@cscfi/csc-ui 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/cjs/c-dropdown_4.cjs.entry.js +17 -28
  2. package/dist/cjs/c-dropdown_4.cjs.entry.js.map +1 -1
  3. package/dist/cjs/c-modal.cjs.entry.js +2 -0
  4. package/dist/cjs/c-modal.cjs.entry.js.map +1 -1
  5. package/dist/cjs/c-select.cjs.entry.js +2 -0
  6. package/dist/cjs/c-select.cjs.entry.js.map +1 -1
  7. package/dist/collection/components/c-dropdown/c-dropdown.css +13 -1
  8. package/dist/collection/components/c-dropdown/c-dropdown.js +16 -27
  9. package/dist/collection/components/c-dropdown/c-dropdown.js.map +1 -1
  10. package/dist/collection/components/c-modal/c-modal.js +2 -0
  11. package/dist/collection/components/c-modal/c-modal.js.map +1 -1
  12. package/dist/collection/components/c-select/c-select.js +2 -0
  13. package/dist/collection/components/c-select/c-select.js.map +1 -1
  14. package/dist/collection/dist/styles/css/typography.css +1 -1
  15. package/dist/collection/dist/styles/scss/_typography.scss +1 -1
  16. package/dist/components/c-dropdown2.js +17 -28
  17. package/dist/components/c-dropdown2.js.map +1 -1
  18. package/dist/components/c-modal.js +2 -0
  19. package/dist/components/c-modal.js.map +1 -1
  20. package/dist/components/c-select.js +2 -0
  21. package/dist/components/c-select.js.map +1 -1
  22. package/dist/csc-ui/csc-ui.esm.js +1 -1
  23. package/dist/csc-ui/dist/styles/css/typography.css +1 -1
  24. package/dist/csc-ui/dist/styles/scss/_typography.scss +1 -1
  25. package/dist/csc-ui/{p-259ebb80.entry.js → p-2f00d8c8.entry.js} +2 -2
  26. package/dist/csc-ui/{p-259ebb80.entry.js.map → p-2f00d8c8.entry.js.map} +1 -1
  27. package/dist/csc-ui/p-9361fc3d.entry.js +2 -0
  28. package/dist/csc-ui/p-9361fc3d.entry.js.map +1 -0
  29. package/dist/csc-ui/p-d94b9e92.entry.js +2 -0
  30. package/dist/csc-ui/p-d94b9e92.entry.js.map +1 -0
  31. package/dist/esm/c-dropdown_4.entry.js +17 -28
  32. package/dist/esm/c-dropdown_4.entry.js.map +1 -1
  33. package/dist/esm/c-modal.entry.js +2 -0
  34. package/dist/esm/c-modal.entry.js.map +1 -1
  35. package/dist/esm/c-select.entry.js +2 -0
  36. package/dist/esm/c-select.entry.js.map +1 -1
  37. package/dist/styles/css/typography.css +1 -1
  38. package/dist/styles/scss/_typography.scss +1 -1
  39. package/dist/types/components/c-dropdown/c-dropdown.d.ts +1 -4
  40. package/package.json +1 -1
  41. package/dist/csc-ui/p-41b19864.entry.js +0 -2
  42. package/dist/csc-ui/p-41b19864.entry.js.map +0 -1
  43. package/dist/csc-ui/p-5a6adec0.entry.js +0 -2
  44. package/dist/csc-ui/p-5a6adec0.entry.js.map +0 -1
@@ -99,6 +99,8 @@ const CSelect = class {
99
99
  }
100
100
  _valueChangedHandler(item) {
101
101
  var _a;
102
+ if (!item)
103
+ return;
102
104
  if (this.hasOptionItems && this.optionAsSelection) {
103
105
  const selection = this._cOptionElements[item.value.toString()];
104
106
  if (!selection)
@@ -1 +1 @@
1
- {"file":"c-select.entry.js","mappings":";;;AAAA,MAAM,UAAU,GAAG,kvHAAkvH;;MC2BxvH,OAAO;;;;;;;;;;;IAuHV,cAAS,GACf,EAAE,CAAC;IAIG,qBAAgB,GAAuC,EAAE,CAAC;IAM1D,yBAAoB,GAAG,CAAC,eAAe,CAAC,CAAC;IAIzC,uBAAkB,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAE5C,cAAS,GAAG,IAAI,CAAC;IAEjB,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,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IAAI,EAAE,IAAI,CAAC,IAAI,EACf,EAAE,EAAE,IAAI,CAAC,MAAM,cACL,IAAI,CAAC,QAAQ,qBACN,IAAI,CAAC,YAAY,EAClC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,sBACL,IAAI,CAAC,cAAc,EACrC,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAC,QAAQ,EAChB,WAAW,EAAE,MAAM,IAAI,CAAC,SAAS,EAAE,IAEnC,YAAM,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,GAAQ,EAEnC,WAAK,KAAK,EAAC,kBAAkB,IAC1B,IAAI,CAAC,mBAAmB,EAAE,EAC1B,IAAI,CAAC,cAAc,EAAE,EAEtB,YAAM,YAAY,EAAE,IAAI,CAAC,iBAAiB,GAAS,CAC/C,EAEN,YAAM,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,GAAQ,CAC7B,CACL,EACP;GACH;;;;;;;;;AA1cc,iBAAS,GAAG,CAAH,CAAK;;;;;","names":[],"sources":["src/components/c-select/c-select.scss?tag=c-select&encapsulation=shadow","src/components/c-select/c-select.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-select-active-color: Active select color\n * @prop --c-select-inactive-color: Inactive select color\n * @prop --c-select-background-color: Inactive select background color\n * @prop --c-select-text-color: Select text color\n * @prop --c-select-placeholder-color: Select placeholder color\n * @prop --c-select-option-background-color: Select option background color\n * @prop --c-select-option-background-color-hover: Select option hover background color\n * @prop --c-select-option-text-color: Select option text color\n */\n --_c-select-active-color: var(--c-select-active-color, var(--c-primary-600));\n --_c-select-inactive-color: var(--c-select-inactive-color, var(--c-tertiary-600));\n --_c-select-background-color: var(--c-select-background-color, var(--c-transparent));\n --_c-select-text-color: var(--c-select-text-color, var(--c-text-body));\n --_c-select-placeholder-color: var(--c-select-placeholder-color, var(--c-tertiary-500));\n --_c-select-option-background-color: var(--c-select-option-background-color, var(--c-white));\n --_c-select-option-background-color-hover: var(--c-select-option-background-color-hover, var(--c-primary-100));\n --_c-select-option-text-color: var(--c-select-option-text-color, var(--c-text-body));\n\n // private\n --_c-input-active-color: var(--_c-select-active-color);\n --_c-input-inactive-color: var(--_c-select-inactive-color);\n --_c-input-background-color: var(--_c-select-background-color);\n --_c-input-text-color: var(--_c-select-text-color);\n --_c-input-placeholder-color: var(--_c-select-placeholder-color);\n}\n\n@import \"../c-input/c-input-menu\";\n","import {\n AttachInternals,\n Component,\n Element,\n Host,\n Prop,\n State,\n h,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\nimport { mdiChevronDown } from '@mdi/js';\nimport { CSelectItem } from '../../types';\n\n/**\n * @group Form\n * @slot Default slot - Use c-option elements only\n */\n@Component({\n tag: 'c-select',\n styleUrl: 'c-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CSelect {\n // eslint-disable-next-line\n @AttachInternals() internals: ElementInternals;\n\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 * 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 element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Set as required\n */\n @Prop() required = false;\n\n /**\n * Return only the item value rather than the whole item object\n */\n @Prop() returnValue: false;\n\n /**\n * Set the validity 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 * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\n\n /**\n * Selected item\n */\n @Prop({ mutable: true }) value: string | number | boolean | CSelectItem =\n null;\n\n /**\n * selectable items\n */\n @Prop() items: CSelectItem[] = [];\n\n /**\n * display the option as selection (works only when c-option elements are used)\n */\n @Prop() optionAsSelection: false;\n\n /**\n * Triggered when an item is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @Element() host: HTMLCSelectElement;\n\n @State() menuVisible = false;\n\n @State() currentIndex: number = null;\n\n @State() activeListItemId: string = null;\n\n @State() statusText = '';\n\n @State() hasOptionItems = false;\n\n @State() previousValue: CSelectItem = { value: '', name: '' };\n\n private _itemRefs: { value: string | number | boolean; ref: HTMLElement }[] =\n [];\n\n private _id: string;\n\n private _cOptionElements: Record<string, HTMLCOptionElement> = {};\n\n private _selectionElement: HTMLDivElement;\n\n private _cInput: HTMLCInputElement;\n\n private _outerWrapperClasses = ['outer-wrapper'];\n\n private static _uniqueId = 0;\n\n private _validationClasses = ['validation-message'];\n\n private _debounce = null;\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 @Watch('value')\n onValueChange() {\n if (!this.value) return;\n\n const realValue = !(this.value as CSelectItem)?.value\n ? this._items.find((item) => item.value === this.value)\n : this.value;\n\n this._valueChangedHandler(realValue as CSelectItem);\n }\n\n @Watch('validate')\n validateChange(newValue: boolean) {\n if (newValue) {\n this._runValidate();\n }\n }\n\n @Watch('currentIndex')\n onCurrentIndexChange(index: number) {\n this.activeListItemId = this._itemRefs[index]?.ref?.id ?? null;\n\n this._scrollToElement();\n\n this._updateStatusText();\n }\n\n private get _items() {\n return this.hasOptionItems ? this._optionItems : this.items;\n }\n\n private _setValue(item: CSelectItem) {\n return this.returnValue\n ? item?.value\n : {\n name: item?.name,\n value: item?.value,\n };\n }\n\n private _valueChangedHandler(item: CSelectItem) {\n if (this.hasOptionItems && this.optionAsSelection) {\n const selection = this._cOptionElements[item.value.toString()];\n\n if (!selection) return;\n\n const clone = selection.cloneNode(true);\n\n this._selectionElement.classList.add('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(clone);\n }\n\n this.currentIndex = this._items.findIndex(\n (element) => element.value === item?.value,\n );\n\n const value = this._setValue(item);\n\n if (this.previousValue && this.previousValue?.value === item?.value) return;\n\n this.previousValue = item;\n\n this.changeValue.emit(value);\n\n this.internals.setFormValue(item.value as string);\n }\n\n private _getLabel() {\n if (!this.value) return '';\n\n if (\n this.returnValue &&\n ['number', 'string', 'boolean'].includes(typeof this.value)\n ) {\n return this._items?.find((item) => item.value === this.value)?.name;\n }\n\n return this._items?.find(\n (item) => item.value === (this.value as CSelectItem).value,\n )?.name;\n }\n\n private _scrollToElement() {\n if (this._items.length > this.itemsPerPage) {\n const itemRef = this._itemRefs.find(\n (item) => item.value === this._items[this.currentIndex]?.value,\n )?.ref;\n\n if (!!itemRef) {\n this._observer.observe(itemRef);\n }\n }\n }\n\n @Listen('keydown', { capture: true })\n handleKeyDown(ev: KeyboardEvent) {\n if (this.disabled) return;\n\n const letterNumber = /^[0-9a-zA-Z]+$/;\n\n if (ev.key.match(letterNumber) && ev.key.length === 1) {\n if (\n Date.now() - this._lastKeyPressTime > 3000 ||\n this._searchString.length > 2\n ) {\n this._searchString = ev.key;\n } else {\n this._searchString = `${this._searchString}${ev.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 function isItem(element) {\n return element === selectedItem;\n }\n\n if (selectedItem) {\n if (this.menuVisible) {\n this.currentIndex = this._items.findIndex(isItem);\n this._scrollToElement();\n } else {\n this.value = selectedItem;\n }\n }\n }\n\n if (ev.key === 'Tab') {\n this._cInput.closeDropdown();\n }\n\n if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n\n this._showMenu();\n }\n\n if (ev.key === 'ArrowUp') {\n ev.preventDefault();\n\n this._showMenu();\n }\n\n if (ev.key === ' ') {\n ev.preventDefault();\n\n this._showMenu();\n }\n }\n\n /**\n * Select item by index\n */\n @Method()\n async onItemSelection(index: number) {\n this.currentIndex = index;\n\n this._selectItem();\n }\n\n /**\n * Hide menu\n * @private\n */\n @Method()\n async onHideMenu() {\n this.menuVisible = false;\n }\n\n componentWillLoad() {\n CSelect._uniqueId += 1;\n\n this._id =\n this.hostId?.replace(/[^a-zA-Z0-9-_]/g, '') ??\n CSelect._uniqueId.toString();\n\n this._inputId =\n 'input-' +\n (this.hostId || this.label || this.placeholder)\n .replace(/[^a-zA-Z0-9-_]/g, '')\n .toLowerCase();\n\n this._setInitialValue();\n }\n\n private _setInitialValue() {\n if (!this.value) return;\n\n const value = this.returnValue\n ? this.value\n : (this.value as CSelectItem).value;\n\n this.internals.setFormValue(value as string);\n }\n\n componentDidLoad() {\n this._getOptionItems();\n\n if (\n (this.value || typeof this.value === 'boolean') &&\n !this.currentIndex &&\n this.currentIndex !== 0\n ) {\n this.currentIndex = this._items.findIndex(\n (item) => item.value === this.value,\n );\n }\n\n requestAnimationFrame(() => {\n this._cInput.createDropdown({\n type: 'select',\n items: this._items,\n options: this._cOptionElements,\n parent: this.host,\n itemsPerPage: this.itemsPerPage,\n index: this.currentIndex,\n click: false,\n id: this._inputId,\n });\n });\n }\n\n disconnectedCallback() {\n this._observer.disconnect();\n }\n\n private _inputId: string;\n\n private _lastKeyPressTime = null;\n\n private _searchString = '';\n\n private _blurred = false;\n\n private _optionItems: CSelectItem[] = [];\n\n private _inputElement: HTMLInputElement;\n\n private _selectItem() {\n const selectedItem = this._items[this.currentIndex];\n\n this.value = selectedItem;\n\n this._scrollToElement();\n }\n\n /**\n * @private\n */\n @Method()\n async setActiveDescendant(id: string) {\n this._inputElement.setAttribute('aria-activedescendant', id);\n }\n\n private _showMenu() {\n if (this.disabled) return;\n\n this.menuVisible = true;\n this._cInput.openDropdown();\n }\n\n private _getOptionItems() {\n requestAnimationFrame(() => {\n this._cOptionElements = {};\n\n let selection: CSelectItem | null = null;\n\n this._optionItems = (\n this.host ? Array.from(this.host.querySelectorAll('c-option')) : []\n ).map((item, index) => {\n const cSelectItem = {\n value: item.value,\n name: item.name || item.innerText,\n disabled: !!item.disabled,\n } as CSelectItem;\n\n if (item.selected) {\n selection = cSelectItem;\n }\n\n item.slot = `option-${index}`;\n\n this._cOptionElements[item.value.toString()] = item;\n\n return cSelectItem;\n });\n\n this.hasOptionItems = !!this._optionItems.length;\n\n if (selection) {\n this._valueChangedHandler(selection);\n }\n });\n }\n\n private _runValidate() {\n if (\n this.required &&\n !this.value &&\n (this._blurred || !this.validateOnBlur)\n ) {\n this._outerWrapperClasses.push('required');\n this._validationClasses.push('show');\n } else {\n this._outerWrapperClasses = this._outerWrapperClasses.filter(\n (c) => c !== 'required',\n );\n this._validationClasses = this._validationClasses.filter(\n (c) => c !== 'show',\n );\n }\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.menuVisible,\n };\n\n return (\n <svg class={classes} viewBox=\"0 0 24 24\">\n <path d={mdiChevronDown} />\n </svg>\n );\n }\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n aria-controls={this._inputId + '-items'}\n aria-expanded={this.menuVisible.toString()}\n aria-readonly=\"true\"\n aria-haspopup=\"listbox\"\n ref={(el) => (this._inputElement = el)}\n id={this._inputId}\n autocomplete=\"off\"\n class=\"c-input__input\"\n type=\"text\"\n value={this._getLabel() ?? null}\n name={this.name ?? null}\n readonly=\"true\"\n />\n\n <div\n ref={(el) => (this._selectionElement = el)}\n class=\"c-input-menu__selection\"\n />\n </div>\n );\n }\n\n private _handleSlotChange = () => {\n this._getOptionItems();\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.host.shadowRoot.querySelector(\n 'li[aria-selected=\"true\"]',\n ) as HTMLLIElement;\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 const selectionText = !!selection\n ? `${beginning}${selection.dataset.value} - ${selection.ariaPosInSet} of ${selection.ariaSetSize} is highlighted`\n : null;\n\n this.statusText = `${selectionText || ending}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n return (\n <Host title={this._getLabel() ?? null}>\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\n <c-input\n ref={(el) => (this._cInput = el)}\n autofocus={this.autofocus}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n itemns-per-page={this.itemsPerPage}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n required={this.required}\n shadow={this.shadow}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.value}\n variant=\"select\"\n onItemClick={() => this._showMenu()}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n {this._renderChevron()}\n\n <slot onSlotchange={this._handleSlotChange}></slot>\n </div>\n\n <slot name=\"post\" slot=\"post\"></slot>\n </c-input>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"c-select.entry.js","mappings":";;;AAAA,MAAM,UAAU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AI,CAAC,iBAAiB,GAAS,CAC/C,EAEN,YAAM,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,GAAQ,CAC7B,CACL,EACP;GACH;;;;;;;;;AA5cc,iBAAS,GAAG,CAAH,CAAK;;;;;","names":[],"sources":["src/components/c-select/c-select.scss?tag=c-select&encapsulation=shadow","src/components/c-select/c-select.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-select-active-color: Active select color\n * @prop --c-select-inactive-color: Inactive select color\n * @prop --c-select-background-color: Inactive select background color\n * @prop --c-select-text-color: Select text color\n * @prop --c-select-placeholder-color: Select placeholder color\n * @prop --c-select-option-background-color: Select option background color\n * @prop --c-select-option-background-color-hover: Select option hover background color\n * @prop --c-select-option-text-color: Select option text color\n */\n --_c-select-active-color: var(--c-select-active-color, var(--c-primary-600));\n --_c-select-inactive-color: var(--c-select-inactive-color, var(--c-tertiary-600));\n --_c-select-background-color: var(--c-select-background-color, var(--c-transparent));\n --_c-select-text-color: var(--c-select-text-color, var(--c-text-body));\n --_c-select-placeholder-color: var(--c-select-placeholder-color, var(--c-tertiary-500));\n --_c-select-option-background-color: var(--c-select-option-background-color, var(--c-white));\n --_c-select-option-background-color-hover: var(--c-select-option-background-color-hover, var(--c-primary-100));\n --_c-select-option-text-color: var(--c-select-option-text-color, var(--c-text-body));\n\n // private\n --_c-input-active-color: var(--_c-select-active-color);\n --_c-input-inactive-color: var(--_c-select-inactive-color);\n --_c-input-background-color: var(--_c-select-background-color);\n --_c-input-text-color: var(--_c-select-text-color);\n --_c-input-placeholder-color: var(--_c-select-placeholder-color);\n}\n\n@import \"../c-input/c-input-menu\";\n","import {\n AttachInternals,\n Component,\n Element,\n Host,\n Prop,\n State,\n h,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\nimport { mdiChevronDown } from '@mdi/js';\nimport { CSelectItem } from '../../types';\n\n/**\n * @group Form\n * @slot Default slot - Use c-option elements only\n */\n@Component({\n tag: 'c-select',\n styleUrl: 'c-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CSelect {\n // eslint-disable-next-line\n @AttachInternals() internals: ElementInternals;\n\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 * 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 element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Set as required\n */\n @Prop() required = false;\n\n /**\n * Return only the item value rather than the whole item object\n */\n @Prop() returnValue: false;\n\n /**\n * Set the validity 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 * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\n\n /**\n * Selected item\n */\n @Prop({ mutable: true }) value: string | number | boolean | CSelectItem =\n null;\n\n /**\n * selectable items\n */\n @Prop() items: CSelectItem[] = [];\n\n /**\n * display the option as selection (works only when c-option elements are used)\n */\n @Prop() optionAsSelection: false;\n\n /**\n * Triggered when an item is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @Element() host: HTMLCSelectElement;\n\n @State() menuVisible = false;\n\n @State() currentIndex: number = null;\n\n @State() activeListItemId: string = null;\n\n @State() statusText = '';\n\n @State() hasOptionItems = false;\n\n @State() previousValue: CSelectItem = { value: '', name: '' };\n\n private _itemRefs: { value: string | number | boolean; ref: HTMLElement }[] =\n [];\n\n private _id: string;\n\n private _cOptionElements: Record<string, HTMLCOptionElement> = {};\n\n private _selectionElement: HTMLDivElement;\n\n private _cInput: HTMLCInputElement;\n\n private _outerWrapperClasses = ['outer-wrapper'];\n\n private static _uniqueId = 0;\n\n private _validationClasses = ['validation-message'];\n\n private _debounce = null;\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 @Watch('value')\n onValueChange() {\n if (!this.value) return;\n\n const realValue = !(this.value as CSelectItem)?.value\n ? this._items.find((item) => item.value === this.value)\n : this.value;\n\n this._valueChangedHandler(realValue as CSelectItem);\n }\n\n @Watch('validate')\n validateChange(newValue: boolean) {\n if (newValue) {\n this._runValidate();\n }\n }\n\n @Watch('currentIndex')\n onCurrentIndexChange(index: number) {\n this.activeListItemId = this._itemRefs[index]?.ref?.id ?? null;\n\n this._scrollToElement();\n\n this._updateStatusText();\n }\n\n private get _items() {\n return this.hasOptionItems ? this._optionItems : this.items;\n }\n\n private _setValue(item: CSelectItem) {\n return this.returnValue\n ? item?.value\n : {\n name: item?.name,\n value: item?.value,\n };\n }\n\n private _valueChangedHandler(item: CSelectItem) {\n if (!item) return;\n\n if (this.hasOptionItems && this.optionAsSelection) {\n const selection = this._cOptionElements[item.value.toString()];\n\n if (!selection) return;\n\n const clone = selection.cloneNode(true);\n\n this._selectionElement.classList.add('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(clone);\n }\n\n this.currentIndex = this._items.findIndex(\n (element) => element.value === item?.value,\n );\n\n const value = this._setValue(item);\n\n if (this.previousValue && this.previousValue?.value === item?.value) return;\n\n this.previousValue = item;\n\n this.changeValue.emit(value);\n\n this.internals.setFormValue(item.value as string);\n }\n\n private _getLabel() {\n if (!this.value) return '';\n\n if (\n this.returnValue &&\n ['number', 'string', 'boolean'].includes(typeof this.value)\n ) {\n return this._items?.find((item) => item.value === this.value)?.name;\n }\n\n return this._items?.find(\n (item) => item.value === (this.value as CSelectItem).value,\n )?.name;\n }\n\n private _scrollToElement() {\n if (this._items.length > this.itemsPerPage) {\n const itemRef = this._itemRefs.find(\n (item) => item.value === this._items[this.currentIndex]?.value,\n )?.ref;\n\n if (!!itemRef) {\n this._observer.observe(itemRef);\n }\n }\n }\n\n @Listen('keydown', { capture: true })\n handleKeyDown(ev: KeyboardEvent) {\n if (this.disabled) return;\n\n const letterNumber = /^[0-9a-zA-Z]+$/;\n\n if (ev.key.match(letterNumber) && ev.key.length === 1) {\n if (\n Date.now() - this._lastKeyPressTime > 3000 ||\n this._searchString.length > 2\n ) {\n this._searchString = ev.key;\n } else {\n this._searchString = `${this._searchString}${ev.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 function isItem(element) {\n return element === selectedItem;\n }\n\n if (selectedItem) {\n if (this.menuVisible) {\n this.currentIndex = this._items.findIndex(isItem);\n this._scrollToElement();\n } else {\n this.value = selectedItem;\n }\n }\n }\n\n if (ev.key === 'Tab') {\n this._cInput.closeDropdown();\n }\n\n if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n\n this._showMenu();\n }\n\n if (ev.key === 'ArrowUp') {\n ev.preventDefault();\n\n this._showMenu();\n }\n\n if (ev.key === ' ') {\n ev.preventDefault();\n\n this._showMenu();\n }\n }\n\n /**\n * Select item by index\n */\n @Method()\n async onItemSelection(index: number) {\n this.currentIndex = index;\n\n this._selectItem();\n }\n\n /**\n * Hide menu\n * @private\n */\n @Method()\n async onHideMenu() {\n this.menuVisible = false;\n }\n\n componentWillLoad() {\n CSelect._uniqueId += 1;\n\n this._id =\n this.hostId?.replace(/[^a-zA-Z0-9-_]/g, '') ??\n CSelect._uniqueId.toString();\n\n this._inputId =\n 'input-' +\n (this.hostId || this.label || this.placeholder)\n .replace(/[^a-zA-Z0-9-_]/g, '')\n .toLowerCase();\n\n this._setInitialValue();\n }\n\n private _setInitialValue() {\n if (!this.value) return;\n\n const value = this.returnValue\n ? this.value\n : (this.value as CSelectItem).value;\n\n this.internals.setFormValue(value as string);\n }\n\n componentDidLoad() {\n this._getOptionItems();\n\n if (\n (this.value || typeof this.value === 'boolean') &&\n !this.currentIndex &&\n this.currentIndex !== 0\n ) {\n this.currentIndex = this._items.findIndex(\n (item) => item.value === this.value,\n );\n }\n\n requestAnimationFrame(() => {\n this._cInput.createDropdown({\n type: 'select',\n items: this._items,\n options: this._cOptionElements,\n parent: this.host,\n itemsPerPage: this.itemsPerPage,\n index: this.currentIndex,\n click: false,\n id: this._inputId,\n });\n });\n }\n\n disconnectedCallback() {\n this._observer.disconnect();\n }\n\n private _inputId: string;\n\n private _lastKeyPressTime = null;\n\n private _searchString = '';\n\n private _blurred = false;\n\n private _optionItems: CSelectItem[] = [];\n\n private _inputElement: HTMLInputElement;\n\n private _selectItem() {\n const selectedItem = this._items[this.currentIndex];\n\n this.value = selectedItem;\n\n this._scrollToElement();\n }\n\n /**\n * @private\n */\n @Method()\n async setActiveDescendant(id: string) {\n this._inputElement.setAttribute('aria-activedescendant', id);\n }\n\n private _showMenu() {\n if (this.disabled) return;\n\n this.menuVisible = true;\n this._cInput.openDropdown();\n }\n\n private _getOptionItems() {\n requestAnimationFrame(() => {\n this._cOptionElements = {};\n\n let selection: CSelectItem | null = null;\n\n this._optionItems = (\n this.host ? Array.from(this.host.querySelectorAll('c-option')) : []\n ).map((item, index) => {\n const cSelectItem = {\n value: item.value,\n name: item.name || item.innerText,\n disabled: !!item.disabled,\n } as CSelectItem;\n\n if (item.selected) {\n selection = cSelectItem;\n }\n\n item.slot = `option-${index}`;\n\n this._cOptionElements[item.value.toString()] = item;\n\n return cSelectItem;\n });\n\n this.hasOptionItems = !!this._optionItems.length;\n\n if (selection) {\n this._valueChangedHandler(selection);\n }\n });\n }\n\n private _runValidate() {\n if (\n this.required &&\n !this.value &&\n (this._blurred || !this.validateOnBlur)\n ) {\n this._outerWrapperClasses.push('required');\n this._validationClasses.push('show');\n } else {\n this._outerWrapperClasses = this._outerWrapperClasses.filter(\n (c) => c !== 'required',\n );\n this._validationClasses = this._validationClasses.filter(\n (c) => c !== 'show',\n );\n }\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.menuVisible,\n };\n\n return (\n <svg class={classes} viewBox=\"0 0 24 24\">\n <path d={mdiChevronDown} />\n </svg>\n );\n }\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n aria-controls={this._inputId + '-items'}\n aria-expanded={this.menuVisible.toString()}\n aria-readonly=\"true\"\n aria-haspopup=\"listbox\"\n ref={(el) => (this._inputElement = el)}\n id={this._inputId}\n autocomplete=\"off\"\n class=\"c-input__input\"\n type=\"text\"\n value={this._getLabel() ?? null}\n name={this.name ?? null}\n readonly=\"true\"\n />\n\n <div\n ref={(el) => (this._selectionElement = el)}\n class=\"c-input-menu__selection\"\n />\n </div>\n );\n }\n\n private _handleSlotChange = () => {\n this._getOptionItems();\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.host.shadowRoot.querySelector(\n 'li[aria-selected=\"true\"]',\n ) as HTMLLIElement;\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 const selectionText = !!selection\n ? `${beginning}${selection.dataset.value} - ${selection.ariaPosInSet} of ${selection.ariaSetSize} is highlighted`\n : null;\n\n this.statusText = `${selectionText || ending}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n return (\n <Host title={this._getLabel() ?? null}>\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\n <c-input\n ref={(el) => (this._cInput = el)}\n autofocus={this.autofocus}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n itemns-per-page={this.itemsPerPage}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n required={this.required}\n shadow={this.shadow}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.value}\n variant=\"select\"\n onItemClick={() => this._showMenu()}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n {this._renderChevron()}\n\n <slot onSlotchange={this._handleSlotChange}></slot>\n </div>\n\n <slot name=\"post\" slot=\"post\"></slot>\n </c-input>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 01 Nov 2023 10:44:39 GMT
3
+ * Generated on Mon, 06 Nov 2023 12:18:41 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Do not edit directly
3
- // Generated on Wed, 01 Nov 2023 10:44:39 GMT
3
+ // Generated on Mon, 06 Nov 2023 12:18:41 GMT
4
4
 
5
5
  $c-font-family: 'museo-sans', sans-serif;
6
6
  $c-text-body: var(--c-primary-900);
@@ -32,8 +32,7 @@ export declare class CDropdown {
32
32
  private _itemRefs;
33
33
  private _lastKeyPressTime;
34
34
  private _listElement;
35
- private _onScrollFn;
36
- private _parentTop;
35
+ private _dialogElement;
37
36
  private _openedOnTop;
38
37
  private _searchString;
39
38
  private _resizeObserver;
@@ -51,10 +50,8 @@ export declare class CDropdown {
51
50
  private _onSelect;
52
51
  private _getParentPosition;
53
52
  private _positionMenu;
54
- private _removeEventListeners;
55
53
  private _createEventListeners;
56
54
  private _scrollToElement;
57
- private _onScroll;
58
55
  private _onKeyDown;
59
56
  private _onKeyboardNavigation;
60
57
  private _handleCurrentIndexChange;
package/package.json CHANGED
@@ -91,5 +91,5 @@
91
91
  },
92
92
  "types": "dist/types/index.d.ts",
93
93
  "unpkg": "dist/csc-ui/csc-ui.esm.js",
94
- "version": "1.0.3"
94
+ "version": "1.0.4"
95
95
  }
@@ -1,2 +0,0 @@
1
- import{r as t,c as i,h as e,H as s,g as o}from"./p-9d54e9a4.js";import{g as n}from"./p-dffa1f9f.js";const r="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-select-active-color:var(--c-select-active-color, var(--c-primary-600));--_c-select-inactive-color:var(--c-select-inactive-color, var(--c-tertiary-600));--_c-select-background-color:var(--c-select-background-color, var(--c-transparent));--_c-select-text-color:var(--c-select-text-color, var(--c-text-body));--_c-select-placeholder-color:var(--c-select-placeholder-color, var(--c-tertiary-500));--_c-select-option-background-color:var(--c-select-option-background-color, var(--c-white));--_c-select-option-background-color-hover:var(--c-select-option-background-color-hover, var(--c-primary-100));--_c-select-option-text-color:var(--c-select-option-text-color, var(--c-text-body));--_c-input-active-color:var(--_c-select-active-color);--_c-input-inactive-color:var(--_c-select-inactive-color);--_c-input-background-color:var(--_c-select-background-color);--_c-input-text-color:var(--_c-select-text-color);--_c-input-placeholder-color:var(--_c-select-placeholder-color)}:host{display:block;cursor:text}.c-input-menu__chevron{fill:currentColor;height:22px;width:22px;min-width:22px;transform:rotate(0deg);transition:transform 0.3s ease-in-out}.c-input-menu__chevron--active{transform:rotate(180deg)}.c-input-menu__input{width:100%;display:flex;justify-items:stretch}.c-input-menu__selection{display:none;pointer-events:none}.c-input-menu__selection--show{align-items:center;display:flex;width:100%;color:var(--_c-select-active-color)}.c-input-menu__item-wrapper{position:absolute;width:100%;top:44px;z-index:10;margin-left:calc(var(--_c-input-label-position) * -1)}.c-input-menu__item-wrapper--shadow{top:47px}.c-input-menu__items{position:absolute;background-color:var(--_c-select-option-background-color);min-width:calc(100% + 24px);box-shadow:0 8px 16px 0 rgba(0, 0, 0, 0.2);z-index:10;user-select:none;border-radius:4px;margin:0 -12px;overflow-y:scroll;list-style:none;padding:0}.c-input-menu__items--hidden{display:none}.c-input-menu__items li{cursor:pointer;display:flex;min-height:48px;padding:0 12px;transition:background-color 0.3s;font-size:14px;align-items:center;justify-content:flex-start;color:var(--_c-select-option-text-color)}.c-input-menu__items li.disabled{background-color:var(--c-tertiary-100);filter:grayscale(1) opacity(0.6);cursor:default}.c-input-menu__items li.disabled:hover{background-color:var(--c-tertiary-100)}.c-input-menu__items li.dense{padding:10px 14px}.c-input-menu__items li:hover{background-color:var(--_c-select-option-background-color-hover)}.c-input-menu__items li[aria-selected=true]{background-color:var(--_c-select-option-background-color-hover);box-shadow:inset 0 0 0 1px var(--_c-select-active-color);border-radius:4px;backface-visibility:hidden;transform:translate3d(0, 0, 0)}.c-input-menu__items li.none{color:rgba(0, 0, 0, 0.5)}.c-input-menu__items--empty li{color:var(--c-text-system);cursor:default;gap:8px;pointer-events:none}.c-input-menu__items--empty li svg{fill:var(--c-warning-600);height:18px;width:18px}input{max-height:32px;padding:8px 0;background-color:transparent;border:none;color:var(--c-text-body);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%;pointer-events:none}input:focus,input:active{outline:none}input::-ms-reveal{display:none}svg{fill:currentColor;height:22px;width:22px}.c-input--disabled{color:var(--c-tertiary-400)}.c-input:focus-within{color:var(--c-primary-600)}.c-input--error{color:var(--c-error-600)}.c-input--error:focus-within{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}";const l=class{constructor(e){t(this,e);this.changeValue=i(this,"changeValue",3);if(e.$hostElement$["s-ei"]){this.internals=e.$hostElement$["s-ei"]}else{this.internals=e.$hostElement$.attachInternals();e.$hostElement$["s-ei"]=this.internals}this._itemRefs=[];this._cOptionElements={};this._outerWrapperClasses=["outer-wrapper"];this._validationClasses=["validation-message"];this._debounce=null;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._lastKeyPressTime=null;this._searchString="";this._blurred=false;this._optionItems=[];this._handleSlotChange=()=>{this._getOptionItems()};this.autofocus=false;this.disabled=false;this.hideDetails=false;this.hint="";this.hostId=undefined;this.label=undefined;this.shadow=false;this.name=undefined;this.required=false;this.returnValue=undefined;this.valid=true;this.validate=false;this.validateOnBlur=false;this.validation="Required field";this.itemsPerPage=6;this.placeholder="";this.value=null;this.items=[];this.optionAsSelection=undefined;this.menuVisible=false;this.currentIndex=null;this.activeListItemId=null;this.statusText="";this.hasOptionItems=false;this.previousValue={value:"",name:""}}onValueChange(){var t;if(!this.value)return;const i=!((t=this.value)===null||t===void 0?void 0:t.value)?this._items.find((t=>t.value===this.value)):this.value;this._valueChangedHandler(i)}validateChange(t){if(t){this._runValidate()}}onCurrentIndexChange(t){var i,e,s;this.activeListItemId=(s=(e=(i=this._itemRefs[t])===null||i===void 0?void 0:i.ref)===null||e===void 0?void 0:e.id)!==null&&s!==void 0?s:null;this._scrollToElement();this._updateStatusText()}get _items(){return this.hasOptionItems?this._optionItems:this.items}_setValue(t){return this.returnValue?t===null||t===void 0?void 0:t.value:{name:t===null||t===void 0?void 0:t.name,value:t===null||t===void 0?void 0:t.value}}_valueChangedHandler(t){var i;if(this.hasOptionItems&&this.optionAsSelection){const i=this._cOptionElements[t.value.toString()];if(!i)return;const e=i.cloneNode(true);this._selectionElement.classList.add("c-input-menu__selection--show");this._selectionElement.replaceChildren(e)}this.currentIndex=this._items.findIndex((i=>i.value===(t===null||t===void 0?void 0:t.value)));const e=this._setValue(t);if(this.previousValue&&((i=this.previousValue)===null||i===void 0?void 0:i.value)===(t===null||t===void 0?void 0:t.value))return;this.previousValue=t;this.changeValue.emit(e);this.internals.setFormValue(t.value)}_getLabel(){var t,i,e,s;if(!this.value)return"";if(this.returnValue&&["number","string","boolean"].includes(typeof this.value)){return(i=(t=this._items)===null||t===void 0?void 0:t.find((t=>t.value===this.value)))===null||i===void 0?void 0:i.name}return(s=(e=this._items)===null||e===void 0?void 0:e.find((t=>t.value===this.value.value)))===null||s===void 0?void 0:s.name}_scrollToElement(){var t;if(this._items.length>this.itemsPerPage){const i=(t=this._itemRefs.find((t=>{var i;return t.value===((i=this._items[this.currentIndex])===null||i===void 0?void 0:i.value)})))===null||t===void 0?void 0:t.ref;if(!!i){this._observer.observe(i)}}}handleKeyDown(t){if(this.disabled)return;const i=/^[0-9a-zA-Z]+$/;if(t.key.match(i)&&t.key.length===1){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 e=this._items.find((t=>t.name.toLowerCase().startsWith(this._searchString)));function s(t){return t===e}if(e){if(this.menuVisible){this.currentIndex=this._items.findIndex(s);this._scrollToElement()}else{this.value=e}}}if(t.key==="Tab"){this._cInput.closeDropdown()}if(t.key==="ArrowDown"){t.preventDefault();this._showMenu()}if(t.key==="ArrowUp"){t.preventDefault();this._showMenu()}if(t.key===" "){t.preventDefault();this._showMenu()}}async onItemSelection(t){this.currentIndex=t;this._selectItem()}async onHideMenu(){this.menuVisible=false}componentWillLoad(){var t,i;l._uniqueId+=1;this._id=(i=(t=this.hostId)===null||t===void 0?void 0:t.replace(/[^a-zA-Z0-9-_]/g,""))!==null&&i!==void 0?i:l._uniqueId.toString();this._inputId="input-"+(this.hostId||this.label||this.placeholder).replace(/[^a-zA-Z0-9-_]/g,"").toLowerCase();this._setInitialValue()}_setInitialValue(){if(!this.value)return;const t=this.returnValue?this.value:this.value.value;this.internals.setFormValue(t)}componentDidLoad(){this._getOptionItems();if((this.value||typeof this.value==="boolean")&&!this.currentIndex&&this.currentIndex!==0){this.currentIndex=this._items.findIndex((t=>t.value===this.value))}requestAnimationFrame((()=>{this._cInput.createDropdown({type:"select",items:this._items,options:this._cOptionElements,parent:this.host,itemsPerPage:this.itemsPerPage,index:this.currentIndex,click:false,id:this._inputId})}))}disconnectedCallback(){this._observer.disconnect()}_selectItem(){const t=this._items[this.currentIndex];this.value=t;this._scrollToElement()}async setActiveDescendant(t){this._inputElement.setAttribute("aria-activedescendant",t)}_showMenu(){if(this.disabled)return;this.menuVisible=true;this._cInput.openDropdown()}_getOptionItems(){requestAnimationFrame((()=>{this._cOptionElements={};let t=null;this._optionItems=(this.host?Array.from(this.host.querySelectorAll("c-option")):[]).map(((i,e)=>{const s={value:i.value,name:i.name||i.innerText,disabled:!!i.disabled};if(i.selected){t=s}i.slot=`option-${e}`;this._cOptionElements[i.value.toString()]=i;return s}));this.hasOptionItems=!!this._optionItems.length;if(t){this._valueChangedHandler(t)}}))}_runValidate(){if(this.required&&!this.value&&(this._blurred||!this.validateOnBlur)){this._outerWrapperClasses.push("required");this._validationClasses.push("show")}else{this._outerWrapperClasses=this._outerWrapperClasses.filter((t=>t!=="required"));this._validationClasses=this._validationClasses.filter((t=>t!=="show"))}}_renderChevron(){const t={"c-input-menu__chevron":true,"c-input-menu__chevron--active":this.menuVisible};return e("svg",{class:t,viewBox:"0 0 24 24"},e("path",{d:n}))}_renderInputElement(){var t,i;return e("div",{class:"c-input-menu__input"},e("input",{"aria-controls":this._inputId+"-items","aria-expanded":this.menuVisible.toString(),"aria-readonly":"true","aria-haspopup":"listbox",ref:t=>this._inputElement=t,id:this._inputId,autocomplete:"off",class:"c-input__input",type:"text",value:(t=this._getLabel())!==null&&t!==void 0?t:null,name:(i=this.name)!==null&&i!==void 0?i:null,readonly:"true"}),e("div",{ref:t=>this._selectionElement=t,class:"c-input-menu__selection"}))}_updateStatusText(){if(this._debounce!==null){clearTimeout(this._debounce);this._debounce=null}this._debounce=window.setTimeout((()=>{var t;const i=this.host.shadowRoot.querySelector('li[aria-selected="true"]');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 o=s?"Disabled option - ":"";const n=!!i?`${o}${i.dataset.value} - ${i.ariaPosInSet} of ${i.ariaSetSize} is highlighted`:null;this.statusText=`${n||e}`;this._debounce=null}),1400)}render(){var t;return e(s,{title:(t=this._getLabel())!==null&&t!==void 0?t:null},e("div",{id:"announce-"+this._id,class:"visuallyhidden","aria-live":"polite","aria-atomic":"true"},this.statusText),e("c-input",{ref:t=>this._cInput=t,autofocus:this.autofocus,disabled:this.disabled,"hide-details":this.hideDetails,hint:this.hint,id:this.hostId,"input-id":this._inputId,"itemns-per-page":this.itemsPerPage,label:this.label,name:this.name,placeholder:this.placeholder,required:this.required,shadow:this.shadow,valid:this.valid,validate:this.validate,"validate-on-blur":this.validateOnBlur,validation:this.validation,value:this.value,variant:"select",onItemClick:()=>this._showMenu()},e("slot",{name:"pre",slot:"pre"}),e("div",{class:"c-input__content"},this._renderInputElement(),this._renderChevron(),e("slot",{onSlotchange:this._handleSlotChange})),e("slot",{name:"post",slot:"post"})))}static get formAssociated(){return true}get host(){return o(this)}static get watchers(){return{value:["onValueChange"],validate:["validateChange"],currentIndex:["onCurrentIndexChange"]}}};l._uniqueId=0;l.style=r;export{l as c_select};
2
- //# sourceMappingURL=p-41b19864.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["cSelectCss","CSelect","this","_itemRefs","_cOptionElements","_outerWrapperClasses","_validationClasses","_debounce","_observer","IntersectionObserver","entries","observer","forEach","entry","isIntersecting","target","scrollIntoView","block","inline","unobserve","threshold","_lastKeyPressTime","_searchString","_blurred","_optionItems","_handleSlotChange","_getOptionItems","value","name","onValueChange","realValue","_a","_items","find","item","_valueChangedHandler","validateChange","newValue","_runValidate","onCurrentIndexChange","index","activeListItemId","_c","_b","ref","id","_scrollToElement","_updateStatusText","hasOptionItems","items","_setValue","returnValue","optionAsSelection","selection","toString","clone","cloneNode","_selectionElement","classList","add","replaceChildren","currentIndex","findIndex","element","previousValue","changeValue","emit","internals","setFormValue","_getLabel","includes","_d","length","itemsPerPage","itemRef","observe","handleKeyDown","ev","disabled","letterNumber","key","match","Date","now","selectedItem","i","toLowerCase","startsWith","isItem","menuVisible","_cInput","closeDropdown","preventDefault","_showMenu","onItemSelection","_selectItem","onHideMenu","componentWillLoad","_uniqueId","_id","hostId","replace","_inputId","label","placeholder","_setInitialValue","componentDidLoad","requestAnimationFrame","createDropdown","type","options","parent","host","click","disconnectedCallback","disconnect","setActiveDescendant","_inputElement","setAttribute","openDropdown","Array","from","querySelectorAll","map","cSelectItem","innerText","selected","slot","required","validateOnBlur","push","filter","c","_renderChevron","classes","h","class","viewBox","d","mdiChevronDown","_renderInputElement","el","autocomplete","readonly","clearTimeout","window","setTimeout","shadowRoot","querySelector","ending","isDisabled","contains","beginning","selectionText","dataset","ariaPosInSet","ariaSetSize","statusText","render","Host","title","autofocus","hideDetails","hint","shadow","valid","validate","validation","variant","onItemClick","onSlotchange"],"sources":["src/components/c-select/c-select.scss?tag=c-select&encapsulation=shadow","src/components/c-select/c-select.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-select-active-color: Active select color\n * @prop --c-select-inactive-color: Inactive select color\n * @prop --c-select-background-color: Inactive select background color\n * @prop --c-select-text-color: Select text color\n * @prop --c-select-placeholder-color: Select placeholder color\n * @prop --c-select-option-background-color: Select option background color\n * @prop --c-select-option-background-color-hover: Select option hover background color\n * @prop --c-select-option-text-color: Select option text color\n */\n --_c-select-active-color: var(--c-select-active-color, var(--c-primary-600));\n --_c-select-inactive-color: var(--c-select-inactive-color, var(--c-tertiary-600));\n --_c-select-background-color: var(--c-select-background-color, var(--c-transparent));\n --_c-select-text-color: var(--c-select-text-color, var(--c-text-body));\n --_c-select-placeholder-color: var(--c-select-placeholder-color, var(--c-tertiary-500));\n --_c-select-option-background-color: var(--c-select-option-background-color, var(--c-white));\n --_c-select-option-background-color-hover: var(--c-select-option-background-color-hover, var(--c-primary-100));\n --_c-select-option-text-color: var(--c-select-option-text-color, var(--c-text-body));\n\n // private\n --_c-input-active-color: var(--_c-select-active-color);\n --_c-input-inactive-color: var(--_c-select-inactive-color);\n --_c-input-background-color: var(--_c-select-background-color);\n --_c-input-text-color: var(--_c-select-text-color);\n --_c-input-placeholder-color: var(--_c-select-placeholder-color);\n}\n\n@import \"../c-input/c-input-menu\";\n","import {\n AttachInternals,\n Component,\n Element,\n Host,\n Prop,\n State,\n h,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\nimport { mdiChevronDown } from '@mdi/js';\nimport { CSelectItem } from '../../types';\n\n/**\n * @group Form\n * @slot Default slot - Use c-option elements only\n */\n@Component({\n tag: 'c-select',\n styleUrl: 'c-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CSelect {\n // eslint-disable-next-line\n @AttachInternals() internals: ElementInternals;\n\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 * 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 element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Set as required\n */\n @Prop() required = false;\n\n /**\n * Return only the item value rather than the whole item object\n */\n @Prop() returnValue: false;\n\n /**\n * Set the validity 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 * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\n\n /**\n * Selected item\n */\n @Prop({ mutable: true }) value: string | number | boolean | CSelectItem =\n null;\n\n /**\n * selectable items\n */\n @Prop() items: CSelectItem[] = [];\n\n /**\n * display the option as selection (works only when c-option elements are used)\n */\n @Prop() optionAsSelection: false;\n\n /**\n * Triggered when an item is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @Element() host: HTMLCSelectElement;\n\n @State() menuVisible = false;\n\n @State() currentIndex: number = null;\n\n @State() activeListItemId: string = null;\n\n @State() statusText = '';\n\n @State() hasOptionItems = false;\n\n @State() previousValue: CSelectItem = { value: '', name: '' };\n\n private _itemRefs: { value: string | number | boolean; ref: HTMLElement }[] =\n [];\n\n private _id: string;\n\n private _cOptionElements: Record<string, HTMLCOptionElement> = {};\n\n private _selectionElement: HTMLDivElement;\n\n private _cInput: HTMLCInputElement;\n\n private _outerWrapperClasses = ['outer-wrapper'];\n\n private static _uniqueId = 0;\n\n private _validationClasses = ['validation-message'];\n\n private _debounce = null;\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 @Watch('value')\n onValueChange() {\n if (!this.value) return;\n\n const realValue = !(this.value as CSelectItem)?.value\n ? this._items.find((item) => item.value === this.value)\n : this.value;\n\n this._valueChangedHandler(realValue as CSelectItem);\n }\n\n @Watch('validate')\n validateChange(newValue: boolean) {\n if (newValue) {\n this._runValidate();\n }\n }\n\n @Watch('currentIndex')\n onCurrentIndexChange(index: number) {\n this.activeListItemId = this._itemRefs[index]?.ref?.id ?? null;\n\n this._scrollToElement();\n\n this._updateStatusText();\n }\n\n private get _items() {\n return this.hasOptionItems ? this._optionItems : this.items;\n }\n\n private _setValue(item: CSelectItem) {\n return this.returnValue\n ? item?.value\n : {\n name: item?.name,\n value: item?.value,\n };\n }\n\n private _valueChangedHandler(item: CSelectItem) {\n if (this.hasOptionItems && this.optionAsSelection) {\n const selection = this._cOptionElements[item.value.toString()];\n\n if (!selection) return;\n\n const clone = selection.cloneNode(true);\n\n this._selectionElement.classList.add('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(clone);\n }\n\n this.currentIndex = this._items.findIndex(\n (element) => element.value === item?.value,\n );\n\n const value = this._setValue(item);\n\n if (this.previousValue && this.previousValue?.value === item?.value) return;\n\n this.previousValue = item;\n\n this.changeValue.emit(value);\n\n this.internals.setFormValue(item.value as string);\n }\n\n private _getLabel() {\n if (!this.value) return '';\n\n if (\n this.returnValue &&\n ['number', 'string', 'boolean'].includes(typeof this.value)\n ) {\n return this._items?.find((item) => item.value === this.value)?.name;\n }\n\n return this._items?.find(\n (item) => item.value === (this.value as CSelectItem).value,\n )?.name;\n }\n\n private _scrollToElement() {\n if (this._items.length > this.itemsPerPage) {\n const itemRef = this._itemRefs.find(\n (item) => item.value === this._items[this.currentIndex]?.value,\n )?.ref;\n\n if (!!itemRef) {\n this._observer.observe(itemRef);\n }\n }\n }\n\n @Listen('keydown', { capture: true })\n handleKeyDown(ev: KeyboardEvent) {\n if (this.disabled) return;\n\n const letterNumber = /^[0-9a-zA-Z]+$/;\n\n if (ev.key.match(letterNumber) && ev.key.length === 1) {\n if (\n Date.now() - this._lastKeyPressTime > 3000 ||\n this._searchString.length > 2\n ) {\n this._searchString = ev.key;\n } else {\n this._searchString = `${this._searchString}${ev.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 function isItem(element) {\n return element === selectedItem;\n }\n\n if (selectedItem) {\n if (this.menuVisible) {\n this.currentIndex = this._items.findIndex(isItem);\n this._scrollToElement();\n } else {\n this.value = selectedItem;\n }\n }\n }\n\n if (ev.key === 'Tab') {\n this._cInput.closeDropdown();\n }\n\n if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n\n this._showMenu();\n }\n\n if (ev.key === 'ArrowUp') {\n ev.preventDefault();\n\n this._showMenu();\n }\n\n if (ev.key === ' ') {\n ev.preventDefault();\n\n this._showMenu();\n }\n }\n\n /**\n * Select item by index\n */\n @Method()\n async onItemSelection(index: number) {\n this.currentIndex = index;\n\n this._selectItem();\n }\n\n /**\n * Hide menu\n * @private\n */\n @Method()\n async onHideMenu() {\n this.menuVisible = false;\n }\n\n componentWillLoad() {\n CSelect._uniqueId += 1;\n\n this._id =\n this.hostId?.replace(/[^a-zA-Z0-9-_]/g, '') ??\n CSelect._uniqueId.toString();\n\n this._inputId =\n 'input-' +\n (this.hostId || this.label || this.placeholder)\n .replace(/[^a-zA-Z0-9-_]/g, '')\n .toLowerCase();\n\n this._setInitialValue();\n }\n\n private _setInitialValue() {\n if (!this.value) return;\n\n const value = this.returnValue\n ? this.value\n : (this.value as CSelectItem).value;\n\n this.internals.setFormValue(value as string);\n }\n\n componentDidLoad() {\n this._getOptionItems();\n\n if (\n (this.value || typeof this.value === 'boolean') &&\n !this.currentIndex &&\n this.currentIndex !== 0\n ) {\n this.currentIndex = this._items.findIndex(\n (item) => item.value === this.value,\n );\n }\n\n requestAnimationFrame(() => {\n this._cInput.createDropdown({\n type: 'select',\n items: this._items,\n options: this._cOptionElements,\n parent: this.host,\n itemsPerPage: this.itemsPerPage,\n index: this.currentIndex,\n click: false,\n id: this._inputId,\n });\n });\n }\n\n disconnectedCallback() {\n this._observer.disconnect();\n }\n\n private _inputId: string;\n\n private _lastKeyPressTime = null;\n\n private _searchString = '';\n\n private _blurred = false;\n\n private _optionItems: CSelectItem[] = [];\n\n private _inputElement: HTMLInputElement;\n\n private _selectItem() {\n const selectedItem = this._items[this.currentIndex];\n\n this.value = selectedItem;\n\n this._scrollToElement();\n }\n\n /**\n * @private\n */\n @Method()\n async setActiveDescendant(id: string) {\n this._inputElement.setAttribute('aria-activedescendant', id);\n }\n\n private _showMenu() {\n if (this.disabled) return;\n\n this.menuVisible = true;\n this._cInput.openDropdown();\n }\n\n private _getOptionItems() {\n requestAnimationFrame(() => {\n this._cOptionElements = {};\n\n let selection: CSelectItem | null = null;\n\n this._optionItems = (\n this.host ? Array.from(this.host.querySelectorAll('c-option')) : []\n ).map((item, index) => {\n const cSelectItem = {\n value: item.value,\n name: item.name || item.innerText,\n disabled: !!item.disabled,\n } as CSelectItem;\n\n if (item.selected) {\n selection = cSelectItem;\n }\n\n item.slot = `option-${index}`;\n\n this._cOptionElements[item.value.toString()] = item;\n\n return cSelectItem;\n });\n\n this.hasOptionItems = !!this._optionItems.length;\n\n if (selection) {\n this._valueChangedHandler(selection);\n }\n });\n }\n\n private _runValidate() {\n if (\n this.required &&\n !this.value &&\n (this._blurred || !this.validateOnBlur)\n ) {\n this._outerWrapperClasses.push('required');\n this._validationClasses.push('show');\n } else {\n this._outerWrapperClasses = this._outerWrapperClasses.filter(\n (c) => c !== 'required',\n );\n this._validationClasses = this._validationClasses.filter(\n (c) => c !== 'show',\n );\n }\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.menuVisible,\n };\n\n return (\n <svg class={classes} viewBox=\"0 0 24 24\">\n <path d={mdiChevronDown} />\n </svg>\n );\n }\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n aria-controls={this._inputId + '-items'}\n aria-expanded={this.menuVisible.toString()}\n aria-readonly=\"true\"\n aria-haspopup=\"listbox\"\n ref={(el) => (this._inputElement = el)}\n id={this._inputId}\n autocomplete=\"off\"\n class=\"c-input__input\"\n type=\"text\"\n value={this._getLabel() ?? null}\n name={this.name ?? null}\n readonly=\"true\"\n />\n\n <div\n ref={(el) => (this._selectionElement = el)}\n class=\"c-input-menu__selection\"\n />\n </div>\n );\n }\n\n private _handleSlotChange = () => {\n this._getOptionItems();\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.host.shadowRoot.querySelector(\n 'li[aria-selected=\"true\"]',\n ) as HTMLLIElement;\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 const selectionText = !!selection\n ? `${beginning}${selection.dataset.value} - ${selection.ariaPosInSet} of ${selection.ariaSetSize} is highlighted`\n : null;\n\n this.statusText = `${selectionText || ending}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n return (\n <Host title={this._getLabel() ?? null}>\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\n <c-input\n ref={(el) => (this._cInput = el)}\n autofocus={this.autofocus}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n itemns-per-page={this.itemsPerPage}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n required={this.required}\n shadow={this.shadow}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.value}\n variant=\"select\"\n onItemClick={() => this._showMenu()}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n {this._renderChevron()}\n\n <slot onSlotchange={this._handleSlotChange}></slot>\n </div>\n\n <slot name=\"post\" slot=\"post\"></slot>\n </c-input>\n </Host>\n );\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAa,mvH,MC2BNC,EAAO,M,kOAuHVC,KAAAC,UACN,GAIMD,KAAAE,iBAAuD,GAMvDF,KAAAG,qBAAuB,CAAC,iBAIxBH,KAAAI,mBAAqB,CAAC,sBAEtBJ,KAAAK,UAAY,KAEZL,KAAAM,UAAY,IAAIC,sBACtB,CAACC,EAASC,KACRD,EAAQE,SAASC,IACf,IAAKA,EAAMC,eAAgB,CACzBD,EAAME,OAAOC,eAAe,CAC1BC,MAAO,UACPC,OAAQ,YAEVP,EAASQ,UAAUN,EAAME,O,KACpB,C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YAAatG,KAAKsG,YAClBwB,SAAU9H,KAAK8H,SACfoC,OAAQlK,KAAKkK,OACbC,MAAOnK,KAAKmK,MACZC,SAAUpK,KAAKoK,SAAQ,mBACLpK,KAAK+H,eACvBsC,WAAYrK,KAAKqK,WACjB5I,MAAOzB,KAAKyB,MACZ6I,QAAQ,SACRC,YAAa,IAAMvK,KAAK2F,aAExB0C,EAAA,QAAM3G,KAAK,MAAMmG,KAAK,QAEtBQ,EAAA,OAAKC,MAAM,oBACRtI,KAAK0I,sBACL1I,KAAKmI,iBAENE,EAAA,QAAMmC,aAAcxK,KAAKuB,qBAG3B8G,EAAA,QAAM3G,KAAK,OAAOmG,KAAK,U,6LAtchB9H,EAAAiG,UAAY,E"}
@@ -1,2 +0,0 @@
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{color:inherit;background-color:transparent;box-shadow:0 2px 0 0 var(--_c-dropdown-text-color-active)}:host ul{margin:0;padding:0;background-color:var(--_c-dropdown-background-color);list-style:none;box-shadow:2px 4px 10px rgba(0, 0, 0, 0.1607843137);width:100%;overflow-y:scroll;pointer-events:auto;border-radius:4px;visibility:hidden;outline:none;max-width:var(--_c-dropdown-width)}: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);padding-left:10px;padding-right:10px;outline:none;white-space:nowrap;pointer-events:auto;width:100%}:host li span{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}: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._parentTop=0;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.scrollingParent=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();this._removeEventListeners()}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("ul");t.role=`listbox`;t.ariaExpanded=this.isVisible.toString();t.tabIndex=-1;t.id=this._id;this._listElement=t;this.host.shadowRoot.appendChild(t);this.items.map(((t,i)=>this._renderMenuItem(t,i)));this.scrollingParent=this.wrapper;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}_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;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 t=this.scrollingParent.scrollTop;const i=this.scrollingParent.scrollLeft;const{top:e,bottom:s,left:n,width:o,height:r}=this._getParentPosition();this.host.style.top=`${s}px`;this.host.style.left=`${n}px`;this.host.style.minWidth=`${o}px`;this.bottomTranslate=0;this.host.style.removeProperty("transform");const{bottom:a,right:h,height:l,width:c}=this.host.getBoundingClientRect();this._parentTop=e;const d={x:h<this.scrollingParent.scrollWidth-i,y:a<this.scrollingParent.scrollHeight-t};if(!d.y||this._openedOnTop){this._openedOnTop=true;this.bottomTranslate=l+r;this.host.style.setProperty("transform",`translateY(-${this.bottomTranslate}px`)}this.host.style.setProperty("--_c-dropdown-width",`${o}px`);this.topPosition=s;if(!d.x){this.host.style.left=`${parseFloat(this.host.style.left)-c+o}px`}}_removeEventListeners(){this.scrollingParent.removeEventListener("scroll",this._onScrollFn)}_createEventListeners(){requestAnimationFrame((async()=>{this._onScrollFn=this._onScroll.bind(this);this.scrollingParent.addEventListener("scroll",this._onScrollFn);this._listElement.classList.add("active")}))}_scrollToElement(){if(this.items.length>this.itemsPerPage){const t=this._itemRefs[this.currentIndex];if(!!t){this._observer.observe(t)}}}_onScroll(){const{top:t}=this.parent.getBoundingClientRect();const i=this._parentTop-t;if(this._openedOnTop){this.host.style.setProperty("transform",`translateY(calc(-1 * ${this.bottomTranslate+i}px))`);return}this.host.style.top=`${this.topPosition-i}px`}_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.host)}disconnectedCallback(){this._resizeObserver.disconnect()}render(){if(this.itemsPerPage&&this.itemsPerPage>0&&this.items.length>this.itemsPerPage){this._listElement.style.maxHeight=42*(this.itemsPerPage+.5)+"px";this._listElement.style.overflowY="scroll"}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-5a6adec0.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["cDropdownCss","CDropdown","this","_id","_debounce","_itemRefs","_lastKeyPressTime","_parentTop","_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","_removeEventListeners","onCurrentIndexChange","_listSize","_firstSelectableIndex","findIndex","_lastSelectableIndex","findLastIndex","regex","RegExp","match","_renderEmptyItem","emptyElement","tabIndex","icon","path","mdiAlert","size","color","append","replaceChildren","map","_renderMenu","listElement","ariaExpanded","isVisible","host","shadowRoot","scrollingParent","wrapper","_onKeyboardNavigation","bind","_onKeyDown","focusInput","onHideMenu","isOpen","onItemSelection","i","_getParentPosition","getBoundingClientRect","scrollTop","scrollLeft","top","parentTop","bottom","parentBottom","left","parentLeft","width","parentWidth","height","parentHeight","style","minWidth","bottomTranslate","removeProperty","right","isInView","x","scrollWidth","y","scrollHeight","setProperty","topPosition","parseFloat","removeEventListener","_onScrollFn","async","_onScroll","_scrollToElement","itemsPerPage","itemRef","observe","differenceY","stopPropagation","wasClicked","letterNumber","key","updatedQuery","slice","updateQuery","Date","now","selectedItem","find","toLowerCase","startsWith","element","_b","clearTimeout","window","setTimeout","selection","ending","beginning","selectionText","statusText","componentWillLoad","componentDidLoad","_resizeObserver","ResizeObserver","disconnectedCallback","disconnect","render","maxHeight","overflowY","h","Host","class","cDropdownsCss","CDropdowns","createDropdown","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","removeAttribute","valid","hint","labelWidth","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 color: inherit;\n background-color: transparent;\n box-shadow: 0 2px 0 0 var(--_c-dropdown-text-color-active);\n }\n\n ul {\n margin: 0;\n padding: 0;\n background-color: var(--_c-dropdown-background-color);\n list-style: none;\n box-shadow: 2px 4px 10px #00000029;\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 this._removeEventListeners();\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 _onScrollFn: () => void;\n\n private _parentTop = 0;\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 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._listElement = listElement;\n\n this.host.shadowRoot.appendChild(listElement);\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 }\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\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 top: parentTop,\n bottom: parentBottom,\n left: parentLeft,\n width: parentWidth,\n height: parentHeight,\n } = this._getParentPosition();\n\n this.host.style.top = `${parentBottom}px`;\n this.host.style.left = `${parentLeft}px`;\n this.host.style.minWidth = `${parentWidth}px`;\n this.bottomTranslate = 0;\n\n this.host.style.removeProperty('transform');\n\n const { bottom, right, height, width } = this.host.getBoundingClientRect();\n\n this._parentTop = parentTop;\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.host.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.host.style.left = `${\n parseFloat(this.host.style.left) - width + parentWidth\n }px`;\n }\n }\n\n private _removeEventListeners() {\n this.scrollingParent.removeEventListener('scroll', this._onScrollFn);\n }\n\n private _createEventListeners() {\n requestAnimationFrame(async () => {\n this._onScrollFn = this._onScroll.bind(this);\n\n this.scrollingParent.addEventListener('scroll', this._onScrollFn);\n\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 _onScroll() {\n const { top: parentTop } = this.parent.getBoundingClientRect();\n\n const differenceY = this._parentTop - parentTop;\n\n if (this._openedOnTop) {\n this.host.style.setProperty(\n 'transform',\n `translateY(calc(-1 * ${this.bottomTranslate + differenceY}px))`,\n );\n\n return;\n }\n\n this.host.style.top = `${this.topPosition - differenceY}px`;\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.host);\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",":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,q6D,MCuBRC,EAAS,M,yBAwEZC,KAAAC,IAAM,GAkFND,KAAAE,UAAY,KAEZF,KAAAG,UAA6B,GAE7BH,KAAAI,kBAAoB,KAMpBJ,KAAAK,WAAa,EAEbL,KAAAM,aAAe,MAEfN,KAAAO,cAAgB,GAgBhBP,KAAAQ,UAAY,IAAIC,sBACtB,CAACC,EAASC,KACRD,EAAQE,SAASC,IACf,IAAKA,EAAMC,eAAgB,CACzBD,EAAME,OAAOC,eAAe,CAC1BC,MAAO,UACPC,OAAQ,YAEVP,EAASQ,UAAUN,EAAME,O,KACpB,CACLJ,EAASQ,UAAUN,EAAME,O,IAE3B,GAEJ,CAAEK,UAAW,IAcPpB,KAAAqB,gBAAkB,CAACC,EAAmBC,K,MAC5C,MAAMC,IAAWC,EAAAzB,KAAK0B,MAAM1B,KAAK2B,iBAAa,MAAAF,SAAA,SAAAA,EAAEG,SAAUN,EAAKM,MAE/D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