@gov-design-system-ce/components 4.0.8-rc09 → 4.0.8-rc10
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/gov-form-multi-select.cjs.entry.js +1 -5
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +1 -5
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-chip.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/{p-04691758.js → p-156b4f92.js} +2 -2
- package/dist/components/{p-e20bdd6e.js → p-2bdd00a0.js} +2 -2
- package/dist/components/{p-b8bb638e.js → p-4e1215f7.js} +2 -2
- package/dist/components/{p-1653073c.js → p-692b78d9.js} +2 -2
- package/dist/components/{p-0fa5ab52.js → p-768b9ba0.js} +2 -2
- package/dist/components/{p-16ce28bd.js → p-c3fdf866.js} +2 -2
- package/dist/components/{p-4f23b264.js → p-f45783e0.js} +2 -2
- package/dist/core/core.esm.js +1 -1
- package/dist/core/{p-973da3e6.entry.js → p-42072b8f.entry.js} +2 -2
- package/dist/core/p-42072b8f.entry.js.map +1 -0
- package/dist/core/{p-4d7ff31f.entry.js → p-be2f3b8f.entry.js} +2 -2
- package/dist/esm/gov-form-multi-select.entry.js +1 -5
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/hydrate/index.js +1 -5
- package/package.json +1 -1
- package/dist/core/p-973da3e6.entry.js.map +0 -1
- package/dist/globals.d.ts +0 -2
- package/dist/types/types/typings.d.ts +0 -6
- /package/dist/components/{p-04691758.js.map → p-156b4f92.js.map} +0 -0
- /package/dist/components/{p-e20bdd6e.js.map → p-2bdd00a0.js.map} +0 -0
- /package/dist/components/{p-b8bb638e.js.map → p-4e1215f7.js.map} +0 -0
- /package/dist/components/{p-1653073c.js.map → p-692b78d9.js.map} +0 -0
- /package/dist/components/{p-0fa5ab52.js.map → p-768b9ba0.js.map} +0 -0
- /package/dist/components/{p-16ce28bd.js.map → p-c3fdf866.js.map} +0 -0
- /package/dist/components/{p-4f23b264.js.map → p-f45783e0.js.map} +0 -0
- /package/dist/core/{p-4d7ff31f.entry.js.map → p-be2f3b8f.entry.js.map} +0 -0
|
@@ -194,11 +194,7 @@ const GovFormMultiSelect = class {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
render() {
|
|
197
|
-
return (index.h(index.Host, { class: form.FormMultiSelectClass.root, size: this.size, variant: this.variant }, index.h("div", { class: form.FormMultiSelectClass.wrap }, this.h.hasSlot('prefix') && index.h("slot", { name: "prefix" }), index.h("div", { class: "element" }, index.h("gov-form-autocomplete", { value: this.valueState, disabled: this.disabled, identifier: this.identifier || this.selectId, required: false, size: this.size, variant: this.variant, placeholder: this.placeholder, "message-empty": this.messageEmpty, "message-loading": this.messageLoading, ref: el => (this.autocompleteRef = el), minlength: 0, "name-key": 'label', wcagDescribedBy: this.wcagDescribedBy, wcagLabelledBy: this.wcagLabelledBy, wcagOwns: this.listId }), index.h("gov-icon", { slot: "right-icon", class: "icon-arrow", name: "chevron-down" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && index.h("slot", { name: "right-icon" }), this.success && index.h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && index.h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), index.h("select", { hidden: true, class: 'hidden-select-list', "aria-hidden": template.toBoolAttr(true), multiple: true, required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": template.toBoolAttrIfDefined(this.disabled), "aria-required": template.toBoolAttrIfDefined(this.required), "aria-invalid": template.toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, index.h("slot", null), Array.isArray(this.
|
|
198
|
-
var _a;
|
|
199
|
-
const selectedOption = this.selectedValueIndex(option.value);
|
|
200
|
-
return (index.h("option", { value: option.value, selected: selectedOption > -1, disabled: option === null || option === void 0 ? void 0 : option.disabled }, (_a = option.label) !== null && _a !== void 0 ? _a : option.value));
|
|
201
|
-
}))), this.h.hasSlot('sufix') && index.h("slot", { name: "sufix" })), this.hideSelectedList === false ? (index.h("ul", { role: "listbox", id: this.listId, class: form.FormMultiSelectClass.list }, Array.isArray(this.selectedOptionsState) && this.selectedOptionsState.map(selected => {
|
|
197
|
+
return (index.h(index.Host, { class: form.FormMultiSelectClass.root, size: this.size, variant: this.variant }, index.h("div", { class: form.FormMultiSelectClass.wrap }, this.h.hasSlot('prefix') && index.h("slot", { name: "prefix" }), index.h("div", { class: "element" }, index.h("gov-form-autocomplete", { value: this.valueState, disabled: this.disabled, identifier: this.identifier || this.selectId, required: false, size: this.size, variant: this.variant, placeholder: this.placeholder, "message-empty": this.messageEmpty, "message-loading": this.messageLoading, ref: el => (this.autocompleteRef = el), minlength: 0, "name-key": 'label', wcagDescribedBy: this.wcagDescribedBy, wcagLabelledBy: this.wcagLabelledBy, wcagOwns: this.listId }), index.h("gov-icon", { slot: "right-icon", class: "icon-arrow", name: "chevron-down" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && index.h("slot", { name: "right-icon" }), this.success && index.h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && index.h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), index.h("select", { hidden: true, class: 'hidden-select-list', "aria-hidden": template.toBoolAttr(true), multiple: true, required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": template.toBoolAttrIfDefined(this.disabled), "aria-required": template.toBoolAttrIfDefined(this.required), "aria-invalid": template.toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, index.h("slot", null))), this.h.hasSlot('sufix') && index.h("slot", { name: "sufix" })), this.hideSelectedList === false ? (index.h("ul", { role: "listbox", id: this.listId, class: form.FormMultiSelectClass.list }, Array.isArray(this.selectedOptionsState) && this.selectedOptionsState.map(selected => {
|
|
202
198
|
var _a, _b;
|
|
203
199
|
const option = this.getOption(selected);
|
|
204
200
|
if (!option)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-multi-select.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,qBAAqB,GAAG,6jqBAA6jqB;;MC+B9kqB,kBAAkB;EAU9B;;;;;;;;;;;;gBAgCmD,GAAG;;4BAQwB,KAAK;oBAK9C,KAAK;oBAKL,KAAK;;;wBAY0B,gCAAgC;0BAI5B,YAAY;;;;;;gCAoClB,EAAE;wBAClB,EAAE;IAtGnD,IAAI,CAAC,QAAQ,GAAGA,qBAAQ,CAAC,WAAW,CAAC,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AAEX,yBAAoB,CAAC,IAAI,CAAC,CAAA;IACnFW,oBAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAEX,yBAAoB,CAAC,IAAI,CAAC,CAAA;IACtEY,yBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAEZ,yBAAoB,CAAC,IAAI,CAAC,CAAA;GACtG;;;;;;;;;;;;;;;;","names":["createID","govHost","govForm","validateProp","FormMultiselectVariants","FormMultiSelectClass","FormMultiselectSizes","propsValueToArray","toBoolAttr","removeDiacritics","tick","canValidateWcagOnRender","delay","h","Host","toBoolAttrIfDefined","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.scss?tag=gov-form-multi-select","../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.tsx"],"sourcesContent":["/*\n * Multiselect\n */\n\n@import \"../select/gov-form-select-core.scss\";\n$class: \".gov-form-multi-select\";\n\n#{$class} {\n\t@extend %form-select-core;\n\tflex-wrap: wrap;\n\t&__wrap {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: rem-calc(8);\n\t\twidth: 100%;\n\t}\n\t&__list {\n\t\t@extend %reset-ul;\n\t\t@include typography($font-size-xs);\n\t\tdisplay: flex;\n\t\tgap: rem-calc(8);\n\t\tflex-wrap: wrap;\n\t}\n\t&__list > &__item {\n\t\t@extend %reset-ul-li;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tflex: 0 0 auto;\n\t\talign-items: center;\n\t\tpadding: rem-calc(0 0 0 8);\n\t\tbackground: $form-multiselect-bg;\n\t\ttransition: $t linear background-color;\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../../helpers/Dom/win'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {validateWcagLabelFor, validateWcagRef} from '../../../helpers/Validate/wcag'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID, removeDiacritics} from '../../../utils/string.utils'\nimport {delay} from '../../../utils/utils'\nimport {FormAutocompleteEvent} from '../autocomplete/gov-form-autocomplete.types'\nimport {\n\tFormMultiSelectClass,\n\tFormMultiselectSizes,\n\tFormMultiselectSizesType,\n\tFormMultiselectVariants,\n\tFormMultiselectVariantType\n} from './constants'\nimport {\n\tFormMultiselectEvent,\n\tGovFormMultiSelectItem,\n\tGovFormMultiSelectSelectedItem\n} from './gov-form-multi-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {tick} from \"../../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-form-multi-select',\n\tstyleUrl: 'gov-form-multi-select.scss',\n})\nexport class GovFormMultiSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate selectRef?: HTMLSelectElement\n\tprivate autocompleteRef?: HTMLGovFormAutocompleteElement\n\n\tprivate readonly selectId: string\n\tprivate readonly listId: string\n\n\tconstructor() {\n\t\tthis.selectId = createID('GovSelect')\n\t\tthis.listId = createID('GovMultiList')\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of multi-select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string | GovFormMultiSelectSelectedItem[]\n\t/**\n\t * Options of multi-select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormMultiSelectItem[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Custom select placeholder.\n\t */\n\t@Prop({attribute: 'placeholder'}) readonly placeholder: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormMultiselectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormMultiselectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Option to hide the list of selected items\n\t */\n\t@Prop({attribute: 'hide-selected-list'}) readonly hideSelectedList: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Custom message for when data is loaded\n\t */\n\t@Prop({attribute: 'message-loading'}) readonly messageLoading: string = 'Načítám...'\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-owns'}) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is selected\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is removed\n\t */\n\t@Event({eventName: 'gov-remove'}) govRemove: EventEmitter<FormMultiselectEvent>\n\n\t@State() focused: boolean\n\t@State() valueState: string\n\t@State() selectedOptionsState: GovFormMultiSelectSelectedItem[] = []\n\t@State() optionsState: GovFormMultiSelectItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormMultiselectVariants, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormMultiSelectItem[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('value')\n\twatchValue(newValue: string | GovFormMultiSelectItem[]): void {\n\t\tthis.selectedOptionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.watchDisabled()\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t\tthis.selectedOptionsState = propsValueToArray(this.value)\n\t}\n\n\tprivate getAvailableOptions(ignoreFilter = false): GovFormMultiSelectItem[] {\n\t\tif (Array.isArray(this.optionsState) && this.optionsState.length) {\n\t\t\tif (ignoreFilter) {\n\t\t\t\treturn this.optionsState;\n\t\t\t}\n\t\t\treturn this.optionsState.filter((option) => {\n\t\t\t\tconst selectedIndex = this.selectedValueIndex(option.value)\n\t\t\t\treturn (selectedIndex !== -1 || option?.disabled) ? false : true\n\t\t\t}).map((option) => ({label: option.label ?? option.value, value: option.value}))\n\t\t}\n\t\treturn Array.from(this.selectRef.querySelectorAll('option'))\n\t\t\t.filter((option: HTMLOptionElement) => {\n\t\t\t\tif (ignoreFilter) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tconst selectedIndex = this.selectedValueIndex(option.value)\n\t\t\t\treturn !(option.disabled || option.selected || selectedIndex > -1)\n\t\t\t})\n\t\t\t.map((option: HTMLOptionElement) => ({label: option.textContent, value: option.value}))\n\t}\n\n\tprivate initAutocomplete() {\n\t\tthis.autocompleteRef?.addEventListener('gov-select', this.onSelectHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-input', this.onInputHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-focus', this.onFocusHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-blur', this.onBlurHandler.bind(this))\n\t\tthis.autocompleteRef\n\t\t\t?.setSearchCallback(searchString => {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tconst data = this.getAvailableOptions()\n\t\t\t\t\tif (String(searchString).length === 0) {\n\t\t\t\t\t\treturn resolve(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(\n\t\t\t\t\t\tdata.filter(({label, value}) => {\n\t\t\t\t\t\t\tif (!label) label = value;\n\t\t\t\t\t\t\treturn removeDiacritics(label).toLowerCase().indexOf(removeDiacritics(searchString).toLowerCase()) > -1\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t})\n\t\t\t.finally()\n\t}\n\n\tprivate selectedValueIndex(value: GovFormMultiSelectSelectedItem) {\n\t\treturn this.selectedOptionsState.findIndex((selected) => selected === value)\n\t}\n\n\tprivate getOptionElement(value: GovFormMultiSelectSelectedItem): Nullable<HTMLOptionElement> {\n\t\treturn this.selectRef.querySelector('option[value=\"' + value + '\"]') as HTMLOptionElement\n\t}\n\n\tprivate getOption(value: GovFormMultiSelectSelectedItem): GovFormMultiSelectItem | null {\n\t\treturn this.getAvailableOptions(true).find((option) => option.value === value) ?? null;\n\t}\n\n\tprivate selectOption(newOption: GovFormMultiSelectSelectedItem, notify = true) {\n\t\tconst index = this.selectedValueIndex(newOption)\n\t\tif (index === -1) {\n\t\t\tthis.selectedOptionsState = [...this.selectedOptionsState, newOption]\n\t\t\tthis.value = this.selectedOptionsState;\n\t\t\tif (notify) {\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t\tthis.govSelect.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst option = this.getOptionElement(newOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeOption(removeOption: GovFormMultiSelectSelectedItem, notify = true) {\n\t\tconst index = this.selectedValueIndex(removeOption)\n\t\tif (index !== -1) {\n\t\t\tthis.selectedOptionsState.splice(index, 1)\n\t\t\tthis.selectedOptionsState = [...this.selectedOptionsState]\n\t\t\tthis.value = this.selectedOptionsState;\n\t\t\tif (notify) {\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t\tthis.govRemove.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst option = this.getOptionElement(removeOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = false\n\t\t\t}\n\t\t}\n\t}\n\n\tasync componentDidLoad() {\n\t\tthis.initAutocomplete()\n\t}\n\n\tasync componentDidRender() {\n\t\ttick(() => {\n\t\t\tthis.selectRef.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\t\tif (option.selected) {\n\t\t\t\t\tthis.selectOption(option.value, false)\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormMultiSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<div class={FormMultiSelectClass.wrap}>\n\t\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t\t<div class=\"element\">\n\t\t\t\t\t\t<gov-form-autocomplete\n\t\t\t\t\t\t\tvalue={this.valueState}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tidentifier={this.identifier || this.selectId}\n\t\t\t\t\t\t\trequired={false}\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tmessage-empty={this.messageEmpty}\n\t\t\t\t\t\t\tmessage-loading={this.messageLoading}\n\t\t\t\t\t\t\tref={el => (this.autocompleteRef = el as HTMLGovFormAutocompleteElement)}\n\t\t\t\t\t\t\tminlength={0}\n\t\t\t\t\t\t\tname-key={'label'}\n\t\t\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\t\t\twcagOwns={this.listId}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-arrow\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\"/>}\n\t\t\t\t\t\t{this.success && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t\t{this.invalid && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\tclass={'hidden-select-list'}\n\t\t\t\t\t\t\taria-hidden={toBoolAttr(true)}\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t{Array.isArray(this.optionsState) && this.optionsState.map((option) => {\n\t\t\t\t\t\t\t\tconst selectedOption = this.selectedValueIndex(option.value);\n\t\t\t\t\t\t\t\treturn (<option value={option.value} selected={selectedOption > -1}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={option?.disabled}>{option.label ?? option.value}</option>)\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t\t</div>\n\t\t\t\t{this.hideSelectedList === false ? (\n\t\t\t\t\t<ul role=\"listbox\" id={this.listId} class={FormMultiSelectClass.list}>\n\t\t\t\t\t\t{Array.isArray(this.selectedOptionsState) && this.selectedOptionsState.map(selected => {\n\t\t\t\t\t\t\tconst option = this.getOption(selected);\n\t\t\t\t\t\t\tif (!option) return null\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<li class={FormMultiSelectClass.item} role=\"option\">\n\t\t\t\t\t\t\t\t\t{option.label ?? option.value}\n\t\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\t\twcagLabel={'Odebrat vybranou položku ' + option.label ?? option.value}\n\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onTagRemove(selected)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ul>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptionsState,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptionsState,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\tthis.valueState = e.detail.value\n\t\te.stopPropagation()\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.selected\n\t\tthis.selectOption(value.value)\n\t\tthis.valueState = ''\n\t\tthis.autocompleteRef.clearValue().finally()\n\t\tthis.autocompleteRef.focus()\n\t}\n\n\tprivate onTagRemove(removeOption: GovFormMultiSelectSelectedItem) {\n\t\tthis.removeOption(removeOption)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.valueState = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormMultiSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormMultiSelectClass.root)\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"gov-form-multi-select.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,qBAAqB,GAAG,6jqBAA6jqB;;MC+B9kqB,kBAAkB;EAU9B;;;;;;;;;;;;gBAgCmD,GAAG;;4BAQwB,KAAK;oBAK9C,KAAK;oBAKL,KAAK;;;wBAY0B,gCAAgC;0BAI5B,YAAY;;;;;;gCAoClB,EAAE;wBAClB,EAAE;IAtGnD,IAAI,CAAC,QAAQ,GAAGA,qBAAQ,CAAC,WAAW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,EAAE,CAAA;IACnB,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAA;IAC/B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAC9B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;IACpB,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,CAAA;IAC3C,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAA;GAC5B;EAEO,WAAW,CAAC,YAA4C;IAC/D,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAA;GAC/B;;;;EAMD,MAAM,QAAQ,CAAC,OAAsB;IACpC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;GACpC;;;;EAMD,MAAM,QAAQ,CAAC,KAAa;IAC3B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAA;GACvB;;;;EAMD,MAAM,MAAM;IACX,OAAO,IAAI,CAAC,SAAS,CAAA;GACrB;;;;EAMD,MAAM,YAAY;IACjBW,oBAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAEX,yBAAoB,CAAC,IAAI,CAAC,CAAA;IACrFW,oBAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAEX,yBAAoB,CAAC,IAAI,CAAC,CAAA;IACnFW,oBAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAEX,yBAAoB,CAAC,IAAI,CAAC,CAAA;IACtEY,yBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAEZ,yBAAoB,CAAC,IAAI,CAAC,CAAA;GACtG;;;;;;;;;;;;;;;;","names":["createID","govHost","govForm","validateProp","FormMultiselectVariants","FormMultiSelectClass","FormMultiselectSizes","propsValueToArray","toBoolAttr","removeDiacritics","tick","canValidateWcagOnRender","delay","h","Host","toBoolAttrIfDefined","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.scss?tag=gov-form-multi-select","../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.tsx"],"sourcesContent":["/*\n * Multiselect\n */\n\n@import \"../select/gov-form-select-core.scss\";\n$class: \".gov-form-multi-select\";\n\n#{$class} {\n\t@extend %form-select-core;\n\tflex-wrap: wrap;\n\t&__wrap {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: rem-calc(8);\n\t\twidth: 100%;\n\t}\n\t&__list {\n\t\t@extend %reset-ul;\n\t\t@include typography($font-size-xs);\n\t\tdisplay: flex;\n\t\tgap: rem-calc(8);\n\t\tflex-wrap: wrap;\n\t}\n\t&__list > &__item {\n\t\t@extend %reset-ul-li;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tflex: 0 0 auto;\n\t\talign-items: center;\n\t\tpadding: rem-calc(0 0 0 8);\n\t\tbackground: $form-multiselect-bg;\n\t\ttransition: $t linear background-color;\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../../helpers/Dom/win'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {validateWcagLabelFor, validateWcagRef} from '../../../helpers/Validate/wcag'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID, removeDiacritics} from '../../../utils/string.utils'\nimport {delay} from '../../../utils/utils'\nimport {FormAutocompleteEvent} from '../autocomplete/gov-form-autocomplete.types'\nimport {\n\tFormMultiSelectClass,\n\tFormMultiselectSizes,\n\tFormMultiselectSizesType,\n\tFormMultiselectVariants,\n\tFormMultiselectVariantType\n} from './constants'\nimport {\n\tFormMultiselectEvent,\n\tGovFormMultiSelectItem,\n\tGovFormMultiSelectSelectedItem\n} from './gov-form-multi-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {tick} from \"../../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-form-multi-select',\n\tstyleUrl: 'gov-form-multi-select.scss',\n})\nexport class GovFormMultiSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate selectRef?: HTMLSelectElement\n\tprivate autocompleteRef?: HTMLGovFormAutocompleteElement\n\n\tprivate readonly selectId: string\n\tprivate readonly listId: string\n\n\tconstructor() {\n\t\tthis.selectId = createID('GovSelect')\n\t\tthis.listId = createID('GovMultiList')\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of multi-select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string | GovFormMultiSelectSelectedItem[]\n\t/**\n\t * Options of multi-select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormMultiSelectItem[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Custom select placeholder.\n\t */\n\t@Prop({attribute: 'placeholder'}) readonly placeholder: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormMultiselectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormMultiselectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Option to hide the list of selected items\n\t */\n\t@Prop({attribute: 'hide-selected-list'}) readonly hideSelectedList: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Custom message for when data is loaded\n\t */\n\t@Prop({attribute: 'message-loading'}) readonly messageLoading: string = 'Načítám...'\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-owns'}) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is selected\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is removed\n\t */\n\t@Event({eventName: 'gov-remove'}) govRemove: EventEmitter<FormMultiselectEvent>\n\n\t@State() focused: boolean\n\t@State() valueState: string\n\t@State() selectedOptionsState: GovFormMultiSelectSelectedItem[] = []\n\t@State() optionsState: GovFormMultiSelectItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormMultiselectVariants, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormMultiSelectItem[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('value')\n\twatchValue(newValue: string | GovFormMultiSelectItem[]): void {\n\t\tthis.selectedOptionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.watchDisabled()\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t\tthis.selectedOptionsState = propsValueToArray(this.value)\n\t}\n\n\tprivate getAvailableOptions(ignoreFilter = false): GovFormMultiSelectItem[] {\n\t\tif (Array.isArray(this.optionsState) && this.optionsState.length) {\n\t\t\tif (ignoreFilter) {\n\t\t\t\treturn this.optionsState;\n\t\t\t}\n\t\t\treturn this.optionsState.filter((option) => {\n\t\t\t\tconst selectedIndex = this.selectedValueIndex(option.value)\n\t\t\t\treturn (selectedIndex !== -1 || option?.disabled) ? false : true\n\t\t\t}).map((option) => ({label: option.label ?? option.value, value: option.value}))\n\t\t}\n\t\treturn Array.from(this.selectRef.querySelectorAll('option'))\n\t\t\t.filter((option: HTMLOptionElement) => {\n\t\t\t\tif (ignoreFilter) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tconst selectedIndex = this.selectedValueIndex(option.value)\n\t\t\t\treturn !(option.disabled || option.selected || selectedIndex > -1)\n\t\t\t})\n\t\t\t.map((option: HTMLOptionElement) => ({label: option.textContent, value: option.value}))\n\t}\n\n\tprivate initAutocomplete() {\n\t\tthis.autocompleteRef?.addEventListener('gov-select', this.onSelectHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-input', this.onInputHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-focus', this.onFocusHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-blur', this.onBlurHandler.bind(this))\n\t\tthis.autocompleteRef\n\t\t\t?.setSearchCallback(searchString => {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tconst data = this.getAvailableOptions()\n\t\t\t\t\tif (String(searchString).length === 0) {\n\t\t\t\t\t\treturn resolve(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(\n\t\t\t\t\t\tdata.filter(({label, value}) => {\n\t\t\t\t\t\t\tif (!label) label = value;\n\t\t\t\t\t\t\treturn removeDiacritics(label).toLowerCase().indexOf(removeDiacritics(searchString).toLowerCase()) > -1\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t})\n\t\t\t.finally()\n\t}\n\n\tprivate selectedValueIndex(value: GovFormMultiSelectSelectedItem) {\n\t\treturn this.selectedOptionsState.findIndex((selected) => selected === value)\n\t}\n\n\tprivate getOptionElement(value: GovFormMultiSelectSelectedItem): Nullable<HTMLOptionElement> {\n\t\treturn this.selectRef.querySelector('option[value=\"' + value + '\"]') as HTMLOptionElement\n\t}\n\n\tprivate getOption(value: GovFormMultiSelectSelectedItem): GovFormMultiSelectItem | null {\n\t\treturn this.getAvailableOptions(true).find((option) => option.value === value) ?? null;\n\t}\n\n\tprivate selectOption(newOption: GovFormMultiSelectSelectedItem, notify = true) {\n\t\tconst index = this.selectedValueIndex(newOption)\n\t\tif (index === -1) {\n\t\t\tthis.selectedOptionsState = [...this.selectedOptionsState, newOption]\n\t\t\tthis.value = this.selectedOptionsState;\n\t\t\tif (notify) {\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t\tthis.govSelect.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst option = this.getOptionElement(newOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeOption(removeOption: GovFormMultiSelectSelectedItem, notify = true) {\n\t\tconst index = this.selectedValueIndex(removeOption)\n\t\tif (index !== -1) {\n\t\t\tthis.selectedOptionsState.splice(index, 1)\n\t\t\tthis.selectedOptionsState = [...this.selectedOptionsState]\n\t\t\tthis.value = this.selectedOptionsState;\n\t\t\tif (notify) {\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t\tthis.govRemove.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst option = this.getOptionElement(removeOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = false\n\t\t\t}\n\t\t}\n\t}\n\n\tasync componentDidLoad() {\n\t\tthis.initAutocomplete()\n\t}\n\n\tasync componentDidRender() {\n\t\ttick(() => {\n\t\t\tthis.selectRef.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\t\tif (option.selected) {\n\t\t\t\t\tthis.selectOption(option.value, false)\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormMultiSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<div class={FormMultiSelectClass.wrap}>\n\t\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t\t<div class=\"element\">\n\t\t\t\t\t\t<gov-form-autocomplete\n\t\t\t\t\t\t\tvalue={this.valueState}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tidentifier={this.identifier || this.selectId}\n\t\t\t\t\t\t\trequired={false}\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tmessage-empty={this.messageEmpty}\n\t\t\t\t\t\t\tmessage-loading={this.messageLoading}\n\t\t\t\t\t\t\tref={el => (this.autocompleteRef = el as HTMLGovFormAutocompleteElement)}\n\t\t\t\t\t\t\tminlength={0}\n\t\t\t\t\t\t\tname-key={'label'}\n\t\t\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\t\t\twcagOwns={this.listId}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-arrow\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\"/>}\n\t\t\t\t\t\t{this.success && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t\t{this.invalid && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\tclass={'hidden-select-list'}\n\t\t\t\t\t\t\taria-hidden={toBoolAttr(true)}\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t\t</div>\n\t\t\t\t{this.hideSelectedList === false ? (\n\t\t\t\t\t<ul role=\"listbox\" id={this.listId} class={FormMultiSelectClass.list}>\n\t\t\t\t\t\t{Array.isArray(this.selectedOptionsState) && this.selectedOptionsState.map(selected => {\n\t\t\t\t\t\t\tconst option = this.getOption(selected);\n\t\t\t\t\t\t\tif (!option) return null\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<li class={FormMultiSelectClass.item} role=\"option\">\n\t\t\t\t\t\t\t\t\t{option.label ?? option.value}\n\t\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\t\twcagLabel={'Odebrat vybranou položku ' + option.label ?? option.value}\n\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onTagRemove(selected)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ul>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptionsState,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptionsState,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\tthis.valueState = e.detail.value\n\t\te.stopPropagation()\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.selected\n\t\tthis.selectOption(value.value)\n\t\tthis.valueState = ''\n\t\tthis.autocompleteRef.clearValue().finally()\n\t\tthis.autocompleteRef.focus()\n\t}\n\n\tprivate onTagRemove(removeOption: GovFormMultiSelectSelectedItem) {\n\t\tthis.removeOption(removeOption)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.valueState = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormMultiSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormMultiSelectClass.root)\n\t}\n}\n"],"version":3}
|
|
@@ -176,11 +176,7 @@ export class GovFormMultiSelect {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
render() {
|
|
179
|
-
return (h(Host, { class: FormMultiSelectClass.root, size: this.size, variant: this.variant }, h("div", { class: FormMultiSelectClass.wrap }, this.h.hasSlot('prefix') && h("slot", { name: "prefix" }), h("div", { class: "element" }, h("gov-form-autocomplete", { value: this.valueState, disabled: this.disabled, identifier: this.identifier || this.selectId, required: false, size: this.size, variant: this.variant, placeholder: this.placeholder, "message-empty": this.messageEmpty, "message-loading": this.messageLoading, ref: el => (this.autocompleteRef = el), minlength: 0, "name-key": 'label', wcagDescribedBy: this.wcagDescribedBy, wcagLabelledBy: this.wcagLabelledBy, wcagOwns: this.listId }), h("gov-icon", { slot: "right-icon", class: "icon-arrow", name: "chevron-down" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && h("slot", { name: "right-icon" }), this.success && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), h("select", { hidden: true, class: 'hidden-select-list', "aria-hidden": toBoolAttr(true), multiple: true, required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, h("slot", null), Array.isArray(this.
|
|
180
|
-
var _a;
|
|
181
|
-
const selectedOption = this.selectedValueIndex(option.value);
|
|
182
|
-
return (h("option", { value: option.value, selected: selectedOption > -1, disabled: option === null || option === void 0 ? void 0 : option.disabled }, (_a = option.label) !== null && _a !== void 0 ? _a : option.value));
|
|
183
|
-
}))), this.h.hasSlot('sufix') && h("slot", { name: "sufix" })), this.hideSelectedList === false ? (h("ul", { role: "listbox", id: this.listId, class: FormMultiSelectClass.list }, Array.isArray(this.selectedOptionsState) && this.selectedOptionsState.map(selected => {
|
|
179
|
+
return (h(Host, { class: FormMultiSelectClass.root, size: this.size, variant: this.variant }, h("div", { class: FormMultiSelectClass.wrap }, this.h.hasSlot('prefix') && h("slot", { name: "prefix" }), h("div", { class: "element" }, h("gov-form-autocomplete", { value: this.valueState, disabled: this.disabled, identifier: this.identifier || this.selectId, required: false, size: this.size, variant: this.variant, placeholder: this.placeholder, "message-empty": this.messageEmpty, "message-loading": this.messageLoading, ref: el => (this.autocompleteRef = el), minlength: 0, "name-key": 'label', wcagDescribedBy: this.wcagDescribedBy, wcagLabelledBy: this.wcagLabelledBy, wcagOwns: this.listId }), h("gov-icon", { slot: "right-icon", class: "icon-arrow", name: "chevron-down" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && h("slot", { name: "right-icon" }), this.success && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), h("select", { hidden: true, class: 'hidden-select-list', "aria-hidden": toBoolAttr(true), multiple: true, required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, h("slot", null))), this.h.hasSlot('sufix') && h("slot", { name: "sufix" })), this.hideSelectedList === false ? (h("ul", { role: "listbox", id: this.listId, class: FormMultiSelectClass.list }, Array.isArray(this.selectedOptionsState) && this.selectedOptionsState.map(selected => {
|
|
184
180
|
var _a, _b;
|
|
185
181
|
const option = this.getOption(selected);
|
|
186
182
|
if (!option)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-form-multi-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/multiselect/gov-form-multi-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAA;AAEjD,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAC,MAAM,+BAA+B,CAAA;AAEtF,OAAO,EAAC,uBAAuB,EAAC,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iCAAiC,CAAA;AAC5D,OAAO,EAAC,oBAAoB,EAAE,eAAe,EAAC,MAAM,gCAAgC,CAAA;AAEpF,OAAO,EAAC,QAAQ,EAAE,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAC,KAAK,EAAC,MAAM,sBAAsB,CAAA;AAE1C,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EAEpB,uBAAuB,EAEvB,MAAM,aAAa,CAAA;AAMpB,OAAO,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAC,IAAI,EAAC,MAAM,8BAA8B,CAAC;AAMlD,MAAM,OAAO,kBAAkB;EAU9B;;;;;;gBAgCmD,GAAG;;4BAQwB,KAAK;oBAK9C,KAAK;oBAKL,KAAK;;;wBAY0B,gCAAgC;0BAI5B,YAAY;;;;;;gCAoClB,EAAE;wBAClB,EAAE;IAtGnD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAA;IACrC,IAAI,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../../helpers/Dom/win'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {validateWcagLabelFor, validateWcagRef} from '../../../helpers/Validate/wcag'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID, removeDiacritics} from '../../../utils/string.utils'\nimport {delay} from '../../../utils/utils'\nimport {FormAutocompleteEvent} from '../autocomplete/gov-form-autocomplete.types'\nimport {\n\tFormMultiSelectClass,\n\tFormMultiselectSizes,\n\tFormMultiselectSizesType,\n\tFormMultiselectVariants,\n\tFormMultiselectVariantType\n} from './constants'\nimport {\n\tFormMultiselectEvent,\n\tGovFormMultiSelectItem,\n\tGovFormMultiSelectSelectedItem\n} from './gov-form-multi-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {tick} from \"../../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-form-multi-select',\n\tstyleUrl: 'gov-form-multi-select.scss',\n})\nexport class GovFormMultiSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate selectRef?: HTMLSelectElement\n\tprivate autocompleteRef?: HTMLGovFormAutocompleteElement\n\n\tprivate readonly selectId: string\n\tprivate readonly listId: string\n\n\tconstructor() {\n\t\tthis.selectId = createID('GovSelect')\n\t\tthis.listId = createID('GovMultiList')\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of multi-select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string | GovFormMultiSelectSelectedItem[]\n\t/**\n\t * Options of multi-select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormMultiSelectItem[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Custom select placeholder.\n\t */\n\t@Prop({attribute: 'placeholder'}) readonly placeholder: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormMultiselectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormMultiselectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Option to hide the list of selected items\n\t */\n\t@Prop({attribute: 'hide-selected-list'}) readonly hideSelectedList: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Custom message for when data is loaded\n\t */\n\t@Prop({attribute: 'message-loading'}) readonly messageLoading: string = 'Načítám...'\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-owns'}) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is selected\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is removed\n\t */\n\t@Event({eventName: 'gov-remove'}) govRemove: EventEmitter<FormMultiselectEvent>\n\n\t@State() focused: boolean\n\t@State() valueState: string\n\t@State() selectedOptionsState: GovFormMultiSelectSelectedItem[] = []\n\t@State() optionsState: GovFormMultiSelectItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormMultiselectVariants, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormMultiSelectItem[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('value')\n\twatchValue(newValue: string | GovFormMultiSelectItem[]): void {\n\t\tthis.selectedOptionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.watchDisabled()\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t\tthis.selectedOptionsState = propsValueToArray(this.value)\n\t}\n\n\tprivate getAvailableOptions(ignoreFilter = false): GovFormMultiSelectItem[] {\n\t\tif (Array.isArray(this.optionsState) && this.optionsState.length) {\n\t\t\tif (ignoreFilter) {\n\t\t\t\treturn this.optionsState;\n\t\t\t}\n\t\t\treturn this.optionsState.filter((option) => {\n\t\t\t\tconst selectedIndex = this.selectedValueIndex(option.value)\n\t\t\t\treturn (selectedIndex !== -1 || option?.disabled) ? false : true\n\t\t\t}).map((option) => ({label: option.label ?? option.value, value: option.value}))\n\t\t}\n\t\treturn Array.from(this.selectRef.querySelectorAll('option'))\n\t\t\t.filter((option: HTMLOptionElement) => {\n\t\t\t\tif (ignoreFilter) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tconst selectedIndex = this.selectedValueIndex(option.value)\n\t\t\t\treturn !(option.disabled || option.selected || selectedIndex > -1)\n\t\t\t})\n\t\t\t.map((option: HTMLOptionElement) => ({label: option.textContent, value: option.value}))\n\t}\n\n\tprivate initAutocomplete() {\n\t\tthis.autocompleteRef?.addEventListener('gov-select', this.onSelectHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-input', this.onInputHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-focus', this.onFocusHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-blur', this.onBlurHandler.bind(this))\n\t\tthis.autocompleteRef\n\t\t\t?.setSearchCallback(searchString => {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tconst data = this.getAvailableOptions()\n\t\t\t\t\tif (String(searchString).length === 0) {\n\t\t\t\t\t\treturn resolve(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(\n\t\t\t\t\t\tdata.filter(({label, value}) => {\n\t\t\t\t\t\t\tif (!label) label = value;\n\t\t\t\t\t\t\treturn removeDiacritics(label).toLowerCase().indexOf(removeDiacritics(searchString).toLowerCase()) > -1\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t})\n\t\t\t.finally()\n\t}\n\n\tprivate selectedValueIndex(value: GovFormMultiSelectSelectedItem) {\n\t\treturn this.selectedOptionsState.findIndex((selected) => selected === value)\n\t}\n\n\tprivate getOptionElement(value: GovFormMultiSelectSelectedItem): Nullable<HTMLOptionElement> {\n\t\treturn this.selectRef.querySelector('option[value=\"' + value + '\"]') as HTMLOptionElement\n\t}\n\n\tprivate getOption(value: GovFormMultiSelectSelectedItem): GovFormMultiSelectItem | null {\n\t\treturn this.getAvailableOptions(true).find((option) => option.value === value) ?? null;\n\t}\n\n\tprivate selectOption(newOption: GovFormMultiSelectSelectedItem, notify = true) {\n\t\tconst index = this.selectedValueIndex(newOption)\n\t\tif (index === -1) {\n\t\t\tthis.selectedOptionsState = [...this.selectedOptionsState, newOption]\n\t\t\tthis.value = this.selectedOptionsState;\n\t\t\tif (notify) {\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t\tthis.govSelect.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst option = this.getOptionElement(newOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeOption(removeOption: GovFormMultiSelectSelectedItem, notify = true) {\n\t\tconst index = this.selectedValueIndex(removeOption)\n\t\tif (index !== -1) {\n\t\t\tthis.selectedOptionsState.splice(index, 1)\n\t\t\tthis.selectedOptionsState = [...this.selectedOptionsState]\n\t\t\tthis.value = this.selectedOptionsState;\n\t\t\tif (notify) {\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t\tthis.govRemove.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst option = this.getOptionElement(removeOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = false\n\t\t\t}\n\t\t}\n\t}\n\n\tasync componentDidLoad() {\n\t\tthis.initAutocomplete()\n\t}\n\n\tasync componentDidRender() {\n\t\ttick(() => {\n\t\t\tthis.selectRef.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\t\tif (option.selected) {\n\t\t\t\t\tthis.selectOption(option.value, false)\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormMultiSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<div class={FormMultiSelectClass.wrap}>\n\t\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t\t<div class=\"element\">\n\t\t\t\t\t\t<gov-form-autocomplete\n\t\t\t\t\t\t\tvalue={this.valueState}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tidentifier={this.identifier || this.selectId}\n\t\t\t\t\t\t\trequired={false}\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tmessage-empty={this.messageEmpty}\n\t\t\t\t\t\t\tmessage-loading={this.messageLoading}\n\t\t\t\t\t\t\tref={el => (this.autocompleteRef = el as HTMLGovFormAutocompleteElement)}\n\t\t\t\t\t\t\tminlength={0}\n\t\t\t\t\t\t\tname-key={'label'}\n\t\t\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\t\t\twcagOwns={this.listId}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-arrow\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\"/>}\n\t\t\t\t\t\t{this.success && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t\t{this.invalid && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\tclass={'hidden-select-list'}\n\t\t\t\t\t\t\taria-hidden={toBoolAttr(true)}\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t\t{Array.isArray(this.optionsState) && this.optionsState.map((option) => {\n\t\t\t\t\t\t\t\tconst selectedOption = this.selectedValueIndex(option.value);\n\t\t\t\t\t\t\t\treturn (<option value={option.value} selected={selectedOption > -1}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={option?.disabled}>{option.label ?? option.value}</option>)\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t\t</div>\n\t\t\t\t{this.hideSelectedList === false ? (\n\t\t\t\t\t<ul role=\"listbox\" id={this.listId} class={FormMultiSelectClass.list}>\n\t\t\t\t\t\t{Array.isArray(this.selectedOptionsState) && this.selectedOptionsState.map(selected => {\n\t\t\t\t\t\t\tconst option = this.getOption(selected);\n\t\t\t\t\t\t\tif (!option) return null\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<li class={FormMultiSelectClass.item} role=\"option\">\n\t\t\t\t\t\t\t\t\t{option.label ?? option.value}\n\t\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\t\twcagLabel={'Odebrat vybranou položku ' + option.label ?? option.value}\n\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onTagRemove(selected)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ul>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptionsState,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptionsState,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\tthis.valueState = e.detail.value\n\t\te.stopPropagation()\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.selected\n\t\tthis.selectOption(value.value)\n\t\tthis.valueState = ''\n\t\tthis.autocompleteRef.clearValue().finally()\n\t\tthis.autocompleteRef.focus()\n\t}\n\n\tprivate onTagRemove(removeOption: GovFormMultiSelectSelectedItem) {\n\t\tthis.removeOption(removeOption)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.valueState = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormMultiSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormMultiSelectClass.root)\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gov-form-multi-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/multiselect/gov-form-multi-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAA;AAEjD,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAC,MAAM,+BAA+B,CAAA;AAEtF,OAAO,EAAC,uBAAuB,EAAC,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iCAAiC,CAAA;AAC5D,OAAO,EAAC,oBAAoB,EAAE,eAAe,EAAC,MAAM,gCAAgC,CAAA;AAEpF,OAAO,EAAC,QAAQ,EAAE,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAC,KAAK,EAAC,MAAM,sBAAsB,CAAA;AAE1C,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EAEpB,uBAAuB,EAEvB,MAAM,aAAa,CAAA;AAMpB,OAAO,EAAC,iBAAiB,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAC,IAAI,EAAC,MAAM,8BAA8B,CAAC;AAMlD,MAAM,OAAO,kBAAkB;EAU9B;;;;;;gBAgCmD,GAAG;;4BAQwB,KAAK;oBAK9C,KAAK;oBAKL,KAAK;;;wBAY0B,gCAAgC;0BAI5B,YAAY;;;;;;gCAoClB,EAAE;wBAClB,EAAE;IAtGnD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAA;IACrC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAA;IAEtC,IAAI,CAAC,CAAC,GAAG,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CAAA;IACnF,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACtE,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;EACvG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../../helpers/Dom/win'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {validateWcagLabelFor, validateWcagRef} from '../../../helpers/Validate/wcag'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID, removeDiacritics} from '../../../utils/string.utils'\nimport {delay} from '../../../utils/utils'\nimport {FormAutocompleteEvent} from '../autocomplete/gov-form-autocomplete.types'\nimport {\n\tFormMultiSelectClass,\n\tFormMultiselectSizes,\n\tFormMultiselectSizesType,\n\tFormMultiselectVariants,\n\tFormMultiselectVariantType\n} from './constants'\nimport {\n\tFormMultiselectEvent,\n\tGovFormMultiSelectItem,\n\tGovFormMultiSelectSelectedItem\n} from './gov-form-multi-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {tick} from \"../../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-form-multi-select',\n\tstyleUrl: 'gov-form-multi-select.scss',\n})\nexport class GovFormMultiSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate selectRef?: HTMLSelectElement\n\tprivate autocompleteRef?: HTMLGovFormAutocompleteElement\n\n\tprivate readonly selectId: string\n\tprivate readonly listId: string\n\n\tconstructor() {\n\t\tthis.selectId = createID('GovSelect')\n\t\tthis.listId = createID('GovMultiList')\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of multi-select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string | GovFormMultiSelectSelectedItem[]\n\t/**\n\t * Options of multi-select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormMultiSelectItem[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Custom select placeholder.\n\t */\n\t@Prop({attribute: 'placeholder'}) readonly placeholder: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormMultiselectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormMultiselectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Option to hide the list of selected items\n\t */\n\t@Prop({attribute: 'hide-selected-list'}) readonly hideSelectedList: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Custom message for when data is loaded\n\t */\n\t@Prop({attribute: 'message-loading'}) readonly messageLoading: string = 'Načítám...'\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-owns'}) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is selected\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is removed\n\t */\n\t@Event({eventName: 'gov-remove'}) govRemove: EventEmitter<FormMultiselectEvent>\n\n\t@State() focused: boolean\n\t@State() valueState: string\n\t@State() selectedOptionsState: GovFormMultiSelectSelectedItem[] = []\n\t@State() optionsState: GovFormMultiSelectItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormMultiselectVariants, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormMultiSelectItem[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('value')\n\twatchValue(newValue: string | GovFormMultiSelectItem[]): void {\n\t\tthis.selectedOptionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.watchDisabled()\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t\tthis.selectedOptionsState = propsValueToArray(this.value)\n\t}\n\n\tprivate getAvailableOptions(ignoreFilter = false): GovFormMultiSelectItem[] {\n\t\tif (Array.isArray(this.optionsState) && this.optionsState.length) {\n\t\t\tif (ignoreFilter) {\n\t\t\t\treturn this.optionsState;\n\t\t\t}\n\t\t\treturn this.optionsState.filter((option) => {\n\t\t\t\tconst selectedIndex = this.selectedValueIndex(option.value)\n\t\t\t\treturn (selectedIndex !== -1 || option?.disabled) ? false : true\n\t\t\t}).map((option) => ({label: option.label ?? option.value, value: option.value}))\n\t\t}\n\t\treturn Array.from(this.selectRef.querySelectorAll('option'))\n\t\t\t.filter((option: HTMLOptionElement) => {\n\t\t\t\tif (ignoreFilter) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tconst selectedIndex = this.selectedValueIndex(option.value)\n\t\t\t\treturn !(option.disabled || option.selected || selectedIndex > -1)\n\t\t\t})\n\t\t\t.map((option: HTMLOptionElement) => ({label: option.textContent, value: option.value}))\n\t}\n\n\tprivate initAutocomplete() {\n\t\tthis.autocompleteRef?.addEventListener('gov-select', this.onSelectHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-input', this.onInputHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-focus', this.onFocusHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-blur', this.onBlurHandler.bind(this))\n\t\tthis.autocompleteRef\n\t\t\t?.setSearchCallback(searchString => {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tconst data = this.getAvailableOptions()\n\t\t\t\t\tif (String(searchString).length === 0) {\n\t\t\t\t\t\treturn resolve(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(\n\t\t\t\t\t\tdata.filter(({label, value}) => {\n\t\t\t\t\t\t\tif (!label) label = value;\n\t\t\t\t\t\t\treturn removeDiacritics(label).toLowerCase().indexOf(removeDiacritics(searchString).toLowerCase()) > -1\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t})\n\t\t\t.finally()\n\t}\n\n\tprivate selectedValueIndex(value: GovFormMultiSelectSelectedItem) {\n\t\treturn this.selectedOptionsState.findIndex((selected) => selected === value)\n\t}\n\n\tprivate getOptionElement(value: GovFormMultiSelectSelectedItem): Nullable<HTMLOptionElement> {\n\t\treturn this.selectRef.querySelector('option[value=\"' + value + '\"]') as HTMLOptionElement\n\t}\n\n\tprivate getOption(value: GovFormMultiSelectSelectedItem): GovFormMultiSelectItem | null {\n\t\treturn this.getAvailableOptions(true).find((option) => option.value === value) ?? null;\n\t}\n\n\tprivate selectOption(newOption: GovFormMultiSelectSelectedItem, notify = true) {\n\t\tconst index = this.selectedValueIndex(newOption)\n\t\tif (index === -1) {\n\t\t\tthis.selectedOptionsState = [...this.selectedOptionsState, newOption]\n\t\t\tthis.value = this.selectedOptionsState;\n\t\t\tif (notify) {\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t\tthis.govSelect.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst option = this.getOptionElement(newOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeOption(removeOption: GovFormMultiSelectSelectedItem, notify = true) {\n\t\tconst index = this.selectedValueIndex(removeOption)\n\t\tif (index !== -1) {\n\t\t\tthis.selectedOptionsState.splice(index, 1)\n\t\t\tthis.selectedOptionsState = [...this.selectedOptionsState]\n\t\t\tthis.value = this.selectedOptionsState;\n\t\t\tif (notify) {\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t\tthis.govRemove.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst option = this.getOptionElement(removeOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = false\n\t\t\t}\n\t\t}\n\t}\n\n\tasync componentDidLoad() {\n\t\tthis.initAutocomplete()\n\t}\n\n\tasync componentDidRender() {\n\t\ttick(() => {\n\t\t\tthis.selectRef.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\t\tif (option.selected) {\n\t\t\t\t\tthis.selectOption(option.value, false)\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormMultiSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<div class={FormMultiSelectClass.wrap}>\n\t\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t\t<div class=\"element\">\n\t\t\t\t\t\t<gov-form-autocomplete\n\t\t\t\t\t\t\tvalue={this.valueState}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tidentifier={this.identifier || this.selectId}\n\t\t\t\t\t\t\trequired={false}\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tmessage-empty={this.messageEmpty}\n\t\t\t\t\t\t\tmessage-loading={this.messageLoading}\n\t\t\t\t\t\t\tref={el => (this.autocompleteRef = el as HTMLGovFormAutocompleteElement)}\n\t\t\t\t\t\t\tminlength={0}\n\t\t\t\t\t\t\tname-key={'label'}\n\t\t\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\t\t\twcagOwns={this.listId}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-arrow\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\"/>}\n\t\t\t\t\t\t{this.success && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t\t{this.invalid && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\tclass={'hidden-select-list'}\n\t\t\t\t\t\t\taria-hidden={toBoolAttr(true)}\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t\t</div>\n\t\t\t\t{this.hideSelectedList === false ? (\n\t\t\t\t\t<ul role=\"listbox\" id={this.listId} class={FormMultiSelectClass.list}>\n\t\t\t\t\t\t{Array.isArray(this.selectedOptionsState) && this.selectedOptionsState.map(selected => {\n\t\t\t\t\t\t\tconst option = this.getOption(selected);\n\t\t\t\t\t\t\tif (!option) return null\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<li class={FormMultiSelectClass.item} role=\"option\">\n\t\t\t\t\t\t\t\t\t{option.label ?? option.value}\n\t\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\t\twcagLabel={'Odebrat vybranou položku ' + option.label ?? option.value}\n\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onTagRemove(selected)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ul>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptionsState,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptionsState,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\tthis.valueState = e.detail.value\n\t\te.stopPropagation()\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.selected\n\t\tthis.selectOption(value.value)\n\t\tthis.valueState = ''\n\t\tthis.autocompleteRef.clearValue().finally()\n\t\tthis.autocompleteRef.focus()\n\t}\n\n\tprivate onTagRemove(removeOption: GovFormMultiSelectSelectedItem) {\n\t\tthis.removeOption(removeOption)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.valueState = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormMultiSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormMultiSelectClass.root)\n\t}\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as i,c as e,h as a,d as r}from"./p-2dee9951.js";import{v as t}from"./p-dcb5fb35.js";import{A as c,a as n,b as d,c as g}from"./p-74b2311a.js";import{c as v}from"./p-24636c53.js";import{g as s,b as m,t as l}from"./p-c353678b.js";import{d as h}from"./p-16ce28bd.js";const _='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-accordion-item{position:relative;display:block;width:100%}.gov-accordion-item::before{content:"";position:absolute;display:block;right:0;bottom:-1px;left:0;height:1px;background-color:var(--gov-color-secondary-500)}.gov-accordion-item__header{display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;border:0;background-color:transparent;text-align:center;text-decoration:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;padding:0;font-family:var(--gov-font-family, "Roboto", sans-serif);font-weight:400;box-sizing:border-box;position:relative;display:flex;justify-content:space-between;align-items:flex-start;width:100%;border-radius:0;text-align:left;text-transform:none;transition:background-color 150ms ease-in-out}.gov-accordion-item__header:focus{outline:none}.gov-accordion-item__header:focus{outline:none}.gov-accordion-item__header:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-accordion-item__header:focus-visible::before{display:none}.gov-accordion-item__header[aria-expanded=""] .gov-accordion-item__arrow .gov-icon:not([slot=toggle-icon]),.gov-accordion-item__header[aria-expanded=true i] .gov-accordion-item__arrow .gov-icon:not([slot=toggle-icon]),.gov-accordion-item__header[aria-expanded="1"] .gov-accordion-item__arrow .gov-icon:not([slot=toggle-icon]){transform:scale(-1)}.gov-accordion-item__icon{display:inline-flex;vertical-align:middle;flex:0 0 auto}.gov-accordion-item__title{display:flex;flex-direction:column;margin-right:auto}.gov-accordion-item__label *{margin-bottom:0;display:inline-block;transform:translateY(1px)}.gov-accordion-item__annotation *{color:var(--gov-color-secondary);margin-bottom:0}.gov-accordion-item__right{display:flex;flex-shrink:0;align-items:center;margin-left:auto}.gov-accordion-item__suffix{display:inline-flex;vertical-align:middle;flex:0 0 auto;align-self:start;line-height:initial}.gov-accordion-item__arrow{flex:0 0 auto}.gov-accordion-item__content>*:last-child{margin-bottom:0}.gov-accordion-item[size=xs] .gov-accordion-item__header,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__header{gap:var(--gov-accordion-xs-headline-gap, 0.5rem);min-height:var(--gov-accordion-xs-min-height, 3rem);padding:var(--gov-accordion-xs-padding-y, 0.75rem) var(--gov-accordion-xs-padding-x, 0.5rem)}.gov-accordion-item[size=xs] .gov-accordion-item__icon,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__icon{width:calc(var(--gov-text-m-font-size) * 1.2);height:calc(var(--gov-text-m-font-size) * 1.2);transform:translateY(var(--gov-accordion-xs-icon-position, 0.1875rem))}.gov-accordion-item[size=xs] .gov-accordion-item__label *,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__label *{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-accordion-item[size=xs] .gov-accordion-item__annotation,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__annotation{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing)}.gov-accordion-item[size=xs] .gov-accordion-item__right,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__right{gap:var(--gov-accordion-xs-headline-gap, 0.5rem);transform:translateY(var(--gov-accordion-xs-arrow-position, 0.1875rem))}.gov-accordion-item[size=xs] .gov-accordion-item__right:has(.gov-accordion-item__suffix),.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__right:has(.gov-accordion-item__suffix){transform:translateY(var(--gov-accordion-xs-icon-position, 0.1875rem))}.gov-accordion-item[size=xs] .gov-accordion-item__arrow,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__arrow{width:var(--gov-accordion-xs-icon-size, 1rem);height:var(--gov-accordion-xs-icon-size, 1rem)}.gov-accordion-item[size=xs] .gov-accordion-item__content,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__content{padding:var(--gov-accordion-xs-padding-inner, 1rem 0.5rem)}.gov-accordion-item[size=s] .gov-accordion-item__header,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__header{gap:var(--gov-accordion-s-headline-gap, 0.5rem);min-height:var(--gov-accordion-s-min-height, 3rem);padding:var(--gov-accordion-s-padding-y, 1.125rem) var(--gov-accordion-s-padding-x, 0.5rem)}.gov-accordion-item[size=s] .gov-accordion-item__icon,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__icon{width:calc(var(--gov-text-xl-font-size) * 1.2);height:calc(var(--gov-text-xl-font-size) * 1.2);transform:translateY(var(--gov-accordion-s-icon-position, 0.1875rem))}.gov-accordion-item[size=s] .gov-accordion-item__label *,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__label *{font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing)}.gov-accordion-item[size=s] .gov-accordion-item__annotation,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__annotation{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-accordion-item[size=s] .gov-accordion-item__right,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__right{gap:var(--gov-accordion-s-headline-gap, 0.5rem);transform:translateY(var(--gov-accordion-s-arrow-position, 0.4375rem))}.gov-accordion-item[size=s] .gov-accordion-item__right:has(.gov-accordion-item__suffix),.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__right:has(.gov-accordion-item__suffix){transform:translateY(var(--gov-accordion-s-icon-position, 0.1875rem))}.gov-accordion-item[size=s] .gov-accordion-item__arrow,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__arrow{width:var(--gov-accordion-s-icon-size, 1rem);height:var(--gov-accordion-s-icon-size, 1rem)}.gov-accordion-item[size=s] .gov-accordion-item__content,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__content{padding:var(--gov-accordion-s-padding-inner, 1rem 0.5rem)}.gov-accordion-item[size=m] .gov-accordion-item__header,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__header{gap:var(--gov-accordion-m-headline-gap, 1rem);min-height:var(--gov-accordion-m-min-height, 4.5rem);padding:var(--gov-accordion-m-padding-y, 1.25rem) var(--gov-accordion-m-padding-x, 0.5rem)}.gov-accordion-item[size=m] .gov-accordion-item__icon,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__icon{width:calc(var(--gov-text-2xl-font-size) * 1.2);height:calc(var(--gov-text-2xl-font-size) * 1.2);transform:translateY(var(--gov-accordion-m-icon-position, 0.25rem))}.gov-accordion-item[size=m] .gov-accordion-item__label *,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__label *{font-weight:var(--gov-text-2xl-font-weight);font-size:var(--gov-text-2xl-font-size);line-height:var(--gov-text-2xl-line-height);letter-spacing:var(--gov-text-2xl-letter-spacing)}.gov-accordion-item[size=m] .gov-accordion-item__annotation,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__annotation{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-accordion-item[size=m] .gov-accordion-item__right,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__right{gap:var(--gov-accordion-m-headline-gap, 1rem);transform:translateY(var(--gov-accordion-m-arrow-position, 0.25rem))}.gov-accordion-item[size=m] .gov-accordion-item__right:has(.gov-accordion-item__suffix),.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__right:has(.gov-accordion-item__suffix){transform:translateY(var(--gov-accordion-m-icon-position, 0.25rem))}.gov-accordion-item[size=m] .gov-accordion-item__arrow,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__arrow{width:var(--gov-accordion-m-icon-size, 1.5rem);height:var(--gov-accordion-m-icon-size, 1.5rem)}.gov-accordion-item[size=m] .gov-accordion-item__content,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__content{padding:var(--gov-accordion-m-padding-inner, 1.25rem 0.5rem)}.gov-accordion-item[size=l] .gov-accordion-item__header,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__header{gap:var(--gov-accordion-l-headline-gap, 1rem);min-height:var(--gov-accordion-l-min-height, 5.5rem);padding:var(--gov-accordion-l-padding-y, 1.375rem) var(--gov-accordion-l-padding-x, 0.5rem)}.gov-accordion-item[size=l] .gov-accordion-item__icon,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__icon{width:calc(var(--gov-text-3xl-font-size) * 1.2);height:calc(var(--gov-text-3xl-font-size) * 1.2);transform:translateY(var(--gov-accordion-l-icon-position, 0.3125rem))}.gov-accordion-item[size=l] .gov-accordion-item__label *,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__label *{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing)}.gov-accordion-item[size=l] .gov-accordion-item__annotation,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__annotation{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-accordion-item[size=l] .gov-accordion-item__right,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__right{gap:var(--gov-accordion-l-headline-gap, 1rem);transform:translateY(var(--gov-accordion-l-arrow-position, 0.625rem))}.gov-accordion-item[size=l] .gov-accordion-item__right:has(.gov-accordion-item__suffix),.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__right:has(.gov-accordion-item__suffix){transform:translateY(var(--gov-accordion-l-icon-position, 0.3125rem))}.gov-accordion-item[size=l] .gov-accordion-item__arrow,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__arrow{width:var(--gov-accordion-l-icon-size, 1.5rem);height:var(--gov-accordion-l-icon-size, 1.5rem)}.gov-accordion-item[size=l] .gov-accordion-item__content,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__content{padding:var(--gov-accordion-l-padding-inner, 1.25rem 0.5rem)}.gov-accordion-item[variant=primary] .gov-accordion-item::before{background-color:var(--gov-accordion-primary-separator, var(--gov-color-secondary-500))}.gov-accordion-item[variant=primary] .gov-accordion-item__header{background-color:var(--gov-accordion-primary-background, transparent);color:var(--gov-accordion-primary-color, var(--gov-color-primary))}@media not all and (pointer: coarse){.gov-accordion-item[variant=primary] .gov-accordion-item__header:hover{background-color:var(--gov-accordion-primary-background-hover, var(--gov-color-primary-200))}}.gov-accordion-item[variant=primary][disabled=""] .gov-accordion-item__header,.gov-accordion-item[variant=primary][disabled=true i] .gov-accordion-item__header,.gov-accordion-item[variant=primary][disabled="1"] .gov-accordion-item__header{color:var(--gov-accordion-primary-disabled-color, var(--gov-color-primary-400))}@media not all and (pointer: coarse){.gov-accordion-item[variant=primary][disabled=""] .gov-accordion-item__header:hover,.gov-accordion-item[variant=primary][disabled=true i] .gov-accordion-item__header:hover,.gov-accordion-item[variant=primary][disabled="1"] .gov-accordion-item__header:hover{background:transparent;cursor:not-allowed}}.gov-accordion-item[variant=secondary] .gov-accordion-item::before{background-color:var(--gov-accordion-secondary-separator, var(--gov-color-secondary-500))}.gov-accordion-item[variant=secondary] .gov-accordion-item__header{background-color:var(--gov-accordion-secondary-background, transparent);color:var(--gov-accordion-secondary-color, var(--gov-color-secondary))}@media not all and (pointer: coarse){.gov-accordion-item[variant=secondary] .gov-accordion-item__header:hover{background-color:var(--gov-accordion-secondary-background-hover, var(--gov-color-secondary-200))}}.gov-accordion-item[variant=secondary][disabled=""] .gov-accordion-item__header,.gov-accordion-item[variant=secondary][disabled=true i] .gov-accordion-item__header,.gov-accordion-item[variant=secondary][disabled="1"] .gov-accordion-item__header{color:var(--gov-accordion-secondary-disabled-color, var(--gov-color-secondary-600))}@media not all and (pointer: coarse){.gov-accordion-item[variant=secondary][disabled=""] .gov-accordion-item__header:hover,.gov-accordion-item[variant=secondary][disabled=true i] .gov-accordion-item__header:hover,.gov-accordion-item[variant=secondary][disabled="1"] .gov-accordion-item__header:hover{background:transparent;cursor:not-allowed}}@media (max-width: 47.99em){.gov-accordion-item__title{flex-wrap:wrap}.gov-accordion-item__label{flex:0 0 auto}}';const p=o(class o extends i{constructor(){super();this.__registerHost();this.govChange=e(this,"gov-change",7);this.isExpandedState=undefined;this.variant=undefined;this.identifier=undefined;this.size=undefined;this.disabled=false;this.isExpanded=false;this.h=s(this.host);this.triggerId=v("GovAccordionItem");this.contentId=v("GovAccordionContent")}validateSize(o){t(d,o,c.root)}validateVariant(o){t(g,o,c.root)}emmitChange(){this.govChange.emit({open:this.isExpanded,component:c.root,ref:this.host})}componentWillLoad(){this.getPropsFromParents();this.validateSize(this.size);this.validateVariant(this.variant)}getPropsFromParents(){const o=this.h.getParent(n.root);if(o){this.size=o.getAttribute("size");this.variant=o.getAttribute("variant")}}render(){const o=this.identifier||this.triggerId;const i=this.contentId;return a(r,{class:this.h.classes(c.root),size:this.size,variant:this.variant,role:"listitem"},a("button",{id:o,class:c.header,"aria-expanded":m(this.isExpanded),"aria-controls":i,disabled:this.disabled,type:"button","aria-disabled":l(this.disabled),onClick:o=>{o.stopPropagation();this.toggle().finally()}},this.h.hasSlot("icon")&&a("span",{class:c.icon},a("slot",{name:"icon"})),a("span",{class:c.title},a("span",{class:c.label},a("slot",{name:"label"})),this.h.hasSlot("annotation")&&a("span",{class:c.annotation},a("slot",{name:"annotation"}))),a("span",{class:c.right},this.h.hasSlot("suffix")&&a("span",{class:c.suffix},a("slot",{name:"suffix"})),a("span",{class:c.arrow},this.h.hasSlot("toggle-icon")?a("slot",{name:"toggle-icon"}):a("gov-icon",{name:"chevron-down"})))),a("div",{class:c.content,id:i,"aria-hidden":m(!this.isExpanded),hidden:!this.isExpanded,"aria-labelledby":o},a("slot",null)))}async open(){this.isExpanded=true;this.emmitChange()}async close(){this.isExpanded=false;this.emmitChange()}async toggle(){this.isExpanded=!this.isExpanded;this.emmitChange()}async currentState(){return this.isExpanded}get host(){return this}static get watchers(){return{size:["validateSize"],variant:["validateVariant"]}}static get style(){return _}},[4,"gov-accordion-item",{variant:[1],identifier:[1],size:[1],disabled:[4],isExpanded:[1028,"is-expanded"],isExpandedState:[32],open:[64],close:[64],toggle:[64],currentState:[64]}]);function f(){if(typeof customElements==="undefined"){return}const o=["gov-accordion-item","gov-icon"];o.forEach((o=>{switch(o){case"gov-accordion-item":if(!customElements.get(o)){customElements.define(o,p)}break;case"gov-icon":if(!customElements.get(o)){h()}break}}))}f();const x=p;const z=f;export{x as GovAccordionItem,z as defineCustomElement};
|
|
1
|
+
import{p as o,H as i,c as e,h as a,d as r}from"./p-2dee9951.js";import{v as t}from"./p-dcb5fb35.js";import{A as c,a as n,b as d,c as g}from"./p-74b2311a.js";import{c as v}from"./p-24636c53.js";import{g as s,b as m,t as l}from"./p-c353678b.js";import{d as h}from"./p-c3fdf866.js";const _='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-accordion-item{position:relative;display:block;width:100%}.gov-accordion-item::before{content:"";position:absolute;display:block;right:0;bottom:-1px;left:0;height:1px;background-color:var(--gov-color-secondary-500)}.gov-accordion-item__header{display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;border:0;background-color:transparent;text-align:center;text-decoration:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;padding:0;font-family:var(--gov-font-family, "Roboto", sans-serif);font-weight:400;box-sizing:border-box;position:relative;display:flex;justify-content:space-between;align-items:flex-start;width:100%;border-radius:0;text-align:left;text-transform:none;transition:background-color 150ms ease-in-out}.gov-accordion-item__header:focus{outline:none}.gov-accordion-item__header:focus{outline:none}.gov-accordion-item__header:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-accordion-item__header:focus-visible::before{display:none}.gov-accordion-item__header[aria-expanded=""] .gov-accordion-item__arrow .gov-icon:not([slot=toggle-icon]),.gov-accordion-item__header[aria-expanded=true i] .gov-accordion-item__arrow .gov-icon:not([slot=toggle-icon]),.gov-accordion-item__header[aria-expanded="1"] .gov-accordion-item__arrow .gov-icon:not([slot=toggle-icon]){transform:scale(-1)}.gov-accordion-item__icon{display:inline-flex;vertical-align:middle;flex:0 0 auto}.gov-accordion-item__title{display:flex;flex-direction:column;margin-right:auto}.gov-accordion-item__label *{margin-bottom:0;display:inline-block;transform:translateY(1px)}.gov-accordion-item__annotation *{color:var(--gov-color-secondary);margin-bottom:0}.gov-accordion-item__right{display:flex;flex-shrink:0;align-items:center;margin-left:auto}.gov-accordion-item__suffix{display:inline-flex;vertical-align:middle;flex:0 0 auto;align-self:start;line-height:initial}.gov-accordion-item__arrow{flex:0 0 auto}.gov-accordion-item__content>*:last-child{margin-bottom:0}.gov-accordion-item[size=xs] .gov-accordion-item__header,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__header{gap:var(--gov-accordion-xs-headline-gap, 0.5rem);min-height:var(--gov-accordion-xs-min-height, 3rem);padding:var(--gov-accordion-xs-padding-y, 0.75rem) var(--gov-accordion-xs-padding-x, 0.5rem)}.gov-accordion-item[size=xs] .gov-accordion-item__icon,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__icon{width:calc(var(--gov-text-m-font-size) * 1.2);height:calc(var(--gov-text-m-font-size) * 1.2);transform:translateY(var(--gov-accordion-xs-icon-position, 0.1875rem))}.gov-accordion-item[size=xs] .gov-accordion-item__label *,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__label *{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-accordion-item[size=xs] .gov-accordion-item__annotation,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__annotation{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing)}.gov-accordion-item[size=xs] .gov-accordion-item__right,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__right{gap:var(--gov-accordion-xs-headline-gap, 0.5rem);transform:translateY(var(--gov-accordion-xs-arrow-position, 0.1875rem))}.gov-accordion-item[size=xs] .gov-accordion-item__right:has(.gov-accordion-item__suffix),.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__right:has(.gov-accordion-item__suffix){transform:translateY(var(--gov-accordion-xs-icon-position, 0.1875rem))}.gov-accordion-item[size=xs] .gov-accordion-item__arrow,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__arrow{width:var(--gov-accordion-xs-icon-size, 1rem);height:var(--gov-accordion-xs-icon-size, 1rem)}.gov-accordion-item[size=xs] .gov-accordion-item__content,.gov-accordion-item .gov-accordion-item[size=xs] .gov-accordion-item__content{padding:var(--gov-accordion-xs-padding-inner, 1rem 0.5rem)}.gov-accordion-item[size=s] .gov-accordion-item__header,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__header{gap:var(--gov-accordion-s-headline-gap, 0.5rem);min-height:var(--gov-accordion-s-min-height, 3rem);padding:var(--gov-accordion-s-padding-y, 1.125rem) var(--gov-accordion-s-padding-x, 0.5rem)}.gov-accordion-item[size=s] .gov-accordion-item__icon,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__icon{width:calc(var(--gov-text-xl-font-size) * 1.2);height:calc(var(--gov-text-xl-font-size) * 1.2);transform:translateY(var(--gov-accordion-s-icon-position, 0.1875rem))}.gov-accordion-item[size=s] .gov-accordion-item__label *,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__label *{font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing)}.gov-accordion-item[size=s] .gov-accordion-item__annotation,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__annotation{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-accordion-item[size=s] .gov-accordion-item__right,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__right{gap:var(--gov-accordion-s-headline-gap, 0.5rem);transform:translateY(var(--gov-accordion-s-arrow-position, 0.4375rem))}.gov-accordion-item[size=s] .gov-accordion-item__right:has(.gov-accordion-item__suffix),.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__right:has(.gov-accordion-item__suffix){transform:translateY(var(--gov-accordion-s-icon-position, 0.1875rem))}.gov-accordion-item[size=s] .gov-accordion-item__arrow,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__arrow{width:var(--gov-accordion-s-icon-size, 1rem);height:var(--gov-accordion-s-icon-size, 1rem)}.gov-accordion-item[size=s] .gov-accordion-item__content,.gov-accordion-item .gov-accordion-item[size=s] .gov-accordion-item__content{padding:var(--gov-accordion-s-padding-inner, 1rem 0.5rem)}.gov-accordion-item[size=m] .gov-accordion-item__header,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__header{gap:var(--gov-accordion-m-headline-gap, 1rem);min-height:var(--gov-accordion-m-min-height, 4.5rem);padding:var(--gov-accordion-m-padding-y, 1.25rem) var(--gov-accordion-m-padding-x, 0.5rem)}.gov-accordion-item[size=m] .gov-accordion-item__icon,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__icon{width:calc(var(--gov-text-2xl-font-size) * 1.2);height:calc(var(--gov-text-2xl-font-size) * 1.2);transform:translateY(var(--gov-accordion-m-icon-position, 0.25rem))}.gov-accordion-item[size=m] .gov-accordion-item__label *,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__label *{font-weight:var(--gov-text-2xl-font-weight);font-size:var(--gov-text-2xl-font-size);line-height:var(--gov-text-2xl-line-height);letter-spacing:var(--gov-text-2xl-letter-spacing)}.gov-accordion-item[size=m] .gov-accordion-item__annotation,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__annotation{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-accordion-item[size=m] .gov-accordion-item__right,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__right{gap:var(--gov-accordion-m-headline-gap, 1rem);transform:translateY(var(--gov-accordion-m-arrow-position, 0.25rem))}.gov-accordion-item[size=m] .gov-accordion-item__right:has(.gov-accordion-item__suffix),.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__right:has(.gov-accordion-item__suffix){transform:translateY(var(--gov-accordion-m-icon-position, 0.25rem))}.gov-accordion-item[size=m] .gov-accordion-item__arrow,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__arrow{width:var(--gov-accordion-m-icon-size, 1.5rem);height:var(--gov-accordion-m-icon-size, 1.5rem)}.gov-accordion-item[size=m] .gov-accordion-item__content,.gov-accordion-item .gov-accordion-item[size=m] .gov-accordion-item__content{padding:var(--gov-accordion-m-padding-inner, 1.25rem 0.5rem)}.gov-accordion-item[size=l] .gov-accordion-item__header,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__header{gap:var(--gov-accordion-l-headline-gap, 1rem);min-height:var(--gov-accordion-l-min-height, 5.5rem);padding:var(--gov-accordion-l-padding-y, 1.375rem) var(--gov-accordion-l-padding-x, 0.5rem)}.gov-accordion-item[size=l] .gov-accordion-item__icon,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__icon{width:calc(var(--gov-text-3xl-font-size) * 1.2);height:calc(var(--gov-text-3xl-font-size) * 1.2);transform:translateY(var(--gov-accordion-l-icon-position, 0.3125rem))}.gov-accordion-item[size=l] .gov-accordion-item__label *,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__label *{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing)}.gov-accordion-item[size=l] .gov-accordion-item__annotation,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__annotation{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-accordion-item[size=l] .gov-accordion-item__right,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__right{gap:var(--gov-accordion-l-headline-gap, 1rem);transform:translateY(var(--gov-accordion-l-arrow-position, 0.625rem))}.gov-accordion-item[size=l] .gov-accordion-item__right:has(.gov-accordion-item__suffix),.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__right:has(.gov-accordion-item__suffix){transform:translateY(var(--gov-accordion-l-icon-position, 0.3125rem))}.gov-accordion-item[size=l] .gov-accordion-item__arrow,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__arrow{width:var(--gov-accordion-l-icon-size, 1.5rem);height:var(--gov-accordion-l-icon-size, 1.5rem)}.gov-accordion-item[size=l] .gov-accordion-item__content,.gov-accordion-item .gov-accordion-item[size=l] .gov-accordion-item__content{padding:var(--gov-accordion-l-padding-inner, 1.25rem 0.5rem)}.gov-accordion-item[variant=primary] .gov-accordion-item::before{background-color:var(--gov-accordion-primary-separator, var(--gov-color-secondary-500))}.gov-accordion-item[variant=primary] .gov-accordion-item__header{background-color:var(--gov-accordion-primary-background, transparent);color:var(--gov-accordion-primary-color, var(--gov-color-primary))}@media not all and (pointer: coarse){.gov-accordion-item[variant=primary] .gov-accordion-item__header:hover{background-color:var(--gov-accordion-primary-background-hover, var(--gov-color-primary-200))}}.gov-accordion-item[variant=primary][disabled=""] .gov-accordion-item__header,.gov-accordion-item[variant=primary][disabled=true i] .gov-accordion-item__header,.gov-accordion-item[variant=primary][disabled="1"] .gov-accordion-item__header{color:var(--gov-accordion-primary-disabled-color, var(--gov-color-primary-400))}@media not all and (pointer: coarse){.gov-accordion-item[variant=primary][disabled=""] .gov-accordion-item__header:hover,.gov-accordion-item[variant=primary][disabled=true i] .gov-accordion-item__header:hover,.gov-accordion-item[variant=primary][disabled="1"] .gov-accordion-item__header:hover{background:transparent;cursor:not-allowed}}.gov-accordion-item[variant=secondary] .gov-accordion-item::before{background-color:var(--gov-accordion-secondary-separator, var(--gov-color-secondary-500))}.gov-accordion-item[variant=secondary] .gov-accordion-item__header{background-color:var(--gov-accordion-secondary-background, transparent);color:var(--gov-accordion-secondary-color, var(--gov-color-secondary))}@media not all and (pointer: coarse){.gov-accordion-item[variant=secondary] .gov-accordion-item__header:hover{background-color:var(--gov-accordion-secondary-background-hover, var(--gov-color-secondary-200))}}.gov-accordion-item[variant=secondary][disabled=""] .gov-accordion-item__header,.gov-accordion-item[variant=secondary][disabled=true i] .gov-accordion-item__header,.gov-accordion-item[variant=secondary][disabled="1"] .gov-accordion-item__header{color:var(--gov-accordion-secondary-disabled-color, var(--gov-color-secondary-600))}@media not all and (pointer: coarse){.gov-accordion-item[variant=secondary][disabled=""] .gov-accordion-item__header:hover,.gov-accordion-item[variant=secondary][disabled=true i] .gov-accordion-item__header:hover,.gov-accordion-item[variant=secondary][disabled="1"] .gov-accordion-item__header:hover{background:transparent;cursor:not-allowed}}@media (max-width: 47.99em){.gov-accordion-item__title{flex-wrap:wrap}.gov-accordion-item__label{flex:0 0 auto}}';const p=o(class o extends i{constructor(){super();this.__registerHost();this.govChange=e(this,"gov-change",7);this.isExpandedState=undefined;this.variant=undefined;this.identifier=undefined;this.size=undefined;this.disabled=false;this.isExpanded=false;this.h=s(this.host);this.triggerId=v("GovAccordionItem");this.contentId=v("GovAccordionContent")}validateSize(o){t(d,o,c.root)}validateVariant(o){t(g,o,c.root)}emmitChange(){this.govChange.emit({open:this.isExpanded,component:c.root,ref:this.host})}componentWillLoad(){this.getPropsFromParents();this.validateSize(this.size);this.validateVariant(this.variant)}getPropsFromParents(){const o=this.h.getParent(n.root);if(o){this.size=o.getAttribute("size");this.variant=o.getAttribute("variant")}}render(){const o=this.identifier||this.triggerId;const i=this.contentId;return a(r,{class:this.h.classes(c.root),size:this.size,variant:this.variant,role:"listitem"},a("button",{id:o,class:c.header,"aria-expanded":m(this.isExpanded),"aria-controls":i,disabled:this.disabled,type:"button","aria-disabled":l(this.disabled),onClick:o=>{o.stopPropagation();this.toggle().finally()}},this.h.hasSlot("icon")&&a("span",{class:c.icon},a("slot",{name:"icon"})),a("span",{class:c.title},a("span",{class:c.label},a("slot",{name:"label"})),this.h.hasSlot("annotation")&&a("span",{class:c.annotation},a("slot",{name:"annotation"}))),a("span",{class:c.right},this.h.hasSlot("suffix")&&a("span",{class:c.suffix},a("slot",{name:"suffix"})),a("span",{class:c.arrow},this.h.hasSlot("toggle-icon")?a("slot",{name:"toggle-icon"}):a("gov-icon",{name:"chevron-down"})))),a("div",{class:c.content,id:i,"aria-hidden":m(!this.isExpanded),hidden:!this.isExpanded,"aria-labelledby":o},a("slot",null)))}async open(){this.isExpanded=true;this.emmitChange()}async close(){this.isExpanded=false;this.emmitChange()}async toggle(){this.isExpanded=!this.isExpanded;this.emmitChange()}async currentState(){return this.isExpanded}get host(){return this}static get watchers(){return{size:["validateSize"],variant:["validateVariant"]}}static get style(){return _}},[4,"gov-accordion-item",{variant:[1],identifier:[1],size:[1],disabled:[4],isExpanded:[1028,"is-expanded"],isExpandedState:[32],open:[64],close:[64],toggle:[64],currentState:[64]}]);function f(){if(typeof customElements==="undefined"){return}const o=["gov-accordion-item","gov-icon"];o.forEach((o=>{switch(o){case"gov-accordion-item":if(!customElements.get(o)){customElements.define(o,p)}break;case"gov-icon":if(!customElements.get(o)){h()}break}}))}f();const x=p;const z=f;export{x as GovAccordionItem,z as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-accordion-item.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-156b4f92.js";const t=o;const p=s;export{t as GovAttachmentsItem,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-attachments-item.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as r,h as a,d as o}from"./p-2dee9951.js";import{v as i}from"./p-4ff831e3.js";import{c as s}from"./p-003e6cca.js";import{d as c}from"./p-03990da5.js";import{g as l}from"./p-c353678b.js";import{d as n}from"./p-
|
|
1
|
+
import{p as e,H as t,c as r,h as a,d as o}from"./p-2dee9951.js";import{v as i}from"./p-4ff831e3.js";import{c as s}from"./p-003e6cca.js";import{d as c}from"./p-03990da5.js";import{g as l}from"./p-c353678b.js";import{d as n}from"./p-768b9ba0.js";import{d}from"./p-c3fdf866.js";const g={root:"gov-breadcrumbs"};const b='.gov-breadcrumbs ul{margin:0;padding:0}.gov-breadcrumbs li{margin:0;padding:0;background:none}.gov-breadcrumbs li::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-breadcrumbs{position:relative;display:flex;width:100%;justify-content:space-between;align-items:flex-start;gap:var(--gov-breadcrumbs-gap, 1rem)}.gov-breadcrumbs nav{overflow:hidden;width:100%}.gov-breadcrumbs ul{position:relative;display:flex;width:100%;flex-direction:column;gap:8px;margin-bottom:0}.gov-breadcrumbs li{display:flex;justify-content:flex-start;align-items:flex-start;margin-bottom:0 !important}.gov-breadcrumbs li .gov-icon{flex:0 0 auto;width:var(--gov-breadcrumbs-icon-size, 0.625rem);height:var(--gov-breadcrumbs-icon-size, 0.625rem);margin:calc((24px - var(--gov-breadcrumbs-icon-size, 0.625rem)) / 2) var(--gov-breadcrumbs-gap, 1rem) 0;color:var(--gov-breadcrumbs-arrow-color, var(--gov-color-secondary-600))}.gov-breadcrumbs li>a:first-child,.gov-breadcrumbs li>button:first-child{margin-left:calc(var(--gov-breadcrumbs-icon-size, 0.625rem) + 2 * var(--gov-breadcrumbs-gap, 1rem))}.gov-breadcrumbs a{font-weight:var(--text-font-weight, var(--gov-text-m-font-weight));font-size:var(--text-font-size, var(--gov-text-m-font-size));line-height:var(--text-line-height, var(--gov-text-m-line-height));letter-spacing:var(--text-letter-spacing, var(--gov-text-m-letter-spacing));color:var(--gov-breadcrumbs-link-color, var(--gov-color-primary))}.gov-breadcrumbs button{font-weight:var(--text-font-weight, var(--gov-text-m-font-weight));font-size:var(--text-font-size, var(--gov-text-m-font-size));line-height:var(--text-line-height, var(--gov-text-m-line-height));letter-spacing:var(--text-letter-spacing, var(--gov-text-m-letter-spacing));color:var(--gov-breadcrumbs-link-color, var(--gov-color-primary));padding:0;border:none;background:none;text-decoration:underline}.gov-breadcrumbs[collapsed=""],.gov-breadcrumbs[collapsed=true i],.gov-breadcrumbs[collapsed="1"]{align-items:center}.gov-breadcrumbs[collapsed=""] ul,.gov-breadcrumbs[collapsed=true i] ul,.gov-breadcrumbs[collapsed="1"] ul{overflow-x:hidden;flex-direction:row}.gov-breadcrumbs[collapsed=""] li,.gov-breadcrumbs[collapsed=true i] li,.gov-breadcrumbs[collapsed="1"] li{align-items:center;white-space:nowrap}.gov-breadcrumbs[collapsed=""] li .gov-icon,.gov-breadcrumbs[collapsed=true i] li .gov-icon,.gov-breadcrumbs[collapsed="1"] li .gov-icon{margin-top:0}.gov-breadcrumbs[collapsed=""] li>a:first-child,.gov-breadcrumbs[collapsed=""] li>button:first-child,.gov-breadcrumbs[collapsed=true i] li>a:first-child,.gov-breadcrumbs[collapsed=true i] li>button:first-child,.gov-breadcrumbs[collapsed="1"] li>a:first-child,.gov-breadcrumbs[collapsed="1"] li>button:first-child{margin-left:0}';const m=e(class e extends t{constructor(){super();this.__registerHost();this.govChange=r(this,"gov-change",7);this.inited=false;this.collapsible=false;this.isExpanded=false;this.wcagLabel=undefined;this.wcagLabelledBy=undefined;this.wcagToggleLabel="Zobrazit či skrýt navigaci";this.collapsed=true;this.toggleOption=false;this.h=l(this.host)}async componentDidRender(){this.scheduleContentVerification();if(s()){await c(500);await this.validateWcag()}}scheduleContentVerification(){if(this.inited)return;this.inited=true;requestAnimationFrame((()=>{this.calculateWidthOfItems();this.inited=false}))}calculateWidthOfItems(){const e=this.host.getBoundingClientRect().width;let t=0;this.host.querySelectorAll("li").forEach((e=>{t+=e.getBoundingClientRect().width}));this.toggleOption=t>e}render(){return a(o,{class:this.h.classes(g.root),collapsed:this.collapsed},a("nav",{"aria-label":this.wcagLabel,"aria-labelledby":this.wcagLabelledBy},a("slot",null)),this.toggleOption?a("gov-button",{size:"xs",variant:"primary",type:"base",wcagLabel:this.wcagToggleLabel,wcagPressed:!this.collapsed,wcagExpanded:!this.collapsed,"on-gov-click":()=>this.collapsed=!this.collapsed},a("gov-icon",{name:this.collapsed?"chevron-down":"chevron-up"})):null)}async validateWcag(){i(this.wcagLabel,this.wcagLabelledBy,g.root);i(this.wcagToggleLabel,undefined,g.root)}get host(){return this}static get style(){return b}},[4,"gov-breadcrumbs",{collapsible:[4],isExpanded:[4,"is-expanded"],wcagLabel:[1,"wcag-label"],wcagLabelledBy:[1,"wcag-labeled-by"],wcagToggleLabel:[1,"wcag-toggle-label"],collapsed:[32],toggleOption:[32],validateWcag:[64]}]);function v(){if(typeof customElements==="undefined"){return}const e=["gov-breadcrumbs","gov-button","gov-icon"];e.forEach((e=>{switch(e){case"gov-breadcrumbs":if(!customElements.get(e)){customElements.define(e,m)}break;case"gov-button":if(!customElements.get(e)){n()}break;case"gov-icon":if(!customElements.get(e)){d()}break}}))}v();const u=m;const p=v;export{u as GovBreadcrumbs,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-breadcrumbs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-768b9ba0.js";const t=o;const a=s;export{t as GovButton,a as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-button.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as e,c as a,h as r,d as i}from"./p-2dee9951.js";import{g as t,b as d}from"./p-c353678b.js";import{c}from"./p-24636c53.js";import{a as s}from"./p-7f2c9830.js";import{v as n}from"./p-4ff831e3.js";import{c as l}from"./p-003e6cca.js";import{d as g}from"./p-03990da5.js";import{d as v}from"./p-
|
|
1
|
+
import{p as o,H as e,c as a,h as r,d as i}from"./p-2dee9951.js";import{g as t,b as d}from"./p-c353678b.js";import{c}from"./p-24636c53.js";import{a as s}from"./p-7f2c9830.js";import{v as n}from"./p-4ff831e3.js";import{c as l}from"./p-003e6cca.js";import{d as g}from"./p-03990da5.js";import{d as v}from"./p-c3fdf866.js";const h={root:"gov-card",header:"gov-card__header",title:"gov-card__title",inner:"gov-card__inner",img:"gov-card__img",main:"gov-card__main",content:"gov-card__content",icon:"gov-card__icon",btns:"gov-card__btns",footer:"gov-card__footer",arrow:"gov-card__arrow"};const p='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-card{position:relative;display:flex;width:100%;flex-direction:column;border:var(--gov-card-border-width, 0.0625rem solid var(--gov-color-secondary-500));border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-card-bg, var(--gov-color-neutral-white));overflow:hidden}.gov-card__header{gap:1.75rem;width:100%;padding:1.5rem;border-bottom:var(--gov-card-border-width, 0.0625rem solid var(--gov-color-secondary-500));border-radius:0;text-align:left;text-transform:none;transition:background-color 150ms ease-in-out}.gov-card__arrow{flex:0 0 auto;width:1rem;height:1rem;color:var(--gov-card-arrow-color, var(--gov-color-primary))}.gov-card__title{margin:0;padding:0;font-family:var(--gov-font-family, "Roboto", sans-serif);font-weight:400;box-sizing:border-box;font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing);color:var(--gov-card-title-color, var(--gov-color-secondary-800));font-weight:700}.gov-card__img{width:100%;margin:0;line-height:1}.gov-card__img img{width:100%;height:auto}.gov-card__inner{display:flex;flex:1 1 auto;flex-direction:column}.gov-card__inner[aria-hidden=""],.gov-card__inner[aria-hidden=true i],.gov-card__inner[aria-hidden="1"]{display:none}.gov-card__main{display:flex;gap:16px 24px;flex:1 1 auto;flex-direction:column;padding:1.5rem}.gov-card__icon{flex:0 0 auto;width:2.5rem;height:2.5rem;color:var(--gov-card-icon-color, var(--gov-color-primary))}.gov-card__btns{display:flex;gap:1rem;flex:0 0 auto;flex-wrap:wrap}.gov-card__content>*:last-child{margin-bottom:0}.gov-card__footer{padding:1rem 1.5rem;background:var(--gov-card-footer-bg, var(--gov-color-primary-100))}.gov-card__footer>*:last-child{margin-bottom:0}.gov-card__footer p{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing)}.gov-card[is-expanded=""],.gov-card[is-expanded=true i],.gov-card[is-expanded="1"]{height:100%}.gov-card[collapsible=""] .gov-card__header,.gov-card[collapsible=true i] .gov-card__header,.gov-card[collapsible="1"] .gov-card__header{display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;border:0;background-color:transparent;text-align:center;text-decoration:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;justify-content:space-between;text-align:left}.gov-card[collapsible=""] .gov-card__header:focus,.gov-card[collapsible=true i] .gov-card__header:focus,.gov-card[collapsible="1"] .gov-card__header:focus{outline:none}.gov-card[collapsible=""] .gov-card__header:focus,.gov-card[collapsible=true i] .gov-card__header:focus,.gov-card[collapsible="1"] .gov-card__header:focus{outline:none}.gov-card[collapsible=""] .gov-card__header:focus-visible,.gov-card[collapsible=true i] .gov-card__header:focus-visible,.gov-card[collapsible="1"] .gov-card__header:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:-0.125rem}@media not all and (pointer: coarse){.gov-card[collapsible=""] .gov-card__header:hover,.gov-card[collapsible=true i] .gov-card__header:hover,.gov-card[collapsible="1"] .gov-card__header:hover{background:var(--gov-card-header-hover-bg, var(--gov-color-primary-100))}}.gov-card[collapsible=""][is-expanded=""] .gov-card__header,.gov-card[collapsible=""][is-expanded=true i] .gov-card__header,.gov-card[collapsible=""][is-expanded="1"] .gov-card__header,.gov-card[collapsible=true i][is-expanded=""] .gov-card__header,.gov-card[collapsible=true i][is-expanded=true i] .gov-card__header,.gov-card[collapsible=true i][is-expanded="1"] .gov-card__header,.gov-card[collapsible="1"][is-expanded=""] .gov-card__header,.gov-card[collapsible="1"][is-expanded=true i] .gov-card__header,.gov-card[collapsible="1"][is-expanded="1"] .gov-card__header{border-bottom:var(--gov-card-border-width, 0.0625rem solid var(--gov-color-secondary-500))}.gov-card[collapsible=""][is-expanded=""] .gov-card__arrow,.gov-card[collapsible=""][is-expanded=true i] .gov-card__arrow,.gov-card[collapsible=""][is-expanded="1"] .gov-card__arrow,.gov-card[collapsible=true i][is-expanded=""] .gov-card__arrow,.gov-card[collapsible=true i][is-expanded=true i] .gov-card__arrow,.gov-card[collapsible=true i][is-expanded="1"] .gov-card__arrow,.gov-card[collapsible="1"][is-expanded=""] .gov-card__arrow,.gov-card[collapsible="1"][is-expanded=true i] .gov-card__arrow,.gov-card[collapsible="1"][is-expanded="1"] .gov-card__arrow{transform:scale(-1)}@media (min-width: 30em){.gov-card[promotion=""] .gov-card__main,.gov-card[promotion=true i] .gov-card__main,.gov-card[promotion="1"] .gov-card__main{flex-direction:row;padding:2rem}.gov-card[promotion=""] .gov-card__icon,.gov-card[promotion=true i] .gov-card__icon,.gov-card[promotion="1"] .gov-card__icon{width:3rem;height:3rem}.gov-card[promotion=""] .gov-card__btns,.gov-card[promotion=true i] .gov-card__btns,.gov-card[promotion="1"] .gov-card__btns{flex-direction:column}}';const _=o(class o extends e{constructor(){super();this.__registerHost();this.govToggle=a(this,"gov-toggle",7);this.promotion=false;this.label=undefined;this.collapsible=false;this.expanded=false;this.headlineTag="h3";this.wcagTriggerLabel=undefined;this.wcagTriggerLabelledBy=undefined;this.isExpanded=undefined;this.h=t(this.host);this.headlineId=c("GovCardHeadline");this.contentId=c("GovCardContent")}validateHeadlineTag(o){const e=["h1","h2","h3","h4","h5","h6","span"];if(o){if(!e.includes(o)){s(`[${h.root}]: Tag ${o} is not allowed.`)}}}componentWillLoad(){this.isExpanded=this.label?this.expanded:true;this.validateHeadlineTag(this.headlineTag)}async componentDidRender(){if(l()){await g(500);await this.validateWcag()}}emmitChange(){this.govToggle.emit({open:this.isExpanded,element:this.host})}render(){const o=this.headlineTag;return r(i,{class:this.h.classes(h.root),"is-expanded":this.isExpanded,collapsible:d(this.collapsible),promotion:this.promotion},this.label&&this.collapsible?r("button",{id:this.headlineId,class:h.header,"aria-label":this.wcagTriggerLabel,"aria-labelledby":this.wcagTriggerLabelledBy,"aria-expanded":d(this.isExpanded),"aria-controls":this.contentId,onClick:this.onClickHandler.bind(this)},r(o,{class:h.title},this.label),r("gov-icon",{class:h.arrow,name:"chevron-down"})):null,this.label&&!this.collapsible?r("div",{class:h.header},r(o,{class:h.title},this.label)):null,r("div",{class:h.inner,id:this.contentId,"aria-hidden":this.collapsible?d(!this.isExpanded):undefined,hidden:this.collapsible?!this.isExpanded:undefined,"aria-labelledby":this.collapsible?this.headlineId:undefined},this.h.hasSlot("img")&&r("p",{class:h.img},r("slot",{name:"img"})),r("div",{class:h.main},this.h.hasSlot("icon")&&this.promotion&&r("div",{class:h.icon},r("slot",{name:"icon"})),r("div",{class:h.content},r("slot",null)),this.h.hasSlot("btn")&&this.promotion&&r("div",{class:h.btns},r("slot",{name:"btn"}))),this.h.hasSlot("footer")&&r("div",{class:h.footer},r("slot",{name:"footer"}))))}onClickHandler(o){o.stopPropagation();if(this.collapsible){this.isExpanded=!this.isExpanded;this.emmitChange()}}async open(){if(this.collapsible){this.isExpanded=true;this.emmitChange()}}async close(){if(this.collapsible){this.isExpanded=false;this.emmitChange()}}async validateWcag(){if(this.collapsible){n(this.wcagTriggerLabel,this.wcagTriggerLabelledBy,h.root)}}get host(){return this}static get watchers(){return{headlineTag:["validateHeadlineTag"]}}static get style(){return p}},[4,"gov-card",{promotion:[4],label:[1],collapsible:[4],expanded:[4],headlineTag:[1,"headline-tag"],wcagTriggerLabel:[1,"wcag-trigger-label"],wcagTriggerLabelledBy:[1,"wcag-trigger-labelled-by"],isExpanded:[32],open:[64],close:[64],validateWcag:[64]}]);function m(){if(typeof customElements==="undefined"){return}const o=["gov-card","gov-icon"];o.forEach((o=>{switch(o){case"gov-card":if(!customElements.get(o)){customElements.define(o,_)}break;case"gov-icon":if(!customElements.get(o)){v()}break}}))}m();const f=_;const b=m;export{f as GovCard,b as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-card.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-f45783e0.js";const t=o;const p=s;export{t as GovChip,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-chip.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-2bdd00a0.js";const t=o;const a=s;export{t as GovFormAutocomplete,a as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-autocomplete.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as e,c as r,h as c,d as i}from"./p-2dee9951.js";import{c as a}from"./p-24636c53.js";import{v as t}from"./p-dcb5fb35.js";import{g as s,f as h,h as n}from"./p-f04382c3.js";import{g as v,a as l,t as m}from"./p-c353678b.js";import{b as g,c as b}from"./p-4ff831e3.js";import{c as f}from"./p-003e6cca.js";import{d}from"./p-03990da5.js";import{F as k}from"./p-1c1d0bbe.js";import{d as x}from"./p-16ce28bd.js";const p='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-checkbox{cursor:pointer}.gov-form-checkbox input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-checkbox input+span{position:relative;display:block;cursor:pointer}.gov-form-checkbox input+span::before{content:"";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-checkbox .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-checkbox input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=""].gov-form-checkbox .gov-form-label__label,[invalid=true i].gov-form-checkbox .gov-form-label__label,[invalid="1"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-checkbox input+span::before,[invalid=true i].gov-form-checkbox input+span::before,[invalid="1"].gov-form-checkbox input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=""].gov-form-checkbox,[disabled=true i].gov-form-checkbox,[disabled="1"].gov-form-checkbox{pointer-events:none}[disabled=""].gov-form-checkbox .gov-form-label__label,[disabled=true i].gov-form-checkbox .gov-form-label__label,[disabled="1"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-checkbox input+span::before,[disabled=true i].gov-form-checkbox input+span::before,[disabled="1"].gov-form-checkbox input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-checkbox{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-checkbox{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-checkbox{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-checkbox{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-checkbox input+span::before{border-radius:var(--gov-border-radius, 0.1875rem)}.gov-form-checkbox__check{position:absolute;color:var(--gov-form-checkbox-check-color, var(--gov-color-neutral-white));opacity:0;transition:150ms linear opacity}.gov-form-checkbox__label{position:relative}.gov-form-checkbox input:checked+span::before{background:var(--gov-form-checkbox-indicator-bg, var(--gov-color-primary))}input:checked+span .gov-form-checkbox__check{opacity:1}.gov-form-checkbox[invalid=""] input:checked+span::before,.gov-form-checkbox[invalid=true i] input:checked+span::before,.gov-form-checkbox[invalid="1"] input:checked+span::before{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-checkbox[disabled=""] input:checked+span::before,.gov-form-checkbox[disabled=true i] input:checked+span::before,.gov-form-checkbox[disabled="1"] input:checked+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400));background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-checkbox[size=xs] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-xs-check-size, 0.75rem);height:var(--gov-form-checkbox-core-xs-check-size, 0.75rem)}.gov-form-checkbox[size=s] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);width:var(--gov-form-checkbox-core-s-check-size, 0.825rem);height:var(--gov-form-checkbox-core-s-check-size, 0.825rem)}.gov-form-checkbox[size=m] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);width:var(--gov-form-checkbox-core-m-check-size, 0.9rem);height:var(--gov-form-checkbox-core-m-check-size, 0.9rem)}.gov-form-checkbox[size=l] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);width:var(--gov-form-checkbox-core-l-check-size, 1.2rem);height:var(--gov-form-checkbox-core-l-check-size, 1.2rem)}';const u=o(class o extends e{constructor(){super();this.__registerHost();this.govFocus=r(this,"gov-focus",7);this.govBlur=r(this,"gov-blur",7);this.govChange=r(this,"gov-change",7);this.hydrated=false;this.value=undefined;this.checked=false;this.required=false;this.disabled=false;this.name=undefined;this.size="m";this.identifier=undefined;this.noLabel=false;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.checkboxId=a("GovCheckbox");this.h=v(this.host);this.f=s(this.h)}validateSize(o){t(n,o,h.root)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",l(this.invalid))}componentWillLoad(){this.f.passAttrToControl("type","checkbox");this.passControlAttrs()}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.checkboxId);this.f.passAttrToLabel("required",String(this.required));if(f()){await d(500);await this.validateWcag()}}connectedCallback(){this.hydrated=true}render(){const o=o=>{if(this.noLabel){return c("label",{class:h.label},o)}return o};return c(i,{class:h.root,hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:m(this.invalid)},o(c(k,null,c("input",{id:this.identifier||this.checkboxId,type:"checkbox",value:this.value,name:this.name,checked:this.checked,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,ref:o=>this.inputRef=o,"aria-checked":l(this.checked),"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":m(this.disabled)}),c("span",null,c("slot",{name:"label"}),c("gov-icon",{class:h.check,name:"check-lg"})))))}onFocusHandler(o){o.stopPropagation();this.govFocus.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}onBlurHandler(o){o.stopPropagation();this.govBlur.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}onClickHandler(o){o.stopPropagation()}onChangeHandler(o){this.checked=o.target.checked;o.stopPropagation();this.govChange.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}async getRef(){return this.inputRef}async validateWcag(){g(this.wcagDescribedBy,"wcag-described-by",h.root);g(this.wcagLabelledBy,"wcag-labelled-by",h.root);b(this.identifier||this.checkboxId,this.wcagLabelledBy,h.root)}get host(){return this}static get watchers(){return{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}}static get style(){return p}},[4,"gov-form-checkbox",{value:[1],checked:[1540],required:[4],disabled:[4],name:[1],size:[1],identifier:[1],noLabel:[4,"no-label"],invalid:[4],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],getRef:[64],validateWcag:[64]}]);function z(){if(typeof customElements==="undefined"){return}const o=["gov-form-checkbox","gov-icon"];o.forEach((o=>{switch(o){case"gov-form-checkbox":if(!customElements.get(o)){customElements.define(o,u)}break;case"gov-icon":if(!customElements.get(o)){x()}break}}))}z();const w=u;const y=z;export{w as GovFormCheckbox,y as defineCustomElement};
|
|
1
|
+
import{p as o,H as e,c as r,h as c,d as i}from"./p-2dee9951.js";import{c as a}from"./p-24636c53.js";import{v as t}from"./p-dcb5fb35.js";import{g as s,f as h,h as n}from"./p-f04382c3.js";import{g as v,a as l,t as m}from"./p-c353678b.js";import{b as g,c as b}from"./p-4ff831e3.js";import{c as f}from"./p-003e6cca.js";import{d}from"./p-03990da5.js";import{F as k}from"./p-1c1d0bbe.js";import{d as x}from"./p-c3fdf866.js";const p='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-checkbox{cursor:pointer}.gov-form-checkbox input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-checkbox input+span{position:relative;display:block;cursor:pointer}.gov-form-checkbox input+span::before{content:"";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-checkbox .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-checkbox input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=""].gov-form-checkbox .gov-form-label__label,[invalid=true i].gov-form-checkbox .gov-form-label__label,[invalid="1"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-checkbox input+span::before,[invalid=true i].gov-form-checkbox input+span::before,[invalid="1"].gov-form-checkbox input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=""].gov-form-checkbox,[disabled=true i].gov-form-checkbox,[disabled="1"].gov-form-checkbox{pointer-events:none}[disabled=""].gov-form-checkbox .gov-form-label__label,[disabled=true i].gov-form-checkbox .gov-form-label__label,[disabled="1"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-checkbox input+span::before,[disabled=true i].gov-form-checkbox input+span::before,[disabled="1"].gov-form-checkbox input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-checkbox{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-checkbox{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-checkbox{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-checkbox{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-checkbox input+span::before{border-radius:var(--gov-border-radius, 0.1875rem)}.gov-form-checkbox__check{position:absolute;color:var(--gov-form-checkbox-check-color, var(--gov-color-neutral-white));opacity:0;transition:150ms linear opacity}.gov-form-checkbox__label{position:relative}.gov-form-checkbox input:checked+span::before{background:var(--gov-form-checkbox-indicator-bg, var(--gov-color-primary))}input:checked+span .gov-form-checkbox__check{opacity:1}.gov-form-checkbox[invalid=""] input:checked+span::before,.gov-form-checkbox[invalid=true i] input:checked+span::before,.gov-form-checkbox[invalid="1"] input:checked+span::before{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-checkbox[disabled=""] input:checked+span::before,.gov-form-checkbox[disabled=true i] input:checked+span::before,.gov-form-checkbox[disabled="1"] input:checked+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400));background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-checkbox[size=xs] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-xs-check-size, 0.75rem);height:var(--gov-form-checkbox-core-xs-check-size, 0.75rem)}.gov-form-checkbox[size=s] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);width:var(--gov-form-checkbox-core-s-check-size, 0.825rem);height:var(--gov-form-checkbox-core-s-check-size, 0.825rem)}.gov-form-checkbox[size=m] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);width:var(--gov-form-checkbox-core-m-check-size, 0.9rem);height:var(--gov-form-checkbox-core-m-check-size, 0.9rem)}.gov-form-checkbox[size=l] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);width:var(--gov-form-checkbox-core-l-check-size, 1.2rem);height:var(--gov-form-checkbox-core-l-check-size, 1.2rem)}';const u=o(class o extends e{constructor(){super();this.__registerHost();this.govFocus=r(this,"gov-focus",7);this.govBlur=r(this,"gov-blur",7);this.govChange=r(this,"gov-change",7);this.hydrated=false;this.value=undefined;this.checked=false;this.required=false;this.disabled=false;this.name=undefined;this.size="m";this.identifier=undefined;this.noLabel=false;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.checkboxId=a("GovCheckbox");this.h=v(this.host);this.f=s(this.h)}validateSize(o){t(n,o,h.root)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",l(this.invalid))}componentWillLoad(){this.f.passAttrToControl("type","checkbox");this.passControlAttrs()}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.checkboxId);this.f.passAttrToLabel("required",String(this.required));if(f()){await d(500);await this.validateWcag()}}connectedCallback(){this.hydrated=true}render(){const o=o=>{if(this.noLabel){return c("label",{class:h.label},o)}return o};return c(i,{class:h.root,hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:m(this.invalid)},o(c(k,null,c("input",{id:this.identifier||this.checkboxId,type:"checkbox",value:this.value,name:this.name,checked:this.checked,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,ref:o=>this.inputRef=o,"aria-checked":l(this.checked),"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":m(this.disabled)}),c("span",null,c("slot",{name:"label"}),c("gov-icon",{class:h.check,name:"check-lg"})))))}onFocusHandler(o){o.stopPropagation();this.govFocus.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}onBlurHandler(o){o.stopPropagation();this.govBlur.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}onClickHandler(o){o.stopPropagation()}onChangeHandler(o){this.checked=o.target.checked;o.stopPropagation();this.govChange.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}async getRef(){return this.inputRef}async validateWcag(){g(this.wcagDescribedBy,"wcag-described-by",h.root);g(this.wcagLabelledBy,"wcag-labelled-by",h.root);b(this.identifier||this.checkboxId,this.wcagLabelledBy,h.root)}get host(){return this}static get watchers(){return{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}}static get style(){return p}},[4,"gov-form-checkbox",{value:[1],checked:[1540],required:[4],disabled:[4],name:[1],size:[1],identifier:[1],noLabel:[4,"no-label"],invalid:[4],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],getRef:[64],validateWcag:[64]}]);function z(){if(typeof customElements==="undefined"){return}const o=["gov-form-checkbox","gov-icon"];o.forEach((o=>{switch(o){case"gov-form-checkbox":if(!customElements.get(o)){customElements.define(o,u)}break;case"gov-icon":if(!customElements.get(o)){x()}break}}))}z();const w=u;const y=z;export{w as GovFormCheckbox,y as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-checkbox.js.map
|