@ukic/canary-web-components 2.0.0-canary.20 → 2.0.0-canary.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (449) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/{helpers-73d277d1.js → helpers-093368be.js} +6 -2
  3. package/dist/cjs/helpers-093368be.js.map +1 -0
  4. package/dist/cjs/{helpers-fc9441f8.js → helpers-85c5ca15.js} +94 -1
  5. package/dist/cjs/helpers-85c5ca15.js.map +1 -0
  6. package/dist/cjs/ic-accordion-group.cjs.entry.js +1 -1
  7. package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
  8. package/dist/cjs/ic-alert.cjs.entry.js +17 -1
  9. package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
  10. package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
  11. package/dist/cjs/ic-badge.cjs.entry.js +1 -1
  12. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
  13. package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
  14. package/dist/cjs/ic-button_3.cjs.entry.js +11 -6
  15. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  16. package/dist/cjs/ic-card-horizontal.cjs.entry.js +131 -0
  17. package/dist/cjs/ic-card-horizontal.cjs.entry.js.map +1 -0
  18. package/dist/cjs/ic-card.cjs.entry.js +25 -1
  19. package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
  20. package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
  21. package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
  22. package/dist/cjs/ic-chip.cjs.entry.js +9 -3
  23. package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
  24. package/dist/cjs/ic-classification-banner.cjs.entry.js +12 -3
  25. package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
  26. package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
  27. package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +1 -1
  28. package/dist/cjs/ic-data-table.cjs.entry.js +526 -71
  29. package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
  30. package/dist/cjs/ic-date-input.cjs.entry.js +4 -3
  31. package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -1
  32. package/dist/cjs/ic-date-picker.cjs.entry.js +15 -4
  33. package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -1
  34. package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
  35. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  36. package/dist/cjs/ic-empty-state_2.cjs.entry.js +21 -2
  37. package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +1 -1
  38. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  39. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  40. package/dist/cjs/ic-footer.cjs.entry.js +1 -1
  41. package/dist/cjs/ic-hero.cjs.entry.js +17 -1
  42. package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
  43. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  44. package/dist/cjs/ic-input-component-container_4.cjs.entry.js +1 -1
  45. package/dist/cjs/ic-link.cjs.entry.js +1 -1
  46. package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
  47. package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
  48. package/dist/cjs/ic-menu-with-multi.cjs.entry.js +1 -1
  49. package/dist/cjs/ic-menu.cjs.entry.js +1 -1
  50. package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
  51. package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
  52. package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
  53. package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
  54. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  55. package/dist/cjs/ic-pagination_4.cjs.entry.js +1 -1
  56. package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
  57. package/dist/cjs/ic-radio-group.cjs.entry.js +41 -22
  58. package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
  59. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  60. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  61. package/dist/cjs/ic-select-with-multi.cjs.entry.js +2 -30
  62. package/dist/cjs/ic-select-with-multi.cjs.entry.js.map +1 -1
  63. package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -1
  64. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  65. package/dist/cjs/ic-step.cjs.entry.js +1 -1
  66. package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
  67. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  68. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  69. package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
  70. package/dist/cjs/ic-tab.cjs.entry.js +1 -1
  71. package/dist/cjs/ic-theme.cjs.entry.js +1 -1
  72. package/dist/cjs/ic-toast.cjs.entry.js +1 -1
  73. package/dist/cjs/ic-toggle-button.cjs.entry.js +1 -1
  74. package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
  75. package/dist/cjs/ic-tree-item.cjs.entry.js +241 -0
  76. package/dist/cjs/ic-tree-item.cjs.entry.js.map +1 -0
  77. package/dist/cjs/ic-tree-view.cjs.entry.js +203 -0
  78. package/dist/cjs/ic-tree-view.cjs.entry.js.map +1 -0
  79. package/dist/cjs/ic-typography.cjs.entry.js +47 -12
  80. package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
  81. package/dist/cjs/index-4cf27b16.js +12 -0
  82. package/dist/cjs/loader.cjs.js +1 -1
  83. package/dist/collection/assets/arrow-dropdown.svg +3 -0
  84. package/dist/collection/collection-manifest.json +4 -1
  85. package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.css +655 -0
  86. package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js +373 -0
  87. package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js.map +1 -0
  88. package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.types.js +2 -0
  89. package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.types.js.map +1 -0
  90. package/dist/collection/components/ic-card-horizontal/test/basic/ic-card-horizontal.spec.js +130 -0
  91. package/dist/collection/components/ic-card-horizontal/test/basic/ic-card-horizontal.spec.js.map +1 -0
  92. package/dist/collection/components/ic-data-table/ic-data-table.css +55 -5
  93. package/dist/collection/components/ic-data-table/ic-data-table.js +570 -77
  94. package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
  95. package/dist/collection/components/ic-data-table/ic-data-table.types.js.map +1 -1
  96. package/dist/collection/components/ic-data-table/story-data.js +364 -21
  97. package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
  98. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js +1 -1
  99. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
  100. package/dist/collection/components/ic-date-input/ic-date-input.js +21 -2
  101. package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -1
  102. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js +7 -0
  103. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js.map +1 -1
  104. package/dist/collection/components/ic-date-picker/ic-date-picker.js +34 -3
  105. package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -1
  106. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js +29 -0
  107. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js.map +1 -1
  108. package/dist/collection/components/ic-tree-item/ic-tree-item.css +150 -0
  109. package/dist/collection/components/ic-tree-item/ic-tree-item.js +592 -0
  110. package/dist/collection/components/ic-tree-item/ic-tree-item.js.map +1 -0
  111. package/dist/collection/components/ic-tree-item/test/basic/ic-tree-item.spec.js +114 -0
  112. package/dist/collection/components/ic-tree-item/test/basic/ic-tree-item.spec.js.map +1 -0
  113. package/dist/collection/components/ic-tree-view/ic-tree-view.css +56 -0
  114. package/dist/collection/components/ic-tree-view/ic-tree-view.js +296 -0
  115. package/dist/collection/components/ic-tree-view/ic-tree-view.js.map +1 -0
  116. package/dist/collection/components/ic-tree-view/test/basic/ic-tree-view.spec.js +85 -0
  117. package/dist/collection/components/ic-tree-view/test/basic/ic-tree-view.spec.js.map +1 -0
  118. package/dist/collection/utils/helpers.js +4 -0
  119. package/dist/collection/utils/helpers.js.map +1 -1
  120. package/dist/components/helpers.js +5 -2
  121. package/dist/components/helpers.js.map +1 -1
  122. package/dist/components/helpers2.js +88 -1
  123. package/dist/components/helpers2.js.map +1 -1
  124. package/dist/components/ic-alert2.js +18 -2
  125. package/dist/components/ic-alert2.js.map +1 -1
  126. package/dist/components/ic-back-to-top.js +1 -1
  127. package/dist/components/ic-badge.js +1 -1
  128. package/dist/components/ic-breadcrumb-group.js +1 -1
  129. package/dist/components/ic-breadcrumb2.js +1 -1
  130. package/dist/components/ic-button2.js +1 -1
  131. package/dist/components/ic-card-horizontal.d.ts +11 -0
  132. package/dist/components/ic-card-horizontal.js +167 -0
  133. package/dist/components/ic-card-horizontal.js.map +1 -0
  134. package/dist/components/ic-card.js +26 -2
  135. package/dist/components/ic-card.js.map +1 -1
  136. package/dist/components/ic-checkbox-group.js +1 -1
  137. package/dist/components/ic-checkbox.js +1 -1
  138. package/dist/components/ic-chip.js +9 -3
  139. package/dist/components/ic-chip.js.map +1 -1
  140. package/dist/components/ic-classification-banner.js +12 -3
  141. package/dist/components/ic-classification-banner.js.map +1 -1
  142. package/dist/components/ic-data-row.js +1 -1
  143. package/dist/components/ic-data-table.js +531 -72
  144. package/dist/components/ic-data-table.js.map +1 -1
  145. package/dist/components/ic-date-input2.js +5 -3
  146. package/dist/components/ic-date-input2.js.map +1 -1
  147. package/dist/components/ic-date-picker.js +17 -4
  148. package/dist/components/ic-date-picker.js.map +1 -1
  149. package/dist/components/ic-dialog.js +1 -1
  150. package/dist/components/ic-divider2.js +1 -1
  151. package/dist/components/ic-empty-state2.js +21 -2
  152. package/dist/components/ic-empty-state2.js.map +1 -1
  153. package/dist/components/ic-footer-link-group.js +1 -1
  154. package/dist/components/ic-footer-link.js +1 -1
  155. package/dist/components/ic-footer.js +1 -1
  156. package/dist/components/ic-hero.js +18 -2
  157. package/dist/components/ic-hero.js.map +1 -1
  158. package/dist/components/ic-horizontal-scroll2.js +1 -1
  159. package/dist/components/ic-input-component-container2.js +1 -1
  160. package/dist/components/ic-input-label2.js +1 -1
  161. package/dist/components/ic-input-validation2.js +1 -1
  162. package/dist/components/ic-link2.js +1 -1
  163. package/dist/components/ic-loading-indicator2.js +1 -1
  164. package/dist/components/ic-menu-group.js +1 -1
  165. package/dist/components/ic-menu-item2.js +1 -1
  166. package/dist/components/ic-menu3.js +1 -1
  167. package/dist/components/ic-navigation-button.js +1 -1
  168. package/dist/components/ic-navigation-group.js +1 -1
  169. package/dist/components/ic-navigation-item.js +1 -1
  170. package/dist/components/ic-navigation-menu2.js +1 -1
  171. package/dist/components/ic-page-header.js +1 -1
  172. package/dist/components/ic-pagination-bar2.js +1 -1
  173. package/dist/components/ic-pagination-item2.js +1 -1
  174. package/dist/components/ic-popover-menu.js +1 -1
  175. package/dist/components/ic-radio-group.js +41 -22
  176. package/dist/components/ic-radio-group.js.map +1 -1
  177. package/dist/components/ic-radio-option.js +1 -1
  178. package/dist/components/ic-search-bar.js +1 -1
  179. package/dist/components/ic-select-with-multi.js +1 -29
  180. package/dist/components/ic-select-with-multi.js.map +1 -1
  181. package/dist/components/ic-select2.js +1 -1
  182. package/dist/components/ic-side-navigation.js +1 -1
  183. package/dist/components/ic-step.js +1 -1
  184. package/dist/components/ic-stepper.js +1 -1
  185. package/dist/components/ic-switch.js +1 -1
  186. package/dist/components/ic-tab-panel.js +1 -1
  187. package/dist/components/ic-text-field2.js +1 -1
  188. package/dist/components/ic-theme.js +1 -1
  189. package/dist/components/ic-toast.js +1 -1
  190. package/dist/components/ic-tooltip2.js +12 -5
  191. package/dist/components/ic-tooltip2.js.map +1 -1
  192. package/dist/components/ic-top-navigation.js +1 -1
  193. package/dist/components/ic-tree-item.d.ts +11 -0
  194. package/dist/components/ic-tree-item.js +286 -0
  195. package/dist/components/ic-tree-item.js.map +1 -0
  196. package/dist/components/ic-tree-view.d.ts +11 -0
  197. package/dist/components/ic-tree-view.js +237 -0
  198. package/dist/components/ic-tree-view.js.map +1 -0
  199. package/dist/components/ic-typography2.js +53 -15
  200. package/dist/components/ic-typography2.js.map +1 -1
  201. package/dist/core/core.esm.js +1 -1
  202. package/dist/core/core.esm.js.map +1 -1
  203. package/dist/core/{p-0cdd4c93.entry.js → p-0180e00a.entry.js} +2 -2
  204. package/dist/core/{p-0970c8a1.entry.js → p-046f4de6.entry.js} +2 -2
  205. package/dist/core/{p-2536b95b.entry.js → p-06732eaf.entry.js} +2 -2
  206. package/dist/core/p-0ec04c16.entry.js +2 -0
  207. package/dist/core/p-0ec04c16.entry.js.map +1 -0
  208. package/dist/core/{p-4c57eef0.entry.js → p-13993bf3.entry.js} +2 -2
  209. package/dist/core/p-16a48a63.entry.js +2 -0
  210. package/dist/core/p-16a48a63.entry.js.map +1 -0
  211. package/dist/core/{p-12120521.entry.js → p-216fbd5e.entry.js} +2 -2
  212. package/dist/core/{p-14b363d0.entry.js → p-2d063032.entry.js} +2 -2
  213. package/dist/core/{p-e2387530.entry.js → p-2ee5d3fb.entry.js} +2 -2
  214. package/dist/core/p-355c8532.entry.js +2 -0
  215. package/dist/core/p-355c8532.entry.js.map +1 -0
  216. package/dist/core/p-3a59391f.entry.js +2 -0
  217. package/dist/core/{p-2b9b9f6e.entry.js.map → p-3a59391f.entry.js.map} +1 -1
  218. package/dist/core/{p-edf3411a.entry.js → p-3f2723aa.entry.js} +2 -2
  219. package/dist/core/p-401d0c66.entry.js +2 -0
  220. package/dist/core/p-401d0c66.entry.js.map +1 -0
  221. package/dist/core/p-413e68be.entry.js +2 -0
  222. package/dist/core/{p-60ca1000.entry.js.map → p-413e68be.entry.js.map} +1 -1
  223. package/dist/core/{p-a484c41c.entry.js → p-418a84d4.entry.js} +2 -2
  224. package/dist/core/{p-a1369740.entry.js → p-41916ef7.entry.js} +2 -2
  225. package/dist/core/p-4309460f.entry.js +2 -0
  226. package/dist/core/p-4309460f.entry.js.map +1 -0
  227. package/dist/core/{p-7168b71a.entry.js → p-486a6957.entry.js} +2 -2
  228. package/dist/core/{p-87868dd2.entry.js → p-5348af01.entry.js} +2 -2
  229. package/dist/core/p-57043b1e.entry.js +2 -0
  230. package/dist/core/p-57043b1e.entry.js.map +1 -0
  231. package/dist/core/p-59993f36.entry.js +2 -0
  232. package/dist/core/p-59993f36.entry.js.map +1 -0
  233. package/dist/core/{p-c2b5e7b1.entry.js → p-5fea8f1c.entry.js} +2 -2
  234. package/dist/core/{p-c2b5e7b1.entry.js.map → p-5fea8f1c.entry.js.map} +1 -1
  235. package/dist/core/{p-eeae7272.entry.js → p-6398a726.entry.js} +2 -2
  236. package/dist/core/{p-0629691b.entry.js → p-648fb902.entry.js} +2 -2
  237. package/dist/core/{p-7e850bad.entry.js → p-673a4a62.entry.js} +2 -2
  238. package/dist/core/{p-0ecde7a8.entry.js → p-67ae9d37.entry.js} +2 -2
  239. package/dist/core/{p-d3e186a3.entry.js → p-6b01e096.entry.js} +2 -2
  240. package/dist/core/{p-92a858f7.entry.js → p-6b1fcf87.entry.js} +2 -2
  241. package/dist/core/{p-94ce6f29.entry.js → p-6fb3d61e.entry.js} +2 -2
  242. package/dist/core/{p-47c91e08.entry.js → p-789ae7f5.entry.js} +2 -2
  243. package/dist/core/{p-1440cdd1.js → p-8128572e.js} +2 -2
  244. package/dist/core/p-8128572e.js.map +1 -0
  245. package/dist/core/p-84eaa486.entry.js +2 -0
  246. package/dist/core/p-84eaa486.entry.js.map +1 -0
  247. package/dist/core/{p-24f9f6d4.entry.js → p-89c7ea3e.entry.js} +2 -2
  248. package/dist/core/{p-992b6161.entry.js → p-8d276e8f.entry.js} +2 -2
  249. package/dist/core/{p-db5c4969.entry.js → p-91cf89c8.entry.js} +2 -2
  250. package/dist/core/p-91cf89c8.entry.js.map +1 -0
  251. package/dist/core/p-969cadfa.entry.js +2 -0
  252. package/dist/core/p-969cadfa.entry.js.map +1 -0
  253. package/dist/core/p-97f141a6.entry.js +2 -0
  254. package/dist/core/p-97f141a6.entry.js.map +1 -0
  255. package/dist/core/{p-cb7793b0.entry.js → p-99185fd5.entry.js} +2 -2
  256. package/dist/core/{p-4883e147.entry.js → p-99f96c33.entry.js} +2 -2
  257. package/dist/core/p-a052bb95.entry.js +2 -0
  258. package/dist/core/p-a052bb95.entry.js.map +1 -0
  259. package/dist/core/{p-8100f45c.entry.js → p-a72af8db.entry.js} +2 -2
  260. package/dist/core/{p-6eafa62e.entry.js → p-a787bba7.entry.js} +2 -2
  261. package/dist/core/{p-6c5c6aaf.entry.js → p-aa72f551.entry.js} +2 -2
  262. package/dist/core/{p-781e8391.entry.js → p-aaaa9261.entry.js} +2 -2
  263. package/dist/core/p-adbe0d89.js +2 -0
  264. package/dist/core/p-adbe0d89.js.map +1 -0
  265. package/dist/core/{p-646b886c.entry.js → p-b29e96b5.entry.js} +2 -2
  266. package/dist/core/p-b97eba08.entry.js +2 -0
  267. package/dist/core/p-b97eba08.entry.js.map +1 -0
  268. package/dist/core/{p-3245554e.entry.js → p-bfc5f3f4.entry.js} +2 -2
  269. package/dist/core/{p-e1e04f34.entry.js → p-cb3afdbf.entry.js} +2 -2
  270. package/dist/core/{p-6cf5343b.entry.js → p-ccf72538.entry.js} +2 -2
  271. package/dist/core/{p-3eb33ef4.entry.js → p-ce0999f1.entry.js} +2 -2
  272. package/dist/core/{p-0a99994a.entry.js → p-d02a4d1b.entry.js} +2 -2
  273. package/dist/core/{p-b7161816.entry.js → p-d8322108.entry.js} +2 -2
  274. package/dist/core/{p-d67a5c90.entry.js → p-d86cdbc8.entry.js} +2 -2
  275. package/dist/core/{p-a5bb7bb0.entry.js → p-da8255b8.entry.js} +2 -2
  276. package/dist/core/{p-6a7a5ed5.entry.js → p-e9f5ebb3.entry.js} +2 -2
  277. package/dist/core/p-e9f5ebb3.entry.js.map +1 -0
  278. package/dist/core/p-ede631c5.entry.js +2 -0
  279. package/dist/core/p-ede631c5.entry.js.map +1 -0
  280. package/dist/core/{p-66c26240.entry.js → p-f09b2041.entry.js} +2 -2
  281. package/dist/core/{p-b8d3f121.entry.js → p-f1044e4d.entry.js} +2 -2
  282. package/dist/core/{p-af21360a.entry.js → p-f10f7f37.entry.js} +2 -2
  283. package/dist/core/{p-34cc7b3d.entry.js → p-fa77211d.entry.js} +2 -2
  284. package/dist/esm/core.js +1 -1
  285. package/dist/esm/{helpers-4e2e4787.js → helpers-886489d5.js} +6 -3
  286. package/dist/esm/helpers-886489d5.js.map +1 -0
  287. package/dist/esm/{helpers-1cd71f8a.js → helpers-f543bc77.js} +89 -2
  288. package/dist/{cjs/helpers-fc9441f8.js.map → esm/helpers-f543bc77.js.map} +1 -1
  289. package/dist/esm/ic-accordion-group.entry.js +1 -1
  290. package/dist/esm/ic-accordion.entry.js +1 -1
  291. package/dist/esm/ic-alert.entry.js +18 -2
  292. package/dist/esm/ic-alert.entry.js.map +1 -1
  293. package/dist/esm/ic-back-to-top.entry.js +1 -1
  294. package/dist/esm/ic-badge.entry.js +1 -1
  295. package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
  296. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  297. package/dist/esm/ic-button_3.entry.js +11 -6
  298. package/dist/esm/ic-button_3.entry.js.map +1 -1
  299. package/dist/esm/ic-card-horizontal.entry.js +127 -0
  300. package/dist/esm/ic-card-horizontal.entry.js.map +1 -0
  301. package/dist/esm/ic-card.entry.js +26 -2
  302. package/dist/esm/ic-card.entry.js.map +1 -1
  303. package/dist/esm/ic-checkbox-group.entry.js +1 -1
  304. package/dist/esm/ic-checkbox.entry.js +1 -1
  305. package/dist/esm/ic-chip.entry.js +9 -3
  306. package/dist/esm/ic-chip.entry.js.map +1 -1
  307. package/dist/esm/ic-classification-banner.entry.js +12 -3
  308. package/dist/esm/ic-classification-banner.entry.js.map +1 -1
  309. package/dist/esm/ic-data-row.entry.js +1 -1
  310. package/dist/esm/ic-data-table-title-bar.entry.js +1 -1
  311. package/dist/esm/ic-data-table.entry.js +526 -71
  312. package/dist/esm/ic-data-table.entry.js.map +1 -1
  313. package/dist/esm/ic-date-input.entry.js +4 -3
  314. package/dist/esm/ic-date-input.entry.js.map +1 -1
  315. package/dist/esm/ic-date-picker.entry.js +15 -4
  316. package/dist/esm/ic-date-picker.entry.js.map +1 -1
  317. package/dist/esm/ic-dialog.entry.js +1 -1
  318. package/dist/esm/ic-divider.entry.js +1 -1
  319. package/dist/esm/ic-empty-state_2.entry.js +22 -3
  320. package/dist/esm/ic-empty-state_2.entry.js.map +1 -1
  321. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  322. package/dist/esm/ic-footer-link.entry.js +1 -1
  323. package/dist/esm/ic-footer.entry.js +1 -1
  324. package/dist/esm/ic-hero.entry.js +18 -2
  325. package/dist/esm/ic-hero.entry.js.map +1 -1
  326. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  327. package/dist/esm/ic-input-component-container_4.entry.js +1 -1
  328. package/dist/esm/ic-link.entry.js +1 -1
  329. package/dist/esm/ic-menu-group.entry.js +1 -1
  330. package/dist/esm/ic-menu-item.entry.js +1 -1
  331. package/dist/esm/ic-menu-with-multi.entry.js +1 -1
  332. package/dist/esm/ic-menu.entry.js +1 -1
  333. package/dist/esm/ic-navigation-button.entry.js +1 -1
  334. package/dist/esm/ic-navigation-group.entry.js +1 -1
  335. package/dist/esm/ic-navigation-item.entry.js +1 -1
  336. package/dist/esm/ic-navigation-menu.entry.js +1 -1
  337. package/dist/esm/ic-page-header.entry.js +1 -1
  338. package/dist/esm/ic-pagination_4.entry.js +1 -1
  339. package/dist/esm/ic-popover-menu.entry.js +1 -1
  340. package/dist/esm/ic-radio-group.entry.js +41 -22
  341. package/dist/esm/ic-radio-group.entry.js.map +1 -1
  342. package/dist/esm/ic-radio-option.entry.js +1 -1
  343. package/dist/esm/ic-search-bar.entry.js +1 -1
  344. package/dist/esm/ic-select-with-multi.entry.js +1 -29
  345. package/dist/esm/ic-select-with-multi.entry.js.map +1 -1
  346. package/dist/esm/ic-side-navigation.entry.js +1 -1
  347. package/dist/esm/ic-status-tag.entry.js +1 -1
  348. package/dist/esm/ic-step.entry.js +1 -1
  349. package/dist/esm/ic-stepper.entry.js +1 -1
  350. package/dist/esm/ic-switch.entry.js +1 -1
  351. package/dist/esm/ic-tab-group.entry.js +1 -1
  352. package/dist/esm/ic-tab-panel.entry.js +1 -1
  353. package/dist/esm/ic-tab.entry.js +1 -1
  354. package/dist/esm/ic-theme.entry.js +1 -1
  355. package/dist/esm/ic-toast.entry.js +1 -1
  356. package/dist/esm/ic-toggle-button.entry.js +1 -1
  357. package/dist/esm/ic-top-navigation.entry.js +1 -1
  358. package/dist/esm/ic-tree-item.entry.js +237 -0
  359. package/dist/esm/ic-tree-item.entry.js.map +1 -0
  360. package/dist/esm/ic-tree-view.entry.js +199 -0
  361. package/dist/esm/ic-tree-view.entry.js.map +1 -0
  362. package/dist/esm/ic-typography.entry.js +48 -13
  363. package/dist/esm/ic-typography.entry.js.map +1 -1
  364. package/dist/esm/index-93509377.js +12 -0
  365. package/dist/esm/loader.js +1 -1
  366. package/dist/types/components/ic-card-horizontal/ic-card-horizontal.d.ts +71 -0
  367. package/dist/types/components/ic-card-horizontal/ic-card-horizontal.types.d.ts +1 -0
  368. package/dist/types/components/ic-data-table/ic-data-table.d.ts +68 -7
  369. package/dist/types/components/ic-data-table/ic-data-table.types.d.ts +9 -0
  370. package/dist/types/components/ic-data-table/story-data.d.ts +112 -0
  371. package/dist/types/components/ic-date-input/ic-date-input.d.ts +4 -0
  372. package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +5 -0
  373. package/dist/types/components/ic-tree-item/ic-tree-item.d.ts +95 -0
  374. package/dist/types/components/ic-tree-view/ic-tree-view.d.ts +40 -0
  375. package/dist/types/components.d.ts +272 -6
  376. package/dist/types/utils/helpers.d.ts +1 -0
  377. package/hydrate/index.js +2198 -899
  378. package/package.json +3 -3
  379. package/dist/cjs/helpers-73d277d1.js.map +0 -1
  380. package/dist/core/p-06e0b5b6.entry.js +0 -2
  381. package/dist/core/p-06e0b5b6.entry.js.map +0 -1
  382. package/dist/core/p-0b14be10.entry.js +0 -2
  383. package/dist/core/p-0b14be10.entry.js.map +0 -1
  384. package/dist/core/p-1440cdd1.js.map +0 -1
  385. package/dist/core/p-20d4ded5.js +0 -2
  386. package/dist/core/p-20d4ded5.js.map +0 -1
  387. package/dist/core/p-2b9b9f6e.entry.js +0 -2
  388. package/dist/core/p-34e72f79.entry.js +0 -2
  389. package/dist/core/p-34e72f79.entry.js.map +0 -1
  390. package/dist/core/p-352b9c17.entry.js +0 -2
  391. package/dist/core/p-352b9c17.entry.js.map +0 -1
  392. package/dist/core/p-3fa986f8.entry.js +0 -2
  393. package/dist/core/p-3fa986f8.entry.js.map +0 -1
  394. package/dist/core/p-4ec1ce96.entry.js +0 -2
  395. package/dist/core/p-4ec1ce96.entry.js.map +0 -1
  396. package/dist/core/p-60ca1000.entry.js +0 -2
  397. package/dist/core/p-6a7a5ed5.entry.js.map +0 -1
  398. package/dist/core/p-9769c195.entry.js +0 -2
  399. package/dist/core/p-9769c195.entry.js.map +0 -1
  400. package/dist/core/p-cb15d0b6.entry.js +0 -2
  401. package/dist/core/p-cb15d0b6.entry.js.map +0 -1
  402. package/dist/core/p-db5c4969.entry.js.map +0 -1
  403. package/dist/core/p-e32cce28.entry.js +0 -2
  404. package/dist/core/p-e32cce28.entry.js.map +0 -1
  405. package/dist/core/p-ef996e40.entry.js +0 -2
  406. package/dist/core/p-ef996e40.entry.js.map +0 -1
  407. package/dist/esm/helpers-1cd71f8a.js.map +0 -1
  408. package/dist/esm/helpers-4e2e4787.js.map +0 -1
  409. /package/dist/core/{p-0cdd4c93.entry.js.map → p-0180e00a.entry.js.map} +0 -0
  410. /package/dist/core/{p-0970c8a1.entry.js.map → p-046f4de6.entry.js.map} +0 -0
  411. /package/dist/core/{p-2536b95b.entry.js.map → p-06732eaf.entry.js.map} +0 -0
  412. /package/dist/core/{p-4c57eef0.entry.js.map → p-13993bf3.entry.js.map} +0 -0
  413. /package/dist/core/{p-12120521.entry.js.map → p-216fbd5e.entry.js.map} +0 -0
  414. /package/dist/core/{p-14b363d0.entry.js.map → p-2d063032.entry.js.map} +0 -0
  415. /package/dist/core/{p-e2387530.entry.js.map → p-2ee5d3fb.entry.js.map} +0 -0
  416. /package/dist/core/{p-edf3411a.entry.js.map → p-3f2723aa.entry.js.map} +0 -0
  417. /package/dist/core/{p-a484c41c.entry.js.map → p-418a84d4.entry.js.map} +0 -0
  418. /package/dist/core/{p-a1369740.entry.js.map → p-41916ef7.entry.js.map} +0 -0
  419. /package/dist/core/{p-7168b71a.entry.js.map → p-486a6957.entry.js.map} +0 -0
  420. /package/dist/core/{p-87868dd2.entry.js.map → p-5348af01.entry.js.map} +0 -0
  421. /package/dist/core/{p-eeae7272.entry.js.map → p-6398a726.entry.js.map} +0 -0
  422. /package/dist/core/{p-0629691b.entry.js.map → p-648fb902.entry.js.map} +0 -0
  423. /package/dist/core/{p-7e850bad.entry.js.map → p-673a4a62.entry.js.map} +0 -0
  424. /package/dist/core/{p-0ecde7a8.entry.js.map → p-67ae9d37.entry.js.map} +0 -0
  425. /package/dist/core/{p-d3e186a3.entry.js.map → p-6b01e096.entry.js.map} +0 -0
  426. /package/dist/core/{p-92a858f7.entry.js.map → p-6b1fcf87.entry.js.map} +0 -0
  427. /package/dist/core/{p-94ce6f29.entry.js.map → p-6fb3d61e.entry.js.map} +0 -0
  428. /package/dist/core/{p-47c91e08.entry.js.map → p-789ae7f5.entry.js.map} +0 -0
  429. /package/dist/core/{p-24f9f6d4.entry.js.map → p-89c7ea3e.entry.js.map} +0 -0
  430. /package/dist/core/{p-992b6161.entry.js.map → p-8d276e8f.entry.js.map} +0 -0
  431. /package/dist/core/{p-cb7793b0.entry.js.map → p-99185fd5.entry.js.map} +0 -0
  432. /package/dist/core/{p-4883e147.entry.js.map → p-99f96c33.entry.js.map} +0 -0
  433. /package/dist/core/{p-8100f45c.entry.js.map → p-a72af8db.entry.js.map} +0 -0
  434. /package/dist/core/{p-6eafa62e.entry.js.map → p-a787bba7.entry.js.map} +0 -0
  435. /package/dist/core/{p-6c5c6aaf.entry.js.map → p-aa72f551.entry.js.map} +0 -0
  436. /package/dist/core/{p-781e8391.entry.js.map → p-aaaa9261.entry.js.map} +0 -0
  437. /package/dist/core/{p-646b886c.entry.js.map → p-b29e96b5.entry.js.map} +0 -0
  438. /package/dist/core/{p-3245554e.entry.js.map → p-bfc5f3f4.entry.js.map} +0 -0
  439. /package/dist/core/{p-e1e04f34.entry.js.map → p-cb3afdbf.entry.js.map} +0 -0
  440. /package/dist/core/{p-6cf5343b.entry.js.map → p-ccf72538.entry.js.map} +0 -0
  441. /package/dist/core/{p-3eb33ef4.entry.js.map → p-ce0999f1.entry.js.map} +0 -0
  442. /package/dist/core/{p-0a99994a.entry.js.map → p-d02a4d1b.entry.js.map} +0 -0
  443. /package/dist/core/{p-b7161816.entry.js.map → p-d8322108.entry.js.map} +0 -0
  444. /package/dist/core/{p-d67a5c90.entry.js.map → p-d86cdbc8.entry.js.map} +0 -0
  445. /package/dist/core/{p-a5bb7bb0.entry.js.map → p-da8255b8.entry.js.map} +0 -0
  446. /package/dist/core/{p-66c26240.entry.js.map → p-f09b2041.entry.js.map} +0 -0
  447. /package/dist/core/{p-b8d3f121.entry.js.map → p-f1044e4d.entry.js.map} +0 -0
  448. /package/dist/core/{p-af21360a.entry.js.map → p-f10f7f37.entry.js.map} +0 -0
  449. /package/dist/core/{p-34cc7b3d.entry.js.map → p-fa77211d.entry.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-93509377.js';
2
- import { i as isSlotUsed, g as getSlotContent } from './helpers-1cd71f8a.js';
2
+ import { d as debounce, a as isEmptyString, p as pxToRem, i as isSlotUsed, b as getSlotContent } from './helpers-f543bc77.js';
3
3
 
4
4
  const unsortedIcon = `<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24">
5
5
  <path d="M9 3 5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z"></path>
@@ -13,23 +13,161 @@ const descendingIcon = `<svg focusable="false" aria-hidden="true" viewBox="0 0 2
13
13
  <path d="M16.01 11H4v2h12.01v3L20 12l-3.99-4z"></path>
14
14
  </svg>`;
15
15
 
16
- const icDataTableCss = ":host{position:relative;display:block;height:100%;max-height:100%}.table-container{position:relative;height:calc(100% - var(--ic-space-xxxs))}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:fixed;border-spacing:0;width:100%}.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-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{padding:var(--ic-space-xxs) var(--ic-space-xs) !important}.text-dense{font-size:var(--ic-font-size-label)}.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)}.column-header,.row-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: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}.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)}.data-type-string{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}.cell-alignment-middle{vertical-align:middle}.cell-alignment-bottom{vertical-align:bottom}.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)}.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,.row-header-alignment-right>ic-typography,.cell-alignment-center>ic-typography{flex:1}.icon>svg{height:var(--ic-space-lg);width:var(--ic-space-lg);display:inline-block}@media screen and (min-width: 576px){.column-header-inner-container{display:flex;align-items:center}.cell-container{display:flex}}";
16
+ const icDataTableCss = ":host{position:relative;display:block;height:100%;max-height:100%}tbody{vertical-align:top}.table-container{position:relative;height:calc(100% - var(--ic-space-xxxs));display:flex;flex-direction:column}.cell-container{display:flex;min-height:1.5rem;overflow-y:hidden}.truncation-show-hide{overflow:visible;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:fixed;border-spacing:0;width:100%}.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-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{padding:var(--ic-space-xxs) var(--ic-space-xs) !important}.text-dense{font-size:var(--ic-font-size-label)}.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)}.column-header,.row-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: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}.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)}.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,.row-header-alignment-right>ic-typography,.cell-alignment-center>ic-typography{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}@media screen and (min-width: 576px){.column-header-inner-container{display:flex;align-items:center}}";
17
17
 
18
- const DENSITY_HEIGHT_MULTIPLIER = {
19
- dense: 0.8,
20
- default: 1,
21
- spacious: 1.2,
22
- };
23
- const SORT_ICONS = {
24
- unsorted: unsortedIcon,
25
- ascending: ascendingIcon,
26
- descending: descendingIcon,
27
- };
28
18
  const DataTable = class {
29
19
  constructor(hostRef) {
30
20
  registerInstance(this, hostRef);
31
21
  this.icRowHeightChange = createEvent(this, "icRowHeightChange", 7);
22
+ this.DENSITY_HEIGHT_MULTIPLIER = {
23
+ dense: 0.8,
24
+ default: 1,
25
+ spacious: 1.2,
26
+ };
27
+ this.DENSITY_PADDING_HEIGHT_DIFF = {
28
+ dense: 8,
29
+ default: 16,
30
+ spacious: 20,
31
+ };
32
+ this.SORT_ICONS = {
33
+ unsorted: unsortedIcon,
34
+ ascending: ascendingIcon,
35
+ descending: descendingIcon,
36
+ };
32
37
  this.hasLoadedForOneSecond = true;
38
+ this.resizeObserver = null;
39
+ this.SHOW_HIDE_STRING = "show-hide";
40
+ this.SHOW_HIDE_CSS_CLASS = `${this.SHOW_HIDE_STRING}-wrap`;
41
+ this.TOOLTIP_STRING = "tooltip";
42
+ this.TOOLTIP = `ic-${this.TOOLTIP_STRING}`;
43
+ this.TEXT_WRAP_STRING = "text-wrap";
44
+ this.TEXT_WRAP_CLASS = `.${this.TEXT_WRAP_STRING}`;
45
+ this.dataUpdated = false;
46
+ this.rowHeightSet = false;
47
+ this.initialLoad = false;
48
+ this.icPageChangeEvent = false;
49
+ this.itemsPerPageChange = false;
50
+ this.DATA_ROW_HEIGHT_STRING = "data-row-height";
51
+ this.DEFAULT_LINE_HEIGHT = 24;
52
+ this.densityUpdate = false;
53
+ this.updateSetRowHeight = (typographyEl) => {
54
+ const fontSize = parseInt(getComputedStyle(document.documentElement).fontSize);
55
+ if (typographyEl) {
56
+ const cellContainer = this.getCellContainer(typographyEl);
57
+ const rowHeight = fontSize *
58
+ parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
59
+ if (typographyEl.scrollHeight > rowHeight) {
60
+ cellContainer.style.removeProperty("height");
61
+ }
62
+ }
63
+ else {
64
+ this.getTypographyElements().forEach((typographyEl) => {
65
+ const cellContainer = this.getCellContainer(typographyEl);
66
+ const rowHeight = fontSize *
67
+ parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
68
+ if (typographyEl.scrollHeight > rowHeight) {
69
+ cellContainer.style.removeProperty("height");
70
+ }
71
+ });
72
+ }
73
+ };
74
+ this.debounceDataTruncation = () => {
75
+ this.getTypographyElements().forEach((typographyEl) => {
76
+ if (!typographyEl.classList.contains(this.TEXT_WRAP_STRING)) {
77
+ this.resizeObserver = new ResizeObserver(
78
+ // This gets triggered twice due to updated data and see more/see less button
79
+ debounce(() => {
80
+ // console.log("resizeObserver triggered");
81
+ this.dataTruncation(typographyEl);
82
+ }, 200));
83
+ this.resizeObserver.observe(typographyEl);
84
+ }
85
+ });
86
+ };
87
+ this.getLines = (height) => Math.floor(height / this.DEFAULT_LINE_HEIGHT);
88
+ this.truncate = (typographyEl, cellContainer, tooltip) => {
89
+ if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
90
+ //24 is the height of a single line
91
+ if (!typographyEl.closest(this.TEXT_WRAP_CLASS)) {
92
+ if (this.truncationPattern === this.TOOLTIP_STRING) {
93
+ this.addTooltipTruncation(typographyEl, cellContainer, tooltip);
94
+ }
95
+ if (this.truncationPattern === this.SHOW_HIDE_STRING) {
96
+ this.addShowHideTruncation(cellContainer, typographyEl);
97
+ }
98
+ }
99
+ }
100
+ else {
101
+ if (this.truncationPattern === this.TOOLTIP_STRING && tooltip) {
102
+ typographyEl.setAttribute("style", `--ic-line-clamp: 0`);
103
+ cellContainer.appendChild(typographyEl);
104
+ tooltip.remove();
105
+ }
106
+ if (this.truncationPattern === this.SHOW_HIDE_STRING &&
107
+ !isEmptyString(typographyEl.getAttribute("max-lines"))) {
108
+ this.resetShowHideTruncation(typographyEl);
109
+ }
110
+ }
111
+ };
112
+ this.dataTruncation = (typographyEl) => {
113
+ // Tooltip truncation mentioned in AC. Will need revisiting
114
+ const tooltip = this.getTooltip(typographyEl);
115
+ const cellContainer = this.getCellContainer(typographyEl);
116
+ if ((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.classList.contains("data-type-element")) ||
117
+ this.dataUpdated) {
118
+ return;
119
+ }
120
+ if (this.truncationPattern === this.SHOW_HIDE_STRING &&
121
+ typographyEl.shadowRoot.querySelector("button")) {
122
+ const showHideBtn = typographyEl.shadowRoot.querySelector("button");
123
+ // If the see more/see less is present and the max lines is equal to the cell container
124
+ // remove the see more/see less button
125
+ if (showHideBtn) {
126
+ const truncWrapper = this.getTruncWrapper(typographyEl);
127
+ if (this.getLines(truncWrapper.scrollHeight) ===
128
+ +typographyEl.getAttribute("max-lines")) {
129
+ this.resetShowHideTruncation(typographyEl);
130
+ }
131
+ }
132
+ }
133
+ // Deals with setting and resetting row height and re-truncating data
134
+ if (this.rowHeightSet && this.truncationPattern === this.SHOW_HIDE_STRING) {
135
+ const truncWrapper = this.getTruncWrapper(typographyEl);
136
+ // cellContainer.clientHeight - 24 removes the extra line by see more/see less
137
+ if (truncWrapper &&
138
+ cellContainer.clientHeight - this.DEFAULT_LINE_HEIGHT >
139
+ truncWrapper.scrollHeight) {
140
+ this.resetShowHideTruncation(typographyEl);
141
+ return;
142
+ }
143
+ if (typographyEl.scrollHeight > cellContainer.clientHeight) {
144
+ this.addShowHideTruncation(cellContainer, typographyEl);
145
+ return;
146
+ }
147
+ }
148
+ if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > 0 &&
149
+ (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) > 0 &&
150
+ (typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) === (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)) {
151
+ if (tooltip) {
152
+ this.removeTooltip(cellContainer, typographyEl, tooltip);
153
+ }
154
+ return;
155
+ }
156
+ this.truncate(typographyEl, cellContainer, tooltip);
157
+ };
158
+ this.removeTextWrap = () => {
159
+ this.getTypographyElements().forEach((typographyEl) => {
160
+ const tableCell = typographyEl.closest("td");
161
+ if (tableCell.classList.contains(this.TEXT_WRAP_STRING)) {
162
+ tableCell.classList.remove(this.TEXT_WRAP_STRING);
163
+ }
164
+ });
165
+ };
166
+ this.getCellContainer = (typographyEl) => {
167
+ return typographyEl.closest(".cell-container");
168
+ };
169
+ this.deleteTextWrapDataKey = (array) => Array.isArray(array) &&
170
+ array.forEach((val) => val.textWrap && delete val.textWrap);
33
171
  this.startLoadingTimer = () => {
34
172
  this.hasLoadedForOneSecond = false;
35
173
  this.timerStarted = Date.now();
@@ -55,13 +193,31 @@ const DataTable = class {
55
193
  return this.getObjectValue(this.getObjectValue(cell, "cellAlignment"), alignment);
56
194
  }
57
195
  };
196
+ this.getCellOptions = (cell, key) => {
197
+ if (!(this.isObject(cell) && Object.keys(cell).includes(key)))
198
+ return;
199
+ return this.getObjectValue(cell, key);
200
+ };
58
201
  this.createUpdatingIndicator = () => {
59
202
  const { appearance, description, max, min, progress } = this.updatingOptions || {};
60
203
  return (h("th", { colSpan: this.columns.length, class: "updating-state" }, h("ic-loading-indicator", { appearance: appearance, description: description || "Updating table data", fullWidth: true, max: max, min: min, progress: progress, type: "linear", size: "small" })));
61
204
  };
205
+ this.setRowHeight = (height) => {
206
+ return pxToRem(`${height * this.DENSITY_HEIGHT_MULTIPLIER[this.density] -
207
+ this.DENSITY_PADDING_HEIGHT_DIFF[this.density]}px`);
208
+ };
209
+ this.setTruncationClass = () => {
210
+ if (this.truncationPattern) {
211
+ return { [`truncation-${this.truncationPattern}`]: true };
212
+ }
213
+ return {};
214
+ };
62
215
  this.createCells = (row, rowIndex) => {
216
+ var _a;
63
217
  const rowValues = Object.values(row);
64
218
  const rowKeys = Object.keys(row);
219
+ const index = rowIndex;
220
+ const rowOptions = this.getRowOptions(rowKeys, rowValues);
65
221
  let rowAlignment;
66
222
  let rowEmphasis;
67
223
  const headerIndex = rowKeys.indexOf("header");
@@ -69,42 +225,63 @@ const DataTable = class {
69
225
  rowAlignment = this.getObjectValue(rowValues[headerIndex], "rowAlignment");
70
226
  rowEmphasis = this.getObjectValue(rowValues[headerIndex], "emphasis");
71
227
  }
228
+ const variableRowHeightVal = (_a = this.variableRowHeight) === null || _a === void 0 ? void 0 : _a.call(this, Object.assign(Object.assign({}, row), { index }));
229
+ const currentRowHeight = variableRowHeightVal
230
+ ? variableRowHeightVal !== "auto" && variableRowHeightVal
231
+ : this.globalRowHeight !== "auto" && this.globalRowHeight;
72
232
  return rowValues.map((cell, index) => {
73
- var _a, _b, _c, _d, _e;
233
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
74
234
  const columnProps = this.columns[index];
75
235
  const cellSlotName = `${columnProps === null || columnProps === void 0 ? void 0 : columnProps.key}-${rowIndex}`;
76
236
  const hasIcon = this.isObject(cell) && Object.keys(cell).includes("icon");
77
237
  const cellValue = (key) => this.getObjectValue(cell, key);
78
- return rowKeys[index] === "header" ? (h("th", { scope: "row", colSpan: cellValue("colspan"), class: {
79
- ["row-header"]: true,
80
- [`row-header-alignment-${cellValue("cellAlignment")}`]: !!cellValue("cellAlignment"),
81
- ["row-header-sticky"]: this.stickyRowHeaders,
82
- } }, cellValue("title"))) : (h("td", { class: {
83
- ["table-cell"]: true,
84
- [`table-density-${this.density}`]: this.notDefaultDensity(),
85
- [`data-type-${columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType}`]: true,
86
- [`cell-alignment-${((_a = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _a === void 0 ? void 0 : _a.vertical) ||
87
- rowAlignment ||
88
- this.getCellAlignment(cell, "vertical")}`]: !!((_b = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _b === void 0 ? void 0 : _b.vertical) ||
89
- !!rowAlignment ||
90
- !!this.getCellAlignment(cell, "vertical"),
91
- } }, h("div", { innerHTML: (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) === "element" &&
92
- !isSlotUsed(this.el, cellSlotName)
93
- ? cell
94
- : null, class: {
95
- "cell-container": (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "element",
96
- [`data-type-${columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType}`]: true,
97
- [`cell-alignment-${((_c = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _c === void 0 ? void 0 : _c.horizontal) ||
98
- this.getCellAlignment(cell, "horizontal")}`]: !!((_d = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _d === void 0 ? void 0 : _d.horizontal) ||
99
- !!this.getCellAlignment(cell, "horizontal"),
100
- } }, isSlotUsed(this.el, cellSlotName) ? (h("slot", { name: cellSlotName })) : (h(Fragment, null, isSlotUsed(this.el, `${cellSlotName}-icon`) ? (h("slot", { name: `${cellSlotName}-icon` })) : ((hasIcon || ((_e = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _e === void 0 ? void 0 : _e.onAllCells)) && (h("span", { class: "icon", innerHTML: cellValue("icon") || (columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon.icon) }))), h("ic-typography", { variant: "body", class: {
101
- [`cell-emphasis-${(this.isObject(cell) && cellValue("emphasis")) ||
102
- (columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
103
- rowEmphasis}`]: (this.isObject(cell) && !!cellValue("emphasis")) ||
104
- !!(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
105
- !!rowEmphasis,
106
- [`text-${this.density}`]: this.notDefaultDensity(),
107
- } }, this.isObject(cell) && (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "date" ? (Object.keys(cell).includes("href") ? (h("ic-link", { href: cellValue("href") }, cellValue("data"))) : (cellValue("data"))) : (this.getCellContent(cell, columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType))))))));
238
+ if (rowKeys[index] === "header") {
239
+ return (h("th", { scope: "row", colSpan: cellValue("colspan"), class: {
240
+ ["row-header"]: true,
241
+ [`row-header-alignment-${cellValue("cellAlignment")}`]: !!cellValue("cellAlignment"),
242
+ ["row-header-sticky"]: this.stickyRowHeaders,
243
+ } }, cellValue("title")));
244
+ }
245
+ if (rowKeys[index] !== "rowOptions") {
246
+ return (h("td", { class: {
247
+ ["table-cell"]: true,
248
+ [`table-density-${this.density}`]: this.notDefaultDensity(),
249
+ } }, h("div", { innerHTML: (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) === "element" &&
250
+ !isSlotUsed(this.el, cellSlotName)
251
+ ? cell
252
+ : null, class: Object.assign({ "cell-container": (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "element", [`cell-alignment-${((_a = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _a === void 0 ? void 0 : _a.vertical) ||
253
+ ((_b = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _b === void 0 ? void 0 : _b.vertical) ||
254
+ rowAlignment ||
255
+ this.getCellAlignment(cell, "vertical")}`]: !!((_c = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _c === void 0 ? void 0 : _c.vertical) ||
256
+ !!((_d = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _d === void 0 ? void 0 : _d.vertical) ||
257
+ !!rowAlignment ||
258
+ !!this.getCellAlignment(cell, "vertical"), [`cell-alignment-${((_e = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _e === void 0 ? void 0 : _e.horizontal) ||
259
+ ((_f = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _f === void 0 ? void 0 : _f.horizontal) ||
260
+ this.getCellAlignment(cell, "horizontal")}`]: !!((_g = columnProps === null || columnProps === void 0 ? void 0 : columnProps.columnAlignment) === null || _g === void 0 ? void 0 : _g.horizontal) ||
261
+ !!((_h = rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.rowAlignment) === null || _h === void 0 ? void 0 : _h.horizontal) ||
262
+ !!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) ||
263
+ (rowOptions === null || rowOptions === void 0 ? void 0 : rowOptions.textWrap) ||
264
+ !!this.getCellOptions(cell, "textWrap"), ["cell-icon"]: hasIcon || !!((_j = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _j === void 0 ? void 0 : _j.icon) }, this.setTruncationClass()), style: {
265
+ height: (this.truncationPattern || currentRowHeight) &&
266
+ !columnProps.textWrap &&
267
+ !rowOptions.textWrap &&
268
+ !this.getCellOptions(cell, "textWrap") &&
269
+ (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "element"
270
+ ? this.setRowHeight(currentRowHeight)
271
+ : null,
272
+ }, "data-row-height": this.truncationPattern || currentRowHeight
273
+ ? this.setRowHeight(currentRowHeight)
274
+ : null }, isSlotUsed(this.el, cellSlotName) ? (h("slot", { name: cellSlotName })) : (h(Fragment, null, isSlotUsed(this.el, `${cellSlotName}-icon`) ? (h("slot", { name: `${cellSlotName}-icon` })) : ((hasIcon || ((_k = columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon) === null || _k === void 0 ? void 0 : _k.onAllCells)) && (h("span", { class: "icon", innerHTML: cellValue("icon") || (columnProps === null || columnProps === void 0 ? void 0 : columnProps.icon.icon) }))), (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "element" &&
275
+ !isSlotUsed(this.el, cellSlotName) && (h("ic-typography", { variant: "body", class: {
276
+ [`cell-emphasis-${(this.isObject(cell) && cellValue("emphasis")) ||
277
+ (columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
278
+ rowEmphasis}`]: (this.isObject(cell) && !!cellValue("emphasis")) ||
279
+ !!(columnProps === null || columnProps === void 0 ? void 0 : columnProps.emphasis) ||
280
+ !!rowEmphasis,
281
+ [`text-${this.density}`]: this.notDefaultDensity(),
282
+ } }, this.isObject(cell) &&
283
+ (columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType) !== "date" ? (Object.keys(cell).includes("href") ? (h("ic-link", { href: cellValue("href") }, cellValue("data"))) : (cellValue("data"))) : (this.getCellContent(cell, columnProps === null || columnProps === void 0 ? void 0 : columnProps.dataType)))))))));
284
+ }
108
285
  });
109
286
  };
110
287
  this.createColumnHeaders = () => {
@@ -121,7 +298,7 @@ const DataTable = class {
121
298
  [`text-${this.density}`]: this.notDefaultDensity(),
122
299
  } }, title), this.sortable && (h("ic-button", { variant: "icon", id: `sort-button-${key}`, "aria-label": this.getSortButtonLabel(key),
123
300
  // eslint-disable-next-line react/jsx-no-bind
124
- onClick: () => this.sortRows(key), innerHTML: SORT_ICONS[this.sortedColumn === key
301
+ onClick: () => this.sortRows(key), innerHTML: this.SORT_ICONS[this.sortedColumn === key
125
302
  ? this.sortedColumnOrder
126
303
  : "unsorted"], class: {
127
304
  ["sort-button"]: true,
@@ -129,6 +306,10 @@ const DataTable = class {
129
306
  this.sortedColumnOrder === "unsorted",
130
307
  } }))))));
131
308
  };
309
+ this.onRowClick = (row) => {
310
+ this.selectedRow =
311
+ this.selectedRow !== row && !this.loading && !this.updating && row;
312
+ };
132
313
  this.createRows = () => {
133
314
  const data = this.showPagination
134
315
  ? this.data.slice(this.fromRow, this.toRow)
@@ -148,24 +329,11 @@ const DataTable = class {
148
329
  return data
149
330
  .sort(!this.sortable ? undefined : this.getSortFunction())
150
331
  .map((row, index) => {
151
- var _a;
152
- const variableRowHeightVal = (_a = this.variableRowHeight) === null || _a === void 0 ? void 0 : _a.call(this, Object.assign(Object.assign({}, row), { index }));
153
- const findRowHeight = variableRowHeightVal
154
- ? variableRowHeightVal !== "auto" && variableRowHeightVal
155
- : this.globalRowHeight !== "auto" && this.globalRowHeight;
156
332
  return (h("tr", {
157
333
  // eslint-disable-next-line react/jsx-no-bind
158
- onClick: () => (this.selectedRow =
159
- this.selectedRow !== row &&
160
- !this.loading &&
161
- !this.updating &&
162
- row), class: {
334
+ onClick: () => this.onRowClick(row), class: {
163
335
  ["table-row"]: true,
164
336
  ["table-row-selected"]: this.selectedRow === row,
165
- }, style: {
166
- height: findRowHeight
167
- ? `${findRowHeight * DENSITY_HEIGHT_MULTIPLIER[this.density]}px`
168
- : null,
169
337
  }
170
338
  }, this.createCells(row, index)));
171
339
  });
@@ -228,6 +396,25 @@ const DataTable = class {
228
396
  }
229
397
  this.sortedColumnOrder = sortOrders[nextSortOrderIndex];
230
398
  sortButton.setAttribute("aria-label", this.getSortButtonLabel(column));
399
+ this.tableSorted = true;
400
+ };
401
+ this.getTypographyElements = () => {
402
+ return Array.from(this.el.shadowRoot.querySelectorAll("ic-typography:not(.column-header-text)"));
403
+ };
404
+ this.getTooltip = (typographyEl) => {
405
+ return typographyEl.closest(this.TOOLTIP);
406
+ };
407
+ this.updateTruncationTooltip = (removeTooltipOnly = false) => {
408
+ this.getTypographyElements().forEach((typographyEl) => {
409
+ const tooltip = this.getTooltip(typographyEl);
410
+ const cellContainer = this.getCellContainer(typographyEl);
411
+ if (typographyEl.closest(this.TEXT_WRAP_CLASS)) {
412
+ this.removeTooltip(cellContainer, typographyEl, tooltip);
413
+ typographyEl.setAttribute("style", `--ic-line-clamp: 0`);
414
+ return;
415
+ }
416
+ this.regenerateTooltip(cellContainer, typographyEl, tooltip, removeTooltipOnly);
417
+ });
231
418
  };
232
419
  this.updateScrollOffset = () => {
233
420
  this.scrollOffset = this.el.shadowRoot.querySelector(".table-row-container").scrollTop;
@@ -241,12 +428,13 @@ const DataTable = class {
241
428
  this.sortedColumn = undefined;
242
429
  this.sortedColumnOrder = undefined;
243
430
  this.toRow = undefined;
431
+ this.currentRowHeight = undefined;
244
432
  this.caption = undefined;
245
433
  this.columns = undefined;
246
434
  this.data = undefined;
247
435
  this.density = "default";
248
436
  this.embedded = false;
249
- this.globalRowHeight = 40;
437
+ this.globalRowHeight = "auto";
250
438
  this.hideColumnHeaders = false;
251
439
  this.loading = false;
252
440
  this.loadingOptions = undefined;
@@ -275,10 +463,15 @@ const DataTable = class {
275
463
  };
276
464
  this.stickyColumnHeaders = false;
277
465
  this.stickyRowHeaders = false;
466
+ this.truncationPattern = undefined;
278
467
  this.updating = false;
279
468
  this.updatingOptions = undefined;
280
469
  this.variableRowHeight = undefined;
281
470
  }
471
+ disconnectedCallback() {
472
+ var _a;
473
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
474
+ }
282
475
  componentWillLoad() {
283
476
  var _a;
284
477
  this.rowsPerPage = Number(this.paginationBarOptions.itemsPerPageOptions[0].value);
@@ -287,10 +480,15 @@ const DataTable = class {
287
480
  this.sortedColumn = this.sortOptions.defaultColumn;
288
481
  this.sortedColumnOrder = this.sortOptions.sortOrders[0];
289
482
  this.loadingOptions = Object.assign(Object.assign({}, this.loadingOptions), { showBackground: ((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) > 0 });
483
+ this.initialLoad = true;
484
+ this.previousItemsPerPage = this.rowsPerPage;
290
485
  }
291
486
  componentDidLoad() {
292
487
  const tableElement = this.el.shadowRoot.querySelector("table");
293
488
  const tableContainer = this.el.shadowRoot.querySelector(".table-container");
489
+ if (this.dataUpdated) {
490
+ this.dataUpdated = false;
491
+ }
294
492
  if ((tableElement === null || tableElement === void 0 ? void 0 : tableElement.clientHeight) > (tableContainer === null || tableContainer === void 0 ? void 0 : tableContainer.clientHeight) ||
295
493
  (tableElement === null || tableElement === void 0 ? void 0 : tableElement.clientWidth) > (tableContainer === null || tableContainer === void 0 ? void 0 : tableContainer.clientWidth)) {
296
494
  this.scrollable = true;
@@ -299,11 +497,144 @@ const DataTable = class {
299
497
  this.startLoadingTimer();
300
498
  this.showLoadingIndicator();
301
499
  }
500
+ if (this.truncationPattern) {
501
+ this.getTypographyElements().forEach((typographyEl) => {
502
+ if (!typographyEl.classList.contains(this.TEXT_WRAP_STRING)) {
503
+ this.dataTruncation(typographyEl);
504
+ }
505
+ });
506
+ this.debounceDataTruncation();
507
+ }
508
+ if (this.globalRowHeight !== "auto") {
509
+ this.updateSetRowHeight();
510
+ }
302
511
  }
303
- handleItemsPerPageChange({ detail, target, }) {
304
- if (target.parentElement !== this.el) {
305
- this.previousRowsPerPage = this.rowsPerPage;
306
- this.rowsPerPage = detail.value;
512
+ componentDidUpdate() {
513
+ this.truncateUpdatedData();
514
+ }
515
+ truncateUpdatedData() {
516
+ if (this.dataUpdated) {
517
+ if (this.truncationPattern === this.SHOW_HIDE_STRING) {
518
+ this.resetShowHideTruncation();
519
+ }
520
+ if (this.truncationPattern === this.TOOLTIP_STRING) {
521
+ this.updateTruncationTooltip();
522
+ }
523
+ this.dataUpdated = false;
524
+ }
525
+ if (this.tableSorted) {
526
+ if (this.truncationPattern === this.TOOLTIP_STRING) {
527
+ this.updateTruncationTooltip();
528
+ }
529
+ this.tableSorted = false;
530
+ }
531
+ // This function recalculates the tooltip truncation when the rowHeight has been set.
532
+ // This is in componentDidUpdate so a setTimeout is not used to wait for the render to be complete
533
+ if (this.rowHeightSet) {
534
+ const fontSize = parseInt(getComputedStyle(document.documentElement).fontSize);
535
+ this.getTypographyElements().forEach((typographyEl) => {
536
+ var _a;
537
+ const cellContainer = this.getCellContainer(typographyEl);
538
+ const tooltipEl = this.getTooltip(typographyEl);
539
+ const rowHeight = fontSize *
540
+ parseFloat(cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
541
+ // If the set row height is bigger than the cell container even
542
+ // with textWrap, set the row height
543
+ if (!((_a = cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.style) === null || _a === void 0 ? void 0 : _a.height) &&
544
+ rowHeight > cellContainer.clientHeight) {
545
+ cellContainer.style.setProperty("height", cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
546
+ }
547
+ if (this.truncationPattern) {
548
+ // If the set row height is bigger than the typography truncation wrapper
549
+ // scroll height, remove see more / see less button
550
+ if (this.truncationPattern === this.SHOW_HIDE_STRING) {
551
+ const truncWrapper = this.getTruncWrapper(typographyEl);
552
+ const showHideBtn = typographyEl.shadowRoot.querySelector("button");
553
+ if (showHideBtn &&
554
+ (truncWrapper === null || truncWrapper === void 0 ? void 0 : truncWrapper.scrollHeight) <= cellContainer.clientHeight) {
555
+ this.resetShowHideTruncation(typographyEl);
556
+ return;
557
+ }
558
+ }
559
+ this.truncate(typographyEl, cellContainer, tooltipEl);
560
+ }
561
+ else {
562
+ this.updateSetRowHeight(typographyEl);
563
+ }
564
+ });
565
+ this.rowHeightSet = false;
566
+ }
567
+ // Only run truncation on the new rows
568
+ // when the number of items per page has increased
569
+ if (this.itemsPerPageChange) {
570
+ const allRows = this.el.shadowRoot.querySelectorAll(".table-row");
571
+ if (this.rowsPerPage > this.previousItemsPerPage) {
572
+ const newRows = Array.from(allRows).slice(this.previousItemsPerPage);
573
+ newRows.forEach((row) => {
574
+ row
575
+ .querySelectorAll("ic-typography")
576
+ .forEach((typographyEl) => {
577
+ const cellContainer = this.getCellContainer(typographyEl);
578
+ const tooltipEl = this.getTooltip(typographyEl);
579
+ this.truncate(typographyEl, cellContainer, tooltipEl);
580
+ });
581
+ });
582
+ }
583
+ this.previousItemsPerPage = this.rowsPerPage;
584
+ this.itemsPerPageChange = false;
585
+ }
586
+ if (!this.initialLoad && this.icPageChangeEvent) {
587
+ if (this.truncationPattern === this.TOOLTIP_STRING) {
588
+ this.updateTruncationTooltip();
589
+ }
590
+ // set truncation to see more if opened and next/previous page is pressed
591
+ if (this.truncationPattern === this.SHOW_HIDE_STRING) {
592
+ this.getTypographyElements().forEach((typographyEl) => {
593
+ const cellContainer = this.getCellContainer(typographyEl);
594
+ const showHideBtn = typographyEl.shadowRoot.querySelector("button");
595
+ if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > cellContainer.clientHeight &&
596
+ !showHideBtn) {
597
+ this.addShowHideTruncation(cellContainer, typographyEl);
598
+ }
599
+ });
600
+ }
601
+ this.icPageChangeEvent = false;
602
+ }
603
+ if (this.densityUpdate) {
604
+ this.getTypographyElements().forEach((typographyEl) => {
605
+ const cellContainer = this.getCellContainer(typographyEl);
606
+ const tooltipEl = this.getTooltip(typographyEl);
607
+ this.truncate(typographyEl, cellContainer, tooltipEl);
608
+ });
609
+ this.densityUpdate = false;
610
+ }
611
+ }
612
+ createShowHideTruncation(typographyEl, cellContainer) {
613
+ typographyEl.checkMaxLines(typographyEl.scrollHeight);
614
+ typographyEl.setAttribute("max-lines", `${Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT)}`);
615
+ typographyEl.setShowHideExpanded(false);
616
+ cellContainer.style.height = null;
617
+ }
618
+ addTooltipTruncation(typographyEl, cellContainer, tooltip) {
619
+ this.addLineClampCSS(typographyEl, cellContainer);
620
+ if (!tooltip) {
621
+ this.createTruncationTooltip(typographyEl, cellContainer);
622
+ }
623
+ }
624
+ addShowHideTruncation(cellContainer, typographyEl) {
625
+ cellContainer.classList.add(this.SHOW_HIDE_CSS_CLASS);
626
+ this.createShowHideTruncation(typographyEl, cellContainer);
627
+ }
628
+ getTruncWrapper(typographyEl) {
629
+ return typographyEl.shadowRoot.querySelector(".trunc-wrapper");
630
+ }
631
+ // Set the height to initial if row height is set and the show / hide truncation
632
+ // is clicked
633
+ handleTypographyTruncationExpandToggle({ detail, }) {
634
+ const { expanded, typographyEl } = detail;
635
+ const cellContainer = this.getCellContainer(typographyEl);
636
+ if (cellContainer.style.height && expanded) {
637
+ cellContainer.style.height = "inherit";
307
638
  }
308
639
  }
309
640
  handlePageChange({ detail, target }) {
@@ -322,6 +653,19 @@ const DataTable = class {
322
653
  this.previousRowsPerPage = this.rowsPerPage;
323
654
  }
324
655
  }
656
+ if (!this.initialLoad && this.previousPaginationPage !== detail.value) {
657
+ // This is to prevent icPageChange from triggering truncation on first load
658
+ this.icPageChangeEvent = true;
659
+ }
660
+ this.previousPaginationPage = detail.value;
661
+ this.initialLoad = false;
662
+ }
663
+ handleItemsPerPageChange({ detail, target, }) {
664
+ if (target.parentElement !== this.el) {
665
+ this.previousRowsPerPage = this.rowsPerPage;
666
+ this.rowsPerPage = detail.value;
667
+ }
668
+ this.itemsPerPageChange = true;
325
669
  }
326
670
  handleDensityChange(ev) {
327
671
  this.density = ev.detail.value;
@@ -339,7 +683,23 @@ const DataTable = class {
339
683
  }, 500);
340
684
  }
341
685
  }
342
- dataHandler(newData) {
686
+ truncationPatternHandler(newValue) {
687
+ if (newValue === this.SHOW_HIDE_STRING) {
688
+ this.updateTruncationTooltip(true);
689
+ // Not using debounceDataTruncation here due to resizeObserver not being triggered
690
+ this.getTypographyElements().forEach((typographyEl) => {
691
+ const cellContainer = this.getCellContainer(typographyEl);
692
+ const tooltip = this.getTooltip(typographyEl);
693
+ this.truncate(typographyEl, cellContainer, tooltip);
694
+ });
695
+ }
696
+ if (newValue === this.TOOLTIP_STRING) {
697
+ // ResizeObserver is trigger here due to the see more/see less links being removed.
698
+ // The resizeObserver will also apply the tooltip where relevant
699
+ this.resetShowHideTruncation();
700
+ }
701
+ }
702
+ async dataHandler(newData) {
343
703
  this.loadingOptions = Object.assign(Object.assign({}, this.loadingOptions), { showBackground: (newData === null || newData === void 0 ? void 0 : newData.length) > 0 });
344
704
  if (this.loading) {
345
705
  !this.hasLoadedForOneSecond
@@ -349,31 +709,124 @@ const DataTable = class {
349
709
  }
350
710
  if (this.updating)
351
711
  this.updating = false;
712
+ this.dataUpdated = true;
352
713
  }
353
- rowHeightChangeHandler() {
354
- this.icRowHeightChange.emit();
714
+ async densityHandler() {
715
+ this.densityUpdate = true;
716
+ }
717
+ resetShowHideTruncation(typographyEl) {
718
+ if (typographyEl) {
719
+ const truncWrapper = this.getTruncWrapper(typographyEl);
720
+ const cellContainer = this.getCellContainer(typographyEl);
721
+ if ((truncWrapper === null || truncWrapper === void 0 ? void 0 : truncWrapper.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) &&
722
+ !isEmptyString(typographyEl.getAttribute("max-lines")) &&
723
+ Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT) !==
724
+ +typographyEl.getAttribute("max-lines")) {
725
+ typographyEl.checkMaxLines(truncWrapper.scrollHeight);
726
+ typographyEl.setAttribute("max-lines", `${Math.floor((cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) / this.DEFAULT_LINE_HEIGHT)}`);
727
+ typographyEl.setShowHideExpanded(false);
728
+ cellContainer.style.height = null;
729
+ }
730
+ else {
731
+ typographyEl.resetTruncation().then(() => {
732
+ cellContainer.style.setProperty("height", cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
733
+ });
734
+ }
735
+ }
736
+ else {
737
+ this.getTypographyElements().forEach((typographyEl) => {
738
+ const cellContainer = this.getCellContainer(typographyEl);
739
+ typographyEl.resetTruncation().then(() => {
740
+ cellContainer.style.setProperty("height", cellContainer.getAttribute(this.DATA_ROW_HEIGHT_STRING));
741
+ });
742
+ });
743
+ }
744
+ }
745
+ rowHeightChangeHandler(newValue, oldValue) {
746
+ if (+newValue !== +oldValue) {
747
+ this.deleteTextWrapDataKey(this.data);
748
+ this.deleteTextWrapDataKey(this.columns);
749
+ this.removeTextWrap();
750
+ this.icRowHeightChange.emit();
751
+ this.rowHeightSet = true;
752
+ }
355
753
  }
356
754
  /**
357
- * Resets the `globalRowHeight` prop to `40px` and sets the `variableRowHeight` prop to `null`.
755
+ * Resets the `globalRowHeight` prop to number or auto and sets the `variableRowHeight` prop to `null`.
358
756
  */
359
- async resetRowHeights() {
360
- this.globalRowHeight = 40;
757
+ async resetRowHeights(rowHeight) {
758
+ this.globalRowHeight = rowHeight || "auto";
361
759
  this.variableRowHeight = null;
362
760
  }
363
761
  showLoadingIndicator() {
364
762
  this.loadingIndicator.classList.add("show");
365
763
  }
764
+ getRowOptions(rowKeys, rowValues) {
765
+ const rowOptionsIndex = rowKeys.indexOf("rowOptions");
766
+ return rowOptionsIndex > -1 && rowValues[rowOptionsIndex];
767
+ }
768
+ regenerateTooltip(cellContainer, typographyEl, tooltip, removeTooltipOnly) {
769
+ // When sorting the table, instead of regenerating the tooltip,
770
+ // the tooltip details are updated
771
+ if (tooltip) {
772
+ if (this.tableSorted) {
773
+ tooltip.setAttribute("target", typographyEl.id);
774
+ tooltip.setAttribute("label", typographyEl.textContent);
775
+ }
776
+ else {
777
+ this.removeTooltip(cellContainer, typographyEl, tooltip);
778
+ }
779
+ if (removeTooltipOnly) {
780
+ return;
781
+ }
782
+ }
783
+ // This add line clamp to data only when
784
+ // the data object has been updated
785
+ if (!typographyEl.getAttribute("style") && this.dataUpdated) {
786
+ this.addLineClampCSS(typographyEl, cellContainer);
787
+ }
788
+ // Adding the tableSorted boolean prevents the tooltip
789
+ // being regenerated and flashing
790
+ if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight) &&
791
+ !this.tableSorted) {
792
+ if (!typographyEl.getAttribute("style")) {
793
+ this.addLineClampCSS(typographyEl, cellContainer);
794
+ }
795
+ this.createTruncationTooltip(typographyEl, cellContainer);
796
+ }
797
+ }
798
+ removeTooltip(cellContainer, typographyEl, tooltip) {
799
+ cellContainer.appendChild(typographyEl);
800
+ if (tooltip) {
801
+ tooltip.remove();
802
+ }
803
+ }
804
+ addLineClampCSS(typographyEl, cellContainer) {
805
+ typographyEl.setAttribute("style", `--ic-line-clamp: ${this.getLines(cellContainer === null || cellContainer === void 0 ? void 0 : cellContainer.clientHeight)}`);
806
+ }
807
+ createTruncationTooltip(typographyEl, cellContainer) {
808
+ const tooltipEl = document.createElement("ic-tooltip");
809
+ tooltipEl.setAttribute("target", typographyEl.id);
810
+ tooltipEl.setAttribute("label", typographyEl.textContent);
811
+ tooltipEl.classList.add("ic-tooltip-overflow");
812
+ tooltipEl.setExternalPopperProps({
813
+ // This might need reverting back to absolute if the tooltip doesn't dynamically position itself correctly
814
+ strategy: "fixed",
815
+ });
816
+ cellContainer.appendChild(tooltipEl);
817
+ tooltipEl.appendChild(typographyEl);
818
+ }
366
819
  render() {
367
820
  const { caption, createColumnHeaders, createRows, createUpdatingIndicator, data, hideColumnHeaders, loading, loadingOptions, paginationBarOptions, scrollable, scrollOffset, showPagination, sortable, sortedColumnOrder, sortedColumn, stickyColumnHeaders, updateScrollOffset, updating, } = this;
368
821
  return (h("div", { class: "table-container" }, isSlotUsed(this.el, "title-bar") && h("slot", { name: "title-bar" }), h("div", { class: {
369
822
  ["table-row-container"]: true,
370
823
  scrollable,
371
- }, tabIndex: scrollable ? 0 : null, onScroll: updateScrollOffset }, h("table", null, h("caption", { class: "table-caption" }, caption), !hideColumnHeaders && (h("thead", { class: {
824
+ }, tabIndex: scrollable ? 0 : null, onScroll: updateScrollOffset }, isSlotUsed(this.el, "title-bar") && h("slot", { name: "title-bar" }), h("table", null, h("caption", { class: "table-caption" }, caption), !hideColumnHeaders && (h("thead", { class: {
372
825
  ["column-header-sticky"]: stickyColumnHeaders,
373
826
  ["column-header-overlay"]: stickyColumnHeaders && scrollOffset !== 0,
374
827
  } }, h("tr", null, createColumnHeaders()))), updating &&
375
828
  !loading &&
376
- (hideColumnHeaders ? (h("thead", null, createUpdatingIndicator())) : (createUpdatingIndicator())), (data === null || data === void 0 ? void 0 : data.length) > 0 && h("tbody", null, createRows())), !(data === null || data === void 0 ? void 0 : data.length) &&
829
+ (hideColumnHeaders ? (h("thead", null, createUpdatingIndicator())) : (createUpdatingIndicator())), (data === null || data === void 0 ? void 0 : data.length) > 0 && !loading && h("tbody", null, createRows())), !(data === null || data === void 0 ? void 0 : data.length) &&
377
830
  !loading &&
378
831
  (isSlotUsed(this.el, "empty-state") ? (h("slot", { name: "empty-state" })) : (h("ic-empty-state", { aligned: "center", heading: "No Data", class: "loading-empty" })))), loading && (h("ic-loading-indicator", { appearance: loadingOptions === null || loadingOptions === void 0 ? void 0 : loadingOptions.appearance, class: {
379
832
  "loading-empty": loading,
@@ -386,7 +839,9 @@ const DataTable = class {
386
839
  get el() { return getElement(this); }
387
840
  static get watchers() { return {
388
841
  "loading": ["loadingHandler"],
842
+ "truncationPattern": ["truncationPatternHandler"],
389
843
  "data": ["dataHandler"],
844
+ "density": ["densityHandler"],
390
845
  "globalRowHeight": ["rowHeightChangeHandler"],
391
846
  "variableRowHeight": ["rowHeightChangeHandler"]
392
847
  }; }