@ni/nimble-components 28.3.1 → 29.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -171,7 +171,7 @@ export const styles = css `
171
171
 
172
172
  .indicator {
173
173
  flex: none;
174
- margin-inline-start: 1em;
174
+ margin-left: ${smallPadding};
175
175
  padding-right: 8px;
176
176
  display: flex;
177
177
  justify-content: center;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/patterns/dropdown/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AACzE,OAAO,EACH,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,mBAAmB,EACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,aAAa,CAAC;;;;iBAIX,aAAa;gBACd,QAAQ;kBACN,aAAa;;;UAGrB,cAAc;qBACH,YAAY;;;mDAGkB,WAAW;;;;;;;;uBAQvC,WAAW;;;;yBAIT,gBAAgB;;4BAEb,UAAU;;;;;;;;;YAS1B,YAAY;;;;;+BAKO,SAAS;;;;;;4BAMZ,WAAW;;;;yBAId,gBAAgB;;4BAEb,UAAU;;;;;;;;;;YAU1B,YAAY;;;;;+BAKO,SAAS;;;;;;;;;;;;;;;;;;iCAkBP,qBAAqB;;mBAEnC,WAAW;;;;+BAIC,gBAAgB;;;;;iBAK9B,qBAAqB;6BACT,qBAAqB;;;;;;+BAMnB,SAAS;;;;;;;;;wCASA,YAAY;iEACa,YAAY;sBACvD,mBAAmB;4BACb,gBAAgB;4BAChB,0BAA0B;;;;;;;;;;;;;;;;;;;;0BAoB5B,YAAY;;;;uBAIf,YAAY;;;;;;;;;;;wBAWX,aAAa;;;;iBAIpB,qBAAqB;;;;;;;;;;;;;iBAarB,QAAQ;kBACP,QAAQ;gBACV,aAAa;;;;gBAIb,qBAAqB;;;;;;;;;;;CAWpC,CAAC,aAAa,CACX,kBAAkB,CACd,kBAAkB,CAAC,SAAS,EAC5B,GAAG,CAAA;;uCAE4B,WAAW;;;;;qCAKb,qBAAqB;;SAEjD,CACJ,EACD,kBAAkB,CACd,kBAAkB,CAAC,OAAO,EAC1B,GAAG,CAAA;;gCAEqB,WAAW;;;SAGlC,CACJ,EACD,kBAAkB,CACd,kBAAkB,CAAC,KAAK,EACxB,GAAG,CAAA;;yCAE8B,qBAAqB;;;;uCAIvB,WAAW;;;;;yCAKT,qBAAqB;;SAErD,CACJ,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;8BAEmB,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC;;SAEnD,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport { display } from '@microsoft/fast-foundation';\nimport { White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';\nimport {\n applicationBackgroundColor,\n bodyFont,\n bodyFontColor,\n bodyDisabledFontColor,\n borderHoverColor,\n borderWidth,\n controlHeight,\n iconSize,\n menuMinWidth,\n popupBorderColor,\n smallDelay,\n smallPadding,\n borderRgbPartialColor,\n mediumPadding,\n failColor,\n elevation2BoxShadow\n} from '../../theme-provider/design-tokens';\nimport { Theme } from '../../theme-provider/types';\nimport { appearanceBehavior } from '../../utilities/style/appearance';\nimport { hexToRgbaCssColor } from '../../utilities/style/colors';\nimport { focusVisible } from '../../utilities/style/focus';\nimport { themeBehavior } from '../../utilities/style/theme';\nimport { DropdownAppearance } from './types';\nimport { userSelectNone } from '../../utilities/style/user-select';\n\nexport const styles = css`\n ${display('inline-flex')}\n\n :host {\n box-sizing: border-box;\n color: ${bodyFontColor};\n font: ${bodyFont};\n height: ${controlHeight};\n position: relative;\n justify-content: center;\n ${userSelectNone}\n min-width: ${menuMinWidth};\n outline: none;\n vertical-align: top;\n --ni-private-hover-indicator-width: calc(${borderWidth} + 1px);\n --ni-private-focus-indicator-width: 1px;\n --ni-private-indicator-lines-gap: 1px;\n }\n\n :host::before {\n content: '';\n position: absolute;\n bottom: calc(${borderWidth} + var(--ni-private-indicator-lines-gap));\n width: 0px;\n height: 0px;\n justify-self: center;\n border-bottom: ${borderHoverColor}\n var(--ni-private-focus-indicator-width) solid;\n transition: width ${smallDelay} ease-in;\n }\n\n @media (prefers-reduced-motion) {\n :host::before {\n transition-duration: 0s;\n }\n }\n\n :host(${focusVisible})::before {\n width: calc(100% - 8px);\n }\n\n :host([error-visible]):before {\n border-bottom-color: ${failColor};\n }\n\n :host::after {\n content: '';\n position: absolute;\n bottom: calc(-1 * ${borderWidth});\n width: 0px;\n height: 0px;\n justify-self: center;\n border-bottom: ${borderHoverColor}\n var(--ni-private-hover-indicator-width) solid;\n transition: width ${smallDelay} ease-in;\n }\n\n @media (prefers-reduced-motion) {\n :host::after {\n transition-duration: 0s;\n }\n }\n\n :host(:hover)::after,\n :host(${focusVisible})::after {\n width: 100%;\n }\n\n :host([error-visible]):after {\n border-bottom-color: ${failColor};\n }\n\n :host([disabled]:hover)::after {\n width: 0px;\n }\n\n [part='start'] {\n display: none;\n }\n\n .control {\n align-items: center;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n min-height: 100%;\n width: 100%;\n border: 0px solid rgba(${borderRgbPartialColor}, 0.3);\n background-color: transparent;\n padding: ${borderWidth};\n }\n\n :host([open]:not(:hover)) .control {\n border-bottom-color: ${borderHoverColor};\n }\n\n :host([disabled]) .control {\n cursor: default;\n color: ${bodyDisabledFontColor};\n border-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([error-visible]) .control,\n :host([error-visible][open]) .control,\n :host([error-visible][disabled]) .control {\n border-bottom-color: ${failColor};\n }\n\n .listbox {\n box-sizing: border-box;\n display: inline-flex;\n flex-direction: column;\n overflow-y: auto;\n width: 100%;\n --ni-private-listbox-padding: ${smallPadding};\n max-height: calc(var(--ni-private-select-max-height) - ${smallPadding});\n box-shadow: ${elevation2BoxShadow};\n border: 1px solid ${popupBorderColor};\n background-color: ${applicationBackgroundColor};\n }\n\n .listbox slot {\n display: block;\n background: transparent;\n padding: var(--ni-private-listbox-padding);\n }\n\n :host([open][position='above']) .listbox {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n :host([open][position='below']) .listbox {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n\n :host([open][position='above']) .anchored-region {\n padding-bottom: ${smallPadding};\n }\n\n :host([open][position='below']) .anchored-region {\n padding-top: ${smallPadding};\n }\n\n .selected-value {\n flex: auto;\n font-family: inherit;\n text-align: start;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n padding: 0px;\n padding-left: ${mediumPadding};\n }\n\n .selected-value[disabled]::placeholder {\n color: ${bodyDisabledFontColor};\n }\n\n .indicator {\n flex: none;\n margin-inline-start: 1em;\n padding-right: 8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .indicator slot[name='indicator'] svg {\n width: ${iconSize};\n height: ${iconSize};\n fill: ${bodyFontColor};\n }\n\n :host([disabled]) .indicator slot[name='indicator'] svg {\n fill: ${bodyDisabledFontColor};\n }\n\n [part='end'] {\n margin-inline-start: auto;\n }\n\n ::slotted([role='option']),\n ::slotted(option) {\n flex: none;\n }\n`.withBehaviors(\n appearanceBehavior(\n DropdownAppearance.underline,\n css`\n .control {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n\n :host([disabled]) .control {\n border-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n `\n ),\n appearanceBehavior(\n DropdownAppearance.outline,\n css`\n .control {\n border-width: ${borderWidth};\n padding: 0;\n }\n `\n ),\n appearanceBehavior(\n DropdownAppearance.block,\n css`\n .control {\n background-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n .control:focus-within {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n\n :host([disabled]) .control {\n background-color: rgba(${borderRgbPartialColor}, 0.07);\n }\n `\n ),\n themeBehavior(\n Theme.color,\n css`\n .listbox slot {\n background: ${hexToRgbaCssColor(White, 0.15)};\n }\n `\n )\n);\n"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/patterns/dropdown/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AACzE,OAAO,EACH,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,mBAAmB,EACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,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,GAAG,CAAA;;gCAEqB,WAAW;;;SAGlC,CACJ,EACD,kBAAkB,CACd,kBAAkB,CAAC,KAAK,EACxB,GAAG,CAAA;;yCAE8B,qBAAqB;;;;uCAIvB,WAAW;;;;;yCAKT,qBAAqB;;SAErD,CACJ,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;8BAEmB,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC;;SAEnD,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport { display } from '@microsoft/fast-foundation';\nimport { White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';\nimport {\n applicationBackgroundColor,\n bodyFont,\n bodyFontColor,\n bodyDisabledFontColor,\n borderHoverColor,\n borderWidth,\n controlHeight,\n iconSize,\n menuMinWidth,\n popupBorderColor,\n smallDelay,\n smallPadding,\n borderRgbPartialColor,\n mediumPadding,\n failColor,\n elevation2BoxShadow\n} from '../../theme-provider/design-tokens';\nimport { Theme } from '../../theme-provider/types';\nimport { appearanceBehavior } from '../../utilities/style/appearance';\nimport { hexToRgbaCssColor } from '../../utilities/style/colors';\nimport { focusVisible } from '../../utilities/style/focus';\nimport { themeBehavior } from '../../utilities/style/theme';\nimport { DropdownAppearance } from './types';\nimport { userSelectNone } from '../../utilities/style/user-select';\n\nexport const styles = css`\n ${display('inline-flex')}\n\n :host {\n box-sizing: border-box;\n color: ${bodyFontColor};\n font: ${bodyFont};\n height: ${controlHeight};\n position: relative;\n justify-content: center;\n ${userSelectNone}\n min-width: ${menuMinWidth};\n outline: none;\n vertical-align: top;\n --ni-private-hover-indicator-width: calc(${borderWidth} + 1px);\n --ni-private-focus-indicator-width: 1px;\n --ni-private-indicator-lines-gap: 1px;\n }\n\n :host::before {\n content: '';\n position: absolute;\n bottom: calc(${borderWidth} + var(--ni-private-indicator-lines-gap));\n width: 0px;\n height: 0px;\n justify-self: center;\n border-bottom: ${borderHoverColor}\n var(--ni-private-focus-indicator-width) solid;\n transition: width ${smallDelay} ease-in;\n }\n\n @media (prefers-reduced-motion) {\n :host::before {\n transition-duration: 0s;\n }\n }\n\n :host(${focusVisible})::before {\n width: calc(100% - 8px);\n }\n\n :host([error-visible]):before {\n border-bottom-color: ${failColor};\n }\n\n :host::after {\n content: '';\n position: absolute;\n bottom: calc(-1 * ${borderWidth});\n width: 0px;\n height: 0px;\n justify-self: center;\n border-bottom: ${borderHoverColor}\n var(--ni-private-hover-indicator-width) solid;\n transition: width ${smallDelay} ease-in;\n }\n\n @media (prefers-reduced-motion) {\n :host::after {\n transition-duration: 0s;\n }\n }\n\n :host(:hover)::after,\n :host(${focusVisible})::after {\n width: 100%;\n }\n\n :host([error-visible]):after {\n border-bottom-color: ${failColor};\n }\n\n :host([disabled]:hover)::after {\n width: 0px;\n }\n\n [part='start'] {\n display: none;\n }\n\n .control {\n align-items: center;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n min-height: 100%;\n width: 100%;\n border: 0px solid rgba(${borderRgbPartialColor}, 0.3);\n background-color: transparent;\n padding: ${borderWidth};\n }\n\n :host([open]:not(:hover)) .control {\n border-bottom-color: ${borderHoverColor};\n }\n\n :host([disabled]) .control {\n cursor: default;\n color: ${bodyDisabledFontColor};\n border-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([error-visible]) .control,\n :host([error-visible][open]) .control,\n :host([error-visible][disabled]) .control {\n border-bottom-color: ${failColor};\n }\n\n .listbox {\n box-sizing: border-box;\n display: inline-flex;\n flex-direction: column;\n overflow-y: auto;\n width: 100%;\n --ni-private-listbox-padding: ${smallPadding};\n max-height: calc(var(--ni-private-select-max-height) - ${smallPadding});\n box-shadow: ${elevation2BoxShadow};\n border: 1px solid ${popupBorderColor};\n background-color: ${applicationBackgroundColor};\n }\n\n .listbox slot {\n display: block;\n background: transparent;\n padding: var(--ni-private-listbox-padding);\n }\n\n :host([open][position='above']) .listbox {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n :host([open][position='below']) .listbox {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n\n :host([open][position='above']) .anchored-region {\n padding-bottom: ${smallPadding};\n }\n\n :host([open][position='below']) .anchored-region {\n padding-top: ${smallPadding};\n }\n\n .selected-value {\n flex: auto;\n font-family: inherit;\n text-align: start;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n padding: 0px;\n padding-left: ${mediumPadding};\n }\n\n .selected-value[disabled]::placeholder {\n color: ${bodyDisabledFontColor};\n }\n\n .indicator {\n flex: none;\n margin-left: ${smallPadding};\n padding-right: 8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .indicator slot[name='indicator'] svg {\n width: ${iconSize};\n height: ${iconSize};\n fill: ${bodyFontColor};\n }\n\n :host([disabled]) .indicator slot[name='indicator'] svg {\n fill: ${bodyDisabledFontColor};\n }\n\n [part='end'] {\n margin-inline-start: auto;\n }\n\n ::slotted([role='option']),\n ::slotted(option) {\n flex: none;\n }\n`.withBehaviors(\n appearanceBehavior(\n DropdownAppearance.underline,\n css`\n .control {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n\n :host([disabled]) .control {\n border-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n `\n ),\n appearanceBehavior(\n DropdownAppearance.outline,\n css`\n .control {\n border-width: ${borderWidth};\n padding: 0;\n }\n `\n ),\n appearanceBehavior(\n DropdownAppearance.block,\n css`\n .control {\n background-color: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n .control:focus-within {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n\n :host([disabled]) .control {\n background-color: rgba(${borderRgbPartialColor}, 0.07);\n }\n `\n ),\n themeBehavior(\n Theme.color,\n css`\n .listbox slot {\n background: ${hexToRgbaCssColor(White, 0.15)};\n }\n `\n )\n);\n"]}
@@ -31,6 +31,7 @@ export declare class Select extends FormAssociatedSelect implements ErrorPattern
31
31
  errorText: string | undefined;
32
32
  errorVisible: boolean;
33
33
  filterMode: FilterMode;
34
+ clearable: boolean;
34
35
  /**
35
36
  * @internal
36
37
  */
@@ -85,10 +86,6 @@ export declare class Select extends FormAssociatedSelect implements ErrorPattern
85
86
  * @internal
86
87
  */
87
88
  filter: string;
88
- /**
89
- * @internal
90
- */
91
- committedSelectedOption?: ListboxOption;
92
89
  /**
93
90
  * The max height for the listbox when opened.
94
91
  *
@@ -167,7 +164,7 @@ export declare class Select extends FormAssociatedSelect implements ErrorPattern
167
164
  /**
168
165
  * @internal
169
166
  */
170
- changeValueHandler(): void;
167
+ clearClickHandler(e: MouseEvent): void;
171
168
  /**
172
169
  * @internal
173
170
  */
@@ -272,7 +269,7 @@ export declare class Select extends FormAssociatedSelect implements ErrorPattern
272
269
  protected setDefaultSelectedOption(): void;
273
270
  private setActiveOption;
274
271
  private focusAndScrollActiveOptionIntoView;
275
- private committedSelectedOptionChanged;
272
+ private getPlaceholderOption;
276
273
  private setPositioning;
277
274
  /**
278
275
  * Filter available options by text value.
@@ -288,6 +285,7 @@ export declare class Select extends FormAssociatedSelect implements ErrorPattern
288
285
  * @internal
289
286
  */
290
287
  private updateValue;
288
+ private clearSelect;
291
289
  /**
292
290
  * Resets and fills the proxy to match the component's options.
293
291
  *
@@ -19,6 +19,9 @@ const isNimbleListOption = (el) => {
19
19
  const isOptionSelectable = (el) => {
20
20
  return !el.visuallyHidden && !el.disabled && !el.hidden;
21
21
  };
22
+ const isOptionPlaceholder = (el) => {
23
+ return el.disabled && el.hidden;
24
+ };
22
25
  /**
23
26
  * A nimble-styled HTML select.
24
27
  */
@@ -28,6 +31,7 @@ export class Select extends FormAssociatedSelect {
28
31
  this.appearance = DropdownAppearance.underline;
29
32
  this.errorVisible = false;
30
33
  this.filterMode = FilterMode.none;
34
+ this.clearable = false;
31
35
  /**
32
36
  * @internal
33
37
  */
@@ -100,13 +104,8 @@ export class Select extends FormAssociatedSelect {
100
104
  if (prev !== newValue && !(this.open && this.selectedIndex < 0)) {
101
105
  this._value = newValue;
102
106
  super.valueChanged(prev, newValue);
103
- if (!this.open) {
104
- this.committedSelectedOption = this.options.find(o => o.value === newValue);
105
- }
106
107
  Observable.notify(this, 'value');
107
- if (this.collapsible) {
108
- Observable.notify(this, 'displayValue');
109
- }
108
+ this.updateDisplayValue();
110
109
  }
111
110
  }
112
111
  /**
@@ -114,7 +113,7 @@ export class Select extends FormAssociatedSelect {
114
113
  */
115
114
  get displayValue() {
116
115
  Observable.track(this, 'displayValue');
117
- return this.committedSelectedOption?.text ?? '';
116
+ return this.firstSelectedOption?.text ?? '';
118
117
  }
119
118
  /**
120
119
  * @internal
@@ -158,7 +157,6 @@ export class Select extends FormAssociatedSelect {
158
157
  if (value) {
159
158
  this.value = value;
160
159
  }
161
- this.committedSelectedOption = this.options[this.selectedIndex];
162
160
  }
163
161
  /**
164
162
  * @internal
@@ -203,11 +201,13 @@ export class Select extends FormAssociatedSelect {
203
201
  break;
204
202
  }
205
203
  case 'selected': {
206
- if (isNimbleListOption(sourceElement)) {
204
+ if (isNimbleListOption(sourceElement)
205
+ && sourceElement.selected) {
207
206
  this.selectedIndex = this.options.indexOf(sourceElement);
208
207
  }
209
- this.setSelectedOptions();
210
- this.updateDisplayValue();
208
+ else {
209
+ this.clearSelect();
210
+ }
211
211
  break;
212
212
  }
213
213
  case 'hidden': {
@@ -266,24 +266,25 @@ export class Select extends FormAssociatedSelect {
266
266
  /**
267
267
  * @internal
268
268
  */
269
- changeValueHandler() {
270
- this.committedSelectedOption = this.options.find(option => option.selected);
269
+ clearClickHandler(e) {
270
+ this.open = false;
271
+ this.clearSelect();
272
+ this.updateValue(true);
273
+ e.stopPropagation();
271
274
  }
272
275
  /**
273
276
  * @internal
274
277
  */
275
278
  updateDisplayValue() {
276
- if (this.committedSelectedOption?.disabled
277
- && this.committedSelectedOption?.hidden
278
- && this.committedSelectedOption?.selected) {
279
+ const placeholderOption = this.getPlaceholderOption();
280
+ if (placeholderOption
281
+ && this.firstSelectedOption === placeholderOption) {
279
282
  this.displayPlaceholder = true;
280
283
  }
281
284
  else {
282
285
  this.displayPlaceholder = false;
283
286
  }
284
- if (this.collapsible) {
285
- Observable.notify(this, 'displayValue');
286
- }
287
+ Observable.notify(this, 'displayValue');
287
288
  }
288
289
  /**
289
290
  * Handle content changes on the control input.
@@ -373,6 +374,11 @@ export class Select extends FormAssociatedSelect {
373
374
  }
374
375
  case keyEscape: {
375
376
  if (!this.open) {
377
+ if (this.clearable) {
378
+ this.clearSelect();
379
+ this.updateValue(true);
380
+ return true;
381
+ }
376
382
  break;
377
383
  }
378
384
  if (this.collapsible && this.open) {
@@ -520,10 +526,10 @@ export class Select extends FormAssociatedSelect {
520
526
  // for more info.
521
527
  this.options.push(option);
522
528
  }
523
- // Prevents parent classes from resetting selectedIndex to a positive
524
- // value while filtering, which can result in a disabled option being
525
- // selected.
526
529
  setSelectedOptions() {
530
+ // Prevents parent classes from resetting selectedIndex to a positive
531
+ // value while filtering, which can result in a disabled option being
532
+ // selected.
527
533
  if (this.open && this.selectedIndex === -1) {
528
534
  return;
529
535
  }
@@ -619,12 +625,17 @@ export class Select extends FormAssociatedSelect {
619
625
  };
620
626
  let selectedIndex = -1;
621
627
  let firstValidOptionIndex = -1;
628
+ let placeholderIndex = -1;
622
629
  for (let i = 0; i < options?.length; i++) {
623
630
  const option = options[i];
624
- if (optionIsSelected(option) || option?.value === this.value) {
631
+ if (optionIsSelected(option) || option.value === this.value) {
625
632
  selectedIndex = i;
633
+ break;
626
634
  }
627
- if (firstValidOptionIndex === -1
635
+ else if (placeholderIndex === -1 && isOptionPlaceholder(option)) {
636
+ placeholderIndex = i;
637
+ }
638
+ else if (firstValidOptionIndex === -1
628
639
  && isOptionSelectable(option)) {
629
640
  firstValidOptionIndex = i;
630
641
  }
@@ -632,13 +643,15 @@ export class Select extends FormAssociatedSelect {
632
643
  if (selectedIndex !== -1) {
633
644
  this.selectedIndex = selectedIndex;
634
645
  }
646
+ else if (placeholderIndex !== -1) {
647
+ this.selectedIndex = placeholderIndex;
648
+ }
635
649
  else if (firstValidOptionIndex !== -1) {
636
650
  this.selectedIndex = firstValidOptionIndex;
637
651
  }
638
652
  else {
639
653
  this.selectedIndex = 0;
640
654
  }
641
- this.committedSelectedOption = options[this.selectedIndex];
642
655
  }
643
656
  setActiveOption(newActiveIndex) {
644
657
  const activeOption = this.options[newActiveIndex];
@@ -674,8 +687,8 @@ export class Select extends FormAssociatedSelect {
674
687
  });
675
688
  }
676
689
  }
677
- committedSelectedOptionChanged() {
678
- this.updateDisplayValue();
690
+ getPlaceholderOption() {
691
+ return this.options.find(o => o.hidden && o.disabled);
679
692
  }
680
693
  setPositioning() {
681
694
  if (!this.$fastController.isConnected) {
@@ -750,6 +763,12 @@ export class Select extends FormAssociatedSelect {
750
763
  });
751
764
  }
752
765
  }
766
+ clearSelect() {
767
+ const placeholder = this.getPlaceholderOption();
768
+ this.selectedIndex = placeholder
769
+ ? this.options.indexOf(placeholder)
770
+ : -1;
771
+ }
753
772
  /**
754
773
  * Resets and fills the proxy to match the component's options.
755
774
  *
@@ -776,7 +795,6 @@ export class Select extends FormAssociatedSelect {
776
795
  this.updateListboxMaxHeightCssVariable();
777
796
  }
778
797
  initializeOpenState() {
779
- this.committedSelectedOption = this.options[this.selectedIndex];
780
798
  this.setActiveOption(this.selectedIndex);
781
799
  this.ariaControls = this.listboxId;
782
800
  this.ariaExpanded = 'true';
@@ -804,6 +822,9 @@ __decorate([
804
822
  __decorate([
805
823
  attr({ attribute: 'filter-mode' })
806
824
  ], Select.prototype, "filterMode", void 0);
825
+ __decorate([
826
+ attr({ attribute: 'clearable', mode: 'boolean' })
827
+ ], Select.prototype, "clearable", void 0);
807
828
  __decorate([
808
829
  observable
809
830
  ], Select.prototype, "displayPlaceholder", void 0);
@@ -834,9 +855,6 @@ __decorate([
834
855
  __decorate([
835
856
  observable
836
857
  ], Select.prototype, "filter", void 0);
837
- __decorate([
838
- observable
839
- ], Select.prototype, "committedSelectedOption", void 0);
840
858
  __decorate([
841
859
  observable
842
860
  ], Select.prototype, "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oC;AAQxC;IADN,UAAU;yCACU;AAQrB;IADC,QAAQ;yCAGR;AA+DD;IADC,QAAQ;0CAIR;AA2yBL,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAgB;IAC/C,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,gBAAgB;IAC3B,QAAQ;IACR,MAAM;IACN,SAAS,EAAE,sBAAsB,CAAC,IAAI;IACtC,GAAG,EAAE,IAAI,CAAQ;WACV,sBAAsB;;;aAGpB,sBAAsB;UACzB,iBAAiB;KACtB;CACJ,CAAC,CAAC;AAEH,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AACnD,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["// Based on: https://github.com/microsoft/fast/blob/%40microsoft/fast-foundation_v2.49.5/packages/web-components/fast-foundation/src/select/select.ts\nimport {\n attr,\n html,\n observable,\n Observable,\n volatile\n} from '@microsoft/fast-element';\nimport {\n AnchoredRegion,\n DesignSystem,\n Select as FoundationSelect,\n ListboxOption,\n SelectOptions,\n SelectPosition,\n applyMixins,\n StartEnd,\n DelegatesARIASelect\n} from '@microsoft/fast-foundation';\nimport {\n findLastIndex,\n keyArrowDown,\n keyArrowUp,\n keyEnd,\n keyEnter,\n keyEscape,\n keyHome,\n keySpace,\n uniqueId\n} from '@microsoft/fast-web-utilities';\nimport { arrowExpanderDown16X16 } from '@ni/nimble-tokens/dist/icons/js';\nimport { styles } from './styles';\nimport {\n DropdownAppearance,\n ListOptionOwner\n} from '../patterns/dropdown/types';\nimport { errorTextTemplate } from '../patterns/error/template';\nimport type { ErrorPattern } from '../patterns/error/types';\nimport { iconExclamationMarkTag } from '../icons/exclamation-mark';\nimport { template } from './template';\nimport { ListOption } from '../list-option';\nimport { FilterMode } from './types';\nimport { diacriticInsensitiveStringNormalizer } from '../utilities/models/string-normalizers';\nimport { FormAssociatedSelect } from './models/select-form-associated';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-select': Select;\n }\n}\n\n// Used in overrides of base class methods\n// eslint-disable-next-line @typescript-eslint/no-invalid-void-type\ntype BooleanOrVoid = boolean | void;\n\nconst isNimbleListOption = (el: Element | undefined): el is ListOption => {\n return el instanceof ListOption;\n};\n\nconst isOptionSelectable = (el: ListOption): boolean => {\n return !el.visuallyHidden && !el.disabled && !el.hidden;\n};\n\n/**\n * A nimble-styled HTML select.\n */\nexport class Select\n extends FormAssociatedSelect\n implements ErrorPattern, ListOptionOwner {\n @attr\n public appearance: DropdownAppearance = DropdownAppearance.underline;\n\n /**\n * Reflects the placement for the listbox when the select is open.\n *\n * @public\n */\n @attr({ attribute: 'position' })\n public positionAttribute?: SelectPosition;\n\n /**\n * A message explaining why the value is invalid.\n *\n * @public\n * @remarks\n * HTML Attribute: error-text\n */\n @attr({ attribute: 'error-text' })\n public errorText: string | undefined;\n\n @attr({ attribute: 'error-visible', mode: 'boolean' })\n public errorVisible = false;\n\n @attr({ attribute: 'filter-mode' })\n public filterMode: FilterMode = FilterMode.none;\n\n /**\n * @internal\n */\n @observable\n public displayPlaceholder = false;\n\n /**\n * @internal\n */\n @attr({ attribute: 'open', mode: 'boolean' })\n public open = false;\n\n /**\n * Holds the current state for the calculated position of the listbox.\n *\n * @public\n */\n @observable\n public position?: SelectPosition;\n\n /**\n * The ref to the internal `.control` element.\n *\n * @internal\n */\n @observable\n public control!: HTMLElement;\n\n /**\n * Reference to the internal listbox element.\n *\n * @internal\n */\n public listbox!: HTMLDivElement;\n\n /**\n * The unique id for the internal listbox element.\n *\n * @internal\n */\n public listboxId: string = uniqueId('listbox-');\n\n /**\n * @internal\n */\n @observable\n public scrollableRegion!: HTMLElement;\n\n /**\n * @internal\n */\n @observable\n public filterInput?: HTMLInputElement;\n\n /**\n * @internal\n */\n @observable\n public anchoredRegion!: AnchoredRegion;\n\n /** @internal */\n @observable\n public hasOverflow = false;\n\n /**\n * @internal\n */\n @observable\n public filteredOptions: ListboxOption[] = [];\n\n /**\n * @internal\n */\n @observable\n public filter = '';\n\n /**\n * @internal\n */\n @observable\n public committedSelectedOption?: ListboxOption;\n\n /**\n * The max height for the listbox when opened.\n *\n * @internal\n */\n @observable\n public maxHeight = 0;\n\n /**\n * The component is collapsible when in single-selection mode with no size attribute.\n *\n * @internal\n */\n @volatile\n public get collapsible(): boolean {\n return !(this.multiple || typeof this.size === 'number');\n }\n\n private _value = '';\n private forcedPosition = false;\n private openActiveIndex?: number;\n\n /**\n * @internal\n */\n public override connectedCallback(): void {\n super.connectedCallback();\n this.forcedPosition = !!this.positionAttribute;\n if (this.open) {\n this.initializeOpenState();\n }\n }\n\n public override get value(): string {\n Observable.track(this, 'value');\n return this._value;\n }\n\n public override set value(next: string) {\n const prev = this._value;\n let newValue = next;\n\n if (this.options?.length) {\n const newValueIndex = this.options.findIndex(\n el => el.value === newValue\n );\n const prevSelectedValue = this.options[this.selectedIndex]?.value ?? null;\n const nextSelectedValue = this.options[newValueIndex]?.value ?? null;\n\n if (\n newValueIndex === -1\n || prevSelectedValue !== nextSelectedValue\n ) {\n newValue = '';\n this.selectedIndex = newValueIndex;\n }\n\n newValue = this.firstSelectedOption?.value ?? newValue;\n }\n\n if (prev !== newValue && !(this.open && this.selectedIndex < 0)) {\n this._value = newValue;\n super.valueChanged(prev, newValue);\n if (!this.open) {\n this.committedSelectedOption = this.options.find(\n o => o.value === newValue\n );\n }\n Observable.notify(this, 'value');\n if (this.collapsible) {\n Observable.notify(this, 'displayValue');\n }\n }\n }\n\n /**\n * @internal\n */\n @volatile\n public get displayValue(): string {\n Observable.track(this, 'displayValue');\n return this.committedSelectedOption?.text ?? '';\n }\n\n /**\n * @internal\n */\n public anchoredRegionChanged(\n _prev: AnchoredRegion | undefined,\n _next: AnchoredRegion | undefined\n ): void {\n if (this.anchoredRegion && this.control) {\n this.anchoredRegion.anchorElement = this.control;\n }\n }\n\n /**\n * @internal\n */\n public controlChanged(\n _prev: HTMLElement | undefined,\n _next: HTMLElement | undefined\n ): void {\n if (this.anchoredRegion && this.control) {\n this.anchoredRegion.anchorElement = this.control;\n }\n }\n\n /**\n * @internal\n */\n public override slottedOptionsChanged(\n prev: Element[],\n next: Element[]\n ): void {\n const value = this.value;\n this.options.forEach(o => {\n const notifier = Observable.getNotifier(o);\n notifier.unsubscribe(this, 'value');\n notifier.unsubscribe(this, 'hidden');\n notifier.unsubscribe(this, 'disabled');\n });\n\n super.slottedOptionsChanged(prev, next);\n\n this.options.forEach(o => {\n const notifier = Observable.getNotifier(o);\n notifier.subscribe(this, 'value');\n notifier.subscribe(this, 'hidden');\n notifier.subscribe(this, 'disabled');\n });\n this.setProxyOptions();\n this.updateValue();\n // We need to force an update to the filteredOptions observable\n // (by calling 'filterOptions()) so that the template correctly updates.\n this.filterOptions();\n if (value) {\n this.value = value;\n }\n this.committedSelectedOption = this.options[this.selectedIndex];\n }\n\n /**\n * @internal\n */\n public override clickHandler(e: MouseEvent): BooleanOrVoid {\n // do nothing if the select is disabled\n if (this.disabled) {\n return;\n }\n\n let optionClicked = false;\n if (this.open) {\n const captured = (e.target as HTMLElement).closest<ListOption>(\n 'option,[role=option]'\n );\n optionClicked = captured !== null;\n\n if (captured?.disabled) {\n return;\n }\n }\n\n const previousSelectedIndex = this.selectedIndex;\n super.clickHandler(e);\n\n this.open = this.collapsible && !this.open;\n if (\n !this.open\n && this.selectedIndex !== previousSelectedIndex\n && optionClicked\n ) {\n this.updateValue(true);\n }\n }\n\n /**\n * Updates the value when an option's value changes.\n *\n * @param source - the source object\n * @param propertyName - the property to evaluate\n *\n * @internal\n * @override\n */\n public override handleChange(source: unknown, propertyName: string): void {\n // don't call super.handleChange so hidden options can be selected programmatically\n const sourceElement = source as Element;\n switch (propertyName) {\n case 'value': {\n this.updateValue();\n break;\n }\n case 'selected': {\n if (isNimbleListOption(sourceElement)) {\n this.selectedIndex = this.options.indexOf(sourceElement);\n }\n this.setSelectedOptions();\n this.updateDisplayValue();\n break;\n }\n case 'hidden': {\n if (isNimbleListOption(sourceElement)) {\n sourceElement.visuallyHidden = sourceElement.hidden;\n }\n this.updateDisplayValue();\n break;\n }\n case 'disabled': {\n this.updateDisplayValue();\n break;\n }\n default:\n break;\n }\n }\n\n /**\n * Prevents focus when size is set and a scrollbar is clicked.\n *\n * @param e - the mouse event object\n *\n * @override\n * @internal\n */\n public override mousedownHandler(e: MouseEvent): BooleanOrVoid {\n if (e.offsetX >= 0 && e.offsetX <= this.listbox?.scrollWidth) {\n return super.mousedownHandler(e);\n }\n\n return this.collapsible;\n }\n\n /**\n * @internal\n */\n public regionLoadedHandler(): void {\n this.focusAndScrollOptionIntoView();\n }\n\n /**\n * Sets the multiple property on the proxy element.\n *\n * @param prev - the previous multiple value\n * @param next - the current multiple value\n */\n public override multipleChanged(\n prev: boolean | undefined,\n next: boolean\n ): void {\n super.multipleChanged(prev, next);\n\n if (this.proxy) {\n this.proxy.multiple = next;\n }\n }\n\n /**\n * @internal\n */\n public inputClickHandler(e: MouseEvent): void {\n e.stopPropagation(); // clicking in filter input shouldn't close dropdown\n }\n\n /**\n * @internal\n */\n public changeValueHandler(): void {\n this.committedSelectedOption = this.options.find(\n option => option.selected\n );\n }\n\n /**\n * @internal\n */\n public updateDisplayValue(): void {\n if (\n this.committedSelectedOption?.disabled\n && this.committedSelectedOption?.hidden\n && this.committedSelectedOption?.selected\n ) {\n this.displayPlaceholder = true;\n } else {\n this.displayPlaceholder = false;\n }\n\n if (this.collapsible) {\n Observable.notify(this, 'displayValue');\n }\n }\n\n /**\n * Handle content changes on the control input.\n *\n * @param e - the input event\n * @internal\n */\n public inputHandler(e: InputEvent): boolean {\n this.filter = this.filterInput?.value ?? '';\n this.filterOptions();\n\n const enabledOptions = this.filteredOptions.filter(o => !o.disabled);\n let activeOptionIndex = this.filter !== ''\n ? this.openActiveIndex ?? this.selectedIndex\n : this.selectedIndex;\n\n if (\n enabledOptions.length > 0\n && !enabledOptions.find(o => o === this.options[activeOptionIndex])\n ) {\n activeOptionIndex = this.options.indexOf(enabledOptions[0]!);\n } else if (enabledOptions.length === 0) {\n activeOptionIndex = -1;\n }\n this.setActiveOption(activeOptionIndex);\n\n if (e.inputType.includes('deleteContent') || !this.filter.length) {\n return true;\n }\n\n e.stopPropagation();\n return true;\n }\n\n /**\n * @internal\n */\n public override focusoutHandler(e: FocusEvent): BooleanOrVoid {\n super.focusoutHandler(e);\n if (!this.open) {\n return true;\n }\n\n this.open = false;\n const focusTarget = e.relatedTarget as HTMLElement;\n if (this.isSameNode(focusTarget)) {\n this.focus();\n return true;\n }\n\n return true;\n }\n\n /**\n * @internal\n */\n public override keydownHandler(e: KeyboardEvent): BooleanOrVoid {\n const initialSelectedIndex = this.selectedIndex;\n super.keydownHandler(e);\n const key = e.key;\n if (e.ctrlKey || e.shiftKey) {\n return true;\n }\n\n let currentActiveIndex = this.openActiveIndex ?? this.selectedIndex;\n switch (key) {\n case keySpace: {\n // when dropdown is open allow user to enter a space for filter text\n if (this.open && this.filterMode !== FilterMode.none) {\n break;\n }\n\n e.preventDefault();\n if (this.collapsible && this.typeAheadExpired) {\n this.open = !this.open;\n }\n if (!this.open) {\n this.focus();\n }\n break;\n }\n case keyHome:\n case keyEnd: {\n e.preventDefault();\n break;\n }\n case keyEnter: {\n e.preventDefault();\n if (\n this.filteredOptions.length === 0\n || this.filteredOptions.every(o => o.disabled)\n ) {\n return false;\n }\n this.open = !this.open;\n if (!this.open) {\n this.focus();\n }\n break;\n }\n case keyEscape: {\n if (!this.open) {\n break;\n }\n\n if (this.collapsible && this.open) {\n e.preventDefault();\n this.open = false;\n }\n\n currentActiveIndex = this.selectedIndex;\n this.focus();\n break;\n }\n\n default: {\n break;\n }\n }\n\n if (!this.open && this.selectedIndex !== currentActiveIndex) {\n this.selectedIndex = currentActiveIndex;\n }\n\n if (!this.open && initialSelectedIndex !== this.selectedIndex) {\n this.updateValue(true);\n }\n\n return !(key === keyArrowDown || key === keyArrowUp);\n }\n\n /**\n * Updates the proxy value when the selected index changes.\n *\n * @param prev - the previous selected index\n * @param next - the next selected index\n *\n * @internal\n */\n public override selectedIndexChanged(\n _: number | undefined,\n __: number\n ): void {\n // Don't call super.selectedIndexChanged as this will disallow disabled options\n // from being valid initial selected values. Our setDefaultSelectedOption\n // implementation handles skipping non-selected disabled options for the initial\n // selected value.\n this.setSelectedOptions();\n if (this.open) {\n this.setActiveOption(this.selectedIndex);\n }\n this.updateValue();\n }\n\n /**\n * @internal\n * Fork of Listbox implementation, so that the selectedIndex is not changed while the dropdown\n * is open.\n */\n public override typeaheadBufferChanged(_: string, __: string): void {\n if (this.$fastController.isConnected) {\n const typeaheadMatches = this.getTypeaheadMatches();\n\n if (typeaheadMatches.length) {\n const activeOptionIndex = this.options.indexOf(\n typeaheadMatches[0] as ListOption\n );\n if (!(this.open && this.filterMode !== FilterMode.none)) {\n this.setActiveOption(activeOptionIndex);\n }\n }\n\n this.typeaheadExpired = false;\n }\n }\n\n /**\n * Synchronize the `aria-disabled` property when the `disabled` property changes.\n *\n * @param prev - The previous disabled value\n * @param next - The next disabled value\n *\n * @internal\n */\n public override disabledChanged(prev: boolean, next: boolean): void {\n if (super.disabledChanged) {\n super.disabledChanged(prev, next);\n }\n this.ariaDisabled = this.disabled ? 'true' : 'false';\n }\n\n /**\n * Reset the element to its first selectable option when its parent form is reset.\n *\n * @internal\n */\n public override formResetCallback(): void {\n this.setProxyOptions();\n // Call the base class's implementation setDefaultSelectedOption instead of the select's\n // override, in order to reset the selectedIndex without using the value property.\n super.setDefaultSelectedOption();\n if (this.selectedIndex === -1) {\n this.selectedIndex = 0;\n }\n }\n\n /**\n * @internal\n */\n public override selectNextOption(): void {\n // don't call super.selectNextOption as that relies on side-effecty\n // behavior to not select disabled option (which no longer works)\n const startIndex = this.openActiveIndex ?? this.selectedIndex;\n for (let i = startIndex + 1; i < this.options.length; i++) {\n const listOption = this.options[i]!;\n if (\n isNimbleListOption(listOption)\n && isOptionSelectable(listOption)\n ) {\n this.setActiveOption(i);\n break;\n }\n }\n }\n\n /**\n * @internal\n */\n public override selectPreviousOption(): void {\n // don't call super.selectPreviousOption as that relies on side-effecty\n // behavior to not select disabled option (which no longer works)\n const startIndex = this.openActiveIndex ?? this.selectedIndex;\n for (let i = startIndex - 1; i >= 0; i--) {\n const listOption = this.options[i]!;\n if (\n isNimbleListOption(listOption)\n && isOptionSelectable(listOption)\n ) {\n this.setActiveOption(i);\n break;\n }\n }\n }\n\n /**\n * @internal\n */\n public override selectFirstOption(): void {\n const newActiveOptionIndex = this.options.findIndex(\n o => isNimbleListOption(o) && isOptionSelectable(o)\n );\n this.setActiveOption(newActiveOptionIndex);\n }\n\n /**\n * @internal\n */\n public override selectLastOption(): void {\n const newActiveOptionIndex = findLastIndex(\n this.options,\n o => isNimbleListOption(o) && isOptionSelectable(o)\n );\n this.setActiveOption(newActiveOptionIndex);\n }\n\n /**\n * @internal\n */\n public registerOption(option: ListOption): void {\n if (this.options.includes(option)) {\n return;\n }\n\n // Adding an option to the end, ultimately, isn't the correct\n // thing to do, as this will mean the option's index in the options,\n // at least temporarily, does not match the DOM order. However, it\n // is expected that a successive run of `slottedOptionsChanged` will\n // correct this order issue. See 'https://github.com/ni/nimble/issues/1915'\n // for more info.\n this.options.push(option);\n }\n\n // Prevents parent classes from resetting selectedIndex to a positive\n // value while filtering, which can result in a disabled option being\n // selected.\n protected override setSelectedOptions(): void {\n if (this.open && this.selectedIndex === -1) {\n return;\n }\n super.setSelectedOptions();\n }\n\n protected override focusAndScrollOptionIntoView(): void {\n if (this.open) {\n super.focusAndScrollOptionIntoView();\n window.requestAnimationFrame(() => {\n this.filterInput?.focus();\n });\n }\n }\n\n protected override getTypeaheadMatches(): ListboxOption[] {\n const matches = super.getTypeaheadMatches();\n // Don't allow placeholder to be matched\n return matches.filter(o => !o.hidden && !o.disabled);\n }\n\n protected positionChanged(\n _: SelectPosition | undefined,\n next: SelectPosition | undefined\n ): void {\n this.positionAttribute = next;\n this.setPositioning();\n }\n\n /**\n * Updates the proxy's size property when the size attribute changes.\n *\n * @param prev - the previous size\n * @param next - the current size\n *\n * @override\n * @internal\n */\n protected override sizeChanged(\n prev: number | undefined,\n next: number\n ): void {\n super.sizeChanged(prev, next);\n\n if (this.proxy) {\n this.proxy.size = next;\n }\n }\n\n protected openChanged(): void {\n if (!this.collapsible) {\n return;\n }\n\n if (this.open) {\n this.initializeOpenState();\n return;\n }\n\n const activeOption = this.options[this.openActiveIndex ?? this.selectedIndex];\n if (isNimbleListOption(activeOption)) {\n activeOption.activeOption = false;\n }\n this.openActiveIndex = undefined;\n this.filter = '';\n if (this.filterInput) {\n this.filterInput.value = '';\n }\n\n this.ariaControls = '';\n this.ariaExpanded = 'false';\n }\n\n /**\n * Updates the selectedness of each option when the list of selected options changes.\n *\n * @param prev - the previous list of selected options\n * @param next - the current list of selected options\n *\n * @override\n * @internal\n */\n protected override selectedOptionsChanged(\n _prev: ListboxOption[] | undefined,\n next: ListboxOption[]\n ): void {\n // don't call super.selectedOptionsChanged so we don't filter out hidden elements\n // when updating 'selected' state (copied relevant super implementation)\n this.options?.forEach((o, i) => {\n const notifier = Observable.getNotifier(o);\n notifier.unsubscribe(this, 'selected');\n o.selected = next.includes(o);\n notifier.subscribe(this, 'selected');\n const proxyOption = this.proxy?.options.item(i);\n if (proxyOption) {\n proxyOption.selected = o.selected;\n }\n });\n }\n\n /**\n * Sets the selected index to match the first option with the selected attribute, or\n * the first selectable option.\n *\n * @override\n * @internal\n */\n protected override setDefaultSelectedOption(): void {\n const options: ListboxOption[] = this.options\n ?? Array.from(this.children).filter(o => isNimbleListOption(o));\n\n const optionIsSelected = (option: ListboxOption): boolean => {\n return option.hasAttribute('selected') || option.selected;\n };\n let selectedIndex = -1;\n let firstValidOptionIndex = -1;\n for (let i = 0; i < options?.length; i++) {\n const option = options[i];\n if (optionIsSelected(option!) || option?.value === this.value) {\n selectedIndex = i;\n }\n if (\n firstValidOptionIndex === -1\n && isOptionSelectable(option! as ListOption)\n ) {\n firstValidOptionIndex = i;\n }\n }\n\n if (selectedIndex !== -1) {\n this.selectedIndex = selectedIndex;\n } else if (firstValidOptionIndex !== -1) {\n this.selectedIndex = firstValidOptionIndex;\n } else {\n this.selectedIndex = 0;\n }\n this.committedSelectedOption = options[this.selectedIndex];\n }\n\n private setActiveOption(newActiveIndex: number): void {\n const activeOption = this.options[newActiveIndex];\n if (this.open) {\n if (isNimbleListOption(activeOption)) {\n activeOption.activeOption = true;\n }\n\n const previousActiveIndex = this.openActiveIndex ?? this.selectedIndex;\n const previousActiveOption = this.options[previousActiveIndex];\n if (\n previousActiveIndex !== newActiveIndex\n && isNimbleListOption(previousActiveOption)\n ) {\n previousActiveOption.activeOption = false;\n }\n\n this.openActiveIndex = newActiveIndex;\n this.focusAndScrollActiveOptionIntoView();\n } else {\n this.selectedIndex = newActiveIndex;\n }\n\n this.ariaActiveDescendant = activeOption?.id ?? '';\n }\n\n private focusAndScrollActiveOptionIntoView(): void {\n const optionToFocus = this.options[this.openActiveIndex ?? this.selectedIndex];\n // Copied from FAST: To ensure that the browser handles both `focus()` and\n // `scrollIntoView()`, the timing here needs to guarantee that they happen on\n // different frames. Since this function is typically called from the `openChanged`\n // observer, `DOM.queueUpdate` causes the calls to be grouped into the same frame.\n // To prevent this, `requestAnimationFrame` is used instead of `DOM.queueUpdate`.\n if (optionToFocus !== undefined && this.contains(optionToFocus)) {\n optionToFocus.focus();\n requestAnimationFrame(() => {\n optionToFocus.scrollIntoView({ block: 'nearest' });\n });\n }\n }\n\n private committedSelectedOptionChanged(): void {\n this.updateDisplayValue();\n }\n\n private setPositioning(): void {\n if (!this.$fastController.isConnected) {\n // Don't call setPositioning() until we're connected,\n // since this.forcedPosition isn't initialized yet.\n return;\n }\n const currentBox = this.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const availableBottom = viewportHeight - currentBox.bottom;\n\n if (this.forcedPosition) {\n this.position = this.positionAttribute;\n } else if (currentBox.top > availableBottom) {\n this.position = SelectPosition.above;\n } else {\n this.position = SelectPosition.below;\n }\n\n this.positionAttribute = this.forcedPosition\n ? this.positionAttribute\n : this.position;\n\n this.maxHeight = this.position === SelectPosition.above\n ? Math.trunc(currentBox.top)\n : Math.trunc(availableBottom);\n this.updateListboxMaxHeightCssVariable();\n }\n\n /**\n * Filter available options by text value.\n *\n * @public\n */\n private filterOptions(): void {\n const filter = this.filter.toLowerCase();\n\n if (filter) {\n this.filteredOptions = this.options.filter(option => {\n const normalizedFilter = diacriticInsensitiveStringNormalizer(filter);\n return (\n !option.hidden\n && diacriticInsensitiveStringNormalizer(option.text).includes(\n normalizedFilter\n )\n );\n });\n } else {\n this.filteredOptions = this.options.filter(\n option => !option.hidden\n );\n }\n\n this.options.forEach(o => {\n if (isNimbleListOption(o)) {\n if (!this.filteredOptions.includes(o)) {\n o.visuallyHidden = true;\n } else {\n o.visuallyHidden = false;\n }\n }\n });\n }\n\n /**\n * Sets the value and display value to match the first selected option.\n *\n * @param shouldEmit - if true, the input and change events will be emitted\n *\n * @internal\n */\n private updateValue(shouldEmit?: boolean): void {\n if (this.$fastController.isConnected) {\n this.value = this.firstSelectedOption?.value ?? '';\n }\n\n if (shouldEmit) {\n this.$emit('input');\n this.$emit('change', this, {\n bubbles: true,\n composed: undefined\n });\n }\n }\n\n /**\n * Resets and fills the proxy to match the component's options.\n *\n * @internal\n */\n private setProxyOptions(): void {\n if (this.proxy instanceof HTMLSelectElement && this.options) {\n this.proxy.options.length = 0;\n this.options.forEach(option => {\n const proxyOption = option.proxy\n || (option instanceof HTMLOptionElement\n ? option.cloneNode()\n : null);\n\n if (proxyOption) {\n this.proxy.options.add(proxyOption);\n }\n });\n }\n }\n\n private filterChanged(): void {\n this.filterOptions();\n }\n\n private maxHeightChanged(): void {\n this.updateListboxMaxHeightCssVariable();\n }\n\n private initializeOpenState(): void {\n this.committedSelectedOption = this.options[this.selectedIndex];\n this.setActiveOption(this.selectedIndex);\n this.ariaControls = this.listboxId;\n this.ariaExpanded = 'true';\n\n this.setPositioning();\n this.focusAndScrollOptionIntoView();\n }\n\n private updateListboxMaxHeightCssVariable(): void {\n if (this.listbox) {\n this.listbox.style.setProperty(\n '--ni-private-select-max-height',\n `${this.maxHeight}px`\n );\n }\n }\n}\n\nconst nimbleSelect = Select.compose<SelectOptions>({\n baseName: 'select',\n baseClass: FoundationSelect,\n template,\n styles,\n indicator: arrowExpanderDown16X16.data,\n end: html<Select>`\n <${iconExclamationMarkTag}\n severity=\"error\"\n class=\"error-icon\"\n ></${iconExclamationMarkTag}>\n ${errorTextTemplate}\n `\n});\n\napplyMixins(Select, StartEnd, DelegatesARIASelect);\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSelect());\nexport const selectTag = 'nimble-select';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/select/index.ts"],"names":[],"mappings":";AAAA,qJAAqJ;AACrJ,OAAO,EACH,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,UAAU,EACV,QAAQ,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEH,YAAY,EACZ,MAAM,IAAI,gBAAgB,EAG1B,cAAc,EACd,WAAW,EACX,QAAQ,EACR,mBAAmB,EACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,aAAa,EACb,YAAY,EACZ,UAAU,EACV,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,EACX,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACH,kBAAkB,EAErB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,QA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AsB;;;aAGpB,sBAAsB;UACzB,iBAAiB;KACtB;CACJ,CAAC,CAAC;AAEH,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AACnD,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC","sourcesContent":["// Based on: https://github.com/microsoft/fast/blob/%40microsoft/fast-foundation_v2.49.5/packages/web-components/fast-foundation/src/select/select.ts\nimport {\n attr,\n html,\n observable,\n Observable,\n volatile\n} from '@microsoft/fast-element';\nimport {\n AnchoredRegion,\n DesignSystem,\n Select as FoundationSelect,\n ListboxOption,\n SelectOptions,\n SelectPosition,\n applyMixins,\n StartEnd,\n DelegatesARIASelect\n} from '@microsoft/fast-foundation';\nimport {\n findLastIndex,\n keyArrowDown,\n keyArrowUp,\n keyEnd,\n keyEnter,\n keyEscape,\n keyHome,\n keySpace,\n uniqueId\n} from '@microsoft/fast-web-utilities';\nimport { arrowExpanderDown16X16 } from '@ni/nimble-tokens/dist/icons/js';\nimport { styles } from './styles';\nimport {\n DropdownAppearance,\n ListOptionOwner\n} from '../patterns/dropdown/types';\nimport { errorTextTemplate } from '../patterns/error/template';\nimport type { ErrorPattern } from '../patterns/error/types';\nimport { iconExclamationMarkTag } from '../icons/exclamation-mark';\nimport { template } from './template';\nimport { ListOption } from '../list-option';\nimport { FilterMode } from './types';\nimport { diacriticInsensitiveStringNormalizer } from '../utilities/models/string-normalizers';\nimport { FormAssociatedSelect } from './models/select-form-associated';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nimble-select': Select;\n }\n}\n\n// Used in overrides of base class methods\n// eslint-disable-next-line @typescript-eslint/no-invalid-void-type\ntype BooleanOrVoid = boolean | void;\n\nconst isNimbleListOption = (el: Element | undefined): el is ListOption => {\n return el instanceof ListOption;\n};\n\nconst isOptionSelectable = (el: ListOption): boolean => {\n return !el.visuallyHidden && !el.disabled && !el.hidden;\n};\n\nconst isOptionPlaceholder = (el: ListboxOption): boolean => {\n return el.disabled && el.hidden;\n};\n\n/**\n * A nimble-styled HTML select.\n */\nexport class Select\n extends FormAssociatedSelect\n implements ErrorPattern, ListOptionOwner {\n @attr\n public appearance: DropdownAppearance = DropdownAppearance.underline;\n\n /**\n * Reflects the placement for the listbox when the select is open.\n *\n * @public\n */\n @attr({ attribute: 'position' })\n public positionAttribute?: SelectPosition;\n\n /**\n * A message explaining why the value is invalid.\n *\n * @public\n * @remarks\n * HTML Attribute: error-text\n */\n @attr({ attribute: 'error-text' })\n public errorText: string | undefined;\n\n @attr({ attribute: 'error-visible', mode: 'boolean' })\n public errorVisible = false;\n\n @attr({ attribute: 'filter-mode' })\n public filterMode: FilterMode = FilterMode.none;\n\n @attr({ attribute: 'clearable', mode: 'boolean' })\n public clearable = false;\n\n /**\n * @internal\n */\n @observable\n public displayPlaceholder = false;\n\n /**\n * @internal\n */\n @attr({ attribute: 'open', mode: 'boolean' })\n public open = false;\n\n /**\n * Holds the current state for the calculated position of the listbox.\n *\n * @public\n */\n @observable\n public position?: SelectPosition;\n\n /**\n * The ref to the internal `.control` element.\n *\n * @internal\n */\n @observable\n public control!: HTMLElement;\n\n /**\n * Reference to the internal listbox element.\n *\n * @internal\n */\n public listbox!: HTMLDivElement;\n\n /**\n * The unique id for the internal listbox element.\n *\n * @internal\n */\n public listboxId: string = uniqueId('listbox-');\n\n /**\n * @internal\n */\n @observable\n public scrollableRegion!: HTMLElement;\n\n /**\n * @internal\n */\n @observable\n public filterInput?: HTMLInputElement;\n\n /**\n * @internal\n */\n @observable\n public anchoredRegion!: AnchoredRegion;\n\n /** @internal */\n @observable\n public hasOverflow = false;\n\n /**\n * @internal\n */\n @observable\n public filteredOptions: ListboxOption[] = [];\n\n /**\n * @internal\n */\n @observable\n public filter = '';\n\n /**\n * The max height for the listbox when opened.\n *\n * @internal\n */\n @observable\n public maxHeight = 0;\n\n /**\n * The component is collapsible when in single-selection mode with no size attribute.\n *\n * @internal\n */\n @volatile\n public get collapsible(): boolean {\n return !(this.multiple || typeof this.size === 'number');\n }\n\n private _value = '';\n private forcedPosition = false;\n private openActiveIndex?: number;\n\n /**\n * @internal\n */\n public override connectedCallback(): void {\n super.connectedCallback();\n this.forcedPosition = !!this.positionAttribute;\n if (this.open) {\n this.initializeOpenState();\n }\n }\n\n public override get value(): string {\n Observable.track(this, 'value');\n return this._value;\n }\n\n public override set value(next: string) {\n const prev = this._value;\n let newValue = next;\n\n if (this.options?.length) {\n const newValueIndex = this.options.findIndex(\n el => el.value === newValue\n );\n const prevSelectedValue = this.options[this.selectedIndex]?.value ?? null;\n const nextSelectedValue = this.options[newValueIndex]?.value ?? null;\n\n if (\n newValueIndex === -1\n || prevSelectedValue !== nextSelectedValue\n ) {\n newValue = '';\n this.selectedIndex = newValueIndex;\n }\n\n newValue = this.firstSelectedOption?.value ?? newValue;\n }\n\n if (prev !== newValue && !(this.open && this.selectedIndex < 0)) {\n this._value = newValue;\n super.valueChanged(prev, newValue);\n Observable.notify(this, 'value');\n this.updateDisplayValue();\n }\n }\n\n /**\n * @internal\n */\n @volatile\n public get displayValue(): string {\n Observable.track(this, 'displayValue');\n return this.firstSelectedOption?.text ?? '';\n }\n\n /**\n * @internal\n */\n public anchoredRegionChanged(\n _prev: AnchoredRegion | undefined,\n _next: AnchoredRegion | undefined\n ): void {\n if (this.anchoredRegion && this.control) {\n this.anchoredRegion.anchorElement = this.control;\n }\n }\n\n /**\n * @internal\n */\n public controlChanged(\n _prev: HTMLElement | undefined,\n _next: HTMLElement | undefined\n ): void {\n if (this.anchoredRegion && this.control) {\n this.anchoredRegion.anchorElement = this.control;\n }\n }\n\n /**\n * @internal\n */\n public override slottedOptionsChanged(\n prev: Element[],\n next: Element[]\n ): void {\n const value = this.value;\n this.options.forEach(o => {\n const notifier = Observable.getNotifier(o);\n notifier.unsubscribe(this, 'value');\n notifier.unsubscribe(this, 'hidden');\n notifier.unsubscribe(this, 'disabled');\n });\n\n super.slottedOptionsChanged(prev, next);\n\n this.options.forEach(o => {\n const notifier = Observable.getNotifier(o);\n notifier.subscribe(this, 'value');\n notifier.subscribe(this, 'hidden');\n notifier.subscribe(this, 'disabled');\n });\n this.setProxyOptions();\n this.updateValue();\n // We need to force an update to the filteredOptions observable\n // (by calling 'filterOptions()) so that the template correctly updates.\n this.filterOptions();\n if (value) {\n this.value = value;\n }\n }\n\n /**\n * @internal\n */\n public override clickHandler(e: MouseEvent): BooleanOrVoid {\n // do nothing if the select is disabled\n if (this.disabled) {\n return;\n }\n\n let optionClicked = false;\n if (this.open) {\n const captured = (e.target as HTMLElement).closest<ListOption>(\n 'option,[role=option]'\n );\n optionClicked = captured !== null;\n\n if (captured?.disabled) {\n return;\n }\n }\n\n const previousSelectedIndex = this.selectedIndex;\n super.clickHandler(e);\n\n this.open = this.collapsible && !this.open;\n if (\n !this.open\n && this.selectedIndex !== previousSelectedIndex\n && optionClicked\n ) {\n this.updateValue(true);\n }\n }\n\n /**\n * Updates the value when an option's value changes.\n *\n * @param source - the source object\n * @param propertyName - the property to evaluate\n *\n * @internal\n * @override\n */\n public override handleChange(source: unknown, propertyName: string): void {\n // don't call super.handleChange so hidden options can be selected programmatically\n const sourceElement = source as Element;\n switch (propertyName) {\n case 'value': {\n this.updateValue();\n break;\n }\n case 'selected': {\n if (\n isNimbleListOption(sourceElement)\n && sourceElement.selected\n ) {\n this.selectedIndex = this.options.indexOf(sourceElement);\n } else {\n this.clearSelect();\n }\n break;\n }\n case 'hidden': {\n if (isNimbleListOption(sourceElement)) {\n sourceElement.visuallyHidden = sourceElement.hidden;\n }\n this.updateDisplayValue();\n break;\n }\n case 'disabled': {\n this.updateDisplayValue();\n break;\n }\n default:\n break;\n }\n }\n\n /**\n * Prevents focus when size is set and a scrollbar is clicked.\n *\n * @param e - the mouse event object\n *\n * @override\n * @internal\n */\n public override mousedownHandler(e: MouseEvent): BooleanOrVoid {\n if (e.offsetX >= 0 && e.offsetX <= this.listbox?.scrollWidth) {\n return super.mousedownHandler(e);\n }\n\n return this.collapsible;\n }\n\n /**\n * @internal\n */\n public regionLoadedHandler(): void {\n this.focusAndScrollOptionIntoView();\n }\n\n /**\n * Sets the multiple property on the proxy element.\n *\n * @param prev - the previous multiple value\n * @param next - the current multiple value\n */\n public override multipleChanged(\n prev: boolean | undefined,\n next: boolean\n ): void {\n super.multipleChanged(prev, next);\n\n if (this.proxy) {\n this.proxy.multiple = next;\n }\n }\n\n /**\n * @internal\n */\n public inputClickHandler(e: MouseEvent): void {\n e.stopPropagation(); // clicking in filter input shouldn't close dropdown\n }\n\n /**\n * @internal\n */\n public clearClickHandler(e: MouseEvent): void {\n this.open = false;\n this.clearSelect();\n this.updateValue(true);\n e.stopPropagation();\n }\n\n /**\n * @internal\n */\n public updateDisplayValue(): void {\n const placeholderOption = this.getPlaceholderOption();\n if (\n placeholderOption\n && this.firstSelectedOption === placeholderOption\n ) {\n this.displayPlaceholder = true;\n } else {\n this.displayPlaceholder = false;\n }\n\n Observable.notify(this, 'displayValue');\n }\n\n /**\n * Handle content changes on the control input.\n *\n * @param e - the input event\n * @internal\n */\n public inputHandler(e: InputEvent): boolean {\n this.filter = this.filterInput?.value ?? '';\n this.filterOptions();\n\n const enabledOptions = this.filteredOptions.filter(o => !o.disabled);\n let activeOptionIndex = this.filter !== ''\n ? this.openActiveIndex ?? this.selectedIndex\n : this.selectedIndex;\n\n if (\n enabledOptions.length > 0\n && !enabledOptions.find(o => o === this.options[activeOptionIndex])\n ) {\n activeOptionIndex = this.options.indexOf(enabledOptions[0]!);\n } else if (enabledOptions.length === 0) {\n activeOptionIndex = -1;\n }\n this.setActiveOption(activeOptionIndex);\n\n if (e.inputType.includes('deleteContent') || !this.filter.length) {\n return true;\n }\n\n e.stopPropagation();\n return true;\n }\n\n /**\n * @internal\n */\n public override focusoutHandler(e: FocusEvent): BooleanOrVoid {\n super.focusoutHandler(e);\n if (!this.open) {\n return true;\n }\n\n this.open = false;\n const focusTarget = e.relatedTarget as HTMLElement;\n if (this.isSameNode(focusTarget)) {\n this.focus();\n return true;\n }\n\n return true;\n }\n\n /**\n * @internal\n */\n public override keydownHandler(e: KeyboardEvent): BooleanOrVoid {\n const initialSelectedIndex = this.selectedIndex;\n super.keydownHandler(e);\n const key = e.key;\n if (e.ctrlKey || e.shiftKey) {\n return true;\n }\n\n let currentActiveIndex = this.openActiveIndex ?? this.selectedIndex;\n switch (key) {\n case keySpace: {\n // when dropdown is open allow user to enter a space for filter text\n if (this.open && this.filterMode !== FilterMode.none) {\n break;\n }\n\n e.preventDefault();\n if (this.collapsible && this.typeAheadExpired) {\n this.open = !this.open;\n }\n if (!this.open) {\n this.focus();\n }\n break;\n }\n case keyHome:\n case keyEnd: {\n e.preventDefault();\n break;\n }\n case keyEnter: {\n e.preventDefault();\n if (\n this.filteredOptions.length === 0\n || this.filteredOptions.every(o => o.disabled)\n ) {\n return false;\n }\n this.open = !this.open;\n if (!this.open) {\n this.focus();\n }\n break;\n }\n case keyEscape: {\n if (!this.open) {\n if (this.clearable) {\n this.clearSelect();\n this.updateValue(true);\n return true;\n }\n\n break;\n }\n\n if (this.collapsible && this.open) {\n e.preventDefault();\n this.open = false;\n }\n\n currentActiveIndex = this.selectedIndex;\n this.focus();\n break;\n }\n\n default: {\n break;\n }\n }\n\n if (!this.open && this.selectedIndex !== currentActiveIndex) {\n this.selectedIndex = currentActiveIndex;\n }\n\n if (!this.open && initialSelectedIndex !== this.selectedIndex) {\n this.updateValue(true);\n }\n\n return !(key === keyArrowDown || key === keyArrowUp);\n }\n\n /**\n * Updates the proxy value when the selected index changes.\n *\n * @param prev - the previous selected index\n * @param next - the next selected index\n *\n * @internal\n */\n public override selectedIndexChanged(\n _: number | undefined,\n __: number\n ): void {\n // Don't call super.selectedIndexChanged as this will disallow disabled options\n // from being valid initial selected values. Our setDefaultSelectedOption\n // implementation handles skipping non-selected disabled options for the initial\n // selected value.\n this.setSelectedOptions();\n if (this.open) {\n this.setActiveOption(this.selectedIndex);\n }\n this.updateValue();\n }\n\n /**\n * @internal\n * Fork of Listbox implementation, so that the selectedIndex is not changed while the dropdown\n * is open.\n */\n public override typeaheadBufferChanged(_: string, __: string): void {\n if (this.$fastController.isConnected) {\n const typeaheadMatches = this.getTypeaheadMatches();\n\n if (typeaheadMatches.length) {\n const activeOptionIndex = this.options.indexOf(\n typeaheadMatches[0] as ListOption\n );\n if (!(this.open && this.filterMode !== FilterMode.none)) {\n this.setActiveOption(activeOptionIndex);\n }\n }\n\n this.typeaheadExpired = false;\n }\n }\n\n /**\n * Synchronize the `aria-disabled` property when the `disabled` property changes.\n *\n * @param prev - The previous disabled value\n * @param next - The next disabled value\n *\n * @internal\n */\n public override disabledChanged(prev: boolean, next: boolean): void {\n if (super.disabledChanged) {\n super.disabledChanged(prev, next);\n }\n this.ariaDisabled = this.disabled ? 'true' : 'false';\n }\n\n /**\n * Reset the element to its first selectable option when its parent form is reset.\n *\n * @internal\n */\n public override formResetCallback(): void {\n this.setProxyOptions();\n // Call the base class's implementation setDefaultSelectedOption instead of the select's\n // override, in order to reset the selectedIndex without using the value property.\n super.setDefaultSelectedOption();\n if (this.selectedIndex === -1) {\n this.selectedIndex = 0;\n }\n }\n\n /**\n * @internal\n */\n public override selectNextOption(): void {\n // don't call super.selectNextOption as that relies on side-effecty\n // behavior to not select disabled option (which no longer works)\n const startIndex = this.openActiveIndex ?? this.selectedIndex;\n for (let i = startIndex + 1; i < this.options.length; i++) {\n const listOption = this.options[i]!;\n if (\n isNimbleListOption(listOption)\n && isOptionSelectable(listOption)\n ) {\n this.setActiveOption(i);\n break;\n }\n }\n }\n\n /**\n * @internal\n */\n public override selectPreviousOption(): void {\n // don't call super.selectPreviousOption as that relies on side-effecty\n // behavior to not select disabled option (which no longer works)\n const startIndex = this.openActiveIndex ?? this.selectedIndex;\n for (let i = startIndex - 1; i >= 0; i--) {\n const listOption = this.options[i]!;\n if (\n isNimbleListOption(listOption)\n && isOptionSelectable(listOption)\n ) {\n this.setActiveOption(i);\n break;\n }\n }\n }\n\n /**\n * @internal\n */\n public override selectFirstOption(): void {\n const newActiveOptionIndex = this.options.findIndex(\n o => isNimbleListOption(o) && isOptionSelectable(o)\n );\n this.setActiveOption(newActiveOptionIndex);\n }\n\n /**\n * @internal\n */\n public override selectLastOption(): void {\n const newActiveOptionIndex = findLastIndex(\n this.options,\n o => isNimbleListOption(o) && isOptionSelectable(o)\n );\n this.setActiveOption(newActiveOptionIndex);\n }\n\n /**\n * @internal\n */\n public registerOption(option: ListOption): void {\n if (this.options.includes(option)) {\n return;\n }\n\n // Adding an option to the end, ultimately, isn't the correct\n // thing to do, as this will mean the option's index in the options,\n // at least temporarily, does not match the DOM order. However, it\n // is expected that a successive run of `slottedOptionsChanged` will\n // correct this order issue. See 'https://github.com/ni/nimble/issues/1915'\n // for more info.\n this.options.push(option);\n }\n\n protected override setSelectedOptions(): void {\n // Prevents parent classes from resetting selectedIndex to a positive\n // value while filtering, which can result in a disabled option being\n // selected.\n if (this.open && this.selectedIndex === -1) {\n return;\n }\n super.setSelectedOptions();\n }\n\n protected override focusAndScrollOptionIntoView(): void {\n if (this.open) {\n super.focusAndScrollOptionIntoView();\n window.requestAnimationFrame(() => {\n this.filterInput?.focus();\n });\n }\n }\n\n protected override getTypeaheadMatches(): ListboxOption[] {\n const matches = super.getTypeaheadMatches();\n // Don't allow placeholder to be matched\n return matches.filter(o => !o.hidden && !o.disabled);\n }\n\n protected positionChanged(\n _: SelectPosition | undefined,\n next: SelectPosition | undefined\n ): void {\n this.positionAttribute = next;\n this.setPositioning();\n }\n\n /**\n * Updates the proxy's size property when the size attribute changes.\n *\n * @param prev - the previous size\n * @param next - the current size\n *\n * @override\n * @internal\n */\n protected override sizeChanged(\n prev: number | undefined,\n next: number\n ): void {\n super.sizeChanged(prev, next);\n\n if (this.proxy) {\n this.proxy.size = next;\n }\n }\n\n protected openChanged(): void {\n if (!this.collapsible) {\n return;\n }\n\n if (this.open) {\n this.initializeOpenState();\n return;\n }\n\n const activeOption = this.options[this.openActiveIndex ?? this.selectedIndex];\n if (isNimbleListOption(activeOption)) {\n activeOption.activeOption = false;\n }\n this.openActiveIndex = undefined;\n this.filter = '';\n if (this.filterInput) {\n this.filterInput.value = '';\n }\n\n this.ariaControls = '';\n this.ariaExpanded = 'false';\n }\n\n /**\n * Updates the selectedness of each option when the list of selected options changes.\n *\n * @param prev - the previous list of selected options\n * @param next - the current list of selected options\n *\n * @override\n * @internal\n */\n protected override selectedOptionsChanged(\n _prev: ListboxOption[] | undefined,\n next: ListboxOption[]\n ): void {\n // don't call super.selectedOptionsChanged so we don't filter out hidden elements\n // when updating 'selected' state (copied relevant super implementation)\n this.options?.forEach((o, i) => {\n const notifier = Observable.getNotifier(o);\n notifier.unsubscribe(this, 'selected');\n o.selected = next.includes(o);\n notifier.subscribe(this, 'selected');\n const proxyOption = this.proxy?.options.item(i);\n if (proxyOption) {\n proxyOption.selected = o.selected;\n }\n });\n }\n\n /**\n * Sets the selected index to match the first option with the selected attribute, or\n * the first selectable option.\n *\n * @override\n * @internal\n */\n protected override setDefaultSelectedOption(): void {\n const options: ListboxOption[] = this.options\n ?? Array.from(this.children).filter(o => isNimbleListOption(o));\n\n const optionIsSelected = (option: ListboxOption): boolean => {\n return option.hasAttribute('selected') || option.selected;\n };\n let selectedIndex = -1;\n let firstValidOptionIndex = -1;\n let placeholderIndex = -1;\n for (let i = 0; i < options?.length; i++) {\n const option = options[i]!;\n if (optionIsSelected(option) || option.value === this.value) {\n selectedIndex = i;\n break;\n } else if (placeholderIndex === -1 && isOptionPlaceholder(option)) {\n placeholderIndex = i;\n } else if (\n firstValidOptionIndex === -1\n && isOptionSelectable(option as ListOption)\n ) {\n firstValidOptionIndex = i;\n }\n }\n\n if (selectedIndex !== -1) {\n this.selectedIndex = selectedIndex;\n } else if (placeholderIndex !== -1) {\n this.selectedIndex = placeholderIndex;\n } else if (firstValidOptionIndex !== -1) {\n this.selectedIndex = firstValidOptionIndex;\n } else {\n this.selectedIndex = 0;\n }\n }\n\n private setActiveOption(newActiveIndex: number): void {\n const activeOption = this.options[newActiveIndex];\n if (this.open) {\n if (isNimbleListOption(activeOption)) {\n activeOption.activeOption = true;\n }\n\n const previousActiveIndex = this.openActiveIndex ?? this.selectedIndex;\n const previousActiveOption = this.options[previousActiveIndex];\n if (\n previousActiveIndex !== newActiveIndex\n && isNimbleListOption(previousActiveOption)\n ) {\n previousActiveOption.activeOption = false;\n }\n\n this.openActiveIndex = newActiveIndex;\n this.focusAndScrollActiveOptionIntoView();\n } else {\n this.selectedIndex = newActiveIndex;\n }\n\n this.ariaActiveDescendant = activeOption?.id ?? '';\n }\n\n private focusAndScrollActiveOptionIntoView(): void {\n const optionToFocus = this.options[this.openActiveIndex ?? this.selectedIndex];\n // Copied from FAST: To ensure that the browser handles both `focus()` and\n // `scrollIntoView()`, the timing here needs to guarantee that they happen on\n // different frames. Since this function is typically called from the `openChanged`\n // observer, `DOM.queueUpdate` causes the calls to be grouped into the same frame.\n // To prevent this, `requestAnimationFrame` is used instead of `DOM.queueUpdate`.\n if (optionToFocus !== undefined && this.contains(optionToFocus)) {\n optionToFocus.focus();\n requestAnimationFrame(() => {\n optionToFocus.scrollIntoView({ block: 'nearest' });\n });\n }\n }\n\n private getPlaceholderOption(): ListOption | undefined {\n return this.options.find(o => o.hidden && o.disabled) as ListOption;\n }\n\n private setPositioning(): void {\n if (!this.$fastController.isConnected) {\n // Don't call setPositioning() until we're connected,\n // since this.forcedPosition isn't initialized yet.\n return;\n }\n const currentBox = this.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const availableBottom = viewportHeight - currentBox.bottom;\n\n if (this.forcedPosition) {\n this.position = this.positionAttribute;\n } else if (currentBox.top > availableBottom) {\n this.position = SelectPosition.above;\n } else {\n this.position = SelectPosition.below;\n }\n\n this.positionAttribute = this.forcedPosition\n ? this.positionAttribute\n : this.position;\n\n this.maxHeight = this.position === SelectPosition.above\n ? Math.trunc(currentBox.top)\n : Math.trunc(availableBottom);\n this.updateListboxMaxHeightCssVariable();\n }\n\n /**\n * Filter available options by text value.\n *\n * @public\n */\n private filterOptions(): void {\n const filter = this.filter.toLowerCase();\n\n if (filter) {\n this.filteredOptions = this.options.filter(option => {\n const normalizedFilter = diacriticInsensitiveStringNormalizer(filter);\n return (\n !option.hidden\n && diacriticInsensitiveStringNormalizer(option.text).includes(\n normalizedFilter\n )\n );\n });\n } else {\n this.filteredOptions = this.options.filter(\n option => !option.hidden\n );\n }\n\n this.options.forEach(o => {\n if (isNimbleListOption(o)) {\n if (!this.filteredOptions.includes(o)) {\n o.visuallyHidden = true;\n } else {\n o.visuallyHidden = false;\n }\n }\n });\n }\n\n /**\n * Sets the value and display value to match the first selected option.\n *\n * @param shouldEmit - if true, the input and change events will be emitted\n *\n * @internal\n */\n private updateValue(shouldEmit?: boolean): void {\n if (this.$fastController.isConnected) {\n this.value = this.firstSelectedOption?.value ?? '';\n }\n\n if (shouldEmit) {\n this.$emit('input');\n this.$emit('change', this, {\n bubbles: true,\n composed: undefined\n });\n }\n }\n\n private clearSelect(): void {\n const placeholder = this.getPlaceholderOption();\n this.selectedIndex = placeholder\n ? this.options.indexOf(placeholder)\n : -1;\n }\n\n /**\n * Resets and fills the proxy to match the component's options.\n *\n * @internal\n */\n private setProxyOptions(): void {\n if (this.proxy instanceof HTMLSelectElement && this.options) {\n this.proxy.options.length = 0;\n this.options.forEach(option => {\n const proxyOption = option.proxy\n || (option instanceof HTMLOptionElement\n ? option.cloneNode()\n : null);\n\n if (proxyOption) {\n this.proxy.options.add(proxyOption);\n }\n });\n }\n }\n\n private filterChanged(): void {\n this.filterOptions();\n }\n\n private maxHeightChanged(): void {\n this.updateListboxMaxHeightCssVariable();\n }\n\n private initializeOpenState(): void {\n this.setActiveOption(this.selectedIndex);\n this.ariaControls = this.listboxId;\n this.ariaExpanded = 'true';\n\n this.setPositioning();\n this.focusAndScrollOptionIntoView();\n }\n\n private updateListboxMaxHeightCssVariable(): void {\n if (this.listbox) {\n this.listbox.style.setProperty(\n '--ni-private-select-max-height',\n `${this.maxHeight}px`\n );\n }\n }\n}\n\nconst nimbleSelect = Select.compose<SelectOptions>({\n baseName: 'select',\n baseClass: FoundationSelect,\n template,\n styles,\n indicator: arrowExpanderDown16X16.data,\n end: html<Select>`\n <${iconExclamationMarkTag}\n severity=\"error\"\n class=\"error-icon\"\n ></${iconExclamationMarkTag}>\n ${errorTextTemplate}\n `\n});\n\napplyMixins(Select, StartEnd, DelegatesARIASelect);\nDesignSystem.getOrCreate().withPrefix('nimble').register(nimbleSelect());\nexport const selectTag = 'nimble-select';\n"]}
@@ -25,8 +25,15 @@ export const styles = css `
25
25
  order: 1;
26
26
  }
27
27
 
28
- [part='indicator'] {
28
+ .clear-button {
29
29
  order: 3;
30
+ width: auto;
31
+ height: auto;
32
+ margin-left: ${smallPadding};
33
+ }
34
+
35
+ [part='indicator'] {
36
+ order: 4;
30
37
  }
31
38
 
32
39
  .error-icon {
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/select/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACH,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,cAAc;MACd,WAAW;;MAEX;AACE;gGACgG,CAAC,EACrG;;;iBAGa,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmCnB,aAAa;;;;;;;;8BAQD,qBAAqB;uBAC5B,aAAa,MAAM,YAAY,MAAM,WAAW;;;;kCAIrC,WAAW;;;;;;;8BAOf,qBAAqB;oBAC/B,aAAa,MAAM,YAAY,MAAM,WAAW;;;;kCAIlC,WAAW;;;;wBAIrB,YAAY;;;;;;;;;qBASf,YAAY,MAAM,aAAa;;;;;iBAKnC,oBAAoB;;;mBAGlB,YAAY;;;;;;;;;;;;;4BAaH,cAAc;;;;4BAId,iBAAiB;;;;4BAIjB,sBAAsB;;;;iBAIjC,oBAAoB;kBACnB,aAAa;;;mBAGZ,YAAY,IAAI,aAAa;;CAE/C,CAAC,aAAa,CACX,kBAAkB,CACd,kBAAkB,CAAC,KAAK,EACxB,GAAG,CAAA;;uCAE4B,WAAW;;;SAGzC,CACJ,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;;8BAGmB,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC;;SAEnD,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport { White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';\nimport { styles as dropdownStyles } from '../patterns/dropdown/styles';\nimport { styles as errorStyles } from '../patterns/error/styles';\nimport {\n borderRgbPartialColor,\n borderWidth,\n controlHeight,\n fillHoverColor,\n fillHoverSelectedColor,\n fillSelectedColor,\n mediumPadding,\n placeholderFontColor,\n smallPadding\n} from '../theme-provider/design-tokens';\nimport { appearanceBehavior } from '../utilities/style/appearance';\nimport { DropdownAppearance } from './types';\nimport { focusVisible } from '../utilities/style/focus';\nimport { themeBehavior } from '../utilities/style/theme';\nimport { Theme } from '../theme-provider/types';\nimport { hexToRgbaCssColor } from '../utilities/style/colors';\n\nexport const styles = css`\n ${dropdownStyles}\n ${errorStyles}\n\n ${\n /* We are using flex `order` to define the visual ordering of the selected value,\n error icon, and dropdown arrow because they are not \"interactive\" i.e. part of the tab order */ ''\n }\n\n .selected-value.placeholder {\n color: ${placeholderFontColor};\n }\n\n .selected-value {\n order: 1;\n }\n\n [part='indicator'] {\n order: 3;\n }\n\n .error-icon {\n order: 2;\n }\n\n [part='end'] {\n display: contents;\n }\n\n .listbox {\n overflow-x: clip;\n }\n\n .listbox.empty slot {\n display: none;\n }\n\n .listbox.above {\n flex-flow: column-reverse;\n }\n\n .filter-field {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: ${controlHeight};\n background: transparent;\n }\n\n .filter-field::before {\n content: '';\n position: absolute;\n height: 0px;\n border-bottom: rgba(${borderRgbPartialColor}, 0.1) 2px solid;\n bottom: calc(${controlHeight} + ${smallPadding} - ${borderWidth});\n }\n\n .filter-field.above::before {\n width: calc(100% - (2 * ${borderWidth}));\n }\n\n .filter-field::after {\n content: '';\n position: absolute;\n height: 0px;\n border-bottom: rgba(${borderRgbPartialColor}, 0.1) 2px solid;\n top: calc(${controlHeight} + ${smallPadding} - ${borderWidth});\n }\n\n .filter-field:not(.above)::after {\n width: calc(100% - (2 * ${borderWidth}));\n }\n\n .filter-icon {\n padding-left: ${smallPadding};\n }\n\n .filter-input {\n background: transparent;\n border: none;\n color: inherit;\n font: inherit;\n height: var(--ni-nimble-control-height);\n padding: 0 ${smallPadding} 0 ${mediumPadding};\n width: 100%;\n }\n\n .filter-input::placeholder {\n color: ${placeholderFontColor};\n }\n\n .filter-input${focusVisible} {\n outline: 0px;\n }\n\n .scrollable-region {\n overflow: auto;\n }\n\n ::slotted([role='option']) {\n background-color: transparent;\n }\n\n ::slotted([role='option']:hover) {\n background-color: ${fillHoverColor};\n }\n\n ::slotted([role='option'][active-option]) {\n background-color: ${fillSelectedColor};\n }\n\n ::slotted([role='option'][active-option]:hover) {\n background-color: ${fillHoverSelectedColor};\n }\n\n .no-results-label {\n color: ${placeholderFontColor};\n height: ${controlHeight};\n display: inline-flex;\n align-items: center;\n padding: ${smallPadding} ${mediumPadding};\n }\n`.withBehaviors(\n appearanceBehavior(\n DropdownAppearance.block,\n css`\n :host([error-visible]) .control {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n `\n ),\n themeBehavior(\n Theme.color,\n css`\n .filter-field,\n .no-results-label {\n background: ${hexToRgbaCssColor(White, 0.15)};\n }\n `\n )\n);\n"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/select/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,kDAAkD,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACH,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,cAAc;MACd,WAAW;;MAEX;AACE;gGACgG,CAAC,EACrG;;;iBAGa,oBAAoB;;;;;;;;;;;uBAWd,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+BjB,aAAa;;;;;;;;8BAQD,qBAAqB;uBAC5B,aAAa,MAAM,YAAY,MAAM,WAAW;;;;kCAIrC,WAAW;;;;;;;8BAOf,qBAAqB;oBAC/B,aAAa,MAAM,YAAY,MAAM,WAAW;;;;kCAIlC,WAAW;;;;wBAIrB,YAAY;;;;;;;;;qBASf,YAAY,MAAM,aAAa;;;;;iBAKnC,oBAAoB;;;mBAGlB,YAAY;;;;;;;;;;;;;4BAaH,cAAc;;;;4BAId,iBAAiB;;;;4BAIjB,sBAAsB;;;;iBAIjC,oBAAoB;kBACnB,aAAa;;;mBAGZ,YAAY,IAAI,aAAa;;CAE/C,CAAC,aAAa,CACX,kBAAkB,CACd,kBAAkB,CAAC,KAAK,EACxB,GAAG,CAAA;;uCAE4B,WAAW;;;SAGzC,CACJ,EACD,aAAa,CACT,KAAK,CAAC,KAAK,EACX,GAAG,CAAA;;;8BAGmB,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC;;SAEnD,CACJ,CACJ,CAAC","sourcesContent":["import { css } from '@microsoft/fast-element';\nimport { White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';\nimport { styles as dropdownStyles } from '../patterns/dropdown/styles';\nimport { styles as errorStyles } from '../patterns/error/styles';\nimport {\n borderRgbPartialColor,\n borderWidth,\n controlHeight,\n fillHoverColor,\n fillHoverSelectedColor,\n fillSelectedColor,\n mediumPadding,\n placeholderFontColor,\n smallPadding\n} from '../theme-provider/design-tokens';\nimport { appearanceBehavior } from '../utilities/style/appearance';\nimport { DropdownAppearance } from './types';\nimport { focusVisible } from '../utilities/style/focus';\nimport { themeBehavior } from '../utilities/style/theme';\nimport { Theme } from '../theme-provider/types';\nimport { hexToRgbaCssColor } from '../utilities/style/colors';\n\nexport const styles = css`\n ${dropdownStyles}\n ${errorStyles}\n\n ${\n /* We are using flex `order` to define the visual ordering of the selected value,\n error icon, and dropdown arrow because they are not \"interactive\" i.e. part of the tab order */ ''\n }\n\n .selected-value.placeholder {\n color: ${placeholderFontColor};\n }\n\n .selected-value {\n order: 1;\n }\n\n .clear-button {\n order: 3;\n width: auto;\n height: auto;\n margin-left: ${smallPadding};\n }\n\n [part='indicator'] {\n order: 4;\n }\n\n .error-icon {\n order: 2;\n }\n\n [part='end'] {\n display: contents;\n }\n\n .listbox {\n overflow-x: clip;\n }\n\n .listbox.empty slot {\n display: none;\n }\n\n .listbox.above {\n flex-flow: column-reverse;\n }\n\n .filter-field {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: ${controlHeight};\n background: transparent;\n }\n\n .filter-field::before {\n content: '';\n position: absolute;\n height: 0px;\n border-bottom: rgba(${borderRgbPartialColor}, 0.1) 2px solid;\n bottom: calc(${controlHeight} + ${smallPadding} - ${borderWidth});\n }\n\n .filter-field.above::before {\n width: calc(100% - (2 * ${borderWidth}));\n }\n\n .filter-field::after {\n content: '';\n position: absolute;\n height: 0px;\n border-bottom: rgba(${borderRgbPartialColor}, 0.1) 2px solid;\n top: calc(${controlHeight} + ${smallPadding} - ${borderWidth});\n }\n\n .filter-field:not(.above)::after {\n width: calc(100% - (2 * ${borderWidth}));\n }\n\n .filter-icon {\n padding-left: ${smallPadding};\n }\n\n .filter-input {\n background: transparent;\n border: none;\n color: inherit;\n font: inherit;\n height: var(--ni-nimble-control-height);\n padding: 0 ${smallPadding} 0 ${mediumPadding};\n width: 100%;\n }\n\n .filter-input::placeholder {\n color: ${placeholderFontColor};\n }\n\n .filter-input${focusVisible} {\n outline: 0px;\n }\n\n .scrollable-region {\n overflow: auto;\n }\n\n ::slotted([role='option']) {\n background-color: transparent;\n }\n\n ::slotted([role='option']:hover) {\n background-color: ${fillHoverColor};\n }\n\n ::slotted([role='option'][active-option]) {\n background-color: ${fillSelectedColor};\n }\n\n ::slotted([role='option'][active-option]:hover) {\n background-color: ${fillHoverSelectedColor};\n }\n\n .no-results-label {\n color: ${placeholderFontColor};\n height: ${controlHeight};\n display: inline-flex;\n align-items: center;\n padding: ${smallPadding} ${mediumPadding};\n }\n`.withBehaviors(\n appearanceBehavior(\n DropdownAppearance.block,\n css`\n :host([error-visible]) .control {\n border-bottom-width: ${borderWidth};\n padding-bottom: 0;\n }\n `\n ),\n themeBehavior(\n Theme.color,\n css`\n .filter-field,\n .no-results-label {\n background: ${hexToRgbaCssColor(White, 0.15)};\n }\n `\n )\n);\n"]}