@ncino/web-components 13.6.0 → 13.7.1

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.
@@ -1,4 +1,4 @@
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 E}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/repeat.js";import{msg as g}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 O}from"../../../../utils/decorators/custom-element-decorator.js";import{createRef as v,ref as m}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/ref.js";import{autoUpdate as V,computePosition as D,flip as k}from"../../../../node_modules/.pnpm/@floating-ui_dom@1.7.5/node_modules/@floating-ui/dom/dist/floating-ui.dom.js";import{KEY_CONSTANTS as n}from"../../../../consts/key-constants.js";import{formattedCountriesForDropdown as I,formattedStatesForDropdown as M}from"../../../../utils/places-utils.js";import{formattedNaicsCodes as L}from"../../../../utils/industry-utils.js";import{flagIconNameByPhoneCountryCode as C,dialCodeForPhoneCountryCode as S,formattedPhoneCountryCodes as B,phoneCountryDropdownOptionMatchesQuery as F}from"../../../../utils/phone-utils.js";import T from"../../../../packages/web-components/src/components/input/gator/dropdown/input-dropdown.gator.scss.js";import{NgcInputBase as _}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,c=e.length-1,u;c>=0;c--)(u=e[c])&&(o=(i?u(t,s,o):u(o))||o);return i&&o&&P(t,s,o),o},H=(e,t,s)=>z(W(e),s,t);let l=class extends _{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._expanded=!1,this._searchValue="",this._visibleChipCount=1/0,this._showOverflowChip=!1,this._truncateChips=!0,this._calculationPending=!1,this.listboxRef=v(),this.listRef=v(),this.inputRef=v(),this.listboxMessageRef=v(),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 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 k}from"../../../../node_modules/.pnpm/@floating-ui_dom@1.7.5/node_modules/@floating-ui/dom/dist/floating-ui.dom.js";import{KEY_CONSTANTS as n}from"../../../../consts/key-constants.js";import{formattedCountriesForDropdown as D,formattedStatesForDropdown as L}from"../../../../utils/places-utils.js";import{formattedNaicsCodes as M}from"../../../../utils/industry-utils.js";import{flagIconNameByPhoneCountryCode as C,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 _}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,o=(e,t,s,i)=>{for(var a=i>1?void 0:i?q(t,s):t,u=e.length-1,c;u>=0;u--)(c=e[u])&&(a=(i?c(t,s,a):c(a))||a);return i&&a&&P(t,s,a),a},H=(e,t,s)=>z(W(e),s,t);let l=class extends _{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._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`
2
2
  <div class="gator-form-element">
3
3
  <slot name="label">
4
4
  ${this.label?this.labelMarkup:null}
@@ -35,7 +35,7 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
35
35
  id="${this.startIconId}"
36
36
  label="${y(this.iconAsLabel?this.label:void 0)}"
37
37
  .name="${e}"
38
- ></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`
38
+ ></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,a])=>{e?.setAttribute(i,a),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`
39
39
  <input ${m(this.inputRef)}
40
40
  type="${this.type}"
41
41
  .id="${this.id}"
@@ -86,7 +86,7 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
86
86
  </ngc-chip>
87
87
  `:b}
88
88
  </div>
89
- `}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,c=e.querySelectorAll("ngc-chip:not(.gator-overflow-chip)");c.forEach(u=>u.classList.add("gator-visually-hidden"));for(let u=1;u<=this.selectedValues.length;u++){c.forEach((p,f)=>{f<u?p.classList.remove("gator-visually-hidden"):p.classList.add("gator-visually-hidden")});const $=e.scrollWidth,x=u===this.selectedValues.length;if($+(!x?i+o:0)>s){const p=Math.max(1,u-1);this._visibleChipCount=p,this._showOverflowChip=p<this.selectedValues.length,c.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`
89
+ `}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,a=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+a: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`
90
90
  <div class="gator-faux-input ${this.showPlaceholder?"gator-faux-input-placeholder":null}">
91
91
  ${this.displayedValue||this.placeholder}
92
92
  </div>
@@ -111,13 +111,13 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
111
111
  class="gator-dropdown-select-all"
112
112
  hide-checkmark
113
113
  start-icon="${this.selectAllIcon}"
114
- text="${g("Select All")}"
114
+ text="${v("Select All")}"
115
115
  value="all"
116
116
  faux-focus
117
117
  ?selected="${this.allSelected}"
118
118
  ></ngc-list-item>
119
119
  `:b}
120
- ${E(this.displayedOptions??[],e=>e.value,e=>r`
120
+ ${$(this.displayedOptions??[],e=>e.value,e=>r`
121
121
  <ngc-list-item
122
122
  class="gator-dropdown-option"
123
123
  text="${e.label}"
@@ -130,7 +130,7 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
130
130
  `)}
131
131
  </ngc-list>
132
132
  </div>
133
- `}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.autocomplete)return null;this.displayedOptions.length===0&&(e=this.noResultsMessage),this.resultsExceedMax&&(e=this.resultsExceedMaxMessage)}return this.setListboxMessageAriaDescribedByElements(),e?r`
133
+ `}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`
134
134
  <div
135
135
  class="gator-dropdown-listbox-message"
136
136
  id="listbox-message-${this.id}"
@@ -139,7 +139,7 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
139
139
  >
140
140
  ${e}
141
141
  </div>
142
- `: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 g(r`Showing ${this.maxAutocompleteResults} results. Refine your search to see more.`)}get noResultsMessage(){return g("No results found. Refine your search.")}get displayedOptions(){return this.autocomplete?this.limitedOptions:this.filteredOptions}get filteredOptions(){let e=this.options??[];return this.dataType==="country"?e=I():this.dataType==="state"&&this.countryCode?e=M(this.countryCode):this.dataType==="naics"?e=L():this.dataType==="phoneCodes"&&(e=B()),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 C(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 c=s==="number"?Number(e.detail.value):e.detail.value;return o===c});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&&((e.key===n.ENTER||e.key===n.SPACE)&&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.BACKSPACE&&this.autocomplete&&this.multiselect&&this.inputRef.value.value==="")){e.preventDefault();const t=this.selectedValues||[];t.length>0&&(t.pop(),this.emitChangeEvent(t))}(e.key===n.ESCAPE||e.key===n.TAB)&&this.closeListbox()}toggleListbox(e,t){if(this.disabled||this.readonly)return;t||(this._expanded=!this._expanded);const s=this.listboxRef.value;if(this._expanded&&s)try{s.showPopover()}catch{}else if(!this._expanded&&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
142
+ `: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=D():this.dataType==="state"&&this.countryCode?e=L(this.countryCode):this.dataType==="naics"?e=M():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,a)=>a<t||i.value===this.value);const s=new Set(this.selectedValues);return e.filter((i,a)=>a<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 C(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(a=>{const u=s==="number"?Number(e.detail.value):e.detail.value;return a===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
143
143
  class="gator-dropdown-chevron"
144
144
  name="${this.renderedEndIcon}"
145
145
  ?disabled="${this.disabled||this.readonly}"
@@ -152,4 +152,4 @@ import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@
152
152
  @click="${this.clearValue}"
153
153
  ?disabled="${this.disabled||this.readonly}"
154
154
  ></ngc-icon-button>
155
- `}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=V(e,this.listboxRef.value,async()=>{if(!this.listboxRef||!this.listboxRef.value||!e)return;const{x:t,y:s,placement:i}=await D(e,this.listboxRef.value,{placement:"bottom-start",middleware:[k()]});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`})}))}handleInput(e){e.preventDefault(),e.stopPropagation();let t=e.target;t.value.length===0&&!this.multiselect&&this.emitChangeEvent(""),this._searchValue=t.value,this._expanded=!0,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}}emitChangeEvent(e){this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:Array.isArray(e)?[...e]:e}}))}};l.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0};l.styles=[...H(l,l,"styles"),N(T)];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([d()],l.prototype,"_activeDescendant",2);a([d()],l.prototype,"_expanded",2);a([d()],l.prototype,"_searchValue",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([O("ngc-input-dropdown"),R()],l);export{l as NgcInputDropdown};
155
+ `}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=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,{placement:"bottom-start",middleware:[k()]});let a=i==="bottom-start"?4:-4;Object.assign(this.listboxRef.value.style,{left:`${t}px`,top:`${s+a}px`,width:`${this.listWidth??e.clientWidth}px`})}))}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(a=>a===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={..._.shadowRootOptions,delegatesFocus:!0};l.styles=[...H(l,l,"styles"),N(B)];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,"_visibleChipCount",2);o([d()],l.prototype,"_showOverflowChip",2);o([d()],l.prototype,"_truncateChips",2);o([d()],l.prototype,"_selectedValues",2);l=o([V("ngc-input-dropdown"),R()],l);export{l as NgcInputDropdown};
@@ -1,22 +1,22 @@
1
- import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{nothing as b,html as o}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 v}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as $}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as y}from"../../../utils/decorators/custom-element-decorator.js";import{msg as g}from"../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import"../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import{NjcTable as F}from"../table.js";import{formatTableTextValue as S}from"../table-format-utils.js";import P from"../../../packages/web-components/src/components/table/gator/table.gator.scss.js";import T from"../../../packages/styles/dist/tokens/primitive.tokens.css.js";import x from"../../../packages/styles/dist/tokens/semantic.tokens.css.js";import"./table-bulk-controls/table-bulk-controls.gator.js";import"./table-cells/table-cell-chip.gator.js";import"./table-cells/table-cell-avatar.gator.js";import"./table-cells/table-cell-checkbox.gator.js";import"./table-cells/table-cell-text-link.gator.js";import"./table-cells/table-cell-button.gator.js";import"./table-cells/table-cell-icon-button.gator.js";import"./table-cells/table-cell-input-dropdown.gator.js";import"./table-cells/table-cell-input-text.gator.js";import"./table-cells/table-cell-text.gator.js";import"../../checkbox/checkbox.gator.js";import"../../icon/gator/icon.gator.js";import"../../icon/gator/templates/index.js";import"../../icon-button/gator/icon-button.gator.js";import"../../popover/gator/popover.gator.js";import"../../checkbox-group/checkbox-group.gator.js";import"../../radio-group/radio-group.gator.js";import"../../button/gator/button.gator.js";import"../../chip/gator/chip.gator.js";import"../../input/gator/input-search/input-search.gator.js";import"../../skip-link/gator/base/skip-link.gator.js";import{unsafeCSS as C}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var _=Object.defineProperty,R=Object.getOwnPropertyDescriptor,p=(e,t,l,i)=>{for(var s=i>1?void 0:i?R(t,l):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(i?a(t,l,s):a(s))||s);return i&&s&&_(t,l,s),s};let c=class extends F{constructor(){super(...arguments),this.elevated=!1,this.includePagination=!1,this.skeleton=!1,this.sortField=null,this.sortDirection=null,this.filterValues={},this.selectedRows=[],this._currentPage=1,this._sortField=null,this._sortDirection=null,this._hoveredHeaderColumnField=null,this._pendingFilterValues={},this._filterSearchQuery={},this.renderHeaderFilterPopover=(e,t)=>{const l=e.filterOptions??[],i=(this._filterSearchQuery[e.field]??"").toLowerCase(),s=i?l.filter(u=>u.label.toLowerCase().includes(i)):l,r=this.hasActiveFilter(e),a=e.filterMultiselect===!0,d=this.getEffectivePending(e),n=s.map(u=>({title:u.label,value:String(u.value)})),h=a?d.join(";"):"",f=a?"":d||"";return o`
1
+ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{nothing as b,html as o}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 v}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as $}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as F}from"../../../utils/decorators/custom-element-decorator.js";import{msg as g}from"../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/install.js";import"../../../node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js";import{NjcTable as S}from"../table.js";import{formatTableTextValue as P}from"../table-format-utils.js";import T from"../../../packages/web-components/src/components/table/gator/table.gator.scss.js";import x from"../../../packages/styles/dist/tokens/primitive.tokens.css.js";import _ from"../../../packages/styles/dist/tokens/semantic.tokens.css.js";import"./table-bulk-controls/table-bulk-controls.gator.js";import"./table-cells/table-cell-chip.gator.js";import"./table-cells/table-cell-avatar.gator.js";import"./table-cells/table-cell-checkbox.gator.js";import"./table-cells/table-cell-text-link.gator.js";import"./table-cells/table-cell-button.gator.js";import"./table-cells/table-cell-icon-button.gator.js";import"./table-cells/table-cell-input-dropdown.gator.js";import"./table-cells/table-cell-input-text.gator.js";import"./table-cells/table-cell-text.gator.js";import"../../checkbox/checkbox.gator.js";import"../../icon/gator/icon.gator.js";import"../../icon/gator/templates/index.js";import"../../icon-button/gator/icon-button.gator.js";import"../../popover/gator/popover.gator.js";import"../../checkbox-group/checkbox-group.gator.js";import"../../radio-group/radio-group.gator.js";import"../../button/gator/button.gator.js";import"../../chip/gator/chip.gator.js";import"../../input/gator/input-search/input-search.gator.js";import"../../skip-link/gator/base/skip-link.gator.js";import{unsafeCSS as k}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var R=Object.defineProperty,A=Object.getOwnPropertyDescriptor,p=(e,t,l,i)=>{for(var s=i>1?void 0:i?A(t,l):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(i?a(t,l,s):a(s))||s);return i&&s&&R(t,l,s),s};let d=class extends S{constructor(){super(...arguments),this.elevated=!1,this.includePagination=!1,this.skeleton=!1,this.sortField=null,this.sortDirection=null,this.filterValues={},this.selectedRows=[],this._currentPage=1,this._sortField=null,this._sortDirection=null,this._hoveredHeaderColumnField=null,this._pendingFilterValues={},this._filterSearchQuery={},this.renderHeaderFilterPopover=(e,t,l=!1)=>{const i=e.filterOptions??[],s=(this._filterSearchQuery[e.field]??"").toLowerCase(),r=s?i.filter(u=>u.label.toLowerCase().includes(s)):i,a=this.hasActiveFilter(e),h=e.filterMultiselect===!0,n=this.getEffectivePending(e),c=r.map(u=>({title:u.label,value:String(u.value)})),f=h?n.join(";"):"",m=h?"":n||"";return o`
2
2
  <span class="gator-table-header-filter-trigger-wrap ${t?"gator-table-header-filter-trigger-visible":""}">
3
3
  <ngc-icon-button
4
4
  id="filter-trigger-${e.field}"
5
5
  icon-name="filters-2"
6
6
  size="xsmall"
7
7
  icon-aria-label="${g("Filter by")} ${e.name}"
8
- class="${r?"gator-table-header-filter-icon-active":""}"
8
+ class="${a?"gator-table-header-filter-icon-active":""}"
9
9
  ></ngc-icon-button>
10
10
  <ngc-popover
11
11
  reference-id="filter-trigger-${e.field}"
12
12
  .title=${g("Filter")}
13
13
  size="small"
14
- placement="bottom"
14
+ placement="${l?"bottom-start":"bottom-end"}"
15
15
  .hideTippet="${!0}"
16
16
  @closed="${()=>this.handleFilterPopoverClosed(e)}"
17
17
  >
18
18
  <div slot="content" class="gator-table-filter-popover-content">
19
- ${l.length>10?o`
19
+ ${i.length>10?o`
20
20
  <ngc-input-search
21
21
  placeholder="${g("Search")}"
22
22
  .value="${this._filterSearchQuery[e.field]??""}"
@@ -24,17 +24,17 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
24
24
  class="gator-table-filter-popover-search"
25
25
  ></ngc-input-search>
26
26
  `:b}
27
- ${a?o`
27
+ ${h?o`
28
28
  <ngc-checkbox-group
29
- .options="${n}"
30
- .value="${h}"
29
+ .options="${c}"
30
+ .value="${f}"
31
31
  aria-label="${g("Filter by")} ${e.name}"
32
32
  @change="${u=>this.handleFilterCheckboxGroupChange(u,e)}"
33
33
  ></ngc-checkbox-group>
34
34
  `:o`
35
35
  <ngc-radio-group
36
- .options="${n}"
37
- .value="${f}"
36
+ .options="${c}"
37
+ .value="${m}"
38
38
  aria-label="${g("Filter by")} ${e.name}"
39
39
  @change="${u=>this.handleFilterRadioGroupChange(u,e)}"
40
40
  ></ngc-radio-group>
@@ -91,7 +91,7 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
91
91
  @itemsperpagechanged="${this.handleItemsPerPageChanged}"
92
92
  ></ngc-table-pagination>
93
93
  `:b}
94
- `}handlePageChanged(e){this._currentPage=e.detail.page}handleItemsPerPageChanged(e){this.itemsPerPage=e.detail.itemsPerPage}getTableHeader(e){const t=e.map(l=>this.getTableHeaderColumn(l));return!this.skeleton&&this.selectable&&t.unshift(o`
94
+ `}handlePageChanged(e){this._currentPage=e.detail.page}handleItemsPerPageChanged(e){this.itemsPerPage=e.detail.itemsPerPage}getTableHeader(e){const t=e.map((l,i)=>this.getTableHeaderColumn(l,i===0));return!this.skeleton&&this.selectable&&t.unshift(o`
95
95
  <th id="col-select" scope="col">
96
96
  <ngc-checkbox
97
97
  title-text="${g("Select All")}"
@@ -105,51 +105,51 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
105
105
  ${t}
106
106
  </tr>
107
107
  </thead>
108
- `}handleSelectAll(e){const t=e.detail.selected;t?(this.data.forEach(l=>{!l.isTableHeader&&!l.disabled&&(l.selected=!0)}),this.selectedRows=this.data.filter(l=>!l.isTableHeader&&!l.disabled)):(this.data.forEach(l=>{l.disabled||(l.selected=!1)}),this.selectedRows=[]),this.dispatchEvent(new CustomEvent("selectall",{bubbles:!0,composed:!0,detail:{selectedRows:this.selectedRows,selected:t}})),this.requestUpdate()}get effectiveSortField(){return this.sortField??this._sortField}get effectiveSortDirection(){return this.sortField!=null?this.sortDirection??"asc":this._sortDirection}getSortIcon(e){return this.effectiveSortField===e.field?this.effectiveSortDirection==="asc"?"arrow-up":"arrow-down":"arrows-down-up"}getSortAriaSort(e){return this.effectiveSortField!==e.field?"none":this.effectiveSortDirection==="asc"?"ascending":"descending"}handleSortColumn(e){const t=this.effectiveSortField===e.field&&this.effectiveSortDirection==="asc"?"desc":"asc";this.sortField==null&&(this._sortField=e.field,this._sortDirection=t),this.dispatchEvent(new CustomEvent("sort",{bubbles:!0,composed:!0,detail:{field:e.field,direction:t}})),this.requestUpdate()}getTableHeaderColumn(e){const t=e.field.startsWith("skeleton-loader"),l=o`
108
+ `}handleSelectAll(e){const t=e.detail.selected;t?(this.data.forEach(l=>{!l.isTableHeader&&!l.disabled&&(l.selected=!0)}),this.selectedRows=this.data.filter(l=>!l.isTableHeader&&!l.disabled)):(this.data.forEach(l=>{l.disabled||(l.selected=!1)}),this.selectedRows=[]),this.dispatchEvent(new CustomEvent("selectall",{bubbles:!0,composed:!0,detail:{selectedRows:this.selectedRows,selected:t}})),this.requestUpdate()}get effectiveSortField(){return this.sortField??this._sortField}get effectiveSortDirection(){return this.sortField!=null?this.sortDirection??"asc":this._sortDirection}getSortIcon(e){return this.effectiveSortField===e.field?this.effectiveSortDirection==="asc"?"arrow-up":"arrow-down":"arrows-down-up"}getSortAriaSort(e){return this.effectiveSortField!==e.field?"none":this.effectiveSortDirection==="asc"?"ascending":"descending"}handleSortColumn(e){const t=this.effectiveSortField===e.field&&this.effectiveSortDirection==="asc"?"desc":"asc";this.sortField==null&&(this._sortField=e.field,this._sortDirection=t),this.dispatchEvent(new CustomEvent("sort",{bubbles:!0,composed:!0,detail:{field:e.field,direction:t}})),this.requestUpdate()}getTableHeaderColumn(e,t=!1){const l=e.field.startsWith("skeleton-loader"),i=o`
109
109
  <ngc-skeleton-loader
110
110
  full-width
111
111
  height="24"
112
112
  rounded
113
113
  ></ngc-skeleton-loader>
114
- `,i=`col-${e.field}`,s=!this.skeleton&&e.sortable===!0,r=!this.skeleton&&e.filterable===!0&&e.filterOptions?.length,a=s?this.getSortAriaSort(e):void 0,d=s&&this.effectiveSortField===e.field,n=r&&this.hasActiveFilter(e),h=s||r,f=s?o`
114
+ `,s=`col-${e.field}`,r=!this.skeleton&&e.sortable===!0,a=!this.skeleton&&e.filterable===!0&&e.filterOptions?.length,h=r?this.getSortAriaSort(e):void 0,n=r&&this.effectiveSortField===e.field,c=a&&this.hasActiveFilter(e),f=r||a,m=r?o`
115
115
  <div
116
116
  class="gator-table-header-sort-trigger"
117
117
  role="button"
118
118
  tabindex="0"
119
119
  aria-label="${g("Sort by")} ${e.name}"
120
120
  @click="${()=>this.handleSortColumn(e)}"
121
- @keydown="${m=>m.key==="Enter"||m.key===" "?(m.preventDefault(),this.handleSortColumn(e)):null}"
121
+ @keydown="${C=>C.key==="Enter"||C.key===" "?(C.preventDefault(),this.handleSortColumn(e)):null}"
122
122
  >
123
123
  <span class="gator-table-header-label">${e.name}</span>
124
124
  <span class="gator-table-sort-icon-wrap" aria-hidden="true">
125
125
  <ngc-icon name="${this.getSortIcon(e)}" class="gator-table-sort-icon" size="x-small"></ngc-icon>
126
126
  </span>
127
127
  </div>
128
- `:o`<span class="gator-table-header-label">${e.name}</span>`,u=!!(r&&(this._hoveredHeaderColumnField===e.field||n||this.isFilterPopoverOpen(e))),k=t?l:o`
128
+ `:o`<span class="gator-table-header-label">${e.name}</span>`,u=!!(a&&(this._hoveredHeaderColumnField===e.field||c||this.isFilterPopoverOpen(e))),w=l?i:o`
129
129
  <div class="gator-table-header-cell-inner">
130
- ${f}
131
- ${r?this.renderHeaderFilterPopover(e,u):b}
130
+ ${m}
131
+ ${a?this.renderHeaderFilterPopover(e,u,t):b}
132
132
  </div>
133
- `,w=[d?"gator-table-header-cell-sort-active":"",n?"gator-table-header-cell-filter-active":"",h?"gator-table-header-cell-interactive":""].filter(Boolean).join(" ");return o`
133
+ `,y=[n?"gator-table-header-cell-sort-active":"",c?"gator-table-header-cell-filter-active":"",f?"gator-table-header-cell-interactive":""].filter(Boolean).join(" ");return o`
134
134
  <th
135
- id="${i}"
135
+ id="${s}"
136
136
  scope="col"
137
- aria-sort="${a??b}"
138
- class="${w}"
139
- @mouseenter="${r||s?()=>this._hoveredHeaderColumnField=e.field:b}"
140
- @mouseleave="${r||s?()=>this._hoveredHeaderColumnField=null:b}"
137
+ aria-sort="${h??b}"
138
+ class="${y}"
139
+ @mouseenter="${a||r?()=>this._hoveredHeaderColumnField=e.field:b}"
140
+ @mouseleave="${a||r?()=>this._hoveredHeaderColumnField=null:b}"
141
141
  >
142
- ${k}
142
+ ${w}
143
143
  </th>
144
- `}getEffectivePending(e){const t=this._pendingFilterValues[e.field];return t!==void 0?t:this.filterValues[e.field]??(e.filterMultiselect===!0?[]:"")}getFilterPopoverForColumn(e){return this.shadowRoot?.querySelector(`ngc-popover[reference-id="filter-trigger-${e.field}"]`)??null}isFilterPopoverOpen(e){return this.getFilterPopoverForColumn(e)?.isOpen===!0}handleFilterPopoverClosed(e){this._filterSearchQuery={...this._filterSearchQuery,[e.field]:""}}handleFilterSearchInput(e,t){const l=e.detail?.value??"";this._filterSearchQuery={...this._filterSearchQuery,[t.field]:l},this.requestUpdate()}handleFilterCheckboxGroupChange(e,t){const l=e.detail??"",i=l?l.split(";").filter(Boolean):[];this._pendingFilterValues={...this._pendingFilterValues,[t.field]:i},this.requestUpdate()}handleFilterRadioGroupChange(e,t){const l=e.detail??"";this._pendingFilterValues={...this._pendingFilterValues,[t.field]:l},this.requestUpdate()}handleFilterPopoverApply(e){const t=this.getEffectivePending(e);this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:t}}));const l={...this._pendingFilterValues};delete l[e.field],this._pendingFilterValues=l,this.getFilterPopoverForColumn(e)?.hidePopover?.(),this.requestUpdate()}handleFilterPopoverClear(e){const l=e.filterMultiselect===!0?[]:"";this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:l}}));const i={...this._pendingFilterValues};delete i[e.field],this._pendingFilterValues=i,this.getFilterPopoverForColumn(e)?.hidePopover?.(),this.requestUpdate()}hasActiveFilter(e){const t=this.filterValues[e.field];return t==null?!1:e.filterMultiselect===!0?t.length>0:t!==""}getActiveFilterChips(){if(!this.columns?.length||!this.filterValues)return[];const e=[],t=l=>l.filterOptions??[];for(const l of this.columns){if(!l.filterable||t(l).length===0)continue;const i=this.filterValues[l.field];if(i==null)continue;if(l.filterMultiselect===!0){const r=i;for(const a of r){const d=t(l).find(n=>String(n.value)===a);e.push({column:l,value:a,label:d?.label??a})}}else{const r=i;if(r==="")continue;const a=t(l).find(d=>String(d.value)===r);e.push({column:l,value:r,label:a?.label??r})}}return e}handleFilterChipDismiss(e,t){const l=e.filterMultiselect===!0,i=this.filterValues[e.field],s=l?(i||[]).filter(r=>r!==t):"";this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:s}})),this.requestUpdate()}getTableBody(e,t){const l=[];let i={rows:[]};return t.forEach(s=>{s.isTableHeader?((i.rows.length>0||i.header)&&l.push(i),i={header:s,rows:[]}):i.rows.push(s)}),(i.rows.length>0||i.header)&&l.push(i),l.length===0&&t.length>0&&l.push({rows:t}),o`
144
+ `}getEffectivePending(e){const t=this._pendingFilterValues[e.field];return t!==void 0?t:this.filterValues[e.field]??(e.filterMultiselect===!0?[]:"")}getFilterPopoverForColumn(e){return this.shadowRoot?.querySelector(`ngc-popover[reference-id="filter-trigger-${e.field}"]`)??null}isFilterPopoverOpen(e){return this.getFilterPopoverForColumn(e)?.isOpen===!0}handleFilterPopoverClosed(e){this._filterSearchQuery={...this._filterSearchQuery,[e.field]:""}}handleFilterSearchInput(e,t){const l=e.detail?.value??"";this._filterSearchQuery={...this._filterSearchQuery,[t.field]:l},this.requestUpdate()}handleFilterCheckboxGroupChange(e,t){const l=e.detail??"",i=l?l.split(";").filter(Boolean):[];this._pendingFilterValues={...this._pendingFilterValues,[t.field]:i},this.requestUpdate()}handleFilterRadioGroupChange(e,t){const l=e.detail??"";this._pendingFilterValues={...this._pendingFilterValues,[t.field]:l},this.requestUpdate()}handleFilterPopoverApply(e){const t=this.getEffectivePending(e);this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:t}}));const l={...this._pendingFilterValues};delete l[e.field],this._pendingFilterValues=l,this.getFilterPopoverForColumn(e)?.hidePopover?.(),this.requestUpdate()}handleFilterPopoverClear(e){const l=e.filterMultiselect===!0?[]:"";this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:l}}));const i={...this._pendingFilterValues};delete i[e.field],this._pendingFilterValues=i,this.getFilterPopoverForColumn(e)?.hidePopover?.(),this.requestUpdate()}hasActiveFilter(e){const t=this.filterValues[e.field];return t==null?!1:e.filterMultiselect===!0?t.length>0:t!==""}getActiveFilterChips(){if(!this.columns?.length||!this.filterValues)return[];const e=[],t=l=>l.filterOptions??[];for(const l of this.columns){if(!l.filterable||t(l).length===0)continue;const i=this.filterValues[l.field];if(i==null)continue;if(l.filterMultiselect===!0){const r=i;for(const a of r){const h=t(l).find(n=>String(n.value)===a);e.push({column:l,value:a,label:h?.label??a})}}else{const r=i;if(r==="")continue;const a=t(l).find(h=>String(h.value)===r);e.push({column:l,value:r,label:a?.label??r})}}return e}handleFilterChipDismiss(e,t){const l=e.filterMultiselect===!0,i=this.filterValues[e.field],s=l?(i||[]).filter(r=>r!==t):"";this.dispatchEvent(new CustomEvent("filter",{bubbles:!0,composed:!0,detail:{field:e.field,value:s}})),this.requestUpdate()}getTableBody(e,t){const l=[];let i={rows:[]};return t.forEach(s=>{s.isTableHeader?((i.rows.length>0||i.header)&&l.push(i),i={header:s,rows:[]}):i.rows.push(s)}),(i.rows.length>0||i.header)&&l.push(i),l.length===0&&t.length>0&&l.push({rows:t}),o`
145
145
  ${l.map(s=>this.getCategoryBody(s,e))}
146
- `}getCategoryBody(e,t){let l="",i="",s="";e.header&&(l=e.header.headerText||e.header.categoryText||e.header.name||"Category",s=`category-${l.toLowerCase().replace(/\s+/g,"-")}`,i=s);const r=e.header?this.getTableHeaderRow(t,e.header):"",a=e.rows.map(h=>this.getTableBodyRow(h,t,s,this.data.indexOf(h))),d=t.some(h=>h.includedInTotals===!0),n=e.rows.length>0&&d?this.getTotalRow(e.rows,t,s):"";return o`
146
+ `}getCategoryBody(e,t){let l="",i="",s="";e.header&&(l=e.header.headerText||e.header.categoryText||e.header.name||"Category",s=`category-${l.toLowerCase().replace(/\s+/g,"-")}`,i=s);const r=e.header?this.getTableHeaderRow(t,e.header):"",a=e.rows.map(c=>this.getTableBodyRow(c,t,s,this.data.indexOf(c))),h=t.some(c=>c.includedInTotals===!0),n=e.rows.length>0&&h?this.getTotalRow(e.rows,t,s):"";return o`
147
147
  <tbody role="rowgroup" ${i?o`aria-labelledby="${i}"`:""}>
148
148
  ${r}
149
149
  ${a}
150
150
  ${n}
151
151
  </tbody>
152
- `}getTotalRow(e,t,l){const i={};t.forEach(n=>{i[n.field]=0,n.includedInTotals&&e.forEach(h=>{const f=this.parseNumericValue(h[n.field]);f!==null&&(i[n.field]+=f)})});const s=l?`${l}-total`:"total-row",r=o`
152
+ `}getTotalRow(e,t,l){const i={};t.forEach(n=>{i[n.field]=0,n.includedInTotals&&e.forEach(c=>{const f=this.parseNumericValue(c[n.field]);f!==null&&(i[n.field]+=f)})});const s=l?`${l}-total`:"total-row",r=o`
153
153
  <th
154
154
  id="${s}"
155
155
  scope="row"
@@ -157,7 +157,7 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
157
157
  >
158
158
  Total
159
159
  </th>
160
- `,a=t.map(n=>{const h=`col-${n.field}`,f=[s,l,h].filter(Boolean).join(" ");return n.includedInTotals?o`
160
+ `,a=t.map(n=>{const c=`col-${n.field}`,f=[s,l,c].filter(Boolean).join(" ");return n.includedInTotals?o`
161
161
  <td
162
162
  role="gridcell"
163
163
  headers="${f}"
@@ -172,11 +172,11 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
172
172
  >
173
173
  &nbsp;
174
174
  </td>
175
- `}),d=this.selectable?[r,...a]:[r,...a.slice(1)];return o`
175
+ `}),h=this.selectable?[r,...a]:[r,...a.slice(1)];return o`
176
176
  <tr role="row" class="gator-table-total-row">
177
- ${d}
177
+ ${h}
178
178
  </tr>
179
- `}parseNumericValue(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=e.replace(/[^0-9.-]/g,""),l=parseFloat(t);if(!isNaN(l))return l}return null}formatTotal(e,t){if(typeof t.cellRenderer=="function"){const i=t.cellConfig?.decimalPlaces??t.decimalPlaces??2;return t.cellRenderer({[t.field]:e.toFixed(i)})}return S(e,t.cellConfig,t.decimalPlaces)}getTableBodyRow(e,t,l,i){const s=t.map(r=>this.getTableBodyCell(e,r,l,i??0));if(!this.skeleton&&this.selectable){const r=l?`col-select ${l}`:"col-select";s.unshift(o`
179
+ `}parseNumericValue(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=e.replace(/[^0-9.-]/g,""),l=parseFloat(t);if(!isNaN(l))return l}return null}formatTotal(e,t){if(typeof t.cellRenderer=="function"){const i=t.cellConfig?.decimalPlaces??t.decimalPlaces??2;return t.cellRenderer({[t.field]:e.toFixed(i)})}return P(e,t.cellConfig,t.decimalPlaces)}getTableBodyRow(e,t,l,i){const s=t.map(r=>this.getTableBodyCell(e,r,l,i??0));if(!this.skeleton&&this.selectable){const r=l?`col-select ${l}`:"col-select";s.unshift(o`
180
180
  <td role="gridcell" class="gator-table-checkbox-column" headers="${r}">
181
181
  <ngc-checkbox
182
182
  label="test"
@@ -202,8 +202,8 @@ import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit
202
202
  height="24"
203
203
  rounded
204
204
  ></ngc-skeleton-loader>
205
- `,a=`col-${t.field}`,d=l?`${a} ${l}`:a,n=s?this.getCellAlignClass(t):"",h=s?r:this.renderCellByType(e,t,i,l??"");return o`
206
- <td role="gridcell" headers="${d}" class="${n}">
207
- ${h}
205
+ `,a=`col-${t.field}`,h=l?`${a} ${l}`:a,n=s?this.getCellAlignClass(t):"",c=s?r:this.renderCellByType(e,t,i,l??"");return o`
206
+ <td role="gridcell" headers="${h}" class="${n}">
207
+ ${c}
208
208
  </td>
209
- `}getCellAlignClass(e){return`gator-table-cell-${e.cellConfig?.align??"left"}`}renderCellByType(e,t,l,i){const s=a=>this.handleCellChange(a),r=a=>this.handleCellClick(a);switch(t.cellType){case"chip":return o`<ngc-table-cell-chip .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-chip>`;case"avatar":return o`<ngc-table-cell-avatar .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-avatar>`;case"checkbox":return o`<ngc-table-cell-checkbox .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-checkbox>`;case"text-link":return o`<ngc-table-cell-text-link .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-text-link>`;case"button":return o`<ngc-table-cell-button .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-button>`;case"icon-button":return o`<ngc-table-cell-icon-button .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-icon-button>`;case"input-dropdown":return o`<ngc-table-cell-input-dropdown .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-input-dropdown>`;case"input-text":return o`<ngc-table-cell-input-text .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-input-text>`;default:return o`<ngc-table-cell-text .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-text>`}}handleCellChange(e){e.stopPropagation();const{rowIndex:t,field:l,value:i}=e.detail??{};this.dispatchEvent(new CustomEvent("cellchange",{bubbles:!0,composed:!0,detail:{rowIndex:t,field:l,value:i}}))}handleCellClick(e){e.stopPropagation();const{rowIndex:t,field:l,value:i}=e.detail??{};this.dispatchEvent(new CustomEvent("cellclick",{bubbles:!0,composed:!0,detail:{rowIndex:t,field:l,...i!==void 0&&{value:i}}}))}};c.styles=[C(x),C(T),C(P)];p([v({type:Boolean})],c.prototype,"elevated",2);p([v({type:Boolean,attribute:"include-pagination"})],c.prototype,"includePagination",2);p([v({type:Boolean})],c.prototype,"skeleton",2);p([v({type:String,attribute:"sort-field"})],c.prototype,"sortField",2);p([v({type:String,attribute:"sort-direction"})],c.prototype,"sortDirection",2);p([v({type:Object,attribute:!1})],c.prototype,"filterValues",2);p([$()],c.prototype,"selectedRows",2);p([$()],c.prototype,"_currentPage",2);p([$()],c.prototype,"_sortField",2);p([$()],c.prototype,"_sortDirection",2);p([$()],c.prototype,"_hoveredHeaderColumnField",2);p([$()],c.prototype,"_pendingFilterValues",2);p([$()],c.prototype,"_filterSearchQuery",2);c=p([y("ngc-table")],c);export{c as NgcTable};
209
+ `}getCellAlignClass(e){return`gator-table-cell-${e.cellConfig?.align??"left"}`}renderCellByType(e,t,l,i){const s=a=>this.handleCellChange(a),r=a=>this.handleCellClick(a);switch(t.cellType){case"chip":return o`<ngc-table-cell-chip .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-chip>`;case"avatar":return o`<ngc-table-cell-avatar .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-avatar>`;case"checkbox":return o`<ngc-table-cell-checkbox .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-checkbox>`;case"text-link":return o`<ngc-table-cell-text-link .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-text-link>`;case"button":return o`<ngc-table-cell-button .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-button>`;case"icon-button":return o`<ngc-table-cell-icon-button .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-icon-button>`;case"input-dropdown":return o`<ngc-table-cell-input-dropdown .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-input-dropdown>`;case"input-text":return o`<ngc-table-cell-input-text .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-input-text>`;default:return o`<ngc-table-cell-text .rowData="${e}" .column="${t}" .rowIndex="${l}" .categoryHeaderId="${i}" @cellchange="${s}" @cellclick="${r}"></ngc-table-cell-text>`}}handleCellChange(e){e.stopPropagation();const{rowIndex:t,field:l,value:i}=e.detail??{};this.dispatchEvent(new CustomEvent("cellchange",{bubbles:!0,composed:!0,detail:{rowIndex:t,field:l,value:i}}))}handleCellClick(e){e.stopPropagation();const{rowIndex:t,field:l,value:i}=e.detail??{};this.dispatchEvent(new CustomEvent("cellclick",{bubbles:!0,composed:!0,detail:{rowIndex:t,field:l,...i!==void 0&&{value:i}}}))}};d.styles=[k(_),k(x),k(T)];p([v({type:Boolean})],d.prototype,"elevated",2);p([v({type:Boolean,attribute:"include-pagination"})],d.prototype,"includePagination",2);p([v({type:Boolean})],d.prototype,"skeleton",2);p([v({type:String,attribute:"sort-field"})],d.prototype,"sortField",2);p([v({type:String,attribute:"sort-direction"})],d.prototype,"sortDirection",2);p([v({type:Object,attribute:!1})],d.prototype,"filterValues",2);p([$()],d.prototype,"selectedRows",2);p([$()],d.prototype,"_currentPage",2);p([$()],d.prototype,"_sortField",2);p([$()],d.prototype,"_sortDirection",2);p([$()],d.prototype,"_hoveredHeaderColumnField",2);p([$()],d.prototype,"_pendingFilterValues",2);p([$()],d.prototype,"_filterSearchQuery",2);d=p([F("ngc-table")],d);export{d as NgcTable};
@@ -1 +1 @@
1
- const o=':root,:host{--ngc-input-dropdown-list-max-height: 14rem}ngc-icon-button{--ngc-icon-button-hover-box-shadow: none;margin-top:-.5rem;margin-bottom:-.5rem}.gator-dropdown-listbox{position:absolute;width:max-content;top:0;left:0;max-height:var(--ngc-input-dropdown-list-max-height);overflow-y:auto;overflow-x:hidden;border-radius:var(--border-radius-medium);padding:var(--spacing-5) var(--spacing-2);background:var(--color-surface-primary);box-shadow:var(--shadow-3-dropdown);margin:0;border:none}.gator-dropdown-listbox:not(:popover-open){display:none}.gator-form-element{position:relative}.gator-form-element-control:focus-visible:not(.gator-disabled){outline:2px solid var(--ngc-input-border-color-focused, var(--color-border-neutral, #1F1F1F))!important;outline-offset:0}.gator-dropdown-listbox_expanded{display:block}.gator-faux-input-placeholder{color:var(--color-text-placeholder);font-family:var(--font-family-body, "Open Sans"),sans-serif;font-size:var(--font-size-body-1);line-height:var(--line-height-body-1);letter-spacing:var(--letter-spacing-default)}.gator-dropdown-listbox-message{display:flex;padding:var(--spacing-5) var(--spacing-8);align-items:flex-start;gap:var(--spacing-5);align-self:stretch;color:var(--color-text-placeholder);font-family:var(--font-family-body, "Open Sans"),sans-serif;font-size:var(--font-size-body-1)}.gator-dropdown-chevron{display:var(--ngc-input-dropdown-end-chevron-display)}.gator-readonly .gator-dropdown-chevron{--ngc-icon-color: var(--color-icon-disabled)}.gator-multiselect-selections{flex-wrap:wrap;display:flex;gap:var(--spacing-5);width:100%;align-items:center;max-height:70px;overflow-y:scroll;margin:-2px 0}.gator-multiselect-selections .gator-input,.gator-multiselect-selections .gator-faux-input{width:max-content}.gator-multiselect-selections .gator-multiselect-label{position:absolute;top:0;left:0;visibility:hidden;opacity:0}.gator-multiselect-selections .gator-chips-container{display:flex;gap:var(--spacing-5);max-width:100%;overflow:hidden}.gator-multiselect-selections .gator-chips-container.gator-chips-container-autocomplete{max-width:66%}.gator-multiselect-selections .gator-chips-container:not(:has(*)){margin-right:calc(var(--spacing-5) * -1)}.gator-dropdown-option{--ngc-list-item-interaction-icon-color: var(--color-border-primary)}.gator-dropdown-select-all[start-icon=checkbox]{--ngc-list-item-start-icon-color: var(--color-border-primary)}.gator-dropdown-select-all[start-icon=checkbox-selected],.gator-dropdown-select-all[start-icon=checkbox-indeterminate]{--ngc-list-item-start-icon-color: var(--color-feedback-brand)}ngc-loading-spinner{padding:0 3px}';export{o as default};
1
+ const o=':root,:host{--ngc-input-dropdown-list-max-height: 14rem}ngc-icon-button{--ngc-icon-button-hover-box-shadow: none;margin-top:-.5rem;margin-bottom:-.5rem}.gator-dropdown-listbox{position:absolute;width:max-content;top:0;left:0;max-height:var(--ngc-input-dropdown-list-max-height);overflow-y:auto;overflow-x:hidden;border-radius:var(--border-radius-medium);padding:var(--spacing-5) var(--spacing-2);background:var(--color-surface-primary);box-shadow:var(--shadow-3-dropdown);margin:0;border:none}.gator-dropdown-listbox:not(:popover-open){display:none}.gator-form-element{position:relative}.gator-form-element-control:focus-visible:not(.gator-disabled){outline:2px solid var(--ngc-input-border-color-focused, var(--color-border-neutral, #1F1F1F))!important;outline-offset:0}.gator-dropdown-listbox_expanded{display:block}.gator-faux-input-placeholder{color:var(--color-text-placeholder);font-family:var(--font-family-body, "Open Sans"),sans-serif;font-size:var(--font-size-body-1);line-height:var(--line-height-body-1);letter-spacing:var(--letter-spacing-default)}.gator-dropdown-listbox-message{display:block;padding:var(--spacing-5) var(--spacing-8);align-self:stretch;color:var(--color-text-primary);font-family:var(--font-family-body, "Open Sans"),sans-serif;font-size:var(--font-size-body-1)}.gator-dropdown-listbox-message .gator-tag-input-kbd{display:inline-block;padding:0 var(--spacing-3);border-radius:var(--border-radius-small);background:#000;color:#fff;font-family:inherit;font-size:inherit;line-height:inherit}.gator-dropdown-chevron{display:var(--ngc-input-dropdown-end-chevron-display)}.gator-readonly .gator-dropdown-chevron{--ngc-icon-color: var(--color-icon-disabled)}.gator-multiselect-selections{flex-wrap:wrap;display:flex;gap:var(--spacing-5);width:100%;align-items:center;max-height:70px;overflow-y:auto;margin:-2px 0}.gator-multiselect-selections .gator-input,.gator-multiselect-selections .gator-faux-input{width:max-content}.gator-multiselect-selections .gator-multiselect-label{position:absolute;top:0;left:0;visibility:hidden;opacity:0}.gator-multiselect-selections .gator-chips-container{display:flex;gap:var(--spacing-5);max-width:100%;overflow:hidden}.gator-multiselect-selections .gator-chips-container.gator-chips-container-autocomplete{max-width:66%}.gator-multiselect-selections .gator-chips-container:not(:has(*)){margin-right:calc(var(--spacing-5) * -1)}.gator-dropdown-option{--ngc-list-item-interaction-icon-color: var(--color-border-primary)}.gator-dropdown-select-all[start-icon=checkbox]{--ngc-list-item-start-icon-color: var(--color-border-primary)}.gator-dropdown-select-all[start-icon=checkbox-selected],.gator-dropdown-select-all[start-icon=checkbox-indeterminate]{--ngc-list-item-start-icon-color: var(--color-feedback-brand)}ngc-loading-spinner{padding:0 3px}';export{o as default};
@@ -70,6 +70,12 @@ export declare class NgcInputDropdown extends NgcInputBase {
70
70
  * @description When set to true, a loading spinner will be displayed in the input
71
71
  */
72
72
  loading: boolean;
73
+ /**
74
+ * @property {boolean} tagInput
75
+ * @description Requires multiselect and autocomplete. Lets users type a value and press Enter or Tab to
76
+ * add it as a chip, even when it is not in the options list.
77
+ */
78
+ tagInput: boolean;
73
79
  value: undefined | string | string[] | number | number[];
74
80
  _cleanup: (() => void) | undefined;
75
81
  private _activeDescendant;
@@ -138,6 +144,9 @@ export declare class NgcInputDropdown extends NgcInputBase {
138
144
  setListboxMessageAriaDescribedByElements(): void;
139
145
  get resultsExceedMaxMessage(): import('lit').TemplateResult;
140
146
  get noResultsMessage(): string;
147
+ get isTagInputMode(): boolean;
148
+ get shouldSuppressEmptyListbox(): boolean;
149
+ get tagInputHintMessage(): import('lit').TemplateResult;
141
150
  get displayedOptions(): NgcDropdownType[];
142
151
  get filteredOptions(): NgcDropdownType[];
143
152
  get limitedOptions(): NgcDropdownType[];
@@ -156,6 +165,12 @@ export declare class NgcInputDropdown extends NgcInputBase {
156
165
  assignPosition(): void;
157
166
  handleInput(e: InputEvent): void;
158
167
  handleInputKeydown(e: KeyboardEvent): void;
168
+ private tryRemoveLastChipFromBackspace;
169
+ private tryAddTagFromKeyboard;
170
+ private showListboxPopover;
171
+ private get valueArrayType();
172
+ addTagFromInput(): void;
173
+ clearSearchInput(): void;
159
174
  emitChangeEvent(value: string | string[] | number[]): void;
160
175
  }
161
176
  declare global {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ncino/web-components",
3
3
  "author": "nCino",
4
- "version": "13.6.0",
4
+ "version": "13.7.1",
5
5
  "license": "(c) Copyright 2023 nCino, Inc., all rights reserved",
6
6
  "publishConfig": {
7
7
  "registry": "https://registry.npmjs.org/"
@@ -88,7 +88,7 @@
88
88
  "eslint-plugin-yml": "3.3.0",
89
89
  "glob": "^13.0.6",
90
90
  "jsdom": "29.0.1",
91
- "playwright": "1.59.1",
91
+ "playwright": "1.60.0",
92
92
  "postcss": "^8.5.6",
93
93
  "rimraf": "^6.1.3",
94
94
  "sass": "1.99.0",
@@ -100,10 +100,10 @@
100
100
  "vite-plugin-static-copy": "^3.3.0",
101
101
  "vitest": "^4.1.0",
102
102
  "yaml-eslint-parser": "^2.0.0",
103
- "@ncino/styles": "13.6.0"
103
+ "@ncino/styles": "13.7.1"
104
104
  },
105
105
  "peerDependencies": {
106
- "@ncino/styles": "13.6.0"
106
+ "@ncino/styles": "13.7.1"
107
107
  },
108
108
  "bugs": {
109
109
  "url": "https://github.com/ncino/force-sdk-web-components/issues"
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@ncino/web-components",
4
- "version": "13.5.0",
4
+ "version": "13.7.0",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -4938,6 +4938,10 @@
4938
4938
  "name": "loading",
4939
4939
  "value": { "type": "boolean", "default": "false" }
4940
4940
  },
4941
+ {
4942
+ "name": "tag-input",
4943
+ "value": { "type": "boolean", "default": "false" }
4944
+ },
4941
4945
  { "name": "id", "value": { "type": "string", "default": "''" } },
4942
4946
  {
4943
4947
  "name": "required",
@@ -5042,6 +5046,7 @@
5042
5046
  { "name": "wrapChips", "type": "boolean" },
5043
5047
  { "name": "hideClear", "type": "boolean" },
5044
5048
  { "name": "loading", "type": "boolean" },
5049
+ { "name": "tagInput", "type": "boolean" },
5045
5050
  { "name": "value", "type": "string | number | undefined | null" },
5046
5051
  { "name": "_cleanup", "type": "(() => void) | undefined" },
5047
5052
  { "name": "_expanded", "type": "boolean" },
@@ -5068,6 +5073,9 @@
5068
5073
  { "name": "listboxMessageMarkup" },
5069
5074
  { "name": "resultsExceedMaxMessage" },
5070
5075
  { "name": "noResultsMessage" },
5076
+ { "name": "isTagInputMode" },
5077
+ { "name": "shouldSuppressEmptyListbox" },
5078
+ { "name": "tagInputHintMessage" },
5071
5079
  { "name": "displayedOptions" },
5072
5080
  { "name": "filteredOptions" },
5073
5081
  { "name": "limitedOptions" },