@gov-design-system-ce/components 4.1.3-BETA-9 → 4.2.0
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/{constants-02aec493.js → constants-7f713d6c.js} +2 -2
- package/dist/cjs/{constants-02aec493.js.map → constants-7f713d6c.js.map} +1 -1
- package/dist/cjs/{constants-4dfa23e3.js → constants-c7447ffd.js} +3 -1
- package/dist/cjs/constants-c7447ffd.js.map +1 -0
- package/dist/cjs/{constants-52053f2d.js → constants-c84c60d6.js} +3 -1
- package/dist/cjs/constants-c84c60d6.js.map +1 -0
- package/dist/cjs/core.cjs.js +2 -2
- package/dist/cjs/gov-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-accordion.cjs.entry.js +1 -1
- package/dist/cjs/gov-attachments_3.cjs.entry.js +3 -3
- package/dist/cjs/gov-attachments_3.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/gov-banner.cjs.entry.js +79 -0
- package/dist/cjs/gov-banner.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-blockquote.cjs.entry.js +33 -0
- package/dist/cjs/gov-blockquote.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js +2 -2
- package/dist/cjs/gov-button.cjs.entry.js +6 -5
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-card.cjs.entry.js +2 -2
- package/dist/cjs/gov-chip.cjs.entry.js +5 -4
- package/dist/cjs/gov-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-container.cjs.entry.js +2 -2
- package/dist/cjs/gov-control-group.cjs.entry.js +2 -2
- package/dist/cjs/gov-cookiebar.cjs.entry.js +2 -2
- package/dist/cjs/gov-dialog.cjs.entry.js +2 -2
- package/dist/cjs/gov-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/gov-empty.cjs.entry.js +2 -2
- package/dist/cjs/gov-error-code.cjs.entry.js +2 -2
- package/dist/cjs/gov-flex_3.cjs.entry.js +7 -26
- package/dist/cjs/gov-flex_3.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +4 -3
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-checkbox-group.cjs.entry.js +4 -4
- package/dist/cjs/gov-form-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +3 -2
- package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-control.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-file.cjs.entry.js +4 -3
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-group.cjs.entry.js +3 -3
- package/dist/cjs/gov-form-input_2.cjs.entry.js +11 -9
- package/dist/cjs/gov-form-input_2.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +5 -4
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-password-power.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/gov-form-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js +3 -2
- package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-search.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-select.cjs.entry.js +5 -4
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-switch.cjs.entry.js +3 -2
- package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-grid-item.cjs.entry.js +14 -8
- package/dist/cjs/gov-grid-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-grid.cjs.entry.js +8 -6
- package/dist/cjs/gov-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-infobar.cjs.entry.js +5 -4
- package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-layout-column.cjs.entry.js +2 -2
- package/dist/cjs/gov-layout.cjs.entry.js +2 -2
- package/dist/cjs/gov-lifecycle.cjs.entry.js +2 -2
- package/dist/cjs/gov-link.cjs.entry.js +3 -2
- package/dist/cjs/gov-link.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-loading.cjs.entry.js +2 -2
- package/dist/cjs/gov-message.cjs.entry.js +2 -2
- package/dist/cjs/gov-message.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js +3 -2
- package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-spacer.cjs.entry.js +2 -2
- package/dist/cjs/gov-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/gov-stepper-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-stepper.cjs.entry.js +3 -3
- package/dist/cjs/gov-tabs-item.cjs.entry.js +2 -2
- package/dist/cjs/gov-tabs.cjs.entry.js +4 -3
- package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tag.cjs.entry.js +2 -2
- package/dist/cjs/gov-tile.cjs.entry.js +2 -2
- package/dist/cjs/gov-toast.cjs.entry.js +4 -3
- package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tooltip-content.cjs.entry.js +2 -2
- package/dist/cjs/gov-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/gov-wizard-item.cjs.entry.js +3 -3
- package/dist/cjs/gov-wizard.cjs.entry.js +2 -2
- package/dist/cjs/{index-67e87c27.js → index-0e4f24f9.js} +9 -19
- package/dist/cjs/index-0e4f24f9.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/gov-attachments/gov-attachments-item.css +3 -4
- package/dist/collection/components/gov-banner/constants.js +26 -0
- package/dist/collection/components/gov-banner/constants.js.map +1 -0
- package/dist/collection/components/gov-banner/gov-banner.js +202 -0
- package/dist/collection/components/gov-banner/gov-banner.js.map +1 -0
- package/dist/collection/components/gov-blocquote/constants.js +10 -0
- package/dist/collection/components/gov-blocquote/constants.js.map +1 -0
- package/dist/collection/components/gov-blocquote/gov-blockquote.js +61 -0
- package/dist/collection/components/gov-blocquote/gov-blockquote.js.map +1 -0
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +1 -1
- package/dist/collection/components/gov-button/button/gov-button.js +5 -4
- package/dist/collection/components/gov-button/button/gov-button.js.map +1 -1
- package/dist/collection/components/gov-button/dropdown/gov-dropdown.js +1 -1
- package/dist/collection/components/gov-card/gov-card.js +1 -1
- package/dist/collection/components/gov-chip/gov-chip.js +4 -3
- package/dist/collection/components/gov-chip/gov-chip.js.map +1 -1
- package/dist/collection/components/gov-container/gov-container.js +1 -1
- package/dist/collection/components/gov-control-group/gov-control-group.js +1 -1
- package/dist/collection/components/gov-cookiebar/gov-cookiebar.js +1 -1
- package/dist/collection/components/gov-dialog/gov-dialog.js +1 -1
- package/dist/collection/components/gov-dialog/gov-dialog.js.map +1 -1
- package/dist/collection/components/gov-empty/gov-empty.js +1 -1
- package/dist/collection/components/gov-error-code/gov-error-code.js +1 -1
- package/dist/collection/components/gov-flex/gov-flex.js +22 -3
- package/dist/collection/components/gov-flex/gov-flex.js.map +1 -1
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +3 -2
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +2 -1
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
- package/dist/collection/components/gov-form/control/gov-form-control.js +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.js +3 -2
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-form/group/constants.js +1 -1
- package/dist/collection/components/gov-form/group/constants.js.map +1 -1
- package/dist/collection/components/gov-form/group/gov-form-checkbox-group.js +2 -2
- package/dist/collection/components/gov-form/group/gov-form-group.css +4 -4
- package/dist/collection/components/gov-form/group/gov-form-group.js +2 -2
- package/dist/collection/components/gov-form/group/gov-form-radio-group.js +2 -2
- package/dist/collection/components/gov-form/input/gov-form-input.js +7 -6
- package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
- package/dist/collection/components/gov-form/label/gov-form-label.js +1 -1
- package/dist/collection/components/gov-form/message/gov-form-message.js +1 -1
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +4 -3
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
- package/dist/collection/components/gov-form/password-power/gov-form-password-power.js +1 -1
- package/dist/collection/components/gov-form/radio/gov-form-radio.js +2 -1
- package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
- package/dist/collection/components/gov-form/search/gov-form-search.js +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.js +4 -3
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.js +2 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
- package/dist/collection/components/gov-grid/constants.js +2 -0
- package/dist/collection/components/gov-grid/constants.js.map +1 -1
- package/dist/collection/components/gov-grid/gov-grid-item.js +111 -20
- package/dist/collection/components/gov-grid/gov-grid-item.js.map +1 -1
- package/dist/collection/components/gov-grid/gov-grid.js +56 -14
- package/dist/collection/components/gov-grid/gov-grid.js.map +1 -1
- package/dist/collection/components/gov-icon/gov-icon.js +0 -17
- package/dist/collection/components/gov-icon/gov-icon.js.map +1 -1
- package/dist/collection/components/gov-infobar/gov-infobar.js +4 -3
- package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -1
- package/dist/collection/components/gov-layout/gov-layout-column.js +1 -1
- package/dist/collection/components/gov-layout/gov-layout.js +1 -1
- package/dist/collection/components/gov-lifecycle-tester/gov-lifecycle-tester.js +1 -1
- package/dist/collection/components/gov-link/constants.js +1 -0
- package/dist/collection/components/gov-link/constants.js.map +1 -1
- package/dist/collection/components/gov-link/gov-link.js +1 -1
- package/dist/collection/components/gov-link/gov-link.js.map +1 -1
- package/dist/collection/components/gov-loading/loading/gov-loading.js +1 -1
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js +3 -2
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js.map +1 -1
- package/dist/collection/components/gov-message/gov-message.js +1 -1
- package/dist/collection/components/gov-message/gov-message.js.map +1 -1
- package/dist/collection/components/gov-pagination/gov-pagination.js +2 -1
- package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
- package/dist/collection/components/gov-spacer/gov-spacer.js +1 -1
- package/dist/collection/components/gov-stepper/constants.js +2 -0
- package/dist/collection/components/gov-stepper/constants.js.map +1 -1
- package/dist/collection/components/gov-stepper/gov-stepper-item.js +1 -1
- package/dist/collection/components/gov-stepper/gov-stepper-item.js.map +1 -1
- package/dist/collection/components/gov-stepper/gov-stepper.js +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs-item.js +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs.js +3 -2
- package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
- package/dist/collection/components/gov-tag/gov-tag.js +1 -1
- package/dist/collection/components/gov-theme-switch/constants.js +1 -0
- package/dist/collection/components/gov-theme-switch/constants.js.map +1 -1
- package/dist/collection/components/gov-theme-switch/gov-theme-switch.js +1 -1
- package/dist/collection/components/gov-theme-switch/gov-theme-switch.js.map +1 -1
- package/dist/collection/components/gov-tile/gov-tile.js +1 -1
- package/dist/collection/components/gov-toast/gov-toast.js +3 -2
- package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip.js +2 -2
- 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/collection/pages/Banner.js +268 -0
- package/dist/collection/pages/Banner.js.map +1 -0
- package/dist/collection/pages/Blockquote.js +25 -0
- package/dist/collection/pages/Blockquote.js.map +1 -0
- package/dist/collection/pages/Breadcrumbs.js +2 -2
- package/dist/collection/pages/Breadcrumbs.js.map +1 -1
- package/dist/collection/pages/Card.js +2 -2
- package/dist/collection/pages/Card.js.map +1 -1
- package/dist/collection/pages/Flex.js +1 -1
- package/dist/collection/pages/Flex.js.map +1 -1
- package/dist/collection/pages/Grid.js +61 -40
- package/dist/collection/pages/Grid.js.map +1 -1
- package/dist/collection/pages/Home.js +57 -0
- package/dist/collection/pages/Home.js.map +1 -1
- package/dist/collection/pages/Infobar.js +36 -56
- package/dist/collection/pages/Infobar.js.map +1 -1
- package/dist/collection/pages/Layout.js +10 -10
- package/dist/collection/pages/Layout.js.map +1 -1
- package/dist/collection/pages/Tag.js +14 -0
- package/dist/collection/pages/Tag.js.map +1 -1
- package/dist/collection/pages/Tiles.js +8 -235
- package/dist/collection/pages/Tiles.js.map +1 -1
- package/dist/collection/pages/Typography.js +110 -51
- package/dist/collection/pages/Typography.js.map +1 -1
- package/dist/collection/utils/icon.utils.js +1 -8
- package/dist/collection/utils/icon.utils.js.map +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-tiles.d.ts → gov-banner.d.ts} +4 -4
- package/dist/components/gov-banner.js +2 -0
- package/dist/components/gov-banner.js.map +1 -0
- package/dist/components/gov-blockquote.d.ts +11 -0
- package/dist/components/gov-blockquote.js +2 -0
- package/dist/components/gov-blockquote.js.map +1 -0
- 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-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-dialog.js.map +1 -1
- package/dist/components/gov-dropdown.js +1 -1
- package/dist/components/gov-dropdown.js.map +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-flex.js.map +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-group.js.map +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-checkbox.js.map +1 -1
- package/dist/components/gov-form-control.js +1 -1
- package/dist/components/gov-form-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-label.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-password-power.js +1 -1
- package/dist/components/gov-form-radio-group.js +1 -1
- package/dist/components/gov-form-radio-group.js.map +1 -1
- package/dist/components/gov-form-radio.js +1 -1
- package/dist/components/gov-form-radio.js.map +1 -1
- package/dist/components/gov-form-search.js +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-form-switch.js +1 -1
- package/dist/components/gov-form-switch.js.map +1 -1
- package/dist/components/gov-grid-item.js +1 -1
- package/dist/components/gov-grid-item.js.map +1 -1
- package/dist/components/gov-grid.js +1 -1
- package/dist/components/gov-grid.js.map +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-infobar.js.map +1 -1
- package/dist/components/gov-layout-column.js +1 -1
- package/dist/components/gov-layout.js +1 -1
- package/dist/components/gov-lifecycle.js +1 -1
- package/dist/components/gov-link.js +1 -1
- package/dist/components/gov-link.js.map +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-loading.js.map +1 -1
- package/dist/components/gov-message.js +1 -1
- package/dist/components/gov-message.js.map +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-pagination.js.map +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-item.js.map +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-tabs.js.map +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-theme-switch.js +1 -1
- package/dist/components/gov-theme-switch.js.map +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-toast.js.map +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-tooltip.js +1 -1
- package/dist/components/gov-tooltip.js.map +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/gov-wizard.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-0327a469.js +2 -0
- package/dist/components/p-0327a469.js.map +1 -0
- package/dist/components/p-2ca5423c.js +2 -0
- package/dist/components/p-2ca5423c.js.map +1 -0
- package/dist/components/p-2fc08a71.js +2 -0
- package/dist/components/p-2fc08a71.js.map +1 -0
- package/dist/components/p-3c90521b.js +2 -0
- package/dist/components/p-3c90521b.js.map +1 -0
- package/dist/components/p-3fead64a.js +2 -0
- package/dist/components/p-3fead64a.js.map +1 -0
- package/dist/components/p-42200001.js +3 -0
- package/dist/components/p-42200001.js.map +1 -0
- package/dist/components/p-4fba9df0.js +2 -0
- package/dist/components/p-4fba9df0.js.map +1 -0
- package/dist/components/p-69a31c96.js +2 -0
- package/dist/components/p-69a31c96.js.map +1 -0
- package/dist/components/{p-03ad4e0f.js → p-73938936.js} +2 -2
- package/dist/components/{p-384c7f2a.js → p-7be2301a.js} +2 -2
- package/dist/components/p-b533871a.js +2 -0
- package/dist/components/p-b533871a.js.map +1 -0
- package/dist/components/p-b5dc6bae.js +2 -0
- package/dist/components/p-b5dc6bae.js.map +1 -0
- package/dist/components/p-ea128b8b.js +2 -0
- package/dist/components/p-ea128b8b.js.map +1 -0
- package/dist/components/p-f9a1ff6e.js +2 -0
- package/dist/components/{p-e44a0fee.js → p-fc2afe61.js} +2 -2
- package/dist/components/{p-e44a0fee.js.map → p-fc2afe61.js.map} +1 -1
- package/dist/core/core.css +2711 -1506
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/p-005214d1.entry.js +2 -0
- package/dist/core/p-0ef1f684.entry.js +2 -0
- package/dist/core/p-0ef1f684.entry.js.map +1 -0
- package/dist/core/p-0fc9ea97.entry.js +2 -0
- package/dist/core/p-0fc9ea97.entry.js.map +1 -0
- package/dist/core/p-132c9a87.entry.js +2 -0
- package/dist/core/p-132c9a87.entry.js.map +1 -0
- package/dist/core/p-16d3a79a.entry.js +2 -0
- package/dist/core/{p-967a1094.entry.js.map → p-16d3a79a.entry.js.map} +1 -1
- package/dist/core/p-16f44a0b.entry.js +2 -0
- package/dist/core/p-16f44a0b.entry.js.map +1 -0
- package/dist/core/p-1c7c9144.entry.js +2 -0
- package/dist/core/p-1cf1dd10.entry.js +2 -0
- package/dist/core/{p-f7f60f91.entry.js.map → p-1cf1dd10.entry.js.map} +1 -1
- package/dist/core/p-23b4dcd3.entry.js +2 -0
- package/dist/core/{p-45b759f4.entry.js.map → p-23b4dcd3.entry.js.map} +1 -1
- package/dist/core/p-2536a8ff.entry.js +2 -0
- package/dist/core/p-2536a8ff.entry.js.map +1 -0
- package/dist/core/p-28d1bc01.entry.js +2 -0
- package/dist/core/p-28d1bc01.entry.js.map +1 -0
- package/dist/core/p-2ca5423c.js +2 -0
- package/dist/core/p-2ca5423c.js.map +1 -0
- package/dist/core/p-3acaa012.entry.js +2 -0
- package/dist/core/{p-1aa7450e.entry.js.map → p-3acaa012.entry.js.map} +1 -1
- package/dist/core/p-3d7fb8f8.entry.js +2 -0
- package/dist/core/p-3d7fb8f8.entry.js.map +1 -0
- package/dist/core/{p-927c31dd.entry.js → p-46ecf09e.entry.js} +2 -2
- package/dist/core/p-49cd4d0d.entry.js +2 -0
- package/dist/core/{p-ee55932a.entry.js.map → p-49cd4d0d.entry.js.map} +1 -1
- package/dist/core/p-5108eb37.entry.js +2 -0
- package/dist/core/{p-237a5b91.entry.js.map → p-5108eb37.entry.js.map} +1 -1
- package/dist/core/{p-0f0f7302.entry.js → p-52042c7e.entry.js} +2 -2
- package/dist/core/p-52103c05.entry.js +2 -0
- package/dist/core/p-52103c05.entry.js.map +1 -0
- package/dist/core/{p-c0800e6d.entry.js → p-5242b51b.entry.js} +2 -2
- package/dist/core/p-564555e6.entry.js +2 -0
- package/dist/core/p-59fe6cbc.entry.js +2 -0
- package/dist/core/p-59fe6cbc.entry.js.map +1 -0
- package/dist/core/p-650fe9e8.entry.js +2 -0
- package/dist/core/{p-ed02945f.entry.js.map → p-650fe9e8.entry.js.map} +1 -1
- package/dist/core/p-6e41cf69.entry.js +2 -0
- package/dist/core/{p-77daba72.entry.js → p-6f1ea21d.entry.js} +2 -2
- package/dist/core/p-7399ad59.entry.js +2 -0
- package/dist/core/p-7399ad59.entry.js.map +1 -0
- package/dist/core/{p-7dfb7e36.entry.js → p-79ec86da.entry.js} +2 -2
- package/dist/core/p-80bebb7f.entry.js +2 -0
- package/dist/core/p-80bebb7f.entry.js.map +1 -0
- package/dist/core/p-8cbe8add.entry.js +2 -0
- package/dist/core/p-8f73f8e0.entry.js +2 -0
- package/dist/core/p-94119ad4.entry.js +2 -0
- package/dist/core/p-94119ad4.entry.js.map +1 -0
- package/dist/core/p-952ab9e5.entry.js +2 -0
- package/dist/core/{p-14d66f26.entry.js.map → p-952ab9e5.entry.js.map} +1 -1
- package/dist/core/{p-7baee44f.entry.js → p-99f192c1.entry.js} +2 -2
- package/dist/core/p-9ae280b2.entry.js +2 -0
- package/dist/core/p-9ae280b2.entry.js.map +1 -0
- package/dist/core/p-9c1601b3.entry.js +2 -0
- package/dist/core/p-9c1601b3.entry.js.map +1 -0
- package/dist/core/p-9dea2efa.js +3 -0
- package/dist/core/p-9dea2efa.js.map +1 -0
- package/dist/core/p-a02f2547.entry.js +2 -0
- package/dist/core/p-ab11081d.entry.js +2 -0
- package/dist/core/p-ab11081d.entry.js.map +1 -0
- package/dist/core/p-ab868410.entry.js +2 -0
- package/dist/core/{p-f2bb8c29.entry.js.map → p-ab868410.entry.js.map} +1 -1
- package/dist/core/{p-a6a9de9a.entry.js → p-ae88fe6b.entry.js} +2 -2
- package/dist/core/p-c07f6bb4.entry.js +2 -0
- package/dist/core/p-c07f6bb4.entry.js.map +1 -0
- package/dist/core/{p-063b70a2.entry.js → p-c2abc031.entry.js} +2 -2
- package/dist/core/p-c688349d.entry.js +2 -0
- package/dist/core/p-c6fdc0a9.entry.js +2 -0
- package/dist/core/p-c6fdc0a9.entry.js.map +1 -0
- package/dist/core/p-c91512dd.entry.js +2 -0
- package/dist/core/p-cf9d5c2f.entry.js +2 -0
- package/dist/core/p-cf9d5c2f.entry.js.map +1 -0
- package/dist/core/p-d1270d72.entry.js +2 -0
- package/dist/core/{p-8cc5ad01.entry.js.map → p-d1270d72.entry.js.map} +1 -1
- package/dist/core/p-d141e9ca.entry.js +2 -0
- package/dist/core/p-d141e9ca.entry.js.map +1 -0
- package/dist/core/p-de852480.entry.js +2 -0
- package/dist/core/p-e89471ef.entry.js +2 -0
- package/dist/core/p-ea128b8b.js +2 -0
- package/dist/core/p-ea128b8b.js.map +1 -0
- package/dist/core/p-eb8a9705.entry.js +2 -0
- package/dist/core/p-eb8a9705.entry.js.map +1 -0
- package/dist/core/p-ee950038.entry.js +2 -0
- package/dist/core/p-ee950038.entry.js.map +1 -0
- package/dist/core/p-f0e001c7.entry.js +2 -0
- package/dist/core/{p-269071f5.entry.js.map → p-f0e001c7.entry.js.map} +1 -1
- package/dist/core/{p-3849ca02.entry.js → p-f120ba66.entry.js} +2 -2
- package/dist/core/p-f120ba66.entry.js.map +1 -0
- package/dist/core/p-f333c673.entry.js +2 -0
- package/dist/core/p-f7e47c0a.entry.js +2 -0
- package/dist/core/p-f7e47c0a.entry.js.map +1 -0
- package/dist/core/p-f98f19f6.entry.js +2 -0
- package/dist/core/{p-906865d0.entry.js.map → p-f98f19f6.entry.js.map} +1 -1
- package/dist/core/{p-e44a0fee.js → p-fc2afe61.js} +2 -2
- package/dist/core/{p-e44a0fee.js.map → p-fc2afe61.js.map} +1 -1
- package/dist/esm/{constants-4da2b3c0.js → constants-1548499a.js} +2 -2
- package/dist/esm/{constants-4da2b3c0.js.map → constants-1548499a.js.map} +1 -1
- package/dist/esm/{constants-372455eb.js → constants-7b1ce2ec.js} +3 -1
- package/dist/esm/constants-7b1ce2ec.js.map +1 -0
- package/dist/esm/{constants-2d5a0e18.js → constants-dc2115cb.js} +3 -1
- package/dist/esm/constants-dc2115cb.js.map +1 -0
- package/dist/esm/core.js +3 -3
- package/dist/esm/gov-accordion-item.entry.js +1 -1
- package/dist/esm/gov-accordion.entry.js +1 -1
- package/dist/esm/gov-attachments_3.entry.js +3 -3
- package/dist/esm/gov-attachments_3.entry.js.map +1 -1
- package/dist/esm/gov-backdrop.entry.js +1 -1
- package/dist/esm/gov-banner.entry.js +75 -0
- package/dist/esm/gov-banner.entry.js.map +1 -0
- package/dist/esm/gov-blockquote.entry.js +29 -0
- package/dist/esm/gov-blockquote.entry.js.map +1 -0
- package/dist/esm/gov-breadcrumbs.entry.js +2 -2
- package/dist/esm/gov-button.entry.js +6 -5
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-card.entry.js +2 -2
- package/dist/esm/gov-chip.entry.js +5 -4
- package/dist/esm/gov-chip.entry.js.map +1 -1
- package/dist/esm/gov-container.entry.js +2 -2
- package/dist/esm/gov-control-group.entry.js +2 -2
- package/dist/esm/gov-cookiebar.entry.js +2 -2
- package/dist/esm/gov-dialog.entry.js +2 -2
- package/dist/esm/gov-dialog.entry.js.map +1 -1
- package/dist/esm/gov-dropdown.entry.js +2 -2
- package/dist/esm/gov-empty.entry.js +2 -2
- package/dist/esm/gov-error-code.entry.js +2 -2
- package/dist/esm/gov-flex_3.entry.js +7 -26
- package/dist/esm/gov-flex_3.entry.js.map +1 -1
- package/dist/esm/gov-form-autocomplete.entry.js +4 -3
- package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
- package/dist/esm/gov-form-checkbox-group.entry.js +4 -4
- package/dist/esm/gov-form-checkbox-group.entry.js.map +1 -1
- package/dist/esm/gov-form-checkbox.entry.js +3 -2
- package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
- package/dist/esm/gov-form-control.entry.js +2 -2
- package/dist/esm/gov-form-file.entry.js +4 -3
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-form-group.entry.js +3 -3
- package/dist/esm/gov-form-input_2.entry.js +11 -9
- package/dist/esm/gov-form-input_2.entry.js.map +1 -1
- package/dist/esm/gov-form-label.entry.js +2 -2
- package/dist/esm/gov-form-multi-select.entry.js +5 -4
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-form-password-power.entry.js +2 -2
- package/dist/esm/gov-form-radio-group.entry.js +4 -4
- package/dist/esm/gov-form-radio-group.entry.js.map +1 -1
- package/dist/esm/gov-form-radio.entry.js +3 -2
- package/dist/esm/gov-form-radio.entry.js.map +1 -1
- package/dist/esm/gov-form-search.entry.js +2 -2
- package/dist/esm/gov-form-select.entry.js +5 -4
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-form-switch.entry.js +3 -2
- package/dist/esm/gov-form-switch.entry.js.map +1 -1
- package/dist/esm/gov-grid-item.entry.js +14 -8
- package/dist/esm/gov-grid-item.entry.js.map +1 -1
- package/dist/esm/gov-grid.entry.js +8 -6
- package/dist/esm/gov-grid.entry.js.map +1 -1
- package/dist/esm/gov-infobar.entry.js +5 -4
- package/dist/esm/gov-infobar.entry.js.map +1 -1
- package/dist/esm/gov-layout-column.entry.js +2 -2
- package/dist/esm/gov-layout.entry.js +2 -2
- package/dist/esm/gov-lifecycle.entry.js +2 -2
- package/dist/esm/gov-link.entry.js +3 -2
- package/dist/esm/gov-link.entry.js.map +1 -1
- package/dist/esm/gov-loading.entry.js +2 -2
- package/dist/esm/gov-message.entry.js +2 -2
- package/dist/esm/gov-message.entry.js.map +1 -1
- package/dist/esm/gov-pagination.entry.js +3 -2
- package/dist/esm/gov-pagination.entry.js.map +1 -1
- package/dist/esm/gov-spacer.entry.js +2 -2
- package/dist/esm/gov-stepper-item.entry.js +3 -3
- package/dist/esm/gov-stepper-item.entry.js.map +1 -1
- package/dist/esm/gov-stepper.entry.js +3 -3
- package/dist/esm/gov-tabs-item.entry.js +2 -2
- package/dist/esm/gov-tabs.entry.js +4 -3
- package/dist/esm/gov-tabs.entry.js.map +1 -1
- package/dist/esm/gov-tag.entry.js +2 -2
- package/dist/esm/gov-tile.entry.js +2 -2
- package/dist/esm/gov-toast.entry.js +4 -3
- package/dist/esm/gov-toast.entry.js.map +1 -1
- package/dist/esm/gov-tooltip-content.entry.js +2 -2
- package/dist/esm/gov-tooltip.entry.js +3 -3
- package/dist/esm/gov-wizard-item.entry.js +3 -3
- package/dist/esm/gov-wizard.entry.js +2 -2
- package/dist/esm/{index-087b155c.js → index-bf8a6f64.js} +10 -18
- package/dist/esm/index-bf8a6f64.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/hydrate/index.js +247 -161
- package/dist/hydrate/index.mjs +247 -161
- package/dist/stencil.config.js +2 -1
- package/dist/stencil.config.js.map +1 -1
- package/dist/types/components/gov-banner/constants.d.ts +26 -0
- package/dist/types/components/gov-banner/gov-banner.d.ts +38 -0
- package/dist/types/components/gov-blocquote/constants.d.ts +10 -0
- package/dist/types/components/gov-blocquote/gov-blockquote.d.ts +15 -0
- package/dist/types/components/gov-button/button/constants.d.ts +1 -1
- package/dist/types/components/gov-control-group/constants.d.ts +1 -1
- package/dist/types/components/gov-flex/gov-flex.d.ts +5 -1
- package/dist/types/components/gov-form/group/constants.d.ts +1 -1
- package/dist/types/components/gov-grid/constants.d.ts +4 -0
- package/dist/types/components/gov-grid/gov-grid-item.d.ts +25 -5
- package/dist/types/components/gov-grid/gov-grid.d.ts +11 -2
- package/dist/types/components/gov-icon/constants.d.ts +1 -1
- package/dist/types/components/gov-icon/gov-icon.d.ts +0 -1
- package/dist/types/components/gov-infobar/constants.d.ts +1 -1
- package/dist/types/components/gov-link/constants.d.ts +1 -0
- package/dist/types/components/gov-stepper/constants.d.ts +2 -0
- package/dist/types/components/gov-theme-switch/constants.d.ts +1 -0
- package/dist/types/components.d.ts +179 -36
- package/dist/types/pages/Banner.d.ts +3 -0
- package/dist/types/pages/Blockquote.d.ts +3 -0
- package/package.json +3 -3
- package/dist/cjs/constants-4dfa23e3.js.map +0 -1
- package/dist/cjs/constants-52053f2d.js.map +0 -1
- package/dist/cjs/gov-tiles.cjs.entry.js +0 -26
- package/dist/cjs/gov-tiles.cjs.entry.js.map +0 -1
- package/dist/cjs/index-67e87c27.js.map +0 -1
- package/dist/collection/components/gov-tile/container/constants.js +0 -4
- package/dist/collection/components/gov-tile/container/constants.js.map +0 -1
- package/dist/collection/components/gov-tile/container/gov-tiles.js +0 -37
- package/dist/collection/components/gov-tile/container/gov-tiles.js.map +0 -1
- package/dist/components/gov-tiles.js +0 -2
- package/dist/components/gov-tiles.js.map +0 -1
- package/dist/components/p-115b9cf3.js +0 -3
- package/dist/components/p-115b9cf3.js.map +0 -1
- package/dist/components/p-350e060c.js +0 -2
- package/dist/components/p-350e060c.js.map +0 -1
- package/dist/components/p-792c5352.js +0 -2
- package/dist/components/p-792c5352.js.map +0 -1
- package/dist/components/p-880743a5.js +0 -2
- package/dist/components/p-880743a5.js.map +0 -1
- package/dist/components/p-8e8a3300.js +0 -2
- package/dist/components/p-8e8a3300.js.map +0 -1
- package/dist/components/p-8ee6f2f3.js +0 -2
- package/dist/components/p-92406c6d.js +0 -2
- package/dist/components/p-92406c6d.js.map +0 -1
- package/dist/components/p-939638b2.js +0 -2
- package/dist/components/p-939638b2.js.map +0 -1
- package/dist/components/p-95bd5f39.js +0 -2
- package/dist/components/p-95bd5f39.js.map +0 -1
- package/dist/components/p-a521c59a.js +0 -2
- package/dist/components/p-a521c59a.js.map +0 -1
- package/dist/components/p-ba61e648.js +0 -2
- package/dist/components/p-ba61e648.js.map +0 -1
- package/dist/components/p-bfce6f99.js +0 -2
- package/dist/components/p-bfce6f99.js.map +0 -1
- package/dist/components/p-f9161803.js +0 -2
- package/dist/components/p-f9161803.js.map +0 -1
- package/dist/core/p-017ff5a5.entry.js +0 -2
- package/dist/core/p-017ff5a5.entry.js.map +0 -1
- package/dist/core/p-032accfb.entry.js +0 -2
- package/dist/core/p-032accfb.entry.js.map +0 -1
- package/dist/core/p-054aa25e.entry.js +0 -2
- package/dist/core/p-054aa25e.entry.js.map +0 -1
- package/dist/core/p-058e6fe2.entry.js +0 -2
- package/dist/core/p-058e6fe2.entry.js.map +0 -1
- package/dist/core/p-0724cb6a.entry.js +0 -2
- package/dist/core/p-0724cb6a.entry.js.map +0 -1
- package/dist/core/p-09c9eba6.entry.js +0 -2
- package/dist/core/p-09c9eba6.entry.js.map +0 -1
- package/dist/core/p-0c076b21.entry.js +0 -2
- package/dist/core/p-10f773c2.entry.js +0 -2
- package/dist/core/p-10f773c2.entry.js.map +0 -1
- package/dist/core/p-14d66f26.entry.js +0 -2
- package/dist/core/p-1aa7450e.entry.js +0 -2
- package/dist/core/p-237a5b91.entry.js +0 -2
- package/dist/core/p-269071f5.entry.js +0 -2
- package/dist/core/p-2ee042d4.js +0 -3
- package/dist/core/p-2ee042d4.js.map +0 -1
- package/dist/core/p-33310735.entry.js +0 -2
- package/dist/core/p-33310735.entry.js.map +0 -1
- package/dist/core/p-347d15d5.entry.js +0 -2
- package/dist/core/p-37473c34.entry.js +0 -2
- package/dist/core/p-3849ca02.entry.js.map +0 -1
- package/dist/core/p-3a7381e7.entry.js +0 -2
- package/dist/core/p-43d3dbc0.entry.js +0 -2
- package/dist/core/p-45b759f4.entry.js +0 -2
- package/dist/core/p-4c60e125.entry.js +0 -2
- package/dist/core/p-4e29744a.entry.js +0 -2
- package/dist/core/p-4e29744a.entry.js.map +0 -1
- package/dist/core/p-4fa0320d.entry.js +0 -2
- package/dist/core/p-50af9ae8.entry.js +0 -2
- package/dist/core/p-5c3f4cfe.entry.js +0 -2
- package/dist/core/p-5c3f4cfe.entry.js.map +0 -1
- package/dist/core/p-6b7c3a96.entry.js +0 -2
- package/dist/core/p-6b7c3a96.entry.js.map +0 -1
- package/dist/core/p-71f5d4ff.entry.js +0 -2
- package/dist/core/p-7a21fb90.entry.js +0 -2
- package/dist/core/p-7a21fb90.entry.js.map +0 -1
- package/dist/core/p-880743a5.js +0 -2
- package/dist/core/p-880743a5.js.map +0 -1
- package/dist/core/p-8bb6c816.entry.js +0 -2
- package/dist/core/p-8bb6c816.entry.js.map +0 -1
- package/dist/core/p-8cc5ad01.entry.js +0 -2
- package/dist/core/p-906865d0.entry.js +0 -2
- package/dist/core/p-967a1094.entry.js +0 -2
- package/dist/core/p-9846fd13.entry.js +0 -2
- package/dist/core/p-9846fd13.entry.js.map +0 -1
- package/dist/core/p-994385ca.entry.js +0 -2
- package/dist/core/p-994385ca.entry.js.map +0 -1
- package/dist/core/p-9f8d69a9.entry.js +0 -2
- package/dist/core/p-a521c59a.js +0 -2
- package/dist/core/p-a521c59a.js.map +0 -1
- package/dist/core/p-b62e49ee.entry.js +0 -2
- package/dist/core/p-cecbe73f.entry.js +0 -2
- package/dist/core/p-cecbe73f.entry.js.map +0 -1
- package/dist/core/p-d795a421.entry.js +0 -2
- package/dist/core/p-d795a421.entry.js.map +0 -1
- package/dist/core/p-d9b42773.entry.js +0 -2
- package/dist/core/p-d9b42773.entry.js.map +0 -1
- package/dist/core/p-e0a199ff.entry.js +0 -2
- package/dist/core/p-e0a199ff.entry.js.map +0 -1
- package/dist/core/p-e215f3ee.entry.js +0 -2
- package/dist/core/p-ed02945f.entry.js +0 -2
- package/dist/core/p-ee55932a.entry.js +0 -2
- package/dist/core/p-f2bb8c29.entry.js +0 -2
- package/dist/core/p-f54edd6c.entry.js +0 -2
- package/dist/core/p-f54edd6c.entry.js.map +0 -1
- package/dist/core/p-f7f60f91.entry.js +0 -2
- package/dist/core/p-fcac8531.entry.js +0 -2
- package/dist/core/p-fcac8531.entry.js.map +0 -1
- package/dist/esm/constants-2d5a0e18.js.map +0 -1
- package/dist/esm/constants-372455eb.js.map +0 -1
- package/dist/esm/gov-tiles.entry.js +0 -22
- package/dist/esm/gov-tiles.entry.js.map +0 -1
- package/dist/esm/index-087b155c.js.map +0 -1
- package/dist/types/components/gov-tile/container/constants.d.ts +0 -3
- package/dist/types/components/gov-tile/container/gov-tiles.d.ts +0 -10
- /package/dist/components/{p-03ad4e0f.js.map → p-73938936.js.map} +0 -0
- /package/dist/components/{p-384c7f2a.js.map → p-7be2301a.js.map} +0 -0
- /package/dist/components/{p-8ee6f2f3.js.map → p-f9a1ff6e.js.map} +0 -0
- /package/dist/core/{p-37473c34.entry.js.map → p-005214d1.entry.js.map} +0 -0
- /package/dist/core/{p-43d3dbc0.entry.js.map → p-1c7c9144.entry.js.map} +0 -0
- /package/dist/core/{p-927c31dd.entry.js.map → p-46ecf09e.entry.js.map} +0 -0
- /package/dist/core/{p-0f0f7302.entry.js.map → p-52042c7e.entry.js.map} +0 -0
- /package/dist/core/{p-c0800e6d.entry.js.map → p-5242b51b.entry.js.map} +0 -0
- /package/dist/core/{p-9f8d69a9.entry.js.map → p-564555e6.entry.js.map} +0 -0
- /package/dist/core/{p-0c076b21.entry.js.map → p-6e41cf69.entry.js.map} +0 -0
- /package/dist/core/{p-77daba72.entry.js.map → p-6f1ea21d.entry.js.map} +0 -0
- /package/dist/core/{p-7dfb7e36.entry.js.map → p-79ec86da.entry.js.map} +0 -0
- /package/dist/core/{p-3a7381e7.entry.js.map → p-8cbe8add.entry.js.map} +0 -0
- /package/dist/core/{p-4fa0320d.entry.js.map → p-8f73f8e0.entry.js.map} +0 -0
- /package/dist/core/{p-7baee44f.entry.js.map → p-99f192c1.entry.js.map} +0 -0
- /package/dist/core/{p-e215f3ee.entry.js.map → p-a02f2547.entry.js.map} +0 -0
- /package/dist/core/{p-a6a9de9a.entry.js.map → p-ae88fe6b.entry.js.map} +0 -0
- /package/dist/core/{p-063b70a2.entry.js.map → p-c2abc031.entry.js.map} +0 -0
- /package/dist/core/{p-b62e49ee.entry.js.map → p-c688349d.entry.js.map} +0 -0
- /package/dist/core/{p-50af9ae8.entry.js.map → p-c91512dd.entry.js.map} +0 -0
- /package/dist/core/{p-71f5d4ff.entry.js.map → p-de852480.entry.js.map} +0 -0
- /package/dist/core/{p-4c60e125.entry.js.map → p-e89471ef.entry.js.map} +0 -0
- /package/dist/core/{p-347d15d5.entry.js.map → p-f333c673.entry.js.map} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-0e4f24f9.js');
|
|
6
6
|
const template = require('./template-39939fd6.js');
|
|
7
7
|
const props = require('./props-d189860c.js');
|
|
8
8
|
const string_utils = require('./string.utils-b84c81cf.js');
|
|
@@ -116,14 +116,15 @@ const GovFormAutocomplete = class {
|
|
|
116
116
|
this.inheritedAttributes = accessibility.inheritAriaAttributes(this.host);
|
|
117
117
|
}
|
|
118
118
|
disconnectedCallback() {
|
|
119
|
-
|
|
119
|
+
var _a;
|
|
120
|
+
(_a = this.attributeObserver) === null || _a === void 0 ? void 0 : _a.stopObserving();
|
|
120
121
|
}
|
|
121
122
|
onAriaAttributeChange(attributeName, newValue) {
|
|
122
123
|
this.host.removeAttribute(attributeName);
|
|
123
124
|
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
|
|
124
125
|
}
|
|
125
126
|
render() {
|
|
126
|
-
return (index.h(index.Host, { key: '
|
|
127
|
+
return (index.h(index.Host, { key: '9aab109be9dc6f21e88a2da79223866b1b39732a', class: constants.FormAutocompleteClass.root, size: this.size }, index.h("gov-form-input", Object.assign({ key: '62828ff7629c39a283925c24113f0db2c7558ca5', 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": utils.throttle(this.onInputHandler.bind(this), this.throttleTime), "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": template.booleanString(this.list.length && this.focused ? true : false), ref: el => (this.inputRef = el) }), index.h("slot", { key: 'd722dd5d3241853d45a5153f0197403a42872c4a', name: "validation-icon" }), index.h("slot", { key: 'bb003098d072de7c33cb1f538470b2ba6a79d920', name: "icon-end" })), index.h("ul", { key: '4d54077583a9eed5682501372cd75f655e635203', class: constants.FormAutocompleteClass.list, role: 'listbox', "aria-hidden": template.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.messageEmpty ? (index.h("li", { class: constants.FormAutocompleteClass.empty }, this.messageEmpty)) : null, this.focused && this.processing === true && this.isValueAccepted ? (index.h("li", { class: constants.FormAutocompleteClass.loading }, index.h("gov-skeleton", { size: "m" }))) : null, this.focused ? this.list.map((item, index$1) => {
|
|
127
128
|
const isSelected = this.arrowCounter === index$1;
|
|
128
129
|
return (index.h("li", { class: constants.FormAutocompleteClass.item, innerHTML: this.templateResolver(item, isSelected), role: 'option', "aria-posinset": index$1, tabindex: isSelected ? 0 : -1, "aria-setsize": this.list.length, onTouchStart: (e) => this.onSelectHandler(e, index$1), onMouseDown: (e) => this.onSelectHandler(e, index$1), "aria-selected": template.toBoolAttr(isSelected) }, index.h("slot", { name: "list-item-left" }), index.h("slot", { name: "list-item-right" })));
|
|
129
130
|
}) : null)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-autocomplete.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;MAiBa,mBAAmB;IAQ/B;;;;;;QAHQ,qBAAgB,GAAiE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;qBAWrE,EAAE;;;;oBAgBZ,GAAG;uBAImB,MAAM;;wBAS3B,KAAK;wBAKU,KAAK;;;;yBAgBpB,CAAC;;4BAQE,GAAG;4BAIyB,gCAAgC;;0BAmB9E,KAAK;4BACH,CAAC,CAAC;oBACiB,EAAE;mCACF,EAAE;QA3F5C,IAAI,CAAC,SAAS,GAAGA,qBAAQ,CAAC,YAAY,CAAC,CAAA;KACvC;IA6FD,YAAY,CAAC,QAAgB;QAC5BC,kBAAY,CAACC,+BAAqB,EAAE,QAAQ,EAAEC,+BAAqB,CAAC,IAAI,CAAC,CAAA;KACzE;IAGD,YAAY,CAAC,QAA4C;QACxD,IAAI,CAAC,UAAU,CAACC,6BAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,CAAA;KACpD;IAEO,SAAS;QAChB,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE;YAC1B,IAAI,CAAC,YAAY,GAAG,I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,EAAE,CAAA;KAChC;;;;IAMD,MAAM,aAAa,CAAC,MAAe;QAClC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAA;KACxB;;;;IAMD,MAAM,iBAAiB,CAAC,QAAyC;QAChE,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAA;KAC9B;;;;;IAOD,MAAM,mBAAmB,CAAC,QAAmD;QAC5E,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAA;KAChC;;;;;;;;;;","names":["createID","validateProp","FormAutocompleteSizes","FormAutocompleteClass","propsValueToArray","delay","AttributeObserver","ariaAttributes","inheritAriaAttributes","h","Host","throttle","booleanString","toBoolAttr","index","has"],"sources":["../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"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"],"version":3}
|
|
1
|
+
{"file":"gov-form-autocomplete.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;MAiBa,mBAAmB;IAQ/B;;;;;;QAHQ,qBAAgB,GAAiE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;qBAWrE,EAAE;;;;oBAgBZ,GAAG;uBAImB,MAAM;;wBAS3B,KAAK;wBAKU,KAAK;;;;yBAgBpB,CAAC;;4BAQE,GAAG;4BAIyB,gCAAgC;;0BAmB9E,KAAK;4BACH,CAAC,CAAC;oBACiB,EAAE;mCACF,EAAE;QA3F5C,IAAI,CAAC,SAAS,GAAGA,qBAAQ,CAAC,YAAY,CAAC,CAAA;KACvC;IA6FD,YAAY,CAAC,QAAgB;QAC5BC,kBAAY,CAACC,+BAAqB,EAAE,QAAQ,EAAEC,+BAAqB,CAAC,IAAI,CAAC,CAAA;KACzE;IAGD,YAAY,CAAC,QAA4C;QACxD,IAAI,CAAC,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CAAC,CAAA;KACtB;;;;IAMD,MAAM,UAAU;QACf,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAA;QAExB,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAA;KAChC;;;;IAMD,MAAM,aAAa,CAAC,MAAe;QAClC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAA;KACxB;;;;IAMD,MAAM,iBAAiB,CAAC,QAAyC;QAChE,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAA;KAC9B;;;;;IAOD,MAAM,mBAAmB,CAAC,QAAmD;QAC5E,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAA;KAChC;;;;;;;;;;","names":["createID","validateProp","FormAutocompleteSizes","FormAutocompleteClass","propsValueToArray","delay","AttributeObserver","ariaAttributes","inheritAriaAttributes","h","Host","throttle","booleanString","toBoolAttr","index","has"],"sources":["../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"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"],"version":3}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const constants = require('./constants-
|
|
5
|
+
const index = require('./index-0e4f24f9.js');
|
|
6
|
+
const constants = require('./constants-7f713d6c.js');
|
|
7
7
|
const template = require('./template-39939fd6.js');
|
|
8
8
|
const props = require('./props-d189860c.js');
|
|
9
9
|
const stencil_utils = require('./stencil.utils-182382ee.js');
|
|
@@ -13,7 +13,7 @@ require('./sizes-89f8d3b2.js');
|
|
|
13
13
|
require('./gov.log-bfea3151.js');
|
|
14
14
|
require('./helpers.types-ff60c9bd.js');
|
|
15
15
|
|
|
16
|
-
const govFormGroupCss = "gov-form-group,.gov-form-group,gov-form-radio-group,.gov-form-radio-group,gov-form-checkbox-group,.gov-form-checkbox-group{margin-top:0;margin-bottom:0;position:relative;display:flex;width:100%;flex-direction:column;align-items:flex-start}gov-form-group .gov-form-label__label,.gov-form-group .gov-form-label__label,gov-form-radio-group .gov-form-label__label,.gov-form-radio-group .gov-form-label__label,gov-form-checkbox-group .gov-form-label__label,.gov-form-checkbox-group .gov-form-label__label{margin:0}gov-form-group[orientation=horizontal],.gov-form-group[orientation=horizontal],gov-form-radio-group[orientation=horizontal],.gov-form-radio-group[orientation=horizontal],gov-form-checkbox-group[orientation=horizontal],.gov-form-checkbox-group[orientation=horizontal]{flex-direction:row;flex-wrap:wrap}gov-form-group[orientation=horizontal] .gov-form-label__label,.gov-form-group[orientation=horizontal] .gov-form-label__label,gov-form-radio-group[orientation=horizontal] .gov-form-label__label,.gov-form-radio-group[orientation=horizontal] .gov-form-label__label,gov-form-checkbox-group[orientation=horizontal] .gov-form-label__label,.gov-form-checkbox-group[orientation=horizontal] .gov-form-label__label{white-space:nowrap}gov-form-group[gap=xs],.gov-form-group[gap=xs],gov-form-radio-group[gap=xs],.gov-form-radio-group[gap=xs],gov-form-checkbox-group[gap=xs],.gov-form-checkbox-group[gap=xs]{gap:var(--gap, var(--spacing-xs-nudge))}gov-form-group[gap=s],.gov-form-group[gap=s],gov-form-radio-group[gap=s],.gov-form-radio-group[gap=s],gov-form-checkbox-group[gap=s],.gov-form-checkbox-group[gap=s]{gap:var(--gap, var(--spacing-s))}gov-form-group[gap=m],.gov-form-group[gap=m],gov-form-radio-group[gap=m],.gov-form-radio-group[gap=m],gov-form-checkbox-group[gap=m],.gov-form-checkbox-group[gap=m]{gap:var(--gap, var(--spacing-
|
|
16
|
+
const govFormGroupCss = "gov-form-group,.gov-form-group,gov-form-radio-group,.gov-form-radio-group,gov-form-checkbox-group,.gov-form-checkbox-group{margin-top:0;margin-bottom:0;position:relative;display:flex;width:100%;flex-direction:column;align-items:flex-start}gov-form-group .gov-form-label__label,.gov-form-group .gov-form-label__label,gov-form-radio-group .gov-form-label__label,.gov-form-radio-group .gov-form-label__label,gov-form-checkbox-group .gov-form-label__label,.gov-form-checkbox-group .gov-form-label__label{margin:0}gov-form-group[orientation=horizontal],.gov-form-group[orientation=horizontal],gov-form-radio-group[orientation=horizontal],.gov-form-radio-group[orientation=horizontal],gov-form-checkbox-group[orientation=horizontal],.gov-form-checkbox-group[orientation=horizontal]{flex-direction:row;flex-wrap:wrap}gov-form-group[orientation=horizontal] .gov-form-label__label,.gov-form-group[orientation=horizontal] .gov-form-label__label,gov-form-radio-group[orientation=horizontal] .gov-form-label__label,.gov-form-radio-group[orientation=horizontal] .gov-form-label__label,gov-form-checkbox-group[orientation=horizontal] .gov-form-label__label,.gov-form-checkbox-group[orientation=horizontal] .gov-form-label__label{white-space:nowrap}gov-form-group[gap=xs],.gov-form-group[gap=xs],gov-form-radio-group[gap=xs],.gov-form-radio-group[gap=xs],gov-form-checkbox-group[gap=xs],.gov-form-checkbox-group[gap=xs]{gap:var(--gap, var(--spacing-xs-nudge))}gov-form-group[gap=s],.gov-form-group[gap=s],gov-form-radio-group[gap=s],.gov-form-radio-group[gap=s],gov-form-checkbox-group[gap=s],.gov-form-checkbox-group[gap=s]{gap:var(--gap, var(--spacing-s))}gov-form-group[gap=m],.gov-form-group[gap=m],gov-form-radio-group[gap=m],.gov-form-radio-group[gap=m],gov-form-checkbox-group[gap=m],.gov-form-checkbox-group[gap=m]{gap:var(--gap, var(--spacing-m))}gov-form-group[gap=l],.gov-form-group[gap=l],gov-form-radio-group[gap=l],.gov-form-radio-group[gap=l],gov-form-checkbox-group[gap=l],.gov-form-checkbox-group[gap=l]{gap:var(--gap, var(--spacing-l))}gov-form-group[gap=xl],.gov-form-group[gap=xl],gov-form-radio-group[gap=xl],.gov-form-radio-group[gap=xl],gov-form-checkbox-group[gap=xl],.gov-form-checkbox-group[gap=xl]{gap:var(--gap, var(--spacing-xl))}";
|
|
17
17
|
const GovFormCheckboxGroupStyle0 = govFormGroupCss;
|
|
18
18
|
|
|
19
19
|
const GovFormCheckboxGroup = class {
|
|
@@ -70,7 +70,7 @@ const GovFormCheckboxGroup = class {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
render() {
|
|
73
|
-
return (index.h(index.Host, { key: '
|
|
73
|
+
return (index.h(index.Host, { key: '22f738e5251d68688b6d21c471a5c18ae2532a5a', gap: this.gap, class: this.h.classes(constants.FormGroupClass.root), value: this.value }, index.h("slot", { key: '8028ab95f42dc8c8dfb8f1ee1b70879c291db6d4' })));
|
|
74
74
|
}
|
|
75
75
|
get host() { return index.getElement(this); }
|
|
76
76
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-checkbox-group.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,
|
|
1
|
+
{"file":"gov-form-checkbox-group.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,ssEAAssE,CAAC;AAC/tE,mCAAe,eAAe;;MCoBjB,oBAAoB;IAGhC;;;QAoCA,iBAAY,GAAG,CAAC,KAAqC;;YACpD,KAAK,CAAC,eAAe,EAAE,CAAA;YACvB,MAAM,KAAK,GAAGA,6BAAiB,CAAW,IAAI,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBAAE,OAAO;YAClC,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;gBACzB,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;aAC3C;iBAAM;gBACN,IAAI,CAAC,KAAK,GAAG,MAAA,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,KAAK,KAAK,CAAC,MAAM,C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AAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SACrD,CAAC,CAAA;KACF;IAED,MAAM;QACL,QACCC,QAACC,UAAI,qDAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAACJ,wBAAc,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,IACjFG,oEAAa,CACP,EACP;KACD;;;;;;;;;;;","names":["propsValueToArray","FormCheckboxGroupClass","govHost","validateProp","FormGroupSizes","FormGroupClass","FormGroupOrientation","tick","h","Host"],"sources":["../../../packages/core/src/components/gov-form/group/gov-form-group.scss?tag=gov-form-checkbox-group","../../../packages/core/src/components/gov-form/group/gov-form-checkbox-group.tsx"],"sourcesContent":["/* Form Control */\n\n\ngov-form-group, .gov-form-group,\ngov-form-radio-group, .gov-form-radio-group,\ngov-form-checkbox-group, .gov-form-checkbox-group {\n\t// VARIABLES\n\t@import \"./gov-form-group-variables\";\n\n\t@include reset-margin();\n\t@include base(flex);\n\tflex-direction: column;\n\talign-items: flex-start;\n\t.gov-form-label__label {\n\t\tmargin: 0;\n\t}\n\n\t&[orientation=\"horizontal\"] {\n\t\tflex-direction: row;\n\t\tflex-wrap: wrap;\n\t\t.gov-form-label__label {\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n\n\t// SIZES\n\t@each $size, $definitions in $form-group-gaps {\n\t\t&[gap=\"#{$size}\"] {\n\t\t\tgap: map-get($definitions, \"gap\");\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, Watch} from \"@stencil/core\"\nimport {\n\tFormCheckboxGroupClass,\n\tFormGroupClass,\n\tFormGroupOrientation,\n\tFormGroupOrientationType,\n\tFormGroupSizes,\n\tFormGroupSizesType\n} from \"./constants\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govHost} from \"../../../helpers/Dom/template\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {FormCheckboxEvent} from \"../checkbox/gov-form-checkbox.types\"\nimport {FormCheckboxGroupEvent} from \"./gov-form-group.types\"\nimport {tick} from \"../../../utils/stencil.utils\"\nimport {propsValueToArray} from \"../../../utils/array.utils\"\n\n@Component({\n\ttag: \"gov-form-checkbox-group\",\n\tstyleUrl: \"gov-form-group.scss\",\n})\nexport class GovFormCheckboxGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovFormGroupElement\n\t/**\n\t * Gap's size.\n\t */\n\t@Prop() readonly gap?: FormGroupSizesType = undefined\n\t/**\n\t * Elements orientation\n\t */\n\t@Prop() readonly orientation?: FormGroupOrientationType = 'vertical'\n\t/**\n\t * Group's value\n\t */\n\t@Prop({attribute: \"value\", mutable: true}) value?: string | string[] = undefined\n\t/**\n /* Emitted when the checkbox change value.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<FormCheckboxGroupEvent>\n\n\t@Watch(\"gap\")\n\tvalidateGap(newValue: string): void {\n\t\tif (newValue) {\n\t\t\tvalidateProp(FormGroupSizes, newValue, FormGroupClass.root)\n\t\t}\n\t}\n\n\t@Watch(\"orientation\")\n\tvalidateOrientation(newValue: string): void {\n\t\tif (newValue) {\n\t\t\tvalidateProp(FormGroupOrientation, newValue, FormGroupClass.root)\n\t\t}\n\t}\n\n\thandleChange = (event: CustomEvent<FormCheckboxEvent>) => {\n\t\tevent.stopPropagation()\n\t\tconst value = propsValueToArray<string[]>(this.value);\n\t\tif (!Array.isArray(value)) return;\n\t\tif (event.detail.checked) {\n\t\t\tthis.value = [...value, event.detail.value]\n\t\t} else {\n\t\t\tthis.value = value.filter((val) => val !== event.detail.value) ?? []\n\t\t}\n\t\tthis.govChange.emit({\n\t\t\tvalue: this.value,\n\t\t\tcomponent: FormCheckboxGroupClass.root,\n\t\t})\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateGap(this.gap)\n\t\tthis.validateOrientation(this.orientation)\n\t\tthis.value = propsValueToArray(this.value)\n\t}\n\n\tcomponentDidRender(): void {\n\t\ttick(() => this.rerenderComponent())\n\t}\n\n\trerenderComponent(): void {\n\t\tthis.host.querySelectorAll('gov-form-checkbox').forEach((element) => {\n\t\t\tif (!element.hasAttribute('listener-attached')) {\n\t\t\t\telement.addEventListener('gov-change', this.handleChange)\n\t\t\t}\n\t\t\telement.setAttribute('listener-attached', 'true')\n\t\t\telement.checked = this.value.includes(element.value);\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host gap={this.gap} class={this.h.classes(FormGroupClass.root)} value={this.value}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-0e4f24f9.js');
|
|
6
6
|
const string_utils = require('./string.utils-b84c81cf.js');
|
|
7
7
|
const props = require('./props-d189860c.js');
|
|
8
8
|
const form = require('./form-4e66039a.js');
|
|
@@ -71,7 +71,8 @@ const GovFormCheckbox = class {
|
|
|
71
71
|
this.hydrated = true;
|
|
72
72
|
}
|
|
73
73
|
disconnectedCallback() {
|
|
74
|
-
|
|
74
|
+
var _a;
|
|
75
|
+
(_a = this.attributeObserver) === null || _a === void 0 ? void 0 : _a.stopObserving();
|
|
75
76
|
}
|
|
76
77
|
onAriaAttributeChange(attributeName, newValue) {
|
|
77
78
|
this.host.removeAttribute(attributeName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-checkbox.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;MAiBa,eAAe;IAS3B;;;;;QAFQ,aAAQ,GAAG,KAAK,CAAA;;uBAiBwB,KAAK;wBAKhB,KAAK;wBAIU,KA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,OAAO;YACrB,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;IAEO,aAAa,CAAC,CAAa;QAClC,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,EAAEA,sBAAiB,CAAC,IAAI;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;IAEO,cAAc,CAAC,CAAe;QACrC,CAAC,CAAC,eAAe,EAAE,CAAA;KACnB;IAEO,eAAe,CAAC,CAAQ;QAC/B,IAAI,CAAC,OAAO,GAAI,CAAC,CAAC,MAA2B,CAAC,OAAO,CAAA;QACrD,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YACnB,SAAS,EAAEA,sBAAiB,CAAC,IAAI;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;;;;IAMD,MAAM,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,CAAA;KACpB;;;;;;;;;;;","names":["createID","govHost","govForm","validateProp","FormCheckboxSizes","FormCheckboxClass","toBoolAttr","inheritAriaAttributes","AttributeObserver","ariaAttributes","h","Host","toBoolAttrIfDefined","Fragment"],"sources":["../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {FormCheckboxClass, FormCheckboxSizes, FormCheckboxSizesType} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport {FormCheckboxEvent} from \"./gov-form-checkbox.types\"\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-checkbox\",\n})\nexport class GovFormCheckbox {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\tprivate attributeObserver: AttributeObserver\n\n\tprivate readonly checkboxId: string\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormCheckboxElement\n\t/**\n\t * Value of checkbox\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * Checkbox button state\n\t */\n\t@Prop({reflect: true, mutable: true}) checked = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the checkbox component disabled.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter (https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate)\n\t */\n\t@Prop({reflect: true}) readonly indeterminate: boolean = false\n\t/**\n\t * Name of the checkbox.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Checkboxes size.\n\t */\n\t@Prop({reflect: true}) readonly size?: FormCheckboxSizesType = \"m\"\n\t/**\n\t * Custom checkbox identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({attribute: \"no-label\"}) readonly noLabel: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Emitted when the checkbox has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox change value.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<FormCheckboxEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormCheckboxSizes, newValue, FormCheckboxClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"checkbox\")\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.passControlAttrs()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\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\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\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\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label class={FormCheckboxClass.label}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormCheckboxClass.root}\n\t\t\t\t\t\thydrated={this.hydrated}\n\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\tinvalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tindeterminate={this.indeterminate}\n\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\t\taria-checked={toBoolAttr(this.checked)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"label\"/>\n\t\t\t\t\t\t\t<gov-icon class={FormCheckboxClass.check} name=\"check-lg\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t<gov-icon class={FormCheckboxClass.indeterminate} name=\"dash-lg\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Fragment>,\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"gov-form-checkbox.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;MAiBa,eAAe;IAS3B;;;;;QAFQ,aAAQ,GAAG,KAAK,CAAA;;uBAiBwB,KAAK;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AK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;IAEO,aAAa,CAAC,CAAa;QAClC,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,EAAEA,sBAAiB,CAAC,IAAI;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;IAEO,cAAc,CAAC,CAAe;QACrC,CAAC,CAAC,eAAe,EAAE,CAAA;KACnB;IAEO,eAAe,CAAC,CAAQ;QAC/B,IAAI,CAAC,OAAO,GAAI,CAAC,CAAC,MAA2B,CAAC,OAAO,CAAA;QACrD,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YACnB,SAAS,EAAEA,sBAAiB,CAAC,IAAI;YACjC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;;;;IAMD,MAAM,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,CAAA;KACpB;;;;;;;;;;;","names":["createID","govHost","govForm","validateProp","FormCheckboxSizes","FormCheckboxClass","toBoolAttr","inheritAriaAttributes","AttributeObserver","ariaAttributes","h","Host","toBoolAttrIfDefined","Fragment"],"sources":["../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {FormCheckboxClass, FormCheckboxSizes, FormCheckboxSizesType} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport {FormCheckboxEvent} from \"./gov-form-checkbox.types\"\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-checkbox\",\n})\nexport class GovFormCheckbox {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\tprivate attributeObserver: AttributeObserver\n\n\tprivate readonly checkboxId: string\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormCheckboxElement\n\t/**\n\t * Value of checkbox\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * Checkbox button state\n\t */\n\t@Prop({reflect: true, mutable: true}) checked = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the checkbox component disabled.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter (https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate)\n\t */\n\t@Prop({reflect: true}) readonly indeterminate: boolean = false\n\t/**\n\t * Name of the checkbox.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Checkboxes size.\n\t */\n\t@Prop({reflect: true}) readonly size?: FormCheckboxSizesType = \"m\"\n\t/**\n\t * Custom checkbox identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({attribute: \"no-label\"}) readonly noLabel: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Emitted when the checkbox has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox change value.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<FormCheckboxEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormCheckboxSizes, newValue, FormCheckboxClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"checkbox\")\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.passControlAttrs()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\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\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\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\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label class={FormCheckboxClass.label}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormCheckboxClass.root}\n\t\t\t\t\t\thydrated={this.hydrated}\n\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\tinvalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tindeterminate={this.indeterminate}\n\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\t\taria-checked={toBoolAttr(this.checked)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"label\"/>\n\t\t\t\t\t\t\t<gov-icon class={FormCheckboxClass.check} name=\"check-lg\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t<gov-icon class={FormCheckboxClass.indeterminate} name=\"dash-lg\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Fragment>,\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n}\n"],"version":3}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-0e4f24f9.js');
|
|
6
6
|
const form = require('./form-4e66039a.js');
|
|
7
7
|
const template = require('./template-39939fd6.js');
|
|
8
8
|
const string_utils = require('./string.utils-b84c81cf.js');
|
|
@@ -58,7 +58,7 @@ const GovFormControl = class {
|
|
|
58
58
|
}
|
|
59
59
|
render() {
|
|
60
60
|
const Tag = this.fieldset ? "fieldset" : "div";
|
|
61
|
-
return (index.h(index.Host, { key: '
|
|
61
|
+
return (index.h(index.Host, { key: '2f6a44e96f79c5ec6fa6326fb01dba74d2f405cc', size: this.size, class: this.h.classes(form.FormControlClass.root) }, index.h(Tag, { key: '5b4ec1e274416aa4330f60727662f9f441cb5973', class: form.FormControlClass.holder }, this.h.hasSlot("top") && index.h("slot", { key: '51738751699005e6642bdf855f6fafbea9af83f6', name: "top" }), index.h("slot", { key: 'f765b4b014274832bbef5118312a0e8a70939cda' }), this.h.hasSlot("bottom") && (index.h("div", { key: '048b08353a3bb6c6246e297bc183288cb9c78034', class: form.FormControlClass.bottom }, index.h("slot", { key: '24e79aa1a2d87c12ac0ebefde129a8055f38525e', name: "bottom" }))))));
|
|
62
62
|
}
|
|
63
63
|
get host() { return index.getElement(this); }
|
|
64
64
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-0e4f24f9.js');
|
|
6
6
|
const string_utils = require('./string.utils-b84c81cf.js');
|
|
7
7
|
const template = require('./template-39939fd6.js');
|
|
8
8
|
const form = require('./form-4e66039a.js');
|
|
@@ -176,14 +176,15 @@ const GovFormFile = class {
|
|
|
176
176
|
this.registerListeners();
|
|
177
177
|
}
|
|
178
178
|
disconnectedCallback() {
|
|
179
|
-
|
|
179
|
+
var _a;
|
|
180
|
+
(_a = this.attributeObserver) === null || _a === void 0 ? void 0 : _a.stopObserving();
|
|
180
181
|
}
|
|
181
182
|
onAriaAttributeChange(attributeName, newValue) {
|
|
182
183
|
this.host.removeAttribute(attributeName);
|
|
183
184
|
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
|
|
184
185
|
}
|
|
185
186
|
render() {
|
|
186
|
-
return (index.h(index.Host, { key: '
|
|
187
|
+
return (index.h(index.Host, { key: '57a2ec8520c058114c22a58cc666d74efccb9a96', class: this.h.classes([FormFileClass.root]), invalid: template.toBoolAttrIfDefined(this.invalid), expanded: template.toBoolAttrIfDefined(this.expanded) }, index.h("div", { key: '6a31911301d1b3eaaeafe32f3167fc0a5893125a', class: FormFileClass.area, ref: el => (this.areaRef = el) }, index.h("slot", { key: 'feae9382b0223eec714593882ade1904d284e40d' }), index.h("input", Object.assign({ key: 'b6a16d19ba27cdd878540b39bc440d11761a3ab5', 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": template.toBoolAttrIfDefined(this.required), "aria-invalid": template.toBoolAttrIfDefined(this.invalid), "aria-disabled": template.toBoolAttrIfDefined(this.disabled) }))), this.h.hasSlot("attachments") ? (index.h("div", { class: FormFileClass.attachments }, index.h("slot", { name: "attachments" }))) : null, this.files.length && this.displayAttachments ? (index.h("div", { class: FormFileClass.attachments }, index.h("gov-attachments", { label: this.accessibleAttachmentsLabel, "accessible-label": this.accessibleAttachmentsLabel }, this.files.map(item => (index.h("gov-attachments-item", { "accessible-remove-labelledby": item.id, "on-gov-remove": () => this.onRemoveFileHandler(item) }, index.h("span", { class: "sr-only", id: item.id }, this.accessibleRemoveLabel.replace("{FILE_NAME}", item.file.name)), item.file.name, item.acceptValid === false ? (index.h("gov-form-message", { slot: "message", color: "error" }, index.h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill", type: "components" }), item.acceptValid === false ? this.errorAccept : null)) : null, item.sizeValid === false ? (index.h("gov-form-message", { slot: "message", color: "error" }, index.h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill", type: "components" }), this.errorSize.replace("{FILE_SIZE}", formatBytes(this.maxFileSize)))) : null, index.h("span", { slot: "info" }, "(", formatBytes(item.file.size), ")"))))))) : null));
|
|
187
188
|
}
|
|
188
189
|
onRemoveFileHandler(file) {
|
|
189
190
|
const index = this.files.findIndex(item => item.id === file.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-file.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;AAAO,MAAM,aAAa,GAAG;IAC5B,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EAAE,4BAA4B;CACzC;;SCLe,WAAW,CAAC,KAAU;IACrC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;IAC/E,IAAI,CAAC,GAAG,CAAC,EACR,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,CAAA;IAE7B,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,EAAE;QACxB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;KACZ;IAED,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;AAC3D,CAAC;SAEe,oBAAoB,CAAC,IAAU,EAAE,MAAc;IAC9D,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE;QAChD,QACC,MAAM;aACJ,OAAO,CAAC,KAA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,EAAE,aAAa,CAAC,IAAI;YAC7B,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;IAEO,aAAa,CAAC,CAAa;QAClC,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,EAAE,aAAa,CAAC,IAAI;YAC7B,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;IAEO,eAAe,CAAC,CAAQ;QAC/B,CAAC,CAAC,eAAe,EAAE,CAAA;KACnB;;;;IAMD,MAAM,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,CAAA;KACpB;;;;IAMD,MAAM,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAA;KACnB;;;;IAMD,MAAM,KAAK;QACV,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC;KACzB;;;;;;;;;;","names":["createID","govHost","govForm","toBoolAttr","AttributeObserver","ariaAttributes","inheritAriaAttributes","h","Host","toBoolAttrIfDefined"],"sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tinput: 'gov-form-file__input',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept === 'string' && accept.length) {\n\t\treturn (\n\t\t\taccept\n\t\t\t\t.replace(/\\s/g, '')\n\t\t\t\t.split(',')\n\t\t\t\t.filter(accept => {\n\t\t\t\t\treturn new RegExp(accept.replace('*', '.*')).test(file.type)\n\t\t\t\t}).length > 0\n\t\t)\n\t} else {\n\t\treturn true\n\t}\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size)\n\treturn fileSize <= maxSize\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-file\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\tprivate attributeObserver: AttributeObserver\n\tprivate eventsRegistered = false\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = false\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"accessible-remove-label\"}) readonly accessibleRemoveLabel: string = \"Odebrat soubor {FILE_NAME}\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"accessible-attachments-label\"}) readonly accessibleAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() files: GovFormFileItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tif (this.eventsRegistered) {\n\t\t\treturn\n\t\t}\n\t\tthis.eventsRegistered = true\n\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\tArray.from(files).map(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\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.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.registerListeners()\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={this.h.classes([FormFileClass.root])}\n\t\t\t\t invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t expanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.accessibleAttachmentsLabel}\n\t\t\t\t\t\t\t\t\t\t accessible-label={this.accessibleAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item accessible-remove-labelledby={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t on-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t<span class={\"sr-only\"} id={item.id}>\n\t\t\t\t\t\t\t\t\t\t{this.accessibleRemoveLabel.replace(\"{FILE_NAME}\", item.file.name)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tthis.inputRef.value = '';\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"gov-form-file.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;AAAO,MAAM,aAAa,GAAG;IAC5B,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EAAE,4BAA4B;CACzC;;SCLe,WAAW,CAAC,KAAU;IACrC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;IAC/E,IAAI,CAAC,GAAG,CAAC,EACR,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,CAAA;IAE7B,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,EAAE;QACxB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;KACZ;IAED,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;AAC3D,CAAC;SAEe,oBAAoB,CAAC,IAAU,EAAE,MAAc;IAC9D,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE;QAChD,QACC,MAAM;aACJ,OAAO,CA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AAC;YAClB,SAAS,EAAE,aAAa,CAAC,IAAI;YAC7B,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;IAEO,aAAa,CAAC,CAAa;QAClC,CAAC,CAAC,eAAe,EAAE,CAAA;QACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,EAAE,aAAa,CAAC,IAAI;YAC7B,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;KACF;IAEO,eAAe,CAAC,CAAQ;QAC/B,CAAC,CAAC,eAAe,EAAE,CAAA;KACnB;;;;IAMD,MAAM,MAAM;QACX,OAAO,IAAI,CAAC,QAAQ,CAAA;KACpB;;;;IAMD,MAAM,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAA;KACnB;;;;IAMD,MAAM,KAAK;QACV,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC;KACzB;;;;;;;;;;","names":["createID","govHost","govForm","toBoolAttr","AttributeObserver","ariaAttributes","inheritAriaAttributes","h","Host","toBoolAttrIfDefined"],"sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tinput: 'gov-form-file__input',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept === 'string' && accept.length) {\n\t\treturn (\n\t\t\taccept\n\t\t\t\t.replace(/\\s/g, '')\n\t\t\t\t.split(',')\n\t\t\t\t.filter(accept => {\n\t\t\t\t\treturn new RegExp(accept.replace('*', '.*')).test(file.type)\n\t\t\t\t}).length > 0\n\t\t)\n\t} else {\n\t\treturn true\n\t}\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size)\n\treturn fileSize <= maxSize\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-file\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\tprivate attributeObserver: AttributeObserver\n\tprivate eventsRegistered = false\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = false\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"accessible-remove-label\"}) readonly accessibleRemoveLabel: string = \"Odebrat soubor {FILE_NAME}\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"accessible-attachments-label\"}) readonly accessibleAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() files: GovFormFileItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tif (this.eventsRegistered) {\n\t\t\treturn\n\t\t}\n\t\tthis.eventsRegistered = true\n\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\tArray.from(files).map(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\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.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.registerListeners()\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={this.h.classes([FormFileClass.root])}\n\t\t\t\t invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t expanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.accessibleAttachmentsLabel}\n\t\t\t\t\t\t\t\t\t\t accessible-label={this.accessibleAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item accessible-remove-labelledby={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t on-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t<span class={\"sr-only\"} id={item.id}>\n\t\t\t\t\t\t\t\t\t\t{this.accessibleRemoveLabel.replace(\"{FILE_NAME}\", item.file.name)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tthis.inputRef.value = '';\n\t}\n}\n"],"version":3}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const constants = require('./constants-
|
|
5
|
+
const index = require('./index-0e4f24f9.js');
|
|
6
|
+
const constants = require('./constants-7f713d6c.js');
|
|
7
7
|
const template = require('./template-39939fd6.js');
|
|
8
8
|
const props = require('./props-d189860c.js');
|
|
9
9
|
require('./utils-d263c5c6.js');
|
|
@@ -32,7 +32,7 @@ const GovFormGroup = class {
|
|
|
32
32
|
this.validateOrientation(this.orientation);
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
|
-
return (index.h(index.Host, { key: '
|
|
35
|
+
return (index.h(index.Host, { key: '23bc665133af4d63acae967405c379aef79f9125', gap: this.gap, class: this.h.classes(constants.FormGroupClass.root) }, index.h("slot", { key: '11d303816dae7149170180b450542c2cd1a322c6' })));
|
|
36
36
|
}
|
|
37
37
|
get host() { return index.getElement(this); }
|
|
38
38
|
static get watchers() { return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-0e4f24f9.js');
|
|
6
6
|
const form = require('./form-4e66039a.js');
|
|
7
7
|
const template = require('./template-39939fd6.js');
|
|
8
8
|
const props = require('./props-d189860c.js');
|
|
@@ -97,15 +97,16 @@ const GovFormInput = class {
|
|
|
97
97
|
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
|
|
98
98
|
}
|
|
99
99
|
disconnectedCallback() {
|
|
100
|
-
|
|
100
|
+
var _a;
|
|
101
|
+
(_a = this.attributeObserver) === null || _a === void 0 ? void 0 : _a.stopObserving();
|
|
101
102
|
}
|
|
102
103
|
render() {
|
|
103
104
|
const Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT;
|
|
104
|
-
return (index.h(index.Host, { key: '
|
|
105
|
-
index.h("div", { key: '
|
|
106
|
-
index.h("div", { key: '
|
|
107
|
-
index.h("gov-icon", { key: '
|
|
108
|
-
index.h("gov-icon", { key: '
|
|
105
|
+
return (index.h(index.Host, { key: 'bdbab2105ea328155d7a023e2070c4ca22a5afba', class: form.FormInputClass.root, size: this.size, type: this.type }, this.h.hasSlot("prefix") && index.h("slot", { key: '71be98f4ba1933c8a5affd3f41b496633528bcc8', name: "prefix" }), index.h("span", { key: '820a6cc14d90fb52b3fa809858c9b7223d7dec21', class: "element" }, (this.h.hasSlot("icon-start") && !this.multiline) &&
|
|
106
|
+
index.h("div", { key: '6c001fb96074d4f5b7779a14cbceee9169b4a70a', class: form.FormInputClass.icons, onClick: () => this.inputRef.focus() }, index.h("slot", { key: '15da634518db7ac788de51911296d1a0ca87c993', name: "icon-start" })), index.h(Tag, Object.assign({ key: 'f43777146426ddbe5d37408a734ca61aa51e0e69', type: this.inputType === 'password' && this.showPassword ? 'text' : this.inputType, disabled: this.disabled, id: this.identifier || this.inputId, name: this.name, onFocus: this.onFocusHandler.bind(this), onInput: this.onInputHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onKeyUp: this.onKeyUpHandler.bind(this), onKeyDown: this.onKeyDownHandler.bind(this), ref: el => (this.inputRef = el), placeholder: this.placeholder, spellcheck: template.toBoolAttrIfDefined(this.spellcheck), lang: this.inputLang, readonly: template.toBoolAttrIfDefined(this.readonly), autocomplete: template.toOnOffAttrIfDefined(this.autocomplete), autocorrect: template.toOnOffAttrIfDefined(this.autocorrect), minlength: this.minlength, maxlength: this.maxlength, min: this.min, max: this.max, required: this.required, rows: this.rows, cols: this.cols, role: this.role, value: this.value }, this.inheritedAttributes, { "aria-required": template.toBoolAttrIfDefined(this.required), "aria-invalid": template.toBoolAttrIfDefined(this.invalid), "aria-disabled": template.toBoolAttrIfDefined(this.disabled) })), ((this.success || this.invalid || this.h.hasSlot("icon-end") || this.inputType === 'password') && !this.multiline) &&
|
|
107
|
+
index.h("div", { key: '716e004caf2077ce8d5ee5101bcb541fbdb45d38', class: form.FormInputClass.icons, onClick: () => this.inputRef.focus() }, this.success && !this.multiline &&
|
|
108
|
+
index.h("gov-icon", { key: '96c5fcdad8332c08d3eaf9a5a6af573962a96744', class: "validation-icon", name: "check-lg", type: "components" }), this.invalid && !this.multiline &&
|
|
109
|
+
index.h("gov-icon", { key: '4883e137f51052a2659f46a09270c656bc3347f7', class: "validation-icon", name: "exclamation-lg", type: "components" }), this.h.hasSlot("icon-end") && this.inputType !== 'password' && index.h("slot", { key: 'a74b2df0932087834fc33de45aa341444c61042a', name: "icon-end" }), this.inputType === 'password' ? (index.h("gov-button", { color: 'primary', type: 'base', size: this.size, "aria-label": this.showPassword ? this.accessibleHidePasswordLabel : this.accessibleShowPasswordLabel, "on-gov-click": () => this.showPassword = !this.showPassword }, index.h("gov-icon", { slot: "icon-start", name: "eye", type: "components" }))) : null)), this.h.hasSlot("sufix") && index.h("slot", { key: '9d15adccc023a5501114982c4417df6db9a4d8c1', name: "sufix" })));
|
|
109
110
|
}
|
|
110
111
|
onFocusHandler(e) {
|
|
111
112
|
e.stopPropagation();
|
|
@@ -240,7 +241,8 @@ const GovSkeleton = class {
|
|
|
240
241
|
this.init();
|
|
241
242
|
}
|
|
242
243
|
disconnectedCallback() {
|
|
243
|
-
|
|
244
|
+
var _a;
|
|
245
|
+
(_a = this.attributeObserver) === null || _a === void 0 ? void 0 : _a.stopObserving();
|
|
244
246
|
}
|
|
245
247
|
onAriaAttributeChange(attributeName, newValue) {
|
|
246
248
|
this.host.removeAttribute(attributeName);
|
|
@@ -263,7 +265,7 @@ const GovSkeleton = class {
|
|
|
263
265
|
return Object.assign({}, dimenssionsStyles);
|
|
264
266
|
}
|
|
265
267
|
render() {
|
|
266
|
-
return (index.h(index.Host, Object.assign({ key: '
|
|
268
|
+
return (index.h(index.Host, Object.assign({ key: '5f948f681fcb9e8edeba710b0bc9b44d4bd44c68', size: this.size, color: this.color, class: {
|
|
267
269
|
[SkeletonClass.root]: true,
|
|
268
270
|
circle: this.shape === "circle",
|
|
269
271
|
line: this.shape === "line",
|