@cscfi/csc-ui 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"file":"c-dropdown2.js","mappings":";;;;AAAA,MAAM,YAAY,GAAG,kkEAAkkE;;MCuB1kE,SAAS;;;;;IAwEZ,QAAG,GAAG,EAAE,CAAC;IAiFT,cAAS,GAAG,IAAI,CAAC;IAEjB,cAAS,GAAoB,EAAE,CAAC;IAEhC,sBAAiB,GAAG,IAAI,CAAC;IAMzB,iBAAY,GAAG,KAAK,CAAC;IAErB,kBAAa,GAAG,EAAE,CAAC;IAgBnB,cAAS,GAAG,IAAI,oBAAoB,CAC1C,CAAC,OAAO,EAAE,QAAQ;MAChB,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK;QACpB,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;UACzB,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC;YAC1B,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,SAAS;WAClB,CAAC,CAAC;UACH,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAClC;aAAM;UACL,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAClC;OACF,CAAC,CAAC;KACJ,EACD,EAAE,SAAS,EAAE,CAAC,EAAE,CACjB,CAAC;IAaM,oBAAe,GAAG,CAAC,IAAiB,EAAE,KAAa;;MACzD,MAAM,QAAQ,GAAG,CAAA,MAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,0CAAE,KAAK,MAAK,IAAI,CAAC,KAAK,CAAC;MAErE,IAAI,MAAM,GAAG,MAAM,CAAC;MAEpB,IAAI,QAAO,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAA,KAAK,QAAQ,EAAE;QACnC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAA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AI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;GACnC;EAED,MAAM;IACJ,IACE,IAAI,CAAC,YAAY;MACjB,IAAI,CAAC,YAAY,GAAG,CAAC;MACrB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EACrC;MACA,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,GAAG,EAAE,IAAI,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;MAC1E,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,GAAG,QAAQ,CAAC;KAC9C;IAED,QACE,EAAC,IAAI,QACH,WACE,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC,GAAG,EAC1B,KAAK,EAAC,gBAAgB,eACZ,QAAQ,iBACN,MAAM,IAEjB,IAAI,CAAC,UAAU,CACZ,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/c-dropdown/c-dropdown.scss?tag=c-dropdown&encapsulation=shadow","src/components/c-dropdown/c-dropdown.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-dropdown-background-color: Menu background color\n * @prop --c-dropdown-background-color-hover: Menu item hover background color\n * @prop --c-dropdown-text-color: Menu item text color\n * @prop --c-dropdown-text-color-active: Active menu item text color\n */\n --_c-dropdown-background-color: var(--c-dropdown-background-color, var(--c-white));\n --_c-dropdown-background-color-hover: var(--c-dropdown-background-color-hover, var(--c-primary-200));\n --_c-dropdown-text-color: var(--c-dropdown-text-color, var(--c-text-body));\n --_c-dropdown-text-color-active: var(--c-dropdown-text-color-active, var(--c-primary-600));\n\n // private\n --_c-dropdown-font-size: 14px;\n --_c-dropdown-height: 42px;\n\n display: block;\n position: absolute;\n\n mark {\n color: inherit;\n background-color: transparent;\n box-shadow: 0 2px 0 0 var(--_c-dropdown-text-color-active);\n }\n\n dialog {\n margin: 0;\n padding: 0;\n border: none;\n background-color: transparent;\n position: fixed;\n box-shadow: 2px 4px 10px #00000029;\n border-radius: 4px;\n overflow: hidden;\n\n &::backdrop {\n display: none;\n }\n }\n\n ul {\n margin: 0;\n padding: 0;\n background-color: var(--_c-dropdown-background-color);\n list-style: none;\n width: 100%;\n overflow-y: scroll;\n pointer-events: auto;\n border-radius: 4px;\n visibility: hidden;\n outline: none;\n max-width: var(--_c-dropdown-width);\n\n &.active {\n visibility: visible;\n animation: 0.2s 1 fade-in cubic-bezier(0.25, 0.8, 0.5, 1);\n }\n }\n\n li {\n align-items: center;\n background: var(--c-white);\n column-gap: 12px;\n cursor: pointer;\n display: flex;\n flex-wrap: nowrap;\n font-size: var(--_c-dropdown-font-size);\n min-height: var(--_c-dropdown-height);\n padding-left: 10px;\n padding-right: 10px;\n outline: none;\n white-space: nowrap;\n pointer-events: auto;\n width: 100%;\n \n span {\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &:not(.disabled):hover,\n &.active {\n background: var(--_c-dropdown-background-color-hover);\n color: var(--_c-dropdown-text-color-active);\n }\n\n &.disabled {\n background-color: rgba(var(--c-tertiary-rgb), 0.05);\n cursor: default;\n filter: grayscale(1) opacity(0.75);\n }\n }\n\n .visuallyhidden {\n border: 0;\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n }\n\n @keyframes fade-in {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n}\n","import {\n Component,\n Element,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n} from '@stencil/core';\nimport { CAutocompleteItem, CSelectItem } from '../../types';\nimport { mdiAlert } from '@mdi/js';\n\nexport type _CDropdownUpdateParams = {\n items?: CSelectItem[] | CAutocompleteItem[];\n options?: Record<string, HTMLCOptionElement>;\n};\n\n@Component({\n tag: 'c-dropdown',\n styleUrl: 'c-dropdown.scss',\n shadow: true,\n})\nexport class CDropdown {\n @Element() host: HTMLCDropdownElement;\n\n /**\n * Dropdown items\n */\n @Prop() items: CSelectItem[] | CAutocompleteItem[] = [];\n\n /**\n * Dropdown options\n */\n @Prop() options: Record<string, HTMLCOptionElement>;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage: number;\n\n /**\n * Dropdown parent\n */\n @Prop() parent: HTMLCSelectElement | HTMLCAutocompleteElement;\n\n /**\n * Dropdown scrolling parent\n */\n @Prop() wrapper: HTMLElement;\n\n /**\n * Initial value index\n */\n @Prop() index: number;\n\n /**\n * Dropdown open state\n */\n @Prop() isOpen = false;\n\n /**\n * Focus dropdown on open\n */\n @Prop() focusList: boolean;\n\n /**\n * Id of the input element\n */\n @Prop() inputId: string;\n\n /**\n * Type of the parent element\n */\n @Prop() type: 'select' | 'autocomplete';\n\n /**\n * @private\n */\n @Prop() wasClicked = false;\n\n @State() currentIndex: number = null;\n\n @State() isVisible = false;\n\n @State() topPosition: number;\n\n @State() bottomTranslate: number;\n\n @State() scrollingParent: HTMLElement;\n\n @State() statusText = '';\n\n // private _isOpenedWithKeyboard = false;\n\n private _id = '';\n\n /**\n * @private\n */\n @Method()\n async updateDropdown(params: _CDropdownUpdateParams) {\n this.items = [];\n this._itemRefs = [];\n this.options = {};\n\n requestAnimationFrame(() => {\n this.currentIndex = null;\n this.items = params.items || this.items;\n this.options = params.options || this.options;\n\n this._updateMenuItems();\n this._updateStatusText();\n });\n }\n\n /**\n * @private\n */\n @Method()\n async focusDropdown() {\n requestAnimationFrame(() => {\n this._listElement.focus();\n });\n }\n\n /**\n * @private\n */\n @Method()\n async focusItem(type: 'first' | 'last') {\n requestAnimationFrame(() => {\n const index = type === 'first' ? 0 : this.items.length - 1;\n\n this.currentIndex = index;\n\n this._itemRefs[index].focus();\n });\n }\n\n @Watch('isOpen')\n onOpenStateChange(open) {\n if (!this.wasClicked && ['select', 'autocomplete'].includes(this.type)) {\n // this._isOpenedWithKeyboard = open;\n }\n\n if (open) {\n this._onOpen();\n this._createEventListeners();\n\n requestAnimationFrame(() => {\n if (this.focusList) {\n this._listElement.focus();\n\n if (this.type === 'autocomplete') {\n this.currentIndex = 0;\n }\n\n this._handleCurrentIndexChange();\n }\n\n this._positionMenu();\n });\n\n return;\n }\n\n this._openedOnTop = false;\n this._onClose();\n }\n\n @Watch('currentIndex')\n onCurrentIndexChange() {\n this._handleCurrentIndexChange();\n }\n\n private _debounce = null;\n\n private _itemRefs: HTMLLIElement[] = [];\n\n private _lastKeyPressTime = null;\n\n private _listElement: HTMLUListElement;\n\n private _dialogElement: HTMLDialogElement;\n\n private _openedOnTop = false;\n\n private _searchString = '';\n\n private _resizeObserver: ResizeObserver;\n\n private get _listSize() {\n return this.items.length || 0;\n }\n\n private get _firstSelectableIndex() {\n return this.items.findIndex((item) => !item.disabled);\n }\n\n private get _lastSelectableIndex() {\n return this.items.findLastIndex((item) => !item.disabled);\n }\n\n private _observer = new IntersectionObserver(\n (entries, observer) => {\n entries.forEach((entry) => {\n if (!entry.isIntersecting) {\n entry.target.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n });\n observer.unobserve(entry.target);\n } else {\n observer.unobserve(entry.target);\n }\n });\n },\n { threshold: 1 },\n );\n\n private _highlightMatchingText(value: string) {\n if (this.type === 'select') return value;\n\n const regex = new RegExp(\n (this.parent as HTMLCAutocompleteElement).query,\n 'gi',\n );\n\n return value.replace(regex, (match) => `<mark>${match}</mark>`);\n }\n\n private _renderMenuItem = (item: CSelectItem, index: number) => {\n const isActive = this.items[this.currentIndex]?.value === item.value;\n\n let itemId = 'none';\n\n if (typeof item?.value === 'string') {\n itemId = item.value.replace(/[^a-zA-Z0-9-_]/g, '');\n }\n\n itemId = `item_${this.inputId}--${itemId}`;\n\n if (isActive) {\n this.currentIndex = index;\n this.parent.setActiveDescendant(itemId);\n }\n\n const listItem = document.createElement('li');\n\n // a11y\n listItem.role = 'option';\n listItem.ariaPosInSet = (index + 1).toString();\n listItem.ariaSetSize = this.items.length.toString();\n\n listItem.ariaSelected = isActive.toString();\n\n listItem.id = itemId;\n listItem.dataset.value = item.name;\n listItem.setAttribute('tabindex', '-1');\n\n listItem.classList.toggle('disabled', !!item.disabled);\n\n listItem.addEventListener('click', (event: MouseEvent) => {\n const isDisabled = this._itemRefs[index].classList.contains('disabled');\n\n if (isDisabled) {\n event.preventDefault();\n\n return;\n }\n\n this.currentIndex = index;\n this._onSelect(index);\n });\n\n listItem.addEventListener('focus', () => {\n listItem.classList.add('active');\n });\n\n listItem.addEventListener('blur', () => {\n listItem.classList.remove('active');\n });\n\n this._itemRefs.push(listItem);\n\n if (Object.keys(this.options).length) {\n requestAnimationFrame(() => {\n const option = this.options[item.value as string];\n\n if (!option) return;\n\n if (\n (this.parent as HTMLCAutocompleteElement).query?.length &&\n this.type === 'autocomplete'\n ) {\n const optionValue = option.querySelector('c-option-value');\n\n if (optionValue) {\n optionValue.innerHTML = this._highlightMatchingText(\n optionValue.textContent,\n );\n }\n }\n\n listItem.appendChild(option);\n\n this._listElement.appendChild(listItem);\n });\n\n return;\n }\n\n const span = document.createElement('span');\n span.innerHTML = this._highlightMatchingText(item.name);\n\n listItem.appendChild(span);\n\n this._listElement.appendChild(listItem);\n };\n\n private _renderEmptyItem() {\n const emptyElement = document.createElement('li');\n emptyElement.tabIndex = -1;\n\n const icon = document.createElement('c-icon');\n icon.path = mdiAlert;\n icon.size = 18;\n icon.color = 'var(--c-warning-600)';\n\n emptyElement.appendChild(icon);\n emptyElement.append('No suggestions found');\n\n this._listElement.replaceChildren(emptyElement);\n }\n\n private _updateMenuItems() {\n if (!this.items.length) {\n this._renderEmptyItem();\n\n return;\n }\n\n requestAnimationFrame(() => {\n this._listElement.replaceChildren();\n this._itemRefs.length = 0;\n\n this.items.map((item, index) => this._renderMenuItem(item, index));\n });\n }\n\n private _renderMenu(/* style */) {\n this._id = `${this.inputId}--items`;\n\n const dialogElement = document.createElement('dialog');\n\n const listElement = document.createElement('ul');\n\n // a11y\n listElement.role = `listbox`;\n listElement.ariaExpanded = this.isVisible.toString();\n listElement.tabIndex = -1;\n\n listElement.id = this._id;\n\n this._dialogElement = dialogElement;\n\n this._listElement = listElement;\n\n this._dialogElement.appendChild(listElement);\n\n this.host.shadowRoot.appendChild(dialogElement);\n\n this.items.map((item, index) => this._renderMenuItem(item, index));\n\n this.scrollingParent = this.wrapper;\n\n this._listElement.addEventListener(\n 'keydown',\n this._onKeyboardNavigation.bind(this),\n );\n\n this._listElement.addEventListener('keyup', this._onKeyDown.bind(this));\n }\n\n private _onOpen() {\n this.parent.shadowRoot.querySelector('.c-input').classList.add('active');\n this._listElement.classList.add('active');\n this._listElement.ariaExpanded = 'true';\n this._listElement.tabIndex = 0;\n this._dialogElement.showModal();\n }\n\n private _onClose(focusInput = false) {\n this.parent.onHideMenu();\n this.parent.shadowRoot.querySelector('.c-input').classList.remove('active');\n this._listElement.classList.remove('active');\n this._listElement.ariaExpanded = 'false';\n this._listElement.tabIndex = -1;\n this.isOpen = false;\n this.currentIndex = this.index;\n this._dialogElement.close();\n\n if (focusInput) {\n this.parent.shadowRoot.querySelector('input').focus();\n }\n }\n\n private _onSelect(index: number, focusInput = false) {\n const isDisabled = this._itemRefs[index].classList.contains('disabled');\n\n if (isDisabled) return;\n\n this.parent.onItemSelection(index);\n this.index = index;\n this._onClose(focusInput);\n\n this._itemRefs.forEach((item, i) => {\n item.ariaSelected = (i === index).toString();\n });\n }\n\n private _getParentPosition() {\n return this.parent.shadowRoot\n .querySelector('.c-input__slot')\n .getBoundingClientRect();\n }\n\n private _positionMenu() {\n const scrollTop = this.scrollingParent.scrollTop;\n\n const scrollLeft = this.scrollingParent.scrollLeft;\n\n const {\n bottom: parentBottom,\n left: parentLeft,\n width: parentWidth,\n height: parentHeight,\n } = this._getParentPosition();\n\n this.bottomTranslate = 0;\n\n this._dialogElement.style.width = `${parentWidth}px`;\n this._dialogElement.style.top = `${parentBottom}px`;\n this._dialogElement.style.left = `${parentLeft}px`;\n\n this._dialogElement.style.removeProperty('transform');\n\n const { bottom, right, height, width } =\n this._dialogElement.getBoundingClientRect();\n\n const isInView = {\n x: right < this.scrollingParent.scrollWidth - scrollLeft,\n y: bottom < this.scrollingParent.scrollHeight - scrollTop,\n };\n\n if (!isInView.y || this._openedOnTop) {\n this._openedOnTop = true;\n\n this.bottomTranslate = height + parentHeight;\n\n this._dialogElement.style.setProperty(\n 'transform',\n `translateY(-${this.bottomTranslate}px`,\n );\n }\n\n this.host.style.setProperty('--_c-dropdown-width', `${parentWidth}px`);\n\n this.topPosition = parentBottom;\n\n if (!isInView.x) {\n this._dialogElement.style.left = `${\n parseFloat(this._dialogElement.style.left) - width + parentWidth\n }px`;\n }\n }\n\n private _createEventListeners() {\n requestAnimationFrame(async () => {\n this._listElement.classList.add('active');\n });\n }\n\n private _scrollToElement() {\n if (this.items.length > this.itemsPerPage) {\n const itemRef = this._itemRefs[this.currentIndex];\n\n if (!!itemRef) {\n this._observer.observe(itemRef);\n }\n }\n }\n\n private _onKeyDown(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n private _onKeyboardNavigation(event: KeyboardEvent) {\n this.wasClicked = false;\n\n const letterNumber = /^[0-9a-zA-Z]+$/;\n\n if (\n (event.key.match(letterNumber) && event.key.length === 1) ||\n event.key === 'Backspace'\n ) {\n if (this.type === 'autocomplete') {\n this.parent.shadowRoot.querySelector('input').focus();\n\n const { query } = this.parent as HTMLCAutocompleteElement;\n\n let updatedQuery = '';\n\n if (event.key === 'Backspace') {\n updatedQuery = query.slice(0, -1);\n } else {\n updatedQuery = `${query}${event.key}`;\n }\n\n (this.parent as HTMLCAutocompleteElement).updateQuery(updatedQuery);\n\n return;\n }\n\n if (\n Date.now() - this._lastKeyPressTime > 3000 ||\n this._searchString.length > 2\n ) {\n this._searchString = event.key;\n } else {\n this._searchString = `${this._searchString}${event.key}`;\n }\n\n this._lastKeyPressTime = Date.now();\n\n const selectedItem = this.items.find((i) =>\n i.name.toLowerCase().startsWith(this._searchString),\n );\n\n if (selectedItem) {\n this.currentIndex = this.items.findIndex(\n (element) => element === selectedItem,\n );\n\n if (this.isOpen) {\n this._scrollToElement();\n } else {\n this._onSelect(this.currentIndex, true);\n }\n }\n }\n\n if (event.key === 'Enter') {\n this._onSelect(this.currentIndex, true);\n }\n\n if (event.key === ' ' && !this.isOpen) {\n event.preventDefault();\n\n this.isOpen = true;\n }\n\n if ('Tab' === event.key) {\n this._onClose();\n }\n\n if (event.key === 'Escape') {\n this._onClose(true);\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.currentIndex === null) {\n this.currentIndex = 0;\n } else if (this.isOpen && this.currentIndex + 1 < this._listSize) {\n this.currentIndex += 1;\n }\n\n this.isOpen = true;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.isOpen && this.currentIndex === 0) {\n this.currentIndex = null;\n this._onClose(true);\n\n return;\n } else if (this.isOpen && this.currentIndex > 0) {\n this.currentIndex -= 1;\n } else if (this.currentIndex === null) {\n this.currentIndex = this._listSize - 1;\n }\n\n this.isOpen = true;\n }\n\n if (event.key === 'Home' && this.isOpen) {\n event.preventDefault();\n\n this.currentIndex = this._firstSelectableIndex;\n }\n\n if (event.key === 'End' && this.isOpen) {\n event.preventDefault();\n\n this.currentIndex = this._lastSelectableIndex;\n }\n }\n\n private _handleCurrentIndexChange() {\n if (this.currentIndex === null) {\n this.parent?.setActiveDescendant('');\n\n return;\n }\n\n this._updateStatusText();\n\n requestAnimationFrame(() => {\n const item = this._itemRefs[this.currentIndex];\n\n if (!item) return;\n\n item?.focus();\n\n this.parent?.setActiveDescendant(item.id ?? null);\n });\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n const selection = this._itemRefs[this.currentIndex];\n\n const ending = !!this.items.length\n ? ', to navigate use up and down arrows'\n : '';\n\n const isDisabled = !!selection?.classList?.contains('disabled');\n\n const beginning = isDisabled ? 'Disabled option - ' : '';\n\n let selectionText = !!selection\n ? `${beginning}${selection.dataset.value} - ${selection.ariaPosInSet} of ${selection.ariaSetSize} is highlighted`\n : null;\n\n if (this.currentIndex === null && this.type === 'autocomplete') {\n selectionText = this.items.length\n ? `${this.items.length} result${\n this.items.length !== 1 ? 's' : ''\n } available`\n : 'No search results available';\n }\n\n this.statusText = `${selectionText || ending}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n componentWillLoad() {\n this._renderMenu();\n }\n\n componentDidLoad() {\n this.currentIndex = this.index;\n\n this._resizeObserver = new ResizeObserver(() => {\n if (!this.isOpen) return;\n\n console.log('🍔');\n this._positionMenu();\n });\n\n this._resizeObserver.observe(this.scrollingParent);\n }\n\n disconnectedCallback() {\n this._resizeObserver.disconnect();\n }\n\n render() {\n if (\n this.itemsPerPage &&\n this.itemsPerPage > 0 &&\n this.items.length > this.itemsPerPage\n ) {\n this._listElement.style.maxHeight = 42 * (this.itemsPerPage + 0.5) + 'px';\n this._listElement.style.overflowY = 'scroll';\n }\n\n return (\n <Host>\n <div\n id={'announce-' + this._id}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"c-dropdown2.js","mappings":";;;;AAAA,MAAM,YAAY,GAAG,mkEAAmkE;;MCuB3kE,SAAS;;;;;IAoEZ,QAAG,GAAG,EAAE,CAAC;IAiFT,cAAS,GAAG,IAAI,CAAC;IAEjB,cAAS,GAAoB,EAAE,CAAC;IAEhC,sBAAiB,GAAG,IAAI,CAAC;IAMzB,iBAAY,GAAG,KAAK,CAAC;IAErB,kBAAa,GAAG,EAAE,CAAC;IAgBnB,cAAS,GAAG,IAAI,oBAAoB,CAC1C,CAAC,OAAO,EAAE,QAAQ;MAChB,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK;QACpB,IAAI,CAAC,KAAK,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CAAC,GAAG,GAAG,GAAG,EAClC,YAAY;YACZ,6BAA6B,CAAC;OACnC;MAED,IAAI,CAAC,UAAU,GAAG,GAAG,aAAa,IAAI,MAAM,EAAE,CAAC;MAE/C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;KACvB,EAAE,IAAI,CAAC,CAAC;GACV;EAED,iBAAiB;IACf,IAAI,CAAC,WAAW,EAAE,CAAC;GACpB;EAED,gBAAgB;IACd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC;IAE/B,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,CAAC;MACxC,IAAI,CAAC,IAAI,CAAC,MAAM;QAAE,OAAO;MAEzB,IAAI,CAAC,aAAa,EAAE,CAAC;KACtB,CAAC,CAAC;IAEH,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;GACnD;EAED,oBAAoB;IAClB,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;GACnC;EAED,MAAM;IACJ,IACE,IAAI,CAAC,YAAY;MACjB,IAAI,CAAC,YAAY,GAAG,CAAC;MACrB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EACrC;MACA,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,IAAI,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;KAC1E;IAED,QACE,EAAC,IAAI,QACH,WACE,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC,GAAG,EAC1B,KAAK,EAAC,gBAAgB,eACZ,QAAQ,iBACN,MAAM,IAEjB,IAAI,CAAC,UAAU,CACZ,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/c-dropdown/c-dropdown.scss?tag=c-dropdown&encapsulation=shadow","src/components/c-dropdown/c-dropdown.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-dropdown-background-color: Menu background color\n * @prop --c-dropdown-background-color-hover: Menu item hover background color\n * @prop --c-dropdown-text-color: Menu item text color\n * @prop --c-dropdown-text-color-active: Active menu item text color\n */\n --_c-dropdown-background-color: var(--c-dropdown-background-color, var(--c-white));\n --_c-dropdown-background-color-hover: var(--c-dropdown-background-color-hover, var(--c-primary-200));\n --_c-dropdown-text-color: var(--c-dropdown-text-color, var(--c-text-body));\n --_c-dropdown-text-color-active: var(--c-dropdown-text-color-active, var(--c-primary-600));\n\n // private\n --_c-dropdown-font-size: 14px;\n --_c-dropdown-height: 42px;\n\n display: block;\n position: absolute;\n\n mark {\n background-color: transparent;\n box-shadow: 0 2px 0 0 var(--_c-dropdown-text-color-active);\n color: inherit;\n }\n\n dialog {\n background-color: transparent;\n border-radius: 4px;\n border: none;\n box-shadow: 2px 4px 10px #00000029;\n margin: 0;\n overflow: hidden;\n padding: 0;\n position: fixed;\n\n &::backdrop {\n display: none;\n }\n }\n\n ul {\n background-color: var(--_c-dropdown-background-color);\n border-radius: 4px;\n height: 100%;\n list-style: none;\n margin: 0;\n outline: none;\n overflow-y: scroll;\n padding: 0;\n pointer-events: auto;\n visibility: hidden;\n width: 100%;\n\n &.active {\n visibility: visible;\n animation: 0.2s 1 fade-in cubic-bezier(0.25, 0.8, 0.5, 1);\n }\n }\n\n li {\n align-items: center;\n background: var(--c-white);\n column-gap: 12px;\n cursor: pointer;\n display: flex;\n flex-wrap: nowrap;\n font-size: var(--_c-dropdown-font-size);\n min-height: var(--_c-dropdown-height);\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n pointer-events: auto;\n white-space: nowrap;\n width: 100%;\n \n span,\n c-option-value {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 100%;\n }\n\n &:not(.disabled):hover,\n &.active {\n background: var(--_c-dropdown-background-color-hover);\n color: var(--_c-dropdown-text-color-active);\n }\n\n &.disabled {\n background-color: rgba(var(--c-tertiary-rgb), 0.05);\n cursor: default;\n filter: grayscale(1) opacity(0.75);\n }\n }\n\n .visuallyhidden {\n border: 0;\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n }\n\n @keyframes fade-in {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n}\n","import {\n Component,\n Element,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n} from '@stencil/core';\nimport { CAutocompleteItem, CSelectItem } from '../../types';\nimport { mdiAlert } from '@mdi/js';\n\nexport type _CDropdownUpdateParams = {\n items?: CSelectItem[] | CAutocompleteItem[];\n options?: Record<string, HTMLCOptionElement>;\n};\n\n@Component({\n tag: 'c-dropdown',\n styleUrl: 'c-dropdown.scss',\n shadow: true,\n})\nexport class CDropdown {\n @Element() host: HTMLCDropdownElement;\n\n /**\n * Dropdown items\n */\n @Prop() items: CSelectItem[] | CAutocompleteItem[] = [];\n\n /**\n * Dropdown options\n */\n @Prop() options: Record<string, HTMLCOptionElement>;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage: number;\n\n /**\n * Dropdown parent\n */\n @Prop() parent: HTMLCSelectElement | HTMLCAutocompleteElement;\n\n /**\n * Dropdown scrolling parent\n */\n @Prop() wrapper: HTMLElement;\n\n /**\n * Initial value index\n */\n @Prop() index: number;\n\n /**\n * Dropdown open state\n */\n @Prop() isOpen = false;\n\n /**\n * Focus dropdown on open\n */\n @Prop() focusList: boolean;\n\n /**\n * Id of the input element\n */\n @Prop() inputId: string;\n\n /**\n * Type of the parent element\n */\n @Prop() type: 'select' | 'autocomplete';\n\n /**\n * @private\n */\n @Prop() wasClicked = false;\n\n @State() currentIndex: number = null;\n\n @State() isVisible = false;\n\n @State() topPosition: number;\n\n @State() bottomTranslate: number;\n\n @State() statusText = '';\n\n private _id = '';\n\n /**\n * @private\n */\n @Method()\n async updateDropdown(params: _CDropdownUpdateParams) {\n this.items = [];\n this._itemRefs = [];\n this.options = {};\n\n requestAnimationFrame(() => {\n this.currentIndex = null;\n this.items = params.items || this.items;\n this.options = params.options || this.options;\n\n this._updateMenuItems();\n this._updateStatusText();\n });\n }\n\n /**\n * @private\n */\n @Method()\n async focusDropdown() {\n requestAnimationFrame(() => {\n this._listElement.focus();\n });\n }\n\n /**\n * @private\n */\n @Method()\n async focusItem(type: 'first' | 'last') {\n requestAnimationFrame(() => {\n const index = type === 'first' ? 0 : this.items.length - 1;\n\n this.currentIndex = index;\n\n this._itemRefs[index].focus();\n });\n }\n\n @Watch('isOpen')\n onOpenStateChange(open) {\n if (!this.wasClicked && ['select', 'autocomplete'].includes(this.type)) {\n // this._isOpenedWithKeyboard = open;\n }\n\n if (open) {\n this._onOpen();\n this._createEventListeners();\n\n requestAnimationFrame(() => {\n if (this.focusList) {\n this._listElement.focus();\n\n if (this.type === 'autocomplete') {\n this.currentIndex = 0;\n }\n\n this._handleCurrentIndexChange();\n }\n\n this._positionMenu();\n });\n\n return;\n }\n\n this._openedOnTop = false;\n this._onClose();\n }\n\n @Watch('currentIndex')\n onCurrentIndexChange() {\n this._handleCurrentIndexChange();\n }\n\n private _debounce = null;\n\n private _itemRefs: HTMLLIElement[] = [];\n\n private _lastKeyPressTime = null;\n\n private _listElement: HTMLUListElement;\n\n private _dialogElement: HTMLDialogElement;\n\n private _openedOnTop = false;\n\n private _searchString = '';\n\n private _resizeObserver: ResizeObserver;\n\n private get _listSize() {\n return this.items.length || 0;\n }\n\n private get _firstSelectableIndex() {\n return this.items.findIndex((item) => !item.disabled);\n }\n\n private get _lastSelectableIndex() {\n return this.items.findLastIndex((item) => !item.disabled);\n }\n\n private _observer = new IntersectionObserver(\n (entries, observer) => {\n entries.forEach((entry) => {\n if (!entry.isIntersecting) {\n entry.target.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n });\n observer.unobserve(entry.target);\n } else {\n observer.unobserve(entry.target);\n }\n });\n },\n { threshold: 1 },\n );\n\n private _highlightMatchingText(value: string) {\n if (this.type === 'select') return value;\n\n const regex = new RegExp(\n (this.parent as HTMLCAutocompleteElement).query,\n 'gi',\n );\n\n return value.replace(regex, (match) => `<mark>${match}</mark>`);\n }\n\n private _renderMenuItem = (item: CSelectItem, index: number) => {\n const isActive = this.items[this.currentIndex]?.value === item.value;\n\n let itemId = 'none';\n\n if (typeof item?.value === 'string') {\n itemId = item.value.replace(/[^a-zA-Z0-9-_]/g, '');\n }\n\n itemId = `item_${this.inputId}--${itemId}`;\n\n if (isActive) {\n this.currentIndex = index;\n this.parent.setActiveDescendant(itemId);\n }\n\n const listItem = document.createElement('li');\n\n // a11y\n listItem.role = 'option';\n listItem.ariaPosInSet = (index + 1).toString();\n listItem.ariaSetSize = this.items.length.toString();\n\n listItem.ariaSelected = isActive.toString();\n\n listItem.id = itemId;\n listItem.dataset.value = item.name;\n listItem.setAttribute('tabindex', '-1');\n\n listItem.classList.toggle('disabled', !!item.disabled);\n\n listItem.addEventListener('click', (event: MouseEvent) => {\n const isDisabled = this._itemRefs[index].classList.contains('disabled');\n\n if (isDisabled) {\n event.preventDefault();\n\n return;\n }\n\n this.currentIndex = index;\n this._onSelect(index);\n });\n\n listItem.addEventListener('focus', () => {\n listItem.classList.add('active');\n });\n\n listItem.addEventListener('blur', () => {\n listItem.classList.remove('active');\n });\n\n this._itemRefs.push(listItem);\n\n if (Object.keys(this.options).length) {\n requestAnimationFrame(() => {\n const option = this.options[item.value as string];\n\n if (!option) return;\n\n if (\n (this.parent as HTMLCAutocompleteElement).query?.length &&\n this.type === 'autocomplete'\n ) {\n const optionValue = option.querySelector('c-option-value');\n\n if (optionValue) {\n optionValue.innerHTML = this._highlightMatchingText(\n optionValue.textContent,\n );\n }\n }\n\n listItem.appendChild(option);\n\n this._listElement.appendChild(listItem);\n });\n\n return;\n }\n\n const span = document.createElement('span');\n span.innerHTML = this._highlightMatchingText(item.name);\n\n listItem.appendChild(span);\n\n this._listElement.appendChild(listItem);\n };\n\n private _renderEmptyItem() {\n const emptyElement = document.createElement('li');\n emptyElement.tabIndex = -1;\n\n const icon = document.createElement('c-icon');\n icon.path = mdiAlert;\n icon.size = 18;\n icon.color = 'var(--c-warning-600)';\n\n emptyElement.appendChild(icon);\n emptyElement.append('No suggestions found');\n\n this._listElement.replaceChildren(emptyElement);\n }\n\n private _updateMenuItems() {\n if (!this.items.length) {\n this._renderEmptyItem();\n\n return;\n }\n\n requestAnimationFrame(() => {\n this._listElement.replaceChildren();\n this._itemRefs.length = 0;\n\n this.items.map((item, index) => this._renderMenuItem(item, index));\n });\n }\n\n private _renderMenu(/* style */) {\n this._id = `${this.inputId}--items`;\n\n const dialogElement = document.createElement('dialog');\n\n const listElement = document.createElement('ul');\n\n // a11y\n listElement.role = `listbox`;\n listElement.ariaExpanded = this.isVisible.toString();\n listElement.tabIndex = -1;\n\n listElement.id = this._id;\n\n this._dialogElement = dialogElement;\n\n this._listElement = listElement;\n\n this._dialogElement.appendChild(listElement);\n\n this.host.shadowRoot.appendChild(dialogElement);\n\n this.items.map((item, index) => this._renderMenuItem(item, index));\n\n this._listElement.addEventListener(\n 'keydown',\n this._onKeyboardNavigation.bind(this),\n );\n\n this._listElement.addEventListener('keyup', this._onKeyDown.bind(this));\n }\n\n private _onOpen() {\n this.parent.shadowRoot.querySelector('.c-input').classList.add('active');\n this._listElement.classList.add('active');\n this._listElement.ariaExpanded = 'true';\n this._listElement.tabIndex = 0;\n this._dialogElement.showModal();\n }\n\n private _onClose(focusInput = false) {\n this.parent.onHideMenu();\n this.parent.shadowRoot.querySelector('.c-input').classList.remove('active');\n this._listElement.classList.remove('active');\n this._listElement.ariaExpanded = 'false';\n this._listElement.tabIndex = -1;\n this.isOpen = false;\n this.currentIndex = this.index;\n this._dialogElement.close();\n\n if (focusInput) {\n this.parent.shadowRoot.querySelector('input').focus();\n }\n }\n\n private _onSelect(index: number, focusInput = false) {\n const isDisabled = this._itemRefs[index].classList.contains('disabled');\n\n if (isDisabled) return;\n\n this.parent.onItemSelection(index);\n this.index = index;\n this._onClose(focusInput);\n\n this._itemRefs.forEach((item, i) => {\n item.ariaSelected = (i === index).toString();\n });\n }\n\n private _getParentPosition() {\n return this.parent.shadowRoot\n .querySelector('.c-input__slot')\n .getBoundingClientRect();\n }\n\n private _positionMenu() {\n const { innerWidth, innerHeight } = window;\n\n const {\n bottom: parentBottom,\n left: parentLeft,\n width: parentWidth,\n height: parentHeight,\n top: parentTop,\n } = this._getParentPosition();\n\n this.bottomTranslate = 0;\n\n this._dialogElement.style.width = `${parentWidth}px`;\n this._dialogElement.style.top = `${parentBottom}px`;\n this._dialogElement.style.left = `${parentLeft}px`;\n\n this._dialogElement.style.removeProperty('transform');\n\n const { bottom, right, height, width } =\n this._dialogElement.getBoundingClientRect();\n\n const isInView = {\n x: right < innerWidth,\n y: bottom < innerHeight,\n };\n\n const fitsOnTop = parentTop - height > 0;\n\n if (!fitsOnTop && !isInView.y) {\n this._dialogElement.style.height = `${parentTop}px`;\n }\n\n if (!isInView.y || this._openedOnTop) {\n this._openedOnTop = true;\n\n this.bottomTranslate = height + parentHeight;\n\n this._dialogElement.style.setProperty(\n 'transform',\n `translateY(-${this.bottomTranslate}px`,\n );\n }\n\n this.topPosition = parentBottom;\n\n if (!isInView.x) {\n this._dialogElement.style.left = `${\n parseFloat(this._dialogElement.style.left) - width + parentWidth\n }px`;\n }\n }\n\n private _createEventListeners() {\n requestAnimationFrame(async () => {\n this._listElement.classList.add('active');\n });\n }\n\n private _scrollToElement() {\n if (this.items.length > this.itemsPerPage) {\n const itemRef = this._itemRefs[this.currentIndex];\n\n if (!!itemRef) {\n this._observer.observe(itemRef);\n }\n }\n }\n\n private _onKeyDown(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n private _onKeyboardNavigation(event: KeyboardEvent) {\n this.wasClicked = false;\n\n const letterNumber = /^[0-9a-zA-Z]+$/;\n\n if (\n (event.key.match(letterNumber) && event.key.length === 1) ||\n event.key === 'Backspace'\n ) {\n if (this.type === 'autocomplete') {\n this.parent.shadowRoot.querySelector('input').focus();\n\n const { query } = this.parent as HTMLCAutocompleteElement;\n\n let updatedQuery = '';\n\n if (event.key === 'Backspace') {\n updatedQuery = query.slice(0, -1);\n } else {\n updatedQuery = `${query}${event.key}`;\n }\n\n (this.parent as HTMLCAutocompleteElement).updateQuery(updatedQuery);\n\n return;\n }\n\n if (\n Date.now() - this._lastKeyPressTime > 3000 ||\n this._searchString.length > 2\n ) {\n this._searchString = event.key;\n } else {\n this._searchString = `${this._searchString}${event.key}`;\n }\n\n this._lastKeyPressTime = Date.now();\n\n const selectedItem = this.items.find((i) =>\n i.name.toLowerCase().startsWith(this._searchString),\n );\n\n if (selectedItem) {\n this.currentIndex = this.items.findIndex(\n (element) => element === selectedItem,\n );\n\n if (this.isOpen) {\n this._scrollToElement();\n } else {\n this._onSelect(this.currentIndex, true);\n }\n }\n }\n\n if (event.key === 'Enter') {\n this._onSelect(this.currentIndex, true);\n }\n\n if (event.key === ' ' && !this.isOpen) {\n event.preventDefault();\n\n this.isOpen = true;\n }\n\n if ('Tab' === event.key) {\n this._onClose();\n }\n\n if (event.key === 'Escape') {\n this._onClose(true);\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.currentIndex === null) {\n this.currentIndex = 0;\n } else if (this.isOpen && this.currentIndex + 1 < this._listSize) {\n this.currentIndex += 1;\n }\n\n this.isOpen = true;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.isOpen && this.currentIndex === 0) {\n this.currentIndex = null;\n this._onClose(true);\n\n return;\n } else if (this.isOpen && this.currentIndex > 0) {\n this.currentIndex -= 1;\n } else if (this.currentIndex === null) {\n this.currentIndex = this._listSize - 1;\n }\n\n this.isOpen = true;\n }\n\n if (event.key === 'Home' && this.isOpen) {\n event.preventDefault();\n\n this.currentIndex = this._firstSelectableIndex;\n }\n\n if (event.key === 'End' && this.isOpen) {\n event.preventDefault();\n\n this.currentIndex = this._lastSelectableIndex;\n }\n }\n\n private _handleCurrentIndexChange() {\n if (this.currentIndex === null) {\n this.parent?.setActiveDescendant('');\n\n return;\n }\n\n this._updateStatusText();\n\n requestAnimationFrame(() => {\n const item = this._itemRefs[this.currentIndex];\n\n if (!item) return;\n\n item?.focus();\n\n this.parent?.setActiveDescendant(item.id ?? null);\n });\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n const selection = this._itemRefs[this.currentIndex];\n\n const ending = !!this.items.length\n ? ', to navigate use up and down arrows'\n : '';\n\n const isDisabled = !!selection?.classList?.contains('disabled');\n\n const beginning = isDisabled ? 'Disabled option - ' : '';\n\n let selectionText = !!selection\n ? `${beginning}${selection.dataset.value} - ${selection.ariaPosInSet} of ${selection.ariaSetSize} is highlighted`\n : null;\n\n if (this.currentIndex === null && this.type === 'autocomplete') {\n selectionText = this.items.length\n ? `${this.items.length} result${\n this.items.length !== 1 ? 's' : ''\n } available`\n : 'No search results available';\n }\n\n this.statusText = `${selectionText || ending}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n componentWillLoad() {\n this._renderMenu();\n }\n\n componentDidLoad() {\n this.currentIndex = this.index;\n\n this._resizeObserver = new ResizeObserver(() => {\n if (!this.isOpen) return;\n\n this._positionMenu();\n });\n\n this._resizeObserver.observe(this._dialogElement);\n }\n\n disconnectedCallback() {\n this._resizeObserver.disconnect();\n }\n\n render() {\n if (\n this.itemsPerPage &&\n this.itemsPerPage > 0 &&\n this.items.length > this.itemsPerPage\n ) {\n this._dialogElement.style.height = 42 * (this.itemsPerPage + 0.5) + 'px';\n }\n\n return (\n <Host>\n <div\n id={'announce-' + this._id}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,2 +1,2 @@
1
- import{p as e,b as a}from"./p-9d54e9a4.js";export{s as setNonce}from"./p-9d54e9a4.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a(JSON.parse('[["p-37c19431",[[1,"c-data-table",{"data":[16],"externalData":[4,"external-data"],"headers":[16],"hideFooter":[4,"hide-footer"],"footerOptions":[16],"loading":[4],"loadingText":[1,"loading-text"],"noDataText":[1,"no-data-text"],"pagination":[1040],"selectable":[4],"singleSelection":[4,"single-selection"],"selectionProperty":[1,"selection-property"],"singleExpansion":[4,"single-expansion"],"sortBy":[1032,"sort-by"],"sortDirection":[1025,"sort-direction"],"stickyHeader":[4,"sticky-header"],"horizontalScrolling":[4,"horizontal-scrolling"],"_activeRows":[32],"_data":[32],"_isIndeterminate":[32],"_isPaginationSimple":[32],"_selections":[32],"hasOverflow":[32],"hiddenHeaders":[32],"initiallyHiddenHeaders":[32],"forceRender":[32],"breakpoints":[32],"markedFooterWidth":[32],"parentWidth":[32],"firstCellHidden":[32],"lastCellHidden":[32],"clearSelections":[64],"getData":[64]},null,{"hiddenHeaders":["onHiddenHeaderChange"],"data":["onDataChange"],"headers":["onHeaderChange"],"singleSelection":["onSingleSelectionChange"],"loading":["onLoadingChange"]}]]],["p-ae28ae3f",[[65,"c-autocomplete",{"autofocus":[4],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"shadow":[4],"name":[1],"label":[1],"query":[1025],"value":[1032],"dense":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"placeholder":[1],"returnValue":[4,"return-value"],"items":[16],"itemsPerPage":[2,"items-per-page"],"optionAsSelection":[4,"option-as-selection"],"menuVisible":[32],"currentIndex":[32],"hasOptionItems":[32],"options":[32],"setValue":[64],"onHideMenu":[64],"setActiveDescendant":[64],"updateQuery":[64],"onItemSelection":[64]},[[1,"keydown","handleKeyDown"]],{"items":["watchHandler"],"value":["onValueChange"]}]]],["p-0f76461d",[[1,"c-navigation-button"]]],["p-d94b9e92",[[65,"c-select",{"autofocus":[4],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"label":[1],"shadow":[4],"name":[1],"required":[4],"returnValue":[4,"return-value"],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"itemsPerPage":[2,"items-per-page"],"placeholder":[1],"value":[1032],"items":[16],"optionAsSelection":[4,"option-as-selection"],"menuVisible":[32],"currentIndex":[32],"activeListItemId":[32],"statusText":[32],"hasOptionItems":[32],"previousValue":[32],"onItemSelection":[64],"onHideMenu":[64],"setActiveDescendant":[64]},[[2,"keydown","handleKeyDown"]],{"value":["onValueChange"],"validate":["validateChange"],"currentIndex":["onCurrentIndexChange"]}]]],["p-57b4991f",[[1,"c-side-navigation",{"mobile":[4],"menuVisible":[1028,"menu-visible"]},[[0,"itemChange","handleChange"]]]]],["p-15fea966",[[1,"c-tabs",{"value":[1032],"borderless":[4],"disableAnimation":[4,"disable-animation"],"justify":[1],"mobileBreakpoint":[2,"mobile-breakpoint"],"vertical":[4],"isOverflowing":[32],"isMobile":[32],"scrollOffset":[32]},[[1,"tabFocus","tabFocusHandler"],[1,"tabChange","tabChangeHandler"],[2,"keydown","handleKeyDown"],[2,"keyup","handleKeyUp"]],{"justify":["onJustificationChange"],"value":["onExternalValueChange"],"scrollOffset":["onScrollOffsetChange"]}]]],["p-c5deb643",[[1,"c-tag",{"active":[4],"block":[4],"fit":[4],"flat":[4],"closeable":[4],"badge":[8]}]]],["p-f0329312",[[65,"c-text-field",{"autofocus":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"trimWhitespace":[4,"trim-whitespace"],"label":[1],"max":[2],"min":[2],"name":[1],"number":[4],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[1025],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"messageOptions":[32]}]]],["p-8b7e9097",[[4,"c-swiper",{"value":[1544],"elementId":[1,"id"],"isBeginning":[32],"isEnd":[32],"statusText":[32]},[[0,"changeValue","onTabClick"],[2,"keyup","handleKeyUp"]]]]],["p-62e4ebd9",[[1,"c-side-navigation-item",{"active":[4],"href":[1],"target":[1],"loading":[4]},[[0,"itemChange","handleChange"]],{"active":["onActiveChange"]}]]],["p-6ec9109d",[[1,"c-sub-navigation-item",{"active":[4],"focusable":[4],"href":[1],"target":[1],"loading":[4]}]]],["p-14ed80ac",[[1,"c-toasts",{"absolute":[4],"horizontal":[1],"vertical":[1],"messages":[32],"addToast":[64],"removeToast":[64]}]]],["p-9f2311a7",[[1,"c-accordion-item",{"collapsable":[4],"heading":[1],"value":[8],"expanded":[4],"outlined":[4]},[[2,"keydown","handleKeyDown"],[0,"changeValue","stop"]]]]],["p-192145f2",[[1,"c-list-item",{"active":[4],"disabled":[4],"disabledByParent":[4,"disabled-by-parent"],"hoverable":[4],"ripple":[4],"href":[1],"target":[1]},null,{"active":["onActiveChange"]}]]],["p-e970fa68",[[1,"c-login-card-actions",{"align":[1],"justify":[1]}]]],["p-ef6162d9",[[65,"c-otp-input",{"hideDetails":[4,"hide-details"],"hint":[1],"elementId":[1,"id"],"length":[2],"valid":[4],"validation":[1],"statusText":[32]},null,{"validation":["onValidationMessageChange"]}]]],["p-05bb5c30",[[65,"c-radio-group",{"value":[1032],"hideDetails":[4,"hide-details"],"hint":[1],"inline":[4],"label":[1],"color":[1],"items":[16],"disabled":[4],"returnValue":[4,"return-value"],"required":[4],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-e0c3d13b",[[1,"c-swiper-tab",{"disabled":[4],"active":[4],"label":[1],"hostId":[1,"id"],"setsize":[2],"position":[2],"value":[8]},[[1,"click","onTabClick"]]]]],["p-dea9da0e",[[1,"c-tab",{"active":[4],"disabled":[4],"hostId":[1,"id"],"position":[2],"setsize":[2],"value":[8]},[[1,"focus","onTabFocus"],[1,"keydown","handleKeydown"]]]]],["p-79308b3f",[[1,"c-accordion",{"value":[1032],"mandatory":[4],"multiple":[4],"outlined":[4]},[[1,"itemChange","onAccordionItemChange"]],{"value":["watchPropHandler"]}]]],["p-f4a9cb4d",[[1,"c-alert",{"type":[1]}]]],["p-cea20d08",[[1,"c-card-content"]]],["p-28282ef5",[[1,"c-card-title"]]],["p-b09ba433",[[1,"c-link",{"href":[1],"underline":[4],"target":[1],"weight":[1]}]]],["p-4c23471f",[[0,"c-list",{"disabled":[4]},null,{"disabled":["onDisabledChange"]}]]],["p-6f86810a",[[1,"c-list-item-title",{"active":[4]}]]],["p-a8da163c",[[1,"c-login-button",{"href":[1],"src":[1],"alt":[1]}]]],["p-a8073d7e",[[1,"c-login-buttons"]]],["p-01ed27ec",[[4,"c-login-card",{"backgroundPosition":[1,"background-position"],"mobileBreakpoint":[2,"mobile-breakpoint"],"overlay":[4],"overlayBlendMode":[1,"overlay-blend-mode"],"src":[1],"path":[32],"imageHeight":[32]}]]],["p-55ca2b16",[[1,"c-login-card-content"]]],["p-eb35a668",[[1,"c-login-card-title"]]],["p-2f00d8c8",[[1,"c-modal",{"value":[4],"dismissable":[4],"width":[8],"zIndex":[2,"z-index"],"innerValue":[32],"animateModal":[32]},null,{"value":["onValueChange"]}]]],["p-2c9aabef",[[1,"c-option",{"selected":[4],"disabled":[4],"name":[1],"value":[8]}]]],["p-c343dd6e",[[1,"c-option-value"]]],["p-c0fd6d82",[[1,"c-page"]]],["p-732bc932",[[1,"c-progress-bar",{"value":[2],"hideDetails":[4,"hide-details"],"singleLine":[4,"single-line"],"label":[1],"indeterminate":[4]}]]],["p-c7a07889",[[1,"c-radio",{"checked":[4],"disabled":[4],"value":[1]}]]],["p-cd047753",[[1,"c-side-navigation-title"]]],["p-843b5cdb",[[1,"c-status",{"type":[1]}]]],["p-738a7d1d",[[1,"c-step",{"complete":[4],"current":[4]}]]],["p-c48a6e1d",[[1,"c-steps",{"value":[8],"isMobile":[32],"label":[32]},null,{"value":["watchPropHandler"]}]]],["p-889d3d6d",[[65,"c-switch",{"checked":[1028],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostDisabled":[4,"disabled"],"hostId":[1,"id"],"required":[4],"hasLabel":[32]}]]],["p-58aed6cc",[[1,"c-tab-buttons",{"value":[1032],"mandatory":[4],"tabs":[4],"size":[1],"hostDisabled":[4,"disabled"]},[[1,"tabFocus","tabFocusHandler"],[2,"keyup","handleKeyUp"],[1,"tabChange","onTabChange"]],{"value":["onValueChange"]}]]],["p-f29b9485",[[1,"c-tab-item",{"value":[8],"active":[4]}]]],["p-d60032ce",[[1,"c-tab-items",{"value":[8],"disableAnimation":[4,"disable-animation"],"activeTab":[32]},[[1,"contentChange","tabContentChangeHandler"]],{"value":["onValueChange"]}]]],["p-f4d93d05",[[4,"c-table",{"mobileBreakpoint":[2,"mobile-breakpoint"],"responsive":[4]}]]],["p-210da773",[[1,"c-tags"]]],["p-6a1e5ae3",[[1,"c-toast",{"message":[16],"closeToast":[64]}]]],["p-02b57cbd",[[1,"c-card-actions",{"align":[1],"justify":[1]}]]],["p-073e6b7a",[[1,"c-card",{"fullscreen":[4],"isFullscreen":[32],"exitFullscreen":[64],"enterFullscreen":[64]}],[1,"c-button",{"inverted":[4],"outlined":[4],"ghost":[4],"danger":[4],"grouped":[4],"text":[4],"loading":[4],"fit":[4],"noRadius":[4,"no-radius"],"type":[1],"disabled":[516],"value":[8],"hostId":[1,"id"],"size":[1],"href":[1],"target":[1],"tabs":[4]},[[1,"focus","onTabFocus"]]],[1,"c-csc-logo",{"width":[2]}],[1,"c-main"],[1,"c-row",{"gap":[2],"nowrap":[4],"align":[1],"justify":[1]}],[1,"c-toolbar"],[1,"c-spacer"],[1,"c-icon-button",{"badge":[1],"danger":[4],"loading":[4],"text":[4],"inverted":[4],"outlined":[4],"path":[1],"ghost":[4],"disabled":[4],"size":[1]}],[1,"c-badge"],[1,"c-spinner",{"color":[1],"size":[2],"width":[2]}],[1,"c-ripple",{"createRipple":[64]}],[1,"c-icon",{"path":[1],"size":[2],"color":[1]}]]],["p-79b90c60",[[1,"c-pagination",{"value":[16],"hideDetails":[4,"hide-details"],"simple":[4],"size":[1],"hideRange":[4,"hide-range"],"itemsPerPageOptions":[16],"_currentPage":[32],"_itemsPerPage":[32],"_totalVisible":[32],"tick":[32]},null,{"value":["valueHandler"]}],[65,"c-checkbox",{"checked":[1028],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"indeterminate":[4],"label":[1],"required":[4],"valid":[4],"validation":[1],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostName":[1,"name"],"messageOptions":[32]},[[1,"keydown","handleKeyDown"]],{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-cfc34289",[[1,"c-loader",{"contentdelay":[2],"hide":[4],"size":[2],"width":[2]},null,{"hide":["onElementHide"]}]]],["p-dd6d422d",[[1,"c-menu",{"items":[16],"contentClass":[1,"content-class"],"custom":[4],"small":[4],"flat":[4],"itemsPerPage":[2,"items-per-page"],"menuItemsComponent":[32],"menuWrapperComponent":[32],"currentIndex":[32],"active":[32]},[[2,"keydown","handleKeyDown"]]],[1,"c-menu-items",{"items":[16],"small":[4],"active":[4],"parentType":[1,"parent-type"],"parent":[16],"top":[2],"index":[2],"itemsPerPage":[2,"items-per-page"],"scrollingParent":[32],"isInView":[32],"currentIndex":[32]},[[2,"keydown","handleKeyDown"]],{"currentIndex":["onIndexChange"]}]]],["p-9361fc3d",[[4,"c-input",{"autofocus":[4],"disabled":[4],"form":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"inputId":[1,"input-id"],"itemsPerPage":[2,"items-per-page"],"label":[1],"max":[2],"min":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[8],"variant":[1],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"statusText":[32],"currentIndex":[32],"focusDropdown":[64],"focusItem":[64],"createDropdown":[64],"openDropdown":[64],"closeDropdown":[64],"updateDropdown":[64]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"value":["onValueChange"],"placeholder":["onPlaceholderChange"]}],[1,"c-dropdowns",{"createDropdown":[64]}],[1,"c-dropdown",{"items":[16],"options":[16],"itemsPerPage":[2,"items-per-page"],"parent":[16],"wrapper":[16],"index":[2],"isOpen":[4,"is-open"],"focusList":[4,"focus-list"],"inputId":[1,"input-id"],"type":[1],"wasClicked":[4,"was-clicked"],"currentIndex":[32],"isVisible":[32],"topPosition":[32],"bottomTranslate":[32],"scrollingParent":[32],"statusText":[32],"updateDropdown":[64],"focusDropdown":[64],"focusItem":[64]},null,{"isOpen":["onOpenStateChange"],"currentIndex":["onCurrentIndexChange"]}],[1,"c-message",{"hint":[1],"inputId":[1,"input-id"],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"hint":["onHintMessageChange"]}]]]]'),e)));
1
+ import{p as e,b as a}from"./p-9d54e9a4.js";export{s as setNonce}from"./p-9d54e9a4.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a(JSON.parse('[["p-37c19431",[[1,"c-data-table",{"data":[16],"externalData":[4,"external-data"],"headers":[16],"hideFooter":[4,"hide-footer"],"footerOptions":[16],"loading":[4],"loadingText":[1,"loading-text"],"noDataText":[1,"no-data-text"],"pagination":[1040],"selectable":[4],"singleSelection":[4,"single-selection"],"selectionProperty":[1,"selection-property"],"singleExpansion":[4,"single-expansion"],"sortBy":[1032,"sort-by"],"sortDirection":[1025,"sort-direction"],"stickyHeader":[4,"sticky-header"],"horizontalScrolling":[4,"horizontal-scrolling"],"_activeRows":[32],"_data":[32],"_isIndeterminate":[32],"_isPaginationSimple":[32],"_selections":[32],"hasOverflow":[32],"hiddenHeaders":[32],"initiallyHiddenHeaders":[32],"forceRender":[32],"breakpoints":[32],"markedFooterWidth":[32],"parentWidth":[32],"firstCellHidden":[32],"lastCellHidden":[32],"clearSelections":[64],"getData":[64]},null,{"hiddenHeaders":["onHiddenHeaderChange"],"data":["onDataChange"],"headers":["onHeaderChange"],"singleSelection":["onSingleSelectionChange"],"loading":["onLoadingChange"]}]]],["p-ae28ae3f",[[65,"c-autocomplete",{"autofocus":[4],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"shadow":[4],"name":[1],"label":[1],"query":[1025],"value":[1032],"dense":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"placeholder":[1],"returnValue":[4,"return-value"],"items":[16],"itemsPerPage":[2,"items-per-page"],"optionAsSelection":[4,"option-as-selection"],"menuVisible":[32],"currentIndex":[32],"hasOptionItems":[32],"options":[32],"setValue":[64],"onHideMenu":[64],"setActiveDescendant":[64],"updateQuery":[64],"onItemSelection":[64]},[[1,"keydown","handleKeyDown"]],{"items":["watchHandler"],"value":["onValueChange"]}]]],["p-0f76461d",[[1,"c-navigation-button"]]],["p-d94b9e92",[[65,"c-select",{"autofocus":[4],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"label":[1],"shadow":[4],"name":[1],"required":[4],"returnValue":[4,"return-value"],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"itemsPerPage":[2,"items-per-page"],"placeholder":[1],"value":[1032],"items":[16],"optionAsSelection":[4,"option-as-selection"],"menuVisible":[32],"currentIndex":[32],"activeListItemId":[32],"statusText":[32],"hasOptionItems":[32],"previousValue":[32],"onItemSelection":[64],"onHideMenu":[64],"setActiveDescendant":[64]},[[2,"keydown","handleKeyDown"]],{"value":["onValueChange"],"validate":["validateChange"],"currentIndex":["onCurrentIndexChange"]}]]],["p-57b4991f",[[1,"c-side-navigation",{"mobile":[4],"menuVisible":[1028,"menu-visible"]},[[0,"itemChange","handleChange"]]]]],["p-15fea966",[[1,"c-tabs",{"value":[1032],"borderless":[4],"disableAnimation":[4,"disable-animation"],"justify":[1],"mobileBreakpoint":[2,"mobile-breakpoint"],"vertical":[4],"isOverflowing":[32],"isMobile":[32],"scrollOffset":[32]},[[1,"tabFocus","tabFocusHandler"],[1,"tabChange","tabChangeHandler"],[2,"keydown","handleKeyDown"],[2,"keyup","handleKeyUp"]],{"justify":["onJustificationChange"],"value":["onExternalValueChange"],"scrollOffset":["onScrollOffsetChange"]}]]],["p-c5deb643",[[1,"c-tag",{"active":[4],"block":[4],"fit":[4],"flat":[4],"closeable":[4],"badge":[8]}]]],["p-f0329312",[[65,"c-text-field",{"autofocus":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"trimWhitespace":[4,"trim-whitespace"],"label":[1],"max":[2],"min":[2],"name":[1],"number":[4],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[1025],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"messageOptions":[32]}]]],["p-8b7e9097",[[4,"c-swiper",{"value":[1544],"elementId":[1,"id"],"isBeginning":[32],"isEnd":[32],"statusText":[32]},[[0,"changeValue","onTabClick"],[2,"keyup","handleKeyUp"]]]]],["p-62e4ebd9",[[1,"c-side-navigation-item",{"active":[4],"href":[1],"target":[1],"loading":[4]},[[0,"itemChange","handleChange"]],{"active":["onActiveChange"]}]]],["p-6ec9109d",[[1,"c-sub-navigation-item",{"active":[4],"focusable":[4],"href":[1],"target":[1],"loading":[4]}]]],["p-14ed80ac",[[1,"c-toasts",{"absolute":[4],"horizontal":[1],"vertical":[1],"messages":[32],"addToast":[64],"removeToast":[64]}]]],["p-9f2311a7",[[1,"c-accordion-item",{"collapsable":[4],"heading":[1],"value":[8],"expanded":[4],"outlined":[4]},[[2,"keydown","handleKeyDown"],[0,"changeValue","stop"]]]]],["p-192145f2",[[1,"c-list-item",{"active":[4],"disabled":[4],"disabledByParent":[4,"disabled-by-parent"],"hoverable":[4],"ripple":[4],"href":[1],"target":[1]},null,{"active":["onActiveChange"]}]]],["p-e970fa68",[[1,"c-login-card-actions",{"align":[1],"justify":[1]}]]],["p-ef6162d9",[[65,"c-otp-input",{"hideDetails":[4,"hide-details"],"hint":[1],"elementId":[1,"id"],"length":[2],"valid":[4],"validation":[1],"statusText":[32]},null,{"validation":["onValidationMessageChange"]}]]],["p-05bb5c30",[[65,"c-radio-group",{"value":[1032],"hideDetails":[4,"hide-details"],"hint":[1],"inline":[4],"label":[1],"color":[1],"items":[16],"disabled":[4],"returnValue":[4,"return-value"],"required":[4],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-e0c3d13b",[[1,"c-swiper-tab",{"disabled":[4],"active":[4],"label":[1],"hostId":[1,"id"],"setsize":[2],"position":[2],"value":[8]},[[1,"click","onTabClick"]]]]],["p-dea9da0e",[[1,"c-tab",{"active":[4],"disabled":[4],"hostId":[1,"id"],"position":[2],"setsize":[2],"value":[8]},[[1,"focus","onTabFocus"],[1,"keydown","handleKeydown"]]]]],["p-79308b3f",[[1,"c-accordion",{"value":[1032],"mandatory":[4],"multiple":[4],"outlined":[4]},[[1,"itemChange","onAccordionItemChange"]],{"value":["watchPropHandler"]}]]],["p-f4a9cb4d",[[1,"c-alert",{"type":[1]}]]],["p-cea20d08",[[1,"c-card-content"]]],["p-28282ef5",[[1,"c-card-title"]]],["p-b09ba433",[[1,"c-link",{"href":[1],"underline":[4],"target":[1],"weight":[1]}]]],["p-4c23471f",[[0,"c-list",{"disabled":[4]},null,{"disabled":["onDisabledChange"]}]]],["p-6f86810a",[[1,"c-list-item-title",{"active":[4]}]]],["p-a8da163c",[[1,"c-login-button",{"href":[1],"src":[1],"alt":[1]}]]],["p-a8073d7e",[[1,"c-login-buttons"]]],["p-01ed27ec",[[4,"c-login-card",{"backgroundPosition":[1,"background-position"],"mobileBreakpoint":[2,"mobile-breakpoint"],"overlay":[4],"overlayBlendMode":[1,"overlay-blend-mode"],"src":[1],"path":[32],"imageHeight":[32]}]]],["p-55ca2b16",[[1,"c-login-card-content"]]],["p-eb35a668",[[1,"c-login-card-title"]]],["p-2f00d8c8",[[1,"c-modal",{"value":[4],"dismissable":[4],"width":[8],"zIndex":[2,"z-index"],"innerValue":[32],"animateModal":[32]},null,{"value":["onValueChange"]}]]],["p-2c9aabef",[[1,"c-option",{"selected":[4],"disabled":[4],"name":[1],"value":[8]}]]],["p-c343dd6e",[[1,"c-option-value"]]],["p-c0fd6d82",[[1,"c-page"]]],["p-732bc932",[[1,"c-progress-bar",{"value":[2],"hideDetails":[4,"hide-details"],"singleLine":[4,"single-line"],"label":[1],"indeterminate":[4]}]]],["p-c7a07889",[[1,"c-radio",{"checked":[4],"disabled":[4],"value":[1]}]]],["p-cd047753",[[1,"c-side-navigation-title"]]],["p-843b5cdb",[[1,"c-status",{"type":[1]}]]],["p-738a7d1d",[[1,"c-step",{"complete":[4],"current":[4]}]]],["p-c48a6e1d",[[1,"c-steps",{"value":[8],"isMobile":[32],"label":[32]},null,{"value":["watchPropHandler"]}]]],["p-889d3d6d",[[65,"c-switch",{"checked":[1028],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostDisabled":[4,"disabled"],"hostId":[1,"id"],"required":[4],"hasLabel":[32]}]]],["p-58aed6cc",[[1,"c-tab-buttons",{"value":[1032],"mandatory":[4],"tabs":[4],"size":[1],"hostDisabled":[4,"disabled"]},[[1,"tabFocus","tabFocusHandler"],[2,"keyup","handleKeyUp"],[1,"tabChange","onTabChange"]],{"value":["onValueChange"]}]]],["p-f29b9485",[[1,"c-tab-item",{"value":[8],"active":[4]}]]],["p-d60032ce",[[1,"c-tab-items",{"value":[8],"disableAnimation":[4,"disable-animation"],"activeTab":[32]},[[1,"contentChange","tabContentChangeHandler"]],{"value":["onValueChange"]}]]],["p-f4d93d05",[[4,"c-table",{"mobileBreakpoint":[2,"mobile-breakpoint"],"responsive":[4]}]]],["p-210da773",[[1,"c-tags"]]],["p-6a1e5ae3",[[1,"c-toast",{"message":[16],"closeToast":[64]}]]],["p-02b57cbd",[[1,"c-card-actions",{"align":[1],"justify":[1]}]]],["p-073e6b7a",[[1,"c-card",{"fullscreen":[4],"isFullscreen":[32],"exitFullscreen":[64],"enterFullscreen":[64]}],[1,"c-button",{"inverted":[4],"outlined":[4],"ghost":[4],"danger":[4],"grouped":[4],"text":[4],"loading":[4],"fit":[4],"noRadius":[4,"no-radius"],"type":[1],"disabled":[516],"value":[8],"hostId":[1,"id"],"size":[1],"href":[1],"target":[1],"tabs":[4]},[[1,"focus","onTabFocus"]]],[1,"c-csc-logo",{"width":[2]}],[1,"c-main"],[1,"c-row",{"gap":[2],"nowrap":[4],"align":[1],"justify":[1]}],[1,"c-toolbar"],[1,"c-spacer"],[1,"c-icon-button",{"badge":[1],"danger":[4],"loading":[4],"text":[4],"inverted":[4],"outlined":[4],"path":[1],"ghost":[4],"disabled":[4],"size":[1]}],[1,"c-badge"],[1,"c-spinner",{"color":[1],"size":[2],"width":[2]}],[1,"c-ripple",{"createRipple":[64]}],[1,"c-icon",{"path":[1],"size":[2],"color":[1]}]]],["p-79b90c60",[[1,"c-pagination",{"value":[16],"hideDetails":[4,"hide-details"],"simple":[4],"size":[1],"hideRange":[4,"hide-range"],"itemsPerPageOptions":[16],"_currentPage":[32],"_itemsPerPage":[32],"_totalVisible":[32],"tick":[32]},null,{"value":["valueHandler"]}],[65,"c-checkbox",{"checked":[1028],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"indeterminate":[4],"label":[1],"required":[4],"valid":[4],"validation":[1],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostName":[1,"name"],"messageOptions":[32]},[[1,"keydown","handleKeyDown"]],{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-cfc34289",[[1,"c-loader",{"contentdelay":[2],"hide":[4],"size":[2],"width":[2]},null,{"hide":["onElementHide"]}]]],["p-dd6d422d",[[1,"c-menu",{"items":[16],"contentClass":[1,"content-class"],"custom":[4],"small":[4],"flat":[4],"itemsPerPage":[2,"items-per-page"],"menuItemsComponent":[32],"menuWrapperComponent":[32],"currentIndex":[32],"active":[32]},[[2,"keydown","handleKeyDown"]]],[1,"c-menu-items",{"items":[16],"small":[4],"active":[4],"parentType":[1,"parent-type"],"parent":[16],"top":[2],"index":[2],"itemsPerPage":[2,"items-per-page"],"scrollingParent":[32],"isInView":[32],"currentIndex":[32]},[[2,"keydown","handleKeyDown"]],{"currentIndex":["onIndexChange"]}]]],["p-0a423333",[[4,"c-input",{"autofocus":[4],"disabled":[4],"form":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"inputId":[1,"input-id"],"itemsPerPage":[2,"items-per-page"],"label":[1],"max":[2],"min":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[8],"variant":[1],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"statusText":[32],"currentIndex":[32],"focusDropdown":[64],"focusItem":[64],"createDropdown":[64],"openDropdown":[64],"closeDropdown":[64],"updateDropdown":[64]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"value":["onValueChange"],"placeholder":["onPlaceholderChange"]}],[1,"c-dropdowns",{"createDropdown":[64]}],[1,"c-dropdown",{"items":[16],"options":[16],"itemsPerPage":[2,"items-per-page"],"parent":[16],"wrapper":[16],"index":[2],"isOpen":[4,"is-open"],"focusList":[4,"focus-list"],"inputId":[1,"input-id"],"type":[1],"wasClicked":[4,"was-clicked"],"currentIndex":[32],"isVisible":[32],"topPosition":[32],"bottomTranslate":[32],"statusText":[32],"updateDropdown":[64],"focusDropdown":[64],"focusItem":[64]},null,{"isOpen":["onOpenStateChange"],"currentIndex":["onCurrentIndexChange"]}],[1,"c-message",{"hint":[1],"inputId":[1,"input-id"],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"hint":["onHintMessageChange"]}]]]]'),e)));
2
2
  //# sourceMappingURL=csc-ui.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","JSON","parse"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.6.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,o5XAAuCH"}
1
+ {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","JSON","parse"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.6.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,63XAAuCH"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 06 Nov 2023 12:18:41 GMT
3
+ * Generated on Tue, 07 Nov 2023 08:40:59 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Mon, 06 Nov 2023 12:18:41 GMT
3
+ // Generated on Tue, 07 Nov 2023 08:40:58 GMT
4
4
 
5
5
  $c-font-family: 'museo-sans', sans-serif;
6
6
  $c-text-body: var(--c-primary-900);
@@ -0,0 +1,2 @@
1
+ import{r as t,h as i,H as e,g as s,c as n}from"./p-9d54e9a4.js";import{c as o,d as r}from"./p-dffa1f9f.js";const a="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-dropdown-background-color:var(--c-dropdown-background-color, var(--c-white));--_c-dropdown-background-color-hover:var(--c-dropdown-background-color-hover, var(--c-primary-200));--_c-dropdown-text-color:var(--c-dropdown-text-color, var(--c-text-body));--_c-dropdown-text-color-active:var(--c-dropdown-text-color-active, var(--c-primary-600));--_c-dropdown-font-size:14px;--_c-dropdown-height:42px;display:block;position:absolute}:host mark{background-color:transparent;box-shadow:0 2px 0 0 var(--_c-dropdown-text-color-active);color:inherit}:host dialog{background-color:transparent;border-radius:4px;border:none;box-shadow:2px 4px 10px rgba(0, 0, 0, 0.1607843137);margin:0;overflow:hidden;padding:0;position:fixed}:host dialog::backdrop{display:none}:host ul{background-color:var(--_c-dropdown-background-color);border-radius:4px;height:100%;list-style:none;margin:0;outline:none;overflow-y:scroll;padding:0;pointer-events:auto;visibility:hidden;width:100%}:host ul.active{visibility:visible;animation:0.2s 1 fade-in cubic-bezier(0.25, 0.8, 0.5, 1)}:host li{align-items:center;background:var(--c-white);column-gap:12px;cursor:pointer;display:flex;flex-wrap:nowrap;font-size:var(--_c-dropdown-font-size);min-height:var(--_c-dropdown-height);outline:none;padding-left:10px;padding-right:10px;pointer-events:auto;white-space:nowrap;width:100%}:host li span,:host li c-option-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}:host li:not(.disabled):hover,:host li.active{background:var(--_c-dropdown-background-color-hover);color:var(--_c-dropdown-text-color-active)}:host li.disabled{background-color:rgba(var(--c-tertiary-rgb), 0.05);cursor:default;filter:grayscale(1) opacity(0.75)}:host .visuallyhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}@keyframes fade-in{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}";const h=class{constructor(i){t(this,i);this._id="";this._debounce=null;this._itemRefs=[];this._lastKeyPressTime=null;this._openedOnTop=false;this._searchString="";this._observer=new IntersectionObserver(((t,i)=>{t.forEach((t=>{if(!t.isIntersecting){t.target.scrollIntoView({block:"nearest",inline:"nearest"});i.unobserve(t.target)}else{i.unobserve(t.target)}}))}),{threshold:1});this._renderMenuItem=(t,i)=>{var e;const s=((e=this.items[this.currentIndex])===null||e===void 0?void 0:e.value)===t.value;let n="none";if(typeof(t===null||t===void 0?void 0:t.value)==="string"){n=t.value.replace(/[^a-zA-Z0-9-_]/g,"")}n=`item_${this.inputId}--${n}`;if(s){this.currentIndex=i;this.parent.setActiveDescendant(n)}const o=document.createElement("li");o.role="option";o.ariaPosInSet=(i+1).toString();o.ariaSetSize=this.items.length.toString();o.ariaSelected=s.toString();o.id=n;o.dataset.value=t.name;o.setAttribute("tabindex","-1");o.classList.toggle("disabled",!!t.disabled);o.addEventListener("click",(t=>{const e=this._itemRefs[i].classList.contains("disabled");if(e){t.preventDefault();return}this.currentIndex=i;this._onSelect(i)}));o.addEventListener("focus",(()=>{o.classList.add("active")}));o.addEventListener("blur",(()=>{o.classList.remove("active")}));this._itemRefs.push(o);if(Object.keys(this.options).length){requestAnimationFrame((()=>{var i;const e=this.options[t.value];if(!e)return;if(((i=this.parent.query)===null||i===void 0?void 0:i.length)&&this.type==="autocomplete"){const t=e.querySelector("c-option-value");if(t){t.innerHTML=this._highlightMatchingText(t.textContent)}}o.appendChild(e);this._listElement.appendChild(o)}));return}const r=document.createElement("span");r.innerHTML=this._highlightMatchingText(t.name);o.appendChild(r);this._listElement.appendChild(o)};this.items=[];this.options=undefined;this.itemsPerPage=undefined;this.parent=undefined;this.wrapper=undefined;this.index=undefined;this.isOpen=false;this.focusList=undefined;this.inputId=undefined;this.type=undefined;this.wasClicked=false;this.currentIndex=null;this.isVisible=false;this.topPosition=undefined;this.bottomTranslate=undefined;this.statusText=""}async updateDropdown(t){this.items=[];this._itemRefs=[];this.options={};requestAnimationFrame((()=>{this.currentIndex=null;this.items=t.items||this.items;this.options=t.options||this.options;this._updateMenuItems();this._updateStatusText()}))}async focusDropdown(){requestAnimationFrame((()=>{this._listElement.focus()}))}async focusItem(t){requestAnimationFrame((()=>{const i=t==="first"?0:this.items.length-1;this.currentIndex=i;this._itemRefs[i].focus()}))}onOpenStateChange(t){if(t){this._onOpen();this._createEventListeners();requestAnimationFrame((()=>{if(this.focusList){this._listElement.focus();if(this.type==="autocomplete"){this.currentIndex=0}this._handleCurrentIndexChange()}this._positionMenu()}));return}this._openedOnTop=false;this._onClose()}onCurrentIndexChange(){this._handleCurrentIndexChange()}get _listSize(){return this.items.length||0}get _firstSelectableIndex(){return this.items.findIndex((t=>!t.disabled))}get _lastSelectableIndex(){return this.items.findLastIndex((t=>!t.disabled))}_highlightMatchingText(t){if(this.type==="select")return t;const i=new RegExp(this.parent.query,"gi");return t.replace(i,(t=>`<mark>${t}</mark>`))}_renderEmptyItem(){const t=document.createElement("li");t.tabIndex=-1;const i=document.createElement("c-icon");i.path=o;i.size=18;i.color="var(--c-warning-600)";t.appendChild(i);t.append("No suggestions found");this._listElement.replaceChildren(t)}_updateMenuItems(){if(!this.items.length){this._renderEmptyItem();return}requestAnimationFrame((()=>{this._listElement.replaceChildren();this._itemRefs.length=0;this.items.map(((t,i)=>this._renderMenuItem(t,i)))}))}_renderMenu(){this._id=`${this.inputId}--items`;const t=document.createElement("dialog");const i=document.createElement("ul");i.role=`listbox`;i.ariaExpanded=this.isVisible.toString();i.tabIndex=-1;i.id=this._id;this._dialogElement=t;this._listElement=i;this._dialogElement.appendChild(i);this.host.shadowRoot.appendChild(t);this.items.map(((t,i)=>this._renderMenuItem(t,i)));this._listElement.addEventListener("keydown",this._onKeyboardNavigation.bind(this));this._listElement.addEventListener("keyup",this._onKeyDown.bind(this))}_onOpen(){this.parent.shadowRoot.querySelector(".c-input").classList.add("active");this._listElement.classList.add("active");this._listElement.ariaExpanded="true";this._listElement.tabIndex=0;this._dialogElement.showModal()}_onClose(t=false){this.parent.onHideMenu();this.parent.shadowRoot.querySelector(".c-input").classList.remove("active");this._listElement.classList.remove("active");this._listElement.ariaExpanded="false";this._listElement.tabIndex=-1;this.isOpen=false;this.currentIndex=this.index;this._dialogElement.close();if(t){this.parent.shadowRoot.querySelector("input").focus()}}_onSelect(t,i=false){const e=this._itemRefs[t].classList.contains("disabled");if(e)return;this.parent.onItemSelection(t);this.index=t;this._onClose(i);this._itemRefs.forEach(((i,e)=>{i.ariaSelected=(e===t).toString()}))}_getParentPosition(){return this.parent.shadowRoot.querySelector(".c-input__slot").getBoundingClientRect()}_positionMenu(){const{innerWidth:t,innerHeight:i}=window;const{bottom:e,left:s,width:n,height:o,top:r}=this._getParentPosition();this.bottomTranslate=0;this._dialogElement.style.width=`${n}px`;this._dialogElement.style.top=`${e}px`;this._dialogElement.style.left=`${s}px`;this._dialogElement.style.removeProperty("transform");const{bottom:a,right:h,height:l,width:c}=this._dialogElement.getBoundingClientRect();const d={x:h<t,y:a<i};const u=r-l>0;if(!u&&!d.y){this._dialogElement.style.height=`${r}px`}if(!d.y||this._openedOnTop){this._openedOnTop=true;this.bottomTranslate=l+o;this._dialogElement.style.setProperty("transform",`translateY(-${this.bottomTranslate}px`)}this.topPosition=e;if(!d.x){this._dialogElement.style.left=`${parseFloat(this._dialogElement.style.left)-c+n}px`}}_createEventListeners(){requestAnimationFrame((async()=>{this._listElement.classList.add("active")}))}_scrollToElement(){if(this.items.length>this.itemsPerPage){const t=this._itemRefs[this.currentIndex];if(!!t){this._observer.observe(t)}}}_onKeyDown(t){t.preventDefault();t.stopPropagation()}_onKeyboardNavigation(t){this.wasClicked=false;const i=/^[0-9a-zA-Z]+$/;if(t.key.match(i)&&t.key.length===1||t.key==="Backspace"){if(this.type==="autocomplete"){this.parent.shadowRoot.querySelector("input").focus();const{query:i}=this.parent;let e="";if(t.key==="Backspace"){e=i.slice(0,-1)}else{e=`${i}${t.key}`}this.parent.updateQuery(e);return}if(Date.now()-this._lastKeyPressTime>3e3||this._searchString.length>2){this._searchString=t.key}else{this._searchString=`${this._searchString}${t.key}`}this._lastKeyPressTime=Date.now();const i=this.items.find((t=>t.name.toLowerCase().startsWith(this._searchString)));if(i){this.currentIndex=this.items.findIndex((t=>t===i));if(this.isOpen){this._scrollToElement()}else{this._onSelect(this.currentIndex,true)}}}if(t.key==="Enter"){this._onSelect(this.currentIndex,true)}if(t.key===" "&&!this.isOpen){t.preventDefault();this.isOpen=true}if("Tab"===t.key){this._onClose()}if(t.key==="Escape"){this._onClose(true)}if(t.key==="ArrowDown"){t.preventDefault();t.stopPropagation();if(this.currentIndex===null){this.currentIndex=0}else if(this.isOpen&&this.currentIndex+1<this._listSize){this.currentIndex+=1}this.isOpen=true}if(t.key==="ArrowUp"){t.preventDefault();t.stopPropagation();if(this.isOpen&&this.currentIndex===0){this.currentIndex=null;this._onClose(true);return}else if(this.isOpen&&this.currentIndex>0){this.currentIndex-=1}else if(this.currentIndex===null){this.currentIndex=this._listSize-1}this.isOpen=true}if(t.key==="Home"&&this.isOpen){t.preventDefault();this.currentIndex=this._firstSelectableIndex}if(t.key==="End"&&this.isOpen){t.preventDefault();this.currentIndex=this._lastSelectableIndex}}_handleCurrentIndexChange(){var t;if(this.currentIndex===null){(t=this.parent)===null||t===void 0?void 0:t.setActiveDescendant("");return}this._updateStatusText();requestAnimationFrame((()=>{var t,i;const e=this._itemRefs[this.currentIndex];if(!e)return;e===null||e===void 0?void 0:e.focus();(t=this.parent)===null||t===void 0?void 0:t.setActiveDescendant((i=e.id)!==null&&i!==void 0?i:null)}))}_updateStatusText(){if(this._debounce!==null){clearTimeout(this._debounce);this._debounce=null}this._debounce=window.setTimeout((()=>{var t;const i=this._itemRefs[this.currentIndex];const e=!!this.items.length?", to navigate use up and down arrows":"";const s=!!((t=i===null||i===void 0?void 0:i.classList)===null||t===void 0?void 0:t.contains("disabled"));const n=s?"Disabled option - ":"";let o=!!i?`${n}${i.dataset.value} - ${i.ariaPosInSet} of ${i.ariaSetSize} is highlighted`:null;if(this.currentIndex===null&&this.type==="autocomplete"){o=this.items.length?`${this.items.length} result${this.items.length!==1?"s":""} available`:"No search results available"}this.statusText=`${o||e}`;this._debounce=null}),1400)}componentWillLoad(){this._renderMenu()}componentDidLoad(){this.currentIndex=this.index;this._resizeObserver=new ResizeObserver((()=>{if(!this.isOpen)return;this._positionMenu()}));this._resizeObserver.observe(this._dialogElement)}disconnectedCallback(){this._resizeObserver.disconnect()}render(){if(this.itemsPerPage&&this.itemsPerPage>0&&this.items.length>this.itemsPerPage){this._dialogElement.style.height=42*(this.itemsPerPage+.5)+"px"}return i(e,null,i("div",{id:"announce-"+this._id,class:"visuallyhidden","aria-live":"polite","aria-atomic":"true"},this.statusText))}get host(){return s(this)}static get watchers(){return{isOpen:["onOpenStateChange"],currentIndex:["onCurrentIndexChange"]}}};h.style=a;const l="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{display:block;inset:0;pointer-events:none;position:fixed}";const c=class{constructor(i){t(this,i)}async createDropdown(t){const i=document.createElement("c-dropdown");i.items=t.items;i.itemsPerPage=t.itemsPerPage||6;i.options=t.options;i.parent=t.parent;i.wrapper=t.wrapper;i.inputId=t.id;i.index=t.index;i.type=t.type;this.host.shadowRoot.appendChild(i);return i}render(){return i(e,null)}get host(){return s(this)}};c.style=l;const d="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:root,:host{--_c-input-inactive-color:var(--c-tertiary-600);--_c-input-active-color:var(--c-primary-600);--_c-input-background-color:var(--c-transparent);--_c-input-text-color:var(--c-text-body);--_c-input-placeholder-color:var(--c-tertiary-500);--_c-input-shadow-active-color:var(--_c-input-active-color);--_c-input-shadow-background-color:var(--c-white);--_c-input-shadow-text-color:var(--_c-input-text-color);--_c-input-shadow-placeholder-color:var(--_c-input-placeholder-color);--_c-input-error-color:var(--c-error-600)}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.c-input{--_c-input-border-width:1px;align-items:flex-start;border-radius:4px;display:flex;flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;letter-spacing:normal;max-width:100%;text-align:left}.c-input input,.c-input select,.c-input textarea{background:none;border:0;display:inline-block;font-family:var(--c-font-family);font-size:16px;line-height:1;margin:0;padding:0;vertical-align:middle;white-space:normal}.c-input input,.c-input textarea{box-sizing:content-box;background-color:transparent;border:none;color:var(--_c-input-text-color);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%}.c-input input[type=checkbox],.c-input input[type=radio],.c-input select{box-sizing:border-box}.c-input input[type=search]{appearance:textfield;box-sizing:content-box}.c-input ::-webkit-search-decoration{display:none}.c-input textarea{margin-top:4px;min-height:44px;overflow:auto;padding:8px 12px 8px 0;resize:vertical;vertical-align:top}.c-input input{max-height:32px;padding:8px 0}.c-input input:focus,.c-input input:active,.c-input textarea:focus,.c-input textarea:active{outline:none}.c-input .c-input__content{align-items:center;display:flex;width:100%}.c-input__control{border-radius:inherit;color:currentColor;display:flex;flex-flow:column wrap;flex-grow:1;gap:8px;height:auto;min-width:0;width:100%}.c-input__slot{align-items:stretch;background:transparent;border-radius:inherit;color:inherit;cursor:text;display:flex;min-height:44px;padding:0 12px;position:relative;transition:0.3s cubic-bezier(0.25, 0.8, 0.5, 1);width:100%}.c-input__field{align-items:center;display:flex;flex:1 1 auto;gap:8px;position:relative}.c-input__field input,.c-input__field textarea{flex:1;outline:0}.c-input__field label{font-size:16px;height:20px;left:0;letter-spacing:normal;line-height:20px;max-width:90%;min-height:8px;overflow:hidden;pointer-events:none;position:absolute;right:auto;text-overflow:ellipsis;top:12px;transform-origin:top left;transform:translateX(var(--_c-input-label-position)) translateY(0) scale(1);transition:0.3s cubic-bezier(0.25, 0.8, 0.5, 1);white-space:nowrap}.c-input__field label.active{transform:translateY(-18px) scale(0.75)}.c-input__field label span{color:var(--_c-input-error-color)}.c-input--select input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-input--select .c-input__slot{cursor:pointer}.c-input fieldset{background-color:var(--_c-input-background-color);border-collapse:collapse;border-color:var(--_c-input-inactive-color);border-radius:inherit;border-style:solid;border-width:var(--_c-input-border-width);inset:0;margin:0;padding:0 0 0 8px;pointer-events:none;position:absolute;transition-duration:0.15s;transition-property:color;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1)}.c-input fieldset legend{float:none;line-height:11px;margin-left:-1px;padding:0;text-align:left;transition:width 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);width:0}.c-input fieldset legend.active{width:var(--_c-input-legend-width)}.c-input--shadow .c-input__slot{background-color:var(--_c-input-shadow-background-color);box-shadow:rgba(0, 0, 0, 0.15) 0 5px 15px 0}.c-input--shadow .c-input__slot input,.c-input--shadow .c-input__slot textarea{color:var(--_c-input-shadow-text-color)}.c-input--shadow .c-input__slot:focus-within{outline:2px var(--_c-input-active-color) solid}.c-input--shadow .c-input__slot:focus-within c-icon{--c-icon-color:var(--_c-input-shadow-active-color) !important}.c-input--shadow input::placeholder,.c-input--shadow textarea::placeholder{color:var(--_c-input-shadow-placeholder-color);opacity:1}.c-input--disabled input,.c-input--disabled textarea,.c-input--disabled fieldset,.c-input--disabled label{--_c-input-error-color:var(--c-tertiary-500);color:var(--c-tertiary-500)}.c-input--textarea .c-input__field{margin-right:-12px}.c-input ::placeholder{color:var(--_c-input-placeholder-color);opacity:1}.c-input:focus-within,.c-input.active,.c-input:not(.c-input--disabled):active{--_c-input-border-width:2px;color:var(--_c-input-active-color)}.c-input:focus-within fieldset,.c-input.active fieldset,.c-input:not(.c-input--disabled):active fieldset{border-color:var(--_c-input-active-color)}.c-input:focus-within label,.c-input.active label,.c-input:not(.c-input--disabled):active label{color:var(--_c-input-active-color);transform:translateX(0) translateY(-18px) scale(0.75)}.c-input:focus-within legend,.c-input.active legend,.c-input:not(.c-input--disabled):active legend{width:var(--_c-input-legend-width)}.c-input.active:not(.filled) .c-input-menu__input{position:relative}.c-input.active:not(.filled) .c-input-menu__input::after{display:flex;align-items:center;position:absolute;inset:0;content:attr(data-placeholder);pointer-events:none;color:var(--_c-input-placeholder-color)}.c-input--error{color:var(--_c-input-error-color)}.c-input--error fieldset{border-color:var(--_c-input-error-color) !important}.c-input--error label{color:var(--_c-input-error-color) !important}.c-input--error:focus-within{color:var(--_c-input-error-color)}";const u=class{constructor(i){t(this,i);this.changeValue=n(this,"changeValue",3);this.itemClick=n(this,"itemClick",3);this.dropdownClose=n(this,"dropdownClose",3);this._hasBlurred=false;this._debounce=null;this._observer=new IntersectionObserver(((t,i)=>{t.forEach((t=>{if(t.isIntersecting){this._calculateElementWidths();i.unobserve(t.target)}}))}),{threshold:1});this._onBlur=()=>{setTimeout((()=>{this.isFocused=false;this._hasBlurred=true;this._onReset()}),100)};this._onFocus=(t=true)=>{var i,e;if(this.disabled)return;this.isFocused=true;(i=this.inputField)===null||i===void 0?void 0:i.focus();if(t){(e=this.inputField)===null||e===void 0?void 0:e.click();if(this._dropdownElement){this._dropdownElement.wasClicked=true;this.itemClick.emit()}}if(this.inputField){this.inputField.placeholder=!!this.value||!this.placeholder?"":this.placeholder}};this.autofocus=false;this.disabled=false;this.form=false;this.hideDetails=false;this.hint="";this.hostId=undefined;this.inputId=undefined;this.itemsPerPage=6;this.label=undefined;this.max=null;this.min=null;this.name=undefined;this.placeholder=undefined;this.readonly=false;this.required=false;this.rows=1;this.shadow=false;this.step=null;this.type=undefined;this.valid=true;this.validate=false;this.validateOnBlur=false;this.validation="Required field";this.value=undefined;this.variant="text";this.isFocused=false;this.labelWidth=0;this.preSlotWidth=0;this.statusText="";this.currentIndex=null}onValidChange(){if(this.validateOnBlur&&!this._hasBlurred)return;this._setAriaDescriptionId()}onValidationMessageChange(){this._updateStatusText()}onValueChange(t){if(!t){this._onReset()}}onPlaceholderChange(t){if(t)this._onReset()}componentWillLoad(){if(this.variant==="select"){this._createDropdownWrapper()}}componentDidLoad(){var t,i,e,s;if(this.autofocus){setTimeout((()=>{this._onFocus(false)}),500)}this._calculateElementWidths();this._setAriaDescriptionId();if(this.label){this._observer.observe(this._labelRef)}(t=this.inputField)===null||t===void 0?void 0:t.addEventListener("focus",(()=>this._onFocus(false)));(i=this.inputField)===null||i===void 0?void 0:i.addEventListener("blur",(()=>this._onBlur()));(e=this.inputField)===null||e===void 0?void 0:e.addEventListener("keypress",this._preventNonNumericalInput);if(this.inputField){this.inputField.placeholder=!!this.label||!this.placeholder?"":this.placeholder;this.inputField.title=(s=this.label)!==null&&s!==void 0?s:this.placeholder;requestAnimationFrame((()=>{const t=this.inputField.closest(".c-input-menu__input");if(!t)return;t.dataset.placeholder=this.placeholder}))}}disconnectedCallback(){var t,i,e,s;(t=this.inputField)===null||t===void 0?void 0:t.removeEventListener("focus",(()=>this._onFocus(false)));(i=this.inputField)===null||i===void 0?void 0:i.removeEventListener("blur",(()=>this._onBlur()));(e=this.inputField)===null||e===void 0?void 0:e.removeEventListener("keypress",this._preventNonNumericalInput);this._observer.disconnect();(s=this._dropdownElement)===null||s===void 0?void 0:s.remove()}get isActive(){return!!this.value||typeof this.value==="boolean"||this.isFocused}_setAriaDescriptionId(){this.inputField.removeAttribute("aria-describedby");let t=null;if(this.valid&&!this.value&&this.hint){t="hint"}if(!this.valid){t="error"}if(t){this.inputField.setAttribute("aria-describedby",`${t}-${this.inputId}`)}}_calculateElementWidths(){this.labelWidth=!!this.label?this._labelRef.scrollWidth*.75+6:0;this.preSlotWidth=this.inputField.offsetLeft}_handleOutsideClick(t){if(!t.composedPath().includes(this._dropdownElement)){this.closeDropdown()}}async _getScrollParent(t){return new Promise((i=>{if(!t){i(undefined)}let e=t.parentNode;while(e){if(e.shadowRoot===undefined){e=e.host}else{const{overflow:t,overflowX:s}=window.getComputedStyle(e);if(s!=="scroll"&&t.split(" ").every((t=>t==="auto"||t==="scroll"))){i(e)}e=e.parentNode}}i(document.documentElement)}))}async focusDropdown(){this._dropdownElement.focusDropdown()}async focusItem(t){await this._dropdownElement.focusItem(t)}async createDropdown(t){const i=await this._getScrollParent(this.hiddenEl);this._dropdownElement=await this._dropdownsElement.createDropdown(Object.assign(Object.assign({},t),{itemsPerPage:t.itemsPerPage||6,wrapper:i}))}async openDropdown(t=true){this._dropdownElement.shadowRoot.querySelector("ul").classList.add("active");this._dropdownElement.isOpen=true;this._dropdownElement.focusList=t;this._outsideClickFn=this._handleOutsideClick.bind(this);requestAnimationFrame((()=>{window.addEventListener("click",this._outsideClickFn)}))}async closeDropdown(){this._dropdownElement.shadowRoot.querySelector("ul").classList.remove("active");this._dropdownElement.isOpen=false;window.removeEventListener("click",this._outsideClickFn)}async updateDropdown(t){var i;(i=this._dropdownElement)===null||i===void 0?void 0:i.updateDropdown(t)}_createDropdownWrapper(){const t=document.querySelector("c-dropdowns");const i=t||document.createElement("c-dropdowns");this._dropdownsElement=i;if(t)return;document.body.appendChild(i)}_onReset(){if(this.inputField){this.inputField.placeholder=!this.label&&!this.value&&!!this.placeholder?this.placeholder:""}}_preventNonNumericalInput(t){if(this.type!=="number")return;if(!t.key.match(/^[0-9,\.]+$/))t.preventDefault()}_renderBorders(){if(this.shadow)return;const t={active:this.isActive};return i("fieldset",{"aria-hidden":"true"},i("legend",{class:t,style:{"--_c-input-legend-width":this.labelWidth+"px"}},i("span",{class:"notranslate"})))}_renderLabel(){if(!this.label)return;const t={active:this.isActive};return i("label",{htmlFor:this.inputId,ref:t=>this._labelRef=t,class:t},this.label,this.required&&i("span",null," *"))}get inputField(){var t;return(t=this.hiddenEl)===null||t===void 0?void 0:t.querySelector(".c-input__input")}_updateStatusText(){if(this._debounce!==null){clearTimeout(this._debounce);this._debounce=null}this._debounce=window.setTimeout((()=>{this.statusText=this.valid?"":`Error: ${this.validation}`;this._debounce=null}),1400)}render(){const t={"c-input":true,"c-input--disabled":this.disabled,"c-input--shadow":this.shadow,"c-input--textarea":this.rows>1,"c-input--error":!this.valid,filled:!!this.value,[`c-input--${this.variant}`]:true};return i(e,{disabled:this.disabled},i("div",{id:"announce-"+this.inputId,class:"visuallyhidden","aria-live":"polite","aria-atomic":"true"},this.statusText),i("div",{class:t},i("div",{class:"c-input__control"},i("div",{class:"c-input__slot",onClick:()=>this._onFocus()},this._renderBorders(),i("div",{class:"c-input__field",style:{"--_c-input-label-position":this.preSlotWidth+"px"}},i("slot",{name:"pre"}),this._renderLabel(),i("slot",null))),!this.hideDetails&&i("c-message",{hint:this.hint,inputId:this.inputId,valid:this.valid,validation:this.validation}))))}get hiddenEl(){return s(this)}static get watchers(){return{valid:["onValidChange"],validation:["onValidationMessageChange"],value:["onValueChange"],placeholder:["onPlaceholderChange"]}}};u.style=d;const p="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-message-error-color:var(--c-error-600);--_c-message-hint-color:var(--c-text-system);display:block;line-height:1;padding:0 12px}.c-message--active .c-message-item{opacity:1;transform:translateY(0)}.c-message-item{font-size:12px;min-height:16px;opacity:0;transform:translateY(-4px);transition:all 0.2s cubic-bezier(0.25, 0.8, 0.5, 1)}.c-message-item--hint{color:var(--_c-message-hint-color)}.c-message-item--error{color:var(--_c-message-error-color)}.c-message-item span{align-items:flex-start;color:currentColor;display:flex;gap:4px;min-height:16px}.c-message-item svg{fill:currentColor;height:16px;width:16px;position:relative;top:-2px}.c-message .visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}";const f=class{constructor(e){t(this,e);this._validationIcon=i("svg",{height:"16px",width:"16px",viewBox:"0 0 24 24"},i("path",{d:r}));this.hint="";this.inputId=undefined;this.valid=true;this.validation="Required field";this.messageOptions={show:true,type:"hint",content:""}}onValidChange(t){this._handleValidation(t)}onValidationMessageChange(t){if(this.valid||!t)return;this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{content:i("span",null,i("span",{class:"visuallyhidden"},"Error: "),this._validationIcon," ",t)})}onHintMessageChange(t){if(!this.valid||!t)return;this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{content:i("span",null,i("span",{class:"visuallyhidden"},"Hint: "),t)})}_handleValidation(t,e=200){this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{show:false});setTimeout((()=>{this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{type:t?"hint":"error",show:true,content:t?i("span",{id:`hint-${this.inputId}`},i("span",{class:"visuallyhidden"},"Hint: "),this.hint):i("span",{id:`error-${this.inputId}`},this._validationIcon,i("span",{class:"visuallyhidden"},"Error: "),this.validation)})}),e)}componentDidLoad(){this._handleValidation(this.valid,0)}render(){const t={"c-message":true,"c-message--active":this.messageOptions.show};const s={"c-message-item":true,[`c-message-item--${this.messageOptions.type}`]:true};return i(e,null,i("div",{class:t},i("div",{class:s},this.messageOptions.content)))}static get watchers(){return{valid:["onValidChange"],validation:["onValidationMessageChange"],hint:["onHintMessageChange"]}}};f.style=p;export{h as c_dropdown,c as c_dropdowns,u as c_input,f as c_message};
2
+ //# sourceMappingURL=p-0a423333.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["cDropdownCss","CDropdown","this","_id","_debounce","_itemRefs","_lastKeyPressTime","_openedOnTop","_searchString","_observer","IntersectionObserver","entries","observer","forEach","entry","isIntersecting","target","scrollIntoView","block","inline","unobserve","threshold","_renderMenuItem","item","index","isActive","_a","items","currentIndex","value","itemId","replace","inputId","parent","setActiveDescendant","listItem","document","createElement","role","ariaPosInSet","toString","ariaSetSize","length","ariaSelected","id","dataset","name","setAttribute","classList","toggle","disabled","addEventListener","event","isDisabled","contains","preventDefault","_onSelect","add","remove","push","Object","keys","options","requestAnimationFrame","option","query","type","optionValue","querySelector","innerHTML","_highlightMatchingText","textContent","appendChild","_listElement","span","updateDropdown","params","_updateMenuItems","_updateStatusText","focusDropdown","focus","focusItem","onOpenStateChange","open","_onOpen","_createEventListeners","focusList","_handleCurrentIndexChange","_positionMenu","_onClose","onCurrentIndexChange","_listSize","_firstSelectableIndex","findIndex","_lastSelectableIndex","findLastIndex","regex","RegExp","match","_renderEmptyItem","emptyElement","tabIndex","icon","path","mdiAlert","size","color","append","replaceChildren","map","_renderMenu","dialogElement","listElement","ariaExpanded","isVisible","_dialogElement","host","shadowRoot","_onKeyboardNavigation","bind","_onKeyDown","showModal","focusInput","onHideMenu","isOpen","close","onItemSelection","i","_getParentPosition","getBoundingClientRect","innerWidth","innerHeight","window","bottom","parentBottom","left","parentLeft","width","parentWidth","height","parentHeight","top","parentTop","bottomTranslate","style","removeProperty","right","isInView","x","y","fitsOnTop","setProperty","topPosition","parseFloat","async","_scrollToElement","itemsPerPage","itemRef","observe","stopPropagation","wasClicked","letterNumber","key","updatedQuery","slice","updateQuery","Date","now","selectedItem","find","toLowerCase","startsWith","element","_b","clearTimeout","setTimeout","selection","ending","beginning","selectionText","statusText","componentWillLoad","componentDidLoad","_resizeObserver","ResizeObserver","disconnectedCallback","disconnect","render","h","Host","class","cDropdownsCss","CDropdowns","createDropdown","wrapper","cInputCss","CInput","_hasBlurred","_calculateElementWidths","_onBlur","isFocused","_onReset","_onFocus","click","inputField","_dropdownElement","itemClick","emit","placeholder","onValidChange","validateOnBlur","_setAriaDescriptionId","onValidationMessageChange","onValueChange","onPlaceholderChange","variant","_createDropdownWrapper","autofocus","label","_labelRef","_c","_preventNonNumericalInput","title","_d","container","closest","removeEventListener","removeAttribute","valid","hint","labelWidth","scrollWidth","preSlotWidth","offsetLeft","_handleOutsideClick","composedPath","includes","closeDropdown","_getScrollParent","Promise","resolve","undefined","parentNode","overflow","overflowX","getComputedStyle","split","every","o","documentElement","hiddenEl","_dropdownsElement","assign","openDropdown","_outsideClickFn","existingElement","body","_renderBorders","shadow","classes","active","_renderLabel","htmlFor","ref","el","required","validation","containerClasses","rows","filled","onClick","hideDetails","cMessageCss","CMessage","_validationIcon","viewBox","d","mdiCloseCircle","show","content","_handleValidation","message","messageOptions","onHintMessageChange","timeout","messageClasses"],"sources":["src/components/c-dropdown/c-dropdown.scss?tag=c-dropdown&encapsulation=shadow","src/components/c-dropdown/c-dropdown.tsx","src/components/c-dropdowns/c-dropdowns.scss?tag=c-dropdowns&encapsulation=shadow","src/components/c-dropdowns/c-dropdowns.tsx","src/components/c-input/c-input.scss?tag=c-input","src/components/c-input/c-input.tsx","src/components/c-message/c-message.scss?tag=c-message&encapsulation=shadow","src/components/c-message/c-message.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-dropdown-background-color: Menu background color\n * @prop --c-dropdown-background-color-hover: Menu item hover background color\n * @prop --c-dropdown-text-color: Menu item text color\n * @prop --c-dropdown-text-color-active: Active menu item text color\n */\n --_c-dropdown-background-color: var(--c-dropdown-background-color, var(--c-white));\n --_c-dropdown-background-color-hover: var(--c-dropdown-background-color-hover, var(--c-primary-200));\n --_c-dropdown-text-color: var(--c-dropdown-text-color, var(--c-text-body));\n --_c-dropdown-text-color-active: var(--c-dropdown-text-color-active, var(--c-primary-600));\n\n // private\n --_c-dropdown-font-size: 14px;\n --_c-dropdown-height: 42px;\n\n display: block;\n position: absolute;\n\n mark {\n background-color: transparent;\n box-shadow: 0 2px 0 0 var(--_c-dropdown-text-color-active);\n color: inherit;\n }\n\n dialog {\n background-color: transparent;\n border-radius: 4px;\n border: none;\n box-shadow: 2px 4px 10px #00000029;\n margin: 0;\n overflow: hidden;\n padding: 0;\n position: fixed;\n\n &::backdrop {\n display: none;\n }\n }\n\n ul {\n background-color: var(--_c-dropdown-background-color);\n border-radius: 4px;\n height: 100%;\n list-style: none;\n margin: 0;\n outline: none;\n overflow-y: scroll;\n padding: 0;\n pointer-events: auto;\n visibility: hidden;\n width: 100%;\n\n &.active {\n visibility: visible;\n animation: 0.2s 1 fade-in cubic-bezier(0.25, 0.8, 0.5, 1);\n }\n }\n\n li {\n align-items: center;\n background: var(--c-white);\n column-gap: 12px;\n cursor: pointer;\n display: flex;\n flex-wrap: nowrap;\n font-size: var(--_c-dropdown-font-size);\n min-height: var(--_c-dropdown-height);\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n pointer-events: auto;\n white-space: nowrap;\n width: 100%;\n \n span,\n c-option-value {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 100%;\n }\n\n &:not(.disabled):hover,\n &.active {\n background: var(--_c-dropdown-background-color-hover);\n color: var(--_c-dropdown-text-color-active);\n }\n\n &.disabled {\n background-color: rgba(var(--c-tertiary-rgb), 0.05);\n cursor: default;\n filter: grayscale(1) opacity(0.75);\n }\n }\n\n .visuallyhidden {\n border: 0;\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n }\n\n @keyframes fade-in {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n}\n","import {\n Component,\n Element,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n} from '@stencil/core';\nimport { CAutocompleteItem, CSelectItem } from '../../types';\nimport { mdiAlert } from '@mdi/js';\n\nexport type _CDropdownUpdateParams = {\n items?: CSelectItem[] | CAutocompleteItem[];\n options?: Record<string, HTMLCOptionElement>;\n};\n\n@Component({\n tag: 'c-dropdown',\n styleUrl: 'c-dropdown.scss',\n shadow: true,\n})\nexport class CDropdown {\n @Element() host: HTMLCDropdownElement;\n\n /**\n * Dropdown items\n */\n @Prop() items: CSelectItem[] | CAutocompleteItem[] = [];\n\n /**\n * Dropdown options\n */\n @Prop() options: Record<string, HTMLCOptionElement>;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage: number;\n\n /**\n * Dropdown parent\n */\n @Prop() parent: HTMLCSelectElement | HTMLCAutocompleteElement;\n\n /**\n * Dropdown scrolling parent\n */\n @Prop() wrapper: HTMLElement;\n\n /**\n * Initial value index\n */\n @Prop() index: number;\n\n /**\n * Dropdown open state\n */\n @Prop() isOpen = false;\n\n /**\n * Focus dropdown on open\n */\n @Prop() focusList: boolean;\n\n /**\n * Id of the input element\n */\n @Prop() inputId: string;\n\n /**\n * Type of the parent element\n */\n @Prop() type: 'select' | 'autocomplete';\n\n /**\n * @private\n */\n @Prop() wasClicked = false;\n\n @State() currentIndex: number = null;\n\n @State() isVisible = false;\n\n @State() topPosition: number;\n\n @State() bottomTranslate: number;\n\n @State() statusText = '';\n\n private _id = '';\n\n /**\n * @private\n */\n @Method()\n async updateDropdown(params: _CDropdownUpdateParams) {\n this.items = [];\n this._itemRefs = [];\n this.options = {};\n\n requestAnimationFrame(() => {\n this.currentIndex = null;\n this.items = params.items || this.items;\n this.options = params.options || this.options;\n\n this._updateMenuItems();\n this._updateStatusText();\n });\n }\n\n /**\n * @private\n */\n @Method()\n async focusDropdown() {\n requestAnimationFrame(() => {\n this._listElement.focus();\n });\n }\n\n /**\n * @private\n */\n @Method()\n async focusItem(type: 'first' | 'last') {\n requestAnimationFrame(() => {\n const index = type === 'first' ? 0 : this.items.length - 1;\n\n this.currentIndex = index;\n\n this._itemRefs[index].focus();\n });\n }\n\n @Watch('isOpen')\n onOpenStateChange(open) {\n if (!this.wasClicked && ['select', 'autocomplete'].includes(this.type)) {\n // this._isOpenedWithKeyboard = open;\n }\n\n if (open) {\n this._onOpen();\n this._createEventListeners();\n\n requestAnimationFrame(() => {\n if (this.focusList) {\n this._listElement.focus();\n\n if (this.type === 'autocomplete') {\n this.currentIndex = 0;\n }\n\n this._handleCurrentIndexChange();\n }\n\n this._positionMenu();\n });\n\n return;\n }\n\n this._openedOnTop = false;\n this._onClose();\n }\n\n @Watch('currentIndex')\n onCurrentIndexChange() {\n this._handleCurrentIndexChange();\n }\n\n private _debounce = null;\n\n private _itemRefs: HTMLLIElement[] = [];\n\n private _lastKeyPressTime = null;\n\n private _listElement: HTMLUListElement;\n\n private _dialogElement: HTMLDialogElement;\n\n private _openedOnTop = false;\n\n private _searchString = '';\n\n private _resizeObserver: ResizeObserver;\n\n private get _listSize() {\n return this.items.length || 0;\n }\n\n private get _firstSelectableIndex() {\n return this.items.findIndex((item) => !item.disabled);\n }\n\n private get _lastSelectableIndex() {\n return this.items.findLastIndex((item) => !item.disabled);\n }\n\n private _observer = new IntersectionObserver(\n (entries, observer) => {\n entries.forEach((entry) => {\n if (!entry.isIntersecting) {\n entry.target.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n });\n observer.unobserve(entry.target);\n } else {\n observer.unobserve(entry.target);\n }\n });\n },\n { threshold: 1 },\n );\n\n private _highlightMatchingText(value: string) {\n if (this.type === 'select') return value;\n\n const regex = new RegExp(\n (this.parent as HTMLCAutocompleteElement).query,\n 'gi',\n );\n\n return value.replace(regex, (match) => `<mark>${match}</mark>`);\n }\n\n private _renderMenuItem = (item: CSelectItem, index: number) => {\n const isActive = this.items[this.currentIndex]?.value === item.value;\n\n let itemId = 'none';\n\n if (typeof item?.value === 'string') {\n itemId = item.value.replace(/[^a-zA-Z0-9-_]/g, '');\n }\n\n itemId = `item_${this.inputId}--${itemId}`;\n\n if (isActive) {\n this.currentIndex = index;\n this.parent.setActiveDescendant(itemId);\n }\n\n const listItem = document.createElement('li');\n\n // a11y\n listItem.role = 'option';\n listItem.ariaPosInSet = (index + 1).toString();\n listItem.ariaSetSize = this.items.length.toString();\n\n listItem.ariaSelected = isActive.toString();\n\n listItem.id = itemId;\n listItem.dataset.value = item.name;\n listItem.setAttribute('tabindex', '-1');\n\n listItem.classList.toggle('disabled', !!item.disabled);\n\n listItem.addEventListener('click', (event: MouseEvent) => {\n const isDisabled = this._itemRefs[index].classList.contains('disabled');\n\n if (isDisabled) {\n event.preventDefault();\n\n return;\n }\n\n this.currentIndex = index;\n this._onSelect(index);\n });\n\n listItem.addEventListener('focus', () => {\n listItem.classList.add('active');\n });\n\n listItem.addEventListener('blur', () => {\n listItem.classList.remove('active');\n });\n\n this._itemRefs.push(listItem);\n\n if (Object.keys(this.options).length) {\n requestAnimationFrame(() => {\n const option = this.options[item.value as string];\n\n if (!option) return;\n\n if (\n (this.parent as HTMLCAutocompleteElement).query?.length &&\n this.type === 'autocomplete'\n ) {\n const optionValue = option.querySelector('c-option-value');\n\n if (optionValue) {\n optionValue.innerHTML = this._highlightMatchingText(\n optionValue.textContent,\n );\n }\n }\n\n listItem.appendChild(option);\n\n this._listElement.appendChild(listItem);\n });\n\n return;\n }\n\n const span = document.createElement('span');\n span.innerHTML = this._highlightMatchingText(item.name);\n\n listItem.appendChild(span);\n\n this._listElement.appendChild(listItem);\n };\n\n private _renderEmptyItem() {\n const emptyElement = document.createElement('li');\n emptyElement.tabIndex = -1;\n\n const icon = document.createElement('c-icon');\n icon.path = mdiAlert;\n icon.size = 18;\n icon.color = 'var(--c-warning-600)';\n\n emptyElement.appendChild(icon);\n emptyElement.append('No suggestions found');\n\n this._listElement.replaceChildren(emptyElement);\n }\n\n private _updateMenuItems() {\n if (!this.items.length) {\n this._renderEmptyItem();\n\n return;\n }\n\n requestAnimationFrame(() => {\n this._listElement.replaceChildren();\n this._itemRefs.length = 0;\n\n this.items.map((item, index) => this._renderMenuItem(item, index));\n });\n }\n\n private _renderMenu(/* style */) {\n this._id = `${this.inputId}--items`;\n\n const dialogElement = document.createElement('dialog');\n\n const listElement = document.createElement('ul');\n\n // a11y\n listElement.role = `listbox`;\n listElement.ariaExpanded = this.isVisible.toString();\n listElement.tabIndex = -1;\n\n listElement.id = this._id;\n\n this._dialogElement = dialogElement;\n\n this._listElement = listElement;\n\n this._dialogElement.appendChild(listElement);\n\n this.host.shadowRoot.appendChild(dialogElement);\n\n this.items.map((item, index) => this._renderMenuItem(item, index));\n\n this._listElement.addEventListener(\n 'keydown',\n this._onKeyboardNavigation.bind(this),\n );\n\n this._listElement.addEventListener('keyup', this._onKeyDown.bind(this));\n }\n\n private _onOpen() {\n this.parent.shadowRoot.querySelector('.c-input').classList.add('active');\n this._listElement.classList.add('active');\n this._listElement.ariaExpanded = 'true';\n this._listElement.tabIndex = 0;\n this._dialogElement.showModal();\n }\n\n private _onClose(focusInput = false) {\n this.parent.onHideMenu();\n this.parent.shadowRoot.querySelector('.c-input').classList.remove('active');\n this._listElement.classList.remove('active');\n this._listElement.ariaExpanded = 'false';\n this._listElement.tabIndex = -1;\n this.isOpen = false;\n this.currentIndex = this.index;\n this._dialogElement.close();\n\n if (focusInput) {\n this.parent.shadowRoot.querySelector('input').focus();\n }\n }\n\n private _onSelect(index: number, focusInput = false) {\n const isDisabled = this._itemRefs[index].classList.contains('disabled');\n\n if (isDisabled) return;\n\n this.parent.onItemSelection(index);\n this.index = index;\n this._onClose(focusInput);\n\n this._itemRefs.forEach((item, i) => {\n item.ariaSelected = (i === index).toString();\n });\n }\n\n private _getParentPosition() {\n return this.parent.shadowRoot\n .querySelector('.c-input__slot')\n .getBoundingClientRect();\n }\n\n private _positionMenu() {\n const { innerWidth, innerHeight } = window;\n\n const {\n bottom: parentBottom,\n left: parentLeft,\n width: parentWidth,\n height: parentHeight,\n top: parentTop,\n } = this._getParentPosition();\n\n this.bottomTranslate = 0;\n\n this._dialogElement.style.width = `${parentWidth}px`;\n this._dialogElement.style.top = `${parentBottom}px`;\n this._dialogElement.style.left = `${parentLeft}px`;\n\n this._dialogElement.style.removeProperty('transform');\n\n const { bottom, right, height, width } =\n this._dialogElement.getBoundingClientRect();\n\n const isInView = {\n x: right < innerWidth,\n y: bottom < innerHeight,\n };\n\n const fitsOnTop = parentTop - height > 0;\n\n if (!fitsOnTop && !isInView.y) {\n this._dialogElement.style.height = `${parentTop}px`;\n }\n\n if (!isInView.y || this._openedOnTop) {\n this._openedOnTop = true;\n\n this.bottomTranslate = height + parentHeight;\n\n this._dialogElement.style.setProperty(\n 'transform',\n `translateY(-${this.bottomTranslate}px`,\n );\n }\n\n this.topPosition = parentBottom;\n\n if (!isInView.x) {\n this._dialogElement.style.left = `${\n parseFloat(this._dialogElement.style.left) - width + parentWidth\n }px`;\n }\n }\n\n private _createEventListeners() {\n requestAnimationFrame(async () => {\n this._listElement.classList.add('active');\n });\n }\n\n private _scrollToElement() {\n if (this.items.length > this.itemsPerPage) {\n const itemRef = this._itemRefs[this.currentIndex];\n\n if (!!itemRef) {\n this._observer.observe(itemRef);\n }\n }\n }\n\n private _onKeyDown(event: KeyboardEvent) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n private _onKeyboardNavigation(event: KeyboardEvent) {\n this.wasClicked = false;\n\n const letterNumber = /^[0-9a-zA-Z]+$/;\n\n if (\n (event.key.match(letterNumber) && event.key.length === 1) ||\n event.key === 'Backspace'\n ) {\n if (this.type === 'autocomplete') {\n this.parent.shadowRoot.querySelector('input').focus();\n\n const { query } = this.parent as HTMLCAutocompleteElement;\n\n let updatedQuery = '';\n\n if (event.key === 'Backspace') {\n updatedQuery = query.slice(0, -1);\n } else {\n updatedQuery = `${query}${event.key}`;\n }\n\n (this.parent as HTMLCAutocompleteElement).updateQuery(updatedQuery);\n\n return;\n }\n\n if (\n Date.now() - this._lastKeyPressTime > 3000 ||\n this._searchString.length > 2\n ) {\n this._searchString = event.key;\n } else {\n this._searchString = `${this._searchString}${event.key}`;\n }\n\n this._lastKeyPressTime = Date.now();\n\n const selectedItem = this.items.find((i) =>\n i.name.toLowerCase().startsWith(this._searchString),\n );\n\n if (selectedItem) {\n this.currentIndex = this.items.findIndex(\n (element) => element === selectedItem,\n );\n\n if (this.isOpen) {\n this._scrollToElement();\n } else {\n this._onSelect(this.currentIndex, true);\n }\n }\n }\n\n if (event.key === 'Enter') {\n this._onSelect(this.currentIndex, true);\n }\n\n if (event.key === ' ' && !this.isOpen) {\n event.preventDefault();\n\n this.isOpen = true;\n }\n\n if ('Tab' === event.key) {\n this._onClose();\n }\n\n if (event.key === 'Escape') {\n this._onClose(true);\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.currentIndex === null) {\n this.currentIndex = 0;\n } else if (this.isOpen && this.currentIndex + 1 < this._listSize) {\n this.currentIndex += 1;\n }\n\n this.isOpen = true;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.isOpen && this.currentIndex === 0) {\n this.currentIndex = null;\n this._onClose(true);\n\n return;\n } else if (this.isOpen && this.currentIndex > 0) {\n this.currentIndex -= 1;\n } else if (this.currentIndex === null) {\n this.currentIndex = this._listSize - 1;\n }\n\n this.isOpen = true;\n }\n\n if (event.key === 'Home' && this.isOpen) {\n event.preventDefault();\n\n this.currentIndex = this._firstSelectableIndex;\n }\n\n if (event.key === 'End' && this.isOpen) {\n event.preventDefault();\n\n this.currentIndex = this._lastSelectableIndex;\n }\n }\n\n private _handleCurrentIndexChange() {\n if (this.currentIndex === null) {\n this.parent?.setActiveDescendant('');\n\n return;\n }\n\n this._updateStatusText();\n\n requestAnimationFrame(() => {\n const item = this._itemRefs[this.currentIndex];\n\n if (!item) return;\n\n item?.focus();\n\n this.parent?.setActiveDescendant(item.id ?? null);\n });\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n const selection = this._itemRefs[this.currentIndex];\n\n const ending = !!this.items.length\n ? ', to navigate use up and down arrows'\n : '';\n\n const isDisabled = !!selection?.classList?.contains('disabled');\n\n const beginning = isDisabled ? 'Disabled option - ' : '';\n\n let selectionText = !!selection\n ? `${beginning}${selection.dataset.value} - ${selection.ariaPosInSet} of ${selection.ariaSetSize} is highlighted`\n : null;\n\n if (this.currentIndex === null && this.type === 'autocomplete') {\n selectionText = this.items.length\n ? `${this.items.length} result${\n this.items.length !== 1 ? 's' : ''\n } available`\n : 'No search results available';\n }\n\n this.statusText = `${selectionText || ending}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n componentWillLoad() {\n this._renderMenu();\n }\n\n componentDidLoad() {\n this.currentIndex = this.index;\n\n this._resizeObserver = new ResizeObserver(() => {\n if (!this.isOpen) return;\n\n this._positionMenu();\n });\n\n this._resizeObserver.observe(this._dialogElement);\n }\n\n disconnectedCallback() {\n this._resizeObserver.disconnect();\n }\n\n render() {\n if (\n this.itemsPerPage &&\n this.itemsPerPage > 0 &&\n this.items.length > this.itemsPerPage\n ) {\n this._dialogElement.style.height = 42 * (this.itemsPerPage + 0.5) + 'px';\n }\n\n return (\n <Host>\n <div\n id={'announce-' + this._id}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: block;\n inset: 0;\n pointer-events: none;\n position: fixed;\n}\n","import { Component, Element, Host, Method, h } from '@stencil/core';\nimport { CSelectItem } from '../../types';\n\nexport type CDropdownParamsSelect = {\n type: 'select';\n parent: HTMLCSelectElement;\n};\n\nexport type CDropdownParamsAutoComplete = {\n type: 'autocomplete';\n parent: HTMLCAutocompleteElement;\n};\n\nexport type _CDropdownParams = {\n index: number;\n click: boolean;\n items: CSelectItem[];\n id: string;\n wrapper?: HTMLElement;\n itemsPerPage?: number;\n options?: Record<string, HTMLCOptionElement>;\n} & (CDropdownParamsSelect | CDropdownParamsAutoComplete);\n\nexport type Position = {\n bottom: number;\n left: number;\n width: number;\n height: number;\n};\n\n@Component({\n tag: 'c-dropdowns',\n styleUrl: 'c-dropdowns.scss',\n shadow: true,\n})\nexport class CDropdowns {\n @Element() host: HTMLCDropdownsElement;\n\n /**\n * Creates a dropdown\n */\n @Method()\n async createDropdown(params: _CDropdownParams) {\n const element = document.createElement('c-dropdown');\n\n element.items = params.items;\n element.itemsPerPage = params.itemsPerPage || 6;\n element.options = params.options;\n element.parent = params.parent;\n element.wrapper = params.wrapper;\n element.inputId = params.id;\n element.index = params.index;\n element.type = params.type;\n\n this.host.shadowRoot.appendChild(element);\n\n return element;\n }\n\n render() {\n return <Host></Host>;\n }\n}\n",":root,\n:host {\n --_c-input-inactive-color: var(--c-tertiary-600);\n --_c-input-active-color: var(--c-primary-600);\n --_c-input-background-color: var(--c-transparent);\n --_c-input-text-color: var(--c-text-body);\n --_c-input-placeholder-color: var(--c-tertiary-500);\n --_c-input-shadow-active-color: var(--_c-input-active-color);\n --_c-input-shadow-background-color: var(--c-white);\n --_c-input-shadow-text-color: var(--_c-input-text-color);\n --_c-input-shadow-placeholder-color: var(--_c-input-placeholder-color);\n\n // private\n --_c-input-error-color: var(--c-error-600);\n}\n\n.visuallyhidden {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.c-input {\n $this: &;\n\n --_c-input-border-width: 1px;\n\n align-items: flex-start;\n border-radius: 4px;\n display: flex;\n flex: 1 1 auto;\n font-family: var(--c-font-family);\n font-size: 16px;\n letter-spacing: normal;\n max-width: 100%;\n text-align: left;\n\n input,\n select,\n textarea {\n background: none;\n border: 0;\n display: inline-block;\n font-family: var(--c-font-family);\n font-size: 16px;\n line-height: 1;\n margin: 0;\n padding: 0;\n vertical-align: middle;\n white-space: normal;\n }\n\n input,\n textarea {\n box-sizing: content-box;\n background-color: transparent;\n border: none;\n color: var(--_c-input-text-color);\n flex: 1 1 auto;\n font-family: var(--c-font-family);\n font-size: 16px;\n line-height: 20px;\n max-width: 100%;\n min-width: 0;\n width: 100%;\n }\n\n input[type=\"checkbox\"],\n input[type=\"radio\"],\n select {\n box-sizing: border-box;\n }\n\n input[type=\"search\"] {\n appearance: textfield;\n box-sizing: content-box;\n }\n\n ::-webkit-search-decoration {\n display: none;\n }\n\n textarea {\n margin-top: 4px;\n min-height: 44px;\n overflow: auto;\n padding: 8px 12px 8px 0;\n resize: vertical;\n vertical-align: top;\n }\n\n input {\n max-height: 32px;\n padding: 8px 0;\n }\n\n input:focus,\n input:active,\n textarea:focus,\n textarea:active {\n outline: none;\n }\n\n .c-input__content {\n align-items: center;\n display: flex;\n width: 100%;\n }\n\n &__control {\n border-radius: inherit;\n color: currentColor;\n display: flex;\n flex-flow: column wrap;\n flex-grow: 1;\n gap: 8px;\n height: auto;\n min-width: 0;\n width: 100%;\n }\n\n &__slot {\n align-items: stretch;\n background: transparent;\n border-radius: inherit;\n color: inherit;\n cursor: text;\n display: flex;\n min-height: 44px;\n padding: 0 12px;\n position: relative;\n transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);\n width: 100%;\n }\n\n &__field {\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n gap: 8px;\n position: relative;\n\n input,\n textarea {\n flex: 1;\n outline: 0;\n }\n\n label {\n font-size: 16px;\n height: 20px;\n left: 0;\n letter-spacing: normal;\n line-height: 20px;\n max-width: 90%;\n min-height: 8px;\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n right: auto;\n text-overflow: ellipsis;\n top: 12px;\n transform-origin: top left;\n transform: translateX(var(--_c-input-label-position)) translateY(0)\n scale(1);\n transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);\n white-space: nowrap;\n\n &.active {\n transform: translateY(-18px) scale(0.75);\n }\n\n span {\n color: var(--_c-input-error-color);\n }\n }\n }\n\n &--select {\n input {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .c-input__slot {\n cursor: pointer;\n }\n }\n\n fieldset {\n background-color: var(--_c-input-background-color);\n border-collapse: collapse;\n border-color: var(--_c-input-inactive-color);\n border-radius: inherit;\n border-style: solid;\n border-width: var(--_c-input-border-width);\n inset: 0;\n margin: 0;\n padding: 0 0 0 8px;\n pointer-events: none;\n position: absolute;\n transition-duration: 0.15s;\n transition-property: color;\n transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);\n\n legend {\n float: none;\n line-height: 11px;\n margin-left: -1px;\n padding: 0;\n text-align: left;\n transition: width 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);\n width: 0;\n\n &.active {\n width: var(--_c-input-legend-width);\n }\n }\n }\n\n &--shadow {\n #{$this} {\n &__slot {\n background-color: var(--_c-input-shadow-background-color);\n box-shadow: rgba(0, 0, 0, 0.15) 0 5px 15px 0;\n\n input,\n textarea {\n color: var(--_c-input-shadow-text-color);\n }\n\n &:focus-within {\n outline: 2px var(--_c-input-active-color) solid;\n\n c-icon {\n --c-icon-color: var(--_c-input-shadow-active-color) !important;\n }\n }\n }\n }\n\n input::placeholder,\n textarea::placeholder {\n color: var(--_c-input-shadow-placeholder-color);\n opacity: 1;\n }\n }\n\n &--disabled {\n input,\n textarea,\n fieldset,\n label {\n --_c-input-error-color: var(--c-tertiary-500);\n\n color: var(--c-tertiary-500);\n }\n }\n\n &--textarea {\n #{$this} {\n &__field {\n margin-right: -12px;\n }\n }\n }\n\n ::placeholder {\n color: var(--_c-input-placeholder-color);\n opacity: 1;\n }\n\n &:focus-within,\n &.active,\n &:not(.c-input--disabled):active {\n --_c-input-border-width: 2px;\n\n color: var(--_c-input-active-color);\n\n fieldset {\n border-color: var(--_c-input-active-color);\n }\n\n label {\n color: var(--_c-input-active-color);\n transform: translateX(0) translateY(-18px) scale(0.75);\n }\n\n legend {\n width: var(--_c-input-legend-width);\n }\n }\n\n &.active:not(.filled) {\n .c-input-menu__input {\n position: relative;\n\n &::after {\n display: flex;\n align-items: center;\n position: absolute;\n inset: 0;\n content: attr(data-placeholder);\n pointer-events: none;\n color: var(--_c-input-placeholder-color);\n }\n }\n }\n\n &--error {\n color: var(--_c-input-error-color);\n\n fieldset {\n border-color: var(--_c-input-error-color) !important;\n }\n\n label {\n color: var(--_c-input-error-color) !important;\n }\n\n &:focus-within {\n color: var(--_c-input-error-color);\n }\n }\n}\n","import {\n Component,\n Host,\n h,\n State,\n Prop,\n Event,\n EventEmitter,\n Element,\n Watch,\n Method,\n} from '@stencil/core';\nimport { CAutocompleteItem, CSelectItem } from '../../types';\nimport { _CDropdownParams } from '../c-dropdowns/c-dropdowns';\nimport { _CDropdownUpdateParams } from '../c-dropdown/c-dropdown';\n\n/**\n * @parent None\n */\n@Component({\n tag: 'c-input',\n styleUrl: 'c-input.scss',\n shadow: false,\n})\nexport class CInput {\n /**\n * Auto focus the input\n */\n @Prop() autofocus = false;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Render a hidden input outside the shadow dom\n */\n @Prop() form = false;\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Id of the input\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Id of the input element\n */\n @Prop() inputId: string;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n /**\n * Label of the input\n */\n @Prop() label: string;\n\n /**\n * Maximum value on a numeric input\n */\n @Prop() max: number = null;\n\n /**\n * Minimum value on a numeric input\n */\n @Prop() min: number = null;\n\n /**\n * Name of the input\n */\n @Prop() name: string;\n\n /**\n * Placeholder of the input\n */\n @Prop() placeholder: string;\n\n /**\n * Mark as readonly\n */\n @Prop() readonly = false;\n\n /**\n * Set the input as required\n */\n @Prop() required = false;\n\n /**\n * Rows on the input\n */\n @Prop() rows = 1;\n\n /**\n * Shadow variant of the input\n */\n @Prop() shadow = false;\n\n /**\n * Step size on a numeric input\n */\n @Prop() step: number = null;\n\n /**\n * Type of the input\n */\n @Prop() type: string;\n\n /**\n * Set the validíty of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Value of the input\n */\n @Prop() value: string | number | boolean | CSelectItem | CAutocompleteItem;\n\n /**\n * Variant\n */\n @Prop() variant: 'text' | 'select' = 'text';\n\n /**\n * Emit changes to the parent\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n /**\n * Emit click to the parent\n * @private\n */\n @Event({ bubbles: false }) itemClick: EventEmitter;\n\n /**\n * Emit close to the parent\n * @private\n */\n @Event({ bubbles: false }) dropdownClose: EventEmitter;\n\n @State() isFocused = false;\n\n @State() labelWidth = 0;\n\n @State() preSlotWidth = 0;\n\n @State() statusText = '';\n\n @State() currentIndex: number = null;\n\n @Element() hiddenEl!: HTMLCInputElement;\n\n @Watch('valid')\n onValidChange() {\n if (this.validateOnBlur && !this._hasBlurred) return;\n\n this._setAriaDescriptionId();\n }\n\n @Watch('validation')\n onValidationMessageChange() {\n this._updateStatusText();\n }\n\n @Watch('value')\n onValueChange(value) {\n if (!value) {\n this._onReset();\n }\n }\n\n @Watch('placeholder')\n onPlaceholderChange(placeholder) {\n if (placeholder) this._onReset();\n }\n\n private _hasBlurred = false;\n\n private _labelRef: HTMLLabelElement;\n\n private _debounce = null;\n\n private _dropdownsElement: HTMLCDropdownsElement;\n\n private _dropdownElement: HTMLCDropdownElement;\n\n private _outsideClickFn: () => void;\n\n // private _parentTop = 0;\n\n // private _listSize = 0;\n\n // private _parent: HTMLCSelectElement | HTMLCAutocompleteElement;\n\n componentWillLoad() {\n if (this.variant === 'select') {\n this._createDropdownWrapper();\n }\n }\n\n componentDidLoad() {\n if (this.autofocus) {\n setTimeout(() => {\n this._onFocus(false);\n }, 500);\n }\n\n this._calculateElementWidths();\n this._setAriaDescriptionId();\n\n if (this.label) {\n this._observer.observe(this._labelRef);\n }\n\n this.inputField?.addEventListener('focus', () => this._onFocus(false));\n this.inputField?.addEventListener('blur', () => this._onBlur());\n this.inputField?.addEventListener(\n 'keypress',\n this._preventNonNumericalInput,\n );\n\n // hide the placeholder text initially if there is a label\n if (this.inputField) {\n this.inputField.placeholder =\n !!this.label || !this.placeholder ? '' : this.placeholder;\n\n this.inputField.title = this.label ?? this.placeholder;\n\n requestAnimationFrame(() => {\n const container = this.inputField.closest(\n '.c-input-menu__input',\n ) as HTMLDivElement;\n\n if (!container) return;\n\n container.dataset.placeholder = this.placeholder;\n });\n }\n }\n\n disconnectedCallback() {\n this.inputField?.removeEventListener('focus', () => this._onFocus(false));\n this.inputField?.removeEventListener('blur', () => this._onBlur());\n this.inputField?.removeEventListener(\n 'keypress',\n this._preventNonNumericalInput,\n );\n\n this._observer.disconnect();\n\n this._dropdownElement?.remove();\n }\n\n get isActive() {\n return !!this.value || typeof this.value === 'boolean' || this.isFocused;\n }\n\n private _setAriaDescriptionId() {\n this.inputField.removeAttribute('aria-describedby');\n\n let type = null;\n\n if (this.valid && !this.value && this.hint) {\n type = 'hint';\n }\n\n if (!this.valid) {\n type = 'error';\n }\n\n if (type) {\n this.inputField.setAttribute(\n 'aria-describedby',\n `${type}-${this.inputId}`,\n );\n }\n }\n\n private _observer = new IntersectionObserver(\n (entries, observer) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n this._calculateElementWidths();\n observer.unobserve(entry.target);\n }\n });\n },\n { threshold: 1 },\n );\n\n private _calculateElementWidths() {\n this.labelWidth = !!this.label ? this._labelRef.scrollWidth * 0.75 + 6 : 0;\n this.preSlotWidth = this.inputField.offsetLeft;\n }\n\n private _handleOutsideClick(event) {\n if (!event.composedPath().includes(this._dropdownElement)) {\n this.closeDropdown();\n }\n }\n\n private async _getScrollParent(element): Promise<HTMLElement> {\n return new Promise((resolve) => {\n if (!element) {\n resolve(undefined);\n }\n\n let parent = element.parentNode;\n\n while (parent) {\n if (parent.shadowRoot === undefined) {\n parent = parent.host;\n } else {\n const { overflow, overflowX } = window.getComputedStyle(parent);\n\n if (\n overflowX !== 'scroll' &&\n overflow.split(' ').every((o) => o === 'auto' || o === 'scroll')\n ) {\n resolve(parent);\n }\n\n parent = parent.parentNode;\n }\n }\n\n resolve(document.documentElement);\n });\n }\n\n /**\n * @private\n */\n @Method()\n async focusDropdown() {\n this._dropdownElement.focusDropdown();\n }\n\n /**\n * @private\n */\n @Method()\n async focusItem(type: 'first' | 'last') {\n await this._dropdownElement.focusItem(type);\n }\n\n /**\n * Create a dropdown\n */\n @Method()\n async createDropdown(params: _CDropdownParams) {\n const wrapper = await this._getScrollParent(this.hiddenEl);\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this._dropdownElement = await this._dropdownsElement.createDropdown({\n ...params,\n itemsPerPage: params.itemsPerPage || 6,\n wrapper,\n });\n }\n\n /**\n * Opens the dropdown\n */\n @Method()\n async openDropdown(focusList = true) {\n this._dropdownElement.shadowRoot\n .querySelector('ul')\n .classList.add('active');\n\n this._dropdownElement.isOpen = true;\n this._dropdownElement.focusList = focusList;\n\n this._outsideClickFn = this._handleOutsideClick.bind(this);\n\n requestAnimationFrame(() => {\n window.addEventListener('click', this._outsideClickFn);\n });\n }\n\n /**\n * Closes the dropdown\n */\n @Method()\n async closeDropdown() {\n this._dropdownElement.shadowRoot\n .querySelector('ul')\n .classList.remove('active');\n\n this._dropdownElement.isOpen = false;\n\n window.removeEventListener('click', this._outsideClickFn);\n }\n\n /**\n * @private\n */\n @Method()\n async updateDropdown(params: _CDropdownUpdateParams) {\n this._dropdownElement?.updateDropdown(params);\n }\n\n private _createDropdownWrapper() {\n const existingElement = document.querySelector('c-dropdowns');\n const element = existingElement || document.createElement('c-dropdowns');\n\n this._dropdownsElement = element;\n // this._dropdownsElement.itemsPerPage = this.itemsPerPage;\n\n if (existingElement) return;\n\n document.body.appendChild(element);\n }\n\n private _onBlur = () => {\n // delay the blur event to prevent the label from 'flashing' on c-select selection\n setTimeout(() => {\n this.isFocused = false;\n this._hasBlurred = true;\n\n // show the label if there's no label or value\n this._onReset();\n }, 100);\n };\n\n private _onFocus = (click = true) => {\n if (this.disabled) return;\n\n this.isFocused = true;\n\n this.inputField?.focus();\n\n if (click) {\n this.inputField?.click();\n\n if (this._dropdownElement) {\n this._dropdownElement.wasClicked = true;\n this.itemClick.emit();\n }\n }\n\n // show the label if there's no value\n if (this.inputField) {\n this.inputField.placeholder =\n !!this.value || !this.placeholder ? '' : this.placeholder;\n }\n };\n\n private _onReset() {\n if (this.inputField) {\n this.inputField.placeholder =\n !this.label && !this.value && !!this.placeholder\n ? this.placeholder\n : '';\n }\n }\n\n /**\n * Prevent non numeric values in the numeric fields\n */\n private _preventNonNumericalInput(event: KeyboardEvent) {\n if (this.type !== 'number') return;\n\n if (!event.key.match(/^[0-9,\\.]+$/)) event.preventDefault();\n }\n\n private _renderBorders() {\n if (this.shadow) return;\n\n const classes = {\n active: this.isActive,\n };\n\n return (\n <fieldset aria-hidden=\"true\">\n <legend\n class={classes}\n style={{\n '--_c-input-legend-width': this.labelWidth + 'px',\n }}\n >\n <span class=\"notranslate\"></span>\n </legend>\n </fieldset>\n );\n }\n\n private _renderLabel() {\n if (!this.label) return;\n\n const classes = {\n active: this.isActive,\n };\n\n return (\n <label\n htmlFor={this.inputId}\n ref={(el) => (this._labelRef = el as HTMLLabelElement)}\n class={classes}\n >\n {this.label}\n {this.required && <span>&nbsp;*</span>}\n </label>\n );\n }\n\n get inputField() {\n return this.hiddenEl?.querySelector('.c-input__input') as\n | HTMLInputElement\n | HTMLTextAreaElement;\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n this.statusText = this.valid ? '' : `Error: ${this.validation}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n const containerClasses = {\n 'c-input': true,\n 'c-input--disabled': this.disabled,\n 'c-input--shadow': this.shadow,\n 'c-input--textarea': this.rows > 1,\n 'c-input--error': !this.valid,\n filled: !!this.value,\n [`c-input--${this.variant}`]: true,\n };\n\n return (\n <Host disabled={this.disabled}>\n <div\n id={'announce-' + this.inputId}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n\n <div class={containerClasses}>\n <div class=\"c-input__control\">\n <div class=\"c-input__slot\" onClick={() => this._onFocus()}>\n {this._renderBorders()}\n\n <div\n class=\"c-input__field\"\n style={{\n '--_c-input-label-position': this.preSlotWidth + 'px',\n }}\n >\n <slot name=\"pre\"></slot>\n\n {this._renderLabel()}\n\n <slot></slot>\n </div>\n </div>\n\n {!this.hideDetails && (\n <c-message\n hint={this.hint}\n inputId={this.inputId}\n valid={this.valid}\n validation={this.validation}\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n",":host {\n --_c-message-error-color: var(--c-error-600);\n --_c-message-hint-color: var(--c-text-system);\n\n display: block;\n line-height: 1;\n padding: 0 12px;\n}\n\n.c-message {\n $this: &;\n\n &--active {\n #{$this} {\n &-item {\n opacity: 1;\n transform: translateY(0);\n }\n }\n }\n\n &-item {\n font-size: 12px;\n min-height: 16px;\n opacity: 0;\n transform: translateY(-4px);\n transition: all 0.2s cubic-bezier(0.25, 0.8, 0.5, 1);\n\n &--hint {\n color: var(--_c-message-hint-color);\n }\n\n &--error {\n color: var(--_c-message-error-color);\n }\n\n span {\n align-items: flex-start;\n color: currentColor;\n display: flex;\n gap: 4px;\n min-height: 16px;\n }\n\n svg {\n fill: currentColor;\n height: 16px;\n width: 16px;\n position: relative;\n top: -2px;\n }\n }\n\n .visuallyhidden {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n }\n}\n","import { mdiCloseCircle } from '@mdi/js';\nimport { Component, Host, Prop, State, Watch, h } from '@stencil/core';\n\n/**\n * @parent None\n */\n@Component({\n tag: 'c-message',\n styleUrl: 'c-message.scss',\n shadow: true,\n})\nexport class CMessage {\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Id of the related input element\n */\n @Prop() inputId: string;\n\n /**\n * Parent validíty\n */\n @Prop() valid = true;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n @State() messageOptions = {\n show: true,\n type: 'hint',\n content: '',\n };\n\n @Watch('valid')\n onValidChange(valid: boolean) {\n // if (this.validateOnBlur && !this._hasBlurred) return;\n\n this._handleValidation(valid);\n }\n\n @Watch('validation')\n onValidationMessageChange(message: string) {\n if (this.valid || !message) return;\n\n this.messageOptions = {\n ...this.messageOptions,\n content: (\n <span>\n <span class=\"visuallyhidden\">Error: </span>\n {this._validationIcon} {message}\n </span>\n ),\n };\n }\n\n @Watch('hint')\n onHintMessageChange(message: string) {\n if (!this.valid || !message) return;\n\n this.messageOptions = {\n ...this.messageOptions,\n content: (\n <span>\n <span class=\"visuallyhidden\">Hint: </span>\n {message}\n </span>\n ),\n };\n }\n\n private _handleValidation(valid: boolean, timeout = 200) {\n this.messageOptions = {\n ...this.messageOptions,\n show: false,\n };\n\n setTimeout(() => {\n this.messageOptions = {\n ...this.messageOptions,\n type: valid ? 'hint' : 'error',\n show: true,\n content: valid ? (\n <span id={`hint-${this.inputId}`}>\n <span class=\"visuallyhidden\">Hint: </span>\n {this.hint}\n </span>\n ) : (\n <span id={`error-${this.inputId}`}>\n {this._validationIcon}\n <span class=\"visuallyhidden\">Error: </span>\n {this.validation}\n </span>\n ),\n };\n }, timeout);\n }\n\n private _validationIcon = (\n <svg height=\"16px\" width=\"16px\" viewBox=\"0 0 24 24\">\n <path d={mdiCloseCircle} />\n </svg>\n );\n\n componentDidLoad() {\n this._handleValidation(this.valid, 0);\n }\n\n render() {\n const classes = {\n 'c-message': true,\n 'c-message--active': this.messageOptions.show,\n };\n\n const messageClasses = {\n 'c-message-item': true,\n [`c-message-item--${this.messageOptions.type}`]: true,\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class={messageClasses}>{this.messageOptions.content}</div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"2GAAA,MAAMA,EAAe,okE,MCuBRC,EAAS,M,yBAoEZC,KAAAC,IAAM,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