@gov-design-system-ce/components 4.1.0-rc1 → 4.1.1
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/{colors-976f6dff.js → colors-f7c8eadd.js} +7 -9
- package/dist/cjs/colors-f7c8eadd.js.map +1 -0
- package/dist/cjs/{constants-e2807da6.js → constants-49f0efa6.js} +2 -2
- package/dist/cjs/{constants-e2807da6.js.map → constants-49f0efa6.js.map} +1 -1
- package/dist/cjs/{constants-43c0c51b.js → constants-4dfa23e3.js} +2 -2
- package/dist/cjs/{constants-43c0c51b.js.map → constants-4dfa23e3.js.map} +1 -1
- package/dist/cjs/{constants-441d1af4.js → constants-82929d01.js} +2 -2
- package/dist/cjs/{constants-441d1af4.js.map → constants-82929d01.js.map} +1 -1
- package/dist/cjs/{constants-bd0d66ac.js → constants-b9fece07.js} +2 -2
- package/dist/cjs/{constants-bd0d66ac.js.map → constants-b9fece07.js.map} +1 -1
- package/dist/cjs/{constants-5037cdc9.js → constants-c0886404.js} +2 -2
- package/dist/cjs/{constants-5037cdc9.js.map → constants-c0886404.js.map} +1 -1
- package/dist/cjs/{constants-861428a4.js → constants-f464dc4c.js} +2 -2
- package/dist/cjs/{constants-861428a4.js.map → constants-f464dc4c.js.map} +1 -1
- package/dist/cjs/core.cjs.js +2 -2
- package/dist/cjs/{form-c1aec07a.js → form-4e66039a.js} +4 -3
- package/dist/cjs/form-4e66039a.js.map +1 -0
- package/dist/cjs/gov-accordion-item.cjs.entry.js +11 -9
- package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-accordion.cjs.entry.js +4 -5
- package/dist/cjs/gov-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-attachments_3.cjs.entry.js +14 -15
- package/dist/cjs/gov-attachments_3.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-backdrop.cjs.entry.js +7 -8
- package/dist/cjs/gov-backdrop.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js +7 -8
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-button.cjs.entry.js +12 -13
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-card.cjs.entry.js +7 -8
- package/dist/cjs/gov-card.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-chip.cjs.entry.js +13 -14
- package/dist/cjs/gov-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-container.cjs.entry.js +3 -11
- package/dist/cjs/gov-container.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-control-group.cjs.entry.js +6 -7
- package/dist/cjs/gov-control-group.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-cookiebar.cjs.entry.js +3 -3
- package/dist/cjs/gov-dialog.cjs.entry.js +7 -8
- package/dist/cjs/gov-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-dropdown.cjs.entry.js +6 -6
- package/dist/cjs/gov-empty.cjs.entry.js +5 -6
- package/dist/cjs/gov-empty.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-error-code.cjs.entry.js +3 -3
- package/dist/cjs/gov-flex_4.cjs.entry.js +339 -0
- package/dist/cjs/gov-flex_4.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +6 -8
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-checkbox-group.cjs.entry.js +6 -7
- package/dist/cjs/gov-form-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +9 -10
- package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-control.cjs.entry.js +7 -7
- package/dist/cjs/gov-form-file.cjs.entry.js +13 -10
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-group.cjs.entry.js +5 -6
- package/dist/cjs/gov-form-group.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-input_2.cjs.entry.js +14 -13
- package/dist/cjs/gov-form-input_2.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +13 -29
- 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 +6 -7
- package/dist/cjs/gov-form-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js +8 -9
- package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-search.cjs.entry.js +3 -3
- package/dist/cjs/gov-form-select.cjs.entry.js +10 -11
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-switch.cjs.entry.js +9 -10
- package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-grid-item.cjs.entry.js +3 -3
- package/dist/cjs/gov-grid.cjs.entry.js +3 -3
- package/dist/cjs/gov-infobar.cjs.entry.js +7 -8
- package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-layout-column.cjs.entry.js +3 -3
- package/dist/cjs/gov-layout.cjs.entry.js +3 -3
- package/dist/cjs/gov-lifecycle.cjs.entry.js +47 -0
- package/dist/cjs/gov-lifecycle.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-link.cjs.entry.js +51 -0
- package/dist/cjs/gov-link.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-loading.cjs.entry.js +5 -6
- package/dist/cjs/gov-loading.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-message.cjs.entry.js +6 -7
- package/dist/cjs/gov-message.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js +8 -9
- package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-spacer.cjs.entry.js +5 -6
- package/dist/cjs/gov-spacer.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-stepper-item.cjs.entry.js +8 -9
- package/dist/cjs/gov-stepper-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-stepper.cjs.entry.js +7 -8
- package/dist/cjs/gov-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tabs-item.cjs.entry.js +6 -6
- package/dist/cjs/gov-tabs.cjs.entry.js +7 -8
- package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tag.cjs.entry.js +11 -12
- package/dist/cjs/gov-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tile.cjs.entry.js +3 -3
- package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tiles.cjs.entry.js +3 -3
- package/dist/cjs/gov-toast.cjs.entry.js +10 -11
- package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tooltip-content.cjs.entry.js +5 -5
- package/dist/cjs/gov-tooltip-content.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tooltip.cjs.entry.js +12 -13
- package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizard-item.cjs.entry.js +10 -11
- package/dist/cjs/gov-wizard-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizard.cjs.entry.js +10 -11
- package/dist/cjs/gov-wizard.cjs.entry.js.map +1 -1
- package/dist/cjs/{win-587f4614.js → gov.log-bfea3151.js} +16 -4
- package/dist/cjs/gov.log-bfea3151.js.map +1 -0
- package/dist/cjs/{index-1af4880c.js → index-7ff4447c.js} +20 -12
- package/dist/cjs/index-7ff4447c.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{props-b8a955b2.js → props-d189860c.js} +2 -2
- package/dist/cjs/{props-b8a955b2.js.map → props-d189860c.js.map} +1 -1
- package/dist/cjs/{string.utils-2335838f.js → string.utils-b84c81cf.js} +2 -1
- package/dist/cjs/string.utils-b84c81cf.js.map +1 -0
- package/dist/cjs/{template-b070338f.js → template-39939fd6.js} +1 -20
- package/dist/cjs/template-39939fd6.js.map +1 -0
- package/dist/cjs/{wcag-31089f70.js → wcag-2927ff73.js} +5 -6
- package/dist/cjs/wcag-2927ff73.js.map +1 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/gov-accordion/gov-accordion-item.js +8 -5
- package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments-item.css +6 -35
- package/dist/collection/components/gov-attachments/gov-attachments-item.js +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments-item.js.map +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments.js +1 -1
- package/dist/collection/components/gov-backdrop/gov-backdrop.js +1 -1
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +1 -1
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
- package/dist/collection/components/gov-button/button/gov-button.js +9 -9
- 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-card/gov-card.js.map +1 -1
- package/dist/collection/components/gov-chip/gov-chip.js +16 -16
- package/dist/collection/components/gov-chip/gov-chip.js.map +1 -1
- package/dist/collection/components/gov-container/gov-container.js +2 -38
- package/dist/collection/components/gov-container/gov-container.js.map +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/constants.js +4 -0
- package/dist/collection/components/gov-flex/constants.js.map +1 -0
- package/dist/collection/components/gov-flex/gov-flex.js +127 -0
- package/dist/collection/components/gov-flex/gov-flex.js.map +1 -0
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +2 -21
- 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 +3 -3
- 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 +8 -23
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-form/group/gov-form-checkbox-group.js +1 -1
- package/dist/collection/components/gov-form/group/gov-form-group.css +7 -36
- package/dist/collection/components/gov-form/group/gov-form-group.js +1 -1
- package/dist/collection/components/gov-form/group/gov-form-radio-group.js +1 -1
- package/dist/collection/components/gov-form/input/constants.js +1 -0
- package/dist/collection/components/gov-form/input/constants.js.map +1 -1
- package/dist/collection/components/gov-form/input/gov-form-input.js +5 -3
- 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 +6 -30
- 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 +1 -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 -4
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-form/switch/constants.js +1 -1
- package/dist/collection/components/gov-form/switch/constants.js.map +1 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.js +4 -4
- package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
- package/dist/collection/components/gov-grid/gov-grid-item.js +1 -1
- package/dist/collection/components/gov-grid/gov-grid.js +1 -1
- package/dist/collection/components/gov-icon/constants.js +8 -7
- package/dist/collection/components/gov-icon/constants.js.map +1 -1
- package/dist/collection/components/gov-icon/gov-icon.js +41 -10
- package/dist/collection/components/gov-icon/gov-icon.js.map +1 -1
- package/dist/collection/components/gov-icon/list.js +43 -151
- package/dist/collection/components/gov-icon/list.js.map +1 -1
- package/dist/collection/components/gov-infobar/gov-infobar.js +2 -2
- 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 +39 -0
- package/dist/collection/components/gov-lifecycle-tester/gov-lifecycle-tester.js.map +1 -0
- package/dist/collection/components/gov-link/constants.js +7 -0
- package/dist/collection/components/gov-link/constants.js.map +1 -0
- package/dist/collection/components/gov-link/gov-link.js +129 -0
- package/dist/collection/components/gov-link/gov-link.js.map +1 -0
- package/dist/collection/components/gov-loading/loading/gov-loading.js +1 -1
- package/dist/collection/components/gov-loading/loading/gov-loading.js.map +1 -1
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js +1 -1
- package/dist/collection/components/gov-message/gov-message.js +1 -1
- package/dist/collection/components/gov-pagination/gov-pagination.js +2 -2
- 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/gov-stepper-item.js +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 +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
- package/dist/collection/components/gov-tag/gov-tag.js +9 -9
- package/dist/collection/components/gov-tag/gov-tag.js.map +1 -1
- package/dist/collection/components/gov-theme-switch/constants.js +9 -1
- package/dist/collection/components/gov-theme-switch/constants.js.map +1 -1
- package/dist/collection/components/gov-theme-switch/gov-theme-switch.js +134 -10
- package/dist/collection/components/gov-theme-switch/gov-theme-switch.js.map +1 -1
- package/dist/collection/components/gov-tile/container/gov-tiles.js +1 -1
- package/dist/collection/components/gov-tile/gov-tile.js +7 -7
- package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
- package/dist/collection/components/gov-toast/constants.js +1 -0
- package/dist/collection/components/gov-toast/constants.js.map +1 -1
- package/dist/collection/components/gov-toast/gov-toast.js +3 -4
- 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-content.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip.js +2 -2
- package/dist/collection/components/gov-wizard/gov-wizard-item.js +3 -3
- package/dist/collection/components/gov-wizard/gov-wizard-item.js.map +1 -1
- package/dist/collection/components/gov-wizard/gov-wizard.js +1 -1
- package/dist/collection/core/constants/colors.js +6 -8
- package/dist/collection/core/constants/colors.js.map +1 -1
- package/dist/collection/data/color-definitions.js +359 -172
- package/dist/collection/helpers/Dom/document.js +46 -0
- package/dist/collection/helpers/Dom/document.js.map +1 -0
- package/dist/collection/helpers/Dom/template.js +0 -18
- package/dist/collection/helpers/Dom/template.js.map +1 -1
- package/dist/collection/helpers/Dom/template.types.js.map +1 -1
- package/dist/collection/pages/Accordion.js +30 -30
- package/dist/collection/pages/Accordion.js.map +1 -1
- package/dist/collection/pages/Button.js +383 -383
- package/dist/collection/pages/Button.js.map +1 -1
- package/dist/collection/pages/Chip.js +53 -53
- package/dist/collection/pages/Chip.js.map +1 -1
- package/dist/collection/pages/ControlGroup.js +18 -18
- package/dist/collection/pages/ControlGroup.js.map +1 -1
- package/dist/collection/pages/Dialog.js +1 -1
- package/dist/collection/pages/Dialog.js.map +1 -1
- package/dist/collection/pages/Forms.js +206 -196
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/pages/Grid.js +1 -1
- package/dist/collection/pages/Grid.js.map +1 -1
- package/dist/collection/pages/Icon.js +10 -0
- package/dist/collection/pages/Icon.js.map +1 -1
- package/dist/collection/pages/Infobar.js +16 -16
- package/dist/collection/pages/Infobar.js.map +1 -1
- package/dist/collection/pages/Message.js +20 -20
- package/dist/collection/pages/Message.js.map +1 -1
- package/dist/collection/pages/Spacer.js +1 -1
- package/dist/collection/pages/Spacer.js.map +1 -1
- package/dist/collection/pages/Stepper.js +15 -15
- package/dist/collection/pages/Stepper.js.map +1 -1
- package/dist/collection/pages/Tag.js +135 -160
- package/dist/collection/pages/Tag.js.map +1 -1
- package/dist/collection/pages/ToastMessage.js +4 -4
- package/dist/collection/pages/ToastMessage.js.map +1 -1
- package/dist/collection/pages/ToastMessageCountdown.js +4 -4
- package/dist/collection/pages/ToastMessageCountdown.js.map +1 -1
- package/dist/collection/pages/Tooltip.js +2 -2
- package/dist/collection/pages/Tooltip.js.map +1 -1
- package/dist/collection/pages/Typography.js +20 -0
- package/dist/collection/pages/Typography.js.map +1 -1
- package/dist/collection/pages/Wizard.js +2 -2
- package/dist/collection/pages/Wizard.js.map +1 -1
- package/dist/collection/utils/string.utils.js +1 -1
- package/dist/collection/utils/string.utils.js.map +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-accordion-item.js.map +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-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-card.js.map +1 -1
- package/dist/components/gov-chip.js +1 -1
- package/dist/components/gov-container.js +1 -1
- package/dist/components/gov-container.js.map +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-app.d.ts → gov-flex.d.ts} +4 -4
- package/dist/components/gov-flex.js +2 -0
- package/dist/components/gov-flex.js.map +1 -0
- 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-label.js.map +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.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-infobar.js.map +1 -1
- package/dist/components/gov-layout-column.js +1 -1
- package/dist/components/gov-layout.js +1 -1
- package/dist/components/gov-lifecycle.d.ts +11 -0
- package/dist/components/gov-lifecycle.js +2 -0
- package/dist/components/gov-lifecycle.js.map +1 -0
- package/dist/components/gov-link.d.ts +11 -0
- package/dist/components/gov-link.js +2 -0
- package/dist/components/gov-link.js.map +1 -0
- 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-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.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-tag.js.map +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-tile.js.map +1 -1
- package/dist/components/gov-tiles.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-content.js.map +1 -1
- package/dist/components/gov-tooltip.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/gov-wizard-item.js.map +1 -1
- package/dist/components/gov-wizard.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-0b3574c2.js +2 -0
- package/dist/components/p-1eb9c053.js +2 -0
- package/dist/components/p-1eb9c053.js.map +1 -0
- package/dist/components/p-283b66c3.js +2 -0
- package/dist/components/p-283b66c3.js.map +1 -0
- package/dist/components/p-318d89bd.js +2 -0
- package/dist/components/{p-1366ed8d.js.map → p-318d89bd.js.map} +1 -1
- package/dist/components/p-3d7a21b5.js +2 -0
- package/dist/components/p-3d7a21b5.js.map +1 -0
- package/dist/components/{p-ae3dada7.js → p-42200001.js} +3 -3
- package/dist/components/p-42200001.js.map +1 -0
- package/dist/components/p-44a8a668.js +2 -0
- package/dist/components/p-46c567fd.js +2 -0
- package/dist/components/p-46c567fd.js.map +1 -0
- package/dist/components/p-5aad3497.js +2 -0
- package/dist/components/p-5aad3497.js.map +1 -0
- package/dist/components/p-68a1aaec.js +2 -0
- package/dist/components/p-68a1aaec.js.map +1 -0
- package/dist/components/p-73938936.js +2 -0
- package/dist/components/p-76d604c6.js +2 -0
- package/dist/components/p-7be2301a.js +2 -0
- package/dist/components/p-7f3becc5.js +2 -0
- package/dist/components/p-80dad64b.js +2 -0
- package/dist/components/{p-9a93146e.js.map → p-80dad64b.js.map} +1 -1
- package/dist/components/{p-7f8a24a7.js → p-860520b0.js} +2 -2
- package/dist/components/p-880743a5.js.map +1 -1
- package/dist/components/p-9908b9f0.js +2 -0
- package/dist/components/p-9908b9f0.js.map +1 -0
- package/dist/components/{p-59737af9.js → p-a521c59a.js} +2 -2
- package/dist/components/p-a6b7a6c2.js +2 -0
- package/dist/components/p-a6be4769.js +2 -0
- package/dist/components/p-a6be4769.js.map +1 -0
- package/dist/components/{p-6e19816b.js → p-ac359044.js} +2 -2
- package/dist/components/p-b95ebe8c.js +2 -0
- package/dist/components/{p-dbae2385.js.map → p-b95ebe8c.js.map} +1 -1
- package/dist/components/{p-0c93dd39.js → p-c61a5830.js} +2 -2
- package/dist/components/{p-95d41a3b.js → p-cd6c2938.js} +2 -2
- package/dist/components/p-cd6c2938.js.map +1 -0
- package/dist/components/p-e8ec030e.js +2 -0
- package/dist/components/p-e8ec030e.js.map +1 -0
- package/dist/components/p-ea7fdd2e.js +2 -0
- package/dist/components/p-ea7fdd2e.js.map +1 -0
- package/dist/core/core.css +8256 -7340
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/p-00d153bf.entry.js +2 -0
- package/dist/core/p-019e967c.entry.js +2 -0
- package/dist/core/{p-eeb9cb73.entry.js.map → p-019e967c.entry.js.map} +1 -1
- package/dist/core/p-04fa0ab5.entry.js +2 -0
- package/dist/core/{p-db940455.entry.js.map → p-04fa0ab5.entry.js.map} +1 -1
- package/dist/core/p-0b3574c2.js +2 -0
- package/dist/core/p-0be19b89.entry.js +2 -0
- package/dist/core/p-0fdd8929.entry.js +2 -0
- package/dist/core/{p-7cf554e6.entry.js.map → p-0fdd8929.entry.js.map} +1 -1
- package/dist/core/p-1200a32d.entry.js +2 -0
- package/dist/core/p-1200a32d.entry.js.map +1 -0
- package/dist/core/p-22fa411d.entry.js +2 -0
- package/dist/core/p-2739fa61.entry.js +2 -0
- package/dist/core/p-2739fa61.entry.js.map +1 -0
- package/dist/core/p-29ac15d2.js +2 -0
- package/dist/core/{p-28a7d3f7.js.map → p-29ac15d2.js.map} +1 -1
- package/dist/core/p-30eaeeec.entry.js +2 -0
- package/dist/core/p-3bbb77a0.js +2 -0
- package/dist/core/p-3cb36bae.entry.js +2 -0
- package/dist/core/p-3cb36bae.entry.js.map +1 -0
- package/dist/core/p-3d6edb09.entry.js +2 -0
- package/dist/core/p-3d6edb09.entry.js.map +1 -0
- package/dist/core/p-3f6a2d20.entry.js +2 -0
- package/dist/core/p-3f6a2d20.entry.js.map +1 -0
- package/dist/core/p-41c6b262.entry.js +2 -0
- package/dist/core/{p-e4978aab.entry.js.map → p-41c6b262.entry.js.map} +1 -1
- package/dist/core/p-432c3875.entry.js +2 -0
- package/dist/core/p-432c3875.entry.js.map +1 -0
- package/dist/core/p-439b66a5.entry.js +2 -0
- package/dist/core/{p-a53a277a.entry.js.map → p-439b66a5.entry.js.map} +1 -1
- package/dist/core/p-4b90fbc4.entry.js +2 -0
- package/dist/core/{p-17015e36.entry.js.map → p-4b90fbc4.entry.js.map} +1 -1
- package/dist/core/p-4c5f6299.entry.js +2 -0
- package/dist/core/p-4c5f6299.entry.js.map +1 -0
- package/dist/core/p-535316b4.entry.js +2 -0
- package/dist/core/p-5396935e.entry.js +2 -0
- package/dist/core/p-561718cd.entry.js +2 -0
- package/dist/core/{p-dc3fab19.entry.js.map → p-561718cd.entry.js.map} +1 -1
- package/dist/core/p-56dc370d.entry.js +2 -0
- package/dist/core/{p-6d772ff9.entry.js.map → p-56dc370d.entry.js.map} +1 -1
- package/dist/core/{p-42d9924c.js → p-56efd4a2.js} +2 -2
- package/dist/core/p-5aad3497.js +2 -0
- package/dist/core/p-5aad3497.js.map +1 -0
- package/dist/core/p-5b2131c1.entry.js +2 -0
- package/dist/core/p-5c9e6275.entry.js +2 -0
- package/dist/core/{p-f456bd71.entry.js.map → p-5c9e6275.entry.js.map} +1 -1
- package/dist/core/{p-60658ae9.js → p-5f1000da.js} +2 -2
- package/dist/core/p-65e67731.entry.js +2 -0
- package/dist/core/p-65e67731.entry.js.map +1 -0
- package/dist/core/p-6bb37fe2.entry.js +2 -0
- package/dist/core/{p-f1be099b.entry.js.map → p-6bb37fe2.entry.js.map} +1 -1
- package/dist/core/p-6e457b3d.entry.js +2 -0
- package/dist/core/{p-5dcbfca3.entry.js.map → p-6e457b3d.entry.js.map} +1 -1
- package/dist/core/p-72130a8f.entry.js +2 -0
- package/dist/core/p-72130a8f.entry.js.map +1 -0
- package/dist/core/p-76d604c6.js +2 -0
- package/dist/core/{p-a21dc94f.js.map → p-76d604c6.js.map} +1 -1
- package/dist/core/p-7b7e502b.entry.js +2 -0
- package/dist/core/p-7ba4daf4.js +2 -0
- package/dist/core/p-7e04730a.entry.js +2 -0
- package/dist/core/{p-182189d2.entry.js.map → p-7e04730a.entry.js.map} +1 -1
- package/dist/core/p-7f3becc5.js +2 -0
- package/dist/core/{p-a1e95a5f.js → p-8506b611.js} +3 -3
- package/dist/core/p-8506b611.js.map +1 -0
- package/dist/core/{p-e9a6cd71.js → p-860520b0.js} +2 -2
- package/dist/core/p-880743a5.js.map +1 -1
- package/dist/core/p-97a9725d.entry.js +2 -0
- package/dist/core/{p-9b41ac88.entry.js.map → p-97a9725d.entry.js.map} +1 -1
- package/dist/core/p-9c2c5447.entry.js +2 -0
- package/dist/core/p-9c2c5447.entry.js.map +1 -0
- package/dist/core/p-9fe35463.entry.js +2 -0
- package/dist/core/p-9fe35463.entry.js.map +1 -0
- package/dist/core/p-a521c59a.js +2 -0
- package/dist/core/p-b7cfe254.entry.js +2 -0
- package/dist/core/{p-963f9fcd.entry.js.map → p-b7cfe254.entry.js.map} +1 -1
- package/dist/core/p-b923a8d9.entry.js +2 -0
- package/dist/core/p-b923a8d9.entry.js.map +1 -0
- package/dist/core/p-bc966c46.entry.js +2 -0
- package/dist/core/{p-83039b10.entry.js.map → p-bc966c46.entry.js.map} +1 -1
- package/dist/core/p-bcb45a18.entry.js +2 -0
- package/dist/core/{p-2ed3afef.entry.js.map → p-bcb45a18.entry.js.map} +1 -1
- package/dist/core/p-bdc51179.entry.js +2 -0
- package/dist/core/p-bdc51179.entry.js.map +1 -0
- package/dist/core/p-c054f955.entry.js +2 -0
- package/dist/core/{p-663d3db2.entry.js.map → p-c054f955.entry.js.map} +1 -1
- package/dist/core/{p-c990d746.js → p-c61a5830.js} +2 -2
- package/dist/core/p-c916d0d2.entry.js +2 -0
- package/dist/core/p-c916d0d2.entry.js.map +1 -0
- package/dist/core/p-ccec8019.entry.js +2 -0
- package/dist/core/p-ccec8019.entry.js.map +1 -0
- package/dist/core/p-cd2d335d.entry.js +2 -0
- package/dist/core/{p-b3acb156.entry.js.map → p-cd2d335d.entry.js.map} +1 -1
- package/dist/core/{p-95d41a3b.js → p-cd6c2938.js} +2 -2
- package/dist/core/p-cd6c2938.js.map +1 -0
- package/dist/core/p-d65cef62.entry.js +2 -0
- package/dist/core/{p-aa8adc45.entry.js.map → p-d65cef62.entry.js.map} +1 -1
- package/dist/core/p-d836fcde.entry.js +2 -0
- package/dist/core/{p-b55fc943.entry.js.map → p-d836fcde.entry.js.map} +1 -1
- package/dist/core/p-da1db6fd.js +2 -0
- package/dist/core/p-da1db6fd.js.map +1 -0
- package/dist/core/p-da7f1e11.entry.js +2 -0
- package/dist/core/p-da7f1e11.entry.js.map +1 -0
- package/dist/core/p-dea64896.entry.js +2 -0
- package/dist/core/{p-ab9ae7ba.entry.js.map → p-dea64896.entry.js.map} +1 -1
- package/dist/core/{p-45a30859.js → p-e0e2e9c1.js} +2 -2
- package/dist/core/p-e44a0fee.js +2 -0
- package/dist/core/p-e61aa53b.entry.js +2 -0
- package/dist/core/{p-d2351924.entry.js.map → p-e61aa53b.entry.js.map} +1 -1
- package/dist/core/p-e834ee73.entry.js +2 -0
- package/dist/core/p-e834ee73.entry.js.map +1 -0
- package/dist/core/p-e8ec030e.js +2 -0
- package/dist/core/p-e8ec030e.js.map +1 -0
- package/dist/core/p-ea44d447.entry.js +2 -0
- package/dist/core/p-ea44d447.entry.js.map +1 -0
- package/dist/core/p-ea7fdd2e.js +2 -0
- package/dist/core/p-ea7fdd2e.js.map +1 -0
- package/dist/core/p-ed833334.entry.js +2 -0
- package/dist/core/p-ed833334.entry.js.map +1 -0
- package/dist/core/p-ed8fc183.entry.js +2 -0
- package/dist/core/p-ed8fc183.entry.js.map +1 -0
- package/dist/core/p-f4bcf817.entry.js +2 -0
- package/dist/core/p-f4bcf817.entry.js.map +1 -0
- package/dist/core/p-f4dac942.entry.js +2 -0
- package/dist/core/{p-9ff8f059.entry.js.map → p-f4dac942.entry.js.map} +1 -1
- package/dist/core/p-f7a4da9d.entry.js +2 -0
- package/dist/core/{p-a5489b0e.entry.js.map → p-f7a4da9d.entry.js.map} +1 -1
- package/dist/esm/{colors-02c1ea96.js → colors-4cf64720.js} +7 -9
- package/dist/esm/colors-4cf64720.js.map +1 -0
- package/dist/esm/{constants-6d727976.js → constants-085f9943.js} +2 -2
- package/dist/esm/{constants-6d727976.js.map → constants-085f9943.js.map} +1 -1
- package/dist/esm/{constants-990365f1.js → constants-372455eb.js} +3 -3
- package/dist/esm/{constants-990365f1.js.map → constants-372455eb.js.map} +1 -1
- package/dist/esm/{constants-d6418889.js → constants-3ab65c42.js} +2 -2
- package/dist/esm/{constants-d6418889.js.map → constants-3ab65c42.js.map} +1 -1
- package/dist/esm/{constants-48177684.js → constants-3b914c35.js} +3 -3
- package/dist/esm/{constants-48177684.js.map → constants-3b914c35.js.map} +1 -1
- package/dist/esm/{constants-d42abf99.js → constants-43f10674.js} +2 -2
- package/dist/esm/{constants-d42abf99.js.map → constants-43f10674.js.map} +1 -1
- package/dist/esm/{constants-501eb756.js → constants-4da2b3c0.js} +2 -2
- package/dist/esm/{constants-501eb756.js.map → constants-4da2b3c0.js.map} +1 -1
- package/dist/esm/{constants-c716fa44.js → constants-51f51588.js} +3 -3
- package/dist/esm/{constants-c716fa44.js.map → constants-51f51588.js.map} +1 -1
- package/dist/esm/{constants-f4e4ede6.js → constants-8429b68f.js} +3 -3
- package/dist/esm/{constants-f4e4ede6.js.map → constants-8429b68f.js.map} +1 -1
- package/dist/esm/{constants-47e20524.js → constants-9177ea52.js} +3 -3
- package/dist/esm/{constants-47e20524.js.map → constants-9177ea52.js.map} +1 -1
- package/dist/esm/{constants-7307438d.js → constants-bc210662.js} +3 -3
- package/dist/esm/{constants-7307438d.js.map → constants-bc210662.js.map} +1 -1
- package/dist/esm/core.js +3 -3
- package/dist/esm/{form-472e078d.js → form-713f26fd.js} +7 -6
- package/dist/esm/form-713f26fd.js.map +1 -0
- package/dist/esm/gov-accordion-item.entry.js +13 -11
- package/dist/esm/gov-accordion-item.entry.js.map +1 -1
- package/dist/esm/gov-accordion.entry.js +6 -7
- package/dist/esm/gov-accordion.entry.js.map +1 -1
- package/dist/esm/gov-attachments_3.entry.js +13 -14
- package/dist/esm/gov-attachments_3.entry.js.map +1 -1
- package/dist/esm/gov-backdrop.entry.js +7 -8
- package/dist/esm/gov-backdrop.entry.js.map +1 -1
- package/dist/esm/gov-breadcrumbs.entry.js +7 -8
- package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
- package/dist/esm/gov-button.entry.js +12 -13
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-card.entry.js +7 -8
- package/dist/esm/gov-card.entry.js.map +1 -1
- package/dist/esm/gov-chip.entry.js +14 -15
- package/dist/esm/gov-chip.entry.js.map +1 -1
- package/dist/esm/gov-container.entry.js +3 -11
- package/dist/esm/gov-container.entry.js.map +1 -1
- package/dist/esm/gov-control-group.entry.js +7 -8
- package/dist/esm/gov-control-group.entry.js.map +1 -1
- package/dist/esm/gov-cookiebar.entry.js +3 -3
- package/dist/esm/gov-dialog.entry.js +7 -8
- package/dist/esm/gov-dialog.entry.js.map +1 -1
- package/dist/esm/gov-dropdown.entry.js +7 -7
- package/dist/esm/gov-empty.entry.js +7 -8
- package/dist/esm/gov-empty.entry.js.map +1 -1
- package/dist/esm/gov-error-code.entry.js +3 -3
- package/dist/esm/gov-flex_4.entry.js +332 -0
- package/dist/esm/gov-flex_4.entry.js.map +1 -0
- package/dist/esm/gov-form-autocomplete.entry.js +8 -10
- package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
- package/dist/esm/gov-form-checkbox-group.entry.js +8 -9
- package/dist/esm/gov-form-checkbox-group.entry.js.map +1 -1
- package/dist/esm/gov-form-checkbox.entry.js +12 -13
- package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
- package/dist/esm/gov-form-control.entry.js +10 -10
- package/dist/esm/gov-form-file.entry.js +16 -13
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-form-group.entry.js +7 -8
- package/dist/esm/gov-form-group.entry.js.map +1 -1
- package/dist/esm/gov-form-input_2.entry.js +17 -16
- package/dist/esm/gov-form-input_2.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +16 -32
- 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 +8 -9
- package/dist/esm/gov-form-radio-group.entry.js.map +1 -1
- package/dist/esm/gov-form-radio.entry.js +11 -12
- package/dist/esm/gov-form-radio.entry.js.map +1 -1
- package/dist/esm/gov-form-search.entry.js +4 -4
- package/dist/esm/gov-form-select.entry.js +13 -14
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-form-switch.entry.js +12 -13
- package/dist/esm/gov-form-switch.entry.js.map +1 -1
- package/dist/esm/gov-grid-item.entry.js +3 -3
- package/dist/esm/gov-grid.entry.js +3 -3
- package/dist/esm/gov-infobar.entry.js +8 -9
- package/dist/esm/gov-infobar.entry.js.map +1 -1
- package/dist/esm/gov-layout-column.entry.js +3 -3
- package/dist/esm/gov-layout.entry.js +3 -3
- package/dist/esm/gov-lifecycle.entry.js +43 -0
- package/dist/esm/gov-lifecycle.entry.js.map +1 -0
- package/dist/esm/gov-link.entry.js +47 -0
- package/dist/esm/gov-link.entry.js.map +1 -0
- package/dist/esm/gov-loading.entry.js +6 -7
- package/dist/esm/gov-loading.entry.js.map +1 -1
- package/dist/esm/gov-message.entry.js +7 -8
- package/dist/esm/gov-message.entry.js.map +1 -1
- package/dist/esm/gov-pagination.entry.js +9 -10
- package/dist/esm/gov-pagination.entry.js.map +1 -1
- package/dist/esm/gov-spacer.entry.js +6 -7
- package/dist/esm/gov-spacer.entry.js.map +1 -1
- package/dist/esm/gov-stepper-item.entry.js +9 -10
- package/dist/esm/gov-stepper-item.entry.js.map +1 -1
- package/dist/esm/gov-stepper.entry.js +8 -9
- package/dist/esm/gov-stepper.entry.js.map +1 -1
- package/dist/esm/gov-tabs-item.entry.js +7 -7
- package/dist/esm/gov-tabs.entry.js +8 -9
- package/dist/esm/gov-tabs.entry.js.map +1 -1
- package/dist/esm/gov-tag.entry.js +12 -13
- package/dist/esm/gov-tag.entry.js.map +1 -1
- package/dist/esm/gov-tile.entry.js +4 -4
- package/dist/esm/gov-tile.entry.js.map +1 -1
- package/dist/esm/gov-tiles.entry.js +3 -3
- package/dist/esm/gov-toast.entry.js +11 -12
- package/dist/esm/gov-toast.entry.js.map +1 -1
- package/dist/esm/gov-tooltip-content.entry.js +6 -6
- package/dist/esm/gov-tooltip-content.entry.js.map +1 -1
- package/dist/esm/gov-tooltip.entry.js +10 -11
- package/dist/esm/gov-tooltip.entry.js.map +1 -1
- package/dist/esm/gov-wizard-item.entry.js +11 -12
- package/dist/esm/gov-wizard-item.entry.js.map +1 -1
- package/dist/esm/gov-wizard.entry.js +10 -11
- package/dist/esm/gov-wizard.entry.js.map +1 -1
- package/dist/esm/{win-cec370ad.js → gov.log-6b64cda6.js} +17 -3
- package/dist/esm/gov.log-6b64cda6.js.map +1 -0
- package/dist/esm/{index-d8b4eb6c.js → index-c263e031.js} +20 -12
- package/dist/esm/index-c263e031.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{props-c82e1abf.js → props-9d3c7ac1.js} +2 -2
- package/dist/esm/{props-c82e1abf.js.map → props-9d3c7ac1.js.map} +1 -1
- package/dist/esm/{string.utils-5ce3f551.js → string.utils-1da8f8fb.js} +2 -2
- package/dist/esm/string.utils-1da8f8fb.js.map +1 -0
- package/dist/esm/{template-3d84d705.js → template-7ecee4d1.js} +2 -20
- package/dist/esm/template-7ecee4d1.js.map +1 -0
- package/dist/esm/{utils-2b4ef320.js → utils-e10e994d.js} +2 -2
- package/dist/esm/{utils-2b4ef320.js.map → utils-e10e994d.js.map} +1 -1
- package/dist/esm/{wcag-fa5ce56c.js → wcag-253a4421.js} +3 -4
- package/dist/esm/wcag-253a4421.js.map +1 -0
- package/dist/hydrate/index.js +431 -10072
- package/dist/hydrate/index.mjs +431 -10072
- package/dist/stencil.config.js +9 -6
- package/dist/stencil.config.js.map +1 -1
- package/dist/types/components/gov-accordion/gov-accordion-item.d.ts +1 -0
- package/dist/types/components/gov-button/button/gov-button.d.ts +1 -1
- package/dist/types/components/gov-chip/gov-chip.d.ts +3 -3
- package/dist/types/components/gov-container/gov-container.d.ts +0 -6
- package/dist/types/components/gov-flex/constants.d.ts +3 -0
- package/dist/types/components/gov-flex/gov-flex.d.ts +33 -0
- package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +0 -4
- package/dist/types/components/gov-form/file/gov-form-file.d.ts +1 -4
- package/dist/types/components/gov-form/input/constants.d.ts +1 -0
- package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +0 -2
- package/dist/types/components/gov-form/switch/constants.d.ts +1 -1
- package/dist/types/components/gov-icon/constants.d.ts +4 -1
- package/dist/types/components/gov-icon/gov-icon.d.ts +8 -3
- package/dist/types/components/gov-icon/list.d.ts +1 -1
- package/dist/types/components/gov-lifecycle-tester/gov-lifecycle-tester.d.ts +14 -0
- package/dist/types/components/gov-link/constants.d.ts +7 -0
- package/dist/types/components/gov-link/gov-link.d.ts +30 -0
- package/dist/types/components/gov-tag/gov-tag.d.ts +2 -2
- package/dist/types/components/gov-theme-switch/constants.d.ts +9 -0
- package/dist/types/components/gov-theme-switch/gov-theme-switch.d.ts +26 -2
- package/dist/types/components/gov-tile/gov-tile.d.ts +1 -1
- package/dist/types/components/gov-toast/constants.d.ts +1 -0
- package/dist/types/components.d.ts +191 -50
- package/dist/types/core/constants/colors.d.ts +6 -8
- package/dist/types/helpers/Dom/document.d.ts +4 -0
- package/dist/types/helpers/Dom/template.d.ts +0 -1
- package/dist/types/helpers/Dom/template.types.d.ts +0 -1
- package/dist/types/utils/string.utils.d.ts +1 -0
- package/package.json +4 -4
- package/dist/cjs/colors-976f6dff.js.map +0 -1
- package/dist/cjs/form-c1aec07a.js.map +0 -1
- package/dist/cjs/gov-app_2.cjs.entry.js +0 -9891
- package/dist/cjs/gov-app_2.cjs.entry.js.map +0 -1
- package/dist/cjs/gov-form-label.cjs.entry.js +0 -27
- package/dist/cjs/gov-form-label.cjs.entry.js.map +0 -1
- package/dist/cjs/gov-icon.cjs.entry.js +0 -161
- package/dist/cjs/gov-icon.cjs.entry.js.map +0 -1
- package/dist/cjs/gov.log-1e8bab6e.js +0 -21
- package/dist/cjs/gov.log-1e8bab6e.js.map +0 -1
- package/dist/cjs/index-1af4880c.js.map +0 -1
- package/dist/cjs/string.utils-2335838f.js.map +0 -1
- package/dist/cjs/template-b070338f.js.map +0 -1
- package/dist/cjs/wcag-31089f70.js.map +0 -1
- package/dist/cjs/win-587f4614.js.map +0 -1
- package/dist/collection/components/gov-app/gov-app.css +0 -68
- package/dist/collection/components/gov-app/gov-app.js +0 -93
- package/dist/collection/components/gov-app/gov-app.js.map +0 -1
- package/dist/components/gov-app.js +0 -2
- package/dist/components/gov-app.js.map +0 -1
- package/dist/components/p-0075138f.js +0 -2
- package/dist/components/p-0075138f.js.map +0 -1
- package/dist/components/p-08621bdf.js +0 -2
- package/dist/components/p-1366ed8d.js +0 -2
- package/dist/components/p-19c681a3.js +0 -2
- package/dist/components/p-1a0b3b4f.js +0 -2
- package/dist/components/p-1a0b3b4f.js.map +0 -1
- package/dist/components/p-255d0471.js +0 -2
- package/dist/components/p-255d0471.js.map +0 -1
- package/dist/components/p-565120d5.js +0 -2
- package/dist/components/p-736e4917.js +0 -2
- package/dist/components/p-7501abe8.js +0 -2
- package/dist/components/p-7501abe8.js.map +0 -1
- package/dist/components/p-778e3fff.js +0 -2
- package/dist/components/p-778e3fff.js.map +0 -1
- package/dist/components/p-7fd16831.js +0 -2
- package/dist/components/p-7fd16831.js.map +0 -1
- package/dist/components/p-95d41a3b.js.map +0 -1
- package/dist/components/p-9a93146e.js +0 -2
- package/dist/components/p-ae3dada7.js.map +0 -1
- package/dist/components/p-ae7e6127.js +0 -2
- package/dist/components/p-cc90a508.js +0 -2
- package/dist/components/p-cc90a508.js.map +0 -1
- package/dist/components/p-d5f25595.js +0 -2
- package/dist/components/p-d5f25595.js.map +0 -1
- package/dist/components/p-dbae2385.js +0 -2
- package/dist/components/p-dcaf0383.js +0 -2
- package/dist/components/p-dcaf0383.js.map +0 -1
- package/dist/components/p-e183a7c7.js +0 -2
- package/dist/components/p-e3aeaca0.js +0 -2
- package/dist/components/p-e3aeaca0.js.map +0 -1
- package/dist/components/p-edd1417b.js +0 -2
- package/dist/core/p-006e52f1.entry.js +0 -2
- package/dist/core/p-006e52f1.entry.js.map +0 -1
- package/dist/core/p-0075138f.js +0 -2
- package/dist/core/p-0075138f.js.map +0 -1
- package/dist/core/p-023787b3.entry.js +0 -2
- package/dist/core/p-023787b3.entry.js.map +0 -1
- package/dist/core/p-052cc573.js +0 -2
- package/dist/core/p-0a952b3c.entry.js +0 -2
- package/dist/core/p-0a952b3c.entry.js.map +0 -1
- package/dist/core/p-0ebc8365.entry.js +0 -2
- package/dist/core/p-0ebc8365.entry.js.map +0 -1
- package/dist/core/p-169b67af.js +0 -2
- package/dist/core/p-17015e36.entry.js +0 -2
- package/dist/core/p-182189d2.entry.js +0 -2
- package/dist/core/p-2614044c.js +0 -2
- package/dist/core/p-28a7d3f7.js +0 -2
- package/dist/core/p-2ed3afef.entry.js +0 -2
- package/dist/core/p-2effdd60.entry.js +0 -2
- package/dist/core/p-2effdd60.entry.js.map +0 -1
- package/dist/core/p-35e66bef.entry.js +0 -2
- package/dist/core/p-35e66bef.entry.js.map +0 -1
- package/dist/core/p-3f2b803c.entry.js +0 -2
- package/dist/core/p-477a5027.entry.js +0 -2
- package/dist/core/p-477a5027.entry.js.map +0 -1
- package/dist/core/p-47e364bb.entry.js +0 -2
- package/dist/core/p-47e364bb.entry.js.map +0 -1
- package/dist/core/p-4bce896c.js +0 -2
- package/dist/core/p-5c88f415.entry.js +0 -2
- package/dist/core/p-5c88f415.entry.js.map +0 -1
- package/dist/core/p-5dc0af54.entry.js +0 -2
- package/dist/core/p-5dc0af54.entry.js.map +0 -1
- package/dist/core/p-5dcbfca3.entry.js +0 -2
- package/dist/core/p-663d3db2.entry.js +0 -2
- package/dist/core/p-69d56f17.js +0 -2
- package/dist/core/p-6aa40794.js +0 -2
- package/dist/core/p-6b42a387.entry.js +0 -2
- package/dist/core/p-6d772ff9.entry.js +0 -2
- package/dist/core/p-6ed147a6.entry.js +0 -2
- package/dist/core/p-6ed147a6.entry.js.map +0 -1
- package/dist/core/p-7cf554e6.entry.js +0 -2
- package/dist/core/p-81b0848c.entry.js +0 -2
- package/dist/core/p-81b0848c.entry.js.map +0 -1
- package/dist/core/p-83039b10.entry.js +0 -2
- package/dist/core/p-904de5e6.entry.js +0 -2
- package/dist/core/p-904de5e6.entry.js.map +0 -1
- package/dist/core/p-91a9cd24.entry.js +0 -2
- package/dist/core/p-95d41a3b.js.map +0 -1
- package/dist/core/p-963f9fcd.entry.js +0 -2
- package/dist/core/p-9b41ac88.entry.js +0 -2
- package/dist/core/p-9d0f20ec.entry.js +0 -2
- package/dist/core/p-9d0f20ec.entry.js.map +0 -1
- package/dist/core/p-9dde00d8.entry.js +0 -2
- package/dist/core/p-9dde00d8.entry.js.map +0 -1
- package/dist/core/p-9ff8f059.entry.js +0 -2
- package/dist/core/p-a16229c6.entry.js +0 -2
- package/dist/core/p-a16229c6.entry.js.map +0 -1
- package/dist/core/p-a1e95a5f.js.map +0 -1
- package/dist/core/p-a1ebb4da.entry.js +0 -2
- package/dist/core/p-a1ebb4da.entry.js.map +0 -1
- package/dist/core/p-a21dc94f.js +0 -2
- package/dist/core/p-a53a277a.entry.js +0 -2
- package/dist/core/p-a5489b0e.entry.js +0 -2
- package/dist/core/p-a54f1db9.entry.js +0 -2
- package/dist/core/p-a693ffbf.js +0 -2
- package/dist/core/p-a693ffbf.js.map +0 -1
- package/dist/core/p-aa8adc45.entry.js +0 -2
- package/dist/core/p-ab9ae7ba.entry.js +0 -2
- package/dist/core/p-b3acb156.entry.js +0 -2
- package/dist/core/p-b48a4aa0.js +0 -2
- package/dist/core/p-b48a4aa0.js.map +0 -1
- package/dist/core/p-b55fc943.entry.js +0 -2
- package/dist/core/p-b838bb27.entry.js +0 -2
- package/dist/core/p-c214c202.entry.js +0 -2
- package/dist/core/p-c214c202.entry.js.map +0 -1
- package/dist/core/p-c4c7cb24.entry.js +0 -2
- package/dist/core/p-d2351924.entry.js +0 -2
- package/dist/core/p-db940455.entry.js +0 -2
- package/dist/core/p-dc3fab19.entry.js +0 -2
- package/dist/core/p-e0d428c9.js +0 -2
- package/dist/core/p-e0d428c9.js.map +0 -1
- package/dist/core/p-e134b123.entry.js +0 -2
- package/dist/core/p-e3aeaca0.js +0 -2
- package/dist/core/p-e3aeaca0.js.map +0 -1
- package/dist/core/p-e4978aab.entry.js +0 -2
- package/dist/core/p-edc05eff.entry.js +0 -2
- package/dist/core/p-edc05eff.entry.js.map +0 -1
- package/dist/core/p-eeb9cb73.entry.js +0 -2
- package/dist/core/p-f141ad5e.entry.js +0 -2
- package/dist/core/p-f1be099b.entry.js +0 -2
- package/dist/core/p-f456bd71.entry.js +0 -2
- package/dist/core/p-fa7caad6.entry.js +0 -2
- package/dist/core/p-fa7caad6.entry.js.map +0 -1
- package/dist/core/p-fc90bf06.entry.js +0 -2
- package/dist/core/p-fc90bf06.entry.js.map +0 -1
- package/dist/esm/colors-02c1ea96.js.map +0 -1
- package/dist/esm/form-472e078d.js.map +0 -1
- package/dist/esm/gov-app_2.entry.js +0 -9886
- package/dist/esm/gov-app_2.entry.js.map +0 -1
- package/dist/esm/gov-form-label.entry.js +0 -23
- package/dist/esm/gov-form-label.entry.js.map +0 -1
- package/dist/esm/gov-icon.entry.js +0 -157
- package/dist/esm/gov-icon.entry.js.map +0 -1
- package/dist/esm/gov.log-6e9faad2.js +0 -19
- package/dist/esm/gov.log-6e9faad2.js.map +0 -1
- package/dist/esm/index-d8b4eb6c.js.map +0 -1
- package/dist/esm/string.utils-5ce3f551.js.map +0 -1
- package/dist/esm/template-3d84d705.js.map +0 -1
- package/dist/esm/wcag-fa5ce56c.js.map +0 -1
- package/dist/esm/win-cec370ad.js.map +0 -1
- package/dist/types/components/gov-app/gov-app.d.ts +0 -37
- /package/dist/components/{p-19c681a3.js.map → p-0b3574c2.js.map} +0 -0
- /package/dist/components/{p-08621bdf.js.map → p-44a8a668.js.map} +0 -0
- /package/dist/components/{p-736e4917.js.map → p-73938936.js.map} +0 -0
- /package/dist/components/{p-565120d5.js.map → p-76d604c6.js.map} +0 -0
- /package/dist/components/{p-e183a7c7.js.map → p-7be2301a.js.map} +0 -0
- /package/dist/components/{p-edd1417b.js.map → p-7f3becc5.js.map} +0 -0
- /package/dist/components/{p-7f8a24a7.js.map → p-860520b0.js.map} +0 -0
- /package/dist/components/{p-59737af9.js.map → p-a521c59a.js.map} +0 -0
- /package/dist/components/{p-ae7e6127.js.map → p-a6b7a6c2.js.map} +0 -0
- /package/dist/components/{p-6e19816b.js.map → p-ac359044.js.map} +0 -0
- /package/dist/components/{p-0c93dd39.js.map → p-c61a5830.js.map} +0 -0
- /package/dist/core/{p-a54f1db9.entry.js.map → p-00d153bf.entry.js.map} +0 -0
- /package/dist/core/{p-169b67af.js.map → p-0b3574c2.js.map} +0 -0
- /package/dist/core/{p-3f2b803c.entry.js.map → p-0be19b89.entry.js.map} +0 -0
- /package/dist/core/{p-f141ad5e.entry.js.map → p-22fa411d.entry.js.map} +0 -0
- /package/dist/core/{p-b838bb27.entry.js.map → p-30eaeeec.entry.js.map} +0 -0
- /package/dist/core/{p-69d56f17.js.map → p-3bbb77a0.js.map} +0 -0
- /package/dist/core/{p-6b42a387.entry.js.map → p-535316b4.entry.js.map} +0 -0
- /package/dist/core/{p-91a9cd24.entry.js.map → p-5396935e.entry.js.map} +0 -0
- /package/dist/core/{p-42d9924c.js.map → p-56efd4a2.js.map} +0 -0
- /package/dist/core/{p-e134b123.entry.js.map → p-5b2131c1.entry.js.map} +0 -0
- /package/dist/core/{p-60658ae9.js.map → p-5f1000da.js.map} +0 -0
- /package/dist/core/{p-c4c7cb24.entry.js.map → p-7b7e502b.entry.js.map} +0 -0
- /package/dist/core/{p-2614044c.js.map → p-7ba4daf4.js.map} +0 -0
- /package/dist/core/{p-6aa40794.js.map → p-7f3becc5.js.map} +0 -0
- /package/dist/core/{p-e9a6cd71.js.map → p-860520b0.js.map} +0 -0
- /package/dist/core/{p-4bce896c.js.map → p-a521c59a.js.map} +0 -0
- /package/dist/core/{p-c990d746.js.map → p-c61a5830.js.map} +0 -0
- /package/dist/core/{p-45a30859.js.map → p-e0e2e9c1.js.map} +0 -0
- /package/dist/core/{p-052cc573.js.map → p-e44a0fee.js.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as e,a as s,g as i,c as n,d as a}from"./p-8506b611.js";import{g as o}from"./p-ea7fdd2e.js";import{F as c}from"./p-7ba4daf4.js";import{p as r}from"./p-e0e2e9c1.js";import{C as h}from"./p-5aad3497.js";import{S as l}from"./p-92f420cb.js";import{i as f,a as d,b as u}from"./p-e8ec030e.js";import{v as m}from"./p-0b3574c2.js";const b={root:"gov-flex"};const g=class{constructor(e){t(this,e);this.direction="row";this.justifyContent=undefined;this.alignItems=undefined;this.wrap=undefined;this.alignContent=undefined;this.alignSelf=undefined;this.h=o(this.host)}render(){return e(s,{key:"77d5eb1db594698f6fde4bf497209912de71173f",class:this.h.classes(b.root)},e("slot",{key:"6c01ff6ec88c53dbf9e83d492f660c96e9e7fc2a"}))}get host(){return i(this)}};const p=class{constructor(e){t(this,e);this.govClick=n(this,"gov-click",7);this.identifier=undefined;this.size="m";this.required=false;this.legend=false}render(){const t=this.legend?"legend":"label";return e(s,{key:"3e02eaa899126807c31fac8d3b6f352a07a73a9d",class:c.root,size:this.size},e(t,{key:"a1213cf879e26565c4c84d31ab6a46dac2a9ee4e",class:c.label,htmlFor:this.identifier,onClick:()=>this.govClick.emit()},e("slot",{key:"46a6a39821d6f3f786b843c037b0b423ba2445ae"}),this.required?e("span",{class:"gov-color--error-500"}," *"):null))}};r(l,["_XS","_S","_M","_L","_XL","_2XL","_3XL","_4XL","_5XL"]);const v=r(h,["DEFAULT","PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING","DISABLED","WHITE","BLACK"]);var _;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(_||(_={}));const w={root:"gov-icon",holder:"gov-icon__holder"};const y="4.1.1";const k=()=>y;const L={};const S={};const C=t=>t.startsWith("http://")||t.startsWith("https://");const D=(t,e,s)=>{if(C(t)){return`${t}/${s}/${e}.svg?v=${k()}`}return a(`${t}/${s}/${e}.svg`)+`?v=${k()}`};async function z({name:t,type:e}){const s=e+"-"+t;if(L[s]){return L[s]}if(!S[s]){S[s]=fetch(D(f(),t,e)).then((t=>{if(t.status===200){return t.text()}else{throw new Error("Gov Icon doesn't exists")}}))}const i=await S[s];L[s]=i;return i}const I=(t,e,s)=>{if(!d){return}let i="";if(s){const t=new Date;t.setTime(t.getTime()+s*24*60*60*1e3);i="; expires="+t.toUTCString()}document.cookie=`${t}=${encodeURIComponent(e)}${i}; path=/`};const $=t=>{if(!d){return null}const e=t+"=";const s=document.cookie.split(";");for(let t=0;t<s.length;t++){let i=s[t].trim();if(i.startsWith(e)){return decodeURIComponent(i.substring(e.length))}}return null};const j=t=>{try{const e=new DOMParser;const s=e.parseFromString(t,"image/svg+xml");const i=s.querySelector("parsererror");if(i){return false}const n=s.documentElement;if(n.tagName.toLowerCase()!=="svg"){return false}return true}catch(t){return false}};const R=class{constructor(e){t(this,e);this.size=undefined;this.color=undefined;this.name=null;this.type="components";this.visible=false;this.error=false;this.h=o(this.host)}validateSize(t){m(l,t,w.root)}validateColor(t){m(v,t,w.root)}async loadIconPathData(){const{name:t,visible:e}=this;if(!t||!e){return}await this.loadIcon()}connectedCallback(){if(u()){this.visible=true;this.loadIconPathData().finally()}else{this.waitUntilVisible((async()=>{this.visible=true;await this.loadIconPathData()}))}}disconnectedCallback(){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}}async componentWillLoad(){this.validateSize(this.size);this.validateColor(this.color);await this.loadIconPathData()}waitUntilVisible(t){if(typeof window==="undefined"||!window.IntersectionObserver){t();return}this.intersectionObserver=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}t()}}))}),{rootMargin:"50px"});this.intersectionObserver.observe(this.host)}async loadIcon(){try{const{name:t,type:e}=this;const s=await z({name:t,type:e});const i=j(s);this.host.innerHTML=i?s:null}catch(t){this.host.innerHTML="";this.error=true}}render(){if(this.error){return null}return e(s,{class:this.h.classes(w.root),size:this.size,color:this.color})}static get assetsDirs(){return["assets"]}get host(){return i(this)}static get watchers(){return{size:["validateSize"],color:["validateColor"],name:["loadIconPathData"]}}};const E=r(l,["_XS","_S","_M","_L","_XL"]);const x={root:"gov-theme-switch",indicator:"gov-theme-switch__indicator",iconLight:"gov-theme-switch__icon-light",iconDark:"gov-theme-switch__icon-dark",labelLight:"gov-theme-switch__label-light",labelDark:"gov-theme-switch__label-dark"};const X="data-theme";var A;(function(t){t["auto"]="auto";t["light"]="light";t["dark"]="dark"})(A||(A={}));const O=class{constructor(e){t(this,e);this.govChange=n(this,"gov-change",7);this.setThemeState=t=>{this.theme=t;this.govChange.emit({component:x.root,state:this.theme,ref:this.host})};this.size="m";this.ariaLabelLight=undefined;this.ariaLabelDark=undefined;this.labelLight=undefined;this.labelDark=undefined;this.theme=A.auto;this.h=o(this.host)}validateSize(t){m(E,t,x.root)}watchTheme(t){this.htmlElement.setAttribute(X,t);this.htmlElement.classList.remove(...Object.keys(A));this.htmlElement.classList.add(t);I(X,t)}get storageValue(){return $(X)}get htmlElement(){return document.documentElement}get isSystemPrefersColorDark(){return d&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}componentWillLoad(){this.initDefaultState();this.validateSize(this.size)}initDefaultState(){const t=Object.keys(A);let e=this.storageValue;const s=this.htmlElement.getAttribute(X);if(e&&t.includes(e)){this.theme=e}else if(s&&t.includes(s)){this.theme=s}else{this.theme=A.auto}}render(){let t=this.theme===A.dark;if(this.theme===A.auto){t=this.isSystemPrefersColorDark}return e(s,{key:"a83f030f54527f8e8a2d23c3769f3f1b41c4af4f",class:this.h.classes(x.root),theme:t?A.dark:A.light,size:this.size},e("button",{key:"54f8337d911cf64f24c8db089b9092b806c3a926",onClick:()=>this.setThemeState(t?A.light:A.dark),"aria-label":t?this.ariaLabelLight:this.ariaLabelDark},e("span",{key:"483310b54df8e8de42c087f04b7e0758067c22b8"},e("span",{key:"88b822cac4b5dc3897fa19252b5b1e1a559b8d6d",class:x.indicator},A.light&&e("gov-icon",{key:"f6f162cda66facba8940ba55f7f3283e7796d157",name:"sun",class:x.iconLight,type:"components"}),A.dark&&e("gov-icon",{key:"b36b009c1787e37a3fd5108618c6bb5993f97a23",name:"moon",class:x.iconDark,type:"components"})),e("gov-form-label",{key:"dff2b2b454a87faa1d7e471d2a271c333c983aad",class:x.labelLight,size:this.size},this.labelLight),e("gov-form-label",{key:"1b682ccaff92cc4cfe8462ff2a59507fd61b114b",class:x.labelDark,size:this.size},this.labelDark))))}get host(){return i(this)}static get watchers(){return{size:["validateSize"],theme:["watchTheme"]}}};export{g as gov_flex,p as gov_form_label,R as gov_icon,O as gov_theme_switch};
|
|
2
|
+
//# sourceMappingURL=p-3f6a2d20.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FlexClass","root","GovFlex","constructor","hostRef","this","h","govHost","host","render","Host","key","class","classes","GovFormLabel","Tag","legend","FormLabelClass","size","label","htmlFor","identifier","onClick","govClick","emit","required","pick","Sizes","IconColors","Colors","Types","IconClass","holder","dsVersion","version","iconCache","requestCache","isExternalUrl","path","startsWith","iconUrl","name","type","getAssetPath","async","fetchIcon","cacheKey","fetch","iconsPath","then","resp","status","text","Error","setCookie","value","days","isWindow","expires","date","Date","setTime","getTime","toUTCString","document","cookie","encodeURIComponent","getCookie","nameEQ","cookies","split","i","length","trim","decodeURIComponent","substring","isValidSVG","svgContent","parser","DOMParser","doc","parseFromString","parseError","querySelector","svgElement","documentElement","tagName","toLowerCase","error","GovIcon","validateSize","newValue","validateProp","validateColor","loadIconPathData","visible","loadIcon","connectedCallback","iconsLazyLoad","finally","waitUntilVisible","disconnectedCallback","intersectionObserver","disconnect","componentWillLoad","color","callback","window","IntersectionObserver","entries","forEach","entry","isIntersecting","rootMargin","observe","data","isValid","innerHTML","e","ThemeSwitchSizes","ThemeSwitchClass","indicator","iconLight","iconDark","labelLight","labelDark","ATTRIBUTE_THEME_NAME","ThemeList","GovThemeSwitch","setThemeState","state","theme","govChange","component","ref","auto","watchTheme","htmlElement","setAttribute","classList","remove","Object","keys","add","storageValue","isSystemPrefersColorDark","matchMedia","matches","initDefaultState","options","currentState","htmlState","getAttribute","includes","isDark","dark","light","ariaLabelLight","ariaLabelDark"],"sources":["../../../packages/core/src/components/gov-flex/constants.ts","../../../packages/core/src/components/gov-flex/gov-flex.tsx","../../../packages/core/src/components/gov-form/label/gov-form-label.tsx","../../../packages/core/src/components/gov-icon/constants.ts","../../../packages/core/src/utils/ds.utils.ts","../../../packages/core/src/utils/icon.utils.ts","../../../packages/core/src/helpers/Dom/document.ts","../../../packages/core/src/components/gov-icon/gov-icon.tsx","../../../packages/core/src/components/gov-theme-switch/constants.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.types.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.tsx"],"sourcesContent":["export const FlexClass = {\n\troot: 'gov-flex',\n}\n\n","import {Component, Element, h, Host, Prop} from '@stencil/core'\nimport {FlexClass} from './constants'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-flex',\n})\nexport class GovFlex {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovGridElement\n\n\t/**\n\t * Controls the flex direction of the container. Can be 'row', 'row-reverse', 'column', or 'column-reverse'.\n\t */\n\t@Prop() direction: 'row' | 'row-reverse' | 'column' | 'column-reverse' = 'row';\n\n\t/**\n\t * Defines how the browser distributes space between and around content items along the main axis.\n\t * Allowed values: 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'.\n\t */\n\t@Prop({\n\t\tattribute: 'justify-content',\n\t\treflect: true\n\t}) justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';\n\n\t/**\n\t * Aligns flex items along the cross axis. Can be 'stretch', 'flex-start', 'flex-end', 'center', or 'baseline'.\n\t */\n\t@Prop({\n\t\tattribute: 'align-items', reflect: true\n\t}) alignItems?: 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline';\n\n\t/**\n\t * Controls whether the flex container is a single-line or multi-line flex container. Can be 'nowrap', 'wrap', or 'wrap-reverse'.\n\t */\n\t@Prop({reflect: true}) wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';\n\n\t/**\n\t * Aligns the flex container's lines within when there is extra space in the cross-axis.\n\t * Allowed values: 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'stretch'.\n\t */\n\t@Prop({\n\t\tattribute: 'align-content',\n\t\treflect: true\n\t}) alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'stretch';\n\n\t/**\n\t * Sets the alignment of the flex container’s children along the flex container’s cross axis, overriding the `align-items` property for individual flex items.\n\t * Allowed values: 'auto', 'flex-start', 'flex-end', 'center', 'baseline', 'stretch'.\n\t */\n\t@Prop({\n\t\tattribute: 'align-self',\n\t\treflect: true\n\t}) alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FlexClass.root)}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n","import { Component, Event, EventEmitter, h, Prop, Host } from '@stencil/core'\nimport { FormLabelClass, FormLabelSizesTypes } from './constants'\n\n@Component({\n\ttag: 'gov-form-label',\n})\nexport class GovFormLabel {\n\t/**\n\t * Identifier for label.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Label's size.\n\t */\n\t@Prop() readonly size?: FormLabelSizesTypes = 'm'\n\t/**\n\t * Set whether the input is required or not.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Use label as a legend for better accessibility.\n\t * Note: Don't forget to set the fieldset attribute of the gov-form-control component\n\t */\n\t@Prop() readonly legend: boolean = false\n\t/**\n\t * Emitted when the label click.\n\t */\n\t@Event({ eventName: 'gov-click' }) govClick: EventEmitter<PointerEvent>\n\n\trender() {\n\t\tconst Tag = this.legend ? 'legend' : 'label'\n\t\treturn (\n\t\t\t<Host class={FormLabelClass.root} size={this.size}>\n\t\t\t\t<Tag class={FormLabelClass.label} htmlFor={this.identifier} onClick={() => this.govClick.emit()}>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t{this.required ? <span class=\"gov-color--error-500\"> *</span> : null}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n","import { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils';\nimport { Colors } from '../../core/constants/colors';\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const IconSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL', '_2XL', '_3XL', '_4XL', '_5XL'])\nexport type IconSizesType = `${ValueOf<typeof IconSizes>}`\n\nexport const IconColors = pick(Colors, [\n\t'DEFAULT',\n\t'PRIMARY',\n\t'SECONDARY',\n\t'NEUTRAL',\n\t'ERROR',\n\t'SUCCESS',\n\t'WARNING',\n\t'DISABLED',\n\t'WHITE',\n\t'BLACK',\n])\nexport type IconColorType = `${ValueOf<typeof IconColors>}`\n\nenum Types {\n\tBASIC = 'basic',\n\tCOMPLEX = 'complex',\n\tCOLORED = 'colored',\n}\nexport type Type = `${ValueOf<typeof Types>}`\n\nexport const IconClass = {\n\troot: 'gov-icon',\n\tholder: 'gov-icon__holder',\n}\n","import { version } from '../../package.json'\n\nexport const dsVersion = (): string => {\n\treturn version\n}\n","import { getAssetPath } from \"@stencil/core\"\nimport { dsVersion } from \"./ds.utils\"\nimport { iconsPath } from \"../helpers/Dom/win\"\n\nconst iconCache: { [key: string]: string } = {}\nconst requestCache: { [key: string]: Promise<string> } = {}\n\nconst isExternalUrl = (path: string) => path.startsWith(\"http://\") || path.startsWith(\"https://\")\nconst iconUrl = (path: string, name: string, type: string) => {\n\tif (isExternalUrl(path)) {\n\t\treturn `${path}/${type}/${name}.svg?v=${dsVersion()}`\n\t}\n\treturn getAssetPath(`${path}/${type}/${name}.svg`) + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({ name, type }: { name: string; type: string }): Promise<string> {\n\tconst cacheKey = type + \"-\" + name\n\tif (iconCache[cacheKey]) {\n\t\treturn iconCache[cacheKey]\n\t}\n\tif (!requestCache[cacheKey]) {\n\t\trequestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n\t\t\tif (resp.status === 200) {\n\t\t\t\treturn resp.text()\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Gov Icon doesn't exists\")\n\t\t\t}\n\t\t})\n\t}\n\tconst path = await requestCache[cacheKey]\n\ticonCache[cacheKey] = path\n\treturn path\n}\n","import {Nullable} from \"../../utils/helpers.types\";\nimport {isWindow} from \"./win\";\n\nexport const setCookie = (name: string, value: string, days?: number) => {\n\tif (!isWindow) {\n\t\treturn\n\t}\n\tlet expires = \"\";\n\tif (days) {\n\t\tconst date = new Date();\n\t\tdate.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n\t\texpires = \"; expires=\" + date.toUTCString();\n\t}\n\tdocument.cookie = `${name}=${encodeURIComponent(value)}${expires}; path=/`;\n}\n\nexport const getCookie = (name: string): Nullable<string> => {\n\tif (!isWindow) {\n\t\treturn null\n\t}\n\tconst nameEQ = name + \"=\";\n\tconst cookies = document.cookie.split(';');\n\tfor (let i = 0; i < cookies.length; i++) {\n\t\tlet cookie = cookies[i].trim();\n\t\tif (cookie.startsWith(nameEQ)) {\n\t\t\treturn decodeURIComponent(cookie.substring(nameEQ.length));\n\t\t}\n\t}\n\treturn null;\n}\n\nexport const isValidSVG = (svgContent: string): boolean => {\n\ttry {\n\t\tconst parser = new DOMParser();\n\t\tconst doc = parser.parseFromString(svgContent, \"image/svg+xml\");\n\t\tconst parseError = doc.querySelector(\"parsererror\");\n\t\tif (parseError) {\n\t\t\treturn false;\n\t\t}\n\t\tconst svgElement = doc.documentElement;\n\t\tif (svgElement.tagName.toLowerCase() !== \"svg\") {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch (error) {\n\t\treturn false;\n\t}\n}\n","import {Build, Component, Element, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {IconClass, IconColors, type IconColorType, IconSizesType} from \"./constants\"\nimport {fetchIcon} from \"../../utils/icon.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {iconsLazyLoad} from \"../../helpers/Dom/win\"\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {isValidSVG} from \"../../helpers/Dom/document\";\n\n@Component({\n\tassetsDirs: [\"assets\"],\n\ttag: \"gov-icon\",\n})\nexport class GovIcon {\n\tprivate h: GovHost\n\tprivate intersectionObserver: IntersectionObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovIconElement\n\t/**\n\t * Icon size\n\t */\n\t@Prop({reflect: true}) readonly size?: IconSizesType\n\t/**\n\t * Icon color\n\t */\n\t@Prop({reflect: true}) readonly color?: IconColorType\n\t/**\n\t * Name of icon in folder\n\t */\n\t@Prop({reflect: true}) name: string = null\n\t/**\n\t * Type (folder) of icon\n\t */\n\t@Prop({reflect: true}) type = \"components\"\n\n\t@State() private visible = false\n\t@State() private error = false\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(IconColors, newValue, IconClass.root)\n\t}\n\n\t@Watch(\"name\")\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst {name, visible} = this\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\treturn\n\t\t}\n\t\tawait this.loadIcon()\n\t}\n\n\tconnectedCallback(): void {\n\t\tif (iconsLazyLoad()) {\n\t\t\tthis.visible = true\n\t\t\tthis.loadIconPathData().finally()\n\t\t} else {\n\t\t\tthis.waitUntilVisible(async () => {\n\t\t\t\tthis.visible = true\n\t\t\t\tawait this.loadIconPathData()\n\t\t\t})\n\t\t}\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tif (this.intersectionObserver) {\n\t\t\tthis.intersectionObserver.disconnect()\n\t\t\tthis.intersectionObserver = null\n\t\t}\n\t}\n\n\tasync componentWillLoad(): Promise<void> {\n\t\tthis.validateSize(this.size)\n\t\tthis.validateColor(this.color)\n\t\tawait this.loadIconPathData()\n\t}\n\n\tprivate waitUntilVisible(callback: () => void): void {\n\t\tif (!Build.isBrowser || typeof window === \"undefined\" || !(window as any).IntersectionObserver) {\n\t\t\tcallback()\n\t\t\treturn\n\t\t}\n\t\tthis.intersectionObserver = new IntersectionObserver(\n\t\t\tentries => {\n\t\t\t\tentries.forEach(entry => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tif (this.intersectionObserver) {\n\t\t\t\t\t\t\tthis.intersectionObserver.disconnect()\n\t\t\t\t\t\t\tthis.intersectionObserver = null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t{rootMargin: \"50px\"},\n\t\t)\n\t\tthis.intersectionObserver.observe(this.host)\n\t}\n\n\tprivate async loadIcon() {\n\t\ttry {\n\t\t\tconst {name, type} = this\n\t\t\tconst data = await fetchIcon({name, type})\n\t\t\tconst isValid = isValidSVG(data)\n\t\t\tthis.host.innerHTML = isValid ? data : null;\n\t\t} catch (e) {\n\t\t\tthis.host.innerHTML = ''\n\t\t\tthis.error = true\n\t\t}\n\t}\n\n\trender() {\n\t\tif (this.error) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(IconClass.root)} size={this.size} color={this.color}/>\n\t\t)\n\t}\n}\n","import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const ThemeSwitchSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type ThemeSwitchSizesType = `${ValueOf<typeof ThemeSwitchSizes>}`\n\nexport const ThemeSwitchClass = {\n\troot: 'gov-theme-switch',\n\tindicator: 'gov-theme-switch__indicator',\n\ticonLight: 'gov-theme-switch__icon-light',\n\ticonDark: 'gov-theme-switch__icon-dark',\n\tlabelLight: 'gov-theme-switch__label-light',\n\tlabelDark: 'gov-theme-switch__label-dark',\n}\n\nexport const ATTRIBUTE_THEME_NAME = 'data-theme'\n","import {GovBaseEvent} from \"../../types/event.types\";\n\nexport enum ThemeList {\n\tauto = 'auto',\n\tlight = 'light',\n\tdark = 'dark'\n}\n\nexport interface ThemeSwitchEvent extends GovBaseEvent {\n\tref: HTMLGovThemeSwitchElement;\n\tstate: ThemeList\n}\n\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {GovHost} from \"../../helpers/Dom/template.types\";\nimport {govHost} from \"../../helpers/Dom/template\";\nimport {ATTRIBUTE_THEME_NAME, ThemeSwitchClass, ThemeSwitchSizes, ThemeSwitchSizesType} from \"./constants\";\nimport {isWindow} from \"../../helpers/Dom/win\";\nimport {ThemeList, ThemeSwitchEvent} from \"./gov-theme-switch.types\";\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {getCookie, setCookie} from \"../../helpers/Dom/document\";\n\n@Component({\n\ttag: \"gov-theme-switch\",\n})\nexport class GovThemeSwitch {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovThemeSwitchElement\n\n\t/**\n\t * Switch's size.\n\t */\n\t@Prop() readonly size?: ThemeSwitchSizesType = \"m\"\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"aria-label-light\"}) readonly ariaLabelLight?: \"Přenout na tmavý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"aria-label-dark\"}) readonly ariaLabelDark?: \"Přepnout na světlý mód\"\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"label-light\"}) readonly labelLight?: \"Světlý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"label-dark\"}) readonly labelDark?: \"Tmavý mód\"\n\t/**\n\t * Called when the theme is changed by the user\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<ThemeSwitchEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ThemeSwitchSizes, newValue, ThemeSwitchClass.root)\n\t}\n\n\t@Watch(\"theme\")\n\twatchTheme(newValue: ThemeList): void {\n\t\tthis.htmlElement.setAttribute(ATTRIBUTE_THEME_NAME, newValue);\n\t\tthis.htmlElement.classList.remove(...Object.keys(ThemeList));\n\t\tthis.htmlElement.classList.add(newValue);\n\t\tsetCookie(ATTRIBUTE_THEME_NAME, newValue);\n\t}\n\n\t@State() theme: ThemeList = ThemeList.auto\n\n\tprivate get storageValue() {\n\t\treturn getCookie(ATTRIBUTE_THEME_NAME)\n\t}\n\n\tprivate get htmlElement(): HTMLElement {\n\t\treturn document.documentElement\n\t}\n\n\tprivate get isSystemPrefersColorDark(): boolean {\n\t\treturn isWindow && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.initDefaultState()\n\t\tthis.validateSize(this.size)\n\t}\n\n\tprivate initDefaultState() {\n\t\tconst options = Object.keys(ThemeList);\n\t\tlet currentState = this.storageValue;\n\t\tconst htmlState = this.htmlElement.getAttribute(ATTRIBUTE_THEME_NAME)\n\n\t\tif (currentState && options.includes(currentState)) {\n\t\t\tthis.theme = currentState as ThemeList;\n\t\t} else if (htmlState && options.includes(htmlState)) {\n\t\t\tthis.theme = htmlState as ThemeList;\n\t\t} else {\n\t\t\tthis.theme = ThemeList.auto;\n\t\t}\n\t}\n\n\tprivate setThemeState = (state: ThemeList) => {\n\t\tthis.theme = state;\n\n\t\tthis.govChange.emit({\n\t\t\tcomponent: ThemeSwitchClass.root,\n\t\t\tstate: this.theme,\n\t\t\tref: this.host\n\t\t})\n\t}\n\n\trender() {\n\t\tlet isDark = this.theme === ThemeList.dark;\n\t\tif (this.theme === ThemeList.auto) {\n\t\t\tisDark = this.isSystemPrefersColorDark;\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ThemeSwitchClass.root)}\n\t\t\t\t theme={isDark ? ThemeList.dark : ThemeList.light}\n\t\t\t\t size={this.size}>\n\t\t\t\t<button onClick={() => this.setThemeState(isDark ? ThemeList.light : ThemeList.dark)}\n\t\t\t\t\t\taria-label={isDark ? this.ariaLabelLight : this.ariaLabelDark}>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<span class={ThemeSwitchClass.indicator}>\n\t\t\t\t\t\t\t{ThemeList.light && <gov-icon name=\"sun\" class={ThemeSwitchClass.iconLight} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t\t{ThemeList.dark && <gov-icon name=\"moon\" class={ThemeSwitchClass.iconDark} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<gov-form-label class={ThemeSwitchClass.labelLight} size={this.size}>\n\t\t\t\t\t\t\t{this.labelLight}\n\t\t\t\t\t\t</gov-form-label>\n\t\t\t\t\t\t<gov-form-label class={ThemeSwitchClass.labelDark} size={this.size}>\n\t\t\t\t\t\t\t{this.labelDark}\n\t\t\t\t\t\t</gov-form-label>\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"iVAAO,MAAMA,EAAY,CACxBC,KAAM,Y,MCOMC,EAAO,MAGnB,WAAAC,CAAAC,G,yBASyE,M,iIARxEC,KAAKC,EAAI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Mb,KAAKa,MAC5Db,KAAKwH,a","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,c as a,h as t,a as s,g as c}from"./p-8506b611.js";import{v as d}from"./p-0b3574c2.js";import{S as i,c as o}from"./p-a521c59a.js";import{c as r}from"./p-cd6c2938.js";import{g as n}from"./p-ea7fdd2e.js";import"./p-e8ec030e.js";import"./p-e0e2e9c1.js";import"./p-5aad3497.js";import"./p-92f420cb.js";const p=class{constructor(t){e(this,t);this.govChange=a(this,"gov-change",7);this.hydrated=false;this.color="primary";this.size="m";this.identifier=undefined;this.h=n(this.host);this.triggerId=r("GovStepperItem");this.contentId=r("GovStepperContent")}validateColor(e){d(o,e,i.root)}componentWillLoad(){this.validateColor(this.color)}connectedCallback(){this.hydrated=true}render(){const e=this.identifier||this.triggerId;const a=this.contentId;return t(s,{key:"f722a022748d8fcb4ca0a27108a7e2e2980a1602",id:e,class:this.h.classes(i.root),color:this.color,role:"listitem",hydrated:this.hydrated},this.h.hasSlot("prefix")&&t("span",{key:"eed745cace26ca1d31c6441dd7be76d3dfa6bd4c",class:i.prefix},t("slot",{key:"d5cab6411231cd082468bcc5c244ee75e0dba147",name:"prefix"})),t("div",{key:"c13c92aa7890f8406eb5870caa93d186801c0a75"},t("span",{key:"ad456eb4699a3d32dfa2d5d477bd346cb1814473",class:i.headline},t("slot",{key:"0dfdb036dcc108943be0795269e7e0b5f8ac0a29",name:"headline"})),t("slot",{key:"24220b19c2f3c6af35407da423bb1900dc363db8",name:"annotation"}),this.h.hasSlot("content")&&t("div",{key:"2bdd3feeaeafdcf73534bfadb5ff29d90eb9e037",class:i.content,id:a,"aria-labelledby":e,role:"tabpanel"},t("slot",{key:"f2f70633c3c2adcc7bd407a23863e0a6fba5ec89",name:"content"}))))}get host(){return c(this)}static get watchers(){return{color:["validateColor"]}}};export{p as gov_stepper_item};
|
|
2
|
+
//# sourceMappingURL=p-41c6b262.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GovStepperItem","constructor","hostRef","this","hydrated","h","govHost","host","triggerId","createID","contentId","validateColor","newValue","validateProp","StepperColors","StepperItemClass","root","componentWillLoad","color","connectedCallback","render","identifier","Host","key","id","class","classes","role","hasSlot","prefix","name","headline","content"],"sources":["../../../packages/core/src/components/gov-stepper/gov-stepper-item.tsx"],"sourcesContent":["import { Component, Element, h, Prop, Watch, Host, Event, EventEmitter } from '@stencil/core'\nimport { validateProp } from '../../helpers/Validate/props'\nimport { StepperSizesType, StepperItemClass, StepperColorType, StepperColors } from './constants'\nimport { createID } from '../../utils/string.utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovStepperItemChangeEvent } from './gov-stepper-item.d'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-stepper-item',\n})\nexport class GovStepperItem {\n\tprivate h: GovHost\n\tprivate readonly triggerId: string\n\tprivate readonly contentId: string\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.triggerId = createID('GovStepperItem')\n\t\tthis.contentId = createID('GovStepperContent')\n\t}\n\n\t@Element() readonly host: HTMLGovStepperItemElement\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly color?: StepperColorType = 'primary'\n\t/**\n\t * Size of stepper\n\t */\n\t@Prop() readonly size?: StepperSizesType = 'm'\n\t/**\n\t * Custom stepper item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovStepperItemChangeEvent>\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(StepperColors, newValue, StepperItemClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst triggerId = this.identifier || this.triggerId\n\t\tconst contentId = this.contentId\n\n\t\treturn (\n\t\t\t<Host id={triggerId} class={this.h.classes(StepperItemClass.root)} color={this.color} role=\"listitem\" hydrated={this.hydrated}>\n\t\t\t\t{this.h.hasSlot('prefix') && (\n\t\t\t\t\t<span class={StepperItemClass.prefix}>\n\t\t\t\t\t\t<slot name=\"prefix\" />\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t<div>\n\t\t\t\t\t<span class={StepperItemClass.headline}>\n\t\t\t\t\t\t<slot name=\"headline\" />\n\t\t\t\t\t</span>\n\t\t\t\t\t<slot name=\"annotation\" />\n\n\t\t\t\t\t{this.h.hasSlot('content') && (\n\t\t\t\t\t\t<div class={StepperItemClass.content} id={contentId} aria-labelledby={triggerId} role=\"tabpanel\">\n\t\t\t\t\t\t\t<slot name=\"content\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["GovStepperItem","constructor","hostRef","this","hydrated","h","govHost","host","triggerId","createID","contentId","validateColor","newValue","validateProp","StepperColors","StepperItemClass","root","componentWillLoad","color","connectedCallback","render","identifier","Host","key","id","class","classes","role","hasSlot","prefix","name","headline","content"],"sources":["../../../packages/core/src/components/gov-stepper/gov-stepper-item.tsx"],"sourcesContent":["import { Component, Element, h, Prop, Watch, Host, Event, EventEmitter } from '@stencil/core'\nimport { validateProp } from '../../helpers/Validate/props'\nimport { StepperSizesType, StepperItemClass, StepperColorType, StepperColors } from './constants'\nimport { createID } from '../../utils/string.utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovStepperItemChangeEvent } from './gov-stepper-item.d'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-stepper-item',\n})\nexport class GovStepperItem {\n\tprivate h: GovHost\n\tprivate readonly triggerId: string\n\tprivate readonly contentId: string\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.triggerId = createID('GovStepperItem')\n\t\tthis.contentId = createID('GovStepperContent')\n\t}\n\n\t@Element() readonly host: HTMLGovStepperItemElement\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly color?: StepperColorType = 'primary'\n\t/**\n\t * Size of stepper\n\t */\n\t@Prop() readonly size?: StepperSizesType = 'm'\n\t/**\n\t * Custom stepper item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovStepperItemChangeEvent>\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(StepperColors, newValue, StepperItemClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst triggerId = this.identifier || this.triggerId\n\t\tconst contentId = this.contentId\n\n\t\treturn (\n\t\t\t<Host id={triggerId} class={this.h.classes(StepperItemClass.root)} color={this.color} role=\"listitem\" hydrated={this.hydrated}>\n\t\t\t\t{this.h.hasSlot('prefix') && (\n\t\t\t\t\t<span class={StepperItemClass.prefix}>\n\t\t\t\t\t\t<slot name=\"prefix\" />\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t\t<div>\n\t\t\t\t\t<span class={StepperItemClass.headline}>\n\t\t\t\t\t\t<slot name=\"headline\" />\n\t\t\t\t\t</span>\n\t\t\t\t\t<slot name=\"annotation\" />\n\n\t\t\t\t\t{this.h.hasSlot('content') && (\n\t\t\t\t\t\t<div class={StepperItemClass.content} id={contentId} aria-labelledby={triggerId} role=\"tabpanel\">\n\t\t\t\t\t\t\t<slot name=\"content\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"6TAWaA,EAAc,MAM1B,WAAAC,CAAAC,G,gDAFQC,KAAAC,SAAW,M,WAayB,U,UAID,I,0BAd1CD,KAAKE,EAAIC,EAAQH,KAAKI,MACtBJ,KAAKK,UAAYC,EAAS,kBAC1BN,KAAKO,UAAYD,EAAS,oB,CAuB3B,aAAAE,CAAcC,GACbC,EAAaC,EAAeF,EAAUG,EAAiBC,K,CAGxD,iBAAAC,GACCd,KAAKQ,cAAcR,KAAKe,M,CAGzB,iBAAAC,GACChB,KAAKC,SAAW,I,CAGjB,MAAAgB,GACC,MAAMZ,EAAYL,KAAKkB,YAAclB,KAAKK,UAC1C,MAAME,EAAYP,KAAKO,UAEvB,OACCL,EAACiB,EAAI,CAAAC,IAAA,2CAACC,GAAIhB,EAAWiB,MAAOtB,KAAKE,EAAEqB,QAAQX,EAAiBC,MAAOE,MAAOf,KAAKe,MAAOS,KAAK,WAAWvB,SAAUD,KAAKC,UACnHD,KAAKE,EAAEuB,QAAQ,WACfvB,EAAA,QAAAkB,IAAA,2CAAME,MAAOV,EAAiBc,QAC7BxB,EAAA,QAAAkB,IAAA,2CAAMO,KAAK,YAGbzB,EAAA,OAAAkB,IAAA,4CACClB,EAAA,QAAAkB,IAAA,2CAAME,MAAOV,EAAiBgB,UAC7B1B,EAAA,QAAAkB,IAAA,2CAAMO,KAAK,cAEZzB,EAAA,QAAAkB,IAAA,2CAAMO,KAAK,eAEV3B,KAAKE,EAAEuB,QAAQ,YACfvB,EAAA,OAAAkB,IAAA,2CAAKE,MAAOV,EAAiBiB,QAASR,GAAId,EAAS,kBAAmBF,EAAWmB,KAAK,YACrFtB,EAAA,QAAAkB,IAAA,2CAAMO,KAAK,c","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as s,h as i,a as e,g as o}from"./p-8506b611.js";import{c as h}from"./p-cd6c2938.js";import{g as a,c as n,t as r}from"./p-ea7fdd2e.js";import{g as l}from"./p-da1db6fd.js";import{i as c}from"./p-d9a299a4.js";import{A as f,a as d}from"./p-9ac55bd1.js";import"./p-92f420cb.js";import"./p-e0e2e9c1.js";import"./p-7f3becc5.js";import"./p-5aad3497.js";import"./p-56efd4a2.js";import"./p-7ba4daf4.js";const m={root:"gov-form-file",area:"gov-form-file__area",input:"gov-form-file__input",attachments:"gov-form-file__attachments"};function p(t){const s=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let i=0,e=parseInt(t,10)||0;while(e>=1024&&++i){e=e/1024}return e.toFixed(e<10&&i>0?1:0)+" "+s[i]}function u(t,s){if(typeof s==="string"&&s.length){return s.replace(/\s/g,"").split(",").filter((s=>new RegExp(s.replace("*",".*")).test(t.type))).length>0}else{return true}}function g(t,s){const i=Math.round(t.size);return i<=s}const v=class{constructor(i){t(this,i);this.govFocus=s(this,"gov-focus",7);this.govBlur=s(this,"gov-blur",7);this.govFiles=s(this,"gov-files",7);this.govAddFile=s(this,"gov-add-file",7);this.govRemoveFile=s(this,"gov-remove-file",7);this.eventsRegistered=false;this.expanded=false;this.required=false;this.disabled=false;this.resetAfterPick=false;this.ignoreFileDuplicationCheck=false;this.displayAttachments=true;this.name=undefined;this.accept=undefined;this.multiple=false;this.maxFileSize=-1;this.identifier=undefined;this.invalid=undefined;this.errorSize="Soubor je větší než povolená velikost {FILE_SIZE}";this.errorAccept="Soubor tohoto typu není povolen";this.accessibleRemoveLabel="Odebrat soubor {FILE_NAME}";this.accessibleAttachmentsLabel="Přílohy";this.files=[];this.inheritedAttributes={};this.fileId=h("GovInputFile");this.h=a(this.host);this.f=l(this.h)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("invalid",n(this.invalid));this.f.passAttrToControl("disabled",n(this.disabled));this.f.passAttrToControl("type","File")}registerListeners(){if(this.eventsRegistered){return}this.eventsRegistered=true;function t(){this.areaRef.classList.add("highlight")}function s(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(t=>{t.preventDefault();t.stopPropagation();const s=t.target.files;if(this.resetAfterPick){if(s.length){this.validateFiles(s)}}else{this.validateFiles(s)}}),false);if(this.expanded){const i=["dragover","dragleave"];const e=["dragenter","dragover","mouseenter"];const o=["dragleave","mouseleave"];i.map((t=>this.inputRef.addEventListener(t,this.preventDefaults.bind(this),false)));e.map((s=>this.inputRef.addEventListener(s,t.bind(this),false)));o.forEach((t=>this.inputRef.addEventListener(t,s.bind(this),false)))}}preventDefaults(t){t.preventDefault();t.stopPropagation()}handleDrop(t){const s=t.dataTransfer;this.validateFiles(s.files)}validateFiles(t){let s=[];Array.from(t).map((t=>{const i=this.files.find((s=>s.file.name===t.name&&s.file.size===t.size))||null;if(i===null||this.ignoreFileDuplicationCheck){const i=typeof this.maxFileSize==="number"&&this.maxFileSize>0?g(t,this.maxFileSize):true;const e=u(t,this.accept);const o={id:h("GovFormFile"),file:t,acceptValid:e,sizeValid:i};if(this.displayAttachments){this.files=[...this.files,o]}else{s=[...s,o]}this.govAddFile.emit({component:m.root,file:o})}}));this.govFiles.emit({component:m.root,files:s.length?s:this.files});if(this.resetAfterPick){this.reset().finally()}}componentDidLoad(){this.attributeObserver=new f(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(d)}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs();this.inheritedAttributes=c(this.host)}async componentDidRender(){this.registerListeners()}disconnectedCallback(){this.attributeObserver.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}render(){return i(e,{key:"30047bbc26c5d51b5e24a6e8ce33690b31fe3b1d",class:this.h.classes([m.root]),invalid:r(this.invalid),expanded:r(this.expanded)},i("div",{key:"f99d4ee71f9126f9fc72acb6adf2ea964410d738",class:m.area,ref:t=>this.areaRef=t},i("slot",{key:"a280d44c9b649aa8ccdc48356a0173e183dbd3ee"}),i("input",Object.assign({key:"2abf8d4c1f0d9086fbe63d86f71c9cdc3e0867c3",class:m.input,ref:t=>this.inputRef=t,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":r(this.required),"aria-invalid":r(this.invalid),"aria-disabled":r(this.disabled)}))),this.h.hasSlot("attachments")?i("div",{class:m.attachments},i("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?i("div",{class:m.attachments},i("gov-attachments",{label:this.accessibleAttachmentsLabel,"accessible-label":this.accessibleAttachmentsLabel},this.files.map((t=>i("gov-attachments-item",{"accessible-remove-labelledby":t.id,"on-gov-remove":()=>this.onRemoveFileHandler(t)},i("span",{class:"sr-only",id:t.id},this.accessibleRemoveLabel.replace("{FILE_NAME}",t.file.name)),t.file.name,t.acceptValid===false?i("gov-form-message",{slot:"message",color:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill",type:"components"}),t.acceptValid===false?this.errorAccept:null):null,t.sizeValid===false?i("gov-form-message",{slot:"message",color:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill",type:"components"}),this.errorSize.replace("{FILE_SIZE}",p(this.maxFileSize))):null,i("span",{slot:"info"},"(",p(t.file.size),")")))))):null)}onRemoveFileHandler(t){const s=this.files.findIndex((s=>s.id===t.id));if(s!==-1){const t=this.files;const i=this.files[s];t.splice(s,1);this.files=[...t];this.govRemoveFile.emit({component:m.root,file:i});this.govFiles.emit({component:m.root,files:t})}}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:m.root,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:m.root,originalEvent:t})}onChangeHandler(t){t.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async reset(){this.files=[];this.inputRef.value=""}get host(){return o(this)}static get watchers(){return{disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}}};export{v as gov_form_file};
|
|
2
|
+
//# sourceMappingURL=p-432c3875.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FormFileClass","root","area","input","attachments","formatBytes","bytes","units","l","n","parseInt","toFixed","fileAcceptValidation","file","accept","length","replace","split","filter","RegExp","test","type","fileSizeValidation","maxSize","fileSize","Math","round","size","GovFormFile","constructor","hostRef","this","eventsRegistered","fileId","createID","h","govHost","host","f","govForm","watchControlAttrs","passControlAttrs","passAttrToControl","toBoolAttr","invalid","disabled","registerListeners","highlight","areaRef","classList","add","unhighlight","remove","inputRef","addEventListener","e","preventDefault","stopPropagation","files","target","resetAfterPick","validateFiles","expanded","events","inEvents","outEvents","map","eventName","preventDefaults","bind","forEach","handleDrop","dataTransfer","filesBuffer","Array","from","isFile","find","item","name","ignoreFileDuplicationCheck","isSizeValid","maxFileSize","isAcceptValid","newFile","id","acceptValid","sizeValid","displayAttachments","govAddFile","emit","component","govFiles","reset","finally","componentDidLoad","attributeObserver","AttributeObserver","attributeName","newValue","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","passAttrToLabel","String","required","inheritedAttributes","inheritAriaAttributes","componentDidRender","disconnectedCallback","stopObserving","removeAttribute","Object","assign","render","Host","key","class","classes","toBoolAttrIfDefined","ref","el","identifier","multiple","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","hasSlot","label","accessibleAttachmentsLabel","onRemoveFileHandler","accessibleRemoveLabel","slot","color","errorAccept","errorSize","index","findIndex","removeFile","splice","govRemoveFile","govFocus","originalEvent","govBlur","getRef","getAreaRef","value"],"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"],"mappings":"yZAAO,MAAMA,EAAgB,CAC5BC,KAAM,gBACNC,KAAM,sBACNC,MAAO,uBACPC,YAAa,8B,SCJEC,EAAYC,GAC3B,MAAMC,EAAQ,CAAC,QAAS,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OACzE,IAAIC,EAAI,EACPC,EAAIC,SAASJ,EAAO,KAAO,EAE5B,MAAOG,GAAK,QAAUD,EAAG,CACxBC,EAAIA,EAAI,I,CAGT,OAAOA,EAAEE,QAAQF,EAAI,IAAMD,EAAI,EAAI,EAAI,GAAK,IAAMD,EAAMC,EACzD,C,SAEgBI,EAAqBC,EAAYC,GAChD,UAAWA,IAAW,UAAYA,EAAOC,OAAQ,CAChD,OACCD,EACEE,QAAQ,MAAO,IACfC,MAAM,KACNC,QAAOJ,GACA,IAAIK,OAAOL,EAAOE,QAAQ,IAAK,OAAOI,KAAKP,EAAKQ,QACrDN,OAAS,C,KAER,CACN,OAAO,I,CAET,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O,GACpB7G,KAAK2B,MAAQ,IAAIA,GACjB3B,KAAKiH,cAActD,KAAK,CACvBC,UAAW3F,EAAcC,KACzBY,KAAMiI,IAEP/G,KAAK6D,SAASF,KAAK,CAClBC,UAAW3F,EAAcC,KACzByD,S,EAKK,cAAAsE,CAAezE,GACtBA,EAAEE,kBACF1B,KAAKkH,SAASvD,KAAK,CAClBC,UAAW3F,EAAcC,KACzBiJ,cAAe3F,G,CAIT,aAAA2E,CAAc3E,GACrBA,EAAEE,kBACF1B,KAAKoH,QAAQzD,KAAK,CACjBC,UAAW3F,EAAcC,KACzBiJ,cAAe3F,G,CAIT,eAAAuE,CAAgBvE,GACvBA,EAAEE,iB,CAOH,YAAM2F,GACL,OAAOrH,KAAKsB,Q,CAOb,gBAAMgG,GACL,OAAOtH,KAAKiB,O,CAOb,WAAM6C,GACL9D,KAAK2B,MAAQ,GACb3B,KAAKsB,SAASiG,MAAQ,E","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as s,h as t,a,g as e}from"./p-8506b611.js";import{L as c}from"./p-13ebd887.js";import{g as r}from"./p-ea7fdd2e.js";const f=class{constructor(t){s(this,t);this.type="stretch";this.variant=undefined;this.inverse=false;this.h=r(this.host)}typeClass(s,t,a,e){const c=t?"-"+t:"";const r=a?"-"+a:"";const f=e?"-inverse":"";return s+" "+s+c+r+f}render(){return t(a,{key:"ba8fc53df2f13fcf8b87f25f073d0284b68b0a3a",type:this.type,class:this.h.classes(c.root)},t("section",{key:"f645a9b32495c4fc1c0c86a0078c78c4bc00a1e8",class:this.typeClass(c.section,this.type,this.variant,this.inverse)},t("slot",{key:"5b0d1a3a137a8fe3bb90ae5dff2dbc179575af56"})))}get host(){return e(this)}};export{f as gov_layout};
|
|
2
|
+
//# sourceMappingURL=p-439b66a5.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GovLayout","constructor","hostRef","this","h","govHost","host","typeClass","originalClass","type","variant","inverse","isType","isVariant","isInverse","render","Host","key","class","classes","LayoutClass","root","section"],"sources":["../../../packages/core/src/components/gov-layout/gov-layout.tsx"],"sourcesContent":["import { Component, Element, h, Host, Prop } from '@stencil/core'\nimport { LayoutClass, LayoutType, LayoutVariantType } from './constants'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { govHost } from '../../helpers/Dom/template'\n\n@Component({\n\ttag: 'gov-layout',\n})\nexport class GovLayout {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovLayoutElement\n\t/**\n\t * Layout type\n\t */\n\t@Prop() readonly type?: LayoutType = 'stretch'\n\t/**\n\t * Layout align\n\t */\n\t@Prop() readonly variant?: LayoutVariantType\n\t/**\n\t * Determine if component should have inverse column order\n\t */\n\t@Prop() readonly inverse: boolean = false\n\n\tprivate typeClass(originalClass: string, type: string, variant: string, inverse: boolean) {\n\t\tconst isType = type ? '-' + type : ''\n\t\tconst isVariant = variant ? '-' + variant : ''\n\t\tconst isInverse = inverse ? '-inverse' : ''\n\t\treturn originalClass + ' ' + originalClass + isType + isVariant + isInverse\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host type={this.type} class={this.h.classes(LayoutClass.root)}>\n\t\t\t\t<section class={this.typeClass(LayoutClass.section, this.type, this.variant, this.inverse)}>\n\t\t\t\t\t<slot />\n\t\t\t\t</section>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["GovLayout","constructor","hostRef","this","h","govHost","host","typeClass","originalClass","type","variant","inverse","isType","isVariant","isInverse","render","Host","key","class","classes","LayoutClass","root","section"],"sources":["../../../packages/core/src/components/gov-layout/gov-layout.tsx"],"sourcesContent":["import { Component, Element, h, Host, Prop } from '@stencil/core'\nimport { LayoutClass, LayoutType, LayoutVariantType } from './constants'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { govHost } from '../../helpers/Dom/template'\n\n@Component({\n\ttag: 'gov-layout',\n})\nexport class GovLayout {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovLayoutElement\n\t/**\n\t * Layout type\n\t */\n\t@Prop() readonly type?: LayoutType = 'stretch'\n\t/**\n\t * Layout align\n\t */\n\t@Prop() readonly variant?: LayoutVariantType\n\t/**\n\t * Determine if component should have inverse column order\n\t */\n\t@Prop() readonly inverse: boolean = false\n\n\tprivate typeClass(originalClass: string, type: string, variant: string, inverse: boolean) {\n\t\tconst isType = type ? '-' + type : ''\n\t\tconst isVariant = variant ? '-' + variant : ''\n\t\tconst isInverse = inverse ? '-inverse' : ''\n\t\treturn originalClass + ' ' + originalClass + isType + isVariant + isInverse\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host type={this.type} class={this.h.classes(LayoutClass.root)}>\n\t\t\t\t<section class={this.typeClass(LayoutClass.section, this.type, this.variant, this.inverse)}>\n\t\t\t\t\t<slot />\n\t\t\t\t</section>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"kIAQaA,EAAS,MAGrB,WAAAC,CAAAC,G,oBAQqC,U,oCAQD,MAfnCC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAiBf,SAAAC,CAAUC,EAAuBC,EAAcC,EAAiBC,GACvE,MAAMC,EAASH,EAAO,IAAMA,EAAO,GACnC,MAAMI,EAAYH,EAAU,IAAMA,EAAU,GAC5C,MAAMI,EAAYH,EAAU,WAAa,GACzC,OAAOH,EAAgB,IAAMA,EAAgBI,EAASC,EAAYC,C,CAGnE,MAAAC,GACC,OACCX,EAACY,EAAI,CAAAC,IAAA,2CAACR,KAAMN,KAAKM,KAAMS,MAAOf,KAAKC,EAAEe,QAAQC,EAAYC,OACxDjB,EAAA,WAAAa,IAAA,2CAASC,MAAOf,KAAKI,UAAUa,EAAYE,QAASnB,KAAKM,KAAMN,KAAKO,QAASP,KAAKQ,UACjFP,EAAA,QAAAa,IAAA,8C","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,h as a,a as t,g as s}from"./p-8506b611.js";import{p as o}from"./p-e0e2e9c1.js";import{S as c}from"./p-92f420cb.js";import{g as i}from"./p-ea7fdd2e.js";import{v as r}from"./p-0b3574c2.js";import{a as f,b as m}from"./p-5f1000da.js";import"./p-e8ec030e.js";o(c,["_S","_M","_L"]);const p={root:"gov-empty",content:"gov-empty__content"};const d=class{constructor(a){e(this,a);this.size="m";this.h=i(this.host)}validateSize(e){r(m,e,f.root)}componentWillLoad(){this.validateSize(this.size)}render(){return a(t,{key:"25d3813acc796b96c6e51aec4a55fc2efa725aa6",class:this.h.classes(p.root),size:this.size},this.h.hasSlot("icon")&&a("slot",{key:"7fccad0fe25b57219f06cfbcf18a2f2bff19c905",name:"icon"}),a("div",{key:"a4cffd5e7175ba9273a5ea74ba622e2a577ba0fe",class:p.content},a("slot",{key:"53fd435d43baa4841ecb5e3d5817efcb57433eab",name:"headline"}),a("slot",{key:"314e7a0fd7a381dbc4a85da4df2082ce4946b7b5"})))}get host(){return s(this)}static get watchers(){return{size:["validateSize"]}}};export{d as gov_empty};
|
|
2
|
+
//# sourceMappingURL=p-4b90fbc4.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["pick","Sizes","EmptyClass","root","content","GovEmpty","constructor","hostRef","this","h","govHost","host","validateSize","newValue","validateProp","AccordionSizes","AccordionClass","componentWillLoad","size","render","Host","key","class","classes","hasSlot","name"],"sources":["../../../packages/core/src/components/gov-empty/constants.ts","../../../packages/core/src/components/gov-empty/gov-empty.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const EmptySizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type EmptySizesType = `${ValueOf<typeof EmptySizes>}`\n\nexport const EmptyClass = {\n\troot: 'gov-empty',\n\tcontent: 'gov-empty__content',\n}\n","import {Component, Element, Host, h, Prop, Watch} from '@stencil/core'\nimport {EmptyClass, EmptySizesType} from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {AccordionClass, AccordionSizes} from \"../gov-accordion/constants\";\n\n@Component({\n\ttag: 'gov-empty',\n})\nexport class GovEmpty {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovEmptyElement\n\t/**\n\t * Element size.\n\t */\n\t@Prop() readonly size?: EmptySizesType = 'm'\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(AccordionSizes, newValue, AccordionClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(EmptyClass.root)} size={this.size}>\n\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t)}\n\t\t\t\t<div class={EmptyClass.content}>\n\t\t\t\t\t<slot name=\"headline\" />\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["pick","Sizes","EmptyClass","root","content","GovEmpty","constructor","hostRef","this","h","govHost","host","validateSize","newValue","validateProp","AccordionSizes","AccordionClass","componentWillLoad","size","render","Host","key","class","classes","hasSlot","name"],"sources":["../../../packages/core/src/components/gov-empty/constants.ts","../../../packages/core/src/components/gov-empty/gov-empty.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const EmptySizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type EmptySizesType = `${ValueOf<typeof EmptySizes>}`\n\nexport const EmptyClass = {\n\troot: 'gov-empty',\n\tcontent: 'gov-empty__content',\n}\n","import {Component, Element, Host, h, Prop, Watch} from '@stencil/core'\nimport {EmptyClass, EmptySizesType} from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {AccordionClass, AccordionSizes} from \"../gov-accordion/constants\";\n\n@Component({\n\ttag: 'gov-empty',\n})\nexport class GovEmpty {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovEmptyElement\n\t/**\n\t * Element size.\n\t */\n\t@Prop() readonly size?: EmptySizesType = 'm'\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(AccordionSizes, newValue, AccordionClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(EmptyClass.root)} size={this.size}>\n\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t)}\n\t\t\t\t<div class={EmptyClass.content}>\n\t\t\t\t\t<slot name=\"headline\" />\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"4QAI0BA,EAAKC,EAAO,CAAC,KAAM,KAAM,OAG5C,MAAMC,EAAa,CACzBC,KAAM,YACNC,QAAS,sB,MCCGC,EAAQ,MAGpB,WAAAC,CAAAC,G,oBAQyC,IAPxCC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAUvB,YAAAC,CAAaC,GACZC,EAAaC,EAAgBF,EAAUG,EAAeb,K,CAGvD,iBAAAc,GACCT,KAAKI,aAAaJ,KAAKU,K,CAGxB,MAAAC,GACC,OACCV,EAACW,EAAI,CAAAC,IAAA,2CAACC,MAAOd,KAAKC,EAAEc,QAAQrB,EAAWC,MAAOe,KAAMV,KAAKU,MACvDV,KAAKC,EAAEe,QAAQ,SACff,EAAA,QAAAY,IAAA,2CAAMI,KAAK,SAEZhB,EAAA,OAAAY,IAAA,2CAAKC,MAAOpB,EAAWE,SACtBK,EAAA,QAAAY,IAAA,2CAAMI,KAAK,aACXhB,EAAA,QAAAY,IAAA,8C","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as i,h as s,a as e,g as h}from"./p-8506b611.js";import{g as n,l as a,m as o}from"./p-da1db6fd.js";import{g as d,c as r,t as c,d as l}from"./p-ea7fdd2e.js";import{v as f}from"./p-0b3574c2.js";import{c as p}from"./p-cd6c2938.js";import{A as u,a as b}from"./p-9ac55bd1.js";import{i as m}from"./p-d9a299a4.js";import{p as v}from"./p-e0e2e9c1.js";import{S as g}from"./p-92f420cb.js";import{C as y}from"./p-5aad3497.js";import"./p-7f3becc5.js";import"./p-56efd4a2.js";import"./p-7ba4daf4.js";import"./p-e8ec030e.js";var k;(function(t){t["INPUT"]="input";t["TEXTAREA"]="textarea"})(k||(k={}));const j=class{constructor(s){t(this,s);this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govInput=i(this,"gov-input",7);this.govKeyUp=i(this,"gov-keyup",7);this.govHydrated=i(this,"gov-hydrated",7);this.govKeyDown=i(this,"gov-keydown",7);this.value=undefined;this.identifier=undefined;this.success=undefined;this.size="m";this.name=undefined;this.multiline=undefined;this.rows=undefined;this.cols=undefined;this.required=false;this.disabled=false;this.placeholder=undefined;this.readonly=undefined;this.minlength=undefined;this.maxlength=undefined;this.min=undefined;this.max=undefined;this.autocomplete=undefined;this.autocorrect=undefined;this.spellcheck=undefined;this.inputLang=undefined;this.type=undefined;this.inputType="text";this.role=undefined;this.invalid=undefined;this.accessibleShowPasswordLabel="Zobrazit heslo";this.accessibleHidePasswordLabel="Skrýt heslo";this.focused=undefined;this.showPassword=false;this.inheritedAttributes={};this.h=d(this.host);this.inputId=p("GovInput");this.f=n(this.h)}validateSize(t){f(o,t,a.root)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("success",r(this.success));this.f.passAttrToControl("disabled",r(this.disabled));this.f.passAttrToControl("invalid",r(this.invalid));this.f.passAttrToControl("type",this.multiline?k.TEXTAREA:k.INPUT)}componentDidLoad(){this.attributeObserver=new u(this.host,((t,i)=>{this.onAriaAttributeChange(t,i)}));this.attributeObserver.startObserving(b);this.govHydrated.emit()}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=m(this.host)}componentDidRender(){this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required))}onAriaAttributeChange(t,i){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:i})}disconnectedCallback(){this.attributeObserver.stopObserving()}render(){const t=this.multiline?k.TEXTAREA:k.INPUT;return s(e,{key:"5210373fd88e2b80df5a4206c5b25b5695f2894b",class:a.root,size:this.size,type:this.type},this.h.hasSlot("prefix")&&s("slot",{key:"9215c45132a4b9dc8fd0da79ef8d082dcce0789b",name:"prefix"}),s("span",{key:"e58ab94aa7926dbd8488ce8323b6c8dbec9ce765",class:"element"},this.h.hasSlot("icon-start")&&!this.multiline&&s("div",{key:"8e67ba10cfb47232f6c0d817df292668c2a4a7e8",class:a.icons,onClick:()=>this.inputRef.focus()},s("slot",{key:"a186f1fbe47936219f6a6a26cb2d0c2b0dbe08f8",name:"icon-start"})),s(t,Object.assign({key:"1090f6e6705365ffc83b5397ad669638d996f5bd",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:t=>this.inputRef=t,placeholder:this.placeholder,spellcheck:c(this.spellcheck),lang:this.inputLang,readonly:c(this.readonly),autocomplete:l(this.autocomplete),autocorrect:l(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":c(this.required),"aria-invalid":c(this.invalid),"aria-disabled":c(this.disabled)})),(this.success||this.invalid||this.h.hasSlot("icon-end")||this.inputType==="password")&&!this.multiline&&s("div",{key:"49cb072b3448735677c47883d851557f107dd6cb",class:a.icons,onClick:()=>this.inputRef.focus()},this.success&&!this.multiline&&s("gov-icon",{key:"f00df3e88ba3a0d695bf9f33ddb51af7a8fb4a96",class:"validation-icon",name:"check-lg",type:"components"}),this.invalid&&!this.multiline&&s("gov-icon",{key:"523966e75d3f3d49eff396226673c3c96cf6de60",class:"validation-icon",name:"exclamation-lg",type:"components"}),this.h.hasSlot("icon-end")&&this.inputType!=="password"&&s("slot",{key:"b707c094fe32bf5864c66e40a95a22f2b27d79b3",name:"icon-end"}),this.inputType==="password"?s("gov-button",{color:"primary",type:"base",size:this.size,"aria-label":this.showPassword?this.accessibleHidePasswordLabel:this.accessibleShowPasswordLabel,"on-gov-click":()=>this.showPassword=!this.showPassword},s("gov-icon",{slot:"icon-start",name:"eye",type:"components"})):null)),this.h.hasSlot("sufix")&&s("slot",{key:"945df71d1a6c3edd76769ae3310bdd33df694d2b",name:"sufix"}))}onFocusHandler(t){t.stopPropagation();this.focused=true;this.govFocus.emit({component:a.root,value:this.value,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.focused=false;this.govBlur.emit({component:a.root,value:this.value,originalEvent:t})}onKeyUpHandler(t){t.stopPropagation();this.govKeyUp.emit({component:a.root,value:this.value,originalEvent:t})}onKeyDownHandler(t){t.stopPropagation();this.govKeyDown.emit({component:a.root,value:this.value,originalEvent:t})}onInputHandler(t){this.value=t.target.value;t.stopPropagation();this.govInput.emit({component:a.root,value:this.value,originalEvent:t})}async setFocus(t){return this.inputRef.focus(t)}async setValue(t){this.value=t}async clearValue(){this.value="";this.inputRef.value=""}async getRef(){return this.inputRef}get host(){return h(this)}static get watchers(){return{size:["validateSize","watchControlAttrs"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"]}}};const w=v(g,["_XS","_S","_M","_L","_XL"]);v(y,["PRIMARY","NEUTRAL"]);var A;(function(t){t["CIRCLE"]="circle";t["LINE"]="line"})(A||(A={}));var x;(function(t){t["PULSE"]="pulse";t["PROGRESS"]="progress";t["FALSE"]="false"})(x||(x={}));const C={root:"gov-skeleton"};const z=class{constructor(i){t(this,i);this.items=[];this.size="m";this.color="neutral";this.shape="line";this.width=null;this.height=null;this.animation="progress";this.inheritedAttributes={};this.h=d(this.host)}validateSize(t){f(w,t,C.root)}validateShape(t){f(A,t,C.root)}validateAnimation(t){f(x,t,C.root)}componentDidLoad(){this.attributeObserver=new u(this.host,((t,i)=>{this.onAriaAttributeChange(t,i)}));this.attributeObserver.startObserving(b)}componentWillLoad(){this.validateSize(this.size);this.validateShape(this.shape);this.validateAnimation(this.animation);this.init();this.inheritedAttributes=m(this.host)}componentWillUpdate(){this.init()}disconnectedCallback(){this.attributeObserver.stopObserving()}onAriaAttributeChange(t,i){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:i})}init(){this.items.fill(1)}get style(){const t={width:null,height:null};if(this.width){t.width=this.width}if(this.height){t.height=this.height}return Object.assign({},t)}render(){return s(e,Object.assign({key:"9e026075a3ee04f09546bb686ec04309374da466",size:this.size,color:this.color,class:{[C.root]:true,circle:this.shape==="circle",line:this.shape==="line",progress:this.animation==="progress",pulse:this.animation==="pulse"}},this.inheritedAttributes,{"aria-busy":"true","aria-valuemin":"0","aria-valuemax":"100",role:"progressbar",tabindex:"0",style:this.style}))}get host(){return h(this)}static get watchers(){return{size:["validateSize"],shape:["validateShape"],animation:["validateAnimation"]}}};export{j as gov_form_input,z as gov_skeleton};
|
|
2
|
+
//# sourceMappingURL=p-4c5f6299.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Tags","GovFormInput","constructor","hostRef","this","h","govHost","host","inputId","createID","f","govForm","validateSize","newValue","validateProp","FormInputSizes","FormInputClass","root","watchControlAttrs","passControlAttrs","passAttrToControl","size","toBoolAttr","success","disabled","invalid","multiline","TEXTAREA","INPUT","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","govHydrated","emit","componentWillLoad","inheritedAttributes","inheritAriaAttributes","componentDidRender","passAttrToLabel","String","required","removeAttribute","Object","assign","disconnectedCallback","stopObserving","render","Tag","Host","key","class","type","hasSlot","name","icons","onClick","inputRef","focus","inputType","showPassword","id","identifier","onFocus","onFocusHandler","bind","onInput","onInputHandler","onBlur","onBlurHandler","onKeyUp","onKeyUpHandler","onKeyDown","onKeyDownHandler","ref","el","placeholder","spellcheck","toBoolAttrIfDefined","lang","inputLang","readonly","autocomplete","toOnOffAttrIfDefined","autocorrect","minlength","maxlength","min","max","rows","cols","role","value","color","accessibleHidePasswordLabel","accessibleShowPasswordLabel","slot","e","stopPropagation","focused","govFocus","component","originalEvent","govBlur","govKeyUp","govKeyDown","target","govInput","setFocus","options","setValue","clearValue","getRef","SkeletonSizes","pick","Sizes","Colors","SkeletonShapes","SkeletonAnimation","SkeletonClass","GovSkeleton","items","validateShape","validateAnimation","shape","animation","init","componentWillUpdate","fill","style","dimenssionsStyles","width","height","circle","line","progress","pulse","tabindex"],"sources":["../../../packages/core/src/components/gov-form/input/gov-form-input.tsx","../../../packages/core/src/components/gov-loading/skeleton/constants.ts","../../../packages/core/src/components/gov-loading/skeleton/gov-skeleton.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined, toOnOffAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormInputClass, FormInputSizes, FormInputSizesType, InputType, Type,} from \"./constants\"\nimport {FormInputEvent} from \"./gov-form-input.types\"\nimport {Nullable} from \"../../../types/interfaces\"\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\nenum Tags {\n\tINPUT = \"input\",\n\tTEXTAREA = \"textarea\",\n}\n\n@Component({\n\ttag: \"gov-form-input\",\n})\nexport class GovFormInput {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly inputId: string\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.inputId = createID(\"GovInput\")\n\t\tthis.f = govForm(this.h)\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: string\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({reflect:true}) readonly success: boolean\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: FormInputSizesType = \"m\"\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Generates a texarea for the possibility of multiple lines\n\t */\n\t@Prop() readonly multiline: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n\t */\n\t@Prop() readonly rows: number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-cols\n\t */\n\t@Prop() readonly cols: number\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({reflect:true}) readonly required: boolean = false\n\t/**\n\t * Makes the input component disabled.\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 * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Minimum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly min?: string | number\n\t/**\n\t * Maximum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly max?: string | number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocomplete\n\t */\n\t@Prop() readonly autocomplete: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocorrect\n\t */\n\t@Prop() readonly autocorrect: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck\n\t */\n\t@Prop() readonly spellcheck: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang\n\t */\n\t@Prop({attribute: \"input-lang\"}) readonly inputLang: string\n\t/**\n\t * Defined the visual style of input\n\t */\n\t@Prop() readonly type?: Type\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n\t */\n\t@Prop({attribute: \"input-type\"}) readonly inputType: InputType = \"text\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/input_role\n\t */\n\t@Prop() readonly role: Nullable<string>\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop({reflect:true}) readonly invalid: boolean\n\t/**\n\t * Accessible text for password display\n\t */\n\t@Prop({attribute: \"accessible-show-password-label\"}) readonly accessibleShowPasswordLabel = 'Zobrazit heslo'\n\t/**\n\t * Accessible text to hide the password\n\t */\n\t@Prop({attribute: \"accessible-hide-password-label\"}) readonly accessibleHidePasswordLabel = 'Skrýt heslo'\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: \"gov-input\"}) govInput: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: \"gov-keyup\"}) govKeyUp: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: \"gov-hydrated\"}) govHydrated: EventEmitter<void>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: \"gov-keydown\"}) govKeyDown: EventEmitter<FormInputEvent>\n\t@State() focused: boolean\n\t@State() showPassword: boolean = false\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormInputSizes, newValue, FormInputClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"success\")\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(\"success\", toBoolAttr(this.success))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", this.multiline ? Tags.TEXTAREA : Tags.INPUT)\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\tthis.govHydrated.emit();\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tcomponentDidRender() {\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver.stopObserving();\n\t}\n\n\trender() {\n\t\tconst Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT\n\n\t\treturn (\n\t\t\t<Host class={FormInputClass.root} size={this.size} type={this.type}>\n\t\t\t\t{this.h.hasSlot(\"prefix\") && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t{(this.h.hasSlot(\"icon-start\") && !this.multiline) &&\n\t\t\t\t\t\t<div class={FormInputClass.icons} onClick={() => this.inputRef.focus()}>\n\t\t\t\t\t\t\t<slot name=\"icon-start\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttype={this.inputType === 'password' && this.showPassword ? 'text' : this.inputType}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tid={this.identifier || this.inputId}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonInput={this.onInputHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\tonKeyUp={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\t\tonKeyDown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\tspellcheck={toBoolAttrIfDefined(this.spellcheck)}\n\t\t\t\t\t\tlang={this.inputLang}\n\t\t\t\t\t\treadonly={toBoolAttrIfDefined(this.readonly)}\n\t\t\t\t\t\tautocomplete={toOnOffAttrIfDefined(this.autocomplete)}\n\t\t\t\t\t\tautocorrect={toOnOffAttrIfDefined(this.autocorrect)}\n\t\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\t\tmin={this.min}\n\t\t\t\t\t\tmax={this.max}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\trows={this.rows}\n\t\t\t\t\t\tcols={this.cols}\n\t\t\t\t\t\trole={this.role}\n\t\t\t\t\t\tvalue={this.value}\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\t{((this.success || this.invalid || this.h.hasSlot(\"icon-end\") || this.inputType === 'password') && !this.multiline) &&\n\t\t\t\t\t\t<div class={FormInputClass.icons} onClick={() => this.inputRef.focus()}>\n\t\t\t\t\t\t\t{this.success && !this.multiline &&\n\t\t\t\t\t\t\t\t<gov-icon class=\"validation-icon\" name=\"check-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t\t\t{this.invalid && !this.multiline &&\n\t\t\t\t\t\t\t\t<gov-icon class=\"validation-icon\" name=\"exclamation-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t\t\t{this.h.hasSlot(\"icon-end\") && this.inputType !== 'password' && <slot name=\"icon-end\"/>}\n\t\t\t\t\t\t\t{this.inputType === 'password' ? (\n\t\t\t\t\t\t\t\t<gov-button color={'primary'}\n\t\t\t\t\t\t\t\t\t\t\ttype={'base'}\n\t\t\t\t\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\t\t\t\t\taria-label={this.showPassword ? this.accessibleHidePasswordLabel : this.accessibleShowPasswordLabel}\n\t\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.showPassword = !this.showPassword}>\n\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon-start\" name=\"eye\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t</gov-button>) : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot(\"sufix\") && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyUpHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyUp.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyDownHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyDown.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\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 * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Clears input value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = \"\"\n\t\tthis.inputRef.value = \"\"\n\t}\n\n\t/**\n\t * Returns an instance of the native html input element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n}\n","import { pick } from \"../../../utils/utils\"\nimport { ValueOf } from \"../../../types/interfaces\"\nimport {Sizes} from \"../../../core/constants/sizes\";\nimport {Colors} from \"../../../core/constants/colors\";\n\nexport const SkeletonSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type SkeletonSizesType = `${ValueOf<typeof SkeletonSizes>}`\n\nexport const SkeletonColors = pick(Colors, [\"PRIMARY\", \"NEUTRAL\"])\nexport type SkeletonColorType = `${ValueOf<typeof SkeletonColors>}`\n\nexport enum SkeletonShapes {\n\tCIRCLE = 'circle',\n\tLINE = 'line'\n}\nexport type SkeletonShapesType = `${ValueOf<typeof SkeletonShapes>}`\n\nexport enum SkeletonAnimation {\n\tPULSE = 'pulse',\n\tPROGRESS = 'progress',\n\tFALSE = 'false'\n}\nexport type SkeletonAnimationType = `${ValueOf<typeof SkeletonAnimation>}`\n\nexport const SkeletonClass = {\n\troot: 'gov-skeleton',\n}\n","import {Component, Element, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {\n\tSkeletonAnimation,\n\tSkeletonAnimationType,\n\tSkeletonClass,\n\tSkeletonColorType,\n\tSkeletonShapes,\n\tSkeletonShapesType,\n\tSkeletonSizes,\n} from \"./constants\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govHost} from \"../../../helpers/Dom/template\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {FormInputSizesType} from \"../../gov-form/input/constants\";\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-skeleton\",\n})\nexport class GovSkeleton {\n\th: GovHost\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovSkeletonElement\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: FormInputSizesType = \"m\"\n\t/**\n\t * Style variation of the skeleton.\n\t */\n\t@Prop() readonly color?: SkeletonColorType = \"neutral\"\n\t/**\n\t * Shape of the skeleton\n\t */\n\t@Prop() shape?: SkeletonShapesType = \"line\"\n\t/**\n\t * Width of the skeleton ex. 100px, 100%, auto etc.\n\t */\n\t@Prop() width: string = null\n\t/**\n\t * Height of the skeleton ex. 100px, 100%, auto etc.\n\t */\n\t@Prop() height: string = null\n\t/**\n\t * Animation type\n\t */\n\t@Prop() animation?: SkeletonAnimationType = \"progress\"\n\n\titems: number[] = []\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(SkeletonSizes, newValue, SkeletonClass.root)\n\t}\n\n\t@Watch('shape')\n\tvalidateShape(newValue: string): void {\n\t\tvalidateProp(SkeletonShapes, newValue, SkeletonClass.root)\n\t}\n\n\t@Watch('animation')\n\tvalidateAnimation(newValue: string): void {\n\t\tvalidateProp(SkeletonAnimation, newValue, SkeletonClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\t\tthis.validateShape(this.shape)\n\t\tthis.validateAnimation(this.animation)\n\t\tthis.init()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tcomponentWillUpdate() {\n\t\tthis.init()\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\tinit() {\n\t\tthis.items.fill(1)\n\t}\n\n\tget style() {\n\t\tconst dimenssionsStyles: {\n\t\t\twidth?: string,\n\t\t\theight?: string,\n\t\t} = {\n\t\t\twidth: null,\n\t\t\theight: null,\n\t\t}\n\t\tif (this.width) {\n\t\t\tdimenssionsStyles.width = this.width\n\t\t}\n\n\t\tif (this.height) {\n\t\t\tdimenssionsStyles.height = this.height\n\t\t}\n\n\t\treturn {...dimenssionsStyles}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host size={this.size}\n\t\t\t\t color={this.color}\n\t\t\t\t class={{\n\t\t\t\t\t [SkeletonClass.root]: true,\n\t\t\t\t\t circle: this.shape === \"circle\",\n\t\t\t\t\t line: this.shape === \"line\",\n\t\t\t\t\t progress: this.animation === \"progress\",\n\t\t\t\t\t pulse: this.animation === \"pulse\",\n\t\t\t\t }}\n\t\t\t\t {...this.inheritedAttributes}\n\t\t\t\t aria-busy=\"true\"\n\t\t\t\t aria-valuemin=\"0\"\n\t\t\t\t aria-valuemax=\"100\"\n\t\t\t\t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,KAAKmI,M,CAGjC,OAAAzF,OAAAC,OAAA,GAAWsF,E,CAGZ,MAAAnF,GACC,OACC7C,EAAC+C,EAAIN,OAAAC,OAAA,CAAAM,IAAA,2CAAChC,KAAMjB,KAAKiB,KACd2E,MAAO5F,KAAK4F,MACZ1C,MAAO,CACN,CAACoE,EAAczG,MAAO,KACtBuH,OAAQpI,KAAK2H,QAAU,SACvBU,KAAMrI,KAAK2H,QAAU,OACrBW,SAAUtI,KAAK4H,YAAc,WAC7BW,MAAOvI,KAAK4H,YAAc,UAEvB5H,KAAKmC,oBAAmB,aAClB,OAAM,gBACF,IAAG,gBACH,MACduD,KAAK,cACL8C,SAAS,IACTR,MAAOhI,KAAKgI,Q","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as s,h as t,a as e,g as i}from"./p-8506b611.js";import{g as a,b as o}from"./p-da1db6fd.js";import{g as d}from"./p-ea7fdd2e.js";import{s as r}from"./p-cd6c2938.js";import"./p-92f420cb.js";import"./p-e0e2e9c1.js";import"./p-7f3becc5.js";import"./p-5aad3497.js";import"./p-56efd4a2.js";import"./p-7ba4daf4.js";const c=class{constructor(t){s(this,t);this.identifier=undefined;this.invalid=false;this.disabled=false;this.success=false;this.fieldset=false;this.size="m";this.h=d(this.host);this.f=a(this.h)}componentDidRender(){this.syncControlMessages();this.formElementDescriptionControl()}disconnectedCallback(){var s;(s=this.observer)===null||s===void 0?void 0:s.disconnect()}formElementDescriptionControl(){const s=this.host.querySelector("."+o.bottom);if(!s)return;this.observer=new MutationObserver(function(){this.syncControlMessages()}.bind(this));this.observer.observe(s,{childList:true})}syncControlMessages(){Promise.all(this.f.messageElements.map((s=>s.identifier()))).then((s=>{this.f.mainElementsInControl.forEach((t=>{const e=r(t.getAttribute("aria-describedby"));t.removeAttribute("aria-describedby");if(Array.isArray(e)){e.forEach((t=>t.indexOf("GovFormMessage")===-1?s.push(t):null))}if(s.length){t.setAttribute("aria-describedby",s.join(" "))}}))}))}render(){const s=this.fieldset?"fieldset":"div";return t(e,{key:"5d1b7313e297a68d4349290d98190e7a0e3039b2",size:this.size,class:this.h.classes(o.root)},t(s,{key:"d4af40d1dcd012c374e0cd43a6d6777945b8e7d7",class:o.holder},this.h.hasSlot("top")&&t("slot",{key:"d46ee92af80770af49c075387f534b9d538a7e39",name:"top"}),t("slot",{key:"ce46e5d88ca4a1069436d702b27ad0c5051e63b5"}),this.h.hasSlot("bottom")&&t("div",{key:"b9da32bf3ad735b0c8bc187fb32528c710e3383c",class:o.bottom},t("slot",{key:"06f43763e2e0a88a2919e33d730898dd2048dcd0",name:"bottom"}))))}get host(){return i(this)}};export{c as gov_form_control};
|
|
2
|
+
//# sourceMappingURL=p-535316b4.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,h as a,a as c,g as o}from"./p-8506b611.js";import{g as s}from"./p-ea7fdd2e.js";const t={root:"gov-error-code",content:"gov-error-code__content"};const r=class{constructor(a){e(this,a);this.h=s(this.host)}render(){return a(c,{key:"90ebeeb8f2e7ed539e7069a876aa1fe3027873fc",class:this.h.classes(t.root),align:"center"},this.h.hasSlot("icon")&&a("slot",{key:"a31a15dd5276be32288c691d5bb7b8cf9d6615ab",name:"icon"}),a("div",{key:"0dfc7905d1e515a7ecc1eba1dd3912cd32774ca3",class:t.content},a("slot",{key:"238e3ab94cf05880567e2ac2c54c9f9c572ff014",name:"headline"}),a("slot",{key:"56519d70f3ab7b162e9e9a78bf7bfabef89a9b2d"})))}get host(){return o(this)}};export{r as gov_error_code};
|
|
2
|
+
//# sourceMappingURL=p-5396935e.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as s,h as i,a as e,g as a}from"./p-8506b611.js";import{F as o}from"./p-1c1d0bbe.js";import{v as n}from"./p-0b3574c2.js";import{S as h}from"./p-92f420cb.js";import{C as r}from"./p-5aad3497.js";import{p as c}from"./p-e0e2e9c1.js";import{g as l,p,t as d}from"./p-ea7fdd2e.js";import{c as g}from"./p-cd6c2938.js";import{c as m}from"./p-ded281e6.js";import{A as u,a as f}from"./p-9ac55bd1.js";import{i as v}from"./p-d9a299a4.js";import"./p-e8ec030e.js";import"./p-2aedc81e.js";const b=c(h,["_S","_M"]);const j=c(r,["PRIMARY","NEUTRAL"]);var _;(function(t){t["BUTTON"]="button";t["SELECT"]="select"})(_||(_={}));const y={root:"gov-pagination",list:"gov-pagination__list",item:"gov-pagination__item",itemArrow:"gov-pagination__item--arrow",itemMore:"gov-pagination__item--more",itemSelect:"gov-pagination__item--select",inner:"gov-pagination__inner",arrow:"gov-pagination__arrow"};function P(t,s=1,i=10,e=10){const a=Math.ceil(t/i);if(s<1){s=1}else if(s>a){s=a}let o,n;if(a<=e){o=1;n=a}else{const t=Math.floor(e/2);const i=Math.ceil(e/2)-1;if(s<=t){o=1;n=e}else if(s+i>=a){o=a-e+1;n=a}else{o=s-t;n=s+i}}const h=(s-1)*i;const r=Math.min(h+i-1,t-1);const c=Array.from(Array(n+1-o).keys()).map((t=>o+t));return{totalItems:t,currentPage:s,pageSize:i,totalPages:a,startPage:o,endPage:n,startIndex:h,endIndex:r,pages:c}}const S=class{constructor(i){t(this,i);this.govPage=s(this,"gov-page",7);this.type="button";this.current=1;this.total=0;this.selectIdentifier=undefined;this.size="m";this.color="primary";this.pageSize=10;this.maxPages=5;this.link=undefined;this.accessibleSelectLabel="Vybrat stranu";this.accessiblePageLabel="Strana";this.labelPrev="Přejít o stranu zpět";this.labelStart="Přejít na začátek";this.labelNext="Přejít na další stranu";this.labelEnd="Přejít na konec";this.pagination=undefined;this.inheritedAttributes={};this.h=l(this.host);this.pageSelectId=g("GovPageSelect");this.selectId=g("GovSelect")}validateType(t){n(_,t,y.root)}validateSize(t){n(b,t,y.root)}validateColor(t){n(j,t,y.root)}recalculate(){this.recalculatePagination(this.current)}componentDidLoad(){this.attributeObserver=new u(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(f)}componentWillLoad(){this.recalculatePagination(this.current);this.validateSize(this.size);this.validateColor(this.color);this.inheritedAttributes=v(this.host)}disconnectedCallback(){this.attributeObserver.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}recalculatePagination(t){this.pagination=P(this.total,t,this.pageSize,this.maxPages)}isActivePageClass(t,s){if(this.pagination.currentPage===s){return t+" is-active"}else{return t}}prepareLinkUrl(t){if(this.link){return String(this.link).replace("{PAGE}",String(t))}return undefined}resetSelectValue(){if(this.spreadSelectRef){this.spreadSelectRef.getRef().then((t=>{t.value="..."}))}}render(){const t=(t,s,e)=>{const a=t===-1;const o=d(this.pagination.currentPage===t?true:undefined);return i("gov-button",{href:this.prepareLinkUrl(t),color:this.color,size:this.size,type:"base",disabled:a,"on-gov-click":s=>this.onClickHandler(s,t),"aria-label":e?e:t>-1?`${this.accessiblePageLabel} ${t}`:undefined,"aria-current":o,class:y.inner,focusable:true},s)};return i(e,{class:this.h.classes(y.root),type:this.type,color:this.color,size:this.size},i("nav",Object.assign({},this.inheritedAttributes),i("ul",{class:y.list},i("li",{class:p([y.item,y.itemArrow])},t(this.pagination.currentPage>1?1:-1,i("gov-icon",{class:y.arrow,name:"chevron-double-left",type:"components"}),this.labelStart)),i("li",{class:p([y.item,y.itemArrow])},t(this.pagination.startPage<this.pagination.currentPage?this.pagination.currentPage-1:-1,i("gov-icon",{class:y.arrow,name:"chevron-left",type:"components"}),this.labelPrev)),this.type=="select"?i("li",{class:p([y.item,y.itemSelect])},i("span",{class:y.inner},i("span",{id:this.pageSelectId,hidden:true},this.accessibleSelectLabel),i("gov-form-select",{size:this.size,color:this.color,identifier:this.selectIdentifier||this.selectId,"aria-labelledby":this.pageSelectId,"on-gov-change":this.onSelectHandler.bind(this)},m(1,this.pagination.totalPages).map((t=>i("option",{value:t,selected:this.pagination.currentPage===t},t)))))):i(o,null,this.pagination.pages.map((s=>i("li",{class:this.isActivePageClass(y.item,s)},t(s,s,"")))),this.pagination.totalPages?i("li",{class:p([y.item,y.itemMore])},i("span",{class:y.inner},i("span",{id:this.pageSelectId,hidden:true},this.accessibleSelectLabel),i("gov-form-select",{size:this.size,color:this.color,identifier:this.selectIdentifier||this.selectId,"aria-labelledby":this.pageSelectId,ref:t=>this.spreadSelectRef=t,"on-gov-change":this.onSelectHandler.bind(this)},i("option",{selected:true,hidden:true},"..."),m(1,this.pagination.totalPages).map((t=>i("option",{value:t,selected:false},t)))))):null),i("li",{class:p([y.item,y.itemArrow])},t(this.pagination.totalPages>this.pagination.currentPage?this.pagination.currentPage+1:-1,i("gov-icon",{class:y.arrow,name:"chevron-right",type:"components"}),this.labelNext)),i("li",{class:p([y.item,y.itemArrow])},t(this.pagination.totalPages>this.pagination.currentPage?this.pagination.totalPages:-1,i("gov-icon",{class:y.arrow,name:"chevron-double-right",type:"components"}),this.labelEnd)))))}onClickHandler(t,s){t.stopPropagation();this.recalculatePagination(s);this.govPage.emit({component:y.root,pagination:this.pagination})}onSelectHandler(t){t.stopPropagation();const s=t.detail.value;const i=parseInt(s);this.resetSelectValue();if(isNaN(i)===false){this.recalculatePagination(i);if(this.link){window.location.href=this.prepareLinkUrl(i)}else{this.govPage.emit({component:y.root,pagination:this.pagination})}}}get host(){return a(this)}static get watchers(){return{type:["validateType"],size:["validateSize"],color:["validateColor"],current:["recalculate"],total:["recalculate"],pageSize:["recalculate"],maxPages:["recalculate"]}}};export{S as gov_pagination};
|
|
2
|
+
//# sourceMappingURL=p-561718cd.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PaginationSizes","pick","Sizes","PaginationColors","Colors","PaginationTypes","PaginationClass","root","list","item","itemArrow","itemMore","itemSelect","inner","arrow","paginate","totalItems","currentPage","pageSize","maxPages","totalPages","Math","ceil","startPage","endPage","maxPagesBeforeCurrentPage","floor","maxPagesAfterCurrentPage","startIndex","endIndex","min","pages","Array","from","keys","map","i","GovPagination","constructor","hostRef","this","h","govHost","host","pageSelectId","createID","selectId","validateType","newValue","validateProp","validateSize","validateColor","recalculate","recalculatePagination","current","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","size","color","inheritedAttributes","inheritAriaAttributes","disconnectedCallback","stopObserving","removeAttribute","Object","assign","pagination","total","isActivePageClass","originalClass","page","prepareLinkUrl","link","String","replace","undefined","resetSelectValue","spreadSelectRef","getRef","then","el","value","render","pageResolver","content","description","isDisabled","ariaCurrent","toBoolAttrIfDefined","href","type","disabled","e","onClickHandler","accessiblePageLabel","class","focusable","Host","classes","prepareClasses","name","labelStart","labelPrev","id","hidden","accessibleSelectLabel","identifier","selectIdentifier","onSelectHandler","bind","createArrayRange","selected","Fragment","ref","labelNext","labelEnd","stopPropagation","govPage","emit","component","detail","parseInt","isNaN","window","location"],"sources":["../../../packages/core/src/components/gov-pagination/constants.ts","../../../packages/core/src/components/gov-pagination/pagination.ts","../../../packages/core/src/components/gov-pagination/gov-pagination.tsx"],"sourcesContent":["import { Sizes } from '../../core/constants/sizes'\nimport { Colors } from '../../core/constants/colors'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const PaginationSizes = pick(Sizes, ['_S', '_M'])\nexport type PaginationSizeType = `${ValueOf<typeof PaginationSizes>}`\n\nexport const PaginationColors = pick(Colors, ['PRIMARY', 'NEUTRAL'])\nexport type PaginationColorType = `${ValueOf<typeof PaginationColors>}`\n\nexport enum PaginationTypes {\n\tBUTTON = 'button',\n\tSELECT = 'select',\n}\nexport type PaginationType = `${ValueOf<typeof PaginationTypes>}`\n\nexport const PaginationClass = {\n\troot: 'gov-pagination',\n\tlist: 'gov-pagination__list',\n\titem: 'gov-pagination__item',\n\titemArrow: 'gov-pagination__item--arrow',\n\titemMore: 'gov-pagination__item--more',\n\titemSelect: 'gov-pagination__item--select',\n\tinner: 'gov-pagination__inner',\n\tarrow: 'gov-pagination__arrow',\n}\n","export interface Pagination {\n\ttotalItems: number\n\tcurrentPage: number\n\tpageSize: number\n\ttotalPages: number\n\tstartPage: number\n\tendPage: number\n\tstartIndex: number\n\tendIndex: number\n\tpages: number[]\n}\n\nexport function paginate(totalItems: number, currentPage = 1, pageSize = 10, maxPages = 10): Pagination {\n\t// calculate total pages\n\tconst totalPages = Math.ceil(totalItems / pageSize)\n\n\t// ensure current page isn't out of range\n\tif (currentPage < 1) {\n\t\tcurrentPage = 1\n\t} else if (currentPage > totalPages) {\n\t\tcurrentPage = totalPages\n\t}\n\n\tlet startPage: number, endPage: number\n\tif (totalPages <= maxPages) {\n\t\t// total pages less than max so show all pages\n\t\tstartPage = 1\n\t\tendPage = totalPages\n\t} else {\n\t\t// total pages more than max so calculate start and end pages\n\t\tconst maxPagesBeforeCurrentPage = Math.floor(maxPages / 2)\n\t\tconst maxPagesAfterCurrentPage = Math.ceil(maxPages / 2) - 1\n\t\tif (currentPage <= maxPagesBeforeCurrentPage) {\n\t\t\t// current page near the start\n\t\t\tstartPage = 1\n\t\t\tendPage = maxPages\n\t\t} else if (currentPage + maxPagesAfterCurrentPage >= totalPages) {\n\t\t\t// current page near the end\n\t\t\tstartPage = totalPages - maxPages + 1\n\t\t\tendPage = totalPages\n\t\t} else {\n\t\t\t// current page somewhere in the middle\n\t\t\tstartPage = currentPage - maxPagesBeforeCurrentPage\n\t\t\tendPage = currentPage + maxPagesAfterCurrentPage\n\t\t}\n\t}\n\n\t// calculate start and end item indexes\n\tconst startIndex = (currentPage - 1) * pageSize\n\tconst endIndex = Math.min(startIndex + pageSize - 1, totalItems - 1)\n\n\t// create an array of pages to ng-repeat in the pager control\n\tconst pages = Array.from(Array(endPage + 1 - startPage).keys()).map(i => startPage + i)\n\n\t// return object with all pager properties required by the view\n\treturn {\n\t\ttotalItems: totalItems,\n\t\tcurrentPage: currentPage,\n\t\tpageSize: pageSize,\n\t\ttotalPages: totalPages,\n\t\tstartPage: startPage,\n\t\tendPage: endPage,\n\t\tstartIndex: startIndex,\n\t\tendIndex: endIndex,\n\t\tpages: pages,\n\t}\n}\n","import Fragment from \"../../helpers/Fragment\"\nimport {Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tPaginationClass,\n\tPaginationColors,\n\tPaginationColorType,\n\tPaginationSizes,\n\tPaginationSizeType,\n\tPaginationType,\n\tPaginationTypes,\n} from \"./constants\"\nimport {govHost, prepareClasses, toBoolAttrIfDefined} from \"../../helpers/Dom/template\"\nimport {paginate, Pagination} from \"./pagination\"\nimport {createID} from \"../../utils/string.utils\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {createArrayRange} from \"../../utils/array.utils\"\nimport {FormSelectEvent} from \"../gov-form/select/gov-form-select.types\"\nimport {PaginationEvent} from \"./gov-pagination.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-pagination\",\n})\nexport class GovPagination {\n\tprivate h: GovHost\n\tprivate readonly pageSelectId: string\n\tprivate readonly selectId: string\n\n\tprivate spreadSelectRef?: HTMLGovFormSelectElement\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.pageSelectId = createID(\"GovPageSelect\")\n\t\tthis.selectId = createID(\"GovSelect\")\n\t}\n\n\t@Element() readonly host: HTMLGovPaginationElement\n\t/**\n\t * Pagination type\n\t */\n\t@Prop() readonly type: PaginationType = \"button\"\n\t/**\n\t * Currently displayed page\n\t */\n\t@Prop() readonly current: number = 1\n\t/**\n\t * Total count of entries\n\t */\n\t@Prop() readonly total: number = 0\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'select-identifier'}) readonly selectIdentifier: string\n\t/**\n\t * Pagination's size\n\t */\n\t@Prop() readonly size?: PaginationSizeType = \"m\"\n\t/**\n\t * Style variation of the pagination.\n\t */\n\t@Prop() readonly color?: PaginationColorType = \"primary\"\n\t/**\n\t * Maximum number of entries per page\n\t */\n\t@Prop({attribute: \"page-size\"}) readonly pageSize: number = 10\n\t/**\n\t * Maximum pages displayed for selection\n\t */\n\t@Prop({attribute: \"max-pages\"}) readonly maxPages: number = 5\n\t/**\n\t * Setting a link to redirect to a given page.\n\t * The {PAGE} wildcard can be used in the link to replace the page number.\n\t * Note that in the case of paging through a link, it is always necessary to send to the component the current page where the user is.\n\t */\n\t@Prop() readonly link: string\n\t/**\n\t * Adds accessible label for the page select\n\t */\n\t@Prop({attribute: \"accessible-select-label\"}) readonly accessibleSelectLabel: string = \"Vybrat stranu\"\n\t/**\n\t * Adds accessible label for the page item\n\t */\n\t@Prop({attribute: \"accessible-page-label\"}) readonly accessiblePageLabel: string = \"Strana\"\n\t/**\n\t * Description of the possibility to go back one page\n\t */\n\t@Prop({attribute: \"label-prev\"}) readonly labelPrev = 'Přejít o stranu zpět'\n\t/**\n\t * Description of the option to go to the top of paging\n\t */\n\t@Prop({attribute: \"label-start\"}) readonly labelStart = 'Přejít na začátek'\n\t/**\n\t * Description of the option to go to the end of paging\n\t */\n\t@Prop({attribute: \"label-next\"}) readonly labelNext = 'Přejít na další stranu'\n\t/**\n\t * Description of the option to move one page forward\n\t */\n\t@Prop({attribute: \"label-end\"}) readonly labelEnd = 'Přejít na konec'\n\t/**\n\t * Event called when changing the page with the current setting of the whole paging\n\t */\n\t@Event({eventName: \"gov-page\"}) govPage: EventEmitter<PaginationEvent>\n\n\t@State() pagination: Pagination\n\t@State() inheritedAttributes: Attributes = {}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(PaginationTypes, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(PaginationSizes, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(PaginationColors, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"current\")\n\t@Watch(\"total\")\n\t@Watch(\"pageSize\")\n\t@Watch(\"maxPages\")\n\trecalculate(): void {\n\t\tthis.recalculatePagination(this.current)\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.recalculatePagination(this.current)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateColor(this.color)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate recalculatePagination(currentPage: number) {\n\t\tthis.pagination = paginate(this.total, currentPage, this.pageSize, this.maxPages)\n\t}\n\n\tprivate isActivePageClass(originalClass: string, page: number) {\n\t\tif (this.pagination.currentPage === page) {\n\t\t\treturn originalClass + \" is-active\"\n\t\t} else {\n\t\t\treturn originalClass\n\t\t}\n\t}\n\n\tprivate prepareLinkUrl(page: number) {\n\t\tif (this.link) {\n\t\t\treturn String(this.link).replace(\"{PAGE}\", String(page))\n\t\t}\n\t\treturn undefined\n\t}\n\n\tprivate resetSelectValue() {\n\t\tif (this.spreadSelectRef) {\n\t\t\tthis.spreadSelectRef.getRef()\n\t\t\t\t.then((el: HTMLSelectElement) => {\n\t\t\t\t\tel.value = '...'\n\t\t\t\t})\n\t\t}\n\t}\n\n\trender() {\n\t\tconst pageResolver = (page: number, content: any, description: string) => {\n\t\t\tconst isDisabled = page === -1\n\t\t\tconst ariaCurrent = toBoolAttrIfDefined(this.pagination.currentPage === page ? true : undefined)\n\t\t\treturn (\n\t\t\t\t<gov-button\n\t\t\t\t\thref={this.prepareLinkUrl(page)}\n\t\t\t\t\tcolor={this.color}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\ttype=\"base\"\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ton-gov-click={(e) => this.onClickHandler(e, page)}\n\t\t\t\t\twcag-label={description ? description : page > -1 ? this.accessiblePageLabel + \" \" + page : undefined}\n\t\t\t\t\twcag-current={ariaCurrent}\n\t\t\t\t\tclass={PaginationClass.inner}\n\t\t\t\t\tfocusable={true}>\n\t\t\t\t\t{content}\n\t\t\t\t</gov-button>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(PaginationClass.root)} type={this.type} color={this.color} size={this.size}>\n\t\t\t\t<nav {...this.inheritedAttributes}>\n\t\t\t\t\t<ul class={PaginationClass.list}>\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.currentPage > 1 ? 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-double-left\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelStart\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-left\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelPrev\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t{this.type == \"select\" ? (\n\t\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemSelect])}>\n\t\t\t\t\t\t\t\t<span class={PaginationClass.inner}>\n\t\t\t\t\t\t\t\t\t<span id={this.pageSelectId} hidden>\n\t\t\t\t\t\t\t\t\t\t{this.accessibleSelectLabel}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<gov-form-select\n\t\t\t\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\t\t\t\t\tidentifier={this.selectIdentifier || this.selectId}\n\t\t\t\t\t\t\t\t\t\taria-labelledby={this.pageSelectId}\n\t\t\t\t\t\t\t\t\t\ton-gov-change={this.onSelectHandler.bind(this)}>\n\t\t\t\t\t\t\t\t\t\t{createArrayRange(1, this.pagination.totalPages).map(page => (\n\t\t\t\t\t\t\t\t\t\t\t<option value={page} selected={this.pagination.currentPage === page}>\n\t\t\t\t\t\t\t\t\t\t\t\t{page}\n\t\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</gov-form-select>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t{this.pagination.pages.map(page => (\n\t\t\t\t\t\t\t\t\t<li class={this.isActivePageClass(PaginationClass.item, page)}>{pageResolver(page, page, '')}</li>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t{this.pagination.totalPages ? (\n\t\t\t\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemMore])}>\n\t\t\t\t\t\t\t\t\t<span class={PaginationClass.inner}>\n\t\t\t\t\t\t\t\t\t\t<span id={this.pageSelectId} hidden>\n\t\t\t\t\t\t\t\t\t\t\t{this.accessibleSelectLabel}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t<gov-form-select\n\t\t\t\t\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\t\t\t\t\t\tidentifier={this.selectIdentifier || this.selectId}\n\t\t\t\t\t\t\t\t\t\t\taria-labelledby={this.pageSelectId}\n\t\t\t\t\t\t\t\t\t\t\tref={el => (this.spreadSelectRef = el as HTMLGovFormSelectElement)}\n\t\t\t\t\t\t\t\t\t\t\ton-gov-change={this.onSelectHandler.bind(this)}>\n\t\t\t\t\t\t\t\t\t\t\t<option selected hidden>...</option>\n\t\t\t\t\t\t\t\t\t\t\t{createArrayRange(1, this.pagination.totalPages).map(page => (\n\t\t\t\t\t\t\t\t\t\t\t\t<option value={page} selected={false}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{page}\n\t\t\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-select>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-right\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelNext\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-double-right\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelEnd\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</nav>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: CustomEvent, page: number): void {\n\t\te.stopPropagation()\n\t\tthis.recalculatePagination(page)\n\t\tthis.govPage.emit({\n\t\t\tcomponent: PaginationClass.root,\n\t\t\tpagination: this.pagination\n\t\t})\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormSelectEvent>): void {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.value\n\t\tconst page = parseInt(value)\n\t\tthis.resetSelectValue()\n\t\tif (isNaN(page) === false) {\n\t\t\tthis.recalculatePagination(page)\n\t\t\tif (this.link) {\n\t\t\t\twindow.location.href = this.prepareLinkUrl(page)\n\t\t\t} else {\n\t\t\t\tthis.govPage.emit({\n\t\t\t\t\tcomponent: PaginationClass.root,\n\t\t\t\t\tpagination: this.pagination\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":"ggBAKO,MAAMA,EAAkBC,EAAKC,EAAO,CAAC,KAAM,OAG3C,MAAMC,EAAmBF,EAAKG,EAAQ,CAAC,UAAW,YAGzD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,mBACAA,EAAA,kBACA,EAHD,CAAYA,MAAe,KAMpB,MAAMC,EAAkB,CAC9BC,KAAM,iBACNC,KAAM,uBACNC,KAAM,uBACNC,UAAW,8BACXC,SAAU,6BACVC,WAAY,+BACZC,MAAO,wBACPC,MAAO,yB,SCbQC,EAASC,EAAoBC,EAAc,EAAGC,EAAW,GAAIC,EAAW,IAEvF,MAAMC,EAAaC,KAAKC,KAAKN,EAAaE,GAG1C,GAAID,EAAc,EAAG,CACpBA,EAAc,C,MACR,GAAIA,EAAcG,EAAY,CACpCH,EAAcG,C,CAGf,IAAIG,EAAmBC,EACvB,GAAIJ,GAAcD,EAAU,CAE3BI,EAAY,EACZ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EACzFqB,EAAA,YAAU4D,MAAO/F,EAAgBQ,MAAO4F,KAAK,yBAC7ClE,KAAKiF,a,CASJ,cAAAtB,CAAeD,EAAgBtB,GACtCsB,EAAEwB,kBACFlF,KAAKa,sBAAsBuB,GAC3BpC,KAAKmF,QAAQC,KAAK,CACjBC,UAAWvH,EAAgBC,KAC3BiE,WAAYhC,KAAKgC,Y,CAIX,eAAA0C,CAAgBhB,GACvBA,EAAEwB,kBACF,MAAMnC,EAAQW,EAAE4B,OAAOvC,MACvB,MAAMX,EAAOmD,SAASxC,GACtB/C,KAAK0C,mBACL,GAAI8C,MAAMpD,KAAU,MAAO,CAC1BpC,KAAKa,sBAAsBuB,GAC3B,GAAIpC,KAAKsC,KAAM,CACdmD,OAAOC,SAASnC,KAAOvD,KAAKqC,eAAeD,E,KACrC,CACNpC,KAAKmF,QAAQC,KAAK,CACjBC,UAAWvH,EAAgBC,KAC3BiE,WAAYhC,KAAKgC,Y","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["PaginationSizes","pick","Sizes","PaginationColors","Colors","PaginationTypes","PaginationClass","root","list","item","itemArrow","itemMore","itemSelect","inner","arrow","paginate","totalItems","currentPage","pageSize","maxPages","totalPages","Math","ceil","startPage","endPage","maxPagesBeforeCurrentPage","floor","maxPagesAfterCurrentPage","startIndex","endIndex","min","pages","Array","from","keys","map","i","GovPagination","constructor","hostRef","this","h","govHost","host","pageSelectId","createID","selectId","validateType","newValue","validateProp","validateSize","validateColor","recalculate","recalculatePagination","current","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","size","color","inheritedAttributes","inheritAriaAttributes","disconnectedCallback","stopObserving","removeAttribute","Object","assign","pagination","total","isActivePageClass","originalClass","page","prepareLinkUrl","link","String","replace","undefined","resetSelectValue","spreadSelectRef","getRef","then","el","value","render","pageResolver","content","description","isDisabled","ariaCurrent","toBoolAttrIfDefined","href","type","disabled","e","onClickHandler","accessiblePageLabel","class","focusable","Host","classes","prepareClasses","name","labelStart","labelPrev","id","hidden","accessibleSelectLabel","identifier","selectIdentifier","onSelectHandler","bind","createArrayRange","selected","Fragment","ref","labelNext","labelEnd","stopPropagation","govPage","emit","component","detail","parseInt","isNaN","window","location"],"sources":["../../../packages/core/src/components/gov-pagination/constants.ts","../../../packages/core/src/components/gov-pagination/pagination.ts","../../../packages/core/src/components/gov-pagination/gov-pagination.tsx"],"sourcesContent":["import { Sizes } from '../../core/constants/sizes'\nimport { Colors } from '../../core/constants/colors'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const PaginationSizes = pick(Sizes, ['_S', '_M'])\nexport type PaginationSizeType = `${ValueOf<typeof PaginationSizes>}`\n\nexport const PaginationColors = pick(Colors, ['PRIMARY', 'NEUTRAL'])\nexport type PaginationColorType = `${ValueOf<typeof PaginationColors>}`\n\nexport enum PaginationTypes {\n\tBUTTON = 'button',\n\tSELECT = 'select',\n}\nexport type PaginationType = `${ValueOf<typeof PaginationTypes>}`\n\nexport const PaginationClass = {\n\troot: 'gov-pagination',\n\tlist: 'gov-pagination__list',\n\titem: 'gov-pagination__item',\n\titemArrow: 'gov-pagination__item--arrow',\n\titemMore: 'gov-pagination__item--more',\n\titemSelect: 'gov-pagination__item--select',\n\tinner: 'gov-pagination__inner',\n\tarrow: 'gov-pagination__arrow',\n}\n","export interface Pagination {\n\ttotalItems: number\n\tcurrentPage: number\n\tpageSize: number\n\ttotalPages: number\n\tstartPage: number\n\tendPage: number\n\tstartIndex: number\n\tendIndex: number\n\tpages: number[]\n}\n\nexport function paginate(totalItems: number, currentPage = 1, pageSize = 10, maxPages = 10): Pagination {\n\t// calculate total pages\n\tconst totalPages = Math.ceil(totalItems / pageSize)\n\n\t// ensure current page isn't out of range\n\tif (currentPage < 1) {\n\t\tcurrentPage = 1\n\t} else if (currentPage > totalPages) {\n\t\tcurrentPage = totalPages\n\t}\n\n\tlet startPage: number, endPage: number\n\tif (totalPages <= maxPages) {\n\t\t// total pages less than max so show all pages\n\t\tstartPage = 1\n\t\tendPage = totalPages\n\t} else {\n\t\t// total pages more than max so calculate start and end pages\n\t\tconst maxPagesBeforeCurrentPage = Math.floor(maxPages / 2)\n\t\tconst maxPagesAfterCurrentPage = Math.ceil(maxPages / 2) - 1\n\t\tif (currentPage <= maxPagesBeforeCurrentPage) {\n\t\t\t// current page near the start\n\t\t\tstartPage = 1\n\t\t\tendPage = maxPages\n\t\t} else if (currentPage + maxPagesAfterCurrentPage >= totalPages) {\n\t\t\t// current page near the end\n\t\t\tstartPage = totalPages - maxPages + 1\n\t\t\tendPage = totalPages\n\t\t} else {\n\t\t\t// current page somewhere in the middle\n\t\t\tstartPage = currentPage - maxPagesBeforeCurrentPage\n\t\t\tendPage = currentPage + maxPagesAfterCurrentPage\n\t\t}\n\t}\n\n\t// calculate start and end item indexes\n\tconst startIndex = (currentPage - 1) * pageSize\n\tconst endIndex = Math.min(startIndex + pageSize - 1, totalItems - 1)\n\n\t// create an array of pages to ng-repeat in the pager control\n\tconst pages = Array.from(Array(endPage + 1 - startPage).keys()).map(i => startPage + i)\n\n\t// return object with all pager properties required by the view\n\treturn {\n\t\ttotalItems: totalItems,\n\t\tcurrentPage: currentPage,\n\t\tpageSize: pageSize,\n\t\ttotalPages: totalPages,\n\t\tstartPage: startPage,\n\t\tendPage: endPage,\n\t\tstartIndex: startIndex,\n\t\tendIndex: endIndex,\n\t\tpages: pages,\n\t}\n}\n","import Fragment from \"../../helpers/Fragment\"\nimport {Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tPaginationClass,\n\tPaginationColors,\n\tPaginationColorType,\n\tPaginationSizes,\n\tPaginationSizeType,\n\tPaginationType,\n\tPaginationTypes,\n} from \"./constants\"\nimport {govHost, prepareClasses, toBoolAttrIfDefined} from \"../../helpers/Dom/template\"\nimport {paginate, Pagination} from \"./pagination\"\nimport {createID} from \"../../utils/string.utils\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {createArrayRange} from \"../../utils/array.utils\"\nimport {FormSelectEvent} from \"../gov-form/select/gov-form-select.types\"\nimport {PaginationEvent} from \"./gov-pagination.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-pagination\",\n})\nexport class GovPagination {\n\tprivate h: GovHost\n\tprivate readonly pageSelectId: string\n\tprivate readonly selectId: string\n\n\tprivate spreadSelectRef?: HTMLGovFormSelectElement\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.pageSelectId = createID(\"GovPageSelect\")\n\t\tthis.selectId = createID(\"GovSelect\")\n\t}\n\n\t@Element() readonly host: HTMLGovPaginationElement\n\t/**\n\t * Pagination type\n\t */\n\t@Prop() readonly type: PaginationType = \"button\"\n\t/**\n\t * Currently displayed page\n\t */\n\t@Prop() readonly current: number = 1\n\t/**\n\t * Total count of entries\n\t */\n\t@Prop() readonly total: number = 0\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'select-identifier'}) readonly selectIdentifier: string\n\t/**\n\t * Pagination's size\n\t */\n\t@Prop() readonly size?: PaginationSizeType = \"m\"\n\t/**\n\t * Style variation of the pagination.\n\t */\n\t@Prop() readonly color?: PaginationColorType = \"primary\"\n\t/**\n\t * Maximum number of entries per page\n\t */\n\t@Prop({attribute: \"page-size\"}) readonly pageSize: number = 10\n\t/**\n\t * Maximum pages displayed for selection\n\t */\n\t@Prop({attribute: \"max-pages\"}) readonly maxPages: number = 5\n\t/**\n\t * Setting a link to redirect to a given page.\n\t * The {PAGE} wildcard can be used in the link to replace the page number.\n\t * Note that in the case of paging through a link, it is always necessary to send to the component the current page where the user is.\n\t */\n\t@Prop() readonly link: string\n\t/**\n\t * Adds accessible label for the page select\n\t */\n\t@Prop({attribute: \"accessible-select-label\"}) readonly accessibleSelectLabel: string = \"Vybrat stranu\"\n\t/**\n\t * Adds accessible label for the page item\n\t */\n\t@Prop({attribute: \"accessible-page-label\"}) readonly accessiblePageLabel: string = \"Strana\"\n\t/**\n\t * Description of the possibility to go back one page\n\t */\n\t@Prop({attribute: \"label-prev\"}) readonly labelPrev = 'Přejít o stranu zpět'\n\t/**\n\t * Description of the option to go to the top of paging\n\t */\n\t@Prop({attribute: \"label-start\"}) readonly labelStart = 'Přejít na začátek'\n\t/**\n\t * Description of the option to go to the end of paging\n\t */\n\t@Prop({attribute: \"label-next\"}) readonly labelNext = 'Přejít na další stranu'\n\t/**\n\t * Description of the option to move one page forward\n\t */\n\t@Prop({attribute: \"label-end\"}) readonly labelEnd = 'Přejít na konec'\n\t/**\n\t * Event called when changing the page with the current setting of the whole paging\n\t */\n\t@Event({eventName: \"gov-page\"}) govPage: EventEmitter<PaginationEvent>\n\n\t@State() pagination: Pagination\n\t@State() inheritedAttributes: Attributes = {}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(PaginationTypes, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(PaginationSizes, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(PaginationColors, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"current\")\n\t@Watch(\"total\")\n\t@Watch(\"pageSize\")\n\t@Watch(\"maxPages\")\n\trecalculate(): void {\n\t\tthis.recalculatePagination(this.current)\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.recalculatePagination(this.current)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateColor(this.color)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate recalculatePagination(currentPage: number) {\n\t\tthis.pagination = paginate(this.total, currentPage, this.pageSize, this.maxPages)\n\t}\n\n\tprivate isActivePageClass(originalClass: string, page: number) {\n\t\tif (this.pagination.currentPage === page) {\n\t\t\treturn originalClass + \" is-active\"\n\t\t} else {\n\t\t\treturn originalClass\n\t\t}\n\t}\n\n\tprivate prepareLinkUrl(page: number) {\n\t\tif (this.link) {\n\t\t\treturn String(this.link).replace(\"{PAGE}\", String(page))\n\t\t}\n\t\treturn undefined\n\t}\n\n\tprivate resetSelectValue() {\n\t\tif (this.spreadSelectRef) {\n\t\t\tthis.spreadSelectRef.getRef()\n\t\t\t\t.then((el: HTMLSelectElement) => {\n\t\t\t\t\tel.value = '...'\n\t\t\t\t})\n\t\t}\n\t}\n\n\trender() {\n\t\tconst pageResolver = (page: number, content: any, description: string) => {\n\t\t\tconst isDisabled = page === -1\n\t\t\tconst ariaCurrent = toBoolAttrIfDefined(this.pagination.currentPage === page ? true : undefined)\n\t\t\treturn (\n\t\t\t\t<gov-button\n\t\t\t\t\thref={this.prepareLinkUrl(page)}\n\t\t\t\t\tcolor={this.color}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\ttype=\"base\"\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ton-gov-click={(e) => this.onClickHandler(e, page)}\n\t\t\t\t\taria-label={description ? description : page > -1 ? `${this.accessiblePageLabel} ${page}` : undefined}\n\t\t\t\t\taria-current={ariaCurrent}\n\t\t\t\t\tclass={PaginationClass.inner}\n\t\t\t\t\tfocusable={true}>\n\t\t\t\t\t{content}\n\t\t\t\t</gov-button>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(PaginationClass.root)} type={this.type} color={this.color} size={this.size}>\n\t\t\t\t<nav {...this.inheritedAttributes}>\n\t\t\t\t\t<ul class={PaginationClass.list}>\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.currentPage > 1 ? 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-double-left\" type=\"components\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelStart\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-left\" type=\"components\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelPrev\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t{this.type == \"select\" ? (\n\t\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemSelect])}>\n\t\t\t\t\t\t\t\t<span class={PaginationClass.inner}>\n\t\t\t\t\t\t\t\t\t<span id={this.pageSelectId} hidden>\n\t\t\t\t\t\t\t\t\t\t{this.accessibleSelectLabel}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<gov-form-select\n\t\t\t\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\t\t\t\t\tidentifier={this.selectIdentifier || this.selectId}\n\t\t\t\t\t\t\t\t\t\taria-labelledby={this.pageSelectId}\n\t\t\t\t\t\t\t\t\t\ton-gov-change={this.onSelectHandler.bind(this)}>\n\t\t\t\t\t\t\t\t\t\t{createArrayRange(1, this.pagination.totalPages).map(page => (\n\t\t\t\t\t\t\t\t\t\t\t<option value={page} selected={this.pagination.currentPage === page}>\n\t\t\t\t\t\t\t\t\t\t\t\t{page}\n\t\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</gov-form-select>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t{this.pagination.pages.map(page => (\n\t\t\t\t\t\t\t\t\t<li class={this.isActivePageClass(PaginationClass.item, page)}>{pageResolver(page, page, '')}</li>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t{this.pagination.totalPages ? (\n\t\t\t\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemMore])}>\n\t\t\t\t\t\t\t\t\t<span class={PaginationClass.inner}>\n\t\t\t\t\t\t\t\t\t\t<span id={this.pageSelectId} hidden>\n\t\t\t\t\t\t\t\t\t\t\t{this.accessibleSelectLabel}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t<gov-form-select\n\t\t\t\t\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\t\t\t\t\t\tidentifier={this.selectIdentifier || this.selectId}\n\t\t\t\t\t\t\t\t\t\t\taria-labelledby={this.pageSelectId}\n\t\t\t\t\t\t\t\t\t\t\tref={el => (this.spreadSelectRef = el as HTMLGovFormSelectElement)}\n\t\t\t\t\t\t\t\t\t\t\ton-gov-change={this.onSelectHandler.bind(this)}>\n\t\t\t\t\t\t\t\t\t\t\t<option selected hidden>...</option>\n\t\t\t\t\t\t\t\t\t\t\t{createArrayRange(1, this.pagination.totalPages).map(page => (\n\t\t\t\t\t\t\t\t\t\t\t\t<option value={page} selected={false}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{page}\n\t\t\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-select>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-right\" type=\"components\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelNext\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-double-right\" type=\"components\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelEnd\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</nav>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: CustomEvent, page: number): void {\n\t\te.stopPropagation()\n\t\tthis.recalculatePagination(page)\n\t\tthis.govPage.emit({\n\t\t\tcomponent: PaginationClass.root,\n\t\t\tpagination: this.pagination\n\t\t})\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormSelectEvent>): void {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.value\n\t\tconst page = parseInt(value)\n\t\tthis.resetSelectValue()\n\t\tif (isNaN(page) === false) {\n\t\t\tthis.recalculatePagination(page)\n\t\t\tif (this.link) {\n\t\t\t\twindow.location.href = this.prepareLinkUrl(page)\n\t\t\t} else {\n\t\t\t\tthis.govPage.emit({\n\t\t\t\t\tcomponent: PaginationClass.root,\n\t\t\t\t\tpagination: this.pagination\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":"weAKO,MAAMA,EAAkBC,EAAKC,EAAO,CAAC,KAAM,OAG3C,MAAMC,EAAmBF,EAAKG,EAAQ,CAAC,UAAW,YAGzD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,mBACAA,EAAA,kBACA,EAHD,CAAYA,MAAe,KAMpB,MAAMC,EAAkB,CAC9BC,KAAM,iBACNC,KAAM,uBACNC,KAAM,uBACNC,UAAW,8BACXC,SAAU,6BACVC,WAAY,+BACZC,MAAO,wBACPC,MAAO,yB,SCbQC,EAASC,EAAoBC,EAAc,EAAGC,EAAW,GAAIC,EAAW,IAEvF,MAAMC,EAAaC,KAAKC,KAAKN,EAAaE,GAG1C,GAAID,EAAc,EAAG,CACpBA,EAAc,C,MACR,GAAIA,EAAcG,EAAY,CACpCH,EAAcG,C,CAGf,IAAIG,EAAmBC,EACvB,GAAIJ,GAAcD,EAAU,CAE3BI,EAAY,EACZC,EAAUJ,C,KACJ,CAEN,MAAMK,EAA4BJ,KAAKK,MAAMP,EAAW,GACxD,MAAMQ,EAA2BN,KAAKC,KAAKH,EAAW,GAAK,EAC3D,GAAIF,GAAeQ,EAA2B,CAE7CF,EAAY,EACZC,EAAUL,C,MACJ,GAAIF,EAAcU,GAA4BP,EAAY,CAEhEG,EAAYH,EAAaD,EAAW,EACpCK,EAAUJ,C,KACJ,CAENG,EAAYN,EAAcQ,EAC1BD,EAAUP,EAAcU,C,EAK1B,MAAMC,GAAcX,EAAc,GAAKC,EAC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AAE4B,OAAOvC,MACvB,MAAMX,EAAOmD,SAASxC,GACtB/C,KAAK0C,mBACL,GAAI8C,MAAMpD,KAAU,MAAO,CAC1BpC,KAAKa,sBAAsBuB,GAC3B,GAAIpC,KAAKsC,KAAM,CACdmD,OAAOC,SAASnC,KAAOvD,KAAKqC,eAAeD,E,KACrC,CACNpC,KAAKmF,QAAQC,KAAK,CACjBC,UAAWvH,EAAgBC,KAC3BiE,WAAYhC,KAAKgC,Y","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,h as t,a,g as s,c as i}from"./p-8506b611.js";import{b as c,v as o}from"./p-29ac15d2.js";import{c as n}from"./p-e8ec030e.js";import{d as r}from"./p-e0e2e9c1.js";import{g as m}from"./p-ea7fdd2e.js";import{F as d,a as l}from"./p-7f3becc5.js";import{v as h}from"./p-0b3574c2.js";import{c as f}from"./p-cd6c2938.js";import"./p-2aedc81e.js";import"./p-5aad3497.js";import"./p-92f420cb.js";const b={root:"gov-attachments",label:"gov-attachments__label",list:"gov-attachments__list"};const g={root:"gov-attachments-item",name:"gov-attachments-item__name",file:"gov-attachments-item__file",messages:"gov-attachments-item__messages"};const p=class{constructor(t){e(this,t);this.label=undefined;this.wcagLabel=undefined;this.h=m(this.host)}async componentDidRender(){if(n()){await r(500);await this.validateWcag()}}render(){return t(a,{key:"01d6046e8da3b76924fa9c3124cec31e5b81d4c5",class:this.h.classes(b.root)},this.label?t("p",{class:b.label},this.label):null,t("div",{key:"88936d984563a5815b90cba8b1b5ee0f71ee3460",class:b.list,role:"list","aria-label":this.wcagLabel},t("slot",{key:"99c6427772c71388f027595a1fdf13ed4956a474"})))}async validateWcag(){c(this.wcagLabel,"wcag-label",b.root)}get host(){return s(this)}};const v=":root{--roboto:Roboto, sans-serif}gov-attachments-item,.gov-attachments-item{position:relative;display:flex;width:100%;gap:var(--spacing-s)}gov-attachments-item__messages>*:last-child,.gov-attachments-item__messages>*:last-child{margin-bottom:0 !important}gov-attachments-item__file,.gov-attachments-item__file{display:flex;gap:var(--spacing-s)}gov-attachments-item__name,.gov-attachments-item__name{display:flex;gap:var(--spacing-s);flex-wrap:wrap;align-items:center;margin:0;color:var(--name-color, var(--text-primary))}gov-attachments-item__name span,.gov-attachments-item__name span{font-size:var(--font-size-xs);line-height:var(--height-line-xs);letter-spacing:0.0125rem;font-weight:400;color:var(--decor-color, var(--text-secondary))}";const y=v;const _=class{constructor(t){e(this,t);this.govRemove=i(this,"gov-remove",7);this.accessibleRemoveLabel=undefined;this.accessibleRemoveLabelledBy=undefined;this.h=m(this.host)}async componentDidRender(){if(n()){await r(500);await this.validateAccessibility()}}render(){return t(a,{key:"a8fffc03fb890c1aaae5a1d63240747f5fcb013e",class:this.h.classes(g.root),role:"listitem"},t("div",{key:"0aa555d1c5b3bdf089cf020db1271e40389522f9",class:g.file},t("p",{key:"46014b9e9d9a46fea6f813ef271815be6ab6dfc4",class:g.name},t("slot",{key:"806f9dc2b2ee44248f7fe613e8362d92ed938ba8"}),t("slot",{key:"97d69e72afd5063f41ea7b41e50012893ee5027c",name:"info"})),t("gov-button",{key:"6c40ff9ae6be99cde30fde276db287a3d14dccd1",color:"primary",type:"base",size:"s","aria-label":this.accessibleRemoveLabel,"aria-labelledby":this.accessibleRemoveLabelledBy,"on-gov-click":this.govRemove.emit},t("gov-icon",{key:"24871273b10ca807811acd15dabb49c6a45d76d1",slot:"icon-start",name:"x-lg",type:"components"}))),this.h.hasSlot("message")&&t("div",{key:"7683c6c6bfd1ca4b9660ee56ec190472970d0ac8",class:g.messages},t("slot",{key:"20b46c868809d19f9c67105a4c4774df9688a2c1",name:"message"})))}async validateAccessibility(){o(this.accessibleRemoveLabel,this.accessibleRemoveLabelledBy,g.root,this.host)}get host(){return s(this)}};_.style=y;const u=class{constructor(t){e(this,t);this.color="neutral";this.size="m";this.h=m(this.host);this.messageId=f("GovFormMessage")}validateColor(e){h(l,e,d.root)}componentWillLoad(){this.validateColor(this.color)}render(){return t(a,{key:"0fc757895a58267edf28d9139e460a14e664de04",class:this.h.classes(d.root),color:this.color,size:this.size},this.h.hasSlot("icon")&&t("slot",{key:"bca8235bbaebcd7066efb8e8e3fdbff7ba8e011c",name:"icon"}),t("span",{key:"a0e46336d6a661bf6d6f2ee8f0cb89c967f5321d",id:this.messageId,class:d.content},t("slot",{key:"2e0e474f9f9d35fc5cda1db690d2b7b4e2addb68"})))}async identifier(){return this.messageId}get host(){return s(this)}static get watchers(){return{color:["validateColor"]}}};export{p as gov_attachments,_ as gov_attachments_item,u as gov_form_message};
|
|
2
|
+
//# sourceMappingURL=p-56dc370d.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AttachmentsClass","root","label","list","AttachmentsItemClass","name","file","messages","GovAttachments","constructor","hostRef","this","h","govHost","host","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","Host","key","class","classes","role","wcagLabel","validateWcagProp","govAttachmentsItemCss","GovAttachmentsItemStyle0","GovAttachmentsItem","validateAccessibility","color","type","size","accessibleRemoveLabel","accessibleRemoveLabelledBy","govRemove","emit","slot","hasSlot","validateAccessibleLabel","GovFormMessage","messageId","createID","validateColor","newValue","validateProp","FormMessageColors","FormMessageClass","componentWillLoad","id","content","identifier"],"sources":["../../../packages/core/src/components/gov-attachments/constants.ts","../../../packages/core/src/components/gov-attachments/gov-attachments.tsx","../../../packages/core/src/components/gov-attachments/gov-attachments-item.scss?tag=gov-attachments-item","../../../packages/core/src/components/gov-attachments/gov-attachments-item.tsx","../../../packages/core/src/components/gov-form/message/gov-form-message.tsx"],"sourcesContent":["export const AttachmentsClass = {\n\troot: 'gov-attachments',\n\tlabel: 'gov-attachments__label',\n\tlist: 'gov-attachments__list',\n}\n\nexport const AttachmentsItemClass = {\n\troot: 'gov-attachments-item',\n\tname: 'gov-attachments-item__name',\n\tfile: 'gov-attachments-item__file',\n\tmessages: 'gov-attachments-item__messages',\n}\n","import { Component, Element, h, Host, Method, Prop } from '@stencil/core'\nimport { AttachmentsClass } from './constants'\nimport { validateWcagProp } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-attachments',\n})\nexport class GovAttachments {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsElement\n\t/**\n\t * Label of attachments section\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Adds accessible label for the attachment section that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsClass.root)}>\n\t\t\t\t{this.label ? <p class={AttachmentsClass.label}>{this.label}</p> : null}\n\t\t\t\t<div class={AttachmentsClass.list} role=\"list\" aria-label={this.wcagLabel}>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagProp(this.wcagLabel, 'wcag-label', AttachmentsClass.root)\n\t}\n}\n","/* Attachments - Item */\n\n\ngov-attachments-item, .gov-attachments-item {\n\t// VARIABLES\n\t@import \"gov-attachments-variables\";\n\n\t@include base($display: flex);\n\tgap: var(--spacing-s);\n\t&__messages {\n\t\t@include reset-last-margin();\n\t}\n\t&__file {\n\t\tdisplay: flex;\n\t\tgap: var(--spacing-s);\n\t}\n\t&__name {\n\t\tdisplay: flex;\n\t\tgap: var(--spacing-s);\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tmargin: 0;\n\t\tcolor: $attachments-name-color;\n\t\tspan {\n\t\t\t@include typography(\"xs\");\n\t\t\tcolor: $attachments-decor-color;\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop} from '@stencil/core'\nimport {AttachmentsItemClass} from './constants'\nimport {validateAccessibleLabel} from '../../helpers/Validate/wcag'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {delay} from '../../utils/utils'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-attachments-item',\n\tstyleUrl: 'gov-attachments-item.scss',\n})\nexport class GovAttachmentsItem {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsItemElement\n\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\n\t/**\n\t * Indicates the id of a component that labels the remove button.\n\t */\n\t@Prop({attribute: 'accessible-remove-labelledby'}) readonly accessibleRemoveLabelledBy: string\n\t/**\n\t * Emitted when the file is removed\n\t */\n\t@Event({eventName: 'gov-remove'}) govRemove: EventEmitter<PointerEvent>\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsItemClass.root)} role=\"listitem\">\n\t\t\t\t<div class={AttachmentsItemClass.file}>\n\t\t\t\t\t<p class={AttachmentsItemClass.name}>\n\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t<slot name=\"info\"/>\n\t\t\t\t\t</p>\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["AttachmentsClass","root","label","list","AttachmentsItemClass","name","file","messages","GovAttachments","constructor","hostRef","this","h","govHost","host","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","Host","key","class","classes","role","wcagLabel","validateWcagProp","govAttachmentsItemCss","GovAttachmentsItemStyle0","GovAttachmentsItem","validateAccessibility","color","type","size","accessibleRemoveLabel","accessibleRemoveLabelledBy","govRemove","emit","slot","hasSlot","validateAccessibleLabel","GovFormMessage","messageId","createID","validateColor","newValue","validateProp","FormMessageColors","FormMessageClass","componentWillLoad","id","content","identifier"],"sources":["../../../packages/core/src/components/gov-attachments/constants.ts","../../../packages/core/src/components/gov-attachments/gov-attachments.tsx","../../../packages/core/src/components/gov-attachments/gov-attachments-item.scss?tag=gov-attachments-item","../../../packages/core/src/components/gov-attachments/gov-attachments-item.tsx","../../../packages/core/src/components/gov-form/message/gov-form-message.tsx"],"sourcesContent":["export const AttachmentsClass = {\n\troot: 'gov-attachments',\n\tlabel: 'gov-attachments__label',\n\tlist: 'gov-attachments__list',\n}\n\nexport const AttachmentsItemClass = {\n\troot: 'gov-attachments-item',\n\tname: 'gov-attachments-item__name',\n\tfile: 'gov-attachments-item__file',\n\tmessages: 'gov-attachments-item__messages',\n}\n","import { Component, Element, h, Host, Method, Prop } from '@stencil/core'\nimport { AttachmentsClass } from './constants'\nimport { validateWcagProp } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-attachments',\n})\nexport class GovAttachments {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsElement\n\t/**\n\t * Label of attachments section\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Adds accessible label for the attachment section that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsClass.root)}>\n\t\t\t\t{this.label ? <p class={AttachmentsClass.label}>{this.label}</p> : null}\n\t\t\t\t<div class={AttachmentsClass.list} role=\"list\" aria-label={this.wcagLabel}>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagProp(this.wcagLabel, 'wcag-label', AttachmentsClass.root)\n\t}\n}\n","/* Attachments - Item */\n\n\ngov-attachments-item, .gov-attachments-item {\n\t// VARIABLES\n\t@import \"gov-attachments-variables\";\n\n\t@include base($display: flex);\n\tgap: var(--spacing-s);\n\t&__messages {\n\t\t@include reset-last-margin();\n\t}\n\t&__file {\n\t\tdisplay: flex;\n\t\tgap: var(--spacing-s);\n\t}\n\t&__name {\n\t\tdisplay: flex;\n\t\tgap: var(--spacing-s);\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tmargin: 0;\n\t\tcolor: $attachments-name-color;\n\t\tspan {\n\t\t\t@include typography(\"xs\");\n\t\t\tcolor: $attachments-decor-color;\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop} from '@stencil/core'\nimport {AttachmentsItemClass} from './constants'\nimport {validateAccessibleLabel} from '../../helpers/Validate/wcag'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {delay} from '../../utils/utils'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-attachments-item',\n\tstyleUrl: 'gov-attachments-item.scss',\n})\nexport class GovAttachmentsItem {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsItemElement\n\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\n\t/**\n\t * Indicates the id of a component that labels the remove button.\n\t */\n\t@Prop({attribute: 'accessible-remove-labelledby'}) readonly accessibleRemoveLabelledBy: string\n\t/**\n\t * Emitted when the file is removed\n\t */\n\t@Event({eventName: 'gov-remove'}) govRemove: EventEmitter<PointerEvent>\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateAccessibility()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsItemClass.root)} role=\"listitem\">\n\t\t\t\t<div class={AttachmentsItemClass.file}>\n\t\t\t\t\t<p class={AttachmentsItemClass.name}>\n\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t<slot name=\"info\"/>\n\t\t\t\t\t</p>\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tcolor=\"primary\"\n\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\taria-label={this.accessibleRemoveLabel}\n\t\t\t\t\t\taria-labelledby={this.accessibleRemoveLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.govRemove.emit}\n\t\t\t\t\t>\n\t\t\t\t\t\t<gov-icon slot=\"icon-start\" name=\"x-lg\" type=\"components\"></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot('message') && (\n\t\t\t\t\t<div class={AttachmentsItemClass.messages}>\n\t\t\t\t\t\t<slot name=\"message\"/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Validate the accessible attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateAccessibleLabel(this.accessibleRemoveLabel, this.accessibleRemoveLabelledBy, AttachmentsItemClass.root, this.host)\n\t}\n}\n","import { Component, Element, h, Host, Method, Prop, Watch } from '@stencil/core'\nimport {FormMessageClass, FormMessageSizesTypes, FormMessageColors, FormMessageColorType} from './constants'\nimport { govHost } from '../../../helpers/Dom/template'\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { createID } from '../../../utils/string.utils'\n\n@Component({\n\ttag: 'gov-form-message',\n})\nexport class GovFormMessage {\n\th: GovHost\n\tprivate readonly messageId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.messageId = createID('GovFormMessage')\n\t}\n\n\t@Element() host: HTMLGovFormMessageElement\n\t/**\n\t * Style variation of the message.\n\t */\n\t@Prop({ attribute: 'color' }) readonly color?: FormMessageColorType = 'neutral'\n\t/**\n\t * Message's size.\n\t */\n\t@Prop() readonly size?: FormMessageSizesTypes = 'm'\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(FormMessageColors, newValue, FormMessageClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FormMessageClass.root)} color={this.color} size={this.size}>\n\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t)}\n\t\t\t\t<span id={this.messageId} class={FormMessageClass.content}>\n\t\t\t\t\t<slot />\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns unique identifier of message\n\t */\n\t@Method()\n\tasync identifier(): Promise<string> {\n\t\treturn this.messageId\n\t}\n}\n"],"mappings":"6YAAO,MAAMA,EAAmB,CAC/BC,KAAM,kBACNC,MAAO,yBACPC,KAAM,yBAGA,MAAMC,EAAuB,CACnCH,KAA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