File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed
Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -74,17 +74,18 @@ export const groupMultiselect = <Value>(opts: GroupMultiSelectOptions<Value>) =>
7474 const unselectedCheckbox = isItem || selectableGroups ? color . dim ( S_CHECKBOX_INACTIVE ) : '' ;
7575 return `${ spacingPrefix } ${ color . dim ( prefix ) } ${ unselectedCheckbox } ${ color . dim ( label ) } ` ;
7676 } ;
77+ const required = opts . required ?? true ;
7778
7879 return new GroupMultiSelectPrompt ( {
7980 options : opts . options ,
8081 input : opts . input ,
8182 output : opts . output ,
8283 initialValues : opts . initialValues ,
83- required : opts . required ?? true ,
84+ required,
8485 cursorAt : opts . cursorAt ,
8586 selectableGroups,
8687 validate ( selected : Value [ ] | undefined ) {
87- if ( opts . required && ( selected === undefined || selected . length === 0 ) )
88+ if ( required && ( selected === undefined || selected . length === 0 ) )
8889 return `Please select at least one option.\n${ color . reset (
8990 color . dim (
9091 `Press ${ color . gray ( color . bgWhite ( color . inverse ( ' space ' ) ) ) } to select, ${ color . gray (
Original file line number Diff line number Diff line change @@ -49,16 +49,17 @@ export const multiselect = <Value>(opts: MultiSelectOptions<Value>) => {
4949 }
5050 return `${ color . dim ( S_CHECKBOX_INACTIVE ) } ${ color . dim ( label ) } ` ;
5151 } ;
52+ const required = opts . required ?? true ;
5253
5354 return new MultiSelectPrompt ( {
5455 options : opts . options ,
5556 input : opts . input ,
5657 output : opts . output ,
5758 initialValues : opts . initialValues ,
58- required : opts . required ?? true ,
59+ required,
5960 cursorAt : opts . cursorAt ,
6061 validate ( selected : Value [ ] | undefined ) {
61- if ( opts . required && ( selected === undefined || selected . length === 0 ) )
62+ if ( required && ( selected === undefined || selected . length === 0 ) )
6263 return `Please select at least one option.\n${ color . reset (
6364 color . dim (
6465 `Press ${ color . gray ( color . bgWhite ( color . inverse ( ' space ' ) ) ) } to select, ${ color . gray (
Original file line number Diff line number Diff line change 11import { existsSync , lstatSync , readdirSync } from 'node:fs' ;
2- import { join , dirname } from 'node:path' ;
2+ import { dirname , join } from 'node:path' ;
33import { autocomplete } from './autocomplete.js' ;
44import type { CommonOptions } from './common.js' ;
55
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ exports[`autocomplete > shows no matches message when search has no results 1`]
173173 " <cursor.down count=1>" ,
174174 " <erase.down>" ,
175175 " [32m◇[39m Select a fruit
176- [90m│[39m [2mApple [22m" ,
176+ [90m│[39m[2m [22m" ,
177177 "
178178" ,
179179 " <cursor.show>" ,
You can’t perform that action at this time.
0 commit comments