@gov-design-system-ce/components 4.1.3-BETA-7 → 4.1.3-BETA-8

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.
Files changed (58) hide show
  1. package/dist/cjs/gov-flex_3.cjs.entry.js +3 -1
  2. package/dist/cjs/gov-flex_3.cjs.entry.js.map +1 -1
  3. package/dist/collection/utils/icon.utils.js +2 -0
  4. package/dist/collection/utils/icon.utils.js.map +1 -1
  5. package/dist/components/gov-accordion-item.js +1 -1
  6. package/dist/components/gov-attachments-item.js +1 -1
  7. package/dist/components/gov-breadcrumbs.js +1 -1
  8. package/dist/components/gov-breadcrumbs.js.map +1 -1
  9. package/dist/components/gov-button.js +1 -1
  10. package/dist/components/gov-card.js +1 -1
  11. package/dist/components/gov-chip.js +1 -1
  12. package/dist/components/gov-dialog.js +1 -1
  13. package/dist/components/gov-form-autocomplete.js +1 -1
  14. package/dist/components/gov-form-checkbox.js +1 -1
  15. package/dist/components/gov-form-file.js +1 -1
  16. package/dist/components/gov-form-file.js.map +1 -1
  17. package/dist/components/gov-form-input.js +1 -1
  18. package/dist/components/gov-form-multi-select.js +1 -1
  19. package/dist/components/gov-form-select.js +1 -1
  20. package/dist/components/gov-form-switch.js +1 -1
  21. package/dist/components/gov-icon.js +1 -1
  22. package/dist/components/gov-infobar.js +1 -1
  23. package/dist/components/gov-link.js +1 -1
  24. package/dist/components/gov-loading.js +1 -1
  25. package/dist/components/gov-pagination.js +1 -1
  26. package/dist/components/gov-tabs.js +1 -1
  27. package/dist/components/gov-tag.js +1 -1
  28. package/dist/components/gov-theme-switch.js +1 -1
  29. package/dist/components/gov-tile.js +1 -1
  30. package/dist/components/gov-toast.js +1 -1
  31. package/dist/components/gov-tooltip-content.js +1 -1
  32. package/dist/components/gov-wizard-item.js +1 -1
  33. package/dist/components/{p-c67a25ad.js → p-0679f3d6.js} +2 -2
  34. package/dist/components/{p-7d808445.js → p-51693b62.js} +2 -2
  35. package/dist/components/p-7f0c6ba3.js +2 -0
  36. package/dist/components/p-7f0c6ba3.js.map +1 -0
  37. package/dist/components/{p-2237d3a5.js → p-884d8f16.js} +2 -2
  38. package/dist/components/{p-f4ca9c18.js → p-887df980.js} +2 -2
  39. package/dist/components/{p-94002301.js → p-8f40dfec.js} +2 -2
  40. package/dist/components/{p-9992e831.js → p-9b0f446d.js} +2 -2
  41. package/dist/core/core.esm.js +1 -1
  42. package/dist/core/p-2642cc66.entry.js +2 -0
  43. package/dist/core/p-2642cc66.entry.js.map +1 -0
  44. package/dist/esm/gov-flex_3.entry.js +3 -1
  45. package/dist/esm/gov-flex_3.entry.js.map +1 -1
  46. package/dist/hydrate/index.js +3 -1
  47. package/dist/hydrate/index.mjs +3 -1
  48. package/package.json +1 -1
  49. package/dist/components/p-88b2667e.js +0 -2
  50. package/dist/components/p-88b2667e.js.map +0 -1
  51. package/dist/core/p-f14252eb.entry.js +0 -2
  52. package/dist/core/p-f14252eb.entry.js.map +0 -1
  53. /package/dist/components/{p-c67a25ad.js.map → p-0679f3d6.js.map} +0 -0
  54. /package/dist/components/{p-7d808445.js.map → p-51693b62.js.map} +0 -0
  55. /package/dist/components/{p-2237d3a5.js.map → p-884d8f16.js.map} +0 -0
  56. /package/dist/components/{p-f4ca9c18.js.map → p-887df980.js.map} +0 -0
  57. /package/dist/components/{p-94002301.js.map → p-8f40dfec.js.map} +0 -0
  58. /package/dist/components/{p-9992e831.js.map → p-9b0f446d.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{p as e,H as i,b as a}from"./p-2ee042d4.js";export{s as setNonce}from"./p-2ee042d4.js";import{g as l}from"./p-e1255160.js";var t=()=>{{o(i.prototype)}const a=import.meta.url;const l={};if(a!==""){l.resourcesUrl=new URL(".",a).href}return e(l)};var o=e=>{const i=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return i.call(this,e)}const a=i.call(this,false);const l=this.childNodes;if(e){for(let e=0;e<l.length;e++){if(l[e].nodeType!==2){a.appendChild(l[e].cloneNode(true))}}}return a}};t().then((async e=>{await l();return a(JSON.parse('[["p-3849ca02",[[4,"gov-form-file",{"expanded":[4],"required":[4],"disabled":[516],"resetAfterPick":[4,"reset-after-pick"],"ignoreFileDuplicationCheck":[4,"ignore-file-duplication-check"],"displayAttachments":[4,"display-attachments"],"name":[1],"accept":[1],"multiple":[4],"maxFileSize":[2,"max-file-size"],"identifier":[1],"invalid":[4],"errorSize":[1,"error-size"],"errorAccept":[1,"error-accept"],"accessibleRemoveLabel":[1,"accessible-remove-label"],"accessibleAttachmentsLabel":[1,"accessible-attachments-label"],"files":[32],"inheritedAttributes":[32],"getRef":[64],"getAreaRef":[64],"reset":[64]},null,{"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-032accfb",[[4,"gov-form-multi-select",{"value":[1537],"options":[1537],"identifier":[1],"placeholder":[1],"size":[1],"name":[1],"hideSelectedList":[4,"hide-selected-list"],"required":[4],"disabled":[516],"invalid":[516],"success":[4],"messageEmpty":[1,"message-empty"],"messageLoading":[1,"message-loading"],"focused":[32],"valueState":[32],"selectedOptionsState":[32],"optionsState":[32],"inheritedAttributes":[32],"setFocus":[64],"setValue":[64],"getRef":[64]},null,{"size":["validateSize"],"options":["watchOptions"],"value":["watchValue"]}]]],["p-cecbe73f",[[4,"gov-dialog",{"open":[1540],"blockClose":[4,"block-close"],"blockBackdropClose":[4,"block-backdrop-close"],"role":[1],"labelTag":[1,"label-tag"],"accessibleLabelledBy":[1,"accessible-labelled-by"],"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleCloseLabel":[1,"accessible-close-label"],"accessibleCloseLabelledBy":[1,"accessible-close-labelled-by"],"setFocus":[64],"validateAccessibility":[64]},null,{"open":["watchOpen"]}]]],["p-e0a199ff",[[0,"gov-pagination",{"type":[1],"current":[2],"total":[2],"selectIdentifier":[1,"select-identifier"],"size":[1],"color":[1],"pageSize":[2,"page-size"],"maxPages":[2,"max-pages"],"link":[1],"accessibleSelectLabel":[1,"accessible-select-label"],"accessiblePageLabel":[1,"accessible-page-label"],"labelPrev":[1,"label-prev"],"labelStart":[1,"label-start"],"labelNext":[1,"label-next"],"labelEnd":[1,"label-end"],"pagination":[32],"inheritedAttributes":[32]},null,{"type":["validateType"],"size":["validateSize"],"color":["validateColor"],"current":["recalculate"],"total":["recalculate"],"pageSize":["recalculate"],"maxPages":["recalculate"]}]]],["p-9f8d69a9",[[4,"gov-breadcrumbs",{"collapsible":[4],"isExpanded":[4,"is-expanded"],"accessibleLabel":[1,"accessible-label"],"accessibleLabelledBy":[1,"accessible-labelledby"],"accessibleToggleLabel":[1,"accessible-toggle-label"],"expanded":[32],"toggleOption":[32],"validateAccessibility":[64]}]]],["p-d9b42773",[[4,"gov-infobar",{"color":[1],"type":[1],"role":[1],"accessibleCloseLabel":[1,"accessible-close-label"],"accessibleToggleLabel":[1,"accessible-toggle-label"],"closable":[4],"toggleContent":[32],"inheritedAttributes":[32]},null,{"color":["validateColor"]}]]],["p-b62e49ee",[[4,"gov-loading",{"size":[1]},null,{"size":["validateSize"]}]]],["p-017ff5a5",[[4,"gov-tabs",{"type":[1],"size":[1],"color":[1],"orientation":[1],"direction":[513],"controllers":[32],"focusIndex":[32],"inheritedAttributes":[32],"refresh":[64],"currentTab":[64],"setActiveTab":[64],"rerender":[64]},null,{"type":["validateType"],"color":["validateColor"],"size":["validateSize"]}]]],["p-5c3f4cfe",[[4,"gov-toast",{"color":[1],"gravity":[1],"position":[1],"type":[1],"time":[2],"closeLabel":[1,"close-label"],"accessibleCloseLabel":[1,"accessible-close-label"],"inheritedAttributes":[32],"destroy":[64]},null,{"color":["validateColor"]}]]],["p-7baee44f",[[4,"gov-tooltip-content",{"color":[1],"size":[1],"persist":[4],"isVisible":[1028,"is-visible"],"parentId":[1,"parent-id"]},null,{"isVisible":["visibleContent"]}]]],["p-77daba72",[[4,"gov-accordion-item",{"identifier":[1],"size":[1025],"disabled":[4],"open":[1028],"openState":[32],"toggle":[64],"currentState":[64]},null,{"size":["validateSize"]}]]],["p-8cc5ad01",[[4,"gov-card",{"direction":[1],"collapsible":[4],"open":[1540],"accessibleTriggerLabel":[1,"accessible-label"],"accessibleTriggerLabelledBy":[1,"accessible-labelledby"],"validateAccessibility":[64]}]]],["p-33310735",[[4,"gov-form-checkbox",{"value":[1],"checked":[1540],"required":[4],"disabled":[516],"indeterminate":[516],"name":[1],"size":[513],"identifier":[1],"noLabel":[4,"no-label"],"invalid":[4],"inheritedAttributes":[32],"getRef":[64]},null,{"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-9846fd13",[[4,"gov-form-switch",{"value":[1],"noLabel":[4,"no-label"],"checked":[1540],"required":[4],"disabled":[516],"name":[1],"size":[513],"identifier":[1],"invalid":[4],"inheritedAttributes":[32],"getRef":[64]},null,{"size":["validateSize","watchDisabled"],"disabled":["watchDisabled"],"invalid":["watchDisabled"]}]]],["p-10f773c2",[[4,"gov-link",{"size":[1],"external":[4],"href":[1],"target":[1],"inheritedAttributes":[32]},null,{"size":["validateSize"]}]]],["p-269071f5",[[4,"gov-tag",{"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"size":[513],"color":[513],"type":[513],"expanded":[516]},null,{"color":["validateColor"],"size":["validateSize"]}]]],["p-ee55932a",[[4,"gov-tile",{"size":[513],"orientation":[1],"noBorder":[4,"no-border"],"href":[513],"target":[1],"getTriggerRef":[64]}]]],["p-f7f60f91",[[4,"gov-wizard-item",{"color":[1],"size":[1],"identifier":[1],"collapsible":[4],"disabled":[4],"isExpanded":[1028,"is-expanded"],"open":[64],"close":[64],"toggle":[64],"currentState":[64]},null,{"color":["validateColor"]}]]],["p-0f0f7302",[[4,"gov-accordion",{"size":[1],"noBorder":[4,"no-border"]},null,{"size":["validateSize"]}]]],["p-3a7381e7",[[4,"gov-container"]]],["p-50af9ae8",[[4,"gov-control-group",{"color":[1],"noBorder":[4,"no-border"],"fitContent":[4,"fit-content"]},null,{"color":["validateColor"]}]]],["p-0c076b21",[[4,"gov-cookiebar"]]],["p-f2bb8c29",[[4,"gov-dropdown",{"identifier":[1],"open":[1028],"position":[1],"getState":[64],"toggle":[64]},null,{"open":["watchOpen"]}]]],["p-ed02945f",[[4,"gov-empty",{"size":[1]},null,{"size":["validateSize"]}]]],["p-4fa0320d",[[4,"gov-error-code"]]],["p-1aa7450e",[[4,"gov-form-checkbox-group",{"gap":[1],"orientation":[1],"value":[1025]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-e215f3ee",[[4,"gov-form-control",{"identifier":[1],"invalid":[516],"disabled":[516],"success":[516],"fieldset":[4],"size":[1]}]]],["p-45b759f4",[[4,"gov-form-group",{"gap":[1],"orientation":[1]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-37473c34",[[4,"gov-form-label",{"identifier":[1],"size":[1],"required":[4],"legend":[4]}]]],["p-43d3dbc0",[[4,"gov-form-password-power",{"power":[514]}]]],["p-994385ca",[[4,"gov-form-radio",{"value":[1],"noLabel":[4,"no-label"],"checked":[1540],"required":[4],"disabled":[516],"name":[1],"size":[1],"identifier":[1],"invalid":[4],"inheritedAttributes":[32],"getRef":[64]},null,{"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-237a5b91",[[4,"gov-form-radio-group",{"gap":[1],"orientation":[1],"value":[1025]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-347d15d5",[[4,"gov-form-search",{"size":[1],"color":[513]}]]],["p-d795a421",[[4,"gov-grid",{"alignX":[1,"align-x"],"alignY":[1,"align-y"]}]]],["p-8bb6c816",[[4,"gov-grid-item",{"size":[1],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]}]]],["p-71f5d4ff",[[4,"gov-layout",{"type":[1],"variant":[1],"inverse":[4]}]]],["p-4c60e125",[[4,"gov-layout-column"]]],["p-a6a9de9a",[[0,"gov-lifecycle"]]],["p-14d66f26",[[4,"gov-message",{"color":[1],"type":[1]},null,{"color":["validateColor"]}]]],["p-7dfb7e36",[[0,"gov-spacer",{"size":[1],"breakpoint":[1]},null,{"size":["validateSize"],"breakpoint":["validateBreakpoint"]}]]],["p-c0800e6d",[[4,"gov-stepper",{"size":[1]},null,{"size":["validateSize"]}]]],["p-4e29744a",[[4,"gov-stepper-item",{"color":[1],"size":[1],"identifier":[1]},null,{"color":["validateColor"]}]]],["p-063b70a2",[[4,"gov-tabs-item",{"identifier":[1],"triggerIdentifier":[1,"trigger-identifier"],"label":[513],"disabled":[516],"iconStart":[513,"icon-start"],"iconEnd":[513,"icon-end"],"default":[4],"isActive":[32],"getIdentifier":[64],"getTriggerIdentifier":[64],"getDisableState":[64],"setActiveStatus":[64]},null,{"label":["rerenderParent"],"disabled":["rerenderParent"]}]]],["p-09c9eba6",[[4,"gov-tiles",{"columns":[514]}]]],["p-967a1094",[[4,"gov-tooltip",{"color":[1],"size":[1],"position":[1025],"message":[1],"identifier":[1],"icon":[516],"persist":[32],"show":[64],"hide":[64]},null,{"color":["validateColor"],"size":["validateSize"],"position":["validatePosition"],"message":["rerenderMessage"]}]]],["p-927c31dd",[[4,"gov-wizard",{"size":[1],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]},null,{"size":["validateSize"]}]]],["p-f14252eb",[[0,"gov-theme-switch",{"size":[1],"displayLabel":[4,"display-label"],"ariaLabelLight":[1,"aria-label-light"],"ariaLabelDark":[1,"aria-label-dark"],"labelLight":[1,"label-light"],"labelDark":[1,"label-dark"],"theme":[32]},null,{"size":["validateSize"],"theme":["watchTheme"]}],[4,"gov-flex",{"direction":[1],"justifyContent":[513,"justify-content"],"alignItems":[513,"align-items"],"wrap":[513],"alignContent":[513,"align-content"],"alignSelf":[513,"align-self"],"gap":[513]}],[0,"gov-icon",{"size":[513],"color":[513],"name":[513],"type":[513],"visible":[32],"error":[32]},null,{"size":["validateSize"],"color":["validateColor"],"error":["watchError"],"name":["loadIconPathData"]}]]],["p-0724cb6a",[[4,"gov-button",{"color":[513],"size":[513],"type":[513],"expanded":[516],"name":[1],"disabled":[516],"nativeType":[1,"native-type"],"href":[1],"target":[1],"download":[4],"hreflang":[1],"referrerpolicy":[1],"rel":[1],"loading":[1],"focusable":[4],"identifier":[1],"inheritedAttributes":[32],"setFocus":[64],"getRef":[64],"validateAccessibility":[64]},null,{"color":["validateColor"],"type":["validateType"],"size":["validateSize"],"nativeType":["validateNativeType"]}]]],["p-fcac8531",[[4,"gov-form-autocomplete",{"value":[1537],"options":[1537],"identifier":[1],"success":[4],"size":[1],"nameKey":[1,"name-key"],"name":[1],"required":[4],"disabled":[516],"placeholder":[1],"readonly":[4],"invalid":[4],"minlength":[2],"maxlength":[2],"throttleTime":[2,"throttle-time"],"messageEmpty":[1,"message-empty"],"focused":[32],"processing":[32],"arrowCounter":[32],"list":[32],"inheritedAttributes":[32],"setFocus":[64],"setBlur":[64],"setOptions":[64],"clearValue":[64],"setProcessing":[64],"setSearchCallback":[64],"setTemplateResolver":[64]},null,{"size":["validateSize"],"options":["watchOptions"]}]]],["p-f54edd6c",[[4,"gov-chip",{"disabled":[516],"href":[1],"target":[1],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"size":[1],"tag":[1],"color":[1],"type":[513],"focusable":[4],"identifier":[1],"inheritedAttributes":[32],"geRef":[64],"setFocus":[64]},null,{"color":["validateColor"],"size":["validateSize"]}]]],["p-058e6fe2",[[4,"gov-form-select",{"value":[1537],"options":[1537],"identifier":[1],"size":[1],"name":[1],"required":[4],"success":[516],"disabled":[516],"invalid":[4],"focused":[32],"optionsState":[32],"inheritedAttributes":[32],"setFocus":[64],"getRef":[64]},null,{"size":["validateSize","watchControlAttrs"],"options":["watchOptions"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"],"success":["watchControlAttrs"],"value":["watchValue"]}]]],["p-906865d0",[[0,"gov-backdrop",{"inverse":[4],"disabled":[1540],"accessibleLabel":[1,"accessible-label"],"accessibleLabelledBy":[1,"accessible-labelledby"],"validateAccessibility":[64]}]]],["p-7a21fb90",[[4,"gov-attachments-item",{"accessibleRemoveLabel":[1,"accessible-remove-label"],"accessibleRemoveLabelledBy":[1,"accessible-remove-labelledby"],"validateAccessibility":[64]}],[4,"gov-attachments",{"label":[1],"wcagLabel":[1,"wcag-label"],"validateWcag":[64]}],[4,"gov-form-message",{"color":[1],"size":[1],"identifier":[64]},null,{"color":["validateColor"]}]]],["p-6b7c3a96",[[4,"gov-form-input",{"value":[1537],"identifier":[1],"success":[516],"size":[1],"name":[1],"multiline":[4],"rows":[2],"cols":[2],"required":[516],"disabled":[516],"placeholder":[1],"readonly":[4],"minlength":[2],"maxlength":[2],"min":[8],"max":[8],"autocomplete":[4],"autocorrect":[4],"spellcheck":[4],"inputLang":[1,"input-lang"],"type":[1],"inputType":[1,"input-type"],"role":[1],"invalid":[516],"accessibleShowPasswordLabel":[1,"accessible-show-password-label"],"accessibleHidePasswordLabel":[1,"accessible-hide-password-label"],"focused":[32],"showPassword":[32],"inheritedAttributes":[32],"setFocus":[64],"setValue":[64],"clearValue":[64],"getRef":[64]},null,{"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"],"success":["watchControlAttrs"]}],[0,"gov-skeleton",{"size":[1],"color":[1],"shape":[1],"width":[1],"height":[1],"animation":[1],"inheritedAttributes":[32]},null,{"size":["validateSize"],"shape":["validateShape"],"animation":["validateAnimation"]}]]]]'),e)}));
1
+ import{p as e,H as i,b as a}from"./p-2ee042d4.js";export{s as setNonce}from"./p-2ee042d4.js";import{g as l}from"./p-e1255160.js";var t=()=>{{o(i.prototype)}const a=import.meta.url;const l={};if(a!==""){l.resourcesUrl=new URL(".",a).href}return e(l)};var o=e=>{const i=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return i.call(this,e)}const a=i.call(this,false);const l=this.childNodes;if(e){for(let e=0;e<l.length;e++){if(l[e].nodeType!==2){a.appendChild(l[e].cloneNode(true))}}}return a}};t().then((async e=>{await l();return a(JSON.parse('[["p-3849ca02",[[4,"gov-form-file",{"expanded":[4],"required":[4],"disabled":[516],"resetAfterPick":[4,"reset-after-pick"],"ignoreFileDuplicationCheck":[4,"ignore-file-duplication-check"],"displayAttachments":[4,"display-attachments"],"name":[1],"accept":[1],"multiple":[4],"maxFileSize":[2,"max-file-size"],"identifier":[1],"invalid":[4],"errorSize":[1,"error-size"],"errorAccept":[1,"error-accept"],"accessibleRemoveLabel":[1,"accessible-remove-label"],"accessibleAttachmentsLabel":[1,"accessible-attachments-label"],"files":[32],"inheritedAttributes":[32],"getRef":[64],"getAreaRef":[64],"reset":[64]},null,{"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-032accfb",[[4,"gov-form-multi-select",{"value":[1537],"options":[1537],"identifier":[1],"placeholder":[1],"size":[1],"name":[1],"hideSelectedList":[4,"hide-selected-list"],"required":[4],"disabled":[516],"invalid":[516],"success":[4],"messageEmpty":[1,"message-empty"],"messageLoading":[1,"message-loading"],"focused":[32],"valueState":[32],"selectedOptionsState":[32],"optionsState":[32],"inheritedAttributes":[32],"setFocus":[64],"setValue":[64],"getRef":[64]},null,{"size":["validateSize"],"options":["watchOptions"],"value":["watchValue"]}]]],["p-cecbe73f",[[4,"gov-dialog",{"open":[1540],"blockClose":[4,"block-close"],"blockBackdropClose":[4,"block-backdrop-close"],"role":[1],"labelTag":[1,"label-tag"],"accessibleLabelledBy":[1,"accessible-labelled-by"],"accessibleDescribedBy":[1,"accessible-described-by"],"accessibleCloseLabel":[1,"accessible-close-label"],"accessibleCloseLabelledBy":[1,"accessible-close-labelled-by"],"setFocus":[64],"validateAccessibility":[64]},null,{"open":["watchOpen"]}]]],["p-e0a199ff",[[0,"gov-pagination",{"type":[1],"current":[2],"total":[2],"selectIdentifier":[1,"select-identifier"],"size":[1],"color":[1],"pageSize":[2,"page-size"],"maxPages":[2,"max-pages"],"link":[1],"accessibleSelectLabel":[1,"accessible-select-label"],"accessiblePageLabel":[1,"accessible-page-label"],"labelPrev":[1,"label-prev"],"labelStart":[1,"label-start"],"labelNext":[1,"label-next"],"labelEnd":[1,"label-end"],"pagination":[32],"inheritedAttributes":[32]},null,{"type":["validateType"],"size":["validateSize"],"color":["validateColor"],"current":["recalculate"],"total":["recalculate"],"pageSize":["recalculate"],"maxPages":["recalculate"]}]]],["p-9f8d69a9",[[4,"gov-breadcrumbs",{"collapsible":[4],"isExpanded":[4,"is-expanded"],"accessibleLabel":[1,"accessible-label"],"accessibleLabelledBy":[1,"accessible-labelledby"],"accessibleToggleLabel":[1,"accessible-toggle-label"],"expanded":[32],"toggleOption":[32],"validateAccessibility":[64]}]]],["p-d9b42773",[[4,"gov-infobar",{"color":[1],"type":[1],"role":[1],"accessibleCloseLabel":[1,"accessible-close-label"],"accessibleToggleLabel":[1,"accessible-toggle-label"],"closable":[4],"toggleContent":[32],"inheritedAttributes":[32]},null,{"color":["validateColor"]}]]],["p-b62e49ee",[[4,"gov-loading",{"size":[1]},null,{"size":["validateSize"]}]]],["p-017ff5a5",[[4,"gov-tabs",{"type":[1],"size":[1],"color":[1],"orientation":[1],"direction":[513],"controllers":[32],"focusIndex":[32],"inheritedAttributes":[32],"refresh":[64],"currentTab":[64],"setActiveTab":[64],"rerender":[64]},null,{"type":["validateType"],"color":["validateColor"],"size":["validateSize"]}]]],["p-5c3f4cfe",[[4,"gov-toast",{"color":[1],"gravity":[1],"position":[1],"type":[1],"time":[2],"closeLabel":[1,"close-label"],"accessibleCloseLabel":[1,"accessible-close-label"],"inheritedAttributes":[32],"destroy":[64]},null,{"color":["validateColor"]}]]],["p-7baee44f",[[4,"gov-tooltip-content",{"color":[1],"size":[1],"persist":[4],"isVisible":[1028,"is-visible"],"parentId":[1,"parent-id"]},null,{"isVisible":["visibleContent"]}]]],["p-77daba72",[[4,"gov-accordion-item",{"identifier":[1],"size":[1025],"disabled":[4],"open":[1028],"openState":[32],"toggle":[64],"currentState":[64]},null,{"size":["validateSize"]}]]],["p-8cc5ad01",[[4,"gov-card",{"direction":[1],"collapsible":[4],"open":[1540],"accessibleTriggerLabel":[1,"accessible-label"],"accessibleTriggerLabelledBy":[1,"accessible-labelledby"],"validateAccessibility":[64]}]]],["p-33310735",[[4,"gov-form-checkbox",{"value":[1],"checked":[1540],"required":[4],"disabled":[516],"indeterminate":[516],"name":[1],"size":[513],"identifier":[1],"noLabel":[4,"no-label"],"invalid":[4],"inheritedAttributes":[32],"getRef":[64]},null,{"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-9846fd13",[[4,"gov-form-switch",{"value":[1],"noLabel":[4,"no-label"],"checked":[1540],"required":[4],"disabled":[516],"name":[1],"size":[513],"identifier":[1],"invalid":[4],"inheritedAttributes":[32],"getRef":[64]},null,{"size":["validateSize","watchDisabled"],"disabled":["watchDisabled"],"invalid":["watchDisabled"]}]]],["p-10f773c2",[[4,"gov-link",{"size":[1],"external":[4],"href":[1],"target":[1],"inheritedAttributes":[32]},null,{"size":["validateSize"]}]]],["p-269071f5",[[4,"gov-tag",{"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"size":[513],"color":[513],"type":[513],"expanded":[516]},null,{"color":["validateColor"],"size":["validateSize"]}]]],["p-ee55932a",[[4,"gov-tile",{"size":[513],"orientation":[1],"noBorder":[4,"no-border"],"href":[513],"target":[1],"getTriggerRef":[64]}]]],["p-f7f60f91",[[4,"gov-wizard-item",{"color":[1],"size":[1],"identifier":[1],"collapsible":[4],"disabled":[4],"isExpanded":[1028,"is-expanded"],"open":[64],"close":[64],"toggle":[64],"currentState":[64]},null,{"color":["validateColor"]}]]],["p-0f0f7302",[[4,"gov-accordion",{"size":[1],"noBorder":[4,"no-border"]},null,{"size":["validateSize"]}]]],["p-3a7381e7",[[4,"gov-container"]]],["p-50af9ae8",[[4,"gov-control-group",{"color":[1],"noBorder":[4,"no-border"],"fitContent":[4,"fit-content"]},null,{"color":["validateColor"]}]]],["p-0c076b21",[[4,"gov-cookiebar"]]],["p-f2bb8c29",[[4,"gov-dropdown",{"identifier":[1],"open":[1028],"position":[1],"getState":[64],"toggle":[64]},null,{"open":["watchOpen"]}]]],["p-ed02945f",[[4,"gov-empty",{"size":[1]},null,{"size":["validateSize"]}]]],["p-4fa0320d",[[4,"gov-error-code"]]],["p-1aa7450e",[[4,"gov-form-checkbox-group",{"gap":[1],"orientation":[1],"value":[1025]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-e215f3ee",[[4,"gov-form-control",{"identifier":[1],"invalid":[516],"disabled":[516],"success":[516],"fieldset":[4],"size":[1]}]]],["p-45b759f4",[[4,"gov-form-group",{"gap":[1],"orientation":[1]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-37473c34",[[4,"gov-form-label",{"identifier":[1],"size":[1],"required":[4],"legend":[4]}]]],["p-43d3dbc0",[[4,"gov-form-password-power",{"power":[514]}]]],["p-994385ca",[[4,"gov-form-radio",{"value":[1],"noLabel":[4,"no-label"],"checked":[1540],"required":[4],"disabled":[516],"name":[1],"size":[1],"identifier":[1],"invalid":[4],"inheritedAttributes":[32],"getRef":[64]},null,{"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"]}]]],["p-237a5b91",[[4,"gov-form-radio-group",{"gap":[1],"orientation":[1],"value":[1025]},null,{"gap":["validateGap"],"orientation":["validateOrientation"]}]]],["p-347d15d5",[[4,"gov-form-search",{"size":[1],"color":[513]}]]],["p-d795a421",[[4,"gov-grid",{"alignX":[1,"align-x"],"alignY":[1,"align-y"]}]]],["p-8bb6c816",[[4,"gov-grid-item",{"size":[1],"sizeSm":[1,"size-sm"],"sizeMd":[1,"size-md"],"sizeLg":[1,"size-lg"],"sizeXl":[1,"size-xl"]}]]],["p-71f5d4ff",[[4,"gov-layout",{"type":[1],"variant":[1],"inverse":[4]}]]],["p-4c60e125",[[4,"gov-layout-column"]]],["p-a6a9de9a",[[0,"gov-lifecycle"]]],["p-14d66f26",[[4,"gov-message",{"color":[1],"type":[1]},null,{"color":["validateColor"]}]]],["p-7dfb7e36",[[0,"gov-spacer",{"size":[1],"breakpoint":[1]},null,{"size":["validateSize"],"breakpoint":["validateBreakpoint"]}]]],["p-c0800e6d",[[4,"gov-stepper",{"size":[1]},null,{"size":["validateSize"]}]]],["p-4e29744a",[[4,"gov-stepper-item",{"color":[1],"size":[1],"identifier":[1]},null,{"color":["validateColor"]}]]],["p-063b70a2",[[4,"gov-tabs-item",{"identifier":[1],"triggerIdentifier":[1,"trigger-identifier"],"label":[513],"disabled":[516],"iconStart":[513,"icon-start"],"iconEnd":[513,"icon-end"],"default":[4],"isActive":[32],"getIdentifier":[64],"getTriggerIdentifier":[64],"getDisableState":[64],"setActiveStatus":[64]},null,{"label":["rerenderParent"],"disabled":["rerenderParent"]}]]],["p-09c9eba6",[[4,"gov-tiles",{"columns":[514]}]]],["p-967a1094",[[4,"gov-tooltip",{"color":[1],"size":[1],"position":[1025],"message":[1],"identifier":[1],"icon":[516],"persist":[32],"show":[64],"hide":[64]},null,{"color":["validateColor"],"size":["validateSize"],"position":["validatePosition"],"message":["rerenderMessage"]}]]],["p-927c31dd",[[4,"gov-wizard",{"size":[1],"wcagLabel":[1,"wcag-label"],"wcagLabelledBy":[1,"wcag-labelled-by"],"validateWcag":[64]},null,{"size":["validateSize"]}]]],["p-2642cc66",[[0,"gov-theme-switch",{"size":[1],"displayLabel":[4,"display-label"],"ariaLabelLight":[1,"aria-label-light"],"ariaLabelDark":[1,"aria-label-dark"],"labelLight":[1,"label-light"],"labelDark":[1,"label-dark"],"theme":[32]},null,{"size":["validateSize"],"theme":["watchTheme"]}],[4,"gov-flex",{"direction":[1],"justifyContent":[513,"justify-content"],"alignItems":[513,"align-items"],"wrap":[513],"alignContent":[513,"align-content"],"alignSelf":[513,"align-self"],"gap":[513]}],[0,"gov-icon",{"size":[513],"color":[513],"name":[513],"type":[513],"visible":[32],"error":[32]},null,{"size":["validateSize"],"color":["validateColor"],"error":["watchError"],"name":["loadIconPathData"]}]]],["p-0724cb6a",[[4,"gov-button",{"color":[513],"size":[513],"type":[513],"expanded":[516],"name":[1],"disabled":[516],"nativeType":[1,"native-type"],"href":[1],"target":[1],"download":[4],"hreflang":[1],"referrerpolicy":[1],"rel":[1],"loading":[1],"focusable":[4],"identifier":[1],"inheritedAttributes":[32],"setFocus":[64],"getRef":[64],"validateAccessibility":[64]},null,{"color":["validateColor"],"type":["validateType"],"size":["validateSize"],"nativeType":["validateNativeType"]}]]],["p-fcac8531",[[4,"gov-form-autocomplete",{"value":[1537],"options":[1537],"identifier":[1],"success":[4],"size":[1],"nameKey":[1,"name-key"],"name":[1],"required":[4],"disabled":[516],"placeholder":[1],"readonly":[4],"invalid":[4],"minlength":[2],"maxlength":[2],"throttleTime":[2,"throttle-time"],"messageEmpty":[1,"message-empty"],"focused":[32],"processing":[32],"arrowCounter":[32],"list":[32],"inheritedAttributes":[32],"setFocus":[64],"setBlur":[64],"setOptions":[64],"clearValue":[64],"setProcessing":[64],"setSearchCallback":[64],"setTemplateResolver":[64]},null,{"size":["validateSize"],"options":["watchOptions"]}]]],["p-f54edd6c",[[4,"gov-chip",{"disabled":[516],"href":[1],"target":[1],"iconStart":[1,"icon-start"],"iconEnd":[1,"icon-end"],"size":[1],"tag":[1],"color":[1],"type":[513],"focusable":[4],"identifier":[1],"inheritedAttributes":[32],"geRef":[64],"setFocus":[64]},null,{"color":["validateColor"],"size":["validateSize"]}]]],["p-058e6fe2",[[4,"gov-form-select",{"value":[1537],"options":[1537],"identifier":[1],"size":[1],"name":[1],"required":[4],"success":[516],"disabled":[516],"invalid":[4],"focused":[32],"optionsState":[32],"inheritedAttributes":[32],"setFocus":[64],"getRef":[64]},null,{"size":["validateSize","watchControlAttrs"],"options":["watchOptions"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"],"success":["watchControlAttrs"],"value":["watchValue"]}]]],["p-906865d0",[[0,"gov-backdrop",{"inverse":[4],"disabled":[1540],"accessibleLabel":[1,"accessible-label"],"accessibleLabelledBy":[1,"accessible-labelledby"],"validateAccessibility":[64]}]]],["p-7a21fb90",[[4,"gov-attachments-item",{"accessibleRemoveLabel":[1,"accessible-remove-label"],"accessibleRemoveLabelledBy":[1,"accessible-remove-labelledby"],"validateAccessibility":[64]}],[4,"gov-attachments",{"label":[1],"wcagLabel":[1,"wcag-label"],"validateWcag":[64]}],[4,"gov-form-message",{"color":[1],"size":[1],"identifier":[64]},null,{"color":["validateColor"]}]]],["p-6b7c3a96",[[4,"gov-form-input",{"value":[1537],"identifier":[1],"success":[516],"size":[1],"name":[1],"multiline":[4],"rows":[2],"cols":[2],"required":[516],"disabled":[516],"placeholder":[1],"readonly":[4],"minlength":[2],"maxlength":[2],"min":[8],"max":[8],"autocomplete":[4],"autocorrect":[4],"spellcheck":[4],"inputLang":[1,"input-lang"],"type":[1],"inputType":[1,"input-type"],"role":[1],"invalid":[516],"accessibleShowPasswordLabel":[1,"accessible-show-password-label"],"accessibleHidePasswordLabel":[1,"accessible-hide-password-label"],"focused":[32],"showPassword":[32],"inheritedAttributes":[32],"setFocus":[64],"setValue":[64],"clearValue":[64],"getRef":[64]},null,{"size":["validateSize","watchControlAttrs"],"disabled":["watchControlAttrs"],"invalid":["watchControlAttrs"],"success":["watchControlAttrs"]}],[0,"gov-skeleton",{"size":[1],"color":[1],"shape":[1],"width":[1],"height":[1],"animation":[1],"inheritedAttributes":[32]},null,{"size":["validateSize"],"shape":["validateShape"],"animation":["validateAnimation"]}]]]]'),e)}));
2
2
  //# sourceMappingURL=core.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{r as t,h as e,a as s,g as o,c as i,B as n,d as c}from"./p-2ee042d4.js";import{S as a}from"./p-92f420cb.js";import{g as r}from"./p-ea7fdd2e.js";import{p as h}from"./p-e0e2e9c1.js";import{C as l}from"./p-5aad3497.js";import{i as d,a as u,b as f}from"./p-e8ec030e.js";import{v as m}from"./p-0b3574c2.js";const p={root:"gov-flex"};const b=class{constructor(e){t(this,e);this.direction="row";this.justifyContent=undefined;this.alignItems=undefined;this.wrap=undefined;this.alignContent=undefined;this.alignSelf=undefined;this.gap=undefined;this.h=r(this.host)}render(){return e(s,{key:"08c1591134f0b5c95a18ac9e1d3723c12d9bc47b",class:this.h.classes(p.root)},e("slot",{key:"b66fb8ffa35b0fb98eed3440a55a92a1bd97eb76"}))}get host(){return o(this)}};h(a,["_XS","_S","_M","_L","_XL","_2XL","_3XL","_4XL","_5XL"]);const v=h(l,["DEFAULT","PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING","DISABLED","WHITE","BLACK"]);var g;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(g||(g={}));const w={root:"gov-icon",holder:"gov-icon__holder"};const y="4.1.3-BETA-8";const _=()=>y;const k={};const L={};const C=t=>t.startsWith("http://")||t.startsWith("https://");const S=(t,e,s)=>{if(C(t)){return`${t}/${s}/${e}.svg?v=${_()}`}return i(`${t}/${s}/${e}.svg`)+`?v=${_()}`};async function I({name:t,type:e}){const s=e+"-"+t;console.log("cacheKey",s);console.log("iconCache[cacheKey]",k,k[s]);if(k[s]){return k[s]}console.log("requestCache[cacheKey]",L,L[s]);if(!L[s]){console.log("iconsPath()",d());console.log("name, type",t,e);console.log("iconUrl(iconsPath(), name, type)",S(d(),t,e));L[s]=fetch(S(d(),t,e)).then((t=>{if(t.status===200){return t.text()}else{throw new Error("Gov Icon doesn't exists")}}))}const o=await L[s];k[s]=o;return o}const D=(t,e,s)=>{if(!u){return}let o="";if(s){const t=new Date;t.setTime(t.getTime()+s*24*60*60*1e3);o="; expires="+t.toUTCString()}document.cookie=`${t}=${encodeURIComponent(e)}${o}; path=/`};const E=t=>{if(!u){return null}const e=t+"=";const s=document.cookie.split(";");for(let t=0;t<s.length;t++){let o=s[t].trim();if(o.startsWith(e)){return decodeURIComponent(o.substring(e.length))}}return null};const $=t=>{try{const e=new DOMParser;const s=e.parseFromString(t,"image/svg+xml");const o=s.querySelector("parsererror");if(o){return false}const i=s.documentElement;if(i.tagName.toLowerCase()!=="svg"){return false}return true}catch(t){return false}};const R=class{constructor(e){t(this,e);this.size=undefined;this.color=undefined;this.name=null;this.type="components";this.visible=false;this.error=false;console.log("GovIcon");this.h=r(this.host)}validateSize(t){m(a,t,w.root)}validateColor(t){m(v,t,w.root)}watchError(t){console.log("error",t)}async loadIconPathData(){const{name:t,visible:e}=this;console.log("name, visible",t,e);console.log("Build.isBrowser",n.isBrowser);if(!t||!e){console.log("return");return}await this.loadIcon()}connectedCallback(){console.log("connectedCallback icon",this.name);console.log("iconsLazyLoad()",f());if(f()){this.visible=true;this.loadIconPathData().finally()}else{this.waitUntilVisible((async()=>{this.visible=true;await this.loadIconPathData()}))}}disconnectedCallback(){console.log("disconnectedCallback");if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}}async componentWillLoad(){console.log("componentWillLoad");this.validateSize(this.size);this.validateColor(this.color);await this.loadIconPathData()}waitUntilVisible(t){if(typeof window==="undefined"||!window.IntersectionObserver){t();return}this.intersectionObserver=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}t()}}))}),{rootMargin:"50px"});this.intersectionObserver.observe(this.host)}async loadIcon(){try{const{name:t,type:e}=this;console.log("loadIcon -> name, type",t,e);const s=await I({name:t,type:e});const o=$(s);this.host.innerHTML=o?s:null}catch(t){this.host.innerHTML="";this.error=true}}render(){if(this.error){return null}return e(s,{class:this.h.classes(w.root),size:this.size,color:this.color})}static get assetsDirs(){return["assets"]}get host(){return o(this)}static get watchers(){return{size:["validateSize"],color:["validateColor"],error:["watchError"],name:["loadIconPathData"]}}};const j=h(a,["_XS","_S","_M","_L","_XL"]);const z={root:"gov-theme-switch",indicator:"gov-theme-switch__indicator",iconLight:"gov-theme-switch__icon-light",iconDark:"gov-theme-switch__icon-dark"};const P="data-theme";var x;(function(t){t["auto"]="auto";t["light"]="light";t["dark"]="dark"})(x||(x={}));const A=class{constructor(e){t(this,e);this.govChange=c(this,"gov-change",7);this.setThemeState=t=>{this.theme=t;this.govChange.emit({component:z.root,state:this.theme,ref:this.host})};this.size="m";this.displayLabel=false;this.ariaLabelLight="Přenout na tmavý mód";this.ariaLabelDark="Přepnout na světlý mód";this.labelLight="Světlý mód";this.labelDark="Tmavý mód";this.theme=x.auto;this.h=r(this.host)}validateSize(t){m(j,t,z.root)}watchTheme(t){this.htmlElement.setAttribute(P,t);this.htmlElement.classList.remove(...Object.keys(x));this.htmlElement.classList.add(t);D(P,t)}get storageValue(){return E(P)}get htmlElement(){return document.documentElement}get isSystemPrefersColorDark(){return u&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}componentWillLoad(){this.initDefaultState();this.validateSize(this.size)}initDefaultState(){const t=Object.keys(x);let e=this.storageValue;const s=this.htmlElement.getAttribute(P);if(e&&t.includes(e)){this.theme=e}else if(s&&t.includes(s)){this.theme=s}else{this.theme=x.auto}}render(){let t=this.theme===x.dark;if(this.theme===x.auto){t=this.isSystemPrefersColorDark}return e(s,{key:"784ed0513ea1436bb754dc82691646422789783b",class:this.h.classes(z.root),theme:t?x.dark:x.light,size:this.size},e("button",{key:"d4abc155a8ae8f07d0a49c378e295c3ab57318d4",onClick:()=>this.setThemeState(t?x.light:x.dark),"aria-current":this.theme,"aria-label":t?this.ariaLabelDark:this.ariaLabelLight},e("span",{key:"7f713875d5618acc919702cdc60e9db58dfb9db5"},e("span",{key:"0b57c0153047ef292b6bdc43b49e5a1a9cdc17e1",class:z.indicator},x.light&&e("gov-icon",{key:"ae2c751435a2bc9c1e9f8dfa4ca52e13943ada9b",name:"sun",class:z.iconLight,type:"components"}),x.dark&&e("gov-icon",{key:"7a4ee602a37742ab94dcee47a7c4970d5dce5bb6",name:"moon",class:z.iconDark,type:"components"})),this.displayLabel&&(t?this.labelDark:this.labelLight))))}get host(){return o(this)}static get watchers(){return{size:["validateSize"],theme:["watchTheme"]}}};export{b as gov_flex,R as gov_icon,A as gov_theme_switch};
2
+ //# sourceMappingURL=p-2642cc66.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FlexClass","root","GovFlex","constructor","hostRef","this","h","govHost","host","render","Host","key","class","classes","pick","Sizes","IconColors","Colors","Types","IconClass","holder","dsVersion","version","iconCache","requestCache","isExternalUrl","path","startsWith","iconUrl","name","type","getAssetPath","async","fetchIcon","cacheKey","console","log","iconsPath","fetch","then","resp","status","text","Error","setCookie","value","days","isWindow","expires","date","Date","setTime","getTime","toUTCString","document","cookie","encodeURIComponent","getCookie","nameEQ","cookies","split","i","length","trim","decodeURIComponent","substring","isValidSVG","svgContent","parser","DOMParser","doc","parseFromString","parseError","querySelector","svgElement","documentElement","tagName","toLowerCase","error","GovIcon","validateSize","newValue","validateProp","validateColor","watchError","loadIconPathData","visible","Build","isBrowser","loadIcon","connectedCallback","iconsLazyLoad","finally","waitUntilVisible","disconnectedCallback","intersectionObserver","disconnect","componentWillLoad","size","color","callback","window","IntersectionObserver","entries","forEach","entry","isIntersecting","rootMargin","observe","data","isValid","innerHTML","e","ThemeSwitchSizes","ThemeSwitchClass","indicator","iconLight","iconDark","ATTRIBUTE_THEME_NAME","ThemeList","GovThemeSwitch","setThemeState","state","theme","govChange","emit","component","ref","auto","watchTheme","htmlElement","setAttribute","classList","remove","Object","keys","add","storageValue","isSystemPrefersColorDark","matchMedia","matches","initDefaultState","options","currentState","htmlState","getAttribute","includes","isDark","dark","light","onClick","ariaLabelDark","ariaLabelLight","displayLabel","labelDark","labelLight"],"sources":["../../../packages/core/src/components/gov-flex/constants.ts","../../../packages/core/src/components/gov-flex/gov-flex.tsx","../../../packages/core/src/components/gov-icon/constants.ts","../../../packages/core/src/utils/ds.utils.ts","../../../packages/core/src/utils/icon.utils.ts","../../../packages/core/src/helpers/Dom/document.ts","../../../packages/core/src/components/gov-icon/gov-icon.tsx","../../../packages/core/src/components/gov-theme-switch/constants.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.types.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.tsx"],"sourcesContent":["import {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const FlexSizes = Sizes\nexport type FlexSizesType = `${ValueOf<typeof FlexSizes>}`\n\nexport const FlexClass = {\n\troot: 'gov-flex',\n}\n\n","import {Component, Element, h, Host, Prop} from '@stencil/core'\nimport {FlexClass, FlexSizesType} from './constants'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-flex',\n})\nexport class GovFlex {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovGridElement\n\n\t/**\n\t * Controls the flex direction of the container.\n\t */\n\t@Prop() direction: 'row' | 'row-reverse' | 'column' | 'column-reverse' = 'row';\n\n\t/**\n\t * Defines how the browser distributes space between and around content items along the main axis.\n\t */\n\t@Prop({\n\t\tattribute: 'justify-content',\n\t\treflect: true\n\t}) justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';\n\n\t/**\n\t * Aligns flex items along the cross axis.\n\t */\n\t@Prop({\n\t\tattribute: 'align-items',\n\t\treflect: true\n\t}) alignItems?: 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline';\n\n\t/**\n\t * Controls whether the flex container is a single-line or multi-line flex container.\n\t */\n\t@Prop({reflect: true}) wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';\n\n\t/**\n\t * Aligns the flex container's lines within when there is extra space in the cross-axis.\n\t */\n\t@Prop({\n\t\tattribute: 'align-content',\n\t\treflect: true\n\t}) alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'stretch';\n\n\t/**\n\t * Sets the alignment of the flex container’s children along the flex container’s cross axis, overriding the `align-items` property for individual flex items.\n\t */\n\t@Prop({\n\t\tattribute: 'align-self',\n\t\treflect: true\n\t}) alignSelf?: 'auto' | 'normal' | 'self-start' | 'self-end' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch' | 'anchor-center';\n\n\t/**\n\t * The gap property creates consistent spacing between flex items in the container.\n\t */\n\t@Prop({\n\t\tattribute: 'gap',\n\t\treflect: true\n\t}) gap?: FlexSizesType;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FlexClass.root)}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n","import { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils';\nimport { Colors } from '../../core/constants/colors';\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const IconSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL', '_2XL', '_3XL', '_4XL', '_5XL'])\nexport type IconSizesType = `${ValueOf<typeof IconSizes>}`\n\nexport const IconColors = pick(Colors, [\n\t'DEFAULT',\n\t'PRIMARY',\n\t'SECONDARY',\n\t'NEUTRAL',\n\t'ERROR',\n\t'SUCCESS',\n\t'WARNING',\n\t'DISABLED',\n\t'WHITE',\n\t'BLACK',\n])\nexport type IconColorType = `${ValueOf<typeof IconColors>}`\n\nenum Types {\n\tBASIC = 'basic',\n\tCOMPLEX = 'complex',\n\tCOLORED = 'colored',\n}\nexport type Type = `${ValueOf<typeof Types>}`\n\nexport const IconClass = {\n\troot: 'gov-icon',\n\tholder: 'gov-icon__holder',\n}\n","import { version } from '../../package.json'\n\nexport const dsVersion = (): string => {\n\treturn version\n}\n","import { getAssetPath } from \"@stencil/core\"\nimport { dsVersion } from \"./ds.utils\"\nimport { iconsPath } from \"../helpers/Dom/win\"\n\nconst iconCache: { [key: string]: string } = {}\nconst requestCache: { [key: string]: Promise<string> } = {}\n\nconst isExternalUrl = (path: string) => path.startsWith(\"http://\") || path.startsWith(\"https://\")\nconst iconUrl = (path: string, name: string, type: string) => {\n\tif (isExternalUrl(path)) {\n\t\treturn `${path}/${type}/${name}.svg?v=${dsVersion()}`\n\t}\n\treturn getAssetPath(`${path}/${type}/${name}.svg`) + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({ name, type }: { name: string; type: string }): Promise<string> {\n\tconst cacheKey = type + \"-\" + name\n\tconsole.log('cacheKey', cacheKey);\n\tconsole.log('iconCache[cacheKey]', iconCache, iconCache[cacheKey]);\n\tif (iconCache[cacheKey]) {\n\t\treturn iconCache[cacheKey]\n\t}\n\tconsole.log('requestCache[cacheKey]', requestCache, requestCache[cacheKey]);\n\n\tif (!requestCache[cacheKey]) {\n\t\tconsole.log('iconsPath()', iconsPath());\n\t\tconsole.log('name, type', name, type);\n\t\tconsole.log('iconUrl(iconsPath(), name, type)', iconUrl(iconsPath(), name, type));\n\t\trequestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n\t\t\tif (resp.status === 200) {\n\t\t\t\treturn resp.text()\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Gov Icon doesn't exists\")\n\t\t\t}\n\t\t})\n\t}\n\tconst path = await requestCache[cacheKey]\n\ticonCache[cacheKey] = path\n\treturn path\n}\n","import {Nullable} from \"../../utils/helpers.types\";\nimport {isWindow} from \"./win\";\n\nexport const setCookie = (name: string, value: string, days?: number) => {\n\tif (!isWindow) {\n\t\treturn\n\t}\n\tlet expires = \"\";\n\tif (days) {\n\t\tconst date = new Date();\n\t\tdate.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n\t\texpires = \"; expires=\" + date.toUTCString();\n\t}\n\tdocument.cookie = `${name}=${encodeURIComponent(value)}${expires}; path=/`;\n}\n\nexport const getCookie = (name: string): Nullable<string> => {\n\tif (!isWindow) {\n\t\treturn null\n\t}\n\tconst nameEQ = name + \"=\";\n\tconst cookies = document.cookie.split(';');\n\tfor (let i = 0; i < cookies.length; i++) {\n\t\tlet cookie = cookies[i].trim();\n\t\tif (cookie.startsWith(nameEQ)) {\n\t\t\treturn decodeURIComponent(cookie.substring(nameEQ.length));\n\t\t}\n\t}\n\treturn null;\n}\n\nexport const isValidSVG = (svgContent: string): boolean => {\n\ttry {\n\t\tconst parser = new DOMParser();\n\t\tconst doc = parser.parseFromString(svgContent, \"image/svg+xml\");\n\t\tconst parseError = doc.querySelector(\"parsererror\");\n\t\tif (parseError) {\n\t\t\treturn false;\n\t\t}\n\t\tconst svgElement = doc.documentElement;\n\t\tif (svgElement.tagName.toLowerCase() !== \"svg\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch (error) {\n\t\treturn false;\n\t}\n}\n","import {Build, Component, Element, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {IconClass, IconColors, type IconColorType, IconSizesType} from \"./constants\"\nimport {fetchIcon} from \"../../utils/icon.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {iconsLazyLoad} from \"../../helpers/Dom/win\"\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {isValidSVG} from \"../../helpers/Dom/document\";\n\n@Component({\n\tassetsDirs: [\"assets\"],\n\ttag: \"gov-icon\",\n})\nexport class GovIcon {\n\tprivate h: GovHost\n\tprivate intersectionObserver: IntersectionObserver\n\n\tconstructor() {\n\t\tconsole.log('GovIcon');\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovIconElement\n\t/**\n\t * Icon size\n\t */\n\t@Prop({reflect: true}) readonly size?: IconSizesType\n\t/**\n\t * Icon color\n\t */\n\t@Prop({reflect: true}) readonly color?: IconColorType\n\t/**\n\t * Name of icon in folder\n\t */\n\t@Prop({reflect: true}) name: string = null\n\t/**\n\t * Type (folder) of icon\n\t */\n\t@Prop({reflect: true}) type = \"components\"\n\n\t@State() private visible = false\n\t@State() private error = false\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(IconColors, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"error\")\n\twatchError(newValue: string): void {\n\t\tconsole.log('error', newValue);\n\t}\n\n\t@Watch(\"name\")\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst {name, visible} = this\n\t\tconsole.log('name, visible', name, visible);\n\t\tconsole.log('Build.isBrowser', Build.isBrowser);\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\tconsole.log('return');\n\t\t\treturn\n\t\t}\n\t\tawait this.loadIcon()\n\t}\n\n\tconnectedCallback(): void {\n\t\tconsole.log('connectedCallback icon', this.name);\n\t\tconsole.log('iconsLazyLoad()', iconsLazyLoad());\n\t\tif (iconsLazyLoad()) {\n\t\t\tthis.visible = true\n\t\t\tthis.loadIconPathData().finally()\n\t\t} else {\n\t\t\tthis.waitUntilVisible(async () => {\n\t\t\t\tthis.visible = true\n\t\t\t\tawait this.loadIconPathData()\n\t\t\t})\n\t\t}\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tconsole.log('disconnectedCallback');\n\t\tif (this.intersectionObserver) {\n\t\t\tthis.intersectionObserver.disconnect()\n\t\t\tthis.intersectionObserver = null\n\t\t}\n\t}\n\n\tasync componentWillLoad(): Promise<void> {\n\t\tconsole.log('componentWillLoad');\n\t\tthis.validateSize(this.size)\n\t\tthis.validateColor(this.color)\n\t\tawait this.loadIconPathData()\n\t}\n\n\tprivate waitUntilVisible(callback: () => void): void {\n\t\tif (!Build.isBrowser || typeof window === \"undefined\" || !(window as any).IntersectionObserver) {\n\t\t\tcallback()\n\t\t\treturn\n\t\t}\n\t\tthis.intersectionObserver = new IntersectionObserver(\n\t\t\tentries => {\n\t\t\t\tentries.forEach(entry => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tif (this.intersectionObserver) {\n\t\t\t\t\t\t\tthis.intersectionObserver.disconnect()\n\t\t\t\t\t\t\tthis.intersectionObserver = null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t{rootMargin: \"50px\"},\n\t\t)\n\t\tthis.intersectionObserver.observe(this.host)\n\t}\n\n\tprivate async loadIcon() {\n\t\ttry {\n\t\t\tconst {name, type} = this\n\t\t\tconsole.log('loadIcon -> name, type', name, type);\n\t\t\tconst data = await fetchIcon({name, type})\n\t\t\tconst isValid = isValidSVG(data)\n\t\t\tthis.host.innerHTML = isValid ? data : null;\n\t\t} catch (e) {\n\t\t\tthis.host.innerHTML = ''\n\t\t\tthis.error = true\n\t\t}\n\t}\n\n\trender() {\n\t\tif (this.error) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(IconClass.root)} size={this.size} color={this.color}/>\n\t\t)\n\t}\n}\n","import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const ThemeSwitchSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type ThemeSwitchSizesType = `${ValueOf<typeof ThemeSwitchSizes>}`\n\nexport const ThemeSwitchClass = {\n\troot: 'gov-theme-switch',\n\tindicator: 'gov-theme-switch__indicator',\n\ticonLight: 'gov-theme-switch__icon-light',\n\ticonDark: 'gov-theme-switch__icon-dark',\n}\n\nexport const ATTRIBUTE_THEME_NAME = 'data-theme'\n","import {GovBaseEvent} from \"../../types/event.types\";\n\nexport enum ThemeList {\n\tauto = 'auto',\n\tlight = 'light',\n\tdark = 'dark'\n}\n\nexport interface ThemeSwitchEvent extends GovBaseEvent {\n\tref: HTMLGovThemeSwitchElement;\n\tstate: ThemeList\n}\n\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {GovHost} from \"../../helpers/Dom/template.types\";\nimport {govHost} from \"../../helpers/Dom/template\";\nimport {ATTRIBUTE_THEME_NAME, ThemeSwitchClass, ThemeSwitchSizes, ThemeSwitchSizesType} from \"./constants\";\nimport {isWindow} from \"../../helpers/Dom/win\";\nimport {ThemeList, ThemeSwitchEvent} from \"./gov-theme-switch.types\";\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {getCookie, setCookie} from \"../../helpers/Dom/document\";\n\n@Component({\n\ttag: \"gov-theme-switch\",\n})\nexport class GovThemeSwitch {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovThemeSwitchElement\n\n\t/**\n\t * Switch's size.\n\t */\n\t@Prop() readonly size?: ThemeSwitchSizesType = \"m\"\n\t/**\n\t * Display switch label\n\t */\n\t@Prop({attribute: \"display-label\"}) readonly displayLabel? = false\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"aria-label-light\"}) readonly ariaLabelLight? = \"Přenout na tmavý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"aria-label-dark\"}) readonly ariaLabelDark? = \"Přepnout na světlý mód\"\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"label-light\"}) readonly labelLight? = \"Světlý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"label-dark\"}) readonly labelDark? = \"Tmavý mód\"\n\t/**\n\t * Called when the theme is changed by the user\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<ThemeSwitchEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ThemeSwitchSizes, newValue, ThemeSwitchClass.root)\n\t}\n\n\t@Watch(\"theme\")\n\twatchTheme(newValue: ThemeList): void {\n\t\tthis.htmlElement.setAttribute(ATTRIBUTE_THEME_NAME, newValue);\n\t\tthis.htmlElement.classList.remove(...Object.keys(ThemeList));\n\t\tthis.htmlElement.classList.add(newValue);\n\t\tsetCookie(ATTRIBUTE_THEME_NAME, newValue);\n\t}\n\n\t@State() theme: ThemeList = ThemeList.auto\n\n\tprivate get storageValue() {\n\t\treturn getCookie(ATTRIBUTE_THEME_NAME)\n\t}\n\n\tprivate get htmlElement(): HTMLElement {\n\t\treturn document.documentElement\n\t}\n\n\tprivate get isSystemPrefersColorDark(): boolean {\n\t\treturn isWindow && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.initDefaultState()\n\t\tthis.validateSize(this.size)\n\t}\n\n\tprivate initDefaultState() {\n\t\tconst options = Object.keys(ThemeList);\n\t\tlet currentState = this.storageValue;\n\t\tconst htmlState = this.htmlElement.getAttribute(ATTRIBUTE_THEME_NAME)\n\n\t\tif (currentState && options.includes(currentState)) {\n\t\t\tthis.theme = currentState as ThemeList;\n\t\t} else if (htmlState && options.includes(htmlState)) {\n\t\t\tthis.theme = htmlState as ThemeList;\n\t\t} else {\n\t\t\tthis.theme = ThemeList.auto;\n\t\t}\n\t}\n\n\tprivate setThemeState = (state: ThemeList) => {\n\t\tthis.theme = state;\n\n\t\tthis.govChange.emit({\n\t\t\tcomponent: ThemeSwitchClass.root,\n\t\t\tstate: this.theme,\n\t\t\tref: this.host\n\t\t})\n\t}\n\n\trender() {\n\t\tlet isDark = this.theme === ThemeList.dark;\n\t\tif (this.theme === ThemeList.auto) {\n\t\t\tisDark = this.isSystemPrefersColorDark;\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ThemeSwitchClass.root)}\n\t\t\t\t theme={isDark ? ThemeList.dark : ThemeList.light}\n\t\t\t\t size={this.size}>\n\t\t\t\t<button onClick={() => this.setThemeState(isDark ? ThemeList.light : ThemeList.dark)}\n\t\t\t\t\t\taria-current={this.theme}\n\t\t\t\t\t\taria-label={isDark ? this.ariaLabelDark : this.ariaLabelLight}>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<span class={ThemeSwitchClass.indicator}>\n\t\t\t\t\t\t\t{ThemeList.light && <gov-icon name=\"sun\" class={ThemeSwitchClass.iconLight} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t\t{ThemeList.dark && <gov-icon name=\"moon\" class={ThemeSwitchClass.iconDark} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{this.displayLabel && (isDark ? this.labelDark : this.labelLight)}\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"oTAMO,MAAMA,EAAY,CACxBC,KAAM,Y,MCCMC,EAAO,MAGnB,WAAAC,CAAAC,G,yBASyE,M,oJARxEC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAuDvB,MAAAC,GACC,OACCH,EAACI,EAAI,CAAAC,IAAA,2CAACC,MAAOP,KAAKC,EAAEO,QAAQb,EAAUC,OACrCK,EAAA,QAAAK,IAAA,6C,6BCjEqBG,EAAKC,EAAO,CAAC,MAAO,KAAM,KAAM,KAAM,MAAO,OAAQ,OAAQ,OAAQ,SAGvF,MAAMC,EAAaF,EAAKG,EAAQ,CACtC,UACA,UACA,YACA,UACA,QACA,UACA,UACA,WACA,QACA,UAID,IAAKC,GAAL,SAAKA,GACJA,EAAA,iBACAA,EAAA,qBACAA,EAAA,oBACA,EAJD,CAAKA,MAAK,KAOH,MAAMC,EAAY,CACxBlB,KAAM,WACNmB,OAAQ,oB,uBC7BF,MAAMC,EAAY,IACjBC,ECCR,MAAMC,EAAuC,GAC7C,MAAMC,EAAmD,GAEzD,MAAMC,EAAiBC,GAAiBA,EAAKC,WAAW,YAAcD,EAAKC,WAAW,YACtF,MAAMC,EAAU,CAACF,EAAcG,EAAcC,KAC5C,GAAIL,EAAcC,GAAO,CACxB,MAAO,GAAGA,KAAQI,KAAQD,WAAcR,K,CAEzC,OAAOU,EAAa,GAAGL,KAAQI,KAAQD,SAAc,MAAMR,KAAa,EAGlEW,eAAeC,GAAUJ,KAAEA,EAAIC,KAAEA,IACvC,MA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MAC3CnD,KAAM7F,KAAK6F,MACb5F,EAAA,UAAAK,IAAA,2CAAQ2I,QAAS,IAAMjJ,KAAKoH,cAAc0B,EAAS5B,EAAU8B,MAAQ9B,EAAU6B,MAAK,eACpE/I,KAAKsH,MAAK,aACZwB,EAAS9I,KAAKkJ,cAAgBlJ,KAAKmJ,gBAChDlJ,EAAA,QAAAK,IAAA,4CACCL,EAAA,QAAAK,IAAA,2CAAMC,MAAOsG,EAAiBC,WAC5BI,EAAU8B,OAAS/I,EAAA,YAAAK,IAAA,2CAAUkB,KAAK,MAAMjB,MAAOsG,EAAiBE,UAAWtF,KAAK,eAChFyF,EAAU6B,MAAQ9I,EAAA,YAAAK,IAAA,2CAAUkB,KAAK,OAAOjB,MAAOsG,EAAiBG,SAAUvF,KAAK,gBAEhFzB,KAAKoJ,eAAiBN,EAAS9I,KAAKqJ,UAAYrJ,KAAKsJ,c","ignoreList":[]}
@@ -52,7 +52,7 @@ const IconClass = {
52
52
  holder: 'gov-icon__holder',
53
53
  };
54
54
 
55
- const version = "4.1.3-BETA-7";
55
+ const version = "4.1.3-BETA-8";
56
56
 
57
57
  const dsVersion = () => {
58
58
  return version;
@@ -76,6 +76,8 @@ async function fetchIcon({ name, type }) {
76
76
  }
77
77
  console.log('requestCache[cacheKey]', requestCache, requestCache[cacheKey]);
78
78
  if (!requestCache[cacheKey]) {
79
+ console.log('iconsPath()', iconsPath());
80
+ console.log('name, type', name, type);
79
81
  console.log('iconUrl(iconsPath(), name, type)', iconUrl(iconsPath(), name, type));
80
82
  requestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {
81
83
  if (resp.status === 200) {
@@ -1 +1 @@
1
- {"file":"gov-flex.gov-icon.gov-theme-switch.entry.js","mappings":";;;;;;;;AAMO,MAAM,SAAS,GAAG;IACxB,IAAI,EAAE,UAAU;CAChB;;MCAY,OAAO;IAGnB;;yBASyE,KAAK;;;;;;;QAR7E,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,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SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,KAAK,EAChD,IAAI,EAAE,IAAI,CAAC,IAAI,IACjB,+DAAQ,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,kBACpE,IAAI,CAAC,KAAK,gBACZ,MAAM,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,IAC9D,+DACC,6DAAM,KAAK,EAAE,gBAAgB,CAAC,SAAS,IACrC,SAAS,CAAC,KAAK,IAAI,iEAAU,IAAI,EAAC,KAAK,EAAC,KAAK,EAAE,gBAAgB,CAAC,SAAS,EAAE,IAAI,EAAC,YAAY,GAAY,EACxG,SAAS,CAAC,IAAI,IAAI,iEAAU,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,gBAAgB,CAAC,QAAQ,EAAE,IAAI,EAAC,YAAY,GAAY,CAClG,EACN,IAAI,CAAC,YAAY,KAAK,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,CAC3D,CACC,CACH,EACP;KACD;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-flex/constants.ts","../../../packages/core/src/components/gov-flex/gov-flex.tsx","../../../packages/core/src/components/gov-icon/constants.ts","../../../packages/core/src/utils/ds.utils.ts","../../../packages/core/src/utils/icon.utils.ts","../../../packages/core/src/helpers/Dom/document.ts","../../../packages/core/src/components/gov-icon/gov-icon.tsx","../../../packages/core/src/components/gov-theme-switch/constants.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.types.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.tsx"],"sourcesContent":["import {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const FlexSizes = Sizes\nexport type FlexSizesType = `${ValueOf<typeof FlexSizes>}`\n\nexport const FlexClass = {\n\troot: 'gov-flex',\n}\n\n","import {Component, Element, h, Host, Prop} from '@stencil/core'\nimport {FlexClass, FlexSizesType} from './constants'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-flex',\n})\nexport class GovFlex {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovGridElement\n\n\t/**\n\t * Controls the flex direction of the container.\n\t */\n\t@Prop() direction: 'row' | 'row-reverse' | 'column' | 'column-reverse' = 'row';\n\n\t/**\n\t * Defines how the browser distributes space between and around content items along the main axis.\n\t */\n\t@Prop({\n\t\tattribute: 'justify-content',\n\t\treflect: true\n\t}) justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';\n\n\t/**\n\t * Aligns flex items along the cross axis.\n\t */\n\t@Prop({\n\t\tattribute: 'align-items',\n\t\treflect: true\n\t}) alignItems?: 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline';\n\n\t/**\n\t * Controls whether the flex container is a single-line or multi-line flex container.\n\t */\n\t@Prop({reflect: true}) wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';\n\n\t/**\n\t * Aligns the flex container's lines within when there is extra space in the cross-axis.\n\t */\n\t@Prop({\n\t\tattribute: 'align-content',\n\t\treflect: true\n\t}) alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'stretch';\n\n\t/**\n\t * Sets the alignment of the flex container’s children along the flex container’s cross axis, overriding the `align-items` property for individual flex items.\n\t */\n\t@Prop({\n\t\tattribute: 'align-self',\n\t\treflect: true\n\t}) alignSelf?: 'auto' | 'normal' | 'self-start' | 'self-end' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch' | 'anchor-center';\n\n\t/**\n\t * The gap property creates consistent spacing between flex items in the container.\n\t */\n\t@Prop({\n\t\tattribute: 'gap',\n\t\treflect: true\n\t}) gap?: FlexSizesType;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FlexClass.root)}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n","import { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils';\nimport { Colors } from '../../core/constants/colors';\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const IconSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL', '_2XL', '_3XL', '_4XL', '_5XL'])\nexport type IconSizesType = `${ValueOf<typeof IconSizes>}`\n\nexport const IconColors = pick(Colors, [\n\t'DEFAULT',\n\t'PRIMARY',\n\t'SECONDARY',\n\t'NEUTRAL',\n\t'ERROR',\n\t'SUCCESS',\n\t'WARNING',\n\t'DISABLED',\n\t'WHITE',\n\t'BLACK',\n])\nexport type IconColorType = `${ValueOf<typeof IconColors>}`\n\nenum Types {\n\tBASIC = 'basic',\n\tCOMPLEX = 'complex',\n\tCOLORED = 'colored',\n}\nexport type Type = `${ValueOf<typeof Types>}`\n\nexport const IconClass = {\n\troot: 'gov-icon',\n\tholder: 'gov-icon__holder',\n}\n","import { version } from '../../package.json'\n\nexport const dsVersion = (): string => {\n\treturn version\n}\n","import { getAssetPath } from \"@stencil/core\"\nimport { dsVersion } from \"./ds.utils\"\nimport { iconsPath } from \"../helpers/Dom/win\"\n\nconst iconCache: { [key: string]: string } = {}\nconst requestCache: { [key: string]: Promise<string> } = {}\n\nconst isExternalUrl = (path: string) => path.startsWith(\"http://\") || path.startsWith(\"https://\")\nconst iconUrl = (path: string, name: string, type: string) => {\n\tif (isExternalUrl(path)) {\n\t\treturn `${path}/${type}/${name}.svg?v=${dsVersion()}`\n\t}\n\treturn getAssetPath(`${path}/${type}/${name}.svg`) + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({ name, type }: { name: string; type: string }): Promise<string> {\n\tconst cacheKey = type + \"-\" + name\n\tconsole.log('cacheKey', cacheKey);\n\tconsole.log('iconCache[cacheKey]', iconCache, iconCache[cacheKey]);\n\tif (iconCache[cacheKey]) {\n\t\treturn iconCache[cacheKey]\n\t}\n\tconsole.log('requestCache[cacheKey]', requestCache, requestCache[cacheKey]);\n\n\tif (!requestCache[cacheKey]) {\n\t\tconsole.log('iconUrl(iconsPath(), name, type)', iconUrl(iconsPath(), name, type));\n\t\trequestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n\t\t\tif (resp.status === 200) {\n\t\t\t\treturn resp.text()\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Gov Icon doesn't exists\")\n\t\t\t}\n\t\t})\n\t}\n\tconst path = await requestCache[cacheKey]\n\ticonCache[cacheKey] = path\n\treturn path\n}\n","import {Nullable} from \"../../utils/helpers.types\";\nimport {isWindow} from \"./win\";\n\nexport const setCookie = (name: string, value: string, days?: number) => {\n\tif (!isWindow) {\n\t\treturn\n\t}\n\tlet expires = \"\";\n\tif (days) {\n\t\tconst date = new Date();\n\t\tdate.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n\t\texpires = \"; expires=\" + date.toUTCString();\n\t}\n\tdocument.cookie = `${name}=${encodeURIComponent(value)}${expires}; path=/`;\n}\n\nexport const getCookie = (name: string): Nullable<string> => {\n\tif (!isWindow) {\n\t\treturn null\n\t}\n\tconst nameEQ = name + \"=\";\n\tconst cookies = document.cookie.split(';');\n\tfor (let i = 0; i < cookies.length; i++) {\n\t\tlet cookie = cookies[i].trim();\n\t\tif (cookie.startsWith(nameEQ)) {\n\t\t\treturn decodeURIComponent(cookie.substring(nameEQ.length));\n\t\t}\n\t}\n\treturn null;\n}\n\nexport const isValidSVG = (svgContent: string): boolean => {\n\ttry {\n\t\tconst parser = new DOMParser();\n\t\tconst doc = parser.parseFromString(svgContent, \"image/svg+xml\");\n\t\tconst parseError = doc.querySelector(\"parsererror\");\n\t\tif (parseError) {\n\t\t\treturn false;\n\t\t}\n\t\tconst svgElement = doc.documentElement;\n\t\tif (svgElement.tagName.toLowerCase() !== \"svg\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch (error) {\n\t\treturn false;\n\t}\n}\n","import {Build, Component, Element, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {IconClass, IconColors, type IconColorType, IconSizesType} from \"./constants\"\nimport {fetchIcon} from \"../../utils/icon.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {iconsLazyLoad} from \"../../helpers/Dom/win\"\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {isValidSVG} from \"../../helpers/Dom/document\";\n\n@Component({\n\tassetsDirs: [\"assets\"],\n\ttag: \"gov-icon\",\n})\nexport class GovIcon {\n\tprivate h: GovHost\n\tprivate intersectionObserver: IntersectionObserver\n\n\tconstructor() {\n\t\tconsole.log('GovIcon');\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovIconElement\n\t/**\n\t * Icon size\n\t */\n\t@Prop({reflect: true}) readonly size?: IconSizesType\n\t/**\n\t * Icon color\n\t */\n\t@Prop({reflect: true}) readonly color?: IconColorType\n\t/**\n\t * Name of icon in folder\n\t */\n\t@Prop({reflect: true}) name: string = null\n\t/**\n\t * Type (folder) of icon\n\t */\n\t@Prop({reflect: true}) type = \"components\"\n\n\t@State() private visible = false\n\t@State() private error = false\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(IconColors, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"error\")\n\twatchError(newValue: string): void {\n\t\tconsole.log('error', newValue);\n\t}\n\n\t@Watch(\"name\")\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst {name, visible} = this\n\t\tconsole.log('name, visible', name, visible);\n\t\tconsole.log('Build.isBrowser', Build.isBrowser);\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\tconsole.log('return');\n\t\t\treturn\n\t\t}\n\t\tawait this.loadIcon()\n\t}\n\n\tconnectedCallback(): void {\n\t\tconsole.log('connectedCallback icon', this.name);\n\t\tconsole.log('iconsLazyLoad()', iconsLazyLoad());\n\t\tif (iconsLazyLoad()) {\n\t\t\tthis.visible = true\n\t\t\tthis.loadIconPathData().finally()\n\t\t} else {\n\t\t\tthis.waitUntilVisible(async () => {\n\t\t\t\tthis.visible = true\n\t\t\t\tawait this.loadIconPathData()\n\t\t\t})\n\t\t}\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tconsole.log('disconnectedCallback');\n\t\tif (this.intersectionObserver) {\n\t\t\tthis.intersectionObserver.disconnect()\n\t\t\tthis.intersectionObserver = null\n\t\t}\n\t}\n\n\tasync componentWillLoad(): Promise<void> {\n\t\tconsole.log('componentWillLoad');\n\t\tthis.validateSize(this.size)\n\t\tthis.validateColor(this.color)\n\t\tawait this.loadIconPathData()\n\t}\n\n\tprivate waitUntilVisible(callback: () => void): void {\n\t\tif (!Build.isBrowser || typeof window === \"undefined\" || !(window as any).IntersectionObserver) {\n\t\t\tcallback()\n\t\t\treturn\n\t\t}\n\t\tthis.intersectionObserver = new IntersectionObserver(\n\t\t\tentries => {\n\t\t\t\tentries.forEach(entry => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tif (this.intersectionObserver) {\n\t\t\t\t\t\t\tthis.intersectionObserver.disconnect()\n\t\t\t\t\t\t\tthis.intersectionObserver = null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t{rootMargin: \"50px\"},\n\t\t)\n\t\tthis.intersectionObserver.observe(this.host)\n\t}\n\n\tprivate async loadIcon() {\n\t\ttry {\n\t\t\tconst {name, type} = this\n\t\t\tconsole.log('loadIcon -> name, type', name, type);\n\t\t\tconst data = await fetchIcon({name, type})\n\t\t\tconst isValid = isValidSVG(data)\n\t\t\tthis.host.innerHTML = isValid ? data : null;\n\t\t} catch (e) {\n\t\t\tthis.host.innerHTML = ''\n\t\t\tthis.error = true\n\t\t}\n\t}\n\n\trender() {\n\t\tif (this.error) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(IconClass.root)} size={this.size} color={this.color}/>\n\t\t)\n\t}\n}\n","import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const ThemeSwitchSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type ThemeSwitchSizesType = `${ValueOf<typeof ThemeSwitchSizes>}`\n\nexport const ThemeSwitchClass = {\n\troot: 'gov-theme-switch',\n\tindicator: 'gov-theme-switch__indicator',\n\ticonLight: 'gov-theme-switch__icon-light',\n\ticonDark: 'gov-theme-switch__icon-dark',\n}\n\nexport const ATTRIBUTE_THEME_NAME = 'data-theme'\n","import {GovBaseEvent} from \"../../types/event.types\";\n\nexport enum ThemeList {\n\tauto = 'auto',\n\tlight = 'light',\n\tdark = 'dark'\n}\n\nexport interface ThemeSwitchEvent extends GovBaseEvent {\n\tref: HTMLGovThemeSwitchElement;\n\tstate: ThemeList\n}\n\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {GovHost} from \"../../helpers/Dom/template.types\";\nimport {govHost} from \"../../helpers/Dom/template\";\nimport {ATTRIBUTE_THEME_NAME, ThemeSwitchClass, ThemeSwitchSizes, ThemeSwitchSizesType} from \"./constants\";\nimport {isWindow} from \"../../helpers/Dom/win\";\nimport {ThemeList, ThemeSwitchEvent} from \"./gov-theme-switch.types\";\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {getCookie, setCookie} from \"../../helpers/Dom/document\";\n\n@Component({\n\ttag: \"gov-theme-switch\",\n})\nexport class GovThemeSwitch {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovThemeSwitchElement\n\n\t/**\n\t * Switch's size.\n\t */\n\t@Prop() readonly size?: ThemeSwitchSizesType = \"m\"\n\t/**\n\t * Display switch label\n\t */\n\t@Prop({attribute: \"display-label\"}) readonly displayLabel? = false\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"aria-label-light\"}) readonly ariaLabelLight? = \"Přenout na tmavý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"aria-label-dark\"}) readonly ariaLabelDark? = \"Přepnout na světlý mód\"\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"label-light\"}) readonly labelLight? = \"Světlý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"label-dark\"}) readonly labelDark? = \"Tmavý mód\"\n\t/**\n\t * Called when the theme is changed by the user\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<ThemeSwitchEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ThemeSwitchSizes, newValue, ThemeSwitchClass.root)\n\t}\n\n\t@Watch(\"theme\")\n\twatchTheme(newValue: ThemeList): void {\n\t\tthis.htmlElement.setAttribute(ATTRIBUTE_THEME_NAME, newValue);\n\t\tthis.htmlElement.classList.remove(...Object.keys(ThemeList));\n\t\tthis.htmlElement.classList.add(newValue);\n\t\tsetCookie(ATTRIBUTE_THEME_NAME, newValue);\n\t}\n\n\t@State() theme: ThemeList = ThemeList.auto\n\n\tprivate get storageValue() {\n\t\treturn getCookie(ATTRIBUTE_THEME_NAME)\n\t}\n\n\tprivate get htmlElement(): HTMLElement {\n\t\treturn document.documentElement\n\t}\n\n\tprivate get isSystemPrefersColorDark(): boolean {\n\t\treturn isWindow && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.initDefaultState()\n\t\tthis.validateSize(this.size)\n\t}\n\n\tprivate initDefaultState() {\n\t\tconst options = Object.keys(ThemeList);\n\t\tlet currentState = this.storageValue;\n\t\tconst htmlState = this.htmlElement.getAttribute(ATTRIBUTE_THEME_NAME)\n\n\t\tif (currentState && options.includes(currentState)) {\n\t\t\tthis.theme = currentState as ThemeList;\n\t\t} else if (htmlState && options.includes(htmlState)) {\n\t\t\tthis.theme = htmlState as ThemeList;\n\t\t} else {\n\t\t\tthis.theme = ThemeList.auto;\n\t\t}\n\t}\n\n\tprivate setThemeState = (state: ThemeList) => {\n\t\tthis.theme = state;\n\n\t\tthis.govChange.emit({\n\t\t\tcomponent: ThemeSwitchClass.root,\n\t\t\tstate: this.theme,\n\t\t\tref: this.host\n\t\t})\n\t}\n\n\trender() {\n\t\tlet isDark = this.theme === ThemeList.dark;\n\t\tif (this.theme === ThemeList.auto) {\n\t\t\tisDark = this.isSystemPrefersColorDark;\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ThemeSwitchClass.root)}\n\t\t\t\t theme={isDark ? ThemeList.dark : ThemeList.light}\n\t\t\t\t size={this.size}>\n\t\t\t\t<button onClick={() => this.setThemeState(isDark ? ThemeList.light : ThemeList.dark)}\n\t\t\t\t\t\taria-current={this.theme}\n\t\t\t\t\t\taria-label={isDark ? this.ariaLabelDark : this.ariaLabelLight}>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<span class={ThemeSwitchClass.indicator}>\n\t\t\t\t\t\t\t{ThemeList.light && <gov-icon name=\"sun\" class={ThemeSwitchClass.iconLight} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t\t{ThemeList.dark && <gov-icon name=\"moon\" class={ThemeSwitchClass.iconDark} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{this.displayLabel && (isDark ? this.labelDark : this.labelLight)}\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-flex.gov-icon.gov-theme-switch.entry.js","mappings":";;;;;;;;AAMO,MA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SAAS,CAAC,IAAI,CAAC;QAC3C,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,IAAI,EAAE;YAClC,MAAM,GAAG,IAAI,CAAC,wBAAwB,CAAC;SACvC;QACD,QACC,EAAC,IAAI,qDAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAC/C,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,KAAK,EAChD,IAAI,EAAE,IAAI,CAAC,IAAI,IACjB,+DAAQ,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,kBACpE,IAAI,CAAC,KAAK,gBACZ,MAAM,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,IAC9D,+DACC,6DAAM,KAAK,EAAE,gBAAgB,CAAC,SAAS,IACrC,SAAS,CAAC,KAAK,IAAI,iEAAU,IAAI,EAAC,KAAK,EAAC,KAAK,EAAE,gBAAgB,CAAC,SAAS,EAAE,IAAI,EAAC,YAAY,GAAY,EACxG,SAAS,CAAC,IAAI,IAAI,iEAAU,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,gBAAgB,CAAC,QAAQ,EAAE,IAAI,EAAC,YAAY,GAAY,CAClG,EACN,IAAI,CAAC,YAAY,KAAK,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,CAC3D,CACC,CACH,EACP;KACD;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-flex/constants.ts","../../../packages/core/src/components/gov-flex/gov-flex.tsx","../../../packages/core/src/components/gov-icon/constants.ts","../../../packages/core/src/utils/ds.utils.ts","../../../packages/core/src/utils/icon.utils.ts","../../../packages/core/src/helpers/Dom/document.ts","../../../packages/core/src/components/gov-icon/gov-icon.tsx","../../../packages/core/src/components/gov-theme-switch/constants.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.types.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.tsx"],"sourcesContent":["import {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const FlexSizes = Sizes\nexport type FlexSizesType = `${ValueOf<typeof FlexSizes>}`\n\nexport const FlexClass = {\n\troot: 'gov-flex',\n}\n\n","import {Component, Element, h, Host, Prop} from '@stencil/core'\nimport {FlexClass, FlexSizesType} from './constants'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-flex',\n})\nexport class GovFlex {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovGridElement\n\n\t/**\n\t * Controls the flex direction of the container.\n\t */\n\t@Prop() direction: 'row' | 'row-reverse' | 'column' | 'column-reverse' = 'row';\n\n\t/**\n\t * Defines how the browser distributes space between and around content items along the main axis.\n\t */\n\t@Prop({\n\t\tattribute: 'justify-content',\n\t\treflect: true\n\t}) justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';\n\n\t/**\n\t * Aligns flex items along the cross axis.\n\t */\n\t@Prop({\n\t\tattribute: 'align-items',\n\t\treflect: true\n\t}) alignItems?: 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline';\n\n\t/**\n\t * Controls whether the flex container is a single-line or multi-line flex container.\n\t */\n\t@Prop({reflect: true}) wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';\n\n\t/**\n\t * Aligns the flex container's lines within when there is extra space in the cross-axis.\n\t */\n\t@Prop({\n\t\tattribute: 'align-content',\n\t\treflect: true\n\t}) alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'stretch';\n\n\t/**\n\t * Sets the alignment of the flex container’s children along the flex container’s cross axis, overriding the `align-items` property for individual flex items.\n\t */\n\t@Prop({\n\t\tattribute: 'align-self',\n\t\treflect: true\n\t}) alignSelf?: 'auto' | 'normal' | 'self-start' | 'self-end' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch' | 'anchor-center';\n\n\t/**\n\t * The gap property creates consistent spacing between flex items in the container.\n\t */\n\t@Prop({\n\t\tattribute: 'gap',\n\t\treflect: true\n\t}) gap?: FlexSizesType;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FlexClass.root)}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n","import { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils';\nimport { Colors } from '../../core/constants/colors';\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const IconSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL', '_2XL', '_3XL', '_4XL', '_5XL'])\nexport type IconSizesType = `${ValueOf<typeof IconSizes>}`\n\nexport const IconColors = pick(Colors, [\n\t'DEFAULT',\n\t'PRIMARY',\n\t'SECONDARY',\n\t'NEUTRAL',\n\t'ERROR',\n\t'SUCCESS',\n\t'WARNING',\n\t'DISABLED',\n\t'WHITE',\n\t'BLACK',\n])\nexport type IconColorType = `${ValueOf<typeof IconColors>}`\n\nenum Types {\n\tBASIC = 'basic',\n\tCOMPLEX = 'complex',\n\tCOLORED = 'colored',\n}\nexport type Type = `${ValueOf<typeof Types>}`\n\nexport const IconClass = {\n\troot: 'gov-icon',\n\tholder: 'gov-icon__holder',\n}\n","import { version } from '../../package.json'\n\nexport const dsVersion = (): string => {\n\treturn version\n}\n","import { getAssetPath } from \"@stencil/core\"\nimport { dsVersion } from \"./ds.utils\"\nimport { iconsPath } from \"../helpers/Dom/win\"\n\nconst iconCache: { [key: string]: string } = {}\nconst requestCache: { [key: string]: Promise<string> } = {}\n\nconst isExternalUrl = (path: string) => path.startsWith(\"http://\") || path.startsWith(\"https://\")\nconst iconUrl = (path: string, name: string, type: string) => {\n\tif (isExternalUrl(path)) {\n\t\treturn `${path}/${type}/${name}.svg?v=${dsVersion()}`\n\t}\n\treturn getAssetPath(`${path}/${type}/${name}.svg`) + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({ name, type }: { name: string; type: string }): Promise<string> {\n\tconst cacheKey = type + \"-\" + name\n\tconsole.log('cacheKey', cacheKey);\n\tconsole.log('iconCache[cacheKey]', iconCache, iconCache[cacheKey]);\n\tif (iconCache[cacheKey]) {\n\t\treturn iconCache[cacheKey]\n\t}\n\tconsole.log('requestCache[cacheKey]', requestCache, requestCache[cacheKey]);\n\n\tif (!requestCache[cacheKey]) {\n\t\tconsole.log('iconsPath()', iconsPath());\n\t\tconsole.log('name, type', name, type);\n\t\tconsole.log('iconUrl(iconsPath(), name, type)', iconUrl(iconsPath(), name, type));\n\t\trequestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n\t\t\tif (resp.status === 200) {\n\t\t\t\treturn resp.text()\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Gov Icon doesn't exists\")\n\t\t\t}\n\t\t})\n\t}\n\tconst path = await requestCache[cacheKey]\n\ticonCache[cacheKey] = path\n\treturn path\n}\n","import {Nullable} from \"../../utils/helpers.types\";\nimport {isWindow} from \"./win\";\n\nexport const setCookie = (name: string, value: string, days?: number) => {\n\tif (!isWindow) {\n\t\treturn\n\t}\n\tlet expires = \"\";\n\tif (days) {\n\t\tconst date = new Date();\n\t\tdate.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n\t\texpires = \"; expires=\" + date.toUTCString();\n\t}\n\tdocument.cookie = `${name}=${encodeURIComponent(value)}${expires}; path=/`;\n}\n\nexport const getCookie = (name: string): Nullable<string> => {\n\tif (!isWindow) {\n\t\treturn null\n\t}\n\tconst nameEQ = name + \"=\";\n\tconst cookies = document.cookie.split(';');\n\tfor (let i = 0; i < cookies.length; i++) {\n\t\tlet cookie = cookies[i].trim();\n\t\tif (cookie.startsWith(nameEQ)) {\n\t\t\treturn decodeURIComponent(cookie.substring(nameEQ.length));\n\t\t}\n\t}\n\treturn null;\n}\n\nexport const isValidSVG = (svgContent: string): boolean => {\n\ttry {\n\t\tconst parser = new DOMParser();\n\t\tconst doc = parser.parseFromString(svgContent, \"image/svg+xml\");\n\t\tconst parseError = doc.querySelector(\"parsererror\");\n\t\tif (parseError) {\n\t\t\treturn false;\n\t\t}\n\t\tconst svgElement = doc.documentElement;\n\t\tif (svgElement.tagName.toLowerCase() !== \"svg\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch (error) {\n\t\treturn false;\n\t}\n}\n","import {Build, Component, Element, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {IconClass, IconColors, type IconColorType, IconSizesType} from \"./constants\"\nimport {fetchIcon} from \"../../utils/icon.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {iconsLazyLoad} from \"../../helpers/Dom/win\"\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {isValidSVG} from \"../../helpers/Dom/document\";\n\n@Component({\n\tassetsDirs: [\"assets\"],\n\ttag: \"gov-icon\",\n})\nexport class GovIcon {\n\tprivate h: GovHost\n\tprivate intersectionObserver: IntersectionObserver\n\n\tconstructor() {\n\t\tconsole.log('GovIcon');\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovIconElement\n\t/**\n\t * Icon size\n\t */\n\t@Prop({reflect: true}) readonly size?: IconSizesType\n\t/**\n\t * Icon color\n\t */\n\t@Prop({reflect: true}) readonly color?: IconColorType\n\t/**\n\t * Name of icon in folder\n\t */\n\t@Prop({reflect: true}) name: string = null\n\t/**\n\t * Type (folder) of icon\n\t */\n\t@Prop({reflect: true}) type = \"components\"\n\n\t@State() private visible = false\n\t@State() private error = false\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(IconColors, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"error\")\n\twatchError(newValue: string): void {\n\t\tconsole.log('error', newValue);\n\t}\n\n\t@Watch(\"name\")\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst {name, visible} = this\n\t\tconsole.log('name, visible', name, visible);\n\t\tconsole.log('Build.isBrowser', Build.isBrowser);\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\tconsole.log('return');\n\t\t\treturn\n\t\t}\n\t\tawait this.loadIcon()\n\t}\n\n\tconnectedCallback(): void {\n\t\tconsole.log('connectedCallback icon', this.name);\n\t\tconsole.log('iconsLazyLoad()', iconsLazyLoad());\n\t\tif (iconsLazyLoad()) {\n\t\t\tthis.visible = true\n\t\t\tthis.loadIconPathData().finally()\n\t\t} else {\n\t\t\tthis.waitUntilVisible(async () => {\n\t\t\t\tthis.visible = true\n\t\t\t\tawait this.loadIconPathData()\n\t\t\t})\n\t\t}\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tconsole.log('disconnectedCallback');\n\t\tif (this.intersectionObserver) {\n\t\t\tthis.intersectionObserver.disconnect()\n\t\t\tthis.intersectionObserver = null\n\t\t}\n\t}\n\n\tasync componentWillLoad(): Promise<void> {\n\t\tconsole.log('componentWillLoad');\n\t\tthis.validateSize(this.size)\n\t\tthis.validateColor(this.color)\n\t\tawait this.loadIconPathData()\n\t}\n\n\tprivate waitUntilVisible(callback: () => void): void {\n\t\tif (!Build.isBrowser || typeof window === \"undefined\" || !(window as any).IntersectionObserver) {\n\t\t\tcallback()\n\t\t\treturn\n\t\t}\n\t\tthis.intersectionObserver = new IntersectionObserver(\n\t\t\tentries => {\n\t\t\t\tentries.forEach(entry => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tif (this.intersectionObserver) {\n\t\t\t\t\t\t\tthis.intersectionObserver.disconnect()\n\t\t\t\t\t\t\tthis.intersectionObserver = null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t{rootMargin: \"50px\"},\n\t\t)\n\t\tthis.intersectionObserver.observe(this.host)\n\t}\n\n\tprivate async loadIcon() {\n\t\ttry {\n\t\t\tconst {name, type} = this\n\t\t\tconsole.log('loadIcon -> name, type', name, type);\n\t\t\tconst data = await fetchIcon({name, type})\n\t\t\tconst isValid = isValidSVG(data)\n\t\t\tthis.host.innerHTML = isValid ? data : null;\n\t\t} catch (e) {\n\t\t\tthis.host.innerHTML = ''\n\t\t\tthis.error = true\n\t\t}\n\t}\n\n\trender() {\n\t\tif (this.error) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(IconClass.root)} size={this.size} color={this.color}/>\n\t\t)\n\t}\n}\n","import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const ThemeSwitchSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type ThemeSwitchSizesType = `${ValueOf<typeof ThemeSwitchSizes>}`\n\nexport const ThemeSwitchClass = {\n\troot: 'gov-theme-switch',\n\tindicator: 'gov-theme-switch__indicator',\n\ticonLight: 'gov-theme-switch__icon-light',\n\ticonDark: 'gov-theme-switch__icon-dark',\n}\n\nexport const ATTRIBUTE_THEME_NAME = 'data-theme'\n","import {GovBaseEvent} from \"../../types/event.types\";\n\nexport enum ThemeList {\n\tauto = 'auto',\n\tlight = 'light',\n\tdark = 'dark'\n}\n\nexport interface ThemeSwitchEvent extends GovBaseEvent {\n\tref: HTMLGovThemeSwitchElement;\n\tstate: ThemeList\n}\n\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {GovHost} from \"../../helpers/Dom/template.types\";\nimport {govHost} from \"../../helpers/Dom/template\";\nimport {ATTRIBUTE_THEME_NAME, ThemeSwitchClass, ThemeSwitchSizes, ThemeSwitchSizesType} from \"./constants\";\nimport {isWindow} from \"../../helpers/Dom/win\";\nimport {ThemeList, ThemeSwitchEvent} from \"./gov-theme-switch.types\";\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {getCookie, setCookie} from \"../../helpers/Dom/document\";\n\n@Component({\n\ttag: \"gov-theme-switch\",\n})\nexport class GovThemeSwitch {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovThemeSwitchElement\n\n\t/**\n\t * Switch's size.\n\t */\n\t@Prop() readonly size?: ThemeSwitchSizesType = \"m\"\n\t/**\n\t * Display switch label\n\t */\n\t@Prop({attribute: \"display-label\"}) readonly displayLabel? = false\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"aria-label-light\"}) readonly ariaLabelLight? = \"Přenout na tmavý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"aria-label-dark\"}) readonly ariaLabelDark? = \"Přepnout na světlý mód\"\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"label-light\"}) readonly labelLight? = \"Světlý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"label-dark\"}) readonly labelDark? = \"Tmavý mód\"\n\t/**\n\t * Called when the theme is changed by the user\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<ThemeSwitchEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ThemeSwitchSizes, newValue, ThemeSwitchClass.root)\n\t}\n\n\t@Watch(\"theme\")\n\twatchTheme(newValue: ThemeList): void {\n\t\tthis.htmlElement.setAttribute(ATTRIBUTE_THEME_NAME, newValue);\n\t\tthis.htmlElement.classList.remove(...Object.keys(ThemeList));\n\t\tthis.htmlElement.classList.add(newValue);\n\t\tsetCookie(ATTRIBUTE_THEME_NAME, newValue);\n\t}\n\n\t@State() theme: ThemeList = ThemeList.auto\n\n\tprivate get storageValue() {\n\t\treturn getCookie(ATTRIBUTE_THEME_NAME)\n\t}\n\n\tprivate get htmlElement(): HTMLElement {\n\t\treturn document.documentElement\n\t}\n\n\tprivate get isSystemPrefersColorDark(): boolean {\n\t\treturn isWindow && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.initDefaultState()\n\t\tthis.validateSize(this.size)\n\t}\n\n\tprivate initDefaultState() {\n\t\tconst options = Object.keys(ThemeList);\n\t\tlet currentState = this.storageValue;\n\t\tconst htmlState = this.htmlElement.getAttribute(ATTRIBUTE_THEME_NAME)\n\n\t\tif (currentState && options.includes(currentState)) {\n\t\t\tthis.theme = currentState as ThemeList;\n\t\t} else if (htmlState && options.includes(htmlState)) {\n\t\t\tthis.theme = htmlState as ThemeList;\n\t\t} else {\n\t\t\tthis.theme = ThemeList.auto;\n\t\t}\n\t}\n\n\tprivate setThemeState = (state: ThemeList) => {\n\t\tthis.theme = state;\n\n\t\tthis.govChange.emit({\n\t\t\tcomponent: ThemeSwitchClass.root,\n\t\t\tstate: this.theme,\n\t\t\tref: this.host\n\t\t})\n\t}\n\n\trender() {\n\t\tlet isDark = this.theme === ThemeList.dark;\n\t\tif (this.theme === ThemeList.auto) {\n\t\t\tisDark = this.isSystemPrefersColorDark;\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ThemeSwitchClass.root)}\n\t\t\t\t theme={isDark ? ThemeList.dark : ThemeList.light}\n\t\t\t\t size={this.size}>\n\t\t\t\t<button onClick={() => this.setThemeState(isDark ? ThemeList.light : ThemeList.dark)}\n\t\t\t\t\t\taria-current={this.theme}\n\t\t\t\t\t\taria-label={isDark ? this.ariaLabelDark : this.ariaLabelLight}>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<span class={ThemeSwitchClass.indicator}>\n\t\t\t\t\t\t\t{ThemeList.light && <gov-icon name=\"sun\" class={ThemeSwitchClass.iconLight} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t\t{ThemeList.dark && <gov-icon name=\"moon\" class={ThemeSwitchClass.iconDark} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{this.displayLabel && (isDark ? this.labelDark : this.labelLight)}\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
@@ -6060,7 +6060,7 @@ const IconClass = {
6060
6060
  holder: 'gov-icon__holder',
6061
6061
  };
6062
6062
 
6063
- const version = "4.1.3-BETA-7";
6063
+ const version = "4.1.3-BETA-8";
6064
6064
 
6065
6065
  const dsVersion = () => {
6066
6066
  return version;
@@ -6084,6 +6084,8 @@ async function fetchIcon({ name, type }) {
6084
6084
  }
6085
6085
  console.log('requestCache[cacheKey]', requestCache, requestCache[cacheKey]);
6086
6086
  if (!requestCache[cacheKey]) {
6087
+ console.log('iconsPath()', iconsPath());
6088
+ console.log('name, type', name, type);
6087
6089
  console.log('iconUrl(iconsPath(), name, type)', iconUrl(iconsPath(), name, type));
6088
6090
  requestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {
6089
6091
  if (resp.status === 200) {
@@ -6056,7 +6056,7 @@ const IconClass = {
6056
6056
  holder: 'gov-icon__holder',
6057
6057
  };
6058
6058
 
6059
- const version = "4.1.3-BETA-7";
6059
+ const version = "4.1.3-BETA-8";
6060
6060
 
6061
6061
  const dsVersion = () => {
6062
6062
  return version;
@@ -6080,6 +6080,8 @@ async function fetchIcon({ name, type }) {
6080
6080
  }
6081
6081
  console.log('requestCache[cacheKey]', requestCache, requestCache[cacheKey]);
6082
6082
  if (!requestCache[cacheKey]) {
6083
+ console.log('iconsPath()', iconsPath());
6084
+ console.log('name, type', name, type);
6083
6085
  console.log('iconUrl(iconsPath(), name, type)', iconUrl(iconsPath(), name, type));
6084
6086
  requestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {
6085
6087
  if (resp.status === 200) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gov-design-system-ce/components",
3
3
  "description": "This package includes Gov Design System Web Components and related utilities.",
4
4
  "author": "Zdeněk Vítek",
5
- "version": "4.1.3-BETA-7",
5
+ "version": "4.1.3-BETA-8",
6
6
  "license": "EUPL v1.2 Licensed",
7
7
  "main": "./dist/index.cjs.js",
8
8
  "unpkg": "./dist/core/core.esm.js",
@@ -1,2 +0,0 @@
1
- import{p as t,H as e,B as s,h as o,d as n}from"./p-115b9cf3.js";import{p as i}from"./p-e0e2e9c1.js";import{C as r}from"./p-5aad3497.js";import{S as c}from"./p-92f420cb.js";import{g as a}from"./p-bfce6f99.js";import{i as l,a as h,b as u}from"./p-e8ec030e.js";import{g as d}from"./p-ea7fdd2e.js";import{v as f}from"./p-0b3574c2.js";i(c,["_XS","_S","_M","_L","_XL","_2XL","_3XL","_4XL","_5XL"]);const m=i(r,["DEFAULT","PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING","DISABLED","WHITE","BLACK"]);var p;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(p||(p={}));const v={root:"gov-icon",holder:"gov-icon__holder"};const w="4.1.3-BETA-7";const y=()=>w;const g={};const b={};const C=t=>t.startsWith("http://")||t.startsWith("https://");const E=(t,e,s)=>{if(C(t)){return`${t}/${s}/${e}.svg?v=${y()}`}return a(`${t}/${s}/${e}.svg`)+`?v=${y()}`};async function I({name:t,type:e}){const s=e+"-"+t;console.log("cacheKey",s);console.log("iconCache[cacheKey]",g,g[s]);if(g[s]){return g[s]}console.log("requestCache[cacheKey]",b,b[s]);if(!b[s]){console.log("iconUrl(iconsPath(), name, type)",E(l(),t,e));b[s]=fetch(E(l(),t,e)).then((t=>{if(t.status===200){return t.text()}else{throw new Error("Gov Icon doesn't exists")}}))}const o=await b[s];g[s]=o;return o}const L=(t,e,s)=>{if(!h){return}let o="";if(s){const t=new Date;t.setTime(t.getTime()+s*24*60*60*1e3);o="; expires="+t.toUTCString()}document.cookie=`${t}=${encodeURIComponent(e)}${o}; path=/`};const S=t=>{if(!h){return null}const e=t+"=";const s=document.cookie.split(";");for(let t=0;t<s.length;t++){let o=s[t].trim();if(o.startsWith(e)){return decodeURIComponent(o.substring(e.length))}}return null};const $=t=>{try{const e=new DOMParser;const s=e.parseFromString(t,"image/svg+xml");const o=s.querySelector("parsererror");if(o){return false}const n=s.documentElement;if(n.tagName.toLowerCase()!=="svg"){return false}return true}catch(t){return false}};const _=t(class t extends e{constructor(){super();this.__registerHost();this.size=undefined;this.color=undefined;this.name=null;this.type="components";this.visible=false;this.error=false;console.log("GovIcon");this.h=d(this.host)}validateSize(t){f(c,t,v.root)}validateColor(t){f(m,t,v.root)}watchError(t){console.log("error",t)}async loadIconPathData(){const{name:t,visible:e}=this;console.log("name, visible",t,e);console.log("Build.isBrowser",s.isBrowser);if(!t||!e){console.log("return");return}await this.loadIcon()}connectedCallback(){console.log("connectedCallback icon",this.name);console.log("iconsLazyLoad()",u());if(u()){this.visible=true;this.loadIconPathData().finally()}else{this.waitUntilVisible((async()=>{this.visible=true;await this.loadIconPathData()}))}}disconnectedCallback(){console.log("disconnectedCallback");if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}}async componentWillLoad(){console.log("componentWillLoad");this.validateSize(this.size);this.validateColor(this.color);await this.loadIconPathData()}waitUntilVisible(t){if(typeof window==="undefined"||!window.IntersectionObserver){t();return}this.intersectionObserver=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}t()}}))}),{rootMargin:"50px"});this.intersectionObserver.observe(this.host)}async loadIcon(){try{const{name:t,type:e}=this;console.log("loadIcon -> name, type",t,e);const s=await I({name:t,type:e});const o=$(s);this.host.innerHTML=o?s:null}catch(t){this.host.innerHTML="";this.error=true}}render(){if(this.error){return null}return o(n,{class:this.h.classes(v.root),size:this.size,color:this.color})}static get assetsDirs(){return["assets"]}get host(){return this}static get watchers(){return{size:["validateSize"],color:["validateColor"],error:["watchError"],name:["loadIconPathData"]}}},[0,"gov-icon",{size:[513],color:[513],name:[513],type:[513],visible:[32],error:[32]},undefined,{size:["validateSize"],color:["validateColor"],error:["watchError"],name:["loadIconPathData"]}]);function D(){if(typeof customElements==="undefined"){return}const t=["gov-icon"];t.forEach((t=>{switch(t){case"gov-icon":if(!customElements.get(t)){customElements.define(t,_)}break}}))}D();export{_ as G,D as d,S as g,L as s};
2
- //# sourceMappingURL=p-88b2667e.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["pick","Sizes","IconColors","Colors","Types","IconClass","root","holder","dsVersion","version","iconCache","requestCache","isExternalUrl","path","startsWith","iconUrl","name","type","getAssetPath","async","fetchIcon","cacheKey","console","log","iconsPath","fetch","then","resp","status","text","Error","setCookie","value","days","isWindow","expires","date","Date","setTime","getTime","toUTCString","document","cookie","encodeURIComponent","getCookie","nameEQ","cookies","split","i","length","trim","decodeURIComponent","substring","isValidSVG","svgContent","parser","DOMParser","doc","parseFromString","parseError","querySelector","svgElement","documentElement","tagName","toLowerCase","error","GovIcon","proxyCustomElement","H","constructor","this","h","govHost","host","validateSize","newValue","validateProp","validateColor","watchError","loadIconPathData","visible","Build","isBrowser","loadIcon","connectedCallback","iconsLazyLoad","finally","waitUntilVisible","disconnectedCallback","intersectionObserver","disconnect","componentWillLoad","size","color","callback","window","IntersectionObserver","entries","forEach","entry","isIntersecting","rootMargin","observe","data","isValid","innerHTML","e","render","Host","class","classes"],"sources":["../../../packages/core/src/components/gov-icon/constants.ts","../../../packages/core/src/utils/ds.utils.ts","../../../packages/core/src/utils/icon.utils.ts","../../../packages/core/src/helpers/Dom/document.ts","../../../packages/core/src/components/gov-icon/gov-icon.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils';\nimport { Colors } from '../../core/constants/colors';\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const IconSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL', '_2XL', '_3XL', '_4XL', '_5XL'])\nexport type IconSizesType = `${ValueOf<typeof IconSizes>}`\n\nexport const IconColors = pick(Colors, [\n\t'DEFAULT',\n\t'PRIMARY',\n\t'SECONDARY',\n\t'NEUTRAL',\n\t'ERROR',\n\t'SUCCESS',\n\t'WARNING',\n\t'DISABLED',\n\t'WHITE',\n\t'BLACK',\n])\nexport type IconColorType = `${ValueOf<typeof IconColors>}`\n\nenum Types {\n\tBASIC = 'basic',\n\tCOMPLEX = 'complex',\n\tCOLORED = 'colored',\n}\nexport type Type = `${ValueOf<typeof Types>}`\n\nexport const IconClass = {\n\troot: 'gov-icon',\n\tholder: 'gov-icon__holder',\n}\n","import { version } from '../../package.json'\n\nexport const dsVersion = (): string => {\n\treturn version\n}\n","import { getAssetPath } from \"@stencil/core\"\nimport { dsVersion } from \"./ds.utils\"\nimport { iconsPath } from \"../helpers/Dom/win\"\n\nconst iconCache: { [key: string]: string } = {}\nconst requestCache: { [key: string]: Promise<string> } = {}\n\nconst isExternalUrl = (path: string) => path.startsWith(\"http://\") || path.startsWith(\"https://\")\nconst iconUrl = (path: string, name: string, type: string) => {\n\tif (isExternalUrl(path)) {\n\t\treturn `${path}/${type}/${name}.svg?v=${dsVersion()}`\n\t}\n\treturn getAssetPath(`${path}/${type}/${name}.svg`) + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({ name, type }: { name: string; type: string }): Promise<string> {\n\tconst cacheKey = type + \"-\" + name\n\tconsole.log('cacheKey', cacheKey);\n\tconsole.log('iconCache[cacheKey]', iconCache, iconCache[cacheKey]);\n\tif (iconCache[cacheKey]) {\n\t\treturn iconCache[cacheKey]\n\t}\n\tconsole.log('requestCache[cacheKey]', requestCache, requestCache[cacheKey]);\n\n\tif (!requestCache[cacheKey]) {\n\t\tconsole.log('iconUrl(iconsPath(), name, type)', iconUrl(iconsPath(), name, type));\n\t\trequestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n\t\t\tif (resp.status === 200) {\n\t\t\t\treturn resp.text()\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Gov Icon doesn't exists\")\n\t\t\t}\n\t\t})\n\t}\n\tconst path = await requestCache[cacheKey]\n\ticonCache[cacheKey] = path\n\treturn path\n}\n","import {Nullable} from \"../../utils/helpers.types\";\nimport {isWindow} from \"./win\";\n\nexport const setCookie = (name: string, value: string, days?: number) => {\n\tif (!isWindow) {\n\t\treturn\n\t}\n\tlet expires = \"\";\n\tif (days) {\n\t\tconst date = new Date();\n\t\tdate.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n\t\texpires = \"; expires=\" + date.toUTCString();\n\t}\n\tdocument.cookie = `${name}=${encodeURIComponent(value)}${expires}; path=/`;\n}\n\nexport const getCookie = (name: string): Nullable<string> => {\n\tif (!isWindow) {\n\t\treturn null\n\t}\n\tconst nameEQ = name + \"=\";\n\tconst cookies = document.cookie.split(';');\n\tfor (let i = 0; i < cookies.length; i++) {\n\t\tlet cookie = cookies[i].trim();\n\t\tif (cookie.startsWith(nameEQ)) {\n\t\t\treturn decodeURIComponent(cookie.substring(nameEQ.length));\n\t\t}\n\t}\n\treturn null;\n}\n\nexport const isValidSVG = (svgContent: string): boolean => {\n\ttry {\n\t\tconst parser = new DOMParser();\n\t\tconst doc = parser.parseFromString(svgContent, \"image/svg+xml\");\n\t\tconst parseError = doc.querySelector(\"parsererror\");\n\t\tif (parseError) {\n\t\t\treturn false;\n\t\t}\n\t\tconst svgElement = doc.documentElement;\n\t\tif (svgElement.tagName.toLowerCase() !== \"svg\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch (error) {\n\t\treturn false;\n\t}\n}\n","import {Build, Component, Element, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {IconClass, IconColors, type IconColorType, IconSizesType} from \"./constants\"\nimport {fetchIcon} from \"../../utils/icon.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {iconsLazyLoad} from \"../../helpers/Dom/win\"\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {isValidSVG} from \"../../helpers/Dom/document\";\n\n@Component({\n\tassetsDirs: [\"assets\"],\n\ttag: \"gov-icon\",\n})\nexport class GovIcon {\n\tprivate h: GovHost\n\tprivate intersectionObserver: IntersectionObserver\n\n\tconstructor() {\n\t\tconsole.log('GovIcon');\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovIconElement\n\t/**\n\t * Icon size\n\t */\n\t@Prop({reflect: true}) readonly size?: IconSizesType\n\t/**\n\t * Icon color\n\t */\n\t@Prop({reflect: true}) readonly color?: IconColorType\n\t/**\n\t * Name of icon in folder\n\t */\n\t@Prop({reflect: true}) name: string = null\n\t/**\n\t * Type (folder) of icon\n\t */\n\t@Prop({reflect: true}) type = \"components\"\n\n\t@State() private visible = false\n\t@State() private error = false\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(IconColors, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"error\")\n\twatchError(newValue: string): void {\n\t\tconsole.log('error', newValue);\n\t}\n\n\t@Watch(\"name\")\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst {name, visible} = this\n\t\tconsole.log('name, visible', name, visible);\n\t\tconsole.log('Build.isBrowser', Build.isBrowser);\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\tconsole.log('return');\n\t\t\treturn\n\t\t}\n\t\tawait this.loadIcon()\n\t}\n\n\tconnectedCallback(): void {\n\t\tconsole.log('connectedCallback icon', this.name);\n\t\tconsole.log('iconsLazyLoad()', iconsLazyLoad());\n\t\tif (iconsLazyLoad()) {\n\t\t\tthis.visible = true\n\t\t\tthis.loadIconPathData().finally()\n\t\t} else {\n\t\t\tthis.waitUntilVisible(async () => {\n\t\t\t\tthis.visible = true\n\t\t\t\tawait this.loadIconPathData()\n\t\t\t})\n\t\t}\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tconsole.log('disconnectedCallback');\n\t\tif (this.intersectionObserver) {\n\t\t\tthis.intersectionObserver.disconnect()\n\t\t\tthis.intersectionObserver = null\n\t\t}\n\t}\n\n\tasync componentWillLoad(): Promise<void> {\n\t\tconsole.log('componentWillLoad');\n\t\tthis.validateSize(this.size)\n\t\tthis.validateColor(this.color)\n\t\tawait this.loadIconPathData()\n\t}\n\n\tprivate waitUntilVisible(callback: () => void): void {\n\t\tif (!Build.isBrowser || typeof window === \"undefined\" || !(window as any).IntersectionObserver) {\n\t\t\tcallback()\n\t\t\treturn\n\t\t}\n\t\tthis.intersectionObserver = new IntersectionObserver(\n\t\t\tentries => {\n\t\t\t\tentries.forEach(entry => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tif (this.intersectionObserver) {\n\t\t\t\t\t\t\tthis.intersectionObserver.disconnect()\n\t\t\t\t\t\t\tthis.intersectionObserver = null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t{rootMargin: \"50px\"},\n\t\t)\n\t\tthis.intersectionObserver.observe(this.host)\n\t}\n\n\tprivate async loadIcon() {\n\t\ttry {\n\t\t\tconst {name, type} = this\n\t\t\tconsole.log('loadIcon -> name, type', name, type);\n\t\t\tconst data = await fetchIcon({name, type})\n\t\t\tconst isValid = isValidSVG(data)\n\t\t\tthis.host.innerHTML = isValid ? data : null;\n\t\t} catch (e) {\n\t\t\tthis.host.innerHTML = ''\n\t\t\tthis.error = true\n\t\t}\n\t}\n\n\trender() {\n\t\tif (this.error) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(IconClass.root)} size={this.size} color={this.color}/>\n\t\t)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ACtBnC,KAAKL,MAAQ,I,EAIf,MAAA0C,GACC,GAAIrC,KAAKL,MAAO,CACf,OAAO,I,CAER,OACCM,EAACqC,EAAI,CAACC,MAAOvC,KAAKC,EAAEuC,QAAQzG,EAAUC,MAAOsF,KAAMtB,KAAKsB,KAAMC,MAAOvB,KAAKuB,O","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as t,h as e,a as s,g as i,c as o,B as n,d as c}from"./p-2ee042d4.js";import{S as a}from"./p-92f420cb.js";import{g as r}from"./p-ea7fdd2e.js";import{p as h}from"./p-e0e2e9c1.js";import{C as l}from"./p-5aad3497.js";import{i as d,a as u,b as f}from"./p-e8ec030e.js";import{v as m}from"./p-0b3574c2.js";const p={root:"gov-flex"};const b=class{constructor(e){t(this,e);this.direction="row";this.justifyContent=undefined;this.alignItems=undefined;this.wrap=undefined;this.alignContent=undefined;this.alignSelf=undefined;this.gap=undefined;this.h=r(this.host)}render(){return e(s,{key:"08c1591134f0b5c95a18ac9e1d3723c12d9bc47b",class:this.h.classes(p.root)},e("slot",{key:"b66fb8ffa35b0fb98eed3440a55a92a1bd97eb76"}))}get host(){return i(this)}};h(a,["_XS","_S","_M","_L","_XL","_2XL","_3XL","_4XL","_5XL"]);const v=h(l,["DEFAULT","PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING","DISABLED","WHITE","BLACK"]);var g;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(g||(g={}));const w={root:"gov-icon",holder:"gov-icon__holder"};const y="4.1.3-BETA-7";const _=()=>y;const k={};const L={};const C=t=>t.startsWith("http://")||t.startsWith("https://");const S=(t,e,s)=>{if(C(t)){return`${t}/${s}/${e}.svg?v=${_()}`}return o(`${t}/${s}/${e}.svg`)+`?v=${_()}`};async function I({name:t,type:e}){const s=e+"-"+t;console.log("cacheKey",s);console.log("iconCache[cacheKey]",k,k[s]);if(k[s]){return k[s]}console.log("requestCache[cacheKey]",L,L[s]);if(!L[s]){console.log("iconUrl(iconsPath(), name, type)",S(d(),t,e));L[s]=fetch(S(d(),t,e)).then((t=>{if(t.status===200){return t.text()}else{throw new Error("Gov Icon doesn't exists")}}))}const i=await L[s];k[s]=i;return i}const D=(t,e,s)=>{if(!u){return}let i="";if(s){const t=new Date;t.setTime(t.getTime()+s*24*60*60*1e3);i="; expires="+t.toUTCString()}document.cookie=`${t}=${encodeURIComponent(e)}${i}; path=/`};const E=t=>{if(!u){return null}const e=t+"=";const s=document.cookie.split(";");for(let t=0;t<s.length;t++){let i=s[t].trim();if(i.startsWith(e)){return decodeURIComponent(i.substring(e.length))}}return null};const $=t=>{try{const e=new DOMParser;const s=e.parseFromString(t,"image/svg+xml");const i=s.querySelector("parsererror");if(i){return false}const o=s.documentElement;if(o.tagName.toLowerCase()!=="svg"){return false}return true}catch(t){return false}};const R=class{constructor(e){t(this,e);this.size=undefined;this.color=undefined;this.name=null;this.type="components";this.visible=false;this.error=false;console.log("GovIcon");this.h=r(this.host)}validateSize(t){m(a,t,w.root)}validateColor(t){m(v,t,w.root)}watchError(t){console.log("error",t)}async loadIconPathData(){const{name:t,visible:e}=this;console.log("name, visible",t,e);console.log("Build.isBrowser",n.isBrowser);if(!t||!e){console.log("return");return}await this.loadIcon()}connectedCallback(){console.log("connectedCallback icon",this.name);console.log("iconsLazyLoad()",f());if(f()){this.visible=true;this.loadIconPathData().finally()}else{this.waitUntilVisible((async()=>{this.visible=true;await this.loadIconPathData()}))}}disconnectedCallback(){console.log("disconnectedCallback");if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}}async componentWillLoad(){console.log("componentWillLoad");this.validateSize(this.size);this.validateColor(this.color);await this.loadIconPathData()}waitUntilVisible(t){if(typeof window==="undefined"||!window.IntersectionObserver){t();return}this.intersectionObserver=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}t()}}))}),{rootMargin:"50px"});this.intersectionObserver.observe(this.host)}async loadIcon(){try{const{name:t,type:e}=this;console.log("loadIcon -> name, type",t,e);const s=await I({name:t,type:e});const i=$(s);this.host.innerHTML=i?s:null}catch(t){this.host.innerHTML="";this.error=true}}render(){if(this.error){return null}return e(s,{class:this.h.classes(w.root),size:this.size,color:this.color})}static get assetsDirs(){return["assets"]}get host(){return i(this)}static get watchers(){return{size:["validateSize"],color:["validateColor"],error:["watchError"],name:["loadIconPathData"]}}};const j=h(a,["_XS","_S","_M","_L","_XL"]);const z={root:"gov-theme-switch",indicator:"gov-theme-switch__indicator",iconLight:"gov-theme-switch__icon-light",iconDark:"gov-theme-switch__icon-dark"};const x="data-theme";var A;(function(t){t["auto"]="auto";t["light"]="light";t["dark"]="dark"})(A||(A={}));const P=class{constructor(e){t(this,e);this.govChange=c(this,"gov-change",7);this.setThemeState=t=>{this.theme=t;this.govChange.emit({component:z.root,state:this.theme,ref:this.host})};this.size="m";this.displayLabel=false;this.ariaLabelLight="Přenout na tmavý mód";this.ariaLabelDark="Přepnout na světlý mód";this.labelLight="Světlý mód";this.labelDark="Tmavý mód";this.theme=A.auto;this.h=r(this.host)}validateSize(t){m(j,t,z.root)}watchTheme(t){this.htmlElement.setAttribute(x,t);this.htmlElement.classList.remove(...Object.keys(A));this.htmlElement.classList.add(t);D(x,t)}get storageValue(){return E(x)}get htmlElement(){return document.documentElement}get isSystemPrefersColorDark(){return u&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}componentWillLoad(){this.initDefaultState();this.validateSize(this.size)}initDefaultState(){const t=Object.keys(A);let e=this.storageValue;const s=this.htmlElement.getAttribute(x);if(e&&t.includes(e)){this.theme=e}else if(s&&t.includes(s)){this.theme=s}else{this.theme=A.auto}}render(){let t=this.theme===A.dark;if(this.theme===A.auto){t=this.isSystemPrefersColorDark}return e(s,{key:"784ed0513ea1436bb754dc82691646422789783b",class:this.h.classes(z.root),theme:t?A.dark:A.light,size:this.size},e("button",{key:"d4abc155a8ae8f07d0a49c378e295c3ab57318d4",onClick:()=>this.setThemeState(t?A.light:A.dark),"aria-current":this.theme,"aria-label":t?this.ariaLabelDark:this.ariaLabelLight},e("span",{key:"7f713875d5618acc919702cdc60e9db58dfb9db5"},e("span",{key:"0b57c0153047ef292b6bdc43b49e5a1a9cdc17e1",class:z.indicator},A.light&&e("gov-icon",{key:"ae2c751435a2bc9c1e9f8dfa4ca52e13943ada9b",name:"sun",class:z.iconLight,type:"components"}),A.dark&&e("gov-icon",{key:"7a4ee602a37742ab94dcee47a7c4970d5dce5bb6",name:"moon",class:z.iconDark,type:"components"})),this.displayLabel&&(t?this.labelDark:this.labelLight))))}get host(){return i(this)}static get watchers(){return{size:["validateSize"],theme:["watchTheme"]}}};export{b as gov_flex,R as gov_icon,P as gov_theme_switch};
2
- //# sourceMappingURL=p-f14252eb.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["FlexClass","root","GovFlex","constructor","hostRef","this","h","govHost","host","render","Host","key","class","classes","pick","Sizes","IconColors","Colors","Types","IconClass","holder","dsVersion","version","iconCache","requestCache","isExternalUrl","path","startsWith","iconUrl","name","type","getAssetPath","async","fetchIcon","cacheKey","console","log","iconsPath","fetch","then","resp","status","text","Error","setCookie","value","days","isWindow","expires","date","Date","setTime","getTime","toUTCString","document","cookie","encodeURIComponent","getCookie","nameEQ","cookies","split","i","length","trim","decodeURIComponent","substring","isValidSVG","svgContent","parser","DOMParser","doc","parseFromString","parseError","querySelector","svgElement","documentElement","tagName","toLowerCase","error","GovIcon","validateSize","newValue","validateProp","validateColor","watchError","loadIconPathData","visible","Build","isBrowser","loadIcon","connectedCallback","iconsLazyLoad","finally","waitUntilVisible","disconnectedCallback","intersectionObserver","disconnect","componentWillLoad","size","color","callback","window","IntersectionObserver","entries","forEach","entry","isIntersecting","rootMargin","observe","data","isValid","innerHTML","e","ThemeSwitchSizes","ThemeSwitchClass","indicator","iconLight","iconDark","ATTRIBUTE_THEME_NAME","ThemeList","GovThemeSwitch","setThemeState","state","theme","govChange","emit","component","ref","auto","watchTheme","htmlElement","setAttribute","classList","remove","Object","keys","add","storageValue","isSystemPrefersColorDark","matchMedia","matches","initDefaultState","options","currentState","htmlState","getAttribute","includes","isDark","dark","light","onClick","ariaLabelDark","ariaLabelLight","displayLabel","labelDark","labelLight"],"sources":["../../../packages/core/src/components/gov-flex/constants.ts","../../../packages/core/src/components/gov-flex/gov-flex.tsx","../../../packages/core/src/components/gov-icon/constants.ts","../../../packages/core/src/utils/ds.utils.ts","../../../packages/core/src/utils/icon.utils.ts","../../../packages/core/src/helpers/Dom/document.ts","../../../packages/core/src/components/gov-icon/gov-icon.tsx","../../../packages/core/src/components/gov-theme-switch/constants.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.types.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.tsx"],"sourcesContent":["import {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const FlexSizes = Sizes\nexport type FlexSizesType = `${ValueOf<typeof FlexSizes>}`\n\nexport const FlexClass = {\n\troot: 'gov-flex',\n}\n\n","import {Component, Element, h, Host, Prop} from '@stencil/core'\nimport {FlexClass, FlexSizesType} from './constants'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-flex',\n})\nexport class GovFlex {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovGridElement\n\n\t/**\n\t * Controls the flex direction of the container.\n\t */\n\t@Prop() direction: 'row' | 'row-reverse' | 'column' | 'column-reverse' = 'row';\n\n\t/**\n\t * Defines how the browser distributes space between and around content items along the main axis.\n\t */\n\t@Prop({\n\t\tattribute: 'justify-content',\n\t\treflect: true\n\t}) justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';\n\n\t/**\n\t * Aligns flex items along the cross axis.\n\t */\n\t@Prop({\n\t\tattribute: 'align-items',\n\t\treflect: true\n\t}) alignItems?: 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline';\n\n\t/**\n\t * Controls whether the flex container is a single-line or multi-line flex container.\n\t */\n\t@Prop({reflect: true}) wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';\n\n\t/**\n\t * Aligns the flex container's lines within when there is extra space in the cross-axis.\n\t */\n\t@Prop({\n\t\tattribute: 'align-content',\n\t\treflect: true\n\t}) alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'stretch';\n\n\t/**\n\t * Sets the alignment of the flex container’s children along the flex container’s cross axis, overriding the `align-items` property for individual flex items.\n\t */\n\t@Prop({\n\t\tattribute: 'align-self',\n\t\treflect: true\n\t}) alignSelf?: 'auto' | 'normal' | 'self-start' | 'self-end' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch' | 'anchor-center';\n\n\t/**\n\t * The gap property creates consistent spacing between flex items in the container.\n\t */\n\t@Prop({\n\t\tattribute: 'gap',\n\t\treflect: true\n\t}) gap?: FlexSizesType;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FlexClass.root)}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n","import { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils';\nimport { Colors } from '../../core/constants/colors';\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const IconSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL', '_2XL', '_3XL', '_4XL', '_5XL'])\nexport type IconSizesType = `${ValueOf<typeof IconSizes>}`\n\nexport const IconColors = pick(Colors, [\n\t'DEFAULT',\n\t'PRIMARY',\n\t'SECONDARY',\n\t'NEUTRAL',\n\t'ERROR',\n\t'SUCCESS',\n\t'WARNING',\n\t'DISABLED',\n\t'WHITE',\n\t'BLACK',\n])\nexport type IconColorType = `${ValueOf<typeof IconColors>}`\n\nenum Types {\n\tBASIC = 'basic',\n\tCOMPLEX = 'complex',\n\tCOLORED = 'colored',\n}\nexport type Type = `${ValueOf<typeof Types>}`\n\nexport const IconClass = {\n\troot: 'gov-icon',\n\tholder: 'gov-icon__holder',\n}\n","import { version } from '../../package.json'\n\nexport const dsVersion = (): string => {\n\treturn version\n}\n","import { getAssetPath } from \"@stencil/core\"\nimport { dsVersion } from \"./ds.utils\"\nimport { iconsPath } from \"../helpers/Dom/win\"\n\nconst iconCache: { [key: string]: string } = {}\nconst requestCache: { [key: string]: Promise<string> } = {}\n\nconst isExternalUrl = (path: string) => path.startsWith(\"http://\") || path.startsWith(\"https://\")\nconst iconUrl = (path: string, name: string, type: string) => {\n\tif (isExternalUrl(path)) {\n\t\treturn `${path}/${type}/${name}.svg?v=${dsVersion()}`\n\t}\n\treturn getAssetPath(`${path}/${type}/${name}.svg`) + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({ name, type }: { name: string; type: string }): Promise<string> {\n\tconst cacheKey = type + \"-\" + name\n\tconsole.log('cacheKey', cacheKey);\n\tconsole.log('iconCache[cacheKey]', iconCache, iconCache[cacheKey]);\n\tif (iconCache[cacheKey]) {\n\t\treturn iconCache[cacheKey]\n\t}\n\tconsole.log('requestCache[cacheKey]', requestCache, requestCache[cacheKey]);\n\n\tif (!requestCache[cacheKey]) {\n\t\tconsole.log('iconUrl(iconsPath(), name, type)', iconUrl(iconsPath(), name, type));\n\t\trequestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n\t\t\tif (resp.status === 200) {\n\t\t\t\treturn resp.text()\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Gov Icon doesn't exists\")\n\t\t\t}\n\t\t})\n\t}\n\tconst path = await requestCache[cacheKey]\n\ticonCache[cacheKey] = path\n\treturn path\n}\n","import {Nullable} from \"../../utils/helpers.types\";\nimport {isWindow} from \"./win\";\n\nexport const setCookie = (name: string, value: string, days?: number) => {\n\tif (!isWindow) {\n\t\treturn\n\t}\n\tlet expires = \"\";\n\tif (days) {\n\t\tconst date = new Date();\n\t\tdate.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n\t\texpires = \"; expires=\" + date.toUTCString();\n\t}\n\tdocument.cookie = `${name}=${encodeURIComponent(value)}${expires}; path=/`;\n}\n\nexport const getCookie = (name: string): Nullable<string> => {\n\tif (!isWindow) {\n\t\treturn null\n\t}\n\tconst nameEQ = name + \"=\";\n\tconst cookies = document.cookie.split(';');\n\tfor (let i = 0; i < cookies.length; i++) {\n\t\tlet cookie = cookies[i].trim();\n\t\tif (cookie.startsWith(nameEQ)) {\n\t\t\treturn decodeURIComponent(cookie.substring(nameEQ.length));\n\t\t}\n\t}\n\treturn null;\n}\n\nexport const isValidSVG = (svgContent: string): boolean => {\n\ttry {\n\t\tconst parser = new DOMParser();\n\t\tconst doc = parser.parseFromString(svgContent, \"image/svg+xml\");\n\t\tconst parseError = doc.querySelector(\"parsererror\");\n\t\tif (parseError) {\n\t\t\treturn false;\n\t\t}\n\t\tconst svgElement = doc.documentElement;\n\t\tif (svgElement.tagName.toLowerCase() !== \"svg\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch (error) {\n\t\treturn false;\n\t}\n}\n","import {Build, Component, Element, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {IconClass, IconColors, type IconColorType, IconSizesType} from \"./constants\"\nimport {fetchIcon} from \"../../utils/icon.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {iconsLazyLoad} from \"../../helpers/Dom/win\"\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {isValidSVG} from \"../../helpers/Dom/document\";\n\n@Component({\n\tassetsDirs: [\"assets\"],\n\ttag: \"gov-icon\",\n})\nexport class GovIcon {\n\tprivate h: GovHost\n\tprivate intersectionObserver: IntersectionObserver\n\n\tconstructor() {\n\t\tconsole.log('GovIcon');\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovIconElement\n\t/**\n\t * Icon size\n\t */\n\t@Prop({reflect: true}) readonly size?: IconSizesType\n\t/**\n\t * Icon color\n\t */\n\t@Prop({reflect: true}) readonly color?: IconColorType\n\t/**\n\t * Name of icon in folder\n\t */\n\t@Prop({reflect: true}) name: string = null\n\t/**\n\t * Type (folder) of icon\n\t */\n\t@Prop({reflect: true}) type = \"components\"\n\n\t@State() private visible = false\n\t@State() private error = false\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(IconColors, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"error\")\n\twatchError(newValue: string): void {\n\t\tconsole.log('error', newValue);\n\t}\n\n\t@Watch(\"name\")\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst {name, visible} = this\n\t\tconsole.log('name, visible', name, visible);\n\t\tconsole.log('Build.isBrowser', Build.isBrowser);\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\tconsole.log('return');\n\t\t\treturn\n\t\t}\n\t\tawait this.loadIcon()\n\t}\n\n\tconnectedCallback(): void {\n\t\tconsole.log('connectedCallback icon', this.name);\n\t\tconsole.log('iconsLazyLoad()', iconsLazyLoad());\n\t\tif (iconsLazyLoad()) {\n\t\t\tthis.visible = true\n\t\t\tthis.loadIconPathData().finally()\n\t\t} else {\n\t\t\tthis.waitUntilVisible(async () => {\n\t\t\t\tthis.visible = true\n\t\t\t\tawait this.loadIconPathData()\n\t\t\t})\n\t\t}\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tconsole.log('disconnectedCallback');\n\t\tif (this.intersectionObserver) {\n\t\t\tthis.intersectionObserver.disconnect()\n\t\t\tthis.intersectionObserver = null\n\t\t}\n\t}\n\n\tasync componentWillLoad(): Promise<void> {\n\t\tconsole.log('componentWillLoad');\n\t\tthis.validateSize(this.size)\n\t\tthis.validateColor(this.color)\n\t\tawait this.loadIconPathData()\n\t}\n\n\tprivate waitUntilVisible(callback: () => void): void {\n\t\tif (!Build.isBrowser || typeof window === \"undefined\" || !(window as any).IntersectionObserver) {\n\t\t\tcallback()\n\t\t\treturn\n\t\t}\n\t\tthis.intersectionObserver = new IntersectionObserver(\n\t\t\tentries => {\n\t\t\t\tentries.forEach(entry => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tif (this.intersectionObserver) {\n\t\t\t\t\t\t\tthis.intersectionObserver.disconnect()\n\t\t\t\t\t\t\tthis.intersectionObserver = null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t{rootMargin: \"50px\"},\n\t\t)\n\t\tthis.intersectionObserver.observe(this.host)\n\t}\n\n\tprivate async loadIcon() {\n\t\ttry {\n\t\t\tconst {name, type} = this\n\t\t\tconsole.log('loadIcon -> name, type', name, type);\n\t\t\tconst data = await fetchIcon({name, type})\n\t\t\tconst isValid = isValidSVG(data)\n\t\t\tthis.host.innerHTML = isValid ? data : null;\n\t\t} catch (e) {\n\t\t\tthis.host.innerHTML = ''\n\t\t\tthis.error = true\n\t\t}\n\t}\n\n\trender() {\n\t\tif (this.error) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(IconClass.root)} size={this.size} color={this.color}/>\n\t\t)\n\t}\n}\n","import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const ThemeSwitchSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type ThemeSwitchSizesType = `${ValueOf<typeof ThemeSwitchSizes>}`\n\nexport const ThemeSwitchClass = {\n\troot: 'gov-theme-switch',\n\tindicator: 'gov-theme-switch__indicator',\n\ticonLight: 'gov-theme-switch__icon-light',\n\ticonDark: 'gov-theme-switch__icon-dark',\n}\n\nexport const ATTRIBUTE_THEME_NAME = 'data-theme'\n","import {GovBaseEvent} from \"../../types/event.types\";\n\nexport enum ThemeList {\n\tauto = 'auto',\n\tlight = 'light',\n\tdark = 'dark'\n}\n\nexport interface ThemeSwitchEvent extends GovBaseEvent {\n\tref: HTMLGovThemeSwitchElement;\n\tstate: ThemeList\n}\n\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {GovHost} from \"../../helpers/Dom/template.types\";\nimport {govHost} from \"../../helpers/Dom/template\";\nimport {ATTRIBUTE_THEME_NAME, ThemeSwitchClass, ThemeSwitchSizes, ThemeSwitchSizesType} from \"./constants\";\nimport {isWindow} from \"../../helpers/Dom/win\";\nimport {ThemeList, ThemeSwitchEvent} from \"./gov-theme-switch.types\";\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {getCookie, setCookie} from \"../../helpers/Dom/document\";\n\n@Component({\n\ttag: \"gov-theme-switch\",\n})\nexport class GovThemeSwitch {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovThemeSwitchElement\n\n\t/**\n\t * Switch's size.\n\t */\n\t@Prop() readonly size?: ThemeSwitchSizesType = \"m\"\n\t/**\n\t * Display switch label\n\t */\n\t@Prop({attribute: \"display-label\"}) readonly displayLabel? = false\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"aria-label-light\"}) readonly ariaLabelLight? = \"Přenout na tmavý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"aria-label-dark\"}) readonly ariaLabelDark? = \"Přepnout na světlý mód\"\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"label-light\"}) readonly labelLight? = \"Světlý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"label-dark\"}) readonly labelDark? = \"Tmavý mód\"\n\t/**\n\t * Called when the theme is changed by the user\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<ThemeSwitchEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ThemeSwitchSizes, newValue, ThemeSwitchClass.root)\n\t}\n\n\t@Watch(\"theme\")\n\twatchTheme(newValue: ThemeList): void {\n\t\tthis.htmlElement.setAttribute(ATTRIBUTE_THEME_NAME, newValue);\n\t\tthis.htmlElement.classList.remove(...Object.keys(ThemeList));\n\t\tthis.htmlElement.classList.add(newValue);\n\t\tsetCookie(ATTRIBUTE_THEME_NAME, newValue);\n\t}\n\n\t@State() theme: ThemeList = ThemeList.auto\n\n\tprivate get storageValue() {\n\t\treturn getCookie(ATTRIBUTE_THEME_NAME)\n\t}\n\n\tprivate get htmlElement(): HTMLElement {\n\t\treturn document.documentElement\n\t}\n\n\tprivate get isSystemPrefersColorDark(): boolean {\n\t\treturn isWindow && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.initDefaultState()\n\t\tthis.validateSize(this.size)\n\t}\n\n\tprivate initDefaultState() {\n\t\tconst options = Object.keys(ThemeList);\n\t\tlet currentState = this.storageValue;\n\t\tconst htmlState = this.htmlElement.getAttribute(ATTRIBUTE_THEME_NAME)\n\n\t\tif (currentState && options.includes(currentState)) {\n\t\t\tthis.theme = currentState as ThemeList;\n\t\t} else if (htmlState && options.includes(htmlState)) {\n\t\t\tthis.theme = htmlState as ThemeList;\n\t\t} else {\n\t\t\tthis.theme = ThemeList.auto;\n\t\t}\n\t}\n\n\tprivate setThemeState = (state: ThemeList) => {\n\t\tthis.theme = state;\n\n\t\tthis.govChange.emit({\n\t\t\tcomponent: ThemeSwitchClass.root,\n\t\t\tstate: this.theme,\n\t\t\tref: this.host\n\t\t})\n\t}\n\n\trender() {\n\t\tlet isDark = this.theme === ThemeList.dark;\n\t\tif (this.theme === ThemeList.auto) {\n\t\t\tisDark = this.isSystemPrefersColorDark;\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ThemeSwitchClass.root)}\n\t\t\t\t theme={isDark ? ThemeList.dark : ThemeList.light}\n\t\t\t\t size={this.size}>\n\t\t\t\t<button onClick={() => this.setThemeState(isDark ? ThemeList.light : ThemeList.dark)}\n\t\t\t\t\t\taria-current={this.theme}\n\t\t\t\t\t\taria-label={isDark ? this.ariaLabelDark : this.ariaLabelLight}>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<span class={ThemeSwitchClass.indicator}>\n\t\t\t\t\t\t\t{ThemeList.light && <gov-icon name=\"sun\" class={ThemeSwitchClass.iconLight} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t\t{ThemeList.dark && <gov-icon name=\"moon\" class={ThemeSwitchClass.iconDark} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{this.displayLabel && (isDark ? this.labelDark : this.labelLight)}\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"oTAMO,MAAMA,EAAY,CACxBC,KAAM,Y,MCCMC,EAAO,MAGnB,WAAAC,CAAAC,G,yBASyE,M,oJARxEC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAuDvB,MAAAC,GACC,OACCH,EAACI,EAAI,CAAAC,IAAA,2CAACC,MAAOP,KAAKC,EAAEO,QAAQb,EAAUC,OACrCK,EAAA,QAAAK,IAAA,6C,6BCjEqBG,EAAKC,EAAO,CAAC,MAAO,KAAM,KAAM,KAAM,MAAO,OAAQ,OAAQ,OAAQ,SAGvF,MAAMC,EAAaF,EAAKG,EAAQ,CACtC,UACA,UACA,YACA,UACA,QACA,UACA,UACA,WACA,QACA,UAID,IAAKC,GAAL,SAAKA,GACJA,EAAA,iBACAA,EAAA,qBACAA,EAAA,oBACA,EAJD,CAAKA,MAAK,KAOH,MAAMC,EAAY,CACxBlB,KAAM,WACNmB,OAAQ,oB,uBC7BF,MAAMC,EAAY,IACjBC,ECCR,MAAMC,EAAuC,GA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