@gov-design-system-ce/components 4.0.8-rc16 → 4.0.8-rc17
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/{array.utils-fcdab10c.js → array.utils-96eadde3.js} +5 -7
- package/dist/cjs/array.utils-96eadde3.js.map +1 -0
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +2 -1
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-checkbox-group.cjs.entry.js +2 -1
- package/dist/cjs/gov-form-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +2 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-select.cjs.entry.js +2 -1
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js +2 -1
- package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tabs.cjs.entry.js +16 -3
- package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/helpers.types-ff60c9bd.js +14 -0
- package/dist/cjs/helpers.types-ff60c9bd.js.map +1 -0
- package/dist/collection/components/gov-tabs/gov-tabs.js +16 -3
- package/dist/collection/components/gov-tabs/gov-tabs.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-group.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tabs.js.map +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/{p-73b7a376.js → p-3248435d.js} +2 -2
- package/dist/components/p-3f704a40.js +2 -0
- package/dist/components/p-3f704a40.js.map +1 -0
- package/dist/components/{p-68d5f793.js → p-44c731a0.js} +2 -2
- package/dist/components/{p-86aa4e6c.js → p-483d079f.js} +2 -2
- package/dist/components/{p-7fe30d5d.js → p-57bc98b3.js} +2 -2
- package/dist/components/{p-31fe0e76.js → p-8ac22724.js} +2 -2
- package/dist/components/{p-4c6666ce.js → p-e35fdedd.js} +2 -2
- package/dist/components/{p-95ac62b9.js → p-fd554fb4.js} +2 -2
- package/dist/core/core.esm.js +1 -1
- package/dist/core/p-065b396a.entry.js +2 -0
- package/dist/core/{p-58c875bb.entry.js.map → p-065b396a.entry.js.map} +1 -1
- package/dist/core/p-2aedc81e.js +2 -0
- package/dist/core/p-2aedc81e.js.map +1 -0
- package/dist/core/p-2db35d0f.entry.js +2 -0
- package/dist/core/{p-7b598f56.entry.js.map → p-2db35d0f.entry.js.map} +1 -1
- package/dist/core/{p-006d67fe.entry.js → p-98e89c46.entry.js} +2 -2
- package/dist/core/p-a50b306f.entry.js +2 -0
- package/dist/core/{p-4978aa0a.entry.js.map → p-a50b306f.entry.js.map} +1 -1
- package/dist/core/p-afb86442.entry.js +2 -0
- package/dist/core/{p-aa9b5731.entry.js.map → p-afb86442.entry.js.map} +1 -1
- package/dist/core/p-b18be1d6.entry.js +2 -0
- package/dist/core/p-b18be1d6.entry.js.map +1 -0
- package/dist/core/p-d0446df9.entry.js +2 -0
- package/dist/core/{p-332a43c7.entry.js.map → p-d0446df9.entry.js.map} +1 -1
- package/dist/core/p-ded281e6.js +2 -0
- package/dist/core/p-ded281e6.js.map +1 -0
- package/dist/esm/{array.utils-5ce9a471.js → array.utils-85696abd.js} +2 -4
- package/dist/esm/array.utils-85696abd.js.map +1 -0
- package/dist/esm/gov-form-autocomplete.entry.js +2 -1
- package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
- package/dist/esm/gov-form-checkbox-group.entry.js +2 -1
- package/dist/esm/gov-form-checkbox-group.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +2 -1
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-form-select.entry.js +2 -1
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/esm/gov-pagination.entry.js +2 -1
- package/dist/esm/gov-pagination.entry.js.map +1 -1
- package/dist/esm/gov-tabs.entry.js +16 -3
- package/dist/esm/gov-tabs.entry.js.map +1 -1
- package/dist/esm/helpers.types-43ddbdb8.js +10 -0
- package/dist/{cjs/array.utils-fcdab10c.js.map → esm/helpers.types-43ddbdb8.js.map} +1 -1
- package/dist/hydrate/index.js +18 -3
- package/dist/hydrate/index.mjs +18 -3
- package/package.json +1 -1
- package/dist/components/p-0a6a373e.js +0 -2
- package/dist/components/p-0a6a373e.js.map +0 -1
- package/dist/core/p-0a6a373e.js +0 -2
- package/dist/core/p-0a6a373e.js.map +0 -1
- package/dist/core/p-332a43c7.entry.js +0 -2
- package/dist/core/p-4978aa0a.entry.js +0 -2
- package/dist/core/p-58c875bb.entry.js +0 -2
- package/dist/core/p-7b598f56.entry.js +0 -2
- package/dist/core/p-aa9b5731.entry.js +0 -2
- package/dist/core/p-e5817de9.entry.js +0 -2
- package/dist/core/p-e5817de9.entry.js.map +0 -1
- package/dist/esm/array.utils-5ce9a471.js.map +0 -1
- /package/dist/components/{p-73b7a376.js.map → p-3248435d.js.map} +0 -0
- /package/dist/components/{p-68d5f793.js.map → p-44c731a0.js.map} +0 -0
- /package/dist/components/{p-86aa4e6c.js.map → p-483d079f.js.map} +0 -0
- /package/dist/components/{p-7fe30d5d.js.map → p-57bc98b3.js.map} +0 -0
- /package/dist/components/{p-31fe0e76.js.map → p-8ac22724.js.map} +0 -0
- /package/dist/components/{p-4c6666ce.js.map → p-e35fdedd.js.map} +0 -0
- /package/dist/components/{p-95ac62b9.js.map → p-fd554fb4.js.map} +0 -0
- /package/dist/core/{p-006d67fe.entry.js.map → p-98e89c46.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as a,h as r,d as o}from"./p-d6759ac3.js";import{v as i}from"./p-6b0471a8.js";import{c as s}from"./p-e618f1cb.js";import{d as c}from"./p-e0e2e9c1.js";import{g as l}from"./p-d687df8f.js";import{d as n}from"./p-
|
|
1
|
+
import{p as e,H as t,c as a,h as r,d as o}from"./p-d6759ac3.js";import{v as i}from"./p-6b0471a8.js";import{c as s}from"./p-e618f1cb.js";import{d as c}from"./p-e0e2e9c1.js";import{g as l}from"./p-d687df8f.js";import{d as n}from"./p-44c731a0.js";import{d}from"./p-fd554fb4.js";const g={root:"gov-breadcrumbs"};const b='.gov-breadcrumbs ul{margin:0;padding:0}.gov-breadcrumbs li{margin:0;padding:0;background:none}.gov-breadcrumbs li::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-breadcrumbs{position:relative;display:flex;width:100%;justify-content:space-between;align-items:flex-start;gap:var(--gov-breadcrumbs-gap, 1rem)}.gov-breadcrumbs nav{overflow:hidden;width:100%}.gov-breadcrumbs ul{position:relative;display:flex;width:100%;flex-direction:column;gap:8px;margin-bottom:0}.gov-breadcrumbs li{display:flex;justify-content:flex-start;align-items:flex-start;margin-bottom:0 !important}.gov-breadcrumbs li .gov-icon{flex:0 0 auto;width:var(--gov-breadcrumbs-icon-size, 0.625rem);height:var(--gov-breadcrumbs-icon-size, 0.625rem);margin:calc((24px - var(--gov-breadcrumbs-icon-size, 0.625rem)) / 2) var(--gov-breadcrumbs-gap, 1rem) 0;color:var(--gov-breadcrumbs-arrow-color, var(--gov-color-secondary-600))}.gov-breadcrumbs li>a:first-child,.gov-breadcrumbs li>button:first-child{margin-left:calc(var(--gov-breadcrumbs-icon-size, 0.625rem) + 2 * var(--gov-breadcrumbs-gap, 1rem))}.gov-breadcrumbs a{font-weight:var(--text-font-weight, var(--gov-text-m-font-weight));font-size:var(--text-font-size, var(--gov-text-m-font-size));line-height:var(--text-line-height, var(--gov-text-m-line-height));letter-spacing:var(--text-letter-spacing, var(--gov-text-m-letter-spacing));color:var(--gov-breadcrumbs-link-color, var(--gov-color-primary))}.gov-breadcrumbs button{font-weight:var(--text-font-weight, var(--gov-text-m-font-weight));font-size:var(--text-font-size, var(--gov-text-m-font-size));line-height:var(--text-line-height, var(--gov-text-m-line-height));letter-spacing:var(--text-letter-spacing, var(--gov-text-m-letter-spacing));color:var(--gov-breadcrumbs-link-color, var(--gov-color-primary));padding:0;border:none;background:none;text-decoration:underline}.gov-breadcrumbs[collapsed=""],.gov-breadcrumbs[collapsed=true i],.gov-breadcrumbs[collapsed="1"]{align-items:center}.gov-breadcrumbs[collapsed=""] ul,.gov-breadcrumbs[collapsed=true i] ul,.gov-breadcrumbs[collapsed="1"] ul{overflow-x:hidden;flex-direction:row}.gov-breadcrumbs[collapsed=""] li,.gov-breadcrumbs[collapsed=true i] li,.gov-breadcrumbs[collapsed="1"] li{align-items:center;white-space:nowrap}.gov-breadcrumbs[collapsed=""] li .gov-icon,.gov-breadcrumbs[collapsed=true i] li .gov-icon,.gov-breadcrumbs[collapsed="1"] li .gov-icon{margin-top:0}.gov-breadcrumbs[collapsed=""] li>a:first-child,.gov-breadcrumbs[collapsed=""] li>button:first-child,.gov-breadcrumbs[collapsed=true i] li>a:first-child,.gov-breadcrumbs[collapsed=true i] li>button:first-child,.gov-breadcrumbs[collapsed="1"] li>a:first-child,.gov-breadcrumbs[collapsed="1"] li>button:first-child{margin-left:0}';const m=b;const v=e(class e extends t{constructor(){super();this.__registerHost();this.govChange=a(this,"gov-change",7);this.inited=false;this.collapsible=false;this.isExpanded=false;this.wcagLabel=undefined;this.wcagLabelledBy=undefined;this.wcagToggleLabel="Zobrazit či skrýt navigaci";this.collapsed=true;this.toggleOption=false;this.h=l(this.host)}async componentDidRender(){this.scheduleContentVerification();if(s()){await c(500);await this.validateWcag()}}scheduleContentVerification(){if(this.inited)return;this.inited=true;requestAnimationFrame((()=>{this.calculateWidthOfItems();this.inited=false}))}calculateWidthOfItems(){const e=this.host.getBoundingClientRect().width;let t=0;this.host.querySelectorAll("li").forEach((e=>{t+=e.getBoundingClientRect().width}));this.toggleOption=t>e}render(){return r(o,{key:"7ae4eae66fadfb3aebb005e85dec94f6cef0c932",class:this.h.classes(g.root),collapsed:this.collapsed},r("nav",{key:"780b9b2ec63b40f2b9f8ae4e088eba378717fc12","aria-label":this.wcagLabel,"aria-labelledby":this.wcagLabelledBy},r("slot",{key:"778051c57d0b3e657d9fe28802098d1f88a328a4"})),this.toggleOption?r("gov-button",{size:"xs",variant:"primary",type:"base",wcagLabel:this.wcagToggleLabel,wcagPressed:!this.collapsed,wcagExpanded:!this.collapsed,"on-gov-click":()=>this.collapsed=!this.collapsed},r("gov-icon",{name:this.collapsed?"chevron-down":"chevron-up"})):null)}async validateWcag(){i(this.wcagLabel,this.wcagLabelledBy,g.root);i(this.wcagToggleLabel,undefined,g.root)}get host(){return this}static get style(){return m}},[4,"gov-breadcrumbs",{collapsible:[4],isExpanded:[4,"is-expanded"],wcagLabel:[1,"wcag-label"],wcagLabelledBy:[1,"wcag-labeled-by"],wcagToggleLabel:[1,"wcag-toggle-label"],collapsed:[32],toggleOption:[32],validateWcag:[64]}]);function u(){if(typeof customElements==="undefined"){return}const e=["gov-breadcrumbs","gov-button","gov-icon"];e.forEach((e=>{switch(e){case"gov-breadcrumbs":if(!customElements.get(e)){customElements.define(e,v)}break;case"gov-button":if(!customElements.get(e)){n()}break;case"gov-icon":if(!customElements.get(e)){d()}break}}))}u();const p=v;const f=u;export{p as GovBreadcrumbs,f as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-breadcrumbs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-44c731a0.js";const t=o;const a=s;export{t as GovButton,a as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-button.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as a,c as o,h as r,d as i}from"./p-d6759ac3.js";import{g as d,b as t}from"./p-d687df8f.js";import{c}from"./p-95d41a3b.js";import{a as s}from"./p-e296ca83.js";import{v as n}from"./p-6b0471a8.js";import{c as l}from"./p-e618f1cb.js";import{d as g}from"./p-e0e2e9c1.js";import{d as v}from"./p-
|
|
1
|
+
import{p as e,H as a,c as o,h as r,d as i}from"./p-d6759ac3.js";import{g as d,b as t}from"./p-d687df8f.js";import{c}from"./p-95d41a3b.js";import{a as s}from"./p-e296ca83.js";import{v as n}from"./p-6b0471a8.js";import{c as l}from"./p-e618f1cb.js";import{d as g}from"./p-e0e2e9c1.js";import{d as v}from"./p-fd554fb4.js";const h={root:"gov-card",header:"gov-card__header",title:"gov-card__title",inner:"gov-card__inner",img:"gov-card__img",main:"gov-card__main",content:"gov-card__content",icon:"gov-card__icon",btns:"gov-card__btns",footer:"gov-card__footer",arrow:"gov-card__arrow"};const p='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-card{position:relative;display:flex;width:100%;flex-direction:column;border:var(--gov-card-border-width, 0.0625rem solid var(--gov-color-secondary-500));border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-card-bg, var(--gov-color-neutral-white));overflow:hidden}.gov-card__header{gap:1.75rem;width:100%;padding:1.5rem;border-bottom:var(--gov-card-border-width, 0.0625rem solid var(--gov-color-secondary-500));border-radius:0;text-align:left;text-transform:none;transition:background-color 150ms ease-in-out}.gov-card__arrow{flex:0 0 auto;width:1rem;height:1rem;color:var(--gov-card-arrow-color, var(--gov-color-primary))}.gov-card__title{margin:0;padding:0;font-family:var(--gov-font-family, "Roboto", sans-serif);font-weight:400;box-sizing:border-box;font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing);color:var(--gov-card-title-color, var(--gov-color-secondary-800));font-weight:700}.gov-card__img{width:100%;margin:0;line-height:1}.gov-card__img img{width:100%;height:auto}.gov-card__inner{display:flex;flex:1 1 auto;flex-direction:column}.gov-card__inner[aria-hidden=""],.gov-card__inner[aria-hidden=true i],.gov-card__inner[aria-hidden="1"]{display:none}.gov-card__main{display:flex;gap:16px 24px;flex:1 1 auto;flex-direction:column;padding:1.5rem}.gov-card__icon{flex:0 0 auto;width:2.5rem;height:2.5rem;color:var(--gov-card-icon-color, var(--gov-color-primary))}.gov-card__btns{display:flex;gap:1rem;flex:0 0 auto;flex-wrap:wrap}.gov-card__content>*:last-child{margin-bottom:0}.gov-card__footer{padding:1rem 1.5rem;background:var(--gov-card-footer-bg, var(--gov-color-primary-100))}.gov-card__footer>*:last-child{margin-bottom:0}.gov-card__footer p{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing)}.gov-card[is-expanded=""],.gov-card[is-expanded=true i],.gov-card[is-expanded="1"]{height:100%}.gov-card[collapsible=""] .gov-card__header,.gov-card[collapsible=true i] .gov-card__header,.gov-card[collapsible="1"] .gov-card__header{display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;border:0;background-color:transparent;text-align:center;text-decoration:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;justify-content:space-between;text-align:left}.gov-card[collapsible=""] .gov-card__header:focus,.gov-card[collapsible=true i] .gov-card__header:focus,.gov-card[collapsible="1"] .gov-card__header:focus{outline:none}.gov-card[collapsible=""] .gov-card__header:focus,.gov-card[collapsible=true i] .gov-card__header:focus,.gov-card[collapsible="1"] .gov-card__header:focus{outline:none}.gov-card[collapsible=""] .gov-card__header:focus-visible,.gov-card[collapsible=true i] .gov-card__header:focus-visible,.gov-card[collapsible="1"] .gov-card__header:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:-0.125rem}@media not all and (pointer: coarse){.gov-card[collapsible=""] .gov-card__header:hover,.gov-card[collapsible=true i] .gov-card__header:hover,.gov-card[collapsible="1"] .gov-card__header:hover{background:var(--gov-card-header-hover-bg, var(--gov-color-primary-100))}}.gov-card[collapsible=""][is-expanded=""] .gov-card__header,.gov-card[collapsible=""][is-expanded=true i] .gov-card__header,.gov-card[collapsible=""][is-expanded="1"] .gov-card__header,.gov-card[collapsible=true i][is-expanded=""] .gov-card__header,.gov-card[collapsible=true i][is-expanded=true i] .gov-card__header,.gov-card[collapsible=true i][is-expanded="1"] .gov-card__header,.gov-card[collapsible="1"][is-expanded=""] .gov-card__header,.gov-card[collapsible="1"][is-expanded=true i] .gov-card__header,.gov-card[collapsible="1"][is-expanded="1"] .gov-card__header{border-bottom:var(--gov-card-border-width, 0.0625rem solid var(--gov-color-secondary-500))}.gov-card[collapsible=""][is-expanded=""] .gov-card__arrow,.gov-card[collapsible=""][is-expanded=true i] .gov-card__arrow,.gov-card[collapsible=""][is-expanded="1"] .gov-card__arrow,.gov-card[collapsible=true i][is-expanded=""] .gov-card__arrow,.gov-card[collapsible=true i][is-expanded=true i] .gov-card__arrow,.gov-card[collapsible=true i][is-expanded="1"] .gov-card__arrow,.gov-card[collapsible="1"][is-expanded=""] .gov-card__arrow,.gov-card[collapsible="1"][is-expanded=true i] .gov-card__arrow,.gov-card[collapsible="1"][is-expanded="1"] .gov-card__arrow{transform:scale(-1)}@media (min-width: 30em){.gov-card[promotion=""] .gov-card__main,.gov-card[promotion=true i] .gov-card__main,.gov-card[promotion="1"] .gov-card__main{flex-direction:row;padding:2rem}.gov-card[promotion=""] .gov-card__icon,.gov-card[promotion=true i] .gov-card__icon,.gov-card[promotion="1"] .gov-card__icon{width:3rem;height:3rem}.gov-card[promotion=""] .gov-card__btns,.gov-card[promotion=true i] .gov-card__btns,.gov-card[promotion="1"] .gov-card__btns{flex-direction:column}}';const f=p;const _=e(class e extends a{constructor(){super();this.__registerHost();this.govToggle=o(this,"gov-toggle",7);this.promotion=false;this.label=undefined;this.collapsible=false;this.expanded=false;this.headlineTag="h3";this.wcagTriggerLabel=undefined;this.wcagTriggerLabelledBy=undefined;this.isExpanded=undefined;this.h=d(this.host);this.headlineId=c("GovCardHeadline");this.contentId=c("GovCardContent")}validateHeadlineTag(e){const a=["h1","h2","h3","h4","h5","h6","span"];if(e){if(!a.includes(e)){s(`[${h.root}]: Tag ${e} is not allowed.`)}}}componentWillLoad(){this.isExpanded=this.label?this.expanded:true;this.validateHeadlineTag(this.headlineTag)}async componentDidRender(){if(l()){await g(500);await this.validateWcag()}}emmitChange(){this.govToggle.emit({open:this.isExpanded,element:this.host})}render(){const e=this.headlineTag;return r(i,{key:"51a576a901ee8da650cdf1fd9ef144aa772c46f6",class:this.h.classes(h.root),"is-expanded":this.isExpanded,collapsible:t(this.collapsible),promotion:this.promotion},this.label&&this.collapsible?r("button",{id:this.headlineId,class:h.header,"aria-label":this.wcagTriggerLabel,"aria-labelledby":this.wcagTriggerLabelledBy,"aria-expanded":t(this.isExpanded),"aria-controls":this.contentId,onClick:this.onClickHandler.bind(this)},r(e,{class:h.title},this.label),r("gov-icon",{class:h.arrow,name:"chevron-down"})):null,this.label&&!this.collapsible?r("div",{class:h.header},r(e,{class:h.title},this.label)):null,r("div",{key:"c5ea010badc430bcb8b288476187ffa390a00aba",class:h.inner,id:this.contentId,"aria-hidden":this.collapsible?t(!this.isExpanded):undefined,hidden:this.collapsible?!this.isExpanded:undefined,"aria-labelledby":this.collapsible?this.headlineId:undefined},this.h.hasSlot("img")&&r("p",{key:"5886f9d7e45b4e391f90cafb9e3b265093e2739f",class:h.img},r("slot",{key:"acfff41523785afe6429277bc64cf1c8d698f047",name:"img"})),r("div",{key:"71296fbd2b1333459e1d1b34e18d3ce4f1fce8d0",class:h.main},this.h.hasSlot("icon")&&this.promotion&&r("div",{key:"b87b2006997178b6aac4c66c8612a449fc7c90e9",class:h.icon},r("slot",{key:"ab0c18d9063987c83355bb6e1494fd13a6da72d2",name:"icon"})),r("div",{key:"61a9762eca1c88158c768d4920ba167657d5290e",class:h.content},r("slot",{key:"de8b07370786fa353a488cf92f2c5195b327521c"})),this.h.hasSlot("btn")&&this.promotion&&r("div",{key:"65d6b6b5f87b54803fc335282f3a2223f12c9a23",class:h.btns},r("slot",{key:"2942bd6cc79958a5e610c234e5f79b52a59fa83d",name:"btn"}))),this.h.hasSlot("footer")&&r("div",{key:"6a31971efcd942e7acb0775de77bf104c580f2c3",class:h.footer},r("slot",{key:"652b298be04e1e55a338309e5644229755cb9f7b",name:"footer"}))))}onClickHandler(e){e.stopPropagation();if(this.collapsible){this.isExpanded=!this.isExpanded;this.emmitChange()}}async open(){if(this.collapsible){this.isExpanded=true;this.emmitChange()}}async close(){if(this.collapsible){this.isExpanded=false;this.emmitChange()}}async validateWcag(){if(this.collapsible){n(this.wcagTriggerLabel,this.wcagTriggerLabelledBy,h.root)}}get host(){return this}static get watchers(){return{headlineTag:["validateHeadlineTag"]}}static get style(){return f}},[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]},undefined,{headlineTag:["validateHeadlineTag"]}]);function b(){if(typeof customElements==="undefined"){return}const e=["gov-card","gov-icon"];e.forEach((e=>{switch(e){case"gov-card":if(!customElements.get(e)){customElements.define(e,_)}break;case"gov-icon":if(!customElements.get(e)){v()}break}}))}b();const m=_;const u=b;export{m as GovCard,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-card.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-e35fdedd.js";const d=o;const t=s;export{d as GovChip,t as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-chip.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-483d079f.js";const t=o;const p=s;export{t as GovFormAutocomplete,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-autocomplete.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as r,c as a,h as e,d as t}from"./p-d6759ac3.js";import{F as i,a as g,b as p,c as s}from"./p-e44a0fee.js";import{g as n}from"./p-d687df8f.js";import{v as f}from"./p-344c72d7.js";import{t as m}from"./p-240c302e.js";import{p as l}from"./p-
|
|
1
|
+
import{p as o,H as r,c as a,h as e,d as t}from"./p-d6759ac3.js";import{F as i,a as g,b as p,c as s}from"./p-e44a0fee.js";import{g as n}from"./p-d687df8f.js";import{v as f}from"./p-344c72d7.js";import{t as m}from"./p-240c302e.js";import{p as l}from"./p-3f704a40.js";const c='.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-group,gov-form-radio-group,gov-form-checkbox-group,.gov-form-group{position:relative;display:flex;width:100%;flex-direction:column;align-items:flex-start}gov-form-group .gov-form-label__label,gov-form-radio-group .gov-form-label__label,gov-form-checkbox-group .gov-form-label__label,.gov-form-group .gov-form-label__label{margin:0}gov-form-group[orientation=horizontal],gov-form-radio-group[orientation=horizontal],gov-form-checkbox-group[orientation=horizontal],.gov-form-group[orientation=horizontal]{flex-direction:row;flex-wrap:wrap}gov-form-group[orientation=horizontal] .gov-form-label__label,gov-form-radio-group[orientation=horizontal] .gov-form-label__label,gov-form-checkbox-group[orientation=horizontal] .gov-form-label__label,.gov-form-group[orientation=horizontal] .gov-form-label__label{white-space:nowrap}gov-form-group[gap="2xs"],gov-form-radio-group[gap="2xs"],gov-form-checkbox-group[gap="2xs"],.gov-form-group[gap="2xs"]{gap:0.25rem}gov-form-group[gap=xs],gov-form-radio-group[gap=xs],gov-form-checkbox-group[gap=xs],.gov-form-group[gap=xs]{gap:0.5rem}gov-form-group[gap=s],gov-form-radio-group[gap=s],gov-form-checkbox-group[gap=s],.gov-form-group[gap=s]{gap:0.75rem}gov-form-group[gap=m],gov-form-radio-group[gap=m],gov-form-checkbox-group[gap=m],.gov-form-group[gap=m]{gap:1rem}gov-form-group[gap=l],gov-form-radio-group[gap=l],gov-form-checkbox-group[gap=l],.gov-form-group[gap=l]{gap:1.25rem}';const u=c;const v=o(class o extends r{constructor(){super();this.__registerHost();this.govChange=a(this,"gov-change",7);this.handleChange=o=>{var r;o.stopPropagation();const a=l(this.value);if(!Array.isArray(a))return;if(o.detail.checked){this.value=[...a,o.detail.value]}else{this.value=(r=a.filter((r=>r!==o.detail.value)))!==null&&r!==void 0?r:[]}this.govChange.emit({value:this.value,component:i.root})};this.gap=undefined;this.orientation="vertical";this.value=undefined;this.h=n(this.host)}validateGap(o){if(o){f(p,o,g.root)}}validateOrientation(o){if(o){f(s,o,g.root)}}componentWillLoad(){this.validateGap(this.gap);this.validateOrientation(this.orientation);this.value=l(this.value)}componentDidRender(){m((()=>this.rerenderComponent()))}rerenderComponent(){this.host.querySelectorAll("gov-form-checkbox").forEach((o=>{if(!o.hasAttribute("listener-attached")){o.addEventListener("gov-change",this.handleChange)}o.setAttribute("listener-attached","true");o.checked=this.value.includes(o.value)}))}render(){return e(t,{key:"88552de8dbe801932fcb4bb2a3df219e31d0d1fc",gap:this.gap,class:this.h.classes(g.root),value:this.value},e("slot",{key:"5f753a7cbcbf30e1bcd924974f3319f359e3fd82"}))}get host(){return this}static get watchers(){return{gap:["validateGap"],orientation:["validateOrientation"]}}static get style(){return u}},[4,"gov-form-checkbox-group",{gap:[1],orientation:[1],value:[1025]},undefined,{gap:["validateGap"],orientation:["validateOrientation"]}]);function h(){if(typeof customElements==="undefined"){return}const o=["gov-form-checkbox-group"];o.forEach((o=>{switch(o){case"gov-form-checkbox-group":if(!customElements.get(o)){customElements.define(o,v)}break}}))}h();const d=v;const b=h;export{d as GovFormCheckboxGroup,b as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-checkbox-group.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as e,c as r,h as c,d as i}from"./p-d6759ac3.js";import{c as a}from"./p-95d41a3b.js";import{v as t}from"./p-344c72d7.js";import{g as s,f as h,h as n}from"./p-77a6e3be.js";import{g as v,a as l,t as m}from"./p-d687df8f.js";import{b as g,c as b}from"./p-6b0471a8.js";import{c as d}from"./p-e618f1cb.js";import{d as f}from"./p-e0e2e9c1.js";import{F as k}from"./p-1c1d0bbe.js";import{d as x}from"./p-95ac62b9.js";const p='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-checkbox{cursor:pointer}.gov-form-checkbox input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-checkbox input+span{position:relative;display:block;cursor:pointer}.gov-form-checkbox input+span::before{content:"";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-checkbox .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-checkbox input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=""].gov-form-checkbox .gov-form-label__label,[invalid=true i].gov-form-checkbox .gov-form-label__label,[invalid="1"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-checkbox input+span::before,[invalid=true i].gov-form-checkbox input+span::before,[invalid="1"].gov-form-checkbox input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=""].gov-form-checkbox,[disabled=true i].gov-form-checkbox,[disabled="1"].gov-form-checkbox{pointer-events:none}[disabled=""].gov-form-checkbox .gov-form-label__label,[disabled=true i].gov-form-checkbox .gov-form-label__label,[disabled="1"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-checkbox input+span::before,[disabled=true i].gov-form-checkbox input+span::before,[disabled="1"].gov-form-checkbox input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-checkbox{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-checkbox{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-checkbox{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-checkbox{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-checkbox input+span::before{border-radius:var(--gov-border-radius, 0.1875rem)}.gov-form-checkbox__check{position:absolute;color:var(--gov-form-checkbox-check-color, var(--gov-color-neutral-white));opacity:0;transition:150ms linear opacity}.gov-form-checkbox__label{position:relative}.gov-form-checkbox input:checked+span::before{background:var(--gov-form-checkbox-indicator-bg, var(--gov-color-primary))}input:checked+span .gov-form-checkbox__check{opacity:1}.gov-form-checkbox[invalid=""] input:checked+span::before,.gov-form-checkbox[invalid=true i] input:checked+span::before,.gov-form-checkbox[invalid="1"] input:checked+span::before{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-checkbox[disabled=""] input:checked+span::before,.gov-form-checkbox[disabled=true i] input:checked+span::before,.gov-form-checkbox[disabled="1"] input:checked+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400));background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-checkbox[size=xs] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-xs-check-size, 0.75rem);height:var(--gov-form-checkbox-core-xs-check-size, 0.75rem)}.gov-form-checkbox[size=s] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);width:var(--gov-form-checkbox-core-s-check-size, 0.825rem);height:var(--gov-form-checkbox-core-s-check-size, 0.825rem)}.gov-form-checkbox[size=m] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);width:var(--gov-form-checkbox-core-m-check-size, 0.9rem);height:var(--gov-form-checkbox-core-m-check-size, 0.9rem)}.gov-form-checkbox[size=l] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);width:var(--gov-form-checkbox-core-l-check-size, 1.2rem);height:var(--gov-form-checkbox-core-l-check-size, 1.2rem)}';const u=p;const z=o(class o extends e{constructor(){super();this.__registerHost();this.govFocus=r(this,"gov-focus",7);this.govBlur=r(this,"gov-blur",7);this.govChange=r(this,"gov-change",7);this.hydrated=false;this.value=undefined;this.checked=false;this.required=false;this.disabled=false;this.name=undefined;this.size="m";this.identifier=undefined;this.noLabel=false;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.checkboxId=a("GovCheckbox");this.h=v(this.host);this.f=s(this.h)}validateSize(o){t(n,o,h.root)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",l(this.invalid))}componentWillLoad(){this.f.passAttrToControl("type","checkbox");this.passControlAttrs()}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.checkboxId);this.f.passAttrToLabel("required",String(this.required));if(d()){await f(500);await this.validateWcag()}}connectedCallback(){this.hydrated=true}render(){const o=o=>{if(this.noLabel){return c("label",{class:h.label},o)}return o};return c(i,{class:h.root,hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:m(this.invalid)},o(c(k,null,c("input",{id:this.identifier||this.checkboxId,type:"checkbox",value:this.value,name:this.name,checked:this.checked,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,ref:o=>this.inputRef=o,"aria-checked":l(this.checked),"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":m(this.disabled)}),c("span",null,c("slot",{name:"label"}),c("gov-icon",{class:h.check,name:"check-lg"})))))}onFocusHandler(o){o.stopPropagation();this.govFocus.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}onBlurHandler(o){o.stopPropagation();this.govBlur.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}onClickHandler(o){o.stopPropagation()}onChangeHandler(o){this.checked=o.target.checked;o.stopPropagation();this.govChange.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}async getRef(){return this.inputRef}async validateWcag(){g(this.wcagDescribedBy,"wcag-described-by",h.root);g(this.wcagLabelledBy,"wcag-labelled-by",h.root);b(this.identifier||this.checkboxId,this.wcagLabelledBy,h.root)}get host(){return this}static get watchers(){return{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}}static get style(){return u}},[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]},undefined,{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}]);function w(){if(typeof customElements==="undefined"){return}const o=["gov-form-checkbox","gov-icon"];o.forEach((o=>{switch(o){case"gov-form-checkbox":if(!customElements.get(o)){customElements.define(o,z)}break;case"gov-icon":if(!customElements.get(o)){x()}break}}))}w();const y=z;const _=w;export{y as GovFormCheckbox,_ as defineCustomElement};
|
|
1
|
+
import{p as o,H as e,c as r,h as c,d as i}from"./p-d6759ac3.js";import{c as a}from"./p-95d41a3b.js";import{v as t}from"./p-344c72d7.js";import{g as s,f as h,h as n}from"./p-77a6e3be.js";import{g as v,a as l,t as m}from"./p-d687df8f.js";import{b as g,c as b}from"./p-6b0471a8.js";import{c as d}from"./p-e618f1cb.js";import{d as f}from"./p-e0e2e9c1.js";import{F as k}from"./p-1c1d0bbe.js";import{d as x}from"./p-fd554fb4.js";const p='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-checkbox{cursor:pointer}.gov-form-checkbox input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-checkbox input+span{position:relative;display:block;cursor:pointer}.gov-form-checkbox input+span::before{content:"";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-checkbox .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-checkbox input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=""].gov-form-checkbox .gov-form-label__label,[invalid=true i].gov-form-checkbox .gov-form-label__label,[invalid="1"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-checkbox input+span::before,[invalid=true i].gov-form-checkbox input+span::before,[invalid="1"].gov-form-checkbox input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=""].gov-form-checkbox,[disabled=true i].gov-form-checkbox,[disabled="1"].gov-form-checkbox{pointer-events:none}[disabled=""].gov-form-checkbox .gov-form-label__label,[disabled=true i].gov-form-checkbox .gov-form-label__label,[disabled="1"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-checkbox input+span::before,[disabled=true i].gov-form-checkbox input+span::before,[disabled="1"].gov-form-checkbox input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-checkbox{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-checkbox{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-checkbox{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-checkbox{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-checkbox input+span::before{border-radius:var(--gov-border-radius, 0.1875rem)}.gov-form-checkbox__check{position:absolute;color:var(--gov-form-checkbox-check-color, var(--gov-color-neutral-white));opacity:0;transition:150ms linear opacity}.gov-form-checkbox__label{position:relative}.gov-form-checkbox input:checked+span::before{background:var(--gov-form-checkbox-indicator-bg, var(--gov-color-primary))}input:checked+span .gov-form-checkbox__check{opacity:1}.gov-form-checkbox[invalid=""] input:checked+span::before,.gov-form-checkbox[invalid=true i] input:checked+span::before,.gov-form-checkbox[invalid="1"] input:checked+span::before{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-checkbox[disabled=""] input:checked+span::before,.gov-form-checkbox[disabled=true i] input:checked+span::before,.gov-form-checkbox[disabled="1"] input:checked+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400));background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-checkbox[size=xs] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-xs-check-size, 0.75rem);height:var(--gov-form-checkbox-core-xs-check-size, 0.75rem)}.gov-form-checkbox[size=s] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);width:var(--gov-form-checkbox-core-s-check-size, 0.825rem);height:var(--gov-form-checkbox-core-s-check-size, 0.825rem)}.gov-form-checkbox[size=m] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);width:var(--gov-form-checkbox-core-m-check-size, 0.9rem);height:var(--gov-form-checkbox-core-m-check-size, 0.9rem)}.gov-form-checkbox[size=l] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);width:var(--gov-form-checkbox-core-l-check-size, 1.2rem);height:var(--gov-form-checkbox-core-l-check-size, 1.2rem)}';const u=p;const z=o(class o extends e{constructor(){super();this.__registerHost();this.govFocus=r(this,"gov-focus",7);this.govBlur=r(this,"gov-blur",7);this.govChange=r(this,"gov-change",7);this.hydrated=false;this.value=undefined;this.checked=false;this.required=false;this.disabled=false;this.name=undefined;this.size="m";this.identifier=undefined;this.noLabel=false;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.checkboxId=a("GovCheckbox");this.h=v(this.host);this.f=s(this.h)}validateSize(o){t(n,o,h.root)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",l(this.invalid))}componentWillLoad(){this.f.passAttrToControl("type","checkbox");this.passControlAttrs()}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.checkboxId);this.f.passAttrToLabel("required",String(this.required));if(d()){await f(500);await this.validateWcag()}}connectedCallback(){this.hydrated=true}render(){const o=o=>{if(this.noLabel){return c("label",{class:h.label},o)}return o};return c(i,{class:h.root,hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:m(this.invalid)},o(c(k,null,c("input",{id:this.identifier||this.checkboxId,type:"checkbox",value:this.value,name:this.name,checked:this.checked,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,ref:o=>this.inputRef=o,"aria-checked":l(this.checked),"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":m(this.disabled)}),c("span",null,c("slot",{name:"label"}),c("gov-icon",{class:h.check,name:"check-lg"})))))}onFocusHandler(o){o.stopPropagation();this.govFocus.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}onBlurHandler(o){o.stopPropagation();this.govBlur.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}onClickHandler(o){o.stopPropagation()}onChangeHandler(o){this.checked=o.target.checked;o.stopPropagation();this.govChange.emit({component:h.root,value:this.value,checked:this.checked,originalEvent:o})}async getRef(){return this.inputRef}async validateWcag(){g(this.wcagDescribedBy,"wcag-described-by",h.root);g(this.wcagLabelledBy,"wcag-labelled-by",h.root);b(this.identifier||this.checkboxId,this.wcagLabelledBy,h.root)}get host(){return this}static get watchers(){return{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}}static get style(){return u}},[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]},undefined,{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}]);function w(){if(typeof customElements==="undefined"){return}const o=["gov-form-checkbox","gov-icon"];o.forEach((o=>{switch(o){case"gov-form-checkbox":if(!customElements.get(o)){customElements.define(o,z)}break;case"gov-icon":if(!customElements.get(o)){x()}break}}))}w();const y=z;const _=w;export{y as GovFormCheckbox,_ as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-checkbox.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as i,c as o,h as a,d as l}from"./p-d6759ac3.js";import{c as r}from"./p-95d41a3b.js";import{g as t,a as s,t as f}from"./p-d687df8f.js";import{b as n,c as d}from"./p-6b0471a8.js";import{c as m}from"./p-e618f1cb.js";import{d as g}from"./p-e0e2e9c1.js";import{g as v}from"./p-77a6e3be.js";import{d as c}from"./p-8df7c635.js";import{d as h}from"./p-7fe30d5d.js";import{d as b}from"./p-68d5f793.js";import{d as _}from"./p-4489a1da.js";import{d as p}from"./p-95ac62b9.js";const u={root:"gov-form-file",area:"gov-form-file__area",label:"gov-form-file__label",input:"gov-form-file__input",list:"gov-form-file__list",item:"gov-form-file__item",attachments:"gov-form-file__attachments"};function x(e){const i=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let o=0,a=parseInt(e,10)||0;while(a>=1024&&++o){a=a/1024}return a.toFixed(a<10&&o>0?1:0)+" "+i[o]}function y(e,i){if(typeof i==="string"&&i.length){return i.replace(/\s/g,"").split(",").filter((i=>new RegExp(i.replace("*",".*")).test(e.type))).length>0}else{return true}}function w(e,i){const o=Math.round(e.size);return o<=i}const k='.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-file{position:relative;display:block;width:100%}.gov-form-file__label .gov-form-label__label>*:last-child{margin-bottom:0}.gov-form-file__input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0.0001;cursor:pointer}.gov-form-file__attachments{margin-top:1rem 0rem 0rem}.gov-form-file__item{display:flex;gap:1rem;align-items:center}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label{pointer-events:none}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label *{color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}.gov-form-file[expanded=""] .gov-form-file__area,.gov-form-file[expanded=true i] .gov-form-file__area,.gov-form-file[expanded="1"] .gov-form-file__area{position:relative;width:100%;padding:2rem 1.375rem 1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center;transition:background-color 150ms ease-in-out;will-change:background-color}.gov-form-file[expanded=""] .gov-form-file__area.highlight,.gov-form-file[expanded=true i] .gov-form-file__area.highlight,.gov-form-file[expanded="1"] .gov-form-file__area.highlight{background-color:var(--gov-color-primary-200)}.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{width:100%;padding:1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center}.gov-form-file[expanded=""] .gov-form-file__attachments,.gov-form-file[expanded=true i] .gov-form-file__attachments,.gov-form-file[expanded="1"] .gov-form-file__attachments{margin:1.5rem 0rem 0rem}.gov-form-file[expanded=""][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__label .gov-form-label__label{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][invalid=""] .gov-form-file__area,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__area,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__area{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][disabled=""] .gov-form-file__area,.gov-form-file[expanded=""][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=""][disabled="1"] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=""] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=true i][disabled="1"] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=""] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=true i] .gov-form-file__area,.gov-form-file[expanded="1"][disabled="1"] .gov-form-file__area{pointer-events:none;color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}@media (min-width: 30em){.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{padding:2rem}}';const E=k;const F=e(class e extends i{constructor(){super();this.__registerHost();this.govFocus=o(this,"gov-focus",7);this.govBlur=o(this,"gov-blur",7);this.govFiles=o(this,"gov-files",7);this.govAddFile=o(this,"gov-add-file",7);this.govRemoveFile=o(this,"gov-remove-file",7);this.expanded=false;this.required=false;this.disabled=false;this.resetAfterPick=true;this.ignoreFileDuplicationCheck=false;this.displayAttachments=true;this.name=undefined;this.accept=undefined;this.multiple=false;this.maxFileSize=-1;this.identifier=undefined;this.invalid=undefined;this.errorSize="Soubor je větší než povolená velikost {FILE_SIZE}";this.errorAccept="Soubor tohoto typu není povolen";this.attachmentsLabel="Přílohy";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagRemoveLabel="Odebrat soubor {FILE_NAME}";this.wcagAttachmentsLabel="Přílohy";this.files=[];this.fileId=r("GovInputFile");this.h=t(this.host);this.f=v(this.h)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("invalid",s(this.invalid));this.f.passAttrToControl("type","File")}registerListeners(){function e(){this.areaRef.classList.add("highlight")}function i(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(e=>{e.preventDefault();e.stopPropagation();const i=e.target.files;if(this.resetAfterPick){if(i.length){this.validateFiles(i)}}else{this.validateFiles(i)}}),false);if(this.expanded){const o=["dragover","dragleave"];const a=["dragenter","dragover","mouseenter"];const l=["dragleave","drop","mouseleave"];o.map((e=>this.inputRef.addEventListener(e,this.preventDefaults.bind(this),false)));a.map((i=>this.inputRef.addEventListener(i,e.bind(this),false)));l.forEach((e=>this.inputRef.addEventListener(e,i.bind(this),false)));this.areaRef.addEventListener("drop",this.handleDrop.bind(this),false)}}preventDefaults(e){e.preventDefault();e.stopPropagation()}handleDrop(e){const i=e.dataTransfer;this.validateFiles(i.files)}validateFiles(e){let i=[];Array.from(e).map((e=>{const o=this.files.find((i=>i.file.name===e.name&&i.file.size===e.size))||null;if(o===null||this.ignoreFileDuplicationCheck){const o=typeof this.maxFileSize==="number"&&this.maxFileSize>0?w(e,this.maxFileSize):true;const a=y(e,this.accept);const l={id:r("GovFormFile"),file:e,acceptValid:a,sizeValid:o};if(this.displayAttachments){this.files=[...this.files,l]}else{i=[...i,l]}this.govAddFile.emit({component:u.root,file:l})}}));this.govFiles.emit({component:u.root,files:i.length?i:this.files});if(this.resetAfterPick){this.reset().finally()}}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.watchDisabled()}async componentDidRender(){if(m()){await g(500);await this.validateWcag()}this.registerListeners()}render(){return a(l,{key:"0f0c007e221e04c4876b204dc1967f5b3bc7cfa4",class:this.h.classes([u.root]),invalid:f(this.invalid),expanded:f(this.expanded)},a("div",{key:"f49933f160fcebaf5b6b7a65a039d4b1dadeadea",class:u.area,ref:e=>this.areaRef=e},a("slot",{key:"1bd9bc79fae21146bfa60b34cc0a9caeaf53b4e0"}),a("input",{key:"71c235790f137f973f65fa5cc355af2da124a86f",class:u.input,ref:e=>this.inputRef=e,id:this.identifier||this.fileId,type:"file",name:this.name,accept:this.accept,multiple:this.multiple,onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,"aria-required":f(this.required),"aria-invalid":f(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":f(this.disabled)})),this.h.hasSlot("attachments")?a("div",{class:u.attachments},a("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?a("div",{class:u.attachments},a("gov-attachments",{label:this.wcagAttachmentsLabel,"wcag-label":this.wcagAttachmentsLabel},this.files.map((e=>a("gov-attachments-item",{"wcag-remove-labelled-by":e.id,"on-gov-remove":()=>this.onRemoveFileHandler(e)},a("span",{class:"sr-only",id:e.id},this.wcagRemoveLabel.replace("{FILE_NAME}",e.file.name)),e.file.name,e.acceptValid===false?a("gov-form-message",{slot:"message",variant:"error"},a("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),e.acceptValid===false?this.errorAccept:null):null,e.sizeValid===false?a("gov-form-message",{slot:"message",variant:"error"},a("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),this.errorSize.replace("{FILE_SIZE}",x(this.maxFileSize))):null,a("span",{slot:"info"},"(",x(e.file.size),")")))))):null)}onRemoveFileHandler(e){const i=this.files.findIndex((i=>i.id===e.id));if(i!==-1){const e=this.files;const o=this.files[i];e.splice(i,1);this.files=[...e];this.govRemoveFile.emit({component:u.root,file:o});this.govFiles.emit({component:u.root,files:e})}}onFocusHandler(e){e.stopPropagation();this.govFocus.emit({component:u.root,originalEvent:e})}onBlurHandler(e){e.stopPropagation();this.govBlur.emit({component:u.root,originalEvent:e})}onChangeHandler(e){e.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async reset(){this.files=[];this.inputRef.value=""}async validateWcag(){n(this.wcagDescribedBy,"wcag-described-by",u.root);n(this.wcagLabelledBy,"wcag-labelled-by",u.root);d(this.identifier||this.fileId,this.wcagLabelledBy,u.root)}get host(){return this}static get watchers(){return{disabled:["watchDisabled"],invalid:["watchDisabled"]}}static get style(){return E}},[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]},undefined,{disabled:["watchDisabled"],invalid:["watchDisabled"]}]);function j(){if(typeof customElements==="undefined"){return}const e=["gov-form-file","gov-attachments","gov-attachments-item","gov-button","gov-form-message","gov-icon"];e.forEach((e=>{switch(e){case"gov-form-file":if(!customElements.get(e)){customElements.define(e,F)}break;case"gov-attachments":if(!customElements.get(e)){c()}break;case"gov-attachments-item":if(!customElements.get(e)){h()}break;case"gov-button":if(!customElements.get(e)){b()}break;case"gov-form-message":if(!customElements.get(e)){_()}break;case"gov-icon":if(!customElements.get(e)){p()}break}}))}j();const B=F;const A=j;export{B as GovFormFile,A as defineCustomElement};
|
|
1
|
+
import{p as e,H as i,c as o,h as a,d as l}from"./p-d6759ac3.js";import{c as r}from"./p-95d41a3b.js";import{g as t,a as s,t as f}from"./p-d687df8f.js";import{b as n,c as d}from"./p-6b0471a8.js";import{c as m}from"./p-e618f1cb.js";import{d as g}from"./p-e0e2e9c1.js";import{g as v}from"./p-77a6e3be.js";import{d as c}from"./p-8df7c635.js";import{d as h}from"./p-57bc98b3.js";import{d as b}from"./p-44c731a0.js";import{d as _}from"./p-4489a1da.js";import{d as p}from"./p-fd554fb4.js";const u={root:"gov-form-file",area:"gov-form-file__area",label:"gov-form-file__label",input:"gov-form-file__input",list:"gov-form-file__list",item:"gov-form-file__item",attachments:"gov-form-file__attachments"};function x(e){const i=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let o=0,a=parseInt(e,10)||0;while(a>=1024&&++o){a=a/1024}return a.toFixed(a<10&&o>0?1:0)+" "+i[o]}function y(e,i){if(typeof i==="string"&&i.length){return i.replace(/\s/g,"").split(",").filter((i=>new RegExp(i.replace("*",".*")).test(e.type))).length>0}else{return true}}function w(e,i){const o=Math.round(e.size);return o<=i}const k='.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-file{position:relative;display:block;width:100%}.gov-form-file__label .gov-form-label__label>*:last-child{margin-bottom:0}.gov-form-file__input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0.0001;cursor:pointer}.gov-form-file__attachments{margin-top:1rem 0rem 0rem}.gov-form-file__item{display:flex;gap:1rem;align-items:center}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label{pointer-events:none}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label *{color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}.gov-form-file[expanded=""] .gov-form-file__area,.gov-form-file[expanded=true i] .gov-form-file__area,.gov-form-file[expanded="1"] .gov-form-file__area{position:relative;width:100%;padding:2rem 1.375rem 1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center;transition:background-color 150ms ease-in-out;will-change:background-color}.gov-form-file[expanded=""] .gov-form-file__area.highlight,.gov-form-file[expanded=true i] .gov-form-file__area.highlight,.gov-form-file[expanded="1"] .gov-form-file__area.highlight{background-color:var(--gov-color-primary-200)}.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{width:100%;padding:1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center}.gov-form-file[expanded=""] .gov-form-file__attachments,.gov-form-file[expanded=true i] .gov-form-file__attachments,.gov-form-file[expanded="1"] .gov-form-file__attachments{margin:1.5rem 0rem 0rem}.gov-form-file[expanded=""][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__label .gov-form-label__label{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][invalid=""] .gov-form-file__area,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__area,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__area{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][disabled=""] .gov-form-file__area,.gov-form-file[expanded=""][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=""][disabled="1"] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=""] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=true i][disabled="1"] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=""] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=true i] .gov-form-file__area,.gov-form-file[expanded="1"][disabled="1"] .gov-form-file__area{pointer-events:none;color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}@media (min-width: 30em){.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{padding:2rem}}';const E=k;const F=e(class e extends i{constructor(){super();this.__registerHost();this.govFocus=o(this,"gov-focus",7);this.govBlur=o(this,"gov-blur",7);this.govFiles=o(this,"gov-files",7);this.govAddFile=o(this,"gov-add-file",7);this.govRemoveFile=o(this,"gov-remove-file",7);this.expanded=false;this.required=false;this.disabled=false;this.resetAfterPick=true;this.ignoreFileDuplicationCheck=false;this.displayAttachments=true;this.name=undefined;this.accept=undefined;this.multiple=false;this.maxFileSize=-1;this.identifier=undefined;this.invalid=undefined;this.errorSize="Soubor je větší než povolená velikost {FILE_SIZE}";this.errorAccept="Soubor tohoto typu není povolen";this.attachmentsLabel="Přílohy";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagRemoveLabel="Odebrat soubor {FILE_NAME}";this.wcagAttachmentsLabel="Přílohy";this.files=[];this.fileId=r("GovInputFile");this.h=t(this.host);this.f=v(this.h)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("invalid",s(this.invalid));this.f.passAttrToControl("type","File")}registerListeners(){function e(){this.areaRef.classList.add("highlight")}function i(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(e=>{e.preventDefault();e.stopPropagation();const i=e.target.files;if(this.resetAfterPick){if(i.length){this.validateFiles(i)}}else{this.validateFiles(i)}}),false);if(this.expanded){const o=["dragover","dragleave"];const a=["dragenter","dragover","mouseenter"];const l=["dragleave","drop","mouseleave"];o.map((e=>this.inputRef.addEventListener(e,this.preventDefaults.bind(this),false)));a.map((i=>this.inputRef.addEventListener(i,e.bind(this),false)));l.forEach((e=>this.inputRef.addEventListener(e,i.bind(this),false)));this.areaRef.addEventListener("drop",this.handleDrop.bind(this),false)}}preventDefaults(e){e.preventDefault();e.stopPropagation()}handleDrop(e){const i=e.dataTransfer;this.validateFiles(i.files)}validateFiles(e){let i=[];Array.from(e).map((e=>{const o=this.files.find((i=>i.file.name===e.name&&i.file.size===e.size))||null;if(o===null||this.ignoreFileDuplicationCheck){const o=typeof this.maxFileSize==="number"&&this.maxFileSize>0?w(e,this.maxFileSize):true;const a=y(e,this.accept);const l={id:r("GovFormFile"),file:e,acceptValid:a,sizeValid:o};if(this.displayAttachments){this.files=[...this.files,l]}else{i=[...i,l]}this.govAddFile.emit({component:u.root,file:l})}}));this.govFiles.emit({component:u.root,files:i.length?i:this.files});if(this.resetAfterPick){this.reset().finally()}}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.watchDisabled()}async componentDidRender(){if(m()){await g(500);await this.validateWcag()}this.registerListeners()}render(){return a(l,{key:"0f0c007e221e04c4876b204dc1967f5b3bc7cfa4",class:this.h.classes([u.root]),invalid:f(this.invalid),expanded:f(this.expanded)},a("div",{key:"f49933f160fcebaf5b6b7a65a039d4b1dadeadea",class:u.area,ref:e=>this.areaRef=e},a("slot",{key:"1bd9bc79fae21146bfa60b34cc0a9caeaf53b4e0"}),a("input",{key:"71c235790f137f973f65fa5cc355af2da124a86f",class:u.input,ref:e=>this.inputRef=e,id:this.identifier||this.fileId,type:"file",name:this.name,accept:this.accept,multiple:this.multiple,onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,"aria-required":f(this.required),"aria-invalid":f(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":f(this.disabled)})),this.h.hasSlot("attachments")?a("div",{class:u.attachments},a("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?a("div",{class:u.attachments},a("gov-attachments",{label:this.wcagAttachmentsLabel,"wcag-label":this.wcagAttachmentsLabel},this.files.map((e=>a("gov-attachments-item",{"wcag-remove-labelled-by":e.id,"on-gov-remove":()=>this.onRemoveFileHandler(e)},a("span",{class:"sr-only",id:e.id},this.wcagRemoveLabel.replace("{FILE_NAME}",e.file.name)),e.file.name,e.acceptValid===false?a("gov-form-message",{slot:"message",variant:"error"},a("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),e.acceptValid===false?this.errorAccept:null):null,e.sizeValid===false?a("gov-form-message",{slot:"message",variant:"error"},a("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),this.errorSize.replace("{FILE_SIZE}",x(this.maxFileSize))):null,a("span",{slot:"info"},"(",x(e.file.size),")")))))):null)}onRemoveFileHandler(e){const i=this.files.findIndex((i=>i.id===e.id));if(i!==-1){const e=this.files;const o=this.files[i];e.splice(i,1);this.files=[...e];this.govRemoveFile.emit({component:u.root,file:o});this.govFiles.emit({component:u.root,files:e})}}onFocusHandler(e){e.stopPropagation();this.govFocus.emit({component:u.root,originalEvent:e})}onBlurHandler(e){e.stopPropagation();this.govBlur.emit({component:u.root,originalEvent:e})}onChangeHandler(e){e.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async reset(){this.files=[];this.inputRef.value=""}async validateWcag(){n(this.wcagDescribedBy,"wcag-described-by",u.root);n(this.wcagLabelledBy,"wcag-labelled-by",u.root);d(this.identifier||this.fileId,this.wcagLabelledBy,u.root)}get host(){return this}static get watchers(){return{disabled:["watchDisabled"],invalid:["watchDisabled"]}}static get style(){return E}},[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]},undefined,{disabled:["watchDisabled"],invalid:["watchDisabled"]}]);function j(){if(typeof customElements==="undefined"){return}const e=["gov-form-file","gov-attachments","gov-attachments-item","gov-button","gov-form-message","gov-icon"];e.forEach((e=>{switch(e){case"gov-form-file":if(!customElements.get(e)){customElements.define(e,F)}break;case"gov-attachments":if(!customElements.get(e)){c()}break;case"gov-attachments-item":if(!customElements.get(e)){h()}break;case"gov-button":if(!customElements.get(e)){b()}break;case"gov-form-message":if(!customElements.get(e)){_()}break;case"gov-icon":if(!customElements.get(e)){p()}break}}))}j();const B=F;const A=j;export{B as GovFormFile,A as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-file.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-8ac22724.js";const t=o;const a=s;export{t as GovFormInput,a as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-input.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as i,h as o,d as r}from"./p-d6759ac3.js";import{g as s,j as l,k as c,l as a}from"./p-77a6e3be.js";import{g as n,a as m,t as g}from"./p-d687df8f.js";import{c as v}from"./p-e618f1cb.js";import{v as u}from"./p-344c72d7.js";import{b as f,c as d}from"./p-6b0471a8.js";import{c as h,r as p}from"./p-95d41a3b.js";import{d as z}from"./p-e0e2e9c1.js";import{p as b}from"./p-0a6a373e.js";import{t as x}from"./p-240c302e.js";import{d as w}from"./p-68d5f793.js";import{d as y}from"./p-86aa4e6c.js";import{d as k}from"./p-31fe0e76.js";import{d as _}from"./p-95ac62b9.js";const j='.gov-form-multi-select__list{margin:0;padding:0}.gov-form-multi-select__list>.gov-form-multi-select__item{margin:0;padding:0;background:none}.gov-form-multi-select__list>.gov-form-multi-select__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-multi-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-multi-select .element{position:relative;display:flex;flex:1 1 auto}.gov-form-multi-select input,.gov-form-multi-select select,.gov-form-multi-select textarea{width:100%;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));font-family:var(--gov-font-family, "Roboto", sans-serif)}.gov-form-multi-select input:focus,.gov-form-multi-select select:focus,.gov-form-multi-select textarea:focus{outline:none}.gov-form-multi-select input:focus-visible,.gov-form-multi-select select:focus-visible,.gov-form-multi-select textarea:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-form-multi-select input::-moz-placeholder,.gov-form-multi-select select::-moz-placeholder,.gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select input::placeholder,.gov-form-multi-select select::placeholder,.gov-form-multi-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select textarea{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);padding:0.5rem 0.75rem;resize:none}.gov-form-multi-select *[slot=left-icon],.gov-form-multi-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-multi-select *[slot=left-icon]{left:0}.gov-form-multi-select *[slot=right-icon]{right:0}.gov-form-multi-select *[slot=prefix],.gov-form-multi-select *[slot=sufix]{margin:0}[size=s].gov-form-multi-select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);gap:0.5rem var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select input,[size=s].gov-form-multi-select select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);height:var(--gov-form-input-core-s-height, 2rem);padding:var(--gov-form-input-core-s-padding, 0.25rem 0.75rem)}[size=s].gov-form-multi-select *[slot=left-icon],[size=s].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-s-icon-size, 1rem);height:var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=right-icon]~input,[size=s].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select input,[size=m].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-multi-select *[slot=left-icon],[size=m].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=right-icon]~input,[size=m].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select input,[size=l].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-multi-select *[slot=left-icon],[size=l].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=right-icon]~input,[size=l].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-multi-select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select input,[size=xl].gov-form-multi-select select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-multi-select *[slot=left-icon],[size=xl].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=right-icon]~input,[size=xl].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-multi-select input,[variant=primary].gov-form-multi-select select,[variant=primary].gov-form-multi-select textarea{color:var(--gov-form-input-color-primary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}[variant=primary].gov-form-multi-select *[slot=left-icon],[variant=primary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-multi-select input,[variant=secondary].gov-form-multi-select select,[variant=secondary].gov-form-multi-select textarea{color:var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}[variant=secondary].gov-form-multi-select *[slot=left-icon],[variant=secondary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-multi-select,[disabled=true i].gov-form-multi-select,[disabled="1"].gov-form-multi-select{pointer-events:none}[disabled=""].gov-form-multi-select input,[disabled=""].gov-form-multi-select select,[disabled=""].gov-form-multi-select textarea,[disabled=true i].gov-form-multi-select input,[disabled=true i].gov-form-multi-select select,[disabled=true i].gov-form-multi-select textarea,[disabled="1"].gov-form-multi-select input,[disabled="1"].gov-form-multi-select select,[disabled="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-multi-select *[slot=left-icon],[disabled=""].gov-form-multi-select *[slot=right-icon],[disabled=true i].gov-form-multi-select *[slot=left-icon],[disabled=true i].gov-form-multi-select *[slot=right-icon],[disabled="1"].gov-form-multi-select *[slot=left-icon],[disabled="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600)) !important}[invalid=""].gov-form-multi-select input,[invalid=""].gov-form-multi-select select,[invalid=""].gov-form-multi-select textarea,[invalid=true i].gov-form-multi-select input,[invalid=true i].gov-form-multi-select select,[invalid=true i].gov-form-multi-select textarea,[invalid="1"].gov-form-multi-select input,[invalid="1"].gov-form-multi-select select,[invalid="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-multi-select input::-moz-placeholder,[invalid=""].gov-form-multi-select select::-moz-placeholder,[invalid=""].gov-form-multi-select textarea::-moz-placeholder,[invalid=true i].gov-form-multi-select input::-moz-placeholder,[invalid=true i].gov-form-multi-select select::-moz-placeholder,[invalid=true i].gov-form-multi-select textarea::-moz-placeholder,[invalid="1"].gov-form-multi-select input::-moz-placeholder,[invalid="1"].gov-form-multi-select select::-moz-placeholder,[invalid="1"].gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select input::placeholder,[invalid=""].gov-form-multi-select select::placeholder,[invalid=""].gov-form-multi-select textarea::placeholder,[invalid=true i].gov-form-multi-select input::placeholder,[invalid=true i].gov-form-multi-select select::placeholder,[invalid=true i].gov-form-multi-select textarea::placeholder,[invalid="1"].gov-form-multi-select input::placeholder,[invalid="1"].gov-form-multi-select select::placeholder,[invalid="1"].gov-form-multi-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select *[slot=left-icon],[invalid=""].gov-form-multi-select *[slot=right-icon],[invalid=true i].gov-form-multi-select *[slot=left-icon],[invalid=true i].gov-form-multi-select *[slot=right-icon],[invalid="1"].gov-form-multi-select *[slot=left-icon],[invalid="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error)) !important}[invalid=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[multiline=""].gov-form-multi-select *[slot=left-icon],[multiline=""].gov-form-multi-select *[slot=right-icon],[multiline=true i].gov-form-multi-select *[slot=left-icon],[multiline=true i].gov-form-multi-select *[slot=right-icon],[multiline="1"].gov-form-multi-select *[slot=left-icon],[multiline="1"].gov-form-multi-select *[slot=right-icon]{display:none}.gov-form-multi-select{background:none}.gov-form-multi-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-multi-select select::-ms-expand{display:none}[size=s].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-s-arrow-right-position, 0.75rem);width:var(--gov-form-select-s-arrow-size, 0.75rem);height:var(--gov-form-select-s-arrow-size, 0.75rem)}[size=s][invalid=""].gov-form-multi-select .icon-arrow,[size=s][invalid=true i].gov-form-multi-select .icon-arrow,[size=s][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=s][success=""].gov-form-multi-select .icon-arrow,[size=s][success=true i].gov-form-multi-select .icon-arrow,[size=s][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=m].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-m-arrow-right-position, 1rem);width:var(--gov-form-select-m-arrow-size, 0.75rem);height:var(--gov-form-select-m-arrow-size, 0.75rem)}[size=m][invalid=""].gov-form-multi-select .icon-arrow,[size=m][invalid=true i].gov-form-multi-select .icon-arrow,[size=m][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=m][success=""].gov-form-multi-select .icon-arrow,[size=m][success=true i].gov-form-multi-select .icon-arrow,[size=m][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=l].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-l-arrow-right-position, 1rem);width:var(--gov-form-select-l-arrow-size, 1rem);height:var(--gov-form-select-l-arrow-size, 1rem)}[size=l][invalid=""].gov-form-multi-select .icon-arrow,[size=l][invalid=true i].gov-form-multi-select .icon-arrow,[size=l][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=l][success=""].gov-form-multi-select .icon-arrow,[size=l][success=true i].gov-form-multi-select .icon-arrow,[size=l][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=xl].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-xl-arrow-right-position, 1.3125rem);width:var(--gov-form-select-xl-arrow-size, 1rem);height:var(--gov-form-select-xl-arrow-size, 1rem)}[size=xl][invalid=""].gov-form-multi-select .icon-arrow,[size=xl][invalid=true i].gov-form-multi-select .icon-arrow,[size=xl][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=xl][success=""].gov-form-multi-select .icon-arrow,[size=xl][success=true i].gov-form-multi-select .icon-arrow,[size=xl][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=s][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=m][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=l][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}.gov-form-multi-select{flex-wrap:wrap}.gov-form-multi-select__wrap{display:flex;align-items:center;gap:0.5rem;width:100%}.gov-form-multi-select__list{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:flex;gap:0.5rem;flex-wrap:wrap}.gov-form-multi-select__list>.gov-form-multi-select__item{position:relative;display:flex;flex:0 0 auto;align-items:center;padding:0rem 0rem 0rem 0.5rem;background:var(--gov-form-multiselect-bg, var(--gov-color-primary-200));transition:150ms linear background-color}';const D=j;const O=e(class e extends t{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govChange=i(this,"gov-change",7);this.govSelect=i(this,"gov-select",7);this.govRemove=i(this,"gov-remove",7);this.value=undefined;this.options=undefined;this.identifier=undefined;this.placeholder=undefined;this.variant=undefined;this.size="m";this.name=undefined;this.hideSelectedList=false;this.required=false;this.disabled=false;this.invalid=undefined;this.success=undefined;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.messageLoading="Načítám...";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.valueState=undefined;this.selectedOptionsState=[];this.optionsState=[];this.selectId=h("GovSelect");this.listId=h("GovMultiList");this.h=n(this.host);this.f=s(this.h)}validateVariant(e){u(c,e,l.root)}validateSize(e){u(a,e,l.root)}watchOptions(e){this.optionsState=b(e)}watchValue(e){this.selectedOptionsState=b(e)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",m(this.invalid));this.f.passAttrToControl("success",m(this.success))}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.watchDisabled();this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));this.optionsState=b(this.options);this.selectedOptionsState=b(this.value)}getAvailableOptions(e=false){if(Array.isArray(this.optionsState)&&this.optionsState.length){if(e){return this.optionsState}return this.optionsState.filter((e=>{const t=this.selectedValueIndex(e.value);return t!==-1||(e===null||e===void 0?void 0:e.disabled)?false:true})).map((e=>{var t;return{label:(t=e.label)!==null&&t!==void 0?t:e.value,value:e.value}}))}return Array.from(this.selectRef.querySelectorAll("option")).filter((t=>{if(e){return true}const i=this.selectedValueIndex(t.value);return!(t.disabled||t.selected||i>-1)})).map((e=>({label:e.textContent,value:e.value})))}initAutocomplete(){var e,t,i,o,r;(e=this.autocompleteRef)===null||e===void 0?void 0:e.addEventListener("gov-select",this.onSelectHandler.bind(this));(t=this.autocompleteRef)===null||t===void 0?void 0:t.addEventListener("gov-input",this.onInputHandler.bind(this));(i=this.autocompleteRef)===null||i===void 0?void 0:i.addEventListener("gov-focus",this.onFocusHandler.bind(this));(o=this.autocompleteRef)===null||o===void 0?void 0:o.addEventListener("gov-blur",this.onBlurHandler.bind(this));(r=this.autocompleteRef)===null||r===void 0?void 0:r.setSearchCallback((e=>new Promise((t=>{const i=this.getAvailableOptions();if(String(e).length===0){return t(i)}t(i.filter((({label:t,value:i})=>{if(!t)t=i;return p(t).toLowerCase().indexOf(p(e).toLowerCase())>-1})))})))).finally()}selectedValueIndex(e){return this.selectedOptionsState.findIndex((t=>t===e))}getOptionElement(e){return this.selectRef.querySelector('option[value="'+e+'"]')}getOption(e){var t;return(t=this.getAvailableOptions(true).find((t=>t.value===e)))!==null&&t!==void 0?t:null}selectOption(e,t=true){const i=this.selectedValueIndex(e);if(i===-1){this.selectedOptionsState=[...this.selectedOptionsState,e];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:l.root,value:this.selectedOptionsState});this.govSelect.emit({component:l.root,value:this.selectedOptionsState})}const i=this.getOptionElement(e);if(i){i.selected=true}}}removeOption(e,t=true){const i=this.selectedValueIndex(e);if(i!==-1){this.selectedOptionsState.splice(i,1);this.selectedOptionsState=[...this.selectedOptionsState];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:l.root,value:this.selectedOptionsState});this.govRemove.emit({component:l.root,value:this.selectedOptionsState})}const o=this.getOptionElement(e);if(o){o.selected=false}}}async componentDidLoad(){this.initAutocomplete()}async componentDidRender(){x((()=>{this.selectRef.querySelectorAll("option").forEach((e=>{if(e.selected){this.selectOption(e.value,false)}}))}));if(v()){await z(500);await this.validateWcag()}}render(){return o(r,{key:"bb5855ba2a4cd63ad2093ae2aebd67f3349cea28",class:l.root,size:this.size,variant:this.variant},o("div",{key:"3abae4b8ea9cc625a21dd45e1b9ee8befc49b8b6",class:l.wrap},this.h.hasSlot("prefix")&&o("slot",{key:"86da9e574fe68a4883b3df4da602e05f627e4714",name:"prefix"}),o("div",{key:"87d30a0d40739f4a4dbeaa9b5cef946ed9873c00",class:"element"},o("gov-form-autocomplete",{key:"ee44381d4eb97059d935135391951e7750afa648",value:this.valueState,disabled:this.disabled,identifier:this.identifier||this.selectId,required:false,size:this.size,variant:this.variant,placeholder:this.placeholder,"message-empty":this.messageEmpty,"message-loading":this.messageLoading,ref:e=>this.autocompleteRef=e,minlength:0,"name-key":"label",wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:this.listId}),o("gov-icon",{key:"83bdc379de06eab7db28d17cd39cd34128e60090",slot:"right-icon",class:"icon-arrow",name:"chevron-down"}),this.h.hasSlot("right-icon")&&!(this.success||this.invalid)&&o("slot",{key:"809ab0378b25182006e15effcb29babacb93274a",name:"right-icon"}),this.success&&o("gov-icon",{key:"85ef665e98040503ea14743e8497ceb7b48d3a9e",slot:"right-icon",class:"icon-validation",name:"check-lg"}),this.invalid&&o("gov-icon",{key:"88509ad301ad83c61957b0d1dd6e95586cf8d65a",slot:"right-icon",class:"icon-validation",name:"exclamation-lg"}),o("select",{key:"382f9855fe424f6427d158568339c51fc7ea46a5",hidden:true,class:"hidden-select-list","aria-hidden":m(true),multiple:true,required:this.required,name:this.name,disabled:this.disabled,ref:e=>this.selectRef=e,"aria-disabled":g(this.disabled),"aria-required":g(this.required),"aria-invalid":g(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns},o("slot",{key:"678201c2968bbb6d3e470ccc03d149b70fed50db"}))),this.h.hasSlot("sufix")&&o("slot",{key:"25a9c902b37c15988f4591a136006d9f3db0fa8d",name:"sufix"})),this.hideSelectedList===false?o("ul",{role:"listbox",id:this.listId,class:l.list},Array.isArray(this.selectedOptionsState)&&this.selectedOptionsState.map((e=>{var t,i;const r=this.getOption(e);if(!r)return null;return o("li",{class:l.item,role:"option"},(t=r.label)!==null&&t!==void 0?t:r.value,o("gov-button",{wcagLabel:(i="Odebrat vybranou položku "+r.label)!==null&&i!==void 0?i:r.value,variant:"primary",type:"base",size:"s","on-gov-click":()=>this.onTagRemove(e)},o("gov-icon",{name:"x-lg"})))}))):null)}onFocusHandler(e){e.stopPropagation();this.focused=true;this.govFocus.emit({component:l.root,originalEvent:e,value:this.selectedOptionsState})}onBlurHandler(e){e.stopPropagation();e.stopPropagation();this.focused=false;this.govBlur.emit({component:l.root,originalEvent:e,value:this.selectedOptionsState})}onInputHandler(e){this.valueState=e.detail.value;e.stopPropagation()}onSelectHandler(e){e.stopPropagation();const t=e.detail.selected;this.selectOption(t.value);this.valueState="";this.autocompleteRef.clearValue().finally();this.autocompleteRef.focus()}onTagRemove(e){this.removeOption(e)}async setFocus(e){return this.selectRef.focus(e)}async setValue(e){this.valueState=e}async getRef(){return this.selectRef}async validateWcag(){f(this.wcagDescribedBy,"wcag-described-by",l.root);f(this.wcagLabelledBy,"wcag-labelled-by",l.root);f(this.wcagOwns,"wcag-owns",l.root);d(this.identifier||this.selectId,this.wcagLabelledBy,l.root)}get host(){return this}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchDisabled"],options:["watchOptions"],value:["watchValue"],disabled:["watchDisabled"],invalid:["watchDisabled"],success:["watchDisabled"]}}static get style(){return D}},[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]},undefined,{variant:["validateVariant"],size:["validateSize","watchDisabled"],options:["watchOptions"],value:["watchValue"],disabled:["watchDisabled"],invalid:["watchDisabled"],success:["watchDisabled"]}]);function E(){if(typeof customElements==="undefined"){return}const e=["gov-form-multi-select","gov-button","gov-form-autocomplete","gov-form-input","gov-icon"];e.forEach((e=>{switch(e){case"gov-form-multi-select":if(!customElements.get(e)){customElements.define(e,O)}break;case"gov-button":if(!customElements.get(e)){w()}break;case"gov-form-autocomplete":if(!customElements.get(e)){y()}break;case"gov-form-input":if(!customElements.get(e)){k()}break;case"gov-icon":if(!customElements.get(e)){_()}break}}))}E();const S=O;const V=E;export{S as GovFormMultiSelect,V as defineCustomElement};
|
|
1
|
+
import{p as e,H as t,c as i,h as o,d as r}from"./p-d6759ac3.js";import{g as s,j as l,k as c,l as a}from"./p-77a6e3be.js";import{g as n,a as m,t as g}from"./p-d687df8f.js";import{c as v}from"./p-e618f1cb.js";import{v as u}from"./p-344c72d7.js";import{b as f,c as d}from"./p-6b0471a8.js";import{c as h,r as p}from"./p-95d41a3b.js";import{d as z}from"./p-e0e2e9c1.js";import{p as b}from"./p-3f704a40.js";import{t as x}from"./p-240c302e.js";import{d as w}from"./p-44c731a0.js";import{d as y}from"./p-483d079f.js";import{d as k}from"./p-8ac22724.js";import{d as _}from"./p-fd554fb4.js";const j='.gov-form-multi-select__list{margin:0;padding:0}.gov-form-multi-select__list>.gov-form-multi-select__item{margin:0;padding:0;background:none}.gov-form-multi-select__list>.gov-form-multi-select__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-multi-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-multi-select .element{position:relative;display:flex;flex:1 1 auto}.gov-form-multi-select input,.gov-form-multi-select select,.gov-form-multi-select textarea{width:100%;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));font-family:var(--gov-font-family, "Roboto", sans-serif)}.gov-form-multi-select input:focus,.gov-form-multi-select select:focus,.gov-form-multi-select textarea:focus{outline:none}.gov-form-multi-select input:focus-visible,.gov-form-multi-select select:focus-visible,.gov-form-multi-select textarea:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-form-multi-select input::-moz-placeholder,.gov-form-multi-select select::-moz-placeholder,.gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select input::placeholder,.gov-form-multi-select select::placeholder,.gov-form-multi-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select textarea{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);padding:0.5rem 0.75rem;resize:none}.gov-form-multi-select *[slot=left-icon],.gov-form-multi-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-multi-select *[slot=left-icon]{left:0}.gov-form-multi-select *[slot=right-icon]{right:0}.gov-form-multi-select *[slot=prefix],.gov-form-multi-select *[slot=sufix]{margin:0}[size=s].gov-form-multi-select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);gap:0.5rem var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select input,[size=s].gov-form-multi-select select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);height:var(--gov-form-input-core-s-height, 2rem);padding:var(--gov-form-input-core-s-padding, 0.25rem 0.75rem)}[size=s].gov-form-multi-select *[slot=left-icon],[size=s].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-s-icon-size, 1rem);height:var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=right-icon]~input,[size=s].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select input,[size=m].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-multi-select *[slot=left-icon],[size=m].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=right-icon]~input,[size=m].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select input,[size=l].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-multi-select *[slot=left-icon],[size=l].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=right-icon]~input,[size=l].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-multi-select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select input,[size=xl].gov-form-multi-select select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-multi-select *[slot=left-icon],[size=xl].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=right-icon]~input,[size=xl].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-multi-select input,[variant=primary].gov-form-multi-select select,[variant=primary].gov-form-multi-select textarea{color:var(--gov-form-input-color-primary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}[variant=primary].gov-form-multi-select *[slot=left-icon],[variant=primary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-multi-select input,[variant=secondary].gov-form-multi-select select,[variant=secondary].gov-form-multi-select textarea{color:var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}[variant=secondary].gov-form-multi-select *[slot=left-icon],[variant=secondary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-multi-select,[disabled=true i].gov-form-multi-select,[disabled="1"].gov-form-multi-select{pointer-events:none}[disabled=""].gov-form-multi-select input,[disabled=""].gov-form-multi-select select,[disabled=""].gov-form-multi-select textarea,[disabled=true i].gov-form-multi-select input,[disabled=true i].gov-form-multi-select select,[disabled=true i].gov-form-multi-select textarea,[disabled="1"].gov-form-multi-select input,[disabled="1"].gov-form-multi-select select,[disabled="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-multi-select *[slot=left-icon],[disabled=""].gov-form-multi-select *[slot=right-icon],[disabled=true i].gov-form-multi-select *[slot=left-icon],[disabled=true i].gov-form-multi-select *[slot=right-icon],[disabled="1"].gov-form-multi-select *[slot=left-icon],[disabled="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600)) !important}[invalid=""].gov-form-multi-select input,[invalid=""].gov-form-multi-select select,[invalid=""].gov-form-multi-select textarea,[invalid=true i].gov-form-multi-select input,[invalid=true i].gov-form-multi-select select,[invalid=true i].gov-form-multi-select textarea,[invalid="1"].gov-form-multi-select input,[invalid="1"].gov-form-multi-select select,[invalid="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-multi-select input::-moz-placeholder,[invalid=""].gov-form-multi-select select::-moz-placeholder,[invalid=""].gov-form-multi-select textarea::-moz-placeholder,[invalid=true i].gov-form-multi-select input::-moz-placeholder,[invalid=true i].gov-form-multi-select select::-moz-placeholder,[invalid=true i].gov-form-multi-select textarea::-moz-placeholder,[invalid="1"].gov-form-multi-select input::-moz-placeholder,[invalid="1"].gov-form-multi-select select::-moz-placeholder,[invalid="1"].gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select input::placeholder,[invalid=""].gov-form-multi-select select::placeholder,[invalid=""].gov-form-multi-select textarea::placeholder,[invalid=true i].gov-form-multi-select input::placeholder,[invalid=true i].gov-form-multi-select select::placeholder,[invalid=true i].gov-form-multi-select textarea::placeholder,[invalid="1"].gov-form-multi-select input::placeholder,[invalid="1"].gov-form-multi-select select::placeholder,[invalid="1"].gov-form-multi-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select *[slot=left-icon],[invalid=""].gov-form-multi-select *[slot=right-icon],[invalid=true i].gov-form-multi-select *[slot=left-icon],[invalid=true i].gov-form-multi-select *[slot=right-icon],[invalid="1"].gov-form-multi-select *[slot=left-icon],[invalid="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error)) !important}[invalid=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[multiline=""].gov-form-multi-select *[slot=left-icon],[multiline=""].gov-form-multi-select *[slot=right-icon],[multiline=true i].gov-form-multi-select *[slot=left-icon],[multiline=true i].gov-form-multi-select *[slot=right-icon],[multiline="1"].gov-form-multi-select *[slot=left-icon],[multiline="1"].gov-form-multi-select *[slot=right-icon]{display:none}.gov-form-multi-select{background:none}.gov-form-multi-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-multi-select select::-ms-expand{display:none}[size=s].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-s-arrow-right-position, 0.75rem);width:var(--gov-form-select-s-arrow-size, 0.75rem);height:var(--gov-form-select-s-arrow-size, 0.75rem)}[size=s][invalid=""].gov-form-multi-select .icon-arrow,[size=s][invalid=true i].gov-form-multi-select .icon-arrow,[size=s][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=s][success=""].gov-form-multi-select .icon-arrow,[size=s][success=true i].gov-form-multi-select .icon-arrow,[size=s][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=m].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-m-arrow-right-position, 1rem);width:var(--gov-form-select-m-arrow-size, 0.75rem);height:var(--gov-form-select-m-arrow-size, 0.75rem)}[size=m][invalid=""].gov-form-multi-select .icon-arrow,[size=m][invalid=true i].gov-form-multi-select .icon-arrow,[size=m][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=m][success=""].gov-form-multi-select .icon-arrow,[size=m][success=true i].gov-form-multi-select .icon-arrow,[size=m][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=l].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-l-arrow-right-position, 1rem);width:var(--gov-form-select-l-arrow-size, 1rem);height:var(--gov-form-select-l-arrow-size, 1rem)}[size=l][invalid=""].gov-form-multi-select .icon-arrow,[size=l][invalid=true i].gov-form-multi-select .icon-arrow,[size=l][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=l][success=""].gov-form-multi-select .icon-arrow,[size=l][success=true i].gov-form-multi-select .icon-arrow,[size=l][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=xl].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-xl-arrow-right-position, 1.3125rem);width:var(--gov-form-select-xl-arrow-size, 1rem);height:var(--gov-form-select-xl-arrow-size, 1rem)}[size=xl][invalid=""].gov-form-multi-select .icon-arrow,[size=xl][invalid=true i].gov-form-multi-select .icon-arrow,[size=xl][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=xl][success=""].gov-form-multi-select .icon-arrow,[size=xl][success=true i].gov-form-multi-select .icon-arrow,[size=xl][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=s][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=m][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=l][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}.gov-form-multi-select{flex-wrap:wrap}.gov-form-multi-select__wrap{display:flex;align-items:center;gap:0.5rem;width:100%}.gov-form-multi-select__list{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:flex;gap:0.5rem;flex-wrap:wrap}.gov-form-multi-select__list>.gov-form-multi-select__item{position:relative;display:flex;flex:0 0 auto;align-items:center;padding:0rem 0rem 0rem 0.5rem;background:var(--gov-form-multiselect-bg, var(--gov-color-primary-200));transition:150ms linear background-color}';const D=j;const O=e(class e extends t{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govChange=i(this,"gov-change",7);this.govSelect=i(this,"gov-select",7);this.govRemove=i(this,"gov-remove",7);this.value=undefined;this.options=undefined;this.identifier=undefined;this.placeholder=undefined;this.variant=undefined;this.size="m";this.name=undefined;this.hideSelectedList=false;this.required=false;this.disabled=false;this.invalid=undefined;this.success=undefined;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.messageLoading="Načítám...";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.valueState=undefined;this.selectedOptionsState=[];this.optionsState=[];this.selectId=h("GovSelect");this.listId=h("GovMultiList");this.h=n(this.host);this.f=s(this.h)}validateVariant(e){u(c,e,l.root)}validateSize(e){u(a,e,l.root)}watchOptions(e){this.optionsState=b(e)}watchValue(e){this.selectedOptionsState=b(e)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",m(this.invalid));this.f.passAttrToControl("success",m(this.success))}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.watchDisabled();this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));this.optionsState=b(this.options);this.selectedOptionsState=b(this.value)}getAvailableOptions(e=false){if(Array.isArray(this.optionsState)&&this.optionsState.length){if(e){return this.optionsState}return this.optionsState.filter((e=>{const t=this.selectedValueIndex(e.value);return t!==-1||(e===null||e===void 0?void 0:e.disabled)?false:true})).map((e=>{var t;return{label:(t=e.label)!==null&&t!==void 0?t:e.value,value:e.value}}))}return Array.from(this.selectRef.querySelectorAll("option")).filter((t=>{if(e){return true}const i=this.selectedValueIndex(t.value);return!(t.disabled||t.selected||i>-1)})).map((e=>({label:e.textContent,value:e.value})))}initAutocomplete(){var e,t,i,o,r;(e=this.autocompleteRef)===null||e===void 0?void 0:e.addEventListener("gov-select",this.onSelectHandler.bind(this));(t=this.autocompleteRef)===null||t===void 0?void 0:t.addEventListener("gov-input",this.onInputHandler.bind(this));(i=this.autocompleteRef)===null||i===void 0?void 0:i.addEventListener("gov-focus",this.onFocusHandler.bind(this));(o=this.autocompleteRef)===null||o===void 0?void 0:o.addEventListener("gov-blur",this.onBlurHandler.bind(this));(r=this.autocompleteRef)===null||r===void 0?void 0:r.setSearchCallback((e=>new Promise((t=>{const i=this.getAvailableOptions();if(String(e).length===0){return t(i)}t(i.filter((({label:t,value:i})=>{if(!t)t=i;return p(t).toLowerCase().indexOf(p(e).toLowerCase())>-1})))})))).finally()}selectedValueIndex(e){return this.selectedOptionsState.findIndex((t=>t===e))}getOptionElement(e){return this.selectRef.querySelector('option[value="'+e+'"]')}getOption(e){var t;return(t=this.getAvailableOptions(true).find((t=>t.value===e)))!==null&&t!==void 0?t:null}selectOption(e,t=true){const i=this.selectedValueIndex(e);if(i===-1){this.selectedOptionsState=[...this.selectedOptionsState,e];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:l.root,value:this.selectedOptionsState});this.govSelect.emit({component:l.root,value:this.selectedOptionsState})}const i=this.getOptionElement(e);if(i){i.selected=true}}}removeOption(e,t=true){const i=this.selectedValueIndex(e);if(i!==-1){this.selectedOptionsState.splice(i,1);this.selectedOptionsState=[...this.selectedOptionsState];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:l.root,value:this.selectedOptionsState});this.govRemove.emit({component:l.root,value:this.selectedOptionsState})}const o=this.getOptionElement(e);if(o){o.selected=false}}}async componentDidLoad(){this.initAutocomplete()}async componentDidRender(){x((()=>{this.selectRef.querySelectorAll("option").forEach((e=>{if(e.selected){this.selectOption(e.value,false)}}))}));if(v()){await z(500);await this.validateWcag()}}render(){return o(r,{key:"bb5855ba2a4cd63ad2093ae2aebd67f3349cea28",class:l.root,size:this.size,variant:this.variant},o("div",{key:"3abae4b8ea9cc625a21dd45e1b9ee8befc49b8b6",class:l.wrap},this.h.hasSlot("prefix")&&o("slot",{key:"86da9e574fe68a4883b3df4da602e05f627e4714",name:"prefix"}),o("div",{key:"87d30a0d40739f4a4dbeaa9b5cef946ed9873c00",class:"element"},o("gov-form-autocomplete",{key:"ee44381d4eb97059d935135391951e7750afa648",value:this.valueState,disabled:this.disabled,identifier:this.identifier||this.selectId,required:false,size:this.size,variant:this.variant,placeholder:this.placeholder,"message-empty":this.messageEmpty,"message-loading":this.messageLoading,ref:e=>this.autocompleteRef=e,minlength:0,"name-key":"label",wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:this.listId}),o("gov-icon",{key:"83bdc379de06eab7db28d17cd39cd34128e60090",slot:"right-icon",class:"icon-arrow",name:"chevron-down"}),this.h.hasSlot("right-icon")&&!(this.success||this.invalid)&&o("slot",{key:"809ab0378b25182006e15effcb29babacb93274a",name:"right-icon"}),this.success&&o("gov-icon",{key:"85ef665e98040503ea14743e8497ceb7b48d3a9e",slot:"right-icon",class:"icon-validation",name:"check-lg"}),this.invalid&&o("gov-icon",{key:"88509ad301ad83c61957b0d1dd6e95586cf8d65a",slot:"right-icon",class:"icon-validation",name:"exclamation-lg"}),o("select",{key:"382f9855fe424f6427d158568339c51fc7ea46a5",hidden:true,class:"hidden-select-list","aria-hidden":m(true),multiple:true,required:this.required,name:this.name,disabled:this.disabled,ref:e=>this.selectRef=e,"aria-disabled":g(this.disabled),"aria-required":g(this.required),"aria-invalid":g(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns},o("slot",{key:"678201c2968bbb6d3e470ccc03d149b70fed50db"}))),this.h.hasSlot("sufix")&&o("slot",{key:"25a9c902b37c15988f4591a136006d9f3db0fa8d",name:"sufix"})),this.hideSelectedList===false?o("ul",{role:"listbox",id:this.listId,class:l.list},Array.isArray(this.selectedOptionsState)&&this.selectedOptionsState.map((e=>{var t,i;const r=this.getOption(e);if(!r)return null;return o("li",{class:l.item,role:"option"},(t=r.label)!==null&&t!==void 0?t:r.value,o("gov-button",{wcagLabel:(i="Odebrat vybranou položku "+r.label)!==null&&i!==void 0?i:r.value,variant:"primary",type:"base",size:"s","on-gov-click":()=>this.onTagRemove(e)},o("gov-icon",{name:"x-lg"})))}))):null)}onFocusHandler(e){e.stopPropagation();this.focused=true;this.govFocus.emit({component:l.root,originalEvent:e,value:this.selectedOptionsState})}onBlurHandler(e){e.stopPropagation();e.stopPropagation();this.focused=false;this.govBlur.emit({component:l.root,originalEvent:e,value:this.selectedOptionsState})}onInputHandler(e){this.valueState=e.detail.value;e.stopPropagation()}onSelectHandler(e){e.stopPropagation();const t=e.detail.selected;this.selectOption(t.value);this.valueState="";this.autocompleteRef.clearValue().finally();this.autocompleteRef.focus()}onTagRemove(e){this.removeOption(e)}async setFocus(e){return this.selectRef.focus(e)}async setValue(e){this.valueState=e}async getRef(){return this.selectRef}async validateWcag(){f(this.wcagDescribedBy,"wcag-described-by",l.root);f(this.wcagLabelledBy,"wcag-labelled-by",l.root);f(this.wcagOwns,"wcag-owns",l.root);d(this.identifier||this.selectId,this.wcagLabelledBy,l.root)}get host(){return this}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchDisabled"],options:["watchOptions"],value:["watchValue"],disabled:["watchDisabled"],invalid:["watchDisabled"],success:["watchDisabled"]}}static get style(){return D}},[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]},undefined,{variant:["validateVariant"],size:["validateSize","watchDisabled"],options:["watchOptions"],value:["watchValue"],disabled:["watchDisabled"],invalid:["watchDisabled"],success:["watchDisabled"]}]);function E(){if(typeof customElements==="undefined"){return}const e=["gov-form-multi-select","gov-button","gov-form-autocomplete","gov-form-input","gov-icon"];e.forEach((e=>{switch(e){case"gov-form-multi-select":if(!customElements.get(e)){customElements.define(e,O)}break;case"gov-button":if(!customElements.get(e)){w()}break;case"gov-form-autocomplete":if(!customElements.get(e)){y()}break;case"gov-form-input":if(!customElements.get(e)){k()}break;case"gov-icon":if(!customElements.get(e)){_()}break}}))}E();const S=O;const V=E;export{S as GovFormMultiSelect,V as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-multi-select.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-3248435d.js";const t=o;const p=s;export{t as GovFormSelect,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-select.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-fd554fb4.js";const t=o;const f=s;export{t as GovIcon,f as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-icon.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as r,c as a,h as n,d as i}from"./p-d6759ac3.js";import{g as e,a as v}from"./p-d687df8f.js";import{c as t}from"./p-e618f1cb.js";import{F as c}from"./p-1c1d0bbe.js";import{v as s}from"./p-344c72d7.js";import{a as g}from"./p-6b0471a8.js";import{p as b,d as f}from"./p-e0e2e9c1.js";import{V as l}from"./p-03dbb8b1.js";import{d}from"./p-68d5f793.js";import{d as _}from"./p-95ac62b9.js";const m=b(l,["PRIMARY","SECONDARY","WARNING","ERROR","SUCCESS"]);const u={root:"gov-infobar",section:"gov-infobar__section",icon:"gov-infobar__icon",content:"gov-infobar__content",closable:"gov-infobar__content--closable",headline:"gov-infobar__headline",close:"gov-infobar__close"};const h='.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-infobar{position:relative;display:block;width:100%}.gov-infobar__section{display:flex;gap:1rem;padding:1rem}.gov-infobar__icon{flex:0 0 auto}.gov-infobar__icon>*{width:1.25rem;height:1.25rem}.gov-infobar__headline{display:flex;gap:1rem}.gov-infobar__headline+div{margin-top:0.5rem}.gov-infobar__headline p{margin-bottom:0}.gov-infobar__headline gov-button{margin-top:-0.25rem}.gov-infobar__content{width:100%}.gov-infobar__content>*:last-child{margin-bottom:0}.gov-infobar__content--closable{padding-right:3.5rem}.gov-infobar__content p{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-infobar__content a{color:inherit}@media not all and (pointer: coarse){.gov-infobar__content a:hover{color:inherit}}.gov-infobar__content a .gov-icon{color:inherit}.gov-infobar__close{position:absolute;top:0.875rem;right:1rem}.gov-infobar[variant=warning]{background-color:var(--gov-infobar-warning-bg-color, var(--gov-color-warning))}.gov-infobar[variant=warning] .gov-infobar__icon{color:var(--gov-infobar-warning-icon-color, var(--gov-color-secondary))}.gov-infobar[variant=warning] .gov-infobar__content{color:var(--gov-infobar-warning-text-color, var(--gov-color-secondary))}.gov-infobar[variant=warning][inverse=""],.gov-infobar[variant=warning][inverse=true i],.gov-infobar[variant=warning][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=warning][inverse=""] .gov-infobar__icon,.gov-infobar[variant=warning][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=warning][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-warning-bg-color, var(--gov-color-warning))}.gov-infobar[variant=warning][inverse=""] .gov-infobar__content,.gov-infobar[variant=warning][inverse=true i] .gov-infobar__content,.gov-infobar[variant=warning][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=error]{background-color:var(--gov-infobar-error-bg-color, var(--gov-color-error))}.gov-infobar[variant=error] .gov-infobar__icon{color:var(--gov-infobar-error-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=error] .gov-infobar__content{color:var(--gov-infobar-error-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=error][inverse=""],.gov-infobar[variant=error][inverse=true i],.gov-infobar[variant=error][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=error][inverse=""] .gov-infobar__icon,.gov-infobar[variant=error][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=error][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-error-bg-color, var(--gov-color-error))}.gov-infobar[variant=error][inverse=""] .gov-infobar__content,.gov-infobar[variant=error][inverse=true i] .gov-infobar__content,.gov-infobar[variant=error][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=secondary]{background-color:var(--gov-infobar-secondary-bg-color, var(--gov-color-secondary))}.gov-infobar[variant=secondary] .gov-infobar__icon{color:var(--gov-infobar-secondary-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary] .gov-infobar__content{color:var(--gov-infobar-secondary-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary][inverse=""],.gov-infobar[variant=secondary][inverse=true i],.gov-infobar[variant=secondary][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary][inverse=""] .gov-infobar__icon,.gov-infobar[variant=secondary][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=secondary][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-secondary-bg-color, var(--gov-color-secondary))}.gov-infobar[variant=secondary][inverse=""] .gov-infobar__content,.gov-infobar[variant=secondary][inverse=true i] .gov-infobar__content,.gov-infobar[variant=secondary][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=success]{background-color:var(--gov-infobar-success-bg-color, var(--gov-color-success-500))}.gov-infobar[variant=success] .gov-infobar__icon{color:var(--gov-infobar-success-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=success] .gov-infobar__content{color:var(--gov-infobar-success-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=success][inverse=""],.gov-infobar[variant=success][inverse=true i],.gov-infobar[variant=success][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=success][inverse=""] .gov-infobar__icon,.gov-infobar[variant=success][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=success][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-success-bg-color, var(--gov-color-success-500))}.gov-infobar[variant=success][inverse=""] .gov-infobar__content,.gov-infobar[variant=success][inverse=true i] .gov-infobar__content,.gov-infobar[variant=success][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=primary]{background-color:var(--gov-infobar-primary-bg-color, var(--gov-color-primary))}.gov-infobar[variant=primary] .gov-infobar__icon{color:var(--gov-infobar-primary-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=primary] .gov-infobar__content{color:var(--gov-infobar-primary-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=primary][inverse=""],.gov-infobar[variant=primary][inverse=true i],.gov-infobar[variant=primary][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=primary][inverse=""] .gov-infobar__icon,.gov-infobar[variant=primary][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=primary][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-primary-bg-color, var(--gov-color-primary))}.gov-infobar[variant=primary][inverse=""] .gov-infobar__content,.gov-infobar[variant=primary][inverse=true i] .gov-infobar__content,.gov-infobar[variant=primary][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}';const p=h;const y=o(class o extends r{constructor(){super();this.__registerHost();this.govClose=a(this,"gov-close",7);this.headline=undefined;this.variant="primary";this.role=undefined;this.inverse=false;this.wcagCloseLabel="Zavřít informační lištu";this.wcagToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.h=e(this.host)}validateVariant(o){s(m,o,u.root)}componentWillLoad(){this.validateVariant(this.variant)}async componentDidRender(){if(t()){await f(500);await this.validateWcag()}}render(){let o=!this.inverse;let r=this.inverse?"secondary":this.variant;if(this.variant=="warning"){o=false;r="secondary"}const a=n("div",{key:"77b4d53e93469ca4325f5af65c8fc90efa44e821",class:u.close},n("gov-button",{key:"5e8fc17fb25637229c1d5c122edb032ac9eade08",size:"s",wcagLabel:this.wcagCloseLabel,type:"base",variant:r,inverse:o,"on-gov-click":this.onCloseHandler.bind(this)},n("gov-icon",{key:"45a33018478d0ef04211313a10857a7d2ad6e66a",name:"x-lg"})));return n(i,{key:"bbcca556a269756e86610ac5730d780afc10dd1f",class:this.h.classes(u.root),variant:this.variant},n("section",{key:"03af203186f5dabafa3871a27ecef1064dc62138",class:u.section,role:this.role},this.h.hasSlot("icon")&&n("div",{key:"2aa3131f8489eb94a3cf18c58af98c25ea6c6295",class:u.icon},n("slot",{key:"4c81fa3be4aff480578222c3e65f84e51117b221",name:"icon"})),n("div",{key:"190f4f6b6d5b6962551e310a081f765b572b24e9",class:u.content+(this.closable?" "+u.closable:"")},this.headline?n(c,null,n("div",{class:u.headline},n("p",null,this.headline),n("gov-button",{size:"s",wcagLabel:this.wcagToggleLabel,type:"base",variant:r,inverse:o,"on-gov-click":()=>this.toggleContent=!this.toggleContent},n("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down"}))),n("div",{hidden:!this.toggleContent,"aria-hidden":v(this.toggleContent)},n("slot",null))):n("slot",null))),this.closable&&a)}onCloseHandler(o){this.govClose.emit({component:u.root,ref:this.host,originalEvent:o})}async validateWcag(){if(this.closable){g(this.wcagCloseLabel,"wcag-close-label",u.root)}if(this.headline){g(this.wcagToggleLabel,"wcag-toggle-label",u.root)}}get host(){return this}static get watchers(){return{variant:["validateVariant"]}}static get style(){return p}},[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]},undefined,{variant:["validateVariant"]}]);function w(){if(typeof customElements==="undefined"){return}const o=["gov-infobar","gov-button","gov-icon"];o.forEach((o=>{switch(o){case"gov-infobar":if(!customElements.get(o)){customElements.define(o,y)}break;case"gov-button":if(!customElements.get(o)){d()}break;case"gov-icon":if(!customElements.get(o)){_()}break}}))}w();const k=y;const x=w;export{k as GovInfobar,x as defineCustomElement};
|
|
1
|
+
import{p as o,H as r,c as a,h as n,d as i}from"./p-d6759ac3.js";import{g as e,a as v}from"./p-d687df8f.js";import{c as t}from"./p-e618f1cb.js";import{F as c}from"./p-1c1d0bbe.js";import{v as s}from"./p-344c72d7.js";import{a as g}from"./p-6b0471a8.js";import{p as b,d as f}from"./p-e0e2e9c1.js";import{V as l}from"./p-03dbb8b1.js";import{d}from"./p-44c731a0.js";import{d as _}from"./p-fd554fb4.js";const m=b(l,["PRIMARY","SECONDARY","WARNING","ERROR","SUCCESS"]);const u={root:"gov-infobar",section:"gov-infobar__section",icon:"gov-infobar__icon",content:"gov-infobar__content",closable:"gov-infobar__content--closable",headline:"gov-infobar__headline",close:"gov-infobar__close"};const h='.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-infobar{position:relative;display:block;width:100%}.gov-infobar__section{display:flex;gap:1rem;padding:1rem}.gov-infobar__icon{flex:0 0 auto}.gov-infobar__icon>*{width:1.25rem;height:1.25rem}.gov-infobar__headline{display:flex;gap:1rem}.gov-infobar__headline+div{margin-top:0.5rem}.gov-infobar__headline p{margin-bottom:0}.gov-infobar__headline gov-button{margin-top:-0.25rem}.gov-infobar__content{width:100%}.gov-infobar__content>*:last-child{margin-bottom:0}.gov-infobar__content--closable{padding-right:3.5rem}.gov-infobar__content p{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-infobar__content a{color:inherit}@media not all and (pointer: coarse){.gov-infobar__content a:hover{color:inherit}}.gov-infobar__content a .gov-icon{color:inherit}.gov-infobar__close{position:absolute;top:0.875rem;right:1rem}.gov-infobar[variant=warning]{background-color:var(--gov-infobar-warning-bg-color, var(--gov-color-warning))}.gov-infobar[variant=warning] .gov-infobar__icon{color:var(--gov-infobar-warning-icon-color, var(--gov-color-secondary))}.gov-infobar[variant=warning] .gov-infobar__content{color:var(--gov-infobar-warning-text-color, var(--gov-color-secondary))}.gov-infobar[variant=warning][inverse=""],.gov-infobar[variant=warning][inverse=true i],.gov-infobar[variant=warning][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=warning][inverse=""] .gov-infobar__icon,.gov-infobar[variant=warning][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=warning][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-warning-bg-color, var(--gov-color-warning))}.gov-infobar[variant=warning][inverse=""] .gov-infobar__content,.gov-infobar[variant=warning][inverse=true i] .gov-infobar__content,.gov-infobar[variant=warning][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=error]{background-color:var(--gov-infobar-error-bg-color, var(--gov-color-error))}.gov-infobar[variant=error] .gov-infobar__icon{color:var(--gov-infobar-error-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=error] .gov-infobar__content{color:var(--gov-infobar-error-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=error][inverse=""],.gov-infobar[variant=error][inverse=true i],.gov-infobar[variant=error][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=error][inverse=""] .gov-infobar__icon,.gov-infobar[variant=error][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=error][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-error-bg-color, var(--gov-color-error))}.gov-infobar[variant=error][inverse=""] .gov-infobar__content,.gov-infobar[variant=error][inverse=true i] .gov-infobar__content,.gov-infobar[variant=error][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=secondary]{background-color:var(--gov-infobar-secondary-bg-color, var(--gov-color-secondary))}.gov-infobar[variant=secondary] .gov-infobar__icon{color:var(--gov-infobar-secondary-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary] .gov-infobar__content{color:var(--gov-infobar-secondary-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary][inverse=""],.gov-infobar[variant=secondary][inverse=true i],.gov-infobar[variant=secondary][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary][inverse=""] .gov-infobar__icon,.gov-infobar[variant=secondary][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=secondary][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-secondary-bg-color, var(--gov-color-secondary))}.gov-infobar[variant=secondary][inverse=""] .gov-infobar__content,.gov-infobar[variant=secondary][inverse=true i] .gov-infobar__content,.gov-infobar[variant=secondary][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=success]{background-color:var(--gov-infobar-success-bg-color, var(--gov-color-success-500))}.gov-infobar[variant=success] .gov-infobar__icon{color:var(--gov-infobar-success-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=success] .gov-infobar__content{color:var(--gov-infobar-success-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=success][inverse=""],.gov-infobar[variant=success][inverse=true i],.gov-infobar[variant=success][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=success][inverse=""] .gov-infobar__icon,.gov-infobar[variant=success][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=success][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-success-bg-color, var(--gov-color-success-500))}.gov-infobar[variant=success][inverse=""] .gov-infobar__content,.gov-infobar[variant=success][inverse=true i] .gov-infobar__content,.gov-infobar[variant=success][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=primary]{background-color:var(--gov-infobar-primary-bg-color, var(--gov-color-primary))}.gov-infobar[variant=primary] .gov-infobar__icon{color:var(--gov-infobar-primary-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=primary] .gov-infobar__content{color:var(--gov-infobar-primary-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=primary][inverse=""],.gov-infobar[variant=primary][inverse=true i],.gov-infobar[variant=primary][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=primary][inverse=""] .gov-infobar__icon,.gov-infobar[variant=primary][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=primary][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-primary-bg-color, var(--gov-color-primary))}.gov-infobar[variant=primary][inverse=""] .gov-infobar__content,.gov-infobar[variant=primary][inverse=true i] .gov-infobar__content,.gov-infobar[variant=primary][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}';const p=h;const y=o(class o extends r{constructor(){super();this.__registerHost();this.govClose=a(this,"gov-close",7);this.headline=undefined;this.variant="primary";this.role=undefined;this.inverse=false;this.wcagCloseLabel="Zavřít informační lištu";this.wcagToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.h=e(this.host)}validateVariant(o){s(m,o,u.root)}componentWillLoad(){this.validateVariant(this.variant)}async componentDidRender(){if(t()){await f(500);await this.validateWcag()}}render(){let o=!this.inverse;let r=this.inverse?"secondary":this.variant;if(this.variant=="warning"){o=false;r="secondary"}const a=n("div",{key:"77b4d53e93469ca4325f5af65c8fc90efa44e821",class:u.close},n("gov-button",{key:"5e8fc17fb25637229c1d5c122edb032ac9eade08",size:"s",wcagLabel:this.wcagCloseLabel,type:"base",variant:r,inverse:o,"on-gov-click":this.onCloseHandler.bind(this)},n("gov-icon",{key:"45a33018478d0ef04211313a10857a7d2ad6e66a",name:"x-lg"})));return n(i,{key:"bbcca556a269756e86610ac5730d780afc10dd1f",class:this.h.classes(u.root),variant:this.variant},n("section",{key:"03af203186f5dabafa3871a27ecef1064dc62138",class:u.section,role:this.role},this.h.hasSlot("icon")&&n("div",{key:"2aa3131f8489eb94a3cf18c58af98c25ea6c6295",class:u.icon},n("slot",{key:"4c81fa3be4aff480578222c3e65f84e51117b221",name:"icon"})),n("div",{key:"190f4f6b6d5b6962551e310a081f765b572b24e9",class:u.content+(this.closable?" "+u.closable:"")},this.headline?n(c,null,n("div",{class:u.headline},n("p",null,this.headline),n("gov-button",{size:"s",wcagLabel:this.wcagToggleLabel,type:"base",variant:r,inverse:o,"on-gov-click":()=>this.toggleContent=!this.toggleContent},n("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down"}))),n("div",{hidden:!this.toggleContent,"aria-hidden":v(this.toggleContent)},n("slot",null))):n("slot",null))),this.closable&&a)}onCloseHandler(o){this.govClose.emit({component:u.root,ref:this.host,originalEvent:o})}async validateWcag(){if(this.closable){g(this.wcagCloseLabel,"wcag-close-label",u.root)}if(this.headline){g(this.wcagToggleLabel,"wcag-toggle-label",u.root)}}get host(){return this}static get watchers(){return{variant:["validateVariant"]}}static get style(){return p}},[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]},undefined,{variant:["validateVariant"]}]);function w(){if(typeof customElements==="undefined"){return}const o=["gov-infobar","gov-button","gov-icon"];o.forEach((o=>{switch(o){case"gov-infobar":if(!customElements.get(o)){customElements.define(o,y)}break;case"gov-button":if(!customElements.get(o)){d()}break;case"gov-icon":if(!customElements.get(o)){_()}break}}))}w();const k=y;const x=w;export{k as GovInfobar,x as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-infobar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as e,h as n,d as a}from"./p-d6759ac3.js";import{g as t,p as i}from"./p-d687df8f.js";import{d as s}from"./p-92c6c6aa.js";import{d as
|
|
1
|
+
import{p as o,H as e,h as n,d as a}from"./p-d6759ac3.js";import{g as t,p as i}from"./p-d687df8f.js";import{d as s}from"./p-92c6c6aa.js";import{d as r}from"./p-fd554fb4.js";const c={root:"gov-loading",content:"gov-loading__content",icon:"gov-loading__icon"};const d=".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-loading{display:block}.gov-loading__content{z-index:101;position:fixed;top:50%;left:50%;display:flex;gap:1rem;flex-direction:column;align-items:center;min-width:9.6875rem;padding:1.5rem;border-radius:0.5rem;background:var(--gov-loading-bg, rgba(var(--gov-color-secondary-400-rgb), 0.8));color:var(--gov-loading-color, var(--gov-color-primary));text-align:center;transform:translate(-50%, -50%)}.gov-loading__icon{width:4rem;height:4rem;line-height:1}.gov-loading__icon svg{width:100%;height:100%}";const g=d;const l=o(class o extends e{constructor(){super();this.__registerHost();this.h=t(this.host)}render(){return n(a,{key:"07e1abd92428555bc7651af43bb1beed4be6585c",class:this.h.classes(c.root)},n("div",{key:"849c10645767b3f3c2e0caa688b57a5454dc4178",class:c.content},n("gov-icon",{key:"c4175ff66bf22dadb3b6779d9efede6dbb6f85e9",class:i([c.icon,"gov-spin-animation"]),name:"loader"}),n("slot",{key:"03e90ff98d83cd748e7b541b579df93de2bcf073"})),n("gov-backdrop",{key:"cbc72236c34803588c4ab1cdcb14f8a420d37238",inverse:true}))}get host(){return this}static get style(){return g}},[4,"gov-loading"]);function f(){if(typeof customElements==="undefined"){return}const o=["gov-loading","gov-backdrop","gov-icon"];o.forEach((o=>{switch(o){case"gov-loading":if(!customElements.get(o)){customElements.define(o,l)}break;case"gov-backdrop":if(!customElements.get(o)){s()}break;case"gov-icon":if(!customElements.get(o)){r()}break}}))}f();const m=l;const p=f;export{m as GovLoading,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-loading.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as e,c as a,h as t,d as i}from"./p-d6759ac3.js";import{g as s,d,a as l}from"./p-d687df8f.js";import{c as r}from"./p-e618f1cb.js";import{a as c}from"./p-e296ca83.js";import{b as n}from"./p-6b0471a8.js";import{c as m}from"./p-95d41a3b.js";import{d as g}from"./p-e0e2e9c1.js";import{M as h}from"./p-0134b442.js";import{d as b}from"./p-92c6c6aa.js";import{d as v}from"./p-
|
|
1
|
+
import{p as o,H as e,c as a,h as t,d as i}from"./p-d6759ac3.js";import{g as s,d,a as l}from"./p-d687df8f.js";import{c as r}from"./p-e618f1cb.js";import{a as c}from"./p-e296ca83.js";import{b as n}from"./p-6b0471a8.js";import{c as m}from"./p-95d41a3b.js";import{d as g}from"./p-e0e2e9c1.js";import{M as h}from"./p-0134b442.js";import{d as b}from"./p-92c6c6aa.js";import{d as v}from"./p-44c731a0.js";import{d as f}from"./p-fd554fb4.js";const p='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=""],.gov-modal[open=true i],.gov-modal[open="1"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const u=p;const y=o(class o extends e{constructor(){super();this.__registerHost();this.govClose=a(this,"gov-close",7);this.open=false;this.blockClose=false;this.blockBackdropClose=false;this.blockButtonClose=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.wcagCloseLabel="Zavřít okno";this.wcagCloseLabelledBy=undefined;this.h=s(this.host);this.labelId=m("GovModalLabel");this.contentId=m("GovModalContent")}validateLabelTag(o){const e=["h1","h2","h3","h4","h5","h6"];if(o){if(!e.includes(o)){c(`[${h.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o;if(o&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}showModal(){this.open=true;document.body.classList.add(h.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(h.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(r()){await g(500);await this.validateWcag()}}render(){const o=this.labelTag;return t(i,{key:"e1525cfa3cdd7b0efeb2385b25a04ea8dbd49bc7",class:this.h.classes(h.root),open:this.open},t("dialog",{key:"a1116333c938d11049de61a9531109f346297734",class:h.dialog,hidden:!this.open,tabindex:d(this.open),open:this.open,"aria-modal":"true","aria-hidden":l(!this.open),"aria-labelledby":this.wcagLabelledBy||this.labelId,"aria-describedby":this.wcagDescribedBy||this.contentId,role:this.role},t("div",{key:"952ca6b5e7d1f4dcc59e09c1495f9aa9a96e56fb",class:h.inner},t("div",{key:"b00890579ccd683cd171a6200e972e0f02b5b4d3",class:h.header},this.h.hasSlot("icon")&&t("div",{key:"7bcf03a0f1c475b0c3553854c885b3d0900894db",class:h.icon},t("slot",{key:"527c8a9e77dbb2568510b6765634db0234039f8f",name:"icon"})),this.label&&t(o,{key:"c96b0339fcc61ba3f834d35926f6ef13419a901a",class:h.title,id:this.labelId},this.label),!(this.blockButtonClose||this.blockClose)?t("gov-button",{ref:o=>this.closeCtaRef=o,disabled:this.blockClose,class:h.close,variant:"primary",wcagLabel:this.wcagCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base","on-gov-click":this.onCloseHandler.bind(this)},t("gov-icon",{name:"x-lg"})):null),t("div",{key:"47e940a5bf64b87ec065f6c0977546603ca9bb11",class:h.content,id:this.contentId},t("slot",{key:"bc97ebe004ffb446c71a4bc0c8086af5d63cf3ec"})),this.h.hasSlot("footer")&&t("div",{key:"c48e97d8c9f597cc544d5e567cb0d679186b868e",class:h.footer},t("slot",{key:"7c9165dca0a9e20eef86e1937704c0f4154fcfb8",name:"footer"})))),this.open?t("gov-backdrop",{"wcag-label":this.wcagCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":o=>!this.blockBackdropClose&&this.onCloseHandler(o)}):null)}onCloseHandler(o){o.stopPropagation();if(this.blockClose===false){this.hideModal();this.govClose.emit(o)}}async show(){this.showModal()}async hide(){this.hideModal()}async validateWcag(){n(this.wcagLabelledBy,"wcag-labelled-by",h.root);n(this.wcagDescribedBy,"wcag-described-by",h.root)}get host(){return this}static get watchers(){return{labelTag:["validateLabelTag"],open:["watchOpen"]}}static get style(){return u}},[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]},undefined,{labelTag:["validateLabelTag"],open:["watchOpen"]}]);function _(){if(typeof customElements==="undefined"){return}const o=["gov-modal","gov-backdrop","gov-button","gov-icon"];o.forEach((o=>{switch(o){case"gov-modal":if(!customElements.get(o)){customElements.define(o,y)}break;case"gov-backdrop":if(!customElements.get(o)){b()}break;case"gov-button":if(!customElements.get(o)){v()}break;case"gov-icon":if(!customElements.get(o)){f()}break}}))}_();const w=y;const k=_;export{w as GovModal,k as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-modal.js.map
|