@gov-design-system-ce/components 4.6.3 → 4.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -1
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-banner.cjs.entry.js +3 -3
- package/dist/cjs/gov-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-banner.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-flex_3.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +67 -23
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-autocomplete.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +32 -3
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-file.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-form-search.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-search.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-search.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-form-select.cjs.entry.js +8 -15
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-select.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-tooltip.gov-tooltip-content.entry.cjs.js.map +1 -1
- package/dist/cjs/gov-tooltip_2.cjs.entry.js +34 -9
- package/dist/cjs/gov-tooltip_2.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizard-item.cjs.entry.js +2 -2
- package/dist/cjs/gov-wizard.cjs.entry.js +1 -1
- package/dist/cjs/index-BEF5cZxd.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gov-banner/gov-banner.js +4 -4
- package/dist/collection/components/gov-banner/gov-banner.js.map +1 -1
- package/dist/collection/components/gov-form/autocomplete/autocomplete.utils.js +14 -0
- package/dist/collection/components/gov-form/autocomplete/autocomplete.utils.js.map +1 -0
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +76 -22
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.js +34 -3
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-form/search/gov-form-search.js +2 -2
- package/dist/collection/components/gov-form/search/gov-form-search.js.map +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.js +8 -15
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +22 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip.js +31 -8
- package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
- package/dist/collection/components/gov-wizard/gov-wizard-item.js +2 -2
- package/dist/collection/components/gov-wizard/gov-wizard.js +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-accordion.js +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-attachments.js +1 -1
- package/dist/components/gov-backdrop.js +1 -1
- package/dist/components/gov-banner.js +1 -1
- package/dist/components/gov-banner.js.map +1 -1
- package/dist/components/gov-blockquote.js +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-breadcrumbs.js.map +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-collapsible.js +1 -1
- package/dist/components/gov-collapsible.js.map +1 -1
- package/dist/components/gov-container.js +1 -1
- package/dist/components/gov-control-group.js +1 -1
- package/dist/components/gov-cookiebar.js +1 -1
- package/dist/components/gov-dialog.js +1 -1
- package/dist/components/gov-dropdown.js +1 -1
- package/dist/components/gov-empty.js +1 -1
- package/dist/components/gov-error-code.js +1 -1
- package/dist/components/gov-flex.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox-group.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-control.js +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-group.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-message.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-group.js +1 -1
- package/dist/components/gov-form-radio.js +1 -1
- package/dist/components/gov-form-range.js +1 -1
- package/dist/components/gov-form-range.js.map +1 -1
- package/dist/components/gov-form-search.js +1 -1
- package/dist/components/gov-form-search.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-grid-item.js +1 -1
- package/dist/components/gov-grid.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-layout-column.js +1 -1
- package/dist/components/gov-layout.js +1 -1
- package/dist/components/gov-link.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-message.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-skeleton.js +1 -1
- package/dist/components/gov-spacer.js +1 -1
- package/dist/components/gov-stepper-item.js +1 -1
- package/dist/components/gov-stepper.js +1 -1
- package/dist/components/gov-tabs-item.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-theme-switch.js +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-tooltip.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/gov-wizard.js +1 -1
- package/dist/components/{p-DKo9A5gq.js → p-BHRF-5cf.js} +2 -2
- package/dist/components/{p-9imLQpxb.js → p-BSr8e18S.js} +2 -2
- package/dist/components/{p-BNnuBQvo.js → p-BxS4InzB.js} +2 -2
- package/dist/components/{p-CfaJM4SA.js → p-CMmyR4-k.js} +2 -2
- package/dist/components/{p-B0KFtEn3.js → p-CU0plGZP.js} +2 -2
- package/dist/components/{p-BrdXh0mI.js → p-CXPP9vec.js} +2 -2
- package/dist/components/{p-djqfSbq-.js → p-C_URF9Su.js} +2 -2
- package/dist/components/{p-yqJEurSE.js → p-CnKqUwf9.js} +2 -2
- package/dist/components/p-DEthsMuE.js +2 -0
- package/dist/components/p-DEthsMuE.js.map +1 -0
- package/dist/components/{p-Bv5L0j6n.js → p-DN5pb9xA.js} +2 -2
- package/dist/components/{p-DesycS6d.js → p-iTwUkISB.js} +2 -2
- package/dist/components/{p-BZTY3MxF.js → p-ibUK7mfI.js} +2 -2
- package/dist/components/p-keC6luw7.js +2 -0
- package/dist/components/p-keC6luw7.js.map +1 -0
- package/dist/components/p-pJ_vPAO0.js +2 -0
- package/dist/components/p-pJ_vPAO0.js.map +1 -0
- package/dist/components/p-yIpIIG5A.js +2 -0
- package/dist/components/p-yIpIIG5A.js.map +1 -0
- package/dist/core/core.css +47 -47
- package/dist/core/core.esm.js +1 -1
- package/dist/core/gov-banner.entry.esm.js.map +1 -1
- package/dist/core/gov-form-autocomplete.entry.esm.js.map +1 -1
- package/dist/core/gov-form-file.entry.esm.js.map +1 -1
- package/dist/core/gov-form-search.entry.esm.js.map +1 -1
- package/dist/core/gov-form-select.entry.esm.js.map +1 -1
- package/dist/core/gov-tooltip.gov-tooltip-content.entry.esm.js.map +1 -1
- package/dist/core/{p-4da8ac1d.entry.js → p-10991f00.entry.js} +2 -2
- package/dist/core/p-19300834.entry.js +2 -0
- package/dist/core/{p-bd389bfd.entry.js.map → p-19300834.entry.js.map} +1 -1
- package/dist/core/p-4e2faea7.entry.js +2 -0
- package/dist/core/p-4e2faea7.entry.js.map +1 -0
- package/dist/core/p-7f513718.entry.js +2 -0
- package/dist/core/p-7f513718.entry.js.map +1 -0
- package/dist/core/p-8d47e346.entry.js +2 -0
- package/dist/core/p-8d47e346.entry.js.map +1 -0
- package/dist/core/p-DQuL1Twl.js.map +1 -1
- package/dist/core/p-afe254cb.entry.js +2 -0
- package/dist/core/p-afe254cb.entry.js.map +1 -0
- package/dist/core/{p-469f14db.entry.js → p-bec959c4.entry.js} +2 -2
- package/dist/core/p-d9d29f50.entry.js +2 -0
- package/dist/core/p-d9d29f50.entry.js.map +1 -0
- package/dist/core/{p-4d365881.entry.js → p-f75ad657.entry.js} +2 -2
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-banner.entry.js +3 -3
- package/dist/esm/gov-banner.entry.js.map +1 -1
- package/dist/esm/gov-flex_3.entry.js +1 -1
- package/dist/esm/gov-form-autocomplete.entry.js +68 -24
- package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
- package/dist/esm/gov-form-file.entry.js +32 -3
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-form-search.entry.js +1 -1
- package/dist/esm/gov-form-search.entry.js.map +1 -1
- package/dist/esm/gov-form-select.entry.js +8 -15
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-tooltip.gov-tooltip-content.entry.js.map +1 -1
- package/dist/esm/gov-tooltip_2.entry.js +34 -9
- package/dist/esm/gov-tooltip_2.entry.js.map +1 -1
- package/dist/esm/gov-wizard-item.entry.js +2 -2
- package/dist/esm/gov-wizard.entry.js +1 -1
- package/dist/esm/index-ClISz4NF.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +154 -60
- package/dist/hydrate/index.mjs +154 -60
- package/dist/types/Users/jf/dev/designSystem/gov-design-system/packages/core/.stencil/packages/core/stencil.config.d.ts +2 -0
- package/dist/types/components/gov-form/autocomplete/autocomplete.utils.d.ts +2 -0
- package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +9 -0
- package/dist/types/components/gov-form/file/gov-form-file.d.ts +1 -0
- package/dist/types/components/gov-form/select/gov-form-select.d.ts +1 -1
- package/dist/types/components/gov-tooltip/gov-tooltip-content.d.ts +4 -0
- package/dist/types/components/gov-tooltip/gov-tooltip.d.ts +3 -0
- package/dist/types/components.d.ts +20 -2
- package/package.json +2 -2
- package/readme.md +9 -0
- package/dist/components/p-DFu5UVoP.js +0 -2
- package/dist/components/p-DFu5UVoP.js.map +0 -1
- package/dist/components/p-DMVQRz4f.js +0 -2
- package/dist/components/p-DMVQRz4f.js.map +0 -1
- package/dist/components/p-UDT3DloZ.js +0 -2
- package/dist/components/p-UDT3DloZ.js.map +0 -1
- package/dist/components/p-x3w8Mun_.js +0 -2
- package/dist/components/p-x3w8Mun_.js.map +0 -1
- package/dist/core/p-11fc3899.entry.js +0 -2
- package/dist/core/p-11fc3899.entry.js.map +0 -1
- package/dist/core/p-33b462c9.entry.js +0 -2
- package/dist/core/p-33b462c9.entry.js.map +0 -1
- package/dist/core/p-3e5ae012.entry.js +0 -2
- package/dist/core/p-3e5ae012.entry.js.map +0 -1
- package/dist/core/p-bd389bfd.entry.js +0 -2
- package/dist/core/p-c21bc8f9.entry.js +0 -2
- package/dist/core/p-c21bc8f9.entry.js.map +0 -1
- package/dist/core/p-def34832.entry.js +0 -2
- package/dist/core/p-def34832.entry.js.map +0 -1
- package/dist/types/work/packages/core/.stencil/packages/core/stencil.config.d.ts +0 -2
- /package/dist/components/{p-DKo9A5gq.js.map → p-BHRF-5cf.js.map} +0 -0
- /package/dist/components/{p-9imLQpxb.js.map → p-BSr8e18S.js.map} +0 -0
- /package/dist/components/{p-BNnuBQvo.js.map → p-BxS4InzB.js.map} +0 -0
- /package/dist/components/{p-CfaJM4SA.js.map → p-CMmyR4-k.js.map} +0 -0
- /package/dist/components/{p-B0KFtEn3.js.map → p-CU0plGZP.js.map} +0 -0
- /package/dist/components/{p-BrdXh0mI.js.map → p-CXPP9vec.js.map} +0 -0
- /package/dist/components/{p-djqfSbq-.js.map → p-C_URF9Su.js.map} +0 -0
- /package/dist/components/{p-yqJEurSE.js.map → p-CnKqUwf9.js.map} +0 -0
- /package/dist/components/{p-Bv5L0j6n.js.map → p-DN5pb9xA.js.map} +0 -0
- /package/dist/components/{p-DesycS6d.js.map → p-iTwUkISB.js.map} +0 -0
- /package/dist/components/{p-BZTY3MxF.js.map → p-ibUK7mfI.js.map} +0 -0
- /package/dist/core/{p-4da8ac1d.entry.js.map → p-10991f00.entry.js.map} +0 -0
- /package/dist/core/{p-469f14db.entry.js.map → p-bec959c4.entry.js.map} +0 -0
- /package/dist/core/{p-4d365881.entry.js.map → p-f75ad657.entry.js.map} +0 -0
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy(JSON.parse("[[\"gov-form-file.cjs\",[[4,\"gov-form-file\",{\"expanded\":[4],\"required\":[4],\"disabled\":[516],\"resetAfterPick\":[4,\"reset-after-pick\"],\"ignoreFileDuplicationCheck\":[4,\"ignore-file-duplication-check\"],\"displayAttachments\":[4,\"display-attachments\"],\"name\":[1],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"identifier\":[1],\"invalid\":[4],\"errorSize\":[1,\"error-size\"],\"errorAccept\":[1,\"error-accept\"],\"accessibleAttachmentsLabel\":[1,\"accessible-attachments-label\"],\"files\":[32],\"inheritedAttributes\":[32],\"getRef\":[64],\"getAreaRef\":[64],\"reset\":[64]},null,{\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-multi-select.cjs\",[[4,\"gov-form-multi-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"placeholder\":[1],\"size\":[1],\"name\":[1],\"hideSelectedList\":[4,\"hide-selected-list\"],\"required\":[4],\"disabled\":[516],\"invalid\":[516],\"success\":[4],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"focused\":[32],\"valueState\":[32],\"selectedOptionsState\":[32],\"optionsState\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\"],\"options\":[\"watchOptions\"],\"value\":[\"watchValue\"]}]]],[\"gov-dialog.cjs\",[[4,\"gov-dialog\",{\"open\":[1540],\"blockClose\":[4,\"block-close\"],\"blockBackdropClose\":[4,\"block-backdrop-close\"],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"accessibleLabelledBy\":[1,\"accessible-labelled-by\"],\"accessibleDescribedBy\":[1,\"accessible-described-by\"],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"accessibleCloseLabelledBy\":[1,\"accessible-close-labelled-by\"],\"setFocus\":[64],\"validateAccessibility\":[64]},null,{\"open\":[\"watchOpen\"]}]]],[\"gov-form-range.cjs\",[[4,\"gov-form-range\",{\"size\":[1],\"value\":[1537],\"identifier\":[1],\"name\":[1],\"min\":[8],\"max\":[8],\"step\":[8],\"tooltip\":[4],\"input\":[4],\"listIdentifier\":[1,\"list-identifier\"],\"required\":[516],\"success\":[516],\"invalid\":[516],\"disabled\":[516],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"value\":[\"watchValue\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]],[\"gov-pagination.cjs\",[[0,\"gov-pagination\",{\"type\":[1],\"current\":[2],\"total\":[2],\"selectIdentifier\":[1,\"select-identifier\"],\"size\":[1],\"color\":[1],\"pageSize\":[2,\"page-size\"],\"maxPages\":[2,\"max-pages\"],\"link\":[1],\"accessibleSelectLabel\":[1,\"accessible-select-label\"],\"accessiblePageLabel\":[1,\"accessible-page-label\"],\"labelPrev\":[1,\"label-prev\"],\"labelStart\":[1,\"label-start\"],\"labelNext\":[1,\"label-next\"],\"labelEnd\":[1,\"label-end\"],\"pagination\":[32],\"inheritedAttributes\":[32]},null,{\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"color\":[\"validateColor\"],\"current\":[\"recalculate\"],\"total\":[\"recalculate\"],\"pageSize\":[\"recalculate\"],\"maxPages\":[\"recalculate\"]}]]],[\"gov-breadcrumbs.cjs\",[[4,\"gov-breadcrumbs\",{\"collapsible\":[4],\"isExpanded\":[4,\"is-expanded\"],\"accessibleLabel\":[1,\"accessible-label\"],\"accessibleLabelledBy\":[1,\"accessible-labelledby\"],\"accessibleToggleLabel\":[1,\"accessible-toggle-label\"],\"expanded\":[32],\"toggleOption\":[32],\"validateAccessibility\":[64]}]]],[\"gov-collapsible.cjs\",[[4,\"gov-collapsible\",{\"size\":[1],\"identifier\":[1],\"label\":[1],\"disabled\":[4],\"open\":[1028],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-infobar.cjs\",[[4,\"gov-infobar\",{\"color\":[1],\"type\":[1],\"role\":[1],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"accessibleToggleLabel\":[1,\"accessible-toggle-label\"],\"closable\":[4],\"toggleContent\":[32],\"inheritedAttributes\":[32]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-loading.cjs\",[[4,\"gov-loading\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tabs.cjs\",[[4,\"gov-tabs\",{\"type\":[1],\"size\":[1],\"color\":[1],\"orientation\":[1],\"direction\":[513],\"controllers\":[32],\"focusIndex\":[32],\"inheritedAttributes\":[32],\"refresh\":[64],\"currentTab\":[64],\"setActiveTab\":[64],\"rerender\":[64]},null,{\"type\":[\"validateType\"],\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-toast.cjs\",[[4,\"gov-toast\",{\"color\":[1],\"gravity\":[1],\"position\":[1],\"type\":[1],\"time\":[2],\"closeLabel\":[1,\"close-label\"],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"inheritedAttributes\":[32],\"destroy\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-accordion-item.cjs\",[[4,\"gov-accordion-item\",{\"identifier\":[1],\"size\":[1025],\"disabled\":[4],\"open\":[1028],\"openState\":[32],\"toggle\":[64],\"currentState\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-blockquote.cjs\",[[4,\"gov-blockquote\",{\"type\":[513],\"cite\":[1]}]]],[\"gov-card.cjs\",[[4,\"gov-card\",{\"direction\":[1],\"collapsible\":[4],\"clickable\":[4],\"open\":[1540],\"href\":[513],\"target\":[1],\"accessibleTriggerLabel\":[1,\"accessible-label\"],\"accessibleTriggerLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-form-checkbox.cjs\",[[4,\"gov-form-checkbox\",{\"value\":[1],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"indeterminate\":[516],\"name\":[1],\"size\":[513],\"identifier\":[1],\"noLabel\":[4,\"no-label\"],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-switch.cjs\",[[4,\"gov-form-switch\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"name\":[1],\"size\":[513],\"identifier\":[1],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchDisabled\"],\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"]}]]],[\"gov-link.cjs\",[[4,\"gov-link\",{\"size\":[1],\"external\":[4],\"truncate\":[4],\"href\":[1],\"target\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tag.cjs\",[[4,\"gov-tag\",{\"iconStart\":[1,\"icon-start\"],\"iconEnd\":[1,\"icon-end\"],\"size\":[513],\"color\":[513],\"type\":[513],\"expanded\":[516]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-tile.cjs\",[[4,\"gov-tile\",{\"size\":[513],\"orientation\":[1],\"noBorder\":[4,\"no-border\"],\"href\":[513],\"target\":[1],\"getTriggerRef\":[64]}]]],[\"gov-wizard-item.cjs\",[[4,\"gov-wizard-item\",{\"color\":[1],\"size\":[1],\"identifier\":[1],\"collapsible\":[4],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-accordion.cjs\",[[4,\"gov-accordion\",{\"size\":[1],\"noBorder\":[4,\"no-border\"]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-banner.cjs\",[[4,\"gov-banner\",{\"size\":[513],\"background\":[1],\"foreground\":[1],\"textColor\":[1,\"text-color\"]},null,{\"size\":[\"validateSize\"],\"background\":[\"validateBackground\"],\"foreground\":[\"validateForeground\"],\"text-color\":[\"validateTextColor\"]}]]],[\"gov-container.cjs\",[[4,\"gov-container\"]]],[\"gov-control-group.cjs\",[[4,\"gov-control-group\",{\"color\":[1],\"noBorder\":[4,\"no-border\"],\"noInnerBorder\":[4,\"no-inner-border\"],\"fitContent\":[4,\"fit-content\"]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-cookiebar.cjs\",[[4,\"gov-cookiebar\"]]],[\"gov-dropdown.cjs\",[[4,\"gov-dropdown\",{\"identifier\":[1],\"open\":[1028],\"position\":[1],\"getState\":[64],\"toggle\":[64]},null,{\"open\":[\"watchOpen\"]}]]],[\"gov-empty.cjs\",[[4,\"gov-empty\",{\"size\":[1],\"direction\":[1],\"align\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-error-code.cjs\",[[4,\"gov-error-code\"]]],[\"gov-form-checkbox-group.cjs\",[[4,\"gov-form-checkbox-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-control.cjs\",[[4,\"gov-form-control\",{\"identifier\":[1],\"invalid\":[516],\"disabled\":[516],\"success\":[516],\"fieldset\":[4],\"size\":[1]}]]],[\"gov-form-group.cjs\",[[4,\"gov-form-group\",{\"gap\":[1],\"orientation\":[1]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-label.cjs\",[[4,\"gov-form-label\",{\"identifier\":[1],\"size\":[1],\"required\":[4],\"legend\":[4]}]]],[\"gov-form-password-power.cjs\",[[4,\"gov-form-password-power\",{\"power\":[514]}]]],[\"gov-form-radio.cjs\",[[4,\"gov-form-radio\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-radio-group.cjs\",[[4,\"gov-form-radio-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-search.cjs\",[[4,\"gov-form-search\",{\"size\":[1],\"color\":[513]}]]],[\"gov-grid.cjs\",[[4,\"gov-grid\",{\"alignItems\":[513,\"align-items\"],\"justifyItems\":[513,\"justify-items\"],\"gap\":[513]}]]],[\"gov-grid-item.cjs\",[[4,\"gov-grid-item\",{\"column\":[1,\"col-span\"],\"columnSm\":[1,\"col-span-sm\"],\"columnMd\":[1,\"col-span-md\"],\"columnLg\":[1,\"col-span-lg\"],\"columnXl\":[1,\"col-span-xl\"],\"row\":[1,\"row-span\"],\"rowSm\":[1,\"row-span-sm\"],\"rowMd\":[1,\"row-span-md\"],\"rowLg\":[1,\"row-span-lg\"],\"rowXl\":[1,\"row-span-xl\"]}]]],[\"gov-layout.cjs\",[[4,\"gov-layout\",{\"type\":[1],\"variant\":[1],\"inverse\":[4]}]]],[\"gov-layout-column.cjs\",[[4,\"gov-layout-column\"]]],[\"gov-lifecycle.cjs\",[[0,\"gov-lifecycle\"]]],[\"gov-message.cjs\",[[4,\"gov-message\",{\"color\":[1],\"type\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-spacer.cjs\",[[0,\"gov-spacer\",{\"size\":[1],\"breakpoint\":[1]},null,{\"size\":[\"validateSize\"],\"breakpoint\":[\"validateBreakpoint\"]}]]],[\"gov-stepper.cjs\",[[4,\"gov-stepper\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-stepper-item.cjs\",[[4,\"gov-stepper-item\",{\"color\":[1],\"size\":[1],\"identifier\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-tabs-item.cjs\",[[4,\"gov-tabs-item\",{\"identifier\":[1],\"triggerIdentifier\":[1,\"trigger-identifier\"],\"label\":[513],\"disabled\":[516],\"iconStart\":[513,\"icon-start\"],\"iconEnd\":[513,\"icon-end\"],\"default\":[4],\"isActive\":[32],\"getIdentifier\":[64],\"getTriggerIdentifier\":[64],\"getDisableState\":[64],\"setActiveStatus\":[64]},null,{\"label\":[\"rerenderParent\"],\"disabled\":[\"rerenderParent\"]}]]],[\"gov-wizard.cjs\",[[4,\"gov-wizard\",{\"size\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-flex_3.cjs\",[[0,\"gov-theme-switch\",{\"size\":[1],\"displayLabel\":[4,\"display-label\"],\"ariaLabelLight\":[1,\"aria-label-light\"],\"ariaLabelDark\":[1,\"aria-label-dark\"],\"labelLight\":[1,\"label-light\"],\"labelDark\":[1,\"label-dark\"],\"theme\":[32]},null,{\"size\":[\"validateSize\"],\"theme\":[\"watchTheme\"]}],[4,\"gov-flex\",{\"direction\":[513],\"justifyContent\":[513,\"justify-content\"],\"alignItems\":[513,\"align-items\"],\"wrap\":[513],\"alignContent\":[513,\"align-content\"],\"alignSelf\":[513,\"align-self\"],\"gap\":[513],\"responsive\":[513]}],[0,\"gov-icon\",{\"size\":[513],\"color\":[513],\"name\":[513],\"type\":[513],\"visible\":[32],\"error\":[32]},null,{\"size\":[\"validateSize\"],\"color\":[\"validateColor\"],\"name\":[\"loadIconPathData\"]}]]],[\"gov-form-autocomplete.cjs\",[[4,\"gov-form-autocomplete\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"success\":[4],\"size\":[1],\"nameKey\":[1,\"name-key\"],\"name\":[1],\"required\":[4],\"disabled\":[516],\"placeholder\":[1],\"readonly\":[4],\"invalid\":[4],\"minlength\":[2],\"maxlength\":[2],\"throttleTime\":[2,\"throttle-time\"],\"messageEmpty\":[1,\"message-empty\"],\"focused\":[32],\"processing\":[32],\"arrowCounter\":[32],\"list\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setBlur\":[64],\"setOptions\":[64],\"clearValue\":[64],\"setProcessing\":[64],\"setSearchCallback\":[64],\"setTemplateResolver\":[64]},null,{\"size\":[\"validateSize\"],\"options\":[\"watchOptions\"]}]]],[\"gov-chip.cjs\",[[4,\"gov-chip\",{\"disabled\":[516],\"href\":[1],\"target\":[1],\"iconStart\":[1,\"icon-start\"],\"iconEnd\":[1,\"icon-end\"],\"size\":[1],\"tag\":[1],\"color\":[1],\"type\":[513],\"focusable\":[4],\"identifier\":[1],\"inheritedAttributes\":[32],\"geRef\":[64],\"setFocus\":[64]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-form-select.cjs\",[[4,\"gov-form-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"size\":[1],\"name\":[1],\"required\":[4],\"success\":[516],\"disabled\":[516],\"invalid\":[4],\"focused\":[32],\"optionsState\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"options\":[\"watchOptions\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"],\"value\":[\"watchValue\"]}]]],[\"gov-backdrop.cjs\",[[0,\"gov-backdrop\",{\"inverse\":[4],\"disabled\":[1540],\"accessibleLabel\":[1,\"accessible-label\"],\"accessibleLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-button.cjs\",[[4,\"gov-button\",{\"color\":[513],\"size\":[513],\"type\":[513],\"expanded\":[516],\"expandedMobile\":[516,\"expanded-mobile\"],\"name\":[1],\"disabled\":[516],\"nativeType\":[1,\"native-type\"],\"href\":[1],\"target\":[1],\"download\":[4],\"tab\":[2],\"hreflang\":[1],\"referrerpolicy\":[1],\"rel\":[1],\"loading\":[1],\"focusable\":[4],\"identifier\":[1],\"inheritedAttributes\":[32],\"setFocus\":[64],\"getRef\":[64],\"validateAccessibility\":[64]},null,{\"color\":[\"validateColor\"],\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"nativeType\":[\"validateNativeType\"]}]]],[\"gov-tooltip_2.cjs\",[[4,\"gov-tooltip-content\",{\"color\":[1],\"size\":[1],\"persist\":[4],\"isVisible\":[1028,\"is-visible\"],\"parentId\":[1,\"parent-id\"]},null,{\"isVisible\":[\"visibleContent\"]}],[4,\"gov-tooltip\",{\"color\":[1],\"size\":[1],\"position\":[1025],\"message\":[1],\"identifier\":[1],\"icon\":[516],\"persist\":[32],\"show\":[64],\"hide\":[64]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"],\"position\":[\"validatePosition\"],\"message\":[\"rerenderMessage\"]}]]],[\"gov-attachments_3.cjs\",[[4,\"gov-attachments-item\",{\"accessibleRemoveLabel\":[1,\"accessible-remove-label\"],\"accessibleRemoveLabelledBy\":[1,\"accessible-remove-labelledby\"],\"validateAccessibility\":[64]}],[4,\"gov-attachments\",{\"label\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]}],[4,\"gov-form-message\",{\"color\":[1],\"size\":[1],\"identifier\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-form-input_2.cjs\",[[0,\"gov-skeleton\",{\"size\":[513],\"color\":[1],\"shape\":[1],\"width\":[513],\"height\":[513],\"animation\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"],\"shape\":[\"validateShape\"],\"animation\":[\"validateAnimation\"]}],[4,\"gov-form-input\",{\"value\":[1537],\"identifier\":[1],\"success\":[516],\"size\":[1],\"name\":[1],\"multiline\":[4],\"rows\":[2],\"cols\":[2],\"required\":[516],\"disabled\":[516],\"placeholder\":[1],\"readonly\":[4],\"minlength\":[2],\"maxlength\":[2],\"min\":[8],\"max\":[8],\"autocomplete\":[4],\"autocorrect\":[4],\"spellcheck\":[4],\"inputLang\":[1,\"input-lang\"],\"type\":[1],\"inputType\":[1,\"input-type\"],\"role\":[1],\"invalid\":[516],\"accessibleShowPasswordLabel\":[1,\"accessible-show-password-label\"],\"accessibleHidePasswordLabel\":[1,\"accessible-hide-password-label\"],\"focused\":[32],\"showPassword\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]]]"), options);
|
|
9
|
+
return index.bootstrapLazy(JSON.parse("[[\"gov-form-file.cjs\",[[4,\"gov-form-file\",{\"expanded\":[4],\"required\":[4],\"disabled\":[516],\"resetAfterPick\":[4,\"reset-after-pick\"],\"ignoreFileDuplicationCheck\":[4,\"ignore-file-duplication-check\"],\"displayAttachments\":[4,\"display-attachments\"],\"name\":[1],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"identifier\":[1],\"invalid\":[4],\"errorSize\":[1,\"error-size\"],\"errorAccept\":[1,\"error-accept\"],\"accessibleAttachmentsLabel\":[1,\"accessible-attachments-label\"],\"files\":[32],\"inheritedAttributes\":[32],\"getRef\":[64],\"getAreaRef\":[64],\"reset\":[64]},null,{\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-multi-select.cjs\",[[4,\"gov-form-multi-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"placeholder\":[1],\"size\":[1],\"name\":[1],\"hideSelectedList\":[4,\"hide-selected-list\"],\"required\":[4],\"disabled\":[516],\"invalid\":[516],\"success\":[4],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"focused\":[32],\"valueState\":[32],\"selectedOptionsState\":[32],\"optionsState\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\"],\"options\":[\"watchOptions\"],\"value\":[\"watchValue\"]}]]],[\"gov-dialog.cjs\",[[4,\"gov-dialog\",{\"open\":[1540],\"blockClose\":[4,\"block-close\"],\"blockBackdropClose\":[4,\"block-backdrop-close\"],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"accessibleLabelledBy\":[1,\"accessible-labelled-by\"],\"accessibleDescribedBy\":[1,\"accessible-described-by\"],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"accessibleCloseLabelledBy\":[1,\"accessible-close-labelled-by\"],\"setFocus\":[64],\"validateAccessibility\":[64]},null,{\"open\":[\"watchOpen\"]}]]],[\"gov-form-range.cjs\",[[4,\"gov-form-range\",{\"size\":[1],\"value\":[1537],\"identifier\":[1],\"name\":[1],\"min\":[8],\"max\":[8],\"step\":[8],\"tooltip\":[4],\"input\":[4],\"listIdentifier\":[1,\"list-identifier\"],\"required\":[516],\"success\":[516],\"invalid\":[516],\"disabled\":[516],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"value\":[\"watchValue\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]],[\"gov-pagination.cjs\",[[0,\"gov-pagination\",{\"type\":[1],\"current\":[2],\"total\":[2],\"selectIdentifier\":[1,\"select-identifier\"],\"size\":[1],\"color\":[1],\"pageSize\":[2,\"page-size\"],\"maxPages\":[2,\"max-pages\"],\"link\":[1],\"accessibleSelectLabel\":[1,\"accessible-select-label\"],\"accessiblePageLabel\":[1,\"accessible-page-label\"],\"labelPrev\":[1,\"label-prev\"],\"labelStart\":[1,\"label-start\"],\"labelNext\":[1,\"label-next\"],\"labelEnd\":[1,\"label-end\"],\"pagination\":[32],\"inheritedAttributes\":[32]},null,{\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"color\":[\"validateColor\"],\"current\":[\"recalculate\"],\"total\":[\"recalculate\"],\"pageSize\":[\"recalculate\"],\"maxPages\":[\"recalculate\"]}]]],[\"gov-breadcrumbs.cjs\",[[4,\"gov-breadcrumbs\",{\"collapsible\":[4],\"isExpanded\":[4,\"is-expanded\"],\"accessibleLabel\":[1,\"accessible-label\"],\"accessibleLabelledBy\":[1,\"accessible-labelledby\"],\"accessibleToggleLabel\":[1,\"accessible-toggle-label\"],\"expanded\":[32],\"toggleOption\":[32],\"validateAccessibility\":[64]}]]],[\"gov-collapsible.cjs\",[[4,\"gov-collapsible\",{\"size\":[1],\"identifier\":[1],\"label\":[1],\"disabled\":[4],\"open\":[1028],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-infobar.cjs\",[[4,\"gov-infobar\",{\"color\":[1],\"type\":[1],\"role\":[1],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"accessibleToggleLabel\":[1,\"accessible-toggle-label\"],\"closable\":[4],\"toggleContent\":[32],\"inheritedAttributes\":[32]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-loading.cjs\",[[4,\"gov-loading\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tabs.cjs\",[[4,\"gov-tabs\",{\"type\":[1],\"size\":[1],\"color\":[1],\"orientation\":[1],\"direction\":[513],\"controllers\":[32],\"focusIndex\":[32],\"inheritedAttributes\":[32],\"refresh\":[64],\"currentTab\":[64],\"setActiveTab\":[64],\"rerender\":[64]},null,{\"type\":[\"validateType\"],\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-toast.cjs\",[[4,\"gov-toast\",{\"color\":[1],\"gravity\":[1],\"position\":[1],\"type\":[1],\"time\":[2],\"closeLabel\":[1,\"close-label\"],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"inheritedAttributes\":[32],\"destroy\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-accordion-item.cjs\",[[4,\"gov-accordion-item\",{\"identifier\":[1],\"size\":[1025],\"disabled\":[4],\"open\":[1028],\"openState\":[32],\"toggle\":[64],\"currentState\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-blockquote.cjs\",[[4,\"gov-blockquote\",{\"type\":[513],\"cite\":[1]}]]],[\"gov-card.cjs\",[[4,\"gov-card\",{\"direction\":[1],\"collapsible\":[4],\"clickable\":[4],\"open\":[1540],\"href\":[513],\"target\":[1],\"accessibleTriggerLabel\":[1,\"accessible-label\"],\"accessibleTriggerLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-form-checkbox.cjs\",[[4,\"gov-form-checkbox\",{\"value\":[1],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"indeterminate\":[516],\"name\":[1],\"size\":[513],\"identifier\":[1],\"noLabel\":[4,\"no-label\"],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-switch.cjs\",[[4,\"gov-form-switch\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"name\":[1],\"size\":[513],\"identifier\":[1],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchDisabled\"],\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"]}]]],[\"gov-link.cjs\",[[4,\"gov-link\",{\"size\":[1],\"external\":[4],\"truncate\":[4],\"href\":[1],\"target\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tag.cjs\",[[4,\"gov-tag\",{\"iconStart\":[1,\"icon-start\"],\"iconEnd\":[1,\"icon-end\"],\"size\":[513],\"color\":[513],\"type\":[513],\"expanded\":[516]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-tile.cjs\",[[4,\"gov-tile\",{\"size\":[513],\"orientation\":[1],\"noBorder\":[4,\"no-border\"],\"href\":[513],\"target\":[1],\"getTriggerRef\":[64]}]]],[\"gov-wizard-item.cjs\",[[4,\"gov-wizard-item\",{\"color\":[1],\"size\":[1],\"identifier\":[1],\"collapsible\":[4],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-accordion.cjs\",[[4,\"gov-accordion\",{\"size\":[1],\"noBorder\":[4,\"no-border\"]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-banner.cjs\",[[4,\"gov-banner\",{\"size\":[513],\"background\":[1],\"foreground\":[1],\"textColor\":[1,\"text-color\"]},null,{\"size\":[\"validateSize\"],\"background\":[\"validateBackground\"],\"foreground\":[\"validateForeground\"],\"text-color\":[\"validateTextColor\"]}]]],[\"gov-container.cjs\",[[4,\"gov-container\"]]],[\"gov-control-group.cjs\",[[4,\"gov-control-group\",{\"color\":[1],\"noBorder\":[4,\"no-border\"],\"noInnerBorder\":[4,\"no-inner-border\"],\"fitContent\":[4,\"fit-content\"]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-cookiebar.cjs\",[[4,\"gov-cookiebar\"]]],[\"gov-dropdown.cjs\",[[4,\"gov-dropdown\",{\"identifier\":[1],\"open\":[1028],\"position\":[1],\"getState\":[64],\"toggle\":[64]},null,{\"open\":[\"watchOpen\"]}]]],[\"gov-empty.cjs\",[[4,\"gov-empty\",{\"size\":[1],\"direction\":[1],\"align\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-error-code.cjs\",[[4,\"gov-error-code\"]]],[\"gov-form-checkbox-group.cjs\",[[4,\"gov-form-checkbox-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-control.cjs\",[[4,\"gov-form-control\",{\"identifier\":[1],\"invalid\":[516],\"disabled\":[516],\"success\":[516],\"fieldset\":[4],\"size\":[1]}]]],[\"gov-form-group.cjs\",[[4,\"gov-form-group\",{\"gap\":[1],\"orientation\":[1]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-label.cjs\",[[4,\"gov-form-label\",{\"identifier\":[1],\"size\":[1],\"required\":[4],\"legend\":[4]}]]],[\"gov-form-password-power.cjs\",[[4,\"gov-form-password-power\",{\"power\":[514]}]]],[\"gov-form-radio.cjs\",[[4,\"gov-form-radio\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-radio-group.cjs\",[[4,\"gov-form-radio-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-search.cjs\",[[4,\"gov-form-search\",{\"size\":[513],\"color\":[513]}]]],[\"gov-grid.cjs\",[[4,\"gov-grid\",{\"alignItems\":[513,\"align-items\"],\"justifyItems\":[513,\"justify-items\"],\"gap\":[513]}]]],[\"gov-grid-item.cjs\",[[4,\"gov-grid-item\",{\"column\":[1,\"col-span\"],\"columnSm\":[1,\"col-span-sm\"],\"columnMd\":[1,\"col-span-md\"],\"columnLg\":[1,\"col-span-lg\"],\"columnXl\":[1,\"col-span-xl\"],\"row\":[1,\"row-span\"],\"rowSm\":[1,\"row-span-sm\"],\"rowMd\":[1,\"row-span-md\"],\"rowLg\":[1,\"row-span-lg\"],\"rowXl\":[1,\"row-span-xl\"]}]]],[\"gov-layout.cjs\",[[4,\"gov-layout\",{\"type\":[1],\"variant\":[1],\"inverse\":[4]}]]],[\"gov-layout-column.cjs\",[[4,\"gov-layout-column\"]]],[\"gov-lifecycle.cjs\",[[0,\"gov-lifecycle\"]]],[\"gov-message.cjs\",[[4,\"gov-message\",{\"color\":[1],\"type\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-spacer.cjs\",[[0,\"gov-spacer\",{\"size\":[1],\"breakpoint\":[1]},null,{\"size\":[\"validateSize\"],\"breakpoint\":[\"validateBreakpoint\"]}]]],[\"gov-stepper.cjs\",[[4,\"gov-stepper\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-stepper-item.cjs\",[[4,\"gov-stepper-item\",{\"color\":[1],\"size\":[1],\"identifier\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-tabs-item.cjs\",[[4,\"gov-tabs-item\",{\"identifier\":[1],\"triggerIdentifier\":[1,\"trigger-identifier\"],\"label\":[513],\"disabled\":[516],\"iconStart\":[513,\"icon-start\"],\"iconEnd\":[513,\"icon-end\"],\"default\":[4],\"isActive\":[32],\"getIdentifier\":[64],\"getTriggerIdentifier\":[64],\"getDisableState\":[64],\"setActiveStatus\":[64]},null,{\"label\":[\"rerenderParent\"],\"disabled\":[\"rerenderParent\"]}]]],[\"gov-wizard.cjs\",[[4,\"gov-wizard\",{\"size\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-flex_3.cjs\",[[0,\"gov-theme-switch\",{\"size\":[1],\"displayLabel\":[4,\"display-label\"],\"ariaLabelLight\":[1,\"aria-label-light\"],\"ariaLabelDark\":[1,\"aria-label-dark\"],\"labelLight\":[1,\"label-light\"],\"labelDark\":[1,\"label-dark\"],\"theme\":[32]},null,{\"size\":[\"validateSize\"],\"theme\":[\"watchTheme\"]}],[4,\"gov-flex\",{\"direction\":[513],\"justifyContent\":[513,\"justify-content\"],\"alignItems\":[513,\"align-items\"],\"wrap\":[513],\"alignContent\":[513,\"align-content\"],\"alignSelf\":[513,\"align-self\"],\"gap\":[513],\"responsive\":[513]}],[0,\"gov-icon\",{\"size\":[513],\"color\":[513],\"name\":[513],\"type\":[513],\"visible\":[32],\"error\":[32]},null,{\"size\":[\"validateSize\"],\"color\":[\"validateColor\"],\"name\":[\"loadIconPathData\"]}]]],[\"gov-form-autocomplete.cjs\",[[4,\"gov-form-autocomplete\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"success\":[4],\"size\":[1],\"nameKey\":[1,\"name-key\"],\"name\":[1],\"required\":[4],\"disabled\":[516],\"placeholder\":[1],\"readonly\":[4],\"invalid\":[4],\"minlength\":[2],\"maxlength\":[2],\"maxOptions\":[2,\"max-options\"],\"throttleTime\":[2,\"throttle-time\"],\"messageEmpty\":[1,\"message-empty\"],\"focused\":[32],\"processing\":[32],\"arrowCounter\":[32],\"list\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setBlur\":[64],\"setOptions\":[64],\"clearValue\":[64],\"setProcessing\":[64],\"setSearchCallback\":[64],\"setTemplateResolver\":[64]},null,{\"size\":[\"validateSize\"],\"options\":[\"watchOptions\"],\"throttleTime\":[\"watchThrottleTime\"]}]]],[\"gov-chip.cjs\",[[4,\"gov-chip\",{\"disabled\":[516],\"href\":[1],\"target\":[1],\"iconStart\":[1,\"icon-start\"],\"iconEnd\":[1,\"icon-end\"],\"size\":[1],\"tag\":[1],\"color\":[1],\"type\":[513],\"focusable\":[4],\"identifier\":[1],\"inheritedAttributes\":[32],\"geRef\":[64],\"setFocus\":[64]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-form-select.cjs\",[[4,\"gov-form-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"size\":[1],\"name\":[1],\"required\":[4],\"success\":[516],\"disabled\":[516],\"invalid\":[4],\"focused\":[32],\"optionsState\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"options\":[\"watchOptions\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"],\"value\":[\"watchValue\"]}]]],[\"gov-backdrop.cjs\",[[0,\"gov-backdrop\",{\"inverse\":[4],\"disabled\":[1540],\"accessibleLabel\":[1,\"accessible-label\"],\"accessibleLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-button.cjs\",[[4,\"gov-button\",{\"color\":[513],\"size\":[513],\"type\":[513],\"expanded\":[516],\"expandedMobile\":[516,\"expanded-mobile\"],\"name\":[1],\"disabled\":[516],\"nativeType\":[1,\"native-type\"],\"href\":[1],\"target\":[1],\"download\":[4],\"tab\":[2],\"hreflang\":[1],\"referrerpolicy\":[1],\"rel\":[1],\"loading\":[1],\"focusable\":[4],\"identifier\":[1],\"inheritedAttributes\":[32],\"setFocus\":[64],\"getRef\":[64],\"validateAccessibility\":[64]},null,{\"color\":[\"validateColor\"],\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"nativeType\":[\"validateNativeType\"]}]]],[\"gov-tooltip_2.cjs\",[[4,\"gov-tooltip-content\",{\"color\":[1],\"size\":[1],\"persist\":[4],\"isVisible\":[1028,\"is-visible\"],\"parentId\":[1,\"parent-id\"],\"message\":[1025]},null,{\"isVisible\":[\"visibleContent\"]}],[4,\"gov-tooltip\",{\"color\":[1],\"size\":[1],\"position\":[1025],\"message\":[1],\"identifier\":[1],\"icon\":[516],\"persist\":[32],\"show\":[64],\"hide\":[64]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"],\"position\":[\"validatePosition\"],\"message\":[\"rerenderMessage\"]}]]],[\"gov-attachments_3.cjs\",[[4,\"gov-attachments-item\",{\"accessibleRemoveLabel\":[1,\"accessible-remove-label\"],\"accessibleRemoveLabelledBy\":[1,\"accessible-remove-labelledby\"],\"validateAccessibility\":[64]}],[4,\"gov-attachments\",{\"label\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]}],[4,\"gov-form-message\",{\"color\":[1],\"size\":[1],\"identifier\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-form-input_2.cjs\",[[0,\"gov-skeleton\",{\"size\":[513],\"color\":[1],\"shape\":[1],\"width\":[513],\"height\":[513],\"animation\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"],\"shape\":[\"validateShape\"],\"animation\":[\"validateAnimation\"]}],[4,\"gov-form-input\",{\"value\":[1537],\"identifier\":[1],\"success\":[516],\"size\":[1],\"name\":[1],\"multiline\":[4],\"rows\":[2],\"cols\":[2],\"required\":[516],\"disabled\":[516],\"placeholder\":[1],\"readonly\":[4],\"minlength\":[2],\"maxlength\":[2],\"min\":[8],\"max\":[8],\"autocomplete\":[4],\"autocorrect\":[4],\"spellcheck\":[4],\"inputLang\":[1,\"input-lang\"],\"type\":[1],\"inputType\":[1,\"input-type\"],\"role\":[1],\"invalid\":[516],\"accessibleShowPasswordLabel\":[1,\"accessible-show-password-label\"],\"accessibleHidePasswordLabel\":[1,\"accessible-hide-password-label\"],\"focused\":[32],\"showPassword\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]]]"), options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -15,7 +15,7 @@ export class GovBanner {
|
|
|
15
15
|
/**
|
|
16
16
|
* Banner’s foreground
|
|
17
17
|
*/
|
|
18
|
-
this.foreground = BannerForeground.
|
|
18
|
+
this.foreground = BannerForeground.IMAGE;
|
|
19
19
|
/**
|
|
20
20
|
* XL Banner’s text color
|
|
21
21
|
*/
|
|
@@ -41,10 +41,10 @@ export class GovBanner {
|
|
|
41
41
|
this.validateTextColor(this.textColor);
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (h(Host, Object.assign({ key: '
|
|
44
|
+
return (h(Host, Object.assign({ key: '142c906194083f6c186d1f1d9033c4f2c9be9bff', class: this.h.classes(BannerClass.root), role: "region", size: this.size }, (this.size !== "xl" ? {
|
|
45
45
|
background: this.background,
|
|
46
46
|
foreground: this.foreground
|
|
47
|
-
} : { 'text-color': this.textColor })), h("div", { key: '
|
|
47
|
+
} : { 'text-color': this.textColor })), h("div", { key: '0b52a8859b6cdcd92d0f5e97b460a3e0a899bd44' }, h("div", { key: 'a36ed5ad57c878d70770ccfeccd172749a555b22', class: BannerClass.content }, h("slot", { key: '57f52bfb0189450e77c00f4d9904712e555a3125', name: "headline" }), h("slot", { key: '91629f1bf0605ae28d694d044d19bbef9ebb69da' })), this.h.hasSlot('button') && (h("slot", { key: '458a59c73e9bdf02d6cdb1e8c5caea0dcfec526a', name: "button" }))), h("slot", { key: 'f1d60077313455ed78c78b56c7741b4b593cf7cc', name: "image" })));
|
|
48
48
|
}
|
|
49
49
|
static get is() { return "gov-banner"; }
|
|
50
50
|
static get properties() {
|
|
@@ -125,7 +125,7 @@ export class GovBanner {
|
|
|
125
125
|
"getter": false,
|
|
126
126
|
"setter": false,
|
|
127
127
|
"reflect": false,
|
|
128
|
-
"defaultValue": "BannerForeground.
|
|
128
|
+
"defaultValue": "BannerForeground.IMAGE"
|
|
129
129
|
},
|
|
130
130
|
"textColor": {
|
|
131
131
|
"type": "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-banner.js","sourceRoot":"","sources":["../../../../../../src/components/gov-banner/gov-banner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAA;AAElD,OAAO,EACH,gBAAgB,EAEhB,WAAW,EACX,gBAAgB,EAEhB,WAAW,EAEX,eAAe,EAElB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAK1D,MAAM,OAAO,SAAS;IAGlB;QAKA;;WAEG;QAC6B,SAAI,GAAoB,WAAW,CAAC,EAAE,CAAA;QACtE;;WAEG;QACc,eAAU,GAA0B,gBAAgB,CAAC,MAAM,CAAA;QAC5E;;WAEG;QACc,eAAU,GAA0B,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"gov-banner.js","sourceRoot":"","sources":["../../../../../../src/components/gov-banner/gov-banner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,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C,CAAA;QACxC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC1C,CAAC;IAED,MAAM;QACF,OAAO,CACH,EAAC,IAAI,mEAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EACvC,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,IAAI,CAAC,IAAI,IACX,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC;YACtB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;SAC9B,CAAC,CAAC,CAAC,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAC,CAAC;YACrC;gBACI,4DAAK,KAAK,EAAE,WAAW,CAAC,OAAO;oBAC3B,6DAAM,IAAI,EAAC,UAAU,GAAE;oBACvB,8DAAO,CACL;gBACL,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CACzB,6DAAM,IAAI,EAAC,QAAQ,GAAE,CACxB,CACC;YACN,6DAAM,IAAI,EAAC,OAAO,GAAE,CACjB,CACV,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {Component, Element, h, Host, Prop, Watch} from '@stencil/core'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {\n BannerBackground,\n BannerBackgroundsType,\n BannerClass,\n BannerForeground,\n BannerForegroundsType,\n BannerSizes,\n BannerSizesType,\n BannerTextColor,\n BannerTextColorsType\n} from \"./constants\";\nimport {validateProp} from \"../../helpers/Validate/props\";\n\n@Component({\n tag: 'gov-banner',\n})\nexport class GovBanner {\n private h: GovHost\n\n constructor() {\n this.h = govHost(this.host)\n }\n\n @Element() host: HTMLGovBannerElement\n /**\n * Banner’s size.\n */\n @Prop({reflect: true}) readonly size: BannerSizesType = BannerSizes._M\n /**\n * Banner’s background\n */\n @Prop() readonly background: BannerBackgroundsType = BannerBackground.SIMPLE\n /**\n * Banner’s foreground\n */\n @Prop() readonly foreground: BannerForegroundsType = BannerForeground.IMAGE\n /**\n * XL Banner’s text color\n */\n @Prop({attribute: 'text-color'}) readonly textColor: BannerTextColorsType = BannerTextColor.LIGHT\n\n @Watch('size')\n validateSize(newValue: string): void {\n validateProp(BannerSizes, newValue, BannerClass.root)\n }\n\n @Watch('background')\n validateBackground(newValue: string): void {\n validateProp(BannerBackground, newValue, BannerClass.root)\n }\n\n @Watch('foreground')\n validateForeground(newValue: string): void {\n validateProp(BannerForeground, newValue, BannerClass.root)\n }\n\n @Watch('text-color')\n validateTextColor(newValue: string): void {\n validateProp(BannerTextColor, newValue, BannerClass.root)\n }\n\n componentWillLoad(): void {\n this.validateSize(this.size)\n this.validateBackground(this.background)\n this.validateForeground(this.foreground)\n this.validateTextColor(this.textColor)\n }\n\n render() {\n return (\n <Host class={this.h.classes(BannerClass.root)}\n role=\"region\"\n size={this.size}\n {...(this.size !== \"xl\" ? {\n background: this.background,\n foreground: this.foreground\n } : {'text-color': this.textColor})}>\n <div>\n <div class={BannerClass.content}>\n <slot name=\"headline\"/>\n <slot/>\n </div>\n {this.h.hasSlot('button') && (\n <slot name=\"button\"/>\n )}\n </div>\n <slot name=\"image\"/>\n </Host>\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { removeDiacritics } from "../../../utils/string.utils";
|
|
2
|
+
const normalize = (value) => typeof value === 'string' ? removeDiacritics(value).toLowerCase() : '';
|
|
3
|
+
export const filterAutocompleteOptions = (options, query, nameKey, maxOptions) => {
|
|
4
|
+
const source = Array.isArray(options) ? options : [];
|
|
5
|
+
const normalizedQuery = normalize(query);
|
|
6
|
+
const matches = normalizedQuery.length === 0
|
|
7
|
+
? source
|
|
8
|
+
: source.filter(item => {
|
|
9
|
+
const text = item === null || item === void 0 ? void 0 : item[nameKey];
|
|
10
|
+
return typeof text === 'string' && normalize(text).includes(normalizedQuery);
|
|
11
|
+
});
|
|
12
|
+
return Number.isInteger(maxOptions) && maxOptions > 0 ? matches.slice(0, maxOptions) : matches;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=autocomplete.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autocomplete.utils.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/autocomplete/autocomplete.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAG9D,MAAM,SAAS,GAAG,CAAC,KAAc,EAAU,EAAE,CAC5C,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;AAEvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACxC,OAAkC,EAClC,KAAa,EACb,OAAe,EACf,UAAkB,EACU,EAAE;IAC9B,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA;IACpD,MAAM,eAAe,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;IACxC,MAAM,OAAO,GACZ,eAAe,CAAC,MAAM,KAAK,CAAC;QAC3B,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACrB,MAAM,IAAI,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAG,OAAO,CAAC,CAAA;YAC5B,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;QAC7E,CAAC,CAAC,CAAA;IACL,OAAO,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;AAC/F,CAAC,CAAA","sourcesContent":["import { removeDiacritics } from '../../../utils/string.utils'\nimport { GovFormAutocompleteItem } from './gov-form-autocomplete.types'\n\nconst normalize = (value: unknown): string =>\n\ttypeof value === 'string' ? removeDiacritics(value).toLowerCase() : ''\n\nexport const filterAutocompleteOptions = (\n\toptions: GovFormAutocompleteItem[],\n\tquery: string,\n\tnameKey: string,\n\tmaxOptions: number,\n): GovFormAutocompleteItem[] => {\n\tconst source = Array.isArray(options) ? options : []\n\tconst normalizedQuery = normalize(query)\n\tconst matches =\n\t\tnormalizedQuery.length === 0\n\t\t\t? source\n\t\t\t: source.filter(item => {\n\t\t\t\t\tconst text = item?.[nameKey]\n\t\t\t\t\treturn typeof text === 'string' && normalize(text).includes(normalizedQuery)\n\t\t\t\t})\n\treturn Number.isInteger(maxOptions) && maxOptions > 0 ? matches.slice(0, maxOptions) : matches\n}\n"]}
|
|
@@ -5,11 +5,13 @@ import { createID } from "../../../utils/string.utils";
|
|
|
5
5
|
import { delay, has, throttle } from "../../../utils/utils";
|
|
6
6
|
import { FormAutocompleteClass, FormAutocompleteSizes, } from "./constants";
|
|
7
7
|
import { propsValueToArray } from "../../../utils/array.utils";
|
|
8
|
+
import { filterAutocompleteOptions } from "./autocomplete.utils";
|
|
8
9
|
import { AttributeObserver } from "../../../helpers/Dom/attribute";
|
|
9
10
|
import { ariaAttributes } from "../../../helpers/Accessibility/attributes";
|
|
10
11
|
import { inheritAriaAttributes } from "../../../helpers/Accessibility/accessibility";
|
|
11
12
|
export class GovFormAutocomplete {
|
|
12
13
|
constructor() {
|
|
14
|
+
this.fullOptions = [];
|
|
13
15
|
this.templateResolver = item => item[this.nameKey];
|
|
14
16
|
/**
|
|
15
17
|
* Value of input
|
|
@@ -37,6 +39,11 @@ export class GovFormAutocomplete {
|
|
|
37
39
|
* Minimum length (number of characters) of value
|
|
38
40
|
*/
|
|
39
41
|
this.minlength = 3;
|
|
42
|
+
/**
|
|
43
|
+
* Maximum number of items shown from a static `options` list (0 = unlimited).
|
|
44
|
+
* Applies only when no async search callback is set.
|
|
45
|
+
*/
|
|
46
|
+
this.maxOptions = 10;
|
|
40
47
|
/**
|
|
41
48
|
* Input throttle in milliseconds
|
|
42
49
|
*/
|
|
@@ -49,13 +56,33 @@ export class GovFormAutocomplete {
|
|
|
49
56
|
this.arrowCounter = -1;
|
|
50
57
|
this.list = [];
|
|
51
58
|
this.inheritedAttributes = {};
|
|
59
|
+
this.emitAndSearch = (e) => {
|
|
60
|
+
this.govInput.emit({
|
|
61
|
+
originalEvent: e,
|
|
62
|
+
component: FormAutocompleteClass.root,
|
|
63
|
+
value: this.value,
|
|
64
|
+
selected: null,
|
|
65
|
+
});
|
|
66
|
+
this.doSearch();
|
|
67
|
+
};
|
|
68
|
+
this.onInputHandler = (e) => {
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
this.value = e.detail.value;
|
|
71
|
+
this.debouncedSearch(e);
|
|
72
|
+
};
|
|
52
73
|
this.listBoxId = createID('GovListBox');
|
|
53
74
|
}
|
|
54
75
|
validateSize(newValue) {
|
|
55
76
|
validateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root);
|
|
56
77
|
}
|
|
57
78
|
watchOptions(newValue) {
|
|
58
|
-
this.
|
|
79
|
+
this.fullOptions = propsValueToArray(newValue);
|
|
80
|
+
if (this.searchCallback) {
|
|
81
|
+
this.setOptions(this.fullOptions).catch();
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
this.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions);
|
|
85
|
+
}
|
|
59
86
|
}
|
|
60
87
|
onArrowUp() {
|
|
61
88
|
if (this.arrowCounter > 0) {
|
|
@@ -79,13 +106,13 @@ export class GovFormAutocomplete {
|
|
|
79
106
|
}
|
|
80
107
|
}
|
|
81
108
|
doSearch() {
|
|
82
|
-
if (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {
|
|
83
|
-
this.list = [];
|
|
84
|
-
this.arrowCounter = -1;
|
|
85
|
-
this.processing = false;
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
109
|
if (this.searchCallback) {
|
|
110
|
+
if (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {
|
|
111
|
+
this.list = [];
|
|
112
|
+
this.arrowCounter = -1;
|
|
113
|
+
this.processing = false;
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
89
116
|
this.processing = true;
|
|
90
117
|
this.searchCallback(this.value)
|
|
91
118
|
.then(response => (this.list = response))
|
|
@@ -94,11 +121,13 @@ export class GovFormAutocomplete {
|
|
|
94
121
|
this.arrowCounter = -1;
|
|
95
122
|
this.processing = false;
|
|
96
123
|
});
|
|
124
|
+
return;
|
|
97
125
|
}
|
|
126
|
+
this.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions);
|
|
127
|
+
this.arrowCounter = -1;
|
|
98
128
|
}
|
|
99
129
|
clearList() {
|
|
100
|
-
|
|
101
|
-
if (areOptions.length === 0) {
|
|
130
|
+
if (this.fullOptions.length === 0) {
|
|
102
131
|
this.list = [];
|
|
103
132
|
}
|
|
104
133
|
}
|
|
@@ -119,6 +148,14 @@ export class GovFormAutocomplete {
|
|
|
119
148
|
componentWillLoad() {
|
|
120
149
|
this.validateSize(this.size);
|
|
121
150
|
this.inheritedAttributes = inheritAriaAttributes(this.host);
|
|
151
|
+
this.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime);
|
|
152
|
+
this.fullOptions = propsValueToArray(this.options);
|
|
153
|
+
if (!this.searchCallback) {
|
|
154
|
+
this.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
watchThrottleTime() {
|
|
158
|
+
this.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime);
|
|
122
159
|
}
|
|
123
160
|
disconnectedCallback() {
|
|
124
161
|
var _a;
|
|
@@ -129,7 +166,7 @@ export class GovFormAutocomplete {
|
|
|
129
166
|
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
|
|
130
167
|
}
|
|
131
168
|
render() {
|
|
132
|
-
return (h(Host, { key: '
|
|
169
|
+
return (h(Host, { key: '0cdbf770359115b24432e9d533b4e17ab2c65e18', class: FormAutocompleteClass.root, size: this.size }, h("gov-form-input", Object.assign({ key: '5724ed153e3f2384725badbafdb0c19e67b69538', placeholder: this.placeholder, name: this.name, disabled: this.disabled, readonly: this.readonly, autocomplete: false, size: this.size, required: this.required, invalid: this.invalid, success: this.success, role: 'searchbox', value: this.value, minlength: this.minlength, maxlength: this.maxlength, "on-gov-input": this.onInputHandler, "on-gov-keyup": this.onKeyUpHandler.bind(this), "on-gov-keydown": this.onKeyDownHandler.bind(this), "on-gov-focus": this.onFocusHandler.bind(this), "on-gov-blur": this.onBlurHandler.bind(this) }, this.inheritedAttributes, { "aria-autocomplete": 'list', "aria-owns": [this.listBoxId, this.inheritedAttributes['aria-owns']].join(' '), "aria-expanded": booleanString(this.list.length && this.focused ? true : false), ref: el => (this.inputRef = el) }), h("slot", { key: 'ab6f37982f3d13adc2473a744b5697ac8bc651f5', name: "validation-icon" }), h("slot", { key: '1961a029eceee169b5be12fa4ba8c2e9072bb9de', name: "icon-end" })), h("ul", { key: '61b9b6929be4816e93e1b5fb778c3861b4f8631b', class: FormAutocompleteClass.list, role: 'listbox', "aria-hidden": toBoolAttr(!this.focused), hidden: !this.focused, id: this.listBoxId, ref: el => (this.listRef = el) }, this.focused && this.list.length === 0 && this.processing === false && (this.isValueAccepted || (!this.searchCallback && this.fullOptions.length > 0)) && this.messageEmpty ? (h("li", { class: FormAutocompleteClass.empty }, this.messageEmpty)) : null, this.focused && this.processing === true && this.isValueAccepted ? (h("li", { class: FormAutocompleteClass.loading }, h("gov-skeleton", { size: "m" }))) : null, this.focused ? this.list.map((item, index) => {
|
|
133
170
|
const isSelected = this.arrowCounter === index;
|
|
134
171
|
return (h("li", { class: FormAutocompleteClass.item, innerHTML: this.templateResolver(item, isSelected), role: 'option', "aria-posinset": index, tabindex: isSelected ? 0 : -1, "aria-setsize": this.list.length, onTouchStart: (e) => this.onSelectHandler(e, index), onMouseDown: (e) => this.onSelectHandler(e, index), "aria-selected": toBoolAttr(isSelected) }, h("slot", { name: "list-item-left" }), h("slot", { name: "list-item-right" })));
|
|
135
172
|
}) : null)));
|
|
@@ -137,7 +174,12 @@ export class GovFormAutocomplete {
|
|
|
137
174
|
onFocusHandler(e) {
|
|
138
175
|
this.focused = true;
|
|
139
176
|
this.arrowCounter = -1;
|
|
140
|
-
if (this.
|
|
177
|
+
if (this.searchCallback) {
|
|
178
|
+
if (this.isValueAccepted) {
|
|
179
|
+
this.doSearch();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
141
183
|
this.doSearch();
|
|
142
184
|
}
|
|
143
185
|
e.stopPropagation();
|
|
@@ -160,17 +202,6 @@ export class GovFormAutocomplete {
|
|
|
160
202
|
selected: null,
|
|
161
203
|
});
|
|
162
204
|
}
|
|
163
|
-
onInputHandler(e) {
|
|
164
|
-
this.value = e.target.value;
|
|
165
|
-
e.stopPropagation();
|
|
166
|
-
this.govInput.emit({
|
|
167
|
-
originalEvent: e,
|
|
168
|
-
component: FormAutocompleteClass.root,
|
|
169
|
-
value: this.value,
|
|
170
|
-
selected: null,
|
|
171
|
-
});
|
|
172
|
-
this.doSearch();
|
|
173
|
-
}
|
|
174
205
|
onSelectHandler(e, index = -1) {
|
|
175
206
|
let selected = null;
|
|
176
207
|
if (index > -1) {
|
|
@@ -548,6 +579,26 @@ export class GovFormAutocomplete {
|
|
|
548
579
|
"setter": false,
|
|
549
580
|
"reflect": false
|
|
550
581
|
},
|
|
582
|
+
"maxOptions": {
|
|
583
|
+
"type": "number",
|
|
584
|
+
"attribute": "max-options",
|
|
585
|
+
"mutable": false,
|
|
586
|
+
"complexType": {
|
|
587
|
+
"original": "number",
|
|
588
|
+
"resolved": "number",
|
|
589
|
+
"references": {}
|
|
590
|
+
},
|
|
591
|
+
"required": false,
|
|
592
|
+
"optional": false,
|
|
593
|
+
"docs": {
|
|
594
|
+
"tags": [],
|
|
595
|
+
"text": "Maximum number of items shown from a static `options` list (0 = unlimited).\nApplies only when no async search callback is set."
|
|
596
|
+
},
|
|
597
|
+
"getter": false,
|
|
598
|
+
"setter": false,
|
|
599
|
+
"reflect": false,
|
|
600
|
+
"defaultValue": "10"
|
|
601
|
+
},
|
|
551
602
|
"throttleTime": {
|
|
552
603
|
"type": "number",
|
|
553
604
|
"attribute": "throttle-time",
|
|
@@ -854,6 +905,9 @@ export class GovFormAutocomplete {
|
|
|
854
905
|
}, {
|
|
855
906
|
"propName": "options",
|
|
856
907
|
"methodName": "watchOptions"
|
|
908
|
+
}, {
|
|
909
|
+
"propName": "throttleTime",
|
|
910
|
+
"methodName": "watchThrottleTime"
|
|
857
911
|
}];
|
|
858
912
|
}
|
|
859
913
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-form-autocomplete.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAC,YAAY,EAAC,MAAM,iCAAiC,CAAA;AAE5D,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAA;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {booleanString, toBoolAttr} from '../../../helpers/Dom/template'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID} from '../../../utils/string.utils'\nimport {delay, has, throttle} from '../../../utils/utils'\nimport {FormInputEvent} from '../input/gov-form-input.types'\nimport {FormAutocompleteClass, FormAutocompleteSizes, SizesType,} from './constants'\nimport {FormAutocompleteEvent, GovFormAutocompleteItem} from './gov-form-autocomplete.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: 'gov-form-autocomplete',\n})\nexport class GovFormAutocomplete {\n\tprivate inputRef?: HTMLGovFormInputElement\n\tprivate listRef?: HTMLUListElement\n\tprivate readonly listBoxId: string\n\tprivate searchCallback: (value: string) => Promise<GovFormAutocompleteItem[]>\n\tprivate templateResolver: (item: GovFormAutocompleteItem, selected: boolean) => string = item => item[this.nameKey]\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.listBoxId = createID('GovListBox')\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({reflect: true, mutable: true}) value = ''\n\t/**\n\t * Options of autocomplete\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormAutocompleteItem[]\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\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\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: SizesType = 'm'\n\t/**\n\t * Main key name in the object\n\t */\n\t@Prop({attribute: 'name-key'}) readonly nameKey: string = 'name'\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\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 input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\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 * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number = 3\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Input throttle in milliseconds\n\t */\n\t@Prop() readonly throttleTime: number = 200\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-input'}) govInput: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormAutocompleteEvent>\n\n\t@State() focused: boolean\n\t@State() processing = false\n\t@State() arrowCounter = -1\n\t@State() list: GovFormAutocompleteItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormAutocompleteItem[]): void {\n\t\tthis.setOptions(propsValueToArray(newValue)).catch()\n\t}\n\n\tprivate onArrowUp() {\n\t\tif (this.arrowCounter > 0) {\n\t\t\tthis.arrowCounter = this.arrowCounter - 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate onArrowDown() {\n\t\tif (this.arrowCounter < this.list.length - 1) {\n\t\t\tthis.arrowCounter = this.arrowCounter + 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate async moveToView() {\n\t\tawait delay(200)\n\t\tconst heightOfList = this.listRef.offsetHeight\n\t\tconst selected = this.listRef.querySelector('li[aria-selected=\"true\"]') as HTMLUListElement\n\t\tif (selected && heightOfList) {\n\t\t\tconst offsetTop = selected.offsetTop\n\t\t\tthis.listRef.scrollTo({top: offsetTop, behavior: 'smooth'})\n\t\t}\n\t}\n\n\tprivate doSearch() {\n\t\tif (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {\n\t\t\tthis.list = []\n\t\t\tthis.arrowCounter = -1\n\t\t\tthis.processing = false\n\t\t\treturn\n\t\t}\n\t\tif (this.searchCallback) {\n\t\t\tthis.processing = true\n\t\t\tthis.searchCallback(this.value)\n\t\t\t\t.then(response => (this.list = response))\n\t\t\t\t.catch(() => (this.list = []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.arrowCounter = -1\n\t\t\t\t\tthis.processing = false\n\t\t\t\t})\n\t\t}\n\t}\n\n\tprivate clearList() {\n\t\tconst areOptions = propsValueToArray<GovFormAutocompleteItem[]>(this.options)\n\t\tif (areOptions.length === 0) {\n\t\t\tthis.list = []\n\t\t}\n\t}\n\n\tget isValueAccepted() {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn this.value.length >= this.minlength\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormAutocompleteClass.root} size={this.size}>\n\t\t\t\t<gov-form-input\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\treadonly={this.readonly}\n\t\t\t\t\tautocomplete={false}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\tsuccess={this.success}\n\t\t\t\t\trole={'searchbox'}\n\t\t\t\t\tvalue={this.value}\n\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\ton-gov-input={throttle(this.onInputHandler.bind(this), this.throttleTime)}\n\t\t\t\t\ton-gov-keyup={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\ton-gov-keydown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\ton-gov-focus={this.onFocusHandler.bind(this)}\n\t\t\t\t\ton-gov-blur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-autocomplete={'list'}\n\t\t\t\t\taria-owns={[this.listBoxId, this.inheritedAttributes['aria-owns']].join(' ')}\n\t\t\t\t\taria-expanded={booleanString(this.list.length && this.focused ? true : false)}\n\t\t\t\t\tref={el => (this.inputRef = el as HTMLGovFormInputElement)}\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"validation-icon\" />\n\t\t\t\t\t<slot name=\"icon-end\" />\n\t\t\t\t</gov-form-input>\n\t\t\t\t<ul class={FormAutocompleteClass.list}\n\t\t\t\t\trole={'listbox'}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.focused)}\n\t\t\t\t\thidden={!this.focused}\n\t\t\t\t\tid={this.listBoxId}\n\t\t\t\t\tref={el => (this.listRef = el as HTMLUListElement)}>\n\t\t\t\t\t{this.focused && this.list.length === 0 && this.processing === false && this.isValueAccepted && this.messageEmpty ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.empty}>{this.messageEmpty}</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused && this.processing === true && this.isValueAccepted ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.loading}>\n\t\t\t\t\t\t\t<gov-skeleton size=\"m\"></gov-skeleton>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused ? this.list.map((item, index) => {\n\t\t\t\t\t\tconst isSelected = this.arrowCounter === index\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tclass={FormAutocompleteClass.item}\n\t\t\t\t\t\t\t\tinnerHTML={this.templateResolver(item, isSelected)}\n\t\t\t\t\t\t\t\trole={'option'}\n\t\t\t\t\t\t\t\taria-posinset={index}\n\t\t\t\t\t\t\t\ttabindex={isSelected ? 0 : -1}\n\t\t\t\t\t\t\t\taria-setsize={this.list.length}\n\t\t\t\t\t\t\t\tonTouchStart={(e: TouchEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\tonMouseDown={(e: PointerEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\taria-selected={toBoolAttr(isSelected)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-left\"/>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-right\"/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}) : null}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.arrowCounter = -1\n\t\tif (this.isValueAccepted && this.searchCallback) {\n\t\t\tthis.doSearch()\n\t\t}\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.clearList();\n\t\tthis.arrowCounter = -1\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLGovFormInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t\tthis.doSearch()\n\t}\n\n\tprivate onSelectHandler(e: PointerEvent | CustomEvent | TouchEvent, index = -1) {\n\t\tlet selected: Nullable<GovFormAutocompleteItem> = null\n\t\tif (index > -1) {\n\t\t\tselected = this.list[index]\n\t\t} else if (has(this.arrowCounter, this.list)) {\n\t\t\tselected = this.list[this.arrowCounter]\n\t\t}\n\t\tif (selected) {\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\tselected: selected,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t\tthis.clearList();\n\t\t\tif (has(this.nameKey, selected) && typeof selected[this.nameKey] === 'string') {\n\t\t\t\tthis.value = selected[this.nameKey]\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onKeyUpHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 38) this.onArrowUp()\n\t\telse if (event.keyCode === 40) this.onArrowDown()\n\t\telse if (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t\tthis.onSelectHandler(e)\n\t\t}\n\t}\n\n\tprivate onKeyDownHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t}\n\t}\n\n\t/**\n\t * Focus main input element\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Blur main input element\n\t */\n\t@Method()\n\tasync setBlur(): Promise<void> {\n\t\treturn this.inputRef.blur()\n\t}\n\n\t/**\n\t * Set options for list\n\t */\n\t@Method()\n\tasync setOptions(options: GovFormAutocompleteItem[]): Promise<void> {\n\t\tthis.list = Array.isArray(options) ? options : []\n\t\tthis.arrowCounter = -1\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\n\t\tawait this.inputRef.clearValue()\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync setProcessing(status: boolean): Promise<void> {\n\t\tthis.processing = status\n\t}\n\n\t/**\n\t * Set a custom asynchronous function for the whisperer\n\t */\n\t@Method()\n\tasync setSearchCallback(callback: (value: string) => Promise<any>) {\n\t\tthis.searchCallback = callback\n\t}\n\n\t/**\n\t * Setting a custom whisper result template\n\t * @param callback\n\t */\n\t@Method()\n\tasync setTemplateResolver(callback: (item: GovFormAutocompleteItem) => string) {\n\t\tthis.templateResolver = callback\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gov-form-autocomplete.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAC,YAAY,EAAC,MAAM,iCAAiC,CAAA;AAE5D,OAAO,EAAC,QAAQ,EAAC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,QAAmD;QAC5E,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAA;IACjC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {booleanString, toBoolAttr} from '../../../helpers/Dom/template'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID} from '../../../utils/string.utils'\nimport {delay, has, throttle} from '../../../utils/utils'\nimport {FormInputEvent} from '../input/gov-form-input.types'\nimport {FormAutocompleteClass, FormAutocompleteSizes, SizesType,} from './constants'\nimport {FormAutocompleteEvent, GovFormAutocompleteItem} from './gov-form-autocomplete.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport { filterAutocompleteOptions } from './autocomplete.utils'\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: 'gov-form-autocomplete',\n})\nexport class GovFormAutocomplete {\n\tprivate inputRef?: HTMLGovFormInputElement\n\tprivate listRef?: HTMLUListElement\n\tprivate readonly listBoxId: string\n\tprivate searchCallback: (value: string) => Promise<GovFormAutocompleteItem[]>\n\tprivate fullOptions: GovFormAutocompleteItem[] = []\n\tprivate templateResolver: (item: GovFormAutocompleteItem, selected: boolean) => string = item => item[this.nameKey]\n\tprivate attributeObserver: AttributeObserver\n\tprivate debouncedSearch: (e: CustomEvent<FormInputEvent>) => void\n\n\tconstructor() {\n\t\tthis.listBoxId = createID('GovListBox')\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({reflect: true, mutable: true}) value = ''\n\t/**\n\t * Options of autocomplete\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormAutocompleteItem[]\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\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\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: SizesType = 'm'\n\t/**\n\t * Main key name in the object\n\t */\n\t@Prop({attribute: 'name-key'}) readonly nameKey: string = 'name'\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\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 input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\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 * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number = 3\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Maximum number of items shown from a static `options` list (0 = unlimited).\n\t * Applies only when no async search callback is set.\n\t */\n\t@Prop({attribute: 'max-options'}) readonly maxOptions: number = 10\n\t/**\n\t * Input throttle in milliseconds\n\t */\n\t@Prop() readonly throttleTime: number = 200\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-input'}) govInput: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormAutocompleteEvent>\n\n\t@State() focused: boolean\n\t@State() processing = false\n\t@State() arrowCounter = -1\n\t@State() list: GovFormAutocompleteItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormAutocompleteItem[]): void {\n\t\tthis.fullOptions = propsValueToArray<GovFormAutocompleteItem[]>(newValue)\n\t\tif (this.searchCallback) {\n\t\t\tthis.setOptions(this.fullOptions).catch()\n\t\t} else {\n\t\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\t}\n\t}\n\n\tprivate onArrowUp() {\n\t\tif (this.arrowCounter > 0) {\n\t\t\tthis.arrowCounter = this.arrowCounter - 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate onArrowDown() {\n\t\tif (this.arrowCounter < this.list.length - 1) {\n\t\t\tthis.arrowCounter = this.arrowCounter + 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate async moveToView() {\n\t\tawait delay(200)\n\t\tconst heightOfList = this.listRef.offsetHeight\n\t\tconst selected = this.listRef.querySelector('li[aria-selected=\"true\"]') as HTMLUListElement\n\t\tif (selected && heightOfList) {\n\t\t\tconst offsetTop = selected.offsetTop\n\t\t\tthis.listRef.scrollTo({top: offsetTop, behavior: 'smooth'})\n\t\t}\n\t}\n\n\tprivate doSearch() {\n\t\tif (this.searchCallback) {\n\t\t\tif (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {\n\t\t\t\tthis.list = []\n\t\t\t\tthis.arrowCounter = -1\n\t\t\t\tthis.processing = false\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.processing = true\n\t\t\tthis.searchCallback(this.value)\n\t\t\t\t.then(response => (this.list = response))\n\t\t\t\t.catch(() => (this.list = []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.arrowCounter = -1\n\t\t\t\t\tthis.processing = false\n\t\t\t\t})\n\t\t\treturn\n\t\t}\n\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\tthis.arrowCounter = -1\n\t}\n\n\tprivate clearList() {\n\t\tif (this.fullOptions.length === 0) {\n\t\t\tthis.list = []\n\t\t}\n\t}\n\n\tget isValueAccepted() {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn this.value.length >= this.minlength\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t\tthis.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime)\n\t\tthis.fullOptions = propsValueToArray<GovFormAutocompleteItem[]>(this.options)\n\t\tif (!this.searchCallback) {\n\t\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\t}\n\t}\n\n\t@Watch('throttleTime')\n\twatchThrottleTime() {\n\t\tthis.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime)\n\t}\n\n\tprivate emitAndSearch = (e: CustomEvent<FormInputEvent>) => {\n\t\tthis.govInput.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t\tthis.doSearch()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormAutocompleteClass.root} size={this.size}>\n\t\t\t\t<gov-form-input\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\treadonly={this.readonly}\n\t\t\t\t\tautocomplete={false}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\tsuccess={this.success}\n\t\t\t\t\trole={'searchbox'}\n\t\t\t\t\tvalue={this.value}\n\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\ton-gov-input={this.onInputHandler}\n\t\t\t\t\ton-gov-keyup={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\ton-gov-keydown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\ton-gov-focus={this.onFocusHandler.bind(this)}\n\t\t\t\t\ton-gov-blur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-autocomplete={'list'}\n\t\t\t\t\taria-owns={[this.listBoxId, this.inheritedAttributes['aria-owns']].join(' ')}\n\t\t\t\t\taria-expanded={booleanString(this.list.length && this.focused ? true : false)}\n\t\t\t\t\tref={el => (this.inputRef = el as HTMLGovFormInputElement)}\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"validation-icon\" />\n\t\t\t\t\t<slot name=\"icon-end\" />\n\t\t\t\t</gov-form-input>\n\t\t\t\t<ul class={FormAutocompleteClass.list}\n\t\t\t\t\trole={'listbox'}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.focused)}\n\t\t\t\t\thidden={!this.focused}\n\t\t\t\t\tid={this.listBoxId}\n\t\t\t\t\tref={el => (this.listRef = el as HTMLUListElement)}>\n\t\t\t\t\t{this.focused && this.list.length === 0 && this.processing === false && (this.isValueAccepted || (!this.searchCallback && this.fullOptions.length > 0)) && this.messageEmpty ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.empty}>{this.messageEmpty}</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused && this.processing === true && this.isValueAccepted ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.loading}>\n\t\t\t\t\t\t\t<gov-skeleton size=\"m\"></gov-skeleton>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused ? this.list.map((item, index) => {\n\t\t\t\t\t\tconst isSelected = this.arrowCounter === index\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tclass={FormAutocompleteClass.item}\n\t\t\t\t\t\t\t\tinnerHTML={this.templateResolver(item, isSelected)}\n\t\t\t\t\t\t\t\trole={'option'}\n\t\t\t\t\t\t\t\taria-posinset={index}\n\t\t\t\t\t\t\t\ttabindex={isSelected ? 0 : -1}\n\t\t\t\t\t\t\t\taria-setsize={this.list.length}\n\t\t\t\t\t\t\t\tonTouchStart={(e: TouchEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\tonMouseDown={(e: PointerEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\taria-selected={toBoolAttr(isSelected)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-left\"/>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-right\"/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}) : null}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.arrowCounter = -1\n\t\tif (this.searchCallback) {\n\t\t\tif (this.isValueAccepted) {\n\t\t\t\tthis.doSearch()\n\t\t\t}\n\t\t} else {\n\t\t\tthis.doSearch()\n\t\t}\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.clearList();\n\t\tthis.arrowCounter = -1\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onInputHandler = (e: CustomEvent<FormInputEvent>) => {\n\t\te.stopPropagation()\n\t\tthis.value = e.detail.value\n\t\tthis.debouncedSearch(e)\n\t}\n\n\tprivate onSelectHandler(e: PointerEvent | CustomEvent | TouchEvent, index = -1) {\n\t\tlet selected: Nullable<GovFormAutocompleteItem> = null\n\t\tif (index > -1) {\n\t\t\tselected = this.list[index]\n\t\t} else if (has(this.arrowCounter, this.list)) {\n\t\t\tselected = this.list[this.arrowCounter]\n\t\t}\n\t\tif (selected) {\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\tselected: selected,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t\tthis.clearList();\n\t\t\tif (has(this.nameKey, selected) && typeof selected[this.nameKey] === 'string') {\n\t\t\t\tthis.value = selected[this.nameKey]\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onKeyUpHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 38) this.onArrowUp()\n\t\telse if (event.keyCode === 40) this.onArrowDown()\n\t\telse if (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t\tthis.onSelectHandler(e)\n\t\t}\n\t}\n\n\tprivate onKeyDownHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t}\n\t}\n\n\t/**\n\t * Focus main input element\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Blur main input element\n\t */\n\t@Method()\n\tasync setBlur(): Promise<void> {\n\t\treturn this.inputRef.blur()\n\t}\n\n\t/**\n\t * Set options for list\n\t */\n\t@Method()\n\tasync setOptions(options: GovFormAutocompleteItem[]): Promise<void> {\n\t\tthis.list = Array.isArray(options) ? options : []\n\t\tthis.arrowCounter = -1\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\n\t\tawait this.inputRef.clearValue()\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync setProcessing(status: boolean): Promise<void> {\n\t\tthis.processing = status\n\t}\n\n\t/**\n\t * Set a custom asynchronous function for the whisperer\n\t */\n\t@Method()\n\tasync setSearchCallback(callback: (value: string) => Promise<any>) {\n\t\tthis.searchCallback = callback\n\t}\n\n\t/**\n\t * Setting a custom whisper result template\n\t * @param callback\n\t */\n\t@Method()\n\tasync setTemplateResolver(callback: (item: GovFormAutocompleteItem) => string) {\n\t\tthis.templateResolver = callback\n\t}\n}\n"]}
|
|
@@ -115,7 +115,10 @@ export class GovFormFile {
|
|
|
115
115
|
}
|
|
116
116
|
validateFiles(files) {
|
|
117
117
|
let filesBuffer = [];
|
|
118
|
-
|
|
118
|
+
if (!this.multiple && this.displayAttachments) {
|
|
119
|
+
this.files = [];
|
|
120
|
+
}
|
|
121
|
+
Array.from(files).forEach(file => {
|
|
119
122
|
const isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null;
|
|
120
123
|
if (isFile === null || this.ignoreFileDuplicationCheck) {
|
|
121
124
|
const isSizeValid = typeof this.maxFileSize === "number" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true;
|
|
@@ -138,6 +141,9 @@ export class GovFormFile {
|
|
|
138
141
|
});
|
|
139
142
|
}
|
|
140
143
|
});
|
|
144
|
+
if (this.displayAttachments) {
|
|
145
|
+
this.syncNativeInputFiles();
|
|
146
|
+
}
|
|
141
147
|
this.govFiles.emit({
|
|
142
148
|
component: FormFileClass.root,
|
|
143
149
|
files: filesBuffer.length ? filesBuffer : this.files,
|
|
@@ -146,6 +152,27 @@ export class GovFormFile {
|
|
|
146
152
|
this.reset().finally();
|
|
147
153
|
}
|
|
148
154
|
}
|
|
155
|
+
// Keep native <input type="file"> in sync with the visible attachments list so
|
|
156
|
+
// that a native form submit / FormData carries exactly the files shown in the UI.
|
|
157
|
+
// Invalid items (wrong type or oversize) are intentionally excluded.
|
|
158
|
+
syncNativeInputFiles() {
|
|
159
|
+
if (!this.inputRef || typeof DataTransfer === "undefined") {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
const dt = new DataTransfer();
|
|
164
|
+
this.files
|
|
165
|
+
.filter(item => item.acceptValid === true && item.sizeValid === true)
|
|
166
|
+
.forEach(item => dt.items.add(item.file));
|
|
167
|
+
this.inputRef.files = dt.files;
|
|
168
|
+
}
|
|
169
|
+
catch (e) {
|
|
170
|
+
// Safari < 14.1 / older browsers may reject assigning to .files; nothing safe to fall back to.
|
|
171
|
+
if (typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production") {
|
|
172
|
+
console.warn("[gov-form-file] Could not sync native input.files:", e);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
149
176
|
componentDidLoad() {
|
|
150
177
|
this.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {
|
|
151
178
|
this.onAriaAttributeChange(attributeName, newValue);
|
|
@@ -169,7 +196,7 @@ export class GovFormFile {
|
|
|
169
196
|
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
|
|
170
197
|
}
|
|
171
198
|
render() {
|
|
172
|
-
return (h(Host, { key: '
|
|
199
|
+
return (h(Host, { key: '6709aba5a796ccb9cf712dd5f962d5f903050d26', class: this.h.classes([FormFileClass.root]), invalid: toBoolAttrIfDefined(this.invalid), expanded: toBoolAttrIfDefined(this.expanded) }, h("div", { key: '668f6959ca55220ed2543dbbeddeb98f1b6c19ba', class: FormFileClass.area, ref: el => (this.areaRef = el) }, h("slot", { key: '5f12f12d074163b525e2200e23f61e6d0fb34c74' }), h("input", Object.assign({ key: '7cf43884dad3c28be956b9897862ff5a1fa22e75', 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 }, this.inheritedAttributes, { "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-disabled": toBoolAttrIfDefined(this.disabled) })), h("div", { key: 'ec717f584bcd4d74416821736fb4bdcea517bc83', class: FormFileClass.inputFocus })), this.h.hasSlot("attachments") ? (h("div", { class: FormFileClass.attachments }, h("slot", { name: "attachments" }))) : null, this.files.length && this.displayAttachments ? (h("div", { class: FormFileClass.attachments }, h("gov-attachments", { label: this.accessibleAttachmentsLabel, "accessible-label": this.accessibleAttachmentsLabel }, this.files.map(item => (h("gov-attachments-item", { "accessible-remove-labelledby": item.id, "on-gov-remove": () => this.onRemoveFileHandler(item) }, item.file.name, h("span", { slot: "name" }, item.file.name), item.acceptValid === false ? (h("gov-form-message", { slot: "message", color: "error" }, h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill", type: "components" }), item.acceptValid === false ? this.errorAccept : null)) : null, item.sizeValid === false ? (h("gov-form-message", { slot: "message", color: "error" }, h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill", type: "components" }), this.errorSize.replace("{FILE_SIZE}", formatBytes(this.maxFileSize)))) : null, h("span", { slot: "info" }, "(", formatBytes(item.file.size), ")"))))))) : null));
|
|
173
200
|
}
|
|
174
201
|
onRemoveFileHandler(file) {
|
|
175
202
|
const index = this.files.findIndex(item => item.id === file.id);
|
|
@@ -178,6 +205,7 @@ export class GovFormFile {
|
|
|
178
205
|
const removeFile = this.files[index];
|
|
179
206
|
files.splice(index, 1);
|
|
180
207
|
this.files = [...files];
|
|
208
|
+
this.syncNativeInputFiles();
|
|
181
209
|
this.govRemoveFile.emit({
|
|
182
210
|
component: FormFileClass.root,
|
|
183
211
|
file: removeFile,
|
|
@@ -222,7 +250,10 @@ export class GovFormFile {
|
|
|
222
250
|
*/
|
|
223
251
|
async reset() {
|
|
224
252
|
this.files = [];
|
|
225
|
-
this.inputRef
|
|
253
|
+
if (this.inputRef) {
|
|
254
|
+
this.inputRef.value = '';
|
|
255
|
+
this.syncNativeInputFiles();
|
|
256
|
+
}
|
|
226
257
|
}
|
|
227
258
|
static get is() { return "gov-form-file"; }
|
|
228
259
|
static get properties() {
|