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

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