File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -388,6 +388,32 @@ export class OptionListController implements ReactiveController {
388388 this . _host . requestUpdate ( ) ;
389389 }
390390
391+ selectAll ( ) {
392+ if ( ! this . _multiSelect ) {
393+ return ;
394+ }
395+
396+ this . _options . forEach ( ( _ , i ) => {
397+ this . _options [ i ] . selected = true ;
398+ this . _selectedIndexes . add ( i ) ;
399+ } ) ;
400+
401+ this . _host . requestUpdate ( ) ;
402+ }
403+
404+ selectNone ( ) {
405+ if ( ! this . _multiSelect ) {
406+ return ;
407+ }
408+
409+ this . _options . forEach ( ( _ , i ) => {
410+ this . _options [ i ] . selected = false ;
411+ } ) ;
412+ this . _selectedIndexes . clear ( ) ;
413+
414+ this . _host . requestUpdate ( ) ;
415+ }
416+
391417 //#endregion
392418
393419 //#region private functions
Original file line number Diff line number Diff line change @@ -122,6 +122,14 @@ export class VscodeMultiSelect
122122 return this . _internals . reportValidity ( ) ;
123123 }
124124
125+ selectAll ( ) {
126+ this . _opts . selectAll ( ) ;
127+ }
128+
129+ selectNone ( ) {
130+ this . _opts . selectNone ( ) ;
131+ }
132+
125133 private _internals : ElementInternals ;
126134
127135 constructor ( ) {
You can’t perform that action at this time.
0 commit comments