Updating NPM dependencies
This commit is contained in:
24
node_modules/prompts/dist/elements/select.js
generated
vendored
24
node_modules/prompts/dist/elements/select.js
generated
vendored
@@ -48,7 +48,7 @@ class SelectPrompt extends Prompt {
|
||||
});
|
||||
this.optionsPerPage = opts.optionsPerPage || 10;
|
||||
this.value = (this.choices[this.cursor] || {}).value;
|
||||
this.clear = clear('');
|
||||
this.clear = clear('', this.out.columns);
|
||||
this.render();
|
||||
}
|
||||
|
||||
@@ -64,6 +64,10 @@ class SelectPrompt extends Prompt {
|
||||
this.render();
|
||||
}
|
||||
|
||||
exit() {
|
||||
this.abort();
|
||||
}
|
||||
|
||||
abort() {
|
||||
this.done = this.aborted = true;
|
||||
this.fire();
|
||||
@@ -94,14 +98,22 @@ class SelectPrompt extends Prompt {
|
||||
}
|
||||
|
||||
up() {
|
||||
if (this.cursor === 0) return this.bell();
|
||||
this.moveCursor(this.cursor - 1);
|
||||
if (this.cursor === 0) {
|
||||
this.moveCursor(this.choices.length - 1);
|
||||
} else {
|
||||
this.moveCursor(this.cursor - 1);
|
||||
}
|
||||
|
||||
this.render();
|
||||
}
|
||||
|
||||
down() {
|
||||
if (this.cursor === this.choices.length - 1) return this.bell();
|
||||
this.moveCursor(this.cursor + 1);
|
||||
if (this.cursor === this.choices.length - 1) {
|
||||
this.moveCursor(0);
|
||||
} else {
|
||||
this.moveCursor(this.cursor + 1);
|
||||
}
|
||||
|
||||
this.render();
|
||||
}
|
||||
|
||||
@@ -120,7 +132,7 @@ class SelectPrompt extends Prompt {
|
||||
|
||||
render() {
|
||||
if (this.closed) return;
|
||||
if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText));
|
||||
if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));
|
||||
super.render();
|
||||
|
||||
let _entriesToDisplay = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage),
|
||||
|
||||
Reference in New Issue
Block a user