@gov-design-system-ce/components 4.0.8-rc17 → 4.0.8-rc19
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-form-checkbox.cjs.entry.js +5 -4
- package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-control.cjs.entry.js +1 -37
- package/dist/cjs/gov-form-control.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +7 -6
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-input.cjs.entry.js +11 -9
- package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +7 -7
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js +5 -4
- package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-select.cjs.entry.js +10 -7
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-switch.cjs.entry.js +2 -1
- package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/cjs/gov-tile.cjs.entry.js +1 -1
- package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +5 -4
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
- package/dist/collection/components/gov-form/control/gov-form-control.js +5 -64
- package/dist/collection/components/gov-form/control/gov-form-control.js.map +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.js +7 -6
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-form/input/gov-form-input.js +16 -14
- package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +7 -7
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
- package/dist/collection/components/gov-form/radio/gov-form-radio.js +5 -4
- package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.js +12 -7
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.js +2 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
- package/dist/collection/components/gov-tile/gov-tile.js +1 -1
- package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
- package/dist/collection/pages/Forms.js +12 -12
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-chip.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-checkbox.js.map +1 -1
- package/dist/components/gov-form-control.js +1 -1
- package/dist/components/gov-form-control.js.map +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-file.js.map +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-radio.js +1 -1
- package/dist/components/gov-form-radio.js.map +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-form-switch.js +1 -1
- package/dist/components/gov-form-switch.js.map +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tabs.js.map +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-tile.js.map +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-8ac22724.js → p-37b342d0.js} +2 -2
- package/dist/components/p-37b342d0.js.map +1 -0
- package/dist/components/{p-57bc98b3.js → p-410e296d.js} +2 -2
- package/dist/components/{p-fd554fb4.js → p-4f694d25.js} +2 -2
- package/dist/components/{p-3248435d.js → p-5ee68c72.js} +2 -2
- package/dist/components/p-5ee68c72.js.map +1 -0
- package/dist/components/{p-483d079f.js → p-701f03e1.js} +2 -2
- package/dist/components/{p-e35fdedd.js → p-ab0ea373.js} +2 -2
- package/dist/components/{p-44c731a0.js → p-eefec75b.js} +2 -2
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-a87d8f17.entry.js → p-2cdb5670.entry.js} +3 -2
- package/dist/core/p-2cdb5670.entry.js.map +1 -0
- package/dist/core/{p-4c83f443.entry.js → p-2e07619e.entry.js} +2 -2
- package/dist/core/{p-4c83f443.entry.js.map → p-2e07619e.entry.js.map} +1 -1
- package/dist/core/{p-14e5fd00.entry.js → p-396ae350.entry.js} +2 -2
- package/dist/core/p-396ae350.entry.js.map +1 -0
- package/dist/core/{p-065b396a.entry.js → p-3c0058a4.entry.js} +2 -2
- package/dist/core/p-3c0058a4.entry.js.map +1 -0
- package/dist/core/{p-98e89c46.entry.js → p-4b88cdf6.entry.js} +2 -2
- package/dist/core/{p-bc2ec133.entry.js → p-5f3721be.entry.js} +2 -2
- package/dist/core/p-5f3721be.entry.js.map +1 -0
- package/dist/core/p-6110119c.entry.js +2 -0
- package/dist/core/p-6110119c.entry.js.map +1 -0
- package/dist/core/{p-afb86442.entry.js → p-6be9b50d.entry.js} +3 -2
- package/dist/core/p-6be9b50d.entry.js.map +1 -0
- package/dist/core/{p-d0446df9.entry.js → p-74627eb2.entry.js} +2 -2
- package/dist/core/p-74627eb2.entry.js.map +1 -0
- package/dist/core/{p-b18be1d6.entry.js → p-753e4861.entry.js} +3 -2
- package/dist/core/p-753e4861.entry.js.map +1 -0
- package/dist/core/{p-36312bef.entry.js → p-92f752e1.entry.js} +3 -2
- package/dist/core/p-92f752e1.entry.js.map +1 -0
- package/dist/core/{p-6092fd22.entry.js → p-aa91f33f.entry.js} +2 -2
- package/dist/core/p-aa91f33f.entry.js.map +1 -0
- package/dist/core/{p-c7e8faec.entry.js → p-ab2f6b4d.entry.js} +2 -2
- package/dist/core/{p-c7e8faec.entry.js.map → p-ab2f6b4d.entry.js.map} +1 -1
- package/dist/core/{p-0d99a3d8.entry.js → p-e102ae1d.entry.js} +2 -2
- package/dist/core/p-e102ae1d.entry.js.map +1 -0
- package/dist/core/{p-dbb67e76.entry.js → p-e21b402c.entry.js} +3 -2
- package/dist/core/p-e21b402c.entry.js.map +1 -0
- package/dist/core/{p-1d67220c.entry.js → p-f9e6f776.entry.js} +3 -2
- package/dist/core/p-f9e6f776.entry.js.map +1 -0
- package/dist/core/{p-dbad9256.entry.js → p-fc3d4a73.entry.js} +3 -2
- package/dist/core/p-fc3d4a73.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-form-checkbox.entry.js +5 -4
- package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
- package/dist/esm/gov-form-control.entry.js +2 -38
- package/dist/esm/gov-form-control.entry.js.map +1 -1
- package/dist/esm/gov-form-file.entry.js +7 -6
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-form-input.entry.js +11 -9
- package/dist/esm/gov-form-input.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +7 -7
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-form-radio.entry.js +5 -4
- package/dist/esm/gov-form-radio.entry.js.map +1 -1
- package/dist/esm/gov-form-select.entry.js +10 -7
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-form-switch.entry.js +2 -1
- package/dist/esm/gov-form-switch.entry.js.map +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/esm/gov-tile.entry.js +1 -1
- package/dist/esm/gov-tile.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +54 -82
- package/dist/hydrate/index.mjs +54 -82
- package/dist/types/components/gov-form/checkbox/gov-form-checkbox.d.ts +1 -1
- package/dist/types/components/gov-form/control/gov-form-control.d.ts +3 -10
- package/dist/types/components/gov-form/file/gov-form-file.d.ts +1 -1
- package/dist/types/components/gov-form/input/gov-form-input.d.ts +1 -1
- package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +1 -1
- package/dist/types/components/gov-form/radio/gov-form-radio.d.ts +1 -1
- package/dist/types/components/gov-form/select/gov-form-select.d.ts +1 -1
- package/dist/types/components.d.ts +6 -14
- package/package.json +1 -1
- package/dist/components/p-3248435d.js.map +0 -1
- package/dist/components/p-8ac22724.js.map +0 -1
- package/dist/core/p-065b396a.entry.js.map +0 -1
- package/dist/core/p-0d99a3d8.entry.js.map +0 -1
- package/dist/core/p-14e5fd00.entry.js.map +0 -1
- package/dist/core/p-1d67220c.entry.js.map +0 -1
- package/dist/core/p-36312bef.entry.js.map +0 -1
- package/dist/core/p-4b048e19.entry.js +0 -2
- package/dist/core/p-4b048e19.entry.js.map +0 -1
- package/dist/core/p-6092fd22.entry.js.map +0 -1
- package/dist/core/p-a87d8f17.entry.js.map +0 -1
- package/dist/core/p-afb86442.entry.js.map +0 -1
- package/dist/core/p-b18be1d6.entry.js.map +0 -1
- package/dist/core/p-bc2ec133.entry.js.map +0 -1
- package/dist/core/p-d0446df9.entry.js.map +0 -1
- package/dist/core/p-dbad9256.entry.js.map +0 -1
- package/dist/core/p-dbb67e76.entry.js.map +0 -1
- /package/dist/components/{p-57bc98b3.js.map → p-410e296d.js.map} +0 -0
- /package/dist/components/{p-fd554fb4.js.map → p-4f694d25.js.map} +0 -0
- /package/dist/components/{p-483d079f.js.map → p-701f03e1.js.map} +0 -0
- /package/dist/components/{p-e35fdedd.js.map → p-ab0ea373.js.map} +0 -0
- /package/dist/components/{p-44c731a0.js.map → p-eefec75b.js.map} +0 -0
- /package/dist/core/{p-98e89c46.entry.js.map → p-4b88cdf6.entry.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\":[4],\"resetAfterPick\":[4,\"reset-after-pick\"],\"ignoreFileDuplicationCheck\":[4,\"ignore-file-duplication-check\"],\"displayAttachments\":[4,\"display-attachments\"],\"name\":[1],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"identifier\":[1],\"invalid\":[4],\"errorSize\":[1,\"error-size\"],\"errorAccept\":[1,\"error-accept\"],\"attachmentsLabel\":[1,\"attachments-label\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagRemoveLabel\":[1,\"wcag-remove-label\"],\"wcagAttachmentsLabel\":[1,\"wcag-attachments-label\"],\"files\":[32],\"getRef\":[64],\"getAreaRef\":[64],\"reset\":[64],\"validateWcag\":[64]},null,{\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"]}]]],[\"gov-form-multi-select.cjs\",[[4,\"gov-form-multi-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"placeholder\":[1],\"variant\":[1],\"size\":[1],\"name\":[1],\"hideSelectedList\":[4,\"hide-selected-list\"],\"required\":[4],\"disabled\":[4],\"invalid\":[4],\"success\":[4],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"valueState\":[32],\"selectedOptionsState\":[32],\"optionsState\":[32],\"setFocus\":[64],\"setValue\":[64],\"getRef\":[64],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\",\"watchDisabled\"],\"options\":[\"watchOptions\"],\"value\":[\"watchValue\"],\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"],\"success\":[\"watchDisabled\"]}]]],[\"gov-modal.cjs\",[[4,\"gov-modal\",{\"open\":[1028],\"blockClose\":[4,\"block-close\"],\"blockBackdropClose\":[4,\"block-backdrop-close\"],\"blockButtonClose\":[4,\"block-button-close\"],\"label\":[1],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagCloseLabelledBy\":[1,\"wcag-close-labelled-by\"],\"show\":[64],\"hide\":[64],\"validateWcag\":[64]},null,{\"labelTag\":[\"validateLabelTag\"],\"open\":[\"watchOpen\"]}]]],[\"gov-pagination.cjs\",[[0,\"gov-pagination\",{\"type\":[1],\"current\":[2],\"total\":[2],\"inverse\":[4],\"selectIdentifier\":[1,\"select-identifier\"],\"size\":[1],\"variant\":[1],\"pageSize\":[2,\"page-size\"],\"maxPages\":[2,\"max-pages\"],\"link\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagSelectLabel\":[1,\"wcag-select-label\"],\"wcagPageLabel\":[1,\"wcag-page-label\"],\"labelPrev\":[1,\"label-prev\"],\"labelStart\":[1,\"label-start\"],\"labelNext\":[1,\"label-next\"],\"labelEnd\":[1,\"label-end\"],\"pagination\":[32],\"validateWcag\":[64]},null,{\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"variant\":[\"validateVariant\"],\"current\":[\"recalculate\"],\"total\":[\"recalculate\"],\"pageSize\":[\"recalculate\"],\"maxPages\":[\"recalculate\"]}]]],[\"gov-prompt.cjs\",[[4,\"gov-prompt\",{\"open\":[1028],\"label\":[1],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagCloseLabelledBy\":[1,\"wcag-close-labelled-by\"],\"show\":[64],\"hide\":[64],\"validateWcag\":[64]},null,{\"labelTag\":[\"validateLabelTag\"],\"open\":[\"watchOpen\"]}]]],[\"gov-tabs.cjs\",[[4,\"gov-tabs\",{\"type\":[1],\"variant\":[1],\"orientation\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagSelectLabel\":[1,\"wcag-select-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"controllers\":[32],\"focusIndex\":[32],\"compactControls\":[32],\"refresh\":[64],\"currentTab\":[64],\"setActiveTab\":[64],\"rerender\":[64],\"validateWcag\":[64]},null,{\"type\":[\"validateType\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-breadcrumbs.cjs\",[[4,\"gov-breadcrumbs\",{\"collapsible\":[4],\"isExpanded\":[4,\"is-expanded\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labeled-by\"],\"wcagToggleLabel\":[1,\"wcag-toggle-label\"],\"collapsed\":[32],\"toggleOption\":[32],\"validateWcag\":[64]}]]],[\"gov-infobar.cjs\",[[4,\"gov-infobar\",{\"headline\":[1],\"variant\":[1],\"role\":[1],\"inverse\":[4],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagToggleLabel\":[1,\"wcag-toggle-label\"],\"closable\":[4],\"toggleContent\":[32],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"]}]]],[\"gov-loading.cjs\",[[4,\"gov-loading\"]]],[\"gov-side-nav-item.cjs\",[[4,\"gov-side-nav-item\",{\"inverse\":[4],\"compact\":[4],\"identifier\":[1],\"count\":[4],\"label\":[1],\"disabled\":[4],\"href\":[1],\"isExpanded\":[4,\"is-expanded\"],\"isExpandedState\":[32],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]},null,{\"label\":[\"validateLabel\"]}]]],[\"gov-toast.cjs\",[[4,\"gov-toast\",{\"variant\":[1],\"gravity\":[1],\"position\":[1],\"type\":[1],\"time\":[2],\"closeLabel\":[1,\"close-label\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"destroy\":[64]},null,{\"variant\":[\"validateVariant\"]}]]],[\"gov-tooltip-content.cjs\",[[4,\"gov-tooltip-content\",{\"variant\":[1],\"size\":[1],\"persist\":[4],\"isVisible\":[1028,\"is-visible\"],\"parentId\":[1,\"parent-id\"]},null,{\"isVisible\":[\"visibleContent\"]}]]],[\"gov-accordion-item.cjs\",[[4,\"gov-accordion-item\",{\"variant\":[1],\"identifier\":[1],\"size\":[1],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"isExpandedState\":[32],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]},null,{\"size\":[\"validateSize\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-card.cjs\",[[4,\"gov-card\",{\"promotion\":[4],\"label\":[1],\"collapsible\":[4],\"expanded\":[4],\"headlineTag\":[1,\"headline-tag\"],\"wcagTriggerLabel\":[1,\"wcag-trigger-label\"],\"wcagTriggerLabelledBy\":[1,\"wcag-trigger-labelled-by\"],\"isExpanded\":[32],\"open\":[64],\"close\":[64],\"validateWcag\":[64]},null,{\"headlineTag\":[\"validateHeadlineTag\"]}]]],[\"gov-form-checkbox.cjs\",[[4,\"gov-form-checkbox\",{\"value\":[1],\"checked\":[1540],\"required\":[4],\"disabled\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"noLabel\":[4,\"no-label\"],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\",\"watchDisabled\"],\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"]}]]],[\"gov-tag.cjs\",[[4,\"gov-tag\",{\"inverse\":[4],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"size\":[513],\"variant\":[513]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\"]}]]],[\"gov-wizard-item.cjs\",[[4,\"gov-wizard-item\",{\"variant\":[1],\"size\":[1],\"identifier\":[1],\"collapsible\":[4],\"annotation\":[1],\"label\":[1],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"labelTag\":[1,\"label-tag\"],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]},null,{\"label\":[\"validateLabel\"],\"labelTag\":[\"validateTriggerTag\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-accordion.cjs\",[[4,\"gov-accordion\",{\"size\":[1],\"variant\":[1],\"noBorder\":[4,\"no-border\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-container.cjs\",[[4,\"gov-container\",{\"slottedChildren\":[64]}]]],[\"gov-control-group.cjs\",[[4,\"gov-control-group\",{\"variant\":[1],\"noBorder\":[4,\"no-border\"]},null,{\"variant\":[\"validateVariant\"]}]]],[\"gov-cookiebar.cjs\",[[4,\"gov-cookiebar\"]]],[\"gov-dropdown.cjs\",[[4,\"gov-dropdown\",{\"identifier\":[1],\"open\":[1028],\"position\":[1],\"getState\":[64],\"setOpen\":[64]}]]],[\"gov-empty.cjs\",[[4,\"gov-empty\"]]],[\"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\",{\"gap\":[1],\"identifier\":[1],\"invalid\":[4],\"disabled\":[4],\"success\":[4],\"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\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\",\"watchDisabled\"],\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"]}]]],[\"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\",{\"variant\":[513]}]]],[\"gov-form-switch.cjs\",[[4,\"gov-form-switch\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\",\"watchDisabled\"],\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"]}]]],[\"gov-grid.cjs\",[[4,\"gov-grid\",{\"alignX\":[1,\"align-x\"],\"alignY\":[1,\"align-y\"]}]]],[\"gov-grid-item.cjs\",[[4,\"gov-grid-item\",{\"size\":[1],\"sizeSm\":[1,\"size-sm\"],\"sizeMd\":[1,\"size-md\"],\"sizeLg\":[1,\"size-lg\"],\"sizeXl\":[1,\"size-xl\"]}]]],[\"gov-layout.cjs\",[[4,\"gov-layout\",{\"type\":[1],\"variant\":[1],\"inverse\":[4]}]]],[\"gov-layout-column.cjs\",[[4,\"gov-layout-column\"]]],[\"gov-message.cjs\",[[4,\"gov-message\",{\"variant\":[1]},null,{\"variant\":[\"validateVariant\"]}]]],[\"gov-nav.cjs\",[[4,\"gov-nav\",{\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-nav-item.cjs\",[[4,\"gov-nav-item\",{\"href\":[1],\"isExpandedState\":[32]},null,{\"href\":[\"validateHref\"]}]]],[\"gov-side-nav.cjs\",[[4,\"gov-side-nav\",{\"inverse\":[4],\"compact\":[4],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-skeleton.cjs\",[[0,\"gov-skeleton\",{\"variant\":[1],\"count\":[2],\"shape\":[1],\"width\":[1],\"height\":[1],\"animation\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"],\"shape\":[\"validateShape\"],\"animation\":[\"validateAnimation\"]}]]],[\"gov-spacer.cjs\",[[0,\"gov-spacer\",{\"size\":[1],\"breakpoint\":[1]},null,{\"size\":[\"validateSize\"],\"breakpoint\":[\"validateBreakpoint\"]}]]],[\"gov-statsbar.cjs\",[[4,\"gov-statsbar\",{\"iconPosition\":[1,\"icon-position\"],\"variant\":[1]},null,{\"iconPosition\":[\"validateIconPosition\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-statsbar-item.cjs\",[[4,\"gov-statsbar-item\",{\"iconPosition\":[1,\"icon-position\"]},null,{\"iconPosition\":[\"validateIconPosition\"]}]]],[\"gov-stepper.cjs\",[[4,\"gov-stepper\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-stepper-item.cjs\",[[4,\"gov-stepper-item\",{\"variant\":[1],\"size\":[1],\"identifier\":[1],\"label\":[1],\"annotation\":[1],\"triggerTag\":[1,\"trigger-tag\"],\"isExpandedState\":[32],\"currentState\":[64]},null,{\"label\":[\"validateLabel\"],\"triggerTag\":[\"validateTriggerTag\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-tabs-item.cjs\",[[4,\"gov-tabs-item\",{\"identifier\":[1],\"triggerIdentifier\":[1,\"trigger-identifier\"],\"label\":[513],\"disabled\":[516],\"default\":[4],\"isActive\":[32],\"getIdentifier\":[64],\"getTriggerIdentifier\":[64],\"getDisableState\":[64],\"setActiveStatus\":[64]},null,{\"label\":[\"rerenderParent\"],\"disabled\":[\"rerenderParent\"]}]]],[\"gov-tile.cjs\",[[4,\"gov-tile\",{\"href\":[513],\"target\":[1],\"getTriggerRef\":[64]}]]],[\"gov-tiles.cjs\",[[4,\"gov-tiles\",{\"columns\":[2],\"noBorder\":[4,\"no-border\"]}]]],[\"gov-tooltip.cjs\",[[4,\"gov-tooltip\",{\"variant\":[1],\"size\":[1],\"position\":[1025],\"message\":[1],\"identifier\":[1],\"icon\":[516],\"persist\":[32],\"show\":[64],\"hide\":[64]},null,{\"variant\":[\"validateVariant\"],\"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-icon.cjs\",[[0,\"gov-icon\",{\"name\":[1],\"type\":[1],\"iconData\":[32],\"visible\":[32],\"error\":[32]},null,{\"name\":[\"loadIconPathData\"]}]]],[\"gov-form-input.cjs\",[[4,\"gov-form-input\",{\"value\":[1537],\"identifier\":[1],\"variant\":[1],\"success\":[4],\"size\":[1],\"name\":[1],\"multiline\":[4],\"rows\":[2],\"cols\":[2],\"required\":[4],\"disabled\":[4],\"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\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"wcagAutocomplete\":[1,\"wcag-autocomplete\"],\"wcagExpanded\":[4,\"wcag-expanded\"],\"focused\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\",\"watchDisabled\"],\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"],\"type\":[\"watchDisabled\"]}]]],[\"gov-form-autocomplete.cjs\",[[4,\"gov-form-autocomplete\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"variant\":[1],\"success\":[4],\"size\":[1],\"nameKey\":[1,\"name-key\"],\"name\":[1],\"required\":[4],\"disabled\":[4],\"placeholder\":[1],\"readonly\":[4],\"invalid\":[4],\"minlength\":[2],\"maxlength\":[2],\"throttleTime\":[2,\"throttle-time\"],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"processing\":[32],\"arrowCounter\":[32],\"list\":[32],\"setFocus\":[64],\"setBlur\":[64],\"setOptions\":[64],\"clearValue\":[64],\"setProcessing\":[64],\"setSearchCallback\":[64],\"setTemplateResolver\":[64]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\"],\"options\":[\"watchOptions\"]}]]],[\"gov-chip.cjs\",[[4,\"gov-chip\",{\"inverse\":[4],\"disabled\":[4],\"href\":[1],\"target\":[1],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"size\":[1],\"tag\":[1],\"variant\":[1],\"focusable\":[4],\"identifier\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagSelected\":[4,\"wcag-selected\"],\"getTriggerRef\":[64],\"getTriggerIdentifier\":[64],\"setFocus\":[64]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\"]}]]],[\"gov-form-select.cjs\",[[4,\"gov-form-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"variant\":[1],\"size\":[1],\"name\":[1],\"required\":[4],\"success\":[4],\"disabled\":[4],\"invalid\":[4],\"wcagActiveDescendant\":[1,\"wcag-active-descendant\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"optionsState\":[32],\"setFocus\":[64],\"getRef\":[64],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\",\"watchDisabled\"],\"options\":[\"watchOptions\"],\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"],\"value\":[\"watchValue\"]}]]],[\"gov-attachments_3.cjs\",[[4,\"gov-attachments-item\",{\"wcagRemoveLabel\":[1,\"wcag-remove-label\"],\"wcagRemoveLabelledBy\":[1,\"wcag-remove-labelled-by\"],\"validateWcag\":[64]}],[4,\"gov-attachments\",{\"label\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]}],[4,\"gov-form-message\",{\"variant\":[1],\"identifier\":[64]},null,{\"variant\":[\"validateVariant\"]}]]],[\"gov-backdrop.cjs\",[[0,\"gov-backdrop\",{\"inverse\":[4],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-button.cjs\",[[4,\"gov-button\",{\"variant\":[513],\"size\":[513],\"type\":[513],\"expanded\":[516],\"inverse\":[516],\"name\":[1],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"disabled\":[516],\"nativeType\":[1,\"native-type\"],\"href\":[1],\"target\":[1],\"download\":[4],\"hreflang\":[1],\"referrerpolicy\":[1],\"rel\":[1],\"loading\":[1],\"focusable\":[4],\"identifier\":[1],\"wcagActiveDescendant\":[1,\"wcag-active-descendant\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagDescription\":[1,\"wcag-description\"],\"wcagDetails\":[1,\"wcag-details\"],\"wcagExpanded\":[4,\"wcag-expanded\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"wcagHasPopup\":[1,\"wcag-has-popup\"],\"wcagPressed\":[4,\"wcag-pressed\"],\"wcagCurrent\":[1,\"wcag-current\"],\"setFocus\":[64],\"getTriggerRef\":[64],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"],\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"nativeType\":[\"validateNativeType\"]}]]]]"), options);
|
|
43
|
+
return index.bootstrapLazy(JSON.parse("[[\"gov-form-file.cjs\",[[4,\"gov-form-file\",{\"expanded\":[4],\"required\":[4],\"disabled\":[4],\"resetAfterPick\":[4,\"reset-after-pick\"],\"ignoreFileDuplicationCheck\":[4,\"ignore-file-duplication-check\"],\"displayAttachments\":[4,\"display-attachments\"],\"name\":[1],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"identifier\":[1],\"invalid\":[4],\"errorSize\":[1,\"error-size\"],\"errorAccept\":[1,\"error-accept\"],\"attachmentsLabel\":[1,\"attachments-label\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagRemoveLabel\":[1,\"wcag-remove-label\"],\"wcagAttachmentsLabel\":[1,\"wcag-attachments-label\"],\"files\":[32],\"getRef\":[64],\"getAreaRef\":[64],\"reset\":[64],\"validateWcag\":[64]},null,{\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-multi-select.cjs\",[[4,\"gov-form-multi-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"placeholder\":[1],\"variant\":[1],\"size\":[1],\"name\":[1],\"hideSelectedList\":[4,\"hide-selected-list\"],\"required\":[4],\"disabled\":[4],\"invalid\":[4],\"success\":[4],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"valueState\":[32],\"selectedOptionsState\":[32],\"optionsState\":[32],\"setFocus\":[64],\"setValue\":[64],\"getRef\":[64],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\",\"watchControlAttrs\"],\"options\":[\"watchOptions\"],\"value\":[\"watchValue\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]],[\"gov-modal.cjs\",[[4,\"gov-modal\",{\"open\":[1028],\"blockClose\":[4,\"block-close\"],\"blockBackdropClose\":[4,\"block-backdrop-close\"],\"blockButtonClose\":[4,\"block-button-close\"],\"label\":[1],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagCloseLabelledBy\":[1,\"wcag-close-labelled-by\"],\"show\":[64],\"hide\":[64],\"validateWcag\":[64]},null,{\"labelTag\":[\"validateLabelTag\"],\"open\":[\"watchOpen\"]}]]],[\"gov-pagination.cjs\",[[0,\"gov-pagination\",{\"type\":[1],\"current\":[2],\"total\":[2],\"inverse\":[4],\"selectIdentifier\":[1,\"select-identifier\"],\"size\":[1],\"variant\":[1],\"pageSize\":[2,\"page-size\"],\"maxPages\":[2,\"max-pages\"],\"link\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagSelectLabel\":[1,\"wcag-select-label\"],\"wcagPageLabel\":[1,\"wcag-page-label\"],\"labelPrev\":[1,\"label-prev\"],\"labelStart\":[1,\"label-start\"],\"labelNext\":[1,\"label-next\"],\"labelEnd\":[1,\"label-end\"],\"pagination\":[32],\"validateWcag\":[64]},null,{\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"variant\":[\"validateVariant\"],\"current\":[\"recalculate\"],\"total\":[\"recalculate\"],\"pageSize\":[\"recalculate\"],\"maxPages\":[\"recalculate\"]}]]],[\"gov-prompt.cjs\",[[4,\"gov-prompt\",{\"open\":[1028],\"label\":[1],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagCloseLabelledBy\":[1,\"wcag-close-labelled-by\"],\"show\":[64],\"hide\":[64],\"validateWcag\":[64]},null,{\"labelTag\":[\"validateLabelTag\"],\"open\":[\"watchOpen\"]}]]],[\"gov-tabs.cjs\",[[4,\"gov-tabs\",{\"type\":[1],\"variant\":[1],\"orientation\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagSelectLabel\":[1,\"wcag-select-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"controllers\":[32],\"focusIndex\":[32],\"compactControls\":[32],\"refresh\":[64],\"currentTab\":[64],\"setActiveTab\":[64],\"rerender\":[64],\"validateWcag\":[64]},null,{\"type\":[\"validateType\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-breadcrumbs.cjs\",[[4,\"gov-breadcrumbs\",{\"collapsible\":[4],\"isExpanded\":[4,\"is-expanded\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labeled-by\"],\"wcagToggleLabel\":[1,\"wcag-toggle-label\"],\"collapsed\":[32],\"toggleOption\":[32],\"validateWcag\":[64]}]]],[\"gov-infobar.cjs\",[[4,\"gov-infobar\",{\"headline\":[1],\"variant\":[1],\"role\":[1],\"inverse\":[4],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagToggleLabel\":[1,\"wcag-toggle-label\"],\"closable\":[4],\"toggleContent\":[32],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"]}]]],[\"gov-loading.cjs\",[[4,\"gov-loading\"]]],[\"gov-side-nav-item.cjs\",[[4,\"gov-side-nav-item\",{\"inverse\":[4],\"compact\":[4],\"identifier\":[1],\"count\":[4],\"label\":[1],\"disabled\":[4],\"href\":[1],\"isExpanded\":[4,\"is-expanded\"],\"isExpandedState\":[32],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]},null,{\"label\":[\"validateLabel\"]}]]],[\"gov-toast.cjs\",[[4,\"gov-toast\",{\"variant\":[1],\"gravity\":[1],\"position\":[1],\"type\":[1],\"time\":[2],\"closeLabel\":[1,\"close-label\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"destroy\":[64]},null,{\"variant\":[\"validateVariant\"]}]]],[\"gov-tooltip-content.cjs\",[[4,\"gov-tooltip-content\",{\"variant\":[1],\"size\":[1],\"persist\":[4],\"isVisible\":[1028,\"is-visible\"],\"parentId\":[1,\"parent-id\"]},null,{\"isVisible\":[\"visibleContent\"]}]]],[\"gov-accordion-item.cjs\",[[4,\"gov-accordion-item\",{\"variant\":[1],\"identifier\":[1],\"size\":[1],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"isExpandedState\":[32],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]},null,{\"size\":[\"validateSize\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-card.cjs\",[[4,\"gov-card\",{\"promotion\":[4],\"label\":[1],\"collapsible\":[4],\"expanded\":[4],\"headlineTag\":[1,\"headline-tag\"],\"wcagTriggerLabel\":[1,\"wcag-trigger-label\"],\"wcagTriggerLabelledBy\":[1,\"wcag-trigger-labelled-by\"],\"isExpanded\":[32],\"open\":[64],\"close\":[64],\"validateWcag\":[64]},null,{\"headlineTag\":[\"validateHeadlineTag\"]}]]],[\"gov-form-checkbox.cjs\",[[4,\"gov-form-checkbox\",{\"value\":[1],\"checked\":[1540],\"required\":[4],\"disabled\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"noLabel\":[4,\"no-label\"],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-tag.cjs\",[[4,\"gov-tag\",{\"inverse\":[4],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"size\":[513],\"variant\":[513]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\"]}]]],[\"gov-tile.cjs\",[[4,\"gov-tile\",{\"href\":[513],\"target\":[1],\"getTriggerRef\":[64]}]]],[\"gov-wizard-item.cjs\",[[4,\"gov-wizard-item\",{\"variant\":[1],\"size\":[1],\"identifier\":[1],\"collapsible\":[4],\"annotation\":[1],\"label\":[1],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"labelTag\":[1,\"label-tag\"],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]},null,{\"label\":[\"validateLabel\"],\"labelTag\":[\"validateTriggerTag\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-accordion.cjs\",[[4,\"gov-accordion\",{\"size\":[1],\"variant\":[1],\"noBorder\":[4,\"no-border\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-container.cjs\",[[4,\"gov-container\",{\"slottedChildren\":[64]}]]],[\"gov-control-group.cjs\",[[4,\"gov-control-group\",{\"variant\":[1],\"noBorder\":[4,\"no-border\"]},null,{\"variant\":[\"validateVariant\"]}]]],[\"gov-cookiebar.cjs\",[[4,\"gov-cookiebar\"]]],[\"gov-dropdown.cjs\",[[4,\"gov-dropdown\",{\"identifier\":[1],\"open\":[1028],\"position\":[1],\"getState\":[64],\"setOpen\":[64]}]]],[\"gov-empty.cjs\",[[4,\"gov-empty\"]]],[\"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\":[4],\"disabled\":[4],\"success\":[4],\"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\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[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\",{\"variant\":[513]}]]],[\"gov-form-switch.cjs\",[[4,\"gov-form-switch\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\",\"watchDisabled\"],\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"]}]]],[\"gov-grid.cjs\",[[4,\"gov-grid\",{\"alignX\":[1,\"align-x\"],\"alignY\":[1,\"align-y\"]}]]],[\"gov-grid-item.cjs\",[[4,\"gov-grid-item\",{\"size\":[1],\"sizeSm\":[1,\"size-sm\"],\"sizeMd\":[1,\"size-md\"],\"sizeLg\":[1,\"size-lg\"],\"sizeXl\":[1,\"size-xl\"]}]]],[\"gov-layout.cjs\",[[4,\"gov-layout\",{\"type\":[1],\"variant\":[1],\"inverse\":[4]}]]],[\"gov-layout-column.cjs\",[[4,\"gov-layout-column\"]]],[\"gov-message.cjs\",[[4,\"gov-message\",{\"variant\":[1]},null,{\"variant\":[\"validateVariant\"]}]]],[\"gov-nav.cjs\",[[4,\"gov-nav\",{\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-nav-item.cjs\",[[4,\"gov-nav-item\",{\"href\":[1],\"isExpandedState\":[32]},null,{\"href\":[\"validateHref\"]}]]],[\"gov-side-nav.cjs\",[[4,\"gov-side-nav\",{\"inverse\":[4],\"compact\":[4],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-skeleton.cjs\",[[0,\"gov-skeleton\",{\"variant\":[1],\"count\":[2],\"shape\":[1],\"width\":[1],\"height\":[1],\"animation\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"],\"shape\":[\"validateShape\"],\"animation\":[\"validateAnimation\"]}]]],[\"gov-spacer.cjs\",[[0,\"gov-spacer\",{\"size\":[1],\"breakpoint\":[1]},null,{\"size\":[\"validateSize\"],\"breakpoint\":[\"validateBreakpoint\"]}]]],[\"gov-statsbar.cjs\",[[4,\"gov-statsbar\",{\"iconPosition\":[1,\"icon-position\"],\"variant\":[1]},null,{\"iconPosition\":[\"validateIconPosition\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-statsbar-item.cjs\",[[4,\"gov-statsbar-item\",{\"iconPosition\":[1,\"icon-position\"]},null,{\"iconPosition\":[\"validateIconPosition\"]}]]],[\"gov-stepper.cjs\",[[4,\"gov-stepper\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-stepper-item.cjs\",[[4,\"gov-stepper-item\",{\"variant\":[1],\"size\":[1],\"identifier\":[1],\"label\":[1],\"annotation\":[1],\"triggerTag\":[1,\"trigger-tag\"],\"isExpandedState\":[32],\"currentState\":[64]},null,{\"label\":[\"validateLabel\"],\"triggerTag\":[\"validateTriggerTag\"],\"variant\":[\"validateVariant\"]}]]],[\"gov-tabs-item.cjs\",[[4,\"gov-tabs-item\",{\"identifier\":[1],\"triggerIdentifier\":[1,\"trigger-identifier\"],\"label\":[513],\"disabled\":[516],\"default\":[4],\"isActive\":[32],\"getIdentifier\":[64],\"getTriggerIdentifier\":[64],\"getDisableState\":[64],\"setActiveStatus\":[64]},null,{\"label\":[\"rerenderParent\"],\"disabled\":[\"rerenderParent\"]}]]],[\"gov-tiles.cjs\",[[4,\"gov-tiles\",{\"columns\":[2],\"noBorder\":[4,\"no-border\"]}]]],[\"gov-tooltip.cjs\",[[4,\"gov-tooltip\",{\"variant\":[1],\"size\":[1],\"position\":[1025],\"message\":[1],\"identifier\":[1],\"icon\":[516],\"persist\":[32],\"show\":[64],\"hide\":[64]},null,{\"variant\":[\"validateVariant\"],\"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-icon.cjs\",[[0,\"gov-icon\",{\"name\":[1],\"type\":[1],\"iconData\":[32],\"visible\":[32],\"error\":[32]},null,{\"name\":[\"loadIconPathData\"]}]]],[\"gov-form-input.cjs\",[[4,\"gov-form-input\",{\"value\":[1537],\"identifier\":[1],\"variant\":[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],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"wcagAutocomplete\":[1,\"wcag-autocomplete\"],\"wcagExpanded\":[4,\"wcag-expanded\"],\"focused\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]],[\"gov-form-autocomplete.cjs\",[[4,\"gov-form-autocomplete\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"variant\":[1],\"success\":[4],\"size\":[1],\"nameKey\":[1,\"name-key\"],\"name\":[1],\"required\":[4],\"disabled\":[4],\"placeholder\":[1],\"readonly\":[4],\"invalid\":[4],\"minlength\":[2],\"maxlength\":[2],\"throttleTime\":[2,\"throttle-time\"],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"processing\":[32],\"arrowCounter\":[32],\"list\":[32],\"setFocus\":[64],\"setBlur\":[64],\"setOptions\":[64],\"clearValue\":[64],\"setProcessing\":[64],\"setSearchCallback\":[64],\"setTemplateResolver\":[64]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\"],\"options\":[\"watchOptions\"]}]]],[\"gov-chip.cjs\",[[4,\"gov-chip\",{\"inverse\":[4],\"disabled\":[4],\"href\":[1],\"target\":[1],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"size\":[1],\"tag\":[1],\"variant\":[1],\"focusable\":[4],\"identifier\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagSelected\":[4,\"wcag-selected\"],\"getTriggerRef\":[64],\"getTriggerIdentifier\":[64],\"setFocus\":[64]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\"]}]]],[\"gov-form-select.cjs\",[[4,\"gov-form-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"variant\":[1],\"size\":[1],\"name\":[1],\"required\":[4],\"success\":[4],\"disabled\":[4],\"invalid\":[4],\"wcagActiveDescendant\":[1,\"wcag-active-descendant\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"optionsState\":[32],\"setFocus\":[64],\"getRef\":[64],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"],\"size\":[\"validateSize\",\"watchControlAttrs\"],\"options\":[\"watchOptions\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"],\"value\":[\"watchValue\"]}]]],[\"gov-attachments_3.cjs\",[[4,\"gov-attachments-item\",{\"wcagRemoveLabel\":[1,\"wcag-remove-label\"],\"wcagRemoveLabelledBy\":[1,\"wcag-remove-labelled-by\"],\"validateWcag\":[64]}],[4,\"gov-attachments\",{\"label\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]}],[4,\"gov-form-message\",{\"variant\":[1],\"identifier\":[64]},null,{\"variant\":[\"validateVariant\"]}]]],[\"gov-backdrop.cjs\",[[0,\"gov-backdrop\",{\"inverse\":[4],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-button.cjs\",[[4,\"gov-button\",{\"variant\":[513],\"size\":[513],\"type\":[513],\"expanded\":[516],\"inverse\":[516],\"name\":[1],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"disabled\":[516],\"nativeType\":[1,\"native-type\"],\"href\":[1],\"target\":[1],\"download\":[4],\"hreflang\":[1],\"referrerpolicy\":[1],\"rel\":[1],\"loading\":[1],\"focusable\":[4],\"identifier\":[1],\"wcagActiveDescendant\":[1,\"wcag-active-descendant\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagDescription\":[1,\"wcag-description\"],\"wcagDetails\":[1,\"wcag-details\"],\"wcagExpanded\":[4,\"wcag-expanded\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"wcagHasPopup\":[1,\"wcag-has-popup\"],\"wcagPressed\":[4,\"wcag-pressed\"],\"wcagCurrent\":[1,\"wcag-current\"],\"setFocus\":[64],\"getTriggerRef\":[64],\"validateWcag\":[64]},null,{\"variant\":[\"validateVariant\"],\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"nativeType\":[\"validateNativeType\"]}]]]]"), options);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
exports.setNonce = index.setNonce;
|
|
@@ -46,11 +46,12 @@ const GovFormCheckbox = class {
|
|
|
46
46
|
validateSize(newValue) {
|
|
47
47
|
props.validateProp(form.FormCheckboxSizes, newValue, form.FormCheckboxClass.root);
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
watchControlAttrs() {
|
|
50
50
|
this.passControlAttrs();
|
|
51
51
|
}
|
|
52
52
|
passControlAttrs() {
|
|
53
53
|
this.f.passAttrToControl("size", this.size);
|
|
54
|
+
this.f.passAttrToControl("disabled", template.toBoolAttr(this.disabled));
|
|
54
55
|
this.f.passAttrToControl("invalid", template.toBoolAttr(this.invalid));
|
|
55
56
|
}
|
|
56
57
|
componentWillLoad() {
|
|
@@ -124,9 +125,9 @@ const GovFormCheckbox = class {
|
|
|
124
125
|
}
|
|
125
126
|
get host() { return index.getElement(this); }
|
|
126
127
|
static get watchers() { return {
|
|
127
|
-
"size": ["validateSize", "
|
|
128
|
-
"disabled": ["
|
|
129
|
-
"invalid": ["
|
|
128
|
+
"size": ["validateSize", "watchControlAttrs"],
|
|
129
|
+
"disabled": ["watchControlAttrs"],
|
|
130
|
+
"invalid": ["watchControlAttrs"]
|
|
130
131
|
}; }
|
|
131
132
|
};
|
|
132
133
|
GovFormCheckbox.style = GovFormCheckboxStyle0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-checkbox.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,y/PAAy/P,CAAC;AACrhQ,8BAAe,kBAAkB;;MCiBpB,eAAe;IAQ3B;;;;;QAFQ,aAAQ,GAAG,KAAK,CAAA;;uBAiB0B,KAAK;wBAKlB,KAAK;wBAKL,KAAK;;oBAQM,GAAG;;uBAQU,KAAK;;;;QAxCjE,IAAI,CAAC,UAAU,GAAGA,qBAAQ,CAAC,aAAa,CAAC,CAAA;QAEzC,IAAI,CAAC,CAAC,GAAGC,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3B,IAAI,CAAC,CAAC,GAAGC,YAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KACxB;IA+DD,YAAY,CAAC,QAAgB;QAC5BC,kBAAY,CAACC,sBAAiB,EAAE,QAAQ,EAAEC,sBAAiB,CAAC,IAAI,CAAC,CAAA;KACjE;IAKD,aAAa;QACZ,IAAI,CAAC,gBAAgB,EAAE,CAAA;KACvB;IAEO,gBAAgB;QACvB,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,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C,CAAa;QAClC,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,EAAEA,sBAAiB,CAAC,IAAI;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;IAEO,cAAc,CAAC,CAAe;QACrC,CAAC,CAAC,eAAe,EAAE,CAAA;KACnB;IAEO,eAAe,CAAC,CAAQ;QAC/B,IAAI,CAAC,OAAO,GAAI,CAAC,CAAC,MAA2B,CAAC,OAAO,CAAA;QACrD,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YACnB,SAAS,EAAEA,sBAAiB,CAAC,IAAI;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;;;;IAMD,MAAM,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,CAAA;KACpB;;;;IAMD,MAAM,YAAY;QACjBQ,oBAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAER,sBAAiB,CAAC,IAAI,CAAC,CAAA;QAClFQ,oBAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAER,sBAAiB,CAAC,IAAI,CAAC,CAAA;QAChFS,yBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,EAAET,sBAAiB,CAAC,IAAI,CAAC,CAAA;KACrG;;;;;;;;;;;;","names":["createID","govHost","govForm","validateProp","FormCheckboxSizes","FormCheckboxClass","toBoolAttr","canValidateWcagOnRender","delay","h","Host","toBoolAttrIfDefined","Fragment","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.scss?tag=gov-form-checkbox","../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.tsx"],"sourcesContent":["/*\n * Checkbox\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n\n$class: \".gov-form-checkbox\";\n\n#{$class} {\n @extend %form-checkbox-core;\n\n input + span {\n &::before {\n border-radius: $border-radius;\n }\n }\n\n &__check {\n position: absolute;\n color: $form-checkbox-check-color;\n opacity: 0;\n transition: $t linear opacity;\n }\n\n &__label {\n position: relative;\n }\n\n // STATES\n input:checked + span::before {\n background: $form-checkbox-indicator-bg;\n }\n\n input:checked + span &__check {\n opacity: 1;\n }\n\n @include parameter(\"invalid\") {\n input:checked + span::before {\n background: $form-state-color-error;\n }\n }\n @include parameter(\"disabled\") {\n input:checked + span::before {\n border-color: $form-state-bg-disabled;\n background-color: $form-state-bg-disabled;\n }\n }\n\n // VARIANTS\n @each $size, $definitions in $form-checkbox-core-sizes {\n &[size=\"#{$size}\"] {\n #{$class} {\n &__check {\n top: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n left: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n width: get(\"check-size\", $definitions);\n height: get(\"check-size\", $definitions);\n }\n }\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormCheckboxClass, FormCheckboxSizes, FormCheckboxSizesType } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport { FormCheckboxEvent } from \"./gov-form-checkbox.types\"\n\n@Component({\n\ttag: \"gov-form-checkbox\",\n\tstyleUrl: \"gov-form-checkbox.scss\",\n})\nexport class GovFormCheckbox {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly checkboxId: string\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormCheckboxElement\n\t/**\n\t * Value of checkbox\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * Checkbox button state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the checkbox component disabled.\n\t * This prevents users from being able to interact with the checkbox, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the checkbox.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Checkboxes size.\n\t */\n\t@Prop() readonly size?: FormCheckboxSizesType = \"m\"\n\t/**\n\t * Custom checkbox identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the checkbox has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormCheckboxEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormCheckboxSizes, newValue, FormCheckboxClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToControl(\"type\", \"checkbox\")\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label class={FormCheckboxClass.label}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormCheckboxClass.root} hydrated={this.hydrated} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\taria-checked={toBoolAttr(this.checked)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"label\" />\n\t\t\t\t\t\t\t<gov-icon class={FormCheckboxClass.check} name=\"check-lg\"></gov-icon>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Fragment>,\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormCheckboxClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormCheckboxClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.checkboxId, this.wcagLabelledBy, FormCheckboxClass.root)\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"gov-form-checkbox.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,y/PAAy/P,CAAC;AACrhQ,8BAAe,kBAAkB;;MCiBpB,eAAe;IAQ3B;;;;;QAFQ,aAAQ,GAAG,KAAK,CAAA;;uBAiBwB,KAAK;wBAKhB,KAAK;wBAKL,KAAK;;oBAQM,GAAG;;uBAQQ,KAAK;;;;QAxC/D,IAAI,CAAC,UAAU,GAAGA,qBAAQ,CAAC,aAAa,CAAC,CAAA;QAEzC,IAAI,CAAC,CAAC,GAAGC,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3B,IAAI,CAAC,CAAC,GAAGC,YAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KACxB;IA+D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,CAAC,IAAI,CAAC,CAAA;QAChFS,yBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,EAAET,sBAAiB,CAAC,IAAI,CAAC,CAAA;KACrG;;;;;;;;;;;;","names":["createID","govHost","govForm","validateProp","FormCheckboxSizes","FormCheckboxClass","toBoolAttr","canValidateWcagOnRender","delay","h","Host","toBoolAttrIfDefined","Fragment","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.scss?tag=gov-form-checkbox","../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.tsx"],"sourcesContent":["/*\n * Checkbox\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n\n$class: \".gov-form-checkbox\";\n\n#{$class} {\n @extend %form-checkbox-core;\n\n input + span {\n &::before {\n border-radius: $border-radius;\n }\n }\n\n &__check {\n position: absolute;\n color: $form-checkbox-check-color;\n opacity: 0;\n transition: $t linear opacity;\n }\n\n &__label {\n position: relative;\n }\n\n // STATES\n input:checked + span::before {\n background: $form-checkbox-indicator-bg;\n }\n\n input:checked + span &__check {\n opacity: 1;\n }\n\n @include parameter(\"invalid\") {\n input:checked + span::before {\n background: $form-state-color-error;\n }\n }\n @include parameter(\"disabled\") {\n input:checked + span::before {\n border-color: $form-state-bg-disabled;\n background-color: $form-state-bg-disabled;\n }\n }\n\n // VARIANTS\n @each $size, $definitions in $form-checkbox-core-sizes {\n &[size=\"#{$size}\"] {\n #{$class} {\n &__check {\n top: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n left: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n width: get(\"check-size\", $definitions);\n height: get(\"check-size\", $definitions);\n }\n }\n }\n }\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {FormCheckboxClass, FormCheckboxSizes, FormCheckboxSizesType} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {validateWcagLabelFor, validateWcagRef} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {delay} from \"../../../utils/utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport {FormCheckboxEvent} from \"./gov-form-checkbox.types\"\n\n@Component({\n\ttag: \"gov-form-checkbox\",\n\tstyleUrl: \"gov-form-checkbox.scss\",\n})\nexport class GovFormCheckbox {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly checkboxId: string\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormCheckboxElement\n\t/**\n\t * Value of checkbox\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * Checkbox button state\n\t */\n\t@Prop({reflect: true, mutable: true}) checked = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the checkbox component disabled.\n\t * This prevents users from being able to interact with the checkbox, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the checkbox.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Checkboxes size.\n\t */\n\t@Prop() readonly size?: FormCheckboxSizesType = \"m\"\n\t/**\n\t * Custom checkbox identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({attribute: \"no-label\"}) readonly noLabel: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: \"wcag-described-by\"}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: \"wcag-labelled-by\"}) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the checkbox has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox change value.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<FormCheckboxEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormCheckboxSizes, newValue, FormCheckboxClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToControl(\"type\", \"checkbox\")\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label class={FormCheckboxClass.label}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormCheckboxClass.root} hydrated={this.hydrated} checked={this.checked} size={this.size}\n\t\t\t\t\t\tinvalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\taria-checked={toBoolAttr(this.checked)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"label\"/>\n\t\t\t\t\t\t\t<gov-icon class={FormCheckboxClass.check} name=\"check-lg\"></gov-icon>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Fragment>,\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormCheckboxClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormCheckboxClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.checkboxId, this.wcagLabelledBy, FormCheckboxClass.root)\n\t}\n}\n"],"version":3}
|
|
@@ -19,7 +19,6 @@ const GovFormControlStyle0 = govFormControlCss;
|
|
|
19
19
|
const GovFormControl = class {
|
|
20
20
|
constructor(hostRef) {
|
|
21
21
|
index.registerInstance(this, hostRef);
|
|
22
|
-
this.gap = undefined;
|
|
23
22
|
this.identifier = undefined;
|
|
24
23
|
this.invalid = false;
|
|
25
24
|
this.disabled = false;
|
|
@@ -28,11 +27,8 @@ const GovFormControl = class {
|
|
|
28
27
|
this.size = "m";
|
|
29
28
|
this.h = template.govHost(this.host);
|
|
30
29
|
this.f = form.govForm(this.h);
|
|
31
|
-
this.controlId = string_utils.createID("GovFormControl");
|
|
32
30
|
}
|
|
33
31
|
componentDidRender() {
|
|
34
|
-
this.passChildAttrs();
|
|
35
|
-
this.invalidChildAttrs();
|
|
36
32
|
this.syncControlMessages();
|
|
37
33
|
this.formElementDescriptionControl();
|
|
38
34
|
}
|
|
@@ -40,38 +36,6 @@ const GovFormControl = class {
|
|
|
40
36
|
var _a;
|
|
41
37
|
(_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
42
38
|
}
|
|
43
|
-
passChildAttrs() {
|
|
44
|
-
const formElements = [
|
|
45
|
-
"gov-form-select",
|
|
46
|
-
"gov-form-input",
|
|
47
|
-
"gov-form-switch",
|
|
48
|
-
"gov-form-checkbox",
|
|
49
|
-
"gov-form-radio",
|
|
50
|
-
"gov-form-multi-select",
|
|
51
|
-
"gov-form-file",
|
|
52
|
-
"gov-form-search",
|
|
53
|
-
];
|
|
54
|
-
this.h.passChildAttr(formElements, "success", this.success);
|
|
55
|
-
if (this.f.hasGroupChildren === false) {
|
|
56
|
-
this.h.passChildAttr([...formElements, "gov-form-label"], "identifier", this.identifier || this.controlId);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
invalidChildAttrs() {
|
|
60
|
-
const formElements = [
|
|
61
|
-
"gov-form-select",
|
|
62
|
-
"gov-form-input",
|
|
63
|
-
"gov-form-switch",
|
|
64
|
-
"gov-form-checkbox",
|
|
65
|
-
"gov-form-radio",
|
|
66
|
-
"gov-form-multi-select",
|
|
67
|
-
"gov-form-file",
|
|
68
|
-
"gov-form-search",
|
|
69
|
-
];
|
|
70
|
-
this.h.passChildAttr(formElements, "invalid", this.invalid);
|
|
71
|
-
if (this.f.hasGroupChildren === false) {
|
|
72
|
-
this.h.passChildAttr([...formElements, "gov-form-label"], "identifier", this.identifier || this.controlId);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
39
|
formElementDescriptionControl() {
|
|
76
40
|
const bottomSlot = this.host.querySelector("." + form.FormControlClass.bottom);
|
|
77
41
|
if (!bottomSlot)
|
|
@@ -97,7 +61,7 @@ const GovFormControl = class {
|
|
|
97
61
|
}
|
|
98
62
|
render() {
|
|
99
63
|
const Tag = this.fieldset ? "fieldset" : "div";
|
|
100
|
-
return (index.h(index.Host, { key: '
|
|
64
|
+
return (index.h(index.Host, { key: '9178f9dbaff42cb649849621e34059afa6d387d7', size: this.size, class: this.h.classes(form.FormControlClass.root) }, index.h(Tag, { key: '296540b214c4106f676b3bf4981ad84409004472', class: form.FormControlClass.holder }, this.h.hasSlot("top") && index.h("slot", { key: 'b62e1d46f8fdc6b56ae481de1cb1fb020f9f8ec6', name: "top" }), index.h("slot", { key: '24ffcd827657b1b02cbe657c41be16af9f8da165' }), this.h.hasSlot("bottom") && (index.h("div", { key: '77d9ee6b541d4b1073fd621deec00c2336aff240', class: form.FormControlClass.bottom }, index.h("slot", { key: '4c7f2200a2fd55b3f801dc40383b7a91cbb18b7d', name: "bottom" }))))));
|
|
101
65
|
}
|
|
102
66
|
get host() { return index.getElement(this); }
|
|
103
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-control.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,s0HAAs0H,CAAC;AACj2H,6BAAe,iBAAiB;;MCWnB,cAAc;
|
|
1
|
+
{"file":"gov-form-control.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,s0HAAs0H,CAAC;AACj2H,6BAAe,iBAAiB;;MCWnB,cAAc;IAK1B;;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C,YAAY,CAAC,EAAE;oBAChC,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;iBACvF;gBACD,IAAI,GAAG,CAAC,MAAM,EAAE;oBACf,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;iBACxD;aACD,CAAC,CAAA;SACF,CAAC,CAAA;KACF;IAED,MAAM;QACL,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAA;QAC9C,QACCC,QAACC,UAAI,qDAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAACH,qBAAgB,CAAC,IAAI,CAAC,IAClEE,QAAC,GAAG,qDAAC,KAAK,EAAEF,qBAAgB,CAAC,MAAM,IACjC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAIE,mEAAM,IAAI,EAAC,KAAK,GAAQ,EAClDA,oEAAa,EACZ,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KACxBA,kEAAK,KAAK,EAAEF,qBAAgB,CAAC,MAAM,IAClCE,mEAAM,IAAI,EAAC,QAAQ,GAAE,CAChB,CACN,CACI,CACA,EACP;KACD;;;;;;;","names":["govHost","govForm","FormControlClass","splitByWhitespace","h","Host"],"sources":["../../../packages/core/src/components/gov-form/control/gov-form-control.scss?tag=gov-form-control","../../../packages/core/src/components/gov-form/control/gov-form-control.tsx"],"sourcesContent":["/*\n * Form Control\n */\n\n$class: \".gov-form-control\";\n\n#{$class} {\n\t&__holder {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 0;\n\t\tborder: none;\n\t}\n\t&__bottom {\n\t\t@include reset-last-margin();\n\t\t> :first-child {\n\t\t\tmargin-top: rem-calc(4);\n\t\t}\n\t}\n\n\t// VARIANTS\n\t.gov-form-label .gov-form-label__label {\n\t\tmargin: rem-calc(0 0 4);\n\t}\n\t&[type=\"file\"] {\n\t\t.gov-form-label[slot=\"top\"] .gov-form-label__label {\n\t\t\tmargin: rem-calc(0 0 8);\n\t\t}\n\t\t#{$class}__bottom > :first-child {\n\t\t\tmargin-top: rem-calc(8);\n\t\t}\n\t}\n\t// Checkbox, radio\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"][type=\"checkbox\"],\n\t\t&[size=\"#{$size}\"][type=\"radio\"] {\n\t\t\t#{$class} {\n\t\t\t\t$indicator-width: get(\"indicator-size\", $definitions);\n\t\t\t\t&__holder > #{$class}__bottom > :first-child {\n\t\t\t\t\tmargin-top: get(\"message-gap\", $definitions);\n\t\t\t\t\tmargin-left: calc($indicator-width + get(\"gap\", $definitions));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Switch\n\t@each $size, $definitions in $form-switch-sizes {\n\t\t&[size=\"#{$size}\"][type=\"switch\"] {\n\t\t\t#{$class} {\n\t\t\t\t$indicator-ratio: calc(5 / 3);\n\t\t\t\t$indicator-width: calc(get(\"indicator-height\", $definitions) * $indicator-ratio);\n\t\t\t\t&__bottom > :first-child {\n\t\t\t\t\tmargin-top: get(\"message-gap\", $definitions);\n\t\t\t\t\tmargin-left: calc($indicator-width + get(\"gap\", $definitions));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t@include parameter(\"invalid\") {\n\t\t.gov-form-label[slot=\"top\"] .gov-form-label__label {\n\t\t\tcolor: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\t.gov-form-label__label {\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n}\n","import {Component, Element, h, Host, Prop} from \"@stencil/core\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {govHost} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {splitByWhitespace} from \"../../../utils/string.utils\"\nimport {FormControlClass, FormControlSizesType} from \"./constants\"\n\n@Component({\n\ttag: \"gov-form-control\",\n\tstyleUrl: \"gov-form-control.scss\",\n})\nexport class GovFormControl {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate observer: MutationObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormControlElement\n\t/**\n\t * Custom form element identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value of child form element does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean = false\n\t/**\n\t/**\n\t* Indicates the form control is disabled\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t/**\n\t* Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean = false\n\t/**\n\t * Use control as a fieldset for better accessibility.\n\t * Note: Don't forget to set the legend attribute of the gov-form-label component\n\t */\n\t@Prop() readonly fieldset: boolean = false\n\t/**\n\t * Form element size.\n\t */\n\t@Prop() readonly size?: FormControlSizesType = \"m\"\n\n\tcomponentDidRender() {\n\t\tthis.syncControlMessages()\n\t\tthis.formElementDescriptionControl()\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.observer?.disconnect()\n\t}\n\n\tprivate formElementDescriptionControl() {\n\t\tconst bottomSlot = this.host.querySelector(\".\" + FormControlClass.bottom)\n\t\tif (!bottomSlot) return\n\t\tthis.observer = new MutationObserver(\n\t\t\tfunction () {\n\t\t\t\tthis.syncControlMessages()\n\t\t\t}.bind(this),\n\t\t)\n\n\t\tthis.observer.observe(bottomSlot, {childList: true})\n\t}\n\n\tprivate syncControlMessages() {\n\t\tPromise.all(this.f.messageElements.map((message: HTMLGovFormMessageElement) => message.identifier())).then((ids: string[]) => {\n\t\t\tthis.f.mainElementsInControl.forEach((element: Element) => {\n\t\t\t\tconst currentValue = splitByWhitespace(element.getAttribute(\"wcag-described-by\"))\n\t\t\t\telement.removeAttribute(\"wcag-described-by\")\n\t\t\t\tif (Array.isArray(currentValue)) {\n\t\t\t\t\tcurrentValue.forEach(id => (id.indexOf(\"GovFormMessage\") === -1 ? ids.push(id) : null))\n\t\t\t\t}\n\t\t\t\tif (ids.length) {\n\t\t\t\t\telement.setAttribute(\"wcag-described-by\", ids.join(\" \"))\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t}\n\n\trender() {\n\t\tconst Tag = this.fieldset ? \"fieldset\" : \"div\"\n\t\treturn (\n\t\t\t<Host size={this.size} class={this.h.classes(FormControlClass.root)}>\n\t\t\t\t<Tag class={FormControlClass.holder}>\n\t\t\t\t\t{this.h.hasSlot(\"top\") && <slot name=\"top\"></slot>}\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t{this.h.hasSlot(\"bottom\") && (\n\t\t\t\t\t\t<div class={FormControlClass.bottom}>\n\t\t\t\t\t\t\t<slot name=\"bottom\"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
|
|
@@ -87,12 +87,12 @@ const GovFormFile = class {
|
|
|
87
87
|
this.h = template.govHost(this.host);
|
|
88
88
|
this.f = form.govForm(this.h);
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
watchControlAttrs() {
|
|
91
91
|
this.passControlAttrs();
|
|
92
92
|
}
|
|
93
93
|
passControlAttrs() {
|
|
94
94
|
this.f.passAttrToControl("invalid", template.toBoolAttr(this.invalid));
|
|
95
|
-
this.f.passAttrToControl("
|
|
95
|
+
this.f.passAttrToControl("disabled", template.toBoolAttr(this.disabled));
|
|
96
96
|
}
|
|
97
97
|
registerListeners() {
|
|
98
98
|
function highlight() {
|
|
@@ -167,7 +167,8 @@ const GovFormFile = class {
|
|
|
167
167
|
}
|
|
168
168
|
componentWillLoad() {
|
|
169
169
|
this.f.passAttrToLabel("required", String(this.required));
|
|
170
|
-
this.
|
|
170
|
+
this.f.passAttrToControl("type", "File");
|
|
171
|
+
this.passControlAttrs();
|
|
171
172
|
}
|
|
172
173
|
async componentDidRender() {
|
|
173
174
|
if (win.canValidateWcagOnRender()) {
|
|
@@ -177,7 +178,7 @@ const GovFormFile = class {
|
|
|
177
178
|
this.registerListeners();
|
|
178
179
|
}
|
|
179
180
|
render() {
|
|
180
|
-
return (index.h(index.Host, { key: '
|
|
181
|
+
return (index.h(index.Host, { key: 'f8ab9ecfba8ade897c1ba9d343259fd77fe74f68', class: this.h.classes([FormFileClass.root]), invalid: template.toBoolAttrIfDefined(this.invalid), expanded: template.toBoolAttrIfDefined(this.expanded) }, index.h("div", { key: '9b1051cb9163af7ceaf42462a2d040a04e3e2088', class: FormFileClass.area, ref: el => (this.areaRef = el) }, index.h("slot", { key: 'cf789459997322558f3a27eeaacaab2e11757aed' }), index.h("input", { key: '82d86f00eecd47a10b9540cc0671303d443b536b', class: FormFileClass.input, ref: el => (this.inputRef = el), id: this.identifier || this.fileId, type: "file", name: this.name, accept: this.accept, multiple: this.multiple, onChange: this.onChangeHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, disabled: this.disabled, "aria-required": template.toBoolAttrIfDefined(this.required), "aria-invalid": template.toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-disabled": template.toBoolAttrIfDefined(this.disabled) })), this.h.hasSlot("attachments") ? (index.h("div", { class: FormFileClass.attachments }, index.h("slot", { name: "attachments" }))) : null, this.files.length && this.displayAttachments ? (index.h("div", { class: FormFileClass.attachments }, index.h("gov-attachments", { label: this.wcagAttachmentsLabel, "wcag-label": this.wcagAttachmentsLabel }, this.files.map(item => (index.h("gov-attachments-item", { "wcag-remove-labelled-by": item.id, "on-gov-remove": () => this.onRemoveFileHandler(item) }, index.h("span", { class: "sr-only", id: item.id }, this.wcagRemoveLabel.replace("{FILE_NAME}", item.file.name)), item.file.name, item.acceptValid === false ? (index.h("gov-form-message", { slot: "message", variant: "error" }, index.h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill" }), item.acceptValid === false ? this.errorAccept : null)) : null, item.sizeValid === false ? (index.h("gov-form-message", { slot: "message", variant: "error" }, index.h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill" }), this.errorSize.replace("{FILE_SIZE}", formatBytes(this.maxFileSize)))) : null, index.h("span", { slot: "info" }, "(", formatBytes(item.file.size), ")"))))))) : null));
|
|
181
182
|
}
|
|
182
183
|
onRemoveFileHandler(file) {
|
|
183
184
|
const index = this.files.findIndex(item => item.id === file.id);
|
|
@@ -242,8 +243,8 @@ const GovFormFile = class {
|
|
|
242
243
|
}
|
|
243
244
|
get host() { return index.getElement(this); }
|
|
244
245
|
static get watchers() { return {
|
|
245
|
-
"disabled": ["
|
|
246
|
-
"invalid": ["
|
|
246
|
+
"disabled": ["watchControlAttrs"],
|
|
247
|
+
"invalid": ["watchControlAttrs"]
|
|
247
248
|
}; }
|
|
248
249
|
};
|
|
249
250
|
GovFormFile.style = GovFormFileStyle0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-file.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;AAAO,MAAM,aAAa,GAAG;IAC5B,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,sBAAsB;IAC7B,KAAK,EAAE,sBAAsB;IAC7B,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,4BAA4B;CACzC;;SCRe,WAAW,CAAC,KAAU;IACrC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAA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,CAAC,IAAI,CAAC;YAClB,SAAS,EAAE,aAAa,CAAC,IAAI;YAC7B,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;IAEO,aAAa,CAAC,CAAa;QAClC,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,EAAE,aAAa,CAAC,IAAI;YAC7B,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;IAEO,eAAe,CAAC,CAAQ;QAC/B,CAAC,CAAC,eAAe,EAAE,CAAA;KACnB;;;;IAMD,MAAM,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,CAAA;KACpB;;;;IAMD,MAAM,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAA;KACnB;;;;IAMD,MAAM,KAAK;QACV,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC;KACzB;;;;IAMD,MAAM,YAAY;QACjBG,oBAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;QAC9EA,oBAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;QAC5EC,yBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;KAC7F;;;;;;;;;;;","names":["createID","govHost","govForm","toBoolAttr","canValidateWcagOnRender","delay","h","Host","toBoolAttrIfDefined","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.scss?tag=gov-form-file","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tlabel: 'gov-form-file__label',\n\tinput: 'gov-form-file__input',\n\tlist: 'gov-form-file__list',\n\titem: 'gov-form-file__item',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept === 'string' && accept.length) {\n\t\treturn (\n\t\t\taccept\n\t\t\t\t.replace(/\\s/g, '')\n\t\t\t\t.split(',')\n\t\t\t\t.filter(accept => {\n\t\t\t\t\treturn new RegExp(accept.replace('*', '.*')).test(file.type)\n\t\t\t\t}).length > 0\n\t\t)\n\t} else {\n\t\treturn true\n\t}\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size)\n\treturn fileSize <= maxSize\n}\n","/*\n * File\n */\n\n$class: \".gov-form-file\";\n\n#{$class} {\n\t@include base();\n\t&__label .gov-form-label__label {\n\t\t@include reset-last-margin();\n\t}\n\t&__input {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\topacity: 0.0001;\n\t\tcursor: pointer;\n\t}\n\t&__attachments {\n\t\tmargin-top: rem-calc(16 0 0);\n\t}\n\t&__item {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\talign-items: center;\n\t}\n\n\t// STATES\n\t@include parameter(\"disabled\") {\n\t\t#{$class} {\n\t\t\t&__label .gov-form-label__label {\n\t\t\t\tpointer-events: none;\n\t\t\t\t* {\n\t\t\t\t\tcolor: $form-file-disabled-color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@include parameter(\"expanded\") {\n\t\t#{$class} {\n\t\t\t&__area {\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: rem-calc(32) rem-calc(22) rem-calc(22);\n\t\t\t\tborder: $form-file-border;\n\t\t\t\ttext-align: center;\n\t\t\t\ttransition: background-color $t ease-in-out;\n\t\t\t\twill-change: background-color;\n\t\t\t\t&.highlight {\n\t\t\t\t\tbackground-color: color(\"primary.200\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&__label .gov-form-label__label {\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: rem-calc(22);\n\t\t\t\tborder: $form-file-border;\n\t\t\t\ttext-align: center;\n\t\t\t}\n\t\t\t&__attachments {\n\t\t\t\tmargin: rem-calc(24 0 0);\n\t\t\t}\n\t\t}\n\n\t\t// STATES\n\t\t@include parameter(\"invalid\") {\n\t\t\t#{$class} {\n\t\t\t\t&__label .gov-form-label__label {\n\t\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t\t}\n\t\t\t\t&__area {\n\t\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t@include parameter(\"disabled\") {\n\t\t\t#{$class} {\n\t\t\t\t&__area {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\tcolor: $form-file-disabled-color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t@include parameter(\"expanded\") {\n\t\t\t#{$class} {\n\t\t\t\t&__label .gov-form-label__label {\n\t\t\t\t\tpadding: rem-calc(32);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {validateWcagLabelFor, validateWcagRef} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {delay} from \"../../../utils/utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\n\n@Component({\n\ttag: \"gov-form-file\",\n\tstyleUrl: \"gov-form-file.scss\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = true\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Description of the list of attachments\n\t */\n\t@Prop({attribute: \"attachments-label\"}) readonly attachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: \"wcag-described-by\"}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: \"wcag-labelled-by\"}) readonly wcagLabelledBy: string\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"wcag-remove-label\"}) readonly wcagRemoveLabel: string = \"Odebrat soubor {FILE_NAME}\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"wcag-attachments-label\"}) readonly wcagAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\t@State() files: GovFormFileItem[] = []\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"drop\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\n\t\t\tthis.areaRef.addEventListener(\"drop\", this.handleDrop.bind(this), false)\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\tArray.from(files).map(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.watchDisabled()\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\n\t\tthis.registerListeners()\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])} invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\texpanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.wcagAttachmentsLabel} wcag-label={this.wcagAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item wcag-remove-labelled-by={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ton-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t<span class={\"sr-only\"} id={item.id}>\n\t\t\t\t\t\t\t\t\t\t{this.wcagRemoveLabel.replace(\"{FILE_NAME}\", item.file.name)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" variant=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" variant=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\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: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tthis.inputRef.value = '';\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormFileClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormFileClass.root)\n\t\tv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CAAC,eAAe,EAAE,mBAAmB,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;QAC9EA,oBAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;QAC5EC,yBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;KAC7F;;;;;;;;;;;","names":["createID","govHost","govForm","toBoolAttr","canValidateWcagOnRender","delay","h","Host","toBoolAttrIfDefined","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.scss?tag=gov-form-file","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tlabel: 'gov-form-file__label',\n\tinput: 'gov-form-file__input',\n\tlist: 'gov-form-file__list',\n\titem: 'gov-form-file__item',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept === 'string' && accept.length) {\n\t\treturn (\n\t\t\taccept\n\t\t\t\t.replace(/\\s/g, '')\n\t\t\t\t.split(',')\n\t\t\t\t.filter(accept => {\n\t\t\t\t\treturn new RegExp(accept.replace('*', '.*')).test(file.type)\n\t\t\t\t}).length > 0\n\t\t)\n\t} else {\n\t\treturn true\n\t}\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size)\n\treturn fileSize <= maxSize\n}\n","/*\n * File\n */\n\n$class: \".gov-form-file\";\n\n#{$class} {\n\t@include base();\n\t&__label .gov-form-label__label {\n\t\t@include reset-last-margin();\n\t}\n\t&__input {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\topacity: 0.0001;\n\t\tcursor: pointer;\n\t}\n\t&__attachments {\n\t\tmargin-top: rem-calc(16 0 0);\n\t}\n\t&__item {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\talign-items: center;\n\t}\n\n\t// STATES\n\t@include parameter(\"disabled\") {\n\t\t#{$class} {\n\t\t\t&__label .gov-form-label__label {\n\t\t\t\tpointer-events: none;\n\t\t\t\t* {\n\t\t\t\t\tcolor: $form-file-disabled-color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@include parameter(\"expanded\") {\n\t\t#{$class} {\n\t\t\t&__area {\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: rem-calc(32) rem-calc(22) rem-calc(22);\n\t\t\t\tborder: $form-file-border;\n\t\t\t\ttext-align: center;\n\t\t\t\ttransition: background-color $t ease-in-out;\n\t\t\t\twill-change: background-color;\n\t\t\t\t&.highlight {\n\t\t\t\t\tbackground-color: color(\"primary.200\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&__label .gov-form-label__label {\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: rem-calc(22);\n\t\t\t\tborder: $form-file-border;\n\t\t\t\ttext-align: center;\n\t\t\t}\n\t\t\t&__attachments {\n\t\t\t\tmargin: rem-calc(24 0 0);\n\t\t\t}\n\t\t}\n\n\t\t// STATES\n\t\t@include parameter(\"invalid\") {\n\t\t\t#{$class} {\n\t\t\t\t&__label .gov-form-label__label {\n\t\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t\t}\n\t\t\t\t&__area {\n\t\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t@include parameter(\"disabled\") {\n\t\t\t#{$class} {\n\t\t\t\t&__area {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\tcolor: $form-file-disabled-color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t@include parameter(\"expanded\") {\n\t\t\t#{$class} {\n\t\t\t\t&__label .gov-form-label__label {\n\t\t\t\t\tpadding: rem-calc(32);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {validateWcagLabelFor, validateWcagRef} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {delay} from \"../../../utils/utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\n\n@Component({\n\ttag: \"gov-form-file\",\n\tstyleUrl: \"gov-form-file.scss\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = true\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Description of the list of attachments\n\t */\n\t@Prop({attribute: \"attachments-label\"}) readonly attachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: \"wcag-described-by\"}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: \"wcag-labelled-by\"}) readonly wcagLabelledBy: string\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"wcag-remove-label\"}) readonly wcagRemoveLabel: string = \"Odebrat soubor {FILE_NAME}\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"wcag-attachments-label\"}) readonly wcagAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\t@State() files: GovFormFileItem[] = []\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t}\n\n\n\tprivate registerListeners() {\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"drop\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\n\t\t\tthis.areaRef.addEventListener(\"drop\", this.handleDrop.bind(this), false)\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\tArray.from(files).map(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\n\t\tthis.registerListeners()\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])} invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\texpanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.wcagAttachmentsLabel} wcag-label={this.wcagAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item wcag-remove-labelled-by={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ton-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t<span class={\"sr-only\"} id={item.id}>\n\t\t\t\t\t\t\t\t\t\t{this.wcagRemoveLabel.replace(\"{FILE_NAME}\", item.file.name)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" variant=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" variant=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\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: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tthis.inputRef.value = '';\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormFileClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormFileClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.fileId, this.wcagLabelledBy, FormFileClass.root)\n\t}\n}\n"],"version":3}
|
|
@@ -75,19 +75,21 @@ const GovFormInput = class {
|
|
|
75
75
|
validateSize(newValue) {
|
|
76
76
|
props.validateProp(form.FormInputSizes, newValue, form.FormInputClass.root);
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
watchControlAttrs() {
|
|
79
79
|
this.passControlAttrs();
|
|
80
80
|
}
|
|
81
81
|
passControlAttrs() {
|
|
82
82
|
this.f.passAttrToControl("size", this.size);
|
|
83
|
+
this.f.passAttrToControl("success", template.toBoolAttr(this.success));
|
|
84
|
+
this.f.passAttrToControl("disabled", template.toBoolAttr(this.disabled));
|
|
83
85
|
this.f.passAttrToControl("invalid", template.toBoolAttr(this.invalid));
|
|
84
|
-
this.f.passAttrToControl("type", this.multiline ? Tags.TEXTAREA : Tags.INPUT);
|
|
85
86
|
}
|
|
86
87
|
componentWillLoad() {
|
|
87
88
|
this.validateVariant(this.variant);
|
|
88
89
|
this.validateSize(this.size);
|
|
89
90
|
this.passControlAttrs();
|
|
90
91
|
this.f.passAttrToLabel("required", String(this.required));
|
|
92
|
+
this.f.passAttrToControl("type", this.multiline ? Tags.TEXTAREA : Tags.INPUT);
|
|
91
93
|
}
|
|
92
94
|
async componentDidRender() {
|
|
93
95
|
if (win.canValidateWcagOnRender()) {
|
|
@@ -100,9 +102,9 @@ const GovFormInput = class {
|
|
|
100
102
|
}
|
|
101
103
|
render() {
|
|
102
104
|
const Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT;
|
|
103
|
-
return (index.h(index.Host, { key: '
|
|
104
|
-
index.h("gov-icon", { key: '
|
|
105
|
-
index.h("gov-icon", { key: '
|
|
105
|
+
return (index.h(index.Host, { key: 'fb06974797e9fe99cc0845cd9aac8cc79bfc0583', class: form.FormInputClass.root, size: this.size, variant: this.variant, type: this.type }, this.h.hasSlot("prefix") && index.h("slot", { key: 'c8a307ca8c1e4e4a27ac00463523f19c4012bbfe', name: "prefix" }), index.h("span", { key: 'b86a839790465feda8d50385ca5b44a98c3ee81d', class: "element" }, this.h.hasSlot("left-icon") && index.h("slot", { key: '300d97f0f13e95ac306b3c0332ccb58b99988c7a', name: "left-icon" }), this.h.hasSlot("right-icon") && !(this.success || this.invalid) && index.h("slot", { key: '6d2673bc16e363b52662671a172f7c20eca85c62', name: "right-icon" }), this.success && !this.multiline &&
|
|
106
|
+
index.h("gov-icon", { key: '40c2f0e9991833ad731e469164d0bd148d883007', slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && !this.multiline &&
|
|
107
|
+
index.h("gov-icon", { key: '56d940b36602db7749fc1656fdee739b2ad21370', slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), index.h(Tag, { key: 'ecdf27b1a0889cfd0367ded8cffd24152c2e1d01', type: this.inputType, disabled: this.disabled, id: this.identifier || this.inputId, name: this.name, onFocus: this.onFocusHandler.bind(this), onInput: this.onInputHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onKeyUp: this.onKeyUpHandler.bind(this), onKeyDown: this.onKeyDownHandler.bind(this), ref: el => (this.inputRef = el), placeholder: this.placeholder, value: this.value, spellcheck: template.toBoolAttrIfDefined(this.spellcheck), lang: this.inputLang, readonly: template.toBoolAttrIfDefined(this.readonly), autocomplete: template.toOnOffAttrIfDefined(this.autocomplete), autocorrect: template.toOnOffAttrIfDefined(this.autocorrect), minlength: this.minlength, maxlength: this.maxlength, min: this.min, max: this.max, required: this.required, rows: this.rows, cols: this.cols, role: this.role, "aria-required": template.toBoolAttrIfDefined(this.required), "aria-invalid": template.toBoolAttrIfDefined(this.invalid), "aria-disabled": template.toBoolAttrIfDefined(this.disabled), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns, "aria-expanded": template.toBoolAttrIfDefined(this.wcagExpanded), "aria-autocomplete": this.wcagAutocomplete })), this.h.hasSlot("sufix") && index.h("slot", { key: 'bd6b9c7a981c40fdddf83e8ce0778978e1ea31af', name: "sufix" })));
|
|
106
108
|
}
|
|
107
109
|
onFocusHandler(e) {
|
|
108
110
|
e.stopPropagation();
|
|
@@ -184,10 +186,10 @@ const GovFormInput = class {
|
|
|
184
186
|
get host() { return index.getElement(this); }
|
|
185
187
|
static get watchers() { return {
|
|
186
188
|
"variant": ["validateVariant"],
|
|
187
|
-
"size": ["validateSize", "
|
|
188
|
-
"disabled": ["
|
|
189
|
-
"invalid": ["
|
|
190
|
-
"
|
|
189
|
+
"size": ["validateSize", "watchControlAttrs"],
|
|
190
|
+
"disabled": ["watchControlAttrs"],
|
|
191
|
+
"invalid": ["watchControlAttrs"],
|
|
192
|
+
"success": ["watchControlAttrs"]
|
|
191
193
|
}; }
|
|
192
194
|
};
|
|
193
195
|
GovFormInput.style = GovFormInputStyle0;
|