@xplortech/apollo-core 3.1.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/.typings/apollo-components.html-data.json +120 -14
  2. package/build/components/avatar.css +1 -1
  3. package/build/components/data-card.css +1 -1
  4. package/build/components/dropdown.css +1 -1
  5. package/build/components/input-time.css +1 -1
  6. package/build/components/large-card.css +1 -1
  7. package/build/components/list-item.css +1 -1
  8. package/build/components/modal.css +1 -1
  9. package/build/components/popover.css +1 -1
  10. package/build/components/side-nav.css +1 -1
  11. package/build/components/spotlight.css +1 -1
  12. package/build/components/table-cell-base.css +1 -0
  13. package/build/components/table-cell.css +1 -0
  14. package/build/components/table-footer-cell.css +1 -1
  15. package/build/components/table-header-cell.css +1 -1
  16. package/build/components/table.css +1 -1
  17. package/build/components/tag.css +1 -1
  18. package/build/components/toast.css +1 -1
  19. package/build/components/toggle.css +1 -1
  20. package/build/components/toolbar.css +1 -1
  21. package/build/components/tooltip.css +1 -1
  22. package/build/components/top-nav.css +1 -1
  23. package/build/components-manifest.json +19 -3
  24. package/build/core.css +1 -1
  25. package/build/style.css +1 -1
  26. package/build/variables/apollo.css +4 -0
  27. package/build/variables/field-edge.css +4 -0
  28. package/build/vendor/flatpickr.css +1 -1
  29. package/dist/apollo-core/apollo-core.css +1 -1
  30. package/dist/apollo-core/apollo-core.esm.js +1 -1
  31. package/dist/apollo-core/p-045a4538.entry.js +1 -0
  32. package/dist/apollo-core/{p-d443291f.entry.js → p-050a8bf2.entry.js} +1 -1
  33. package/dist/apollo-core/p-08767607.entry.js +1 -0
  34. package/dist/apollo-core/{p-149ddd12.entry.js → p-11914cd4.entry.js} +1 -1
  35. package/dist/apollo-core/{p-581b702c.entry.js → p-14e86de8.entry.js} +1 -1
  36. package/dist/apollo-core/p-194c0ccd.entry.js +1 -0
  37. package/dist/apollo-core/p-1c031055.entry.js +1 -0
  38. package/dist/apollo-core/p-24f7280a.entry.js +1 -0
  39. package/dist/apollo-core/{p-47bda204.entry.js → p-24fa8a03.entry.js} +1 -1
  40. package/dist/apollo-core/{p-91895c40.entry.js → p-2971e2ec.entry.js} +1 -1
  41. package/dist/apollo-core/{p-0958c719.entry.js → p-3417c1ce.entry.js} +1 -1
  42. package/dist/apollo-core/p-3713cd77.entry.js +1 -0
  43. package/dist/apollo-core/p-386851a2.entry.js +1 -0
  44. package/dist/apollo-core/p-3cd1238b.entry.js +1 -0
  45. package/dist/apollo-core/p-45c872d2.entry.js +1 -0
  46. package/dist/apollo-core/{p-b45179fb.entry.js → p-49531864.entry.js} +1 -1
  47. package/dist/apollo-core/p-4e3c6616.entry.js +1 -0
  48. package/dist/apollo-core/p-5b9fd96e.entry.js +1 -0
  49. package/dist/apollo-core/p-5c3be343.entry.js +1 -0
  50. package/dist/apollo-core/p-5cbf5d42.entry.js +1 -0
  51. package/dist/apollo-core/p-5ec2b180.entry.js +1 -0
  52. package/dist/apollo-core/{p-790709c0.entry.js → p-64f5c129.entry.js} +1 -1
  53. package/dist/apollo-core/{p-28bce81a.entry.js → p-65f6b66c.entry.js} +1 -1
  54. package/dist/apollo-core/{p-d9070ae5.entry.js → p-715baae0.entry.js} +1 -1
  55. package/dist/apollo-core/p-72e0455f.entry.js +1 -0
  56. package/dist/apollo-core/p-7ac7fbc0.entry.js +1 -0
  57. package/dist/apollo-core/p-7d70e089.entry.js +1 -0
  58. package/dist/apollo-core/{p-d41b8f46.entry.js → p-7eb02cf3.entry.js} +1 -1
  59. package/dist/apollo-core/p-7f4463ff.entry.js +1 -0
  60. package/dist/apollo-core/p-808f3d9c.entry.js +1 -0
  61. package/dist/apollo-core/p-87582346.entry.js +1 -0
  62. package/dist/apollo-core/{p-2c995d80.entry.js → p-8f8f4759.entry.js} +1 -1
  63. package/dist/apollo-core/{p-5d9a593e.entry.js → p-907bc21e.entry.js} +1 -1
  64. package/dist/apollo-core/p-9905c77c.entry.js +1 -0
  65. package/dist/apollo-core/{p-54903322.entry.js → p-9d731673.entry.js} +1 -1
  66. package/dist/apollo-core/{p-2938ab4f.entry.js → p-9feaa8be.entry.js} +1 -1
  67. package/dist/apollo-core/p-O7gQjVdS.js +1 -0
  68. package/dist/apollo-core/p-a6ecca68.entry.js +1 -0
  69. package/dist/apollo-core/p-a789c272.entry.js +1 -0
  70. package/dist/apollo-core/{p-06a9a27b.entry.js → p-aeb2bcb8.entry.js} +1 -1
  71. package/dist/apollo-core/p-b3b4678b.entry.js +1 -0
  72. package/dist/apollo-core/{p-82812126.entry.js → p-b64ed46d.entry.js} +1 -1
  73. package/dist/apollo-core/{p-0368a1df.entry.js → p-bc821e69.entry.js} +1 -1
  74. package/dist/apollo-core/p-bd493c4a.entry.js +1 -0
  75. package/dist/apollo-core/p-bdcece21.entry.js +1 -0
  76. package/dist/apollo-core/{p-cdb5b5c4.entry.js → p-bfb7a83a.entry.js} +1 -1
  77. package/dist/apollo-core/{p-cdacfcd4.entry.js → p-c22f70f4.entry.js} +1 -1
  78. package/dist/apollo-core/{p-5730d96c.entry.js → p-c5bc3b2c.entry.js} +1 -1
  79. package/dist/apollo-core/{p-4ad79534.entry.js → p-ca83003e.entry.js} +1 -1
  80. package/dist/apollo-core/p-d3230277.entry.js +1 -0
  81. package/dist/apollo-core/p-d3ada7d0.entry.js +1 -0
  82. package/dist/apollo-core/{p-d0bc7c45.entry.js → p-d469bf5d.entry.js} +1 -1
  83. package/dist/apollo-core/p-d7f8ee34.entry.js +1 -0
  84. package/dist/apollo-core/p-d879c349.entry.js +1 -0
  85. package/dist/apollo-core/{p-2139f9f6.entry.js → p-df257cbf.entry.js} +1 -1
  86. package/dist/apollo-core/p-e09d8beb.entry.js +1 -0
  87. package/dist/apollo-core/p-e4d50301.entry.js +1 -0
  88. package/dist/apollo-core/{p-f3a2c79b.entry.js → p-ea9cdd65.entry.js} +1 -1
  89. package/dist/apollo-core/{p-ca4652b3.entry.js → p-eba654a3.entry.js} +1 -1
  90. package/dist/apollo-core/{p-4a2323b3.entry.js → p-ee68bed6.entry.js} +1 -1
  91. package/dist/apollo-core/{p-abdf199b.entry.js → p-f384a990.entry.js} +1 -1
  92. package/dist/apollo-core/{p-4d4acd1f.entry.js → p-f579e4b0.entry.js} +1 -1
  93. package/dist/apollo-core/{p-d724c419.entry.js → p-fcb17ff9.entry.js} +1 -1
  94. package/dist/apollo-core/{p-e2890eb1.entry.js → p-ff16f574.entry.js} +1 -1
  95. package/dist/cjs/apollo-core.cjs.js +1 -1
  96. package/dist/cjs/index-3cBvw409.js +8 -12
  97. package/dist/cjs/loader.cjs.js +1 -1
  98. package/dist/cjs/table-internal-DssCrBs_.js +67 -0
  99. package/dist/cjs/xpl-accordion.cjs.entry.js +2 -2
  100. package/dist/cjs/xpl-application-shell.cjs.entry.js +1 -1
  101. package/dist/cjs/xpl-avatar_3.cjs.entry.js +4 -4
  102. package/dist/cjs/xpl-backdrop.cjs.entry.js +1 -1
  103. package/dist/cjs/xpl-badge.cjs.entry.js +1 -1
  104. package/dist/cjs/xpl-banner.cjs.entry.js +2 -2
  105. package/dist/cjs/xpl-breadcrumb-item.cjs.entry.js +1 -1
  106. package/dist/cjs/xpl-breadcrumbs.cjs.entry.js +1 -1
  107. package/dist/cjs/xpl-button-row.cjs.entry.js +1 -1
  108. package/dist/cjs/xpl-button.cjs.entry.js +1 -1
  109. package/dist/cjs/xpl-calendar.cjs.entry.js +1 -1
  110. package/dist/cjs/xpl-checkbox.cjs.entry.js +3 -3
  111. package/dist/cjs/xpl-choicelist.cjs.entry.js +1 -1
  112. package/dist/cjs/xpl-content-area.cjs.entry.js +1 -1
  113. package/dist/cjs/xpl-dashboard.cjs.entry.js +1 -1
  114. package/dist/cjs/xpl-data-card.cjs.entry.js +2 -2
  115. package/dist/cjs/xpl-dropdown_4.cjs.entry.js +8 -8
  116. package/dist/cjs/xpl-dynamic-table-cell.cjs.entry.js +2 -2
  117. package/dist/cjs/xpl-dynamic-table-row.cjs.entry.js +2 -2
  118. package/dist/cjs/xpl-dynamic-table.cjs.entry.js +2 -2
  119. package/dist/cjs/xpl-grid-item.cjs.entry.js +1 -1
  120. package/dist/cjs/xpl-grid.cjs.entry.js +1 -1
  121. package/dist/cjs/xpl-header-accordion.cjs.entry.js +1 -1
  122. package/dist/cjs/xpl-icon.cjs.entry.js +2 -2
  123. package/dist/cjs/xpl-input-color.cjs.entry.js +8 -8
  124. package/dist/cjs/xpl-input-phone.cjs.entry.js +5 -5
  125. package/dist/cjs/xpl-input-time.cjs.entry.js +2 -2
  126. package/dist/cjs/xpl-input_4.cjs.entry.js +10 -10
  127. package/dist/cjs/xpl-large-card.cjs.entry.js +1 -1
  128. package/dist/cjs/xpl-list.cjs.entry.js +2 -2
  129. package/dist/cjs/xpl-main-nav.cjs.entry.js +1 -1
  130. package/dist/cjs/xpl-modal.cjs.entry.js +1 -1
  131. package/dist/cjs/xpl-nav-header-menu.cjs.entry.js +2 -2
  132. package/dist/cjs/xpl-nav-item.cjs.entry.js +2 -2
  133. package/dist/cjs/xpl-pagination.cjs.entry.js +4 -4
  134. package/dist/cjs/xpl-panel.cjs.entry.js +2 -2
  135. package/dist/cjs/xpl-popover.cjs.entry.js +4 -4
  136. package/dist/cjs/xpl-progress-bar.cjs.entry.js +2 -2
  137. package/dist/cjs/xpl-progress-indicator.cjs.entry.js +1 -1
  138. package/dist/cjs/xpl-secondary-nav.cjs.entry.js +1 -1
  139. package/dist/cjs/xpl-select_2.cjs.entry.js +9 -9
  140. package/dist/cjs/xpl-side-nav-header-item.cjs.entry.js +2 -2
  141. package/dist/cjs/xpl-side-nav-item.cjs.entry.js +2 -2
  142. package/dist/cjs/xpl-side-nav-section.cjs.entry.js +5 -5
  143. package/dist/cjs/xpl-side-nav.cjs.entry.js +2 -2
  144. package/dist/cjs/xpl-skeleton.cjs.entry.js +1 -1
  145. package/dist/cjs/xpl-slideout.cjs.entry.js +1 -1
  146. package/dist/cjs/xpl-tab-panel.cjs.entry.js +2 -2
  147. package/dist/cjs/xpl-table-body.cjs.entry.js +1 -1
  148. package/dist/cjs/xpl-table-cell_3.cjs.entry.js +228 -0
  149. package/dist/cjs/xpl-table-footer.cjs.entry.js +1 -1
  150. package/dist/cjs/xpl-table-header.cjs.entry.js +1 -1
  151. package/dist/cjs/xpl-table-row.cjs.entry.js +43 -2
  152. package/dist/cjs/xpl-table.cjs.entry.js +1204 -80
  153. package/dist/cjs/xpl-tabs.cjs.entry.js +5 -5
  154. package/dist/cjs/xpl-toast.cjs.entry.js +2 -2
  155. package/dist/cjs/xpl-toggle.cjs.entry.js +3 -3
  156. package/dist/cjs/xpl-toolbar.cjs.entry.js +2 -2
  157. package/dist/cjs/xpl-tooltip.cjs.entry.js +1 -1
  158. package/dist/cjs/xpl-top-nav-item.cjs.entry.js +2 -2
  159. package/dist/cjs/xpl-top-nav-menu.cjs.entry.js +2 -2
  160. package/dist/cjs/xpl-top-nav.cjs.entry.js +5 -5
  161. package/dist/cjs/xpl-utility-bar.cjs.entry.js +1 -1
  162. package/dist/collection/collection-manifest.json +2 -1
  163. package/dist/collection/components/xpl-accordion/xpl-accordion.js +2 -2
  164. package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +1 -1
  165. package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +1 -1
  166. package/dist/collection/components/xpl-badge/xpl-badge.js +1 -1
  167. package/dist/collection/components/xpl-banner/xpl-banner.js +2 -2
  168. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +1 -1
  169. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +1 -1
  170. package/dist/collection/components/xpl-button/xpl-button.js +1 -1
  171. package/dist/collection/components/xpl-button-row/xpl-button-row.js +1 -1
  172. package/dist/collection/components/xpl-calendar/xpl-calendar.js +1 -1
  173. package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +3 -3
  174. package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +1 -1
  175. package/dist/collection/components/xpl-content-area/xpl-content-area.js +1 -1
  176. package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +1 -1
  177. package/dist/collection/components/xpl-data-card/xpl-data-card.js +2 -2
  178. package/dist/collection/components/xpl-divider/xpl-divider.js +1 -1
  179. package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +1 -1
  180. package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +1 -1
  181. package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +2 -2
  182. package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +4 -4
  183. package/dist/collection/components/xpl-dynamic-table/xpl-dynamic-table.js +2 -2
  184. package/dist/collection/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.js +2 -2
  185. package/dist/collection/components/xpl-dynamic-table-row/xpl-dynamic-table-row.js +2 -2
  186. package/dist/collection/components/xpl-grid/xpl-grid.js +1 -1
  187. package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +1 -1
  188. package/dist/collection/components/xpl-header-accordion/xpl-header-accordion.js +1 -1
  189. package/dist/collection/components/xpl-icon/xpl-icon.js +2 -2
  190. package/dist/collection/components/xpl-input/xpl-input-color/xpl-input-color.js +8 -8
  191. package/dist/collection/components/xpl-input/xpl-input-date/xpl-input-date.js +3 -3
  192. package/dist/collection/components/xpl-input/xpl-input-file/xpl-input-file.js +4 -4
  193. package/dist/collection/components/xpl-input/xpl-input-phone/xpl-input-phone.js +5 -5
  194. package/dist/collection/components/xpl-input/xpl-input-search/xpl-input-search.js +1 -1
  195. package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +2 -2
  196. package/dist/collection/components/xpl-input/xpl-input.js +2 -2
  197. package/dist/collection/components/xpl-large-card/xpl-large-card.js +1 -1
  198. package/dist/collection/components/xpl-list/xpl-list.js +2 -2
  199. package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +1 -1
  200. package/dist/collection/components/xpl-modal/xpl-modal.js +1 -1
  201. package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +2 -2
  202. package/dist/collection/components/xpl-pagination/xpl-pagination.js +4 -4
  203. package/dist/collection/components/xpl-panel/xpl-panel.js +2 -2
  204. package/dist/collection/components/xpl-popover/xpl-popover.js +4 -4
  205. package/dist/collection/components/xpl-progress-bar/xpl-progress-bar.js +2 -2
  206. package/dist/collection/components/xpl-progress-indicator/xpl-progress-indicator.js +1 -1
  207. package/dist/collection/components/xpl-radio/xpl-radio.js +3 -3
  208. package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +1 -1
  209. package/dist/collection/components/xpl-select/xpl-select.js +7 -7
  210. package/dist/collection/components/xpl-side-nav/xpl-side-nav-header-item/xpl-side-nav-header-item.js +2 -2
  211. package/dist/collection/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.js +2 -2
  212. package/dist/collection/components/xpl-side-nav/xpl-side-nav-section/xpl-side-nav-section.js +5 -5
  213. package/dist/collection/components/xpl-side-nav/xpl-side-nav.js +2 -2
  214. package/dist/collection/components/xpl-skeleton/xpl-skeleton.js +1 -1
  215. package/dist/collection/components/xpl-slideout/xpl-slideout.js +1 -1
  216. package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +2 -2
  217. package/dist/collection/components/xpl-table/utils/move-row-dom.js +50 -0
  218. package/dist/collection/components/xpl-table/utils/table-internal.js +57 -0
  219. package/dist/collection/components/xpl-table/xpl-table-body/xpl-table-body.js +1 -1
  220. package/dist/collection/components/xpl-table/xpl-table-cell/xpl-table-cell.js +167 -0
  221. package/dist/collection/components/xpl-table/xpl-table-footer/xpl-table-footer.js +1 -1
  222. package/dist/collection/components/xpl-table/xpl-table-footer-cell/xpl-table-footer-cell.js +2 -2
  223. package/dist/collection/components/xpl-table/xpl-table-header-cell/xpl-table-header-cell.js +402 -0
  224. package/dist/collection/components/xpl-table/xpl-table-row/xpl-table-row.js +44 -2
  225. package/dist/collection/components/xpl-table/xpl-table.js +1427 -116
  226. package/dist/collection/components/xpl-table-header/xpl-table-header.js +1 -1
  227. package/dist/collection/components/xpl-tabs/xpl-tabs.js +5 -5
  228. package/dist/collection/components/xpl-tag/xpl-tag.js +2 -2
  229. package/dist/collection/components/xpl-toast/xpl-toast.js +2 -2
  230. package/dist/collection/components/xpl-toggle/xpl-toggle.js +3 -3
  231. package/dist/collection/components/xpl-toolbar/xpl-toolbar.js +2 -2
  232. package/dist/collection/components/xpl-tooltip/xpl-tooltip.js +1 -1
  233. package/dist/collection/components/xpl-top-nav/xpl-nav-header-menu/xpl-nav-header-menu.js +2 -2
  234. package/dist/collection/components/xpl-top-nav/xpl-top-nav-item/xpl-top-nav-item.js +2 -2
  235. package/dist/collection/components/xpl-top-nav/xpl-top-nav-menu/xpl-top-nav-menu.js +2 -2
  236. package/dist/collection/components/xpl-top-nav/xpl-top-nav.js +5 -5
  237. package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +1 -1
  238. package/dist/components/index.d.ts +3 -1
  239. package/dist/components/index.js +1 -1
  240. package/dist/components/{p-oIn1krdu.js → p-1D7CWIJ-.js} +1 -1
  241. package/dist/components/{p-xtOHikY0.js → p-2cJsJK3-.js} +1 -1
  242. package/dist/components/{p-DYmvElhR.js → p-8zrW9vEC.js} +1 -1
  243. package/dist/components/p-B56GeUtW.js +1 -0
  244. package/dist/components/p-B6YLKDUX.js +1 -0
  245. package/dist/components/{p-D--kzomA.js → p-B7aaJikj.js} +1 -1
  246. package/dist/components/{p-U0JYwf4c.js → p-BOm_p_mz.js} +1 -1
  247. package/dist/components/p-BZIZSovL.js +1 -0
  248. package/dist/components/{p-xFsB212F.js → p-Btb2UkLz.js} +1 -1
  249. package/dist/components/{p-DAb-txW3.js → p-C0AbGd4t.js} +1 -1
  250. package/dist/components/p-CFXvQqUO.js +1 -0
  251. package/dist/components/{p-l3EZ-agL.js → p-CQjJIHK6.js} +1 -1
  252. package/dist/components/{p-Chpgh5SL.js → p-CV5nn1zR.js} +1 -1
  253. package/dist/components/p-CdRmVtIN.js +1 -0
  254. package/dist/components/p-CgemLtmL.js +1 -0
  255. package/dist/components/p-CmbpWpb0.js +1 -0
  256. package/dist/components/p-CuVYRPvz.js +1 -0
  257. package/dist/components/{p-JyNpXfDe.js → p-D09sGbzs.js} +1 -1
  258. package/dist/components/{p-BdpZR4KO.js → p-DTh_zemx.js} +1 -1
  259. package/dist/components/{p-CiHTfk3E.js → p-DoVubWyd.js} +1 -1
  260. package/dist/components/p-Dp62sBqX.js +1 -0
  261. package/dist/components/p-DqgnC_vS.js +1 -0
  262. package/dist/components/p-DtV4i45B.js +1 -0
  263. package/dist/components/{p-wIU7KUhA.js → p-ohy3NrgH.js} +1 -1
  264. package/dist/components/p-rLxtqgsy.js +1 -0
  265. package/dist/components/xpl-accordion.js +1 -1
  266. package/dist/components/xpl-application-shell.js +1 -1
  267. package/dist/components/xpl-avatar.js +1 -1
  268. package/dist/components/xpl-backdrop.js +1 -1
  269. package/dist/components/xpl-badge.js +1 -1
  270. package/dist/components/xpl-banner.js +1 -1
  271. package/dist/components/xpl-breadcrumb-item.js +1 -1
  272. package/dist/components/xpl-breadcrumbs.js +1 -1
  273. package/dist/components/xpl-button-row.js +1 -1
  274. package/dist/components/xpl-button.js +1 -1
  275. package/dist/components/xpl-calendar.js +1 -1
  276. package/dist/components/xpl-checkbox.js +1 -1
  277. package/dist/components/xpl-choicelist.js +1 -1
  278. package/dist/components/xpl-content-area.js +1 -1
  279. package/dist/components/xpl-dashboard.js +1 -1
  280. package/dist/components/xpl-data-card.js +1 -1
  281. package/dist/components/xpl-divider.js +1 -1
  282. package/dist/components/xpl-dropdown-group.js +1 -1
  283. package/dist/components/xpl-dropdown-heading.js +1 -1
  284. package/dist/components/xpl-dropdown-option.js +1 -1
  285. package/dist/components/xpl-dropdown.js +1 -1
  286. package/dist/components/xpl-dynamic-table-cell.js +1 -1
  287. package/dist/components/xpl-dynamic-table-row.js +1 -1
  288. package/dist/components/xpl-dynamic-table.js +1 -1
  289. package/dist/components/xpl-grid-item.js +1 -1
  290. package/dist/components/xpl-grid.js +1 -1
  291. package/dist/components/xpl-header-accordion.js +1 -1
  292. package/dist/components/xpl-icon.js +1 -1
  293. package/dist/components/xpl-input-color.js +1 -1
  294. package/dist/components/xpl-input-date.js +1 -1
  295. package/dist/components/xpl-input-file.js +1 -1
  296. package/dist/components/xpl-input-phone.js +1 -1
  297. package/dist/components/xpl-input-search.js +1 -1
  298. package/dist/components/xpl-input-time.js +1 -1
  299. package/dist/components/xpl-input.js +1 -1
  300. package/dist/components/xpl-large-card.js +1 -1
  301. package/dist/components/xpl-list-item.js +1 -1
  302. package/dist/components/xpl-list.js +1 -1
  303. package/dist/components/xpl-main-nav.js +1 -1
  304. package/dist/components/xpl-modal.js +1 -1
  305. package/dist/components/xpl-nav-header-menu.js +1 -1
  306. package/dist/components/xpl-nav-item.js +1 -1
  307. package/dist/components/xpl-pagination.js +1 -1
  308. package/dist/components/xpl-panel.js +1 -1
  309. package/dist/components/xpl-popover.js +1 -1
  310. package/dist/components/xpl-progress-bar.js +1 -1
  311. package/dist/components/xpl-progress-indicator.js +1 -1
  312. package/dist/components/xpl-radio.js +1 -1
  313. package/dist/components/xpl-secondary-nav.js +1 -1
  314. package/dist/components/xpl-select.js +1 -1
  315. package/dist/components/xpl-side-nav-header-item.js +1 -1
  316. package/dist/components/xpl-side-nav-item.js +1 -1
  317. package/dist/components/xpl-side-nav-section.js +1 -1
  318. package/dist/components/xpl-side-nav.js +1 -1
  319. package/dist/components/xpl-skeleton.js +1 -1
  320. package/dist/components/xpl-slideout.js +1 -1
  321. package/dist/components/xpl-spotlight.js +1 -1
  322. package/dist/components/xpl-tab-panel.js +1 -1
  323. package/dist/components/xpl-tab.js +1 -1
  324. package/dist/components/xpl-table-body.js +1 -1
  325. package/dist/components/xpl-table-cell.d.ts +11 -0
  326. package/dist/components/xpl-table-cell.js +1 -0
  327. package/dist/components/xpl-table-footer-cell.js +1 -1
  328. package/dist/components/xpl-table-footer.js +1 -1
  329. package/dist/components/xpl-table-header-cell.js +1 -1
  330. package/dist/components/xpl-table-header.js +1 -1
  331. package/dist/components/xpl-table-row.js +1 -1
  332. package/dist/components/xpl-table.js +1 -1
  333. package/dist/components/xpl-tabs.js +1 -1
  334. package/dist/components/xpl-tag.js +1 -1
  335. package/dist/components/xpl-toast.js +1 -1
  336. package/dist/components/xpl-toggle.js +1 -1
  337. package/dist/components/xpl-toolbar.js +1 -1
  338. package/dist/components/xpl-tooltip.js +1 -1
  339. package/dist/components/xpl-top-nav-item.js +1 -1
  340. package/dist/components/xpl-top-nav-menu.js +1 -1
  341. package/dist/components/xpl-top-nav.js +1 -1
  342. package/dist/components/xpl-utility-bar.js +1 -1
  343. package/dist/docs/xpl-avatar/readme.md +1 -1
  344. package/dist/docs/xpl-checkbox/readme.md +1 -3
  345. package/dist/docs/xpl-data-card/readme.md +1 -1
  346. package/dist/docs/xpl-dynamic-table/readme.md +4 -1
  347. package/dist/docs/xpl-dynamic-table-cell/readme.md +2 -0
  348. package/dist/docs/xpl-dynamic-table-row/readme.md +2 -0
  349. package/dist/docs/xpl-icon/readme.md +1 -1
  350. package/dist/docs/xpl-input/xpl-input-time/readme.md +1 -1
  351. package/dist/docs/xpl-large-card/readme.md +1 -1
  352. package/dist/docs/xpl-modal/readme.md +2 -2
  353. package/dist/docs/xpl-popover/readme.md +1 -2
  354. package/dist/docs/xpl-slideout/readme.md +1 -1
  355. package/dist/docs/xpl-spotlight/readme.md +1 -0
  356. package/dist/docs/xpl-table/readme.md +178 -20
  357. package/dist/docs/xpl-table/xpl-table-body/readme.md +4 -4
  358. package/dist/docs/xpl-table/xpl-table-cell/readme.md +53 -0
  359. package/dist/docs/xpl-table/xpl-table-footer/readme.md +4 -4
  360. package/dist/docs/xpl-table/xpl-table-footer-cell/readme.md +24 -15
  361. package/dist/docs/xpl-table/xpl-table-header-cell/readme.md +84 -0
  362. package/dist/docs/xpl-table/xpl-table-row/readme.md +18 -14
  363. package/dist/docs/xpl-toast/readme.md +2 -2
  364. package/dist/docs/xpl-toggle/readme.md +1 -1
  365. package/dist/docs/xpl-toolbar/readme.md +5 -3
  366. package/dist/docs/xpl-tooltip/readme.md +1 -2
  367. package/dist/docs.json +776 -113
  368. package/dist/esm/apollo-core.js +1 -1
  369. package/dist/esm/index-ukZKsqqq.js +8 -12
  370. package/dist/esm/loader.js +1 -1
  371. package/dist/esm/table-internal-O7gQjVdS.js +59 -0
  372. package/dist/esm/xpl-accordion.entry.js +2 -2
  373. package/dist/esm/xpl-application-shell.entry.js +1 -1
  374. package/dist/esm/xpl-avatar_3.entry.js +4 -4
  375. package/dist/esm/xpl-backdrop.entry.js +1 -1
  376. package/dist/esm/xpl-badge.entry.js +1 -1
  377. package/dist/esm/xpl-banner.entry.js +2 -2
  378. package/dist/esm/xpl-breadcrumb-item.entry.js +1 -1
  379. package/dist/esm/xpl-breadcrumbs.entry.js +1 -1
  380. package/dist/esm/xpl-button-row.entry.js +1 -1
  381. package/dist/esm/xpl-button.entry.js +1 -1
  382. package/dist/esm/xpl-calendar.entry.js +1 -1
  383. package/dist/esm/xpl-checkbox.entry.js +3 -3
  384. package/dist/esm/xpl-choicelist.entry.js +1 -1
  385. package/dist/esm/xpl-content-area.entry.js +1 -1
  386. package/dist/esm/xpl-dashboard.entry.js +1 -1
  387. package/dist/esm/xpl-data-card.entry.js +2 -2
  388. package/dist/esm/xpl-dropdown_4.entry.js +8 -8
  389. package/dist/esm/xpl-dynamic-table-cell.entry.js +2 -2
  390. package/dist/esm/xpl-dynamic-table-row.entry.js +2 -2
  391. package/dist/esm/xpl-dynamic-table.entry.js +2 -2
  392. package/dist/esm/xpl-grid-item.entry.js +1 -1
  393. package/dist/esm/xpl-grid.entry.js +1 -1
  394. package/dist/esm/xpl-header-accordion.entry.js +1 -1
  395. package/dist/esm/xpl-icon.entry.js +2 -2
  396. package/dist/esm/xpl-input-color.entry.js +8 -8
  397. package/dist/esm/xpl-input-phone.entry.js +5 -5
  398. package/dist/esm/xpl-input-time.entry.js +2 -2
  399. package/dist/esm/xpl-input_4.entry.js +10 -10
  400. package/dist/esm/xpl-large-card.entry.js +1 -1
  401. package/dist/esm/xpl-list.entry.js +2 -2
  402. package/dist/esm/xpl-main-nav.entry.js +1 -1
  403. package/dist/esm/xpl-modal.entry.js +1 -1
  404. package/dist/esm/xpl-nav-header-menu.entry.js +2 -2
  405. package/dist/esm/xpl-nav-item.entry.js +2 -2
  406. package/dist/esm/xpl-pagination.entry.js +4 -4
  407. package/dist/esm/xpl-panel.entry.js +2 -2
  408. package/dist/esm/xpl-popover.entry.js +4 -4
  409. package/dist/esm/xpl-progress-bar.entry.js +2 -2
  410. package/dist/esm/xpl-progress-indicator.entry.js +1 -1
  411. package/dist/esm/xpl-secondary-nav.entry.js +1 -1
  412. package/dist/esm/xpl-select_2.entry.js +9 -9
  413. package/dist/esm/xpl-side-nav-header-item.entry.js +2 -2
  414. package/dist/esm/xpl-side-nav-item.entry.js +2 -2
  415. package/dist/esm/xpl-side-nav-section.entry.js +5 -5
  416. package/dist/esm/xpl-side-nav.entry.js +2 -2
  417. package/dist/esm/xpl-skeleton.entry.js +1 -1
  418. package/dist/esm/xpl-slideout.entry.js +1 -1
  419. package/dist/esm/xpl-tab-panel.entry.js +2 -2
  420. package/dist/esm/xpl-table-body.entry.js +1 -1
  421. package/dist/esm/xpl-table-cell_3.entry.js +224 -0
  422. package/dist/esm/xpl-table-footer.entry.js +1 -1
  423. package/dist/esm/xpl-table-header.entry.js +1 -1
  424. package/dist/esm/xpl-table-row.entry.js +44 -3
  425. package/dist/esm/xpl-table.entry.js +1204 -80
  426. package/dist/esm/xpl-tabs.entry.js +5 -5
  427. package/dist/esm/xpl-toast.entry.js +2 -2
  428. package/dist/esm/xpl-toggle.entry.js +3 -3
  429. package/dist/esm/xpl-toolbar.entry.js +2 -2
  430. package/dist/esm/xpl-tooltip.entry.js +1 -1
  431. package/dist/esm/xpl-top-nav-item.entry.js +2 -2
  432. package/dist/esm/xpl-top-nav-menu.entry.js +2 -2
  433. package/dist/esm/xpl-top-nav.entry.js +5 -5
  434. package/dist/esm/xpl-utility-bar.entry.js +1 -1
  435. package/dist/types/components/xpl-table/utils/move-row-dom.d.ts +3 -0
  436. package/dist/types/components/xpl-table/utils/table-internal.d.ts +8 -0
  437. package/dist/types/components/xpl-table/xpl-table-cell/xpl-table-cell.d.ts +11 -0
  438. package/dist/types/components/xpl-table/xpl-table-header-cell/xpl-table-header-cell.d.ts +33 -0
  439. package/dist/types/components/xpl-table/xpl-table-row/xpl-table-row.d.ts +7 -0
  440. package/dist/types/components/xpl-table/xpl-table.d.ts +126 -22
  441. package/dist/types/components.d.ts +238 -60
  442. package/hydrate/index.js +1670 -266
  443. package/hydrate/index.mjs +1670 -266
  444. package/package.json +7 -7
  445. package/dist/apollo-core/p-056a99e4.entry.js +0 -1
  446. package/dist/apollo-core/p-068e3532.entry.js +0 -1
  447. package/dist/apollo-core/p-0a0a6e43.entry.js +0 -1
  448. package/dist/apollo-core/p-1a94c2d9.entry.js +0 -1
  449. package/dist/apollo-core/p-2faa7b9c.entry.js +0 -1
  450. package/dist/apollo-core/p-30b1b700.entry.js +0 -1
  451. package/dist/apollo-core/p-32084caf.entry.js +0 -1
  452. package/dist/apollo-core/p-38586952.entry.js +0 -1
  453. package/dist/apollo-core/p-50fae269.entry.js +0 -1
  454. package/dist/apollo-core/p-60cb3cfb.entry.js +0 -1
  455. package/dist/apollo-core/p-722b145a.entry.js +0 -1
  456. package/dist/apollo-core/p-75e5bfe0.entry.js +0 -1
  457. package/dist/apollo-core/p-77fe3cc1.entry.js +0 -1
  458. package/dist/apollo-core/p-83bb7607.entry.js +0 -1
  459. package/dist/apollo-core/p-8664d88b.entry.js +0 -1
  460. package/dist/apollo-core/p-8a925e9d.entry.js +0 -1
  461. package/dist/apollo-core/p-9064badb.entry.js +0 -1
  462. package/dist/apollo-core/p-969d5cca.entry.js +0 -1
  463. package/dist/apollo-core/p-99a79cf4.entry.js +0 -1
  464. package/dist/apollo-core/p-ae8a5f66.entry.js +0 -1
  465. package/dist/apollo-core/p-af8ebf49.entry.js +0 -1
  466. package/dist/apollo-core/p-b29025b2.entry.js +0 -1
  467. package/dist/apollo-core/p-b5a61076.entry.js +0 -1
  468. package/dist/apollo-core/p-bf7d8e18.entry.js +0 -1
  469. package/dist/apollo-core/p-c48e4884.entry.js +0 -1
  470. package/dist/apollo-core/p-cb5b15c2.entry.js +0 -1
  471. package/dist/apollo-core/p-cc57f20d.entry.js +0 -1
  472. package/dist/apollo-core/p-dca48977.entry.js +0 -1
  473. package/dist/apollo-core/p-e1833287.entry.js +0 -1
  474. package/dist/apollo-core/p-e2b73b60.entry.js +0 -1
  475. package/dist/apollo-core/p-e7e445b0.entry.js +0 -1
  476. package/dist/apollo-core/p-f1c103ff.entry.js +0 -1
  477. package/dist/apollo-core/p-ffc2f0cf.entry.js +0 -1
  478. package/dist/cjs/xpl-table-footer-cell.cjs.entry.js +0 -18
  479. package/dist/cjs/xpl-table-header-cell.cjs.entry.js +0 -59
  480. package/dist/collection/components/xpl-table-header-cell/xpl-table-header-cell.js +0 -190
  481. package/dist/components/p-9VnxPQLs.js +0 -1
  482. package/dist/components/p-B2oLZUDD.js +0 -1
  483. package/dist/components/p-BYYFsuD3.js +0 -1
  484. package/dist/components/p-BZtxVB1R.js +0 -1
  485. package/dist/components/p-CnVGKN63.js +0 -1
  486. package/dist/components/p-Cz7zDaI4.js +0 -1
  487. package/dist/components/p-D4rv6CNJ.js +0 -1
  488. package/dist/components/p-EfW0v54z.js +0 -1
  489. package/dist/components/p-YG9Jza0y.js +0 -1
  490. package/dist/docs/xpl-table-header-cell/readme.md +0 -47
  491. package/dist/esm/xpl-table-footer-cell.entry.js +0 -16
  492. package/dist/esm/xpl-table-header-cell.entry.js +0 -57
  493. package/dist/types/components/xpl-table-header-cell/xpl-table-header-cell.d.ts +0 -13
@@ -1,63 +1,92 @@
1
1
  import { Host, h, } from "@stencil/core";
2
- const getIconType = (sortType) => {
3
- switch (sortType) {
4
- case 'asc':
5
- return 'arrow-up';
6
- case 'desc':
7
- return 'arrow-down';
8
- default:
9
- return 'dash';
10
- }
11
- };
2
+ import { TimerManager } from "../../utils/lifecycle";
3
+ import { cycleSortDirection, getGridColumnWidthFromHeaderCell, getIconType, ROW_REORDER_MARK, SELECTION_MARK, } from "./utils/table-internal";
4
+ import { getNearestTableBodyRowFromNode, getNextVisibleTableBodyRowAfter, moveRowInTableBody, } from "./utils/move-row-dom";
5
+ function bodyRowFromDragTarget(target) {
6
+ return getNearestTableBodyRowFromNode(target);
7
+ }
8
+ function tableBodyRowFromEvent(ev) {
9
+ const path = typeof ev.composedPath === 'function' ? ev.composedPath() : [];
10
+ const row = path.find((n) => n instanceof HTMLElement && n.tagName.toLowerCase() === 'xpl-table-row');
11
+ return row ?? bodyRowFromDragTarget(ev.target);
12
+ }
13
+ function reorderDragHandleFromEvent(ev) {
14
+ const path = typeof ev.composedPath === 'function' ? ev.composedPath() : [];
15
+ const handle = path.find((n) => n instanceof HTMLElement && n.classList.contains('xpl-table__row-drag-handle'));
16
+ return handle ?? null;
17
+ }
12
18
  export class Table {
13
19
  constructor() {
14
- this.selectedValues = [];
15
- this.isSortable = false;
16
- this.sortableColumns = [];
20
+ this.columnWidthsToken = '';
21
+ this.lastEmittedRowSelectionKey = '';
22
+ this.draggedRow = null;
23
+ this.pendingDragRow = null;
24
+ this.pointerUpClearPending = null;
25
+ this.reorderKeyboardTimers = new TimerManager();
26
+ this.onReorderHandleKeydown = (ev) => {
27
+ this.handleReorderHandleKeyDown(ev);
28
+ };
17
29
  this.areAllSelected = false;
30
+ this.colCount = 0;
18
31
  this.hasScrolled = false;
32
+ this.keyboardReorderRowId = null;
33
+ this.reorderLiveMessage = '';
34
+ this.rowData = [];
35
+ this.rowFooterData = [];
36
+ this.selected = [];
37
+ this.selectedRowIds = [];
19
38
  this.sortTypeArray = [];
39
+ this.isSortable = false;
40
+ this.rowReorderable = false;
41
+ this.selectedValues = [];
42
+ this.sortableColumns = [];
43
+ this.onGridScroll = (e) => {
44
+ this.hasScrolled = e.target.scrollLeft > 0;
45
+ };
20
46
  this.selectAll = (e) => {
21
- const checked = e.detail;
47
+ const { target } = e;
48
+ if (!(target instanceof HTMLInputElement))
49
+ return;
50
+ const { checked } = target;
22
51
  this.areAllSelected = checked;
23
52
  this.selected =
24
- this.selectedValues.length > 0
25
- ? Array.from(this.el.querySelectorAll('tbody td:first-child xpl-checkbox')).map((checkbox) => (checked ? (checkbox.value ?? checked) : checked))
53
+ this.selectedValues && this.selectedValues.length > 0
54
+ ? Array.from(this.el.querySelectorAll('tbody td:first-child input')).map((input) => (checked ? input?.value : checked))
26
55
  : this.selected.map(() => checked);
27
- this.onChange();
56
+ this.onSelectionChange();
28
57
  };
29
58
  this.selectOne = (e, checkboxIdx) => {
30
- const checked = e.detail;
31
- const { value } = e.target;
59
+ const { target } = e;
60
+ if (!(target instanceof HTMLInputElement))
61
+ return;
62
+ const { checked, value } = target;
63
+ this.areAllSelected = false;
32
64
  this.selected = this.selected.map((v, selectedIdx) => {
33
65
  if (selectedIdx !== checkboxIdx)
34
66
  return v;
35
- return this.selectedValues.length > 0
67
+ return this.selectedValues && this.selectedValues.length > 0
36
68
  ? checked
37
- ? (value ?? checked)
69
+ ? value
38
70
  : checked
39
71
  : checked;
40
72
  });
41
- this.areAllSelected = this.selected.every((v) => !!v);
42
- this.onChange();
73
+ this.onSelectionChange();
43
74
  };
44
- this.onChange = () => {
75
+ this.onSelectionChange = () => {
45
76
  this.tableSelect.emit({
46
77
  selected: this.selected,
47
78
  areAllSelected: this.areAllSelected,
48
79
  });
49
80
  };
50
- this.onScroll = () => {
81
+ this.onLegacyScroll = () => {
51
82
  this.hasScrolled = this.container.scrollLeft > 0;
52
83
  };
53
84
  this.sortBy = (col, sortTypeArray) => {
54
85
  const handleSort = (a, b) => {
55
- if (a[col].toLocaleLowerCase() < b[col].toLocaleLowerCase()) {
86
+ if (a[col].toLocaleLowerCase() < b[col].toLocaleLowerCase())
56
87
  return -1;
57
- }
58
- if (a[col].toLocaleLowerCase() > b[col].toLocaleLowerCase()) {
88
+ if (a[col].toLocaleLowerCase() > b[col].toLocaleLowerCase())
59
89
  return 1;
60
- }
61
90
  return 0;
62
91
  };
63
92
  switch (sortTypeArray[col]) {
@@ -68,7 +97,7 @@ export class Table {
68
97
  this.rowData.sort((a, b) => handleSort(b, a));
69
98
  break;
70
99
  default:
71
- this.rowData = this.data ? Array.from(this.data) : [];
100
+ this.rowData = this.data !== undefined ? Array.from(this.data) : [];
72
101
  this.sortTypeArray[col] = null;
73
102
  break;
74
103
  }
@@ -77,44 +106,69 @@ export class Table {
77
106
  this.setData = () => {
78
107
  this.rowData = this.data !== undefined ? Array.from(this.data) : [];
79
108
  };
109
+ this.setFooterData = () => {
110
+ this.rowFooterData = this.footer !== undefined ? Array.from(this.footer) : [];
111
+ };
80
112
  }
81
- handleSort(clickEvt, isColumnSortable, colNum, colName) {
82
- clickEvt.preventDefault();
83
- clickEvt.stopPropagation();
84
- if (!isColumnSortable)
85
- return;
86
- this.sortTypeArray = this.sortTypeArray.map((val, i) => {
87
- if (i !== colNum)
88
- return null;
89
- switch (val) {
90
- case 'asc':
91
- return 'desc';
92
- case 'desc':
93
- return null;
94
- default:
95
- return 'asc';
96
- }
97
- });
98
- const evt = this.sortChanged.emit({
99
- colNum,
100
- colName,
101
- sortTypeArr: this.sortTypeArray,
102
- });
103
- if (!evt.defaultPrevented)
104
- this.sortBy(colNum, this.sortTypeArray);
113
+ watchColumns() {
114
+ this.sortTypeArray = this.columns ? this.columns.map(() => null) : [];
105
115
  }
106
116
  watchData() {
107
117
  this.setData();
108
118
  }
109
- watchColumns() {
110
- this.sortTypeArray = this.columns ? this.columns.map(() => null) : [];
119
+ watchFooterData() {
120
+ this.setFooterData();
121
+ }
122
+ watchReorderHandleIcon() {
123
+ if (this.isLegacyMode || !this.rowReorderable)
124
+ return;
125
+ this.syncInjectedReorderHandleIcons();
126
+ }
127
+ watchReorderHandleIconKeyboard() {
128
+ if (this.isLegacyMode || !this.rowReorderable)
129
+ return;
130
+ this.syncInjectedReorderHandleIcons();
131
+ }
132
+ watchRowReorderable(next) {
133
+ if (this.isLegacyMode)
134
+ return;
135
+ if (!next) {
136
+ this.keyboardReorderRowId = null;
137
+ this.syncReorderHandleKeyboardA11y(null);
138
+ this.removeManagedReorderCells();
139
+ this.draggedRow = null;
140
+ this.pendingDragRow = null;
141
+ this.clearPendingDragListeners();
142
+ this.reorderLiveMessage = '';
143
+ this.queryBodyRows().forEach((r) => {
144
+ r.removeAttribute('draggable');
145
+ r.querySelector('.xpl-table__row-drag-handle')?.removeAttribute('draggable');
146
+ r.classList.remove('xpl-table-row--dragging', 'xpl-table-row--drag-over');
147
+ });
148
+ this.colCount = 0;
149
+ this.columnWidthsToken = '';
150
+ }
151
+ }
152
+ watchSelectable(next) {
153
+ if (this.isLegacyMode)
154
+ return;
155
+ if (!next) {
156
+ this.selectedRowIds = [];
157
+ this.lastEmittedRowSelectionKey = '';
158
+ this.colCount = 0;
159
+ this.columnWidthsToken = '';
160
+ this.syncRowSelectedProps();
161
+ }
111
162
  }
112
163
  componentWillLoad() {
113
- this.ensureSelectAllValue();
114
- this.areAllSelected = false;
115
- this.setData();
116
- this.selected = new Array(this.rowData.length).fill(false);
117
- this.ensureSortTypeArray();
164
+ if (this.isLegacyMode) {
165
+ this.ensureSelectAllValue();
166
+ this.areAllSelected = false;
167
+ this.setData();
168
+ this.setFooterData();
169
+ this.selected = new Array(this.rowData.length).fill(false);
170
+ this.sortTypeArray = this.columns ? this.columns.map(() => null) : [];
171
+ }
118
172
  }
119
173
  ensureSelectAllValue() {
120
174
  if (this.selectAllValue !== undefined) {
@@ -134,35 +188,1038 @@ export class Table {
134
188
  this.selectAllValue = `select-all-${Table.selectAllSeq}`;
135
189
  this.el.setAttribute('data-select-all-value', this.selectAllValue);
136
190
  }
137
- ensureSortTypeArray() {
191
+ componentDidLoad() {
192
+ if (!this.isLegacyMode) {
193
+ this.syncCompositionalLayout();
194
+ }
195
+ }
196
+ componentDidUpdate() {
197
+ if (!this.isLegacyMode) {
198
+ this.syncCompositionalLayout();
199
+ }
200
+ }
201
+ disconnectedCallback() {
202
+ this.clearPendingDragListeners();
203
+ this.detachReorderHandleKeydownListeners();
204
+ this.reorderKeyboardTimers.dispose();
205
+ if (this.reorderAnnounceRaf !== undefined) {
206
+ cancelAnimationFrame(this.reorderAnnounceRaf);
207
+ this.reorderAnnounceRaf = undefined;
208
+ }
209
+ }
210
+ handleHeaderCellColumnWidthsChange(ev) {
211
+ if (this.isLegacyMode)
212
+ return;
213
+ const t = ev.target;
214
+ if (!(t instanceof Node) || !this.el.contains(t))
215
+ return;
216
+ this.updateColumnWidths();
217
+ }
218
+ handleCompositionalCheckboxChange(ev) {
219
+ if (this.isLegacyMode || !this.selectable)
220
+ return;
221
+ if (!this.isEventFromThisTable(ev.target))
222
+ return;
223
+ const path = ev.composedPath?.() ?? [];
224
+ let checkboxHost = (path.length > 0 ? path : [ev.target].filter((n) => n != null)).find((n) => n instanceof HTMLElement && n.tagName.toLowerCase() === 'xpl-checkbox');
225
+ if (!checkboxHost &&
226
+ ev.target &&
227
+ typeof ev.target.closest === 'function') {
228
+ checkboxHost = ev.target.closest('xpl-checkbox') ?? undefined;
229
+ }
230
+ if (!checkboxHost || !this.el.contains(checkboxHost))
231
+ return;
232
+ const row = checkboxHost.closest('xpl-table-row');
233
+ if (!row || !this.isDirectChildBodyRow(row))
234
+ return;
235
+ const cell = checkboxHost.closest('xpl-table-cell');
236
+ if (!cell)
237
+ return;
238
+ const selectionIdx = this.getSelectionColumnIndex();
239
+ if (selectionIdx === null)
240
+ return;
241
+ const bodyCells = Table.getBodyRowCells(row);
242
+ const colIdx = bodyCells.indexOf(cell);
243
+ if (colIdx !== selectionIdx)
244
+ return;
245
+ ev.stopPropagation();
246
+ const rowId = Table.getRowIdForRow(row);
247
+ if (!rowId || row.disabled)
248
+ return;
249
+ const input = checkboxHost.querySelector('input[type="checkbox"]');
250
+ if (!input)
251
+ return;
252
+ const { checked } = input;
253
+ if (checked) {
254
+ if (!this.selectedRowIds.includes(rowId)) {
255
+ this.selectedRowIds = [...this.selectedRowIds, rowId];
256
+ }
257
+ }
258
+ else {
259
+ this.selectedRowIds = this.selectedRowIds.filter((id) => id !== rowId);
260
+ }
261
+ this.applyHeaderCheckboxState();
262
+ this.syncRowSelectedProps();
263
+ this.emitCompositionalSelection();
264
+ }
265
+ handleCompositionalHeaderCheckboxChange(ev) {
266
+ if (this.isLegacyMode || !this.selectable)
267
+ return;
268
+ if (!this.isEventFromThisTable(ev.target))
269
+ return;
270
+ const path = ev.composedPath?.() ?? [];
271
+ let headerCell = (path.length > 0 ? path : [ev.target].filter((n) => n != null)).find((n) => n instanceof HTMLElement &&
272
+ n.tagName.toLowerCase() === 'xpl-table-header-cell' &&
273
+ n.getAttribute('type') === 'checkbox');
274
+ if (!headerCell && ev.target && typeof ev.target.closest === 'function') {
275
+ const maybeCell = ev.target.closest('xpl-table-header-cell[type="checkbox"]');
276
+ if (maybeCell instanceof HTMLElement) {
277
+ headerCell = maybeCell;
278
+ }
279
+ }
280
+ if (!headerCell || !this.el.contains(headerCell))
281
+ return;
282
+ if (!this.isCellInOurCompositionalHeader(headerCell))
283
+ return;
284
+ const headerCells = this.getCompositionalHeaderCells();
285
+ if (!headerCells.includes(headerCell))
286
+ return;
287
+ const checked = !!ev.detail;
288
+ const selectableRows = this.querySelectableBodyRows();
289
+ const ids = selectableRows
290
+ .map((r) => Table.getRowIdForRow(r))
291
+ .filter((id) => !!id);
292
+ if (checked) {
293
+ this.selectedRowIds = [...ids];
294
+ }
295
+ else {
296
+ this.selectedRowIds = [];
297
+ }
298
+ this.applyBodyCheckboxStates();
299
+ this.syncRowSelectedProps();
300
+ this.emitCompositionalSelection();
301
+ }
302
+ handlePointerDownExitKeyboardReorder(ev) {
303
+ if (this.isLegacyMode || !this.rowReorderable || this.keyboardReorderRowId === null) {
304
+ return;
305
+ }
306
+ const t = ev.target;
307
+ if (!(t instanceof Node) || !this.el.contains(t)) {
308
+ return;
309
+ }
310
+ const row = t instanceof Element ? t.closest('xpl-table-row') : null;
311
+ if (!row || !this.isDirectChildBodyRow(row)) {
312
+ return;
313
+ }
314
+ this.keyboardReorderRowId = null;
315
+ this.syncReorderHandleKeyboardA11y(null);
316
+ }
317
+ handleReorderHandleKeyDown(ev) {
318
+ if (this.isLegacyMode || !this.rowReorderable) {
319
+ return;
320
+ }
321
+ const rawPath = typeof ev.composedPath === 'function' ? ev.composedPath() : [];
322
+ const path = rawPath.length > 0 ? rawPath : ev.target ? [ev.target] : [];
323
+ let handle = path.find((n) => n instanceof HTMLElement && n.classList.contains('xpl-table__row-drag-handle'));
324
+ if (!handle &&
325
+ ev.target instanceof HTMLElement &&
326
+ ev.target.classList.contains('xpl-table__row-drag-handle')) {
327
+ handle = ev.target;
328
+ }
329
+ if (!handle || !this.el.contains(handle)) {
330
+ return;
331
+ }
332
+ const row = handle.closest('xpl-table-row');
333
+ if (!row || !this.isDirectChildBodyRow(row)) {
334
+ return;
335
+ }
336
+ const rowId = Table.getRowIdForRow(row) ?? '';
337
+ if (!rowId) {
338
+ return;
339
+ }
340
+ const isKbd = this.keyboardReorderRowId === rowId;
341
+ const isEscapeKey = ev.key === 'Escape' ||
342
+ ev.key === 'Esc' ||
343
+ ev.code === 'Escape' ||
344
+ ev.keyCode === 27;
345
+ if (row.disabled) {
346
+ if (isEscapeKey && isKbd) {
347
+ ev.preventDefault();
348
+ this.keyboardReorderRowId = null;
349
+ this.syncReorderHandleKeyboardA11y(null);
350
+ }
351
+ return;
352
+ }
353
+ if (isEscapeKey) {
354
+ if (isKbd) {
355
+ ev.preventDefault();
356
+ this.keyboardReorderRowId = null;
357
+ this.syncReorderHandleKeyboardA11y(null);
358
+ }
359
+ return;
360
+ }
361
+ if (!isKbd) {
362
+ if (ev.key === 'Enter' || ev.key === ' ') {
363
+ ev.preventDefault();
364
+ this.keyboardReorderRowId = rowId;
365
+ this.syncReorderHandleKeyboardA11y(rowId);
366
+ }
367
+ return;
368
+ }
369
+ if (ev.key === 'ArrowUp' || ev.key === 'ArrowDown') {
370
+ ev.preventDefault();
371
+ const dir = ev.key === 'ArrowUp' ? 'up' : 'down';
372
+ this.performKeyboardRowReorder(rowId, dir);
373
+ }
374
+ }
375
+ handleRowReorderPointerDown(ev) {
376
+ if (this.isLegacyMode || !this.rowReorderable) {
377
+ return;
378
+ }
379
+ const handle = reorderDragHandleFromEvent(ev);
380
+ if (!handle) {
381
+ return;
382
+ }
383
+ const table = handle.closest('xpl-table');
384
+ if (table !== this.el) {
385
+ return;
386
+ }
387
+ const row = bodyRowFromDragTarget(handle);
388
+ if (!row || row.disabled) {
389
+ return;
390
+ }
391
+ const body = this.getDirectChildTableSection('xpl-table-body');
392
+ if (!body || row.parentElement !== body) {
393
+ return;
394
+ }
395
+ this.clearPendingDragListeners();
396
+ this.pendingDragRow = row;
397
+ const onPointerEnd = () => {
398
+ this.clearPendingDragListeners();
399
+ this.pendingDragRow = null;
400
+ };
401
+ document.addEventListener('pointerup', onPointerEnd, true);
402
+ document.addEventListener('pointercancel', onPointerEnd, true);
403
+ this.pointerUpClearPending = () => {
404
+ document.removeEventListener('pointerup', onPointerEnd, true);
405
+ document.removeEventListener('pointercancel', onPointerEnd, true);
406
+ };
407
+ }
408
+ handleRowReorderDragStart(ev) {
409
+ if (this.isLegacyMode || !this.rowReorderable) {
410
+ return;
411
+ }
412
+ const row = tableBodyRowFromEvent(ev);
413
+ if (!row) {
414
+ return;
415
+ }
416
+ if (row.closest('xpl-table') !== this.el) {
417
+ return;
418
+ }
419
+ const body = this.getDirectChildTableSection('xpl-table-body');
420
+ if (!body || row.parentElement !== body) {
421
+ return;
422
+ }
423
+ if (row.disabled || this.pendingDragRow !== row) {
424
+ ev.preventDefault();
425
+ return;
426
+ }
427
+ this.keyboardReorderRowId = null;
428
+ this.syncReorderHandleKeyboardA11y(null);
429
+ this.clearPendingDragListeners();
430
+ this.pendingDragRow = null;
431
+ this.draggedRow = row;
432
+ if (ev.dataTransfer) {
433
+ ev.dataTransfer.effectAllowed = 'move';
434
+ ev.dataTransfer.setData('text/plain', Table.getRowIdForRow(row) ?? '');
435
+ }
436
+ row.classList.add('xpl-table-row--dragging');
437
+ }
438
+ handleRowReorderDragEnd(ev) {
439
+ if (this.isLegacyMode || !this.rowReorderable) {
440
+ return;
441
+ }
442
+ const row = tableBodyRowFromEvent(ev);
443
+ if (!row || row.closest('xpl-table') !== this.el) {
444
+ return;
445
+ }
446
+ row.classList.remove('xpl-table-row--dragging');
447
+ this.clearReorderDragOverClasses();
448
+ this.draggedRow = null;
449
+ }
450
+ handleRowReorderDragOver(ev) {
451
+ if (this.isLegacyMode || !this.rowReorderable) {
452
+ return;
453
+ }
454
+ const row = tableBodyRowFromEvent(ev);
455
+ if (!row || row.closest('xpl-table') !== this.el) {
456
+ return;
457
+ }
458
+ const body = this.getDirectChildTableSection('xpl-table-body');
459
+ if (!body || row.parentElement !== body || row.disabled) {
460
+ return;
461
+ }
462
+ ev.preventDefault();
463
+ if (ev.dataTransfer) {
464
+ ev.dataTransfer.dropEffect = 'move';
465
+ }
466
+ }
467
+ handleRowReorderDragEnter(ev) {
468
+ if (this.isLegacyMode || !this.rowReorderable) {
469
+ return;
470
+ }
471
+ const row = tableBodyRowFromEvent(ev);
472
+ if (!row || row.closest('xpl-table') !== this.el) {
473
+ return;
474
+ }
475
+ const body = this.getDirectChildTableSection('xpl-table-body');
476
+ if (!body || row.parentElement !== body || row.disabled) {
477
+ return;
478
+ }
479
+ ev.preventDefault();
480
+ row.classList.add('xpl-table-row--drag-over');
481
+ }
482
+ handleRowReorderDragLeave(ev) {
483
+ if (this.isLegacyMode || !this.rowReorderable) {
484
+ return;
485
+ }
486
+ const row = tableBodyRowFromEvent(ev);
487
+ if (!row || row.closest('xpl-table') !== this.el) {
488
+ return;
489
+ }
490
+ const related = ev.relatedTarget;
491
+ if (related && row.contains(related)) {
492
+ return;
493
+ }
494
+ row.classList.remove('xpl-table-row--drag-over');
495
+ }
496
+ handleRowReorderDrop(ev) {
497
+ if (this.isLegacyMode || !this.rowReorderable) {
498
+ return;
499
+ }
500
+ ev.preventDefault();
501
+ const dropRow = tableBodyRowFromEvent(ev);
502
+ if (!dropRow || dropRow.closest('xpl-table') !== this.el) {
503
+ return;
504
+ }
505
+ const body = this.getDirectChildTableSection('xpl-table-body');
506
+ if (!body || dropRow.parentElement !== body || dropRow.disabled) {
507
+ return;
508
+ }
509
+ const source = this.draggedRow;
510
+ if (!source || source.disabled) {
511
+ this.draggedRow = null;
512
+ this.clearReorderDragOverClasses();
513
+ return;
514
+ }
515
+ if (source === dropRow) {
516
+ this.clearReorderDragOverClasses();
517
+ return;
518
+ }
519
+ const visible = this.getVisibleBodyRowsForReorder();
520
+ const fromIndex = visible.indexOf(source);
521
+ const toIndex = visible.indexOf(dropRow);
522
+ if (fromIndex === -1 || toIndex === -1) {
523
+ this.clearReorderDragOverClasses();
524
+ return;
525
+ }
526
+ const direction = fromIndex > toIndex ? 'up' : 'down';
527
+ const rowId = Table.getRowIdForRow(source) ?? '';
528
+ const runMove = () => {
529
+ moveRowInTableBody(body, source, dropRow);
530
+ };
531
+ runMove();
532
+ const orderedRowIds = this.getVisibleBodyRowsForReorder().map((r) => Table.getRowIdForRow(r) ?? '');
533
+ this.rowOrderChange.emit({
534
+ rowId,
535
+ direction,
536
+ orderedRowIds,
537
+ fromIndex,
538
+ toIndex,
539
+ });
540
+ this.announceRowReorder(rowId, orderedRowIds);
541
+ this.clearReorderDragOverClasses();
542
+ if (this.selectable) {
543
+ this.applyBodyCheckboxStates();
544
+ this.applyHeaderCheckboxState();
545
+ this.syncRowSelectedProps();
546
+ }
547
+ this.updateColumnWidths();
548
+ }
549
+ get isLegacyMode() {
550
+ return this.columns !== undefined || this.data !== undefined || this.footer !== undefined;
551
+ }
552
+ ensureTableInstanceId() {
553
+ if (this.tableInstanceId)
554
+ return;
555
+ if (typeof crypto !== 'undefined' && crypto.randomUUID) {
556
+ this.tableInstanceId = crypto.randomUUID();
557
+ }
558
+ else {
559
+ this.tableInstanceId = Math.random().toString(36).slice(2);
560
+ }
561
+ }
562
+ generateRowId() {
563
+ this.ensureTableInstanceId();
564
+ if (typeof crypto !== 'undefined' && crypto.randomUUID) {
565
+ return `${this.tableInstanceId}-${crypto.randomUUID()}`;
566
+ }
567
+ return `${this.tableInstanceId}-${Math.random().toString(36).slice(2)}`;
568
+ }
569
+ syncCompositionalLayout() {
570
+ if (this.isLegacyMode)
571
+ return;
572
+ if (this.rowReorderable) {
573
+ this.syncReorderColumn();
574
+ }
575
+ else {
576
+ this.removeManagedReorderCells();
577
+ }
578
+ if (this.selectable) {
579
+ this.ensureTableInstanceId();
580
+ this.pruneStaleSelectedRowIds();
581
+ this.ensureBodyRowIds();
582
+ this.applyBodyCheckboxStates();
583
+ this.applyHeaderCheckboxState();
584
+ this.syncRowSelectedProps();
585
+ }
586
+ if (this.rowReorderable && this.selectable) {
587
+ this.normalizeManagedColumnsOrder();
588
+ }
589
+ this.updateColumnWidths();
590
+ }
591
+ getDirectChildTableSection(tag) {
592
+ const el = Array.from(this.el.children).find((c) => c.tagName.toLowerCase() === tag);
593
+ return el ?? null;
594
+ }
595
+ isDirectChildBodyRow(row) {
596
+ const body = this.getDirectChildTableSection('xpl-table-body');
597
+ return body !== null && row.parentElement === body;
598
+ }
599
+ isCellInOurCompositionalHeader(cell) {
600
+ const header = cell.closest('xpl-table-header');
601
+ return header !== null && header.parentElement === this.el;
602
+ }
603
+ getSelectionColumnIndex() {
604
+ const headerCells = this.getCompositionalHeaderCells();
605
+ const idx = headerCells.findIndex((c) => c.getAttribute('type') === 'checkbox');
606
+ return idx >= 0 ? idx : null;
607
+ }
608
+ static getBodyRowCells(row) {
609
+ return Array.from(row.children).filter((c) => c.tagName.toLowerCase() === 'xpl-table-cell');
610
+ }
611
+ queryBodyRows() {
612
+ const body = this.getDirectChildTableSection('xpl-table-body');
613
+ if (!body)
614
+ return [];
615
+ return Array.from(body.children).filter((c) => c.tagName.toLowerCase() === 'xpl-table-row');
616
+ }
617
+ querySelectableBodyRows() {
618
+ return this.queryBodyRows().filter((row) => !row.disabled);
619
+ }
620
+ static getRowIdForRow(row) {
621
+ const id = row.getAttribute('row-id')?.trim();
622
+ return id || null;
623
+ }
624
+ ensureBodyRowIds() {
625
+ this.queryBodyRows().forEach((row) => {
626
+ if (Table.getRowIdForRow(row))
627
+ return;
628
+ row.setAttribute('row-id', this.generateRowId());
629
+ });
630
+ }
631
+ removeManagedReorderCells() {
632
+ this.el.querySelectorAll(`[${ROW_REORDER_MARK}]`).forEach((node) => {
633
+ if (!(node instanceof Element))
634
+ return;
635
+ if (node.closest('xpl-table') !== this.el)
636
+ return;
637
+ node.parentElement?.removeChild(node);
638
+ });
639
+ }
640
+ getSelectionSlotCellForReorderOrder(row) {
641
+ const idx = this.getSelectionColumnIndex();
642
+ if (idx === null) {
643
+ return null;
644
+ }
645
+ const cells = Array.from(row.children);
646
+ const cell = cells[idx];
647
+ if (!cell) {
648
+ return null;
649
+ }
650
+ const tag = cell.tagName.toLowerCase();
651
+ if (tag === 'xpl-table-header-cell') {
652
+ return cell.getAttribute('type') === 'checkbox' ? cell : null;
653
+ }
654
+ if (tag === 'xpl-table-cell') {
655
+ if (cell.hasAttribute(SELECTION_MARK)) {
656
+ return cell;
657
+ }
658
+ return cell.querySelector('xpl-checkbox') ? cell : null;
659
+ }
660
+ if (tag === 'xpl-table-footer-cell') {
661
+ return cell;
662
+ }
663
+ return null;
664
+ }
665
+ normalizeManagedColumnsOrder() {
666
+ const fix = (row) => {
667
+ const re = row.querySelector(`:scope > [${ROW_REORDER_MARK}]`);
668
+ const se = this.getSelectionSlotCellForReorderOrder(row);
669
+ if (!re || !se) {
670
+ return;
671
+ }
672
+ const siblings = Array.from(row.children);
673
+ const iRe = siblings.indexOf(re);
674
+ const iSe = siblings.indexOf(se);
675
+ if (iRe > iSe) {
676
+ row.insertBefore(re, se);
677
+ }
678
+ };
679
+ const header = Array.from(this.el.children).find((c) => c.tagName.toLowerCase() === 'xpl-table-header') ?? null;
680
+ if (header) {
681
+ const firstRow = Array.from(header.children).find((c) => c.tagName.toLowerCase() === 'xpl-table-row');
682
+ const container = firstRow ?? header;
683
+ fix(container);
684
+ }
685
+ this.queryBodyRows().forEach((row) => fix(row));
686
+ const footer = this.getDirectChildTableSection('xpl-table-footer');
687
+ if (footer) {
688
+ Array.from(footer.children)
689
+ .filter((c) => c.tagName.toLowerCase() === 'xpl-table-row')
690
+ .forEach((row) => fix(row));
691
+ }
692
+ }
693
+ syncReorderColumn() {
694
+ if (!this.rowReorderable || this.isLegacyMode)
695
+ return;
696
+ this.ensureBodyRowIds();
697
+ this.ensureHeaderReorderCell();
698
+ this.ensureBodyReorderCells();
699
+ this.ensureFooterReorderCells();
700
+ this.applyReorderRowDraggableState();
701
+ }
702
+ ensureHeaderReorderCell() {
703
+ const header = Array.from(this.el.children).find((c) => c.tagName.toLowerCase() === 'xpl-table-header') ?? null;
704
+ if (!header)
705
+ return;
706
+ const firstRow = Array.from(header.children).find((c) => c.tagName.toLowerCase() === 'xpl-table-row');
707
+ const container = firstRow ?? header;
708
+ if (Array.from(container.children).some((c) => c.tagName.toLowerCase() === 'xpl-table-header-cell' &&
709
+ c.hasAttribute(ROW_REORDER_MARK))) {
710
+ return;
711
+ }
712
+ const cell = document.createElement('xpl-table-header-cell');
713
+ cell.setAttribute(ROW_REORDER_MARK, '');
714
+ cell.setAttribute('type', 'empty');
715
+ cell.setAttribute('width', '48');
716
+ cell.setAttribute('align', 'center');
717
+ container.insertBefore(cell, container.firstChild);
718
+ }
719
+ ensureBodyReorderCells() {
720
+ this.queryBodyRows().forEach((row) => {
721
+ const managed = Array.from(row.children).filter((c) => c.tagName.toLowerCase() === 'xpl-table-cell' &&
722
+ c.hasAttribute(ROW_REORDER_MARK));
723
+ if (managed.length > 1) {
724
+ for (let i = 1; i < managed.length; i += 1) {
725
+ managed[i].remove();
726
+ }
727
+ }
728
+ let cell = managed[0];
729
+ if (!cell) {
730
+ const newCell = document.createElement('xpl-table-cell');
731
+ newCell.setAttribute(ROW_REORDER_MARK, '');
732
+ newCell.setAttribute('width', '48');
733
+ newCell.setAttribute('align', 'center');
734
+ const btn = document.createElement('button');
735
+ btn.type = 'button';
736
+ btn.className = 'xpl-table__row-drag-handle';
737
+ btn.setAttribute('aria-label', 'Reorder row');
738
+ btn.setAttribute('aria-pressed', 'false');
739
+ const iconName = this.getResolvedIconForRow(Table.getRowIdForRow(row) ?? '');
740
+ if (iconName) {
741
+ const icon = document.createElement('xpl-icon');
742
+ icon.setAttribute('icon', iconName);
743
+ icon.setAttribute('size', '16');
744
+ btn.appendChild(icon);
745
+ }
746
+ newCell.appendChild(btn);
747
+ row.insertBefore(newCell, row.firstChild);
748
+ cell = newCell;
749
+ }
750
+ else {
751
+ cell.setAttribute('align', 'center');
752
+ }
753
+ const btn = cell.querySelector('.xpl-table__row-drag-handle');
754
+ if (btn) {
755
+ btn.disabled = row.disabled;
756
+ }
757
+ });
758
+ this.syncInjectedReorderHandleIcons();
759
+ this.attachReorderHandleKeydownListeners();
760
+ }
761
+ getResolvedIconForRow(rowId) {
762
+ const inKeyboardMode = this.keyboardReorderRowId !== null &&
763
+ rowId !== '' &&
764
+ rowId === this.keyboardReorderRowId;
765
+ if (inKeyboardMode) {
766
+ if (this.reorderHandleIconKeyboard === '') {
767
+ return null;
768
+ }
769
+ return this.reorderHandleIconKeyboard ?? 'caret-expand-y';
770
+ }
771
+ if (this.reorderHandleIcon === '') {
772
+ return null;
773
+ }
774
+ return this.reorderHandleIcon ?? 'grip-dots-vertical';
775
+ }
776
+ syncInjectedReorderHandleIcons() {
777
+ this.queryBodyRows().forEach((row) => {
778
+ const btn = row.querySelector('.xpl-table__row-drag-handle');
779
+ if (!btn) {
780
+ return;
781
+ }
782
+ const rowId = Table.getRowIdForRow(row) ?? '';
783
+ const iconName = this.getResolvedIconForRow(rowId);
784
+ btn.querySelectorAll('xpl-icon').forEach((n) => n.remove());
785
+ if (iconName) {
786
+ const icon = document.createElement('xpl-icon');
787
+ icon.setAttribute('icon', iconName);
788
+ icon.setAttribute('size', '16');
789
+ btn.appendChild(icon);
790
+ }
791
+ });
792
+ }
793
+ syncReorderHandleKeyboardA11y(activeId) {
794
+ if (this.isLegacyMode || !this.rowReorderable) {
795
+ return;
796
+ }
797
+ this.queryBodyRows().forEach((row) => {
798
+ const btn = row.querySelector('.xpl-table__row-drag-handle');
799
+ if (!btn) {
800
+ return;
801
+ }
802
+ const rid = Table.getRowIdForRow(row) ?? '';
803
+ const isActive = activeId !== null && rid === activeId;
804
+ btn.classList.toggle('xpl-table__row-drag-handle--keyboard-mode', isActive);
805
+ btn.setAttribute('aria-pressed', isActive ? 'true' : 'false');
806
+ btn.setAttribute('aria-label', isActive
807
+ ? 'Press arrow up or down to reorder, Escape to exit'
808
+ : 'Press Enter or Space to activate keyboard reorder mode, or drag to reorder');
809
+ });
810
+ this.syncInjectedReorderHandleIcons();
811
+ }
812
+ attachReorderHandleKeydownListeners() {
813
+ if (this.isLegacyMode || !this.rowReorderable) {
814
+ return;
815
+ }
816
+ this.queryBodyRows().forEach((row) => {
817
+ const btn = row.querySelector('.xpl-table__row-drag-handle');
818
+ if (!btn || btn.dataset.xplReorderKbdBound === 'true') {
819
+ return;
820
+ }
821
+ btn.dataset.xplReorderKbdBound = 'true';
822
+ btn.addEventListener('keydown', this.onReorderHandleKeydown);
823
+ });
824
+ }
825
+ detachReorderHandleKeydownListeners() {
826
+ if (!this.el) {
827
+ return;
828
+ }
829
+ this.el
830
+ .querySelectorAll('.xpl-table__row-drag-handle[data-xpl-reorder-kbd-bound="true"]')
831
+ .forEach((btn) => {
832
+ btn.removeEventListener('keydown', this.onReorderHandleKeydown);
833
+ delete btn.dataset.xplReorderKbdBound;
834
+ });
835
+ }
836
+ performKeyboardRowReorder(rowId, direction) {
837
+ const body = this.getDirectChildTableSection('xpl-table-body');
838
+ if (!body) {
839
+ return false;
840
+ }
841
+ const visible = this.getVisibleBodyRowsForReorder();
842
+ const itemIndex = visible.findIndex((r) => Table.getRowIdForRow(r) === rowId);
843
+ if (itemIndex === -1) {
844
+ return false;
845
+ }
846
+ const targetIndex = direction === 'up' ? itemIndex - 1 : itemIndex + 1;
847
+ if (targetIndex < 0 || targetIndex >= visible.length) {
848
+ return false;
849
+ }
850
+ const fromIndex = itemIndex;
851
+ const item = visible[itemIndex];
852
+ const targetItem = visible[targetIndex];
853
+ if (direction === 'up') {
854
+ body.insertBefore(item, targetItem);
855
+ }
856
+ else {
857
+ const nextVisible = getNextVisibleTableBodyRowAfter(targetItem);
858
+ if (nextVisible) {
859
+ body.insertBefore(item, nextVisible);
860
+ }
861
+ else {
862
+ body.appendChild(item);
863
+ }
864
+ }
865
+ const orderedRowIds = this.getVisibleBodyRowsForReorder().map((r) => Table.getRowIdForRow(r) ?? '');
866
+ const toIndex = orderedRowIds.indexOf(rowId);
867
+ this.rowOrderChange.emit({
868
+ rowId,
869
+ direction,
870
+ orderedRowIds,
871
+ fromIndex,
872
+ toIndex,
873
+ });
874
+ this.announceRowReorder(rowId, orderedRowIds);
875
+ this.clearReorderDragOverClasses();
876
+ if (this.selectable) {
877
+ this.applyBodyCheckboxStates();
878
+ this.applyHeaderCheckboxState();
879
+ this.syncRowSelectedProps();
880
+ }
881
+ this.updateColumnWidths();
882
+ this.reorderKeyboardTimers.requestAnimationFrame(() => {
883
+ if (!this.el.isConnected) {
884
+ return;
885
+ }
886
+ const moved = this.getVisibleBodyRowsForReorder().find((r) => Table.getRowIdForRow(r) === rowId);
887
+ const btn = moved?.querySelector('.xpl-table__row-drag-handle');
888
+ btn?.focus();
889
+ });
890
+ return true;
891
+ }
892
+ ensureFooterReorderCells() {
893
+ const footer = this.getDirectChildTableSection('xpl-table-footer');
894
+ if (!footer)
895
+ return;
896
+ Array.from(footer.children)
897
+ .filter((c) => c.tagName.toLowerCase() === 'xpl-table-row')
898
+ .forEach((row) => {
899
+ if (Array.from(row.children).some((c) => c.tagName.toLowerCase() === 'xpl-table-footer-cell' &&
900
+ c.hasAttribute(ROW_REORDER_MARK))) {
901
+ return;
902
+ }
903
+ const cell = document.createElement('xpl-table-footer-cell');
904
+ cell.setAttribute(ROW_REORDER_MARK, '');
905
+ cell.setAttribute('width', '48');
906
+ cell.setAttribute('align', 'center');
907
+ row.insertBefore(cell, row.firstChild);
908
+ });
909
+ }
910
+ static supportsSubgridBodyRow() {
911
+ return (typeof CSS !== 'undefined' &&
912
+ typeof CSS.supports === 'function' &&
913
+ CSS.supports('grid-template-columns', 'subgrid'));
914
+ }
915
+ applyReorderRowDraggableState() {
916
+ const useRowDrag = Table.supportsSubgridBodyRow();
917
+ this.queryBodyRows().forEach((row) => {
918
+ const btn = row.querySelector('.xpl-table__row-drag-handle');
919
+ btn?.removeAttribute('draggable');
920
+ row.removeAttribute('draggable');
921
+ if (!this.rowReorderable || row.disabled) {
922
+ return;
923
+ }
924
+ if (!btn) {
925
+ return;
926
+ }
927
+ if (useRowDrag) {
928
+ row.setAttribute('draggable', 'true');
929
+ }
930
+ else {
931
+ btn.setAttribute('draggable', 'true');
932
+ }
933
+ });
934
+ }
935
+ getVisibleBodyRowsForReorder() {
936
+ return this.queryBodyRows().filter((r) => !r.hasAttribute('hidden'));
937
+ }
938
+ clearReorderDragOverClasses() {
939
+ this.queryBodyRows().forEach((r) => r.classList.remove('xpl-table-row--drag-over'));
940
+ }
941
+ clearPendingDragListeners() {
942
+ if (this.pointerUpClearPending) {
943
+ this.pointerUpClearPending();
944
+ this.pointerUpClearPending = null;
945
+ }
946
+ }
947
+ announceRowReorder(movedRowId, orderedRowIds) {
948
+ if (!this.rowReorderable || !movedRowId) {
949
+ return;
950
+ }
951
+ const index = orderedRowIds.indexOf(movedRowId);
952
+ if (index < 0) {
953
+ return;
954
+ }
955
+ this.reorderLiveMessage = '';
956
+ if (this.reorderAnnounceRaf !== undefined) {
957
+ cancelAnimationFrame(this.reorderAnnounceRaf);
958
+ }
959
+ this.reorderAnnounceRaf = requestAnimationFrame(() => {
960
+ this.reorderAnnounceRaf = undefined;
961
+ if (!this.el.isConnected) {
962
+ return;
963
+ }
964
+ this.reorderLiveMessage = `Row ${movedRowId}, now position ${index + 1} of ${orderedRowIds.length}`;
965
+ });
966
+ }
967
+ pruneStaleSelectedRowIds() {
968
+ const validIds = new Set(this.queryBodyRows()
969
+ .map((r) => Table.getRowIdForRow(r))
970
+ .filter((id) => !!id));
971
+ const next = this.selectedRowIds.filter((id) => validIds.has(id));
972
+ if (next.length === this.selectedRowIds.length)
973
+ return;
974
+ this.selectedRowIds = next;
975
+ this.applyBodyCheckboxStates();
976
+ this.applyHeaderCheckboxState();
977
+ this.syncRowSelectedProps();
978
+ this.emitCompositionalSelection();
979
+ }
980
+ static getBodyRowCheckboxAriaLabel(row, selectionColIndex) {
981
+ const cells = Table.getBodyRowCells(row);
982
+ const labelCell = cells.find((c, i) => (selectionColIndex === null || i !== selectionColIndex) &&
983
+ !c.hasAttribute(ROW_REORDER_MARK));
984
+ const first = labelCell ?? cells[0];
985
+ if (!first)
986
+ return 'Select row';
987
+ const raw = first.textContent?.replace(/\s+/g, ' ').trim() ?? '';
988
+ if (!raw)
989
+ return 'Select row';
990
+ const truncated = raw.length > 100 ? `${raw.slice(0, 100)}…` : raw;
991
+ return `Select row, ${truncated}`;
992
+ }
993
+ applyBodyCheckboxStates() {
994
+ const selectionIdx = this.getSelectionColumnIndex();
995
+ if (selectionIdx === null)
996
+ return;
997
+ this.queryBodyRows().forEach((row) => {
998
+ const rowId = Table.getRowIdForRow(row);
999
+ const cells = Table.getBodyRowCells(row);
1000
+ const cell = cells[selectionIdx];
1001
+ const cb = cell?.querySelector('xpl-checkbox');
1002
+ if (!cb || !rowId)
1003
+ return;
1004
+ cb.checked = this.selectedRowIds.includes(rowId);
1005
+ cb.disabled = row.disabled;
1006
+ cb.value = rowId;
1007
+ cb.setAttribute('aria-label', Table.getBodyRowCheckboxAriaLabel(row, selectionIdx));
1008
+ });
1009
+ }
1010
+ getHeaderCheckboxCell() {
1011
+ const idx = this.getSelectionColumnIndex();
1012
+ if (idx === null)
1013
+ return null;
1014
+ const cells = this.getCompositionalHeaderCells();
1015
+ const cell = cells[idx];
1016
+ if (!cell || cell.getAttribute('type') !== 'checkbox')
1017
+ return null;
1018
+ return cell;
1019
+ }
1020
+ applyHeaderCheckboxState() {
1021
+ const cell = this.getHeaderCheckboxCell();
1022
+ if (!cell)
1023
+ return;
1024
+ const selectableRows = this.querySelectableBodyRows();
1025
+ const ids = selectableRows
1026
+ .map((r) => Table.getRowIdForRow(r))
1027
+ .filter((id) => !!id);
1028
+ const selectedCount = ids.filter((id) => this.selectedRowIds.includes(id)).length;
1029
+ const allSelected = ids.length > 0 && selectedCount === ids.length;
1030
+ const indeterminate = selectedCount > 0 && !allSelected;
1031
+ cell.checked = allSelected;
1032
+ cell.indeterminate = indeterminate;
1033
+ }
1034
+ syncRowSelectedProps() {
1035
+ this.queryBodyRows().forEach((row) => {
1036
+ const id = Table.getRowIdForRow(row);
1037
+ const selected = id ? this.selectedRowIds.includes(id) : false;
1038
+ row.selected = selected;
1039
+ });
1040
+ }
1041
+ emitCompositionalSelection() {
1042
+ const ids = this.selectedRowIds;
1043
+ const key = ids.join('\u0001');
1044
+ if (key === this.lastEmittedRowSelectionKey) {
1045
+ return;
1046
+ }
1047
+ this.lastEmittedRowSelectionKey = key;
1048
+ this.rowSelectionChange.emit({ selectedRowIds: [...ids] });
1049
+ }
1050
+ isEventFromThisTable(target) {
1051
+ if (target == null || typeof target !== 'object')
1052
+ return false;
1053
+ const t = target;
1054
+ const start = 'closest' in t && typeof t.closest === 'function'
1055
+ ? t
1056
+ : 'parentElement' in t
1057
+ ? t.parentElement
1058
+ : null;
1059
+ if (!start)
1060
+ return false;
1061
+ const nearest = start.closest('xpl-table');
1062
+ return nearest === this.el;
1063
+ }
1064
+ static sortKeyFromHeaderCell(cell, columnIndex) {
1065
+ const c = cell;
1066
+ const raw = (c.sortKey ?? c.label ?? '').trim();
1067
+ if (raw.length > 0) {
1068
+ return raw.replace(/ /g, '-').toLowerCase();
1069
+ }
1070
+ return `column-${columnIndex}`;
1071
+ }
1072
+ handleCompositionalHeaderSort(ev) {
1073
+ if (this.isLegacyMode)
1074
+ return;
1075
+ if (!this.isEventFromThisTable(ev.target))
1076
+ return;
1077
+ ev.stopPropagation();
1078
+ const source = ev.target;
1079
+ const headerRow = source.closest('xpl-table-header xpl-table-row') ?? source.closest('xpl-table-row');
1080
+ if (!headerRow || !this.el.contains(headerRow))
1081
+ return;
1082
+ const cells = Array.from(headerRow.querySelectorAll('xpl-table-header-cell'));
1083
+ const { columnIndex } = ev.detail;
1084
+ const target = cells[columnIndex];
1085
+ if (!target?.sortable)
1086
+ return;
1087
+ const next = cycleSortDirection(target.sortDirection);
1088
+ cells.forEach((cell, i) => {
1089
+ const hc = cell;
1090
+ if (!hc.sortable)
1091
+ return;
1092
+ hc.sortDirection = i === columnIndex ? next : null;
1093
+ });
1094
+ const sortState = {};
1095
+ cells.forEach((cell, i) => {
1096
+ const hc = cell;
1097
+ if (!hc.sortable)
1098
+ return;
1099
+ sortState[Table.sortKeyFromHeaderCell(hc, i)] = hc.sortDirection ?? null;
1100
+ });
1101
+ const sortTypeArr = cells.map((cell) => {
1102
+ const hc = cell;
1103
+ return hc.sortable ? (hc.sortDirection ?? null) : null;
1104
+ });
1105
+ const colName = Table.sortKeyFromHeaderCell(cells[columnIndex], columnIndex);
1106
+ const detail = {
1107
+ ...sortState,
1108
+ colNum: columnIndex,
1109
+ colName,
1110
+ sortTypeArr,
1111
+ };
1112
+ this.sortChanged.emit(detail);
1113
+ }
1114
+ legacySortStatePayload() {
1115
+ const out = {};
1116
+ if (!this.columns?.length)
1117
+ return out;
1118
+ this.columns.forEach((col, i) => {
1119
+ const key = col.replace(/ /g, '-').toLowerCase();
1120
+ out[key] = this.sortTypeArray[i] ?? null;
1121
+ });
1122
+ return out;
1123
+ }
1124
+ legacySortChangedDetail(colNum) {
1125
+ const base = this.legacySortStatePayload();
1126
+ const title = this.columns?.[colNum] ?? '';
1127
+ const colName = title.replace(/ /g, '-').toLowerCase();
1128
+ return {
1129
+ ...base,
1130
+ colNum,
1131
+ colName,
1132
+ sortTypeArr: [...this.sortTypeArray],
1133
+ };
1134
+ }
1135
+ getCompositionalHeaderCells() {
1136
+ const header = Array.from(this.el.children).find((c) => c.tagName.toLowerCase() === 'xpl-table-header') ?? null;
1137
+ if (!header)
1138
+ return [];
1139
+ const firstRow = Array.from(header.children).find((c) => c.tagName.toLowerCase() === 'xpl-table-row');
1140
+ const container = firstRow ?? header;
1141
+ return Array.from(container.children).filter((c) => c.tagName.toLowerCase() === 'xpl-table-header-cell');
1142
+ }
1143
+ updateColumnWidths() {
1144
+ const headerCells = this.getCompositionalHeaderCells();
1145
+ const columnWidths = headerCells.map((cell) => getGridColumnWidthFromHeaderCell(cell));
1146
+ const next = columnWidths.join(' ');
1147
+ const n = headerCells.length;
1148
+ if (n === this.colCount && this.colCount > 0 && this.columnWidthsToken === next) {
1149
+ return;
1150
+ }
1151
+ this.el.style.setProperty('--column-widths', next);
1152
+ this.colCount = n;
1153
+ this.columnWidthsToken = next;
1154
+ }
1155
+ handleSort(clickEvt, isColumnSortable, colNum) {
1156
+ clickEvt.preventDefault();
1157
+ clickEvt.stopPropagation();
1158
+ if (!isColumnSortable)
1159
+ return;
1160
+ this.sortTypeArray = this.sortTypeArray.map((val, i) => {
1161
+ if (i !== colNum)
1162
+ return null;
1163
+ switch (val) {
1164
+ case 'asc':
1165
+ return 'desc';
1166
+ case 'desc':
1167
+ return null;
1168
+ default:
1169
+ return 'asc';
1170
+ }
1171
+ });
1172
+ const evt = this.sortChanged.emit(this.legacySortChangedDetail(colNum));
1173
+ if (!evt.defaultPrevented)
1174
+ this.sortBy(colNum, this.sortTypeArray);
1175
+ }
1176
+ renderLegacy() {
138
1177
  if (this.columns &&
139
1178
  (!this.sortTypeArray || this.sortTypeArray.length !== this.columns.length)) {
140
1179
  this.sortTypeArray = this.columns.map(() => null);
141
1180
  }
142
- else if (!this.columns) {
143
- this.sortTypeArray = [];
144
- }
145
- }
146
- render() {
147
- const rowFooterData = this.footer !== undefined ? Array.from(this.footer) : [];
148
- return (h(Host, { key: '1e6bf436320a44e1e22e8590a881bc90c4a091d5' }, h("div", { key: '3d2e5361fbe615a6ae8ebe916ce07e00f82c444c', class: "xpl-table-container", onScroll: this.onScroll, ref: (el) => {
1181
+ return (h(Host, null, h("div", { class: "xpl-table-container", onScroll: this.onLegacyScroll, ref: (el) => {
149
1182
  if (el)
150
1183
  this.container = el;
151
- } }, h("table", { key: '036672b3ba45a90a42f906c155ce3d59e33c8a7a', class: {
1184
+ } }, h("table", { class: {
152
1185
  'xpl-table': true,
1186
+ 'xpl-table--legacy': true,
153
1187
  'xpl-table--striped': !!this.striped,
154
1188
  'xpl-table--freeze': !!this.freeze,
155
1189
  'xpl-table--has-scrolled': this.hasScrolled,
156
- } }, this.columns && (h("thead", { key: 'bf0d5a808624234ba985c1c32064f1dab11bfefa' }, this.columns.map((column, i) => {
157
- const iconType = getIconType(this.sortTypeArray?.[i]);
158
- const isColumnSortable = !!(this.isSortable && this.sortableColumns[i]);
159
- return (h("th", null, h("label", { onClick: (e) => this.handleSort(e, isColumnSortable, i, column.replace(/ /g, '-').toLowerCase()), class: isColumnSortable ? 'cursor-pointer' : '' }, this.multiselect && i === 0 && (h("xpl-checkbox", { checked: this.areAllSelected, indeterminate: !this.areAllSelected &&
160
- this.selected.some((a) => a), onClick: (e) => e.stopPropagation(), onCheckboxChange: (e) => this.selectAll(e), value: this.selectAllValue, "aria-label": "Select all rows" })), column, isColumnSortable && !!this.sortTypeArray[i] && (h("xpl-icon", { icon: iconType, size: 16 })))));
161
- }))), h("tbody", { key: '7915dbfbf1a9b68719c4168e09c5f0e3ab7fa35a' }, this.rowData.map((row, rowNum) => (h("tr", { class: this.selected && this.selected[rowNum]
1190
+ } }, this.columns && (h("thead", null, this.columns.map((column, i) => {
1191
+ const iconType = getIconType(this.sortTypeArray?.[i] ?? null);
1192
+ const isColumnSortable = !!(this.isSortable && this.sortableColumns?.[i]);
1193
+ return (h("th", null, h("label", { onClick: (e) => this.handleSort(e, isColumnSortable, i), class: isColumnSortable ? 'cursor-pointer' : '' }, this.multiselect && i === 0 && (h("input", { checked: this.areAllSelected, id: "__xpl-table-th", indeterminate: !this.areAllSelected &&
1194
+ this.selected.some((a) => a), onClick: (e) => {
1195
+ e.stopPropagation();
1196
+ this.selectAll(e);
1197
+ }, type: "checkbox", value: this.selectAllValue })), column, isColumnSortable && !!this.sortTypeArray[i] && (h("xpl-icon", { icon: iconType, size: 16 })))));
1198
+ }))), h("tbody", null, this.rowData.map((row, rowNum) => (h("tr", { class: this.selected && this.selected[rowNum]
162
1199
  ? 'xpl-table-row-selected'
163
- : '' }, row.map((cell, i) => (h("td", null, this.multiselect && i === 0 ? (h("label", null, h("xpl-checkbox", { checked: !!this.selected[rowNum], onCheckboxChange: (e) => this.selectOne(e, rowNum), value: this.selectedValues.length > 0
1200
+ : '' }, row.map((cell, i) => (h("td", null, this.multiselect && i === 0 ? (h("label", { htmlFor: `__xpl-table-row-${rowNum}` }, h("input", { id: `__xpl-table-row-${rowNum}`, checked: !!this.selected[rowNum], type: "checkbox", onChange: (e) => this.selectOne(e, rowNum), value: this.selectedValues &&
1201
+ this.selectedValues.length > 0
164
1202
  ? this.selectedValues[rowNum]
165
- : `xpl-table-checkbox-${rowNum}`, "aria-label": `Select row ${rowNum + 1}` }), h("div", { innerHTML: cell }))) : (h("div", { innerHTML: cell }))))))))), rowFooterData.length > 0 && (h("tfoot", { key: '78ee72f80c77e61c6234be9500770780952ca669' }, rowFooterData.map((row) => (h("tr", null, row.map((cell) => (h("td", null, h("div", { innerHTML: cell })))))))))))));
1203
+ : `xpl-table-checkbox-${rowNum}` }), h("div", { innerHTML: cell }))) : (h("div", { innerHTML: cell }))))))))), this.rowFooterData?.length > 0 && (h("tfoot", null, this.rowFooterData.map((row) => (h("tr", null, row.map((cell) => (h("td", null, h("div", { innerHTML: cell })))))))))))));
1204
+ }
1205
+ renderCompositional() {
1206
+ const selectionToolbarCount = this.selectedRowIds.length;
1207
+ return (h(Host, { role: "grid", "aria-label": this.label, "aria-colcount": this.colCount > 0 ? this.colCount : undefined, class: {
1208
+ 'xpl-table': true,
1209
+ 'xpl-table--striped': !!this.striped,
1210
+ 'xpl-table--freeze': !!this.freeze,
1211
+ 'xpl-table--has-scrolled': this.hasScrolled,
1212
+ 'xpl-table--selectable': !!this.selectable,
1213
+ 'xpl-table--selection-active': !!this.selectable && this.selectedRowIds.length > 0,
1214
+ 'xpl-table--row-reorderable': !!this.rowReorderable,
1215
+ }, onScroll: this.onGridScroll }, this.rowReorderable && (h("div", { class: "xpl-table__reorder-live", "aria-live": "assertive", "aria-atomic": "true" }, this.reorderLiveMessage)), this.selectable && (h("div", { class: {
1216
+ 'xpl-toolbar': true,
1217
+ hidden: selectionToolbarCount === 0,
1218
+ 'xpl-table__toolbar': true,
1219
+ } }, h("div", { class: "toolbar" }, h("p", { class: "selected-item-count" }, selectionToolbarCount, " Selected"), h("div", { class: "actions" }, h("slot", { name: "toolbar-actions-left" }), h("slot", { name: "toolbar-actions-right" }))))), h("slot", null)));
1220
+ }
1221
+ render() {
1222
+ return this.isLegacyMode ? this.renderLegacy() : this.renderCompositional();
166
1223
  }
167
1224
  static get is() { return "xpl-table"; }
168
1225
  static get properties() {
@@ -178,8 +1235,11 @@ export class Table {
178
1235
  "required": false,
179
1236
  "optional": true,
180
1237
  "docs": {
181
- "tags": [],
182
- "text": "The header values for each column."
1238
+ "tags": [{
1239
+ "name": "deprecated",
1240
+ "text": "Legacy data-driven table API only (`columns` / `data` / `footer`). May be removed in a future major release.\n\nThe header values for each column."
1241
+ }],
1242
+ "text": ""
183
1243
  },
184
1244
  "getter": false,
185
1245
  "setter": false
@@ -195,8 +1255,11 @@ export class Table {
195
1255
  "required": false,
196
1256
  "optional": true,
197
1257
  "docs": {
198
- "tags": [],
199
- "text": "The data for the body of the table."
1258
+ "tags": [{
1259
+ "name": "deprecated",
1260
+ "text": "Legacy data-driven table API only (`columns` / `data` / `footer`). May be removed in a future major release.\n\nThe data for the body of the table."
1261
+ }],
1262
+ "text": ""
200
1263
  },
201
1264
  "getter": false,
202
1265
  "setter": false
@@ -212,8 +1275,11 @@ export class Table {
212
1275
  "required": false,
213
1276
  "optional": true,
214
1277
  "docs": {
215
- "tags": [],
216
- "text": "The data for the footer of the table."
1278
+ "tags": [{
1279
+ "name": "deprecated",
1280
+ "text": "Legacy data-driven table API only (`columns` / `data` / `footer`). May be removed in a future major release.\n\nThe data for the footer of the table."
1281
+ }],
1282
+ "text": ""
217
1283
  },
218
1284
  "getter": false,
219
1285
  "setter": false
@@ -230,14 +1296,14 @@ export class Table {
230
1296
  "optional": true,
231
1297
  "docs": {
232
1298
  "tags": [],
233
- "text": "When true, the first column of the table is sticky and will cover the leftmost rows in a horizontally scrollable container."
1299
+ "text": "When true, the first **data** column (per row) is sticky during horizontal scroll.\nLeading compositional columns are skipped: `selectable` (checkbox) and/or `row-reorderable`\n(grip) are not frozen so they scroll with the grid; the next column stays pinned at `left: 0`."
234
1300
  },
235
1301
  "getter": false,
236
1302
  "setter": false,
237
1303
  "reflect": false,
238
1304
  "attribute": "freeze"
239
1305
  },
240
- "multiselect": {
1306
+ "isSortable": {
241
1307
  "type": "boolean",
242
1308
  "mutable": false,
243
1309
  "complexType": {
@@ -247,16 +1313,39 @@ export class Table {
247
1313
  },
248
1314
  "required": false,
249
1315
  "optional": true,
1316
+ "docs": {
1317
+ "tags": [{
1318
+ "name": "deprecated",
1319
+ "text": "Legacy data-driven table API only. May be removed in a future major release.\n\nToggles to show the sort button on each table head."
1320
+ }],
1321
+ "text": ""
1322
+ },
1323
+ "getter": false,
1324
+ "setter": false,
1325
+ "reflect": false,
1326
+ "attribute": "is-sortable",
1327
+ "defaultValue": "false"
1328
+ },
1329
+ "label": {
1330
+ "type": "string",
1331
+ "mutable": false,
1332
+ "complexType": {
1333
+ "original": "string",
1334
+ "resolved": "string",
1335
+ "references": {}
1336
+ },
1337
+ "required": false,
1338
+ "optional": true,
250
1339
  "docs": {
251
1340
  "tags": [],
252
- "text": "Toggles a selectable checkbox for each row in the table"
1341
+ "text": "Accessible label for the table. Maps to `aria-label` in compositional mode."
253
1342
  },
254
1343
  "getter": false,
255
1344
  "setter": false,
256
1345
  "reflect": false,
257
- "attribute": "multiselect"
1346
+ "attribute": "label"
258
1347
  },
259
- "striped": {
1348
+ "multiselect": {
260
1349
  "type": "boolean",
261
1350
  "mutable": false,
262
1351
  "complexType": {
@@ -266,34 +1355,57 @@ export class Table {
266
1355
  },
267
1356
  "required": false,
268
1357
  "optional": true,
1358
+ "docs": {
1359
+ "tags": [{
1360
+ "name": "deprecated",
1361
+ "text": "Legacy data-driven table API only. May be removed in a future major release.\n\nToggles a selectable checkbox for each row in the table."
1362
+ }],
1363
+ "text": ""
1364
+ },
1365
+ "getter": false,
1366
+ "setter": false,
1367
+ "reflect": false,
1368
+ "attribute": "multiselect"
1369
+ },
1370
+ "reorderHandleIcon": {
1371
+ "type": "string",
1372
+ "mutable": false,
1373
+ "complexType": {
1374
+ "original": "string",
1375
+ "resolved": "string",
1376
+ "references": {}
1377
+ },
1378
+ "required": false,
1379
+ "optional": true,
269
1380
  "docs": {
270
1381
  "tags": [],
271
- "text": "Toggles an optional styling of the background of each even row of the table body."
1382
+ "text": "Icon name for the optional `xpl-icon` inside each **managed** reorder grip when the row is **not** in\nkeyboard reorder mode (pointer / idle). Set to `\"\"` to omit the icon so you can style the button or author a\nfully custom reorder column in markup. When omitted, defaults to `grip-dots-vertical`."
272
1383
  },
273
1384
  "getter": false,
274
1385
  "setter": false,
275
1386
  "reflect": false,
276
- "attribute": "striped"
1387
+ "attribute": "reorder-handle-icon"
277
1388
  },
278
- "selectedValues": {
279
- "type": "unknown",
1389
+ "reorderHandleIconKeyboard": {
1390
+ "type": "string",
280
1391
  "mutable": false,
281
1392
  "complexType": {
282
- "original": "string[]",
283
- "resolved": "string[]",
1393
+ "original": "string",
1394
+ "resolved": "string",
284
1395
  "references": {}
285
1396
  },
286
1397
  "required": false,
287
- "optional": false,
1398
+ "optional": true,
288
1399
  "docs": {
289
1400
  "tags": [],
290
- "text": "The values for the input for each row when multiselect is activated."
1401
+ "text": "Icon name for the managed reorder grip **while that row is in keyboard reorder mode** (after the user\nactivates the grip with Enter or Space). Use a different icon than `reorder-handle-icon` so users can see\nthey should use arrow keys. When omitted, defaults to `caret-expand-y` (same as `xpl-list` keyboard reorder).\nSet to `\"\"` to show no icon in keyboard mode only (combine with CSS on\n`.xpl-table__row-drag-handle--keyboard-mode` if needed)."
291
1402
  },
292
1403
  "getter": false,
293
1404
  "setter": false,
294
- "defaultValue": "[]"
1405
+ "reflect": false,
1406
+ "attribute": "reorder-handle-icon-keyboard"
295
1407
  },
296
- "isSortable": {
1408
+ "rowReorderable": {
297
1409
  "type": "boolean",
298
1410
  "mutable": false,
299
1411
  "complexType": {
@@ -305,14 +1417,54 @@ export class Table {
305
1417
  "optional": false,
306
1418
  "docs": {
307
1419
  "tags": [],
308
- "text": "Toggles to show the sort button on each table head"
1420
+ "text": "When true (compositional mode only), **prepends** a managed reorder column as the **first** grid\ncolumn (empty header + grip button per body row) and enables HTML5 drag-and-drop row reordering\n(same interaction model as `xpl-list`). With `selectable`, DOM order is **reorder | selection |\ndata** unless you author a custom reorder column. The table updates the DOM and emits\n`rowOrderChange`; consumers should persist order if needed. Ignored in legacy `columns`/`data` mode."
309
1421
  },
310
1422
  "getter": false,
311
1423
  "setter": false,
312
1424
  "reflect": false,
313
- "attribute": "is-sortable",
1425
+ "attribute": "row-reorderable",
314
1426
  "defaultValue": "false"
315
1427
  },
1428
+ "selectable": {
1429
+ "type": "boolean",
1430
+ "mutable": false,
1431
+ "complexType": {
1432
+ "original": "boolean",
1433
+ "resolved": "boolean",
1434
+ "references": {}
1435
+ },
1436
+ "required": false,
1437
+ "optional": true,
1438
+ "docs": {
1439
+ "tags": [],
1440
+ "text": "When true (compositional mode only), enables row selection state, the selection toolbar\n(\u201CN Selected\u201D), and `rowSelectionChange`. **You must add the selection column in your\nmarkup:** a header cell with `type=\"checkbox\"`, a body cell containing `xpl-checkbox` per row\n(aligned with that column), and matching `xpl-table-footer-cell` cells when you use a footer.\nEach body row should use `row-id` on `xpl-table-row` (or accept auto-generated ids) so\n`rowSelectionChange` can report `selectedRowIds`.\n\nThe toolbar uses the same layout as `xpl-toolbar` and is visible only while at least one row\nis selected. Use `toolbar-actions-left` / `toolbar-actions-right` slots on this host for bulk\nactions."
1441
+ },
1442
+ "getter": false,
1443
+ "setter": false,
1444
+ "reflect": false,
1445
+ "attribute": "selectable"
1446
+ },
1447
+ "selectedValues": {
1448
+ "type": "unknown",
1449
+ "mutable": false,
1450
+ "complexType": {
1451
+ "original": "string[]",
1452
+ "resolved": "string[]",
1453
+ "references": {}
1454
+ },
1455
+ "required": false,
1456
+ "optional": true,
1457
+ "docs": {
1458
+ "tags": [{
1459
+ "name": "deprecated",
1460
+ "text": "Legacy data-driven table API only. May be removed in a future major release.\n\nThe values for the input for each row when multiselect is activated."
1461
+ }],
1462
+ "text": ""
1463
+ },
1464
+ "getter": false,
1465
+ "setter": false,
1466
+ "defaultValue": "[]"
1467
+ },
316
1468
  "sortableColumns": {
317
1469
  "type": "unknown",
318
1470
  "mutable": false,
@@ -322,40 +1474,88 @@ export class Table {
322
1474
  "references": {}
323
1475
  },
324
1476
  "required": false,
325
- "optional": false,
1477
+ "optional": true,
326
1478
  "docs": {
327
- "tags": [],
328
- "text": "Manually determined if the column is sortable"
1479
+ "tags": [{
1480
+ "name": "deprecated",
1481
+ "text": "Use the compositional slot-based API instead. Will be removed in a future major release.\n\nManually determined if the column is sortable."
1482
+ }],
1483
+ "text": ""
329
1484
  },
330
1485
  "getter": false,
331
1486
  "setter": false,
332
1487
  "defaultValue": "[]"
1488
+ },
1489
+ "striped": {
1490
+ "type": "boolean",
1491
+ "mutable": false,
1492
+ "complexType": {
1493
+ "original": "boolean",
1494
+ "resolved": "boolean",
1495
+ "references": {}
1496
+ },
1497
+ "required": false,
1498
+ "optional": true,
1499
+ "docs": {
1500
+ "tags": [],
1501
+ "text": "Toggles an optional styling of the background of each even row of the\ntable body."
1502
+ },
1503
+ "getter": false,
1504
+ "setter": false,
1505
+ "reflect": false,
1506
+ "attribute": "striped"
333
1507
  }
334
1508
  };
335
1509
  }
336
1510
  static get states() {
337
1511
  return {
338
1512
  "areAllSelected": {},
339
- "rowData": {},
1513
+ "colCount": {},
340
1514
  "hasScrolled": {},
1515
+ "keyboardReorderRowId": {},
1516
+ "reorderLiveMessage": {},
1517
+ "rowData": {},
1518
+ "rowFooterData": {},
341
1519
  "selected": {},
1520
+ "selectedRowIds": {},
342
1521
  "sortTypeArray": {}
343
1522
  };
344
1523
  }
345
1524
  static get events() {
346
1525
  return [{
347
- "method": "tableSelect",
348
- "name": "tableSelect",
349
- "bubbles": true,
1526
+ "method": "rowOrderChange",
1527
+ "name": "rowOrderChange",
1528
+ "bubbles": false,
350
1529
  "cancelable": true,
351
1530
  "composed": true,
352
1531
  "docs": {
353
1532
  "tags": [],
354
- "text": "Callback function that is called when the checkbox for a row of a\n`multiselect` table is checked"
1533
+ "text": "Emitted after body rows are reordered via drag-and-drop (compositional `row-reorderable` mode)."
355
1534
  },
356
1535
  "complexType": {
357
- "original": "any",
358
- "resolved": "any",
1536
+ "original": "XplTableRowOrderChangeDetail",
1537
+ "resolved": "XplTableRowOrderChangeDetail",
1538
+ "references": {
1539
+ "XplTableRowOrderChangeDetail": {
1540
+ "location": "local",
1541
+ "path": "/home/runner/work/apollo/apollo/packages/apollo-core/src/components/components/xpl-table/xpl-table.tsx",
1542
+ "id": "src/components/components/xpl-table/xpl-table.tsx::XplTableRowOrderChangeDetail"
1543
+ }
1544
+ }
1545
+ }
1546
+ }, {
1547
+ "method": "rowSelectionChange",
1548
+ "name": "rowSelectionChange",
1549
+ "bubbles": false,
1550
+ "cancelable": true,
1551
+ "composed": true,
1552
+ "docs": {
1553
+ "tags": [],
1554
+ "text": "Emitted when row selection changes in compositional `selectable` mode (`bubbles: false`,\n`composed: true`).\nListen on this `xpl-table` instance only; the event does not bubble to parents\u2014use\n`table.addEventListener('rowSelectionChange', \u2026)` on the same element. When wiring from a\nscript in static HTML, wait for `customElements.whenDefined('xpl-table')` so the host is ready.\n(Named `rowSelectionChange` to avoid clashing with the native `selectionchange` event.)"
1555
+ },
1556
+ "complexType": {
1557
+ "original": "{ selectedRowIds: string[] }",
1558
+ "resolved": "{ selectedRowIds: string[]; }",
359
1559
  "references": {}
360
1560
  }
361
1561
  }, {
@@ -366,11 +1566,32 @@ export class Table {
366
1566
  "composed": true,
367
1567
  "docs": {
368
1568
  "tags": [],
369
- "text": "Emits an event whenever the sort changes.\nThe 'sortChanged' event passes an object with colNum (number), colName (string), sortTypeArr(('asc' | 'desc' | null)[]).\nThe default action can be overridden by calling event.preventDefault()."
1569
+ "text": "Emitted when sort changes in **legacy** or **compositional** mode. `event.detail` is a plain\nobject: **sort-key slug \u2192 `'asc' | 'desc' | null`** (null = that column not sorted). Keys match\nlegacy column titles (slugified) or compositional `sort-key` / label slugs. Call\n`event.preventDefault()` in legacy mode to skip built-in row sorting; compositional tables do\nnot reorder rows automatically."
1570
+ },
1571
+ "complexType": {
1572
+ "original": "XplTableSortChangedDetail",
1573
+ "resolved": "XplTableSortChangedDetail",
1574
+ "references": {
1575
+ "XplTableSortChangedDetail": {
1576
+ "location": "local",
1577
+ "path": "/home/runner/work/apollo/apollo/packages/apollo-core/src/components/components/xpl-table/xpl-table.tsx",
1578
+ "id": "src/components/components/xpl-table/xpl-table.tsx::XplTableSortChangedDetail"
1579
+ }
1580
+ }
1581
+ }
1582
+ }, {
1583
+ "method": "tableSelect",
1584
+ "name": "tableSelect",
1585
+ "bubbles": true,
1586
+ "cancelable": true,
1587
+ "composed": true,
1588
+ "docs": {
1589
+ "tags": [],
1590
+ "text": "Callback function that is called when the checkbox for a row of a\n`multiselect` table is checked."
370
1591
  },
371
1592
  "complexType": {
372
- "original": "{\n colNum: number;\n colName: string;\n sortTypeArr: ('asc' | 'desc' | null)[];\n }",
373
- "resolved": "{ colNum: number; colName: string; sortTypeArr: (\"desc\" | \"asc\")[]; }",
1593
+ "original": "any",
1594
+ "resolved": "any",
374
1595
  "references": {}
375
1596
  }
376
1597
  }];
@@ -378,11 +1599,101 @@ export class Table {
378
1599
  static get elementRef() { return "el"; }
379
1600
  static get watchers() {
380
1601
  return [{
1602
+ "propName": "columns",
1603
+ "methodName": "watchColumns"
1604
+ }, {
381
1605
  "propName": "data",
382
1606
  "methodName": "watchData"
383
1607
  }, {
384
- "propName": "columns",
385
- "methodName": "watchColumns"
1608
+ "propName": "footer",
1609
+ "methodName": "watchFooterData"
1610
+ }, {
1611
+ "propName": "reorderHandleIcon",
1612
+ "methodName": "watchReorderHandleIcon"
1613
+ }, {
1614
+ "propName": "reorderHandleIconKeyboard",
1615
+ "methodName": "watchReorderHandleIconKeyboard"
1616
+ }, {
1617
+ "propName": "rowReorderable",
1618
+ "methodName": "watchRowReorderable"
1619
+ }, {
1620
+ "propName": "selectable",
1621
+ "methodName": "watchSelectable"
1622
+ }];
1623
+ }
1624
+ static get listeners() {
1625
+ return [{
1626
+ "name": "xplTableColumnWidthsChange",
1627
+ "method": "handleHeaderCellColumnWidthsChange",
1628
+ "target": undefined,
1629
+ "capture": false,
1630
+ "passive": false
1631
+ }, {
1632
+ "name": "checkboxChange",
1633
+ "method": "handleCompositionalCheckboxChange",
1634
+ "target": undefined,
1635
+ "capture": false,
1636
+ "passive": false
1637
+ }, {
1638
+ "name": "headerCheckboxChange",
1639
+ "method": "handleCompositionalHeaderCheckboxChange",
1640
+ "target": undefined,
1641
+ "capture": false,
1642
+ "passive": false
1643
+ }, {
1644
+ "name": "pointerdown",
1645
+ "method": "handlePointerDownExitKeyboardReorder",
1646
+ "target": undefined,
1647
+ "capture": true,
1648
+ "passive": true
1649
+ }, {
1650
+ "name": "pointerdown",
1651
+ "method": "handleRowReorderPointerDown",
1652
+ "target": undefined,
1653
+ "capture": true,
1654
+ "passive": true
1655
+ }, {
1656
+ "name": "dragstart",
1657
+ "method": "handleRowReorderDragStart",
1658
+ "target": undefined,
1659
+ "capture": true,
1660
+ "passive": true
1661
+ }, {
1662
+ "name": "dragend",
1663
+ "method": "handleRowReorderDragEnd",
1664
+ "target": undefined,
1665
+ "capture": true,
1666
+ "passive": true
1667
+ }, {
1668
+ "name": "dragover",
1669
+ "method": "handleRowReorderDragOver",
1670
+ "target": undefined,
1671
+ "capture": true,
1672
+ "passive": false
1673
+ }, {
1674
+ "name": "dragenter",
1675
+ "method": "handleRowReorderDragEnter",
1676
+ "target": undefined,
1677
+ "capture": true,
1678
+ "passive": false
1679
+ }, {
1680
+ "name": "dragleave",
1681
+ "method": "handleRowReorderDragLeave",
1682
+ "target": undefined,
1683
+ "capture": true,
1684
+ "passive": true
1685
+ }, {
1686
+ "name": "drop",
1687
+ "method": "handleRowReorderDrop",
1688
+ "target": undefined,
1689
+ "capture": true,
1690
+ "passive": false
1691
+ }, {
1692
+ "name": "headerSortChange",
1693
+ "method": "handleCompositionalHeaderSort",
1694
+ "target": undefined,
1695
+ "capture": false,
1696
+ "passive": false
386
1697
  }];
387
1698
  }
388
1699
  }