@@ -91,6 +91,18 @@ const exampleVariationsTemplate = `
9191</div>
9292` ;
9393
94+ const exampleClearableTemplate = `
95+ <sui-select class="selection"
96+ [(ngModel)]="selectedOption"
97+ [options]="filters"
98+ [isClearable]="true"
99+ #select>
100+ <sui-select-option *ngFor="let option of select.filteredOptions"
101+ [value]="option">
102+ </sui-select-option>
103+ </sui-select>
104+ ` ;
105+
94106const exampleInMenuSearchTemplate = `
95107<sui-multi-select [(ngModel)]="selected"
96108 [options]="options"
@@ -221,6 +233,12 @@ export class SelectPage {
221233 description : "Sets whether the multi select is searchable." ,
222234 defaultValue : "false"
223235 } ,
236+ {
237+ name : "isСlearable" ,
238+ type : "boolean" ,
239+ description : "Sets whether the select is clearable." ,
240+ defaultValue : "false"
241+ } ,
224242 {
225243 name : "optionFormatter" ,
226244 type : "(result:T, query?:string) => string" ,
@@ -408,6 +426,7 @@ export class SelectPage {
408426 ] ;
409427 public exampleStandardTemplate :string = exampleStandardTemplate ;
410428 public exampleVariationsTemplate :string = exampleVariationsTemplate ;
429+ public exampleClearableTemplate :string = exampleClearableTemplate ;
411430 public exampleInMenuSearchTemplate :string = exampleInMenuSearchTemplate ;
412431 public exampleTemplateTemplate :string = exampleTemplateTemplate ;
413432 public formatterCode :string = `
@@ -468,6 +487,15 @@ export class SelectExampleVariations {
468487 public filters :string [ ] = [ "Important" , "Announcement" , "Discussion" ] ;
469488}
470489
490+ @Component ( {
491+ selector : "example-clearable-select" ,
492+ template : exampleClearableTemplate
493+ } )
494+ export class SelectClearableExample {
495+ public selectedOption :string ;
496+ public filters :string [ ] = [ "Important" , "Announcement" , "Discussion" ] ;
497+ }
498+
471499@Component ( {
472500 selector : "example-select-in-menu-search" ,
473501 template : exampleInMenuSearchTemplate
@@ -520,6 +548,7 @@ export const SelectPageComponents = [
520548
521549 SelectExampleStandard ,
522550 SelectExampleVariations ,
551+ SelectClearableExample ,
523552 SelectExampleInMenuSearch ,
524553 SelectExampleTemplate ,
525554 SelectExampleLookupSearch
0 commit comments