q2-tecton-elements 1.54.2 → 1.54.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/bundle-report.json +100 -19
- package/dist/cjs/q2-badge_7.cjs.entry.js +1 -1
- package/dist/cjs/q2-badge_7.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +21 -2
- package/dist/cjs/q2-dropdown-item.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +4 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-option-list_2.cjs.entry.js +7 -5
- package/dist/cjs/q2-option-list_2.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-option.cjs.entry.js +15 -1
- package/dist/cjs/q2-option.cjs.entry.js.map +1 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js +4 -1
- package/dist/collection/components/q2-dropdown/q2-dropdown.js.map +1 -1
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js +67 -2
- package/dist/collection/components/q2-dropdown/test/q2-dropdown-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js +21 -2
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
- package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js +43 -2
- package/dist/collection/components/q2-dropdown-item/test/q2-dropdown-item-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-input/q2-input.css +1 -1
- package/dist/collection/components/q2-option/q2-option.js +29 -1
- package/dist/collection/components/q2-option/q2-option.js.map +1 -1
- package/dist/collection/components/q2-option/test/q2-option-test.e2e.js +33 -114
- package/dist/collection/components/q2-option/test/q2-option-test.e2e.js.map +1 -1
- package/dist/collection/components/q2-option-list/q2-option-list.js +7 -5
- package/dist/collection/components/q2-option-list/q2-option-list.js.map +1 -1
- package/dist/collection/utils/mirror-emit.js +19 -0
- package/dist/collection/utils/mirror-emit.js.map +1 -0
- package/dist/components/q2-dropdown-item2.js +21 -2
- package/dist/components/q2-dropdown-item2.js.map +1 -1
- package/dist/components/q2-dropdown.js +4 -1
- package/dist/components/q2-dropdown.js.map +1 -1
- package/dist/components/q2-input2.js +1 -1
- package/dist/components/q2-input2.js.map +1 -1
- package/dist/components/q2-option-list2.js +7 -5
- package/dist/components/q2-option-list2.js.map +1 -1
- package/dist/components/q2-option2.js +15 -1
- package/dist/components/q2-option2.js.map +1 -1
- package/dist/esm/q2-badge_7.entry.js +1 -1
- package/dist/esm/q2-badge_7.entry.js.map +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +21 -2
- package/dist/esm/q2-dropdown-item.entry.js.map +1 -1
- package/dist/esm/q2-dropdown.entry.js +4 -1
- package/dist/esm/q2-dropdown.entry.js.map +1 -1
- package/dist/esm/q2-option-list_2.entry.js +7 -5
- package/dist/esm/q2-option-list_2.entry.js.map +1 -1
- package/dist/esm/q2-option.entry.js +15 -1
- package/dist/esm/q2-option.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-badge_7.entry.js +1 -1
- package/dist/q2-tecton-elements/q2-badge_7.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +23 -6
- package/dist/q2-tecton-elements/q2-dropdown-item.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-dropdown.entry.js +8 -5
- package/dist/q2-tecton-elements/q2-dropdown.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-option-list_2.entry.js +29 -23
- package/dist/q2-tecton-elements/q2-option-list_2.entry.js.map +1 -1
- package/dist/q2-tecton-elements/q2-option.entry.js +35 -15
- package/dist/q2-tecton-elements/q2-option.entry.js.map +1 -1
- package/dist/types/components/q2-dropdown-item/q2-dropdown-item.d.ts +8 -0
- package/dist/types/components/q2-option/q2-option.d.ts +7 -0
- package/dist/types/components.d.ts +11 -0
- package/dist/types/utils/mirror-emit.d.ts +11 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sanitizeRegexString","regexString","replace","q2OptionListCss","Q2OptionListStyle0","Q2OptionList","this","keyStore","queue","lastPressedAt","Date","scheduledAfterRender","clickHandler","event","target","option","closest","selectOption","multiple","popoverState","emit","open","action","externalKeydownHandler","stopPropagation","activeIndex","customSearch","allOptions","key","nextIndex","searchString","searchOptions","type","openDropdownWithActiveElement","setDefaultActiveElement","nextPaint","preventDefault","selectedOptions","length","getDefaultActiveIndex","getNextVisibleIndex","Math","max","min","noSelect","setActiveElement","match","focusoutHandler","relatedTarget","isInQ2OptionList","includes","isInLightDom","hostElement","contains","internalKeydownHandler","allVisibleOptions","shiftKey","newOption","find","element","active","disabled","firstVisibleOption","isFirstVisibleOptionActive","undefined","adjustActiveOptionAndScroll","lastVisibleOption","isLastVisibleOptionActive","searchAndFocus","keyValue","shouldSelect","reorder","pivotIndex","list","map","index","slice","buildQueue","now","getTime","push","searchIndex","keyStr","join","sanitizedKeyStr","v","display","RegExp","setFocus","matched","loc","componentWillLoad","hasOptions","querySelectorAll","componentDidLoad","overrideFocus","checkOptions","selectedOptionsUpdated","ready","componentDidRender","forEach","fn","handleClick","delegateFocus","isEventFromElement","setActiveOption","setFocusedOption","getContents","allContents","getOptions","handleExternalKeydown","updateMultipleOptionAttrs","updateSingleOptionAttrs","showSelectedUpdated","showSelected","_multiSelectHidden","selected","rootSlot","getRootSlot","acceptedTags","Set","filter","has","tagName","contents","extractOptions","elements","reduce","acc","separator","Array","from","children","hidden","disabledGroup","numToAdd","scrollToActiveOption","optionRole","role","focusSelectedSibling","hasNoSiblings","selectedOptionVisibleIndex","indexOf","nextVisibleSiblingIndex","nextVisibleSibling","nextSiblingIndex","firstSelected","findIndex","firstEnabled","direction","activeOption","visibleActiveOptionIndex","nextVisibleOptionIndex","nextVisibleOption","slot","querySelector","assignedElements","_a","hasAnotherSlot","waitForNextPaint","resetTimer","searchStringTimer","clearTimeout","window","setTimeout","scrollIntoView","block","selectedOption","selectedValue","value","displayValue","innerText","trim","valueObject","values","isAlreadySelected","change","elementIndex","isOptionVisible","isVisible","focus","selectedValues","render","h","Host","class","ref","el","contentElement","onFocusout","label","onKeyDown","onClick","q2PopoverCss","Q2PopoverStyle0","Q2Popover","displayBuffer","orientationChanged","handleMinHeight","minHeight","handleDeprecationWarning","setAbsoluteCSSProperties","async","controlElement","containerElement","currentDirection","align","style","setProperty","controlStyle","getComputedStyle","controlSize","parseInt","height","borderTopWidth","borderBottomWidth","setFixedCSSProperties","rootElementRect","top","controlTop","bottom","controlBottom","left","controlLeft","right","controlRight","_b","getBoundingClientRect","call","popoverLeft","offsetWidth","width","viewPortChanged","determinePopDirection","viewPortOrientationChanged","disconnectedCallback","removeViewportListeners","popoverStateHandler","detail","scrollContainerTo","options","scrollTo","toggle","minHeightProvided","openChanged","setRootElement","popoverStateChanged","addViewportListeners","show","clearCSSProperties","isModule","isIframe","hasPlatformDimensions","Object","keys","Tecton","platformDimensions","providedDirection","validatedMaxHeight","maxHeight","isNaN","addEventListener","passive","capture","screen","orientation","removeProperty","windowHeight","maxSpaceAbove","maxSpaceBelow","outletOffset","innerHeight","_c","distanceToIframeBottom","visualViewport","viewableSpaceBelow","isIframeShorterThanWindow","directionWithMostSpace","shouldUpdateMaxHeight","getPropertyValue","currentOrDetermineDirection","priorityMaxHeight","setDirectionAndShow","removeEventListener","isOpen","mode","currentElement","document","documentElement","computedStyle","transform","perspective","containerType","willChange","contain","rootNode","getRootNode","isRootNodeWebComponent","ShadowRoot","host","HTMLElement","parentElement","containerClasses","tabIndex"],"sources":["src/utils/sanitize-regex-string.ts","src/components/q2-option-list/q2-option-list.scss?tag=q2-option-list&encapsulation=shadow","src/components/q2-option-list/q2-option-list.tsx","src/components/q2-popover/q2-popover.scss?tag=q2-popover&encapsulation=shadow","src/components/q2-popover/q2-popover.tsx"],"sourcesContent":["export default function sanitizeRegexString(regexString: string) {\n return regexString.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n","@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n position: relative;\n width: 100%;\n display: block;\n line-height: var-list(var-prefixer(option-list-line-height),--app-line-height, 1.428571429em);\n}\n\n.content {\n text-align: start;\n\n :host([is-sizeable]) & {\n display: block;\n height: auto;\n }\n}\n","import sanitizeRegexString from '@/utils/sanitize-regex-string';\nimport {\n Component,\n Prop,\n h,\n Event,\n State,\n Element,\n ComponentInterface,\n Host,\n EventEmitter,\n Method,\n Watch,\n Listen,\n} from '@stencil/core';\nimport { isEventFromElement, isVisible, loc, nextPaint, overrideFocus, waitForNextPaint } from 'src/utils';\n\nexport interface IOptionValue {\n value: string;\n display?: string;\n}\n\nexport type ValidOptionElements = HTMLQ2OptionElement | HTMLQ2DropdownItemElement;\n\n@Component({ tag: 'q2-option-list', shadow: true, styleUrl: 'q2-option-list.scss' })\nexport class Q2OptionList implements ComponentInterface {\n // #region Own Properties\n\n activeIndex: number;\n contentElement: HTMLElement;\n keyStore: {\n queue: string[];\n lastPressedAt: Date;\n } = {\n queue: [],\n lastPressedAt: new Date(),\n };\n pivotIndex: number;\n scheduledAfterRender: (() => void)[] = [];\n searchString: string;\n searchStringTimer: number;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n hasOptions: boolean;\n\n // #endregion\n // #region Public Property API\n\n @Prop({ reflect: true })\n align: 'left' | 'right';\n\n /** Indicates a custom search is being implemented for the option list. */\n @Prop({ reflect: true })\n customSearch: boolean;\n\n /** Disables the option list. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /** Determines the label that is applied to the option list for accessibility purposes. */\n @Prop()\n label: string = loc('tecton.element.optionList.label');\n\n /**\n * Enables the multi-select ability for the option list.\n * @info\n * Only applicable when options are provided.\n */\n @Prop({ reflect: true })\n multiple: boolean;\n\n /** Disables the logic that handles selecting and focusing an option in the option list. */\n @Prop({ reflect: true })\n noSelect: boolean;\n\n /** A list of the selected options on the element. */\n @Prop({ mutable: true })\n selectedOptions: IOptionValue[] = [];\n\n /** Applies focus to the selected option. */\n @Prop({ reflect: true, mutable: true })\n showSelected: boolean;\n\n /** Translates to the role of the option list */\n @Prop()\n type: 'menu' | 'listbox' = 'listbox';\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when an option is selected or deselected.\n *\n * When the multi-select is enabled, the `value` property will be `undefined` and the `selectedOptions` property\n * will contain the selected option values.\n */\n @Event()\n change: EventEmitter<{ value: string; values: IOptionValue[] }>;\n\n /**\n * Emitted to indicate the intended state of the popover.\n * @private\n */\n @Event()\n popoverState: EventEmitter<{ open: boolean; action: 'close' | 'select' | 'open' }>;\n\n /**\n * Emitted when the component has finished rendering.\n * @private\n */\n @Event({ bubbles: false })\n ready: EventEmitter<undefined>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n this.hasOptions = !!this.hostElement.querySelectorAll(\n 'q2-option:not([separator]):not([separator=true]), q2-dropdown-item:not([separator]):not([separator=true])'\n ).length;\n }\n\n componentDidLoad(): void {\n overrideFocus(this.hostElement);\n this.checkOptions();\n this.selectedOptionsUpdated();\n this.ready.emit();\n }\n\n componentDidRender() {\n this.scheduledAfterRender.forEach(fn => fn());\n this.scheduledAfterRender = [];\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('click')\n handleClick(event: MouseEvent) {\n event.stopPropagation();\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.popoverState.emit({ open: true, action: 'open' });\n const { activeIndex } = this;\n if (typeof activeIndex === 'number' && activeIndex > -1) {\n this.setActiveOption();\n this.setFocusedOption();\n } else {\n this.setDefaultActiveElement();\n }\n }\n\n // #endregion\n // #region Public Methods API\n\n @Method()\n async getContents(): Promise<(HTMLQ2OptgroupElement | ValidOptionElements)[]> {\n return this.allContents;\n }\n\n @Method()\n async getOptions(): Promise<ValidOptionElements[]> {\n return this.allOptions;\n }\n\n @Method()\n async handleExternalKeydown(event: KeyboardEvent) {\n this.externalKeydownHandler(event);\n }\n\n @Method()\n async setActiveElement(index: number) {\n this.activeIndex = index;\n this.setActiveOption();\n this.setFocusedOption();\n }\n\n @Method()\n async setDefaultActiveElement() {\n this.activeIndex = this.getDefaultActiveIndex();\n this.setActiveOption();\n this.setFocusedOption();\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('selectedOptions')\n selectedOptionsUpdated() {\n if (this.multiple) {\n this.updateMultipleOptionAttrs();\n } else {\n this.updateSingleOptionAttrs();\n }\n }\n\n @Watch('showSelected')\n showSelectedUpdated(showSelected: boolean) {\n if (showSelected && this.selectedOptions.length === 0) {\n this.showSelected = false;\n return;\n }\n this.allOptions.forEach(option => {\n if (!('_multiSelectHidden' in option)) return;\n option._multiSelectHidden = showSelected ? !option.selected : false;\n });\n }\n\n // #endregion\n // #region Local Methods\n\n get allContents(): (HTMLQ2OptgroupElement | ValidOptionElements)[] {\n const rootSlot = this.getRootSlot(this.hostElement);\n const acceptedTags = new Set(['Q2-OPTGROUP', 'Q2-OPTION', 'Q2-DROPDOWN-ITEM']);\n return rootSlot.filter(element => acceptedTags.has(element.tagName)) as (\n | HTMLQ2OptgroupElement\n | ValidOptionElements\n )[];\n }\n\n get allOptions(): ValidOptionElements[] {\n const contents = this.allContents;\n\n const extractOptions = (\n elements: (HTMLQ2OptgroupElement | ValidOptionElements | Element)[]\n ): ValidOptionElements[] => {\n return elements.reduce((acc, element) => {\n if (element.tagName === 'Q2-OPTION' || element.tagName === 'Q2-DROPDOWN-ITEM') {\n return (element as ValidOptionElements).separator ? acc : [...acc, element];\n } else if (element.tagName === 'Q2-OPTGROUP') {\n return [...acc, ...extractOptions(Array.from(element.children))];\n } else {\n return acc;\n }\n }, []);\n };\n\n return extractOptions(contents);\n }\n\n get allVisibleOptions(): ValidOptionElements[] {\n return this.allOptions.filter(\n option =>\n !option.hidden &&\n (!('_multiSelectHidden' in option) || !option._multiSelectHidden) &&\n !option.disabled &&\n (!('disabledGroup' in option) || !option.disabledGroup)\n );\n }\n\n adjustActiveOptionAndScroll(numToAdd: number) {\n this.activeIndex += numToAdd;\n this.setActiveOption();\n this.setFocusedOption();\n this.scrollToActiveOption();\n }\n\n checkOptions() {\n const { type } = this;\n if (!type) return;\n const optionRole = type === 'menu' ? 'menuitem' : 'option';\n this.allOptions.forEach(option => {\n option.role = optionRole;\n });\n }\n\n clickHandler = (event: Event) => {\n const target = event.target as ValidOptionElements;\n const option = target.closest<ValidOptionElements>(\n 'q2-option:not([separator]):not([separator=true]), q2-dropdown-item:not([separator]):not([separator=true])'\n );\n this.selectOption(option);\n if (this.multiple) return;\n this.popoverState.emit({ open: false, action: 'select' });\n };\n\n /* tslint:disable:cyclomatic-complexity */\n externalKeydownHandler = (event: KeyboardEvent) => {\n event.stopPropagation();\n const { activeIndex, customSearch, allOptions } = this;\n const { key } = event;\n\n let nextIndex;\n switch (key) {\n case ' ':\n if (this.searchString) {\n if (customSearch) break;\n\n this.searchOptions(key, true);\n break;\n } else if (this.type === 'menu') {\n this.activeIndex = 0;\n this.openDropdownWithActiveElement(0);\n } else {\n this.setDefaultActiveElement();\n nextPaint(() => this.popoverState.emit({ open: true, action: 'open' }));\n }\n break;\n\n case 'Enter':\n if (this.type === 'menu') {\n this.activeIndex = 0;\n this.openDropdownWithActiveElement(0);\n } else {\n this.setDefaultActiveElement();\n nextPaint(() => this.popoverState.emit({ open: true, action: 'open' }));\n }\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n nextIndex = !!this.selectedOptions.length ? this.getDefaultActiveIndex() : this.getNextVisibleIndex(-1);\n if (nextIndex === -1) break;\n this.openDropdownWithActiveElement(nextIndex);\n break;\n\n case 'ArrowDown':\n event.preventDefault();\n nextIndex = !!this.selectedOptions.length ? this.getDefaultActiveIndex() : this.getNextVisibleIndex(1);\n if (nextIndex === -1) break;\n this.openDropdownWithActiveElement(nextIndex);\n break;\n\n case 'Home':\n event.preventDefault();\n this.openDropdownWithActiveElement(0);\n break;\n\n case 'End':\n event.preventDefault();\n this.openDropdownWithActiveElement(allOptions.length - 1);\n break;\n\n case 'PageUp':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.max((activeIndex || 0) - 10, 0));\n break;\n\n case 'PageDown':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.min((activeIndex || 0) + 10, allOptions.length - 1));\n break;\n\n case 'Tab':\n this.popoverState.emit({ open: false, action: 'close' });\n break;\n\n case 'Esc':\n case 'Escape':\n if (this.noSelect) this.setActiveElement(null);\n this.popoverState.emit({ open: false, action: 'close' });\n break;\n\n default:\n if (customSearch) break;\n if (!key.match(/^[\\w]$/)) break;\n\n this.searchOptions(key, true);\n break;\n }\n };\n\n /* tslint:enable:cyclomatic-complexity */\n\n focusoutHandler = (event: FocusEvent) => {\n const { relatedTarget } = event as unknown as { relatedTarget: ValidOptionElements };\n const isInQ2OptionList = this.allOptions.includes(relatedTarget);\n const isInLightDom = !isInQ2OptionList && this.hostElement.contains(relatedTarget);\n if (isInQ2OptionList || isInLightDom) {\n event.stopPropagation();\n }\n };\n\n focusSelectedSibling(option: ValidOptionElements) {\n const { allVisibleOptions, allOptions } = this;\n const hasNoSiblings = allVisibleOptions.length < 2;\n if (hasNoSiblings) {\n this.showSelected = false;\n return;\n }\n\n const selectedOptionVisibleIndex = allVisibleOptions.indexOf(option);\n const nextVisibleSiblingIndex = selectedOptionVisibleIndex\n ? selectedOptionVisibleIndex - 1\n : selectedOptionVisibleIndex + 1;\n const nextVisibleSibling = allVisibleOptions[nextVisibleSiblingIndex];\n const nextSiblingIndex = allOptions.indexOf(nextVisibleSibling);\n\n this.activeIndex = nextSiblingIndex;\n this.setFocusedOption();\n this.scheduledAfterRender.push(() => {\n if (!('_multiSelectHidden' in option)) return;\n option._multiSelectHidden = !option.selected;\n });\n }\n\n getDefaultActiveIndex() {\n const { allOptions } = this;\n const firstSelected = allOptions.findIndex(element => {\n return 'selected' in element && element.selected;\n });\n if (firstSelected > -1) return firstSelected;\n\n const firstEnabled = allOptions.findIndex(element => !element.hidden);\n if (firstEnabled > -1) return firstEnabled;\n\n return 0;\n }\n\n getNextVisibleIndex(direction) {\n const { allVisibleOptions, allOptions, activeIndex } = this;\n const activeOption = allOptions[activeIndex];\n const visibleActiveOptionIndex = allVisibleOptions.indexOf(activeOption);\n let nextVisibleOptionIndex = visibleActiveOptionIndex + direction;\n\n if (nextVisibleOptionIndex < 0) {\n nextVisibleOptionIndex = allVisibleOptions.length - 1;\n } else if (nextVisibleOptionIndex > allVisibleOptions.length - 1) {\n nextVisibleOptionIndex = 0;\n }\n\n const nextVisibleOption = allVisibleOptions[nextVisibleOptionIndex];\n return allOptions.indexOf(nextVisibleOption);\n }\n\n getRootSlot(element: Element): Element[] {\n const slot = element.querySelector('slot');\n const assignedElements = slot?.assignedElements() ?? Array.from(element.children);\n const hasAnotherSlot = !!assignedElements.length && assignedElements[0].tagName === 'SLOT';\n if (hasAnotherSlot) {\n return this.getRootSlot(assignedElements[0]);\n } else {\n return assignedElements;\n }\n }\n\n internalKeydownHandler = (event: KeyboardEvent) => {\n event.stopPropagation();\n const { activeIndex, customSearch, allOptions, allVisibleOptions, multiple } = this;\n const { key, shiftKey } = event;\n\n let newOption: ValidOptionElements;\n switch (key) {\n case ' ':\n if (this.searchString && !this.multiple) {\n if (customSearch) break;\n\n this.searchOptions(key, false);\n break;\n }\n\n event.preventDefault();\n newOption = allOptions.find(element => element.active);\n if (!newOption || newOption.disabled) break;\n this.selectOption(newOption);\n if (multiple) break;\n this.popoverState.emit({ open: false, action: 'select' });\n break;\n\n case 'Enter':\n event.preventDefault();\n newOption = allOptions.find(element => element.active);\n if (!newOption || newOption.disabled) break;\n this.selectOption(newOption);\n if (multiple) break;\n this.popoverState.emit({ open: false, action: 'select' });\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n const firstVisibleOption = allVisibleOptions[0];\n const isFirstVisibleOptionActive = firstVisibleOption.active;\n if (isFirstVisibleOptionActive) break;\n if (activeIndex === undefined) {\n this.setDefaultActiveElement();\n break;\n } else {\n const nextIndex = this.getNextVisibleIndex(-1);\n if (nextIndex === -1) break;\n this.adjustActiveOptionAndScroll(nextIndex - activeIndex);\n break;\n }\n\n case 'ArrowDown':\n event.preventDefault();\n const lastVisibleOption = allVisibleOptions[allVisibleOptions.length - 1];\n const isLastVisibleOptionActive = lastVisibleOption.active;\n if (isLastVisibleOptionActive) break;\n if (activeIndex === undefined) {\n this.setDefaultActiveElement();\n break;\n } else {\n const nextIndex = this.getNextVisibleIndex(1);\n if (nextIndex === -1) break;\n this.adjustActiveOptionAndScroll(nextIndex - activeIndex);\n break;\n }\n\n case 'Home':\n event.preventDefault();\n this.openDropdownWithActiveElement(0);\n break;\n\n case 'End':\n event.preventDefault();\n this.openDropdownWithActiveElement(allOptions.length - 1);\n break;\n\n case 'PageUp':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.max(activeIndex - 10, 0));\n break;\n\n case 'PageDown':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.min(activeIndex + 10, allOptions.length - 1));\n break;\n\n case 'Tab':\n if (shiftKey) break;\n if (this.multiple && this.type === 'listbox') break;\n if (this.type === 'menu') {\n this.popoverState.emit({ open: false, action: 'close' });\n break;\n }\n\n newOption = allOptions.find(element => element.active);\n if (!newOption || newOption.disabled) return;\n this.selectOption(newOption);\n break;\n\n case 'Esc':\n case 'Escape':\n if (this.noSelect) this.setActiveElement(null);\n this.popoverState.emit({ open: false, action: 'close' });\n break;\n\n default:\n if (customSearch) break;\n if (!key.match(/^[\\w]$/)) break;\n\n this.searchOptions(key, false);\n break;\n }\n };\n\n async openDropdownWithActiveElement(activeIndex: number) {\n if (this.disabled) return;\n this.popoverState.emit({ open: true, action: 'open' });\n await waitForNextPaint();\n this.activeIndex = activeIndex;\n this.setActiveOption();\n this.setFocusedOption();\n this.scrollToActiveOption();\n }\n\n resetTimer() {\n if (this.searchStringTimer) {\n clearTimeout(this.searchStringTimer);\n }\n\n this.searchStringTimer = window.setTimeout(() => {\n this.searchString = null;\n }, 2000);\n }\n\n scrollToActiveOption() {\n const activeOption = this.allOptions[this.activeIndex];\n activeOption?.scrollIntoView({ block: 'center' });\n }\n\n searchAndFocus = (keyValue: string, shouldSelect: boolean) => {\n // pseudo search in non-searchable select\n const reorder = () => {\n this.pivotIndex = this.pivotIndex === undefined ? 0 : (this.activeIndex || 0) + 1;\n const list = this.allOptions.map((element, index) => ({ element, index }));\n return [...list.slice(this.pivotIndex), ...list.slice(0, this.pivotIndex)];\n };\n\n const buildQueue = () => {\n const now = new Date();\n if (now.getTime() - this.keyStore.lastPressedAt.getTime() > 1000) {\n // empty stored keys if delay > 1s\n this.keyStore.queue.length = 0;\n }\n if (this.keyStore.queue.length !== 1 || this.keyStore.queue[0] !== keyValue) {\n this.keyStore.queue.push(keyValue);\n }\n this.keyStore.lastPressedAt = now;\n };\n\n const searchIndex = (list: any[]) => {\n const keyStr = this.keyStore.queue.join('');\n const sanitizedKeyStr = sanitizeRegexString(keyStr);\n return list.find(v => {\n return (\n !v.element.disabled &&\n v.element.display &&\n (v.element.display.match(new RegExp(`^${sanitizedKeyStr}`, 'i')) ||\n v.element.display.replace(/\\s/g, '').match(new RegExp(`^${sanitizedKeyStr}`, 'i')))\n );\n });\n };\n\n const setFocus = ({ index }) => {\n if (this.multiple) {\n // multiple: should open to make sure that which options are selected\n this.openDropdownWithActiveElement(index);\n } else {\n this.activeIndex = index;\n if (shouldSelect) {\n this.selectOption(this.allOptions[index]);\n this.popoverState.emit({ open: false, action: 'select' });\n } else this.setActiveElement(index);\n }\n };\n\n buildQueue();\n const matched = searchIndex(reorder());\n if (matched) {\n setFocus(matched);\n }\n };\n\n searchOptions(key: string, shouldSelect?: boolean) {\n this.searchString = key;\n this.searchAndFocus(key, shouldSelect);\n }\n\n selectOption(selectedOption: ValidOptionElements) {\n const { multiple, noSelect, showSelected } = this;\n if (\n !selectedOption ||\n selectedOption.disabled ||\n ('disabledGroup' in selectedOption && selectedOption.disabledGroup)\n )\n return;\n const selectedValue = selectedOption.value;\n const displayValue =\n 'display' in selectedOption && selectedOption.display\n ? selectedOption.display\n : selectedOption.innerText.trim();\n const valueObject = {\n value: selectedValue,\n display: displayValue,\n };\n\n let values: IOptionValue[] = [];\n if (multiple) {\n const { selectedOptions } = this;\n const isAlreadySelected = selectedOptions.find(option => option.value === selectedValue);\n\n if (isAlreadySelected) {\n values = selectedOptions.filter(({ value }) => value !== selectedValue);\n } else {\n values = [...selectedOptions, valueObject];\n }\n\n if (showSelected) this.focusSelectedSibling(selectedOption);\n } else {\n values = [valueObject];\n }\n\n if (noSelect) this.setActiveElement(null);\n else this.selectedOptions = values;\n\n this.change.emit({ value: selectedValue, values });\n }\n\n setActiveOption() {\n const activeIndex = this.activeIndex;\n\n this.allOptions.forEach((element, elementIndex) => {\n element.active = activeIndex === elementIndex;\n });\n }\n\n setFocusedOption() {\n const option = this.allOptions[this.activeIndex];\n if (!option) return;\n\n const isOptionVisible = isVisible(option);\n if (isOptionVisible) option.focus();\n else nextPaint(() => option.focus());\n }\n\n updateMultipleOptionAttrs() {\n const { allOptions, selectedOptions } = this;\n const selectedValues = selectedOptions.map(({ value }) => value);\n if (this.noSelect) return;\n allOptions.forEach(element => {\n if (!('selected' in element)) return;\n element.selected = selectedValues.includes(element.value);\n });\n }\n\n updateSingleOptionAttrs() {\n const { allOptions, selectedOptions } = this;\n const selectedValue = selectedOptions[0]?.value || undefined;\n if (this.noSelect) return;\n allOptions.forEach(element => {\n if (!('selected' in element)) return;\n element.selected = element.value === selectedValue;\n });\n }\n\n // #endregion\n // #region Render Methods\n\n render() {\n return (\n <Host>\n <div\n class=\"content\"\n ref={el => (this.contentElement = el)}\n onFocusout={this.focusoutHandler}\n >\n <div\n class=\"options\"\n aria-label={loc('tecton.element.optionList.label', [this.label])}\n aria-multiselectable={`${!!this.multiple}`}\n role={this.type || 'listbox'}\n onKeyDown={this.internalKeydownHandler}\n onClick={this.clickHandler}\n >\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n\n // #endregion\n}\n","@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n.container {\n display: none;\n}\n\n.show {\n display: block;\n position: fixed;\n z-index: var-list(--tct-popover-z-index, 50);\n margin: 0;\n padding: 0;\n overflow: auto;\n background: var-list(--tct-popover-background, --app-white, #ffffff);\n color: var-list(--tct-popover-font-color, --t-text, #4d4d4d);\n min-width: var-list(--tct-popover-min-width, 135px);\n margin-block: var-list(--tct-popover-margin-block, 0);\n box-shadow: var-list(--tct-popover-box-shadow, --app-shadow-1, unquote(\"0px 0px 2px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.14)\"));\n border-width: var-list(--tct-popover-border-width, 0);\n border-style: solid;\n border-color: var-list(--tct-popover-border-color, transparent);\n border-radius: var-list(--tct-popover-border-radius, 0);\n // the following --comp variables are set via JS\n max-height: var(--comp-pop-max-height);\n left: var(--comp-pop-left);\n opacity: var(--comp-pop-opacity, 0);\n\n :host([block]) & {\n right: unset;\n width: var(--comp-pop-width);\n min-width: var-list(--tct-popover-min-width, unset);\n }\n\n :host([align='left']) & {\n left: var(--comp-pop-left);\n right: unset;\n }\n\n :host([align='right']) & {\n right: var(--comp-pop-right);\n left: unset;\n }\n\n &.down {\n top: var-list(--tct-popover-top, --comp-pop-top);\n bottom: unset;\n }\n\n &.up {\n top: unset;\n bottom: var(--comp-pop-bottom);\n }\n\n &.legacy {\n position: absolute;\n }\n\n @include tiny-scrollbar();\n}\n\nclick-elsewhere {\n position: relative;\n display: block;\n}\n","import {\n Component,\n Prop,\n h,\n ComponentInterface,\n Element,\n Watch,\n Method,\n Listen,\n EventEmitter,\n Event,\n State,\n} from '@stencil/core';\nimport { handleDeprecationWarning, waitForNextPaint } from '../../utils';\n\n@Component({ tag: 'q2-popover', shadow: true, styleUrl: 'q2-popover.scss' })\nexport class Q2Popover implements ComponentInterface {\n // #region Own Properties\n\n containerElement: HTMLDivElement;\n contentElement: HTMLDivElement;\n /**\n * The number of pixels to leave between the popover and the edge of the viewport\n */\n displayBuffer = 10;\n /** remove when Popover API is supported in iOS */\n orientationChanged: boolean = false;\n rootElementRect: DOMRect;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n currentDirection: 'down' | 'up' = undefined;\n\n // remove `show` when Popover API is supported in iOS\n @State()\n show: boolean = false;\n\n // #endregion\n // #region Public Property API\n\n /** Aligns the popover to the left or right side of the control element. */\n @Prop({ reflect: true })\n align: 'left' | 'right';\n\n /** Indicates the popover will match the width of its parent element. */\n @Prop({ reflect: true })\n block: boolean;\n\n /** The element that controls the popover's behavior. */\n @Prop()\n controlElement: HTMLElement;\n\n /**\n * Force the direction of the popover when it opens.\n * If no value is passed, the component will auto-detect the direction based on available space.\n */\n @Prop({ reflect: true })\n direction: 'up' | 'down';\n\n /**\n * Force the maximum height of the popover. This value will be interpreted as pixels.\n * If no value is passed, or the value exceeds available space, the component will auto-detect the maximum height based on available space.\n */\n @Prop()\n maxHeight: number;\n\n /** @deprecated */\n @Prop()\n minHeight: number;\n\n @Prop()\n mode: 'legacy' = null;\n\n /** Controls whether the popover is open or closed. */\n @Prop({ reflect: true, mutable: true })\n open: boolean;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the popover is opened or closed.\n */\n @Event()\n popoverStateChanged: EventEmitter<{ open: boolean }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback() {\n this.removeViewportListeners();\n }\n\n componentDidLoad() {\n this.handleMinHeight();\n if (this.open) this.determinePopDirection();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('popoverState')\n popoverStateHandler(event: CustomEvent<{ open: boolean }>) {\n const {\n detail: { open },\n } = event;\n if (open === this.open) return;\n\n this.open = open;\n event.stopPropagation();\n }\n\n // #endregion\n // #region Public Methods API\n\n @Method()\n async scrollContainerTo(options: ScrollToOptions) {\n this.containerElement.scrollTo(options);\n }\n\n @Method()\n async toggle() {\n this.open = !this.open;\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('minHeight')\n minHeightProvided() {\n this.handleMinHeight();\n }\n\n @Watch('open')\n async openChanged(open: boolean) {\n this.setRootElement();\n this.popoverStateChanged.emit({ open });\n\n if (open) {\n this.addViewportListeners();\n this.determinePopDirection();\n } else {\n this.removeViewportListeners();\n this.currentDirection = undefined;\n this.show = false;\n await waitForNextPaint();\n this.clearCSSProperties();\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get isModule() {\n const isIframe = window !== window.top;\n const hasPlatformDimensions = Object.keys(window.Tecton?.platformDimensions ?? {}).length > 0;\n return isIframe && hasPlatformDimensions;\n }\n\n get providedDirection(): 'up' | 'down' | undefined {\n const { direction } = this;\n switch (direction) {\n case 'up':\n case 'down':\n return direction;\n default:\n return undefined;\n }\n }\n\n get validatedMaxHeight(): number | undefined {\n const { maxHeight } = this;\n return isNaN(maxHeight) ? undefined : maxHeight;\n }\n\n addViewportListeners() {\n window.addEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });\n screen?.orientation?.addEventListener('change', this.viewPortOrientationChanged);\n window.addEventListener('orientationchange', this.viewPortOrientationChanged);\n\n // #endregion\n }\n\n clearCSSProperties() {\n this.containerElement.style.removeProperty('--comp-pop-max-height');\n this.containerElement.style.removeProperty('--comp-pop-top');\n this.containerElement.style.removeProperty('--comp-pop-bottom');\n this.containerElement.style.removeProperty('--comp-pop-left');\n this.containerElement.style.removeProperty('--comp-pop-right');\n this.containerElement.style.removeProperty('--comp-pop-width');\n this.containerElement.style.removeProperty('--comp-pop-opacity');\n }\n\n async determinePopDirection() {\n const { containerElement, controlElement, providedDirection, displayBuffer } = this;\n if (containerElement) containerElement.style.maxHeight = null;\n\n await waitForNextPaint();\n\n const { isModule } = this;\n const { top: controlTop, bottom: controlBottom } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n };\n\n let windowHeight: number;\n let maxSpaceAbove: number;\n let maxSpaceBelow: number;\n\n if (isModule) {\n const { outletOffset = 0, innerHeight = window.innerHeight } = window.Tecton?.platformDimensions || {};\n const distanceToIframeBottom = window.visualViewport.height - controlBottom;\n const viewableSpaceBelow = innerHeight - (outletOffset + controlBottom);\n const isIframeShorterThanWindow = distanceToIframeBottom < viewableSpaceBelow;\n windowHeight = innerHeight;\n // If the top of the module is below the top of the window we just use the controlTop\n // Otherwise we need to add the outletOffset to the controlTop\n maxSpaceAbove = (outletOffset > 0 ? controlTop : controlTop + outletOffset) - displayBuffer;\n maxSpaceBelow = isIframeShorterThanWindow\n ? distanceToIframeBottom - displayBuffer\n : viewableSpaceBelow - displayBuffer;\n } else {\n windowHeight = window.visualViewport.height;\n maxSpaceAbove = controlTop - displayBuffer;\n maxSpaceBelow = windowHeight - controlBottom - displayBuffer;\n }\n\n const directionWithMostSpace: 'up' | 'down' = maxSpaceAbove > maxSpaceBelow ? 'up' : 'down';\n\n // We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)\n const shouldUpdateMaxHeight =\n !containerElement.style.getPropertyValue('--comp-pop-max-height') || this.orientationChanged;\n // we do not want to constantly update the max-height after an orientation change, so we switch this back to false\n this.orientationChanged = false;\n const currentOrDetermineDirection = this.currentDirection || providedDirection || directionWithMostSpace;\n\n switch (currentOrDetermineDirection) {\n case 'up':\n if (shouldUpdateMaxHeight) {\n const priorityMaxHeight = this.validatedMaxHeight || maxSpaceAbove;\n const maxHeight = Math.min(maxSpaceAbove, priorityMaxHeight);\n containerElement.style.setProperty('--comp-pop-max-height', `${maxHeight}px`);\n }\n this.setDirectionAndShow('up');\n break;\n case 'down':\n if (shouldUpdateMaxHeight) {\n const priorityMaxHeight = this.validatedMaxHeight || maxSpaceBelow;\n const maxHeight = Math.min(maxSpaceBelow, priorityMaxHeight);\n containerElement.style.setProperty('--comp-pop-max-height', `${maxHeight}px`);\n }\n this.setDirectionAndShow('down');\n break;\n default:\n break;\n }\n }\n\n handleMinHeight = () => {\n if (this.minHeight) {\n handleDeprecationWarning(this, 'minHeight', 'prop');\n }\n };\n\n removeViewportListeners() {\n window.removeEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.removeEventListener('scroll', this.viewPortChanged);\n screen?.orientation?.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n window.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n\n // #endregion\n }\n\n setAbsoluteCSSProperties = async () => {\n const { controlElement, containerElement, currentDirection, align } = this;\n\n if (align === 'right') {\n containerElement.style.setProperty('--comp-pop-right', '0');\n containerElement.style.setProperty('--comp-pop-left', 'unset');\n } else {\n containerElement.style.setProperty('--comp-pop-left', '0');\n containerElement.style.setProperty('--comp-pop-right', 'unset');\n }\n\n if (this.block) {\n containerElement.style.setProperty('--comp-pop-width', '100%');\n }\n\n if (currentDirection === 'up') {\n const controlStyle = getComputedStyle(controlElement);\n const controlSize =\n parseInt(controlStyle.height || '0') +\n parseInt(controlStyle.borderTopWidth || '0') +\n parseInt(controlStyle.borderBottomWidth || '0');\n\n containerElement.style.setProperty('--comp-pop-bottom', `${controlSize}px`);\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n setDirectionAndShow(direction: 'up' | 'down') {\n this.setRootElement();\n // Due to some runtime inconsistency across devices/browsers we need to add one more check here because the\n // popover can be closed between the time the popover is opened and the time the direction is determined\n const isOpen = this.open;\n if (!isOpen) return;\n\n this.currentDirection = direction;\n this.show = true;\n if (this.mode === 'legacy') {\n this.setAbsoluteCSSProperties();\n } else {\n this.setFixedCSSProperties();\n }\n }\n\n setFixedCSSProperties = async () => {\n const { controlElement, containerElement, currentDirection, rootElementRect } = this;\n const {\n top: controlTop,\n bottom: controlBottom,\n left: controlLeft,\n right: controlRight,\n } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n };\n const popoverLeft: number = controlLeft - rootElementRect.left;\n\n if (this.block) containerElement.style.setProperty('--comp-pop-width', `${controlElement?.offsetWidth || 0}px`);\n containerElement.style.setProperty('--comp-pop-left', `${popoverLeft}px`);\n containerElement.style.setProperty(\n '--comp-pop-right',\n `${rootElementRect.width + rootElementRect.left - controlRight}px`\n );\n\n if (currentDirection === 'up') {\n containerElement.style.setProperty(\n '--comp-pop-bottom',\n `${rootElementRect.height + rootElementRect.top - controlTop}px`\n );\n }\n if (currentDirection === 'down') {\n containerElement.style.setProperty('--comp-pop-top', `${controlBottom - rootElementRect.top}px`);\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n setRootElement() {\n let currentElement: HTMLElement = this.hostElement;\n\n while (currentElement && currentElement !== document.documentElement) {\n const computedStyle = window.getComputedStyle(currentElement);\n\n // Check if the element has any styles applied that create a new containg block\n if (\n computedStyle.transform !== 'none' ||\n computedStyle.filter !== 'none' ||\n computedStyle.perspective !== 'none' ||\n computedStyle.containerType !== 'normal' ||\n ['transform', 'perspective', 'filter'].includes(computedStyle.willChange) ||\n ['layout', 'paint', 'strict', 'content'].includes(computedStyle.contain)\n ) {\n this.rootElementRect = currentElement.getBoundingClientRect();\n return;\n }\n\n const rootNode = currentElement.getRootNode();\n const isRootNodeWebComponent =\n typeof ShadowRoot !== 'undefined' &&\n rootNode instanceof ShadowRoot &&\n rootNode.host instanceof HTMLElement;\n if (isRootNodeWebComponent) {\n currentElement = rootNode.host;\n } else {\n currentElement = currentElement.parentElement;\n }\n }\n\n // Return the document's bounding rect if no element is found\n this.rootElementRect = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n height: window.visualViewport.height,\n width: window.visualViewport.width,\n } as DOMRect;\n }\n\n viewPortChanged = () => {\n if (!this.open) return;\n this.determinePopDirection();\n };\n\n viewPortOrientationChanged = () => {\n this.orientationChanged = true;\n this.viewPortChanged();\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const containerClasses = ['container', this.currentDirection];\n if (this.show) containerClasses.push('show');\n if (this.mode === 'legacy') containerClasses.push('legacy');\n\n return (\n <div\n ref={el => (this.containerElement = el)}\n class={containerClasses.join(' ')}\n test-id=\"outerContainer\"\n tabIndex={-1}\n >\n <div\n ref={el => (this.contentElement = el)}\n class=\"content\"\n >\n <slot />\n </div>\n </div>\n );\n }\n\n // #endregion\n}\n"],"mappings":";;;;SAAwBA,oBAAoBC;EACxC,OAAOA,EAAYC,QAAQ,uBAAuB;AACtD;;ACFA,MAAMC,IAAkB;;AACxB,MAAAC,IAAeD;;MCwBFE,IAAY;;;;;;IAKrBC,KAAAC,WAGI;MACAC,OAAO;MACPC,eAAe,IAAIC;;IAGvBJ,KAAAK,uBAAuC;IAgPvCL,KAAAM,eAAgBC;MACZ,MAAMC,IAASD,EAAMC;MACrB,MAAMC,IAASD,EAAOE,QAClB;MAEJV,KAAKW,aAAaF;MAClB,IAAIT,KAAKY,UAAU;MACnBZ,KAAKa,aAAaC,KAAK;QAAEC,MAAM;QAAOC,QAAQ;;AAAW;kDAI7DhB,KAAAiB,yBAA0BV;MACtBA,EAAMW;MACN,OAAMC,aAAEA,GAAWC,cAAEA,GAAYC,YAAEA,KAAerB;MAClD,OAAMsB,KAAEA,KAAQf;MAEhB,IAAIgB;MACJ,QAAQD;OACJ,KAAK;QACD,IAAItB,KAAKwB,cAAc;UACnB,IAAIJ,GAAc;UAElBpB,KAAKyB,cAAcH,GAAK;UACxB;eACG,IAAItB,KAAK0B,SAAS,QAAQ;UAC7B1B,KAAKmB,cAAc;UACnBnB,KAAK2B,8BAA8B;eAChC;UACH3B,KAAK4B;UACLC,GAAU,MAAM7B,KAAKa,aAAaC,KAAK;YAAEC,MAAM;YAAMC,QAAQ;;;QAEjE;;OAEJ,KAAK;QACD,IAAIhB,KAAK0B,SAAS,QAAQ;UACtB1B,KAAKmB,cAAc;UACnBnB,KAAK2B,8BAA8B;eAChC;UACH3B,KAAK4B;UACLC,GA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ACrC,IAAI1E,KAAKuR,SAAS,UAAUiB,EAAiB9N,KAAK;IAElD,OACIuG,EAAA;MAAA3J,KAAA;MACI8J,KAAKC,KAAOrL,KAAKsM,mBAAmBjB;MACpCF,OAAOqH,EAAiB3N,KAAK;MAAI,WACzB;MACR4N,WAAW;OAEXxH,EAAA;MAAA3J,KAAA;MACI8J,KAAKC,KAAOrL,KAAKsL,iBAAiBD;MAClCF,OAAM;OAENF,EAAA;MAAA3J,KAAA"}
|
|
1
|
+
{"version":3,"names":["sanitizeRegexString","regexString","replace","q2OptionListCss","Q2OptionListStyle0","Q2OptionList","this","keyStore","queue","lastPressedAt","Date","scheduledAfterRender","clickHandler","event","target","option","closest","selectOption","multiple","popoverState","emit","open","action","externalKeydownHandler","stopPropagation","activeIndex","customSearch","allOptions","key","nextIndex","searchString","searchOptions","type","openDropdownWithActiveElement","setDefaultActiveElement","nextPaint","preventDefault","selectedOptions","length","getDefaultActiveIndex","getNextVisibleIndex","Math","max","min","noSelect","setActiveElement","match","focusoutHandler","relatedTarget","isInQ2OptionList","includes","isInLightDom","hostElement","contains","internalKeydownHandler","allVisibleOptions","shiftKey","newOption","find","element","active","disabled","addEventListener","once","firstVisibleOption","isFirstVisibleOptionActive","undefined","adjustActiveOptionAndScroll","lastVisibleOption","isLastVisibleOptionActive","searchAndFocus","keyValue","shouldSelect","reorder","pivotIndex","list","map","index","slice","buildQueue","now","getTime","push","searchIndex","keyStr","join","sanitizedKeyStr","v","display","RegExp","setFocus","matched","loc","componentWillLoad","hasOptions","querySelectorAll","componentDidLoad","overrideFocus","checkOptions","selectedOptionsUpdated","ready","componentDidRender","forEach","fn","handleClick","delegateFocus","isEventFromElement","setActiveOption","setFocusedOption","getContents","allContents","getOptions","handleExternalKeydown","updateMultipleOptionAttrs","updateSingleOptionAttrs","showSelectedUpdated","showSelected","_multiSelectHidden","selected","rootSlot","getRootSlot","acceptedTags","Set","filter","has","tagName","contents","extractOptions","elements","reduce","acc","separator","Array","from","children","hidden","disabledGroup","numToAdd","scrollToActiveOption","optionRole","role","focusSelectedSibling","hasNoSiblings","selectedOptionVisibleIndex","indexOf","nextVisibleSiblingIndex","nextVisibleSibling","nextSiblingIndex","firstSelected","findIndex","firstEnabled","direction","activeOption","visibleActiveOptionIndex","nextVisibleOptionIndex","nextVisibleOption","slot","querySelector","assignedElements","_a","hasAnotherSlot","waitForNextPaint","resetTimer","searchStringTimer","clearTimeout","window","setTimeout","scrollIntoView","block","selectedOption","selectedValue","value","displayValue","innerText","trim","valueObject","values","isAlreadySelected","change","elementIndex","isOptionVisible","isVisible","focus","selectedValues","render","h","Host","class","ref","el","contentElement","onFocusout","label","onKeyDown","onClick","q2PopoverCss","Q2PopoverStyle0","Q2Popover","displayBuffer","orientationChanged","handleMinHeight","minHeight","handleDeprecationWarning","setAbsoluteCSSProperties","async","controlElement","containerElement","currentDirection","align","style","setProperty","controlStyle","getComputedStyle","controlSize","parseInt","height","borderTopWidth","borderBottomWidth","setFixedCSSProperties","rootElementRect","top","controlTop","bottom","controlBottom","left","controlLeft","right","controlRight","_b","getBoundingClientRect","call","popoverLeft","offsetWidth","width","viewPortChanged","determinePopDirection","viewPortOrientationChanged","disconnectedCallback","removeViewportListeners","popoverStateHandler","detail","scrollContainerTo","options","scrollTo","toggle","minHeightProvided","openChanged","setRootElement","popoverStateChanged","addViewportListeners","show","clearCSSProperties","isModule","isIframe","hasPlatformDimensions","Object","keys","Tecton","platformDimensions","providedDirection","validatedMaxHeight","maxHeight","isNaN","passive","capture","screen","orientation","removeProperty","windowHeight","maxSpaceAbove","maxSpaceBelow","outletOffset","innerHeight","_c","distanceToIframeBottom","visualViewport","viewableSpaceBelow","isIframeShorterThanWindow","directionWithMostSpace","shouldUpdateMaxHeight","getPropertyValue","currentOrDetermineDirection","priorityMaxHeight","setDirectionAndShow","removeEventListener","isOpen","mode","currentElement","document","documentElement","computedStyle","transform","perspective","containerType","willChange","contain","rootNode","getRootNode","isRootNodeWebComponent","ShadowRoot","host","HTMLElement","parentElement","containerClasses","tabIndex"],"sources":["src/utils/sanitize-regex-string.ts","src/components/q2-option-list/q2-option-list.scss?tag=q2-option-list&encapsulation=shadow","src/components/q2-option-list/q2-option-list.tsx","src/components/q2-popover/q2-popover.scss?tag=q2-popover&encapsulation=shadow","src/components/q2-popover/q2-popover.tsx"],"sourcesContent":["export default function sanitizeRegexString(regexString: string) {\n return regexString.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n","@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host {\n position: relative;\n width: 100%;\n display: block;\n line-height: var-list(var-prefixer(option-list-line-height),--app-line-height, 1.428571429em);\n}\n\n.content {\n text-align: start;\n\n :host([is-sizeable]) & {\n display: block;\n height: auto;\n }\n}\n","import sanitizeRegexString from '@/utils/sanitize-regex-string';\nimport {\n Component,\n Prop,\n h,\n Event,\n State,\n Element,\n ComponentInterface,\n Host,\n EventEmitter,\n Method,\n Watch,\n Listen,\n} from '@stencil/core';\nimport { isEventFromElement, isVisible, loc, nextPaint, overrideFocus, waitForNextPaint } from 'src/utils';\n\nexport interface IOptionValue {\n value: string;\n display?: string;\n}\n\nexport type ValidOptionElements = HTMLQ2OptionElement | HTMLQ2DropdownItemElement;\n\n@Component({ tag: 'q2-option-list', shadow: true, styleUrl: 'q2-option-list.scss' })\nexport class Q2OptionList implements ComponentInterface {\n // #region Own Properties\n\n activeIndex: number;\n contentElement: HTMLElement;\n keyStore: {\n queue: string[];\n lastPressedAt: Date;\n } = {\n queue: [],\n lastPressedAt: new Date(),\n };\n pivotIndex: number;\n scheduledAfterRender: (() => void)[] = [];\n searchString: string;\n searchStringTimer: number;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n hasOptions: boolean;\n\n // #endregion\n // #region Public Property API\n\n @Prop({ reflect: true })\n align: 'left' | 'right';\n\n /** Indicates a custom search is being implemented for the option list. */\n @Prop({ reflect: true })\n customSearch: boolean;\n\n /** Disables the option list. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /** Determines the label that is applied to the option list for accessibility purposes. */\n @Prop()\n label: string = loc('tecton.element.optionList.label');\n\n /**\n * Enables the multi-select ability for the option list.\n * @info\n * Only applicable when options are provided.\n */\n @Prop({ reflect: true })\n multiple: boolean;\n\n /** Disables the logic that handles selecting and focusing an option in the option list. */\n @Prop({ reflect: true })\n noSelect: boolean;\n\n /** A list of the selected options on the element. */\n @Prop({ mutable: true })\n selectedOptions: IOptionValue[] = [];\n\n /** Applies focus to the selected option. */\n @Prop({ reflect: true, mutable: true })\n showSelected: boolean;\n\n /** Translates to the role of the option list */\n @Prop()\n type: 'menu' | 'listbox' = 'listbox';\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when an option is selected or deselected.\n *\n * When the multi-select is enabled, the `value` property will be `undefined` and the `selectedOptions` property\n * will contain the selected option values.\n */\n @Event()\n change: EventEmitter<{ value: string; values: IOptionValue[] }>;\n\n /**\n * Emitted to indicate the intended state of the popover.\n * @private\n */\n @Event()\n popoverState: EventEmitter<{ open: boolean; action: 'close' | 'select' | 'open' }>;\n\n /**\n * Emitted when the component has finished rendering.\n * @private\n */\n @Event({ bubbles: false })\n ready: EventEmitter<undefined>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n componentWillLoad() {\n this.hasOptions = !!this.hostElement.querySelectorAll(\n 'q2-option:not([separator]):not([separator=true]), q2-dropdown-item:not([separator]):not([separator=true])'\n ).length;\n }\n\n componentDidLoad(): void {\n overrideFocus(this.hostElement);\n this.checkOptions();\n this.selectedOptionsUpdated();\n this.ready.emit();\n }\n\n componentDidRender() {\n this.scheduledAfterRender.forEach(fn => fn());\n this.scheduledAfterRender = [];\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('click')\n handleClick(event: MouseEvent) {\n event.stopPropagation();\n }\n\n @Listen('focus')\n delegateFocus(event: FocusEvent) {\n if (!isEventFromElement(event, this.hostElement)) return;\n this.popoverState.emit({ open: true, action: 'open' });\n const { activeIndex } = this;\n if (typeof activeIndex === 'number' && activeIndex > -1) {\n this.setActiveOption();\n this.setFocusedOption();\n } else {\n this.setDefaultActiveElement();\n }\n }\n\n // #endregion\n // #region Public Methods API\n\n @Method()\n async getContents(): Promise<(HTMLQ2OptgroupElement | ValidOptionElements)[]> {\n return this.allContents;\n }\n\n @Method()\n async getOptions(): Promise<ValidOptionElements[]> {\n return this.allOptions;\n }\n\n @Method()\n async handleExternalKeydown(event: KeyboardEvent) {\n this.externalKeydownHandler(event);\n }\n\n @Method()\n async setActiveElement(index: number) {\n this.activeIndex = index;\n this.setActiveOption();\n this.setFocusedOption();\n }\n\n @Method()\n async setDefaultActiveElement() {\n this.activeIndex = this.getDefaultActiveIndex();\n this.setActiveOption();\n this.setFocusedOption();\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('selectedOptions')\n selectedOptionsUpdated() {\n if (this.multiple) {\n this.updateMultipleOptionAttrs();\n } else {\n this.updateSingleOptionAttrs();\n }\n }\n\n @Watch('showSelected')\n showSelectedUpdated(showSelected: boolean) {\n if (showSelected && this.selectedOptions.length === 0) {\n this.showSelected = false;\n return;\n }\n this.allOptions.forEach(option => {\n if (!('_multiSelectHidden' in option)) return;\n option._multiSelectHidden = showSelected ? !option.selected : false;\n });\n }\n\n // #endregion\n // #region Local Methods\n\n get allContents(): (HTMLQ2OptgroupElement | ValidOptionElements)[] {\n const rootSlot = this.getRootSlot(this.hostElement);\n const acceptedTags = new Set(['Q2-OPTGROUP', 'Q2-OPTION', 'Q2-DROPDOWN-ITEM']);\n return rootSlot.filter(element => acceptedTags.has(element.tagName)) as (\n | HTMLQ2OptgroupElement\n | ValidOptionElements\n )[];\n }\n\n get allOptions(): ValidOptionElements[] {\n const contents = this.allContents;\n\n const extractOptions = (\n elements: (HTMLQ2OptgroupElement | ValidOptionElements | Element)[]\n ): ValidOptionElements[] => {\n return elements.reduce((acc, element) => {\n if (element.tagName === 'Q2-OPTION' || element.tagName === 'Q2-DROPDOWN-ITEM') {\n return (element as ValidOptionElements).separator ? acc : [...acc, element];\n } else if (element.tagName === 'Q2-OPTGROUP') {\n return [...acc, ...extractOptions(Array.from(element.children))];\n } else {\n return acc;\n }\n }, []);\n };\n\n return extractOptions(contents);\n }\n\n get allVisibleOptions(): ValidOptionElements[] {\n return this.allOptions.filter(\n option =>\n !option.hidden &&\n (!('_multiSelectHidden' in option) || !option._multiSelectHidden) &&\n !option.disabled &&\n (!('disabledGroup' in option) || !option.disabledGroup)\n );\n }\n\n adjustActiveOptionAndScroll(numToAdd: number) {\n this.activeIndex += numToAdd;\n this.setActiveOption();\n this.setFocusedOption();\n this.scrollToActiveOption();\n }\n\n checkOptions() {\n const { type } = this;\n if (!type) return;\n const optionRole = type === 'menu' ? 'menuitem' : 'option';\n this.allOptions.forEach(option => {\n option.role = optionRole;\n });\n }\n\n clickHandler = (event: Event) => {\n const target = event.target as ValidOptionElements;\n const option = target.closest<ValidOptionElements>(\n 'q2-option:not([separator]):not([separator=true]), q2-dropdown-item:not([separator]):not([separator=true])'\n );\n this.selectOption(option);\n if (this.multiple) return;\n this.popoverState.emit({ open: false, action: 'select' });\n };\n\n /* tslint:disable:cyclomatic-complexity */\n externalKeydownHandler = (event: KeyboardEvent) => {\n event.stopPropagation();\n const { activeIndex, customSearch, allOptions } = this;\n const { key } = event;\n\n let nextIndex;\n switch (key) {\n case ' ':\n if (this.searchString) {\n if (customSearch) break;\n\n this.searchOptions(key, true);\n break;\n } else if (this.type === 'menu') {\n this.activeIndex = 0;\n this.openDropdownWithActiveElement(0);\n } else {\n this.setDefaultActiveElement();\n nextPaint(() => this.popoverState.emit({ open: true, action: 'open' }));\n }\n break;\n\n case 'Enter':\n if (this.type === 'menu') {\n this.activeIndex = 0;\n this.openDropdownWithActiveElement(0);\n } else {\n this.setDefaultActiveElement();\n nextPaint(() => this.popoverState.emit({ open: true, action: 'open' }));\n }\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n nextIndex = !!this.selectedOptions.length ? this.getDefaultActiveIndex() : this.getNextVisibleIndex(-1);\n if (nextIndex === -1) break;\n this.openDropdownWithActiveElement(nextIndex);\n break;\n\n case 'ArrowDown':\n event.preventDefault();\n nextIndex = !!this.selectedOptions.length ? this.getDefaultActiveIndex() : this.getNextVisibleIndex(1);\n if (nextIndex === -1) break;\n this.openDropdownWithActiveElement(nextIndex);\n break;\n\n case 'Home':\n event.preventDefault();\n this.openDropdownWithActiveElement(0);\n break;\n\n case 'End':\n event.preventDefault();\n this.openDropdownWithActiveElement(allOptions.length - 1);\n break;\n\n case 'PageUp':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.max((activeIndex || 0) - 10, 0));\n break;\n\n case 'PageDown':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.min((activeIndex || 0) + 10, allOptions.length - 1));\n break;\n\n case 'Tab':\n this.popoverState.emit({ open: false, action: 'close' });\n break;\n\n case 'Esc':\n case 'Escape':\n if (this.noSelect) this.setActiveElement(null);\n this.popoverState.emit({ open: false, action: 'close' });\n break;\n\n default:\n if (customSearch) break;\n if (!key.match(/^[\\w]$/)) break;\n\n this.searchOptions(key, true);\n break;\n }\n };\n\n /* tslint:enable:cyclomatic-complexity */\n\n focusoutHandler = (event: FocusEvent) => {\n const { relatedTarget } = event as unknown as { relatedTarget: ValidOptionElements };\n const isInQ2OptionList = this.allOptions.includes(relatedTarget);\n const isInLightDom = !isInQ2OptionList && this.hostElement.contains(relatedTarget);\n if (isInQ2OptionList || isInLightDom) {\n event.stopPropagation();\n }\n };\n\n focusSelectedSibling(option: ValidOptionElements) {\n const { allVisibleOptions, allOptions } = this;\n const hasNoSiblings = allVisibleOptions.length < 2;\n if (hasNoSiblings) {\n this.showSelected = false;\n return;\n }\n\n const selectedOptionVisibleIndex = allVisibleOptions.indexOf(option);\n const nextVisibleSiblingIndex = selectedOptionVisibleIndex\n ? selectedOptionVisibleIndex - 1\n : selectedOptionVisibleIndex + 1;\n const nextVisibleSibling = allVisibleOptions[nextVisibleSiblingIndex];\n const nextSiblingIndex = allOptions.indexOf(nextVisibleSibling);\n\n this.activeIndex = nextSiblingIndex;\n this.setFocusedOption();\n this.scheduledAfterRender.push(() => {\n if (!('_multiSelectHidden' in option)) return;\n option._multiSelectHidden = !option.selected;\n });\n }\n\n getDefaultActiveIndex() {\n const { allOptions } = this;\n const firstSelected = allOptions.findIndex(element => {\n return 'selected' in element && element.selected;\n });\n if (firstSelected > -1) return firstSelected;\n\n const firstEnabled = allOptions.findIndex(element => !element.hidden);\n if (firstEnabled > -1) return firstEnabled;\n\n return 0;\n }\n\n getNextVisibleIndex(direction) {\n const { allVisibleOptions, allOptions, activeIndex } = this;\n const activeOption = allOptions[activeIndex];\n const visibleActiveOptionIndex = allVisibleOptions.indexOf(activeOption);\n let nextVisibleOptionIndex = visibleActiveOptionIndex + direction;\n\n if (nextVisibleOptionIndex < 0) {\n nextVisibleOptionIndex = allVisibleOptions.length - 1;\n } else if (nextVisibleOptionIndex > allVisibleOptions.length - 1) {\n nextVisibleOptionIndex = 0;\n }\n\n const nextVisibleOption = allVisibleOptions[nextVisibleOptionIndex];\n return allOptions.indexOf(nextVisibleOption);\n }\n\n getRootSlot(element: Element): Element[] {\n const slot = element.querySelector('slot');\n const assignedElements = slot?.assignedElements() ?? Array.from(element.children);\n const hasAnotherSlot = !!assignedElements.length && assignedElements[0].tagName === 'SLOT';\n if (hasAnotherSlot) {\n return this.getRootSlot(assignedElements[0]);\n } else {\n return assignedElements;\n }\n }\n\n internalKeydownHandler = (event: KeyboardEvent) => {\n event.stopPropagation();\n const { activeIndex, customSearch, allOptions, allVisibleOptions, multiple } = this;\n const { key, shiftKey } = event;\n\n let newOption: ValidOptionElements;\n switch (key) {\n case ' ':\n if (this.searchString && !this.multiple) {\n if (customSearch) break;\n\n this.searchOptions(key, false);\n break;\n }\n\n newOption = allOptions.find(element => element.active);\n if (!newOption || newOption.disabled) break;\n this.selectOption(newOption);\n if (multiple) break;\n this.hostElement.addEventListener(\n 'tctClick',\n () => {\n this.popoverState.emit({ open: false, action: 'select' });\n },\n { once: true }\n );\n\n break;\n\n case 'Enter':\n newOption = allOptions.find(element => element.active);\n if (!newOption || newOption.disabled) break;\n this.selectOption(newOption);\n if (multiple) break;\n this.hostElement.addEventListener(\n 'tctClick',\n () => {\n this.popoverState.emit({ open: false, action: 'select' });\n },\n { once: true }\n );\n break;\n\n case 'ArrowUp':\n event.preventDefault();\n const firstVisibleOption = allVisibleOptions[0];\n const isFirstVisibleOptionActive = firstVisibleOption.active;\n if (isFirstVisibleOptionActive) break;\n if (activeIndex === undefined) {\n this.setDefaultActiveElement();\n break;\n } else {\n const nextIndex = this.getNextVisibleIndex(-1);\n if (nextIndex === -1) break;\n this.adjustActiveOptionAndScroll(nextIndex - activeIndex);\n break;\n }\n\n case 'ArrowDown':\n event.preventDefault();\n const lastVisibleOption = allVisibleOptions[allVisibleOptions.length - 1];\n const isLastVisibleOptionActive = lastVisibleOption.active;\n if (isLastVisibleOptionActive) break;\n if (activeIndex === undefined) {\n this.setDefaultActiveElement();\n break;\n } else {\n const nextIndex = this.getNextVisibleIndex(1);\n if (nextIndex === -1) break;\n this.adjustActiveOptionAndScroll(nextIndex - activeIndex);\n break;\n }\n\n case 'Home':\n event.preventDefault();\n this.openDropdownWithActiveElement(0);\n break;\n\n case 'End':\n event.preventDefault();\n this.openDropdownWithActiveElement(allOptions.length - 1);\n break;\n\n case 'PageUp':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.max(activeIndex - 10, 0));\n break;\n\n case 'PageDown':\n event.preventDefault();\n this.openDropdownWithActiveElement(Math.min(activeIndex + 10, allOptions.length - 1));\n break;\n\n case 'Tab':\n if (shiftKey) break;\n if (this.multiple && this.type === 'listbox') break;\n if (this.type === 'menu') {\n this.popoverState.emit({ open: false, action: 'close' });\n break;\n }\n\n newOption = allOptions.find(element => element.active);\n if (!newOption || newOption.disabled) return;\n this.selectOption(newOption);\n break;\n\n case 'Esc':\n case 'Escape':\n if (this.noSelect) this.setActiveElement(null);\n this.popoverState.emit({ open: false, action: 'close' });\n break;\n\n default:\n if (customSearch) break;\n if (!key.match(/^[\\w]$/)) break;\n\n this.searchOptions(key, false);\n break;\n }\n };\n\n async openDropdownWithActiveElement(activeIndex: number) {\n if (this.disabled) return;\n this.popoverState.emit({ open: true, action: 'open' });\n await waitForNextPaint();\n this.activeIndex = activeIndex;\n this.setActiveOption();\n this.setFocusedOption();\n this.scrollToActiveOption();\n }\n\n resetTimer() {\n if (this.searchStringTimer) {\n clearTimeout(this.searchStringTimer);\n }\n\n this.searchStringTimer = window.setTimeout(() => {\n this.searchString = null;\n }, 2000);\n }\n\n scrollToActiveOption() {\n const activeOption = this.allOptions[this.activeIndex];\n activeOption?.scrollIntoView({ block: 'center' });\n }\n\n searchAndFocus = (keyValue: string, shouldSelect: boolean) => {\n // pseudo search in non-searchable select\n const reorder = () => {\n this.pivotIndex = this.pivotIndex === undefined ? 0 : (this.activeIndex || 0) + 1;\n const list = this.allOptions.map((element, index) => ({ element, index }));\n return [...list.slice(this.pivotIndex), ...list.slice(0, this.pivotIndex)];\n };\n\n const buildQueue = () => {\n const now = new Date();\n if (now.getTime() - this.keyStore.lastPressedAt.getTime() > 1000) {\n // empty stored keys if delay > 1s\n this.keyStore.queue.length = 0;\n }\n if (this.keyStore.queue.length !== 1 || this.keyStore.queue[0] !== keyValue) {\n this.keyStore.queue.push(keyValue);\n }\n this.keyStore.lastPressedAt = now;\n };\n\n const searchIndex = (list: any[]) => {\n const keyStr = this.keyStore.queue.join('');\n const sanitizedKeyStr = sanitizeRegexString(keyStr);\n return list.find(v => {\n return (\n !v.element.disabled &&\n v.element.display &&\n (v.element.display.match(new RegExp(`^${sanitizedKeyStr}`, 'i')) ||\n v.element.display.replace(/\\s/g, '').match(new RegExp(`^${sanitizedKeyStr}`, 'i')))\n );\n });\n };\n\n const setFocus = ({ index }) => {\n if (this.multiple) {\n // multiple: should open to make sure that which options are selected\n this.openDropdownWithActiveElement(index);\n } else {\n this.activeIndex = index;\n if (shouldSelect) {\n this.selectOption(this.allOptions[index]);\n this.popoverState.emit({ open: false, action: 'select' });\n } else this.setActiveElement(index);\n }\n };\n\n buildQueue();\n const matched = searchIndex(reorder());\n if (matched) {\n setFocus(matched);\n }\n };\n\n searchOptions(key: string, shouldSelect?: boolean) {\n this.searchString = key;\n this.searchAndFocus(key, shouldSelect);\n }\n\n selectOption(selectedOption: ValidOptionElements) {\n const { multiple, noSelect, showSelected } = this;\n if (\n !selectedOption ||\n selectedOption.disabled ||\n ('disabledGroup' in selectedOption && selectedOption.disabledGroup)\n )\n return;\n const selectedValue = selectedOption.value;\n const displayValue =\n 'display' in selectedOption && selectedOption.display\n ? selectedOption.display\n : selectedOption.innerText.trim();\n const valueObject = {\n value: selectedValue,\n display: displayValue,\n };\n\n let values: IOptionValue[] = [];\n if (multiple) {\n const { selectedOptions } = this;\n const isAlreadySelected = selectedOptions.find(option => option.value === selectedValue);\n\n if (isAlreadySelected) {\n values = selectedOptions.filter(({ value }) => value !== selectedValue);\n } else {\n values = [...selectedOptions, valueObject];\n }\n\n if (showSelected) this.focusSelectedSibling(selectedOption);\n } else {\n values = [valueObject];\n }\n\n if (noSelect) this.setActiveElement(null);\n else this.selectedOptions = values;\n\n this.change.emit({ value: selectedValue, values });\n }\n\n setActiveOption() {\n const activeIndex = this.activeIndex;\n\n this.allOptions.forEach((element, elementIndex) => {\n element.active = activeIndex === elementIndex;\n });\n }\n\n setFocusedOption() {\n const option = this.allOptions[this.activeIndex];\n if (!option) return;\n\n const isOptionVisible = isVisible(option);\n if (isOptionVisible) option.focus();\n else nextPaint(() => option.focus());\n }\n\n updateMultipleOptionAttrs() {\n const { allOptions, selectedOptions } = this;\n const selectedValues = selectedOptions.map(({ value }) => value);\n if (this.noSelect) return;\n allOptions.forEach(element => {\n if (!('selected' in element)) return;\n element.selected = selectedValues.includes(element.value);\n });\n }\n\n updateSingleOptionAttrs() {\n const { allOptions, selectedOptions } = this;\n const selectedValue = selectedOptions[0]?.value || undefined;\n if (this.noSelect) return;\n allOptions.forEach(element => {\n if (!('selected' in element)) return;\n element.selected = element.value === selectedValue;\n });\n }\n\n // #endregion\n // #region Render Methods\n\n render() {\n return (\n <Host>\n <div\n class=\"content\"\n ref={el => (this.contentElement = el)}\n onFocusout={this.focusoutHandler}\n >\n <div\n class=\"options\"\n aria-label={loc('tecton.element.optionList.label', [this.label])}\n aria-multiselectable={`${!!this.multiple}`}\n role={this.type || 'listbox'}\n onKeyDown={this.internalKeydownHandler}\n onClick={this.clickHandler}\n >\n <slot />\n </div>\n </div>\n </Host>\n );\n }\n\n // #endregion\n}\n","@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n.container {\n display: none;\n}\n\n.show {\n display: block;\n position: fixed;\n z-index: var-list(--tct-popover-z-index, 50);\n margin: 0;\n padding: 0;\n overflow: auto;\n background: var-list(--tct-popover-background, --app-white, #ffffff);\n color: var-list(--tct-popover-font-color, --t-text, #4d4d4d);\n min-width: var-list(--tct-popover-min-width, 135px);\n margin-block: var-list(--tct-popover-margin-block, 0);\n box-shadow: var-list(--tct-popover-box-shadow, --app-shadow-1, unquote(\"0px 0px 2px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.14)\"));\n border-width: var-list(--tct-popover-border-width, 0);\n border-style: solid;\n border-color: var-list(--tct-popover-border-color, transparent);\n border-radius: var-list(--tct-popover-border-radius, 0);\n // the following --comp variables are set via JS\n max-height: var(--comp-pop-max-height);\n left: var(--comp-pop-left);\n opacity: var(--comp-pop-opacity, 0);\n\n :host([block]) & {\n right: unset;\n width: var(--comp-pop-width);\n min-width: var-list(--tct-popover-min-width, unset);\n }\n\n :host([align='left']) & {\n left: var(--comp-pop-left);\n right: unset;\n }\n\n :host([align='right']) & {\n right: var(--comp-pop-right);\n left: unset;\n }\n\n &.down {\n top: var-list(--tct-popover-top, --comp-pop-top);\n bottom: unset;\n }\n\n &.up {\n top: unset;\n bottom: var(--comp-pop-bottom);\n }\n\n &.legacy {\n position: absolute;\n }\n\n @include tiny-scrollbar();\n}\n\nclick-elsewhere {\n position: relative;\n display: block;\n}\n","import {\n Component,\n Prop,\n h,\n ComponentInterface,\n Element,\n Watch,\n Method,\n Listen,\n EventEmitter,\n Event,\n State,\n} from '@stencil/core';\nimport { handleDeprecationWarning, waitForNextPaint } from '../../utils';\n\n@Component({ tag: 'q2-popover', shadow: true, styleUrl: 'q2-popover.scss' })\nexport class Q2Popover implements ComponentInterface {\n // #region Own Properties\n\n containerElement: HTMLDivElement;\n contentElement: HTMLDivElement;\n /**\n * The number of pixels to leave between the popover and the edge of the viewport\n */\n displayBuffer = 10;\n /** remove when Popover API is supported in iOS */\n orientationChanged: boolean = false;\n rootElementRect: DOMRect;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region State Properties\n\n @State()\n currentDirection: 'down' | 'up' = undefined;\n\n // remove `show` when Popover API is supported in iOS\n @State()\n show: boolean = false;\n\n // #endregion\n // #region Public Property API\n\n /** Aligns the popover to the left or right side of the control element. */\n @Prop({ reflect: true })\n align: 'left' | 'right';\n\n /** Indicates the popover will match the width of its parent element. */\n @Prop({ reflect: true })\n block: boolean;\n\n /** The element that controls the popover's behavior. */\n @Prop()\n controlElement: HTMLElement;\n\n /**\n * Force the direction of the popover when it opens.\n * If no value is passed, the component will auto-detect the direction based on available space.\n */\n @Prop({ reflect: true })\n direction: 'up' | 'down';\n\n /**\n * Force the maximum height of the popover. This value will be interpreted as pixels.\n * If no value is passed, or the value exceeds available space, the component will auto-detect the maximum height based on available space.\n */\n @Prop()\n maxHeight: number;\n\n /** @deprecated */\n @Prop()\n minHeight: number;\n\n @Prop()\n mode: 'legacy' = null;\n\n /** Controls whether the popover is open or closed. */\n @Prop({ reflect: true, mutable: true })\n open: boolean;\n\n // #endregion\n // #region Events\n\n /**\n * Emitted when the popover is opened or closed.\n */\n @Event()\n popoverStateChanged: EventEmitter<{ open: boolean }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback() {\n this.removeViewportListeners();\n }\n\n componentDidLoad() {\n this.handleMinHeight();\n if (this.open) this.determinePopDirection();\n }\n\n // #endregion\n // #region Listeners\n\n @Listen('popoverState')\n popoverStateHandler(event: CustomEvent<{ open: boolean }>) {\n const {\n detail: { open },\n } = event;\n if (open === this.open) return;\n\n this.open = open;\n event.stopPropagation();\n }\n\n // #endregion\n // #region Public Methods API\n\n @Method()\n async scrollContainerTo(options: ScrollToOptions) {\n this.containerElement.scrollTo(options);\n }\n\n @Method()\n async toggle() {\n this.open = !this.open;\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('minHeight')\n minHeightProvided() {\n this.handleMinHeight();\n }\n\n @Watch('open')\n async openChanged(open: boolean) {\n this.setRootElement();\n this.popoverStateChanged.emit({ open });\n\n if (open) {\n this.addViewportListeners();\n this.determinePopDirection();\n } else {\n this.removeViewportListeners();\n this.currentDirection = undefined;\n this.show = false;\n await waitForNextPaint();\n this.clearCSSProperties();\n }\n }\n\n // #endregion\n // #region Local Methods\n\n get isModule() {\n const isIframe = window !== window.top;\n const hasPlatformDimensions = Object.keys(window.Tecton?.platformDimensions ?? {}).length > 0;\n return isIframe && hasPlatformDimensions;\n }\n\n get providedDirection(): 'up' | 'down' | undefined {\n const { direction } = this;\n switch (direction) {\n case 'up':\n case 'down':\n return direction;\n default:\n return undefined;\n }\n }\n\n get validatedMaxHeight(): number | undefined {\n const { maxHeight } = this;\n return isNaN(maxHeight) ? undefined : maxHeight;\n }\n\n addViewportListeners() {\n window.addEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.addEventListener('scroll', this.viewPortChanged, { passive: true, capture: true });\n screen?.orientation?.addEventListener('change', this.viewPortOrientationChanged);\n window.addEventListener('orientationchange', this.viewPortOrientationChanged);\n\n // #endregion\n }\n\n clearCSSProperties() {\n this.containerElement.style.removeProperty('--comp-pop-max-height');\n this.containerElement.style.removeProperty('--comp-pop-top');\n this.containerElement.style.removeProperty('--comp-pop-bottom');\n this.containerElement.style.removeProperty('--comp-pop-left');\n this.containerElement.style.removeProperty('--comp-pop-right');\n this.containerElement.style.removeProperty('--comp-pop-width');\n this.containerElement.style.removeProperty('--comp-pop-opacity');\n }\n\n async determinePopDirection() {\n const { containerElement, controlElement, providedDirection, displayBuffer } = this;\n if (containerElement) containerElement.style.maxHeight = null;\n\n await waitForNextPaint();\n\n const { isModule } = this;\n const { top: controlTop, bottom: controlBottom } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n };\n\n let windowHeight: number;\n let maxSpaceAbove: number;\n let maxSpaceBelow: number;\n\n if (isModule) {\n const { outletOffset = 0, innerHeight = window.innerHeight } = window.Tecton?.platformDimensions || {};\n const distanceToIframeBottom = window.visualViewport.height - controlBottom;\n const viewableSpaceBelow = innerHeight - (outletOffset + controlBottom);\n const isIframeShorterThanWindow = distanceToIframeBottom < viewableSpaceBelow;\n windowHeight = innerHeight;\n // If the top of the module is below the top of the window we just use the controlTop\n // Otherwise we need to add the outletOffset to the controlTop\n maxSpaceAbove = (outletOffset > 0 ? controlTop : controlTop + outletOffset) - displayBuffer;\n maxSpaceBelow = isIframeShorterThanWindow\n ? distanceToIframeBottom - displayBuffer\n : viewableSpaceBelow - displayBuffer;\n } else {\n windowHeight = window.visualViewport.height;\n maxSpaceAbove = controlTop - displayBuffer;\n maxSpaceBelow = windowHeight - controlBottom - displayBuffer;\n }\n\n const directionWithMostSpace: 'up' | 'down' = maxSpaceAbove > maxSpaceBelow ? 'up' : 'down';\n\n // We do not want to update the max height once the popover is open unless the page orientation shifts (resize or mobile use cases)\n const shouldUpdateMaxHeight =\n !containerElement.style.getPropertyValue('--comp-pop-max-height') || this.orientationChanged;\n // we do not want to constantly update the max-height after an orientation change, so we switch this back to false\n this.orientationChanged = false;\n const currentOrDetermineDirection = this.currentDirection || providedDirection || directionWithMostSpace;\n\n switch (currentOrDetermineDirection) {\n case 'up':\n if (shouldUpdateMaxHeight) {\n const priorityMaxHeight = this.validatedMaxHeight || maxSpaceAbove;\n const maxHeight = Math.min(maxSpaceAbove, priorityMaxHeight);\n containerElement.style.setProperty('--comp-pop-max-height', `${maxHeight}px`);\n }\n this.setDirectionAndShow('up');\n break;\n case 'down':\n if (shouldUpdateMaxHeight) {\n const priorityMaxHeight = this.validatedMaxHeight || maxSpaceBelow;\n const maxHeight = Math.min(maxSpaceBelow, priorityMaxHeight);\n containerElement.style.setProperty('--comp-pop-max-height', `${maxHeight}px`);\n }\n this.setDirectionAndShow('down');\n break;\n default:\n break;\n }\n }\n\n handleMinHeight = () => {\n if (this.minHeight) {\n handleDeprecationWarning(this, 'minHeight', 'prop');\n }\n };\n\n removeViewportListeners() {\n window.removeEventListener('resize', this.viewPortOrientationChanged);\n // #region remove when Popover API is supported in iOS\n window.removeEventListener('scroll', this.viewPortChanged);\n screen?.orientation?.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n window.removeEventListener('orientationchange', this.viewPortOrientationChanged);\n\n // #endregion\n }\n\n setAbsoluteCSSProperties = async () => {\n const { controlElement, containerElement, currentDirection, align } = this;\n\n if (align === 'right') {\n containerElement.style.setProperty('--comp-pop-right', '0');\n containerElement.style.setProperty('--comp-pop-left', 'unset');\n } else {\n containerElement.style.setProperty('--comp-pop-left', '0');\n containerElement.style.setProperty('--comp-pop-right', 'unset');\n }\n\n if (this.block) {\n containerElement.style.setProperty('--comp-pop-width', '100%');\n }\n\n if (currentDirection === 'up') {\n const controlStyle = getComputedStyle(controlElement);\n const controlSize =\n parseInt(controlStyle.height || '0') +\n parseInt(controlStyle.borderTopWidth || '0') +\n parseInt(controlStyle.borderBottomWidth || '0');\n\n containerElement.style.setProperty('--comp-pop-bottom', `${controlSize}px`);\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n setDirectionAndShow(direction: 'up' | 'down') {\n this.setRootElement();\n // Due to some runtime inconsistency across devices/browsers we need to add one more check here because the\n // popover can be closed between the time the popover is opened and the time the direction is determined\n const isOpen = this.open;\n if (!isOpen) return;\n\n this.currentDirection = direction;\n this.show = true;\n if (this.mode === 'legacy') {\n this.setAbsoluteCSSProperties();\n } else {\n this.setFixedCSSProperties();\n }\n }\n\n setFixedCSSProperties = async () => {\n const { controlElement, containerElement, currentDirection, rootElementRect } = this;\n const {\n top: controlTop,\n bottom: controlBottom,\n left: controlLeft,\n right: controlRight,\n } = controlElement?.getBoundingClientRect?.() ?? {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n };\n const popoverLeft: number = controlLeft - rootElementRect.left;\n\n if (this.block) containerElement.style.setProperty('--comp-pop-width', `${controlElement?.offsetWidth || 0}px`);\n containerElement.style.setProperty('--comp-pop-left', `${popoverLeft}px`);\n containerElement.style.setProperty(\n '--comp-pop-right',\n `${rootElementRect.width + rootElementRect.left - controlRight}px`\n );\n\n if (currentDirection === 'up') {\n containerElement.style.setProperty(\n '--comp-pop-bottom',\n `${rootElementRect.height + rootElementRect.top - controlTop}px`\n );\n }\n if (currentDirection === 'down') {\n containerElement.style.setProperty('--comp-pop-top', `${controlBottom - rootElementRect.top}px`);\n }\n\n // Wait for one paint to prevent layout thrashing\n await waitForNextPaint();\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n };\n\n setRootElement() {\n let currentElement: HTMLElement = this.hostElement;\n\n while (currentElement && currentElement !== document.documentElement) {\n const computedStyle = window.getComputedStyle(currentElement);\n\n // Check if the element has any styles applied that create a new containg block\n if (\n computedStyle.transform !== 'none' ||\n computedStyle.filter !== 'none' ||\n computedStyle.perspective !== 'none' ||\n computedStyle.containerType !== 'normal' ||\n ['transform', 'perspective', 'filter'].includes(computedStyle.willChange) ||\n ['layout', 'paint', 'strict', 'content'].includes(computedStyle.contain)\n ) {\n this.rootElementRect = currentElement.getBoundingClientRect();\n return;\n }\n\n const rootNode = currentElement.getRootNode();\n const isRootNodeWebComponent =\n typeof ShadowRoot !== 'undefined' &&\n rootNode instanceof ShadowRoot &&\n rootNode.host instanceof HTMLElement;\n if (isRootNodeWebComponent) {\n currentElement = rootNode.host;\n } else {\n currentElement = currentElement.parentElement;\n }\n }\n\n // Return the document's bounding rect if no element is found\n this.rootElementRect = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n height: window.visualViewport.height,\n width: window.visualViewport.width,\n } as DOMRect;\n }\n\n viewPortChanged = () => {\n if (!this.open) return;\n this.determinePopDirection();\n };\n\n viewPortOrientationChanged = () => {\n this.orientationChanged = true;\n this.viewPortChanged();\n };\n\n // #endregion\n // #region Render Methods\n\n render() {\n const containerClasses = ['container', this.currentDirection];\n if (this.show) containerClasses.push('show');\n if (this.mode === 'legacy') containerClasses.push('legacy');\n\n return (\n <div\n ref={el => (this.containerElement = el)}\n class={containerClasses.join(' ')}\n test-id=\"outerContainer\"\n tabIndex={-1}\n >\n <div\n ref={el => (this.contentElement = el)}\n class=\"content\"\n >\n <slot />\n </div>\n </div>\n );\n }\n\n // #endregion\n}\n"],"mappings":";;;;SAAwBA,oBAAoBC;EACxC,OAAOA,EAAYC,QAAQ,uBAAuB;AACtD;;ACFA,MAAMC,IAAkB;;AACxB,MAAAC,IAAeD;;MCwBFE,IAAY;;;;;;IAKrBC,KAAAC,WAGI;MACAC,OAAO;MACPC,eAAe,IAAIC;;IAGvBJ,KAAAK,uBAAuC;IAgPvCL,KAAAM,eAAgBC;MACZ,MAAMC,IAASD,EAAMC;MACrB,MAAMC,IAASD,EAAOE,QAClB;MAEJV,KAAKW,aAAaF;MAClB,IAAIT,KAAKY,UAAU;MACnBZ,KAAKa,aAAaC,KAAK;QAAEC,MAAM;QAAOC,QAAQ;;AAAW;kDAI7DhB,KAAAiB,yBAA0BV;MACtBA,EAAMW;MACN,OAAMC,aAAEA,GAAWC,cAAEA,GAAYC,YAAEA,KAAerB;MAClD,OAAMsB,KAAEA,KAAQf;MAEhB,IAAIgB;MACJ,QAAQD;OACJ,KAAK;QACD,IAAItB,KAAKwB,cAAc;UACnB,IA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,UAClE;QACEjS,KAAKqN,kBAAkBoE,EAAe1D;QACtC;;MAGJ,MAAMmE,IAAWT,EAAeU;MAChC,MAAMC,WACKC,eAAe,eACtBH,aAAoBG,cACpBH,EAASI,gBAAgBC;MAC7B,IAAIH,GAAwB;QACxBX,IAAiBS,EAASI;aACvB;QACHb,IAAiBA,EAAee;;;;QAKxCxS,KAAKqN,kBAAkB;MACnBC,KAAK;MACLE,QAAQ;MACRE,MAAM;MACNE,OAAO;MACPX,QAAQlD,OAAO8G,eAAe5D;MAC9BkB,OAAOpE,OAAO8G,eAAe1C;;;;;EAiBrC,MAAAjD;IACI,MAAMuH,IAAmB,EAAC,aAAazS,KAAKyM;IAC5C,IAAIzM,KAAKoP,MAAMqD,EAAiB7N,KAAK;IACrC,IAAI5E,KAAKwR,SAAS,UAAUiB,EAAiB7N,KAAK;IAElD,OACIuG,EAAA;MAAA7J,KAAA;MACIgK,KAAKC,KAAOvL,KAAKwM,mBAAmBjB;MACpCF,OAAOoH,EAAiB1N,KAAK;MAAI,WACzB;MACR2N,WAAW;OAEXvH,EAAA;MAAA7J,KAAA;MACIgK,KAAKC,KAAOvL,KAAKwL,iBAAiBD;MAClCF,OAAM;OAENF,EAAA;MAAA7J,KAAA"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { r as t, c as i, h as e, H as a, g as
|
|
1
|
+
import { r as t, c as i, h as e, H as a, g as s } from "./index-7a5365e2.js";
|
|
2
2
|
|
|
3
|
-
import { u as
|
|
3
|
+
import { u as o, l as n } from "./index-504f1a9e.js";
|
|
4
4
|
|
|
5
5
|
const r = '*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host(:not([separator]):not([separator=false])){--comp-padding:0 var(--app-scale-2x, 10px);--comp-selected-icon-size:var(--tct-option-selected-icon-size, var(--t-option-selected-icon-size, var(--tct-scale-3, var(--app-scale-3x, 15px))));padding:var(--tct-option-padding, var(--t-option-padding, var(--comp-padding)));min-height:44px;align-items:center;cursor:pointer;grid-template-columns:var(--comp-selected-icon-size) 1fr;align-items:center;grid-template-areas:"icon content";gap:var(--tct-scale-1, var(--app-scale-1x, 5px))}:host(:focus),:host(:not([separator]):not([separator=false]):hover),:host([active]){position:relative;z-index:1}:host([multiline]){--comp-padding:var(--app-scale-2, 10px) var(--app-scale-2, 10px);--comp-selected-icon-size:var(--tct-option-selected-multiline-icon-size, var(--t-option-selected-multiline-icon-size, var(--tct-option-selected-icon-size, var(--t-option-selected-icon-size, 26px))))}:host([_no-select]){grid-template-columns:1fr;grid-template-areas:"content"}:host([aria-disabled]){cursor:not-allowed;opacity:var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4));pointer-events:none}:host([aria-hidden]){display:none}:host(:not([hidden]):not([aria-hidden])){display:grid}:host(:not([aria-disabled]):not([separator]):not([separator=false]):hover),:host([active]),:host(:focus){background:var(--tct-option-active-background, var(--tct-option-active-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, #f2f2f2))))));color:var(--tct-option-active-color, inherit)}:host(:focus){box-shadow:var(--tct-option-focus-box-shadow, var(--const-inset-double-focus-ring, inset var(--const-global-focus, 0 0 0 2px var(--const-focus-color, #0066CC)))) !important}q2-icon{grid-area:icon;--tct-icon-size:var(--comp-selected-icon-size)}.content{display:block;grid-area:content}:host(:not([multiline])) .content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.separator{--comp-default-separator-margin:0 var(--tct-scale-1, var(--app-scale-3x, 15px));margin:var(--tct-dropdown-separator-margin, var(--t-dropdown-separator-margin, var(--comp-default-separator-margin)));border-bottom:1px solid var(--tct-dropdown-item-separator-color, var(--t-gray-11, #cccccc))}';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const c = r;
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const d = class {
|
|
10
10
|
constructor(e) {
|
|
11
11
|
t(this, e);
|
|
12
12
|
this.displayChanged = i(this, "displayChanged", 7);
|
|
13
|
+
this.tctClick = i(this, "tctClick", 7);
|
|
13
14
|
// #endregion
|
|
14
15
|
// #region Local Methods
|
|
15
16
|
this.handleTextContent = async () => {
|
|
16
17
|
if (this.multiline) return;
|
|
17
|
-
const t = await
|
|
18
|
+
const t = await o(this.hostElement);
|
|
18
19
|
if (this.display === t) return;
|
|
19
20
|
if (this.display && !t) this.hostElement.textContent = n(this.display);
|
|
20
21
|
};
|
|
21
22
|
this.initDisplay = async () => {
|
|
22
23
|
if (this.multiline) return;
|
|
23
|
-
const t = await
|
|
24
|
+
const t = await o(this.hostElement);
|
|
24
25
|
if (this.display) this.displayProvidedAtInit = true;
|
|
25
26
|
this.display = !!this.display ? n(this.display) : t;
|
|
26
27
|
await this.handleTextContent();
|
|
@@ -35,7 +36,7 @@ const c = class {
|
|
|
35
36
|
this.mutationObserver = t;
|
|
36
37
|
};
|
|
37
38
|
this.mutationHandler = async () => {
|
|
38
|
-
const t = await
|
|
39
|
+
const t = await o(this.hostElement);
|
|
39
40
|
if (this.display === t || this.multiline) return;
|
|
40
41
|
if (!this.displayProvidedAtInit) this.display = t;
|
|
41
42
|
};
|
|
@@ -86,14 +87,33 @@ const c = class {
|
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
89
|
renderOption() {
|
|
89
|
-
const {display: t, disabled: i, disabledGroup:
|
|
90
|
-
const
|
|
90
|
+
const {display: t, disabled: i, disabledGroup: s, selected: o, _multiSelectHidden: r} = this;
|
|
91
|
+
const c = i || s;
|
|
91
92
|
return e(a, {
|
|
92
93
|
tabindex: "-1",
|
|
93
|
-
"aria-disabled":
|
|
94
|
-
"aria-selected": `${!!
|
|
94
|
+
"aria-disabled": c ? "true" : undefined,
|
|
95
|
+
"aria-selected": `${!!o}`,
|
|
95
96
|
"aria-hidden": r ? "true" : undefined,
|
|
96
|
-
display: n(t)
|
|
97
|
+
display: n(t),
|
|
98
|
+
onClick: () => {
|
|
99
|
+
if (c) return;
|
|
100
|
+
this.tctClick.emit({
|
|
101
|
+
type: "select",
|
|
102
|
+
value: this.value
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
onKeydown: t => {
|
|
106
|
+
if (c) return;
|
|
107
|
+
if (t.key === "Enter" || t.key === " ") {
|
|
108
|
+
setTimeout((() => {
|
|
109
|
+
this.tctClick.emit({
|
|
110
|
+
type: "select",
|
|
111
|
+
value: this.value
|
|
112
|
+
});
|
|
113
|
+
}), 1);
|
|
114
|
+
t.preventDefault();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
97
117
|
}, this.selected && e("q2-icon", {
|
|
98
118
|
type: "checkmark"
|
|
99
119
|
}), e("div", {
|
|
@@ -104,7 +124,7 @@ const c = class {
|
|
|
104
124
|
return this.separator ? this.renderSeparator() : this.renderOption();
|
|
105
125
|
}
|
|
106
126
|
get hostElement() {
|
|
107
|
-
return
|
|
127
|
+
return s(this);
|
|
108
128
|
}
|
|
109
129
|
static get watchers() {
|
|
110
130
|
return {
|
|
@@ -114,7 +134,7 @@ const c = class {
|
|
|
114
134
|
}
|
|
115
135
|
};
|
|
116
136
|
|
|
117
|
-
|
|
137
|
+
d.style = c;
|
|
118
138
|
|
|
119
|
-
export {
|
|
139
|
+
export { d as q2_option };
|
|
120
140
|
//# sourceMappingURL=q2-option.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["q2OptionCss","Q2OptionStyle0","Q2Option","this","handleTextContent","async","multiline","textContent","getAllText","hostElement","display","loc","initDisplay","displayProvidedAtInit","initMutationObserver","observer","MutationObserver","mutationHandler","observe","childList","subtree","characterData","mutationObserver","allTextContent","disconnectedCallback","_a","disconnect","componentWillLoad","separatorChangedHandler","separator","componentDidLoad","window","role","displayChangedHandler","displayChanged","emit","value","renderSeparator","h","class","renderOption","disabled","disabledGroup","selected","_multiSelectHidden","isDisabled","Host","tabindex","undefined","type","render"],"sources":["src/components/q2-option/q2-option.scss?tag=q2-option&encapsulation=shadow","src/components/q2-option/q2-option.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host(:not([separator]):not([separator='false'])) {\n --comp-padding: #{0 var-list(--app-scale-2x, 10px)};\n --comp-selected-icon-size: #{var-list(var-prefixer(option-selected-icon-size), --tct-scale-3, --app-scale-3x, 15px)};\n padding: var-list(var-prefixer(option-padding), --comp-padding);\n min-height: 44px;\n align-items: center;\n cursor: pointer;\n grid-template-columns:\n var(--comp-selected-icon-size)\n 1fr;\n align-items: center;\n grid-template-areas: 'icon content';\n gap: var-list(--tct-scale-1, --app-scale-1x, 5px);\n}\n\n:host(:focus),\n:host(:not([separator]):not([separator='false']):hover),\n:host([active]) {\n position: relative;\n z-index: 1; // Puts the option above any scroll shadows on the `q2-action-sheet`\n}\n\n:host([multiline]) {\n --comp-padding: #{var-list(--app-scale-2, 10px) var-list(--app-scale-2, 10px)};\n --comp-selected-icon-size: #{var-list(\n var-prefixer(option-selected-multiline-icon-size),\n var-prefixer(option-selected-icon-size),\n 26px\n )};\n}\n\n:host([_no-select]) {\n grid-template-columns: 1fr;\n grid-template-areas: 'content';\n}\n\n:host([aria-disabled]) {\n cursor: not-allowed;\n opacity: var-list(--tct-disabled-opacity, --app-disabled-opacity, 0.4);\n pointer-events: none;\n}\n\n:host([aria-hidden]) {\n display: none;\n}\n\n:host(:not([hidden]):not([aria-hidden])) {\n display: grid;\n}\n\n:host(:not([aria-disabled]):not([separator]):not([separator='false']):hover),\n:host([active]),\n:host(:focus) {\n background: var-list(\n --tct-option-active-background,\n --tct-option-active-bg,\n --tct-gray-14,\n --t-gray-14,\n --tct-gray-l3,\n --app-gray-l3,\n #f2f2f2\n );\n color: var(--tct-option-active-color, inherit);\n}\n\n:host(:focus) {\n box-shadow: var-list(\n --tct-option-focus-box-shadow,\n --const-inset-double-focus-ring,\n unquote('inset var(--const-global-focus, 0 0 0 2px var(--const-focus-color, #0066CC))')\n ) !important;\n}\n\nq2-icon {\n grid-area: icon;\n --tct-icon-size: var(--comp-selected-icon-size);\n}\n\n.content {\n display: block;\n grid-area: content;\n\n :host(:not([multiline])) & {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n}\n\n.separator {\n --comp-default-separator-margin: 0 #{var-list(--tct-scale-1, --app-scale-3x, 15px)};\n margin: var-list(var-prefixer(dropdown-separator-margin), --comp-default-separator-margin);\n border-bottom: 1px solid var-list(--tct-dropdown-item-separator-color --t-gray-11 #cccccc);\n}\n","import { Component, Prop, h, Element, ComponentInterface, Host, Event, EventEmitter, Watch } from '@stencil/core';\nimport { getAllText, loc } from '@/utils';\n\n@Component({ tag: 'q2-option', shadow: true, styleUrl: 'q2-option.scss' })\nexport class Q2Option implements ComponentInterface {\n // #region Own Properties\n\n displayProvidedAtInit: boolean;\n mutationObserver: MutationObserver;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n @Prop({ reflect: true, attribute: '_multiSelectHidden' })\n _multiSelectHidden: boolean = false;\n\n /**\n * Used by q2-option-list to indicate the option is active\n * @private\n */\n @Prop({ reflect: true })\n active: boolean;\n\n /** Disables the option. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /**\n * Used by consuming elements to disable all options in the group\n * @private\n */\n @Prop({ reflect: true })\n disabledGroup: boolean;\n\n /**\n * The text that is displayed in the field when selected. If not provided, any text inside the element will be used.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n display: string;\n\n /**\n * Used by consuming elements to enable multiline content support\n * @private\n */\n @Prop({ reflect: true })\n multiline: boolean;\n\n /**\n * Used by q2-option-list to set a role on the option\n * @type {('option' | 'menuitem' | 'separator')}\n * @private\n */\n @Prop({ reflect: true, mutable: true })\n role: string = 'option';\n\n /**\n * Used by q2-option-list to indicate the option is selected\n * @private\n */\n @Prop({ reflect: true })\n selected: boolean;\n\n /**\n * Renders a line in the item instead of text.\n * Click events from these items will not have details provided.\n * A `separator` allows for quick visual grouping of items, so interactions should not be bound to these options.\n */\n @Prop({ reflect: true })\n separator: boolean;\n\n /** Serves as the option's value. */\n @Prop({ reflect: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Used by consuming elements to indicate the display value of the option has changed.\n * @private\n */\n @Event()\n displayChanged: EventEmitter<{ value: string; display: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n this.mutationObserver = null;\n }\n\n componentWillLoad() {\n this.separatorChangedHandler(this.separator);\n this.initDisplay();\n }\n\n componentDidLoad() {\n if ('MutationObserver' in window) this.initMutationObserver();\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('separator')\n async separatorChangedHandler(separator: boolean) {\n if (!separator) return;\n this.role = 'separator';\n }\n\n @Watch('display')\n async displayChangedHandler() {\n this.display = loc(this.display);\n await this.handleTextContent();\n this.displayChanged.emit({ display: this.display, value: this.value });\n }\n\n // #endregion\n // #region Local Methods\n\n handleTextContent = async () => {\n if (this.multiline) return;\n const textContent = await getAllText(this.hostElement);\n if (this.display === textContent) return;\n if (this.display && !textContent) this.hostElement.textContent = loc(this.display);\n };\n\n initDisplay = async () => {\n if (this.multiline) return;\n const textContent = await getAllText(this.hostElement);\n if (this.display) this.displayProvidedAtInit = true;\n this.display = !!this.display ? loc(this.display) : textContent;\n await this.handleTextContent();\n };\n\n initMutationObserver = () => {\n const observer = new MutationObserver(this.mutationHandler);\n observer.observe(this.hostElement, { childList: true, subtree: true, characterData: true });\n this.mutationObserver = observer;\n };\n\n mutationHandler = async () => {\n const allTextContent = await getAllText(this.hostElement);\n if (this.display === allTextContent || this.multiline) return;\n if (!this.displayProvidedAtInit) this.display = allTextContent;\n };\n\n // #endregion\n // #region Render Methods\n\n renderSeparator() {\n return <div class=\"separator\"></div>;\n }\n\n renderOption() {\n const { display, disabled, disabledGroup, selected, _multiSelectHidden } = this;\n const isDisabled = disabled || disabledGroup;\n return (\n <Host\n tabindex=\"-1\"\n aria-disabled={isDisabled ? 'true' : undefined}\n aria-selected={`${!!selected}`}\n aria-hidden={_multiSelectHidden ? 'true' : undefined}\n display={loc(display)}\n >\n {this.selected && <q2-icon type=\"checkmark\" />}\n <div class=\"content\">\n <slot />\n </div>\n </Host>\n );\n }\n\n render() {\n return this.separator ? this.renderSeparator() : this.renderOption();\n }\n\n // #endregion\n}\n"],"mappings":";;;;AAAA,MAAMA,IAAc;;AACpB,MAAAC,IAAeD;;MCGFE,IAAQ;;;;;;QA2HjBC,KAAAC,oBAAoBC;MAChB,IAAIF,KAAKG,WAAW;MACpB,MAAMC,UAAoBC,EAAWL,KAAKM;MAC1C,IAAIN,KAAKO,YAAYH,GAAa;MAClC,IAAIJ,KAAKO,YAAYH,GAAaJ,KAAKM,YAAYF,cAAcI,EAAIR,KAAKO;AAAQ;IAGtFP,KAAAS,cAAcP;MACV,IAAIF,KAAKG,WAAW;MACpB,MAAMC,UAAoBC,EAAWL,KAAKM;MAC1C,IAAIN,KAAKO,SAASP,KAAKU,wBAAwB;MAC/CV,KAAKO,YAAYP,KAAKO,UAAUC,EAAIR,KAAKO,WAAWH;YAC9CJ,KAAKC;AAAmB;IAGlCD,KAAAW,uBAAuB;MACnB,MAAMC,IAAW,IAAIC,iBAAiBb,KAAKc;MAC3CF,EAASG,QAAQf,KAAKM,aAAa;QAAEU,WAAW;QAAMC,SAAS;QAAMC,eAAe;;MACpFlB,KAAKmB,mBAAmBP;AAAQ;IAGpCZ,KAAAc,kBAAkBZ;MACd,MAAMkB,UAAuBf,EAAWL,KAAKM;MAC7C,IAAIN,KAAKO,YAAYa,KAAkBpB,KAAKG,WAAW;MACvD,KAAKH,KAAKU,uBAAuBV,KAAKO,UAAUa;AAAc;8BAnIpC;;;;;;gBAwCf;;;;;;;EAkCf,oBAAAC;;KACIC,IAAAtB,KAAKmB,sBAAgB,QAAAG,WAAA,aAAAA,EAAEC;IACvBvB,KAAKmB,mBAAmB;;EAG5B,iBAAAK;IACIxB,KAAKyB,wBAAwBzB,KAAK0B;IAClC1B,KAAKS;;EAGT,gBAAAkB;IACI,IAAI,sBAAsBC,QAAQ5B,KAAKW;;;;EAO3C,6BAAMc,CAAwBC;IAC1B,KAAKA,GAAW;IAChB1B,KAAK6B,OAAO;;EAIhB,2BAAMC;IACF9B,KAAKO,UAAUC,EAAIR,KAAKO;UAClBP,KAAKC;IACXD,KAAK+B,eAAeC,KAAK;MAAEzB,SAASP,KAAKO;MAAS0B,OAAOjC,KAAKiC;;;;;EAoClE,eAAAC;IACI,OAAOC,EAAA;MAAKC,OAAM;;;EAGtB,YAAAC;IACI,OAAM9B,SAAEA,GAAO+B,UAAEA,GAAQC,eAAEA,GAAaC,UAAEA,GAAQC,oBAAEA,KAAuBzC;IAC3E,MAAM0C,IAAaJ,KAAYC;IAC/B,OACIJ,EAACQ,GAAI;MACDC,UAAS;MAAI,iBACEF,IAAa,SAASG;MAAS,iBAC/B,KAAKL;MAAU,eACjBC,IAAqB,SAASI;MAC3CtC,SAASC,EAAID;OAEZP,KAAKwC,YAAYL,EAAA;MAASW,MAAK;QAChCX,EAAA;MAAKC,OAAM;OACPD,EAAA;;EAMhB,MAAAY;IACI,OAAO/C,KAAK0B,YAAY1B,KAAKkC,oBAAoBlC,KAAKqC"}
|
|
1
|
+
{"version":3,"names":["q2OptionCss","Q2OptionStyle0","Q2Option","this","handleTextContent","async","multiline","textContent","getAllText","hostElement","display","loc","initDisplay","displayProvidedAtInit","initMutationObserver","observer","MutationObserver","mutationHandler","observe","childList","subtree","characterData","mutationObserver","allTextContent","disconnectedCallback","_a","disconnect","componentWillLoad","separatorChangedHandler","separator","componentDidLoad","window","role","displayChangedHandler","displayChanged","emit","value","renderSeparator","h","class","renderOption","disabled","disabledGroup","selected","_multiSelectHidden","isDisabled","Host","tabindex","undefined","onClick","tctClick","type","onKeydown","event","key","setTimeout","preventDefault","render"],"sources":["src/components/q2-option/q2-option.scss?tag=q2-option&encapsulation=shadow","src/components/q2-option/q2-option.tsx"],"sourcesContent":["@import '../../styles/host.scss';\n@import '../../styles/functions';\n\n:host(:not([separator]):not([separator='false'])) {\n --comp-padding: #{0 var-list(--app-scale-2x, 10px)};\n --comp-selected-icon-size: #{var-list(var-prefixer(option-selected-icon-size), --tct-scale-3, --app-scale-3x, 15px)};\n padding: var-list(var-prefixer(option-padding), --comp-padding);\n min-height: 44px;\n align-items: center;\n cursor: pointer;\n grid-template-columns:\n var(--comp-selected-icon-size)\n 1fr;\n align-items: center;\n grid-template-areas: 'icon content';\n gap: var-list(--tct-scale-1, --app-scale-1x, 5px);\n}\n\n:host(:focus),\n:host(:not([separator]):not([separator='false']):hover),\n:host([active]) {\n position: relative;\n z-index: 1; // Puts the option above any scroll shadows on the `q2-action-sheet`\n}\n\n:host([multiline]) {\n --comp-padding: #{var-list(--app-scale-2, 10px) var-list(--app-scale-2, 10px)};\n --comp-selected-icon-size: #{var-list(\n var-prefixer(option-selected-multiline-icon-size),\n var-prefixer(option-selected-icon-size),\n 26px\n )};\n}\n\n:host([_no-select]) {\n grid-template-columns: 1fr;\n grid-template-areas: 'content';\n}\n\n:host([aria-disabled]) {\n cursor: not-allowed;\n opacity: var-list(--tct-disabled-opacity, --app-disabled-opacity, 0.4);\n pointer-events: none;\n}\n\n:host([aria-hidden]) {\n display: none;\n}\n\n:host(:not([hidden]):not([aria-hidden])) {\n display: grid;\n}\n\n:host(:not([aria-disabled]):not([separator]):not([separator='false']):hover),\n:host([active]),\n:host(:focus) {\n background: var-list(\n --tct-option-active-background,\n --tct-option-active-bg,\n --tct-gray-14,\n --t-gray-14,\n --tct-gray-l3,\n --app-gray-l3,\n #f2f2f2\n );\n color: var(--tct-option-active-color, inherit);\n}\n\n:host(:focus) {\n box-shadow: var-list(\n --tct-option-focus-box-shadow,\n --const-inset-double-focus-ring,\n unquote('inset var(--const-global-focus, 0 0 0 2px var(--const-focus-color, #0066CC))')\n ) !important;\n}\n\nq2-icon {\n grid-area: icon;\n --tct-icon-size: var(--comp-selected-icon-size);\n}\n\n.content {\n display: block;\n grid-area: content;\n\n :host(:not([multiline])) & {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n}\n\n.separator {\n --comp-default-separator-margin: 0 #{var-list(--tct-scale-1, --app-scale-3x, 15px)};\n margin: var-list(var-prefixer(dropdown-separator-margin), --comp-default-separator-margin);\n border-bottom: 1px solid var-list(--tct-dropdown-item-separator-color --t-gray-11 #cccccc);\n}\n","import { Component, Prop, h, Element, ComponentInterface, Host, Event, EventEmitter, Watch } from '@stencil/core';\nimport { getAllText, loc } from '@/utils';\n\n@Component({ tag: 'q2-option', shadow: true, styleUrl: 'q2-option.scss' })\nexport class Q2Option implements ComponentInterface {\n // #region Own Properties\n\n displayProvidedAtInit: boolean;\n mutationObserver: MutationObserver;\n\n // #endregion\n // #region Host HTML Element\n\n @Element()\n hostElement: HTMLElement;\n\n // #endregion\n // #region Public Property API\n\n @Prop({ reflect: true, attribute: '_multiSelectHidden' })\n _multiSelectHidden: boolean = false;\n\n /**\n * Used by q2-option-list to indicate the option is active\n * @private\n */\n @Prop({ reflect: true })\n active: boolean;\n\n /** Disables the option. */\n @Prop({ reflect: true })\n disabled: boolean;\n\n /**\n * Used by consuming elements to disable all options in the group\n * @private\n */\n @Prop({ reflect: true })\n disabledGroup: boolean;\n\n /**\n * The text that is displayed in the field when selected. If not provided, any text inside the element will be used.\n * @localizable\n */\n @Prop({ reflect: true, mutable: true })\n display: string;\n\n /**\n * Used by consuming elements to enable multiline content support\n * @private\n */\n @Prop({ reflect: true })\n multiline: boolean;\n\n /**\n * Used by q2-option-list to set a role on the option\n * @type {('option' | 'menuitem' | 'separator')}\n * @private\n */\n @Prop({ reflect: true, mutable: true })\n role: string = 'option';\n\n /**\n * Used by q2-option-list to indicate the option is selected\n * @private\n */\n @Prop({ reflect: true })\n selected: boolean;\n\n /**\n * Renders a line in the item instead of text.\n * Click events from these items will not have details provided.\n * A `separator` allows for quick visual grouping of items, so interactions should not be bound to these options.\n */\n @Prop({ reflect: true })\n separator: boolean;\n\n /** Serves as the option's value. */\n @Prop({ reflect: true })\n value: string;\n\n // #endregion\n // #region Events\n\n /**\n * Used by consuming elements to indicate the display value of the option has changed.\n * @private\n */\n @Event()\n displayChanged: EventEmitter<{ value: string; display: string }>;\n\n /**\n * Is emitted when the option is clicked.\n */\n @Event()\n tctClick: EventEmitter<{ type: 'select' | 'remove'; value: string }>;\n\n // #endregion\n // #region Component Lifecycle Events\n\n disconnectedCallback() {\n this.mutationObserver?.disconnect();\n this.mutationObserver = null;\n }\n\n componentWillLoad() {\n this.separatorChangedHandler(this.separator);\n this.initDisplay();\n }\n\n componentDidLoad() {\n if ('MutationObserver' in window) this.initMutationObserver();\n }\n\n // #endregion\n // #region Watchers\n\n @Watch('separator')\n async separatorChangedHandler(separator: boolean) {\n if (!separator) return;\n this.role = 'separator';\n }\n\n @Watch('display')\n async displayChangedHandler() {\n this.display = loc(this.display);\n await this.handleTextContent();\n this.displayChanged.emit({ display: this.display, value: this.value });\n }\n\n // #endregion\n // #region Local Methods\n\n handleTextContent = async () => {\n if (this.multiline) return;\n const textContent = await getAllText(this.hostElement);\n if (this.display === textContent) return;\n if (this.display && !textContent) this.hostElement.textContent = loc(this.display);\n };\n\n initDisplay = async () => {\n if (this.multiline) return;\n const textContent = await getAllText(this.hostElement);\n if (this.display) this.displayProvidedAtInit = true;\n this.display = !!this.display ? loc(this.display) : textContent;\n await this.handleTextContent();\n };\n\n initMutationObserver = () => {\n const observer = new MutationObserver(this.mutationHandler);\n observer.observe(this.hostElement, { childList: true, subtree: true, characterData: true });\n this.mutationObserver = observer;\n };\n\n mutationHandler = async () => {\n const allTextContent = await getAllText(this.hostElement);\n if (this.display === allTextContent || this.multiline) return;\n if (!this.displayProvidedAtInit) this.display = allTextContent;\n };\n\n // #endregion\n // #region Render Methods\n\n renderSeparator() {\n return <div class=\"separator\"></div>;\n }\n\n renderOption() {\n const { display, disabled, disabledGroup, selected, _multiSelectHidden } = this;\n const isDisabled = disabled || disabledGroup;\n return (\n <Host\n tabindex=\"-1\"\n aria-disabled={isDisabled ? 'true' : undefined}\n aria-selected={`${!!selected}`}\n aria-hidden={_multiSelectHidden ? 'true' : undefined}\n display={loc(display)}\n onClick={() => {\n if (isDisabled) return;\n this.tctClick.emit({ type: 'select', value: this.value });\n }}\n onKeydown={(event: KeyboardEvent) => {\n if (isDisabled) return;\n if (event.key === 'Enter' || event.key === ' ') {\n setTimeout(() => {\n this.tctClick.emit({ type: 'select', value: this.value });\n }, 1);\n\n event.preventDefault();\n }\n }}\n >\n {this.selected && <q2-icon type=\"checkmark\" />}\n <div class=\"content\">\n <slot />\n </div>\n </Host>\n );\n }\n\n render() {\n return this.separator ? this.renderSeparator() : this.renderOption();\n }\n\n // #endregion\n}\n"],"mappings":";;;;AAAA,MAAMA,IAAc;;AACpB,MAAAC,IAAeD;;MCGFE,IAAQ;;;;;;;QAiIjBC,KAAAC,oBAAoBC;MAChB,IAAIF,KAAKG,WAAW;MACpB,MAAMC,UAAoBC,EAAWL,KAAKM;MAC1C,IAAIN,KAAKO,YAAYH,GAAa;MAClC,IAAIJ,KAAKO,YAAYH,GAAaJ,KAAKM,YAAYF,cAAcI,EAAIR,KAAKO;AAAQ;IAGtFP,KAAAS,cAAcP;MACV,IAAIF,KAAKG,WAAW;MACpB,MAAMC,UAAoBC,EAAWL,KAAKM;MAC1C,IAAIN,KAAKO,SAASP,KAAKU,wBAAwB;MAC/CV,KAAKO,YAAYP,KAAKO,UAAUC,EAAIR,KAAKO,WAAWH;YAC9CJ,KAAKC;AAA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KiC;;AAAQ;MAE7DgB,WAAYC;QACR,IAAIR,GAAY;QAChB,IAAIQ,EAAMC,QAAQ,WAAWD,EAAMC,QAAQ,KAAK;UAC5CC,YAAW;YACPpD,KAAK+C,SAASf,KAAK;cAAEgB,MAAM;cAAUf,OAAOjC,KAAKiC;;AAAQ,cAC1D;UAEHiB,EAAMG;;;OAIbrD,KAAKwC,YAAYL,EAAA;MAASa,MAAK;QAChCb,EAAA;MAAKC,OAAM;OACPD,EAAA;;EAMhB,MAAAmB;IACI,OAAOtD,KAAK0B,YAAY1B,KAAKkC,oBAAoBlC,KAAKqC"}
|
|
@@ -37,11 +37,19 @@ export declare class Q2DropdownItem implements ComponentInterface {
|
|
|
37
37
|
value: string;
|
|
38
38
|
/**
|
|
39
39
|
* Is emitted when the item is clicked.
|
|
40
|
+
* @deprecated
|
|
40
41
|
*/
|
|
41
42
|
click: EventEmitter<{
|
|
42
43
|
type: 'select' | 'remove';
|
|
43
44
|
value: string;
|
|
44
45
|
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Is emitted when the item is clicked.
|
|
48
|
+
*/
|
|
49
|
+
tctClick: EventEmitter<{
|
|
50
|
+
type: 'select' | 'remove';
|
|
51
|
+
value: string;
|
|
52
|
+
}>;
|
|
45
53
|
componentWillLoad(): void;
|
|
46
54
|
componentDidLoad(): void;
|
|
47
55
|
onHostElementFocus(event: FocusEvent): void;
|
|
@@ -53,6 +53,13 @@ export declare class Q2Option implements ComponentInterface {
|
|
|
53
53
|
value: string;
|
|
54
54
|
display: string;
|
|
55
55
|
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Is emitted when the option is clicked.
|
|
58
|
+
*/
|
|
59
|
+
tctClick: EventEmitter<{
|
|
60
|
+
type: 'select' | 'remove';
|
|
61
|
+
value: string;
|
|
62
|
+
}>;
|
|
56
63
|
disconnectedCallback(): void;
|
|
57
64
|
componentWillLoad(): void;
|
|
58
65
|
componentDidLoad(): void;
|
|
@@ -2948,6 +2948,7 @@ declare global {
|
|
|
2948
2948
|
};
|
|
2949
2949
|
interface HTMLQ2DropdownItemElementEventMap {
|
|
2950
2950
|
"click": { type: 'select' | 'remove'; value: string };
|
|
2951
|
+
"tctClick": { type: 'select' | 'remove'; value: string };
|
|
2951
2952
|
}
|
|
2952
2953
|
interface HTMLQ2DropdownItemElement extends Components.Q2DropdownItem, HTMLStencilElement {
|
|
2953
2954
|
addEventListener<K extends keyof HTMLQ2DropdownItemElementEventMap>(type: K, listener: (this: HTMLQ2DropdownItemElement, ev: Q2DropdownItemCustomEvent<HTMLQ2DropdownItemElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -3153,6 +3154,7 @@ declare global {
|
|
|
3153
3154
|
};
|
|
3154
3155
|
interface HTMLQ2OptionElementEventMap {
|
|
3155
3156
|
"displayChanged": { value: string; display: string };
|
|
3157
|
+
"tctClick": { type: 'select' | 'remove'; value: string };
|
|
3156
3158
|
}
|
|
3157
3159
|
interface HTMLQ2OptionElement extends Components.Q2Option, HTMLStencilElement {
|
|
3158
3160
|
addEventListener<K extends keyof HTMLQ2OptionElementEventMap>(type: K, listener: (this: HTMLQ2OptionElement, ev: Q2OptionCustomEvent<HTMLQ2OptionElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -4590,8 +4592,13 @@ declare namespace LocalJSX {
|
|
|
4590
4592
|
"label"?: string;
|
|
4591
4593
|
/**
|
|
4592
4594
|
* Is emitted when the item is clicked.
|
|
4595
|
+
* @deprecated
|
|
4593
4596
|
*/
|
|
4594
4597
|
"onClick"?: (event: Q2DropdownItemCustomEvent<{ type: 'select' | 'remove'; value: string }>) => void;
|
|
4598
|
+
/**
|
|
4599
|
+
* Is emitted when the item is clicked.
|
|
4600
|
+
*/
|
|
4601
|
+
"onTctClick"?: (event: Q2DropdownItemCustomEvent<{ type: 'select' | 'remove'; value: string }>) => void;
|
|
4595
4602
|
/**
|
|
4596
4603
|
* Renders an icon button in the item. Clicking on this button will change the `type` on the item's click event detail to "remove".
|
|
4597
4604
|
*/
|
|
@@ -5165,6 +5172,10 @@ declare namespace LocalJSX {
|
|
|
5165
5172
|
* @private
|
|
5166
5173
|
*/
|
|
5167
5174
|
"onDisplayChanged"?: (event: Q2OptionCustomEvent<{ value: string; display: string }>) => void;
|
|
5175
|
+
/**
|
|
5176
|
+
* Is emitted when the option is clicked.
|
|
5177
|
+
*/
|
|
5178
|
+
"onTctClick"?: (event: Q2OptionCustomEvent<{ type: 'select' | 'remove'; value: string }>) => void;
|
|
5168
5179
|
/**
|
|
5169
5180
|
* Used by q2-option-list to set a role on the option
|
|
5170
5181
|
* @type {('option' | 'menuitem' | 'separator')}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentInterface } from '../stencil-public-runtime';
|
|
2
|
+
/**
|
|
3
|
+
* Emits specified events from a given component context with the provided detail.
|
|
4
|
+
*
|
|
5
|
+
* @template T - The type of the event detail. Defaults to the type of `CustomEvent['detail']`.
|
|
6
|
+
* @param context - The component context that contains the event emitters.
|
|
7
|
+
* @param events - An array of event names to be emitted.
|
|
8
|
+
* @param detail - The detail payload to be passed to each emitted event.
|
|
9
|
+
*/
|
|
10
|
+
declare const mirrorEmit: <T = any>(context: ComponentInterface, events: Array<string>, detail: T) => void;
|
|
11
|
+
export default mirrorEmit;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "q2-tecton-elements",
|
|
3
|
-
"version": "1.54.
|
|
3
|
+
"version": "1.54.4",
|
|
4
4
|
"description": "Q2 Tecton Custom Elements",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Q2 Tecton Team",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@stencil/core": "4.18.0",
|
|
39
|
-
"q2-tecton-common": "1.54.
|
|
39
|
+
"q2-tecton-common": "1.54.4",
|
|
40
40
|
"swiper": "8.4.4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"typescript": "5.4.5",
|
|
62
62
|
"typescript-eslint": "^7.11.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "e19da0b786616b67fc67ad74c6497d3c49d4ba3b"
|
|
65
65
|
}
|