@gov-design-system-ce/components 4.0.8-rc24 → 4.0.8-rc25
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/core.cjs.js +1 -1
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +2 -3
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-select.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +2 -2
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +2 -2
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.js +3 -4
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +2 -2
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
- package/dist/collection/components/gov-form/radio/gov-form-radio.js +1 -1
- package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.js +4 -4
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.js +2 -2
- package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-chip.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-checkbox.js.map +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-file.js.map +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 +1 -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 +1 -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-pagination.js +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/{p-d8e853ed.js → p-042e4a03.js} +2 -2
- package/dist/components/{p-414a45bb.js → p-0b747888.js} +2 -2
- package/dist/components/{p-b9450157.js → p-67f1f6d6.js} +2 -2
- package/dist/components/{p-1c288519.js → p-7ec74eb3.js} +2 -2
- package/dist/components/{p-3072ede5.js → p-8ab1afe9.js} +2 -2
- package/dist/components/{p-8ba0b435.js → p-9f2a08e5.js} +2 -2
- package/dist/components/p-9f2a08e5.js.map +1 -0
- package/dist/components/{p-f518bc1c.js → p-b62a37d1.js} +2 -2
- package/dist/components/p-b62a37d1.js.map +1 -0
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-14a87c92.entry.js → p-290c5b2f.entry.js} +2 -2
- package/dist/core/p-2e881577.entry.js.map +1 -1
- package/dist/core/{p-3832de64.entry.js → p-33c70c32.entry.js} +2 -2
- package/dist/{components/p-f518bc1c.js.map → core/p-33c70c32.entry.js.map} +1 -1
- package/dist/core/p-3e041d63.entry.js.map +1 -1
- package/dist/core/p-4f77a766.entry.js.map +1 -1
- package/dist/core/{p-1005135a.entry.js → p-c8b69610.entry.js} +2 -2
- package/dist/core/p-c8b69610.entry.js.map +1 -0
- package/dist/core/{p-3b8fb675.entry.js → p-d90d1c7d.entry.js} +2 -2
- package/dist/core/p-d90d1c7d.entry.js.map +1 -0
- package/dist/core/{p-d4f2d6f9.entry.js → p-fe44d078.entry.js} +2 -2
- package/dist/core/p-fe44d078.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-form-autocomplete.entry.js +1 -1
- package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
- package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
- package/dist/esm/gov-form-file.entry.js +2 -3
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +1 -1
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-form-radio.entry.js.map +1 -1
- package/dist/esm/gov-form-select.entry.js +2 -2
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-form-switch.entry.js.map +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +23 -24
- package/dist/hydrate/index.mjs +23 -24
- package/package.json +1 -1
- package/dist/components/p-8ba0b435.js.map +0 -1
- package/dist/core/p-1005135a.entry.js.map +0 -1
- package/dist/core/p-3832de64.entry.js.map +0 -1
- package/dist/core/p-3b8fb675.entry.js.map +0 -1
- package/dist/core/p-d4f2d6f9.entry.js.map +0 -1
- /package/dist/components/{p-d8e853ed.js.map → p-042e4a03.js.map} +0 -0
- /package/dist/components/{p-414a45bb.js.map → p-0b747888.js.map} +0 -0
- /package/dist/components/{p-b9450157.js.map → p-67f1f6d6.js.map} +0 -0
- /package/dist/components/{p-1c288519.js.map → p-7ec74eb3.js.map} +0 -0
- /package/dist/components/{p-3072ede5.js.map → p-8ab1afe9.js.map} +0 -0
- /package/dist/core/{p-14a87c92.entry.js.map → p-290c5b2f.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as o,c as t,h as i,d as r}from"./p-5262b9ce.js";import{g as s,o as c,p as l,q as n}from"./p-77a6e3be.js";import{g as a,a as g,t as v}from"./p-d687df8f.js";import{c as m}from"./p-e618f1cb.js";import{v as f}from"./p-344c72d7.js";import{b as d,c as h}from"./p-71cec4ef.js";import{c as p}from"./p-cd6c2938.js";import{d as u}from"./p-e0e2e9c1.js";import{p as z}from"./p-3f704a40.js";import{t as w}from"./p-240c302e.js";import{d as x}from"./p-b9450157.js";const b='.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-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-select .element{position:relative;display:flex;flex:1 1 auto}.gov-form-select input,.gov-form-select select,.gov-form-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-select input:focus,.gov-form-select select:focus,.gov-form-select textarea:focus{outline:none}.gov-form-select input:focus-visible,.gov-form-select select:focus-visible,.gov-form-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-select input::-moz-placeholder,.gov-form-select select::-moz-placeholder,.gov-form-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-select input::placeholder,.gov-form-select select::placeholder,.gov-form-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-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-select *[slot=left-icon],.gov-form-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-select *[slot=left-icon]{left:0}.gov-form-select *[slot=right-icon]{right:0}.gov-form-select *[slot=prefix],.gov-form-select *[slot=sufix]{margin:0}[size=s].gov-form-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-select input,[size=s].gov-form-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-select *[slot=left-icon],[size=s].gov-form-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-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-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-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-select *[slot=right-icon]~input,[size=s].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-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-select input,[size=m].gov-form-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-select *[slot=left-icon],[size=m].gov-form-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-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-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-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-select *[slot=right-icon]~input,[size=m].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-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-select input,[size=l].gov-form-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-select *[slot=left-icon],[size=l].gov-form-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-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-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-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-select *[slot=right-icon]~input,[size=l].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-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-select input,[size=xl].gov-form-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-select *[slot=left-icon],[size=xl].gov-form-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-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-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-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-select *[slot=right-icon]~input,[size=xl].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-select input,[variant=primary].gov-form-select select,[variant=primary].gov-form-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-select *[slot=left-icon],[variant=primary].gov-form-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-select input,[variant=secondary].gov-form-select select,[variant=secondary].gov-form-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-select *[slot=left-icon],[variant=secondary].gov-form-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-select,[disabled=true i].gov-form-select,[disabled="1"].gov-form-select{pointer-events:none}[disabled=""].gov-form-select input,[disabled=""].gov-form-select select,[disabled=""].gov-form-select textarea,[disabled=true i].gov-form-select input,[disabled=true i].gov-form-select select,[disabled=true i].gov-form-select textarea,[disabled="1"].gov-form-select input,[disabled="1"].gov-form-select select,[disabled="1"].gov-form-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-select *[slot=left-icon],[disabled=""].gov-form-select *[slot=right-icon],[disabled=true i].gov-form-select *[slot=left-icon],[disabled=true i].gov-form-select *[slot=right-icon],[disabled="1"].gov-form-select *[slot=left-icon],[disabled="1"].gov-form-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600)) !important}[invalid=""].gov-form-select input,[invalid=""].gov-form-select select,[invalid=""].gov-form-select textarea,[invalid=true i].gov-form-select input,[invalid=true i].gov-form-select select,[invalid=true i].gov-form-select textarea,[invalid="1"].gov-form-select input,[invalid="1"].gov-form-select select,[invalid="1"].gov-form-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-select input::-moz-placeholder,[invalid=""].gov-form-select select::-moz-placeholder,[invalid=""].gov-form-select textarea::-moz-placeholder,[invalid=true i].gov-form-select input::-moz-placeholder,[invalid=true i].gov-form-select select::-moz-placeholder,[invalid=true i].gov-form-select textarea::-moz-placeholder,[invalid="1"].gov-form-select input::-moz-placeholder,[invalid="1"].gov-form-select select::-moz-placeholder,[invalid="1"].gov-form-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-select input::placeholder,[invalid=""].gov-form-select select::placeholder,[invalid=""].gov-form-select textarea::placeholder,[invalid=true i].gov-form-select input::placeholder,[invalid=true i].gov-form-select select::placeholder,[invalid=true i].gov-form-select textarea::placeholder,[invalid="1"].gov-form-select input::placeholder,[invalid="1"].gov-form-select select::placeholder,[invalid="1"].gov-form-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-select *[slot=left-icon],[invalid=""].gov-form-select *[slot=right-icon],[invalid=true i].gov-form-select *[slot=left-icon],[invalid=true i].gov-form-select *[slot=right-icon],[invalid="1"].gov-form-select *[slot=left-icon],[invalid="1"].gov-form-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error)) !important}[invalid=""].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid=true i].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid="1"].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[success=""].gov-form-select *[slot=right-icon]:not(.icon-arrow),[success=true i].gov-form-select *[slot=right-icon]:not(.icon-arrow),[success="1"].gov-form-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[multiline=""].gov-form-select *[slot=left-icon],[multiline=""].gov-form-select *[slot=right-icon],[multiline=true i].gov-form-select *[slot=left-icon],[multiline=true i].gov-form-select *[slot=right-icon],[multiline="1"].gov-form-select *[slot=left-icon],[multiline="1"].gov-form-select *[slot=right-icon]{display:none}.gov-form-select{background:none}.gov-form-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-select select::-ms-expand{display:none}[size=s].gov-form-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-select .icon-arrow,[size=s][invalid=true i].gov-form-select .icon-arrow,[size=s][invalid="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=s][success=""].gov-form-select .icon-arrow,[size=s][success=true i].gov-form-select .icon-arrow,[size=s][success="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=m].gov-form-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-select .icon-arrow,[size=m][invalid=true i].gov-form-select .icon-arrow,[size=m][invalid="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=m][success=""].gov-form-select .icon-arrow,[size=m][success=true i].gov-form-select .icon-arrow,[size=m][success="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=l].gov-form-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-select .icon-arrow,[size=l][invalid=true i].gov-form-select .icon-arrow,[size=l][invalid="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=l][success=""].gov-form-select .icon-arrow,[size=l][success=true i].gov-form-select .icon-arrow,[size=l][success="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=xl].gov-form-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-select .icon-arrow,[size=xl][invalid=true i].gov-form-select .icon-arrow,[size=xl][invalid="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=xl][success=""].gov-form-select .icon-arrow,[size=xl][success=true i].gov-form-select .icon-arrow,[size=xl][success="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=s][invalid=""].gov-form-select *[slot=right-icon]~select,[size=s][invalid=""].gov-form-select *[slot=right-icon]~input,[size=s][invalid=true i].gov-form-select *[slot=right-icon]~select,[size=s][invalid=true i].gov-form-select *[slot=right-icon]~input,[size=s][invalid="1"].gov-form-select *[slot=right-icon]~select,[size=s][invalid="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=s][success=""].gov-form-select *[slot=right-icon]~select,[size=s][success=""].gov-form-select *[slot=right-icon]~input,[size=s][success=true i].gov-form-select *[slot=right-icon]~select,[size=s][success=true i].gov-form-select *[slot=right-icon]~input,[size=s][success="1"].gov-form-select *[slot=right-icon]~select,[size=s][success="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=m][invalid=""].gov-form-select *[slot=right-icon]~select,[size=m][invalid=""].gov-form-select *[slot=right-icon]~input,[size=m][invalid=true i].gov-form-select *[slot=right-icon]~select,[size=m][invalid=true i].gov-form-select *[slot=right-icon]~input,[size=m][invalid="1"].gov-form-select *[slot=right-icon]~select,[size=m][invalid="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=m][success=""].gov-form-select *[slot=right-icon]~select,[size=m][success=""].gov-form-select *[slot=right-icon]~input,[size=m][success=true i].gov-form-select *[slot=right-icon]~select,[size=m][success=true i].gov-form-select *[slot=right-icon]~input,[size=m][success="1"].gov-form-select *[slot=right-icon]~select,[size=m][success="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=l][invalid=""].gov-form-select *[slot=right-icon]~select,[size=l][invalid=""].gov-form-select *[slot=right-icon]~input,[size=l][invalid=true i].gov-form-select *[slot=right-icon]~select,[size=l][invalid=true i].gov-form-select *[slot=right-icon]~input,[size=l][invalid="1"].gov-form-select *[slot=right-icon]~select,[size=l][invalid="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=l][success=""].gov-form-select *[slot=right-icon]~select,[size=l][success=""].gov-form-select *[slot=right-icon]~input,[size=l][success=true i].gov-form-select *[slot=right-icon]~select,[size=l][success=true i].gov-form-select *[slot=right-icon]~input,[size=l][success="1"].gov-form-select *[slot=right-icon]~select,[size=l][success="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=xl][invalid=""].gov-form-select *[slot=right-icon]~select,[size=xl][invalid=""].gov-form-select *[slot=right-icon]~input,[size=xl][invalid=true i].gov-form-select *[slot=right-icon]~select,[size=xl][invalid=true i].gov-form-select *[slot=right-icon]~input,[size=xl][invalid="1"].gov-form-select *[slot=right-icon]~select,[size=xl][invalid="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}[size=xl][success=""].gov-form-select *[slot=right-icon]~select,[size=xl][success=""].gov-form-select *[slot=right-icon]~input,[size=xl][success=true i].gov-form-select *[slot=right-icon]~select,[size=xl][success=true i].gov-form-select *[slot=right-icon]~input,[size=xl][success="1"].gov-form-select *[slot=right-icon]~select,[size=xl][success="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}';const y=b;const k=e(class e extends o{constructor(){super();this.__registerHost();this.govFocus=t(this,"gov-focus",7);this.govBlur=t(this,"gov-blur",7);this.govChange=t(this,"gov-change",7);this.value=undefined;this.options=undefined;this.identifier=undefined;this.variant="secondary";this.size="m";this.name=undefined;this.required=false;this.success=undefined;this.disabled=false;this.invalid=undefined;this.wcagActiveDescendant=undefined;this.wcagControls=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.optionsState=[];this.h=a(this.host);this.f=s(this.h);this.selectId=p("GovSelect")}validateVariant(e){f(l,e,c.root)}validateSize(e){f(n,e,c.root)}watchOptions(e){this.optionsState=z(e)}watchControlAttrs(){this.passControlAttrs()}watchValue(){this.markSelectedValue()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",g(this.invalid));this.f.passAttrToControl("success",g(this.success));this.f.passAttrToControl("disabled",g(this.disabled));this.f.passAttrToControl("type","select")}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.markSelectedValue();this.optionsState=z(this.options)}async componentDidRender(){this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));if(m()){await u(500);await this.validateWcag()}w((()=>this.markSelectedValue()))}markSelectedValue(){this.host.querySelectorAll("option").forEach((e=>{if(e.value===this.value){e.setAttribute("selected","selected")}else{e.removeAttribute("selected")}}))}render(){return i(r,{key:"ad730683b3c90c1f843e0b623ccb90620d850f38",class:c.root,size:this.size,variant:this.variant},this.h.hasSlot("prefix")&&i("slot",{key:"a502060ea1fe99bdc99c6d41ec724a028e953936",name:"prefix"}),i("span",{key:"c1145ad7d689eedd3364a036cbbc84e2651bf2f3",class:"element"},i("gov-icon",{key:"4064afe2f528385e0488d9b0d4de823468d5291b",slot:"right-icon",name:"chevron-down",class:"icon-arrow"}),this.h.hasSlot("right-icon")&&!(this.success||this.invalid)&&i("slot",{key:"3be3d76095659ad871ad56c301455d845ad2228c",name:"right-icon"}),this.success&&i("gov-icon",{key:"fa6b68bbd864c09ba5b5dab1118dab5acba21875",slot:"right-icon",class:"icon-validation",name:"check-lg"}),this.invalid&&i("gov-icon",{key:"956ce3b961a6cce2f815a787bc16daed467a519e",slot:"right-icon",class:"icon-validation",name:"exclamation-lg"}),i("select",{key:"f176ad1c96c7b1c2fa080332a82b5c4a0847ceb0",id:this.identifier||this.selectId,onFocus:this.onFocusHandler.bind(this),onChange:this.onChangeHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,name:this.name,disabled:this.disabled,ref:e=>this.selectRef=e,"aria-disabled":v(this.disabled),"aria-activedescendant":this.wcagActiveDescendant,"aria-controls":this.wcagControls,"aria-required":v(this.required),"aria-invalid":v(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns},i("slot",{key:"1021bfce70fc2896c420df6e16e36aa63dfe0b37"}),Array.isArray(this.optionsState)&&this.optionsState.map((e=>{var o;return i("option",{value:e.value,selected:e.value===this.value,disabled:e===null||e===void 0?void 0:e.disabled},(o=e.label)!==null&&o!==void 0?o:e.value)})))),this.h.hasSlot("sufix")&&i("slot",{key:"c1900ebfcba04e86829852c2a164a2c3492f1895",name:"sufix"}))}onFocusHandler(e){this.focused=true;this.govFocus.emit({component:c.root,originalEvent:e,value:this.value})}onBlurHandler(e){this.focused=false;this.govBlur.emit({component:c.root,originalEvent:e,value:this.value})}onChangeHandler(e){this.value=e.target.value;e.stopPropagation();this.govChange.emit({component:c.root,originalEvent:e,value:this.value})}async setFocus(e){return this.selectRef.focus(e)}async getRef(){return this.selectRef}async validateWcag(){d(this.wcagActiveDescendant,"wcag-active-descendant",c.root);d(this.wcagControls,"wcag-controls",c.root);d(this.wcagDescribedBy,"wcag-described-by",c.root);d(this.wcagOwns,"wcag-owns",c.root);h(this.identifier||this.selectId,this.wcagLabelledBy,c.root)}get host(){return this}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchControlAttrs"],options:["watchOptions"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"],value:["watchValue"]}}static get style(){return y}},[4,"gov-form-select",{value:[1537],options:[1537],identifier:[1],variant:[1],size:[1],name:[1],required:[4],success:[4],disabled:[4],invalid:[4],wcagActiveDescendant:[1,"wcag-active-descendant"],wcagControls:[1,"wcag-controls"],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagOwns:[1,"wcag-owns"],focused:[32],optionsState:[32],setFocus:[64],getRef:[64],validateWcag:[64]},undefined,{variant:["validateVariant"],size:["validateSize","watchControlAttrs"],options:["watchOptions"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"],value:["watchValue"]}]);function C(){if(typeof customElements==="undefined"){return}const e=["gov-form-select","gov-icon"];e.forEach((e=>{switch(e){case"gov-form-select":if(!customElements.get(e)){customElements.define(e,k)}break;case"gov-icon":if(!customElements.get(e)){x()}break}}))}C();export{k as G,C as d};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as e,H as o,c as t,h as i,d as r}from"./p-5262b9ce.js";import{g as s,o as c,p as l,q as n}from"./p-77a6e3be.js";import{g as a,a as g,t as v}from"./p-d687df8f.js";import{c as m}from"./p-e618f1cb.js";import{v as f}from"./p-344c72d7.js";import{b as d,c as h}from"./p-71cec4ef.js";import{c as p}from"./p-cd6c2938.js";import{d as u}from"./p-e0e2e9c1.js";import{p as z}from"./p-3f704a40.js";import{t as w}from"./p-240c302e.js";import{d as x}from"./p-67f1f6d6.js";const b='.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-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-select .element{position:relative;display:flex;flex:1 1 auto}.gov-form-select input,.gov-form-select select,.gov-form-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-select input:focus,.gov-form-select select:focus,.gov-form-select textarea:focus{outline:none}.gov-form-select input:focus-visible,.gov-form-select select:focus-visible,.gov-form-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-select input::-moz-placeholder,.gov-form-select select::-moz-placeholder,.gov-form-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-select input::placeholder,.gov-form-select select::placeholder,.gov-form-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-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-select *[slot=left-icon],.gov-form-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-select *[slot=left-icon]{left:0}.gov-form-select *[slot=right-icon]{right:0}.gov-form-select *[slot=prefix],.gov-form-select *[slot=sufix]{margin:0}[size=s].gov-form-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-select input,[size=s].gov-form-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-select *[slot=left-icon],[size=s].gov-form-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-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-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-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-select *[slot=right-icon]~input,[size=s].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-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-select input,[size=m].gov-form-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-select *[slot=left-icon],[size=m].gov-form-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-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-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-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-select *[slot=right-icon]~input,[size=m].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-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-select input,[size=l].gov-form-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-select *[slot=left-icon],[size=l].gov-form-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-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-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-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-select *[slot=right-icon]~input,[size=l].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-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-select input,[size=xl].gov-form-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-select *[slot=left-icon],[size=xl].gov-form-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-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-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-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-select *[slot=right-icon]~input,[size=xl].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-select input,[variant=primary].gov-form-select select,[variant=primary].gov-form-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-select *[slot=left-icon],[variant=primary].gov-form-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-select input,[variant=secondary].gov-form-select select,[variant=secondary].gov-form-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-select *[slot=left-icon],[variant=secondary].gov-form-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-select,[disabled=true i].gov-form-select,[disabled="1"].gov-form-select{pointer-events:none}[disabled=""].gov-form-select input,[disabled=""].gov-form-select select,[disabled=""].gov-form-select textarea,[disabled=true i].gov-form-select input,[disabled=true i].gov-form-select select,[disabled=true i].gov-form-select textarea,[disabled="1"].gov-form-select input,[disabled="1"].gov-form-select select,[disabled="1"].gov-form-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-select *[slot=left-icon],[disabled=""].gov-form-select *[slot=right-icon],[disabled=true i].gov-form-select *[slot=left-icon],[disabled=true i].gov-form-select *[slot=right-icon],[disabled="1"].gov-form-select *[slot=left-icon],[disabled="1"].gov-form-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600)) !important}[invalid=""].gov-form-select input,[invalid=""].gov-form-select select,[invalid=""].gov-form-select textarea,[invalid=true i].gov-form-select input,[invalid=true i].gov-form-select select,[invalid=true i].gov-form-select textarea,[invalid="1"].gov-form-select input,[invalid="1"].gov-form-select select,[invalid="1"].gov-form-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-select input::-moz-placeholder,[invalid=""].gov-form-select select::-moz-placeholder,[invalid=""].gov-form-select textarea::-moz-placeholder,[invalid=true i].gov-form-select input::-moz-placeholder,[invalid=true i].gov-form-select select::-moz-placeholder,[invalid=true i].gov-form-select textarea::-moz-placeholder,[invalid="1"].gov-form-select input::-moz-placeholder,[invalid="1"].gov-form-select select::-moz-placeholder,[invalid="1"].gov-form-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-select input::placeholder,[invalid=""].gov-form-select select::placeholder,[invalid=""].gov-form-select textarea::placeholder,[invalid=true i].gov-form-select input::placeholder,[invalid=true i].gov-form-select select::placeholder,[invalid=true i].gov-form-select textarea::placeholder,[invalid="1"].gov-form-select input::placeholder,[invalid="1"].gov-form-select select::placeholder,[invalid="1"].gov-form-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-select *[slot=left-icon],[invalid=""].gov-form-select *[slot=right-icon],[invalid=true i].gov-form-select *[slot=left-icon],[invalid=true i].gov-form-select *[slot=right-icon],[invalid="1"].gov-form-select *[slot=left-icon],[invalid="1"].gov-form-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error)) !important}[invalid=""].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid=true i].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid="1"].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[success=""].gov-form-select *[slot=right-icon]:not(.icon-arrow),[success=true i].gov-form-select *[slot=right-icon]:not(.icon-arrow),[success="1"].gov-form-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[multiline=""].gov-form-select *[slot=left-icon],[multiline=""].gov-form-select *[slot=right-icon],[multiline=true i].gov-form-select *[slot=left-icon],[multiline=true i].gov-form-select *[slot=right-icon],[multiline="1"].gov-form-select *[slot=left-icon],[multiline="1"].gov-form-select *[slot=right-icon]{display:none}.gov-form-select{background:none}.gov-form-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-select select::-ms-expand{display:none}[size=s].gov-form-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-select .icon-arrow,[size=s][invalid=true i].gov-form-select .icon-arrow,[size=s][invalid="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=s][success=""].gov-form-select .icon-arrow,[size=s][success=true i].gov-form-select .icon-arrow,[size=s][success="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=m].gov-form-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-select .icon-arrow,[size=m][invalid=true i].gov-form-select .icon-arrow,[size=m][invalid="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=m][success=""].gov-form-select .icon-arrow,[size=m][success=true i].gov-form-select .icon-arrow,[size=m][success="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=l].gov-form-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-select .icon-arrow,[size=l][invalid=true i].gov-form-select .icon-arrow,[size=l][invalid="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=l][success=""].gov-form-select .icon-arrow,[size=l][success=true i].gov-form-select .icon-arrow,[size=l][success="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=xl].gov-form-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-select .icon-arrow,[size=xl][invalid=true i].gov-form-select .icon-arrow,[size=xl][invalid="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=xl][success=""].gov-form-select .icon-arrow,[size=xl][success=true i].gov-form-select .icon-arrow,[size=xl][success="1"].gov-form-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=s][invalid=""].gov-form-select *[slot=right-icon]~select,[size=s][invalid=""].gov-form-select *[slot=right-icon]~input,[size=s][invalid=true i].gov-form-select *[slot=right-icon]~select,[size=s][invalid=true i].gov-form-select *[slot=right-icon]~input,[size=s][invalid="1"].gov-form-select *[slot=right-icon]~select,[size=s][invalid="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=s][success=""].gov-form-select *[slot=right-icon]~select,[size=s][success=""].gov-form-select *[slot=right-icon]~input,[size=s][success=true i].gov-form-select *[slot=right-icon]~select,[size=s][success=true i].gov-form-select *[slot=right-icon]~input,[size=s][success="1"].gov-form-select *[slot=right-icon]~select,[size=s][success="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=m][invalid=""].gov-form-select *[slot=right-icon]~select,[size=m][invalid=""].gov-form-select *[slot=right-icon]~input,[size=m][invalid=true i].gov-form-select *[slot=right-icon]~select,[size=m][invalid=true i].gov-form-select *[slot=right-icon]~input,[size=m][invalid="1"].gov-form-select *[slot=right-icon]~select,[size=m][invalid="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=m][success=""].gov-form-select *[slot=right-icon]~select,[size=m][success=""].gov-form-select *[slot=right-icon]~input,[size=m][success=true i].gov-form-select *[slot=right-icon]~select,[size=m][success=true i].gov-form-select *[slot=right-icon]~input,[size=m][success="1"].gov-form-select *[slot=right-icon]~select,[size=m][success="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=l][invalid=""].gov-form-select *[slot=right-icon]~select,[size=l][invalid=""].gov-form-select *[slot=right-icon]~input,[size=l][invalid=true i].gov-form-select *[slot=right-icon]~select,[size=l][invalid=true i].gov-form-select *[slot=right-icon]~input,[size=l][invalid="1"].gov-form-select *[slot=right-icon]~select,[size=l][invalid="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=l][success=""].gov-form-select *[slot=right-icon]~select,[size=l][success=""].gov-form-select *[slot=right-icon]~input,[size=l][success=true i].gov-form-select *[slot=right-icon]~select,[size=l][success=true i].gov-form-select *[slot=right-icon]~input,[size=l][success="1"].gov-form-select *[slot=right-icon]~select,[size=l][success="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=xl][invalid=""].gov-form-select *[slot=right-icon]~select,[size=xl][invalid=""].gov-form-select *[slot=right-icon]~input,[size=xl][invalid=true i].gov-form-select *[slot=right-icon]~select,[size=xl][invalid=true i].gov-form-select *[slot=right-icon]~input,[size=xl][invalid="1"].gov-form-select *[slot=right-icon]~select,[size=xl][invalid="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}[size=xl][success=""].gov-form-select *[slot=right-icon]~select,[size=xl][success=""].gov-form-select *[slot=right-icon]~input,[size=xl][success=true i].gov-form-select *[slot=right-icon]~select,[size=xl][success=true i].gov-form-select *[slot=right-icon]~input,[size=xl][success="1"].gov-form-select *[slot=right-icon]~select,[size=xl][success="1"].gov-form-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}';const y=b;const k=e(class e extends o{constructor(){super();this.__registerHost();this.govFocus=t(this,"gov-focus",7);this.govBlur=t(this,"gov-blur",7);this.govChange=t(this,"gov-change",7);this.value=undefined;this.options=undefined;this.identifier=undefined;this.variant="secondary";this.size="m";this.name=undefined;this.required=false;this.success=undefined;this.disabled=false;this.invalid=undefined;this.wcagActiveDescendant=undefined;this.wcagControls=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.optionsState=[];this.h=a(this.host);this.f=s(this.h);this.selectId=p("GovSelect")}validateVariant(e){f(l,e,c.root)}validateSize(e){f(n,e,c.root)}watchOptions(e){this.optionsState=z(e)}watchControlAttrs(){this.passControlAttrs()}watchValue(){this.markSelectedValue()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",g(this.invalid));this.f.passAttrToControl("success",g(this.success));this.f.passAttrToControl("disabled",g(this.disabled));this.f.passAttrToControl("type","select")}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.markSelectedValue();this.optionsState=z(this.options)}async componentDidRender(){this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));if(m()){await u(500);await this.validateWcag()}w((()=>this.markSelectedValue()))}markSelectedValue(){this.host.querySelectorAll("option").forEach((e=>{if(e.value===this.value){e.setAttribute("selected","selected")}else{e.removeAttribute("selected")}}))}render(){return i(r,{key:"e517387348cdc343319b7170181cfe8549f225e1",class:c.root,size:this.size,variant:this.variant},this.h.hasSlot("prefix")&&i("slot",{key:"189248b9687820168f5aaec4cd44c81b039fc0aa",name:"prefix"}),i("span",{key:"be1611b8684b47987ee50dcb2ee9469cd37b19ec",class:"element"},i("gov-icon",{key:"b92d964fd19c5df2b68ebeaa743f791f351b5ca6",slot:"right-icon",name:"chevron-down",class:"icon-arrow"}),this.h.hasSlot("right-icon")&&!(this.success||this.invalid)&&i("slot",{key:"20adb5864da3d7fde6b63974a38ed36d07133360",name:"right-icon"}),this.success&&i("gov-icon",{key:"c06681957a1bfd8283150606d9af842944bf0c57",slot:"right-icon",class:"icon-validation",name:"check-lg"}),this.invalid&&i("gov-icon",{key:"e5c4bde2d36fa4d9a8ce0291ec9615ed160b9973",slot:"right-icon",class:"icon-validation",name:"exclamation-lg"}),i("select",{key:"707a4af7513d0f520b1c1a27f00ceeac5543002c",id:this.identifier||this.selectId,onFocus:this.onFocusHandler.bind(this),onChange:this.onChangeHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,name:this.name,disabled:this.disabled,ref:e=>this.selectRef=e,"aria-disabled":v(this.disabled),"aria-activedescendant":this.wcagActiveDescendant,"aria-controls":this.wcagControls,"aria-required":v(this.required),"aria-invalid":v(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns},i("slot",{key:"2065a567ff2d4ac258f3bfe9c264e0b6c6201afe"}),Array.isArray(this.optionsState)&&this.optionsState.map((e=>{var o;return i("option",{value:e.value,selected:e.value===this.value,disabled:e===null||e===void 0?void 0:e.disabled},(o=e.label)!==null&&o!==void 0?o:e.value)})))),this.h.hasSlot("sufix")&&i("slot",{key:"1a876505b0864afe5b24345c6723c50e66187660",name:"sufix"}))}onFocusHandler(e){this.focused=true;this.govFocus.emit({component:c.root,originalEvent:e,value:this.value})}onBlurHandler(e){this.focused=false;this.govBlur.emit({component:c.root,originalEvent:e,value:this.value})}onChangeHandler(e){this.value=e.target.value;e.stopPropagation();this.govChange.emit({component:c.root,originalEvent:e,value:this.value})}async setFocus(e){return this.selectRef.focus(e)}async getRef(){return this.selectRef}async validateWcag(){d(this.wcagActiveDescendant,"wcag-active-descendant",c.root);d(this.wcagControls,"wcag-controls",c.root);d(this.wcagDescribedBy,"wcag-described-by",c.root);d(this.wcagOwns,"wcag-owns",c.root);h(this.identifier||this.selectId,this.wcagLabelledBy,c.root)}get host(){return this}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchControlAttrs"],options:["watchOptions"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"],value:["watchValue"]}}static get style(){return y}},[4,"gov-form-select",{value:[1537],options:[1537],identifier:[1],variant:[1],size:[1],name:[1],required:[4],success:[516],disabled:[516],invalid:[4],wcagActiveDescendant:[1,"wcag-active-descendant"],wcagControls:[1,"wcag-controls"],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagOwns:[1,"wcag-owns"],focused:[32],optionsState:[32],setFocus:[64],getRef:[64],validateWcag:[64]},undefined,{variant:["validateVariant"],size:["validateSize","watchControlAttrs"],options:["watchOptions"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"],value:["watchValue"]}]);function C(){if(typeof customElements==="undefined"){return}const e=["gov-form-select","gov-icon"];e.forEach((e=>{switch(e){case"gov-form-select":if(!customElements.get(e)){customElements.define(e,k)}break;case"gov-icon":if(!customElements.get(e)){x()}break}}))}C();export{k as G,C as d};
|
|
2
|
+
//# sourceMappingURL=p-9f2a08e5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["govFormSelectCss","GovFormSelectStyle0","GovFormSelect","proxyCustomElement","H","constructor","this","h","govHost","host","f","govForm","selectId","createID","validateVariant","newValue","validateProp","FormSelectVariants","FormSelectClass","root","validateSize","FormSelectSizes","watchOptions","optionsState","propsValueToArray","watchControlAttrs","passControlAttrs","watchValue","markSelectedValue","passAttrToControl","size","toBoolAttr","invalid","success","disabled","componentWillLoad","variant","options","componentDidRender","passAttrToLabel","String","required","canValidateWcagOnRender","delay","validateWcag","tick","querySelectorAll","forEach","option","value","setAttribute","removeAttribute","render","Host","key","class","hasSlot","name","slot","id","identifier","onFocus","onFocusHandler","bind","onChange","onChangeHandler","onBlur","onBlurHandler","ref","el","selectRef","toBoolAttrIfDefined","wcagActiveDescendant","wcagControls","wcagDescribedBy","wcagLabelledBy","wcagOwns","Array","isArray","map","selected","_a","label","e","focused","govFocus","emit","component","originalEvent","govBlur","target","stopPropagation","govChange","setFocus","focus","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/select/gov-form-select.scss?tag=gov-form-select","../../../packages/core/src/components/gov-form/select/gov-form-select.tsx"],"sourcesContent":["/*\n * Select\n */\n\n@import \"../select/gov-form-select-core.scss\";\n\n$class: \".gov-form-select\";\n\n#{$class} {\n\t@extend %form-select-core;\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 {createID} from '../../../utils/string.utils'\nimport {delay} from '../../../utils/utils'\nimport {\n\tFormSelectClass,\n\tFormSelectSizes,\n\tFormSelectSizesType,\n\tFormSelectVariants,\n\tFormSelectVariantType\n} from './constants'\nimport {FormSelectEvent, FormSelectOption} from './gov-form-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {tick} from \"../../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-form-select',\n\tstyleUrl: 'gov-form-select.scss',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID('GovSelect')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string\n\t/**\n\t * Options of select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | FormSelectOption[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormSelectVariantType = 'secondary'\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\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 * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop({reflect: true}) readonly success: boolean\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({reflect: true}) 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 id of a related component’s visually focused element.\n\t */\n\t@Prop({attribute: 'wcag-active-descendant'}) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this prop to add an aria-controls attribute. Use the attribute to indicate the id of a component controlled by this component.\n\t */\n\t@Prop({attribute: 'wcag-controls'}) readonly wcagControls: string\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<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\t@State() optionsState: FormSelectOption[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormSelectVariants, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | FormSelectOption[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@Watch('value')\n\twatchValue(): void {\n\t\tthis.markSelectedValue()\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\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('type', 'select')\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\n\t\tthis.markSelectedValue()\n\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t\ttick(() => this.markSelectedValue())\n\t}\n\n\tprivate markSelectedValue() {\n\t\tthis.host.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.value === this.value) {\n\t\t\t\toption.setAttribute('selected', 'selected')\n\t\t\t} else {\n\t\t\t\toption.removeAttribute('selected')\n\t\t\t}\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<gov-icon slot=\"right-icon\" name=\"chevron-down\" class=\"icon-arrow\"></gov-icon>\n\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\"/>}\n\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{this.invalid && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t{Array.isArray(this.optionsState) && this.optionsState.map((option) => {\n\t\t\t\t\t\t\treturn (<option value={option.value} selected={option.value === this.value}\n\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})}\n\t\t\t\t\t</select>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\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 * 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.wcagActiveDescendant, 'wcag-active-descendant', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagControls, 'wcag-controls', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormSelectClass.root)\n\t}\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as i,h as s,d as o}from"./p-5262b9ce.js";import{a}from"./p-d687df8f.js";import{v as n}from"./p-344c72d7.js";import{c as r}from"./p-cd6c2938.js";import{d as h,t as l,h as c}from"./p-e0e2e9c1.js";import{F as m,a as d,b as p}from"./p-77a6e3be.js";import{p as u}from"./p-3f704a40.js";import{d as g}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as t,H as e,c as i,h as s,d as o}from"./p-5262b9ce.js";import{a}from"./p-d687df8f.js";import{v as n}from"./p-344c72d7.js";import{c as r}from"./p-cd6c2938.js";import{d as h,t as l,h as c}from"./p-e0e2e9c1.js";import{F as m,a as d,b as p}from"./p-77a6e3be.js";import{p as u}from"./p-3f704a40.js";import{d as g}from"./p-8ab1afe9.js";import{d as f}from"./p-67f1f6d6.js";const v='.gov-form-autocomplete__list{margin:0;padding:0}.gov-form-autocomplete__list>.gov-form-autocomplete__item{margin:0;padding:0;background:none}.gov-form-autocomplete__list>.gov-form-autocomplete__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-autocomplete{position:relative;display:block;width:100%}.gov-form-autocomplete__list{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);position:absolute;top:100%;right:0;left:0;z-index:5;max-height:14.0625rem;margin-top:0.5rem;border:var(--gov-autocomplete-item-hover, 0.0625rem solid var(--gov-color-secondary-500));border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-autocomplete-bg, var(--gov-color-neutral-white));overflow-x:hidden;overflow-y:auto;overscroll-behavior:none}.gov-form-autocomplete__list>.gov-form-autocomplete__item{padding:0.75rem 0.5rem;cursor:pointer}.gov-form-autocomplete__item--empty,.gov-form-autocomplete__item--loading{padding:0.75rem 0.5rem;color:var(--gov-autocomplete-item-disable-color, var(--gov-color-secondary-600))}.gov-form-autocomplete__item--empty .gov-icon,.gov-form-autocomplete__item--empty .gov-spin-animation,.gov-form-autocomplete__item--loading .gov-icon,.gov-form-autocomplete__item--loading .gov-spin-animation{width:12px;height:12px}.gov-form-autocomplete__list:empty{display:none}.gov-form-autocomplete__item[aria-selected=""],.gov-form-autocomplete__item[aria-selected=true i],.gov-form-autocomplete__item[aria-selected="1"]{background:var(--gov-autocomplete-item-select, var(--gov-color-secondary-400))}@media not all and (pointer: coarse){.gov-form-autocomplete__item:hover{background:var(--gov-autocomplete-item-hover, var(--gov-color-primary-100))}}';const y=v;const b=t(class t extends e{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govInput=i(this,"gov-input",7);this.govSelect=i(this,"gov-select",7);this.templateResolver=t=>t[this.nameKey];this.value="";this.options=undefined;this.identifier=undefined;this.variant=undefined;this.success=undefined;this.size="m";this.nameKey="name";this.name=undefined;this.required=false;this.disabled=false;this.placeholder=undefined;this.readonly=undefined;this.invalid=undefined;this.minlength=3;this.maxlength=undefined;this.throttleTime=200;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.processing=false;this.arrowCounter=-1;this.list=[];this.listBoxId=r("GovListBox")}validateVariant(t){n(d,t,m.root)}validateSize(t){n(p,t,m.root)}watchOptions(t){this.setOptions(u(t)).catch()}onArrowUp(){if(this.arrowCounter>0){this.arrowCounter=this.arrowCounter-1;this.moveToView().finally()}}onArrowDown(){if(this.arrowCounter<this.list.length-1){this.arrowCounter=this.arrowCounter+1;this.moveToView().finally()}}async moveToView(){await h(200);const t=this.listRef.offsetHeight;const e=this.listRef.querySelector('li[aria-selected="true"]');if(e&&t){const t=e.offsetTop;this.listRef.scrollTo({top:t,behavior:"smooth"})}}doSearch(){if(Number.isInteger(this.minlength)&&this.isValueAccepted===false&&this.minlength){this.list=[];this.arrowCounter=-1;this.processing=false;return}if(this.searchCallback){this.processing=true;this.searchCallback(this.value).then((t=>this.list=t)).catch((()=>this.list=[])).finally((()=>{this.arrowCounter=-1;this.processing=false}))}}clearList(){const t=u(this.options);if(t.length===0){this.list=[]}}get isValueAccepted(){if(typeof this.value==="string"){return this.value.length>=this.minlength}else{return false}}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size)}render(){return s(o,{key:"4edb7e993e80b593bfce912e18640dd47bdece95",class:m.root,size:this.size,variant:this.variant},s("gov-form-input",{key:"77b7815152610e937f4125639ce841c66f626aa1",placeholder:this.placeholder,name:this.name,disabled:this.disabled,readonly:this.readonly,autocomplete:false,size:this.size,variant:this.variant,required:this.required,invalid:this.invalid,success:this.success,role:"searchbox",value:this.value,minlength:this.minlength,maxlength:this.maxlength,"on-gov-input":l(this.onInputHandler.bind(this),this.throttleTime),"on-gov-keyup":this.onKeyUpHandler.bind(this),"on-gov-keydown":this.onKeyDownHandler.bind(this),"on-gov-focus":this.onFocusHandler.bind(this),"on-gov-blur":this.onBlurHandler.bind(this),wcagAutocomplete:"list",wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:[this.listBoxId,this.wcagOwns].join(" "),wcagExpanded:this.list.length&&this.focused,ref:t=>this.inputRef=t},s("slot",{key:"49afd3279b906a00975ed68e323db007493cc3c1",slot:"right-icon",name:"right-icon"})),s("ul",{key:"7ca7af32cf949f0c5f2cf9ff7657293a86ada96c",class:m.list,role:"listbox","aria-hidden":a(!this.focused),hidden:!this.focused,id:this.listBoxId,ref:t=>this.listRef=t},this.focused&&this.list.length===0&&this.processing===false&&this.isValueAccepted&&this.messageEmpty?s("li",{class:m.empty},this.messageEmpty):null,this.focused&&this.processing===true&&this.isValueAccepted?s("li",{class:m.loading},s("gov-icon",{name:"loader",class:"gov-spin-animation"})," ",this.messageLoading):null,this.focused?this.list.map(((t,e)=>{const i=this.arrowCounter===e;return s("li",{class:m.item,innerHTML:this.templateResolver(t,i),role:"option","aria-posinset":e,tabindex:i?0:-1,"aria-setsize":this.list.length,onTouchStart:t=>this.onSelectHandler(t,e),onMouseDown:t=>this.onSelectHandler(t,e),"aria-selected":a(i)})})):null))}onFocusHandler(t){this.focused=true;this.arrowCounter=-1;if(this.isValueAccepted&&this.searchCallback){this.doSearch()}t.stopPropagation();this.govFocus.emit({originalEvent:t,component:m.root,value:this.value,selected:null})}onBlurHandler(t){this.focused=false;this.clearList();this.arrowCounter=-1;t.stopPropagation();this.govBlur.emit({originalEvent:t,component:m.root,value:this.value,selected:null})}onInputHandler(t){this.value=t.target.value;t.stopPropagation();this.govInput.emit({originalEvent:t,component:m.root,value:this.value,selected:null});this.doSearch()}onSelectHandler(t,e=-1){let i=null;if(e>-1){i=this.list[e]}else if(c(this.arrowCounter,this.list)){i=this.list[this.arrowCounter]}if(i){this.govSelect.emit({component:m.root,value:this.value,selected:i,originalEvent:t});this.clearList();if(c(this.nameKey,i)&&typeof i[this.nameKey]==="string"){this.value=i[this.nameKey]}}}onKeyUpHandler(t){const e=t.detail.originalEvent;t.stopPropagation();e.stopPropagation();if(e.keyCode===38)this.onArrowUp();else if(e.keyCode===40)this.onArrowDown();else if(e.keyCode===13){t.preventDefault();e.preventDefault();this.onSelectHandler(t)}}onKeyDownHandler(t){const e=t.detail.originalEvent;t.stopPropagation();e.stopPropagation();if(e.keyCode===13){t.preventDefault();e.preventDefault()}}async setFocus(t){return this.inputRef.focus(t)}async setBlur(){return this.inputRef.blur()}async setOptions(t){this.list=Array.isArray(t)?t:[];this.arrowCounter=-1}async clearValue(){this.value="";this.inputRef.value="";await this.inputRef.clearValue()}async setProcessing(t){this.processing=t}async setSearchCallback(t){this.searchCallback=t}async setTemplateResolver(t){this.templateResolver=t}get host(){return this}static get watchers(){return{variant:["validateVariant"],size:["validateSize"],options:["watchOptions"]}}static get style(){return y}},[4,"gov-form-autocomplete",{value:[1537],options:[1537],identifier:[1],variant:[1],success:[4],size:[1],nameKey:[1,"name-key"],name:[1],required:[4],disabled:[516],placeholder:[1],readonly:[4],invalid:[4],minlength:[2],maxlength:[2],throttleTime:[2,"throttle-time"],messageEmpty:[1,"message-empty"],messageLoading:[1,"message-loading"],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagOwns:[1,"wcag-owns"],focused:[32],processing:[32],arrowCounter:[32],list:[32],setFocus:[64],setBlur:[64],setOptions:[64],clearValue:[64],setProcessing:[64],setSearchCallback:[64],setTemplateResolver:[64]},undefined,{variant:["validateVariant"],size:["validateSize"],options:["watchOptions"]}]);function _(){if(typeof customElements==="undefined"){return}const t=["gov-form-autocomplete","gov-form-input","gov-icon"];t.forEach((t=>{switch(t){case"gov-form-autocomplete":if(!customElements.get(t)){customElements.define(t,b)}break;case"gov-form-input":if(!customElements.get(t)){g()}break;case"gov-icon":if(!customElements.get(t)){f()}break}}))}_();export{b as G,_ as d};
|
|
2
|
+
//# sourceMappingURL=p-b62a37d1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["govFormAutocompleteCss","GovFormAutocompleteStyle0","GovFormAutocomplete","proxyCustomElement","H","constructor","this","templateResolver","item","nameKey","listBoxId","createID","validateVariant","newValue","validateProp","FormAutocompleteVariants","FormAutocompleteClass","root","validateSize","FormAutocompleteSizes","watchOptions","setOptions","propsValueToArray","catch","onArrowUp","arrowCounter","moveToView","finally","onArrowDown","list","length","delay","heightOfList","listRef","offsetHeight","selected","querySelector","offsetTop","scrollTo","top","behavior","doSearch","Number","isInteger","minlength","isValueAccepted","processing","searchCallback","value","then","response","clearList","areOptions","options","componentWillLoad","variant","size","render","h","Host","key","class","placeholder","name","disabled","readonly","autocomplete","required","invalid","success","role","maxlength","throttle","onInputHandler","bind","throttleTime","onKeyUpHandler","onKeyDownHandler","onFocusHandler","onBlurHandler","wcagAutocomplete","wcagDescribedBy","wcagLabelledBy","wcagOwns","join","wcagExpanded","focused","ref","el","inputRef","slot","toBoolAttr","hidden","id","messageEmpty","empty","loading","messageLoading","map","index","isSelected","innerHTML","tabindex","onTouchStart","e","onSelectHandler","onMouseDown","stopPropagation","govFocus","emit","originalEvent","component","govBlur","target","govInput","has","govSelect","event","detail","keyCode","preventDefault","setFocus","focus","setBlur","blur","Array","isArray","clearValue","setProcessing","status","setSearchCallback","callback","setTemplateResolver"],"sources":["../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.scss?tag=gov-form-autocomplete","../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"sourcesContent":["$class: \".gov-form-autocomplete\";\n\n#{$class} {\n\t@include base();\n\t&__list {\n\t\t@include typography($font-size-s);\n\t\t@extend %reset-ul;\n\t\tposition: absolute;\n\t\ttop: 100%;\n\t\tright: 0;\n\t\tleft: 0;\n\t\tz-index: 5;\n\t\tmax-height: rem-calc(225);\n\t\tmargin-top: rem-calc(8);\n\t\tborder: $form-autocomplete-border;\n\t\tborder-radius: $border-radius;\n\t\tbackground: $form-autocomplete-bg;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\toverscroll-behavior: none;\n\t}\n\t&__list > &__item {\n\t\t@extend %reset-ul-li;\n\t\tpadding: rem-calc(12 8);\n\t\tcursor: pointer;\n\t}\n\t&__item {\n\t\t&--empty,\n\t\t&--loading {\n\t\t\tpadding: rem-calc(12 8);\n\t\t\tcolor: $form-autocomplete-item-disable-color;\n\t\t\t& .gov-icon,\n\t\t\t& .gov-spin-animation {\n\t\t\t\twidth: 12px;\n\t\t\t\theight: 12px;\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t&__list:empty {\n\t\tdisplay: none;\n\t}\n\n\t// HOVERS\n\t&__item {\n\t\t@include parameter(\"aria-selected\") {\n\t\t\tbackground: $form-autocomplete-item-select-bg;\n\t\t}\n\t\t@include hover() {\n\t\t\tbackground: $form-autocomplete-item-hover-bg;\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {toBoolAttr} from '../../../helpers/Dom/template'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID} from '../../../utils/string.utils'\nimport {delay, has, throttle} from '../../../utils/utils'\nimport {FormInputEvent} from '../input/gov-form-input.types'\nimport {\n\tFormAutocompleteClass,\n\tFormAutocompleteSizes,\n\tFormAutocompleteVariants,\n\tSizesType,\n\tVariantType\n} from './constants'\nimport {FormAutocompleteEvent, GovFormAutocompleteItem} from './gov-form-autocomplete.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\n\n@Component({\n\ttag: 'gov-form-autocomplete',\n\tstyleUrl: 'gov-form-autocomplete.scss',\n})\nexport class GovFormAutocomplete {\n\tprivate inputRef?: HTMLGovFormInputElement\n\tprivate listRef?: HTMLUListElement\n\tprivate readonly listBoxId: string\n\tprivate searchCallback: (value: string) => Promise<GovFormAutocompleteItem[]>\n\tprivate templateResolver: (item: GovFormAutocompleteItem, selected: boolean) => string = item => item[this.nameKey]\n\n\tconstructor() {\n\t\tthis.listBoxId = createID('GovListBox')\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({reflect: true, mutable: true}) value = ''\n\t/**\n\t * Options of autocomplete\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormAutocompleteItem[]\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: VariantType\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 * Input’s size.\n\t */\n\t@Prop() readonly size?: SizesType = 'm'\n\t/**\n\t * Main key name in the object\n\t */\n\t@Prop({attribute: 'name-key'}) readonly nameKey: string = 'name'\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\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 input 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({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\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 * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number = 3\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Input throttle in milliseconds\n\t */\n\t@Prop() readonly throttleTime: number = 200\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 * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-owns\n\t */\n\t@Prop({attribute: 'wcag-owns'}) readonly wcagOwns: string\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-input'}) govInput: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormAutocompleteEvent>\n\t@State() focused: boolean\n\t@State() processing = false\n\t@State() arrowCounter = -1\n\t@State() list: GovFormAutocompleteItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteVariants, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormAutocompleteItem[]): void {\n\t\tthis.setOptions(propsValueToArray(newValue)).catch()\n\t}\n\n\tprivate onArrowUp() {\n\t\tif (this.arrowCounter > 0) {\n\t\t\tthis.arrowCounter = this.arrowCounter - 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate onArrowDown() {\n\t\tif (this.arrowCounter < this.list.length - 1) {\n\t\t\tthis.arrowCounter = this.arrowCounter + 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate async moveToView() {\n\t\tawait delay(200)\n\t\tconst heightOfList = this.listRef.offsetHeight\n\t\tconst selected = this.listRef.querySelector('li[aria-selected=\"true\"]') as HTMLUListElement\n\t\tif (selected && heightOfList) {\n\t\t\tconst offsetTop = selected.offsetTop\n\t\t\tthis.listRef.scrollTo({top: offsetTop, behavior: 'smooth'})\n\t\t}\n\t}\n\n\tprivate doSearch() {\n\t\tif (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {\n\t\t\tthis.list = []\n\t\t\tthis.arrowCounter = -1\n\t\t\tthis.processing = false\n\t\t\treturn\n\t\t}\n\t\tif (this.searchCallback) {\n\t\t\tthis.processing = true\n\t\t\tthis.searchCallback(this.value)\n\t\t\t\t.then(response => (this.list = response))\n\t\t\t\t.catch(() => (this.list = []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.arrowCounter = -1\n\t\t\t\t\tthis.processing = false\n\t\t\t\t})\n\t\t}\n\t}\n\n\tprivate clearList() {\n\t\tconst areOptions = propsValueToArray<GovFormAutocompleteItem[]>(this.options)\n\t\tif (areOptions.length === 0) {\n\t\t\tthis.list = []\n\t\t}\n\t}\n\n\tget isValueAccepted() {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn this.value.length >= this.minlength\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormAutocompleteClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<gov-form-input\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\treadonly={this.readonly}\n\t\t\t\t\tautocomplete={false}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\tsuccess={this.success}\n\t\t\t\t\trole={'searchbox'}\n\t\t\t\t\tvalue={this.value}\n\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\ton-gov-input={throttle(this.onInputHandler.bind(this), this.throttleTime)}\n\t\t\t\t\ton-gov-keyup={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\ton-gov-keydown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\ton-gov-focus={this.onFocusHandler.bind(this)}\n\t\t\t\t\ton-gov-blur={this.onBlurHandler.bind(this)}\n\t\t\t\t\twcagAutocomplete={'list'}\n\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\twcagOwns={[this.listBoxId, this.wcagOwns].join(' ')}\n\t\t\t\t\twcagExpanded={this.list.length && this.focused}\n\t\t\t\t\tref={el => (this.inputRef = el as HTMLGovFormInputElement)}\n\t\t\t\t>\n\t\t\t\t\t<slot slot=\"right-icon\" name=\"right-icon\"/>\n\t\t\t\t</gov-form-input>\n\t\t\t\t<ul class={FormAutocompleteClass.list}\n\t\t\t\t\t\trole={'listbox'}\n\t\t\t\t\t\taria-hidden={toBoolAttr(!this.focused)}\n\t\t\t\t\t\thidden={!this.focused}\n\t\t\t\t\t\tid={this.listBoxId}\n\t\t\t\t\t\tref={el => (this.listRef = el as HTMLUListElement)}>\n\t\t\t\t\t{this.focused && this.list.length === 0 && this.processing === false && this.isValueAccepted && this.messageEmpty ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.empty}>{this.messageEmpty}</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused && this.processing === true && this.isValueAccepted ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.loading}>\n\t\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>\n\t\t\t\t\t\t\t {this.messageLoading}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused ? this.list.map((item, index) => {\n\t\t\t\t\t\tconst isSelected = this.arrowCounter === index\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tclass={FormAutocompleteClass.item}\n\t\t\t\t\t\t\t\tinnerHTML={this.templateResolver(item, isSelected)}\n\t\t\t\t\t\t\t\trole={'option'}\n\t\t\t\t\t\t\t\taria-posinset={index}\n\t\t\t\t\t\t\t\ttabindex={isSelected ? 0 : -1}\n\t\t\t\t\t\t\t\taria-setsize={this.list.length}\n\t\t\t\t\t\t\t\tonTouchStart={(e: TouchEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\tonMouseDown={(e: PointerEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\taria-selected={toBoolAttr(isSelected)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t}) : null}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.arrowCounter = -1\n\t\tif (this.isValueAccepted && this.searchCallback) {\n\t\t\tthis.doSearch()\n\t\t}\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.clearList();\n\t\tthis.arrowCounter = -1\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLGovFormInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t\tthis.doSearch()\n\t}\n\n\tprivate onSelectHandler(e: PointerEvent | CustomEvent | TouchEvent, index = -1) {\n\t\tlet selected: Nullable<GovFormAutocompleteItem> = null\n\t\tif (index > -1) {\n\t\t\tselected = this.list[index]\n\t\t} else if (has(this.arrowCounter, this.list)) {\n\t\t\tselected = this.list[this.arrowCounter]\n\t\t}\n\t\tif (selected) {\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\tselected: selected,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t\tthis.clearList();\n\t\t\tif (has(this.nameKey, selected) && typeof selected[this.nameKey] === 'string') {\n\t\t\t\tthis.value = selected[this.nameKey]\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onKeyUpHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 38) this.onArrowUp()\n\t\telse if (event.keyCode === 40) this.onArrowDown()\n\t\telse if (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t\tthis.onSelectHandler(e)\n\t\t}\n\t}\n\n\tprivate onKeyDownHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t}\n\t}\n\n\t/**\n\t * Focus main input element\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Blur main input element\n\t */\n\t@Method()\n\tasync setBlur(): Promise<void> {\n\t\treturn this.inputRef.blur()\n\t}\n\n\t/**\n\t * Set options for list\n\t */\n\t@Method()\n\tasync setOptions(options: GovFormAutocompleteItem[]): Promise<void> {\n\t\tthis.list = Array.isArray(options) ? options : []\n\t\tthis.arrowCounter = -1\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\n\t\tawait this.inputRef.clearValue()\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync setProcessing(status: boolean): Promise<void> {\n\t\tthis.processing = status\n\t}\n\n\t/**\n\t * Set a custom asynchronous function for the whisperer\n\t */\n\t@Method()\n\tasync setSearchCallback(callback: (value: string) => Promise<any>) {\n\t\tthis.searchCallback = callback\n\t}\n\n\t/**\n\t * Setting a custom whisper result template\n\t * @param callback\n\t */\n\t@Method()\n\tasync setTemplateResolver(callback: (item: GovFormAutocompleteItem) => string) {\n\t\tthis.templateResolver = callback\n\t}\n}\n"],"mappings":"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","ignoreList":[]}
|
package/dist/core/core.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as a,b as l}from"./p-240659bb.js";export{s as setNonce}from"./p-240659bb.js";import{g as i}from"./p-e1255160.js";var t=()=>{{c(a.prototype)}const l=import.meta.url;const i={};if(l!==""){i.resourcesUrl=new URL(".",l).href}return e(i)};var c=e=>{const a=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return a.call(this,e)}const l=a.call(this,false);const i=this.childNodes;if(e){for(let e=0;e<i.length;e++){if(i[e].nodeType!==2){l.appendChild(i[e].cloneNode(true))}}}return l}};t().then((async e=>{await i();return l(JSON.parse('[["p-1005135a",[[4,"gov-form-file",{"expanded":[4],"required":[4],"disabled":[4],"resetAfterPick":[4,"reset-after-pick"],"ignoreFileDuplicationCheck":[4,"ignore-file-duplication-check"],"displayAttachments":[4,"display-attachments"],"name":[1],"accept":[1],"multiple":[4],"maxFileSize":[2,"max-file-size"],"identifier":[1],"invalid":[4],"errorSize":[1,"error-size"],"errorAccept":[1,"error-accept"],"attachmentsLabel":[1,"attachments-label"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagRemoveLabel":[1,"wcag-remove-label"],"wcagAttachmentsLabel":[1,"wcag-attachments-label"],"files":[32],"getRef":[64],"getAreaRef":[64],"reset":[64],"validateWcag":[64]},null,{"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-3b8fb675",[[4,"gov-form-multi-select",{"value":[1537],"options":[1537],"identifier":[1],"placeholder":[1],"variant":[1],"size":[1],"name":[1],"hideSelectedList":[4,"hide-selected-list"],"required":[4],"disabled":[4],"invalid":[4],"success":[4],"messageEmpty":[1,"message-empty"],"messageLoading":[1,"message-loading"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagOwns":[1,"wcag-owns"],"focused":[32],"valueState":[32],"selectedOptionsState":[32],"optionsState":[32],"setFocus":[64],"setValue":[64],"getRef":[64],"validateWcag":[64]},null,{"variant":["validateVariant"],"size":["validateSize","watchControlAttrs"],"options":["watchOptions"],"value":["watchValue"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"],"success":["watchControlAttrs"]}]]],["p-cc83b8cb",[[4,"gov-modal",{"open":[1028],"blockClose":[4,"block-close"],"blockBackdropClose":[4,"block-backdrop-close"],"blockButtonClose":[4,"block-button-close"],"label":[1],"role":[1],"labelTag":[1,"label-tag"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagCloseLabel":[1,"wcag-close-label"],"wcagCloseLabelledBy":[1,"wcag-close-labelled-by"],"show":[64],"hide":[64],"validateWcag":[64]},null,{"labelTag":["validateLabelTag"],"open":["watchOpen"]}]]],["p-87b7b469",[[0,"gov-pagination",{"type":[1],"current":[2],"total":[2],"inverse":[4],"selectIdentifier":[1,"select-identifier"],"size":[1],"variant":[1],"pageSize":[2,"page-size"],"maxPages":[2,"max-pages"],"link":[1],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagSelectLabel":[1,"wcag-select-label"],"wcagPageLabel":[1,"wcag-page-label"],"labelPrev":[1,"label-prev"],"labelStart":[1,"label-start"],"labelNext":[1,"label-next"],"labelEnd":[1,"label-end"],"pagination":[32],"validateWcag":[64]},null,{"type":["validateType"],"size":["validateSize"],"variant":["validateVariant"],"current":["recalculate"],"total":["recalculate"],"pageSize":["recalculate"],"maxPages":["recalculate"]}]]],["p-20ae3168",[[4,"gov-prompt",{"open":[1028],"label":[1],"role":[1],"labelTag":[1,"label-tag"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagCloseLabel":[1,"wcag-close-label"],"wcagCloseLabelledBy":[1,"wcag-close-labelled-by"],"show":[64],"hide":[64],"validateWcag":[64]},null,{"labelTag":["validateLabelTag"],"open":["watchOpen"]}]]],["p-1b3143a8",[[4,"gov-tabs",{"type":[1],"variant":[1],"orientation":[1],"wcagLabel":[1,"wcag-label"],"wcagSelectLabel":[1,"wcag-select-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"controllers":[32],"focusIndex":[32],"compactControls":[32],"refresh":[64],"currentTab":[64],"setActiveTab":[64],"rerender":[64],"validateWcag":[64]},null,{"type":["validateType"],"variant":["validateVariant"]}]]],["p-208c99c8",[[4,"gov-breadcrumbs",{"collapsible":[4],"isExpanded":[4,"is-expanded"],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labeled-by"],"wcagToggleLabel":[1,"wcag-toggle-label"],"collapsed":[32],"toggleOption":[32],"validateWcag":[64]}]]],["p-cdaeb7d8",[[4,"gov-infobar",{"headline":[1],"variant":[1],"role":[1],"inverse":[4],"wcagCloseLabel":[1,"wcag-close-label"],"wcagToggleLabel":[1,"wcag-toggle-label"],"closable":[4],"toggleContent":[32],"validateWcag":[64]},null,{"variant":["validateVariant"]}]]],["p-828e8bce",[[4,"gov-loading"]]],["p-e9bcadf1",[[4,"gov-side-nav-item",{"inverse":[4],"compact":[4],"identifier":[1],"count":[4],"label":[1],"disabled":[4],"href":[1],"isExpanded":[4,"is-expanded"],"isExpandedState":[32],"open":[64],"close":[64],"toggle":[64],"currentState":[64]},null,{"label":["validateLabel"]}]]],["p-34d7c203",[[4,"gov-toast",{"variant":[1],"gravity":[1],"position":[1],"type":[1],"time":[2],"closeLabel":[1,"close-label"],"wcagCloseLabel":[1,"wcag-close-label"],"destroy":[64]},null,{"variant":["validateVariant"]}]]],["p-6d894ec7",[[4,"gov-tooltip-content",{"variant":[1],"size":[1],"persist":[4],"isVisible":[1028,"is-visible"],"parentId":[1,"parent-id"]},null,{"isVisible":["visibleContent"]}]]],["p-4ed064db",[[4,"gov-accordion-item",{"variant":[1],"identifier":[1],"size":[1],"disabled":[4],"isExpanded":[1028,"is-expanded"],"isExpandedState":[32],"open":[64],"close":[64],"toggle":[64],"currentState":[64]},null,{"size":["validateSize"],"variant":["validateVariant"]}]]],["p-bcdf6cfc",[[4,"gov-card",{"promotion":[4],"label":[1],"collapsible":[4],"expanded":[4],"headlineTag":[1,"headline-tag"],"wcagTriggerLabel":[1,"wcag-trigger-label"],"wcagTriggerLabelledBy":[1,"wcag-trigger-labelled-by"],"isExpanded":[32],"open":[64],"close":[64],"validateWcag":[64]},null,{"headlineTag":["validateHeadlineTag"]}]]],["p-4f77a766",[[4,"gov-form-checkbox",{"value":[1],"checked":[1540],"required":[4],"disabled":[4],"name":[1],"size":[1],"identifier":[1],"noLabel":[4,"no-label"],"invalid":[4],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"getRef":[64],"validateWcag":[64]},null,{"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-810f0d0c",[[4,"gov-tag",{"inverse":[4],"iconLeft":[1,"icon-left"],"iconRight":[1,"icon-right"],"size":[513],"variant":[513]},null,{"variant":["validateVariant"],"size":["validateSize"]}]]],["p-1bdc04bb",[[4,"gov-tile",{"href":[513],"target":[1],"getTriggerRef":[64]}]]],["p-2186fcd5",[[4,"gov-wizard-item",{"variant":[1],"size":[1],"identifier":[1],"collapsible":[4],"annotation":[1],"label":[1],"disabled":[4],"isExpanded":[1028,"is-expanded"],"labelTag":[1,"label-tag"],"open":[64],"close":[64],"toggle":[64],"currentState":[64]},null,{"label":["validateLabel"],"labelTag":["validateTriggerTag"],"variant":["validateVariant"]}]]],["p-6789b9d0",[[4,"gov-accordion",{"size":[1],"variant":[1],"noBorder":[4,"no-border"],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]},null,{"size":["validateSize"],"variant":["validateVariant"]}]]],["p-b2b254b6",[[4,"gov-container",{"slottedChildren":[64]}]]],["p-ae4321ea",[[4,"gov-control-group",{"variant":[1],"noBorder":[4,"no-border"]},null,{"variant":["validateVariant"]}]]],["p-64353313",[[4,"gov-cookiebar"]]],["p-092b0437",[[4,"gov-dropdown",{"identifier":[1],"open":[1028],"position":[1],"getState":[64],"setOpen":[64]}]]],["p-3309aed9",[[4,"gov-empty"]]],["p-802909c5",[[4,"gov-error-code"]]],["p-4700508c",[[4,"gov-form-checkbox-group",{"gap":[1],"orientation":[1],"value":[1025]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-f9de3c09",[[4,"gov-form-control",{"identifier":[1],"invalid":[516],"disabled":[516],"success":[516],"fieldset":[4],"size":[1]}]]],["p-6a82c6a1",[[4,"gov-form-group",{"gap":[1],"orientation":[1]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-06e9e93b",[[4,"gov-form-label",{"identifier":[1],"size":[1],"required":[4],"legend":[4]}]]],["p-f2edcca7",[[4,"gov-form-password-power",{"power":[514]}]]],["p-3e041d63",[[4,"gov-form-radio",{"value":[1],"noLabel":[4,"no-label"],"checked":[1540],"required":[4],"disabled":[4],"name":[1],"size":[1],"identifier":[1],"invalid":[4],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"getRef":[64],"validateWcag":[64]},null,{"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-74233183",[[4,"gov-form-radio-group",{"gap":[1],"orientation":[1],"value":[1025]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-3ccab2ba",[[4,"gov-form-search",{"variant":[513]}]]],["p-2e881577",[[4,"gov-form-switch",{"value":[1],"noLabel":[4,"no-label"],"checked":[1540],"required":[4],"disabled":[4],"name":[1],"size":[1],"identifier":[1],"invalid":[4],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"getRef":[64],"validateWcag":[64]},null,{"size":["validateSize","watchDisabled"],"disabled":["watchDisabled"],"invalid":["watchDisabled"]}]]],["p-5c3a0b02",[[4,"gov-grid",{"alignX":[1,"align-x"],"alignY":[1,"align-y"]}]]],["p-107a6a5c",[[4,"gov-grid-item",{"size":[1],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]}]]],["p-f16f9116",[[4,"gov-layout",{"type":[1],"variant":[1],"inverse":[4]}]]],["p-d4b50bcd",[[4,"gov-layout-column"]]],["p-7e43f440",[[0,"gov-lifecycle"]]],["p-8fb45e7c",[[4,"gov-message",{"variant":[1]},null,{"variant":["validateVariant"]}]]],["p-55cd3fee",[[4,"gov-nav",{"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]}]]],["p-55abc7bc",[[4,"gov-nav-item",{"href":[1],"isExpandedState":[32]},null,{"href":["validateHref"]}]]],["p-6dfde487",[[4,"gov-side-nav",{"inverse":[4],"compact":[4],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]}]]],["p-551c9f44",[[0,"gov-skeleton",{"variant":[1],"count":[2],"shape":[1],"width":[1],"height":[1],"animation":[1],"wcagLabel":[1,"wcag-label"],"validateWcag":[64]},null,{"variant":["validateVariant"],"shape":["validateShape"],"animation":["validateAnimation"]}]]],["p-348165e2",[[0,"gov-spacer",{"size":[1],"breakpoint":[1]},null,{"size":["validateSize"],"breakpoint":["validateBreakpoint"]}]]],["p-7d011c4b",[[4,"gov-statsbar",{"iconPosition":[1,"icon-position"],"variant":[1]},null,{"iconPosition":["validateIconPosition"],"variant":["validateVariant"]}]]],["p-489f5c82",[[4,"gov-statsbar-item",{"iconPosition":[1,"icon-position"]},null,{"iconPosition":["validateIconPosition"]}]]],["p-13ced376",[[4,"gov-stepper",{"size":[1]},null,{"size":["validateSize"]}]]],["p-7ba4ae8d",[[4,"gov-stepper-item",{"variant":[1],"size":[1],"identifier":[1],"label":[1],"annotation":[1],"triggerTag":[1,"trigger-tag"],"isExpandedState":[32],"currentState":[64]},null,{"label":["validateLabel"],"triggerTag":["validateTriggerTag"],"variant":["validateVariant"]}]]],["p-7a896683",[[4,"gov-tabs-item",{"identifier":[1],"triggerIdentifier":[1,"trigger-identifier"],"label":[513],"disabled":[516],"default":[4],"isActive":[32],"getIdentifier":[64],"getTriggerIdentifier":[64],"getDisableState":[64],"setActiveStatus":[64]},null,{"label":["rerenderParent"],"disabled":["rerenderParent"]}]]],["p-13520b30",[[4,"gov-tiles",{"columns":[2],"noBorder":[4,"no-border"]}]]],["p-f6a98765",[[4,"gov-tooltip",{"variant":[1],"size":[1],"position":[1025],"message":[1],"identifier":[1],"icon":[516],"persist":[32],"show":[64],"hide":[64]},null,{"variant":["validateVariant"],"size":["validateSize"],"position":["validatePosition"],"message":["rerenderMessage"]}]]],["p-1011ca26",[[4,"gov-wizard",{"size":[1],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]},null,{"size":["validateSize"]}]]],["p-14a87c92",[[0,"gov-icon",{"name":[1],"type":[1],"iconData":[32],"visible":[32],"error":[32]},null,{"name":["loadIconPathData"]}]]],["p-6c33492a",[[4,"gov-form-input",{"value":[1537],"identifier":[1],"variant":[1],"success":[516],"size":[1],"name":[1],"multiline":[4],"rows":[2],"cols":[2],"required":[516],"disabled":[516],"placeholder":[1],"readonly":[4],"minlength":[2],"maxlength":[2],"min":[8],"max":[8],"autocomplete":[4],"autocorrect":[4],"spellcheck":[4],"inputLang":[1,"input-lang"],"type":[1],"inputType":[1,"input-type"],"role":[1],"invalid":[516],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagOwns":[1,"wcag-owns"],"wcagAutocomplete":[1,"wcag-autocomplete"],"wcagExpanded":[4,"wcag-expanded"],"focused":[32],"setFocus":[64],"setValue":[64],"clearValue":[64],"getRef":[64],"validateWcag":[64]},null,{"variant":["validateVariant"],"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"],"success":["watchControlAttrs"]}]]],["p-3832de64",[[4,"gov-form-autocomplete",{"value":[1537],"options":[1537],"identifier":[1],"variant":[1],"success":[4],"size":[1],"nameKey":[1,"name-key"],"name":[1],"required":[4],"disabled":[4],"placeholder":[1],"readonly":[4],"invalid":[4],"minlength":[2],"maxlength":[2],"throttleTime":[2,"throttle-time"],"messageEmpty":[1,"message-empty"],"messageLoading":[1,"message-loading"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagOwns":[1,"wcag-owns"],"focused":[32],"processing":[32],"arrowCounter":[32],"list":[32],"setFocus":[64],"setBlur":[64],"setOptions":[64],"clearValue":[64],"setProcessing":[64],"setSearchCallback":[64],"setTemplateResolver":[64]},null,{"variant":["validateVariant"],"size":["validateSize"],"options":["watchOptions"]}]]],["p-2c3697cf",[[4,"gov-chip",{"inverse":[4],"disabled":[4],"href":[1],"target":[1],"iconLeft":[1,"icon-left"],"iconRight":[1,"icon-right"],"size":[1],"tag":[1],"variant":[1],"focusable":[4],"identifier":[1],"wcagLabel":[1,"wcag-label"],"wcagControls":[1,"wcag-controls"],"wcagSelected":[4,"wcag-selected"],"getTriggerRef":[64],"getTriggerIdentifier":[64],"setFocus":[64]},null,{"variant":["validateVariant"],"size":["validateSize"]}]]],["p-d4f2d6f9",[[4,"gov-form-select",{"value":[1537],"options":[1537],"identifier":[1],"variant":[1],"size":[1],"name":[1],"required":[4],"success":[4],"disabled":[4],"invalid":[4],"wcagActiveDescendant":[1,"wcag-active-descendant"],"wcagControls":[1,"wcag-controls"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagOwns":[1,"wcag-owns"],"focused":[32],"optionsState":[32],"setFocus":[64],"getRef":[64],"validateWcag":[64]},null,{"variant":["validateVariant"],"size":["validateSize","watchControlAttrs"],"options":["watchOptions"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"],"success":["watchControlAttrs"],"value":["watchValue"]}]]],["p-4694b4b6",[[4,"gov-attachments-item",{"wcagRemoveLabel":[1,"wcag-remove-label"],"wcagRemoveLabelledBy":[1,"wcag-remove-labelled-by"],"validateWcag":[64]}],[4,"gov-attachments",{"label":[1],"wcagLabel":[1,"wcag-label"],"validateWcag":[64]}],[4,"gov-form-message",{"variant":[1],"identifier":[64]},null,{"variant":["validateVariant"]}]]],["p-114a4d0b",[[0,"gov-backdrop",{"inverse":[4],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]}]]],["p-77892071",[[4,"gov-button",{"variant":[513],"size":[513],"type":[513],"expanded":[516],"inverse":[516],"name":[1],"iconLeft":[1,"icon-left"],"iconRight":[1,"icon-right"],"disabled":[516],"nativeType":[1,"native-type"],"href":[1],"target":[1],"download":[4],"hreflang":[1],"referrerpolicy":[1],"rel":[1],"loading":[1],"focusable":[4],"identifier":[1],"wcagActiveDescendant":[1,"wcag-active-descendant"],"wcagControls":[1,"wcag-controls"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagDescription":[1,"wcag-description"],"wcagDetails":[1,"wcag-details"],"wcagExpanded":[4,"wcag-expanded"],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagOwns":[1,"wcag-owns"],"wcagHasPopup":[1,"wcag-has-popup"],"wcagPressed":[4,"wcag-pressed"],"wcagCurrent":[1,"wcag-current"],"setFocus":[64],"getTriggerRef":[64],"validateWcag":[64]},null,{"variant":["validateVariant"],"type":["validateType"],"size":["validateSize"],"nativeType":["validateNativeType"]}]]]]'),e)}));
|
|
1
|
+
import{p as e,H as a,b as l}from"./p-240659bb.js";export{s as setNonce}from"./p-240659bb.js";import{g as i}from"./p-e1255160.js";var t=()=>{{c(a.prototype)}const l=import.meta.url;const i={};if(l!==""){i.resourcesUrl=new URL(".",l).href}return e(i)};var c=e=>{const a=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return a.call(this,e)}const l=a.call(this,false);const i=this.childNodes;if(e){for(let e=0;e<i.length;e++){if(i[e].nodeType!==2){l.appendChild(i[e].cloneNode(true))}}}return l}};t().then((async e=>{await i();return l(JSON.parse('[["p-c8b69610",[[4,"gov-form-file",{"expanded":[4],"required":[4],"disabled":[516],"resetAfterPick":[4,"reset-after-pick"],"ignoreFileDuplicationCheck":[4,"ignore-file-duplication-check"],"displayAttachments":[4,"display-attachments"],"name":[1],"accept":[1],"multiple":[4],"maxFileSize":[2,"max-file-size"],"identifier":[1],"invalid":[4],"errorSize":[1,"error-size"],"errorAccept":[1,"error-accept"],"attachmentsLabel":[1,"attachments-label"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagRemoveLabel":[1,"wcag-remove-label"],"wcagAttachmentsLabel":[1,"wcag-attachments-label"],"files":[32],"getRef":[64],"getAreaRef":[64],"reset":[64],"validateWcag":[64]},null,{"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-d90d1c7d",[[4,"gov-form-multi-select",{"value":[1537],"options":[1537],"identifier":[1],"placeholder":[1],"variant":[1],"size":[1],"name":[1],"hideSelectedList":[4,"hide-selected-list"],"required":[4],"disabled":[516],"invalid":[4],"success":[4],"messageEmpty":[1,"message-empty"],"messageLoading":[1,"message-loading"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagOwns":[1,"wcag-owns"],"focused":[32],"valueState":[32],"selectedOptionsState":[32],"optionsState":[32],"setFocus":[64],"setValue":[64],"getRef":[64],"validateWcag":[64]},null,{"variant":["validateVariant"],"size":["validateSize","watchControlAttrs"],"options":["watchOptions"],"value":["watchValue"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"],"success":["watchControlAttrs"]}]]],["p-cc83b8cb",[[4,"gov-modal",{"open":[1028],"blockClose":[4,"block-close"],"blockBackdropClose":[4,"block-backdrop-close"],"blockButtonClose":[4,"block-button-close"],"label":[1],"role":[1],"labelTag":[1,"label-tag"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagCloseLabel":[1,"wcag-close-label"],"wcagCloseLabelledBy":[1,"wcag-close-labelled-by"],"show":[64],"hide":[64],"validateWcag":[64]},null,{"labelTag":["validateLabelTag"],"open":["watchOpen"]}]]],["p-87b7b469",[[0,"gov-pagination",{"type":[1],"current":[2],"total":[2],"inverse":[4],"selectIdentifier":[1,"select-identifier"],"size":[1],"variant":[1],"pageSize":[2,"page-size"],"maxPages":[2,"max-pages"],"link":[1],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagSelectLabel":[1,"wcag-select-label"],"wcagPageLabel":[1,"wcag-page-label"],"labelPrev":[1,"label-prev"],"labelStart":[1,"label-start"],"labelNext":[1,"label-next"],"labelEnd":[1,"label-end"],"pagination":[32],"validateWcag":[64]},null,{"type":["validateType"],"size":["validateSize"],"variant":["validateVariant"],"current":["recalculate"],"total":["recalculate"],"pageSize":["recalculate"],"maxPages":["recalculate"]}]]],["p-20ae3168",[[4,"gov-prompt",{"open":[1028],"label":[1],"role":[1],"labelTag":[1,"label-tag"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagCloseLabel":[1,"wcag-close-label"],"wcagCloseLabelledBy":[1,"wcag-close-labelled-by"],"show":[64],"hide":[64],"validateWcag":[64]},null,{"labelTag":["validateLabelTag"],"open":["watchOpen"]}]]],["p-1b3143a8",[[4,"gov-tabs",{"type":[1],"variant":[1],"orientation":[1],"wcagLabel":[1,"wcag-label"],"wcagSelectLabel":[1,"wcag-select-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"controllers":[32],"focusIndex":[32],"compactControls":[32],"refresh":[64],"currentTab":[64],"setActiveTab":[64],"rerender":[64],"validateWcag":[64]},null,{"type":["validateType"],"variant":["validateVariant"]}]]],["p-208c99c8",[[4,"gov-breadcrumbs",{"collapsible":[4],"isExpanded":[4,"is-expanded"],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labeled-by"],"wcagToggleLabel":[1,"wcag-toggle-label"],"collapsed":[32],"toggleOption":[32],"validateWcag":[64]}]]],["p-cdaeb7d8",[[4,"gov-infobar",{"headline":[1],"variant":[1],"role":[1],"inverse":[4],"wcagCloseLabel":[1,"wcag-close-label"],"wcagToggleLabel":[1,"wcag-toggle-label"],"closable":[4],"toggleContent":[32],"validateWcag":[64]},null,{"variant":["validateVariant"]}]]],["p-828e8bce",[[4,"gov-loading"]]],["p-e9bcadf1",[[4,"gov-side-nav-item",{"inverse":[4],"compact":[4],"identifier":[1],"count":[4],"label":[1],"disabled":[4],"href":[1],"isExpanded":[4,"is-expanded"],"isExpandedState":[32],"open":[64],"close":[64],"toggle":[64],"currentState":[64]},null,{"label":["validateLabel"]}]]],["p-34d7c203",[[4,"gov-toast",{"variant":[1],"gravity":[1],"position":[1],"type":[1],"time":[2],"closeLabel":[1,"close-label"],"wcagCloseLabel":[1,"wcag-close-label"],"destroy":[64]},null,{"variant":["validateVariant"]}]]],["p-6d894ec7",[[4,"gov-tooltip-content",{"variant":[1],"size":[1],"persist":[4],"isVisible":[1028,"is-visible"],"parentId":[1,"parent-id"]},null,{"isVisible":["visibleContent"]}]]],["p-4ed064db",[[4,"gov-accordion-item",{"variant":[1],"identifier":[1],"size":[1],"disabled":[4],"isExpanded":[1028,"is-expanded"],"isExpandedState":[32],"open":[64],"close":[64],"toggle":[64],"currentState":[64]},null,{"size":["validateSize"],"variant":["validateVariant"]}]]],["p-bcdf6cfc",[[4,"gov-card",{"promotion":[4],"label":[1],"collapsible":[4],"expanded":[4],"headlineTag":[1,"headline-tag"],"wcagTriggerLabel":[1,"wcag-trigger-label"],"wcagTriggerLabelledBy":[1,"wcag-trigger-labelled-by"],"isExpanded":[32],"open":[64],"close":[64],"validateWcag":[64]},null,{"headlineTag":["validateHeadlineTag"]}]]],["p-4f77a766",[[4,"gov-form-checkbox",{"value":[1],"checked":[1540],"required":[4],"disabled":[516],"name":[1],"size":[513],"identifier":[1],"noLabel":[4,"no-label"],"invalid":[4],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"getRef":[64],"validateWcag":[64]},null,{"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-810f0d0c",[[4,"gov-tag",{"inverse":[4],"iconLeft":[1,"icon-left"],"iconRight":[1,"icon-right"],"size":[513],"variant":[513]},null,{"variant":["validateVariant"],"size":["validateSize"]}]]],["p-1bdc04bb",[[4,"gov-tile",{"href":[513],"target":[1],"getTriggerRef":[64]}]]],["p-2186fcd5",[[4,"gov-wizard-item",{"variant":[1],"size":[1],"identifier":[1],"collapsible":[4],"annotation":[1],"label":[1],"disabled":[4],"isExpanded":[1028,"is-expanded"],"labelTag":[1,"label-tag"],"open":[64],"close":[64],"toggle":[64],"currentState":[64]},null,{"label":["validateLabel"],"labelTag":["validateTriggerTag"],"variant":["validateVariant"]}]]],["p-6789b9d0",[[4,"gov-accordion",{"size":[1],"variant":[1],"noBorder":[4,"no-border"],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]},null,{"size":["validateSize"],"variant":["validateVariant"]}]]],["p-b2b254b6",[[4,"gov-container",{"slottedChildren":[64]}]]],["p-ae4321ea",[[4,"gov-control-group",{"variant":[1],"noBorder":[4,"no-border"]},null,{"variant":["validateVariant"]}]]],["p-64353313",[[4,"gov-cookiebar"]]],["p-092b0437",[[4,"gov-dropdown",{"identifier":[1],"open":[1028],"position":[1],"getState":[64],"setOpen":[64]}]]],["p-3309aed9",[[4,"gov-empty"]]],["p-802909c5",[[4,"gov-error-code"]]],["p-4700508c",[[4,"gov-form-checkbox-group",{"gap":[1],"orientation":[1],"value":[1025]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-f9de3c09",[[4,"gov-form-control",{"identifier":[1],"invalid":[516],"disabled":[516],"success":[516],"fieldset":[4],"size":[1]}]]],["p-6a82c6a1",[[4,"gov-form-group",{"gap":[1],"orientation":[1]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-06e9e93b",[[4,"gov-form-label",{"identifier":[1],"size":[1],"required":[4],"legend":[4]}]]],["p-f2edcca7",[[4,"gov-form-password-power",{"power":[514]}]]],["p-3e041d63",[[4,"gov-form-radio",{"value":[1],"noLabel":[4,"no-label"],"checked":[1540],"required":[4],"disabled":[516],"name":[1],"size":[1],"identifier":[1],"invalid":[4],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"getRef":[64],"validateWcag":[64]},null,{"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-74233183",[[4,"gov-form-radio-group",{"gap":[1],"orientation":[1],"value":[1025]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-3ccab2ba",[[4,"gov-form-search",{"variant":[513]}]]],["p-2e881577",[[4,"gov-form-switch",{"value":[1],"noLabel":[4,"no-label"],"checked":[1540],"required":[4],"disabled":[516],"name":[1],"size":[513],"identifier":[1],"invalid":[4],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"getRef":[64],"validateWcag":[64]},null,{"size":["validateSize","watchDisabled"],"disabled":["watchDisabled"],"invalid":["watchDisabled"]}]]],["p-5c3a0b02",[[4,"gov-grid",{"alignX":[1,"align-x"],"alignY":[1,"align-y"]}]]],["p-107a6a5c",[[4,"gov-grid-item",{"size":[1],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]}]]],["p-f16f9116",[[4,"gov-layout",{"type":[1],"variant":[1],"inverse":[4]}]]],["p-d4b50bcd",[[4,"gov-layout-column"]]],["p-7e43f440",[[0,"gov-lifecycle"]]],["p-8fb45e7c",[[4,"gov-message",{"variant":[1]},null,{"variant":["validateVariant"]}]]],["p-55cd3fee",[[4,"gov-nav",{"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]}]]],["p-55abc7bc",[[4,"gov-nav-item",{"href":[1],"isExpandedState":[32]},null,{"href":["validateHref"]}]]],["p-6dfde487",[[4,"gov-side-nav",{"inverse":[4],"compact":[4],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]}]]],["p-551c9f44",[[0,"gov-skeleton",{"variant":[1],"count":[2],"shape":[1],"width":[1],"height":[1],"animation":[1],"wcagLabel":[1,"wcag-label"],"validateWcag":[64]},null,{"variant":["validateVariant"],"shape":["validateShape"],"animation":["validateAnimation"]}]]],["p-348165e2",[[0,"gov-spacer",{"size":[1],"breakpoint":[1]},null,{"size":["validateSize"],"breakpoint":["validateBreakpoint"]}]]],["p-7d011c4b",[[4,"gov-statsbar",{"iconPosition":[1,"icon-position"],"variant":[1]},null,{"iconPosition":["validateIconPosition"],"variant":["validateVariant"]}]]],["p-489f5c82",[[4,"gov-statsbar-item",{"iconPosition":[1,"icon-position"]},null,{"iconPosition":["validateIconPosition"]}]]],["p-13ced376",[[4,"gov-stepper",{"size":[1]},null,{"size":["validateSize"]}]]],["p-7ba4ae8d",[[4,"gov-stepper-item",{"variant":[1],"size":[1],"identifier":[1],"label":[1],"annotation":[1],"triggerTag":[1,"trigger-tag"],"isExpandedState":[32],"currentState":[64]},null,{"label":["validateLabel"],"triggerTag":["validateTriggerTag"],"variant":["validateVariant"]}]]],["p-7a896683",[[4,"gov-tabs-item",{"identifier":[1],"triggerIdentifier":[1,"trigger-identifier"],"label":[513],"disabled":[516],"default":[4],"isActive":[32],"getIdentifier":[64],"getTriggerIdentifier":[64],"getDisableState":[64],"setActiveStatus":[64]},null,{"label":["rerenderParent"],"disabled":["rerenderParent"]}]]],["p-13520b30",[[4,"gov-tiles",{"columns":[2],"noBorder":[4,"no-border"]}]]],["p-f6a98765",[[4,"gov-tooltip",{"variant":[1],"size":[1],"position":[1025],"message":[1],"identifier":[1],"icon":[516],"persist":[32],"show":[64],"hide":[64]},null,{"variant":["validateVariant"],"size":["validateSize"],"position":["validatePosition"],"message":["rerenderMessage"]}]]],["p-1011ca26",[[4,"gov-wizard",{"size":[1],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]},null,{"size":["validateSize"]}]]],["p-290c5b2f",[[0,"gov-icon",{"name":[1],"type":[1],"iconData":[32],"visible":[32],"error":[32]},null,{"name":["loadIconPathData"]}]]],["p-6c33492a",[[4,"gov-form-input",{"value":[1537],"identifier":[1],"variant":[1],"success":[516],"size":[1],"name":[1],"multiline":[4],"rows":[2],"cols":[2],"required":[516],"disabled":[516],"placeholder":[1],"readonly":[4],"minlength":[2],"maxlength":[2],"min":[8],"max":[8],"autocomplete":[4],"autocorrect":[4],"spellcheck":[4],"inputLang":[1,"input-lang"],"type":[1],"inputType":[1,"input-type"],"role":[1],"invalid":[516],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagOwns":[1,"wcag-owns"],"wcagAutocomplete":[1,"wcag-autocomplete"],"wcagExpanded":[4,"wcag-expanded"],"focused":[32],"setFocus":[64],"setValue":[64],"clearValue":[64],"getRef":[64],"validateWcag":[64]},null,{"variant":["validateVariant"],"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"],"success":["watchControlAttrs"]}]]],["p-33c70c32",[[4,"gov-form-autocomplete",{"value":[1537],"options":[1537],"identifier":[1],"variant":[1],"success":[4],"size":[1],"nameKey":[1,"name-key"],"name":[1],"required":[4],"disabled":[516],"placeholder":[1],"readonly":[4],"invalid":[4],"minlength":[2],"maxlength":[2],"throttleTime":[2,"throttle-time"],"messageEmpty":[1,"message-empty"],"messageLoading":[1,"message-loading"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagOwns":[1,"wcag-owns"],"focused":[32],"processing":[32],"arrowCounter":[32],"list":[32],"setFocus":[64],"setBlur":[64],"setOptions":[64],"clearValue":[64],"setProcessing":[64],"setSearchCallback":[64],"setTemplateResolver":[64]},null,{"variant":["validateVariant"],"size":["validateSize"],"options":["watchOptions"]}]]],["p-2c3697cf",[[4,"gov-chip",{"inverse":[4],"disabled":[4],"href":[1],"target":[1],"iconLeft":[1,"icon-left"],"iconRight":[1,"icon-right"],"size":[1],"tag":[1],"variant":[1],"focusable":[4],"identifier":[1],"wcagLabel":[1,"wcag-label"],"wcagControls":[1,"wcag-controls"],"wcagSelected":[4,"wcag-selected"],"getTriggerRef":[64],"getTriggerIdentifier":[64],"setFocus":[64]},null,{"variant":["validateVariant"],"size":["validateSize"]}]]],["p-fe44d078",[[4,"gov-form-select",{"value":[1537],"options":[1537],"identifier":[1],"variant":[1],"size":[1],"name":[1],"required":[4],"success":[516],"disabled":[516],"invalid":[4],"wcagActiveDescendant":[1,"wcag-active-descendant"],"wcagControls":[1,"wcag-controls"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagOwns":[1,"wcag-owns"],"focused":[32],"optionsState":[32],"setFocus":[64],"getRef":[64],"validateWcag":[64]},null,{"variant":["validateVariant"],"size":["validateSize","watchControlAttrs"],"options":["watchOptions"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"],"success":["watchControlAttrs"],"value":["watchValue"]}]]],["p-4694b4b6",[[4,"gov-attachments-item",{"wcagRemoveLabel":[1,"wcag-remove-label"],"wcagRemoveLabelledBy":[1,"wcag-remove-labelled-by"],"validateWcag":[64]}],[4,"gov-attachments",{"label":[1],"wcagLabel":[1,"wcag-label"],"validateWcag":[64]}],[4,"gov-form-message",{"variant":[1],"identifier":[64]},null,{"variant":["validateVariant"]}]]],["p-114a4d0b",[[0,"gov-backdrop",{"inverse":[4],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]}]]],["p-77892071",[[4,"gov-button",{"variant":[513],"size":[513],"type":[513],"expanded":[516],"inverse":[516],"name":[1],"iconLeft":[1,"icon-left"],"iconRight":[1,"icon-right"],"disabled":[516],"nativeType":[1,"native-type"],"href":[1],"target":[1],"download":[4],"hreflang":[1],"referrerpolicy":[1],"rel":[1],"loading":[1],"focusable":[4],"identifier":[1],"wcagActiveDescendant":[1,"wcag-active-descendant"],"wcagControls":[1,"wcag-controls"],"wcagDescribedBy":[1,"wcag-described-by"],"wcagDescription":[1,"wcag-description"],"wcagDetails":[1,"wcag-details"],"wcagExpanded":[4,"wcag-expanded"],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"wcagOwns":[1,"wcag-owns"],"wcagHasPopup":[1,"wcag-has-popup"],"wcagPressed":[4,"wcag-pressed"],"wcagCurrent":[1,"wcag-current"],"setFocus":[64],"getTriggerRef":[64],"validateWcag":[64]},null,{"variant":["validateVariant"],"type":["validateType"],"size":["validateSize"],"nativeType":["validateNativeType"]}]]]]'),e)}));
|
|
2
2
|
//# sourceMappingURL=core.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["patchBrowser","patchCloneNodeFix","H","prototype","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","HTMLElementPrototype","nativeCloneNodeFn","cloneNode","deep","this","nodeName","call","clonedNode","srcChildNodes","childNodes","i","length","nodeType","appendChild","then","async","options","globalScripts","bootstrapLazy","JSON","parse"],"sources":["../../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"iIAOA,IAAIA,EAAe,KAIO,CACtBC,EAAkBC,EAAEC,UACxB,CAIE,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACrBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACjD,CACE,OAAOC,EAAeJ,EAAK,EAE7B,IAAIL,EAAqBU,IACvB,MAAMC,EAAoBD,EAAqBE,UAC/CF,EAAqBE,UAAY,SAASC,GACxC,GAAIC,KAAKC,WAAa,WAAY,CAChC,OAAOJ,EAAkBK,KAAKF,KAAMD,EAC1C,CACI,MAAMI,EAAaN,EAAkBK,KAAKF,KAAM,OAChD,MAAMI,EAAgBJ,KAAKK,WAC3B,GAAIN,EAAM,CACR,IAAK,IAAIO,EAAI,EAAGA,EAAIF,EAAcG,OAAQD,IAAK,CAC7C,GAAIF,EAAcE,GAAGE,WAAa,EAAG,CACnCL,EAAWM,YAAYL,EAAcE,GAAGR,UAAU,MAC5D,CACA,CACA,CACI,OAAOK,CACX,CAAG,ECpCHlB,IAAeyB,MAAKC,MAAOC,UACnBC,IACN,OAAOC,EAAcC,KAAAC,MAAA,
|
|
1
|
+
{"version":3,"names":["patchBrowser","patchCloneNodeFix","H","prototype","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","HTMLElementPrototype","nativeCloneNodeFn","cloneNode","deep","this","nodeName","call","clonedNode","srcChildNodes","childNodes","i","length","nodeType","appendChild","then","async","options","globalScripts","bootstrapLazy","JSON","parse"],"sources":["../../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, doc, H, promiseResolve } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? Array.from(doc.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"iIAOA,IAAIA,EAAe,KAIO,CACtBC,EAAkBC,EAAEC,UACxB,CAIE,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACrBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACjD,CACE,OAAOC,EAAeJ,EAAK,EAE7B,IAAIL,EAAqBU,IACvB,MAAMC,EAAoBD,EAAqBE,UAC/CF,EAAqBE,UAAY,SAASC,GACxC,GAAIC,KAAKC,WAAa,WAAY,CAChC,OAAOJ,EAAkBK,KAAKF,KAAMD,EAC1C,CACI,MAAMI,EAAaN,EAAkBK,KAAKF,KAAM,OAChD,MAAMI,EAAgBJ,KAAKK,WAC3B,GAAIN,EAAM,CACR,IAAK,IAAIO,EAAI,EAAGA,EAAIF,EAAcG,OAAQD,IAAK,CAC7C,GAAIF,EAAcE,GAAGE,WAAa,EAAG,CACnCL,EAAWM,YAAYL,EAAcE,GAAGR,UAAU,MAC5D,CACA,CACA,CACI,OAAOK,CACX,CAAG,ECpCHlB,IAAeyB,MAAKC,MAAOC,UACnBC,IACN,OAAOC,EAAcC,KAAAC,MAAA,6hfAAuCJ,EAAA","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as t,r as i,h as s,a as n,g as e}from"./p-240659bb.js";import{i as o,e as a}from"./p-e618f1cb.js";import{g as r}from"./p-4191acf2.js";import"./p-e0e2e9c1.js";var c;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(c||(c={}));const h={root:"gov-icon",holder:"gov-icon__holder"};const l="4.0.8-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{d as t,r as i,h as s,a as n,g as e}from"./p-240659bb.js";import{i as o,e as a}from"./p-e618f1cb.js";import{g as r}from"./p-4191acf2.js";import"./p-e0e2e9c1.js";var c;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(c||(c={}));const h={root:"gov-icon",holder:"gov-icon__holder"};const l="4.0.8-rc25";const p=()=>l;const f={};const d={};const u=t=>t.startsWith("http://")||t.startsWith("https://");const g=(i,s,n)=>{if(u(i)){return`${i}/${n}/${s}.svg?v=${p()}`}return t(`${i}/${n}/${s}.svg`)+`?v=${p()}`};async function m({name:t,type:i}){const s=i+"-"+t;if(f[s]){return f[s]}if(!d[s]){d[s]=fetch(g(o(),t,i)).then((t=>{if(t.status===200){return t.text()}else{throw new Error("Gov Icon doesn't exists")}}))}const n=await d[s];f[s]=n;return n}const y=".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-icon{display:inline-flex}.gov-icon__holder{display:inline-flex;width:100%;height:100%}.gov-icon__holder+.gov-icon__holder{display:none !important}.gov-icon svg{display:inline-flex;width:100%;height:100%;max-width:100%;max-height:100%}";const v=y;const w=class{constructor(t){i(this,t);this.name=null;this.type="basic";this.iconData=undefined;this.visible=false;this.error=false;this.h=r(this.host)}async loadIconPathData(){const{name:t,visible:i,type:s}=this;if(!t||!i){return}try{this.iconData=await m({name:t,type:s})}catch(t){this.error=true}}connectedCallback(){if(a()){this.visible=true;this.loadIconPathData().finally()}else{this.waitUntilVisible((async()=>{this.visible=true;await this.loadIconPathData()}))}}disconnectedCallback(){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}}async componentWillLoad(){await this.loadIconPathData()}waitUntilVisible(t){if(typeof window==="undefined"||!window.IntersectionObserver){t();return}this.intersectionObserver=new IntersectionObserver((i=>{i.forEach((i=>{if(i.isIntersecting){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}t()}}))}),{rootMargin:"50px"});this.intersectionObserver.observe(this.host)}render(){if(this.error){return null}return s(n,{class:this.h.classes(h.root)},s("span",{class:h.holder,innerHTML:this.iconData}))}static get assetsDirs(){return["assets"]}get host(){return e(this)}static get watchers(){return{name:["loadIconPathData"]}}};w.style=v;export{w as gov_icon};
|
|
2
|
+
//# sourceMappingURL=p-290c5b2f.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["govFormSwitchCss","GovFormSwitchStyle0","GovFormSwitch","constructor","hostRef","this","hydrated","checkboxId","createID","h","govHost","host","f","govForm","validateSize","newValue","validateProp","FormSwitchSizes","FormSwitchClass","root","watchDisabled","passControlAttrs","passAttrToControl","size","toBoolAttr","invalid","disabled","componentDidRender","passAttrToLabel","identifier","String","required","canValidateWcagOnRender","delay","validateWcag","connectedCallback","render","wrapCheckbox","children","noLabel","Host","class","classes","checked","toBoolAttrIfDefined","holder","Fragment","input","id","type","value","name","onClick","onClickHandler","bind","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","ref","el","inputRef","wcagDescribedBy","wcagLabelledBy","indicator","e","stopPropagation","govFocus","emit","component","originalEvent","govBlur","target","govChange","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/switch/gov-form-switch.scss?tag=gov-form-switch","../../../packages/core/src/components/gov-form/switch/gov-form-switch.tsx"],"sourcesContent":["/*\n * Switch\n */\n\n$class: \".gov-form-switch\";\n$indicator-ratio: calc(5 / 3);\n\n#{$class} {\n\tposition: relative;\n\tdisplay: flex;\n\t&__holder {\n\t\tdisplay: inline-flex;\n\t}\n\t&__input {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tappearance: none;\n\t\tcursor: pointer;\n\t\tflex-shrink: 0;\n\t}\n\t.gov-form-label__label {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tmargin-bottom: 0;\n\t\tcolor: $form-switch-color;\n\t}\n\t&__indicator {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tborder: $form-switch-indicator-border;\n\t\tbackground-color: $form-switch-indicator-bg;\n\t\ttransition: $t linear background-color;\n\t\t&::before {\n\t\t\t@include pseudo();\n\t\t\tborder-radius: 50%;\n\t\t\tbackground-color: $form-switch-indicator-circle-bg;\n\t\t\ttransition: $t linear left;\n\t\t\tbox-shadow: $form-switch-indicator-circle-box-shadow;\n\t\t}\n\t}\n\n\t// STATES\n\t// focus\n\t&__input:focus-visible ~ &__indicator {\n\t\toutline: $outline;\n\t}\n\t// checked\n\t&__input:checked + &__indicator {\n\t\tborder-color: $form-switch-indicator-bg-checked;\n\t\tbackground-color: $form-switch-indicator-bg-checked;\n\t}\n\n\t// disabled\n\t@include parameter(\"disabled\") {\n\t\tpointer-events: none;\n\t\t.gov-form-label__label {\n\t\t\tcolor: $form-state-color-disabled;\n\t\t}\n\t\t#{$class} {\n\t\t\t&__indicator {\n\t\t\t\t&::before {\n\t\t\t\t\tbackground: $form-state-bg-input-disabled;\n\t\t\t\t}\n\t\t\t}\n\t\t\t&__input:checked + #{$class}__indicator {\n\t\t\t\tborder-color: $form-state-bg-disabled;\n\t\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t\t}\n\t\t}\n\t}\n\n\t// invalid\n\t@include parameter(\"invalid\") {\n\t\t.gov-form-label__label {\n\t\t\tcolor: $form-state-color-error;\n\t\t}\n\t\t#{$class} {\n\t\t\t&__indicator {\n\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t}\n\t\t\t&__input:checked + #{$class}__indicator {\n\t\t\t\tbackground-color: $form-state-color-error;\n\t\t\t}\n\t\t}\n\t}\n\n\t// sizes\n\t@each $size, $definitions in $form-switch-sizes {\n\t\t$indicator-width: calc(get(\"indicator-height\", $definitions) * $indicator-ratio);\n\t\t$indicator-height: get(\"indicator-height\", $definitions);\n\t\t$border-offset: calc(get(\"toggle-offset\", $definitions) - rem-calc(1));\n\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.gov-form-label__label {\n\t\t\t\t@include typography($size);\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\t\t\t#{$class} {\n\t\t\t\t&__holder {\n\t\t\t\t\tgap: get(\"gap\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__input {\n\t\t\t\t\twidth: $indicator-width;\n\t\t\t\t\theight: $indicator-height;\n\t\t\t\t}\n\t\t\t\t&__indicator {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\twidth: $indicator-width;\n\t\t\t\t\theight: $indicator-height;\n\t\t\t\t\tborder-radius: calc($indicator-height * 0.5);\n\t\t\t\t\t&::before {\n\t\t\t\t\t\ttop: $border-offset;\n\t\t\t\t\t\tleft: $border-offset;\n\t\t\t\t\t\twidth: calc($indicator-height - (2 * get(\"toggle-offset\", $definitions)));\n\t\t\t\t\t\theight: calc($indicator-height - (2 * get(\"toggle-offset\", $definitions)));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// STATES\n\t\t\t\t&__input[aria-checked] + #{$class}__indicator {\n\t\t\t\t\t&::before {\n\t\t\t\t\t\tleft: calc($indicator-width - $indicator-height + $border-offset);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlabel {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\t#{$class}__input {\n\t\t\t\t\twidth: $indicator-width;\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 { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormSwitchClass, FormSwitchSizes, FormSwitchSizesType } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport { FormSwitchEvent } from \"./gov-form-switch.types\"\n\n@Component({\n\ttag: \"gov-form-switch\",\n\tstyleUrl: \"gov-form-switch.scss\",\n})\nexport class GovFormSwitch {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly checkboxId: string\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSwitchElement\n\t/**\n\t * Value of switch\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Switch button state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = 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 switch component disabled.\n\t * This prevents users from being able to interact with the switch, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the switch.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Switch's size.\n\t */\n\t@Prop() readonly size?: FormSwitchSizesType = \"m\"\n\t/**\n\t * Custom switch identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\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 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 * Emitted when the switch has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormSwitchEvent>\n\t/**\n\t * Emitted when the switch loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormSwitchEvent>\n\t/**\n\t * Emitted when the switch change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormSwitchEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSwitchSizes, newValue, FormSwitchClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\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(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"switch\")\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FormSwitchClass.root)} hydrated={this.hydrated} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t<div class={FormSwitchClass.holder}>\n\t\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass={FormSwitchClass.input}\n\t\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\t\taria-checked={this.checked}\n\t\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span class={FormSwitchClass.indicator}></span>\n\t\t\t\t\t\t\t<slot name=\"label\"></slot>\n\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\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\", FormSwitchClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormSwitchClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.checkboxId, this.wcagLabelledBy, FormSwitchClass.root)\n\t}\n}\n"],"mappings":"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","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["govFormSwitchCss","GovFormSwitchStyle0","GovFormSwitch","constructor","hostRef","this","hydrated","checkboxId","createID","h","govHost","host","f","govForm","validateSize","newValue","validateProp","FormSwitchSizes","FormSwitchClass","root","watchDisabled","passControlAttrs","passAttrToControl","size","toBoolAttr","invalid","disabled","componentDidRender","passAttrToLabel","identifier","String","required","canValidateWcagOnRender","delay","validateWcag","connectedCallback","render","wrapCheckbox","children","noLabel","Host","class","classes","checked","toBoolAttrIfDefined","holder","Fragment","input","id","type","value","name","onClick","onClickHandler","bind","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","ref","el","inputRef","wcagDescribedBy","wcagLabelledBy","indicator","e","stopPropagation","govFocus","emit","component","originalEvent","govBlur","target","govChange","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/switch/gov-form-switch.scss?tag=gov-form-switch","../../../packages/core/src/components/gov-form/switch/gov-form-switch.tsx"],"sourcesContent":["/*\n * Switch\n */\n\n$class: \".gov-form-switch\";\n$indicator-ratio: calc(5 / 3);\n\n#{$class} {\n\tposition: relative;\n\tdisplay: flex;\n\t&__holder {\n\t\tdisplay: inline-flex;\n\t}\n\t&__input {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tappearance: none;\n\t\tcursor: pointer;\n\t\tflex-shrink: 0;\n\t}\n\t.gov-form-label__label {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tmargin-bottom: 0;\n\t\tcolor: $form-switch-color;\n\t}\n\t&__indicator {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tborder: $form-switch-indicator-border;\n\t\tbackground-color: $form-switch-indicator-bg;\n\t\ttransition: $t linear background-color;\n\t\t&::before {\n\t\t\t@include pseudo();\n\t\t\tborder-radius: 50%;\n\t\t\tbackground-color: $form-switch-indicator-circle-bg;\n\t\t\ttransition: $t linear left;\n\t\t\tbox-shadow: $form-switch-indicator-circle-box-shadow;\n\t\t}\n\t}\n\n\t// STATES\n\t// focus\n\t&__input:focus-visible ~ &__indicator {\n\t\toutline: $outline;\n\t}\n\t// checked\n\t&__input:checked + &__indicator {\n\t\tborder-color: $form-switch-indicator-bg-checked;\n\t\tbackground-color: $form-switch-indicator-bg-checked;\n\t}\n\n\t// disabled\n\t@include parameter(\"disabled\") {\n\t\tpointer-events: none;\n\t\t.gov-form-label__label {\n\t\t\tcolor: $form-state-color-disabled;\n\t\t}\n\t\t#{$class} {\n\t\t\t&__indicator {\n\t\t\t\t&::before {\n\t\t\t\t\tbackground: $form-state-bg-input-disabled;\n\t\t\t\t}\n\t\t\t}\n\t\t\t&__input:checked + #{$class}__indicator {\n\t\t\t\tborder-color: $form-state-bg-disabled;\n\t\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t\t}\n\t\t}\n\t}\n\n\t// invalid\n\t@include parameter(\"invalid\") {\n\t\t.gov-form-label__label {\n\t\t\tcolor: $form-state-color-error;\n\t\t}\n\t\t#{$class} {\n\t\t\t&__indicator {\n\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t}\n\t\t\t&__input:checked + #{$class}__indicator {\n\t\t\t\tbackground-color: $form-state-color-error;\n\t\t\t}\n\t\t}\n\t}\n\n\t// sizes\n\t@each $size, $definitions in $form-switch-sizes {\n\t\t$indicator-width: calc(get(\"indicator-height\", $definitions) * $indicator-ratio);\n\t\t$indicator-height: get(\"indicator-height\", $definitions);\n\t\t$border-offset: calc(get(\"toggle-offset\", $definitions) - rem-calc(1));\n\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.gov-form-label__label {\n\t\t\t\t@include typography($size);\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\t\t\t#{$class} {\n\t\t\t\t&__holder {\n\t\t\t\t\tgap: get(\"gap\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__input {\n\t\t\t\t\twidth: $indicator-width;\n\t\t\t\t\theight: $indicator-height;\n\t\t\t\t}\n\t\t\t\t&__indicator {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\twidth: $indicator-width;\n\t\t\t\t\theight: $indicator-height;\n\t\t\t\t\tborder-radius: calc($indicator-height * 0.5);\n\t\t\t\t\t&::before {\n\t\t\t\t\t\ttop: $border-offset;\n\t\t\t\t\t\tleft: $border-offset;\n\t\t\t\t\t\twidth: calc($indicator-height - (2 * get(\"toggle-offset\", $definitions)));\n\t\t\t\t\t\theight: calc($indicator-height - (2 * get(\"toggle-offset\", $definitions)));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// STATES\n\t\t\t\t&__input[aria-checked] + #{$class}__indicator {\n\t\t\t\t\t&::before {\n\t\t\t\t\t\tleft: calc($indicator-width - $indicator-height + $border-offset);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlabel {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\t#{$class}__input {\n\t\t\t\t\twidth: $indicator-width;\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 { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormSwitchClass, FormSwitchSizes, FormSwitchSizesType } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport { FormSwitchEvent } from \"./gov-form-switch.types\"\n\n@Component({\n\ttag: \"gov-form-switch\",\n\tstyleUrl: \"gov-form-switch.scss\",\n})\nexport class GovFormSwitch {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly checkboxId: string\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSwitchElement\n\t/**\n\t * Value of switch\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Switch button state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = 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 switch component disabled.\n\t * This prevents users from being able to interact with the switch, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Name of the switch.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Switch's size.\n\t */\n\t@Prop({reflect: true}) readonly size?: FormSwitchSizesType = \"m\"\n\t/**\n\t * Custom switch identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\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 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 * Emitted when the switch has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormSwitchEvent>\n\t/**\n\t * Emitted when the switch loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormSwitchEvent>\n\t/**\n\t * Emitted when the switch change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormSwitchEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSwitchSizes, newValue, FormSwitchClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\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(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"switch\")\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FormSwitchClass.root)} hydrated={this.hydrated} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t<div class={FormSwitchClass.holder}>\n\t\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass={FormSwitchClass.input}\n\t\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\t\taria-checked={this.checked}\n\t\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span class={FormSwitchClass.indicator}></span>\n\t\t\t\t\t\t\t<slot name=\"label\"></slot>\n\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\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\", FormSwitchClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormSwitchClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.checkboxId, this.wcagLabelledBy, FormSwitchClass.root)\n\t}\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,a as s,g as o}from"./p-240659bb.js";import{a}from"./p-4191acf2.js";import{v as n}from"./p-344c72d7.js";import{c as r}from"./p-cd6c2938.js";import{d as h,t as l,h as c}from"./p-e0e2e9c1.js";import{F as m,a as d,b as p}from"./p-45b869ae.js";import{p as f}from"./p-ded281e6.js";import"./p-e296ca83.js";import"./p-e618f1cb.js";import"./p-92f420cb.js";import"./p-03dbb8b1.js";import"./p-2aedc81e.js";const u='.gov-form-autocomplete__list{margin:0;padding:0}.gov-form-autocomplete__list>.gov-form-autocomplete__item{margin:0;padding:0;background:none}.gov-form-autocomplete__list>.gov-form-autocomplete__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-autocomplete{position:relative;display:block;width:100%}.gov-form-autocomplete__list{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);position:absolute;top:100%;right:0;left:0;z-index:5;max-height:14.0625rem;margin-top:0.5rem;border:var(--gov-autocomplete-item-hover, 0.0625rem solid var(--gov-color-secondary-500));border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-autocomplete-bg, var(--gov-color-neutral-white));overflow-x:hidden;overflow-y:auto;overscroll-behavior:none}.gov-form-autocomplete__list>.gov-form-autocomplete__item{padding:0.75rem 0.5rem;cursor:pointer}.gov-form-autocomplete__item--empty,.gov-form-autocomplete__item--loading{padding:0.75rem 0.5rem;color:var(--gov-autocomplete-item-disable-color, var(--gov-color-secondary-600))}.gov-form-autocomplete__item--empty .gov-icon,.gov-form-autocomplete__item--empty .gov-spin-animation,.gov-form-autocomplete__item--loading .gov-icon,.gov-form-autocomplete__item--loading .gov-spin-animation{width:12px;height:12px}.gov-form-autocomplete__list:empty{display:none}.gov-form-autocomplete__item[aria-selected=""],.gov-form-autocomplete__item[aria-selected=true i],.gov-form-autocomplete__item[aria-selected="1"]{background:var(--gov-autocomplete-item-select, var(--gov-color-secondary-400))}@media not all and (pointer: coarse){.gov-form-autocomplete__item:hover{background:var(--gov-autocomplete-item-hover, var(--gov-color-primary-100))}}';const g=u;const v=class{constructor(e){t(this,e);this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govInput=i(this,"gov-input",7);this.govSelect=i(this,"gov-select",7);this.templateResolver=t=>t[this.nameKey];this.value="";this.options=undefined;this.identifier=undefined;this.variant=undefined;this.success=undefined;this.size="m";this.nameKey="name";this.name=undefined;this.required=false;this.disabled=false;this.placeholder=undefined;this.readonly=undefined;this.invalid=undefined;this.minlength=3;this.maxlength=undefined;this.throttleTime=200;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.processing=false;this.arrowCounter=-1;this.list=[];this.listBoxId=r("GovListBox")}validateVariant(t){n(d,t,m.root)}validateSize(t){n(p,t,m.root)}watchOptions(t){this.setOptions(f(t)).catch()}onArrowUp(){if(this.arrowCounter>0){this.arrowCounter=this.arrowCounter-1;this.moveToView().finally()}}onArrowDown(){if(this.arrowCounter<this.list.length-1){this.arrowCounter=this.arrowCounter+1;this.moveToView().finally()}}async moveToView(){await h(200);const t=this.listRef.offsetHeight;const i=this.listRef.querySelector('li[aria-selected="true"]');if(i&&t){const t=i.offsetTop;this.listRef.scrollTo({top:t,behavior:"smooth"})}}doSearch(){if(Number.isInteger(this.minlength)&&this.isValueAccepted===false&&this.minlength){this.list=[];this.arrowCounter=-1;this.processing=false;return}if(this.searchCallback){this.processing=true;this.searchCallback(this.value).then((t=>this.list=t)).catch((()=>this.list=[])).finally((()=>{this.arrowCounter=-1;this.processing=false}))}}clearList(){const t=f(this.options);if(t.length===0){this.list=[]}}get isValueAccepted(){if(typeof this.value==="string"){return this.value.length>=this.minlength}else{return false}}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size)}render(){return e(s,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as i,h as e,a as s,g as o}from"./p-240659bb.js";import{a}from"./p-4191acf2.js";import{v as n}from"./p-344c72d7.js";import{c as r}from"./p-cd6c2938.js";import{d as h,t as l,h as c}from"./p-e0e2e9c1.js";import{F as m,a as d,b as p}from"./p-45b869ae.js";import{p as f}from"./p-ded281e6.js";import"./p-e296ca83.js";import"./p-e618f1cb.js";import"./p-92f420cb.js";import"./p-03dbb8b1.js";import"./p-2aedc81e.js";const u='.gov-form-autocomplete__list{margin:0;padding:0}.gov-form-autocomplete__list>.gov-form-autocomplete__item{margin:0;padding:0;background:none}.gov-form-autocomplete__list>.gov-form-autocomplete__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-autocomplete{position:relative;display:block;width:100%}.gov-form-autocomplete__list{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);position:absolute;top:100%;right:0;left:0;z-index:5;max-height:14.0625rem;margin-top:0.5rem;border:var(--gov-autocomplete-item-hover, 0.0625rem solid var(--gov-color-secondary-500));border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-autocomplete-bg, var(--gov-color-neutral-white));overflow-x:hidden;overflow-y:auto;overscroll-behavior:none}.gov-form-autocomplete__list>.gov-form-autocomplete__item{padding:0.75rem 0.5rem;cursor:pointer}.gov-form-autocomplete__item--empty,.gov-form-autocomplete__item--loading{padding:0.75rem 0.5rem;color:var(--gov-autocomplete-item-disable-color, var(--gov-color-secondary-600))}.gov-form-autocomplete__item--empty .gov-icon,.gov-form-autocomplete__item--empty .gov-spin-animation,.gov-form-autocomplete__item--loading .gov-icon,.gov-form-autocomplete__item--loading .gov-spin-animation{width:12px;height:12px}.gov-form-autocomplete__list:empty{display:none}.gov-form-autocomplete__item[aria-selected=""],.gov-form-autocomplete__item[aria-selected=true i],.gov-form-autocomplete__item[aria-selected="1"]{background:var(--gov-autocomplete-item-select, var(--gov-color-secondary-400))}@media not all and (pointer: coarse){.gov-form-autocomplete__item:hover{background:var(--gov-autocomplete-item-hover, var(--gov-color-primary-100))}}';const g=u;const v=class{constructor(e){t(this,e);this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govInput=i(this,"gov-input",7);this.govSelect=i(this,"gov-select",7);this.templateResolver=t=>t[this.nameKey];this.value="";this.options=undefined;this.identifier=undefined;this.variant=undefined;this.success=undefined;this.size="m";this.nameKey="name";this.name=undefined;this.required=false;this.disabled=false;this.placeholder=undefined;this.readonly=undefined;this.invalid=undefined;this.minlength=3;this.maxlength=undefined;this.throttleTime=200;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.processing=false;this.arrowCounter=-1;this.list=[];this.listBoxId=r("GovListBox")}validateVariant(t){n(d,t,m.root)}validateSize(t){n(p,t,m.root)}watchOptions(t){this.setOptions(f(t)).catch()}onArrowUp(){if(this.arrowCounter>0){this.arrowCounter=this.arrowCounter-1;this.moveToView().finally()}}onArrowDown(){if(this.arrowCounter<this.list.length-1){this.arrowCounter=this.arrowCounter+1;this.moveToView().finally()}}async moveToView(){await h(200);const t=this.listRef.offsetHeight;const i=this.listRef.querySelector('li[aria-selected="true"]');if(i&&t){const t=i.offsetTop;this.listRef.scrollTo({top:t,behavior:"smooth"})}}doSearch(){if(Number.isInteger(this.minlength)&&this.isValueAccepted===false&&this.minlength){this.list=[];this.arrowCounter=-1;this.processing=false;return}if(this.searchCallback){this.processing=true;this.searchCallback(this.value).then((t=>this.list=t)).catch((()=>this.list=[])).finally((()=>{this.arrowCounter=-1;this.processing=false}))}}clearList(){const t=f(this.options);if(t.length===0){this.list=[]}}get isValueAccepted(){if(typeof this.value==="string"){return this.value.length>=this.minlength}else{return false}}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size)}render(){return e(s,{key:"4edb7e993e80b593bfce912e18640dd47bdece95",class:m.root,size:this.size,variant:this.variant},e("gov-form-input",{key:"77b7815152610e937f4125639ce841c66f626aa1",placeholder:this.placeholder,name:this.name,disabled:this.disabled,readonly:this.readonly,autocomplete:false,size:this.size,variant:this.variant,required:this.required,invalid:this.invalid,success:this.success,role:"searchbox",value:this.value,minlength:this.minlength,maxlength:this.maxlength,"on-gov-input":l(this.onInputHandler.bind(this),this.throttleTime),"on-gov-keyup":this.onKeyUpHandler.bind(this),"on-gov-keydown":this.onKeyDownHandler.bind(this),"on-gov-focus":this.onFocusHandler.bind(this),"on-gov-blur":this.onBlurHandler.bind(this),wcagAutocomplete:"list",wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:[this.listBoxId,this.wcagOwns].join(" "),wcagExpanded:this.list.length&&this.focused,ref:t=>this.inputRef=t},e("slot",{key:"49afd3279b906a00975ed68e323db007493cc3c1",slot:"right-icon",name:"right-icon"})),e("ul",{key:"7ca7af32cf949f0c5f2cf9ff7657293a86ada96c",class:m.list,role:"listbox","aria-hidden":a(!this.focused),hidden:!this.focused,id:this.listBoxId,ref:t=>this.listRef=t},this.focused&&this.list.length===0&&this.processing===false&&this.isValueAccepted&&this.messageEmpty?e("li",{class:m.empty},this.messageEmpty):null,this.focused&&this.processing===true&&this.isValueAccepted?e("li",{class:m.loading},e("gov-icon",{name:"loader",class:"gov-spin-animation"})," ",this.messageLoading):null,this.focused?this.list.map(((t,i)=>{const s=this.arrowCounter===i;return e("li",{class:m.item,innerHTML:this.templateResolver(t,s),role:"option","aria-posinset":i,tabindex:s?0:-1,"aria-setsize":this.list.length,onTouchStart:t=>this.onSelectHandler(t,i),onMouseDown:t=>this.onSelectHandler(t,i),"aria-selected":a(s)})})):null))}onFocusHandler(t){this.focused=true;this.arrowCounter=-1;if(this.isValueAccepted&&this.searchCallback){this.doSearch()}t.stopPropagation();this.govFocus.emit({originalEvent:t,component:m.root,value:this.value,selected:null})}onBlurHandler(t){this.focused=false;this.clearList();this.arrowCounter=-1;t.stopPropagation();this.govBlur.emit({originalEvent:t,component:m.root,value:this.value,selected:null})}onInputHandler(t){this.value=t.target.value;t.stopPropagation();this.govInput.emit({originalEvent:t,component:m.root,value:this.value,selected:null});this.doSearch()}onSelectHandler(t,i=-1){let e=null;if(i>-1){e=this.list[i]}else if(c(this.arrowCounter,this.list)){e=this.list[this.arrowCounter]}if(e){this.govSelect.emit({component:m.root,value:this.value,selected:e,originalEvent:t});this.clearList();if(c(this.nameKey,e)&&typeof e[this.nameKey]==="string"){this.value=e[this.nameKey]}}}onKeyUpHandler(t){const i=t.detail.originalEvent;t.stopPropagation();i.stopPropagation();if(i.keyCode===38)this.onArrowUp();else if(i.keyCode===40)this.onArrowDown();else if(i.keyCode===13){t.preventDefault();i.preventDefault();this.onSelectHandler(t)}}onKeyDownHandler(t){const i=t.detail.originalEvent;t.stopPropagation();i.stopPropagation();if(i.keyCode===13){t.preventDefault();i.preventDefault()}}async setFocus(t){return this.inputRef.focus(t)}async setBlur(){return this.inputRef.blur()}async setOptions(t){this.list=Array.isArray(t)?t:[];this.arrowCounter=-1}async clearValue(){this.value="";this.inputRef.value="";await this.inputRef.clearValue()}async setProcessing(t){this.processing=t}async setSearchCallback(t){this.searchCallback=t}async setTemplateResolver(t){this.templateResolver=t}get host(){return o(this)}static get watchers(){return{variant:["validateVariant"],size:["validateSize"],options:["watchOptions"]}}};v.style=g;export{v as gov_form_autocomplete};
|
|
2
|
+
//# sourceMappingURL=p-33c70c32.entry.js.map
|