@ukic/canary-web-components 3.0.0-canary.5 → 3.0.0-canary.8
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-c80f6ce4.js → helpers-02b23286.js} +41 -19
- package/dist/cjs/helpers-02b23286.js.map +1 -0
- package/dist/cjs/{helpers-55099147.js → helpers-4190b7f2.js} +56 -29
- package/dist/cjs/helpers-4190b7f2.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +8 -1
- package/dist/cjs/ic-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +3 -10
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +2 -2
- package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +10 -7
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-horizontal.cjs.entry.js +18 -15
- package/dist/cjs/ic-card-horizontal.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-vertical.cjs.entry.js +26 -24
- package/dist/cjs/ic-card-vertical.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +5 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +5 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +9 -4
- package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-table.cjs.entry.js +277 -100
- package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-input.cjs.entry.js +7 -2
- package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-picker.cjs.entry.js +6 -1
- package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +3 -3
- package/dist/cjs/ic-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-empty-state_2.cjs.entry.js +24 -15
- package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +4 -5
- package/dist/cjs/ic-footer-link-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +4 -5
- package/dist/cjs/ic-footer-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +24 -14
- package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +7 -15
- package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +3 -3
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +39 -24
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +9 -6
- package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +7 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +6 -7
- package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +5 -6
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +4 -4
- package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination_4.cjs.entry.js +85 -42
- package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +9 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +5 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +37 -29
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +5 -5
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +6 -2
- package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab.cjs.entry.js +5 -2
- package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +20 -20
- package/dist/cjs/ic-theme.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +29 -10
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js +57 -5
- package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +10 -6
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tree-item.cjs.entry.js +14 -12
- package/dist/cjs/ic-tree-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tree-view.cjs.entry.js +17 -12
- package/dist/cjs/ic-tree-view.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.css +4 -1
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js +24 -18
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js.map +1 -1
- package/dist/collection/components/ic-card-horizontal/test/basic/ic-card-horizontal.spec.js +10 -0
- package/dist/collection/components/ic-card-horizontal/test/basic/ic-card-horizontal.spec.js.map +1 -1
- package/dist/collection/components/ic-data-table/ic-data-table.css +92 -2
- package/dist/collection/components/ic-data-table/ic-data-table.js +312 -102
- package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
- package/dist/collection/components/ic-data-table/ic-data-table.types.js.map +1 -1
- package/dist/collection/components/ic-data-table/story-data.js +293 -2
- package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
- package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js +102 -1
- package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
- package/dist/collection/components/ic-date-input/ic-date-input.css +2 -1
- package/dist/collection/components/ic-date-input/ic-date-input.js +8 -1
- package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -1
- package/dist/collection/components/ic-date-picker/ic-date-picker.js +8 -1
- package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -1
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +40 -1
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -1
- package/dist/collection/components/ic-tree-item/ic-tree-item.css +20 -3
- package/dist/collection/components/ic-tree-item/ic-tree-item.js +33 -12
- package/dist/collection/components/ic-tree-item/ic-tree-item.js.map +1 -1
- package/dist/collection/components/ic-tree-item/test/basic/ic-tree-item.spec.js +3 -0
- package/dist/collection/components/ic-tree-item/test/basic/ic-tree-item.spec.js.map +1 -1
- package/dist/collection/components/ic-tree-view/ic-tree-view.css +16 -2
- package/dist/collection/components/ic-tree-view/ic-tree-view.js +54 -11
- package/dist/collection/components/ic-tree-view/ic-tree-view.js.map +1 -1
- package/dist/collection/utils/helpers.js +42 -25
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/types.js +6 -6
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/helpers.js +51 -26
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/helpers2.js +37 -17
- package/dist/components/helpers2.js.map +1 -1
- package/dist/components/ic-accordion.js +9 -1
- package/dist/components/ic-accordion.js.map +1 -1
- package/dist/components/ic-alert.js +4 -11
- package/dist/components/ic-alert.js.map +1 -1
- package/dist/components/ic-badge.js +2 -2
- package/dist/components/ic-badge.js.map +1 -1
- package/dist/components/ic-button2.js +11 -8
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-card-horizontal.js +22 -17
- package/dist/components/ic-card-horizontal.js.map +1 -1
- package/dist/components/ic-card-vertical.js +30 -26
- package/dist/components/ic-card-vertical.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +5 -0
- package/dist/components/ic-checkbox-group.js.map +1 -1
- package/dist/components/ic-checkbox.js +5 -0
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-chip.js +11 -4
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-data-table.js +278 -100
- package/dist/components/ic-data-table.js.map +1 -1
- package/dist/components/ic-date-input2.js +8 -2
- package/dist/components/ic-date-input2.js.map +1 -1
- package/dist/components/ic-date-picker.js +7 -1
- package/dist/components/ic-date-picker.js.map +1 -1
- package/dist/components/ic-divider2.js +4 -4
- package/dist/components/ic-divider2.js.map +1 -1
- package/dist/components/ic-empty-state2.js +3 -13
- package/dist/components/ic-empty-state2.js.map +1 -1
- package/dist/components/ic-footer-link-group.js +5 -6
- package/dist/components/ic-footer-link-group.js.map +1 -1
- package/dist/components/ic-footer-link.js +5 -6
- package/dist/components/ic-footer-link.js.map +1 -1
- package/dist/components/ic-footer.js +25 -15
- package/dist/components/ic-footer.js.map +1 -1
- package/dist/components/ic-hero.js +9 -17
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-horizontal-scroll2.js +3 -3
- package/dist/components/ic-horizontal-scroll2.js.map +1 -1
- package/dist/components/ic-input-component-container2.js +15 -11
- package/dist/components/ic-input-component-container2.js.map +1 -1
- package/dist/components/ic-link2.js +10 -7
- package/dist/components/ic-link2.js.map +1 -1
- package/dist/components/ic-menu-item2.js +9 -1
- package/dist/components/ic-menu-item2.js.map +1 -1
- package/dist/components/ic-menu2.js +28 -15
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-navigation-button.js +7 -8
- package/dist/components/ic-navigation-button.js.map +1 -1
- package/dist/components/ic-navigation-group.js +6 -7
- package/dist/components/ic-navigation-group.js.map +1 -1
- package/dist/components/ic-navigation-item.js +5 -5
- package/dist/components/ic-navigation-item.js.map +1 -1
- package/dist/components/ic-navigation-menu2.js +1 -1
- package/dist/components/ic-pagination-bar2.js +25 -4
- package/dist/components/ic-pagination-bar2.js.map +1 -1
- package/dist/components/ic-pagination-item2.js +6 -1
- package/dist/components/ic-pagination-item2.js.map +1 -1
- package/dist/components/ic-pagination2.js +5 -0
- package/dist/components/ic-pagination2.js.map +1 -1
- package/dist/components/ic-popover-menu.js +1 -1
- package/dist/components/ic-radio-group.js +8 -0
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js +6 -1
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-search-bar.js +52 -54
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-select2.js +54 -35
- 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-stepper.js +1 -1
- package/dist/components/ic-switch.js +8 -3
- package/dist/components/ic-switch.js.map +1 -1
- package/dist/components/ic-tab.js +5 -2
- package/dist/components/ic-tab.js.map +1 -1
- package/dist/components/ic-text-field2.js +28 -10
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-theme.js +22 -22
- package/dist/components/ic-theme.js.map +1 -1
- package/dist/components/ic-toast.js +1 -1
- package/dist/components/ic-toggle-button-group.js +34 -11
- package/dist/components/ic-toggle-button-group.js.map +1 -1
- package/dist/components/ic-toggle-button.js +67 -13
- package/dist/components/ic-toggle-button.js.map +1 -1
- package/dist/components/ic-top-navigation.js +11 -7
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/components/ic-tree-item.js +17 -13
- package/dist/components/ic-tree-item.js.map +1 -1
- package/dist/components/ic-tree-view.js +22 -14
- package/dist/components/ic-tree-view.js.map +1 -1
- package/dist/core/core.css +78 -46
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-9da6df82.entry.js → p-01034ef4.entry.js} +2 -2
- package/dist/core/p-033f3971.entry.js +2 -0
- package/dist/core/p-033f3971.entry.js.map +1 -0
- package/dist/core/{p-f5d1e747.entry.js → p-03d51c20.entry.js} +2 -2
- package/dist/core/{p-a67c358a.entry.js → p-05890d1e.entry.js} +2 -2
- package/dist/core/{p-dd3a9cb1.entry.js → p-07bcfaef.entry.js} +2 -2
- package/dist/core/{p-a0c3f221.entry.js → p-0d918e59.entry.js} +2 -2
- package/dist/core/p-0d918e59.entry.js.map +1 -0
- package/dist/core/p-10640219.entry.js +2 -0
- package/dist/core/p-10640219.entry.js.map +1 -0
- package/dist/core/p-15e382a4.entry.js +2 -0
- package/dist/core/p-15e382a4.entry.js.map +1 -0
- package/dist/core/p-16b64836.entry.js +2 -0
- package/dist/core/p-16b64836.entry.js.map +1 -0
- package/dist/core/p-186edbae.entry.js +2 -0
- package/dist/core/p-186edbae.entry.js.map +1 -0
- package/dist/core/p-1c94e08c.entry.js +2 -0
- package/dist/core/p-1c94e08c.entry.js.map +1 -0
- package/dist/core/p-1d3f7a04.entry.js +2 -0
- package/dist/core/p-1d3f7a04.entry.js.map +1 -0
- package/dist/core/{p-10afa533.entry.js → p-22708591.entry.js} +2 -2
- package/dist/core/p-23afb7d0.entry.js +2 -0
- package/dist/core/p-23afb7d0.entry.js.map +1 -0
- package/dist/core/p-289fff24.entry.js +2 -0
- package/dist/core/p-289fff24.entry.js.map +1 -0
- package/dist/core/{p-40f94113.entry.js → p-2fd78585.entry.js} +2 -2
- package/dist/core/{p-3d478ba9.entry.js → p-345a88a7.entry.js} +2 -2
- package/dist/core/{p-3d478ba9.entry.js.map → p-345a88a7.entry.js.map} +1 -1
- package/dist/core/p-361da840.entry.js +2 -0
- package/dist/core/p-361da840.entry.js.map +1 -0
- package/dist/core/p-3f182d5d.entry.js +2 -0
- package/dist/core/p-3f182d5d.entry.js.map +1 -0
- package/dist/core/{p-0687cc81.entry.js → p-49bf3a47.entry.js} +2 -2
- package/dist/core/p-49bf3a47.entry.js.map +1 -0
- package/dist/core/p-4abbdbbc.entry.js +2 -0
- package/dist/core/p-4abbdbbc.entry.js.map +1 -0
- package/dist/core/p-5193184c.entry.js +2 -0
- package/dist/core/p-5193184c.entry.js.map +1 -0
- package/dist/core/{p-c894bc8f.entry.js → p-51fd68b7.entry.js} +2 -2
- package/dist/core/p-51fd68b7.entry.js.map +1 -0
- package/dist/core/p-563392e4.entry.js +2 -0
- package/dist/core/p-563392e4.entry.js.map +1 -0
- package/dist/core/p-5a48839e.entry.js +2 -0
- package/dist/core/p-5a48839e.entry.js.map +1 -0
- package/dist/core/p-5cbf0885.entry.js +2 -0
- package/dist/core/p-5cbf0885.entry.js.map +1 -0
- package/dist/core/{p-6f92ee7a.entry.js → p-5dcee0aa.entry.js} +2 -2
- package/dist/core/{p-b4eb1c6d.entry.js → p-646f21ff.entry.js} +2 -2
- package/dist/core/{p-c4dc8fdf.entry.js → p-74b676a6.entry.js} +2 -2
- package/dist/core/{p-acb0eddb.entry.js → p-74e63f4d.entry.js} +2 -2
- package/dist/core/{p-df05b999.entry.js → p-77f26d29.entry.js} +2 -2
- package/dist/core/p-77f26d29.entry.js.map +1 -0
- package/dist/core/{p-e4b9221b.entry.js → p-792ec0a3.entry.js} +2 -2
- package/dist/core/p-792ec0a3.entry.js.map +1 -0
- package/dist/core/{p-bd5aada7.entry.js → p-79c8879c.entry.js} +2 -2
- package/dist/core/{p-3b3a8108.entry.js → p-7d5a0251.entry.js} +2 -2
- package/dist/core/{p-160de322.entry.js → p-7eef69d7.entry.js} +2 -2
- package/dist/core/p-8167f2e0.entry.js +2 -0
- package/dist/core/p-8167f2e0.entry.js.map +1 -0
- package/dist/core/p-8576281d.entry.js +2 -0
- package/dist/core/p-8576281d.entry.js.map +1 -0
- package/dist/core/{p-fca3589b.entry.js → p-87cd3985.entry.js} +2 -2
- package/dist/core/p-8d3e250a.entry.js +2 -0
- package/dist/core/p-8d3e250a.entry.js.map +1 -0
- package/dist/core/p-8eb30ebf.entry.js +2 -0
- package/dist/core/p-8eb30ebf.entry.js.map +1 -0
- package/dist/core/{p-ffe923ae.entry.js → p-901879b8.entry.js} +2 -2
- package/dist/core/p-92bb5fe9.entry.js +2 -0
- package/dist/core/p-92bb5fe9.entry.js.map +1 -0
- package/dist/core/p-94efa0d2.entry.js +2 -0
- package/dist/core/p-94efa0d2.entry.js.map +1 -0
- package/dist/core/p-9f5071bd.entry.js +2 -0
- package/dist/core/p-9f5071bd.entry.js.map +1 -0
- package/dist/core/p-a04712b9.js +2 -0
- package/dist/core/p-a04712b9.js.map +1 -0
- package/dist/core/{p-29623ad5.entry.js → p-a683fd94.entry.js} +2 -2
- package/dist/core/p-a683fd94.entry.js.map +1 -0
- package/dist/core/{p-70543f44.entry.js → p-b2a6f0dd.entry.js} +2 -2
- package/dist/core/p-be6d9ab9.entry.js +2 -0
- package/dist/core/p-be6d9ab9.entry.js.map +1 -0
- package/dist/core/{p-91cf88d6.entry.js → p-d0c7bc04.entry.js} +2 -2
- package/dist/core/p-d0c7bc04.entry.js.map +1 -0
- package/dist/core/{p-3106c4fd.entry.js → p-d1b8e306.entry.js} +2 -2
- package/dist/core/{p-bc7d33e1.entry.js → p-db924212.entry.js} +2 -2
- package/dist/core/p-db924212.entry.js.map +1 -0
- package/dist/core/p-dd5daf97.entry.js +2 -0
- package/dist/core/p-dd5daf97.entry.js.map +1 -0
- package/dist/core/{p-9235425c.entry.js → p-dedca102.entry.js} +2 -2
- package/dist/core/{p-f08723ca.entry.js → p-eb09d6af.entry.js} +2 -2
- package/dist/core/p-ee5388e6.entry.js +2 -0
- package/dist/core/p-ee5388e6.entry.js.map +1 -0
- package/dist/core/p-f1fcc442.entry.js +2 -0
- package/dist/core/p-f1fcc442.entry.js.map +1 -0
- package/dist/core/{p-3bbfefcc.entry.js → p-f3995b20.entry.js} +2 -2
- package/dist/core/p-f3995b20.entry.js.map +1 -0
- package/dist/core/p-fa002d21.js +2 -0
- package/dist/core/p-fa002d21.js.map +1 -0
- package/dist/core/{p-e532fa26.entry.js → p-faae4ac4.entry.js} +2 -2
- package/dist/core/p-faae4ac4.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-d399f9c8.js → helpers-0f42cb46.js} +38 -18
- package/dist/esm/helpers-0f42cb46.js.map +1 -0
- package/dist/esm/{helpers-d3091c8c.js → helpers-96838a0a.js} +52 -27
- package/dist/esm/helpers-96838a0a.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +1 -1
- package/dist/esm/ic-accordion.entry.js +8 -1
- package/dist/esm/ic-accordion.entry.js.map +1 -1
- package/dist/esm/ic-alert.entry.js +4 -11
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-back-to-top.entry.js +1 -1
- package/dist/esm/ic-badge.entry.js +2 -2
- package/dist/esm/ic-badge.entry.js.map +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js +10 -7
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card-horizontal.entry.js +19 -16
- package/dist/esm/ic-card-horizontal.entry.js.map +1 -1
- package/dist/esm/ic-card-vertical.entry.js +27 -25
- package/dist/esm/ic-card-vertical.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +5 -1
- package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
- package/dist/esm/ic-checkbox.entry.js +5 -1
- package/dist/esm/ic-checkbox.entry.js.map +1 -1
- package/dist/esm/ic-chip.entry.js +9 -4
- package/dist/esm/ic-chip.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-data-table-title-bar.entry.js +1 -1
- package/dist/esm/ic-data-table.entry.js +277 -100
- package/dist/esm/ic-data-table.entry.js.map +1 -1
- package/dist/esm/ic-date-input.entry.js +7 -2
- package/dist/esm/ic-date-input.entry.js.map +1 -1
- package/dist/esm/ic-date-picker.entry.js +6 -1
- package/dist/esm/ic-date-picker.entry.js.map +1 -1
- package/dist/esm/ic-dialog.entry.js +1 -1
- package/dist/esm/ic-divider.entry.js +3 -3
- package/dist/esm/ic-divider.entry.js.map +1 -1
- package/dist/esm/ic-empty-state_2.entry.js +25 -16
- package/dist/esm/ic-empty-state_2.entry.js.map +1 -1
- package/dist/esm/ic-footer-link-group.entry.js +4 -5
- package/dist/esm/ic-footer-link-group.entry.js.map +1 -1
- package/dist/esm/ic-footer-link.entry.js +4 -5
- package/dist/esm/ic-footer-link.entry.js.map +1 -1
- package/dist/esm/ic-footer.entry.js +24 -14
- package/dist/esm/ic-footer.entry.js.map +1 -1
- package/dist/esm/ic-hero.entry.js +8 -16
- package/dist/esm/ic-hero.entry.js.map +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +3 -3
- package/dist/esm/ic-horizontal-scroll.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +40 -25
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-input-label_2.entry.js +1 -1
- package/dist/esm/ic-link.entry.js +9 -6
- package/dist/esm/ic-link.entry.js.map +1 -1
- package/dist/esm/ic-menu-group.entry.js +1 -1
- package/dist/esm/ic-menu-item.entry.js +7 -1
- package/dist/esm/ic-menu-item.entry.js.map +1 -1
- package/dist/esm/ic-navigation-button.entry.js +6 -7
- package/dist/esm/ic-navigation-button.entry.js.map +1 -1
- package/dist/esm/ic-navigation-group.entry.js +5 -6
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +4 -4
- package/dist/esm/ic-navigation-item.entry.js.map +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +1 -1
- package/dist/esm/ic-page-header.entry.js +1 -1
- package/dist/esm/ic-pagination_4.entry.js +85 -42
- package/dist/esm/ic-pagination_4.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +1 -1
- package/dist/esm/ic-radio-group.entry.js +9 -1
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +5 -1
- package/dist/esm/ic-radio-option.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js +37 -29
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js +5 -5
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-status-tag.entry.js +1 -1
- package/dist/esm/ic-step.entry.js +1 -1
- package/dist/esm/ic-stepper.entry.js +1 -1
- package/dist/esm/ic-switch.entry.js +6 -2
- package/dist/esm/ic-switch.entry.js.map +1 -1
- package/dist/esm/ic-tab-group.entry.js +1 -1
- package/dist/esm/ic-tab-panel.entry.js +1 -1
- package/dist/esm/ic-tab.entry.js +5 -2
- package/dist/esm/ic-tab.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +20 -20
- package/dist/esm/ic-theme.entry.js.map +1 -1
- package/dist/esm/ic-toast.entry.js +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js +29 -10
- package/dist/esm/ic-toggle-button-group.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button.entry.js +57 -5
- package/dist/esm/ic-toggle-button.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +10 -6
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/ic-tree-item.entry.js +15 -13
- package/dist/esm/ic-tree-item.entry.js.map +1 -1
- package/dist/esm/ic-tree-view.entry.js +18 -13
- package/dist/esm/ic-tree-view.entry.js.map +1 -1
- package/dist/esm/ic-typography.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-card-horizontal/ic-card-horizontal.d.ts +4 -4
- package/dist/types/components/ic-data-table/ic-data-table.d.ts +25 -0
- package/dist/types/components/ic-data-table/ic-data-table.types.d.ts +11 -0
- package/dist/types/components/ic-data-table/story-data.d.ts +181 -0
- package/dist/types/components/ic-date-input/ic-date-input.d.ts +1 -0
- package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +1 -0
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.d.ts +6 -0
- package/dist/types/components/ic-tree-item/ic-tree-item.d.ts +6 -1
- package/dist/types/components/ic-tree-view/ic-tree-view.d.ts +9 -1
- package/dist/types/components.d.ts +47 -0
- package/dist/types/utils/helpers.d.ts +13 -10
- package/dist/types/utils/types.d.ts +6 -5
- package/hydrate/index.js +897 -448
- package/package.json +3 -10
- package/dist/cjs/helpers-55099147.js.map +0 -1
- package/dist/cjs/helpers-c80f6ce4.js.map +0 -1
- package/dist/core/p-006afa83.entry.js +0 -2
- package/dist/core/p-006afa83.entry.js.map +0 -1
- package/dist/core/p-0687cc81.entry.js.map +0 -1
- package/dist/core/p-12b1db1b.entry.js +0 -2
- package/dist/core/p-12b1db1b.entry.js.map +0 -1
- package/dist/core/p-199ce579.entry.js +0 -2
- package/dist/core/p-199ce579.entry.js.map +0 -1
- package/dist/core/p-25597c03.js +0 -2
- package/dist/core/p-25597c03.js.map +0 -1
- package/dist/core/p-29623ad5.entry.js.map +0 -1
- package/dist/core/p-2d6fffa4.entry.js +0 -2
- package/dist/core/p-2d6fffa4.entry.js.map +0 -1
- package/dist/core/p-31082e64.entry.js +0 -2
- package/dist/core/p-31082e64.entry.js.map +0 -1
- package/dist/core/p-3bbfefcc.entry.js.map +0 -1
- package/dist/core/p-43891495.entry.js +0 -2
- package/dist/core/p-43891495.entry.js.map +0 -1
- package/dist/core/p-47ae7d10.entry.js +0 -2
- package/dist/core/p-47ae7d10.entry.js.map +0 -1
- package/dist/core/p-59d48811.entry.js +0 -2
- package/dist/core/p-59d48811.entry.js.map +0 -1
- package/dist/core/p-690d0bbd.entry.js +0 -2
- package/dist/core/p-690d0bbd.entry.js.map +0 -1
- package/dist/core/p-6f7cf143.entry.js +0 -2
- package/dist/core/p-6f7cf143.entry.js.map +0 -1
- package/dist/core/p-7a1f1e0d.entry.js +0 -2
- package/dist/core/p-7a1f1e0d.entry.js.map +0 -1
- package/dist/core/p-7c843bc8.entry.js +0 -2
- package/dist/core/p-7c843bc8.entry.js.map +0 -1
- package/dist/core/p-7e358f32.entry.js +0 -2
- package/dist/core/p-7e358f32.entry.js.map +0 -1
- package/dist/core/p-81da002e.entry.js +0 -2
- package/dist/core/p-81da002e.entry.js.map +0 -1
- package/dist/core/p-83c09d8d.entry.js +0 -2
- package/dist/core/p-83c09d8d.entry.js.map +0 -1
- package/dist/core/p-8d933976.entry.js +0 -2
- package/dist/core/p-8d933976.entry.js.map +0 -1
- package/dist/core/p-91cf88d6.entry.js.map +0 -1
- package/dist/core/p-92f443aa.entry.js +0 -2
- package/dist/core/p-92f443aa.entry.js.map +0 -1
- package/dist/core/p-982deb94.entry.js +0 -2
- package/dist/core/p-982deb94.entry.js.map +0 -1
- package/dist/core/p-99c76218.entry.js +0 -2
- package/dist/core/p-99c76218.entry.js.map +0 -1
- package/dist/core/p-9ae77f11.entry.js +0 -2
- package/dist/core/p-9ae77f11.entry.js.map +0 -1
- package/dist/core/p-a0c3f221.entry.js.map +0 -1
- package/dist/core/p-b2389339.js +0 -2
- package/dist/core/p-b2389339.js.map +0 -1
- package/dist/core/p-b4dd4835.entry.js +0 -2
- package/dist/core/p-b4dd4835.entry.js.map +0 -1
- package/dist/core/p-bc7d33e1.entry.js.map +0 -1
- package/dist/core/p-bdce46ca.entry.js +0 -2
- package/dist/core/p-bdce46ca.entry.js.map +0 -1
- package/dist/core/p-be7bc371.entry.js +0 -2
- package/dist/core/p-be7bc371.entry.js.map +0 -1
- package/dist/core/p-c12f3582.entry.js +0 -2
- package/dist/core/p-c12f3582.entry.js.map +0 -1
- package/dist/core/p-c5ea1e19.entry.js +0 -2
- package/dist/core/p-c5ea1e19.entry.js.map +0 -1
- package/dist/core/p-c894bc8f.entry.js.map +0 -1
- package/dist/core/p-df05b999.entry.js.map +0 -1
- package/dist/core/p-e4b9221b.entry.js.map +0 -1
- package/dist/core/p-e532fa26.entry.js.map +0 -1
- package/dist/core/p-e89e5ec8.entry.js +0 -2
- package/dist/core/p-e89e5ec8.entry.js.map +0 -1
- package/dist/core/p-f4414801.entry.js +0 -2
- package/dist/core/p-f4414801.entry.js.map +0 -1
- package/dist/esm/helpers-d3091c8c.js.map +0 -1
- package/dist/esm/helpers-d399f9c8.js.map +0 -1
- /package/dist/core/{p-9da6df82.entry.js.map → p-01034ef4.entry.js.map} +0 -0
- /package/dist/core/{p-f5d1e747.entry.js.map → p-03d51c20.entry.js.map} +0 -0
- /package/dist/core/{p-a67c358a.entry.js.map → p-05890d1e.entry.js.map} +0 -0
- /package/dist/core/{p-dd3a9cb1.entry.js.map → p-07bcfaef.entry.js.map} +0 -0
- /package/dist/core/{p-10afa533.entry.js.map → p-22708591.entry.js.map} +0 -0
- /package/dist/core/{p-40f94113.entry.js.map → p-2fd78585.entry.js.map} +0 -0
- /package/dist/core/{p-6f92ee7a.entry.js.map → p-5dcee0aa.entry.js.map} +0 -0
- /package/dist/core/{p-b4eb1c6d.entry.js.map → p-646f21ff.entry.js.map} +0 -0
- /package/dist/core/{p-c4dc8fdf.entry.js.map → p-74b676a6.entry.js.map} +0 -0
- /package/dist/core/{p-acb0eddb.entry.js.map → p-74e63f4d.entry.js.map} +0 -0
- /package/dist/core/{p-bd5aada7.entry.js.map → p-79c8879c.entry.js.map} +0 -0
- /package/dist/core/{p-3b3a8108.entry.js.map → p-7d5a0251.entry.js.map} +0 -0
- /package/dist/core/{p-160de322.entry.js.map → p-7eef69d7.entry.js.map} +0 -0
- /package/dist/core/{p-fca3589b.entry.js.map → p-87cd3985.entry.js.map} +0 -0
- /package/dist/core/{p-ffe923ae.entry.js.map → p-901879b8.entry.js.map} +0 -0
- /package/dist/core/{p-70543f44.entry.js.map → p-b2a6f0dd.entry.js.map} +0 -0
- /package/dist/core/{p-3106c4fd.entry.js.map → p-d1b8e306.entry.js.map} +0 -0
- /package/dist/core/{p-9235425c.entry.js.map → p-dedca102.entry.js.map} +0 -0
- /package/dist/core/{p-f08723ca.entry.js.map → p-eb09d6af.entry.js.map} +0 -0
@@ -4,7 +4,8 @@ import unsortedIcon from "./assets/unsorted-icon.svg";
|
|
4
4
|
import ascendingIcon from "./assets/ascending-icon.svg";
|
5
5
|
import descendingIcon from "./assets/descending-icon.svg";
|
6
6
|
// Unable to import helper functions via @ukic/web-components
|
7
|
-
import { isEmptyString, isSlotUsed, pxToRem, addDataToPosition, dynamicDebounce, getSlotElements, checkResizeObserver, } from "../../utils/helpers";
|
7
|
+
import { isEmptyString, isSlotUsed, pxToRem, addDataToPosition, dynamicDebounce, getSlotElements, checkResizeObserver, deviceSizeMatches, } from "../../utils/helpers";
|
8
|
+
import { IC_DEVICE_SIZES } from "../../utils/constants";
|
8
9
|
/**
|
9
10
|
* @slot empty-state - Content is slotted below the table header when there is no data and the table is not loading.
|
10
11
|
* @slot {COLUMN_KEY}-{ROW_INDEX}[-icon] - Each cell should have its own slot, named using the column tag and the row index, allowing for custom elements to be displayed. Include `-icon` at the end for that cell's icon slot.
|
@@ -44,6 +45,7 @@ export class DataTable {
|
|
44
45
|
this.itemsPerPageChange = false;
|
45
46
|
this.DATA_ROW_HEIGHT_STRING = "data-row-height";
|
46
47
|
this.ROW_HEIGHT_CSS_VARIABLE = "--row-height";
|
48
|
+
this.LINE_CLAMP_CSS_VARIABLE = "--ic-line-clamp";
|
47
49
|
this.DEFAULT_LINE_HEIGHT = 24;
|
48
50
|
this.densityUpdate = false;
|
49
51
|
this.truncationPatternUpdated = false;
|
@@ -51,6 +53,10 @@ export class DataTable {
|
|
51
53
|
this.headerResizeObserver = null;
|
52
54
|
this.IC_TOOLTIP_STRING = "ic-tooltip";
|
53
55
|
this.SHOW_TRUNC_TOOLTIP_STRING = "show-trunc-tooltip";
|
56
|
+
this.CELL_DESCRIPTION_STRING = ".cell-description";
|
57
|
+
this.CELL_CONTAINER_WITH_DESCRIPTION_STRING = "cell-container-with-description";
|
58
|
+
this.CELL_TEXT_WRAPPER_STRING = ".cell-text-wrapper";
|
59
|
+
this.IC_TYPOGRAPHY_STRING = "ic-typography";
|
54
60
|
this.runHeaderResizeObserver = () => {
|
55
61
|
this.headerResizeObserver = new ResizeObserver(() => {
|
56
62
|
this.headerResizeCallback();
|
@@ -64,7 +70,7 @@ export class DataTable {
|
|
64
70
|
const headers = this.el.shadowRoot.querySelectorAll("th.column-header");
|
65
71
|
headers.forEach((header) => {
|
66
72
|
const tooltip = header.querySelector(this.IC_TOOLTIP_STRING);
|
67
|
-
const typographyEls = header.querySelectorAll(
|
73
|
+
const typographyEls = header.querySelectorAll(this.IC_TYPOGRAPHY_STRING);
|
68
74
|
if (tooltip && typographyEls && typographyEls.length === 2) {
|
69
75
|
tooltip.classList.remove(this.SHOW_TRUNC_TOOLTIP_STRING);
|
70
76
|
if (typographyEls[1].clientWidth > typographyEls[0].clientWidth) {
|
@@ -132,8 +138,9 @@ export class DataTable {
|
|
132
138
|
}
|
133
139
|
else {
|
134
140
|
if (this.truncationPattern === this.TOOLTIP_STRING && tooltip) {
|
135
|
-
typographyEl.setAttribute("style",
|
136
|
-
cellContainer.
|
141
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: 0`);
|
142
|
+
const cellTextWrapper = cellContainer.querySelector(this.CELL_TEXT_WRAPPER_STRING);
|
143
|
+
cellTextWrapper.prepend(typographyEl);
|
137
144
|
tooltip.remove();
|
138
145
|
}
|
139
146
|
if (this.truncationPattern === this.SHOW_HIDE_STRING &&
|
@@ -209,7 +216,7 @@ export class DataTable {
|
|
209
216
|
this.timerStarted = null;
|
210
217
|
}, this.minimumLoadingDisplayDuration);
|
211
218
|
};
|
212
|
-
this.isObject = (value) => typeof value === "object";
|
219
|
+
this.isObject = (value) => value !== undefined && value !== null && typeof value === "object";
|
213
220
|
this.notDefaultDensity = () => this.density !== "default";
|
214
221
|
this.getCellContent = (cell, dataType) => {
|
215
222
|
switch (dataType) {
|
@@ -275,6 +282,56 @@ export class DataTable {
|
|
275
282
|
}
|
276
283
|
return {};
|
277
284
|
};
|
285
|
+
this.adjustWidthForActionElement = () => {
|
286
|
+
const elements = this.el.shadowRoot.querySelectorAll(".action-element");
|
287
|
+
elements.forEach((element) => {
|
288
|
+
const width = element.firstChild.getBoundingClientRect()
|
289
|
+
.width;
|
290
|
+
const gridWrapper = element.closest(".cell-grid-wrapper");
|
291
|
+
gridWrapper.style.gridTemplateColumns = `auto calc(${width}px + var(--ic-space-xs))`;
|
292
|
+
});
|
293
|
+
};
|
294
|
+
this.createCellContent = (columnProps, cell, cellSlotName, rowOptions, rowAlignment, hasIcon, currentRowHeight, cellValue, rowEmphasis) => {
|
295
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
296
|
+
return (h("div", { innerHTML: (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) === "element" &&
|
297
|
+
!isSlotUsed(this.el, cellSlotName)
|
298
|
+
? cell
|
299
|
+
: null, 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) ||
|
300
|
+
((_b = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _b === void 0 ? void 0 : _b.vertical) ||
|
301
|
+
rowAlignment ||
|
302
|
+
this.getCellAlignment(cell, "vertical")}`]: !!((_c = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _c === void 0 ? void 0 : _c.vertical) ||
|
303
|
+
!!((_d = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _d === void 0 ? void 0 : _d.vertical) ||
|
304
|
+
!!rowAlignment ||
|
305
|
+
!!this.getCellAlignment(cell, "vertical"), [`cell-alignment-${((_e = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _e === void 0 ? void 0 : _e.horizontal) ||
|
306
|
+
((_f = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _f === void 0 ? void 0 : _f.horizontal) ||
|
307
|
+
this.getCellAlignment(cell, "horizontal")}`]: !!((_g = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _g === void 0 ? void 0 : _g.horizontal) ||
|
308
|
+
!!((_h = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _h === void 0 ? void 0 : _h.horizontal) ||
|
309
|
+
!!this.getCellAlignment(cell, "horizontal"), [`data-type-${columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType}`]: true, [this.TEXT_WRAP_STRING]: (columnProps === null || columnProps === void 0 ? void 0 : columnProps.textWrap) ||
|
310
|
+
(rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.textWrap) ||
|
311
|
+
!!this.getCellOptions(cell, "textWrap"), ["cell-icon"]: hasIcon || !!((_j = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _j === void 0 ? void 0 : _j.icon), [`cell-emphasis-${(this.isObject(cell) && cellValue("emphasis")) ||
|
312
|
+
(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
|
313
|
+
rowEmphasis}`]: (this.isObject(cell) && !!cellValue("emphasis")) ||
|
314
|
+
!!(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
|
315
|
+
!!rowEmphasis }, this.setTruncationClass()), { [this.CELL_CONTAINER_WITH_DESCRIPTION_STRING]: this.isObject(cell) && Object.keys(cell).includes("description") }), style: Object.assign(Object.assign({}, this.getRowHeight(currentRowHeight, columnProps, rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.textWrap, cell)), this.getColumnWidth(columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnWidth)), "data-row-height": this.truncationPattern || currentRowHeight
|
316
|
+
? this.setRowHeight(currentRowHeight)
|
317
|
+
: null }, isSlotUsed(this.el, cellSlotName) ? (h("slot", { name: cellSlotName })) : (h(Fragment, null, isSlotUsed(this.el, `${cellSlotName}-icon`) ? (h("slot", { name: `${cellSlotName}-icon` })) : ((hasIcon || ((_k = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _k === void 0 ? void 0 : _k.onAllCells)) &&
|
318
|
+
(cellValue("icon") || ((_l = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _l === void 0 ? void 0 : _l.icon)) && (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" &&
|
319
|
+
!isSlotUsed(this.el, cellSlotName) && (h("div", { class: {
|
320
|
+
"cell-text-wrapper": true,
|
321
|
+
"cell-text-no-wrap": !this.truncationPattern,
|
322
|
+
} }, h("ic-typography", { variant: "body", class: {
|
323
|
+
[`cell-emphasis-${(this.isObject(cell) && cellValue("emphasis")) ||
|
324
|
+
(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
|
325
|
+
rowEmphasis}`]: (this.isObject(cell) && !!cellValue("emphasis")) ||
|
326
|
+
!!(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
|
327
|
+
!!rowEmphasis,
|
328
|
+
[`text-${this.density}`]: this.notDefaultDensity(),
|
329
|
+
} }, this.isObject(cell) && (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "date" ? (Object.keys(cell).includes("href") ? (h("ic-link", { href: cellValue("href"), theme: this.theme, target: cellValue("target") || undefined, rel: cellValue("rel") || undefined }, cellValue("data"))) : (cellValue("data"))) : (this.getCellContent(cell, columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType))), this.isObject(cell) &&
|
330
|
+
Object.keys(cell).includes("description") && (h("div", { class: {
|
331
|
+
["cell-description"]: true,
|
332
|
+
[`data-type-${columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType}`]: true,
|
333
|
+
} }, ((_o = cellValue("description")) === null || _o === void 0 ? void 0 : _o.icon) && (h("span", { class: "cell-description-icon", innerHTML: cellValue("description").icon })), h("ic-typography", { variant: "caption", class: "cell-description-text" }, (_q = (_p = cellValue("description")) === null || _p === void 0 ? void 0 : _p.data) !== null && _q !== void 0 ? _q : cellValue("description"))))))))));
|
334
|
+
};
|
278
335
|
this.createCells = (row, rowIndex) => {
|
279
336
|
var _a;
|
280
337
|
const rowValues = Object.values(row);
|
@@ -292,7 +349,6 @@ export class DataTable {
|
|
292
349
|
? variableRowHeightVal !== "auto" && variableRowHeightVal
|
293
350
|
: this.globalRowHeight !== "auto" && this.globalRowHeight;
|
294
351
|
return rowValues.map((cell, index) => {
|
295
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
296
352
|
const columnProps = this.columns[index];
|
297
353
|
const cellSlotName = `${columnProps === null || columnProps === void 0 ? void 0 : columnProps.key}-${rowIndex}`;
|
298
354
|
const hasIcon = this.isObject(cell) && Object.keys(cell).includes("icon");
|
@@ -309,67 +365,47 @@ export class DataTable {
|
|
309
365
|
["table-cell"]: true,
|
310
366
|
[`table-density-${this.density}`]: this.notDefaultDensity(),
|
311
367
|
["with-overflow"]: (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) === "element",
|
312
|
-
}, style: Object.assign({}, this.getColumnWidth(columnProps.columnWidth)) },
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
this.getCellAlignment(cell, "vertical")}`]: !!((_c = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _c === void 0 ? void 0 : _c.vertical) ||
|
319
|
-
!!((_d = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _d === void 0 ? void 0 : _d.vertical) ||
|
320
|
-
!!rowAlignment ||
|
321
|
-
!!this.getCellAlignment(cell, "vertical"), [`cell-alignment-${((_e = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _e === void 0 ? void 0 : _e.horizontal) ||
|
322
|
-
((_f = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _f === void 0 ? void 0 : _f.horizontal) ||
|
323
|
-
this.getCellAlignment(cell, "horizontal")}`]: !!((_g = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _g === void 0 ? void 0 : _g.horizontal) ||
|
324
|
-
!!((_h = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _h === void 0 ? void 0 : _h.horizontal) ||
|
325
|
-
!!this.getCellAlignment(cell, "horizontal"), [`data-type-${columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType}`]: true, [this.TEXT_WRAP_STRING]: (columnProps === null || columnProps === void 0 ? void 0 : columnProps.textWrap) ||
|
326
|
-
(rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.textWrap) ||
|
327
|
-
!!this.getCellOptions(cell, "textWrap"), ["cell-icon"]: hasIcon || !!((_j = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _j === void 0 ? void 0 : _j.icon), [`cell-emphasis-${(this.isObject(cell) && cellValue("emphasis")) ||
|
328
|
-
(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
|
329
|
-
rowEmphasis}`]: (this.isObject(cell) && !!cellValue("emphasis")) ||
|
330
|
-
!!(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
|
331
|
-
!!rowEmphasis }, this.setTruncationClass()), style: Object.assign(Object.assign({}, this.getRowHeight(currentRowHeight, columnProps, rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.textWrap, cell)), this.getColumnWidth(columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnWidth)), "data-row-height": this.truncationPattern || currentRowHeight
|
332
|
-
? this.setRowHeight(currentRowHeight)
|
333
|
-
: null }, isSlotUsed(this.el, cellSlotName) ? (h("slot", { name: cellSlotName })) : (h(Fragment, null, isSlotUsed(this.el, `${cellSlotName}-icon`) ? (h("slot", { name: `${cellSlotName}-icon` })) : ((hasIcon || ((_k = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _k === void 0 ? void 0 : _k.onAllCells)) &&
|
334
|
-
(cellValue("icon") || ((_l = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _l === void 0 ? void 0 : _l.icon)) && (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" &&
|
335
|
-
!isSlotUsed(this.el, cellSlotName) && (h("ic-typography", { variant: "body", class: {
|
336
|
-
[`text-${this.density}`]: this.notDefaultDensity(),
|
337
|
-
} }, this.isObject(cell) &&
|
338
|
-
(columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "date" ? (Object.keys(cell).includes("href") ? (h("ic-link", { href: cellValue("href"), theme: this.theme }, cellValue("data"))) : (cellValue("data"))) : (this.getCellContent(cell, columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType)))))))));
|
368
|
+
}, style: Object.assign({}, this.getColumnWidth(columnProps.columnWidth)) }, this.isObject(cell) &&
|
369
|
+
Object.keys(cell).includes("actionElement") ? (h("div", { class: "cell-grid-wrapper" }, this.createCellContent(columnProps, cell, cellSlotName, rowOptions, rowAlignment, hasIcon, currentRowHeight, cellValue, rowEmphasis), h("span", { class: "action-element", innerHTML: cellValue("actionElement"),
|
370
|
+
// eslint-disable-next-line react/jsx-no-bind
|
371
|
+
onClick: cell.actionOnClick
|
372
|
+
? () => this.handleClick(cell.actionOnClick)
|
373
|
+
: undefined }))) : (this.createCellContent(columnProps, cell, cellSlotName, rowOptions, rowAlignment, hasIcon, currentRowHeight, cellValue, rowEmphasis))));
|
339
374
|
}
|
340
375
|
});
|
341
376
|
};
|
342
|
-
this.createColumnHeaders = () => {
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
} }, title)))));
|
371
|
-
};
|
377
|
+
this.createColumnHeaders = () => (this.columns || []).map(({ cellAlignment, colspan, icon, key, title, columnWidth }, index) => (h("th", { scope: "col", class: {
|
378
|
+
["column-header"]: true,
|
379
|
+
[`table-density-${this.density}`]: this.notDefaultDensity(),
|
380
|
+
["updating-state-headers"]: this.updating && !this.loading,
|
381
|
+
}, style: Object.assign({}, this.getColumnWidth(columnWidth)), colSpan: colspan }, h("div", { class: {
|
382
|
+
"column-header-inner-container": true,
|
383
|
+
"truncation-tooltip": this.columnHeaderTruncation,
|
384
|
+
[`column-header-alignment-${cellAlignment}`]: !!cellAlignment,
|
385
|
+
} }, isSlotUsed(this.el, `${key}-column-icon`) ? (h("slot", { name: `${key}-column-icon` })) : (icon &&
|
386
|
+
!icon.hideOnHeader && (h("span", { class: "icon", innerHTML: icon.icon }))), this.columnHeaderTruncation ? (h("ic-tooltip", { label: title, target: `column-header-${index}` }, h("ic-typography", { id: `column-header-${index}`, variant: "body", class: {
|
387
|
+
["column-header-text"]: true,
|
388
|
+
[`text-${this.density}`]: this.notDefaultDensity(),
|
389
|
+
} }, title))) : (h("ic-typography", { variant: "body", class: {
|
390
|
+
["column-header-text"]: true,
|
391
|
+
[`text-${this.density}`]: this.notDefaultDensity(),
|
392
|
+
} }, title)), this.sortable && (h("ic-button", { variant: "icon", id: `sort-button-${key}`, "aria-label": this.getSortButtonLabel(key),
|
393
|
+
// eslint-disable-next-line react/jsx-no-bind
|
394
|
+
onClick: () => this.sortRows(key), innerHTML: this.SORT_ICONS[this.sortedColumn === key
|
395
|
+
? this.sortedColumnOrder
|
396
|
+
: "unsorted"], class: {
|
397
|
+
["sort-button"]: true,
|
398
|
+
["sort-button-unsorted"]: this.sortedColumn !== key ||
|
399
|
+
this.sortedColumnOrder === "unsorted",
|
400
|
+
} }))), this.columnHeaderTruncation && (h("ic-typography", { variant: "body", "aria-hidden": "true", class: {
|
401
|
+
["column-header-text"]: true,
|
402
|
+
["dummy-column-header-text"]: this.columnHeaderTruncation,
|
403
|
+
[`text-${this.density}`]: this.notDefaultDensity(),
|
404
|
+
} }, title)))));
|
372
405
|
this.onRowClick = (row) => {
|
406
|
+
if (!this.loading && !this.updating) {
|
407
|
+
this.icSelectedRowChange.emit(this.selectedRow !== row ? row : null);
|
408
|
+
}
|
373
409
|
this.selectedRow =
|
374
410
|
this.selectedRow !== row && !this.loading && !this.updating && row;
|
375
411
|
};
|
@@ -400,7 +436,7 @@ export class DataTable {
|
|
400
436
|
// eslint-disable-next-line react/jsx-no-bind
|
401
437
|
onClick: () => this.onRowClick(row), class: {
|
402
438
|
["table-row"]: true,
|
403
|
-
["table-row-selected"]: this.selectedRow === row,
|
439
|
+
["table-row-selected"]: this.highlightSelectedRow && this.selectedRow === row,
|
404
440
|
}
|
405
441
|
}, this.createCells(row, index)));
|
406
442
|
});
|
@@ -470,7 +506,8 @@ export class DataTable {
|
|
470
506
|
});
|
471
507
|
};
|
472
508
|
this.getTypographyElements = () => {
|
473
|
-
|
509
|
+
// Filter out column headers and cell descriptions
|
510
|
+
return Array.from(this.el.shadowRoot.querySelectorAll("ic-typography:not(.column-header-text,.cell-description-text)"));
|
474
511
|
};
|
475
512
|
this.getTooltip = (typographyEl) => {
|
476
513
|
return typographyEl.closest(this.TOOLTIP);
|
@@ -481,7 +518,7 @@ export class DataTable {
|
|
481
518
|
const cellContainer = this.getCellContainer(typographyEl);
|
482
519
|
if (typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
483
520
|
this.removeTooltip(cellContainer, typographyEl, tooltip);
|
484
|
-
typographyEl.setAttribute("style",
|
521
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: 0`);
|
485
522
|
return;
|
486
523
|
}
|
487
524
|
this.regenerateTooltip(cellContainer, typographyEl, tooltip, removeTooltipOnly);
|
@@ -490,6 +527,56 @@ export class DataTable {
|
|
490
527
|
this.updateScrollOffset = () => {
|
491
528
|
this.scrollOffset = this.el.shadowRoot.querySelector(".table-row-container").scrollTop;
|
492
529
|
};
|
530
|
+
this.updateRowHeightForDescriptions = (rowHeight, cellContainer) => {
|
531
|
+
cellContainer.setAttribute("data-row-height", rowHeight.toString());
|
532
|
+
cellContainer.setAttribute("style", `${this.ROW_HEIGHT_CSS_VARIABLE}: ${rowHeight}px`);
|
533
|
+
};
|
534
|
+
// Method to update the row heights on cells with descriptions and tooltip truncation
|
535
|
+
this.updateCellHeightsWithDescriptions = () => {
|
536
|
+
const descriptions = this.el.shadowRoot.querySelectorAll(this.CELL_DESCRIPTION_STRING);
|
537
|
+
descriptions.forEach((description) => {
|
538
|
+
const cellContainer = description.closest(`.${this.CELL_CONTAINER_WITH_DESCRIPTION_STRING}`);
|
539
|
+
const typography = cellContainer.querySelector(this.IC_TYPOGRAPHY_STRING);
|
540
|
+
const descriptionMarginTop = window
|
541
|
+
.getComputedStyle(description)
|
542
|
+
.getPropertyValue("margin-top");
|
543
|
+
const descriptionHeight = description.clientHeight + parseInt(descriptionMarginTop, 10);
|
544
|
+
if (this.globalRowHeight && this.globalRowHeight !== "auto") {
|
545
|
+
if (!typography.textContent &&
|
546
|
+
descriptionHeight + this.DEFAULT_LINE_HEIGHT > this.globalRowHeight) {
|
547
|
+
this.updateRowHeightForDescriptions(descriptionHeight, cellContainer);
|
548
|
+
}
|
549
|
+
else if (this.truncationPattern === this.TOOLTIP_STRING) {
|
550
|
+
if (descriptionHeight + this.DEFAULT_LINE_HEIGHT >
|
551
|
+
this.globalRowHeight) {
|
552
|
+
const cellIcon = cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.querySelector(".icon");
|
553
|
+
if (deviceSizeMatches(IC_DEVICE_SIZES.XS) && cellIcon) {
|
554
|
+
// recalculate descriptionHeight as when a word break occurs this value changes
|
555
|
+
// Additional spacing given for 300-400% zoom
|
556
|
+
this.updateRowHeightForDescriptions(descriptionHeight +
|
557
|
+
this.DEFAULT_LINE_HEIGHT +
|
558
|
+
cellIcon.clientHeight, cellContainer);
|
559
|
+
}
|
560
|
+
else {
|
561
|
+
this.updateRowHeightForDescriptions(descriptionHeight + this.DEFAULT_LINE_HEIGHT, cellContainer);
|
562
|
+
}
|
563
|
+
}
|
564
|
+
this.addLineClampCSS(typography, cellContainer);
|
565
|
+
// Additional case for show/hide truncation for when a description is present, but the text
|
566
|
+
// isn't overflowing the cell to trigger the show more button to appear.
|
567
|
+
}
|
568
|
+
else if (this.truncationPattern === this.SHOW_HIDE_STRING &&
|
569
|
+
descriptionHeight + this.DEFAULT_LINE_HEIGHT > this.globalRowHeight &&
|
570
|
+
typography.style.getPropertyValue("--truncation-max-lines") !==
|
571
|
+
"initial") {
|
572
|
+
this.updateRowHeightForDescriptions(descriptionHeight + this.DEFAULT_LINE_HEIGHT, cellContainer);
|
573
|
+
if (descriptionHeight) {
|
574
|
+
this.createShowHideTruncation(typography, cellContainer, descriptionHeight);
|
575
|
+
}
|
576
|
+
}
|
577
|
+
}
|
578
|
+
});
|
579
|
+
};
|
493
580
|
this.setTableDimensions = () => {
|
494
581
|
let tableHostDimensions = {};
|
495
582
|
if (this.width) {
|
@@ -506,22 +593,79 @@ export class DataTable {
|
|
506
593
|
}
|
507
594
|
return tableHostDimensions;
|
508
595
|
};
|
596
|
+
this.fixCellTooltip = (element) => {
|
597
|
+
var _a;
|
598
|
+
const tooltipEl = (element.tagName === "IC-TOOLTIP"
|
599
|
+
? element
|
600
|
+
: (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(this.IC_TOOLTIP_STRING));
|
601
|
+
if (tooltipEl) {
|
602
|
+
tooltipEl.setExternalPopperProps({
|
603
|
+
strategy: "fixed",
|
604
|
+
});
|
605
|
+
}
|
606
|
+
};
|
509
607
|
this.fixCellTooltips = () => {
|
510
608
|
const elements = this.el.shadowRoot.querySelectorAll(".data-type-element");
|
511
609
|
elements.forEach((element) => {
|
512
610
|
const slotElements = getSlotElements(element);
|
513
|
-
slotElements.forEach((slottedEl) => {
|
514
|
-
|
515
|
-
const tooltipEl = (slottedEl.tagName === "IC-TOOLTIP"
|
516
|
-
? slottedEl
|
517
|
-
: (_a = slottedEl.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(this.IC_TOOLTIP_STRING));
|
518
|
-
if (tooltipEl) {
|
519
|
-
tooltipEl.setExternalPopperProps({
|
520
|
-
strategy: "fixed",
|
521
|
-
});
|
522
|
-
}
|
611
|
+
slotElements === null || slotElements === void 0 ? void 0 : slotElements.forEach((slottedEl) => {
|
612
|
+
this.fixCellTooltip(slottedEl);
|
523
613
|
});
|
524
614
|
});
|
615
|
+
const actionElements = this.el.shadowRoot.querySelectorAll(".action-element");
|
616
|
+
actionElements === null || actionElements === void 0 ? void 0 : actionElements.forEach((actionElementSpan) => {
|
617
|
+
const actionElement = actionElementSpan.firstChild;
|
618
|
+
if (actionElement) {
|
619
|
+
this.fixCellTooltip(actionElement);
|
620
|
+
}
|
621
|
+
});
|
622
|
+
};
|
623
|
+
this.handleClick = (callback) => callback();
|
624
|
+
this.renderTableBody = (data, loading, overlay) => {
|
625
|
+
if (!(data === null || data === void 0 ? void 0 : data.length))
|
626
|
+
return;
|
627
|
+
if (overlay && loading) {
|
628
|
+
return h("tbody", null, this.createRows());
|
629
|
+
}
|
630
|
+
else if (loading && !overlay) {
|
631
|
+
return null;
|
632
|
+
}
|
633
|
+
else {
|
634
|
+
return h("tbody", null, this.createRows());
|
635
|
+
}
|
636
|
+
};
|
637
|
+
this.renderLoadingIndicator = (isLoading, loadingOptions) => {
|
638
|
+
if (!isLoading)
|
639
|
+
return null;
|
640
|
+
return (h(Fragment, null, h("div", { class: "loading-overlay", ref: (el) => (this.loadingOverlay = el) }), h("ic-loading-indicator", { theme: this.theme, monochrome: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.monochrome, class: {
|
641
|
+
"loading-empty": isLoading,
|
642
|
+
loading: true,
|
643
|
+
"show-background": loadingOptions.showBackground || loadingOptions.overlay,
|
644
|
+
}, 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) })));
|
645
|
+
};
|
646
|
+
this.renderAriaLiveLoading = () => {
|
647
|
+
var _a, _b;
|
648
|
+
if (this.loading) {
|
649
|
+
return ((_a = this.loadingOptions) === null || _a === void 0 ? void 0 : _a.label) || "Loading...";
|
650
|
+
}
|
651
|
+
else if (this.updating) {
|
652
|
+
return ((_b = this.updatingOptions) === null || _b === void 0 ? void 0 : _b.description) || "Updating table data";
|
653
|
+
}
|
654
|
+
else {
|
655
|
+
return "";
|
656
|
+
}
|
657
|
+
};
|
658
|
+
this.renderEmptyState = (data, loading, overlay) => {
|
659
|
+
const emptyStateEl = isSlotUsed(this.el, "empty-state") ? (h("slot", { name: "empty-state" })) : (h("ic-empty-state", { aligned: "center", heading: "No Data", class: "loading-empty" }));
|
660
|
+
if (loading && !(data === null || data === void 0 ? void 0 : data.length) && overlay) {
|
661
|
+
return emptyStateEl;
|
662
|
+
}
|
663
|
+
else if (!loading && !(data === null || data === void 0 ? void 0 : data.length)) {
|
664
|
+
return emptyStateEl;
|
665
|
+
}
|
666
|
+
else {
|
667
|
+
return null;
|
668
|
+
}
|
525
669
|
};
|
526
670
|
this.fromRow = 0;
|
527
671
|
this.previousRowsPerPage = undefined;
|
@@ -542,6 +686,7 @@ export class DataTable {
|
|
542
686
|
this.embedded = false;
|
543
687
|
this.globalRowHeight = "auto";
|
544
688
|
this.height = undefined;
|
689
|
+
this.highlightSelectedRow = true;
|
545
690
|
this.hideColumnHeaders = false;
|
546
691
|
this.loading = false;
|
547
692
|
this.loadingOptions = undefined;
|
@@ -564,6 +709,7 @@ export class DataTable {
|
|
564
709
|
hideRangeLabel: false,
|
565
710
|
hideAllFromItemsPerPage: false,
|
566
711
|
monochrome: false,
|
712
|
+
setToFirstPageOnPaginationChange: false,
|
567
713
|
};
|
568
714
|
this.showPagination = false;
|
569
715
|
this.sortable = false;
|
@@ -601,13 +747,13 @@ export class DataTable {
|
|
601
747
|
(_b = this.headerResizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
602
748
|
}
|
603
749
|
componentWillLoad() {
|
604
|
-
var _a;
|
750
|
+
var _a, _b;
|
605
751
|
this.rowsPerPage = Number(this.paginationBarOptions.itemsPerPageOptions[0].value);
|
606
752
|
this.previousRowsPerPage = this.rowsPerPage;
|
607
753
|
this.toRow = this.rowsPerPage;
|
608
754
|
this.sortedColumn = this.sortOptions.defaultColumn;
|
609
755
|
this.sortedColumnOrder = this.sortOptions.sortOrders[0];
|
610
|
-
this.loadingOptions = Object.assign(Object.assign({}, this.loadingOptions), { showBackground: ((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) > 0 });
|
756
|
+
this.loadingOptions = Object.assign(Object.assign({}, this.loadingOptions), { showBackground: ((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) > 0 || !!((_b = this.loadingOptions) === null || _b === void 0 ? void 0 : _b.overlay) });
|
611
757
|
this.initialLoad = true;
|
612
758
|
this.previousItemsPerPage = this.rowsPerPage;
|
613
759
|
}
|
@@ -638,6 +784,7 @@ export class DataTable {
|
|
638
784
|
if (this.globalRowHeight !== "auto") {
|
639
785
|
this.updateSetRowHeight();
|
640
786
|
}
|
787
|
+
window.addEventListener("resize", this.updateCellHeightsWithDescriptions);
|
641
788
|
}
|
642
789
|
componentDidUpdate() {
|
643
790
|
// truncation updates invoked here once new/updated data has
|
@@ -649,6 +796,8 @@ export class DataTable {
|
|
649
796
|
}
|
650
797
|
componentDidRender() {
|
651
798
|
this.fixCellTooltips();
|
799
|
+
this.updateCellHeightsWithDescriptions();
|
800
|
+
this.adjustWidthForActionElement();
|
652
801
|
}
|
653
802
|
truncateUpdatedData() {
|
654
803
|
if (this.dataUpdated) {
|
@@ -706,7 +855,7 @@ export class DataTable {
|
|
706
855
|
cellContainer.style.height = null;
|
707
856
|
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
708
857
|
this.removeTooltip(cellContainer, typographyEl, tooltipEl);
|
709
|
-
typographyEl.setAttribute("style",
|
858
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: 0`);
|
710
859
|
}
|
711
860
|
else if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
712
861
|
this.resetShowHideTruncation(typographyEl);
|
@@ -717,7 +866,8 @@ export class DataTable {
|
|
717
866
|
parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
718
867
|
// If the set row height is bigger than the cell container even
|
719
868
|
// with textWrap, set the row height
|
720
|
-
if (!
|
869
|
+
if (!cellContainer.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING) &&
|
870
|
+
!((_a = cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.style) === null || _a === void 0 ? void 0 : _a.height) &&
|
721
871
|
rowHeight > cellContainer.clientHeight &&
|
722
872
|
!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {
|
723
873
|
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
@@ -750,7 +900,7 @@ export class DataTable {
|
|
750
900
|
const newRows = Array.from(allRows).slice(this.previousItemsPerPage);
|
751
901
|
newRows.forEach((row) => {
|
752
902
|
row
|
753
|
-
.querySelectorAll(
|
903
|
+
.querySelectorAll(this.IC_TYPOGRAPHY_STRING)
|
754
904
|
.forEach((typographyEl) => {
|
755
905
|
const cellContainer = this.getCellContainer(typographyEl);
|
756
906
|
const tooltipEl = this.getTooltip(typographyEl);
|
@@ -812,9 +962,17 @@ export class DataTable {
|
|
812
962
|
}
|
813
963
|
}
|
814
964
|
}
|
815
|
-
createShowHideTruncation(typographyEl, cellContainer) {
|
965
|
+
createShowHideTruncation(typographyEl, cellContainer, descriptionHeight) {
|
816
966
|
typographyEl.checkMaxLines(typographyEl.scrollHeight);
|
817
967
|
typographyEl.setAttribute("max-lines", `${Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT)}`);
|
968
|
+
if (cellContainer.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING) &&
|
969
|
+
descriptionHeight) {
|
970
|
+
typographyEl.setAttribute("max-lines", `${Math.floor(((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) - descriptionHeight) /
|
971
|
+
this.DEFAULT_LINE_HEIGHT)}`);
|
972
|
+
}
|
973
|
+
else {
|
974
|
+
typographyEl.setAttribute("max-lines", `${Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT)}`);
|
975
|
+
}
|
818
976
|
typographyEl.setShowHideExpanded(false);
|
819
977
|
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, null);
|
820
978
|
}
|
@@ -921,7 +1079,8 @@ export class DataTable {
|
|
921
1079
|
this.truncationPatternUpdated = true;
|
922
1080
|
}
|
923
1081
|
async dataHandler(newData) {
|
924
|
-
|
1082
|
+
var _a;
|
1083
|
+
this.loadingOptions = Object.assign(Object.assign({}, this.loadingOptions), { showBackground: (newData === null || newData === void 0 ? void 0 : newData.length) > 0 || !!((_a = this.loadingOptions) === null || _a === void 0 ? void 0 : _a.overlay) });
|
925
1084
|
if (this.loading) {
|
926
1085
|
!this.hasLoadedForOneSecond
|
927
1086
|
? setTimeout(() => (this.loading = false), this.minimumLoadingDisplayDuration -
|
@@ -948,7 +1107,7 @@ export class DataTable {
|
|
948
1107
|
typographyEl.setShowHideExpanded(false);
|
949
1108
|
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, null);
|
950
1109
|
}
|
951
|
-
else {
|
1110
|
+
else if (!cellContainer.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING)) {
|
952
1111
|
typographyEl.resetTruncation().then(() => {
|
953
1112
|
if (!typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
954
1113
|
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
@@ -984,8 +1143,11 @@ export class DataTable {
|
|
984
1143
|
this.variableRowHeight = null;
|
985
1144
|
}
|
986
1145
|
showLoadingIndicator() {
|
987
|
-
var _a;
|
988
|
-
(_a = this.
|
1146
|
+
var _a, _b, _c;
|
1147
|
+
if ((_a = this.loadingOptions) === null || _a === void 0 ? void 0 : _a.overlay) {
|
1148
|
+
(_b = this.loadingOverlay) === null || _b === void 0 ? void 0 : _b.classList.add("show");
|
1149
|
+
}
|
1150
|
+
(_c = this.loadingIndicator) === null || _c === void 0 ? void 0 : _c.classList.add("show");
|
989
1151
|
}
|
990
1152
|
getRowOptions(rowKeys, rowValues) {
|
991
1153
|
const rowOptionsIndex = rowKeys.indexOf("rowOptions");
|
@@ -1014,20 +1176,40 @@ export class DataTable {
|
|
1014
1176
|
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) &&
|
1015
1177
|
this.truncationPattern === this.TOOLTIP_STRING) {
|
1016
1178
|
if (!typographyEl.getAttribute("style") ||
|
1017
|
-
typographyEl.style.cssText.includes(
|
1179
|
+
typographyEl.style.cssText.includes(`${this.LINE_CLAMP_CSS_VARIABLE}: 0;`)) {
|
1018
1180
|
this.addLineClampCSS(typographyEl, cellContainer);
|
1019
1181
|
}
|
1020
1182
|
this.createTruncationTooltip(typographyEl, cellContainer);
|
1021
1183
|
}
|
1022
1184
|
}
|
1023
1185
|
removeTooltip(cellContainer, typographyEl, tooltip) {
|
1024
|
-
cellContainer.
|
1186
|
+
const cellTextWrapper = cellContainer.querySelector(this.CELL_TEXT_WRAPPER_STRING);
|
1187
|
+
cellTextWrapper.prepend(typographyEl);
|
1025
1188
|
if (tooltip) {
|
1026
1189
|
tooltip.remove();
|
1027
1190
|
}
|
1028
1191
|
}
|
1029
1192
|
addLineClampCSS(typographyEl, cellContainer) {
|
1030
|
-
|
1193
|
+
var _a, _b;
|
1194
|
+
const descriptionCellHeight = (_a = cellContainer.querySelector(this.CELL_DESCRIPTION_STRING)) === null || _a === void 0 ? void 0 : _a.clientHeight;
|
1195
|
+
if (cellContainer.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING) &&
|
1196
|
+
(cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) > descriptionCellHeight) {
|
1197
|
+
let iconHeight;
|
1198
|
+
if (deviceSizeMatches(IC_DEVICE_SIZES.XS)) {
|
1199
|
+
const cellIcon = cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.querySelector(".icon");
|
1200
|
+
iconHeight = cellIcon ? cellIcon.clientHeight : 0;
|
1201
|
+
}
|
1202
|
+
else {
|
1203
|
+
iconHeight = 0;
|
1204
|
+
}
|
1205
|
+
const height = (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) -
|
1206
|
+
((_b = cellContainer.querySelector(this.CELL_DESCRIPTION_STRING)) === null || _b === void 0 ? void 0 : _b.clientHeight) -
|
1207
|
+
iconHeight;
|
1208
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: ${this.getLines(height || 0)}`);
|
1209
|
+
}
|
1210
|
+
else {
|
1211
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: ${this.getLines(cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)}`);
|
1212
|
+
}
|
1031
1213
|
}
|
1032
1214
|
createTruncationTooltip(typographyEl, cellContainer) {
|
1033
1215
|
const tooltipEl = document.createElement(this.IC_TOOLTIP_STRING);
|
@@ -1038,12 +1220,13 @@ export class DataTable {
|
|
1038
1220
|
// This might need reverting back to absolute if the tooltip doesn't dynamically position itself correctly
|
1039
1221
|
strategy: "fixed",
|
1040
1222
|
});
|
1041
|
-
cellContainer.
|
1042
|
-
|
1223
|
+
const cellTextWrapper = cellContainer.querySelector(this.CELL_TEXT_WRAPPER_STRING);
|
1224
|
+
cellTextWrapper.prepend(tooltipEl);
|
1225
|
+
tooltipEl.prepend(typographyEl);
|
1043
1226
|
}
|
1044
1227
|
render() {
|
1045
1228
|
var _a;
|
1046
|
-
const { caption, createColumnHeaders,
|
1229
|
+
const { caption, createColumnHeaders, createUpdatingIndicator, data, hideColumnHeaders, loading, loadingOptions, paginationBarOptions, scrollable, scrollOffset, showPagination, sortable, sortedColumnOrder, sortedColumn, stickyColumnHeaders, updateScrollOffset, updating, theme, } = this;
|
1047
1230
|
return (h(Host, { style: Object.assign({}, this.setTableDimensions()), class: { [`ic-theme-${theme}`]: theme !== "inherit" } }, h("div", { class: "table-container" }, isSlotUsed(this.el, "title-bar") && h("slot", { name: "title-bar" }), h("div", { class: {
|
1048
1231
|
["table-row-container"]: true,
|
1049
1232
|
scrollable,
|
@@ -1054,13 +1237,7 @@ export class DataTable {
|
|
1054
1237
|
["column-header-overlay"]: stickyColumnHeaders && scrollOffset !== 0,
|
1055
1238
|
} }, h("tr", null, createColumnHeaders()))), updating &&
|
1056
1239
|
!loading &&
|
1057
|
-
(hideColumnHeaders ? (h("thead", null, createUpdatingIndicator())) : (createUpdatingIndicator())), (data
|
1058
|
-
!loading &&
|
1059
|
-
(isSlotUsed(this.el, "empty-state") ? (h("slot", { name: "empty-state" })) : (h("ic-empty-state", { aligned: "center", heading: "No Data", class: "loading-empty" })))), loading && (h("ic-loading-indicator", { theme: theme, monochrome: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.monochrome, class: {
|
1060
|
-
"loading-empty": loading,
|
1061
|
-
loading: true,
|
1062
|
-
"show-background": loadingOptions.showBackground,
|
1063
|
-
}, 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) })), (showPagination || isSlotUsed(this.el, "pagination-bar")) && (h("div", { class: "pagination-container" }, isSlotUsed(this.el, "pagination-bar") ? (h("slot", { name: "pagination-bar" })) : (h("ic-pagination-bar", { totalItems: (_a = data === null || data === void 0 ? void 0 : data.length) !== null && _a !== void 0 ? _a : 0, type: paginationBarOptions.type, rangeLabelType: paginationBarOptions.rangeLabelType, showItemsPerPageControl: paginationBarOptions.showItemsPerPageControl, showGoToPageControl: paginationBarOptions.showGoToPageControl, itemsPerPageOptions: paginationBarOptions.itemsPerPageOptions, alignment: paginationBarOptions.alignment, theme: theme, monochrome: paginationBarOptions.monochrome, itemLabel: paginationBarOptions.itemLabel, pageLabel: paginationBarOptions.pageLabel, hideRangeLabel: paginationBarOptions.hideRangeLabel, hideAllFromItemsPerPage: paginationBarOptions.hideAllFromItemsPerPage })))), sortable && (h("div", { class: "screen-reader-sort-text", "aria-live": "polite" }, sortedColumnOrder !== "unsorted" && sortedColumn
|
1240
|
+
(hideColumnHeaders ? (h("thead", null, createUpdatingIndicator())) : (createUpdatingIndicator())), this.renderTableBody(data, loading, loadingOptions.overlay)), this.renderEmptyState(data, loading, loadingOptions.overlay)), h("div", { "aria-live": "assertive", class: "sr-only" }, this.renderAriaLiveLoading()), this.renderLoadingIndicator(loading, loadingOptions), (showPagination || isSlotUsed(this.el, "pagination-bar")) && (h("div", { class: "pagination-container" }, isSlotUsed(this.el, "pagination-bar") ? (h("slot", { name: "pagination-bar" })) : (h("ic-pagination-bar", { totalItems: (_a = data === null || data === void 0 ? void 0 : data.length) !== null && _a !== void 0 ? _a : 0, type: paginationBarOptions.type, rangeLabelType: paginationBarOptions.rangeLabelType, showItemsPerPageControl: paginationBarOptions.showItemsPerPageControl, showGoToPageControl: paginationBarOptions.showGoToPageControl, itemsPerPageOptions: paginationBarOptions.itemsPerPageOptions, alignment: paginationBarOptions.alignment, theme: theme, monochrome: paginationBarOptions.monochrome, itemLabel: paginationBarOptions.itemLabel, pageLabel: paginationBarOptions.pageLabel, hideRangeLabel: paginationBarOptions.hideRangeLabel, hideAllFromItemsPerPage: paginationBarOptions.hideAllFromItemsPerPage, setToFirstPageOnPaginationChange: paginationBarOptions.setToFirstPageOnPaginationChange })))), sortable && (h("div", { class: "screen-reader-sort-text", "aria-live": "polite" }, sortedColumnOrder !== "unsorted" && sortedColumn
|
1064
1241
|
? `${sortedColumn} sorted ${sortedColumnOrder}`
|
1065
1242
|
: "table unsorted")))));
|
1066
1243
|
}
|
@@ -1238,6 +1415,24 @@ export class DataTable {
|
|
1238
1415
|
"attribute": "height",
|
1239
1416
|
"reflect": false
|
1240
1417
|
},
|
1418
|
+
"highlightSelectedRow": {
|
1419
|
+
"type": "boolean",
|
1420
|
+
"mutable": false,
|
1421
|
+
"complexType": {
|
1422
|
+
"original": "boolean",
|
1423
|
+
"resolved": "boolean",
|
1424
|
+
"references": {}
|
1425
|
+
},
|
1426
|
+
"required": false,
|
1427
|
+
"optional": true,
|
1428
|
+
"docs": {
|
1429
|
+
"tags": [],
|
1430
|
+
"text": "If `true`, the selected row is highlighted using a background colour."
|
1431
|
+
},
|
1432
|
+
"attribute": "highlight-selected-row",
|
1433
|
+
"reflect": false,
|
1434
|
+
"defaultValue": "true"
|
1435
|
+
},
|
1241
1436
|
"hideColumnHeaders": {
|
1242
1437
|
"type": "boolean",
|
1243
1438
|
"mutable": false,
|
@@ -1278,8 +1473,8 @@ export class DataTable {
|
|
1278
1473
|
"type": "unknown",
|
1279
1474
|
"mutable": false,
|
1280
1475
|
"complexType": {
|
1281
|
-
"original": "{\n description?: string;\n label?: string;\n labelDuration?: number;\n max?: number;\n min?: number;\n progress?: number;\n showBackground?: boolean;\n monochrome?: boolean;\n }",
|
1282
|
-
"resolved": "{ description?: string; label?: string; labelDuration?: number; max?: number; min?: number; progress?: number; showBackground?: boolean; monochrome?: boolean; }",
|
1476
|
+
"original": "{\n description?: string;\n label?: string;\n labelDuration?: number;\n max?: number;\n min?: number;\n progress?: number;\n showBackground?: boolean;\n monochrome?: boolean;\n overlay?: boolean;\n }",
|
1477
|
+
"resolved": "{ description?: string; label?: string; labelDuration?: number; max?: number; min?: number; progress?: number; showBackground?: boolean; monochrome?: boolean; overlay?: boolean; }",
|
1283
1478
|
"references": {}
|
1284
1479
|
},
|
1285
1480
|
"required": false,
|
@@ -1361,7 +1556,7 @@ export class DataTable {
|
|
1361
1556
|
"tags": [],
|
1362
1557
|
"text": "Sets the props for the built-in pagination bar. If the `pagination-bar` slot is used then this prop is ignored."
|
1363
1558
|
},
|
1364
|
-
"defaultValue": "{\n itemsPerPageOptions: [\n { label: \"10\", value: \"10\" },\n { label: \"25\", value: \"25\" },\n { label: \"50\", value: \"50\" },\n ],\n rangeLabelType: \"page\",\n type: \"simple\",\n showItemsPerPageControl: true,\n showGoToPageControl: true,\n alignment: \"right\",\n itemLabel: \"Item\",\n pageLabel: \"Page\",\n hideRangeLabel: false,\n hideAllFromItemsPerPage: false,\n monochrome: false,\n }"
|
1559
|
+
"defaultValue": "{\n itemsPerPageOptions: [\n { label: \"10\", value: \"10\" },\n { label: \"25\", value: \"25\" },\n { label: \"50\", value: \"50\" },\n ],\n rangeLabelType: \"page\",\n type: \"simple\",\n showItemsPerPageControl: true,\n showGoToPageControl: true,\n alignment: \"right\",\n itemLabel: \"Item\",\n pageLabel: \"Page\",\n hideRangeLabel: false,\n hideAllFromItemsPerPage: false,\n monochrome: false,\n setToFirstPageOnPaginationChange: false,\n }"
|
1365
1560
|
},
|
1366
1561
|
"showPagination": {
|
1367
1562
|
"type": "boolean",
|
@@ -1626,6 +1821,21 @@ export class DataTable {
|
|
1626
1821
|
"resolved": "void",
|
1627
1822
|
"references": {}
|
1628
1823
|
}
|
1824
|
+
}, {
|
1825
|
+
"method": "icSelectedRowChange",
|
1826
|
+
"name": "icSelectedRowChange",
|
1827
|
+
"bubbles": true,
|
1828
|
+
"cancelable": true,
|
1829
|
+
"composed": true,
|
1830
|
+
"docs": {
|
1831
|
+
"tags": [],
|
1832
|
+
"text": "Emitted when the selected row changes in the data table."
|
1833
|
+
},
|
1834
|
+
"complexType": {
|
1835
|
+
"original": "object",
|
1836
|
+
"resolved": "object",
|
1837
|
+
"references": {}
|
1838
|
+
}
|
1629
1839
|
}, {
|
1630
1840
|
"method": "icSortChange",
|
1631
1841
|
"name": "icSortChange",
|