@cscfi/csc-ui 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/c-autocomplete.cjs.entry.js +15 -23
- package/dist/cjs/c-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/c-checkbox_2.cjs.entry.js +0 -1
- package/dist/cjs/c-checkbox_2.cjs.entry.js.map +1 -1
- package/dist/cjs/{c-dropdown_4.cjs.entry.js → c-dropdown_2.cjs.entry.js} +70 -205
- package/dist/cjs/c-dropdown_2.cjs.entry.js.map +1 -0
- package/dist/cjs/c-message.cjs.entry.js +67 -0
- package/dist/cjs/c-message.cjs.entry.js.map +1 -0
- package/dist/cjs/c-select.cjs.entry.js +12 -18
- package/dist/cjs/c-select.cjs.entry.js.map +1 -1
- package/dist/cjs/csc-ui.cjs.js +1 -1
- package/dist/cjs/index-3cad12b5.js +6 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/c-autocomplete/c-autocomplete.js +15 -23
- package/dist/collection/components/c-autocomplete/c-autocomplete.js.map +1 -1
- package/dist/collection/components/c-checkbox/c-checkbox.js +0 -1
- package/dist/collection/components/c-checkbox/c-checkbox.js.map +1 -1
- package/dist/collection/components/c-dropdown/c-dropdown.css +15 -16
- package/dist/collection/components/c-dropdown/c-dropdown.js +109 -65
- package/dist/collection/components/c-dropdown/c-dropdown.js.map +1 -1
- package/dist/collection/components/c-input/c-input.css +1 -0
- package/dist/collection/components/c-input/c-input.js +26 -214
- package/dist/collection/components/c-input/c-input.js.map +1 -1
- package/dist/collection/components/c-select/c-select.js +12 -18
- package/dist/collection/components/c-select/c-select.js.map +1 -1
- package/dist/components/c-autocomplete.js +17 -31
- package/dist/components/c-autocomplete.js.map +1 -1
- package/dist/components/c-checkbox2.js +0 -1
- package/dist/components/c-checkbox2.js.map +1 -1
- package/dist/components/c-dropdown2.js +67 -44
- package/dist/components/c-dropdown2.js.map +1 -1
- package/dist/components/c-input2.js +9 -104
- package/dist/components/c-input2.js.map +1 -1
- package/dist/components/c-select.js +14 -26
- package/dist/components/c-select.js.map +1 -1
- package/dist/components/c-text-field.js +1 -19
- package/dist/components/c-text-field.js.map +1 -1
- package/dist/csc-ui/csc-ui.esm.js +1 -1
- package/dist/csc-ui/csc-ui.esm.js.map +1 -1
- package/dist/csc-ui/{p-d94b9e92.entry.js → p-2ff8e8e2.entry.js} +2 -2
- package/dist/csc-ui/p-2ff8e8e2.entry.js.map +1 -0
- package/dist/csc-ui/p-32298609.entry.js +2 -0
- package/dist/csc-ui/p-32298609.entry.js.map +1 -0
- package/dist/csc-ui/p-50db6941.entry.js +2 -0
- package/dist/csc-ui/p-50db6941.entry.js.map +1 -0
- package/dist/csc-ui/{p-ae28ae3f.entry.js → p-7575c2c3.entry.js} +2 -2
- package/dist/csc-ui/p-7575c2c3.entry.js.map +1 -0
- package/dist/csc-ui/p-bf307cb4.entry.js +2 -0
- package/dist/csc-ui/p-bf307cb4.entry.js.map +1 -0
- package/dist/esm/c-autocomplete.entry.js +15 -23
- package/dist/esm/c-autocomplete.entry.js.map +1 -1
- package/dist/esm/c-checkbox_2.entry.js +0 -1
- package/dist/esm/c-checkbox_2.entry.js.map +1 -1
- package/dist/esm/{c-dropdown_4.entry.js → c-dropdown_2.entry.js} +72 -205
- package/dist/esm/c-dropdown_2.entry.js.map +1 -0
- package/dist/esm/c-message.entry.js +63 -0
- package/dist/esm/c-message.entry.js.map +1 -0
- package/dist/esm/c-select.entry.js +12 -18
- package/dist/esm/c-select.entry.js.map +1 -1
- package/dist/esm/csc-ui.js +1 -1
- package/dist/esm/index-cdf029b7.js +6 -2
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/c-autocomplete/c-autocomplete.d.ts +2 -2
- package/dist/types/components/c-dropdown/c-dropdown.d.ts +7 -5
- package/dist/types/components/c-input/c-input.d.ts +2 -15
- package/dist/types/components/c-select/c-select.d.ts +2 -2
- package/dist/types/components.d.ts +17 -56
- package/package.json +1 -1
- package/vscode-data.json +0 -8
- package/dist/cjs/c-dropdown_4.cjs.entry.js.map +0 -1
- package/dist/collection/components/c-dropdowns/c-dropdowns.css +0 -25
- package/dist/collection/components/c-dropdowns/c-dropdowns.js +0 -66
- package/dist/collection/components/c-dropdowns/c-dropdowns.js.map +0 -1
- package/dist/components/c-dropdowns.d.ts +0 -11
- package/dist/components/c-dropdowns.js +0 -8
- package/dist/components/c-dropdowns.js.map +0 -1
- package/dist/components/c-dropdowns2.js +0 -60
- package/dist/components/c-dropdowns2.js.map +0 -1
- package/dist/csc-ui/p-0a423333.entry.js +0 -2
- package/dist/csc-ui/p-0a423333.entry.js.map +0 -1
- package/dist/csc-ui/p-79b90c60.entry.js +0 -2
- package/dist/csc-ui/p-79b90c60.entry.js.map +0 -1
- package/dist/csc-ui/p-ae28ae3f.entry.js.map +0 -1
- package/dist/csc-ui/p-d94b9e92.entry.js.map +0 -1
- package/dist/esm/c-dropdown_4.entry.js.map +0 -1
- package/dist/types/components/c-dropdowns/c-dropdowns.d.ts +0 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"c-select.js","mappings":";;;;;;;;AAAA,MAAM,UAAU,GAAG,kvHAAkvH;;MC2BxvHA,SAAO;;;;;;;IAuHV,cAAS,GACf,EAAE,CAAC;IAIG,qBAAgB,GAAuC,EAAE,CAAC;IAM1D,yBAAoB,GAAG,CAAC,eAAe,CAAC,CAAC;IAIzC,uBAAkB,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAE5C,cAAS,GAAG,IAAI,CAAC;IAEjB,cAAS,GAAG,IAAI,oBAAoB,CAC1C,CAAC,OAAO,EAAE,QAAQ;MAChB,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK;QACpB,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;UACzB,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC;YAC1B,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,SA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T,IAAI,CAAC,WAAW,EAC9B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,EAAE,EAAE,IAAI,CAAC,MAAM,cACL,IAAI,CAAC,QAAQ,qBACN,IAAI,CAAC,YAAY,EAClC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ,sBACL,IAAI,CAAC,cAAc,EACrC,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAC,QAAQ,EAChB,WAAW,EAAE,MAAM,IAAI,CAAC,SAAS,EAAE,IAEnC,YAAM,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,GAAQ,EAEnC,WAAK,KAAK,EAAC,kBAAkB,IAC1B,IAAI,CAAC,mBAAmB,EAAE,EAC1B,IAAI,CAAC,cAAc,EAAE,EAEtB,YAAM,YAAY,EAAE,IAAI,CAAC,iBAAiB,GAAS,CAC/C,EAEN,YAAM,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,GAAQ,CAC7B,CACL,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5ccA,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 AttachInternals,\n Component,\n Element,\n Host,\n Prop,\n State,\n h,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\nimport { mdiChevronDown } from '@mdi/js';\nimport { CSelectItem } from '../../types';\n\n/**\n * @group Form\n * @slot Default slot - Use c-option elements only\n */\n@Component({\n tag: 'c-select',\n styleUrl: 'c-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CSelect {\n // eslint-disable-next-line\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Auto focus the input\n */\n @Prop() autofocus = false;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Set as required\n */\n @Prop() required = false;\n\n /**\n * Return only the item value rather than the whole item object\n */\n @Prop() returnValue: false;\n\n /**\n * Set the validity of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\n\n /**\n * Selected item\n */\n @Prop({ mutable: true }) value: string | number | boolean | CSelectItem =\n null;\n\n /**\n * selectable items\n */\n @Prop() items: CSelectItem[] = [];\n\n /**\n * display the option as selection (works only when c-option elements are used)\n */\n @Prop() optionAsSelection: false;\n\n /**\n * Triggered when an item is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @Element() host: HTMLCSelectElement;\n\n @State() menuVisible = false;\n\n @State() currentIndex: number = null;\n\n @State() activeListItemId: string = null;\n\n @State() statusText = '';\n\n @State() hasOptionItems = false;\n\n @State() previousValue: CSelectItem = { value: '', name: '' };\n\n private _itemRefs: { value: string | number | boolean; ref: HTMLElement }[] =\n [];\n\n private _id: string;\n\n private _cOptionElements: Record<string, HTMLCOptionElement> = {};\n\n private _selectionElement: HTMLDivElement;\n\n private _cInput: HTMLCInputElement;\n\n private _outerWrapperClasses = ['outer-wrapper'];\n\n private static _uniqueId = 0;\n\n private _validationClasses = ['validation-message'];\n\n private _debounce = null;\n\n private _observer = new IntersectionObserver(\n (entries, observer) => {\n entries.forEach((entry) => {\n if (!entry.isIntersecting) {\n entry.target.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n });\n observer.unobserve(entry.target);\n } else {\n observer.unobserve(entry.target);\n }\n });\n },\n { threshold: 1 },\n );\n\n @Watch('value')\n onValueChange() {\n if (!this.value) return;\n\n const realValue = !(this.value as CSelectItem)?.value\n ? this._items.find((item) => item.value === this.value)\n : this.value;\n\n this._valueChangedHandler(realValue as CSelectItem);\n }\n\n @Watch('validate')\n validateChange(newValue: boolean) {\n if (newValue) {\n this._runValidate();\n }\n }\n\n @Watch('currentIndex')\n onCurrentIndexChange(index: number) {\n this.activeListItemId = this._itemRefs[index]?.ref?.id ?? null;\n\n this._scrollToElement();\n\n this._updateStatusText();\n }\n\n private get _items() {\n return this.hasOptionItems ? this._optionItems : this.items;\n }\n\n private _setValue(item: CSelectItem) {\n return this.returnValue\n ? item?.value\n : {\n name: item?.name,\n value: item?.value,\n };\n }\n\n private _valueChangedHandler(item: CSelectItem) {\n if (!item) return;\n\n if (this.hasOptionItems && this.optionAsSelection) {\n const selection = this._cOptionElements[item.value.toString()];\n\n if (!selection) return;\n\n const clone = selection.cloneNode(true);\n\n this._selectionElement.classList.add('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(clone);\n }\n\n this.currentIndex = this._items.findIndex(\n (element) => element.value === item?.value,\n );\n\n const value = this._setValue(item);\n\n if (this.previousValue && this.previousValue?.value === item?.value) return;\n\n this.previousValue = item;\n\n this.changeValue.emit(value);\n\n this.internals.setFormValue(item.value as string);\n }\n\n private _getLabel() {\n if (!this.value) return '';\n\n if (\n this.returnValue &&\n ['number', 'string', 'boolean'].includes(typeof this.value)\n ) {\n return this._items?.find((item) => item.value === this.value)?.name;\n }\n\n return this._items?.find(\n (item) => item.value === (this.value as CSelectItem).value,\n )?.name;\n }\n\n private _scrollToElement() {\n if (this._items.length > this.itemsPerPage) {\n const itemRef = this._itemRefs.find(\n (item) => item.value === this._items[this.currentIndex]?.value,\n )?.ref;\n\n if (!!itemRef) {\n this._observer.observe(itemRef);\n }\n }\n }\n\n @Listen('keydown', { capture: true })\n handleKeyDown(ev: KeyboardEvent) {\n if (this.disabled) return;\n\n const letterNumber = /^[0-9a-zA-Z]+$/;\n\n if (ev.key.match(letterNumber) && ev.key.length === 1) {\n if (\n Date.now() - this._lastKeyPressTime > 3000 ||\n this._searchString.length > 2\n ) {\n this._searchString = ev.key;\n } else {\n this._searchString = `${this._searchString}${ev.key}`;\n }\n\n this._lastKeyPressTime = Date.now();\n\n const selectedItem = this._items.find((i) =>\n i.name.toLowerCase().startsWith(this._searchString),\n );\n\n function isItem(element) {\n return element === selectedItem;\n }\n\n if (selectedItem) {\n if (this.menuVisible) {\n this.currentIndex = this._items.findIndex(isItem);\n this._scrollToElement();\n } else {\n this.value = selectedItem;\n }\n }\n }\n\n if (ev.key === 'Tab') {\n this._cInput.closeDropdown();\n }\n\n if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n\n this._showMenu();\n }\n\n if (ev.key === 'ArrowUp') {\n ev.preventDefault();\n\n this._showMenu();\n }\n\n if (ev.key === ' ') {\n ev.preventDefault();\n\n this._showMenu();\n }\n }\n\n /**\n * Select item by index\n */\n @Method()\n async onItemSelection(index: number) {\n this.currentIndex = index;\n\n this._selectItem();\n }\n\n /**\n * Hide menu\n * @private\n */\n @Method()\n async onHideMenu() {\n this.menuVisible = false;\n }\n\n componentWillLoad() {\n CSelect._uniqueId += 1;\n\n this._id =\n this.hostId?.replace(/[^a-zA-Z0-9-_]/g, '') ??\n CSelect._uniqueId.toString();\n\n this._inputId =\n 'input-' +\n (this.hostId || this.label || this.placeholder)\n .replace(/[^a-zA-Z0-9-_]/g, '')\n .toLowerCase();\n\n this._setInitialValue();\n }\n\n private _setInitialValue() {\n if (!this.value) return;\n\n const value = this.returnValue\n ? this.value\n : (this.value as CSelectItem).value;\n\n this.internals.setFormValue(value as string);\n }\n\n componentDidLoad() {\n this._getOptionItems();\n\n if (\n (this.value || typeof this.value === 'boolean') &&\n !this.currentIndex &&\n this.currentIndex !== 0\n ) {\n this.currentIndex = this._items.findIndex(\n (item) => item.value === this.value,\n );\n }\n\n requestAnimationFrame(() => {\n this._cInput.createDropdown({\n type: 'select',\n items: this._items,\n options: this._cOptionElements,\n parent: this.host,\n itemsPerPage: this.itemsPerPage,\n index: this.currentIndex,\n click: false,\n id: this._inputId,\n });\n });\n }\n\n disconnectedCallback() {\n this._observer.disconnect();\n }\n\n private _inputId: string;\n\n private _lastKeyPressTime = null;\n\n private _searchString = '';\n\n private _blurred = false;\n\n private _optionItems: CSelectItem[] = [];\n\n private _inputElement: HTMLInputElement;\n\n private _selectItem() {\n const selectedItem = this._items[this.currentIndex];\n\n this.value = selectedItem;\n\n this._scrollToElement();\n }\n\n /**\n * @private\n */\n @Method()\n async setActiveDescendant(id: string) {\n this._inputElement.setAttribute('aria-activedescendant', id);\n }\n\n private _showMenu() {\n if (this.disabled) return;\n\n this.menuVisible = true;\n this._cInput.openDropdown();\n }\n\n private _getOptionItems() {\n requestAnimationFrame(() => {\n this._cOptionElements = {};\n\n let selection: CSelectItem | null = null;\n\n this._optionItems = (\n this.host ? Array.from(this.host.querySelectorAll('c-option')) : []\n ).map((item, index) => {\n const cSelectItem = {\n value: item.value,\n name: item.name || item.innerText,\n disabled: !!item.disabled,\n } as CSelectItem;\n\n if (item.selected) {\n selection = cSelectItem;\n }\n\n item.slot = `option-${index}`;\n\n this._cOptionElements[item.value.toString()] = item;\n\n return cSelectItem;\n });\n\n this.hasOptionItems = !!this._optionItems.length;\n\n if (selection) {\n this._valueChangedHandler(selection);\n }\n });\n }\n\n private _runValidate() {\n if (\n this.required &&\n !this.value &&\n (this._blurred || !this.validateOnBlur)\n ) {\n this._outerWrapperClasses.push('required');\n this._validationClasses.push('show');\n } else {\n this._outerWrapperClasses = this._outerWrapperClasses.filter(\n (c) => c !== 'required',\n );\n this._validationClasses = this._validationClasses.filter(\n (c) => c !== 'show',\n );\n }\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.menuVisible,\n };\n\n return (\n <svg class={classes} viewBox=\"0 0 24 24\">\n <path d={mdiChevronDown} />\n </svg>\n );\n }\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n aria-controls={this._inputId + '-items'}\n aria-expanded={this.menuVisible.toString()}\n aria-readonly=\"true\"\n aria-haspopup=\"listbox\"\n ref={(el) => (this._inputElement = el)}\n id={this._inputId}\n autocomplete=\"off\"\n class=\"c-input__input\"\n type=\"text\"\n value={this._getLabel() ?? null}\n name={this.name ?? null}\n readonly=\"true\"\n />\n\n <div\n ref={(el) => (this._selectionElement = el)}\n class=\"c-input-menu__selection\"\n />\n </div>\n );\n }\n\n private _handleSlotChange = () => {\n this._getOptionItems();\n };\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n const selection = this.host.shadowRoot.querySelector(\n 'li[aria-selected=\"true\"]',\n ) as HTMLLIElement;\n\n const ending = !!this._items.length\n ? ', to navigate use up and down arrows'\n : '';\n\n const isDisabled = !!selection?.classList?.contains('disabled');\n\n const beginning = isDisabled ? 'Disabled option - ' : '';\n\n const selectionText = !!selection\n ? `${beginning}${selection.dataset.value} - ${selection.ariaPosInSet} of ${selection.ariaSetSize} is highlighted`\n : null;\n\n this.statusText = `${selectionText || ending}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n return (\n <Host title={this._getLabel() ?? null}>\n <div\n id={'announce-' + this._id}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n\n <c-input\n ref={(el) => (this._cInput = el)}\n autofocus={this.autofocus}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n itemns-per-page={this.itemsPerPage}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n required={this.required}\n shadow={this.shadow}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.value}\n variant=\"select\"\n onItemClick={() => this._showMenu()}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n {this._renderChevron()}\n\n <slot onSlotchange={this._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EAAE,IAAI,CAAC,iBAAiB,GAAS,CAC/C,EAEN,kBACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC,EACzC,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,OAAO,EAAE,IAAI,CAAC,gBAAgB,oBACd,IAAI,CAAC,YAAY,EACjC,MAAM,EAAE,IAAI,CAAC,EAAE,EACf,KAAK,EAAE,IAAI,CAAC,YAAY,cACd,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,QAAQ,GACb,EAEF,YAAM,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,GAAQ,CAC7B,CACL,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAtdcA,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 AttachInternals,\n Component,\n Element,\n Host,\n Prop,\n State,\n h,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\nimport { mdiChevronDown } from '@mdi/js';\nimport { CSelectItem } from '../../types';\n\n/**\n * @group Form\n * @slot Default slot - Use c-option elements only\n */\n@Component({\n tag: 'c-select',\n styleUrl: 'c-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CSelect {\n @Element() el: HTMLCSelectElement;\n\n // eslint-disable-next-line\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Auto focus the input\n */\n @Prop() autofocus = false;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Set as required\n */\n @Prop() required = false;\n\n /**\n * Return only the item value rather than the whole item object\n */\n @Prop() returnValue: false;\n\n /**\n * Set the validity of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\n\n /**\n * Selected item\n */\n @Prop({ mutable: true }) value: string | number | boolean | CSelectItem =\n null;\n\n /**\n * selectable items\n */\n @Prop() items: CSelectItem[] = [];\n\n /**\n * display the option as selection (works only when c-option elements are used)\n */\n @Prop() optionAsSelection: false;\n\n /**\n * Triggered when an item is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @State() menuVisible = false;\n\n @State() currentIndex: number = null;\n\n @State() activeListItemId: string = null;\n\n @State() statusText = '';\n\n @State() hasOptionItems = false;\n\n @State() previousValue: CSelectItem = { value: '', name: '' };\n\n private _itemRefs: { value: string | number | boolean; ref: HTMLElement }[] =\n [];\n\n private _id: string;\n\n private _cOptionElements: Record<string, HTMLCOptionElement> = {};\n\n private _selectionElement: HTMLDivElement;\n\n private _outerWrapperClasses = ['outer-wrapper'];\n\n private static _uniqueId = 0;\n\n private _validationClasses = ['validation-message'];\n\n private _debounce = null;\n\n private _observer = new IntersectionObserver(\n (entries, observer) => {\n entries.forEach((entry) => {\n if (!entry.isIntersecting) {\n entry.target.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n });\n observer.unobserve(entry.target);\n } else {\n observer.unobserve(entry.target);\n }\n });\n },\n { threshold: 1 },\n );\n\n @Watch('value')\n onValueChange() {\n if (!this.value) return;\n\n const realValue = !(this.value as CSelectItem)?.value\n ? this._items.find((item) => item.value === this.value)\n : this.value;\n\n this._valueChangedHandler(realValue as CSelectItem);\n }\n\n @Watch('validate')\n validateChange(newValue: boolean) {\n if (newValue) {\n this._runValidate();\n }\n }\n\n @Watch('currentIndex')\n onCurrentIndexChange(index: number) {\n this.activeListItemId = this._itemRefs[index]?.ref?.id ?? null;\n\n this._scrollToElement();\n\n this._updateStatusText();\n }\n\n private get _items() {\n return this.hasOptionItems ? this._optionItems : this.items;\n }\n\n private _setValue(item: CSelectItem) {\n return this.returnValue\n ? item?.value\n : {\n name: item?.name,\n value: item?.value,\n };\n }\n\n private _valueChangedHandler(item: CSelectItem) {\n if (!item) return;\n\n if (this.hasOptionItems && this.optionAsSelection) {\n const selection = this._cOptionElements[item.value.toString()];\n\n if (!selection) return;\n\n const clone = selection.cloneNode(true);\n\n this._selectionElement.classList.add('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(clone);\n }\n\n this.currentIndex = this._items.findIndex(\n (element) => element.value === item?.value,\n );\n\n const value = this._setValue(item);\n\n if (this.previousValue && this.previousValue?.value === item?.value) return;\n\n this.previousValue = item;\n\n this.changeValue.emit(value);\n\n this.internals.setFormValue(item.value as string);\n }\n\n private _getLabel() {\n if (!this.value) return '';\n\n if (\n this.returnValue &&\n ['number', 'string', 'boolean'].includes(typeof this.value)\n ) {\n return this._items?.find((item) => item.value === this.value)?.name;\n }\n\n return this._items?.find(\n (item) => item.value === (this.value as CSelectItem).value,\n )?.name;\n }\n\n private _scrollToElement() {\n if (this._items.length > this.itemsPerPage) {\n const itemRef = this._itemRefs.find(\n (item) => item.value === this._items[this.currentIndex]?.value,\n )?.ref;\n\n if (!!itemRef) {\n this._observer.observe(itemRef);\n }\n }\n }\n\n @Listen('keydown', { capture: true })\n handleKeyDown(ev: KeyboardEvent) {\n if (this.disabled) return;\n\n const letterNumber = /^[0-9a-zA-Z]+$/;\n\n if (ev.key.match(letterNumber) && ev.key.length === 1) {\n if (\n Date.now() - this._lastKeyPressTime > 3000 ||\n this._searchString.length > 2\n ) {\n this._searchString = ev.key;\n } else {\n this._searchString = `${this._searchString}${ev.key}`;\n }\n\n this._lastKeyPressTime = Date.now();\n\n const selectedItem = this._items.find((i) =>\n i.name.toLowerCase().startsWith(this._searchString),\n );\n\n function isItem(element) {\n return element === selectedItem;\n }\n\n if (selectedItem) {\n if (this.menuVisible) {\n this.currentIndex = this._items.findIndex(isItem);\n this._scrollToElement();\n } else {\n this.value = selectedItem;\n }\n }\n }\n\n if (ev.key === 'Tab') {\n this._dropdownElement.close();\n }\n\n if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n\n if (this._dropdownElement.isOpen) return;\n\n this._showMenu();\n\n this._dropdownElement.focusItem(this.currentIndex);\n }\n\n if (ev.key === 'ArrowUp') {\n ev.preventDefault();\n\n if (this._dropdownElement.isOpen) return;\n\n this._showMenu();\n\n this._dropdownElement.focusItem(this.currentIndex);\n }\n\n if (ev.key === ' ') {\n ev.preventDefault();\n\n this._showMenu();\n }\n }\n\n /**\n * Select item by index\n */\n @Method()\n async onItemSelection(index: number) {\n this.currentIndex = index;\n\n this._selectItem();\n }\n\n /**\n * Hide menu\n * @private\n */\n @Method()\n async onHideMenu() {\n this.menuVisible = false;\n }\n\n componentWillLoad() {\n CSelect._uniqueId += 1;\n\n this._id =\n this.hostId?.replace(/[^a-zA-Z0-9-_]/g, '') ??\n CSelect._uniqueId.toString();\n\n this._inputId =\n 'input-' +\n (this.hostId || this.label || this.placeholder)\n .replace(/[^a-zA-Z0-9-_]/g, '')\n .toLowerCase();\n\n this._setInitialValue();\n }\n\n private _setInitialValue() {\n if (!this.value) return;\n\n const value = this.returnValue\n ? this.value\n : (this.value as CSelectItem).value;\n\n this.internals.setFormValue(value as string);\n }\n\n componentDidLoad() {\n this._getOptionItems();\n\n if (\n (this.value || typeof this.value === 'boolean') &&\n !this.currentIndex &&\n this.currentIndex !== 0\n ) {\n this.currentIndex = this._items.findIndex(\n (item) => item.value === this.value,\n );\n }\n }\n\n disconnectedCallback() {\n this._observer.disconnect();\n }\n\n private _inputId: string;\n\n private _lastKeyPressTime = null;\n\n private _searchString = '';\n\n private _blurred = false;\n\n private _optionItems: CSelectItem[] = [];\n\n private _inputElement: HTMLInputElement;\n\n private _dropdownElement: HTMLCDropdownElement;\n\n private _selectItem() {\n const selectedItem = this._items[this.currentIndex];\n\n this.value = selectedItem;\n\n this._scrollToElement();\n }\n\n /**\n * @private\n */\n @Method()\n async setActiveDescendant(id: string) {\n this._inputElement.setAttribute('aria-activedescendant', id);\n }\n\n private _showMenu() {\n if (this.disabled) return;\n\n this.menuVisible = true;\n\n this._dropdownElement.open();\n }\n\n private _getOptionItems() {\n requestAnimationFrame(() => {\n this._cOptionElements = {};\n\n let selection: CSelectItem | null = null;\n\n this._optionItems = (\n this.el ? Array.from(this.el.querySelectorAll('c-option')) : []\n ).map((item, index) => {\n const cSelectItem = {\n value: item.value,\n name: item.name || item.innerText,\n disabled: !!item.disabled,\n } as CSelectItem;\n\n if (item.selected) {\n selection = cSelectItem;\n }\n\n item.slot = `option-${index}`;\n\n this._cOptionElements[item.value.toString()] = item;\n\n return cSelectItem;\n });\n\n this.hasOptionItems = !!this._optionItems.length;\n\n if (selection) {\n this._valueChangedHandler(selection);\n }\n });\n }\n\n private _runValidate() {\n if (\n this.required &&\n !this.value &&\n (this._blurred || !this.validateOnBlur)\n ) {\n this._outerWrapperClasses.push('required');\n this._validationClasses.push('show');\n } else {\n this._outerWrapperClasses = this._outerWrapperClasses.filter(\n (c) => c !== 'required',\n );\n this._validationClasses = this._validationClasses.filter(\n (c) => c !== 'show',\n );\n }\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.menuVisible,\n };\n\n return (\n <svg class={classes} viewBox=\"0 0 24 24\">\n <path d={mdiChevronDown} />\n </svg>\n );\n }\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n aria-controls={this._inputId + '-items'}\n aria-expanded={this.menuVisible.toString()}\n aria-readonly=\"true\"\n aria-haspopup=\"listbox\"\n ref={(el) => (this._inputElement = el)}\n id={this._inputId}\n autocomplete=\"off\"\n class=\"c-input__input\"\n type=\"text\"\n value={this._getLabel() ?? null}\n name={this.name ?? null}\n readonly=\"true\"\n />\n\n <div\n ref={(el) => (this._selectionElement = el)}\n class=\"c-input-menu__selection\"\n />\n </div>\n );\n }\n\n private _handleSlotChange = () => {\n this._getOptionItems();\n };\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n const selection = this.el.shadowRoot.querySelector(\n 'li[aria-selected=\"true\"]',\n ) as HTMLLIElement;\n\n const ending = !!this._items.length\n ? ', to navigate use up and down arrows'\n : '';\n\n const isDisabled = !!selection?.classList?.contains('disabled');\n\n const beginning = isDisabled ? 'Disabled option - ' : '';\n\n const selectionText = !!selection\n ? `${beginning}${selection.dataset.value} - ${selection.ariaPosInSet} of ${selection.ariaSetSize} is highlighted`\n : null;\n\n this.statusText = `${selectionText || ending}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n return (\n <Host title={this._getLabel() ?? null}>\n <div\n id={'announce-' + this._id}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n\n <c-input\n autofocus={this.autofocus}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n items={this._items}\n items-per-page={this.itemsPerPage}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n required={this.required}\n shadow={this.shadow}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.value}\n variant=\"select\"\n onItemClick={() => this._showMenu()}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n {this._renderChevron()}\n\n <slot onSlotchange={this._handleSlotChange}></slot>\n </div>\n\n <c-dropdown\n ref={(el) => (this._dropdownElement = el)}\n slot=\"dropdown\"\n items={this._items}\n options={this._cOptionElements}\n items-per-page={this.itemsPerPage}\n parent={this.el}\n index={this.currentIndex}\n input-id={this._inputId}\n type=\"select\"\n />\n\n <slot name=\"post\" slot=\"post\"></slot>\n </c-input>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { r as mdiEye, s as mdiEyeOff, t as mdiCalendar } from './mdi.js';
|
|
3
|
-
import { d as defineCustomElement$6 } from './c-dropdown2.js';
|
|
4
|
-
import { d as defineCustomElement$5 } from './c-dropdowns2.js';
|
|
5
|
-
import { d as defineCustomElement$4 } from './c-icon2.js';
|
|
6
3
|
import { d as defineCustomElement$3 } from './c-input2.js';
|
|
7
4
|
import { d as defineCustomElement$2 } from './c-message2.js';
|
|
8
5
|
|
|
@@ -177,28 +174,13 @@ function defineCustomElement$1() {
|
|
|
177
174
|
if (typeof customElements === "undefined") {
|
|
178
175
|
return;
|
|
179
176
|
}
|
|
180
|
-
const components = ["c-text-field", "c-
|
|
177
|
+
const components = ["c-text-field", "c-input", "c-message"];
|
|
181
178
|
components.forEach(tagName => { switch (tagName) {
|
|
182
179
|
case "c-text-field":
|
|
183
180
|
if (!customElements.get(tagName)) {
|
|
184
181
|
customElements.define(tagName, CTextField$1);
|
|
185
182
|
}
|
|
186
183
|
break;
|
|
187
|
-
case "c-dropdown":
|
|
188
|
-
if (!customElements.get(tagName)) {
|
|
189
|
-
defineCustomElement$6();
|
|
190
|
-
}
|
|
191
|
-
break;
|
|
192
|
-
case "c-dropdowns":
|
|
193
|
-
if (!customElements.get(tagName)) {
|
|
194
|
-
defineCustomElement$5();
|
|
195
|
-
}
|
|
196
|
-
break;
|
|
197
|
-
case "c-icon":
|
|
198
|
-
if (!customElements.get(tagName)) {
|
|
199
|
-
defineCustomElement$4();
|
|
200
|
-
}
|
|
201
|
-
break;
|
|
202
184
|
case "c-input":
|
|
203
185
|
if (!customElements.get(tagName)) {
|
|
204
186
|
defineCustomElement$3();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"c-text-field.js","mappings":";;;;;;;;AAAA,MAAM,aAAa,GAAG,2nEAA2nE;;MCwBpoEA,YAAU;;;;;;;IA6Jb,kBAAa,GAAG,EAAE,CAAC;IA6BnB,kBAAa,GAAG,CAAC,KAAK;MAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc;UAC5B,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;UACzB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;M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-field/c-text-field.tsx"],"sourcesContent":[":root,\n:host {\n /**\n * @prop --c-text-field-active-color: Active text field color\n * @prop --c-text-field-inactive-color: Inactive text field color\n * @prop --c-text-field-background-color: Inactive text field background color\n * @prop --c-text-field-text-color: Text field text color\n * @prop --c-text-field-placeholder-color:Text field placeholder color\n * @prop --c-text-field-shadow-active-color: Shadow text field active color\n * @prop --c-text-field-shadow-background-color: Shadow text field background color\n * @prop --c-text-field-shadow-text-color: Shadow text field text color\n * @prop --c-text-field-shadow-placeholder-color: Shadow text field placeholder color\n */\n --_c-text-field-active-color: var(--c-text-field-active-color, var(--c-primary-600));\n --_c-text-field-inactive-color: var(--c-text-field-inactive-color, var(--c-tertiary-600));\n --_c-text-field-background-color: var(--c-text-field-background-color, var(--c-transparent));\n --_c-text-field-text-color: var(--c-text-field-text-color, var(--c-text-body));\n --_c-text-field-placeholder-color: var(--c-text-field-placeholder-color, var(--c-tertiary-500));\n --_c-text-field-shadow-active-color: var(--c-text-field-shadow-active-color, var(--_c-text-field-active-color));\n --_c-text-field-shadow-background-color: var(--c-text-field-shadow-background-color, var(--c-white));\n --_c-text-field-shadow-text-color: var(--c-text-field-shadow-text-color, var(--_c-text-field-text-color));\n --_c-text-field-shadow-placeholder-color: var(--c-text-field-shadow-placeholder-color, var(--_c-text-field-placeholder-color));\n}\n\n.c-input {\n --_c-input-active-color: var(--_c-text-field-active-color);\n --_c-input-inactive-color: var(--_c-text-field-inactive-color);\n --_c-input-background-color: var(--_c-text-field-background-color);\n --_c-input-text-color: var(--_c-text-field-text-color);\n --_c-input-placeholder-color: var(--_c-text-field-placeholder-color);\n --_c-input-shadow-active-color: var(--_c-text-field-shadow-active-color);\n --_c-input-shadow-background-color: var(--_c-text-field-shadow-background-color);\n --_c-input-shadow-text-color: var(--_c-text-field-shadow-text-color);\n --_c-input-shadow-placeholder-color: var(--_c-text-field-shadow-placeholder-color);\n\n &__password-toggle,\n &__date-toggle {\n cursor: pointer;\n fill: currentColor;\n height: 22px;\n width: 22px;\n\n &--disabled {\n cursor: not-allowed;\n fill: var(--c-tertiary-500);\n }\n }\n\n input {\n &[type=\"date\"] {\n opacity: 0;\n\n &::-webkit-calendar-picker-indicator,\n &::-webkit-inner-spin-button {\n display: none;\n appearance: none;\n }\n\n &:focus,\n &.c-input__input--filled {\n opacity: 1;\n }\n }\n }\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n} from '@stencil/core';\nimport { mdiCalendar, mdiEye, mdiEyeOff } from '@mdi/js';\n\n/**\n * @group Form\n * @slot pre - Content added before the input\n * @slot post - Content added after the input\n */\n@Component({\n tag: 'c-text-field',\n styleUrl: 'c-text-field.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CTextField {\n // eslint-disable-next-line\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Auto focus the input\n */\n @Prop() autofocus = false;\n\n /**\n * HTML input autocapitalize\n */\n @Prop() autocapitalize = '';\n\n /**\n * HTML input autocorrect\n */\n @Prop() autocorrect = '';\n\n /**\n * HTML input autocomplete\n */\n @Prop() autocomplete = '';\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Id of the input\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Trim whitespace from the return value\n */\n @Prop() trimWhitespace = false;\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 * Numeric input\n *\n * @deprecated Use type=\"number\" instead\n */\n @Prop() number = false;\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 validity of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Value of the input\n */\n @Prop({ mutable: true }) value: string;\n\n /**\n * Emit changes to the parent\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @State() isFocused = false;\n\n @State() labelWidth = 0;\n\n @State() preSlotWidth = 0;\n\n @State() messageOptions = {\n show: true,\n type: 'hint',\n content: '',\n };\n\n @Element() hiddenEl!: HTMLCTextFieldElement;\n\n private _inputElement: HTMLInputElement;\n\n private _originalType = '';\n\n private _inputId: string;\n\n private static _uniqueId = 0;\n\n componentWillLoad() {\n CTextField._uniqueId += 1;\n\n this._originalType = this.type;\n\n this._inputId = `${(\n this.hostId ||\n this.label ||\n this.placeholder ||\n ''\n ).replace(/[^a-zA-Z0-9-_]/g, '')}_${CTextField._uniqueId}`;\n\n this.internals.setFormValue(this.value);\n }\n\n get isActive() {\n return !!this.value || this.isFocused;\n }\n\n get passwordIcon() {\n return this.type === 'password' ? mdiEye : mdiEyeOff;\n }\n\n private _handleChange = (event) => {\n this.value = this.trimWhitespace\n ? event.target.value.trim()\n : event.target.value;\n\n this.changeValue.emit(this.value);\n this.internals.setFormValue(this.value);\n };\n\n private _handleBlur = (event) => {\n if (this.trimWhitespace) {\n const trimmedValue = event.target.value.trim();\n\n event.target.value = trimmedValue;\n }\n };\n\n private _renderInputElement() {\n const props = {\n classes: {\n 'c-input__input': true,\n 'c-input__input--filled': !!this.value,\n },\n shared: {\n id: this._inputId,\n name: this.name,\n disabled: this.disabled,\n readonly: this.readonly,\n value: this.value,\n onInput: this._handleChange,\n onChange: this._handleChange,\n onBlur: this._handleBlur,\n },\n input: {\n type: this.number ? 'number' : this.type || 'text',\n min: this.min,\n max: this.max,\n step: this.step,\n ...(!!this.autocomplete && { autocomplete: this.autocomplete }),\n ...(!!this.autocapitalize && { autocapitalize: this.autocapitalize }),\n ...(!!this.autocorrect && { autocorrect: this.autocorrect }),\n },\n textArea: {\n rows: this.rows,\n },\n };\n\n const textInput = (\n <input\n class={props.classes}\n {...props.input}\n {...props.shared}\n ref={(el) => (this._inputElement = el)}\n />\n );\n\n const textArea = (\n <textarea\n class={props.classes}\n {...props.shared}\n {...props.textArea}\n ></textarea>\n );\n\n return this.rows > 1 ? textArea : textInput;\n }\n\n private _isFirefox() {\n return !!navigator.userAgent.match(/firefox|fxios/i);\n }\n\n private _renderDateToggle() {\n if (this._originalType !== 'date' || this._isFirefox()) return;\n\n const classes = {\n 'c-input__date-toggle': true,\n 'c-input__date-toggle--disabled': this.disabled,\n };\n\n return (\n <svg\n class={classes}\n viewBox=\"0 0 24 24\"\n onClick={this._toggleDatepicker.bind(this)}\n >\n <path d={mdiCalendar} />\n </svg>\n );\n }\n\n private _toggleDatepicker() {\n this._inputElement?.showPicker();\n }\n\n private _renderPasswordToggle() {\n if (this._originalType !== 'password') return;\n\n const classes = {\n 'c-input__password-toggle': true,\n 'c-input__password-toggle--disabled': this.disabled,\n };\n\n return (\n <svg\n class={classes}\n viewBox=\"0 0 24 24\"\n onClick={this._togglePasswordVisibility}\n >\n <path d={this.passwordIcon} />\n </svg>\n );\n }\n\n private _togglePasswordVisibility = () => {\n if (this.disabled) return;\n\n this.type = this.type === 'password' ? 'text' : 'password';\n };\n\n render() {\n return (\n <Host>\n <c-input\n autofocus={this.autofocus}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n rows={this.rows}\n shadow={this.shadow}\n type={this.type}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.value}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n {this._renderInputElement()}\n\n {this._renderPasswordToggle()}\n\n {this._renderDateToggle()}\n\n <slot name=\"post\"></slot>\n </c-input>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"c-text-field.js","mappings":";;;;;AAAA,MAAM,aAAa,GAAG,2nEAA2nE;;MCwBpoEA,YAAU;;;;;;;IA6Jb,kBAAa,GAAG,EAAE,CAAC;IA6BnB,kBAAa,GAAG,CAAC,KAAK;MAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc;UAC5B,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;UACzB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;MAEvB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;MAClC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACzC,CAAC;IAEM,gBAAW,GAAG,CAAC,KAAK;MAC1B,IAAI,IAAI,CAAC,cAAc,EAAE;QACvB,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAE/C,KAAK,CAAC,MAAM,CAAC,KAAK,GAAG,YAAY,CAAC;OACnC;KACF,CAAC;IAkGM,8BAAyB,GAAG;MAClC,IAAI,IAAI,CAAC,QAAQ;QAAE,OAAO;MAE1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,KAAK,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;KAC5D,CAAC;qBAxSkB,KAAK;0BAKA,EAAE;uBAKL,EAAE;wBAKD,EAAE;oBAKN,KAAK;uBAKF,KAAK;gBAKZ,EAAE;;0BAUQ,KAAK;;eAUR,IAAI;eAKJ,IA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,QAAQ,EAAE,IAAI,CAAC,QAAQ,sBACL,IAAI,CAAC,cAAc,EACrC,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,IAEjB,YAAM,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,GAAQ,EAElC,IAAI,CAAC,mBAAmB,EAAE,EAE1B,IAAI,CAAC,qBAAqB,EAAE,EAE5B,IAAI,CAAC,iBAAiB,EAAE,EAEzB,YAAM,IAAI,EAAC,MAAM,GAAQ,CACjB,CACL,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApLcA,sBAAS,GAAG,CAAH,CAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CTextField"],"sources":["src/components/c-text-field/c-text-field.scss?tag=c-text-field&encapsulation=shadow","src/components/c-text-field/c-text-field.tsx"],"sourcesContent":[":root,\n:host {\n /**\n * @prop --c-text-field-active-color: Active text field color\n * @prop --c-text-field-inactive-color: Inactive text field color\n * @prop --c-text-field-background-color: Inactive text field background color\n * @prop --c-text-field-text-color: Text field text color\n * @prop --c-text-field-placeholder-color:Text field placeholder color\n * @prop --c-text-field-shadow-active-color: Shadow text field active color\n * @prop --c-text-field-shadow-background-color: Shadow text field background color\n * @prop --c-text-field-shadow-text-color: Shadow text field text color\n * @prop --c-text-field-shadow-placeholder-color: Shadow text field placeholder color\n */\n --_c-text-field-active-color: var(--c-text-field-active-color, var(--c-primary-600));\n --_c-text-field-inactive-color: var(--c-text-field-inactive-color, var(--c-tertiary-600));\n --_c-text-field-background-color: var(--c-text-field-background-color, var(--c-transparent));\n --_c-text-field-text-color: var(--c-text-field-text-color, var(--c-text-body));\n --_c-text-field-placeholder-color: var(--c-text-field-placeholder-color, var(--c-tertiary-500));\n --_c-text-field-shadow-active-color: var(--c-text-field-shadow-active-color, var(--_c-text-field-active-color));\n --_c-text-field-shadow-background-color: var(--c-text-field-shadow-background-color, var(--c-white));\n --_c-text-field-shadow-text-color: var(--c-text-field-shadow-text-color, var(--_c-text-field-text-color));\n --_c-text-field-shadow-placeholder-color: var(--c-text-field-shadow-placeholder-color, var(--_c-text-field-placeholder-color));\n}\n\n.c-input {\n --_c-input-active-color: var(--_c-text-field-active-color);\n --_c-input-inactive-color: var(--_c-text-field-inactive-color);\n --_c-input-background-color: var(--_c-text-field-background-color);\n --_c-input-text-color: var(--_c-text-field-text-color);\n --_c-input-placeholder-color: var(--_c-text-field-placeholder-color);\n --_c-input-shadow-active-color: var(--_c-text-field-shadow-active-color);\n --_c-input-shadow-background-color: var(--_c-text-field-shadow-background-color);\n --_c-input-shadow-text-color: var(--_c-text-field-shadow-text-color);\n --_c-input-shadow-placeholder-color: var(--_c-text-field-shadow-placeholder-color);\n\n &__password-toggle,\n &__date-toggle {\n cursor: pointer;\n fill: currentColor;\n height: 22px;\n width: 22px;\n\n &--disabled {\n cursor: not-allowed;\n fill: var(--c-tertiary-500);\n }\n }\n\n input {\n &[type=\"date\"] {\n opacity: 0;\n\n &::-webkit-calendar-picker-indicator,\n &::-webkit-inner-spin-button {\n display: none;\n appearance: none;\n }\n\n &:focus,\n &.c-input__input--filled {\n opacity: 1;\n }\n }\n }\n}\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n} from '@stencil/core';\nimport { mdiCalendar, mdiEye, mdiEyeOff } from '@mdi/js';\n\n/**\n * @group Form\n * @slot pre - Content added before the input\n * @slot post - Content added after the input\n */\n@Component({\n tag: 'c-text-field',\n styleUrl: 'c-text-field.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CTextField {\n // eslint-disable-next-line\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Auto focus the input\n */\n @Prop() autofocus = false;\n\n /**\n * HTML input autocapitalize\n */\n @Prop() autocapitalize = '';\n\n /**\n * HTML input autocorrect\n */\n @Prop() autocorrect = '';\n\n /**\n * HTML input autocomplete\n */\n @Prop() autocomplete = '';\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Id of the input\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Trim whitespace from the return value\n */\n @Prop() trimWhitespace = false;\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 * Numeric input\n *\n * @deprecated Use type=\"number\" instead\n */\n @Prop() number = false;\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 validity of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Value of the input\n */\n @Prop({ mutable: true }) value: string;\n\n /**\n * Emit changes to the parent\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @State() isFocused = false;\n\n @State() labelWidth = 0;\n\n @State() preSlotWidth = 0;\n\n @State() messageOptions = {\n show: true,\n type: 'hint',\n content: '',\n };\n\n @Element() hiddenEl!: HTMLCTextFieldElement;\n\n private _inputElement: HTMLInputElement;\n\n private _originalType = '';\n\n private _inputId: string;\n\n private static _uniqueId = 0;\n\n componentWillLoad() {\n CTextField._uniqueId += 1;\n\n this._originalType = this.type;\n\n this._inputId = `${(\n this.hostId ||\n this.label ||\n this.placeholder ||\n ''\n ).replace(/[^a-zA-Z0-9-_]/g, '')}_${CTextField._uniqueId}`;\n\n this.internals.setFormValue(this.value);\n }\n\n get isActive() {\n return !!this.value || this.isFocused;\n }\n\n get passwordIcon() {\n return this.type === 'password' ? mdiEye : mdiEyeOff;\n }\n\n private _handleChange = (event) => {\n this.value = this.trimWhitespace\n ? event.target.value.trim()\n : event.target.value;\n\n this.changeValue.emit(this.value);\n this.internals.setFormValue(this.value);\n };\n\n private _handleBlur = (event) => {\n if (this.trimWhitespace) {\n const trimmedValue = event.target.value.trim();\n\n event.target.value = trimmedValue;\n }\n };\n\n private _renderInputElement() {\n const props = {\n classes: {\n 'c-input__input': true,\n 'c-input__input--filled': !!this.value,\n },\n shared: {\n id: this._inputId,\n name: this.name,\n disabled: this.disabled,\n readonly: this.readonly,\n value: this.value,\n onInput: this._handleChange,\n onChange: this._handleChange,\n onBlur: this._handleBlur,\n },\n input: {\n type: this.number ? 'number' : this.type || 'text',\n min: this.min,\n max: this.max,\n step: this.step,\n ...(!!this.autocomplete && { autocomplete: this.autocomplete }),\n ...(!!this.autocapitalize && { autocapitalize: this.autocapitalize }),\n ...(!!this.autocorrect && { autocorrect: this.autocorrect }),\n },\n textArea: {\n rows: this.rows,\n },\n };\n\n const textInput = (\n <input\n class={props.classes}\n {...props.input}\n {...props.shared}\n ref={(el) => (this._inputElement = el)}\n />\n );\n\n const textArea = (\n <textarea\n class={props.classes}\n {...props.shared}\n {...props.textArea}\n ></textarea>\n );\n\n return this.rows > 1 ? textArea : textInput;\n }\n\n private _isFirefox() {\n return !!navigator.userAgent.match(/firefox|fxios/i);\n }\n\n private _renderDateToggle() {\n if (this._originalType !== 'date' || this._isFirefox()) return;\n\n const classes = {\n 'c-input__date-toggle': true,\n 'c-input__date-toggle--disabled': this.disabled,\n };\n\n return (\n <svg\n class={classes}\n viewBox=\"0 0 24 24\"\n onClick={this._toggleDatepicker.bind(this)}\n >\n <path d={mdiCalendar} />\n </svg>\n );\n }\n\n private _toggleDatepicker() {\n this._inputElement?.showPicker();\n }\n\n private _renderPasswordToggle() {\n if (this._originalType !== 'password') return;\n\n const classes = {\n 'c-input__password-toggle': true,\n 'c-input__password-toggle--disabled': this.disabled,\n };\n\n return (\n <svg\n class={classes}\n viewBox=\"0 0 24 24\"\n onClick={this._togglePasswordVisibility}\n >\n <path d={this.passwordIcon} />\n </svg>\n );\n }\n\n private _togglePasswordVisibility = () => {\n if (this.disabled) return;\n\n this.type = this.type === 'password' ? 'text' : 'password';\n };\n\n render() {\n return (\n <Host>\n <c-input\n autofocus={this.autofocus}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n rows={this.rows}\n shadow={this.shadow}\n type={this.type}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.value}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n {this._renderInputElement()}\n\n {this._renderPasswordToggle()}\n\n {this._renderDateToggle()}\n\n <slot name=\"post\"></slot>\n </c-input>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-9d54e9a4.js";export{s as setNonce}from"./p-9d54e9a4.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a(JSON.parse('[["p-37c19431",[[1,"c-data-table",{"data":[16],"externalData":[4,"external-data"],"headers":[16],"hideFooter":[4,"hide-footer"],"footerOptions":[16],"loading":[4],"loadingText":[1,"loading-text"],"noDataText":[1,"no-data-text"],"pagination":[1040],"selectable":[4],"singleSelection":[4,"single-selection"],"selectionProperty":[1,"selection-property"],"singleExpansion":[4,"single-expansion"],"sortBy":[1032,"sort-by"],"sortDirection":[1025,"sort-direction"],"stickyHeader":[4,"sticky-header"],"horizontalScrolling":[4,"horizontal-scrolling"],"_activeRows":[32],"_data":[32],"_isIndeterminate":[32],"_isPaginationSimple":[32],"_selections":[32],"hasOverflow":[32],"hiddenHeaders":[32],"initiallyHiddenHeaders":[32],"forceRender":[32],"breakpoints":[32],"markedFooterWidth":[32],"parentWidth":[32],"firstCellHidden":[32],"lastCellHidden":[32],"clearSelections":[64],"getData":[64]},null,{"hiddenHeaders":["onHiddenHeaderChange"],"data":["onDataChange"],"headers":["onHeaderChange"],"singleSelection":["onSingleSelectionChange"],"loading":["onLoadingChange"]}]]],["p-ae28ae3f",[[65,"c-autocomplete",{"autofocus":[4],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"shadow":[4],"name":[1],"label":[1],"query":[1025],"value":[1032],"dense":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"placeholder":[1],"returnValue":[4,"return-value"],"items":[16],"itemsPerPage":[2,"items-per-page"],"optionAsSelection":[4,"option-as-selection"],"menuVisible":[32],"currentIndex":[32],"hasOptionItems":[32],"options":[32],"setValue":[64],"onHideMenu":[64],"setActiveDescendant":[64],"updateQuery":[64],"onItemSelection":[64]},[[1,"keydown","handleKeyDown"]],{"items":["watchHandler"],"value":["onValueChange"]}]]],["p-0f76461d",[[1,"c-navigation-button"]]],["p-d94b9e92",[[65,"c-select",{"autofocus":[4],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"label":[1],"shadow":[4],"name":[1],"required":[4],"returnValue":[4,"return-value"],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"itemsPerPage":[2,"items-per-page"],"placeholder":[1],"value":[1032],"items":[16],"optionAsSelection":[4,"option-as-selection"],"menuVisible":[32],"currentIndex":[32],"activeListItemId":[32],"statusText":[32],"hasOptionItems":[32],"previousValue":[32],"onItemSelection":[64],"onHideMenu":[64],"setActiveDescendant":[64]},[[2,"keydown","handleKeyDown"]],{"value":["onValueChange"],"validate":["validateChange"],"currentIndex":["onCurrentIndexChange"]}]]],["p-a369bf94",[[1,"c-side-navigation",{"mobile":[4],"menuVisible":[1028,"menu-visible"]},[[0,"itemChange","handleChange"]]]]],["p-b65fb982",[[1,"c-tabs",{"value":[1032],"borderless":[4],"disableAnimation":[4,"disable-animation"],"justify":[1],"mobileBreakpoint":[2,"mobile-breakpoint"],"vertical":[4],"isOverflowing":[32],"isMobile":[32],"scrollOffset":[32]},[[1,"tabFocus","tabFocusHandler"],[1,"tabChange","tabChangeHandler"],[2,"keydown","handleKeyDown"],[2,"keyup","handleKeyUp"]],{"justify":["onJustificationChange"],"value":["onExternalValueChange"],"scrollOffset":["onScrollOffsetChange"]}]]],["p-c5deb643",[[1,"c-tag",{"active":[4],"block":[4],"fit":[4],"flat":[4],"closeable":[4],"badge":[8]}]]],["p-f0329312",[[65,"c-text-field",{"autofocus":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"trimWhitespace":[4,"trim-whitespace"],"label":[1],"max":[2],"min":[2],"name":[1],"number":[4],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[1025],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"messageOptions":[32]}]]],["p-8b7e9097",[[4,"c-swiper",{"value":[1544],"elementId":[1,"id"],"isBeginning":[32],"isEnd":[32],"statusText":[32]},[[0,"changeValue","onTabClick"],[2,"keyup","handleKeyUp"]]]]],["p-0bf28786",[[1,"c-side-navigation-item",{"active":[4],"href":[1],"target":[1],"loading":[4]},[[0,"itemChange","handleChange"]],{"active":["onActiveChange"]}]]],["p-6ec9109d",[[1,"c-sub-navigation-item",{"active":[4],"focusable":[4],"href":[1],"target":[1],"loading":[4]}]]],["p-14ed80ac",[[1,"c-toasts",{"absolute":[4],"horizontal":[1],"vertical":[1],"messages":[32],"addToast":[64],"removeToast":[64]}]]],["p-9f2311a7",[[1,"c-accordion-item",{"collapsable":[4],"heading":[1],"value":[8],"expanded":[4],"outlined":[4]},[[2,"keydown","handleKeyDown"],[0,"changeValue","stop"]]]]],["p-192145f2",[[1,"c-list-item",{"active":[4],"disabled":[4],"disabledByParent":[4,"disabled-by-parent"],"hoverable":[4],"ripple":[4],"href":[1],"target":[1]},null,{"active":["onActiveChange"]}]]],["p-e970fa68",[[1,"c-login-card-actions",{"align":[1],"justify":[1]}]]],["p-ef6162d9",[[65,"c-otp-input",{"hideDetails":[4,"hide-details"],"hint":[1],"elementId":[1,"id"],"length":[2],"valid":[4],"validation":[1],"statusText":[32]},null,{"validation":["onValidationMessageChange"]}]]],["p-05bb5c30",[[65,"c-radio-group",{"value":[1032],"hideDetails":[4,"hide-details"],"hint":[1],"inline":[4],"label":[1],"color":[1],"items":[16],"disabled":[4],"returnValue":[4,"return-value"],"required":[4],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-e0c3d13b",[[1,"c-swiper-tab",{"disabled":[4],"active":[4],"label":[1],"hostId":[1,"id"],"setsize":[2],"position":[2],"value":[8]},[[1,"click","onTabClick"]]]]],["p-dea9da0e",[[1,"c-tab",{"active":[4],"disabled":[4],"hostId":[1,"id"],"position":[2],"setsize":[2],"value":[8]},[[1,"focus","onTabFocus"],[1,"keydown","handleKeydown"]]]]],["p-79308b3f",[[1,"c-accordion",{"value":[1032],"mandatory":[4],"multiple":[4],"outlined":[4]},[[1,"itemChange","onAccordionItemChange"]],{"value":["watchPropHandler"]}]]],["p-f4a9cb4d",[[1,"c-alert",{"type":[1]}]]],["p-cea20d08",[[1,"c-card-content"]]],["p-28282ef5",[[1,"c-card-title"]]],["p-b09ba433",[[1,"c-link",{"href":[1],"underline":[4],"target":[1],"weight":[1]}]]],["p-4c23471f",[[0,"c-list",{"disabled":[4]},null,{"disabled":["onDisabledChange"]}]]],["p-6f86810a",[[1,"c-list-item-title",{"active":[4]}]]],["p-a8da163c",[[1,"c-login-button",{"href":[1],"src":[1],"alt":[1]}]]],["p-a8073d7e",[[1,"c-login-buttons"]]],["p-01ed27ec",[[4,"c-login-card",{"backgroundPosition":[1,"background-position"],"mobileBreakpoint":[2,"mobile-breakpoint"],"overlay":[4],"overlayBlendMode":[1,"overlay-blend-mode"],"src":[1],"path":[32],"imageHeight":[32]}]]],["p-55ca2b16",[[1,"c-login-card-content"]]],["p-eb35a668",[[1,"c-login-card-title"]]],["p-ff51acad",[[1,"c-modal",{"value":[4],"dismissable":[4],"width":[8],"zIndex":[2,"z-index"],"innerValue":[32],"animateModal":[32]},null,{"value":["onValueChange"]}]]],["p-2c9aabef",[[1,"c-option",{"selected":[4],"disabled":[4],"name":[1],"value":[8]}]]],["p-c343dd6e",[[1,"c-option-value"]]],["p-93280350",[[1,"c-page",{"scrollIndicator":[4,"scroll-indicator"]}]]],["p-732bc932",[[1,"c-progress-bar",{"value":[2],"hideDetails":[4,"hide-details"],"singleLine":[4,"single-line"],"label":[1],"indeterminate":[4]}]]],["p-c7a07889",[[1,"c-radio",{"checked":[4],"disabled":[4],"value":[1]}]]],["p-cd047753",[[1,"c-side-navigation-title"]]],["p-843b5cdb",[[1,"c-status",{"type":[1]}]]],["p-738a7d1d",[[1,"c-step",{"complete":[4],"current":[4]}]]],["p-c48a6e1d",[[1,"c-steps",{"value":[8],"isMobile":[32],"label":[32]},null,{"value":["watchPropHandler"]}]]],["p-889d3d6d",[[65,"c-switch",{"checked":[1028],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostDisabled":[4,"disabled"],"hostId":[1,"id"],"required":[4],"hasLabel":[32]}]]],["p-58aed6cc",[[1,"c-tab-buttons",{"value":[1032],"mandatory":[4],"tabs":[4],"size":[1],"hostDisabled":[4,"disabled"]},[[1,"tabFocus","tabFocusHandler"],[2,"keyup","handleKeyUp"],[1,"tabChange","onTabChange"]],{"value":["onValueChange"]}]]],["p-26021965",[[1,"c-tab-item",{"value":[8],"active":[4]}]]],["p-d60032ce",[[1,"c-tab-items",{"value":[8],"disableAnimation":[4,"disable-animation"],"activeTab":[32]},[[1,"contentChange","tabContentChangeHandler"]],{"value":["onValueChange"]}]]],["p-f4d93d05",[[4,"c-table",{"mobileBreakpoint":[2,"mobile-breakpoint"],"responsive":[4]}]]],["p-210da773",[[1,"c-tags"]]],["p-6a1e5ae3",[[1,"c-toast",{"message":[16],"closeToast":[64]}]]],["p-02b57cbd",[[1,"c-card-actions",{"align":[1],"justify":[1]}]]],["p-6b21aa4e",[[1,"c-card",{"fullscreen":[4],"isFullscreen":[32],"exitFullscreen":[64],"enterFullscreen":[64]}],[1,"c-button",{"inverted":[4],"outlined":[4],"ghost":[4],"danger":[4],"grouped":[4],"text":[4],"loading":[4],"fit":[4],"noRadius":[4,"no-radius"],"type":[1],"disabled":[516],"value":[8],"hostId":[1,"id"],"size":[1],"href":[1],"target":[1],"tabs":[4]},[[1,"focus","onTabFocus"]]],[1,"c-csc-logo",{"width":[2]}],[1,"c-main"],[1,"c-row",{"gap":[2],"nowrap":[4],"align":[1],"justify":[1]}],[1,"c-toolbar"],[1,"c-spacer"],[1,"c-icon-button",{"badge":[1],"danger":[4],"loading":[4],"text":[4],"inverted":[4],"outlined":[4],"path":[1],"ghost":[4],"disabled":[4],"size":[1]}],[1,"c-badge"],[1,"c-spinner",{"color":[1],"size":[2],"width":[2]}],[1,"c-ripple",{"createRipple":[64]}],[1,"c-icon",{"path":[1],"size":[2],"color":[1]}]]],["p-79b90c60",[[1,"c-pagination",{"value":[16],"hideDetails":[4,"hide-details"],"simple":[4],"size":[1],"hideRange":[4,"hide-range"],"itemsPerPageOptions":[16],"_currentPage":[32],"_itemsPerPage":[32],"_totalVisible":[32],"tick":[32]},null,{"value":["valueHandler"]}],[65,"c-checkbox",{"checked":[1028],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"indeterminate":[4],"label":[1],"required":[4],"valid":[4],"validation":[1],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostName":[1,"name"],"messageOptions":[32]},[[1,"keydown","handleKeyDown"]],{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-cfc34289",[[1,"c-loader",{"contentdelay":[2],"hide":[4],"size":[2],"width":[2]},null,{"hide":["onElementHide"]}]]],["p-dd6d422d",[[1,"c-menu",{"items":[16],"contentClass":[1,"content-class"],"custom":[4],"small":[4],"flat":[4],"itemsPerPage":[2,"items-per-page"],"menuItemsComponent":[32],"menuWrapperComponent":[32],"currentIndex":[32],"active":[32]},[[2,"keydown","handleKeyDown"]]],[1,"c-menu-items",{"items":[16],"small":[4],"active":[4],"parentType":[1,"parent-type"],"parent":[16],"top":[2],"index":[2],"itemsPerPage":[2,"items-per-page"],"scrollingParent":[32],"isInView":[32],"currentIndex":[32]},[[2,"keydown","handleKeyDown"]],{"currentIndex":["onIndexChange"]}]]],["p-0a423333",[[4,"c-input",{"autofocus":[4],"disabled":[4],"form":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"inputId":[1,"input-id"],"itemsPerPage":[2,"items-per-page"],"label":[1],"max":[2],"min":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[8],"variant":[1],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"statusText":[32],"currentIndex":[32],"focusDropdown":[64],"focusItem":[64],"createDropdown":[64],"openDropdown":[64],"closeDropdown":[64],"updateDropdown":[64]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"value":["onValueChange"],"placeholder":["onPlaceholderChange"]}],[1,"c-dropdowns",{"createDropdown":[64]}],[1,"c-dropdown",{"items":[16],"options":[16],"itemsPerPage":[2,"items-per-page"],"parent":[16],"wrapper":[16],"index":[2],"isOpen":[4,"is-open"],"focusList":[4,"focus-list"],"inputId":[1,"input-id"],"type":[1],"wasClicked":[4,"was-clicked"],"currentIndex":[32],"isVisible":[32],"topPosition":[32],"bottomTranslate":[32],"statusText":[32],"updateDropdown":[64],"focusDropdown":[64],"focusItem":[64]},null,{"isOpen":["onOpenStateChange"],"currentIndex":["onCurrentIndexChange"]}],[1,"c-message",{"hint":[1],"inputId":[1,"input-id"],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"hint":["onHintMessageChange"]}]]]]'),e)));
|
|
1
|
+
import{p as e,b as a}from"./p-9d54e9a4.js";export{s as setNonce}from"./p-9d54e9a4.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a(JSON.parse('[["p-37c19431",[[1,"c-data-table",{"data":[16],"externalData":[4,"external-data"],"headers":[16],"hideFooter":[4,"hide-footer"],"footerOptions":[16],"loading":[4],"loadingText":[1,"loading-text"],"noDataText":[1,"no-data-text"],"pagination":[1040],"selectable":[4],"singleSelection":[4,"single-selection"],"selectionProperty":[1,"selection-property"],"singleExpansion":[4,"single-expansion"],"sortBy":[1032,"sort-by"],"sortDirection":[1025,"sort-direction"],"stickyHeader":[4,"sticky-header"],"horizontalScrolling":[4,"horizontal-scrolling"],"_activeRows":[32],"_data":[32],"_isIndeterminate":[32],"_isPaginationSimple":[32],"_selections":[32],"hasOverflow":[32],"hiddenHeaders":[32],"initiallyHiddenHeaders":[32],"forceRender":[32],"breakpoints":[32],"markedFooterWidth":[32],"parentWidth":[32],"firstCellHidden":[32],"lastCellHidden":[32],"clearSelections":[64],"getData":[64]},null,{"hiddenHeaders":["onHiddenHeaderChange"],"data":["onDataChange"],"headers":["onHeaderChange"],"singleSelection":["onSingleSelectionChange"],"loading":["onLoadingChange"]}]]],["p-0f76461d",[[1,"c-navigation-button"]]],["p-a369bf94",[[1,"c-side-navigation",{"mobile":[4],"menuVisible":[1028,"menu-visible"]},[[0,"itemChange","handleChange"]]]]],["p-b65fb982",[[1,"c-tabs",{"value":[1032],"borderless":[4],"disableAnimation":[4,"disable-animation"],"justify":[1],"mobileBreakpoint":[2,"mobile-breakpoint"],"vertical":[4],"isOverflowing":[32],"isMobile":[32],"scrollOffset":[32]},[[1,"tabFocus","tabFocusHandler"],[1,"tabChange","tabChangeHandler"],[2,"keydown","handleKeyDown"],[2,"keyup","handleKeyUp"]],{"justify":["onJustificationChange"],"value":["onExternalValueChange"],"scrollOffset":["onScrollOffsetChange"]}]]],["p-c5deb643",[[1,"c-tag",{"active":[4],"block":[4],"fit":[4],"flat":[4],"closeable":[4],"badge":[8]}]]],["p-7575c2c3",[[65,"c-autocomplete",{"autofocus":[4],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"shadow":[4],"name":[1],"label":[1],"query":[1025],"value":[1032],"dense":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"placeholder":[1],"returnValue":[4,"return-value"],"items":[16],"itemsPerPage":[2,"items-per-page"],"optionAsSelection":[4,"option-as-selection"],"menuVisible":[32],"currentIndex":[32],"hasOptionItems":[32],"options":[32],"setValue":[64],"onHideMenu":[64],"setActiveDescendant":[64],"updateQuery":[64],"onItemSelection":[64]},[[1,"keydown","handleKeyDown"]],{"items":["watchHandler"],"value":["onValueChange"]}]]],["p-2ff8e8e2",[[65,"c-select",{"autofocus":[4],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"label":[1],"shadow":[4],"name":[1],"required":[4],"returnValue":[4,"return-value"],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"itemsPerPage":[2,"items-per-page"],"placeholder":[1],"value":[1032],"items":[16],"optionAsSelection":[4,"option-as-selection"],"menuVisible":[32],"currentIndex":[32],"activeListItemId":[32],"statusText":[32],"hasOptionItems":[32],"previousValue":[32],"onItemSelection":[64],"onHideMenu":[64],"setActiveDescendant":[64]},[[2,"keydown","handleKeyDown"]],{"value":["onValueChange"],"validate":["validateChange"],"currentIndex":["onCurrentIndexChange"]}]]],["p-8b7e9097",[[4,"c-swiper",{"value":[1544],"elementId":[1,"id"],"isBeginning":[32],"isEnd":[32],"statusText":[32]},[[0,"changeValue","onTabClick"],[2,"keyup","handleKeyUp"]]]]],["p-0bf28786",[[1,"c-side-navigation-item",{"active":[4],"href":[1],"target":[1],"loading":[4]},[[0,"itemChange","handleChange"]],{"active":["onActiveChange"]}]]],["p-6ec9109d",[[1,"c-sub-navigation-item",{"active":[4],"focusable":[4],"href":[1],"target":[1],"loading":[4]}]]],["p-f0329312",[[65,"c-text-field",{"autofocus":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"trimWhitespace":[4,"trim-whitespace"],"label":[1],"max":[2],"min":[2],"name":[1],"number":[4],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[1025],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"messageOptions":[32]}]]],["p-14ed80ac",[[1,"c-toasts",{"absolute":[4],"horizontal":[1],"vertical":[1],"messages":[32],"addToast":[64],"removeToast":[64]}]]],["p-9f2311a7",[[1,"c-accordion-item",{"collapsable":[4],"heading":[1],"value":[8],"expanded":[4],"outlined":[4]},[[2,"keydown","handleKeyDown"],[0,"changeValue","stop"]]]]],["p-192145f2",[[1,"c-list-item",{"active":[4],"disabled":[4],"disabledByParent":[4,"disabled-by-parent"],"hoverable":[4],"ripple":[4],"href":[1],"target":[1]},null,{"active":["onActiveChange"]}]]],["p-e970fa68",[[1,"c-login-card-actions",{"align":[1],"justify":[1]}]]],["p-ef6162d9",[[65,"c-otp-input",{"hideDetails":[4,"hide-details"],"hint":[1],"elementId":[1,"id"],"length":[2],"valid":[4],"validation":[1],"statusText":[32]},null,{"validation":["onValidationMessageChange"]}]]],["p-05bb5c30",[[65,"c-radio-group",{"value":[1032],"hideDetails":[4,"hide-details"],"hint":[1],"inline":[4],"label":[1],"color":[1],"items":[16],"disabled":[4],"returnValue":[4,"return-value"],"required":[4],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-e0c3d13b",[[1,"c-swiper-tab",{"disabled":[4],"active":[4],"label":[1],"hostId":[1,"id"],"setsize":[2],"position":[2],"value":[8]},[[1,"click","onTabClick"]]]]],["p-dea9da0e",[[1,"c-tab",{"active":[4],"disabled":[4],"hostId":[1,"id"],"position":[2],"setsize":[2],"value":[8]},[[1,"focus","onTabFocus"],[1,"keydown","handleKeydown"]]]]],["p-79308b3f",[[1,"c-accordion",{"value":[1032],"mandatory":[4],"multiple":[4],"outlined":[4]},[[1,"itemChange","onAccordionItemChange"]],{"value":["watchPropHandler"]}]]],["p-f4a9cb4d",[[1,"c-alert",{"type":[1]}]]],["p-cea20d08",[[1,"c-card-content"]]],["p-28282ef5",[[1,"c-card-title"]]],["p-b09ba433",[[1,"c-link",{"href":[1],"underline":[4],"target":[1],"weight":[1]}]]],["p-4c23471f",[[0,"c-list",{"disabled":[4]},null,{"disabled":["onDisabledChange"]}]]],["p-6f86810a",[[1,"c-list-item-title",{"active":[4]}]]],["p-a8da163c",[[1,"c-login-button",{"href":[1],"src":[1],"alt":[1]}]]],["p-a8073d7e",[[1,"c-login-buttons"]]],["p-01ed27ec",[[4,"c-login-card",{"backgroundPosition":[1,"background-position"],"mobileBreakpoint":[2,"mobile-breakpoint"],"overlay":[4],"overlayBlendMode":[1,"overlay-blend-mode"],"src":[1],"path":[32],"imageHeight":[32]}]]],["p-55ca2b16",[[1,"c-login-card-content"]]],["p-eb35a668",[[1,"c-login-card-title"]]],["p-ff51acad",[[1,"c-modal",{"value":[4],"dismissable":[4],"width":[8],"zIndex":[2,"z-index"],"innerValue":[32],"animateModal":[32]},null,{"value":["onValueChange"]}]]],["p-2c9aabef",[[1,"c-option",{"selected":[4],"disabled":[4],"name":[1],"value":[8]}]]],["p-c343dd6e",[[1,"c-option-value"]]],["p-93280350",[[1,"c-page",{"scrollIndicator":[4,"scroll-indicator"]}]]],["p-732bc932",[[1,"c-progress-bar",{"value":[2],"hideDetails":[4,"hide-details"],"singleLine":[4,"single-line"],"label":[1],"indeterminate":[4]}]]],["p-c7a07889",[[1,"c-radio",{"checked":[4],"disabled":[4],"value":[1]}]]],["p-cd047753",[[1,"c-side-navigation-title"]]],["p-843b5cdb",[[1,"c-status",{"type":[1]}]]],["p-738a7d1d",[[1,"c-step",{"complete":[4],"current":[4]}]]],["p-c48a6e1d",[[1,"c-steps",{"value":[8],"isMobile":[32],"label":[32]},null,{"value":["watchPropHandler"]}]]],["p-889d3d6d",[[65,"c-switch",{"checked":[1028],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostDisabled":[4,"disabled"],"hostId":[1,"id"],"required":[4],"hasLabel":[32]}]]],["p-58aed6cc",[[1,"c-tab-buttons",{"value":[1032],"mandatory":[4],"tabs":[4],"size":[1],"hostDisabled":[4,"disabled"]},[[1,"tabFocus","tabFocusHandler"],[2,"keyup","handleKeyUp"],[1,"tabChange","onTabChange"]],{"value":["onValueChange"]}]]],["p-26021965",[[1,"c-tab-item",{"value":[8],"active":[4]}]]],["p-d60032ce",[[1,"c-tab-items",{"value":[8],"disableAnimation":[4,"disable-animation"],"activeTab":[32]},[[1,"contentChange","tabContentChangeHandler"]],{"value":["onValueChange"]}]]],["p-f4d93d05",[[4,"c-table",{"mobileBreakpoint":[2,"mobile-breakpoint"],"responsive":[4]}]]],["p-210da773",[[1,"c-tags"]]],["p-6a1e5ae3",[[1,"c-toast",{"message":[16],"closeToast":[64]}]]],["p-02b57cbd",[[1,"c-card-actions",{"align":[1],"justify":[1]}]]],["p-6b21aa4e",[[1,"c-card",{"fullscreen":[4],"isFullscreen":[32],"exitFullscreen":[64],"enterFullscreen":[64]}],[1,"c-button",{"inverted":[4],"outlined":[4],"ghost":[4],"danger":[4],"grouped":[4],"text":[4],"loading":[4],"fit":[4],"noRadius":[4,"no-radius"],"type":[1],"disabled":[516],"value":[8],"hostId":[1,"id"],"size":[1],"href":[1],"target":[1],"tabs":[4]},[[1,"focus","onTabFocus"]]],[1,"c-csc-logo",{"width":[2]}],[1,"c-main"],[1,"c-row",{"gap":[2],"nowrap":[4],"align":[1],"justify":[1]}],[1,"c-toolbar"],[1,"c-spacer"],[1,"c-icon-button",{"badge":[1],"danger":[4],"loading":[4],"text":[4],"inverted":[4],"outlined":[4],"path":[1],"ghost":[4],"disabled":[4],"size":[1]}],[1,"c-badge"],[1,"c-spinner",{"color":[1],"size":[2],"width":[2]}],[1,"c-icon",{"path":[1],"size":[2],"color":[1]}],[1,"c-ripple",{"createRipple":[64]}]]],["p-dd6d422d",[[1,"c-menu",{"items":[16],"contentClass":[1,"content-class"],"custom":[4],"small":[4],"flat":[4],"itemsPerPage":[2,"items-per-page"],"menuItemsComponent":[32],"menuWrapperComponent":[32],"currentIndex":[32],"active":[32]},[[2,"keydown","handleKeyDown"]]],[1,"c-menu-items",{"items":[16],"small":[4],"active":[4],"parentType":[1,"parent-type"],"parent":[16],"top":[2],"index":[2],"itemsPerPage":[2,"items-per-page"],"scrollingParent":[32],"isInView":[32],"currentIndex":[32]},[[2,"keydown","handleKeyDown"]],{"currentIndex":["onIndexChange"]}]]],["p-bf307cb4",[[1,"c-pagination",{"value":[16],"hideDetails":[4,"hide-details"],"simple":[4],"size":[1],"hideRange":[4,"hide-range"],"itemsPerPageOptions":[16],"_currentPage":[32],"_itemsPerPage":[32],"_totalVisible":[32],"tick":[32]},null,{"value":["valueHandler"]}],[65,"c-checkbox",{"checked":[1028],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"indeterminate":[4],"label":[1],"required":[4],"valid":[4],"validation":[1],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostName":[1,"name"],"messageOptions":[32]},[[1,"keydown","handleKeyDown"]],{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-cfc34289",[[1,"c-loader",{"contentdelay":[2],"hide":[4],"size":[2],"width":[2]},null,{"hide":["onElementHide"]}]]],["p-32298609",[[1,"c-message",{"hint":[1],"inputId":[1,"input-id"],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"hint":["onHintMessageChange"]}]]],["p-50db6941",[[1,"c-dropdown",{"items":[16],"options":[16],"itemsPerPage":[2,"items-per-page"],"parent":[16],"index":[2],"isOpen":[4,"is-open"],"focusList":[4,"focus-list"],"inputId":[1,"input-id"],"type":[1],"wasClicked":[4,"was-clicked"],"currentIndex":[32],"isVisible":[32],"topPosition":[32],"statusText":[32],"updateDropdown":[64],"focusDropdown":[64],"open":[64],"close":[64],"focusItem":[64]},null,{"items":["onItemsChange"],"options":["onOptionsChange"],"currentIndex":["onCurrentIndexChange"]}],[4,"c-input",{"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]},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.6.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,
|
|
1
|
+
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","JSON","parse"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.6.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,6yXAAuCH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as s,g as o}from"./p-9d54e9a4.js";import{g as n}from"./p-dffa1f9f.js";const r="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-select-active-color:var(--c-select-active-color, var(--c-primary-600));--_c-select-inactive-color:var(--c-select-inactive-color, var(--c-tertiary-600));--_c-select-background-color:var(--c-select-background-color, var(--c-transparent));--_c-select-text-color:var(--c-select-text-color, var(--c-text-body));--_c-select-placeholder-color:var(--c-select-placeholder-color, var(--c-tertiary-500));--_c-select-option-background-color:var(--c-select-option-background-color, var(--c-white));--_c-select-option-background-color-hover:var(--c-select-option-background-color-hover, var(--c-primary-100));--_c-select-option-text-color:var(--c-select-option-text-color, var(--c-text-body));--_c-input-active-color:var(--_c-select-active-color);--_c-input-inactive-color:var(--_c-select-inactive-color);--_c-input-background-color:var(--_c-select-background-color);--_c-input-text-color:var(--_c-select-text-color);--_c-input-placeholder-color:var(--_c-select-placeholder-color)}:host{display:block;cursor:text}.c-input-menu__chevron{fill:currentColor;height:22px;width:22px;min-width:22px;transform:rotate(0deg);transition:transform 0.3s ease-in-out}.c-input-menu__chevron--active{transform:rotate(180deg)}.c-input-menu__input{width:100%;display:flex;justify-items:stretch}.c-input-menu__selection{display:none;pointer-events:none}.c-input-menu__selection--show{align-items:center;display:flex;width:100%;color:var(--_c-select-active-color)}.c-input-menu__item-wrapper{position:absolute;width:100%;top:44px;z-index:10;margin-left:calc(var(--_c-input-label-position) * -1)}.c-input-menu__item-wrapper--shadow{top:47px}.c-input-menu__items{position:absolute;background-color:var(--_c-select-option-background-color);min-width:calc(100% + 24px);box-shadow:0 8px 16px 0 rgba(0, 0, 0, 0.2);z-index:10;user-select:none;border-radius:4px;margin:0 -12px;overflow-y:scroll;list-style:none;padding:0}.c-input-menu__items--hidden{display:none}.c-input-menu__items li{cursor:pointer;display:flex;min-height:48px;padding:0 12px;transition:background-color 0.3s;font-size:14px;align-items:center;justify-content:flex-start;color:var(--_c-select-option-text-color)}.c-input-menu__items li.disabled{background-color:var(--c-tertiary-100);filter:grayscale(1) opacity(0.6);cursor:default}.c-input-menu__items li.disabled:hover{background-color:var(--c-tertiary-100)}.c-input-menu__items li.dense{padding:10px 14px}.c-input-menu__items li:hover{background-color:var(--_c-select-option-background-color-hover)}.c-input-menu__items li[aria-selected=true]{background-color:var(--_c-select-option-background-color-hover);box-shadow:inset 0 0 0 1px var(--_c-select-active-color);border-radius:4px;backface-visibility:hidden;transform:translate3d(0, 0, 0)}.c-input-menu__items li.none{color:rgba(0, 0, 0, 0.5)}.c-input-menu__items--empty li{color:var(--c-text-system);cursor:default;gap:8px;pointer-events:none}.c-input-menu__items--empty li svg{fill:var(--c-warning-600);height:18px;width:18px}input{max-height:32px;padding:8px 0;background-color:transparent;border:none;color:var(--c-text-body);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%;pointer-events:none}input:focus,input:active{outline:none}input::-ms-reveal{display:none}svg{fill:currentColor;height:22px;width:22px}.c-input--disabled{color:var(--c-tertiary-400)}.c-input:focus-within{color:var(--c-primary-600)}.c-input--error{color:var(--c-error-600)}.c-input--error:focus-within{color:var(--c-error-600)}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}";const l=class{constructor(e){t(this,e);this.changeValue=i(this,"changeValue",3);if(e.$hostElement$["s-ei"]){this.internals=e.$hostElement$["s-ei"]}else{this.internals=e.$hostElement$.attachInternals();e.$hostElement$["s-ei"]=this.internals}this._itemRefs=[];this._cOptionElements={};this._outerWrapperClasses=["outer-wrapper"];this._validationClasses=["validation-message"];this._debounce=null;this._observer=new IntersectionObserver(((t,i)=>{t.forEach((t=>{if(!t.isIntersecting){t.target.scrollIntoView({block:"nearest",inline:"nearest"});i.unobserve(t.target)}else{i.unobserve(t.target)}}))}),{threshold:1});this._lastKeyPressTime=null;this._searchString="";this._blurred=false;this._optionItems=[];this._handleSlotChange=()=>{this._getOptionItems()};this.autofocus=false;this.disabled=false;this.hideDetails=false;this.hint="";this.hostId=undefined;this.label=undefined;this.shadow=false;this.name=undefined;this.required=false;this.returnValue=undefined;this.valid=true;this.validate=false;this.validateOnBlur=false;this.validation="Required field";this.itemsPerPage=6;this.placeholder="";this.value=null;this.items=[];this.optionAsSelection=undefined;this.menuVisible=false;this.currentIndex=null;this.activeListItemId=null;this.statusText="";this.hasOptionItems=false;this.previousValue={value:"",name:""}}onValueChange(){var t;if(!this.value)return;const i=!((t=this.value)===null||t===void 0?void 0:t.value)?this._items.find((t=>t.value===this.value)):this.value;this._valueChangedHandler(i)}validateChange(t){if(t){this._runValidate()}}onCurrentIndexChange(t){var i,e,s;this.activeListItemId=(s=(e=(i=this._itemRefs[t])===null||i===void 0?void 0:i.ref)===null||e===void 0?void 0:e.id)!==null&&s!==void 0?s:null;this._scrollToElement();this._updateStatusText()}get _items(){return this.hasOptionItems?this._optionItems:this.items}_setValue(t){return this.returnValue?t===null||t===void 0?void 0:t.value:{name:t===null||t===void 0?void 0:t.name,value:t===null||t===void 0?void 0:t.value}}_valueChangedHandler(t){var i;if(!t)return;if(this.hasOptionItems&&this.optionAsSelection){const i=this._cOptionElements[t.value.toString()];if(!i)return;const e=i.cloneNode(true);this._selectionElement.classList.add("c-input-menu__selection--show");this._selectionElement.replaceChildren(e)}this.currentIndex=this._items.findIndex((i=>i.value===(t===null||t===void 0?void 0:t.value)));const e=this._setValue(t);if(this.previousValue&&((i=this.previousValue)===null||i===void 0?void 0:i.value)===(t===null||t===void 0?void 0:t.value))return;this.previousValue=t;this.changeValue.emit(e);this.internals.setFormValue(t.value)}_getLabel(){var t,i,e,s;if(!this.value)return"";if(this.returnValue&&["number","string","boolean"].includes(typeof this.value)){return(i=(t=this._items)===null||t===void 0?void 0:t.find((t=>t.value===this.value)))===null||i===void 0?void 0:i.name}return(s=(e=this._items)===null||e===void 0?void 0:e.find((t=>t.value===this.value.value)))===null||s===void 0?void 0:s.name}_scrollToElement(){var t;if(this._items.length>this.itemsPerPage){const i=(t=this._itemRefs.find((t=>{var i;return t.value===((i=this._items[this.currentIndex])===null||i===void 0?void 0:i.value)})))===null||t===void 0?void 0:t.ref;if(!!i){this._observer.observe(i)}}}handleKeyDown(t){if(this.disabled)return;const i=/^[0-9a-zA-Z]+$/;if(t.key.match(i)&&t.key.length===1){if(Date.now()-this._lastKeyPressTime>3e3||this._searchString.length>2){this._searchString=t.key}else{this._searchString=`${this._searchString}${t.key}`}this._lastKeyPressTime=Date.now();const e=this._items.find((t=>t.name.toLowerCase().startsWith(this._searchString)));function s(t){return t===e}if(e){if(this.menuVisible){this.currentIndex=this._items.findIndex(s);this._scrollToElement()}else{this.value=e}}}if(t.key==="Tab"){this._cInput.closeDropdown()}if(t.key==="ArrowDown"){t.preventDefault();this._showMenu()}if(t.key==="ArrowUp"){t.preventDefault();this._showMenu()}if(t.key===" "){t.preventDefault();this._showMenu()}}async onItemSelection(t){this.currentIndex=t;this._selectItem()}async onHideMenu(){this.menuVisible=false}componentWillLoad(){var t,i;l._uniqueId+=1;this._id=(i=(t=this.hostId)===null||t===void 0?void 0:t.replace(/[^a-zA-Z0-9-_]/g,""))!==null&&i!==void 0?i:l._uniqueId.toString();this._inputId="input-"+(this.hostId||this.label||this.placeholder).replace(/[^a-zA-Z0-9-_]/g,"").toLowerCase();this._setInitialValue()}_setInitialValue(){if(!this.value)return;const t=this.returnValue?this.value:this.value.value;this.internals.setFormValue(t)}componentDidLoad(){this._getOptionItems();if((this.value||typeof this.value==="boolean")&&!this.currentIndex&&this.currentIndex!==0){this.currentIndex=this._items.findIndex((t=>t.value===this.value))}requestAnimationFrame((()=>{this._cInput.createDropdown({type:"select",items:this._items,options:this._cOptionElements,parent:this.host,itemsPerPage:this.itemsPerPage,index:this.currentIndex,click:false,id:this._inputId})}))}disconnectedCallback(){this._observer.disconnect()}_selectItem(){const t=this._items[this.currentIndex];this.value=t;this._scrollToElement()}async setActiveDescendant(t){this._inputElement.setAttribute("aria-activedescendant",t)}_showMenu(){if(this.disabled)return;this.menuVisible=true;this._cInput.openDropdown()}_getOptionItems(){requestAnimationFrame((()=>{this._cOptionElements={};let t=null;this._optionItems=(this.host?Array.from(this.host.querySelectorAll("c-option")):[]).map(((i,e)=>{const s={value:i.value,name:i.name||i.innerText,disabled:!!i.disabled};if(i.selected){t=s}i.slot=`option-${e}`;this._cOptionElements[i.value.toString()]=i;return s}));this.hasOptionItems=!!this._optionItems.length;if(t){this._valueChangedHandler(t)}}))}_runValidate(){if(this.required&&!this.value&&(this._blurred||!this.validateOnBlur)){this._outerWrapperClasses.push("required");this._validationClasses.push("show")}else{this._outerWrapperClasses=this._outerWrapperClasses.filter((t=>t!=="required"));this._validationClasses=this._validationClasses.filter((t=>t!=="show"))}}_renderChevron(){const t={"c-input-menu__chevron":true,"c-input-menu__chevron--active":this.menuVisible};return e("svg",{class:t,viewBox:"0 0 24 24"},e("path",{d:n}))}_renderInputElement(){var t,i;return e("div",{class:"c-input-menu__input"},e("input",{"aria-controls":this._inputId+"-items","aria-expanded":this.menuVisible.toString(),"aria-readonly":"true","aria-haspopup":"listbox",ref:t=>this._inputElement=t,id:this._inputId,autocomplete:"off",class:"c-input__input",type:"text",value:(t=this._getLabel())!==null&&t!==void 0?t:null,name:(i=this.name)!==null&&i!==void 0?i:null,readonly:"true"}),e("div",{ref:t=>this._selectionElement=t,class:"c-input-menu__selection"}))}_updateStatusText(){if(this._debounce!==null){clearTimeout(this._debounce);this._debounce=null}this._debounce=window.setTimeout((()=>{var t;const i=this.host.shadowRoot.querySelector('li[aria-selected="true"]');const e=!!this._items.length?", to navigate use up and down arrows":"";const s=!!((t=i===null||i===void 0?void 0:i.classList)===null||t===void 0?void 0:t.contains("disabled"));const o=s?"Disabled option - ":"";const n=!!i?`${o}${i.dataset.value} - ${i.ariaPosInSet} of ${i.ariaSetSize} is highlighted`:null;this.statusText=`${n||e}`;this._debounce=null}),1400)}render(){var t;return e(s,{title:(t=this._getLabel())!==null&&t!==void 0?t:null},e("div",{id:"announce-"+this._id,class:"visuallyhidden","aria-live":"polite","aria-atomic":"true"},this.statusText),e("c-input",{ref:t=>this._cInput=t,autofocus:this.autofocus,disabled:this.disabled,"hide-details":this.hideDetails,hint:this.hint,id:this.hostId,"input-id":this._inputId,"itemns-per-page":this.itemsPerPage,label:this.label,name:this.name,placeholder:this.placeholder,required:this.required,shadow:this.shadow,valid:this.valid,validate:this.validate,"validate-on-blur":this.validateOnBlur,validation:this.validation,value:this.value,variant:"select",onItemClick:()=>this._showMenu()},e("slot",{name:"pre",slot:"pre"}),e("div",{class:"c-input__content"},this._renderInputElement(),this._renderChevron(),e("slot",{onSlotchange:this._handleSlotChange})),e("slot",{name:"post",slot:"post"})))}static get formAssociated(){return true}get host(){return o(this)}static get watchers(){return{value:["onValueChange"],validate:["validateChange"],currentIndex:["onCurrentIndexChange"]}}};l._uniqueId=0;l.style=r;export{l as c_select};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,h as e,H as s,g as o}from"./p-9d54e9a4.js";import{g as n}from"./p-dffa1f9f.js";const r="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-select-active-color:var(--c-select-active-color, var(--c-primary-600));--_c-select-inactive-color:var(--c-select-inactive-color, var(--c-tertiary-600));--_c-select-background-color:var(--c-select-background-color, var(--c-transparent));--_c-select-text-color:var(--c-select-text-color, var(--c-text-body));--_c-select-placeholder-color:var(--c-select-placeholder-color, var(--c-tertiary-500));--_c-select-option-background-color:var(--c-select-option-background-color, var(--c-white));--_c-select-option-background-color-hover:var(--c-select-option-background-color-hover, var(--c-primary-100));--_c-select-option-text-color:var(--c-select-option-text-color, var(--c-text-body));--_c-input-active-color:var(--_c-select-active-color);--_c-input-inactive-color:var(--_c-select-inactive-color);--_c-input-background-color:var(--_c-select-background-color);--_c-input-text-color:var(--_c-select-text-color);--_c-input-placeholder-color:var(--_c-select-placeholder-color)}:host{display:block;cursor:text}.c-input-menu__chevron{fill:currentColor;height:22px;width:22px;min-width:22px;transform:rotate(0deg);transition:transform 0.3s ease-in-out}.c-input-menu__chevron--active{transform:rotate(180deg)}.c-input-menu__input{width:100%;display:flex;justify-items:stretch}.c-input-menu__selection{display:none;pointer-events:none}.c-input-menu__selection--show{align-items:center;display:flex;width:100%;color:var(--_c-select-active-color)}.c-input-menu__item-wrapper{position:absolute;width:100%;top:44px;z-index:10;margin-left:calc(var(--_c-input-label-position) * -1)}.c-input-menu__item-wrapper--shadow{top:47px}.c-input-menu__items{position:absolute;background-color:var(--_c-select-option-background-color);min-width:calc(100% + 24px);box-shadow:0 8px 16px 0 rgba(0, 0, 0, 0.2);z-index:10;user-select:none;border-radius:4px;margin:0 -12px;overflow-y:scroll;list-style:none;padding:0}.c-input-menu__items--hidden{display:none}.c-input-menu__items li{cursor:pointer;display:flex;min-height:48px;padding:0 12px;transition:background-color 0.3s;font-size:14px;align-items:center;justify-content:flex-start;color:var(--_c-select-option-text-color)}.c-input-menu__items li.disabled{background-color:var(--c-tertiary-100);filter:grayscale(1) opacity(0.6);cursor:default}.c-input-menu__items li.disabled:hover{background-color:var(--c-tertiary-100)}.c-input-menu__items li.dense{padding:10px 14px}.c-input-menu__items li:hover{background-color:var(--_c-select-option-background-color-hover)}.c-input-menu__items li[aria-selected=true]{background-color:var(--_c-select-option-background-color-hover);box-shadow:inset 0 0 0 1px var(--_c-select-active-color);border-radius:4px;backface-visibility:hidden;transform:translate3d(0, 0, 0)}.c-input-menu__items li.none{color:rgba(0, 0, 0, 0.5)}.c-input-menu__items--empty li{color:var(--c-text-system);cursor:default;gap:8px;pointer-events:none}.c-input-menu__items--empty li svg{fill:var(--c-warning-600);height:18px;width:18px}input{max-height:32px;padding:8px 0;background-color:transparent;border:none;color:var(--c-text-body);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%;pointer-events:none}input:focus,input:active{outline:none}input::-ms-reveal{display:none}svg{fill:currentColor;height:22px;width:22px}.c-input--disabled{color:var(--c-tertiary-400)}.c-input:focus-within{color:var(--c-primary-600)}.c-input--error{color:var(--c-error-600)}.c-input--error:focus-within{color:var(--c-error-600)}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}";const l=class{constructor(e){t(this,e);this.changeValue=i(this,"changeValue",3);if(e.$hostElement$["s-ei"]){this.internals=e.$hostElement$["s-ei"]}else{this.internals=e.$hostElement$.attachInternals();e.$hostElement$["s-ei"]=this.internals}this._itemRefs=[];this._cOptionElements={};this._outerWrapperClasses=["outer-wrapper"];this._validationClasses=["validation-message"];this._debounce=null;this._observer=new IntersectionObserver(((t,i)=>{t.forEach((t=>{if(!t.isIntersecting){t.target.scrollIntoView({block:"nearest",inline:"nearest"});i.unobserve(t.target)}else{i.unobserve(t.target)}}))}),{threshold:1});this._lastKeyPressTime=null;this._searchString="";this._blurred=false;this._optionItems=[];this._handleSlotChange=()=>{this._getOptionItems()};this.autofocus=false;this.disabled=false;this.hideDetails=false;this.hint="";this.hostId=undefined;this.label=undefined;this.shadow=false;this.name=undefined;this.required=false;this.returnValue=undefined;this.valid=true;this.validate=false;this.validateOnBlur=false;this.validation="Required field";this.itemsPerPage=6;this.placeholder="";this.value=null;this.items=[];this.optionAsSelection=undefined;this.menuVisible=false;this.currentIndex=null;this.activeListItemId=null;this.statusText="";this.hasOptionItems=false;this.previousValue={value:"",name:""}}onValueChange(){var t;if(!this.value)return;const i=!((t=this.value)===null||t===void 0?void 0:t.value)?this._items.find((t=>t.value===this.value)):this.value;this._valueChangedHandler(i)}validateChange(t){if(t){this._runValidate()}}onCurrentIndexChange(t){var i,e,s;this.activeListItemId=(s=(e=(i=this._itemRefs[t])===null||i===void 0?void 0:i.ref)===null||e===void 0?void 0:e.id)!==null&&s!==void 0?s:null;this._scrollToElement();this._updateStatusText()}get _items(){return this.hasOptionItems?this._optionItems:this.items}_setValue(t){return this.returnValue?t===null||t===void 0?void 0:t.value:{name:t===null||t===void 0?void 0:t.name,value:t===null||t===void 0?void 0:t.value}}_valueChangedHandler(t){var i;if(!t)return;if(this.hasOptionItems&&this.optionAsSelection){const i=this._cOptionElements[t.value.toString()];if(!i)return;const e=i.cloneNode(true);this._selectionElement.classList.add("c-input-menu__selection--show");this._selectionElement.replaceChildren(e)}this.currentIndex=this._items.findIndex((i=>i.value===(t===null||t===void 0?void 0:t.value)));const e=this._setValue(t);if(this.previousValue&&((i=this.previousValue)===null||i===void 0?void 0:i.value)===(t===null||t===void 0?void 0:t.value))return;this.previousValue=t;this.changeValue.emit(e);this.internals.setFormValue(t.value)}_getLabel(){var t,i,e,s;if(!this.value)return"";if(this.returnValue&&["number","string","boolean"].includes(typeof this.value)){return(i=(t=this._items)===null||t===void 0?void 0:t.find((t=>t.value===this.value)))===null||i===void 0?void 0:i.name}return(s=(e=this._items)===null||e===void 0?void 0:e.find((t=>t.value===this.value.value)))===null||s===void 0?void 0:s.name}_scrollToElement(){var t;if(this._items.length>this.itemsPerPage){const i=(t=this._itemRefs.find((t=>{var i;return t.value===((i=this._items[this.currentIndex])===null||i===void 0?void 0:i.value)})))===null||t===void 0?void 0:t.ref;if(!!i){this._observer.observe(i)}}}handleKeyDown(t){if(this.disabled)return;const i=/^[0-9a-zA-Z]+$/;if(t.key.match(i)&&t.key.length===1){if(Date.now()-this._lastKeyPressTime>3e3||this._searchString.length>2){this._searchString=t.key}else{this._searchString=`${this._searchString}${t.key}`}this._lastKeyPressTime=Date.now();const e=this._items.find((t=>t.name.toLowerCase().startsWith(this._searchString)));function s(t){return t===e}if(e){if(this.menuVisible){this.currentIndex=this._items.findIndex(s);this._scrollToElement()}else{this.value=e}}}if(t.key==="Tab"){this._dropdownElement.close()}if(t.key==="ArrowDown"){t.preventDefault();if(this._dropdownElement.isOpen)return;this._showMenu();this._dropdownElement.focusItem(this.currentIndex)}if(t.key==="ArrowUp"){t.preventDefault();if(this._dropdownElement.isOpen)return;this._showMenu();this._dropdownElement.focusItem(this.currentIndex)}if(t.key===" "){t.preventDefault();this._showMenu()}}async onItemSelection(t){this.currentIndex=t;this._selectItem()}async onHideMenu(){this.menuVisible=false}componentWillLoad(){var t,i;l._uniqueId+=1;this._id=(i=(t=this.hostId)===null||t===void 0?void 0:t.replace(/[^a-zA-Z0-9-_]/g,""))!==null&&i!==void 0?i:l._uniqueId.toString();this._inputId="input-"+(this.hostId||this.label||this.placeholder).replace(/[^a-zA-Z0-9-_]/g,"").toLowerCase();this._setInitialValue()}_setInitialValue(){if(!this.value)return;const t=this.returnValue?this.value:this.value.value;this.internals.setFormValue(t)}componentDidLoad(){this._getOptionItems();if((this.value||typeof this.value==="boolean")&&!this.currentIndex&&this.currentIndex!==0){this.currentIndex=this._items.findIndex((t=>t.value===this.value))}}disconnectedCallback(){this._observer.disconnect()}_selectItem(){const t=this._items[this.currentIndex];this.value=t;this._scrollToElement()}async setActiveDescendant(t){this._inputElement.setAttribute("aria-activedescendant",t)}_showMenu(){if(this.disabled)return;this.menuVisible=true;this._dropdownElement.open()}_getOptionItems(){requestAnimationFrame((()=>{this._cOptionElements={};let t=null;this._optionItems=(this.el?Array.from(this.el.querySelectorAll("c-option")):[]).map(((i,e)=>{const s={value:i.value,name:i.name||i.innerText,disabled:!!i.disabled};if(i.selected){t=s}i.slot=`option-${e}`;this._cOptionElements[i.value.toString()]=i;return s}));this.hasOptionItems=!!this._optionItems.length;if(t){this._valueChangedHandler(t)}}))}_runValidate(){if(this.required&&!this.value&&(this._blurred||!this.validateOnBlur)){this._outerWrapperClasses.push("required");this._validationClasses.push("show")}else{this._outerWrapperClasses=this._outerWrapperClasses.filter((t=>t!=="required"));this._validationClasses=this._validationClasses.filter((t=>t!=="show"))}}_renderChevron(){const t={"c-input-menu__chevron":true,"c-input-menu__chevron--active":this.menuVisible};return e("svg",{class:t,viewBox:"0 0 24 24"},e("path",{d:n}))}_renderInputElement(){var t,i;return e("div",{class:"c-input-menu__input"},e("input",{"aria-controls":this._inputId+"-items","aria-expanded":this.menuVisible.toString(),"aria-readonly":"true","aria-haspopup":"listbox",ref:t=>this._inputElement=t,id:this._inputId,autocomplete:"off",class:"c-input__input",type:"text",value:(t=this._getLabel())!==null&&t!==void 0?t:null,name:(i=this.name)!==null&&i!==void 0?i:null,readonly:"true"}),e("div",{ref:t=>this._selectionElement=t,class:"c-input-menu__selection"}))}_updateStatusText(){if(this._debounce!==null){clearTimeout(this._debounce);this._debounce=null}this._debounce=window.setTimeout((()=>{var t;const i=this.el.shadowRoot.querySelector('li[aria-selected="true"]');const e=!!this._items.length?", to navigate use up and down arrows":"";const s=!!((t=i===null||i===void 0?void 0:i.classList)===null||t===void 0?void 0:t.contains("disabled"));const o=s?"Disabled option - ":"";const n=!!i?`${o}${i.dataset.value} - ${i.ariaPosInSet} of ${i.ariaSetSize} is highlighted`:null;this.statusText=`${n||e}`;this._debounce=null}),1400)}render(){var t;return e(s,{title:(t=this._getLabel())!==null&&t!==void 0?t:null},e("div",{id:"announce-"+this._id,class:"visuallyhidden","aria-live":"polite","aria-atomic":"true"},this.statusText),e("c-input",{autofocus:this.autofocus,disabled:this.disabled,"hide-details":this.hideDetails,hint:this.hint,id:this.hostId,"input-id":this._inputId,items:this._items,"items-per-page":this.itemsPerPage,label:this.label,name:this.name,placeholder:this.placeholder,required:this.required,shadow:this.shadow,valid:this.valid,validate:this.validate,"validate-on-blur":this.validateOnBlur,validation:this.validation,value:this.value,variant:"select",onItemClick:()=>this._showMenu()},e("slot",{name:"pre",slot:"pre"}),e("div",{class:"c-input__content"},this._renderInputElement(),this._renderChevron(),e("slot",{onSlotchange:this._handleSlotChange})),e("c-dropdown",{ref:t=>this._dropdownElement=t,slot:"dropdown",items:this._items,options:this._cOptionElements,"items-per-page":this.itemsPerPage,parent:this.el,index:this.currentIndex,"input-id":this._inputId,type:"select"}),e("slot",{name:"post",slot:"post"})))}static get formAssociated(){return true}get el(){return o(this)}static get watchers(){return{value:["onValueChange"],validate:["validateChange"],currentIndex:["onCurrentIndexChange"]}}};l._uniqueId=0;l.style=r;export{l as c_select};
|
|
2
|
+
//# sourceMappingURL=p-2ff8e8e2.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cSelectCss","CSelect","this","_itemRefs","_cOptionElements","_outerWrapperClasses","_validationClasses","_debounce","_observer","IntersectionObserver","entries","observer","forEach","entry","isIntersecting","target","scrollIntoView","block","inline","unobserve","threshold","_lastKeyPressTime","_searchString","_blurred","_optionItems","_handleSlotChange","_getOptionItems","value","name","onValueChange","realValue","_a","_items","find","item","_valueChangedHandler","validateChange","newValue","_runValidate","onCurrentIndexChange","index","activeListItemId","_c","_b","ref","id","_scrollToElement","_updateStatusText","hasOptionItems","items","_setValue","returnValue","optionAsSelection","selection","toString","clone","cloneNode","_selectionElement","classList","add","replaceChildren","currentIndex","findIndex","element","previousValue","changeValue","emit","internals","setFormValue","_getLabel","includes","_d","length","itemsPerPage","itemRef","observe","handleKeyDown","ev","disabled","letterNumber","key","match","Date","now","selectedItem","i","toLowerCase","startsWith","isItem","menuVisible","_dropdownElement","close","preventDefault","isOpen","_showMenu","focusItem","onItemSelection","_selectItem","onHideMenu","componentWillLoad","_uniqueId","_id","hostId","replace","_inputId","label","placeholder","_setInitialValue","componentDidLoad","disconnectedCallback","disconnect","setActiveDescendant","_inputElement","setAttribute","open","requestAnimationFrame","el","Array","from","querySelectorAll","map","cSelectItem","innerText","selected","slot","required","validateOnBlur","push","filter","c","_renderChevron","classes","h","class","viewBox","d","mdiChevronDown","_renderInputElement","autocomplete","type","readonly","clearTimeout","window","setTimeout","shadowRoot","querySelector","ending","isDisabled","contains","beginning","selectionText","dataset","ariaPosInSet","ariaSetSize","statusText","render","Host","title","autofocus","hideDetails","hint","shadow","valid","validate","validation","variant","onItemClick","onSlotchange","options","parent"],"sources":["src/components/c-select/c-select.scss?tag=c-select&encapsulation=shadow","src/components/c-select/c-select.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-select-active-color: Active select color\n * @prop --c-select-inactive-color: Inactive select color\n * @prop --c-select-background-color: Inactive select background color\n * @prop --c-select-text-color: Select text color\n * @prop --c-select-placeholder-color: Select placeholder color\n * @prop --c-select-option-background-color: Select option background color\n * @prop --c-select-option-background-color-hover: Select option hover background color\n * @prop --c-select-option-text-color: Select option text color\n */\n --_c-select-active-color: var(--c-select-active-color, var(--c-primary-600));\n --_c-select-inactive-color: var(--c-select-inactive-color, var(--c-tertiary-600));\n --_c-select-background-color: var(--c-select-background-color, var(--c-transparent));\n --_c-select-text-color: var(--c-select-text-color, var(--c-text-body));\n --_c-select-placeholder-color: var(--c-select-placeholder-color, var(--c-tertiary-500));\n --_c-select-option-background-color: var(--c-select-option-background-color, var(--c-white));\n --_c-select-option-background-color-hover: var(--c-select-option-background-color-hover, var(--c-primary-100));\n --_c-select-option-text-color: var(--c-select-option-text-color, var(--c-text-body));\n\n // private\n --_c-input-active-color: var(--_c-select-active-color);\n --_c-input-inactive-color: var(--_c-select-inactive-color);\n --_c-input-background-color: var(--_c-select-background-color);\n --_c-input-text-color: var(--_c-select-text-color);\n --_c-input-placeholder-color: var(--_c-select-placeholder-color);\n}\n\n@import \"../c-input/c-input-menu\";\n","import {\n AttachInternals,\n Component,\n Element,\n Host,\n Prop,\n State,\n h,\n Listen,\n Event,\n EventEmitter,\n Watch,\n Method,\n} from '@stencil/core';\nimport { mdiChevronDown } from '@mdi/js';\nimport { CSelectItem } from '../../types';\n\n/**\n * @group Form\n * @slot Default slot - Use c-option elements only\n */\n@Component({\n tag: 'c-select',\n styleUrl: 'c-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CSelect {\n @Element() el: HTMLCSelectElement;\n\n // eslint-disable-next-line\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Auto focus the input\n */\n @Prop() autofocus = false;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Set as required\n */\n @Prop() required = false;\n\n /**\n * Return only the item value rather than the whole item object\n */\n @Prop() returnValue: false;\n\n /**\n * Set the validity of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\n\n /**\n * Selected item\n */\n @Prop({ mutable: true }) value: string | number | boolean | CSelectItem =\n null;\n\n /**\n * selectable items\n */\n @Prop() items: CSelectItem[] = [];\n\n /**\n * display the option as selection (works only when c-option elements are used)\n */\n @Prop() optionAsSelection: false;\n\n /**\n * Triggered when an item is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @State() menuVisible = false;\n\n @State() currentIndex: number = null;\n\n @State() activeListItemId: string = null;\n\n @State() statusText = '';\n\n @State() hasOptionItems = false;\n\n @State() previousValue: CSelectItem = { value: '', name: '' };\n\n private _itemRefs: { value: string | number | boolean; ref: HTMLElement }[] =\n [];\n\n private _id: string;\n\n private _cOptionElements: Record<string, HTMLCOptionElement> = {};\n\n private _selectionElement: HTMLDivElement;\n\n private _outerWrapperClasses = ['outer-wrapper'];\n\n private static _uniqueId = 0;\n\n private _validationClasses = ['validation-message'];\n\n private _debounce = null;\n\n private _observer = new IntersectionObserver(\n (entries, observer) => {\n entries.forEach((entry) => {\n if (!entry.isIntersecting) {\n entry.target.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n });\n observer.unobserve(entry.target);\n } else {\n observer.unobserve(entry.target);\n }\n });\n },\n { threshold: 1 },\n );\n\n @Watch('value')\n onValueChange() {\n if (!this.value) return;\n\n const realValue = !(this.value as CSelectItem)?.value\n ? this._items.find((item) => item.value === this.value)\n : this.value;\n\n this._valueChangedHandler(realValue as CSelectItem);\n }\n\n @Watch('validate')\n validateChange(newValue: boolean) {\n if (newValue) {\n this._runValidate();\n }\n }\n\n @Watch('currentIndex')\n onCurrentIndexChange(index: number) {\n this.activeListItemId = this._itemRefs[index]?.ref?.id ?? null;\n\n this._scrollToElement();\n\n this._updateStatusText();\n }\n\n private get _items() {\n return this.hasOptionItems ? this._optionItems : this.items;\n }\n\n private _setValue(item: CSelectItem) {\n return this.returnValue\n ? item?.value\n : {\n name: item?.name,\n value: item?.value,\n };\n }\n\n private _valueChangedHandler(item: CSelectItem) {\n if (!item) return;\n\n if (this.hasOptionItems && this.optionAsSelection) {\n const selection = this._cOptionElements[item.value.toString()];\n\n if (!selection) return;\n\n const clone = selection.cloneNode(true);\n\n this._selectionElement.classList.add('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(clone);\n }\n\n this.currentIndex = this._items.findIndex(\n (element) => element.value === item?.value,\n );\n\n const value = this._setValue(item);\n\n if (this.previousValue && this.previousValue?.value === item?.value) return;\n\n this.previousValue = item;\n\n this.changeValue.emit(value);\n\n this.internals.setFormValue(item.value as string);\n }\n\n private _getLabel() {\n if (!this.value) return '';\n\n if (\n this.returnValue &&\n ['number', 'string', 'boolean'].includes(typeof this.value)\n ) {\n return this._items?.find((item) => item.value === this.value)?.name;\n }\n\n return this._items?.find(\n (item) => item.value === (this.value as CSelectItem).value,\n )?.name;\n }\n\n private _scrollToElement() {\n if (this._items.length > this.itemsPerPage) {\n const itemRef = this._itemRefs.find(\n (item) => item.value === this._items[this.currentIndex]?.value,\n )?.ref;\n\n if (!!itemRef) {\n this._observer.observe(itemRef);\n }\n }\n }\n\n @Listen('keydown', { capture: true })\n handleKeyDown(ev: KeyboardEvent) {\n if (this.disabled) return;\n\n const letterNumber = /^[0-9a-zA-Z]+$/;\n\n if (ev.key.match(letterNumber) && ev.key.length === 1) {\n if (\n Date.now() - this._lastKeyPressTime > 3000 ||\n this._searchString.length > 2\n ) {\n this._searchString = ev.key;\n } else {\n this._searchString = `${this._searchString}${ev.key}`;\n }\n\n this._lastKeyPressTime = Date.now();\n\n const selectedItem = this._items.find((i) =>\n i.name.toLowerCase().startsWith(this._searchString),\n );\n\n function isItem(element) {\n return element === selectedItem;\n }\n\n if (selectedItem) {\n if (this.menuVisible) {\n this.currentIndex = this._items.findIndex(isItem);\n this._scrollToElement();\n } else {\n this.value = selectedItem;\n }\n }\n }\n\n if (ev.key === 'Tab') {\n this._dropdownElement.close();\n }\n\n if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n\n if (this._dropdownElement.isOpen) return;\n\n this._showMenu();\n\n this._dropdownElement.focusItem(this.currentIndex);\n }\n\n if (ev.key === 'ArrowUp') {\n ev.preventDefault();\n\n if (this._dropdownElement.isOpen) return;\n\n this._showMenu();\n\n this._dropdownElement.focusItem(this.currentIndex);\n }\n\n if (ev.key === ' ') {\n ev.preventDefault();\n\n this._showMenu();\n }\n }\n\n /**\n * Select item by index\n */\n @Method()\n async onItemSelection(index: number) {\n this.currentIndex = index;\n\n this._selectItem();\n }\n\n /**\n * Hide menu\n * @private\n */\n @Method()\n async onHideMenu() {\n this.menuVisible = false;\n }\n\n componentWillLoad() {\n CSelect._uniqueId += 1;\n\n this._id =\n this.hostId?.replace(/[^a-zA-Z0-9-_]/g, '') ??\n CSelect._uniqueId.toString();\n\n this._inputId =\n 'input-' +\n (this.hostId || this.label || this.placeholder)\n .replace(/[^a-zA-Z0-9-_]/g, '')\n .toLowerCase();\n\n this._setInitialValue();\n }\n\n private _setInitialValue() {\n if (!this.value) return;\n\n const value = this.returnValue\n ? this.value\n : (this.value as CSelectItem).value;\n\n this.internals.setFormValue(value as string);\n }\n\n componentDidLoad() {\n this._getOptionItems();\n\n if (\n (this.value || typeof this.value === 'boolean') &&\n !this.currentIndex &&\n this.currentIndex !== 0\n ) {\n this.currentIndex = this._items.findIndex(\n (item) => item.value === this.value,\n );\n }\n }\n\n disconnectedCallback() {\n this._observer.disconnect();\n }\n\n private _inputId: string;\n\n private _lastKeyPressTime = null;\n\n private _searchString = '';\n\n private _blurred = false;\n\n private _optionItems: CSelectItem[] = [];\n\n private _inputElement: HTMLInputElement;\n\n private _dropdownElement: HTMLCDropdownElement;\n\n private _selectItem() {\n const selectedItem = this._items[this.currentIndex];\n\n this.value = selectedItem;\n\n this._scrollToElement();\n }\n\n /**\n * @private\n */\n @Method()\n async setActiveDescendant(id: string) {\n this._inputElement.setAttribute('aria-activedescendant', id);\n }\n\n private _showMenu() {\n if (this.disabled) return;\n\n this.menuVisible = true;\n\n this._dropdownElement.open();\n }\n\n private _getOptionItems() {\n requestAnimationFrame(() => {\n this._cOptionElements = {};\n\n let selection: CSelectItem | null = null;\n\n this._optionItems = (\n this.el ? Array.from(this.el.querySelectorAll('c-option')) : []\n ).map((item, index) => {\n const cSelectItem = {\n value: item.value,\n name: item.name || item.innerText,\n disabled: !!item.disabled,\n } as CSelectItem;\n\n if (item.selected) {\n selection = cSelectItem;\n }\n\n item.slot = `option-${index}`;\n\n this._cOptionElements[item.value.toString()] = item;\n\n return cSelectItem;\n });\n\n this.hasOptionItems = !!this._optionItems.length;\n\n if (selection) {\n this._valueChangedHandler(selection);\n }\n });\n }\n\n private _runValidate() {\n if (\n this.required &&\n !this.value &&\n (this._blurred || !this.validateOnBlur)\n ) {\n this._outerWrapperClasses.push('required');\n this._validationClasses.push('show');\n } else {\n this._outerWrapperClasses = this._outerWrapperClasses.filter(\n (c) => c !== 'required',\n );\n this._validationClasses = this._validationClasses.filter(\n (c) => c !== 'show',\n );\n }\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.menuVisible,\n };\n\n return (\n <svg class={classes} viewBox=\"0 0 24 24\">\n <path d={mdiChevronDown} />\n </svg>\n );\n }\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n aria-controls={this._inputId + '-items'}\n aria-expanded={this.menuVisible.toString()}\n aria-readonly=\"true\"\n aria-haspopup=\"listbox\"\n ref={(el) => (this._inputElement = el)}\n id={this._inputId}\n autocomplete=\"off\"\n class=\"c-input__input\"\n type=\"text\"\n value={this._getLabel() ?? null}\n name={this.name ?? null}\n readonly=\"true\"\n />\n\n <div\n ref={(el) => (this._selectionElement = el)}\n class=\"c-input-menu__selection\"\n />\n </div>\n );\n }\n\n private _handleSlotChange = () => {\n this._getOptionItems();\n };\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n const selection = this.el.shadowRoot.querySelector(\n 'li[aria-selected=\"true\"]',\n ) as HTMLLIElement;\n\n const ending = !!this._items.length\n ? ', to navigate use up and down arrows'\n : '';\n\n const isDisabled = !!selection?.classList?.contains('disabled');\n\n const beginning = isDisabled ? 'Disabled option - ' : '';\n\n const selectionText = !!selection\n ? `${beginning}${selection.dataset.value} - ${selection.ariaPosInSet} of ${selection.ariaSetSize} is highlighted`\n : null;\n\n this.statusText = `${selectionText || ending}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n return (\n <Host title={this._getLabel() ?? null}>\n <div\n id={'announce-' + this._id}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n\n <c-input\n autofocus={this.autofocus}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n items={this._items}\n items-per-page={this.itemsPerPage}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n required={this.required}\n shadow={this.shadow}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.value}\n variant=\"select\"\n onItemClick={() => this._showMenu()}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n {this._renderChevron()}\n\n <slot onSlotchange={this._handleSlotChange}></slot>\n </div>\n\n <c-dropdown\n ref={(el) => (this._dropdownElement = el)}\n slot=\"dropdown\"\n items={this._items}\n options={this._cOptionElements}\n items-per-page={this.itemsPerPage}\n parent={this.el}\n index={this.currentIndex}\n input-id={this._inputId}\n type=\"select\"\n />\n\n <slot name=\"post\" slot=\"post\"></slot>\n </c-input>\n </Host>\n );\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAa,mvH,MC2BNC,EAAO,M,kOAuH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WACE0B,UAAW5J,KAAK4J,UAChBhF,SAAU5E,KAAK4E,SAAQ,eACT5E,KAAK6J,YACnBC,KAAM9J,KAAK8J,KACXnH,GAAI3C,KAAKoG,OAAM,WACLpG,KAAKsG,SACfvD,MAAO/C,KAAK8B,OAAM,iBACF9B,KAAKuE,aACrBgC,MAAOvG,KAAKuG,MACZ7E,KAAM1B,KAAK0B,KACX8E,YAAaxG,KAAKwG,YAClBmB,SAAU3H,KAAK2H,SACfoC,OAAQ/J,KAAK+J,OACbC,MAAOhK,KAAKgK,MACZC,SAAUjK,KAAKiK,SAAQ,mBACLjK,KAAK4H,eACvBsC,WAAYlK,KAAKkK,WACjBzI,MAAOzB,KAAKyB,MACZ0I,QAAQ,SACRC,YAAa,IAAMpK,KAAK4F,aAExBsC,EAAA,QAAMxG,KAAK,MAAMgG,KAAK,QAEtBQ,EAAA,OAAKC,MAAM,oBACRnI,KAAKuI,sBACLvI,KAAKgI,iBAENE,EAAA,QAAMmC,aAAcrK,KAAKuB,qBAG3B2G,EAAA,cACExF,IAAMwE,GAAQlH,KAAKwF,iBAAmB0B,EACtCQ,KAAK,WACL3E,MAAO/C,KAAK8B,OACZwI,QAAStK,KAAKE,iBAAgB,iBACdF,KAAKuE,aACrBgG,OAAQvK,KAAKkH,GACb5E,MAAOtC,KAAK2D,aAAY,WACd3D,KAAKsG,SACfmC,KAAK,WAGPP,EAAA,QAAMxG,KAAK,OAAOgG,KAAK,U,2LAldhB3H,EAAAmG,UAAY,E"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,h as t,H as s}from"./p-9d54e9a4.js";import{d as i}from"./p-dffa1f9f.js";const a="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-message-error-color:var(--c-error-600);--_c-message-hint-color:var(--c-text-system);display:block;line-height:1;padding:0 12px}.c-message--active .c-message-item{opacity:1;transform:translateY(0)}.c-message-item{font-size:12px;min-height:16px;opacity:0;transform:translateY(-4px);transition:all 0.2s cubic-bezier(0.25, 0.8, 0.5, 1)}.c-message-item--hint{color:var(--_c-message-hint-color)}.c-message-item--error{color:var(--_c-message-error-color)}.c-message-item span{align-items:flex-start;color:currentColor;display:flex;gap:4px;min-height:16px}.c-message-item svg{fill:currentColor;height:16px;width:16px;position:relative;top:-2px}.c-message .visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}";const n=class{constructor(s){e(this,s);this._validationIcon=t("svg",{height:"16px",width:"16px",viewBox:"0 0 24 24"},t("path",{d:i}));this.hint="";this.inputId=undefined;this.valid=true;this.validation="Required field";this.messageOptions={show:true,type:"hint",content:""}}onValidChange(e){this._handleValidation(e)}onValidationMessageChange(e){if(this.valid||!e)return;this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{content:t("span",null,t("span",{class:"visuallyhidden"},"Error: "),this._validationIcon," ",e)})}onHintMessageChange(e){if(!this.valid||!e)return;this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{content:t("span",null,t("span",{class:"visuallyhidden"},"Hint: "),e)})}_handleValidation(e,s=200){this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{show:false});setTimeout((()=>{this.messageOptions=Object.assign(Object.assign({},this.messageOptions),{type:e?"hint":"error",show:true,content:e?t("span",{id:`hint-${this.inputId}`},t("span",{class:"visuallyhidden"},"Hint: "),this.hint):t("span",{id:`error-${this.inputId}`},this._validationIcon,t("span",{class:"visuallyhidden"},"Error: "),this.validation)})}),s)}componentDidLoad(){this._handleValidation(this.valid,0)}render(){const e={"c-message":true,"c-message--active":this.messageOptions.show};const i={"c-message-item":true,[`c-message-item--${this.messageOptions.type}`]:true};return t(s,null,t("div",{class:e},t("div",{class:i},this.messageOptions.content)))}static get watchers(){return{valid:["onValidChange"],validation:["onValidationMessageChange"],hint:["onHintMessageChange"]}}};n.style=a;export{n as c_message};
|
|
2
|
+
//# sourceMappingURL=p-32298609.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cMessageCss","CMessage","this","_validationIcon","h","height","width","viewBox","d","mdiCloseCircle","show","type","content","onValidChange","valid","_handleValidation","onValidationMessageChange","message","messageOptions","Object","assign","class","onHintMessageChange","timeout","setTimeout","id","inputId","hint","validation","componentDidLoad","render","classes","messageClasses","Host"],"sources":["src/components/c-message/c-message.scss?tag=c-message&encapsulation=shadow","src/components/c-message/c-message.tsx"],"sourcesContent":[":host {\n --_c-message-error-color: var(--c-error-600);\n --_c-message-hint-color: var(--c-text-system);\n\n display: block;\n line-height: 1;\n padding: 0 12px;\n}\n\n.c-message {\n $this: &;\n\n &--active {\n #{$this} {\n &-item {\n opacity: 1;\n transform: translateY(0);\n }\n }\n }\n\n &-item {\n font-size: 12px;\n min-height: 16px;\n opacity: 0;\n transform: translateY(-4px);\n transition: all 0.2s cubic-bezier(0.25, 0.8, 0.5, 1);\n\n &--hint {\n color: var(--_c-message-hint-color);\n }\n\n &--error {\n color: var(--_c-message-error-color);\n }\n\n span {\n align-items: flex-start;\n color: currentColor;\n display: flex;\n gap: 4px;\n min-height: 16px;\n }\n\n svg {\n fill: currentColor;\n height: 16px;\n width: 16px;\n position: relative;\n top: -2px;\n }\n }\n\n .visuallyhidden {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n }\n}\n","import { mdiCloseCircle } from '@mdi/js';\nimport { Component, Host, Prop, State, Watch, h } from '@stencil/core';\n\n/**\n * @parent None\n */\n@Component({\n tag: 'c-message',\n styleUrl: 'c-message.scss',\n shadow: true,\n})\nexport class CMessage {\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Id of the related input element\n */\n @Prop() inputId: string;\n\n /**\n * Parent validíty\n */\n @Prop() valid = true;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n @State() messageOptions = {\n show: true,\n type: 'hint',\n content: '',\n };\n\n @Watch('valid')\n onValidChange(valid: boolean) {\n // if (this.validateOnBlur && !this._hasBlurred) return;\n\n this._handleValidation(valid);\n }\n\n @Watch('validation')\n onValidationMessageChange(message: string) {\n if (this.valid || !message) return;\n\n this.messageOptions = {\n ...this.messageOptions,\n content: (\n <span>\n <span class=\"visuallyhidden\">Error: </span>\n {this._validationIcon} {message}\n </span>\n ),\n };\n }\n\n @Watch('hint')\n onHintMessageChange(message: string) {\n if (!this.valid || !message) return;\n\n this.messageOptions = {\n ...this.messageOptions,\n content: (\n <span>\n <span class=\"visuallyhidden\">Hint: </span>\n {message}\n </span>\n ),\n };\n }\n\n private _handleValidation(valid: boolean, timeout = 200) {\n this.messageOptions = {\n ...this.messageOptions,\n show: false,\n };\n\n setTimeout(() => {\n this.messageOptions = {\n ...this.messageOptions,\n type: valid ? 'hint' : 'error',\n show: true,\n content: valid ? (\n <span id={`hint-${this.inputId}`}>\n <span class=\"visuallyhidden\">Hint: </span>\n {this.hint}\n </span>\n ) : (\n <span id={`error-${this.inputId}`}>\n {this._validationIcon}\n <span class=\"visuallyhidden\">Error: </span>\n {this.validation}\n </span>\n ),\n };\n }, timeout);\n }\n\n private _validationIcon = (\n <svg height=\"16px\" width=\"16px\" viewBox=\"0 0 24 24\">\n <path d={mdiCloseCircle} />\n </svg>\n );\n\n componentDidLoad() {\n this._handleValidation(this.valid, 0);\n }\n\n render() {\n const classes = {\n 'c-message': true,\n 'c-message--active': this.messageOptions.show,\n };\n\n const messageClasses = {\n 'c-message-item': true,\n [`c-message-item--${this.messageOptions.type}`]: true,\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class={messageClasses}>{this.messageOptions.content}</div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"sFAAA,MAAMA,EAAc,28B,MCWPC,EAAQ,M,yBA2FXC,KAAAC,gBACNC,EAAA,OAAKC,OAAO,OAAOC,MAAM,OAAOC,QAA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AkB,KAClB,CAAC,mBAAmB9B,KAAKgB,eAAeP,QAAS,MAGnD,OACEP,EAAC6B,EAAI,KACH7B,EAAA,OAAKiB,MAAOU,GACV3B,EAAA,OAAKiB,MAAOW,GAAiB9B,KAAKgB,eAAeN,U"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as i,H as e,g as s,c as n}from"./p-9d54e9a4.js";import{c as o}from"./p-dffa1f9f.js";const r="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host(c-dropdown){--_c-dropdown-background-color:var(--c-dropdown-background-color, var(--c-white));--_c-dropdown-background-color-hover:var(--c-dropdown-background-color-hover, var(--c-primary-200));--_c-dropdown-text-color:var(--c-dropdown-text-color, var(--c-text-body));--_c-dropdown-text-color-active:var(--c-dropdown-text-color-active, var(--c-primary-600));--_c-dropdown-font-size:14px;--_c-dropdown-height:42px;display:block;position:absolute}:host(c-dropdown) mark{background-color:transparent;box-shadow:0 2px 0 0 var(--_c-dropdown-text-color-active);color:inherit}:host(c-dropdown) dialog{background-color:transparent;border-radius:4px;border:none;box-shadow:2px 4px 10px rgba(0, 0, 0, 0.1607843137);margin:0;overflow-y:scroll;padding:0;position:fixed}:host(c-dropdown) dialog::backdrop{display:none}:host(c-dropdown) ul{background-color:var(--_c-dropdown-background-color);border-radius:4px;list-style:none;margin:0;outline:none;padding:0;pointer-events:auto;visibility:hidden;width:100%}: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) 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.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(i){t(this,i);this._id="";this._debounce=null;this._itemRefs=[];this._lastKeyPressTime=null;this._openedOnTop=false;this._searchString="";this._observer=new IntersectionObserver(((t,i)=>{t.forEach((t=>{if(!t.isIntersecting){t.target.scrollIntoView({block:"nearest",inline:"nearest"});i.unobserve(t.target)}else{i.unobserve(t.target)}}))}),{threshold:1});this._renderMenuItem=(t,i)=>{var e;const s=((e=this.items[this.currentIndex])===null||e===void 0?void 0:e.value)===t.value;let n="none";if(typeof(t===null||t===void 0?void 0:t.value)==="string"){n=t.value.replace(/[^a-zA-Z0-9-_]/g,"")}n=`item_${this.inputId}--${n}`;if(s){this.currentIndex=i;this.parent.setActiveDescendant(n)}const o=document.createElement("li");o.role="option";o.ariaPosInSet=(i+1).toString();o.ariaSetSize=this.items.length.toString();o.ariaSelected=s.toString();o.id=n;o.dataset.value=t.name;o.setAttribute("tabindex","-1");o.classList.toggle("disabled",!!t.disabled);o.addEventListener("click",(t=>{const e=this._itemRefs[i].classList.contains("disabled");if(e){t.preventDefault();return}this.currentIndex=i;this._onSelect(i)}));o.addEventListener("focus",(()=>{o.classList.add("active")}));o.addEventListener("blur",(()=>{o.classList.remove("active")}));this._itemRefs.push(o);if(Object.keys(this.options).length){requestAnimationFrame((()=>{var i;const e=this.options[t.value];if(!e)return;if(((i=this.parent.query)===null||i===void 0?void 0:i.length)&&this.type==="autocomplete"){const t=e.querySelector("c-option-value");if(t){t.innerHTML=this._highlightMatchingText(t.textContent)}}o.appendChild(e);this._listElement.appendChild(o)}));return}const r=document.createElement("span");r.innerHTML=this._highlightMatchingText(t.name);o.appendChild(r);this._listElement.appendChild(o)};this.items=[];this.options=undefined;this.itemsPerPage=undefined;this.parent=undefined;this.index=undefined;this.isOpen=false;this.focusList=undefined;this.inputId=undefined;this.type=undefined;this.wasClicked=false;this.currentIndex=null;this.isVisible=false;this.topPosition=undefined;this.statusText=""}onItemsChange(){if(!this.items.length)return;this._updateMenuItems()}onOptionsChange(){if(!Object.keys(this.options).length)return;this._updateMenuItems()}async updateDropdown(t){this.items=[];this._itemRefs=[];this.options={};requestAnimationFrame((()=>{this.currentIndex=null;this.items=t.items||this.items;this.options=t.options||this.options;this._updateMenuItems();this._updateStatusText()}))}async focusDropdown(){requestAnimationFrame((()=>{this._listElement.focus()}))}async open(t=false){this._onOpen();this._createEventListeners();this._outsideClickFn=this._handleOutsideClick.bind(this);requestAnimationFrame((()=>{if(t){this._listElement.focus();if(this.type==="autocomplete"){this.currentIndex=0}this._handleCurrentIndexChange()}this._positionMenu();window.addEventListener("click",this._outsideClickFn)}))}async close(){this._openedOnTop=false;this._onClose();window.removeEventListener("click",this._outsideClickFn)}async focusItem(t){requestAnimationFrame((()=>{this.currentIndex=t;this._itemRefs[this.currentIndex].focus()}))}onCurrentIndexChange(){this._handleCurrentIndexChange()}get _listSize(){return this.items.length||0}get _firstSelectableIndex(){return this.items.findIndex((t=>!t.disabled))}get _lastSelectableIndex(){return this.items.findLastIndex((t=>!t.disabled))}_highlightMatchingText(t){if(this.type==="select"||this.parent.query==="")return t;const i=new RegExp(this.parent.query,"gi");const e=t.replace(/(<([^>]+)>)/gi,"").replace(i,(t=>`<mark>${t}</mark>`));return e}_renderEmptyItem(){const t=document.createElement("li");t.tabIndex=-1;const i=document.createElement("c-icon");i.path=o;i.size=18;i.color="var(--c-warning-600)";t.appendChild(i);t.append("No suggestions found");this._listElement.replaceChildren(t)}_updateMenuItems(){if(!this.items.length){this._renderEmptyItem();return}this._listElement.replaceChildren();this._itemRefs.length=0;this.items.map(((t,i)=>this._renderMenuItem(t,i)));requestAnimationFrame((()=>{this._positionMenu()}))}_renderMenu(){this._id=`${this.inputId}--items`;const t=document.createElement("dialog");const i=document.createElement("ul");i.role=`listbox`;i.ariaExpanded=this.isVisible.toString();i.tabIndex=-1;i.id=this._id;this._dialogElement=t;this._listElement=i;this._dialogElement.appendChild(i);this.host.shadowRoot.appendChild(t);this.items.map(((t,i)=>this._renderMenuItem(t,i)));this._listElement.addEventListener("keydown",this._onKeyboardNavigation.bind(this));this._listElement.addEventListener("keyup",this._onKeyDown.bind(this))}_onOpen(){this.parent.shadowRoot.querySelector(".c-input").classList.add("active");this._listElement.classList.add("active");this.isOpen=true;this._listElement.ariaExpanded="true";this._listElement.tabIndex=0;this._dialogElement.showModal()}_onClose(t=false){this.parent.onHideMenu();this.parent.shadowRoot.querySelector(".c-input").classList.remove("active");this._listElement.classList.remove("active");this._listElement.ariaExpanded="false";this._listElement.tabIndex=-1;this.isOpen=false;this.currentIndex=this.index;this._dialogElement.close();if(t){this.parent.shadowRoot.querySelector("input").focus()}}_onSelect(t,i=false){if(t===null)return;const e=this._itemRefs[t].classList.contains("disabled");if(e)return;this.parent.onItemSelection(t);this.index=t;this._onClose(i);this._itemRefs.forEach(((i,e)=>{i.ariaSelected=(e===t).toString()}))}_getParentPosition(){return this.parent.shadowRoot.querySelector(".c-input__slot").getBoundingClientRect()}_positionMenu(){const{innerWidth:t,innerHeight:i}=window;const{bottom:e,left:s,width:n,top:o}=this._getParentPosition();this._dialogElement.style.width=`${n}px`;this._dialogElement.style.top=`${e}px`;this._dialogElement.style.bottom="auto";this._dialogElement.style.left=`${s}px`;this._dialogElement.style.removeProperty("transform");const{bottom:r,right:a,height:h,width:l}=this._dialogElement.getBoundingClientRect();const c={x:a<t,y:r<i};const d=o-h>0;if(!d&&!c.y){this._dialogElement.style.maxHeight=`${o}px`}if(!c.y||this._openedOnTop){this._openedOnTop=true;this._dialogElement.style.top="auto";this._dialogElement.style.bottom=`${i-o}px`}this.topPosition=e;if(!c.x){this._dialogElement.style.left=`${parseFloat(this._dialogElement.style.left)-l+n}px`}}_createEventListeners(){requestAnimationFrame((async()=>{this._listElement.classList.add("active")}))}_scrollToElement(){if(this.items.length>this.itemsPerPage){const t=this._itemRefs[this.currentIndex];if(!!t){this._observer.observe(t)}}}_onKeyDown(t){t.preventDefault();t.stopPropagation()}_onKeyboardNavigation(t){this.wasClicked=false;const i=/^[0-9a-zA-Z]+$/;if(t.key.match(i)&&t.key.length===1||t.key==="Backspace"){if(this.type==="autocomplete"){const{query:i}=this.parent;let e="";if(t.key==="Backspace"){e=i.slice(0,-1)}else{e=`${i}${t.key}`}this.parent.updateQuery(e);return}if(Date.now()-this._lastKeyPressTime>3e3||this._searchString.length>2){this._searchString=t.key}else{this._searchString=`${this._searchString}${t.key}`}this._lastKeyPressTime=Date.now();const i=this.items.find((t=>t.name.toLowerCase().startsWith(this._searchString)));if(i){this.currentIndex=this.items.findIndex((t=>t===i));if(this.isOpen){this._scrollToElement()}else{this._onSelect(this.currentIndex,true)}}}if(t.key==="Enter"){this._onSelect(this.currentIndex,true)}if(t.key===" "&&!this.isOpen){t.preventDefault();this.isOpen=true}if("Tab"===t.key){this._onClose()}if(t.key==="Escape"){this._onClose(true)}if(t.key==="ArrowDown"){t.preventDefault();t.stopPropagation();if(this.currentIndex===null){this.currentIndex=0}else if(this.isOpen&&this.currentIndex+1<this._listSize){this.currentIndex+=1}this.isOpen=true}if(t.key==="ArrowUp"){t.preventDefault();t.stopPropagation();if(this.isOpen&&this.currentIndex===0){this.currentIndex=null;this._onClose(true);return}else if(this.isOpen&&this.currentIndex>0){this.currentIndex-=1}else if(this.currentIndex===null){this.currentIndex=this._listSize-1}this.isOpen=true}if(t.key==="Home"&&this.isOpen){t.preventDefault();this.currentIndex=this._firstSelectableIndex}if(t.key==="End"&&this.isOpen){t.preventDefault();this.currentIndex=this._lastSelectableIndex}}_handleCurrentIndexChange(){var t;if(this.currentIndex===null){(t=this.parent)===null||t===void 0?void 0:t.setActiveDescendant("");return}this._updateStatusText();requestAnimationFrame((()=>{var t,i;const e=this._itemRefs[this.currentIndex];if(!e)return;e===null||e===void 0?void 0:e.focus();(t=this.parent)===null||t===void 0?void 0:t.setActiveDescendant((i=e.id)!==null&&i!==void 0?i:null)}))}_handleOutsideClick(t){if(!t.composedPath().includes(this._dialogElement)){this.close()}}_updateStatusText(){if(this._debounce!==null){clearTimeout(this._debounce);this._debounce=null}this._debounce=window.setTimeout((()=>{var t;const i=this._itemRefs[this.currentIndex];const e=!!this.items.length?", to navigate use up and down arrows":"";const s=!!((t=i===null||i===void 0?void 0:i.classList)===null||t===void 0?void 0:t.contains("disabled"));const n=s?"Disabled option - ":"";let o=!!i?`${n}${i.dataset.value} - ${i.ariaPosInSet} of ${i.ariaSetSize} is highlighted`:null;if(this.currentIndex===null&&this.type==="autocomplete"){o=this.items.length?`${this.items.length} result${this.items.length!==1?"s":""} available`:"No search results available"}this.statusText=`${o||e}`;this._debounce=null}),1400)}componentDidLoad(){this._renderMenu();this.currentIndex=this.index;this._resizeObserver=new ResizeObserver((()=>{if(!this.isOpen)return;this._positionMenu()}));this._resizeObserver.observe(window.document.body)}disconnectedCallback(){this._resizeObserver.disconnect()}render(){if(this._dialogElement&&this.itemsPerPage&&this.itemsPerPage>0&&this.items.length>this.itemsPerPage){this._dialogElement.style.maxHeight=42*(this.itemsPerPage+.5)+"px"}return i(e,null,i("div",{id:"announce-"+this._id,class:"visuallyhidden","aria-live":"polite","aria-atomic":"true"},this.statusText))}get host(){return s(this)}static get watchers(){return{items:["onItemsChange"],options:["onOptionsChange"],currentIndex:["onCurrentIndexChange"]}}};a.style=r;const h="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:root,:host{--_c-input-inactive-color:var(--c-tertiary-600);--_c-input-active-color:var(--c-primary-600);--_c-input-background-color:var(--c-transparent);--_c-input-text-color:var(--c-text-body);--_c-input-placeholder-color:var(--c-tertiary-500);--_c-input-shadow-active-color:var(--_c-input-active-color);--_c-input-shadow-background-color:var(--c-white);--_c-input-shadow-text-color:var(--_c-input-text-color);--_c-input-shadow-placeholder-color:var(--_c-input-placeholder-color);--_c-input-error-color:var(--c-error-600)}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.c-input{--_c-input-border-width:1px;align-items:flex-start;border-radius:4px;display:flex;flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;letter-spacing:normal;max-width:100%;text-align:left}.c-input input,.c-input select,.c-input textarea{background:none;border:0;display:inline-block;font-family:var(--c-font-family);font-size:16px;line-height:1;margin:0;padding:0;vertical-align:middle;white-space:normal}.c-input input,.c-input textarea{box-sizing:content-box;background-color:transparent;border:none;color:var(--_c-input-text-color);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%}.c-input input[type=checkbox],.c-input input[type=radio],.c-input select{box-sizing:border-box}.c-input input[type=search]{appearance:textfield;box-sizing:content-box}.c-input ::-webkit-search-decoration{display:none}.c-input textarea{margin-top:4px;min-height:44px;overflow:auto;padding:8px 12px 8px 0;resize:vertical;vertical-align:top}.c-input input{max-height:32px;padding:8px 0}.c-input input:focus,.c-input input:active,.c-input textarea:focus,.c-input textarea:active{outline:none}.c-input .c-input__content{align-items:center;display:flex;width:100%}.c-input__control{border-radius:inherit;color:currentColor;display:flex;flex-flow:column wrap;flex-grow:1;gap:8px;height:auto;min-width:0;width:100%;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);white-space:nowrap}.c-input__field label.active{transform:translateY(-18px) scale(0.75)}.c-input__field label span{color:var(--_c-input-error-color)}.c-input--select input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-input--select .c-input__slot{cursor:pointer}.c-input fieldset{background-color:var(--_c-input-background-color);border-collapse:collapse;border-color:var(--_c-input-inactive-color);border-radius:inherit;border-style:solid;border-width:var(--_c-input-border-width);inset:0;margin:0;padding:0 0 0 8px;pointer-events:none;position:absolute;transition-duration:0.15s;transition-property:color;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1)}.c-input fieldset legend{float:none;line-height:11px;margin-left:-1px;padding:0;text-align:left;transition:width 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);width:0}.c-input fieldset legend.active{width:var(--_c-input-legend-width)}.c-input--shadow .c-input__slot{background-color:var(--_c-input-shadow-background-color);box-shadow:rgba(0, 0, 0, 0.15) 0 5px 15px 0}.c-input--shadow .c-input__slot input,.c-input--shadow .c-input__slot textarea{color:var(--_c-input-shadow-text-color)}.c-input--shadow .c-input__slot:focus-within{outline:2px var(--_c-input-active-color) solid}.c-input--shadow .c-input__slot:focus-within c-icon{--c-icon-color:var(--_c-input-shadow-active-color) !important}.c-input--shadow input::placeholder,.c-input--shadow textarea::placeholder{color:var(--_c-input-shadow-placeholder-color);opacity:1}.c-input--disabled input,.c-input--disabled textarea,.c-input--disabled fieldset,.c-input--disabled label{--_c-input-error-color:var(--c-tertiary-500);color:var(--c-tertiary-500)}.c-input--textarea .c-input__field{margin-right:-12px}.c-input ::placeholder{color:var(--_c-input-placeholder-color);opacity:1}.c-input:focus-within,.c-input.active,.c-input:not(.c-input--disabled):active{--_c-input-border-width:2px;color:var(--_c-input-active-color)}.c-input:focus-within fieldset,.c-input.active fieldset,.c-input:not(.c-input--disabled):active fieldset{border-color:var(--_c-input-active-color)}.c-input:focus-within label,.c-input.active label,.c-input:not(.c-input--disabled):active label{color:var(--_c-input-active-color);transform:translateX(0) translateY(-18px) scale(0.75)}.c-input:focus-within legend,.c-input.active legend,.c-input:not(.c-input--disabled):active legend{width:var(--_c-input-legend-width)}.c-input.active:not(.filled) .c-input-menu__input{position:relative}.c-input.active:not(.filled) .c-input-menu__input::after{display:flex;align-items:center;position:absolute;inset:0;content:attr(data-placeholder);pointer-events:none;color:var(--_c-input-placeholder-color)}.c-input--error{color:var(--_c-input-error-color)}.c-input--error fieldset{border-color:var(--_c-input-error-color) !important}.c-input--error label{color:var(--_c-input-error-color) !important}.c-input--error:focus-within{color:var(--_c-input-error-color)}";const l=class{constructor(i){t(this,i);this.changeValue=n(this,"changeValue",3);this.itemClick=n(this,"itemClick",3);this.dropdownClose=n(this,"dropdownClose",3);this._hasBlurred=false;this._debounce=null;this._observer=new IntersectionObserver(((t,i)=>{t.forEach((t=>{if(t.isIntersecting){this._calculateElementWidths();i.unobserve(t.target)}}))}),{threshold:1});this._onBlur=()=>{setTimeout((()=>{this.isFocused=false;this._hasBlurred=true;this._onReset()}),100)};this._onFocus=(t=true)=>{var i,e;if(this.disabled)return;this.isFocused=true;(i=this.inputField)===null||i===void 0?void 0:i.focus();if(t){(e=this.inputField)===null||e===void 0?void 0:e.click();if(this.variant==="select"){this.itemClick.emit()}}if(this.inputField){this.inputField.placeholder=!!this.value||!this.placeholder?"":this.placeholder}};this.autofocus=false;this.disabled=false;this.form=false;this.hideDetails=false;this.hint="";this.hostId=undefined;this.inputId=undefined;this.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()}componentDidLoad(){var t,i,e,s;if(this.autofocus){setTimeout((()=>{this._onFocus(false)}),500)}this._calculateElementWidths();this._setAriaDescriptionId();if(this.label){this._observer.observe(this._labelRef)}(t=this.inputField)===null||t===void 0?void 0:t.addEventListener("focus",(()=>this._onFocus(false)));(i=this.inputField)===null||i===void 0?void 0:i.addEventListener("blur",(()=>this._onBlur()));(e=this.inputField)===null||e===void 0?void 0:e.addEventListener("keypress",this._preventNonNumericalInput);if(this.inputField){this.inputField.placeholder=!!this.label||!this.placeholder?"":this.placeholder;this.inputField.title=(s=this.label)!==null&&s!==void 0?s:this.placeholder;requestAnimationFrame((()=>{const t=this.inputField.closest(".c-input-menu__input");if(!t)return;t.dataset.placeholder=this.placeholder}))}}disconnectedCallback(){var t,i,e,s;(t=this.inputField)===null||t===void 0?void 0:t.removeEventListener("focus",(()=>this._onFocus(false)));(i=this.inputField)===null||i===void 0?void 0:i.removeEventListener("blur",(()=>this._onBlur()));(e=this.inputField)===null||e===void 0?void 0:e.removeEventListener("keypress",this._preventNonNumericalInput);this._observer.disconnect();(s=this._dropdownElement)===null||s===void 0?void 0:s.remove()}get isActive(){return!!this.value||typeof this.value==="boolean"||this.isFocused}_setAriaDescriptionId(){this.inputField.removeAttribute("aria-describedby");let t=null;if(this.valid&&!this.value&&this.hint){t="hint"}if(!this.valid){t="error"}if(t){this.inputField.setAttribute("aria-describedby",`${t}-${this.inputId}`)}}_calculateElementWidths(){this.labelWidth=!!this.label?this._labelRef.scrollWidth*.75+6:0;this.preSlotWidth=this.inputField.offsetLeft}_onReset(){if(this.inputField){this.inputField.placeholder=!this.label&&!this.value&&!!this.placeholder?this.placeholder:""}}_preventNonNumericalInput(t){if(this.type!=="number")return;if(!t.key.match(/^[0-9,\.]+$/))t.preventDefault()}_renderBorders(){if(this.shadow)return;const t={active:this.isActive};return i("fieldset",{"aria-hidden":"true"},i("legend",{class:t,style:{"--_c-input-legend-width":this.labelWidth+"px"}},i("span",{class:"notranslate"})))}_renderLabel(){if(!this.label)return;const t={active:this.isActive};return i("label",{htmlFor:this.inputId,ref:t=>this._labelRef=t,class:t},this.label,this.required&&i("span",null," *"))}get inputField(){var t;return(t=this.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,filled:!!this.value,[`c-input--${this.variant}`]:true};return i(e,{disabled:this.disabled},i("div",{id:"announce-"+this.inputId,class:"visuallyhidden","aria-live":"polite","aria-atomic":"true"},this.statusText),i("div",{class:t},i("div",{class:"c-input__control"},i("div",{class:"c-input__slot",onClick:()=>this._onFocus()},this._renderBorders(),i("div",{class:"c-input__field",style:{"--_c-input-label-position":this.preSlotWidth+"px"}},i("slot",{name:"pre"}),this._renderLabel(),i("slot",null))),this.variant==="select"&&i("slot",{name:"dropdown"}),!this.hideDetails&&i("c-message",{hint:this.hint,inputId:this.inputId,valid:this.valid,validation:this.validation}))))}get el(){return s(this)}static get watchers(){return{valid:["onValidChange"],validation:["onValidationMessageChange"],value:["onValueChange"],placeholder:["onPlaceholderChange"]}}};l.style=h;export{a as c_dropdown,l as c_input};
|
|
2
|
+
//# sourceMappingURL=p-50db6941.entry.js.map
|