@ncino/web-components 15.4.0 → 15.6.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.
Files changed (29) hide show
  1. package/dist/_virtual/index3.js +1 -1
  2. package/dist/_virtual/index5.js +1 -1
  3. package/dist/_virtual/index6.js +1 -1
  4. package/dist/_virtual/index7.js +1 -1
  5. package/dist/_virtual/index8.js +1 -1
  6. package/dist/components/guided-nav/gator/guided-nav-step/guided-nav-step.gator.js +3 -3
  7. package/dist/components/input/gator/dropdown/input-dropdown.gator.js +42 -35
  8. package/dist/components/input-rich-text/input-rich-text.slds.js +1 -1
  9. package/dist/components/list/gator/list/list.gator.js +1 -1
  10. package/dist/components/menu/base/gator/menu.gator.js +3 -3
  11. package/dist/components/menu/menu-item/gator/menu-item.gator.js +10 -4
  12. package/dist/components/menu/menu-item/menu-item.js +1 -1
  13. package/dist/components/table/gator/table-cells/table-cell-icon-button.gator.js +11 -8
  14. package/dist/components/table/gator/table.gator.js +22 -22
  15. package/dist/node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.js +1 -1
  16. package/dist/node_modules/.pnpm/aria-query@5.3.0/node_modules/aria-query/lib/index.js +1 -1
  17. package/dist/node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/lite/index.js +1 -1
  18. package/dist/node_modules/.pnpm/pretty-format@27.5.1/node_modules/pretty-format/build/index.js +1 -1
  19. package/dist/node_modules/.pnpm/react-is@17.0.2/node_modules/react-is/index.js +1 -1
  20. package/dist/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.js +1 -1
  21. package/dist/packages/web-components/src/components/input/gator/dropdown/input-dropdown.gator.scss.js +1 -1
  22. package/dist/types/src/components/input/gator/dropdown/input-dropdown.gator.d.ts +56 -1
  23. package/dist/types/src/components/menu/base/gator/menu.gator.d.ts +4 -0
  24. package/dist/types/src/components/menu/menu-item/gator/menu-item.gator.d.ts +10 -1
  25. package/dist/types/src/components/menu/menu-item/menu-item.d.ts +14 -2
  26. package/dist/types/src/components/table/gator/table.gator.d.ts +14 -0
  27. package/dist/types/src/components/table/table-cell-config.d.ts +6 -0
  28. package/package.json +3 -3
  29. package/web-types.json +81 -22
@@ -1 +1 @@
1
- var r={};export{r as __exports};
1
+ import{getDefaultExportFromCjs as e}from"./_commonjsHelpers.js";import{__require as r}from"../node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.js";var t=r();const a=e(t);export{a as default};
@@ -1 +1 @@
1
- var e={exports:{}};export{e as __module};
1
+ var r={};export{r as __exports};
@@ -1 +1 @@
1
- import{getDefaultExportFromCjs as e}from"./_commonjsHelpers.js";import{__require as r}from"../node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.js";var t=r();const a=e(t);export{a as default};
1
+ var e={exports:{}};export{e as __module};
@@ -1 +1 @@
1
- var e={};export{e as __exports};
1
+ var e={exports:{}};export{e as __module};
@@ -1 +1 @@
1
- var e={exports:{}};export{e as __module};
1
+ var e={};export{e as __exports};
@@ -1,11 +1,10 @@
1
- import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{nothing as h,html as c}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{property as a}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as g}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as b}from"../../../../utils/decorators/custom-element-decorator.js";import{classMap as o}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/class-map.js";import _ from"../../../../packages/web-components/src/components/guided-nav/gator/guided-nav-step/guided-nav-step.gator.scss.js";import"../../../list/gator/list-item/list-item.gator.js";import{NgcComponent as m}from"../../../../utils/components/ngc-component.js";import{ifDefined as S}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/if-defined.js";import{unsafeCSS as f}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var $=Object.defineProperty,v=Object.getOwnPropertyDescriptor,x=Object.getPrototypeOf,y=Reflect.get,p=(e,s,r,n)=>{for(var i=n>1?void 0:n?v(s,r):s,d=e.length-1,l;d>=0;d--)(l=e[d])&&(i=(n?l(s,r,i):l(i))||i);return n&&i&&$(s,r,i),i},u=(e,s,r)=>y(x(e),r,s);let t=class extends m{constructor(){super(...arguments),this.step={id:"",value:"",text:""},this.selectedStep={step:"",substep:null},this.state="complete",this.onStepSelected=()=>{},this.onSubstepSelected=()=>{},this.badgeContent=null,this._substepsExpanded=!1}updated(e){(e.has("_isSelected")||e.has("selectedStep"))&&(this._substepsExpanded=this._hasSubsteps&&this._isSelected||!1)}render(){return c`
1
+ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{nothing as h,html as c}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{property as a}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as g}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as b}from"../../../../utils/decorators/custom-element-decorator.js";import{classMap as o}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/class-map.js";import m from"../../../../packages/web-components/src/components/guided-nav/gator/guided-nav-step/guided-nav-step.gator.scss.js";import"../../../list/gator/list-item/list-item.gator.js";import"../../../icon/gator/icon.gator.js";import"../../../icon/gator/templates/index.js";import{NgcComponent as _}from"../../../../utils/components/ngc-component.js";import{ifDefined as S}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/if-defined.js";import{unsafeCSS as f}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var $=Object.defineProperty,v=Object.getOwnPropertyDescriptor,x=Object.getPrototypeOf,y=Reflect.get,p=(e,s,r,n)=>{for(var i=n>1?void 0:n?v(s,r):s,d=e.length-1,l;d>=0;d--)(l=e[d])&&(i=(n?l(s,r,i):l(i))||i);return n&&i&&$(s,r,i),i},u=(e,s,r)=>y(x(e),r,s);let t=class extends _{constructor(){super(...arguments),this.step={id:"",value:"",text:""},this.selectedStep={step:"",substep:null},this.state="complete",this.onStepSelected=()=>{},this.onSubstepSelected=()=>{},this.badgeContent=null,this._substepsExpanded=!1}updated(e){(e.has("_isSelected")||e.has("selectedStep"))&&(this._substepsExpanded=this._hasSubsteps&&this._isSelected||!1)}render(){return c`
2
2
  <div class="${o(this._stepClasses)}" role="listitem">
3
3
  <ngc-list-item
4
4
  id="${this.step.id}"
5
5
  class="${o(this._stepListItemClasses)}"
6
6
  text="${this.step.text}"
7
7
  value="${this.step.value}"
8
- start-icon="${this._stepProgressIcon}"
9
8
  hide-checkmark
10
9
  .tabindex="${0}"
11
10
  ?current-list-item="${this.state==="current"}"
@@ -16,6 +15,7 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
16
15
  aria-current="${!this._hasSubsteps&&this._isSelected?"step":"false"}"
17
16
  aria-expanded=${S(this._hasSubsteps?this._substepsExpanded:void 0)}
18
17
  >
18
+ <ngc-icon slot="start" name="${this._stepProgressIcon}"></ngc-icon>
19
19
  ${this.badgeContent?c`<ngc-badge slot="end">${this.badgeContent}</ngc-badge>`:h}
20
20
  </ngc-list-item>
21
21
  ${this._substepElementsMarkup}
@@ -40,4 +40,4 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
40
40
  ></ngc-guided-nav-substep>
41
41
  `})}
42
42
  </ngc-list>
43
- `}handleSelected(e){if(e.detail.interactionType==="keyboard"&&this._hasSubsteps){this._substepsExpanded=!this._substepsExpanded;return}this.onStepSelected(e,this.step)}get _isSelected(){return this.selectedStep?.step===this.step.id}get _substeps(){return this.step.substeps??[]}_getSubstepState(e,s){return e.complete?"complete":s?.complete||!s?"current":"incomplete"}};t.shadowRootOptions={...u(t,t,"shadowRootOptions"),delegatesFocus:!0};t.styles=[...u(t,t,"styles"),f(_)];p([a()],t.prototype,"step",2);p([a()],t.prototype,"selectedStep",2);p([a()],t.prototype,"state",2);p([a({type:Function})],t.prototype,"onStepSelected",2);p([a({type:Function})],t.prototype,"onSubstepSelected",2);p([a({type:String})],t.prototype,"badgeContent",2);p([g()],t.prototype,"_substepsExpanded",2);t=p([b("ngc-guided-nav-step")],t);export{t as NgcGuidedNavStep};
43
+ `}handleSelected(e){if(e.detail.interactionType==="keyboard"&&this._hasSubsteps){this._substepsExpanded=!this._substepsExpanded;return}this.onStepSelected(e,this.step)}get _isSelected(){return this.selectedStep?.step===this.step.id}get _substeps(){return this.step.substeps??[]}_getSubstepState(e,s){return e.complete?"complete":s?.complete||!s?"current":"incomplete"}};t.shadowRootOptions={...u(t,t,"shadowRootOptions"),delegatesFocus:!0};t.styles=[...u(t,t,"styles"),f(m)];p([a()],t.prototype,"step",2);p([a()],t.prototype,"selectedStep",2);p([a()],t.prototype,"state",2);p([a({type:Function})],t.prototype,"onStepSelected",2);p([a({type:Function})],t.prototype,"onSubstepSelected",2);p([a({type:String})],t.prototype,"badgeContent",2);p([g()],t.prototype,"_substepsExpanded",2);t=p([b("ngc-guided-nav-step")],t);export{t as NgcGuidedNavStep};
@@ -1,11 +1,11 @@
1
- import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as r,nothing as b}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{ifDefined as y}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/if-defined.js";import{repeat as $}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.js";import{msg as v}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import{localized as R}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js";import"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import{classMap as w}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/class-map.js";import{property as h}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as d}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as V}from"../../../../utils/decorators/custom-element-decorator.js";import{createRef as g,ref as m}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/ref.js";import{autoUpdate as O,computePosition as I,flip as L}from"../../../../node_modules/.pnpm/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.js";import{KEY_CONSTANTS as n}from"../../../../consts/key-constants.js";import{formattedCountriesForDropdown as k,formattedStatesForDropdown as M}from"../../../../utils/places-utils.js";import{formattedNaicsCodes as D}from"../../../../utils/industry-utils.js";import{flagIconNameByPhoneCountryCode as _,dialCodeForPhoneCountryCode as S,formattedPhoneCountryCodes as T,phoneCountryDropdownOptionMatchesQuery as F}from"../../../../utils/phone-utils.js";import B from"../../../../packages/web-components/src/components/input/gator/dropdown/input-dropdown.gator.scss.js";import{NgcInputBase as C}from"../../base/input-base.gator.js";import"../input-label/input-label.gator.js";import"../help-text/help-text.gator.js";import"../../../icon/gator/icon.gator.js";import"../../../icon/gator/templates/index.js";import"../../../list/gator/list/list.gator.js";import"../../../list/gator/list-item/list-item.gator.js";import"../../../icon-button/gator/icon-button.gator.js";import{unsafeCSS as N}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var P=Object.defineProperty,q=Object.getOwnPropertyDescriptor,W=Object.getPrototypeOf,z=Reflect.get,a=(e,t,s,i)=>{for(var o=i>1?void 0:i?q(t,s):t,u=e.length-1,c;u>=0;u--)(c=e[u])&&(o=(i?c(t,s,o):c(o))||o);return i&&o&&P(t,s,o),o},H=(e,t,s)=>z(W(e),s,t);let l=class extends C{constructor(){super(...arguments),this.multiselect=!1,this.options=[],this.autocomplete=!1,this.selectAll=!1,this.listboxHelpText="",this.valueDisplayed=!1,this.maxAutocompleteResults=250,this.wrapChips=!1,this.hideClear=!1,this.loading=!1,this.tagInput=!1,this._expanded=!1,this._searchValue="",this._focused=!1,this._hovered=!1,this._visibleChipCount=1/0,this._showOverflowChip=!1,this._truncateChips=!0,this._calculationPending=!1,this.listboxRef=g(),this.listRef=g(),this.inputRef=g(),this.listboxMessageRef=g(),this.multiselectValueDelimiter=", ",this._selectedValues=[]}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._cleanup?.()}render(){return r`
1
+ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as r,nothing as p}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{ifDefined as y}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/if-defined.js";import{repeat as $}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.js";import{msg as v}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import{localized as E}from"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js";import"../../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import{classMap as V}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/class-map.js";import{property as h}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as d}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as R}from"../../../../utils/decorators/custom-element-decorator.js";import{createRef as g,ref as f}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/ref.js";import{autoUpdate as S,computePosition as w,flip as O}from"../../../../node_modules/.pnpm/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.js";import{KEY_CONSTANTS as n}from"../../../../consts/key-constants.js";import{formattedCountriesForDropdown as M,formattedStatesForDropdown as D}from"../../../../utils/places-utils.js";import{formattedNaicsCodes as k}from"../../../../utils/industry-utils.js";import{flagIconNameByPhoneCountryCode as C,dialCodeForPhoneCountryCode as T,formattedPhoneCountryCodes as F,phoneCountryDropdownOptionMatchesQuery as B}from"../../../../utils/phone-utils.js";import N from"../../../../packages/web-components/src/components/input/gator/dropdown/input-dropdown.gator.scss.js";import{NgcInputBase as A}from"../../base/input-base.gator.js";import"../input-label/input-label.gator.js";import"../help-text/help-text.gator.js";import"../../../icon/gator/icon.gator.js";import"../../../icon/gator/templates/index.js";import"../../../list/gator/list/list.gator.js";import"../../../list/gator/list-item/list-item.gator.js";import"../../../icon-button/gator/icon-button.gator.js";import{unsafeCSS as P}from"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var q=Object.defineProperty,W=Object.getOwnPropertyDescriptor,z=Object.getPrototypeOf,H=Reflect.get,o=(t,e,s,i)=>{for(var a=i>1?void 0:i?W(e,s):e,u=t.length-1,c;u>=0;u--)(c=t[u])&&(a=(i?c(e,s,a):c(a))||a);return i&&a&&q(e,s,a),a},K=(t,e,s)=>H(z(t),s,e);const I="__ngc_select_all__";let l=class extends A{constructor(){super(...arguments),this.multiselect=!1,this.options=[],this.autocomplete=!1,this.selectAll=!1,this.listboxHelpText="",this.valueDisplayed=!1,this.maxAutocompleteResults=250,this.wrapChips=!1,this.hideClear=!1,this.loading=!1,this.tagInput=!1,this._expanded=!1,this._searchValue="",this._focused=!1,this._hovered=!1,this._visibleChipCount=1/0,this._showOverflowChip=!1,this._truncateChips=!0,this._hasSlottedListItems=!1,this._calculationPending=!1,this.listboxRef=g(),this.listRef=g(),this.inputRef=g(),this.listboxMessageRef=g(),this.multiselectValueDelimiter=", ",this._selectedValues=[]}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._cleanup?.()}willUpdate(t){super.willUpdate(t),this.refreshSlottedMode()}render(){return r`
2
2
  <div class="gator-form-element">
3
3
  <slot name="label">
4
4
  ${this.label?this.labelMarkup:null}
5
5
  </slot>
6
6
  <div
7
- ${m(this.controlRef)}
8
- class=${w(this.controlClasses)}
7
+ ${f(this.controlRef)}
8
+ class=${V(this.controlClasses)}
9
9
  data-testid=${y(this.dataTestid)}-listbox
10
10
  aria-disabled="${this.disabled}"
11
11
  id="listbox-control-${this.id}"
@@ -34,12 +34,12 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
34
34
  ${this.bottomText}
35
35
  ${this.listboxMarkup}
36
36
  </div>
37
- `}get controlClasses(){return{...super.controlClasses,"gator-cursor-pointer":!this.disabled&&!this.readonly}}_topLevelFocusIn(){this._focused=!0}_handleMouseEnter(){this._hovered=!0}_handleMouseLeave(){this._hovered=!1}_topLevelFocusOut(e){const t=e.relatedTarget;(!t||!this.shadowRoot?.contains(t))&&(this._focused=!1,this.closeListbox())}get tabIndexForControl(){return this.disabled||this.autocomplete?"-1":"0"}phoneCodesFlagIconName(){if(this.dataType!=="phoneCodes")return"";const e=typeof this.value=="string"?this.value:"";return _(e)||""}get shouldHaveStartMarkup(){return this.phoneCodesFlagIconName()||super.shouldHaveStartMarkup}get startIconMarkup(){const e=this.phoneCodesFlagIconName();return e?r`<ngc-icon
37
+ `}get controlClasses(){return{...super.controlClasses,"gator-cursor-pointer":!this.disabled&&!this.readonly}}_topLevelFocusIn(){this._focused=!0}_handleMouseEnter(){this._hovered=!0}_handleMouseLeave(){this._hovered=!1}_topLevelFocusOut(t){const e=t.relatedTarget;(!e||!this.shadowRoot?.contains(e))&&(this._focused=!1,this.closeListbox())}get tabIndexForControl(){return this.disabled||this.autocomplete?"-1":"0"}phoneCodesFlagIconName(){if(this.dataType!=="phoneCodes")return"";const t=typeof this.value=="string"?this.value:"";return C(t)||""}get shouldHaveStartMarkup(){return this.phoneCodesFlagIconName()||super.shouldHaveStartMarkup}get startIconMarkup(){const t=this.phoneCodesFlagIconName();return t?r`<ngc-icon
38
38
  id="${this.startIconId}"
39
39
  label="${y(this.iconAsLabel?this.label:void 0)}"
40
- .name="${e}"
41
- ></ngc-icon>`:super.startIconMarkup}firstUpdated(){this.setComboboxAriaAttributes(),this._expanded&&this.toggleListbox(n.ENTER,!0),this.wrapChips&&(this._truncateChips=!1),this.multiselect&&this._truncateChips&&(this.setupResizeObserver(),this.scheduleOverflowCalculation()),this.multiselect&&Array.isArray(this.value)&&this.value?.length&&(this._selectedValues=[...this.value])}updated(e){if(e.has("autocomplete")&&this.setComboboxAriaAttributes(),e.has("_expanded")&&(this._expanded?this.setAriaActiveDescendant():this.clearAriaActiveDescendant(),this.comboboxElement?.setAttribute("aria-expanded",`${this._expanded}`)),e.has("required")&&this.comboboxElement?.setAttribute("aria-required",`${this.required}`),e.has("readonly")&&this.comboboxElement?.setAttribute("aria-readonly",`${this.readonly}`),(e.has("helpText")||e.has("errorText"))&&this.comboboxElement?.setAttribute("aria-describedby",this.ariaDescribedby),(e.has("ariaLabelledby")||e.has("ariaLabelledByElements")||e.has("label"))&&this.setComboboxAriaLabelledByElements(),e.has("multiselect")&&(this.setMultiselectAriaLabelledbyElements(),this._truncateChips&&this.setupResizeObserver()),e.has("value")&&this.multiselect&&this._truncateChips&&this.scheduleOverflowCalculation(),e.has("wrapChips")&&(this.wrapChips?(this._truncateChips=!1,this._resizeObserver?.disconnect()):(this._truncateChips=!0,this.setupResizeObserver())),e.has("_truncateChips")&&this._truncateChips&&this.scheduleOverflowCalculation(),e.has("_searchValue")&&this._searchValue===""&&this._expanded){const t=this.autocomplete&&!this.multiselect&&this.value!==void 0&&this.value!==null&&this.value!=="",s=this.value;this.updateComplete.then(()=>{!this._expanded||this._searchValue!==""||!this.listRef.value||(t?this._activeDescendant=this.listRef.value.setFalseFocusToValue(s):this._activeDescendant=this.listRef.value.falseFocusFirstItem(),this.listRef.value._setFauxFocusToCurrentItem(),this.setAriaActiveDescendant())})}e.has("value")&&this.multiselect&&(Array.isArray(this.value)?this._selectedValues=[...this.value]:this._selectedValues=[])}get comboboxElement(){return this.autocomplete?this.inputRef.value:this.controlRef.value}setComboboxAriaAttributes(){const e=this.comboboxElement,t=this.autocomplete?this.controlRef.value:this.inputRef.value,s={role:"combobox","aria-autocomplete":"list","aria-expanded":`${this._expanded}`,"aria-describedby":this.ariaDescribedby,"aria-required":`${this.required}`,"aria-readonly":`${this.readonly}`};Object.entries(s).forEach(([i,o])=>{e?.setAttribute(i,o),t?.removeAttribute(i)}),e&&(e.ariaControlsElements=[this.listRef.value],this.setComboboxAriaLabelledByElements()),t&&(t.ariaControlsElements=null,t.ariaLabelledByElements=null)}setComboboxAriaLabelledByElements(){const e=this.shadowRoot?.getElementById(this.labelId),t=this.shadowRoot?.getElementById(this.ariaLabelledbyValue),s=this.ariaLabelledByElements||[],i=this.multiselect?this.shadowRoot?.getElementById(`multiselect-label-${this.id}`):void 0;this.comboboxElement&&(this.comboboxElement.ariaLabelledByElements=[i,e,t,...s].filter(Boolean))}setMultiselectAriaLabelledbyElements(){if(!this.multiselect)return;const e=this.shadowRoot?.getElementById(`multiselect-label-${this.id}`);if(this.comboboxElement&&e){const t=this.comboboxElement.ariaLabelledByElements||null;this.comboboxElement.ariaLabelledByElements=t?[e,...t]:[e]}}setAriaActiveDescendant(){const e=this.comboboxElement;e&&(e.ariaActiveDescendantElement=this._activeDescendant||null)}clearAriaActiveDescendant(){const e=this.comboboxElement;e&&(e.ariaActiveDescendantElement=null)}get inputMarkup(){return r`
42
- <input ${m(this.inputRef)}
40
+ .name="${t}"
41
+ ></ngc-icon>`:super.startIconMarkup}firstUpdated(){this.setComboboxAriaAttributes(),this._expanded&&this.toggleListbox(n.ENTER,!0),this.wrapChips&&(this._truncateChips=!1),this.multiselect&&this._truncateChips&&(this.setupResizeObserver(),this.scheduleOverflowCalculation()),this.multiselect&&Array.isArray(this.value)&&this.value?.length&&(this._selectedValues=[...this.value])}updated(t){if(t.has("autocomplete")&&this.setComboboxAriaAttributes(),t.has("_expanded")&&(this._expanded?this.setAriaActiveDescendant():this.clearAriaActiveDescendant(),this.comboboxElement?.setAttribute("aria-expanded",`${this._expanded}`)),t.has("required")&&this.comboboxElement?.setAttribute("aria-required",`${this.required}`),t.has("readonly")&&this.comboboxElement?.setAttribute("aria-readonly",`${this.readonly}`),(t.has("helpText")||t.has("errorText"))&&this.comboboxElement?.setAttribute("aria-describedby",this.ariaDescribedby),(t.has("ariaLabelledby")||t.has("ariaLabelledByElements")||t.has("label"))&&this.setComboboxAriaLabelledByElements(),t.has("multiselect")&&(this.setMultiselectAriaLabelledbyElements(),this._truncateChips&&this.setupResizeObserver()),t.has("value")&&this.multiselect&&this._truncateChips&&this.scheduleOverflowCalculation(),t.has("wrapChips")&&(this.wrapChips?(this._truncateChips=!1,this._resizeObserver?.disconnect()):(this._truncateChips=!0,this.setupResizeObserver())),t.has("_truncateChips")&&this._truncateChips&&this.scheduleOverflowCalculation(),t.has("_searchValue")&&this._searchValue===""&&this._expanded){const e=this.autocomplete&&!this.multiselect&&this.value!==void 0&&this.value!==null&&this.value!=="",s=this.value;this.updateComplete.then(()=>{!this._expanded||this._searchValue!==""||!this.listRef.value||(e?this._activeDescendant=this.listRef.value.setFalseFocusToValue(s):this._activeDescendant=this.listRef.value.falseFocusFirstItem(),this.listRef.value._setFauxFocusToCurrentItem(),this.setAriaActiveDescendant())})}t.has("value")&&this.multiselect&&(Array.isArray(this.value)?this._selectedValues=[...this.value]:this._selectedValues=[]),this._hasSlottedListItems&&(t.has("value")||t.has("_selectedValues")||t.has("_searchValue")||t.has("multiselect")||t.has("autocomplete")||t.has("_hasSlottedListItems"))&&this.syncSlottedListItems()}get comboboxElement(){return this.autocomplete?this.inputRef.value:this.controlRef.value}setComboboxAriaAttributes(){const t=this.comboboxElement,e=this.autocomplete?this.controlRef.value:this.inputRef.value,s={role:"combobox","aria-autocomplete":"list","aria-expanded":`${this._expanded}`,"aria-describedby":this.ariaDescribedby,"aria-required":`${this.required}`,"aria-readonly":`${this.readonly}`};Object.entries(s).forEach(([i,a])=>{t?.setAttribute(i,a),e?.removeAttribute(i)}),t&&(t.ariaControlsElements=[this.listRef.value],this.setComboboxAriaLabelledByElements()),e&&(e.ariaControlsElements=null,e.ariaLabelledByElements=null)}setComboboxAriaLabelledByElements(){const t=this.shadowRoot?.getElementById(this.labelId),e=this.shadowRoot?.getElementById(this.ariaLabelledbyValue),s=this.ariaLabelledByElements||[],i=this.multiselect?this.shadowRoot?.getElementById(`multiselect-label-${this.id}`):void 0;this.comboboxElement&&(this.comboboxElement.ariaLabelledByElements=[i,t,e,...s].filter(Boolean))}setMultiselectAriaLabelledbyElements(){if(!this.multiselect)return;const t=this.shadowRoot?.getElementById(`multiselect-label-${this.id}`);if(this.comboboxElement&&t){const e=this.comboboxElement.ariaLabelledByElements||null;this.comboboxElement.ariaLabelledByElements=e?[t,...e]:[t]}}setAriaActiveDescendant(){const t=this.comboboxElement;t&&(t.ariaActiveDescendantElement=this._activeDescendant||null)}clearAriaActiveDescendant(){const t=this.comboboxElement;t&&(t.ariaActiveDescendantElement=null)}get inputMarkup(){return r`
42
+ <input ${f(this.inputRef)}
43
43
  type="${this.type}"
44
44
  .id="${this.id}"
45
45
  .placeholder="${this.placeholder}"
@@ -54,13 +54,13 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
54
54
  @keydown="${this.handleInputKeydown}"
55
55
  @focusin="${this.handleInputFocusIn}"
56
56
  @focusout="${this.handleInputFocusOut}"
57
- />`}get multiselectLabel(){return this.multiselect?r`<div id="multiselect-label-${this.id}" class="gator-multiselect-label">${this.selectedValues?.join(this.multiselectValueDelimiter)}</div>`:b}get multiselectSelectionsMarkup(){return r`
57
+ />`}get multiselectLabel(){return this.multiselect?r`<div id="multiselect-label-${this.id}" class="gator-multiselect-label">${this.selectedValues?.join(this.multiselectValueDelimiter)}</div>`:p}get multiselectSelectionsMarkup(){return r`
58
58
  <div class="gator-multiselect-selections">
59
59
  ${this.multiselectLabel}
60
60
  ${this._truncateChips?this.truncatedChipsMarkup:this.chipsMarkup}
61
- ${this.autocomplete?this.inputMarkup:this.selectedValues.length===0?this.fauxInputMarkup:b}
61
+ ${this.autocomplete?this.inputMarkup:this.selectedValues.length===0?this.fauxInputMarkup:p}
62
62
  </div>
63
- `}get chipsMarkup(){return this.selectedValues.map(e=>r`
63
+ `}get chipsMarkup(){return this.selectedValues.map(t=>r`
64
64
  <ngc-chip
65
65
  readonly
66
66
  aria-hidden="true"
@@ -68,10 +68,10 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
68
68
  size="small"
69
69
  ?dismissible="${!this.readonly}"
70
70
  ?disabled="${this.disabled}"
71
- @dismiss=${()=>this.removeSelection(e)}
71
+ @dismiss=${()=>this.removeSelection(t)}
72
72
  >
73
- ${this.getLabelFromValue(e)}
74
- </ngc-chip>`)}getLabelFromValue(e){const t=this.options.find(s=>s.value===e);return t?t.label:e}get truncatedChipsMarkup(){return r`
73
+ ${this.getLabelFromValue(t)}
74
+ </ngc-chip>`)}getLabelFromValue(t){if(this._hasSlottedListItems){const s=this.slottedListItems.find(i=>this.isSameOptionValue(i.value,t));if(s)return s.text||String(t)}const e=this.options.find(s=>this.isSameOptionValue(s.value,t));return e?e.label:t}get truncatedChipsMarkup(){return r`
75
75
  <div class="gator-chips-container ${this.autocomplete?"gator-chips-container-autocomplete":""}">
76
76
  ${this.chipsMarkup}
77
77
  ${this._showOverflowChip?r`
@@ -87,21 +87,21 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
87
87
  >
88
88
  +${this.selectedValues.length-this._visibleChipCount}
89
89
  </ngc-chip>
90
- `:b}
90
+ `:p}
91
91
  </div>
92
- `}handleOverflowChipClick(){requestAnimationFrame(()=>{this.toggleListbox(n.DOWN,!1)})}scheduleOverflowCalculation(){this._calculationPending||(this._calculationPending=!0,requestAnimationFrame(()=>{this.calculateOverflow(),this._calculationPending=!1}))}calculateOverflow(){if(!this.multiselect||this.selectedValues.length<=1){this._showOverflowChip=!1,this._visibleChipCount=1/0;return}const e=this.shadowRoot?.querySelector(".gator-chips-container"),t=this.shadowRoot?.querySelector(".gator-multiselect-selections");if(!e||!t)return;const s=this.autocomplete?t.clientWidth/3*2:t.clientWidth,i=50,o=8,u=e.querySelectorAll("ngc-chip:not(.gator-overflow-chip)");u.forEach(c=>c.classList.add("gator-visually-hidden"));for(let c=1;c<=this.selectedValues.length;c++){u.forEach((p,f)=>{f<c?p.classList.remove("gator-visually-hidden"):p.classList.add("gator-visually-hidden")});const E=e.scrollWidth,x=c===this.selectedValues.length;if(E+(!x?i+o:0)>s){const p=Math.max(1,c-1);this._visibleChipCount=p,this._showOverflowChip=p<this.selectedValues.length,u.forEach((f,A)=>{A<p?f.classList.remove("gator-visually-hidden"):f.classList.add("gator-visually-hidden")});return}if(x){this._visibleChipCount=this.selectedValues.length,this._showOverflowChip=!1;return}}}setupResizeObserver(){this.multiselect&&(this._resizeObserver=new ResizeObserver(()=>{this.scheduleOverflowCalculation()}),requestAnimationFrame(()=>{const e=this.shadowRoot?.querySelector(".gator-multiselect-selections");e&&this._resizeObserver?.observe(e)}))}removeSelection(e){let t=this.selectedValues;t=t.filter(s=>s!==e),this.emitChangeEvent(t)}get fauxInputMarkup(){return r`
92
+ `}handleOverflowChipClick(){requestAnimationFrame(()=>{this.toggleListbox(n.DOWN,!1)})}scheduleOverflowCalculation(){this._calculationPending||(this._calculationPending=!0,requestAnimationFrame(()=>{this.calculateOverflow(),this._calculationPending=!1}))}calculateOverflow(){if(!this.multiselect||this.selectedValues.length<=1){this._showOverflowChip=!1,this._visibleChipCount=1/0;return}const t=this.shadowRoot?.querySelector(".gator-chips-container"),e=this.shadowRoot?.querySelector(".gator-multiselect-selections");if(!t||!e)return;const s=this.autocomplete?e.clientWidth/3*2:e.clientWidth,i=50,a=8,u=t.querySelectorAll("ngc-chip:not(.gator-overflow-chip)");u.forEach(c=>c.classList.add("gator-visually-hidden"));for(let c=1;c<=this.selectedValues.length;c++){u.forEach((m,b)=>{b<c?m.classList.remove("gator-visually-hidden"):m.classList.add("gator-visually-hidden")});const x=t.scrollWidth,_=c===this.selectedValues.length;if(x+(!_?i+a:0)>s){const m=Math.max(1,c-1);this._visibleChipCount=m,this._showOverflowChip=m<this.selectedValues.length,u.forEach((b,L)=>{L<m?b.classList.remove("gator-visually-hidden"):b.classList.add("gator-visually-hidden")});return}if(_){this._visibleChipCount=this.selectedValues.length,this._showOverflowChip=!1;return}}}setupResizeObserver(){this.multiselect&&(this._resizeObserver=new ResizeObserver(()=>{this.scheduleOverflowCalculation()}),requestAnimationFrame(()=>{const t=this.shadowRoot?.querySelector(".gator-multiselect-selections");t&&this._resizeObserver?.observe(t)}))}removeSelection(t){let e=this.selectedValues;e=e.filter(s=>s!==t),this.emitChangeEvent(e)}get fauxInputMarkup(){return r`
93
93
  <div class="gator-faux-input ${this.showPlaceholder?"gator-faux-input-placeholder":null}">
94
94
  ${this.displayedValue||this.placeholder}
95
95
  </div>
96
- `}get displayedValue(){return!this.value||this.multiselect?"":this.valueDisplayed?this.dataType==="phoneCodes"&&typeof this.value=="string"?S(this.value)||this.value:this.value:this.displayedOptions.find(t=>t.value===this.value)?.label??String(this.value)}get autocompleteEditorValue(){if(!this.autocomplete)return this.displayedValue;if(this.multiselect)return this._searchValue;if(this._expanded){const e=this.value!==void 0&&this.value!==null&&this.value!=="";return this._searchValue===""&&e?this.displayedValue:this._searchValue}return this.displayedValue}get showPlaceholder(){return this.placeholder&&!this.value}get listboxMarkup(){return r`
96
+ `}get displayedValue(){return!this.value||this.multiselect?"":this.valueDisplayed?this.dataType==="phoneCodes"&&typeof this.value=="string"?T(this.value)||this.value:this.value:this._hasSlottedListItems?this.slottedListItems.find(s=>this.isSameOptionValue(s.value,this.value))?.text??String(this.value):this.displayedOptions.find(e=>this.isSameOptionValue(e.value,this.value))?.label??String(this.value)}get autocompleteEditorValue(){if(!this.autocomplete)return this.displayedValue;if(this.multiselect)return this._searchValue;if(this._expanded){const t=this.value!==void 0&&this.value!==null&&this.value!=="";return this._searchValue===""&&t?this.displayedValue:this._searchValue}return this.displayedValue}get showPlaceholder(){return this.placeholder&&!this.value}get listboxMarkup(){return r`
97
97
  <div
98
- ${m(this.listboxRef)}
98
+ ${f(this.listboxRef)}
99
99
  popover="manual"
100
100
  class="gator-dropdown-listbox ${this._expanded?"gator-dropdown-listbox_expanded":""}"
101
101
  >
102
102
  ${this.listboxMessageMarkup}
103
103
  <ngc-list
104
- ${m(this.listRef)}
104
+ ${f(this.listRef)}
105
105
  id="listbox-${this.id}"
106
106
  selectable
107
107
  faux-focus
@@ -112,37 +112,44 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
112
112
  ${this.selectAll&&this.multiselect?r`
113
113
  <ngc-list-item
114
114
  class="gator-dropdown-select-all"
115
+ data-select-all-icon="${this.selectAllIcon}"
115
116
  hide-checkmark
116
- start-icon="${this.selectAllIcon}"
117
117
  text="${v("Select All")}"
118
- value="all"
118
+ value="${I}"
119
119
  faux-focus
120
120
  ?selected="${this.allSelected}"
121
- ></ngc-list-item>
122
- `:b}
123
- ${$(this.displayedOptions??[],e=>e.value,e=>r`
121
+ >
122
+ <ngc-icon slot="start" name="${this.selectAllIcon}"></ngc-icon>
123
+ </ngc-list-item>
124
+ `:p}
125
+ <slot @slotchange=${this.handleDefaultSlotChange}></slot>
126
+ ${this._hasSlottedListItems?p:$(this.displayedOptions??[],t=>t.value,t=>{const e=this.getStartIconForOption(t);return r`
124
127
  <ngc-list-item
125
128
  class="gator-dropdown-option"
126
- text="${e.label}"
127
- .value="${e.value}"
128
- ?selected="${this.getOptionSelected(e.value)}"
129
- id="${this.id}-${e.value}"
130
- start-icon="${y(this.getStartIconForOption(e.value))}"
129
+ text="${t.label}"
130
+ .value="${t.value}"
131
+ subtitle="${y(t.subtitle)}"
132
+ ?selected="${this.getOptionSelected(t.value)}"
133
+ ?disabled="${!!t.disabled}"
134
+ id="${this.id}-${t.value}"
131
135
  faux-focus
132
- ></ngc-list-item>
133
- `)}
136
+ >
137
+ ${e?r`<ngc-icon slot="start" name="${e}"></ngc-icon>`:p}
138
+ ${t.endIcon?r`<ngc-icon slot="end" name="${t.endIcon}"></ngc-icon>`:p}
139
+ </ngc-list-item>
140
+ `})}
134
141
  </ngc-list>
135
142
  </div>
136
- `}get selectAllIcon(){return this.allSelected?"checkbox-selected":this.selectedValues.length===0?"checkbox":"checkbox-indeterminate"}get allSelected(){return this.selectedValues.length===this.displayedOptions.length}selectAllOptions(){this.emitChangeEvent(this.displayedOptions.map(e=>e.value))}deselectAllOptions(){this.emitChangeEvent([])}getOptionSelected(e){return this.multiselect?this.selectedValues.some(t=>t===e):this.value===e}get listboxMessageMarkup(){let e;if(this.listboxHelpText)e=this.listboxHelpText;else if(this.isTagInputMode&&this._searchValue.trim()&&this.displayedOptions.length===0)e=this.tagInputHintMessage;else{if(!this.autocomplete)return null;this.displayedOptions.length===0&&(e=this.noResultsMessage),this.resultsExceedMax&&(e=this.resultsExceedMaxMessage)}return this.setListboxMessageAriaDescribedByElements(),e?r`
143
+ `}get slottedListItems(){return Array.from(this.children).filter(t=>t.tagName==="NGC-LIST-ITEM")}refreshSlottedMode(){const t=this.slottedListItems.length>0;t!==this._hasSlottedListItems&&(this._hasSlottedListItems=t)}handleDefaultSlotChange(){this.refreshSlottedMode(),this._hasSlottedListItems&&this.syncSlottedListItems()}isSameOptionValue(t,e){return t===e}syncSlottedListItems(){const t=this.autocomplete?this._searchValue.trim().toLowerCase():"",e=this.autocomplete&&this.maxAutocompleteResults!=null?this.maxAutocompleteResults:1/0;let s=0;for(const i of this.slottedListItems){i.fauxFocus=!0;const a=this.getOptionSelected(i.value);i.selected=a;const u=(i.text||"").toLowerCase(),c=(i.subtitle||"").toLowerCase();if(!(!t||u.includes(t)||c.includes(t))){i.hidden=!0;continue}if(s>=e&&!a){i.hidden=!0;continue}i.hidden=!1,s+=1}this._expanded&&this.listRef.value&&(this._activeDescendant=this.listRef.value.setCurrentListItem()??void 0,this.listRef.value._setFauxFocusToCurrentItem(),this.setAriaActiveDescendant())}get visibleSlottedListItemCount(){return this.slottedListItems.filter(t=>!t.hidden).length}get hasVisibleListOptions(){return this._hasSlottedListItems?this.visibleSlottedListItemCount>0:this.displayedOptions.length>0}get selectableOptionValues(){return this._hasSlottedListItems?this.slottedListItems.filter(t=>!t.disabled&&!t.hidden).map(t=>t.value):this.displayedOptions.filter(t=>!t.disabled).map(t=>t.value)}get selectAllIcon(){return this.allSelected?"checkbox-selected":this.selectedValues.length===0?"checkbox":"checkbox-indeterminate"}get allSelected(){const t=this.selectableOptionValues;return t.length>0&&t.every(e=>this.selectedValues.some(s=>this.isSameOptionValue(s,e)))}selectAllOptions(){this.emitChangeEvent([...this.selectableOptionValues])}deselectAllOptions(){this.emitChangeEvent([])}getOptionSelected(t){return this.multiselect?this.selectedValues.some(e=>this.isSameOptionValue(e,t)):this.isSameOptionValue(this.value,t)}get listboxMessageMarkup(){let t;const e=this._hasSlottedListItems?this.visibleSlottedListItemCount:this.displayedOptions.length;if(this.listboxHelpText)t=this.listboxHelpText;else if(this.isTagInputMode&&this._searchValue.trim()&&e===0)t=this.tagInputHintMessage;else{if(!this.autocomplete)return null;e===0&&(t=this.noResultsMessage),this.resultsExceedMax&&(t=this.resultsExceedMaxMessage)}return this.setListboxMessageAriaDescribedByElements(),t?r`
137
144
  <div
138
145
  class="gator-dropdown-listbox-message"
139
146
  id="listbox-message-${this.id}"
140
147
  data-testid="${this.dataTestid}-listbox-message"
141
- ${m(this.listboxMessageRef)}
148
+ ${f(this.listboxMessageRef)}
142
149
  >
143
- ${e}
150
+ ${t}
144
151
  </div>
145
- `:null}setListboxMessageAriaDescribedByElements(){requestAnimationFrame(()=>{const e=this.listboxMessageRef.value;if(!this.inputRef.value)return;const t=this.inputRef.value.ariaDescribedByElements||[],s=this.listRef.value.ariaDescribedByElements||[];if(e){t.includes(e)||(this.inputRef.value.ariaDescribedByElements=[e,...t]),s.includes(e)||(this.listRef.value.ariaDescribedByElements=[e,...s]);return}this.inputRef.value.ariaDescribedByElements=t.filter(i=>i.id!==`listbox-message-${this.id}`),this.listRef.value.ariaDescribedByElements=s.filter(i=>i.id!==`listbox-message-${this.id}`)})}get resultsExceedMaxMessage(){return v(r`Showing ${this.maxAutocompleteResults} results. Refine your search to see more.`)}get noResultsMessage(){return v("No results found. Refine your search.")}get isTagInputMode(){return this.tagInput&&this.multiselect&&this.autocomplete}get shouldSuppressEmptyListbox(){return this.isTagInputMode&&this._searchValue.trim()===""&&this.filteredOptions.length===0}get tagInputHintMessage(){const e=this._searchValue.trim();return v(r`Press <kbd class="gator-tag-input-kbd">enter</kbd> or <kbd class="gator-tag-input-kbd">tab</kbd> to add "<strong>${e}</strong>"`)}get displayedOptions(){return this.autocomplete?this.limitedOptions:this.filteredOptions}get filteredOptions(){let e=this.options??[];return this.dataType==="country"?e=k():this.dataType==="state"&&this.countryCode?e=M(this.countryCode):this.dataType==="naics"?e=D():this.dataType==="phoneCodes"&&(e=T()),this._searchValue?this.dataType==="phoneCodes"?e.filter(s=>F(s,this._searchValue)):[...e.filter(s=>s.label.toLowerCase().includes(this._searchValue.toLowerCase()))]:e}get limitedOptions(){const e=this.filteredOptions,t=this.maxAutocompleteResults??e.length;if(!this.multiselect)return e.filter((i,o)=>o<t||i.value===this.value);const s=new Set(this.selectedValues);return e.filter((i,o)=>o<t||s.has(i.value))}get resultsExceedMax(){return!this.autocomplete||!this.maxAutocompleteResults?!1:this.filteredOptions.length>this.maxAutocompleteResults}getStartIconForOption(e){if(typeof e=="string"&&this.dataType==="phoneCodes")return _(e)||void 0}handleSelected(e){if(e.stopImmediatePropagation(),this.clearAriaActiveDescendant(),this.multiselect){if(e.detail.value==="all"){this.allSelected?this.deselectAllOptions():this.selectAllOptions();return}const t=this.selectedValues,s=typeof this.options?.[0]?.value=="number"?"number":"string",i=t.findIndex(o=>{const u=s==="number"?Number(e.detail.value):e.detail.value;return o===u});i>-1?t.splice(i,1):s==="number"?t.push(Number(e.detail.value)):t.push(e.detail.value),t&&this.emitChangeEvent(t)}else this.closeListbox(),this.emitChangeEvent(e.detail.value)}get selectedValues(){return this.multiselect&&Array.isArray(this.value)?this._selectedValues:[]}handleComboboxKeydown(e){if(!this._expanded&&(e.key===n.ENTER||e.key===n.SPACE||e.key===n.DOWN))this.toggleListbox(e.key,!1);else if(this._expanded&&this.listRef.value){if(e.key===n.ENTER||e.key===n.SPACE){if(e.key===n.ENTER&&this.tryAddTagFromKeyboard(e))return;this.listRef.value?.selectFalseFocusedItem()}e.key===n.DOWN&&(e.preventDefault(),this._activeDescendant=this.listRef.value?.falseFocusNextItem(),this.setAriaActiveDescendant()),e.key===n.UP&&(e.preventDefault(),this._activeDescendant=this.listRef.value?.falseFocusPreviousItem(),this.setAriaActiveDescendant())}(e.key===n.ESCAPE||e.key===n.TAB)&&this.closeListbox()}toggleListbox(e,t){if(this.disabled||this.readonly)return;if(!t){if(!this._expanded&&this.shouldSuppressEmptyListbox){requestAnimationFrame(()=>{this.comboboxElement?.focus()});return}this._expanded=!this._expanded}const s=this.listboxRef.value;if(this._expanded&&s&&!this.shouldSuppressEmptyListbox)try{s.showPopover()}catch{}else if((!this._expanded||this.shouldSuppressEmptyListbox)&&s)try{s.hidePopover()}catch{}this.assignPosition(),this.listRef.value&&(this.autocomplete&&!this.multiselect&&this.value!==void 0&&this.value!==null&&this.value!==""?this._activeDescendant=this.listRef.value.setFalseFocusToValue(this.value):e==n.DOWN||!this.value?this._activeDescendant=this.listRef.value.falseFocusFirstItem():this.value&&(this._activeDescendant=this.listRef.value.setFalseFocusToValue(this.value))),this._expanded&&(this._truncateChips=!1,this.setAriaActiveDescendant(),requestAnimationFrame(()=>{this.comboboxElement?.focus()})),this._expanded||(this._activeDescendant=void 0,this.clearAriaActiveDescendant(),this.wrapChips||(this._truncateChips=!0),this.autocomplete&&(this._searchValue=""))}closeListbox(){this._expanded=!1,this.autocomplete&&(this._searchValue=""),this._activeDescendant=void 0,this.clearAriaActiveDescendant(),this.wrapChips||(this._truncateChips=!0);const e=this.listboxRef.value;if(e)try{e.hidePopover()}catch{}}get endIconMarkup(){return r`<ngc-icon
152
+ `:null}setListboxMessageAriaDescribedByElements(){requestAnimationFrame(()=>{const t=this.listboxMessageRef.value;if(!this.inputRef.value)return;const e=this.inputRef.value.ariaDescribedByElements||[],s=this.listRef.value.ariaDescribedByElements||[];if(t){e.includes(t)||(this.inputRef.value.ariaDescribedByElements=[t,...e]),s.includes(t)||(this.listRef.value.ariaDescribedByElements=[t,...s]);return}this.inputRef.value.ariaDescribedByElements=e.filter(i=>i.id!==`listbox-message-${this.id}`),this.listRef.value.ariaDescribedByElements=s.filter(i=>i.id!==`listbox-message-${this.id}`)})}get resultsExceedMaxMessage(){return v(r`Showing ${this.maxAutocompleteResults} results. Refine your search to see more.`)}get noResultsMessage(){return v("No results found. Refine your search.")}get isTagInputMode(){return this.tagInput&&this.multiselect&&this.autocomplete}get shouldSuppressEmptyListbox(){return this._hasSlottedListItems?this.isTagInputMode&&this._searchValue.trim()===""&&this.slottedListItems.length===0:this.isTagInputMode&&this._searchValue.trim()===""&&this.filteredOptions.length===0}get tagInputHintMessage(){const t=this._searchValue.trim();return v(r`Press <kbd class="gator-tag-input-kbd">enter</kbd> or <kbd class="gator-tag-input-kbd">tab</kbd> to add "<strong>${t}</strong>"`)}get displayedOptions(){return this.autocomplete?this.limitedOptions:this.filteredOptions}get filteredOptions(){let t=this.options??[];return this.dataType==="country"?t=M():this.dataType==="state"&&this.countryCode?t=D(this.countryCode):this.dataType==="naics"?t=k():this.dataType==="phoneCodes"&&(t=F()),this._searchValue?this.dataType==="phoneCodes"?t.filter(s=>B(s,this._searchValue)):[...t.filter(s=>s.label.toLowerCase().includes(this._searchValue.toLowerCase()))]:t}get limitedOptions(){const t=this.filteredOptions,e=this.maxAutocompleteResults??t.length;if(!this.multiselect)return t.filter((i,a)=>a<e||i.value===this.value);const s=new Set(this.selectedValues);return t.filter((i,a)=>a<e||s.has(i.value))}get resultsExceedMax(){if(!this.autocomplete||!this.maxAutocompleteResults)return!1;if(this._hasSlottedListItems){const t=this._searchValue.trim().toLowerCase();return this.slottedListItems.filter(s=>{if(!t)return!0;const i=(s.text||"").toLowerCase(),a=(s.subtitle||"").toLowerCase();return i.includes(t)||a.includes(t)}).length>this.maxAutocompleteResults}return this.filteredOptions.length>this.maxAutocompleteResults}getStartIconForOption(t){if(t.startIcon)return t.startIcon;if(typeof t.value=="string"&&this.dataType==="phoneCodes")return C(t.value)||void 0}handleSelected(t){if(t.stopImmediatePropagation(),this.clearAriaActiveDescendant(),this.multiselect){if(t.detail.value===I){this.allSelected?this.deselectAllOptions():this.selectAllOptions();return}const e=this.selectedValues,s=this.valueArrayType,i=e.findIndex(a=>{const u=s==="number"?Number(t.detail.value):t.detail.value;return a===u});i>-1?e.splice(i,1):s==="number"?e.push(Number(t.detail.value)):e.push(t.detail.value),e&&this.emitChangeEvent(e)}else this.closeListbox(),this.emitChangeEvent(t.detail.value)}get selectedValues(){return this.multiselect&&Array.isArray(this.value)?this._selectedValues:[]}handleComboboxKeydown(t){if(!this._expanded&&(t.key===n.ENTER||t.key===n.SPACE||t.key===n.DOWN))this.toggleListbox(t.key,!1);else if(this._expanded&&this.listRef.value){if(t.key===n.ENTER||t.key===n.SPACE){if(t.key===n.ENTER&&this.tryAddTagFromKeyboard(t))return;this.listRef.value?.selectFalseFocusedItem()}t.key===n.DOWN&&(t.preventDefault(),this._activeDescendant=this.listRef.value?.falseFocusNextItem(),this.setAriaActiveDescendant()),t.key===n.UP&&(t.preventDefault(),this._activeDescendant=this.listRef.value?.falseFocusPreviousItem(),this.setAriaActiveDescendant())}(t.key===n.ESCAPE||t.key===n.TAB)&&this.closeListbox()}toggleListbox(t,e){if(this.disabled||this.readonly)return;if(!e){if(!this._expanded&&this.shouldSuppressEmptyListbox){requestAnimationFrame(()=>{this.comboboxElement?.focus()});return}this._expanded=!this._expanded}const s=this.listboxRef.value;if(this._expanded&&s&&!this.shouldSuppressEmptyListbox)try{s.showPopover()}catch{}else if((!this._expanded||this.shouldSuppressEmptyListbox)&&s)try{s.hidePopover()}catch{}this.assignPosition(),this.listRef.value&&(this.autocomplete&&!this.multiselect&&this.value!==void 0&&this.value!==null&&this.value!==""?this._activeDescendant=this.listRef.value.setFalseFocusToValue(this.value):t==n.DOWN||!this.value?this._activeDescendant=this.listRef.value.falseFocusFirstItem():this.value&&(this._activeDescendant=this.listRef.value.setFalseFocusToValue(this.value))),this._expanded&&(this._truncateChips=!1,this.setAriaActiveDescendant(),requestAnimationFrame(()=>{this.comboboxElement?.focus()})),this._expanded||(this._activeDescendant=void 0,this.clearAriaActiveDescendant(),this.wrapChips||(this._truncateChips=!0),this.autocomplete&&(this._searchValue=""))}closeListbox(){this._expanded=!1,this.autocomplete&&(this._searchValue=""),this._activeDescendant=void 0,this.clearAriaActiveDescendant(),this.wrapChips||(this._truncateChips=!0);const t=this.listboxRef.value;if(t)try{t.hidePopover()}catch{}}get endIconMarkup(){return r`<ngc-icon
146
153
  class="gator-dropdown-chevron"
147
154
  name="${this.renderedEndIcon}"
148
155
  ?disabled="${this.disabled||this.readonly}"
@@ -155,4 +162,4 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
155
162
  @click="${this.clearValue}"
156
163
  ?disabled="${this.disabled||this.readonly}"
157
164
  ></ngc-icon-button>
158
- `}clearValue(){this.inputRef.value&&(this.inputRef.value.value=""),this._searchValue="",this.inputRef.value?.focus(),this.emitChangeEvent(this.multiselect?[]:"")}assignPosition(){const e=this.controlRef.value;!this.listboxRef||!this.listboxRef.value||!e||(this._cleanup?.(),this._cleanup=O(e,this.listboxRef.value,async()=>{if(!this.listboxRef||!this.listboxRef.value||!e)return;const{x:t,y:s,placement:i}=await I(e,this.listboxRef.value,{strategy:"fixed",placement:"bottom-start",middleware:[L()]});let o=i==="bottom-start"?4:-4;Object.assign(this.listboxRef.value.style,{left:`${t}px`,top:`${s+o}px`,width:`${this.listWidth??e.clientWidth}px`})},{animationFrame:!0}))}handleInput(e){e.preventDefault(),e.stopPropagation();let t=e.target;t.value.length===0&&!this.multiselect&&this.emitChangeEvent(""),this._searchValue=t.value,this.shouldSuppressEmptyListbox?this._expanded&&this.closeListbox():(this._expanded=!0,this.showListboxPopover(),this.assignPosition()),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:t.value}}))}handleInputKeydown(e){if((e.key===n.DOWN||e.key===n.UP)&&e.preventDefault(),e.key===n.SPACE){e.stopPropagation();return}this.tryAddTagFromKeyboard(e)||e.key===n.BACKSPACE&&this.tryRemoveLastChipFromBackspace(e)}tryRemoveLastChipFromBackspace(e){if(!this.autocomplete||!this.multiselect||this._searchValue.trim()!=="")return;e.preventDefault(),e.stopPropagation(),this._searchValue!==""&&this.clearSearchInput();const t=this.selectedValues||[];t.length>0&&(t.pop(),this.emitChangeEvent(t))}tryAddTagFromKeyboard(e){if(!this.isTagInputMode)return!1;const t=e.key===n.ENTER,s=e.key===n.TAB;return!t&&!s||!this._searchValue.trim()||t&&this._expanded&&this.displayedOptions.length>0&&this.listRef.value&&this.listRef.value.listItems.some(u=>u.falseFocusing)?!1:(e.preventDefault(),e.stopPropagation(),this.addTagFromInput(),this.inputRef.value?.focus(),!0)}showListboxPopover(){const e=this.listboxRef.value;if(e)try{e.showPopover()}catch{}}get valueArrayType(){return this.selectedValues.length>0?typeof this.selectedValues[0]=="number"?"number":"string":this.options?.length&&typeof this.options[0].value=="number"?"number":"string"}addTagFromInput(){const e=this._searchValue.trim();if(!e||!this.isTagInputMode)return;const t=[...this.selectedValues],s=this.valueArrayType,i=s==="number"?Number(e):e;if(!(s==="number"&&Number.isNaN(i))){if(t.some(o=>o===i)){this.clearSearchInput(),this.shouldSuppressEmptyListbox&&this.closeListbox();return}t.push(i),this.emitChangeEvent(t),this.clearSearchInput(),this.shouldSuppressEmptyListbox&&this.closeListbox()}}clearSearchInput(){this._searchValue="",this.inputRef.value&&(this.inputRef.value.value="")}emitChangeEvent(e){this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:Array.isArray(e)?[...e]:e}}))}};l.shadowRootOptions={...C.shadowRootOptions,delegatesFocus:!0};l.styles=[...H(l,l,"styles"),N(B)];a([h({type:Boolean})],l.prototype,"multiselect",2);a([h({type:Array})],l.prototype,"options",2);a([h({type:Boolean})],l.prototype,"autocomplete",2);a([h({type:Boolean,attribute:"select-all"})],l.prototype,"selectAll",2);a([h({type:String,attribute:"listbox-help-text"})],l.prototype,"listboxHelpText",2);a([h({type:String,attribute:"data-type"})],l.prototype,"dataType",2);a([h({type:String,attribute:"country-code"})],l.prototype,"countryCode",2);a([h({type:String,attribute:"list-width"})],l.prototype,"listWidth",2);a([h({type:Boolean,attribute:"value-displayed"})],l.prototype,"valueDisplayed",2);a([h({type:Number,attribute:"max-autocomplete-results"})],l.prototype,"maxAutocompleteResults",2);a([h({type:Boolean,attribute:"wrap-chips"})],l.prototype,"wrapChips",2);a([h({type:Boolean,attribute:"hide-clear"})],l.prototype,"hideClear",2);a([h({type:Boolean})],l.prototype,"loading",2);a([h({type:Boolean,attribute:"tag-input"})],l.prototype,"tagInput",2);a([d()],l.prototype,"_activeDescendant",2);a([d()],l.prototype,"_expanded",2);a([d()],l.prototype,"_searchValue",2);a([d()],l.prototype,"_focused",2);a([d()],l.prototype,"_hovered",2);a([d()],l.prototype,"_visibleChipCount",2);a([d()],l.prototype,"_showOverflowChip",2);a([d()],l.prototype,"_truncateChips",2);a([d()],l.prototype,"_selectedValues",2);l=a([V("ngc-input-dropdown"),R()],l);export{l as NgcInputDropdown};
165
+ `}clearValue(){this.inputRef.value&&(this.inputRef.value.value=""),this._searchValue="",this.inputRef.value?.focus(),this.emitChangeEvent(this.multiselect?[]:"")}assignPosition(){const t=this.controlRef.value;!this.listboxRef||!this.listboxRef.value||!t||(this._cleanup?.(),this._cleanup=S(t,this.listboxRef.value,async()=>{if(!this.listboxRef||!this.listboxRef.value||!t)return;const{x:e,y:s,placement:i}=await w(t,this.listboxRef.value,{strategy:"fixed",placement:"bottom-start",middleware:[O()]});let a=i==="bottom-start"?4:-4;Object.assign(this.listboxRef.value.style,{left:`${e}px`,top:`${s+a}px`,width:`${this.listWidth??t.clientWidth}px`})},{animationFrame:!0}))}handleInput(t){t.preventDefault(),t.stopPropagation();let e=t.target;e.value.length===0&&!this.multiselect&&this.emitChangeEvent(""),this._searchValue=e.value,this.shouldSuppressEmptyListbox?this._expanded&&this.closeListbox():(this._expanded=!0,this.showListboxPopover(),this.assignPosition()),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:e.value}}))}handleInputKeydown(t){if((t.key===n.DOWN||t.key===n.UP)&&t.preventDefault(),t.key===n.SPACE){t.stopPropagation();return}this.tryAddTagFromKeyboard(t)||t.key===n.BACKSPACE&&this.tryRemoveLastChipFromBackspace(t)}tryRemoveLastChipFromBackspace(t){if(!this.autocomplete||!this.multiselect||this._searchValue.trim()!=="")return;t.preventDefault(),t.stopPropagation(),this._searchValue!==""&&this.clearSearchInput();const e=this.selectedValues||[];e.length>0&&(e.pop(),this.emitChangeEvent(e))}tryAddTagFromKeyboard(t){if(!this.isTagInputMode)return!1;const e=t.key===n.ENTER,s=t.key===n.TAB;return!e&&!s||!this._searchValue.trim()||e&&this._expanded&&this.hasVisibleListOptions&&this.listRef.value&&this.listRef.value.listItems.some(u=>u.falseFocusing)?!1:(t.preventDefault(),t.stopPropagation(),this.addTagFromInput(),this.inputRef.value?.focus(),!0)}showListboxPopover(){const t=this.listboxRef.value;if(t)try{t.showPopover()}catch{}}get valueArrayType(){return this.selectedValues.length>0?typeof this.selectedValues[0]=="number"?"number":"string":this._hasSlottedListItems&&this.slottedListItems.length>0?typeof this.slottedListItems[0].value=="number"?"number":"string":this.options?.length&&typeof this.options[0].value=="number"?"number":"string"}addTagFromInput(){const t=this._searchValue.trim();if(!t||!this.isTagInputMode)return;const e=[...this.selectedValues],s=this.valueArrayType,i=s==="number"?Number(t):t;if(!(s==="number"&&Number.isNaN(i))){if(e.some(a=>a===i)){this.clearSearchInput(),this.shouldSuppressEmptyListbox&&this.closeListbox();return}e.push(i),this.emitChangeEvent(e),this.clearSearchInput(),this.shouldSuppressEmptyListbox&&this.closeListbox()}}clearSearchInput(){this._searchValue="",this.inputRef.value&&(this.inputRef.value.value="")}emitChangeEvent(t){this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:Array.isArray(t)?[...t]:t}}))}};l.shadowRootOptions={...A.shadowRootOptions,delegatesFocus:!0};l.styles=[...K(l,l,"styles"),P(N)];o([h({type:Boolean})],l.prototype,"multiselect",2);o([h({type:Array})],l.prototype,"options",2);o([h({type:Boolean})],l.prototype,"autocomplete",2);o([h({type:Boolean,attribute:"select-all"})],l.prototype,"selectAll",2);o([h({type:String,attribute:"listbox-help-text"})],l.prototype,"listboxHelpText",2);o([h({type:String,attribute:"data-type"})],l.prototype,"dataType",2);o([h({type:String,attribute:"country-code"})],l.prototype,"countryCode",2);o([h({type:String,attribute:"list-width"})],l.prototype,"listWidth",2);o([h({type:Boolean,attribute:"value-displayed"})],l.prototype,"valueDisplayed",2);o([h({type:Number,attribute:"max-autocomplete-results"})],l.prototype,"maxAutocompleteResults",2);o([h({type:Boolean,attribute:"wrap-chips"})],l.prototype,"wrapChips",2);o([h({type:Boolean,attribute:"hide-clear"})],l.prototype,"hideClear",2);o([h({type:Boolean})],l.prototype,"loading",2);o([h({type:Boolean,attribute:"tag-input"})],l.prototype,"tagInput",2);o([d()],l.prototype,"_activeDescendant",2);o([d()],l.prototype,"_expanded",2);o([d()],l.prototype,"_searchValue",2);o([d()],l.prototype,"_focused",2);o([d()],l.prototype,"_hovered",2);o([d()],l.prototype,"_visibleChipCount",2);o([d()],l.prototype,"_showOverflowChip",2);o([d()],l.prototype,"_truncateChips",2);o([d()],l.prototype,"_hasSlottedListItems",2);o([d()],l.prototype,"_selectedValues",2);l=o([R("ngc-input-dropdown"),E()],l);export{I as NGC_DROPDOWN_SELECT_ALL_VALUE,l as NgcInputDropdown};