@gov-design-system-ce/components 4.0.8-rc05 → 4.0.8-rc06
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +5 -2
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +5 -2
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-chip.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/{p-f8a108f1.js → p-245d3ff5.js} +2 -2
- package/dist/components/{p-09b12418.js → p-281b05f0.js} +2 -2
- package/dist/components/{p-b5408874.js → p-5a96fe7a.js} +2 -2
- package/dist/components/{p-0f5aceff.js → p-7677b93a.js} +2 -2
- package/dist/components/{p-0576bf44.js → p-86a37e8c.js} +2 -2
- package/dist/components/p-86a37e8c.js.map +1 -0
- package/dist/components/{p-d58ed95a.js → p-98464833.js} +2 -2
- package/dist/components/{p-36d7ce72.js → p-d3271ba4.js} +2 -2
- package/dist/core/core.esm.js +1 -1
- package/dist/core/{p-3d980231.entry.js → p-2254b2ef.entry.js} +2 -2
- package/dist/core/{p-d2da3db9.entry.js → p-cdd77b6c.entry.js} +2 -2
- package/dist/core/p-cdd77b6c.entry.js.map +1 -0
- package/dist/esm/gov-form-autocomplete.entry.js +5 -2
- package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/globals.d.ts +2 -0
- package/dist/hydrate/index.js +5 -2
- package/dist/types/types/typings.d.ts +6 -0
- package/package.json +1 -1
- package/dist/components/p-0576bf44.js.map +0 -1
- package/dist/core/p-d2da3db9.entry.js.map +0 -1
- /package/dist/components/{p-f8a108f1.js.map → p-245d3ff5.js.map} +0 -0
- /package/dist/components/{p-09b12418.js.map → p-281b05f0.js.map} +0 -0
- /package/dist/components/{p-b5408874.js.map → p-5a96fe7a.js.map} +0 -0
- /package/dist/components/{p-0f5aceff.js.map → p-7677b93a.js.map} +0 -0
- /package/dist/components/{p-d58ed95a.js.map → p-98464833.js.map} +0 -0
- /package/dist/components/{p-36d7ce72.js.map → p-d3271ba4.js.map} +0 -0
- /package/dist/core/{p-3d980231.entry.js.map → p-2254b2ef.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as o,c as i,h as a,d as l}from"./p-2dee9951.js";import{c as r}from"./p-24636c53.js";import{g as t,a as s,t as f}from"./p-c353678b.js";import{b as n,c as m}from"./p-4ff831e3.js";import{c as d}from"./p-003e6cca.js";import{d as g}from"./p-03990da5.js";import{g as v}from"./p-f04382c3.js";import{d as h}from"./p-b9ee51d6.js";import{d as c}from"./p-b5408874.js";import{d as _}from"./p-36d7ce72.js";import{d as b}from"./p-033f8bda.js";import{d as p}from"./p-09b12418.js";const u={root:"gov-form-file",area:"gov-form-file__area",label:"gov-form-file__label",input:"gov-form-file__input",list:"gov-form-file__list",item:"gov-form-file__item",attachments:"gov-form-file__attachments"};function x(e){const o=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let i=0,a=parseInt(e,10)||0;while(a>=1024&&++i){a=a/1024}return a.toFixed(a<10&&i>0?1:0)+" "+o[i]}function y(e,o){if(typeof o==="string"&&o.length){return o.replace(/\s/g,"").split(",").filter((o=>new RegExp(o.replace("*",".*")).test(e.type))).length>0}else{return true}}function w(e,o){const i=Math.round(e.size);return i<=o}const k='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-file{position:relative;display:block;width:100%}.gov-form-file__label .gov-form-label__label>*:last-child{margin-bottom:0}.gov-form-file__input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0.0001;cursor:pointer}.gov-form-file__attachments{margin-top:1rem 0rem 0rem}.gov-form-file__item{display:flex;gap:1rem;align-items:center}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label{pointer-events:none}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label *{color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}.gov-form-file[expanded=""] .gov-form-file__area,.gov-form-file[expanded=true i] .gov-form-file__area,.gov-form-file[expanded="1"] .gov-form-file__area{position:relative;width:100%;padding:2rem 1.375rem 1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center;transition:background-color 150ms ease-in-out;will-change:background-color}.gov-form-file[expanded=""] .gov-form-file__area.highlight,.gov-form-file[expanded=true i] .gov-form-file__area.highlight,.gov-form-file[expanded="1"] .gov-form-file__area.highlight{background-color:var(--gov-color-primary-200)}.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{width:100%;padding:1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center}.gov-form-file[expanded=""] .gov-form-file__attachments,.gov-form-file[expanded=true i] .gov-form-file__attachments,.gov-form-file[expanded="1"] .gov-form-file__attachments{margin:1.5rem 0rem 0rem}.gov-form-file[expanded=""][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__label .gov-form-label__label{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][invalid=""] .gov-form-file__area,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__area,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__area{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][disabled=""] .gov-form-file__area,.gov-form-file[expanded=""][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=""][disabled="1"] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=""] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=true i][disabled="1"] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=""] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=true i] .gov-form-file__area,.gov-form-file[expanded="1"][disabled="1"] .gov-form-file__area{pointer-events:none;color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}@media (min-width: 30em){.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{padding:2rem}}';const E=e(class e extends o{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govFiles=i(this,"gov-files",7);this.govAddFile=i(this,"gov-add-file",7);this.govRemoveFile=i(this,"gov-remove-file",7);this.expanded=false;this.required=false;this.disabled=false;this.resetAfterPick=true;this.ignoreFileDuplicationCheck=false;this.displayAttachments=true;this.name=undefined;this.accept=undefined;this.multiple=false;this.maxFileSize=-1;this.identifier=undefined;this.invalid=undefined;this.errorSize="Soubor je větší než povolená velikost {FILE_SIZE}";this.errorAccept="Soubor tohoto typu není povolen";this.attachmentsLabel="Přílohy";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagRemoveLabel="Odebrat soubor {FILE_NAME}";this.wcagAttachmentsLabel="Přílohy";this.files=[];this.fileId=r("GovInputFile");this.h=t(this.host);this.f=v(this.h)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("invalid",s(this.invalid));this.f.passAttrToControl("type","File")}registerListeners(){function e(){this.areaRef.classList.add("highlight")}function o(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(e=>{e.preventDefault();e.stopPropagation();const o=e.target.files;if(this.resetAfterPick){if(o.length){this.validateFiles(o)}}else{this.validateFiles(o)}}),false);if(this.expanded){const i=["dragover","dragleave"];const a=["dragenter","dragover","mouseenter"];const l=["dragleave","drop","mouseleave"];i.map((e=>this.inputRef.addEventListener(e,this.preventDefaults.bind(this),false)));a.map((o=>this.inputRef.addEventListener(o,e.bind(this),false)));l.forEach((e=>this.inputRef.addEventListener(e,o.bind(this),false)));this.areaRef.addEventListener("drop",this.handleDrop.bind(this),false)}}preventDefaults(e){e.preventDefault();e.stopPropagation()}handleDrop(e){const o=e.dataTransfer;this.validateFiles(o.files)}validateFiles(e){let o=[];Array.from(e).map((e=>{const i=this.files.find((o=>o.file.name===e.name&&o.file.size===e.size))||null;if(i===null||this.ignoreFileDuplicationCheck){const i=typeof this.maxFileSize==="number"&&this.maxFileSize>0?w(e,this.maxFileSize):true;const a=y(e,this.accept);const l={id:r("GovFormFile"),file:e,acceptValid:a,sizeValid:i};if(this.displayAttachments){this.files=[...this.files,l]}else{o=[...o,l]}this.govAddFile.emit({component:u.root,file:l})}}));this.govFiles.emit({component:u.root,files:o.length?o:this.files});if(this.resetAfterPick){this.reset().finally()}}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.watchDisabled()}async componentDidRender(){if(d()){await g(500);await this.validateWcag()}this.registerListeners()}render(){return a(l,{class:this.h.classes([u.root]),invalid:f(this.invalid),expanded:f(this.expanded)},a("div",{class:u.area,ref:e=>this.areaRef=e},a("slot",null),a("input",{class:u.input,ref:e=>this.inputRef=e,id:this.identifier||this.fileId,type:"file",name:this.name,accept:this.accept,multiple:this.multiple,onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,"aria-required":f(this.required),"aria-invalid":f(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":f(this.disabled)})),this.h.hasSlot("attachments")?a("div",{class:u.attachments},a("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?a("div",{class:u.attachments},a("gov-attachments",{label:this.wcagAttachmentsLabel,"wcag-label":this.wcagAttachmentsLabel},this.files.map((e=>a("gov-attachments-item",{"wcag-remove-labelled-by":e.id,"on-gov-remove":()=>this.onRemoveFileHandler(e)},a("span",{class:"sr-only",id:e.id},this.wcagRemoveLabel.replace("{FILE_NAME}",e.file.name)),e.file.name,e.acceptValid===false?a("gov-form-message",{slot:"message",variant:"error"},a("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),e.acceptValid===false?this.errorAccept:null):null,e.sizeValid===false?a("gov-form-message",{slot:"message",variant:"error"},a("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),this.errorSize.replace("{FILE_SIZE}",x(this.maxFileSize))):null,a("span",{slot:"info"},"(",x(e.file.size),")")))))):null)}onRemoveFileHandler(e){const o=this.files.findIndex((o=>o.id===e.id));if(o!==-1){const e=this.files;const i=this.files[o];e.splice(o,1);this.files=[...e];this.govRemoveFile.emit({component:u.root,file:i});this.govFiles.emit({component:u.root,files:e})}}onFocusHandler(e){e.stopPropagation();this.govFocus.emit({component:u.root,originalEvent:e})}onBlurHandler(e){e.stopPropagation();this.govBlur.emit({component:u.root,originalEvent:e})}onChangeHandler(e){e.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async reset(){this.files=[];this.inputRef.value=""}async validateWcag(){n(this.wcagDescribedBy,"wcag-described-by",u.root);n(this.wcagLabelledBy,"wcag-labelled-by",u.root);m(this.identifier||this.fileId,this.wcagLabelledBy,u.root)}get host(){return this}static get watchers(){return{disabled:["watchDisabled"],invalid:["watchDisabled"]}}static get style(){return k}},[4,"gov-form-file",{expanded:[4],required:[4],disabled:[4],resetAfterPick:[4,"reset-after-pick"],ignoreFileDuplicationCheck:[4,"ignore-file-duplication-check"],displayAttachments:[4,"display-attachments"],name:[1],accept:[1],multiple:[4],maxFileSize:[2,"max-file-size"],identifier:[1],invalid:[4],errorSize:[1,"error-size"],errorAccept:[1,"error-accept"],attachmentsLabel:[1,"attachments-label"],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagRemoveLabel:[1,"wcag-remove-label"],wcagAttachmentsLabel:[1,"wcag-attachments-label"],files:[32],getRef:[64],getAreaRef:[64],reset:[64],validateWcag:[64]}]);function F(){if(typeof customElements==="undefined"){return}const e=["gov-form-file","gov-attachments","gov-attachments-item","gov-button","gov-form-message","gov-icon"];e.forEach((e=>{switch(e){case"gov-form-file":if(!customElements.get(e)){customElements.define(e,E)}break;case"gov-attachments":if(!customElements.get(e)){h()}break;case"gov-attachments-item":if(!customElements.get(e)){c()}break;case"gov-button":if(!customElements.get(e)){_()}break;case"gov-form-message":if(!customElements.get(e)){b()}break;case"gov-icon":if(!customElements.get(e)){p()}break}}))}F();const j=E;const B=F;export{j as GovFormFile,B as defineCustomElement};
|
|
1
|
+
import{p as e,H as o,c as i,h as a,d as l}from"./p-2dee9951.js";import{c as r}from"./p-24636c53.js";import{g as t,a as s,t as f}from"./p-c353678b.js";import{b as n,c as m}from"./p-4ff831e3.js";import{c as d}from"./p-003e6cca.js";import{d as g}from"./p-03990da5.js";import{g as v}from"./p-f04382c3.js";import{d as h}from"./p-b9ee51d6.js";import{d as c}from"./p-5a96fe7a.js";import{d as _}from"./p-d3271ba4.js";import{d as b}from"./p-033f8bda.js";import{d as p}from"./p-281b05f0.js";const u={root:"gov-form-file",area:"gov-form-file__area",label:"gov-form-file__label",input:"gov-form-file__input",list:"gov-form-file__list",item:"gov-form-file__item",attachments:"gov-form-file__attachments"};function x(e){const o=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let i=0,a=parseInt(e,10)||0;while(a>=1024&&++i){a=a/1024}return a.toFixed(a<10&&i>0?1:0)+" "+o[i]}function y(e,o){if(typeof o==="string"&&o.length){return o.replace(/\s/g,"").split(",").filter((o=>new RegExp(o.replace("*",".*")).test(e.type))).length>0}else{return true}}function w(e,o){const i=Math.round(e.size);return i<=o}const k='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-file{position:relative;display:block;width:100%}.gov-form-file__label .gov-form-label__label>*:last-child{margin-bottom:0}.gov-form-file__input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;opacity:0.0001;cursor:pointer}.gov-form-file__attachments{margin-top:1rem 0rem 0rem}.gov-form-file__item{display:flex;gap:1rem;align-items:center}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label{pointer-events:none}.gov-form-file[disabled=""] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled=true i] .gov-form-file__label .gov-form-label__label *,.gov-form-file[disabled="1"] .gov-form-file__label .gov-form-label__label *{color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}.gov-form-file[expanded=""] .gov-form-file__area,.gov-form-file[expanded=true i] .gov-form-file__area,.gov-form-file[expanded="1"] .gov-form-file__area{position:relative;width:100%;padding:2rem 1.375rem 1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center;transition:background-color 150ms ease-in-out;will-change:background-color}.gov-form-file[expanded=""] .gov-form-file__area.highlight,.gov-form-file[expanded=true i] .gov-form-file__area.highlight,.gov-form-file[expanded="1"] .gov-form-file__area.highlight{background-color:var(--gov-color-primary-200)}.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{width:100%;padding:1.375rem;border:var(--gov-form-file-border, 0.0625rem dashed var(--gov-color-secondary-500));text-align:center}.gov-form-file[expanded=""] .gov-form-file__attachments,.gov-form-file[expanded=true i] .gov-form-file__attachments,.gov-form-file[expanded="1"] .gov-form-file__attachments{margin:1.5rem 0rem 0rem}.gov-form-file[expanded=""][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__label .gov-form-label__label{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][invalid=""] .gov-form-file__area,.gov-form-file[expanded=""][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=""][invalid="1"] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=""] .gov-form-file__area,.gov-form-file[expanded=true i][invalid=true i] .gov-form-file__area,.gov-form-file[expanded=true i][invalid="1"] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=""] .gov-form-file__area,.gov-form-file[expanded="1"][invalid=true i] .gov-form-file__area,.gov-form-file[expanded="1"][invalid="1"] .gov-form-file__area{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-file[expanded=""][disabled=""] .gov-form-file__area,.gov-form-file[expanded=""][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=""][disabled="1"] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=""] .gov-form-file__area,.gov-form-file[expanded=true i][disabled=true i] .gov-form-file__area,.gov-form-file[expanded=true i][disabled="1"] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=""] .gov-form-file__area,.gov-form-file[expanded="1"][disabled=true i] .gov-form-file__area,.gov-form-file[expanded="1"][disabled="1"] .gov-form-file__area{pointer-events:none;color:var(--gov-form-file-disabled-color, var(--gov-color-secondary-600))}@media (min-width: 30em){.gov-form-file[expanded=""] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded=true i] .gov-form-file__label .gov-form-label__label,.gov-form-file[expanded="1"] .gov-form-file__label .gov-form-label__label{padding:2rem}}';const E=e(class e extends o{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govFiles=i(this,"gov-files",7);this.govAddFile=i(this,"gov-add-file",7);this.govRemoveFile=i(this,"gov-remove-file",7);this.expanded=false;this.required=false;this.disabled=false;this.resetAfterPick=true;this.ignoreFileDuplicationCheck=false;this.displayAttachments=true;this.name=undefined;this.accept=undefined;this.multiple=false;this.maxFileSize=-1;this.identifier=undefined;this.invalid=undefined;this.errorSize="Soubor je větší než povolená velikost {FILE_SIZE}";this.errorAccept="Soubor tohoto typu není povolen";this.attachmentsLabel="Přílohy";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagRemoveLabel="Odebrat soubor {FILE_NAME}";this.wcagAttachmentsLabel="Přílohy";this.files=[];this.fileId=r("GovInputFile");this.h=t(this.host);this.f=v(this.h)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("invalid",s(this.invalid));this.f.passAttrToControl("type","File")}registerListeners(){function e(){this.areaRef.classList.add("highlight")}function o(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(e=>{e.preventDefault();e.stopPropagation();const o=e.target.files;if(this.resetAfterPick){if(o.length){this.validateFiles(o)}}else{this.validateFiles(o)}}),false);if(this.expanded){const i=["dragover","dragleave"];const a=["dragenter","dragover","mouseenter"];const l=["dragleave","drop","mouseleave"];i.map((e=>this.inputRef.addEventListener(e,this.preventDefaults.bind(this),false)));a.map((o=>this.inputRef.addEventListener(o,e.bind(this),false)));l.forEach((e=>this.inputRef.addEventListener(e,o.bind(this),false)));this.areaRef.addEventListener("drop",this.handleDrop.bind(this),false)}}preventDefaults(e){e.preventDefault();e.stopPropagation()}handleDrop(e){const o=e.dataTransfer;this.validateFiles(o.files)}validateFiles(e){let o=[];Array.from(e).map((e=>{const i=this.files.find((o=>o.file.name===e.name&&o.file.size===e.size))||null;if(i===null||this.ignoreFileDuplicationCheck){const i=typeof this.maxFileSize==="number"&&this.maxFileSize>0?w(e,this.maxFileSize):true;const a=y(e,this.accept);const l={id:r("GovFormFile"),file:e,acceptValid:a,sizeValid:i};if(this.displayAttachments){this.files=[...this.files,l]}else{o=[...o,l]}this.govAddFile.emit({component:u.root,file:l})}}));this.govFiles.emit({component:u.root,files:o.length?o:this.files});if(this.resetAfterPick){this.reset().finally()}}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.watchDisabled()}async componentDidRender(){if(d()){await g(500);await this.validateWcag()}this.registerListeners()}render(){return a(l,{class:this.h.classes([u.root]),invalid:f(this.invalid),expanded:f(this.expanded)},a("div",{class:u.area,ref:e=>this.areaRef=e},a("slot",null),a("input",{class:u.input,ref:e=>this.inputRef=e,id:this.identifier||this.fileId,type:"file",name:this.name,accept:this.accept,multiple:this.multiple,onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,"aria-required":f(this.required),"aria-invalid":f(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":f(this.disabled)})),this.h.hasSlot("attachments")?a("div",{class:u.attachments},a("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?a("div",{class:u.attachments},a("gov-attachments",{label:this.wcagAttachmentsLabel,"wcag-label":this.wcagAttachmentsLabel},this.files.map((e=>a("gov-attachments-item",{"wcag-remove-labelled-by":e.id,"on-gov-remove":()=>this.onRemoveFileHandler(e)},a("span",{class:"sr-only",id:e.id},this.wcagRemoveLabel.replace("{FILE_NAME}",e.file.name)),e.file.name,e.acceptValid===false?a("gov-form-message",{slot:"message",variant:"error"},a("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),e.acceptValid===false?this.errorAccept:null):null,e.sizeValid===false?a("gov-form-message",{slot:"message",variant:"error"},a("gov-icon",{slot:"icon",name:"exclamation-triangle-fill"}),this.errorSize.replace("{FILE_SIZE}",x(this.maxFileSize))):null,a("span",{slot:"info"},"(",x(e.file.size),")")))))):null)}onRemoveFileHandler(e){const o=this.files.findIndex((o=>o.id===e.id));if(o!==-1){const e=this.files;const i=this.files[o];e.splice(o,1);this.files=[...e];this.govRemoveFile.emit({component:u.root,file:i});this.govFiles.emit({component:u.root,files:e})}}onFocusHandler(e){e.stopPropagation();this.govFocus.emit({component:u.root,originalEvent:e})}onBlurHandler(e){e.stopPropagation();this.govBlur.emit({component:u.root,originalEvent:e})}onChangeHandler(e){e.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async reset(){this.files=[];this.inputRef.value=""}async validateWcag(){n(this.wcagDescribedBy,"wcag-described-by",u.root);n(this.wcagLabelledBy,"wcag-labelled-by",u.root);m(this.identifier||this.fileId,this.wcagLabelledBy,u.root)}get host(){return this}static get watchers(){return{disabled:["watchDisabled"],invalid:["watchDisabled"]}}static get style(){return k}},[4,"gov-form-file",{expanded:[4],required:[4],disabled:[4],resetAfterPick:[4,"reset-after-pick"],ignoreFileDuplicationCheck:[4,"ignore-file-duplication-check"],displayAttachments:[4,"display-attachments"],name:[1],accept:[1],multiple:[4],maxFileSize:[2,"max-file-size"],identifier:[1],invalid:[4],errorSize:[1,"error-size"],errorAccept:[1,"error-accept"],attachmentsLabel:[1,"attachments-label"],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagRemoveLabel:[1,"wcag-remove-label"],wcagAttachmentsLabel:[1,"wcag-attachments-label"],files:[32],getRef:[64],getAreaRef:[64],reset:[64],validateWcag:[64]}]);function F(){if(typeof customElements==="undefined"){return}const e=["gov-form-file","gov-attachments","gov-attachments-item","gov-button","gov-form-message","gov-icon"];e.forEach((e=>{switch(e){case"gov-form-file":if(!customElements.get(e)){customElements.define(e,E)}break;case"gov-attachments":if(!customElements.get(e)){h()}break;case"gov-attachments-item":if(!customElements.get(e)){c()}break;case"gov-button":if(!customElements.get(e)){_()}break;case"gov-form-message":if(!customElements.get(e)){b()}break;case"gov-icon":if(!customElements.get(e)){p()}break}}))}F();const j=E;const B=F;export{j as GovFormFile,B as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-file.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-245d3ff5.js";const t=o;const f=s;export{t as GovFormInput,f as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-input.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as i,h as o,d as r}from"./p-2dee9951.js";import{g as s,j as l,k as c,l as n}from"./p-f04382c3.js";import{g as m,a,t as g}from"./p-c353678b.js";import{c as v}from"./p-003e6cca.js";import{v as u}from"./p-dcb5fb35.js";import{b as f,c as d}from"./p-4ff831e3.js";import{c as h,r as p}from"./p-24636c53.js";import{d as z}from"./p-03990da5.js";import{p as x}from"./p-ab5a13ea.js";import{t as w}from"./p-8fcc8483.js";import{d as b}from"./p-36d7ce72.js";import{d as y}from"./p-0576bf44.js";import{d as k}from"./p-f8a108f1.js";import{d as _}from"./p-09b12418.js";const j='.gov-form-multi-select__list{margin:0;padding:0}.gov-form-multi-select__list>.gov-form-multi-select__item{margin:0;padding:0;background:none}.gov-form-multi-select__list>.gov-form-multi-select__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-multi-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-multi-select .element{position:relative;display:flex;flex:1 1 auto}.gov-form-multi-select input,.gov-form-multi-select select,.gov-form-multi-select textarea{width:100%;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));font-family:var(--gov-font-family, "Roboto", sans-serif)}.gov-form-multi-select input:focus,.gov-form-multi-select select:focus,.gov-form-multi-select textarea:focus{outline:none}.gov-form-multi-select input:focus-visible,.gov-form-multi-select select:focus-visible,.gov-form-multi-select textarea:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-form-multi-select input::-moz-placeholder,.gov-form-multi-select select::-moz-placeholder,.gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select input::placeholder,.gov-form-multi-select select::placeholder,.gov-form-multi-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select textarea{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);padding:0.5rem 0.75rem;resize:none}.gov-form-multi-select *[slot=left-icon],.gov-form-multi-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-multi-select *[slot=left-icon]{left:0}.gov-form-multi-select *[slot=right-icon]{right:0}.gov-form-multi-select *[slot=prefix],.gov-form-multi-select *[slot=sufix]{margin:0}[size=s].gov-form-multi-select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);gap:0.5rem var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select input,[size=s].gov-form-multi-select select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);height:var(--gov-form-input-core-s-height, 2rem);padding:var(--gov-form-input-core-s-padding, 0.25rem 0.75rem)}[size=s].gov-form-multi-select *[slot=left-icon],[size=s].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-s-icon-size, 1rem);height:var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=right-icon]~input,[size=s].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select input,[size=m].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-multi-select *[slot=left-icon],[size=m].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=right-icon]~input,[size=m].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select input,[size=l].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-multi-select *[slot=left-icon],[size=l].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=right-icon]~input,[size=l].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-multi-select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select input,[size=xl].gov-form-multi-select select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-multi-select *[slot=left-icon],[size=xl].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=right-icon]~input,[size=xl].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-multi-select input,[variant=primary].gov-form-multi-select select,[variant=primary].gov-form-multi-select textarea{color:var(--gov-form-input-color-primary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}[variant=primary].gov-form-multi-select *[slot=left-icon],[variant=primary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-multi-select input,[variant=secondary].gov-form-multi-select select,[variant=secondary].gov-form-multi-select textarea{color:var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}[variant=secondary].gov-form-multi-select *[slot=left-icon],[variant=secondary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-multi-select,[disabled=true i].gov-form-multi-select,[disabled="1"].gov-form-multi-select{pointer-events:none}[disabled=""].gov-form-multi-select input,[disabled=""].gov-form-multi-select select,[disabled=""].gov-form-multi-select textarea,[disabled=true i].gov-form-multi-select input,[disabled=true i].gov-form-multi-select select,[disabled=true i].gov-form-multi-select textarea,[disabled="1"].gov-form-multi-select input,[disabled="1"].gov-form-multi-select select,[disabled="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-multi-select *[slot=left-icon],[disabled=""].gov-form-multi-select *[slot=right-icon],[disabled=true i].gov-form-multi-select *[slot=left-icon],[disabled=true i].gov-form-multi-select *[slot=right-icon],[disabled="1"].gov-form-multi-select *[slot=left-icon],[disabled="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600)) !important}[invalid=""].gov-form-multi-select input,[invalid=""].gov-form-multi-select select,[invalid=""].gov-form-multi-select textarea,[invalid=true i].gov-form-multi-select input,[invalid=true i].gov-form-multi-select select,[invalid=true i].gov-form-multi-select textarea,[invalid="1"].gov-form-multi-select input,[invalid="1"].gov-form-multi-select select,[invalid="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-multi-select input::-moz-placeholder,[invalid=""].gov-form-multi-select select::-moz-placeholder,[invalid=""].gov-form-multi-select textarea::-moz-placeholder,[invalid=true i].gov-form-multi-select input::-moz-placeholder,[invalid=true i].gov-form-multi-select select::-moz-placeholder,[invalid=true i].gov-form-multi-select textarea::-moz-placeholder,[invalid="1"].gov-form-multi-select input::-moz-placeholder,[invalid="1"].gov-form-multi-select select::-moz-placeholder,[invalid="1"].gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select input::placeholder,[invalid=""].gov-form-multi-select select::placeholder,[invalid=""].gov-form-multi-select textarea::placeholder,[invalid=true i].gov-form-multi-select input::placeholder,[invalid=true i].gov-form-multi-select select::placeholder,[invalid=true i].gov-form-multi-select textarea::placeholder,[invalid="1"].gov-form-multi-select input::placeholder,[invalid="1"].gov-form-multi-select select::placeholder,[invalid="1"].gov-form-multi-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select *[slot=left-icon],[invalid=""].gov-form-multi-select *[slot=right-icon],[invalid=true i].gov-form-multi-select *[slot=left-icon],[invalid=true i].gov-form-multi-select *[slot=right-icon],[invalid="1"].gov-form-multi-select *[slot=left-icon],[invalid="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error)) !important}[invalid=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[multiline=""].gov-form-multi-select *[slot=left-icon],[multiline=""].gov-form-multi-select *[slot=right-icon],[multiline=true i].gov-form-multi-select *[slot=left-icon],[multiline=true i].gov-form-multi-select *[slot=right-icon],[multiline="1"].gov-form-multi-select *[slot=left-icon],[multiline="1"].gov-form-multi-select *[slot=right-icon]{display:none}.gov-form-multi-select{background:none}.gov-form-multi-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-multi-select select::-ms-expand{display:none}[size=s].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-s-arrow-right-position, 0.75rem);width:var(--gov-form-select-s-arrow-size, 0.75rem);height:var(--gov-form-select-s-arrow-size, 0.75rem)}[size=s][invalid=""].gov-form-multi-select .icon-arrow,[size=s][invalid=true i].gov-form-multi-select .icon-arrow,[size=s][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=s][success=""].gov-form-multi-select .icon-arrow,[size=s][success=true i].gov-form-multi-select .icon-arrow,[size=s][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=m].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-m-arrow-right-position, 1rem);width:var(--gov-form-select-m-arrow-size, 0.75rem);height:var(--gov-form-select-m-arrow-size, 0.75rem)}[size=m][invalid=""].gov-form-multi-select .icon-arrow,[size=m][invalid=true i].gov-form-multi-select .icon-arrow,[size=m][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=m][success=""].gov-form-multi-select .icon-arrow,[size=m][success=true i].gov-form-multi-select .icon-arrow,[size=m][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=l].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-l-arrow-right-position, 1rem);width:var(--gov-form-select-l-arrow-size, 1rem);height:var(--gov-form-select-l-arrow-size, 1rem)}[size=l][invalid=""].gov-form-multi-select .icon-arrow,[size=l][invalid=true i].gov-form-multi-select .icon-arrow,[size=l][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=l][success=""].gov-form-multi-select .icon-arrow,[size=l][success=true i].gov-form-multi-select .icon-arrow,[size=l][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=xl].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-xl-arrow-right-position, 1.3125rem);width:var(--gov-form-select-xl-arrow-size, 1rem);height:var(--gov-form-select-xl-arrow-size, 1rem)}[size=xl][invalid=""].gov-form-multi-select .icon-arrow,[size=xl][invalid=true i].gov-form-multi-select .icon-arrow,[size=xl][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=xl][success=""].gov-form-multi-select .icon-arrow,[size=xl][success=true i].gov-form-multi-select .icon-arrow,[size=xl][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=s][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=m][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=l][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}.gov-form-multi-select{flex-wrap:wrap}.gov-form-multi-select__wrap{display:flex;align-items:center;gap:0.5rem;width:100%}.gov-form-multi-select__list{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:flex;gap:0.5rem;flex-wrap:wrap}.gov-form-multi-select__list>.gov-form-multi-select__item{position:relative;display:flex;flex:0 0 auto;align-items:center;padding:0rem 0rem 0rem 0.5rem;background:var(--gov-form-multiselect-bg, var(--gov-color-primary-200));transition:150ms linear background-color}';const E=e(class e extends t{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govChange=i(this,"gov-change",7);this.govSelect=i(this,"gov-select",7);this.govRemove=i(this,"gov-remove",7);this.value=undefined;this.options=undefined;this.identifier=undefined;this.placeholder=undefined;this.variant=undefined;this.size="m";this.name=undefined;this.hideSelectedList=false;this.required=false;this.disabled=false;this.invalid=undefined;this.success=undefined;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.messageLoading="Načítám...";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.valueState=undefined;this.selectedOptionsState=[];this.optionsState=[];this.selectId=h("GovSelect");this.listId=h("GovMultiList");this.h=m(this.host);this.f=s(this.h)}validateVariant(e){u(c,e,l.root)}validateSize(e){u(n,e,l.root)}watchOptions(e){this.optionsState=x(e)}watchValue(e){this.selectedOptionsState=x(e)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",a(this.invalid));this.f.passAttrToControl("success",a(this.success))}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.watchDisabled();this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));this.optionsState=x(this.options);this.selectedOptionsState=x(this.value)}getAvailableOptions(e=false){if(Array.isArray(this.optionsState)&&this.optionsState.length){if(e){return this.optionsState}return this.optionsState.filter((e=>{const t=this.selectedValueIndex(e.value);return t!==-1||(e===null||e===void 0?void 0:e.disabled)?false:true})).map((e=>{var t;return{name:(t=e.label)!==null&&t!==void 0?t:e.value,value:e.value}}))}return Array.from(this.selectRef.querySelectorAll("option")).filter((t=>{if(e){return true}const i=this.selectedValueIndex(t.value);return!(t.disabled||t.selected||i>-1)})).map((e=>({name:e.textContent,value:e.value})))}initAutocomplete(){var e,t,i,o,r;(e=this.autocompleteRef)===null||e===void 0?void 0:e.addEventListener("gov-select",this.onSelectHandler.bind(this));(t=this.autocompleteRef)===null||t===void 0?void 0:t.addEventListener("gov-input",this.onInputHandler.bind(this));(i=this.autocompleteRef)===null||i===void 0?void 0:i.addEventListener("gov-focus",this.onFocusHandler.bind(this));(o=this.autocompleteRef)===null||o===void 0?void 0:o.addEventListener("gov-blur",this.onBlurHandler.bind(this));(r=this.autocompleteRef)===null||r===void 0?void 0:r.setSearchCallback((e=>new Promise((t=>{const i=this.getAvailableOptions();if(String(e).length===0){return t(i)}t(i.filter((({label:t,value:i})=>{if(!t)t=i;return p(t).toLowerCase().indexOf(p(e).toLowerCase())>-1})))})))).finally()}selectedValueIndex(e){return this.selectedOptionsState.findIndex((t=>t===e))}getOptionElement(e){return this.selectRef.querySelector('option[value="'+e+'"]')}getOption(e){var t;return(t=this.getAvailableOptions(true).find((t=>t.value===e)))!==null&&t!==void 0?t:null}selectOption(e,t=true){const i=this.selectedValueIndex(e);if(i===-1){this.selectedOptionsState=[...this.selectedOptionsState,e];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:l.root,value:this.selectedOptionsState});this.govSelect.emit({component:l.root,value:this.selectedOptionsState})}const i=this.getOptionElement(e);if(i){i.selected=true}}}removeOption(e,t=true){const i=this.selectedValueIndex(e);if(i!==-1){this.selectedOptionsState.splice(i,1);this.selectedOptionsState=[...this.selectedOptionsState];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:l.root,value:this.selectedOptionsState});this.govRemove.emit({component:l.root,value:this.selectedOptionsState})}const o=this.getOptionElement(e);if(o){o.selected=false}}}async componentDidLoad(){this.initAutocomplete()}async componentDidRender(){w((()=>{this.selectRef.querySelectorAll("option").forEach((e=>{if(e.selected){this.selectOption(e.value,false)}}))}));if(v()){await z(500);await this.validateWcag()}}render(){return o(r,{class:l.root,size:this.size,variant:this.variant},o("div",{class:l.wrap},this.h.hasSlot("prefix")&&o("slot",{name:"prefix"}),o("div",{class:"element"},o("gov-form-autocomplete",{value:this.valueState,disabled:this.disabled,identifier:this.identifier||this.selectId,required:false,size:this.size,variant:this.variant,placeholder:this.placeholder,"message-empty":this.messageEmpty,"message-loading":this.messageLoading,ref:e=>this.autocompleteRef=e,minlength:0,wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:this.listId}),o("gov-icon",{slot:"right-icon",class:"icon-arrow",name:"chevron-down"}),this.h.hasSlot("right-icon")&&!(this.success||this.invalid)&&o("slot",{name:"right-icon"}),this.success&&o("gov-icon",{slot:"right-icon",class:"icon-validation",name:"check-lg"}),this.invalid&&o("gov-icon",{slot:"right-icon",class:"icon-validation",name:"exclamation-lg"}),o("select",{hidden:true,class:"hidden-select-list","aria-hidden":a(true),multiple:true,required:this.required,name:this.name,disabled:this.disabled,ref:e=>this.selectRef=e,"aria-disabled":g(this.disabled),"aria-required":g(this.required),"aria-invalid":g(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns},o("slot",null),Array.isArray(this.optionsState)&&this.optionsState.map((e=>{var t;const i=this.selectedValueIndex(e.value);return o("option",{value:e.value,selected:i>-1,disabled:e===null||e===void 0?void 0:e.disabled},(t=e.label)!==null&&t!==void 0?t:e.value)})))),this.h.hasSlot("sufix")&&o("slot",{name:"sufix"})),this.hideSelectedList===false?o("ul",{role:"listbox",id:this.listId,class:l.list},Array.isArray(this.selectedOptionsState)&&this.selectedOptionsState.map((e=>{var t,i;const r=this.getOption(e);if(!r)return null;return o("li",{class:l.item,role:"option"},(t=r.label)!==null&&t!==void 0?t:r.value,o("gov-button",{wcagLabel:(i="Odebrat vybranou položku "+r.label)!==null&&i!==void 0?i:r.value,variant:"primary",type:"base",size:"s","on-gov-click":()=>this.onTagRemove(e)},o("gov-icon",{name:"x-lg"})))}))):null)}onFocusHandler(e){e.stopPropagation();this.focused=true;this.govFocus.emit({component:l.root,originalEvent:e,value:this.selectedOptionsState})}onBlurHandler(e){e.stopPropagation();e.stopPropagation();this.focused=false;this.govBlur.emit({component:l.root,originalEvent:e,value:this.selectedOptionsState})}onInputHandler(e){this.valueState=e.detail.value;e.stopPropagation()}onSelectHandler(e){e.stopPropagation();const t=e.detail.selected;this.selectOption(t.value);this.valueState="";this.autocompleteRef.clearValue().finally();this.autocompleteRef.focus()}onTagRemove(e){this.removeOption(e)}async setFocus(e){return this.selectRef.focus(e)}async setValue(e){this.valueState=e}async getRef(){return this.selectRef}async validateWcag(){f(this.wcagDescribedBy,"wcag-described-by",l.root);f(this.wcagLabelledBy,"wcag-labelled-by",l.root);f(this.wcagOwns,"wcag-owns",l.root);d(this.identifier||this.selectId,this.wcagLabelledBy,l.root)}get host(){return this}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchDisabled"],options:["watchOptions"],value:["watchValue"],disabled:["watchDisabled"],invalid:["watchDisabled"],success:["watchDisabled"]}}static get style(){return j}},[4,"gov-form-multi-select",{value:[1537],options:[1537],identifier:[1],placeholder:[1],variant:[1],size:[1],name:[1],hideSelectedList:[4,"hide-selected-list"],required:[4],disabled:[4],invalid:[4],success:[4],messageEmpty:[1,"message-empty"],messageLoading:[1,"message-loading"],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagOwns:[1,"wcag-owns"],focused:[32],valueState:[32],selectedOptionsState:[32],optionsState:[32],setFocus:[64],setValue:[64],getRef:[64],validateWcag:[64]}]);function O(){if(typeof customElements==="undefined"){return}const e=["gov-form-multi-select","gov-button","gov-form-autocomplete","gov-form-input","gov-icon"];e.forEach((e=>{switch(e){case"gov-form-multi-select":if(!customElements.get(e)){customElements.define(e,E)}break;case"gov-button":if(!customElements.get(e)){b()}break;case"gov-form-autocomplete":if(!customElements.get(e)){y()}break;case"gov-form-input":if(!customElements.get(e)){k()}break;case"gov-icon":if(!customElements.get(e)){_()}break}}))}O();const S=E;const D=O;export{S as GovFormMultiSelect,D as defineCustomElement};
|
|
1
|
+
import{p as e,H as t,c as i,h as o,d as r}from"./p-2dee9951.js";import{g as s,j as l,k as c,l as n}from"./p-f04382c3.js";import{g as m,a,t as g}from"./p-c353678b.js";import{c as v}from"./p-003e6cca.js";import{v as u}from"./p-dcb5fb35.js";import{b as f,c as d}from"./p-4ff831e3.js";import{c as h,r as p}from"./p-24636c53.js";import{d as z}from"./p-03990da5.js";import{p as x}from"./p-ab5a13ea.js";import{t as w}from"./p-8fcc8483.js";import{d as b}from"./p-d3271ba4.js";import{d as y}from"./p-86a37e8c.js";import{d as k}from"./p-245d3ff5.js";import{d as _}from"./p-281b05f0.js";const j='.gov-form-multi-select__list{margin:0;padding:0}.gov-form-multi-select__list>.gov-form-multi-select__item{margin:0;padding:0;background:none}.gov-form-multi-select__list>.gov-form-multi-select__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-multi-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-multi-select .element{position:relative;display:flex;flex:1 1 auto}.gov-form-multi-select input,.gov-form-multi-select select,.gov-form-multi-select textarea{width:100%;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));font-family:var(--gov-font-family, "Roboto", sans-serif)}.gov-form-multi-select input:focus,.gov-form-multi-select select:focus,.gov-form-multi-select textarea:focus{outline:none}.gov-form-multi-select input:focus-visible,.gov-form-multi-select select:focus-visible,.gov-form-multi-select textarea:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-form-multi-select input::-moz-placeholder,.gov-form-multi-select select::-moz-placeholder,.gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select input::placeholder,.gov-form-multi-select select::placeholder,.gov-form-multi-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select textarea{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);padding:0.5rem 0.75rem;resize:none}.gov-form-multi-select *[slot=left-icon],.gov-form-multi-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-multi-select *[slot=left-icon]{left:0}.gov-form-multi-select *[slot=right-icon]{right:0}.gov-form-multi-select *[slot=prefix],.gov-form-multi-select *[slot=sufix]{margin:0}[size=s].gov-form-multi-select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);gap:0.5rem var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select input,[size=s].gov-form-multi-select select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);height:var(--gov-form-input-core-s-height, 2rem);padding:var(--gov-form-input-core-s-padding, 0.25rem 0.75rem)}[size=s].gov-form-multi-select *[slot=left-icon],[size=s].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-s-icon-size, 1rem);height:var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=right-icon]~input,[size=s].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select input,[size=m].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-multi-select *[slot=left-icon],[size=m].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=right-icon]~input,[size=m].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select input,[size=l].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-multi-select *[slot=left-icon],[size=l].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=right-icon]~input,[size=l].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-multi-select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select input,[size=xl].gov-form-multi-select select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-multi-select *[slot=left-icon],[size=xl].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=right-icon]~input,[size=xl].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-multi-select input,[variant=primary].gov-form-multi-select select,[variant=primary].gov-form-multi-select textarea{color:var(--gov-form-input-color-primary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}[variant=primary].gov-form-multi-select *[slot=left-icon],[variant=primary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-multi-select input,[variant=secondary].gov-form-multi-select select,[variant=secondary].gov-form-multi-select textarea{color:var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}[variant=secondary].gov-form-multi-select *[slot=left-icon],[variant=secondary].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-multi-select,[disabled=true i].gov-form-multi-select,[disabled="1"].gov-form-multi-select{pointer-events:none}[disabled=""].gov-form-multi-select input,[disabled=""].gov-form-multi-select select,[disabled=""].gov-form-multi-select textarea,[disabled=true i].gov-form-multi-select input,[disabled=true i].gov-form-multi-select select,[disabled=true i].gov-form-multi-select textarea,[disabled="1"].gov-form-multi-select input,[disabled="1"].gov-form-multi-select select,[disabled="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-multi-select *[slot=left-icon],[disabled=""].gov-form-multi-select *[slot=right-icon],[disabled=true i].gov-form-multi-select *[slot=left-icon],[disabled=true i].gov-form-multi-select *[slot=right-icon],[disabled="1"].gov-form-multi-select *[slot=left-icon],[disabled="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600)) !important}[invalid=""].gov-form-multi-select input,[invalid=""].gov-form-multi-select select,[invalid=""].gov-form-multi-select textarea,[invalid=true i].gov-form-multi-select input,[invalid=true i].gov-form-multi-select select,[invalid=true i].gov-form-multi-select textarea,[invalid="1"].gov-form-multi-select input,[invalid="1"].gov-form-multi-select select,[invalid="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-multi-select input::-moz-placeholder,[invalid=""].gov-form-multi-select select::-moz-placeholder,[invalid=""].gov-form-multi-select textarea::-moz-placeholder,[invalid=true i].gov-form-multi-select input::-moz-placeholder,[invalid=true i].gov-form-multi-select select::-moz-placeholder,[invalid=true i].gov-form-multi-select textarea::-moz-placeholder,[invalid="1"].gov-form-multi-select input::-moz-placeholder,[invalid="1"].gov-form-multi-select select::-moz-placeholder,[invalid="1"].gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select input::placeholder,[invalid=""].gov-form-multi-select select::placeholder,[invalid=""].gov-form-multi-select textarea::placeholder,[invalid=true i].gov-form-multi-select input::placeholder,[invalid=true i].gov-form-multi-select select::placeholder,[invalid=true i].gov-form-multi-select textarea::placeholder,[invalid="1"].gov-form-multi-select input::placeholder,[invalid="1"].gov-form-multi-select select::placeholder,[invalid="1"].gov-form-multi-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select *[slot=left-icon],[invalid=""].gov-form-multi-select *[slot=right-icon],[invalid=true i].gov-form-multi-select *[slot=left-icon],[invalid=true i].gov-form-multi-select *[slot=right-icon],[invalid="1"].gov-form-multi-select *[slot=left-icon],[invalid="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error)) !important}[invalid=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-arrow){color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[multiline=""].gov-form-multi-select *[slot=left-icon],[multiline=""].gov-form-multi-select *[slot=right-icon],[multiline=true i].gov-form-multi-select *[slot=left-icon],[multiline=true i].gov-form-multi-select *[slot=right-icon],[multiline="1"].gov-form-multi-select *[slot=left-icon],[multiline="1"].gov-form-multi-select *[slot=right-icon]{display:none}.gov-form-multi-select{background:none}.gov-form-multi-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-multi-select select::-ms-expand{display:none}[size=s].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-s-arrow-right-position, 0.75rem);width:var(--gov-form-select-s-arrow-size, 0.75rem);height:var(--gov-form-select-s-arrow-size, 0.75rem)}[size=s][invalid=""].gov-form-multi-select .icon-arrow,[size=s][invalid=true i].gov-form-multi-select .icon-arrow,[size=s][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=s][success=""].gov-form-multi-select .icon-arrow,[size=s][success=true i].gov-form-multi-select .icon-arrow,[size=s][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-s-arrow-right-position, 0.75rem))}[size=m].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-m-arrow-right-position, 1rem);width:var(--gov-form-select-m-arrow-size, 0.75rem);height:var(--gov-form-select-m-arrow-size, 0.75rem)}[size=m][invalid=""].gov-form-multi-select .icon-arrow,[size=m][invalid=true i].gov-form-multi-select .icon-arrow,[size=m][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=m][success=""].gov-form-multi-select .icon-arrow,[size=m][success=true i].gov-form-multi-select .icon-arrow,[size=m][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-m-arrow-right-position, 1rem))}[size=l].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-l-arrow-right-position, 1rem);width:var(--gov-form-select-l-arrow-size, 1rem);height:var(--gov-form-select-l-arrow-size, 1rem)}[size=l][invalid=""].gov-form-multi-select .icon-arrow,[size=l][invalid=true i].gov-form-multi-select .icon-arrow,[size=l][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=l][success=""].gov-form-multi-select .icon-arrow,[size=l][success=true i].gov-form-multi-select .icon-arrow,[size=l][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-l-arrow-right-position, 1rem))}[size=xl].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-xl-arrow-right-position, 1.3125rem);width:var(--gov-form-select-xl-arrow-size, 1rem);height:var(--gov-form-select-xl-arrow-size, 1rem)}[size=xl][invalid=""].gov-form-multi-select .icon-arrow,[size=xl][invalid=true i].gov-form-multi-select .icon-arrow,[size=xl][invalid="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=xl][success=""].gov-form-multi-select .icon-arrow,[size=xl][success=true i].gov-form-multi-select .icon-arrow,[size=xl][success="1"].gov-form-multi-select .icon-arrow{right:calc(3 * var(--gov-form-select-xl-arrow-right-position, 1.3125rem))}[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=s][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=s][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=s][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-s-icon-padding, 2rem))}[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=m][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=m][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=m][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-m-icon-padding, 2.5rem))}[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=l][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=l][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=l][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-l-icon-padding, 2.5rem))}[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][invalid="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=""].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success=true i].gov-form-multi-select *[slot=right-icon]~input,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~select,[size=xl][success="1"].gov-form-multi-select *[slot=right-icon]~input{padding-right:calc(2 * var(--gov-form-input-core-xl-icon-padding, 3rem))}.gov-form-multi-select{flex-wrap:wrap}.gov-form-multi-select__wrap{display:flex;align-items:center;gap:0.5rem;width:100%}.gov-form-multi-select__list{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:flex;gap:0.5rem;flex-wrap:wrap}.gov-form-multi-select__list>.gov-form-multi-select__item{position:relative;display:flex;flex:0 0 auto;align-items:center;padding:0rem 0rem 0rem 0.5rem;background:var(--gov-form-multiselect-bg, var(--gov-color-primary-200));transition:150ms linear background-color}';const E=e(class e extends t{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govChange=i(this,"gov-change",7);this.govSelect=i(this,"gov-select",7);this.govRemove=i(this,"gov-remove",7);this.value=undefined;this.options=undefined;this.identifier=undefined;this.placeholder=undefined;this.variant=undefined;this.size="m";this.name=undefined;this.hideSelectedList=false;this.required=false;this.disabled=false;this.invalid=undefined;this.success=undefined;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.messageLoading="Načítám...";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.valueState=undefined;this.selectedOptionsState=[];this.optionsState=[];this.selectId=h("GovSelect");this.listId=h("GovMultiList");this.h=m(this.host);this.f=s(this.h)}validateVariant(e){u(c,e,l.root)}validateSize(e){u(n,e,l.root)}watchOptions(e){this.optionsState=x(e)}watchValue(e){this.selectedOptionsState=x(e)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",a(this.invalid));this.f.passAttrToControl("success",a(this.success))}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.watchDisabled();this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));this.optionsState=x(this.options);this.selectedOptionsState=x(this.value)}getAvailableOptions(e=false){if(Array.isArray(this.optionsState)&&this.optionsState.length){if(e){return this.optionsState}return this.optionsState.filter((e=>{const t=this.selectedValueIndex(e.value);return t!==-1||(e===null||e===void 0?void 0:e.disabled)?false:true})).map((e=>{var t;return{name:(t=e.label)!==null&&t!==void 0?t:e.value,value:e.value}}))}return Array.from(this.selectRef.querySelectorAll("option")).filter((t=>{if(e){return true}const i=this.selectedValueIndex(t.value);return!(t.disabled||t.selected||i>-1)})).map((e=>({name:e.textContent,value:e.value})))}initAutocomplete(){var e,t,i,o,r;(e=this.autocompleteRef)===null||e===void 0?void 0:e.addEventListener("gov-select",this.onSelectHandler.bind(this));(t=this.autocompleteRef)===null||t===void 0?void 0:t.addEventListener("gov-input",this.onInputHandler.bind(this));(i=this.autocompleteRef)===null||i===void 0?void 0:i.addEventListener("gov-focus",this.onFocusHandler.bind(this));(o=this.autocompleteRef)===null||o===void 0?void 0:o.addEventListener("gov-blur",this.onBlurHandler.bind(this));(r=this.autocompleteRef)===null||r===void 0?void 0:r.setSearchCallback((e=>new Promise((t=>{const i=this.getAvailableOptions();if(String(e).length===0){return t(i)}t(i.filter((({label:t,value:i})=>{if(!t)t=i;return p(t).toLowerCase().indexOf(p(e).toLowerCase())>-1})))})))).finally()}selectedValueIndex(e){return this.selectedOptionsState.findIndex((t=>t===e))}getOptionElement(e){return this.selectRef.querySelector('option[value="'+e+'"]')}getOption(e){var t;return(t=this.getAvailableOptions(true).find((t=>t.value===e)))!==null&&t!==void 0?t:null}selectOption(e,t=true){const i=this.selectedValueIndex(e);if(i===-1){this.selectedOptionsState=[...this.selectedOptionsState,e];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:l.root,value:this.selectedOptionsState});this.govSelect.emit({component:l.root,value:this.selectedOptionsState})}const i=this.getOptionElement(e);if(i){i.selected=true}}}removeOption(e,t=true){const i=this.selectedValueIndex(e);if(i!==-1){this.selectedOptionsState.splice(i,1);this.selectedOptionsState=[...this.selectedOptionsState];this.value=this.selectedOptionsState;if(t){this.govChange.emit({component:l.root,value:this.selectedOptionsState});this.govRemove.emit({component:l.root,value:this.selectedOptionsState})}const o=this.getOptionElement(e);if(o){o.selected=false}}}async componentDidLoad(){this.initAutocomplete()}async componentDidRender(){w((()=>{this.selectRef.querySelectorAll("option").forEach((e=>{if(e.selected){this.selectOption(e.value,false)}}))}));if(v()){await z(500);await this.validateWcag()}}render(){return o(r,{class:l.root,size:this.size,variant:this.variant},o("div",{class:l.wrap},this.h.hasSlot("prefix")&&o("slot",{name:"prefix"}),o("div",{class:"element"},o("gov-form-autocomplete",{value:this.valueState,disabled:this.disabled,identifier:this.identifier||this.selectId,required:false,size:this.size,variant:this.variant,placeholder:this.placeholder,"message-empty":this.messageEmpty,"message-loading":this.messageLoading,ref:e=>this.autocompleteRef=e,minlength:0,wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:this.listId}),o("gov-icon",{slot:"right-icon",class:"icon-arrow",name:"chevron-down"}),this.h.hasSlot("right-icon")&&!(this.success||this.invalid)&&o("slot",{name:"right-icon"}),this.success&&o("gov-icon",{slot:"right-icon",class:"icon-validation",name:"check-lg"}),this.invalid&&o("gov-icon",{slot:"right-icon",class:"icon-validation",name:"exclamation-lg"}),o("select",{hidden:true,class:"hidden-select-list","aria-hidden":a(true),multiple:true,required:this.required,name:this.name,disabled:this.disabled,ref:e=>this.selectRef=e,"aria-disabled":g(this.disabled),"aria-required":g(this.required),"aria-invalid":g(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns},o("slot",null),Array.isArray(this.optionsState)&&this.optionsState.map((e=>{var t;const i=this.selectedValueIndex(e.value);return o("option",{value:e.value,selected:i>-1,disabled:e===null||e===void 0?void 0:e.disabled},(t=e.label)!==null&&t!==void 0?t:e.value)})))),this.h.hasSlot("sufix")&&o("slot",{name:"sufix"})),this.hideSelectedList===false?o("ul",{role:"listbox",id:this.listId,class:l.list},Array.isArray(this.selectedOptionsState)&&this.selectedOptionsState.map((e=>{var t,i;const r=this.getOption(e);if(!r)return null;return o("li",{class:l.item,role:"option"},(t=r.label)!==null&&t!==void 0?t:r.value,o("gov-button",{wcagLabel:(i="Odebrat vybranou položku "+r.label)!==null&&i!==void 0?i:r.value,variant:"primary",type:"base",size:"s","on-gov-click":()=>this.onTagRemove(e)},o("gov-icon",{name:"x-lg"})))}))):null)}onFocusHandler(e){e.stopPropagation();this.focused=true;this.govFocus.emit({component:l.root,originalEvent:e,value:this.selectedOptionsState})}onBlurHandler(e){e.stopPropagation();e.stopPropagation();this.focused=false;this.govBlur.emit({component:l.root,originalEvent:e,value:this.selectedOptionsState})}onInputHandler(e){this.valueState=e.detail.value;e.stopPropagation()}onSelectHandler(e){e.stopPropagation();const t=e.detail.selected;this.selectOption(t.value);this.valueState="";this.autocompleteRef.clearValue().finally();this.autocompleteRef.focus()}onTagRemove(e){this.removeOption(e)}async setFocus(e){return this.selectRef.focus(e)}async setValue(e){this.valueState=e}async getRef(){return this.selectRef}async validateWcag(){f(this.wcagDescribedBy,"wcag-described-by",l.root);f(this.wcagLabelledBy,"wcag-labelled-by",l.root);f(this.wcagOwns,"wcag-owns",l.root);d(this.identifier||this.selectId,this.wcagLabelledBy,l.root)}get host(){return this}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchDisabled"],options:["watchOptions"],value:["watchValue"],disabled:["watchDisabled"],invalid:["watchDisabled"],success:["watchDisabled"]}}static get style(){return j}},[4,"gov-form-multi-select",{value:[1537],options:[1537],identifier:[1],placeholder:[1],variant:[1],size:[1],name:[1],hideSelectedList:[4,"hide-selected-list"],required:[4],disabled:[4],invalid:[4],success:[4],messageEmpty:[1,"message-empty"],messageLoading:[1,"message-loading"],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagOwns:[1,"wcag-owns"],focused:[32],valueState:[32],selectedOptionsState:[32],optionsState:[32],setFocus:[64],setValue:[64],getRef:[64],validateWcag:[64]}]);function O(){if(typeof customElements==="undefined"){return}const e=["gov-form-multi-select","gov-button","gov-form-autocomplete","gov-form-input","gov-icon"];e.forEach((e=>{switch(e){case"gov-form-multi-select":if(!customElements.get(e)){customElements.define(e,E)}break;case"gov-button":if(!customElements.get(e)){b()}break;case"gov-form-autocomplete":if(!customElements.get(e)){y()}break;case"gov-form-input":if(!customElements.get(e)){k()}break;case"gov-icon":if(!customElements.get(e)){_()}break}}))}O();const S=E;const D=O;export{S as GovFormMultiSelect,D as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-multi-select.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-7677b93a.js";const t=o;const a=s;export{t as GovFormSelect,a as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-form-select.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{G as o,d as s}from"./p-
|
|
1
|
+
import{G as o,d as s}from"./p-281b05f0.js";const t=o;const p=s;export{t as GovIcon,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-icon.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as r,c as a,h as n,d as i}from"./p-2dee9951.js";import{g as e,a as v}from"./p-c353678b.js";import{c as t}from"./p-003e6cca.js";import{F as c}from"./p-1c1d0bbe.js";import{v as s}from"./p-dcb5fb35.js";import{a as g}from"./p-4ff831e3.js";import{p as b,d as l}from"./p-03990da5.js";import{V as f}from"./p-ff7365ae.js";import{d as _}from"./p-36d7ce72.js";import{d}from"./p-09b12418.js";const m=b(f,["PRIMARY","SECONDARY","WARNING","ERROR","SUCCESS"]);const u={root:"gov-infobar",section:"gov-infobar__section",icon:"gov-infobar__icon",content:"gov-infobar__content",closable:"gov-infobar__content--closable",headline:"gov-infobar__headline",close:"gov-infobar__close"};const h='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-infobar{position:relative;display:block;width:100%}.gov-infobar__section{display:flex;gap:1rem;padding:1rem}.gov-infobar__icon{flex:0 0 auto}.gov-infobar__icon>*{width:1.25rem;height:1.25rem}.gov-infobar__headline{display:flex;gap:1rem}.gov-infobar__headline+div{margin-top:0.5rem}.gov-infobar__headline p{margin-bottom:0}.gov-infobar__headline gov-button{margin-top:-0.25rem}.gov-infobar__content{width:100%}.gov-infobar__content>*:last-child{margin-bottom:0}.gov-infobar__content--closable{padding-right:3.5rem}.gov-infobar__content p{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-infobar__content a{color:inherit}@media not all and (pointer: coarse){.gov-infobar__content a:hover{color:inherit}}.gov-infobar__content a .gov-icon{color:inherit}.gov-infobar__close{position:absolute;top:0.875rem;right:1rem}.gov-infobar[variant=warning]{background-color:var(--gov-infobar-warning-bg-color, var(--gov-color-warning))}.gov-infobar[variant=warning] .gov-infobar__icon{color:var(--gov-infobar-warning-icon-color, var(--gov-color-secondary))}.gov-infobar[variant=warning] .gov-infobar__content{color:var(--gov-infobar-warning-text-color, var(--gov-color-secondary))}.gov-infobar[variant=warning][inverse=""],.gov-infobar[variant=warning][inverse=true i],.gov-infobar[variant=warning][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=warning][inverse=""] .gov-infobar__icon,.gov-infobar[variant=warning][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=warning][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-warning-bg-color, var(--gov-color-warning))}.gov-infobar[variant=warning][inverse=""] .gov-infobar__content,.gov-infobar[variant=warning][inverse=true i] .gov-infobar__content,.gov-infobar[variant=warning][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=error]{background-color:var(--gov-infobar-error-bg-color, var(--gov-color-error))}.gov-infobar[variant=error] .gov-infobar__icon{color:var(--gov-infobar-error-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=error] .gov-infobar__content{color:var(--gov-infobar-error-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=error][inverse=""],.gov-infobar[variant=error][inverse=true i],.gov-infobar[variant=error][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=error][inverse=""] .gov-infobar__icon,.gov-infobar[variant=error][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=error][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-error-bg-color, var(--gov-color-error))}.gov-infobar[variant=error][inverse=""] .gov-infobar__content,.gov-infobar[variant=error][inverse=true i] .gov-infobar__content,.gov-infobar[variant=error][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=secondary]{background-color:var(--gov-infobar-secondary-bg-color, var(--gov-color-secondary))}.gov-infobar[variant=secondary] .gov-infobar__icon{color:var(--gov-infobar-secondary-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary] .gov-infobar__content{color:var(--gov-infobar-secondary-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary][inverse=""],.gov-infobar[variant=secondary][inverse=true i],.gov-infobar[variant=secondary][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary][inverse=""] .gov-infobar__icon,.gov-infobar[variant=secondary][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=secondary][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-secondary-bg-color, var(--gov-color-secondary))}.gov-infobar[variant=secondary][inverse=""] .gov-infobar__content,.gov-infobar[variant=secondary][inverse=true i] .gov-infobar__content,.gov-infobar[variant=secondary][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=success]{background-color:var(--gov-infobar-success-bg-color, var(--gov-color-success-500))}.gov-infobar[variant=success] .gov-infobar__icon{color:var(--gov-infobar-success-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=success] .gov-infobar__content{color:var(--gov-infobar-success-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=success][inverse=""],.gov-infobar[variant=success][inverse=true i],.gov-infobar[variant=success][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=success][inverse=""] .gov-infobar__icon,.gov-infobar[variant=success][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=success][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-success-bg-color, var(--gov-color-success-500))}.gov-infobar[variant=success][inverse=""] .gov-infobar__content,.gov-infobar[variant=success][inverse=true i] .gov-infobar__content,.gov-infobar[variant=success][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=primary]{background-color:var(--gov-infobar-primary-bg-color, var(--gov-color-primary))}.gov-infobar[variant=primary] .gov-infobar__icon{color:var(--gov-infobar-primary-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=primary] .gov-infobar__content{color:var(--gov-infobar-primary-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=primary][inverse=""],.gov-infobar[variant=primary][inverse=true i],.gov-infobar[variant=primary][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=primary][inverse=""] .gov-infobar__icon,.gov-infobar[variant=primary][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=primary][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-primary-bg-color, var(--gov-color-primary))}.gov-infobar[variant=primary][inverse=""] .gov-infobar__content,.gov-infobar[variant=primary][inverse=true i] .gov-infobar__content,.gov-infobar[variant=primary][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}';const p=o(class o extends r{constructor(){super();this.__registerHost();this.govClose=a(this,"gov-close",7);this.headline=undefined;this.variant="primary";this.role=undefined;this.inverse=false;this.wcagCloseLabel="Zavřít informační lištu";this.wcagToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.h=e(this.host)}validateVariant(o){s(m,o,u.root)}componentWillLoad(){this.validateVariant(this.variant)}async componentDidRender(){if(t()){await l(500);await this.validateWcag()}}render(){let o=!this.inverse;let r=this.inverse?"secondary":this.variant;if(this.variant=="warning"){o=false;r="secondary"}const a=n("div",{class:u.close},n("gov-button",{size:"s",wcagLabel:this.wcagCloseLabel,type:"base",variant:r,inverse:o,"on-gov-click":this.onCloseHandler.bind(this)},n("gov-icon",{name:"x-lg"})));return n(i,{class:this.h.classes(u.root),variant:this.variant},n("section",{class:u.section,role:this.role},this.h.hasSlot("icon")&&n("div",{class:u.icon},n("slot",{name:"icon"})),n("div",{class:u.content+(this.closable?" "+u.closable:"")},this.headline?n(c,null,n("div",{class:u.headline},n("p",null,this.headline),n("gov-button",{size:"s",wcagLabel:this.wcagToggleLabel,type:"base",variant:r,inverse:o,"on-gov-click":()=>this.toggleContent=!this.toggleContent},n("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down"}))),n("div",{hidden:!this.toggleContent,"aria-hidden":v(this.toggleContent)},n("slot",null))):n("slot",null))),this.closable&&a)}onCloseHandler(o){this.govClose.emit({component:u.root,ref:this.host,originalEvent:o})}async validateWcag(){if(this.closable){g(this.wcagCloseLabel,"wcag-close-label",u.root)}if(this.headline){g(this.wcagToggleLabel,"wcag-toggle-label",u.root)}}get host(){return this}static get watchers(){return{variant:["validateVariant"]}}static get style(){return h}},[4,"gov-infobar",{headline:[1],variant:[1],role:[1],inverse:[4],wcagCloseLabel:[1,"wcag-close-label"],wcagToggleLabel:[1,"wcag-toggle-label"],closable:[4],toggleContent:[32],validateWcag:[64]}]);function y(){if(typeof customElements==="undefined"){return}const o=["gov-infobar","gov-button","gov-icon"];o.forEach((o=>{switch(o){case"gov-infobar":if(!customElements.get(o)){customElements.define(o,p)}break;case"gov-button":if(!customElements.get(o)){_()}break;case"gov-icon":if(!customElements.get(o)){d()}break}}))}y();const w=p;const k=y;export{w as GovInfobar,k as defineCustomElement};
|
|
1
|
+
import{p as o,H as r,c as a,h as n,d as i}from"./p-2dee9951.js";import{g as e,a as v}from"./p-c353678b.js";import{c as t}from"./p-003e6cca.js";import{F as c}from"./p-1c1d0bbe.js";import{v as s}from"./p-dcb5fb35.js";import{a as g}from"./p-4ff831e3.js";import{p as b,d as l}from"./p-03990da5.js";import{V as f}from"./p-ff7365ae.js";import{d as _}from"./p-d3271ba4.js";import{d}from"./p-281b05f0.js";const m=b(f,["PRIMARY","SECONDARY","WARNING","ERROR","SUCCESS"]);const u={root:"gov-infobar",section:"gov-infobar__section",icon:"gov-infobar__icon",content:"gov-infobar__content",closable:"gov-infobar__content--closable",headline:"gov-infobar__headline",close:"gov-infobar__close"};const h='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-infobar{position:relative;display:block;width:100%}.gov-infobar__section{display:flex;gap:1rem;padding:1rem}.gov-infobar__icon{flex:0 0 auto}.gov-infobar__icon>*{width:1.25rem;height:1.25rem}.gov-infobar__headline{display:flex;gap:1rem}.gov-infobar__headline+div{margin-top:0.5rem}.gov-infobar__headline p{margin-bottom:0}.gov-infobar__headline gov-button{margin-top:-0.25rem}.gov-infobar__content{width:100%}.gov-infobar__content>*:last-child{margin-bottom:0}.gov-infobar__content--closable{padding-right:3.5rem}.gov-infobar__content p{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-infobar__content a{color:inherit}@media not all and (pointer: coarse){.gov-infobar__content a:hover{color:inherit}}.gov-infobar__content a .gov-icon{color:inherit}.gov-infobar__close{position:absolute;top:0.875rem;right:1rem}.gov-infobar[variant=warning]{background-color:var(--gov-infobar-warning-bg-color, var(--gov-color-warning))}.gov-infobar[variant=warning] .gov-infobar__icon{color:var(--gov-infobar-warning-icon-color, var(--gov-color-secondary))}.gov-infobar[variant=warning] .gov-infobar__content{color:var(--gov-infobar-warning-text-color, var(--gov-color-secondary))}.gov-infobar[variant=warning][inverse=""],.gov-infobar[variant=warning][inverse=true i],.gov-infobar[variant=warning][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=warning][inverse=""] .gov-infobar__icon,.gov-infobar[variant=warning][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=warning][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-warning-bg-color, var(--gov-color-warning))}.gov-infobar[variant=warning][inverse=""] .gov-infobar__content,.gov-infobar[variant=warning][inverse=true i] .gov-infobar__content,.gov-infobar[variant=warning][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=error]{background-color:var(--gov-infobar-error-bg-color, var(--gov-color-error))}.gov-infobar[variant=error] .gov-infobar__icon{color:var(--gov-infobar-error-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=error] .gov-infobar__content{color:var(--gov-infobar-error-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=error][inverse=""],.gov-infobar[variant=error][inverse=true i],.gov-infobar[variant=error][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=error][inverse=""] .gov-infobar__icon,.gov-infobar[variant=error][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=error][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-error-bg-color, var(--gov-color-error))}.gov-infobar[variant=error][inverse=""] .gov-infobar__content,.gov-infobar[variant=error][inverse=true i] .gov-infobar__content,.gov-infobar[variant=error][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=secondary]{background-color:var(--gov-infobar-secondary-bg-color, var(--gov-color-secondary))}.gov-infobar[variant=secondary] .gov-infobar__icon{color:var(--gov-infobar-secondary-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary] .gov-infobar__content{color:var(--gov-infobar-secondary-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary][inverse=""],.gov-infobar[variant=secondary][inverse=true i],.gov-infobar[variant=secondary][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=secondary][inverse=""] .gov-infobar__icon,.gov-infobar[variant=secondary][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=secondary][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-secondary-bg-color, var(--gov-color-secondary))}.gov-infobar[variant=secondary][inverse=""] .gov-infobar__content,.gov-infobar[variant=secondary][inverse=true i] .gov-infobar__content,.gov-infobar[variant=secondary][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=success]{background-color:var(--gov-infobar-success-bg-color, var(--gov-color-success-500))}.gov-infobar[variant=success] .gov-infobar__icon{color:var(--gov-infobar-success-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=success] .gov-infobar__content{color:var(--gov-infobar-success-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=success][inverse=""],.gov-infobar[variant=success][inverse=true i],.gov-infobar[variant=success][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=success][inverse=""] .gov-infobar__icon,.gov-infobar[variant=success][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=success][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-success-bg-color, var(--gov-color-success-500))}.gov-infobar[variant=success][inverse=""] .gov-infobar__content,.gov-infobar[variant=success][inverse=true i] .gov-infobar__content,.gov-infobar[variant=success][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}.gov-infobar[variant=primary]{background-color:var(--gov-infobar-primary-bg-color, var(--gov-color-primary))}.gov-infobar[variant=primary] .gov-infobar__icon{color:var(--gov-infobar-primary-icon-color, var(--gov-color-neutral-white))}.gov-infobar[variant=primary] .gov-infobar__content{color:var(--gov-infobar-primary-text-color, var(--gov-color-neutral-white))}.gov-infobar[variant=primary][inverse=""],.gov-infobar[variant=primary][inverse=true i],.gov-infobar[variant=primary][inverse="1"]{border-bottom:var(--gov-infobar-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-infobar-inverse-bg, var(--gov-color-neutral-white))}.gov-infobar[variant=primary][inverse=""] .gov-infobar__icon,.gov-infobar[variant=primary][inverse=true i] .gov-infobar__icon,.gov-infobar[variant=primary][inverse="1"] .gov-infobar__icon{color:var(--gov-infobar-primary-bg-color, var(--gov-color-primary))}.gov-infobar[variant=primary][inverse=""] .gov-infobar__content,.gov-infobar[variant=primary][inverse=true i] .gov-infobar__content,.gov-infobar[variant=primary][inverse="1"] .gov-infobar__content{color:var(--gov-infobar-inverse-color, var(--gov-color-secondary-800))}';const p=o(class o extends r{constructor(){super();this.__registerHost();this.govClose=a(this,"gov-close",7);this.headline=undefined;this.variant="primary";this.role=undefined;this.inverse=false;this.wcagCloseLabel="Zavřít informační lištu";this.wcagToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.h=e(this.host)}validateVariant(o){s(m,o,u.root)}componentWillLoad(){this.validateVariant(this.variant)}async componentDidRender(){if(t()){await l(500);await this.validateWcag()}}render(){let o=!this.inverse;let r=this.inverse?"secondary":this.variant;if(this.variant=="warning"){o=false;r="secondary"}const a=n("div",{class:u.close},n("gov-button",{size:"s",wcagLabel:this.wcagCloseLabel,type:"base",variant:r,inverse:o,"on-gov-click":this.onCloseHandler.bind(this)},n("gov-icon",{name:"x-lg"})));return n(i,{class:this.h.classes(u.root),variant:this.variant},n("section",{class:u.section,role:this.role},this.h.hasSlot("icon")&&n("div",{class:u.icon},n("slot",{name:"icon"})),n("div",{class:u.content+(this.closable?" "+u.closable:"")},this.headline?n(c,null,n("div",{class:u.headline},n("p",null,this.headline),n("gov-button",{size:"s",wcagLabel:this.wcagToggleLabel,type:"base",variant:r,inverse:o,"on-gov-click":()=>this.toggleContent=!this.toggleContent},n("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down"}))),n("div",{hidden:!this.toggleContent,"aria-hidden":v(this.toggleContent)},n("slot",null))):n("slot",null))),this.closable&&a)}onCloseHandler(o){this.govClose.emit({component:u.root,ref:this.host,originalEvent:o})}async validateWcag(){if(this.closable){g(this.wcagCloseLabel,"wcag-close-label",u.root)}if(this.headline){g(this.wcagToggleLabel,"wcag-toggle-label",u.root)}}get host(){return this}static get watchers(){return{variant:["validateVariant"]}}static get style(){return h}},[4,"gov-infobar",{headline:[1],variant:[1],role:[1],inverse:[4],wcagCloseLabel:[1,"wcag-close-label"],wcagToggleLabel:[1,"wcag-toggle-label"],closable:[4],toggleContent:[32],validateWcag:[64]}]);function y(){if(typeof customElements==="undefined"){return}const o=["gov-infobar","gov-button","gov-icon"];o.forEach((o=>{switch(o){case"gov-infobar":if(!customElements.get(o)){customElements.define(o,p)}break;case"gov-button":if(!customElements.get(o)){_()}break;case"gov-icon":if(!customElements.get(o)){d()}break}}))}y();const w=p;const k=y;export{w as GovInfobar,k as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-infobar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as n,h as e,d as t}from"./p-2dee9951.js";import{g as i,p as s}from"./p-c353678b.js";import{d as a}from"./p-f8b7ea69.js";import{d as r}from"./p-
|
|
1
|
+
import{p as o,H as n,h as e,d as t}from"./p-2dee9951.js";import{g as i,p as s}from"./p-c353678b.js";import{d as a}from"./p-f8b7ea69.js";import{d as r}from"./p-281b05f0.js";const c={root:"gov-loading",content:"gov-loading__content",icon:"gov-loading__icon"};const g=".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-loading{display:block}.gov-loading__content{z-index:101;position:fixed;top:50%;left:50%;display:flex;gap:1rem;flex-direction:column;align-items:center;min-width:9.6875rem;padding:1.5rem;border-radius:0.5rem;background:var(--gov-loading-bg, rgba(var(--gov-color-secondary-400-rgb), 0.8));color:var(--gov-loading-color, var(--gov-color-primary));text-align:center;transform:translate(-50%, -50%)}.gov-loading__icon{width:4rem;height:4rem;line-height:1}.gov-loading__icon svg{width:100%;height:100%}";const l=o(class o extends n{constructor(){super();this.__registerHost();this.h=i(this.host)}render(){return e(t,{class:this.h.classes(c.root)},e("div",{class:c.content},e("gov-icon",{class:s([c.icon,"gov-spin-animation"]),name:"loader"}),e("slot",null)),e("gov-backdrop",{inverse:true}))}get host(){return this}static get style(){return g}},[4,"gov-loading"]);function d(){if(typeof customElements==="undefined"){return}const o=["gov-loading","gov-backdrop","gov-icon"];o.forEach((o=>{switch(o){case"gov-loading":if(!customElements.get(o)){customElements.define(o,l)}break;case"gov-backdrop":if(!customElements.get(o)){a()}break;case"gov-icon":if(!customElements.get(o)){r()}break}}))}d();const m=l;const p=d;export{m as GovLoading,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-loading.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as e,c as a,h as t,d as i}from"./p-2dee9951.js";import{g as s,d as r,a as l}from"./p-c353678b.js";import{c as d}from"./p-003e6cca.js";import{a as n}from"./p-7f2c9830.js";import{b as m}from"./p-4ff831e3.js";import{c}from"./p-24636c53.js";import{d as g}from"./p-03990da5.js";import{M as h}from"./p-be4aab0e.js";import{d as v}from"./p-f8b7ea69.js";import{d as p}from"./p-
|
|
1
|
+
import{p as o,H as e,c as a,h as t,d as i}from"./p-2dee9951.js";import{g as s,d as r,a as l}from"./p-c353678b.js";import{c as d}from"./p-003e6cca.js";import{a as n}from"./p-7f2c9830.js";import{b as m}from"./p-4ff831e3.js";import{c}from"./p-24636c53.js";import{d as g}from"./p-03990da5.js";import{M as h}from"./p-be4aab0e.js";import{d as v}from"./p-f8b7ea69.js";import{d as p}from"./p-d3271ba4.js";import{d as f}from"./p-281b05f0.js";const b='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=""],.gov-modal[open=true i],.gov-modal[open="1"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const u=o(class o extends e{constructor(){super();this.__registerHost();this.govClose=a(this,"gov-close",7);this.open=false;this.blockClose=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.wcagCloseLabel="Zavřít okno";this.wcagCloseLabelledBy=undefined;this.h=s(this.host);this.labelId=c("GovModalLabel");this.contentId=c("GovModalContent")}validateLabelTag(o){const e=["h1","h2","h3","h4","h5","h6"];if(o){if(!e.includes(o)){n(`[${h.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o;if(o&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}showModal(){this.open=true;document.body.classList.add(h.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(h.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(d()){await g(500);await this.validateWcag()}}render(){const o=this.labelTag;return t(i,{class:this.h.classes(h.root),open:this.open},t("dialog",{class:h.dialog,hidden:!this.open,tabindex:r(this.open),open:this.open,"aria-modal":"true","aria-hidden":l(!this.open),"aria-labelledby":this.wcagLabelledBy||this.labelId,"aria-describedby":this.wcagDescribedBy||this.contentId,role:this.role},t("div",{class:h.inner},t("div",{class:h.header},this.h.hasSlot("icon")&&t("div",{class:h.icon},t("slot",{name:"icon"})),this.label&&t(o,{class:h.title,id:this.labelId},this.label),t("gov-button",{ref:o=>this.closeCtaRef=o,disabled:this.blockClose,class:h.close,variant:"primary",wcagLabel:this.wcagCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base","on-gov-click":this.onCloseHandler.bind(this)},t("gov-icon",{name:"x-lg"}))),t("div",{class:h.content,id:this.contentId},t("slot",null)),this.h.hasSlot("footer")&&t("div",{class:h.footer},t("slot",{name:"footer"})))),this.open?t("gov-backdrop",{"wcag-label":this.wcagCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(o){o.stopPropagation();if(this.blockClose===false){this.hideModal();this.govClose.emit(o)}}async show(){this.showModal()}async hide(){this.hideModal()}async validateWcag(){m(this.wcagLabelledBy,"wcag-labelled-by",h.root);m(this.wcagDescribedBy,"wcag-described-by",h.root)}get host(){return this}static get watchers(){return{labelTag:["validateLabelTag"],open:["watchOpen"]}}static get style(){return b}},[4,"gov-modal",{open:[1028],blockClose:[4,"block-close"],label:[1],role:[1],labelTag:[1,"label-tag"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagDescribedBy:[1,"wcag-described-by"],wcagCloseLabel:[1,"wcag-close-label"],wcagCloseLabelledBy:[1,"wcag-close-labelled-by"],show:[64],hide:[64],validateWcag:[64]}]);function _(){if(typeof customElements==="undefined"){return}const o=["gov-modal","gov-backdrop","gov-button","gov-icon"];o.forEach((o=>{switch(o){case"gov-modal":if(!customElements.get(o)){customElements.define(o,u)}break;case"gov-backdrop":if(!customElements.get(o)){v()}break;case"gov-button":if(!customElements.get(o)){p()}break;case"gov-icon":if(!customElements.get(o)){f()}break}}))}_();const w=u;const y=_;export{w as GovModal,y as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-modal.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as e,c as t,h as r,d as a}from"./p-2dee9951.js";import{F as n}from"./p-1c1d0bbe.js";import{v as i}from"./p-dcb5fb35.js";import{S as s}from"./p-55500e5a.js";import{V as g}from"./p-ff7365ae.js";import{p as c,d as l}from"./p-03990da5.js";import{g as v,p as u,t as p}from"./p-c353678b.js";import{a as h,v as d}from"./p-4ff831e3.js";import{c as b}from"./p-003e6cca.js";import{c as m}from"./p-24636c53.js";import{c as _}from"./p-ab5a13ea.js";import{d as f}from"./p-36d7ce72.js";import{d as y}from"./p-0f5aceff.js";import{d as w}from"./p-09b12418.js";const k=c(s,["_S","_M"]);const x=c(g,["PRIMARY","SECONDARY"]);var z;(function(o){o["BUTTON"]="button";o["SELECT"]="select"})(z||(z={}));const j={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 P(o,e=1,t=10,r=10){const a=Math.ceil(o/t);if(e<1){e=1}else if(e>a){e=a}let n,i;if(a<=r){n=1;i=a}else{const o=Math.floor(r/2);const t=Math.ceil(r/2)-1;if(e<=o){n=1;i=r}else if(e+t>=a){n=a-r+1;i=a}else{n=e-o;i=e+t}}const s=(e-1)*t;const g=Math.min(s+t-1,o-1);const c=Array.from(Array(i+1-n).keys()).map((o=>n+o));return{totalItems:o,currentPage:e,pageSize:t,totalPages:a,startPage:n,endPage:i,startIndex:s,endIndex:g,pages:c}}const S=".gov-pagination__list{margin:0;padding:0}.gov-pagination__list .gov-pagination__item{margin:0;padding:0;background:none}.gov-pagination__list .gov-pagination__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-pagination{position:relative;display:block;width:100%}.gov-pagination__list{display:flex;align-items:center;flex-wrap:wrap;font-weight:bold;text-align:center}.gov-pagination__list .gov-pagination__item{display:flex;justify-content:center;align-items:center;margin:0;padding:0.125rem;border-radius:var(--gov-border-radius, 0.1875rem);overflow:hidden}.gov-pagination__list .gov-pagination__item--arrow{display:flex}.gov-pagination__list .gov-pagination__item--select{z-index:1;display:flex;overflow:visible;padding:0rem 1rem}.gov-pagination__arrow{margin:0}.gov-pagination__item--more .gov-form-select select{border:none !important;padding-right:0.75rem !important}.gov-pagination__item--more .gov-form-select .gov-icon{display:none}.gov-pagination__inner{display:flex;justify-content:center;align-items:center;align-self:stretch;width:100%;text-decoration:none}.gov-pagination__inner[wcag-current=true][type=solid][variant=primary] .element{background-color:var(--gov-button-primary-solid-hover-bg, var(--gov-color-primary-700));color:var(--gov-button-primary-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=primary] .element{background-color:var(--gov-button-primary-outlined-hover-bg, var(--gov-color-primary-100));color:var(--gov-button-primary-outlined-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=base][variant=primary] .element{background-color:var(--gov-button-primary-base-hover-bg, var(--gov-color-primary-100));color:var(--gov-button-primary-base-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=link][variant=primary] .element{background-color:var(--gov-button-primary-link-hover-bg, transparent);color:var(--gov-button-primary-link-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=solid][variant=secondary] .element{background-color:var(--gov-button-secondary-solid-hover-bg, var(--gov-color-secondary-900));color:var(--gov-button-secondary-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=secondary] .element{background-color:var(--gov-button-secondary-outlined-hover-bg, var(--gov-color-secondary-300));color:var(--gov-button-secondary-outlined-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=base][variant=secondary] .element{background-color:var(--gov-button-secondary-base-hover-bg, var(--gov-color-secondary-300));color:var(--gov-button-secondary-base-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=link][variant=secondary] .element{background-color:var(--gov-button-secondary-link-hover-bg, transparent);color:var(--gov-button-secondary-link-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=solid][variant=error] .element{background-color:var(--gov-button-error-solid-hover-bg, var(--gov-color-error-500));color:var(--gov-button-error-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=error] .element{background-color:var(--gov-button-error-outlined-hover-bg, var(--gov-color-error-100));color:var(--gov-button-error-outlined-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=base][variant=error] .element{background-color:var(--gov-button-error-base-hover-bg, var(--gov-color-error-100));color:var(--gov-button-error-base-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=link][variant=error] .element{background-color:var(--gov-button-error-link-hover-bg, transparent);color:var(--gov-button-error-link-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=solid][variant=success] .element{background-color:var(--gov-button-success-solid-hover-bg, var(--gov-color-success-600));color:var(--gov-button-success-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=success] .element{background-color:var(--gov-button-success-outlined-hover-bg, var(--gov-color-success-100));color:var(--gov-button-success-outlined-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=base][variant=success] .element{background-color:var(--gov-button-success-base-hover-bg, var(--gov-color-success-100));color:var(--gov-button-success-base-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=link][variant=success] .element{background-color:var(--gov-button-success-link-hover-bg, transparent);color:var(--gov-button-success-link-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=solid][variant=warning] .element{background-color:var(--gov-button-warning-solid-hover-bg, var(--gov-color-warning-600));color:var(--gov-button-warning-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=warning] .element{background-color:var(--gov-button-warning-outlined-hover-bg, var(--gov-color-warning-200));color:var(--gov-button-warning-outlined-hover-color, var(--gov-color-warning-500))}.gov-pagination__inner[wcag-current=true][type=base][variant=warning] .element{background-color:var(--gov-button-warning-base-hover-bg, var(--gov-color-warning-200));color:var(--gov-button-warning-base-hover-color, var(--gov-color-warning-500))}.gov-pagination__inner[wcag-current=true][type=link][variant=warning] .element{background-color:var(--gov-button-warning-link-hover-bg, transparent);color:var(--gov-button-warning-link-hover-color, var(--gov-color-warning-500))}.gov-pagination[size=s] .gov-pagination__inner{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);font-weight:inherit}.gov-pagination[size=s] .gov-pagination__inner .element{min-width:var(--gov-pagination-s-button-size, 2rem)}.gov-pagination[size=m] .gov-pagination__inner{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);font-weight:inherit}.gov-pagination[size=m] .gov-pagination__inner .element{min-width:var(--gov-pagination-m-button-size, 2.5rem)}";const E=o(class o extends e{constructor(){super();this.__registerHost();this.govPage=t(this,"gov-page",7);this.type="button";this.current=1;this.total=0;this.inverse=undefined;this.size="m";this.variant="primary";this.pageSize=10;this.maxPages=5;this.link=undefined;this.wcagLabel=undefined;this.wcagLabelledBy=undefined;this.wcagSelectLabel="Vybrat stranu";this.wcagPageLabel="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.h=v(this.host);this.pageSelectId=m("GovPageSelect")}validateType(o){i(z,o,j.root)}validateSize(o){i(k,o,j.root)}validateVariant(o){i(x,o,j.root)}recalculate(){this.recalculatePagination(this.current)}componentWillLoad(){this.recalculatePagination(this.current);this.validateSize(this.size);this.validateVariant(this.variant)}async componentDidRender(){if(b()){await l(500);await this.validateWcag()}}recalculatePagination(o){this.pagination=P(this.total,o,this.pageSize,this.maxPages)}isActivePageClass(o,e){if(this.pagination.currentPage===e){return o+" is-active"}else{return o}}prepareLinkUrl(o){if(this.link){return String(this.link).replace("{PAGE}",String(o))}return undefined}resetSelectValue(){if(this.spreadSelectRef){this.spreadSelectRef.getRef().then((o=>{o.value="..."}))}}render(){const o=(o,e,t)=>{const a=o===-1;const n=p(this.pagination.currentPage===o?true:undefined);return r("gov-button",{href:this.prepareLinkUrl(o),variant:this.variant,size:this.size,type:"base",disabled:a,"on-gov-click":e=>this.onClickHandler(e,o),"wcag-label":t?t:o>-1?this.wcagPageLabel+" "+o:undefined,"wcag-current":n,class:j.inner},e)};return r(a,{class:this.h.classes(j.root),type:this.type,variant:this.variant,size:this.size},r("nav",{"aria-label":this.wcagLabel,"aria-labelledby":this.wcagLabelledBy},r("ul",{class:j.list},r("li",{class:u([j.item,j.itemArrow])},o(this.pagination.currentPage>1?1:-1,r("gov-icon",{class:j.arrow,name:"chevron-double-left"}),this.labelStart)),r("li",{class:u([j.item,j.itemArrow])},o(this.pagination.startPage<this.pagination.currentPage?this.pagination.currentPage-1:-1,r("gov-icon",{class:j.arrow,name:"chevron-left"}),this.labelPrev)),this.type=="select"?r("li",{class:u([j.item,j.itemSelect])},r("span",{class:j.inner},r("span",{id:this.pageSelectId,hidden:true},this.wcagSelectLabel),r("gov-form-select",{size:this.size,variant:this.variant,"wcag-labelled-by":this.pageSelectId,"on-gov-change":this.onSelectHandler.bind(this)},_(1,this.pagination.totalPages).map((o=>r("option",{value:o,selected:this.pagination.currentPage===o},o)))))):r(n,null,this.pagination.pages.map((e=>r("li",{class:this.isActivePageClass(j.item,e)},o(e,e,"")))),this.pagination.totalPages?r("li",{class:u([j.item,j.itemMore])},r("span",{class:j.inner},r("span",{id:this.pageSelectId,hidden:true},this.wcagSelectLabel),r("gov-form-select",{size:this.size,variant:this.variant,"wcag-labelled-by":this.pageSelectId,ref:o=>this.spreadSelectRef=o,"on-gov-change":this.onSelectHandler.bind(this)},r("option",{selected:true,hidden:true},"..."),_(1,this.pagination.totalPages).map((o=>r("option",{value:o,selected:false},o)))))):null),r("li",{class:u([j.item,j.itemArrow])},o(this.pagination.totalPages>this.pagination.currentPage?this.pagination.currentPage+1:-1,r("gov-icon",{class:j.arrow,name:"chevron-right"}),this.labelNext)),r("li",{class:u([j.item,j.itemArrow])},o(this.pagination.totalPages>this.pagination.currentPage?this.pagination.totalPages:-1,r("gov-icon",{class:j.arrow,name:"chevron-double-right"}),this.labelEnd)))))}onClickHandler(o,e){o.stopPropagation();this.recalculatePagination(e);this.govPage.emit({component:j.root,pagination:this.pagination})}onSelectHandler(o){o.stopPropagation();const e=o.detail.value;const t=parseInt(e);this.resetSelectValue();if(isNaN(t)===false){this.recalculatePagination(t);if(this.link){window.location.href=this.prepareLinkUrl(t)}else{this.govPage.emit({component:j.root,pagination:this.pagination})}}}async validateWcag(){h(this.wcagPageLabel,"wcag-page-label",j.root);d(this.wcagLabel,this.wcagLabelledBy,j.root)}get host(){return this}static get watchers(){return{type:["validateType"],size:["validateSize"],variant:["validateVariant"],current:["recalculate"],total:["recalculate"],pageSize:["recalculate"],maxPages:["recalculate"]}}static get style(){return S}},[0,"gov-pagination",{type:[1],current:[2],total:[2],inverse:[4],size:[1],variant:[1],pageSize:[2,"page-size"],maxPages:[2,"max-pages"],link:[1],wcagLabel:[1,"wcag-label"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagSelectLabel:[1,"wcag-select-label"],wcagPageLabel:[1,"wcag-page-label"],labelPrev:[1,"label-prev"],labelStart:[1,"label-start"],labelNext:[1,"label-next"],labelEnd:[1,"label-end"],pagination:[32],validateWcag:[64]}]);function A(){if(typeof customElements==="undefined"){return}const o=["gov-pagination","gov-button","gov-form-select","gov-icon"];o.forEach((o=>{switch(o){case"gov-pagination":if(!customElements.get(o)){customElements.define(o,E)}break;case"gov-button":if(!customElements.get(o)){f()}break;case"gov-form-select":if(!customElements.get(o)){y()}break;case"gov-icon":if(!customElements.get(o)){w()}break}}))}A();const M=E;const L=A;export{M as GovPagination,L as defineCustomElement};
|
|
1
|
+
import{p as o,H as t,c as e,h as r,d as a}from"./p-2dee9951.js";import{F as n}from"./p-1c1d0bbe.js";import{v as i}from"./p-dcb5fb35.js";import{S as s}from"./p-55500e5a.js";import{V as g}from"./p-ff7365ae.js";import{p as c,d as l}from"./p-03990da5.js";import{g as v,p as u,t as p}from"./p-c353678b.js";import{a as h,v as d}from"./p-4ff831e3.js";import{c as b}from"./p-003e6cca.js";import{c as m}from"./p-24636c53.js";import{c as _}from"./p-ab5a13ea.js";import{d as f}from"./p-d3271ba4.js";import{d as y}from"./p-7677b93a.js";import{d as w}from"./p-281b05f0.js";const k=c(s,["_S","_M"]);const x=c(g,["PRIMARY","SECONDARY"]);var z;(function(o){o["BUTTON"]="button";o["SELECT"]="select"})(z||(z={}));const j={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 P(o,t=1,e=10,r=10){const a=Math.ceil(o/e);if(t<1){t=1}else if(t>a){t=a}let n,i;if(a<=r){n=1;i=a}else{const o=Math.floor(r/2);const e=Math.ceil(r/2)-1;if(t<=o){n=1;i=r}else if(t+e>=a){n=a-r+1;i=a}else{n=t-o;i=t+e}}const s=(t-1)*e;const g=Math.min(s+e-1,o-1);const c=Array.from(Array(i+1-n).keys()).map((o=>n+o));return{totalItems:o,currentPage:t,pageSize:e,totalPages:a,startPage:n,endPage:i,startIndex:s,endIndex:g,pages:c}}const S=".gov-pagination__list{margin:0;padding:0}.gov-pagination__list .gov-pagination__item{margin:0;padding:0;background:none}.gov-pagination__list .gov-pagination__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-pagination{position:relative;display:block;width:100%}.gov-pagination__list{display:flex;align-items:center;flex-wrap:wrap;font-weight:bold;text-align:center}.gov-pagination__list .gov-pagination__item{display:flex;justify-content:center;align-items:center;margin:0;padding:0.125rem;border-radius:var(--gov-border-radius, 0.1875rem);overflow:hidden}.gov-pagination__list .gov-pagination__item--arrow{display:flex}.gov-pagination__list .gov-pagination__item--select{z-index:1;display:flex;overflow:visible;padding:0rem 1rem}.gov-pagination__arrow{margin:0}.gov-pagination__item--more .gov-form-select select{border:none !important;padding-right:0.75rem !important}.gov-pagination__item--more .gov-form-select .gov-icon{display:none}.gov-pagination__inner{display:flex;justify-content:center;align-items:center;align-self:stretch;width:100%;text-decoration:none}.gov-pagination__inner[wcag-current=true][type=solid][variant=primary] .element{background-color:var(--gov-button-primary-solid-hover-bg, var(--gov-color-primary-700));color:var(--gov-button-primary-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=primary] .element{background-color:var(--gov-button-primary-outlined-hover-bg, var(--gov-color-primary-100));color:var(--gov-button-primary-outlined-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=base][variant=primary] .element{background-color:var(--gov-button-primary-base-hover-bg, var(--gov-color-primary-100));color:var(--gov-button-primary-base-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=link][variant=primary] .element{background-color:var(--gov-button-primary-link-hover-bg, transparent);color:var(--gov-button-primary-link-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=solid][variant=secondary] .element{background-color:var(--gov-button-secondary-solid-hover-bg, var(--gov-color-secondary-900));color:var(--gov-button-secondary-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=secondary] .element{background-color:var(--gov-button-secondary-outlined-hover-bg, var(--gov-color-secondary-300));color:var(--gov-button-secondary-outlined-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=base][variant=secondary] .element{background-color:var(--gov-button-secondary-base-hover-bg, var(--gov-color-secondary-300));color:var(--gov-button-secondary-base-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=link][variant=secondary] .element{background-color:var(--gov-button-secondary-link-hover-bg, transparent);color:var(--gov-button-secondary-link-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=solid][variant=error] .element{background-color:var(--gov-button-error-solid-hover-bg, var(--gov-color-error-500));color:var(--gov-button-error-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=error] .element{background-color:var(--gov-button-error-outlined-hover-bg, var(--gov-color-error-100));color:var(--gov-button-error-outlined-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=base][variant=error] .element{background-color:var(--gov-button-error-base-hover-bg, var(--gov-color-error-100));color:var(--gov-button-error-base-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=link][variant=error] .element{background-color:var(--gov-button-error-link-hover-bg, transparent);color:var(--gov-button-error-link-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=solid][variant=success] .element{background-color:var(--gov-button-success-solid-hover-bg, var(--gov-color-success-600));color:var(--gov-button-success-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=success] .element{background-color:var(--gov-button-success-outlined-hover-bg, var(--gov-color-success-100));color:var(--gov-button-success-outlined-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=base][variant=success] .element{background-color:var(--gov-button-success-base-hover-bg, var(--gov-color-success-100));color:var(--gov-button-success-base-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=link][variant=success] .element{background-color:var(--gov-button-success-link-hover-bg, transparent);color:var(--gov-button-success-link-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=solid][variant=warning] .element{background-color:var(--gov-button-warning-solid-hover-bg, var(--gov-color-warning-600));color:var(--gov-button-warning-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=warning] .element{background-color:var(--gov-button-warning-outlined-hover-bg, var(--gov-color-warning-200));color:var(--gov-button-warning-outlined-hover-color, var(--gov-color-warning-500))}.gov-pagination__inner[wcag-current=true][type=base][variant=warning] .element{background-color:var(--gov-button-warning-base-hover-bg, var(--gov-color-warning-200));color:var(--gov-button-warning-base-hover-color, var(--gov-color-warning-500))}.gov-pagination__inner[wcag-current=true][type=link][variant=warning] .element{background-color:var(--gov-button-warning-link-hover-bg, transparent);color:var(--gov-button-warning-link-hover-color, var(--gov-color-warning-500))}.gov-pagination[size=s] .gov-pagination__inner{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);font-weight:inherit}.gov-pagination[size=s] .gov-pagination__inner .element{min-width:var(--gov-pagination-s-button-size, 2rem)}.gov-pagination[size=m] .gov-pagination__inner{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);font-weight:inherit}.gov-pagination[size=m] .gov-pagination__inner .element{min-width:var(--gov-pagination-m-button-size, 2.5rem)}";const E=o(class o extends t{constructor(){super();this.__registerHost();this.govPage=e(this,"gov-page",7);this.type="button";this.current=1;this.total=0;this.inverse=undefined;this.size="m";this.variant="primary";this.pageSize=10;this.maxPages=5;this.link=undefined;this.wcagLabel=undefined;this.wcagLabelledBy=undefined;this.wcagSelectLabel="Vybrat stranu";this.wcagPageLabel="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.h=v(this.host);this.pageSelectId=m("GovPageSelect")}validateType(o){i(z,o,j.root)}validateSize(o){i(k,o,j.root)}validateVariant(o){i(x,o,j.root)}recalculate(){this.recalculatePagination(this.current)}componentWillLoad(){this.recalculatePagination(this.current);this.validateSize(this.size);this.validateVariant(this.variant)}async componentDidRender(){if(b()){await l(500);await this.validateWcag()}}recalculatePagination(o){this.pagination=P(this.total,o,this.pageSize,this.maxPages)}isActivePageClass(o,t){if(this.pagination.currentPage===t){return o+" is-active"}else{return o}}prepareLinkUrl(o){if(this.link){return String(this.link).replace("{PAGE}",String(o))}return undefined}resetSelectValue(){if(this.spreadSelectRef){this.spreadSelectRef.getRef().then((o=>{o.value="..."}))}}render(){const o=(o,t,e)=>{const a=o===-1;const n=p(this.pagination.currentPage===o?true:undefined);return r("gov-button",{href:this.prepareLinkUrl(o),variant:this.variant,size:this.size,type:"base",disabled:a,"on-gov-click":t=>this.onClickHandler(t,o),"wcag-label":e?e:o>-1?this.wcagPageLabel+" "+o:undefined,"wcag-current":n,class:j.inner},t)};return r(a,{class:this.h.classes(j.root),type:this.type,variant:this.variant,size:this.size},r("nav",{"aria-label":this.wcagLabel,"aria-labelledby":this.wcagLabelledBy},r("ul",{class:j.list},r("li",{class:u([j.item,j.itemArrow])},o(this.pagination.currentPage>1?1:-1,r("gov-icon",{class:j.arrow,name:"chevron-double-left"}),this.labelStart)),r("li",{class:u([j.item,j.itemArrow])},o(this.pagination.startPage<this.pagination.currentPage?this.pagination.currentPage-1:-1,r("gov-icon",{class:j.arrow,name:"chevron-left"}),this.labelPrev)),this.type=="select"?r("li",{class:u([j.item,j.itemSelect])},r("span",{class:j.inner},r("span",{id:this.pageSelectId,hidden:true},this.wcagSelectLabel),r("gov-form-select",{size:this.size,variant:this.variant,"wcag-labelled-by":this.pageSelectId,"on-gov-change":this.onSelectHandler.bind(this)},_(1,this.pagination.totalPages).map((o=>r("option",{value:o,selected:this.pagination.currentPage===o},o)))))):r(n,null,this.pagination.pages.map((t=>r("li",{class:this.isActivePageClass(j.item,t)},o(t,t,"")))),this.pagination.totalPages?r("li",{class:u([j.item,j.itemMore])},r("span",{class:j.inner},r("span",{id:this.pageSelectId,hidden:true},this.wcagSelectLabel),r("gov-form-select",{size:this.size,variant:this.variant,"wcag-labelled-by":this.pageSelectId,ref:o=>this.spreadSelectRef=o,"on-gov-change":this.onSelectHandler.bind(this)},r("option",{selected:true,hidden:true},"..."),_(1,this.pagination.totalPages).map((o=>r("option",{value:o,selected:false},o)))))):null),r("li",{class:u([j.item,j.itemArrow])},o(this.pagination.totalPages>this.pagination.currentPage?this.pagination.currentPage+1:-1,r("gov-icon",{class:j.arrow,name:"chevron-right"}),this.labelNext)),r("li",{class:u([j.item,j.itemArrow])},o(this.pagination.totalPages>this.pagination.currentPage?this.pagination.totalPages:-1,r("gov-icon",{class:j.arrow,name:"chevron-double-right"}),this.labelEnd)))))}onClickHandler(o,t){o.stopPropagation();this.recalculatePagination(t);this.govPage.emit({component:j.root,pagination:this.pagination})}onSelectHandler(o){o.stopPropagation();const t=o.detail.value;const e=parseInt(t);this.resetSelectValue();if(isNaN(e)===false){this.recalculatePagination(e);if(this.link){window.location.href=this.prepareLinkUrl(e)}else{this.govPage.emit({component:j.root,pagination:this.pagination})}}}async validateWcag(){h(this.wcagPageLabel,"wcag-page-label",j.root);d(this.wcagLabel,this.wcagLabelledBy,j.root)}get host(){return this}static get watchers(){return{type:["validateType"],size:["validateSize"],variant:["validateVariant"],current:["recalculate"],total:["recalculate"],pageSize:["recalculate"],maxPages:["recalculate"]}}static get style(){return S}},[0,"gov-pagination",{type:[1],current:[2],total:[2],inverse:[4],size:[1],variant:[1],pageSize:[2,"page-size"],maxPages:[2,"max-pages"],link:[1],wcagLabel:[1,"wcag-label"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagSelectLabel:[1,"wcag-select-label"],wcagPageLabel:[1,"wcag-page-label"],labelPrev:[1,"label-prev"],labelStart:[1,"label-start"],labelNext:[1,"label-next"],labelEnd:[1,"label-end"],pagination:[32],validateWcag:[64]}]);function A(){if(typeof customElements==="undefined"){return}const o=["gov-pagination","gov-button","gov-form-select","gov-icon"];o.forEach((o=>{switch(o){case"gov-pagination":if(!customElements.get(o)){customElements.define(o,E)}break;case"gov-button":if(!customElements.get(o)){f()}break;case"gov-form-select":if(!customElements.get(o)){y()}break;case"gov-icon":if(!customElements.get(o)){w()}break}}))}A();const M=E;const L=A;export{M as GovPagination,L as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-pagination.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as o,H as e,c as a,h as t,d as i}from"./p-2dee9951.js";import{g as s,a as r}from"./p-c353678b.js";import{c as l}from"./p-003e6cca.js";import{a as d}from"./p-7f2c9830.js";import{b as n}from"./p-4ff831e3.js";import{c as m}from"./p-24636c53.js";import{d as c}from"./p-03990da5.js";import{M as g}from"./p-be4aab0e.js";import{d as h}from"./p-f8b7ea69.js";import{d as v}from"./p-
|
|
1
|
+
import{p as o,H as e,c as a,h as t,d as i}from"./p-2dee9951.js";import{g as s,a as r}from"./p-c353678b.js";import{c as l}from"./p-003e6cca.js";import{a as d}from"./p-7f2c9830.js";import{b as n}from"./p-4ff831e3.js";import{c as m}from"./p-24636c53.js";import{d as c}from"./p-03990da5.js";import{M as g}from"./p-be4aab0e.js";import{d as h}from"./p-f8b7ea69.js";import{d as v}from"./p-d3271ba4.js";import{d as p}from"./p-281b05f0.js";const f='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=""],.gov-modal[open=true i],.gov-modal[open="1"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const b=o(class o extends e{constructor(){super();this.__registerHost();this.govClose=a(this,"gov-close",7);this.open=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.wcagCloseLabel="Zavřít okno";this.wcagCloseLabelledBy=undefined;this.h=s(this.host);this.labelId=m("GovPromptLabel");this.contentId=m("GovPromptContent")}validateLabelTag(o){const e=["h1","h2","h3","h4","h5","h6"];if(o){if(!e.includes(o)){d(`[${g.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o;if(o&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}showModal(){this.open=true;document.body.classList.add(g.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(g.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(l()){await c(500);await this.validateWcag()}}render(){const o=this.labelTag;return t(i,{class:this.h.classes(g.rootPrompt),open:this.open},t("dialog",{class:g.dialog,hidden:!this.open,tabindex:"-1",open:this.open,"aria-modal":"true","aria-hidden":r(!this.open),"aria-labelledby":this.wcagLabelledBy||this.labelId,"aria-describedby":this.wcagDescribedBy||this.contentId,role:this.role},t("div",{class:g.inner},t("div",{class:g.header},this.h.hasSlot("icon")&&t("div",{class:g.icon},t("slot",{name:"icon"})),this.label&&t(o,{class:g.title,id:this.labelId},this.label),t("gov-button",{class:g.close,variant:"primary",wcagLabel:this.wcagCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base",ref:o=>this.closeCtaRef=o,"on-gov-click":this.onCloseHandler.bind(this)},t("gov-icon",{name:"x-lg"}))),t("div",{class:g.content,id:this.contentId},t("slot",null)),t("div",{class:g.actions},t("slot",{name:"actions"})))),this.open?t("gov-backdrop",{"wcag-label":this.wcagCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(o){o.stopPropagation();this.hideModal();this.govClose.emit(o)}async show(){this.showModal()}async hide(){this.hideModal()}async validateWcag(){n(this.wcagLabelledBy,"wcag-labelled-by",g.root);n(this.wcagDescribedBy,"wcag-described-by",g.root)}get host(){return this}static get watchers(){return{labelTag:["validateLabelTag"],open:["watchOpen"]}}static get style(){return f}},[4,"gov-prompt",{open:[1028],label:[1],role:[1],labelTag:[1,"label-tag"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagDescribedBy:[1,"wcag-described-by"],wcagCloseLabel:[1,"wcag-close-label"],wcagCloseLabelledBy:[1,"wcag-close-labelled-by"],show:[64],hide:[64],validateWcag:[64]}]);function u(){if(typeof customElements==="undefined"){return}const o=["gov-prompt","gov-backdrop","gov-button","gov-icon"];o.forEach((o=>{switch(o){case"gov-prompt":if(!customElements.get(o)){customElements.define(o,b)}break;case"gov-backdrop":if(!customElements.get(o)){h()}break;case"gov-button":if(!customElements.get(o)){v()}break;case"gov-icon":if(!customElements.get(o)){p()}break}}))}u();const _=b;const w=u;export{_ as GovPrompt,w as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-prompt.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as i,c as a,h as o,d as t}from"./p-2dee9951.js";import{a as n}from"./p-7f2c9830.js";import{S as s}from"./p-db1f0452.js";import{g as r,p as v,b as d}from"./p-c353678b.js";import{d as g}from"./p-
|
|
1
|
+
import{p as e,H as i,c as a,h as o,d as t}from"./p-2dee9951.js";import{a as n}from"./p-7f2c9830.js";import{S as s}from"./p-db1f0452.js";import{g as r,p as v,b as d}from"./p-c353678b.js";import{d as g}from"./p-98464833.js";import{d as m}from"./p-281b05f0.js";const c='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-side-nav-item{position:relative;display:block;width:100%}.gov-side-nav-item__header{display:flex;align-items:center;border-bottom:var(--gov-side-nav-border, 0.0625rem solid var(--gov-color-secondary-500))}.gov-side-nav-item__name{display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;border:0;background-color:transparent;text-align:center;text-decoration:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);display:flex;gap:1rem;flex:1 1 auto;justify-content:flex-start;padding:0.75rem 1rem 0.75rem 0.5rem;color:var(--gov-side-nav-color, var(--gov-color-secondary));text-align:left;transition:background-color 150ms}.gov-side-nav-item__name:focus{outline:none}.gov-side-nav-item__name:focus{outline:none}.gov-side-nav-item__name:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}button.gov-side-nav-item__name{padding-right:0 !important}@media not all and (pointer: coarse){.gov-side-nav-item__name:hover{background:var(--gov-side-nav-hover-bg, var(--gov-color-primary-200))}}.gov-side-nav-item__icon{display:flex;flex:0 0 auto;width:1rem;height:1rem}.gov-side-nav-item__icon .gov-icon{margin:0;color:var(--gov-side-nav-color, var(--gov-color-secondary))}.gov-side-nav-item__label{color:inherit}.gov-side-nav-item__chip{display:flex;flex:0 0 auto}.gov-side-nav-item__arrow{display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;border:0;background-color:transparent;text-align:center;text-decoration:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;flex:0 0 auto;align-self:stretch;width:3rem;margin-left:auto;color:var(--gov-side-nav-arrow-color, var(--gov-color-primary));transition:background-color 150ms}.gov-side-nav-item__arrow:focus{outline:none}.gov-side-nav-item__arrow:focus{outline:none}.gov-side-nav-item__arrow:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-side-nav-item__arrow .gov-icon{width:0.75rem;height:0.75rem}@media not all and (pointer: coarse){.gov-side-nav-item__arrow:hover{background:var(--gov-side-nav-hover-bg, var(--gov-color-primary-200))}}.gov-side-nav-item__content{display:none}.gov-side-nav-item--w-icon .gov-side-nav-item__label{margin-left:2rem}.gov-side-nav-item--w-icon .gov-side-nav-item__icon+.gov-side-nav-item__label{margin-left:0}.gov-side-nav-item .gov-side-nav-item .gov-side-nav-item__header{border:none !important}.gov-side-nav-item .gov-side-nav-item .gov-side-nav-item__name{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);padding:0.625rem 0.5rem;font-weight:bold}.gov-side-nav-item .gov-side-nav-item[aria-expanded=""],.gov-side-nav-item .gov-side-nav-item[aria-expanded=true i],.gov-side-nav-item .gov-side-nav-item[aria-expanded="1"]{background:var(--gov-side-nav-bg-level-2, var(--gov-color-secondary-300))}.gov-side-nav-item .gov-side-nav-item[aria-expanded=""][inverse=""],.gov-side-nav-item .gov-side-nav-item[aria-expanded=""][inverse=true i],.gov-side-nav-item .gov-side-nav-item[aria-expanded=""][inverse="1"],.gov-side-nav-item .gov-side-nav-item[aria-expanded=true i][inverse=""],.gov-side-nav-item .gov-side-nav-item[aria-expanded=true i][inverse=true i],.gov-side-nav-item .gov-side-nav-item[aria-expanded=true i][inverse="1"],.gov-side-nav-item .gov-side-nav-item[aria-expanded="1"][inverse=""],.gov-side-nav-item .gov-side-nav-item[aria-expanded="1"][inverse=true i],.gov-side-nav-item .gov-side-nav-item[aria-expanded="1"][inverse="1"]{background:var(--gov-side-nav-bg-level-2, var(--gov-color-neutral-white))}.gov-side-nav-item .gov-side-nav-item .gov-side-nav-item .gov-side-nav-item__name{gap:0.75rem;font-weight:inherit}.gov-side-nav-item[compact=""] .gov-side-nav-item__header,.gov-side-nav-item[compact=true i] .gov-side-nav-item__header,.gov-side-nav-item[compact="1"] .gov-side-nav-item__header{border-bottom:none}.gov-side-nav-item[aria-expanded=""]>.gov-side-nav-item__header .gov-side-nav-item__arrow .gov-icon,.gov-side-nav-item[aria-expanded=true i]>.gov-side-nav-item__header .gov-side-nav-item__arrow .gov-icon,.gov-side-nav-item[aria-expanded="1"]>.gov-side-nav-item__header .gov-side-nav-item__arrow .gov-icon{transform:scale(-1)}.gov-side-nav-item[aria-expanded=""]>.gov-side-nav-item__content,.gov-side-nav-item[aria-expanded=true i]>.gov-side-nav-item__content,.gov-side-nav-item[aria-expanded="1"]>.gov-side-nav-item__content{display:block}';const l=e(class e extends i{constructor(){super();this.__registerHost();this.govChange=a(this,"gov-change",7);this.isExpandedState=undefined;this.inverse=false;this.compact=false;this.identifier=undefined;this.count=false;this.label=undefined;this.disabled=false;this.href=undefined;this.isExpanded=false;this.h=r(this.host)}validateLabel(e){if(!e){n(`[${s.root}]: Parameter label is required.`)}}emmitChange(){this.govChange.emit({open:this.isExpandedState,element:this.host})}componentWillLoad(){this.isExpandedState=this.isExpanded;this.validateLabel(this.label)}get classNames(){const{h:e}=this;return v([s.root,e.hasSlot("icon")&&s.rootWithIcon])}render(){const{isExpandedState:e,label:i}=this;const a=this.host.children.length>1;return o(t,{class:this.classNames,role:"listitem",inverse:this.inverse,"aria-expanded":d(e)},this.href?o("div",{class:s.header},o("a",{class:s.name,href:this.href},this.h.hasSlot("icon")&&o("span",{class:s.icon},o("slot",{name:"icon"})),o("span",{class:s.label},i),this.count&&o("span",{class:s.chip},o("gov-chip",{variant:"secondary",size:"s",inverse:this.inverse},"3"))),a&&o("button",{type:"button",class:s.arrow,onClick:()=>this.toggle()},o("gov-icon",{name:"chevron-down"}))):o("div",{class:s.header},o("button",{class:s.name,type:"button",onClick:()=>this.toggle()},this.h.hasSlot("icon")&&o("span",{class:s.icon},o("slot",{name:"icon"})),o("span",{class:s.label},i),a&&o("span",{class:s.arrow},o("gov-icon",{name:"chevron-down"})))),a&&o("div",{class:s.content},o("slot",null)))}async open(){this.isExpandedState=true;this.emmitChange()}async close(){this.isExpandedState=false;this.emmitChange()}async toggle(){this.isExpandedState=!this.isExpandedState;this.emmitChange()}async currentState(){return this.isExpandedState}get host(){return this}static get watchers(){return{label:["validateLabel"]}}static get style(){return c}},[4,"gov-side-nav-item",{inverse:[4],compact:[4],identifier:[1],count:[4],label:[1],disabled:[4],href:[1],isExpanded:[4,"is-expanded"],isExpandedState:[32],open:[64],close:[64],toggle:[64],currentState:[64]}]);function p(){if(typeof customElements==="undefined"){return}const e=["gov-side-nav-item","gov-chip","gov-icon"];e.forEach((e=>{switch(e){case"gov-side-nav-item":if(!customElements.get(e)){customElements.define(e,l)}break;case"gov-chip":if(!customElements.get(e)){g()}break;case"gov-icon":if(!customElements.get(e)){m()}break}}))}p();const h=l;const u=p;export{h as GovSideNavItem,u as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-side-nav-item.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as o,c as r,h as e,d as a}from"./p-2dee9951.js";import{v as s}from"./p-dcb5fb35.js";import{T as i,a as n,b as c,c as v}from"./p-fa1e4aea.js";import{g as l,a as g}from"./p-c353678b.js";import{a as b,v as d}from"./p-4ff831e3.js";import{c as h}from"./p-003e6cca.js";import{d as m,t as p}from"./p-03990da5.js";import{c as f}from"./p-24636c53.js";import{d as u}from"./p-d58ed95a.js";import{d as y}from"./p-0f5aceff.js";import{d as _}from"./p-09b12418.js";const w=".gov-tabs__list{margin:0;padding:0}.gov-tabs__list>.gov-tabs__item{margin:0;padding:0;background:none}.gov-tabs__list>.gov-tabs__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-tabs{position:relative;display:block;width:100%}.gov-tabs__list{display:flex;flex-wrap:wrap;margin:0rem 0rem 1.25rem}.gov-tabs__list>.gov-tabs__item{display:flex;margin:0}.gov-tabs__btn{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;border:0;background-color:transparent;text-align:center;text-decoration:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;padding:0.75rem 0rem 0.625rem;border-bottom:0.125rem solid transparent;font-weight:700;text-align:center;transition:150ms linear color, 150ms linear border-color}.gov-tabs__btn:focus{outline:none}.gov-tabs__btn:focus{outline:none}.gov-tabs__btn:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-tabs[type=text] .gov-tabs__list{gap:0.5rem 2rem;border-bottom:var(--gov-tabs-list-border-width, 0.0625rem solid var(--gov-color-secondary-500))}.gov-tabs[type=chip] .gov-tabs__list{gap:0.5rem 1rem}.gov-tabs[variant=primary][type=text] .gov-tabs__btn{color:var(--gov-tabs-primary-color, var(--gov-color-primary))}@media not all and (pointer: coarse){.gov-tabs[variant=primary][type=text] .gov-tabs__btn:hover{color:var(--gov-tabs-primary-color-hover, var(--gov-color-primary-800))}}.gov-tabs[variant=primary][type=text] .gov-tabs__btn[aria-selected=true]{border-bottom-color:var(--gov-tabs-primary-color-active, var(--gov-color-primary-800));color:var(--gov-tabs-primary-color-active, var(--gov-color-primary-800))}.gov-tabs[variant=secondary][type=text] .gov-tabs__btn{color:var(--gov-tabs-secondary-color, var(--gov-color-secondary-700))}@media not all and (pointer: coarse){.gov-tabs[variant=secondary][type=text] .gov-tabs__btn:hover{color:var(--gov-tabs-secondary-color-hover, var(--gov-color-secondary-900))}}.gov-tabs[variant=secondary][type=text] .gov-tabs__btn[aria-selected=true]{border-bottom-color:var(--gov-tabs-secondary-color-active, var(--gov-color-secondary-900));color:var(--gov-tabs-secondary-color-active, var(--gov-color-secondary-900))}.gov-tabs[variant=success][type=text] .gov-tabs__btn{color:var(--gov-tabs-success-color, var(--gov-color-success-500))}@media not all and (pointer: coarse){.gov-tabs[variant=success][type=text] .gov-tabs__btn:hover{color:var(--gov-tabs-success-color-hover, var(--gov-color-success-700))}}.gov-tabs[variant=success][type=text] .gov-tabs__btn[aria-selected=true]{border-bottom-color:var(--gov-tabs-success-color-active, var(--gov-color-success-700));color:var(--gov-tabs-success-color-active, var(--gov-color-success-700))}.gov-tabs[variant=warning][type=text] .gov-tabs__btn{color:var(--gov-tabs-warning-color, var(--gov-color-warning-500))}@media not all and (pointer: coarse){.gov-tabs[variant=warning][type=text] .gov-tabs__btn:hover{color:var(--gov-tabs-warning-color-hover, var(--gov-color-warning-700))}}.gov-tabs[variant=warning][type=text] .gov-tabs__btn[aria-selected=true]{border-bottom-color:var(--gov-tabs-warning-color-active, var(--gov-color-warning-700));color:var(--gov-tabs-warning-color-active, var(--gov-color-warning-700))}.gov-tabs[variant=error][type=text] .gov-tabs__btn{color:var(--gov-tabs-error-color, var(--gov-color-error-400))}@media not all and (pointer: coarse){.gov-tabs[variant=error][type=text] .gov-tabs__btn:hover{color:var(--gov-tabs-error-color-hover, var(--gov-color-error-600))}}.gov-tabs[variant=error][type=text] .gov-tabs__btn[aria-selected=true]{border-bottom-color:var(--gov-tabs-error-color-active, var(--gov-color-error-600));color:var(--gov-tabs-error-color-active, var(--gov-color-error-600))}.gov-tabs[orientation=vertical] .gov-tabs__btn{text-align:left}@media (min-width: 75em){.gov-tabs[orientation=vertical]{display:flex;flex-direction:row}.gov-tabs[orientation=vertical] .gov-tabs__list{flex-wrap:nowrap;flex-direction:column;width:-moz-max-content;width:max-content;max-width:30vw;margin-right:1.25rem;padding:0rem 0.5rem;border-bottom:none;border-right:var(--gov-tabs-list-border-width, 0.0625rem solid var(--gov-color-secondary-500))}.gov-tabs[orientation=vertical] .gov-tabs__item{justify-content:flex-end}.gov-tabs[orientation=vertical] .gov-tabs__btn{padding:0.5rem 0.75rem;text-align:right}}";const x=t(class t extends o{constructor(){super();this.__registerHost();this.govChange=r(this,"gov-change",7);this.triggerRefs={};this.controller=[];this.focusIndex=0;this.compactControls=false;this.type="text";this.variant="primary";this.orientation="horizontal";this.wcagLabel=undefined;this.wcagSelectLabel=undefined;this.wcagLabelledBy=undefined;this.h=l(this.host);this.formSelectId=f("GovFormSelect")}validateType(t){s(c,t,n.root)}validateVariant(t){s(v,t,n.root)}componentWillLoad(){this.prepareDataSource()}async componentDidRender(){if(h()){await m(500);await this.validateWcag()}this.resizeObserver()}prepareDataSource(){this.controller=[];const t=[];this.host.querySelectorAll(i.root).forEach((o=>{const r=Promise.all([o.getIdentifier(),o.getTriggerIdentifier()]).then((([t,r])=>{const e=typeof o.getAttribute("default")==="string";return{label:o.getAttribute("label"),contentIdentifier:t,triggerIdentifier:r,element:o,active:false,default:e}}));t.push(r)}));Promise.all(t).then((t=>{let o=t.findIndex((t=>t.default));if(o===-1)o=0;this.focusIndex=o;t[o].active=true;this.controller=[...t];this.reRender()}))}setActiveByIdentifier(t){const o=[];this.controller.map((r=>{r.active=t===r.triggerIdentifier||t===r.contentIdentifier;o.push(r)}));this.controller=[...o]}reRender(){this.controller.map((t=>{t.element.setActiveStatus(t.active)}))}resizeObserver(){const t=new ResizeObserver(p((()=>{}),200));t.observe(this.tabsRef)}render(){return e(a,{class:this.h.classes(n.root),variant:this.variant,type:this.type,role:"tablist",ref:t=>this.tabsRef=t,"aria-label":this.wcagLabel,"aria-labelledby":this.wcagLabelledBy,onKeyDown:this.onKeydownHandler.bind(this)},e("div",{class:n.tabs,"aria-hidden":g(this.compactControls)},e("ul",{class:n.list},this.controller.map(((t,o)=>e("li",{class:n.item},this.type=="text"?e("button",{class:n.btn,id:t.triggerIdentifier,role:"tab",onClick:()=>this.onSelectHandler(t,o),"aria-selected":g(t.active),"aria-controls":t.contentIdentifier,tabindex:t.active?0:-1,ref:o=>this.triggerRefs[t.triggerIdentifier]=o},t.label):e("gov-chip",{role:"tab",tag:"button",identifier:t.triggerIdentifier,"wcag-selected":t.active,"wcag-controls":t.contentIdentifier,focusable:t.active,variant:this.variant,inverse:!t.active,ref:o=>this.triggerRefs[t.triggerIdentifier]=o,"on-gov-click":()=>this.onSelectHandler(t,o)},t.label)))))),e("span",{id:this.formSelectId,hidden:true},this.wcagSelectLabel),this.compactControls?e("gov-form-select",{"wcag-labelled-by":this.formSelectId,"onGov-change":this.onChangeHandler.bind(this)},this.controller.map((t=>e("option",{value:t.triggerIdentifier,selected:t.active},t.label)))):null,e("slot",null))}getCurrentTab(){return this.controller.find((t=>t.active))||null}onSelectHandler(t,o){this.focusIndex=o;this.setActiveByIdentifier(t.triggerIdentifier);this.reRender();this.govChange.emit(this.getCurrentTab().element)}onChangeHandler(t){const o=t.target.value;t.stopPropagation();this.setActiveByIdentifier(o);this.reRender();this.govChange.emit(this.getCurrentTab().element)}onKeydownHandler(t){const o=t.keyCode;t.stopPropagation();if([37,38,39,40].includes(o)){if(false===(this.focusIndex>=0&&this.focusIndex<=this.controller.length-1)){return}this.controller[this.focusIndex].active=false;if(o===39||o===40){this.focusIndex++;if(this.focusIndex>=this.controller.length){this.focusIndex=0}}else if(o===37||o===38){this.focusIndex--;if(this.focusIndex<0){this.focusIndex=this.controller.length-1}}if(this.focusIndex>=0&&this.focusIndex<=this.controller.length-1){const t=this.controller[this.focusIndex];t.active=true;const o=this.triggerRefs[t.triggerIdentifier];if(o.nodeName.toLowerCase()==="gov-chip"){this.triggerRefs[t.triggerIdentifier].setFocus()}else{this.triggerRefs[t.triggerIdentifier].focus()}this.controller=[...this.controller];this.reRender();this.govChange.emit(this.getCurrentTab().element)}}}async refresh(){this.prepareDataSource()}async currentTab(){return this.getCurrentTab().element||null}async setActiveTab(t){this.setActiveByIdentifier(t);this.reRender()}async validateWcag(){b(this.wcagSelectLabel,"wcag-select-label",n.root);d(this.wcagLabel,this.wcagLabelledBy,n.root)}get host(){return this}static get watchers(){return{type:["validateType"],variant:["validateVariant"]}}static get style(){return w}},[4,"gov-tabs",{type:[1],variant:[1],orientation:[1],wcagLabel:[1,"wcag-label"],wcagSelectLabel:[1,"wcag-select-label"],wcagLabelledBy:[1,"wcag-labelled-by"],controller:[32],focusIndex:[32],compactControls:[32],refresh:[64],currentTab:[64],setActiveTab:[64],validateWcag:[64]}]);function k(){if(typeof customElements==="undefined"){return}const t=["gov-tabs","gov-chip","gov-form-select","gov-icon"];t.forEach((t=>{switch(t){case"gov-tabs":if(!customElements.get(t)){customElements.define(t,x)}break;case"gov-chip":if(!customElements.get(t)){u()}break;case"gov-form-select":if(!customElements.get(t)){y()}break;case"gov-icon":if(!customElements.get(t)){_()}break}}))}k();const j=x;const T=k;export{j as GovTabs,T as defineCustomElement};
|
|
1
|
+
import{p as t,H as o,c as r,h as e,d as a}from"./p-2dee9951.js";import{v as s}from"./p-dcb5fb35.js";import{T as i,a as n,b as c,c as v}from"./p-fa1e4aea.js";import{g as l,a as g}from"./p-c353678b.js";import{a as b,v as d}from"./p-4ff831e3.js";import{c as h}from"./p-003e6cca.js";import{d as m,t as p}from"./p-03990da5.js";import{c as f}from"./p-24636c53.js";import{d as u}from"./p-98464833.js";import{d as y}from"./p-7677b93a.js";import{d as _}from"./p-281b05f0.js";const w=".gov-tabs__list{margin:0;padding:0}.gov-tabs__list>.gov-tabs__item{margin:0;padding:0;background:none}.gov-tabs__list>.gov-tabs__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-tabs{position:relative;display:block;width:100%}.gov-tabs__list{display:flex;flex-wrap:wrap;margin:0rem 0rem 1.25rem}.gov-tabs__list>.gov-tabs__item{display:flex;margin:0}.gov-tabs__btn{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;border:0;background-color:transparent;text-align:center;text-decoration:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;padding:0.75rem 0rem 0.625rem;border-bottom:0.125rem solid transparent;font-weight:700;text-align:center;transition:150ms linear color, 150ms linear border-color}.gov-tabs__btn:focus{outline:none}.gov-tabs__btn:focus{outline:none}.gov-tabs__btn:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-tabs[type=text] .gov-tabs__list{gap:0.5rem 2rem;border-bottom:var(--gov-tabs-list-border-width, 0.0625rem solid var(--gov-color-secondary-500))}.gov-tabs[type=chip] .gov-tabs__list{gap:0.5rem 1rem}.gov-tabs[variant=primary][type=text] .gov-tabs__btn{color:var(--gov-tabs-primary-color, var(--gov-color-primary))}@media not all and (pointer: coarse){.gov-tabs[variant=primary][type=text] .gov-tabs__btn:hover{color:var(--gov-tabs-primary-color-hover, var(--gov-color-primary-800))}}.gov-tabs[variant=primary][type=text] .gov-tabs__btn[aria-selected=true]{border-bottom-color:var(--gov-tabs-primary-color-active, var(--gov-color-primary-800));color:var(--gov-tabs-primary-color-active, var(--gov-color-primary-800))}.gov-tabs[variant=secondary][type=text] .gov-tabs__btn{color:var(--gov-tabs-secondary-color, var(--gov-color-secondary-700))}@media not all and (pointer: coarse){.gov-tabs[variant=secondary][type=text] .gov-tabs__btn:hover{color:var(--gov-tabs-secondary-color-hover, var(--gov-color-secondary-900))}}.gov-tabs[variant=secondary][type=text] .gov-tabs__btn[aria-selected=true]{border-bottom-color:var(--gov-tabs-secondary-color-active, var(--gov-color-secondary-900));color:var(--gov-tabs-secondary-color-active, var(--gov-color-secondary-900))}.gov-tabs[variant=success][type=text] .gov-tabs__btn{color:var(--gov-tabs-success-color, var(--gov-color-success-500))}@media not all and (pointer: coarse){.gov-tabs[variant=success][type=text] .gov-tabs__btn:hover{color:var(--gov-tabs-success-color-hover, var(--gov-color-success-700))}}.gov-tabs[variant=success][type=text] .gov-tabs__btn[aria-selected=true]{border-bottom-color:var(--gov-tabs-success-color-active, var(--gov-color-success-700));color:var(--gov-tabs-success-color-active, var(--gov-color-success-700))}.gov-tabs[variant=warning][type=text] .gov-tabs__btn{color:var(--gov-tabs-warning-color, var(--gov-color-warning-500))}@media not all and (pointer: coarse){.gov-tabs[variant=warning][type=text] .gov-tabs__btn:hover{color:var(--gov-tabs-warning-color-hover, var(--gov-color-warning-700))}}.gov-tabs[variant=warning][type=text] .gov-tabs__btn[aria-selected=true]{border-bottom-color:var(--gov-tabs-warning-color-active, var(--gov-color-warning-700));color:var(--gov-tabs-warning-color-active, var(--gov-color-warning-700))}.gov-tabs[variant=error][type=text] .gov-tabs__btn{color:var(--gov-tabs-error-color, var(--gov-color-error-400))}@media not all and (pointer: coarse){.gov-tabs[variant=error][type=text] .gov-tabs__btn:hover{color:var(--gov-tabs-error-color-hover, var(--gov-color-error-600))}}.gov-tabs[variant=error][type=text] .gov-tabs__btn[aria-selected=true]{border-bottom-color:var(--gov-tabs-error-color-active, var(--gov-color-error-600));color:var(--gov-tabs-error-color-active, var(--gov-color-error-600))}.gov-tabs[orientation=vertical] .gov-tabs__btn{text-align:left}@media (min-width: 75em){.gov-tabs[orientation=vertical]{display:flex;flex-direction:row}.gov-tabs[orientation=vertical] .gov-tabs__list{flex-wrap:nowrap;flex-direction:column;width:-moz-max-content;width:max-content;max-width:30vw;margin-right:1.25rem;padding:0rem 0.5rem;border-bottom:none;border-right:var(--gov-tabs-list-border-width, 0.0625rem solid var(--gov-color-secondary-500))}.gov-tabs[orientation=vertical] .gov-tabs__item{justify-content:flex-end}.gov-tabs[orientation=vertical] .gov-tabs__btn{padding:0.5rem 0.75rem;text-align:right}}";const x=t(class t extends o{constructor(){super();this.__registerHost();this.govChange=r(this,"gov-change",7);this.triggerRefs={};this.controller=[];this.focusIndex=0;this.compactControls=false;this.type="text";this.variant="primary";this.orientation="horizontal";this.wcagLabel=undefined;this.wcagSelectLabel=undefined;this.wcagLabelledBy=undefined;this.h=l(this.host);this.formSelectId=f("GovFormSelect")}validateType(t){s(c,t,n.root)}validateVariant(t){s(v,t,n.root)}componentWillLoad(){this.prepareDataSource()}async componentDidRender(){if(h()){await m(500);await this.validateWcag()}this.resizeObserver()}prepareDataSource(){this.controller=[];const t=[];this.host.querySelectorAll(i.root).forEach((o=>{const r=Promise.all([o.getIdentifier(),o.getTriggerIdentifier()]).then((([t,r])=>{const e=typeof o.getAttribute("default")==="string";return{label:o.getAttribute("label"),contentIdentifier:t,triggerIdentifier:r,element:o,active:false,default:e}}));t.push(r)}));Promise.all(t).then((t=>{let o=t.findIndex((t=>t.default));if(o===-1)o=0;this.focusIndex=o;t[o].active=true;this.controller=[...t];this.reRender()}))}setActiveByIdentifier(t){const o=[];this.controller.map((r=>{r.active=t===r.triggerIdentifier||t===r.contentIdentifier;o.push(r)}));this.controller=[...o]}reRender(){this.controller.map((t=>{t.element.setActiveStatus(t.active)}))}resizeObserver(){const t=new ResizeObserver(p((()=>{}),200));t.observe(this.tabsRef)}render(){return e(a,{class:this.h.classes(n.root),variant:this.variant,type:this.type,role:"tablist",ref:t=>this.tabsRef=t,"aria-label":this.wcagLabel,"aria-labelledby":this.wcagLabelledBy,onKeyDown:this.onKeydownHandler.bind(this)},e("div",{class:n.tabs,"aria-hidden":g(this.compactControls)},e("ul",{class:n.list},this.controller.map(((t,o)=>e("li",{class:n.item},this.type=="text"?e("button",{class:n.btn,id:t.triggerIdentifier,role:"tab",onClick:()=>this.onSelectHandler(t,o),"aria-selected":g(t.active),"aria-controls":t.contentIdentifier,tabindex:t.active?0:-1,ref:o=>this.triggerRefs[t.triggerIdentifier]=o},t.label):e("gov-chip",{role:"tab",tag:"button",identifier:t.triggerIdentifier,"wcag-selected":t.active,"wcag-controls":t.contentIdentifier,focusable:t.active,variant:this.variant,inverse:!t.active,ref:o=>this.triggerRefs[t.triggerIdentifier]=o,"on-gov-click":()=>this.onSelectHandler(t,o)},t.label)))))),e("span",{id:this.formSelectId,hidden:true},this.wcagSelectLabel),this.compactControls?e("gov-form-select",{"wcag-labelled-by":this.formSelectId,"onGov-change":this.onChangeHandler.bind(this)},this.controller.map((t=>e("option",{value:t.triggerIdentifier,selected:t.active},t.label)))):null,e("slot",null))}getCurrentTab(){return this.controller.find((t=>t.active))||null}onSelectHandler(t,o){this.focusIndex=o;this.setActiveByIdentifier(t.triggerIdentifier);this.reRender();this.govChange.emit(this.getCurrentTab().element)}onChangeHandler(t){const o=t.target.value;t.stopPropagation();this.setActiveByIdentifier(o);this.reRender();this.govChange.emit(this.getCurrentTab().element)}onKeydownHandler(t){const o=t.keyCode;t.stopPropagation();if([37,38,39,40].includes(o)){if(false===(this.focusIndex>=0&&this.focusIndex<=this.controller.length-1)){return}this.controller[this.focusIndex].active=false;if(o===39||o===40){this.focusIndex++;if(this.focusIndex>=this.controller.length){this.focusIndex=0}}else if(o===37||o===38){this.focusIndex--;if(this.focusIndex<0){this.focusIndex=this.controller.length-1}}if(this.focusIndex>=0&&this.focusIndex<=this.controller.length-1){const t=this.controller[this.focusIndex];t.active=true;const o=this.triggerRefs[t.triggerIdentifier];if(o.nodeName.toLowerCase()==="gov-chip"){this.triggerRefs[t.triggerIdentifier].setFocus()}else{this.triggerRefs[t.triggerIdentifier].focus()}this.controller=[...this.controller];this.reRender();this.govChange.emit(this.getCurrentTab().element)}}}async refresh(){this.prepareDataSource()}async currentTab(){return this.getCurrentTab().element||null}async setActiveTab(t){this.setActiveByIdentifier(t);this.reRender()}async validateWcag(){b(this.wcagSelectLabel,"wcag-select-label",n.root);d(this.wcagLabel,this.wcagLabelledBy,n.root)}get host(){return this}static get watchers(){return{type:["validateType"],variant:["validateVariant"]}}static get style(){return w}},[4,"gov-tabs",{type:[1],variant:[1],orientation:[1],wcagLabel:[1,"wcag-label"],wcagSelectLabel:[1,"wcag-select-label"],wcagLabelledBy:[1,"wcag-labelled-by"],controller:[32],focusIndex:[32],compactControls:[32],refresh:[64],currentTab:[64],setActiveTab:[64],validateWcag:[64]}]);function k(){if(typeof customElements==="undefined"){return}const t=["gov-tabs","gov-chip","gov-form-select","gov-icon"];t.forEach((t=>{switch(t){case"gov-tabs":if(!customElements.get(t)){customElements.define(t,x)}break;case"gov-chip":if(!customElements.get(t)){u()}break;case"gov-form-select":if(!customElements.get(t)){y()}break;case"gov-icon":if(!customElements.get(t)){_()}break}}))}k();const j=x;const T=k;export{j as GovTabs,T as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=gov-tabs.js.map
|