@ukic/canary-web-components 3.0.0-canary.14 → 3.0.0-canary.16
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/README.md +1 -1
- package/dist/cjs/core.cjs.js +2 -2
- package/dist/cjs/{date-helpers-c9551119.js → date-helpers-6f70dd03.js} +20 -66
- package/dist/cjs/date-helpers-6f70dd03.js.map +1 -0
- package/dist/cjs/{helpers-fc51fdcb.js → helpers-199b92d5.js} +42 -2
- package/dist/cjs/helpers-199b92d5.js.map +1 -0
- package/dist/cjs/{helpers-32016c21.js → helpers-d01564f7.js} +15 -15
- package/dist/cjs/helpers-d01564f7.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-accordion.cjs.entry.js +2 -2
- package/dist/cjs/ic-alert.cjs.entry.js +2 -2
- package/dist/cjs/ic-back-to-top.cjs.entry.js +2 -2
- package/dist/cjs/ic-badge.cjs.entry.js +3 -3
- package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/ic-button_3.cjs.entry.js +3 -3
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-horizontal.cjs.entry.js +16 -12
- package/dist/cjs/ic-card-horizontal.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-vertical.cjs.entry.js +3 -3
- package/dist/cjs/ic-card-vertical.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +7 -7
- package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/{ic-empty-state_2.cjs.entry.js → ic-checkbox_3.cjs.entry.js} +158 -24
- package/dist/cjs/ic-checkbox_3.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-chip.cjs.entry.js +3 -3
- package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js +3 -3
- package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-list.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +2 -2
- package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +7 -7
- package/dist/cjs/ic-data-table-title-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-table.cjs.entry.js +310 -276
- package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-input.cjs.entry.js +130 -148
- package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-picker.cjs.entry.js +87 -70
- package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +38 -47
- package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer.cjs.entry.js +2 -2
- package/dist/cjs/ic-hero.cjs.entry.js +2 -2
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +2 -2
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +3 -3
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +2 -2
- package/dist/cjs/ic-link.cjs.entry.js +2 -2
- package/dist/cjs/ic-menu-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-button.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-group.cjs.entry.js +25 -22
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +7 -7
- package/dist/cjs/ic-navigation-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +12 -11
- package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination_4.cjs.entry.js +52 -29
- package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +6 -6
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +7 -7
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +2 -2
- package/dist/cjs/ic-search-bar.cjs.entry.js +3 -3
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js +3 -3
- package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +7 -7
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js +3 -3
- package/dist/cjs/ic-skeleton.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-skip-link.cjs.entry.js +3 -3
- package/dist/cjs/ic-skip-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-status-tag.cjs.entry.js +5 -5
- package/dist/cjs/ic-status-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +16 -16
- package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +4 -4
- package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +6 -6
- package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js +2 -2
- package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +4 -4
- package/dist/cjs/ic-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/ic-tab-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab.cjs.entry.js +3 -3
- package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +3 -3
- package/dist/cjs/ic-theme.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast-region.cjs.entry.js +2 -2
- package/dist/cjs/ic-toast-region.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +6 -6
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +4 -4
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js +5 -5
- package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +5 -9
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tree-item.cjs.entry.js +35 -42
- package/dist/cjs/ic-tree-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tree-view.cjs.entry.js +25 -21
- package/dist/cjs/ic-tree-view.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +2 -2
- package/dist/cjs/{index-8a24b20c.js → index-d337cd8a.js} +6 -11
- package/dist/cjs/index-d337cd8a.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.css +1 -1
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js +27 -23
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js.map +1 -1
- package/dist/collection/components/ic-data-table/ic-data-table.css +16 -0
- package/dist/collection/components/ic-data-table/ic-data-table.js +385 -330
- package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
- package/dist/collection/components/ic-data-table/ic-data-table.stories.js +8 -9
- package/dist/collection/components/ic-data-table/ic-data-table.stories.js.map +1 -1
- package/dist/collection/components/ic-data-table/story-data.js +13 -14
- package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
- package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js +9 -9
- package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js.map +1 -1
- package/dist/collection/components/ic-date-input/ic-date-input.js +166 -183
- package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -1
- package/dist/collection/components/ic-date-input/ic-date-input.stories.js +1 -1
- package/dist/collection/components/ic-date-input/ic-date-input.stories.js.map +1 -1
- package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js +6 -3
- package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js.map +1 -1
- package/dist/collection/components/ic-date-picker/ic-date-picker.js +109 -92
- package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -1
- package/dist/collection/components/ic-date-picker/ic-day-button.js +1 -1
- package/dist/collection/components/ic-date-picker/ic-day-button.js.map +1 -1
- package/dist/collection/components/ic-date-picker/ic-month-picker.js.map +1 -1
- package/dist/collection/components/ic-date-picker/ic-year-picker.js.map +1 -1
- package/dist/collection/components/ic-date-picker/story-data.js.map +1 -1
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +41 -38
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -1
- package/dist/collection/components/ic-tree-item/ic-tree-item.js +45 -52
- package/dist/collection/components/ic-tree-item/ic-tree-item.js.map +1 -1
- package/dist/collection/components/ic-tree-view/ic-tree-view.js +29 -25
- package/dist/collection/components/ic-tree-view/ic-tree-view.js.map +1 -1
- package/dist/collection/utils/date-helpers.js +19 -61
- package/dist/collection/utils/date-helpers.js.map +1 -1
- package/dist/collection/utils/helpers.js +44 -61
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/testa11y.helpers.js +2 -1
- package/dist/collection/utils/testa11y.helpers.js.map +1 -1
- package/dist/components/helpers.js +40 -1
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/helpers2.js +13 -13
- package/dist/components/helpers2.js.map +1 -1
- package/dist/components/ic-badge.js +1 -1
- package/dist/components/ic-badge.js.map +1 -1
- package/dist/components/ic-button2.js +1 -1
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-card-horizontal.js +14 -10
- package/dist/components/ic-card-horizontal.js.map +1 -1
- package/dist/components/ic-card-vertical.js +1 -1
- package/dist/components/ic-card-vertical.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +5 -5
- package/dist/components/ic-checkbox-group.js.map +1 -1
- package/dist/components/ic-checkbox.js +1 -175
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/{esm/ic-checkbox.entry.js → components/ic-checkbox2.js} +53 -11
- package/dist/components/ic-checkbox2.js.map +1 -0
- package/dist/components/ic-chip.js +1 -1
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-classification-banner.js +2 -2
- package/dist/components/ic-classification-banner.js.map +1 -1
- package/dist/components/ic-data-table-title-bar.js +5 -5
- package/dist/components/ic-data-table-title-bar.js.map +1 -1
- package/dist/components/ic-data-table.js +319 -279
- package/dist/components/ic-data-table.js.map +1 -1
- package/dist/components/ic-date-input2.js +146 -210
- package/dist/components/ic-date-input2.js.map +1 -1
- package/dist/components/ic-date-picker.js +84 -67
- package/dist/components/ic-date-picker.js.map +1 -1
- package/dist/components/ic-dialog.js +38 -47
- package/dist/components/ic-dialog.js.map +1 -1
- package/dist/components/ic-footer.js +1 -1
- package/dist/components/ic-horizontal-scroll2.js +1 -1
- package/dist/components/ic-input-component-container2.js +1 -1
- package/dist/components/ic-input-component-container2.js.map +1 -1
- package/dist/components/ic-navigation-group.js +25 -21
- package/dist/components/ic-navigation-group.js.map +1 -1
- package/dist/components/ic-navigation-item.js +1 -1
- package/dist/components/ic-navigation-menu2.js +6 -6
- package/dist/components/ic-navigation-menu2.js.map +1 -1
- package/dist/components/ic-page-header.js +10 -9
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-pagination-bar2.js +22 -20
- package/dist/components/ic-pagination-bar2.js.map +1 -1
- package/dist/components/ic-pagination-item2.js +2 -2
- package/dist/components/ic-pagination-item2.js.map +1 -1
- package/dist/components/ic-pagination2.js +5 -5
- package/dist/components/ic-pagination2.js.map +1 -1
- 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 +5 -5
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-search-bar.js +2 -2
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-section-container2.js +2 -2
- package/dist/components/ic-section-container2.js.map +1 -1
- package/dist/components/ic-select2.js +6 -6
- package/dist/components/ic-select2.js.map +1 -1
- package/dist/components/ic-side-navigation.js +6 -6
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-skeleton.js +2 -2
- package/dist/components/ic-skeleton.js.map +1 -1
- package/dist/components/ic-skip-link.js +2 -2
- package/dist/components/ic-skip-link.js.map +1 -1
- package/dist/components/ic-status-tag.js +3 -3
- package/dist/components/ic-status-tag.js.map +1 -1
- package/dist/components/ic-step.js +14 -14
- package/dist/components/ic-step.js.map +1 -1
- package/dist/components/ic-stepper.js +3 -3
- 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 -1
- package/dist/components/ic-tab-context.js.map +1 -1
- package/dist/components/ic-tab-group.js +2 -2
- package/dist/components/ic-tab-group.js.map +1 -1
- package/dist/components/ic-tab-panel.js +2 -2
- package/dist/components/ic-tab-panel.js.map +1 -1
- package/dist/components/ic-tab.js +1 -1
- package/dist/components/ic-tab.js.map +1 -1
- package/dist/components/ic-text-field2.js +42 -15
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-theme.js +2 -2
- package/dist/components/ic-theme.js.map +1 -1
- package/dist/components/ic-toast-region.js +1 -1
- package/dist/components/ic-toast-region.js.map +1 -1
- package/dist/components/ic-toast.js +5 -5
- 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-group.js.map +1 -1
- package/dist/components/ic-toggle-button.js +4 -4
- package/dist/components/ic-toggle-button.js.map +1 -1
- package/dist/components/ic-top-navigation.js +4 -8
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/components/ic-tree-item.js +33 -40
- package/dist/components/ic-tree-item.js.map +1 -1
- package/dist/components/ic-tree-view.js +23 -19
- package/dist/components/ic-tree-view.js.map +1 -1
- package/dist/core/core.css +358 -250
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-f2f7299b.entry.js → p-071f4748.entry.js} +2 -2
- package/dist/core/{p-f2f7299b.entry.js.map → p-071f4748.entry.js.map} +1 -1
- package/dist/core/p-09e8b002.entry.js +2 -0
- package/dist/core/p-09e8b002.entry.js.map +1 -0
- package/dist/core/{p-b18a5861.entry.js → p-110486f0.entry.js} +2 -2
- package/dist/core/{p-b18a5861.entry.js.map → p-110486f0.entry.js.map} +1 -1
- package/dist/core/{p-a30d165d.entry.js → p-123bd8ce.entry.js} +2 -2
- package/dist/core/p-123bd8ce.entry.js.map +1 -0
- package/dist/core/{p-1334a78f.entry.js → p-12d4803e.entry.js} +2 -2
- package/dist/core/{p-8d73a3cc.entry.js → p-19c4cc6c.entry.js} +2 -2
- package/dist/core/p-19c4cc6c.entry.js.map +1 -0
- package/dist/core/p-19ecd2a6.entry.js +2 -0
- package/dist/core/p-19ecd2a6.entry.js.map +1 -0
- package/dist/core/{p-d154b26c.entry.js → p-1b31a720.entry.js} +2 -2
- package/dist/core/{p-a4582939.entry.js → p-1bfead5b.entry.js} +2 -2
- package/dist/core/p-1bfead5b.entry.js.map +1 -0
- package/dist/core/{p-08fd225f.entry.js → p-214a48c6.entry.js} +2 -2
- package/dist/core/p-236dc1a6.entry.js +2 -0
- package/dist/core/p-236dc1a6.entry.js.map +1 -0
- package/dist/core/{p-0848efa2.entry.js → p-2c7e9e71.entry.js} +2 -2
- package/dist/core/{p-ef25bb6d.entry.js → p-2d9c36a6.entry.js} +2 -2
- package/dist/core/{p-ef25bb6d.entry.js.map → p-2d9c36a6.entry.js.map} +1 -1
- package/dist/core/{p-b8aa37f9.entry.js → p-336be00c.entry.js} +2 -2
- package/dist/core/{p-5dc25d11.entry.js → p-37df68fe.entry.js} +2 -2
- package/dist/core/{p-5dc25d11.entry.js.map → p-37df68fe.entry.js.map} +1 -1
- package/dist/core/{p-272352cb.entry.js → p-38f612b0.entry.js} +2 -2
- package/dist/core/p-3cf6ca89.entry.js +2 -0
- package/dist/core/p-3cf6ca89.entry.js.map +1 -0
- package/dist/core/{p-4da17eda.entry.js → p-3ee70c45.entry.js} +2 -2
- package/dist/core/{p-762a4d7c.entry.js → p-46f64dc5.entry.js} +2 -2
- package/dist/core/p-48465394.entry.js +2 -0
- package/dist/core/{p-4e5934f3.entry.js.map → p-48465394.entry.js.map} +1 -1
- package/dist/core/{p-cd9e1ffa.entry.js → p-50f4d151.entry.js} +2 -2
- package/dist/core/{p-cd9e1ffa.entry.js.map → p-50f4d151.entry.js.map} +1 -1
- package/dist/core/p-520dce89.entry.js +2 -0
- package/dist/core/p-520dce89.entry.js.map +1 -0
- package/dist/core/{p-22e0ed96.entry.js → p-5bd43e19.entry.js} +2 -2
- package/dist/core/{p-da798f58.entry.js → p-5ec11974.entry.js} +2 -2
- package/dist/core/p-643a94c2.entry.js +2 -0
- package/dist/core/p-643a94c2.entry.js.map +1 -0
- package/dist/core/{p-be5ad372.entry.js → p-65ddc948.entry.js} +2 -2
- package/dist/core/p-69f6db9f.entry.js +2 -0
- package/dist/core/p-69f6db9f.entry.js.map +1 -0
- package/dist/core/p-6cfd6b56.entry.js +2 -0
- package/dist/core/{p-144b1dee.entry.js.map → p-6cfd6b56.entry.js.map} +1 -1
- package/dist/core/{p-507ec499.entry.js → p-701696aa.entry.js} +2 -2
- package/dist/core/{p-507ec499.entry.js.map → p-701696aa.entry.js.map} +1 -1
- package/dist/core/p-7b13ccd0.entry.js +2 -0
- package/dist/core/p-7b13ccd0.entry.js.map +1 -0
- package/dist/core/p-7d054704.js +2 -0
- package/dist/core/p-7d054704.js.map +1 -0
- package/dist/core/{p-e13b43b1.entry.js → p-8402fcf7.entry.js} +2 -2
- package/dist/core/p-858dd362.entry.js +2 -0
- package/dist/core/p-858dd362.entry.js.map +1 -0
- package/dist/core/p-87c92ab1.entry.js +2 -0
- package/dist/core/p-87c92ab1.entry.js.map +1 -0
- package/dist/core/{p-0e3cb8d0.entry.js → p-8856dff4.entry.js} +2 -2
- package/dist/core/{p-00135a74.js → p-8e4e97b4.js} +3 -3
- package/dist/core/p-8e4e97b4.js.map +1 -0
- package/dist/core/{p-32720276.entry.js → p-91b8ee39.entry.js} +2 -2
- package/dist/core/{p-fd42f129.entry.js → p-91d5efc0.entry.js} +2 -2
- package/dist/core/p-91d5efc0.entry.js.map +1 -0
- package/dist/core/p-944ea274.entry.js +2 -0
- package/dist/core/p-944ea274.entry.js.map +1 -0
- package/dist/core/p-951669ca.entry.js +2 -0
- package/dist/core/p-951669ca.entry.js.map +1 -0
- package/dist/core/{p-b6db0cc1.entry.js → p-9bf0ce9e.entry.js} +2 -2
- package/dist/core/{p-afc4ce53.entry.js → p-9e5e6070.entry.js} +2 -2
- package/dist/core/{p-a214a9f8.entry.js → p-a12dd148.entry.js} +2 -2
- package/dist/core/{p-a214a9f8.entry.js.map → p-a12dd148.entry.js.map} +1 -1
- package/dist/core/p-a2fcea60.entry.js +2 -0
- package/dist/core/p-a2fcea60.entry.js.map +1 -0
- package/dist/core/{p-60a0c711.entry.js → p-a6031c41.entry.js} +2 -2
- package/dist/core/{p-60a0c711.entry.js.map → p-a6031c41.entry.js.map} +1 -1
- package/dist/core/{p-3d1ba098.entry.js → p-b006976c.entry.js} +2 -2
- package/dist/core/p-b17f6b1d.entry.js +2 -0
- package/dist/core/p-b17f6b1d.entry.js.map +1 -0
- package/dist/core/{p-0c3bd9e6.entry.js → p-b334a20d.entry.js} +2 -2
- package/dist/core/p-b603b9ef.entry.js +2 -0
- package/dist/core/p-b603b9ef.entry.js.map +1 -0
- package/dist/core/{p-3e9564b5.entry.js → p-b88ae211.entry.js} +2 -2
- package/dist/core/{p-5d85bd73.entry.js → p-b953b22f.entry.js} +2 -2
- package/dist/core/{p-5d85bd73.entry.js.map → p-b953b22f.entry.js.map} +1 -1
- package/dist/core/p-b9e73154.js +2 -0
- package/dist/core/p-b9e73154.js.map +1 -0
- package/dist/core/p-bb9142fe.entry.js +2 -0
- package/dist/core/{p-a13dc5ba.entry.js.map → p-bb9142fe.entry.js.map} +1 -1
- package/dist/core/{p-48163a2a.entry.js → p-c1dbb35b.entry.js} +2 -2
- package/dist/core/{p-48163a2a.entry.js.map → p-c1dbb35b.entry.js.map} +1 -1
- package/dist/core/{p-0fd762bf.entry.js → p-c1f653d4.entry.js} +2 -2
- package/dist/core/p-c1f653d4.entry.js.map +1 -0
- package/dist/core/{p-96551ddf.entry.js → p-c3f26b24.entry.js} +2 -2
- package/dist/core/p-c86ca475.js +2 -0
- package/dist/core/p-c86ca475.js.map +1 -0
- package/dist/core/{p-fd006a9b.entry.js → p-ca5d3a21.entry.js} +2 -2
- package/dist/core/{p-f541034c.entry.js → p-cd0dbcea.entry.js} +2 -2
- package/dist/core/p-cda2a461.entry.js +2 -0
- package/dist/core/p-cda2a461.entry.js.map +1 -0
- package/dist/core/p-ed416362.entry.js +2 -0
- package/dist/core/p-ed416362.entry.js.map +1 -0
- package/dist/core/{p-b17e7059.entry.js → p-f2beca5c.entry.js} +2 -2
- package/dist/core/{p-b17e7059.entry.js.map → p-f2beca5c.entry.js.map} +1 -1
- package/dist/core/p-f3bb5006.entry.js +2 -0
- package/dist/core/p-f3bb5006.entry.js.map +1 -0
- package/dist/core/{p-895a3eb1.entry.js → p-f5e9c8c8.entry.js} +2 -2
- package/dist/core/p-f5e9c8c8.entry.js.map +1 -0
- package/dist/core/{p-0e119312.entry.js → p-fa02a267.entry.js} +2 -2
- package/dist/core/{p-0e119312.entry.js.map → p-fa02a267.entry.js.map} +1 -1
- package/dist/core/{p-9f4fa820.entry.js → p-fa18f9c6.entry.js} +2 -2
- package/dist/core/{p-9f4fa820.entry.js.map → p-fa18f9c6.entry.js.map} +1 -1
- package/dist/core/p-fb01a001.entry.js +2 -0
- package/dist/core/p-fb01a001.entry.js.map +1 -0
- package/dist/esm/core.js +3 -3
- package/dist/esm/{date-helpers-0e5e32a7.js → date-helpers-3b8c39ab.js} +20 -66
- package/dist/esm/date-helpers-3b8c39ab.js.map +1 -0
- package/dist/esm/{helpers-bbab69a2.js → helpers-9fe45194.js} +42 -3
- package/dist/esm/helpers-9fe45194.js.map +1 -0
- package/dist/esm/{helpers-5479985d.js → helpers-ddc2008a.js} +16 -16
- package/dist/esm/helpers-ddc2008a.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +2 -2
- package/dist/esm/ic-accordion.entry.js +2 -2
- package/dist/esm/ic-alert.entry.js +2 -2
- package/dist/esm/ic-back-to-top.entry.js +2 -2
- package/dist/esm/ic-badge.entry.js +3 -3
- package/dist/esm/ic-badge.entry.js.map +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +2 -2
- package/dist/esm/ic-breadcrumb.entry.js +2 -2
- package/dist/esm/ic-button_3.entry.js +3 -3
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card-horizontal.entry.js +16 -12
- package/dist/esm/ic-card-horizontal.entry.js.map +1 -1
- package/dist/esm/ic-card-vertical.entry.js +3 -3
- package/dist/esm/ic-card-vertical.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +7 -7
- package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
- package/dist/esm/{ic-empty-state_2.entry.js → ic-checkbox_3.entry.js} +158 -25
- package/dist/esm/ic-checkbox_3.entry.js.map +1 -0
- package/dist/esm/ic-chip.entry.js +3 -3
- package/dist/esm/ic-chip.entry.js.map +1 -1
- package/dist/esm/ic-classification-banner.entry.js +3 -3
- package/dist/esm/ic-classification-banner.entry.js.map +1 -1
- package/dist/esm/ic-data-list.entry.js +1 -1
- package/dist/esm/ic-data-row.entry.js +2 -2
- package/dist/esm/ic-data-table-title-bar.entry.js +7 -7
- package/dist/esm/ic-data-table-title-bar.entry.js.map +1 -1
- package/dist/esm/ic-data-table.entry.js +310 -276
- package/dist/esm/ic-data-table.entry.js.map +1 -1
- package/dist/esm/ic-date-input.entry.js +130 -148
- package/dist/esm/ic-date-input.entry.js.map +1 -1
- package/dist/esm/ic-date-picker.entry.js +87 -70
- package/dist/esm/ic-date-picker.entry.js.map +1 -1
- package/dist/esm/ic-dialog.entry.js +38 -47
- package/dist/esm/ic-dialog.entry.js.map +1 -1
- package/dist/esm/ic-divider.entry.js +2 -2
- package/dist/esm/ic-footer-link-group.entry.js +2 -2
- package/dist/esm/ic-footer-link.entry.js +2 -2
- package/dist/esm/ic-footer.entry.js +2 -2
- package/dist/esm/ic-hero.entry.js +2 -2
- package/dist/esm/ic-horizontal-scroll.entry.js +2 -2
- package/dist/esm/ic-input-component-container_3.entry.js +3 -3
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js +2 -2
- package/dist/esm/ic-link.entry.js +2 -2
- package/dist/esm/ic-menu-group.entry.js +2 -2
- package/dist/esm/ic-menu-item.entry.js +2 -2
- package/dist/esm/ic-navigation-button.entry.js +2 -2
- package/dist/esm/ic-navigation-group.entry.js +25 -22
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +2 -2
- package/dist/esm/ic-navigation-menu.entry.js +7 -7
- package/dist/esm/ic-navigation-menu.entry.js.map +1 -1
- package/dist/esm/ic-page-header.entry.js +12 -11
- package/dist/esm/ic-page-header.entry.js.map +1 -1
- package/dist/esm/ic-pagination_4.entry.js +52 -29
- package/dist/esm/ic-pagination_4.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +6 -6
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-radio-group.entry.js +7 -7
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +2 -2
- package/dist/esm/ic-search-bar.entry.js +3 -3
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js +3 -3
- package/dist/esm/ic-section-container.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js +7 -7
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-skeleton.entry.js +3 -3
- package/dist/esm/ic-skeleton.entry.js.map +1 -1
- package/dist/esm/ic-skip-link.entry.js +3 -3
- package/dist/esm/ic-skip-link.entry.js.map +1 -1
- package/dist/esm/ic-status-tag.entry.js +5 -5
- package/dist/esm/ic-status-tag.entry.js.map +1 -1
- package/dist/esm/ic-step.entry.js +16 -16
- package/dist/esm/ic-step.entry.js.map +1 -1
- package/dist/esm/ic-stepper.entry.js +4 -4
- package/dist/esm/ic-stepper.entry.js.map +1 -1
- package/dist/esm/ic-switch.entry.js +6 -6
- package/dist/esm/ic-switch.entry.js.map +1 -1
- package/dist/esm/ic-tab-context.entry.js +2 -2
- package/dist/esm/ic-tab-context.entry.js.map +1 -1
- package/dist/esm/ic-tab-group.entry.js +4 -4
- package/dist/esm/ic-tab-group.entry.js.map +1 -1
- package/dist/esm/ic-tab-panel.entry.js +3 -3
- package/dist/esm/ic-tab-panel.entry.js.map +1 -1
- package/dist/esm/ic-tab.entry.js +3 -3
- package/dist/esm/ic-tab.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +3 -3
- package/dist/esm/ic-theme.entry.js.map +1 -1
- package/dist/esm/ic-toast-region.entry.js +2 -2
- package/dist/esm/ic-toast-region.entry.js.map +1 -1
- package/dist/esm/ic-toast.entry.js +6 -6
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js +4 -4
- package/dist/esm/ic-toggle-button-group.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button.entry.js +5 -5
- package/dist/esm/ic-toggle-button.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +5 -9
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/ic-tree-item.entry.js +35 -42
- package/dist/esm/ic-tree-item.entry.js.map +1 -1
- package/dist/esm/ic-tree-view.entry.js +25 -21
- package/dist/esm/ic-tree-view.entry.js.map +1 -1
- package/dist/esm/ic-typography.entry.js +2 -2
- package/dist/esm/{index-163fe708.js → index-a7a720e7.js} +6 -11
- package/dist/esm/index-a7a720e7.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/ic-card-horizontal/ic-card-horizontal.d.ts +3 -3
- package/dist/types/components/ic-data-table/ic-data-table.d.ts +30 -20
- package/dist/types/components/ic-data-table/ic-data-table.stories.d.ts +3 -9
- package/dist/types/components/ic-data-table/story-data.d.ts +15 -4
- package/dist/types/components/ic-date-input/ic-date-input.d.ts +34 -28
- package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +14 -12
- package/dist/types/components/ic-date-picker/ic-day-button.d.ts +2 -2
- package/dist/types/components/ic-date-picker/ic-month-picker.d.ts +3 -3
- package/dist/types/components/ic-date-picker/ic-year-picker.d.ts +3 -3
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.d.ts +2 -2
- package/dist/types/components/ic-tree-item/ic-tree-item.d.ts +3 -3
- package/dist/types/components/ic-tree-view/ic-tree-view.d.ts +4 -4
- package/dist/types/components.d.ts +95 -72
- package/dist/types/utils/date-helpers.d.ts +4 -4
- package/dist/types/utils/helpers.d.ts +6 -15
- package/hydrate/index.js +898 -851
- package/hydrate/index.mjs +898 -851
- package/package.json +3 -3
- package/dist/cjs/date-helpers-c9551119.js.map +0 -1
- package/dist/cjs/helpers-32016c21.js.map +0 -1
- package/dist/cjs/helpers-fc51fdcb.js.map +0 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +0 -141
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +0 -1
- package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +0 -1
- package/dist/cjs/index-8a24b20c.js.map +0 -1
- package/dist/core/p-00135a74.js.map +0 -1
- package/dist/core/p-0ad472d0.entry.js +0 -2
- package/dist/core/p-0ad472d0.entry.js.map +0 -1
- package/dist/core/p-0c97a53d.entry.js +0 -2
- package/dist/core/p-0c97a53d.entry.js.map +0 -1
- package/dist/core/p-0efeab8a.entry.js +0 -2
- package/dist/core/p-0efeab8a.entry.js.map +0 -1
- package/dist/core/p-0f6b9686.js +0 -2
- package/dist/core/p-0f6b9686.js.map +0 -1
- package/dist/core/p-0fd762bf.entry.js.map +0 -1
- package/dist/core/p-144b1dee.entry.js +0 -2
- package/dist/core/p-1cf61bf2.entry.js +0 -2
- package/dist/core/p-1cf61bf2.entry.js.map +0 -1
- package/dist/core/p-250bf568.entry.js +0 -2
- package/dist/core/p-250bf568.entry.js.map +0 -1
- package/dist/core/p-33dd24eb.js +0 -2
- package/dist/core/p-33dd24eb.js.map +0 -1
- package/dist/core/p-4e5934f3.entry.js +0 -2
- package/dist/core/p-4f00aa91.entry.js +0 -2
- package/dist/core/p-4f00aa91.entry.js.map +0 -1
- package/dist/core/p-54e01fad.entry.js +0 -2
- package/dist/core/p-54e01fad.entry.js.map +0 -1
- package/dist/core/p-6040a025.entry.js +0 -2
- package/dist/core/p-6040a025.entry.js.map +0 -1
- package/dist/core/p-62f7f2bd.entry.js +0 -2
- package/dist/core/p-62f7f2bd.entry.js.map +0 -1
- package/dist/core/p-6eaf585a.entry.js +0 -2
- package/dist/core/p-6eaf585a.entry.js.map +0 -1
- package/dist/core/p-72310da8.js +0 -2
- package/dist/core/p-72310da8.js.map +0 -1
- package/dist/core/p-836d302a.entry.js +0 -2
- package/dist/core/p-836d302a.entry.js.map +0 -1
- package/dist/core/p-881bb783.entry.js +0 -2
- package/dist/core/p-881bb783.entry.js.map +0 -1
- package/dist/core/p-895a3eb1.entry.js.map +0 -1
- package/dist/core/p-8d73a3cc.entry.js.map +0 -1
- package/dist/core/p-9a46b1e5.entry.js +0 -2
- package/dist/core/p-9a46b1e5.entry.js.map +0 -1
- package/dist/core/p-a13dc5ba.entry.js +0 -2
- package/dist/core/p-a30d165d.entry.js.map +0 -1
- package/dist/core/p-a4582939.entry.js.map +0 -1
- package/dist/core/p-a7f95a61.entry.js +0 -2
- package/dist/core/p-a7f95a61.entry.js.map +0 -1
- package/dist/core/p-a81c9048.entry.js +0 -2
- package/dist/core/p-a81c9048.entry.js.map +0 -1
- package/dist/core/p-c0687222.entry.js +0 -2
- package/dist/core/p-c0687222.entry.js.map +0 -1
- package/dist/core/p-c2aef5cc.entry.js +0 -2
- package/dist/core/p-c2aef5cc.entry.js.map +0 -1
- package/dist/core/p-c4f7e479.entry.js +0 -2
- package/dist/core/p-c4f7e479.entry.js.map +0 -1
- package/dist/core/p-fb11ce9b.entry.js +0 -2
- package/dist/core/p-fb11ce9b.entry.js.map +0 -1
- package/dist/core/p-fba58c42.entry.js +0 -2
- package/dist/core/p-fba58c42.entry.js.map +0 -1
- package/dist/core/p-fd42f129.entry.js.map +0 -1
- package/dist/esm/date-helpers-0e5e32a7.js.map +0 -1
- package/dist/esm/helpers-5479985d.js.map +0 -1
- package/dist/esm/helpers-bbab69a2.js.map +0 -1
- package/dist/esm/ic-checkbox.entry.js.map +0 -1
- package/dist/esm/ic-empty-state_2.entry.js.map +0 -1
- package/dist/esm/index-163fe708.js.map +0 -1
- /package/dist/core/{p-1334a78f.entry.js.map → p-12d4803e.entry.js.map} +0 -0
- /package/dist/core/{p-d154b26c.entry.js.map → p-1b31a720.entry.js.map} +0 -0
- /package/dist/core/{p-08fd225f.entry.js.map → p-214a48c6.entry.js.map} +0 -0
- /package/dist/core/{p-0848efa2.entry.js.map → p-2c7e9e71.entry.js.map} +0 -0
- /package/dist/core/{p-b8aa37f9.entry.js.map → p-336be00c.entry.js.map} +0 -0
- /package/dist/core/{p-272352cb.entry.js.map → p-38f612b0.entry.js.map} +0 -0
- /package/dist/core/{p-4da17eda.entry.js.map → p-3ee70c45.entry.js.map} +0 -0
- /package/dist/core/{p-762a4d7c.entry.js.map → p-46f64dc5.entry.js.map} +0 -0
- /package/dist/core/{p-22e0ed96.entry.js.map → p-5bd43e19.entry.js.map} +0 -0
- /package/dist/core/{p-da798f58.entry.js.map → p-5ec11974.entry.js.map} +0 -0
- /package/dist/core/{p-be5ad372.entry.js.map → p-65ddc948.entry.js.map} +0 -0
- /package/dist/core/{p-e13b43b1.entry.js.map → p-8402fcf7.entry.js.map} +0 -0
- /package/dist/core/{p-0e3cb8d0.entry.js.map → p-8856dff4.entry.js.map} +0 -0
- /package/dist/core/{p-32720276.entry.js.map → p-91b8ee39.entry.js.map} +0 -0
- /package/dist/core/{p-b6db0cc1.entry.js.map → p-9bf0ce9e.entry.js.map} +0 -0
- /package/dist/core/{p-afc4ce53.entry.js.map → p-9e5e6070.entry.js.map} +0 -0
- /package/dist/core/{p-3d1ba098.entry.js.map → p-b006976c.entry.js.map} +0 -0
- /package/dist/core/{p-0c3bd9e6.entry.js.map → p-b334a20d.entry.js.map} +0 -0
- /package/dist/core/{p-3e9564b5.entry.js.map → p-b88ae211.entry.js.map} +0 -0
- /package/dist/core/{p-96551ddf.entry.js.map → p-c3f26b24.entry.js.map} +0 -0
- /package/dist/core/{p-fd006a9b.entry.js.map → p-ca5d3a21.entry.js.map} +0 -0
- /package/dist/core/{p-f541034c.entry.js.map → p-cd0dbcea.entry.js.map} +0 -0
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
6
|
-
const helpers = require('./helpers-
|
5
|
+
const index = require('./index-d337cd8a.js');
|
6
|
+
const helpers = require('./helpers-d01564f7.js');
|
7
7
|
|
8
8
|
const unsortedIcon = `<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24">
|
9
9
|
<path d="M9 3 5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z"></path>
|
@@ -17,13 +17,14 @@ const descendingIcon = `<svg focusable="false" aria-hidden="true" viewBox="0 0 2
|
|
17
17
|
<path d="M16.01 11H4v2h12.01v3L20 12l-3.99-4z"></path>
|
18
18
|
</svg>`;
|
19
19
|
|
20
|
-
const icDataTableCss = ":host{position:relative;display:inline-flex;max-height:100%;width:var(--table-width, 100%);height:100%;min-width:var(--table-min-width);max-width:var(--table-max-width)}tbody{vertical-align:top}.table-container{position:relative;height:calc(100% - var(--ic-space-xxxs));display:flex;flex-direction:column;width:100%}.cell-container{display:flex;min-height:1.5rem;overflow-y:hidden;height:var(--row-height);--ic-typography-color:var(--ic-data-table-text-default-emphasis)}.truncation-show-hide{display:block}.cell-icon.truncation-show-hide{display:flex}.cell-container:not(.data-type-element,.truncation-show-hide){overflow-x:hidden}ic-loading-indicator{position:sticky;top:20px}.table-row-container{position:relative;height:100%;overflow:auto;transition:var(--ic-easing-transition-fast);overflow-anchor:none}:host([show-pagination=\"true\"]) .table-row-container{height:calc(100% - 3.5625rem)}table{table-layout:var(--table-layout, \"fixed\");border-spacing:0;width:100%;height:var(--table-height, auto)}.table-row-container:focus{outline:none;box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast);z-index:1}:host([embedded=\"true\"]) .table-row-container{border:var(--ic-space-1px) solid var(--ic-data-table-border)}.column-header-inner-container{padding:var(--ic-space-xs);box-sizing:border-box}.column-header-inner-container ic-tooltip{pointer-events:none}.column-header-inner-container ic-tooltip.show-trunc-tooltip{pointer-events:auto}.column-header-inner-container ic-tooltip .column-header-text{--ic-line-clamp:1}.column-header-sticky{position:sticky;top:0;z-index:1}.column-header-overlay{position:sticky;top:0;z-index:1;box-shadow:0 0.375rem var(--ic-space-xs) calc(var(--ic-space-xxs * -1))\n rgb(0 0 0 / 20%)}.row-header-sticky{position:sticky;left:0}.column-header,.table-row{box-sizing:border-box}.table-row-selected{background-color:var(--ic-data-table-cell-background-selected) !important}.table-row:hover{background-color:var(--ic-data-table-cell-background-hover) !important}.table-row-selected:hover{background-color:var(\n --ic-data-table-cell-background-selected-hover\n ) !important}.sort-button{margin-left:auto}.sort-button:hover{background-color:var(--ic-data-table-icon-button-background-hover)}.sort-button:active{background-color:var(--ic-data-table-icon-button-background-pressed)}.sort-button svg{color:var(--ic-data-table-sort-toggle-icon)}.sort-button-unsorted svg{color:var(--ic-data-table-sort-toggle-icon-default)}.table-density-dense .column-header-inner-container,td.table-density-dense{padding:var(--ic-space-xxs) var(--ic-space-xs) !important}.text-dense{font-size:var(--ic-font-size-label)}.table-density-spacious .column-header-inner-container,td.table-density-spacious{padding:0.625rem var(--ic-space-xs) !important}.text-spacious{font-size:1.125rem}.column-header-text{font-weight:var(--ic-font-weight-bold)}.dummy-column-header-text{white-space:nowrap;overflow:hidden;height:0;width:-moz-fit-content;width:fit-content}.row-header,.column-header{text-align:left;padding:var(--ic-space-xs);background-color:var(--ic-data-table-header-background);border-right:var(--ic-space-1px) solid var(--ic-data-table-header-keyline);border-bottom:var(--ic-space-1px) solid var(--ic-data-table-header-keyline);color:var(--ic-data-table-header-text)}.column-header{padding:0;width:var(--column-width);min-width:var(--column-min-width, 4rem);max-width:var(--column-max-width)}.column-header:last-child{border-right:none}.scrollable .column-header:last-child{border-right:var(--ic-space-1px) solid var(--ic-data-table-header-keyline) !important}:host([embedded=\"true\"]) tr:last-child .table-cell,:host([embedded=\"true\"]) tr:last-child .row-header{border-bottom:none}.column-header-alignment-left,.row-header-alignment-left,.cell-alignment-left{text-align:left !important;justify-content:start !important}.column-header-alignment-right,.row-header-alignment-right,.cell-alignment-right{text-align:right !important;justify-content:end !important}.cell-alignment-right.truncation-tooltip ic-tooltip ic-typography{padding-right:calc(var(--ic-space-xxs) + var(--ic-space-xs))}.cell-alignment-right.truncation-show-hide ic-typography{--ellipsis-padding-right:calc(var(--ic-space-xxs) + var(--ic-space-xs))}.column-header-alignment-center,.row-header-alignment-center,.cell-alignment-center{text-align:center !important;justify-content:center !important}.table-row{background-color:var(--ic-data-table-cell-background)}.table-row:nth-child(even){background-color:var(--ic-data-table-cell-background-stripe)}.table-cell{padding:var(--ic-space-xs);border-bottom:solid var(--ic-data-table-cell-keyline) var(--ic-space-1px);overflow:hidden;box-sizing:border-box;max-width:var(--column-max-width);min-width:var(--column-min-width)}.table-cell.with-overflow{overflow:visible}.data-type-string,.data-type-address{text-align:left;vertical-align:top}.data-type-number,.data-type-date{text-align:right;justify-content:end;vertical-align:top}.cell-alignment-top{vertical-align:top;align-items:flex-start}.cell-alignment-middle{vertical-align:middle;align-items:center}.cell-alignment-bottom{vertical-align:bottom;align-items:flex-end}.cell-emphasis-low ic-typography{--ic-typography-color:var(--ic-data-table-text-low-emphasis)}.cell-emphasis-high ic-typography{--ic-typography-color:var(--ic-data-table-text-high-emphasis);font-weight:var(--ic-font-weight-bold)}.pagination-container{background-color:var(--ic-data-table-pagination-bar-background-color);border-top:var(--ic-space-1px) solid\n var(--ic-data-table-pagination-bar-keyline)}.screen-reader-sort-text,.table-caption{position:absolute;left:-100rem}.table-cell,.column-header,.row-header{word-wrap:break-word;white-space:pre-wrap}.loading-empty{padding:var(--ic-space-xl) var(--ic-space-xxl);margin-top:var(--ic-space-xl)}.updating-state{padding:0;border-bottom:var(--ic-space-1px) solid var(--ic-data-table-header-keyline)}.updating-state-headers{border-bottom:none}.loading{position:absolute;left:calc(50% - 5.9741rem);opacity:0;transition:opacity var(--ic-transition-duration-slow);z-index:calc(var(--ic-z-index-dialog) - 1);background-color:var(--ic-data-table-overlay-background);border:var(--ic-space-1px) solid var(--ic-data-table-overlay-border)}.loading.show{opacity:1}.icon,::slotted(svg){height:var(--ic-space-lg);width:var(--ic-space-lg);margin-right:var(--ic-space-xxs)}.column-header .icon>svg,.column-header ::slotted(svg){fill:var(--ic-data-table-icon)}.table-cell .icon>svg,.table-cell ::slotted(svg),.cell-description-icon>svg{fill:var(--ic-data-table-icon-default-emphasis)}.cell-emphasis-high .icon>svg,.cell-emphasis-high ::slotted(svg){fill:var(--ic-data-table-icon-high-emphasis)}.cell-emphasis-low .icon>svg,.cell-emphasis-low ::slotted(svg){fill:var(--ic-data-table-icon-low-emphasis)}.column-header-alignment-right>.icon,.row-header-alignment-right>.icon,.cell-alignment-right>.icon,.column-header-alignment-right>::slotted(svg),.row-header-alignment-right>::slotted(svg),.cell-alignment-right>::slotted(svg){margin-right:auto}.column-header-alignment-center>ic-typography,.column-header-alignment-center>.cell-text-wrapper,.row-header-alignment-right>ic-typography,.row-header-alignment-right>.cell-text-wrapper,.cell-alignment-center>ic-typography,.cell-alignment-center>.cell-text-wrapper{flex:1}.icon>svg{height:var(--ic-space-lg);width:var(--ic-space-lg);display:inline-block}.truncation-tooltip ic-typography{display:-webkit-box;-webkit-line-clamp:var(--ic-line-clamp, 0);-webkit-box-orient:vertical;overflow:hidden}.truncation-tooltip ic-typography,.truncation-show-hide ic-typography{white-space:normal}.ic-tooltip-overflow{overflow:hidden;width:100%}.action-element{display:flex;justify-content:right}.cell-grid-wrapper{display:grid;grid-template-columns:auto auto}.loading-overlay{visibility:hidden;position:absolute;top:0;left:0;width:100%;height:100%;background:var(--ic-data-table-loading-indicator-overlay-background);z-index:calc(var(--ic-z-index-dialog) - 2);opacity:0;transition:opacity var(--ic-transition-duration-slow)}.loading-overlay.show{visibility:visible;opacity:0.6}.sr-only{position:absolute;left:-9999px}@media (prefers-reduced-motion: reduce){.loading-overlay{transition:none}}.cell-text-wrapper{overflow:hidden}.cell-text-wrapper>ic-typography{margin-left:2px}.cell-text-no-wrap{word-wrap:initial}.cell-container-with-description{display:flex;flex-direction:row}.cell-description{display:flex;flex-direction:row;margin-top:var(--ic-space-xxs);word-break:break-all}.cell-description-text{color:var(--ic-data-table-cell-description-text)}.cell-description-icon{padding-right:var(--ic-space-xs)}.cell-description-icon>svg{height:calc(var(--ic-space-lg) - var(--ic-space-xxs));width:calc(var(--ic-space-lg) - var(--ic-space-xxs));display:flex}@media (min-width: 577px){.column-header-inner-container{display:flex;align-items:center}}@media (max-width: 577px){.cell-icon{flex-wrap:wrap}.cell-description-icon{padding-right:0}}@media (forced-colors: active){.icon,::slotted(svg),.cell-description-icon>svg{fill:currentcolor}.sort-button svg{color:currentcolor}.table-row-selected{background-color:Highlight !important}}";
|
20
|
+
const icDataTableCss = ":host{position:relative;display:inline-flex;max-height:100%;width:var(--table-width, 100%);height:100%;min-width:var(--table-min-width);max-width:var(--table-max-width)}tbody{vertical-align:top}.table-container{position:relative;height:calc(100% - var(--ic-space-xxxs));display:flex;flex-direction:column;width:100%}.cell-container{display:flex;min-height:1.5rem;overflow-y:hidden;height:var(--row-height);--ic-typography-color:var(--ic-data-table-text-default-emphasis)}.truncation-show-hide{display:block}.cell-icon.truncation-show-hide{display:flex}.cell-container:not(.data-type-element,.truncation-show-hide){overflow-x:hidden}ic-loading-indicator{position:sticky;top:20px}.table-row-container{position:relative;height:100%;overflow:auto;transition:var(--ic-easing-transition-fast);overflow-anchor:none}:host([show-pagination=\"true\"]) .table-row-container{height:calc(100% - 3.5625rem)}table{table-layout:var(--table-layout, \"fixed\");border-spacing:0;width:100%;height:var(--table-height, auto)}.table-row-container:focus{outline:none;box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast);z-index:1}:host([embedded=\"true\"]) .table-row-container{border:var(--ic-space-1px) solid var(--ic-data-table-border)}.column-header-inner-container{padding:var(--ic-space-xs);box-sizing:border-box}.column-header-inner-container ic-tooltip{pointer-events:none}.column-header-inner-container ic-tooltip.show-trunc-tooltip{pointer-events:auto}.column-header-inner-container ic-tooltip .column-header-text{--ic-line-clamp:1}.column-header-sticky{position:sticky;top:0;z-index:1}.column-header-overlay{position:sticky;top:0;z-index:1;box-shadow:0 0.375rem var(--ic-space-xs) calc(var(--ic-space-xxs * -1))\n rgb(0 0 0 / 20%)}.row-header-sticky{position:sticky;left:0}.column-header,.table-row{box-sizing:border-box}.table-row-selected{background-color:var(--ic-data-table-cell-background-selected) !important}.table-row:hover{background-color:var(--ic-data-table-cell-background-hover) !important}.table-row-selected:hover{background-color:var(\n --ic-data-table-cell-background-selected-hover\n ) !important}.sort-button{margin-left:auto}.sort-button:hover{background-color:var(--ic-data-table-icon-button-background-hover)}.sort-button:active{background-color:var(--ic-data-table-icon-button-background-pressed)}.sort-button svg{color:var(--ic-data-table-sort-toggle-icon)}.sort-button-unsorted svg{color:var(--ic-data-table-sort-toggle-icon-default)}.table-density-dense .column-header-inner-container,td.table-density-dense{padding:var(--ic-space-xxs) var(--ic-space-xs) !important}.text-dense{font-size:var(--ic-font-size-label)}.table-density-spacious .column-header-inner-container,td.table-density-spacious{padding:0.625rem var(--ic-space-xs) !important}.text-spacious{font-size:1.125rem}.column-header-text{font-weight:var(--ic-font-weight-bold)}.dummy-column-header-text{white-space:nowrap;overflow:hidden;height:0;width:-moz-fit-content;width:fit-content}.row-header,.column-header{text-align:left;padding:var(--ic-space-xs);background-color:var(--ic-data-table-header-background);border-right:var(--ic-space-1px) solid var(--ic-data-table-header-keyline);border-bottom:var(--ic-space-1px) solid var(--ic-data-table-header-keyline);color:var(--ic-data-table-header-text)}.column-header{padding:0;width:var(--column-width);min-width:var(--column-min-width, 4rem);max-width:var(--column-max-width)}.column-header:last-child{border-right:none}.scrollable .column-header:last-child{border-right:var(--ic-space-1px) solid var(--ic-data-table-header-keyline) !important}:host([embedded=\"true\"]) tr:last-child .table-cell,:host([embedded=\"true\"]) tr:last-child .row-header{border-bottom:none}.column-header-alignment-left,.row-header-alignment-left,.cell-alignment-left{text-align:left !important;justify-content:start !important}.column-header-alignment-right,.row-header-alignment-right,.cell-alignment-right{text-align:right !important;justify-content:end !important}.cell-alignment-right.truncation-tooltip ic-tooltip ic-typography{padding-right:calc(var(--ic-space-xxs) + var(--ic-space-xs))}.cell-alignment-right.truncation-show-hide ic-typography{--ellipsis-padding-right:calc(var(--ic-space-xxs) + var(--ic-space-xs))}.column-header-alignment-center,.row-header-alignment-center,.cell-alignment-center{text-align:center !important;justify-content:center !important}.table-row{background-color:var(--ic-data-table-cell-background)}.table-row:nth-child(even){background-color:var(--ic-data-table-cell-background-stripe)}.table-cell{padding:var(--ic-space-xs);border-bottom:solid var(--ic-data-table-cell-keyline) var(--ic-space-1px);overflow:hidden;box-sizing:border-box;max-width:var(--column-max-width);min-width:var(--column-min-width)}.table-cell.with-overflow{overflow:visible}.data-type-string,.data-type-address{text-align:left;vertical-align:top}.data-type-number,.data-type-date{text-align:right;justify-content:end;vertical-align:top}.cell-alignment-top{vertical-align:top;align-items:flex-start}.cell-alignment-middle{vertical-align:middle;align-items:center}.cell-alignment-bottom{vertical-align:bottom;align-items:flex-end}.cell-emphasis-low ic-typography{--ic-typography-color:var(--ic-data-table-text-low-emphasis)}.cell-emphasis-high ic-typography{--ic-typography-color:var(--ic-data-table-text-high-emphasis);font-weight:var(--ic-font-weight-bold)}.pagination-container{background-color:var(--ic-data-table-pagination-bar-background-color);border-top:var(--ic-space-1px) solid\n var(--ic-data-table-pagination-bar-keyline)}.screen-reader-sort-text,.table-caption{position:absolute;left:-100rem}.table-cell,.column-header,.row-header{word-wrap:break-word;white-space:pre-wrap}.loading-empty{padding:var(--ic-space-xl) var(--ic-space-xxl);margin-top:var(--ic-space-xl)}.updating-state{padding:0;border-bottom:var(--ic-space-1px) solid var(--ic-data-table-header-keyline)}.updating-state-headers{border-bottom:none}.loading{position:absolute;left:calc(50% - 5.9741rem);opacity:0;transition:opacity var(--ic-transition-duration-slow);z-index:calc(var(--ic-z-index-dialog) - 1);background-color:var(--ic-data-table-overlay-background);border:var(--ic-space-1px) solid var(--ic-data-table-overlay-border)}.loading.show{opacity:1}.icon,::slotted(svg){height:var(--ic-space-lg);width:var(--ic-space-lg);margin-right:var(--ic-space-xxs)}.column-header .icon>svg,.column-header ::slotted(svg){fill:var(--ic-data-table-icon)}.table-cell .icon>svg,.table-cell ::slotted(svg),.cell-description-icon>svg{fill:var(--ic-data-table-icon-default-emphasis)}.cell-emphasis-high .icon>svg,.cell-emphasis-high ::slotted(svg){fill:var(--ic-data-table-icon-high-emphasis)}.cell-emphasis-low .icon>svg,.cell-emphasis-low ::slotted(svg){fill:var(--ic-data-table-icon-low-emphasis)}.column-header-alignment-right>.icon,.row-header-alignment-right>.icon,.cell-alignment-right>.icon,.column-header-alignment-right>::slotted(svg),.row-header-alignment-right>::slotted(svg),.cell-alignment-right>::slotted(svg){margin-right:auto}.column-header-alignment-center>ic-typography,.column-header-alignment-center>.cell-text-wrapper,.row-header-alignment-right>ic-typography,.row-header-alignment-right>.cell-text-wrapper,.cell-alignment-center>ic-typography,.cell-alignment-center>.cell-text-wrapper{flex:1}.checkbox-cell{--column-width:var(--ic-space-xxl);align-content:center;border-right:none}.table-density-dense.checkbox-cell{--column-width:2.5rem}.checkbox-wrapper{display:flex;justify-content:center}.icon>svg{height:var(--ic-space-lg);width:var(--ic-space-lg);display:inline-block}.truncation-tooltip ic-typography{display:-webkit-box;-webkit-line-clamp:var(--ic-line-clamp, 0);-webkit-box-orient:vertical;overflow:hidden}.truncation-tooltip ic-typography,.truncation-show-hide ic-typography{white-space:normal}.ic-tooltip-overflow{overflow:hidden;width:100%}.action-element{display:flex;justify-content:right}.cell-grid-wrapper{display:grid;grid-template-columns:auto auto}.loading-overlay{visibility:hidden;position:absolute;top:0;left:0;width:100%;height:100%;background:var(--ic-data-table-loading-indicator-overlay-background);z-index:calc(var(--ic-z-index-dialog) - 2);opacity:0;transition:opacity var(--ic-transition-duration-slow)}.loading-overlay.show{visibility:visible;opacity:0.6}.sr-only{position:absolute;left:-9999px}@media (prefers-reduced-motion: reduce){.loading-overlay{transition:none}}.cell-text-wrapper{overflow:hidden}.cell-text-wrapper>ic-typography{margin-left:2px}.cell-text-no-wrap{word-wrap:initial}.cell-container-with-description{display:flex;flex-direction:row}.cell-description{display:flex;flex-direction:row;margin-top:var(--ic-space-xxs);word-break:break-all}.cell-description-text{color:var(--ic-data-table-cell-description-text)}.cell-description-icon{padding-right:var(--ic-space-xs)}.cell-description-icon>svg{height:calc(var(--ic-space-lg) - var(--ic-space-xxs));width:calc(var(--ic-space-lg) - var(--ic-space-xxs));display:flex}@media (min-width: 577px){.column-header-inner-container{display:flex;align-items:center}}@media (max-width: 577px){.cell-icon{flex-wrap:wrap}.cell-description-icon{padding-right:0}}@media (forced-colors: active){.icon,::slotted(svg),.cell-description-icon>svg{fill:currentcolor}.sort-button svg{color:currentcolor}.table-row-selected{background-color:Highlight !important}}";
|
21
21
|
const IcDataTableStyle0 = icDataTableCss;
|
22
22
|
|
23
23
|
const DataTable = class {
|
24
24
|
constructor(hostRef) {
|
25
25
|
index.registerInstance(this, hostRef);
|
26
26
|
this.icRowHeightChange = index.createEvent(this, "icRowHeightChange", 7);
|
27
|
+
this.icSelectAllRows = index.createEvent(this, "icSelectAllRows", 7);
|
27
28
|
this.icSelectedRowChange = index.createEvent(this, "icSelectedRowChange", 7);
|
28
29
|
this.icSortChange = index.createEvent(this, "icSortChange", 7);
|
29
30
|
this.DENSITY_HEIGHT_MULTIPLIER = {
|
@@ -71,6 +72,7 @@ const DataTable = class {
|
|
71
72
|
this.fromRow = 0;
|
72
73
|
this.scrollable = false;
|
73
74
|
this.scrollOffset = 0;
|
75
|
+
this.selectedRows = [];
|
74
76
|
this.debounceDelay = 0;
|
75
77
|
/**
|
76
78
|
* Determines whether the column header should be truncated and display a tooltip. Default is `false`.
|
@@ -92,10 +94,6 @@ const DataTable = class {
|
|
92
94
|
* Sets the row height on all rows in the table that aren't set using the `variableRowHeight` method.
|
93
95
|
*/
|
94
96
|
this.globalRowHeight = "auto";
|
95
|
-
/**
|
96
|
-
* If `true`, the selected row is highlighted using a background colour.
|
97
|
-
*/
|
98
|
-
this.highlightSelectedRow = true;
|
99
97
|
/**
|
100
98
|
* If `true`, column headers will not be visible.
|
101
99
|
*/
|
@@ -130,6 +128,10 @@ const DataTable = class {
|
|
130
128
|
showItemsPerPageControl: true,
|
131
129
|
type: "simple",
|
132
130
|
};
|
131
|
+
/**
|
132
|
+
* If `true`, a checkbox column will be displayed to the left of the table which allows multiple rows to be selected.
|
133
|
+
*/
|
134
|
+
this.rowSelection = false;
|
133
135
|
/**
|
134
136
|
* If `true`, adds a pagination bar to the bottom of the table.
|
135
137
|
*/
|
@@ -172,11 +174,12 @@ const DataTable = class {
|
|
172
174
|
this.headerResizeObserver.observe(this.el);
|
173
175
|
};
|
174
176
|
this.headerResizeCallback = () => {
|
177
|
+
var _a, _b, _c;
|
175
178
|
if (!this.hideColumnHeaders && this.columnHeaderTruncation) {
|
176
|
-
const tableContainerWidth = this.el.shadowRoot.querySelector(".table-container").clientWidth;
|
177
|
-
if (tableContainerWidth
|
178
|
-
|
179
|
-
|
179
|
+
const tableContainerWidth = (_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".table-container")) === null || _b === void 0 ? void 0 : _b.clientWidth;
|
180
|
+
if (tableContainerWidth &&
|
181
|
+
tableContainerWidth !== this.prevTableContainerWidth) {
|
182
|
+
(_c = this.el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelectorAll("th.column-header").forEach((header) => {
|
180
183
|
const tooltip = header.querySelector(this.IC_TOOLTIP_STRING);
|
181
184
|
const typographyEls = header.querySelectorAll(this.IC_TYPOGRAPHY_STRING);
|
182
185
|
if (tooltip && typographyEls && typographyEls.length === 2) {
|
@@ -190,49 +193,46 @@ const DataTable = class {
|
|
190
193
|
}
|
191
194
|
}
|
192
195
|
};
|
196
|
+
this.getRowHeight = (cellContainer) => parseInt(getComputedStyle(document.documentElement).fontSize) *
|
197
|
+
parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING) || "");
|
193
198
|
this.updateSetRowHeight = (typographyEl) => {
|
194
|
-
const
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
199
|
-
if (typographyEl.scrollHeight > rowHeight) {
|
199
|
+
const removeRowHeightVariable = (element) => {
|
200
|
+
const cellContainer = this.getCellContainer(element);
|
201
|
+
if (cellContainer &&
|
202
|
+
element.scrollHeight > this.getRowHeight(cellContainer)) {
|
200
203
|
cellContainer.style.removeProperty(this.ROW_HEIGHT_CSS_VARIABLE);
|
201
204
|
}
|
205
|
+
};
|
206
|
+
if (typographyEl) {
|
207
|
+
removeRowHeightVariable(typographyEl);
|
202
208
|
}
|
203
209
|
else {
|
204
210
|
this.getTypographyElements().forEach((typographyEl) => {
|
205
|
-
|
206
|
-
const rowHeight = fontSize *
|
207
|
-
parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
208
|
-
if (typographyEl.scrollHeight > rowHeight) {
|
209
|
-
cellContainer.style.removeProperty(this.ROW_HEIGHT_CSS_VARIABLE);
|
210
|
-
}
|
211
|
+
removeRowHeightVariable(typographyEl);
|
211
212
|
});
|
212
213
|
}
|
213
214
|
};
|
214
215
|
this.debounceDataTruncation = () => {
|
215
216
|
this.getTypographyElements().forEach((typographyEl) => {
|
216
217
|
const cellContainer = this.getCellContainer(typographyEl);
|
217
|
-
if (
|
218
|
+
if (cellContainer &&
|
219
|
+
!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {
|
218
220
|
this.resizeObserver = new ResizeObserver(
|
219
221
|
// This gets triggered twice due to updated data and see more/see less button
|
220
222
|
helpers.dynamicDebounce(() => {
|
221
223
|
this.dataTruncation(typographyEl);
|
222
224
|
if (!this.isNewDebounceDelaySet) {
|
223
|
-
this.
|
225
|
+
this.debounceDelay = 200;
|
226
|
+
this.isNewDebounceDelaySet = true;
|
224
227
|
}
|
225
228
|
}, () => this.debounceDelay));
|
226
229
|
this.resizeObserver.observe(typographyEl);
|
227
230
|
}
|
228
231
|
});
|
229
232
|
};
|
230
|
-
this.setNewDebounceDelay = (delay) => {
|
231
|
-
this.debounceDelay = delay;
|
232
|
-
this.isNewDebounceDelaySet = true;
|
233
|
-
};
|
234
233
|
this.getLines = (height) => Math.floor(height / this.DEFAULT_LINE_HEIGHT);
|
235
234
|
this.truncate = (typographyEl, cellContainer, tooltip) => {
|
235
|
+
var _a;
|
236
236
|
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
|
237
237
|
//24 is the height of a single line
|
238
238
|
if (!typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
@@ -247,33 +247,36 @@ const DataTable = class {
|
|
247
247
|
else {
|
248
248
|
if (this.truncationPattern === this.TOOLTIP_STRING && tooltip) {
|
249
249
|
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: 0`);
|
250
|
-
|
251
|
-
|
250
|
+
(_a = cellContainer
|
251
|
+
.querySelector(this.CELL_TEXT_WRAPPER_STRING)) === null || _a === void 0 ? void 0 : _a.prepend(typographyEl);
|
252
252
|
tooltip.remove();
|
253
253
|
}
|
254
254
|
if (this.truncationPattern === this.SHOW_HIDE_STRING &&
|
255
|
-
!helpers.isEmptyString(typographyEl.getAttribute("max-lines"))) {
|
255
|
+
!helpers.isEmptyString(typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.getAttribute("max-lines"))) {
|
256
256
|
this.resetShowHideTruncation(typographyEl);
|
257
257
|
}
|
258
258
|
}
|
259
259
|
};
|
260
260
|
this.dataTruncation = (typographyEl) => {
|
261
|
+
var _a;
|
261
262
|
// Tooltip truncation mentioned in AC. Will need revisiting
|
262
263
|
const tooltip = this.getTooltip(typographyEl);
|
263
264
|
const cellContainer = this.getCellContainer(typographyEl);
|
264
|
-
if (
|
265
|
+
if (!cellContainer ||
|
266
|
+
cellContainer.classList.contains("data-type-element") ||
|
265
267
|
this.dataUpdated) {
|
266
268
|
return;
|
267
269
|
}
|
268
270
|
if (this.truncationPattern === this.SHOW_HIDE_STRING &&
|
269
|
-
typographyEl.shadowRoot.querySelector("button")) {
|
271
|
+
((_a = typographyEl.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("button"))) {
|
270
272
|
const showHideBtn = typographyEl.shadowRoot.querySelector("button");
|
271
273
|
// If the see more/see less is present and the max lines is equal to the cell container
|
272
274
|
// remove the see more/see less button
|
273
275
|
if (showHideBtn) {
|
274
276
|
const truncWrapper = this.getTruncWrapper(typographyEl);
|
275
|
-
if (
|
276
|
-
|
277
|
+
if (truncWrapper &&
|
278
|
+
this.getLines(truncWrapper.scrollHeight) ===
|
279
|
+
Number(typographyEl.getAttribute("max-lines"))) {
|
277
280
|
this.resetShowHideTruncation(typographyEl);
|
278
281
|
}
|
279
282
|
}
|
@@ -303,18 +306,16 @@ const DataTable = class {
|
|
303
306
|
}
|
304
307
|
this.truncate(typographyEl, cellContainer, tooltip);
|
305
308
|
};
|
306
|
-
this.getTruncWrapper = (typographyEl) => typographyEl.shadowRoot.querySelector(".trunc-wrapper");
|
309
|
+
this.getTruncWrapper = (typographyEl) => { var _a; return (_a = typographyEl.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".trunc-wrapper"); };
|
307
310
|
this.removeTextWrap = () => {
|
308
311
|
this.getTypographyElements().forEach((typographyEl) => {
|
309
312
|
const tableCell = typographyEl.closest("td");
|
310
|
-
if (tableCell.classList.contains(this.TEXT_WRAP_STRING)) {
|
313
|
+
if (tableCell === null || tableCell === void 0 ? void 0 : tableCell.classList.contains(this.TEXT_WRAP_STRING)) {
|
311
314
|
tableCell.classList.remove(this.TEXT_WRAP_STRING);
|
312
315
|
}
|
313
316
|
});
|
314
317
|
};
|
315
|
-
this.getCellContainer = (typographyEl) =>
|
316
|
-
return typographyEl.closest(".cell-container");
|
317
|
-
};
|
318
|
+
this.getCellContainer = (typographyEl) => typographyEl.closest(".cell-container");
|
318
319
|
this.deleteTextWrapDataKey = (array) => Array.isArray(array) &&
|
319
320
|
array.forEach((val) => val.textWrap && delete val.textWrap);
|
320
321
|
this.startLoadingTimer = () => {
|
@@ -322,7 +323,7 @@ const DataTable = class {
|
|
322
323
|
this.timerStarted = Date.now();
|
323
324
|
setTimeout(() => {
|
324
325
|
this.hasLoadedForOneSecond = true;
|
325
|
-
this.timerStarted =
|
326
|
+
this.timerStarted = 0;
|
326
327
|
}, this.minimumLoadingDisplayDuration);
|
327
328
|
};
|
328
329
|
this.isObject = (value) => value !== undefined && value !== null && typeof value === "object";
|
@@ -351,32 +352,28 @@ const DataTable = class {
|
|
351
352
|
const { description, max, min, progress, monochrome } = this.updatingOptions || {};
|
352
353
|
return (index.h("th", { colSpan: this.columns.length, class: "updating-state" }, index.h("ic-loading-indicator", { theme: this.theme, monochrome: monochrome, description: description || "Updating table data", fullWidth: true, max: max, min: min, progress: progress, type: "linear", size: "small" })));
|
353
354
|
};
|
354
|
-
this.setRowHeight = (height) => {
|
355
|
-
|
356
|
-
this.DENSITY_PADDING_HEIGHT_DIFF[this.density]}px`);
|
357
|
-
};
|
355
|
+
this.setRowHeight = (height) => helpers.pxToRem(`${height * this.DENSITY_HEIGHT_MULTIPLIER[this.density] -
|
356
|
+
this.DENSITY_PADDING_HEIGHT_DIFF[this.density]}px`);
|
358
357
|
this.setTruncationClass = () => this.truncationPattern
|
359
358
|
? { [`truncation-${this.truncationPattern}`]: true }
|
360
359
|
: {};
|
361
360
|
this.getColumnWidth = (columnWidth) => {
|
362
361
|
// TODO: Setting max width on columns
|
363
362
|
let columnWidthStyling = {};
|
364
|
-
if (columnWidth) {
|
365
|
-
|
366
|
-
|
363
|
+
if (typeof columnWidth === "string") {
|
364
|
+
columnWidthStyling = Object.assign(Object.assign({}, columnWidthStyling), { ["--column-width"]: columnWidth });
|
365
|
+
}
|
366
|
+
else if (columnWidth && Object.keys(columnWidth).length > 0) {
|
367
|
+
if (columnWidth.minWidth) {
|
368
|
+
columnWidthStyling = Object.assign(Object.assign({}, columnWidthStyling), { ["--column-min-width"]: columnWidth.minWidth });
|
367
369
|
}
|
368
|
-
if (
|
369
|
-
|
370
|
-
columnWidthStyling = Object.assign(Object.assign({}, columnWidthStyling), { ["--column-min-width"]: columnWidth === null || columnWidth === void 0 ? void 0 : columnWidth.minWidth });
|
371
|
-
}
|
372
|
-
if (columnWidth === null || columnWidth === void 0 ? void 0 : columnWidth.maxWidth) {
|
373
|
-
columnWidthStyling = Object.assign(Object.assign({}, columnWidthStyling), { ["--column-max-width"]: columnWidth === null || columnWidth === void 0 ? void 0 : columnWidth.maxWidth });
|
374
|
-
}
|
370
|
+
if (columnWidth.maxWidth) {
|
371
|
+
columnWidthStyling = Object.assign(Object.assign({}, columnWidthStyling), { ["--column-max-width"]: columnWidth.maxWidth });
|
375
372
|
}
|
376
373
|
}
|
377
374
|
return columnWidthStyling;
|
378
375
|
};
|
379
|
-
this.
|
376
|
+
this.getCalculatedRowHeight = (columnProps, rowTextWrap, cell, currentRowHeight) => {
|
380
377
|
if ((this.truncationPattern || currentRowHeight) &&
|
381
378
|
!(columnProps === null || columnProps === void 0 ? void 0 : columnProps.textWrap) &&
|
382
379
|
!rowTextWrap &&
|
@@ -389,20 +386,22 @@ const DataTable = class {
|
|
389
386
|
return {};
|
390
387
|
};
|
391
388
|
this.adjustWidthForActionElement = () => {
|
392
|
-
|
393
|
-
elements.
|
389
|
+
var _a;
|
390
|
+
const elements = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".action-element");
|
391
|
+
elements === null || elements === void 0 ? void 0 : elements.forEach((element) => {
|
394
392
|
const width = element.firstChild.getBoundingClientRect()
|
395
393
|
.width;
|
396
394
|
const gridWrapper = element.closest(".cell-grid-wrapper");
|
397
|
-
|
395
|
+
if (gridWrapper)
|
396
|
+
gridWrapper.style.gridTemplateColumns = `auto calc(${width}px + var(--ic-space-xs))`;
|
398
397
|
});
|
399
398
|
};
|
400
|
-
this.createCellContent = (columnProps, cell, cellSlotName, rowOptions, rowAlignment, hasIcon,
|
399
|
+
this.createCellContent = (columnProps, cell, cellSlotName, rowOptions, rowAlignment, hasIcon, cellValue, rowEmphasis, currentRowHeight) => {
|
401
400
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
402
401
|
return (index.h("div", { innerHTML: (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) === "element" &&
|
403
402
|
!helpers.isSlotUsed(this.el, cellSlotName)
|
404
403
|
? cell
|
405
|
-
:
|
404
|
+
: undefined, class: Object.assign(Object.assign({ "cell-container": (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "element", [`cell-alignment-${((_a = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _a === void 0 ? void 0 : _a.vertical) ||
|
406
405
|
((_b = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _b === void 0 ? void 0 : _b.vertical) ||
|
407
406
|
rowAlignment ||
|
408
407
|
this.getCellAlignment(cell, "vertical")}`]: !!((_c = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _c === void 0 ? void 0 : _c.vertical) ||
|
@@ -418,7 +417,7 @@ const DataTable = class {
|
|
418
417
|
(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
|
419
418
|
rowEmphasis}`]: (this.isObject(cell) && !!cellValue("emphasis")) ||
|
420
419
|
!!(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
|
421
|
-
!!rowEmphasis }, this.setTruncationClass()), { [this.CELL_CONTAINER_WITH_DESCRIPTION_STRING]: this.isObject(cell) && Object.keys(cell).includes("description") }), style: Object.assign(Object.assign({}, this.
|
420
|
+
!!rowEmphasis }, this.setTruncationClass()), { [this.CELL_CONTAINER_WITH_DESCRIPTION_STRING]: this.isObject(cell) && Object.keys(cell).includes("description") }), style: Object.assign(Object.assign({}, this.getCalculatedRowHeight(columnProps, rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.textWrap, cell, currentRowHeight)), this.getColumnWidth(columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnWidth)), "data-row-height": this.truncationPattern || currentRowHeight
|
422
421
|
? this.setRowHeight(currentRowHeight)
|
423
422
|
: null }, helpers.isSlotUsed(this.el, cellSlotName) ? (index.h("slot", { name: cellSlotName })) : (index.h(index.Fragment, null, helpers.isSlotUsed(this.el, `${cellSlotName}-icon`) ? (index.h("slot", { name: `${cellSlotName}-icon` })) : ((hasIcon || ((_k = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _k === void 0 ? void 0 : _k.onAllCells)) &&
|
424
423
|
(cellValue("icon") || ((_l = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _l === void 0 ? void 0 : _l.icon)) && (index.h("span", { class: "icon", innerHTML: cellValue("icon") || ((_m = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _m === void 0 ? void 0 : _m.icon) }))), (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "element" &&
|
@@ -466,17 +465,18 @@ const DataTable = class {
|
|
466
465
|
["row-header-sticky"]: this.stickyRowHeaders,
|
467
466
|
} }, cellValue("title")));
|
468
467
|
}
|
468
|
+
const CellContent = this.createCellContent(columnProps, cell, cellSlotName, rowOptions, rowAlignment, hasIcon, cellValue, rowEmphasis, currentRowHeight || undefined);
|
469
469
|
if (rowKeys[index$1] !== "rowOptions") {
|
470
470
|
return (index.h("td", { class: {
|
471
471
|
["table-cell"]: true,
|
472
472
|
[`table-density-${this.density}`]: this.notDefaultDensity(),
|
473
473
|
["with-overflow"]: (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) === "element",
|
474
474
|
}, style: Object.assign({}, this.getColumnWidth(columnProps.columnWidth)) }, this.isObject(cell) &&
|
475
|
-
Object.keys(cell).includes("actionElement") ? (index.h("div", { class: "cell-grid-wrapper" },
|
475
|
+
Object.keys(cell).includes("actionElement") ? (index.h("div", { class: "cell-grid-wrapper" }, CellContent, index.h("span", { class: "action-element", innerHTML: cellValue("actionElement"),
|
476
476
|
// eslint-disable-next-line react/jsx-no-bind
|
477
477
|
onClick: cell.actionOnClick
|
478
478
|
? (event) => this.handleClick(event, cell.actionOnClick)
|
479
|
-
: undefined }))) : (
|
479
|
+
: undefined }))) : (CellContent)));
|
480
480
|
}
|
481
481
|
});
|
482
482
|
};
|
@@ -509,16 +509,28 @@ const DataTable = class {
|
|
509
509
|
[`text-${this.density}`]: this.notDefaultDensity(),
|
510
510
|
} }, title)))));
|
511
511
|
this.onRowClick = (row) => {
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
512
|
+
const notCurrentlySelected = !this.selectedRows.includes(row);
|
513
|
+
this.selectedRows = notCurrentlySelected
|
514
|
+
? [...this.selectedRows, row]
|
515
|
+
: this.selectedRows.filter((selectedRow) => selectedRow !== row);
|
516
|
+
this.icSelectedRowChange.emit({
|
517
|
+
row: notCurrentlySelected ? row : null,
|
518
|
+
selectedRows: this.selectedRows,
|
519
|
+
});
|
520
|
+
};
|
521
|
+
this.selectAllRows = () => {
|
522
|
+
this.selectedRows =
|
523
|
+
this.organisedData &&
|
524
|
+
this.selectedRows.length !== this.organisedData.length
|
525
|
+
? [...this.organisedData]
|
526
|
+
: [];
|
527
|
+
this.icSelectAllRows.emit(this.selectedRows);
|
517
528
|
};
|
518
529
|
this.createRows = () => {
|
530
|
+
var _a, _b, _c;
|
519
531
|
const data = this.showPagination
|
520
|
-
? this.data.slice(this.fromRow, this.toRow)
|
521
|
-
: this.data.slice();
|
532
|
+
? (_a = this.data) === null || _a === void 0 ? void 0 : _a.slice(this.fromRow, this.toRow)
|
533
|
+
: (_b = this.data) === null || _b === void 0 ? void 0 : _b.slice();
|
522
534
|
const paginationOffset = this.showPagination ? this.fromRow : 0;
|
523
535
|
/**
|
524
536
|
* Ensures that createCells has a value in data to map over to actually render the slot.
|
@@ -526,7 +538,7 @@ const DataTable = class {
|
|
526
538
|
* `addDataToPosition` used to add the element in the correct column order.
|
527
539
|
* Adding empty string value in to give `createCells` something to loop over.
|
528
540
|
*/
|
529
|
-
|
541
|
+
this.organisedData = data === null || data === void 0 ? void 0 : data.map((row, rowIndex) => {
|
530
542
|
const slottedColumns = this.columns
|
531
543
|
.map(({ key }, index) => helpers.isSlotUsed(this.el, `${key}-${rowIndex + paginationOffset}`) && {
|
532
544
|
key,
|
@@ -539,18 +551,19 @@ const DataTable = class {
|
|
539
551
|
? helpers.addDataToPosition(row, slottedColumns, "")
|
540
552
|
: row;
|
541
553
|
});
|
542
|
-
return organisedData
|
543
|
-
.sort(!this.sortable || this.disableAutoSort
|
554
|
+
return (_c = this.organisedData) === null || _c === void 0 ? void 0 : _c.sort(!this.sortable || this.disableAutoSort
|
544
555
|
? undefined
|
545
|
-
: this.getSortFunction())
|
546
|
-
.
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
556
|
+
: this.getSortFunction()).map((row, index$1) => {
|
557
|
+
const isRowSelected = this.rowSelection && this.selectedRows.includes(row);
|
558
|
+
const cellIndex = index$1 + paginationOffset;
|
559
|
+
return (index.h("tr", { class: {
|
560
|
+
"table-row": true,
|
561
|
+
"table-row-selected": isRowSelected,
|
562
|
+
} }, this.rowSelection && (index.h("td", { class: {
|
563
|
+
"table-cell": true,
|
564
|
+
"checkbox-cell": true,
|
565
|
+
[`table-density-${this.density}`]: this.notDefaultDensity(),
|
566
|
+
} }, index.h("div", { class: "checkbox-wrapper" }, index.h("ic-checkbox", { class: "ic-data-table-checkbox", checked: isRowSelected, disabled: this.updating || this.loading, hideLabel: true, label: `${isRowSelected ? "Deselect" : "Select"} row ${cellIndex}`, onIcCheck: () => this.onRowClick(row), size: this.density === "dense" ? "small" : "medium", value: cellIndex })))), this.createCells(row, cellIndex)));
|
554
567
|
});
|
555
568
|
};
|
556
569
|
this.getObjectValue = (cell, key) => Object.values(cell)[Object.keys(cell).indexOf(key)];
|
@@ -593,12 +606,11 @@ const DataTable = class {
|
|
593
606
|
}
|
594
607
|
};
|
595
608
|
this.sortRows = (column) => {
|
596
|
-
|
609
|
+
var _a, _b, _c, _d;
|
597
610
|
const sortOrders = this.sortOptions.sortOrders;
|
598
611
|
if (column !== this.sortedColumn) {
|
599
612
|
if (this.sortedColumn) {
|
600
|
-
|
601
|
-
previousSortedButton.setAttribute("aria-label", this.getSortButtonLabel(column)); // Passing through unsorted column returns correct label for newly unsorted column
|
613
|
+
(_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(`#sort-button-${this.sortedColumn}`)) === null || _b === void 0 ? void 0 : _b.setAttribute("aria-label", this.getSortButtonLabel(column)); // Passing through unsorted column returns correct label for newly unsorted column
|
602
614
|
}
|
603
615
|
this.sortedColumn = column;
|
604
616
|
this.sortedColumnOrder = "unsorted";
|
@@ -608,50 +620,57 @@ const DataTable = class {
|
|
608
620
|
nextSortOrderIndex = 0;
|
609
621
|
}
|
610
622
|
this.sortedColumnOrder = sortOrders[nextSortOrderIndex];
|
611
|
-
|
623
|
+
(_d = (_c = this.el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector(`#sort-button-${column}`)) === null || _d === void 0 ? void 0 : _d.setAttribute("aria-label", this.getSortButtonLabel(column));
|
612
624
|
this.tableSorted = true;
|
613
625
|
this.icSortChange.emit({
|
614
626
|
columnName: column,
|
615
627
|
sorted: this.sortedColumnOrder,
|
616
628
|
});
|
617
629
|
};
|
630
|
+
/** Gets all `ic-typography`elements within the data table, excluding column headers and cell descriptions */
|
618
631
|
this.getTypographyElements = () => {
|
619
|
-
|
620
|
-
return Array.from(this.el.shadowRoot.querySelectorAll("ic-typography:not(.column-header-text,.cell-description-text)"));
|
621
|
-
};
|
622
|
-
this.getTooltip = (typographyEl) => {
|
623
|
-
return typographyEl.closest(this.TOOLTIP);
|
632
|
+
var _a;
|
633
|
+
return Array.from(((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll("ic-typography:not(.column-header-text,.cell-description-text)")) || []);
|
624
634
|
};
|
635
|
+
this.getTooltip = (typographyEl) => typographyEl.closest(this.TOOLTIP);
|
625
636
|
this.updateTruncationTooltip = (removeTooltipOnly = false) => {
|
626
637
|
this.getTypographyElements().forEach((typographyEl) => {
|
627
638
|
const tooltip = this.getTooltip(typographyEl);
|
628
639
|
const cellContainer = this.getCellContainer(typographyEl);
|
629
|
-
if (
|
630
|
-
this.
|
631
|
-
|
632
|
-
|
640
|
+
if (cellContainer) {
|
641
|
+
if (typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
642
|
+
this.removeTooltip(cellContainer, typographyEl, tooltip);
|
643
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: 0`);
|
644
|
+
return;
|
645
|
+
}
|
646
|
+
this.regenerateTooltip(cellContainer, typographyEl, tooltip, removeTooltipOnly);
|
633
647
|
}
|
634
|
-
this.regenerateTooltip(cellContainer, typographyEl, tooltip, removeTooltipOnly);
|
635
648
|
});
|
636
649
|
};
|
637
650
|
this.updateScrollOffset = () => {
|
638
|
-
|
651
|
+
var _a;
|
652
|
+
const tableRowContainer = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".table-row-container");
|
653
|
+
if (tableRowContainer)
|
654
|
+
this.scrollOffset = tableRowContainer.scrollTop;
|
639
655
|
};
|
640
656
|
this.updateRowHeightForDescriptions = (rowHeight, cellContainer) => {
|
641
|
-
cellContainer.setAttribute(
|
657
|
+
cellContainer.setAttribute(this.DATA_ROW_HEIGHT_STRING, rowHeight.toString());
|
642
658
|
cellContainer.setAttribute("style", `${this.ROW_HEIGHT_CSS_VARIABLE}: ${rowHeight}px`);
|
643
659
|
};
|
644
|
-
|
660
|
+
/** Method to update the row heights on cells with descriptions and tooltip truncation */
|
645
661
|
this.updateCellHeightsWithDescriptions = () => {
|
646
|
-
|
647
|
-
|
662
|
+
var _a, _b;
|
663
|
+
(_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.CELL_DESCRIPTION_STRING)) === null || _b === void 0 ? void 0 : _b.forEach((description) => {
|
648
664
|
const cellContainer = description.closest(`.${this.CELL_CONTAINER_WITH_DESCRIPTION_STRING}`);
|
649
|
-
const typography = cellContainer.querySelector(this.IC_TYPOGRAPHY_STRING);
|
665
|
+
const typography = cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.querySelector(this.IC_TYPOGRAPHY_STRING);
|
650
666
|
const descriptionMarginTop = window
|
651
667
|
.getComputedStyle(description)
|
652
668
|
.getPropertyValue("margin-top");
|
653
669
|
const descriptionHeight = description.clientHeight + parseInt(descriptionMarginTop, 10);
|
654
|
-
if (
|
670
|
+
if (typography &&
|
671
|
+
cellContainer &&
|
672
|
+
this.globalRowHeight &&
|
673
|
+
this.globalRowHeight !== "auto") {
|
655
674
|
if (!typography.textContent &&
|
656
675
|
descriptionHeight + this.DEFAULT_LINE_HEIGHT > this.globalRowHeight) {
|
657
676
|
this.updateRowHeightForDescriptions(descriptionHeight, cellContainer);
|
@@ -659,7 +678,7 @@ const DataTable = class {
|
|
659
678
|
else if (this.truncationPattern === this.TOOLTIP_STRING) {
|
660
679
|
if (descriptionHeight + this.DEFAULT_LINE_HEIGHT >
|
661
680
|
this.globalRowHeight) {
|
662
|
-
const cellIcon = cellContainer
|
681
|
+
const cellIcon = cellContainer.querySelector(".icon");
|
663
682
|
if (helpers.deviceSizeMatches(helpers.IC_DEVICE_SIZES.XS) && cellIcon) {
|
664
683
|
// recalculate descriptionHeight as when a word break occurs this value changes
|
665
684
|
// Additional spacing given for 300-400% zoom
|
@@ -676,7 +695,8 @@ const DataTable = class {
|
|
676
695
|
// isn't overflowing the cell to trigger the show more button to appear.
|
677
696
|
}
|
678
697
|
else if (this.truncationPattern === this.SHOW_HIDE_STRING &&
|
679
|
-
descriptionHeight + this.DEFAULT_LINE_HEIGHT >
|
698
|
+
descriptionHeight + this.DEFAULT_LINE_HEIGHT >
|
699
|
+
this.globalRowHeight &&
|
680
700
|
typography.style.getPropertyValue("--truncation-max-lines") !==
|
681
701
|
"initial") {
|
682
702
|
this.updateRowHeightForDescriptions(descriptionHeight + this.DEFAULT_LINE_HEIGHT, cellContainer);
|
@@ -704,40 +724,36 @@ const DataTable = class {
|
|
704
724
|
return tableHostDimensions;
|
705
725
|
};
|
706
726
|
this.fixCellTooltip = (element) => {
|
707
|
-
var _a, _b
|
708
|
-
let tooltip;
|
727
|
+
var _a, _b;
|
728
|
+
let tooltip = null;
|
729
|
+
const tooltipChildElement = (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(this.IC_TOOLTIP_STRING);
|
709
730
|
if (element.tagName === "IC-TOOLTIP") {
|
710
731
|
tooltip = element;
|
711
732
|
}
|
712
|
-
else if (
|
713
|
-
tooltip =
|
714
|
-
}
|
715
|
-
else {
|
716
|
-
if (((_c = element.children) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
717
|
-
Array.from(element.children).forEach((el) => {
|
718
|
-
this.fixCellTooltip(el);
|
719
|
-
});
|
720
|
-
}
|
721
|
-
else {
|
722
|
-
return;
|
723
|
-
}
|
733
|
+
else if (tooltipChildElement) {
|
734
|
+
tooltip = tooltipChildElement;
|
724
735
|
}
|
725
|
-
if (
|
726
|
-
|
727
|
-
|
736
|
+
else if (((_b = element.children) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
737
|
+
Array.from(element.children).forEach((el) => {
|
738
|
+
this.fixCellTooltip(el);
|
728
739
|
});
|
729
740
|
}
|
741
|
+
else {
|
742
|
+
return;
|
743
|
+
}
|
744
|
+
tooltip === null || tooltip === void 0 ? void 0 : tooltip.setExternalPopperProps({
|
745
|
+
strategy: "fixed",
|
746
|
+
});
|
730
747
|
};
|
731
748
|
this.fixCellTooltips = () => {
|
732
|
-
|
733
|
-
|
749
|
+
var _a, _b, _c, _d;
|
750
|
+
(_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".data-type-element")) === null || _b === void 0 ? void 0 : _b.forEach((element) => {
|
734
751
|
const slotElements = helpers.getSlotElements(element);
|
735
752
|
slotElements === null || slotElements === void 0 ? void 0 : slotElements.forEach((slottedEl) => {
|
736
753
|
this.fixCellTooltip(slottedEl);
|
737
754
|
});
|
738
755
|
});
|
739
|
-
|
740
|
-
actionElements === null || actionElements === void 0 ? void 0 : actionElements.forEach((actionElementSpan) => {
|
756
|
+
(_d = (_c = this.el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelectorAll(".action-element")) === null || _d === void 0 ? void 0 : _d.forEach((actionElementSpan) => {
|
741
757
|
const actionElement = actionElementSpan.firstChild;
|
742
758
|
if (actionElement) {
|
743
759
|
this.fixCellTooltip(actionElement);
|
@@ -745,7 +761,7 @@ const DataTable = class {
|
|
745
761
|
});
|
746
762
|
};
|
747
763
|
this.handleClick = (event, callback) => callback(event);
|
748
|
-
this.renderTableBody = (
|
764
|
+
this.renderTableBody = (loading, data, overlay) => {
|
749
765
|
if (!(data === null || data === void 0 ? void 0 : data.length))
|
750
766
|
return;
|
751
767
|
if (overlay && loading) {
|
@@ -764,7 +780,7 @@ const DataTable = class {
|
|
764
780
|
return (index.h(index.Fragment, null, index.h("div", { class: "loading-overlay", ref: (el) => (this.loadingOverlay = el) }), index.h("ic-loading-indicator", { theme: this.theme, monochrome: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.monochrome, class: {
|
765
781
|
"loading-empty": isLoading,
|
766
782
|
loading: true,
|
767
|
-
}, description: loadingOptions.description || "Loading table data", label: loadingOptions.label || "Loading...", labelDuration: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.labelDuration, max: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.max, min: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.min, progress: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.progress, ref: (el) => (this.loadingIndicator = el) })));
|
783
|
+
}, description: (loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.description) || "Loading table data", label: (loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.label) || "Loading...", labelDuration: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.labelDuration, max: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.max, min: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.min, progress: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.progress, ref: (el) => (this.loadingIndicator = el) })));
|
768
784
|
};
|
769
785
|
this.renderAriaLiveLoading = () => {
|
770
786
|
var _a, _b;
|
@@ -778,7 +794,7 @@ const DataTable = class {
|
|
778
794
|
return "";
|
779
795
|
}
|
780
796
|
};
|
781
|
-
this.renderEmptyState = (
|
797
|
+
this.renderEmptyState = (loading, data, overlay) => {
|
782
798
|
const emptyStateEl = helpers.isSlotUsed(this.el, "empty-state") ? (index.h("slot", { name: "empty-state" })) : (index.h("ic-empty-state", { aligned: "center", heading: "No Data", class: "loading-empty" }));
|
783
799
|
if (loading && !(data === null || data === void 0 ? void 0 : data.length) && overlay) {
|
784
800
|
return emptyStateEl;
|
@@ -792,16 +808,15 @@ const DataTable = class {
|
|
792
808
|
};
|
793
809
|
}
|
794
810
|
headerTruncationChangeHandler() {
|
811
|
+
var _a, _b;
|
795
812
|
if (this.columnHeaderTruncation) {
|
796
813
|
this.prevTableContainerWidth = 0;
|
797
814
|
}
|
798
815
|
else {
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
tooltip.classList.remove(this.SHOW_TRUNC_TOOLTIP_STRING);
|
804
|
-
}
|
816
|
+
(_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll("th.column-header")) === null || _b === void 0 ? void 0 : _b.forEach((header) => {
|
817
|
+
var _a;
|
818
|
+
(_a = header
|
819
|
+
.querySelector(this.IC_TOOLTIP_STRING)) === null || _a === void 0 ? void 0 : _a.classList.remove(this.SHOW_TRUNC_TOOLTIP_STRING);
|
805
820
|
});
|
806
821
|
}
|
807
822
|
}
|
@@ -821,14 +836,17 @@ const DataTable = class {
|
|
821
836
|
this.previousItemsPerPage = this.rowsPerPage;
|
822
837
|
}
|
823
838
|
componentDidLoad() {
|
824
|
-
|
825
|
-
const
|
839
|
+
var _a, _b;
|
840
|
+
const tableElement = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("table");
|
841
|
+
const tableContainer = (_b = this.el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(".table-container");
|
826
842
|
helpers.checkResizeObserver(this.runHeaderResizeObserver);
|
827
843
|
if (this.dataUpdated) {
|
828
844
|
this.dataUpdated = false;
|
829
845
|
}
|
830
|
-
if (
|
831
|
-
|
846
|
+
if (tableElement &&
|
847
|
+
tableContainer &&
|
848
|
+
(tableElement.clientHeight > tableContainer.clientHeight ||
|
849
|
+
tableElement.clientWidth > tableContainer.clientWidth)) {
|
832
850
|
this.scrollable = true;
|
833
851
|
}
|
834
852
|
if (this.loading) {
|
@@ -838,7 +856,8 @@ const DataTable = class {
|
|
838
856
|
if (this.truncationPattern) {
|
839
857
|
this.getTypographyElements().forEach((typographyEl) => {
|
840
858
|
const cellContainer = this.getCellContainer(typographyEl);
|
841
|
-
if (
|
859
|
+
if (cellContainer &&
|
860
|
+
!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {
|
842
861
|
this.dataTruncation(typographyEl);
|
843
862
|
}
|
844
863
|
});
|
@@ -863,19 +882,23 @@ const DataTable = class {
|
|
863
882
|
this.adjustWidthForActionElement();
|
864
883
|
}
|
865
884
|
truncateUpdatedData() {
|
885
|
+
var _a;
|
866
886
|
if (this.dataUpdated) {
|
867
887
|
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
868
888
|
this.getTypographyElements().forEach((typographyEl) => {
|
869
889
|
const truncWrapper = this.getTruncWrapper(typographyEl);
|
870
890
|
const cellContainer = this.getCellContainer(typographyEl);
|
871
|
-
if (
|
872
|
-
|
891
|
+
if (truncWrapper &&
|
892
|
+
cellContainer &&
|
893
|
+
cellContainer.clientHeight - this.DEFAULT_LINE_HEIGHT >=
|
894
|
+
truncWrapper.scrollHeight) {
|
873
895
|
this.resetShowHideTruncation(typographyEl);
|
874
896
|
return;
|
875
897
|
}
|
876
898
|
setTimeout(() => {
|
877
899
|
// slight delay due to data rendering
|
878
|
-
if (
|
900
|
+
if (cellContainer &&
|
901
|
+
typographyEl.scrollHeight > cellContainer.clientHeight) {
|
879
902
|
this.addShowHideTruncation(cellContainer, typographyEl);
|
880
903
|
}
|
881
904
|
}, 150);
|
@@ -893,13 +916,15 @@ const DataTable = class {
|
|
893
916
|
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
894
917
|
this.getTypographyElements().forEach((typographyEl) => {
|
895
918
|
const cellContainer = this.getCellContainer(typographyEl);
|
896
|
-
if (
|
897
|
-
this.
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
919
|
+
if (cellContainer) {
|
920
|
+
if (!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {
|
921
|
+
this.createShowHideTruncation(typographyEl, cellContainer);
|
922
|
+
}
|
923
|
+
else {
|
924
|
+
typographyEl.resetTruncation().then(() => {
|
925
|
+
cellContainer.removeAttribute("style");
|
926
|
+
});
|
927
|
+
}
|
903
928
|
}
|
904
929
|
});
|
905
930
|
}
|
@@ -908,49 +933,48 @@ const DataTable = class {
|
|
908
933
|
// This function recalculates the tooltip truncation when the rowHeight has been set.
|
909
934
|
// This is in componentDidUpdate so a setTimeout is not used to wait for the render to be complete
|
910
935
|
if (this.rowHeightSet) {
|
911
|
-
const fontSize = parseInt(getComputedStyle(document.documentElement).fontSize);
|
912
|
-
const hasAutoRowHeight = this.globalRowHeight === "auto";
|
913
936
|
this.getTypographyElements().forEach((typographyEl) => {
|
914
|
-
var _a;
|
937
|
+
var _a, _b;
|
915
938
|
const cellContainer = this.getCellContainer(typographyEl);
|
916
939
|
const tooltipEl = this.getTooltip(typographyEl);
|
917
|
-
if (
|
918
|
-
|
919
|
-
|
920
|
-
this.
|
921
|
-
|
940
|
+
if (cellContainer) {
|
941
|
+
if (this.globalRowHeight === "auto") {
|
942
|
+
cellContainer.style.height = "";
|
943
|
+
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
944
|
+
this.removeTooltip(cellContainer, typographyEl, tooltipEl);
|
945
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: 0`);
|
946
|
+
}
|
947
|
+
else if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
948
|
+
this.resetShowHideTruncation(typographyEl);
|
949
|
+
}
|
950
|
+
return;
|
922
951
|
}
|
923
|
-
|
924
|
-
|
952
|
+
// If the set row height is bigger than the cell container even
|
953
|
+
// with textWrap, set the row height
|
954
|
+
if (!cellContainer.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING) &&
|
955
|
+
!((_a = cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.style) === null || _a === void 0 ? void 0 : _a.height) &&
|
956
|
+
this.getRowHeight(cellContainer) > cellContainer.clientHeight &&
|
957
|
+
!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {
|
958
|
+
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
925
959
|
}
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
if (this.truncationPattern) {
|
939
|
-
// If the set row height is bigger than the typography truncation wrapper
|
940
|
-
// scroll height, remove see more / see less button
|
941
|
-
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
942
|
-
const truncWrapper = this.getTruncWrapper(typographyEl);
|
943
|
-
const showHideBtn = typographyEl.shadowRoot.querySelector("button");
|
944
|
-
if (showHideBtn &&
|
945
|
-
(truncWrapper === null || truncWrapper === void 0 ? void 0 : truncWrapper.scrollHeight) <= cellContainer.clientHeight) {
|
946
|
-
this.resetShowHideTruncation(typographyEl);
|
947
|
-
return;
|
960
|
+
if (this.truncationPattern) {
|
961
|
+
// If the set row height is bigger than the typography truncation wrapper
|
962
|
+
// scroll height, remove see more / see less button
|
963
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
964
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
965
|
+
const showHideBtn = (_b = typographyEl.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("button");
|
966
|
+
if (showHideBtn &&
|
967
|
+
truncWrapper &&
|
968
|
+
truncWrapper.scrollHeight <= cellContainer.clientHeight) {
|
969
|
+
this.resetShowHideTruncation(typographyEl);
|
970
|
+
return;
|
971
|
+
}
|
948
972
|
}
|
973
|
+
this.truncate(typographyEl, cellContainer, tooltipEl);
|
974
|
+
}
|
975
|
+
else {
|
976
|
+
this.updateSetRowHeight(typographyEl);
|
949
977
|
}
|
950
|
-
this.truncate(typographyEl, cellContainer, tooltipEl);
|
951
|
-
}
|
952
|
-
else {
|
953
|
-
this.updateSetRowHeight(typographyEl);
|
954
978
|
}
|
955
979
|
});
|
956
980
|
this.rowHeightSet = false;
|
@@ -958,16 +982,15 @@ const DataTable = class {
|
|
958
982
|
// Only run truncation on the new rows
|
959
983
|
// when the number of items per page has increased
|
960
984
|
if (this.itemsPerPageChange) {
|
961
|
-
const allRows = this.el.shadowRoot.querySelectorAll(".table-row");
|
962
|
-
if (this.rowsPerPage > this.previousItemsPerPage) {
|
985
|
+
const allRows = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".table-row");
|
986
|
+
if (allRows && this.rowsPerPage > this.previousItemsPerPage) {
|
963
987
|
const newRows = Array.from(allRows).slice(this.previousItemsPerPage);
|
964
988
|
newRows.forEach((row) => {
|
965
|
-
row
|
966
|
-
.querySelectorAll(this.IC_TYPOGRAPHY_STRING)
|
967
|
-
.forEach((typographyEl) => {
|
989
|
+
row.querySelectorAll("ic-typography").forEach((typographyEl) => {
|
968
990
|
const cellContainer = this.getCellContainer(typographyEl);
|
969
991
|
const tooltipEl = this.getTooltip(typographyEl);
|
970
|
-
|
992
|
+
if (cellContainer)
|
993
|
+
this.truncate(typographyEl, cellContainer, tooltipEl);
|
971
994
|
});
|
972
995
|
});
|
973
996
|
}
|
@@ -981,9 +1004,11 @@ const DataTable = class {
|
|
981
1004
|
// set truncation to see more if opened and next/previous page is pressed
|
982
1005
|
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
983
1006
|
this.getTypographyElements().forEach((typographyEl) => {
|
1007
|
+
var _a;
|
984
1008
|
const cellContainer = this.getCellContainer(typographyEl);
|
985
|
-
const showHideBtn = typographyEl.shadowRoot.querySelector("button");
|
986
|
-
if (
|
1009
|
+
const showHideBtn = (_a = typographyEl.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("button");
|
1010
|
+
if (cellContainer &&
|
1011
|
+
(typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > cellContainer.clientHeight &&
|
987
1012
|
!showHideBtn) {
|
988
1013
|
this.addShowHideTruncation(cellContainer, typographyEl);
|
989
1014
|
}
|
@@ -995,7 +1020,8 @@ const DataTable = class {
|
|
995
1020
|
this.getTypographyElements().forEach((typographyEl) => {
|
996
1021
|
const cellContainer = this.getCellContainer(typographyEl);
|
997
1022
|
const tooltipEl = this.getTooltip(typographyEl);
|
998
|
-
|
1023
|
+
if (cellContainer)
|
1024
|
+
this.truncate(typographyEl, cellContainer, tooltipEl);
|
999
1025
|
});
|
1000
1026
|
this.densityUpdate = false;
|
1001
1027
|
}
|
@@ -1004,7 +1030,8 @@ const DataTable = class {
|
|
1004
1030
|
this.getTypographyElements().forEach((typographyEl) => {
|
1005
1031
|
const cellContainer = this.getCellContainer(typographyEl);
|
1006
1032
|
const tooltipEl = this.getTooltip(typographyEl);
|
1007
|
-
if (
|
1033
|
+
if (cellContainer &&
|
1034
|
+
typographyEl.scrollHeight > cellContainer.clientHeight) {
|
1008
1035
|
this.addTooltipTruncation(typographyEl, cellContainer, tooltipEl);
|
1009
1036
|
}
|
1010
1037
|
});
|
@@ -1013,29 +1040,24 @@ const DataTable = class {
|
|
1013
1040
|
this.getTypographyElements().forEach((typographyEl) => {
|
1014
1041
|
const truncWrapper = this.getTruncWrapper(typographyEl);
|
1015
1042
|
const cellContainer = this.getCellContainer(typographyEl);
|
1016
|
-
if (
|
1017
|
-
(truncWrapper
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1043
|
+
if (cellContainer) {
|
1044
|
+
if (truncWrapper &&
|
1045
|
+
(cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) - this.DEFAULT_LINE_HEIGHT >
|
1046
|
+
truncWrapper.scrollHeight) {
|
1047
|
+
this.resetShowHideTruncation(typographyEl);
|
1048
|
+
return;
|
1049
|
+
}
|
1050
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
|
1051
|
+
this.addShowHideTruncation(cellContainer, typographyEl);
|
1052
|
+
}
|
1023
1053
|
}
|
1024
1054
|
});
|
1025
1055
|
}
|
1026
1056
|
}
|
1027
1057
|
}
|
1028
|
-
createShowHideTruncation(typographyEl, cellContainer, descriptionHeight) {
|
1058
|
+
createShowHideTruncation(typographyEl, cellContainer, descriptionHeight = 0) {
|
1029
1059
|
typographyEl.checkMaxLines(typographyEl.scrollHeight);
|
1030
|
-
typographyEl.setAttribute("max-lines", `${
|
1031
|
-
if (cellContainer.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING) &&
|
1032
|
-
descriptionHeight) {
|
1033
|
-
typographyEl.setAttribute("max-lines", `${Math.floor(((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) - descriptionHeight) /
|
1034
|
-
this.DEFAULT_LINE_HEIGHT)}`);
|
1035
|
-
}
|
1036
|
-
else {
|
1037
|
-
typographyEl.setAttribute("max-lines", `${Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT)}`);
|
1038
|
-
}
|
1060
|
+
typographyEl.setAttribute("max-lines", `${this.getLines(cellContainer.clientHeight - descriptionHeight)}`);
|
1039
1061
|
typographyEl.setShowHideExpanded(false);
|
1040
1062
|
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, null);
|
1041
1063
|
}
|
@@ -1054,26 +1076,30 @@ const DataTable = class {
|
|
1054
1076
|
handleTypographyTruncationExpandToggle({ detail, }) {
|
1055
1077
|
const { expanded, typographyEl } = detail;
|
1056
1078
|
const cellContainer = this.getCellContainer(typographyEl);
|
1057
|
-
if (cellContainer.style.getPropertyValue(this.ROW_HEIGHT_CSS_VARIABLE) &&
|
1079
|
+
if ((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.style.getPropertyValue(this.ROW_HEIGHT_CSS_VARIABLE)) &&
|
1058
1080
|
expanded) {
|
1059
1081
|
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, "inherit");
|
1060
1082
|
}
|
1061
1083
|
}
|
1062
1084
|
handlePageChange({ detail, target }) {
|
1085
|
+
var _a;
|
1063
1086
|
if (target.parentElement !== this.el) {
|
1064
1087
|
this.fromRow = (detail.value - 1) * this.rowsPerPage;
|
1065
1088
|
this.toRow = this.fromRow + this.rowsPerPage;
|
1066
|
-
const tableRowsContainer = this.el.shadowRoot.querySelector(".table-row-container");
|
1067
|
-
if (
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1089
|
+
const tableRowsContainer = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".table-row-container");
|
1090
|
+
if (tableRowsContainer) {
|
1091
|
+
if (this.previousRowsPerPage === this.rowsPerPage) {
|
1092
|
+
tableRowsContainer.scrollTop = 0;
|
1093
|
+
}
|
1094
|
+
else if (this.previousRowsPerPage < this.rowsPerPage) {
|
1095
|
+
tableRowsContainer.scrollTop = this.scrollOffset;
|
1096
|
+
this.previousRowsPerPage = this.rowsPerPage;
|
1097
|
+
}
|
1098
|
+
else {
|
1099
|
+
this.previousRowsPerPage = this.rowsPerPage;
|
1100
|
+
}
|
1076
1101
|
}
|
1102
|
+
this.selectedRows = [];
|
1077
1103
|
}
|
1078
1104
|
if (!this.initialLoad && this.previousPaginationPage !== detail.value) {
|
1079
1105
|
// This is to prevent icPageChange from triggering truncation on first load
|
@@ -1092,10 +1118,6 @@ const DataTable = class {
|
|
1092
1118
|
handleDensityChange(ev) {
|
1093
1119
|
this.density = ev.detail.value;
|
1094
1120
|
}
|
1095
|
-
clickListener(ev) {
|
1096
|
-
if (ev.target !== this.el)
|
1097
|
-
this.selectedRow = undefined;
|
1098
|
-
}
|
1099
1121
|
loadingHandler(newValue) {
|
1100
1122
|
if (newValue)
|
1101
1123
|
this.startLoadingTimer();
|
@@ -1113,7 +1135,8 @@ const DataTable = class {
|
|
1113
1135
|
this.getTypographyElements().forEach((typographyEl) => {
|
1114
1136
|
const cellContainer = this.getCellContainer(typographyEl);
|
1115
1137
|
const tooltip = this.getTooltip(typographyEl);
|
1116
|
-
|
1138
|
+
if (cellContainer)
|
1139
|
+
this.truncate(typographyEl, cellContainer, tooltip);
|
1117
1140
|
});
|
1118
1141
|
}
|
1119
1142
|
if (newValue === this.SHOW_HIDE_STRING) {
|
@@ -1123,17 +1146,20 @@ const DataTable = class {
|
|
1123
1146
|
this.getTypographyElements().forEach((typographyEl) => {
|
1124
1147
|
const truncWrapper = this.getTruncWrapper(typographyEl);
|
1125
1148
|
const cellContainer = this.getCellContainer(typographyEl);
|
1126
|
-
if (
|
1127
|
-
(truncWrapper
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
// slight delay due to data rendering
|
1133
|
-
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
|
1134
|
-
this.addShowHideTruncation(cellContainer, typographyEl);
|
1149
|
+
if (cellContainer) {
|
1150
|
+
if (truncWrapper &&
|
1151
|
+
cellContainer.clientHeight - this.DEFAULT_LINE_HEIGHT >
|
1152
|
+
truncWrapper.scrollHeight) {
|
1153
|
+
this.resetShowHideTruncation(typographyEl);
|
1154
|
+
return;
|
1135
1155
|
}
|
1136
|
-
|
1156
|
+
setTimeout(() => {
|
1157
|
+
// slight delay due to data rendering
|
1158
|
+
if (typographyEl.scrollHeight > cellContainer.clientHeight) {
|
1159
|
+
this.addShowHideTruncation(cellContainer, typographyEl);
|
1160
|
+
}
|
1161
|
+
}, 150);
|
1162
|
+
}
|
1137
1163
|
});
|
1138
1164
|
}
|
1139
1165
|
this.truncationPatternUpdated = true;
|
@@ -1157,10 +1183,12 @@ const DataTable = class {
|
|
1157
1183
|
if (typographyEl) {
|
1158
1184
|
const truncWrapper = this.getTruncWrapper(typographyEl);
|
1159
1185
|
const cellContainer = this.getCellContainer(typographyEl);
|
1160
|
-
if ((
|
1186
|
+
if (!(cellContainer && truncWrapper))
|
1187
|
+
return;
|
1188
|
+
if (truncWrapper.scrollHeight > cellContainer.clientHeight &&
|
1161
1189
|
!helpers.isEmptyString(typographyEl.getAttribute("max-lines")) &&
|
1162
1190
|
Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT) !==
|
1163
|
-
|
1191
|
+
Number(typographyEl.getAttribute("max-lines"))) {
|
1164
1192
|
typographyEl.checkMaxLines(truncWrapper.scrollHeight);
|
1165
1193
|
typographyEl.setAttribute("max-lines", `${Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT)}`);
|
1166
1194
|
typographyEl.setShowHideExpanded(false);
|
@@ -1178,7 +1206,7 @@ const DataTable = class {
|
|
1178
1206
|
this.getTypographyElements().forEach((typographyEl) => {
|
1179
1207
|
const cellContainer = this.getCellContainer(typographyEl);
|
1180
1208
|
typographyEl.resetTruncation().then(() => {
|
1181
|
-
if (!typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
1209
|
+
if (cellContainer && !typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
1182
1210
|
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
1183
1211
|
}
|
1184
1212
|
});
|
@@ -1199,7 +1227,7 @@ const DataTable = class {
|
|
1199
1227
|
*/
|
1200
1228
|
async resetRowHeights(rowHeight) {
|
1201
1229
|
this.globalRowHeight = rowHeight || "auto";
|
1202
|
-
this.variableRowHeight =
|
1230
|
+
this.variableRowHeight = undefined;
|
1203
1231
|
}
|
1204
1232
|
showLoadingIndicator() {
|
1205
1233
|
var _a, _b, _c;
|
@@ -1243,35 +1271,28 @@ const DataTable = class {
|
|
1243
1271
|
}
|
1244
1272
|
}
|
1245
1273
|
removeTooltip(cellContainer, typographyEl, tooltip) {
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
}
|
1274
|
+
var _a;
|
1275
|
+
(_a = cellContainer
|
1276
|
+
.querySelector(this.CELL_TEXT_WRAPPER_STRING)) === null || _a === void 0 ? void 0 : _a.prepend(typographyEl);
|
1277
|
+
tooltip === null || tooltip === void 0 ? void 0 : tooltip.remove();
|
1251
1278
|
}
|
1252
1279
|
addLineClampCSS(typographyEl, cellContainer) {
|
1253
1280
|
var _a, _b;
|
1254
1281
|
const descriptionCellHeight = (_a = cellContainer.querySelector(this.CELL_DESCRIPTION_STRING)) === null || _a === void 0 ? void 0 : _a.clientHeight;
|
1282
|
+
const cellContainerHeight = cellContainer.clientHeight;
|
1283
|
+
let totalHeight = cellContainerHeight;
|
1255
1284
|
if (cellContainer.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING) &&
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
else {
|
1263
|
-
iconHeight = 0;
|
1264
|
-
}
|
1265
|
-
const height = (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) -
|
1266
|
-
((_b = cellContainer.querySelector(this.CELL_DESCRIPTION_STRING)) === null || _b === void 0 ? void 0 : _b.clientHeight) -
|
1267
|
-
iconHeight;
|
1268
|
-
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: ${this.getLines(height || 0)}`);
|
1269
|
-
}
|
1270
|
-
else {
|
1271
|
-
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: ${this.getLines(cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)}`);
|
1285
|
+
descriptionCellHeight &&
|
1286
|
+
cellContainerHeight > descriptionCellHeight) {
|
1287
|
+
const iconHeight = (helpers.deviceSizeMatches(helpers.IC_DEVICE_SIZES.XS) &&
|
1288
|
+
((_b = cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.querySelector(".icon")) === null || _b === void 0 ? void 0 : _b.clientHeight)) ||
|
1289
|
+
0;
|
1290
|
+
totalHeight = totalHeight - descriptionCellHeight - iconHeight;
|
1272
1291
|
}
|
1292
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: ${this.getLines(totalHeight || 0)}`);
|
1273
1293
|
}
|
1274
1294
|
createTruncationTooltip(typographyEl, cellContainer) {
|
1295
|
+
var _a;
|
1275
1296
|
const tooltipEl = document.createElement(this.IC_TOOLTIP_STRING);
|
1276
1297
|
tooltipEl.setAttribute("target", typographyEl.id);
|
1277
1298
|
tooltipEl.setAttribute("label", typographyEl.textContent);
|
@@ -1280,25 +1301,38 @@ const DataTable = class {
|
|
1280
1301
|
// This might need reverting back to absolute if the tooltip doesn't dynamically position itself correctly
|
1281
1302
|
strategy: "fixed",
|
1282
1303
|
});
|
1283
|
-
|
1284
|
-
|
1304
|
+
(_a = cellContainer
|
1305
|
+
.querySelector(this.CELL_TEXT_WRAPPER_STRING)) === null || _a === void 0 ? void 0 : _a.prepend(tooltipEl);
|
1285
1306
|
tooltipEl.prepend(typographyEl);
|
1286
1307
|
}
|
1287
1308
|
render() {
|
1288
1309
|
var _a, _b;
|
1289
|
-
const { caption, createColumnHeaders, createUpdatingIndicator, data, hideColumnHeaders, loading, loadingOptions, paginationBarOptions, scrollable, scrollOffset, showPagination, sortable, sortedColumn, sortedColumnOrder, stickyColumnHeaders, updateScrollOffset, updating, theme, } = this;
|
1290
|
-
|
1310
|
+
const { caption, columns, createColumnHeaders, createUpdatingIndicator, data, density, hideColumnHeaders, rowSelection, loading, loadingOptions, paginationBarOptions, rowsPerPage, scrollable, scrollOffset, selectAllRows, selectedRows, showPagination, sortable, sortedColumn, sortedColumnOrder, stickyColumnHeaders, updateScrollOffset, updating, tableLayout, theme, } = this;
|
1311
|
+
const rowsSelected = selectedRows.length > 0;
|
1312
|
+
const allRowsSelected = selectedRows.length === (showPagination ? rowsPerPage : data === null || data === void 0 ? void 0 : data.length);
|
1313
|
+
const headerCheckboxLabelState = rowsSelected
|
1314
|
+
? allRowsSelected
|
1315
|
+
? "deselect all"
|
1316
|
+
: "select all remaining"
|
1317
|
+
: "select all";
|
1318
|
+
return (index.h(index.Host, { key: 'c70d98425c01e5f0d7b23d12a0a22fcde6bfa8aa', style: Object.assign({}, this.setTableDimensions()), class: { [`ic-theme-${theme}`]: theme !== "inherit" } }, index.h("div", { key: 'b7411965f1bd64038922da836d86791d9fce0766', class: "table-container" }, helpers.isSlotUsed(this.el, "title-bar") && index.h("slot", { key: 'de14d3c9613fc5f216f9318c8b584a4fe6d7d0b9', name: "title-bar" }), index.h("div", { key: 'c28d8074bb81266c7104ce842b2ea0e415ea7576', class: {
|
1291
1319
|
["table-row-container"]: true,
|
1292
1320
|
scrollable,
|
1293
|
-
}, tabIndex: scrollable ? 0 :
|
1294
|
-
|
1295
|
-
} }, index.h("caption", { key: '
|
1321
|
+
}, tabIndex: scrollable ? 0 : undefined, onScroll: updateScrollOffset }, index.h("table", { key: '283aac0915752eb13c7651fe2594cbbce7eb1164', style: {
|
1322
|
+
"--table-layout": tableLayout,
|
1323
|
+
} }, index.h("caption", { key: '9d49941bb4a1f14337af61c35057895a32466c0e', class: "table-caption" }, caption), !hideColumnHeaders && (index.h("thead", { key: '970d0ecda5d04b06b394f0f1cf1e58dfdd93660f', class: {
|
1296
1324
|
["column-header-sticky"]: stickyColumnHeaders,
|
1297
1325
|
["column-header-overlay"]: stickyColumnHeaders && scrollOffset !== 0,
|
1298
|
-
} }, index.h("tr", { key: '
|
1326
|
+
} }, index.h("tr", { key: 'dd2b7e0e731a8652d726b98c4d4b53de1d4bc89a' }, rowSelection && data && (index.h("th", { key: 'd1c97faa5830737aa4c9d7020b7bf89a2357d127', class: {
|
1327
|
+
"column-header": true,
|
1328
|
+
"checkbox-cell": true,
|
1329
|
+
"updating-state-headers": updating && !loading,
|
1330
|
+
[`table-density-${density}`]: this.notDefaultDensity(),
|
1331
|
+
} }, index.h("div", { key: '93aad327435bc6bc944fc3c7e141c0281beb421b', class: "checkbox-wrapper" }, index.h("ic-checkbox", { key: '9f984d73bf5172d756d1553c631a571adad238f6', class: "ic-data-table-checkbox", checked: rowsSelected && allRowsSelected, disabled: updating || loading, hideLabel: true, indeterminate: rowsSelected && !allRowsSelected, label: `${caption} ${headerCheckboxLabelState} rows`, nativeIndeterminateBehaviour: true, onIcCheck: () => selectAllRows(), size: density === "dense" ? "small" : "medium", value: caption })))), createColumnHeaders()))), updating &&
|
1299
1332
|
!loading &&
|
1300
|
-
(hideColumnHeaders ? (index.h("thead", null, createUpdatingIndicator())) : (createUpdatingIndicator())), this.renderTableBody(
|
1301
|
-
? `${((_b =
|
1333
|
+
(hideColumnHeaders ? (index.h("thead", null, createUpdatingIndicator())) : (createUpdatingIndicator())), this.renderTableBody(loading, data, loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.overlay)), this.renderEmptyState(loading, data, loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.overlay)), index.h("div", { key: '3b3d4811530dabad832180f06631b32724b7c3c8', "aria-live": "assertive", class: "sr-only" }, this.renderAriaLiveLoading()), this.renderLoadingIndicator(loading, loadingOptions), (showPagination || helpers.isSlotUsed(this.el, "pagination-bar")) && (index.h("div", { key: '4efe794f7f5e48ff1ad762780b5a8e3f291cb8f0', class: "pagination-container" }, helpers.isSlotUsed(this.el, "pagination-bar") ? (index.h("slot", { name: "pagination-bar" })) : (index.h("ic-pagination-bar", { alignment: paginationBarOptions.alignment, hideAllFromItemsPerPage: paginationBarOptions.hideAllFromItemsPerPage, hideRangeLabel: paginationBarOptions.hideRangeLabel, itemLabel: paginationBarOptions.itemLabel, itemsPerPageOptions: paginationBarOptions.itemsPerPageOptions, monochrome: paginationBarOptions.monochrome, pageLabel: paginationBarOptions.pageLabel, rangeLabelType: paginationBarOptions.rangeLabelType, selectedItemsPerPage: paginationBarOptions.selectedItemsPerPage, setToFirstPageOnPaginationChange: paginationBarOptions.setToFirstPageOnPaginationChange, showGoToPageControl: paginationBarOptions.showGoToPageControl, showItemsPerPageControl: paginationBarOptions.showItemsPerPageControl, theme: theme, totalItems: (_a = data === null || data === void 0 ? void 0 : data.length) !== null && _a !== void 0 ? _a : 0, type: paginationBarOptions.type })))), sortable && (index.h("div", { key: '2eadf2de56bcbccfdb70707846a5eaa920cba050', class: "screen-reader-sort-text", "aria-live": "polite" }, sortedColumnOrder !== "unsorted" && sortedColumn
|
1334
|
+
? `${((_b = columns.find((col) => col.key === sortedColumn)) === null || _b === void 0 ? void 0 : _b.title) ||
|
1335
|
+
sortedColumn} sorted ${sortedColumnOrder}`
|
1302
1336
|
: "table unsorted")))));
|
1303
1337
|
}
|
1304
1338
|
get el() { return index.getElement(this); }
|