@gov-design-system-ce/components 4.2.4 → 4.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-flex_3.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-input_2.cjs.entry.js +2 -15
- package/dist/cjs/gov-form-input_2.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js +7 -20
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js.map +1 -1
- package/dist/collection/pages/Loading.js +5 -1
- package/dist/collection/pages/Loading.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-blockquote.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-dialog.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-range.js +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-form-switch.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-link.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-skeleton.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-theme-switch.js +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/{p-abea96cf.js → p-4fb591c3.js} +2 -2
- package/dist/components/{p-043a676e.js → p-5697ee30.js} +2 -2
- package/dist/components/{p-2b33d27c.js → p-8a9d4e12.js} +2 -2
- package/dist/components/{p-bd393ff0.js → p-8d1d7dd5.js} +2 -2
- package/dist/components/{p-90657523.js → p-a7917b98.js} +2 -2
- package/dist/components/p-b60d627f.js +2 -0
- package/dist/components/p-b60d627f.js.map +1 -0
- package/dist/components/{p-cbe3bc71.js → p-d2d05f02.js} +2 -2
- package/dist/components/{p-b56d6b99.js → p-ffc3a0df.js} +2 -2
- package/dist/core/core.css +20 -18
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-9e5eb19a.entry.js → p-2c52dcc9.entry.js} +2 -2
- package/dist/core/p-68b63bde.entry.js +2 -0
- package/dist/core/p-68b63bde.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-flex_3.entry.js +1 -1
- package/dist/esm/gov-form-input_2.entry.js +2 -15
- package/dist/esm/gov-form-input_2.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +7 -20
- package/dist/hydrate/index.mjs +7 -20
- package/dist/types/components/gov-loading/skeleton/gov-skeleton.d.ts +2 -6
- package/dist/types/components.d.ts +2 -2
- package/package.json +1 -1
- package/dist/components/p-313b4611.js +0 -2
- package/dist/components/p-313b4611.js.map +0 -1
- package/dist/core/p-b9f1c2ef.entry.js +0 -2
- package/dist/core/p-b9f1c2ef.entry.js.map +0 -1
- /package/dist/components/{p-abea96cf.js.map → p-4fb591c3.js.map} +0 -0
- /package/dist/components/{p-043a676e.js.map → p-5697ee30.js.map} +0 -0
- /package/dist/components/{p-2b33d27c.js.map → p-8a9d4e12.js.map} +0 -0
- /package/dist/components/{p-bd393ff0.js.map → p-8d1d7dd5.js.map} +0 -0
- /package/dist/components/{p-90657523.js.map → p-a7917b98.js.map} +0 -0
- /package/dist/components/{p-cbe3bc71.js.map → p-d2d05f02.js.map} +0 -0
- /package/dist/components/{p-b56d6b99.js.map → p-ffc3a0df.js.map} +0 -0
- /package/dist/core/{p-9e5eb19a.entry.js.map → p-2c52dcc9.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,h as o,d as s}from"./p-42200001.js";import{g as c}from"./p-ea7fdd2e.js";import{d as a}from"./p-
|
|
1
|
+
import{p as e,H as t,h as o,d as s}from"./p-42200001.js";import{g as c}from"./p-ea7fdd2e.js";import{d as a}from"./p-8a9d4e12.js";var n;(function(e){e["PRIMARY"]="primary";e["SUBTLE"]="subtle";e["NEUTRAL"]="neutral"})(n||(n={}));const f={root:"gov-blockquote"};const i=e(class e extends t{constructor(){super();this.__registerHost();this.type=n.SUBTLE;this.cite=undefined;this.h=c(this.host)}render(){return o(s,{key:"0d4b930791ee54ea55552b1a8ab9a2f248b5109e",class:this.h.classes(f.root),type:this.type},o("gov-icon",{key:"f27a6a5059203b000bede13c47aa7e5eb150e4cd",type:"components",name:"quote",size:"3xl"}),o("blockquote",{key:"3206cd993309f5636920e5b552e3cd97be98b334",cite:this.cite},o("slot",{key:"16ac7ec3098d37e1c5b444fe18e47986a5afa915"})),o("slot",{key:"ae4f20fbf0820346cc9919014ab6a3fc9f9ef96e",name:"image"}),o("slot",{key:"f43c96fef744f2d6147f8579fad0c808c064c81a",name:"author"}))}get host(){return this}},[4,"gov-blockquote",{type:[513],cite:[1]}]);function r(){if(typeof customElements==="undefined"){return}const e=["gov-blockquote","gov-icon"];e.forEach((e=>{switch(e){case"gov-blockquote":if(!customElements.get(e)){customElements.define(e,i)}break;case"gov-icon":if(!customElements.get(e)){a()}break}}))}r();const u=i;const b=r;export{u as GovBlockquote,b as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-blockquote.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as s,H as e,c as t,h as i,d as a}from"./p-42200001.js";import{a as c}from"./p-10cad7f1.js";import{c as o}from"./p-e8ec030e.js";import{g as n}from"./p-ea7fdd2e.js";import{t as l}from"./p-26618322.js";import{d as r}from"./p-
|
|
1
|
+
import{p as s,H as e,c as t,h as i,d as a}from"./p-42200001.js";import{a as c}from"./p-10cad7f1.js";import{c as o}from"./p-e8ec030e.js";import{g as n}from"./p-ea7fdd2e.js";import{t as l}from"./p-26618322.js";import{d as r}from"./p-4fb591c3.js";import{d}from"./p-8a9d4e12.js";const b={root:"gov-breadcrumbs"};const h=s(class s extends e{constructor(){super();this.__registerHost();this.govChange=t(this,"gov-change",7);this.inited=false;this.collapsible=false;this.isExpanded=false;this.accessibleLabel=undefined;this.accessibleLabelledBy=undefined;this.accessibleToggleLabel="Zobrazit či skrýt navigaci";this.expanded=false;this.toggleOption=false;this.h=n(this.host)}async componentDidRender(){this.scheduleContentVerification();if(o()){l((()=>this.validateAccessibility()))}}scheduleContentVerification(){if(this.inited)return;this.inited=true;l((()=>{this.calculateWidthOfItems();this.inited=false}))}calculateWidthOfItems(){const s=this.host.getBoundingClientRect().width;let e=0;this.host.querySelectorAll("li").forEach((s=>{e+=s.getBoundingClientRect().width}));this.toggleOption=e>s}render(){return i(a,{key:"dadd8de710050476be68e3f6fa0b317d6ccedfc1",class:this.h.classes(b.root),expanded:this.expanded},i("nav",{key:"468a3b605408c943421243024733b0381809f931","aria-label":this.accessibleLabel,"aria-labelledby":this.accessibleLabelledBy},i("slot",{key:"2c9f85b826c8c54340ab5abba51c1861282c9cb7"})),this.toggleOption?i("gov-button",{size:"xs",color:"primary",type:"base","aria-label":this.accessibleToggleLabel,"aria-pressed":this.expanded,"aria-expanded":this.expanded,"on-gov-click":()=>this.expanded=!this.expanded},i("gov-icon",{name:this.expanded?"chevron-up":"chevron-down",type:"components"})):null)}async validateAccessibility(){c(this.accessibleLabel,this.accessibleLabelledBy,b.root,this.host);c(this.accessibleToggleLabel,undefined,b.root,this.host)}get host(){return this}},[4,"gov-breadcrumbs",{collapsible:[4],isExpanded:[4,"is-expanded"],accessibleLabel:[1,"accessible-label"],accessibleLabelledBy:[1,"accessible-labelledby"],accessibleToggleLabel:[1,"accessible-toggle-label"],expanded:[32],toggleOption:[32],validateAccessibility:[64]}]);function f(){if(typeof customElements==="undefined"){return}const s=["gov-breadcrumbs","gov-button","gov-icon"];s.forEach((s=>{switch(s){case"gov-breadcrumbs":if(!customElements.get(s)){customElements.define(s,h)}break;case"gov-button":if(!customElements.get(s)){r()}break;case"gov-icon":if(!customElements.get(s)){d()}break}}))}f();const m=h;const p=f;export{m as GovBreadcrumbs,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-breadcrumbs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-4fb591c3.js";const t=o;const c=s;export{t as GovButton,c as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-button.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as i,c as s,h as t,d as a}from"./p-42200001.js";import{g as c,b as d}from"./p-ea7fdd2e.js";import{c as o}from"./p-cd6c2938.js";import{a as n}from"./p-10cad7f1.js";import{c as r}from"./p-e8ec030e.js";import{d as l}from"./p-e0e2e9c1.js";import{d as h}from"./p-
|
|
1
|
+
import{p as e,H as i,c as s,h as t,d as a}from"./p-42200001.js";import{g as c,b as d}from"./p-ea7fdd2e.js";import{c as o}from"./p-cd6c2938.js";import{a as n}from"./p-10cad7f1.js";import{c as r}from"./p-e8ec030e.js";import{d as l}from"./p-e0e2e9c1.js";import{d as h}from"./p-8a9d4e12.js";var f;(function(e){e["HORIZONTAL"]="horizontal";e["VERTICAL"]="vertical"})(f||(f={}));const b={root:"gov-card",header:"gov-card__header",arrow:"gov-card__arrow",inner:"gov-card__inner",img:"gov-card__img",icon:"gov-card__icon",content:"gov-card__content",footer:"gov-card__footer"};var m;(function(e){e["A"]="a";e["DIV"]="div"})(m||(m={}));const v=e(class e extends i{constructor(){super();this.__registerHost();this.govToggle=s(this,"gov-toggle",7);this.hydrated=false;this.direction="vertical";this.collapsible=false;this.open=true;this.href=undefined;this.target=undefined;this.accessibleTriggerLabel=undefined;this.accessibleTriggerLabelledBy=undefined;this.h=c(this.host);this.headlineId=o("GovCardHeadline");this.contentId=o("GovCardContent")}async componentDidRender(){if(r()){await l(500);await this.validateAccessibility()}}connectedCallback(){this.hydrated=true}render(){const e=this.href?m.A:m.DIV;return t(a,{key:"3a11dfeface1fa81d0c27f4ee3644c1c3b3a0191",class:this.h.classes(b.root),open:this.open,collapsible:d(this.collapsible),clickable:this.href?true:null,direction:this.direction,hydrated:this.hydrated},this.collapsible?t("button",{id:this.headlineId,class:b.header,"aria-label":this.accessibleTriggerLabel,"aria-labelledby":this.accessibleTriggerLabelledBy,"aria-expanded":d(this.open),"aria-controls":this.contentId,onClick:this.onClickHandler.bind(this)},t("slot",{name:"headline"}),t("gov-icon",{class:b.arrow,name:"chevron-down",type:"components"})):this.h.hasSlot("headline")?t("div",{class:b.header},t("slot",{name:"headline"})):null,t(e,{key:"bdf47c610db6c937ebe9f6fa45124b5df8e2847f",href:this.href,target:this.target,id:this.contentId,"aria-hidden":this.collapsible?d(!this.open):undefined,hidden:this.collapsible?!this.open:undefined,"aria-labelledby":this.collapsible?this.headlineId:undefined,class:b.inner},this.h.hasSlot("img")&&t("div",{key:"11ed1b55fe67d05382d538c903726ffd84fb7d48",class:b.img},t("slot",{key:"b1c362609163af2748256ecd1370bd074b8cd396",name:"img"})),this.h.hasSlot("icon")&&t("div",{key:"70b848927a86419442be3a84ee060c27a87fa12b",class:b.icon},t("slot",{key:"357b5dffa7c0970495ed167ca9a5db0b8d67c721",name:"icon"})),t("div",{key:"0bec7d7dc66dda27ba05e9041caeca8f20def8c4",class:b.content},t("slot",{key:"e3b08eb1097e0d788df4a45f78711bd0a5f02656"})),this.h.hasSlot("footer")&&t("div",{key:"0f4ef687f88e18a935d8f651bb7d2a9ea2c3df97",class:b.footer},t("slot",{key:"d645292f3ee9f007d9aeffdefcf2c26a1e5415b1",name:"footer"}))))}onClickHandler(e){e.stopPropagation();if(this.collapsible){this.open=!this.open;this.govToggle.emit({open:this.open,element:this.host})}}async validateAccessibility(){if(this.collapsible){n(this.accessibleTriggerLabel,this.accessibleTriggerLabelledBy,b.root,this.host)}}get host(){return this}},[4,"gov-card",{direction:[1],collapsible:[4],open:[1540],href:[513],target:[1],accessibleTriggerLabel:[1,"accessible-label"],accessibleTriggerLabelledBy:[1,"accessible-labelledby"],validateAccessibility:[64]}]);function g(){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,v)}break;case"gov-icon":if(!customElements.get(e)){h()}break}}))}g();const p=v;const u=g;export{p 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-d2d05f02.js";const t=o;const d=s;export{t as GovChip,d as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-chip.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,c as
|
|
1
|
+
import{p as e,H as s,c as i,h as a,d as t}from"./p-42200001.js";import{g as o,a as c,c as l}from"./p-ea7fdd2e.js";import{c as d}from"./p-e8ec030e.js";import{b}from"./p-10cad7f1.js";import{c as n}from"./p-cd6c2938.js";import{t as h}from"./p-26618322.js";import{d as r}from"./p-e0c3b1a7.js";import{d as f}from"./p-4fb591c3.js";import{d as g}from"./p-8a9d4e12.js";const m={root:"gov-dialog",dialog:"gov-dialog__dialog",inner:"gov-dialog__inner",header:"gov-dialog__header",title:"gov-dialog__title",content:"gov-dialog__content",close:"gov-dialog__close",footer:"gov-dialog__footer",bodyFix:"body-fixed"};const p=e(class e extends s{constructor(){super();this.__registerHost();this.govClose=i(this,"gov-close",7);this.hydrated=false;this.open=false;this.blockClose=false;this.blockBackdropClose=false;this.role="dialog";this.labelTag="h2";this.accessibleLabelledBy=undefined;this.accessibleDescribedBy=undefined;this.accessibleCloseLabel="Zavřít okno";this.accessibleCloseLabelledBy=undefined;this.h=o(this.host);this.labelId=n("GovDialogLabel");this.contentId=n("GovDialogContent")}watchOpen(e){this.open=e;this.setFocus().finally()}showDialog(){this.open=true;document.body.classList.add(m.bodyFix)}hideDialog(){this.open=false;document.body.classList.remove(m.bodyFix)}async componentDidRender(){if(d()){h((()=>this.validateAccessibility()))}if(this.open){this.showDialog()}else{this.hideDialog()}}connectedCallback(){this.hydrated=true}disconnectedCallback(){document.body.classList.remove(m.bodyFix)}render(){return a(t,{key:"d4185a1b611db509ebf08509afa23b6e1682fe6f",class:this.h.classes(m.root),open:this.open,hydrated:this.hydrated},a("dialog",{key:"6a9624025826c1bd0eb7e83739112cf7b2d56dbc",class:m.dialog,hidden:!this.open,tabindex:c(this.open),open:this.open,"aria-modal":"true","aria-hidden":l(!this.open),"aria-labelledby":this.accessibleLabelledBy||this.labelId,"aria-describedby":this.accessibleDescribedBy||this.contentId,role:this.role},a("div",{key:"1f93dc885aad9898151e00ca4717c8dd8eeea1ff",class:m.inner},a("div",{key:"4455c3f5f5e6aa9e6ec84ce400ead24a3e526374",class:m.header},this.h.hasSlot("icon")&&a("span",{key:"40bd7dba7f121d87e00b48b5c4f3ed0c01f5d4a0"},a("slot",{key:"911f36f5199cde0f6561da2385934bb88e668c68",name:"icon"})),this.h.hasSlot("title")&&a("span",{key:"1e45df978ffc0f360d242d24e826b4df41188196",class:m.title,id:this.labelId},a("slot",{key:"920d60a3305db5b2b7963e6e0c795dbe49101f40",name:"title"})),a("gov-button",{key:"42a64cd1706ba71362bc0bc0b8d69e9867ec5fb1",ref:e=>this.closeCtaRef=e,disabled:this.blockClose,class:m.close,color:"primary","aria-label":this.accessibleCloseLabel,"aria-labelledby":this.accessibleCloseLabelledBy,type:"base",size:"m","on-gov-click":this.onCloseHandler.bind(this)},a("gov-icon",{key:"480265e99c21126cbb755df8e6c6f482f69fb92b",slot:"icon-start",name:"x-lg",type:"components"}))),a("div",{key:"dc16ca442fbb779b8d0c127253324d2894e1b1e5",class:m.content,id:this.contentId},a("slot",{key:"a721e2e66951a436c2a7c946648e15cd1043a7c1"})),this.h.hasSlot("footer")&&a("div",{key:"ea53d2a6284285c3b33a346784f783e69cc6ff4a",class:m.footer},a("slot",{key:"1693aec930d48ffd79505638b4b03df4e50529f5",name:"footer"})))),this.open?a("gov-backdrop",{disabled:this.blockBackdropClose,"aria-label":this.accessibleCloseLabel,"aria-labelled-by":this.accessibleCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(e){e.stopPropagation();e.preventDefault();if(this.blockClose===false){this.hideDialog();this.govClose.emit(e)}}async setFocus(){if(this.open&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}async validateAccessibility(){b(this.accessibleLabelledBy,"accessible-labelled-by",m.root);b(this.accessibleDescribedBy,"accessible-described-by",m.root)}get host(){return this}static get watchers(){return{open:["watchOpen"]}}},[4,"gov-dialog",{open:[1540],blockClose:[4,"block-close"],blockBackdropClose:[4,"block-backdrop-close"],role:[1],labelTag:[1,"label-tag"],accessibleLabelledBy:[1,"accessible-labelled-by"],accessibleDescribedBy:[1,"accessible-described-by"],accessibleCloseLabel:[1,"accessible-close-label"],accessibleCloseLabelledBy:[1,"accessible-close-labelled-by"],setFocus:[64],validateAccessibility:[64]},undefined,{open:["watchOpen"]}]);function y(){if(typeof customElements==="undefined"){return}const e=["gov-dialog","gov-backdrop","gov-button","gov-icon"];e.forEach((e=>{switch(e){case"gov-dialog":if(!customElements.get(e)){customElements.define(e,p)}break;case"gov-backdrop":if(!customElements.get(e)){r()}break;case"gov-button":if(!customElements.get(e)){f()}break;case"gov-icon":if(!customElements.get(e)){g()}break}}))}y();const k=p;const v=y;export{k as GovDialog,v as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-dialog.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-a7917b98.js";const t=o;const a=s;export{t as GovFormAutocomplete,a as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-autocomplete.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as i,c as s,h as e,d as h}from"./p-42200001.js";import{c as n}from"./p-cd6c2938.js";import{v as o}from"./p-0b3574c2.js";import{g as a,d as r,e as c}from"./p-9908b9f0.js";import{g as d,c as l,t as m}from"./p-ea7fdd2e.js";import{F as u}from"./p-1c1d0bbe.js";import{i as f,A as p,a as v}from"./p-33d5d1ed.js";import{d as b}from"./p-
|
|
1
|
+
import{p as t,H as i,c as s,h as e,d as h}from"./p-42200001.js";import{c as n}from"./p-cd6c2938.js";import{v as o}from"./p-0b3574c2.js";import{g as a,d as r,e as c}from"./p-9908b9f0.js";import{g as d,c as l,t as m}from"./p-ea7fdd2e.js";import{F as u}from"./p-1c1d0bbe.js";import{i as f,A as p,a as v}from"./p-33d5d1ed.js";import{d as b}from"./p-8a9d4e12.js";const g=t(class t extends i{constructor(){super();this.__registerHost();this.govFocus=s(this,"gov-focus",7);this.govBlur=s(this,"gov-blur",7);this.govChange=s(this,"gov-change",7);this.hydrated=false;this.value=undefined;this.checked=false;this.required=false;this.disabled=false;this.indeterminate=false;this.name=undefined;this.size="m";this.identifier=undefined;this.noLabel=false;this.invalid=undefined;this.inheritedAttributes={};this.checkboxId=n("GovCheckbox");this.h=d(this.host);this.f=a(this.h)}validateSize(t){o(c,t,r.root)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("disabled",l(this.disabled));this.f.passAttrToControl("invalid",l(this.invalid));this.f.passAttrToControl("type","checkbox")}componentWillLoad(){this.passControlAttrs();this.inheritedAttributes=f(this.host)}componentDidLoad(){this.attributeObserver=new p(this.host,((t,i)=>{this.onAriaAttributeChange(t,i)}));this.attributeObserver.startObserving(v)}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.checkboxId);this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs()}connectedCallback(){this.hydrated=true}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,i){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:i})}render(){const t=t=>{if(this.noLabel){return e("label",{class:r.label},t)}return t};return e(h,{class:r.root,hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:m(this.invalid)},t(e(u,null,e("input",Object.assign({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,indeterminate:this.indeterminate,ref:t=>this.inputRef=t},this.inheritedAttributes,{"aria-checked":l(this.checked),"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-disabled":m(this.disabled)})),e("span",null,e("slot",{name:"label"}),e("gov-icon",{class:r.check,name:"check-lg",type:"components"}),e("gov-icon",{class:r.indeterminate,name:"dash-lg",type:"components"})))))}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}onClickHandler(t){t.stopPropagation()}onChangeHandler(t){this.checked=t.target.checked;t.stopPropagation();this.govChange.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}async getRef(){return this.inputRef}get host(){return this}static get watchers(){return{size:["validateSize","watchControlAttrs"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}}},[4,"gov-form-checkbox",{value:[1],checked:[1540],required:[4],disabled:[516],indeterminate:[516],name:[1],size:[513],identifier:[1],noLabel:[4,"no-label"],invalid:[4],inheritedAttributes:[32],getRef:[64]},undefined,{size:["validateSize","watchControlAttrs"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}]);function k(){if(typeof customElements==="undefined"){return}const t=["gov-form-checkbox","gov-icon"];t.forEach((t=>{switch(t){case"gov-form-checkbox":if(!customElements.get(t)){customElements.define(t,g)}break;case"gov-icon":if(!customElements.get(t)){b()}break}}))}k();const C=g;const A=k;export{C as GovFormCheckbox,A as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-checkbox.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as s,h as i,d as o}from"./p-42200001.js";import{c as a}from"./p-cd6c2938.js";import{g as n,c as r,t as h}from"./p-ea7fdd2e.js";import{g as l}from"./p-9908b9f0.js";import{A as c,a as f,i as m}from"./p-33d5d1ed.js";import{d}from"./p-022e49cf.js";import{d as u}from"./p-
|
|
1
|
+
import{p as t,H as e,c as s,h as i,d as o}from"./p-42200001.js";import{c as a}from"./p-cd6c2938.js";import{g as n,c as r,t as h}from"./p-ea7fdd2e.js";import{g as l}from"./p-9908b9f0.js";import{A as c,a as f,i as m}from"./p-33d5d1ed.js";import{d}from"./p-022e49cf.js";import{d as u}from"./p-ffc3a0df.js";import{d as p}from"./p-4fb591c3.js";import{d as g}from"./p-de989dfe.js";import{d as v}from"./p-8a9d4e12.js";const b={root:"gov-form-file",area:"gov-form-file__area",input:"gov-form-file__input",attachments:"gov-form-file__attachments"};function y(t){const e=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let s=0,i=parseInt(t,10)||0;while(i>=1024&&++s){i=i/1024}return i.toFixed(i<10&&s>0?1:0)+" "+e[s]}function E(t,e){if(typeof e==="string"&&e.length){return e.replace(/\s/g,"").split(",").filter((e=>new RegExp(e.replace("*",".*")).test(t.type))).length>0}else{return true}}function A(t,e){const s=Math.round(t.size);return s<=e}const k=t(class t extends e{constructor(){super();this.__registerHost();this.govFocus=s(this,"gov-focus",7);this.govBlur=s(this,"gov-blur",7);this.govFiles=s(this,"gov-files",7);this.govAddFile=s(this,"gov-add-file",7);this.govRemoveFile=s(this,"gov-remove-file",7);this.eventsRegistered=false;this.expanded=false;this.required=false;this.disabled=false;this.resetAfterPick=false;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.accessibleRemoveLabel="Odebrat soubor {FILE_NAME}";this.accessibleAttachmentsLabel="Přílohy";this.files=[];this.inheritedAttributes={};this.fileId=a("GovInputFile");this.h=n(this.host);this.f=l(this.h)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("invalid",r(this.invalid));this.f.passAttrToControl("disabled",r(this.disabled));this.f.passAttrToControl("type","File")}registerListeners(){if(this.eventsRegistered){return}this.eventsRegistered=true;function t(){this.areaRef.classList.add("highlight")}function e(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(t=>{t.preventDefault();t.stopPropagation();const e=t.target.files;if(this.resetAfterPick){if(e.length){this.validateFiles(e)}}else{this.validateFiles(e)}}),false);if(this.expanded){const s=["dragover","dragleave"];const i=["dragenter","dragover","mouseenter"];const o=["dragleave","mouseleave"];s.map((t=>this.inputRef.addEventListener(t,this.preventDefaults.bind(this),false)));i.map((e=>this.inputRef.addEventListener(e,t.bind(this),false)));o.forEach((t=>this.inputRef.addEventListener(t,e.bind(this),false)))}}preventDefaults(t){t.preventDefault();t.stopPropagation()}handleDrop(t){const e=t.dataTransfer;this.validateFiles(e.files)}validateFiles(t){let e=[];Array.from(t).map((t=>{const s=this.files.find((e=>e.file.name===t.name&&e.file.size===t.size))||null;if(s===null||this.ignoreFileDuplicationCheck){const s=typeof this.maxFileSize==="number"&&this.maxFileSize>0?A(t,this.maxFileSize):true;const i=E(t,this.accept);const o={id:a("GovFormFile"),file:t,acceptValid:i,sizeValid:s};if(this.displayAttachments){this.files=[...this.files,o]}else{e=[...e,o]}this.govAddFile.emit({component:b.root,file:o})}}));this.govFiles.emit({component:b.root,files:e.length?e:this.files});if(this.resetAfterPick){this.reset().finally()}}componentDidLoad(){this.attributeObserver=new c(this.host,((t,e)=>{this.onAriaAttributeChange(t,e)}));this.attributeObserver.startObserving(f)}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs();this.inheritedAttributes=m(this.host)}async componentDidRender(){this.registerListeners()}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,e){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:e})}render(){return i(o,{key:"6fe6eb71a8275871bb0aeebae9531d846123ae06",class:this.h.classes([b.root]),invalid:h(this.invalid),expanded:h(this.expanded)},i("div",{key:"cd7ab5a0c223214f5d825c8695993e8c64b9ea78",class:b.area,ref:t=>this.areaRef=t},i("slot",{key:"6197c08c6a50725a261da65069159f75e3e47834"}),i("input",Object.assign({key:"f6897d875af8c47268118ef5d7dd9c19cec6e9a1",class:b.input,ref:t=>this.inputRef=t,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},this.inheritedAttributes,{"aria-required":h(this.required),"aria-invalid":h(this.invalid),"aria-disabled":h(this.disabled)}))),this.h.hasSlot("attachments")?i("div",{class:b.attachments},i("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?i("div",{class:b.attachments},i("gov-attachments",{label:this.accessibleAttachmentsLabel,"accessible-label":this.accessibleAttachmentsLabel},this.files.map((t=>i("gov-attachments-item",{"accessible-remove-labelledby":t.id,"on-gov-remove":()=>this.onRemoveFileHandler(t)},i("span",{class:"sr-only",id:t.id},this.accessibleRemoveLabel.replace("{FILE_NAME}",t.file.name)),t.file.name,t.acceptValid===false?i("gov-form-message",{slot:"message",color:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill",type:"components"}),t.acceptValid===false?this.errorAccept:null):null,t.sizeValid===false?i("gov-form-message",{slot:"message",color:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill",type:"components"}),this.errorSize.replace("{FILE_SIZE}",y(this.maxFileSize))):null,i("span",{slot:"info"},"(",y(t.file.size),")")))))):null)}onRemoveFileHandler(t){const e=this.files.findIndex((e=>e.id===t.id));if(e!==-1){const t=this.files;const s=this.files[e];t.splice(e,1);this.files=[...t];this.govRemoveFile.emit({component:b.root,file:s});this.govFiles.emit({component:b.root,files:t})}}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:b.root,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:b.root,originalEvent:t})}onChangeHandler(t){t.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async reset(){this.files=[];this.inputRef.value=""}get host(){return this}static get watchers(){return{disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}}},[4,"gov-form-file",{expanded:[4],required:[4],disabled:[516],resetAfterPick:[4,"reset-after-pick"],ignoreFileDuplicationCheck:[4,"ignore-file-duplication-check"],displayAttachments:[4,"display-attachments"],name:[1],accept:[1],multiple:[4],maxFileSize:[2,"max-file-size"],identifier:[1],invalid:[4],errorSize:[1,"error-size"],errorAccept:[1,"error-accept"],accessibleRemoveLabel:[1,"accessible-remove-label"],accessibleAttachmentsLabel:[1,"accessible-attachments-label"],files:[32],inheritedAttributes:[32],getRef:[64],getAreaRef:[64],reset:[64]},undefined,{disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}]);function j(){if(typeof customElements==="undefined"){return}const t=["gov-form-file","gov-attachments","gov-attachments-item","gov-button","gov-form-message","gov-icon"];t.forEach((t=>{switch(t){case"gov-form-file":if(!customElements.get(t)){customElements.define(t,k)}break;case"gov-attachments":if(!customElements.get(t)){d()}break;case"gov-attachments-item":if(!customElements.get(t)){u()}break;case"gov-button":if(!customElements.get(t)){p()}break;case"gov-form-message":if(!customElements.get(t)){g()}break;case"gov-icon":if(!customElements.get(t)){v()}break}}))}j();const F=k;const C=j;export{F as GovFormFile,C as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-file.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as
|
|
1
|
+
import{G as d,d as o}from"./p-8d1d7dd5.js";const s=d;const t=o;export{s as GovFormInput,t as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-input.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as i,h as s,d as o}from"./p-42200001.js";import{g as a,h as n,i as h}from"./p-9908b9f0.js";import{g as l,c as r,t as c}from"./p-ea7fdd2e.js";import{v as d}from"./p-0b3574c2.js";import{c as u,r as f}from"./p-cd6c2938.js";import{p as m}from"./p-be086357.js";import{t as v}from"./p-26618322.js";import{A as p,a as b}from"./p-33d5d1ed.js";import{d as g}from"./p-
|
|
1
|
+
import{p as t,H as e,c as i,h as s,d as o}from"./p-42200001.js";import{g as a,h as n,i as h}from"./p-9908b9f0.js";import{g as l,c as r,t as c}from"./p-ea7fdd2e.js";import{v as d}from"./p-0b3574c2.js";import{c as u,r as f}from"./p-cd6c2938.js";import{p as m}from"./p-be086357.js";import{t as v}from"./p-26618322.js";import{A as p,a as b}from"./p-33d5d1ed.js";import{d as g}from"./p-4fb591c3.js";import{d as y}from"./p-a7917b98.js";import{d as k}from"./p-8d1d7dd5.js";import{d as j}from"./p-8a9d4e12.js";import{d as w}from"./p-b60d627f.js";const O=t(class t extends e{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.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.focused=undefined;this.valueState=undefined;this.selectedOptionsState=[];this.optionsState=[];this.inheritedAttributes={};this.selectId=u("GovSelect");this.listId=u("GovMultiList");this.h=l(this.host);this.f=a(this.h)}validateSize(t){d(h,t,n.root)}watchOptions(t){this.optionsState=m(t)}watchValue(t){this.selectedOptionsState=m(t)}componentDidLoad(){this.attributeObserver=new p(this.host,((t,e)=>{this.onAriaAttributeChange(t,e)}));this.attributeObserver.startObserving(b);this.initAutocomplete()}componentWillLoad(){this.validateSize(this.size);this.optionsState=m(this.options);this.selectedOptionsState=m(this.value)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,e){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:e})}getAvailableOptions(t=false){if(Array.isArray(this.optionsState)&&this.optionsState.length){if(t){return this.optionsState}return this.optionsState.filter((t=>{const e=this.selectedValueIndex(t.value);return e!==-1||(t===null||t===void 0?void 0:t.disabled)?false:true})).map((t=>{var e;return{name:(e=t.label)!==null&&e!==void 0?e:t.value,value:t.value}}))}return Array.from(this.selectRef.querySelectorAll("option")).filter((e=>{if(t){return true}const i=this.selectedValueIndex(e.value);return!(e.disabled||e.selected||i>-1)})).map((t=>({name:t.textContent,value:t.value})))}initAutocomplete(){var t,e,i,s,o;(t=this.autocompleteRef)===null||t===void 0?void 0:t.addEventListener("gov-select",this.onSelectHandler.bind(this));(e=this.autocompleteRef)===null||e===void 0?void 0:e.addEventListener("gov-input",this.onInputHandler.bind(this));(i=this.autocompleteRef)===null||i===void 0?void 0:i.addEventListener("gov-focus",this.onFocusHandler.bind(this));(s=this.autocompleteRef)===null||s===void 0?void 0:s.addEventListener("gov-blur",this.onBlurHandler.bind(this));(o=this.autocompleteRef)===null||o===void 0?void 0:o.setSearchCallback((t=>new Promise((e=>{const i=this.getAvailableOptions();if(String(t).length===0){return e(i)}e(i.filter((({label:e,value:i})=>{if(!e)e=i;return f(e).toLowerCase().indexOf(f(t).toLowerCase())>-1})))})))).finally()}selectedValueIndex(t){return this.selectedOptionsState.findIndex((e=>e===t))}getOptionElement(t){return this.selectRef.querySelector('option[value="'+t+'"]')}getOption(t){var e;return(e=this.getAvailableOptions(true).find((e=>e.value===t)))!==null&&e!==void 0?e:null}selectOption(t,e=true){const i=this.selectedValueIndex(t);if(i===-1){this.selectedOptionsState=[...this.selectedOptionsState,t];this.value=this.selectedOptionsState;if(e){this.govChange.emit({component:n.root,value:this.selectedOptionsState});this.govSelect.emit({component:n.root,value:this.selectedOptionsState})}const i=this.getOptionElement(t);if(i){i.selected=true}}}removeOption(t,e=true){const i=this.selectedValueIndex(t);if(i!==-1){this.selectedOptionsState.splice(i,1);this.selectedOptionsState=[...this.selectedOptionsState];this.value=this.selectedOptionsState;if(e){this.govChange.emit({component:n.root,value:this.selectedOptionsState});this.govRemove.emit({component:n.root,value:this.selectedOptionsState})}const s=this.getOptionElement(t);if(s){s.selected=false}}}async componentDidRender(){this.f.passAttrToLabel("required",String(this.required));v((()=>{this.selectRef.querySelectorAll("option").forEach((t=>{if(t.selected){this.selectOption(t.value,false)}}))}))}render(){return s(o,{key:"efc41cd22f35a7c326f8321f11c875a6ee6d44fe",class:n.root,size:this.size},s("div",{key:"229b01f0a9b0cb35e59cda5ce5a78c14309ab1ee",class:n.wrap},this.h.hasSlot("prefix")&&s("slot",{key:"48cefdbe753f57acca0aa5fc74bc7cc6f902e4b7",name:"prefix"}),s("gov-form-autocomplete",{key:"a4a3e0f0fb0f9e3d9ec0ce8d24b390a169f0749a",value:this.valueState,disabled:this.disabled,identifier:this.identifier||this.selectId,required:false,invalid:this.invalid,success:this.success,size:this.size,placeholder:this.placeholder,"message-empty":this.messageEmpty,"message-loading":this.messageLoading,ref:t=>this.autocompleteRef=t,minlength:0,"aria-owns":this.listId},this.success&&s("gov-icon",{key:"8a43c6c12f16773956b669b7cd08608d6aeb3bb9",slot:"validation-icon",class:"validation-icon",name:"check-lg",type:"components"}),this.invalid&&s("gov-icon",{key:"6eaee1ebf4ac9c337e22b071edf77fbeec012a3c",slot:"validation-icon",class:"validation-icon",name:"exclamation-lg",type:"components"}),s("gov-icon",{key:"c9f7f2f83f37abdab373bfb2aa43c36ec08dfede",slot:"icon-end",class:"arrow-icon",name:"chevron-down",type:"components"})),s("select",Object.assign({key:"d4623e47694c6b28b5e201f083e6d73fa6a331aa",hidden:true,class:"hidden-select-list","aria-hidden":r(true),multiple:true,required:this.required,name:this.name,disabled:this.disabled,ref:t=>this.selectRef=t},this.inheritedAttributes,{"aria-disabled":c(this.disabled),"aria-required":c(this.required),"aria-invalid":c(this.invalid)}),s("slot",{key:"f5e03e3e33a1bb97b00c544765332b67812c5fd5"}),Array.isArray(this.optionsState)&&this.optionsState.map((t=>{var e;const i=this.selectedValueIndex(t.value);return s("option",{value:t.value,selected:i>-1,disabled:t===null||t===void 0?void 0:t.disabled},(e=t.label)!==null&&e!==void 0?e:t.value)}))),this.h.hasSlot("sufix")&&s("slot",{key:"aa9c37047083aa68a9ccaf8066a62a2eb9a3797f",name:"sufix"})),this.hideSelectedList===false?s("ul",{role:"listbox",id:this.listId,class:n.list},Array.isArray(this.selectedOptionsState)&&this.selectedOptionsState.map((t=>{var e,i;const o=this.getOption(t);if(!o)return null;return s("li",{class:n.item,role:"option"},(e=o.label)!==null&&e!==void 0?e:o.value,s("gov-button",{"aria-label":(i="Odebrat vybranou položku "+o.label)!==null&&i!==void 0?i:o.value,color:"primary",type:"base",size:this.size,"on-gov-click":()=>this.onTagRemove(t)},s("gov-icon",{name:"x-lg",type:"components"})))}))):null)}onFocusHandler(t){t.stopPropagation();this.focused=true;this.govFocus.emit({component:n.root,originalEvent:t,value:this.selectedOptionsState})}onBlurHandler(t){t.stopPropagation();t.stopPropagation();this.focused=false;this.govBlur.emit({component:n.root,originalEvent:t,value:this.selectedOptionsState})}onInputHandler(t){this.valueState=t.detail.value;t.stopPropagation()}onSelectHandler(t){t.stopPropagation();const e=t.detail.selected;this.selectOption(e.value);this.valueState="";this.autocompleteRef.clearValue().finally();this.autocompleteRef.focus()}onTagRemove(t){this.removeOption(t)}async setFocus(t){return this.selectRef.focus(t)}async setValue(t){this.valueState=t}async getRef(){return this.selectRef}get host(){return this}static get watchers(){return{size:["validateSize"],options:["watchOptions"],value:["watchValue"]}}},[4,"gov-form-multi-select",{value:[1537],options:[1537],identifier:[1],placeholder:[1],size:[1],name:[1],hideSelectedList:[4,"hide-selected-list"],required:[4],disabled:[516],invalid:[516],success:[4],messageEmpty:[1,"message-empty"],messageLoading:[1,"message-loading"],focused:[32],valueState:[32],selectedOptionsState:[32],optionsState:[32],inheritedAttributes:[32],setFocus:[64],setValue:[64],getRef:[64]},undefined,{size:["validateSize"],options:["watchOptions"],value:["watchValue"]}]);function E(){if(typeof customElements==="undefined"){return}const t=["gov-form-multi-select","gov-button","gov-form-autocomplete","gov-form-input","gov-icon","gov-skeleton"];t.forEach((t=>{switch(t){case"gov-form-multi-select":if(!customElements.get(t)){customElements.define(t,O)}break;case"gov-button":if(!customElements.get(t)){g()}break;case"gov-form-autocomplete":if(!customElements.get(t)){y()}break;case"gov-form-input":if(!customElements.get(t)){k()}break;case"gov-icon":if(!customElements.get(t)){j()}break;case"gov-skeleton":if(!customElements.get(t)){w()}break}}))}E();const S=O;const x=E;export{S as GovFormMultiSelect,x as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-multi-select.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as s,c as i,h as e,d as n}from"./p-42200001.js";import{p as o}from"./p-e0e2e9c1.js";import{S as a}from"./p-92f420cb.js";import{g as h,c as r,t as c}from"./p-ea7fdd2e.js";import{v as d}from"./p-0b3574c2.js";import{A as l,a as
|
|
1
|
+
import{p as t,H as s,c as i,h as e,d as n}from"./p-42200001.js";import{p as o}from"./p-e0e2e9c1.js";import{S as a}from"./p-92f420cb.js";import{g as h,c as r,t as c}from"./p-ea7fdd2e.js";import{v as d}from"./p-0b3574c2.js";import{A as l,a as u,i as f}from"./p-33d5d1ed.js";import{g as m}from"./p-9908b9f0.js";import{t as p}from"./p-26618322.js";import{b}from"./p-2fe7d728.js";import{c as v}from"./p-cd6c2938.js";import{d as g}from"./p-4fb591c3.js";import{d as j}from"./p-8d1d7dd5.js";import{d as w}from"./p-8a9d4e12.js";const A=o(a,["_S","_M","_L"]);const y={root:"gov-form-range",fill:"gov-form-range--fill",input:"gov-form-range--input"};const C=t(class t extends s{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govInput=i(this,"gov-input",7);this.size="m";this.value=undefined;this.identifier=undefined;this.name=undefined;this.min=undefined;this.max=undefined;this.step=undefined;this.tooltip=false;this.input=false;this.listIdentifier=undefined;this.required=false;this.success=undefined;this.invalid=undefined;this.disabled=false;this.inheritedAttributes={};this.h=h(this.host);this.f=m(this.h);this.inputId=v("GovInput")}validateSize(t){d(A,t,y.root)}watchValue(){this.controlOutputPosition()}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("success",r(this.success));this.f.passAttrToControl("disabled",r(this.disabled));this.f.passAttrToControl("invalid",r(this.invalid))}get getThumbWidth(){const t=window.getComputedStyle(this.inputRef);return parseFloat(t.getPropertyValue("--thumb-size"))||1}controlOutputPosition(){const t=+this.value;const s=+this.inputRef.min;const i=+this.inputRef.max;const e=this.getThumbWidth*16;const n=this.inputRef.offsetWidth;const o=(t-s)/(i-s)*100;let a=o/100*(n-e)+e/2;if(this.outputRef){this.outputRef.textContent=this.value;const t=this.outputRef.offsetWidth/2;this.outputRef.style.left=`${a-t}px`}if(this.fillRef){this.fillRef.style.width=`${a}px`}}componentDidLoad(){this.attributeObserver=new l(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(u)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=f(this.host)}componentDidRender(){this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));p(this.controlOutputPosition.bind(this))}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}render(){return e(n,{key:"87236e8cdb0534dbefc72286517c353d41860260",class:y.root,size:this.size},this.h.hasSlot("prefix")&&e("slot",{key:"83f2b5ff50d7638d1e13de9e0f4774d747a8e374",name:"prefix"}),e("span",{key:"7cef4eac6144ee71dd6b3ffcdc2e992f33f97740",class:"element"},e("input",Object.assign({key:"1c2fda25454dc11bdfab17065f07bb38959a2941",type:"range",ref:t=>this.inputRef=t,onInput:this.onInputHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),id:this.identifier||this.inputId,name:this.name,min:this.min,max:this.max,step:this.step,list:this.listIdentifier,value:this.value,required:this.required,disabled:this.disabled},this.inheritedAttributes,{"aria-required":c(this.required),"aria-invalid":c(this.invalid),"aria-disabled":c(this.disabled)})),e("div",{key:"bdece1cc0cad1614eb090e9183d9dd96389b7568",class:y.fill,ref:t=>this.fillRef=t}),this.tooltip?e("output",{htmlFor:this.name,ref:t=>this.outputRef=t},this.value):null,e("slot",{key:"4e346163e119d7508942a31bc35b28acd807bdb3",name:"datalist"})),this.h.hasSlot("sufix")&&e("slot",{key:"3faaf9ba94069c9a7f3a147e9a6ecfec7a38edc7",name:"sufix"}),this.input?e("gov-form-input",Object.assign({"on-gov-input":this.onCustomInputHandler.bind(this),class:y.input,size:this.size,value:this.value,disabled:this.disabled},this.inheritedAttributes)):null)}onCustomInputHandler(t){const s=t.target.value;if(this.step&&b(+this.step)){const i=+s;const e=+this.min;const n=+this.max;const o=+this.step;if(isNaN(i)){return false}if(i<e||i>n){return false}const a=i-e;if(a%o!==0){return false}this.value=s;this.govInput.emit({component:y.root,value:this.value,originalEvent:t})}}onInputHandler(t){this.value=t.target.value;t.stopPropagation();this.govInput.emit({component:y.root,value:this.value,originalEvent:t})}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:y.root,value:this.value,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:y.root,value:this.value,originalEvent:t})}async setFocus(t){return this.inputRef.focus(t)}async setValue(t){this.value=t}async clearValue(){this.value="";this.inputRef.value=""}async getRef(){return this.inputRef}get host(){return this}static get watchers(){return{size:["validateSize","watchControlAttrs"],value:["watchValue"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"]}}},[4,"gov-form-range",{size:[1],value:[1537],identifier:[1],name:[1],min:[8],max:[8],step:[8],tooltip:[4],input:[4],listIdentifier:[1,"list-identifier"],required:[516],success:[516],invalid:[516],disabled:[516],inheritedAttributes:[32],setFocus:[64],setValue:[64],clearValue:[64],getRef:[64]},undefined,{size:["validateSize","watchControlAttrs"],value:["watchValue"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"]}]);function k(){if(typeof customElements==="undefined"){return}const t=["gov-form-range","gov-button","gov-form-input","gov-icon"];t.forEach((t=>{switch(t){case"gov-form-range":if(!customElements.get(t)){customElements.define(t,C)}break;case"gov-button":if(!customElements.get(t)){g()}break;case"gov-form-input":if(!customElements.get(t)){j()}break;case"gov-icon":if(!customElements.get(t)){w()}break}}))}k();const x=C;const z=k;export{x as GovFormRange,z as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-range.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-5697ee30.js";const t=o;const e=s;export{t as GovFormSelect,e as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-select.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as i,H as s,c as t,h as e,d as h}from"./p-42200001.js";import{c as a}from"./p-cd6c2938.js";import{v as n}from"./p-0b3574c2.js";import{g as o,n as c,o as d}from"./p-9908b9f0.js";import{g as r,c as l,t as u}from"./p-ea7fdd2e.js";import{F as m}from"./p-1c1d0bbe.js";import{A as f,a as
|
|
1
|
+
import{p as i,H as s,c as t,h as e,d as h}from"./p-42200001.js";import{c as a}from"./p-cd6c2938.js";import{v as n}from"./p-0b3574c2.js";import{g as o,n as c,o as d}from"./p-9908b9f0.js";import{g as r,c as l,t as u}from"./p-ea7fdd2e.js";import{F as m}from"./p-1c1d0bbe.js";import{A as f,a as p,i as b}from"./p-33d5d1ed.js";import{d as v}from"./p-8a9d4e12.js";const g=i(class i extends s{constructor(){super();this.__registerHost();this.govFocus=t(this,"gov-focus",7);this.govBlur=t(this,"gov-blur",7);this.govChange=t(this,"gov-change",7);this.hydrated=false;this.value=undefined;this.noLabel=false;this.checked=false;this.required=false;this.disabled=false;this.name=undefined;this.size="m";this.identifier=undefined;this.invalid=undefined;this.inheritedAttributes={};this.checkboxId=a("GovCheckbox");this.h=r(this.host);this.f=o(this.h)}validateSize(i){n(d,i,c.root)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",l(this.invalid));this.f.passAttrToControl("disabled",l(this.disabled));this.f.passAttrToControl("type","switch")}componentDidLoad(){this.attributeObserver=new f(this.host,((i,s)=>{this.onAriaAttributeChange(i,s)}));this.attributeObserver.startObserving(p)}componentWillLoad(){this.passControlAttrs();this.inheritedAttributes=b(this.host)}disconnectedCallback(){var i;(i=this.attributeObserver)===null||i===void 0?void 0:i.stopObserving()}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.checkboxId);this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs()}connectedCallback(){this.hydrated=true}onAriaAttributeChange(i,s){this.host.removeAttribute(i);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[i]:s})}render(){const i=i=>{if(this.noLabel){return e("label",{class:c.label},i)}return i};return e(h,{class:this.h.classes(c.root),hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:u(this.invalid)},i(e(m,null,e("input",Object.assign({class:c.input,id:this.identifier||this.checkboxId,type:"checkbox",value:this.value,name:this.name,disabled:this.disabled,checked:this.checked,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),ref:i=>this.inputRef=i,required:this.required},this.inheritedAttributes,{"aria-checked":this.checked,"aria-required":u(this.required),"aria-invalid":u(this.invalid),"aria-disabled":u(this.disabled)})),e("span",null,e("span",{class:c.indicator},this.checked&&e("gov-icon",{name:"check-lg",type:"components"})),e("slot",{name:"label"})))))}onClickHandler(i){i.stopPropagation()}onFocusHandler(i){i.stopPropagation();this.govFocus.emit({component:c.root,checked:this.checked,value:this.value,originalEvent:i})}onBlurHandler(i){i.stopPropagation();this.govBlur.emit({component:c.root,checked:this.checked,value:this.value,originalEvent:i})}onChangeHandler(i){this.checked=i.target.checked;i.stopPropagation();this.govChange.emit({component:c.root,checked:this.checked,value:this.value,originalEvent:i})}async getRef(){return this.inputRef}get host(){return this}static get watchers(){return{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}}},[4,"gov-form-switch",{value:[1],noLabel:[4,"no-label"],checked:[1540],required:[4],disabled:[516],name:[1],size:[513],identifier:[1],invalid:[4],inheritedAttributes:[32],getRef:[64]},undefined,{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}]);function k(){if(typeof customElements==="undefined"){return}const i=["gov-form-switch","gov-icon"];i.forEach((i=>{switch(i){case"gov-form-switch":if(!customElements.get(i)){customElements.define(i,g)}break;case"gov-icon":if(!customElements.get(i)){v()}break}}))}k();const w=g;const j=k;export{w as GovFormSwitch,j as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-switch.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-8a9d4e12.js";const t=o;const a=s;export{t as GovIcon,a as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-icon.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as s,h as o,d as i}from"./p-42200001.js";import{g as a,c as n}from"./p-ea7fdd2e.js";import{F as c}from"./p-1c1d0bbe.js";import{v as l}from"./p-0b3574c2.js";import{C as r}from"./p-5aad3497.js";import{p as h}from"./p-e0e2e9c1.js";import{A as d,a as b,i as f}from"./p-33d5d1ed.js";import{d as m}from"./p-
|
|
1
|
+
import{p as t,H as e,c as s,h as o,d as i}from"./p-42200001.js";import{g as a,c as n}from"./p-ea7fdd2e.js";import{F as c}from"./p-1c1d0bbe.js";import{v as l}from"./p-0b3574c2.js";import{C as r}from"./p-5aad3497.js";import{p as h}from"./p-e0e2e9c1.js";import{A as d,a as b,i as f}from"./p-33d5d1ed.js";import{d as m}from"./p-4fb591c3.js";import{d as p}from"./p-8a9d4e12.js";const v=h(r,["PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING"]);var u;(function(t){t["BOLD"]="bold";t["SUBTLE"]="subtle"})(u||(u={}));const g={root:"gov-infobar",section:"gov-infobar__section",content:"gov-infobar__content",headline:"gov-infobar__headline",close:"gov-infobar__close"};const y=t(class t extends e{constructor(){super();this.__registerHost();this.govClose=s(this,"gov-close",7);this.hydrated=false;this.color="primary";this.type="bold";this.role=undefined;this.accessibleCloseLabel="Zavřít informační lištu";this.accessibleToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.inheritedAttributes={};this.h=a(this.host)}validateColor(t){l(v,t,g.root)}componentDidLoad(){this.attributeObserver=new d(this.host,((t,e)=>{this.onAriaAttributeChange(t,e)}));this.attributeObserver.startObserving(b)}componentWillLoad(){this.validateColor(this.color);this.inheritedAttributes=f(this.host)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,e){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:e})}connectedCallback(){this.hydrated=true}render(){const t=o("gov-button",{key:"43dfaa83a5cbf0c8ac3ffe055b9b2df56ee95252",size:"s","aria-label":this.accessibleCloseLabel,type:"base",color:this.isBold?this.color:"neutral","on-gov-click":this.onCloseHandler.bind(this),class:g.close},o("gov-icon",{key:"9a04704a5679dbd328b150975cd01b13a9a8939b",name:"x-lg",type:"components"}));return o(i,{key:"61a672fe70509238f25f353f0f97c4170f958b18",class:this.h.classes(g.root),color:this.color,type:this.type,hydrated:this.hydrated},o("section",Object.assign({key:"2cebebdc62541a0c71578b06f677c3814b2dfd36",class:g.section},this.inheritedAttributes,{role:this.role}),this.h.hasSlot("icon")&&o("span",{key:"de201f0008f3ec11533e0712cb95391e2694318a"},o("slot",{key:"fe5ff9dca68dad254be183b31174123f7218f8ff",name:"icon"})),o("div",{key:"d2201cd542519895dbab9329c7bef7190ad42783",class:g.content},this.h.hasSlot("headline")?o(c,null,o("div",{class:g.headline},o("slot",{name:"headline"}),o("gov-button",{size:"s",type:"base",color:this.isBold?this.color:"neutral","aria-label":this.accessibleToggleLabel,"on-gov-click":()=>this.toggleContent=!this.toggleContent},o("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down",type:"components"}))),o("div",{hidden:!this.toggleContent,"aria-hidden":n(this.toggleContent)},o("slot",null))):o("slot",null)),this.closable&&t))}onCloseHandler(t){this.govClose.emit({component:g.root,ref:this.host,originalEvent:t})}get isBold(){return this.type==="bold"}get host(){return this}static get watchers(){return{color:["validateColor"]}}},[4,"gov-infobar",{color:[1],type:[1],role:[1],accessibleCloseLabel:[1,"accessible-close-label"],accessibleToggleLabel:[1,"accessible-toggle-label"],closable:[4],toggleContent:[32],inheritedAttributes:[32]},undefined,{color:["validateColor"]}]);function k(){if(typeof customElements==="undefined"){return}const t=["gov-infobar","gov-button","gov-icon"];t.forEach((t=>{switch(t){case"gov-infobar":if(!customElements.get(t)){customElements.define(t,y)}break;case"gov-button":if(!customElements.get(t)){m()}break;case"gov-icon":if(!customElements.get(t)){p()}break}}))}k();const C=y;const j=k;export{C as GovInfobar,j as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-infobar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,h as s,d as i}from"./p-42200001.js";import{p as n}from"./p-e0e2e9c1.js";import{S as
|
|
1
|
+
import{p as e,H as t,h as s,d as i}from"./p-42200001.js";import{p as n}from"./p-e0e2e9c1.js";import{S as a}from"./p-92f420cb.js";import{g as o}from"./p-ea7fdd2e.js";import{v as r}from"./p-0b3574c2.js";import{i as c}from"./p-33d5d1ed.js";import{d}from"./p-8a9d4e12.js";const f=n(a,["_S","_M","_L"]);const h={root:"gov-link",external:"gov-link--external"};const l=e(class e extends t{constructor(){super();this.__registerHost();this.size="m";this.external=false;this.truncate=false;this.href=undefined;this.target=undefined;this.inheritedAttributes={};this.h=o(this.host)}validateSize(e){r(f,e,h.root)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=c(this.host)}onAriaAttributeChange(e,t){this.host.removeAttribute(e);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[e]:t})}render(){return s(i,{key:"1e7fe110dd7ffc47364765cd01d17adf78db675c",class:this.h.classes(h.root),size:this.size,href:this.href,external:this.external,truncate:this.truncate},s("a",Object.assign({key:"4a9148c0adfd79bc7cb0953768929b702530c298",class:"element",href:this.href,target:this.external?"_blank":this.target,rel:this.external?"noreferrer":null},this.inheritedAttributes),s("slot",{key:"ca80033f0525c11e0f16bb9cb93c746816144e54",name:"icon-start"}),s("span",{key:"0338222112b926d141ff42538489d7d019997560"},s("slot",{key:"a492aed90aed29892e4522f602858d8a84c5f010"})),s("slot",{key:"f9f60c054849df9980b26ca09804218476d3b4ed",name:"icon-end"}),this.external&&s("gov-icon",{key:"fbe4cd9d42ae1bcc1f3666271f49ee96ff49d112",name:"box-arrow-up-right",type:"components",size:this.size,class:h.external})))}get host(){return this}static get watchers(){return{size:["validateSize"]}}},[4,"gov-link",{size:[1],external:[4],truncate:[4],href:[1],target:[1],inheritedAttributes:[32]},undefined,{size:["validateSize"]}]);function m(){if(typeof customElements==="undefined"){return}const e=["gov-link","gov-icon"];e.forEach((e=>{switch(e){case"gov-link":if(!customElements.get(e)){customElements.define(e,l)}break;case"gov-icon":if(!customElements.get(e)){d()}break}}))}m();const p=l;const b=m;export{p as GovLink,b as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-link.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as o,h as s,d as t}from"./p-42200001.js";import{p as a}from"./p-e0e2e9c1.js";import{S as c}from"./p-92f420cb.js";import{g as i,p as n}from"./p-ea7fdd2e.js";import{v as d}from"./p-0b3574c2.js";import{d as r}from"./p-e0c3b1a7.js";import{d as m}from"./p-
|
|
1
|
+
import{p as e,H as o,h as s,d as t}from"./p-42200001.js";import{p as a}from"./p-e0e2e9c1.js";import{S as c}from"./p-92f420cb.js";import{g as i,p as n}from"./p-ea7fdd2e.js";import{v as d}from"./p-0b3574c2.js";import{d as r}from"./p-e0c3b1a7.js";import{d as m}from"./p-8a9d4e12.js";const f=a(c,["_S","_M","_L"]);const p={root:"gov-loading",content:"gov-loading__content",icon:"gov-loading__icon"};const b=e(class e extends o{constructor(){super();this.__registerHost();this.size="m";this.h=i(this.host)}validateSize(e){d(f,e,p.root)}componentWillLoad(){this.validateSize(this.size)}render(){return s(t,{key:"84c4d73523ef359fc224441d2b3ee700b9d563b3",class:this.h.classes(p.root),size:this.size},s("div",{key:"e8e9bda9cb6d86fdec2022b8a9b3fba9f5ee423a",class:p.content},s("gov-icon",{key:"7adafe593b0c37da48dc3da5eb43bc25c504e9a4",class:n([p.icon,"gov-spin-animation"]),name:"loader",type:"components"}),s("slot",{key:"e4b8461f84f519b70eea2a1bb10cf86e9e3d14ca"})),s("gov-backdrop",{key:"0c044675ab012d028dcc7772c2ad0dfb0aa08de2",inverse:true}))}get host(){return this}static get watchers(){return{size:["validateSize"]}}},[4,"gov-loading",{size:[1]},undefined,{size:["validateSize"]}]);function g(){if(typeof customElements==="undefined"){return}const e=["gov-loading","gov-backdrop","gov-icon"];e.forEach((e=>{switch(e){case"gov-loading":if(!customElements.get(e)){customElements.define(e,b)}break;case"gov-backdrop":if(!customElements.get(e)){r()}break;case"gov-icon":if(!customElements.get(e)){m()}break}}))}g();const l=b;const v=g;export{l as GovLoading,v as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-loading.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as s,h as i,d as a}from"./p-42200001.js";import{F as o}from"./p-1c1d0bbe.js";import{v as n}from"./p-0b3574c2.js";import{S as l}from"./p-92f420cb.js";import{C as r}from"./p-5aad3497.js";import{p as c}from"./p-e0e2e9c1.js";import{g as h,p,t as d}from"./p-ea7fdd2e.js";import{c as g}from"./p-cd6c2938.js";import{c as m}from"./p-be086357.js";import{A as u,a as f,i as v}from"./p-33d5d1ed.js";import{d as b}from"./p-
|
|
1
|
+
import{p as t,H as e,c as s,h as i,d as a}from"./p-42200001.js";import{F as o}from"./p-1c1d0bbe.js";import{v as n}from"./p-0b3574c2.js";import{S as l}from"./p-92f420cb.js";import{C as r}from"./p-5aad3497.js";import{p as c}from"./p-e0e2e9c1.js";import{g as h,p,t as d}from"./p-ea7fdd2e.js";import{c as g}from"./p-cd6c2938.js";import{c as m}from"./p-be086357.js";import{A as u,a as f,i as v}from"./p-33d5d1ed.js";import{d as b}from"./p-4fb591c3.js";import{d as j}from"./p-5697ee30.js";import{d as y}from"./p-8a9d4e12.js";const S=c(l,["_S","_M"]);const P=c(r,["PRIMARY","NEUTRAL"]);var z;(function(t){t["BUTTON"]="button";t["SELECT"]="select"})(z||(z={}));const _={root:"gov-pagination",list:"gov-pagination__list",item:"gov-pagination__item",itemArrow:"gov-pagination__item--arrow",itemMore:"gov-pagination__item--more",itemSelect:"gov-pagination__item--select",inner:"gov-pagination__inner",arrow:"gov-pagination__arrow"};function k(t,e=1,s=10,i=10){const a=Math.ceil(t/s);if(e<1){e=1}else if(e>a){e=a}let o,n;if(a<=i){o=1;n=a}else{const t=Math.floor(i/2);const s=Math.ceil(i/2)-1;if(e<=t){o=1;n=i}else if(e+s>=a){o=a-i+1;n=a}else{o=e-t;n=e+s}}const l=(e-1)*s;const r=Math.min(l+s-1,t-1);const c=Array.from(Array(n+1-o).keys()).map((t=>o+t));return{totalItems:t,currentPage:e,pageSize:s,totalPages:a,startPage:o,endPage:n,startIndex:l,endIndex:r,pages:c}}const A=t(class t extends e{constructor(){super();this.__registerHost();this.govPage=s(this,"gov-page",7);this.type="button";this.current=1;this.total=0;this.selectIdentifier=undefined;this.size="m";this.color="primary";this.pageSize=10;this.maxPages=5;this.link=undefined;this.accessibleSelectLabel="Vybrat stranu";this.accessiblePageLabel="Strana";this.labelPrev="Přejít o stranu zpět";this.labelStart="Přejít na začátek";this.labelNext="Přejít na další stranu";this.labelEnd="Přejít na konec";this.pagination=undefined;this.inheritedAttributes={};this.h=h(this.host);this.pageSelectId=g("GovPageSelect");this.selectId=g("GovSelect")}validateType(t){n(z,t,_.root)}validateSize(t){n(S,t,_.root)}validateColor(t){n(P,t,_.root)}recalculate(){this.recalculatePagination(this.current)}componentDidLoad(){this.attributeObserver=new u(this.host,((t,e)=>{this.onAriaAttributeChange(t,e)}));this.attributeObserver.startObserving(f)}componentWillLoad(){this.recalculatePagination(this.current);this.validateSize(this.size);this.validateColor(this.color);this.inheritedAttributes=v(this.host)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,e){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:e})}recalculatePagination(t){this.pagination=k(this.total,t,this.pageSize,this.maxPages)}isActivePageClass(t,e){if(this.pagination.currentPage===e){return t+" is-active"}else{return t}}prepareLinkUrl(t){if(this.link){return String(this.link).replace("{PAGE}",String(t))}return undefined}resetSelectValue(){if(this.spreadSelectRef){this.spreadSelectRef.getRef().then((t=>{t.value="..."}))}}render(){const t=(t,e,s)=>{const a=t===-1;const o=d(this.pagination.currentPage===t?true:undefined);return i("gov-button",{href:this.prepareLinkUrl(t),color:this.color,size:this.size,type:"base",disabled:a,"on-gov-click":e=>this.onClickHandler(e,t),"aria-label":s?s:t>-1?`${this.accessiblePageLabel} ${t}`:undefined,"aria-current":o,class:_.inner,focusable:true},e)};return i(a,{class:this.h.classes(_.root),type:this.type,color:this.color,size:this.size},i("nav",Object.assign({},this.inheritedAttributes),i("ul",{class:_.list},i("li",{class:p([_.item,_.itemArrow])},t(this.pagination.currentPage>1?1:-1,i("gov-icon",{class:_.arrow,name:"chevron-double-left",type:"components"}),this.labelStart)),i("li",{class:p([_.item,_.itemArrow])},t(this.pagination.startPage<this.pagination.currentPage?this.pagination.currentPage-1:-1,i("gov-icon",{class:_.arrow,name:"chevron-left",type:"components"}),this.labelPrev)),this.type=="select"?i("li",{class:p([_.item,_.itemSelect])},i("span",{class:_.inner},i("span",{id:this.pageSelectId,hidden:true},this.accessibleSelectLabel),i("gov-form-select",{size:this.size,color:this.color,identifier:this.selectIdentifier||this.selectId,"aria-labelledby":this.pageSelectId,"on-gov-change":this.onSelectHandler.bind(this)},m(1,this.pagination.totalPages).map((t=>i("option",{value:t,selected:this.pagination.currentPage===t},t)))))):i(o,null,this.pagination.pages.map((e=>i("li",{class:this.isActivePageClass(_.item,e)},t(e,e,"")))),this.pagination.totalPages?i("li",{class:p([_.item,_.itemMore])},i("span",{class:_.inner},i("span",{id:this.pageSelectId,hidden:true},this.accessibleSelectLabel),i("gov-form-select",{size:this.size,color:this.color,identifier:this.selectIdentifier||this.selectId,"aria-labelledby":this.pageSelectId,ref:t=>this.spreadSelectRef=t,"on-gov-change":this.onSelectHandler.bind(this)},i("option",{selected:true,hidden:true},"..."),m(1,this.pagination.totalPages).map((t=>i("option",{value:t,selected:false},t)))))):null),i("li",{class:p([_.item,_.itemArrow])},t(this.pagination.totalPages>this.pagination.currentPage?this.pagination.currentPage+1:-1,i("gov-icon",{class:_.arrow,name:"chevron-right",type:"components"}),this.labelNext)),i("li",{class:p([_.item,_.itemArrow])},t(this.pagination.totalPages>this.pagination.currentPage?this.pagination.totalPages:-1,i("gov-icon",{class:_.arrow,name:"chevron-double-right",type:"components"}),this.labelEnd)))))}onClickHandler(t,e){t.stopPropagation();this.recalculatePagination(e);this.govPage.emit({component:_.root,pagination:this.pagination})}onSelectHandler(t){t.stopPropagation();const e=t.detail.value;const s=parseInt(e);this.resetSelectValue();if(isNaN(s)===false){this.recalculatePagination(s);if(this.link){window.location.href=this.prepareLinkUrl(s)}else{this.govPage.emit({component:_.root,pagination:this.pagination})}}}get host(){return this}static get watchers(){return{type:["validateType"],size:["validateSize"],color:["validateColor"],current:["recalculate"],total:["recalculate"],pageSize:["recalculate"],maxPages:["recalculate"]}}},[0,"gov-pagination",{type:[1],current:[2],total:[2],selectIdentifier:[1,"select-identifier"],size:[1],color:[1],pageSize:[2,"page-size"],maxPages:[2,"max-pages"],link:[1],accessibleSelectLabel:[1,"accessible-select-label"],accessiblePageLabel:[1,"accessible-page-label"],labelPrev:[1,"label-prev"],labelStart:[1,"label-start"],labelNext:[1,"label-next"],labelEnd:[1,"label-end"],pagination:[32],inheritedAttributes:[32]},undefined,{type:["validateType"],size:["validateSize"],color:["validateColor"],current:["recalculate"],total:["recalculate"],pageSize:["recalculate"],maxPages:["recalculate"]}]);function x(){if(typeof customElements==="undefined"){return}const t=["gov-pagination","gov-button","gov-form-select","gov-icon"];t.forEach((t=>{switch(t){case"gov-pagination":if(!customElements.get(t)){customElements.define(t,A)}break;case"gov-button":if(!customElements.get(t)){b()}break;case"gov-form-select":if(!customElements.get(t)){j()}break;case"gov-icon":if(!customElements.get(t)){y()}break}}))}x();const w=A;const E=x;export{w as GovPagination,E as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-pagination.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-b60d627f.js";const t=o;const p=s;export{t as GovSkeleton,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-skeleton.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as s,c as i,h as e,d as o}from"./p-42200001.js";import{v as a}from"./p-0b3574c2.js";import{T as r,a as n,b as h,c,d as l}from"./p-860520b0.js";import{g as d,c as f,b}from"./p-ea7fdd2e.js";import{h as
|
|
1
|
+
import{p as t,H as s,c as i,h as e,d as o}from"./p-42200001.js";import{v as a}from"./p-0b3574c2.js";import{T as r,a as n,b as h,c,d as l}from"./p-860520b0.js";import{g as d,c as f,b as p}from"./p-ea7fdd2e.js";import{h as b}from"./p-2fe7d728.js";import{p as u}from"./p-016bbea6.js";import{A as m,a as v,i as y}from"./p-33d5d1ed.js";import{d as g}from"./p-d2d05f02.js";import{d as j}from"./p-8a9d4e12.js";const k=t(class t extends s{constructor(){super();this.__registerHost();this.govChange=i(this,"gov-change",7);this.triggerRefs={};this.type="text";this.size="m";this.color="primary";this.orientation="horizontal";this.direction="row";this.controllers=[];this.focusIndex=0;this.inheritedAttributes={};this.h=d(this.host)}validateType(t){a(h,t,n.root)}validateColor(t){a(c,t,n.root)}validateSize(t){a(l,t,n.root)}componentDidLoad(){this.attributeObserver=new m(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(v)}componentWillLoad(){this.prepareControllers();this.validateSize(this.size);this.inheritedAttributes=y(this.host)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}prepareControllers(t=false){this.controllers=[];const s=[];this.host.querySelectorAll(":scope > "+r.root).forEach((t=>{const i=Promise.all([t.getIdentifier(),t.getTriggerIdentifier(),t.getDisableState()]).then((([s,i,e])=>{const o=typeof t.getAttribute("default")==="string";const a=u(t.getAttribute("icon-start"));const r=u(t.getAttribute("icon-end"));return{label:t.getAttribute("label"),direction:t.getAttribute("direction"),contentIdentifier:s,disabled:e,triggerIdentifier:i,element:t,active:false,default:o,iconStart:a,iconEnd:r}}));s.push(i)}));Promise.all(s).then((s=>{if(t===false){let t=s.findIndex((t=>t.default));if(t===-1)t=0;this.focusIndex=t;s[t].active=true}else if(this.focusIndex>-1&&b(s,this.focusIndex)){s[this.focusIndex].active=true}const i=s.findIndex((t=>t.active&&t.disabled));if(i>-1){s[i].active=false;const t=s.findIndex((t=>!t.disabled));if(t>-1){s[t].active=true;this.focusIndex=t}}this.controllers=[...s];this.reRender()}))}setActiveByIdentifier(t){const s=[];this.controllers.map((i=>{i.active=t===i.triggerIdentifier||t===i.contentIdentifier;s.push(i)}));this.controllers=[...s]}reRender(){this.controllers.map((t=>{t.element.setActiveStatus(t.active).catch()}))}render(){return e(o,{key:"a68c1ad1b08fbec4f9046547f7dedafe01948c8a",class:this.h.classes(n.root),size:this.size,color:this.color,type:this.type,direction:this.direction,onKeyDown:this.onKeydownHandler.bind(this)},e("div",Object.assign({key:"4a202effd6504ad3d432b1e10f99d192108879e1",class:n.tabs,role:"tablist"},this.inheritedAttributes),e("ul",{key:"db71e6b909138871942570fd600c6b0ef7a9ffc3",class:n.list},this.controllers.map((t=>e("li",{class:n.item},this.type=="text"?e("button",{class:n.btn,id:t.triggerIdentifier,role:"tab",type:"button",onClick:()=>this.onSelectHandler(t),disabled:t.disabled,"aria-disabled":f(t.disabled),"aria-selected":f(t.active),"aria-controls":t.contentIdentifier,tabindex:t.active&&!t.disabled?0:-1,ref:s=>this.triggerRefs[t.triggerIdentifier]=s},t.iconStart?e("gov-icon",{name:t.iconStart.name,type:t.iconStart.type}):null,t.label,t.iconEnd?e("gov-icon",{name:t.iconEnd.name,type:t.iconEnd.type}):null):e("gov-chip",{role:"tab",tag:"button",identifier:t.triggerIdentifier,"aria-selected":p(t.active),"aria-controls":t.contentIdentifier,focusable:t.active,disabled:t.disabled,color:this.color,size:this.size==="xs"?"xs":this.size==="s"?"s":"m",type:t.active?"solid":"outlined",ref:s=>this.triggerRefs[t.triggerIdentifier]=s,"on-gov-click":()=>this.onSelectHandler(t)},t.iconStart?e("gov-icon",{name:t.iconStart.name,type:t.iconStart.type,slot:"icon-start"}):null,t.label,t.iconEnd?e("gov-icon",{name:t.iconEnd.name,type:t.iconEnd.type,slot:"icon-end"}):null)))))),e("slot",{key:"44c656ecd0e6610f4861ac1f2096484baee02a55"}))}getCurrentTab(){return this.controllers.find((t=>t.active))||null}onSelectHandler(t){const s=this.controllers.findIndex((s=>s.triggerIdentifier===t.triggerIdentifier));this.focusIndex=s;this.setActiveByIdentifier(t.triggerIdentifier);this.reRender();this.govChange.emit(this.getCurrentTab().element)}onKeydownHandler(t){const s=t.keyCode;t.stopPropagation();this.goToPrevNext(s)}goToPrevNext(t){if([37,38,39,40].includes(t)){if(false===(this.focusIndex>=0&&this.focusIndex<=this.controllers.length-1)){return}this.controllers[this.focusIndex].active=false;if(t===39||t===40){this.focusIndex++;if(this.focusIndex>=this.controllers.length){this.focusIndex=0}if(this.controllers[this.focusIndex].disabled){this.goToPrevNext(40)}}else if(t===37||t===38){this.focusIndex--;if(this.focusIndex<0){this.focusIndex=this.controllers.length-1}if(this.controllers[this.focusIndex].disabled){this.goToPrevNext(38)}}if(this.focusIndex>=0&&this.focusIndex<=this.controllers.length-1){const t=this.controllers[this.focusIndex];t.active=true;const s=this.triggerRefs[t.triggerIdentifier];if(s.nodeName.toLowerCase()==="gov-chip"){this.triggerRefs[t.triggerIdentifier].setFocus()}else{this.triggerRefs[t.triggerIdentifier].focus()}this.controllers=[...this.controllers];this.reRender();this.govChange.emit(this.getCurrentTab().element)}}}async refresh(){this.prepareControllers()}async currentTab(){return this.getCurrentTab().element||null}async setActiveTab(t){this.setActiveByIdentifier(t);this.reRender()}async rerender(){this.prepareControllers(true)}get host(){return this}static get watchers(){return{type:["validateType"],color:["validateColor"],size:["validateSize"]}}},[4,"gov-tabs",{type:[1],size:[1],color:[1],orientation:[1],direction:[513],controllers:[32],focusIndex:[32],inheritedAttributes:[32],refresh:[64],currentTab:[64],setActiveTab:[64],rerender:[64]},undefined,{type:["validateType"],color:["validateColor"],size:["validateSize"]}]);function T(){if(typeof customElements==="undefined"){return}const t=["gov-tabs","gov-chip","gov-icon"];t.forEach((t=>{switch(t){case"gov-tabs":if(!customElements.get(t)){customElements.define(t,k)}break;case"gov-chip":if(!customElements.get(t)){g()}break;case"gov-icon":if(!customElements.get(t)){j()}break}}))}T();const x=k;const z=T;export{x as GovTabs,z as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-tabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GovTabs","proxyCustomElement","H","constructor","this","triggerRefs","h","govHost","host","validateType","newValue","validateProp","TabTypes","TabsClass","root","validateColor","TabColors","validateSize","TabSizes","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","prepareControllers","size","inheritedAttributes","inheritAriaAttributes","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","skipDefault","controllers","promises","querySelectorAll","TabsItemClass","forEach","tab","controlItem","Promise","all","getIdentifier","getTriggerIdentifier","getDisableState","then","identifier","triggerIdentifier","disabled","isDefault","getAttribute","iconStart","prepareIconFormat","iconEnd","label","direction","contentIdentifier","element","active","default","push","defaultTabIndex","findIndex","controller","focusIndex","hasOwnProperty","isWrongCombination","firstGoodTab","reRender","setActiveByIdentifier","temp","map","item","control","setActiveStatus","catch","render","Host","key","class","classes","color","type","onKeyDown","onKeydownHandler","bind","tabs","role","list","btn","id","onClick","onSelectHandler","toBoolAttr","tabindex","ref","el","name","tag","booleanString","focusable","slot","getCurrentTab","find","index","t","govChange","emit","e","keyCode","stopPropagation","goToPrevNext","includes","length","current","trigger","nodeName","toLowerCase","setFocus","focus","refresh","currentTab","setActiveTab","rerender"],"sources":["../../../packages/core/src/components/gov-tabs/gov-tabs.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tColorType,\n\tTabColors,\n\tTabOrientationType,\n\tTabsClass,\n\tTabsItemClass,\n\tTabSizes,\n\tTabSizeType,\n\tTabType,\n\tTabTypes\n} from \"./constants\"\nimport {GovTabControllerItem} from \"./gov-tabs.types\"\nimport {booleanString, govHost, toBoolAttr} from \"../../helpers/Dom/template\"\nimport {Nullable} from \"../../types/interfaces\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {hasOwnProperty} from \"../../utils/helpers.types\";\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\n\n\n@Component({\n\ttag: \"gov-tabs\",\n})\nexport class GovTabs {\n\tprivate h: GovHost\n\tprivate triggerRefs: Record<string, HTMLButtonElement | HTMLGovChipElement> = {}\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTabsElement\n\t/**\n\t * Tabs type\n\t */\n\t@Prop() readonly type: TabType = \"text\"\n\t/**\n\t * Tabs size.\n\t */\n\t@Prop() readonly size?: TabSizeType = 'm'\n\t/**\n\t * Style variation of the tab chips.\n\t */\n\t@Prop() readonly color?: ColorType = \"primary\"\n\t/**\n\t * Tabs orientation\n\t */\n\t@Prop() readonly orientation: TabOrientationType = \"horizontal\"\n\t/**\n\t * Icon and description display direction\n\t */\n\t@Prop({reflect: true}) readonly direction: 'row' | 'column' = 'row'\n\t/**\n\t * Emitted when the tab is changed.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<HTMLGovTabsItemElement>\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(TabTypes, newValue, TabsClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TabColors, newValue, TabsClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TabSizes, newValue, TabsClass.root)\n\t}\n\n\t@State() controllers: GovTabControllerItem[] = []\n\t@State() focusIndex = 0\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.prepareControllers()\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate prepareControllers(skipDefault = false): void {\n\t\tthis.controllers = []\n\t\tconst promises: Promise<GovTabControllerItem>[] = []\n\t\tthis.host.querySelectorAll(':scope > ' + TabsItemClass.root).forEach((tab: HTMLGovTabsItemElement) => {\n\t\t\tconst controlItem = Promise.all([\n\t\t\t\ttab.getIdentifier(),\n\t\t\t\ttab.getTriggerIdentifier(),\n\t\t\t\ttab.getDisableState()\n\t\t\t]).then(([identifier, triggerIdentifier, disabled]) => {\n\t\t\t\tconst isDefault = typeof tab.getAttribute(\"default\") === \"string\"\n\t\t\t\tconst iconStart = prepareIconFormat(tab.getAttribute('icon-start'))\n\t\t\t\tconst iconEnd = prepareIconFormat(tab.getAttribute('icon-end'))\n\t\t\t\treturn {\n\t\t\t\t\tlabel: tab.getAttribute(\"label\"),\n\t\t\t\t\tdirection: tab.getAttribute(\"direction\"),\n\t\t\t\t\tcontentIdentifier: identifier,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\ttriggerIdentifier: triggerIdentifier,\n\t\t\t\t\telement: tab,\n\t\t\t\t\tactive: false,\n\t\t\t\t\tdefault: isDefault,\n\t\t\t\t\ticonStart,\n\t\t\t\t\ticonEnd\n\t\t\t\t}\n\t\t\t})\n\t\t\tpromises.push(controlItem)\n\t\t});\n\t\tPromise.all(promises).then(controllers => {\n\t\t\tif (skipDefault === false) {\n\t\t\t\tlet defaultTabIndex = controllers.findIndex(controller => controller.default)\n\t\t\t\tif (defaultTabIndex === -1) defaultTabIndex = 0\n\t\t\t\tthis.focusIndex = defaultTabIndex\n\t\t\t\tcontrollers[defaultTabIndex].active = true\n\t\t\t} else if (this.focusIndex > -1 && hasOwnProperty(controllers, this.focusIndex)) {\n\t\t\t\tcontrollers[this.focusIndex].active = true\n\t\t\t}\n\t\t\tconst isWrongCombination = controllers.findIndex((controller) => controller.active && controller.disabled)\n\t\t\tif (isWrongCombination > -1) {\n\t\t\t\tcontrollers[isWrongCombination].active = false;\n\t\t\t\tconst firstGoodTab = controllers.findIndex((controller) => !controller.disabled)\n\t\t\t\tif (firstGoodTab > -1) {\n\t\t\t\t\tcontrollers[firstGoodTab].active = true\n\t\t\t\t\tthis.focusIndex = firstGoodTab;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.controllers = [...controllers]\n\t\t\tthis.reRender()\n\t\t})\n\t}\n\n\tprivate setActiveByIdentifier(identifier: string) {\n\t\tconst temp = []\n\t\tthis.controllers.map(item => {\n\t\t\titem.active = identifier === item.triggerIdentifier || identifier === item.contentIdentifier\n\t\t\ttemp.push(item)\n\t\t})\n\t\tthis.controllers = [...temp]\n\t}\n\n\tprivate reRender() {\n\t\tthis.controllers.map(control => {\n\t\t\tcontrol.element.setActiveStatus(control.active).catch()\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(TabsClass.root)}\n\t\t\t\tsize={this.size}\n\t\t\t\tcolor={this.color}\n\t\t\t\ttype={this.type}\n\t\t\t\tdirection={this.direction}\n\t\t\t\tonKeyDown={this.onKeydownHandler.bind(this)}\n\t\t\t>\n\t\t\t\t<div class={TabsClass.tabs}\n\t\t\t\t\t role=\"tablist\"\n\t\t\t\t\t {...this.inheritedAttributes}>\n\t\t\t\t\t<ul class={TabsClass.list}>\n\t\t\t\t\t\t{this.controllers.map(control => (\n\t\t\t\t\t\t\t<li class={TabsClass.item}>\n\t\t\t\t\t\t\t\t{this.type == \"text\" ? (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tclass={TabsClass.btn}\n\t\t\t\t\t\t\t\t\t\tid={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\taria-disabled={toBoolAttr(control.disabled)}\n\t\t\t\t\t\t\t\t\t\taria-selected={toBoolAttr(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\ttabindex={control.active && !control.disabled ? 0 : -1}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLButtonElement)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<gov-chip\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttag={'button'}\n\t\t\t\t\t\t\t\t\t\tidentifier={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\taria-selected={booleanString(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\tfocusable={control.active}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\t\t\t\t\tsize={this.size === \"xs\" ? \"xs\" : (this.size === \"s\" ? \"s\" : \"m\")}\n\t\t\t\t\t\t\t\t\t\ttype={control.active ? \"solid\" : \"outlined\"}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLGovChipElement)}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"icon-start\"></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"icon-end\"></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t</gov-chip>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate getCurrentTab(): GovTabControllerItem | null {\n\t\treturn this.controllers.find(control => control.active) || null\n\t}\n\n\tprivate onSelectHandler(control: GovTabControllerItem) {\n\t\tconst index = this.controllers.findIndex(t => t.triggerIdentifier === control.triggerIdentifier);\n\t\tthis.focusIndex = index\n\t\tthis.setActiveByIdentifier(control.triggerIdentifier)\n\t\tthis.reRender()\n\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t}\n\n\tprivate onKeydownHandler(e: KeyboardEvent) {\n\t\tconst keyCode = e.keyCode\n\n\t\te.stopPropagation()\n\t\tthis.goToPrevNext(keyCode)\n\t}\n\n\tprivate goToPrevNext(keyCode: number) {\n\t\tif ([37, 38, 39, 40].includes(keyCode)) {\n\t\t\tif (false === (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1)) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.controllers[this.focusIndex].active = false\n\n\t\t\tif (keyCode === 39 || keyCode === 40) {\n\t\t\t\tthis.focusIndex++\n\t\t\t\tif (this.focusIndex >= this.controllers.length) {\n\t\t\t\t\tthis.focusIndex = 0\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(40)\n\t\t\t\t}\n\t\t\t} else if (keyCode === 37 || keyCode === 38) {\n\t\t\t\tthis.focusIndex--\n\t\t\t\tif (this.focusIndex < 0) {\n\t\t\t\t\tthis.focusIndex = this.controllers.length - 1\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(38)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1) {\n\t\t\t\tconst current = this.controllers[this.focusIndex]\n\t\t\t\tcurrent.active = true\n\t\t\t\tconst trigger = this.triggerRefs[current.triggerIdentifier]\n\t\t\t\tif (trigger.nodeName.toLowerCase() === 'gov-chip') {\n\t\t\t\t\t(this.triggerRefs[current.triggerIdentifier] as HTMLGovChipElement).setFocus()\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerRefs[current.triggerIdentifier].focus()\n\t\t\t\t}\n\n\t\t\t\tthis.controllers = [...this.controllers]\n\t\t\t\tthis.reRender()\n\t\t\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync refresh(): Promise<void> {\n\t\tthis.prepareControllers()\n\t}\n\n\t/**\n\t * Returns the currently selected tabs-item\n\t */\n\t@Method()\n\tasync currentTab(): Promise<Nullable<HTMLGovTabsItemElement>> {\n\t\treturn this.getCurrentTab().element || null\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync setActiveTab(identifier: string): Promise<void> {\n\t\tthis.setActiveByIdentifier(identifier)\n\t\tthis.reRender()\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync rerender(): Promise<void> {\n\t\tthis.prepareControllers(true);\n\t}\n}\n"],"mappings":"oZA2BaA,EAAOC,EAAA,MAAAD,UAAAE,EAKnB,WAAAC,G,oEAHQC,KAAAC,YAAsE,G,UAW7C,O,UAIK,I,WAID,U,iBAIc,a,eAIW,M,iBAqBf,G,gBACzB,E,yBACqB,GA9C1CD,KAAKE,EAAIC,EA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ACL,GAAIjE,KAAKiE,WAAa,EAAG,CACxBjE,KAAKiE,WAAajE,KAAKkC,YAAYgF,OAAS,C,CAE7C,GAAIlH,KAAKkC,YAAYlC,KAAKiE,YAAYhB,SAAU,CAC/CjD,KAAKgH,aAAa,G,EAIpB,GAAIhH,KAAKiE,YAAc,GAAKjE,KAAKiE,YAAcjE,KAAKkC,YAAYgF,OAAS,EAAG,CAC3E,MAAMC,EAAUnH,KAAKkC,YAAYlC,KAAKiE,YACtCkD,EAAQxD,OAAS,KACjB,MAAMyD,EAAUpH,KAAKC,YAAYkH,EAAQnE,mBACzC,GAAIoE,EAAQC,SAASC,gBAAkB,WAAY,CACjDtH,KAAKC,YAAYkH,EAAQnE,mBAA0CuE,U,KAC9D,CACNvH,KAAKC,YAAYkH,EAAQnE,mBAAmBwE,O,CAG7CxH,KAAKkC,YAAc,IAAIlC,KAAKkC,aAC5BlC,KAAKqE,WACLrE,KAAK2G,UAAUC,KAAK5G,KAAKuG,gBAAgB7C,Q,GAS5C,aAAM+D,GACLzH,KAAKuB,oB,CAON,gBAAMmG,GACL,OAAO1H,KAAKuG,gBAAgB7C,SAAW,I,CAOxC,kBAAMiE,CAAa5E,GAClB/C,KAAKsE,sBAAsBvB,GAC3B/C,KAAKqE,U,CAON,cAAMuD,GACL5H,KAAKuB,mBAAmB,K","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["GovTabs","proxyCustomElement","H","constructor","this","triggerRefs","h","govHost","host","validateType","newValue","validateProp","TabTypes","TabsClass","root","validateColor","TabColors","validateSize","TabSizes","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","prepareControllers","size","inheritedAttributes","inheritAriaAttributes","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","skipDefault","controllers","promises","querySelectorAll","TabsItemClass","forEach","tab","controlItem","Promise","all","getIdentifier","getTriggerIdentifier","getDisableState","then","identifier","triggerIdentifier","disabled","isDefault","getAttribute","iconStart","prepareIconFormat","iconEnd","label","direction","contentIdentifier","element","active","default","push","defaultTabIndex","findIndex","controller","focusIndex","hasOwnProperty","isWrongCombination","firstGoodTab","reRender","setActiveByIdentifier","temp","map","item","control","setActiveStatus","catch","render","Host","key","class","classes","color","type","onKeyDown","onKeydownHandler","bind","tabs","role","list","btn","id","onClick","onSelectHandler","toBoolAttr","tabindex","ref","el","name","tag","booleanString","focusable","slot","getCurrentTab","find","index","t","govChange","emit","e","keyCode","stopPropagation","goToPrevNext","includes","length","current","trigger","nodeName","toLowerCase","setFocus","focus","refresh","currentTab","setActiveTab","rerender"],"sources":["../../../packages/core/src/components/gov-tabs/gov-tabs.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tColorType,\n\tTabColors,\n\tTabOrientationType,\n\tTabsClass,\n\tTabsItemClass,\n\tTabSizes,\n\tTabSizeType,\n\tTabType,\n\tTabTypes\n} from \"./constants\"\nimport {GovTabControllerItem} from \"./gov-tabs.types\"\nimport {booleanString, govHost, toBoolAttr} from \"../../helpers/Dom/template\"\nimport {Nullable} from \"../../types/interfaces\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {hasOwnProperty} from \"../../utils/helpers.types\";\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\n\n\n@Component({\n\ttag: \"gov-tabs\",\n})\nexport class GovTabs {\n\tprivate h: GovHost\n\tprivate triggerRefs: Record<string, HTMLButtonElement | HTMLGovChipElement> = {}\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTabsElement\n\t/**\n\t * Tabs type\n\t */\n\t@Prop() readonly type: TabType = \"text\"\n\t/**\n\t * Tabs size.\n\t */\n\t@Prop() readonly size?: TabSizeType = 'm'\n\t/**\n\t * Style variation of the tab chips.\n\t */\n\t@Prop() readonly color?: ColorType = \"primary\"\n\t/**\n\t * Tabs orientation\n\t */\n\t@Prop() readonly orientation: TabOrientationType = \"horizontal\"\n\t/**\n\t * Icon and description display direction\n\t */\n\t@Prop({reflect: true}) readonly direction: 'row' | 'column' = 'row'\n\t/**\n\t * Emitted when the tab is changed.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<HTMLGovTabsItemElement>\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(TabTypes, newValue, TabsClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TabColors, newValue, TabsClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TabSizes, newValue, TabsClass.root)\n\t}\n\n\t@State() controllers: GovTabControllerItem[] = []\n\t@State() focusIndex = 0\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.prepareControllers()\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate prepareControllers(skipDefault = false): void {\n\t\tthis.controllers = []\n\t\tconst promises: Promise<GovTabControllerItem>[] = []\n\t\tthis.host.querySelectorAll(':scope > ' + TabsItemClass.root).forEach((tab: HTMLGovTabsItemElement) => {\n\t\t\tconst controlItem = Promise.all([\n\t\t\t\ttab.getIdentifier(),\n\t\t\t\ttab.getTriggerIdentifier(),\n\t\t\t\ttab.getDisableState()\n\t\t\t]).then(([identifier, triggerIdentifier, disabled]) => {\n\t\t\t\tconst isDefault = typeof tab.getAttribute(\"default\") === \"string\"\n\t\t\t\tconst iconStart = prepareIconFormat(tab.getAttribute('icon-start'))\n\t\t\t\tconst iconEnd = prepareIconFormat(tab.getAttribute('icon-end'))\n\t\t\t\treturn {\n\t\t\t\t\tlabel: tab.getAttribute(\"label\"),\n\t\t\t\t\tdirection: tab.getAttribute(\"direction\"),\n\t\t\t\t\tcontentIdentifier: identifier,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\ttriggerIdentifier: triggerIdentifier,\n\t\t\t\t\telement: tab,\n\t\t\t\t\tactive: false,\n\t\t\t\t\tdefault: isDefault,\n\t\t\t\t\ticonStart,\n\t\t\t\t\ticonEnd\n\t\t\t\t}\n\t\t\t})\n\t\t\tpromises.push(controlItem)\n\t\t});\n\t\tPromise.all(promises).then(controllers => {\n\t\t\tif (skipDefault === false) {\n\t\t\t\tlet defaultTabIndex = controllers.findIndex(controller => controller.default)\n\t\t\t\tif (defaultTabIndex === -1) defaultTabIndex = 0\n\t\t\t\tthis.focusIndex = defaultTabIndex\n\t\t\t\tcontrollers[defaultTabIndex].active = true\n\t\t\t} else if (this.focusIndex > -1 && hasOwnProperty(controllers, this.focusIndex)) {\n\t\t\t\tcontrollers[this.focusIndex].active = true\n\t\t\t}\n\t\t\tconst isWrongCombination = controllers.findIndex((controller) => controller.active && controller.disabled)\n\t\t\tif (isWrongCombination > -1) {\n\t\t\t\tcontrollers[isWrongCombination].active = false;\n\t\t\t\tconst firstGoodTab = controllers.findIndex((controller) => !controller.disabled)\n\t\t\t\tif (firstGoodTab > -1) {\n\t\t\t\t\tcontrollers[firstGoodTab].active = true\n\t\t\t\t\tthis.focusIndex = firstGoodTab;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.controllers = [...controllers]\n\t\t\tthis.reRender()\n\t\t})\n\t}\n\n\tprivate setActiveByIdentifier(identifier: string) {\n\t\tconst temp = []\n\t\tthis.controllers.map(item => {\n\t\t\titem.active = identifier === item.triggerIdentifier || identifier === item.contentIdentifier\n\t\t\ttemp.push(item)\n\t\t})\n\t\tthis.controllers = [...temp]\n\t}\n\n\tprivate reRender() {\n\t\tthis.controllers.map(control => {\n\t\t\tcontrol.element.setActiveStatus(control.active).catch()\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(TabsClass.root)}\n\t\t\t\tsize={this.size}\n\t\t\t\tcolor={this.color}\n\t\t\t\ttype={this.type}\n\t\t\t\tdirection={this.direction}\n\t\t\t\tonKeyDown={this.onKeydownHandler.bind(this)}\n\t\t\t>\n\t\t\t\t<div class={TabsClass.tabs}\n\t\t\t\t\t role=\"tablist\"\n\t\t\t\t\t {...this.inheritedAttributes}>\n\t\t\t\t\t<ul class={TabsClass.list}>\n\t\t\t\t\t\t{this.controllers.map(control => (\n\t\t\t\t\t\t\t<li class={TabsClass.item}>\n\t\t\t\t\t\t\t\t{this.type == \"text\" ? (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tclass={TabsClass.btn}\n\t\t\t\t\t\t\t\t\t\tid={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\taria-disabled={toBoolAttr(control.disabled)}\n\t\t\t\t\t\t\t\t\t\taria-selected={toBoolAttr(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\ttabindex={control.active && !control.disabled ? 0 : -1}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLButtonElement)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<gov-chip\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttag={'button'}\n\t\t\t\t\t\t\t\t\t\tidentifier={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\taria-selected={booleanString(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\tfocusable={control.active}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\t\t\t\t\tsize={this.size === \"xs\" ? \"xs\" : (this.size === \"s\" ? \"s\" : \"m\")}\n\t\t\t\t\t\t\t\t\t\ttype={control.active ? \"solid\" : \"outlined\"}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLGovChipElement)}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"icon-start\"></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"icon-end\"></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t</gov-chip>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate getCurrentTab(): GovTabControllerItem | null {\n\t\treturn this.controllers.find(control => control.active) || null\n\t}\n\n\tprivate onSelectHandler(control: GovTabControllerItem) {\n\t\tconst index = this.controllers.findIndex(t => t.triggerIdentifier === control.triggerIdentifier);\n\t\tthis.focusIndex = index\n\t\tthis.setActiveByIdentifier(control.triggerIdentifier)\n\t\tthis.reRender()\n\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t}\n\n\tprivate onKeydownHandler(e: KeyboardEvent) {\n\t\tconst keyCode = e.keyCode\n\n\t\te.stopPropagation()\n\t\tthis.goToPrevNext(keyCode)\n\t}\n\n\tprivate goToPrevNext(keyCode: number) {\n\t\tif ([37, 38, 39, 40].includes(keyCode)) {\n\t\t\tif (false === (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1)) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.controllers[this.focusIndex].active = false\n\n\t\t\tif (keyCode === 39 || keyCode === 40) {\n\t\t\t\tthis.focusIndex++\n\t\t\t\tif (this.focusIndex >= this.controllers.length) {\n\t\t\t\t\tthis.focusIndex = 0\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(40)\n\t\t\t\t}\n\t\t\t} else if (keyCode === 37 || keyCode === 38) {\n\t\t\t\tthis.focusIndex--\n\t\t\t\tif (this.focusIndex < 0) {\n\t\t\t\t\tthis.focusIndex = this.controllers.length - 1\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(38)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1) {\n\t\t\t\tconst current = this.controllers[this.focusIndex]\n\t\t\t\tcurrent.active = true\n\t\t\t\tconst trigger = this.triggerRefs[current.triggerIdentifier]\n\t\t\t\tif (trigger.nodeName.toLowerCase() === 'gov-chip') {\n\t\t\t\t\t(this.triggerRefs[current.triggerIdentifier] as HTMLGovChipElement).setFocus()\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerRefs[current.triggerIdentifier].focus()\n\t\t\t\t}\n\n\t\t\t\tthis.controllers = [...this.controllers]\n\t\t\t\tthis.reRender()\n\t\t\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync refresh(): Promise<void> {\n\t\tthis.prepareControllers()\n\t}\n\n\t/**\n\t * Returns the currently selected tabs-item\n\t */\n\t@Method()\n\tasync currentTab(): Promise<Nullable<HTMLGovTabsItemElement>> {\n\t\treturn this.getCurrentTab().element || null\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync setActiveTab(identifier: string): Promise<void> {\n\t\tthis.setActiveByIdentifier(identifier)\n\t\tthis.reRender()\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync rerender(): Promise<void> {\n\t\tthis.prepareControllers(true);\n\t}\n}\n"],"mappings":"yZA2BaA,EAAOC,EAAA,MAAAD,UAAAE,EAKnB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,GAAIjE,KAAKkC,YAAYlC,KAAKiE,YAAYhB,SAAU,CAC/CjD,KAAKgH,aAAa,G,OAEb,GAAIF,IAAY,IAAMA,IAAY,GAAI,CAC5C9G,KAAKiE,aACL,GAAIjE,KAAKiE,WAAa,EAAG,CACxBjE,KAAKiE,WAAajE,KAAKkC,YAAYgF,OAAS,C,CAE7C,GAAIlH,KAAKkC,YAAYlC,KAAKiE,YAAYhB,SAAU,CAC/CjD,KAAKgH,aAAa,G,EAIpB,GAAIhH,KAAKiE,YAAc,GAAKjE,KAAKiE,YAAcjE,KAAKkC,YAAYgF,OAAS,EAAG,CAC3E,MAAMC,EAAUnH,KAAKkC,YAAYlC,KAAKiE,YACtCkD,EAAQxD,OAAS,KACjB,MAAMyD,EAAUpH,KAAKC,YAAYkH,EAAQnE,mBACzC,GAAIoE,EAAQC,SAASC,gBAAkB,WAAY,CACjDtH,KAAKC,YAAYkH,EAAQnE,mBAA0CuE,U,KAC9D,CACNvH,KAAKC,YAAYkH,EAAQnE,mBAAmBwE,O,CAG7CxH,KAAKkC,YAAc,IAAIlC,KAAKkC,aAC5BlC,KAAKqE,WACLrE,KAAK2G,UAAUC,KAAK5G,KAAKuG,gBAAgB7C,Q,GAS5C,aAAM+D,GACLzH,KAAKuB,oB,CAON,gBAAMmG,GACL,OAAO1H,KAAKuG,gBAAgB7C,SAAW,I,CAOxC,kBAAMiE,CAAa5E,GAClB/C,KAAKsE,sBAAsBvB,GAC3B/C,KAAKqE,U,CAON,cAAMuD,GACL5H,KAAKuB,mBAAmB,K","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,h as s,d as o}from"./p-42200001.js";import{g as a}from"./p-ea7fdd2e.js";import{v as i}from"./p-0b3574c2.js";import{a as c,c as n}from"./p-44a8a668.js";import{p as d}from"./p-e0e2e9c1.js";import{S as r}from"./p-92f420cb.js";import{p as f}from"./p-016bbea6.js";import{d as b}from"./p-
|
|
1
|
+
import{p as e,H as t,h as s,d as o}from"./p-42200001.js";import{g as a}from"./p-ea7fdd2e.js";import{v as i}from"./p-0b3574c2.js";import{a as c,c as n}from"./p-44a8a668.js";import{p as d}from"./p-e0e2e9c1.js";import{S as r}from"./p-92f420cb.js";import{p as f}from"./p-016bbea6.js";import{d as b}from"./p-8a9d4e12.js";const m=d(r,["_XS","_S","_M"]);var l;(function(e){e["BOLD"]="bold";e["SUBTLE"]="subtle"})(l||(l={}));const p={root:"gov-tag"};const h=e(class e extends t{constructor(){super();this.__registerHost();this.iconStart=undefined;this.iconEnd=undefined;this.size=m._S;this.color=c.PRIMARY;this.type=undefined;this.expanded=false;this.h=a(this.host)}validateColor(e){i(c,e,p.root)}validateSize(e){i(n,e,p.root)}componentWillLoad(){this.validateColor(this.color);this.validateSize(this.size)}render(){const e=f(this.iconStart);const t=f(this.iconEnd);return s(o,{key:"df3988a7cb0dbf8e7ee418918e9f65e7cca6ba87",class:this.h.classes(p.root),color:this.color,size:this.size,type:this.type},s("span",{key:"bcb9b024178012722badffe0b0faaf79e2e8a933",class:"element"},s("slot",{key:"2651a7dbce1b7a893dfc703e1393235286353e4b",name:"icon-start"},e&&s("gov-icon",{key:"111e55c5ee1edaf6b578af8f37667e18c4d2487c",type:e.type,name:e.name})),s("slot",{key:"fb60c7f3f3f25168f062134a93c4c4bb039fc29b"}),s("slot",{key:"20e64ee3addb1e45de10d486d25d7f024725626e",name:"icon-end"},t&&s("gov-icon",{key:"e11b23de2ce9b35a27367c7ba7bb1b907bded75b",type:t.type,name:t.name}))))}get host(){return this}static get watchers(){return{color:["validateColor"],size:["validateSize"]}}},[4,"gov-tag",{iconStart:[1,"icon-start"],iconEnd:[1,"icon-end"],size:[513],color:[513],type:[513],expanded:[516]},undefined,{color:["validateColor"],size:["validateSize"]}]);function u(){if(typeof customElements==="undefined"){return}const e=["gov-tag","gov-icon"];e.forEach((e=>{switch(e){case"gov-tag":if(!customElements.get(e)){customElements.define(e,h)}break;case"gov-icon":if(!customElements.get(e)){b()}break}}))}u();const v=h;const g=u;export{v as GovTag,g as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-tag.js.map
|