@ukic/web-components 3.21.0 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-3a796e7a.js → helpers-81cd6930.js} +3 -16
- package/dist/cjs/helpers-81cd6930.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ic-action-chip.cjs.entry.js +7 -3
- package/dist/cjs/ic-action-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-horizontal.cjs.entry.js +1 -1
- package/dist/cjs/ic-card-vertical.cjs.entry.js +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +5 -5
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +7 -3
- package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js +13 -5
- package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +1 -1
- package/dist/cjs/ic-empty-state.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +212 -80
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination-bar.cjs.entry.js +389 -0
- package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-pagination-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination_3.cjs.entry.js +1412 -0
- package/dist/cjs/ic-pagination_3.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-popover-menu.cjs.entry.js +5 -5
- package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +11 -11
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js +2 -2
- package/dist/cjs/ic-side-navigation.cjs.entry.js +18 -9
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/ic-skip-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-status-tag.cjs.entry.js +3 -3
- package/dist/cjs/ic-step.cjs.entry.js +14 -14
- package/dist/cjs/ic-stepper.cjs.entry.js +3 -3
- package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +5 -5
- package/dist/cjs/ic-tab-context.cjs.entry.js +1 -2
- package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab.cjs.entry.js +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +2 -2
- package/dist/cjs/ic-toast-region.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +8 -7
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +3 -3
- package/dist/cjs/ic-toggle-button.cjs.entry.js +3 -3
- package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +1 -1
- package/dist/cjs/index-d337cd8a.js +12 -16
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ic-action-chip/ic-action-chip.css +15 -2
- package/dist/collection/components/ic-action-chip/ic-action-chip.js +5 -1
- package/dist/collection/components/ic-action-chip/ic-action-chip.js.map +1 -1
- package/dist/collection/components/ic-checkbox/ic-checkbox.js +4 -5
- package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
- package/dist/collection/components/ic-chip/ic-chip.css +15 -3
- package/dist/collection/components/ic-chip/ic-chip.js +5 -1
- package/dist/collection/components/ic-chip/ic-chip.js.map +1 -1
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.js +33 -5
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.js.map +1 -1
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.stories.js +32 -0
- package/dist/collection/components/ic-menu/ic-menu.css +6 -1
- package/dist/collection/components/ic-menu/ic-menu.js +184 -53
- package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.css +104 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +895 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.stories.js +215 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.types.js +2 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.types.js.map +1 -0
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +4 -4
- package/dist/collection/components/ic-search-bar/ic-search-bar.js +10 -11
- package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
- package/dist/collection/components/ic-section-container/ic-section-container.js +2 -2
- package/dist/collection/components/ic-select/ic-select.css +1 -2
- package/dist/collection/components/ic-select/ic-select.js +414 -589
- package/dist/collection/components/ic-select/ic-select.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select.types.js +2 -0
- package/dist/collection/components/ic-select/ic-select.types.js.map +1 -0
- package/dist/collection/components/ic-select/ic-select_(searchable).stories.js +26 -21
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +18 -9
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
- package/dist/collection/components/ic-skeleton/ic-skeleton.js +2 -2
- package/dist/collection/components/ic-skip-link/ic-skip-link.js +2 -2
- package/dist/collection/components/ic-status-tag/ic-status-tag.js +2 -2
- package/dist/collection/components/ic-step/ic-step.js +13 -13
- package/dist/collection/components/ic-stepper/ic-stepper.js +2 -2
- package/dist/collection/components/ic-stepper/ic-stepper.js.map +1 -1
- package/dist/collection/components/ic-switch/ic-switch.js +4 -4
- package/dist/collection/components/ic-tab-context/ic-tab-context.js +1 -2
- package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
- package/dist/collection/components/ic-tab-group/ic-tab-group.js +2 -2
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +2 -2
- package/dist/collection/components/ic-theme/ic-theme.js +1 -1
- package/dist/collection/components/ic-toast/ic-toast.js +7 -6
- package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
- package/dist/collection/components/ic-toast-region/ic-toast-region.js +1 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.js +2 -2
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js +2 -2
- package/dist/collection/utils/helpers.js +2 -15
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/components/helpers.js +3 -16
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/ic-action-chip.js +6 -2
- package/dist/components/ic-action-chip.js.map +1 -1
- package/dist/components/ic-card-vertical.js.map +1 -1
- package/dist/components/ic-checkbox.js +4 -4
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-chip.js +6 -2
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-classification-banner.js +14 -5
- package/dist/components/ic-classification-banner.js.map +1 -1
- package/dist/components/ic-menu2.js +213 -79
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-pagination-bar.d.ts +11 -0
- package/dist/components/ic-pagination-bar.js +523 -0
- package/dist/components/ic-pagination-bar.js.map +1 -0
- package/dist/components/ic-pagination.js +1 -375
- package/dist/components/ic-pagination.js.map +1 -1
- package/dist/{esm/ic-pagination.entry.js → components/ic-pagination2.js} +82 -11
- package/dist/components/ic-pagination2.js.map +1 -0
- package/dist/components/ic-popover-menu.js +4 -4
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-search-bar.js +11 -11
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-section-container2.js +2 -2
- package/dist/components/ic-select.js +1 -994
- package/dist/components/ic-select.js.map +1 -1
- package/dist/components/ic-select2.js +804 -0
- package/dist/components/ic-select2.js.map +1 -0
- package/dist/components/ic-side-navigation.js +18 -9
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-skeleton.js +2 -2
- package/dist/components/ic-skip-link.js +2 -2
- package/dist/components/ic-status-tag.js +2 -2
- package/dist/components/ic-step.js +13 -13
- package/dist/components/ic-stepper.js +2 -2
- package/dist/components/ic-stepper.js.map +1 -1
- package/dist/components/ic-switch.js +4 -4
- package/dist/components/ic-switch.js.map +1 -1
- package/dist/components/ic-tab-context.js +1 -2
- package/dist/components/ic-tab-context.js.map +1 -1
- package/dist/components/ic-tab-group.js +2 -2
- package/dist/components/ic-tab-panel.js +2 -2
- package/dist/components/ic-tab-panel.js.map +1 -1
- package/dist/components/ic-text-field.js +1 -528
- package/dist/components/ic-text-field.js.map +1 -1
- package/dist/{esm/ic-text-field.entry.js → components/ic-text-field2.js} +114 -11
- package/dist/components/ic-text-field2.js.map +1 -0
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-toast-region.js +1 -1
- package/dist/components/ic-toast.js +7 -6
- package/dist/components/ic-toast.js.map +1 -1
- package/dist/components/ic-toggle-button-group.js +2 -2
- package/dist/components/ic-toggle-button.js +2 -2
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-0a24c536.entry.js → p-05fd2707.entry.js} +2 -2
- package/dist/core/{p-85e15d01.entry.js → p-09505807.entry.js} +2 -2
- package/dist/core/{p-96bc7d24.entry.js → p-09caf7ed.entry.js} +2 -2
- package/dist/core/p-09caf7ed.entry.js.map +1 -0
- package/dist/core/{p-9057a186.entry.js → p-0b728f50.entry.js} +2 -2
- package/dist/core/{p-9057a186.entry.js.map → p-0b728f50.entry.js.map} +1 -1
- package/dist/core/p-0fb7f915.entry.js +2 -0
- package/dist/core/p-0fb7f915.entry.js.map +1 -0
- package/dist/core/{p-41a5da12.entry.js → p-1b81ec88.entry.js} +2 -2
- package/dist/core/{p-99951365.entry.js → p-2691cc80.entry.js} +2 -2
- package/dist/core/{p-94916588.entry.js → p-2a124daf.entry.js} +2 -2
- package/dist/core/{p-04c77b2d.entry.js → p-2b87c592.entry.js} +2 -2
- package/dist/core/{p-4aa56990.entry.js → p-2bd80913.entry.js} +2 -2
- package/dist/core/{p-aed1c7e7.entry.js → p-347cc084.entry.js} +2 -2
- package/dist/core/p-393af2bc.entry.js +2 -0
- package/dist/core/p-393af2bc.entry.js.map +1 -0
- package/dist/core/{p-a3dea729.entry.js → p-3aed13ba.entry.js} +2 -2
- package/dist/core/{p-8da90b72.entry.js → p-46fd555f.entry.js} +2 -2
- package/dist/core/{p-43cc0f1d.entry.js → p-48a628f0.entry.js} +2 -2
- package/dist/core/{p-9a4e067f.entry.js → p-4f56acff.entry.js} +2 -2
- package/dist/core/{p-3021290f.entry.js → p-506d428a.entry.js} +2 -2
- package/dist/core/{p-a1b2f483.entry.js → p-50dca790.entry.js} +2 -2
- package/dist/core/p-53ab3c0f.entry.js +2 -0
- package/dist/core/p-53ab3c0f.entry.js.map +1 -0
- package/dist/core/{p-feef7c2c.entry.js → p-56de4f4b.entry.js} +2 -2
- package/dist/core/{p-b4e322fe.entry.js → p-5900cb65.entry.js} +2 -2
- package/dist/core/{p-78a54069.entry.js → p-5976de6e.entry.js} +2 -2
- package/dist/core/{p-2af89564.entry.js → p-61d79fc6.entry.js} +2 -2
- package/dist/core/{p-2af89564.entry.js.map → p-61d79fc6.entry.js.map} +1 -1
- package/dist/core/p-659d048d.entry.js +2 -0
- package/dist/core/{p-1edf2689.entry.js → p-67de1290.entry.js} +2 -2
- package/dist/core/p-6b4ec95f.entry.js +3 -0
- package/dist/core/p-6b4ec95f.entry.js.map +1 -0
- package/dist/core/{p-f700b759.entry.js → p-73043f57.entry.js} +2 -2
- package/dist/core/{p-7b8e5926.entry.js → p-735d3096.entry.js} +2 -2
- package/dist/core/{p-07075461.entry.js → p-7b538fd1.entry.js} +2 -2
- package/dist/core/{p-cfd43558.entry.js → p-80d85403.entry.js} +2 -2
- package/dist/core/{p-7f279c8a.entry.js → p-83578f1d.entry.js} +2 -2
- package/dist/core/{p-7f279c8a.entry.js.map → p-83578f1d.entry.js.map} +1 -1
- package/dist/core/{p-b8c0c142.entry.js → p-880f7548.entry.js} +2 -2
- package/dist/core/p-880f7548.entry.js.map +1 -0
- package/dist/core/{p-79949920.entry.js → p-8a833e82.entry.js} +2 -2
- package/dist/core/{p-0aba9e31.entry.js → p-90678e67.entry.js} +2 -2
- package/dist/core/{p-a851eb65.entry.js → p-9502fb86.entry.js} +2 -2
- package/dist/core/{p-2ca7f050.entry.js → p-99433296.entry.js} +2 -2
- package/dist/core/p-99433296.entry.js.map +1 -0
- package/dist/core/{p-f6de08fb.entry.js → p-9c2b2cb9.entry.js} +2 -2
- package/dist/core/{p-949d08d3.entry.js → p-9cb83a2e.entry.js} +2 -2
- package/dist/core/{p-f0ecb80b.entry.js → p-a08d6b46.entry.js} +2 -2
- package/dist/core/p-a321feee.entry.js +2 -0
- package/dist/core/p-a321feee.entry.js.map +1 -0
- package/dist/core/{p-208f470f.entry.js → p-a780a34b.entry.js} +2 -2
- package/dist/core/{p-387b7bca.entry.js → p-aad03a3c.entry.js} +2 -2
- package/dist/core/{p-ec14c783.entry.js → p-aaf4e367.entry.js} +2 -2
- package/dist/core/{p-707ae6e9.entry.js → p-b52c44eb.entry.js} +2 -2
- package/dist/core/{p-716e7eaf.entry.js → p-b777f0a1.entry.js} +2 -2
- package/dist/core/p-b777f0a1.entry.js.map +1 -0
- package/dist/core/p-b77b1e1f.js +2 -0
- package/dist/core/p-b77b1e1f.js.map +1 -0
- package/dist/core/{p-780babc0.entry.js → p-b997ad5e.entry.js} +2 -2
- package/dist/core/{p-a0af1b0a.entry.js → p-bb7652cd.entry.js} +2 -2
- package/dist/core/{p-ded4cd76.entry.js → p-cbca04bb.entry.js} +2 -2
- package/dist/core/{p-99687bce.entry.js → p-cc64e5ef.entry.js} +2 -2
- package/dist/core/{p-812c5e61.entry.js → p-cfbacca1.entry.js} +2 -2
- package/dist/core/{p-0da2caa2.entry.js → p-daec7e69.entry.js} +2 -2
- package/dist/core/{p-1590fd69.entry.js → p-e7767c0d.entry.js} +2 -2
- package/dist/core/p-e938eb31.entry.js +2 -0
- package/dist/core/p-e938eb31.entry.js.map +1 -0
- package/dist/core/{p-dce11b9d.entry.js → p-ea7a3d30.entry.js} +2 -2
- package/dist/core/{p-880afd4b.entry.js → p-ebd688b9.entry.js} +2 -2
- package/dist/core/p-ebd688b9.entry.js.map +1 -0
- package/dist/core/{p-a674b13b.entry.js → p-ef70ea50.entry.js} +2 -2
- package/dist/core/{p-d25d0aad.entry.js → p-f64996f1.entry.js} +2 -2
- package/dist/core/{p-db17a793.entry.js → p-f661ba76.entry.js} +2 -2
- package/dist/core/{p-a03bb31c.entry.js → p-f84ac9c6.entry.js} +2 -2
- package/dist/core/{p-f3406b42.entry.js → p-fb9376f0.entry.js} +2 -2
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-0f85537f.js → helpers-66681c73.js} +4 -17
- package/dist/esm/helpers-66681c73.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +1 -1
- package/dist/esm/ic-accordion.entry.js +1 -1
- package/dist/esm/ic-action-chip.entry.js +7 -3
- package/dist/esm/ic-action-chip.entry.js.map +1 -1
- package/dist/esm/ic-alert.entry.js +1 -1
- package/dist/esm/ic-back-to-top.entry.js +1 -1
- package/dist/esm/ic-badge.entry.js +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card-horizontal.entry.js +1 -1
- package/dist/esm/ic-card-vertical.entry.js +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +1 -1
- package/dist/esm/ic-checkbox.entry.js +5 -5
- package/dist/esm/ic-checkbox.entry.js.map +1 -1
- package/dist/esm/ic-chip.entry.js +7 -3
- package/dist/esm/ic-chip.entry.js.map +1 -1
- package/dist/esm/ic-classification-banner.entry.js +13 -5
- package/dist/esm/ic-classification-banner.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-dialog.entry.js +1 -1
- package/dist/esm/ic-divider.entry.js +1 -1
- package/dist/esm/ic-empty-state.entry.js +1 -1
- package/dist/esm/ic-footer-link-group.entry.js +1 -1
- package/dist/esm/ic-footer-link.entry.js +1 -1
- package/dist/esm/ic-footer.entry.js +1 -1
- package/dist/esm/ic-hero.entry.js +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +212 -80
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js +1 -1
- package/dist/esm/ic-link.entry.js +1 -1
- package/dist/esm/ic-menu-group.entry.js +1 -1
- package/dist/esm/ic-menu-item.entry.js +1 -1
- package/dist/esm/ic-navigation-button.entry.js +1 -1
- package/dist/esm/ic-navigation-group.entry.js +1 -1
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +1 -1
- package/dist/esm/ic-page-header.entry.js +1 -1
- package/dist/esm/ic-pagination-bar.entry.js +385 -0
- package/dist/esm/ic-pagination-bar.entry.js.map +1 -0
- package/dist/esm/ic-pagination-item.entry.js +1 -1
- package/dist/esm/ic-pagination_3.entry.js +1406 -0
- package/dist/esm/ic-pagination_3.entry.js.map +1 -0
- package/dist/esm/ic-popover-menu.entry.js +5 -5
- package/dist/esm/ic-radio-group.entry.js +1 -1
- package/dist/esm/ic-radio-option.entry.js +1 -1
- package/dist/esm/ic-search-bar.entry.js +11 -11
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js +2 -2
- package/dist/esm/ic-side-navigation.entry.js +18 -9
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-skeleton.entry.js +2 -2
- package/dist/esm/ic-skip-link.entry.js +2 -2
- package/dist/esm/ic-status-tag.entry.js +3 -3
- package/dist/esm/ic-step.entry.js +14 -14
- package/dist/esm/ic-stepper.entry.js +3 -3
- package/dist/esm/ic-stepper.entry.js.map +1 -1
- package/dist/esm/ic-switch.entry.js +5 -5
- package/dist/esm/ic-tab-context.entry.js +1 -2
- package/dist/esm/ic-tab-context.entry.js.map +1 -1
- package/dist/esm/ic-tab-group.entry.js +3 -3
- package/dist/esm/ic-tab-panel.entry.js +2 -2
- package/dist/esm/ic-tab.entry.js +1 -1
- package/dist/esm/ic-theme.entry.js +2 -2
- package/dist/esm/ic-toast-region.entry.js +1 -1
- package/dist/esm/ic-toast.entry.js +8 -7
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js +3 -3
- package/dist/esm/ic-toggle-button.entry.js +3 -3
- package/dist/esm/ic-top-navigation.entry.js +1 -1
- package/dist/esm/ic-typography.entry.js +1 -1
- package/dist/esm/index-a7a720e7.js +12 -16
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-classification-banner/ic-classification-banner.d.ts +4 -0
- package/dist/types/components/ic-menu/ic-menu.d.ts +11 -1
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.d.ts +162 -0
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.types.d.ts +8 -0
- package/dist/types/components/ic-select/ic-select.d.ts +53 -80
- package/dist/types/components/ic-select/ic-select.types.d.ts +43 -0
- package/dist/types/components/ic-side-navigation/ic-side-navigation.d.ts +3 -2
- package/dist/types/components.d.ts +234 -5
- package/dist/types/utils/helpers.d.ts +2 -4
- package/hydrate/index.js +1141 -771
- package/hydrate/index.mjs +1141 -771
- package/package.json +2 -2
- package/vscode-data.json +131 -0
- package/dist/cjs/helpers-3a796e7a.js.map +0 -1
- package/dist/cjs/ic-pagination.cjs.entry.js +0 -312
- package/dist/cjs/ic-pagination.cjs.entry.js.map +0 -1
- package/dist/cjs/ic-select.cjs.entry.js +0 -879
- package/dist/cjs/ic-select.cjs.entry.js.map +0 -1
- package/dist/cjs/ic-text-field.cjs.entry.js +0 -433
- package/dist/cjs/ic-text-field.cjs.entry.js.map +0 -1
- package/dist/core/p-0d7fd892.entry.js +0 -2
- package/dist/core/p-29b61bb5.entry.js +0 -3
- package/dist/core/p-29b61bb5.entry.js.map +0 -1
- package/dist/core/p-2ca7f050.entry.js.map +0 -1
- package/dist/core/p-4aadabc8.entry.js +0 -2
- package/dist/core/p-4aadabc8.entry.js.map +0 -1
- package/dist/core/p-716e7eaf.entry.js.map +0 -1
- package/dist/core/p-808e1ef5.entry.js +0 -2
- package/dist/core/p-808e1ef5.entry.js.map +0 -1
- package/dist/core/p-880afd4b.entry.js.map +0 -1
- package/dist/core/p-8fe4e0ad.entry.js +0 -2
- package/dist/core/p-8fe4e0ad.entry.js.map +0 -1
- package/dist/core/p-96bc7d24.entry.js.map +0 -1
- package/dist/core/p-b8c0c142.entry.js.map +0 -1
- package/dist/core/p-c5b9519d.entry.js +0 -2
- package/dist/core/p-c5b9519d.entry.js.map +0 -1
- package/dist/core/p-d1730d4d.entry.js +0 -2
- package/dist/core/p-d1730d4d.entry.js.map +0 -1
- package/dist/core/p-dbc8bf0c.js +0 -2
- package/dist/core/p-dbc8bf0c.js.map +0 -1
- package/dist/core/p-fdb587ab.entry.js +0 -2
- package/dist/core/p-fdb587ab.entry.js.map +0 -1
- package/dist/esm/helpers-0f85537f.js.map +0 -1
- package/dist/esm/ic-pagination.entry.js.map +0 -1
- package/dist/esm/ic-select.entry.js +0 -875
- package/dist/esm/ic-select.entry.js.map +0 -1
- package/dist/esm/ic-text-field.entry.js.map +0 -1
- /package/dist/core/{p-0a24c536.entry.js.map → p-05fd2707.entry.js.map} +0 -0
- /package/dist/core/{p-85e15d01.entry.js.map → p-09505807.entry.js.map} +0 -0
- /package/dist/core/{p-41a5da12.entry.js.map → p-1b81ec88.entry.js.map} +0 -0
- /package/dist/core/{p-99951365.entry.js.map → p-2691cc80.entry.js.map} +0 -0
- /package/dist/core/{p-94916588.entry.js.map → p-2a124daf.entry.js.map} +0 -0
- /package/dist/core/{p-04c77b2d.entry.js.map → p-2b87c592.entry.js.map} +0 -0
- /package/dist/core/{p-4aa56990.entry.js.map → p-2bd80913.entry.js.map} +0 -0
- /package/dist/core/{p-aed1c7e7.entry.js.map → p-347cc084.entry.js.map} +0 -0
- /package/dist/core/{p-a3dea729.entry.js.map → p-3aed13ba.entry.js.map} +0 -0
- /package/dist/core/{p-8da90b72.entry.js.map → p-46fd555f.entry.js.map} +0 -0
- /package/dist/core/{p-43cc0f1d.entry.js.map → p-48a628f0.entry.js.map} +0 -0
- /package/dist/core/{p-9a4e067f.entry.js.map → p-4f56acff.entry.js.map} +0 -0
- /package/dist/core/{p-3021290f.entry.js.map → p-506d428a.entry.js.map} +0 -0
- /package/dist/core/{p-a1b2f483.entry.js.map → p-50dca790.entry.js.map} +0 -0
- /package/dist/core/{p-feef7c2c.entry.js.map → p-56de4f4b.entry.js.map} +0 -0
- /package/dist/core/{p-b4e322fe.entry.js.map → p-5900cb65.entry.js.map} +0 -0
- /package/dist/core/{p-78a54069.entry.js.map → p-5976de6e.entry.js.map} +0 -0
- /package/dist/core/{p-0d7fd892.entry.js.map → p-659d048d.entry.js.map} +0 -0
- /package/dist/core/{p-1edf2689.entry.js.map → p-67de1290.entry.js.map} +0 -0
- /package/dist/core/{p-f700b759.entry.js.map → p-73043f57.entry.js.map} +0 -0
- /package/dist/core/{p-7b8e5926.entry.js.map → p-735d3096.entry.js.map} +0 -0
- /package/dist/core/{p-07075461.entry.js.map → p-7b538fd1.entry.js.map} +0 -0
- /package/dist/core/{p-cfd43558.entry.js.map → p-80d85403.entry.js.map} +0 -0
- /package/dist/core/{p-79949920.entry.js.map → p-8a833e82.entry.js.map} +0 -0
- /package/dist/core/{p-0aba9e31.entry.js.map → p-90678e67.entry.js.map} +0 -0
- /package/dist/core/{p-a851eb65.entry.js.map → p-9502fb86.entry.js.map} +0 -0
- /package/dist/core/{p-f6de08fb.entry.js.map → p-9c2b2cb9.entry.js.map} +0 -0
- /package/dist/core/{p-949d08d3.entry.js.map → p-9cb83a2e.entry.js.map} +0 -0
- /package/dist/core/{p-f0ecb80b.entry.js.map → p-a08d6b46.entry.js.map} +0 -0
- /package/dist/core/{p-208f470f.entry.js.map → p-a780a34b.entry.js.map} +0 -0
- /package/dist/core/{p-387b7bca.entry.js.map → p-aad03a3c.entry.js.map} +0 -0
- /package/dist/core/{p-ec14c783.entry.js.map → p-aaf4e367.entry.js.map} +0 -0
- /package/dist/core/{p-707ae6e9.entry.js.map → p-b52c44eb.entry.js.map} +0 -0
- /package/dist/core/{p-780babc0.entry.js.map → p-b997ad5e.entry.js.map} +0 -0
- /package/dist/core/{p-a0af1b0a.entry.js.map → p-bb7652cd.entry.js.map} +0 -0
- /package/dist/core/{p-ded4cd76.entry.js.map → p-cbca04bb.entry.js.map} +0 -0
- /package/dist/core/{p-99687bce.entry.js.map → p-cc64e5ef.entry.js.map} +0 -0
- /package/dist/core/{p-812c5e61.entry.js.map → p-cfbacca1.entry.js.map} +0 -0
- /package/dist/core/{p-0da2caa2.entry.js.map → p-daec7e69.entry.js.map} +0 -0
- /package/dist/core/{p-1590fd69.entry.js.map → p-e7767c0d.entry.js.map} +0 -0
- /package/dist/core/{p-dce11b9d.entry.js.map → p-ea7a3d30.entry.js.map} +0 -0
- /package/dist/core/{p-a674b13b.entry.js.map → p-ef70ea50.entry.js.map} +0 -0
- /package/dist/core/{p-d25d0aad.entry.js.map → p-f64996f1.entry.js.map} +0 -0
- /package/dist/core/{p-db17a793.entry.js.map → p-f661ba76.entry.js.map} +0 -0
- /package/dist/core/{p-a03bb31c.entry.js.map → p-f84ac9c6.entry.js.map} +0 -0
- /package/dist/core/{p-f3406b42.entry.js.map → p-fb9376f0.entry.js.map} +0 -0
|
@@ -1,378 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as removeDisabledFalse, o as onComponentRequiredPropUndefined } from './helpers.js';
|
|
3
|
-
import { d as defineCustomElement$6 } from './ic-button2.js';
|
|
4
|
-
import { d as defineCustomElement$5 } from './ic-loading-indicator2.js';
|
|
5
|
-
import { d as defineCustomElement$4 } from './ic-pagination-item2.js';
|
|
6
|
-
import { d as defineCustomElement$3 } from './ic-tooltip2.js';
|
|
7
|
-
import { d as defineCustomElement$2 } from './ic-typography2.js';
|
|
8
|
-
|
|
9
|
-
const paginationNextPrevious = `<svg width="8" height="10" viewBox="0 0 8 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
10
|
-
<path d="M2.08748 0L0.912476 1.175L4.72914 5L0.912476 8.825L2.08748 10L7.08748 5L2.08748 0Z" fill="currentColor"/>
|
|
11
|
-
</svg>
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
const paginationFirstLast = `<svg width="12" height="10" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
15
|
-
<path d="M11.1709 8.825L7.34589 5L11.1709 1.175L9.99589 0L4.99589 5L9.99589 10L11.1709 8.825ZM0.829224 0H2.49589V10H0.829224V0Z" fill="currentColour"/>
|
|
16
|
-
</svg>`;
|
|
17
|
-
|
|
18
|
-
const icPaginationCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{box-sizing:border-box;width:100%;display:flex;justify-content:center}nav{width:100%;display:flex;flex-flow:row wrap;justify-content:flex-start;align-items:center}ic-button{cursor:pointer}ic-button.next-previous{--icon-width:var(--ic-space-xs);--icon-height:calc(var(--ic-space-xs) + var(--ic-space-xxxs));padding:0 var(--ic-space-xxs) 0 var(--ic-space-xxxs)}ic-button.first-last{--icon-width:calc(var(--ic-space-sm) + var(--ic-space-xxxs));--icon-height:calc(var(--ic-space-xs) + var(--ic-space-xxxs))}ic-button.first-last::part(button),ic-button.next-previous::part(button){color:var(--ic-pagination-chevron)}:host(.ic-pagination-monochrome) ic-button.first-last::part(button),:host(.ic-pagination-monochrome) ic-button.next-previous::part(button){color:var(--ic-pagination-chevron-monochrome)}ic-button.ic-button-disabled.first-last::part(button),ic-button.ic-button-disabled.next-previous::part(button),:host(.ic-pagination-monochrome) ic-button.ic-button-disabled.first-last::part(button),:host(.ic-pagination-monochrome) ic-button.ic-button-disabled.next-previous::part(button){color:var(--ic-pagination-chevron-disabled)}.disabled{color:var(--ic-color-text-disabled-mid);pointer-events:none;cursor:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.hide-current-page{display:none}.sr-only{position:absolute;left:-9999px}.sr-only:dir(rtl){right:-9999px}";
|
|
19
|
-
const IcPaginationStyle0 = icPaginationCss;
|
|
20
|
-
|
|
21
|
-
const Pagination = /*@__PURE__*/ proxyCustomElement(class Pagination extends HTMLElement {
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
this.__registerHost();
|
|
25
|
-
this.__attachShadow();
|
|
26
|
-
this.icPageChange = createEvent(this, "icPageChange", 7);
|
|
27
|
-
this.endEllipsis = false;
|
|
28
|
-
this.endItems = [];
|
|
29
|
-
this.midItems = [];
|
|
30
|
-
this.startEllipsis = false;
|
|
31
|
-
this.startItems = [];
|
|
32
|
-
/**
|
|
33
|
-
* The accessible label of the pagination component to provide context for screen reader users.
|
|
34
|
-
*/
|
|
35
|
-
this.accessibleLabel = "Pagination Navigation";
|
|
36
|
-
/**
|
|
37
|
-
* The number of pages displayed adjacent to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.
|
|
38
|
-
*/
|
|
39
|
-
this.adjacentPageCount = 1;
|
|
40
|
-
/**
|
|
41
|
-
* The number of pages displayed as boundary items to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.
|
|
42
|
-
*/
|
|
43
|
-
this.boundaryPageCount = 1;
|
|
44
|
-
/**
|
|
45
|
-
* The default page to display.
|
|
46
|
-
*/
|
|
47
|
-
this.defaultPage = 1;
|
|
48
|
-
/**
|
|
49
|
-
* If `true`, the pagination will not allow interaction.
|
|
50
|
-
*/
|
|
51
|
-
this.disabled = false;
|
|
52
|
-
/**
|
|
53
|
-
* If `true`, the current page of the simple pagination will not be displayed.
|
|
54
|
-
*/
|
|
55
|
-
this.hideCurrentPage = false;
|
|
56
|
-
/**
|
|
57
|
-
* If `true`, the first and last page buttons will not be displayed.
|
|
58
|
-
*/
|
|
59
|
-
this.hideFirstAndLastPageButton = false;
|
|
60
|
-
/**
|
|
61
|
-
* The label for the pagination item (applicable when simple pagination is being used).
|
|
62
|
-
*/
|
|
63
|
-
this.label = "Page";
|
|
64
|
-
/**
|
|
65
|
-
* If `true`, the pagination will display as black in the light theme, and white in dark theme.
|
|
66
|
-
*/
|
|
67
|
-
this.monochrome = false;
|
|
68
|
-
/**
|
|
69
|
-
* Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component.
|
|
70
|
-
*/
|
|
71
|
-
this.theme = "inherit";
|
|
72
|
-
/**
|
|
73
|
-
* The type of pagination to be used.
|
|
74
|
-
*/
|
|
75
|
-
this.type = "simple";
|
|
76
|
-
/**
|
|
77
|
-
* The current page displayed by the pagination.
|
|
78
|
-
*/
|
|
79
|
-
this.currentPage = this.defaultPage;
|
|
80
|
-
this.handleClickFirst = () => {
|
|
81
|
-
this.currentPage = 1;
|
|
82
|
-
this.icPageChange.emit({ value: this.currentPage });
|
|
83
|
-
};
|
|
84
|
-
this.handleClickPrevious = () => {
|
|
85
|
-
this.currentPage--;
|
|
86
|
-
this.icPageChange.emit({ value: this.currentPage });
|
|
87
|
-
};
|
|
88
|
-
this.handleClickNext = () => {
|
|
89
|
-
this.currentPage++;
|
|
90
|
-
this.icPageChange.emit({ value: this.currentPage });
|
|
91
|
-
};
|
|
92
|
-
this.handleClickLast = () => {
|
|
93
|
-
this.currentPage = this.pages;
|
|
94
|
-
this.icPageChange.emit({ value: this.currentPage });
|
|
95
|
-
};
|
|
96
|
-
// button rendering abstracted from component render methods for clarity
|
|
97
|
-
this.firstButton = () => {
|
|
98
|
-
return (h("ic-button", { id: "first-page-button", "aria-label": "Go to first page", theme: this.theme, onClick: this.handleClickFirst, class: "page-button first-last", disabled: this.currentPage === 1 || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationFirstLast }));
|
|
99
|
-
};
|
|
100
|
-
this.previousButton = () => {
|
|
101
|
-
return (h("ic-button", { id: "previous-page-button", "aria-label": "Go to previous page", theme: this.theme, onClick: this.handleClickPrevious, class: "page-button next-previous flip", disabled: this.currentPage === 1 || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationNextPrevious }));
|
|
102
|
-
};
|
|
103
|
-
this.nextButton = () => {
|
|
104
|
-
return (h("ic-button", { id: "next-page-button", "aria-label": "Go to next page", theme: this.theme, onClick: this.handleClickNext, class: "page-button next-previous", disabled: this.currentPage === this.pages || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationNextPrevious }));
|
|
105
|
-
};
|
|
106
|
-
this.lastButton = () => {
|
|
107
|
-
return (h("ic-button", { id: "last-page-button", "aria-label": "Go to last page", theme: this.theme, onClick: this.handleClickLast, class: "page-button first-last flip", disabled: this.currentPage === this.pages || this.disabled, variant: "icon-tertiary", monochrome: this.theme == "light" || this.theme == "dark", innerHTML: paginationFirstLast }));
|
|
108
|
-
};
|
|
109
|
-
this.renderStartEllipsis = () => {
|
|
110
|
-
return (h("ic-pagination-item", { theme: this.theme, monochrome: this.monochrome, type: "ellipsis", id: "start-ellipsis", disabled: this.disabled }));
|
|
111
|
-
};
|
|
112
|
-
this.renderEndEllipsis = () => {
|
|
113
|
-
return (h("ic-pagination-item", { theme: this.theme, monochrome: this.monochrome, type: "ellipsis", id: "end-ellipsis", disabled: this.disabled }));
|
|
114
|
-
};
|
|
115
|
-
this.renderStartItems = () => {
|
|
116
|
-
return this.startItems.map((page) => {
|
|
117
|
-
return (h("ic-pagination-item", { theme: this.theme, monochrome: this.monochrome, selected: page === this.currentPage, id: `pagination-item-${page}`, type: "page", page: page, disabled: this.disabled }));
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
this.renderEndItems = () => {
|
|
121
|
-
return this.endItems.map((page) => {
|
|
122
|
-
return (h("ic-pagination-item", { theme: this.theme, monochrome: this.monochrome, selected: page === this.currentPage, id: `pagination-item-${page}`, type: "page", page: page, disabled: this.disabled }));
|
|
123
|
-
});
|
|
124
|
-
};
|
|
125
|
-
this.renderMiddleItems = () => {
|
|
126
|
-
return this.midItems.map((page) => {
|
|
127
|
-
return (h("ic-pagination-item", { theme: this.theme, monochrome: this.monochrome, selected: page === this.currentPage, id: `pagination-item-${page}`, type: "page", page: page, disabled: this.disabled }));
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
watchAdjacentPageCountHandler() {
|
|
132
|
-
if (this.adjacentPageCount > 2) {
|
|
133
|
-
this.adjacentPageCount = 2;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
watchBoundaryPageCountHandler() {
|
|
137
|
-
if (this.boundaryPageCount > 2) {
|
|
138
|
-
this.boundaryPageCount = 2;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
watchDisabledHandler() {
|
|
142
|
-
removeDisabledFalse(this.disabled, this.el);
|
|
143
|
-
}
|
|
144
|
-
watchNumberPagesHandler() {
|
|
145
|
-
this.watchPageChangeHandler();
|
|
146
|
-
}
|
|
147
|
-
watchTypeHandler() {
|
|
148
|
-
this.watchPageChangeHandler();
|
|
149
|
-
}
|
|
150
|
-
watchPageChangeHandler() {
|
|
151
|
-
if (this.type === "simple") {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
this.startEllipsis = false;
|
|
155
|
-
this.endEllipsis = false;
|
|
156
|
-
this.startItems = [];
|
|
157
|
-
this.endItems = [];
|
|
158
|
-
this.midItems = [];
|
|
159
|
-
const startItems = [];
|
|
160
|
-
let startItemCount = 0;
|
|
161
|
-
const endItems = [];
|
|
162
|
-
let endStart = this.pages;
|
|
163
|
-
const midItems = [];
|
|
164
|
-
let midStart;
|
|
165
|
-
let midEnd;
|
|
166
|
-
let startEllipsis = false;
|
|
167
|
-
let endEllipsis = false;
|
|
168
|
-
if (this.pages <=
|
|
169
|
-
this.boundaryPageCount * 2 + this.adjacentPageCount * 2 + 3) {
|
|
170
|
-
this.startEllipsis = false;
|
|
171
|
-
this.endEllipsis = false;
|
|
172
|
-
for (let i = 1; i <= this.pages; i++) {
|
|
173
|
-
startItems.push(i);
|
|
174
|
-
}
|
|
175
|
-
this.startItems = startItems;
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
startItemCount = this.boundaryPageCount === 0 ? 1 : this.boundaryPageCount;
|
|
179
|
-
endStart =
|
|
180
|
-
this.boundaryPageCount === 0
|
|
181
|
-
? this.pages
|
|
182
|
-
: this.pages - this.boundaryPageCount + 1;
|
|
183
|
-
if (this.currentPage <=
|
|
184
|
-
this.adjacentPageCount + this.boundaryPageCount + 2) {
|
|
185
|
-
startEllipsis = false;
|
|
186
|
-
endEllipsis = true;
|
|
187
|
-
let numItems = 2 * this.adjacentPageCount + 1;
|
|
188
|
-
if (this.boundaryPageCount === 0) {
|
|
189
|
-
numItems--;
|
|
190
|
-
}
|
|
191
|
-
midStart = startItemCount + 1;
|
|
192
|
-
midEnd = midStart + numItems;
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
startEllipsis = true;
|
|
196
|
-
if (this.currentPage >
|
|
197
|
-
this.pages - (this.adjacentPageCount + this.boundaryPageCount + 2)) {
|
|
198
|
-
let numItems = 2 * this.adjacentPageCount + 1;
|
|
199
|
-
if (this.boundaryPageCount === 0) {
|
|
200
|
-
numItems--;
|
|
201
|
-
}
|
|
202
|
-
midEnd =
|
|
203
|
-
this.boundaryPageCount === 0
|
|
204
|
-
? this.pages - 1
|
|
205
|
-
: this.pages - this.boundaryPageCount;
|
|
206
|
-
midStart = midEnd - numItems;
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
endEllipsis = true;
|
|
210
|
-
midStart = this.currentPage - this.adjacentPageCount;
|
|
211
|
-
midEnd = this.currentPage + this.adjacentPageCount;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
//create array of start items
|
|
215
|
-
if (this.boundaryPageCount > 0 ||
|
|
216
|
-
(this.boundaryPageCount === 0 && startEllipsis === false)) {
|
|
217
|
-
for (let i = 1; i <= startItemCount; i++) {
|
|
218
|
-
startItems.push(i);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
//create array of end items
|
|
222
|
-
if (this.boundaryPageCount > 0 ||
|
|
223
|
-
(this.boundaryPageCount === 0 && endEllipsis === false)) {
|
|
224
|
-
for (let i = endStart; i <= this.pages; i++) {
|
|
225
|
-
endItems.push(i);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
//create array of mid items
|
|
229
|
-
for (let i = midStart; i <= midEnd; i++) {
|
|
230
|
-
midItems.push(i);
|
|
231
|
-
}
|
|
232
|
-
this.startEllipsis = startEllipsis;
|
|
233
|
-
this.endEllipsis = endEllipsis;
|
|
234
|
-
this.startItems = startItems;
|
|
235
|
-
this.endItems = endItems;
|
|
236
|
-
this.midItems = midItems;
|
|
237
|
-
}
|
|
238
|
-
componentWillLoad() {
|
|
239
|
-
this.watchPageChangeHandler();
|
|
240
|
-
this.watchBoundaryPageCountHandler();
|
|
241
|
-
this.watchAdjacentPageCountHandler();
|
|
242
|
-
removeDisabledFalse(this.disabled, this.el);
|
|
243
|
-
}
|
|
244
|
-
componentDidLoad() {
|
|
245
|
-
onComponentRequiredPropUndefined([{ prop: this.pages, propName: "pages" }], "Pagination");
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Prevents focus lingering on a disabled element. If the currently
|
|
249
|
-
* focused element is one of the back buttons (and we reach the first page),
|
|
250
|
-
* move focus to "next" button, and vice versa.
|
|
251
|
-
* @param ev
|
|
252
|
-
*/
|
|
253
|
-
icPageChangeHandler(ev) {
|
|
254
|
-
var _a, _b, _c;
|
|
255
|
-
const shadow = (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.shadowRoot;
|
|
256
|
-
const activeEl = shadow ? shadow.activeElement : document.activeElement;
|
|
257
|
-
if (!shadow || !activeEl) {
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
if (ev.detail.value === 1 &&
|
|
261
|
-
["first-page-button", "previous-page-button"].some((id) => id === (activeEl === null || activeEl === void 0 ? void 0 : activeEl.id))) {
|
|
262
|
-
const btn = (_b = shadow.querySelector("#next-page-button").shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("button");
|
|
263
|
-
// When navigating from firstPage->lastPage or vice versa, the to-be-selected element will be disabled. wait a tick so that it can receive focus.
|
|
264
|
-
setTimeout(() => btn === null || btn === void 0 ? void 0 : btn.focus(), 10);
|
|
265
|
-
}
|
|
266
|
-
else if (ev.detail.value === this.pages &&
|
|
267
|
-
["last-page-button", "next-page-button"].some((id) => id === (activeEl === null || activeEl === void 0 ? void 0 : activeEl.id))) {
|
|
268
|
-
const btn = (_c = shadow.querySelector("#previous-page-button").shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector("button");
|
|
269
|
-
setTimeout(() => btn === null || btn === void 0 ? void 0 : btn.focus(), 10);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
paginationItemClickHandler(ev) {
|
|
273
|
-
const page = ev.detail.page;
|
|
274
|
-
this.currentPage = page;
|
|
275
|
-
this.icPageChange.emit({ value: this.currentPage });
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Sets the currently displayed page.
|
|
279
|
-
* @param {number} page The page number to set as the current page
|
|
280
|
-
*/
|
|
281
|
-
async setCurrentPage(page) {
|
|
282
|
-
if (typeof page === "number" && page > 0 && page <= this.pages) {
|
|
283
|
-
this.currentPage = page;
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
console.error("Current page must be a number greater than zero but less than or equal to the total number of pages");
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
render() {
|
|
290
|
-
const { type, currentPage, hideCurrentPage, disabled, hideFirstAndLastPageButton, label, theme, monochrome, } = this;
|
|
291
|
-
return (h(Host, { key: 'cefb3137892be2304c041ca32ca118268f8ccb07', class: {
|
|
292
|
-
[`ic-theme-${theme}`]: theme !== "inherit",
|
|
293
|
-
["ic-pagination-monochrome"]: !!monochrome,
|
|
294
|
-
} }, type === "simple" && (h("nav", { key: '9a1d8230be41cb26b31bb8af066a32e9b64e0d89', class: {
|
|
295
|
-
["disabled"]: !!disabled,
|
|
296
|
-
}, role: "navigation", "aria-label": this.accessibleLabel }, hideFirstAndLastPageButton ? null : this.firstButton(), this.previousButton(), h("ic-pagination-item", { key: '577b9b9894ce6ddc2cf02381729600e4284e8912', theme: this.theme, monochrome: this.monochrome, type: "simple-current", page: currentPage, label: label, class: { ["hide-current-page"]: !!hideCurrentPage }, disabled: disabled }), this.nextButton(), hideFirstAndLastPageButton ? null : this.lastButton())), type === "complex" && (h("nav", { key: '317d507ca76549e3c980ced7d01332504738a102', class: {
|
|
297
|
-
["disabled"]: !!disabled,
|
|
298
|
-
}, role: "navigation", "aria-label": this.accessibleLabel }, hideFirstAndLastPageButton ? null : this.firstButton(), this.previousButton(), this.renderStartItems(), this.startEllipsis && this.renderStartEllipsis(), this.renderMiddleItems(), this.endEllipsis && this.renderEndEllipsis(), this.renderEndItems(), this.nextButton(), hideFirstAndLastPageButton ? null : this.lastButton())), type === "complex" && (h("span", { key: '6d3a5778f4704dd5ec1e74bf2cf236143c5f7e7c', class: "sr-only", "aria-live": "polite" }, "Page ", this.currentPage))));
|
|
299
|
-
}
|
|
300
|
-
get el() { return this; }
|
|
301
|
-
static get watchers() { return {
|
|
302
|
-
"adjacentPageCount": ["watchAdjacentPageCountHandler"],
|
|
303
|
-
"boundaryPageCount": ["watchBoundaryPageCountHandler"],
|
|
304
|
-
"disabled": ["watchDisabledHandler"],
|
|
305
|
-
"pages": ["watchNumberPagesHandler"],
|
|
306
|
-
"type": ["watchTypeHandler"],
|
|
307
|
-
"currentPage": ["watchPageChangeHandler"]
|
|
308
|
-
}; }
|
|
309
|
-
static get style() { return IcPaginationStyle0; }
|
|
310
|
-
}, [1, "ic-pagination", {
|
|
311
|
-
"accessibleLabel": [1, "accessible-label"],
|
|
312
|
-
"adjacentPageCount": [1026, "adjacent-page-count"],
|
|
313
|
-
"boundaryPageCount": [1026, "boundary-page-count"],
|
|
314
|
-
"defaultPage": [2, "default-page"],
|
|
315
|
-
"disabled": [4],
|
|
316
|
-
"hideCurrentPage": [4, "hide-current-page"],
|
|
317
|
-
"hideFirstAndLastPageButton": [4, "hide-first-and-last-page-button"],
|
|
318
|
-
"label": [1],
|
|
319
|
-
"monochrome": [4],
|
|
320
|
-
"pages": [2],
|
|
321
|
-
"theme": [1],
|
|
322
|
-
"type": [1],
|
|
323
|
-
"currentPage": [1026, "current-page"],
|
|
324
|
-
"endEllipsis": [32],
|
|
325
|
-
"endItems": [32],
|
|
326
|
-
"midItems": [32],
|
|
327
|
-
"startEllipsis": [32],
|
|
328
|
-
"startItems": [32],
|
|
329
|
-
"setCurrentPage": [64]
|
|
330
|
-
}, [[0, "icPageChange", "icPageChangeHandler"], [0, "paginationItemClick", "paginationItemClickHandler"]], {
|
|
331
|
-
"adjacentPageCount": ["watchAdjacentPageCountHandler"],
|
|
332
|
-
"boundaryPageCount": ["watchBoundaryPageCountHandler"],
|
|
333
|
-
"disabled": ["watchDisabledHandler"],
|
|
334
|
-
"pages": ["watchNumberPagesHandler"],
|
|
335
|
-
"type": ["watchTypeHandler"],
|
|
336
|
-
"currentPage": ["watchPageChangeHandler"]
|
|
337
|
-
}]);
|
|
338
|
-
function defineCustomElement$1() {
|
|
339
|
-
if (typeof customElements === "undefined") {
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
const components = ["ic-pagination", "ic-button", "ic-loading-indicator", "ic-pagination-item", "ic-tooltip", "ic-typography"];
|
|
343
|
-
components.forEach(tagName => { switch (tagName) {
|
|
344
|
-
case "ic-pagination":
|
|
345
|
-
if (!customElements.get(tagName)) {
|
|
346
|
-
customElements.define(tagName, Pagination);
|
|
347
|
-
}
|
|
348
|
-
break;
|
|
349
|
-
case "ic-button":
|
|
350
|
-
if (!customElements.get(tagName)) {
|
|
351
|
-
defineCustomElement$6();
|
|
352
|
-
}
|
|
353
|
-
break;
|
|
354
|
-
case "ic-loading-indicator":
|
|
355
|
-
if (!customElements.get(tagName)) {
|
|
356
|
-
defineCustomElement$5();
|
|
357
|
-
}
|
|
358
|
-
break;
|
|
359
|
-
case "ic-pagination-item":
|
|
360
|
-
if (!customElements.get(tagName)) {
|
|
361
|
-
defineCustomElement$4();
|
|
362
|
-
}
|
|
363
|
-
break;
|
|
364
|
-
case "ic-tooltip":
|
|
365
|
-
if (!customElements.get(tagName)) {
|
|
366
|
-
defineCustomElement$3();
|
|
367
|
-
}
|
|
368
|
-
break;
|
|
369
|
-
case "ic-typography":
|
|
370
|
-
if (!customElements.get(tagName)) {
|
|
371
|
-
defineCustomElement$2();
|
|
372
|
-
}
|
|
373
|
-
break;
|
|
374
|
-
} });
|
|
375
|
-
}
|
|
1
|
+
import { P as Pagination, d as defineCustomElement$1 } from './ic-pagination2.js';
|
|
376
2
|
|
|
377
3
|
const IcPagination = Pagination;
|
|
378
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"ic-pagination.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,wuHAAwuH,CAAC;AACjwH,2BAAe,eAAe;;MC0BjB,UAAU;IALvB;;;;;QAQW,gBAAW,GAAY,KAAK,CAAC;QAC7B,aAAQ,GAAa,EAAE,CAAC;QAC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,SAAS,KACjB,4DACE,KAAK,EAAE;gBACL,CAAC,UAAU,GAAG,CAAC,CAAC,QAAQ;aACzB,EACD,IAAI,EAAC,YAAY,gBACL,IAAI,CAAC,eAAe,IAE/B,0BAA0B,GAAG,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,EACtD,IAAI,CAAC,cAAc,EAAE,EACrB,IAAI,CAAC,gBAAgB,EAAE,EACvB,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,mBAAmB,EAAE,EAChD,IAAI,CAAC,iBAAiB,EAAE,EACxB,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,iBAAiB,EAAE,EAC5C,IAAI,CAAC,cAAc,EAAE,EACrB,IAAI,CAAC,UAAU,EAAE,EACjB,0BAA0B,GAAG,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAClD,CACP,EACA,IAAI,KAAK,SAAS,KACjB,6DAAM,KAAK,EAAC,SAAS,eAAW,QAAQ,aAChC,IAAI,CAAC,WAAW,CACjB,CACR,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/ic-pagination/ic-pagination.css?tag=ic-pagination&encapsulation=shadow","src/components/ic-pagination/ic-pagination.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n box-sizing: border-box;\n width: 100%;\n display: flex;\n justify-content: center;\n}\n\nnav {\n width: 100%;\n display: flex;\n flex-flow: row wrap;\n justify-content: flex-start;\n align-items: center;\n}\n\nic-button {\n cursor: pointer;\n}\n\nic-button.next-previous {\n --icon-width: var(--ic-space-xs);\n --icon-height: calc(var(--ic-space-xs) + var(--ic-space-xxxs));\n\n padding: 0 var(--ic-space-xxs) 0 var(--ic-space-xxxs);\n}\n\nic-button.first-last {\n --icon-width: calc(var(--ic-space-sm) + var(--ic-space-xxxs));\n --icon-height: calc(var(--ic-space-xs) + var(--ic-space-xxxs));\n}\n\nic-button.first-last::part(button),\nic-button.next-previous::part(button) {\n color: var(--ic-pagination-chevron);\n}\n\n:host(.ic-pagination-monochrome) ic-button.first-last::part(button),\n:host(.ic-pagination-monochrome) ic-button.next-previous::part(button) {\n color: var(--ic-pagination-chevron-monochrome);\n}\n\nic-button.ic-button-disabled.first-last::part(button),\nic-button.ic-button-disabled.next-previous::part(button),\n:host(.ic-pagination-monochrome)\n ic-button.ic-button-disabled.first-last::part(button),\n:host(.ic-pagination-monochrome)\n ic-button.ic-button-disabled.next-previous::part(button) {\n color: var(--ic-pagination-chevron-disabled);\n}\n\n.disabled {\n color: var(--ic-color-text-disabled-mid);\n pointer-events: none;\n cursor: none;\n user-select: none;\n}\n\n.hide-current-page {\n display: none;\n}\n\n.sr-only {\n position: absolute;\n left: -9999px;\n}\n\n.sr-only:dir(rtl) {\n right: -9999px;\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n Listen,\n State,\n Watch,\n Event,\n EventEmitter,\n Method,\n} from \"@stencil/core\";\nimport paginationNextPrevious from \"../../assets/pagination-next-previous.svg\";\nimport paginationFirstLast from \"../../assets/pagination-first-last.svg\";\nimport { IcThemeMode } from \"../../utils/types\";\nimport { IcPaginationTypes, IcChangeEventDetail } from \"./ic-pagination.types\";\nimport {\n onComponentRequiredPropUndefined,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\n\n@Component({\n tag: \"ic-pagination\",\n styleUrl: \"ic-pagination.css\",\n shadow: true,\n})\nexport class Pagination {\n @Element() el: HTMLIcPaginationElement;\n\n @State() endEllipsis: boolean = false;\n @State() endItems: number[] = [];\n @State() midItems: number[] = [];\n @State() startEllipsis: boolean = false;\n @State() startItems: number[] = [];\n\n /**\n * The accessible label of the pagination component to provide context for screen reader users.\n */\n @Prop() accessibleLabel?: string = \"Pagination Navigation\";\n\n /**\n * The number of pages displayed adjacent to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.\n */\n @Prop({ mutable: true }) adjacentPageCount?: number = 1;\n\n @Watch(\"adjacentPageCount\")\n watchAdjacentPageCountHandler(): void {\n if (this.adjacentPageCount! > 2) {\n this.adjacentPageCount = 2;\n }\n }\n\n /**\n * The number of pages displayed as boundary items to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.\n */\n @Prop({ mutable: true }) boundaryPageCount?: number = 1;\n\n @Watch(\"boundaryPageCount\")\n watchBoundaryPageCountHandler(): void {\n if (this.boundaryPageCount! > 2) {\n this.boundaryPageCount = 2;\n }\n }\n\n /**\n * The default page to display.\n */\n @Prop() defaultPage?: number = 1;\n\n /**\n * If `true`, the pagination will not allow interaction.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the current page of the simple pagination will not be displayed.\n */\n @Prop() hideCurrentPage?: boolean = false;\n\n /**\n * If `true`, the first and last page buttons will not be displayed.\n */\n @Prop() hideFirstAndLastPageButton?: boolean = false;\n\n /**\n * The label for the pagination item (applicable when simple pagination is being used).\n */\n @Prop() label?: string = \"Page\";\n\n /**\n * If `true`, the pagination will display as black in the light theme, and white in dark theme.\n */\n @Prop() monochrome?: boolean = false;\n\n /**\n * The total number of pages.\n */\n @Prop() pages!: number;\n\n @Watch(\"pages\")\n watchNumberPagesHandler(): void {\n this.watchPageChangeHandler();\n }\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * The type of pagination to be used.\n */\n @Prop() type?: IcPaginationTypes = \"simple\";\n\n @Watch(\"type\")\n watchTypeHandler(): void {\n this.watchPageChangeHandler();\n }\n\n /**\n * The current page displayed by the pagination.\n */\n @Prop({ mutable: true }) currentPage?: number = this.defaultPage;\n\n @Watch(\"currentPage\")\n watchPageChangeHandler(): void {\n if (this.type === \"simple\") {\n return;\n }\n\n this.startEllipsis = false;\n this.endEllipsis = false;\n this.startItems = [];\n this.endItems = [];\n this.midItems = [];\n\n const startItems = [];\n let startItemCount = 0;\n const endItems = [];\n let endStart = this.pages;\n const midItems = [];\n let midStart;\n let midEnd;\n let startEllipsis = false;\n let endEllipsis = false;\n\n if (\n this.pages <=\n this.boundaryPageCount! * 2 + this.adjacentPageCount! * 2 + 3\n ) {\n this.startEllipsis = false;\n this.endEllipsis = false;\n for (let i = 1; i <= this.pages; i++) {\n startItems.push(i);\n }\n this.startItems = startItems;\n return;\n }\n\n startItemCount = this.boundaryPageCount === 0 ? 1 : this.boundaryPageCount!;\n endStart =\n this.boundaryPageCount === 0\n ? this.pages\n : this.pages - this.boundaryPageCount! + 1;\n\n if (\n this.currentPage! <=\n this.adjacentPageCount! + this.boundaryPageCount! + 2\n ) {\n startEllipsis = false;\n endEllipsis = true;\n\n let numItems = 2 * this.adjacentPageCount! + 1;\n if (this.boundaryPageCount === 0) {\n numItems--;\n }\n midStart = startItemCount + 1;\n midEnd = midStart + numItems;\n } else {\n startEllipsis = true;\n if (\n this.currentPage! >\n this.pages - (this.adjacentPageCount! + this.boundaryPageCount! + 2)\n ) {\n let numItems = 2 * this.adjacentPageCount! + 1;\n if (this.boundaryPageCount === 0) {\n numItems--;\n }\n midEnd =\n this.boundaryPageCount === 0\n ? this.pages - 1\n : this.pages - this.boundaryPageCount!;\n midStart = midEnd - numItems;\n } else {\n endEllipsis = true;\n midStart = this.currentPage! - this.adjacentPageCount!;\n midEnd = this.currentPage! + this.adjacentPageCount!;\n }\n }\n\n //create array of start items\n if (\n this.boundaryPageCount! > 0 ||\n (this.boundaryPageCount === 0 && startEllipsis === false)\n ) {\n for (let i = 1; i <= startItemCount; i++) {\n startItems.push(i);\n }\n }\n\n //create array of end items\n if (\n this.boundaryPageCount! > 0 ||\n (this.boundaryPageCount === 0 && endEllipsis === false)\n ) {\n for (let i = endStart; i <= this.pages; i++) {\n endItems.push(i);\n }\n }\n\n //create array of mid items\n for (let i = midStart; i <= midEnd; i++) {\n midItems.push(i);\n }\n\n this.startEllipsis = startEllipsis;\n this.endEllipsis = endEllipsis;\n this.startItems = startItems;\n this.endItems = endItems;\n this.midItems = midItems;\n }\n\n /**\n * Emitted when a page is selected.\n */\n @Event() icPageChange: EventEmitter<IcChangeEventDetail>;\n\n componentWillLoad(): void {\n this.watchPageChangeHandler();\n this.watchBoundaryPageCountHandler();\n this.watchAdjacentPageCountHandler();\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.pages, propName: \"pages\" }],\n \"Pagination\"\n );\n }\n\n /**\n * Prevents focus lingering on a disabled element. If the currently\n * focused element is one of the back buttons (and we reach the first page),\n * move focus to \"next\" button, and vice versa.\n * @param ev\n */\n @Listen(\"icPageChange\")\n icPageChangeHandler(ev: CustomEvent<IcChangeEventDetail>) {\n const shadow = document.activeElement?.shadowRoot;\n\n const activeEl = shadow ? shadow.activeElement : document.activeElement;\n if (!shadow || !activeEl) {\n return;\n }\n\n if (\n ev.detail.value === 1 &&\n [\"first-page-button\", \"previous-page-button\"].some(\n (id) => id === activeEl?.id\n )\n ) {\n const btn = (\n shadow.querySelector(\"#next-page-button\") as HTMLElement\n ).shadowRoot?.querySelector(\"button\");\n // When navigating from firstPage->lastPage or vice versa, the to-be-selected element will be disabled. wait a tick so that it can receive focus.\n setTimeout(() => btn?.focus(), 10);\n } else if (\n ev.detail.value === this.pages &&\n [\"last-page-button\", \"next-page-button\"].some((id) => id === activeEl?.id)\n ) {\n const btn = (\n shadow!.querySelector(\"#previous-page-button\") as HTMLElement\n ).shadowRoot?.querySelector(\"button\");\n setTimeout(() => btn?.focus(), 10);\n }\n }\n\n @Listen(\"paginationItemClick\")\n paginationItemClickHandler(ev: CustomEvent): void {\n const page = ev.detail.page;\n this.currentPage = page;\n this.icPageChange.emit({ value: this.currentPage! });\n }\n\n /**\n * Sets the currently displayed page.\n * @param {number} page The page number to set as the current page\n */\n @Method()\n async setCurrentPage(page: number): Promise<void> {\n if (typeof page === \"number\" && page > 0 && page <= this.pages) {\n this.currentPage = page;\n } else {\n console.error(\n \"Current page must be a number greater than zero but less than or equal to the total number of pages\"\n );\n }\n }\n\n private handleClickFirst = () => {\n this.currentPage = 1;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n private handleClickPrevious = (): void => {\n this.currentPage!--;\n this.icPageChange.emit({ value: this.currentPage! });\n };\n\n private handleClickNext = (): void => {\n this.currentPage!++;\n this.icPageChange.emit({ value: this.currentPage! });\n };\n\n private handleClickLast = (): void => {\n this.currentPage = this.pages;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n // button rendering abstracted from component render methods for clarity\n private firstButton = () => {\n return (\n <ic-button\n id=\"first-page-button\"\n aria-label=\"Go to first page\"\n theme={this.theme}\n onClick={this.handleClickFirst}\n class=\"page-button first-last\"\n disabled={this.currentPage === 1 || this.disabled}\n variant=\"icon-tertiary\"\n monochrome={this.theme == \"light\" || this.theme == \"dark\"}\n innerHTML={paginationFirstLast}\n />\n );\n };\n\n private previousButton = () => {\n return (\n <ic-button\n id=\"previous-page-button\"\n aria-label=\"Go to previous page\"\n theme={this.theme}\n onClick={this.handleClickPrevious}\n class=\"page-button next-previous flip\"\n disabled={this.currentPage === 1 || this.disabled}\n variant=\"icon-tertiary\"\n monochrome={this.theme == \"light\" || this.theme == \"dark\"}\n innerHTML={paginationNextPrevious}\n />\n );\n };\n\n private nextButton = () => {\n return (\n <ic-button\n id=\"next-page-button\"\n aria-label=\"Go to next page\"\n theme={this.theme}\n onClick={this.handleClickNext}\n class=\"page-button next-previous\"\n disabled={this.currentPage === this.pages || this.disabled}\n variant=\"icon-tertiary\"\n monochrome={this.theme == \"light\" || this.theme == \"dark\"}\n innerHTML={paginationNextPrevious}\n />\n );\n };\n\n private lastButton = () => {\n return (\n <ic-button\n id=\"last-page-button\"\n aria-label=\"Go to last page\"\n theme={this.theme}\n onClick={this.handleClickLast}\n class=\"page-button first-last flip\"\n disabled={this.currentPage === this.pages || this.disabled}\n variant=\"icon-tertiary\"\n monochrome={this.theme == \"light\" || this.theme == \"dark\"}\n innerHTML={paginationFirstLast}\n />\n );\n };\n\n private renderStartEllipsis = () => {\n return (\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n type=\"ellipsis\"\n id=\"start-ellipsis\"\n disabled={this.disabled}\n />\n );\n };\n\n private renderEndEllipsis = () => {\n return (\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n type=\"ellipsis\"\n id=\"end-ellipsis\"\n disabled={this.disabled}\n />\n );\n };\n\n private renderStartItems = () => {\n return this.startItems.map((page: number) => {\n return (\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n private renderEndItems = () => {\n return this.endItems.map((page: number) => {\n return (\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n private renderMiddleItems = () => {\n return this.midItems.map((page: number) => {\n return (\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n render() {\n const {\n type,\n currentPage,\n hideCurrentPage,\n disabled,\n hideFirstAndLastPageButton,\n label,\n theme,\n monochrome,\n } = this;\n\n return (\n <Host\n class={{\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n [\"ic-pagination-monochrome\"]: !!monochrome,\n }}\n >\n {type === \"simple\" && (\n <nav\n class={{\n [\"disabled\"]: !!disabled,\n }}\n role=\"navigation\"\n aria-label={this.accessibleLabel}\n >\n {hideFirstAndLastPageButton ? null : this.firstButton()}\n {this.previousButton()}\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n type=\"simple-current\"\n page={currentPage}\n label={label}\n class={{ [\"hide-current-page\"]: !!hideCurrentPage }}\n disabled={disabled}\n />\n {this.nextButton()}\n {hideFirstAndLastPageButton ? null : this.lastButton()}\n </nav>\n )}\n {type === \"complex\" && (\n <nav\n class={{\n [\"disabled\"]: !!disabled,\n }}\n role=\"navigation\"\n aria-label={this.accessibleLabel}\n >\n {hideFirstAndLastPageButton ? null : this.firstButton()}\n {this.previousButton()}\n {this.renderStartItems()}\n {this.startEllipsis && this.renderStartEllipsis()}\n {this.renderMiddleItems()}\n {this.endEllipsis && this.renderEndEllipsis()}\n {this.renderEndItems()}\n {this.nextButton()}\n {hideFirstAndLastPageButton ? null : this.lastButton()}\n </nav>\n )}\n {type === \"complex\" && (\n <span class=\"sr-only\" aria-live=\"polite\">\n Page {this.currentPage}\n </span>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"ic-pagination.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as removeDisabledFalse, o as onComponentRequiredPropUndefined } from './helpers
|
|
3
|
-
import './
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { r as removeDisabledFalse, o as onComponentRequiredPropUndefined } from './helpers.js';
|
|
3
|
+
import { d as defineCustomElement$5 } from './ic-button2.js';
|
|
4
|
+
import { d as defineCustomElement$4 } from './ic-loading-indicator2.js';
|
|
5
|
+
import { d as defineCustomElement$3 } from './ic-pagination-item2.js';
|
|
6
|
+
import { d as defineCustomElement$2 } from './ic-tooltip2.js';
|
|
7
|
+
import { d as defineCustomElement$1 } from './ic-typography2.js';
|
|
4
8
|
|
|
5
9
|
const paginationNextPrevious = `<svg width="8" height="10" viewBox="0 0 8 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
10
|
<path d="M2.08748 0L0.912476 1.175L4.72914 5L0.912476 8.825L2.08748 10L7.08748 5L2.08748 0Z" fill="currentColor"/>
|
|
@@ -14,9 +18,11 @@ const paginationFirstLast = `<svg width="12" height="10" viewBox="0 0 12 10" fil
|
|
|
14
18
|
const icPaginationCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{box-sizing:border-box;width:100%;display:flex;justify-content:center}nav{width:100%;display:flex;flex-flow:row wrap;justify-content:flex-start;align-items:center}ic-button{cursor:pointer}ic-button.next-previous{--icon-width:var(--ic-space-xs);--icon-height:calc(var(--ic-space-xs) + var(--ic-space-xxxs));padding:0 var(--ic-space-xxs) 0 var(--ic-space-xxxs)}ic-button.first-last{--icon-width:calc(var(--ic-space-sm) + var(--ic-space-xxxs));--icon-height:calc(var(--ic-space-xs) + var(--ic-space-xxxs))}ic-button.first-last::part(button),ic-button.next-previous::part(button){color:var(--ic-pagination-chevron)}:host(.ic-pagination-monochrome) ic-button.first-last::part(button),:host(.ic-pagination-monochrome) ic-button.next-previous::part(button){color:var(--ic-pagination-chevron-monochrome)}ic-button.ic-button-disabled.first-last::part(button),ic-button.ic-button-disabled.next-previous::part(button),:host(.ic-pagination-monochrome) ic-button.ic-button-disabled.first-last::part(button),:host(.ic-pagination-monochrome) ic-button.ic-button-disabled.next-previous::part(button){color:var(--ic-pagination-chevron-disabled)}.disabled{color:var(--ic-color-text-disabled-mid);pointer-events:none;cursor:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.hide-current-page{display:none}.sr-only{position:absolute;left:-9999px}.sr-only:dir(rtl){right:-9999px}";
|
|
15
19
|
const IcPaginationStyle0 = icPaginationCss;
|
|
16
20
|
|
|
17
|
-
const Pagination = class {
|
|
18
|
-
constructor(
|
|
19
|
-
|
|
21
|
+
const Pagination = /*@__PURE__*/ proxyCustomElement(class Pagination extends HTMLElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
this.__registerHost();
|
|
25
|
+
this.__attachShadow();
|
|
20
26
|
this.icPageChange = createEvent(this, "icPageChange", 7);
|
|
21
27
|
this.endEllipsis = false;
|
|
22
28
|
this.endItems = [];
|
|
@@ -291,7 +297,7 @@ const Pagination = class {
|
|
|
291
297
|
["disabled"]: !!disabled,
|
|
292
298
|
}, role: "navigation", "aria-label": this.accessibleLabel }, hideFirstAndLastPageButton ? null : this.firstButton(), this.previousButton(), this.renderStartItems(), this.startEllipsis && this.renderStartEllipsis(), this.renderMiddleItems(), this.endEllipsis && this.renderEndEllipsis(), this.renderEndItems(), this.nextButton(), hideFirstAndLastPageButton ? null : this.lastButton())), type === "complex" && (h("span", { key: '6d3a5778f4704dd5ec1e74bf2cf236143c5f7e7c', class: "sr-only", "aria-live": "polite" }, "Page ", this.currentPage))));
|
|
293
299
|
}
|
|
294
|
-
get el() { return
|
|
300
|
+
get el() { return this; }
|
|
295
301
|
static get watchers() { return {
|
|
296
302
|
"adjacentPageCount": ["watchAdjacentPageCountHandler"],
|
|
297
303
|
"boundaryPageCount": ["watchBoundaryPageCountHandler"],
|
|
@@ -300,9 +306,74 @@ const Pagination = class {
|
|
|
300
306
|
"type": ["watchTypeHandler"],
|
|
301
307
|
"currentPage": ["watchPageChangeHandler"]
|
|
302
308
|
}; }
|
|
303
|
-
}
|
|
304
|
-
|
|
309
|
+
static get style() { return IcPaginationStyle0; }
|
|
310
|
+
}, [1, "ic-pagination", {
|
|
311
|
+
"accessibleLabel": [1, "accessible-label"],
|
|
312
|
+
"adjacentPageCount": [1026, "adjacent-page-count"],
|
|
313
|
+
"boundaryPageCount": [1026, "boundary-page-count"],
|
|
314
|
+
"defaultPage": [2, "default-page"],
|
|
315
|
+
"disabled": [4],
|
|
316
|
+
"hideCurrentPage": [4, "hide-current-page"],
|
|
317
|
+
"hideFirstAndLastPageButton": [4, "hide-first-and-last-page-button"],
|
|
318
|
+
"label": [1],
|
|
319
|
+
"monochrome": [4],
|
|
320
|
+
"pages": [2],
|
|
321
|
+
"theme": [1],
|
|
322
|
+
"type": [1],
|
|
323
|
+
"currentPage": [1026, "current-page"],
|
|
324
|
+
"endEllipsis": [32],
|
|
325
|
+
"endItems": [32],
|
|
326
|
+
"midItems": [32],
|
|
327
|
+
"startEllipsis": [32],
|
|
328
|
+
"startItems": [32],
|
|
329
|
+
"setCurrentPage": [64]
|
|
330
|
+
}, [[0, "icPageChange", "icPageChangeHandler"], [0, "paginationItemClick", "paginationItemClickHandler"]], {
|
|
331
|
+
"adjacentPageCount": ["watchAdjacentPageCountHandler"],
|
|
332
|
+
"boundaryPageCount": ["watchBoundaryPageCountHandler"],
|
|
333
|
+
"disabled": ["watchDisabledHandler"],
|
|
334
|
+
"pages": ["watchNumberPagesHandler"],
|
|
335
|
+
"type": ["watchTypeHandler"],
|
|
336
|
+
"currentPage": ["watchPageChangeHandler"]
|
|
337
|
+
}]);
|
|
338
|
+
function defineCustomElement() {
|
|
339
|
+
if (typeof customElements === "undefined") {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const components = ["ic-pagination", "ic-button", "ic-loading-indicator", "ic-pagination-item", "ic-tooltip", "ic-typography"];
|
|
343
|
+
components.forEach(tagName => { switch (tagName) {
|
|
344
|
+
case "ic-pagination":
|
|
345
|
+
if (!customElements.get(tagName)) {
|
|
346
|
+
customElements.define(tagName, Pagination);
|
|
347
|
+
}
|
|
348
|
+
break;
|
|
349
|
+
case "ic-button":
|
|
350
|
+
if (!customElements.get(tagName)) {
|
|
351
|
+
defineCustomElement$5();
|
|
352
|
+
}
|
|
353
|
+
break;
|
|
354
|
+
case "ic-loading-indicator":
|
|
355
|
+
if (!customElements.get(tagName)) {
|
|
356
|
+
defineCustomElement$4();
|
|
357
|
+
}
|
|
358
|
+
break;
|
|
359
|
+
case "ic-pagination-item":
|
|
360
|
+
if (!customElements.get(tagName)) {
|
|
361
|
+
defineCustomElement$3();
|
|
362
|
+
}
|
|
363
|
+
break;
|
|
364
|
+
case "ic-tooltip":
|
|
365
|
+
if (!customElements.get(tagName)) {
|
|
366
|
+
defineCustomElement$2();
|
|
367
|
+
}
|
|
368
|
+
break;
|
|
369
|
+
case "ic-typography":
|
|
370
|
+
if (!customElements.get(tagName)) {
|
|
371
|
+
defineCustomElement$1();
|
|
372
|
+
}
|
|
373
|
+
break;
|
|
374
|
+
} });
|
|
375
|
+
}
|
|
305
376
|
|
|
306
|
-
export { Pagination as
|
|
377
|
+
export { Pagination as P, defineCustomElement as d };
|
|
307
378
|
|
|
308
|
-
//# sourceMappingURL=ic-
|
|
379
|
+
//# sourceMappingURL=ic-pagination2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"ic-pagination2.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,wuHAAwuH,CAAC;AACjwH,2BAAe,eAAe;;MC0BjB,UAAU;IALvB;;;;;QAQW,gBAAW,GAAY,KAAK,CAAC;QAC7B,aAAQ,GAAa,EAAE,CAAC;QACxB,aAAQ,GAAa,EAAE,CAAC;QACxB,kBAAa,GAAY,KAAK,CAAC;QAC/B,eAAU,GAAa,EAAE,CAAC;;;;QAK3B,oBAAe,GAAY,uBAAuB,CAAC;;;;QAKlC,sBAAiB,GAAY,CAAC,CAAC;;;;QAY/B,sBAAiB,GAAY,CAAC,CAAC;;;;QAYhD,gBAAW,GAAY,CAAC,CAAC;;;;QAKzB,aAAQ,GAAa,KAAK,CAAC;;;;QAS3B,oBAAe,GAAa,KAAK,CAAC;;;;QAKlC,+BAA0B,GAAa,KAAK,CAAC;;;;QAK7C,UAAK,GAAY,MAAM,CAAC;;;;QAKxB,eAAU,GAAa,KAAK,CAAC;;;;QAe7B,UAAK,GAAiB,SAAS,CAAC;;;;QAKhC,SAAI,GAAuB,QAAQ,CAAC;;;;QAUnB,gBAAW,GAAY,IAAI,CAAC,WAAW,CAAC;QA4LzD,q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6DAAM,KAAK,EAAC,SAAS,eAAW,QAAQ,aAChC,IAAI,CAAC,WAAW,CACjB,CACR,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/ic-pagination/ic-pagination.css?tag=ic-pagination&encapsulation=shadow","src/components/ic-pagination/ic-pagination.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n box-sizing: border-box;\n width: 100%;\n display: flex;\n justify-content: center;\n}\n\nnav {\n width: 100%;\n display: flex;\n flex-flow: row wrap;\n justify-content: flex-start;\n align-items: center;\n}\n\nic-button {\n cursor: pointer;\n}\n\nic-button.next-previous {\n --icon-width: var(--ic-space-xs);\n --icon-height: calc(var(--ic-space-xs) + var(--ic-space-xxxs));\n\n padding: 0 var(--ic-space-xxs) 0 var(--ic-space-xxxs);\n}\n\nic-button.first-last {\n --icon-width: calc(var(--ic-space-sm) + var(--ic-space-xxxs));\n --icon-height: calc(var(--ic-space-xs) + var(--ic-space-xxxs));\n}\n\nic-button.first-last::part(button),\nic-button.next-previous::part(button) {\n color: var(--ic-pagination-chevron);\n}\n\n:host(.ic-pagination-monochrome) ic-button.first-last::part(button),\n:host(.ic-pagination-monochrome) ic-button.next-previous::part(button) {\n color: var(--ic-pagination-chevron-monochrome);\n}\n\nic-button.ic-button-disabled.first-last::part(button),\nic-button.ic-button-disabled.next-previous::part(button),\n:host(.ic-pagination-monochrome)\n ic-button.ic-button-disabled.first-last::part(button),\n:host(.ic-pagination-monochrome)\n ic-button.ic-button-disabled.next-previous::part(button) {\n color: var(--ic-pagination-chevron-disabled);\n}\n\n.disabled {\n color: var(--ic-color-text-disabled-mid);\n pointer-events: none;\n cursor: none;\n user-select: none;\n}\n\n.hide-current-page {\n display: none;\n}\n\n.sr-only {\n position: absolute;\n left: -9999px;\n}\n\n.sr-only:dir(rtl) {\n right: -9999px;\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n Listen,\n State,\n Watch,\n Event,\n EventEmitter,\n Method,\n} from \"@stencil/core\";\nimport paginationNextPrevious from \"../../assets/pagination-next-previous.svg\";\nimport paginationFirstLast from \"../../assets/pagination-first-last.svg\";\nimport { IcThemeMode } from \"../../utils/types\";\nimport { IcPaginationTypes, IcChangeEventDetail } from \"./ic-pagination.types\";\nimport {\n onComponentRequiredPropUndefined,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\n\n@Component({\n tag: \"ic-pagination\",\n styleUrl: \"ic-pagination.css\",\n shadow: true,\n})\nexport class Pagination {\n @Element() el: HTMLIcPaginationElement;\n\n @State() endEllipsis: boolean = false;\n @State() endItems: number[] = [];\n @State() midItems: number[] = [];\n @State() startEllipsis: boolean = false;\n @State() startItems: number[] = [];\n\n /**\n * The accessible label of the pagination component to provide context for screen reader users.\n */\n @Prop() accessibleLabel?: string = \"Pagination Navigation\";\n\n /**\n * The number of pages displayed adjacent to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.\n */\n @Prop({ mutable: true }) adjacentPageCount?: number = 1;\n\n @Watch(\"adjacentPageCount\")\n watchAdjacentPageCountHandler(): void {\n if (this.adjacentPageCount! > 2) {\n this.adjacentPageCount = 2;\n }\n }\n\n /**\n * The number of pages displayed as boundary items to the current page when using 'complex' type pagination. Accepted values are 0, 1 & 2.\n */\n @Prop({ mutable: true }) boundaryPageCount?: number = 1;\n\n @Watch(\"boundaryPageCount\")\n watchBoundaryPageCountHandler(): void {\n if (this.boundaryPageCount! > 2) {\n this.boundaryPageCount = 2;\n }\n }\n\n /**\n * The default page to display.\n */\n @Prop() defaultPage?: number = 1;\n\n /**\n * If `true`, the pagination will not allow interaction.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the current page of the simple pagination will not be displayed.\n */\n @Prop() hideCurrentPage?: boolean = false;\n\n /**\n * If `true`, the first and last page buttons will not be displayed.\n */\n @Prop() hideFirstAndLastPageButton?: boolean = false;\n\n /**\n * The label for the pagination item (applicable when simple pagination is being used).\n */\n @Prop() label?: string = \"Page\";\n\n /**\n * If `true`, the pagination will display as black in the light theme, and white in dark theme.\n */\n @Prop() monochrome?: boolean = false;\n\n /**\n * The total number of pages.\n */\n @Prop() pages!: number;\n\n @Watch(\"pages\")\n watchNumberPagesHandler(): void {\n this.watchPageChangeHandler();\n }\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * The type of pagination to be used.\n */\n @Prop() type?: IcPaginationTypes = \"simple\";\n\n @Watch(\"type\")\n watchTypeHandler(): void {\n this.watchPageChangeHandler();\n }\n\n /**\n * The current page displayed by the pagination.\n */\n @Prop({ mutable: true }) currentPage?: number = this.defaultPage;\n\n @Watch(\"currentPage\")\n watchPageChangeHandler(): void {\n if (this.type === \"simple\") {\n return;\n }\n\n this.startEllipsis = false;\n this.endEllipsis = false;\n this.startItems = [];\n this.endItems = [];\n this.midItems = [];\n\n const startItems = [];\n let startItemCount = 0;\n const endItems = [];\n let endStart = this.pages;\n const midItems = [];\n let midStart;\n let midEnd;\n let startEllipsis = false;\n let endEllipsis = false;\n\n if (\n this.pages <=\n this.boundaryPageCount! * 2 + this.adjacentPageCount! * 2 + 3\n ) {\n this.startEllipsis = false;\n this.endEllipsis = false;\n for (let i = 1; i <= this.pages; i++) {\n startItems.push(i);\n }\n this.startItems = startItems;\n return;\n }\n\n startItemCount = this.boundaryPageCount === 0 ? 1 : this.boundaryPageCount!;\n endStart =\n this.boundaryPageCount === 0\n ? this.pages\n : this.pages - this.boundaryPageCount! + 1;\n\n if (\n this.currentPage! <=\n this.adjacentPageCount! + this.boundaryPageCount! + 2\n ) {\n startEllipsis = false;\n endEllipsis = true;\n\n let numItems = 2 * this.adjacentPageCount! + 1;\n if (this.boundaryPageCount === 0) {\n numItems--;\n }\n midStart = startItemCount + 1;\n midEnd = midStart + numItems;\n } else {\n startEllipsis = true;\n if (\n this.currentPage! >\n this.pages - (this.adjacentPageCount! + this.boundaryPageCount! + 2)\n ) {\n let numItems = 2 * this.adjacentPageCount! + 1;\n if (this.boundaryPageCount === 0) {\n numItems--;\n }\n midEnd =\n this.boundaryPageCount === 0\n ? this.pages - 1\n : this.pages - this.boundaryPageCount!;\n midStart = midEnd - numItems;\n } else {\n endEllipsis = true;\n midStart = this.currentPage! - this.adjacentPageCount!;\n midEnd = this.currentPage! + this.adjacentPageCount!;\n }\n }\n\n //create array of start items\n if (\n this.boundaryPageCount! > 0 ||\n (this.boundaryPageCount === 0 && startEllipsis === false)\n ) {\n for (let i = 1; i <= startItemCount; i++) {\n startItems.push(i);\n }\n }\n\n //create array of end items\n if (\n this.boundaryPageCount! > 0 ||\n (this.boundaryPageCount === 0 && endEllipsis === false)\n ) {\n for (let i = endStart; i <= this.pages; i++) {\n endItems.push(i);\n }\n }\n\n //create array of mid items\n for (let i = midStart; i <= midEnd; i++) {\n midItems.push(i);\n }\n\n this.startEllipsis = startEllipsis;\n this.endEllipsis = endEllipsis;\n this.startItems = startItems;\n this.endItems = endItems;\n this.midItems = midItems;\n }\n\n /**\n * Emitted when a page is selected.\n */\n @Event() icPageChange: EventEmitter<IcChangeEventDetail>;\n\n componentWillLoad(): void {\n this.watchPageChangeHandler();\n this.watchBoundaryPageCountHandler();\n this.watchAdjacentPageCountHandler();\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.pages, propName: \"pages\" }],\n \"Pagination\"\n );\n }\n\n /**\n * Prevents focus lingering on a disabled element. If the currently\n * focused element is one of the back buttons (and we reach the first page),\n * move focus to \"next\" button, and vice versa.\n * @param ev\n */\n @Listen(\"icPageChange\")\n icPageChangeHandler(ev: CustomEvent<IcChangeEventDetail>) {\n const shadow = document.activeElement?.shadowRoot;\n\n const activeEl = shadow ? shadow.activeElement : document.activeElement;\n if (!shadow || !activeEl) {\n return;\n }\n\n if (\n ev.detail.value === 1 &&\n [\"first-page-button\", \"previous-page-button\"].some(\n (id) => id === activeEl?.id\n )\n ) {\n const btn = (\n shadow.querySelector(\"#next-page-button\") as HTMLElement\n ).shadowRoot?.querySelector(\"button\");\n // When navigating from firstPage->lastPage or vice versa, the to-be-selected element will be disabled. wait a tick so that it can receive focus.\n setTimeout(() => btn?.focus(), 10);\n } else if (\n ev.detail.value === this.pages &&\n [\"last-page-button\", \"next-page-button\"].some((id) => id === activeEl?.id)\n ) {\n const btn = (\n shadow!.querySelector(\"#previous-page-button\") as HTMLElement\n ).shadowRoot?.querySelector(\"button\");\n setTimeout(() => btn?.focus(), 10);\n }\n }\n\n @Listen(\"paginationItemClick\")\n paginationItemClickHandler(ev: CustomEvent): void {\n const page = ev.detail.page;\n this.currentPage = page;\n this.icPageChange.emit({ value: this.currentPage! });\n }\n\n /**\n * Sets the currently displayed page.\n * @param {number} page The page number to set as the current page\n */\n @Method()\n async setCurrentPage(page: number): Promise<void> {\n if (typeof page === \"number\" && page > 0 && page <= this.pages) {\n this.currentPage = page;\n } else {\n console.error(\n \"Current page must be a number greater than zero but less than or equal to the total number of pages\"\n );\n }\n }\n\n private handleClickFirst = () => {\n this.currentPage = 1;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n private handleClickPrevious = (): void => {\n this.currentPage!--;\n this.icPageChange.emit({ value: this.currentPage! });\n };\n\n private handleClickNext = (): void => {\n this.currentPage!++;\n this.icPageChange.emit({ value: this.currentPage! });\n };\n\n private handleClickLast = (): void => {\n this.currentPage = this.pages;\n this.icPageChange.emit({ value: this.currentPage });\n };\n\n // button rendering abstracted from component render methods for clarity\n private firstButton = () => {\n return (\n <ic-button\n id=\"first-page-button\"\n aria-label=\"Go to first page\"\n theme={this.theme}\n onClick={this.handleClickFirst}\n class=\"page-button first-last\"\n disabled={this.currentPage === 1 || this.disabled}\n variant=\"icon-tertiary\"\n monochrome={this.theme == \"light\" || this.theme == \"dark\"}\n innerHTML={paginationFirstLast}\n />\n );\n };\n\n private previousButton = () => {\n return (\n <ic-button\n id=\"previous-page-button\"\n aria-label=\"Go to previous page\"\n theme={this.theme}\n onClick={this.handleClickPrevious}\n class=\"page-button next-previous flip\"\n disabled={this.currentPage === 1 || this.disabled}\n variant=\"icon-tertiary\"\n monochrome={this.theme == \"light\" || this.theme == \"dark\"}\n innerHTML={paginationNextPrevious}\n />\n );\n };\n\n private nextButton = () => {\n return (\n <ic-button\n id=\"next-page-button\"\n aria-label=\"Go to next page\"\n theme={this.theme}\n onClick={this.handleClickNext}\n class=\"page-button next-previous\"\n disabled={this.currentPage === this.pages || this.disabled}\n variant=\"icon-tertiary\"\n monochrome={this.theme == \"light\" || this.theme == \"dark\"}\n innerHTML={paginationNextPrevious}\n />\n );\n };\n\n private lastButton = () => {\n return (\n <ic-button\n id=\"last-page-button\"\n aria-label=\"Go to last page\"\n theme={this.theme}\n onClick={this.handleClickLast}\n class=\"page-button first-last flip\"\n disabled={this.currentPage === this.pages || this.disabled}\n variant=\"icon-tertiary\"\n monochrome={this.theme == \"light\" || this.theme == \"dark\"}\n innerHTML={paginationFirstLast}\n />\n );\n };\n\n private renderStartEllipsis = () => {\n return (\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n type=\"ellipsis\"\n id=\"start-ellipsis\"\n disabled={this.disabled}\n />\n );\n };\n\n private renderEndEllipsis = () => {\n return (\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n type=\"ellipsis\"\n id=\"end-ellipsis\"\n disabled={this.disabled}\n />\n );\n };\n\n private renderStartItems = () => {\n return this.startItems.map((page: number) => {\n return (\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n private renderEndItems = () => {\n return this.endItems.map((page: number) => {\n return (\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n private renderMiddleItems = () => {\n return this.midItems.map((page: number) => {\n return (\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n selected={page === this.currentPage}\n id={`pagination-item-${page}`}\n type=\"page\"\n page={page}\n disabled={this.disabled}\n />\n );\n });\n };\n\n render() {\n const {\n type,\n currentPage,\n hideCurrentPage,\n disabled,\n hideFirstAndLastPageButton,\n label,\n theme,\n monochrome,\n } = this;\n\n return (\n <Host\n class={{\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n [\"ic-pagination-monochrome\"]: !!monochrome,\n }}\n >\n {type === \"simple\" && (\n <nav\n class={{\n [\"disabled\"]: !!disabled,\n }}\n role=\"navigation\"\n aria-label={this.accessibleLabel}\n >\n {hideFirstAndLastPageButton ? null : this.firstButton()}\n {this.previousButton()}\n <ic-pagination-item\n theme={this.theme}\n monochrome={this.monochrome}\n type=\"simple-current\"\n page={currentPage}\n label={label}\n class={{ [\"hide-current-page\"]: !!hideCurrentPage }}\n disabled={disabled}\n />\n {this.nextButton()}\n {hideFirstAndLastPageButton ? null : this.lastButton()}\n </nav>\n )}\n {type === \"complex\" && (\n <nav\n class={{\n [\"disabled\"]: !!disabled,\n }}\n role=\"navigation\"\n aria-label={this.accessibleLabel}\n >\n {hideFirstAndLastPageButton ? null : this.firstButton()}\n {this.previousButton()}\n {this.renderStartItems()}\n {this.startEllipsis && this.renderStartEllipsis()}\n {this.renderMiddleItems()}\n {this.endEllipsis && this.renderEndEllipsis()}\n {this.renderEndItems()}\n {this.nextButton()}\n {hideFirstAndLastPageButton ? null : this.lastButton()}\n </nav>\n )}\n {type === \"complex\" && (\n <span class=\"sr-only\" aria-live=\"polite\">\n Page {this.currentPage}\n </span>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|