dap-design-system 0.62.3 → 0.62.4
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/dist/common/utils.d.ts +8 -0
- package/dist/common/utils.js +36 -31
- package/dist/common/utils.js.map +1 -1
- package/dist/components/combobox/comboboxBase.d.ts +8 -0
- package/dist/components/combobox/comboboxBase.js +64 -33
- package/dist/components/combobox/comboboxBase.js.map +1 -1
- package/dist/components/option-list/option-list.component.d.ts +2 -0
- package/dist/components/option-list/option-list.component.js +42 -39
- package/dist/components/option-list/option-list.component.js.map +1 -1
- package/dist/components/popup/popup-base-element.d.ts +6 -0
- package/dist/components/popup/popup-base-element.js +92 -63
- package/dist/components/popup/popup-base-element.js.map +1 -1
- package/dist/components/select/select.component.js +33 -30
- package/dist/components/select/select.component.js.map +1 -1
- package/dist/localization/locales/de.json.js +7 -7
- package/dist/localization/locales/en.json.js +6 -6
- package/dist/localization/locales/hu.json.js +1 -1
- package/dist/manifest/types/vue/index.d.ts +161 -159
- package/dist/manifest/vscode.html-custom-data.json +152 -147
- package/dist/manifest/web-types.json +386 -376
- package/dist/react/index.d.ts +4 -4
- package/dist/react-types.ts +4 -4
- package/dist/react.js +30 -30
- package/package.json +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option-list.component.js","sources":["../../../src/components/option-list/option-list.component.ts"],"sourcesContent":["import clsx from 'clsx'\nimport { PropertyValueMap, unsafeCSS } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { html, unsafeStatic } from 'lit/static-html.js'\n\nimport { scrollIntoContainer } from '@/common/utils'\nimport { DdsElement } from '@/internal/dds-hu-element'\nimport { SizedMixin } from '@/internal/mixin/sizedMixin'\n\nimport DapDSOptionItem from '../option-item/option-item.component'\nimport styles from './option-list.scss?inline'\n\n/**\n * `dap-ds-option-list`\n * @summary An option list is a list of selectable options.\n * @element dap-ds-option-list\n * @title - Option list\n *\n * @event {{ void }} dds-cancel - Fired when the escape key is pressed.\n * @event {{ option: DapDSOptionItem, value: string, index: number, text: string }} dds-option-change - Fired when the option list value changes.\n * @event {{ void }} dds-keydown - Fired when a key is pressed down.\n * @event {{ elements: DapDSOptionItem[] }} dds-list-changed - Fired when the available options list changes.\n *\n * @csspart base - The main option list container.\n * @csspart option-item - The option item of the option list.\n * @csspart popup-base - The base of the popup.\n * @csspart option-item-base - The base of the option item.\n * @csspart option-item-label - The label of the option item.\n * @csspart option-item-prefix - The prefix of the option item.\n * @csspart option-item-suffix - The suffix of the option item.\n *\n * @slot - The default slot for the options.\n */\nexport default class DapDSOptionList extends SizedMixin(DdsElement) {\n static tagName = 'dap-ds-option-list'\n\n static dependencies = {\n 'dap-ds-option-item': DapDSOptionItem,\n }\n\n /** The filter text of the option list */\n @property() filterText = ''\n\n /** The value of the option list */\n @property({ type: String, reflect: true }) value?: string\n\n /** The focused state of the option list. */\n @property({ type: Boolean }) focused = false\n\n /** Whether the option list is searchable */\n @property({ type: Boolean }) search = false\n\n /** The search mode of the option list. Default is `none` */\n @property() searchMode: 'none' | 'typehead' | 'autocomplete' | 'manual' =\n 'none'\n\n /**\n * @ignore\n */\n @property({ type: String }) searchOnValueSet = 'true'\n\n /** Whether the option list items are selectable, whether it shows the selected icon */\n @property({ type: String }) selectable = 'true'\n\n /**\n * @ignore\n */\n @property({ type: Array })\n public options?: any[]\n\n /**\n * @ignore\n */\n @property({ type: Boolean }) disableDelaySet = false\n\n queryTimeout: number | undefined\n queryString = ''\n firstLoad = true\n\n @state()\n private currentOption: any\n\n @state()\n public selectedIndex: number\n\n @state()\n private optionEls: DapDSOptionItem[] = []\n\n @state()\n private availableOptions: DapDSOptionItem[] = []\n\n get isAutoComplete() {\n return this.searchMode === 'autocomplete' || this.searchMode === 'manual'\n }\n\n static readonly styles = unsafeCSS(styles)\n\n protected firstUpdated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.firstUpdated(_changedProperties)\n\n this.setAttribute('role', 'listbox')\n }\n\n getAllOptions() {\n const mainSlot = this.shadowRoot?.querySelector('slot')\n const assignedElement = mainSlot?.assignedElements()[0]\n const embeddedSlot =\n assignedElement?.nodeName === 'SLOT'\n ? (\n mainSlot?.assignedElements()[0] as HTMLSlotElement\n ).assignedElements()\n : mainSlot?.assignedElements()\n\n if (!embeddedSlot) {\n return [...this.querySelectorAll<DapDSOptionItem>('dap-ds-option-item')]\n } else {\n return [...(embeddedSlot as DapDSOptionItem[])]\n }\n }\n\n private getAllRenderedOptions(): DapDSOptionItem[] {\n const ro =\n this.shadowRoot?.querySelectorAll<DapDSOptionItem>('dap-ds-option-item')\n return ro ? [...ro] : []\n }\n\n getAllAvailabeOptions() {\n return this.availableOptions\n }\n\n getActiveOption() {\n if (!this.currentOption) {\n return null\n }\n\n const activeOption = this.getAllRenderedOptions().find(\n el => el.value === this.currentOption.value,\n )\n\n return activeOption\n }\n\n protected updated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.updated(_changedProperties)\n\n if (\n _changedProperties.has('value') &&\n !_changedProperties.has('currentOption') &&\n this.searchOnValueSet === 'true'\n ) {\n const option = this.availableOptions.find(\n option => option.value === this.value,\n )\n\n if (option) {\n this.changeOption(option, _changedProperties.get('value'))\n\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n this.value,\n )\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n }\n\n if (\n _changedProperties.has('options') ||\n _changedProperties.has('optionEls')\n ) {\n this.availableOptions = this.options || this.optionEls\n this.emit('dds-list-changed', { elements: this.availableOptions })\n }\n }\n\n protected shouldUpdate(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): boolean {\n if (_changedProperties.has('filterText')) {\n if (\n this.filterText &&\n this.searchMode !== 'none' &&\n this.searchMode !== 'manual'\n ) {\n this.filterAvailableOptions()\n this.selectedIndex = 0\n this.setCurrentOption(this.availableOptions[0], false)\n this.emit('dds-list-changed', { elements: this.availableOptions })\n } else if (this.filterText && this.searchMode === 'manual') {\n if (this.selectedIndex === -1 && this.availableOptions.length > 0) {\n this.selectedIndex = 0\n this.setCurrentOption(this.availableOptions[0], false)\n }\n } else if (this.filterText && this.searchMode === 'none') {\n this.filterAvailableOptions()\n this.selectedIndex = -1\n this.setCurrentOption(null, false)\n this.setSelectedOption()\n this.emit('dds-list-changed', { elements: this.availableOptions })\n } else {\n this.availableOptions = this.options || this.optionEls\n this.selectedIndex = -1\n this.setCurrentOption(null, false)\n this.emit('dds-list-changed', { elements: this.availableOptions })\n }\n }\n\n return super.shouldUpdate(_changedProperties)\n }\n\n public filterAvailableOptions(): void {\n const valueLowerCase = this.filterText.toLowerCase()\n this.availableOptions = (this.options || this.optionEls).filter(item => {\n if (!item.disabled) {\n const itemTextLowerCase = item.optionText.toLowerCase()\n return itemTextLowerCase.startsWith(valueLowerCase)\n }\n })\n }\n\n attributeChangedCallback(name: string, oldValue: any, newValue: any) {\n super.attributeChangedCallback(name, oldValue, newValue)\n if (\n name === 'value' &&\n oldValue !== newValue &&\n this.searchOnValueSet === 'true'\n ) {\n if (newValue) {\n const option = this.availableOptions.find(el => el.value === newValue)\n\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n } else {\n this.setSelectedOption()\n this.selectionChanged()\n }\n }\n }\n\n public setOptionsFromSlottedItems(): void {\n const elements = this.getAllOptions()\n this.availableOptions = elements\n this.optionEls = elements\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n // Keydown only reaches the list while focus is inside it. Focus can arrive\n // via Tab (not captureFocus), so mark the list focused or every key is ignored.\n this.focused = true\n\n // Tab and Escape must always work so keyboard users can leave the list\n // (WCAG 2.1.2). Tab keeps its native behaviour; the host closes the popup.\n if (event.key === 'Tab' || event.key === 'Escape') {\n if (event.key === 'Escape') {\n event.preventDefault()\n this.emit('dds-cancel')\n }\n this.emit('dds-keydown', { key: event.key, code: event.code })\n return\n }\n\n event.preventDefault()\n\n this.handleKeyCodes(event.key, event.code)\n }\n\n private scrollToActiveOption(): void {\n if (!this.currentOption) {\n return\n }\n\n const activeOption = this.getAllRenderedOptions().find(\n el => el.value === this.currentOption.value,\n )\n\n if (activeOption) {\n // Scroll only within the list's own scroll container. A plain\n // scrollIntoView would also scroll every ancestor (modal body, page),\n // pushing the trigger out of the viewport and tripping the popup's\n // viewport auto-close so the dropdown snaps shut on open.\n scrollIntoContainer(activeOption)\n }\n }\n\n private handleNavigationKey(key: string): void {\n if (key === 'ArrowDown') {\n this.selectedIndex = this.findNearestEnabled(\n this.availableOptions,\n this.selectedIndex,\n 1,\n )\n } else if (key === 'ArrowUp') {\n const nearest = this.findNearestEnabled(\n this.availableOptions,\n this.selectedIndex,\n this.selectedIndex === -1 ? 1 : -1,\n )\n this.selectedIndex =\n nearest === this.availableOptions.length ? -1 : nearest\n } else if (key === 'Home') {\n this.selectedIndex = this.availableOptions[0]?.disabled\n ? this.findNearestEnabled(this.availableOptions, -1, 1)\n : 0\n } else if (key === 'End') {\n const nearest = this.findNearestEnabled(\n this.availableOptions,\n this.availableOptions.length,\n -1,\n )\n this.selectedIndex =\n nearest === this.availableOptions.length ? -1 : nearest\n }\n }\n\n private handleActionKey(key: string): void {\n if (key === 'Enter') {\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n this.selectionChanged(this.availableOptions[this.selectedIndex])\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n }\n\n private handleTypeheadKey(key: string): void {\n if (\n this.searchMode === 'typehead' &&\n (key?.length === 1 || key === 'Backspace')\n ) {\n this.buildQueryString(key)\n }\n }\n\n private handleKeyCodes(key: string, keyCode?: string) {\n if (!this.focused) {\n return\n }\n\n this.handleNavigationKey(key)\n this.handleActionKey(key)\n this.handleTypeheadKey(key)\n\n if (this.selectedIndex >= 0) {\n const option = this.availableOptions[this.selectedIndex]\n this.setCurrentOption(option)\n this.emit('dds-keydown', {\n code: keyCode,\n key,\n ...this.getEventDetails(option),\n })\n }\n }\n\n private getEventDetails(option?: DapDSOptionItem) {\n if (!option) {\n return undefined\n }\n\n let opt = option\n\n if (option.tagName !== 'DAP-DS-OPTION-ITEM') {\n opt = option.closest('dap-ds-option-item')!\n }\n\n return {\n opt,\n value: opt?.value,\n text: opt?.optionText,\n index: this.selectedIndex,\n }\n }\n\n private findNearestEnabled(\n allOptions: DapDSOptionItem[],\n current: number,\n step: number,\n ) {\n let nextIndex: number = current\n let nextOption: DapDSOptionItem\n\n do {\n nextIndex += step\n nextOption = allOptions[nextIndex]\n if (nextOption === undefined) {\n break\n }\n } while (nextOption?.disabled)\n\n return nextOption ? nextIndex : current\n }\n\n private findIndexByValue(\n allOptions: DapDSOptionItem[],\n value?: string,\n ): number {\n return allOptions.findIndex(option => option.value === value)\n }\n\n private clearItemFocusStates() {\n this.availableOptions.forEach(el => {\n el.focused = false\n el.tabIndex = -1\n })\n }\n\n // Only set the current option without selecting it, eg: focus\n private setCurrentOption(option?: DapDSOptionItem | null, setFocus = true) {\n this.clearItemFocusStates()\n\n if (option) {\n this.currentOption = option\n option.focused = true\n option.tabIndex = 0\n\n this.emit('dds-current-change', {\n ...this.getEventDetails(option),\n })\n\n if (setFocus) {\n this.setFocusedOption(option)\n } else {\n this.scrollToActiveOption()\n }\n } else {\n this.currentOption = null\n\n this.emit('dds-current-change', null)\n }\n }\n\n private setFocusedOption(option: DapDSOptionItem) {\n const renderedItem = this.getAllRenderedOptions().find(\n el => el.value === option.value,\n )\n\n if (renderedItem) {\n // preventScroll so native focus doesn't scroll ancestor containers (modal\n // body, page); scrollToActiveOption reveals it within the list instead.\n renderedItem.focus({ preventScroll: true })\n }\n }\n\n private setSelectedOption(option?: DapDSOptionItem | undefined) {\n this.availableOptions.forEach(el => (el.selected = false))\n\n if (option) {\n this.currentOption = option\n\n option.selected = true\n }\n }\n\n private selectionChanged(option?: DapDSOptionItem | undefined, value?: any) {\n const oldValue = value || this.value\n\n if (option) {\n if (option.value !== oldValue) {\n this.value = option.value\n }\n }\n }\n\n private changeOption(option: DapDSOptionItem, value?: any) {\n if (option && !option.disabled) {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n option.value,\n )\n\n this.setSelectedOption(option)\n this.setCurrentOption(option)\n this.selectionChanged(option, value)\n }\n }\n\n private readonly handleOptionClick = (event: MouseEvent) => {\n this.focused = true\n const option = event.target as DapDSOptionItem\n\n if (option && !option.disabled) {\n const isModifierKeyPressed = event.ctrlKey || event.metaKey\n const isAlreadySelected = option.selected\n\n if (isModifierKeyPressed && isAlreadySelected) {\n // Find the empty item (with \"empty\" attribute) to select automatically\n const emptyItem = this.availableOptions.find(opt =>\n opt.hasAttribute('empty'),\n )\n\n if (emptyItem) {\n // Select the empty item automatically\n this.setSelectedOption(emptyItem)\n this.setCurrentOption(emptyItem)\n this.value = emptyItem.value\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n emptyItem.value,\n )\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(emptyItem),\n })\n } else {\n // Fallback to original behavior if no empty item found\n this.setSelectedOption(undefined)\n this.setCurrentOption(null)\n this.value = undefined\n this.selectedIndex = -1\n\n this.emit('dds-option-deselect', {\n option: option,\n value: undefined,\n index: -1,\n text: option.optionText,\n })\n }\n\n return\n }\n\n this.setCurrentOption(option)\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n this.updateComplete.then(() => {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n this.value,\n )\n\n if (!this.disableDelaySet) {\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n })\n } else {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n getSearchString = (char: string) => {\n if (typeof this.queryTimeout === 'number') {\n window.clearTimeout(this.queryTimeout)\n }\n\n this.queryTimeout = window.setTimeout(() => {\n this.queryString = ''\n }, 500)\n\n this.queryString += char\n return this.queryString\n }\n\n buildQueryString = (char: string) => {\n const queryString = this.getSearchString(char)\n\n for (const option of this.availableOptions) {\n const label = option.optionText.toLowerCase()\n\n if (label.startsWith(queryString.toLowerCase())) {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n option.value,\n )\n this.setCurrentOption(option)\n break\n }\n }\n }\n\n private handleInitialFocus(): void {\n if (!this.value && this.selectedIndex < 0) {\n this.selectedIndex = 0\n } else {\n const index = this.value\n ? this.findIndexByValue(this.availableOptions, this.value)\n : this.selectedIndex\n\n if (index !== -1 && !this.isAutoComplete) {\n this.selectedIndex = index\n this.setCurrentOption(this.availableOptions[this.selectedIndex])\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n if (this.value) {\n this.selectionChanged(this.availableOptions[this.selectedIndex])\n }\n }\n }\n\n if (!this.selectedIndex) {\n this.setCurrentOption(this.availableOptions[0])\n this.setSelectedOption(this.availableOptions[0])\n }\n }\n\n private handleKeyFocus(key: string): void {\n if (this.isAutoComplete || this.searchMode === 'none') {\n this.handleKeyCodes(key)\n this.setCurrentOption(this.availableOptions[this.selectedIndex], false)\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n }\n\n if (this.searchMode === 'typehead') {\n this.buildQueryString(key)\n }\n }\n\n public captureFocus(key?: string): void {\n this.focused = true\n this.focus()\n\n if (!key) {\n this.handleInitialFocus()\n } else {\n this.handleKeyFocus(key)\n }\n\n // The popup constrains its scroll container's max-height via floating-ui one\n // animation frame after opening. At this point that constraint isn't applied\n // yet (clientHeight === scrollHeight), so the container isn't scrollable and\n // both native focus() scrolling and scrollIntoView are no-ops. Defer the\n // scroll to the next frame so the selected option is actually revealed.\n if (typeof requestAnimationFrame === 'function') {\n requestAnimationFrame(() => this.scrollToActiveOption())\n }\n }\n\n public removeFocus(): void {\n this.focused = false\n this.clearItemFocusStates()\n }\n\n private handleSlotChange() {\n const allOptions = this.getAllOptions()\n this.setOptionsFromSlottedItems()\n\n if (allOptions.length > 0 && this.searchOnValueSet === 'true') {\n const option = allOptions.find(el => el.value === this.value)\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n if (this.currentOption) {\n this.selectedIndex = this.findIndexByValue(allOptions, this.value)\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n } else if (allOptions.length > 0 && !this.search && !this.isAutoComplete) {\n const firstOption = allOptions.find(option => !option.disabled)\n this.selectedIndex = 0\n this.setCurrentOption(firstOption, false)\n\n this.emit('dds-current-change', {\n ...this.getEventDetails(firstOption),\n })\n } else if (allOptions.length > 0 && (this.search || this.isAutoComplete)) {\n const firstOption = allOptions.find(option => !option.disabled)\n\n if (\n !this.currentOption ||\n this.currentOption.value !== firstOption?.value\n ) {\n this.selectedIndex = 0\n this.setCurrentOption(firstOption, false)\n }\n }\n }\n\n render() {\n return html`<div\n part=\"base\"\n class=${clsx('option-list', {\n 'option-list--sm': this.size === 'sm',\n 'option-list--lg': this.size === 'lg',\n })}\n @keydown=${this.handleKeydown}\n @focus=${this.captureFocus}>\n ${this.availableOptions.map(\n (option, index) => html`\n <dap-ds-option-item\n size=${this.size}\n part=\"option-item\"\n exportparts=\"base: option-item-base, label: option-item-label, prefix: option-item-prefix, suffix: option-item-suffix\"\n ?disabled=${option.disabled}\n ?selected=${this.value === option.value}\n ?focused=${index === this.selectedIndex}\n label=${ifDefined(option.label)}\n role=\"option\"\n value=${option.value}\n tabIndex=${option.tabIndex}\n id=${option.id || `dap-ds-option-${option.value}`}\n data-testid=${ifDefined(option.dataset.testid || undefined)}\n selectable=${this.selectable}\n @click=${this.handleOptionClick}>\n ${unsafeStatic(option.innerHTML)}\n </dap-ds-option-item>\n `,\n )}\n <slot hidden @slotchange=${this.handleSlotChange}></slot>\n </div> `\n }\n}\n"],"names":["_DapDSOptionList","SizedMixin","DdsElement","event","option","isModifierKeyPressed","isAlreadySelected","emptyItem","opt","__spreadValues","char","queryString","_changedProperties","mainSlot","_a","assignedElement","embeddedSlot","ro","el","valueLowerCase","item","name","oldValue","newValue","elements","activeOption","scrollIntoContainer","key","nearest","keyCode","allOptions","current","step","nextIndex","nextOption","value","setFocus","renderedItem","index","firstOption","html","clsx","ifDefined","unsafeStatic","DapDSOptionItem","unsafeCSS","styles","DapDSOptionList","__decorateClass","property","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCqB,MAAAA,IAAA,MAAAA,UAAwBC,EAAWC,CAAU,EAAE;AAAA,EAApE,cAAA;AAAA,UAAA,GAAA,SAAA,GAQ2B,KAAA,aAAA,IAMc,KAAA,UAAA,IAGD,KAAA,SAAA,IAIpC,KAAA,aAAA,QAK6C,KAAA,mBAAA,QAGN,KAAA,aAAA,QAWM,KAAA,kBAAA,IAGjC,KAAA,cAAA,IACF,KAAA,YAAA,IASZ,KAAQ,YAA+B,CAAC,GAGxC,KAAQ,mBAAsC,CAAC,GA4Y9B,KAAA,oBAAoB,CAACC,MAAsB;AAC1D,WAAK,UAAU;AACf,YAAMC,IAASD,EAAM;AAEjB,UAAAC,KAAU,CAACA,EAAO,UAAU;AACxB,cAAAC,IAAuBF,EAAM,WAAWA,EAAM,SAC9CG,IAAoBF,EAAO;AAEjC,YAAIC,KAAwBC,GAAmB;AAEvC,gBAAAC,IAAY,KAAK,iBAAiB;AAAA,YAAK,CAAAC,MAC3CA,EAAI,aAAa,OAAO;AAAA,UAC1B;AAEA,UAAID,KAEF,KAAK,kBAAkBA,CAAS,GAChC,KAAK,iBAAiBA,CAAS,GAC/B,KAAK,QAAQA,EAAU,OACvB,KAAK,gBAAgB,KAAK;AAAA,YACxB,KAAK;AAAA,YACLA,EAAU;AAAA,UACZ,GAEA,KAAK,KAAK,qBAAqBE,EAAA,IAC1B,KAAK,gBAAgBF,CAAS,EAClC,MAGD,KAAK,kBAAkB,MAAS,GAChC,KAAK,iBAAiB,IAAI,GAC1B,KAAK,QAAQ,QACb,KAAK,gBAAgB,IAErB,KAAK,KAAK,uBAAuB;AAAA,YAC/B,QAAAH;AAAA,YACA,OAAO;AAAA,YACP,O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,YAAA;AAMgBC,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GA1BPF,EA0BS,WAAA,kBAAA;AAGAC,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GA7BPF,EA6BS,WAAA,YAAA;AAMrBC,EAAA;AAAA,EADNC,EAAS,EAAE,MAAM,MAAO,CAAA;AAAA,GAlCNF,EAmCZ,WAAA,SAAA;AAKsBC,EAAA;AAAA,EAA5BC,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GAxCRF,EAwCU,WAAA,iBAAA;AAOrBC,EAAA;AAAA,EADPE,EAAM;AAAA,GA9CYH,EA+CX,WAAA,eAAA;AAGDC,EAAA;AAAA,EADNE,EAAM;AAAA,GAjDYH,EAkDZ,WAAA,eAAA;AAGCC,EAAA;AAAA,EADPE,EAAM;AAAA,GApDYH,EAqDX,WAAA,WAAA;AAGAC,EAAA;AAAA,EADPE,EAAM;AAAA,GAvDYH,EAwDX,WAAA,kBAAA;"}
|
|
1
|
+
{"version":3,"file":"option-list.component.js","sources":["../../../src/components/option-list/option-list.component.ts"],"sourcesContent":["import clsx from 'clsx'\nimport { PropertyValueMap, unsafeCSS } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { html, unsafeStatic } from 'lit/static-html.js'\n\nimport { scrollIntoContainer } from '@/common/utils'\nimport { DdsElement } from '@/internal/dds-hu-element'\nimport { SizedMixin } from '@/internal/mixin/sizedMixin'\n\nimport DapDSOptionItem from '../option-item/option-item.component'\nimport styles from './option-list.scss?inline'\n\n/**\n * `dap-ds-option-list`\n * @summary An option list is a list of selectable options.\n * @element dap-ds-option-list\n * @title - Option list\n *\n * @event {{ void }} dds-cancel - Fired when the escape key is pressed.\n * @event {{ option: DapDSOptionItem, value: string, index: number, text: string }} dds-option-change - Fired when the option list value changes.\n * @event {{ void }} dds-keydown - Fired when a key is pressed down.\n * @event {{ elements: DapDSOptionItem[] }} dds-list-changed - Fired when the available options list changes.\n *\n * @csspart base - The main option list container.\n * @csspart option-item - The option item of the option list.\n * @csspart popup-base - The base of the popup.\n * @csspart option-item-base - The base of the option item.\n * @csspart option-item-label - The label of the option item.\n * @csspart option-item-prefix - The prefix of the option item.\n * @csspart option-item-suffix - The suffix of the option item.\n *\n * @slot - The default slot for the options.\n */\nexport default class DapDSOptionList extends SizedMixin(DdsElement) {\n static tagName = 'dap-ds-option-list'\n\n static dependencies = {\n 'dap-ds-option-item': DapDSOptionItem,\n }\n\n /** The filter text of the option list */\n @property() filterText = ''\n\n /** The value of the option list */\n @property({ type: String, reflect: true }) value?: string\n\n /** The focused state of the option list. */\n @property({ type: Boolean }) focused = false\n\n /** Whether the option list is searchable */\n @property({ type: Boolean }) search = false\n\n /** The search mode of the option list. Default is `none` */\n @property() searchMode: 'none' | 'typehead' | 'autocomplete' | 'manual' =\n 'none'\n\n /**\n * @ignore\n */\n @property({ type: String }) searchOnValueSet = 'true'\n\n /** Whether the option list items are selectable, whether it shows the selected icon */\n @property({ type: String }) selectable = 'true'\n\n /**\n * @ignore\n */\n @property({ type: Array })\n public options?: any[]\n\n /**\n * @ignore\n */\n @property({ type: Boolean }) disableDelaySet = false\n\n /** Whether multiple options can be selected; exposed as aria-multiselectable on the listbox. */\n @property({ type: Boolean }) multiselectable = false\n\n queryTimeout: number | undefined\n queryString = ''\n firstLoad = true\n\n @state()\n private currentOption: any\n\n @state()\n public selectedIndex: number\n\n @state()\n private optionEls: DapDSOptionItem[] = []\n\n @state()\n private availableOptions: DapDSOptionItem[] = []\n\n get isAutoComplete() {\n return this.searchMode === 'autocomplete' || this.searchMode === 'manual'\n }\n\n static readonly styles = unsafeCSS(styles)\n\n protected firstUpdated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.firstUpdated(_changedProperties)\n\n this.setAttribute('role', 'listbox')\n }\n\n getAllOptions() {\n const mainSlot = this.shadowRoot?.querySelector('slot')\n const assignedElement = mainSlot?.assignedElements()[0]\n const embeddedSlot =\n assignedElement?.nodeName === 'SLOT'\n ? (\n mainSlot?.assignedElements()[0] as HTMLSlotElement\n ).assignedElements()\n : mainSlot?.assignedElements()\n\n if (!embeddedSlot) {\n return [...this.querySelectorAll<DapDSOptionItem>('dap-ds-option-item')]\n } else {\n return [...(embeddedSlot as DapDSOptionItem[])]\n }\n }\n\n private getAllRenderedOptions(): DapDSOptionItem[] {\n const ro =\n this.shadowRoot?.querySelectorAll<DapDSOptionItem>('dap-ds-option-item')\n return ro ? [...ro] : []\n }\n\n getAllAvailabeOptions() {\n return this.availableOptions\n }\n\n getActiveOption() {\n if (!this.currentOption) {\n return null\n }\n\n const activeOption = this.getAllRenderedOptions().find(\n el => el.value === this.currentOption.value,\n )\n\n return activeOption\n }\n\n protected updated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.updated(_changedProperties)\n\n if (_changedProperties.has('multiselectable')) {\n if (this.multiselectable) {\n this.setAttribute('aria-multiselectable', 'true')\n } else {\n this.removeAttribute('aria-multiselectable')\n }\n }\n\n if (\n _changedProperties.has('value') &&\n !_changedProperties.has('currentOption') &&\n this.searchOnValueSet === 'true'\n ) {\n const option = this.availableOptions.find(\n option => option.value === this.value,\n )\n\n if (option) {\n this.changeOption(option, _changedProperties.get('value'))\n\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n this.value,\n )\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n }\n\n if (\n _changedProperties.has('options') ||\n _changedProperties.has('optionEls')\n ) {\n this.availableOptions = this.options || this.optionEls\n this.emit('dds-list-changed', { elements: this.availableOptions })\n }\n }\n\n protected shouldUpdate(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): boolean {\n if (_changedProperties.has('filterText')) {\n if (\n this.filterText &&\n this.searchMode !== 'none' &&\n this.searchMode !== 'manual'\n ) {\n this.filterAvailableOptions()\n this.selectedIndex = 0\n this.setCurrentOption(this.availableOptions[0], false)\n this.emit('dds-list-changed', { elements: this.availableOptions })\n } else if (this.filterText && this.searchMode === 'manual') {\n if (this.selectedIndex === -1 && this.availableOptions.length > 0) {\n this.selectedIndex = 0\n this.setCurrentOption(this.availableOptions[0], false)\n }\n } else if (this.filterText && this.searchMode === 'none') {\n this.filterAvailableOptions()\n this.selectedIndex = -1\n this.setCurrentOption(null, false)\n this.setSelectedOption()\n this.emit('dds-list-changed', { elements: this.availableOptions })\n } else {\n this.availableOptions = this.options || this.optionEls\n this.selectedIndex = -1\n this.setCurrentOption(null, false)\n this.emit('dds-list-changed', { elements: this.availableOptions })\n }\n }\n\n return super.shouldUpdate(_changedProperties)\n }\n\n public filterAvailableOptions(): void {\n const valueLowerCase = this.filterText.toLowerCase()\n this.availableOptions = (this.options || this.optionEls).filter(item => {\n if (!item.disabled) {\n const itemTextLowerCase = item.optionText.toLowerCase()\n return itemTextLowerCase.startsWith(valueLowerCase)\n }\n })\n }\n\n attributeChangedCallback(name: string, oldValue: any, newValue: any) {\n super.attributeChangedCallback(name, oldValue, newValue)\n if (\n name === 'value' &&\n oldValue !== newValue &&\n this.searchOnValueSet === 'true'\n ) {\n if (newValue) {\n const option = this.availableOptions.find(el => el.value === newValue)\n\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n } else {\n this.setSelectedOption()\n this.selectionChanged()\n }\n }\n }\n\n public setOptionsFromSlottedItems(): void {\n const elements = this.getAllOptions()\n this.availableOptions = elements\n this.optionEls = elements\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n // Keydown only reaches the list while focus is inside it. Focus can arrive\n // via Tab (not captureFocus), so mark the list focused or every key is ignored.\n this.focused = true\n\n // Tab and Escape must always work so keyboard users can leave the list\n // (WCAG 2.1.2). Tab keeps its native behaviour; the host closes the popup.\n if (event.key === 'Tab' || event.key === 'Escape') {\n if (event.key === 'Escape') {\n event.preventDefault()\n this.emit('dds-cancel')\n }\n this.emit('dds-keydown', { key: event.key, code: event.code })\n return\n }\n\n event.preventDefault()\n\n this.handleKeyCodes(event.key, event.code)\n }\n\n private scrollToActiveOption(): void {\n if (!this.currentOption) {\n return\n }\n\n const activeOption = this.getAllRenderedOptions().find(\n el => el.value === this.currentOption.value,\n )\n\n if (activeOption) {\n // Scroll only within the list's own scroll container. A plain\n // scrollIntoView would also scroll every ancestor (modal body, page),\n // pushing the trigger out of the viewport and tripping the popup's\n // viewport auto-close so the dropdown snaps shut on open.\n scrollIntoContainer(activeOption)\n }\n }\n\n private handleNavigationKey(key: string): void {\n if (key === 'ArrowDown') {\n this.selectedIndex = this.findNearestEnabled(\n this.availableOptions,\n this.selectedIndex,\n 1,\n )\n } else if (key === 'ArrowUp') {\n const nearest = this.findNearestEnabled(\n this.availableOptions,\n this.selectedIndex,\n this.selectedIndex === -1 ? 1 : -1,\n )\n this.selectedIndex =\n nearest === this.availableOptions.length ? -1 : nearest\n } else if (key === 'Home') {\n this.selectedIndex = this.availableOptions[0]?.disabled\n ? this.findNearestEnabled(this.availableOptions, -1, 1)\n : 0\n } else if (key === 'End') {\n const nearest = this.findNearestEnabled(\n this.availableOptions,\n this.availableOptions.length,\n -1,\n )\n this.selectedIndex =\n nearest === this.availableOptions.length ? -1 : nearest\n }\n }\n\n private handleActionKey(key: string): void {\n if (key === 'Enter') {\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n this.selectionChanged(this.availableOptions[this.selectedIndex])\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n }\n\n private handleTypeheadKey(key: string): void {\n if (\n this.searchMode === 'typehead' &&\n (key?.length === 1 || key === 'Backspace')\n ) {\n this.buildQueryString(key)\n }\n }\n\n private handleKeyCodes(key: string, keyCode?: string) {\n if (!this.focused) {\n return\n }\n\n this.handleNavigationKey(key)\n this.handleActionKey(key)\n this.handleTypeheadKey(key)\n\n if (this.selectedIndex >= 0) {\n const option = this.availableOptions[this.selectedIndex]\n this.setCurrentOption(option)\n this.emit('dds-keydown', {\n code: keyCode,\n key,\n ...this.getEventDetails(option),\n })\n }\n }\n\n private getEventDetails(option?: DapDSOptionItem) {\n if (!option) {\n return undefined\n }\n\n let opt = option\n\n if (option.tagName !== 'DAP-DS-OPTION-ITEM') {\n opt = option.closest('dap-ds-option-item')!\n }\n\n return {\n opt,\n value: opt?.value,\n text: opt?.optionText,\n index: this.selectedIndex,\n }\n }\n\n private findNearestEnabled(\n allOptions: DapDSOptionItem[],\n current: number,\n step: number,\n ) {\n let nextIndex: number = current\n let nextOption: DapDSOptionItem\n\n do {\n nextIndex += step\n nextOption = allOptions[nextIndex]\n if (nextOption === undefined) {\n break\n }\n } while (nextOption?.disabled)\n\n return nextOption ? nextIndex : current\n }\n\n private findIndexByValue(\n allOptions: DapDSOptionItem[],\n value?: string,\n ): number {\n return allOptions.findIndex(option => option.value === value)\n }\n\n private clearItemFocusStates() {\n this.availableOptions.forEach(el => {\n el.focused = false\n el.tabIndex = -1\n })\n }\n\n // Only set the current option without selecting it, eg: focus\n private setCurrentOption(option?: DapDSOptionItem | null, setFocus = true) {\n this.clearItemFocusStates()\n\n if (option) {\n this.currentOption = option\n option.focused = true\n option.tabIndex = 0\n\n this.emit('dds-current-change', {\n ...this.getEventDetails(option),\n })\n\n if (setFocus) {\n this.setFocusedOption(option)\n } else {\n this.scrollToActiveOption()\n }\n } else {\n this.currentOption = null\n\n this.emit('dds-current-change', null)\n }\n }\n\n private setFocusedOption(option: DapDSOptionItem) {\n const renderedItem = this.getAllRenderedOptions().find(\n el => el.value === option.value,\n )\n\n if (renderedItem) {\n // preventScroll so native focus doesn't scroll ancestor containers (modal\n // body, page); scrollToActiveOption reveals it within the list instead.\n renderedItem.focus({ preventScroll: true })\n }\n }\n\n private setSelectedOption(option?: DapDSOptionItem | undefined) {\n this.availableOptions.forEach(el => (el.selected = false))\n\n if (option) {\n this.currentOption = option\n\n option.selected = true\n }\n }\n\n private selectionChanged(option?: DapDSOptionItem | undefined, value?: any) {\n const oldValue = value || this.value\n\n if (option) {\n if (option.value !== oldValue) {\n this.value = option.value\n }\n }\n }\n\n private changeOption(option: DapDSOptionItem, value?: any) {\n if (option && !option.disabled) {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n option.value,\n )\n\n this.setSelectedOption(option)\n this.setCurrentOption(option)\n this.selectionChanged(option, value)\n }\n }\n\n private readonly handleOptionClick = (event: MouseEvent) => {\n this.focused = true\n const option = event.target as DapDSOptionItem\n\n if (option && !option.disabled) {\n const isModifierKeyPressed = event.ctrlKey || event.metaKey\n const isAlreadySelected = option.selected\n\n if (isModifierKeyPressed && isAlreadySelected) {\n // Find the empty item (with \"empty\" attribute) to select automatically\n const emptyItem = this.availableOptions.find(opt =>\n opt.hasAttribute('empty'),\n )\n\n if (emptyItem) {\n // Select the empty item automatically\n this.setSelectedOption(emptyItem)\n this.setCurrentOption(emptyItem)\n this.value = emptyItem.value\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n emptyItem.value,\n )\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(emptyItem),\n })\n } else {\n // Fallback to original behavior if no empty item found\n this.setSelectedOption(undefined)\n this.setCurrentOption(null)\n this.value = undefined\n this.selectedIndex = -1\n\n this.emit('dds-option-deselect', {\n option: option,\n value: undefined,\n index: -1,\n text: option.optionText,\n })\n }\n\n return\n }\n\n this.setCurrentOption(option)\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n this.updateComplete.then(() => {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n this.value,\n )\n\n if (!this.disableDelaySet) {\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n })\n } else {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n getSearchString = (char: string) => {\n if (typeof this.queryTimeout === 'number') {\n window.clearTimeout(this.queryTimeout)\n }\n\n this.queryTimeout = window.setTimeout(() => {\n this.queryString = ''\n }, 500)\n\n this.queryString += char\n return this.queryString\n }\n\n buildQueryString = (char: string) => {\n const queryString = this.getSearchString(char)\n\n for (const option of this.availableOptions) {\n const label = option.optionText.toLowerCase()\n\n if (label.startsWith(queryString.toLowerCase())) {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n option.value,\n )\n this.setCurrentOption(option)\n break\n }\n }\n }\n\n private handleInitialFocus(): void {\n if (!this.value && this.selectedIndex < 0) {\n this.selectedIndex = 0\n } else {\n const index = this.value\n ? this.findIndexByValue(this.availableOptions, this.value)\n : this.selectedIndex\n\n if (index !== -1 && !this.isAutoComplete) {\n this.selectedIndex = index\n this.setCurrentOption(this.availableOptions[this.selectedIndex])\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n if (this.value) {\n this.selectionChanged(this.availableOptions[this.selectedIndex])\n }\n }\n }\n\n if (!this.selectedIndex) {\n this.setCurrentOption(this.availableOptions[0])\n this.setSelectedOption(this.availableOptions[0])\n }\n }\n\n private handleKeyFocus(key: string): void {\n if (this.isAutoComplete || this.searchMode === 'none') {\n this.handleKeyCodes(key)\n this.setCurrentOption(this.availableOptions[this.selectedIndex], false)\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n }\n\n if (this.searchMode === 'typehead') {\n this.buildQueryString(key)\n }\n }\n\n public captureFocus(key?: string): void {\n this.focused = true\n this.focus()\n\n if (!key) {\n this.handleInitialFocus()\n } else {\n this.handleKeyFocus(key)\n }\n\n // The popup constrains its scroll container's max-height via floating-ui one\n // animation frame after opening. At this point that constraint isn't applied\n // yet (clientHeight === scrollHeight), so the container isn't scrollable and\n // both native focus() scrolling and scrollIntoView are no-ops. Defer the\n // scroll to the next frame so the selected option is actually revealed.\n if (typeof requestAnimationFrame === 'function') {\n requestAnimationFrame(() => this.scrollToActiveOption())\n }\n }\n\n public removeFocus(): void {\n this.focused = false\n this.clearItemFocusStates()\n }\n\n private handleSlotChange() {\n const allOptions = this.getAllOptions()\n this.setOptionsFromSlottedItems()\n\n if (allOptions.length > 0 && this.searchOnValueSet === 'true') {\n const option = allOptions.find(el => el.value === this.value)\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n if (this.currentOption) {\n this.selectedIndex = this.findIndexByValue(allOptions, this.value)\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n } else if (allOptions.length > 0 && !this.search && !this.isAutoComplete) {\n const firstOption = allOptions.find(option => !option.disabled)\n this.selectedIndex = 0\n this.setCurrentOption(firstOption, false)\n\n this.emit('dds-current-change', {\n ...this.getEventDetails(firstOption),\n })\n } else if (allOptions.length > 0 && (this.search || this.isAutoComplete)) {\n const firstOption = allOptions.find(option => !option.disabled)\n\n if (\n !this.currentOption ||\n this.currentOption.value !== firstOption?.value\n ) {\n this.selectedIndex = 0\n this.setCurrentOption(firstOption, false)\n }\n }\n }\n\n render() {\n return html`<div\n part=\"base\"\n class=${clsx('option-list', {\n 'option-list--sm': this.size === 'sm',\n 'option-list--lg': this.size === 'lg',\n })}\n @keydown=${this.handleKeydown}\n @focus=${this.captureFocus}>\n ${this.availableOptions.map(\n (option, index) => html`\n <dap-ds-option-item\n size=${this.size}\n part=\"option-item\"\n exportparts=\"base: option-item-base, label: option-item-label, prefix: option-item-prefix, suffix: option-item-suffix\"\n ?disabled=${option.disabled}\n ?selected=${this.value === option.value}\n ?focused=${index === this.selectedIndex}\n label=${ifDefined(option.label)}\n role=\"option\"\n value=${option.value}\n tabIndex=${option.tabIndex}\n id=${option.id || `dap-ds-option-${option.value}`}\n data-testid=${ifDefined(option.dataset.testid || undefined)}\n selectable=${this.selectable}\n @click=${this.handleOptionClick}>\n ${unsafeStatic(option.innerHTML)}\n </dap-ds-option-item>\n `,\n )}\n <slot hidden @slotchange=${this.handleSlotChange}></slot>\n </div> `\n }\n}\n"],"names":["_DapDSOptionList","SizedMixin","DdsElement","event","option","isModifierKeyPressed","isAlreadySelected","emptyItem","opt","__spreadValues","char","queryString","_changedProperties","mainSlot","_a","assignedElement","embeddedSlot","ro","el","valueLowerCase","item","name","oldValue","newValue","elements","activeOption","scrollIntoContainer","key","nearest","keyCode","allOptions","current","step","nextIndex","nextOption","value","setFocus","renderedItem","index","firstOption","html","clsx","ifDefined","unsafeStatic","DapDSOptionItem","unsafeCSS","styles","DapDSOptionList","__decorateClass","property","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCqB,MAAAA,IAAA,MAAAA,UAAwBC,EAAWC,CAAU,EAAE;AAAA,EAApE,cAAA;AAAA,UAAA,GAAA,SAAA,GAQ2B,KAAA,aAAA,IAMc,KAAA,UAAA,IAGD,KAAA,SAAA,IAIpC,KAAA,aAAA,QAK6C,KAAA,mBAAA,QAGN,KAAA,aAAA,QAWM,KAAA,kBAAA,IAGA,KAAA,kBAAA,IAGjC,KAAA,cAAA,IACF,KAAA,YAAA,IASZ,KAAQ,YAA+B,CAAC,GAGxC,KAAQ,mBAAsC,CAAC,GAoZ9B,KAAA,oBAAoB,CAACC,MAAsB;AAC1D,WAAK,UAAU;AACf,YAAMC,IAASD,EAAM;AAEjB,UAAAC,KAAU,CAACA,EAAO,UAAU;AACxB,cAAAC,IAAuBF,EAAM,WAAWA,EAAM,SAC9CG,IAAoBF,EAAO;AAEjC,YAAIC,KAAwBC,GAAmB;AAEvC,gBAAAC,IAAY,KAAK,iBAAiB;AAAA,YAAK,CAAAC,MAC3CA,EAAI,aAAa,OAAO;AAAA,UAC1B;AAEA,UAAID,KAEF,KAAK,kBAAkBA,CAAS,GAChC,KAAK,iBAAiBA,CAAS,GAC/B,KAAK,QAAQA,EAAU,OACvB,KAAK,gBAAgB,KAAK;AAAA,YACxB,KAAK;AAAA,YACLA,EAAU;AAAA,UACZ,GAEA,KAAK,KAAK,qBAAqBE,EAAA,IAC1B,KAAK,gBAAgBF,CAAS,EAClC,MAGD,KAAK,kBAAkB,MAAS,GAChC,KAAK,iBAAiB,IAAI,GAC1B,KAAK,QAAQ,QACb,KAAK,gBAAgB,IAErB,KAAK,KAAK,uBAAuB;AAA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AAGAC,EAAA;AAAA,EAA5BC,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GAjBRF,EAiBU,WAAA,QAAA;AAGjBC,EAAA;AAAA,EAAXC,EAAS;AAAA,GApBSF,EAoBP,WAAA,YAAA;AAMgBC,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GA1BPF,EA0BS,WAAA,kBAAA;AAGAC,EAAA;AAAA,EAA3BC,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GA7BPF,EA6BS,WAAA,YAAA;AAMrBC,EAAA;AAAA,EADNC,EAAS,EAAE,MAAM,MAAO,CAAA;AAAA,GAlCNF,EAmCZ,WAAA,SAAA;AAKsBC,EAAA;AAAA,EAA5BC,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GAxCRF,EAwCU,WAAA,iBAAA;AAGAC,EAAA;AAAA,EAA5BC,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GA3CRF,EA2CU,WAAA,iBAAA;AAOrBC,EAAA;AAAA,EADPE,EAAM;AAAA,GAjDYH,EAkDX,WAAA,eAAA;AAGDC,EAAA;AAAA,EADNE,EAAM;AAAA,GApDYH,EAqDZ,WAAA,eAAA;AAGCC,EAAA;AAAA,EADPE,EAAM;AAAA,GAvDYH,EAwDX,WAAA,WAAA;AAGAC,EAAA;AAAA,EADPE,EAAM;AAAA,GA1DYH,EA2DX,WAAA,kBAAA;"}
|
|
@@ -42,6 +42,12 @@ export default class PopupBaseElement extends PopupBaseElement_base {
|
|
|
42
42
|
disableViewportAutoClose: boolean;
|
|
43
43
|
connectedCallback(): Promise<void>;
|
|
44
44
|
protected firstUpdated(changedProps: Map<string, unknown>): void;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the trigger can carry aria-expanded. Role-less wrappers (e.g. the
|
|
47
|
+
* combobox/datepicker field frame) expose state on their own inner control.
|
|
48
|
+
*/
|
|
49
|
+
private triggerSupportsExpanded;
|
|
50
|
+
private syncTriggerAria;
|
|
45
51
|
updated(changedProps: Map<string, unknown>): Promise<void>;
|
|
46
52
|
_handleTriggerSlotChange(e?: Event | undefined): Promise<void>;
|
|
47
53
|
_handleTriggerSlotChangeCallback(_e?: Event): void;
|
|
@@ -1,60 +1,89 @@
|
|
|
1
1
|
var O = Object.getPrototypeOf;
|
|
2
|
-
var
|
|
3
|
-
var y = (
|
|
4
|
-
var
|
|
5
|
-
var
|
|
2
|
+
var $ = Reflect.get;
|
|
3
|
+
var y = (l, t, e) => $(O(l), e, t);
|
|
4
|
+
var g = (l, t, e) => new Promise((u, n) => {
|
|
5
|
+
var a = (s) => {
|
|
6
6
|
try {
|
|
7
|
-
|
|
8
|
-
} catch (
|
|
9
|
-
p
|
|
7
|
+
d(e.next(s));
|
|
8
|
+
} catch (p) {
|
|
9
|
+
n(p);
|
|
10
10
|
}
|
|
11
|
-
},
|
|
11
|
+
}, h = (s) => {
|
|
12
12
|
try {
|
|
13
|
-
|
|
14
|
-
} catch (
|
|
15
|
-
p
|
|
13
|
+
d(e.throw(s));
|
|
14
|
+
} catch (p) {
|
|
15
|
+
n(p);
|
|
16
16
|
}
|
|
17
|
-
},
|
|
18
|
-
|
|
17
|
+
}, d = (s) => s.done ? u(s.value) : Promise.resolve(s.value).then(a, h);
|
|
18
|
+
d((e = e.apply(l, t)).next());
|
|
19
19
|
});
|
|
20
|
-
import { autoUpdate as
|
|
21
|
-
import { clsx as
|
|
20
|
+
import { autoUpdate as U, computePosition as W, offset as H, flip as N, shift as M, size as k, arrow as B } from "../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
21
|
+
import { clsx as S } from "../../node_modules/clsx/dist/clsx.js";
|
|
22
22
|
import "../../node_modules/@lit/reactive-element/reactive-element.js";
|
|
23
23
|
import "../../node_modules/lit-html/lit-html.js";
|
|
24
24
|
import "../../node_modules/lit-element/lit-element.js";
|
|
25
25
|
import { property as o } from "../../node_modules/@lit/reactive-element/decorators/property.js";
|
|
26
|
-
import { query as
|
|
27
|
-
import { html as
|
|
28
|
-
import { SizedMixin as
|
|
29
|
-
import { DdsElement as
|
|
30
|
-
import
|
|
31
|
-
import { unsafeCSS as
|
|
32
|
-
var
|
|
33
|
-
for (var
|
|
34
|
-
(
|
|
35
|
-
return
|
|
26
|
+
import { query as A } from "../../node_modules/@lit/reactive-element/decorators/query.js";
|
|
27
|
+
import { html as b } from "../../node_modules/lit-html/static.js";
|
|
28
|
+
import { SizedMixin as P } from "../../internal/mixin/sizedMixin.js";
|
|
29
|
+
import { DdsElement as L } from "../../internal/dds-hu-element.js";
|
|
30
|
+
import V from "./popup.scss.js";
|
|
31
|
+
import { unsafeCSS as q } from "../../node_modules/@lit/reactive-element/css-tag.js";
|
|
32
|
+
var D = Object.defineProperty, r = (l, t, e, u) => {
|
|
33
|
+
for (var n = void 0, a = l.length - 1, h; a >= 0; a--)
|
|
34
|
+
(h = l[a]) && (n = h(t, e, n) || n);
|
|
35
|
+
return n && D(t, e, n), n;
|
|
36
36
|
};
|
|
37
|
-
const
|
|
37
|
+
const I = /* @__PURE__ */ new Set([
|
|
38
|
+
"application",
|
|
39
|
+
"button",
|
|
40
|
+
"checkbox",
|
|
41
|
+
"columnheader",
|
|
42
|
+
"combobox",
|
|
43
|
+
"gridcell",
|
|
44
|
+
"link",
|
|
45
|
+
"menuitem",
|
|
46
|
+
"row",
|
|
47
|
+
"rowheader",
|
|
48
|
+
"tab",
|
|
49
|
+
"treeitem"
|
|
50
|
+
]), R = /* @__PURE__ */ new Set([
|
|
51
|
+
"button",
|
|
52
|
+
"checkbox",
|
|
53
|
+
"image",
|
|
54
|
+
"reset",
|
|
55
|
+
"submit"
|
|
56
|
+
]), c = class c extends P(L) {
|
|
38
57
|
constructor() {
|
|
39
58
|
super(...arguments), this.triggerElement = null, this.intersectionObserver = null, this.disabled = !1, this.opened = !1, this.placement = "bottom", this.floatingStrategy = "absolute", this.offset = 0, this.maxHeight = 250, this.maxWidth = "auto", this.disableViewportAutoClose = !1;
|
|
40
59
|
}
|
|
41
60
|
connectedCallback() {
|
|
42
|
-
return
|
|
61
|
+
return g(this, null, function* () {
|
|
43
62
|
y(c.prototype, this, "connectedCallback").call(this), yield this.updateComplete, this.startUpdate();
|
|
44
63
|
});
|
|
45
64
|
}
|
|
46
65
|
firstUpdated(t) {
|
|
47
|
-
|
|
48
|
-
|
|
66
|
+
super.firstUpdated(t), this.syncTriggerAria();
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Whether the trigger can carry aria-expanded. Role-less wrappers (e.g. the
|
|
70
|
+
* combobox/datepicker field frame) expose state on their own inner control.
|
|
71
|
+
*/
|
|
72
|
+
triggerSupportsExpanded(t) {
|
|
73
|
+
const e = t.getAttribute("role");
|
|
74
|
+
return e ? I.has(e) : t.tagName === "BUTTON" ? !0 : t.tagName === "A" ? t.hasAttribute("href") : t.tagName === "INPUT" ? R.has(t.type) : !1;
|
|
75
|
+
}
|
|
76
|
+
syncTriggerAria() {
|
|
77
|
+
const t = this.triggerElement;
|
|
78
|
+
!t || !this.triggerSupportsExpanded(t) || (t.hasAttribute("aria-controls") || t.setAttribute("aria-controls", "popup"), t.setAttribute("aria-expanded", String(!!this.opened)));
|
|
49
79
|
}
|
|
50
80
|
updated(t) {
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
y(c.prototype, this, "updated").call(this, t), t.has("opened") && (this.opened ? (this.startUpdate(), (e = this.triggerElement) == null || e.setAttribute("aria-expanded", "true"), this.emit("dds-opened")) : (this.stopUpdate(), (n = this.triggerElement) == null || n.setAttribute("aria-expanded", "false"), this.emit("dds-closed"))), t.has("anchor") && this._handleTriggerSlotChange(), this.opened && (yield this.updateComplete, this.updatePosition());
|
|
81
|
+
return g(this, null, function* () {
|
|
82
|
+
y(c.prototype, this, "updated").call(this, t), t.has("opened") && (this.opened ? (this.startUpdate(), this.syncTriggerAria(), this.emit("dds-opened")) : (this.stopUpdate(), this.syncTriggerAria(), this.emit("dds-closed"))), t.has("anchor") && this._handleTriggerSlotChange(), this.opened && (yield this.updateComplete, this.updatePosition());
|
|
54
83
|
});
|
|
55
84
|
}
|
|
56
85
|
_handleTriggerSlotChange(t) {
|
|
57
|
-
return
|
|
86
|
+
return g(this, null, function* () {
|
|
58
87
|
var e;
|
|
59
88
|
this._handleTriggerSlotChangeCallback(t), yield this.stopUpdate(), this.triggerElement = this.querySelector(
|
|
60
89
|
':scope > [slot="trigger"]'
|
|
@@ -76,12 +105,12 @@ const c = class c extends B(j) {
|
|
|
76
105
|
e[0] && !e[0].isIntersecting && this.opened && !this.disableViewportAutoClose && (this.opened = !1, this.emit("dds-close"));
|
|
77
106
|
},
|
|
78
107
|
{ threshold: 0 }
|
|
79
|
-
), this.intersectionObserver.observe(this.triggerElement), this.cleanup =
|
|
108
|
+
), this.intersectionObserver.observe(this.triggerElement), this.cleanup = U(this.triggerElement, this.popup, () => {
|
|
80
109
|
this.updatePosition();
|
|
81
110
|
}));
|
|
82
111
|
}
|
|
83
112
|
stopUpdate() {
|
|
84
|
-
return
|
|
113
|
+
return g(this, null, function* () {
|
|
85
114
|
return new Promise((t) => {
|
|
86
115
|
this.intersectionObserver && (this.intersectionObserver.disconnect(), this.intersectionObserver = null), this.cleanup ? (this.cleanup(), this.cleanup = void 0, requestAnimationFrame(() => t())) : t();
|
|
87
116
|
});
|
|
@@ -91,8 +120,8 @@ const c = class c extends B(j) {
|
|
|
91
120
|
super.disconnectedCallback(), this.intersectionObserver && (this.intersectionObserver.disconnect(), this.intersectionObserver = null), this.stopUpdate();
|
|
92
121
|
}
|
|
93
122
|
updatePosition() {
|
|
94
|
-
return
|
|
95
|
-
var
|
|
123
|
+
return g(this, null, function* () {
|
|
124
|
+
var d;
|
|
96
125
|
if (this.disabled || !this.triggerElement)
|
|
97
126
|
return;
|
|
98
127
|
const t = this.triggerElement.getBoundingClientRect();
|
|
@@ -100,43 +129,43 @@ const c = class c extends B(j) {
|
|
|
100
129
|
this.opened && !this.disableViewportAutoClose && (this.opened = !1, this.emit("dds-close"));
|
|
101
130
|
return;
|
|
102
131
|
}
|
|
103
|
-
const { x:
|
|
132
|
+
const { x: u, y: n, placement: a, middlewareData: h } = yield W(
|
|
104
133
|
this.triggerElement,
|
|
105
134
|
this.popup,
|
|
106
135
|
{
|
|
107
136
|
placement: this.placement,
|
|
108
137
|
strategy: this.floatingStrategy,
|
|
109
138
|
middleware: [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
apply: ({ rects: s, availableHeight:
|
|
115
|
-
const
|
|
116
|
-
this.popup.style.width =
|
|
117
|
-
const v = typeof this.maxHeight == "number" ? this.maxHeight : void 0,
|
|
118
|
-
this.popup.style.maxHeight =
|
|
119
|
-
const
|
|
120
|
-
this.popup.style.maxWidth = `${
|
|
139
|
+
H(this.offset),
|
|
140
|
+
N(),
|
|
141
|
+
M(),
|
|
142
|
+
k({
|
|
143
|
+
apply: ({ rects: s, availableHeight: p, availableWidth: m, elements: f }) => {
|
|
144
|
+
const w = Math.max(0, p), x = Math.max(0, m), C = this.sync;
|
|
145
|
+
this.popup.style.width = C ? `${s.reference.width}px` : "";
|
|
146
|
+
const v = typeof this.maxHeight == "number" ? this.maxHeight : void 0, E = v != null ? Math.min(v, w) : w;
|
|
147
|
+
this.popup.style.maxHeight = E >= f.floating.scrollHeight ? "" : `${E}px`;
|
|
148
|
+
const _ = typeof this.maxWidth == "number" ? this.maxWidth : void 0, T = _ != null ? Math.min(_, x) : x;
|
|
149
|
+
this.popup.style.maxWidth = `${T}px`, this.fullWidth && (this.popup.style.width = "100vw");
|
|
121
150
|
}
|
|
122
151
|
}),
|
|
123
|
-
...this.arrowElement ? [
|
|
152
|
+
...this.arrowElement ? [B({ element: this.arrowElement, padding: 8 })] : []
|
|
124
153
|
]
|
|
125
154
|
}
|
|
126
155
|
);
|
|
127
156
|
if (Object.assign(this.popup.style, {
|
|
128
|
-
left: `${
|
|
129
|
-
top: `${
|
|
157
|
+
left: `${u}px`,
|
|
158
|
+
top: `${n}px`
|
|
130
159
|
}), this.arrowElement) {
|
|
131
|
-
const { x: s, y:
|
|
160
|
+
const { x: s, y: p } = h.arrow, [m] = a.split("-"), f = (d = {
|
|
132
161
|
top: "bottom",
|
|
133
162
|
right: "left",
|
|
134
163
|
bottom: "top",
|
|
135
164
|
left: "right"
|
|
136
|
-
}[m]) != null ?
|
|
165
|
+
}[m]) != null ? d : "";
|
|
137
166
|
Object.assign(this.arrowElement.style, {
|
|
138
167
|
left: s != null ? `${s}px` : "",
|
|
139
|
-
top:
|
|
168
|
+
top: p != null ? `${p}px` : "",
|
|
140
169
|
[f]: "-5px"
|
|
141
170
|
}), this.arrowElement.classList.remove(
|
|
142
171
|
"popup__arrow--top",
|
|
@@ -148,10 +177,10 @@ const c = class c extends B(j) {
|
|
|
148
177
|
});
|
|
149
178
|
}
|
|
150
179
|
renderTrigger() {
|
|
151
|
-
return
|
|
180
|
+
return b``;
|
|
152
181
|
}
|
|
153
182
|
renderPopup() {
|
|
154
|
-
return
|
|
183
|
+
return b`
|
|
155
184
|
<slot name="trigger" @slotchange=${this._handleTriggerSlotChange}>
|
|
156
185
|
${this.renderTrigger()}
|
|
157
186
|
</slot>
|
|
@@ -159,7 +188,7 @@ const c = class c extends B(j) {
|
|
|
159
188
|
part="popup"
|
|
160
189
|
id="popup"
|
|
161
190
|
?inert=${!this.opened}
|
|
162
|
-
class=${
|
|
191
|
+
class=${S("popup", `popup--${this.size}`, {
|
|
163
192
|
"popup--opened": this.opened,
|
|
164
193
|
"popup--fixed": this.floatingStrategy === "fixed",
|
|
165
194
|
"popup--has-arrow": this.hasArrow,
|
|
@@ -167,21 +196,21 @@ const c = class c extends B(j) {
|
|
|
167
196
|
"popup--full-width": this.fullWidth
|
|
168
197
|
})}>
|
|
169
198
|
<slot @slotchange=${this._handleContentSlotChange}></slot>
|
|
170
|
-
${this.hasArrow ?
|
|
199
|
+
${this.hasArrow ? b`<div
|
|
171
200
|
part="arrow"
|
|
172
|
-
class=${
|
|
201
|
+
class=${S("popup__arrow")}
|
|
173
202
|
role="presentation"></div>` : ""}
|
|
174
203
|
</div>
|
|
175
204
|
`;
|
|
176
205
|
}
|
|
177
206
|
};
|
|
178
|
-
c.styles =
|
|
207
|
+
c.styles = q(V);
|
|
179
208
|
let i = c;
|
|
180
209
|
r([
|
|
181
|
-
|
|
210
|
+
A(".popup")
|
|
182
211
|
], i.prototype, "popup");
|
|
183
212
|
r([
|
|
184
|
-
|
|
213
|
+
A(".popup__arrow")
|
|
185
214
|
], i.prototype, "arrowElement");
|
|
186
215
|
r([
|
|
187
216
|
o({ reflect: !0, type: Boolean })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popup-base-element.js","sources":["../../../src/components/popup/popup-base-element.ts"],"sourcesContent":["import {\n arrow,\n autoUpdate,\n computePosition,\n Coords,\n flip,\n offset,\n shift,\n size,\n} from '@floating-ui/dom'\nimport { clsx } from 'clsx'\nimport { TemplateResult, unsafeCSS } from 'lit'\nimport { property, query } from 'lit/decorators.js'\nimport { html } from 'lit/static-html.js'\n\nimport { SizedMixin } from '@/internal/mixin/sizedMixin'\n\nimport { FloatingStrategy, PopupPlacement } from '../../common/types'\nimport { DdsElement } from '../../internal/dds-hu-element'\nimport styles from './popup.scss?inline'\n\nexport default class PopupBaseElement extends SizedMixin(DdsElement) {\n static readonly styles = unsafeCSS(styles)\n\n protected triggerElement: Element | null = null\n private cleanup: ReturnType<typeof autoUpdate> | undefined\n private intersectionObserver: IntersectionObserver | null = null\n\n @query('.popup') protected readonly popup!: HTMLDivElement\n @query('.popup__arrow') private readonly arrowElement?: HTMLDivElement\n\n /** The disabled state of the popup. */\n @property({ reflect: true, type: Boolean }) disabled? = false\n\n /** The open state of the popup. */\n @property({ reflect: true, type: Boolean }) opened? = false\n\n /** The placement of the popup.\n * @type {'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'}\n */\n @property({ reflect: true }) placement: PopupPlacement = 'bottom'\n\n /** The floating strategy of the popup.\n * @type {'absolute' | 'fixed'}\n */\n @property({ reflect: true })\n floatingStrategy: FloatingStrategy = 'absolute'\n\n /** The offset of the popup. */\n @property({ type: Number }) offset = 0\n\n /** Whether the popup should sync its width with the trigger. */\n @property({ type: Boolean }) sync?: boolean\n\n /** The maximum height of the popup. */\n @property({ type: Number }) maxHeight: number | 'auto' = 250\n\n /** The maximum width of the popup. */\n @property({ type: Number }) maxWidth: number | 'auto' = 'auto'\n\n /** Whether the popup has an arrow. */\n @property({ type: Boolean }) hasArrow: boolean\n\n /** Whether the popup should overflow. */\n @property({ type: Boolean }) overflow: boolean\n\n /** Whether the popup should take full width of the screen. */\n @property({ type: Boolean }) fullWidth: boolean\n\n /** Whether to keep popup open when trigger leaves viewport. */\n @property({ type: Boolean }) disableViewportAutoClose: boolean = false\n\n async connectedCallback() {\n super.connectedCallback()\n\n await this.updateComplete\n this.startUpdate()\n }\n\n protected firstUpdated(changedProps: Map<string, unknown>) {\n super.firstUpdated(changedProps)\n\n this.triggerElement?.setAttribute('aria-controls', 'popup')\n this.triggerElement?.setAttribute('aria-expanded', 'false')\n }\n\n async updated(changedProps: Map<string, unknown>) {\n super.updated(changedProps)\n\n if (changedProps.has('opened')) {\n if (this.opened) {\n this.startUpdate()\n this.triggerElement?.setAttribute('aria-expanded', 'true')\n this.emit('dds-opened')\n } else {\n this.stopUpdate()\n this.triggerElement?.setAttribute('aria-expanded', 'false')\n this.emit('dds-closed')\n }\n }\n\n if (changedProps.has('anchor')) {\n this._handleTriggerSlotChange()\n }\n\n if (this.opened) {\n await this.updateComplete\n this.updatePosition()\n }\n }\n\n async _handleTriggerSlotChange(e?: Event | undefined) {\n this._handleTriggerSlotChangeCallback(e)\n\n await this.stopUpdate()\n\n // Use :scope > to only match direct children, not descendants\n this.triggerElement = this.querySelector<HTMLElement>(\n ':scope > [slot=\"trigger\"]',\n )\n\n if (!this.triggerElement) {\n this.triggerElement = this.shadowRoot?.querySelector(\n 'slot[name=\"trigger\"] *',\n ) as HTMLElement\n }\n\n if (this.triggerElement instanceof HTMLSlotElement) {\n this.triggerElement = this.triggerElement.assignedElements({\n flatten: true,\n })[0] as HTMLElement\n }\n\n if (this.triggerElement) {\n this.startUpdate()\n }\n }\n\n public _handleTriggerSlotChangeCallback(_e?: Event) {\n return\n }\n\n public _handleContentSlotChange(_e: Event) {\n return\n }\n\n public startUpdate() {\n if (!this.triggerElement) {\n return\n }\n\n // Create IntersectionObserver to detect when trigger is out of viewport\n this.intersectionObserver?.disconnect()\n this.intersectionObserver = new IntersectionObserver(\n entries => {\n // If trigger is not intersecting (out of viewport), close the popup\n if (\n entries[0] &&\n !entries[0].isIntersecting &&\n this.opened &&\n !this.disableViewportAutoClose\n ) {\n this.opened = false\n this.emit('dds-close')\n }\n },\n { threshold: 0 },\n )\n this.intersectionObserver.observe(this.triggerElement)\n\n this.cleanup = autoUpdate(this.triggerElement, this.popup, () => {\n this.updatePosition()\n })\n }\n\n public async stopUpdate(): Promise<void> {\n return new Promise(resolve => {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect()\n this.intersectionObserver = null\n }\n\n if (this.cleanup) {\n this.cleanup()\n this.cleanup = undefined\n requestAnimationFrame(() => resolve())\n } else {\n resolve()\n }\n })\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n // Clean up the IntersectionObserver\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect()\n this.intersectionObserver = null\n }\n\n this.stopUpdate()\n }\n\n protected async updatePosition() {\n if (this.disabled || !this.triggerElement) {\n return\n }\n\n // Check if trigger element is visible in viewport\n const triggerRect = this.triggerElement.getBoundingClientRect()\n const isVisible =\n triggerRect.top < window.innerHeight &&\n triggerRect.bottom > 0 &&\n triggerRect.left < window.innerWidth &&\n triggerRect.right > 0\n\n if (!isVisible) {\n if (this.opened && !this.disableViewportAutoClose) {\n this.opened = false\n this.emit('dds-close')\n }\n return\n }\n\n const { x, y, placement, middlewareData } = await computePosition(\n this.triggerElement,\n this.popup,\n {\n placement: this.placement,\n strategy: this.floatingStrategy,\n middleware: [\n offset(this.offset),\n flip(),\n shift(),\n size({\n apply: ({ rects, availableHeight, availableWidth, elements }) => {\n const safeAvailableHeight = Math.max(0, availableHeight)\n const safeAvailableWidth = Math.max(0, availableWidth)\n const syncWidth = this.sync\n this.popup.style.width = syncWidth\n ? `${rects.reference.width}px`\n : ''\n\n const configuredMaxHeight =\n typeof this.maxHeight === 'number' ? this.maxHeight : undefined\n const effectiveMaxHeight =\n configuredMaxHeight != null\n ? Math.min(configuredMaxHeight, safeAvailableHeight)\n : safeAvailableHeight\n this.popup.style.maxHeight =\n effectiveMaxHeight >= elements.floating.scrollHeight\n ? ''\n : `${effectiveMaxHeight}px`\n\n const configuredMaxWidth =\n typeof this.maxWidth === 'number' ? this.maxWidth : undefined\n const effectiveMaxWidth =\n configuredMaxWidth != null\n ? Math.min(configuredMaxWidth, safeAvailableWidth)\n : safeAvailableWidth\n this.popup.style.maxWidth = `${effectiveMaxWidth}px`\n\n if (this.fullWidth) {\n this.popup.style.width = '100vw'\n }\n },\n }),\n ...(this.arrowElement\n ? [arrow({ element: this.arrowElement, padding: 8 })]\n : []),\n ],\n },\n )\n\n Object.assign(this.popup.style, {\n left: `${x}px`,\n top: `${y}px`,\n })\n\n if (this.arrowElement) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow as Coords\n const [side] = placement.split('-')\n const staticSide =\n {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[side] ?? ''\n\n Object.assign(this.arrowElement.style, {\n left: arrowX != null ? `${arrowX}px` : '',\n top: arrowY != null ? `${arrowY}px` : '',\n [staticSide]: `-5px`,\n })\n\n this.arrowElement.classList.remove(\n 'popup__arrow--top',\n 'popup__arrow--right',\n 'popup__arrow--bottom',\n 'popup__arrow--left',\n )\n this.arrowElement.classList.add(`popup__arrow--${side}`)\n }\n }\n\n renderTrigger(): TemplateResult {\n return html``\n }\n\n renderPopup() {\n return html`\n <slot name=\"trigger\" @slotchange=${this._handleTriggerSlotChange}>\n ${this.renderTrigger()}\n </slot>\n <div\n part=\"popup\"\n id=\"popup\"\n ?inert=${!this.opened}\n class=${clsx('popup', `popup--${this.size}`, {\n 'popup--opened': this.opened,\n 'popup--fixed': this.floatingStrategy === 'fixed',\n 'popup--has-arrow': this.hasArrow,\n 'popup--overflow': this.overflow,\n 'popup--full-width': this.fullWidth,\n })}>\n <slot @slotchange=${this._handleContentSlotChange}></slot>\n ${this.hasArrow\n ? html`<div\n part=\"arrow\"\n class=${clsx('popup__arrow')}\n role=\"presentation\"></div>`\n : ''}\n </div>\n `\n }\n}\n"],"names":["_PopupBaseElement","SizedMixin","DdsElement","__async","__superGet","changedProps","_a","_b","e","_e","entries","autoUpdate","resolve","triggerRect","x","y","placement","middlewareData","computePosition","offset","flip","shift","size","rects","availableHeight","availableWidth","elements","safeAvailableHeight","safeAvailableWidth","syncWidth","configuredMaxHeight","effectiveMaxHeight","configuredMaxWidth","effectiveMaxWidth","arrow","arrowX","arrowY","side","staticSide","html","clsx","unsafeCSS","styles","PopupBaseElement","__decorateClass","query","property"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBqB,MAAAA,IAAA,MAAAA,UAAyBC,EAAWC,CAAU,EAAE;AAAA,EAArE,cAAA;AAAA,UAAA,GAAA,SAAA,GAGE,KAAU,iBAAiC,MAE3C,KAAQ,uBAAoD,MAMJ,KAAA,WAAA,IAGF,KAAA,SAAA,IAKG,KAAA,YAAA,UAMpB,KAAA,mBAAA,YAGA,KAAA,SAAA,GAMoB,KAAA,YAAA,KAGD,KAAA,WAAA,QAYS,KAAA,2BAAA;AAAA,EAAA;AAAA,EAE3D,oBAAoB;AAAA,WAAAC,EAAA;AACxB,MAAAC,EAAAJ,EAAA,iBAAM,0BAAN,IAAwB,GAExB,MAAM,KAAK,gBACX,KAAK,YAAY;AAAA,IAAA;AAAA;AAAA,EAGT,aAAaK,GAAoC;;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S,CAAA;AAAA,GAXvBH,EAWyB,WAAA,UAAA;AAGAC,EAAA;AAAA,EAA3CE,EAAS,EAAE,SAAS,IAAM,MAAM,QAAS,CAAA;AAAA,GAdvBH,EAcyB,WAAA,QAAA;AAKfC,EAAA;AAAA,EAA5BE,EAAS,EAAE,SAAS,GAAM,CAAA;AAAA,GAnBRH,EAmBU,WAAA,WAAA;AAM7BC,EAAA;AAAA,EADCE,EAAS,EAAE,SAAS,GAAM,CAAA;AAAA,GAxBRH,EAyBnB,WAAA,kBAAA;AAG4BC,EAAA;AAAA,EAA3BE,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GA5BPH,EA4BS,WAAA,QAAA;AAGCC,EAAA;AAAA,EAA5BE,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GA/BRH,EA+BU,WAAA,MAAA;AAGDC,EAAA;AAAA,EAA3BE,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GAlCPH,EAkCS,WAAA,WAAA;AAGAC,EAAA;AAAA,EAA3BE,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GArCPH,EAqCS,WAAA,UAAA;AAGCC,EAAA;AAAA,EAA5BE,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GAxCRH,EAwCU,WAAA,UAAA;AAGAC,EAAA;AAAA,EAA5BE,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GA3CRH,EA2CU,WAAA,UAAA;AAGAC,EAAA;AAAA,EAA5BE,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GA9CRH,EA8CU,WAAA,WAAA;AAGAC,EAAA;AAAA,EAA5BE,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GAjDRH,EAiDU,WAAA,0BAAA;"}
|
|
1
|
+
{"version":3,"file":"popup-base-element.js","sources":["../../../src/components/popup/popup-base-element.ts"],"sourcesContent":["import {\n arrow,\n autoUpdate,\n computePosition,\n Coords,\n flip,\n offset,\n shift,\n size,\n} from '@floating-ui/dom'\nimport { clsx } from 'clsx'\nimport { TemplateResult, unsafeCSS } from 'lit'\nimport { property, query } from 'lit/decorators.js'\nimport { html } from 'lit/static-html.js'\n\nimport { SizedMixin } from '@/internal/mixin/sizedMixin'\n\nimport { FloatingStrategy, PopupPlacement } from '../../common/types'\nimport { DdsElement } from '../../internal/dds-hu-element'\nimport styles from './popup.scss?inline'\n\n// Roles on which ARIA 1.2 permits aria-expanded; on any other role axe reports aria-allowed-attr\nconst EXPANDABLE_ROLES = new Set([\n 'application',\n 'button',\n 'checkbox',\n 'columnheader',\n 'combobox',\n 'gridcell',\n 'link',\n 'menuitem',\n 'row',\n 'rowheader',\n 'tab',\n 'treeitem',\n])\n\nconst EXPANDABLE_INPUT_TYPES = new Set([\n 'button',\n 'checkbox',\n 'image',\n 'reset',\n 'submit',\n])\n\nexport default class PopupBaseElement extends SizedMixin(DdsElement) {\n static readonly styles = unsafeCSS(styles)\n\n protected triggerElement: Element | null = null\n private cleanup: ReturnType<typeof autoUpdate> | undefined\n private intersectionObserver: IntersectionObserver | null = null\n\n @query('.popup') protected readonly popup!: HTMLDivElement\n @query('.popup__arrow') private readonly arrowElement?: HTMLDivElement\n\n /** The disabled state of the popup. */\n @property({ reflect: true, type: Boolean }) disabled? = false\n\n /** The open state of the popup. */\n @property({ reflect: true, type: Boolean }) opened? = false\n\n /** The placement of the popup.\n * @type {'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'}\n */\n @property({ reflect: true }) placement: PopupPlacement = 'bottom'\n\n /** The floating strategy of the popup.\n * @type {'absolute' | 'fixed'}\n */\n @property({ reflect: true })\n floatingStrategy: FloatingStrategy = 'absolute'\n\n /** The offset of the popup. */\n @property({ type: Number }) offset = 0\n\n /** Whether the popup should sync its width with the trigger. */\n @property({ type: Boolean }) sync?: boolean\n\n /** The maximum height of the popup. */\n @property({ type: Number }) maxHeight: number | 'auto' = 250\n\n /** The maximum width of the popup. */\n @property({ type: Number }) maxWidth: number | 'auto' = 'auto'\n\n /** Whether the popup has an arrow. */\n @property({ type: Boolean }) hasArrow: boolean\n\n /** Whether the popup should overflow. */\n @property({ type: Boolean }) overflow: boolean\n\n /** Whether the popup should take full width of the screen. */\n @property({ type: Boolean }) fullWidth: boolean\n\n /** Whether to keep popup open when trigger leaves viewport. */\n @property({ type: Boolean }) disableViewportAutoClose: boolean = false\n\n async connectedCallback() {\n super.connectedCallback()\n\n await this.updateComplete\n this.startUpdate()\n }\n\n protected firstUpdated(changedProps: Map<string, unknown>) {\n super.firstUpdated(changedProps)\n\n this.syncTriggerAria()\n }\n\n /**\n * Whether the trigger can carry aria-expanded. Role-less wrappers (e.g. the\n * combobox/datepicker field frame) expose state on their own inner control.\n */\n private triggerSupportsExpanded(el: Element): boolean {\n const role = el.getAttribute('role')\n if (role) {\n return EXPANDABLE_ROLES.has(role)\n }\n if (el.tagName === 'BUTTON') {\n return true\n }\n if (el.tagName === 'A') {\n return el.hasAttribute('href')\n }\n if (el.tagName === 'INPUT') {\n return EXPANDABLE_INPUT_TYPES.has((el as HTMLInputElement).type)\n }\n return false\n }\n\n private syncTriggerAria() {\n const trigger = this.triggerElement\n if (!trigger || !this.triggerSupportsExpanded(trigger)) {\n return\n }\n // Keep a trigger's own aria-controls (e.g. select points at its option list)\n if (!trigger.hasAttribute('aria-controls')) {\n trigger.setAttribute('aria-controls', 'popup')\n }\n trigger.setAttribute('aria-expanded', String(!!this.opened))\n }\n\n async updated(changedProps: Map<string, unknown>) {\n super.updated(changedProps)\n\n if (changedProps.has('opened')) {\n if (this.opened) {\n this.startUpdate()\n this.syncTriggerAria()\n this.emit('dds-opened')\n } else {\n this.stopUpdate()\n this.syncTriggerAria()\n this.emit('dds-closed')\n }\n }\n\n if (changedProps.has('anchor')) {\n this._handleTriggerSlotChange()\n }\n\n if (this.opened) {\n await this.updateComplete\n this.updatePosition()\n }\n }\n\n async _handleTriggerSlotChange(e?: Event | undefined) {\n this._handleTriggerSlotChangeCallback(e)\n\n await this.stopUpdate()\n\n // Use :scope > to only match direct children, not descendants\n this.triggerElement = this.querySelector<HTMLElement>(\n ':scope > [slot=\"trigger\"]',\n )\n\n if (!this.triggerElement) {\n this.triggerElement = this.shadowRoot?.querySelector(\n 'slot[name=\"trigger\"] *',\n ) as HTMLElement\n }\n\n if (this.triggerElement instanceof HTMLSlotElement) {\n this.triggerElement = this.triggerElement.assignedElements({\n flatten: true,\n })[0] as HTMLElement\n }\n\n if (this.triggerElement) {\n this.startUpdate()\n }\n }\n\n public _handleTriggerSlotChangeCallback(_e?: Event) {\n return\n }\n\n public _handleContentSlotChange(_e: Event) {\n return\n }\n\n public startUpdate() {\n if (!this.triggerElement) {\n return\n }\n\n // Create IntersectionObserver to detect when trigger is out of viewport\n this.intersectionObserver?.disconnect()\n this.intersectionObserver = new IntersectionObserver(\n entries => {\n // If trigger is not intersecting (out of viewport), close the popup\n if (\n entries[0] &&\n !entries[0].isIntersecting &&\n this.opened &&\n !this.disableViewportAutoClose\n ) {\n this.opened = false\n this.emit('dds-close')\n }\n },\n { threshold: 0 },\n )\n this.intersectionObserver.observe(this.triggerElement)\n\n this.cleanup = autoUpdate(this.triggerElement, this.popup, () => {\n this.updatePosition()\n })\n }\n\n public async stopUpdate(): Promise<void> {\n return new Promise(resolve => {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect()\n this.intersectionObserver = null\n }\n\n if (this.cleanup) {\n this.cleanup()\n this.cleanup = undefined\n requestAnimationFrame(() => resolve())\n } else {\n resolve()\n }\n })\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n // Clean up the IntersectionObserver\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect()\n this.intersectionObserver = null\n }\n\n this.stopUpdate()\n }\n\n protected async updatePosition() {\n if (this.disabled || !this.triggerElement) {\n return\n }\n\n // Check if trigger element is visible in viewport\n const triggerRect = this.triggerElement.getBoundingClientRect()\n const isVisible =\n triggerRect.top < window.innerHeight &&\n triggerRect.bottom > 0 &&\n triggerRect.left < window.innerWidth &&\n triggerRect.right > 0\n\n if (!isVisible) {\n if (this.opened && !this.disableViewportAutoClose) {\n this.opened = false\n this.emit('dds-close')\n }\n return\n }\n\n const { x, y, placement, middlewareData } = await computePosition(\n this.triggerElement,\n this.popup,\n {\n placement: this.placement,\n strategy: this.floatingStrategy,\n middleware: [\n offset(this.offset),\n flip(),\n shift(),\n size({\n apply: ({ rects, availableHeight, availableWidth, elements }) => {\n const safeAvailableHeight = Math.max(0, availableHeight)\n const safeAvailableWidth = Math.max(0, availableWidth)\n const syncWidth = this.sync\n this.popup.style.width = syncWidth\n ? `${rects.reference.width}px`\n : ''\n\n const configuredMaxHeight =\n typeof this.maxHeight === 'number' ? this.maxHeight : undefined\n const effectiveMaxHeight =\n configuredMaxHeight != null\n ? Math.min(configuredMaxHeight, safeAvailableHeight)\n : safeAvailableHeight\n this.popup.style.maxHeight =\n effectiveMaxHeight >= elements.floating.scrollHeight\n ? ''\n : `${effectiveMaxHeight}px`\n\n const configuredMaxWidth =\n typeof this.maxWidth === 'number' ? this.maxWidth : undefined\n const effectiveMaxWidth =\n configuredMaxWidth != null\n ? Math.min(configuredMaxWidth, safeAvailableWidth)\n : safeAvailableWidth\n this.popup.style.maxWidth = `${effectiveMaxWidth}px`\n\n if (this.fullWidth) {\n this.popup.style.width = '100vw'\n }\n },\n }),\n ...(this.arrowElement\n ? [arrow({ element: this.arrowElement, padding: 8 })]\n : []),\n ],\n },\n )\n\n Object.assign(this.popup.style, {\n left: `${x}px`,\n top: `${y}px`,\n })\n\n if (this.arrowElement) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow as Coords\n const [side] = placement.split('-')\n const staticSide =\n {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[side] ?? ''\n\n Object.assign(this.arrowElement.style, {\n left: arrowX != null ? `${arrowX}px` : '',\n top: arrowY != null ? `${arrowY}px` : '',\n [staticSide]: `-5px`,\n })\n\n this.arrowElement.classList.remove(\n 'popup__arrow--top',\n 'popup__arrow--right',\n 'popup__arrow--bottom',\n 'popup__arrow--left',\n )\n this.arrowElement.classList.add(`popup__arrow--${side}`)\n }\n }\n\n renderTrigger(): TemplateResult {\n return html``\n }\n\n renderPopup() {\n return html`\n <slot name=\"trigger\" @slotchange=${this._handleTriggerSlotChange}>\n ${this.renderTrigger()}\n </slot>\n <div\n part=\"popup\"\n id=\"popup\"\n ?inert=${!this.opened}\n class=${clsx('popup', `popup--${this.size}`, {\n 'popup--opened': this.opened,\n 'popup--fixed': this.floatingStrategy === 'fixed',\n 'popup--has-arrow': this.hasArrow,\n 'popup--overflow': this.overflow,\n 'popup--full-width': this.fullWidth,\n })}>\n <slot @slotchange=${this._handleContentSlotChange}></slot>\n ${this.hasArrow\n ? html`<div\n part=\"arrow\"\n class=${clsx('popup__arrow')}\n role=\"presentation\"></div>`\n : ''}\n </div>\n `\n }\n}\n"],"names":["EXPANDABLE_ROLES","EXPANDABLE_INPUT_TYPES","_PopupBaseElement","SizedMixin","DdsElement","__async","__superGet","changedProps","el","role","trigger","e","_a","_e","entries","autoUpdate","resolve","triggerRect","x","y","placement","middlewareData","computePosition","offset","flip","shift","size","rects","availableHeight","availableWidth","elements","safeAvailableHeight","safeAvailableWidth","syncWidth","configuredMaxHeight","effectiveMaxHeight","configuredMaxWidth","effectiveMaxWidth","arrow","arrowX","arrowY","side","staticSide","html","clsx","unsafeCSS","styles","PopupBaseElement","__decorateClass","query","property"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAMA,wBAAuB,IAAI;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAEKC,wBAA6B,IAAI;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAEoBC,I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