@tylertech/forge 2.24.0 → 2.24.2
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.
- package/custom-elements.json +93 -108
- package/dist/esm/accordion/index.js +1 -1
- package/dist/esm/app-bar/help-button/index.js +1 -1
- package/dist/esm/app-bar/index.js +1 -1
- package/dist/esm/app-bar/menu-button/index.js +1 -1
- package/dist/esm/app-bar/notification-button/index.js +1 -1
- package/dist/esm/app-bar/profile-button/index.js +1 -1
- package/dist/esm/app-bar/search/index.js +1 -1
- package/dist/esm/autocomplete/index.js +1 -1
- package/dist/esm/banner/index.js +1 -1
- package/dist/esm/bottom-sheet/index.js +1 -1
- package/dist/esm/busy-indicator/index.js +1 -1
- package/dist/esm/button/index.js +1 -1
- package/dist/esm/button-area/index.js +1 -1
- package/dist/esm/calendar/calendar-dropdown/index.js +1 -1
- package/dist/esm/calendar/calendar-menu/index.js +1 -1
- package/dist/esm/calendar/index.js +1 -1
- package/dist/esm/checkbox/index.js +1 -1
- package/dist/esm/chip-field/index.js +1 -1
- package/dist/esm/chips/chip/index.js +1 -1
- package/dist/esm/chips/chip-set/index.js +1 -1
- package/dist/esm/chips/index.js +1 -1
- package/dist/esm/chunks/{chunk.UUBAUAER.js → chunk.3MMDUUTN.js} +2 -2
- package/dist/esm/chunks/{chunk.KZDQFUNT.js → chunk.3V2VDOOP.js} +2 -2
- package/dist/esm/chunks/{chunk.Q2PGK4IA.js → chunk.4KKMVMPN.js} +2 -2
- package/dist/esm/chunks/{chunk.WLBRU5HI.js → chunk.5SM7UG6C.js} +2 -2
- package/dist/esm/chunks/{chunk.KNNT4CGL.js → chunk.6DVJ22IK.js} +2 -2
- package/dist/esm/chunks/{chunk.QRWYYBZC.js → chunk.6NARYF7U.js} +2 -2
- package/dist/esm/chunks/{chunk.QRWYYBZC.js.map → chunk.6NARYF7U.js.map} +3 -3
- package/dist/esm/chunks/{chunk.4APGDQHF.js → chunk.AFW54X3W.js} +2 -2
- package/dist/esm/chunks/chunk.AH4YGLZ4.js +7 -0
- package/dist/esm/chunks/chunk.AH4YGLZ4.js.map +7 -0
- package/dist/esm/chunks/chunk.AJTQHK25.js +7 -0
- package/dist/esm/chunks/chunk.AJTQHK25.js.map +7 -0
- package/dist/esm/chunks/{chunk.KMMOZ2SF.js → chunk.C3G25JFG.js} +2 -2
- package/dist/esm/chunks/chunk.CL4FTBLR.js +7 -0
- package/dist/esm/chunks/chunk.CL4FTBLR.js.map +7 -0
- package/dist/esm/chunks/{chunk.POBCKMFO.js → chunk.CYLDP7ML.js} +2 -2
- package/dist/esm/chunks/{chunk.HDHGU4L2.js → chunk.E3K6KM57.js} +2 -2
- package/dist/esm/chunks/{chunk.PTEWJ5PZ.js → chunk.EQEMCHMB.js} +2 -2
- package/dist/esm/chunks/{chunk.QBST3QSM.js → chunk.FEU4FTVQ.js} +2 -2
- package/dist/esm/chunks/{chunk.ZN6U7WVM.js → chunk.FIZVVCUB.js} +2 -2
- package/dist/esm/chunks/{chunk.BQRXAJTH.js → chunk.JFAOCIGZ.js} +2 -2
- package/dist/esm/chunks/{chunk.4QVF44G5.js → chunk.K57IO236.js} +2 -2
- package/dist/esm/chunks/{chunk.K2O3KSP7.js → chunk.KGMCBPGV.js} +2 -2
- package/dist/esm/chunks/chunk.KYH5GKVI.js +7 -0
- package/dist/esm/chunks/chunk.KYH5GKVI.js.map +7 -0
- package/dist/esm/chunks/chunk.LEINPSKL.js +7 -0
- package/dist/esm/chunks/chunk.LEINPSKL.js.map +7 -0
- package/dist/esm/chunks/{chunk.V5L5DKNF.js → chunk.LFBYFJTX.js} +2 -2
- package/dist/esm/chunks/chunk.MKHU4IPO.js +7 -0
- package/dist/esm/chunks/chunk.MKHU4IPO.js.map +7 -0
- package/dist/esm/chunks/chunk.N6MAUMFI.js +7 -0
- package/dist/esm/chunks/chunk.N6MAUMFI.js.map +7 -0
- package/dist/esm/chunks/{chunk.USKQFX4N.js → chunk.OBBYRQCY.js} +2 -2
- package/dist/esm/chunks/chunk.OJ54J4L3.js +7 -0
- package/dist/esm/chunks/chunk.OJ54J4L3.js.map +7 -0
- package/dist/esm/chunks/chunk.OML7MHH6.js +29 -0
- package/dist/esm/chunks/chunk.OML7MHH6.js.map +7 -0
- package/dist/esm/chunks/chunk.OUORLMTZ.js +12 -0
- package/dist/esm/chunks/chunk.QIGNMZRL.js +7 -0
- package/dist/esm/chunks/chunk.QIGNMZRL.js.map +7 -0
- package/dist/esm/chunks/{chunk.DNWMURCG.js → chunk.RHXQ2GMV.js} +2 -2
- package/dist/esm/chunks/{chunk.OLNY6ZNB.js → chunk.TLXWXBQO.js} +2 -2
- package/dist/esm/chunks/chunk.TMEYQXRR.js +7 -0
- package/dist/esm/chunks/chunk.TMEYQXRR.js.map +7 -0
- package/dist/esm/chunks/{chunk.NHZTE4I4.js → chunk.TUQWDTRA.js} +2 -2
- package/dist/esm/chunks/{chunk.NHZTE4I4.js.map → chunk.TUQWDTRA.js.map} +1 -1
- package/dist/esm/chunks/{chunk.EPFMWAIO.js → chunk.TVWUZYVG.js} +2 -2
- package/dist/esm/chunks/{chunk.AITARMT3.js → chunk.UNFOIEF6.js} +2 -2
- package/dist/esm/chunks/{chunk.AITARMT3.js.map → chunk.UNFOIEF6.js.map} +2 -2
- package/dist/esm/chunks/{chunk.32AY5G4D.js → chunk.W3DFKTAX.js} +2 -2
- package/dist/esm/chunks/{chunk.ATJJ6NAY.js → chunk.WF24FWAT.js} +2 -2
- package/dist/esm/chunks/chunk.XINI6PNZ.js +7 -0
- package/dist/esm/chunks/chunk.XINI6PNZ.js.map +7 -0
- package/dist/esm/chunks/{chunk.WVU4LCVC.js → chunk.XKX2BE6Z.js} +2 -2
- package/dist/esm/chunks/{chunk.ZVHFSAID.js → chunk.YVXZ753Q.js} +2 -2
- package/dist/esm/chunks/{chunk.QFMQPAT2.js → chunk.Z7Y2RA4P.js} +2 -2
- package/dist/esm/color-picker/index.js +1 -1
- package/dist/esm/core/index.js +1 -1
- package/dist/esm/core/utils/index.js +1 -1
- package/dist/esm/date-picker/index.js +1 -1
- package/dist/esm/date-range-picker/index.js +1 -1
- package/dist/esm/expansion-panel/index.js +1 -1
- package/dist/esm/file-picker/index.js +1 -1
- package/dist/esm/icon/index.js +1 -1
- package/dist/esm/icon-button/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/list/index.js +1 -1
- package/dist/esm/list/list/index.js +1 -1
- package/dist/esm/list/list-item/index.js +1 -1
- package/dist/esm/list-dropdown/index.js +1 -1
- package/dist/esm/menu/index.js +1 -1
- package/dist/esm/open-icon/index.js +1 -1
- package/dist/esm/paginator/index.js +1 -1
- package/dist/esm/profile-card/index.js +1 -1
- package/dist/esm/quantity-field/index.js +1 -1
- package/dist/esm/radio/index.js +1 -1
- package/dist/esm/select/core/index.js +1 -1
- package/dist/esm/select/index.js +1 -1
- package/dist/esm/select/option/index.js +1 -1
- package/dist/esm/select/select/index.js +1 -1
- package/dist/esm/select/select-dropdown/index.js +1 -1
- package/dist/esm/slider/index.js +1 -1
- package/dist/esm/split-view/index.js +1 -1
- package/dist/esm/split-view/split-view/index.js +1 -1
- package/dist/esm/split-view/split-view-panel/index.js +1 -1
- package/dist/esm/stepper/index.js +1 -1
- package/dist/esm/stepper/step/index.js +1 -1
- package/dist/esm/stepper/stepper/index.js +1 -1
- package/dist/esm/switch/index.js +1 -1
- package/dist/esm/table/index.js +1 -1
- package/dist/esm/tabs/index.js +1 -1
- package/dist/esm/tabs/tab/index.js +1 -1
- package/dist/esm/tabs/tab-bar/index.js +1 -1
- package/dist/esm/time-picker/index.js +1 -1
- package/dist/esm/toast/index.js +1 -1
- package/esm/app-bar/notification-button/app-bar-notification-button-adapter.d.ts +2 -2
- package/esm/app-bar/notification-button/app-bar-notification-button-adapter.js +1 -1
- package/esm/app-bar/notification-button/app-bar-notification-button-foundation.d.ts +3 -3
- package/esm/app-bar/notification-button/app-bar-notification-button-foundation.js +12 -4
- package/esm/app-bar/notification-button/app-bar-notification-button.d.ts +2 -2
- package/esm/app-bar/notification-button/app-bar-notification-button.js +2 -2
- package/esm/autocomplete/autocomplete-adapter.d.ts +2 -0
- package/esm/autocomplete/autocomplete-adapter.js +6 -0
- package/esm/autocomplete/autocomplete-foundation.js +1 -0
- package/esm/core/utils/utils.d.ts +9 -0
- package/esm/core/utils/utils.js +22 -0
- package/esm/date-picker/date-picker-adapter.js +3 -0
- package/esm/date-range-picker/date-range-picker-adapter.js +6 -1
- package/esm/list/list-item/list-item-adapter.js +3 -1
- package/esm/list-dropdown/list-dropdown-constants.d.ts +1 -0
- package/esm/list-dropdown/list-dropdown-utils.js +16 -3
- package/esm/menu/menu-adapter.d.ts +2 -0
- package/esm/menu/menu-adapter.js +3 -0
- package/esm/menu/menu-foundation.js +2 -5
- package/esm/select/core/base-select-adapter.d.ts +0 -2
- package/esm/select/core/base-select-foundation.js +1 -2
- package/esm/select/option/option.d.ts +0 -1
- package/esm/select/option/option.js +0 -5
- package/esm/select/select/select-adapter.d.ts +0 -1
- package/esm/select/select/select-adapter.js +4 -9
- package/esm/select/select/select-foundation.js +0 -1
- package/esm/select/select-dropdown/select-dropdown-adapter.d.ts +0 -1
- package/esm/select/select-dropdown/select-dropdown-adapter.js +0 -11
- package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
- package/esm/tabs/tab/tab-adapter.d.ts +1 -3
- package/esm/tabs/tab/tab-adapter.js +13 -14
- package/esm/tabs/tab/tab-constants.d.ts +2 -1
- package/esm/tabs/tab/tab-constants.js +2 -1
- package/esm/tabs/tab/tab-foundation.d.ts +0 -2
- package/esm/tabs/tab/tab-foundation.js +3 -3
- package/esm/tabs/tab/tab.d.ts +0 -1
- package/esm/tabs/tab/tab.js +2 -5
- package/esm/time-picker/time-picker-adapter.d.ts +2 -0
- package/esm/time-picker/time-picker-adapter.js +7 -2
- package/esm/time-picker/time-picker-foundation.js +1 -0
- package/package.json +1 -1
- package/styles/tabs/tab/_mixins.scss +3 -7
- package/styles/tabs/tab/tab.scss +4 -0
- package/dist/esm/chunks/chunk.36RT7UOR.js +0 -7
- package/dist/esm/chunks/chunk.36RT7UOR.js.map +0 -7
- package/dist/esm/chunks/chunk.7NUOX3JD.js +0 -12
- package/dist/esm/chunks/chunk.E6FHH3CM.js +0 -7
- package/dist/esm/chunks/chunk.E6FHH3CM.js.map +0 -7
- package/dist/esm/chunks/chunk.F6DMKNFU.js +0 -29
- package/dist/esm/chunks/chunk.F6DMKNFU.js.map +0 -7
- package/dist/esm/chunks/chunk.HSUOYMJT.js +0 -7
- package/dist/esm/chunks/chunk.HSUOYMJT.js.map +0 -7
- package/dist/esm/chunks/chunk.HVYDNI2O.js +0 -7
- package/dist/esm/chunks/chunk.HVYDNI2O.js.map +0 -7
- package/dist/esm/chunks/chunk.KZJYLYWN.js +0 -7
- package/dist/esm/chunks/chunk.KZJYLYWN.js.map +0 -7
- package/dist/esm/chunks/chunk.LZOAYM6V.js +0 -7
- package/dist/esm/chunks/chunk.LZOAYM6V.js.map +0 -7
- package/dist/esm/chunks/chunk.M5QM2CPF.js +0 -7
- package/dist/esm/chunks/chunk.M5QM2CPF.js.map +0 -7
- package/dist/esm/chunks/chunk.MA2P7CG4.js +0 -7
- package/dist/esm/chunks/chunk.MA2P7CG4.js.map +0 -7
- package/dist/esm/chunks/chunk.MSOMQ4HD.js +0 -7
- package/dist/esm/chunks/chunk.MSOMQ4HD.js.map +0 -7
- package/dist/esm/chunks/chunk.QRSFRMBF.js +0 -7
- package/dist/esm/chunks/chunk.QRSFRMBF.js.map +0 -7
- package/dist/esm/chunks/chunk.SDZC7JIX.js +0 -7
- package/dist/esm/chunks/chunk.SDZC7JIX.js.map +0 -7
- /package/dist/esm/chunks/{chunk.UUBAUAER.js.map → chunk.3MMDUUTN.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.KZDQFUNT.js.map → chunk.3V2VDOOP.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.Q2PGK4IA.js.map → chunk.4KKMVMPN.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.WLBRU5HI.js.map → chunk.5SM7UG6C.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.KNNT4CGL.js.map → chunk.6DVJ22IK.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.4APGDQHF.js.map → chunk.AFW54X3W.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.KMMOZ2SF.js.map → chunk.C3G25JFG.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.POBCKMFO.js.map → chunk.CYLDP7ML.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.HDHGU4L2.js.map → chunk.E3K6KM57.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.PTEWJ5PZ.js.map → chunk.EQEMCHMB.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.QBST3QSM.js.map → chunk.FEU4FTVQ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ZN6U7WVM.js.map → chunk.FIZVVCUB.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.BQRXAJTH.js.map → chunk.JFAOCIGZ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.4QVF44G5.js.map → chunk.K57IO236.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.K2O3KSP7.js.map → chunk.KGMCBPGV.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.V5L5DKNF.js.map → chunk.LFBYFJTX.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.USKQFX4N.js.map → chunk.OBBYRQCY.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.7NUOX3JD.js.map → chunk.OUORLMTZ.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.DNWMURCG.js.map → chunk.RHXQ2GMV.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.OLNY6ZNB.js.map → chunk.TLXWXBQO.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.EPFMWAIO.js.map → chunk.TVWUZYVG.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.32AY5G4D.js.map → chunk.W3DFKTAX.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ATJJ6NAY.js.map → chunk.WF24FWAT.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.WVU4LCVC.js.map → chunk.XKX2BE6Z.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.ZVHFSAID.js.map → chunk.YVXZ753Q.js.map} +0 -0
- /package/dist/esm/chunks/{chunk.QFMQPAT2.js.map → chunk.Z7Y2RA4P.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/select/select/select-constants.ts", "../../src/select/select/select-adapter.ts", "../../src/select/select/select-foundation.ts", "../../src/select/select/select.ts", "../../src/select/select/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}select`;\n\nconst classes = {\n ROOT: 'forge-select',\n OPENED: 'forge-select--opened',\n SELECTED_TEXT: 'forge-select__selected-text',\n DROPDOWN: 'forge-select__dropdown',\n LABEL_FLOAT: 'forge-select--label-float',\n GROUP_WRAPPER: 'forge-select__group-wrapper'\n};\n\nconst selectors = {\n ROOT: `.${classes.ROOT}`,\n SELECTED_TEXT: `.${classes.SELECTED_TEXT}`,\n LABEL: 'label#select-label',\n LEADING_SLOT: 'slot[name=leading]',\n ADDON_END_SLOT: 'slot[name=addon-end]'\n};\n\nconst attributes = {\n TYPE: 'type',\n VALUE: 'value',\n LABEL: 'label',\n MULTIPLE: 'multiple',\n DISABLED: 'disabled',\n PLACEHOLDER: 'placeholder',\n OBSERVE_SCROLL: 'observe-scroll',\n OBSERVE_SCROLL_THRESHOLD: 'observe-scroll-threshold'\n};\n\nconst events = {\n SCROLLED_BOTTOM: `${elementName}-scrolled-bottom`\n};\n\nexport const SELECT_CONSTANTS = {\n elementName,\n classes,\n selectors,\n attributes,\n events\n};\n\nexport {\n type FieldDensityType as SelectDensityType,\n type FieldFloatLabelType as SelectFloatLabelType,\n type FieldShapeType as SelectShapeType\n} from '../../field/field-constants';\n", "import { calculateFontWidth, getShadowElement, IFontInfo, toggleClass, toggleAttribute } from '@tylertech/forge-core';\nimport { FloatingLabel, IFloatingLabel } from '../../floating-label/floating-label';\nimport { ISelectComponent } from './select';\nimport { SELECT_CONSTANTS } from './select-constants';\nimport { IBaseSelectAdapter, BaseSelectAdapter } from '../core';\nimport { IListDropdownConfig } from '../../list-dropdown/list-dropdown-constants';\nimport { FIELD_CONSTANTS } from '../../field/field-constants';\nimport { tryCreateAriaControlsPlaceholder, setAriaControls } from '../../core/utils';\n\nexport type OptionListenerDestructor = () => void;\n\nexport interface ISelectAdapter extends IBaseSelectAdapter {\n initializeFloatingLabel(): IFloatingLabel;\n initializeLabel(): void;\n hasLabel(): boolean;\n setLabel(value: string): void;\n addRootClass(name: string): void;\n removeRootClass(name: string): void;\n setPlaceholderText(value: string): void;\n setSelectedText(value: string): void;\n addMouseDownListener(listener: (evt: MouseEvent) => void): void;\n removeMouseDownListener(listener: (evt: MouseEvent) => void): void;\n setLeadingListener(listener: (evt: Event) => void): void;\n removeLeadingListener(listener: (evt: Event) => void): void;\n setAddonEndListener(listener: (evt: Event) => void): void;\n removeAddonEndListener(listener: (evt: Event) => void): void;\n hasLeadingElement(): boolean;\n setDisabled(isDisabled: boolean): void;\n setInvalid(isInvalid: boolean): void;\n setRequired(isRequired: boolean): void;\n setRoomy(isRoomy: boolean): void;\n setDense(isDense: boolean): void;\n getLabelWidth(fontSize: number, fontFamily: string): number;\n getLabelFontMetrics(): IFontInfo;\n getTargetWidth(): number;\n hasAddonEndNodes(): boolean;\n setFocus(): void;\n isWithinSelf(element: HTMLElement): boolean;\n}\n\n/**\n * The DOM adapter behind the `<forge-select>` component.\n */\nexport class SelectAdapter extends BaseSelectAdapter implements ISelectAdapter {\n private _selectElement: HTMLElement;\n private _labelElement: HTMLLabelElement;\n private _selectedTextElement: HTMLElement;\n private _leadingSlot: HTMLSlotElement;\n private _addonEndSlot: HTMLSlotElement;\n\n constructor(component: ISelectComponent) {\n super(component);\n this._selectElement = getShadowElement(component, SELECT_CONSTANTS.selectors.ROOT);\n this._leadingSlot = getShadowElement(component, SELECT_CONSTANTS.selectors.LEADING_SLOT) as HTMLSlotElement;\n this._addonEndSlot = getShadowElement(this._component, SELECT_CONSTANTS.selectors.ADDON_END_SLOT) as HTMLSlotElement;\n this._selectedTextElement = getShadowElement(component, SELECT_CONSTANTS.selectors.SELECTED_TEXT) as HTMLElement;\n this._targetElement = this._selectElement;\n }\n\n public initializeLabel(): void {\n this._labelElement = getShadowElement(this._component, SELECT_CONSTANTS.selectors.LABEL) as HTMLLabelElement;\n }\n\n public hasLabel(): boolean {\n return !!this._labelElement;\n }\n\n public initializeAccessibility(): void {\n this._component.setAttribute('role', 'combobox');\n this._component.setAttribute('aria-haspopup', 'true');\n this._component.setAttribute('aria-expanded', 'false');\n tryCreateAriaControlsPlaceholder();\n setAriaControls(this._component);\n\n // We need to ensure the host element receives a non-negative tabindex for our interactions to work properly\n if (!this._component.hasAttribute('tabindex') || this._component.tabIndex === -1) {\n this._component.tabIndex = 0;\n }\n }\n\n public initializeFloatingLabel(): IFloatingLabel {\n return new FloatingLabel(this._labelElement);\n }\n\n public setLabel(value: string): void {\n if (!this._component.hasAttribute('aria-label') || this._component.getAttribute('aria-label') === this._labelElement.textContent) {\n this._component.setAttribute('aria-label', value);\n }\n this._labelElement.textContent = value;\n }\n\n public addRootClass(name: string): void {\n this._selectElement.classList.add(name);\n }\n\n public removeRootClass(name: string): void {\n this._selectElement.classList.remove(name);\n }\n\n public setPlaceholderText(value: string): void {\n toggleAttribute(this._selectedTextElement, !!value, 'placeholder', value);\n }\n\n public addClickListener(listener: (evt: Event) => void): void {\n this._component.addEventListener('click', listener);\n }\n\n public removeClickListener(listener: (evt: Event) => void): void {\n this._component.removeEventListener('click', listener);\n }\n\n public addMouseDownListener(listener: (evt: MouseEvent) => void): void {\n this._component.addEventListener('mousedown', listener);\n }\n\n public removeMouseDownListener(listener: (evt: MouseEvent) => void): void {\n this._component.removeEventListener('mousedown', listener);\n }\n\n public addTargetListener(type: string, listener: (evt: Event) => void): void {\n this._component.addEventListener(type, listener);\n }\n\n public removeTargetListener(type: string, listener: (evt: Event) => void): void {\n this._component.removeEventListener(type, listener);\n }\n\n public open(config: IListDropdownConfig): void {\n super.open(config);\n this._component.setAttribute('aria-controls', `list-dropdown-popup-${config.id}`);\n this._component.setAttribute('aria-expanded', 'true');\n toggleClass(this._selectElement, true, SELECT_CONSTANTS.classes.OPENED);\n }\n\n public close(): void {\n this._component.setAttribute('aria-expanded', 'false');\n this._component.removeAttribute('aria-activedescendant');\n setAriaControls(this._component);\n toggleClass(this._selectElement, false, SELECT_CONSTANTS.classes.OPENED);\n super.close();\n }\n\n public updateActiveDescendant(id: string): void {\n toggleAttribute(this._component, !!id, 'aria-activedescendant', id);\n }\n\n public setSelectedText(value: string): void {\n this._selectedTextElement.textContent = value;\n }\n\n public setLeadingListener(listener: (evt: Event) => void): void {\n this._leadingSlot.addEventListener('slotchange', listener);\n }\n\n public removeLeadingListener(listener: (evt: Event) => void): void {\n this._leadingSlot.removeEventListener('slotchange', listener);\n }\n\n public setAddonEndListener(listener: (evt: Event) => void): void {\n this._addonEndSlot.addEventListener('slotchange', listener);\n }\n\n public removeAddonEndListener(listener: (evt: Event) => void): void {\n this._addonEndSlot.removeEventListener('slotchange', listener);\n }\n\n public hasLeadingElement(): boolean {\n return this._leadingSlot.assignedNodes().length > 0;\n }\n\n public setDisabled(isDisabled: boolean): void {\n toggleClass(this._selectElement, isDisabled, FIELD_CONSTANTS.classes.DISABLED);\n toggleAttribute(this._component, isDisabled, 'aria-disabled', 'true');\n this._component.tabIndex = isDisabled ? -1 : 0;\n }\n\n public setInvalid(isInvalid: boolean): void {\n toggleClass(this._selectElement, isInvalid, FIELD_CONSTANTS.classes.INVALID);\n toggleAttribute(this._component, isInvalid, 'aria-invalid', 'true');\n }\n\n public setRequired(isRequired: boolean): void {\n toggleClass(this._selectElement, isRequired, FIELD_CONSTANTS.classes.REQUIRED);\n toggleAttribute(this._component, isRequired, 'aria-required', 'true');\n }\n\n public setRoomy(isRoomy: boolean): void {\n toggleClass(this._selectElement, isRoomy, FIELD_CONSTANTS.classes.ROOMY);\n }\n\n public setDense(isDense: boolean): void {\n toggleClass(this._selectElement, isDense, FIELD_CONSTANTS.classes.DENSE);\n }\n\n public getLabelWidth(fontSize: number, fontFamily: string): number {\n return calculateFontWidth(this._labelElement.innerText, { fontSize, fontFamily });\n }\n\n public getLabelFontMetrics(): IFontInfo {\n const style = getComputedStyle(this._labelElement);\n return {\n fontSize: parseInt(style.fontSize || '16', 10),\n fontFamily: style.fontFamily || 'Roboto'\n };\n }\n\n public getTargetWidth(): number {\n return this._selectElement.getBoundingClientRect().width;\n }\n\n public hasAddonEndNodes(): boolean {\n if (!this._addonEndSlot) {\n return false;\n }\n return this._addonEndSlot.assignedNodes().length > 0;\n }\n\n public setFocus(): void {\n this._component.focus();\n }\n\n public isWithinSelf(element: HTMLElement): boolean {\n const isShadowChild = !!this._component.shadowRoot && this._component.shadowRoot.contains(element);\n return isShadowChild || this._component.contains(element);\n }\n}\n", "import { isDefined, getEventPath } from '@tylertech/forge-core';\nimport { IBaseSelectFoundation, ISelectOption, BaseSelectFoundation } from '../core';\nimport { SELECT_CONSTANTS } from './select-constants';\nimport { IFloatingLabel } from '../../floating-label';\nimport { ISelectAdapter } from './select-adapter';\nimport { FieldDensityType, FieldFloatLabelType, FieldShapeType, FIELD_CONSTANTS } from '../../field/field-constants';\n\nexport interface ISelectFoundation extends IBaseSelectFoundation {\n label: string;\n disabled: boolean;\n density: FieldDensityType;\n invalid: boolean;\n required: boolean;\n floatLabelType: FieldFloatLabelType;\n placeholder: string;\n}\n\n/**\n * The foundation class behind the `<forge-select>` component.\n */\nexport class SelectFoundation extends BaseSelectFoundation<ISelectAdapter> implements ISelectFoundation {\n private _floatingLabelInstance: IFloatingLabel | undefined;\n private _shape: FieldShapeType = 'default';\n private _label = '';\n private _disabled = false;\n private _invalid = false;\n private _required = false;\n private _floatLabelType: FieldFloatLabelType = 'auto';\n private _placeholder: string;\n private _density: FieldDensityType = 'default';\n private _isInitialized = false;\n private _leadingChangeListener: (evt: Event) => void;\n private _addonEndChangeListener: (evt: Event) => void;\n private _mousedownListener: (evt: MouseEvent) => void;\n\n constructor(adapter: ISelectAdapter) {\n super(adapter);\n this._leadingChangeListener = evt => this._onLeadingSlotChanged(evt);\n this._addonEndChangeListener = evt => this._onAddonEndSlotChanged(evt);\n this._targetWidthCallback = () => this._adapter.getTargetWidth();\n this._mousedownListener = evt => this._onMouseDown(evt);\n }\n\n public initialize(): void {\n super.initialize();\n super.initializeTarget();\n this._initializeLabel();\n this._initializeAccessibility();\n\n this._adapter.setPlaceholderText(this._placeholder);\n this._applyDensity();\n this._setShapeType();\n\n this._detectLeadingElement();\n this._detectAddonEndContent();\n this._adapter.addMouseDownListener(this._mousedownListener);\n this._adapter.setLeadingListener(this._leadingChangeListener);\n this._adapter.setAddonEndListener(this._addonEndChangeListener);\n\n if (this._disabled) {\n this._adapter.setDisabled(true);\n }\n\n if (this._invalid) {\n this._adapter.setInvalid(true);\n }\n\n this._isInitialized = true;\n }\n\n public disconnect(): void {\n super.disconnect();\n this._adapter.removeMouseDownListener(this._mousedownListener);\n this._adapter.removeLeadingListener(this._leadingChangeListener);\n this._adapter.removeAddonEndListener(this._leadingChangeListener);\n\n if (this._floatingLabelInstance) {\n this._floatingLabelInstance.destroy();\n this._floatingLabelInstance = undefined;\n }\n }\n\n private _initializeLabel(): void {\n this._adapter.initializeLabel();\n this._updateLabel();\n this._floatingLabelInstance = this._adapter.initializeFloatingLabel();\n if (this._floatLabelType === 'always') {\n this._floatLabel(true);\n } else {\n const hasText = !!this._getSelectedText();\n const hasPlaceholder = !!this._placeholder;\n this._floatLabel(hasText || hasPlaceholder);\n }\n }\n\n private _destroyLabel(): void {\n if (this._floatingLabelInstance) {\n this._floatingLabelInstance.destroy();\n this._floatingLabelInstance = undefined;\n }\n }\n\n protected _initializeValue(): void {\n super._initializeValue();\n if (this._selectedValues.length) {\n this._floatLabel(true);\n }\n }\n\n private _initializeAccessibility(): void {\n if (this._required) {\n this._adapter.setHostAttribute('aria-required', 'true');\n }\n if (this._disabled) {\n this._adapter.setHostAttribute('aria-disabled', 'true');\n }\n if (this._invalid) {\n this._adapter.setHostAttribute('aria-invalid', 'true');\n }\n }\n\n private _onMouseDown(evt: MouseEvent): void {\n const isElementWithinSelf = this._adapter.isWithinSelf(evt.target as HTMLElement);\n if (isElementWithinSelf) {\n evt.preventDefault();\n }\n }\n\n /** Called when the `slotchange` event fires on the \"leading\" slot element. */\n private _onLeadingSlotChanged(evt: Event): void {\n this._detectLeadingElement();\n }\n\n /** Called when the `slotchange` event fires on the \"addon-end\" slot element. */\n private _onAddonEndSlotChanged(evt: Event): void {\n this._detectAddonEndContent();\n }\n\n /** Updates the component state based on the existance of elements within the \"leading\" slot. */\n private _detectLeadingElement(): void {\n if (this._adapter.hasLeadingElement()) {\n this._adapter.addRootClass(FIELD_CONSTANTS.classes.LEADING);\n } else {\n this._adapter.removeRootClass(FIELD_CONSTANTS.classes.LEADING);\n }\n }\n\n private _detectAddonEndContent(): void {\n if (this._adapter.hasAddonEndNodes()) {\n this._adapter.addRootClass(FIELD_CONSTANTS.classes.ADDON_END);\n } else {\n this._adapter.removeRootClass(FIELD_CONSTANTS.classes.ADDON_END);\n }\n }\n\n protected _onClick(evt: MouseEvent): void {\n if (this._disabled) {\n return;\n }\n\n // We ignore clicks events that originate from without our addon-end container\n const composedPath = getEventPath(evt);\n if (composedPath.find(el => el.classList && el.classList.contains(FIELD_CONSTANTS.classes.ADDON_END_CONTAINER))) {\n return;\n }\n\n this.setFocus();\n super._onClick(evt);\n }\n\n /** Handles receiving focus on the selected text element. */\n protected _onFocus(evt: Event): void {\n if (this._disabled) {\n return;\n }\n this._setFocused();\n super._onFocus(evt);\n }\n\n protected _floatLabel(value: boolean): void {\n if (!this._floatingLabelInstance) {\n return;\n }\n\n if (value) {\n this._adapter.addRootClass(SELECT_CONSTANTS.classes.LABEL_FLOAT);\n } else {\n this._adapter.removeRootClass(SELECT_CONSTANTS.classes.LABEL_FLOAT);\n }\n\n if (this._floatLabelType === 'always') {\n value = true;\n }\n\n this._floatingLabelInstance.float(value, this._floatLabelType === 'always');\n }\n\n /** Handles losing focus on the selected text element. */\n protected _onBlur(evt: FocusEvent): void {\n super._onBlur(evt);\n this._setBlurred();\n }\n\n protected _onDismiss(): void {\n super._onDismiss();\n this._setBlurred();\n }\n\n protected _onDropdownScrollEnd(): void {\n this._adapter.emitHostEvent(SELECT_CONSTANTS.events.SCROLLED_BOTTOM);\n }\n\n /**\n * Handles selecting an item in the dropdown.\n * @param {ISelectOption} option The selected option.\n * @param {number} optionIndex The index of the selected option.\n */\n protected async _onSelect(option: ISelectOption, optionIndex: number, closeDropdown = true): Promise<boolean> {\n const result = await super._onSelect(option, optionIndex, closeDropdown);\n if (result) {\n this._adapter.setSelectedText(this._getSelectedText());\n if (closeDropdown && !this._multiple) {\n this._adapter.setFocus();\n }\n }\n return result;\n }\n\n /** Updates the state of the component to contain focus. */\n private _setFocused(): void {\n this._adapter.addRootClass(FIELD_CONSTANTS.classes.FOCUSED);\n this._floatLabel(true);\n }\n\n /** Updates the state of the component to not contain focus. */\n private _setBlurred(): void {\n this._adapter.removeRootClass(FIELD_CONSTANTS.classes.FOCUSED);\n if (!this._selectedValues.length && !this._placeholder?.length) {\n this._floatLabel(false);\n }\n }\n\n /** Resets the state of the component to original values. */\n protected _reset(): void {\n super._reset();\n this._adapter.setSelectedText('');\n this._floatLabel(!this._placeholder?.length);\n }\n\n private _updateLabel(): void {\n if (this._adapter.hasLabel()) {\n this._adapter.setLabel(this._label);\n }\n if (this._label && this._density !== 'dense') {\n this._adapter.addRootClass(FIELD_CONSTANTS.classes.LABEL);\n } else {\n this._adapter.removeRootClass(FIELD_CONSTANTS.classes.LABEL);\n }\n }\n\n protected _applyValue(value: string | string[]): void {\n super._applyValue(value);\n\n // Update the state of the component based on the existence of a selected value\n const text = this._getSelectedText();\n this._adapter.setSelectedText(text);\n if (!this._open) {\n this._floatLabel(!!text || !!this._placeholder);\n }\n }\n\n private _applyDensity(): void {\n this._adapter.setRoomy(this._density === 'roomy');\n this._adapter.setDense(this._density === 'dense');\n }\n\n protected _setShapeType(): void {\n if (this._shape === 'rounded') {\n this._adapter.addRootClass(FIELD_CONSTANTS.classes.SHAPE_ROUNDED);\n } else {\n this._adapter.removeRootClass(FIELD_CONSTANTS.classes.SHAPE_ROUNDED);\n }\n }\n\n public setFocus(): void {\n this._adapter.setFocus();\n }\n\n /** Gets/sets the label text. */\n public get label(): string {\n return this._label;\n }\n public set label(value: string) {\n if (this._label !== value) {\n this._label = value;\n this._updateLabel();\n if (this._label) {\n this._initializeLabel();\n this._adapter.setHostAttribute(SELECT_CONSTANTS.attributes.LABEL, this._label);\n } else {\n this._destroyLabel();\n this.required = false;\n this._adapter.removeHostAttribute(SELECT_CONSTANTS.attributes.LABEL);\n }\n }\n }\n\n public get shape(): FieldShapeType {\n return this._shape;\n }\n public set shape(value: FieldShapeType) {\n if (this._shape !== value) {\n this._shape = value;\n\n if (this._isInitialized) {\n this._setShapeType();\n }\n\n this._adapter.setHostAttribute(FIELD_CONSTANTS.attributes.SHAPE, this._shape);\n }\n }\n\n /** Gets/sets the disabled state. */\n public get disabled(): boolean {\n return this._disabled;\n }\n public set disabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._adapter.setDisabled(this._disabled);\n this._initializeLabel();\n }\n }\n\n /** Gets/sets the invalid state. */\n public get invalid(): boolean {\n return this._invalid;\n }\n public set invalid(value: boolean) {\n if (this._invalid !== value) {\n this._invalid = value;\n this._adapter.setInvalid(this._invalid);\n }\n }\n\n /** Gets/sets the required state which controls the visibility of the asterisk in the label. */\n public get required(): boolean {\n return this._required;\n }\n public set required(value: boolean) {\n if (this._required !== value) {\n this._required = value;\n this._adapter.setRequired(this._required);\n this._adapter.toggleHostAttribute(FIELD_CONSTANTS.attributes.REQUIRED, this._required);\n }\n }\n\n /** Gets/sets the dense state. */\n public get density(): FieldDensityType {\n return this._density;\n }\n public set density(value: FieldDensityType) {\n if (this._density !== value) {\n this._density = value;\n this._applyDensity();\n this._adapter.setHostAttribute(FIELD_CONSTANTS.attributes.DENSITY, this._density.toString());\n this._initializeLabel(); // This ensures label is removed while dense\n }\n }\n\n /** Gets/sets the floating label type. */\n public get floatLabelType(): FieldFloatLabelType {\n return this._floatLabelType;\n }\n public set floatLabelType(value: FieldFloatLabelType) {\n if (this._floatLabelType !== value) {\n this._floatLabelType = value;\n this._floatLabel(this._floatLabelType === 'always' || !!this._placeholder);\n this._adapter.setHostAttribute(FIELD_CONSTANTS.attributes.FLOAT_LABEL_TYPE, isDefined(this._floatLabelType) ? this._floatLabelType.toString() : '');\n }\n }\n\n /** Gets/sets the placeholder text. */\n public get placeholder(): string {\n return this._placeholder;\n }\n public set placeholder(value: string) {\n if (this._placeholder !== value) {\n this._placeholder = value;\n this._adapter.setPlaceholderText(this._placeholder);\n this._initializeLabel();\n }\n }\n}\n", "import { CustomElement, attachShadowTemplate, FoundationProperty, coerceBoolean } from '@tylertech/forge-core';\nimport { tylIconArrowDropDown, tylIconCheckBoxOutlineBlank, tylIconCheckBox } from '@tylertech/tyler-icons/standard';\nimport { SelectAdapter } from './select-adapter';\nimport { SelectFoundation } from './select-foundation';\nimport { SELECT_CONSTANTS } from './select-constants';\nimport { OptionComponent } from '../option';\nimport { PopupComponent } from '../../popup';\nimport { ListComponent, ListItemComponent } from '../../list';\nimport { OptionGroupComponent } from '../option-group';\nimport { IconComponent, IconRegistry } from '../../icon';\nimport { BaseSelectComponent, BASE_SELECT_CONSTANTS } from '../core';\nimport { CircularProgressComponent } from '../../circular-progress';\nimport { ScaffoldComponent } from '../../scaffold';\nimport { ToolbarComponent } from '../../toolbar';\nimport { IconButtonComponent } from '../../icon-button';\nimport { FieldDensityType, FieldFloatLabelType, FieldShapeType, FIELD_CONSTANTS } from '../../field/field-constants';\nimport { IBaseSelectComponent } from '../core/base-select';\n\nconst template = '<template><div class=\\\"forge-select__wrapper\\\" part=\\\"root\\\"><div class=\\\"forge-select forge-field\\\" part=\\\"container\\\"><div class=\\\"forge-select__leading-container\\\" part=\\\"leading-container\\\"><slot name=\\\"leading\\\"></slot></div><div class=\\\"forge-field__label-input-container\\\" part=\\\"label-input-container\\\"><div id=\\\"selected-text\\\" class=\\\"forge-select__selected-text\\\" part=\\\"text\\\" aria-live=\\\"assertive\\\" aria-atomic=\\\"true\\\"></div><label id=\\\"select-label\\\" aria-hidden=\\\"true\\\" part=\\\"label\\\"></label></div><forge-icon class=\\\"forge-select__dropdown-icon\\\" name=\\\"arrow_drop_down\\\" part=\\\"icon\\\"></forge-icon><div class=\\\"forge-field__addon-end-container\\\" part=\\\"addon-end-container\\\"><slot name=\\\"addon-end\\\"></slot></div></div><slot name=\\\"helper-text\\\"></slot></div></template>';\nconst styles = '.forge-select{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;position:relative;z-index:1;z-index:var(--forge-z-index-surface,1);margin-top:0;margin-top:var(--forge-select-margin-top,0)}.forge-select.forge-field--disabled{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5);cursor:not-allowed}.forge-select:not(.forge-field--dense):not(.forge-field--roomy){height:3rem;height:var(--forge-select-height,3rem)}.forge-select.forge-field--roomy:not(.forge-field--dense){height:3.5rem;height:var(--forge-select-height,3.5rem)}.forge-select.forge-field--dense:not(.forge-field--roomy){height:1.5rem;height:var(--forge-select-height,1.5rem)}.forge-field::before{content:\\\"\\\";display:-webkit-box;display:flex;position:absolute;top:0;right:0;left:0;z-index:-1;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;max-width:100%;height:100%;pointer-events:none;border-style:solid;border-style:var(--forge-select-border-style,solid);border-width:1px;-webkit-transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);background-color:transparent;background-color:var(--forge-select-theme-background,transparent);text-align:left}.forge-field[dir=rtl]::before,[dir=rtl] .forge-field::before{text-align:right}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused)::before{border-color:rgba(0,0,0,.38);border-color:var(--mdc-theme-text-icon-on-background,rgba(0,0,0,.38))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused):hover::before{border-color:rgba(0,0,0,.87);border-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled)::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-field--invalid:not(.forge-field--disabled)::before{border-color:#b00020;border-color:var(--mdc-theme-error,#b00020)}.forge-field--invalid:not(.forge-field--disabled):not(.forge-field--focused):hover::before{border-color:#db8a98;border-color:var(--forge-theme-error-hover,#db8a98)}.forge-field--disabled::before{border-color:rgba(0,0,0,.12);border-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--shape-rounded){border-radius:4px}.forge-field:not(.forge-field--shape-rounded)::before{border-radius:4px}.forge-field--shape-rounded{border-radius:28px}.forge-field--shape-rounded::before{border-radius:28px}.forge-field--disabled::before{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5)}.forge-field--focused::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);border-width:2px}.forge-field__label-input-container{position:relative;-webkit-box-flex:1;flex:1 1 0.0001px;height:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;min-width:0}.forge-field~::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-field:not(.forge-field--dense):not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field--roomy:not(.forge-field--dense)~::slotted([slot=helper-text]){font-size:.875rem}.forge-field--dense:not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field~::slotted([slot=helper-text]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled)~::slotted([slot=helper-text]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field:not(.forge-field--shape-rounded)~::slotted([slot=helper-text]){margin-left:12px}.forge-field--shape-rounded~::slotted([slot=helper-text]){margin-left:32px}.forge-field ::slotted([slot=leading]){display:-webkit-box;display:flex;align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=leading]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=leading]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=leading]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=leading]){margin:0 4px}.forge-field ::slotted([slot=leading]:not(forge-icon-button)){padding:6px}.forge-field__addon-end-container{display:none}.forge-field--addon-end .forge-field__addon-end-container{height:100%;width:auto;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;padding:0 4px;border-left-width:1px;border-left-style:solid;-webkit-transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.54);border-left-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container:hover{border-left-color:rgba(0,0,0,.87);border-left-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#3f51b5;border-left-color:var(--mdc-theme-primary,#3f51b5)}.forge-field.forge-field--invalid:not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#b00020;border-left-color:var(--mdc-theme-error,#b00020)}.forge-field.forge-field--invalid:not(.forge-field--focused):not(.forge-field--disabled) .forge-field__addon-end-container:hover{border-left-color:#db8a98;border-left-color:var(--forge-theme-error-hover,#db8a98)}.forge-field.forge-field--disabled .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.12);border-left-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=addon-end]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=addon-end]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=addon-end]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-select__leading-container{display:-webkit-box;display:flex;align-self:center}.forge-field label{color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65));pointer-events:none;right:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);font-size:var(--mdc-typography-subtitle1-font-size, 1rem);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.1rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;-webkit-transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field label[dir=rtl],[dir=rtl] .forge-field label{right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.forge-field--dense:not(.forge-field--roomy) label{display:none}.forge-field--required label::after{content:none}.forge-field--required label::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:\\\"*\\\";margin-right:4px}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label{font-size:1rem}.forge-field--roomy:not(.forge-field--dense) label{font-size:1rem}.forge-field--disabled label{color:rgba(0,0,0,.38);color:var(--forge-theme-label-disabled-on-background,rgba(0,0,0,.38))}.forge-field--invalid:not(.forge-field--disabled) label{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) label{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label{top:1rem}.forge-field--roomy:not(.forge-field--dense) label{top:1.285rem}.forge-field:not(.forge-field--shape-rounded):not(.forge-field--leading) label{left:12px!important}.forge-field--shape-rounded:not(.forge-field--leading) label{left:32px!important}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end):not(.forge-field--shape-rounded) label{padding-right:12px}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end).forge-field--shape-rounded label{padding-right:32px}.forge-field label.forge-floating-label--float-above{color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65))}.forge-field--disabled label.forge-floating-label--float-above{color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6))}.forge-field--invalid:not(.forge-field--disabled) label.forge-floating-label--float-above{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) label.forge-floating-label--float-above{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--float-above{-webkit-transform:translateY(-.54rem) scale(.8125);transform:translateY(-.54rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--float-above{-webkit-transform:translateY(-.72rem) scale(.8125);transform:translateY(-.72rem) scale(.8125);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe{-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.62rem) scale(1);transform:translateY(-.62rem) scale(1);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe{-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.8rem) scale(1);transform:translateY(-.8rem) scale(1);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--unfloat-above-start-keyframe{-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.62rem) scale(.8125);transform:translateY(-.62rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--unfloat-above-start-keyframe{-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.8rem) scale(.8125);transform:translateY(-.8rem) scale(.8125);cursor:auto}.forge-field .forge-select__selected-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:block;overflow:hidden;text-overflow:ellipsis;align-self:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;white-space:nowrap;-webkit-transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);border:none;background:0 0;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;line-height:normal;min-width:0;font-size:var(--forge-select-font-size, 1rem);padding:0 12px;padding-right:0}.forge-field:not(.forge-field--disabled) .forge-select__selected-text{color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--disabled .forge-select__selected-text{color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6));cursor:not-allowed}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) .forge-select__selected-text{font-size:1rem;font-size:var(--forge-select-font-size, 1rem)}.forge-field--roomy:not(.forge-field--dense) .forge-select__selected-text{font-size:1rem;font-size:var(--forge-select-font-size, 1rem)}.forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{font-size:.875rem;font-size:var(--forge-select-font-size, .875rem)}.forge-field .forge-select__selected-text{padding:0 12px}.forge-field--label .forge-select__selected-text{padding-top:24px}.forge-field--roomy.forge-field--label .forge-select__selected-text{padding-top:29px}.forge-field--shape-rounded:not(.forge-field--leading) .forge-select__selected-text{padding-left:32px}.forge-field--leading .forge-select__selected-text{padding-left:0}.forge-field--label .forge-select__selected-text{padding-bottom:3px}.forge-field--roomy.forge-field--label .forge-select__selected-text{padding-bottom:8px}.forge-field:not(.forge-field--label):not(.forge-field--dense):not(.forge-field--roomy) .forge-select__selected-text{line-height:var(--forge-select-height, 3rem)}.forge-field:not(.forge-field--label).forge-field--roomy:not(.forge-field--dense) .forge-select__selected-text{line-height:var(--forge-select-height-roomy, 3.5rem)}.forge-field:not(.forge-field--label).forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{line-height:var(--forge-select-height-dense, 1.5rem)}.forge-field.forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{padding:0 8px}.forge-field .forge-select__selected-text:empty::before{content:attr(placeholder);color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field .forge-select--label .forge-select__selected-text{padding-top:25px}.forge-field .forge-select__dropdown-icon{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;width:24px;height:100%;-webkit-box-flex:0;flex:none;-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);pointer-events:none;margin-right:8px}.forge-select--opened .forge-field .forge-select__dropdown-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-select--opened .forge-field .forge-select__dropdown-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) .forge-select__dropdown-icon{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) .forge-select__dropdown-icon{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled .forge-select__dropdown-icon{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field.forge-field--dense:not(.forge-field--roomy) .forge-select__dropdown-icon{margin-right:4px}:host{display:block;contain:layout}:host(:focus){outline:0}:host([hidden]){display:none}';\n\nexport interface ISelectComponent extends IBaseSelectComponent {\n density: FieldDensityType;\n floatLabelType: FieldFloatLabelType;\n shape: FieldShapeType;\n invalid: boolean;\n required: boolean;\n label: string;\n disabled: boolean;\n placeholder: string;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-select': ISelectComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-select-scrolled-bottom': CustomEvent<void>;\n 'change': CustomEvent<any>;\n }\n}\n\n/**\n * The custom element class behind the `<forge-select>` component.\n * \n * @tag forge-select\n */\n@CustomElement({\n name: SELECT_CONSTANTS.elementName,\n dependencies: [\n OptionComponent,\n OptionGroupComponent,\n PopupComponent,\n ListComponent,\n ListItemComponent,\n CircularProgressComponent,\n IconComponent,\n ScaffoldComponent,\n ToolbarComponent,\n IconButtonComponent\n ]\n})\nexport class SelectComponent extends BaseSelectComponent<SelectFoundation> implements ISelectComponent {\n public static get observedAttributes(): string[] {\n return [\n FIELD_CONSTANTS.attributes.DENSITY,\n FIELD_CONSTANTS.attributes.FLOAT_LABEL_TYPE,\n FIELD_CONSTANTS.attributes.SHAPE,\n FIELD_CONSTANTS.attributes.INVALID,\n FIELD_CONSTANTS.attributes.REQUIRED,\n SELECT_CONSTANTS.attributes.LABEL,\n SELECT_CONSTANTS.attributes.MULTIPLE,\n SELECT_CONSTANTS.attributes.VALUE,\n SELECT_CONSTANTS.attributes.DISABLED,\n SELECT_CONSTANTS.attributes.PLACEHOLDER,\n SELECT_CONSTANTS.attributes.OBSERVE_SCROLL,\n SELECT_CONSTANTS.attributes.OBSERVE_SCROLL_THRESHOLD,\n BASE_SELECT_CONSTANTS.attributes.POPUP_CLASSES,\n BASE_SELECT_CONSTANTS.attributes.OPTION_LIMIT,\n BASE_SELECT_CONSTANTS.attributes.SYNC_POPUP_WIDTH,\n BASE_SELECT_CONSTANTS.attributes.CONSTRAIN_POPUP_WIDTH,\n BASE_SELECT_CONSTANTS.attributes.WRAP_OPTION_TEXT\n ];\n }\n\n constructor() {\n super();\n IconRegistry.define([tylIconArrowDropDown, tylIconCheckBox, tylIconCheckBoxOutlineBlank]);\n attachShadowTemplate(this, template, styles);\n this._foundation = new SelectFoundation(new SelectAdapter(this));\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case FIELD_CONSTANTS.attributes.DENSITY:\n this.density = newValue as FieldDensityType;\n return;\n case FIELD_CONSTANTS.attributes.FLOAT_LABEL_TYPE:\n this.floatLabelType = newValue as FieldFloatLabelType;\n return;\n case FIELD_CONSTANTS.attributes.SHAPE:\n this.shape = newValue as FieldShapeType;\n break;\n case FIELD_CONSTANTS.attributes.INVALID:\n this.invalid = coerceBoolean(newValue);\n return;\n case FIELD_CONSTANTS.attributes.REQUIRED:\n this.required = coerceBoolean(newValue);\n return;\n case SELECT_CONSTANTS.attributes.LABEL:\n this.label = newValue;\n return;\n case SELECT_CONSTANTS.attributes.DISABLED:\n this.disabled = coerceBoolean(newValue);\n return;\n case SELECT_CONSTANTS.attributes.PLACEHOLDER:\n this.placeholder = newValue;\n return;\n }\n super.attributeChangedCallback(name, oldValue, newValue);\n }\n\n /** Gets/sets the label text. */\n @FoundationProperty()\n public declare label: string;\n\n /** Gets/sets the disabled state. */\n @FoundationProperty()\n public declare disabled: boolean;\n\n /** Gets/sets the invalid state. */\n @FoundationProperty()\n public declare invalid: boolean;\n\n /** Gets/sets the required state which controls the visibility of the asterisk in the label. */\n @FoundationProperty()\n public declare required: boolean;\n\n /** Controls the density type. */\n @FoundationProperty()\n public declare density: FieldDensityType;\n\n /** Whether the label should always float, never float or float as the user types. */\n @FoundationProperty()\n public declare floatLabelType: FieldFloatLabelType;\n\n /** The shape type to use. */\n @FoundationProperty()\n public declare shape: FieldShapeType;\n\n /** Gets/sets the placeholder text. */\n @FoundationProperty()\n public declare placeholder: string;\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { SelectComponent } from './select';\n\nexport * from './select-adapter';\nexport * from './select-constants';\nexport * from './select-foundation';\nexport * from './select';\n\nexport function defineSelectComponent(): void {\n defineCustomElement(SelectComponent);\n}\n"],
|
|
5
|
+
"mappings": "28BAEA,IAAMA,EAA2C,GAAGC,UAE9CC,EAAU,C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AW,MAC/B,KAAK,MAAQI,EACb,YACGJ,EAAiB,WAAW,SAC/B,KAAK,SAAWK,EAAcD,CAAQ,EACtC,YACGJ,EAAiB,WAAW,YAC/B,KAAK,YAAcI,EACnB,OAEJ,MAAM,yBAAyBF,EAAMC,EAAUC,CAAQ,CACzD,CAiCF,EA7BiBE,EAAA,CADdC,EAAmB,GA7DTjB,EA8DI,qBAIAgB,EAAA,CADdC,EAAmB,GAjETjB,EAkEI,wBAIAgB,EAAA,CADdC,EAAmB,GArETjB,EAsEI,uBAIAgB,EAAA,CADdC,EAAmB,GAzETjB,EA0EI,wBAIAgB,EAAA,CADdC,EAAmB,GA7ETjB,EA8EI,uBAIAgB,EAAA,CADdC,EAAmB,GAjFTjB,EAkFI,8BAIAgB,EAAA,CADdC,EAAmB,GArFTjB,EAsFI,qBAIAgB,EAAA,CADdC,EAAmB,GAzFTjB,EA0FI,2BA1FJA,EAANgB,EAAA,CAfNE,EAAc,CACb,KAAMR,EAAiB,YACvB,aAAc,CACZS,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,CACF,CACF,CAAC,GACY5B,GCtDN,SAAS6B,IAA8B,CAC5CC,EAAoBC,CAAe,CACrC",
|
|
6
|
+
"names": ["elementName", "COMPONENT_NAME_PREFIX", "classes", "selectors", "attributes", "events", "SELECT_CONSTANTS", "SelectAdapter", "BaseSelectAdapter", "component", "getShadowElement", "SELECT_CONSTANTS", "tryCreateAriaControlsPlaceholder", "setAriaControls", "FloatingLabel", "value", "name", "toggleAttribute", "listener", "type", "config", "toggleClass", "id", "isDisabled", "FIELD_CONSTANTS", "isInvalid", "isRequired", "isRoomy", "isDense", "fontSize", "fontFamily", "calculateFontWidth", "style", "element", "SelectFoundation", "BaseSelectFoundation", "adapter", "evt", "hasText", "hasPlaceholder", "FIELD_CONSTANTS", "getEventPath", "el", "value", "SELECT_CONSTANTS", "option", "optionIndex", "closeDropdown", "result", "_a", "text", "isDefined", "template", "styles", "SelectComponent", "BaseSelectComponent", "IconRegistry", "tylIconArrowDropDown", "tylIconCheckBox", "tylIconCheckBoxOutlineBlank", "attachShadowTemplate", "SelectFoundation", "SelectAdapter", "FIELD_CONSTANTS", "SELECT_CONSTANTS", "BASE_SELECT_CONSTANTS", "name", "oldValue", "newValue", "coerceBoolean", "__decorateClass", "FoundationProperty", "CustomElement", "OptionComponent", "OptionGroupComponent", "PopupComponent", "ListComponent", "ListItemComponent", "CircularProgressComponent", "IconComponent", "ScaffoldComponent", "ToolbarComponent", "IconButtonComponent", "defineSelectComponent", "defineCustomElement", "SelectComponent"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
|
+
* License: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import{b as Z}from"./chunk.H5IFZCUL.js";import{c as pe}from"./chunk.VDF5MWGC.js";import{a as le,b as ae}from"./chunk.EYGSUZWX.js";import{a as F}from"./chunk.OZPV5ZJC.js";import{a as re}from"./chunk.IX2UHMIM.js";import{a as oe}from"./chunk.EQEMCHMB.js";import{h as ue,i as de}from"./chunk.LEINPSKL.js";import{b as se}from"./chunk.RQG6GVOI.js";import{c as ie}from"./chunk.K57IO236.js";import{e as te}from"./chunk.AJTQHK25.js";import{b as ee}from"./chunk.P73BXRKY.js";import{a as C,e as ne}from"./chunk.WCSVKQR2.js";import{c as W,g as K,h as q}from"./chunk.MZLPUI6R.js";import{a as D}from"./chunk.YI4JTY4T.js";import{d as j,l as Q,m as J}from"./chunk.WHQZNZHW.js";import{a as z}from"./chunk.2KXSGD3S.js";import{b as $,i as Y,j as X}from"./chunk.KYH5GKVI.js";import{a as R}from"./chunk.UWYANU5D.js";import{a}from"./chunk.KTGSZEAG.js";import{a as H,b as G,c as V}from"./chunk.DL7NX432.js";import{a as N,e as U,g as L}from"./chunk.LJLEPTLU.js";import{m as B,r as M,s as k,u as A}from"./chunk.4LA6HEA7.js";import{a as y,b as h,c as x,j as T,k as f,l as S,n as w,o as P}from"./chunk.J2M2MXP2.js";import{a as E,f as p}from"./chunk.MCIQXNKY.js";var g=`${G}autocomplete`,ve={MODE:"mode",MULTIPLE:"multiple",DEBOUNCE:"debounce",FILTER_ON_FOCUS:"filter-on-focus",FILTER_FOCUS_FIRST:"filter-focus-first",ALLOW_UNMATCHED:"allow-unmatched",POPUP_TARGET:"popup-target",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",SYNC_POPUP_WIDTH:"sync-popup-width",OPEN:"open",MATCH_KEY:"match-key",FILTER_TEXT:"filter-text",DROPDOWN_ICON_OPEN:"data-forge-dropdown-icon-open"},be={INPUT:re.selectors.INPUT,DROPDOWN_ICON:"[data-forge-dropdown-icon],[data-forge-dropdown-icon],[forge-dropdown-icon],.forge-dropdown-icon",CLEAR_BUTTON:"[data-forge-autocomplete-clear],[forge-autocomplete-clear]"},ge={DEFAULT_DEBOUNCE_TIME:500,NUM_SKELETON_ITEMS:3},Oe={CHANGE:`${g}-change`,SELECT:`${g}-select`,SCROLLED_BOTTOM:`${g}-scrolled-bottom`},o={elementName:g,attributes:ve,selectors:be,numbers:ge,events:Oe},ce=(e=>(e.Default="default",e.Stateless="stateless",e))(ce||{});var O=class extends R{constructor(e){super(e);this.setInputElement()}get inputElement(){return this._inputElement}setInputElement(){let e=M(this._component,o.selectors.INPUT,!1);return e.length&&(this._inputElement=e[0]),this._inputElement}setInputAttribute(e,t){this._inputElement.setAttribute(e,t)}addInputListener(e,t){this._inputElement.addEventListener(e,t)}removeInputListener(e,t){this._inputElement.removeEventListener(e,t)}initializeInputAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","polite"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.setAttribute("aria-autocomplete","list"),Y(),X(this._inputElement)}isWrappingChipField(){return!!this._component.querySelector(F.elementName)}show(e,t){this._targetElement=this._getTargetElement(t),this._targetElement&&(this._listDropdown=new ue(this._targetElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-expanded","true"),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._tryToggleDropdownIconRotation(!0))}hide(e){if(!this._listDropdown)return;let{targetElement:t}=this._listDropdown.dropdownElement;t.removeEventListener(C.events.BLUR,e),this.setBusyVisibility(!1),this._tryToggleDropdownIconRotation(!1),this._inputElement.removeAttribute("aria-activedescendant"),this._inputElement.removeAttribute("aria-controls"),this._inputElement.setAttribute("aria-expanded","false"),this._listDropdown.close(),this._listDropdown=void 0}setBusyVisibility(e){var t;(t=this._listDropdown)==null||t.setBusyVisibility(e)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(C.events.BLUR,e)}focus(){window.requestAnimationFrame(()=>this._inputElement.focus())}setOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}appendOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setSelectedText(e){this._inputElement.value=e}getInputValue(){return this._inputElement.value}setInputValue(e){this._inputElement.value=e}selectInputValue(){window.requestAnimationFrame(()=>this._inputElement.select())}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}hasFocus(){let e=k(this._component.ownerDocument);return e===this._inputElement||this.isFocusWithinPopup(e)}hasInputElement(){return!!this._inputElement}setDropdownIconListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.addEventListener(e,t)})}removeDropdownIconListener(e,t){let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.removeEventListener(e,t)}setClearButtonListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.addEventListener(e,t)})}removeClearButtonListener(e,t){let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.removeEventListener(e,t)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}updateActiveDescendant(e){!this._targetElement||A(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._targetElement||(this._targetElement=this._getTargetElement(e)),this._targetElement.getBoundingClientRect().width}getPopupElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateOptionByIndex(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:null}clearActiveOption(){var e;(e=this._listDropdown)==null||e.clearActiveOption()}setSelectedOptions(e){if(this._listDropdown){let t=e.map(i=>i.value);this._listDropdown.setSelectedValues(t)}}queueDropdownPositionUpdate(){!this.getPopupElement()||window.requestAnimationFrame(()=>{let e=this.getPopupElement();e==null||e.position()})}_getTargetElement(e){return e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement()}_getDefaultTargetElement(){let e=this._component.querySelector("forge-text-field");if(e&&e.shadowRoot){let i=L(e,le.selectors.ROOT);if(i)return i}let t=this._component.querySelector("forge-chip-field");if(t&&t.shadowRoot){let i=L(t,F.selectors.ROOT);if(i)return i}return this._component.querySelector("input")||this._component}_tryToggleDropdownIconRotation(e){let t=this._component.querySelector(o.selectors.DROPDOWN_ICON);t&&A(t,e,o.attributes.DROPDOWN_ICON_OPEN)}};var he=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(he||{});function v(u,d){let e=u.some(i=>h(i)&&T(i)&&i.hasOwnProperty("options")&&(i.hasOwnProperty("text")||i.hasOwnProperty("builder"))),t=u.some(i=>h(i)&&T(i)&&i.hasOwnProperty("label")&&i.hasOwnProperty("value"));return e&&d===1||t&&d===0}function _e(u,d){return u.find(e=>e.value===d)}function b(u,d,e=null){return e?!(e in u.value)||!(e in d)?!1:w(u.value[e],d[e]):w(u.value,d)}var I=class extends de{constructor(e){super();this._adapter=e;this._isInitialized=!1;this._isDropdownOpen=!1;this._mode="default";this._multiple=!1;this._debounce=o.numbers.DEFAULT_DEBOUNCE_TIME;this._allowUnmatched=!1;this._filterOnFocus=!0;this._filterFocusFirst=!0;this._options=[];this._filterText="";this._selectedOptions=[];this._values=[];this._pendingFilterPromises=[];this._matchKey=null;this._clickListener=t=>this._onClick(t),this._focusListener=()=>this._onFocus(),this._blurListener=t=>this._onBlur(t),this._keydownListener=t=>this._onKeydown(t),this._dropdownIconClickListener=t=>this._onDropdownIconClick(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dropdownIconMouseDownListener=t=>this._onDropdownIconMouseDown(t),this._clearButtonListener=t=>this._onClear(t),this._dismissListener=()=>this._onDismiss(),this._activeChangeListener=t=>this._adapter.updateActiveDescendant(t),this._targetWidthCallback=()=>this._adapter.getTargetElementWidth(this._popupTarget),this._identifier=y()}async initialize(){if(!this._adapter.hasInputElement()&&!this._adapter.setInputElement())throw new Error("An input element is required as a child of the autocomplete component.");if(this._setInputListener(),this._setFilterCallback(),this._attachListeners(),this._initializeAccessibility(),this._values.length){if(!this._selectedOptions.length){try{await this._executeFilter()}catch(e){console.error(e)}this._updateSelectedOptions(this._values)}this._adapter.setSelectedText(this._getSelectedText())}this._isInitialized=!0}disconnect(){this._isInitialized&&(this._detachListeners(),this._isInitialized=!1),this._isDropdownOpen&&this._closeDropdown()}async forceFilter({preserveValue:e}){this._options=[],await this._executeFilter(!0,!0),e&&this._options.push(...this._selectedOptions),this._applyValue(this._values)}_attachListeners(){this._adapter.addInputListener("click",this._clickListener),this._adapter.addInputListener("focus",this._focusListener),this._adapter.addInputListener("blur",this._blurListener),this._adapter.addInputListener("input",this._inputListener),this._adapter.addInputListener("keydown",this._keydownListener),this._adapter.setDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.setDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.setClearButtonListener("click",this._clearButtonListener)}_detachListeners(){this._adapter.removeInputListener("click",this._clickListener),this._adapter.removeInputListener("focus",this._focusListener),this._adapter.removeInputListener("blur",this._blurListener),this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("keydown",this._keydownListener),this._adapter.removeDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.removeDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.removeClearButtonListener("click",this._clearButtonListener)}_setInputListener(){this._inputListener=e=>this._onInput(e)}_setFilterCallback(){this._filterFn=h(this._debounce)&&this._debounce>0?P(this._debounceFilter,this._debounce,!1):this._debounceFilter}_initializeAccessibility(){this._adapter.initializeInputAccessibility(this._identifier)}get _flatOptions(){return v(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onClick(e){!this._isDropdownOpen&&this._filterOnFocus&&this._showDropdown()}_onDropdownIconMouseDown(e){e.preventDefault()}_onDropdownIconClick(e){this._isDropdownOpen?this._closeDropdown():(this._adapter.focus(),window.requestAnimationFrame(()=>this._showDropdown()))}_onClear(e){this._filterText="",this._clearValue(),this._adapter.setSelectedText(this._getSelectedText())}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_onFocus(){!this._isDropdownOpen&&this._adapter.getInputValue()&&!D.isMobile&&this._adapter.selectInputValue()}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._applyBlur()}_applyBlur(){this._isDropdownOpen&&this._closeDropdown(),this._mode!=="stateless"&&(this._selectedOptions.length?this._adapter.setSelectedText(this._getSelectedText()):this._allowUnmatched||(this._filterText="",this._adapter.setSelectedText("")))}_onInput(e){this._selectedOptions.length&&!this._multiple&&(!this._adapter.getInputValue()||this._allowUnmatched)&&!this._adapter.isWrappingChipField()&&(this._selectedOptions=[],this._values=[],this._emitChangeEvent()),this._filterText=this._adapter.getInputValue(),this._filterFn()}async _debounceFilter({checkFocus:e=!0}={}){if(!e&&!this._adapter.hasFocus()){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}let t=this._filterText,i=this._executeFilter();this._pendingFilterPromises.push(i),this._isDropdownOpen?this._adapter.setBusyVisibility(!0):this._showDropdown({filter:!1});try{await i}catch(n){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}if(t===this._filterText)this._pendingFilterPromises=[],this._onFilterComplete();else{let n=this._pendingFilterPromises.indexOf(i);n!==-1&&this._pendingFilterPromises.splice(n,1)}}_onKeydown(e){switch(e.key){case"Tab":this._isDropdownOpen&&!this._multiple&&this._selectActiveOption(!1);break;case"Esc":case"Escape":this._isDropdownOpen&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Down":case"ArrowDown":e.preventDefault(),this._isDropdownOpen?this._adapter.propagateKey(e.key):this._showDropdown({activateFirst:!0,activateSelected:!0});break;case"Up":case"ArrowUp":e.preventDefault(),this._isDropdownOpen&&this._adapter.propagateKey(e.key);break;case"Enter":case"Home":case"End":this._isDropdownOpen&&(e.key==="Enter"&&e.stopPropagation(),e.preventDefault(),this._adapter.propagateKey(e.key));break;case"Backspace":case"Delete":let t=e.target,i=this._adapter.getInputValue(),n=t.value.substring(t.selectionStart,t.selectionEnd)===t.value,l=i.length===1&&t.selectionEnd===1,c=i.length===1&&t.selectionEnd===0,_=!i||n||l||c;!this._adapter.isWrappingChipField()&&_&&!this._multiple&&this._values.length&&this._clearValue();break}}_executeFilter(e=!0,t=!1){if(!this._filter||typeof this._filter!="function")throw new Error('A filter callback must be provided. Did you set the "filter" property?');let i=this._filter,n=e?this._filterText:"",l=t?this._getValue():null;return new Promise((c,_)=>Promise.resolve(i(n,l)).then(r=>{this._options=r,c(this._options)}).catch(r=>_(`An unexpected error occurred while filtering: ${r}`)))}_onFilterComplete(){if(!this._adapter.hasFocus()){this._isDropdownOpen&&this._closeDropdown();return}if(this._options.length){let e=this._allowUnmatched&&!this._selectedOptions.length;this._dropdownReady({userTriggered:e}),this._filterFocusFirst&&this._filterText&&this._adapter.activateFirstOption()}else this._closeDropdown()}_clearValue(){this._selectedOptions=[],this._values=[],this._isDropdownOpen&&(this._adapter.setSelectedOptions([]),this._adapter.clearActiveOption()),this._emitChangeEvent()}async _showDropdown({filter:e=!0,userTriggered:t=!0,activateFirst:i=!1,activateSelected:n=!1}={}){let l=this._allowUnmatched&&!this._selectedOptions.length;this._isDropdownOpen=!0;let c;if(this._optionBuilder){let r=this._optionBuilder;c=(m,fe)=>r(m,this._filterText,fe)}let _={options:this._options,referenceElement:this._adapter.inputElement,multiple:this._multiple,selectedValues:[...this._values],id:`forge-autocomplete-${this._identifier}`,asyncStyle:"skeleton",optionLimit:this._optionLimit,popupClasses:this._popupClasses,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,transform:r=>{if(this._filterText){let m=$(r,this._filterText);if(m)return m}return r},allowBusy:!0,optionBuilder:c,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,selectCallback:r=>this._onSelect(r),closeCallback:()=>this._closeDropdown()};if(this._adapter.show(_,this._popupTarget),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen),e){this._options.length&&this._adapter.setBusyVisibility(!0);try{await this._executeFilter(l)}catch(r){console.error(r)}this._updateSelectedOptions(this._values)}this._pendingFilterPromises.length||this._dropdownReady({userTriggered:t,activateFirst:i,activateSelected:n})}_dropdownReady({userTriggered:e=!0,activateFirst:t=!1,activateSelected:i=!1}={}){if(!this._isDropdownOpen||!this._options.length||e&&!this._adapter.hasFocus()){this._closeDropdown();return}this._sortSelectedOptions(),this._adapter.setBusyVisibility(!1),this._adapter.setOptions(this._options),this._adapter.setSelectedOptions(this._selectedOptions),this._adapter.setDismissListener(this._dismissListener),i&&this._selectedOptions.length?this._adapter.activateSelectedOption():t&&this._adapter.activateFirstOption()}_closeDropdown(){this._multiple&&(this._filterText=""),this._isDropdownOpen=!1,this._adapter.hide(this._dismissListener),this._sortSelectedOptions(),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen)}_sortSelectedOptions(){if(this._multiple&&this._selectedOptions.length&&v(this._options,0)){let e=[],t=[];this._options.forEach(i=>{this._selectedOptions.find(n=>b(n,i.value,this._matchKey))?e.push(i):t.push(i)}),this._options=[...e,...t]}}async _onSelect(e,t=!0){if(this._valueChanging)return;if(this._mode==="stateless"){let n={value:e};this._adapter.emitHostEvent(o.events.SELECT,n,!0,!0)&&(this._filterText="",this._multiple||this._closeDropdown());return}let i=()=>{let l=this._flatOptions.find(r=>b(r,e,this._matchKey)),c=l?l.value:"",_=l?l.label:"";if(this._multiple){let r=_e(this._selectedOptions,c);if(r){let m=this._selectedOptions.indexOf(r);this._selectedOptions.splice(m,1)}else this._selectedOptions.push(l)}else h(c)?(this._selectedOptions[0]=l,this._filterText=_):(this._selectedOptions=[],this._filterText="");this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions),this._values=this._selectedOptions.map(r=>r.value),this._adapter.setSelectedText(this._getSelectedText()),!D.isMobile&&t&&this._adapter.selectInputValue(),this._emitChangeEvent(),this._tryUpdateDropdownPosition()};this._isDropdownOpen&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"?(this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,e,this._matchKey)),await this._valueChanging?i():this._tryUpdateDropdownPosition(),this._valueChanging=void 0):i()}_selectActiveOption(e=!0){let t=this._adapter.getActiveOptionIndex();if(typeof t=="number"&&t>=0){let i=this._flatOptions[t];i&&this._onSelect(i.value,e)}}_emitChangeEvent(){this._adapter.emitHostEvent(o.events.CHANGE,this._getValue(),!0)}_tryUpdateDropdownPosition(){this._isDropdownOpen&&this._adapter.queueDropdownPositionUpdate()}_getValue(){return this._values?this._values.length?this._multiple?[...this._values]:this._values[0]:this._multiple?[]:null:null}_getSelectedText(){var e,t;return this._adapter.isWrappingChipField()?"":this._selectedTextBuilder?this._selectedTextBuilder(this._selectedOptions):this._multiple?this._values.length?this._values.length===1?(t=(e=this._selectedOptions[0])==null?void 0:e.label)!=null?t:"":`${this._values.length} options selected`:"":this._selectedOptions.filter(i=>i&&i.label).map(i=>i.label).join(" ").trim()}_onDismiss(){this._closeDropdown()}async _applyValue(e){let t=[];this._selectedOptions=[],Array.isArray(e)?t=e:t=h(e)?[e]:[],!this._multiple&&t.length>1&&(t=[t[0]]),v(t,0)?(this._values=t.map(n=>n.value),this._selectedOptions=t):this._values=t;let i=this._flatOptions;if(t.length&&i.length&&this._updateSelectedOptions(t),this._values.length&&!this._selectedOptions.length&&!!this._filter&&this._isInitialized){try{await this._executeFilter(!1,!0)}catch(n){console.error(n)}this._updateSelectedOptions(this._values)}this._multiple?this._filterText="":this._filterText=this._selectedOptions.length?this._selectedOptions[0].label:"",this._isInitialized&&this._adapter.setSelectedText(this._getSelectedText()),this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions)}_updateSelectedOptions(e){let t=[...this._flatOptions,...this._selectedOptions];if(this._selectedOptions.length&&(this._selectedOptions=[]),v(e,0))for(let i of e){let n=t.find(l=>b(l,i.value,this._matchKey));n?this._selectedOptions.push(n):this._selectedOptions.push(i)}else for(let i of e){let n=t.find(l=>b(l,i,this._matchKey));n?this._selectedOptions.push(n):this._allowUnmatched&&this._selectedOptions.push({label:i,value:i})}}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._mode==="stateless"&&(this._selectedOptions=[],this._isDropdownOpen&&this._closeDropdown()),this._adapter.setHostAttribute(o.attributes.MODE,this._mode))}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._adapter.setHostAttribute(o.attributes.MULTIPLE,h(this._multiple)?this._multiple.toString():""))}get value(){return this._getValue()}set value(e){let t=[];e==null?t=[]:Array.isArray(e)?t=structuredClone(e):x(e)?t=[e]:t=[structuredClone(e)],(t.length!==this._values.length||t.some(n=>!this._values.includes(n)))&&this._applyValue(e)}get filterOnFocus(){return this._filterOnFocus}set filterOnFocus(e){this._filterOnFocus!==e&&(this._filterOnFocus=e,this._adapter.setHostAttribute(o.attributes.FILTER_ON_FOCUS,h(this._filterOnFocus)?this._filterOnFocus.toString():""))}get filterFocusFirst(){return this._filterFocusFirst}set filterFocusFirst(e){this._filterFocusFirst!==e&&(this._filterFocusFirst=e,this._adapter.toggleHostAttribute(o.attributes.FILTER_FOCUS_FIRST,this._filterFocusFirst))}get allowUnmatched(){return this._allowUnmatched}set allowUnmatched(e){this._allowUnmatched!==e&&(this._allowUnmatched=e,h(this._allowUnmatched)&&this._adapter.setHostAttribute(o.attributes.ALLOW_UNMATCHED,this._allowUnmatched.toString()))}get matchKey(){return this._matchKey}set matchKey(e){this._matchKey!==e&&(this._matchKey=e)}get popupTarget(){return this._popupTarget}set popupTarget(e){this._popupTarget!==e&&(this._popupTarget=e)}get filterText(){return this._filterText}set filterText(e){this._filterText!==e&&(this._filterText=this._allowUnmatched?e:"",this._isInitialized&&this._allowUnmatched&&(this._adapter.setInputValue(this._filterText),this._isDropdownOpen&&this._debounceFilter({checkFocus:!1})))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:[this._popupClasses]}set popupClasses(e){this._popupClasses!==e&&(this._popupClasses=Array.isArray(e)?[...e]:[e])}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}set popupFooterBuilder(e){this._popupFooterBuilder=e}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth!==e&&(this._syncPopupWidth=e)}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit!==e&&(this._optionLimit=e)}get debounce(){return this._debounce}set debounce(e){this._debounce!==e&&(this._debounce=e,this._isInitialized&&this._setFilterCallback(),this._adapter.setHostAttribute(o.attributes.DEBOUNCE,h(this._debounce)?this._debounce.toString():""))}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get filter(){return this._filter}set filter(e){this._filter!==e&&(this._filter=e,this._isInitialized&&this._values.length&&!this._flatOptions.length&&!!this._filter&&this._executeFilter().then(()=>{this._updateSelectedOptions(this._values),this._adapter.setSelectedText(this._getSelectedText())}))}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e,this._selectedOptions.length&&this._adapter.setSelectedText(this._getSelectedText())}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}appendOptions(e){!this._isDropdownOpen||(this._options=[...this._options,...e],this._adapter.appendOptions(e))}get isInitialized(){return this._isInitialized}get open(){return this._isDropdownOpen}set open(e){this._isDropdownOpen!==e&&(e?this._showDropdown({userTriggered:!1}):this._closeDropdown())}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){e!==this._beforeValueChange&&(this._beforeValueChange=e)}get popupElement(){return this._adapter.getPopupElement()}};var Ie="<template><slot></slot></template>",Ee=":host{display:block}:host([hidden]){display:none}",s=class extends oe{constructor(){super();j.define([W,q,K]),U(this,Ie,Ee),this._foundation=new I(new O(this))}static get observedAttributes(){return[o.attributes.MODE,o.attributes.MULTIPLE,o.attributes.DEBOUNCE,o.attributes.FILTER_ON_FOCUS,o.attributes.FILTER_FOCUS_FIRST,o.attributes.ALLOW_UNMATCHED,o.attributes.POPUP_TARGET,o.attributes.POPUP_CLASSES,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,o.attributes.OPTION_LIMIT,o.attributes.SYNC_POPUP_WIDTH,o.attributes.OPEN,o.attributes.MATCH_KEY,o.attributes.FILTER_TEXT]}connectedCallback(){this.querySelector(o.selectors.INPUT)?this._foundation.initialize():B(this,o.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case o.attributes.MODE:this.mode=i;break;case o.attributes.MULTIPLE:this.multiple=f(i);break;case o.attributes.DEBOUNCE:this.debounce=S(i);break;case o.attributes.FILTER_ON_FOCUS:this.filterOnFocus=f(i);break;case o.attributes.FILTER_FOCUS_FIRST:this.filterFocusFirst=f(i);break;case o.attributes.ALLOW_UNMATCHED:this.allowUnmatched=f(i);break;case o.attributes.POPUP_TARGET:this.popupTarget=i;break;case o.attributes.OPEN:this.open=f(i);break;case o.attributes.MATCH_KEY:this.matchKey=i;break;case o.attributes.FILTER_TEXT:this.filterText=i;break}}appendOptions(e){this._foundation.appendOptions(e)}openDropdown(){this.open=!0}closeDropdown(){this.open=!1}forceFilter(e={preserveValue:!1}){this._foundation.forceFilter(e)}};p([a()],s.prototype,"mode",2),p([a()],s.prototype,"multiple",2),p([a()],s.prototype,"value",2),p([a()],s.prototype,"debounce",2),p([a()],s.prototype,"filterOnFocus",2),p([a()],s.prototype,"filterFocusFirst",2),p([a()],s.prototype,"allowUnmatched",2),p([a()],s.prototype,"popupTarget",2),p([a()],s.prototype,"filterText",2),p([a()],s.prototype,"optionBuilder",2),p([a()],s.prototype,"filter",2),p([a()],s.prototype,"selectedTextBuilder",2),p([a()],s.prototype,"open",2),p([a()],s.prototype,"matchKey",2),p([a({set:!1})],s.prototype,"isInitialized",2),p([a({set:!1})],s.prototype,"popupElement",2),p([a()],s.prototype,"beforeValueChange",2),s=p([H({name:o.elementName,dependencies:[pe,ne,ie,te,Z,se,ee,Q]})],s);var me=class extends z{constructor(e){super(e)}_build(){let e=document.createElement(o.elementName);return this._attachTextField(e),e}get textFieldDelegate(){return this._textFieldDelegate}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(e){this._textFieldDelegate.inputElement.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(o.events.CHANGE,t=>e(t.detail))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,n,l,c,_,r;let t={props:E({},(n=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:n.props),options:E({},(c=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:c.options)};t.options||(t.options={}),((_=this._config.options)==null?void 0:_.useDropdownIcon)!==!1&&!((r=t.options)!=null&&r.trailingElement)&&(t.options.trailingElement=this._createDropdownIconElement()),this._textFieldDelegate=new ae(t),e.appendChild(this._textFieldDelegate.element)}_createDropdownIconElement(){let e={props:{slot:"trailing",name:"arrow_drop_down"},options:{attributes:{"forge-dropdown-icon":""}}};return new J(e).element}};function Kt(){N(s)}export{o as a,ce as b,O as c,he as d,v as e,_e as f,b as g,I as h,s as i,me as j,Kt as k};
|
|
7
|
+
//# sourceMappingURL=chunk.N6MAUMFI.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/autocomplete/autocomplete-constants.ts", "../../src/autocomplete/autocomplete-adapter.ts", "../../src/autocomplete/autocomplete-utils.ts", "../../src/autocomplete/autocomplete-foundation.ts", "../../src/autocomplete/autocomplete.ts", "../../src/autocomplete/autocomplete-component-delegate.ts", "../../src/autocomplete/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { COMPONENT_NAME_PREFIX, KEYSTROKE_DEBOUNCE_THRESHOLD } from '../constants';\nimport { IListItemComponent } from '../list';\nimport { IListDropdownConfig, IListDropdownOption, IListDropdownOptionGroup, ListDropdownOptionGroupBuilder } from '../list-dropdown';\nimport { IPopupPosition } from '../popup';\nimport { FIELD_CONSTANTS } from '../field/field-constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}autocomplete`;\n\nconst attributes = {\n MODE: 'mode',\n MULTIPLE: 'multiple',\n DEBOUNCE: 'debounce',\n FILTER_ON_FOCUS: 'filter-on-focus',\n FILTER_FOCUS_FIRST: 'filter-focus-first',\n ALLOW_UNMATCHED: 'allow-unmatched',\n POPUP_TARGET: 'popup-target',\n POPUP_CLASSES: 'popup-classes',\n OPTION_LIMIT: 'option-limit',\n OBSERVE_SCROLL: 'observe-scroll',\n OBSERVE_SCROLL_THRESHOLD: 'observe-scroll-threshold',\n SYNC_POPUP_WIDTH: 'sync-popup-width',\n OPEN: 'open',\n MATCH_KEY: 'match-key',\n FILTER_TEXT: 'filter-text',\n DROPDOWN_ICON_OPEN: 'data-forge-dropdown-icon-open'\n};\n\nconst selectors = {\n INPUT: FIELD_CONSTANTS.selectors.INPUT,\n DROPDOWN_ICON: '[data-forge-dropdown-icon],[data-forge-dropdown-icon],[forge-dropdown-icon],.forge-dropdown-icon',\n CLEAR_BUTTON: '[data-forge-autocomplete-clear],[forge-autocomplete-clear]'\n};\n\nconst numbers = {\n DEFAULT_DEBOUNCE_TIME: KEYSTROKE_DEBOUNCE_THRESHOLD,\n NUM_SKELETON_ITEMS: 3\n};\n\nconst events = {\n CHANGE: `${elementName}-change`,\n SELECT: `${elementName}-select`,\n SCROLLED_BOTTOM: `${elementName}-scrolled-bottom`\n};\n\nexport const AUTOCOMPLETE_CONSTANTS = {\n elementName,\n attributes,\n selectors,\n numbers,\n events\n};\n\nexport type AutocompleteOptionBuilder<T = any> = (option: IAutocompleteOption<T>, filterText: string, parentElement: IListItemComponent) => HTMLElement;\nexport type AutocompleteOptionGroupBuilder<T = any> = ListDropdownOptionGroupBuilder<T>;\nexport type AutocompleteFilterCallback<T = any> = (filterText: string, value: T | null) => IAutocompleteOption<T>[] | IAutocompleteOptionGroup<T>[] | Promise<IAutocompleteOption<T>[] | IAutocompleteOptionGroup<T>[]>;\nexport type AutocompleteSelectedTextBuilder<T = any> = (selectedOptions: Array<IAutocompleteOption<T>>) => string;\n\nexport enum AutocompleteMode {\n Default = 'default',\n Stateless = 'stateless'\n}\n\nexport interface IAutocompleteOption<T = any> extends IListDropdownOption<T> {}\nexport interface IAutocompleteOptionGroup<T = any> extends IListDropdownOptionGroup<T> {}\n\nexport interface IAutocompletePopupConfiguration {\n filterText: string;\n popupTarget: string;\n dropdownConfig: IListDropdownConfig;\n popupClasses: string[];\n popupOffset: IPopupPosition;\n syncPopupWidth: boolean;\n listener: (value: string) => void;\n scrollEndListener: () => void;\n}\n\nexport interface IAutocompleteSelectEventData<T = any> {\n value: T;\n}\n\nexport interface IAutocompleteForceFilterOptions {\n preserveValue: boolean;\n}\n", "import { getShadowElement, deepQuerySelectorAll, getActiveElement, toggleAttribute } from '@tylertech/forge-core';\nimport { BaseAdapter, IBaseAdapter } from '../core/base/base-adapter';\nimport { IAutocompleteComponent } from './autocomplete';\nimport { AUTOCOMPLETE_CONSTANTS, IAutocompleteOption, IAutocompleteOptionGroup } from './autocomplete-constants';\nimport { TEXT_FIELD_CONSTANTS } from '../text-field';\nimport { IListDropdown, IListDropdownConfig, ListDropdown } from '../list-dropdown';\nimport { CHIP_FIELD_CONSTANTS } from '../chip-field';\nimport { IPopupComponent, POPUP_CONSTANTS } from '../popup';\nimport { setAriaControls, tryCreateAriaControlsPlaceholder } from '../core';\n\nexport interface IAutocompleteAdapter extends IBaseAdapter {\n readonly inputElement: HTMLInputElement;\n setInputElement(): HTMLInputElement;\n setInputAttribute(name: string, value: string): void;\n addInputListener(type: string, listener: (evt: Event) => void): void;\n removeInputListener(type: string, listener: (evt: Event) => void): void;\n initializeInputAccessibility(identifier: string): void;\n isWrappingChipField(): boolean;\n show(config: IListDropdownConfig, popupTarget: string): void;\n hide(listener: () => void): void;\n focus(): void;\n setOptions(options: IAutocompleteOption[] | IAutocompleteOptionGroup[]): void;\n appendOptions(options: IAutocompleteOption[] | IAutocompleteOptionGroup[]): void;\n setSelectedText(value: string): void;\n getInputValue(): string;\n setInputValue(value: string): void;\n selectInputValue(): void;\n setDismissListener(listener: () => void): void;\n isFocusWithinPopup(target: HTMLElement): boolean;\n hasFocus(): boolean;\n hasInputElement(): boolean;\n setDropdownIconListener(type: string, listener: EventListener): void;\n removeDropdownIconListener(type: string, listener: EventListener): void;\n setClearButtonListener(type: string, listener: EventListener): void;\n removeClearButtonListener(type: string, listener: EventListener): void;\n getPopupElement(): HTMLElement | null;\n propagateKey(key: string): void;\n updateActiveDescendant(id: string): void;\n getTargetElementWidth(selector: string): number;\n activateFirstOption(): void;\n activateSelectedOption(): void;\n activateOptionByIndex(value: number): void;\n setBusyVisibility(busy: boolean): void;\n getActiveOptionIndex(): number | null;\n clearActiveOption(): void;\n setSelectedOptions(options: IAutocompleteOption[]): void;\n queueDropdownPositionUpdate(): void;\n}\n\n/**\n * The DOM adapter for the `<forge-autocomplete>` element.\n */\nexport class AutocompleteAdapter extends BaseAdapter<IAutocompleteComponent> implements IAutocompleteAdapter {\n private _inputElement: HTMLInputElement;\n private _listDropdown?: IListDropdown;\n private _targetElement?: HTMLElement;\n \n constructor(component: IAutocompleteComponent) {\n super(component);\n this.setInputElement();\n }\n\n public get inputElement(): HTMLInputElement {\n return this._inputElement;\n }\n\n public setInputElement(): HTMLInputElement {\n const inputElements = deepQuerySelectorAll(this._component, AUTOCOMPLETE_CONSTANTS.selectors.INPUT, false);\n if (inputElements.length) {\n this._inputElement = inputElements[0] as HTMLInputElement;\n }\n return this._inputElement;\n }\n\n public setInputAttribute(name: string, value: string): void {\n this._inputElement.setAttribute(name, value);\n }\n\n public addInputListener(type: string, listener: (evt: Event) => void): void {\n this._inputElement.addEventListener(type, listener);\n }\n\n public removeInputListener(type: string, listener: (evt: Event) => void): void {\n this._inputElement.removeEventListener(type, listener);\n }\n\n public initializeInputAccessibility(identifier: string): void {\n this._inputElement.setAttribute('autocomplete', 'off');\n this._inputElement.setAttribute('role', 'combobox');\n this._inputElement.setAttribute('aria-live', 'polite');\n this._inputElement.setAttribute('aria-atomic', 'true');\n this._inputElement.setAttribute('aria-haspopup', 'true');\n this._inputElement.setAttribute('aria-expanded', 'false');\n this._inputElement.setAttribute('aria-autocomplete', 'list');\n tryCreateAriaControlsPlaceholder();\n setAriaControls(this._inputElement);\n }\n\n public isWrappingChipField(): boolean {\n return !!this._component.querySelector(CHIP_FIELD_CONSTANTS.elementName);\n }\n\n public show(config: IListDropdownConfig, popupTarget: string): void {\n this._targetElement = this._getTargetElement(popupTarget);\n if (!this._targetElement) {\n return;\n }\n this._listDropdown = new ListDropdown(this._targetElement, config);\n this._listDropdown.open();\n this._inputElement.setAttribute('aria-expanded', 'true');\n this._inputElement.setAttribute('aria-controls', `list-dropdown-popup-${config.id}`);\n this._tryToggleDropdownIconRotation(true);\n }\n\n public hide(listener: () => void): void {\n if (!this._listDropdown) {\n return;\n }\n const { targetElement } = this._listDropdown.dropdownElement as IPopupComponent;\n targetElement.removeEventListener(POPUP_CONSTANTS.events.BLUR, listener);\n this.setBusyVisibility(false);\n this._tryToggleDropdownIconRotation(false);\n this._inputElement.removeAttribute('aria-activedescendant');\n this._inputElement.removeAttribute('aria-controls');\n this._inputElement.setAttribute('aria-expanded', 'false');\n this._listDropdown.close();\n this._listDropdown = undefined;\n }\n\n\n public setBusyVisibility(isVisible: boolean): void {\n this._listDropdown?.setBusyVisibility(isVisible);\n }\n\n public setDismissListener(listener: () => void): void {\n if (!this._listDropdown || !this._listDropdown.dropdownElement) {\n return;\n }\n const dropdownElement = this._listDropdown.dropdownElement as IPopupComponent;\n if (dropdownElement.targetElement) {\n dropdownElement.targetElement.addEventListener(POPUP_CONSTANTS.events.BLUR, listener);\n }\n }\n\n public focus(): void {\n window.requestAnimationFrame(() => this._inputElement.focus());\n }\n\n public setOptions(options: IAutocompleteOption[] | IAutocompleteOptionGroup[]): void {\n this._listDropdown?.setOptions(options);\n }\n\n public appendOptions(options: IAutocompleteOption[] | IAutocompleteOptionGroup[]): void {\n this._listDropdown?.appendOptions(options);\n }\n\n public setSelectedText(value: string): void {\n this._inputElement.value = value;\n }\n\n public getInputValue(): string {\n return this._inputElement.value;\n }\n\n public setInputValue(value: string): void {\n this._inputElement.value = value;\n }\n\n public selectInputValue(): void {\n window.requestAnimationFrame(() => this._inputElement.select());\n }\n\n public isFocusWithinPopup(target: HTMLElement): boolean {\n if (!this._listDropdown || !this._listDropdown.dropdownElement) {\n return false;\n }\n return this._listDropdown.dropdownElement.contains(target);\n }\n\n public hasFocus(): boolean {\n const activeElement = getActiveElement(this._component.ownerDocument) as HTMLElement;\n return activeElement === this._inputElement || this.isFocusWithinPopup(activeElement);\n }\n\n public hasInputElement(): boolean {\n return !!this._inputElement;\n }\n\n public setDropdownIconListener(type: string, listener: EventListener): void {\n window.requestAnimationFrame(() => {\n const dropdownIcon = this._component.querySelector(AUTOCOMPLETE_CONSTANTS.selectors.DROPDOWN_ICON);\n if (dropdownIcon) {\n dropdownIcon.addEventListener(type, listener);\n }\n });\n }\n\n public removeDropdownIconListener(type: string, listener: EventListener): void {\n const dropdownIcon = this._component.querySelector(AUTOCOMPLETE_CONSTANTS.selectors.DROPDOWN_ICON);\n if (dropdownIcon) {\n dropdownIcon.removeEventListener(type, listener);\n }\n }\n\n public setClearButtonListener(type: string, listener: EventListener): void {\n window.requestAnimationFrame(() => {\n const clearButton = this._component.querySelector(AUTOCOMPLETE_CONSTANTS.selectors.CLEAR_BUTTON);\n if (clearButton) {\n clearButton.addEventListener(type, listener);\n }\n });\n }\n\n public removeClearButtonListener(type: string, listener: EventListener): void {\n const clearButton = this._component.querySelector(AUTOCOMPLETE_CONSTANTS.selectors.CLEAR_BUTTON);\n if (clearButton) {\n clearButton.removeEventListener(type, listener);\n }\n }\n\n public propagateKey(key: string): void {\n this._listDropdown?.handleKey(key);\n }\n\n public updateActiveDescendant(id: string): void {\n if (!this._targetElement) {\n return;\n }\n toggleAttribute(this._inputElement, !!id, 'aria-activedescendant', id);\n }\n\n public getTargetElementWidth(selector: string): number {\n if (!this._targetElement) {\n this._targetElement = this._getTargetElement(selector);\n }\n return this._targetElement.getBoundingClientRect().width;\n }\n\n public getPopupElement(): HTMLElement | null {\n return this._listDropdown?.dropdownElement ?? null;\n }\n\n public activateFirstOption(): void {\n this._listDropdown?.activateFirstOption();\n }\n\n public activateSelectedOption(): void {\n this._listDropdown?.activateSelectedOption();\n }\n\n public activateOptionByIndex(value: number): void {\n this._listDropdown?.activateOption(value);\n }\n\n public getActiveOptionIndex(): number | null {\n return this._listDropdown?.getActiveOptionIndex() ?? null;\n }\n\n public clearActiveOption(): void {\n this._listDropdown?.clearActiveOption();\n }\n\n public setSelectedOptions(options: IAutocompleteOption[]): void {\n if (this._listDropdown) {\n const values = options.map(o => o.value);\n this._listDropdown.setSelectedValues(values);\n }\n }\n\n public queueDropdownPositionUpdate(): void {\n if (!this.getPopupElement()) {\n return;\n }\n // We need to wait for the next animation frame to ensure that the layout has been updated\n window.requestAnimationFrame(() => {\n const dropdownEl = this.getPopupElement() as IPopupComponent | undefined;\n dropdownEl?.position();\n });\n }\n\n private _getTargetElement(selector?: string): HTMLElement {\n return selector ? this._component.querySelector(selector) || this._getDefaultTargetElement() : this._getDefaultTargetElement();\n }\n\n private _getDefaultTargetElement(): HTMLElement {\n // This component is often used with the text-field, if so, let's target our popup around one if its internal elements for proper alignnment\n const textField = this._component.querySelector('forge-text-field');\n if (textField && textField.shadowRoot) {\n const textFieldRoot = getShadowElement(textField, TEXT_FIELD_CONSTANTS.selectors.ROOT) as HTMLElement;\n if (textFieldRoot) {\n return textFieldRoot;\n }\n }\n\n // This component is often used with the chip-field, if so, let's target our popup around one if its internal elements for proper alignnment\n const chipField = this._component.querySelector('forge-chip-field');\n if (chipField && chipField.shadowRoot) {\n const chipFieldRoot = getShadowElement(chipField, CHIP_FIELD_CONSTANTS.selectors.ROOT) as HTMLElement;\n if (chipFieldRoot) {\n return chipFieldRoot;\n }\n }\n\n return this._component.querySelector('input') || this._component;\n }\n\n private _tryToggleDropdownIconRotation(state: boolean): void {\n const dropdownIcon = this._component.querySelector(AUTOCOMPLETE_CONSTANTS.selectors.DROPDOWN_ICON) as HTMLElement;\n if (dropdownIcon) {\n toggleAttribute(dropdownIcon, state, AUTOCOMPLETE_CONSTANTS.attributes.DROPDOWN_ICON_OPEN);\n }\n }\n}\n", "import { IAutocompleteOption, IAutocompleteOptionGroup } from './autocomplete-constants';\nimport { isDefined, isObject, isDeepEqual } from '@tylertech/forge-core';\n\n/** The available option types. */\nexport enum OptionType { Option, Group }\n\n/**\n * Determines if the provided options are of the specified type.\n * @param options The options either grouped or individual.\n * @param type The type of option to detect.\n */\nexport function isOptionType(options: IAutocompleteOption[] | IAutocompleteOptionGroup[], type: OptionType): boolean {\n const isOptionGroups = options.some((o: IAutocompleteOption | IAutocompleteOptionGroup) => isDefined(o) && isObject(o) && o.hasOwnProperty('options') && (o.hasOwnProperty('text') || o.hasOwnProperty('builder')));\n const isOptionTypes = options.some((o: IAutocompleteOption | IAutocompleteOptionGroup) => isDefined(o) && isObject(o) && o.hasOwnProperty('label') && o.hasOwnProperty('value'));\n return (isOptionGroups && type === OptionType.Group) || (isOptionTypes && type === OptionType.Option);\n}\n\n/** A utility function to find the matching option in the provided options by the value provided. */\nexport function getSelectedOption(options: IAutocompleteOption[], value: string): IAutocompleteOption | undefined {\n return options.find(o => o.value === value);\n}\n\n/** A predicate function that will determine if an option value is equal regardless of primitive type or complex object type. */\nexport function optionEqualPredicate(option: IAutocompleteOption, value: any, property: string | null = null): boolean {\n if (property) {\n if (!(property in option.value) || !(property in value)) {\n return false;\n }\n return isDeepEqual(option.value[property], value[property]);\n }\n return isDeepEqual(option.value, value);\n}\n", "import { debounce, isDefined, isString, Platform, randomChars } from '@tylertech/forge-core';\nimport { highlightTextHTML } from '../core';\nimport { IListItemComponent } from '../list';\nimport { IListDropdownConfig, IListDropdownOption, ListDropdownAsyncStyle, ListDropdownFooterBuilder, ListDropdownHeaderBuilder, ListDropdownOptionBuilder } from '../list-dropdown';\nimport { IListDropdownAwareFoundation, ListDropdownAwareFoundation } from '../list-dropdown/list-dropdown-aware-foundation';\nimport { IAutocompleteAdapter } from './autocomplete-adapter';\nimport { AutocompleteFilterCallback, AutocompleteMode, AutocompleteOptionBuilder, AutocompleteSelectedTextBuilder, AUTOCOMPLETE_CONSTANTS, IAutocompleteForceFilterOptions, IAutocompleteOption, IAutocompleteOptionGroup, IAutocompleteSelectEventData } from './autocomplete-constants';\nimport { getSelectedOption, isOptionType, optionEqualPredicate, OptionType } from './autocomplete-utils';\n\nexport interface IAutocompleteFoundation extends IListDropdownAwareFoundation {\n mode: AutocompleteMode;\n multiple: boolean;\n value: string | string[] | IAutocompleteOption | IAutocompleteOption[] | null | undefined;\n debounce: number;\n filterOnFocus: boolean;\n filterFocusFirst: boolean;\n allowUnmatched: boolean;\n popupTarget: string;\n filterText: string;\n optionBuilder: AutocompleteOptionBuilder | null | undefined;\n filter: AutocompleteFilterCallback | null | undefined;\n selectedTextBuilder: AutocompleteSelectedTextBuilder;\n isInitialized: boolean;\n open: boolean;\n matchKey: string | null | undefined;\n appendOptions(options: IAutocompleteOption[] | IAutocompleteOptionGroup[]): void;\n beforeValueChange: (value: any) => boolean | Promise<boolean>;\n forceFilter(opts: IAutocompleteForceFilterOptions): void;\n}\n\n/**\n * The foundation class behind the `<forge-autocomplete>` element.\n */\nexport class AutocompleteFoundation extends ListDropdownAwareFoundation implements IAutocompleteFoundation {\n private _isInitialized = false;\n private _isDropdownOpen = false;\n private _mode: AutocompleteMode = AutocompleteMode.Default;\n private _multiple = false;\n private _debounce = AUTOCOMPLETE_CONSTANTS.numbers.DEFAULT_DEBOUNCE_TIME;\n private _allowUnmatched = false;\n private _popupTarget: string;\n private _filterOnFocus = true;\n private _filterFocusFirst = true;\n private _optionBuilder?: AutocompleteOptionBuilder | null;\n private _filter?: AutocompleteFilterCallback | null;\n private _selectedTextBuilder: AutocompleteSelectedTextBuilder;\n private _options: IAutocompleteOption[] | IAutocompleteOptionGroup[] = [];\n private _filterText = '';\n private _selectedOptions: IAutocompleteOption[] = [];\n private _values: any[] = [];\n private _pendingFilterPromises: Array<Promise<IAutocompleteOption[] | IAutocompleteOptionGroup[]>> = [];\n private _identifier: string;\n private _matchKey?: string | null = null;\n private _filterFn: () => Promise<void>;\n private _clickListener: (evt: MouseEvent) => void;\n private _focusListener: (evt: FocusEvent) => void;\n private _blurListener: (evt: FocusEvent) => void;\n private _inputListener: (evt: KeyboardEvent) => void;\n private _keydownListener: (evt: KeyboardEvent) => void;\n private _dropdownIconClickListener: (evt: MouseEvent) => void;\n private _dropdownIconMouseDownListener: (evt: MouseEvent) => void;\n private _clearButtonListener: (evt: MouseEvent) => void;\n private _dropdownScrollEndListener: () => void;\n private _dismissListener: () => void;\n private _activeChangeListener: (id: string) => void;\n private _targetWidthCallback: () => number;\n private _beforeValueChange: (value: any) => boolean | Promise<boolean>;\n private _valueChanging: Promise<boolean> | undefined;\n\n constructor(private _adapter: IAutocompleteAdapter) {\n super();\n this._clickListener = evt => this._onClick(evt);\n this._focusListener = () => this._onFocus();\n this._blurListener = evt => this._onBlur(evt);\n this._keydownListener = evt => this._onKeydown(evt);\n this._dropdownIconClickListener = evt => this._onDropdownIconClick(evt);\n this._dropdownScrollEndListener = () => this._onDropdownScrollEnd();\n this._dropdownIconMouseDownListener = evt => this._onDropdownIconMouseDown(evt);\n this._clearButtonListener = evt => this._onClear(evt);\n this._dismissListener = () => this._onDismiss();\n this._activeChangeListener = id => this._adapter.updateActiveDescendant(id);\n this._targetWidthCallback = () => this._adapter.getTargetElementWidth(this._popupTarget);\n this._identifier = randomChars();\n }\n\n public async initialize(): Promise<void> {\n if (!this._adapter.hasInputElement() && !this._adapter.setInputElement()) {\n throw new Error('An input element is required as a child of the autocomplete component.');\n }\n\n this._setInputListener();\n this._setFilterCallback();\n this._attachListeners();\n this._initializeAccessibility();\n\n if (this._values.length) {\n if (!this._selectedOptions.length) {\n try {\n await this._executeFilter();\n } catch (e) {\n console.error(e);\n }\n this._updateSelectedOptions(this._values);\n }\n this._adapter.setSelectedText(this._getSelectedText());\n }\n\n this._isInitialized = true;\n }\n\n public disconnect(): void {\n if (this._isInitialized) {\n this._detachListeners();\n this._isInitialized = false;\n }\n if (this._isDropdownOpen) {\n this._closeDropdown();\n }\n }\n\n public async forceFilter({ preserveValue }: IAutocompleteForceFilterOptions): Promise<void> {\n // Clear any existing options since they are expected to no longer be valid\n this._options = [];\n\n // Execute the filter callback to fetch new options if the consumer has provided any.\n // This allows us to update the current value(s) with new label(s) if there are any matches\n await this._executeFilter(true, true);\n\n // Edge case, but if the consumer has a need to preserve the existing selection if it doesn't exist in the new options, this will support that\n if (preserveValue) {\n this._options.push(...this._selectedOptions as IAutocompleteOption<any>[] & IAutocompleteOptionGroup[]);\n }\n\n // This will update our current state, but it's expected that consumers will manage their own values so it's likely that this will be called again soon\n this._applyValue(this._values);\n }\n\n private _attachListeners(): void {\n this._adapter.addInputListener('click', this._clickListener);\n this._adapter.addInputListener('focus', this._focusListener);\n this._adapter.addInputListener('blur', this._blurListener);\n this._adapter.addInputListener('input', this._inputListener);\n this._adapter.addInputListener('keydown', this._keydownListener);\n this._adapter.setDropdownIconListener('click', this._dropdownIconClickListener);\n this._adapter.setDropdownIconListener('mousedown', this._dropdownIconMouseDownListener);\n this._adapter.setClearButtonListener('click', this._clearButtonListener);\n }\n\n private _detachListeners(): void {\n this._adapter.removeInputListener('click', this._clickListener);\n this._adapter.removeInputListener('focus', this._focusListener);\n this._adapter.removeInputListener('blur', this._blurListener);\n this._adapter.removeInputListener('input', this._inputListener);\n this._adapter.removeInputListener('keydown', this._keydownListener);\n this._adapter.removeDropdownIconListener('click', this._dropdownIconClickListener);\n this._adapter.removeDropdownIconListener('mousedown', this._dropdownIconMouseDownListener);\n this._adapter.removeClearButtonListener('click', this._clearButtonListener);\n }\n\n private _setInputListener(): void {\n this._inputListener = (evt: KeyboardEvent) => this._onInput(evt);\n }\n\n private _setFilterCallback(): void {\n this._filterFn = isDefined(this._debounce) && this._debounce > 0 ? debounce(this._debounceFilter, this._debounce, false) : this._debounceFilter;\n }\n\n private _initializeAccessibility(): void {\n this._adapter.initializeInputAccessibility(this._identifier);\n }\n\n private get _flatOptions(): IAutocompleteOption[] {\n if (isOptionType(this._options, OptionType.Group)) {\n return (this._options as IAutocompleteOptionGroup[]).reduce((previousValue, currentValue) => previousValue.concat(currentValue.options), [] as IAutocompleteOption[]);\n }\n return this._options as IAutocompleteOption[];\n }\n\n private _onClick(evt: MouseEvent): void {\n if (!this._isDropdownOpen && this._filterOnFocus) {\n this._showDropdown();\n }\n }\n\n private _onDropdownIconMouseDown(evt: MouseEvent): void {\n evt.preventDefault(); // Always avoid changing focus when clicking the dropdown\n }\n\n private _onDropdownIconClick(evt: MouseEvent): void {\n if (!this._isDropdownOpen) {\n this._adapter.focus();\n window.requestAnimationFrame(() => this._showDropdown());\n } else {\n this._closeDropdown();\n }\n }\n\n private _onClear(evt: MouseEvent): void {\n this._filterText = '';\n this._clearValue();\n this._adapter.setSelectedText(this._getSelectedText());\n }\n\n private _onDropdownScrollEnd(): void {\n this._adapter.emitHostEvent(AUTOCOMPLETE_CONSTANTS.events.SCROLLED_BOTTOM);\n }\n\n private _onFocus(): void {\n if (!this._isDropdownOpen && this._adapter.getInputValue() && !Platform.isMobile) {\n this._adapter.selectInputValue();\n }\n }\n\n private _onBlur(evt: FocusEvent): void {\n // If the blur event was triggered by an element within the popup then ignore it\n if (this._adapter.isFocusWithinPopup(evt.relatedTarget as HTMLElement)) {\n return;\n }\n\n this._applyBlur();\n }\n\n private _applyBlur(): void {\n if (this._isDropdownOpen) {\n this._closeDropdown();\n }\n\n // If we are in stateless mode, we don't need to do anything further\n if (this._mode === AutocompleteMode.Stateless) {\n return;\n }\n\n if (!this._selectedOptions.length) {\n if (!this._allowUnmatched) {\n this._filterText = '';\n this._adapter.setSelectedText('');\n }\n } else {\n this._adapter.setSelectedText(this._getSelectedText());\n }\n }\n\n private _onInput(evt: KeyboardEvent): void {\n if (this._selectedOptions.length && !this._multiple && (!this._adapter.getInputValue() || this._allowUnmatched) && !this._adapter.isWrappingChipField()) {\n this._selectedOptions = [];\n this._values = [];\n this._emitChangeEvent();\n }\n this._filterText = this._adapter.getInputValue();\n this._filterFn();\n }\n\n private async _debounceFilter({ checkFocus = true } = {}): Promise<void> {\n // There is the potential that the user could have started a filter, then moved focus to another element\n // while a debounced filter is running. This check detects that scenario and stops all pending filters.\n if (!checkFocus && !this._adapter.hasFocus()) {\n this._pendingFilterPromises = [];\n if (this._isDropdownOpen) {\n this._closeDropdown();\n }\n return;\n }\n\n // Keep track of these variables so we can use them when each filter callback completes\n const filterText = this._filterText; // Filter text just before the execution\n const filterPromise = this._executeFilter(); // Execute the filter and keep track of the filter promise object for use after it resolves\n\n // Keep track of all pending promises\n this._pendingFilterPromises.push(filterPromise);\n\n // If the dropdown is open, show the spinner and execute the filter. If not open, then we need to\n // show the dropdown (which will handle showing the spinner and executing the filter for us) so\n // we use the promise from that method instead.\n if (this._isDropdownOpen) {\n this._adapter.setBusyVisibility(true);\n } else {\n this._showDropdown({ filter: false });\n }\n\n try {\n await filterPromise;\n } catch {\n // When an exception occurs, we just flush the pending promises and clean up\n this._pendingFilterPromises = [];\n if (this._isDropdownOpen) {\n this._closeDropdown();\n }\n return;\n }\n\n // We only continue if the filter text before this result matches the latest filter text\n if (filterText === this._filterText) {\n this._pendingFilterPromises = [];\n this._onFilterComplete();\n } else {\n // If this is not the latest filter result, we ignore it and remove it from the pending promises\n const promiseIndex = this._pendingFilterPromises.indexOf(filterPromise);\n if (promiseIndex !== -1) {\n this._pendingFilterPromises.splice(promiseIndex, 1);\n }\n }\n }\n\n private _onKeydown(evt: KeyboardEvent): void {\n switch (evt.key) {\n case 'Tab':\n if (this._isDropdownOpen && !this._multiple) {\n this._selectActiveOption(false);\n }\n break;\n case 'Esc':\n case 'Escape':\n if (this._isDropdownOpen) {\n evt.preventDefault();\n evt.stopPropagation();\n this._closeDropdown();\n }\n break;\n case 'Down':\n case 'ArrowDown':\n evt.preventDefault();\n if (!this._isDropdownOpen) {\n this._showDropdown({ activateFirst: true, activateSelected: true });\n } else {\n this._adapter.propagateKey(evt.key);\n }\n break;\n case 'Up':\n case 'ArrowUp':\n evt.preventDefault();\n if (this._isDropdownOpen) {\n this._adapter.propagateKey(evt.key);\n }\n break;\n case 'Enter':\n case 'Home':\n case 'End':\n if (this._isDropdownOpen) {\n if (evt.key === 'Enter') {\n evt.stopPropagation();\n }\n evt.preventDefault();\n this._adapter.propagateKey(evt.key);\n }\n break;\n case 'Backspace':\n case 'Delete':\n const input = evt.target as HTMLInputElement;\n const value = this._adapter.getInputValue();\n const isRemovingAllChars = input.value.substring(input.selectionStart as number, input.selectionEnd as number) === input.value;\n const isBackspacingLastChar = value.length === 1 && input.selectionEnd === 1;\n const isDeletingLastChar = value.length === 1 && input.selectionEnd === 0;\n const isEmpty = !value || isRemovingAllChars || isBackspacingLastChar || isDeletingLastChar;\n \n // We only clear the value on empty when not around a chip-field and NOT in multiple mode\n if (!this._adapter.isWrappingChipField() && isEmpty && !this._multiple && this._values.length) {\n this._clearValue();\n }\n break;\n }\n }\n\n private _executeFilter(sendFilterText = true, sendValue = false): Promise<IAutocompleteOption[] | IAutocompleteOptionGroup[]> {\n if (!this._filter || typeof this._filter !== 'function') {\n throw new Error('A filter callback must be provided. Did you set the \"filter\" property?');\n }\n const filter = this._filter;\n\n const filterText = sendFilterText ? this._filterText : '';\n const value = sendValue ? this._getValue() : null;\n\n return new Promise<IAutocompleteOption[] | IAutocompleteOptionGroup[]>((resolve, reject) => {\n return Promise.resolve(filter(filterText, value))\n .then(options => {\n this._options = options;\n resolve(this._options);\n })\n .catch(e => reject(`An unexpected error occurred while filtering: ${e}`));\n });\n }\n\n private _onFilterComplete(): void {\n if (!this._adapter.hasFocus()) {\n if (this._isDropdownOpen) {\n this._closeDropdown();\n }\n return;\n }\n\n if (this._options.length) {\n const sendFilterText = this._allowUnmatched && !this._selectedOptions.length;\n this._dropdownReady({ userTriggered: sendFilterText });\n\n if (this._filterFocusFirst && this._filterText) {\n this._adapter.activateFirstOption();\n }\n } else {\n this._closeDropdown();\n }\n }\n\n private _clearValue(): void {\n this._selectedOptions = [];\n this._values = [];\n\n if (this._isDropdownOpen) {\n this._adapter.setSelectedOptions([]);\n this._adapter.clearActiveOption();\n }\n\n this._emitChangeEvent();\n }\n\n private async _showDropdown({ filter = true, userTriggered = true, activateFirst = false, activateSelected = false } = {}): Promise<void> {\n const sendFilterText = this._allowUnmatched && !this._selectedOptions.length;\n this._isDropdownOpen = true;\n let listOptionBuilder: ListDropdownOptionBuilder<HTMLElement> | undefined;\n if (this._optionBuilder) {\n const optionBuilder = this._optionBuilder;\n listOptionBuilder = (option: IListDropdownOption, parentElement: HTMLElement) => {\n return optionBuilder(option, this._filterText, parentElement as IListItemComponent);\n };\n }\n const config: IListDropdownConfig = {\n options: this._options,\n referenceElement: this._adapter.inputElement,\n multiple: this._multiple,\n selectedValues: [...this._values],\n id: `forge-autocomplete-${this._identifier}`,\n asyncStyle: ListDropdownAsyncStyle.Skeleton,\n optionLimit: this._optionLimit,\n popupClasses: this._popupClasses,\n headerBuilder: this._popupHeaderBuilder,\n footerBuilder: this._popupFooterBuilder,\n transform: label => {\n if (this._filterText) {\n // Highlight the filter text within the label\n const highlightElement = highlightTextHTML(label, this._filterText);\n if (highlightElement) {\n return highlightElement;\n }\n }\n return label;\n },\n allowBusy: true,\n optionBuilder: listOptionBuilder,\n syncWidth: this._syncPopupWidth,\n observeScroll: this._observeScroll,\n observeScrollThreshold: this._observeScrollThreshold,\n scrollEndListener: this._dropdownScrollEndListener,\n activeChangeCallback: this._activeChangeListener,\n targetWidthCallback: this._targetWidthCallback,\n selectCallback: (value: any) => this._onSelect(value),\n closeCallback: () => this._closeDropdown()\n };\n\n this._adapter.show(config, this._popupTarget);\n this._adapter.toggleHostAttribute(AUTOCOMPLETE_CONSTANTS.attributes.OPEN, this._isDropdownOpen);\n\n if (filter) {\n if (this._options.length) {\n this._adapter.setBusyVisibility(true);\n }\n try {\n await this._executeFilter(sendFilterText);\n } catch (e) {\n console.error(e);\n }\n this._updateSelectedOptions(this._values);\n }\n\n // If we have any pending filter promises, then we will let those complete and update the dropdown separately after\n if (this._pendingFilterPromises.length) {\n return;\n }\n\n this._dropdownReady({ userTriggered, activateFirst, activateSelected });\n }\n\n private _dropdownReady({ userTriggered = true, activateFirst = false, activateSelected = false } = {}): void {\n if (!this._isDropdownOpen || !this._options.length || (userTriggered && !this._adapter.hasFocus())) {\n this._closeDropdown();\n return;\n }\n\n this._sortSelectedOptions();\n this._adapter.setBusyVisibility(false);\n this._adapter.setOptions(this._options);\n this._adapter.setSelectedOptions(this._selectedOptions);\n this._adapter.setDismissListener(this._dismissListener);\n\n if (activateSelected && this._selectedOptions.length) {\n this._adapter.activateSelectedOption();\n } else if (activateFirst) {\n this._adapter.activateFirstOption();\n }\n }\n\n private _closeDropdown(): void {\n if (this._multiple) {\n this._filterText = '';\n }\n this._isDropdownOpen = false;\n this._adapter.hide(this._dismissListener);\n this._sortSelectedOptions();\n this._adapter.toggleHostAttribute(AUTOCOMPLETE_CONSTANTS.attributes.OPEN, this._isDropdownOpen);\n }\n\n private _sortSelectedOptions(): void {\n // When in multiple selection mode, we need to make sure that the selected options appear at the top of the list\n if (this._multiple && this._selectedOptions.length && isOptionType(this._options, OptionType.Option)) {\n const selectedOptions: IAutocompleteOption[] = [];\n const unselectedOptions: IAutocompleteOption[] = [];\n\n (this._options as IAutocompleteOption[]).forEach(option => {\n if (this._selectedOptions.find(o => optionEqualPredicate(o, option.value, this._matchKey))) {\n selectedOptions.push(option);\n } else {\n unselectedOptions.push(option);\n }\n });\n\n this._options = [...selectedOptions, ...unselectedOptions];\n }\n }\n\n /**\n * Handles selecting an item in the dropdown.\n * @param {string} selectedValue The string value to select.\n */\n private async _onSelect(selectedValue: string, keepFocus = true): Promise<void> {\n if (this._valueChanging) {\n return;\n }\n\n // If we are in stateless mode, then we need to just emit an event when selecting an option. The\n // selected values are not tracked in stateless mode\n if (this._mode === AutocompleteMode.Stateless) {\n const data: IAutocompleteSelectEventData = { value: selectedValue };\n const result = this._adapter.emitHostEvent(AUTOCOMPLETE_CONSTANTS.events.SELECT, data, true, true);\n if (result) {\n this._filterText = '';\n if (!this._multiple) {\n this._closeDropdown();\n }\n }\n return;\n }\n\n const select = (): void => {\n const flatOptions = this._flatOptions;\n const option = flatOptions.find(o => optionEqualPredicate(o, selectedValue, this._matchKey)) as IAutocompleteOption;\n const value = option ? option.value : '';\n const label = option ? option.label : '';\n\n if (this._multiple) {\n const selectedOption = getSelectedOption(this._selectedOptions, value);\n if (selectedOption) {\n const index = this._selectedOptions.indexOf(selectedOption);\n this._selectedOptions.splice(index, 1);\n } else {\n this._selectedOptions.push(option);\n }\n } else {\n if (isDefined(value)) {\n this._selectedOptions[0] = option;\n this._filterText = label;\n } else {\n this._selectedOptions = [];\n this._filterText = '';\n }\n }\n\n // Update the dropdown selection status if its open\n if (this._isDropdownOpen) {\n this._adapter.setSelectedOptions(this._selectedOptions);\n }\n\n // Keep the values in sync with the currently selected options\n this._values = this._selectedOptions.map(o => o.value);\n\n // Update the selected text in the input\n this._adapter.setSelectedText(this._getSelectedText());\n\n // Select the text in the input to allow for the next filter\n if (!Platform.isMobile && keepFocus) {\n this._adapter.selectInputValue();\n }\n\n this._emitChangeEvent();\n this._tryUpdateDropdownPosition();\n };\n\n // We close the dropdown immediately if in single selection mode\n if (this._isDropdownOpen && !this._multiple) {\n this._closeDropdown();\n }\n\n if (typeof this._beforeValueChange === 'function') {\n this._valueChanging = Promise.resolve(this._beforeValueChange.call(null, selectedValue, this._matchKey));\n const shouldContinue = await this._valueChanging;\n if (shouldContinue) {\n select();\n } else {\n this._tryUpdateDropdownPosition();\n }\n this._valueChanging = undefined;\n } else {\n select();\n }\n }\n\n private _selectActiveOption(keepFocus = true): void {\n const activeOptionIndex = this._adapter.getActiveOptionIndex();\n if (typeof activeOptionIndex === 'number' && activeOptionIndex >= 0) {\n const option = this._flatOptions[activeOptionIndex];\n if (option) {\n this._onSelect(option.value, keepFocus);\n }\n }\n }\n\n private _emitChangeEvent(): void {\n this._adapter.emitHostEvent(AUTOCOMPLETE_CONSTANTS.events.CHANGE, this._getValue(), true);\n }\n\n private _tryUpdateDropdownPosition(): void {\n if (this._isDropdownOpen) {\n this._adapter.queueDropdownPositionUpdate();\n }\n }\n\n /**\n * Retrieves the current value(s) from the selected options array based on whether\n * we are in multi-select mode or not.\n */\n private _getValue(): string | string[] | null | undefined {\n if (!this._values) {\n return null;\n }\n\n if (!this._values.length) {\n return this._multiple ? [] : null;\n }\n\n return this._multiple ? [...this._values] : this._values[0];\n }\n\n /**\n * Creates the selected text value from the selected label values.\n */\n private _getSelectedText(): string {\n if (this._adapter.isWrappingChipField()) {\n return '';\n }\n\n if (this._selectedTextBuilder) {\n return this._selectedTextBuilder(this._selectedOptions);\n } else {\n if (this._multiple) {\n if (this._values.length) {\n if (this._values.length === 1) {\n return this._selectedOptions[0]?.label ?? '';\n } else {\n return `${this._values.length} options selected`;\n }\n } else {\n return '';\n }\n } else {\n return this._selectedOptions.filter(o => o && o.label).map(o => o.label).join(' ').trim();\n }\n }\n }\n\n /**\n * Handles the user dismissing the dropdown. This is only called if the blur event was triggered\n * from within the popup element itself (in a custom template most likely).\n * @param keepFocus Keep focus on the dropdown or not.\n */\n private _onDismiss(): void {\n this._closeDropdown();\n }\n\n private async _applyValue(value: string | string[] | IAutocompleteOption | IAutocompleteOption[] | null | undefined): Promise<void> {\n let values: any[] = [];\n this._selectedOptions = [];\n\n if (!Array.isArray(value)) {\n values = isDefined(value) ? [value] : [];\n } else {\n values = value;\n }\n\n // If this is not a multi-select, then make sure we only allow one selected value\n if (!this._multiple && values.length > 1) {\n values = [values[0]];\n }\n\n if (isOptionType(values, OptionType.Option)) {\n this._values = values.map((o: IAutocompleteOption) => o.value);\n this._selectedOptions = values as IAutocompleteOption[];\n } else {\n this._values = values as any[];\n }\n\n // Ensure that the values passed are actually existing options\n const allOptions = this._flatOptions;\n if (values.length && allOptions.length) {\n this._updateSelectedOptions(values);\n }\n\n // Execute the filter now if we have a value, but not options yet (only if it has been initialized already)\n if (this._values.length && !this._selectedOptions.length && !!this._filter && this._isInitialized) {\n try {\n await this._executeFilter(false, true);\n } catch (e) {\n console.error(e);\n }\n this._updateSelectedOptions(this._values);\n }\n\n // Update filter text to match the label when on in multiselect mode\n if (!this._multiple) {\n this._filterText = this._selectedOptions.length ? this._selectedOptions[0].label : '';\n } else {\n this._filterText = '';\n }\n\n // Update the state of the component based on the existence of a selected value\n if (this._isInitialized) {\n this._adapter.setSelectedText(this._getSelectedText());\n }\n\n // When the value is changed programmatically we should update the selected options\n if (this._isDropdownOpen) {\n this._adapter.setSelectedOptions(this._selectedOptions);\n }\n }\n\n private _updateSelectedOptions(values: Array<any | IAutocompleteOption>): void {\n const flatOptions = [...this._flatOptions, ...this._selectedOptions];\n\n if (this._selectedOptions.length) {\n this._selectedOptions = [];\n }\n\n if (isOptionType(values, OptionType.Option)) {\n for (const option of values as IAutocompleteOption[]) {\n const actualOption = flatOptions.find(o => optionEqualPredicate(o, option.value, this._matchKey));\n if (actualOption) {\n this._selectedOptions.push(actualOption);\n } else {\n this._selectedOptions.push(option);\n }\n }\n } else {\n for (const value of values as any[]) {\n const actualOption = flatOptions.find(o => optionEqualPredicate(o, value, this._matchKey));\n if (actualOption) {\n this._selectedOptions.push(actualOption);\n } else if (this._allowUnmatched) {\n this._selectedOptions.push({ label: value, value });\n }\n }\n }\n }\n\n /** Gets/sets the mode state. */\n public get mode(): AutocompleteMode {\n return this._mode;\n }\n public set mode(value: AutocompleteMode) {\n if (this._mode !== value) {\n this._mode = value;\n if (this._mode === AutocompleteMode.Stateless) {\n this._selectedOptions = [];\n if (this._isDropdownOpen) {\n this._closeDropdown();\n }\n }\n this._adapter.setHostAttribute(AUTOCOMPLETE_CONSTANTS.attributes.MODE, this._mode);\n }\n }\n\n /** Gets/sets the multi-select state. */\n public get multiple(): boolean {\n return this._multiple;\n }\n public set multiple(value: boolean) {\n if (this._multiple !== value) {\n this._multiple = value;\n this._adapter.setHostAttribute(AUTOCOMPLETE_CONSTANTS.attributes.MULTIPLE, isDefined(this._multiple) ? this._multiple.toString() : '');\n }\n }\n\n /** Gets/sets the value of the component. */\n public get value(): string | string[] | IAutocompleteOption | IAutocompleteOption[] | null | undefined {\n return this._getValue();\n }\n public set value(value: string | string[] | IAutocompleteOption | IAutocompleteOption[] | null | undefined) {\n let values: Array<string | IAutocompleteOption | IAutocompleteOption[] | string[]> = [];\n\n if (value == null) {\n values = [];\n } else if (Array.isArray(value)) {\n values = structuredClone(value);\n } else if (isString(value)) {\n values = [value];\n } else {\n values = [structuredClone(value)];\n }\n\n const hasNewValue = values.length !== this._values.length || values.some(v => !this._values.includes(v));\n if (!hasNewValue) {\n return;\n }\n\n // We only apply the new values if they have actually changed\n this._applyValue(value);\n }\n\n /** Gets/sets filter on focus settings which controls whether the dropdown displays automatically when focused. */\n public get filterOnFocus(): boolean {\n return this._filterOnFocus;\n }\n public set filterOnFocus(value: boolean) {\n if (this._filterOnFocus !== value) {\n this._filterOnFocus = value;\n this._adapter.setHostAttribute(AUTOCOMPLETE_CONSTANTS.attributes.FILTER_ON_FOCUS, isDefined(this._filterOnFocus) ? this._filterOnFocus.toString() : '');\n }\n }\n\n /** Gets/sets whether the first option in the dropdown will be focused automatically when opened or not. */\n public get filterFocusFirst(): boolean {\n return this._filterFocusFirst;\n }\n public set filterFocusFirst(value: boolean) {\n if (this._filterFocusFirst !== value) {\n this._filterFocusFirst = value;\n this._adapter.toggleHostAttribute(AUTOCOMPLETE_CONSTANTS.attributes.FILTER_FOCUS_FIRST, this._filterFocusFirst);\n }\n }\n\n /** Controls whether unmatched text entered by the user will stay visible an option in the dropdown is not found. */\n public get allowUnmatched(): boolean {\n return this._allowUnmatched;\n }\n public set allowUnmatched(value: boolean) {\n if (this._allowUnmatched !== value) {\n this._allowUnmatched = value;\n\n if (isDefined(this._allowUnmatched)) {\n this._adapter.setHostAttribute(AUTOCOMPLETE_CONSTANTS.attributes.ALLOW_UNMATCHED, this._allowUnmatched.toString());\n }\n }\n }\n\n /** Gets/sets the property key to match the value to an option. */\n public get matchKey(): string | null | undefined {\n return this._matchKey;\n }\n public set matchKey(value: string | null | undefined) {\n if (this._matchKey !== value) {\n this._matchKey = value;\n }\n }\n\n /** Gets/sets the selector that will be used to find an element to attach the popup to. Defaults to the input element. */\n public get popupTarget(): string {\n return this._popupTarget;\n }\n public set popupTarget(value: string) {\n if (this._popupTarget !== value) {\n this._popupTarget = value;\n }\n }\n\n /**\n * Gets/sets the filter text.\n * \n * Setting the filter text only applies when allowUnmatched is enabled.\n */\n public get filterText(): string {\n return this._filterText;\n }\n public set filterText(value: string) {\n if (this._filterText !== value) {\n this._filterText = this._allowUnmatched ? value : '';\n\n if (this._isInitialized && this._allowUnmatched) {\n this._adapter.setInputValue(this._filterText);\n\n if (this._isDropdownOpen) {\n this._debounceFilter({ checkFocus: false });\n }\n }\n }\n }\n\n /** Gets/sets the list of classes to apply to the popup element. */\n public get popupClasses(): string | string[] {\n return Array.isArray(this._popupClasses) ? [...this._popupClasses] : [this._popupClasses];\n }\n public set popupClasses(value: string | string[]) {\n if (this._popupClasses !== value) {\n this._popupClasses = Array.isArray(value) ? [...value] : [value];\n }\n }\n\n /** Gets/sets the builder callback to use for the popup header. */\n public set popupHeaderBuilder(value: ListDropdownHeaderBuilder) {\n this._popupHeaderBuilder = value;\n }\n\n /** Gets/sets the builder callback to use for the popup footer. */\n public set popupFooterBuilder(value: ListDropdownFooterBuilder) {\n this._popupFooterBuilder = value;\n }\n\n /** Gets/sets whether the popup width is synchronized with the popup target. */\n public get syncPopupWidth(): boolean {\n return this._syncPopupWidth;\n }\n public set syncPopupWidth(value: boolean) {\n if (this._syncPopupWidth !== value) {\n this._syncPopupWidth = value;\n }\n }\n\n /** Gets/sets the maximum number of options to display in the dropdown. */\n public get optionLimit(): number {\n return this._optionLimit;\n }\n public set optionLimit(value: number) {\n if (this._optionLimit !== value) {\n this._optionLimit = value;\n }\n }\n\n /** Gets/sets the debounce delay (milliseconds) for keyboard events. */\n public get debounce(): number {\n return this._debounce;\n }\n public set debounce(value: number) {\n if (this._debounce !== value) {\n this._debounce = value;\n\n if (this._isInitialized) {\n this._setFilterCallback();\n }\n\n this._adapter.setHostAttribute(AUTOCOMPLETE_CONSTANTS.attributes.DEBOUNCE, isDefined(this._debounce) ? this._debounce.toString() : '');\n }\n }\n\n /** Sets the item builder callback that will be executed when building the option list in the dropdown. */\n public get optionBuilder(): AutocompleteOptionBuilder | null | undefined {\n return this._optionBuilder;\n }\n public set optionBuilder(fn: AutocompleteOptionBuilder | null | undefined) {\n this._optionBuilder = fn;\n }\n\n /** Sets the filter callback that will be executed when fetching options for the autocomplete dropdown. */\n public get filter(): AutocompleteFilterCallback | null | undefined {\n return this._filter;\n }\n public set filter(cb: AutocompleteFilterCallback | null | undefined) {\n if (this._filter !== cb) {\n this._filter = cb;\n\n // If we have a value, but don't have any options yet then execute the filter\n if (this._isInitialized && this._values.length && !this._flatOptions.length && !!this._filter) {\n this._executeFilter().then(() => {\n this._updateSelectedOptions(this._values);\n this._adapter.setSelectedText(this._getSelectedText());\n });\n }\n }\n }\n\n /** Sets the selected text builder callback that will be executed when getting the selected text. */\n public get selectedTextBuilder(): AutocompleteSelectedTextBuilder {\n return this._selectedTextBuilder;\n }\n public set selectedTextBuilder(fn: AutocompleteSelectedTextBuilder) {\n this._selectedTextBuilder = fn;\n\n // If there are selected options, set the selected text again\n if (this._selectedOptions.length) {\n this._adapter.setSelectedText(this._getSelectedText());\n }\n }\n\n public get observeScroll(): boolean {\n return this._observeScroll;\n }\n public set observeScroll(value: boolean) {\n this._observeScroll = value;\n }\n\n public get observeScrollThreshold(): number {\n return this._observeScrollThreshold;\n }\n public set observeScrollThreshold(value: number) {\n this._observeScrollThreshold = value;\n }\n\n public appendOptions(options: IAutocompleteOption[] | IAutocompleteOptionGroup[]): void {\n if (!this._isDropdownOpen) {\n return;\n }\n this._options = [...this._options, ...options] as IAutocompleteOption[] | IAutocompleteOptionGroup[];\n this._adapter.appendOptions(options);\n }\n\n public get isInitialized(): boolean {\n return this._isInitialized;\n }\n\n public get open(): boolean {\n return this._isDropdownOpen;\n }\n public set open(value: boolean) {\n if (this._isDropdownOpen !== value) {\n if (value) {\n this._showDropdown({ userTriggered: false });\n } else {\n this._closeDropdown();\n }\n }\n }\n\n public get beforeValueChange(): (value: any) => boolean | Promise<boolean> {\n return this._beforeValueChange;\n }\n public set beforeValueChange(value: (value: any) => boolean | Promise<boolean>) {\n if (value !== this._beforeValueChange) {\n this._beforeValueChange = value;\n }\n }\n\n public get popupElement(): HTMLElement | null {\n return this._adapter.getPopupElement();\n }\n}\n", "import { attachShadowTemplate, coerceBoolean, coerceNumber, CustomElement, ensureChild, FoundationProperty } from '@tylertech/forge-core';\nimport { tylIconArrowDropDown, tylIconCheckBox, tylIconCheckBoxOutlineBlank } from '@tylertech/tyler-icons/standard';\nimport { DividerComponent } from '../divider';\nimport { IconComponent, IconRegistry } from '../icon';\nimport { LinearProgressComponent } from '../linear-progress';\nimport { ListComponent, ListItemComponent } from '../list';\nimport { IListDropdownAware, ListDropdownAware } from '../list-dropdown/list-dropdown-aware';\nimport { PopupComponent } from '../popup';\nimport { SkeletonComponent } from '../skeleton';\nimport { TextFieldComponent } from '../text-field';\nimport { AutocompleteAdapter } from './autocomplete-adapter';\nimport { AutocompleteFilterCallback, AutocompleteMode, AutocompleteOptionBuilder, AutocompleteSelectedTextBuilder, AUTOCOMPLETE_CONSTANTS, IAutocompleteForceFilterOptions, IAutocompleteOption, IAutocompleteOptionGroup, IAutocompleteSelectEventData } from './autocomplete-constants';\nimport { AutocompleteFoundation } from './autocomplete-foundation';\n\nconst template = '<template><slot></slot></template>';\nconst styles = ':host{display:block}:host([hidden]){display:none}';\n\nexport interface IAutocompleteComponent extends IListDropdownAware {\n mode: `${AutocompleteMode}`;\n multiple: boolean;\n value: any;\n debounce: number;\n filterOnFocus: boolean;\n filterFocusFirst: boolean;\n allowUnmatched: boolean;\n matchKey: string | null | undefined;\n popupTarget: string;\n filterText: string;\n filter: AutocompleteFilterCallback | null | undefined;\n optionBuilder: AutocompleteOptionBuilder | null | undefined;\n selectedTextBuilder: AutocompleteSelectedTextBuilder;\n popupElement: HTMLElement | null;\n beforeValueChange: (value: any) => boolean | Promise<boolean>;\n isInitialized: boolean;\n open: boolean;\n appendOptions(options: IAutocompleteOption[] | IAutocompleteOptionGroup[]): void;\n openDropdown(): void;\n closeDropdown(): void;\n forceFilter(opts?: IAutocompleteForceFilterOptions): void;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-autocomplete': IAutocompleteComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-autocomplete-change': CustomEvent<any>;\n 'forge-autocomplete-select': CustomEvent<IAutocompleteSelectEventData>;\n 'forge-autocomplete-scrolled-bottom': CustomEvent<void>;\n }\n}\n\n/**\n * The custom element class behind the `<forge-autocomplete>` element.\n * \n * @tag forge-autocomplete\n */\n@CustomElement({\n name: AUTOCOMPLETE_CONSTANTS.elementName,\n dependencies: [\n TextFieldComponent,\n PopupComponent,\n ListComponent,\n ListItemComponent,\n DividerComponent,\n SkeletonComponent,\n LinearProgressComponent,\n IconComponent\n ]\n})\nexport class AutocompleteComponent extends ListDropdownAware implements IAutocompleteComponent {\n public static get observedAttributes(): string[] {\n return [\n AUTOCOMPLETE_CONSTANTS.attributes.MODE,\n AUTOCOMPLETE_CONSTANTS.attributes.MULTIPLE,\n AUTOCOMPLETE_CONSTANTS.attributes.DEBOUNCE,\n AUTOCOMPLETE_CONSTANTS.attributes.FILTER_ON_FOCUS,\n AUTOCOMPLETE_CONSTANTS.attributes.FILTER_FOCUS_FIRST,\n AUTOCOMPLETE_CONSTANTS.attributes.ALLOW_UNMATCHED,\n AUTOCOMPLETE_CONSTANTS.attributes.POPUP_TARGET,\n AUTOCOMPLETE_CONSTANTS.attributes.POPUP_CLASSES,\n AUTOCOMPLETE_CONSTANTS.attributes.OBSERVE_SCROLL,\n AUTOCOMPLETE_CONSTANTS.attributes.OBSERVE_SCROLL_THRESHOLD,\n AUTOCOMPLETE_CONSTANTS.attributes.OPTION_LIMIT,\n AUTOCOMPLETE_CONSTANTS.attributes.SYNC_POPUP_WIDTH,\n AUTOCOMPLETE_CONSTANTS.attributes.OPEN,\n AUTOCOMPLETE_CONSTANTS.attributes.MATCH_KEY,\n AUTOCOMPLETE_CONSTANTS.attributes.FILTER_TEXT\n ];\n }\n\n private _foundation: AutocompleteFoundation;\n\n constructor() {\n super();\n IconRegistry.define([tylIconArrowDropDown, tylIconCheckBox, tylIconCheckBoxOutlineBlank]);\n attachShadowTemplate(this, template, styles);\n this._foundation = new AutocompleteFoundation(new AutocompleteAdapter(this));\n }\n\n public connectedCallback(): void {\n if (this.querySelector(AUTOCOMPLETE_CONSTANTS.selectors.INPUT)) {\n this._foundation.initialize();\n } else {\n ensureChild(this, AUTOCOMPLETE_CONSTANTS.selectors.INPUT).then(() => this._foundation.initialize());\n }\n }\n\n public disconnectedCallback(): void {\n this._foundation.disconnect();\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n super.attributeChangedCallback(name, oldValue, newValue);\n switch (name) {\n case AUTOCOMPLETE_CONSTANTS.attributes.MODE:\n this.mode = newValue as AutocompleteMode;\n break;\n case AUTOCOMPLETE_CONSTANTS.attributes.MULTIPLE:\n this.multiple = coerceBoolean(newValue);\n break;\n case AUTOCOMPLETE_CONSTANTS.attributes.DEBOUNCE:\n this.debounce = coerceNumber(newValue);\n break;\n case AUTOCOMPLETE_CONSTANTS.attributes.FILTER_ON_FOCUS:\n this.filterOnFocus = coerceBoolean(newValue);\n break;\n case AUTOCOMPLETE_CONSTANTS.attributes.FILTER_FOCUS_FIRST:\n this.filterFocusFirst = coerceBoolean(newValue);\n break;\n case AUTOCOMPLETE_CONSTANTS.attributes.ALLOW_UNMATCHED:\n this.allowUnmatched = coerceBoolean(newValue);\n break;\n case AUTOCOMPLETE_CONSTANTS.attributes.POPUP_TARGET:\n this.popupTarget = newValue;\n break;\n case AUTOCOMPLETE_CONSTANTS.attributes.OPEN:\n this.open = coerceBoolean(newValue);\n break;\n case AUTOCOMPLETE_CONSTANTS.attributes.MATCH_KEY:\n this.matchKey = newValue;\n break;\n case AUTOCOMPLETE_CONSTANTS.attributes.FILTER_TEXT:\n this.filterText = newValue;\n break;\n }\n }\n\n /** Gets/sets the interaction mode. */\n @FoundationProperty()\n public declare mode: `${AutocompleteMode}`;\n\n /** Gets/sets the multi-select state. */\n @FoundationProperty()\n public declare multiple: boolean;\n\n /** Gets/sets the value. */\n @FoundationProperty()\n public declare value: any;\n\n /** Gets/sets the debounce delay (milliseconds) for keyboard events. */\n @FoundationProperty()\n public declare debounce: number;\n\n /** Gets/sets filter on focus settings which controls whether the dropdown displays automatically when focused. */\n @FoundationProperty()\n public declare filterOnFocus: boolean;\n\n /** Gets/sets whether the first option in the dropdown will be focused automatically when opened or not. */\n @FoundationProperty()\n public declare filterFocusFirst: boolean;\n\n /** Controls whether unmatched text entered by the user will stay visible an option in the dropdown is not found. */\n @FoundationProperty()\n public declare allowUnmatched: boolean;\n\n /** Gets/sets the selector that will be used to find an element to attach the popup to. Defaults to the input element. */\n @FoundationProperty()\n public declare popupTarget: string;\n\n /**\n * Gets/sets the filter text.\n * \n * Setting the filter text only applies when allowUnmatched is enabled.\n */\n @FoundationProperty()\n public declare filterText: string;\n\n /** Sets the option builder callback that will be executed when building the option list in the dropdown. */\n @FoundationProperty()\n public declare optionBuilder: AutocompleteOptionBuilder | null | undefined;\n\n /** Sets the filter callback that will be executed when fetching options for the autocomplete dropdown. */\n @FoundationProperty()\n public declare filter: AutocompleteFilterCallback | null | undefined;\n\n /** Sets the selected text builder callback that will be executed when getting the selected text. */\n @FoundationProperty()\n public declare selectedTextBuilder: AutocompleteSelectedTextBuilder;\n\n /** Controls the open state of the dropdown. */\n @FoundationProperty()\n public declare open: boolean;\n\n /** Gets/sets the property key to match the value to an option. */\n @FoundationProperty()\n public declare matchKey: string | null | undefined;\n\n /**\n * Returns whether the component has been initialized or not yet.\n * @readonly\n */\n @FoundationProperty({ set: false })\n public declare isInitialized: boolean;\n\n /**\n * Gets the currently active popup element when the dropdown is open.\n * @readonly\n */\n @FoundationProperty({ set: false })\n public declare popupElement: HTMLElement | null;\n\n /** Sets the callback to be executed when the user selects an option, before the UI is updated to allow for validation. */\n @FoundationProperty()\n public declare beforeValueChange: (value: any) => boolean | Promise<boolean>;\n\n /** Adds options to the dropdown while it is open. Has no effect if the dropdown is closed. */\n public appendOptions(options: IAutocompleteOption[] | IAutocompleteOptionGroup[]): void {\n this._foundation.appendOptions(options);\n }\n\n /** Opens the dropdown. */\n public openDropdown(): void {\n this.open = true;\n }\n\n /** Closes the dropdown. */\n public closeDropdown(): void {\n this.open = false;\n }\n\n /**\n * Forces the filter callback to be executed to update the current selection state with new options.\n * @param opts\n */\n public forceFilter(opts: IAutocompleteForceFilterOptions = { preserveValue: false }): void {\n this._foundation.forceFilter(opts);\n }\n}\n", "import { FormFieldComponentDelegate, IFormFieldComponentDelegateOptions } from '../core/delegates/form-field-component-delegate';\nimport { ITextFieldComponent, TextFieldComponentDelegate, ITextFieldComponentDelegateOptions } from '../text-field';\nimport { IAutocompleteComponent } from './autocomplete';\nimport { AUTOCOMPLETE_CONSTANTS } from './autocomplete-constants';\nimport { IconComponentDelegate, IIconComponentDelegateConfig } from '../icon';\nimport { IBaseComponentDelegateConfig } from '../core/delegates/base-component-delegate';\nimport { ITextFieldComponentDelegateConfig } from '../text-field/text-field-component-delegate';\n\nexport type AutocompleteComponentDelegateProps = Partial<IAutocompleteComponent>;\nexport interface IAutocompleteComponentDelegateOptions extends IFormFieldComponentDelegateOptions {\n useDropdownIcon?: boolean;\n textFieldDelegateConfig?: ITextFieldComponentDelegateConfig;\n}\n\nexport interface IAutocompleteComponentDelegateConfig extends IBaseComponentDelegateConfig<IAutocompleteComponent, IAutocompleteComponentDelegateOptions> {}\n\nexport class AutocompleteComponentDelegate extends FormFieldComponentDelegate<IAutocompleteComponent, IAutocompleteComponentDelegateOptions> {\n private _textFieldDelegate: TextFieldComponentDelegate;\n\n constructor(config?: IAutocompleteComponentDelegateConfig) {\n super(config);\n }\n\n protected _build(): IAutocompleteComponent {\n const autocomplete = document.createElement(AUTOCOMPLETE_CONSTANTS.elementName) as IAutocompleteComponent;\n this._attachTextField(autocomplete);\n return autocomplete;\n }\n\n public get textFieldDelegate(): TextFieldComponentDelegate {\n return this._textFieldDelegate;\n }\n\n public get value(): any {\n return this._element.value;\n }\n public set value(value: any) {\n this._element.value = value;\n }\n\n public get disabled(): boolean {\n return this._textFieldDelegate.inputElement.disabled;\n }\n public set disabled(value: boolean) {\n this._textFieldDelegate.inputElement.disabled = value;\n }\n\n public get invalid(): boolean {\n return this._textFieldDelegate.invalid || false;\n }\n public set invalid(value: boolean) {\n this._textFieldDelegate.invalid = value;\n }\n\n public onChange(listener: (value: string) => void): void {\n this._element.addEventListener(AUTOCOMPLETE_CONSTANTS.events.CHANGE, (evt: CustomEvent) => listener(evt.detail));\n }\n\n public onFocus(listener: (evt: FocusEvent) => void): void {\n this._textFieldDelegate.inputElement.addEventListener('focus', (evt: FocusEvent) => listener(evt));\n }\n\n public onBlur(listener: (evt: FocusEvent) => void): void {\n this._textFieldDelegate.inputElement.addEventListener('blur', (evt: FocusEvent) => listener(evt));\n }\n\n private _attachTextField(autocomplete: IAutocompleteComponent): void {\n const textFieldConfig: ITextFieldComponentDelegateConfig = {\n props: { ...this._config.options?.textFieldDelegateConfig?.props },\n options: { ...this._config.options?.textFieldDelegateConfig?.options }\n };\n\n if (!textFieldConfig.options) {\n textFieldConfig.options = {};\n }\n\n if (this._config.options?.useDropdownIcon !== false && !textFieldConfig.options?.trailingElement) {\n textFieldConfig.options.trailingElement = this._createDropdownIconElement();\n }\n\n this._textFieldDelegate = new TextFieldComponentDelegate(textFieldConfig);\n autocomplete.appendChild(this._textFieldDelegate.element);\n }\n\n private _createDropdownIconElement(): HTMLElement {\n const config: IIconComponentDelegateConfig = {\n props: {\n slot: 'trailing',\n name: 'arrow_drop_down'\n },\n options: {\n attributes: { 'forge-dropdown-icon': '' }\n }\n };\n return new IconComponentDelegate(config).element;\n }\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { AutocompleteComponent } from './autocomplete';\n\nexport * from './autocomplete-adapter';\nexport * from './autocomplete-component-delegate';\nexport * from './autocomplete-constants';\nexport * from './autocomplete-foundation';\nexport * from './autocomplete-utils';\nexport * from './autocomplete';\n\nexport function defineAutocompleteComponent(): void {\n defineCustomElement(AutocompleteComponent);\n}\n"],
|
|
5
|
+
"mappings": "+mCAMA,IAAMA,EAA2C,GAAGC,gBAE9CC,GAAa,CACjB,KAAM,OACN,SAAU,WACV,SAAU,WACV,gBAAiB,kBACjB,mBAAoB,qBACpB,gBAAiB,kBACjB,aAAc,eACd,cAAe,gBACf,aAAc,eACd,eAAgB,iBAChB,yBAA0B,2BAC1B,iBAAkB,mBAClB,KAAM,OACN,UAAW,YACX,YAAa,cACb,mBAAoB,+BACtB,EAEMC,GAAY,CAChB,MAAOC,GAAgB,UAAU,MACjC,cAAe,mGACf,aAAc,4DAChB,EAEMC,GAAU,CACd,sBAAuB,IACvB,mBAAoB,CACtB,EAEMC,GAAS,CACb,OAAQ,GAAGN,WACX,OAAQ,GAAGA,WACX,gBAAiB,GAAGA,mBACtB,EAEaO,EAAyB,CACpC,YAAAP,EACA,WAAAE,GACA,UAAAC,GACA,QAAAE,GACA,OAAAC,EACF,EAOYE,QACVA,EAAA,QAAU,UACVA,EAAA,UAAY,YAFFA,QAAA,ICLL,IAAMC,EAAN,cAAkCC,CAAoE,CAK3G,YAAYC,EAAmC,CAC7C,MAAMA,CAAS,EACf,KAAK,gBAAgB,CACvB,CAEA,IAAW,cAAiC,CAC1C,OAAO,KAAK,aACd,CAEO,iBAAoC,CACzC,IAA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oC,CAClDC,EAAoBC,CAAqB,CAC3C",
|
|
6
|
+
"names": ["elementName", "COMPONENT_NAME_PREFIX", "attributes", "selectors", "FIELD_CONSTANTS", "numbers", "events", "AUTOCOMPLETE_CONSTANTS", "AutocompleteMode", "AutocompleteAdapter", "BaseAdapter", "component", "inputElements", "deepQuerySelectorAll", "AUTOCOMPLETE_CONSTANTS", "name", "value", "type", "listener", "identifier", "tryCreateAriaControlsPlaceholder", "setAriaControls", "CHIP_FIELD_CONSTANTS", "config", "popupTarget", "ListDropdown", "targetElement", "POPUP_CONSTANTS", "isVisible", "_a", "dropdownElement", "options", "target", "activeElement", "getActiveElement", "dropdownIcon", "clearButton", "key", "id", "toggleAttribute", "selector", "_b", "values", "o", "dropdownEl", "textField", "textFieldRoot", "getShadowElement", "TEXT_FIELD_CONSTANTS", "chipField", "chipFieldRoot", "state", "OptionType", "isOptionType", "options", "type", "isOptionGroups", "o", "isDefined", "isObject", "isOptionTypes", "getSelectedOption", "value", "optionEqualPredicate", "option", "property", "isDeepEqual", "AutocompleteFoundation", "ListDropdownAwareFoundation", "_adapter", "AUTOCOMPLETE_CONSTANTS", "evt", "id", "randomChars", "preserveValue", "isDefined", "debounce", "isOptionType", "previousValue", "currentValue", "Platform", "checkFocus", "filterText", "filterPromise", "e", "promiseIndex", "input", "value", "isRemovingAllChars", "isBackspacingLastChar", "isDeletingLastChar", "isEmpty", "sendFilterText", "sendValue", "filter", "resolve", "reject", "options", "userTriggered", "activateFirst", "activateSelected", "listOptionBuilder", "optionBuilder", "option", "parentElement", "config", "label", "highlightElement", "highlightTextHTML", "selectedOptions", "unselectedOptions", "o", "optionEqualPredicate", "selectedValue", "keepFocus", "data", "select", "selectedOption", "getSelectedOption", "index", "activeOptionIndex", "_a", "_b", "values", "allOptions", "flatOptions", "actualOption", "isString", "v", "fn", "cb", "template", "styles", "AutocompleteComponent", "ListDropdownAware", "IconRegistry", "tylIconArrowDropDown", "tylIconCheckBox", "tylIconCheckBoxOutlineBlank", "attachShadowTemplate", "AutocompleteFoundation", "AutocompleteAdapter", "AUTOCOMPLETE_CONSTANTS", "ensureChild", "name", "oldValue", "newValue", "coerceBoolean", "coerceNumber", "options", "opts", "__decorateClass", "FoundationProperty", "CustomElement", "TextFieldComponent", "PopupComponent", "ListComponent", "ListItemComponent", "DividerComponent", "SkeletonComponent", "LinearProgressComponent", "IconComponent", "AutocompleteComponentDelegate", "FormFieldComponentDelegate", "config", "autocomplete", "AUTOCOMPLETE_CONSTANTS", "value", "listener", "evt", "_a", "_b", "_c", "_d", "_e", "_f", "textFieldConfig", "__spreadValues", "TextFieldComponentDelegate", "IconComponentDelegate", "defineAutocompleteComponent", "defineCustomElement", "AutocompleteComponent"]
|
|
7
|
+
}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
4
|
* License: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import{b as N}from"./chunk.EYGSUZWX.js";import{a as F,b as S}from"./chunk.HDHGU4L2.js";import{k as d,z as m}from"./chunk.MZLPUI6R.js";import{d as h}from"./chunk.WHQZNZHW.js";import{a as A}from"./chunk.2KXSGD3S.js";import{a as C}from"./chunk.UWYANU5D.js";import{a as E}from"./chunk.KTGSZEAG.js";import{a as B,b as L}from"./chunk.DL7NX432.js";import{a as I,e as T,g as c,l as D}from"./chunk.LJLEPTLU.js";import{k as f}from"./chunk.J2M2MXP2.js";import{a as _,b as x,f as p}from"./chunk.MCIQXNKY.js";var R=`${L}quantity-field`,q={INVALID:"invalid",REQUIRED:"required",DISABLED:"disabled"},O={ROOT:"forge-quantity-field",INVALID:"forge-quantity-field--invalid",REQUIRED:"forge-quantity-field--required"},a={INCREMENT_BUTTON:"increment-button",DECREMENT_BUTTON:"decrement-button",LABEL:"label",HELPER_TEXT:"helper-text"},w={ROOT:`.${O.ROOT}`,INCREMENT_BUTTON_SLOT:`slot[name=${a.INCREMENT_BUTTON}]`,DECREMENT_BUTTON_SLOT:`slot[name=${a.DECREMENT_BUTTON}]`,INCREMENT_BUTTON:`[slot=${a.INCREMENT_BUTTON}] button, button[slot=${a.INCREMENT_BUTTON}]`,DECREMENT_BUTTON:`[slot=${a.DECREMENT_BUTTON}] button, button[slot=${a.DECREMENT_BUTTON}]`,TEXT_FIELD:"forge-text-field",INPUT:"input[type=number]",LABEL:`[slot=${a.LABEL}]`,HELPER_TEXT:`[slot=${a.HELPER_TEXT}]`},i={elementName:R,classes:O,slots:a,selectors:w,attributes:q};var v=class extends C{constructor(t){super(t);this._rootElement=c(t,i.selectors.ROOT),this._incrementButtonSlot=c(this._component,i.selectors.INCREMENT_BUTTON_SLOT),this._decrementButtonSlot=c(this._component,i.selectors.DECREMENT_BUTTON_SLOT)}initializeButtons(){this._incrementButton&&!this._incrementButton.hasAttribute("tabindex")&&(this._incrementButton.tabIndex=-1),this._decrementButton&&!this._decrementButton.hasAttribute("tabindex")&&(this._decrementButton.tabIndex=-1)}addRootClass(t){this._rootElement.classList.add(t)}removeRootClass(t){this._rootElement.classList.remove(t)}inputHasAttribute(t){return this.inputElement?this.inputElement.hasAttribute(t):!1}addIncrementButtonSlotListener(t){this._incrementButtonSlot.addEventListener("slotchange",t)}removeIncrementButtonSlotListener(t){this._incrementButtonSlot&&this._incrementButtonSlot.removeEventListener("slotchange",t)}addDecrementButtonSlotListener(t){this._decrementButtonSlot.addEventListener("slotchange",t)}removeDecrementButtonSlotListener(t){this._decrementButtonSlot&&this._decrementButtonSlot.removeEventListener("slotchange",t)}addTextFieldAttribute(t,e=""){this._textFieldComponent&&this._textFieldComponent.setAttribute(t,e)}removeTextFieldAttribute(t){this._textFieldComponent&&this._textFieldComponent.removeAttribute(t)}addIncrementEventListener(t,e){this._incrementButtonElement.addEventListener(t,e)}removeIncrementEventListener(t,e){this._incrementButtonElement&&this._incrementButtonElement.removeEventListener(t,e)}addDecrementEventListener(t,e){this._decrementButtonElement.addEventListener(t,e)}removeDecrementEventListener(t,e){this._decrementButtonElement&&this._decrementButtonElement.removeEventListener(t,e)}addIncrementButtonAttribute(t,e=""){this._incrementButtonElement.setAttribute(t,e)}removeIncrementButtonAttribute(t){this._incrementButtonElement.removeAttribute(t)}addDecrementButtonAttribute(t,e=""){this._decrementButtonElement.setAttribute(t,e)}removeDecrementButtonAttribute(t){this._decrementButtonElement.removeAttribute(t)}increment(){let t=this.inputElement;if(!t)return;let e=+t.value,n=this._calcPrecision(this._inputStep),o=parseFloat((e+this._inputStep).toFixed(n));!!this._inputMax&&this._inputMax<o&&(o=this._inputMax),this._setInputValue(o)}decrement(){let t=this.inputElement;if(!t)return;let e=+t.value,n=this._calcPrecision(this._inputStep),o=parseFloat((e-this._inputStep).toFixed(n));!!this._inputMin&&this._inputMin>o&&(o=this._inputMin),this._setInputValue(o)}addInputDisabledAttributeChangeListener(t){this._setupInputDisabledAttributeMutationObserver(t)}removeInputDisabledAttributeChangeListener(){this._cleanupInputDisabledAttributeMutationObserver()}_setInputValue(t){!this.inputElement||(this.inputElement.value=`${t}`,this.inputElement.dispatchEvent(new Event("input")),this.inputElement.dispatchEvent(new Event("change")))}_isNullOrUndefinedOrEmpty(t){return t==null||t===""}_setupInputDisabledAttributeMutationObserver(t){if(!this.inputElement)return;this._cleanupInputDisabledAttributeMutationObserver();let e=o=>this._inputDisabledAttributeMutationCallback(o,t);this._inputAttributeMutationObserver=new MutationObserver(e);let n={attributes:!0,attributeOldValue:!0,attributeFilter:[i.attributes.DISABLED]};this._inputAttributeMutationObserver.observe(this.inputElement,n)}_cleanupInputDisabledAttributeMutationObserver(){this._inputAttributeMutationObserver&&(this._inputAttributeMutationObserver.disconnect(),delete this._inputAttributeMutationObserver)}_inputDisabledAttributeMutationCallback(t,e){for(let n of t)n.type!=="attributes"||!n.attributeName||n.attributeName!==i.attributes.DISABLED||n.target[n.attributeName]===n.oldValue||e()}get _incrementButtonElement(){return this._incrementButton||(this._incrementButton=this._component.querySelector(i.selectors.INCREMENT_BUTTON)),this._incrementButton}get _decrementButtonElement(){return this._decrementButton||(this._decrementButton=this._component.querySelector(i.selectors.DECREMENT_BUTTON)),this._decrementButton}get _textFieldComponent(){return this._textField||(this._textField=this._component.querySelector(i.selectors.TEXT_FIELD)),this._textField}get inputElement(){return this._inputElement||(this._inputElement=this._component.querySelector(i.selectors.INPUT)),this._inputElement}get _inputStep(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.step)?1:+t.step}get _inputMax(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.max)?null:+t.max}get _inputMin(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.min)?null:+t.min}_calcPrecision(t){let e=String(t);return e.includes(".")?e.split(".")[1].length:0}};var b=class{constructor(r){this._adapter=r;this._incrementValue=()=>this._adapter.increment(),this._decrementValue=()=>this._adapter.decrement(),this._incrementButtonSlotChanged=()=>this._onIncrementButtonSlotChanged(),this._decrementButtonSlotChanged=()=>this._onDecrementButtonSlotChanged(),this._adapter.addIncrementButtonSlotListener(this._incrementButtonSlotChanged),this._adapter.addDecrementButtonSlotListener(this._decrementButtonSlotChanged)}connect(){this._adapter.addInputDisabledAttributeChangeListener(()=>this._syncDisabledStateOfButtons()),this._syncDisabledStateOfButtons(),this._adapter.initializeButtons()}disconnect(){this._removeIncrementEventListener(),this._removeDecrementEventListener(),this._removeIncrementButtonSlotListener(),this._removeDecrementButtonSlotListener(),this._adapter.removeInputDisabledAttributeChangeListener()}_onIncrementButtonSlotChanged(){this._addIncrementEventListener()}_onDecrementButtonSlotChanged(){this._addDecrementEventListener()}_addIncrementEventListener(){this._adapter.addIncrementEventListener("click",this._incrementValue)}_addDecrementEventListener(){this._adapter.addDecrementEventListener("click",this._decrementValue)}_removeIncrementEventListener(){this._adapter.removeIncrementEventListener("click",this._incrementValue)}_removeDecrementEventListener(){this._adapter.removeDecrementEventListener("click",this._decrementValue)}_removeIncrementButtonSlotListener(){this._adapter.removeIncrementButtonSlotListener(this._incrementButtonSlotChanged)}_removeDecrementButtonSlotListener(){this._adapter.removeDecrementButtonSlotListener(this._decrementButtonSlotChanged)}_syncDisabledStateOfButtons(){this._adapter.inputHasAttribute(i.attributes.DISABLED)?(this._adapter.addDecrementButtonAttribute(i.attributes.DISABLED),this._adapter.addIncrementButtonAttribute(i.attributes.DISABLED)):(this._adapter.removeIncrementButtonAttribute(i.attributes.DISABLED),this._adapter.removeDecrementButtonAttribute(i.attributes.DISABLED))}get required(){return this._required}set required(r){this._required!==r&&(this._required=r,this._required?(this._adapter.setHostAttribute(i.attributes.REQUIRED),this._adapter.addRootClass(i.classes.REQUIRED)):(this._adapter.removeHostAttribute(i.attributes.REQUIRED),this._adapter.removeRootClass(i.classes.REQUIRED)))}get invalid(){return this._invalid}set invalid(r){this._invalid!==r&&(this._invalid=r,this._invalid?(this._adapter.setHostAttribute(i.attributes.INVALID),this._adapter.addRootClass(i.classes.INVALID),this._adapter.addTextFieldAttribute(i.attributes.INVALID)):(this._adapter.removeHostAttribute(i.attributes.INVALID),this._adapter.removeRootClass(i.classes.INVALID),this._adapter.removeTextFieldAttribute(i.attributes.INVALID)))}};var U='<template><div class="forge-quantity-field" part="root"><slot name="label"></slot><div class="forge-quantity-field__row" part="row"><slot name="decrement-button"></slot><slot></slot><slot name="increment-button"></slot></div><slot name="helper-text"></slot></div></template>',k='.forge-quantity-field ::slotted([slot=label]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-quantity-field ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);height:1rem;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-quantity-field ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}.forge-quantity-field__row{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.forge-quantity-field ::slotted(forge-icon-button:first-of-type){color:var(--mdc-theme-text-secondary-on-light);margin-right:4px}.forge-quantity-field ::slotted(forge-icon-button:last-of-type){color:var(--mdc-theme-text-secondary-on-light);margin-left:4px}.forge-quantity-field ::slotted(forge-text-field){--forge-text-field-margin-top:0;--forge-text-field-margin-bottom:0}.forge-quantity-field--required ::slotted([slot=label])::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:"*";margin-right:4px}.forge-quantity-field--invalid ::slotted([slot=label]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-quantity-field--invalid ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);height:1rem;color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-quantity-field--invalid ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}:host{display:inline-block}:host([hidden]){display:none}',s=class extends D{constructor(){super();T(this,U,k),this._foundation=new b(new v(this)),h.define([m,d])}static get observedAttributes(){return[i.attributes.INVALID,i.attributes.REQUIRED]}connectedCallback(){this._requiredElementsPresent()?this._foundation.connect():this._ensureElementsPresent().then(()=>{this._foundation.connect()})}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,e,n){switch(t){case i.attributes.INVALID:this.invalid=f(n);break;case i.attributes.REQUIRED:this.required=f(n);break}}_ensureElementsPresent(){return new Promise(t=>{if(this._requiredElementsPresent()){t();return}let e=new MutationObserver(n=>{n.reduce((l,u)=>l+u.addedNodes.length,0)>0&&this._requiredElementsPresent()&&(e.disconnect(),t())});e.observe(this,{childList:!0,subtree:!0})})}_requiredElementsPresent(){let t=this.querySelector(i.selectors.INPUT),e=this.querySelector(i.selectors.DECREMENT_BUTTON),n=this.querySelector(i.selectors.INCREMENT_BUTTON);return!!t&&!!e&&!!n}};p([E()],s.prototype,"invalid",2),p([E()],s.prototype,"required",2),s=p([B({name:i.elementName,dependencies:[F]})],s);var M=class extends A{constructor(t){super(t);h.define([m,d])}_build(){let t=document.createElement(i.elementName);return this._attachButton(t,m.name,"decrement-button"),this._attachTextField(t),this._attachButton(t,d.name,"increment-button"),t}_configure(){var t,e,n,o,l;this.inputElement.value=(e=(t=this._config.options)==null?void 0:t.value)!=null?e:"0",this.inputElement.style.textAlign="center",this.inputElement.style.width="64px",(n=this._config.options)!=null&&n.helperText&&this.setHelperText(this._config.options.helperText),typeof((o=this._config.options)==null?void 0:o.label)=="string"&&this._createLabel(this._config.options.label),((l=this._config.options)==null?void 0:l.step)!==void 0&&(this.inputElement.step=this._config.options.step)}get value(){return this._textFieldDelegate.inputElement.value}set value(t){this._textFieldDelegate.inputElement.value=t}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(t){this._textFieldDelegate.inputElement.disabled=t}get invalid(){return this._element.invalid||!1}set invalid(t){this._element.invalid=t}get inputElement(){return this._textFieldDelegate.inputElement}get labelElement(){return this._labelElement}onChange(t){this._textFieldDelegate.inputElement.addEventListener("input",e=>t(e.target.value))}onFocus(t){this._textFieldDelegate.inputElement.addEventListener("focus",e=>t(e))}onBlur(t){this._textFieldDelegate.inputElement.addEventListener("blur",e=>t(e))}_attachTextField(t){var n,o,l,u,y;let e={props:_({},(o=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:o.props),options:x(_({},(u=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:u.options),{id:(y=this._config.options)==null?void 0:y.id,type:"number"})};this._textFieldDelegate=new N(e),t.appendChild(this._textFieldDelegate.element)}setLabel(t){t?this._labelElement?this._labelElement.textContent=t:this._createLabel(t):this._labelElement&&(this._element.removeChild(this._labelElement),this._labelElement=void 0)}setHelperText(t){t?(this._helperTextElement||(this._helperTextElement=document.createElement("span"),this._helperTextElement.slot="helper-text",this._element.appendChild(this._helperTextElement)),this._helperTextElement.textContent=t):this._helperTextElement&&(this._element.removeChild(this._helperTextElement),this._helperTextElement=void 0)}_createLabel(t){var e;this._labelElement=document.createElement("label"),this._labelElement.textContent=t,this._labelElement.slot="label",(e=this._config.options)!=null&&e.id&&this._labelElement.setAttribute("for",this._config.options.id),this._element.appendChild(this._labelElement)}_attachButton(t,e,n){return new S({options:{iconName:e,parent:t,attributes:{slot:n}}})}};function gt(){I(s)}export{i as a,v as b,b as c,s as d,M as e,gt as f};
|
|
7
|
-
//# sourceMappingURL=chunk.
|
|
6
|
+
import{b as N}from"./chunk.EYGSUZWX.js";import{a as F,b as S}from"./chunk.E3K6KM57.js";import{k as d,z as m}from"./chunk.MZLPUI6R.js";import{d as h}from"./chunk.WHQZNZHW.js";import{a as A}from"./chunk.2KXSGD3S.js";import{a as C}from"./chunk.UWYANU5D.js";import{a as E}from"./chunk.KTGSZEAG.js";import{a as B,b as L}from"./chunk.DL7NX432.js";import{a as I,e as T,g as c,l as D}from"./chunk.LJLEPTLU.js";import{k as f}from"./chunk.J2M2MXP2.js";import{a as _,b as x,f as p}from"./chunk.MCIQXNKY.js";var R=`${L}quantity-field`,q={INVALID:"invalid",REQUIRED:"required",DISABLED:"disabled"},O={ROOT:"forge-quantity-field",INVALID:"forge-quantity-field--invalid",REQUIRED:"forge-quantity-field--required"},a={INCREMENT_BUTTON:"increment-button",DECREMENT_BUTTON:"decrement-button",LABEL:"label",HELPER_TEXT:"helper-text"},w={ROOT:`.${O.ROOT}`,INCREMENT_BUTTON_SLOT:`slot[name=${a.INCREMENT_BUTTON}]`,DECREMENT_BUTTON_SLOT:`slot[name=${a.DECREMENT_BUTTON}]`,INCREMENT_BUTTON:`[slot=${a.INCREMENT_BUTTON}] button, button[slot=${a.INCREMENT_BUTTON}]`,DECREMENT_BUTTON:`[slot=${a.DECREMENT_BUTTON}] button, button[slot=${a.DECREMENT_BUTTON}]`,TEXT_FIELD:"forge-text-field",INPUT:"input[type=number]",LABEL:`[slot=${a.LABEL}]`,HELPER_TEXT:`[slot=${a.HELPER_TEXT}]`},i={elementName:R,classes:O,slots:a,selectors:w,attributes:q};var v=class extends C{constructor(t){super(t);this._rootElement=c(t,i.selectors.ROOT),this._incrementButtonSlot=c(this._component,i.selectors.INCREMENT_BUTTON_SLOT),this._decrementButtonSlot=c(this._component,i.selectors.DECREMENT_BUTTON_SLOT)}initializeButtons(){this._incrementButton&&!this._incrementButton.hasAttribute("tabindex")&&(this._incrementButton.tabIndex=-1),this._decrementButton&&!this._decrementButton.hasAttribute("tabindex")&&(this._decrementButton.tabIndex=-1)}addRootClass(t){this._rootElement.classList.add(t)}removeRootClass(t){this._rootElement.classList.remove(t)}inputHasAttribute(t){return this.inputElement?this.inputElement.hasAttribute(t):!1}addIncrementButtonSlotListener(t){this._incrementButtonSlot.addEventListener("slotchange",t)}removeIncrementButtonSlotListener(t){this._incrementButtonSlot&&this._incrementButtonSlot.removeEventListener("slotchange",t)}addDecrementButtonSlotListener(t){this._decrementButtonSlot.addEventListener("slotchange",t)}removeDecrementButtonSlotListener(t){this._decrementButtonSlot&&this._decrementButtonSlot.removeEventListener("slotchange",t)}addTextFieldAttribute(t,e=""){this._textFieldComponent&&this._textFieldComponent.setAttribute(t,e)}removeTextFieldAttribute(t){this._textFieldComponent&&this._textFieldComponent.removeAttribute(t)}addIncrementEventListener(t,e){this._incrementButtonElement.addEventListener(t,e)}removeIncrementEventListener(t,e){this._incrementButtonElement&&this._incrementButtonElement.removeEventListener(t,e)}addDecrementEventListener(t,e){this._decrementButtonElement.addEventListener(t,e)}removeDecrementEventListener(t,e){this._decrementButtonElement&&this._decrementButtonElement.removeEventListener(t,e)}addIncrementButtonAttribute(t,e=""){this._incrementButtonElement.setAttribute(t,e)}removeIncrementButtonAttribute(t){this._incrementButtonElement.removeAttribute(t)}addDecrementButtonAttribute(t,e=""){this._decrementButtonElement.setAttribute(t,e)}removeDecrementButtonAttribute(t){this._decrementButtonElement.removeAttribute(t)}increment(){let t=this.inputElement;if(!t)return;let e=+t.value,n=this._calcPrecision(this._inputStep),o=parseFloat((e+this._inputStep).toFixed(n));!!this._inputMax&&this._inputMax<o&&(o=this._inputMax),this._setInputValue(o)}decrement(){let t=this.inputElement;if(!t)return;let e=+t.value,n=this._calcPrecision(this._inputStep),o=parseFloat((e-this._inputStep).toFixed(n));!!this._inputMin&&this._inputMin>o&&(o=this._inputMin),this._setInputValue(o)}addInputDisabledAttributeChangeListener(t){this._setupInputDisabledAttributeMutationObserver(t)}removeInputDisabledAttributeChangeListener(){this._cleanupInputDisabledAttributeMutationObserver()}_setInputValue(t){!this.inputElement||(this.inputElement.value=`${t}`,this.inputElement.dispatchEvent(new Event("input")),this.inputElement.dispatchEvent(new Event("change")))}_isNullOrUndefinedOrEmpty(t){return t==null||t===""}_setupInputDisabledAttributeMutationObserver(t){if(!this.inputElement)return;this._cleanupInputDisabledAttributeMutationObserver();let e=o=>this._inputDisabledAttributeMutationCallback(o,t);this._inputAttributeMutationObserver=new MutationObserver(e);let n={attributes:!0,attributeOldValue:!0,attributeFilter:[i.attributes.DISABLED]};this._inputAttributeMutationObserver.observe(this.inputElement,n)}_cleanupInputDisabledAttributeMutationObserver(){this._inputAttributeMutationObserver&&(this._inputAttributeMutationObserver.disconnect(),delete this._inputAttributeMutationObserver)}_inputDisabledAttributeMutationCallback(t,e){for(let n of t)n.type!=="attributes"||!n.attributeName||n.attributeName!==i.attributes.DISABLED||n.target[n.attributeName]===n.oldValue||e()}get _incrementButtonElement(){return this._incrementButton||(this._incrementButton=this._component.querySelector(i.selectors.INCREMENT_BUTTON)),this._incrementButton}get _decrementButtonElement(){return this._decrementButton||(this._decrementButton=this._component.querySelector(i.selectors.DECREMENT_BUTTON)),this._decrementButton}get _textFieldComponent(){return this._textField||(this._textField=this._component.querySelector(i.selectors.TEXT_FIELD)),this._textField}get inputElement(){return this._inputElement||(this._inputElement=this._component.querySelector(i.selectors.INPUT)),this._inputElement}get _inputStep(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.step)?1:+t.step}get _inputMax(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.max)?null:+t.max}get _inputMin(){let t=this.inputElement;return!t||this._isNullOrUndefinedOrEmpty(t.min)?null:+t.min}_calcPrecision(t){let e=String(t);return e.includes(".")?e.split(".")[1].length:0}};var b=class{constructor(r){this._adapter=r;this._incrementValue=()=>this._adapter.increment(),this._decrementValue=()=>this._adapter.decrement(),this._incrementButtonSlotChanged=()=>this._onIncrementButtonSlotChanged(),this._decrementButtonSlotChanged=()=>this._onDecrementButtonSlotChanged(),this._adapter.addIncrementButtonSlotListener(this._incrementButtonSlotChanged),this._adapter.addDecrementButtonSlotListener(this._decrementButtonSlotChanged)}connect(){this._adapter.addInputDisabledAttributeChangeListener(()=>this._syncDisabledStateOfButtons()),this._syncDisabledStateOfButtons(),this._adapter.initializeButtons()}disconnect(){this._removeIncrementEventListener(),this._removeDecrementEventListener(),this._removeIncrementButtonSlotListener(),this._removeDecrementButtonSlotListener(),this._adapter.removeInputDisabledAttributeChangeListener()}_onIncrementButtonSlotChanged(){this._addIncrementEventListener()}_onDecrementButtonSlotChanged(){this._addDecrementEventListener()}_addIncrementEventListener(){this._adapter.addIncrementEventListener("click",this._incrementValue)}_addDecrementEventListener(){this._adapter.addDecrementEventListener("click",this._decrementValue)}_removeIncrementEventListener(){this._adapter.removeIncrementEventListener("click",this._incrementValue)}_removeDecrementEventListener(){this._adapter.removeDecrementEventListener("click",this._decrementValue)}_removeIncrementButtonSlotListener(){this._adapter.removeIncrementButtonSlotListener(this._incrementButtonSlotChanged)}_removeDecrementButtonSlotListener(){this._adapter.removeDecrementButtonSlotListener(this._decrementButtonSlotChanged)}_syncDisabledStateOfButtons(){this._adapter.inputHasAttribute(i.attributes.DISABLED)?(this._adapter.addDecrementButtonAttribute(i.attributes.DISABLED),this._adapter.addIncrementButtonAttribute(i.attributes.DISABLED)):(this._adapter.removeIncrementButtonAttribute(i.attributes.DISABLED),this._adapter.removeDecrementButtonAttribute(i.attributes.DISABLED))}get required(){return this._required}set required(r){this._required!==r&&(this._required=r,this._required?(this._adapter.setHostAttribute(i.attributes.REQUIRED),this._adapter.addRootClass(i.classes.REQUIRED)):(this._adapter.removeHostAttribute(i.attributes.REQUIRED),this._adapter.removeRootClass(i.classes.REQUIRED)))}get invalid(){return this._invalid}set invalid(r){this._invalid!==r&&(this._invalid=r,this._invalid?(this._adapter.setHostAttribute(i.attributes.INVALID),this._adapter.addRootClass(i.classes.INVALID),this._adapter.addTextFieldAttribute(i.attributes.INVALID)):(this._adapter.removeHostAttribute(i.attributes.INVALID),this._adapter.removeRootClass(i.classes.INVALID),this._adapter.removeTextFieldAttribute(i.attributes.INVALID)))}};var U='<template><div class="forge-quantity-field" part="root"><slot name="label"></slot><div class="forge-quantity-field__row" part="row"><slot name="decrement-button"></slot><slot></slot><slot name="increment-button"></slot></div><slot name="helper-text"></slot></div></template>',k='.forge-quantity-field ::slotted([slot=label]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-quantity-field ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);height:1rem;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-quantity-field ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}.forge-quantity-field__row{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.forge-quantity-field ::slotted(forge-icon-button:first-of-type){color:var(--mdc-theme-text-secondary-on-light);margin-right:4px}.forge-quantity-field ::slotted(forge-icon-button:last-of-type){color:var(--mdc-theme-text-secondary-on-light);margin-left:4px}.forge-quantity-field ::slotted(forge-text-field){--forge-text-field-margin-top:0;--forge-text-field-margin-bottom:0}.forge-quantity-field--required ::slotted([slot=label])::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:"*";margin-right:4px}.forge-quantity-field--invalid ::slotted([slot=label]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-quantity-field--invalid ::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.75rem;font-size:var(--mdc-typography-caption-font-size, .75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);height:1rem;color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-quantity-field--invalid ::slotted([slot=helper-text])::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}:host{display:inline-block}:host([hidden]){display:none}',s=class extends D{constructor(){super();T(this,U,k),this._foundation=new b(new v(this)),h.define([m,d])}static get observedAttributes(){return[i.attributes.INVALID,i.attributes.REQUIRED]}connectedCallback(){this._requiredElementsPresent()?this._foundation.connect():this._ensureElementsPresent().then(()=>{this._foundation.connect()})}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(t,e,n){switch(t){case i.attributes.INVALID:this.invalid=f(n);break;case i.attributes.REQUIRED:this.required=f(n);break}}_ensureElementsPresent(){return new Promise(t=>{if(this._requiredElementsPresent()){t();return}let e=new MutationObserver(n=>{n.reduce((l,u)=>l+u.addedNodes.length,0)>0&&this._requiredElementsPresent()&&(e.disconnect(),t())});e.observe(this,{childList:!0,subtree:!0})})}_requiredElementsPresent(){let t=this.querySelector(i.selectors.INPUT),e=this.querySelector(i.selectors.DECREMENT_BUTTON),n=this.querySelector(i.selectors.INCREMENT_BUTTON);return!!t&&!!e&&!!n}};p([E()],s.prototype,"invalid",2),p([E()],s.prototype,"required",2),s=p([B({name:i.elementName,dependencies:[F]})],s);var M=class extends A{constructor(t){super(t);h.define([m,d])}_build(){let t=document.createElement(i.elementName);return this._attachButton(t,m.name,"decrement-button"),this._attachTextField(t),this._attachButton(t,d.name,"increment-button"),t}_configure(){var t,e,n,o,l;this.inputElement.value=(e=(t=this._config.options)==null?void 0:t.value)!=null?e:"0",this.inputElement.style.textAlign="center",this.inputElement.style.width="64px",(n=this._config.options)!=null&&n.helperText&&this.setHelperText(this._config.options.helperText),typeof((o=this._config.options)==null?void 0:o.label)=="string"&&this._createLabel(this._config.options.label),((l=this._config.options)==null?void 0:l.step)!==void 0&&(this.inputElement.step=this._config.options.step)}get value(){return this._textFieldDelegate.inputElement.value}set value(t){this._textFieldDelegate.inputElement.value=t}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(t){this._textFieldDelegate.inputElement.disabled=t}get invalid(){return this._element.invalid||!1}set invalid(t){this._element.invalid=t}get inputElement(){return this._textFieldDelegate.inputElement}get labelElement(){return this._labelElement}onChange(t){this._textFieldDelegate.inputElement.addEventListener("input",e=>t(e.target.value))}onFocus(t){this._textFieldDelegate.inputElement.addEventListener("focus",e=>t(e))}onBlur(t){this._textFieldDelegate.inputElement.addEventListener("blur",e=>t(e))}_attachTextField(t){var n,o,l,u,y;let e={props:_({},(o=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:o.props),options:x(_({},(u=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:u.options),{id:(y=this._config.options)==null?void 0:y.id,type:"number"})};this._textFieldDelegate=new N(e),t.appendChild(this._textFieldDelegate.element)}setLabel(t){t?this._labelElement?this._labelElement.textContent=t:this._createLabel(t):this._labelElement&&(this._element.removeChild(this._labelElement),this._labelElement=void 0)}setHelperText(t){t?(this._helperTextElement||(this._helperTextElement=document.createElement("span"),this._helperTextElement.slot="helper-text",this._element.appendChild(this._helperTextElement)),this._helperTextElement.textContent=t):this._helperTextElement&&(this._element.removeChild(this._helperTextElement),this._helperTextElement=void 0)}_createLabel(t){var e;this._labelElement=document.createElement("label"),this._labelElement.textContent=t,this._labelElement.slot="label",(e=this._config.options)!=null&&e.id&&this._labelElement.setAttribute("for",this._config.options.id),this._element.appendChild(this._labelElement)}_attachButton(t,e,n){return new S({options:{iconName:e,parent:t,attributes:{slot:n}}})}};function gt(){I(s)}export{i as a,v as b,b as c,s as d,M as e,gt as f};
|
|
7
|
+
//# sourceMappingURL=chunk.OBBYRQCY.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Tyler Technologies, Inc.
|
|
4
|
+
* License: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import{a as O,b as B,d as H,e as z}from"./chunk.6ENND42M.js";import{E as S}from"./chunk.LFBYFJTX.js";import{F as L}from"./chunk.KTEM7SW7.js";import{b as w}from"./chunk.EYGSUZWX.js";import{e as g}from"./chunk.DONAMICM.js";import{e as M}from"./chunk.WCSVKQR2.js";import{a as N}from"./chunk.E3K6KM57.js";import{p as P}from"./chunk.MZLPUI6R.js";import{a as D}from"./chunk.YI4JTY4T.js";import{d as V,l as y}from"./chunk.WHQZNZHW.js";import{a as A}from"./chunk.2KXSGD3S.js";import{b as F}from"./chunk.FVRSGKJD.js";import{e as m}from"./chunk.U6WGJELL.js";import{i as x,j as T}from"./chunk.KYH5GKVI.js";import{a as b,b as k}from"./chunk.DL7NX432.js";import{a as E,e as C,i as I}from"./chunk.LJLEPTLU.js";import{s as f}from"./chunk.4LA6HEA7.js";import{f as v}from"./chunk.J2M2MXP2.js";import{a as d,f as _}from"./chunk.MCIQXNKY.js";var r=`${k}date-picker`,R={VALUE:"value"},K={INPUT:"input,input[forge-date-picker-input]"},$={CHANGE:`${r}-change`,OPEN:`${r}-open`,CLOSE:`${r}-close`,INPUT:`${r}-input`},n={elementName:r,selectors:K,events:$,observedAttributes:R};var l=class extends H{constructor(e){super(e);this._dropdownIdentifier=`forge-date-picker-${this._identifier}`}_initializeInput(){this._inputElement=this._component.querySelector(n.selectors.INPUT)}_initializeCalendarDropdown(){let e=this._getDefaultTargetElement();this._calendarDropdown=new L(e,this._dropdownIdentifier)}initializeMask(e){var t;(t=this._inputMask)==null||t.destroy(),this._inputMask=new F(this._inputElement,e)}destroyMask(){var e;(e=this._inputMask)==null||e.destroy(),this._inputMask=void 0}initializeAccessibility(){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("autocorrect","off"),this._inputElement.setAttribute("autocapitalize","off"),this._inputElement.setAttribute("spellcheck","false"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","assertive"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.setAttribute("aria-owns",this._dropdownIdentifier),x(),T(this._inputElement)}addInputListener(e,t,i){var a;(a=this._inputElement)==null||a.addEventListener(e,t,{capture:i})}removeInputListener(e,t,i){var a;(a=this._inputElement)==null||a.removeEventListener(e,t,{capture:i})}setInputValueChangedListener(e,t){this.destroyValueChangeListener();let i=g(e,this._inputElement,"value",t);this._valueChangeListeners.push(i)}hasInputElement(){return!!this._inputElement}attachCalendar(e,t){super.attachCalendar(e,t),this._inputElement.setAttribute("aria-expanded","true")}detachCalendar(){super.detachCalendar(),this._inputElement&&(this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.removeAttribute("aria-activedescendant"))}setActiveDescendant(e){this._inputElement.setAttribute("aria-activedescendant",e)}setInputValue(e,t){this._inputElement.value!==e&&(this._inputElement.value=e,this._inputMask&&this._inputMask.updateMask(),t&&(this._inputElement.dispatchEvent(new Event("change")),this._inputElement.dispatchEvent(new Event("input"))))}isInputDisabled(){return this._inputElement.disabled}isInputFocused(){return f(this._component.ownerDocument)===this._inputElement}getInputValue(){return this._inputMask?this._inputMask.maskedValue:this._inputElement.value}setDisabled(e){this._inputElement.disabled=e,this._inputElement.setAttribute("aria-disabled",e.toString()),this._toggleElement&&(this._toggleElement.setAttribute("aria-disabled",e.toString()),this._toggleElement.hasOwnProperty("disabled")&&(this._toggleElement.disabled=e))}tryFocusInput(){this._inputElement.focus()}tryBlurInput(){this._inputElement.blur()}selectInputText(){this._inputElement.select()}emitInputEvent(e,t){I(this._inputElement,e,t)}};var p=class extends z{constructor(e){super(e);this._mode="single"}_initializeState(){this._value||(this._value=this._coerceDateValue(this._adapter.getInputValue()))}_emitChangeEvent(e,t){let i=this._getTypedValue(e);return this._adapter.emitHostEvent(n.events.CHANGE,i,!0,!t)?(this._setValue(e),!0):!1}_emitOpenEvent(){this._adapter.emitHostEvent(n.events.OPEN,void 0,!1)}_emitCloseEvent(){this._adapter.emitHostEvent(n.events.CLOSE,void 0,!1)}_onToday(){let e=new Date;e.setHours(0,0,0,0),this._onDateSelected({date:e,selected:!0,type:"date"})}_onClear(){this._onDateSelected({date:null,selected:!1,type:"date"})}_getCurrentValue(){return this._value}_setFormattedInputValue(e){let t=this._formatDate(this._value);t?this._adapter.setInputValue(t,e?!1:this._notifyInputValueChanges):this._allowInvalidDate||this._adapter.setInputValue("",e?!1:this._notifyInputValueChanges)}_setValue(e){(!e||this._isDateValueAcceptable(e))&&(this._value=e)}_onDateSelected(e){let t=e.date;if(e.type==="date"&&this._closeCalendar(!0),!this._emitChangeEvent(t))return;let i=this._formatDate(t);this._adapter.setInputValue(i,this._notifyInputValueChanges),this._formatInputValue(),D.isMobile||this._adapter.selectInputText()}_openCalendar(e){super._openCalendar(e);let t=this._getCurrentValue();t&&this._adapter.goToCalendarDate(new Date(t))}_applyMin(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue()),super._applyMin()}_applyMax(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue()),super._applyMax()}_applyDisabledDates(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue())}_applyDisabledDaysOfWeek(){this._value&&!this._isDateValueAcceptable(this._value)&&(this._emitChangeEvent(null,!0),this._setFormattedInputValue())}_handleInput(e){let t=this._getSanitizedDateString(e),i=this._coerceDateValue(t);this._masked&&this._adapter.emitInputEvent(n.events.INPUT,t),!m(i,this._value)&&this._isDateValueAcceptable(i)&&this._emitChangeEvent(i)}_onInputValueChanged(e){let t=this._getSanitizedDateString(e);if(this._masked&&t)return;let i=this._coerceDateValue(t);!m(i,this._value)&&this._isDateValueAcceptable(i)&&(this.value=i,this._emitChangeEvent(this._value))}_applyValue(){this._setFormattedInputValue(),this._open&&this._adapter.setCalendarValue(this._value)}get value(){let e=this._getTypedValue(this._value);return e?v(e)?new Date(e.getTime()):e:null}set value(e){this._value!==e&&(this._setValue(this._coerceDateValue(e)),this._isInitialized&&this._applyValue())}};var G="<template><slot></slot></template>",j=":host{display:block}:host([hidden]){display:none}",o=class extends B{static get observedAttributes(){return[...Object.values(O.observedAttributes),n.observedAttributes.VALUE]}constructor(){super(),V.define(P),C(this,G,j),this._foundation=new p(new l(this))}attributeChangedCallback(s,e,t){switch(s){case n.observedAttributes.VALUE:this.value=t;return}super.attributeChangedCallback(s,e,t)}};o=_([b({name:n.elementName,dependencies:[M,S,N,y]})],o);var U=class extends A{constructor(e){super(e)}_build(){let e=document.createElement(n.elementName);return this._attachTextField(e),e}getInputElement(){return this._textFieldDelegate.inputElement}getTextFieldElement(){return this._textFieldDelegate.element}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.masked?this._element.addEventListener(n.events.INPUT,t=>e(t.target.value)):this.getInputElement().addEventListener("input",t=>e(t.target.value))}onInput(e){this._element.masked?this._element.addEventListener(n.events.INPUT,t=>e(t.detail)):this._textFieldDelegate.inputElement.addEventListener("input",t=>e(t.target.value))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,a,c,h;let t={props:d({},(a=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:a.props),options:d({},(h=(c=this._config.options)==null?void 0:c.textFieldDelegateConfig)==null?void 0:h.options)};this._textFieldDelegate=new w(t),e.appendChild(this._textFieldDelegate.element)}};function Me(){E(o)}export{n as a,l as b,p as c,o as d,U as e,Me as f};
|
|
7
|
+
//# sourceMappingURL=chunk.OJ54J4L3.js.map
|