@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
|
@@ -162,6 +162,9 @@
|
|
|
162
162
|
/*
|
|
163
163
|
- Variables - Form multiselect
|
|
164
164
|
*/
|
|
165
|
+
/*
|
|
166
|
+
- Variables - Form password power
|
|
167
|
+
*/
|
|
165
168
|
/*
|
|
166
169
|
- Variables - Form checkbox & radio
|
|
167
170
|
*/
|
|
@@ -221,6 +224,7 @@
|
|
|
221
224
|
.gov-pagination__list {
|
|
222
225
|
display: flex;
|
|
223
226
|
align-items: center;
|
|
227
|
+
flex-wrap: wrap;
|
|
224
228
|
font-weight: bold;
|
|
225
229
|
text-align: center;
|
|
226
230
|
}
|
|
@@ -241,9 +245,6 @@
|
|
|
241
245
|
overflow: visible;
|
|
242
246
|
padding: 0rem 1rem;
|
|
243
247
|
}
|
|
244
|
-
.gov-pagination__item .gov-button .element {
|
|
245
|
-
width: var(--gov-pagination-button-size, 2rem);
|
|
246
|
-
}
|
|
247
248
|
.gov-pagination__arrow {
|
|
248
249
|
margin: 0;
|
|
249
250
|
}
|
|
@@ -260,37 +261,88 @@
|
|
|
260
261
|
align-items: center;
|
|
261
262
|
align-self: stretch;
|
|
262
263
|
width: 100%;
|
|
263
|
-
color: var(--gov-pagination-color, var(--gov-color-primary));
|
|
264
264
|
text-decoration: none;
|
|
265
265
|
}
|
|
266
|
-
.gov-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
.gov-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
266
|
+
.gov-pagination__inner[wcag-current=true][type=solid][variant=primary] .element {
|
|
267
|
+
background-color: var(--gov-button-primary-solid-hover-bg, var(--gov-color-primary-700));
|
|
268
|
+
color: var(--gov-button-primary-solid-hover-color, var(--gov-color-neutral-white));
|
|
269
|
+
}
|
|
270
|
+
.gov-pagination__inner[wcag-current=true][type=outlined][variant=primary] .element {
|
|
271
|
+
background-color: var(--gov-button-primary-outlined-hover-bg, var(--gov-color-primary-100));
|
|
272
|
+
color: var(--gov-button-primary-outlined-hover-color, var(--gov-color-primary));
|
|
273
|
+
}
|
|
274
|
+
.gov-pagination__inner[wcag-current=true][type=base][variant=primary] .element {
|
|
275
|
+
background-color: var(--gov-button-primary-base-hover-bg, var(--gov-color-primary-100));
|
|
276
|
+
color: var(--gov-button-primary-base-hover-color, var(--gov-color-primary));
|
|
277
|
+
}
|
|
278
|
+
.gov-pagination__inner[wcag-current=true][type=link][variant=primary] .element {
|
|
279
|
+
background-color: var(--gov-button-primary-link-hover-bg, transparent);
|
|
280
|
+
color: var(--gov-button-primary-link-hover-color, var(--gov-color-primary));
|
|
281
|
+
}
|
|
282
|
+
.gov-pagination__inner[wcag-current=true][type=solid][variant=secondary] .element {
|
|
283
|
+
background-color: var(--gov-button-secondary-solid-hover-bg, var(--gov-color-secondary-900));
|
|
284
|
+
color: var(--gov-button-secondary-solid-hover-color, var(--gov-color-neutral-white));
|
|
285
|
+
}
|
|
286
|
+
.gov-pagination__inner[wcag-current=true][type=outlined][variant=secondary] .element {
|
|
287
|
+
background-color: var(--gov-button-secondary-outlined-hover-bg, var(--gov-color-secondary-300));
|
|
288
|
+
color: var(--gov-button-secondary-outlined-hover-color, var(--gov-color-secondary));
|
|
289
|
+
}
|
|
290
|
+
.gov-pagination__inner[wcag-current=true][type=base][variant=secondary] .element {
|
|
291
|
+
background-color: var(--gov-button-secondary-base-hover-bg, var(--gov-color-secondary-300));
|
|
292
|
+
color: var(--gov-button-secondary-base-hover-color, var(--gov-color-secondary));
|
|
293
|
+
}
|
|
294
|
+
.gov-pagination__inner[wcag-current=true][type=link][variant=secondary] .element {
|
|
295
|
+
background-color: var(--gov-button-secondary-link-hover-bg, transparent);
|
|
296
|
+
color: var(--gov-button-secondary-link-hover-color, var(--gov-color-secondary));
|
|
297
|
+
}
|
|
298
|
+
.gov-pagination__inner[wcag-current=true][type=solid][variant=error] .element {
|
|
299
|
+
background-color: var(--gov-button-error-solid-hover-bg, var(--gov-color-error-500));
|
|
300
|
+
color: var(--gov-button-error-solid-hover-color, var(--gov-color-neutral-white));
|
|
301
|
+
}
|
|
302
|
+
.gov-pagination__inner[wcag-current=true][type=outlined][variant=error] .element {
|
|
303
|
+
background-color: var(--gov-button-error-outlined-hover-bg, var(--gov-color-error-100));
|
|
304
|
+
color: var(--gov-button-error-outlined-hover-color, var(--gov-color-error));
|
|
305
|
+
}
|
|
306
|
+
.gov-pagination__inner[wcag-current=true][type=base][variant=error] .element {
|
|
307
|
+
background-color: var(--gov-button-error-base-hover-bg, var(--gov-color-error-100));
|
|
308
|
+
color: var(--gov-button-error-base-hover-color, var(--gov-color-error));
|
|
309
|
+
}
|
|
310
|
+
.gov-pagination__inner[wcag-current=true][type=link][variant=error] .element {
|
|
311
|
+
background-color: var(--gov-button-error-link-hover-bg, transparent);
|
|
312
|
+
color: var(--gov-button-error-link-hover-color, var(--gov-color-error));
|
|
313
|
+
}
|
|
314
|
+
.gov-pagination__inner[wcag-current=true][type=solid][variant=success] .element {
|
|
315
|
+
background-color: var(--gov-button-success-solid-hover-bg, var(--gov-color-success-600));
|
|
316
|
+
color: var(--gov-button-success-solid-hover-color, var(--gov-color-neutral-white));
|
|
317
|
+
}
|
|
318
|
+
.gov-pagination__inner[wcag-current=true][type=outlined][variant=success] .element {
|
|
319
|
+
background-color: var(--gov-button-success-outlined-hover-bg, var(--gov-color-success-100));
|
|
320
|
+
color: var(--gov-button-success-outlined-hover-color, var(--gov-color-success-500));
|
|
321
|
+
}
|
|
322
|
+
.gov-pagination__inner[wcag-current=true][type=base][variant=success] .element {
|
|
323
|
+
background-color: var(--gov-button-success-base-hover-bg, var(--gov-color-success-100));
|
|
324
|
+
color: var(--gov-button-success-base-hover-color, var(--gov-color-success-500));
|
|
325
|
+
}
|
|
326
|
+
.gov-pagination__inner[wcag-current=true][type=link][variant=success] .element {
|
|
327
|
+
background-color: var(--gov-button-success-link-hover-bg, transparent);
|
|
328
|
+
color: var(--gov-button-success-link-hover-color, var(--gov-color-success-500));
|
|
329
|
+
}
|
|
330
|
+
.gov-pagination__inner[wcag-current=true][type=solid][variant=warning] .element {
|
|
331
|
+
background-color: var(--gov-button-warning-solid-hover-bg, var(--gov-color-warning-600));
|
|
332
|
+
color: var(--gov-button-warning-solid-hover-color, var(--gov-color-neutral-white));
|
|
333
|
+
}
|
|
334
|
+
.gov-pagination__inner[wcag-current=true][type=outlined][variant=warning] .element {
|
|
335
|
+
background-color: var(--gov-button-warning-outlined-hover-bg, var(--gov-color-warning-200));
|
|
336
|
+
color: var(--gov-button-warning-outlined-hover-color, var(--gov-color-warning-500));
|
|
337
|
+
}
|
|
338
|
+
.gov-pagination__inner[wcag-current=true][type=base][variant=warning] .element {
|
|
339
|
+
background-color: var(--gov-button-warning-base-hover-bg, var(--gov-color-warning-200));
|
|
340
|
+
color: var(--gov-button-warning-base-hover-color, var(--gov-color-warning-500));
|
|
341
|
+
}
|
|
342
|
+
.gov-pagination__inner[wcag-current=true][type=link][variant=warning] .element {
|
|
343
|
+
background-color: var(--gov-button-warning-link-hover-bg, transparent);
|
|
344
|
+
color: var(--gov-button-warning-link-hover-color, var(--gov-color-warning-500));
|
|
292
345
|
}
|
|
293
|
-
|
|
294
346
|
.gov-pagination[size=s] .gov-pagination__inner {
|
|
295
347
|
font-weight: var(--gov-text-s-font-weight);
|
|
296
348
|
font-size: var(--gov-text-s-font-size);
|
|
@@ -298,10 +350,8 @@
|
|
|
298
350
|
letter-spacing: var(--gov-text-s-letter-spacing);
|
|
299
351
|
font-weight: inherit;
|
|
300
352
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
width: var(--gov-pagination-s-button-size, 2rem);
|
|
304
|
-
}
|
|
353
|
+
.gov-pagination[size=s] .gov-pagination__inner .element {
|
|
354
|
+
min-width: var(--gov-pagination-s-button-size, 2rem);
|
|
305
355
|
}
|
|
306
356
|
.gov-pagination[size=m] .gov-pagination__inner {
|
|
307
357
|
font-weight: var(--gov-text-m-font-weight);
|
|
@@ -310,8 +360,6 @@
|
|
|
310
360
|
letter-spacing: var(--gov-text-m-letter-spacing);
|
|
311
361
|
font-weight: inherit;
|
|
312
362
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
width: var(--gov-pagination-m-button-size, 2.5rem);
|
|
316
|
-
}
|
|
363
|
+
.gov-pagination[size=m] .gov-pagination__inner .element {
|
|
364
|
+
min-width: var(--gov-pagination-m-button-size, 2.5rem);
|
|
317
365
|
}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import Fragment from
|
|
2
|
-
import { h, Host } from
|
|
3
|
-
import { validateProp } from
|
|
4
|
-
import { PaginationClass, PaginationSizes, PaginationTypes, PaginationVariants } from
|
|
5
|
-
import { govHost, prepareClasses } from
|
|
6
|
-
import { paginate } from
|
|
7
|
-
import { toBoolAttrIfDefined } from
|
|
8
|
-
import { validateWcagLabel, validateWcagProp } from
|
|
9
|
-
import { canValidateWcagOnRender } from
|
|
10
|
-
import { delay } from
|
|
11
|
-
import { createID } from
|
|
1
|
+
import Fragment from "../../helpers/Fragment";
|
|
2
|
+
import { h, Host } from "@stencil/core";
|
|
3
|
+
import { validateProp } from "../../helpers/Validate/props";
|
|
4
|
+
import { PaginationClass, PaginationSizes, PaginationTypes, PaginationVariants, } from "./constants";
|
|
5
|
+
import { govHost, prepareClasses } from "../../helpers/Dom/template";
|
|
6
|
+
import { paginate } from "./pagination";
|
|
7
|
+
import { toBoolAttrIfDefined } from "../../helpers/Dom/template";
|
|
8
|
+
import { validateWcagLabel, validateWcagProp } from "../../helpers/Validate/wcag";
|
|
9
|
+
import { canValidateWcagOnRender } from "../../helpers/Dom/win";
|
|
10
|
+
import { delay } from "../../utils/utils";
|
|
11
|
+
import { createID } from "../../utils/string.utils";
|
|
12
|
+
import { createArrayRange } from "../../utils/array.utils";
|
|
12
13
|
export class GovPagination {
|
|
13
14
|
constructor() {
|
|
14
|
-
this.type =
|
|
15
|
+
this.type = "button";
|
|
15
16
|
this.current = 1;
|
|
16
17
|
this.total = undefined;
|
|
17
18
|
this.inverse = undefined;
|
|
18
|
-
this.size =
|
|
19
|
-
this.variant =
|
|
19
|
+
this.size = "m";
|
|
20
|
+
this.variant = "primary";
|
|
20
21
|
this.pageSize = 10;
|
|
21
22
|
this.maxPages = 5;
|
|
22
23
|
this.link = undefined;
|
|
23
24
|
this.wcagLabel = undefined;
|
|
24
25
|
this.wcagLabelledBy = undefined;
|
|
25
|
-
this.wcagSelectLabel =
|
|
26
|
-
this.wcagPageLabel =
|
|
26
|
+
this.wcagSelectLabel = "Vybrat stranu";
|
|
27
|
+
this.wcagPageLabel = "Strana";
|
|
27
28
|
this.pagination = undefined;
|
|
28
29
|
this.h = govHost(this.host);
|
|
29
|
-
this.pageSelectId = createID(
|
|
30
|
+
this.pageSelectId = createID("GovPageSelect");
|
|
30
31
|
}
|
|
31
32
|
validateType(newValue) {
|
|
32
33
|
validateProp(PaginationTypes, newValue, PaginationClass.root);
|
|
@@ -53,32 +54,65 @@ export class GovPagination {
|
|
|
53
54
|
}
|
|
54
55
|
isActivePageClass(originalClass, page) {
|
|
55
56
|
if (this.pagination.currentPage === page) {
|
|
56
|
-
return originalClass +
|
|
57
|
+
return originalClass + " is-active";
|
|
57
58
|
}
|
|
58
59
|
else {
|
|
59
60
|
return originalClass;
|
|
60
61
|
}
|
|
61
62
|
}
|
|
63
|
+
prepareLinkUrl(page) {
|
|
64
|
+
if (this.link) {
|
|
65
|
+
return String(this.link).replace("{PAGE}", String(page));
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
resetSelectValue() {
|
|
70
|
+
if (this.spreadSelectRef) {
|
|
71
|
+
this.spreadSelectRef.getInstance()
|
|
72
|
+
.then((el) => {
|
|
73
|
+
el.value = '...';
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
62
77
|
render() {
|
|
63
78
|
const pageResolver = (page, content) => {
|
|
64
79
|
const isDisabled = page === -1;
|
|
65
80
|
const ariaCurrent = toBoolAttrIfDefined(this.pagination.currentPage === page ? true : undefined);
|
|
66
|
-
|
|
67
|
-
return (h("gov-button", { variant: this.variant, size: this.size, type: buttonType, inverse: this.pagination.currentPage === page ? true : false, disabled: isDisabled, "gov-click": () => this.onClickHandler(page), "wcag-label": this.wcagPageLabel + ' ' + page, "wcag-current": ariaCurrent, class: PaginationClass.inner }, content));
|
|
81
|
+
return (h("gov-button", { href: this.prepareLinkUrl(page), variant: this.variant, size: this.size, type: "base", disabled: isDisabled, "on-gov-click": (e) => this.onClickHandler(e, page), "wcag-label": page > -1 ? this.wcagPageLabel + " " + page : undefined, "wcag-current": ariaCurrent, class: PaginationClass.inner }, content));
|
|
68
82
|
};
|
|
69
|
-
return (h(Host, { class: this.h.classes(PaginationClass.root), type: this.type, variant: this.variant, size: this.size }, h("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, h("ul", { class: PaginationClass.list }, h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.
|
|
83
|
+
return (h(Host, { class: this.h.classes(PaginationClass.root), type: this.type, variant: this.variant, size: this.size }, h("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, h("ul", { class: PaginationClass.list }, h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.currentPage > 1 ? 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-left" }))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-left" }))), this.type == "select" ? (h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemSelect]) }, h("span", { class: PaginationClass.inner }, h("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), h("gov-form-select", { size: "m", "wcag-labelled-by": this.pageSelectId, "on-gov-change": this.onSelectHandler.bind(this) }, createArrayRange(1, this.pagination.totalPages).map(page => (h("option", { value: page, selected: this.pagination.currentPage === page }, page))))))) : (h(Fragment, null, this.pagination.pages.map(page => (h("li", { class: this.isActivePageClass(PaginationClass.item, page) }, pageResolver(page, page)))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemMore]) }, h("span", { class: PaginationClass.inner }, h("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), h("gov-form-select", { size: "m", "wcag-labelled-by": this.pageSelectId, ref: el => (this.spreadSelectRef = el), "on-gov-change": this.onSelectHandler.bind(this) }, h("option", { selected: true, hidden: true }, "..."), createArrayRange(1, this.pagination.totalPages).map(page => (h("option", { value: page, selected: false }, page)))))))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-right" }))), h("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1, h("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-right" })))))));
|
|
70
84
|
}
|
|
71
|
-
onClickHandler(page) {
|
|
85
|
+
onClickHandler(e, page) {
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
e.preventDefault();
|
|
72
88
|
this.recalculatePagination(page);
|
|
73
89
|
this.govPage.emit(Object.assign({}, this.pagination));
|
|
74
90
|
}
|
|
91
|
+
onSelectHandler(e) {
|
|
92
|
+
e.stopPropagation();
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
const target = e.target;
|
|
95
|
+
const page = parseInt(target.value);
|
|
96
|
+
this.resetSelectValue();
|
|
97
|
+
if (isNaN(page) === false) {
|
|
98
|
+
this.recalculatePagination(page);
|
|
99
|
+
if (this.link) {
|
|
100
|
+
window.location.href = this.prepareLinkUrl(page);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
this.govPage.emit(Object.assign({}, this.pagination));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
75
107
|
/**
|
|
76
108
|
* Validate the WCAG attributes of the component
|
|
77
109
|
*/
|
|
78
110
|
async validateWcag() {
|
|
79
|
-
validateWcagProp(this.wcagPageLabel,
|
|
80
|
-
validateWcagProp(this.wcagSelectLabel, 'wcag-select-label', PaginationClass.root);
|
|
111
|
+
validateWcagProp(this.wcagPageLabel, "wcag-page-label", PaginationClass.root);
|
|
81
112
|
validateWcagLabel(this.wcagLabel, this.wcagLabelledBy, PaginationClass.root);
|
|
113
|
+
if (this.type === "select") {
|
|
114
|
+
validateWcagProp(this.wcagSelectLabel, "wcag-select-label", PaginationClass.root);
|
|
115
|
+
}
|
|
82
116
|
}
|
|
83
117
|
static get is() { return "gov-pagination"; }
|
|
84
118
|
static get originalStyleUrls() {
|
|
@@ -114,7 +148,7 @@ export class GovPagination {
|
|
|
114
148
|
},
|
|
115
149
|
"attribute": "type",
|
|
116
150
|
"reflect": false,
|
|
117
|
-
"defaultValue": "
|
|
151
|
+
"defaultValue": "\"button\""
|
|
118
152
|
},
|
|
119
153
|
"current": {
|
|
120
154
|
"type": "number",
|
|
@@ -189,7 +223,7 @@ export class GovPagination {
|
|
|
189
223
|
},
|
|
190
224
|
"attribute": "size",
|
|
191
225
|
"reflect": false,
|
|
192
|
-
"defaultValue": "
|
|
226
|
+
"defaultValue": "\"m\""
|
|
193
227
|
},
|
|
194
228
|
"variant": {
|
|
195
229
|
"type": "string",
|
|
@@ -212,7 +246,7 @@ export class GovPagination {
|
|
|
212
246
|
},
|
|
213
247
|
"attribute": "variant",
|
|
214
248
|
"reflect": false,
|
|
215
|
-
"defaultValue": "
|
|
249
|
+
"defaultValue": "\"primary\""
|
|
216
250
|
},
|
|
217
251
|
"pageSize": {
|
|
218
252
|
"type": "number",
|
|
@@ -317,7 +351,7 @@ export class GovPagination {
|
|
|
317
351
|
},
|
|
318
352
|
"attribute": "wcag-select-label",
|
|
319
353
|
"reflect": false,
|
|
320
|
-
"defaultValue": "
|
|
354
|
+
"defaultValue": "\"Vybrat stranu\""
|
|
321
355
|
},
|
|
322
356
|
"wcagPageLabel": {
|
|
323
357
|
"type": "string",
|
|
@@ -335,7 +369,7 @@ export class GovPagination {
|
|
|
335
369
|
},
|
|
336
370
|
"attribute": "wcag-page-label",
|
|
337
371
|
"reflect": false,
|
|
338
|
-
"defaultValue": "
|
|
372
|
+
"defaultValue": "\"Strana\""
|
|
339
373
|
}
|
|
340
374
|
};
|
|
341
375
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-pagination.js","sourceRoot":"","sources":["../../../../../../src/components/gov-pagination/gov-pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC5G,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAsB,eAAe,EAAyC,eAAe,EAAE,kBAAkB,EAAE,MAAM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C,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;EAC7E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["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
|
+
{"version":3,"file":"gov-pagination.js","sourceRoot":"","sources":["../../../../../../src/components/gov-pagination/gov-pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC5G,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EACN,eAAe,EAEf,eAAe,EAGf,eAAe,EACf,kBAAkB,GAClB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,EAAE,QAAQ,EAAc,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EAAC,gBAAgB,EAAE,MAAM,yBAAyB,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import Fragment from \"../../helpers/Fragment\"\nimport { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport {\n\tPaginationClass,\n\tPaginationSizeType,\n\tPaginationSizes,\n\tPaginationVariantType,\n\tPaginationType,\n\tPaginationTypes,\n\tPaginationVariants,\n} from \"./constants\"\nimport { govHost, prepareClasses } from \"../../helpers/Dom/template\"\nimport { paginate, Pagination } from \"./pagination\"\nimport { toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\nimport { validateWcagLabel, validateWcagProp } from \"../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../helpers/Dom/win\"\nimport { delay } from \"../../utils/utils\"\nimport { createID } from \"../../utils/string.utils\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport {createArrayRange } from \"../../utils/array.utils\"\n\n@Component({\n\ttag: \"gov-pagination\",\n\tstyleUrl: \"gov-pagination.scss\",\n})\nexport class GovPagination {\n\tprivate h: GovHost\n\tprivate readonly pageSelectId: string\n\n\tprivate spreadSelectRef?: HTMLGovFormSelectElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.pageSelectId = createID(\"GovPageSelect\")\n\t}\n\n\t@Element() readonly host: HTMLGovPaginationElement\n\t/**\n\t * Pagination type\n\t */\n\t@Prop() readonly type: PaginationType = \"button\"\n\t/**\n\t * Currently displayed page\n\t */\n\t@Prop() readonly current: number = 1\n\t/**\n\t * Total count of entries\n\t */\n\t@Prop() readonly total: number\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\tprivate prepareLinkUrl(page: number) {\n\t\tif (this.link) {\n\t\t\treturn String(this.link).replace(\"{PAGE}\", String(page))\n\t\t}\n\t\treturn undefined\n\t}\n\n\tprivate resetSelectValue() {\n\t\tif (this.spreadSelectRef) {\n\t\t\tthis.spreadSelectRef.getInstance()\n\t\t\t\t.then((el: HTMLSelectElement) => {\n\t\t\t\t\tel.value = '...'\n\t\t\t\t})\n\t\t}\n\t}\n\n\trender() {\n\t\tconst pageResolver = (page: number, content: any) => {\n\t\t\tconst isDisabled = page === -1\n\t\t\tconst ariaCurrent = toBoolAttrIfDefined(this.pagination.currentPage === page ? true : undefined)\n\t\t\treturn (\n\t\t\t\t<gov-button\n\t\t\t\t\thref={this.prepareLinkUrl(page)}\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\ttype=\"base\"\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ton-gov-click={(e) => this.onClickHandler(e, page)}\n\t\t\t\t\twcag-label={page > -1 ? this.wcagPageLabel + \" \" + page : undefined}\n\t\t\t\t\twcag-current={ariaCurrent}\n\t\t\t\t\tclass={PaginationClass.inner}>\n\t\t\t\t\t{content}\n\t\t\t\t</gov-button>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(PaginationClass.root)} type={this.type} variant={this.variant} size={this.size}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\n\t\t\t\t\t<ul class={PaginationClass.list}>\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.currentPage > 1 ? 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-double-left\"></gov-icon>,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-left\"></gov-icon>,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t{this.type == \"select\" ? (\n\t\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemSelect])}>\n\t\t\t\t\t\t\t\t<span class={PaginationClass.inner}>\n\t\t\t\t\t\t\t\t\t<span id={this.pageSelectId} hidden>\n\t\t\t\t\t\t\t\t\t\t{this.wcagSelectLabel}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<gov-form-select\n\t\t\t\t\t\t\t\t\t\tsize=\"m\"\n\t\t\t\t\t\t\t\t\t\twcag-labelled-by={this.pageSelectId}\n\t\t\t\t\t\t\t\t\t\ton-gov-change={this.onSelectHandler.bind(this)}>\n\t\t\t\t\t\t\t\t\t\t{createArrayRange(1, this.pagination.totalPages).map(page => (\n\t\t\t\t\t\t\t\t\t\t\t<option value={page} selected={this.pagination.currentPage === page}>\n\t\t\t\t\t\t\t\t\t\t\t\t{page}\n\t\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</gov-form-select>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t{this.pagination.pages.map(page => (\n\t\t\t\t\t\t\t\t\t<li class={this.isActivePageClass(PaginationClass.item, page)}>{pageResolver(page, page)}</li>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemMore])}>\n\t\t\t\t\t\t\t\t\t<span class={PaginationClass.inner}>\n\t\t\t\t\t\t\t\t\t\t<span id={this.pageSelectId} hidden>\n\t\t\t\t\t\t\t\t\t\t\t{this.wcagSelectLabel}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t<gov-form-select\n\t\t\t\t\t\t\t\t\t\t\tsize=\"m\"\n\t\t\t\t\t\t\t\t\t\t\twcag-labelled-by={this.pageSelectId}\n\t\t\t\t\t\t\t\t\t\t\tref={el => (this.spreadSelectRef = el as HTMLGovFormSelectElement)}\n\t\t\t\t\t\t\t\t\t\t\ton-gov-change={this.onSelectHandler.bind(this)}>\n\t\t\t\t\t\t\t\t\t\t\t<option selected hidden>...</option>\n\t\t\t\t\t\t\t\t\t\t\t{createArrayRange(1, this.pagination.totalPages).map(page => (\n\t\t\t\t\t\t\t\t\t\t\t\t<option value={page} selected={false}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{page}\n\t\t\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-select>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</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=\"chevron-right\"></gov-icon>,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-double-right\"></gov-icon>,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</nav>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: CustomEvent, page: number): void {\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tthis.recalculatePagination(page)\n\t\tthis.govPage.emit({ ...this.pagination })\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent): void {\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tconst target = e.target as HTMLSelectElement\n\t\tconst page = parseInt(target.value)\n\t\tthis.resetSelectValue()\n\t\tif (isNaN(page) === false) {\n\t\t\tthis.recalculatePagination(page)\n\t\t\tif (this.link) {\n\t\t\t\twindow.location.href = this.prepareLinkUrl(page)\n\t\t\t} else {\n\t\t\t\tthis.govPage.emit({ ...this.pagination })\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagProp(this.wcagPageLabel, \"wcag-page-label\", PaginationClass.root)\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, PaginationClass.root)\n\t\tif (this.type === \"select\") {\n\t\t\tvalidateWcagProp(this.wcagSelectLabel, \"wcag-select-label\", PaginationClass.root)\n\t\t}\n\t}\n}\n"]}
|
|
@@ -148,6 +148,9 @@
|
|
|
148
148
|
/*
|
|
149
149
|
- Variables - Form multiselect
|
|
150
150
|
*/
|
|
151
|
+
/*
|
|
152
|
+
- Variables - Form password power
|
|
153
|
+
*/
|
|
151
154
|
/*
|
|
152
155
|
- Variables - Form checkbox & radio
|
|
153
156
|
*/
|
|
@@ -238,7 +241,7 @@
|
|
|
238
241
|
display: flex;
|
|
239
242
|
gap: 1rem;
|
|
240
243
|
align-items: flex-start;
|
|
241
|
-
padding: 1.5rem
|
|
244
|
+
padding: 1.5rem 1rem;
|
|
242
245
|
border-bottom: var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500));
|
|
243
246
|
}
|
|
244
247
|
.gov-modal__icon {
|
|
@@ -302,13 +305,13 @@
|
|
|
302
305
|
@media (min-width: 48em) {
|
|
303
306
|
.gov-modal__header {
|
|
304
307
|
gap: 1.25rem;
|
|
305
|
-
padding: 2rem 2.
|
|
308
|
+
padding: 2rem 2.5rem 2rem 3rem;
|
|
306
309
|
}
|
|
307
310
|
.gov-modal__close {
|
|
308
311
|
padding-top: calc((var(--gov-text-3xl-font-size) * 1.5 - 2.5rem) / 2);
|
|
309
312
|
}
|
|
310
313
|
.gov-modal__content {
|
|
311
|
-
padding:
|
|
314
|
+
padding: 2rem 3rem;
|
|
312
315
|
}
|
|
313
316
|
.gov-modal--prompt .gov-modal__header, .gov-modal--prompt .gov-modal__content, .gov-modal--prompt .gov-modal__actions {
|
|
314
317
|
padding: 1.5rem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, Host } from
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { createID } from '../../utils/string.utils';
|
|
3
3
|
import { validateWcagRef } from '../../helpers/Validate/wcag';
|
|
4
4
|
import { ModalClass } from '../gov-modal/constants';
|
|
@@ -17,6 +17,7 @@ export class GovPrompt {
|
|
|
17
17
|
this.wcagDescribedBy = undefined;
|
|
18
18
|
this.wcagCloseLabel = undefined;
|
|
19
19
|
this.wcagCloseLabelledBy = undefined;
|
|
20
|
+
this.modalVisible = false;
|
|
20
21
|
this.h = govHost(this.host);
|
|
21
22
|
this.labelId = createID('GovPromptLabel');
|
|
22
23
|
this.contentId = createID('GovPromptContent');
|
|
@@ -29,16 +30,19 @@ export class GovPrompt {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
}
|
|
33
|
+
watchOpen(newValue) {
|
|
34
|
+
this.modalVisible = newValue;
|
|
35
|
+
}
|
|
32
36
|
showModal() {
|
|
33
|
-
this.
|
|
37
|
+
this.modalVisible = true;
|
|
34
38
|
document.body.classList.add(ModalClass.bodyFix);
|
|
35
39
|
}
|
|
36
40
|
hideModal() {
|
|
37
|
-
this.
|
|
41
|
+
this.modalVisible = false;
|
|
38
42
|
document.body.classList.remove(ModalClass.bodyFix);
|
|
39
43
|
}
|
|
40
44
|
async componentWillRender() {
|
|
41
|
-
if (this.
|
|
45
|
+
if (this.modalVisible) {
|
|
42
46
|
this.showModal();
|
|
43
47
|
}
|
|
44
48
|
else {
|
|
@@ -46,6 +50,7 @@ export class GovPrompt {
|
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
async componentDidRender() {
|
|
53
|
+
this.modalVisible = this.open;
|
|
49
54
|
if (canValidateWcagOnRender()) {
|
|
50
55
|
await delay(500);
|
|
51
56
|
await this.validateWcag();
|
|
@@ -53,7 +58,7 @@ export class GovPrompt {
|
|
|
53
58
|
}
|
|
54
59
|
render() {
|
|
55
60
|
const LabelTag = this.labelTag;
|
|
56
|
-
return (h(Host, { class: this.h.classes(ModalClass.rootPrompt), open: this.
|
|
61
|
+
return (h(Host, { class: this.h.classes(ModalClass.rootPrompt), open: this.modalVisible }, h("dialog", { class: ModalClass.dialog, hidden: !this.modalVisible, tabindex: "-1", open: this.modalVisible, "aria-modal": "true", "aria-hidden": toBoolAttr(!this.modalVisible), "aria-labelledby": this.wcaglabelledBy || this.labelId, "aria-describedby": this.wcagDescribedBy || this.contentId, role: this.role }, h("div", { class: ModalClass.inner }, h("div", { class: ModalClass.header }, this.h.hasSlot('icon') && (h("div", { class: ModalClass.icon }, h("slot", { name: "icon" }))), this.label && (h(LabelTag, { class: ModalClass.title, id: this.labelId }, this.label)), h("gov-button", { class: ModalClass.close, variant: "primary", wcagLabel: this.wcagCloseLabel, wcagLabelledBy: this.wcagCloseLabelledBy, type: "base", "on-gov-click": this.onCloseHandler.bind(this) }, h("gov-icon", { name: "x-lg" }))), h("div", { class: ModalClass.content, id: this.contentId }, h("slot", null)), h("div", { class: ModalClass.actions }, h("slot", { name: "actions" })))), h("gov-backdrop", { visible: this.modalVisible, "wcag-label": this.wcagCloseLabel, "wcag-labelled-by": this.wcagCloseLabelledBy, "on-gov-click": this.onCloseHandler.bind(this) })));
|
|
57
62
|
}
|
|
58
63
|
onCloseHandler(e) {
|
|
59
64
|
e.stopPropagation();
|
|
@@ -233,6 +238,11 @@ export class GovPrompt {
|
|
|
233
238
|
}
|
|
234
239
|
};
|
|
235
240
|
}
|
|
241
|
+
static get states() {
|
|
242
|
+
return {
|
|
243
|
+
"modalVisible": {}
|
|
244
|
+
};
|
|
245
|
+
}
|
|
236
246
|
static get events() {
|
|
237
247
|
return [{
|
|
238
248
|
"method": "govClose",
|
|
@@ -312,6 +322,9 @@ export class GovPrompt {
|
|
|
312
322
|
return [{
|
|
313
323
|
"propName": "labelTag",
|
|
314
324
|
"methodName": "validateLabelTag"
|
|
325
|
+
}, {
|
|
326
|
+
"propName": "open",
|
|
327
|
+
"methodName": "watchOpen"
|
|
315
328
|
}];
|
|
316
329
|
}
|
|
317
330
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-prompt.js","sourceRoot":"","sources":["../../../../../../src/components/gov-promp/gov-prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"gov-prompt.js","sourceRoot":"","sources":["../../../../../../src/components/gov-promp/gov-prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAgB,CAAC,EAAE,IAAI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EACjB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,SAAS,EAAE,CAAA;EACjB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,iBAAiB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IACxE,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,kBAAkB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;EAC3E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Event, Element, EventEmitter, h, Host, Method, Prop, Watch, State } 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@State() modalVisible = false\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\t@Watch(\"open\")\n\twatchOpen(newValue: boolean): void {\n\t\tthis.modalVisible = newValue\n\t}\n\n\tprivate showModal() {\n\t\tthis.modalVisible = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.modalVisible = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.modalVisible) {\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\tthis.modalVisible = this.open\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.modalVisible}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.modalVisible}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\topen={this.modalVisible}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.modalVisible)}\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=\"x-lg\" />\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.modalVisible}\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"]}
|
|
@@ -36,7 +36,7 @@ export class GovSideNavItem {
|
|
|
36
36
|
const { isExpandedState, label } = this;
|
|
37
37
|
// TODO: správný počet zanořených childů
|
|
38
38
|
const hasChilds = this.host.children.length > 1;
|
|
39
|
-
return (h(Host, { class: this.classNames, role: "listitem", inverse: this.inverse, "aria-expanded": booleanString(isExpandedState) }, this.href ? (h("div", { class: SideNavItemClass.header }, h("a", { class: SideNavItemClass.name, href: this.href }, this.h.hasSlot('icon') && (h("span", { class: SideNavItemClass.icon }, h("slot", { name: "icon" }))), h("span", { class: SideNavItemClass.label }, label), this.count && (h("span", { class: SideNavItemClass.badge }, h("gov-badge", { variant: "secondary", size: "s", inverse: this.inverse }, "3")))), hasChilds && (h("button", { type: "button", class: SideNavItemClass.arrow, onClick: () => this.toggle() }, h("gov-icon", { name: "
|
|
39
|
+
return (h(Host, { class: this.classNames, role: "listitem", inverse: this.inverse, "aria-expanded": booleanString(isExpandedState) }, this.href ? (h("div", { class: SideNavItemClass.header }, h("a", { class: SideNavItemClass.name, href: this.href }, this.h.hasSlot('icon') && (h("span", { class: SideNavItemClass.icon }, h("slot", { name: "icon" }))), h("span", { class: SideNavItemClass.label }, label), this.count && (h("span", { class: SideNavItemClass.badge }, h("gov-badge", { variant: "secondary", size: "s", inverse: this.inverse }, "3")))), hasChilds && (h("button", { type: "button", class: SideNavItemClass.arrow, onClick: () => this.toggle() }, h("gov-icon", { name: "chevron-down" }))))) : (h("div", { class: SideNavItemClass.header }, h("button", { class: SideNavItemClass.name, type: "button", onClick: () => this.toggle() }, this.h.hasSlot('icon') && (h("span", { class: SideNavItemClass.icon }, h("slot", { name: "icon" }))), h("span", { class: SideNavItemClass.label }, label), hasChilds && (h("span", { class: SideNavItemClass.arrow }, h("gov-icon", { name: "chevron-down" })))))), hasChilds && (h("div", { class: SideNavItemClass.content }, h("slot", null)))));
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Opening the sidenav
|