@gov-design-system-ce/components 0.0.48 → 0.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.cjs.js +6 -2
- package/dist/cjs/core.cjs.js.map +1 -1
- package/dist/cjs/gov-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-accordion.cjs.entry.js +1 -1
- package/dist/cjs/gov-alert.cjs.entry.js +1 -1
- package/dist/cjs/gov-app.cjs.entry.js +1 -1
- package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-attachments_3.cjs.entry.js +1 -1
- package/dist/cjs/gov-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/gov-badge.cjs.entry.js +1 -1
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/gov-button.cjs.entry.js +1 -1
- package/dist/cjs/gov-card.cjs.entry.js +1 -1
- package/dist/cjs/gov-container.cjs.entry.js +1 -1
- package/dist/cjs/gov-control-group.cjs.entry.js +1 -1
- package/dist/cjs/gov-cookiebar.cjs.entry.js +1 -1
- package/dist/cjs/gov-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/gov-empty.cjs.entry.js +1 -1
- package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-control.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-group.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-input.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-password-power.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-search.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-select.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-switch.cjs.entry.js +1 -1
- package/dist/cjs/gov-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-grid.cjs.entry.js +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +2 -2
- package/dist/cjs/gov-layout-column.cjs.entry.js +1 -1
- package/dist/cjs/gov-layout.cjs.entry.js +1 -1
- package/dist/cjs/gov-loading.cjs.entry.js +1 -1
- package/dist/cjs/gov-message.cjs.entry.js +1 -1
- package/dist/cjs/gov-modal.cjs.entry.js +1 -1
- package/dist/cjs/gov-nav-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-nav.cjs.entry.js +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js +1 -1
- package/dist/cjs/gov-prompt.cjs.entry.js +1 -1
- package/dist/cjs/gov-side-nav-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-side-nav.cjs.entry.js +1 -1
- package/dist/cjs/gov-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/gov-spacer.cjs.entry.js +1 -1
- package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-statsbar.cjs.entry.js +1 -1
- package/dist/cjs/gov-stepper-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-stepper.cjs.entry.js +1 -1
- package/dist/cjs/gov-tabs-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-tabs.cjs.entry.js +1 -1
- package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tile.cjs.entry.js +1 -1
- package/dist/cjs/gov-tiles.cjs.entry.js +1 -1
- package/dist/cjs/gov-toast.cjs.entry.js +1 -1
- package/dist/cjs/gov-tooltip-content.cjs.entry.js +1 -1
- package/dist/cjs/gov-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/gov-wizzard-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-wizzard.cjs.entry.js +1 -1
- package/dist/cjs/{index-29ac07f6.js → index-83edd4fe.js} +305 -63
- package/dist/cjs/index-83edd4fe.js.map +1 -0
- package/dist/cjs/loader.cjs.js +3 -11
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +62 -62
- package/dist/collection/components/gov-accordion/constants.js +3 -3
- package/dist/collection/components/gov-accordion/gov-accordion-item.js +14 -7
- package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
- package/dist/collection/components/gov-accordion/gov-accordion.js +16 -12
- package/dist/collection/components/gov-accordion/gov-accordion.js.map +1 -1
- package/dist/collection/components/gov-alert/constants.js +2 -2
- package/dist/collection/components/gov-alert/gov-alert.js +6 -3
- package/dist/collection/components/gov-alert/gov-alert.js.map +1 -1
- package/dist/collection/components/gov-app/gov-app.js +37 -37
- package/dist/collection/components/gov-app/gov-app.js.map +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments-item.js +10 -8
- package/dist/collection/components/gov-attachments/gov-attachments-item.js.map +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments.js +8 -7
- package/dist/collection/components/gov-attachments/gov-attachments.js.map +1 -1
- package/dist/collection/components/gov-backdrop/gov-backdrop.js +10 -8
- package/dist/collection/components/gov-backdrop/gov-backdrop.js.map +1 -1
- package/dist/collection/components/gov-badge/gov-badge.js +18 -9
- package/dist/collection/components/gov-badge/gov-badge.js.map +1 -1
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +10 -8
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
- package/dist/collection/components/gov-button/default/constants.js +3 -3
- package/dist/collection/components/gov-button/default/gov-button.js +26 -13
- package/dist/collection/components/gov-button/default/gov-button.js.map +1 -1
- package/dist/collection/components/gov-button/dropdown/gov-dropdown.js +8 -4
- package/dist/collection/components/gov-button/dropdown/gov-dropdown.js.map +1 -1
- package/dist/collection/components/gov-card/gov-card.js +16 -12
- package/dist/collection/components/gov-card/gov-card.js.map +1 -1
- package/dist/collection/components/gov-container/gov-container.js +7 -5
- package/dist/collection/components/gov-container/gov-container.js.map +1 -1
- package/dist/collection/components/gov-control-group/constants.js +2 -2
- package/dist/collection/components/gov-control-group/gov-control-group.js +2 -1
- package/dist/collection/components/gov-control-group/gov-control-group.js.map +1 -1
- package/dist/collection/components/gov-cookiebar/gov-cookiebar.js +3 -3
- package/dist/collection/components/gov-empty/gov-empty.js +3 -3
- package/dist/collection/components/gov-error-code/gov-error-code.js +3 -3
- package/dist/collection/components/gov-form/autocomplete/constants.js +3 -3
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +30 -15
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
- package/dist/collection/components/gov-form/checkbox/constants.js +2 -2
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +14 -7
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
- package/dist/collection/components/gov-form/control/constants.js +2 -2
- package/dist/collection/components/gov-form/control/gov-form-control.js +4 -2
- package/dist/collection/components/gov-form/control/gov-form-control.js.map +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.js +20 -10
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-form/group/gov-form-group.js +2 -1
- package/dist/collection/components/gov-form/group/gov-form-group.js.map +1 -1
- package/dist/collection/components/gov-form/input/constants.js +3 -3
- package/dist/collection/components/gov-form/input/gov-form-input.js +40 -24
- 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 +6 -4
- package/dist/collection/components/gov-form/label/gov-form-label.js.map +1 -1
- package/dist/collection/components/gov-form/message/constants.js +2 -2
- package/dist/collection/components/gov-form/message/gov-form-message.js +9 -7
- package/dist/collection/components/gov-form/message/gov-form-message.js.map +1 -1
- package/dist/collection/components/gov-form/multiselect/constants.js +3 -3
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +22 -11
- 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 +2 -2
- package/dist/collection/components/gov-form/radio/constants.js +2 -2
- package/dist/collection/components/gov-form/radio/gov-form-radio.js +14 -7
- package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
- package/dist/collection/components/gov-form/search/constants.js +2 -2
- package/dist/collection/components/gov-form/search/gov-form-search.js +4 -3
- package/dist/collection/components/gov-form/search/gov-form-search.js.map +1 -1
- package/dist/collection/components/gov-form/select/constants.js +3 -3
- package/dist/collection/components/gov-form/select/gov-form-select.js +22 -11
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-form/switch/constants.js +2 -2
- package/dist/collection/components/gov-form/switch/gov-form-switch.js +14 -7
- package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
- package/dist/collection/components/gov-grid/gov-grid-item.css +0 -44
- package/dist/collection/components/gov-grid/gov-grid-item.js +3 -3
- package/dist/collection/components/gov-grid/gov-grid.js +3 -3
- package/dist/collection/components/gov-icon/gov-icon.js +6 -5
- package/dist/collection/components/gov-icon/gov-icon.js.map +1 -1
- package/dist/collection/components/gov-layout/gov-layout-column.js +3 -3
- package/dist/collection/components/gov-layout/gov-layout.js +7 -5
- package/dist/collection/components/gov-layout/gov-layout.js.map +1 -1
- package/dist/collection/components/gov-loading/loading/gov-loading.js +3 -3
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js +8 -4
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js.map +1 -1
- package/dist/collection/components/gov-message/constants.js +2 -2
- package/dist/collection/components/gov-message/gov-message.js +7 -6
- package/dist/collection/components/gov-message/gov-message.js.map +1 -1
- package/dist/collection/components/gov-modal/gov-modal.js +8 -4
- package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
- package/dist/collection/components/gov-nav/gov-nav-item.js +3 -3
- package/dist/collection/components/gov-nav/gov-nav.js +7 -6
- package/dist/collection/components/gov-nav/gov-nav.js.map +1 -1
- package/dist/collection/components/gov-pagination/constants.js +3 -3
- package/dist/collection/components/gov-pagination/gov-pagination.js +10 -5
- package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
- package/dist/collection/components/gov-promp/gov-prompt.js +8 -4
- package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
- package/dist/collection/components/gov-side-nav/gov-side-nav-item.js +15 -10
- package/dist/collection/components/gov-side-nav/gov-side-nav-item.js.map +1 -1
- package/dist/collection/components/gov-side-nav/gov-side-nav.js +10 -8
- package/dist/collection/components/gov-side-nav/gov-side-nav.js.map +1 -1
- package/dist/collection/components/gov-spacer/constants.js +2 -2
- package/dist/collection/components/gov-spacer/gov-spacer.js +8 -6
- package/dist/collection/components/gov-spacer/gov-spacer.js.map +1 -1
- package/dist/collection/components/gov-statsbar/constants.js +2 -2
- package/dist/collection/components/gov-statsbar/gov-statsbar-item.js +6 -5
- package/dist/collection/components/gov-statsbar/gov-statsbar-item.js.map +1 -1
- package/dist/collection/components/gov-statsbar/gov-statsbar.js +8 -6
- package/dist/collection/components/gov-statsbar/gov-statsbar.js.map +1 -1
- package/dist/collection/components/gov-stepper/constants.js +3 -3
- package/dist/collection/components/gov-stepper/gov-stepper-item.js +14 -10
- package/dist/collection/components/gov-stepper/gov-stepper-item.js.map +1 -1
- package/dist/collection/components/gov-stepper/gov-stepper.js +8 -6
- package/dist/collection/components/gov-stepper/gov-stepper.js.map +1 -1
- package/dist/collection/components/gov-tabs/constants.js +2 -2
- package/dist/collection/components/gov-tabs/gov-tabs-item.js +10 -7
- package/dist/collection/components/gov-tabs/gov-tabs-item.js.map +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs.js +29 -19
- package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
- package/dist/collection/components/gov-tile/container/gov-tiles.js +4 -4
- package/dist/collection/components/gov-tile/gov-tile.js +6 -3
- package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
- package/dist/collection/components/gov-toast/constants.js +2 -2
- package/dist/collection/components/gov-toast/gov-toast.js +11 -8
- package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
- package/dist/collection/components/gov-tooltip/constants.js +3 -3
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +3 -3
- package/dist/collection/components/gov-tooltip/gov-tooltip.js +15 -10
- package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
- package/dist/collection/components/gov-wizzard/constants.js +3 -3
- package/dist/collection/components/gov-wizzard/gov-wizzard-item.js +14 -7
- package/dist/collection/components/gov-wizzard/gov-wizzard-item.js.map +1 -1
- package/dist/collection/components/gov-wizzard/gov-wizzard.js +6 -3
- package/dist/collection/components/gov-wizzard/gov-wizzard.js.map +1 -1
- package/dist/collection/helpers/Dom/form.js +9 -9
- package/dist/collection/helpers/Dom/win.js +1 -1
- package/dist/collection/helpers/StorybookDocsTemplate.js +3 -3
- package/dist/collection/helpers/Validate/props.js +1 -1
- package/dist/collection/helpers/Validate/wcag.js +3 -3
- package/dist/collection/utils/ds.utils.js +1 -1
- package/dist/collection/utils/icon.utils.js +3 -3
- package/dist/components/gov-accordion-item.js +1 -156
- package/dist/components/gov-accordion-item.js.map +1 -1
- package/dist/components/gov-accordion.js +1 -94
- package/dist/components/gov-accordion.js.map +1 -1
- package/dist/components/gov-alert.js +1 -122
- package/dist/components/gov-alert.js.map +1 -1
- package/dist/components/gov-app.js +1 -8924
- package/dist/components/gov-app.js.map +1 -1
- package/dist/components/gov-attachments-item.js +1 -7
- package/dist/components/gov-attachments-item.js.map +1 -1
- package/dist/components/gov-attachments.js +1 -7
- package/dist/components/gov-attachments.js.map +1 -1
- package/dist/components/gov-backdrop.js +1 -7
- package/dist/components/gov-backdrop.js.map +1 -1
- package/dist/components/gov-badge.js +1 -7
- package/dist/components/gov-badge.js.map +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -67
- package/dist/components/gov-breadcrumbs.js.map +1 -1
- package/dist/components/gov-button.js +1 -7
- package/dist/components/gov-button.js.map +1 -1
- package/dist/components/gov-card.js +1 -143
- package/dist/components/gov-card.js.map +1 -1
- package/dist/components/gov-container.js +1 -51
- package/dist/components/gov-container.js.map +1 -1
- package/dist/components/gov-control-group.js +1 -57
- package/dist/components/gov-control-group.js.map +1 -1
- package/dist/components/gov-cookiebar.js +1 -46
- package/dist/components/gov-cookiebar.js.map +1 -1
- package/dist/components/gov-dropdown.js +1 -150
- package/dist/components/gov-dropdown.js.map +1 -1
- package/dist/components/gov-empty.js +1 -44
- package/dist/components/gov-empty.js.map +1 -1
- package/dist/components/gov-error-code.js +1 -44
- package/dist/components/gov-error-code.js.map +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -7
- package/dist/components/gov-form-autocomplete.js.map +1 -1
- package/dist/components/gov-form-checkbox.js +1 -159
- package/dist/components/gov-form-checkbox.js.map +1 -1
- package/dist/components/gov-form-control.js +1 -139
- package/dist/components/gov-form-control.js.map +1 -1
- package/dist/components/gov-form-file.js +1 -288
- package/dist/components/gov-form-file.js.map +1 -1
- package/dist/components/gov-form-group.js +1 -57
- package/dist/components/gov-form-group.js.map +1 -1
- package/dist/components/gov-form-input.js +1 -7
- package/dist/components/gov-form-input.js.map +1 -1
- package/dist/components/gov-form-label.js +1 -46
- package/dist/components/gov-form-label.js.map +1 -1
- package/dist/components/gov-form-message.js +1 -7
- package/dist/components/gov-form-message.js.map +1 -1
- package/dist/components/gov-form-multi-select.js +1 -270
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-password-power.js +1 -43
- package/dist/components/gov-form-password-power.js.map +1 -1
- package/dist/components/gov-form-radio.js +1 -153
- package/dist/components/gov-form-radio.js.map +1 -1
- package/dist/components/gov-form-search.js +1 -47
- package/dist/components/gov-form-search.js.map +1 -1
- package/dist/components/gov-form-select.js +1 -7
- package/dist/components/gov-form-select.js.map +1 -1
- package/dist/components/gov-form-switch.js +1 -153
- package/dist/components/gov-form-switch.js.map +1 -1
- package/dist/components/gov-grid-item.js +1 -49
- package/dist/components/gov-grid-item.js.map +1 -1
- package/dist/components/gov-grid.js +1 -44
- package/dist/components/gov-grid.js.map +1 -1
- package/dist/components/gov-icon.js +1 -7
- package/dist/components/gov-icon.js.map +1 -1
- package/dist/components/gov-layout-column.js +1 -38
- package/dist/components/gov-layout-column.js.map +1 -1
- package/dist/components/gov-layout.js +1 -51
- package/dist/components/gov-layout.js.map +1 -1
- package/dist/components/gov-loading.js +1 -58
- package/dist/components/gov-loading.js.map +1 -1
- package/dist/components/gov-message.js +1 -57
- package/dist/components/gov-message.js.map +1 -1
- package/dist/components/gov-modal.js +1 -146
- package/dist/components/gov-modal.js.map +1 -1
- package/dist/components/gov-nav-item.js +1 -53
- package/dist/components/gov-nav-item.js.map +1 -1
- package/dist/components/gov-nav.js +1 -57
- package/dist/components/gov-nav.js.map +1 -1
- package/dist/components/gov-pagination.js +1 -270
- package/dist/components/gov-pagination.js.map +1 -1
- package/dist/components/gov-prompt.js +1 -146
- package/dist/components/gov-prompt.js.map +1 -1
- package/dist/components/gov-side-nav-item.js +1 -124
- package/dist/components/gov-side-nav-item.js.map +1 -1
- package/dist/components/gov-side-nav.js +1 -73
- package/dist/components/gov-side-nav.js.map +1 -1
- package/dist/components/gov-skeleton.js +1 -137
- package/dist/components/gov-skeleton.js.map +1 -1
- package/dist/components/gov-spacer.js +1 -72
- package/dist/components/gov-spacer.js.map +1 -1
- package/dist/components/gov-statsbar-item.js +1 -51
- package/dist/components/gov-statsbar-item.js.map +1 -1
- package/dist/components/gov-statsbar.js +1 -65
- package/dist/components/gov-statsbar.js.map +1 -1
- package/dist/components/gov-stepper-item.js +1 -96
- package/dist/components/gov-stepper-item.js.map +1 -1
- package/dist/components/gov-stepper.js +1 -61
- package/dist/components/gov-stepper.js.map +1 -1
- package/dist/components/gov-tabs-item.js +1 -73
- package/dist/components/gov-tabs-item.js.map +1 -1
- package/dist/components/gov-tabs.js +1 -232
- package/dist/components/gov-tabs.js.map +1 -1
- package/dist/components/gov-tile.js +1 -80
- package/dist/components/gov-tile.js.map +1 -1
- package/dist/components/gov-tiles.js +1 -49
- package/dist/components/gov-tiles.js.map +1 -1
- package/dist/components/gov-toast.js +1 -136
- package/dist/components/gov-toast.js.map +1 -1
- package/dist/components/gov-tooltip-content.js +1 -54
- package/dist/components/gov-tooltip-content.js.map +1 -1
- package/dist/components/gov-tooltip.js +1 -176
- package/dist/components/gov-tooltip.js.map +1 -1
- package/dist/components/gov-wizzard-item.js +1 -144
- package/dist/components/gov-wizzard-item.js.map +1 -1
- package/dist/components/gov-wizzard.js +1 -83
- package/dist/components/gov-wizzard.js.map +1 -1
- package/dist/components/index.d.ts +14 -62
- package/dist/components/index.js +1 -62
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-03990da5.js +2 -0
- package/dist/components/p-03990da5.js.map +1 -0
- package/dist/components/p-0f5e2b0a.js +2 -0
- package/dist/components/p-0f5e2b0a.js.map +1 -0
- package/dist/components/p-1020a160.js +2 -0
- package/dist/components/p-1020a160.js.map +1 -0
- package/dist/components/p-16e8c053.js +2 -0
- package/dist/components/p-16e8c053.js.map +1 -0
- package/dist/components/p-17c1ffc1.js +2 -0
- package/dist/components/p-17c1ffc1.js.map +1 -0
- package/dist/components/p-1b4f2520.js +2 -0
- package/dist/components/p-1b4f2520.js.map +1 -0
- package/dist/components/p-1c1d0bbe.js +2 -0
- package/dist/components/p-1c1d0bbe.js.map +1 -0
- package/dist/components/p-20853eff.js +2 -0
- package/dist/components/{gov-form-select2.js.map → p-20853eff.js.map} +1 -1
- package/dist/components/p-24636c53.js +2 -0
- package/dist/components/p-24636c53.js.map +1 -0
- package/dist/components/p-2692b1ff.js +2 -0
- package/dist/components/p-2692b1ff.js.map +1 -0
- package/dist/components/p-26acf964.js +2 -0
- package/dist/components/p-26acf964.js.map +1 -0
- package/dist/components/p-34152b51.js +2 -0
- package/dist/components/p-34152b51.js.map +1 -0
- package/dist/components/p-3464136c.js +2 -0
- package/dist/components/p-3464136c.js.map +1 -0
- package/dist/components/p-36be8f6e.js +2 -0
- package/dist/components/p-36be8f6e.js.map +1 -0
- package/dist/components/p-386409dc.js +2 -0
- package/dist/components/p-386409dc.js.map +1 -0
- package/dist/components/p-3dbf7f49.js +2 -0
- package/dist/components/p-3dbf7f49.js.map +1 -0
- package/dist/components/p-3f37ddb6.js +2 -0
- package/dist/components/p-3f37ddb6.js.map +1 -0
- package/dist/components/p-404f469e.js +2 -0
- package/dist/components/p-404f469e.js.map +1 -0
- package/dist/components/p-47172f0a.js +2 -0
- package/dist/components/p-47172f0a.js.map +1 -0
- package/dist/components/p-55500e5a.js +2 -0
- package/dist/components/p-55500e5a.js.map +1 -0
- package/dist/components/p-561fa17b.js +2 -0
- package/dist/components/p-561fa17b.js.map +1 -0
- package/dist/components/p-5bf5a42e.js +2 -0
- package/dist/components/p-5bf5a42e.js.map +1 -0
- package/dist/components/p-5defdc5e.js +2 -0
- package/dist/components/p-5defdc5e.js.map +1 -0
- package/dist/components/p-6278531b.js +2 -0
- package/dist/components/p-6278531b.js.map +1 -0
- package/dist/components/p-64ced668.js +2 -0
- package/dist/components/p-64ced668.js.map +1 -0
- package/dist/components/p-80c0109d.js +2 -0
- package/dist/components/p-80c0109d.js.map +1 -0
- package/dist/components/p-80e30702.js +2 -0
- package/dist/components/{constants13.js.map → p-80e30702.js.map} +1 -1
- package/dist/components/p-9144dde1.js +2 -0
- package/dist/components/p-9144dde1.js.map +1 -0
- package/dist/components/p-9331532e.js +2 -0
- package/dist/components/p-9331532e.js.map +1 -0
- package/dist/components/p-a5d69694.js +2 -0
- package/dist/components/p-a5d69694.js.map +1 -0
- package/dist/components/p-a6d14a47.js +2 -0
- package/dist/components/p-a6d14a47.js.map +1 -0
- package/dist/components/p-b72a7bed.js +2 -0
- package/dist/components/p-b72a7bed.js.map +1 -0
- package/dist/components/p-be4aab0e.js +2 -0
- package/dist/components/p-be4aab0e.js.map +1 -0
- package/dist/components/p-ccc44ac1.js +2 -0
- package/dist/components/p-ccc44ac1.js.map +1 -0
- package/dist/components/p-efcdfed8.js +2 -0
- package/dist/components/p-efcdfed8.js.map +1 -0
- package/dist/components/p-ff7365ae.js +2 -0
- package/dist/components/p-ff7365ae.js.map +1 -0
- package/dist/components/p-ffb7495c.js +2 -0
- package/dist/components/p-ffb7495c.js.map +1 -0
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/index.esm.js.map +1 -1
- package/dist/core/{p-a2f998a0.entry.js → p-02c3a3fd.entry.js} +2 -2
- package/dist/core/p-02c3a3fd.entry.js.map +1 -0
- package/dist/core/p-03990da5.js.map +1 -1
- package/dist/core/{p-6aa31f02.entry.js → p-041d30b1.entry.js} +2 -2
- package/dist/core/p-041d30b1.entry.js.map +1 -0
- package/dist/core/{p-90330543.entry.js → p-0eadfb3e.entry.js} +2 -2
- package/dist/core/p-0eadfb3e.entry.js.map +1 -0
- package/dist/core/{p-5d348765.entry.js → p-0eb11cfc.entry.js} +2 -2
- package/dist/core/p-0eb11cfc.entry.js.map +1 -0
- package/dist/core/p-0f5e2b0a.js.map +1 -1
- package/dist/core/p-1020a160.js.map +1 -1
- package/dist/core/p-10cbc3fe.js +3 -0
- package/dist/core/p-10cbc3fe.js.map +1 -0
- package/dist/core/{p-02fb27e8.entry.js → p-11be550d.entry.js} +2 -2
- package/dist/core/p-11be550d.entry.js.map +1 -0
- package/dist/core/{p-2e2be66b.entry.js → p-1ae47d62.entry.js} +2 -2
- package/dist/core/p-1ae47d62.entry.js.map +1 -0
- package/dist/core/p-1c1d0bbe.js.map +1 -1
- package/dist/core/{p-2f88b6d9.entry.js → p-1c62f175.entry.js} +2 -2
- package/dist/core/p-1c62f175.entry.js.map +1 -0
- package/dist/core/{p-d90a2718.entry.js → p-1da9f871.entry.js} +2 -2
- package/dist/core/p-1da9f871.entry.js.map +1 -0
- package/dist/core/{p-d8def432.entry.js → p-1e3cad4b.entry.js} +2 -2
- package/dist/core/p-1e3cad4b.entry.js.map +1 -0
- package/dist/core/{p-e1e4c8f8.entry.js → p-228da18e.entry.js} +2 -2
- package/dist/core/p-228da18e.entry.js.map +1 -0
- package/dist/core/p-24636c53.js.map +1 -1
- package/dist/core/p-26acf964.js.map +1 -1
- package/dist/core/{p-e4bb6100.entry.js → p-2790d89e.entry.js} +2 -2
- package/dist/core/p-2790d89e.entry.js.map +1 -0
- package/dist/core/{p-a89c27c1.entry.js → p-2fe9d3ea.entry.js} +2 -2
- package/dist/core/p-2fe9d3ea.entry.js.map +1 -0
- package/dist/core/{p-732f74fe.entry.js → p-33895061.entry.js} +2 -2
- package/dist/core/p-33895061.entry.js.map +1 -0
- package/dist/core/p-34152b51.js.map +1 -1
- package/dist/core/p-3464136c.js.map +1 -1
- package/dist/core/p-34ed07f6.js.map +1 -1
- package/dist/core/{p-21d08d89.entry.js → p-3559e7c5.entry.js} +2 -2
- package/dist/core/p-3559e7c5.entry.js.map +1 -0
- package/dist/core/p-36be8f6e.js.map +1 -1
- package/dist/core/{p-042d5b20.entry.js → p-3858e2c8.entry.js} +2 -2
- package/dist/core/p-3858e2c8.entry.js.map +1 -0
- package/dist/core/p-3b9df792.entry.js +2 -0
- package/dist/core/p-3b9df792.entry.js.map +1 -0
- package/dist/core/{p-2507a42a.entry.js → p-3d720d54.entry.js} +2 -2
- package/dist/core/p-3d720d54.entry.js.map +1 -0
- package/dist/core/p-3dbf7f49.js.map +1 -1
- package/dist/core/{p-42636ddf.entry.js → p-3e5432d7.entry.js} +2 -2
- package/dist/core/p-3e5432d7.entry.js.map +1 -0
- package/dist/core/p-3f37ddb6.js.map +1 -1
- package/dist/core/p-404f469e.js.map +1 -1
- package/dist/core/{p-7cde4bc8.entry.js → p-42cd2cc4.entry.js} +2 -2
- package/dist/core/p-42cd2cc4.entry.js.map +1 -0
- package/dist/core/{p-3d7ea15c.entry.js → p-48349167.entry.js} +2 -2
- package/dist/core/p-48349167.entry.js.map +1 -0
- package/dist/core/{p-8bebbcc7.entry.js → p-49926f53.entry.js} +2 -2
- package/dist/core/p-49926f53.entry.js.map +1 -0
- package/dist/core/{p-14a475a8.entry.js → p-5150efee.entry.js} +2 -2
- package/dist/core/p-5150efee.entry.js.map +1 -0
- package/dist/core/{p-dc94a1da.entry.js → p-5316e768.entry.js} +2 -2
- package/dist/core/p-5316e768.entry.js.map +1 -0
- package/dist/core/p-55500e5a.js.map +1 -1
- package/dist/core/p-561fa17b.js.map +1 -1
- package/dist/core/{p-ed1e9d01.entry.js → p-5a855a15.entry.js} +2 -2
- package/dist/core/p-5a855a15.entry.js.map +1 -0
- package/dist/core/p-5defdc5e.js.map +1 -1
- package/dist/core/{p-00c4dc0d.entry.js → p-5e23a6ba.entry.js} +2 -2
- package/dist/core/p-5e23a6ba.entry.js.map +1 -0
- package/dist/core/p-6278531b.js.map +1 -1
- package/dist/core/p-64ced668.js.map +1 -1
- package/dist/core/{p-76e2aa52.entry.js → p-6dacb8d3.entry.js} +2 -2
- package/dist/core/p-6dacb8d3.entry.js.map +1 -0
- package/dist/core/{p-52dc68aa.entry.js → p-6f43bd00.entry.js} +2 -2
- package/dist/core/p-6f43bd00.entry.js.map +1 -0
- package/dist/core/{p-2e94d2d3.entry.js → p-722218fd.entry.js} +2 -2
- package/dist/core/p-722218fd.entry.js.map +1 -0
- package/dist/core/{p-a4d23e73.entry.js → p-739dd451.entry.js} +2 -2
- package/dist/core/p-739dd451.entry.js.map +1 -0
- package/dist/core/{p-4d257c38.entry.js → p-7ab82a55.entry.js} +2 -2
- package/dist/core/p-7ab82a55.entry.js.map +1 -0
- package/dist/core/p-80e30702.js.map +1 -1
- package/dist/core/{p-1def0eb2.entry.js → p-88a78167.entry.js} +2 -2
- package/dist/core/p-88a78167.entry.js.map +1 -0
- package/dist/core/{p-58047fab.entry.js → p-89921159.entry.js} +2 -2
- package/dist/core/p-89921159.entry.js.map +1 -0
- package/dist/core/p-9144dde1.js.map +1 -1
- package/dist/core/{p-50e94566.entry.js → p-93042b25.entry.js} +2 -2
- package/dist/core/p-93042b25.entry.js.map +1 -0
- package/dist/core/{p-0f0564e8.entry.js → p-9633e7b5.entry.js} +2 -2
- package/dist/core/p-9633e7b5.entry.js.map +1 -0
- package/dist/core/{p-fe8dd50e.entry.js → p-9751af2e.entry.js} +2 -2
- package/dist/core/p-9751af2e.entry.js.map +1 -0
- package/dist/core/{p-d9e28400.entry.js → p-9a3e3ace.entry.js} +2 -2
- package/dist/core/p-9a3e3ace.entry.js.map +1 -0
- package/dist/core/{p-22222994.entry.js → p-9ad54c30.entry.js} +2 -2
- package/dist/core/p-9ad54c30.entry.js.map +1 -0
- package/dist/core/p-9dab01be.js.map +1 -1
- package/dist/core/{p-5957ba08.entry.js → p-9e208f40.entry.js} +2 -2
- package/dist/core/p-9e208f40.entry.js.map +1 -0
- package/dist/core/p-9f541022.entry.js +2 -0
- package/dist/core/p-9f541022.entry.js.map +1 -0
- package/dist/core/p-a5d69694.js.map +1 -1
- package/dist/core/{p-f1503456.entry.js → p-a68547b1.entry.js} +2 -2
- package/dist/core/p-a68547b1.entry.js.map +1 -0
- package/dist/core/p-a6d14a47.js.map +1 -1
- package/dist/core/{p-bd47b407.entry.js → p-a857915f.entry.js} +2 -2
- package/dist/core/{p-bd47b407.entry.js.map → p-a857915f.entry.js.map} +1 -1
- package/dist/core/{p-354c6a6d.entry.js → p-aa4e716e.entry.js} +2 -2
- package/dist/core/p-aa4e716e.entry.js.map +1 -0
- package/dist/core/{p-25e53e01.entry.js → p-ac94d242.entry.js} +2 -2
- package/dist/core/p-ac94d242.entry.js.map +1 -0
- package/dist/core/{p-b2dfef17.entry.js → p-ae04e58f.entry.js} +2 -2
- package/dist/core/p-ae04e58f.entry.js.map +1 -0
- package/dist/core/{p-4db67975.entry.js → p-af7a89bc.entry.js} +2 -2
- package/dist/core/p-af7a89bc.entry.js.map +1 -0
- package/dist/core/{p-683fc65e.entry.js → p-b5a560d2.entry.js} +2 -2
- package/dist/core/p-b5a560d2.entry.js.map +1 -0
- package/dist/core/{p-63ef7826.entry.js → p-bbcbe1cc.entry.js} +2 -2
- package/dist/core/p-bbcbe1cc.entry.js.map +1 -0
- package/dist/core/p-be4aab0e.js.map +1 -1
- package/dist/core/{p-220f189d.entry.js → p-d2729599.entry.js} +2 -2
- package/dist/core/p-d2729599.entry.js.map +1 -0
- package/dist/core/{p-70a7e7f6.entry.js → p-d921bd4b.entry.js} +2 -2
- package/dist/core/p-d921bd4b.entry.js.map +1 -0
- package/dist/core/{p-f644cad5.entry.js → p-da762184.entry.js} +2 -2
- package/dist/core/p-da762184.entry.js.map +1 -0
- package/dist/core/p-de3dc437.entry.js +2 -0
- package/dist/core/p-de3dc437.entry.js.map +1 -0
- package/dist/core/p-e0c04c5f.entry.js +2 -0
- package/dist/core/p-e0c04c5f.entry.js.map +1 -0
- package/dist/core/{p-a714637e.entry.js → p-e1b3c361.entry.js} +2 -2
- package/dist/core/p-e1b3c361.entry.js.map +1 -0
- package/dist/core/{p-bc1c8436.entry.js → p-e86db39c.entry.js} +2 -2
- package/dist/core/p-e86db39c.entry.js.map +1 -0
- package/dist/core/{p-ce59c2ee.entry.js → p-eda868dc.entry.js} +2 -2
- package/dist/core/p-eda868dc.entry.js.map +1 -0
- package/dist/core/{p-bbfa3d9e.entry.js → p-f95bca5f.entry.js} +2 -2
- package/dist/core/p-f95bca5f.entry.js.map +1 -0
- package/dist/core/{p-ec63daab.entry.js → p-f969eec7.entry.js} +2 -2
- package/dist/core/p-f969eec7.entry.js.map +1 -0
- package/dist/core/{p-4c6d7b65.entry.js → p-fa71fb92.entry.js} +2 -2
- package/dist/core/p-fa71fb92.entry.js.map +1 -0
- package/dist/core/p-ff7365ae.js.map +1 -1
- package/dist/core/p-ffb7495c.js.map +1 -1
- package/dist/esm/core.js +3 -2
- package/dist/esm/core.js.map +1 -1
- package/dist/esm/gov-accordion-item.entry.js +1 -1
- package/dist/esm/gov-accordion.entry.js +1 -1
- package/dist/esm/gov-alert.entry.js +1 -1
- package/dist/esm/gov-app.entry.js +1 -1
- package/dist/esm/gov-app.entry.js.map +1 -1
- package/dist/esm/gov-attachments_3.entry.js +1 -1
- package/dist/esm/gov-backdrop.entry.js +1 -1
- package/dist/esm/gov-badge.entry.js +1 -1
- package/dist/esm/gov-breadcrumbs.entry.js +1 -1
- package/dist/esm/gov-button.entry.js +1 -1
- package/dist/esm/gov-card.entry.js +1 -1
- package/dist/esm/gov-container.entry.js +1 -1
- package/dist/esm/gov-control-group.entry.js +1 -1
- package/dist/esm/gov-cookiebar.entry.js +1 -1
- package/dist/esm/gov-dropdown.entry.js +1 -1
- package/dist/esm/gov-empty.entry.js +1 -1
- package/dist/esm/gov-error-code.entry.js +1 -1
- package/dist/esm/gov-form-autocomplete.entry.js +1 -1
- package/dist/esm/gov-form-checkbox.entry.js +1 -1
- package/dist/esm/gov-form-control.entry.js +1 -1
- package/dist/esm/gov-form-file.entry.js +1 -1
- package/dist/esm/gov-form-group.entry.js +1 -1
- package/dist/esm/gov-form-input.entry.js +1 -1
- package/dist/esm/gov-form-label.entry.js +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +1 -1
- package/dist/esm/gov-form-password-power.entry.js +1 -1
- package/dist/esm/gov-form-radio.entry.js +1 -1
- package/dist/esm/gov-form-search.entry.js +1 -1
- package/dist/esm/gov-form-select.entry.js +1 -1
- package/dist/esm/gov-form-switch.entry.js +1 -1
- package/dist/esm/gov-grid-item.entry.js +1 -1
- package/dist/esm/gov-grid.entry.js +1 -1
- package/dist/esm/gov-icon.entry.js +2 -2
- package/dist/esm/gov-layout-column.entry.js +1 -1
- package/dist/esm/gov-layout.entry.js +1 -1
- package/dist/esm/gov-loading.entry.js +1 -1
- package/dist/esm/gov-message.entry.js +1 -1
- package/dist/esm/gov-modal.entry.js +1 -1
- package/dist/esm/gov-nav-item.entry.js +1 -1
- package/dist/esm/gov-nav.entry.js +1 -1
- package/dist/esm/gov-pagination.entry.js +1 -1
- package/dist/esm/gov-prompt.entry.js +1 -1
- package/dist/esm/gov-side-nav-item.entry.js +1 -1
- package/dist/esm/gov-side-nav.entry.js +1 -1
- package/dist/esm/gov-skeleton.entry.js +1 -1
- package/dist/esm/gov-spacer.entry.js +1 -1
- package/dist/esm/gov-statsbar-item.entry.js +1 -1
- package/dist/esm/gov-statsbar.entry.js +1 -1
- package/dist/esm/gov-stepper-item.entry.js +1 -1
- package/dist/esm/gov-stepper.entry.js +1 -1
- package/dist/esm/gov-tabs-item.entry.js +1 -1
- package/dist/esm/gov-tabs.entry.js +1 -1
- package/dist/esm/gov-tabs.entry.js.map +1 -1
- package/dist/esm/gov-tile.entry.js +1 -1
- package/dist/esm/gov-tiles.entry.js +1 -1
- package/dist/esm/gov-toast.entry.js +1 -1
- package/dist/esm/gov-tooltip-content.entry.js +1 -1
- package/dist/esm/gov-tooltip.entry.js +1 -1
- package/dist/esm/gov-wizzard-item.entry.js +1 -1
- package/dist/esm/gov-wizzard.entry.js +1 -1
- package/dist/esm/{index-b010bfb4.js → index-ae3c50f1.js} +305 -64
- package/dist/esm/index-ae3c50f1.js.map +1 -0
- package/dist/esm/loader.js +3 -11
- package/dist/esm/loader.js.map +1 -1
- package/dist/hydrate/index.d.ts +17 -16
- package/dist/hydrate/index.js +199 -166
- package/dist/stencil.config.js +6 -11
- package/dist/stencil.config.js.map +1 -1
- package/dist/types/components/gov-accordion/constants.d.ts +2 -2
- package/dist/types/components/gov-alert/constants.d.ts +1 -1
- package/dist/types/components/gov-app/gov-app.d.ts +34 -34
- package/dist/types/components/gov-badge/constants.d.ts +1 -1
- package/dist/types/components/gov-button/default/constants.d.ts +5 -5
- package/dist/types/components/gov-button/dropdown/constants.d.ts +1 -1
- package/dist/types/components/gov-control-group/constants.d.ts +1 -1
- package/dist/types/components/gov-form/autocomplete/constants.d.ts +2 -2
- package/dist/types/components/gov-form/checkbox/constants.d.ts +1 -1
- package/dist/types/components/gov-form/control/constants.d.ts +1 -1
- package/dist/types/components/gov-form/group/constants.d.ts +1 -1
- package/dist/types/components/gov-form/input/constants.d.ts +4 -4
- package/dist/types/components/gov-form/label/constants.d.ts +1 -1
- package/dist/types/components/gov-form/message/constants.d.ts +1 -1
- package/dist/types/components/gov-form/multiselect/constants.d.ts +2 -2
- package/dist/types/components/gov-form/radio/constants.d.ts +1 -1
- package/dist/types/components/gov-form/search/constants.d.ts +1 -1
- package/dist/types/components/gov-form/select/constants.d.ts +2 -2
- package/dist/types/components/gov-form/switch/constants.d.ts +1 -1
- package/dist/types/components/gov-icon/constants.d.ts +1 -1
- package/dist/types/components/gov-layout/constants.d.ts +2 -2
- package/dist/types/components/gov-loading/skeleton/constants.d.ts +3 -3
- package/dist/types/components/gov-message/constants.d.ts +1 -1
- package/dist/types/components/gov-pagination/constants.d.ts +3 -3
- package/dist/types/components/gov-spacer/constants.d.ts +2 -2
- package/dist/types/components/gov-statsbar/constants.d.ts +2 -2
- package/dist/types/components/gov-stepper/constants.d.ts +2 -2
- package/dist/types/components/gov-tabs/constants.d.ts +3 -3
- package/dist/types/components/gov-toast/constants.d.ts +2 -2
- package/dist/types/components/gov-tooltip/constants.d.ts +3 -3
- package/dist/types/components/gov-wizzard/constants.d.ts +2 -2
- package/dist/types/components.d.ts +50 -0
- package/dist/types/stencil-public-runtime.d.ts +88 -17
- package/dist/types/types/interfaces.d.ts +2 -2
- package/dist/types/utils/utils.d.ts +1 -1
- package/loader/index.d.ts +10 -1
- package/package.json +22 -22
- package/dist/cjs/index-29ac07f6.js.map +0 -1
- package/dist/components/Fragment.js +0 -5
- package/dist/components/Fragment.js.map +0 -1
- package/dist/components/constants.js +0 -25
- package/dist/components/constants.js.map +0 -1
- package/dist/components/constants10.js +0 -19
- package/dist/components/constants10.js.map +0 -1
- package/dist/components/constants11.js +0 -22
- package/dist/components/constants11.js.map +0 -1
- package/dist/components/constants12.js +0 -25
- package/dist/components/constants12.js.map +0 -1
- package/dist/components/constants13.js +0 -29
- package/dist/components/constants14.js +0 -23
- package/dist/components/constants14.js.map +0 -1
- package/dist/components/constants15.js +0 -24
- package/dist/components/constants15.js.map +0 -1
- package/dist/components/constants2.js +0 -15
- package/dist/components/constants2.js.map +0 -1
- package/dist/components/constants3.js +0 -33
- package/dist/components/constants3.js.map +0 -1
- package/dist/components/constants4.js +0 -12
- package/dist/components/constants4.js.map +0 -1
- package/dist/components/constants5.js +0 -13
- package/dist/components/constants5.js.map +0 -1
- package/dist/components/constants6.js +0 -10
- package/dist/components/constants6.js.map +0 -1
- package/dist/components/constants7.js +0 -22
- package/dist/components/constants7.js.map +0 -1
- package/dist/components/constants8.js +0 -18
- package/dist/components/constants8.js.map +0 -1
- package/dist/components/constants9.js +0 -12
- package/dist/components/constants9.js.map +0 -1
- package/dist/components/form.js +0 -152
- package/dist/components/form.js.map +0 -1
- package/dist/components/gov-attachments-item2.js +0 -70
- package/dist/components/gov-attachments-item2.js.map +0 -1
- package/dist/components/gov-attachments2.js +0 -57
- package/dist/components/gov-attachments2.js.map +0 -1
- package/dist/components/gov-backdrop2.js +0 -64
- package/dist/components/gov-backdrop2.js.map +0 -1
- package/dist/components/gov-badge2.js +0 -108
- package/dist/components/gov-badge2.js.map +0 -1
- package/dist/components/gov-button2.js +0 -223
- package/dist/components/gov-button2.js.map +0 -1
- package/dist/components/gov-form-autocomplete2.js +0 -294
- package/dist/components/gov-form-autocomplete2.js.map +0 -1
- package/dist/components/gov-form-input2.js +0 -235
- package/dist/components/gov-form-input2.js.map +0 -1
- package/dist/components/gov-form-message2.js +0 -58
- package/dist/components/gov-form-message2.js.map +0 -1
- package/dist/components/gov-form-select2.js +0 -186
- package/dist/components/gov-icon2.js +0 -142
- package/dist/components/gov-icon2.js.map +0 -1
- package/dist/components/gov.log.js +0 -17
- package/dist/components/gov.log.js.map +0 -1
- package/dist/components/props.js +0 -14
- package/dist/components/props.js.map +0 -1
- package/dist/components/sizes.js +0 -18
- package/dist/components/sizes.js.map +0 -1
- package/dist/components/string.utils.js +0 -20
- package/dist/components/string.utils.js.map +0 -1
- package/dist/components/template.js +0 -113
- package/dist/components/template.js.map +0 -1
- package/dist/components/utils.js +0 -35
- package/dist/components/utils.js.map +0 -1
- package/dist/components/variants.js +0 -18
- package/dist/components/variants.js.map +0 -1
- package/dist/components/wcag.js +0 -62
- package/dist/components/wcag.js.map +0 -1
- package/dist/components/win.js +0 -23
- package/dist/components/win.js.map +0 -1
- package/dist/core/critical.css +0 -2532
- package/dist/core/p-00c4dc0d.entry.js.map +0 -1
- package/dist/core/p-02fb27e8.entry.js.map +0 -1
- package/dist/core/p-042d5b20.entry.js.map +0 -1
- package/dist/core/p-0574a26a.entry.js +0 -2
- package/dist/core/p-0574a26a.entry.js.map +0 -1
- package/dist/core/p-070f9684.entry.js +0 -2
- package/dist/core/p-070f9684.entry.js.map +0 -1
- package/dist/core/p-0f0564e8.entry.js.map +0 -1
- package/dist/core/p-14a475a8.entry.js.map +0 -1
- package/dist/core/p-1def0eb2.entry.js.map +0 -1
- package/dist/core/p-21d08d89.entry.js.map +0 -1
- package/dist/core/p-220f189d.entry.js.map +0 -1
- package/dist/core/p-22222994.entry.js.map +0 -1
- package/dist/core/p-2507a42a.entry.js.map +0 -1
- package/dist/core/p-25e53e01.entry.js.map +0 -1
- package/dist/core/p-2e2be66b.entry.js.map +0 -1
- package/dist/core/p-2e94d2d3.entry.js.map +0 -1
- package/dist/core/p-2f88b6d9.entry.js.map +0 -1
- package/dist/core/p-354c6a6d.entry.js.map +0 -1
- package/dist/core/p-3d7ea15c.entry.js.map +0 -1
- package/dist/core/p-42636ddf.entry.js.map +0 -1
- package/dist/core/p-4af5e4f4.js +0 -3
- package/dist/core/p-4af5e4f4.js.map +0 -1
- package/dist/core/p-4c6d7b65.entry.js.map +0 -1
- package/dist/core/p-4d257c38.entry.js.map +0 -1
- package/dist/core/p-4db67975.entry.js.map +0 -1
- package/dist/core/p-50e94566.entry.js.map +0 -1
- package/dist/core/p-52dc68aa.entry.js.map +0 -1
- package/dist/core/p-58047fab.entry.js.map +0 -1
- package/dist/core/p-5957ba08.entry.js.map +0 -1
- package/dist/core/p-5d348765.entry.js.map +0 -1
- package/dist/core/p-60ff8457.entry.js +0 -2
- package/dist/core/p-60ff8457.entry.js.map +0 -1
- package/dist/core/p-63ef7826.entry.js.map +0 -1
- package/dist/core/p-683fc65e.entry.js.map +0 -1
- package/dist/core/p-6aa31f02.entry.js.map +0 -1
- package/dist/core/p-70a7e7f6.entry.js.map +0 -1
- package/dist/core/p-732f74fe.entry.js.map +0 -1
- package/dist/core/p-76e2aa52.entry.js.map +0 -1
- package/dist/core/p-7cde4bc8.entry.js.map +0 -1
- package/dist/core/p-8bebbcc7.entry.js.map +0 -1
- package/dist/core/p-90330543.entry.js.map +0 -1
- package/dist/core/p-a2f998a0.entry.js.map +0 -1
- package/dist/core/p-a4d23e73.entry.js.map +0 -1
- package/dist/core/p-a714637e.entry.js.map +0 -1
- package/dist/core/p-a89c27c1.entry.js.map +0 -1
- package/dist/core/p-b2dfef17.entry.js.map +0 -1
- package/dist/core/p-bbfa3d9e.entry.js.map +0 -1
- package/dist/core/p-bc1c8436.entry.js.map +0 -1
- package/dist/core/p-ce59c2ee.entry.js.map +0 -1
- package/dist/core/p-d8def432.entry.js.map +0 -1
- package/dist/core/p-d90a2718.entry.js.map +0 -1
- package/dist/core/p-d9e28400.entry.js.map +0 -1
- package/dist/core/p-dc94a1da.entry.js.map +0 -1
- package/dist/core/p-e1e4c8f8.entry.js.map +0 -1
- package/dist/core/p-e4bb6100.entry.js.map +0 -1
- package/dist/core/p-ebf79ea8.entry.js +0 -2
- package/dist/core/p-ebf79ea8.entry.js.map +0 -1
- package/dist/core/p-ec63daab.entry.js.map +0 -1
- package/dist/core/p-ed1e9d01.entry.js.map +0 -1
- package/dist/core/p-f1503456.entry.js.map +0 -1
- package/dist/core/p-f644cad5.entry.js.map +0 -1
- package/dist/core/p-fe8dd50e.entry.js.map +0 -1
- package/dist/custom-elements/index.d.ts +0 -399
- package/dist/custom-elements/index.js +0 -2
- package/dist/custom-elements/index.js.map +0 -1
- package/dist/esm/index-b010bfb4.js.map +0 -1
- package/dist/esm/polyfills/css-shim.js +0 -1
|
@@ -1,271 +1,2 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { F as Fragment } from './Fragment.js';
|
|
3
|
-
import { v as validateProp } from './props.js';
|
|
4
|
-
import { S as Sizes } from './sizes.js';
|
|
5
|
-
import { V as Variants } from './variants.js';
|
|
6
|
-
import { p as pick, d as delay } from './utils.js';
|
|
7
|
-
import { g as govHost, p as prepareClasses, t as toBoolAttrIfDefined } from './template.js';
|
|
8
|
-
import { a as validateWcagProp, v as validateWcagLabel } from './wcag.js';
|
|
9
|
-
import { c as canValidateWcagOnRender } from './win.js';
|
|
10
|
-
import { c as createID } from './string.utils.js';
|
|
11
|
-
import { d as defineCustomElement$4 } from './gov-button2.js';
|
|
12
|
-
import { d as defineCustomElement$3 } from './gov-form-select2.js';
|
|
13
|
-
import { d as defineCustomElement$2 } from './gov-icon2.js';
|
|
14
|
-
|
|
15
|
-
const PaginationSizes = pick(Sizes, ['_S', '_M']);
|
|
16
|
-
const PaginationVariants = pick(Variants, ['PRIMARY', 'SECONDARY']);
|
|
17
|
-
var PaginationTypes;
|
|
18
|
-
(function (PaginationTypes) {
|
|
19
|
-
PaginationTypes["BUTTON"] = "button";
|
|
20
|
-
PaginationTypes["SELECT"] = "select";
|
|
21
|
-
})(PaginationTypes || (PaginationTypes = {}));
|
|
22
|
-
const PaginationClass = {
|
|
23
|
-
root: 'gov-pagination',
|
|
24
|
-
list: 'gov-pagination__list',
|
|
25
|
-
item: 'gov-pagination__item',
|
|
26
|
-
itemArrow: 'gov-pagination__item--arrow',
|
|
27
|
-
itemMore: 'gov-pagination__item--more',
|
|
28
|
-
itemSelect: 'gov-pagination__item--select',
|
|
29
|
-
inner: 'gov-pagination__inner',
|
|
30
|
-
arrow: 'gov-pagination__arrow',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
function paginate(totalItems, currentPage = 1, pageSize = 10, maxPages = 10) {
|
|
34
|
-
// calculate total pages
|
|
35
|
-
const totalPages = Math.ceil(totalItems / pageSize);
|
|
36
|
-
// ensure current page isn't out of range
|
|
37
|
-
if (currentPage < 1) {
|
|
38
|
-
currentPage = 1;
|
|
39
|
-
}
|
|
40
|
-
else if (currentPage > totalPages) {
|
|
41
|
-
currentPage = totalPages;
|
|
42
|
-
}
|
|
43
|
-
let startPage, endPage;
|
|
44
|
-
if (totalPages <= maxPages) {
|
|
45
|
-
// total pages less than max so show all pages
|
|
46
|
-
startPage = 1;
|
|
47
|
-
endPage = totalPages;
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
// total pages more than max so calculate start and end pages
|
|
51
|
-
const maxPagesBeforeCurrentPage = Math.floor(maxPages / 2);
|
|
52
|
-
const maxPagesAfterCurrentPage = Math.ceil(maxPages / 2) - 1;
|
|
53
|
-
if (currentPage <= maxPagesBeforeCurrentPage) {
|
|
54
|
-
// current page near the start
|
|
55
|
-
startPage = 1;
|
|
56
|
-
endPage = maxPages;
|
|
57
|
-
}
|
|
58
|
-
else if (currentPage + maxPagesAfterCurrentPage >= totalPages) {
|
|
59
|
-
// current page near the end
|
|
60
|
-
startPage = totalPages - maxPages + 1;
|
|
61
|
-
endPage = totalPages;
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
// current page somewhere in the middle
|
|
65
|
-
startPage = currentPage - maxPagesBeforeCurrentPage;
|
|
66
|
-
endPage = currentPage + maxPagesAfterCurrentPage;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
// calculate start and end item indexes
|
|
70
|
-
const startIndex = (currentPage - 1) * pageSize;
|
|
71
|
-
const endIndex = Math.min(startIndex + pageSize - 1, totalItems - 1);
|
|
72
|
-
// create an array of pages to ng-repeat in the pager control
|
|
73
|
-
const pages = Array.from(Array(endPage + 1 - startPage).keys()).map(i => startPage + i);
|
|
74
|
-
// return object with all pager properties required by the view
|
|
75
|
-
return {
|
|
76
|
-
totalItems: totalItems,
|
|
77
|
-
currentPage: currentPage,
|
|
78
|
-
pageSize: pageSize,
|
|
79
|
-
totalPages: totalPages,
|
|
80
|
-
startPage: startPage,
|
|
81
|
-
endPage: endPage,
|
|
82
|
-
startIndex: startIndex,
|
|
83
|
-
endIndex: endIndex,
|
|
84
|
-
pages: pages,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const createArrayRange = (from, to) => {
|
|
89
|
-
if (Number.isInteger(from) && Number.isInteger(to)) {
|
|
90
|
-
return [...Array(to + 1).keys()].slice(from);
|
|
91
|
-
}
|
|
92
|
-
return [];
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const govPaginationCss = ".gov-pagination__list{margin:0;padding:0}.gov-pagination__list .gov-pagination__item{margin:0;padding:0;background:none}.gov-pagination__list .gov-pagination__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-pagination{position:relative;display:block;width:100%}.gov-pagination__list{display:flex;align-items:center;flex-wrap:wrap;font-weight:bold;text-align:center}.gov-pagination__list .gov-pagination__item{display:flex;justify-content:center;align-items:center;margin:0;padding:0.125rem;border-radius:var(--gov-border-radius, 0.1875rem);overflow:hidden}.gov-pagination__list .gov-pagination__item--arrow{display:flex}.gov-pagination__list .gov-pagination__item--select{z-index:1;display:flex;overflow:visible;padding:0rem 1rem}.gov-pagination__arrow{margin:0}.gov-pagination__item--more .gov-form-select select{border:none;padding-right:0.75rem !important}.gov-pagination__item--more .gov-form-select .gov-icon{display:none}.gov-pagination__inner{display:flex;justify-content:center;align-items:center;align-self:stretch;width:100%;text-decoration:none}.gov-pagination__inner[wcag-current=true][type=solid][variant=primary] .element{background-color:var(--gov-button-primary-solid-hover-bg, var(--gov-color-primary-700));color:var(--gov-button-primary-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=primary] .element{background-color:var(--gov-button-primary-outlined-hover-bg, var(--gov-color-primary-100));color:var(--gov-button-primary-outlined-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=base][variant=primary] .element{background-color:var(--gov-button-primary-base-hover-bg, var(--gov-color-primary-100));color:var(--gov-button-primary-base-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=link][variant=primary] .element{background-color:var(--gov-button-primary-link-hover-bg, transparent);color:var(--gov-button-primary-link-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=solid][variant=secondary] .element{background-color:var(--gov-button-secondary-solid-hover-bg, var(--gov-color-secondary-900));color:var(--gov-button-secondary-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=secondary] .element{background-color:var(--gov-button-secondary-outlined-hover-bg, var(--gov-color-secondary-300));color:var(--gov-button-secondary-outlined-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=base][variant=secondary] .element{background-color:var(--gov-button-secondary-base-hover-bg, var(--gov-color-secondary-300));color:var(--gov-button-secondary-base-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=link][variant=secondary] .element{background-color:var(--gov-button-secondary-link-hover-bg, transparent);color:var(--gov-button-secondary-link-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=solid][variant=error] .element{background-color:var(--gov-button-error-solid-hover-bg, var(--gov-color-error-500));color:var(--gov-button-error-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=error] .element{background-color:var(--gov-button-error-outlined-hover-bg, var(--gov-color-error-100));color:var(--gov-button-error-outlined-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=base][variant=error] .element{background-color:var(--gov-button-error-base-hover-bg, var(--gov-color-error-100));color:var(--gov-button-error-base-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=link][variant=error] .element{background-color:var(--gov-button-error-link-hover-bg, transparent);color:var(--gov-button-error-link-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=solid][variant=success] .element{background-color:var(--gov-button-success-solid-hover-bg, var(--gov-color-success-600));color:var(--gov-button-success-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=success] .element{background-color:var(--gov-button-success-outlined-hover-bg, var(--gov-color-success-100));color:var(--gov-button-success-outlined-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=base][variant=success] .element{background-color:var(--gov-button-success-base-hover-bg, var(--gov-color-success-100));color:var(--gov-button-success-base-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=link][variant=success] .element{background-color:var(--gov-button-success-link-hover-bg, transparent);color:var(--gov-button-success-link-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=solid][variant=warning] .element{background-color:var(--gov-button-warning-solid-hover-bg, var(--gov-color-warning-600));color:var(--gov-button-warning-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=warning] .element{background-color:var(--gov-button-warning-outlined-hover-bg, var(--gov-color-warning-200));color:var(--gov-button-warning-outlined-hover-color, var(--gov-color-warning-500))}.gov-pagination__inner[wcag-current=true][type=base][variant=warning] .element{background-color:var(--gov-button-warning-base-hover-bg, var(--gov-color-warning-200));color:var(--gov-button-warning-base-hover-color, var(--gov-color-warning-500))}.gov-pagination__inner[wcag-current=true][type=link][variant=warning] .element{background-color:var(--gov-button-warning-link-hover-bg, transparent);color:var(--gov-button-warning-link-hover-color, var(--gov-color-warning-500))}.gov-pagination[size=s] .gov-pagination__inner{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);font-weight:inherit}.gov-pagination[size=s] .gov-pagination__inner .element{min-width:var(--gov-pagination-s-button-size, 2rem)}.gov-pagination[size=m] .gov-pagination__inner{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);font-weight:inherit}.gov-pagination[size=m] .gov-pagination__inner .element{min-width:var(--gov-pagination-m-button-size, 2.5rem)}";
|
|
96
|
-
|
|
97
|
-
const GovPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
98
|
-
constructor() {
|
|
99
|
-
super();
|
|
100
|
-
this.__registerHost();
|
|
101
|
-
this.govPage = createEvent(this, "gov-page", 7);
|
|
102
|
-
this.type = "button";
|
|
103
|
-
this.current = 1;
|
|
104
|
-
this.total = 0;
|
|
105
|
-
this.inverse = undefined;
|
|
106
|
-
this.size = "m";
|
|
107
|
-
this.variant = "primary";
|
|
108
|
-
this.pageSize = 10;
|
|
109
|
-
this.maxPages = 5;
|
|
110
|
-
this.link = undefined;
|
|
111
|
-
this.wcagLabel = undefined;
|
|
112
|
-
this.wcagLabelledBy = undefined;
|
|
113
|
-
this.wcagSelectLabel = "Vybrat stranu";
|
|
114
|
-
this.wcagPageLabel = "Strana";
|
|
115
|
-
this.pagination = undefined;
|
|
116
|
-
this.h = govHost(this.host);
|
|
117
|
-
this.pageSelectId = createID("GovPageSelect");
|
|
118
|
-
}
|
|
119
|
-
validateType(newValue) {
|
|
120
|
-
validateProp(PaginationTypes, newValue, PaginationClass.root);
|
|
121
|
-
}
|
|
122
|
-
validateSize(newValue) {
|
|
123
|
-
validateProp(PaginationSizes, newValue, PaginationClass.root);
|
|
124
|
-
}
|
|
125
|
-
validateVariant(newValue) {
|
|
126
|
-
validateProp(PaginationVariants, newValue, PaginationClass.root);
|
|
127
|
-
}
|
|
128
|
-
recalculate() {
|
|
129
|
-
this.recalculatePagination(this.current);
|
|
130
|
-
}
|
|
131
|
-
componentWillLoad() {
|
|
132
|
-
this.recalculatePagination(this.current);
|
|
133
|
-
this.validateSize(this.size);
|
|
134
|
-
this.validateVariant(this.variant);
|
|
135
|
-
}
|
|
136
|
-
async componentDidRender() {
|
|
137
|
-
if (canValidateWcagOnRender()) {
|
|
138
|
-
await delay(500);
|
|
139
|
-
await this.validateWcag();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
recalculatePagination(currentPage) {
|
|
143
|
-
this.pagination = paginate(this.total, currentPage, this.pageSize, this.maxPages);
|
|
144
|
-
}
|
|
145
|
-
isActivePageClass(originalClass, page) {
|
|
146
|
-
if (this.pagination.currentPage === page) {
|
|
147
|
-
return originalClass + " is-active";
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
return originalClass;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
prepareLinkUrl(page) {
|
|
154
|
-
if (this.link) {
|
|
155
|
-
return String(this.link).replace("{PAGE}", String(page));
|
|
156
|
-
}
|
|
157
|
-
return undefined;
|
|
158
|
-
}
|
|
159
|
-
resetSelectValue() {
|
|
160
|
-
if (this.spreadSelectRef) {
|
|
161
|
-
this.spreadSelectRef.getRef()
|
|
162
|
-
.then((el) => {
|
|
163
|
-
el.value = '...';
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
render() {
|
|
168
|
-
const pageResolver = (page, content) => {
|
|
169
|
-
const isDisabled = page === -1;
|
|
170
|
-
const ariaCurrent = toBoolAttrIfDefined(this.pagination.currentPage === page ? true : undefined);
|
|
171
|
-
return (h("gov-button", { href: this.prepareLinkUrl(page), variant: this.variant, size: this.size, type: "base", disabled: isDisabled, "on-gov-click": (e) => this.onClickHandler(e, page), "wcag-label": page > -1 ? this.wcagPageLabel + " " + page : undefined, "wcag-current": ariaCurrent, class: PaginationClass.inner }, content));
|
|
172
|
-
};
|
|
173
|
-
return (h(Host, { class: this.h.classes(PaginationClass.root), type: this.type, variant: this.variant, size: this.size }, h("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, h("ul", { class: PaginationClass.list }, h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.currentPage > 1 ? 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-left" }))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-left" }))), this.type == "select" ? (h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemSelect]) }, h("span", { class: PaginationClass.inner }, h("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), h("gov-form-select", { size: "m", variant: this.variant, "wcag-labelled-by": this.pageSelectId, "on-gov-change": this.onSelectHandler.bind(this) }, createArrayRange(1, this.pagination.totalPages).map(page => (h("option", { value: page, selected: this.pagination.currentPage === page }, page))))))) : (h(Fragment, null, this.pagination.pages.map(page => (h("li", { class: this.isActivePageClass(PaginationClass.item, page) }, pageResolver(page, page)))), this.pagination.totalPages ? (h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemMore]) }, h("span", { class: PaginationClass.inner }, h("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), h("gov-form-select", { size: "m", variant: this.variant, "wcag-labelled-by": this.pageSelectId, ref: el => (this.spreadSelectRef = el), "on-gov-change": this.onSelectHandler.bind(this) }, h("option", { selected: true, hidden: true }, "..."), createArrayRange(1, this.pagination.totalPages).map(page => (h("option", { value: page, selected: false }, page))))))) : null)), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-right" }))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-right" })))))));
|
|
174
|
-
}
|
|
175
|
-
onClickHandler(e, page) {
|
|
176
|
-
e.stopPropagation();
|
|
177
|
-
this.recalculatePagination(page);
|
|
178
|
-
this.govPage.emit({
|
|
179
|
-
component: PaginationClass.root,
|
|
180
|
-
pagination: this.pagination
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
onSelectHandler(e) {
|
|
184
|
-
e.stopPropagation();
|
|
185
|
-
const value = e.detail.value;
|
|
186
|
-
const page = parseInt(value);
|
|
187
|
-
this.resetSelectValue();
|
|
188
|
-
if (isNaN(page) === false) {
|
|
189
|
-
this.recalculatePagination(page);
|
|
190
|
-
if (this.link) {
|
|
191
|
-
window.location.href = this.prepareLinkUrl(page);
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
this.govPage.emit({
|
|
195
|
-
component: PaginationClass.root,
|
|
196
|
-
pagination: this.pagination
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Validate the WCAG attributes of the component
|
|
203
|
-
*/
|
|
204
|
-
async validateWcag() {
|
|
205
|
-
validateWcagProp(this.wcagPageLabel, "wcag-page-label", PaginationClass.root);
|
|
206
|
-
validateWcagLabel(this.wcagLabel, this.wcagLabelledBy, PaginationClass.root);
|
|
207
|
-
}
|
|
208
|
-
get host() { return this; }
|
|
209
|
-
static get watchers() { return {
|
|
210
|
-
"type": ["validateType"],
|
|
211
|
-
"size": ["validateSize"],
|
|
212
|
-
"variant": ["validateVariant"],
|
|
213
|
-
"current": ["recalculate"],
|
|
214
|
-
"total": ["recalculate"],
|
|
215
|
-
"pageSize": ["recalculate"],
|
|
216
|
-
"maxPages": ["recalculate"]
|
|
217
|
-
}; }
|
|
218
|
-
static get style() { return govPaginationCss; }
|
|
219
|
-
}, [0, "gov-pagination", {
|
|
220
|
-
"type": [1],
|
|
221
|
-
"current": [2],
|
|
222
|
-
"total": [2],
|
|
223
|
-
"inverse": [4],
|
|
224
|
-
"size": [1],
|
|
225
|
-
"variant": [1],
|
|
226
|
-
"pageSize": [2, "page-size"],
|
|
227
|
-
"maxPages": [2, "max-pages"],
|
|
228
|
-
"link": [1],
|
|
229
|
-
"wcagLabel": [1, "wcag-label"],
|
|
230
|
-
"wcagLabelledBy": [1, "wcag-labelled-by"],
|
|
231
|
-
"wcagSelectLabel": [1, "wcag-select-label"],
|
|
232
|
-
"wcagPageLabel": [1, "wcag-page-label"],
|
|
233
|
-
"pagination": [32],
|
|
234
|
-
"validateWcag": [64]
|
|
235
|
-
}]);
|
|
236
|
-
function defineCustomElement$1() {
|
|
237
|
-
if (typeof customElements === "undefined") {
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
const components = ["gov-pagination", "gov-button", "gov-form-select", "gov-icon"];
|
|
241
|
-
components.forEach(tagName => { switch (tagName) {
|
|
242
|
-
case "gov-pagination":
|
|
243
|
-
if (!customElements.get(tagName)) {
|
|
244
|
-
customElements.define(tagName, GovPagination$1);
|
|
245
|
-
}
|
|
246
|
-
break;
|
|
247
|
-
case "gov-button":
|
|
248
|
-
if (!customElements.get(tagName)) {
|
|
249
|
-
defineCustomElement$4();
|
|
250
|
-
}
|
|
251
|
-
break;
|
|
252
|
-
case "gov-form-select":
|
|
253
|
-
if (!customElements.get(tagName)) {
|
|
254
|
-
defineCustomElement$3();
|
|
255
|
-
}
|
|
256
|
-
break;
|
|
257
|
-
case "gov-icon":
|
|
258
|
-
if (!customElements.get(tagName)) {
|
|
259
|
-
defineCustomElement$2();
|
|
260
|
-
}
|
|
261
|
-
break;
|
|
262
|
-
} });
|
|
263
|
-
}
|
|
264
|
-
defineCustomElement$1();
|
|
265
|
-
|
|
266
|
-
const GovPagination = GovPagination$1;
|
|
267
|
-
const defineCustomElement = defineCustomElement$1;
|
|
268
|
-
|
|
269
|
-
export { GovPagination, defineCustomElement };
|
|
270
|
-
|
|
1
|
+
import{p as o,H as r,c as e,h as t,d as a}from"./p-80c0109d.js";import{F as n}from"./p-1c1d0bbe.js";import{v as i}from"./p-26acf964.js";import{S as s}from"./p-55500e5a.js";import{V as g}from"./p-ff7365ae.js";import{p as c,d as l}from"./p-03990da5.js";import{g as v,p as u,t as p}from"./p-3f37ddb6.js";import{a as h,v as d}from"./p-0f5e2b0a.js";import{c as m}from"./p-34152b51.js";import{c as b}from"./p-24636c53.js";import{d as f}from"./p-efcdfed8.js";import{d as _}from"./p-20853eff.js";import{d as y}from"./p-47172f0a.js";const w=c(s,["_S","_M"]);const k=c(g,["PRIMARY","SECONDARY"]);var x;(function(o){o["BUTTON"]="button";o["SELECT"]="select"})(x||(x={}));const z={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 S(o,r=1,e=10,t=10){const a=Math.ceil(o/e);if(r<1){r=1}else if(r>a){r=a}let n,i;if(a<=t){n=1;i=a}else{const o=Math.floor(t/2);const e=Math.ceil(t/2)-1;if(r<=o){n=1;i=t}else if(r+e>=a){n=a-t+1;i=a}else{n=r-o;i=r+e}}const s=(r-1)*e;const g=Math.min(s+e-1,o-1);const c=Array.from(Array(i+1-n).keys()).map((o=>n+o));return{totalItems:o,currentPage:r,pageSize:e,totalPages:a,startPage:n,endPage:i,startIndex:s,endIndex:g,pages:c}}const j=(o,r)=>{if(Number.isInteger(o)&&Number.isInteger(r)){return[...Array(r+1).keys()].slice(o)}return[]};const P=".gov-pagination__list{margin:0;padding:0}.gov-pagination__list .gov-pagination__item{margin:0;padding:0;background:none}.gov-pagination__list .gov-pagination__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-pagination{position:relative;display:block;width:100%}.gov-pagination__list{display:flex;align-items:center;flex-wrap:wrap;font-weight:bold;text-align:center}.gov-pagination__list .gov-pagination__item{display:flex;justify-content:center;align-items:center;margin:0;padding:0.125rem;border-radius:var(--gov-border-radius, 0.1875rem);overflow:hidden}.gov-pagination__list .gov-pagination__item--arrow{display:flex}.gov-pagination__list .gov-pagination__item--select{z-index:1;display:flex;overflow:visible;padding:0rem 1rem}.gov-pagination__arrow{margin:0}.gov-pagination__item--more .gov-form-select select{border:none;padding-right:0.75rem !important}.gov-pagination__item--more .gov-form-select .gov-icon{display:none}.gov-pagination__inner{display:flex;justify-content:center;align-items:center;align-self:stretch;width:100%;text-decoration:none}.gov-pagination__inner[wcag-current=true][type=solid][variant=primary] .element{background-color:var(--gov-button-primary-solid-hover-bg, var(--gov-color-primary-700));color:var(--gov-button-primary-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=primary] .element{background-color:var(--gov-button-primary-outlined-hover-bg, var(--gov-color-primary-100));color:var(--gov-button-primary-outlined-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=base][variant=primary] .element{background-color:var(--gov-button-primary-base-hover-bg, var(--gov-color-primary-100));color:var(--gov-button-primary-base-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=link][variant=primary] .element{background-color:var(--gov-button-primary-link-hover-bg, transparent);color:var(--gov-button-primary-link-hover-color, var(--gov-color-primary))}.gov-pagination__inner[wcag-current=true][type=solid][variant=secondary] .element{background-color:var(--gov-button-secondary-solid-hover-bg, var(--gov-color-secondary-900));color:var(--gov-button-secondary-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=secondary] .element{background-color:var(--gov-button-secondary-outlined-hover-bg, var(--gov-color-secondary-300));color:var(--gov-button-secondary-outlined-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=base][variant=secondary] .element{background-color:var(--gov-button-secondary-base-hover-bg, var(--gov-color-secondary-300));color:var(--gov-button-secondary-base-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=link][variant=secondary] .element{background-color:var(--gov-button-secondary-link-hover-bg, transparent);color:var(--gov-button-secondary-link-hover-color, var(--gov-color-secondary))}.gov-pagination__inner[wcag-current=true][type=solid][variant=error] .element{background-color:var(--gov-button-error-solid-hover-bg, var(--gov-color-error-500));color:var(--gov-button-error-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=error] .element{background-color:var(--gov-button-error-outlined-hover-bg, var(--gov-color-error-100));color:var(--gov-button-error-outlined-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=base][variant=error] .element{background-color:var(--gov-button-error-base-hover-bg, var(--gov-color-error-100));color:var(--gov-button-error-base-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=link][variant=error] .element{background-color:var(--gov-button-error-link-hover-bg, transparent);color:var(--gov-button-error-link-hover-color, var(--gov-color-error))}.gov-pagination__inner[wcag-current=true][type=solid][variant=success] .element{background-color:var(--gov-button-success-solid-hover-bg, var(--gov-color-success-600));color:var(--gov-button-success-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=success] .element{background-color:var(--gov-button-success-outlined-hover-bg, var(--gov-color-success-100));color:var(--gov-button-success-outlined-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=base][variant=success] .element{background-color:var(--gov-button-success-base-hover-bg, var(--gov-color-success-100));color:var(--gov-button-success-base-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=link][variant=success] .element{background-color:var(--gov-button-success-link-hover-bg, transparent);color:var(--gov-button-success-link-hover-color, var(--gov-color-success-500))}.gov-pagination__inner[wcag-current=true][type=solid][variant=warning] .element{background-color:var(--gov-button-warning-solid-hover-bg, var(--gov-color-warning-600));color:var(--gov-button-warning-solid-hover-color, var(--gov-color-neutral-white))}.gov-pagination__inner[wcag-current=true][type=outlined][variant=warning] .element{background-color:var(--gov-button-warning-outlined-hover-bg, var(--gov-color-warning-200));color:var(--gov-button-warning-outlined-hover-color, var(--gov-color-warning-500))}.gov-pagination__inner[wcag-current=true][type=base][variant=warning] .element{background-color:var(--gov-button-warning-base-hover-bg, var(--gov-color-warning-200));color:var(--gov-button-warning-base-hover-color, var(--gov-color-warning-500))}.gov-pagination__inner[wcag-current=true][type=link][variant=warning] .element{background-color:var(--gov-button-warning-link-hover-bg, transparent);color:var(--gov-button-warning-link-hover-color, var(--gov-color-warning-500))}.gov-pagination[size=s] .gov-pagination__inner{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);font-weight:inherit}.gov-pagination[size=s] .gov-pagination__inner .element{min-width:var(--gov-pagination-s-button-size, 2rem)}.gov-pagination[size=m] .gov-pagination__inner{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);font-weight:inherit}.gov-pagination[size=m] .gov-pagination__inner .element{min-width:var(--gov-pagination-m-button-size, 2.5rem)}";const A=o(class o extends r{constructor(){super();this.__registerHost();this.govPage=e(this,"gov-page",7);this.type="button";this.current=1;this.total=0;this.inverse=undefined;this.size="m";this.variant="primary";this.pageSize=10;this.maxPages=5;this.link=undefined;this.wcagLabel=undefined;this.wcagLabelledBy=undefined;this.wcagSelectLabel="Vybrat stranu";this.wcagPageLabel="Strana";this.pagination=undefined;this.h=v(this.host);this.pageSelectId=b("GovPageSelect")}validateType(o){i(x,o,z.root)}validateSize(o){i(w,o,z.root)}validateVariant(o){i(k,o,z.root)}recalculate(){this.recalculatePagination(this.current)}componentWillLoad(){this.recalculatePagination(this.current);this.validateSize(this.size);this.validateVariant(this.variant)}async componentDidRender(){if(m()){await l(500);await this.validateWcag()}}recalculatePagination(o){this.pagination=S(this.total,o,this.pageSize,this.maxPages)}isActivePageClass(o,r){if(this.pagination.currentPage===r){return o+" is-active"}else{return o}}prepareLinkUrl(o){if(this.link){return String(this.link).replace("{PAGE}",String(o))}return undefined}resetSelectValue(){if(this.spreadSelectRef){this.spreadSelectRef.getRef().then((o=>{o.value="..."}))}}render(){const o=(o,r)=>{const e=o===-1;const a=p(this.pagination.currentPage===o?true:undefined);return t("gov-button",{href:this.prepareLinkUrl(o),variant:this.variant,size:this.size,type:"base",disabled:e,"on-gov-click":r=>this.onClickHandler(r,o),"wcag-label":o>-1?this.wcagPageLabel+" "+o:undefined,"wcag-current":a,class:z.inner},r)};return t(a,{class:this.h.classes(z.root),type:this.type,variant:this.variant,size:this.size},t("nav",{"aria-label":this.wcagLabel,"aria-labelledby":this.wcagLabelledBy},t("ul",{class:z.list},t("li",{class:u([z.item,z.itemArrow])},o(this.pagination.currentPage>1?1:-1,t("gov-icon",{class:z.arrow,name:"chevron-double-left"}))),t("li",{class:u([z.item,z.itemArrow])},o(this.pagination.startPage<this.pagination.currentPage?this.pagination.currentPage-1:-1,t("gov-icon",{class:z.arrow,name:"chevron-left"}))),this.type=="select"?t("li",{class:u([z.item,z.itemSelect])},t("span",{class:z.inner},t("span",{id:this.pageSelectId,hidden:true},this.wcagSelectLabel),t("gov-form-select",{size:"m",variant:this.variant,"wcag-labelled-by":this.pageSelectId,"on-gov-change":this.onSelectHandler.bind(this)},j(1,this.pagination.totalPages).map((o=>t("option",{value:o,selected:this.pagination.currentPage===o},o)))))):t(n,null,this.pagination.pages.map((r=>t("li",{class:this.isActivePageClass(z.item,r)},o(r,r)))),this.pagination.totalPages?t("li",{class:u([z.item,z.itemMore])},t("span",{class:z.inner},t("span",{id:this.pageSelectId,hidden:true},this.wcagSelectLabel),t("gov-form-select",{size:"m",variant:this.variant,"wcag-labelled-by":this.pageSelectId,ref:o=>this.spreadSelectRef=o,"on-gov-change":this.onSelectHandler.bind(this)},t("option",{selected:true,hidden:true},"..."),j(1,this.pagination.totalPages).map((o=>t("option",{value:o,selected:false},o)))))):null),t("li",{class:u([z.item,z.itemArrow])},o(this.pagination.totalPages>this.pagination.currentPage?this.pagination.currentPage+1:-1,t("gov-icon",{class:z.arrow,name:"chevron-right"}))),t("li",{class:u([z.item,z.itemArrow])},o(this.pagination.totalPages>this.pagination.currentPage?this.pagination.totalPages:-1,t("gov-icon",{class:z.arrow,name:"chevron-double-right"}))))))}onClickHandler(o,r){o.stopPropagation();this.recalculatePagination(r);this.govPage.emit({component:z.root,pagination:this.pagination})}onSelectHandler(o){o.stopPropagation();const r=o.detail.value;const e=parseInt(r);this.resetSelectValue();if(isNaN(e)===false){this.recalculatePagination(e);if(this.link){window.location.href=this.prepareLinkUrl(e)}else{this.govPage.emit({component:z.root,pagination:this.pagination})}}}async validateWcag(){h(this.wcagPageLabel,"wcag-page-label",z.root);d(this.wcagLabel,this.wcagLabelledBy,z.root)}get host(){return this}static get watchers(){return{type:["validateType"],size:["validateSize"],variant:["validateVariant"],current:["recalculate"],total:["recalculate"],pageSize:["recalculate"],maxPages:["recalculate"]}}static get style(){return P}},[0,"gov-pagination",{type:[1],current:[2],total:[2],inverse:[4],size:[1],variant:[1],pageSize:[2,"page-size"],maxPages:[2,"max-pages"],link:[1],wcagLabel:[1,"wcag-label"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagSelectLabel:[1,"wcag-select-label"],wcagPageLabel:[1,"wcag-page-label"],pagination:[32],validateWcag:[64]}]);function E(){if(typeof customElements==="undefined"){return}const o=["gov-pagination","gov-button","gov-form-select","gov-icon"];o.forEach((o=>{switch(o){case"gov-pagination":if(!customElements.get(o)){customElements.define(o,A)}break;case"gov-button":if(!customElements.get(o)){f()}break;case"gov-form-select":if(!customElements.get(o)){_()}break;case"gov-icon":if(!customElements.get(o)){y()}break}}))}E();const M=A;const L=E;export{M as GovPagination,L as defineCustomElement};
|
|
271
2
|
//# sourceMappingURL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KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAA;IAC5B,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC5B,IAAI,CAAC,gBAAgB,EAAE,CAAA;IACvB,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,EAAE;MAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;MAChC,IAAI,IAAI,CAAC,IAAI,EAAE;QACd,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;OAChD;WAAM;QACN,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;UACjB,SAAS,EAAE,eAAe,CAAC,IAAI;UAC/B,UAAU,EAAE,IAAI,CAAC,UAAU;SAC3B,CAAC,CAAA;OACF;KACD;GACD;;;;EAMD,MAAM,YAAY;IACjB,gBAAgB,CAAC,IAAI,CAAC,aAAa,EAAE,iBAAiB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IAC7E,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;GAC5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovPagination"],"sources":["../../../packages/core/src/components/gov-pagination/constants.ts","../../../packages/core/src/components/gov-pagination/pagination.ts","../../../packages/core/src/utils/array.utils.ts","../../../packages/core/src/components/gov-pagination/gov-pagination.scss?tag=gov-pagination","../../../packages/core/src/components/gov-pagination/gov-pagination.tsx"],"sourcesContent":["import { Sizes } from '../../core/constants/sizes'\nimport { Variants } from '../../core/constants/variants'\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 PaginationVariants = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type PaginationVariantType = `${ValueOf<typeof PaginationVariants>}`\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","export const createArrayRange = (from: number, to: number): number[] => {\n\tif (Number.isInteger(from) && Number.isInteger(to)) {\n\t\treturn [...Array(to + 1).keys()].slice(from)\n\t}\n\treturn []\n}\n","/*\n * Pagination\n */\n\n$class: \".gov-pagination\";\n\n#{$class} {\n\t@include base();\n\t&__list {\n\t\t@extend %reset-ul;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t\tfont-weight: bold;\n\t\ttext-align: center;\n\t}\n\t&__list &__item {\n\t\t@extend %reset-ul-li;\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\tmargin: 0;\n\t\tpadding: rem-calc(2);\n\t\tborder-radius: $border-radius;\n\t\toverflow: hidden;\n\t\t&--arrow {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t&--select {\n\t\t\tz-index: 1;\n\t\t\tdisplay: flex;\n\t\t\toverflow: visible;\n\t\t\tpadding: rem-calc(0 16);\n\t\t}\n\t}\n\t&__arrow {\n\t\tmargin: 0;\n\t}\n\t&__item--more {\n\t\t.gov-form-select {\n\t\t\tselect {\n\t\t\t\tborder: none;\n\t\t\t\tpadding-right: rem-calc(12) !important;\n\t\t\t}\n\t\t\t.gov-icon {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t}\n\t&__inner {\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\talign-self: stretch;\n\t\twidth: 100%;\n\t\ttext-decoration: none;\n\t\t// Use hover styles from gov-button to active page button\n\t\t&[wcag-current=\"true\"] {\n\t\t\t@each $variant, $types in $button-variants {\n\t\t\t\t@each $type, $definitions in $types {\n\t\t\t\t\t&[type=\"#{$type}\"][variant=\"#{$variant}\"] {\n\t\t\t\t\t\t.element {\n\t\t\t\t\t\t\tbackground-color: deep-map-get($button-variants, $variant, $type, \"hover-bg\");\n\t\t\t\t\t\t\tcolor: deep-map-get($button-variants, $variant, $type, \"hover-color\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $pagination-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__inner {\n\t\t\t\t\t@include typography(get(\"font\", $definitions));\n\t\t\t\t\tfont-weight: inherit;\n\t\t\t\t\t.element {\n\t\t\t\t\t\tmin-width: get(\"button-size\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import Fragment from \"../../helpers/Fragment\"\nimport { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport {\n\tPaginationClass,\n\tPaginationSizeType,\n\tPaginationSizes,\n\tPaginationVariantType,\n\tPaginationType,\n\tPaginationTypes,\n\tPaginationVariants,\n} from \"./constants\"\nimport { govHost, prepareClasses } from \"../../helpers/Dom/template\"\nimport { paginate, Pagination } from \"./pagination\"\nimport { toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\nimport { validateWcagLabel, validateWcagProp } from \"../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../helpers/Dom/win\"\nimport { delay } from \"../../utils/utils\"\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\"\n\n@Component({\n\ttag: \"gov-pagination\",\n\tstyleUrl: \"gov-pagination.scss\",\n})\nexport class GovPagination {\n\tprivate h: GovHost\n\tprivate readonly pageSelectId: string\n\n\tprivate spreadSelectRef?: HTMLGovFormSelectElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.pageSelectId = createID(\"GovPageSelect\")\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 * Set on active page\n\t */\n\t@Prop() readonly inverse: boolean\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 variant?: PaginationVariantType = \"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 pagination that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: \"wcag-label\" }) readonly wcagLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Adds accessible label for the page select\n\t */\n\t@Prop({ attribute: \"wcag-select-label\" }) readonly wcagSelectLabel: string = \"Vybrat stranu\"\n\t/**\n\t * Adds accessible label for the page item\n\t */\n\t@Prop({ attribute: \"wcag-page-label\" }) readonly wcagPageLabel: string = \"Strana\"\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\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(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(PaginationVariants, 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\tcomponentWillLoad() {\n\t\tthis.recalculatePagination(this.current)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateVariant(this.variant)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\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) => {\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\tvariant={this.variant}\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={page > -1 ? this.wcagPageLabel + \" \" + page : undefined}\n\t\t\t\t\twcag-current={ariaCurrent}\n\t\t\t\t\tclass={PaginationClass.inner}>\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} variant={this.variant} size={this.size}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\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)}\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)}\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.wcagSelectLabel}\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=\"m\"\n\t\t\t\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\t\t\t\twcag-labelled-by={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.wcagSelectLabel}\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=\"m\"\n\t\t\t\t\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\t\t\t\t\twcag-labelled-by={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)}\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)}\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\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagProp(this.wcagPageLabel, \"wcag-page-label\", PaginationClass.root)\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, PaginationClass.root)\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"version":3,"names":["PaginationSizes","pick","Sizes","PaginationVariants","Variants","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","createArrayRange","to","Number","isInteger","slice","govPaginationCss","GovPagination","proxyCustomElement","H","constructor","this","h","govHost","host","pageSelectId","createID","validateType","newValue","validateProp","validateSize","validateVariant","recalculate","recalculatePagination","current","componentWillLoad","size","variant","componentDidRender","canValidateWcagOnRender","delay","validateWcag","pagination","total","isActivePageClass","originalClass","page","prepareLinkUrl","link","String","replace","undefined","resetSelectValue","spreadSelectRef","getRef","then","el","value","render","pageResolver","content","isDisabled","ariaCurrent","toBoolAttrIfDefined","href","type","disabled","e","onClickHandler","wcagPageLabel","class","Host","classes","wcagLabel","wcagLabelledBy","prepareClasses","name","id","hidden","wcagSelectLabel","onSelectHandler","bind","selected","Fragment","ref","stopPropagation","govPage","emit","component","detail","parseInt","isNaN","window","location","validateWcagProp","validateWcagLabel"],"sources":["../../../packages/core/src/components/gov-pagination/constants.ts","../../../packages/core/src/components/gov-pagination/pagination.ts","../../../packages/core/src/utils/array.utils.ts","../../../packages/core/src/components/gov-pagination/gov-pagination.scss?tag=gov-pagination","../../../packages/core/src/components/gov-pagination/gov-pagination.tsx"],"sourcesContent":["import { Sizes } from '../../core/constants/sizes'\nimport { Variants } from '../../core/constants/variants'\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 PaginationVariants = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type PaginationVariantType = `${ValueOf<typeof PaginationVariants>}`\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","export const createArrayRange = (from: number, to: number): number[] => {\n\tif (Number.isInteger(from) && Number.isInteger(to)) {\n\t\treturn [...Array(to + 1).keys()].slice(from)\n\t}\n\treturn []\n}\n","/*\n * Pagination\n */\n\n$class: \".gov-pagination\";\n\n#{$class} {\n\t@include base();\n\t&__list {\n\t\t@extend %reset-ul;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t\tfont-weight: bold;\n\t\ttext-align: center;\n\t}\n\t&__list &__item {\n\t\t@extend %reset-ul-li;\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\tmargin: 0;\n\t\tpadding: rem-calc(2);\n\t\tborder-radius: $border-radius;\n\t\toverflow: hidden;\n\t\t&--arrow {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t&--select {\n\t\t\tz-index: 1;\n\t\t\tdisplay: flex;\n\t\t\toverflow: visible;\n\t\t\tpadding: rem-calc(0 16);\n\t\t}\n\t}\n\t&__arrow {\n\t\tmargin: 0;\n\t}\n\t&__item--more {\n\t\t.gov-form-select {\n\t\t\tselect {\n\t\t\t\tborder: none;\n\t\t\t\tpadding-right: rem-calc(12) !important;\n\t\t\t}\n\t\t\t.gov-icon {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t}\n\t&__inner {\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\talign-self: stretch;\n\t\twidth: 100%;\n\t\ttext-decoration: none;\n\t\t// Use hover styles from gov-button to active page button\n\t\t&[wcag-current=\"true\"] {\n\t\t\t@each $variant, $types in $button-variants {\n\t\t\t\t@each $type, $definitions in $types {\n\t\t\t\t\t&[type=\"#{$type}\"][variant=\"#{$variant}\"] {\n\t\t\t\t\t\t.element {\n\t\t\t\t\t\t\tbackground-color: deep-map-get($button-variants, $variant, $type, \"hover-bg\");\n\t\t\t\t\t\t\tcolor: deep-map-get($button-variants, $variant, $type, \"hover-color\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $pagination-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__inner {\n\t\t\t\t\t@include typography(get(\"font\", $definitions));\n\t\t\t\t\tfont-weight: inherit;\n\t\t\t\t\t.element {\n\t\t\t\t\t\tmin-width: get(\"button-size\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import Fragment from \"../../helpers/Fragment\"\nimport { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport {\n\tPaginationClass,\n\tPaginationSizeType,\n\tPaginationSizes,\n\tPaginationVariantType,\n\tPaginationType,\n\tPaginationTypes,\n\tPaginationVariants,\n} from \"./constants\"\nimport { govHost, prepareClasses } from \"../../helpers/Dom/template\"\nimport { paginate, Pagination } from \"./pagination\"\nimport { toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\nimport { validateWcagLabel, validateWcagProp } from \"../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../helpers/Dom/win\"\nimport { delay } from \"../../utils/utils\"\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\"\n\n@Component({\n\ttag: \"gov-pagination\",\n\tstyleUrl: \"gov-pagination.scss\",\n})\nexport class GovPagination {\n\tprivate h: GovHost\n\tprivate readonly pageSelectId: string\n\n\tprivate spreadSelectRef?: HTMLGovFormSelectElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.pageSelectId = createID(\"GovPageSelect\")\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 * Set on active page\n\t */\n\t@Prop() readonly inverse: boolean\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 variant?: PaginationVariantType = \"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 pagination that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: \"wcag-label\" }) readonly wcagLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Adds accessible label for the page select\n\t */\n\t@Prop({ attribute: \"wcag-select-label\" }) readonly wcagSelectLabel: string = \"Vybrat stranu\"\n\t/**\n\t * Adds accessible label for the page item\n\t */\n\t@Prop({ attribute: \"wcag-page-label\" }) readonly wcagPageLabel: string = \"Strana\"\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\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(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(PaginationVariants, 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\tcomponentWillLoad() {\n\t\tthis.recalculatePagination(this.current)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateVariant(this.variant)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\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) => {\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\tvariant={this.variant}\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={page > -1 ? this.wcagPageLabel + \" \" + page : undefined}\n\t\t\t\t\twcag-current={ariaCurrent}\n\t\t\t\t\tclass={PaginationClass.inner}>\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} variant={this.variant} size={this.size}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\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)}\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)}\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.wcagSelectLabel}\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=\"m\"\n\t\t\t\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\t\t\t\twcag-labelled-by={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.wcagSelectLabel}\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=\"m\"\n\t\t\t\t\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\t\t\t\t\twcag-labelled-by={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)}\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)}\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\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagProp(this.wcagPageLabel, \"wcag-page-label\", PaginationClass.root)\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, PaginationClass.root)\n\t}\n}\n"],"mappings":"4gBAKO,MAAMA,EAAkBC,EAAKC,EAAO,CAAC,KAAM,OAG3C,MAAMC,EAAqBF,EAAKG,EAAU,CAAC,UAAW,cAG7D,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,EA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{ c as createID } from './string.utils.js';
|
|
3
|
-
import { b as validateWcagRef } from './wcag.js';
|
|
4
|
-
import { M as ModalClass } from './constants8.js';
|
|
5
|
-
import { c as canValidateWcagOnRender } from './win.js';
|
|
6
|
-
import { d as delay } from './utils.js';
|
|
7
|
-
import { g as govHost, a as toBoolAttr } from './template.js';
|
|
8
|
-
import { g as govErrorLog } from './gov.log.js';
|
|
9
|
-
import { d as defineCustomElement$4 } from './gov-backdrop2.js';
|
|
10
|
-
import { d as defineCustomElement$3 } from './gov-button2.js';
|
|
11
|
-
import { d as defineCustomElement$2 } from './gov-icon2.js';
|
|
12
|
-
|
|
13
|
-
const govPromptCss = ".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 2rem) / 2)}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=\"\"],.gov-modal[open=true i],.gov-modal[open=\"1\"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__close{padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 2.5rem) / 2)}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}";
|
|
14
|
-
|
|
15
|
-
const GovPrompt$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super();
|
|
18
|
-
this.__registerHost();
|
|
19
|
-
this.govClose = createEvent(this, "gov-close", 7);
|
|
20
|
-
this.open = false;
|
|
21
|
-
this.label = undefined;
|
|
22
|
-
this.role = "dialog";
|
|
23
|
-
this.labelTag = "h2";
|
|
24
|
-
this.wcagLabelledBy = undefined;
|
|
25
|
-
this.wcagDescribedBy = undefined;
|
|
26
|
-
this.wcagCloseLabel = undefined;
|
|
27
|
-
this.wcagCloseLabelledBy = undefined;
|
|
28
|
-
this.h = govHost(this.host);
|
|
29
|
-
this.labelId = createID("GovPromptLabel");
|
|
30
|
-
this.contentId = createID("GovPromptContent");
|
|
31
|
-
}
|
|
32
|
-
validateLabelTag(newValue) {
|
|
33
|
-
const validTags = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
34
|
-
if (newValue) {
|
|
35
|
-
if (!validTags.includes(newValue)) {
|
|
36
|
-
govErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
watchOpen(newValue) {
|
|
41
|
-
this.open = newValue;
|
|
42
|
-
}
|
|
43
|
-
showModal() {
|
|
44
|
-
this.open = true;
|
|
45
|
-
document.body.classList.add(ModalClass.bodyFix);
|
|
46
|
-
}
|
|
47
|
-
hideModal() {
|
|
48
|
-
this.open = false;
|
|
49
|
-
document.body.classList.remove(ModalClass.bodyFix);
|
|
50
|
-
}
|
|
51
|
-
async componentWillRender() {
|
|
52
|
-
if (this.open) {
|
|
53
|
-
this.showModal();
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
this.hideModal();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
async componentDidRender() {
|
|
60
|
-
if (canValidateWcagOnRender()) {
|
|
61
|
-
await delay(500);
|
|
62
|
-
await this.validateWcag();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
render() {
|
|
66
|
-
const LabelTag = this.labelTag;
|
|
67
|
-
return (h(Host, { class: this.h.classes(ModalClass.rootPrompt), open: this.open }, h("dialog", { class: ModalClass.dialog, hidden: !this.open, tabindex: "-1", open: this.open, "aria-modal": "true", "aria-hidden": toBoolAttr(!this.open), "aria-labelledby": this.wcagLabelledBy || this.labelId, "aria-describedby": this.wcagDescribedBy || this.contentId, role: this.role }, h("div", { class: ModalClass.inner }, h("div", { class: ModalClass.header }, this.h.hasSlot("icon") && (h("div", { class: ModalClass.icon }, h("slot", { name: "icon" }))), this.label && (h(LabelTag, { class: ModalClass.title, id: this.labelId }, this.label)), h("gov-button", { class: ModalClass.close, variant: "primary", wcagLabel: this.wcagCloseLabel, wcagLabelledBy: this.wcagCloseLabelledBy, type: "base", "on-gov-click": this.onCloseHandler.bind(this) }, h("gov-icon", { name: "x-lg" }))), h("div", { class: ModalClass.content, id: this.contentId }, h("slot", null)), h("div", { class: ModalClass.actions }, h("slot", { name: "actions" })))), this.open ? (h("gov-backdrop", { "wcag-label": this.wcagCloseLabel, "wcag-labelled-by": this.wcagCloseLabelledBy, "on-gov-click": this.onCloseHandler.bind(this) })) : null));
|
|
68
|
-
}
|
|
69
|
-
onCloseHandler(e) {
|
|
70
|
-
e.stopPropagation();
|
|
71
|
-
this.hideModal();
|
|
72
|
-
this.govClose.emit(e);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Showing the modal
|
|
76
|
-
*/
|
|
77
|
-
async show() {
|
|
78
|
-
this.showModal();
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Hiding the modal
|
|
82
|
-
*/
|
|
83
|
-
async hide() {
|
|
84
|
-
this.hideModal();
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Validate the WCAG attributes of the component
|
|
88
|
-
*/
|
|
89
|
-
async validateWcag() {
|
|
90
|
-
validateWcagRef(this.wcagLabelledBy, "wcag-labelled-by", ModalClass.root);
|
|
91
|
-
validateWcagRef(this.wcagDescribedBy, "wcag-described-by", ModalClass.root);
|
|
92
|
-
}
|
|
93
|
-
get host() { return this; }
|
|
94
|
-
static get watchers() { return {
|
|
95
|
-
"labelTag": ["validateLabelTag"],
|
|
96
|
-
"open": ["watchOpen"]
|
|
97
|
-
}; }
|
|
98
|
-
static get style() { return govPromptCss; }
|
|
99
|
-
}, [4, "gov-prompt", {
|
|
100
|
-
"open": [1028],
|
|
101
|
-
"label": [1],
|
|
102
|
-
"role": [1],
|
|
103
|
-
"labelTag": [1, "label-tag"],
|
|
104
|
-
"wcagLabelledBy": [1, "wcag-labelled-by"],
|
|
105
|
-
"wcagDescribedBy": [1, "wcag-described-by"],
|
|
106
|
-
"wcagCloseLabel": [1, "wcag-close-label"],
|
|
107
|
-
"wcagCloseLabelledBy": [1, "wcag-close-labelled-by"],
|
|
108
|
-
"show": [64],
|
|
109
|
-
"hide": [64],
|
|
110
|
-
"validateWcag": [64]
|
|
111
|
-
}]);
|
|
112
|
-
function defineCustomElement$1() {
|
|
113
|
-
if (typeof customElements === "undefined") {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
const components = ["gov-prompt", "gov-backdrop", "gov-button", "gov-icon"];
|
|
117
|
-
components.forEach(tagName => { switch (tagName) {
|
|
118
|
-
case "gov-prompt":
|
|
119
|
-
if (!customElements.get(tagName)) {
|
|
120
|
-
customElements.define(tagName, GovPrompt$1);
|
|
121
|
-
}
|
|
122
|
-
break;
|
|
123
|
-
case "gov-backdrop":
|
|
124
|
-
if (!customElements.get(tagName)) {
|
|
125
|
-
defineCustomElement$4();
|
|
126
|
-
}
|
|
127
|
-
break;
|
|
128
|
-
case "gov-button":
|
|
129
|
-
if (!customElements.get(tagName)) {
|
|
130
|
-
defineCustomElement$3();
|
|
131
|
-
}
|
|
132
|
-
break;
|
|
133
|
-
case "gov-icon":
|
|
134
|
-
if (!customElements.get(tagName)) {
|
|
135
|
-
defineCustomElement$2();
|
|
136
|
-
}
|
|
137
|
-
break;
|
|
138
|
-
} });
|
|
139
|
-
}
|
|
140
|
-
defineCustomElement$1();
|
|
141
|
-
|
|
142
|
-
const GovPrompt = GovPrompt$1;
|
|
143
|
-
const defineCustomElement = defineCustomElement$1;
|
|
144
|
-
|
|
145
|
-
export { GovPrompt, defineCustomElement };
|
|
146
|
-
|
|
1
|
+
import{p as o,H as e,c as a,h as t,d as i}from"./p-80c0109d.js";import{c as s}from"./p-24636c53.js";import{b as r}from"./p-0f5e2b0a.js";import{M as l}from"./p-be4aab0e.js";import{c as d}from"./p-34152b51.js";import{d as n}from"./p-03990da5.js";import{g as m,a as g}from"./p-3f37ddb6.js";import{a as c}from"./p-561fa17b.js";import{d as v}from"./p-386409dc.js";import{d as p}from"./p-efcdfed8.js";import{d as h}from"./p-47172f0a.js";const f='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 2rem) / 2)}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=""],.gov-modal[open=true i],.gov-modal[open="1"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__close{padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 2.5rem) / 2)}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const b=o(class o extends e{constructor(){super();this.__registerHost();this.govClose=a(this,"gov-close",7);this.open=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.wcagCloseLabel=undefined;this.wcagCloseLabelledBy=undefined;this.h=m(this.host);this.labelId=s("GovPromptLabel");this.contentId=s("GovPromptContent")}validateLabelTag(o){const e=["h1","h2","h3","h4","h5","h6"];if(o){if(!e.includes(o)){c(`[${l.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o}showModal(){this.open=true;document.body.classList.add(l.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(l.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(d()){await n(500);await this.validateWcag()}}render(){const o=this.labelTag;return t(i,{class:this.h.classes(l.rootPrompt),open:this.open},t("dialog",{class:l.dialog,hidden:!this.open,tabindex:"-1",open:this.open,"aria-modal":"true","aria-hidden":g(!this.open),"aria-labelledby":this.wcagLabelledBy||this.labelId,"aria-describedby":this.wcagDescribedBy||this.contentId,role:this.role},t("div",{class:l.inner},t("div",{class:l.header},this.h.hasSlot("icon")&&t("div",{class:l.icon},t("slot",{name:"icon"})),this.label&&t(o,{class:l.title,id:this.labelId},this.label),t("gov-button",{class:l.close,variant:"primary",wcagLabel:this.wcagCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base","on-gov-click":this.onCloseHandler.bind(this)},t("gov-icon",{name:"x-lg"}))),t("div",{class:l.content,id:this.contentId},t("slot",null)),t("div",{class:l.actions},t("slot",{name:"actions"})))),this.open?t("gov-backdrop",{"wcag-label":this.wcagCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(o){o.stopPropagation();this.hideModal();this.govClose.emit(o)}async show(){this.showModal()}async hide(){this.hideModal()}async validateWcag(){r(this.wcagLabelledBy,"wcag-labelled-by",l.root);r(this.wcagDescribedBy,"wcag-described-by",l.root)}get host(){return this}static get watchers(){return{labelTag:["validateLabelTag"],open:["watchOpen"]}}static get style(){return f}},[4,"gov-prompt",{open:[1028],label:[1],role:[1],labelTag:[1,"label-tag"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagDescribedBy:[1,"wcag-described-by"],wcagCloseLabel:[1,"wcag-close-label"],wcagCloseLabelledBy:[1,"wcag-close-labelled-by"],show:[64],hide:[64],validateWcag:[64]}]);function u(){if(typeof customElements==="undefined"){return}const o=["gov-prompt","gov-backdrop","gov-button","gov-icon"];o.forEach((o=>{switch(o){case"gov-prompt":if(!customElements.get(o)){customElements.define(o,b)}break;case"gov-backdrop":if(!customElements.get(o)){v()}break;case"gov-button":if(!customElements.get(o)){p()}break;case"gov-icon":if(!customElements.get(o)){h()}break}}))}u();const _=b;const w=u;export{_ as GovPrompt,w as defineCustomElement};
|
|
147
2
|
//# sourceMappingURL=gov-prompt.js.map
|