@gov-design-system-ce/components 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{constants-5f6bbc50.js → constants-245999e7.js} +3 -2
- package/dist/cjs/constants-245999e7.js.map +1 -0
- package/dist/cjs/{constants-dc2ba6bd.js → constants-61f8be34.js} +3 -3
- package/dist/cjs/constants-61f8be34.js.map +1 -0
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-accordion-item.cjs.entry.js +2 -2
- package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-accordion.cjs.entry.js +2 -1
- package/dist/cjs/gov-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-alert.cjs.entry.js +1 -1
- package/dist/cjs/gov-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-app.cjs.entry.js +658 -159
- 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-attachments_3.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-backdrop.cjs.entry.js +4 -3
- package/dist/cjs/gov-backdrop.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-badge.cjs.entry.js +17 -17
- package/dist/cjs/gov-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-button.cjs.entry.js +2 -2
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-card.cjs.entry.js +1 -1
- package/dist/cjs/gov-card.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-input.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +3 -3
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-password-power.cjs.entry.js +28 -0
- package/dist/cjs/gov-form-password-power.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-form-select.cjs.entry.js +3 -3
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/cjs/gov-modal.cjs.entry.js +19 -13
- package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js +49 -14
- package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-prompt.cjs.entry.js +12 -6
- package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-side-nav-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-side-nav-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-spacer.cjs.entry.js +1 -1
- package/dist/cjs/gov-spacer.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-statsbar.cjs.entry.js +2 -2
- package/dist/cjs/gov-statsbar.cjs.entry.js.map +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 +2 -2
- package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tiles.cjs.entry.js +2 -1
- package/dist/cjs/gov-tiles.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-toast.cjs.entry.js +1 -1
- package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizzard-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-wizzard-item.cjs.entry.js.map +1 -1
- package/dist/cjs/index-356717ae.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/gov-accordion/gov-accordion-item.css +37 -5
- package/dist/collection/components/gov-accordion/gov-accordion-item.js +1 -1
- package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
- package/dist/collection/components/gov-accordion/gov-accordion.css +6 -0
- package/dist/collection/components/gov-accordion/gov-accordion.js +19 -0
- package/dist/collection/components/gov-accordion/gov-accordion.js.map +1 -1
- package/dist/collection/components/gov-alert/gov-alert.css +3 -0
- package/dist/collection/components/gov-alert/gov-alert.js +1 -1
- package/dist/collection/components/gov-alert/gov-alert.js.map +1 -1
- package/dist/collection/components/gov-app/gov-app.css +3 -0
- package/dist/collection/components/gov-attachments/gov-attachments-item.css +3 -0
- package/dist/collection/components/gov-attachments/gov-attachments-item.js +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments-item.js.map +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments.css +3 -0
- package/dist/collection/components/gov-backdrop/gov-backdrop.css +3 -0
- package/dist/collection/components/gov-backdrop/gov-backdrop.js +5 -4
- package/dist/collection/components/gov-backdrop/gov-backdrop.js.map +1 -1
- package/dist/collection/components/gov-badge/constants.js +4 -1
- package/dist/collection/components/gov-badge/constants.js.map +1 -1
- package/dist/collection/components/gov-badge/gov-badge.css +204 -96
- package/dist/collection/components/gov-badge/gov-badge.js +26 -47
- package/dist/collection/components/gov-badge/gov-badge.js.map +1 -1
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +3 -0
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +1 -1
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
- package/dist/collection/components/gov-button/constants.js +2 -1
- package/dist/collection/components/gov-button/constants.js.map +1 -1
- package/dist/collection/components/gov-button/gov-button.css +210 -131
- package/dist/collection/components/gov-button/gov-button.js +6 -6
- package/dist/collection/components/gov-button/gov-button.js.map +1 -1
- package/dist/collection/components/gov-card/gov-card.css +3 -0
- package/dist/collection/components/gov-card/gov-card.js +1 -1
- package/dist/collection/components/gov-card/gov-card.js.map +1 -1
- package/dist/collection/components/gov-container/gov-container.css +3 -0
- package/dist/collection/components/gov-cookiebar/gov-cookiebar.css +3 -0
- package/dist/collection/components/gov-empty/gov-empty.css +3 -0
- package/dist/collection/components/gov-error-code/gov-error-code.css +3 -0
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.css +3 -0
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.css +3 -0
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +1 -1
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
- package/dist/collection/components/gov-form/control/gov-form-control.css +3 -0
- package/dist/collection/components/gov-form/file/gov-form-file.css +3 -0
- package/dist/collection/components/gov-form/file/gov-form-file.js +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-form/group/gov-form-group.css +3 -0
- package/dist/collection/components/gov-form/input/gov-form-input.css +6 -3
- package/dist/collection/components/gov-form/input/gov-form-input.js +1 -1
- package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
- package/dist/collection/components/gov-form/label/gov-form-label.css +3 -0
- package/dist/collection/components/gov-form/message/gov-form-message.css +3 -0
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +3 -3
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +2 -2
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
- package/dist/collection/components/gov-form/password-power/constants.js +6 -0
- package/dist/collection/components/gov-form/password-power/constants.js.map +1 -0
- package/dist/collection/components/gov-form/password-power/gov-form-password-power.css +246 -0
- package/dist/collection/components/gov-form/password-power/gov-form-password-power.js +43 -0
- package/dist/collection/components/gov-form/password-power/gov-form-password-power.js.map +1 -0
- package/dist/collection/components/gov-form/radio/gov-form-radio.css +3 -0
- package/dist/collection/components/gov-form/search/gov-form-search.css +3 -0
- package/dist/collection/components/gov-form/select/gov-form-select.css +3 -3
- package/dist/collection/components/gov-form/select/gov-form-select.js +2 -2
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.css +3 -0
- package/dist/collection/components/gov-grid/gov-grid-item.css +3 -0
- package/dist/collection/components/gov-grid/gov-grid.css +3 -0
- package/dist/collection/components/gov-icon/gov-icon.css +3 -0
- package/dist/collection/components/gov-icon/list.js +148 -5
- package/dist/collection/components/gov-icon/list.js.map +1 -1
- package/dist/collection/components/gov-layout/gov-layout-column.css +3 -0
- package/dist/collection/components/gov-layout/gov-layout.css +3 -0
- package/dist/collection/components/gov-loading/gov-loading.css +3 -0
- package/dist/collection/components/gov-message/gov-message.css +3 -0
- package/dist/collection/components/gov-modal/gov-modal.css +6 -3
- package/dist/collection/components/gov-modal/gov-modal.js +35 -22
- package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
- package/dist/collection/components/gov-nav/gov-nav-item.css +3 -0
- package/dist/collection/components/gov-nav/gov-nav.css +3 -0
- package/dist/collection/components/gov-pagination/gov-pagination.css +87 -39
- package/dist/collection/components/gov-pagination/gov-pagination.js +63 -29
- package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
- package/dist/collection/components/gov-promp/gov-prompt.css +6 -3
- package/dist/collection/components/gov-promp/gov-prompt.js +18 -5
- package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
- package/dist/collection/components/gov-side-nav/gov-side-nav-item.css +3 -0
- package/dist/collection/components/gov-side-nav/gov-side-nav-item.js +1 -1
- 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.css +3 -0
- package/dist/collection/components/gov-spacer/gov-spacer.css +3 -0
- package/dist/collection/components/gov-spacer/gov-spacer.js +3 -2
- package/dist/collection/components/gov-spacer/gov-spacer.js.map +1 -1
- package/dist/collection/components/gov-statsbar/constants.js +1 -1
- package/dist/collection/components/gov-statsbar/constants.js.map +1 -1
- package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +3 -0
- package/dist/collection/components/gov-statsbar/gov-statsbar.css +3 -0
- package/dist/collection/components/gov-statsbar/gov-statsbar.js +2 -2
- package/dist/collection/components/gov-statsbar/gov-statsbar.js.map +1 -1
- package/dist/collection/components/gov-stepper/gov-stepper-item.css +3 -0
- package/dist/collection/components/gov-stepper/gov-stepper.css +3 -0
- package/dist/collection/components/gov-tabs/gov-tabs-item.css +3 -0
- package/dist/collection/components/gov-tabs/gov-tabs.css +3 -0
- package/dist/collection/components/gov-tabs/gov-tabs.js +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
- package/dist/collection/components/gov-tile/gov-tile.css +4 -1
- package/dist/collection/components/gov-tile/gov-tile.js +1 -1
- package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
- package/dist/collection/components/gov-tiles/gov-tiles.css +6 -0
- package/dist/collection/components/gov-tiles/gov-tiles.js +19 -0
- package/dist/collection/components/gov-tiles/gov-tiles.js.map +1 -1
- package/dist/collection/components/gov-toast/gov-toast.css +3 -0
- package/dist/collection/components/gov-toast/gov-toast.js +1 -1
- package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +3 -0
- package/dist/collection/components/gov-tooltip/gov-tooltip.css +3 -0
- package/dist/collection/components/gov-wizzard/gov-wizzard-item.css +3 -0
- package/dist/collection/components/gov-wizzard/gov-wizzard-item.js +1 -1
- package/dist/collection/components/gov-wizzard/gov-wizzard-item.js.map +1 -1
- package/dist/collection/components/gov-wizzard/gov-wizzard.css +3 -0
- package/dist/collection/pages/Accordion.js +97 -2
- package/dist/collection/pages/Accordion.js.map +1 -1
- package/dist/collection/pages/Badge.js +27 -0
- package/dist/collection/pages/Badge.js.map +1 -1
- package/dist/collection/pages/Button.js +440 -120
- package/dist/collection/pages/Button.js.map +1 -1
- package/dist/collection/pages/Error.js +1 -1
- package/dist/collection/pages/Error.js.map +1 -1
- package/dist/collection/pages/Forms.js +31 -23
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/pages/Pagination.js +12 -2
- package/dist/collection/pages/Pagination.js.map +1 -1
- package/dist/collection/pages/Stepper.js +6 -6
- package/dist/collection/pages/Stepper.js.map +1 -1
- package/dist/collection/pages/Tiles.js +39 -0
- package/dist/collection/pages/Tiles.js.map +1 -1
- package/dist/collection/pages/ToastMessage.js +1 -1
- package/dist/collection/pages/ToastMessage.js.map +1 -1
- package/dist/collection/pages/ToastMessageCountdown.js +1 -1
- package/dist/collection/pages/ToastMessageCountdown.js.map +1 -1
- package/dist/collection/pages/Wizzard.js +3 -3
- package/dist/collection/pages/Wizzard.js.map +1 -1
- package/dist/collection/utils/array.utils.js +2 -0
- package/dist/collection/utils/array.utils.js.map +1 -0
- package/dist/components/constants11.js +2 -2
- package/dist/components/constants11.js.map +1 -1
- package/dist/components/constants3.js +2 -1
- package/dist/components/constants3.js.map +1 -1
- package/dist/components/gov-accordion-item.js +2 -2
- package/dist/components/gov-accordion-item.js.map +1 -1
- package/dist/components/gov-accordion.js +3 -1
- package/dist/components/gov-accordion.js.map +1 -1
- package/dist/components/gov-alert.js +1 -1
- package/dist/components/gov-alert.js.map +1 -1
- package/dist/components/gov-app.js +658 -159
- package/dist/components/gov-app.js.map +1 -1
- package/dist/components/gov-attachments-item2.js +1 -1
- package/dist/components/gov-attachments-item2.js.map +1 -1
- package/dist/components/gov-backdrop2.js +5 -4
- package/dist/components/gov-backdrop2.js.map +1 -1
- package/dist/components/gov-badge2.js +16 -17
- package/dist/components/gov-badge2.js.map +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-breadcrumbs.js.map +1 -1
- package/dist/components/gov-button2.js +5 -5
- package/dist/components/gov-button2.js.map +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-card.js.map +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-checkbox.js.map +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-file.js.map +1 -1
- package/dist/components/gov-form-input2.js +2 -2
- package/dist/components/gov-form-input2.js.map +1 -1
- package/dist/components/gov-form-multi-select.js +3 -3
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-password-power.d.ts +11 -0
- package/dist/components/gov-form-password-power.js +44 -0
- package/dist/components/gov-form-password-power.js.map +1 -0
- package/dist/components/gov-form-select2.js +3 -3
- package/dist/components/gov-form-select2.js.map +1 -1
- package/dist/components/gov-icon2.js +1 -1
- package/dist/components/gov-modal.js +20 -13
- package/dist/components/gov-modal.js.map +1 -1
- package/dist/components/gov-pagination.js +49 -14
- package/dist/components/gov-pagination.js.map +1 -1
- package/dist/components/gov-prompt.js +13 -6
- package/dist/components/gov-prompt.js.map +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-side-nav-item.js.map +1 -1
- package/dist/components/gov-spacer.js +1 -1
- package/dist/components/gov-spacer.js.map +1 -1
- package/dist/components/gov-statsbar.js +2 -2
- package/dist/components/gov-statsbar.js.map +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tabs.js.map +1 -1
- package/dist/components/gov-tile.js +2 -2
- package/dist/components/gov-tile.js.map +1 -1
- package/dist/components/gov-tiles.js +4 -2
- package/dist/components/gov-tiles.js.map +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-toast.js.map +1 -1
- package/dist/components/gov-wizzard-item.js +1 -1
- package/dist/components/gov-wizzard-item.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-e7dd2002.entry.js → p-00e1e600.entry.js} +2 -2
- package/dist/core/p-00e1e600.entry.js.map +1 -0
- package/dist/core/p-0950ba85.entry.js +2 -0
- package/dist/core/p-0950ba85.entry.js.map +1 -0
- package/dist/core/{p-5fa41af9.js → p-1020a160.js} +1 -1
- package/dist/core/p-1020a160.js.map +1 -0
- package/dist/core/p-165fe5f4.entry.js +2 -0
- package/dist/core/{p-0a152bb7.entry.js.map → p-165fe5f4.entry.js.map} +1 -1
- package/dist/core/{p-9e6a41cc.entry.js → p-16608a87.entry.js} +2 -2
- package/dist/core/p-16608a87.entry.js.map +1 -0
- package/dist/core/{p-f5ee7634.entry.js → p-1bb5184f.entry.js} +2 -2
- package/dist/core/{p-f5ee7634.entry.js.map → p-1bb5184f.entry.js.map} +1 -1
- package/dist/core/p-1cc7b8d3.entry.js +2 -0
- package/dist/core/p-1cc7b8d3.entry.js.map +1 -0
- package/dist/core/{p-b48a3112.entry.js → p-4b375a4d.entry.js} +2 -2
- package/dist/core/{p-b48a3112.entry.js.map → p-4b375a4d.entry.js.map} +1 -1
- package/dist/core/{p-ad0cc981.entry.js → p-54f367db.entry.js} +2 -2
- package/dist/core/{p-ad0cc981.entry.js.map → p-54f367db.entry.js.map} +1 -1
- package/dist/core/p-5b4e3bdf.entry.js +2 -0
- package/dist/core/p-5b4e3bdf.entry.js.map +1 -0
- package/dist/core/p-613d8ed8.entry.js +2 -0
- package/dist/core/p-613d8ed8.entry.js.map +1 -0
- package/dist/core/{p-6d40721b.entry.js → p-63d2e8ec.entry.js} +2 -2
- package/dist/core/{p-6d40721b.entry.js.map → p-63d2e8ec.entry.js.map} +1 -1
- package/dist/core/{p-38fb2d42.entry.js → p-692eb701.entry.js} +2 -2
- package/dist/core/p-692eb701.entry.js.map +1 -0
- package/dist/core/{p-5cecdaaf.entry.js → p-72f16a95.entry.js} +2 -2
- package/dist/core/p-7ac5f119.entry.js +2 -0
- package/dist/core/{p-63079b80.entry.js.map → p-7ac5f119.entry.js.map} +1 -1
- package/dist/core/{p-03d40bf4.entry.js → p-833ab414.entry.js} +2 -2
- package/dist/core/{p-03d40bf4.entry.js.map → p-833ab414.entry.js.map} +1 -1
- package/dist/core/{p-34360f92.entry.js → p-84fda9dd.entry.js} +2 -2
- package/dist/core/{p-34360f92.entry.js.map → p-84fda9dd.entry.js.map} +1 -1
- package/dist/core/p-86a3c0d5.entry.js +2 -0
- package/dist/core/p-86a3c0d5.entry.js.map +1 -0
- package/dist/core/p-8dacc8dc.entry.js +2 -0
- package/dist/core/p-8dacc8dc.entry.js.map +1 -0
- package/dist/core/p-99155ec0.entry.js +2 -0
- package/dist/core/p-99155ec0.entry.js.map +1 -0
- package/dist/core/{p-7591ecd4.entry.js → p-9ca0a11c.entry.js} +2 -2
- package/dist/core/{p-7591ecd4.entry.js.map → p-9ca0a11c.entry.js.map} +1 -1
- package/dist/core/p-a0c491a6.entry.js +2 -0
- package/dist/core/p-a0c491a6.entry.js.map +1 -0
- package/dist/core/p-a0dd0a95.entry.js +2 -0
- package/dist/core/{p-e52a042f.entry.js.map → p-a0dd0a95.entry.js.map} +1 -1
- package/dist/core/p-b966062a.entry.js +2 -0
- package/dist/core/p-b966062a.entry.js.map +1 -0
- package/dist/core/{p-fc1581f9.entry.js → p-bd560ffc.entry.js} +2 -2
- package/dist/core/{p-fc1581f9.entry.js.map → p-bd560ffc.entry.js.map} +1 -1
- package/dist/core/p-c9948e57.entry.js +2 -0
- package/dist/core/p-c9948e57.entry.js.map +1 -0
- package/dist/core/p-cd869237.js +2 -0
- package/dist/core/p-cd869237.js.map +1 -0
- package/dist/core/{p-93facb4a.entry.js → p-da2b921e.entry.js} +2 -2
- package/dist/core/p-da2b921e.entry.js.map +1 -0
- package/dist/core/{p-9cc6ed83.entry.js → p-e57d250f.entry.js} +2 -2
- package/dist/core/p-e57d250f.entry.js.map +1 -0
- package/dist/core/{p-f5ffcb3d.entry.js → p-e9c94ef7.entry.js} +2 -2
- package/dist/core/p-fac1c202.entry.js +2 -0
- package/dist/core/p-fac1c202.entry.js.map +1 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +1 -1
- package/dist/custom-elements/index.js.map +1 -1
- package/dist/esm/{constants-d550c816.js → constants-037c35bc.js} +3 -3
- package/dist/esm/constants-037c35bc.js.map +1 -0
- package/dist/esm/{constants-1a2146b2.js → constants-45f6db4c.js} +3 -2
- package/dist/esm/constants-45f6db4c.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-accordion-item.entry.js +2 -2
- package/dist/esm/gov-accordion-item.entry.js.map +1 -1
- package/dist/esm/gov-accordion.entry.js +2 -1
- package/dist/esm/gov-accordion.entry.js.map +1 -1
- package/dist/esm/gov-alert.entry.js +1 -1
- package/dist/esm/gov-alert.entry.js.map +1 -1
- package/dist/esm/gov-app.entry.js +658 -159
- package/dist/esm/gov-app.entry.js.map +1 -1
- package/dist/esm/gov-attachments_3.entry.js +1 -1
- package/dist/esm/gov-attachments_3.entry.js.map +1 -1
- package/dist/esm/gov-backdrop.entry.js +5 -4
- package/dist/esm/gov-backdrop.entry.js.map +1 -1
- package/dist/esm/gov-badge.entry.js +17 -17
- package/dist/esm/gov-badge.entry.js.map +1 -1
- package/dist/esm/gov-breadcrumbs.entry.js +1 -1
- package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
- package/dist/esm/gov-button.entry.js +2 -2
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-card.entry.js +1 -1
- package/dist/esm/gov-card.entry.js.map +1 -1
- package/dist/esm/gov-form-checkbox.entry.js +1 -1
- package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
- package/dist/esm/gov-form-file.entry.js +1 -1
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-form-input.entry.js +2 -2
- package/dist/esm/gov-form-input.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +3 -3
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-form-password-power.entry.js +24 -0
- package/dist/esm/gov-form-password-power.entry.js.map +1 -0
- package/dist/esm/gov-form-select.entry.js +3 -3
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/esm/gov-modal.entry.js +19 -13
- package/dist/esm/gov-modal.entry.js.map +1 -1
- package/dist/esm/gov-pagination.entry.js +49 -14
- package/dist/esm/gov-pagination.entry.js.map +1 -1
- package/dist/esm/gov-prompt.entry.js +12 -6
- package/dist/esm/gov-prompt.entry.js.map +1 -1
- package/dist/esm/gov-side-nav-item.entry.js +1 -1
- package/dist/esm/gov-side-nav-item.entry.js.map +1 -1
- package/dist/esm/gov-spacer.entry.js +1 -1
- package/dist/esm/gov-spacer.entry.js.map +1 -1
- package/dist/esm/gov-statsbar-item.entry.js +1 -1
- package/dist/esm/gov-statsbar.entry.js +2 -2
- package/dist/esm/gov-statsbar.entry.js.map +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 +2 -2
- package/dist/esm/gov-tile.entry.js.map +1 -1
- package/dist/esm/gov-tiles.entry.js +2 -1
- package/dist/esm/gov-tiles.entry.js.map +1 -1
- package/dist/esm/gov-toast.entry.js +1 -1
- package/dist/esm/gov-toast.entry.js.map +1 -1
- package/dist/esm/gov-wizzard-item.entry.js +1 -1
- package/dist/esm/gov-wizzard-item.entry.js.map +1 -1
- package/dist/esm/index-00e9a0d5.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +830 -247
- package/dist/types/components/gov-accordion/gov-accordion.d.ts +4 -0
- package/dist/types/components/gov-badge/constants.d.ts +4 -2
- package/dist/types/components/gov-badge/gov-badge.d.ts +4 -9
- package/dist/types/components/gov-button/constants.d.ts +3 -2
- package/dist/types/components/gov-form/password-power/constants.d.ts +5 -0
- package/dist/types/components/gov-form/password-power/gov-form-password-power.d.ts +7 -0
- package/dist/types/components/gov-modal/gov-modal.d.ts +3 -1
- package/dist/types/components/gov-pagination/gov-pagination.d.ts +7 -3
- package/dist/types/components/gov-promp/gov-prompt.d.ts +3 -1
- package/dist/types/components/gov-statsbar/constants.d.ts +2 -2
- package/dist/types/components/gov-tiles/gov-tiles.d.ts +4 -0
- package/dist/types/components.d.ts +39 -10
- package/dist/types/utils/array.utils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/constants-5f6bbc50.js.map +0 -1
- package/dist/cjs/constants-dc2ba6bd.js.map +0 -1
- package/dist/core/p-00182e76.entry.js +0 -2
- package/dist/core/p-00182e76.entry.js.map +0 -1
- package/dist/core/p-0278fcb3.entry.js +0 -2
- package/dist/core/p-0278fcb3.entry.js.map +0 -1
- package/dist/core/p-08f14c8b.entry.js +0 -2
- package/dist/core/p-08f14c8b.entry.js.map +0 -1
- package/dist/core/p-0a152bb7.entry.js +0 -2
- package/dist/core/p-14f8f2fb.js +0 -2
- package/dist/core/p-14f8f2fb.js.map +0 -1
- package/dist/core/p-2128abe1.entry.js +0 -2
- package/dist/core/p-2128abe1.entry.js.map +0 -1
- package/dist/core/p-2419f4cd.entry.js +0 -2
- package/dist/core/p-2419f4cd.entry.js.map +0 -1
- package/dist/core/p-38fb2d42.entry.js.map +0 -1
- package/dist/core/p-4681cb3a.entry.js +0 -2
- package/dist/core/p-4681cb3a.entry.js.map +0 -1
- package/dist/core/p-469273be.entry.js +0 -2
- package/dist/core/p-469273be.entry.js.map +0 -1
- package/dist/core/p-5547dbb0.entry.js +0 -2
- package/dist/core/p-5547dbb0.entry.js.map +0 -1
- package/dist/core/p-5fa41af9.js.map +0 -1
- package/dist/core/p-63079b80.entry.js +0 -2
- package/dist/core/p-93facb4a.entry.js.map +0 -1
- package/dist/core/p-9cc6ed83.entry.js.map +0 -1
- package/dist/core/p-9e6a41cc.entry.js.map +0 -1
- package/dist/core/p-e52a042f.entry.js +0 -2
- package/dist/core/p-e7dd2002.entry.js.map +0 -1
- package/dist/core/p-f2dc8ce3.entry.js +0 -2
- package/dist/core/p-f2dc8ce3.entry.js.map +0 -1
- package/dist/core/p-fc91591d.entry.js +0 -2
- package/dist/core/p-fc91591d.entry.js.map +0 -1
- package/dist/esm/constants-1a2146b2.js.map +0 -1
- package/dist/esm/constants-d550c816.js.map +0 -1
- /package/dist/core/{p-5cecdaaf.entry.js.map → p-72f16a95.entry.js.map} +0 -0
- /package/dist/core/{p-f5ffcb3d.entry.js.map → p-e9c94ef7.entry.js.map} +0 -0
|
@@ -13,6 +13,10 @@ export declare class GovAccordion {
|
|
|
13
13
|
* Style variation of the button.
|
|
14
14
|
*/
|
|
15
15
|
readonly variant?: AccordionVariantType;
|
|
16
|
+
/**
|
|
17
|
+
* Accordion item underline
|
|
18
|
+
*/
|
|
19
|
+
readonly noBorder: boolean;
|
|
16
20
|
/**
|
|
17
21
|
* Adds accessible label for the accordion that is only shown for screen readers.
|
|
18
22
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ValueOf } from '../../types/interfaces';
|
|
2
|
-
declare enum NativeType {
|
|
2
|
+
export declare enum NativeType {
|
|
3
|
+
A = "a",
|
|
3
4
|
SPAN = "span",
|
|
4
5
|
BUTTON = "button"
|
|
5
6
|
}
|
|
@@ -7,5 +8,6 @@ export declare type NativeTypesType = `${ValueOf<typeof NativeType>}`;
|
|
|
7
8
|
export declare const BadgeClass: {
|
|
8
9
|
root: string;
|
|
9
10
|
inner: string;
|
|
11
|
+
hasRight: string;
|
|
12
|
+
hasLeft: string;
|
|
10
13
|
};
|
|
11
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EventEmitter } from
|
|
2
|
-
import { NativeTypesType } from
|
|
3
|
-
import { ButtonSizesType, TypesType, ButtonVariantType } from
|
|
1
|
+
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
|
+
import { NativeTypesType } from "./constants";
|
|
3
|
+
import { ButtonSizesType, TypesType, ButtonVariantType } from "../gov-button/constants";
|
|
4
4
|
export declare class GovBadge {
|
|
5
5
|
private h;
|
|
6
6
|
constructor();
|
|
@@ -35,12 +35,7 @@ export declare class GovBadge {
|
|
|
35
35
|
/**
|
|
36
36
|
* Used to change the HMTL tag in the badge
|
|
37
37
|
*/
|
|
38
|
-
readonly tag:
|
|
39
|
-
/**
|
|
40
|
-
* Same as original parameter
|
|
41
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type
|
|
42
|
-
*/
|
|
43
|
-
readonly nativeType: NativeTypesType;
|
|
38
|
+
readonly tag: NativeTypesType;
|
|
44
39
|
/**
|
|
45
40
|
* Style variation of the badge.
|
|
46
41
|
*/
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Sizes } from '../../core/constants/sizes';
|
|
2
2
|
import { Variants } from '../../core/constants/variants';
|
|
3
3
|
import { ValueOf } from '../../types/interfaces';
|
|
4
|
-
export declare const ButtonSizes: Pick<typeof Sizes, "_S" | "_M" | "_L" | "_XL">;
|
|
4
|
+
export declare const ButtonSizes: Pick<typeof Sizes, "_S" | "_M" | "_L" | "_XS" | "_XL">;
|
|
5
5
|
export declare type ButtonSizesType = `${ValueOf<typeof ButtonSizes>}`;
|
|
6
6
|
export declare const ButtonVariants: Pick<typeof Variants, "PRIMARY" | "SECONDARY" | "SUCCESS" | "ERROR" | "WARNING">;
|
|
7
7
|
export declare type ButtonVariantType = `${ValueOf<typeof ButtonVariants>}`;
|
|
8
8
|
export declare enum Type {
|
|
9
9
|
SOLID = "solid",
|
|
10
10
|
OUTLINED = "outlined",
|
|
11
|
-
BASE = "base"
|
|
11
|
+
BASE = "base",
|
|
12
|
+
LINK = "link"
|
|
12
13
|
}
|
|
13
14
|
export declare type TypesType = `${ValueOf<typeof Type>}`;
|
|
14
15
|
export declare enum NativeType {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventEmitter } from
|
|
1
|
+
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
2
|
export declare class GovModal {
|
|
3
3
|
private h;
|
|
4
4
|
private readonly labelId;
|
|
@@ -41,7 +41,9 @@ export declare class GovModal {
|
|
|
41
41
|
* Emitted when modal window closes.
|
|
42
42
|
*/
|
|
43
43
|
govClose: EventEmitter<PointerEvent>;
|
|
44
|
+
modalVisible: boolean;
|
|
44
45
|
validateLabelTag(newValue: string): void;
|
|
46
|
+
watchOpen(newValue: boolean): void;
|
|
45
47
|
private showModal;
|
|
46
48
|
private hideModal;
|
|
47
49
|
componentWillRender(): Promise<void>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { EventEmitter } from
|
|
2
|
-
import { PaginationSizeType, PaginationVariantType, PaginationType } from
|
|
3
|
-
import { Pagination } from
|
|
1
|
+
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
|
+
import { PaginationSizeType, PaginationVariantType, PaginationType } from "./constants";
|
|
3
|
+
import { Pagination } from "./pagination";
|
|
4
4
|
export declare class GovPagination {
|
|
5
5
|
private h;
|
|
6
6
|
private readonly pageSelectId;
|
|
7
|
+
private spreadSelectRef?;
|
|
7
8
|
constructor();
|
|
8
9
|
readonly host: HTMLGovPaginationElement;
|
|
9
10
|
/**
|
|
@@ -72,8 +73,11 @@ export declare class GovPagination {
|
|
|
72
73
|
componentDidRender(): Promise<void>;
|
|
73
74
|
private recalculatePagination;
|
|
74
75
|
private isActivePageClass;
|
|
76
|
+
private prepareLinkUrl;
|
|
77
|
+
private resetSelectValue;
|
|
75
78
|
render(): any;
|
|
76
79
|
private onClickHandler;
|
|
80
|
+
private onSelectHandler;
|
|
77
81
|
/**
|
|
78
82
|
* Validate the WCAG attributes of the component
|
|
79
83
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventEmitter } from
|
|
1
|
+
import { EventEmitter } from "../../stencil-public-runtime";
|
|
2
2
|
export declare class GovPrompt {
|
|
3
3
|
private h;
|
|
4
4
|
private readonly labelId;
|
|
@@ -41,7 +41,9 @@ export declare class GovPrompt {
|
|
|
41
41
|
* Emitted when modal window closes.
|
|
42
42
|
*/
|
|
43
43
|
govClose: EventEmitter<PointerEvent>;
|
|
44
|
+
modalVisible: boolean;
|
|
44
45
|
validateLabelTag(newValue: string): void;
|
|
46
|
+
watchOpen(newValue: boolean): void;
|
|
45
47
|
private showModal;
|
|
46
48
|
private hideModal;
|
|
47
49
|
componentWillRender(): Promise<void>;
|
|
@@ -4,8 +4,8 @@ export declare enum StatsBarIconPosition {
|
|
|
4
4
|
LEFT = "left"
|
|
5
5
|
}
|
|
6
6
|
export declare type StatsBarIconPositionType = `${ValueOf<typeof StatsBarIconPosition>}`;
|
|
7
|
-
export declare const
|
|
8
|
-
export declare type StatsBarVariantType = `${ValueOf<typeof
|
|
7
|
+
export declare const StatsBarVariants: Pick<typeof Variants, "PRIMARY" | "SECONDARY">;
|
|
8
|
+
export declare type StatsBarVariantType = `${ValueOf<typeof StatsBarVariants>}`;
|
|
9
9
|
export declare const StatsBarClass: {
|
|
10
10
|
root: string;
|
|
11
11
|
section: string;
|
|
@@ -45,6 +45,10 @@ import { WizardSizesType, WizardVariantsType } from "./components/gov-wizzard/co
|
|
|
45
45
|
import { GovWizzardItemChangeEvent } from "./components/gov-wizzard/gov-wizzard-item.d";
|
|
46
46
|
export namespace Components {
|
|
47
47
|
interface GovAccordion {
|
|
48
|
+
/**
|
|
49
|
+
* Accordion item underline
|
|
50
|
+
*/
|
|
51
|
+
"noBorder": boolean;
|
|
48
52
|
/**
|
|
49
53
|
* Accordion’s size.
|
|
50
54
|
*/
|
|
@@ -200,10 +204,6 @@ export namespace Components {
|
|
|
200
204
|
* Determide if component should have inversed colors to be used on dark background
|
|
201
205
|
*/
|
|
202
206
|
"inverse": boolean;
|
|
203
|
-
/**
|
|
204
|
-
* Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type
|
|
205
|
-
*/
|
|
206
|
-
"nativeType": NativeTypesType;
|
|
207
207
|
/**
|
|
208
208
|
* Badge’s size.
|
|
209
209
|
*/
|
|
@@ -211,7 +211,7 @@ export namespace Components {
|
|
|
211
211
|
/**
|
|
212
212
|
* Used to change the HMTL tag in the badge
|
|
213
213
|
*/
|
|
214
|
-
"tag":
|
|
214
|
+
"tag": NativeTypesType;
|
|
215
215
|
/**
|
|
216
216
|
* Same as original parameter
|
|
217
217
|
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target
|
|
@@ -898,6 +898,12 @@ export namespace Components {
|
|
|
898
898
|
*/
|
|
899
899
|
"wcagOwns": string;
|
|
900
900
|
}
|
|
901
|
+
interface GovFormPasswordPower {
|
|
902
|
+
/**
|
|
903
|
+
* Password power: 0 - none, 1 - weak, 2 - medium, 3 - strong
|
|
904
|
+
*/
|
|
905
|
+
"power": number;
|
|
906
|
+
}
|
|
901
907
|
interface GovFormRadio {
|
|
902
908
|
/**
|
|
903
909
|
* Radio default state
|
|
@@ -1530,6 +1536,10 @@ export namespace Components {
|
|
|
1530
1536
|
* Number of columns between 1-4
|
|
1531
1537
|
*/
|
|
1532
1538
|
"columns": number;
|
|
1539
|
+
/**
|
|
1540
|
+
* Tiles border
|
|
1541
|
+
*/
|
|
1542
|
+
"noBorder": boolean;
|
|
1533
1543
|
}
|
|
1534
1544
|
interface GovToast {
|
|
1535
1545
|
/**
|
|
@@ -1939,6 +1949,12 @@ declare global {
|
|
|
1939
1949
|
prototype: HTMLGovFormMultiSelectElement;
|
|
1940
1950
|
new (): HTMLGovFormMultiSelectElement;
|
|
1941
1951
|
};
|
|
1952
|
+
interface HTMLGovFormPasswordPowerElement extends Components.GovFormPasswordPower, HTMLStencilElement {
|
|
1953
|
+
}
|
|
1954
|
+
var HTMLGovFormPasswordPowerElement: {
|
|
1955
|
+
prototype: HTMLGovFormPasswordPowerElement;
|
|
1956
|
+
new (): HTMLGovFormPasswordPowerElement;
|
|
1957
|
+
};
|
|
1942
1958
|
interface HTMLGovFormRadioElement extends Components.GovFormRadio, HTMLStencilElement {
|
|
1943
1959
|
}
|
|
1944
1960
|
var HTMLGovFormRadioElement: {
|
|
@@ -2156,6 +2172,7 @@ declare global {
|
|
|
2156
2172
|
"gov-form-label": HTMLGovFormLabelElement;
|
|
2157
2173
|
"gov-form-message": HTMLGovFormMessageElement;
|
|
2158
2174
|
"gov-form-multi-select": HTMLGovFormMultiSelectElement;
|
|
2175
|
+
"gov-form-password-power": HTMLGovFormPasswordPowerElement;
|
|
2159
2176
|
"gov-form-radio": HTMLGovFormRadioElement;
|
|
2160
2177
|
"gov-form-search": HTMLGovFormSearchElement;
|
|
2161
2178
|
"gov-form-select": HTMLGovFormSelectElement;
|
|
@@ -2192,6 +2209,10 @@ declare global {
|
|
|
2192
2209
|
}
|
|
2193
2210
|
declare namespace LocalJSX {
|
|
2194
2211
|
interface GovAccordion {
|
|
2212
|
+
/**
|
|
2213
|
+
* Accordion item underline
|
|
2214
|
+
*/
|
|
2215
|
+
"noBorder"?: boolean;
|
|
2195
2216
|
/**
|
|
2196
2217
|
* Called when the accordion state changes
|
|
2197
2218
|
*/
|
|
@@ -2335,10 +2356,6 @@ declare namespace LocalJSX {
|
|
|
2335
2356
|
* Determide if component should have inversed colors to be used on dark background
|
|
2336
2357
|
*/
|
|
2337
2358
|
"inverse"?: boolean;
|
|
2338
|
-
/**
|
|
2339
|
-
* Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type
|
|
2340
|
-
*/
|
|
2341
|
-
"nativeType"?: NativeTypesType;
|
|
2342
2359
|
/**
|
|
2343
2360
|
* Emitted when the button click.
|
|
2344
2361
|
*/
|
|
@@ -2350,7 +2367,7 @@ declare namespace LocalJSX {
|
|
|
2350
2367
|
/**
|
|
2351
2368
|
* Used to change the HMTL tag in the badge
|
|
2352
2369
|
*/
|
|
2353
|
-
"tag"?:
|
|
2370
|
+
"tag"?: NativeTypesType;
|
|
2354
2371
|
/**
|
|
2355
2372
|
* Same as original parameter
|
|
2356
2373
|
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target
|
|
@@ -3031,6 +3048,12 @@ declare namespace LocalJSX {
|
|
|
3031
3048
|
*/
|
|
3032
3049
|
"wcagOwns"?: string;
|
|
3033
3050
|
}
|
|
3051
|
+
interface GovFormPasswordPower {
|
|
3052
|
+
/**
|
|
3053
|
+
* Password power: 0 - none, 1 - weak, 2 - medium, 3 - strong
|
|
3054
|
+
*/
|
|
3055
|
+
"power"?: number;
|
|
3056
|
+
}
|
|
3034
3057
|
interface GovFormRadio {
|
|
3035
3058
|
/**
|
|
3036
3059
|
* Radio default state
|
|
@@ -3623,6 +3646,10 @@ declare namespace LocalJSX {
|
|
|
3623
3646
|
* Number of columns between 1-4
|
|
3624
3647
|
*/
|
|
3625
3648
|
"columns"?: number;
|
|
3649
|
+
/**
|
|
3650
|
+
* Tiles border
|
|
3651
|
+
*/
|
|
3652
|
+
"noBorder"?: boolean;
|
|
3626
3653
|
}
|
|
3627
3654
|
interface GovToast {
|
|
3628
3655
|
/**
|
|
@@ -3775,6 +3802,7 @@ declare namespace LocalJSX {
|
|
|
3775
3802
|
"gov-form-label": GovFormLabel;
|
|
3776
3803
|
"gov-form-message": GovFormMessage;
|
|
3777
3804
|
"gov-form-multi-select": GovFormMultiSelect;
|
|
3805
|
+
"gov-form-password-power": GovFormPasswordPower;
|
|
3778
3806
|
"gov-form-radio": GovFormRadio;
|
|
3779
3807
|
"gov-form-search": GovFormSearch;
|
|
3780
3808
|
"gov-form-select": GovFormSelect;
|
|
@@ -3837,6 +3865,7 @@ declare module "@stencil/core" {
|
|
|
3837
3865
|
"gov-form-label": LocalJSX.GovFormLabel & JSXBase.HTMLAttributes<HTMLGovFormLabelElement>;
|
|
3838
3866
|
"gov-form-message": LocalJSX.GovFormMessage & JSXBase.HTMLAttributes<HTMLGovFormMessageElement>;
|
|
3839
3867
|
"gov-form-multi-select": LocalJSX.GovFormMultiSelect & JSXBase.HTMLAttributes<HTMLGovFormMultiSelectElement>;
|
|
3868
|
+
"gov-form-password-power": LocalJSX.GovFormPasswordPower & JSXBase.HTMLAttributes<HTMLGovFormPasswordPowerElement>;
|
|
3840
3869
|
"gov-form-radio": LocalJSX.GovFormRadio & JSXBase.HTMLAttributes<HTMLGovFormRadioElement>;
|
|
3841
3870
|
"gov-form-search": LocalJSX.GovFormSearch & JSXBase.HTMLAttributes<HTMLGovFormSearchElement>;
|
|
3842
3871
|
"gov-form-select": LocalJSX.GovFormSelect & JSXBase.HTMLAttributes<HTMLGovFormSelectElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createArrayRange: (from: number, to: number) => number[];
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name" : "@gov-design-system-ce/components",
|
|
3
3
|
"description" : "This package includes Gov Design System Web Components and related utilities.",
|
|
4
4
|
"author": "Zdeněk Vítek",
|
|
5
|
-
"version" : "0.0.
|
|
5
|
+
"version" : "0.0.7",
|
|
6
6
|
"license" : "EUPL v1.2 Licensed",
|
|
7
7
|
"main" : "./dist/index.cjs.js",
|
|
8
8
|
"module" : "./dist/index.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"constants-5f6bbc50.js","mappings":";;;;;;MAKa,WAAW,GAAGA,UAAI,CAACC,WAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,EAAC;MAGpD,cAAc,GAAGD,UAAI,CAACE,iBAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,EAAC;AAGzFC;AAAZ,WAAY,IAAI;EACf,uBAAe,CAAA;EACf,6BAAqB,CAAA;EACrB,qBAAa,CAAA;AACd,CAAC,EAJWA,YAAI,KAAJA,YAAI,QAIf;AAIWC;AAAZ,WAAY,UAAU;EACrB,+BAAiB,CAAA;EACjB,+BAAiB,CAAA;EACjB,6BAAe,CAAA;AAChB,CAAC,EAJWA,kBAAU,KAAVA,kBAAU,QAIrB;AAID,IAAY,YAIX;AAJD,WAAY,YAAY;EACvB,gCAAgB,CAAA;EAChB,8BAAc,CAAA;EACd,4BAAY,CAAA;AACb,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;MAGY,WAAW,GAAG;EAC1B,IAAI,EAAE,YAAY;EAClB,YAAY,EAAE,oBAAoB;;;;;;;","names":["pick","Sizes","Variants","Type","NativeType"],"sources":["../../../packages/core/src/components/gov-button/constants.ts"],"sourcesContent":["import { Sizes } from '../../core/constants/sizes'\nimport { Variants } from '../../core/constants/variants'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const ButtonSizes = pick(Sizes, ['_S', '_M', '_L', '_XL'])\nexport type ButtonSizesType = `${ValueOf<typeof ButtonSizes>}`\n\nexport const ButtonVariants = pick(Variants, ['PRIMARY', 'SECONDARY', 'SUCCESS', 'ERROR', 'WARNING'])\nexport type ButtonVariantType = `${ValueOf<typeof ButtonVariants>}`\n\nexport enum Type {\n\tSOLID = 'solid',\n\tOUTLINED = 'outlined',\n\tBASE = 'base',\n}\n\nexport type TypesType = `${ValueOf<typeof Type>}`\n\nexport enum NativeType {\n\tSUBMIT = 'submit',\n\tBUTTON = 'button',\n\tRESET = 'reset',\n}\n\nexport type NativeTypesType = `${ValueOf<typeof NativeType>}`\n\nexport enum ButtonTarget {\n\tBLANK = '_blank',\n\tSELF = '_self',\n\tNEW = '_new',\n}\nexport type ButtonTargetType = `${ValueOf<typeof ButtonTarget>}`\n\nexport const ButtonClass = {\n\troot: 'gov-button',\n\trootWithIcon: 'gov-button--w-icon',\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"constants-dc2ba6bd.js","mappings":";;;;;AAIYA;AAAZ,WAAY,oBAAoB;EAC/B,qCAAa,CAAA;AACd,CAAC,EAFWA,4BAAoB,KAApBA,4BAAoB,QAE/B;MAGY,eAAe,GAAGC,UAAI,CAACC,iBAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAC;MAG1D,aAAa,GAAG;EAC5B,IAAI,EAAE,cAAc;EACpB,OAAO,EAAE,uBAAuB;EAChC;MAEY,iBAAiB,GAAG;EAChC,IAAI,EAAE,mBAAmB;EACzB,IAAI,EAAE,yBAAyB;EAC/B,MAAM,EAAE,2BAA2B;EACnC,IAAI,EAAE,yBAAyB;;;;;;;","names":["StatsBarIconPosition","pick","Variants"],"sources":["../../../packages/core/src/components/gov-statsbar/constants.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\nimport { Variants } from '../../core/constants/variants'\n\nexport enum StatsBarIconPosition {\n\tLEFT = 'left',\n}\nexport type StatsBarIconPositionType = `${ValueOf<typeof StatsBarIconPosition>}`\n\nexport const StatsBarVariant = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type StatsBarVariantType = `${ValueOf<typeof StatsBarVariant>}`\n\nexport const StatsBarClass = {\n\troot: 'gov-statsbar',\n\tsection: 'gov-statsbar__section',\n}\n\nexport const StatsBarItemClass = {\n\troot: 'gov-statsbar-item',\n\ticon: 'gov-statsbar-item__icon',\n\tnumber: 'gov-statsbar-item__number',\n\ttext: 'gov-statsbar-item__text',\n}\n"],"version":3}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as o,c as a,h as e,H as t,g as i}from"./p-682c7cc6.js";import{c as r}from"./p-24636c53.js";import{a as s}from"./p-364b4792.js";import{M as d}from"./p-45485d1c.js";import{c as l}from"./p-c20102ff.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";const h='.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)}}.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 0.25rem 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__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end;padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.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.25rem 2rem 3rem}.gov-modal__close{padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 2.5rem) / 2)}.gov-modal__content{padding:1.5rem 3rem 2rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const v=class{constructor(e){o(this,e);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=r("GovModalLabel");this.contentId=r("GovModalContent")}validateLabelTag(o){const a=["h1","h2","h3","h4","h5","h6"];if(o){if(!a.includes(o)){c(`[${d.root}]: Tag ${o} is not allowed.`)}}}showModal(){this.open=true;document.body.classList.add(d.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(d.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(l()){await n(500);await this.validateWcag()}}render(){const o=this.labelTag;return e(t,{class:this.h.classes(d.root),open:this.open},e("dialog",{class:d.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},e("div",{class:d.inner},e("div",{class:d.header},this.h.hasSlot("icon")&&e("div",{class:d.icon},e("slot",{name:"icon"})),this.label&&e(o,{class:d.title,id:this.labelId},this.label),e("gov-button",{class:d.close,variant:"primary",wcagLabel:this.wcagCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base","on-gov-click":this.onCloseHandler.bind(this)},e("gov-icon",{name:"cross"}))),e("div",{class:d.content,id:this.contentId},e("slot",null)))),e("gov-backdrop",{visible:this.open,"wcag-label":this.wcagCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}))}onCloseHandler(o){o.stopPropagation();this.hideModal();this.govClose.emit(o)}async show(){this.showModal()}async hide(){this.hideModal()}async validateWcag(){s(this.wcaglabelledBy,"aria-labelledby",d.root);s(this.wcagDescribedBy,"aria-describedby",d.root)}get host(){return i(this)}static get watchers(){return{labelTag:["validateLabelTag"]}}};v.style=h;export{v as gov_modal};
|
|
2
|
-
//# sourceMappingURL=p-00182e76.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/src/components/gov-modal/gov-modal.scss?tag=gov-modal","../../../packages/core/src/components/gov-modal/gov-modal.tsx"],"names":["govModalCss","GovModal","[object Object]","hostRef","this","h","govHost","host","labelId","createID","contentId","newValue","validTags","includes","govErrorLog","ModalClass","root","open","document","body","classList","add","bodyFix","remove","showModal","hideModal","canValidateWcagOnRender","delay","validateWcag","LabelTag","labelTag","Host","class","classes","dialog","hidden","tabindex","aria-modal","aria-hidden","toBoolAttr","aria-labelledby","wcaglabelledBy","aria-describedby","wcagDescribedBy","role","inner","header","hasSlot","icon","name","label","title","id","close","variant","wcagLabel","wcagCloseLabel","wcagLabelledBy","wcagCloseLabelledBy","type","on-gov-click","onCloseHandler","bind","content","visible","wcag-label","wcag-labelled-by","e","stopPropagation","govClose","emit","validateWcagRef"],"mappings":"mUAAA,MAAMA,EAAc,4sFCePC,EAAQ,MAKpBC,YAAAC,2DAWe,qCAQqB,uBAI0B,mIAtB7DC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,QAAUC,EAAS,iBACxBL,KAAKM,UAAYD,EAAS,mBA2C3BP,iBAAiBS,GAChB,MAAMC,EAAY,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,MACjD,GAAID,EAAU,CACb,IAAKC,EAAUC,SAASF,GAAW,CAClCG,EAAY,IAAIC,EAAWC,cAAcL,uBAKpCT,YACPE,KAAKa,KAAO,KACZC,SAASC,KAAKC,UAAUC,IAAIN,EAAWO,SAGhCpB,YACPE,KAAKa,KAAO,MACZC,SAASC,KAAKC,UAAUG,OAAOR,EAAWO,SAG3CpB,4BACC,GAAIE,KAAKa,KAAM,CACdb,KAAKoB,gBACC,CACNpB,KAAKqB,aAIPvB,2BACC,GAAIwB,IAA2B,OACxBC,EAAM,WACNvB,KAAKwB,gBAIb1B,SACC,MAAM2B,EAAWzB,KAAK0B,SACtB,OACCzB,EAAC0B,EAAI,CAACC,MAAO5B,KAAKC,EAAE4B,QAAQlB,EAAWC,MAAOC,KAAMb,KAAKa,MACxDZ,EAAA,SAAA,CACC2B,MAAOjB,EAAWmB,OAClBC,QAAS/B,KAAKa,KACdmB,SAAS,KACTnB,KAAMb,KAAKa,KAAIoB,aACJ,OAAMC,cACJC,GAAYnC,KAAKa,MAAKuB,kBAClBpC,KAAKqC,gBAAkBrC,KAAKI,QAAOkC,mBAClCtC,KAAKuC,iBAAmBvC,KAAKM,UAC/CkC,KAAMxC,KAAKwC,MAEXvC,EAAA,MAAA,CAAK2B,MAAOjB,EAAW8B,OACtBxC,EAAA,MAAA,CAAK2B,MAAOjB,EAAW+B,QACrB1C,KAAKC,EAAE0C,QAAQ,SACf1C,EAAA,MAAA,CAAK2B,MAAOjB,EAAWiC,MACtB3C,EAAA,OAAA,CAAM4C,KAAK,UAGZ7C,KAAK8C,OACL7C,EAACwB,EAAQ,CAACG,MAAOjB,EAAWoC,MAAOC,GAAIhD,KAAKI,SAC1CJ,KAAK8C,OAGR7C,EAAA,aAAA,CACC2B,MAAOjB,EAAWsC,MAClBC,QAAQ,UACRC,UAAWnD,KAAKoD,eAChBC,eAAgBrD,KAAKsD,oBACrBC,KAAK,OAAMC,eACGxD,KAAKyD,eAAeC,KAAK1D,OAEvCC,EAAA,WAAA,CAAU4C,KAAK,YAGjB5C,EAAA,MAAA,CAAK2B,MAAOjB,EAAWgD,QAASX,GAAIhD,KAAKM,WACxCL,EAAA,OAAA,SAKHA,EAAA,eAAA,CACC2D,QAAS5D,KAAKa,KAAIgD,aACN7D,KAAKoD,eAAcU,mBACb9D,KAAKsD,oBAAmBE,eAC5BxD,KAAKyD,eAAeC,KAAK1D,SAMnCF,eAAeiE,GACtBA,EAAEC,kBACFhE,KAAKqB,YACLrB,KAAKiE,SAASC,KAAKH,GAOpBjE,aACCE,KAAKoB,YAONtB,aACCE,KAAKqB,YAONvB,qBACCqE,EAAgBnE,KAAKqC,eAAgB,kBAAmB1B,EAAWC,MACnEuD,EAAgBnE,KAAKuC,gBAAiB,mBAAoB5B,EAAWC","sourcesContent":["/*\n * Modal\n */\n\n$class: \".gov-modal\";\n\n#{$class} {\n\tdisplay: none;\n\t&__dialog {\n\t\t@include z-index(\"modal\", 1);\n\t\tposition: fixed;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: 100%;\n\t\tmax-width: $modal-max-width;\n\t\theight: 100%;\n\t\tpadding: rem-calc(8);\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\ttransform: translate(-50%, -50%);\n\t\tpointer-events: none;\n\t}\n\t&__inner {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\twidth: 100%;\n\t\tmax-height: 100%;\n\t\tborder-radius: $border-radius;\n\t\tbackground: $modal-bg;\n\t\toverflow: hidden;\n\t\tpointer-events: auto;\n\t\tbox-shadow: get($shadow-l, $shadows);\n\t}\n\t&__header {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\talign-items: flex-start;\n\t\tpadding: rem-calc(24 4 24 16);\n\t\tborder-bottom: $modal-border;\n\t}\n\t&__icon {\n\t\tflex: 0 0 auto;\n\t\tpadding-top: calc(((var(--gov-text-#{$font-size-3xl}-font-size) * 1.5) - rem-calc(24)) / 2);\n\t\t& > * {\n\t\t\twidth: rem-calc(24);\n\t\t\theight: rem-calc(24);\n\t\t}\n\t}\n\t&__title {\n\t\t@include typography($font-size-3xl);\n\t\tmargin: 0;\n\t}\n\t&__close {\n\t\tflex: 0 0 auto;\n\t\tmargin-left: auto;\n\t\tpadding-top: calc(((var(--gov-text-#{$font-size-3xl}-font-size) * 1.5) - rem-calc(32)) / 2);\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t\theight: 100%;\n\t\tpadding: rem-calc(24 16);\n\t\tcolor: $modal-text-color;\n\t\toverflow: auto;\n\t}\n\t&__actions {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(8 16);\n\t\tflex-wrap: wrap;\n\t\tjustify-content: flex-end;\n\t\tpadding: rem-calc(24 16);\n\t\tborder-top: $modal-border;\n\t}\n\n\t// STATES\n\t&__dialog:focus &__inner {\n\t\toutline: $outline;\n\t}\n\t@include parameter(\"open\") {\n\t\tdisplay: block;\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t&__dialog {\n\t\t\tmax-width: calc($modal-max-width + 2 * rem-calc(24));\n\t\t\tpadding: rem-calc(24);\n\t\t\t&:focus {\n\t\t\t\toutline-offset: rem-calc(-24);\n\t\t\t}\n\t\t}\n\t\t&__inner {\n\t\t\tbox-shadow: get($shadow-xl, $shadows);\n\t\t}\n\n\t\t// VARIANTS\n\t\t&--prompt &__dialog {\n\t\t\tmax-width: calc($modal-prompt-max-width + 2 * rem-calc(24));\n\t\t}\n\t}\n\t@include mq($from: md) {\n\t\t&__header {\n\t\t\tgap: rem-calc(20);\n\t\t\tpadding: rem-calc(32 36 32 48);\n\t\t}\n\t\t&__close {\n\t\t\tpadding-top: calc(((var(--gov-text-#{$font-size-3xl}-font-size) * 1.5) - rem-calc(40)) / 2);\n\t\t}\n\t\t&__content {\n\t\t\tpadding: rem-calc(24 48 32);\n\t\t}\n\n\t\t// VARIANTS\n\t\t&--prompt {\n\t\t\t#{$class} {\n\t\t\t\t&__header,\n\t\t\t\t&__content,\n\t\t\t\t&__actions {\n\t\t\t\t\tpadding: rem-calc(24);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Event, Element, EventEmitter, h, Host, Method, Prop, Watch } from '@stencil/core'\nimport { createID } from '../../utils/string.utils'\nimport { validateWcagRef } from '../../helpers/Validate/wcag'\nimport { ModalClass } from './constants'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { toBoolAttr } from '../../helpers/Dom/template'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { govErrorLog } from '../../helpers/Log/gov.log'\n\n@Component({\n\ttag: 'gov-modal',\n\tstyleUrl: 'gov-modal.scss',\n})\nexport class GovModal {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovModalLabel')\n\t\tthis.contentId = createID('GovModalContent')\n\t}\n\n\t@Element() host: HTMLGovModalElement\n\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop() open = false\n\t/**\n\t * Title of modal window\n\t */\n\t@Prop() label: string\n\t/**\n\t * Role of modal\n\t */\n\t@Prop({ attribute: 'role' }) role = 'dialog'\n\t/**\n\t * Used to change the HMTL tag in the modal label for correct semantic structure\n\t */\n\t@Prop({ attribute: 'label-tag' }) readonly labelTag: string = 'h2'\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) wcaglabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the modal.\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) wcagDescribedBy: string\n\t/**\n\t * Adds accessible label for the modal close button that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-close-label' }) wcagCloseLabel: string\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the modal window\n\t */\n\t@Prop({ attribute: 'wcag-close-labelled-by' }) wcagCloseLabelledBy: string\n\t/**\n\t * Emitted when modal window closes.\n\t */\n\t@Event({ eventName: 'gov-close' }) govClose: EventEmitter<PointerEvent>\n\n\t@Watch('labelTag')\n\tvalidateLabelTag(newValue: string): void {\n\t\tconst validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\n\t\t\tthis.showModal()\n\t\t} else {\n\t\t\tthis.hideModal()\n\t\t}\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\trender() {\n\t\tconst LabelTag = this.labelTag\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ModalClass.root)} open={this.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\taria-labelledby={this.wcaglabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.wcagDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={ModalClass.inner}>\n\t\t\t\t\t\t<div class={ModalClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t\t\t<div class={ModalClass.icon}>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.label && (\n\t\t\t\t\t\t\t\t<LabelTag class={ModalClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t\t\t</LabelTag>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\tclass={ModalClass.close}\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\twcagLabel={this.wcagCloseLabel}\n\t\t\t\t\t\t\t\twcagLabelledBy={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<gov-icon name=\"cross\" />\n\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={ModalClass.content} id={this.contentId}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t<gov-backdrop\n\t\t\t\t\tvisible={this.open}\n\t\t\t\t\twcag-label={this.wcagCloseLabel}\n\t\t\t\t\twcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t/>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\tthis.hideModal()\n\t\tthis.govClose.emit(e)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hidding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideModal()\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcaglabelledBy, 'aria-labelledby', ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'aria-describedby', ModalClass.root)\n\t}\n}\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,h as a,H as n,g as e}from"./p-682c7cc6.js";import{v as o}from"./p-26acf964.js";import{S as s}from"./p-55500e5a.js";import{V as r}from"./p-ff7365ae.js";import{p as g,d as l}from"./p-03990da5.js";import{g as c,p,t as v}from"./p-3f37ddb6.js";import{c as h,v as m}from"./p-364b4792.js";import{c as d}from"./p-c20102ff.js";import{c as f}from"./p-24636c53.js";import"./p-561fa17b.js";const _=(i,t)=>[...t];const u=g(s,["_S","_M"]);const b=g(r,["PRIMARY","SECONDARY"]);var w;(function(i){i["BUTTON"]="button";i["SELECT"]="select"})(w||(w={}));const y={root:"gov-pagination",list:"gov-pagination__list",item:"gov-pagination__item",itemArrow:"gov-pagination__item--arrow",itemMore:"gov-pagination__item--more",itemSelect:"gov-pagination__item--select",inner:"gov-pagination__inner",arrow:"gov-pagination__arrow"};function x(i,t=1,a=10,n=10){const e=Math.ceil(i/a);if(t<1){t=1}else if(t>e){t=e}let o,s;if(e<=n){o=1;s=e}else{const i=Math.floor(n/2);const a=Math.ceil(n/2)-1;if(t<=i){o=1;s=n}else if(t+a>=e){o=e-n+1;s=e}else{o=t-i;s=t+a}}const r=(t-1)*a;const g=Math.min(r+a-1,i-1);const l=Array.from(Array(s+1-o).keys()).map((i=>o+i));return{totalItems:i,currentPage:t,pageSize:a,totalPages:e,startPage:o,endPage:s,startIndex:r,endIndex:g,pages:l}}const z=".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)}}.gov-pagination{position:relative;display:block;width:100%}.gov-pagination__list{display:flex;align-items:center;font-weight:bold;text-align:center}.gov-pagination__list .gov-pagination__item{display:flex;justify-content:center;align-items:center;margin:0;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__item .gov-button .element{width:var(--gov-pagination-button-size, 2rem)}.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%;color:var(--gov-pagination-color, var(--gov-color-primary));text-decoration:none}.gov-pagination button.gov-pagination__inner,.gov-pagination a.gov-pagination__inner{display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;border:0;background-color:transparent;text-align:center;text-decoration:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;transition:background-color 150ms, color 150ms}.gov-pagination button.gov-pagination__inner:focus,.gov-pagination a.gov-pagination__inner:focus{outline:none}@media not all and (pointer: coarse){.gov-pagination button.gov-pagination__inner:hover,.gov-pagination a.gov-pagination__inner:hover{background-color:var(--gov-pagination-bg-active, var(--gov-color-primary-100));color:var(--gov-pagination-color-active, var(--gov-color-secondary))}}.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}@media (min-width: 48em){.gov-pagination[size=s] .gov-pagination__item .gov-button .element{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}@media (min-width: 48em){.gov-pagination[size=m] .gov-pagination__item .gov-button .element{width:var(--gov-pagination-m-button-size, 2.5rem)}}";const j=class{constructor(a){i(this,a);this.govPage=t(this,"gov-page",7);this.type="button";this.current=1;this.total=undefined;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=c(this.host);this.pageSelectId=f("GovPageSelect")}validateType(i){o(w,i,y.root)}validateSize(i){o(u,i,y.root)}validateVariant(i){o(b,i,y.root)}componentWillLoad(){this.recalculatePagination(this.current);this.validateSize(this.size);this.validateVariant(this.variant)}async componentDidRender(){if(d()){await l(500);await this.validateWcag()}}recalculatePagination(i){this.pagination=x(this.total,i,this.pageSize,this.maxPages)}isActivePageClass(i,t){if(this.pagination.currentPage===t){return i+" is-active"}else{return i}}render(){const i=(i,t)=>{const n=i===-1;const e=v(this.pagination.currentPage===i?true:undefined);const o=this.pagination.currentPage===i?"solid":"base";return a("gov-button",{variant:this.variant,size:this.size,type:o,inverse:this.pagination.currentPage===i?true:false,disabled:n,"gov-click":()=>this.onClickHandler(i),"wcag-label":this.wcagPageLabel+" "+i,"wcag-current":e,class:y.inner},t)};return a(n,{class:this.h.classes(y.root),type:this.type,variant:this.variant,size:this.size},a("nav",{"aria-label":this.wcagLabel,"aria-labelledby":this.wcagLabelledBy},a("ul",{class:y.list},a("li",{class:p([y.item,y.itemArrow])},i(this.pagination.startPage<this.pagination.currentPage?this.pagination.currentPage-1:-1,a("gov-icon",{class:y.arrow,name:"double-arrow-left"}))),a("li",{class:p([y.item,y.itemArrow])},i(this.pagination.startPage<this.pagination.currentPage?this.pagination.currentPage-1:-1,a("gov-icon",{class:y.arrow,name:"arrow-left"}))),this.type=="select"?a("li",{class:p([y.item,y.itemSelect])},a("span",{class:y.inner},a("span",{id:this.pageSelectId,hidden:true},this.wcagSelectLabel),a("gov-form-select",{size:"m","wcag-labelled-by":this.pageSelectId},this.pagination.pages.map((i=>a("option",{value:i,selected:this.pagination.currentPage===i},i)))))):a(_,null,this.pagination.pages.map((t=>a("li",{class:this.isActivePageClass(y.item,t)},i(t,t)))),a("li",{class:p([y.item,y.itemMore])},a("span",{class:y.inner},a("span",{id:this.pageSelectId,hidden:true},this.wcagSelectLabel),a("gov-form-select",{size:"m","wcag-labelled-by":this.pageSelectId},a("option",{value:"..."},"..."),this.pagination.pages.map((i=>a("option",{value:i,selected:this.pagination.currentPage===i},i))))))),a("li",{class:p([y.item,y.itemArrow])},i(this.pagination.totalPages>this.pagination.currentPage?this.pagination.currentPage+1:-1,a("gov-icon",{class:y.arrow,name:"arrow-right"}))),a("li",{class:p([y.item,y.itemArrow])},i(this.pagination.totalPages>this.pagination.currentPage?this.pagination.totalPages:-1,a("gov-icon",{class:y.arrow,name:"double-arrow-right"}))))))}onClickHandler(i){this.recalculatePagination(i);this.govPage.emit(Object.assign({},this.pagination))}async validateWcag(){h(this.wcagPageLabel,"wcag-page-label",y.root);h(this.wcagSelectLabel,"wcag-select-label",y.root);m(this.wcagLabel,this.wcagLabelledBy,y.root)}get host(){return e(this)}static get watchers(){return{type:["validateType"],size:["validateSize"],variant:["validateVariant"]}}};j.style=z;export{j as gov_pagination};
|
|
2
|
-
//# sourceMappingURL=p-0278fcb3.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/src/helpers/Fragment.tsx","../../../packages/core/src/components/gov-pagination/constants.ts","../../../packages/core/src/components/gov-pagination/pagination.ts","../../../packages/core/src/components/gov-pagination/gov-pagination.scss?tag=gov-pagination","../../../packages/core/src/components/gov-pagination/gov-pagination.tsx"],"names":["Fragment","_","children","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","govPaginationCss","GovPagination","[object Object]","hostRef","this","h","govHost","host","pageSelectId","createID","newValue","validateProp","recalculatePagination","current","validateSize","size","validateVariant","variant","canValidateWcagOnRender","delay","validateWcag","pagination","total","originalClass","page","pageResolver","content","isDisabled","ariaCurrent","toBoolAttrIfDefined","undefined","buttonType","type","inverse","disabled","gov-click","onClickHandler","wcag-label","wcagPageLabel","wcag-current","class","Host","classes","aria-label","wcagLabel","aria-labelledby","wcagLabelledBy","prepareClasses","name","id","hidden","wcagSelectLabel","wcag-labelled-by","value","selected","isActivePageClass","govPage","emit","Object","assign","validateWcagProp","validateWcagLabel"],"mappings":"+YAAA,MAAAA,EAAe,CAACC,EAAGC,IAAa,IAAIA,GCK7B,MAAMC,EAAkBC,EAAKC,EAAO,CAAC,KAAM,OAG3C,MAAMC,EAAqBF,EAAKG,EAAU,CAAC,UAAW,cAG7D,IAAYC,GAAZ,SAAYA,GACXA,EAAA,UAAA,SACAA,EAAA,UAAA,UAFD,CAAYA,IAAAA,EAAe,KAMpB,MAAMC,EAAkB,CAC9BC,KAAM,iBACNC,KAAM,uBACNC,KAAM,uBACNC,UAAW,8BACXC,SAAU,6BACVC,WAAY,+BACZC,MAAO,wBACPC,MAAO,kCCbQC,EAASC,EAAoBC,EAAc,EAAGC,EAAW,GAAIC,EAAW,IAEvF,MAAMC,EAAaC,KAAKC,KAAKN,EAAaE,GAG1C,GAAID,EAAc,EAAG,CACpBA,EAAc,OACR,GAAIA,EAAcG,EAAY,CACpCH,EAAcG,EAGf,IAAIG,EAAmBC,EACvB,GAAIJ,GAAcD,EAAU,CAE3BI,EAAY,EACZC,EAAUJ,MACJ,CAEN,MAAMK,EAA4BJ,KAAKK,MAAMP,EAAW,GACxD,MAAMQ,EAA2BN,KAAKC,KAAKH,EAAW,GAAK,EAC3D,GAAIF,GAAeQ,EAA2B,CAE7CF,EAAY,EACZC,EAAUL,OACJ,GAAIF,EAAcU,GAA4BP,EAAY,CAEhEG,EAAYH,EAAaD,EAAW,EACpCK,EAAUJ,MACJ,CAENG,EAAYN,EAAcQ,EAC1BD,EAAUP,EAAcU,GAK1B,MAAMC,GAAcX,EAAc,GAAKC,EACvC,MAAMW,EAAWR,KAAKS,IAAIF,EAAaV,EAAW,EAAGF,EAAa,GAGlE,MAAMe,EAAQC,MAAMC,KAAKD,MAAMR,EAAU,EAAID,GAAWW,QAAQC,KAAIC,GAAKb,EAAYa,IAGrF,MAAO,CACNpB,WAAYA,EACZC,YAAaA,EACbC,SAAUA,EACVE,WAAYA,EACZG,UAAWA,EACXC,QAASA,EACTI,WAAYA,EACZC,SAAUA,EACVE,MAAOA,GChET,MAAMM,EAAmB,kzFCiBZC,EAAa,MAIzBC,YAAAC,yDASwC,sBAIL,wDAYU,iBAIM,wBAIW,iBAIA,kGAkBe,mCAIJ,mCA1DxEC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,aAAeC,EAAS,iBAkE9BP,aAAaQ,GACZC,EAAa3C,EAAiB0C,EAAUzC,EAAgBC,MAIzDgC,aAAaQ,GACZC,EAAahD,EAAiB+C,EAAUzC,EAAgBC,MAIzDgC,gBAAgBQ,GACfC,EAAa7C,EAAoB4C,EAAUzC,EAAgBC,MAG5DgC,oBACCE,KAAKQ,sBAAsBR,KAAKS,SAChCT,KAAKU,aAAaV,KAAKW,MACvBX,KAAKY,gBAAgBZ,KAAKa,SAG3Bf,2BACC,GAAIgB,IAA2B,OACxBC,EAAM,WACNf,KAAKgB,gBAILlB,sBAAsBtB,GAC7BwB,KAAKiB,WAAa3C,EAAS0B,KAAKkB,MAAO1C,EAAawB,KAAKvB,SAAUuB,KAAKtB,UAGjEoB,kBAAkBqB,EAAuBC,GAChD,GAAIpB,KAAKiB,WAAWzC,cAAgB4C,EAAM,CACzC,OAAOD,EAAgB,iBACjB,CACN,OAAOA,GAITrB,SACC,MAAMuB,EAAe,CAACD,EAAcE,KACnC,MAAMC,EAAaH,KAAU,EAC7B,MAAMI,EAAcC,EAAoBzB,KAAKiB,WAAWzC,cAAgB4C,EAAO,KAAOM,WACtF,MAAMC,EAAa3B,KAAKiB,WAAWzC,cAAgB4C,EAAO,QAAU,OACpE,OACCnB,EAAA,aAAA,CACCY,QAASb,KAAKa,QACdF,KAAMX,KAAKW,KACXiB,KAAMD,EACNE,QAAS7B,KAAKiB,WAAWzC,cAAgB4C,EAAO,KAAO,MACvDU,SAAUP,EAAUQ,YACT,IAAM/B,KAAKgC,eAAeZ,GAAKa,aAC9BjC,KAAKkC,cAAgB,IAAMd,EAAIe,eAC7BX,EACdY,MAAOvE,EAAgBO,OAEtBkD,IAIJ,OACCrB,EAACoC,EAAI,CAACD,MAAOpC,KAAKC,EAAEqC,QAAQzE,EAAgBC,MAAO8D,KAAM5B,KAAK4B,KAAMf,QAASb,KAAKa,QAASF,KAAMX,KAAKW,MACrGV,EAAA,MAAA,CAAAsC,aAAiBvC,KAAKwC,UAASC,kBAAmBzC,KAAK0C,gBACtDzC,EAAA,KAAA,CAAImC,MAAOvE,EAAgBE,MAC1BkC,EAAA,KAAA,CAAImC,MAAOO,EAAe,CAAC9E,EAAgBG,KAAMH,EAAgBI,aAC/DoD,EACArB,KAAKiB,WAAWnC,UAAYkB,KAAKiB,WAAWzC,YAAcwB,KAAKiB,WAAWzC,YAAc,GAAK,EAC7FyB,EAAA,WAAA,CAAUmC,MAAOvE,EAAgBQ,MAAOuE,KAAK,wBAI/C3C,EAAA,KAAA,CAAImC,MAAOO,EAAe,CAAC9E,EAAgBG,KAAMH,EAAgBI,aAC/DoD,EACArB,KAAKiB,WAAWnC,UAAYkB,KAAKiB,WAAWzC,YAAcwB,KAAKiB,WAAWzC,YAAc,GAAK,EAC7FyB,EAAA,WAAA,CAAUmC,MAAOvE,EAAgBQ,MAAOuE,KAAK,iBAI9C5C,KAAK4B,MAAQ,SACb3B,EAAA,KAAA,CAAImC,MAAOO,EAAe,CAAC9E,EAAgBG,KAAMH,EAAgBM,cAChE8B,EAAA,OAAA,CAAMmC,MAAOvE,EAAgBO,OAC5B6B,EAAA,OAAA,CAAM4C,GAAI7C,KAAKI,aAAc0C,OAAM,MACjC9C,KAAK+C,iBAEP9C,EAAA,kBAAA,CAAiBU,KAAK,IAAGqC,mBAAmBhD,KAAKI,cAC/CJ,KAAKiB,WAAW3B,MAAMI,KAAI0B,GAC1BnB,EAAA,SAAA,CAAQgD,MAAO7B,EAAM8B,SAAUlD,KAAKiB,WAAWzC,cAAgB4C,GAC7DA,QAONnB,EAAC7C,EAAQ,KACP4C,KAAKiB,WAAW3B,MAAMI,KAAI0B,GAC1BnB,EAAA,KAAA,CAAImC,MAAOpC,KAAKmD,kBAAkBtF,EAAgBG,KAAMoD,IAAQC,EAAaD,EAAMA,MAEpFnB,EAAA,KAAA,CAAImC,MAAOO,EAAe,CAAC9E,EAAgBG,KAAMH,EAAgBK,YAChE+B,EAAA,OAAA,CAAMmC,MAAOvE,EAAgBO,OAC5B6B,EAAA,OAAA,CAAM4C,GAAI7C,KAAKI,aAAc0C,OAAM,MACjC9C,KAAK+C,iBAEP9C,EAAA,kBAAA,CAAiBU,KAAK,IAAGqC,mBAAmBhD,KAAKI,cAChDH,EAAA,SAAA,CAAQgD,MAAM,OAAK,OAClBjD,KAAKiB,WAAW3B,MAAMI,KAAI0B,GAC1BnB,EAAA,SAAA,CAAQgD,MAAO7B,EAAM8B,SAAUlD,KAAKiB,WAAWzC,cAAgB4C,GAC7DA,SASRnB,EAAA,KAAA,CAAImC,MAAOO,EAAe,CAAC9E,EAAgBG,KAAMH,EAAgBI,aAC/DoD,EACArB,KAAKiB,WAAWtC,WAAaqB,KAAKiB,WAAWzC,YAAcwB,KAAKiB,WAAWzC,YAAc,GAAK,EAC9FyB,EAAA,WAAA,CAAUmC,MAAOvE,EAAgBQ,MAAOuE,KAAK,kBAI/C3C,EAAA,KAAA,CAAImC,MAAOO,EAAe,CAAC9E,EAAgBG,KAAMH,EAAgBI,aAC/DoD,EACArB,KAAKiB,WAAWtC,WAAaqB,KAAKiB,WAAWzC,YAAcwB,KAAKiB,WAAWtC,YAAc,EACzFsB,EAAA,WAAA,CAAUmC,MAAOvE,EAAgBQ,MAAOuE,KAAK,4BAS5C9C,eAAesB,GACtBpB,KAAKQ,sBAAsBY,GAC3BpB,KAAKoD,QAAQC,KAAIC,OAAAC,OAAA,GAAMvD,KAAKiB,aAO7BnB,qBACC0D,EAAiBxD,KAAKkC,cAAe,kBAAmBrE,EAAgBC,MACxE0F,EAAiBxD,KAAK+C,gBAAiB,oBAAqBlF,EAAgBC,MAC5E2F,EAAkBzD,KAAKwC,UAAWxC,KAAK0C,eAAgB7E,EAAgBC","sourcesContent":["export default (_, children) => [...children]\n","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","/*\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\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\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&__item .gov-button .element {\n\t\twidth: $pagination-button-size;\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\tcolor: $pagination-color;\n\t\ttext-decoration: none;\n\t}\n\n\t// HOVERS\n\t@at-root & {\n\t\tbutton#{&}__inner,\n\t\ta#{&}__inner {\n\t\t\t@include button-core();\n\t\t\ttransition: background-color $t, color $t;\n\t\t\t@include hover() {\n\t\t\t\tbackground-color: $pagination-bg-active;\n\t\t\t\tcolor: $pagination-color-active;\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}\n\t\t\t}\n\t\t}\n\n\t\t// MQ\n\t\t@include mq($from: md) {\n\t\t\t&[size=\"#{$size}\"] {\n\t\t\t\t#{$class} {\n\t\t\t\t\t&__item .gov-button .element {\n\t\t\t\t\t\twidth: 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 { PaginationClass, PaginationSizeType, PaginationSizes, PaginationVariantType, PaginationType, PaginationTypes, PaginationVariants } 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'\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\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\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<Pagination>\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\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\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\tconst buttonType = this.pagination.currentPage === page ? 'solid' : 'base'\n\t\t\treturn (\n\t\t\t\t<gov-button\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\ttype={buttonType}\n\t\t\t\t\tinverse={this.pagination.currentPage === page ? true : false}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\tgov-click={() => this.onClickHandler(page)}\n\t\t\t\t\twcag-label={this.wcagPageLabel + ' ' + page}\n\t\t\t\t\twcag-current={ariaCurrent}\n\t\t\t\t\tclass={PaginationClass.inner}\n\t\t\t\t>\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.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"double-arrow-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=\"arrow-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 size=\"m\" wcag-labelled-by={this.pageSelectId}>\n\t\t\t\t\t\t\t\t\t\t{this.pagination.pages.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<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 size=\"m\" wcag-labelled-by={this.pageSelectId}>\n\t\t\t\t\t\t\t\t\t\t\t<option value=\"...\">...</option>\n\t\t\t\t\t\t\t\t\t\t\t{this.pagination.pages.map(page => (\n\t\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\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</li>\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=\"arrow-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=\"double-arrow-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(page: number): void {\n\t\tthis.recalculatePagination(page)\n\t\tthis.govPage.emit({ ...this.pagination })\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\tvalidateWcagProp(this.wcagSelectLabel, 'wcag-select-label', PaginationClass.root)\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, PaginationClass.root)\n\t}\n}\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as o,c as a,h as e,H as t,g as i}from"./p-682c7cc6.js";import{c as r}from"./p-24636c53.js";import{a as s}from"./p-364b4792.js";import{M as d}from"./p-45485d1c.js";import{c as l}from"./p-c20102ff.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";const h='.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)}}.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 0.25rem 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__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end;padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.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.25rem 2rem 3rem}.gov-modal__close{padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 2.5rem) / 2)}.gov-modal__content{padding:1.5rem 3rem 2rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const v=class{constructor(e){o(this,e);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=r("GovPromptLabel");this.contentId=r("GovPromptContent")}validateLabelTag(o){const a=["h1","h2","h3","h4","h5","h6"];if(o){if(!a.includes(o)){c(`[${d.root}]: Tag ${o} is not allowed.`)}}}showModal(){this.open=true;document.body.classList.add(d.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(d.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(l()){await n(500);await this.validateWcag()}}render(){const o=this.labelTag;return e(t,{class:this.h.classes(d.rootPrompt),open:this.open},e("dialog",{class:d.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},e("div",{class:d.inner},e("div",{class:d.header},this.h.hasSlot("icon")&&e("div",{class:d.icon},e("slot",{name:"icon"})),this.label&&e(o,{class:d.title,id:this.labelId},this.label),e("gov-button",{class:d.close,variant:"primary",wcagLabel:this.wcagCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base","on-gov-click":this.onCloseHandler.bind(this)},e("gov-icon",{name:"cross"}))),e("div",{class:d.content,id:this.contentId},e("slot",null)),e("div",{class:d.actions},e("slot",{name:"actions"})))),e("gov-backdrop",{visible:this.open,"wcag-label":this.wcagCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}))}onCloseHandler(o){o.stopPropagation();this.hideModal();this.govClose.emit(o)}async show(){this.showModal()}async hide(){this.hideModal()}async validateWcag(){s(this.wcaglabelledBy,"aria-labelledby",d.root);s(this.wcagDescribedBy,"aria-describedby",d.root)}get host(){return i(this)}static get watchers(){return{labelTag:["validateLabelTag"]}}};v.style=h;export{v as gov_prompt};
|
|
2
|
-
//# sourceMappingURL=p-08f14c8b.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/src/components/gov-promp/gov-prompt.scss?tag=gov-prompt","../../../packages/core/src/components/gov-promp/gov-prompt.tsx"],"names":["govPromptCss","GovPrompt","[object Object]","hostRef","this","h","govHost","host","labelId","createID","contentId","newValue","validTags","includes","govErrorLog","ModalClass","root","open","document","body","classList","add","bodyFix","remove","showModal","hideModal","canValidateWcagOnRender","delay","validateWcag","LabelTag","labelTag","Host","class","classes","rootPrompt","dialog","hidden","tabindex","aria-modal","aria-hidden","toBoolAttr","aria-labelledby","wcaglabelledBy","aria-describedby","wcagDescribedBy","role","inner","header","hasSlot","icon","name","label","title","id","close","variant","wcagLabel","wcagCloseLabel","wcagLabelledBy","wcagCloseLabelledBy","type","on-gov-click","onCloseHandler","bind","content","actions","visible","wcag-label","wcag-labelled-by","e","stopPropagation","govClose","emit","validateWcagRef"],"mappings":"mUAAA,MAAMA,EAAe,4sFCeRC,EAAS,MAKrBC,YAAAC,2DAUe,qCAQqB,uBAI0B,mIArB7DC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,QAAUC,EAAS,kBACxBL,KAAKM,UAAYD,EAAS,oBA0C3BP,iBAAiBS,GAChB,MAAMC,EAAY,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,MACjD,GAAID,EAAU,CACb,IAAKC,EAAUC,SAASF,GAAW,CAClCG,EAAY,IAAIC,EAAWC,cAAcL,uBAKpCT,YACPE,KAAKa,KAAO,KACZC,SAASC,KAAKC,UAAUC,IAAIN,EAAWO,SAGhCpB,YACPE,KAAKa,KAAO,MACZC,SAASC,KAAKC,UAAUG,OAAOR,EAAWO,SAG3CpB,4BACC,GAAIE,KAAKa,KAAM,CACdb,KAAKoB,gBACC,CACNpB,KAAKqB,aAIPvB,2BACC,GAAIwB,IAA2B,OACxBC,EAAM,WACNvB,KAAKwB,gBAIb1B,SACC,MAAM2B,EAAWzB,KAAK0B,SACtB,OACCzB,EAAC0B,EAAI,CAACC,MAAO5B,KAAKC,EAAE4B,QAAQlB,EAAWmB,YAAajB,KAAMb,KAAKa,MAC9DZ,EAAA,SAAA,CACC2B,MAAOjB,EAAWoB,OAClBC,QAAShC,KAAKa,KACdoB,SAAS,KACTpB,KAAMb,KAAKa,KAAIqB,aACJ,OAAMC,cACJC,GAAYpC,KAAKa,MAAKwB,kBAClBrC,KAAKsC,gBAAkBtC,KAAKI,QAAOmC,mBAClCvC,KAAKwC,iBAAmBxC,KAAKM,UAC/CmC,KAAMzC,KAAKyC,MAEXxC,EAAA,MAAA,CAAK2B,MAAOjB,EAAW+B,OACtBzC,EAAA,MAAA,CAAK2B,MAAOjB,EAAWgC,QACrB3C,KAAKC,EAAE2C,QAAQ,SACf3C,EAAA,MAAA,CAAK2B,MAAOjB,EAAWkC,MACtB5C,EAAA,OAAA,CAAM6C,KAAK,UAGZ9C,KAAK+C,OACL9C,EAACwB,EAAQ,CAACG,MAAOjB,EAAWqC,MAAOC,GAAIjD,KAAKI,SAC1CJ,KAAK+C,OAGR9C,EAAA,aAAA,CACC2B,MAAOjB,EAAWuC,MAClBC,QAAQ,UACRC,UAAWpD,KAAKqD,eAChBC,eAAgBtD,KAAKuD,oBACrBC,KAAK,OAAMC,eACGzD,KAAK0D,eAAeC,KAAK3D,OAEvCC,EAAA,WAAA,CAAU6C,KAAK,YAGjB7C,EAAA,MAAA,CAAK2B,MAAOjB,EAAWiD,QAASX,GAAIjD,KAAKM,WACxCL,EAAA,OAAA,OAEDA,EAAA,MAAA,CAAK2B,MAAOjB,EAAWkD,SACtB5D,EAAA,OAAA,CAAM6C,KAAK,eAKd7C,EAAA,eAAA,CACC6D,QAAS9D,KAAKa,KAAIkD,aACN/D,KAAKqD,eAAcW,mBACbhE,KAAKuD,oBAAmBE,eAC5BzD,KAAK0D,eAAeC,KAAK3D,SAMnCF,eAAemE,GACtBA,EAAEC,kBACFlE,KAAKqB,YACLrB,KAAKmE,SAASC,KAAKH,GAOpBnE,aACCE,KAAKoB,YAONtB,aACCE,KAAKqB,YAONvB,qBACCuE,EAAgBrE,KAAKsC,eAAgB,kBAAmB3B,EAAWC,MACnEyD,EAAgBrE,KAAKwC,gBAAiB,mBAAoB7B,EAAWC","sourcesContent":["/*\n * Prompt\n */\n\n// $class: \".gov-prompt\";\n@import \"../gov-modal/gov-modal.scss\";\n\n// #{$class} {\n// \t//\n// }\n","import { Component, Event, Element, EventEmitter, h, Host, Method, Prop, Watch } from '@stencil/core'\nimport { createID } from '../../utils/string.utils'\nimport { validateWcagRef } from '../../helpers/Validate/wcag'\nimport { ModalClass } from '../gov-modal/constants'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { toBoolAttr } from '../../helpers/Dom/template'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { govErrorLog } from '../../helpers/Log/gov.log'\n\n@Component({\n\ttag: 'gov-prompt',\n\tstyleUrl: 'gov-prompt.scss',\n})\nexport class GovPrompt {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovPromptLabel')\n\t\tthis.contentId = createID('GovPromptContent')\n\t}\n\n\t@Element() host: HTMLGovPromptElement\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop() open = false\n\t/**\n\t * Title of modal window\n\t */\n\t@Prop() label: string\n\t/**\n\t * Role of modal\n\t */\n\t@Prop({ attribute: 'role' }) role = 'dialog'\n\t/**\n\t * Used to change the HMTL tag in the modal label for correct semantic structure\n\t */\n\t@Prop({ attribute: 'label-tag' }) readonly labelTag: string = 'h2'\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) wcaglabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the modal.\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) wcagDescribedBy: string\n\t/**\n\t * Adds accessible label for the modal close button that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-close-label' }) wcagCloseLabel: string\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the modal window\n\t */\n\t@Prop({ attribute: 'wcag-close-labelled-by' }) wcagCloseLabelledBy: string\n\t/**\n\t * Emitted when modal window closes.\n\t */\n\t@Event({ eventName: 'gov-close' }) govClose: EventEmitter<PointerEvent>\n\n\t@Watch('labelTag')\n\tvalidateLabelTag(newValue: string): void {\n\t\tconst validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\n\t\t\tthis.showModal()\n\t\t} else {\n\t\t\tthis.hideModal()\n\t\t}\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\trender() {\n\t\tconst LabelTag = this.labelTag\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ModalClass.rootPrompt)} open={this.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\taria-labelledby={this.wcaglabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.wcagDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={ModalClass.inner}>\n\t\t\t\t\t\t<div class={ModalClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t\t\t<div class={ModalClass.icon}>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.label && (\n\t\t\t\t\t\t\t\t<LabelTag class={ModalClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t\t\t</LabelTag>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\tclass={ModalClass.close}\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\twcagLabel={this.wcagCloseLabel}\n\t\t\t\t\t\t\t\twcagLabelledBy={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<gov-icon name=\"cross\" />\n\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={ModalClass.content} id={this.contentId}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={ModalClass.actions}>\n\t\t\t\t\t\t\t<slot name=\"actions\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t<gov-backdrop\n\t\t\t\t\tvisible={this.open}\n\t\t\t\t\twcag-label={this.wcagCloseLabel}\n\t\t\t\t\twcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t/>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\tthis.hideModal()\n\t\tthis.govClose.emit(e)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hidding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideModal()\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcaglabelledBy, 'aria-labelledby', ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'aria-describedby', ModalClass.root)\n\t}\n}\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as o,H as i,g as r}from"./p-682c7cc6.js";import{t as l}from"./p-3f37ddb6.js";import{F as s,a,b as n}from"./p-ef79904e.js";import{v as c}from"./p-26acf964.js";import{a as m,b as v}from"./p-364b4792.js";import{c as g}from"./p-c20102ff.js";import{c as f,r as u}from"./p-24636c53.js";import{d}from"./p-03990da5.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-561fa17b.js";const h='.gov-form-multi-select__list{margin:0;padding:0}.gov-form-multi-select__list>.gov-form-multi-select__item{margin:0;padding:0;background:none}.gov-form-multi-select__list>.gov-form-multi-select__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)}}.gov-form-multi-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-multi-select .element{position:relative;flex:1 1 auto}.gov-form-multi-select input,.gov-form-multi-select select,.gov-form-multi-select textarea{width:100%;border:var(--gov-form-input-border-width, 0.0625rem solid var(--gov-color-secondary-700));border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));color:var(--gov-form-input-color, var(--gov-color-secondary-700));font-family:var(--gov-font-family, "Roboto", sans-serif)}.gov-form-multi-select input:focus,.gov-form-multi-select select:focus,.gov-form-multi-select textarea:focus{outline:none}.gov-form-multi-select input:focus-visible,.gov-form-multi-select select:focus-visible,.gov-form-multi-select textarea:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-form-multi-select input::-moz-placeholder,.gov-form-multi-select select::-moz-placeholder,.gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select input::placeholder,.gov-form-multi-select select::placeholder,.gov-form-multi-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select textarea{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);padding:0.5rem 0.75rem;resize:none}.gov-form-multi-select *[slot=left-icon],.gov-form-multi-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;color:var(--gov-form-input-icon-color, var(--gov-color-primary));transform:translateY(-50%);pointer-events:none}.gov-form-multi-select *[slot=left-icon]{left:0}.gov-form-multi-select *[slot=right-icon]{right:0}[disabled=""].gov-form-multi-select,[disabled=true i].gov-form-multi-select,[disabled="1"].gov-form-multi-select{pointer-events:none}[disabled=""].gov-form-multi-select input,[disabled=""].gov-form-multi-select select,[disabled=""].gov-form-multi-select textarea,[disabled=true i].gov-form-multi-select input,[disabled=true i].gov-form-multi-select select,[disabled=true i].gov-form-multi-select textarea,[disabled="1"].gov-form-multi-select input,[disabled="1"].gov-form-multi-select select,[disabled="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-multi-select *[slot=left-icon],[disabled=""].gov-form-multi-select *[slot=right-icon],[disabled=true i].gov-form-multi-select *[slot=left-icon],[disabled=true i].gov-form-multi-select *[slot=right-icon],[disabled="1"].gov-form-multi-select *[slot=left-icon],[disabled="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[invalid=""].gov-form-multi-select input,[invalid=""].gov-form-multi-select select,[invalid=""].gov-form-multi-select textarea,[invalid=true i].gov-form-multi-select input,[invalid=true i].gov-form-multi-select select,[invalid=true i].gov-form-multi-select textarea,[invalid="1"].gov-form-multi-select input,[invalid="1"].gov-form-multi-select select,[invalid="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-multi-select input::-moz-placeholder,[invalid=""].gov-form-multi-select select::-moz-placeholder,[invalid=""].gov-form-multi-select textarea::-moz-placeholder,[invalid=true i].gov-form-multi-select input::-moz-placeholder,[invalid=true i].gov-form-multi-select select::-moz-placeholder,[invalid=true i].gov-form-multi-select textarea::-moz-placeholder,[invalid="1"].gov-form-multi-select input::-moz-placeholder,[invalid="1"].gov-form-multi-select select::-moz-placeholder,[invalid="1"].gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select input::placeholder,[invalid=""].gov-form-multi-select select::placeholder,[invalid=""].gov-form-multi-select textarea::placeholder,[invalid=true i].gov-form-multi-select input::placeholder,[invalid=true i].gov-form-multi-select select::placeholder,[invalid=true i].gov-form-multi-select textarea::placeholder,[invalid="1"].gov-form-multi-select input::placeholder,[invalid="1"].gov-form-multi-select select::placeholder,[invalid="1"].gov-form-multi-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select *[slot=left-icon],[invalid=""].gov-form-multi-select *[slot=right-icon],[invalid=true i].gov-form-multi-select *[slot=left-icon],[invalid=true i].gov-form-multi-select *[slot=right-icon],[invalid="1"].gov-form-multi-select *[slot=left-icon],[invalid="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[invalid="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[success=""].gov-form-multi-select *[slot=right-icon],[success=true i].gov-form-multi-select *[slot=right-icon],[success="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}[size=m].gov-form-multi-select{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);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select input,[size=m].gov-form-multi-select select{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);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-multi-select *[slot=left-icon],[size=m].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=right-icon]~input,[size=m].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-multi-select{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);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select input,[size=l].gov-form-multi-select select{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);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-multi-select *[slot=left-icon],[size=l].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=right-icon]~input,[size=l].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-multi-select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select input,[size=xl].gov-form-multi-select select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-multi-select *[slot=left-icon],[size=xl].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=right-icon]~input,[size=xl].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}.gov-form-multi-select{background:none}.gov-form-multi-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-multi-select select::-ms-expand{display:none}[size=m].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-m-arrow-right-position, 1rem);width:var(--gov-form-select-m-arrow-size, 0.5rem);height:var(--gov-form-select-m-arrow-size, 0.5rem)}[size=l].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-l-arrow-right-position, 1rem);width:var(--gov-form-select-l-arrow-size, 0.5rem);height:var(--gov-form-select-l-arrow-size, 0.5rem)}[size=xl].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-xl-arrow-right-position, 1.3125rem);width:var(--gov-form-select-xl-arrow-size, 0.625rem);height:var(--gov-form-select-xl-arrow-size, 0.625rem)}.gov-form-multi-select{flex-wrap:wrap}.gov-form-multi-select__wrap{display:flex;gap:0.5rem;width:100%}.gov-form-multi-select__list{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:flex;gap:0.5rem;flex-wrap:wrap}.gov-form-multi-select__list>.gov-form-multi-select__item{position:relative;display:flex;flex:0 0 auto;align-items:center;padding:0rem 0rem 0rem 0.5rem;background:var(--gov-form-multiselect-bg, var(--gov-color-primary-200));transition:150ms linear background-color}';const p=class{constructor(o){e(this,o);this.govFocus=t(this,"gov-focus",7);this.govBlur=t(this,"gov-blur",7);this.govChange=t(this,"gov-change",7);this.identifier=undefined;this.placeholder=undefined;this.variant=undefined;this.size="m";this.name=undefined;this.required=false;this.disabled=undefined;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.value=undefined;this.selectedOptions=[];this.selectId=f("GovSelect");this.listId=f("GovMultiList")}validateVariant(e){c(a,e,s.root)}validateSize(e){c(n,e,s.root)}emitChange(e){this.govChange.emit(e)}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size)}getAvailableOptions(){return Array.from(this.selectRef.querySelectorAll("option")).filter((e=>!(e.disabled||e.selected))).map((e=>({name:e.textContent,value:e.value})))}initAutocomplete(){this.autocompleteRef.addEventListener("gov-select",this.onSelectHandler.bind(this));this.autocompleteRef.addEventListener("gov-input",this.onInputHandler.bind(this));this.autocompleteRef.addEventListener("gov-focus",this.onFocusHandler.bind(this));this.autocompleteRef.addEventListener("gov-blur",this.onBlurHandler.bind(this));this.autocompleteRef.setSearchCallback((e=>new Promise((t=>{const o=this.getAvailableOptions();if(String(e).length===0){return t(o)}t(o.filter((({name:t})=>{if(!t)return false;return u(t).toLowerCase().indexOf(u(e).toLowerCase())>-1})))})))).then()}getOptionIndex(e){return this.selectedOptions.findIndex((t=>t.value===e.value&&t.name===e.name))}getOptionElement(e){return this.selectRef.querySelector('option[value="'+e.value+'"]')}selectOption(e){const t=this.getOptionIndex(e);if(t===-1){this.selectedOptions=[...this.selectedOptions,e];const t=this.getOptionElement(e);if(t){t.selected=true}}}removeOption(e){const t=this.getOptionIndex(e);if(t!==-1){this.selectedOptions.splice(t,1);this.selectedOptions=[...this.selectedOptions];const o=this.getOptionElement(e);if(o){o.selected=false}}}async componentDidRender(){this.initAutocomplete();await d(0);this.selectRef.querySelectorAll("option").forEach((e=>{if(e.selected){this.selectOption({name:e.textContent,value:e.value})}}));if(g()){await d(500);await this.validateWcag()}}render(){return o(i,{class:s.root,size:this.size,variant:this.variant},o("div",{class:s.wrap},o("div",{class:"element"},o("gov-form-autocomplete",{value:this.value,disabled:this.disabled,identifier:this.identifier||this.selectId,required:false,size:this.size,variant:this.variant,invalid:this.invalid,placeholder:this.placeholder,ref:e=>this.autocompleteRef=e,minlength:0,wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:this.listId}),o("gov-icon",{slot:"right-icon",class:"icon-arrow",name:"arrow-down"}),o("select",{hidden:true,"aria-hidden":true,multiple:true,required:this.required,name:this.name,disabled:this.disabled,ref:e=>this.selectRef=e,"aria-disabled":l(this.disabled),"aria-required":l(this.required),"aria-invalid":l(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns},o("slot",null)))),o("ul",{role:"listbox",id:this.listId,class:s.list},this.selectedOptions.map((e=>o("li",{class:s.item,role:"option"},e.name,o("gov-button",{wcagLabel:"Odebrat vybranou položku "+e.name,variant:"primary",type:"base",size:"s","on-gov-click":()=>this.onTagRemove(e)},o("gov-icon",{name:"cross"})))))))}onFocusHandler(e){this.focused=true;this.govFocus.emit(e)}onBlurHandler(e){this.focused=false;this.govBlur.emit(e)}onInputHandler(e){this.value=e.target.value;e.stopPropagation()}onSelectHandler(e){const t=e.detail;this.selectOption(t);this.value="";this.autocompleteRef.clearValue();this.autocompleteRef.focus()}onTagRemove(e){this.removeOption(e)}async setFocus(e){return this.selectRef.focus(e)}async setValue(e){this.value=e}async getInstance(){return this.selectRef}async validateWcag(){m(this.wcagDescribedBy,"wcag-described-by",s.root);m(this.wcagLabelledBy,"wcag-labelled-by",s.root);m(this.wcagOwns,"wcag-owns",s.root);v(this.identifier||this.selectId,this.wcagLabelledBy,s.root)}get host(){return r(this)}static get watchers(){return{variant:["validateVariant"],size:["validateSize"],selectedOptions:["emitChange"]}}};p.style=h;export{p as gov_form_multi_select};
|
|
2
|
-
//# sourceMappingURL=p-0a152bb7.entry.js.map
|
package/dist/core/p-14f8f2fb.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{S as o}from"./p-55500e5a.js";import{V as t}from"./p-ff7365ae.js";import{p as s}from"./p-03990da5.js";const a=s(o,["_S","_M","_L","_XL"]);const n=s(t,["PRIMARY","SECONDARY","SUCCESS","ERROR","WARNING"]);var r;(function(o){o["SOLID"]="solid";o["OUTLINED"]="outlined";o["BASE"]="base"})(r||(r={}));var i;(function(o){o["SUBMIT"]="submit";o["BUTTON"]="button";o["RESET"]="reset"})(i||(i={}));var e;(function(o){o["BLANK"]="_blank";o["SELF"]="_self";o["NEW"]="_new"})(e||(e={}));const f={root:"gov-button",rootWithIcon:"gov-button--w-icon"};export{n as B,i as N,r as T,a,f as b};
|
|
2
|
-
//# sourceMappingURL=p-14f8f2fb.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/core/src/components/gov-button/constants.ts"],"names":["ButtonSizes","pick","Sizes","ButtonVariants","Variants","Type","NativeType","ButtonTarget","ButtonClass","root","rootWithIcon"],"mappings":"kHAKaA,EAAcC,EAAKC,EAAO,CAAC,KAAM,KAAM,KAAM,cAG7CC,EAAiBF,EAAKG,EAAU,CAAC,UAAW,YAAa,UAAW,QAAS,gBAG9EC,GAAZ,SAAYA,GACXA,EAAA,SAAA,QACAA,EAAA,YAAA,WACAA,EAAA,QAAA,QAHD,CAAYA,IAAAA,EAAI,SAQJC,GAAZ,SAAYA,GACXA,EAAA,UAAA,SACAA,EAAA,UAAA,SACAA,EAAA,SAAA,SAHD,CAAYA,IAAAA,EAAU,KAQtB,IAAYC,GAAZ,SAAYA,GACXA,EAAA,SAAA,SACAA,EAAA,QAAA,QACAA,EAAA,OAAA,QAHD,CAAYA,IAAAA,EAAY,WAOXC,EAAc,CAC1BC,KAAM,aACNC,aAAc","sourcesContent":["import { Sizes } from '../../core/constants/sizes'\nimport { Variants } from '../../core/constants/variants'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const ButtonSizes = pick(Sizes, ['_S', '_M', '_L', '_XL'])\nexport type ButtonSizesType = `${ValueOf<typeof ButtonSizes>}`\n\nexport const ButtonVariants = pick(Variants, ['PRIMARY', 'SECONDARY', 'SUCCESS', 'ERROR', 'WARNING'])\nexport type ButtonVariantType = `${ValueOf<typeof ButtonVariants>}`\n\nexport enum Type {\n\tSOLID = 'solid',\n\tOUTLINED = 'outlined',\n\tBASE = 'base',\n}\n\nexport type TypesType = `${ValueOf<typeof Type>}`\n\nexport enum NativeType {\n\tSUBMIT = 'submit',\n\tBUTTON = 'button',\n\tRESET = 'reset',\n}\n\nexport type NativeTypesType = `${ValueOf<typeof NativeType>}`\n\nexport enum ButtonTarget {\n\tBLANK = '_blank',\n\tSELF = '_self',\n\tNEW = '_new',\n}\nexport type ButtonTargetType = `${ValueOf<typeof ButtonTarget>}`\n\nexport const ButtonClass = {\n\troot: 'gov-button',\n\trootWithIcon: 'gov-button--w-icon',\n}\n"]}
|