mirror of
https://github.com/actions/labeler.git
synced 2025-12-19 08:38:15 +00:00
build
This commit is contained in:
21
node_modules/prompts/lib/elements/autocompleteMultiselect.js
generated
vendored
21
node_modules/prompts/lib/elements/autocompleteMultiselect.js
generated
vendored
@@ -119,17 +119,23 @@ class AutocompleteMultiselectPrompt extends MultiselectPrompt {
|
||||
this.handleSpaceToggle();
|
||||
} else {
|
||||
this.handleInputChange(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderInstructions() {
|
||||
return `
|
||||
if (this.instructions === undefined || this.instructions) {
|
||||
if (typeof this.instructions === 'string') {
|
||||
return this.instructions;
|
||||
}
|
||||
return `
|
||||
Instructions:
|
||||
${figures.arrowUp}/${figures.arrowDown}: Highlight option
|
||||
${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
|
||||
[a,b,c]/delete: Filter choices
|
||||
enter/return: Complete answer
|
||||
`
|
||||
`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
renderCurrentInput() {
|
||||
@@ -146,13 +152,12 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray('Enter so
|
||||
|
||||
renderDoneOrInstructions() {
|
||||
if (this.done) {
|
||||
const selected = this.value
|
||||
return this.value
|
||||
.filter(e => e.selected)
|
||||
.map(v => v.title)
|
||||
.join(', ');
|
||||
return selected;
|
||||
}
|
||||
|
||||
|
||||
const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];
|
||||
|
||||
if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {
|
||||
@@ -167,14 +172,14 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray('Enter so
|
||||
super.render();
|
||||
|
||||
// print prompt
|
||||
|
||||
|
||||
let prompt = [
|
||||
style.symbol(this.done, this.aborted),
|
||||
color.bold(this.msg),
|
||||
style.delimiter(false),
|
||||
this.renderDoneOrInstructions()
|
||||
].join(' ');
|
||||
|
||||
|
||||
if (this.showMinError) {
|
||||
prompt += color.red(`You must select a minimum of ${this.minSelected} choices.`);
|
||||
this.showMinError = false;
|
||||
|
||||
Reference in New Issue
Block a user