@ukic/canary-web-components 2.0.0-canary.4 → 2.0.0-canary.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/date-helpers-c9551119.js +150 -0
- package/dist/cjs/date-helpers-c9551119.js.map +1 -0
- package/dist/cjs/helpers-951fb33a.js +433 -0
- package/dist/cjs/helpers-951fb33a.js.map +1 -0
- package/dist/cjs/{helpers-bbe55215.js → helpers-eabe59b6.js} +147 -100
- package/dist/cjs/helpers-eabe59b6.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +31 -4
- package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +11 -4
- package/dist/cjs/ic-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +20 -6
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +26 -17
- package/dist/cjs/ic-back-to-top.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +86 -83
- package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +62 -25
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/ic-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +145 -103
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-horizontal.cjs.entry.js +130 -0
- package/dist/cjs/ic-card-horizontal.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-card.cjs.entry.js +30 -7
- package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +28 -17
- package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +50 -31
- package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +45 -21
- package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js +14 -5
- package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-entity.cjs.entry.js +3 -6
- package/dist/cjs/ic-data-entity.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +21 -35
- package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +57 -0
- package/dist/cjs/ic-data-table-title-bar.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-data-table.cjs.entry.js +1079 -84
- package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-input.cjs.entry.js +1123 -0
- package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-date-picker.cjs.entry.js +1129 -0
- package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-dialog.cjs.entry.js +54 -12
- package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +1 -1
- package/dist/cjs/ic-empty-state_2.cjs.entry.js +388 -0
- package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +4 -4
- package/dist/cjs/ic-footer-link-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +3 -3
- package/dist/cjs/ic-footer-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +18 -7
- package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +12 -2
- package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +5 -5
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_4.cjs.entry.js +164 -0
- package/dist/cjs/ic-input-component-container_4.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-link.cjs.entry.js +34 -16
- package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +2 -2
- package/dist/cjs/ic-menu-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +21 -20
- package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-menu-with-multi.cjs.entry.js +2740 -0
- package/dist/cjs/ic-menu-with-multi.cjs.entry.js.map +1 -0
- package/dist/cjs/{ic-input-component-container_3.cjs.entry.js → ic-menu.cjs.entry.js} +17 -80
- package/dist/cjs/ic-menu.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-navigation-button.cjs.entry.js +28 -7
- package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +32 -22
- package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +82 -36
- 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 +10 -10
- package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination_4.cjs.entry.js +231 -116
- package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +40 -36
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +100 -59
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +59 -42
- package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +22 -30
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-select-with-multi.cjs.entry.js +796 -0
- package/dist/cjs/ic-select-with-multi.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-side-navigation.cjs.entry.js +53 -73
- package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-skeleton.cjs.entry.js +16 -35
- package/dist/cjs/ic-skeleton.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-status-tag.cjs.entry.js +4 -2
- package/dist/cjs/ic-status-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +5 -2
- package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +31 -9
- package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +7 -3
- package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js +78 -130
- package/dist/cjs/ic-tab-context.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 +5 -13
- package/dist/cjs/ic-tab-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab.cjs.entry.js +16 -14
- package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +13 -22
- package/dist/cjs/ic-theme.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast-region.cjs.entry.js +6 -0
- package/dist/cjs/ic-toast-region.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +21 -18
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js +201 -0
- package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-toggle-button.cjs.entry.js +97 -0
- package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-top-navigation.cjs.entry.js +60 -82
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tree-item.cjs.entry.js +253 -0
- package/dist/cjs/ic-tree-item.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-tree-view.cjs.entry.js +215 -0
- package/dist/cjs/ic-tree-view.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-typography.cjs.entry.js +51 -14
- package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
- package/dist/cjs/index-4cf27b16.js +48 -12
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/arrow-dropdown.svg +3 -0
- package/dist/collection/assets/calendar.svg +3 -0
- package/dist/collection/collection-manifest.json +11 -1
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.css +658 -0
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js +375 -0
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js.map +1 -0
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.stories.js +605 -0
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.stories.js.map +1 -0
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.types.js +2 -0
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.types.js.map +1 -0
- package/dist/collection/components/ic-card-horizontal/test/basic/ic-card-horizontal.spec.js +140 -0
- package/dist/collection/components/ic-card-horizontal/test/basic/ic-card-horizontal.spec.js.map +1 -0
- package/dist/collection/components/ic-data-table/ic-data-table.css +286 -10
- package/dist/collection/components/ic-data-table/ic-data-table.js +1533 -123
- package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
- package/dist/collection/components/ic-data-table/ic-data-table.stories.js +414 -0
- package/dist/collection/components/ic-data-table/ic-data-table.stories.js.map +1 -0
- 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 +1326 -43
- 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 +460 -3
- package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
- package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.css +91 -0
- package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js +160 -0
- package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js.map +1 -0
- package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.stories.js +98 -0
- package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.stories.js.map +1 -0
- package/dist/collection/components/ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.js +11 -0
- package/dist/collection/components/ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.js.map +1 -0
- package/dist/collection/components/ic-data-table-title-bar/test/basic/ic-data-table-title-bar.spec.js +70 -0
- package/dist/collection/components/ic-data-table-title-bar/test/basic/ic-data-table-title-bar.spec.js.map +1 -0
- package/dist/collection/components/ic-date-input/ic-date-input.css +564 -0
- package/dist/collection/components/ic-date-input/ic-date-input.js +1808 -0
- package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -0
- package/dist/collection/components/ic-date-input/ic-date-input.stories.js +341 -0
- package/dist/collection/components/ic-date-input/ic-date-input.stories.js.map +1 -0
- package/dist/collection/components/ic-date-input/story-data.js +28 -0
- package/dist/collection/components/ic-date-input/story-data.js.map +1 -0
- package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js +1158 -0
- package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js.map +1 -0
- package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js +42 -0
- package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js.map +1 -0
- package/dist/collection/components/ic-date-picker/ic-date-picker.css +885 -0
- package/dist/collection/components/ic-date-picker/ic-date-picker.js +1688 -0
- package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -0
- package/dist/collection/components/ic-date-picker/ic-date-picker.stories.js +167 -0
- package/dist/collection/components/ic-date-picker/ic-date-picker.stories.js.map +1 -0
- package/dist/collection/components/ic-date-picker/ic-day-button.js +36 -0
- package/dist/collection/components/ic-date-picker/ic-day-button.js.map +1 -0
- package/dist/collection/components/ic-date-picker/ic-month-picker.js +29 -0
- package/dist/collection/components/ic-date-picker/ic-month-picker.js.map +1 -0
- package/dist/collection/components/ic-date-picker/ic-year-picker.js +39 -0
- package/dist/collection/components/ic-date-picker/ic-year-picker.js.map +1 -0
- package/dist/collection/components/ic-date-picker/story-data.js +179 -0
- package/dist/collection/components/ic-date-picker/story-data.js.map +1 -0
- package/dist/collection/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.js +13 -0
- package/dist/collection/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.js.map +1 -0
- package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js +207 -0
- package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js.map +1 -0
- package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js +1030 -0
- package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js.map +1 -0
- package/dist/collection/components/ic-menu-with-multi/ic-menu.css +701 -0
- package/dist/collection/components/ic-menu-with-multi/ic-menu.js +1599 -0
- package/dist/collection/components/ic-menu-with-multi/ic-menu.js.map +1 -0
- package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js +1057 -0
- package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js.map +1 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +346 -166
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -1
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.stories.js +260 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.stories.js.map +1 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.types.js +2 -0
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.types.js.map +1 -0
- package/dist/collection/components/ic-pagination-bar/test/a11y/ic-pagination-bar.test.a11y.js +8 -1
- package/dist/collection/components/ic-pagination-bar/test/a11y/ic-pagination-bar.test.a11y.js.map +1 -1
- package/dist/collection/components/ic-pagination-bar/test/basic/ic-pagination-bar.spec.js +75 -12
- package/dist/collection/components/ic-pagination-bar/test/basic/ic-pagination-bar.spec.js.map +1 -1
- package/dist/collection/components/ic-select-with-multi/assets/Check.svg +3 -0
- package/dist/collection/components/ic-select-with-multi/assets/Clear.svg +3 -0
- package/dist/collection/components/ic-select-with-multi/assets/Expand.svg +3 -0
- package/dist/collection/components/ic-select-with-multi/ic-select-multi.stories.js +144 -0
- package/dist/collection/components/ic-select-with-multi/ic-select-multi.stories.js.map +1 -0
- package/dist/collection/components/ic-select-with-multi/ic-select.css +693 -0
- package/dist/collection/components/ic-select-with-multi/ic-select.js +1649 -0
- package/dist/collection/components/ic-select-with-multi/ic-select.js.map +1 -0
- package/dist/collection/components/ic-select-with-multi/story-data.js +216 -0
- package/dist/collection/components/ic-select-with-multi/story-data.js.map +1 -0
- package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.spec.js +1518 -0
- package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.spec.js.map +1 -0
- package/dist/collection/components/ic-tree-item/ic-tree-item.css +186 -0
- package/dist/collection/components/ic-tree-item/ic-tree-item.js +620 -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 +117 -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 +74 -0
- package/dist/collection/components/ic-tree-view/ic-tree-view.js +346 -0
- package/dist/collection/components/ic-tree-view/ic-tree-view.js.map +1 -0
- package/dist/collection/components/ic-tree-view/ic-tree-view.stories.js +456 -0
- package/dist/collection/components/ic-tree-view/ic-tree-view.stories.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/collection/utils/constants.js +83 -0
- package/dist/collection/utils/constants.js.map +1 -0
- package/dist/collection/utils/date-helpers.js +133 -0
- package/dist/collection/utils/date-helpers.js.map +1 -0
- package/dist/collection/utils/helpers.js +473 -5
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/collection/utils/types.js +58 -0
- package/dist/collection/utils/types.js.map +1 -0
- package/dist/components/helpers.js +141 -98
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/helpers2.js +403 -0
- package/dist/components/helpers2.js.map +1 -0
- package/dist/components/ic-accordion-group.js +38 -7
- package/dist/components/ic-accordion-group.js.map +1 -1
- package/dist/components/ic-accordion.js +12 -4
- package/dist/components/ic-accordion.js.map +1 -1
- package/dist/components/ic-alert2.js +21 -6
- package/dist/components/ic-alert2.js.map +1 -1
- package/dist/components/ic-back-to-top.js +34 -18
- package/dist/components/ic-back-to-top.js.map +1 -1
- package/dist/components/ic-badge.js +91 -84
- package/dist/components/ic-badge.js.map +1 -1
- package/dist/components/ic-breadcrumb-group.js +66 -25
- package/dist/components/ic-breadcrumb-group.js.map +1 -1
- package/dist/components/ic-breadcrumb2.js +2 -2
- package/dist/components/ic-breadcrumb2.js.map +1 -1
- package/dist/components/ic-button2.js +104 -74
- package/dist/components/ic-button2.js.map +1 -1
- package/dist/components/ic-card-horizontal.d.ts +11 -0
- package/dist/components/ic-card-horizontal.js +168 -0
- package/dist/components/ic-card-horizontal.js.map +1 -0
- package/dist/components/ic-card.js +34 -21
- package/dist/components/ic-card.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +33 -18
- package/dist/components/ic-checkbox-group.js.map +1 -1
- package/dist/components/ic-checkbox.js +58 -33
- package/dist/components/ic-checkbox.js.map +1 -1
- package/dist/components/ic-chip.js +52 -23
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-classification-banner.js +14 -5
- package/dist/components/ic-classification-banner.js.map +1 -1
- package/dist/components/ic-data-entity.js +3 -6
- package/dist/components/ic-data-entity.js.map +1 -1
- package/dist/components/ic-data-row.js +21 -35
- package/dist/components/ic-data-row.js.map +1 -1
- package/dist/components/ic-data-table-title-bar.d.ts +11 -0
- package/dist/components/ic-data-table-title-bar.js +136 -0
- package/dist/components/ic-data-table-title-bar.js.map +1 -0
- package/dist/components/ic-data-table.js +1119 -91
- package/dist/components/ic-data-table.js.map +1 -1
- package/dist/components/ic-date-input.d.ts +11 -0
- package/dist/components/ic-date-input.js +8 -0
- package/dist/components/ic-date-input.js.map +1 -0
- package/dist/components/ic-date-input2.js +1359 -0
- package/dist/components/ic-date-input2.js.map +1 -0
- package/dist/components/ic-date-picker.d.ts +11 -0
- package/dist/components/ic-date-picker.js +1258 -0
- package/dist/components/ic-date-picker.js.map +1 -0
- package/dist/components/ic-dialog.js +55 -12
- package/dist/components/ic-dialog.js.map +1 -1
- package/dist/components/ic-divider2.js +1 -1
- package/dist/components/ic-empty-state.js +1 -57
- package/dist/components/ic-empty-state.js.map +1 -1
- package/dist/{esm/ic-empty-state.entry.js → components/ic-empty-state2.js} +47 -11
- package/dist/components/ic-empty-state2.js.map +1 -0
- package/dist/components/ic-footer-link-group.js +4 -4
- package/dist/components/ic-footer-link-group.js.map +1 -1
- package/dist/components/ic-footer-link.js +3 -3
- package/dist/components/ic-footer-link.js.map +1 -1
- package/dist/components/ic-footer.js +18 -7
- package/dist/components/ic-footer.js.map +1 -1
- package/dist/components/ic-hero.js +12 -2
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-horizontal-scroll2.js +5 -5
- package/dist/components/ic-horizontal-scroll2.js.map +1 -1
- package/dist/components/ic-input-component-container2.js +24 -8
- package/dist/components/ic-input-component-container2.js.map +1 -1
- package/dist/components/ic-input-label2.js +7 -5
- package/dist/components/ic-input-label2.js.map +1 -1
- package/dist/components/ic-input-validation2.js +1 -1
- package/dist/components/ic-link2.js +35 -17
- package/dist/components/ic-link2.js.map +1 -1
- package/dist/components/ic-loading-indicator2.js +2 -2
- package/dist/components/ic-loading-indicator2.js.map +1 -1
- package/dist/components/ic-menu-group.js +2 -2
- package/dist/components/ic-menu-group.js.map +1 -1
- package/dist/components/ic-menu-item2.js +26 -23
- package/dist/components/ic-menu-item2.js.map +1 -1
- package/dist/components/ic-menu-with-multi.d.ts +11 -0
- package/dist/components/ic-menu-with-multi.js +8 -0
- package/dist/components/ic-menu-with-multi.js.map +1 -0
- package/dist/components/ic-menu2.js +14 -14
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-menu3.js +2806 -0
- package/dist/components/ic-menu3.js.map +1 -0
- package/dist/components/ic-navigation-button.js +29 -8
- package/dist/components/ic-navigation-button.js.map +1 -1
- package/dist/components/ic-navigation-group.js +34 -24
- package/dist/components/ic-navigation-group.js.map +1 -1
- package/dist/components/ic-navigation-item.js +84 -37
- package/dist/components/ic-navigation-item.js.map +1 -1
- package/dist/components/ic-navigation-menu2.js +1 -1
- package/dist/components/ic-page-header.js +10 -10
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-pagination-bar2.js +244 -161
- package/dist/components/ic-pagination-bar2.js.map +1 -1
- package/dist/components/ic-pagination-item2.js +27 -12
- package/dist/components/ic-pagination-item2.js.map +1 -1
- package/dist/components/ic-pagination2.js +30 -10
- package/dist/components/ic-pagination2.js.map +1 -1
- package/dist/components/ic-popover-menu.js +43 -38
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js +101 -59
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js +63 -44
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-search-bar.js +23 -30
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-section-container2.js +1 -1
- package/dist/components/ic-section-container2.js.map +1 -1
- package/dist/components/ic-select-with-multi.d.ts +11 -0
- package/dist/components/ic-select-with-multi.js +921 -0
- package/dist/components/ic-select-with-multi.js.map +1 -0
- package/dist/components/ic-select2.js +77 -30
- package/dist/components/ic-select2.js.map +1 -1
- package/dist/components/ic-side-navigation.js +56 -74
- package/dist/components/ic-side-navigation.js.map +1 -1
- package/dist/components/ic-skeleton.js +17 -40
- package/dist/components/ic-skeleton.js.map +1 -1
- package/dist/components/ic-status-tag.js +3 -1
- package/dist/components/ic-status-tag.js.map +1 -1
- package/dist/components/ic-step.js +5 -2
- package/dist/components/ic-step.js.map +1 -1
- package/dist/components/ic-stepper.js +35 -9
- package/dist/components/ic-stepper.js.map +1 -1
- package/dist/components/ic-switch.js +9 -4
- package/dist/components/ic-switch.js.map +1 -1
- package/dist/components/ic-tab-context.js +79 -130
- package/dist/components/ic-tab-context.js.map +1 -1
- package/dist/components/ic-tab-panel.js +6 -17
- package/dist/components/ic-tab-panel.js.map +1 -1
- package/dist/components/ic-tab.js +16 -14
- package/dist/components/ic-tab.js.map +1 -1
- package/dist/components/ic-text-field2.js +120 -72
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-theme.js +13 -22
- package/dist/components/ic-theme.js.map +1 -1
- package/dist/components/ic-toast-region.js +6 -0
- package/dist/components/ic-toast-region.js.map +1 -1
- package/dist/components/ic-toast.js +24 -19
- package/dist/components/ic-toast.js.map +1 -1
- package/dist/components/ic-toggle-button-group.js +230 -0
- package/dist/components/ic-toggle-button-group.js.map +1 -0
- package/dist/components/ic-toggle-button.js +148 -0
- package/dist/components/ic-toggle-button.js.map +1 -0
- package/dist/components/ic-tooltip2.js +52 -30
- package/dist/components/ic-tooltip2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +61 -83
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/components/ic-tree-item.d.ts +11 -0
- package/dist/components/ic-tree-item.js +300 -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 +252 -0
- package/dist/components/ic-tree-view.js.map +1 -0
- package/dist/components/ic-typography2.js +57 -17
- package/dist/components/ic-typography2.js.map +1 -1
- package/dist/core/core.css +8 -5
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/p-0229eb46.entry.js +2 -0
- package/dist/core/p-0229eb46.entry.js.map +1 -0
- package/dist/core/p-04fe848d.entry.js +2 -0
- package/dist/core/p-04fe848d.entry.js.map +1 -0
- package/dist/core/p-05ae9a59.entry.js +2 -0
- package/dist/core/p-05ae9a59.entry.js.map +1 -0
- package/dist/core/p-074e64d0.entry.js +2 -0
- package/dist/core/p-074e64d0.entry.js.map +1 -0
- package/dist/core/p-0f1706e8.entry.js +2 -0
- package/dist/core/p-0f1706e8.entry.js.map +1 -0
- package/dist/core/p-11877d23.entry.js +2 -0
- package/dist/core/p-11877d23.entry.js.map +1 -0
- package/dist/core/p-1e450833.entry.js +2 -0
- package/dist/core/p-1e450833.entry.js.map +1 -0
- package/dist/core/{p-4409f656.entry.js → p-23408776.entry.js} +2 -2
- package/dist/core/p-23408776.entry.js.map +1 -0
- package/dist/core/p-26fa17fb.entry.js +2 -0
- package/dist/core/p-26fa17fb.entry.js.map +1 -0
- package/dist/core/p-2b15ea77.entry.js +2 -0
- package/dist/core/p-2b15ea77.entry.js.map +1 -0
- package/dist/core/p-2d44b81a.entry.js +2 -0
- package/dist/core/p-2d44b81a.entry.js.map +1 -0
- package/dist/core/p-2ea7af8b.entry.js +2 -0
- package/dist/core/p-2ea7af8b.entry.js.map +1 -0
- package/dist/core/p-33dd24eb.js +2 -0
- package/dist/core/p-33dd24eb.js.map +1 -0
- package/dist/core/p-38f329ab.entry.js +2 -0
- package/dist/core/p-38f329ab.entry.js.map +1 -0
- package/dist/core/p-3cd2056f.entry.js +2 -0
- package/dist/core/p-3cd2056f.entry.js.map +1 -0
- package/dist/core/p-3d00ad9e.entry.js +2 -0
- package/dist/core/p-3d00ad9e.entry.js.map +1 -0
- package/dist/core/p-3ebd4703.entry.js +2 -0
- package/dist/core/p-3ebd4703.entry.js.map +1 -0
- package/dist/core/p-44036532.entry.js +2 -0
- package/dist/core/p-44036532.entry.js.map +1 -0
- package/dist/core/p-44680720.entry.js +2 -0
- package/dist/core/p-44680720.entry.js.map +1 -0
- package/dist/core/{p-24945ee5.entry.js → p-452985d9.entry.js} +2 -2
- package/dist/core/p-452985d9.entry.js.map +1 -0
- package/dist/core/{p-b97dc365.entry.js → p-487fd924.entry.js} +2 -2
- package/dist/core/p-56db5123.entry.js +2 -0
- package/dist/core/p-56db5123.entry.js.map +1 -0
- package/dist/core/p-5a90eaa8.entry.js +2 -0
- package/dist/core/p-5a90eaa8.entry.js.map +1 -0
- package/dist/core/p-5dd6381a.entry.js +2 -0
- package/dist/core/p-5dd6381a.entry.js.map +1 -0
- package/dist/core/p-5f149106.entry.js +2 -0
- package/dist/core/p-5f149106.entry.js.map +1 -0
- package/dist/core/p-61848e6b.entry.js +2 -0
- package/dist/core/p-61848e6b.entry.js.map +1 -0
- package/dist/core/{p-d77960f6.entry.js → p-656378ba.entry.js} +2 -2
- package/dist/core/p-6a920114.entry.js +2 -0
- package/dist/core/p-6a920114.entry.js.map +1 -0
- package/dist/core/p-6cdf5de2.entry.js +2 -0
- package/dist/core/p-6cdf5de2.entry.js.map +1 -0
- package/dist/core/p-70ad364c.entry.js +2 -0
- package/dist/core/p-70ad364c.entry.js.map +1 -0
- package/dist/core/p-70c659ec.entry.js +2 -0
- package/dist/core/p-70c659ec.entry.js.map +1 -0
- package/dist/core/p-74b42302.entry.js +2 -0
- package/dist/core/p-74b42302.entry.js.map +1 -0
- package/dist/core/p-75bd12f8.entry.js +2 -0
- package/dist/core/p-75bd12f8.entry.js.map +1 -0
- package/dist/core/p-780294b8.entry.js +2 -0
- package/dist/core/p-780294b8.entry.js.map +1 -0
- package/dist/core/{p-baf81f30.entry.js → p-787ffd96.entry.js} +2 -2
- package/dist/core/p-787ffd96.entry.js.map +1 -0
- package/dist/core/p-7edc19be.entry.js +2 -0
- package/dist/core/p-7edc19be.entry.js.map +1 -0
- package/dist/core/p-8ab58daa.js +2 -0
- package/dist/core/p-8ab58daa.js.map +1 -0
- package/dist/core/p-8ced1495.entry.js +2 -0
- package/dist/core/p-8ced1495.entry.js.map +1 -0
- package/dist/core/{p-939baa93.entry.js → p-95545b4c.entry.js} +2 -2
- package/dist/core/p-95545b4c.entry.js.map +1 -0
- package/dist/core/p-95d057b8.entry.js +2 -0
- package/dist/core/p-95d057b8.entry.js.map +1 -0
- package/dist/core/p-987cd821.entry.js +2 -0
- package/dist/core/p-987cd821.entry.js.map +1 -0
- package/dist/core/{p-41aa0ed3.entry.js → p-9b386822.entry.js} +2 -2
- package/dist/core/p-9b386822.entry.js.map +1 -0
- package/dist/core/{p-39e20b87.entry.js → p-9bbe221f.entry.js} +2 -2
- package/dist/core/{p-39e20b87.entry.js.map → p-9bbe221f.entry.js.map} +1 -1
- package/dist/core/p-9f157649.entry.js +2 -0
- package/dist/core/p-9f157649.entry.js.map +1 -0
- package/dist/core/{p-356b8a4c.entry.js → p-9f3cf053.entry.js} +2 -2
- package/dist/core/{p-356b8a4c.entry.js.map → p-9f3cf053.entry.js.map} +1 -1
- package/dist/core/p-9f58998d.entry.js +2 -0
- package/dist/core/p-9f58998d.entry.js.map +1 -0
- package/dist/core/p-a4f28ef1.entry.js +2 -0
- package/dist/core/p-a4f28ef1.entry.js.map +1 -0
- package/dist/core/p-ac8090a5.entry.js +2 -0
- package/dist/core/p-ac8090a5.entry.js.map +1 -0
- package/dist/core/p-b1f89f44.entry.js +2 -0
- package/dist/core/p-b1f89f44.entry.js.map +1 -0
- package/dist/core/p-bc350ec5.entry.js +2 -0
- package/dist/core/p-bc350ec5.entry.js.map +1 -0
- package/dist/core/p-bd0328f3.entry.js +2 -0
- package/dist/core/p-bd0328f3.entry.js.map +1 -0
- package/dist/core/p-bf06977d.js +2 -0
- package/dist/core/p-bf06977d.js.map +1 -0
- package/dist/core/p-c0a2a040.entry.js +2 -0
- package/dist/core/p-c0a2a040.entry.js.map +1 -0
- package/dist/core/p-cc0e0b46.entry.js +2 -0
- package/dist/core/p-cc0e0b46.entry.js.map +1 -0
- package/dist/core/p-d0020f6f.entry.js +2 -0
- package/dist/core/p-d0020f6f.entry.js.map +1 -0
- package/dist/core/{p-3d618bc2.entry.js → p-d1045cd5.entry.js} +2 -2
- package/dist/core/p-d56248df.entry.js +2 -0
- package/dist/core/p-d56248df.entry.js.map +1 -0
- package/dist/core/p-d921dc2c.entry.js +2 -0
- package/dist/core/p-d921dc2c.entry.js.map +1 -0
- package/dist/core/p-da398a5d.entry.js +2 -0
- package/dist/core/p-da398a5d.entry.js.map +1 -0
- package/dist/core/{p-2e9e8e7c.entry.js → p-db5af9f7.entry.js} +2 -2
- package/dist/core/p-db5af9f7.entry.js.map +1 -0
- package/dist/core/p-dd4c83ad.entry.js +2 -0
- package/dist/core/p-dd4c83ad.entry.js.map +1 -0
- package/dist/core/p-e362b5f3.entry.js +2 -0
- package/dist/core/p-e362b5f3.entry.js.map +1 -0
- package/dist/core/p-e89c2feb.entry.js +2 -0
- package/dist/core/p-e89c2feb.entry.js.map +1 -0
- package/dist/core/p-eaeaa096.entry.js +2 -0
- package/dist/core/p-eaeaa096.entry.js.map +1 -0
- package/dist/core/{p-c2b5e7b1.entry.js → p-eb87b43b.entry.js} +2 -2
- package/dist/core/{p-c2b5e7b1.entry.js.map → p-eb87b43b.entry.js.map} +1 -1
- package/dist/core/p-f5dfcf4f.entry.js +2 -0
- package/dist/core/p-f5dfcf4f.entry.js.map +1 -0
- package/dist/core/p-f5fbfbc9.entry.js +2 -0
- package/dist/core/p-f5fbfbc9.entry.js.map +1 -0
- package/dist/core/p-fac387e8.entry.js +2 -0
- package/dist/core/p-fac387e8.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/date-helpers-0e5e32a7.js +136 -0
- package/dist/esm/date-helpers-0e5e32a7.js.map +1 -0
- package/dist/esm/helpers-948df101.js +403 -0
- package/dist/esm/helpers-948df101.js.map +1 -0
- package/dist/esm/{helpers-268c2b7f.js → helpers-cd64688a.js} +142 -99
- package/dist/esm/helpers-cd64688a.js.map +1 -0
- package/dist/esm/ic-accordion-group.entry.js +31 -4
- package/dist/esm/ic-accordion-group.entry.js.map +1 -1
- package/dist/esm/ic-accordion.entry.js +11 -4
- package/dist/esm/ic-accordion.entry.js.map +1 -1
- package/dist/esm/ic-alert.entry.js +20 -6
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-back-to-top.entry.js +26 -17
- package/dist/esm/ic-back-to-top.entry.js.map +1 -1
- package/dist/esm/ic-badge.entry.js +86 -83
- package/dist/esm/ic-badge.entry.js.map +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +62 -25
- package/dist/esm/ic-breadcrumb-group.entry.js.map +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +2 -2
- package/dist/esm/ic-breadcrumb.entry.js.map +1 -1
- package/dist/esm/ic-button_3.entry.js +145 -103
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card-horizontal.entry.js +126 -0
- package/dist/esm/ic-card-horizontal.entry.js.map +1 -0
- package/dist/esm/ic-card.entry.js +30 -7
- package/dist/esm/ic-card.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +28 -17
- package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
- package/dist/esm/ic-checkbox.entry.js +50 -31
- package/dist/esm/ic-checkbox.entry.js.map +1 -1
- package/dist/esm/ic-chip.entry.js +45 -21
- package/dist/esm/ic-chip.entry.js.map +1 -1
- package/dist/esm/ic-classification-banner.entry.js +14 -5
- package/dist/esm/ic-classification-banner.entry.js.map +1 -1
- package/dist/esm/ic-data-entity.entry.js +3 -6
- package/dist/esm/ic-data-entity.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +21 -35
- package/dist/esm/ic-data-row.entry.js.map +1 -1
- package/dist/esm/ic-data-table-title-bar.entry.js +53 -0
- package/dist/esm/ic-data-table-title-bar.entry.js.map +1 -0
- package/dist/esm/ic-data-table.entry.js +1080 -85
- package/dist/esm/ic-data-table.entry.js.map +1 -1
- package/dist/esm/ic-date-input.entry.js +1119 -0
- package/dist/esm/ic-date-input.entry.js.map +1 -0
- package/dist/esm/ic-date-picker.entry.js +1125 -0
- package/dist/esm/ic-date-picker.entry.js.map +1 -0
- package/dist/esm/ic-dialog.entry.js +54 -12
- package/dist/esm/ic-dialog.entry.js.map +1 -1
- package/dist/esm/ic-divider.entry.js +1 -1
- package/dist/esm/ic-empty-state_2.entry.js +383 -0
- package/dist/esm/ic-empty-state_2.entry.js.map +1 -0
- package/dist/esm/ic-footer-link-group.entry.js +4 -4
- package/dist/esm/ic-footer-link-group.entry.js.map +1 -1
- package/dist/esm/ic-footer-link.entry.js +3 -3
- package/dist/esm/ic-footer-link.entry.js.map +1 -1
- package/dist/esm/ic-footer.entry.js +18 -7
- package/dist/esm/ic-footer.entry.js.map +1 -1
- package/dist/esm/ic-hero.entry.js +12 -2
- package/dist/esm/ic-hero.entry.js.map +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +5 -5
- package/dist/esm/ic-horizontal-scroll.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_4.entry.js +157 -0
- package/dist/esm/ic-input-component-container_4.entry.js.map +1 -0
- package/dist/esm/ic-link.entry.js +35 -17
- package/dist/esm/ic-link.entry.js.map +1 -1
- package/dist/esm/ic-menu-group.entry.js +2 -2
- package/dist/esm/ic-menu-group.entry.js.map +1 -1
- package/dist/esm/ic-menu-item.entry.js +21 -20
- package/dist/esm/ic-menu-item.entry.js.map +1 -1
- package/dist/esm/ic-menu-with-multi.entry.js +2736 -0
- package/dist/esm/ic-menu-with-multi.entry.js.map +1 -0
- package/dist/esm/{ic-input-component-container_3.entry.js → ic-menu.entry.js} +19 -80
- package/dist/esm/ic-menu.entry.js.map +1 -0
- package/dist/esm/ic-navigation-button.entry.js +29 -8
- package/dist/esm/ic-navigation-button.entry.js.map +1 -1
- package/dist/esm/ic-navigation-group.entry.js +33 -23
- package/dist/esm/ic-navigation-group.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +83 -37
- 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 +10 -10
- package/dist/esm/ic-page-header.entry.js.map +1 -1
- package/dist/esm/ic-pagination_4.entry.js +232 -117
- package/dist/esm/ic-pagination_4.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +40 -36
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-radio-group.entry.js +100 -59
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +59 -42
- package/dist/esm/ic-radio-option.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js +22 -30
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js +1 -1
- package/dist/esm/ic-section-container.entry.js.map +1 -1
- package/dist/esm/ic-select-with-multi.entry.js +792 -0
- package/dist/esm/ic-select-with-multi.entry.js.map +1 -0
- package/dist/esm/ic-side-navigation.entry.js +53 -73
- package/dist/esm/ic-side-navigation.entry.js.map +1 -1
- package/dist/esm/ic-skeleton.entry.js +16 -35
- package/dist/esm/ic-skeleton.entry.js.map +1 -1
- package/dist/esm/ic-status-tag.entry.js +4 -2
- package/dist/esm/ic-status-tag.entry.js.map +1 -1
- package/dist/esm/ic-step.entry.js +5 -2
- package/dist/esm/ic-step.entry.js.map +1 -1
- package/dist/esm/ic-stepper.entry.js +31 -9
- package/dist/esm/ic-stepper.entry.js.map +1 -1
- package/dist/esm/ic-switch.entry.js +7 -3
- package/dist/esm/ic-switch.entry.js.map +1 -1
- package/dist/esm/ic-tab-context.entry.js +78 -130
- package/dist/esm/ic-tab-context.entry.js.map +1 -1
- package/dist/esm/ic-tab-group.entry.js +1 -1
- package/dist/esm/ic-tab-panel.entry.js +5 -13
- package/dist/esm/ic-tab-panel.entry.js.map +1 -1
- package/dist/esm/ic-tab.entry.js +16 -14
- package/dist/esm/ic-tab.entry.js.map +1 -1
- package/dist/esm/ic-theme.entry.js +13 -22
- package/dist/esm/ic-theme.entry.js.map +1 -1
- package/dist/esm/ic-toast-region.entry.js +6 -0
- package/dist/esm/ic-toast-region.entry.js.map +1 -1
- package/dist/esm/ic-toast.entry.js +21 -18
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/dist/esm/ic-toggle-button-group.entry.js +197 -0
- package/dist/esm/ic-toggle-button-group.entry.js.map +1 -0
- package/dist/esm/ic-toggle-button.entry.js +93 -0
- package/dist/esm/ic-toggle-button.entry.js.map +1 -0
- package/dist/esm/ic-top-navigation.entry.js +60 -82
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/ic-tree-item.entry.js +249 -0
- package/dist/esm/ic-tree-item.entry.js.map +1 -0
- package/dist/esm/ic-tree-view.entry.js +211 -0
- package/dist/esm/ic-tree-view.entry.js.map +1 -0
- package/dist/esm/ic-typography.entry.js +52 -15
- package/dist/esm/ic-typography.entry.js.map +1 -1
- package/dist/esm/index-93509377.js +48 -12
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-card-horizontal/ic-card-horizontal.d.ts +71 -0
- package/dist/types/components/ic-card-horizontal/ic-card-horizontal.stories.d.ts +82 -0
- package/dist/types/components/ic-card-horizontal/ic-card-horizontal.types.d.ts +1 -0
- package/dist/types/components/ic-data-table/ic-data-table.d.ts +218 -19
- package/dist/types/components/ic-data-table/ic-data-table.stories.d.ts +239 -0
- package/dist/types/components/ic-data-table/ic-data-table.types.d.ts +43 -0
- package/dist/types/components/ic-data-table/story-data.d.ts +492 -2
- package/dist/types/components/ic-data-table-title-bar/ic-data-table-title-bar.d.ts +36 -0
- package/dist/types/components/ic-data-table-title-bar/ic-data-table-title-bar.stories.d.ts +47 -0
- package/dist/types/components/ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.d.ts +1 -0
- package/dist/types/components/ic-date-input/ic-date-input.d.ts +264 -0
- package/dist/types/components/ic-date-input/ic-date-input.stories.d.ts +124 -0
- package/dist/types/components/ic-date-input/story-data.d.ts +1 -0
- package/dist/types/components/ic-date-input/test/helpers/ic-date-input.d.ts +23 -0
- package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +262 -0
- package/dist/types/components/ic-date-picker/ic-date-picker.stories.d.ts +153 -0
- package/dist/types/components/ic-date-picker/ic-day-button.d.ts +16 -0
- package/dist/types/components/ic-date-picker/ic-month-picker.d.ts +14 -0
- package/dist/types/components/ic-date-picker/ic-year-picker.d.ts +16 -0
- package/dist/types/components/ic-date-picker/story-data.d.ts +24 -0
- package/dist/types/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.d.ts +1 -0
- package/dist/types/components/ic-menu-with-multi/ic-menu.d.ts +218 -0
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.d.ts +65 -23
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.stories.d.ts +106 -0
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.types.d.ts +4 -0
- package/dist/types/components/ic-select-with-multi/ic-select-multi.stories.d.ts +106 -0
- package/dist/types/components/ic-select-with-multi/ic-select.d.ts +289 -0
- package/dist/types/components/ic-select-with-multi/story-data.d.ts +32 -0
- package/dist/types/components/ic-tree-item/ic-tree-item.d.ts +101 -0
- package/dist/types/components/ic-tree-view/ic-tree-view.d.ts +51 -0
- package/dist/types/components/ic-tree-view/ic-tree-view.stories.d.ts +99 -0
- package/dist/types/components.d.ts +1711 -127
- package/dist/types/interface.d.ts +1 -0
- package/dist/types/utils/constants.d.ts +38 -0
- package/dist/types/utils/date-helpers.d.ts +22 -0
- package/dist/types/utils/helpers.d.ts +144 -2
- package/dist/types/utils/types.d.ts +126 -0
- package/hydrate/index.js +18298 -9132
- package/package.json +27 -17
- package/dist/cjs/helpers-bbe55215.js.map +0 -1
- package/dist/cjs/ic-empty-state.cjs.entry.js +0 -38
- package/dist/cjs/ic-empty-state.cjs.entry.js.map +0 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +0 -1
- package/dist/cjs/ic-input-label_2.cjs.entry.js +0 -86
- package/dist/cjs/ic-input-label_2.cjs.entry.js.map +0 -1
- package/dist/cjs/ic-pagination-bar.cjs.entry.js +0 -285
- package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +0 -1
- package/dist/collection/components/ic-pagination/ic-pagination.types.js +0 -2
- package/dist/collection/components/ic-pagination/ic-pagination.types.js.map +0 -1
- package/dist/core/p-0083465b.entry.js +0 -2
- package/dist/core/p-0083465b.entry.js.map +0 -1
- package/dist/core/p-03487f12.entry.js +0 -2
- package/dist/core/p-03487f12.entry.js.map +0 -1
- package/dist/core/p-03f8fa1a.entry.js +0 -2
- package/dist/core/p-03f8fa1a.entry.js.map +0 -1
- package/dist/core/p-0c18b6a0.entry.js +0 -2
- package/dist/core/p-0c18b6a0.entry.js.map +0 -1
- package/dist/core/p-1bc034aa.entry.js +0 -2
- package/dist/core/p-1bc034aa.entry.js.map +0 -1
- package/dist/core/p-20a76d1d.entry.js +0 -2
- package/dist/core/p-20a76d1d.entry.js.map +0 -1
- package/dist/core/p-24945ee5.entry.js.map +0 -1
- package/dist/core/p-2dc35696.entry.js +0 -2
- package/dist/core/p-2dc35696.entry.js.map +0 -1
- package/dist/core/p-2e9e8e7c.entry.js.map +0 -1
- package/dist/core/p-3ee25a6d.entry.js +0 -2
- package/dist/core/p-3ee25a6d.entry.js.map +0 -1
- package/dist/core/p-41aa0ed3.entry.js.map +0 -1
- package/dist/core/p-4314aa0e.entry.js +0 -2
- package/dist/core/p-4314aa0e.entry.js.map +0 -1
- package/dist/core/p-4409f656.entry.js.map +0 -1
- package/dist/core/p-47abbd06.entry.js +0 -2
- package/dist/core/p-47abbd06.entry.js.map +0 -1
- package/dist/core/p-485823b6.entry.js +0 -2
- package/dist/core/p-485823b6.entry.js.map +0 -1
- package/dist/core/p-4ee59448.entry.js +0 -2
- package/dist/core/p-4ee59448.entry.js.map +0 -1
- package/dist/core/p-5157cfab.entry.js +0 -2
- package/dist/core/p-5157cfab.entry.js.map +0 -1
- package/dist/core/p-53083575.entry.js +0 -2
- package/dist/core/p-53083575.entry.js.map +0 -1
- package/dist/core/p-55d5541f.entry.js +0 -2
- package/dist/core/p-55d5541f.entry.js.map +0 -1
- package/dist/core/p-5bb32ee6.entry.js +0 -2
- package/dist/core/p-5bb32ee6.entry.js.map +0 -1
- package/dist/core/p-67eea079.entry.js +0 -2
- package/dist/core/p-67eea079.entry.js.map +0 -1
- package/dist/core/p-6bd0e984.entry.js +0 -2
- package/dist/core/p-6bd0e984.entry.js.map +0 -1
- package/dist/core/p-75bf6162.entry.js +0 -2
- package/dist/core/p-75bf6162.entry.js.map +0 -1
- package/dist/core/p-76959313.entry.js +0 -2
- package/dist/core/p-76959313.entry.js.map +0 -1
- package/dist/core/p-7de813a3.entry.js +0 -2
- package/dist/core/p-7de813a3.entry.js.map +0 -1
- package/dist/core/p-7eae5f70.entry.js +0 -2
- package/dist/core/p-7eae5f70.entry.js.map +0 -1
- package/dist/core/p-85508347.entry.js +0 -2
- package/dist/core/p-85508347.entry.js.map +0 -1
- package/dist/core/p-8da152c4.entry.js +0 -2
- package/dist/core/p-8da152c4.entry.js.map +0 -1
- package/dist/core/p-8fd4ca0a.js +0 -2
- package/dist/core/p-8fd4ca0a.js.map +0 -1
- package/dist/core/p-939baa93.entry.js.map +0 -1
- package/dist/core/p-9777ebb1.entry.js +0 -2
- package/dist/core/p-9777ebb1.entry.js.map +0 -1
- package/dist/core/p-9c27b73e.entry.js +0 -2
- package/dist/core/p-9c27b73e.entry.js.map +0 -1
- package/dist/core/p-9fa6844f.entry.js +0 -2
- package/dist/core/p-9fa6844f.entry.js.map +0 -1
- package/dist/core/p-9fdd7d73.entry.js +0 -2
- package/dist/core/p-9fdd7d73.entry.js.map +0 -1
- package/dist/core/p-a3ab9f4c.entry.js +0 -2
- package/dist/core/p-a3ab9f4c.entry.js.map +0 -1
- package/dist/core/p-a51e5c7c.entry.js +0 -2
- package/dist/core/p-a51e5c7c.entry.js.map +0 -1
- package/dist/core/p-a7481232.entry.js +0 -2
- package/dist/core/p-a7481232.entry.js.map +0 -1
- package/dist/core/p-ab9f8a3f.entry.js +0 -2
- package/dist/core/p-ab9f8a3f.entry.js.map +0 -1
- package/dist/core/p-b2aa3d7c.entry.js +0 -2
- package/dist/core/p-b2aa3d7c.entry.js.map +0 -1
- package/dist/core/p-b5cf6d65.entry.js +0 -2
- package/dist/core/p-b5cf6d65.entry.js.map +0 -1
- package/dist/core/p-baf81f30.entry.js.map +0 -1
- package/dist/core/p-bc187bb5.entry.js +0 -2
- package/dist/core/p-bc187bb5.entry.js.map +0 -1
- package/dist/core/p-bd9cecce.entry.js +0 -2
- package/dist/core/p-bd9cecce.entry.js.map +0 -1
- package/dist/core/p-be980606.entry.js +0 -2
- package/dist/core/p-be980606.entry.js.map +0 -1
- package/dist/core/p-c1256810.entry.js +0 -2
- package/dist/core/p-c1256810.entry.js.map +0 -1
- package/dist/core/p-d76cfa5a.entry.js +0 -2
- package/dist/core/p-d76cfa5a.entry.js.map +0 -1
- package/dist/core/p-e189f1d0.entry.js +0 -2
- package/dist/core/p-e189f1d0.entry.js.map +0 -1
- package/dist/core/p-e9e145aa.entry.js +0 -2
- package/dist/core/p-e9e145aa.entry.js.map +0 -1
- package/dist/core/p-f0e9a83f.entry.js +0 -2
- package/dist/core/p-f0e9a83f.entry.js.map +0 -1
- package/dist/core/p-f23d2102.entry.js +0 -2
- package/dist/core/p-f23d2102.entry.js.map +0 -1
- package/dist/core/p-f87e8411.entry.js +0 -2
- package/dist/core/p-f87e8411.entry.js.map +0 -1
- package/dist/esm/helpers-268c2b7f.js.map +0 -1
- package/dist/esm/ic-empty-state.entry.js.map +0 -1
- package/dist/esm/ic-input-component-container_3.entry.js.map +0 -1
- package/dist/esm/ic-input-label_2.entry.js +0 -81
- package/dist/esm/ic-input-label_2.entry.js.map +0 -1
- package/dist/esm/ic-pagination-bar.entry.js +0 -281
- package/dist/esm/ic-pagination-bar.entry.js.map +0 -1
- package/dist/types/components/ic-pagination/ic-pagination.types.d.ts +0 -6
- /package/dist/core/{p-b97dc365.entry.js.map → p-487fd924.entry.js.map} +0 -0
- /package/dist/core/{p-d77960f6.entry.js.map → p-656378ba.entry.js.map} +0 -0
- /package/dist/core/{p-3d618bc2.entry.js.map → p-d1045cd5.entry.js.map} +0 -0
@@ -3,6 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-4cf27b16.js');
|
6
|
+
const helpers = require('./helpers-951fb33a.js');
|
6
7
|
|
7
8
|
const unsortedIcon = `<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24">
|
8
9
|
<path d="M9 3 5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z"></path>
|
@@ -16,17 +17,217 @@ const descendingIcon = `<svg focusable="false" aria-hidden="true" viewBox="0 0 2
|
|
16
17
|
<path d="M16.01 11H4v2h12.01v3L20 12l-3.99-4z"></path>
|
17
18
|
</svg>`;
|
18
19
|
|
19
|
-
const icDataTableCss = ":host{position:relative;display:
|
20
|
+
const icDataTableCss = ":host{position:relative;display:inline-flex;max-height:100%;width:var(--table-width, 100%);height:100%;min-width:var(--table-min-width);max-width:var(--table-max-width)}tbody{vertical-align:top}.table-container{position:relative;height:calc(100% - var(--ic-space-xxxs));display:flex;flex-direction:column;width:100%}.cell-container{display:flex;min-height:1.5rem;overflow-y:hidden;height:var(--row-height)}.truncation-show-hide{display:block}.cell-icon.truncation-show-hide{display:flex}.cell-container:not(.data-type-element,.truncation-show-hide){overflow-x:hidden}ic-loading-indicator{position:sticky;top:20px}.table-row-container{position:relative;height:100%;overflow:auto;transition:var(--ic-easing-transition-fast);overflow-anchor:none}:host([show-pagination=\"true\"]) .table-row-container{height:calc(100% - 3.5625rem)}table{table-layout:var(--table-layout, \"fixed\");border-spacing:0;width:100%;height:var(--table-height, auto)}.table-row-container:focus{outline:none;box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast);z-index:1}:host([embedded=\"true\"]) .table-row-container{border:var(--ic-border-light)}.column-header-inner-container{padding:var(--ic-space-xs);box-sizing:border-box}.column-header-inner-container ic-tooltip{pointer-events:none}.column-header-inner-container ic-tooltip.show-trunc-tooltip{pointer-events:auto}.column-header-inner-container ic-tooltip .column-header-text{--ic-line-clamp:1}.column-header-sticky{position:sticky;top:0;z-index:1}.column-header-overlay{position:sticky;top:0;z-index:1;box-shadow:0 0.375rem var(--ic-space-xs) calc(var(--ic-space-xxs * -1))\n rgb(0 0 0 / 20%)}.row-header-sticky{position:sticky;left:0}.column-header,.table-row{box-sizing:border-box}.table-row-selected{background-color:var(--ic-table-row-selected) !important}.sort-button{margin-left:auto}.sort-button:hover{background-color:var(--ic-action-dark-bg-hover)}.sort-button:active{background-color:var(--ic-action-dark-bg-active)}.sort-button svg{color:var(--ic-architectural-black)}.sort-button-unsorted svg{color:var(--ic-color-tertiary-text)}.table-density-dense .column-header-inner-container,td.table-density-dense{padding:var(--ic-space-xxs) var(--ic-space-xs) !important}.text-dense{font-size:var(--ic-font-size-label)}.table-density-spacious .column-header-inner-container,td.table-density-spacious{padding:0.625rem var(--ic-space-xs) !important}.text-spacious{font-size:1.125rem}.column-header-text{font-weight:var(--ic-font-weight-bold)}.dummy-column-header-text{white-space:nowrap;overflow:hidden;height:0;width:-moz-fit-content;width:fit-content}.row-header,.column-header{text-align:left;padding:var(--ic-space-xs);background-color:var(--ic-architectural-40);border-right:var(--ic-border-light);border-bottom:var(--ic-border-light)}.column-header{padding:0;width:var(--column-width);min-width:var(--column-min-width, 4rem);max-width:var(--column-max-width)}.column-header:last-child{border-right:none}.scrollable .column-header:last-child{border-right:var(--ic-border-light) !important}:host([embedded=\"true\"]) tr:last-child .table-cell,:host([embedded=\"true\"]) tr:last-child .row-header{border-bottom:none}.column-header-alignment-left,.row-header-alignment-left,.cell-alignment-left{text-align:left !important;justify-content:start !important}.column-header-alignment-right,.row-header-alignment-right,.cell-alignment-right{text-align:right !important;justify-content:end !important}.cell-alignment-right.truncation-tooltip ic-tooltip ic-typography{padding-right:calc(var(--ic-space-xxs) + var(--ic-space-xs))}.cell-alignment-right.truncation-show-hide ic-typography{--ellipsis-padding-right:calc(var(--ic-space-xxs) + var(--ic-space-xs))}.column-header-alignment-center,.row-header-alignment-center,.cell-alignment-center{text-align:center !important;justify-content:center !important}.table-row:nth-child(even){background-color:var(--ic-architectural-20)}.table-cell{padding:var(--ic-space-xs);border-bottom:solid var(--ic-architectural-100) var(--ic-space-1px);overflow:hidden;box-sizing:border-box;max-width:var(--column-max-width);min-width:var(--column-min-width)}.table-cell.with-overflow{overflow:visible}.data-type-string,.data-type-address{text-align:left;vertical-align:top}.data-type-number,.data-type-date{text-align:right;justify-content:end;vertical-align:top}.cell-alignment-top{vertical-align:top;align-items:flex-start}.cell-alignment-middle{vertical-align:middle;align-items:center}.cell-alignment-bottom{vertical-align:bottom;align-items:flex-end}.cell-emphasis-low{color:var(--ic-color-secondary-text)}.cell-emphasis-high{font-weight:var(--ic-font-weight-bold)}.pagination-container{background-color:var(--ic-architectural-40);border-top:var(--ic-border-light)}.screen-reader-sort-text,.table-caption{position:absolute;left:-100rem}.table-cell,.column-header,.row-header{word-wrap:break-word;white-space:pre-wrap}.loading-empty{padding:var(--ic-space-xl) var(--ic-space-xxl);margin-top:var(--ic-space-xl)}.updating-state{padding:0;border-bottom:var(--ic-border-light)}.updating-state-headers{border-bottom:none}.loading{position:absolute;left:calc(50% - 5.9741rem);opacity:0;transition:opacity var(--ic-transition-duration-slow);z-index:calc(var(--ic-z-index-dialog) - 1)}.loading.show-background{background-color:var(--ic-architectural-white);border:var(--ic-border-light)}.loading.show{opacity:1}.icon,::slotted(svg){height:var(--ic-space-lg);width:var(--ic-space-lg);margin-right:var(--ic-space-xxs)}.column-header-alignment-right>.icon,.row-header-alignment-right>.icon,.cell-alignment-right>.icon,.column-header-alignment-right>::slotted(svg),.row-header-alignment-right>::slotted(svg),.cell-alignment-right>::slotted(svg){margin-right:auto}.column-header-alignment-center>ic-typography,.column-header-alignment-center>.cell-text-wrapper,.row-header-alignment-right>ic-typography,.row-header-alignment-right>.cell-text-wrapper,.cell-alignment-center>ic-typography,.cell-alignment-center>.cell-text-wrapper{flex:1}.icon>svg{height:var(--ic-space-lg);width:var(--ic-space-lg);display:inline-block}.truncation-tooltip ic-typography{display:-webkit-box;-webkit-line-clamp:var(--ic-line-clamp, 0);-webkit-box-orient:vertical;overflow:hidden}.truncation-tooltip ic-typography,.truncation-show-hide ic-typography{white-space:normal}.ic-tooltip-overflow{overflow:hidden;width:100%}.action-element{display:flex;justify-content:right}.cell-grid-wrapper{display:grid;grid-template-columns:auto auto}.loading-overlay{visibility:hidden;position:absolute;top:0;left:0;width:100%;height:100%;background:var(--ic-architectural-black);z-index:calc(var(--ic-z-index-dialog) - 2);opacity:0;transition:opacity var(--ic-transition-duration-slow)}.loading-overlay.show{visibility:visible;opacity:0.6}.sr-only{position:absolute;left:-9999px}@media (prefers-reduced-motion: reduce){.loading-overlay{transition:none}}.cell-text-wrapper{overflow:hidden}.cell-text-wrapper>ic-typography{margin-left:2px}.cell-text-no-wrap{word-wrap:initial}.cell-container-with-description{display:flex;flex-direction:row}.cell-description{display:flex;flex-direction:row;margin-top:var(--ic-space-xxs);word-break:break-all}.cell-description-text{color:var(--ic-color-secondary-text)}.cell-description-icon{padding-right:var(--ic-space-xs)}.cell-description-icon>svg{height:calc(var(--ic-space-lg) - var(--ic-space-xxs));width:calc(var(--ic-space-lg) - var(--ic-space-xxs));display:flex}@media (min-width: 577px){.column-header-inner-container{display:flex;align-items:center}}@media (max-width: 577px){.cell-icon{flex-wrap:wrap}.cell-description-icon{padding-right:0}}@media (forced-colors: active){.icon,::slotted(svg),.cell-description-icon>svg{fill:currentcolor}.sort-button svg{color:currentcolor}.table-row-selected{background-color:Highlight !important}}";
|
20
21
|
|
21
22
|
const DataTable = class {
|
22
23
|
constructor(hostRef) {
|
23
24
|
index.registerInstance(this, hostRef);
|
25
|
+
this.icRowHeightChange = index.createEvent(this, "icRowHeightChange", 7);
|
26
|
+
this.icSelectedRowChange = index.createEvent(this, "icSelectedRowChange", 7);
|
27
|
+
this.icSortChange = index.createEvent(this, "icSortChange", 7);
|
28
|
+
this.DENSITY_HEIGHT_MULTIPLIER = {
|
29
|
+
dense: 0.8,
|
30
|
+
default: 1,
|
31
|
+
spacious: 1.2,
|
32
|
+
};
|
33
|
+
this.DENSITY_PADDING_HEIGHT_DIFF = {
|
34
|
+
dense: 8,
|
35
|
+
default: 16,
|
36
|
+
spacious: 20,
|
37
|
+
};
|
24
38
|
this.SORT_ICONS = {
|
25
39
|
unsorted: unsortedIcon,
|
26
40
|
ascending: ascendingIcon,
|
27
41
|
descending: descendingIcon,
|
28
42
|
};
|
29
|
-
this.
|
43
|
+
this.hasLoadedForOneSecond = true;
|
44
|
+
this.resizeObserver = null;
|
45
|
+
this.SHOW_HIDE_STRING = "show-hide";
|
46
|
+
this.SHOW_HIDE_CSS_CLASS = `${this.SHOW_HIDE_STRING}-wrap`;
|
47
|
+
this.TOOLTIP_STRING = "tooltip";
|
48
|
+
this.TOOLTIP = `ic-${this.TOOLTIP_STRING}`;
|
49
|
+
this.TEXT_WRAP_STRING = "text-wrap";
|
50
|
+
this.TEXT_WRAP_CLASS = `.${this.TEXT_WRAP_STRING}`;
|
51
|
+
this.dataUpdated = false;
|
52
|
+
this.rowHeightSet = false;
|
53
|
+
this.initialLoad = false;
|
54
|
+
this.icPageChangeEvent = false;
|
55
|
+
this.itemsPerPageChange = false;
|
56
|
+
this.DATA_ROW_HEIGHT_STRING = "data-row-height";
|
57
|
+
this.ROW_HEIGHT_CSS_VARIABLE = "--row-height";
|
58
|
+
this.LINE_CLAMP_CSS_VARIABLE = "--ic-line-clamp";
|
59
|
+
this.DEFAULT_LINE_HEIGHT = 24;
|
60
|
+
this.densityUpdate = false;
|
61
|
+
this.truncationPatternUpdated = false;
|
62
|
+
this.isNewDebounceDelaySet = false;
|
63
|
+
this.headerResizeObserver = null;
|
64
|
+
this.IC_TOOLTIP_STRING = "ic-tooltip";
|
65
|
+
this.SHOW_TRUNC_TOOLTIP_STRING = "show-trunc-tooltip";
|
66
|
+
this.CELL_DESCRIPTION_STRING = ".cell-description";
|
67
|
+
this.CELL_CONTAINER_WITH_DESCRIPTION_STRING = "cell-container-with-description";
|
68
|
+
this.CELL_TEXT_WRAPPER_STRING = ".cell-text-wrapper";
|
69
|
+
this.IC_TYPOGRAPHY_STRING = "ic-typography";
|
70
|
+
this.runHeaderResizeObserver = () => {
|
71
|
+
this.headerResizeObserver = new ResizeObserver(() => {
|
72
|
+
this.headerResizeCallback();
|
73
|
+
});
|
74
|
+
this.headerResizeObserver.observe(this.el);
|
75
|
+
};
|
76
|
+
this.headerResizeCallback = () => {
|
77
|
+
if (!this.hideColumnHeaders && this.columnHeaderTruncation) {
|
78
|
+
const tableContainerWidth = this.el.shadowRoot.querySelector(".table-container").clientWidth;
|
79
|
+
if (tableContainerWidth !== this.prevTableContainerWidth) {
|
80
|
+
const headers = this.el.shadowRoot.querySelectorAll("th.column-header");
|
81
|
+
headers.forEach((header) => {
|
82
|
+
const tooltip = header.querySelector(this.IC_TOOLTIP_STRING);
|
83
|
+
const typographyEls = header.querySelectorAll(this.IC_TYPOGRAPHY_STRING);
|
84
|
+
if (tooltip && typographyEls && typographyEls.length === 2) {
|
85
|
+
tooltip.classList.remove(this.SHOW_TRUNC_TOOLTIP_STRING);
|
86
|
+
if (typographyEls[1].clientWidth > typographyEls[0].clientWidth) {
|
87
|
+
tooltip.classList.add(this.SHOW_TRUNC_TOOLTIP_STRING);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
});
|
91
|
+
this.prevTableContainerWidth = tableContainerWidth;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
};
|
95
|
+
this.updateSetRowHeight = (typographyEl) => {
|
96
|
+
const fontSize = parseInt(getComputedStyle(document.documentElement).fontSize);
|
97
|
+
if (typographyEl) {
|
98
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
99
|
+
const rowHeight = fontSize *
|
100
|
+
parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
101
|
+
if (typographyEl.scrollHeight > rowHeight) {
|
102
|
+
cellContainer.style.removeProperty(this.ROW_HEIGHT_CSS_VARIABLE);
|
103
|
+
}
|
104
|
+
}
|
105
|
+
else {
|
106
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
107
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
108
|
+
const rowHeight = fontSize *
|
109
|
+
parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
110
|
+
if (typographyEl.scrollHeight > rowHeight) {
|
111
|
+
cellContainer.style.removeProperty(this.ROW_HEIGHT_CSS_VARIABLE);
|
112
|
+
}
|
113
|
+
});
|
114
|
+
}
|
115
|
+
};
|
116
|
+
this.debounceDataTruncation = () => {
|
117
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
118
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
119
|
+
if (!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {
|
120
|
+
this.resizeObserver = new ResizeObserver(
|
121
|
+
// This gets triggered twice due to updated data and see more/see less button
|
122
|
+
helpers.dynamicDebounce(() => {
|
123
|
+
this.dataTruncation(typographyEl);
|
124
|
+
if (!this.isNewDebounceDelaySet) {
|
125
|
+
this.setNewDebounceDelay(200);
|
126
|
+
}
|
127
|
+
}, () => this.debounceDelay));
|
128
|
+
this.resizeObserver.observe(typographyEl);
|
129
|
+
}
|
130
|
+
});
|
131
|
+
};
|
132
|
+
this.setNewDebounceDelay = (delay) => {
|
133
|
+
this.debounceDelay = delay;
|
134
|
+
this.isNewDebounceDelaySet = true;
|
135
|
+
};
|
136
|
+
this.getLines = (height) => Math.floor(height / this.DEFAULT_LINE_HEIGHT);
|
137
|
+
this.truncate = (typographyEl, cellContainer, tooltip) => {
|
138
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
|
139
|
+
//24 is the height of a single line
|
140
|
+
if (!typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
141
|
+
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
142
|
+
this.addTooltipTruncation(typographyEl, cellContainer, tooltip);
|
143
|
+
}
|
144
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
145
|
+
this.addShowHideTruncation(cellContainer, typographyEl);
|
146
|
+
}
|
147
|
+
}
|
148
|
+
}
|
149
|
+
else {
|
150
|
+
if (this.truncationPattern === this.TOOLTIP_STRING && tooltip) {
|
151
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: 0`);
|
152
|
+
const cellTextWrapper = cellContainer.querySelector(this.CELL_TEXT_WRAPPER_STRING);
|
153
|
+
cellTextWrapper.prepend(typographyEl);
|
154
|
+
tooltip.remove();
|
155
|
+
}
|
156
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING &&
|
157
|
+
!helpers.isEmptyString(typographyEl.getAttribute("max-lines"))) {
|
158
|
+
this.resetShowHideTruncation(typographyEl);
|
159
|
+
}
|
160
|
+
}
|
161
|
+
};
|
162
|
+
this.dataTruncation = (typographyEl) => {
|
163
|
+
// Tooltip truncation mentioned in AC. Will need revisiting
|
164
|
+
const tooltip = this.getTooltip(typographyEl);
|
165
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
166
|
+
if ((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.classList.contains("data-type-element")) ||
|
167
|
+
this.dataUpdated) {
|
168
|
+
return;
|
169
|
+
}
|
170
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING &&
|
171
|
+
typographyEl.shadowRoot.querySelector("button")) {
|
172
|
+
const showHideBtn = typographyEl.shadowRoot.querySelector("button");
|
173
|
+
// If the see more/see less is present and the max lines is equal to the cell container
|
174
|
+
// remove the see more/see less button
|
175
|
+
if (showHideBtn) {
|
176
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
177
|
+
if (this.getLines(truncWrapper.scrollHeight) ===
|
178
|
+
+typographyEl.getAttribute("max-lines")) {
|
179
|
+
this.resetShowHideTruncation(typographyEl);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}
|
183
|
+
// Deals with setting and resetting row height and re-truncating data
|
184
|
+
if (this.rowHeightSet && this.truncationPattern === this.SHOW_HIDE_STRING) {
|
185
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
186
|
+
// cellContainer.clientHeight - 24 removes the extra line by see more/see less
|
187
|
+
if (truncWrapper &&
|
188
|
+
cellContainer.clientHeight - this.DEFAULT_LINE_HEIGHT >
|
189
|
+
truncWrapper.scrollHeight) {
|
190
|
+
this.resetShowHideTruncation(typographyEl);
|
191
|
+
return;
|
192
|
+
}
|
193
|
+
if (typographyEl.scrollHeight > cellContainer.clientHeight) {
|
194
|
+
this.addShowHideTruncation(cellContainer, typographyEl);
|
195
|
+
return;
|
196
|
+
}
|
197
|
+
}
|
198
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > 0 &&
|
199
|
+
(cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) > 0 &&
|
200
|
+
(typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) === (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
|
201
|
+
if (tooltip) {
|
202
|
+
this.removeTooltip(cellContainer, typographyEl, tooltip);
|
203
|
+
}
|
204
|
+
return;
|
205
|
+
}
|
206
|
+
this.truncate(typographyEl, cellContainer, tooltip);
|
207
|
+
};
|
208
|
+
this.getTruncWrapper = (typographyEl) => typographyEl.shadowRoot.querySelector(".trunc-wrapper");
|
209
|
+
this.removeTextWrap = () => {
|
210
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
211
|
+
const tableCell = typographyEl.closest("td");
|
212
|
+
if (tableCell.classList.contains(this.TEXT_WRAP_STRING)) {
|
213
|
+
tableCell.classList.remove(this.TEXT_WRAP_STRING);
|
214
|
+
}
|
215
|
+
});
|
216
|
+
};
|
217
|
+
this.getCellContainer = (typographyEl) => {
|
218
|
+
return typographyEl.closest(".cell-container");
|
219
|
+
};
|
220
|
+
this.deleteTextWrapDataKey = (array) => Array.isArray(array) &&
|
221
|
+
array.forEach((val) => val.textWrap && delete val.textWrap);
|
222
|
+
this.startLoadingTimer = () => {
|
223
|
+
this.hasLoadedForOneSecond = false;
|
224
|
+
this.timerStarted = Date.now();
|
225
|
+
setTimeout(() => {
|
226
|
+
this.hasLoadedForOneSecond = true;
|
227
|
+
this.timerStarted = null;
|
228
|
+
}, this.minimumLoadingDisplayDuration);
|
229
|
+
};
|
230
|
+
this.isObject = (value) => value !== undefined && value !== null && typeof value === "object";
|
30
231
|
this.notDefaultDensity = () => this.density !== "default";
|
31
232
|
this.getCellContent = (cell, dataType) => {
|
32
233
|
switch (dataType) {
|
@@ -43,9 +244,103 @@ const DataTable = class {
|
|
43
244
|
return this.getObjectValue(this.getObjectValue(cell, "cellAlignment"), alignment);
|
44
245
|
}
|
45
246
|
};
|
46
|
-
this.
|
247
|
+
this.getCellOptions = (cell, key) => {
|
248
|
+
if (!(this.isObject(cell) && Object.keys(cell).includes(key)))
|
249
|
+
return;
|
250
|
+
return this.getObjectValue(cell, key);
|
251
|
+
};
|
252
|
+
this.createUpdatingIndicator = () => {
|
253
|
+
const { appearance, description, max, min, progress } = this.updatingOptions || {};
|
254
|
+
return (index.h("th", { colSpan: this.columns.length, class: "updating-state" }, index.h("ic-loading-indicator", { appearance: appearance, description: description || "Updating table data", fullWidth: true, max: max, min: min, progress: progress, type: "linear", size: "small" })));
|
255
|
+
};
|
256
|
+
this.setRowHeight = (height) => {
|
257
|
+
return helpers.pxToRem(`${height * this.DENSITY_HEIGHT_MULTIPLIER[this.density] -
|
258
|
+
this.DENSITY_PADDING_HEIGHT_DIFF[this.density]}px`);
|
259
|
+
};
|
260
|
+
this.setTruncationClass = () => this.truncationPattern
|
261
|
+
? { [`truncation-${this.truncationPattern}`]: true }
|
262
|
+
: {};
|
263
|
+
this.getColumnWidth = (columnWidth) => {
|
264
|
+
// TODO: Setting max width on columns
|
265
|
+
let columnWidthStyling = {};
|
266
|
+
if (columnWidth) {
|
267
|
+
if (typeof columnWidth === "string") {
|
268
|
+
columnWidthStyling = Object.assign(Object.assign({}, columnWidthStyling), { ["--column-width"]: columnWidth });
|
269
|
+
}
|
270
|
+
if (typeof columnWidth === "object" && !!Object.keys(columnWidth)) {
|
271
|
+
if (columnWidth === null || columnWidth === void 0 ? void 0 : columnWidth.minWidth) {
|
272
|
+
columnWidthStyling = Object.assign(Object.assign({}, columnWidthStyling), { ["--column-min-width"]: columnWidth === null || columnWidth === void 0 ? void 0 : columnWidth.minWidth });
|
273
|
+
}
|
274
|
+
if (columnWidth === null || columnWidth === void 0 ? void 0 : columnWidth.maxWidth) {
|
275
|
+
columnWidthStyling = Object.assign(Object.assign({}, columnWidthStyling), { ["--column-max-width"]: columnWidth === null || columnWidth === void 0 ? void 0 : columnWidth.maxWidth });
|
276
|
+
}
|
277
|
+
}
|
278
|
+
}
|
279
|
+
return columnWidthStyling;
|
280
|
+
};
|
281
|
+
this.getRowHeight = (currentRowHeight, columnProps, rowTextWrap, cell) => {
|
282
|
+
if ((this.truncationPattern || currentRowHeight) &&
|
283
|
+
!(columnProps === null || columnProps === void 0 ? void 0 : columnProps.textWrap) &&
|
284
|
+
!rowTextWrap &&
|
285
|
+
!this.getCellOptions(cell, "textWrap") &&
|
286
|
+
(columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "element") {
|
287
|
+
return {
|
288
|
+
[this.ROW_HEIGHT_CSS_VARIABLE]: this.setRowHeight(currentRowHeight),
|
289
|
+
};
|
290
|
+
}
|
291
|
+
return {};
|
292
|
+
};
|
293
|
+
this.adjustWidthForActionElement = () => {
|
294
|
+
const elements = this.el.shadowRoot.querySelectorAll(".action-element");
|
295
|
+
elements.forEach((element) => {
|
296
|
+
const width = element.firstChild.getBoundingClientRect()
|
297
|
+
.width;
|
298
|
+
const gridWrapper = element.closest(".cell-grid-wrapper");
|
299
|
+
gridWrapper.style.gridTemplateColumns = `auto calc(${width}px + var(--ic-space-xs))`;
|
300
|
+
});
|
301
|
+
};
|
302
|
+
this.createCellContent = (columnProps, cell, cellSlotName, rowOptions, rowAlignment, hasIcon, currentRowHeight, cellValue, rowEmphasis) => {
|
303
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
304
|
+
return (index.h("div", { innerHTML: (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) === "element" &&
|
305
|
+
!helpers.isSlotUsed(this.el, cellSlotName)
|
306
|
+
? cell
|
307
|
+
: 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) ||
|
308
|
+
((_b = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _b === void 0 ? void 0 : _b.vertical) ||
|
309
|
+
rowAlignment ||
|
310
|
+
this.getCellAlignment(cell, "vertical")}`]: !!((_c = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _c === void 0 ? void 0 : _c.vertical) ||
|
311
|
+
!!((_d = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _d === void 0 ? void 0 : _d.vertical) ||
|
312
|
+
!!rowAlignment ||
|
313
|
+
!!this.getCellAlignment(cell, "vertical"), [`cell-alignment-${((_e = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _e === void 0 ? void 0 : _e.horizontal) ||
|
314
|
+
((_f = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _f === void 0 ? void 0 : _f.horizontal) ||
|
315
|
+
this.getCellAlignment(cell, "horizontal")}`]: !!((_g = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _g === void 0 ? void 0 : _g.horizontal) ||
|
316
|
+
!!((_h = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _h === void 0 ? void 0 : _h.horizontal) ||
|
317
|
+
!!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) ||
|
318
|
+
(rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.textWrap) ||
|
319
|
+
!!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()), { [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
|
320
|
+
? this.setRowHeight(currentRowHeight)
|
321
|
+
: null }, helpers.isSlotUsed(this.el, cellSlotName) ? (index.h("slot", { name: cellSlotName })) : (index.h(index.Fragment, null, helpers.isSlotUsed(this.el, `${cellSlotName}-icon`) ? (index.h("slot", { name: `${cellSlotName}-icon` })) : ((hasIcon || ((_k = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _k === void 0 ? void 0 : _k.onAllCells)) &&
|
322
|
+
(cellValue("icon") || ((_l = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _l === void 0 ? void 0 : _l.icon)) && (index.h("span", { class: "icon", innerHTML: cellValue("icon") || ((_m = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _m === void 0 ? void 0 : _m.icon) }))), (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "element" &&
|
323
|
+
!helpers.isSlotUsed(this.el, cellSlotName) && (index.h("div", { class: {
|
324
|
+
"cell-text-wrapper": true,
|
325
|
+
"cell-text-no-wrap": !this.truncationPattern,
|
326
|
+
} }, index.h("ic-typography", { variant: "body", class: {
|
327
|
+
[`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,
|
332
|
+
[`text-${this.density}`]: this.notDefaultDensity(),
|
333
|
+
} }, this.isObject(cell) && (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "date" ? (Object.keys(cell).includes("href") ? (index.h("ic-link", { href: cellValue("href"), 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) &&
|
334
|
+
Object.keys(cell).includes("description") && (index.h("div", { class: {
|
335
|
+
["cell-description"]: true,
|
336
|
+
[`data-type-${columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType}`]: true,
|
337
|
+
} }, ((_o = cellValue("description")) === null || _o === void 0 ? void 0 : _o.icon) && (index.h("span", { class: "cell-description-icon", innerHTML: cellValue("description").icon })), index.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"))))))))));
|
338
|
+
};
|
339
|
+
this.createCells = (row, rowIndex) => {
|
340
|
+
var _a;
|
47
341
|
const rowValues = Object.values(row);
|
48
342
|
const rowKeys = Object.keys(row);
|
343
|
+
const rowOptions = this.getRowOptions(rowKeys, rowValues);
|
49
344
|
let rowAlignment;
|
50
345
|
let rowEmphasis;
|
51
346
|
const headerIndex = rowKeys.indexOf("header");
|
@@ -53,70 +348,110 @@ const DataTable = class {
|
|
53
348
|
rowAlignment = this.getObjectValue(rowValues[headerIndex], "rowAlignment");
|
54
349
|
rowEmphasis = this.getObjectValue(rowValues[headerIndex], "emphasis");
|
55
350
|
}
|
351
|
+
const variableRowHeightVal = (_a = this.variableRowHeight) === null || _a === void 0 ? void 0 : _a.call(this, Object.assign(Object.assign({}, row), { index: rowIndex }));
|
352
|
+
const currentRowHeight = variableRowHeightVal
|
353
|
+
? variableRowHeightVal !== "auto" && variableRowHeightVal
|
354
|
+
: this.globalRowHeight !== "auto" && this.globalRowHeight;
|
56
355
|
return rowValues.map((cell, index$1) => {
|
57
|
-
const
|
356
|
+
const columnProps = this.columns[index$1];
|
357
|
+
const cellSlotName = `${columnProps === null || columnProps === void 0 ? void 0 : columnProps.key}-${rowIndex}`;
|
358
|
+
const hasIcon = this.isObject(cell) && Object.keys(cell).includes("icon");
|
58
359
|
const cellValue = (key) => this.getObjectValue(cell, key);
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
rowEmphasis}`]: (this.isObject(cell) && !!cellValue("emphasis")) ||
|
79
|
-
!!emphasis ||
|
80
|
-
!!rowEmphasis,
|
81
|
-
[`text-${this.density}`]: this.notDefaultDensity(),
|
82
|
-
} }, this.isObject(cell) && dataType !== "date" ? (Object.keys(cell).includes("href") ? (index.h("ic-link", { href: cellValue("href") }, cellValue("data"))) : (cellValue("data"))) : (this.getCellContent(cell, dataType)))));
|
360
|
+
if (rowKeys[index$1] === "header") {
|
361
|
+
return (index.h("th", { scope: "row", colSpan: cellValue("colspan"), class: {
|
362
|
+
["row-header"]: true,
|
363
|
+
[`row-header-alignment-${cellValue("cellAlignment")}`]: !!cellValue("cellAlignment"),
|
364
|
+
["row-header-sticky"]: this.stickyRowHeaders,
|
365
|
+
} }, cellValue("title")));
|
366
|
+
}
|
367
|
+
if (rowKeys[index$1] !== "rowOptions") {
|
368
|
+
return (index.h("td", { class: {
|
369
|
+
["table-cell"]: true,
|
370
|
+
[`table-density-${this.density}`]: this.notDefaultDensity(),
|
371
|
+
["with-overflow"]: (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) === "element",
|
372
|
+
}, style: Object.assign({}, this.getColumnWidth(columnProps.columnWidth)) }, this.isObject(cell) &&
|
373
|
+
Object.keys(cell).includes("actionElement") ? (index.h("div", { class: "cell-grid-wrapper" }, this.createCellContent(columnProps, cell, cellSlotName, rowOptions, rowAlignment, hasIcon, currentRowHeight, cellValue, rowEmphasis), index.h("span", { class: "action-element", innerHTML: cellValue("actionElement"),
|
374
|
+
// eslint-disable-next-line react/jsx-no-bind
|
375
|
+
onClick: cell.actionOnClick
|
376
|
+
? (event) => this.handleClick(event, cell.actionOnClick)
|
377
|
+
: undefined }))) : (this.createCellContent(columnProps, cell, cellSlotName, rowOptions, rowAlignment, hasIcon, currentRowHeight, cellValue, rowEmphasis))));
|
378
|
+
}
|
83
379
|
});
|
84
380
|
};
|
85
|
-
this.createColumnHeaders = () => {
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
381
|
+
this.createColumnHeaders = () => (this.columns || []).map(({ cellAlignment, colspan, icon, key, title, columnWidth, excludeColumnFromSort, }, index$1) => (index.h("th", { scope: "col", class: {
|
382
|
+
["column-header"]: true,
|
383
|
+
[`table-density-${this.density}`]: this.notDefaultDensity(),
|
384
|
+
["updating-state-headers"]: this.updating && !this.loading,
|
385
|
+
}, style: Object.assign({}, this.getColumnWidth(columnWidth)), colSpan: colspan }, index.h("div", { class: {
|
386
|
+
"column-header-inner-container": true,
|
387
|
+
"truncation-tooltip": this.columnHeaderTruncation,
|
388
|
+
[`column-header-alignment-${cellAlignment}`]: !!cellAlignment,
|
389
|
+
} }, helpers.isSlotUsed(this.el, `${key}-column-icon`) ? (index.h("slot", { name: `${key}-column-icon` })) : (icon &&
|
390
|
+
!icon.hideOnHeader && (index.h("span", { class: "icon", innerHTML: icon.icon }))), this.columnHeaderTruncation ? (index.h("ic-tooltip", { label: title, target: `column-header-${index$1}` }, index.h("ic-typography", { id: `column-header-${index$1}`, variant: "body", class: {
|
391
|
+
["column-header-text"]: true,
|
392
|
+
[`text-${this.density}`]: this.notDefaultDensity(),
|
393
|
+
} }, title))) : (index.h("ic-typography", { variant: "body", class: {
|
394
|
+
["column-header-text"]: true,
|
395
|
+
[`text-${this.density}`]: this.notDefaultDensity(),
|
396
|
+
} }, title)), this.sortable && !excludeColumnFromSort && (index.h("ic-button", { variant: "icon", id: `sort-button-${key}`, "aria-label": this.getSortButtonLabel(key),
|
397
|
+
// eslint-disable-next-line react/jsx-no-bind
|
398
|
+
onClick: () => this.sortRows(key), innerHTML: this.SORT_ICONS[this.sortedColumn === key
|
399
|
+
? this.sortedColumnOrder
|
400
|
+
: "unsorted"], class: {
|
401
|
+
["sort-button"]: true,
|
402
|
+
["sort-button-unsorted"]: this.sortedColumn !== key ||
|
403
|
+
this.sortedColumnOrder === "unsorted",
|
404
|
+
} }))), this.columnHeaderTruncation && (index.h("ic-typography", { variant: "body", "aria-hidden": "true", class: {
|
405
|
+
["column-header-text"]: true,
|
406
|
+
["dummy-column-header-text"]: this.columnHeaderTruncation,
|
407
|
+
[`text-${this.density}`]: this.notDefaultDensity(),
|
408
|
+
} }, title)))));
|
409
|
+
this.onRowClick = (row) => {
|
410
|
+
if (!this.loading && !this.updating) {
|
411
|
+
this.icSelectedRowChange.emit(this.selectedRow !== row ? row : null);
|
412
|
+
}
|
413
|
+
this.selectedRow =
|
414
|
+
this.selectedRow !== row && !this.loading && !this.updating && row;
|
105
415
|
};
|
106
416
|
this.createRows = () => {
|
107
417
|
const data = this.showPagination
|
108
418
|
? this.data.slice(this.fromRow, this.toRow)
|
109
419
|
: this.data.slice();
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
420
|
+
const paginationOffset = this.showPagination ? this.fromRow : 0;
|
421
|
+
/**
|
422
|
+
* Ensures that createCells has a value in data to map over to actually render the slot.
|
423
|
+
* Removes the need for the user to add it multiple times.
|
424
|
+
* `addDataToPosition` used to add the element in the correct column order.
|
425
|
+
* Adding empty string value in to give `createCells` something to loop over.
|
426
|
+
*/
|
427
|
+
const organisedData = data.map((row, rowIndex) => {
|
428
|
+
const slottedColumns = this.columns
|
429
|
+
.map(({ key }, index) => helpers.isSlotUsed(this.el, `${key}-${rowIndex + paginationOffset}`) && {
|
430
|
+
key,
|
431
|
+
index,
|
432
|
+
})
|
433
|
+
.filter((col) => !!col &&
|
434
|
+
// skip the column if its already in the row
|
435
|
+
!Object.prototype.hasOwnProperty.call(row, col.key));
|
436
|
+
return slottedColumns.length > 0
|
437
|
+
? helpers.addDataToPosition(row, slottedColumns, "")
|
438
|
+
: row;
|
439
|
+
});
|
440
|
+
return organisedData
|
441
|
+
.sort(!this.sortable || this.disableAutoSort
|
442
|
+
? undefined
|
443
|
+
: this.getSortFunction())
|
444
|
+
.map((row, index$1) => {
|
445
|
+
return (index.h("tr", {
|
446
|
+
// eslint-disable-next-line react/jsx-no-bind
|
447
|
+
onClick: () => this.onRowClick(row), class: {
|
448
|
+
["table-row"]: true,
|
449
|
+
["table-row-selected"]: this.highlightSelectedRow && this.selectedRow === row,
|
450
|
+
}
|
451
|
+
}, this.createCells(row, index$1 + paginationOffset)));
|
452
|
+
});
|
119
453
|
};
|
454
|
+
this.getObjectValue = (cell, key) => Object.values(cell)[Object.keys(cell).indexOf(key)];
|
120
455
|
this.getSortButtonLabel = (key) => {
|
121
456
|
let label = "";
|
122
457
|
const getNextSortOption = (option) => {
|
@@ -172,10 +507,174 @@ const DataTable = class {
|
|
172
507
|
}
|
173
508
|
this.sortedColumnOrder = sortOrders[nextSortOrderIndex];
|
174
509
|
sortButton.setAttribute("aria-label", this.getSortButtonLabel(column));
|
510
|
+
this.tableSorted = true;
|
511
|
+
this.icSortChange.emit({
|
512
|
+
columnName: column,
|
513
|
+
sorted: this.sortedColumnOrder,
|
514
|
+
});
|
515
|
+
};
|
516
|
+
this.getTypographyElements = () => {
|
517
|
+
// Filter out column headers and cell descriptions
|
518
|
+
return Array.from(this.el.shadowRoot.querySelectorAll("ic-typography:not(.column-header-text,.cell-description-text)"));
|
519
|
+
};
|
520
|
+
this.getTooltip = (typographyEl) => {
|
521
|
+
return typographyEl.closest(this.TOOLTIP);
|
522
|
+
};
|
523
|
+
this.updateTruncationTooltip = (removeTooltipOnly = false) => {
|
524
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
525
|
+
const tooltip = this.getTooltip(typographyEl);
|
526
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
527
|
+
if (typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
528
|
+
this.removeTooltip(cellContainer, typographyEl, tooltip);
|
529
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: 0`);
|
530
|
+
return;
|
531
|
+
}
|
532
|
+
this.regenerateTooltip(cellContainer, typographyEl, tooltip, removeTooltipOnly);
|
533
|
+
});
|
175
534
|
};
|
176
535
|
this.updateScrollOffset = () => {
|
177
536
|
this.scrollOffset = this.el.shadowRoot.querySelector(".table-row-container").scrollTop;
|
178
537
|
};
|
538
|
+
this.updateRowHeightForDescriptions = (rowHeight, cellContainer) => {
|
539
|
+
cellContainer.setAttribute("data-row-height", rowHeight.toString());
|
540
|
+
cellContainer.setAttribute("style", `${this.ROW_HEIGHT_CSS_VARIABLE}: ${rowHeight}px`);
|
541
|
+
};
|
542
|
+
// Method to update the row heights on cells with descriptions and tooltip truncation
|
543
|
+
this.updateCellHeightsWithDescriptions = () => {
|
544
|
+
const descriptions = this.el.shadowRoot.querySelectorAll(this.CELL_DESCRIPTION_STRING);
|
545
|
+
descriptions.forEach((description) => {
|
546
|
+
const cellContainer = description.closest(`.${this.CELL_CONTAINER_WITH_DESCRIPTION_STRING}`);
|
547
|
+
const typography = cellContainer.querySelector(this.IC_TYPOGRAPHY_STRING);
|
548
|
+
const descriptionMarginTop = window
|
549
|
+
.getComputedStyle(description)
|
550
|
+
.getPropertyValue("margin-top");
|
551
|
+
const descriptionHeight = description.clientHeight + parseInt(descriptionMarginTop, 10);
|
552
|
+
if (this.globalRowHeight && this.globalRowHeight !== "auto") {
|
553
|
+
if (!typography.textContent &&
|
554
|
+
descriptionHeight + this.DEFAULT_LINE_HEIGHT > this.globalRowHeight) {
|
555
|
+
this.updateRowHeightForDescriptions(descriptionHeight, cellContainer);
|
556
|
+
}
|
557
|
+
else if (this.truncationPattern === this.TOOLTIP_STRING) {
|
558
|
+
if (descriptionHeight + this.DEFAULT_LINE_HEIGHT >
|
559
|
+
this.globalRowHeight) {
|
560
|
+
const cellIcon = cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.querySelector(".icon");
|
561
|
+
if (helpers.deviceSizeMatches(helpers.IC_DEVICE_SIZES.XS) && cellIcon) {
|
562
|
+
// recalculate descriptionHeight as when a word break occurs this value changes
|
563
|
+
// Additional spacing given for 300-400% zoom
|
564
|
+
this.updateRowHeightForDescriptions(descriptionHeight +
|
565
|
+
this.DEFAULT_LINE_HEIGHT +
|
566
|
+
cellIcon.clientHeight, cellContainer);
|
567
|
+
}
|
568
|
+
else {
|
569
|
+
this.updateRowHeightForDescriptions(descriptionHeight + this.DEFAULT_LINE_HEIGHT, cellContainer);
|
570
|
+
}
|
571
|
+
}
|
572
|
+
this.addLineClampCSS(typography, cellContainer);
|
573
|
+
// Additional case for show/hide truncation for when a description is present, but the text
|
574
|
+
// isn't overflowing the cell to trigger the show more button to appear.
|
575
|
+
}
|
576
|
+
else if (this.truncationPattern === this.SHOW_HIDE_STRING &&
|
577
|
+
descriptionHeight + this.DEFAULT_LINE_HEIGHT > this.globalRowHeight &&
|
578
|
+
typography.style.getPropertyValue("--truncation-max-lines") !==
|
579
|
+
"initial") {
|
580
|
+
this.updateRowHeightForDescriptions(descriptionHeight + this.DEFAULT_LINE_HEIGHT, cellContainer);
|
581
|
+
if (descriptionHeight) {
|
582
|
+
this.createShowHideTruncation(typography, cellContainer, descriptionHeight);
|
583
|
+
}
|
584
|
+
}
|
585
|
+
}
|
586
|
+
});
|
587
|
+
};
|
588
|
+
this.setTableDimensions = () => {
|
589
|
+
let tableHostDimensions = {};
|
590
|
+
if (this.width) {
|
591
|
+
tableHostDimensions = Object.assign(Object.assign({}, tableHostDimensions), { ["--table-width"]: this.width });
|
592
|
+
}
|
593
|
+
if (this.height) {
|
594
|
+
tableHostDimensions = Object.assign(Object.assign({}, tableHostDimensions), { ["--table-height"]: this.height });
|
595
|
+
}
|
596
|
+
if (this.maxWidth) {
|
597
|
+
tableHostDimensions = Object.assign(Object.assign({}, tableHostDimensions), { ["--table-max-width"]: this.maxWidth });
|
598
|
+
}
|
599
|
+
if (this.minWidth) {
|
600
|
+
tableHostDimensions = Object.assign(Object.assign({}, tableHostDimensions), { ["--table-min-width"]: this.minWidth });
|
601
|
+
}
|
602
|
+
return tableHostDimensions;
|
603
|
+
};
|
604
|
+
this.fixCellTooltip = (element) => {
|
605
|
+
var _a;
|
606
|
+
const tooltipEl = (element.tagName === "IC-TOOLTIP"
|
607
|
+
? element
|
608
|
+
: (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(this.IC_TOOLTIP_STRING));
|
609
|
+
if (tooltipEl) {
|
610
|
+
tooltipEl.setExternalPopperProps({
|
611
|
+
strategy: "fixed",
|
612
|
+
});
|
613
|
+
}
|
614
|
+
};
|
615
|
+
this.fixCellTooltips = () => {
|
616
|
+
const elements = this.el.shadowRoot.querySelectorAll(".data-type-element");
|
617
|
+
elements.forEach((element) => {
|
618
|
+
const slotElements = helpers.getSlotElements(element);
|
619
|
+
slotElements === null || slotElements === void 0 ? void 0 : slotElements.forEach((slottedEl) => {
|
620
|
+
this.fixCellTooltip(slottedEl);
|
621
|
+
});
|
622
|
+
});
|
623
|
+
const actionElements = this.el.shadowRoot.querySelectorAll(".action-element");
|
624
|
+
actionElements === null || actionElements === void 0 ? void 0 : actionElements.forEach((actionElementSpan) => {
|
625
|
+
const actionElement = actionElementSpan.firstChild;
|
626
|
+
if (actionElement) {
|
627
|
+
this.fixCellTooltip(actionElement);
|
628
|
+
}
|
629
|
+
});
|
630
|
+
};
|
631
|
+
this.handleClick = (event, callback) => callback(event);
|
632
|
+
this.renderTableBody = (data, loading, overlay) => {
|
633
|
+
if (!(data === null || data === void 0 ? void 0 : data.length))
|
634
|
+
return;
|
635
|
+
if (overlay && loading) {
|
636
|
+
return index.h("tbody", null, this.createRows());
|
637
|
+
}
|
638
|
+
else if (loading && !overlay) {
|
639
|
+
return null;
|
640
|
+
}
|
641
|
+
else {
|
642
|
+
return index.h("tbody", null, this.createRows());
|
643
|
+
}
|
644
|
+
};
|
645
|
+
this.renderLoadingIndicator = (isLoading, loadingOptions) => {
|
646
|
+
if (!isLoading)
|
647
|
+
return null;
|
648
|
+
return (index.h(index.Fragment, null, index.h("div", { class: "loading-overlay", ref: (el) => (this.loadingOverlay = el) }), index.h("ic-loading-indicator", { appearance: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.appearance, class: {
|
649
|
+
"loading-empty": isLoading,
|
650
|
+
loading: true,
|
651
|
+
"show-background": loadingOptions.showBackground || loadingOptions.overlay,
|
652
|
+
}, 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) })));
|
653
|
+
};
|
654
|
+
this.renderAriaLiveLoading = () => {
|
655
|
+
var _a, _b;
|
656
|
+
if (this.loading) {
|
657
|
+
return ((_a = this.loadingOptions) === null || _a === void 0 ? void 0 : _a.label) || "Loading...";
|
658
|
+
}
|
659
|
+
else if (this.updating) {
|
660
|
+
return ((_b = this.updatingOptions) === null || _b === void 0 ? void 0 : _b.description) || "Updating table data";
|
661
|
+
}
|
662
|
+
else {
|
663
|
+
return "";
|
664
|
+
}
|
665
|
+
};
|
666
|
+
this.renderEmptyState = (data, loading, overlay) => {
|
667
|
+
const emptyStateEl = helpers.isSlotUsed(this.el, "empty-state") ? (index.h("slot", { name: "empty-state" })) : (index.h("ic-empty-state", { aligned: "center", heading: "No Data", class: "loading-empty" }));
|
668
|
+
if (loading && !(data === null || data === void 0 ? void 0 : data.length) && overlay) {
|
669
|
+
return emptyStateEl;
|
670
|
+
}
|
671
|
+
else if (!loading && !(data === null || data === void 0 ? void 0 : data.length)) {
|
672
|
+
return emptyStateEl;
|
673
|
+
}
|
674
|
+
else {
|
675
|
+
return null;
|
676
|
+
}
|
677
|
+
};
|
179
678
|
this.fromRow = 0;
|
180
679
|
this.previousRowsPerPage = undefined;
|
181
680
|
this.rowsPerPage = undefined;
|
@@ -185,23 +684,42 @@ const DataTable = class {
|
|
185
684
|
this.sortedColumn = undefined;
|
186
685
|
this.sortedColumnOrder = undefined;
|
187
686
|
this.toRow = undefined;
|
687
|
+
this.currentRowHeight = undefined;
|
688
|
+
this.debounceDelay = 0;
|
188
689
|
this.caption = undefined;
|
690
|
+
this.columnHeaderTruncation = false;
|
189
691
|
this.columns = undefined;
|
190
692
|
this.data = undefined;
|
693
|
+
this.disableAutoSort = false;
|
191
694
|
this.density = "default";
|
192
695
|
this.embedded = false;
|
696
|
+
this.globalRowHeight = "auto";
|
697
|
+
this.height = undefined;
|
698
|
+
this.highlightSelectedRow = true;
|
193
699
|
this.hideColumnHeaders = false;
|
194
|
-
this.
|
195
|
-
|
700
|
+
this.loading = false;
|
701
|
+
this.loadingOptions = undefined;
|
702
|
+
this.maxWidth = undefined;
|
703
|
+
this.minWidth = undefined;
|
704
|
+
this.minimumLoadingDisplayDuration = 1000;
|
705
|
+
this.paginationBarOptions = {
|
706
|
+
alignment: "right",
|
707
|
+
appearance: "default",
|
708
|
+
hideAllFromItemsPerPage: false,
|
709
|
+
hideRangeLabel: false,
|
710
|
+
itemLabel: "Item",
|
711
|
+
itemsPerPageOptions: [
|
196
712
|
{ label: "10", value: "10" },
|
197
713
|
{ label: "25", value: "25" },
|
198
714
|
{ label: "50", value: "50" },
|
199
715
|
],
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
716
|
+
pageLabel: "Page",
|
717
|
+
rangeLabelType: "page",
|
718
|
+
selectedItemsPerPage: 10,
|
719
|
+
setToFirstPageOnPaginationChange: false,
|
720
|
+
showGoToPageControl: true,
|
721
|
+
showItemsPerPageControl: true,
|
722
|
+
type: "simple",
|
205
723
|
};
|
206
724
|
this.showPagination = false;
|
207
725
|
this.sortable = false;
|
@@ -211,58 +729,535 @@ const DataTable = class {
|
|
211
729
|
};
|
212
730
|
this.stickyColumnHeaders = false;
|
213
731
|
this.stickyRowHeaders = false;
|
732
|
+
this.tableLayout = "fixed";
|
733
|
+
this.truncationPattern = undefined;
|
734
|
+
this.updating = false;
|
735
|
+
this.updatingOptions = undefined;
|
736
|
+
this.variableRowHeight = undefined;
|
737
|
+
this.width = undefined;
|
738
|
+
}
|
739
|
+
headerTruncationChangeHandler() {
|
740
|
+
if (this.columnHeaderTruncation) {
|
741
|
+
this.prevTableContainerWidth = 0;
|
742
|
+
}
|
743
|
+
else {
|
744
|
+
const headers = this.el.shadowRoot.querySelectorAll("th.column-header");
|
745
|
+
headers.forEach((header) => {
|
746
|
+
const tooltip = header.querySelector(this.IC_TOOLTIP_STRING);
|
747
|
+
if (tooltip) {
|
748
|
+
tooltip.classList.remove(this.SHOW_TRUNC_TOOLTIP_STRING);
|
749
|
+
}
|
750
|
+
});
|
751
|
+
}
|
752
|
+
}
|
753
|
+
disconnectedCallback() {
|
754
|
+
var _a, _b;
|
755
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
756
|
+
(_b = this.headerResizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
214
757
|
}
|
215
758
|
componentWillLoad() {
|
216
|
-
|
759
|
+
var _a, _b;
|
760
|
+
this.rowsPerPage = Number(this.paginationBarOptions.itemsPerPageOptions[0].value);
|
217
761
|
this.previousRowsPerPage = this.rowsPerPage;
|
218
762
|
this.toRow = this.rowsPerPage;
|
219
763
|
this.sortedColumn = this.sortOptions.defaultColumn;
|
220
764
|
this.sortedColumnOrder = this.sortOptions.sortOrders[0];
|
765
|
+
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) });
|
766
|
+
this.initialLoad = true;
|
767
|
+
this.previousItemsPerPage = this.rowsPerPage;
|
221
768
|
}
|
222
769
|
componentDidLoad() {
|
223
770
|
const tableElement = this.el.shadowRoot.querySelector("table");
|
224
771
|
const tableContainer = this.el.shadowRoot.querySelector(".table-container");
|
772
|
+
helpers.checkResizeObserver(this.runHeaderResizeObserver);
|
773
|
+
if (this.dataUpdated) {
|
774
|
+
this.dataUpdated = false;
|
775
|
+
}
|
225
776
|
if ((tableElement === null || tableElement === void 0 ? void 0 : tableElement.clientHeight) > (tableContainer === null || tableContainer === void 0 ? void 0 : tableContainer.clientHeight) ||
|
226
777
|
(tableElement === null || tableElement === void 0 ? void 0 : tableElement.clientWidth) > (tableContainer === null || tableContainer === void 0 ? void 0 : tableContainer.clientWidth)) {
|
227
778
|
this.scrollable = true;
|
228
779
|
}
|
780
|
+
if (this.loading) {
|
781
|
+
this.startLoadingTimer();
|
782
|
+
this.showLoadingIndicator();
|
783
|
+
}
|
784
|
+
if (this.truncationPattern) {
|
785
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
786
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
787
|
+
if (!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {
|
788
|
+
this.dataTruncation(typographyEl);
|
789
|
+
}
|
790
|
+
});
|
791
|
+
this.debounceDataTruncation();
|
792
|
+
}
|
793
|
+
if (this.globalRowHeight !== "auto") {
|
794
|
+
this.updateSetRowHeight();
|
795
|
+
}
|
796
|
+
window.addEventListener("resize", this.updateCellHeightsWithDescriptions);
|
229
797
|
}
|
230
|
-
|
231
|
-
|
232
|
-
|
798
|
+
componentDidUpdate() {
|
799
|
+
// truncation updates invoked here once new/updated data has
|
800
|
+
// rendered to take into account updated .cell-container/ic-typography box model updates.
|
801
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING ||
|
802
|
+
this.truncationPattern === this.TOOLTIP_STRING) {
|
803
|
+
this.truncateUpdatedData();
|
804
|
+
}
|
233
805
|
}
|
234
|
-
|
235
|
-
this.
|
236
|
-
this.
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
806
|
+
componentDidRender() {
|
807
|
+
this.fixCellTooltips();
|
808
|
+
this.updateCellHeightsWithDescriptions();
|
809
|
+
this.adjustWidthForActionElement();
|
810
|
+
}
|
811
|
+
truncateUpdatedData() {
|
812
|
+
if (this.dataUpdated) {
|
813
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
814
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
815
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
816
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
817
|
+
if ((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) - this.DEFAULT_LINE_HEIGHT >=
|
818
|
+
(truncWrapper === null || truncWrapper === void 0 ? void 0 : truncWrapper.scrollHeight)) {
|
819
|
+
this.resetShowHideTruncation(typographyEl);
|
820
|
+
return;
|
821
|
+
}
|
822
|
+
setTimeout(() => {
|
823
|
+
// slight delay due to data rendering
|
824
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
|
825
|
+
this.addShowHideTruncation(cellContainer, typographyEl);
|
826
|
+
}
|
827
|
+
}, 150);
|
828
|
+
});
|
829
|
+
}
|
830
|
+
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
831
|
+
this.updateTruncationTooltip();
|
832
|
+
}
|
833
|
+
this.dataUpdated = false;
|
834
|
+
}
|
835
|
+
if (this.tableSorted) {
|
836
|
+
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
837
|
+
this.updateTruncationTooltip();
|
838
|
+
}
|
839
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
840
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
841
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
842
|
+
if (!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {
|
843
|
+
this.createShowHideTruncation(typographyEl, cellContainer);
|
844
|
+
}
|
845
|
+
else {
|
846
|
+
typographyEl.resetTruncation().then(() => {
|
847
|
+
cellContainer.removeAttribute("style");
|
848
|
+
});
|
849
|
+
}
|
850
|
+
});
|
851
|
+
}
|
852
|
+
this.tableSorted = false;
|
853
|
+
}
|
854
|
+
// This function recalculates the tooltip truncation when the rowHeight has been set.
|
855
|
+
// This is in componentDidUpdate so a setTimeout is not used to wait for the render to be complete
|
856
|
+
if (this.rowHeightSet) {
|
857
|
+
const fontSize = parseInt(getComputedStyle(document.documentElement).fontSize);
|
858
|
+
const hasAutoRowHeight = this.globalRowHeight === "auto";
|
859
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
860
|
+
var _a;
|
861
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
862
|
+
const tooltipEl = this.getTooltip(typographyEl);
|
863
|
+
if (hasAutoRowHeight) {
|
864
|
+
cellContainer.style.height = null;
|
865
|
+
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
866
|
+
this.removeTooltip(cellContainer, typographyEl, tooltipEl);
|
867
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: 0`);
|
868
|
+
}
|
869
|
+
else if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
870
|
+
this.resetShowHideTruncation(typographyEl);
|
871
|
+
}
|
872
|
+
return;
|
873
|
+
}
|
874
|
+
const rowHeight = fontSize *
|
875
|
+
parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
876
|
+
// If the set row height is bigger than the cell container even
|
877
|
+
// with textWrap, set the row height
|
878
|
+
if (!cellContainer.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING) &&
|
879
|
+
!((_a = cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.style) === null || _a === void 0 ? void 0 : _a.height) &&
|
880
|
+
rowHeight > cellContainer.clientHeight &&
|
881
|
+
!cellContainer.classList.contains(this.TEXT_WRAP_STRING)) {
|
882
|
+
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
883
|
+
}
|
884
|
+
if (this.truncationPattern) {
|
885
|
+
// If the set row height is bigger than the typography truncation wrapper
|
886
|
+
// scroll height, remove see more / see less button
|
887
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
888
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
889
|
+
const showHideBtn = typographyEl.shadowRoot.querySelector("button");
|
890
|
+
if (showHideBtn &&
|
891
|
+
(truncWrapper === null || truncWrapper === void 0 ? void 0 : truncWrapper.scrollHeight) <= cellContainer.clientHeight) {
|
892
|
+
this.resetShowHideTruncation(typographyEl);
|
893
|
+
return;
|
894
|
+
}
|
895
|
+
}
|
896
|
+
this.truncate(typographyEl, cellContainer, tooltipEl);
|
897
|
+
}
|
898
|
+
else {
|
899
|
+
this.updateSetRowHeight(typographyEl);
|
900
|
+
}
|
901
|
+
});
|
902
|
+
this.rowHeightSet = false;
|
903
|
+
}
|
904
|
+
// Only run truncation on the new rows
|
905
|
+
// when the number of items per page has increased
|
906
|
+
if (this.itemsPerPageChange) {
|
907
|
+
const allRows = this.el.shadowRoot.querySelectorAll(".table-row");
|
908
|
+
if (this.rowsPerPage > this.previousItemsPerPage) {
|
909
|
+
const newRows = Array.from(allRows).slice(this.previousItemsPerPage);
|
910
|
+
newRows.forEach((row) => {
|
911
|
+
row
|
912
|
+
.querySelectorAll(this.IC_TYPOGRAPHY_STRING)
|
913
|
+
.forEach((typographyEl) => {
|
914
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
915
|
+
const tooltipEl = this.getTooltip(typographyEl);
|
916
|
+
this.truncate(typographyEl, cellContainer, tooltipEl);
|
917
|
+
});
|
918
|
+
});
|
919
|
+
}
|
920
|
+
this.previousItemsPerPage = this.rowsPerPage;
|
921
|
+
this.itemsPerPageChange = false;
|
922
|
+
}
|
923
|
+
if (!this.initialLoad && this.icPageChangeEvent) {
|
924
|
+
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
925
|
+
this.updateTruncationTooltip();
|
926
|
+
}
|
927
|
+
// set truncation to see more if opened and next/previous page is pressed
|
928
|
+
if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
929
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
930
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
931
|
+
const showHideBtn = typographyEl.shadowRoot.querySelector("button");
|
932
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > cellContainer.clientHeight &&
|
933
|
+
!showHideBtn) {
|
934
|
+
this.addShowHideTruncation(cellContainer, typographyEl);
|
935
|
+
}
|
936
|
+
});
|
937
|
+
}
|
938
|
+
this.icPageChangeEvent = false;
|
939
|
+
}
|
940
|
+
if (this.densityUpdate) {
|
941
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
942
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
943
|
+
const tooltipEl = this.getTooltip(typographyEl);
|
944
|
+
this.truncate(typographyEl, cellContainer, tooltipEl);
|
945
|
+
});
|
946
|
+
this.densityUpdate = false;
|
947
|
+
}
|
948
|
+
if (this.truncationPatternUpdated) {
|
949
|
+
if (this.truncationPattern === this.TOOLTIP_STRING) {
|
950
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
951
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
952
|
+
const tooltipEl = this.getTooltip(typographyEl);
|
953
|
+
if (typographyEl.scrollHeight > cellContainer.clientHeight) {
|
954
|
+
this.addTooltipTruncation(typographyEl, cellContainer, tooltipEl);
|
955
|
+
}
|
956
|
+
});
|
957
|
+
}
|
958
|
+
else if (this.truncationPattern === this.SHOW_HIDE_STRING) {
|
959
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
960
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
961
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
962
|
+
if ((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) - this.DEFAULT_LINE_HEIGHT >
|
963
|
+
(truncWrapper === null || truncWrapper === void 0 ? void 0 : truncWrapper.scrollHeight)) {
|
964
|
+
this.resetShowHideTruncation(typographyEl);
|
965
|
+
return;
|
966
|
+
}
|
967
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
|
968
|
+
this.addShowHideTruncation(cellContainer, typographyEl);
|
969
|
+
}
|
970
|
+
});
|
971
|
+
}
|
972
|
+
}
|
973
|
+
}
|
974
|
+
createShowHideTruncation(typographyEl, cellContainer, descriptionHeight) {
|
975
|
+
typographyEl.checkMaxLines(typographyEl.scrollHeight);
|
976
|
+
typographyEl.setAttribute("max-lines", `${Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT)}`);
|
977
|
+
if (cellContainer.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING) &&
|
978
|
+
descriptionHeight) {
|
979
|
+
typographyEl.setAttribute("max-lines", `${Math.floor(((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) - descriptionHeight) /
|
980
|
+
this.DEFAULT_LINE_HEIGHT)}`);
|
244
981
|
}
|
245
982
|
else {
|
983
|
+
typographyEl.setAttribute("max-lines", `${Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT)}`);
|
984
|
+
}
|
985
|
+
typographyEl.setShowHideExpanded(false);
|
986
|
+
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, null);
|
987
|
+
}
|
988
|
+
addTooltipTruncation(typographyEl, cellContainer, tooltip) {
|
989
|
+
this.addLineClampCSS(typographyEl, cellContainer);
|
990
|
+
if (!tooltip) {
|
991
|
+
this.createTruncationTooltip(typographyEl, cellContainer);
|
992
|
+
}
|
993
|
+
}
|
994
|
+
addShowHideTruncation(cellContainer, typographyEl) {
|
995
|
+
cellContainer.classList.add(this.SHOW_HIDE_CSS_CLASS);
|
996
|
+
this.createShowHideTruncation(typographyEl, cellContainer);
|
997
|
+
}
|
998
|
+
// Set the height to initial if row height is set and the show / hide truncation
|
999
|
+
// is clicked
|
1000
|
+
handleTypographyTruncationExpandToggle({ detail, }) {
|
1001
|
+
const { expanded, typographyEl } = detail;
|
1002
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
1003
|
+
if (cellContainer.style.getPropertyValue(this.ROW_HEIGHT_CSS_VARIABLE) &&
|
1004
|
+
expanded) {
|
1005
|
+
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, "inherit");
|
1006
|
+
}
|
1007
|
+
}
|
1008
|
+
handlePageChange({ detail, target }) {
|
1009
|
+
if (target.parentElement !== this.el) {
|
1010
|
+
this.fromRow = (detail.value - 1) * this.rowsPerPage;
|
1011
|
+
this.toRow = this.fromRow + this.rowsPerPage;
|
1012
|
+
const tableRowsContainer = this.el.shadowRoot.querySelector(".table-row-container");
|
1013
|
+
if (this.previousRowsPerPage === this.rowsPerPage) {
|
1014
|
+
tableRowsContainer.scrollTop = 0;
|
1015
|
+
}
|
1016
|
+
else if (this.previousRowsPerPage < this.rowsPerPage) {
|
1017
|
+
tableRowsContainer.scrollTop = this.scrollOffset;
|
1018
|
+
this.previousRowsPerPage = this.rowsPerPage;
|
1019
|
+
}
|
1020
|
+
else {
|
1021
|
+
this.previousRowsPerPage = this.rowsPerPage;
|
1022
|
+
}
|
1023
|
+
}
|
1024
|
+
if (!this.initialLoad && this.previousPaginationPage !== detail.value) {
|
1025
|
+
// This is to prevent icPageChange from triggering truncation on first load
|
1026
|
+
this.icPageChangeEvent = true;
|
1027
|
+
}
|
1028
|
+
this.previousPaginationPage = detail.value;
|
1029
|
+
this.initialLoad = false;
|
1030
|
+
}
|
1031
|
+
handleItemsPerPageChange({ detail, target, }) {
|
1032
|
+
if (target.parentElement !== this.el) {
|
246
1033
|
this.previousRowsPerPage = this.rowsPerPage;
|
1034
|
+
this.rowsPerPage = detail.value;
|
247
1035
|
}
|
1036
|
+
this.itemsPerPageChange = true;
|
1037
|
+
}
|
1038
|
+
handleDensityChange(ev) {
|
1039
|
+
this.density = ev.detail.value;
|
248
1040
|
}
|
249
1041
|
clickListener(ev) {
|
250
1042
|
if (ev.target !== this.el)
|
251
1043
|
this.selectedRow = undefined;
|
252
1044
|
}
|
1045
|
+
loadingHandler(newValue) {
|
1046
|
+
if (newValue)
|
1047
|
+
this.startLoadingTimer();
|
1048
|
+
if (this.loading) {
|
1049
|
+
setTimeout(() => {
|
1050
|
+
this.showLoadingIndicator();
|
1051
|
+
}, 500);
|
1052
|
+
}
|
1053
|
+
}
|
1054
|
+
truncationPatternHandler(newValue) {
|
1055
|
+
if (newValue === this.TOOLTIP_STRING) {
|
1056
|
+
this.resetShowHideTruncation();
|
1057
|
+
this.updateTruncationTooltip(true);
|
1058
|
+
// Not using debounceDataTruncation here due to resizeObserver not being triggered
|
1059
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
1060
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
1061
|
+
const tooltip = this.getTooltip(typographyEl);
|
1062
|
+
this.truncate(typographyEl, cellContainer, tooltip);
|
1063
|
+
});
|
1064
|
+
}
|
1065
|
+
if (newValue === this.SHOW_HIDE_STRING) {
|
1066
|
+
// ResizeObserver is trigger here due to the see more/see less links being removed.
|
1067
|
+
// The resizeObserver will also apply the tooltip where relevant
|
1068
|
+
this.updateTruncationTooltip(true);
|
1069
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
1070
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
1071
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
1072
|
+
if ((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) - this.DEFAULT_LINE_HEIGHT >
|
1073
|
+
(truncWrapper === null || truncWrapper === void 0 ? void 0 : truncWrapper.scrollHeight)) {
|
1074
|
+
this.resetShowHideTruncation(typographyEl);
|
1075
|
+
return;
|
1076
|
+
}
|
1077
|
+
setTimeout(() => {
|
1078
|
+
// slight delay due to data rendering
|
1079
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
|
1080
|
+
this.addShowHideTruncation(cellContainer, typographyEl);
|
1081
|
+
}
|
1082
|
+
}, 150);
|
1083
|
+
});
|
1084
|
+
}
|
1085
|
+
this.truncationPatternUpdated = true;
|
1086
|
+
}
|
1087
|
+
async dataHandler(newData) {
|
1088
|
+
var _a;
|
1089
|
+
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) });
|
1090
|
+
if (this.loading) {
|
1091
|
+
!this.hasLoadedForOneSecond
|
1092
|
+
? setTimeout(() => (this.loading = false), this.minimumLoadingDisplayDuration -
|
1093
|
+
(Date.now() - this.timerStarted))
|
1094
|
+
: (this.loading = false);
|
1095
|
+
}
|
1096
|
+
if (this.updating)
|
1097
|
+
this.updating = false;
|
1098
|
+
this.dataUpdated = true;
|
1099
|
+
}
|
1100
|
+
async densityHandler() {
|
1101
|
+
this.densityUpdate = true;
|
1102
|
+
}
|
1103
|
+
resetShowHideTruncation(typographyEl) {
|
1104
|
+
if (typographyEl) {
|
1105
|
+
const truncWrapper = this.getTruncWrapper(typographyEl);
|
1106
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
1107
|
+
if ((truncWrapper === null || truncWrapper === void 0 ? void 0 : truncWrapper.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) &&
|
1108
|
+
!helpers.isEmptyString(typographyEl.getAttribute("max-lines")) &&
|
1109
|
+
Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT) !==
|
1110
|
+
+typographyEl.getAttribute("max-lines")) {
|
1111
|
+
typographyEl.checkMaxLines(truncWrapper.scrollHeight);
|
1112
|
+
typographyEl.setAttribute("max-lines", `${Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT)}`);
|
1113
|
+
typographyEl.setShowHideExpanded(false);
|
1114
|
+
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, null);
|
1115
|
+
}
|
1116
|
+
else if (!cellContainer.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING)) {
|
1117
|
+
typographyEl.resetTruncation().then(() => {
|
1118
|
+
if (!typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
1119
|
+
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
1120
|
+
}
|
1121
|
+
});
|
1122
|
+
}
|
1123
|
+
}
|
1124
|
+
else {
|
1125
|
+
this.getTypographyElements().forEach((typographyEl) => {
|
1126
|
+
const cellContainer = this.getCellContainer(typographyEl);
|
1127
|
+
typographyEl.resetTruncation().then(() => {
|
1128
|
+
if (!typographyEl.closest(this.TEXT_WRAP_CLASS)) {
|
1129
|
+
cellContainer.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE, cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
|
1130
|
+
}
|
1131
|
+
});
|
1132
|
+
});
|
1133
|
+
}
|
1134
|
+
}
|
1135
|
+
rowHeightChangeHandler(newValue, oldValue) {
|
1136
|
+
if (+newValue !== +oldValue) {
|
1137
|
+
this.deleteTextWrapDataKey(this.data);
|
1138
|
+
this.deleteTextWrapDataKey(this.columns);
|
1139
|
+
this.removeTextWrap();
|
1140
|
+
this.icRowHeightChange.emit();
|
1141
|
+
this.rowHeightSet = true;
|
1142
|
+
}
|
1143
|
+
}
|
1144
|
+
/**
|
1145
|
+
* Resets the `globalRowHeight` prop to number or auto and sets the `variableRowHeight` prop to `null`.
|
1146
|
+
*/
|
1147
|
+
async resetRowHeights(rowHeight) {
|
1148
|
+
this.globalRowHeight = rowHeight || "auto";
|
1149
|
+
this.variableRowHeight = null;
|
1150
|
+
}
|
1151
|
+
showLoadingIndicator() {
|
1152
|
+
var _a, _b, _c;
|
1153
|
+
if ((_a = this.loadingOptions) === null || _a === void 0 ? void 0 : _a.overlay) {
|
1154
|
+
(_b = this.loadingOverlay) === null || _b === void 0 ? void 0 : _b.classList.add("show");
|
1155
|
+
}
|
1156
|
+
(_c = this.loadingIndicator) === null || _c === void 0 ? void 0 : _c.classList.add("show");
|
1157
|
+
}
|
1158
|
+
getRowOptions(rowKeys, rowValues) {
|
1159
|
+
const rowOptionsIndex = rowKeys.indexOf("rowOptions");
|
1160
|
+
return rowOptionsIndex > -1 && rowValues[rowOptionsIndex];
|
1161
|
+
}
|
1162
|
+
regenerateTooltip(cellContainer, typographyEl, tooltip, removeTooltipOnly) {
|
1163
|
+
// When sorting the table, instead of regenerating the tooltip,
|
1164
|
+
// the tooltip details are updated
|
1165
|
+
if (tooltip) {
|
1166
|
+
if (this.tableSorted) {
|
1167
|
+
tooltip.setAttribute("target", typographyEl.id);
|
1168
|
+
tooltip.setAttribute("label", typographyEl.textContent);
|
1169
|
+
}
|
1170
|
+
else {
|
1171
|
+
this.removeTooltip(cellContainer, typographyEl, tooltip);
|
1172
|
+
}
|
1173
|
+
if (removeTooltipOnly) {
|
1174
|
+
return;
|
1175
|
+
}
|
1176
|
+
}
|
1177
|
+
// This add line clamp to data only when
|
1178
|
+
// the data object has been updated
|
1179
|
+
if (!typographyEl.getAttribute("style") && this.dataUpdated) {
|
1180
|
+
this.addLineClampCSS(typographyEl, cellContainer);
|
1181
|
+
}
|
1182
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) &&
|
1183
|
+
this.truncationPattern === this.TOOLTIP_STRING) {
|
1184
|
+
if (!typographyEl.getAttribute("style") ||
|
1185
|
+
typographyEl.style.cssText.includes(`${this.LINE_CLAMP_CSS_VARIABLE}: 0;`)) {
|
1186
|
+
this.addLineClampCSS(typographyEl, cellContainer);
|
1187
|
+
}
|
1188
|
+
if (!cellContainer.querySelector(this.IC_TOOLTIP_STRING))
|
1189
|
+
this.createTruncationTooltip(typographyEl, cellContainer);
|
1190
|
+
}
|
1191
|
+
}
|
1192
|
+
removeTooltip(cellContainer, typographyEl, tooltip) {
|
1193
|
+
const cellTextWrapper = cellContainer.querySelector(this.CELL_TEXT_WRAPPER_STRING);
|
1194
|
+
cellTextWrapper.prepend(typographyEl);
|
1195
|
+
if (tooltip) {
|
1196
|
+
tooltip.remove();
|
1197
|
+
}
|
1198
|
+
}
|
1199
|
+
addLineClampCSS(typographyEl, cellContainer) {
|
1200
|
+
var _a, _b;
|
1201
|
+
const descriptionCellHeight = (_a = cellContainer.querySelector(this.CELL_DESCRIPTION_STRING)) === null || _a === void 0 ? void 0 : _a.clientHeight;
|
1202
|
+
if (cellContainer.classList.contains(this.CELL_CONTAINER_WITH_DESCRIPTION_STRING) &&
|
1203
|
+
(cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) > descriptionCellHeight) {
|
1204
|
+
let iconHeight;
|
1205
|
+
if (helpers.deviceSizeMatches(helpers.IC_DEVICE_SIZES.XS)) {
|
1206
|
+
const cellIcon = cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.querySelector(".icon");
|
1207
|
+
iconHeight = cellIcon ? cellIcon.clientHeight : 0;
|
1208
|
+
}
|
1209
|
+
else {
|
1210
|
+
iconHeight = 0;
|
1211
|
+
}
|
1212
|
+
const height = (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) -
|
1213
|
+
((_b = cellContainer.querySelector(this.CELL_DESCRIPTION_STRING)) === null || _b === void 0 ? void 0 : _b.clientHeight) -
|
1214
|
+
iconHeight;
|
1215
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: ${this.getLines(height || 0)}`);
|
1216
|
+
}
|
1217
|
+
else {
|
1218
|
+
typographyEl.setAttribute("style", `${this.LINE_CLAMP_CSS_VARIABLE}: ${this.getLines(cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)}`);
|
1219
|
+
}
|
1220
|
+
}
|
1221
|
+
createTruncationTooltip(typographyEl, cellContainer) {
|
1222
|
+
const tooltipEl = document.createElement(this.IC_TOOLTIP_STRING);
|
1223
|
+
tooltipEl.setAttribute("target", typographyEl.id);
|
1224
|
+
tooltipEl.setAttribute("label", typographyEl.textContent);
|
1225
|
+
tooltipEl.classList.add("ic-tooltip-overflow");
|
1226
|
+
tooltipEl.setExternalPopperProps({
|
1227
|
+
// This might need reverting back to absolute if the tooltip doesn't dynamically position itself correctly
|
1228
|
+
strategy: "fixed",
|
1229
|
+
});
|
1230
|
+
const cellTextWrapper = cellContainer.querySelector(this.CELL_TEXT_WRAPPER_STRING);
|
1231
|
+
cellTextWrapper.prepend(tooltipEl);
|
1232
|
+
tooltipEl.prepend(typographyEl);
|
1233
|
+
}
|
253
1234
|
render() {
|
254
|
-
|
255
|
-
|
1235
|
+
var _a, _b;
|
1236
|
+
const { caption, createColumnHeaders, createUpdatingIndicator, data, hideColumnHeaders, loading, loadingOptions, paginationBarOptions, scrollable, scrollOffset, showPagination, sortable, sortedColumn, sortedColumnOrder, stickyColumnHeaders, updateScrollOffset, updating, } = this;
|
1237
|
+
return (index.h(index.Host, { style: Object.assign({}, this.setTableDimensions()) }, index.h("div", { class: "table-container" }, helpers.isSlotUsed(this.el, "title-bar") && index.h("slot", { name: "title-bar" }), index.h("div", { class: {
|
256
1238
|
["table-row-container"]: true,
|
257
1239
|
scrollable,
|
258
|
-
}, tabIndex: scrollable ? 0 : null, onScroll: updateScrollOffset },
|
1240
|
+
}, tabIndex: scrollable ? 0 : null, onScroll: updateScrollOffset }, helpers.isSlotUsed(this.el, "title-bar") && index.h("slot", { name: "title-bar" }), index.h("table", { style: {
|
1241
|
+
["--table-layout"]: this.tableLayout,
|
1242
|
+
} }, index.h("caption", { class: "table-caption" }, caption), !hideColumnHeaders && (index.h("thead", { class: {
|
259
1243
|
["column-header-sticky"]: stickyColumnHeaders,
|
260
1244
|
["column-header-overlay"]: stickyColumnHeaders && scrollOffset !== 0,
|
261
|
-
} }, index.h("tr", null, createColumnHeaders()))),
|
262
|
-
|
263
|
-
: "
|
1245
|
+
} }, index.h("tr", null, createColumnHeaders()))), updating &&
|
1246
|
+
!loading &&
|
1247
|
+
(hideColumnHeaders ? (index.h("thead", null, createUpdatingIndicator())) : (createUpdatingIndicator())), this.renderTableBody(data, loading, loadingOptions.overlay)), this.renderEmptyState(data, loading, loadingOptions.overlay)), index.h("div", { "aria-live": "assertive", class: "sr-only" }, this.renderAriaLiveLoading()), this.renderLoadingIndicator(loading, loadingOptions), (showPagination || helpers.isSlotUsed(this.el, "pagination-bar")) && (index.h("div", { class: "pagination-container" }, helpers.isSlotUsed(this.el, "pagination-bar") ? (index.h("slot", { name: "pagination-bar" })) : (index.h("ic-pagination-bar", { alignment: paginationBarOptions.alignment, appearance: paginationBarOptions.appearance, hideAllFromItemsPerPage: paginationBarOptions.hideAllFromItemsPerPage, hideRangeLabel: paginationBarOptions.hideRangeLabel, itemLabel: paginationBarOptions.itemLabel, itemsPerPageOptions: paginationBarOptions.itemsPerPageOptions, pageLabel: paginationBarOptions.pageLabel, rangeLabelType: paginationBarOptions.rangeLabelType, selectedItemsPerPage: paginationBarOptions.selectedItemsPerPage, setToFirstPageOnPaginationChange: paginationBarOptions.setToFirstPageOnPaginationChange, showGoToPageControl: paginationBarOptions.showGoToPageControl, showItemsPerPageControl: paginationBarOptions.showItemsPerPageControl, totalItems: (_a = data === null || data === void 0 ? void 0 : data.length) !== null && _a !== void 0 ? _a : 0, type: paginationBarOptions.type })))), sortable && (index.h("div", { class: "screen-reader-sort-text", "aria-live": "polite" }, sortedColumnOrder !== "unsorted" && sortedColumn
|
1248
|
+
? `${((_b = this.columns.find((col) => col.key === sortedColumn)) === null || _b === void 0 ? void 0 : _b.title) || sortedColumn} sorted ${sortedColumnOrder}`
|
1249
|
+
: "table unsorted")))));
|
264
1250
|
}
|
265
1251
|
get el() { return index.getElement(this); }
|
1252
|
+
static get watchers() { return {
|
1253
|
+
"columnHeaderTruncation": ["headerTruncationChangeHandler"],
|
1254
|
+
"loading": ["loadingHandler"],
|
1255
|
+
"truncationPattern": ["truncationPatternHandler"],
|
1256
|
+
"data": ["dataHandler"],
|
1257
|
+
"density": ["densityHandler"],
|
1258
|
+
"globalRowHeight": ["rowHeightChangeHandler"],
|
1259
|
+
"variableRowHeight": ["rowHeightChangeHandler"]
|
1260
|
+
}; }
|
266
1261
|
};
|
267
1262
|
DataTable.style = icDataTableCss;
|
268
1263
|
|