@ukic/canary-web-components 2.0.0-canary.21 → 2.0.0-canary.22
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-081d6031.js → helpers-093368be.js} +3 -1
- package/dist/cjs/helpers-093368be.js.map +1 -0
- package/dist/cjs/{helpers-261701cd.js → helpers-85c5ca15.js} +14 -1
- package/dist/cjs/helpers-85c5ca15.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +11 -6
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-horizontal.cjs.entry.js +1 -1
- package/dist/cjs/ic-card.cjs.entry.js +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +9 -3
- 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 +526 -71
- package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-input.cjs.entry.js +4 -3
- package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-picker.cjs.entry.js +5 -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 +1 -1
- package/dist/cjs/ic-empty-state_2.cjs.entry.js +2 -2
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
- package/dist/cjs/ic-input-component-container_4.cjs.entry.js +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-with-multi.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination_4.cjs.entry.js +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +41 -22
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
- package/dist/cjs/ic-select-with-multi.cjs.entry.js +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +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 +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 +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +1 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-tree-item.cjs.entry.js +241 -0
- package/dist/cjs/ic-tree-item.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-tree-view.cjs.entry.js +203 -0
- package/dist/cjs/ic-tree-view.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-typography.cjs.entry.js +47 -12
- package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
- package/dist/cjs/index-4cf27b16.js +8 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/arrow-dropdown.svg +3 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/ic-data-table/ic-data-table.css +55 -5
- package/dist/collection/components/ic-data-table/ic-data-table.js +570 -77
- 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 +364 -21
- 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 +1 -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.js +21 -2
- package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -1
- package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js +7 -0
- package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js.map +1 -1
- package/dist/collection/components/ic-date-picker/ic-date-picker.js +22 -0
- package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -1
- package/dist/collection/components/ic-tree-item/ic-tree-item.css +150 -0
- package/dist/collection/components/ic-tree-item/ic-tree-item.js +592 -0
- package/dist/collection/components/ic-tree-item/ic-tree-item.js.map +1 -0
- package/dist/collection/components/ic-tree-item/test/basic/ic-tree-item.spec.js +114 -0
- package/dist/collection/components/ic-tree-item/test/basic/ic-tree-item.spec.js.map +1 -0
- package/dist/collection/components/ic-tree-view/ic-tree-view.css +56 -0
- package/dist/collection/components/ic-tree-view/ic-tree-view.js +296 -0
- package/dist/collection/components/ic-tree-view/ic-tree-view.js.map +1 -0
- package/dist/collection/components/ic-tree-view/test/basic/ic-tree-view.spec.js +85 -0
- package/dist/collection/components/ic-tree-view/test/basic/ic-tree-view.spec.js.map +1 -0
- package/dist/components/helpers.js +2 -1
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/helpers2.js +11 -1
- package/dist/components/helpers2.js.map +1 -1
- package/dist/components/ic-alert2.js +1 -1
- package/dist/components/ic-back-to-top.js +1 -1
- package/dist/components/ic-badge.js +1 -1
- package/dist/components/ic-breadcrumb-group.js +1 -1
- package/dist/components/ic-breadcrumb2.js +1 -1
- package/dist/components/ic-button2.js +1 -1
- package/dist/components/ic-card.js +1 -1
- package/dist/components/ic-checkbox-group.js +1 -1
- package/dist/components/ic-checkbox.js +1 -1
- package/dist/components/ic-chip.js +9 -3
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-data-row.js +1 -1
- package/dist/components/ic-data-table.js +531 -72
- package/dist/components/ic-data-table.js.map +1 -1
- package/dist/components/ic-date-input2.js +5 -3
- package/dist/components/ic-date-input2.js.map +1 -1
- package/dist/components/ic-date-picker.js +6 -1
- package/dist/components/ic-date-picker.js.map +1 -1
- package/dist/components/ic-dialog.js +1 -1
- package/dist/components/ic-divider2.js +1 -1
- package/dist/components/ic-empty-state2.js +1 -1
- package/dist/components/ic-footer-link-group.js +1 -1
- package/dist/components/ic-footer-link.js +1 -1
- package/dist/components/ic-footer.js +1 -1
- package/dist/components/ic-hero.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-label2.js +1 -1
- package/dist/components/ic-input-validation2.js +1 -1
- package/dist/components/ic-link2.js +1 -1
- package/dist/components/ic-loading-indicator2.js +1 -1
- package/dist/components/ic-menu-group.js +1 -1
- package/dist/components/ic-menu-item2.js +1 -1
- package/dist/components/ic-menu3.js +1 -1
- package/dist/components/ic-navigation-button.js +1 -1
- package/dist/components/ic-navigation-group.js +1 -1
- package/dist/components/ic-navigation-item.js +1 -1
- package/dist/components/ic-navigation-menu2.js +1 -1
- package/dist/components/ic-page-header.js +1 -1
- package/dist/components/ic-pagination-bar2.js +1 -1
- package/dist/components/ic-pagination-item2.js +1 -1
- package/dist/components/ic-popover-menu.js +1 -1
- package/dist/components/ic-radio-group.js +41 -22
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js +1 -1
- package/dist/components/ic-search-bar.js +1 -1
- package/dist/components/ic-select-with-multi.js +1 -1
- package/dist/components/ic-select2.js +1 -1
- package/dist/components/ic-side-navigation.js +1 -1
- package/dist/components/ic-step.js +1 -1
- package/dist/components/ic-stepper.js +1 -1
- package/dist/components/ic-switch.js +1 -1
- package/dist/components/ic-tab-panel.js +1 -1
- package/dist/components/ic-text-field2.js +1 -1
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-toast.js +1 -1
- package/dist/components/ic-tooltip2.js +12 -5
- package/dist/components/ic-tooltip2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +1 -1
- package/dist/components/ic-tree-item.d.ts +11 -0
- package/dist/components/ic-tree-item.js +286 -0
- package/dist/components/ic-tree-item.js.map +1 -0
- package/dist/components/ic-tree-view.d.ts +11 -0
- package/dist/components/ic-tree-view.js +237 -0
- package/dist/components/ic-tree-view.js.map +1 -0
- package/dist/components/ic-typography2.js +53 -15
- package/dist/components/ic-typography2.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-e5b1dd58.entry.js → p-0180e00a.entry.js} +2 -2
- package/dist/core/{p-7f690fa3.entry.js → p-046f4de6.entry.js} +2 -2
- package/dist/core/{p-d5d36143.entry.js → p-06732eaf.entry.js} +2 -2
- package/dist/core/p-0ec04c16.entry.js +2 -0
- package/dist/core/p-0ec04c16.entry.js.map +1 -0
- package/dist/core/{p-01297278.entry.js → p-13993bf3.entry.js} +2 -2
- package/dist/core/{p-693a77bb.entry.js → p-16a48a63.entry.js} +2 -2
- package/dist/core/{p-d91428b4.entry.js → p-216fbd5e.entry.js} +2 -2
- package/dist/core/{p-a8c97918.entry.js → p-2d063032.entry.js} +2 -2
- package/dist/core/{p-2647931d.entry.js → p-2ee5d3fb.entry.js} +2 -2
- package/dist/core/p-355c8532.entry.js +2 -0
- package/dist/core/p-355c8532.entry.js.map +1 -0
- package/dist/core/p-3a59391f.entry.js +2 -0
- package/dist/core/{p-66595f5f.entry.js.map → p-3a59391f.entry.js.map} +1 -1
- package/dist/core/{p-007da09d.entry.js → p-3f2723aa.entry.js} +2 -2
- package/dist/core/p-401d0c66.entry.js +2 -0
- package/dist/core/p-401d0c66.entry.js.map +1 -0
- package/dist/core/p-413e68be.entry.js +2 -0
- package/dist/core/{p-a4585c7e.entry.js.map → p-413e68be.entry.js.map} +1 -1
- package/dist/core/{p-a970d653.entry.js → p-418a84d4.entry.js} +2 -2
- package/dist/core/{p-354e5dbe.entry.js → p-41916ef7.entry.js} +2 -2
- package/dist/core/p-4309460f.entry.js +2 -0
- package/dist/core/p-4309460f.entry.js.map +1 -0
- package/dist/core/{p-6f8fd43e.entry.js → p-486a6957.entry.js} +2 -2
- package/dist/core/{p-b3ed5423.entry.js → p-5348af01.entry.js} +2 -2
- package/dist/core/p-57043b1e.entry.js +2 -0
- package/dist/core/{p-d68e0c94.entry.js.map → p-57043b1e.entry.js.map} +1 -1
- package/dist/core/{p-6b74397a.entry.js → p-59993f36.entry.js} +2 -2
- package/dist/core/{p-be4c0cc8.entry.js → p-6398a726.entry.js} +2 -2
- package/dist/core/{p-9e7a5c72.entry.js → p-648fb902.entry.js} +2 -2
- package/dist/core/{p-d3ea79e1.entry.js → p-673a4a62.entry.js} +2 -2
- package/dist/core/{p-fb4219d6.entry.js → p-67ae9d37.entry.js} +2 -2
- package/dist/core/{p-0ea28e7a.entry.js → p-6b01e096.entry.js} +2 -2
- package/dist/core/{p-40fc7162.entry.js → p-6b1fcf87.entry.js} +2 -2
- package/dist/core/{p-1d0cff8a.entry.js → p-6fb3d61e.entry.js} +2 -2
- package/dist/core/{p-1733278a.entry.js → p-789ae7f5.entry.js} +2 -2
- package/dist/core/{p-45ebcb74.js → p-8128572e.js} +2 -2
- package/dist/{esm/helpers-d41662f3.js.map → core/p-8128572e.js.map} +1 -1
- package/dist/core/p-84eaa486.entry.js +2 -0
- package/dist/core/p-84eaa486.entry.js.map +1 -0
- package/dist/core/{p-0944d33b.entry.js → p-89c7ea3e.entry.js} +2 -2
- package/dist/core/{p-96670e29.entry.js → p-8d276e8f.entry.js} +2 -2
- package/dist/core/{p-569a68c0.entry.js → p-91cf89c8.entry.js} +2 -2
- package/dist/core/p-91cf89c8.entry.js.map +1 -0
- package/dist/core/p-969cadfa.entry.js +2 -0
- package/dist/core/p-969cadfa.entry.js.map +1 -0
- package/dist/core/{p-d44b7f21.entry.js → p-97f141a6.entry.js} +2 -2
- package/dist/core/{p-9f8ef2bc.entry.js → p-99185fd5.entry.js} +2 -2
- package/dist/core/{p-1ac733c1.entry.js → p-99f96c33.entry.js} +2 -2
- package/dist/core/{p-4e6f7cfe.entry.js → p-a052bb95.entry.js} +2 -2
- package/dist/core/{p-9e69f517.entry.js → p-a72af8db.entry.js} +2 -2
- package/dist/core/{p-ae7c2c39.entry.js → p-a787bba7.entry.js} +2 -2
- package/dist/core/{p-e393e53c.entry.js → p-aa72f551.entry.js} +2 -2
- package/dist/core/{p-3d9eca50.entry.js → p-aaaa9261.entry.js} +2 -2
- package/dist/core/p-adbe0d89.js +2 -0
- package/dist/core/p-adbe0d89.js.map +1 -0
- package/dist/core/{p-a589ead8.entry.js → p-b29e96b5.entry.js} +2 -2
- package/dist/core/p-b97eba08.entry.js +2 -0
- package/dist/core/p-b97eba08.entry.js.map +1 -0
- package/dist/core/{p-fab8da25.entry.js → p-bfc5f3f4.entry.js} +2 -2
- package/dist/core/{p-e2421111.entry.js → p-cb3afdbf.entry.js} +2 -2
- package/dist/core/{p-d06c0049.entry.js → p-ccf72538.entry.js} +2 -2
- package/dist/core/{p-0551f0cf.entry.js → p-ce0999f1.entry.js} +2 -2
- package/dist/core/{p-01008e8d.entry.js → p-d02a4d1b.entry.js} +2 -2
- package/dist/core/{p-ffeca3c7.entry.js → p-d8322108.entry.js} +2 -2
- package/dist/core/{p-fdacc7f7.entry.js → p-d86cdbc8.entry.js} +2 -2
- package/dist/core/{p-59d9ea22.entry.js → p-da8255b8.entry.js} +2 -2
- package/dist/core/{p-6e697a16.entry.js → p-e9f5ebb3.entry.js} +2 -2
- package/dist/core/p-e9f5ebb3.entry.js.map +1 -0
- package/dist/core/{p-145c8074.entry.js → p-ede631c5.entry.js} +2 -2
- package/dist/core/{p-d39239be.entry.js → p-f09b2041.entry.js} +2 -2
- package/dist/core/{p-169bcf0f.entry.js → p-f1044e4d.entry.js} +2 -2
- package/dist/core/{p-3be4aae0.entry.js → p-f10f7f37.entry.js} +2 -2
- package/dist/core/{p-a6d3743c.entry.js → p-fa77211d.entry.js} +2 -2
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-d41662f3.js → helpers-886489d5.js} +3 -2
- package/dist/esm/helpers-886489d5.js.map +1 -0
- package/dist/esm/{helpers-e75fd113.js → helpers-f543bc77.js} +12 -2
- package/dist/esm/helpers-f543bc77.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +1 -1
- package/dist/esm/ic-accordion.entry.js +1 -1
- package/dist/esm/ic-alert.entry.js +1 -1
- package/dist/esm/ic-back-to-top.entry.js +1 -1
- package/dist/esm/ic-badge.entry.js +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js +11 -6
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card-horizontal.entry.js +1 -1
- package/dist/esm/ic-card.entry.js +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +1 -1
- package/dist/esm/ic-checkbox.entry.js +1 -1
- package/dist/esm/ic-chip.entry.js +9 -3
- 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 +526 -71
- package/dist/esm/ic-data-table.entry.js.map +1 -1
- package/dist/esm/ic-date-input.entry.js +4 -3
- package/dist/esm/ic-date-input.entry.js.map +1 -1
- package/dist/esm/ic-date-picker.entry.js +5 -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 +1 -1
- package/dist/esm/ic-empty-state_2.entry.js +2 -2
- package/dist/esm/ic-footer-link-group.entry.js +1 -1
- package/dist/esm/ic-footer-link.entry.js +1 -1
- package/dist/esm/ic-footer.entry.js +1 -1
- package/dist/esm/ic-hero.entry.js +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
- package/dist/esm/ic-input-component-container_4.entry.js +1 -1
- package/dist/esm/ic-link.entry.js +1 -1
- package/dist/esm/ic-menu-group.entry.js +1 -1
- package/dist/esm/ic-menu-item.entry.js +1 -1
- package/dist/esm/ic-menu-with-multi.entry.js +1 -1
- package/dist/esm/ic-menu.entry.js +1 -1
- package/dist/esm/ic-navigation-button.entry.js +1 -1
- package/dist/esm/ic-navigation-group.entry.js +1 -1
- package/dist/esm/ic-navigation-item.entry.js +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +1 -1
- package/dist/esm/ic-page-header.entry.js +1 -1
- package/dist/esm/ic-pagination_4.entry.js +1 -1
- package/dist/esm/ic-popover-menu.entry.js +1 -1
- package/dist/esm/ic-radio-group.entry.js +41 -22
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +1 -1
- package/dist/esm/ic-search-bar.entry.js +1 -1
- package/dist/esm/ic-select-with-multi.entry.js +1 -1
- package/dist/esm/ic-side-navigation.entry.js +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 +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 +1 -1
- package/dist/esm/ic-theme.entry.js +1 -1
- package/dist/esm/ic-toast.entry.js +1 -1
- package/dist/esm/ic-toggle-button.entry.js +1 -1
- package/dist/esm/ic-top-navigation.entry.js +1 -1
- package/dist/esm/ic-tree-item.entry.js +237 -0
- package/dist/esm/ic-tree-item.entry.js.map +1 -0
- package/dist/esm/ic-tree-view.entry.js +199 -0
- package/dist/esm/ic-tree-view.entry.js.map +1 -0
- package/dist/esm/ic-typography.entry.js +48 -13
- package/dist/esm/ic-typography.entry.js.map +1 -1
- package/dist/esm/index-93509377.js +8 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-data-table/ic-data-table.d.ts +68 -7
- package/dist/types/components/ic-data-table/ic-data-table.types.d.ts +9 -0
- package/dist/types/components/ic-data-table/story-data.d.ts +112 -0
- package/dist/types/components/ic-date-input/ic-date-input.d.ts +4 -0
- package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +4 -0
- package/dist/types/components/ic-tree-item/ic-tree-item.d.ts +95 -0
- package/dist/types/components/ic-tree-view/ic-tree-view.d.ts +40 -0
- package/dist/types/components.d.ts +173 -6
- package/hydrate/index.js +1175 -161
- package/package.json +3 -3
- package/dist/cjs/helpers-081d6031.js.map +0 -1
- package/dist/cjs/helpers-261701cd.js.map +0 -1
- package/dist/core/p-32a3b6c8.entry.js +0 -2
- package/dist/core/p-32a3b6c8.entry.js.map +0 -1
- package/dist/core/p-45ebcb74.js.map +0 -1
- package/dist/core/p-569a68c0.entry.js.map +0 -1
- package/dist/core/p-66595f5f.entry.js +0 -2
- package/dist/core/p-6e697a16.entry.js.map +0 -1
- package/dist/core/p-a4585c7e.entry.js +0 -2
- package/dist/core/p-c04f1bfb.entry.js +0 -2
- package/dist/core/p-c04f1bfb.entry.js.map +0 -1
- package/dist/core/p-d448bdbd.entry.js +0 -2
- package/dist/core/p-d448bdbd.entry.js.map +0 -1
- package/dist/core/p-d68e0c94.entry.js +0 -2
- package/dist/core/p-e191290c.entry.js +0 -2
- package/dist/core/p-e191290c.entry.js.map +0 -1
- package/dist/core/p-f6735e4a.js +0 -2
- package/dist/core/p-f6735e4a.js.map +0 -1
- package/dist/core/p-fc0eac8b.entry.js +0 -2
- package/dist/core/p-fc0eac8b.entry.js.map +0 -1
- package/dist/esm/helpers-e75fd113.js.map +0 -1
- /package/dist/core/{p-e5b1dd58.entry.js.map → p-0180e00a.entry.js.map} +0 -0
- /package/dist/core/{p-7f690fa3.entry.js.map → p-046f4de6.entry.js.map} +0 -0
- /package/dist/core/{p-d5d36143.entry.js.map → p-06732eaf.entry.js.map} +0 -0
- /package/dist/core/{p-01297278.entry.js.map → p-13993bf3.entry.js.map} +0 -0
- /package/dist/core/{p-693a77bb.entry.js.map → p-16a48a63.entry.js.map} +0 -0
- /package/dist/core/{p-d91428b4.entry.js.map → p-216fbd5e.entry.js.map} +0 -0
- /package/dist/core/{p-a8c97918.entry.js.map → p-2d063032.entry.js.map} +0 -0
- /package/dist/core/{p-2647931d.entry.js.map → p-2ee5d3fb.entry.js.map} +0 -0
- /package/dist/core/{p-007da09d.entry.js.map → p-3f2723aa.entry.js.map} +0 -0
- /package/dist/core/{p-a970d653.entry.js.map → p-418a84d4.entry.js.map} +0 -0
- /package/dist/core/{p-354e5dbe.entry.js.map → p-41916ef7.entry.js.map} +0 -0
- /package/dist/core/{p-6f8fd43e.entry.js.map → p-486a6957.entry.js.map} +0 -0
- /package/dist/core/{p-b3ed5423.entry.js.map → p-5348af01.entry.js.map} +0 -0
- /package/dist/core/{p-6b74397a.entry.js.map → p-59993f36.entry.js.map} +0 -0
- /package/dist/core/{p-be4c0cc8.entry.js.map → p-6398a726.entry.js.map} +0 -0
- /package/dist/core/{p-9e7a5c72.entry.js.map → p-648fb902.entry.js.map} +0 -0
- /package/dist/core/{p-d3ea79e1.entry.js.map → p-673a4a62.entry.js.map} +0 -0
- /package/dist/core/{p-fb4219d6.entry.js.map → p-67ae9d37.entry.js.map} +0 -0
- /package/dist/core/{p-0ea28e7a.entry.js.map → p-6b01e096.entry.js.map} +0 -0
- /package/dist/core/{p-40fc7162.entry.js.map → p-6b1fcf87.entry.js.map} +0 -0
- /package/dist/core/{p-1d0cff8a.entry.js.map → p-6fb3d61e.entry.js.map} +0 -0
- /package/dist/core/{p-1733278a.entry.js.map → p-789ae7f5.entry.js.map} +0 -0
- /package/dist/core/{p-0944d33b.entry.js.map → p-89c7ea3e.entry.js.map} +0 -0
- /package/dist/core/{p-96670e29.entry.js.map → p-8d276e8f.entry.js.map} +0 -0
- /package/dist/core/{p-d44b7f21.entry.js.map → p-97f141a6.entry.js.map} +0 -0
- /package/dist/core/{p-9f8ef2bc.entry.js.map → p-99185fd5.entry.js.map} +0 -0
- /package/dist/core/{p-1ac733c1.entry.js.map → p-99f96c33.entry.js.map} +0 -0
- /package/dist/core/{p-4e6f7cfe.entry.js.map → p-a052bb95.entry.js.map} +0 -0
- /package/dist/core/{p-9e69f517.entry.js.map → p-a72af8db.entry.js.map} +0 -0
- /package/dist/core/{p-ae7c2c39.entry.js.map → p-a787bba7.entry.js.map} +0 -0
- /package/dist/core/{p-e393e53c.entry.js.map → p-aa72f551.entry.js.map} +0 -0
- /package/dist/core/{p-3d9eca50.entry.js.map → p-aaaa9261.entry.js.map} +0 -0
- /package/dist/core/{p-a589ead8.entry.js.map → p-b29e96b5.entry.js.map} +0 -0
- /package/dist/core/{p-fab8da25.entry.js.map → p-bfc5f3f4.entry.js.map} +0 -0
- /package/dist/core/{p-e2421111.entry.js.map → p-cb3afdbf.entry.js.map} +0 -0
- /package/dist/core/{p-d06c0049.entry.js.map → p-ccf72538.entry.js.map} +0 -0
- /package/dist/core/{p-0551f0cf.entry.js.map → p-ce0999f1.entry.js.map} +0 -0
- /package/dist/core/{p-01008e8d.entry.js.map → p-d02a4d1b.entry.js.map} +0 -0
- /package/dist/core/{p-ffeca3c7.entry.js.map → p-d8322108.entry.js.map} +0 -0
- /package/dist/core/{p-fdacc7f7.entry.js.map → p-d86cdbc8.entry.js.map} +0 -0
- /package/dist/core/{p-59d9ea22.entry.js.map → p-da8255b8.entry.js.map} +0 -0
- /package/dist/core/{p-145c8074.entry.js.map → p-ede631c5.entry.js.map} +0 -0
- /package/dist/core/{p-d39239be.entry.js.map → p-f09b2041.entry.js.map} +0 -0
- /package/dist/core/{p-169bcf0f.entry.js.map → p-f1044e4d.entry.js.map} +0 -0
- /package/dist/core/{p-3be4aae0.entry.js.map → p-f10f7f37.entry.js.map} +0 -0
- /package/dist/core/{p-a6d3743c.entry.js.map → p-fa77211d.entry.js.map} +0 -0
@@ -4,17 +4,7 @@ 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 { getSlotContent, isSlotUsed } from "../../utils/helpers";
|
8
|
-
const DENSITY_HEIGHT_MULTIPLIER = {
|
9
|
-
dense: 0.8,
|
10
|
-
default: 1,
|
11
|
-
spacious: 1.2,
|
12
|
-
};
|
13
|
-
const SORT_ICONS = {
|
14
|
-
unsorted: unsortedIcon,
|
15
|
-
ascending: ascendingIcon,
|
16
|
-
descending: descendingIcon,
|
17
|
-
};
|
7
|
+
import { getSlotContent, isEmptyString, isSlotUsed, pxToRem, debounce, } from "../../utils/helpers";
|
18
8
|
/**
|
19
9
|
* @slot empty-state - Content is slotted below the table header when there is no data and the table is not loading.
|
20
10
|
* @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.
|
@@ -24,7 +14,155 @@ const SORT_ICONS = {
|
|
24
14
|
*/
|
25
15
|
export class DataTable {
|
26
16
|
constructor() {
|
17
|
+
this.DENSITY_HEIGHT_MULTIPLIER = {
|
18
|
+
dense: 0.8,
|
19
|
+
default: 1,
|
20
|
+
spacious: 1.2,
|
21
|
+
};
|
22
|
+
this.DENSITY_PADDING_HEIGHT_DIFF = {
|
23
|
+
dense: 8,
|
24
|
+
default: 16,
|
25
|
+
spacious: 20,
|
26
|
+
};
|
27
|
+
this.SORT_ICONS = {
|
28
|
+
unsorted: unsortedIcon,
|
29
|
+
ascending: ascendingIcon,
|
30
|
+
descending: descendingIcon,
|
31
|
+
};
|
27
32
|
this.hasLoadedForOneSecond = true;
|
33
|
+
this.resizeObserver = null;
|
34
|
+
this.SHOW_HIDE_STRING = "show-hide";
|
35
|
+
this.SHOW_HIDE_CSS_CLASS = `${this.SHOW_HIDE_STRING}-wrap`;
|
36
|
+
this.TOOLTIP_STRING = "tooltip";
|
37
|
+
this.TOOLTIP = `ic-${this.TOOLTIP_STRING}`;
|
38
|
+
this.TEXT_WRAP_STRING = "text-wrap";
|
39
|
+
this.TEXT_WRAP_CLASS = `.${this.TEXT_WRAP_STRING}`;
|
40
|
+
this.dataUpdated = false;
|
41
|
+
this.rowHeightSet = false;
|
42
|
+
this.initialLoad = false;
|
43
|
+
this.icPageChangeEvent = false;
|
44
|
+
this.itemsPerPageChange = false;
|
45
|
+
this.DATA_ROW_HEIGHT_STRING = "data-row-height";
|
46
|
+
this.DEFAULT_LINE_HEIGHT = 24;
|
47
|
+
this.densityUpdate = false;
|
48
|
+
this.updateSetRowHeight = (typographyEl) => {
|
49
|
+
const fontSize = parseInt(getComputedStyle(document.documentElement).fontSize);
|
50
|
+
if (typographyEl) {
|
51
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
52
|
+
const rowHeight = fontSize *
|
53
|
+
parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
54
|
+
if (typographyEl.scrollHeight > rowHeight) {
|
55
|
+
cellContainer.style.removeProperty("height");
|
56
|
+
}
|
57
|
+
}
|
58
|
+
else {
|
59
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
60
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
61
|
+
const rowHeight = fontSize *
|
62
|
+
parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
63
|
+
if (typographyEl.scrollHeight > rowHeight) {
|
64
|
+
cellContainer.style.removeProperty("height");
|
65
|
+
}
|
66
|
+
});
|
67
|
+
}
|
68
|
+
};
|
69
|
+
this.debounceDataTruncation = () => {
|
70
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
71
|
+
if (!typographyEl.classList.contains(this.TEXT_WRAP_STRING)) {
|
72
|
+
this.resizeObserver = new ResizeObserver(
|
73
|
+
// This gets triggered twice due to updated data and see more/see less button
|
74
|
+
debounce(() => {
|
75
|
+
// console.log("resizeObserver triggered");
|
76
|
+
this.dataTruncation(typographyEl);
|
77
|
+
}, 200));
|
78
|
+
this.resizeObserver.observe(typographyEl);
|
79
|
+
}
|
80
|
+
});
|
81
|
+
};
|
82
|
+
this.getLines = (height) => Math.floor(height / this.DEFAULT_LINE_HEIGHT);
|
83
|
+
this.truncate = (typographyEl, cellContainer, tooltip) => {
|
84
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
|
85
|
+
//24 is the height of a single line
|
86
|
+
if (!typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
87
|
+
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
88
|
+
this.addTooltipTruncation(typographyEl, cellContainer, tooltip);
|
89
|
+
}
|
90
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
91
|
+
this.addShowHideTruncation(cellContainer, typographyEl);
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
else {
|
96
|
+
if (this.truncationPattern === this.TOOLTIP_STRING && tooltip) {
|
97
|
+
typographyEl.setAttribute("style", `--ic-line-clamp: 0`);
|
98
|
+
cellContainer.appendChild(typographyEl);
|
99
|
+
tooltip.remove();
|
100
|
+
}
|
101
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING &&
|
102
|
+
!isEmptyString(typographyEl.getAttribute("max-lines"))) {
|
103
|
+
this.resetShowHideTruncation(typographyEl);
|
104
|
+
}
|
105
|
+
}
|
106
|
+
};
|
107
|
+
this.dataTruncation = (typographyEl) => {
|
108
|
+
// Tooltip truncation mentioned in AC. Will need revisiting
|
109
|
+
const tooltip = this.getTooltip(typographyEl);
|
110
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
111
|
+
if ((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.classList.contains("data-type-element")) ||
|
112
|
+
this.dataUpdated) {
|
113
|
+
return;
|
114
|
+
}
|
115
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING &&
|
116
|
+
typographyEl.shadowRoot.querySelector("button")) {
|
117
|
+
const showHideBtn = typographyEl.shadowRoot.querySelector("button");
|
118
|
+
// If the see more/see less is present and the max lines is equal to the cell container
|
119
|
+
// remove the see more/see less button
|
120
|
+
if (showHideBtn) {
|
121
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
122
|
+
if (this.getLines(truncWrapper.scrollHeight) ===
|
123
|
+
+typographyEl.getAttribute("max-lines")) {
|
124
|
+
this.resetShowHideTruncation(typographyEl);
|
125
|
+
}
|
126
|
+
}
|
127
|
+
}
|
128
|
+
// Deals with setting and resetting row height and re-truncating data
|
129
|
+
if (this.rowHeightSet && this.truncationPattern === this.SHOW_HIDE_STRING) {
|
130
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
131
|
+
// cellContainer.clientHeight - 24 removes the extra line by see more/see less
|
132
|
+
if (truncWrapper &&
|
133
|
+
cellContainer.clientHeight - this.DEFAULT_LINE_HEIGHT >
|
134
|
+
truncWrapper.scrollHeight) {
|
135
|
+
this.resetShowHideTruncation(typographyEl);
|
136
|
+
return;
|
137
|
+
}
|
138
|
+
if (typographyEl.scrollHeight > cellContainer.clientHeight) {
|
139
|
+
this.addShowHideTruncation(cellContainer, typographyEl);
|
140
|
+
return;
|
141
|
+
}
|
142
|
+
}
|
143
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > 0 &&
|
144
|
+
(cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) > 0 &&
|
145
|
+
(typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) === (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
|
146
|
+
if (tooltip) {
|
147
|
+
this.removeTooltip(cellContainer, typographyEl, tooltip);
|
148
|
+
}
|
149
|
+
return;
|
150
|
+
}
|
151
|
+
this.truncate(typographyEl, cellContainer, tooltip);
|
152
|
+
};
|
153
|
+
this.removeTextWrap = () => {
|
154
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
155
|
+
const tableCell = typographyEl.closest("td");
|
156
|
+
if (tableCell.classList.contains(this.TEXT_WRAP_STRING)) {
|
157
|
+
tableCell.classList.remove(this.TEXT_WRAP_STRING);
|
158
|
+
}
|
159
|
+
});
|
160
|
+
};
|
161
|
+
this.getCellContainer = (typographyEl) => {
|
162
|
+
return typographyEl.closest(".cell-container");
|
163
|
+
};
|
164
|
+
this.deleteTextWrapDataKey = (array) => Array.isArray(array) &&
|
165
|
+
array.forEach((val) => val.textWrap && delete val.textWrap);
|
28
166
|
this.startLoadingTimer = () => {
|
29
167
|
this.hasLoadedForOneSecond = false;
|
30
168
|
this.timerStarted = Date.now();
|
@@ -50,13 +188,31 @@ export class DataTable {
|
|
50
188
|
return this.getObjectValue(this.getObjectValue(cell, "cellAlignment"), alignment);
|
51
189
|
}
|
52
190
|
};
|
191
|
+
this.getCellOptions = (cell, key) => {
|
192
|
+
if (!(this.isObject(cell) && Object.keys(cell).includes(key)))
|
193
|
+
return;
|
194
|
+
return this.getObjectValue(cell, key);
|
195
|
+
};
|
53
196
|
this.createUpdatingIndicator = () => {
|
54
197
|
const { appearance, description, max, min, progress } = this.updatingOptions || {};
|
55
198
|
return (h("th", { colSpan: this.columns.length, class: "updating-state" }, h("ic-loading-indicator", { appearance: appearance, description: description || "Updating table data", fullWidth: true, max: max, min: min, progress: progress, type: "linear", size: "small" })));
|
56
199
|
};
|
200
|
+
this.setRowHeight = (height) => {
|
201
|
+
return pxToRem(`${height * this.DENSITY_HEIGHT_MULTIPLIER[this.density] -
|
202
|
+
this.DENSITY_PADDING_HEIGHT_DIFF[this.density]}px`);
|
203
|
+
};
|
204
|
+
this.setTruncationClass = () => {
|
205
|
+
if (this.truncationPattern) {
|
206
|
+
return { [`truncation-${this.truncationPattern}`]: true };
|
207
|
+
}
|
208
|
+
return {};
|
209
|
+
};
|
57
210
|
this.createCells = (row, rowIndex) => {
|
211
|
+
var _a;
|
58
212
|
const rowValues = Object.values(row);
|
59
213
|
const rowKeys = Object.keys(row);
|
214
|
+
const index = rowIndex;
|
215
|
+
const rowOptions = this.getRowOptions(rowKeys, rowValues);
|
60
216
|
let rowAlignment;
|
61
217
|
let rowEmphasis;
|
62
218
|
const headerIndex = rowKeys.indexOf("header");
|
@@ -64,42 +220,63 @@ export class DataTable {
|
|
64
220
|
rowAlignment = this.getObjectValue(rowValues[headerIndex], "rowAlignment");
|
65
221
|
rowEmphasis = this.getObjectValue(rowValues[headerIndex], "emphasis");
|
66
222
|
}
|
223
|
+
const variableRowHeightVal = (_a = this.variableRowHeight) === null || _a === void 0 ? void 0 : _a.call(this, Object.assign(Object.assign({}, row), { index }));
|
224
|
+
const currentRowHeight = variableRowHeightVal
|
225
|
+
? variableRowHeightVal !== "auto" && variableRowHeightVal
|
226
|
+
: this.globalRowHeight !== "auto" && this.globalRowHeight;
|
67
227
|
return rowValues.map((cell, index) => {
|
68
|
-
var _a, _b, _c, _d, _e;
|
228
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
69
229
|
const columnProps = this.columns[index];
|
70
230
|
const cellSlotName = `${columnProps === null || columnProps === void 0 ? void 0 : columnProps.key}-${rowIndex}`;
|
71
231
|
const hasIcon = this.isObject(cell) && Object.keys(cell).includes("icon");
|
72
232
|
const cellValue = (key) => this.getObjectValue(cell, key);
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
this.
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
233
|
+
if (rowKeys[index] === "header") {
|
234
|
+
return (h("th", { scope: "row", colSpan: cellValue("colspan"), class: {
|
235
|
+
["row-header"]: true,
|
236
|
+
[`row-header-alignment-${cellValue("cellAlignment")}`]: !!cellValue("cellAlignment"),
|
237
|
+
["row-header-sticky"]: this.stickyRowHeaders,
|
238
|
+
} }, cellValue("title")));
|
239
|
+
}
|
240
|
+
if (rowKeys[index] !== "rowOptions") {
|
241
|
+
return (h("td", { class: {
|
242
|
+
["table-cell"]: true,
|
243
|
+
[`table-density-${this.density}`]: this.notDefaultDensity(),
|
244
|
+
} }, h("div", { innerHTML: (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) === "element" &&
|
245
|
+
!isSlotUsed(this.el, cellSlotName)
|
246
|
+
? cell
|
247
|
+
: null, class: 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) ||
|
248
|
+
((_b = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _b === void 0 ? void 0 : _b.vertical) ||
|
249
|
+
rowAlignment ||
|
250
|
+
this.getCellAlignment(cell, "vertical")}`]: !!((_c = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _c === void 0 ? void 0 : _c.vertical) ||
|
251
|
+
!!((_d = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _d === void 0 ? void 0 : _d.vertical) ||
|
252
|
+
!!rowAlignment ||
|
253
|
+
!!this.getCellAlignment(cell, "vertical"), [`cell-alignment-${((_e = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _e === void 0 ? void 0 : _e.horizontal) ||
|
254
|
+
((_f = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _f === void 0 ? void 0 : _f.horizontal) ||
|
255
|
+
this.getCellAlignment(cell, "horizontal")}`]: !!((_g = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _g === void 0 ? void 0 : _g.horizontal) ||
|
256
|
+
!!((_h = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _h === void 0 ? void 0 : _h.horizontal) ||
|
257
|
+
!!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) ||
|
258
|
+
(rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.textWrap) ||
|
259
|
+
!!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) }, this.setTruncationClass()), style: {
|
260
|
+
height: (this.truncationPattern || currentRowHeight) &&
|
261
|
+
!columnProps.textWrap &&
|
262
|
+
!rowOptions.textWrap &&
|
263
|
+
!this.getCellOptions(cell, "textWrap") &&
|
264
|
+
(columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "element"
|
265
|
+
? this.setRowHeight(currentRowHeight)
|
266
|
+
: null,
|
267
|
+
}, "data-row-height": this.truncationPattern || currentRowHeight
|
268
|
+
? this.setRowHeight(currentRowHeight)
|
269
|
+
: 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)) && (h("span", { class: "icon", innerHTML: cellValue("icon") || (columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon.icon) }))), (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "element" &&
|
270
|
+
!isSlotUsed(this.el, cellSlotName) && (h("ic-typography", { variant: "body", class: {
|
271
|
+
[`cell-emphasis-${(this.isObject(cell) && cellValue("emphasis")) ||
|
272
|
+
(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
|
273
|
+
rowEmphasis}`]: (this.isObject(cell) && !!cellValue("emphasis")) ||
|
274
|
+
!!(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
|
275
|
+
!!rowEmphasis,
|
276
|
+
[`text-${this.density}`]: this.notDefaultDensity(),
|
277
|
+
} }, this.isObject(cell) &&
|
278
|
+
(columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "date" ? (Object.keys(cell).includes("href") ? (h("ic-link", { href: cellValue("href") }, cellValue("data"))) : (cellValue("data"))) : (this.getCellContent(cell, columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType)))))))));
|
279
|
+
}
|
103
280
|
});
|
104
281
|
};
|
105
282
|
this.createColumnHeaders = () => {
|
@@ -116,7 +293,7 @@ export class DataTable {
|
|
116
293
|
[`text-${this.density}`]: this.notDefaultDensity(),
|
117
294
|
} }, title), this.sortable && (h("ic-button", { variant: "icon", id: `sort-button-${key}`, "aria-label": this.getSortButtonLabel(key),
|
118
295
|
// eslint-disable-next-line react/jsx-no-bind
|
119
|
-
onClick: () => this.sortRows(key), innerHTML: SORT_ICONS[this.sortedColumn === key
|
296
|
+
onClick: () => this.sortRows(key), innerHTML: this.SORT_ICONS[this.sortedColumn === key
|
120
297
|
? this.sortedColumnOrder
|
121
298
|
: "unsorted"], class: {
|
122
299
|
["sort-button"]: true,
|
@@ -124,6 +301,10 @@ export class DataTable {
|
|
124
301
|
this.sortedColumnOrder === "unsorted",
|
125
302
|
} }))))));
|
126
303
|
};
|
304
|
+
this.onRowClick = (row) => {
|
305
|
+
this.selectedRow =
|
306
|
+
this.selectedRow !== row && !this.loading && !this.updating && row;
|
307
|
+
};
|
127
308
|
this.createRows = () => {
|
128
309
|
const data = this.showPagination
|
129
310
|
? this.data.slice(this.fromRow, this.toRow)
|
@@ -143,24 +324,11 @@ export class DataTable {
|
|
143
324
|
return data
|
144
325
|
.sort(!this.sortable ? undefined : this.getSortFunction())
|
145
326
|
.map((row, index) => {
|
146
|
-
var _a;
|
147
|
-
const variableRowHeightVal = (_a = this.variableRowHeight) === null || _a === void 0 ? void 0 : _a.call(this, Object.assign(Object.assign({}, row), { index }));
|
148
|
-
const findRowHeight = variableRowHeightVal
|
149
|
-
? variableRowHeightVal !== "auto" && variableRowHeightVal
|
150
|
-
: this.globalRowHeight !== "auto" && this.globalRowHeight;
|
151
327
|
return (h("tr", {
|
152
328
|
// eslint-disable-next-line react/jsx-no-bind
|
153
|
-
onClick: () =>
|
154
|
-
this.selectedRow !== row &&
|
155
|
-
!this.loading &&
|
156
|
-
!this.updating &&
|
157
|
-
row), class: {
|
329
|
+
onClick: () => this.onRowClick(row), class: {
|
158
330
|
["table-row"]: true,
|
159
331
|
["table-row-selected"]: this.selectedRow === row,
|
160
|
-
}, style: {
|
161
|
-
height: findRowHeight
|
162
|
-
? `${findRowHeight * DENSITY_HEIGHT_MULTIPLIER[this.density]}px`
|
163
|
-
: null,
|
164
332
|
}
|
165
333
|
}, this.createCells(row, index)));
|
166
334
|
});
|
@@ -223,6 +391,25 @@ export class DataTable {
|
|
223
391
|
}
|
224
392
|
this.sortedColumnOrder = sortOrders[nextSortOrderIndex];
|
225
393
|
sortButton.setAttribute("aria-label", this.getSortButtonLabel(column));
|
394
|
+
this.tableSorted = true;
|
395
|
+
};
|
396
|
+
this.getTypographyElements = () => {
|
397
|
+
return Array.from(this.el.shadowRoot.querySelectorAll("ic-typography:not(.column-header-text)"));
|
398
|
+
};
|
399
|
+
this.getTooltip = (typographyEl) => {
|
400
|
+
return typographyEl.closest(this.TOOLTIP);
|
401
|
+
};
|
402
|
+
this.updateTruncationTooltip = (removeTooltipOnly = false) => {
|
403
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
404
|
+
const tooltip = this.getTooltip(typographyEl);
|
405
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
406
|
+
if (typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
407
|
+
this.removeTooltip(cellContainer, typographyEl, tooltip);
|
408
|
+
typographyEl.setAttribute("style", `--ic-line-clamp: 0`);
|
409
|
+
return;
|
410
|
+
}
|
411
|
+
this.regenerateTooltip(cellContainer, typographyEl, tooltip, removeTooltipOnly);
|
412
|
+
});
|
226
413
|
};
|
227
414
|
this.updateScrollOffset = () => {
|
228
415
|
this.scrollOffset = this.el.shadowRoot.querySelector(".table-row-container").scrollTop;
|
@@ -236,12 +423,13 @@ export class DataTable {
|
|
236
423
|
this.sortedColumn = undefined;
|
237
424
|
this.sortedColumnOrder = undefined;
|
238
425
|
this.toRow = undefined;
|
426
|
+
this.currentRowHeight = undefined;
|
239
427
|
this.caption = undefined;
|
240
428
|
this.columns = undefined;
|
241
429
|
this.data = undefined;
|
242
430
|
this.density = "default";
|
243
431
|
this.embedded = false;
|
244
|
-
this.globalRowHeight =
|
432
|
+
this.globalRowHeight = "auto";
|
245
433
|
this.hideColumnHeaders = false;
|
246
434
|
this.loading = false;
|
247
435
|
this.loadingOptions = undefined;
|
@@ -270,10 +458,15 @@ export class DataTable {
|
|
270
458
|
};
|
271
459
|
this.stickyColumnHeaders = false;
|
272
460
|
this.stickyRowHeaders = false;
|
461
|
+
this.truncationPattern = undefined;
|
273
462
|
this.updating = false;
|
274
463
|
this.updatingOptions = undefined;
|
275
464
|
this.variableRowHeight = undefined;
|
276
465
|
}
|
466
|
+
disconnectedCallback() {
|
467
|
+
var _a;
|
468
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
469
|
+
}
|
277
470
|
componentWillLoad() {
|
278
471
|
var _a;
|
279
472
|
this.rowsPerPage = Number(this.paginationBarOptions.itemsPerPageOptions[0].value);
|
@@ -282,10 +475,15 @@ export class DataTable {
|
|
282
475
|
this.sortedColumn = this.sortOptions.defaultColumn;
|
283
476
|
this.sortedColumnOrder = this.sortOptions.sortOrders[0];
|
284
477
|
this.loadingOptions = Object.assign(Object.assign({}, this.loadingOptions), { showBackground: ((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) > 0 });
|
478
|
+
this.initialLoad = true;
|
479
|
+
this.previousItemsPerPage = this.rowsPerPage;
|
285
480
|
}
|
286
481
|
componentDidLoad() {
|
287
482
|
const tableElement = this.el.shadowRoot.querySelector("table");
|
288
483
|
const tableContainer = this.el.shadowRoot.querySelector(".table-container");
|
484
|
+
if (this.dataUpdated) {
|
485
|
+
this.dataUpdated = false;
|
486
|
+
}
|
289
487
|
if ((tableElement === null || tableElement === void 0 ? void 0 : tableElement.clientHeight) > (tableContainer === null || tableContainer === void 0 ? void 0 : tableContainer.clientHeight) ||
|
290
488
|
(tableElement === null || tableElement === void 0 ? void 0 : tableElement.clientWidth) > (tableContainer === null || tableContainer === void 0 ? void 0 : tableContainer.clientWidth)) {
|
291
489
|
this.scrollable = true;
|
@@ -294,11 +492,144 @@ export class DataTable {
|
|
294
492
|
this.startLoadingTimer();
|
295
493
|
this.showLoadingIndicator();
|
296
494
|
}
|
495
|
+
if (this.truncationPattern) {
|
496
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
497
|
+
if (!typographyEl.classList.contains(this.TEXT_WRAP_STRING)) {
|
498
|
+
this.dataTruncation(typographyEl);
|
499
|
+
}
|
500
|
+
});
|
501
|
+
this.debounceDataTruncation();
|
502
|
+
}
|
503
|
+
if (this.globalRowHeight !== "auto") {
|
504
|
+
this.updateSetRowHeight();
|
505
|
+
}
|
297
506
|
}
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
507
|
+
componentDidUpdate() {
|
508
|
+
this.truncateUpdatedData();
|
509
|
+
}
|
510
|
+
truncateUpdatedData() {
|
511
|
+
if (this.dataUpdated) {
|
512
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
513
|
+
this.resetShowHideTruncation();
|
514
|
+
}
|
515
|
+
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
516
|
+
this.updateTruncationTooltip();
|
517
|
+
}
|
518
|
+
this.dataUpdated = false;
|
519
|
+
}
|
520
|
+
if (this.tableSorted) {
|
521
|
+
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
522
|
+
this.updateTruncationTooltip();
|
523
|
+
}
|
524
|
+
this.tableSorted = false;
|
525
|
+
}
|
526
|
+
// This function recalculates the tooltip truncation when the rowHeight has been set.
|
527
|
+
// This is in componentDidUpdate so a setTimeout is not used to wait for the render to be complete
|
528
|
+
if (this.rowHeightSet) {
|
529
|
+
const fontSize = parseInt(getComputedStyle(document.documentElement).fontSize);
|
530
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
531
|
+
var _a;
|
532
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
533
|
+
const tooltipEl = this.getTooltip(typographyEl);
|
534
|
+
const rowHeight = fontSize *
|
535
|
+
parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
536
|
+
// If the set row height is bigger than the cell container even
|
537
|
+
// with textWrap, set the row height
|
538
|
+
if (!((_a = cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.style) === null || _a === void 0 ? void 0 : _a.height) &&
|
539
|
+
rowHeight > cellContainer.clientHeight) {
|
540
|
+
cellContainer.style.setProperty("height", cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
541
|
+
}
|
542
|
+
if (this.truncationPattern) {
|
543
|
+
// If the set row height is bigger than the typography truncation wrapper
|
544
|
+
// scroll height, remove see more / see less button
|
545
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
546
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
547
|
+
const showHideBtn = typographyEl.shadowRoot.querySelector("button");
|
548
|
+
if (showHideBtn &&
|
549
|
+
(truncWrapper === null || truncWrapper === void 0 ? void 0 : truncWrapper.scrollHeight) <= cellContainer.clientHeight) {
|
550
|
+
this.resetShowHideTruncation(typographyEl);
|
551
|
+
return;
|
552
|
+
}
|
553
|
+
}
|
554
|
+
this.truncate(typographyEl, cellContainer, tooltipEl);
|
555
|
+
}
|
556
|
+
else {
|
557
|
+
this.updateSetRowHeight(typographyEl);
|
558
|
+
}
|
559
|
+
});
|
560
|
+
this.rowHeightSet = false;
|
561
|
+
}
|
562
|
+
// Only run truncation on the new rows
|
563
|
+
// when the number of items per page has increased
|
564
|
+
if (this.itemsPerPageChange) {
|
565
|
+
const allRows = this.el.shadowRoot.querySelectorAll(".table-row");
|
566
|
+
if (this.rowsPerPage > this.previousItemsPerPage) {
|
567
|
+
const newRows = Array.from(allRows).slice(this.previousItemsPerPage);
|
568
|
+
newRows.forEach((row) => {
|
569
|
+
row
|
570
|
+
.querySelectorAll("ic-typography")
|
571
|
+
.forEach((typographyEl) => {
|
572
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
573
|
+
const tooltipEl = this.getTooltip(typographyEl);
|
574
|
+
this.truncate(typographyEl, cellContainer, tooltipEl);
|
575
|
+
});
|
576
|
+
});
|
577
|
+
}
|
578
|
+
this.previousItemsPerPage = this.rowsPerPage;
|
579
|
+
this.itemsPerPageChange = false;
|
580
|
+
}
|
581
|
+
if (!this.initialLoad && this.icPageChangeEvent) {
|
582
|
+
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
583
|
+
this.updateTruncationTooltip();
|
584
|
+
}
|
585
|
+
// set truncation to see more if opened and next/previous page is pressed
|
586
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
587
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
588
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
589
|
+
const showHideBtn = typographyEl.shadowRoot.querySelector("button");
|
590
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > cellContainer.clientHeight &&
|
591
|
+
!showHideBtn) {
|
592
|
+
this.addShowHideTruncation(cellContainer, typographyEl);
|
593
|
+
}
|
594
|
+
});
|
595
|
+
}
|
596
|
+
this.icPageChangeEvent = false;
|
597
|
+
}
|
598
|
+
if (this.densityUpdate) {
|
599
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
600
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
601
|
+
const tooltipEl = this.getTooltip(typographyEl);
|
602
|
+
this.truncate(typographyEl, cellContainer, tooltipEl);
|
603
|
+
});
|
604
|
+
this.densityUpdate = false;
|
605
|
+
}
|
606
|
+
}
|
607
|
+
createShowHideTruncation(typographyEl, cellContainer) {
|
608
|
+
typographyEl.checkMaxLines(typographyEl.scrollHeight);
|
609
|
+
typographyEl.setAttribute("max-lines", `${Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT)}`);
|
610
|
+
typographyEl.setShowHideExpanded(false);
|
611
|
+
cellContainer.style.height = null;
|
612
|
+
}
|
613
|
+
addTooltipTruncation(typographyEl, cellContainer, tooltip) {
|
614
|
+
this.addLineClampCSS(typographyEl, cellContainer);
|
615
|
+
if (!tooltip) {
|
616
|
+
this.createTruncationTooltip(typographyEl, cellContainer);
|
617
|
+
}
|
618
|
+
}
|
619
|
+
addShowHideTruncation(cellContainer, typographyEl) {
|
620
|
+
cellContainer.classList.add(this.SHOW_HIDE_CSS_CLASS);
|
621
|
+
this.createShowHideTruncation(typographyEl, cellContainer);
|
622
|
+
}
|
623
|
+
getTruncWrapper(typographyEl) {
|
624
|
+
return typographyEl.shadowRoot.querySelector(".trunc-wrapper");
|
625
|
+
}
|
626
|
+
// Set the height to initial if row height is set and the show / hide truncation
|
627
|
+
// is clicked
|
628
|
+
handleTypographyTruncationExpandToggle({ detail, }) {
|
629
|
+
const { expanded, typographyEl } = detail;
|
630
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
631
|
+
if (cellContainer.style.height && expanded) {
|
632
|
+
cellContainer.style.height = "inherit";
|
302
633
|
}
|
303
634
|
}
|
304
635
|
handlePageChange({ detail, target }) {
|
@@ -317,6 +648,19 @@ export class DataTable {
|
|
317
648
|
this.previousRowsPerPage = this.rowsPerPage;
|
318
649
|
}
|
319
650
|
}
|
651
|
+
if (!this.initialLoad && this.previousPaginationPage !== detail.value) {
|
652
|
+
// This is to prevent icPageChange from triggering truncation on first load
|
653
|
+
this.icPageChangeEvent = true;
|
654
|
+
}
|
655
|
+
this.previousPaginationPage = detail.value;
|
656
|
+
this.initialLoad = false;
|
657
|
+
}
|
658
|
+
handleItemsPerPageChange({ detail, target, }) {
|
659
|
+
if (target.parentElement !== this.el) {
|
660
|
+
this.previousRowsPerPage = this.rowsPerPage;
|
661
|
+
this.rowsPerPage = detail.value;
|
662
|
+
}
|
663
|
+
this.itemsPerPageChange = true;
|
320
664
|
}
|
321
665
|
handleDensityChange(ev) {
|
322
666
|
this.density = ev.detail.value;
|
@@ -334,7 +678,23 @@ export class DataTable {
|
|
334
678
|
}, 500);
|
335
679
|
}
|
336
680
|
}
|
337
|
-
|
681
|
+
truncationPatternHandler(newValue) {
|
682
|
+
if (newValue === this.SHOW_HIDE_STRING) {
|
683
|
+
this.updateTruncationTooltip(true);
|
684
|
+
// Not using debounceDataTruncation here due to resizeObserver not being triggered
|
685
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
686
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
687
|
+
const tooltip = this.getTooltip(typographyEl);
|
688
|
+
this.truncate(typographyEl, cellContainer, tooltip);
|
689
|
+
});
|
690
|
+
}
|
691
|
+
if (newValue === this.TOOLTIP_STRING) {
|
692
|
+
// ResizeObserver is trigger here due to the see more/see less links being removed.
|
693
|
+
// The resizeObserver will also apply the tooltip where relevant
|
694
|
+
this.resetShowHideTruncation();
|
695
|
+
}
|
696
|
+
}
|
697
|
+
async dataHandler(newData) {
|
338
698
|
this.loadingOptions = Object.assign(Object.assign({}, this.loadingOptions), { showBackground: (newData === null || newData === void 0 ? void 0 : newData.length) > 0 });
|
339
699
|
if (this.loading) {
|
340
700
|
!this.hasLoadedForOneSecond
|
@@ -344,31 +704,124 @@ export class DataTable {
|
|
344
704
|
}
|
345
705
|
if (this.updating)
|
346
706
|
this.updating = false;
|
707
|
+
this.dataUpdated = true;
|
347
708
|
}
|
348
|
-
|
349
|
-
this.
|
709
|
+
async densityHandler() {
|
710
|
+
this.densityUpdate = true;
|
711
|
+
}
|
712
|
+
resetShowHideTruncation(typographyEl) {
|
713
|
+
if (typographyEl) {
|
714
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
715
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
716
|
+
if ((truncWrapper === null || truncWrapper === void 0 ? void 0 : truncWrapper.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) &&
|
717
|
+
!isEmptyString(typographyEl.getAttribute("max-lines")) &&
|
718
|
+
Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT) !==
|
719
|
+
+typographyEl.getAttribute("max-lines")) {
|
720
|
+
typographyEl.checkMaxLines(truncWrapper.scrollHeight);
|
721
|
+
typographyEl.setAttribute("max-lines", `${Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT)}`);
|
722
|
+
typographyEl.setShowHideExpanded(false);
|
723
|
+
cellContainer.style.height = null;
|
724
|
+
}
|
725
|
+
else {
|
726
|
+
typographyEl.resetTruncation().then(() => {
|
727
|
+
cellContainer.style.setProperty("height", cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
728
|
+
});
|
729
|
+
}
|
730
|
+
}
|
731
|
+
else {
|
732
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
733
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
734
|
+
typographyEl.resetTruncation().then(() => {
|
735
|
+
cellContainer.style.setProperty("height", cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
736
|
+
});
|
737
|
+
});
|
738
|
+
}
|
739
|
+
}
|
740
|
+
rowHeightChangeHandler(newValue, oldValue) {
|
741
|
+
if (+newValue !== +oldValue) {
|
742
|
+
this.deleteTextWrapDataKey(this.data);
|
743
|
+
this.deleteTextWrapDataKey(this.columns);
|
744
|
+
this.removeTextWrap();
|
745
|
+
this.icRowHeightChange.emit();
|
746
|
+
this.rowHeightSet = true;
|
747
|
+
}
|
350
748
|
}
|
351
749
|
/**
|
352
|
-
* Resets the `globalRowHeight` prop to
|
750
|
+
* Resets the `globalRowHeight` prop to number or auto and sets the `variableRowHeight` prop to `null`.
|
353
751
|
*/
|
354
|
-
async resetRowHeights() {
|
355
|
-
this.globalRowHeight =
|
752
|
+
async resetRowHeights(rowHeight) {
|
753
|
+
this.globalRowHeight = rowHeight || "auto";
|
356
754
|
this.variableRowHeight = null;
|
357
755
|
}
|
358
756
|
showLoadingIndicator() {
|
359
757
|
this.loadingIndicator.classList.add("show");
|
360
758
|
}
|
759
|
+
getRowOptions(rowKeys, rowValues) {
|
760
|
+
const rowOptionsIndex = rowKeys.indexOf("rowOptions");
|
761
|
+
return rowOptionsIndex > -1 && rowValues[rowOptionsIndex];
|
762
|
+
}
|
763
|
+
regenerateTooltip(cellContainer, typographyEl, tooltip, removeTooltipOnly) {
|
764
|
+
// When sorting the table, instead of regenerating the tooltip,
|
765
|
+
// the tooltip details are updated
|
766
|
+
if (tooltip) {
|
767
|
+
if (this.tableSorted) {
|
768
|
+
tooltip.setAttribute("target", typographyEl.id);
|
769
|
+
tooltip.setAttribute("label", typographyEl.textContent);
|
770
|
+
}
|
771
|
+
else {
|
772
|
+
this.removeTooltip(cellContainer, typographyEl, tooltip);
|
773
|
+
}
|
774
|
+
if (removeTooltipOnly) {
|
775
|
+
return;
|
776
|
+
}
|
777
|
+
}
|
778
|
+
// This add line clamp to data only when
|
779
|
+
// the data object has been updated
|
780
|
+
if (!typographyEl.getAttribute("style") && this.dataUpdated) {
|
781
|
+
this.addLineClampCSS(typographyEl, cellContainer);
|
782
|
+
}
|
783
|
+
// Adding the tableSorted boolean prevents the tooltip
|
784
|
+
// being regenerated and flashing
|
785
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) &&
|
786
|
+
!this.tableSorted) {
|
787
|
+
if (!typographyEl.getAttribute("style")) {
|
788
|
+
this.addLineClampCSS(typographyEl, cellContainer);
|
789
|
+
}
|
790
|
+
this.createTruncationTooltip(typographyEl, cellContainer);
|
791
|
+
}
|
792
|
+
}
|
793
|
+
removeTooltip(cellContainer, typographyEl, tooltip) {
|
794
|
+
cellContainer.appendChild(typographyEl);
|
795
|
+
if (tooltip) {
|
796
|
+
tooltip.remove();
|
797
|
+
}
|
798
|
+
}
|
799
|
+
addLineClampCSS(typographyEl, cellContainer) {
|
800
|
+
typographyEl.setAttribute("style", `--ic-line-clamp: ${this.getLines(cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)}`);
|
801
|
+
}
|
802
|
+
createTruncationTooltip(typographyEl, cellContainer) {
|
803
|
+
const tooltipEl = document.createElement("ic-tooltip");
|
804
|
+
tooltipEl.setAttribute("target", typographyEl.id);
|
805
|
+
tooltipEl.setAttribute("label", typographyEl.textContent);
|
806
|
+
tooltipEl.classList.add("ic-tooltip-overflow");
|
807
|
+
tooltipEl.setExternalPopperProps({
|
808
|
+
// This might need reverting back to absolute if the tooltip doesn't dynamically position itself correctly
|
809
|
+
strategy: "fixed",
|
810
|
+
});
|
811
|
+
cellContainer.appendChild(tooltipEl);
|
812
|
+
tooltipEl.appendChild(typographyEl);
|
813
|
+
}
|
361
814
|
render() {
|
362
815
|
const { caption, createColumnHeaders, createRows, createUpdatingIndicator, data, hideColumnHeaders, loading, loadingOptions, paginationBarOptions, scrollable, scrollOffset, showPagination, sortable, sortedColumnOrder, sortedColumn, stickyColumnHeaders, updateScrollOffset, updating, } = this;
|
363
816
|
return (h("div", { class: "table-container" }, isSlotUsed(this.el, "title-bar") && h("slot", { name: "title-bar" }), h("div", { class: {
|
364
817
|
["table-row-container"]: true,
|
365
818
|
scrollable,
|
366
|
-
}, tabIndex: scrollable ? 0 : null, onScroll: updateScrollOffset }, h("table", null, h("caption", { class: "table-caption" }, caption), !hideColumnHeaders && (h("thead", { class: {
|
819
|
+
}, tabIndex: scrollable ? 0 : null, onScroll: updateScrollOffset }, isSlotUsed(this.el, "title-bar") && h("slot", { name: "title-bar" }), h("table", null, h("caption", { class: "table-caption" }, caption), !hideColumnHeaders && (h("thead", { class: {
|
367
820
|
["column-header-sticky"]: stickyColumnHeaders,
|
368
821
|
["column-header-overlay"]: stickyColumnHeaders && scrollOffset !== 0,
|
369
822
|
} }, h("tr", null, createColumnHeaders()))), updating &&
|
370
823
|
!loading &&
|
371
|
-
(hideColumnHeaders ? (h("thead", null, createUpdatingIndicator())) : (createUpdatingIndicator())), (data === null || data === void 0 ? void 0 : data.length) > 0 && h("tbody", null, createRows())), !(data === null || data === void 0 ? void 0 : data.length) &&
|
824
|
+
(hideColumnHeaders ? (h("thead", null, createUpdatingIndicator())) : (createUpdatingIndicator())), (data === null || data === void 0 ? void 0 : data.length) > 0 && !loading && h("tbody", null, createRows())), !(data === null || data === void 0 ? void 0 : data.length) &&
|
372
825
|
!loading &&
|
373
826
|
(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", { appearance: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.appearance, class: {
|
374
827
|
"loading-empty": loading,
|
@@ -509,7 +962,7 @@ export class DataTable {
|
|
509
962
|
},
|
510
963
|
"attribute": "global-row-height",
|
511
964
|
"reflect": false,
|
512
|
-
"defaultValue": "
|
965
|
+
"defaultValue": "\"auto\""
|
513
966
|
},
|
514
967
|
"hideColumnHeaders": {
|
515
968
|
"type": "boolean",
|
@@ -702,6 +1155,29 @@ export class DataTable {
|
|
702
1155
|
"reflect": false,
|
703
1156
|
"defaultValue": "false"
|
704
1157
|
},
|
1158
|
+
"truncationPattern": {
|
1159
|
+
"type": "string",
|
1160
|
+
"mutable": false,
|
1161
|
+
"complexType": {
|
1162
|
+
"original": "IcDataTableTruncationTypes",
|
1163
|
+
"resolved": "\"show-hide\" | \"tooltip\"",
|
1164
|
+
"references": {
|
1165
|
+
"IcDataTableTruncationTypes": {
|
1166
|
+
"location": "import",
|
1167
|
+
"path": "./ic-data-table.types",
|
1168
|
+
"id": "src/components/ic-data-table/ic-data-table.types.tsx::IcDataTableTruncationTypes"
|
1169
|
+
}
|
1170
|
+
}
|
1171
|
+
},
|
1172
|
+
"required": false,
|
1173
|
+
"optional": true,
|
1174
|
+
"docs": {
|
1175
|
+
"tags": [],
|
1176
|
+
"text": "Sets the method used to truncate longer text in cells where textWrap is `false`.\nThe `tooltip` truncation pattern allows the overflowing text to be seen in a tooltip. The `show-hide` truncation pattern allows the overflowing text to be shown and hidden using the ic-typography \"See more\"/\"See less\" buttons."
|
1177
|
+
},
|
1178
|
+
"attribute": "truncation-pattern",
|
1179
|
+
"reflect": false
|
1180
|
+
},
|
705
1181
|
"updating": {
|
706
1182
|
"type": "boolean",
|
707
1183
|
"mutable": false,
|
@@ -774,7 +1250,8 @@ export class DataTable {
|
|
774
1250
|
"selectedRow": {},
|
775
1251
|
"sortedColumn": {},
|
776
1252
|
"sortedColumnOrder": {},
|
777
|
-
"toRow": {}
|
1253
|
+
"toRow": {},
|
1254
|
+
"currentRowHeight": {}
|
778
1255
|
};
|
779
1256
|
}
|
780
1257
|
static get events() {
|
@@ -799,8 +1276,12 @@ export class DataTable {
|
|
799
1276
|
return {
|
800
1277
|
"resetRowHeights": {
|
801
1278
|
"complexType": {
|
802
|
-
"signature": "() => Promise<void>",
|
803
|
-
"parameters": [
|
1279
|
+
"signature": "(rowHeight?: number | \"auto\") => Promise<void>",
|
1280
|
+
"parameters": [{
|
1281
|
+
"name": "rowHeight",
|
1282
|
+
"type": "number | \"auto\"",
|
1283
|
+
"docs": ""
|
1284
|
+
}],
|
804
1285
|
"references": {
|
805
1286
|
"Promise": {
|
806
1287
|
"location": "global",
|
@@ -810,7 +1291,7 @@ export class DataTable {
|
|
810
1291
|
"return": "Promise<void>"
|
811
1292
|
},
|
812
1293
|
"docs": {
|
813
|
-
"text": "Resets the `globalRowHeight` prop to
|
1294
|
+
"text": "Resets the `globalRowHeight` prop to number or auto and sets the `variableRowHeight` prop to `null`.",
|
814
1295
|
"tags": []
|
815
1296
|
}
|
816
1297
|
}
|
@@ -821,9 +1302,15 @@ export class DataTable {
|
|
821
1302
|
return [{
|
822
1303
|
"propName": "loading",
|
823
1304
|
"methodName": "loadingHandler"
|
1305
|
+
}, {
|
1306
|
+
"propName": "truncationPattern",
|
1307
|
+
"methodName": "truncationPatternHandler"
|
824
1308
|
}, {
|
825
1309
|
"propName": "data",
|
826
1310
|
"methodName": "dataHandler"
|
1311
|
+
}, {
|
1312
|
+
"propName": "density",
|
1313
|
+
"methodName": "densityHandler"
|
827
1314
|
}, {
|
828
1315
|
"propName": "globalRowHeight",
|
829
1316
|
"methodName": "rowHeightChangeHandler"
|
@@ -834,8 +1321,8 @@ export class DataTable {
|
|
834
1321
|
}
|
835
1322
|
static get listeners() {
|
836
1323
|
return [{
|
837
|
-
"name": "
|
838
|
-
"method": "
|
1324
|
+
"name": "typographyTruncationExpandToggle",
|
1325
|
+
"method": "handleTypographyTruncationExpandToggle",
|
839
1326
|
"target": undefined,
|
840
1327
|
"capture": false,
|
841
1328
|
"passive": false
|
@@ -845,6 +1332,12 @@ export class DataTable {
|
|
845
1332
|
"target": undefined,
|
846
1333
|
"capture": false,
|
847
1334
|
"passive": false
|
1335
|
+
}, {
|
1336
|
+
"name": "icItemsPerPageChange",
|
1337
|
+
"method": "handleItemsPerPageChange",
|
1338
|
+
"target": undefined,
|
1339
|
+
"capture": false,
|
1340
|
+
"passive": false
|
848
1341
|
}, {
|
849
1342
|
"name": "icTableDensityUpdate",
|
850
1343
|
"method": "handleDensityChange",
|