@gov-design-system-ce/components 4.0.8-rc07 → 4.0.8-rc09
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-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +3 -3
- 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/autocomplete/gov-form-autocomplete.js.map +1 -1
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +3 -3
- 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-accordion.js +2 -1
- package/dist/components/gov-accordion.js.map +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-radio.js +2 -1
- package/dist/components/gov-form-radio.js.map +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-form-switch.js +2 -1
- package/dist/components/gov-form-switch.js.map +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-nav.js +2 -1
- package/dist/components/gov-nav.js.map +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-side-nav.js +2 -1
- package/dist/components/gov-side-nav.js.map +1 -1
- package/dist/components/gov-skeleton.js +2 -1
- package/dist/components/gov-skeleton.js.map +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/gov-wizard.js +2 -1
- package/dist/components/gov-wizard.js.map +1 -1
- package/dist/components/{p-d65d3380.js → p-04691758.js} +2 -2
- package/dist/components/{p-754d36f5.js → p-0fa5ab52.js} +2 -2
- package/dist/components/{p-7e260ed7.js → p-1653073c.js} +2 -2
- package/dist/components/{p-fe8d183d.js → p-16ce28bd.js} +2 -2
- package/dist/components/{p-eb4223bd.js → p-4f23b264.js} +2 -2
- package/dist/components/p-4ff831e3.js.map +1 -1
- package/dist/components/{p-3e9f24b6.js → p-b8bb638e.js} +2 -2
- package/dist/components/p-b9ee51d6.js +2 -1
- package/dist/components/p-b9ee51d6.js.map +1 -1
- package/dist/components/{p-3d7d9d2e.js → p-e20bdd6e.js} +2 -2
- package/dist/components/p-e20bdd6e.js.map +1 -0
- package/dist/components/p-f8b7ea69.js +2 -1
- package/dist/components/p-f8b7ea69.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/{p-a49391e5.entry.js → p-0e53df52.entry.js} +3 -2
- package/dist/core/p-0e53df52.entry.js.map +1 -0
- package/dist/core/{p-4b4a270d.entry.js → p-0f4f02a6.entry.js} +3 -2
- package/dist/core/p-0f4f02a6.entry.js.map +1 -0
- package/dist/core/{p-0702b541.entry.js → p-148613fd.entry.js} +3 -2
- package/dist/core/p-148613fd.entry.js.map +1 -0
- package/dist/core/{p-ead75342.entry.js → p-1ebf3575.entry.js} +3 -2
- package/dist/core/p-1ebf3575.entry.js.map +1 -0
- package/dist/core/{p-0ab12526.entry.js → p-28a50f60.entry.js} +3 -2
- package/dist/core/p-28a50f60.entry.js.map +1 -0
- package/dist/core/{p-64c5748e.entry.js → p-2d15339f.entry.js} +3 -2
- package/dist/core/p-2d15339f.entry.js.map +1 -0
- package/dist/core/{p-be8eec3f.entry.js → p-43fc5c70.entry.js} +3 -2
- package/dist/core/p-43fc5c70.entry.js.map +1 -0
- package/dist/core/{p-c20ee863.entry.js → p-46467293.entry.js} +3 -2
- package/dist/core/p-46467293.entry.js.map +1 -0
- package/dist/core/{p-467bf15a.entry.js → p-4d7ff31f.entry.js} +2 -2
- package/dist/core/p-542ce647.entry.js.map +1 -1
- package/dist/core/{p-9c00b909.entry.js → p-715dccc0.entry.js} +3 -2
- package/dist/core/p-715dccc0.entry.js.map +1 -0
- package/dist/core/p-71ca4aee.entry.js +3 -0
- package/dist/core/p-71ca4aee.entry.js.map +1 -0
- package/dist/core/p-7724b535.js.map +1 -1
- package/dist/core/{p-e4f11ddf.entry.js → p-7abfd047.entry.js} +3 -2
- package/dist/core/p-7abfd047.entry.js.map +1 -0
- package/dist/core/{p-c6a4ca41.entry.js → p-7d921045.entry.js} +3 -2
- package/dist/core/p-7d921045.entry.js.map +1 -0
- package/dist/core/{p-41550ab6.entry.js → p-973da3e6.entry.js} +2 -2
- package/dist/core/p-973da3e6.entry.js.map +1 -0
- package/dist/core/{p-3975851f.entry.js → p-ab1c25e7.entry.js} +3 -2
- package/dist/core/p-ab1c25e7.entry.js.map +1 -0
- package/dist/core/{p-f59b858f.entry.js → p-b88d732b.entry.js} +3 -2
- package/dist/core/p-b88d732b.entry.js.map +1 -0
- package/dist/core/{p-7f158b6f.entry.js → p-bdd4ee7c.entry.js} +3 -2
- package/dist/core/p-bdd4ee7c.entry.js.map +1 -0
- package/dist/core/{p-1cbd2c7c.entry.js → p-c67ddbd3.entry.js} +3 -2
- package/dist/core/p-c67ddbd3.entry.js.map +1 -0
- package/dist/core/{p-ed580ac7.entry.js → p-d6eed6df.entry.js} +3 -2
- package/dist/core/p-d6eed6df.entry.js.map +1 -0
- package/dist/core/{p-115f99f4.entry.js → p-f2f2c14a.entry.js} +3 -2
- package/dist/core/p-f2f2c14a.entry.js.map +1 -0
- package/dist/core/{p-f4f969d0.entry.js → p-f3967a1d.entry.js} +3 -2
- package/dist/core/p-f3967a1d.entry.js.map +1 -0
- package/dist/core/{p-39272558.entry.js → p-f6a4bf04.entry.js} +3 -2
- package/dist/core/p-f6a4bf04.entry.js.map +1 -0
- package/dist/core/{p-1fee1753.entry.js → p-ff3323bd.entry.js} +3 -2
- package/dist/core/p-ff3323bd.entry.js.map +1 -0
- package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +3 -3
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/globals.d.ts +2 -0
- package/dist/hydrate/index.js +3 -3
- package/dist/types/types/typings.d.ts +6 -0
- package/package.json +1 -1
- package/dist/components/p-3d7d9d2e.js.map +0 -1
- package/dist/core/p-0702b541.entry.js.map +0 -1
- package/dist/core/p-0ab12526.entry.js.map +0 -1
- package/dist/core/p-115f99f4.entry.js.map +0 -1
- package/dist/core/p-1cbd2c7c.entry.js.map +0 -1
- package/dist/core/p-1fee1753.entry.js.map +0 -1
- package/dist/core/p-39272558.entry.js.map +0 -1
- package/dist/core/p-3975851f.entry.js.map +0 -1
- package/dist/core/p-41550ab6.entry.js.map +0 -1
- package/dist/core/p-4b4a270d.entry.js.map +0 -1
- package/dist/core/p-64c5748e.entry.js.map +0 -1
- package/dist/core/p-7f158b6f.entry.js.map +0 -1
- package/dist/core/p-984b36f7.entry.js +0 -2
- package/dist/core/p-984b36f7.entry.js.map +0 -1
- package/dist/core/p-9c00b909.entry.js.map +0 -1
- package/dist/core/p-a49391e5.entry.js.map +0 -1
- package/dist/core/p-be8eec3f.entry.js.map +0 -1
- package/dist/core/p-c20ee863.entry.js.map +0 -1
- package/dist/core/p-c6a4ca41.entry.js.map +0 -1
- package/dist/core/p-e4f11ddf.entry.js.map +0 -1
- package/dist/core/p-ead75342.entry.js.map +0 -1
- package/dist/core/p-ed580ac7.entry.js.map +0 -1
- package/dist/core/p-f4f969d0.entry.js.map +0 -1
- package/dist/core/p-f59b858f.entry.js.map +0 -1
- /package/dist/components/{p-d65d3380.js.map → p-04691758.js.map} +0 -0
- /package/dist/components/{p-754d36f5.js.map → p-0fa5ab52.js.map} +0 -0
- /package/dist/components/{p-7e260ed7.js.map → p-1653073c.js.map} +0 -0
- /package/dist/components/{p-fe8d183d.js.map → p-16ce28bd.js.map} +0 -0
- /package/dist/components/{p-eb4223bd.js.map → p-4f23b264.js.map} +0 -0
- /package/dist/components/{p-3e9f24b6.js.map → p-b8bb638e.js.map} +0 -0
- /package/dist/core/{p-467bf15a.entry.js.map → p-4d7ff31f.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i,c as t,h as e,a as o,g as r}from"./p-5bc604a3.js";import{g as l,c as s,d as c,e as n}from"./p-61a2b12a.js";import{g as m,a,t as g}from"./p-5de606f8.js";import{c as v}from"./p-003e6cca.js";import{v as u}from"./p-dcb5fb35.js";import{a as f,b as h}from"./p-7724b535.js";import{c as d,r as p}from"./p-24636c53.js";import{d as z}from"./p-03990da5.js";import{p as x}from"./p-ab5a13ea.js";import{t as w}from"./p-8fcc8483.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-6278531b.js";import"./p-9dab01be.js";import"./p-3464136c.js";import"./p-7f2c9830.js";const b='.gov-form-multi-select__list{margin:0;padding:0}.gov-form-multi-select__list>.gov-form-multi-select__item{margin:0;padding:0;background:none}.gov-form-multi-select__list>.gov-form-multi-select__item::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-form-multi-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-multi-select .element{position:relative;display:flex;flex:1 1 auto}.gov-form-multi-select input,.gov-form-multi-select select,.gov-form-multi-select textarea{width:100%;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));font-family:var(--gov-font-family, "Roboto", sans-serif)}.gov-form-multi-select input:focus,.gov-form-multi-select select:focus,.gov-form-multi-select textarea:focus{outline:none}.gov-form-multi-select input:focus-visible,.gov-form-multi-select select:focus-visible,.gov-form-multi-select textarea: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-form-multi-select input::-moz-placeholder,.gov-form-multi-select select::-moz-placeholder,.gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select input::placeholder,.gov-form-multi-select select::placeholder,.gov-form-multi-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select textarea{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);padding:0.5rem 0.75rem;resize:none}.gov-form-multi-select *[slot=left-icon],.gov-form-multi-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-multi-select *[slot=left-icon]{left:0}.gov-form-multi-select *[slot=right-icon]{right:0}.gov-form-multi-select *[slot=prefix],.gov-form-multi-select *[slot=sufix]{margin:0}[size=s].gov-form-multi-select{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);gap:0.5rem var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select input,[size=s].gov-form-multi-select select{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);height:var(--gov-form-input-core-s-height, 2rem);padding:var(--gov-form-input-core-s-padding, 0.25rem 0.75rem)}[size=s].gov-form-multi-select *[slot=left-icon],[size=s].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-s-icon-size, 1rem);height:var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=right-icon]~input,[size=s].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-multi-select{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);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select input,[size=m].gov-form-multi-select select{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);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-multi-select *[slot=left-icon],[size=m].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=right-icon]~input,[size=m].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-multi-select{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);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select input,[size=l].gov-form-multi-select select{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);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-multi-select *[slot=left-icon],[size=l].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=right-icon]~input,[size=l].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-multi-select{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);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select input,[size=xl].gov-form-multi-select select{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);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-multi-select *[slot=left-icon],[size=xl].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=right-icon]~input,[size=xl].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-multi-select input,[variant=primary].gov-form-multi-select select,[variant=primary].gov-form-multi-select textarea{color:var(--gov-form-input-color-primary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}[variant=primary].gov-form-multi-select *[slot=left-icon],[variant=primary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-multi-select input,[variant=secondary].gov-form-multi-select select,[variant=secondary].gov-form-multi-select textarea{color:var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}[variant=secondary].gov-form-multi-select *[slot=left-icon],[variant=secondary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-multi-select,[disabled=true i].gov-form-multi-select,[disabled="1"].gov-form-multi-select{pointer-events:none}[disabled=""].gov-form-multi-select input,[disabled=""].gov-form-multi-select select,[disabled=""].gov-form-multi-select textarea,[disabled=true i].gov-form-multi-select input,[disabled=true i].gov-form-multi-select select,[disabled=true i].gov-form-multi-select textarea,[disabled="1"].gov-form-multi-select input,[disabled="1"].gov-form-multi-select select,[disabled="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-multi-select *[slot=left-icon],[disabled=""].gov-form-multi-select *[slot=right-icon],[disabled=true i].gov-form-multi-select *[slot=left-icon],[disabled=true i].gov-form-multi-select *[slot=right-icon],[disabled="1"].gov-form-multi-select *[slot=left-icon],[disabled="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600)) !important}[invalid=""].gov-form-multi-select input,[invalid=""].gov-form-multi-select select,[invalid=""].gov-form-multi-select textarea,[invalid=true i].gov-form-multi-select input,[invalid=true i].gov-form-multi-select select,[invalid=true i].gov-form-multi-select textarea,[invalid="1"].gov-form-multi-select input,[invalid="1"].gov-form-multi-select select,[invalid="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-multi-select input::-moz-placeholder,[invalid=""].gov-form-multi-select select::-moz-placeholder,[invalid=""].gov-form-multi-select textarea::-moz-placeholder,[invalid=true i].gov-form-multi-select input::-moz-placeholder,[invalid=true i].gov-form-multi-select select::-moz-placeholder,[invalid=true i].gov-form-multi-select textarea::-moz-placeholder,[invalid="1"].gov-form-multi-select input::-moz-placeholder,[invalid="1"].gov-form-multi-select select::-moz-placeholder,[invalid="1"].gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select input::placeholder,[invalid=""].gov-form-multi-select select::placeholder,[invalid=""].gov-form-multi-select textarea::placeholder,[invalid=true i].gov-form-multi-select input::placeholder,[invalid=true i].gov-form-multi-select select::placeholder,[invalid=true i].gov-form-multi-select textarea::placeholder,[invalid="1"].gov-form-multi-select input::placeholder,[invalid="1"].gov-form-multi-select select::placeholder,[invalid="1"].gov-form-multi-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select *[slot=left-icon],[invalid=""].gov-form-multi-select *[slot=right-icon],[invalid=true i].gov-form-multi-select *[slot=left-icon],[invalid=true i].gov-form-multi-select *[slot=right-icon],[invalid="1"].gov-form-multi-select *[slot=left-icon],[invalid="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error)) !important}[invalid=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[multiline=""].gov-form-multi-select *[slot=left-icon],[multiline=""].gov-form-multi-select *[slot=right-icon],[multiline=true i].gov-form-multi-select *[slot=left-icon],[multiline=true i].gov-form-multi-select *[slot=right-icon],[multiline="1"].gov-form-multi-select *[slot=left-icon],[multiline="1"].gov-form-multi-select *[slot=right-icon]{display:none}.gov-form-multi-select{background:none}.gov-form-multi-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-multi-select select::-ms-expand{display:none}[size=s].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-s-arrow-right-position, 0.75rem);width:var(--gov-form-select-s-arrow-size, 0.75rem);height:var(--gov-form-select-s-arrow-size, 0.75rem)}[size=s][invalid=""].gov-form-multi-select .icon-arrow,[size=s][invalid=true i].gov-form-multi-select .icon-arrow,[size=s][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=s][success=""].gov-form-multi-select .icon-arrow,[size=s][success=true i].gov-form-multi-select .icon-arrow,[size=s][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=m].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-m-arrow-right-position, 1rem);width:var(--gov-form-select-m-arrow-size, 0.75rem);height:var(--gov-form-select-m-arrow-size, 0.75rem)}[size=m][invalid=""].gov-form-multi-select .icon-arrow,[size=m][invalid=true i].gov-form-multi-select .icon-arrow,[size=m][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=m][success=""].gov-form-multi-select .icon-arrow,[size=m][success=true i].gov-form-multi-select .icon-arrow,[size=m][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=l].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-l-arrow-right-position, 1rem);width:var(--gov-form-select-l-arrow-size, 1rem);height:var(--gov-form-select-l-arrow-size, 1rem)}[size=l][invalid=""].gov-form-multi-select .icon-arrow,[size=l][invalid=true i].gov-form-multi-select .icon-arrow,[size=l][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=l][success=""].gov-form-multi-select .icon-arrow,[size=l][success=true i].gov-form-multi-select .icon-arrow,[size=l][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=xl].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-xl-arrow-right-position, 1.3125rem);width:var(--gov-form-select-xl-arrow-size, 1rem);height:var(--gov-form-select-xl-arrow-size, 1rem)}[size=xl][invalid=""].gov-form-multi-select .icon-arrow,[size=xl][invalid=true i].gov-form-multi-select .icon-arrow,[size=xl][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=xl][success=""].gov-form-multi-select .icon-arrow,[size=xl][success=true i].gov-form-multi-select .icon-arrow,[size=xl][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=s][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=m][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=l][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}.gov-form-multi-select{flex-wrap:wrap}.gov-form-multi-select__wrap{display:flex;align-items:center;gap:0.5rem;width:100%}.gov-form-multi-select__list{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:flex;gap:0.5rem;flex-wrap:wrap}.gov-form-multi-select__list>.gov-form-multi-select__item{position:relative;display:flex;flex:0 0 auto;align-items:center;padding:0rem 0rem 0rem 0.5rem;background:var(--gov-form-multiselect-bg, var(--gov-color-primary-200));transition:150ms linear background-color}';const y=class{constructor(e){i(this,e);this.govFocus=t(this,"gov-focus",7);this.govBlur=t(this,"gov-blur",7);this.govChange=t(this,"gov-change",7);this.govSelect=t(this,"gov-select",7);this.govRemove=t(this,"gov-remove",7);this.value=undefined;this.options=undefined;this.identifier=undefined;this.placeholder=undefined;this.variant=undefined;this.size="m";this.name=undefined;this.hideSelectedList=false;this.required=false;this.disabled=false;this.invalid=undefined;this.success=undefined;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.messageLoading="Načítám...";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.valueState=undefined;this.selectedOptionsState=[];this.optionsState=[];this.selectId=d("GovSelect");this.listId=d("GovMultiList");this.h=m(this.host);this.f=l(this.h)}validateVariant(i){u(c,i,s.root)}validateSize(i){u(n,i,s.root)}watchOptions(i){this.optionsState=x(i)}watchValue(i){this.selectedOptionsState=x(i)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",a(this.invalid));this.f.passAttrToControl("success",a(this.success))}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.watchDisabled();this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));this.optionsState=x(this.options);this.selectedOptionsState=x(this.value)}getAvailableOptions(i=false){if(Array.isArray(this.optionsState)&&this.optionsState.length){if(i){return this.optionsState}return this.optionsState.filter((i=>{const t=this.selectedValueIndex(i.value);return t!==-1||(i===null||i===void 0?void 0:i.disabled)?false:true})).map((i=>{var t;return{name:(t=i.label)!==null&&t!==void 0?t:i.value,value:i.value}}))}return Array.from(this.selectRef.querySelectorAll("option")).filter((t=>{if(i){return true}const e=this.selectedValueIndex(t.value);return!(t.disabled||t.selected||e>-1)})).map((i=>({name:i.textContent,value:i.value})))}initAutocomplete(){var i,t,e,o,r;(i=this.autocompleteRef)===null||i===void 0?void 0:i.addEventListener("gov-select",this.onSelectHandler.bind(this));(t=this.autocompleteRef)===null||t===void 0?void 0:t.addEventListener("gov-input",this.onInputHandler.bind(this));(e=this.autocompleteRef)===null||e===void 0?void 0:e.addEventListener("gov-focus",this.onFocusHandler.bind(this));(o=this.autocompleteRef)===null||o===void 0?void 0:o.addEventListener("gov-blur",this.onBlurHandler.bind(this));(r=this.autocompleteRef)===null||r===void 0?void 0:r.setSearchCallback((i=>new Promise((t=>{const e=this.getAvailableOptions();if(String(i).length===0){return t(e)}t(e.filter((({label:t,value:e})=>{if(!t)t=e;return p(t).toLowerCase().indexOf(p(i).toLowerCase())>-1})))})))).finally()}selectedValueIndex(i){return this.selectedOptionsState.findIndex((t=>t===i))}getOptionElement(i){return this.selectRef.querySelector('option[value="'+i+'"]')}getOption(i){var t;return(t=this.getAvailableOptions(true).find((t=>t.value===i)))!==null&&t!==void 0?t:null}selectOption(i,t=true){const e=this.selectedValueIndex(i);if(e===-1){this.selectedOptionsState=[...this.selectedOptionsState,i];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:s.root,value:this.selectedOptionsState});this.govSelect.emit({component:s.root,value:this.selectedOptionsState})}const e=this.getOptionElement(i);if(e){e.selected=true}}}removeOption(i,t=true){const e=this.selectedValueIndex(i);if(e!==-1){this.selectedOptionsState.splice(e,1);this.selectedOptionsState=[...this.selectedOptionsState];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:s.root,value:this.selectedOptionsState});this.govRemove.emit({component:s.root,value:this.selectedOptionsState})}const o=this.getOptionElement(i);if(o){o.selected=false}}}async componentDidLoad(){this.initAutocomplete()}async componentDidRender(){w((()=>{this.selectRef.querySelectorAll("option").forEach((i=>{if(i.selected){this.selectOption(i.value,false)}}))}));if(v()){await z(500);await this.validateWcag()}}render(){return e(o,{class:s.root,size:this.size,variant:this.variant},e("div",{class:s.wrap},this.h.hasSlot("prefix")&&e("slot",{name:"prefix"}),e("div",{class:"element"},e("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:i=>this.autocompleteRef=i,minlength:0,wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:this.listId}),e("gov-icon",{slot:"right-icon",class:"icon-arrow",name:"chevron-down"}),this.h.hasSlot("right-icon")&&!(this.success||this.invalid)&&e("slot",{name:"right-icon"}),this.success&&e("gov-icon",{slot:"right-icon",class:"icon-validation",name:"check-lg"}),this.invalid&&e("gov-icon",{slot:"right-icon",class:"icon-validation",name:"exclamation-lg"}),e("select",{hidden:true,class:"hidden-select-list","aria-hidden":a(true),multiple:true,required:this.required,name:this.name,disabled:this.disabled,ref:i=>this.selectRef=i,"aria-disabled":g(this.disabled),"aria-required":g(this.required),"aria-invalid":g(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns},e("slot",null),Array.isArray(this.optionsState)&&this.optionsState.map((i=>{var t;const o=this.selectedValueIndex(i.value);return e("option",{value:i.value,selected:o>-1,disabled:i===null||i===void 0?void 0:i.disabled},(t=i.label)!==null&&t!==void 0?t:i.value)})))),this.h.hasSlot("sufix")&&e("slot",{name:"sufix"})),this.hideSelectedList===false?e("ul",{role:"listbox",id:this.listId,class:s.list},Array.isArray(this.selectedOptionsState)&&this.selectedOptionsState.map((i=>{var t,o;const r=this.getOption(i);if(!r)return null;return e("li",{class:s.item,role:"option"},(t=r.label)!==null&&t!==void 0?t:r.value,e("gov-button",{wcagLabel:(o="Odebrat vybranou položku "+r.label)!==null&&o!==void 0?o:r.value,variant:"primary",type:"base",size:"s","on-gov-click":()=>this.onTagRemove(i)},e("gov-icon",{name:"x-lg"})))}))):null)}onFocusHandler(i){i.stopPropagation();this.focused=true;this.govFocus.emit({component:s.root,originalEvent:i,value:this.selectedOptionsState})}onBlurHandler(i){i.stopPropagation();i.stopPropagation();this.focused=false;this.govBlur.emit({component:s.root,originalEvent:i,value:this.selectedOptionsState})}onInputHandler(i){this.valueState=i.detail.value;i.stopPropagation()}onSelectHandler(i){i.stopPropagation();const t=i.detail.selected;this.selectOption(t.value);this.valueState="";this.autocompleteRef.clearValue().finally();this.autocompleteRef.focus()}onTagRemove(i){this.removeOption(i)}async setFocus(i){return this.selectRef.focus(i)}async setValue(i){this.valueState=i}async getRef(){return this.selectRef}async validateWcag(){f(this.wcagDescribedBy,"wcag-described-by",s.root);f(this.wcagLabelledBy,"wcag-labelled-by",s.root);f(this.wcagOwns,"wcag-owns",s.root);h(this.identifier||this.selectId,this.wcagLabelledBy,s.root)}get host(){return r(this)}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchDisabled"],options:["watchOptions"],value:["watchValue"],disabled:["watchDisabled"],invalid:["watchDisabled"],success:["watchDisabled"]}}};y.style=b;export{y as gov_form_multi_select};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as i,c as t,h as e,a as o,g as r}from"./p-5bc604a3.js";import{g as l,c as s,d as c,e as n}from"./p-61a2b12a.js";import{g as m,a,t as g}from"./p-5de606f8.js";import{c as v}from"./p-003e6cca.js";import{v as u}from"./p-dcb5fb35.js";import{a as f,b as h}from"./p-7724b535.js";import{c as d,r as p}from"./p-24636c53.js";import{d as z}from"./p-03990da5.js";import{p as x}from"./p-ab5a13ea.js";import{t as w}from"./p-8fcc8483.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-6278531b.js";import"./p-9dab01be.js";import"./p-3464136c.js";import"./p-7f2c9830.js";const b='.gov-form-multi-select__list{margin:0;padding:0}.gov-form-multi-select__list>.gov-form-multi-select__item{margin:0;padding:0;background:none}.gov-form-multi-select__list>.gov-form-multi-select__item::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-form-multi-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-multi-select .element{position:relative;display:flex;flex:1 1 auto}.gov-form-multi-select input,.gov-form-multi-select select,.gov-form-multi-select textarea{width:100%;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));font-family:var(--gov-font-family, "Roboto", sans-serif)}.gov-form-multi-select input:focus,.gov-form-multi-select select:focus,.gov-form-multi-select textarea:focus{outline:none}.gov-form-multi-select input:focus-visible,.gov-form-multi-select select:focus-visible,.gov-form-multi-select textarea: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-form-multi-select input::-moz-placeholder,.gov-form-multi-select select::-moz-placeholder,.gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select input::placeholder,.gov-form-multi-select select::placeholder,.gov-form-multi-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select textarea{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);padding:0.5rem 0.75rem;resize:none}.gov-form-multi-select *[slot=left-icon],.gov-form-multi-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-multi-select *[slot=left-icon]{left:0}.gov-form-multi-select *[slot=right-icon]{right:0}.gov-form-multi-select *[slot=prefix],.gov-form-multi-select *[slot=sufix]{margin:0}[size=s].gov-form-multi-select{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);gap:0.5rem var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select input,[size=s].gov-form-multi-select select{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);height:var(--gov-form-input-core-s-height, 2rem);padding:var(--gov-form-input-core-s-padding, 0.25rem 0.75rem)}[size=s].gov-form-multi-select *[slot=left-icon],[size=s].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-s-icon-size, 1rem);height:var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=right-icon]~input,[size=s].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-multi-select{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);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select input,[size=m].gov-form-multi-select select{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);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-multi-select *[slot=left-icon],[size=m].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=right-icon]~input,[size=m].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-multi-select{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);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select input,[size=l].gov-form-multi-select select{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);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-multi-select *[slot=left-icon],[size=l].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=right-icon]~input,[size=l].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-multi-select{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);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select input,[size=xl].gov-form-multi-select select{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);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-multi-select *[slot=left-icon],[size=xl].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=right-icon]~input,[size=xl].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-multi-select input,[variant=primary].gov-form-multi-select select,[variant=primary].gov-form-multi-select textarea{color:var(--gov-form-input-color-primary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}[variant=primary].gov-form-multi-select *[slot=left-icon],[variant=primary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-multi-select input,[variant=secondary].gov-form-multi-select select,[variant=secondary].gov-form-multi-select textarea{color:var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}[variant=secondary].gov-form-multi-select *[slot=left-icon],[variant=secondary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-multi-select,[disabled=true i].gov-form-multi-select,[disabled="1"].gov-form-multi-select{pointer-events:none}[disabled=""].gov-form-multi-select input,[disabled=""].gov-form-multi-select select,[disabled=""].gov-form-multi-select textarea,[disabled=true i].gov-form-multi-select input,[disabled=true i].gov-form-multi-select select,[disabled=true i].gov-form-multi-select textarea,[disabled="1"].gov-form-multi-select input,[disabled="1"].gov-form-multi-select select,[disabled="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-multi-select *[slot=left-icon],[disabled=""].gov-form-multi-select *[slot=right-icon],[disabled=true i].gov-form-multi-select *[slot=left-icon],[disabled=true i].gov-form-multi-select *[slot=right-icon],[disabled="1"].gov-form-multi-select *[slot=left-icon],[disabled="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600)) !important}[invalid=""].gov-form-multi-select input,[invalid=""].gov-form-multi-select select,[invalid=""].gov-form-multi-select textarea,[invalid=true i].gov-form-multi-select input,[invalid=true i].gov-form-multi-select select,[invalid=true i].gov-form-multi-select textarea,[invalid="1"].gov-form-multi-select input,[invalid="1"].gov-form-multi-select select,[invalid="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-multi-select input::-moz-placeholder,[invalid=""].gov-form-multi-select select::-moz-placeholder,[invalid=""].gov-form-multi-select textarea::-moz-placeholder,[invalid=true i].gov-form-multi-select input::-moz-placeholder,[invalid=true i].gov-form-multi-select select::-moz-placeholder,[invalid=true i].gov-form-multi-select textarea::-moz-placeholder,[invalid="1"].gov-form-multi-select input::-moz-placeholder,[invalid="1"].gov-form-multi-select select::-moz-placeholder,[invalid="1"].gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select input::placeholder,[invalid=""].gov-form-multi-select select::placeholder,[invalid=""].gov-form-multi-select textarea::placeholder,[invalid=true i].gov-form-multi-select input::placeholder,[invalid=true i].gov-form-multi-select select::placeholder,[invalid=true i].gov-form-multi-select textarea::placeholder,[invalid="1"].gov-form-multi-select input::placeholder,[invalid="1"].gov-form-multi-select select::placeholder,[invalid="1"].gov-form-multi-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select *[slot=left-icon],[invalid=""].gov-form-multi-select *[slot=right-icon],[invalid=true i].gov-form-multi-select *[slot=left-icon],[invalid=true i].gov-form-multi-select *[slot=right-icon],[invalid="1"].gov-form-multi-select *[slot=left-icon],[invalid="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error)) !important}[invalid=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[multiline=""].gov-form-multi-select *[slot=left-icon],[multiline=""].gov-form-multi-select *[slot=right-icon],[multiline=true i].gov-form-multi-select *[slot=left-icon],[multiline=true i].gov-form-multi-select *[slot=right-icon],[multiline="1"].gov-form-multi-select *[slot=left-icon],[multiline="1"].gov-form-multi-select *[slot=right-icon]{display:none}.gov-form-multi-select{background:none}.gov-form-multi-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-multi-select select::-ms-expand{display:none}[size=s].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-s-arrow-right-position, 0.75rem);width:var(--gov-form-select-s-arrow-size, 0.75rem);height:var(--gov-form-select-s-arrow-size, 0.75rem)}[size=s][invalid=""].gov-form-multi-select .icon-arrow,[size=s][invalid=true i].gov-form-multi-select .icon-arrow,[size=s][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=s][success=""].gov-form-multi-select .icon-arrow,[size=s][success=true i].gov-form-multi-select .icon-arrow,[size=s][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=m].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-m-arrow-right-position, 1rem);width:var(--gov-form-select-m-arrow-size, 0.75rem);height:var(--gov-form-select-m-arrow-size, 0.75rem)}[size=m][invalid=""].gov-form-multi-select .icon-arrow,[size=m][invalid=true i].gov-form-multi-select .icon-arrow,[size=m][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=m][success=""].gov-form-multi-select .icon-arrow,[size=m][success=true i].gov-form-multi-select .icon-arrow,[size=m][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=l].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-l-arrow-right-position, 1rem);width:var(--gov-form-select-l-arrow-size, 1rem);height:var(--gov-form-select-l-arrow-size, 1rem)}[size=l][invalid=""].gov-form-multi-select .icon-arrow,[size=l][invalid=true i].gov-form-multi-select .icon-arrow,[size=l][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=l][success=""].gov-form-multi-select .icon-arrow,[size=l][success=true i].gov-form-multi-select .icon-arrow,[size=l][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=xl].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-xl-arrow-right-position, 1.3125rem);width:var(--gov-form-select-xl-arrow-size, 1rem);height:var(--gov-form-select-xl-arrow-size, 1rem)}[size=xl][invalid=""].gov-form-multi-select .icon-arrow,[size=xl][invalid=true i].gov-form-multi-select .icon-arrow,[size=xl][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=xl][success=""].gov-form-multi-select .icon-arrow,[size=xl][success=true i].gov-form-multi-select .icon-arrow,[size=xl][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=s][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=m][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=l][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}.gov-form-multi-select{flex-wrap:wrap}.gov-form-multi-select__wrap{display:flex;align-items:center;gap:0.5rem;width:100%}.gov-form-multi-select__list{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:flex;gap:0.5rem;flex-wrap:wrap}.gov-form-multi-select__list>.gov-form-multi-select__item{position:relative;display:flex;flex:0 0 auto;align-items:center;padding:0rem 0rem 0rem 0.5rem;background:var(--gov-form-multiselect-bg, var(--gov-color-primary-200));transition:150ms linear background-color}';const y=class{constructor(e){i(this,e);this.govFocus=t(this,"gov-focus",7);this.govBlur=t(this,"gov-blur",7);this.govChange=t(this,"gov-change",7);this.govSelect=t(this,"gov-select",7);this.govRemove=t(this,"gov-remove",7);this.value=undefined;this.options=undefined;this.identifier=undefined;this.placeholder=undefined;this.variant=undefined;this.size="m";this.name=undefined;this.hideSelectedList=false;this.required=false;this.disabled=false;this.invalid=undefined;this.success=undefined;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.messageLoading="Načítám...";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.valueState=undefined;this.selectedOptionsState=[];this.optionsState=[];this.selectId=d("GovSelect");this.listId=d("GovMultiList");this.h=m(this.host);this.f=l(this.h)}validateVariant(i){u(c,i,s.root)}validateSize(i){u(n,i,s.root)}watchOptions(i){this.optionsState=x(i)}watchValue(i){this.selectedOptionsState=x(i)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",a(this.invalid));this.f.passAttrToControl("success",a(this.success))}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.watchDisabled();this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));this.optionsState=x(this.options);this.selectedOptionsState=x(this.value)}getAvailableOptions(i=false){if(Array.isArray(this.optionsState)&&this.optionsState.length){if(i){return this.optionsState}return this.optionsState.filter((i=>{const t=this.selectedValueIndex(i.value);return t!==-1||(i===null||i===void 0?void 0:i.disabled)?false:true})).map((i=>{var t;return{label:(t=i.label)!==null&&t!==void 0?t:i.value,value:i.value}}))}return Array.from(this.selectRef.querySelectorAll("option")).filter((t=>{if(i){return true}const e=this.selectedValueIndex(t.value);return!(t.disabled||t.selected||e>-1)})).map((i=>({label:i.textContent,value:i.value})))}initAutocomplete(){var i,t,e,o,r;(i=this.autocompleteRef)===null||i===void 0?void 0:i.addEventListener("gov-select",this.onSelectHandler.bind(this));(t=this.autocompleteRef)===null||t===void 0?void 0:t.addEventListener("gov-input",this.onInputHandler.bind(this));(e=this.autocompleteRef)===null||e===void 0?void 0:e.addEventListener("gov-focus",this.onFocusHandler.bind(this));(o=this.autocompleteRef)===null||o===void 0?void 0:o.addEventListener("gov-blur",this.onBlurHandler.bind(this));(r=this.autocompleteRef)===null||r===void 0?void 0:r.setSearchCallback((i=>new Promise((t=>{const e=this.getAvailableOptions();if(String(i).length===0){return t(e)}t(e.filter((({label:t,value:e})=>{if(!t)t=e;return p(t).toLowerCase().indexOf(p(i).toLowerCase())>-1})))})))).finally()}selectedValueIndex(i){return this.selectedOptionsState.findIndex((t=>t===i))}getOptionElement(i){return this.selectRef.querySelector('option[value="'+i+'"]')}getOption(i){var t;return(t=this.getAvailableOptions(true).find((t=>t.value===i)))!==null&&t!==void 0?t:null}selectOption(i,t=true){const e=this.selectedValueIndex(i);if(e===-1){this.selectedOptionsState=[...this.selectedOptionsState,i];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:s.root,value:this.selectedOptionsState});this.govSelect.emit({component:s.root,value:this.selectedOptionsState})}const e=this.getOptionElement(i);if(e){e.selected=true}}}removeOption(i,t=true){const e=this.selectedValueIndex(i);if(e!==-1){this.selectedOptionsState.splice(e,1);this.selectedOptionsState=[...this.selectedOptionsState];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:s.root,value:this.selectedOptionsState});this.govRemove.emit({component:s.root,value:this.selectedOptionsState})}const o=this.getOptionElement(i);if(o){o.selected=false}}}async componentDidLoad(){this.initAutocomplete()}async componentDidRender(){w((()=>{this.selectRef.querySelectorAll("option").forEach((i=>{if(i.selected){this.selectOption(i.value,false)}}))}));if(v()){await z(500);await this.validateWcag()}}render(){return e(o,{class:s.root,size:this.size,variant:this.variant},e("div",{class:s.wrap},this.h.hasSlot("prefix")&&e("slot",{name:"prefix"}),e("div",{class:"element"},e("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:i=>this.autocompleteRef=i,minlength:0,"name-key":"label",wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:this.listId}),e("gov-icon",{slot:"right-icon",class:"icon-arrow",name:"chevron-down"}),this.h.hasSlot("right-icon")&&!(this.success||this.invalid)&&e("slot",{name:"right-icon"}),this.success&&e("gov-icon",{slot:"right-icon",class:"icon-validation",name:"check-lg"}),this.invalid&&e("gov-icon",{slot:"right-icon",class:"icon-validation",name:"exclamation-lg"}),e("select",{hidden:true,class:"hidden-select-list","aria-hidden":a(true),multiple:true,required:this.required,name:this.name,disabled:this.disabled,ref:i=>this.selectRef=i,"aria-disabled":g(this.disabled),"aria-required":g(this.required),"aria-invalid":g(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns},e("slot",null),Array.isArray(this.optionsState)&&this.optionsState.map((i=>{var t;const o=this.selectedValueIndex(i.value);return e("option",{value:i.value,selected:o>-1,disabled:i===null||i===void 0?void 0:i.disabled},(t=i.label)!==null&&t!==void 0?t:i.value)})))),this.h.hasSlot("sufix")&&e("slot",{name:"sufix"})),this.hideSelectedList===false?e("ul",{role:"listbox",id:this.listId,class:s.list},Array.isArray(this.selectedOptionsState)&&this.selectedOptionsState.map((i=>{var t,o;const r=this.getOption(i);if(!r)return null;return e("li",{class:s.item,role:"option"},(t=r.label)!==null&&t!==void 0?t:r.value,e("gov-button",{wcagLabel:(o="Odebrat vybranou položku "+r.label)!==null&&o!==void 0?o:r.value,variant:"primary",type:"base",size:"s","on-gov-click":()=>this.onTagRemove(i)},e("gov-icon",{name:"x-lg"})))}))):null)}onFocusHandler(i){i.stopPropagation();this.focused=true;this.govFocus.emit({component:s.root,originalEvent:i,value:this.selectedOptionsState})}onBlurHandler(i){i.stopPropagation();i.stopPropagation();this.focused=false;this.govBlur.emit({component:s.root,originalEvent:i,value:this.selectedOptionsState})}onInputHandler(i){this.valueState=i.detail.value;i.stopPropagation()}onSelectHandler(i){i.stopPropagation();const t=i.detail.selected;this.selectOption(t.value);this.valueState="";this.autocompleteRef.clearValue().finally();this.autocompleteRef.focus()}onTagRemove(i){this.removeOption(i)}async setFocus(i){return this.selectRef.focus(i)}async setValue(i){this.valueState=i}async getRef(){return this.selectRef}async validateWcag(){f(this.wcagDescribedBy,"wcag-described-by",s.root);f(this.wcagLabelledBy,"wcag-labelled-by",s.root);f(this.wcagOwns,"wcag-owns",s.root);h(this.identifier||this.selectId,this.wcagLabelledBy,s.root)}get host(){return r(this)}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchDisabled"],options:["watchOptions"],value:["watchValue"],disabled:["watchDisabled"],invalid:["watchDisabled"],success:["watchDisabled"]}}};y.style=b;export{y as gov_form_multi_select};
|
|
2
|
+
//# sourceMappingURL=p-973da3e6.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["govFormMultiSelectCss","GovFormMultiSelect","constructor","hostRef","this","selectId","createID","listId","h","govHost","host","f","govForm","validateVariant","newValue","validateProp","FormMultiselectVariants","FormMultiSelectClass","root","validateSize","FormMultiselectSizes","watchOptions","optionsState","propsValueToArray","watchValue","selectedOptionsState","watchDisabled","passControlAttrs","passAttrToControl","size","toBoolAttr","invalid","success","componentWillLoad","variant","passAttrToLabel","String","required","options","value","getAvailableOptions","ignoreFilter","Array","isArray","length","filter","option","selectedIndex","selectedValueIndex","disabled","map","_a","label","from","selectRef","querySelectorAll","selected","textContent","initAutocomplete","autocompleteRef","addEventListener","onSelectHandler","bind","_b","onInputHandler","_c","onFocusHandler","_d","onBlurHandler","_e","setSearchCallback","searchString","Promise","resolve","data","removeDiacritics","toLowerCase","indexOf","finally","findIndex","getOptionElement","querySelector","getOption","find","selectOption","newOption","notify","index","govChange","emit","component","govSelect","removeOption","splice","govRemove","componentDidLoad","componentDidRender","tick","forEach","canValidateWcagOnRender","delay","validateWcag","render","Host","class","wrap","hasSlot","name","valueState","identifier","placeholder","messageEmpty","messageLoading","ref","el","minlength","wcagDescribedBy","wcagLabelledBy","wcagOwns","slot","hidden","multiple","toBoolAttrIfDefined","selectedOption","hideSelectedList","role","id","list","item","wcagLabel","type","onTagRemove","e","stopPropagation","focused","govFocus","originalEvent","govBlur","detail","clearValue","focus","setFocus","setValue","getRef","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"],"mappings":"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"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{r as o,c as a,h as r,a as i,g as s}from"./p-5bc604a3.js";import{v as t}from"./p-7724b535.js";import{c}from"./p-003e6cca.js";import{d as e}from"./p-03990da5.js";import{g as p}from"./p-5de606f8.js";import"./p-7f2c9830.js";import"./p-24636c53.js";const n={root:"gov-backdrop",bg:"gov-backdrop__bg"};const g='.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-backdrop__bg{z-index:100;position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--gov-backdrop-bg, var(--gov-color-secondary));opacity:var(--gov-backdrop-opacity, 0.45)}.gov-backdrop[inverse=""] .gov-backdrop__bg,.gov-backdrop[inverse=true i] .gov-backdrop__bg,.gov-backdrop[inverse="1"] .gov-backdrop__bg{background-color:var(--gov-backdrop-bg-inverse, var(--gov-color-neutral-white));opacity:var(--gov-backdrop-opacity, 0.8)}';const d=class{constructor(r){o(this,r);this.govClick=a(this,"gov-click",7);this.inverse=false;this.wcagLabel=undefined;this.wcagLabelledBy=undefined;this.h=p(this.host)}async componentDidRender(){if(c()){await e(500);await this.
|
|
2
|
-
|
|
1
|
+
import{r as o,c as a,h as r,a as i,g as s}from"./p-5bc604a3.js";import{v as t}from"./p-7724b535.js";import{c}from"./p-003e6cca.js";import{d as e}from"./p-03990da5.js";import{g as p}from"./p-5de606f8.js";import"./p-7f2c9830.js";import"./p-24636c53.js";const n={root:"gov-backdrop",bg:"gov-backdrop__bg"};const g='.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-backdrop__bg{z-index:100;position:fixed;top:0;right:0;bottom:0;left:0;background-color:var(--gov-backdrop-bg, var(--gov-color-secondary));opacity:var(--gov-backdrop-opacity, 0.45)}.gov-backdrop[inverse=""] .gov-backdrop__bg,.gov-backdrop[inverse=true i] .gov-backdrop__bg,.gov-backdrop[inverse="1"] .gov-backdrop__bg{background-color:var(--gov-backdrop-bg-inverse, var(--gov-color-neutral-white));opacity:var(--gov-backdrop-opacity, 0.8)}';const d=class{constructor(r){o(this,r);this.govClick=a(this,"gov-click",7);this.inverse=false;this.wcagLabel=undefined;this.wcagLabelledBy=undefined;this.h=p(this.host)}async componentDidRender(){if(c()){await e(500);await this.validateAccessibility()}}render(){return r(i,{class:this.h.classes(n.root)},r("div",{role:"button","aria-label":this.wcagLabel,"aria-labelledby":this.wcagLabelledBy,onClick:o=>this.govClick.emit(o),class:n.bg}))}async validateAccessibility(){t(this.wcagLabel,this.wcagLabelledBy,n.root)}get host(){return s(this)}};d.style=g;export{d as gov_backdrop};
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=p-ab1c25e7.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BackdropClass","root","bg","govBackdropCss","GovBackdrop","constructor","hostRef","this","h","govHost","host","componentDidRender","canValidateWcagOnRender","delay","validateAccessibility","render","Host","class","classes","role","wcagLabel","wcagLabelledBy","onClick","e","govClick","emit","validateAccessibleLabel"],"sources":["../../../packages/core/src/components/gov-backdrop/constants.ts","../../../packages/core/src/components/gov-backdrop/gov-backdrop.scss?tag=gov-backdrop","../../../packages/core/src/components/gov-backdrop/gov-backdrop.tsx"],"sourcesContent":["export const BackdropClass = {\n\troot: 'gov-backdrop',\n\tbg: 'gov-backdrop__bg',\n}\n","/*\n * Backdrop\n */\n\n$class: \".gov-backdrop\";\n\n#{$class} {\n\t&__bg {\n\t\t@include z-index(\"modal\", 0);\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tbackground-color: $backdrop-bg;\n\t\topacity: $backdrop-opacity;\n\t}\n\n\t// VARIANTS\n\t@include parameter(\"inverse\") {\n\t\t#{$class} {\n\t\t\t&__bg {\n\t\t\t\tbackground-color: $backdrop-bg-inverse;\n\t\t\t\topacity: $backdrop-opacity-inverse;\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Event, EventEmitter, h, Method, Prop, Host, Element } from '@stencil/core'\nimport { validateAccessibleLabel } from '../../helpers/Validate/wcag'\nimport { BackdropClass } from './constants'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-backdrop',\n\tstyleUrl: 'gov-backdrop.scss',\n})\nexport class GovBackdrop {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovBackdropElement\n\t/**\n\t * Determine if component should have inverse colors to be used on dark background.\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Adds accessible label for the backdrop that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when button clicks.\n\t */\n\t@Event({ eventName: 'gov-click' }) govClick: EventEmitter<MouseEvent>\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(BackdropClass.root)}>\n\t\t\t\t<div\n\t\t\t\t\trole={'button'}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\tonClick={e => this.govClick.emit(e)}\n\t\t\t\t\tclass={BackdropClass.bg}\n\t\t\t\t></div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, BackdropClass.root)\n\t}\n}\n"],"mappings":"2PAAO,MAAMA,EAAgB,CAC5BC,KAAM,eACNC,GAAI,oBCFL,MAAMC,EAAiB,oxB,MCYVC,EAAW,MAGvB,WAAAC,CAAAC,G,2DAQoC,M,uDAPnCC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAqBvB,wBAAMC,GACL,GAAIC,IAA2B,OACxBC,EAAM,WACNN,KAAKO,c,EAIb,MAAAC,GACC,OACCP,EAACQ,EAAI,CAACC,MAAOV,KAAKC,EAAEU,QAAQlB,EAAcC,OACzCO,EAAA,OACCW,KAAM,SAAQ,aACFZ,KAAKa,UAAS,kBACTb,KAAKc,eACtBC,QAASC,GAAKhB,KAAKiB,SAASC,KAAKF,GACjCN,MAAOjB,EAAcE,K,CAUzB,kBAAMY,GACLY,EAAkBnB,KAAKa,UAAWb,KAAKc,eAAgBrB,EAAcC,K"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{r as s,c as i,h as a,a as t,g as o}from"./p-5bc604a3.js";import{S as e,a as n}from"./p-db1f0452.js";import{v as r}from"./p-7724b535.js";import{c as p}from"./p-003e6cca.js";import{d as c}from"./p-03990da5.js";import{b as m}from"./p-5de606f8.js";import"./p-7f2c9830.js";import"./p-24636c53.js";const d=".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-side-nav{position:relative;display:block;width:100%}";const l=class{constructor(a){s(this,a);this.govChange=i(this,"gov-change",7);this.inverse=false;this.compact=false;this.wcagLabel=undefined;this.wcagLabelledBy=undefined}componentDidLoad(){this.host.querySelectorAll(e.root).forEach((s=>{s.setAttribute("inverse",m(this.inverse));s.setAttribute("compact",m(this.compact));s.addEventListener("gov-change",(s=>{s.stopPropagation();this.govChange.emit(s.detail)}))}))}async componentDidRender(){if(p()){await c(500);await this.
|
|
2
|
-
|
|
1
|
+
import{r as s,c as i,h as a,a as t,g as o}from"./p-5bc604a3.js";import{S as e,a as n}from"./p-db1f0452.js";import{v as r}from"./p-7724b535.js";import{c as p}from"./p-003e6cca.js";import{d as c}from"./p-03990da5.js";import{b as m}from"./p-5de606f8.js";import"./p-7f2c9830.js";import"./p-24636c53.js";const d=".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-side-nav{position:relative;display:block;width:100%}";const l=class{constructor(a){s(this,a);this.govChange=i(this,"gov-change",7);this.inverse=false;this.compact=false;this.wcagLabel=undefined;this.wcagLabelledBy=undefined}componentDidLoad(){this.host.querySelectorAll(e.root).forEach((s=>{s.setAttribute("inverse",m(this.inverse));s.setAttribute("compact",m(this.compact));s.addEventListener("gov-change",(s=>{s.stopPropagation();this.govChange.emit(s.detail)}))}))}async componentDidRender(){if(p()){await c(500);await this.validateAccessibility()}}render(){return a(t,{class:n.root,compact:this.compact,inverse:this.inverse,"arial-label":this.wcagLabel,"arial-labelledby":this.wcagLabelledBy},a("aside",{class:n.aside,role:"list"},a("slot",null)))}async validateAccessibility(){r(this.wcagLabel,this.wcagLabelledBy,n.root)}get host(){return o(this)}};l.style=d;export{l as gov_side_nav};
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=p-b88d732b.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["govSideNavCss","GovSideNav","componentDidLoad","this","host","querySelectorAll","SideNavItemClass","root","forEach","child","setAttribute","booleanString","inverse","compact","addEventListener","e","stopPropagation","govChange","emit","detail","componentDidRender","canValidateWcagOnRender","delay","validateAccessibility","render","h","Host","class","SideNavClass","wcagLabel","wcagLabelledBy","aside","role","validateAccessibleLabel"],"sources":["../../../packages/core/src/components/gov-side-nav/gov-side-nav.scss?tag=gov-side-nav","../../../packages/core/src/components/gov-side-nav/gov-side-nav.tsx"],"sourcesContent":["/*\n * Side nav\n */\n\n$class: \".gov-side-nav\";\n\n#{$class} {\n\t@include base();\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from '@stencil/core'\nimport { SideNavClass, SideNavItemClass } from './constants'\nimport { GovSideNavItemCustomEvent } from '../../components'\nimport { GovSideNavItemChangeEvent } from './gov-side-nav-item.d'\nimport { validateAccessibleLabel } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { booleanString } from '../../helpers/Dom/template'\n\n@Component({\n\ttag: 'gov-side-nav',\n\tstyleUrl: 'gov-side-nav.scss',\n})\nexport class GovSideNav {\n\t@Element() readonly host: HTMLGovSideNavElement\n\n\t/**\n\t * Determide if component should have inversed colors to be used on dark background.\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Determide if component should have compact styles.\n\t */\n\t@Prop() readonly compact: boolean = false\n\t/**\n\t * Adds accessible label for the sidenav that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Called when the sidenav state changes\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovSideNavItemChangeEvent>\n\n\tcomponentDidLoad() {\n\t\tthis.host.querySelectorAll(SideNavItemClass.root).forEach((child: HTMLGovSideNavItemElement) => {\n\t\t\tchild.setAttribute('inverse', booleanString(this.inverse))\n\t\t\tchild.setAttribute('compact', booleanString(this.compact))\n\t\t\tchild.addEventListener('gov-change', (e: GovSideNavItemCustomEvent<GovSideNavItemChangeEvent>) => {\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.govChange.emit(e.detail)\n\t\t\t})\n\t\t})\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={SideNavClass.root} compact={this.compact} inverse={this.inverse} arial-label={this.wcagLabel} arial-labelledby={this.wcagLabelledBy}>\n\t\t\t\t<aside class={SideNavClass.aside} role={'list'}>\n\t\t\t\t\t<slot />\n\t\t\t\t</aside>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, SideNavClass.root)\n\t}\n}\n"],"mappings":"2SAAA,MAAMA,EAAgB,kZ,MCaTC,EAAU,M,4EAMc,M,aAIA,M,uDAcpC,gBAAAC,GACCC,KAAKC,KAAKC,iBAAiBC,EAAiBC,MAAMC,SAASC,IAC1DA,EAAMC,aAAa,UAAWC,EAAcR,KAAKS,UACjDH,EAAMC,aAAa,UAAWC,EAAcR,KAAKU,UACjDJ,EAAMK,iBAAiB,cAAeC,IACrCA,EAAEC,kBACFb,KAAKc,UAAUC,KAAKH,EAAEI,OAAO,GAC5B,G,CAIJ,wBAAMC,GACL,GAAIC,IAA2B,OACxBC,EAAM,WACNnB,KAAKoB,c,EAIb,MAAAC,GACC,OACCC,EAACC,EAAI,CAACC,MAAOC,EAAarB,KAAMM,QAASV,KAAKU,QAASD,QAAST,KAAKS,QAAO,cAAeT,KAAK0B,UAAS,mBAAoB1B,KAAK2B,gBACjIL,EAAA,SAAOE,MAAOC,EAAaG,MAAOC,KAAM,QACvCP,EAAA,c,CAUJ,kBAAMF,GACLU,EAAkB9B,KAAK0B,UAAW1B,KAAK2B,eAAgBF,EAAarB,K"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{r as o,c as a,h as e,a as t,g as i}from"./p-5bc604a3.js";import{g as s,c as r,a as d}from"./p-5de606f8.js";import{c as l}from"./p-003e6cca.js";import{a as n}from"./p-7f2c9830.js";import{a as m}from"./p-7724b535.js";import{c as g}from"./p-24636c53.js";import{d as h}from"./p-03990da5.js";import{M as c}from"./p-be4aab0e.js";const v='.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-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{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);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=""],.gov-modal[open=true i],.gov-modal[open="1"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const p=class{constructor(e){o(this,e);this.govClose=a(this,"gov-close",7);this.open=false;this.blockClose=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.wcagCloseLabel="Zavřít okno";this.wcagCloseLabelledBy=undefined;this.h=s(this.host);this.labelId=g("GovModalLabel");this.contentId=g("GovModalContent")}validateLabelTag(o){const a=["h1","h2","h3","h4","h5","h6"];if(o){if(!a.includes(o)){n(`[${c.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o;if(o&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}showModal(){this.open=true;document.body.classList.add(c.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(c.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(l()){await h(500);await this.
|
|
2
|
-
|
|
1
|
+
import{r as o,c as a,h as e,a as t,g as i}from"./p-5bc604a3.js";import{g as s,c as r,a as d}from"./p-5de606f8.js";import{c as l}from"./p-003e6cca.js";import{a as n}from"./p-7f2c9830.js";import{a as m}from"./p-7724b535.js";import{c as g}from"./p-24636c53.js";import{d as h}from"./p-03990da5.js";import{M as c}from"./p-be4aab0e.js";const v='.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-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{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);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=""],.gov-modal[open=true i],.gov-modal[open="1"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const p=class{constructor(e){o(this,e);this.govClose=a(this,"gov-close",7);this.open=false;this.blockClose=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.wcagCloseLabel="Zavřít okno";this.wcagCloseLabelledBy=undefined;this.h=s(this.host);this.labelId=g("GovModalLabel");this.contentId=g("GovModalContent")}validateLabelTag(o){const a=["h1","h2","h3","h4","h5","h6"];if(o){if(!a.includes(o)){n(`[${c.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o;if(o&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}showModal(){this.open=true;document.body.classList.add(c.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(c.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(l()){await h(500);await this.validateAccessibility()}}render(){const o=this.labelTag;return e(t,{class:this.h.classes(c.root),open:this.open},e("dialog",{class:c.dialog,hidden:!this.open,tabindex:r(this.open),open:this.open,"aria-modal":"true","aria-hidden":d(!this.open),"aria-labelledby":this.wcagLabelledBy||this.labelId,"aria-describedby":this.wcagDescribedBy||this.contentId,role:this.role},e("div",{class:c.inner},e("div",{class:c.header},this.h.hasSlot("icon")&&e("div",{class:c.icon},e("slot",{name:"icon"})),this.label&&e(o,{class:c.title,id:this.labelId},this.label),e("gov-button",{ref:o=>this.closeCtaRef=o,disabled:this.blockClose,class:c.close,variant:"primary",wcagLabel:this.wcagCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base","on-gov-click":this.onCloseHandler.bind(this)},e("gov-icon",{name:"x-lg"}))),e("div",{class:c.content,id:this.contentId},e("slot",null)),this.h.hasSlot("footer")&&e("div",{class:c.footer},e("slot",{name:"footer"})))),this.open?e("gov-backdrop",{"wcag-label":this.wcagCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(o){o.stopPropagation();if(this.blockClose===false){this.hideModal();this.govClose.emit(o)}}async show(){this.showModal()}async hide(){this.hideModal()}async validateAccessibility(){m(this.wcagLabelledBy,"wcag-labelled-by",c.root);m(this.wcagDescribedBy,"wcag-described-by",c.root)}get host(){return i(this)}static get watchers(){return{labelTag:["validateLabelTag"],open:["watchOpen"]}}};p.style=v;export{p as gov_modal};
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=p-bdd4ee7c.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["govModalCss","GovModal","constructor","hostRef","this","h","govHost","host","labelId","createID","contentId","validateLabelTag","newValue","validTags","includes","govErrorLog","ModalClass","root","watchOpen","open","closeCtaRef","setFocus","catch","showModal","document","body","classList","add","bodyFix","hideModal","remove","componentWillRender","componentDidRender","canValidateWcagOnRender","delay","validateAccessibility","render","LabelTag","labelTag","Host","class","classes","dialog","hidden","tabindex","boolToFocusValue","toBoolAttr","wcagLabelledBy","wcagDescribedBy","role","inner","header","hasSlot","icon","name","label","title","id","ref","el","disabled","blockClose","close","variant","wcagLabel","wcagCloseLabel","wcagCloseLabelledBy","type","onCloseHandler","bind","content","footer","e","stopPropagation","govClose","emit","show","hide","validateWcagRef"],"sources":["../../../packages/core/src/components/gov-modal/gov-modal.scss?tag=gov-modal","../../../packages/core/src/components/gov-modal/gov-modal.tsx"],"sourcesContent":["/*\n * Modal\n */\n\n$class: \".gov-modal\";\n\n#{$class} {\n\tdisplay: none;\n\n\t&__dialog {\n\t\t@include z-index(\"modal\", 1);\n\t\tposition: fixed;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: 100%;\n\t\tmax-width: $modal-max-width;\n\t\theight: 100%;\n\t\tpadding: rem-calc(8);\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\ttransform: translate(-50%, -50%);\n\t\tpointer-events: none;\n\t}\n\n\t&__inner {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\twidth: 100%;\n\t\tmax-height: 100%;\n\t\tborder-radius: $border-radius;\n\t\tbackground: $modal-bg;\n\t\toverflow: hidden;\n\t\tpointer-events: auto;\n\t\tbox-shadow: get($shadow-l, $shadows);\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\talign-items: flex-start;\n\t\tpadding: rem-calc(24 16);\n\t\tborder-bottom: $modal-border;\n\t}\n\n\t&__icon {\n\t\tflex: 0 0 auto;\n\t\tpadding-top: calc(((var(--gov-text-#{$font-size-3xl}-font-size) * 1.5) - rem-calc(24)) / 2);\n\n\t\t& > * {\n\t\t\twidth: rem-calc(24);\n\t\t\theight: rem-calc(24);\n\t\t}\n\t}\n\n\t&__title {\n\t\t@include typography($font-size-3xl);\n\t\tmargin: 0;\n\t}\n\n\t&__close {\n\t\tflex: 0 0 auto;\n\t\tmargin-left: auto;\n\t}\n\n\t&__content {\n\t\t@include reset-last-margin();\n\t\theight: 100%;\n\t\tpadding: rem-calc(24 16);\n\t\tcolor: $modal-text-color;\n\t\toverflow: auto;\n\t}\n\n\t&__footer,\n\t&__actions {\n\t\tpadding: rem-calc(24 16);\n\t\tborder-top: $modal-border;\n\t}\n\n\t&__actions {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(8 16);\n\t\tflex-wrap: wrap;\n\t\tjustify-content: flex-end;\n\t}\n\n\t// STATES\n\t&__dialog:focus &__inner {\n\t\toutline: $outline;\n\t}\n\n\t@include parameter(\"open\") {\n\t\tdisplay: block;\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t&__dialog {\n\t\t\tmax-width: calc($modal-max-width + 2 * rem-calc(24));\n\t\t\tpadding: rem-calc(24);\n\n\t\t\t&:focus {\n\t\t\t\toutline-offset: rem-calc(-24);\n\t\t\t}\n\t\t}\n\t\t&__inner {\n\t\t\tbox-shadow: get($shadow-xl, $shadows);\n\t\t}\n\n\t\t// VARIANTS\n\t\t&--prompt &__dialog {\n\t\t\tmax-width: calc($modal-prompt-max-width + 2 * rem-calc(24));\n\t\t}\n\t}\n\t@include mq($from: md) {\n\t\t&__header {\n\t\t\tgap: rem-calc(20);\n\t\t\tpadding: rem-calc(32 40 32 48);\n\t\t}\n\t\t&__content {\n\t\t\tpadding: rem-calc(32 48);\n\t\t}\n\t\t&__footer {\n\t\t\tpadding: rem-calc(16 48);\n\t\t}\n\n\t\t// VARIANTS\n\t\t&--prompt {\n\t\t\t#{$class} {\n\t\t\t\t&__header,\n\t\t\t\t&__content,\n\t\t\t\t&__footer,\n\t\t\t\t&__actions {\n\t\t\t\t\tpadding: rem-calc(24);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from '@stencil/core'\nimport {boolToFocusValue, govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {govErrorLog} from '../../helpers/Log/gov.log'\nimport {validateWcagRef} from '../../helpers/Validate/wcag'\nimport {Nullable} from '../../types/interfaces'\nimport {createID} from '../../utils/string.utils'\nimport {delay} from '../../utils/utils'\nimport {ModalClass} from './constants'\n\n@Component({\n\ttag: 'gov-modal',\n\tstyleUrl: 'gov-modal.scss',\n})\nexport class GovModal {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\tprivate closeCtaRef?: HTMLGovButtonElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovModalLabel')\n\t\tthis.contentId = createID('GovModalContent')\n\t}\n\n\t@Element() host: HTMLGovModalElement\n\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Attribute allowing blocking the modal closing\n\t */\n\t@Prop() blockClose = false\n\t/**\n\t * Title of modal window\n\t */\n\t@Prop() label: string\n\t/**\n\t * Role of modal\n\t */\n\t@Prop({attribute: 'role'}) role: Nullable<string> = 'dialog'\n\t/**\n\t * Used to change the HTML tag in the modal label for correct semantic structure\n\t */\n\t@Prop({attribute: 'label-tag'}) readonly labelTag: string = 'h2'\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the modal.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) wcagDescribedBy: string\n\t/**\n\t * Adds accessible label for the modal close button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'wcag-close-label'}) readonly wcagCloseLabel: string = 'Zavřít okno'\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the modal window\n\t */\n\t@Prop({attribute: 'wcag-close-labelled-by'}) wcagCloseLabelledBy: string\n\t/**\n\t * Emitted when modal window closes.\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<PointerEvent>\n\n\t@Watch('labelTag')\n\tvalidateLabelTag(newValue: string): void {\n\t\tconst validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch('open')\n\twatchOpen(newValue: boolean): void {\n\t\tthis.open = newValue\n\t\tif (newValue && this.closeCtaRef) {\n\t\t\tthis.closeCtaRef.setFocus().catch()\n\t\t}\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\n\t\t\tthis.showModal()\n\t\t} else {\n\t\t\tthis.hideModal()\n\t\t}\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst LabelTag = this.labelTag\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ModalClass.root)} open={this.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex={boolToFocusValue(this.open)}\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.wcagDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={ModalClass.inner}>\n\t\t\t\t\t\t<div class={ModalClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t\t\t<div class={ModalClass.icon}>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.label && (\n\t\t\t\t\t\t\t\t<LabelTag class={ModalClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t\t\t</LabelTag>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\tref={el => (this.closeCtaRef = el)}\n\t\t\t\t\t\t\t\tdisabled={this.blockClose}\n\t\t\t\t\t\t\t\tclass={ModalClass.close}\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\twcagLabel={this.wcagCloseLabel}\n\t\t\t\t\t\t\t\twcagLabelledBy={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"/>\n\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={ModalClass.content} id={this.contentId}>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{this.h.hasSlot('footer') && (\n\t\t\t\t\t\t\t<div class={ModalClass.footer}>\n\t\t\t\t\t\t\t\t<slot name=\"footer\"/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t{this.open ? (\n\t\t\t\t\t<gov-backdrop wcag-label={this.wcagCloseLabel} wcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}/>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\tif (this.blockClose === false) {\n\t\t\tthis.hideModal()\n\t\t\tthis.govClose.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideModal()\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', ModalClass.root)\n\t}\n}\n"],"mappings":"0UAAA,MAAMA,EAAc,wyF,MCePC,EAAQ,MAMpB,WAAAC,CAAAC,G,wDAW8B,M,gBAIT,M,+BAQ+B,S,cAIQ,K,iFAYa,c,mCAtCxEC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,QAAUC,EAAS,iBACxBL,KAAKM,UAAYD,EAAS,kB,CA+C3B,gBAAAE,CAAiBC,GAChB,MAAMC,EAAY,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,MACjD,GAAID,EAAU,CACb,IAAKC,EAAUC,SAASF,GAAW,CAClCG,EAAY,IAAIC,EAAWC,cAAcL,oB,GAM5C,SAAAM,CAAUN,GACTR,KAAKe,KAAOP,EACZ,GAAIA,GAAYR,KAAKgB,YAAa,CACjChB,KAAKgB,YAAYC,WAAWC,O,EAItB,SAAAC,GACPnB,KAAKe,KAAO,KACZK,SAASC,KAAKC,UAAUC,IAAIX,EAAWY,Q,CAGhC,SAAAC,GACPzB,KAAKe,KAAO,MACZK,SAASC,KAAKC,UAAUI,OAAOd,EAAWY,Q,CAG3C,yBAAMG,GACL,GAAI3B,KAAKe,KAAM,CACdf,KAAKmB,W,KACC,CACNnB,KAAKyB,W,EAIP,wBAAMG,GACL,GAAIC,IAA2B,OACxBC,EAAM,WACN9B,KAAK+B,c,EAIb,MAAAC,GACC,MAAMC,EAAWjC,KAAKkC,SACtB,OACCjC,EAACkC,EAAI,CAACC,MAAOpC,KAAKC,EAAEoC,QAAQzB,EAAWC,MAAOE,KAAMf,KAAKe,MACxDd,EAAA,UACCmC,MAAOxB,EAAW0B,OAClBC,QAASvC,KAAKe,KACdyB,SAAUC,EAAiBzC,KAAKe,MAChCA,KAAMf,KAAKe,KAAI,aACJ,OAAM,cACJ2B,GAAY1C,KAAKe,MAAK,kBAClBf,KAAK2C,gBAAkB3C,KAAKI,QAAO,mBAClCJ,KAAK4C,iBAAmB5C,KAAKM,UAC/CuC,KAAM7C,KAAK6C,MAEX5C,EAAA,OAAKmC,MAAOxB,EAAWkC,OACtB7C,EAAA,OAAKmC,MAAOxB,EAAWmC,QACrB/C,KAAKC,EAAE+C,QAAQ,SACf/C,EAAA,OAAKmC,MAAOxB,EAAWqC,MACtBhD,EAAA,QAAMiD,KAAK,UAGZlD,KAAKmD,OACLlD,EAACgC,EAAQ,CAACG,MAAOxB,EAAWwC,MAAOC,GAAIrD,KAAKI,SAC1CJ,KAAKmD,OAGRlD,EAAA,cACCqD,IAAKC,GAAOvD,KAAKgB,YAAcuC,EAC/BC,SAAUxD,KAAKyD,WACfrB,MAAOxB,EAAW8C,MAClBC,QAAQ,UACRC,UAAW5D,KAAK6D,eAChBlB,eAAgB3C,KAAK8D,oBACrBC,KAAK,OAAM,eACG/D,KAAKgE,eAAeC,KAAKjE,OAEvCC,EAAA,YAAUiD,KAAK,WAGjBjD,EAAA,OAAKmC,MAAOxB,EAAWsD,QAASb,GAAIrD,KAAKM,WACxCL,EAAA,cAEAD,KAAKC,EAAE+C,QAAQ,WACf/C,EAAA,OAAKmC,MAAOxB,EAAWuD,QACtBlE,EAAA,QAAMiD,KAAK,cAMdlD,KAAKe,KACLd,EAAA,6BAA0BD,KAAK6D,eAAc,mBAAoB7D,KAAK8D,oBAAmB,eACpE9D,KAAKgE,eAAeC,KAAKjE,QAC3C,K,CAKC,cAAAgE,CAAeI,GACtBA,EAAEC,kBACF,GAAIrE,KAAKyD,aAAe,MAAO,CAC9BzD,KAAKyB,YACLzB,KAAKsE,SAASC,KAAKH,E,EAQrB,UAAMI,GACLxE,KAAKmB,W,CAON,UAAMsD,GACLzE,KAAKyB,W,CAON,kBAAMM,GACL2C,EAAgB1E,KAAK2C,eAAgB,mBAAoB/B,EAAWC,MACpE6D,EAAgB1E,KAAK4C,gBAAiB,oBAAqBhC,EAAWC,K"}
|