Updating NPM dependencies
This commit is contained in:
22
node_modules/prompts/lib/elements/select.js
generated
vendored
22
node_modules/prompts/lib/elements/select.js
generated
vendored
@@ -36,7 +36,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();
|
||||
}
|
||||
|
||||
@@ -52,6 +52,10 @@ class SelectPrompt extends Prompt {
|
||||
this.render();
|
||||
}
|
||||
|
||||
exit() {
|
||||
this.abort();
|
||||
}
|
||||
|
||||
abort() {
|
||||
this.done = this.aborted = true;
|
||||
this.fire();
|
||||
@@ -83,14 +87,20 @@ 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();
|
||||
}
|
||||
|
||||
@@ -110,7 +120,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));
|
||||
else this.out.write(clear(this.outputText, this.out.columns));
|
||||
super.render();
|
||||
|
||||
let { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage);
|
||||
|
||||
Reference in New Issue
Block a user