@gov-design-system-ce/components 4.2.3 → 4.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-button.cjs.entry.js +4 -3
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-empty.cjs.entry.js +7 -1
- package/dist/cjs/gov-empty.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-flex_3.cjs.entry.js +3 -3
- package/dist/cjs/gov-flex_3.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-infobar.cjs.entry.js +6 -2
- package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gov-button/button/gov-button.js +22 -3
- package/dist/collection/components/gov-button/button/gov-button.js.map +1 -1
- package/dist/collection/components/gov-empty/constants.js +5 -0
- package/dist/collection/components/gov-empty/constants.js.map +1 -1
- package/dist/collection/components/gov-empty/gov-empty.js +26 -1
- package/dist/collection/components/gov-empty/gov-empty.js.map +1 -1
- package/dist/collection/components/gov-form/label/gov-form-label.js +1 -1
- package/dist/collection/components/gov-form/label/gov-form-label.js.map +1 -1
- package/dist/collection/components/gov-infobar/gov-infobar.js +6 -2
- package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -1
- package/dist/collection/components/gov-theme-switch/gov-theme-switch.js +5 -5
- package/dist/collection/components/gov-theme-switch/gov-theme-switch.js.map +1 -1
- package/dist/collection/pages/Banner.js +10 -0
- package/dist/collection/pages/Banner.js.map +1 -1
- package/dist/collection/pages/Button.js +18 -0
- package/dist/collection/pages/Button.js.map +1 -1
- package/dist/collection/pages/Empty.js +26 -0
- package/dist/collection/pages/Empty.js.map +1 -1
- package/dist/collection/pages/Forms.js +31 -31
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/pages/Home.js +8 -2
- package/dist/collection/pages/Home.js.map +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-blockquote.js +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-chip.js +1 -1
- package/dist/components/gov-dialog.js +1 -1
- package/dist/components/gov-empty.js +1 -1
- package/dist/components/gov-empty.js.map +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-label.js +1 -1
- package/dist/components/gov-form-label.js.map +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-range.js +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-form-switch.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-infobar.js.map +1 -1
- package/dist/components/gov-link.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tabs.js.map +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-theme-switch.js +1 -1
- package/dist/components/gov-theme-switch.js.map +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/{p-8e888b01.js → p-043a676e.js} +2 -2
- package/dist/components/{p-5b0a3c98.js → p-2b33d27c.js} +2 -2
- package/dist/components/{p-1572effa.js → p-90657523.js} +2 -2
- package/dist/components/p-abea96cf.js +2 -0
- package/dist/components/p-abea96cf.js.map +1 -0
- package/dist/components/{p-c150610c.js → p-b56d6b99.js} +2 -2
- package/dist/components/{p-11fa70ff.js → p-bd393ff0.js} +2 -2
- package/dist/components/{p-93f4a242.js → p-cbe3bc71.js} +2 -2
- package/dist/core/core.css +115 -42
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/p-39d6e51d.entry.js +2 -0
- package/dist/core/p-39d6e51d.entry.js.map +1 -0
- package/dist/core/{p-83e14b47.entry.js → p-9e5eb19a.entry.js} +2 -2
- package/dist/core/{p-83e14b47.entry.js.map → p-9e5eb19a.entry.js.map} +1 -1
- package/dist/core/p-ac800db4.entry.js +2 -0
- package/dist/core/p-ac800db4.entry.js.map +1 -0
- package/dist/core/p-d45bcd43.entry.js +2 -0
- package/dist/core/p-d45bcd43.entry.js.map +1 -0
- package/dist/core/p-e7e00fe3.entry.js +2 -0
- package/dist/core/{p-774ea182.entry.js.map → p-e7e00fe3.entry.js.map} +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-button.entry.js +4 -3
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-empty.entry.js +7 -1
- package/dist/esm/gov-empty.entry.js.map +1 -1
- package/dist/esm/gov-flex_3.entry.js +3 -3
- package/dist/esm/gov-flex_3.entry.js.map +1 -1
- package/dist/esm/gov-form-label.entry.js +1 -1
- package/dist/esm/gov-form-label.entry.js.map +1 -1
- package/dist/esm/gov-infobar.entry.js +6 -2
- package/dist/esm/gov-infobar.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +25 -12
- package/dist/hydrate/index.mjs +25 -12
- package/dist/types/components/gov-button/button/gov-button.d.ts +4 -0
- package/dist/types/components/gov-empty/constants.d.ts +5 -0
- package/dist/types/components/gov-empty/gov-empty.d.ts +5 -1
- package/dist/types/components/gov-infobar/gov-infobar.d.ts +2 -0
- package/dist/types/components/gov-theme-switch/gov-theme-switch.d.ts +1 -1
- package/dist/types/components.d.ts +20 -4
- package/package.json +1 -1
- package/dist/components/p-62d01259.js +0 -2
- package/dist/components/p-62d01259.js.map +0 -1
- package/dist/core/p-774ea182.entry.js +0 -2
- package/dist/core/p-a1c825f3.entry.js +0 -2
- package/dist/core/p-a1c825f3.entry.js.map +0 -1
- package/dist/core/p-c1584cfe.entry.js +0 -2
- package/dist/core/p-c1584cfe.entry.js.map +0 -1
- package/dist/core/p-c5a49469.entry.js +0 -2
- package/dist/core/p-c5a49469.entry.js.map +0 -1
- /package/dist/components/{p-8e888b01.js.map → p-043a676e.js.map} +0 -0
- /package/dist/components/{p-5b0a3c98.js.map → p-2b33d27c.js.map} +0 -0
- /package/dist/components/{p-1572effa.js.map → p-90657523.js.map} +0 -0
- /package/dist/components/{p-c150610c.js.map → p-b56d6b99.js.map} +0 -0
- /package/dist/components/{p-11fa70ff.js.map → p-bd393ff0.js.map} +0 -0
- /package/dist/components/{p-93f4a242.js.map → p-cbe3bc71.js.map} +0 -0
package/dist/cjs/core.cjs.js
CHANGED
|
@@ -40,7 +40,7 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
40
40
|
|
|
41
41
|
patchBrowser().then(async (options) => {
|
|
42
42
|
await appGlobals.globalScripts();
|
|
43
|
-
return index.bootstrapLazy(JSON.parse("[[\"gov-form-file.cjs\",[[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\"]}]]],[\"gov-form-multi-select.cjs\",[[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\"]}]]],[\"gov-dialog.cjs\",[[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\"]}]]],[\"gov-form-range.cjs\",[[4,\"gov-form-range\",{\"size\":[1],\"value\":[1537],\"identifier\":[1],\"name\":[1],\"min\":[8],\"max\":[8],\"step\":[8],\"tooltip\":[4],\"input\":[4],\"listIdentifier\":[1,\"list-identifier\"],\"required\":[516],\"success\":[516],\"invalid\":[516],\"disabled\":[516],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"value\":[\"watchValue\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]],[\"gov-pagination.cjs\",[[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\"]}]]],[\"gov-breadcrumbs.cjs\",[[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]}]]],[\"gov-infobar.cjs\",[[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\"]}]]],[\"gov-loading.cjs\",[[4,\"gov-loading\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tabs.cjs\",[[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\"]}]]],[\"gov-toast.cjs\",[[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\"]}]]],[\"gov-tooltip-content.cjs\",[[4,\"gov-tooltip-content\",{\"color\":[1],\"size\":[1],\"persist\":[4],\"isVisible\":[1028,\"is-visible\"],\"parentId\":[1,\"parent-id\"]},null,{\"isVisible\":[\"visibleContent\"]}]]],[\"gov-accordion-item.cjs\",[[4,\"gov-accordion-item\",{\"identifier\":[1],\"size\":[1025],\"disabled\":[4],\"open\":[1028],\"openState\":[32],\"toggle\":[64],\"currentState\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-blockquote.cjs\",[[4,\"gov-blockquote\",{\"type\":[513],\"cite\":[1]}]]],[\"gov-card.cjs\",[[4,\"gov-card\",{\"direction\":[1],\"collapsible\":[4],\"open\":[1540],\"href\":[513],\"target\":[1],\"accessibleTriggerLabel\":[1,\"accessible-label\"],\"accessibleTriggerLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-form-checkbox.cjs\",[[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\"]}]]],[\"gov-form-switch.cjs\",[[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\"]}]]],[\"gov-link.cjs\",[[4,\"gov-link\",{\"size\":[1],\"external\":[4],\"truncate\":[4],\"href\":[1],\"target\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tag.cjs\",[[4,\"gov-tag\",{\"iconStart\":[1,\"icon-start\"],\"iconEnd\":[1,\"icon-end\"],\"size\":[513],\"color\":[513],\"type\":[513],\"expanded\":[516]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-tile.cjs\",[[4,\"gov-tile\",{\"size\":[513],\"orientation\":[1],\"noBorder\":[4,\"no-border\"],\"href\":[513],\"target\":[1],\"getTriggerRef\":[64]}]]],[\"gov-wizard-item.cjs\",[[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\"]}]]],[\"gov-accordion.cjs\",[[4,\"gov-accordion\",{\"size\":[1],\"noBorder\":[4,\"no-border\"]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-banner.cjs\",[[4,\"gov-banner\",{\"size\":[513],\"background\":[1],\"foreground\":[1],\"textColor\":[1,\"text-color\"]},null,{\"size\":[\"validateSize\"],\"background\":[\"validateBackground\"],\"foreground\":[\"validateForeground\"],\"text-color\":[\"validateTextColor\"]}]]],[\"gov-container.cjs\",[[4,\"gov-container\"]]],[\"gov-control-group.cjs\",[[4,\"gov-control-group\",{\"color\":[1],\"noBorder\":[4,\"no-border\"],\"fitContent\":[4,\"fit-content\"]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-cookiebar.cjs\",[[4,\"gov-cookiebar\"]]],[\"gov-dropdown.cjs\",[[4,\"gov-dropdown\",{\"identifier\":[1],\"open\":[1028],\"position\":[1],\"getState\":[64],\"toggle\":[64]},null,{\"open\":[\"watchOpen\"]}]]],[\"gov-empty.cjs\",[[4,\"gov-empty\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-error-code.cjs\",[[4,\"gov-error-code\"]]],[\"gov-form-checkbox-group.cjs\",[[4,\"gov-form-checkbox-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-control.cjs\",[[4,\"gov-form-control\",{\"identifier\":[1],\"invalid\":[516],\"disabled\":[516],\"success\":[516],\"fieldset\":[4],\"size\":[1]}]]],[\"gov-form-group.cjs\",[[4,\"gov-form-group\",{\"gap\":[1],\"orientation\":[1]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-label.cjs\",[[4,\"gov-form-label\",{\"identifier\":[1],\"size\":[1],\"required\":[4],\"legend\":[4]}]]],[\"gov-form-password-power.cjs\",[[4,\"gov-form-password-power\",{\"power\":[514]}]]],[\"gov-form-radio.cjs\",[[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\"]}]]],[\"gov-form-radio-group.cjs\",[[4,\"gov-form-radio-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-search.cjs\",[[4,\"gov-form-search\",{\"size\":[1],\"color\":[513]}]]],[\"gov-grid.cjs\",[[4,\"gov-grid\",{\"columns\":[513],\"alignItems\":[513,\"align-items\"],\"justifyItems\":[513,\"justify-items\"],\"gap\":[513]}]]],[\"gov-grid-item.cjs\",[[4,\"gov-grid-item\",{\"column\":[1,\"col-span\"],\"columnSm\":[1,\"col-span-sm\"],\"columnMd\":[1,\"col-span-md\"],\"columnLg\":[1,\"col-span-lg\"],\"columnXl\":[1,\"col-span-xl\"],\"row\":[1,\"row-span\"],\"rowSm\":[1,\"row-span-sm\"],\"rowMd\":[1,\"row-span-md\"],\"rowLg\":[1,\"row-span-lg\"],\"rowXl\":[1,\"row-span-xl\"]}]]],[\"gov-layout.cjs\",[[4,\"gov-layout\",{\"type\":[1],\"variant\":[1],\"inverse\":[4]}]]],[\"gov-layout-column.cjs\",[[4,\"gov-layout-column\"]]],[\"gov-lifecycle.cjs\",[[0,\"gov-lifecycle\"]]],[\"gov-message.cjs\",[[4,\"gov-message\",{\"color\":[1],\"type\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-spacer.cjs\",[[0,\"gov-spacer\",{\"size\":[1],\"breakpoint\":[1]},null,{\"size\":[\"validateSize\"],\"breakpoint\":[\"validateBreakpoint\"]}]]],[\"gov-stepper.cjs\",[[4,\"gov-stepper\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-stepper-item.cjs\",[[4,\"gov-stepper-item\",{\"color\":[1],\"size\":[1],\"identifier\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-tabs-item.cjs\",[[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\"]}]]],[\"gov-tooltip.cjs\",[[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\"]}]]],[\"gov-wizard.cjs\",[[4,\"gov-wizard\",{\"size\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-flex_3.cjs\",[[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\":[513],\"justifyContent\":[513,\"justify-content\"],\"alignItems\":[513,\"align-items\"],\"wrap\":[513],\"alignContent\":[513,\"align-content\"],\"alignSelf\":[513,\"align-self\"],\"gap\":[513],\"responsive\":[513]}],[0,\"gov-icon\",{\"size\":[513],\"color\":[513],\"name\":[513],\"type\":[513],\"visible\":[32],\"error\":[32]},null,{\"size\":[\"validateSize\"],\"color\":[\"validateColor\"],\"name\":[\"loadIconPathData\"]}]]],[\"gov-form-autocomplete.cjs\",[[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\"]}]]],[\"gov-chip.cjs\",[[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\"]}]]],[\"gov-form-select.cjs\",[[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\"]}]]],[\"gov-backdrop.cjs\",[[0,\"gov-backdrop\",{\"inverse\":[4],\"disabled\":[1540],\"accessibleLabel\":[1,\"accessible-label\"],\"accessibleLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-button.cjs\",[[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\"]}]]],[\"gov-attachments_3.cjs\",[[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\"]}]]],[\"gov-form-input_2.cjs\",[[0,\"gov-skeleton\",{\"size\":[1],\"color\":[1],\"shape\":[1],\"width\":[1],\"height\":[1],\"animation\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"],\"shape\":[\"validateShape\"],\"animation\":[\"validateAnimation\"]}],[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\"]}]]]]"), options);
|
|
43
|
+
return index.bootstrapLazy(JSON.parse("[[\"gov-form-file.cjs\",[[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\"]}]]],[\"gov-form-multi-select.cjs\",[[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\"]}]]],[\"gov-dialog.cjs\",[[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\"]}]]],[\"gov-form-range.cjs\",[[4,\"gov-form-range\",{\"size\":[1],\"value\":[1537],\"identifier\":[1],\"name\":[1],\"min\":[8],\"max\":[8],\"step\":[8],\"tooltip\":[4],\"input\":[4],\"listIdentifier\":[1,\"list-identifier\"],\"required\":[516],\"success\":[516],\"invalid\":[516],\"disabled\":[516],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"value\":[\"watchValue\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]],[\"gov-pagination.cjs\",[[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\"]}]]],[\"gov-breadcrumbs.cjs\",[[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]}]]],[\"gov-infobar.cjs\",[[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\"]}]]],[\"gov-loading.cjs\",[[4,\"gov-loading\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tabs.cjs\",[[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\"]}]]],[\"gov-toast.cjs\",[[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\"]}]]],[\"gov-tooltip-content.cjs\",[[4,\"gov-tooltip-content\",{\"color\":[1],\"size\":[1],\"persist\":[4],\"isVisible\":[1028,\"is-visible\"],\"parentId\":[1,\"parent-id\"]},null,{\"isVisible\":[\"visibleContent\"]}]]],[\"gov-accordion-item.cjs\",[[4,\"gov-accordion-item\",{\"identifier\":[1],\"size\":[1025],\"disabled\":[4],\"open\":[1028],\"openState\":[32],\"toggle\":[64],\"currentState\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-blockquote.cjs\",[[4,\"gov-blockquote\",{\"type\":[513],\"cite\":[1]}]]],[\"gov-card.cjs\",[[4,\"gov-card\",{\"direction\":[1],\"collapsible\":[4],\"open\":[1540],\"href\":[513],\"target\":[1],\"accessibleTriggerLabel\":[1,\"accessible-label\"],\"accessibleTriggerLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-form-checkbox.cjs\",[[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\"]}]]],[\"gov-form-switch.cjs\",[[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\"]}]]],[\"gov-link.cjs\",[[4,\"gov-link\",{\"size\":[1],\"external\":[4],\"truncate\":[4],\"href\":[1],\"target\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tag.cjs\",[[4,\"gov-tag\",{\"iconStart\":[1,\"icon-start\"],\"iconEnd\":[1,\"icon-end\"],\"size\":[513],\"color\":[513],\"type\":[513],\"expanded\":[516]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-tile.cjs\",[[4,\"gov-tile\",{\"size\":[513],\"orientation\":[1],\"noBorder\":[4,\"no-border\"],\"href\":[513],\"target\":[1],\"getTriggerRef\":[64]}]]],[\"gov-wizard-item.cjs\",[[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\"]}]]],[\"gov-accordion.cjs\",[[4,\"gov-accordion\",{\"size\":[1],\"noBorder\":[4,\"no-border\"]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-banner.cjs\",[[4,\"gov-banner\",{\"size\":[513],\"background\":[1],\"foreground\":[1],\"textColor\":[1,\"text-color\"]},null,{\"size\":[\"validateSize\"],\"background\":[\"validateBackground\"],\"foreground\":[\"validateForeground\"],\"text-color\":[\"validateTextColor\"]}]]],[\"gov-container.cjs\",[[4,\"gov-container\"]]],[\"gov-control-group.cjs\",[[4,\"gov-control-group\",{\"color\":[1],\"noBorder\":[4,\"no-border\"],\"fitContent\":[4,\"fit-content\"]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-cookiebar.cjs\",[[4,\"gov-cookiebar\"]]],[\"gov-dropdown.cjs\",[[4,\"gov-dropdown\",{\"identifier\":[1],\"open\":[1028],\"position\":[1],\"getState\":[64],\"toggle\":[64]},null,{\"open\":[\"watchOpen\"]}]]],[\"gov-empty.cjs\",[[4,\"gov-empty\",{\"size\":[1],\"direction\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-error-code.cjs\",[[4,\"gov-error-code\"]]],[\"gov-form-checkbox-group.cjs\",[[4,\"gov-form-checkbox-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-control.cjs\",[[4,\"gov-form-control\",{\"identifier\":[1],\"invalid\":[516],\"disabled\":[516],\"success\":[516],\"fieldset\":[4],\"size\":[1]}]]],[\"gov-form-group.cjs\",[[4,\"gov-form-group\",{\"gap\":[1],\"orientation\":[1]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-label.cjs\",[[4,\"gov-form-label\",{\"identifier\":[1],\"size\":[1],\"required\":[4],\"legend\":[4]}]]],[\"gov-form-password-power.cjs\",[[4,\"gov-form-password-power\",{\"power\":[514]}]]],[\"gov-form-radio.cjs\",[[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\"]}]]],[\"gov-form-radio-group.cjs\",[[4,\"gov-form-radio-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-search.cjs\",[[4,\"gov-form-search\",{\"size\":[1],\"color\":[513]}]]],[\"gov-grid.cjs\",[[4,\"gov-grid\",{\"columns\":[513],\"alignItems\":[513,\"align-items\"],\"justifyItems\":[513,\"justify-items\"],\"gap\":[513]}]]],[\"gov-grid-item.cjs\",[[4,\"gov-grid-item\",{\"column\":[1,\"col-span\"],\"columnSm\":[1,\"col-span-sm\"],\"columnMd\":[1,\"col-span-md\"],\"columnLg\":[1,\"col-span-lg\"],\"columnXl\":[1,\"col-span-xl\"],\"row\":[1,\"row-span\"],\"rowSm\":[1,\"row-span-sm\"],\"rowMd\":[1,\"row-span-md\"],\"rowLg\":[1,\"row-span-lg\"],\"rowXl\":[1,\"row-span-xl\"]}]]],[\"gov-layout.cjs\",[[4,\"gov-layout\",{\"type\":[1],\"variant\":[1],\"inverse\":[4]}]]],[\"gov-layout-column.cjs\",[[4,\"gov-layout-column\"]]],[\"gov-lifecycle.cjs\",[[0,\"gov-lifecycle\"]]],[\"gov-message.cjs\",[[4,\"gov-message\",{\"color\":[1],\"type\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-spacer.cjs\",[[0,\"gov-spacer\",{\"size\":[1],\"breakpoint\":[1]},null,{\"size\":[\"validateSize\"],\"breakpoint\":[\"validateBreakpoint\"]}]]],[\"gov-stepper.cjs\",[[4,\"gov-stepper\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-stepper-item.cjs\",[[4,\"gov-stepper-item\",{\"color\":[1],\"size\":[1],\"identifier\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-tabs-item.cjs\",[[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\"]}]]],[\"gov-tooltip.cjs\",[[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\"]}]]],[\"gov-wizard.cjs\",[[4,\"gov-wizard\",{\"size\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-flex_3.cjs\",[[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\":[513],\"justifyContent\":[513,\"justify-content\"],\"alignItems\":[513,\"align-items\"],\"wrap\":[513],\"alignContent\":[513,\"align-content\"],\"alignSelf\":[513,\"align-self\"],\"gap\":[513],\"responsive\":[513]}],[0,\"gov-icon\",{\"size\":[513],\"color\":[513],\"name\":[513],\"type\":[513],\"visible\":[32],\"error\":[32]},null,{\"size\":[\"validateSize\"],\"color\":[\"validateColor\"],\"name\":[\"loadIconPathData\"]}]]],[\"gov-form-autocomplete.cjs\",[[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\"]}]]],[\"gov-chip.cjs\",[[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\"]}]]],[\"gov-form-select.cjs\",[[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\"]}]]],[\"gov-backdrop.cjs\",[[0,\"gov-backdrop\",{\"inverse\":[4],\"disabled\":[1540],\"accessibleLabel\":[1,\"accessible-label\"],\"accessibleLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-button.cjs\",[[4,\"gov-button\",{\"color\":[513],\"size\":[513],\"type\":[513],\"expanded\":[516],\"expandedMobile\":[516,\"expanded-mobile\"],\"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\"]}]]],[\"gov-attachments_3.cjs\",[[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\"]}]]],[\"gov-form-input_2.cjs\",[[0,\"gov-skeleton\",{\"size\":[1],\"color\":[1],\"shape\":[1],\"width\":[1],\"height\":[1],\"animation\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"],\"shape\":[\"validateShape\"],\"animation\":[\"validateAnimation\"]}],[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\"]}]]]]"), options);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
exports.setNonce = index.setNonce;
|
|
@@ -47,6 +47,7 @@ const GovButton = class {
|
|
|
47
47
|
this.size = "m";
|
|
48
48
|
this.type = undefined;
|
|
49
49
|
this.expanded = false;
|
|
50
|
+
this.expandedMobile = false;
|
|
50
51
|
this.name = undefined;
|
|
51
52
|
this.disabled = false;
|
|
52
53
|
this.nativeType = "button";
|
|
@@ -107,9 +108,9 @@ const GovButton = class {
|
|
|
107
108
|
render() {
|
|
108
109
|
const Tag = this.href ? Tags.A : Tags.BUTTON;
|
|
109
110
|
const nativeType = Tag === Tags.A ? undefined : this.nativeType;
|
|
110
|
-
return (index.h(index.Host, { key: '
|
|
111
|
-
index.h("gov-icon", { key: '
|
|
112
|
-
index.h("gov-icon", { key: '
|
|
111
|
+
return (index.h(index.Host, { key: '1f7bae74ab0d6f1b451c6ccc60cf614fb2671303', size: this.size, hydrated: this.hydrated, color: this.color, class: this.h.classes(constants.ButtonClass.root), type: this.type }, index.h(Tag, Object.assign({ key: '23e34ef9581b3dfa0c571aaef6a5b9a82dfe7c91', class: "element", ref: el => (this.triggerRef = el), onClick: this.onClickHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), disabled: this.disabled, id: this.identifier, href: this.href, target: this.target, download: this.download, hreflang: this.hreflang, rel: this.rel, name: this.name, type: nativeType, tabindex: this.disabled ? "-1" : "0" }, this.inheritedAttributes, { "aria-disabled": template.toBoolAttrIfDefined(this.disabled) }), toBool(this.loading) && !this.h.hasSlot("icon-end") &&
|
|
112
|
+
index.h("gov-icon", { key: '03f9d20b44f5424f5fe71e02d1c66fba64875c04', name: "loader", class: "gov-spin-animation", type: "components" }), this.h.hasSlot("icon-start") && index.h("slot", { key: '674ca625c6c5a9678c4a87ce370b894e704dbb1c', name: "icon-start" }), index.h("slot", { key: 'd7443ddf6d04ef50934ddb11be083eb6abf1448a' }), this.h.hasSlot("icon-end") && index.h("slot", { key: '977ea88979aae53ff5f0c8e5801e0682833e4f41', name: "icon-end" }), toBool(this.loading) && this.h.hasSlot("icon-end") &&
|
|
113
|
+
index.h("gov-icon", { key: '755b00182e3af1734483ee7bbeb63e541ad015f2', name: "loader", class: "gov-spin-animation", type: "components" }))));
|
|
113
114
|
}
|
|
114
115
|
onClickHandler(e) {
|
|
115
116
|
e.stopPropagation();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-button.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;SAAgB,MAAM,CAAC,KAAU;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9B,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;KAC1D;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QACrC,OAAO,KAAK,GAAG,CAAC,CAAA;KAChB;SAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;QACtC,OAAO,KAAK,CAAA;KACZ;SAAM;QACN,OAAO,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;KAC3B;AACF;;ACeA,IAAK,IAGJ;AAHD,WAAK,IAAI;IACR,eAAO,CAAA;IACP,yBAAiB,CAAA;AAClB,CAAC,EAHI,IAAI,KAAJ,IAAI,QAGR;MAKY,SAAS;IAMrB;;;;;QAFQ,aAAQ,GAAG,KAAK,CAAA;;oBAeiC,GAAG;;wBAQR,KAAK;;wBASL,KAAK;0BAKT,QAAQ;;;;;;;;yBAuClB,IAAI;;mCAsCC,EAAE;QA/G5C,IAAI,CAAC,CAAC,GAAGA,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAC3B;IA2FD,aAAa,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EAAE,CAAA;QACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAClB,SAAS,EAAEA,qBAAW,CAAC,IAAI;YAC3B,aAAa,EAAE,CAAC;YAChB,GAAG,EAAE,IAAI,CAAC,IAAI;SACd,CAAC,CAAA;KACF;IAEO,aAAa,CAAC,CAAa;QAClC,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,EAAEA,qBAAW,CAAC,IAAI;YAC3B,aAAa,EAAE,CAAC;YAChB,GAAG,EAAE,IAAI,CAAC,IAAI;SACd,CAAC,CAAA;KACF;;;;IAMD,MAAM,QAAQ;QACb,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;KACvB;;;;IAMD,MAAM,MAAM;QACX,OAAO,IAAI,CAAC,UAAU,CAAA;KACtB;;;;IAMD,MAAM,qBAAqB;QAC1B,IAAI,IAAI,CAAC,SAAS,EAAE;YACnBY,4BAAuB,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAEZ,qBAAW,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;SACjJ;KACD;;;;;;;;;;;;","names":["govHost","validateProp","ButtonColors","ButtonClass","ButtonType","Sizes","NativeType","AttributeObserver","ariaAttributes","inheritAriaAttributes","canValidateWcagOnRender","delay","h","Host","toBoolAttrIfDefined","validateAccessibleLabel"],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/button/gov-button.tsx"],"sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {\n\tButtonClass,\n\tButtonColors,\n\tButtonColorType,\n\tButtonSizesType,\n\tButtonTargetType,\n\tButtonType,\n\tButtonTypesType,\n\tNativeType,\n\tNativeTypesType,\n} from \"./constants\"\nimport {govHost, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {toBool} from \"../../../utils/bool.utils\"\nimport {Sizes} from \"../../../core/constants/sizes\"\nimport {validateAccessibleLabel} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {delay} from \"../../../utils/utils\"\nimport {ButtonEvent} from \"./gov-button.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\n\nenum Tags {\n\tA = \"a\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-button\",\n})\nexport class GovButton {\n\tprivate h: GovHost\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement\n\tprivate attributeObserver: AttributeObserver\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Style variation of the button\n\t */\n\t@Prop({reflect: true}) readonly color: ButtonColorType\n\t/**\n\t * Button’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: ButtonSizesType = \"m\"\n\t/**\n\t * Button's type\n\t */\n\t@Prop({reflect: true}) readonly type: ButtonTypesType\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop({reflect: true}) readonly expanded: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = \"button\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({eventName: \"gov-click\"}) govClick: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<ButtonEvent>\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(ButtonType, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"nativeType\")\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\treturn (\n\t\t\t<Host size={this.size}\n\t\t\t\t hydrated={this.hydrated}\n\t\t\t\t color={this.color}\n\t\t\t\t class={this.h.classes(ButtonClass.root)}\n\t\t\t\t type={this.type}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLButtonElement | HTMLLinkElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tdownload={this.download}\n\t\t\t\t\threflang={this.hreflang}\n\t\t\t\t\trel={this.rel}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\ttabindex={this.disabled ? \"-1\" : \"0\"}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t>\n\t\t\t\t\t{toBool(this.loading) && !this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot(\"icon-start\") && <slot name=\"icon-start\"></slot>}\n\t\t\t\t\t<slot/>\n\t\t\t\t\t{this.h.hasSlot(\"icon-end\") && <slot name=\"icon-end\"></slot>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false) {\n\t\t\tthis.govClick.emit({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getRef() {\n\t\treturn this.triggerRef\n\t}\n\n\t/**\n\t * Validate the Accessibility attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tif (this.focusable) {\n\t\t\tvalidateAccessibleLabel(this.triggerRef.getAttribute('aria-label'), this.triggerRef.getAttribute('aria-labelledby'), ButtonClass.root, this.host)\n\t\t}\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"gov-button.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;SAAgB,MAAM,CAAC,KAAU;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9B,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;KAC1D;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QACrC,OAAO,KAAK,GAAG,CAAC,CAAA;KAChB;SAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;QACtC,OAAO,KAAK,CAAA;KACZ;SAAM;QACN,OAAO,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;KAC3B;AACF;;ACeA,IAAK,IAGJ;AAHD,WAA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ariaAttributes","inheritAriaAttributes","canValidateWcagOnRender","delay","h","Host","toBoolAttrIfDefined","validateAccessibleLabel"],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/button/gov-button.tsx"],"sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {\n\tButtonClass,\n\tButtonColors,\n\tButtonColorType,\n\tButtonSizesType,\n\tButtonTargetType,\n\tButtonType,\n\tButtonTypesType,\n\tNativeType,\n\tNativeTypesType,\n} from \"./constants\"\nimport {govHost, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {toBool} from \"../../../utils/bool.utils\"\nimport {Sizes} from \"../../../core/constants/sizes\"\nimport {validateAccessibleLabel} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {delay} from \"../../../utils/utils\"\nimport {ButtonEvent} from \"./gov-button.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\n\nenum Tags {\n\tA = \"a\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-button\",\n})\nexport class GovButton {\n\tprivate h: GovHost\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement\n\tprivate attributeObserver: AttributeObserver\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Style variation of the button\n\t */\n\t@Prop({reflect: true}) readonly color: ButtonColorType\n\t/**\n\t * Button’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: ButtonSizesType = \"m\"\n\t/**\n\t * Button's type\n\t */\n\t@Prop({reflect: true}) readonly type: ButtonTypesType\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop({reflect: true}) readonly expanded: boolean = false\n\t/**\n\t * Expands the button to fill 100% of the container width only on mobile\n\t */\n\t@Prop({reflect: true, attribute: \"expanded-mobile\"}) readonly expandedMobile: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = \"button\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({eventName: \"gov-click\"}) govClick: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<ButtonEvent>\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(ButtonType, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"nativeType\")\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\treturn (\n\t\t\t<Host size={this.size}\n\t\t\t\t hydrated={this.hydrated}\n\t\t\t\t color={this.color}\n\t\t\t\t class={this.h.classes(ButtonClass.root)}\n\t\t\t\t type={this.type}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLButtonElement | HTMLLinkElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tdownload={this.download}\n\t\t\t\t\threflang={this.hreflang}\n\t\t\t\t\trel={this.rel}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\ttabindex={this.disabled ? \"-1\" : \"0\"}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t>\n\t\t\t\t\t{toBool(this.loading) && !this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot(\"icon-start\") && <slot name=\"icon-start\"></slot>}\n\t\t\t\t\t<slot/>\n\t\t\t\t\t{this.h.hasSlot(\"icon-end\") && <slot name=\"icon-end\"></slot>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"icon-end\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\" type=\"components\"></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false) {\n\t\t\tthis.govClick.emit({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getRef() {\n\t\treturn this.triggerRef\n\t}\n\n\t/**\n\t * Validate the Accessibility attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tif (this.focusable) {\n\t\t\tvalidateAccessibleLabel(this.triggerRef.getAttribute('aria-label'), this.triggerRef.getAttribute('aria-labelledby'), ButtonClass.root, this.host)\n\t\t}\n\t}\n}\n"],"version":3}
|
|
@@ -11,6 +11,11 @@ const constants = require('./constants-e1bbb053.js');
|
|
|
11
11
|
require('./gov.log-bfea3151.js');
|
|
12
12
|
|
|
13
13
|
utils.pick(sizes.Sizes, ['_S', '_M', '_L']);
|
|
14
|
+
var EmptyDirection;
|
|
15
|
+
(function (EmptyDirection) {
|
|
16
|
+
EmptyDirection["HORIZONTAL"] = "horizontal";
|
|
17
|
+
EmptyDirection["VERTICAL"] = "vertical";
|
|
18
|
+
})(EmptyDirection || (EmptyDirection = {}));
|
|
14
19
|
const EmptyClass = {
|
|
15
20
|
root: 'gov-empty',
|
|
16
21
|
content: 'gov-empty__content',
|
|
@@ -20,6 +25,7 @@ const GovEmpty = class {
|
|
|
20
25
|
constructor(hostRef) {
|
|
21
26
|
index.registerInstance(this, hostRef);
|
|
22
27
|
this.size = 'm';
|
|
28
|
+
this.direction = "vertical";
|
|
23
29
|
this.h = template.govHost(this.host);
|
|
24
30
|
}
|
|
25
31
|
validateSize(newValue) {
|
|
@@ -29,7 +35,7 @@ const GovEmpty = class {
|
|
|
29
35
|
this.validateSize(this.size);
|
|
30
36
|
}
|
|
31
37
|
render() {
|
|
32
|
-
return (index.h(index.Host, { key: '
|
|
38
|
+
return (index.h(index.Host, { key: 'e1da3889a26333688dc65efaa66664219de109f5', class: this.h.classes(EmptyClass.root), size: this.size, direction: this.direction }, this.h.hasSlot('icon') && (index.h("slot", { key: '592a4e748c922485301a5c24fb459948e854acae', name: "icon" })), index.h("div", { key: 'e8b2296af06278720ab78cbb6f4b3ef2ce8b09e7', class: EmptyClass.content }, index.h("slot", { key: 'ec87498dbf98c45455f7d5247c5938dce0acf6e6', name: "headline" }), index.h("slot", { key: '9f9a00c7bc8404a81ddaf6025d023e1ee7058834' }))));
|
|
33
39
|
}
|
|
34
40
|
get host() { return index.getElement(this); }
|
|
35
41
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-empty.entry.cjs.js","mappings":";;;;;;;;;;;;AAI0BA,UAAI,CAACC,WAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAC;
|
|
1
|
+
{"file":"gov-empty.entry.cjs.js","mappings":";;;;;;;;;;;;AAI0BA,UAAI,CAACC,WAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAC;AAGzD,IAAY,cAGX;AAHD,WAAY,cAAc;IACzB,2CAAyB,CAAA;IACzB,uCAAqB,CAAA;AACtB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAGM,MAAM,UAAU,GAAG;IACzB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,oBAAoB;CAC7B;;MCNY,QAAQ;IAGpB;;oBAQyC,GAAG;yBAIK,UAAU;QAX1D,IAAI,CAAC,CAAC,GAAGC,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAC3B;IAaD,YAAY,CAAC,QAAgB;QAC5BC,kBAAY,CAACC,wBAAc,EAAE,QAAQ,EAAEC,wBAAc,CAAC,IAAI,CAAC,CAAA;KAC3D;IAED,iBAAiB;QAChB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAC5B;IAED,MAAM;QACL,QACCC,QAACC,UAAI,qDAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,IACtF,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KACtBD,mEAAM,IAAI,EAAC,MAAM,GAAG,CACpB,EACDA,kEAAK,KAAK,EAAE,UAAU,CAAC,OAAO,IAC7BA,mEAAM,IAAI,EAAC,UAAU,GAAG,EACxBA,oEAAQ,CACH,CACA,EACP;KACD;;;;;;;;;","names":["pick","Sizes","govHost","validateProp","AccordionSizes","AccordionClass","h","Host"],"sources":["../../../packages/core/src/components/gov-empty/constants.ts","../../../packages/core/src/components/gov-empty/gov-empty.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const EmptySizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type EmptySizesType = `${ValueOf<typeof EmptySizes>}`\n\nexport enum EmptyDirection {\n\tHORIZONTAL = 'horizontal',\n\tVERTICAL = 'vertical',\n}\nexport type EmptyDirectionType = `${ValueOf<typeof EmptyDirection>}`\n\nexport const EmptyClass = {\n\troot: 'gov-empty',\n\tcontent: 'gov-empty__content',\n}\n","import {Component, Element, Host, h, Prop, Watch} from '@stencil/core'\nimport {EmptyClass, EmptyDirectionType, EmptySizesType} from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {AccordionClass, AccordionSizes} from \"../gov-accordion/constants\";\n\n@Component({\n\ttag: 'gov-empty',\n})\nexport class GovEmpty {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovEmptyElement\n\t/**\n\t * Element size.\n\t */\n\t@Prop() readonly size?: EmptySizesType = 'm'\n\t/**\n\t * Element direction\n\t */\n\t@Prop() readonly direction: EmptyDirectionType = \"vertical\"\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(AccordionSizes, newValue, AccordionClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(EmptyClass.root)} size={this.size} direction={this.direction}>\n\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t)}\n\t\t\t\t<div class={EmptyClass.content}>\n\t\t\t\t\t<slot name=\"headline\" />\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
|
|
@@ -57,7 +57,7 @@ const IconClass = {
|
|
|
57
57
|
holder: 'gov-icon__holder',
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
const version = "4.2.
|
|
60
|
+
const version = "4.2.4";
|
|
61
61
|
|
|
62
62
|
const dsVersion = () => {
|
|
63
63
|
return version;
|
|
@@ -260,7 +260,7 @@ const GovThemeSwitch = class {
|
|
|
260
260
|
};
|
|
261
261
|
this.size = "m";
|
|
262
262
|
this.displayLabel = false;
|
|
263
|
-
this.ariaLabelLight = "
|
|
263
|
+
this.ariaLabelLight = "Přepnout na tmavý mód";
|
|
264
264
|
this.ariaLabelDark = "Přepnout na světlý mód";
|
|
265
265
|
this.labelLight = "Světlý mód";
|
|
266
266
|
this.labelDark = "Tmavý mód";
|
|
@@ -308,7 +308,7 @@ const GovThemeSwitch = class {
|
|
|
308
308
|
if (this.theme === ThemeList.auto) {
|
|
309
309
|
isDark = this.isSystemPrefersColorDark;
|
|
310
310
|
}
|
|
311
|
-
return (index.h(index.Host, { key: '
|
|
311
|
+
return (index.h(index.Host, { key: '544d940df577f621ba8ee0d8f46bc6b6b41815ca', class: this.h.classes(ThemeSwitchClass.root), theme: isDark ? ThemeList.dark : ThemeList.light, size: this.size }, index.h("button", { key: '8b1165e9c7ade60a00f4b8dcc65ba50dd0ee9408', onClick: () => this.setThemeState(isDark ? ThemeList.light : ThemeList.dark), "aria-current": this.theme, "aria-label": isDark ? this.ariaLabelDark : this.ariaLabelLight }, index.h("span", { key: '3d78b019112d3b3bcf75517d85d61e2ed17cd717' }, index.h("span", { key: 'cf2293cd960946e2be0fe54bd847a0d616219887', class: ThemeSwitchClass.indicator }, ThemeList.light && index.h("gov-icon", { key: '7d1affc44645eca82d285a51a138ddf73b03ad3e', name: "sun", class: ThemeSwitchClass.iconLight, type: "components" }), ThemeList.dark && index.h("gov-icon", { key: 'df70460dc0cf1530f2ca36917f2bd203aee324ab', name: "moon", class: ThemeSwitchClass.iconDark, type: "components" })), this.displayLabel ? (index.h("span", { class: ThemeSwitchClass.label }, isDark ? this.labelDark : this.labelLight)) : null))));
|
|
312
312
|
}
|
|
313
313
|
get host() { return index.getElement(this); }
|
|
314
314
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-flex.gov-icon.gov-theme-switch.entry.cjs.js","mappings":";;;;;;;;;;;;AAMO,MAAM,SAAS,GAAG;IACxB,IAAI,EAAE,UAAU;CAChB;;MCAY,OAAO;IAGnB;;yBASyF,KAAK;;;;;;;0BAkDzC,MAAM;QA1D1D,IAAI,CAAC,CAAC,GAAGA,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAC3B;IA2DD,MAAM;QACL,QACCC,QAACC,UAAI,qDAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAC1CD,oEAAa,CACP,EACP;KACD;;;;ACzEuBE,UAAI,CAACC,WAAK,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAC;AAG/F,MAAM,UAAU,GAAGD,UAAI,CAACE,aAAM,EAAE;IACtC,SAAS;IACT,SAAS;IACT,WAAW;IACX,SAAS;IACT,OAAO;IACP,SAAS;IACT,SAAS;IACT,UAAU;IACV,OAAO;IACP,OAAO;CACP,CAAC,CAAA;AAGF,IAAK,KAIJ;AAJD,WAAK,KAAK;IACT,wBAAe,CAAA;IACf,4BAAmB,CAAA;IACnB,4BAAmB,CAAA;AACpB,CAAC,EAJI,KAAK,KAAL,KAAK,QAIT;AAGM,MAAM,SAAS,GAAG;IACxB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,kBAAkB;CAC1B;;;;AC9BM,MAAM,SAAS,GAAG;IACxB,OAAO,OAAO,CAAA;AACf,CAAC;;ACDD,MAAM,SAAS,GAA8B,EAAE,CAAA;AAC/C,MAAM,YAAY,GAAuC,E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AAY,IACjBA,kBAAM,KAAK,EAAE,gBAAgB,CAAC,KAAK,IACjC,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CACpC,IACH,IAAI,CAEH,CACC,CACH,EACP;KACD;;;;;;;;;;;;","names":["govHost","h","Host","pick","Sizes","Colors","iconsPath","isWindow","validateProp","iconsLazyLoad"],"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({reflect: true}) 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\t/**\n\t * Option to turn off responsive\n\t */\n\t@Prop({reflect: true}) readonly responsive: string = \"true\"\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 {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 if (isExternalUrl(path)) {\n return `${path}/${type}/${name}.svg?v=${dsVersion()}`\n }\n return `${path}/${type}/${name}.svg` + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({name, type}: { name: string; type: string }): Promise<string> {\n const cacheKey = type + \"-\" + name\n if (iconCache[cacheKey]) {\n return iconCache[cacheKey]\n }\n\n if (!requestCache[cacheKey]) {\n requestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n if (resp.status === 200) {\n return resp.text()\n } else {\n throw new Error(\"Gov Icon doesn't exists\")\n }\n })\n }\n const path = await requestCache[cacheKey]\n iconCache[cacheKey] = path\n return 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\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(\"name\")\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst {name, visible} = this\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\treturn\n\t\t}\n\t\tawait this.loadIcon()\n\t}\n\n\tconnectedCallback(): void {\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\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\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\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\tlabel: 'gov-theme-switch__label',\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 ? (\n\t\t\t\t\t\t\t<span class={ThemeSwitchClass.label}>\n\t\t\t\t\t\t\t\t{isDark ? this.labelDark : this.labelLight}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : null\n\t\t\t\t\t\t}\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.cjs.js","mappings":";;;;;;;;;;;;AAMO,MAAM,SAAS,GAAG;IACxB,IAAI,EAAE,UAAU;CAChB;;MCAY,OAAO;IAGnB;;yBASyF,KAAK;;;;;;;0BAkDzC,MAAM;QA1D1D,IAAI,CAAC,CAAC,GAAGA,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAC3B;IA2DD,MAAM;QACL,QACCC,QAACC,UAAI,qDAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAC1CD,oEAAa,CACP,EACP;KACD;;;;ACzEuBE,UAAI,CAACC,WAAK,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAC;AAG/F,MAAM,UAAU,GAAGD,UAAI,CAACE,aAAM,EAAE;IACtC,SAAS;IACT,SAAS;IACT,WAAW;IACX,SAAS;IACT,OAAO;IACP,SAAS;IACT,SAAS;IACT,UAAU;IACV,OAAO;IACP,OAAO;CACP,CAAC,CAAA;AAGF,IAAK,KAIJ;AAJD,WAAK,KAAK;IACT,wBAAe,CAAA;IACf,4BAAmB,CAAA;IACnB,4BAAmB,CAAA;AACpB,CAAC,EAJI,KAAK,KAAL,KAAK,QAIT;AAGM,MAAM,SAAS,GAAG;IACxB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,kBAAkB;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AAC,IAAI,IAAIA,uEAAU,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,gBAAgB,CAAC,QAAQ,EAAE,IAAI,EAAC,YAAY,GAAY,CAClG,EACN,IAAI,CAAC,YAAY,IACjBA,kBAAM,KAAK,EAAE,gBAAgB,CAAC,KAAK,IACjC,MAAM,GAAG,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CACpC,IACH,IAAI,CAEH,CACC,CACH,EACP;KACD;;;;;;;;;;;;","names":["govHost","h","Host","pick","Sizes","Colors","iconsPath","isWindow","validateProp","iconsLazyLoad"],"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({reflect: true}) 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\t/**\n\t * Option to turn off responsive\n\t */\n\t@Prop({reflect: true}) readonly responsive: string = \"true\"\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 {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 if (isExternalUrl(path)) {\n return `${path}/${type}/${name}.svg?v=${dsVersion()}`\n }\n return `${path}/${type}/${name}.svg` + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({name, type}: { name: string; type: string }): Promise<string> {\n const cacheKey = type + \"-\" + name\n if (iconCache[cacheKey]) {\n return iconCache[cacheKey]\n }\n\n if (!requestCache[cacheKey]) {\n requestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n if (resp.status === 200) {\n return resp.text()\n } else {\n throw new Error(\"Gov Icon doesn't exists\")\n }\n })\n }\n const path = await requestCache[cacheKey]\n iconCache[cacheKey] = path\n return 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\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(\"name\")\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst {name, visible} = this\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\treturn\n\t\t}\n\t\tawait this.loadIcon()\n\t}\n\n\tconnectedCallback(): void {\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\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\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\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\tlabel: 'gov-theme-switch__label',\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řepnout 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 ? (\n\t\t\t\t\t\t\t<span class={ThemeSwitchClass.label}>\n\t\t\t\t\t\t\t\t{isDark ? this.labelDark : this.labelLight}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : null\n\t\t\t\t\t\t}\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}
|
|
@@ -18,7 +18,7 @@ const GovFormLabel = class {
|
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
20
|
const Tag = this.legend ? 'legend' : 'label';
|
|
21
|
-
return (index.h(index.Host, { key: '5227d00ebe3e8923687d4e8d0f3a74bad0da82b3', class: constants.FormLabelClass.root, size: this.size }, index.h(Tag, { key: '981d363fdf7435a0b242b9610a7dd68e11d4f05e', class: constants.FormLabelClass.label, htmlFor: this.identifier, onClick: () => this.govClick.emit() }, index.h("slot", { key: 'bdf282178e200fa69d9f871354786ecbd024fa90' }), this.required ? index.h("span", { class: "gov-color--error
|
|
21
|
+
return (index.h(index.Host, { key: '5227d00ebe3e8923687d4e8d0f3a74bad0da82b3', class: constants.FormLabelClass.root, size: this.size }, index.h(Tag, { key: '981d363fdf7435a0b242b9610a7dd68e11d4f05e', class: constants.FormLabelClass.label, htmlFor: this.identifier, onClick: () => this.govClick.emit() }, index.h("slot", { key: 'bdf282178e200fa69d9f871354786ecbd024fa90' }), this.required ? index.h("span", { class: "gov-color--text-status-error" }, "\u00A0*") : null)));
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-label.entry.cjs.js","mappings":";;;;;;;;;MAMa,YAAY;;;;;oBAQsB,GAAG;wBAIZ,KAAK;sBAKP,KAAK;;IAMxC,MAAM;QACL,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;QAC5C,QACCA,QAACC,UAAI,qDAAC,KAAK,EAAEC,wBAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAChDF,QAAC,GAAG,qDAAC,KAAK,EAAEE,wBAAc,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAC9FF,oEAAa,EACZ,IAAI,CAAC,QAAQ,GAAGA,kBAAM,KAAK,EAAC,
|
|
1
|
+
{"file":"gov-form-label.entry.cjs.js","mappings":";;;;;;;;;MAMa,YAAY;;;;;oBAQsB,GAAG;wBAIZ,KAAK;sBAKP,KAAK;;IAMxC,MAAM;QACL,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;QAC5C,QACCA,QAACC,UAAI,qDAAC,KAAK,EAAEC,wBAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAChDF,QAAC,GAAG,qDAAC,KAAK,EAAEE,wBAAc,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAC9FF,oEAAa,EACZ,IAAI,CAAC,QAAQ,GAAGA,kBAAM,KAAK,EAAC,8BAA8B,cAAe,GAAG,IAAI,CAC5E,CACA,EACP;KACD;;;;;","names":["h","Host","FormLabelClass"],"sources":["../../../packages/core/src/components/gov-form/label/gov-form-label.tsx"],"sourcesContent":["import { Component, Event, EventEmitter, h, Prop, Host } from '@stencil/core'\nimport { FormLabelClass, FormLabelSizesTypes } from './constants'\n\n@Component({\n\ttag: 'gov-form-label',\n})\nexport class GovFormLabel {\n\t/**\n\t * Identifier for label.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Label's size.\n\t */\n\t@Prop() readonly size?: FormLabelSizesTypes = 'm'\n\t/**\n\t * Set whether the input is required or not.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Use label as a legend for better accessibility.\n\t * Note: Don't forget to set the fieldset attribute of the gov-form-control component\n\t */\n\t@Prop() readonly legend: boolean = false\n\t/**\n\t * Emitted when the label click.\n\t */\n\t@Event({ eventName: 'gov-click' }) govClick: EventEmitter<PointerEvent>\n\n\trender() {\n\t\tconst Tag = this.legend ? 'legend' : 'label'\n\t\treturn (\n\t\t\t<Host class={FormLabelClass.root} size={this.size}>\n\t\t\t\t<Tag class={FormLabelClass.label} htmlFor={this.identifier} onClick={() => this.govClick.emit()}>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t{this.required ? <span class=\"gov-color--text-status-error\"> *</span> : null}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
|
|
@@ -30,6 +30,7 @@ const GovInfobar = class {
|
|
|
30
30
|
constructor(hostRef) {
|
|
31
31
|
index.registerInstance(this, hostRef);
|
|
32
32
|
this.govClose = index.createEvent(this, "gov-close", 7);
|
|
33
|
+
this.hydrated = false;
|
|
33
34
|
this.color = 'primary';
|
|
34
35
|
this.type = "bold";
|
|
35
36
|
this.role = undefined;
|
|
@@ -61,9 +62,12 @@ const GovInfobar = class {
|
|
|
61
62
|
this.host.removeAttribute(attributeName);
|
|
62
63
|
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
|
|
63
64
|
}
|
|
65
|
+
connectedCallback() {
|
|
66
|
+
this.hydrated = true;
|
|
67
|
+
}
|
|
64
68
|
render() {
|
|
65
|
-
const closeButton = (index.h("gov-button", { key: '
|
|
66
|
-
return (index.h(index.Host, { key: '
|
|
69
|
+
const closeButton = (index.h("gov-button", { key: '43dfaa83a5cbf0c8ac3ffe055b9b2df56ee95252', size: "s", "aria-label": this.accessibleCloseLabel, type: "base", color: this.isBold ? this.color : "neutral", "on-gov-click": this.onCloseHandler.bind(this), class: InfobarClass.close }, index.h("gov-icon", { key: '9a04704a5679dbd328b150975cd01b13a9a8939b', name: "x-lg", type: "components" })));
|
|
70
|
+
return (index.h(index.Host, { key: '61a672fe70509238f25f353f0f97c4170f958b18', class: this.h.classes(InfobarClass.root), color: this.color, type: this.type, hydrated: this.hydrated }, index.h("section", Object.assign({ key: '2cebebdc62541a0c71578b06f677c3814b2dfd36', class: InfobarClass.section }, this.inheritedAttributes, { role: this.role }), this.h.hasSlot("icon") && (index.h("span", { key: 'de201f0008f3ec11533e0712cb95391e2694318a' }, index.h("slot", { key: 'fe5ff9dca68dad254be183b31174123f7218f8ff', name: "icon" }))), index.h("div", { key: 'd2201cd542519895dbab9329c7bef7190ad42783', class: InfobarClass.content }, this.h.hasSlot('headline') ? (index.h(Fragment.Fragment, null, index.h("div", { class: InfobarClass.headline }, index.h("slot", { name: "headline" }), index.h("gov-button", { size: "s", type: "base", color: this.isBold ? this.color : "neutral", "aria-label": this.accessibleToggleLabel, "on-gov-click": () => (this.toggleContent = !this.toggleContent) }, index.h("gov-icon", { name: this.toggleContent ? 'chevron-up' : 'chevron-down', type: "components" }))), index.h("div", { hidden: !this.toggleContent, "aria-hidden": template.toBoolAttr(this.toggleContent) }, index.h("slot", null)))) : (index.h("slot", null))), this.closable && closeButton)));
|
|
67
71
|
}
|
|
68
72
|
onCloseHandler(e) {
|
|
69
73
|
this.govClose.emit({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-infobar.entry.cjs.js","mappings":";;;;;;;;;;;;;;AAIO,MAAM,aAAa,GAAGA,UAAI,CAACC,aAAM,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAA;AAG7G,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,4BAAa,CA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aAttributes","inheritAriaAttributes","h","Host","Fragment","toBoolAttr"],"sources":["../../../packages/core/src/components/gov-infobar/constants.ts","../../../packages/core/src/components/gov-infobar/gov-infobar.tsx"],"sourcesContent":["import { Colors } from '../../core/constants/colors'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const InfobarColors = pick(Colors, ['PRIMARY', 'SECONDARY', 'NEUTRAL', 'ERROR', 'SUCCESS', 'WARNING'])\nexport type ColorType = `${ValueOf<typeof InfobarColors>}`\n\nexport enum InfobarType {\n\tBOLD = 'bold',\n\tSUBTLE = 'subtle',\n}\nexport type InfobarTypesType = `${ValueOf<typeof InfobarType>}`\n\nexport const InfobarClass = {\n\troot: 'gov-infobar',\n\tsection: 'gov-infobar__section',\n\tcontent: 'gov-infobar__content',\n\theadline: 'gov-infobar__headline',\n\tclose: 'gov-infobar__close',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch} from '@stencil/core'\nimport {govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport Fragment from '../../helpers/Fragment'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {ButtonEvent} from '../gov-button/button/gov-button.types'\nimport {ColorType, InfobarClass, InfobarColors, InfobarTypesType} from './constants'\nimport {InfobarEvent} from './gov-infobar.types'\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: 'gov-infobar',\n})\nexport class GovInfobar {\n\tprivate h: GovHost\n\tprivate attributeObserver: AttributeObserver\n\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovInfobarElement\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly color: ColorType = 'primary'\n\t/**\n\t * Infobar appearance\n\t */\n\t@Prop() readonly type?: InfobarTypesType = \"bold\"\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly role: HTMLElement['role'] = undefined\n\t/**\n\t * Aria label for the closing button. It is mandatory if the infobar is closable\n\t */\n\t@Prop({attribute: 'accessible-close-label'}) readonly accessibleCloseLabel: string = 'Zavřít informační lištu'\n\t/**\n\t * Aria label for the toggle button. It is mandatory if the infobar has headline\n\t */\n\t@Prop({attribute: 'accessible-toggle-label'}) readonly accessibleToggleLabel: string = 'Zobrazit více informací'\n\t/**\n\t * Called when the close button is clicked\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<InfobarEvent>\n\t/**\n\t * Displays the option to close the infobar\n\t */\n\t@Prop() readonly closable?: boolean = false\n\n\t@State() toggleContent = false\n\t@State() inheritedAttributes: Attributes = {}\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(InfobarColors, newValue, InfobarClass.root)\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst closeButton = (\n\t\t\t<gov-button size=\"s\"\n\t\t\t\t\t\taria-label={this.accessibleCloseLabel}\n\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\tcolor={this.isBold ? this.color : \"neutral\"}\n\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\tclass={InfobarClass.close}>\n\t\t\t\t<gov-icon name=\"x-lg\" type=\"components\"></gov-icon>\n\t\t\t</gov-button>\n\t\t)\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(InfobarClass.root)} color={this.color} type={this.type} hydrated={this.hydrated}>\n\t\t\t\t<section class={InfobarClass.section} {...this.inheritedAttributes} role={this.role}>\n\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t\t<div class={InfobarClass.content}>\n\t\t\t\t\t\t{this.h.hasSlot('headline') ? (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<div class={InfobarClass.headline}>\n\t\t\t\t\t\t\t\t\t<slot name={\"headline\"}/>\n\t\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\t\tcolor={this.isBold ? this.color : \"neutral\"}\n\t\t\t\t\t\t\t\t\t\taria-label={this.accessibleToggleLabel}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => (this.toggleContent = !this.toggleContent)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name={this.toggleContent ? 'chevron-up' : 'chevron-down'} type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div hidden={!this.toggleContent} aria-hidden={toBoolAttr(this.toggleContent)}>\n\t\t\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t{this.closable && closeButton}\n\t\t\t\t</section>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tonCloseHandler(e: CustomEvent<ButtonEvent>) {\n\t\tthis.govClose.emit({\n\t\t\tcomponent: InfobarClass.root,\n\t\t\tref: this.host,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tget isBold(): boolean {\n\t\treturn this.type === \"bold\"\n\t}\n}\n"],"version":3}
|