@cscfi/csc-ui 1.0.18 → 1.1.0

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 (56) hide show
  1. package/dist/cjs/c-dropdown_2.cjs.entry.js +2 -2
  2. package/dist/cjs/c-dropdown_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/c-modal.cjs.entry.js +3 -0
  4. package/dist/cjs/c-modal.cjs.entry.js.map +1 -1
  5. package/dist/cjs/c-radio-group.cjs.entry.js +6 -6
  6. package/dist/cjs/c-radio-group.cjs.entry.js.map +1 -1
  7. package/dist/cjs/c-select.cjs.entry.js +1 -1
  8. package/dist/cjs/c-select.cjs.entry.js.map +1 -1
  9. package/dist/cjs/csc-ui.cjs.js +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/collection/components/c-dropdown/c-dropdown.css +3 -3
  12. package/dist/collection/components/c-input/c-input.css +5 -5
  13. package/dist/collection/components/c-modal/c-modal.js +3 -0
  14. package/dist/collection/components/c-modal/c-modal.js.map +1 -1
  15. package/dist/collection/components/c-radio-group/c-radio-group.js +9 -9
  16. package/dist/collection/components/c-radio-group/c-radio-group.js.map +1 -1
  17. package/dist/collection/components/c-select/c-select.css +8 -0
  18. package/dist/components/c-dropdown2.js +1 -1
  19. package/dist/components/c-dropdown2.js.map +1 -1
  20. package/dist/components/c-input2.js +1 -1
  21. package/dist/components/c-input2.js.map +1 -1
  22. package/dist/components/c-modal.js +3 -0
  23. package/dist/components/c-modal.js.map +1 -1
  24. package/dist/components/c-radio-group.js +7 -7
  25. package/dist/components/c-radio-group.js.map +1 -1
  26. package/dist/components/c-select.js +1 -1
  27. package/dist/components/c-select.js.map +1 -1
  28. package/dist/csc-ui/csc-ui.esm.js +1 -1
  29. package/dist/csc-ui/csc-ui.esm.js.map +1 -1
  30. package/dist/csc-ui/p-35e770d6.entry.js +2 -0
  31. package/dist/csc-ui/p-35e770d6.entry.js.map +1 -0
  32. package/dist/csc-ui/{p-a9ed6afb.entry.js → p-64bcde03.entry.js} +2 -2
  33. package/dist/csc-ui/p-64bcde03.entry.js.map +1 -0
  34. package/dist/csc-ui/p-6c5e538b.entry.js +2 -0
  35. package/dist/csc-ui/p-6c5e538b.entry.js.map +1 -0
  36. package/dist/csc-ui/{p-fde2bd49.entry.js → p-f616d1c4.entry.js} +2 -2
  37. package/dist/csc-ui/{p-fde2bd49.entry.js.map → p-f616d1c4.entry.js.map} +1 -1
  38. package/dist/esm/c-dropdown_2.entry.js +2 -2
  39. package/dist/esm/c-dropdown_2.entry.js.map +1 -1
  40. package/dist/esm/c-modal.entry.js +3 -0
  41. package/dist/esm/c-modal.entry.js.map +1 -1
  42. package/dist/esm/c-radio-group.entry.js +6 -6
  43. package/dist/esm/c-radio-group.entry.js.map +1 -1
  44. package/dist/esm/c-select.entry.js +1 -1
  45. package/dist/esm/c-select.entry.js.map +1 -1
  46. package/dist/esm/csc-ui.js +1 -1
  47. package/dist/esm/loader.js +1 -1
  48. package/dist/types/components/c-radio-group/c-radio-group.d.ts +1 -1
  49. package/dist/types/components.d.ts +4 -4
  50. package/package.json +1 -1
  51. package/vscode-data.json +2 -2
  52. package/dist/csc-ui/p-a9ed6afb.entry.js.map +0 -1
  53. package/dist/csc-ui/p-d62e2784.entry.js +0 -2
  54. package/dist/csc-ui/p-d62e2784.entry.js.map +0 -1
  55. package/dist/csc-ui/p-dda56b09.entry.js +0 -2
  56. package/dist/csc-ui/p-dda56b09.entry.js.map +0 -1
@@ -1 +1 @@
1
- {"file":"c-select.js","mappings":";;;;;;;;;;;AAAA,MAAM,UAAU,GAAG,4sHAA4sH;;MCwBltHA,SAAO;;;;;;IAkIV,uBAAkB,GAAG,KAAK,CAAC;IAE3B,cAAS,GAAG,IAAI,CAAC;IAEjB,sBAAiB,GAAG,IAAI,CAAC;IAEzB,kBAAa,GAAG,EAAE,CAAC;IAkMnB,oBAAe,GAAG,CAAC,KAAK;MAC9B,KAAK,CAAC,eAAe,EAAE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OAAO,EAAE,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAE3C,YAAM,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,GAAQ,EAEnC,WAAK,KAAK,EAAC,kBAAkB,IAC1B,IAAI,CAAC,mBAAmB,EAAE,EAE1B,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,EAAE,EAEpC,CAAC,IAAI,CAAC,OAAO;MACZ,IAAI,CAAC,KAAK;MACV,IAAI,CAAC,SAAS;MACd,IAAI,CAAC,YAAY,EAAE,EAEpB,CAAC,IAAI,CAAC,OAAO;OACX,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;MAChC,IAAI,CAAC,cAAc,EAAE,EAEvB,YAAM,YAAY,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,GAAS,CACnD,EAEN,YAAM,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,GAAQ,CAC7B,CACC,CACR,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AArccA,mBAAS,GAAG,CAAH,CAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CSelect"],"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 Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n h,\n} from '@stencil/core';\nimport { CSelectItem } from '../../types';\nimport { mdiChevronDown, mdiClose } from '@mdi/js';\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})\nexport class CSelect {\n @Element() el: HTMLCSelectElement;\n\n /**\n * Dropdown items\n */\n @Prop() items: CSelectItem[] = [];\n\n /**\n * Selected item\n */\n @Prop() value: string | number | CSelectItem = null;\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Make the selected value clearable\n */\n @Prop() clearable = false;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\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 * Show loading state\n */\n @Prop() loading = false;\n\n /**\n * Show required validation\n */\n @Prop() required = false;\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 * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Return object instead of value\n */\n @Prop() returnObject = false;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\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 option is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @State() optionElements: NodeListOf<HTMLCOptionElement>;\n\n @State() currentIndex: number = null;\n\n @State() dropdownVisible = false;\n\n @State() statusText = '';\n\n @State() optionElementsExist = false;\n\n private static _uniqueId = 0;\n\n private _dropdownElement: HTMLCDropdownElement;\n\n private _inputElement: HTMLInputElement;\n\n private _cInputElement: HTMLCInputElement;\n\n private _selectionElement: HTMLDivElement;\n\n private _inputId: string;\n\n private _preventDialogOpen = false;\n\n private _debounce = null;\n\n private _lastKeyPressTime = null;\n\n private _searchString = '';\n\n private get _id() {\n return this.hostId || `select_${CSelect._uniqueId}`;\n }\n\n private get _items() {\n return this.optionElementsExist ? this.optionElements : this.items;\n }\n\n private get _value() {\n if (!this.value) return '';\n\n if (\n !this.returnObject &&\n !['number', 'string'].includes(typeof this.value)\n ) {\n console.warn(\n `[C-SELECT] The value should be of type 'number' or 'string' when return-object is not used.`,\n );\n\n return '';\n }\n\n if (\n !this.returnObject &&\n ['number', 'string'].includes(typeof this.value)\n ) {\n return Array.from(this._items)?.find((item) => item.value === this.value)\n ?.name;\n }\n\n return (this._items as CSelectItem[])?.find(\n (item) => item.value === (this.value as CSelectItem).value,\n )?.name;\n }\n\n /**\n * Reset select state\n */\n @Method()\n async reset() {\n this.changeValue.emit(null);\n\n this._dropdownElement.updateList();\n }\n\n @Listen('keydown', { passive: true })\n handleKeyDown(event: KeyboardEvent) {\n const alphanumeric = /^[0-9a-zA-Z ]+$/;\n\n if (event.key.match(alphanumeric) && event.key.length === 1) {\n if (this.dropdownVisible) return;\n\n if (Date.now() - this._lastKeyPressTime > 3000) {\n this._searchString = event.key;\n } else {\n this._searchString += event.key;\n }\n\n this._lastKeyPressTime = Date.now();\n\n const selectionIndex = Array.from(this._items).findIndex((i) =>\n i.name.toLowerCase().startsWith(this._searchString),\n );\n\n this.currentIndex = selectionIndex >= 0 ? selectionIndex : null;\n\n if (this.currentIndex !== null) {\n this._dropdownElement.selectItem(this.currentIndex);\n }\n\n return;\n }\n\n if (event.key === 'Escape') {\n this._preventDialogOpen = true;\n this._dropdownElement.close();\n this._inputElement.focus();\n\n return;\n }\n\n if (event.key === 'Tab') {\n this._dropdownElement.close();\n\n return;\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (!this._items.length) return;\n\n if (!this.dropdownVisible || this.currentIndex === null) {\n this.currentIndex = 0;\n this._dropdownElement.open();\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n this.currentIndex = Math.min(\n this.currentIndex + 1,\n this._items.length - 1,\n );\n\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (this.currentIndex === 0) {\n this._dropdownElement.close();\n this._inputElement.focus();\n }\n\n if (!this.dropdownVisible || this.currentIndex === null) {\n this.currentIndex = this._items.length - 1;\n this._dropdownElement.open();\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n this.currentIndex = Math.max(this.currentIndex - 1, 0);\n\n this._dropdownElement.focusItem(this.currentIndex);\n }\n\n if (event.key === ' ') {\n event.preventDefault();\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (this.currentIndex === null) return;\n\n this._dropdownElement.selectItem(this.currentIndex);\n }\n\n if (event.key === 'Home' && this.dropdownVisible) {\n this.currentIndex = 0;\n }\n\n if (event.key === 'End' && this.dropdownVisible) {\n this.currentIndex = this._items.length - 1;\n }\n }\n\n @Listen('dropdownStateChange')\n onDropdownStateChange(event: CustomEvent<boolean>) {\n const isOpen = event.detail;\n\n this.dropdownVisible = isOpen;\n\n if (!isOpen) {\n requestAnimationFrame(() => {\n this.currentIndex = null;\n });\n }\n }\n\n @Listen('selectOption')\n onSelectOption(event: CustomEvent<{ name: string; value: string }>) {\n this._dropdownElement.close();\n\n const { name, value } = event.detail;\n\n if (this.optionElementsExist && this.optionAsSelection) {\n // const selection = this._cOptionElements[item.value.toString()];\n const selection = Array.from(this.optionElements).find(\n (item) => item.value === value && item.name === name,\n );\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.changeValue.emit(this.returnObject ? event.detail : value);\n\n this._preventDialogOpen = true;\n\n this._inputElement.focus();\n }\n\n private _toggleDropdown = (event) => {\n event.stopPropagation();\n\n if (this.dropdownVisible) {\n this._dropdownElement.close();\n\n return;\n }\n\n this._dropdownElement.open();\n };\n\n private _onButtonKeyDown = (\n src: 'chevron' | 'reset',\n event: KeyboardEvent,\n ) => {\n event.stopPropagation();\n\n if (event.key !== 'Tab') event.preventDefault();\n\n if (['Enter', ' '].includes(event.key)) {\n if (src === 'chevron') {\n this._toggleDropdown(event);\n\n return;\n }\n\n this._onReset(event);\n\n this._preventDialogOpen = true;\n\n requestAnimationFrame(() => {\n this._inputElement.focus();\n });\n }\n };\n\n private _onSlotChange = () => {\n this.optionElements = this.el.querySelectorAll('c-option');\n\n if (this.optionElements.length && !this.optionElementsExist) {\n this.optionElementsExist = true;\n }\n };\n\n private _onReset = (event) => {\n event.stopPropagation();\n\n this.changeValue.emit(null);\n\n this._selectionElement.classList.remove('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(null);\n\n this._preventDialogOpen = true;\n\n this._cInputElement.reset();\n\n this._inputElement.focus();\n\n this._dropdownElement.updateList();\n };\n\n private _updateInput() {\n this._dropdownElement.open();\n\n this._dropdownElement.updateList();\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 = '';\n\n if (this.currentIndex === null) {\n this.statusText = this._items.length\n ? `${this._items.length} option${\n this._items.length !== 1 ? 's' : ''\n } available`\n : 'No options available';\n }\n\n const ending = !!this._items.length\n ? ', navigate using the up and down arrows'\n : '';\n\n this._dropdownElement.setStatusText(this.statusText + ending);\n\n this._debounce = null;\n }, 1400);\n }\n\n private _onInputFocus = () => {\n if (!this._preventDialogOpen) {\n this._dropdownElement.open();\n }\n\n this._updateStatusText();\n\n this._preventDialogOpen = false;\n };\n\n componentWillLoad() {\n CSelect._uniqueId += 1;\n\n this._inputId =\n 'input_' +\n (this.hostId || this.label || this.placeholder).replace(\n /[^a-zA-Z0-9-_]/g,\n '',\n );\n }\n\n private _renderLoader() {\n return <c-spinner color=\"var(--_c-autocomplete-active-color)\" size={20} />;\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.dropdownVisible,\n };\n\n return (\n <c-icon-button\n size=\"x-small\"\n class={classes}\n text\n onClick={(event) => this._toggleDropdown(event)}\n onKeyDown={(event) => this._onButtonKeyDown('chevron', event)}\n >\n <c-icon path={mdiChevronDown} size={24} />\n </c-icon-button>\n );\n }\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n type=\"text\"\n readonly\n ref={(el) => (this._inputElement = el)}\n aria-expanded={this.dropdownVisible.toString()}\n aria-owns={this._inputId + '-items'}\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n class=\"c-input__input\"\n role=\"combobox\"\n value={this._value}\n name={this.name ?? null}\n onInput={() => this._updateInput()}\n onFocus={() => this._onInputFocus()}\n />\n\n <div\n ref={(el) => (this._selectionElement = el)}\n class=\"c-input-menu__selection\"\n />\n </div>\n );\n }\n\n private _renderReset() {\n return (\n <c-icon-button\n aria-label=\"\"\n size=\"x-small\"\n text\n onClick={(event) => this._onReset(event)}\n onKeyDown={(event) => this._onButtonKeyDown('reset', event)}\n >\n <c-icon path={mdiClose} size={20} />\n </c-icon-button>\n );\n }\n\n render() {\n const itemType = this.optionElementsExist ? 'option' : 'item';\n\n return (\n <Host>\n <c-dropdown\n ref={(el) => (this._dropdownElement = el)}\n id={`${this._id}-dropdown`}\n index={this.currentIndex}\n items-per-page={this.itemsPerPage}\n item-type={itemType}\n items={this._items as NodeListOf<HTMLCOptionElement> & CSelectItem[]}\n parent={this.el}\n type=\"select\"\n >\n <c-input\n slot=\"default\"\n ref={(el) => (this._cInputElement = el)}\n active={this.dropdownVisible}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\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 onClick={() => this._dropdownElement.open()}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n\n {this.loading && this._renderLoader()}\n\n {!this.loading &&\n this.value &&\n this.clearable &&\n this._renderReset()}\n\n {!this.loading &&\n (!this.value || !this.clearable) &&\n this._renderChevron()}\n\n <slot onSlotchange={() => this._onSlotChange()}></slot>\n </div>\n\n <slot name=\"post\" slot=\"post\"></slot>\n </c-input>\n </c-dropdown>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"c-select.js","mappings":";;;;;;;;;;;AAAA,MAAM,UAAU,GAAG,w3IAAw3I;;MCwB93IA,SAAO;;;;;;IAkIV,uBAAkB,GAAG,KAAK,CAAC;IAE3B,cAAS,GAAG,IAAI,CAAC;IAEjB,sBAAiB,GAAG,IAAI,CAAC;IAEzB,kBAAa,GAAG,EAAE,CAAC;IAkMnB,oBAAe,GAAG,CAAC,KAAK;MAC9B,KAAK,CAAC,eAAe,EAAE,CAAC;MAExB,IAAI,IAAI,CAAC,eAAe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B,CAAC,IAAI,EAAE,IAE3C,YAAM,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,GAAQ,EAEnC,WAAK,KAAK,EAAC,kBAAkB,IAC1B,IAAI,CAAC,mBAAmB,EAAE,EAE1B,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,EAAE,EAEpC,CAAC,IAAI,CAAC,OAAO;MACZ,IAAI,CAAC,KAAK;MACV,IAAI,CAAC,SAAS;MACd,IAAI,CAAC,YAAY,EAAE,EAEpB,CAAC,IAAI,CAAC,OAAO;OACX,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;MAChC,IAAI,CAAC,cAAc,EAAE,EAEvB,YAAM,YAAY,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,GAAS,CACnD,EAEN,YAAM,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,GAAQ,CAC7B,CACC,CACR,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AArccA,mBAAS,GAAG,CAAH,CAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CSelect"],"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 --_c-select-shadow-active-color: var(--c-select-shadow-active-color, var(--_c-select-active-color));\n --_c-select-shadow-background-color: var(--c-select-shadow-background-color, var(--c-white));\n --_c-select-shadow-text-color: var(--c-select-shadow-text-color, var(--_c-select-text-color));\n --_c-select-shadow-placeholder-color: var(--c-select-shadow-placeholder-color, var(--_c-select-placeholder-color));\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 --_c-input-shadow-active-color: var(--_c-select-shadow-active-color);\n --_c-input-shadow-background-color: var(--_c-select-shadow-background-color);\n --_c-input-shadow-text-color: var(--_c-select-shadow-text-color);\n --_c-input-shadow-placeholder-color: var(--_c-select-shadow-placeholder-color);\n}\n\n@import \"../c-input/c-input-menu\";\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n h,\n} from '@stencil/core';\nimport { CSelectItem } from '../../types';\nimport { mdiChevronDown, mdiClose } from '@mdi/js';\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})\nexport class CSelect {\n @Element() el: HTMLCSelectElement;\n\n /**\n * Dropdown items\n */\n @Prop() items: CSelectItem[] = [];\n\n /**\n * Selected item\n */\n @Prop() value: string | number | CSelectItem = null;\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Make the selected value clearable\n */\n @Prop() clearable = false;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\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 * Show loading state\n */\n @Prop() loading = false;\n\n /**\n * Show required validation\n */\n @Prop() required = false;\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 * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Return object instead of value\n */\n @Prop() returnObject = false;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\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 option is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @State() optionElements: NodeListOf<HTMLCOptionElement>;\n\n @State() currentIndex: number = null;\n\n @State() dropdownVisible = false;\n\n @State() statusText = '';\n\n @State() optionElementsExist = false;\n\n private static _uniqueId = 0;\n\n private _dropdownElement: HTMLCDropdownElement;\n\n private _inputElement: HTMLInputElement;\n\n private _cInputElement: HTMLCInputElement;\n\n private _selectionElement: HTMLDivElement;\n\n private _inputId: string;\n\n private _preventDialogOpen = false;\n\n private _debounce = null;\n\n private _lastKeyPressTime = null;\n\n private _searchString = '';\n\n private get _id() {\n return this.hostId || `select_${CSelect._uniqueId}`;\n }\n\n private get _items() {\n return this.optionElementsExist ? this.optionElements : this.items;\n }\n\n private get _value() {\n if (!this.value) return '';\n\n if (\n !this.returnObject &&\n !['number', 'string'].includes(typeof this.value)\n ) {\n console.warn(\n `[C-SELECT] The value should be of type 'number' or 'string' when return-object is not used.`,\n );\n\n return '';\n }\n\n if (\n !this.returnObject &&\n ['number', 'string'].includes(typeof this.value)\n ) {\n return Array.from(this._items)?.find((item) => item.value === this.value)\n ?.name;\n }\n\n return (this._items as CSelectItem[])?.find(\n (item) => item.value === (this.value as CSelectItem).value,\n )?.name;\n }\n\n /**\n * Reset select state\n */\n @Method()\n async reset() {\n this.changeValue.emit(null);\n\n this._dropdownElement.updateList();\n }\n\n @Listen('keydown', { passive: true })\n handleKeyDown(event: KeyboardEvent) {\n const alphanumeric = /^[0-9a-zA-Z ]+$/;\n\n if (event.key.match(alphanumeric) && event.key.length === 1) {\n if (this.dropdownVisible) return;\n\n if (Date.now() - this._lastKeyPressTime > 3000) {\n this._searchString = event.key;\n } else {\n this._searchString += event.key;\n }\n\n this._lastKeyPressTime = Date.now();\n\n const selectionIndex = Array.from(this._items).findIndex((i) =>\n i.name.toLowerCase().startsWith(this._searchString),\n );\n\n this.currentIndex = selectionIndex >= 0 ? selectionIndex : null;\n\n if (this.currentIndex !== null) {\n this._dropdownElement.selectItem(this.currentIndex);\n }\n\n return;\n }\n\n if (event.key === 'Escape') {\n this._preventDialogOpen = true;\n this._dropdownElement.close();\n this._inputElement.focus();\n\n return;\n }\n\n if (event.key === 'Tab') {\n this._dropdownElement.close();\n\n return;\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (!this._items.length) return;\n\n if (!this.dropdownVisible || this.currentIndex === null) {\n this.currentIndex = 0;\n this._dropdownElement.open();\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n this.currentIndex = Math.min(\n this.currentIndex + 1,\n this._items.length - 1,\n );\n\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (this.currentIndex === 0) {\n this._dropdownElement.close();\n this._inputElement.focus();\n }\n\n if (!this.dropdownVisible || this.currentIndex === null) {\n this.currentIndex = this._items.length - 1;\n this._dropdownElement.open();\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n this.currentIndex = Math.max(this.currentIndex - 1, 0);\n\n this._dropdownElement.focusItem(this.currentIndex);\n }\n\n if (event.key === ' ') {\n event.preventDefault();\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (this.currentIndex === null) return;\n\n this._dropdownElement.selectItem(this.currentIndex);\n }\n\n if (event.key === 'Home' && this.dropdownVisible) {\n this.currentIndex = 0;\n }\n\n if (event.key === 'End' && this.dropdownVisible) {\n this.currentIndex = this._items.length - 1;\n }\n }\n\n @Listen('dropdownStateChange')\n onDropdownStateChange(event: CustomEvent<boolean>) {\n const isOpen = event.detail;\n\n this.dropdownVisible = isOpen;\n\n if (!isOpen) {\n requestAnimationFrame(() => {\n this.currentIndex = null;\n });\n }\n }\n\n @Listen('selectOption')\n onSelectOption(event: CustomEvent<{ name: string; value: string }>) {\n this._dropdownElement.close();\n\n const { name, value } = event.detail;\n\n if (this.optionElementsExist && this.optionAsSelection) {\n // const selection = this._cOptionElements[item.value.toString()];\n const selection = Array.from(this.optionElements).find(\n (item) => item.value === value && item.name === name,\n );\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.changeValue.emit(this.returnObject ? event.detail : value);\n\n this._preventDialogOpen = true;\n\n this._inputElement.focus();\n }\n\n private _toggleDropdown = (event) => {\n event.stopPropagation();\n\n if (this.dropdownVisible) {\n this._dropdownElement.close();\n\n return;\n }\n\n this._dropdownElement.open();\n };\n\n private _onButtonKeyDown = (\n src: 'chevron' | 'reset',\n event: KeyboardEvent,\n ) => {\n event.stopPropagation();\n\n if (event.key !== 'Tab') event.preventDefault();\n\n if (['Enter', ' '].includes(event.key)) {\n if (src === 'chevron') {\n this._toggleDropdown(event);\n\n return;\n }\n\n this._onReset(event);\n\n this._preventDialogOpen = true;\n\n requestAnimationFrame(() => {\n this._inputElement.focus();\n });\n }\n };\n\n private _onSlotChange = () => {\n this.optionElements = this.el.querySelectorAll('c-option');\n\n if (this.optionElements.length && !this.optionElementsExist) {\n this.optionElementsExist = true;\n }\n };\n\n private _onReset = (event) => {\n event.stopPropagation();\n\n this.changeValue.emit(null);\n\n this._selectionElement.classList.remove('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(null);\n\n this._preventDialogOpen = true;\n\n this._cInputElement.reset();\n\n this._inputElement.focus();\n\n this._dropdownElement.updateList();\n };\n\n private _updateInput() {\n this._dropdownElement.open();\n\n this._dropdownElement.updateList();\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 = '';\n\n if (this.currentIndex === null) {\n this.statusText = this._items.length\n ? `${this._items.length} option${\n this._items.length !== 1 ? 's' : ''\n } available`\n : 'No options available';\n }\n\n const ending = !!this._items.length\n ? ', navigate using the up and down arrows'\n : '';\n\n this._dropdownElement.setStatusText(this.statusText + ending);\n\n this._debounce = null;\n }, 1400);\n }\n\n private _onInputFocus = () => {\n if (!this._preventDialogOpen) {\n this._dropdownElement.open();\n }\n\n this._updateStatusText();\n\n this._preventDialogOpen = false;\n };\n\n componentWillLoad() {\n CSelect._uniqueId += 1;\n\n this._inputId =\n 'input_' +\n (this.hostId || this.label || this.placeholder).replace(\n /[^a-zA-Z0-9-_]/g,\n '',\n );\n }\n\n private _renderLoader() {\n return <c-spinner color=\"var(--_c-autocomplete-active-color)\" size={20} />;\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.dropdownVisible,\n };\n\n return (\n <c-icon-button\n size=\"x-small\"\n class={classes}\n text\n onClick={(event) => this._toggleDropdown(event)}\n onKeyDown={(event) => this._onButtonKeyDown('chevron', event)}\n >\n <c-icon path={mdiChevronDown} size={24} />\n </c-icon-button>\n );\n }\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n type=\"text\"\n readonly\n ref={(el) => (this._inputElement = el)}\n aria-expanded={this.dropdownVisible.toString()}\n aria-owns={this._inputId + '-items'}\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n class=\"c-input__input\"\n role=\"combobox\"\n value={this._value}\n name={this.name ?? null}\n onInput={() => this._updateInput()}\n onFocus={() => this._onInputFocus()}\n />\n\n <div\n ref={(el) => (this._selectionElement = el)}\n class=\"c-input-menu__selection\"\n />\n </div>\n );\n }\n\n private _renderReset() {\n return (\n <c-icon-button\n aria-label=\"\"\n size=\"x-small\"\n text\n onClick={(event) => this._onReset(event)}\n onKeyDown={(event) => this._onButtonKeyDown('reset', event)}\n >\n <c-icon path={mdiClose} size={20} />\n </c-icon-button>\n );\n }\n\n render() {\n const itemType = this.optionElementsExist ? 'option' : 'item';\n\n return (\n <Host>\n <c-dropdown\n ref={(el) => (this._dropdownElement = el)}\n id={`${this._id}-dropdown`}\n index={this.currentIndex}\n items-per-page={this.itemsPerPage}\n item-type={itemType}\n items={this._items as NodeListOf<HTMLCOptionElement> & CSelectItem[]}\n parent={this.el}\n type=\"select\"\n >\n <c-input\n slot=\"default\"\n ref={(el) => (this._cInputElement = el)}\n active={this.dropdownVisible}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\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 onClick={() => this._dropdownElement.open()}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n\n {this.loading && this._renderLoader()}\n\n {!this.loading &&\n this.value &&\n this.clearable &&\n this._renderReset()}\n\n {!this.loading &&\n (!this.value || !this.clearable) &&\n this._renderChevron()}\n\n <slot onSlotchange={() => this._onSlotChange()}></slot>\n </div>\n\n <slot name=\"post\" slot=\"post\"></slot>\n </c-input>\n </c-dropdown>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,2 +1,2 @@
1
- import{p as e,b as a}from"./p-565ec8e4.js";export{s as setNonce}from"./p-565ec8e4.js";const t=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};t().then((e=>a(JSON.parse('[["p-45641e3d",[[1,"c-data-table",{"data":[16],"externalData":[4,"external-data"],"headers":[16],"hideFooter":[4,"hide-footer"],"footerOptions":[16],"loading":[4],"loadingText":[1,"loading-text"],"noDataText":[1,"no-data-text"],"pagination":[1040],"selectable":[4],"singleSelection":[4,"single-selection"],"selectionProperty":[1,"selection-property"],"singleExpansion":[4,"single-expansion"],"sortBy":[1032,"sort-by"],"sortDirection":[1025,"sort-direction"],"stickyHeader":[4,"sticky-header"],"horizontalScrolling":[4,"horizontal-scrolling"],"_activeRows":[32],"_data":[32],"_isIndeterminate":[32],"_isPaginationSimple":[32],"_selections":[32],"hasOverflow":[32],"hiddenHeaders":[32],"initiallyHiddenHeaders":[32],"forceRender":[32],"breakpoints":[32],"markedFooterWidth":[32],"parentWidth":[32],"firstCellHidden":[32],"lastCellHidden":[32],"clearSelections":[64],"getData":[64]},null,{"hiddenHeaders":["onHiddenHeaderChange"],"data":["onDataChange"],"headers":["onHeaderChange"],"singleSelection":["onSingleSelectionChange"],"loading":["onLoadingChange"]}]]],["p-d2fc8cb4",[[1,"c-autocomplete",{"items":[16],"value":[8],"query":[1],"hostId":[1,"id"],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[1,"keydown","handleKeyDown"],[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]],{"query":["handleQueryChange"]}]]],["p-dda56b09",[[1,"c-select",{"items":[16],"value":[8],"hostId":[1,"id"],"clearable":[4],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"optionAsSelection":[4,"option-as-selection"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[1,"keydown","handleKeyDown"],[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]]]]],["p-c291cbe2",[[1,"c-navigation-button"]]],["p-16098e94",[[1,"c-side-navigation",{"mobile":[4],"menuVisible":[1028,"menu-visible"]},[[0,"itemChange","handleChange"]]]]],["p-27904068",[[1,"c-tabs",{"value":[1032],"borderless":[4],"disableAnimation":[4,"disable-animation"],"justify":[1],"mobileBreakpoint":[2,"mobile-breakpoint"],"vertical":[4],"isOverflowing":[32],"isMobile":[32],"scrollOffset":[32]},[[1,"tabFocus","tabFocusHandler"],[1,"tabChange","tabChangeHandler"],[2,"keydown","handleKeyDown"],[2,"keyup","handleKeyUp"]],{"justify":["onJustificationChange"],"value":["onExternalValueChange"],"scrollOffset":["onScrollOffsetChange"]}]]],["p-862486aa",[[1,"c-tag",{"active":[4],"block":[4],"fit":[4],"flat":[4],"closeable":[4],"badge":[8]}]]],["p-47ca0a95",[[4,"c-swiper",{"value":[1544],"elementId":[1,"id"],"isBeginning":[32],"isEnd":[32],"statusText":[32]},[[0,"changeValue","onTabClick"],[2,"keyup","handleKeyUp"]]]]],["p-7af82ab9",[[1,"c-side-navigation-item",{"active":[4],"href":[1],"target":[1],"loading":[4]},[[0,"itemChange","handleChange"]],{"active":["onActiveChange"]}]]],["p-afd4cc03",[[1,"c-sub-navigation-item",{"active":[4],"focusable":[4],"href":[1],"target":[1],"loading":[4]}]]],["p-958cf6ed",[[65,"c-text-field",{"autofocus":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"trimWhitespace":[4,"trim-whitespace"],"label":[1],"max":[2],"min":[2],"name":[1],"number":[4],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[1025],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"messageOptions":[32]}]]],["p-55cbda54",[[1,"c-toasts",{"absolute":[4],"horizontal":[1],"vertical":[1],"messages":[32],"addToast":[64],"removeToast":[64]}]]],["p-5d21c4c7",[[1,"c-accordion-item",{"collapsable":[4],"heading":[1],"value":[8],"expanded":[4],"outlined":[4]},[[2,"keydown","handleKeyDown"],[0,"changeValue","stop"]]]]],["p-d8899493",[[1,"c-list-item",{"active":[4],"disabled":[4],"disabledByParent":[4,"disabled-by-parent"],"hoverable":[4],"ripple":[4],"href":[1],"target":[1]},null,{"active":["onActiveChange"]}]]],["p-e8bd7a76",[[1,"c-login-card-actions",{"align":[1],"justify":[1]}]]],["p-7ea05669",[[65,"c-otp-input",{"hideDetails":[4,"hide-details"],"hint":[1],"elementId":[1,"id"],"length":[2],"valid":[4],"validation":[1],"statusText":[32]},null,{"validation":["onValidationMessageChange"]}]]],["p-a9ed6afb",[[65,"c-radio-group",{"value":[1032],"hideDetails":[4,"hide-details"],"hint":[1],"inline":[4],"label":[1],"color":[1],"items":[16],"disabled":[4],"returnValue":[4,"return-value"],"required":[4],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-0db503fb",[[1,"c-swiper-tab",{"disabled":[4],"active":[4],"label":[1],"hostId":[1,"id"],"setsize":[2],"position":[2],"value":[8]},[[1,"click","onTabClick"]]]]],["p-fb098c2b",[[1,"c-tab",{"active":[4],"disabled":[4],"hostId":[1,"id"],"position":[2],"setsize":[2],"value":[8]},[[1,"focus","onTabFocus"],[1,"keydown","handleKeydown"]]]]],["p-82a711fb",[[1,"c-accordion",{"value":[1032],"mandatory":[4],"multiple":[4],"outlined":[4]},[[1,"itemChange","onAccordionItemChange"]],{"value":["watchPropHandler"]}]]],["p-bf01d3ef",[[1,"c-alert",{"type":[1]}]]],["p-bbe8423c",[[1,"c-card-content"]]],["p-bddd9153",[[1,"c-card-title"]]],["p-4f9c92e4",[[1,"c-link",{"href":[1],"underline":[4],"target":[1],"weight":[1]}]]],["p-1a1e8b4b",[[0,"c-list",{"disabled":[4]},null,{"disabled":["onDisabledChange"]}]]],["p-d26167bc",[[1,"c-list-item-title",{"active":[4]}]]],["p-cc31d9b2",[[1,"c-login-button",{"href":[1],"src":[1],"alt":[1]}]]],["p-baea3193",[[1,"c-login-buttons"]]],["p-88c60ba3",[[4,"c-login-card",{"backgroundPosition":[1,"background-position"],"mobileBreakpoint":[2,"mobile-breakpoint"],"overlay":[4],"overlayBlendMode":[1,"overlay-blend-mode"],"src":[1],"path":[32],"imageHeight":[32]}]]],["p-ea99cd0e",[[1,"c-login-card-content"]]],["p-98faa11d",[[1,"c-login-card-title"]]],["p-fde2bd49",[[1,"c-modal",{"value":[4],"dismissable":[4],"width":[8],"zIndex":[2,"z-index"],"disableBackdropBlur":[4,"disable-backdrop-blur"],"innerValue":[32],"animateModal":[32]},null,{"value":["onValueChange"]}]]],["p-0666f12d",[[1,"c-option",{"selected":[4],"disabled":[4],"name":[1],"value":[8]}]]],["p-da6a2275",[[1,"c-option-value"]]],["p-4cf4ffff",[[1,"c-page",{"scrollIndicator":[4,"scroll-indicator"]}]]],["p-75798257",[[1,"c-progress-bar",{"value":[2],"hideDetails":[4,"hide-details"],"singleLine":[4,"single-line"],"label":[1],"indeterminate":[4]}]]],["p-494a4f19",[[1,"c-radio",{"checked":[4],"disabled":[4],"value":[1]}]]],["p-2b5cd791",[[1,"c-side-navigation-title"]]],["p-ff51bae3",[[1,"c-status",{"type":[1]}]]],["p-075a7c96",[[1,"c-step",{"complete":[4],"current":[4]}]]],["p-d76079eb",[[1,"c-steps",{"value":[8],"isMobile":[32],"label":[32]},null,{"value":["watchPropHandler"]}]]],["p-d7ca1f65",[[65,"c-switch",{"checked":[1028],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostDisabled":[4,"disabled"],"hostId":[1,"id"],"required":[4],"hasLabel":[32]}]]],["p-e6fb98a7",[[1,"c-tab-buttons",{"value":[1032],"mandatory":[4],"tabs":[4],"size":[1],"hostDisabled":[4,"disabled"]},[[1,"tabFocus","tabFocusHandler"],[2,"keyup","handleKeyUp"],[1,"tabChange","onTabChange"]],{"value":["onValueChange"]}]]],["p-8d34efbc",[[1,"c-tab-item",{"value":[8],"active":[4]}]]],["p-aa930d89",[[1,"c-tab-items",{"value":[8],"disableAnimation":[4,"disable-animation"],"activeTab":[32]},[[1,"contentChange","tabContentChangeHandler"]],{"value":["onValueChange"]}]]],["p-caa58a64",[[4,"c-table",{"mobileBreakpoint":[2,"mobile-breakpoint"],"responsive":[4]}]]],["p-8d5fe14f",[[1,"c-tags"]]],["p-873aa915",[[1,"c-toast",{"message":[16],"closeToast":[64]}]]],["p-019c6898",[[1,"c-card-actions",{"align":[1],"justify":[1]}]]],["p-d1089126",[[1,"c-card",{"fullscreen":[4],"isFullscreen":[32],"exitFullscreen":[64],"enterFullscreen":[64]}],[1,"c-button",{"inverted":[4],"outlined":[4],"ghost":[4],"danger":[4],"grouped":[4],"text":[4],"loading":[4],"fit":[4],"noRadius":[4,"no-radius"],"type":[1],"disabled":[516],"value":[8],"hostId":[1,"id"],"size":[1],"href":[1],"target":[1],"tabs":[4]},[[1,"focus","onTabFocus"]]],[1,"c-csc-logo",{"width":[2]}],[1,"c-main"],[1,"c-row",{"gap":[2],"nowrap":[4],"align":[1],"justify":[1]}],[1,"c-toolbar"],[1,"c-spacer"],[1,"c-icon-button",{"badge":[1],"danger":[4],"loading":[4],"text":[4],"inverted":[4],"outlined":[4],"path":[1],"ghost":[4],"disabled":[4],"size":[1]}],[1,"c-badge"],[1,"c-icon",{"path":[1],"size":[2],"color":[1]}],[1,"c-spinner",{"color":[1],"size":[2],"width":[2]}],[1,"c-ripple",{"createRipple":[64]}]]],["p-4e1d8f5d",[[1,"c-menu",{"items":[16],"contentClass":[1,"content-class"],"custom":[4],"small":[4],"flat":[4],"itemsPerPage":[2,"items-per-page"],"menuItemsComponent":[32],"menuWrapperComponent":[32],"currentIndex":[32],"active":[32]},[[2,"keydown","handleKeyDown"]]],[1,"c-menu-items",{"items":[16],"small":[4],"active":[4],"parentType":[1,"parent-type"],"parent":[16],"top":[2],"index":[2],"itemsPerPage":[2,"items-per-page"],"scrollingParent":[32],"isInView":[32],"currentIndex":[32]},[[2,"keydown","handleKeyDown"]],{"currentIndex":["onIndexChange"]}]]],["p-2a622e79",[[1,"c-pagination",{"value":[16],"hideDetails":[4,"hide-details"],"simple":[4],"size":[1],"hideRange":[4,"hide-range"],"itemsPerPageOptions":[16],"_currentPage":[32],"_itemsPerPage":[32],"_totalVisible":[32],"tick":[32]},null,{"value":["valueHandler"]}],[65,"c-checkbox",{"checked":[1028],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"indeterminate":[4],"label":[1],"required":[4],"valid":[4],"validation":[1],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostName":[1,"name"],"messageOptions":[32]},[[1,"keydown","handleKeyDown"]],{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-e3bd1f42",[[1,"c-loader",{"contentdelay":[2],"hide":[4],"size":[2],"width":[2]},null,{"hide":["onElementHide"]}]]],["p-ec167606",[[1,"c-message",{"hint":[1],"inputId":[1,"input-id"],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"hint":["onHintMessageChange"]}]]],["p-d62e2784",[[1,"c-dropdown",{"itemsPerPage":[2,"items-per-page"],"parent":[16],"items":[16],"index":[2],"hostId":[1,"id"],"type":[1],"itemType":[1,"item-type"],"renderedList":[32],"isOpen":[32],"statusText":[32],"setStatusText":[64],"focusItem":[64],"open":[64],"close":[64],"selectItem":[64],"updateList":[64]},null,{"items":["optionsWatcher"],"isOpen":["stateWatcher"],"index":["handleIndexChange"]}],[4,"c-input",{"active":[4],"autofocus":[4],"disabled":[4],"form":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"inputId":[1,"input-id"],"items":[16],"itemsPerPage":[2,"items-per-page"],"label":[1],"max":[2],"min":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[8],"variant":[1],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"statusText":[32],"currentIndex":[32],"reset":[64]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"value":["onValueChange"],"placeholder":["onPlaceholderChange"]}]]]]'),e)));
1
+ import{p as e,b as a}from"./p-565ec8e4.js";export{s as setNonce}from"./p-565ec8e4.js";const t=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};t().then((e=>a(JSON.parse('[["p-45641e3d",[[1,"c-data-table",{"data":[16],"externalData":[4,"external-data"],"headers":[16],"hideFooter":[4,"hide-footer"],"footerOptions":[16],"loading":[4],"loadingText":[1,"loading-text"],"noDataText":[1,"no-data-text"],"pagination":[1040],"selectable":[4],"singleSelection":[4,"single-selection"],"selectionProperty":[1,"selection-property"],"singleExpansion":[4,"single-expansion"],"sortBy":[1032,"sort-by"],"sortDirection":[1025,"sort-direction"],"stickyHeader":[4,"sticky-header"],"horizontalScrolling":[4,"horizontal-scrolling"],"_activeRows":[32],"_data":[32],"_isIndeterminate":[32],"_isPaginationSimple":[32],"_selections":[32],"hasOverflow":[32],"hiddenHeaders":[32],"initiallyHiddenHeaders":[32],"forceRender":[32],"breakpoints":[32],"markedFooterWidth":[32],"parentWidth":[32],"firstCellHidden":[32],"lastCellHidden":[32],"clearSelections":[64],"getData":[64]},null,{"hiddenHeaders":["onHiddenHeaderChange"],"data":["onDataChange"],"headers":["onHeaderChange"],"singleSelection":["onSingleSelectionChange"],"loading":["onLoadingChange"]}]]],["p-d2fc8cb4",[[1,"c-autocomplete",{"items":[16],"value":[8],"query":[1],"hostId":[1,"id"],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[1,"keydown","handleKeyDown"],[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]],{"query":["handleQueryChange"]}]]],["p-6c5e538b",[[1,"c-select",{"items":[16],"value":[8],"hostId":[1,"id"],"clearable":[4],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"optionAsSelection":[4,"option-as-selection"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[1,"keydown","handleKeyDown"],[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]]]]],["p-c291cbe2",[[1,"c-navigation-button"]]],["p-16098e94",[[1,"c-side-navigation",{"mobile":[4],"menuVisible":[1028,"menu-visible"]},[[0,"itemChange","handleChange"]]]]],["p-27904068",[[1,"c-tabs",{"value":[1032],"borderless":[4],"disableAnimation":[4,"disable-animation"],"justify":[1],"mobileBreakpoint":[2,"mobile-breakpoint"],"vertical":[4],"isOverflowing":[32],"isMobile":[32],"scrollOffset":[32]},[[1,"tabFocus","tabFocusHandler"],[1,"tabChange","tabChangeHandler"],[2,"keydown","handleKeyDown"],[2,"keyup","handleKeyUp"]],{"justify":["onJustificationChange"],"value":["onExternalValueChange"],"scrollOffset":["onScrollOffsetChange"]}]]],["p-862486aa",[[1,"c-tag",{"active":[4],"block":[4],"fit":[4],"flat":[4],"closeable":[4],"badge":[8]}]]],["p-47ca0a95",[[4,"c-swiper",{"value":[1544],"elementId":[1,"id"],"isBeginning":[32],"isEnd":[32],"statusText":[32]},[[0,"changeValue","onTabClick"],[2,"keyup","handleKeyUp"]]]]],["p-7af82ab9",[[1,"c-side-navigation-item",{"active":[4],"href":[1],"target":[1],"loading":[4]},[[0,"itemChange","handleChange"]],{"active":["onActiveChange"]}]]],["p-afd4cc03",[[1,"c-sub-navigation-item",{"active":[4],"focusable":[4],"href":[1],"target":[1],"loading":[4]}]]],["p-958cf6ed",[[65,"c-text-field",{"autofocus":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"trimWhitespace":[4,"trim-whitespace"],"label":[1],"max":[2],"min":[2],"name":[1],"number":[4],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[1025],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"messageOptions":[32]}]]],["p-55cbda54",[[1,"c-toasts",{"absolute":[4],"horizontal":[1],"vertical":[1],"messages":[32],"addToast":[64],"removeToast":[64]}]]],["p-5d21c4c7",[[1,"c-accordion-item",{"collapsable":[4],"heading":[1],"value":[8],"expanded":[4],"outlined":[4]},[[2,"keydown","handleKeyDown"],[0,"changeValue","stop"]]]]],["p-d8899493",[[1,"c-list-item",{"active":[4],"disabled":[4],"disabledByParent":[4,"disabled-by-parent"],"hoverable":[4],"ripple":[4],"href":[1],"target":[1]},null,{"active":["onActiveChange"]}]]],["p-e8bd7a76",[[1,"c-login-card-actions",{"align":[1],"justify":[1]}]]],["p-7ea05669",[[65,"c-otp-input",{"hideDetails":[4,"hide-details"],"hint":[1],"elementId":[1,"id"],"length":[2],"valid":[4],"validation":[1],"statusText":[32]},null,{"validation":["onValidationMessageChange"]}]]],["p-64bcde03",[[65,"c-radio-group",{"value":[1032],"hideDetails":[4,"hide-details"],"hint":[1],"inline":[4],"label":[1],"color":[1],"items":[16],"disabled":[4],"returnObject":[4,"return-object"],"required":[4],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-0db503fb",[[1,"c-swiper-tab",{"disabled":[4],"active":[4],"label":[1],"hostId":[1,"id"],"setsize":[2],"position":[2],"value":[8]},[[1,"click","onTabClick"]]]]],["p-fb098c2b",[[1,"c-tab",{"active":[4],"disabled":[4],"hostId":[1,"id"],"position":[2],"setsize":[2],"value":[8]},[[1,"focus","onTabFocus"],[1,"keydown","handleKeydown"]]]]],["p-82a711fb",[[1,"c-accordion",{"value":[1032],"mandatory":[4],"multiple":[4],"outlined":[4]},[[1,"itemChange","onAccordionItemChange"]],{"value":["watchPropHandler"]}]]],["p-bf01d3ef",[[1,"c-alert",{"type":[1]}]]],["p-bbe8423c",[[1,"c-card-content"]]],["p-bddd9153",[[1,"c-card-title"]]],["p-4f9c92e4",[[1,"c-link",{"href":[1],"underline":[4],"target":[1],"weight":[1]}]]],["p-1a1e8b4b",[[0,"c-list",{"disabled":[4]},null,{"disabled":["onDisabledChange"]}]]],["p-d26167bc",[[1,"c-list-item-title",{"active":[4]}]]],["p-cc31d9b2",[[1,"c-login-button",{"href":[1],"src":[1],"alt":[1]}]]],["p-baea3193",[[1,"c-login-buttons"]]],["p-88c60ba3",[[4,"c-login-card",{"backgroundPosition":[1,"background-position"],"mobileBreakpoint":[2,"mobile-breakpoint"],"overlay":[4],"overlayBlendMode":[1,"overlay-blend-mode"],"src":[1],"path":[32],"imageHeight":[32]}]]],["p-ea99cd0e",[[1,"c-login-card-content"]]],["p-98faa11d",[[1,"c-login-card-title"]]],["p-f616d1c4",[[1,"c-modal",{"value":[4],"dismissable":[4],"width":[8],"zIndex":[2,"z-index"],"disableBackdropBlur":[4,"disable-backdrop-blur"],"innerValue":[32],"animateModal":[32]},null,{"value":["onValueChange"]}]]],["p-0666f12d",[[1,"c-option",{"selected":[4],"disabled":[4],"name":[1],"value":[8]}]]],["p-da6a2275",[[1,"c-option-value"]]],["p-4cf4ffff",[[1,"c-page",{"scrollIndicator":[4,"scroll-indicator"]}]]],["p-75798257",[[1,"c-progress-bar",{"value":[2],"hideDetails":[4,"hide-details"],"singleLine":[4,"single-line"],"label":[1],"indeterminate":[4]}]]],["p-494a4f19",[[1,"c-radio",{"checked":[4],"disabled":[4],"value":[1]}]]],["p-2b5cd791",[[1,"c-side-navigation-title"]]],["p-ff51bae3",[[1,"c-status",{"type":[1]}]]],["p-075a7c96",[[1,"c-step",{"complete":[4],"current":[4]}]]],["p-d76079eb",[[1,"c-steps",{"value":[8],"isMobile":[32],"label":[32]},null,{"value":["watchPropHandler"]}]]],["p-d7ca1f65",[[65,"c-switch",{"checked":[1028],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostDisabled":[4,"disabled"],"hostId":[1,"id"],"required":[4],"hasLabel":[32]}]]],["p-e6fb98a7",[[1,"c-tab-buttons",{"value":[1032],"mandatory":[4],"tabs":[4],"size":[1],"hostDisabled":[4,"disabled"]},[[1,"tabFocus","tabFocusHandler"],[2,"keyup","handleKeyUp"],[1,"tabChange","onTabChange"]],{"value":["onValueChange"]}]]],["p-8d34efbc",[[1,"c-tab-item",{"value":[8],"active":[4]}]]],["p-aa930d89",[[1,"c-tab-items",{"value":[8],"disableAnimation":[4,"disable-animation"],"activeTab":[32]},[[1,"contentChange","tabContentChangeHandler"]],{"value":["onValueChange"]}]]],["p-caa58a64",[[4,"c-table",{"mobileBreakpoint":[2,"mobile-breakpoint"],"responsive":[4]}]]],["p-8d5fe14f",[[1,"c-tags"]]],["p-873aa915",[[1,"c-toast",{"message":[16],"closeToast":[64]}]]],["p-019c6898",[[1,"c-card-actions",{"align":[1],"justify":[1]}]]],["p-d1089126",[[1,"c-card",{"fullscreen":[4],"isFullscreen":[32],"exitFullscreen":[64],"enterFullscreen":[64]}],[1,"c-button",{"inverted":[4],"outlined":[4],"ghost":[4],"danger":[4],"grouped":[4],"text":[4],"loading":[4],"fit":[4],"noRadius":[4,"no-radius"],"type":[1],"disabled":[516],"value":[8],"hostId":[1,"id"],"size":[1],"href":[1],"target":[1],"tabs":[4]},[[1,"focus","onTabFocus"]]],[1,"c-csc-logo",{"width":[2]}],[1,"c-main"],[1,"c-row",{"gap":[2],"nowrap":[4],"align":[1],"justify":[1]}],[1,"c-toolbar"],[1,"c-spacer"],[1,"c-icon-button",{"badge":[1],"danger":[4],"loading":[4],"text":[4],"inverted":[4],"outlined":[4],"path":[1],"ghost":[4],"disabled":[4],"size":[1]}],[1,"c-badge"],[1,"c-icon",{"path":[1],"size":[2],"color":[1]}],[1,"c-spinner",{"color":[1],"size":[2],"width":[2]}],[1,"c-ripple",{"createRipple":[64]}]]],["p-4e1d8f5d",[[1,"c-menu",{"items":[16],"contentClass":[1,"content-class"],"custom":[4],"small":[4],"flat":[4],"itemsPerPage":[2,"items-per-page"],"menuItemsComponent":[32],"menuWrapperComponent":[32],"currentIndex":[32],"active":[32]},[[2,"keydown","handleKeyDown"]]],[1,"c-menu-items",{"items":[16],"small":[4],"active":[4],"parentType":[1,"parent-type"],"parent":[16],"top":[2],"index":[2],"itemsPerPage":[2,"items-per-page"],"scrollingParent":[32],"isInView":[32],"currentIndex":[32]},[[2,"keydown","handleKeyDown"]],{"currentIndex":["onIndexChange"]}]]],["p-2a622e79",[[1,"c-pagination",{"value":[16],"hideDetails":[4,"hide-details"],"simple":[4],"size":[1],"hideRange":[4,"hide-range"],"itemsPerPageOptions":[16],"_currentPage":[32],"_itemsPerPage":[32],"_totalVisible":[32],"tick":[32]},null,{"value":["valueHandler"]}],[65,"c-checkbox",{"checked":[1028],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"indeterminate":[4],"label":[1],"required":[4],"valid":[4],"validation":[1],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostName":[1,"name"],"messageOptions":[32]},[[1,"keydown","handleKeyDown"]],{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-e3bd1f42",[[1,"c-loader",{"contentdelay":[2],"hide":[4],"size":[2],"width":[2]},null,{"hide":["onElementHide"]}]]],["p-ec167606",[[1,"c-message",{"hint":[1],"inputId":[1,"input-id"],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"hint":["onHintMessageChange"]}]]],["p-35e770d6",[[1,"c-dropdown",{"itemsPerPage":[2,"items-per-page"],"parent":[16],"items":[16],"index":[2],"hostId":[1,"id"],"type":[1],"itemType":[1,"item-type"],"renderedList":[32],"isOpen":[32],"statusText":[32],"setStatusText":[64],"focusItem":[64],"open":[64],"close":[64],"selectItem":[64],"updateList":[64]},null,{"items":["optionsWatcher"],"isOpen":["stateWatcher"],"index":["handleIndexChange"]}],[4,"c-input",{"active":[4],"autofocus":[4],"disabled":[4],"form":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"inputId":[1,"input-id"],"items":[16],"itemsPerPage":[2,"items-per-page"],"label":[1],"max":[2],"min":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[8],"variant":[1],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"statusText":[32],"currentIndex":[32],"reset":[64]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"value":["onValueChange"],"placeholder":["onPlaceholderChange"]}]]]]'),e)));
2
2
  //# sourceMappingURL=csc-ui.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","JSON","parse"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.7.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,ypXAAuCH"}
1
+ {"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","JSON","parse"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.7.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,2pXAAuCH"}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as i,h as e,H as n,g as o}from"./p-565ec8e4.js";import{c as s}from"./p-5461ca29.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-dropdown){--_c-dropdown-background-color:var(\n --c-dropdown-background-color,\n var(--c-white)\n );--_c-dropdown-background-color-hover:var(\n --c-dropdown-background-color-hover,\n var(--c-primary-200)\n );--_c-dropdown-text-color:var(--c-dropdown-text-color, var(--c-text-body));--_c-dropdown-text-color-active:var(\n --c-dropdown-text-color-active,\n var(--c-primary-600)\n );--_c-dropdown-font-size:14px;--_c-dropdown-height:42px;display:block;position:relative}:host(c-dropdown) mark{background-color:transparent;box-shadow:0 2px 0 0 var(--_c-dropdown-text-color-active);color:inherit}:host(c-dropdown) dialog{border-radius:4px;background-color:transparent;border:none;margin:-4px 0 0;overflow:visible;padding:4px 0 0;position:fixed}:host(c-dropdown) dialog::backdrop{display:none}:host(c-dropdown) dialog[open].mobile{width:100vw;max-width:100vw;height:100vh;max-height:100svh;inset:0}:host(c-dropdown) dialog[open].mobile .input-top-wrapper{padding:8px}:host(c-dropdown) dialog .input-bottom-wrapper.active{padding-top:8px}:host(c-dropdown) .dummy{display:none}:host(c-dropdown) ul{background-color:var(--_c-dropdown-background-color);box-shadow:2px 4px 10px rgba(0, 0, 0, 0.1607843137);border-radius:4px;list-style:none;margin:0;outline:none;padding:0;pointer-events:auto;visibility:hidden;width:100%;height:max-content;overflow-y:scroll}:host(c-dropdown) ul.active{visibility:visible;animation:0.2s 1 fade-in cubic-bezier(0.25, 0.8, 0.5, 1)}:host(c-dropdown) ul.active.mobile{width:100vw;max-width:100vw;height:100vh;max-height:calc(100svh - 60px)}:host(c-dropdown) li{align-items:center;column-gap:12px;cursor:pointer;display:flex;flex-wrap:nowrap;font-size:var(--_c-dropdown-font-size);min-height:var(--_c-dropdown-height);outline:none;padding-left:10px;padding-right:10px;pointer-events:auto;white-space:nowrap;width:100%;border-radius:4px}:host(c-dropdown) li span,:host(c-dropdown) li c-option-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}:host(c-dropdown) li:not(.disabled):hover,:host(c-dropdown) li:not(.disabled):focus,:host(c-dropdown) li.active{background:var(--_c-dropdown-background-color-hover);color:var(--_c-dropdown-text-color-active);box-shadow:inset 0 0 0 1px var(--_c-dropdown-text-color-active)}:host(c-dropdown) li.disabled{background-color:rgba(var(--c-tertiary-rgb), 0.05);cursor:default;filter:grayscale(1) opacity(0.75)}:host(c-dropdown) .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 a=class{constructor(e){t(this,e);this.selectOption=i(this,"selectOption",7);this.dropdownStateChange=i(this,"dropdownStateChange",7);this._debounce=null;this._isMobile=false;this._listItems=[];this._inputSize={height:0,width:0};this._openedOnTop=false;this._hideDetails=false;this.itemsPerPage=undefined;this.parent=undefined;this.items=undefined;this.index=undefined;this.hostId=undefined;this.type=undefined;this.itemType=undefined;this.renderedList=null;this.isOpen=false;this.statusText=""}optionsWatcher(){requestAnimationFrame((()=>{this.renderedList=this._renderList()}))}stateWatcher(){this.dropdownStateChange.emit(this.isOpen)}handleIndexChange(t){requestAnimationFrame((()=>{this._updateStatusText();this._listItems.forEach(((i,e)=>{i===null||i===void 0?void 0:i.classList.toggle("active",t===e);if(t===e){i===null||i===void 0?void 0:i.focus()}}))}))}async setStatusText(t){requestAnimationFrame((()=>{this.statusText=t}))}async focusItem(t){requestAnimationFrame((()=>{var i;(i=this._listItems[t])===null||i===void 0?void 0:i.focus()}))}async open(){if(this._dialog.open)return;this._outsideClickFn=this._handleOutsideClick.bind(this);window.addEventListener("click",this._outsideClickFn);requestAnimationFrame((()=>{this.isOpen=true;this._positionMenu()}))}async close(){this._dialog.close();this.isOpen=false;this._inputElement.slot="default";this._inputElement.hideDetails=this._hideDetails;this._dummyElement.style.width="0";this._dummyElement.style.display="none";this._dialog.style.width="0";window.removeEventListener("click",this._outsideClickFn)}_setIsMobile(){this._isMobile=window.matchMedia("only screen and (max-width: 760px)").matches}componentDidLoad(){this._setIsMobile();this._hideDetails=this.parent.hideDetails;this._inputElement=this.el.querySelector("c-input");this._resizeObserver=new ResizeObserver((t=>{requestAnimationFrame((()=>{if(!Array.isArray(t)||!t.length)return;this._setIsMobile();if(!this._dialog.open)return;this.close()}))}));this._resizeObserver.observe(window.document.body);requestAnimationFrame((()=>{this.renderedList=this._renderList()}))}async selectItem(t){const i=this._listItems[t];if(i.classList.contains("disabled")){return true}this._listItems[t].click();return false}async updateList(){requestAnimationFrame((()=>{this.renderedList=this._renderList()}))}_handleOutsideClick(t){if(!this.isOpen)return;if(!t.composedPath().includes(this._dialog)){this.close()}}_highlightMatchingText(t){const{query:i}=this.parent;if(this.parent.tagName==="C-SELECT"||i==="")return t;const e=new RegExp(i,"gi");const n=t.replace(/(<([^>]+)>)/gi,"").replace(e,(t=>`<mark>${t}</mark>`));return n}_getParentPosition(){return this.parent.shadowRoot.querySelector(".c-input__slot").getBoundingClientRect()}_positionMenu(){const{innerWidth:t,innerHeight:i}=window;this._dialog.style.width="auto";this._dialog.style.opacity="0";this._dialog.showModal();requestAnimationFrame((()=>{let e="input-top";if(!this._isMobile){const{top:n,width:o}=this._getParentPosition();const s=this.el.getBoundingClientRect();this._inputSize={height:s.height,width:s.width};this._dialog.style.width=`${o}px`;this._dialog.style.top=`${s.top}px`;this._dialog.style.bottom="auto";this._dialog.style.left=`${s.left}px`;const{bottom:r,right:a,height:l}=this._dialog.getBoundingClientRect();const h={x:a<t,y:r<i};const c=n-l>0;if(!c&&!h.y){this._dialog.style.maxHeight=`${n}px`}if(!h.y||this._openedOnTop){this._openedOnTop=true;this._inputElement.hideDetails=true;e="input-bottom";this._dialog.style.top="auto";this._dialog.style.bottom=`${i-s.top-44}px`;this._inputElement.scrollIntoView()}this._dummyElement.style.width=`${this._getParentPosition().width}px`;this._dummyElement.style.height=`${this._inputSize.height}px`;this._dummyElement.style.display="block"}this._dummyElement.slot="default";this._inputElement.slot=e;this._inputElement.hideDetails=true;this._dialog.style.opacity="1";const n=this.parent.shadowRoot.querySelector("input");n.focus()}))}_emptyItem(){const{query:t,loading:i}=this.parent;if(!t||i)return;return e("li",null,e("c-icon",{path:s,size:18,color:"var(--c-warning-600)"}),"No suggestions found")}_renderList(){return this.itemType==="option"?this._renderOptionsList():this._renderItemsList()}_renderOptionsList(){if(!this.items.length)return this._emptyItem();const t=Array.from(this.items);this._listItems.length=0;return t.map(((t,i)=>{const n=t.querySelector("c-option-value");if(n){n.innerHTML=this._highlightMatchingText(n.textContent)}return e("li",{ref:t=>this._listItems.push(t),id:`${this.hostId}-option-${t.value}`,tabindex:"-1",role:"option","aria-set-size":this.items.length.toString(),"aria-pos-in-set":(i+1).toString(),"aria-selected":(!!t.selected).toString(),class:{disabled:!!t.disabled},"data-name":t.name,onClick:i=>{if(t.disabled){i.preventDefault();return}this.selectOption.emit({name:t.name,value:t.value})},innerHTML:t.outerHTML})}))}_renderItemsList(){if(!this.items.length)return this._emptyItem();this._listItems.length=0;return this.items.map(((t,i)=>e("li",{ref:t=>this._listItems.push(t),id:`${this.hostId}-option-${t.value}`,tabindex:"-1",role:"option","aria-set-size":this.items.length.toString(),"aria-pos-in-set":(i+1).toString(),"aria-selected":(this.index===i).toString(),class:{disabled:!!t.disabled},"data-name":t.name,onClick:i=>{if(t.disabled){i.preventDefault();return}this.selectOption.emit({name:t.name,value:t.value})}},e("span",{innerHTML:this._highlightMatchingText(t.name)}))))}_updateStatusText(){if(this._debounce!==null){clearTimeout(this._debounce);this._debounce=null}this._debounce=window.setTimeout((()=>{var t;const i=this._listItems[this.index];const e=!!this.items.length?", to navigate use up and down arrows":"";const n=this._listItems.length;const o=this.index+1;const s=!!((t=i===null||i===void 0?void 0:i.classList)===null||t===void 0?void 0:t.contains("disabled"));const r=s?"Disabled option - ":"";let a=!!i?`${r}${i.dataset.name} - ${o} of ${n} is highlighted`:null;if(this.index===null&&this.type==="autocomplete"){a=this.items.length?`${this.items.length} result${this.items.length!==1?"s":""} available`:"No search results available"}this.statusText=`${a||e}`;this._debounce=null}),1400)}render(){if(!this._isMobile&&this._dialog&&this.itemsPerPage&&this.itemsPerPage>0&&this.items.length>this.itemsPerPage){this._dialog.style.maxHeight=42*(this.itemsPerPage+.5)+60+"px";this._list.style.maxHeight=42*(this.itemsPerPage+.5)+"px"}return e(n,null,e("slot",{name:"default"}),e("div",{class:"dummy",ref:t=>this._dummyElement=t}),e("dialog",{tabindex:"-1",ref:t=>this._dialog=t,class:{mobile:this._isMobile},onCancel:()=>this.close()},e("div",{id:"announce-"+this.hostId,class:"visuallyhidden","aria-live":"polite","aria-atomic":"true"},this.statusText),e("div",{class:"input-top-wrapper"},e("slot",{name:"input-top"})),e("ul",{ref:t=>this._list=t,id:`${this.hostId}--results`,role:"listbox","aria-expanded":this.isOpen.toString(),class:{active:this.isOpen,mobile:this._isMobile},tabindex:"-1"},this.renderedList),e("div",{class:{active:this._openedOnTop,"input-bottom-wrapper":true}},e("slot",{name:"input-bottom"}))))}get el(){return o(this)}static get watchers(){return{items:["optionsWatcher"],isOpen:["stateWatcher"],index:["handleIndexChange"]}}};a.style=r;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(c-input){--_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 input[aria-expanded=true],.c-input textarea:focus,.c-input textarea:active{outline:none}.c-input .c-input__content{align-items:center;display:flex;width:100%}.c-input .c-input__content slot{display:none}.c-input .c-input__content c-icon-button{aspect-ratio:1;margin-right:-6px}.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%;position:relative}.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) 0.08s;white-space:nowrap}.c-input__field label.active{transform:translateY(-18px) scale(0.75)}.c-input__field label span{color:var(--c-error-600)}.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-error-600)}.c-input--error fieldset{border-color:var(--c-error-600) !important}.c-input--error label{color:var(--c-error-600) !important}.c-input--error:focus-within{color:var(--c-error-600)}";const h=class{constructor(e){t(this,e);this.changeValue=i(this,"changeValue",3);this.itemClick=i(this,"itemClick",3);this.dropdownClose=i(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((()=>{if(!this.active){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.variant==="select"){this.itemClick.emit()}}if(this.inputField){this.inputField.placeholder=!!this.value||!this.placeholder?"":this.placeholder}};this.active=false;this.autofocus=false;this.disabled=false;this.form=false;this.hideDetails=false;this.hint="";this.hostId=undefined;this.inputId=undefined;this.items=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()}async reset(){this._onReset()}componentDidLoad(){var t,i,e,n;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=(n=this.label)!==null&&n!==void 0?n: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,n;(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();(n=this._dropdownElement)===null||n===void 0?void 0:n.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}_onReset(){if(this.inputField){if(!!this.placeholder&&!this.value&&(this.active||this.isFocused)){this.inputField.placeholder=this.placeholder;return}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||this.active};return e("fieldset",{"aria-hidden":"true"},e("legend",{class:t,style:{"--_c-input-legend-width":this.labelWidth+"px"}},e("span",{class:"notranslate"})))}_renderLabel(){if(!this.label)return;const t={active:this.isActive};return e("label",{htmlFor:this.inputId,ref:t=>this._labelRef=t,class:t},this.label,this.required&&e("span",null," *"))}get inputField(){var t;return(t=this.el)===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,"c-input--active":this.isFocused||this.active,filled:!!this.value,[`c-input--${this.variant}`]:true};return e(n,{disabled:this.disabled},e("div",{id:"announce-"+this.inputId,class:"visuallyhidden","aria-live":"polite","aria-atomic":"true"},this.statusText),e("div",{class:t},e("div",{class:"c-input__control"},e("div",{class:"c-input__slot",onClick:()=>this._onFocus()},this._renderBorders(),e("div",{class:"c-input__field",style:{"--_c-input-label-position":this.preSlotWidth+"px"}},e("slot",{name:"pre"}),this._renderLabel(),e("slot",null))),this.variant==="select"&&e("slot",{name:"dropdown"}),!this.hideDetails&&e("c-message",{hint:this.hint,inputId:this.inputId,valid:this.valid,validation:this.validation}))))}get el(){return o(this)}static get watchers(){return{valid:["onValidChange"],validation:["onValidationMessageChange"],value:["onValueChange"],placeholder:["onPlaceholderChange"]}}};h.style=l;export{a as c_dropdown,h as c_input};
2
+ //# sourceMappingURL=p-35e770d6.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["cDropdownCss","CDropdown","this","_debounce","_isMobile","_listItems","_inputSize","height","width","_openedOnTop","_hideDetails","optionsWatcher","requestAnimationFrame","renderedList","_renderList","stateWatcher","dropdownStateChange","emit","isOpen","handleIndexChange","index","_updateStatusText","forEach","item","itemIndex","classList","toggle","focus","setStatusText","text","statusText","focusItem","_a","open","_dialog","_outsideClickFn","_handleOutsideClick","bind","window","addEventListener","_positionMenu","close","_inputElement","slot","hideDetails","_dummyElement","style","display","removeEventListener","_setIsMobile","matchMedia","matches","componentDidLoad","parent","el","querySelector","_resizeObserver","ResizeObserver","entries","Array","isArray","length","observe","document","body","selectItem","contains","click","updateList","event","composedPath","includes","_highlightMatchingText","value","query","tagName","regex","RegExp","highlighted","replace","match","_getParentPosition","shadowRoot","getBoundingClientRect","innerWidth","innerHeight","opacity","showModal","inputSlot","top","parentTop","inputSize","bottom","left","right","isInView","x","y","fitsOnTop","maxHeight","scrollIntoView","input","_emptyItem","loading","h","path","mdiAlert","size","color","itemType","_renderOptionsList","_renderItemsList","items","options","from","map","option","optionValue","innerHTML","textContent","ref","push","id","hostId","tabindex","role","toString","selected","class","disabled","name","onClick","preventDefault","selectOption","outerHTML","clearTimeout","setTimeout","selection","ending","total","position","isDisabled","beginning","selectionText","dataset","type","render","itemsPerPage","_list","Host","mobile","onCancel","active","cInputCss","CInput","_hasBlurred","_observer","IntersectionObserver","observer","entry","isIntersecting","_calculateElementWidths","unobserve","target","threshold","_onBlur","isFocused","_onReset","_onFocus","inputField","_b","variant","itemClick","placeholder","onValidChange","validateOnBlur","_setAriaDescriptionId","onValidationMessageChange","onValueChange","onPlaceholderChange","reset","autofocus","label","_labelRef","_c","_preventNonNumericalInput","title","_d","container","closest","disconnectedCallback","disconnect","_dropdownElement","remove","isActive","removeAttribute","valid","hint","setAttribute","inputId","labelWidth","scrollWidth","preSlotWidth","offsetLeft","key","_renderBorders","shadow","classes","_renderLabel","htmlFor","required","validation","containerClasses","rows","filled"],"sources":["src/components/c-dropdown/c-dropdown.scss?tag=c-dropdown&encapsulation=shadow","src/components/c-dropdown/c-dropdown.tsx","src/components/c-input/c-input.scss?tag=c-input","src/components/c-input/c-input.tsx"],"sourcesContent":[":host(c-dropdown) {\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(\n --c-dropdown-background-color,\n var(--c-white)\n );\n --_c-dropdown-background-color-hover: var(\n --c-dropdown-background-color-hover,\n var(--c-primary-200)\n );\n --_c-dropdown-text-color: var(--c-dropdown-text-color, var(--c-text-body));\n --_c-dropdown-text-color-active: var(\n --c-dropdown-text-color-active,\n var(--c-primary-600)\n );\n\n // private\n --_c-dropdown-font-size: 14px;\n --_c-dropdown-height: 42px;\n\n display: block;\n position: relative;\n\n mark {\n background-color: transparent;\n box-shadow: 0 2px 0 0 var(--_c-dropdown-text-color-active);\n color: inherit;\n }\n\n dialog {\n border-radius: 4px;\n background-color: transparent;\n border: none;\n margin: -4px 0 0;\n overflow: visible;\n padding: 4px 0 0;\n position: fixed;\n\n &::backdrop {\n display: none;\n }\n\n &[open].mobile {\n width: 100vw;\n max-width: 100vw;\n height: 100vh;\n max-height: 100svh;\n inset: 0;\n\n .input-top-wrapper {\n padding: 8px;\n }\n }\n\n .input-bottom-wrapper.active {\n padding-top: 8px;\n }\n }\n\n .dummy {\n display: none;\n }\n\n ul {\n background-color: var(--_c-dropdown-background-color);\n box-shadow: 2px 4px 10px #00000029;\n border-radius: 4px;\n list-style: none;\n margin: 0;\n outline: none;\n padding: 0;\n pointer-events: auto;\n visibility: hidden;\n width: 100%;\n height: max-content;\n overflow-y: scroll;\n\n &.active {\n visibility: visible;\n animation: 0.2s 1 fade-in cubic-bezier(0.25, 0.8, 0.5, 1);\n\n &.mobile {\n width: 100vw;\n max-width: 100vw;\n height: 100vh;\n max-height: calc(100svh - 60px);\n }\n }\n }\n\n li {\n align-items: center;\n column-gap: 12px;\n cursor: pointer;\n display: flex;\n flex-wrap: nowrap;\n font-size: var(--_c-dropdown-font-size);\n min-height: var(--_c-dropdown-height);\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n pointer-events: auto;\n white-space: nowrap;\n width: 100%;\n border-radius: 4px;\n\n span,\n c-option-value {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 100%;\n }\n\n &:not(.disabled):hover,\n &:not(.disabled):focus,\n &.active {\n background: var(--_c-dropdown-background-color-hover);\n color: var(--_c-dropdown-text-color-active);\n box-shadow: inset 0 0 0 1px 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 { mdiAlert } from '@mdi/js';\nimport {\n Component,\n Host,\n Prop,\n h,\n Element,\n Method,\n Watch,\n Event,\n EventEmitter,\n State,\n} from '@stencil/core';\nimport { CAutocompleteItem, CSelectItem } from '../../types';\n\n@Component({\n tag: 'c-dropdown',\n styleUrl: 'c-dropdown.scss',\n shadow: true,\n})\nexport class CDropdown {\n @Element() el: HTMLCDropdownElement;\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 options\n */\n @Prop() items:\n | NodeListOf<HTMLCOptionElement>\n | CAutocompleteItem[]\n | CSelectItem[];\n\n /**\n * Current index value\n */\n @Prop() index: number;\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Triggered when option is selected\n */\n @Event() selectOption: EventEmitter;\n\n /**\n * Type of the parent element\n */\n @Prop() type: 'select' | 'autocomplete';\n\n /**\n * Type of items\n */\n @Prop() itemType: 'option' | 'item';\n\n /**\n * Triggered when dropdown opens or closes\n */\n @Event() dropdownStateChange: EventEmitter<boolean>;\n\n /**\n * Dropdown dialog element\n */\n private _dialog: HTMLDialogElement;\n\n private _debounce = null;\n\n private _list: HTMLUListElement;\n\n private _outsideClickFn: () => void;\n\n private _resizeObserver: ResizeObserver;\n\n private _inputElement: HTMLCInputElement;\n\n private _dummyElement: HTMLDivElement;\n\n private _isMobile = false;\n\n private _listItems: HTMLLIElement[] = [];\n\n @State() renderedList = null;\n\n @State() isOpen = false;\n\n @State() statusText = '';\n\n @Watch('items')\n optionsWatcher() {\n requestAnimationFrame(() => {\n this.renderedList = this._renderList();\n });\n }\n\n @Watch('isOpen')\n stateWatcher() {\n this.dropdownStateChange.emit(this.isOpen);\n }\n\n @Watch('index')\n handleIndexChange(index) {\n requestAnimationFrame(() => {\n this._updateStatusText();\n\n this._listItems.forEach((item, itemIndex) => {\n item?.classList.toggle('active', index === itemIndex);\n\n if (index === itemIndex) {\n item?.focus();\n }\n });\n });\n }\n\n /**\n * @private\n */\n @Method()\n async setStatusText(text: string) {\n requestAnimationFrame(() => {\n this.statusText = text;\n });\n }\n\n /**\n * @private\n */\n @Method()\n async focusItem(index: number) {\n requestAnimationFrame(() => {\n this._listItems[index]?.focus();\n });\n }\n\n /**\n * Open dropdown\n */\n @Method()\n async open() {\n if (this._dialog.open) return;\n\n this._outsideClickFn = this._handleOutsideClick.bind(this);\n\n window.addEventListener('click', this._outsideClickFn);\n\n requestAnimationFrame(() => {\n this.isOpen = true;\n\n this._positionMenu();\n });\n }\n\n /**\n * Open dropdown\n */\n @Method()\n async close() {\n this._dialog.close();\n\n this.isOpen = false;\n\n this._inputElement.slot = 'default';\n\n this._inputElement.hideDetails = this._hideDetails;\n\n this._dummyElement.style.width = '0';\n this._dummyElement.style.display = 'none';\n this._dialog.style.width = '0';\n\n window.removeEventListener('click', this._outsideClickFn);\n }\n\n private _setIsMobile() {\n this._isMobile = window.matchMedia(\n 'only screen and (max-width: 760px)',\n ).matches;\n }\n\n componentDidLoad() {\n this._setIsMobile();\n\n this._hideDetails = this.parent.hideDetails;\n\n this._inputElement = this.el.querySelector('c-input');\n\n this._resizeObserver = new ResizeObserver((entries) => {\n requestAnimationFrame(() => {\n if (!Array.isArray(entries) || !entries.length) return;\n\n this._setIsMobile();\n\n if (!this._dialog.open) return;\n\n this.close();\n });\n });\n\n this._resizeObserver.observe(window.document.body);\n\n requestAnimationFrame(() => {\n this.renderedList = this._renderList();\n });\n }\n\n /**\n * Select item\n * @returns the disabled status of the input\n */\n @Method()\n async selectItem(index: number) {\n const item = this._listItems[index];\n\n if (item.classList.contains('disabled')) {\n return true;\n }\n\n this._listItems[index].click();\n\n return false;\n }\n\n /**\n * Update list items\n */\n @Method()\n async updateList() {\n requestAnimationFrame(() => {\n this.renderedList = this._renderList();\n });\n }\n\n private _handleOutsideClick(event) {\n if (!this.isOpen) return;\n\n if (!event.composedPath().includes(this._dialog)) {\n this.close();\n }\n }\n\n private _inputSize = {\n height: 0,\n width: 0,\n };\n\n private _openedOnTop = false;\n\n private _hideDetails = false;\n\n private _highlightMatchingText(value: string) {\n const { query } = this.parent as HTMLCAutocompleteElement;\n\n if (this.parent.tagName === 'C-SELECT' || query === '') return value;\n\n const regex = new RegExp(query, 'gi');\n\n const highlighted = value\n .replace(/(<([^>]+)>)/gi, '')\n .replace(regex, (match) => `<mark>${match}</mark>`);\n\n return highlighted;\n }\n\n private _getParentPosition() {\n return this.parent.shadowRoot\n .querySelector('.c-input__slot')\n .getBoundingClientRect();\n }\n\n private _positionMenu() {\n const { innerWidth, innerHeight } = window;\n\n this._dialog.style.width = 'auto';\n this._dialog.style.opacity = '0';\n\n this._dialog.showModal();\n\n requestAnimationFrame(() => {\n let inputSlot = 'input-top';\n\n if (!this._isMobile) {\n const { top: parentTop, width } = this._getParentPosition();\n\n const inputSize = this.el.getBoundingClientRect();\n\n this._inputSize = {\n height: inputSize.height,\n width: inputSize.width,\n };\n\n this._dialog.style.width = `${width}px`;\n this._dialog.style.top = `${inputSize.top}px`;\n this._dialog.style.bottom = 'auto';\n this._dialog.style.left = `${inputSize.left}px`;\n\n const { bottom, right, height } = this._dialog.getBoundingClientRect();\n\n const isInView = {\n x: right < innerWidth,\n y: bottom < innerHeight,\n };\n\n const fitsOnTop = parentTop - height > 0;\n\n if (!fitsOnTop && !isInView.y) {\n this._dialog.style.maxHeight = `${parentTop}px`;\n }\n\n if (!isInView.y || this._openedOnTop) {\n this._openedOnTop = true;\n\n this._inputElement.hideDetails = true;\n inputSlot = 'input-bottom';\n\n this._dialog.style.top = 'auto';\n this._dialog.style.bottom = `${innerHeight - inputSize.top - 44}px`;\n this._inputElement.scrollIntoView();\n }\n\n this._dummyElement.style.width = `${this._getParentPosition().width}px`;\n this._dummyElement.style.height = `${this._inputSize.height}px`;\n this._dummyElement.style.display = 'block';\n }\n\n this._dummyElement.slot = 'default';\n\n this._inputElement.slot = inputSlot;\n\n this._inputElement.hideDetails = true;\n\n this._dialog.style.opacity = '1';\n\n const input = this.parent.shadowRoot.querySelector('input');\n\n input.focus();\n });\n }\n\n private _emptyItem() {\n const { query, loading } = this.parent as HTMLCAutocompleteElement;\n\n if (!query || loading) return;\n\n return (\n <li>\n <c-icon path={mdiAlert} size={18} color=\"var(--c-warning-600)\"></c-icon>\n No suggestions found\n </li>\n );\n }\n\n private _renderList() {\n return this.itemType === 'option'\n ? this._renderOptionsList()\n : this._renderItemsList();\n }\n\n private _renderOptionsList() {\n if (!this.items.length) return this._emptyItem();\n\n const options = Array.from(this.items) as HTMLCOptionElement[];\n\n this._listItems.length = 0;\n\n return options.map((option, index) => {\n const optionValue = option.querySelector('c-option-value');\n\n if (optionValue) {\n optionValue.innerHTML = this._highlightMatchingText(\n optionValue.textContent,\n );\n }\n\n return (\n <li\n ref={(el) => this._listItems.push(el)}\n id={`${this.hostId}-option-${option.value}`}\n tabindex=\"-1\"\n role=\"option\"\n aria-set-size={this.items.length.toString()}\n aria-pos-in-set={(index + 1).toString()}\n aria-selected={(!!option.selected).toString()}\n class={{ disabled: !!option.disabled }}\n data-name={option.name}\n onClick={(event) => {\n if (option.disabled) {\n event.preventDefault();\n\n return;\n }\n\n this.selectOption.emit({ name: option.name, value: option.value });\n }}\n innerHTML={option.outerHTML}\n ></li>\n );\n });\n }\n\n private _renderItemsList() {\n if (!this.items.length) return this._emptyItem();\n\n this._listItems.length = 0;\n\n return (this.items as unknown as CAutocompleteItem[]).map((item, index) => {\n return (\n <li\n ref={(el) => this._listItems.push(el)}\n id={`${this.hostId}-option-${item.value}`}\n tabindex=\"-1\"\n role=\"option\"\n aria-set-size={this.items.length.toString()}\n aria-pos-in-set={(index + 1).toString()}\n aria-selected={(this.index === index).toString()}\n class={{ disabled: !!item.disabled }}\n data-name={item.name}\n onClick={(event) => {\n if (item.disabled) {\n event.preventDefault();\n\n return;\n }\n\n this.selectOption.emit({ name: item.name, value: item.value });\n }}\n >\n <span innerHTML={this._highlightMatchingText(item.name)}></span>\n </li>\n );\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._listItems[this.index];\n\n const ending = !!this.items.length\n ? ', to navigate use up and down arrows'\n : '';\n\n const total = this._listItems.length;\n\n const position = this.index + 1;\n\n const isDisabled = !!selection?.classList?.contains('disabled');\n\n const beginning = isDisabled ? 'Disabled option - ' : '';\n\n let selectionText = !!selection\n ? `${beginning}${selection.dataset.name} - ${position} of ${total} is highlighted`\n : null;\n\n if (this.index === 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 render() {\n if (\n !this._isMobile &&\n this._dialog &&\n this.itemsPerPage &&\n this.itemsPerPage > 0 &&\n this.items.length > this.itemsPerPage\n ) {\n this._dialog.style.maxHeight = 42 * (this.itemsPerPage + 0.5) + 60 + 'px';\n this._list.style.maxHeight = 42 * (this.itemsPerPage + 0.5) + 'px';\n }\n\n return (\n <Host>\n <slot name=\"default\"></slot>\n\n <div class=\"dummy\" ref={(el) => (this._dummyElement = el)}></div>\n\n <dialog\n tabindex=\"-1\"\n ref={(el) => (this._dialog = el)}\n class={{ mobile: this._isMobile }}\n onCancel={() => this.close()}\n >\n <div\n id={'announce-' + this.hostId}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n\n <div class=\"input-top-wrapper\">\n <slot name=\"input-top\"></slot>\n </div>\n\n <ul\n ref={(el) => (this._list = el)}\n id={`${this.hostId}--results`}\n role=\"listbox\"\n aria-expanded={this.isOpen.toString()}\n class={{ active: this.isOpen, mobile: this._isMobile }}\n tabindex=\"-1\"\n >\n {this.renderedList}\n </ul>\n\n <div\n class={{ active: this._openedOnTop, 'input-bottom-wrapper': true }}\n >\n <slot name=\"input-bottom\"></slot>\n </div>\n </dialog>\n </Host>\n );\n }\n}\n",":host(c-input) {\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 input[aria-expanded=\"true\"],\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 slot {\n display: none;\n }\n\n c-icon-button {\n aspect-ratio: 1;\n margin-right: -6px;\n }\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 position: relative;\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) 0.08s;\n white-space: nowrap;\n\n &.active {\n transform: translateY(-18px) scale(0.75);\n }\n\n span {\n color: var(--c-error-600);\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-error-600);\n\n fieldset {\n border-color: var(--c-error-600) !important;\n }\n\n label {\n color: var(--c-error-600) !important;\n }\n\n &:focus-within {\n color: var(--c-error-600);\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';\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 @Element() el!: HTMLCInputElement;\n\n /**\n * Active state\n */\n @Prop() active = false;\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 * 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 for the dropdown\n */\n @Prop() items: CSelectItem[];\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 @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 _dropdownElement: HTMLCDropdownElement;\n\n /**\n * @private\n */\n @Method()\n async reset() {\n this._onReset();\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 _onBlur = () => {\n // delay the blur event to prevent the label from 'flashing' on c-select selection\n setTimeout(() => {\n if (!this.active) {\n this.isFocused = false;\n this._hasBlurred = true;\n }\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.variant === 'select') {\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 if (\n !!this.placeholder &&\n !this.value &&\n (this.active || this.isFocused)\n ) {\n this.inputField.placeholder = this.placeholder;\n\n return;\n }\n\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 || this.active,\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.el?.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 'c-input--active': this.isFocused || this.active,\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.variant === 'select' && <slot name=\"dropdown\"></slot>}\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"],"mappings":"oGAAA,MAAMA,EAAe,ywF,MCoBRC,EAAS,M,6HAwDZC,KAAAC,UAAY,KAYZD,KAAAE,UAAY,MAEZF,KAAAG,WAA8B,GAgK9BH,KAAAI,WAAa,CACnBC,OAAQ,EACRC,MAAO,GAGDN,KAAAO,aAAe,MAEfP,KAAAQ,aAAe,M,gLArKC,K,YAEN,M,gBAEI,E,CAGtB,cAAAC,GACEC,uBAAsB,KACpBV,KAAKW,aAAeX,KAAKY,aAAa,G,CAK1C,YAAAC,GACEb,KAAKc,oBAAoBC,KAAKf,KAAKgB,O,CAIrC,iBAAAC,CAAkBC,GAChBR,uBAAsB,KACpBV,KAAKmB,oBAELnB,KAAKG,WAAWiB,SAAQ,CAACC,EAAMC,KAC7BD,IAAI,MAAJA,SAAI,SAAJA,EAAME,UAAUC,OAAO,SAAUN,IAAUI,GAE3C,GAAIJ,IAAUI,EAAW,CACvBD,IAAI,MAAJA,SAAI,SAAJA,EAAMI,O,IAER,G,CAQN,mBAAMC,CAAcC,GAClBjB,uBAAsB,KACpBV,KAAK4B,WAAaD,CAAI,G,CAQ1B,eAAME,CAAUX,GACdR,uBAAsB,K,OACpBoB,EAAA9B,KAAKG,WAAWe,MAAM,MAAAY,SAAA,SAAAA,EAAEL,OAAO,G,CAQnC,UAAMM,GACJ,GAAI/B,KAAK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KAAKoK,WAAapK,KAAKsJ,OAC1C8D,SAAUpN,KAAKuE,MACf,CAAC,YAAYvE,KAAKyK,WAAY,MAGhC,OACEnE,EAAC6C,EAAI,CAACpB,SAAU/H,KAAK+H,UACnBzB,EAAA,OACEkB,GAAI,YAAcxH,KAAKqM,QACvBvE,MAAM,iBAAgB,YACZ,SAAQ,cACN,QAEX9H,KAAK4B,YAGR0E,EAAA,OAAKwB,MAAOoF,GACV5G,EAAA,OAAKwB,MAAM,oBACTxB,EAAA,OAAKwB,MAAM,gBAAgBG,QAAS,IAAMjI,KAAKsK,YAC5CtK,KAAK2M,iBAENrG,EAAA,OACEwB,MAAM,iBACNlF,MAAO,CACL,4BAA6B5C,KAAKwM,aAAe,OAGnDlG,EAAA,QAAM0B,KAAK,QAEVhI,KAAK8M,eAENxG,EAAA,eAIHtG,KAAKyK,UAAY,UAAYnE,EAAA,QAAM0B,KAAK,cAEvChI,KAAK0C,aACL4D,EAAA,aACE6F,KAAMnM,KAAKmM,KACXE,QAASrM,KAAKqM,QACdH,MAAOlM,KAAKkM,MACZe,WAAYjN,KAAKiN,e"}
@@ -1,2 +1,2 @@
1
- import{r,c as o,h as i,g as a}from"./p-565ec8e4.js";import{d as t}from"./p-5461ca29.js";const e='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-radio-group-background-color-hover:var(--c-radio-group-background-color-hover, rgba(var(--c-primary-rgb), 0.1));--_c-radio-group-color:var(--c-radio-group-color, var(--c-primary-600));--_c-radio-group-color-active:var(--c-radio-group-color-active, var(--_c-radio-group-color));--_c-radio-group-color-disabled:var(--c-radio-group-color-disabled, var(--c-tertiary-500));display:flex;flex-direction:column;gap:4px;width:fit-content}.c-radio-group{--_c-radio-group-error-color:var(--c-error-600);--_c-radio-flex-direction:column;--_c-radio-item-gap:2px}.c-radio-group__items{display:flex;flex-flow:var(--_c-radio-flex-direction) wrap;gap:var(--_c-radio-item-gap)}.c-radio-group__label span.required{color:var(--_c-radio-group-error-color)}.c-radio-group--disabled{--_c-radio-group-color:var(--_c-radio-group-color-disabled);--_c-radio-group-error-color:var(--_c-radio-group-color-disabled);color:var(--_c-radio-group-color-disabled);cursor:default;opacity:0.75}.c-radio-group--error{--_c-radio-group-color:var(--_c-radio-group-error-color);--_c-radio-group-color-active:var(--_c-radio-group-error-color);color:var(--_c-radio-group-error-color)}.c-radio-group--inline{--_c-radio-flex-direction:row;--_c-radio-item-gap:12px}.c-radio{align-items:flex-start;display:flex;position:relative;cursor:pointer;font-size:16px;user-select:none;gap:4px;line-height:1.2}.c-radio input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.c-radio input:checked~.ripple .selection::after{display:block;transform:scale(1)}.c-radio .ripple{position:relative;height:42px;width:42px;min-width:42px;border-radius:50%;overflow:hidden;transition:translateZ(0);color:var(--_c-radio-group-color)}.c-radio .selection{position:absolute;top:11px;left:11px;height:20px;width:20px;background-color:transparent;box-shadow:inset 0 0 0 2px var(--_c-radio-group-color);border-radius:50%;transition:box-shadow 0.15s ease-in-out}.c-radio .selection::after{content:"";position:absolute;transform:scale(0);transition:transform 0.15s ease-in-out;top:5px;left:5px;width:10px;height:10px;border-radius:50%;background:var(--_c-radio-group-color-active)}.c-radio__details{line-height:1;padding:0 12px}.c-radio__details.active .c-radio__message{opacity:1;transform:translateY(0)}.c-radio__message{font-size:12px;opacity:0;transform:translateY(-4px);transition:all 0.2s cubic-bezier(0.25, 0.8, 0.5, 1)}.c-radio__message--hint{color:var(--c-tertiary-500)}.c-radio__message--error{color:var(--_c-radio-group-error-color) !important}.c-radio__message span{align-items:flex-start;display:flex;gap:4px;height:16px}.c-radio__message span.error{color:var(--_c-radio-group-error-color)}.c-radio__message span.hint{color:var(--c-tertiary-500)}.c-radio__message svg{fill:currentColor;min-height:16px;min-width:16px;position:relative;top:-2px}.c-radio__label{padding-top:12px}.c-radio--disabled{--_c-radio-group-color:var(--_c-radio-group-color-disabled);--_c-radio-group-color-active:var(--_c-radio-group-color-disabled);color:var(--_c-radio-group-color);cursor:default;opacity:0.75}.c-radio--error{--_c-radio-group-color:var(--_c-radio-group-error-color);color:var(--_c-radio-group-error-color)}.c-radio--error span,.c-radio--error svg{fill:var(--_c-radio-group-error-color);color:var(--_c-radio-group-error-color)}.c-radio input:focus{outline:none}.c-radio input:focus+.ripple{outline:2px var(--_c-radio-group-color-active) solid}@supports selector(:focus-visible){.c-radio input:focus+.ripple{outline:none}}.c-radio input:focus-visible+.ripple{outline:2px var(--_c-radio-group-color) solid}.c-radio:not(.c-radio--disabled) .ripple:hover{background-color:var(--_c-radio-group-background-color-hover)}';const s=class{constructor(a){r(this,a);this.changeValue=o(this,"changeValue",3);if(a.$hostElement$["s-ei"]){this.internals=a.$hostElement$["s-ei"]}else{this.internals=a.$hostElement$.attachInternals();a.$hostElement$["s-ei"]=this.internals}this._containers=[];this._rippleElements=[];this._handleSlotChange=()=>{this._getRadioButtons()};this._getRadioButtons=()=>{const r=this.el.querySelectorAll("c-radio");if(r.length){this.returnValue=true;this.items=[...Array.from(r).map((r=>{if(!!r.checked){this.value=r.value;this.changeValue.emit(this.value)}r.style.display="none";return{name:r.textContent,value:r.value,disabled:!!r.disabled}}))]}};this._getRadioButton=(r,o)=>{var a,t,e;const c=r.value.toString().replace(/[^a-zA-Z0-9-_]/g,"");const l=this.returnValue?((t=(a=this.items)===null||a===void 0?void 0:a.find((o=>o.value===r.value)))===null||t===void 0?void 0:t.value)===this.value:((e=this.value)===null||e===void 0?void 0:e.value)===r.value;const d={"c-radio":true,"c-radio--disabled":!!r.disabled||this.disabled,"c-radio--error":this.messageOptions.type==="error"};return i("label",{class:d,id:c,onKeyDown:i=>this._handleKeyDown(i,r,o)},i("input",{type:"radio","aria-checked":(this.value===r).toString(),"aria-disabled":(!!r.disabled||this.disabled).toString(),"aria-labelledby":c,disabled:!!r.disabled||this.disabled,checked:l,name:s._uniqueId.toString(),onChange:i=>this._select(i,r,o)}),i("span",{class:"ripple",ref:r=>this._containers[o]=r},i("span",{class:"selection"}),i("c-ripple",{ref:r=>this._rippleElements[o]=r})),i("div",{class:"c-radio__label"},r.name))};this._validationIcon=i("svg",{height:"16px",width:"16px",viewBox:"0 0 24 24"},i("path",{d:t}));this.value=undefined;this.hideDetails=false;this.hint="";this.inline=false;this.label=undefined;this.color="";this.items=[];this.disabled=false;this.returnValue=false;this.required=false;this.valid=true;this.validation="Required field";this.messageOptions={show:true,type:"hint",content:""}}onValidationMessageChange(r){this.onValidChange(r.length===0)}onValidChange(r){this._handleValidation(r||this.valid)}componentDidLoad(){this._handleValidation(this.valid,0)}_handleKeyDown(r,o,i){if(["Space","Enter"].includes(r.code)){r.preventDefault();this._select(r,o,i)}}_handleValidation(r,o=200){this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{show:false});setTimeout((()=>{this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{type:r?"hint":"error",show:true,content:r?i("span",null,this.hint):i("span",null,this._validationIcon," ",this.validation)})}),o)}_select(r,o,i){if(!!o.disabled||this.disabled)return;this._rippleElements[i].createRipple(r,this._containers[i],true);this.value=this.returnValue?o===null||o===void 0?void 0:o.value:o;this.changeValue.emit(this.value);const a=this.returnValue?this.value:this.value.value;this.internals.setFormValue(a)}_renderMessages(){if(this.hideDetails)return;const r={"c-radio__details":true,active:this.messageOptions.show};const o={"c-radio__message":true,[`c-radio__message--${this.messageOptions.type}`]:true};return i("div",{class:r},i("div",{class:o},this.messageOptions.content))}componentWillLoad(){s._uniqueId+=1;if(this.value){const r=this.returnValue?this.value:this.value.value;this.internals.setFormValue(r)}}render(){const r=!!this.el.childNodes.length;const o={"c-radio-group":true,"c-radio-group--disabled":this.disabled,"c-radio-group--inline":this.inline,"c-radio-group--error":this.messageOptions.type==="error"};return i("div",{class:o,role:"radiogroup","aria-labelledby":"c-radio-group__label"},(!!this.label||r)&&i("label",{class:"c-radio-group__label"},!!this.label&&this.label,i("slot",{onSlotchange:this._handleSlotChange}),this.required&&i("span",{class:"required"}," *")),i("div",{class:"c-radio-group__items"},this.items.map(((r,o)=>this._getRadioButton(r,o)))),this._renderMessages())}static get formAssociated(){return true}get el(){return a(this)}static get watchers(){return{validation:["onValidationMessageChange"],valid:["onValidChange"]}}};s._uniqueId=0;s.style=e;export{s as c_radio_group};
2
- //# sourceMappingURL=p-a9ed6afb.entry.js.map
1
+ import{r,c as o,h as i,g as a}from"./p-565ec8e4.js";import{d as t}from"./p-5461ca29.js";const e='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-radio-group-background-color-hover:var(--c-radio-group-background-color-hover, rgba(var(--c-primary-rgb), 0.1));--_c-radio-group-color:var(--c-radio-group-color, var(--c-primary-600));--_c-radio-group-color-active:var(--c-radio-group-color-active, var(--_c-radio-group-color));--_c-radio-group-color-disabled:var(--c-radio-group-color-disabled, var(--c-tertiary-500));display:flex;flex-direction:column;gap:4px;width:fit-content}.c-radio-group{--_c-radio-group-error-color:var(--c-error-600);--_c-radio-flex-direction:column;--_c-radio-item-gap:2px}.c-radio-group__items{display:flex;flex-flow:var(--_c-radio-flex-direction) wrap;gap:var(--_c-radio-item-gap)}.c-radio-group__label span.required{color:var(--_c-radio-group-error-color)}.c-radio-group--disabled{--_c-radio-group-color:var(--_c-radio-group-color-disabled);--_c-radio-group-error-color:var(--_c-radio-group-color-disabled);color:var(--_c-radio-group-color-disabled);cursor:default;opacity:0.75}.c-radio-group--error{--_c-radio-group-color:var(--_c-radio-group-error-color);--_c-radio-group-color-active:var(--_c-radio-group-error-color);color:var(--_c-radio-group-error-color)}.c-radio-group--inline{--_c-radio-flex-direction:row;--_c-radio-item-gap:12px}.c-radio{align-items:flex-start;display:flex;position:relative;cursor:pointer;font-size:16px;user-select:none;gap:4px;line-height:1.2}.c-radio input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.c-radio input:checked~.ripple .selection::after{display:block;transform:scale(1)}.c-radio .ripple{position:relative;height:42px;width:42px;min-width:42px;border-radius:50%;overflow:hidden;transition:translateZ(0);color:var(--_c-radio-group-color)}.c-radio .selection{position:absolute;top:11px;left:11px;height:20px;width:20px;background-color:transparent;box-shadow:inset 0 0 0 2px var(--_c-radio-group-color);border-radius:50%;transition:box-shadow 0.15s ease-in-out}.c-radio .selection::after{content:"";position:absolute;transform:scale(0);transition:transform 0.15s ease-in-out;top:5px;left:5px;width:10px;height:10px;border-radius:50%;background:var(--_c-radio-group-color-active)}.c-radio__details{line-height:1;padding:0 12px}.c-radio__details.active .c-radio__message{opacity:1;transform:translateY(0)}.c-radio__message{font-size:12px;opacity:0;transform:translateY(-4px);transition:all 0.2s cubic-bezier(0.25, 0.8, 0.5, 1)}.c-radio__message--hint{color:var(--c-tertiary-500)}.c-radio__message--error{color:var(--_c-radio-group-error-color) !important}.c-radio__message span{align-items:flex-start;display:flex;gap:4px;height:16px}.c-radio__message span.error{color:var(--_c-radio-group-error-color)}.c-radio__message span.hint{color:var(--c-tertiary-500)}.c-radio__message svg{fill:currentColor;min-height:16px;min-width:16px;position:relative;top:-2px}.c-radio__label{padding-top:12px}.c-radio--disabled{--_c-radio-group-color:var(--_c-radio-group-color-disabled);--_c-radio-group-color-active:var(--_c-radio-group-color-disabled);color:var(--_c-radio-group-color);cursor:default;opacity:0.75}.c-radio--error{--_c-radio-group-color:var(--_c-radio-group-error-color);color:var(--_c-radio-group-error-color)}.c-radio--error span,.c-radio--error svg{fill:var(--_c-radio-group-error-color);color:var(--_c-radio-group-error-color)}.c-radio input:focus{outline:none}.c-radio input:focus+.ripple{outline:2px var(--_c-radio-group-color-active) solid}@supports selector(:focus-visible){.c-radio input:focus+.ripple{outline:none}}.c-radio input:focus-visible+.ripple{outline:2px var(--_c-radio-group-color) solid}.c-radio:not(.c-radio--disabled) .ripple:hover{background-color:var(--_c-radio-group-background-color-hover)}';const s=class{constructor(a){r(this,a);this.changeValue=o(this,"changeValue",3);if(a.$hostElement$["s-ei"]){this.internals=a.$hostElement$["s-ei"]}else{this.internals=a.$hostElement$.attachInternals();a.$hostElement$["s-ei"]=this.internals}this._containers=[];this._rippleElements=[];this._handleSlotChange=()=>{this._getRadioButtons()};this._getRadioButtons=()=>{const r=this.el.querySelectorAll("c-radio");if(r.length){this.returnObject=false;this.items=[...Array.from(r).map((r=>{if(!!r.checked){this.value=r.value;this.changeValue.emit(this.value)}r.style.display="none";return{name:r.textContent,value:r.value,disabled:!!r.disabled}}))]}};this._getRadioButton=(r,o)=>{var a,t,e;const c=r.value.toString().replace(/[^a-zA-Z0-9-_]/g,"");const l=!this.returnObject?((t=(a=this.items)===null||a===void 0?void 0:a.find((o=>o.value===r.value)))===null||t===void 0?void 0:t.value)===this.value:((e=this.value)===null||e===void 0?void 0:e.value)===r.value;const d={"c-radio":true,"c-radio--disabled":!!r.disabled||this.disabled,"c-radio--error":this.messageOptions.type==="error"};return i("label",{class:d,id:c,onKeyDown:i=>this._handleKeyDown(i,r,o)},i("input",{type:"radio","aria-checked":(this.value===r).toString(),"aria-disabled":(!!r.disabled||this.disabled).toString(),"aria-labelledby":c,disabled:!!r.disabled||this.disabled,checked:l,name:s._uniqueId.toString(),onChange:i=>this._select(i,r,o)}),i("span",{class:"ripple",ref:r=>this._containers[o]=r},i("span",{class:"selection"}),i("c-ripple",{ref:r=>this._rippleElements[o]=r})),i("div",{class:"c-radio__label"},r.name))};this._validationIcon=i("svg",{height:"16px",width:"16px",viewBox:"0 0 24 24"},i("path",{d:t}));this.value=undefined;this.hideDetails=false;this.hint="";this.inline=false;this.label=undefined;this.color="";this.items=[];this.disabled=false;this.returnObject=false;this.required=false;this.valid=true;this.validation="Required field";this.messageOptions={show:true,type:"hint",content:""}}onValidationMessageChange(r){this.onValidChange(r.length===0)}onValidChange(r){this._handleValidation(r||this.valid)}componentDidLoad(){this._handleValidation(this.valid,0)}_handleKeyDown(r,o,i){if(["Space","Enter"].includes(r.code)){r.preventDefault();this._select(r,o,i)}}_handleValidation(r,o=200){this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{show:false});setTimeout((()=>{this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{type:r?"hint":"error",show:true,content:r?i("span",null,this.hint):i("span",null,this._validationIcon," ",this.validation)})}),o)}_select(r,o,i){if(!!o.disabled||this.disabled)return;this._rippleElements[i].createRipple(r,this._containers[i],true);this.value=!this.returnObject?o===null||o===void 0?void 0:o.value:o;this.changeValue.emit(this.value);const a=!this.returnObject?this.value:this.value.value;this.internals.setFormValue(a)}_renderMessages(){if(this.hideDetails)return;const r={"c-radio__details":true,active:this.messageOptions.show};const o={"c-radio__message":true,[`c-radio__message--${this.messageOptions.type}`]:true};return i("div",{class:r},i("div",{class:o},this.messageOptions.content))}componentWillLoad(){s._uniqueId+=1;if(this.value){const r=!this.returnObject?this.value:this.value.value;this.internals.setFormValue(r)}}render(){const r=!!this.el.childNodes.length;const o={"c-radio-group":true,"c-radio-group--disabled":this.disabled,"c-radio-group--inline":this.inline,"c-radio-group--error":this.messageOptions.type==="error"};return i("div",{class:o,role:"radiogroup","aria-labelledby":"c-radio-group__label"},(!!this.label||r)&&i("label",{class:"c-radio-group__label"},!!this.label&&this.label,i("slot",{onSlotchange:this._handleSlotChange}),this.required&&i("span",{class:"required"}," *")),i("div",{class:"c-radio-group__items"},this.items.map(((r,o)=>this._getRadioButton(r,o)))),this._renderMessages())}static get formAssociated(){return true}get el(){return a(this)}static get watchers(){return{validation:["onValidationMessageChange"],valid:["onValidChange"]}}};s._uniqueId=0;s.style=e;export{s as c_radio_group};
2
+ //# sourceMappingURL=p-64bcde03.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["cRadioGroupCss","CRadioGroup","this","_containers","_rippleElements","_handleSlotChange","_getRadioButtons","radios","el","querySelectorAll","length","returnObject","items","Array","from","map","radio","checked","value","changeValue","emit","style","display","name","textContent","disabled","_getRadioButton","item","index","itemId","toString","replace","isChecked","_b","_a","find","i","_c","classes","messageOptions","type","h","class","id","onKeyDown","event","_handleKeyDown","_uniqueId","onChange","_select","ref","_validationIcon","height","width","viewBox","d","mdiCloseCircle","show","content","onValidationMessageChange","message","onValidChange","valid","_handleValidation","componentDidLoad","includes","code","preventDefault","timeout","Object","assign","setTimeout","hint","validation","createRipple","internals","setFormValue","_renderMessages","hideDetails","active","messageClasses","componentWillLoad","render","slotHasContent","childNodes","wrapperClasses","inline","role","label","onSlotchange","required"],"sources":["src/components/c-radio-group/c-radio-group.scss?tag=c-radio-group&encapsulation=shadow","src/components/c-radio-group/c-radio-group.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-radio-group-background-color-hover: Radio button hover background color\n * @prop --c-radio-group-color: Radio button color\n * @prop --c-radio-group-color-active: Active radio button color\n * @prop --c-radio-group-color-disabled: Disabled radio button color\n */\n --_c-radio-group-background-color-hover: var(--c-radio-group-background-color-hover, rgba(var(--c-primary-rgb), 0.1));\n --_c-radio-group-color: var(--c-radio-group-color, var(--c-primary-600));\n --_c-radio-group-color-active: var(--c-radio-group-color-active, var(--_c-radio-group-color));\n --_c-radio-group-color-disabled: var(--c-radio-group-color-disabled, var(--c-tertiary-500));\n\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: fit-content;\n}\n\n.c-radio-group {\n --_c-radio-group-error-color: var(--c-error-600);\n --_c-radio-flex-direction: column;\n --_c-radio-item-gap: 2px;\n\n &__items {\n display: flex;\n flex-flow: var(--_c-radio-flex-direction) wrap;\n gap: var(--_c-radio-item-gap);\n }\n\n &__label {\n span.required {\n color: var(--_c-radio-group-error-color);\n }\n }\n\n &--disabled {\n --_c-radio-group-color: var(--_c-radio-group-color-disabled);\n --_c-radio-group-error-color: var(--_c-radio-group-color-disabled);\n\n color: var(--_c-radio-group-color-disabled);\n cursor: default;\n opacity: 0.75;\n }\n\n &--error {\n --_c-radio-group-color: var(--_c-radio-group-error-color);\n --_c-radio-group-color-active: var(--_c-radio-group-error-color);\n\n color: var(--_c-radio-group-error-color);\n }\n\n &--inline {\n --_c-radio-flex-direction: row;\n --_c-radio-item-gap: 12px;\n }\n}\n\n.c-radio {\n $this: &;\n\n align-items: flex-start;\n display: flex;\n position: relative;\n cursor: pointer;\n font-size: 16px;\n user-select: none;\n gap: 4px;\n line-height: 1.2;\n\n input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n\n &:checked ~ .ripple .selection {\n &::after {\n display: block;\n transform: scale(1);\n }\n }\n }\n\n .ripple {\n position: relative;\n height: 42px;\n width: 42px;\n min-width: 42px;\n border-radius: 50%;\n overflow: hidden;\n transition: translateZ(0);\n color: var(--_c-radio-group-color);\n }\n\n .selection {\n position: absolute;\n top: 11px;\n left: 11px;\n height: 20px;\n width: 20px;\n background-color: transparent;\n box-shadow: inset 0 0 0 2px var(--_c-radio-group-color);\n border-radius: 50%;\n transition: box-shadow 0.15s ease-in-out;\n\n &::after {\n content: \"\";\n position: absolute;\n transform: scale(0);\n transition: transform 0.15s ease-in-out;\n top: 5px;\n left: 5px;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background: var(--_c-radio-group-color-active);\n }\n }\n\n &__details {\n line-height: 1;\n padding: 0 12px;\n\n &.active {\n #{$this} {\n &__message {\n opacity: 1;\n transform: translateY(0);\n }\n }\n }\n }\n\n &__message {\n font-size: 12px;\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-tertiary-500);\n }\n\n &--error {\n color: var(--_c-radio-group-error-color) !important;\n }\n\n span {\n align-items: flex-start;\n display: flex;\n gap: 4px;\n height: 16px;\n\n &.error {\n color: var(--_c-radio-group-error-color);\n }\n\n &.hint {\n color: var(--c-tertiary-500);\n }\n }\n\n svg {\n fill: currentColor;\n min-height: 16px;\n min-width: 16px;\n position: relative;\n top: -2px;\n }\n }\n\n &__label {\n padding-top: 12px;\n }\n\n &--disabled {\n --_c-radio-group-color: var(--_c-radio-group-color-disabled);\n --_c-radio-group-color-active: var(--_c-radio-group-color-disabled);\n\n color: var(--_c-radio-group-color);\n cursor: default;\n opacity: 0.75;\n }\n\n &--error {\n --_c-radio-group-color: var(--_c-radio-group-error-color);\n\n color: var(--_c-radio-group-error-color);\n\n span,\n svg {\n fill: var(--_c-radio-group-error-color);\n color: var(--_c-radio-group-error-color);\n }\n }\n\n input:focus {\n outline: none;\n }\n\n input:focus + .ripple {\n outline: 2px var(--_c-radio-group-color-active) solid;\n }\n\n @supports selector(:focus-visible) {\n input:focus + .ripple {\n outline: none;\n }\n }\n\n input:focus-visible + .ripple {\n outline: 2px var(--_c-radio-group-color) solid;\n }\n\n &:not(.c-radio--disabled) {\n .ripple:hover {\n background-color: var(--_c-radio-group-background-color-hover);\n }\n }\n}\n","import {\n Component,\n h,\n Prop,\n Event,\n EventEmitter,\n Element,\n State,\n Watch,\n AttachInternals,\n} from '@stencil/core';\nimport { mdiCloseCircle } from '@mdi/js';\nimport { CRadioGroupItem } from '../../types';\n\n/**\n * @group Form\n * @slot Default slot - Default slot for the label\n */\n@Component({\n tag: 'c-radio-group',\n styleUrl: 'c-radio-group.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CRadioGroup {\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Value of the radio group\n */\n @Prop({ mutable: true }) value: string | number | CRadioGroupItem;\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 * Display radio buttons inline\n */\n @Prop() inline = false;\n\n /**\n * Label of the radio group\n */\n @Prop() label: string;\n\n /**\n * Color of the radio group\n */\n @Prop() color = '';\n\n /**\n * Radio group items\n */\n @Prop() items: CRadioGroupItem[] = [];\n\n /**\n * Disable the radio group\n */\n @Prop() disabled = false;\n\n /**\n * Return the whole item object\n */\n @Prop() returnObject = false;\n\n /**\n * Set as required\n */\n @Prop() required = false;\n\n /**\n * Set the validity of the input\n */\n @Prop() valid = true;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Emit value change to the parent\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @Element() el: HTMLCRadioGroupElement;\n\n @State() messageOptions = {\n show: true,\n type: 'hint',\n content: '',\n };\n\n @Watch('validation')\n onValidationMessageChange(message: string) {\n this.onValidChange(message.length === 0);\n }\n\n @Watch('valid')\n onValidChange(valid: boolean) {\n this._handleValidation(valid || this.valid);\n }\n\n componentDidLoad() {\n this._handleValidation(this.valid, 0);\n }\n\n private _containers?: HTMLDivElement[] = [];\n\n private _rippleElements: HTMLCRippleElement[] = [];\n\n private static _uniqueId = 0;\n\n private _handleKeyDown(event: KeyboardEvent, item, index) {\n if (['Space', 'Enter'].includes(event.code)) {\n event.preventDefault();\n\n this._select(event, item, index);\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>{this.hint}</span>\n ) : (\n <span>\n {this._validationIcon} {this.validation}\n </span>\n ),\n };\n }, timeout);\n }\n\n private _select(event, item, index) {\n if (!!item.disabled || this.disabled) return;\n\n this._rippleElements[index].createRipple(\n event,\n this._containers[index],\n true,\n );\n this.value = !this.returnObject ? item?.value : item;\n this.changeValue.emit(this.value);\n\n const value = !this.returnObject\n ? this.value\n : (this.value as CRadioGroupItem).value;\n\n this.internals.setFormValue(value as string);\n }\n\n private _handleSlotChange = () => {\n this._getRadioButtons();\n };\n\n private _getRadioButtons = () => {\n const radios = this.el.querySelectorAll('c-radio');\n\n if (radios.length) {\n this.returnObject = false;\n\n this.items = [\n ...Array.from(radios).map((radio) => {\n if (!!radio.checked) {\n this.value = radio.value;\n this.changeValue.emit(this.value);\n }\n\n radio.style.display = 'none';\n\n return {\n name: radio.textContent,\n value: radio.value,\n disabled: !!radio.disabled,\n };\n }),\n ];\n }\n };\n\n private _getRadioButton = (item, index) => {\n const itemId = item.value.toString().replace(/[^a-zA-Z0-9-_]/g, '');\n\n const isChecked = !this.returnObject\n ? this.items?.find((i) => i.value === item.value)?.value === this.value\n : (this.value as CRadioGroupItem)?.value === item.value;\n\n const classes = {\n 'c-radio': true,\n 'c-radio--disabled': !!item.disabled || this.disabled,\n 'c-radio--error': this.messageOptions.type === 'error',\n };\n\n return (\n <label\n class={classes}\n id={itemId}\n onKeyDown={(event) => this._handleKeyDown(event, item, index)}\n >\n <input\n type=\"radio\"\n aria-checked={(this.value === item).toString()}\n aria-disabled={(!!item.disabled || this.disabled).toString()}\n aria-labelledby={itemId}\n disabled={!!item.disabled || this.disabled}\n checked={isChecked}\n name={CRadioGroup._uniqueId.toString()}\n onChange={(event) => this._select(event, item, index)}\n />\n\n <span\n class=\"ripple\"\n ref={(el) => (this._containers[index] = el as HTMLDivElement)}\n >\n <span class=\"selection\"></span>\n\n <c-ripple ref={(el) => (this._rippleElements[index] = el)}></c-ripple>\n </span>\n\n <div class=\"c-radio__label\">{item.name}</div>\n </label>\n );\n };\n\n private _renderMessages() {\n if (this.hideDetails) return;\n\n const classes = {\n 'c-radio__details': true,\n active: this.messageOptions.show,\n };\n\n const messageClasses = {\n 'c-radio__message': true,\n [`c-radio__message--${this.messageOptions.type}`]: true,\n };\n\n return (\n <div class={classes}>\n <div class={messageClasses}>{this.messageOptions.content}</div>\n </div>\n );\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 componentWillLoad() {\n CRadioGroup._uniqueId += 1;\n\n if (this.value) {\n const value = !this.returnObject\n ? this.value\n : (this.value as CRadioGroupItem).value;\n\n this.internals.setFormValue(value as string);\n }\n }\n\n render() {\n const slotHasContent = !!this.el.childNodes.length;\n\n const wrapperClasses = {\n 'c-radio-group': true,\n 'c-radio-group--disabled': this.disabled,\n 'c-radio-group--inline': this.inline,\n 'c-radio-group--error': this.messageOptions.type === 'error',\n };\n\n return (\n <div\n class={wrapperClasses}\n role=\"radiogroup\"\n aria-labelledby=\"c-radio-group__label\"\n >\n {(!!this.label || slotHasContent) && (\n <label class=\"c-radio-group__label\">\n {!!this.label && this.label}\n\n <slot onSlotchange={this._handleSlotChange}></slot>\n\n {this.required && <span class=\"required\">&nbsp;*</span>}\n </label>\n )}\n\n <div class=\"c-radio-group__items\">\n {this.items.map((item, index) => this._getRadioButton(item, index))}\n </div>\n\n {this._renderMessages()}\n </div>\n );\n }\n}\n"],"mappings":"wFAAA,MAAMA,EAAiB,2vH,MCwBVC,EAAW,M,kOA2FdC,KAAAC,YAAiC,GAEjCD,KAAAE,gBAAwC,GAoDxCF,KAAAG,kBAAoB,KAC1BH,KAAKI,kBAAkB,EAGjBJ,KAAAI,iBAAmB,KACzB,MAAMC,EAASL,KAAKM,GAAGC,iBAAiB,WAExC,GAAIF,EAAOG,OAAQ,CACjBR,KAAKS,aAAe,MAEpBT,KAAKU,MAAQ,IACRC,MAAMC,KAAKP,GAAQQ,KAAKC,IACzB,KAAMA,EAAMC,QAAS,CACnBf,KAAKgB,MAAQF,EAAME,MACnBhB,KAAKiB,YAAYC,KAAKlB,KAAKgB,M,CAG7BF,EAAMK,MAAMC,QAAU,OAEtB,MAAO,CACLC,KAAMP,EAAMQ,YACZN,MAAOF,EAAME,MACbO,WAAYT,EAAMS,SACnB,I,GAMDvB,KAAAwB,gBAAkB,CAACC,EAAMC,K,UAC/B,MAAMC,EAASF,EAAKT,MAAMY,WAAWC,QAAQ,kBAAmB,IAEhE,MAAMC,GAAa9B,KAAKS,eACpBsB,GAAAC,EAAAhC,KAAKU,SAAK,MAAAsB,SAAA,SAAAA,EAAEC,MAAMC,GAAMA,EAAElB,QAAUS,EAAKT,WAAM,MAAAe,SAAA,SAAAA,EAAEf,SAAUhB,KAAKgB,QAChEmB,EAACnC,KAAKgB,SAAyB,MAAAmB,SAAA,SAAAA,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gB,MAA0BA,MAEpChB,KAAKyE,UAAUC,aAAa1D,E,EAIhC,MAAAgE,GACE,MAAMC,IAAmBjF,KAAKM,GAAG4E,WAAW1E,OAE5C,MAAM2E,EAAiB,CACrB,gBAAiB,KACjB,0BAA2BnF,KAAKuB,SAChC,wBAAyBvB,KAAKoF,OAC9B,uBAAwBpF,KAAKqC,eAAeC,OAAS,SAGvD,OACEC,EAAA,OACEC,MAAO2C,EACPE,KAAK,aAAY,kBACD,2BAEZrF,KAAKsF,OAASL,IAChB1C,EAAA,SAAOC,MAAM,0BACRxC,KAAKsF,OAAStF,KAAKsF,MAEtB/C,EAAA,QAAMgD,aAAcvF,KAAKG,oBAExBH,KAAKwF,UAAYjD,EAAA,QAAMC,MAAM,YAAU,OAI5CD,EAAA,OAAKC,MAAM,wBACRxC,KAAKU,MAAMG,KAAI,CAACY,EAAMC,IAAU1B,KAAKwB,gBAAgBC,EAAMC,MAG7D1B,KAAK2E,kB,kKA/LG5E,EAAA8C,UAAY,E"}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as i,h as e,H as s,g as o}from"./p-565ec8e4.js";import{g as r,h as n}from"./p-5461ca29.js";const c="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-select-shadow-active-color:var(--c-select-shadow-active-color, var(--_c-select-active-color));--_c-select-shadow-background-color:var(--c-select-shadow-background-color, var(--c-white));--_c-select-shadow-text-color:var(--c-select-shadow-text-color, var(--_c-select-text-color));--_c-select-shadow-placeholder-color:var(--c-select-shadow-placeholder-color, var(--_c-select-placeholder-color));--_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);--_c-input-shadow-active-color:var(--_c-select-shadow-active-color);--_c-input-shadow-background-color:var(--_c-select-shadow-background-color);--_c-input-shadow-text-color:var(--_c-select-shadow-text-color);--_c-input-shadow-placeholder-color:var(--_c-select-shadow-placeholder-color)}:host{display:block;cursor:text}.c-input-menu__chevron{fill:currentColor;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);this._preventDialogOpen=false;this._debounce=null;this._lastKeyPressTime=null;this._searchString="";this._toggleDropdown=t=>{t.stopPropagation();if(this.dropdownVisible){this._dropdownElement.close();return}this._dropdownElement.open()};this._onButtonKeyDown=(t,i)=>{i.stopPropagation();if(i.key!=="Tab")i.preventDefault();if(["Enter"," "].includes(i.key)){if(t==="chevron"){this._toggleDropdown(i);return}this._onReset(i);this._preventDialogOpen=true;requestAnimationFrame((()=>{this._inputElement.focus()}))}};this._onSlotChange=()=>{this.optionElements=this.el.querySelectorAll("c-option");if(this.optionElements.length&&!this.optionElementsExist){this.optionElementsExist=true}};this._onReset=t=>{t.stopPropagation();this.changeValue.emit(null);this._selectionElement.classList.remove("c-input-menu__selection--show");this._selectionElement.replaceChildren(null);this._preventDialogOpen=true;this._cInputElement.reset();this._inputElement.focus();this._dropdownElement.updateList()};this._onInputFocus=()=>{if(!this._preventDialogOpen){this._dropdownElement.open()}this._updateStatusText();this._preventDialogOpen=false};this.items=[];this.value=null;this.hostId=undefined;this.clearable=false;this.disabled=false;this.label=undefined;this.name=undefined;this.placeholder="";this.hideDetails=false;this.hint="";this.loading=false;this.required=false;this.valid=true;this.validate=false;this.validateOnBlur=false;this.validation="Required field";this.shadow=false;this.returnObject=false;this.itemsPerPage=6;this.optionAsSelection=undefined;this.optionElements=undefined;this.currentIndex=null;this.dropdownVisible=false;this.statusText="";this.optionElementsExist=false}get _id(){return this.hostId||`select_${l._uniqueId}`}get _items(){return this.optionElementsExist?this.optionElements:this.items}get _value(){var t,i,e,s;if(!this.value)return"";if(!this.returnObject&&!["number","string"].includes(typeof this.value)){console.warn(`[C-SELECT] The value should be of type 'number' or 'string' when return-object is not used.`);return""}if(!this.returnObject&&["number","string"].includes(typeof this.value)){return(i=(t=Array.from(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}async reset(){this.changeValue.emit(null);this._dropdownElement.updateList()}handleKeyDown(t){const i=/^[0-9a-zA-Z ]+$/;if(t.key.match(i)&&t.key.length===1){if(this.dropdownVisible)return;if(Date.now()-this._lastKeyPressTime>3e3){this._searchString=t.key}else{this._searchString+=t.key}this._lastKeyPressTime=Date.now();const i=Array.from(this._items).findIndex((t=>t.name.toLowerCase().startsWith(this._searchString)));this.currentIndex=i>=0?i:null;if(this.currentIndex!==null){this._dropdownElement.selectItem(this.currentIndex)}return}if(t.key==="Escape"){this._preventDialogOpen=true;this._dropdownElement.close();this._inputElement.focus();return}if(t.key==="Tab"){this._dropdownElement.close();return}if(t.key==="ArrowDown"){t.preventDefault();if(!this._items.length)return;if(!this.dropdownVisible||this.currentIndex===null){this.currentIndex=0;this._dropdownElement.open();this._dropdownElement.focusItem(this.currentIndex);return}this.currentIndex=Math.min(this.currentIndex+1,this._items.length-1);this._dropdownElement.focusItem(this.currentIndex);return}if(t.key==="ArrowUp"){t.preventDefault();if(this.currentIndex===0){this._dropdownElement.close();this._inputElement.focus()}if(!this.dropdownVisible||this.currentIndex===null){this.currentIndex=this._items.length-1;this._dropdownElement.open();this._dropdownElement.focusItem(this.currentIndex);return}this.currentIndex=Math.max(this.currentIndex-1,0);this._dropdownElement.focusItem(this.currentIndex)}if(t.key===" "){t.preventDefault()}if(t.key==="Enter"){t.preventDefault();if(this.currentIndex===null)return;this._dropdownElement.selectItem(this.currentIndex)}if(t.key==="Home"&&this.dropdownVisible){this.currentIndex=0}if(t.key==="End"&&this.dropdownVisible){this.currentIndex=this._items.length-1}}onDropdownStateChange(t){const i=t.detail;this.dropdownVisible=i;if(!i){requestAnimationFrame((()=>{this.currentIndex=null}))}}onSelectOption(t){this._dropdownElement.close();const{name:i,value:e}=t.detail;if(this.optionElementsExist&&this.optionAsSelection){const t=Array.from(this.optionElements).find((t=>t.value===e&&t.name===i));if(!t)return;const s=t.cloneNode(true);this._selectionElement.classList.add("c-input-menu__selection--show");this._selectionElement.replaceChildren(s)}this.changeValue.emit(this.returnObject?t.detail:e);this._preventDialogOpen=true;this._inputElement.focus()}_updateInput(){this._dropdownElement.open();this._dropdownElement.updateList()}_updateStatusText(){if(this._debounce!==null){clearTimeout(this._debounce);this._debounce=null}this._debounce=window.setTimeout((()=>{this.statusText="";if(this.currentIndex===null){this.statusText=this._items.length?`${this._items.length} option${this._items.length!==1?"s":""} available`:"No options available"}const t=!!this._items.length?", navigate using the up and down arrows":"";this._dropdownElement.setStatusText(this.statusText+t);this._debounce=null}),1400)}componentWillLoad(){l._uniqueId+=1;this._inputId="input_"+(this.hostId||this.label||this.placeholder).replace(/[^a-zA-Z0-9-_]/g,"")}_renderLoader(){return e("c-spinner",{color:"var(--_c-autocomplete-active-color)",size:20})}_renderChevron(){const t={"c-input-menu__chevron":true,"c-input-menu__chevron--active":this.dropdownVisible};return e("c-icon-button",{size:"x-small",class:t,text:true,onClick:t=>this._toggleDropdown(t),onKeyDown:t=>this._onButtonKeyDown("chevron",t)},e("c-icon",{path:r,size:24}))}_renderInputElement(){var t;return e("div",{class:"c-input-menu__input"},e("input",{type:"text",readonly:true,ref:t=>this._inputElement=t,"aria-expanded":this.dropdownVisible.toString(),"aria-owns":this._inputId+"-items","aria-autocomplete":"list",autocomplete:"off",class:"c-input__input",role:"combobox",value:this._value,name:(t=this.name)!==null&&t!==void 0?t:null,onInput:()=>this._updateInput(),onFocus:()=>this._onInputFocus()}),e("div",{ref:t=>this._selectionElement=t,class:"c-input-menu__selection"}))}_renderReset(){return e("c-icon-button",{"aria-label":"",size:"x-small",text:true,onClick:t=>this._onReset(t),onKeyDown:t=>this._onButtonKeyDown("reset",t)},e("c-icon",{path:n,size:20}))}render(){const t=this.optionElementsExist?"option":"item";return e(s,null,e("c-dropdown",{ref:t=>this._dropdownElement=t,id:`${this._id}-dropdown`,index:this.currentIndex,"items-per-page":this.itemsPerPage,"item-type":t,items:this._items,parent:this.el,type:"select"},e("c-input",{slot:"default",ref:t=>this._cInputElement=t,active:this.dropdownVisible,disabled:this.disabled,"hide-details":this.hideDetails,hint:this.hint,id:this.hostId,"input-id":this._inputId,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",onClick:()=>this._dropdownElement.open()},e("slot",{name:"pre",slot:"pre"}),e("div",{class:"c-input__content"},this._renderInputElement(),this.loading&&this._renderLoader(),!this.loading&&this.value&&this.clearable&&this._renderReset(),!this.loading&&(!this.value||!this.clearable)&&this._renderChevron(),e("slot",{onSlotchange:()=>this._onSlotChange()})),e("slot",{name:"post",slot:"post"}))))}get el(){return o(this)}};l._uniqueId=0;l.style=c;export{l as c_select};
2
+ //# sourceMappingURL=p-6c5e538b.entry.js.map