@servicetitan/anvil2 2.8.0 → 2.9.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 (243) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/{AiMark-Cwc9KoyE.js → AiMark-DR-w6Nbm.js} +4 -4
  3. package/dist/{AiMark-Cwc9KoyE.js.map → AiMark-DR-w6Nbm.js.map} +1 -1
  4. package/dist/AiMark.js +1 -1
  5. package/dist/{Alert-5qhkSUN3.js → Alert-Dj61Bq8h.js} +3 -3
  6. package/dist/{Alert-5qhkSUN3.js.map → Alert-Dj61Bq8h.js.map} +1 -1
  7. package/dist/Alert.js +1 -1
  8. package/dist/{Announcement-fQmFNysn.js → Announcement-B9zm-_1S.js} +2 -2
  9. package/dist/{Announcement-fQmFNysn.js.map → Announcement-B9zm-_1S.js.map} +1 -1
  10. package/dist/Announcement.js +1 -1
  11. package/dist/{AnvilProvider-ClfmLl_6.js → AnvilProvider-DUPYyMc7.js} +2 -2
  12. package/dist/{AnvilProvider-ClfmLl_6.js.map → AnvilProvider-DUPYyMc7.js.map} +1 -1
  13. package/dist/AnvilProvider.js +1 -1
  14. package/dist/{Breadcrumbs-BXo2FO2n.js → Breadcrumbs-ojgYVZwe.js} +2 -2
  15. package/dist/{Breadcrumbs-BXo2FO2n.js.map → Breadcrumbs-ojgYVZwe.js.map} +1 -1
  16. package/dist/Breadcrumbs.js +1 -1
  17. package/dist/Button-BdrrhBTI.js +2185 -0
  18. package/dist/Button-BdrrhBTI.js.map +1 -0
  19. package/dist/Button.js +1 -1
  20. package/dist/{ButtonToggle-CmY77gUp.js → ButtonToggle-DaFQ3DBG.js} +2 -2
  21. package/dist/{ButtonToggle-CmY77gUp.js.map → ButtonToggle-DaFQ3DBG.js.map} +1 -1
  22. package/dist/ButtonToggle.js +1 -1
  23. package/dist/{Calendar-d2owsYe9.js → Calendar-Cka4unyi.js} +2 -2
  24. package/dist/{Calendar-d2owsYe9.js.map → Calendar-Cka4unyi.js.map} +1 -1
  25. package/dist/{Calendar-Bd_WELZC.js → Calendar-Dxl9QnfP.js} +3 -3
  26. package/dist/{Calendar-Bd_WELZC.js.map → Calendar-Dxl9QnfP.js.map} +1 -1
  27. package/dist/Calendar.js +2 -2
  28. package/dist/{Checkbox-BlFc6ZWy.js → Checkbox-B-XTVPbX.js} +3 -3
  29. package/dist/{Checkbox-BlFc6ZWy.js.map → Checkbox-B-XTVPbX.js.map} +1 -1
  30. package/dist/{Checkbox-DbaZrUE2.js → Checkbox-Cw1-KFvq.js} +2 -2
  31. package/dist/{Checkbox-DbaZrUE2.js.map → Checkbox-Cw1-KFvq.js.map} +1 -1
  32. package/dist/Checkbox.js +1 -1
  33. package/dist/{Chip-BnofwIUN.js → Chip-Ce0WGKAc.js} +2 -2
  34. package/dist/{Chip-BnofwIUN.js.map → Chip-Ce0WGKAc.js.map} +1 -1
  35. package/dist/Chip.js +1 -1
  36. package/dist/{Combobox-BOxAzG9v.js → Combobox-CNQUROyr.js} +4 -4
  37. package/dist/{Combobox-BOxAzG9v.js.map → Combobox-CNQUROyr.js.map} +1 -1
  38. package/dist/Combobox.js +1 -1
  39. package/dist/{DataTable-DK9xRjnq.js → DataTable-JRxu2yTP.js} +862 -497
  40. package/dist/DataTable-JRxu2yTP.js.map +1 -0
  41. package/dist/DataTable.css +185 -109
  42. package/dist/{DateFieldRange-5Jrz6dLl.js → DateFieldRange-D2hnF50O.js} +4 -4
  43. package/dist/{DateFieldRange-5Jrz6dLl.js.map → DateFieldRange-D2hnF50O.js.map} +1 -1
  44. package/dist/DateFieldRange.js +1 -1
  45. package/dist/{DateFieldSingle-DWFr6Ew4.js → DateFieldSingle-BuaB7RDr.js} +4 -4
  46. package/dist/{DateFieldSingle-DWFr6Ew4.js.map → DateFieldSingle-BuaB7RDr.js.map} +1 -1
  47. package/dist/DateFieldSingle.js +1 -1
  48. package/dist/{DateFieldYearless-UU22A5-E.js → DateFieldYearless-DLeMEutt.js} +4 -4
  49. package/dist/{DateFieldYearless-UU22A5-E.js.map → DateFieldYearless-DLeMEutt.js.map} +1 -1
  50. package/dist/DateFieldYearless.js +1 -1
  51. package/dist/{DateFieldYearlessRange-BoPLxm6t.js → DateFieldYearlessRange-BfPuYKKC.js} +3 -3
  52. package/dist/{DateFieldYearlessRange-BoPLxm6t.js.map → DateFieldYearlessRange-BfPuYKKC.js.map} +1 -1
  53. package/dist/DateFieldYearlessRange.js +1 -1
  54. package/dist/{DaysOfTheWeek-4cfTmjzm.js → DaysOfTheWeek-BW1T8sTU.js} +3 -3
  55. package/dist/{DaysOfTheWeek-4cfTmjzm.js.map → DaysOfTheWeek-BW1T8sTU.js.map} +1 -1
  56. package/dist/DaysOfTheWeek.js +1 -1
  57. package/dist/{Dialog-Dn836WQM.js → Dialog-Cewu2pd_.js} +38 -10
  58. package/dist/Dialog-Cewu2pd_.js.map +1 -0
  59. package/dist/Dialog.js +1 -1
  60. package/dist/{DialogCancelButton-B-jfihJr.js → DialogCancelButton-Czz4Wpse.js} +2 -2
  61. package/dist/{DialogCancelButton-B-jfihJr.js.map → DialogCancelButton-Czz4Wpse.js.map} +1 -1
  62. package/dist/{Drawer-CdDWt_Ba.js → Drawer-Cb5asXWf.js} +38 -10
  63. package/dist/Drawer-Cb5asXWf.js.map +1 -0
  64. package/dist/Drawer.js +1 -1
  65. package/dist/DrillDown.js +1 -1
  66. package/dist/DrillDown.module-C8VOhzaF.js.map +1 -1
  67. package/dist/{EditCard-CZibhEfS.js → EditCard-DlJE3LXN.js} +3 -3
  68. package/dist/{EditCard-CZibhEfS.js.map → EditCard-DlJE3LXN.js.map} +1 -1
  69. package/dist/EditCard.js +1 -1
  70. package/dist/{FieldLabel-Dr41PRxH.js → FieldLabel-HO2VP-4B.js} +2 -2
  71. package/dist/{FieldLabel-Dr41PRxH.js.map → FieldLabel-HO2VP-4B.js.map} +1 -1
  72. package/dist/FieldLabel.js +1 -1
  73. package/dist/{InputMask-CcXqzqdx.js → InputMask-CLLTehFI.js} +3 -3
  74. package/dist/{InputMask-CcXqzqdx.js.map → InputMask-CLLTehFI.js.map} +1 -1
  75. package/dist/InputMask.js +1 -1
  76. package/dist/{ListView-D9cZUVer.js → ListView-CPi-qG2w.js} +2 -2
  77. package/dist/{ListView-D9cZUVer.js.map → ListView-CPi-qG2w.js.map} +1 -1
  78. package/dist/ListView.js +1 -1
  79. package/dist/{Listbox-CgDwzRfz.js → Listbox-Bp4hqIpH.js} +2 -2
  80. package/dist/{Listbox-CgDwzRfz.js.map → Listbox-Bp4hqIpH.js.map} +1 -1
  81. package/dist/Listbox.js +1 -1
  82. package/dist/{Menu-CPbuIsqC.js → Menu-CCavGohP.js} +91 -93
  83. package/dist/Menu-CCavGohP.js.map +1 -0
  84. package/dist/Menu.js +1 -1
  85. package/dist/MultiSelectField.js +1 -1
  86. package/dist/{MultiSelectFieldSync-Ei7DXzvs.js → MultiSelectFieldSync-ChZCW4M9.js} +7 -7
  87. package/dist/{MultiSelectFieldSync-Ei7DXzvs.js.map → MultiSelectFieldSync-ChZCW4M9.js.map} +1 -1
  88. package/dist/MultiSelectMenu.js +1 -1
  89. package/dist/{MultiSelectMenuSync-B_mXpTEe.js → MultiSelectMenuSync-7C1wW4oO.js} +3 -3
  90. package/dist/{MultiSelectMenuSync-B_mXpTEe.js.map → MultiSelectMenuSync-7C1wW4oO.js.map} +1 -1
  91. package/dist/{NumberField-C5t47Obp.js → NumberField-CZSTHBeO.js} +4 -4
  92. package/dist/{NumberField-C5t47Obp.js.map → NumberField-CZSTHBeO.js.map} +1 -1
  93. package/dist/NumberField.js +1 -1
  94. package/dist/{Page-2hbQxUj6.js → Page-BHdvTlfE.js} +111 -62
  95. package/dist/Page-BHdvTlfE.js.map +1 -0
  96. package/dist/Page.css +76 -76
  97. package/dist/Page.js +1 -1
  98. package/dist/{Pagination-CjGmJ_rU.js → Pagination-B5jqHYG3.js} +7 -7
  99. package/dist/{Pagination-CjGmJ_rU.js.map → Pagination-B5jqHYG3.js.map} +1 -1
  100. package/dist/Pagination.css +7 -6
  101. package/dist/Pagination.js +1 -1
  102. package/dist/{Popover-CpU9VAcb.js → Popover-BbqTZw-1.js} +3 -3
  103. package/dist/{Popover-CpU9VAcb.js.map → Popover-BbqTZw-1.js.map} +1 -1
  104. package/dist/Popover.js +1 -1
  105. package/dist/{ProgressBar-FMuK8viJ.js → ProgressBar-CZcxkdX6.js} +2 -2
  106. package/dist/{ProgressBar-FMuK8viJ.js.map → ProgressBar-CZcxkdX6.js.map} +1 -1
  107. package/dist/ProgressBar.js +1 -1
  108. package/dist/{Radio-DmtVWAmN.js → Radio-BFr8AdHc.js} +2 -2
  109. package/dist/{Radio-DmtVWAmN.js.map → Radio-BFr8AdHc.js.map} +1 -1
  110. package/dist/{Radio-CZZd8phn.js → Radio-DJZVMCv0.js} +3 -3
  111. package/dist/{Radio-CZZd8phn.js.map → Radio-DJZVMCv0.js.map} +1 -1
  112. package/dist/Radio.js +1 -1
  113. package/dist/{SelectCard-8OmIDl1m.js → SelectCard-DVcWJRbX.js} +3 -3
  114. package/dist/{SelectCard-8OmIDl1m.js.map → SelectCard-DVcWJRbX.js.map} +1 -1
  115. package/dist/SelectCard.js +1 -1
  116. package/dist/SelectField.js +1 -1
  117. package/dist/{SelectFieldLabel-C8PrXxDU.js → SelectFieldLabel-kEBS8L4l.js} +2 -2
  118. package/dist/{SelectFieldLabel-C8PrXxDU.js.map → SelectFieldLabel-kEBS8L4l.js.map} +1 -1
  119. package/dist/{SelectFieldSync-DGK8F2G9.js → SelectFieldSync-o1Cp9UYC.js} +6 -6
  120. package/dist/{SelectFieldSync-DGK8F2G9.js.map → SelectFieldSync-o1Cp9UYC.js.map} +1 -1
  121. package/dist/SelectMenu.js +1 -1
  122. package/dist/{SelectMenuSync-CuZp9mnt.js → SelectMenuSync-DXrwecFt.js} +3 -3
  123. package/dist/{SelectMenuSync-CuZp9mnt.js.map → SelectMenuSync-DXrwecFt.js.map} +1 -1
  124. package/dist/{SelectOptions-CmElsiTd.js → SelectOptions-Dy2OWqxn.js} +2 -2
  125. package/dist/{SelectOptions-CmElsiTd.js.map → SelectOptions-Dy2OWqxn.js.map} +1 -1
  126. package/dist/{SelectTrigger-KF8w6Ynk.js → SelectTrigger-DhKYzEAr.js} +2 -2
  127. package/dist/{SelectTrigger-KF8w6Ynk.js.map → SelectTrigger-DhKYzEAr.js.map} +1 -1
  128. package/dist/SelectTrigger.js +1 -1
  129. package/dist/{SelectTriggerBase-Bxmv6oXk.js → SelectTriggerBase-Ni8WqeUx.js} +76 -63
  130. package/dist/SelectTriggerBase-Ni8WqeUx.js.map +1 -0
  131. package/dist/SelectTriggerBase.css +83 -66
  132. package/dist/SelectTriggerBase.module-CKoq6qzX.js +38 -0
  133. package/dist/SelectTriggerBase.module-CKoq6qzX.js.map +1 -0
  134. package/dist/{Stepper-_27Lmm2K.js → Stepper-Dt2xAXth.js} +2 -2
  135. package/dist/{Stepper-_27Lmm2K.js.map → Stepper-Dt2xAXth.js.map} +1 -1
  136. package/dist/Stepper.js +1 -1
  137. package/dist/{Switch-DPGz7wC_.js → Switch-C84MBChG.js} +2 -2
  138. package/dist/{Switch-DPGz7wC_.js.map → Switch-C84MBChG.js.map} +1 -1
  139. package/dist/Switch.js +1 -1
  140. package/dist/Table.js +1 -1
  141. package/dist/{Text-MVxRo6yx.js → Text-WiS8UZkY.js} +2 -2
  142. package/dist/{Text-MVxRo6yx.js.map → Text-WiS8UZkY.js.map} +1 -1
  143. package/dist/Text.js +1 -1
  144. package/dist/{TextField-BpSxZa0z.js → TextField-Bul_uln5.js} +3 -3
  145. package/dist/{TextField-BpSxZa0z.js.map → TextField-Bul_uln5.js.map} +1 -1
  146. package/dist/{TextField-D93iv_pk.js → TextField-OznkTx4e.js} +2 -2
  147. package/dist/{TextField-D93iv_pk.js.map → TextField-OznkTx4e.js.map} +1 -1
  148. package/dist/TextField.js +1 -1
  149. package/dist/{Textarea-1u2fSMTh.js → Textarea-CCYLsJ1x.js} +3 -3
  150. package/dist/{Textarea-1u2fSMTh.js.map → Textarea-CCYLsJ1x.js.map} +1 -1
  151. package/dist/Textarea.js +1 -1
  152. package/dist/{TimeField-B4gLlBQJ.js → TimeField-BPvPbD8H.js} +4 -4
  153. package/dist/{TimeField-B4gLlBQJ.js.map → TimeField-BPvPbD8H.js.map} +1 -1
  154. package/dist/TimeField.js +1 -1
  155. package/dist/Toast.js +2 -2
  156. package/dist/{Toaster-DbWYnF_t.js → Toaster-CIaIvwH6.js} +2 -2
  157. package/dist/{Toaster-DbWYnF_t.js.map → Toaster-CIaIvwH6.js.map} +1 -1
  158. package/dist/{Toaster-CSJfSOHx.js → Toaster-DYJm06Vb.js} +4 -4
  159. package/dist/{Toaster-CSJfSOHx.js.map → Toaster-DYJm06Vb.js.map} +1 -1
  160. package/dist/{Toolbar-CWRk523l.js → Toolbar-ByyI7SqG.js} +14 -14
  161. package/dist/{Toolbar-CWRk523l.js.map → Toolbar-ByyI7SqG.js.map} +1 -1
  162. package/dist/Toolbar.js +1 -1
  163. package/dist/{YearlessDateInputWithPicker-BSl5z2zo.js → YearlessDateInputWithPicker-C_twiQW5.js} +2 -2
  164. package/dist/{YearlessDateInputWithPicker-BSl5z2zo.js.map → YearlessDateInputWithPicker-C_twiQW5.js.map} +1 -1
  165. package/dist/assets/icons/st/unsorted.svg +1 -0
  166. package/dist/assets/icons/st.ts +1 -0
  167. package/dist/beta/components/Table/DataTable/DataTable.d.ts +28 -3
  168. package/dist/beta/components/Table/DataTable/internal/DataTableBody.d.ts +19 -4
  169. package/dist/beta/components/Table/DataTable/internal/DataTableBodyRow.d.ts +18 -1
  170. package/dist/beta/components/Table/DataTable/internal/DataTableFooter.d.ts +5 -5
  171. package/dist/beta/components/Table/DataTable/internal/DataTableHeader.d.ts +4 -2
  172. package/dist/beta/components/Table/DataTable/internal/cells/DataTableBodyCell.d.ts +0 -2
  173. package/dist/beta/components/Table/DataTable/internal/cells/DataTableBodyImmutableCell.d.ts +0 -5
  174. package/dist/beta/components/Table/DataTable/internal/cells/DataTableBodyMutableCell.d.ts +0 -5
  175. package/dist/beta/components/Table/DataTable/internal/cells/DataTableHeaderCell.d.ts +4 -4
  176. package/dist/beta/components/Table/DataTable/internal/cells/useCellFocusListener.d.ts +10 -0
  177. package/dist/beta/components/Table/DataTable/internal/context/focus/DTFocusProvider.d.ts +4 -1
  178. package/dist/beta/components/Table/DataTable/internal/editable-cells/DataTableEditableMultiselectAsyncCell.d.ts +0 -1
  179. package/dist/beta/components/Table/DataTable/internal/editable-cells/DataTableEditableMultiselectCell.d.ts +0 -1
  180. package/dist/beta/components/Table/DataTable/internal/editable-cells/types.d.ts +0 -4
  181. package/dist/beta/components/Table/DataTable/internal/editable-cells/useEditableMenuCell.d.ts +3 -6
  182. package/dist/beta/components/Table/DataTable/internal/useDataTableVirtualizer.d.ts +29 -0
  183. package/dist/beta/components/Table/DataTable/internal/util/getTanStackColumnDef.d.ts +13 -2
  184. package/dist/beta/components/Table/DataTable/internal/util/shallowSortingEqual.d.ts +2 -0
  185. package/dist/beta/components/Table/DataTable/stories/DataTable.story-data.d.ts +1 -0
  186. package/dist/beta/components/Table/base/cells/TableHeaderCell.d.ts +4 -0
  187. package/dist/beta/components/Table/createColumnHelper.d.ts +36 -12
  188. package/dist/beta/components/Table/formatters/htmlFormatter.d.ts +13 -0
  189. package/dist/beta/components/Table/formatters/htmlToMarkdown.d.ts +11 -0
  190. package/dist/beta/components/Table/formatters/index.d.ts +2 -0
  191. package/dist/beta/components/Table/formatters/markdownFormatter.d.ts +11 -0
  192. package/dist/beta/components/Table/types.d.ts +64 -10
  193. package/dist/beta.js +9 -9
  194. package/dist/components/DrillDown/internal/DrillDownContext.d.ts +4 -0
  195. package/dist/components/DrillDown/internal/useDrillDownContextState.d.ts +4 -0
  196. package/dist/index.js +43 -44
  197. package/dist/index.js.map +1 -1
  198. package/dist/internal/flubber/a2c.d.ts +16 -0
  199. package/dist/internal/flubber/add.d.ts +3 -0
  200. package/dist/internal/flubber/arc.d.ts +26 -0
  201. package/dist/internal/flubber/bezier.d.ts +32 -0
  202. package/dist/internal/flubber/errors.d.ts +5 -0
  203. package/dist/internal/flubber/index.d.ts +6 -0
  204. package/dist/internal/flubber/interpolate.d.ts +7 -0
  205. package/dist/internal/flubber/linear.d.ts +27 -0
  206. package/dist/internal/flubber/math.d.ts +10 -0
  207. package/dist/internal/flubber/normalize.d.ts +4 -0
  208. package/dist/internal/flubber/parse.d.ts +7 -0
  209. package/dist/internal/flubber/path-properties.d.ts +23 -0
  210. package/dist/internal/flubber/rotate.d.ts +2 -0
  211. package/dist/internal/flubber/svg.d.ts +9 -0
  212. package/dist/internal/index.d.ts +1 -0
  213. package/dist/{stripInlineMarkdown-DyqLAQnf.js → stripInlineMarkdown-Cg1qlNwL.js} +2 -2
  214. package/dist/{stripInlineMarkdown-DyqLAQnf.js.map → stripInlineMarkdown-Cg1qlNwL.js.map} +1 -1
  215. package/dist/{syncFilterUtils-CsbCnI1-.js → syncFilterUtils-UR5Vgqkh.js} +7 -8
  216. package/dist/{syncFilterUtils-CsbCnI1-.js.map → syncFilterUtils-UR5Vgqkh.js.map} +1 -1
  217. package/dist/{useDrilldown-C7eMBl68.js → useDrilldown-D6VZNSCX.js} +46 -20
  218. package/dist/{useDrilldown-C7eMBl68.js.map → useDrilldown-D6VZNSCX.js.map} +1 -1
  219. package/dist/{useInitialFocus-DbaB-x5T.js → useInitialFocus-BUxEDMEG.js} +65 -23
  220. package/dist/useInitialFocus-BUxEDMEG.js.map +1 -0
  221. package/dist/{usePopoverTransitionStates-B1opfxxn.js → usePopoverTransitionStates-CDXCdyKa.js} +2 -1
  222. package/dist/{usePopoverTransitionStates-B1opfxxn.js.map → usePopoverTransitionStates-CDXCdyKa.js.map} +1 -1
  223. package/dist/{useToggleSelection-BM8asdFj.js → useToggleSelection-BBdrIVWs.js} +2 -2
  224. package/dist/{useToggleSelection-BM8asdFj.js.map → useToggleSelection-BBdrIVWs.js.map} +1 -1
  225. package/package.json +1 -3
  226. package/dist/Button-a_D7tUgM.js +0 -4517
  227. package/dist/Button-a_D7tUgM.js.map +0 -1
  228. package/dist/DataTable-DK9xRjnq.js.map +0 -1
  229. package/dist/Dialog-Dn836WQM.js.map +0 -1
  230. package/dist/Drawer-CdDWt_Ba.js.map +0 -1
  231. package/dist/Menu-CPbuIsqC.js.map +0 -1
  232. package/dist/Page-2hbQxUj6.js.map +0 -1
  233. package/dist/SelectTriggerBase-Bxmv6oXk.js.map +0 -1
  234. package/dist/SelectTriggerBase.module-B0NFRlQP.js +0 -36
  235. package/dist/SelectTriggerBase.module-B0NFRlQP.js.map +0 -1
  236. package/dist/beta/components/Table/DataTable/internal/cells/CellFocusContext.d.ts +0 -16
  237. package/dist/beta/components/Table/DataTable/internal/context/hover/DTHoverContext.d.ts +0 -31
  238. package/dist/beta/components/Table/DataTable/internal/context/hover/DTHoverProvider.d.ts +0 -3
  239. package/dist/beta/components/Table/DataTable/internal/context/hover/useDTHoverDispatchContext.d.ts +0 -1
  240. package/dist/beta/components/Table/DataTable/internal/context/hover/useDTHoverStateContext.d.ts +0 -4
  241. package/dist/beta/components/Table/internal/getColSpanWidth.d.ts +0 -7
  242. package/dist/useInitialFocus-DbaB-x5T.js.map +0 -1
  243. /package/dist/{anvil-fonts.css → AnvilProvider.css} +0 -0
@@ -1,56 +1,58 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { C as Chip } from './Chip-BnofwIUN.js';
2
+ import { C as Chip } from './Chip-Ce0WGKAc.js';
3
3
  import { F as Flex } from './Flex-WyyZm1bf.js';
4
4
  import * as React from 'react';
5
- import { useRef, useState, useLayoutEffect, createContext, useContext, useCallback, forwardRef, useMemo, useImperativeHandle, useEffect, useId, Fragment as Fragment$1, useReducer } from 'react';
5
+ import { useRef, useState, useLayoutEffect, createContext, useContext, useCallback, forwardRef, useMemo, useImperativeHandle, useEffect, useId, memo as memo$1, Fragment as Fragment$1, isValidElement } from 'react';
6
6
  import { c as cx } from './index-De1g9FRV.js';
7
7
  import { D as DateTime } from './luxon-wpz4A-OQ.js';
8
- import { C as Checkbox } from './Checkbox-DbaZrUE2.js';
9
- import { B as Button } from './Button-a_D7tUgM.js';
8
+ import { C as Checkbox } from './Checkbox-Cw1-KFvq.js';
9
+ import { B as Button } from './Button-BdrrhBTI.js';
10
10
  import { S as SvgChevronRight } from './chevron_right-BdpsxX7x.js';
11
11
  import { S as SvgEdit } from './edit-DQOiktcu.js';
12
12
  import { I as Icon } from './Icon-DuIlne4x.js';
13
13
  import { S as SrOnly } from './SrOnly-eUpYGpAT.js';
14
14
  import { u as useNumberField } from './useNumberField-eMyk7MB8.js';
15
15
  import { u as useMergeRefs, m as mergeRefs } from './useMergeRefs-Dfmtq9cI.js';
16
- import { a as SelectMenuSync, S as SelectMenu } from './SelectMenuSync-CuZp9mnt.js';
17
- import { a as MultiSelectMenuSync, M as MultiSelectMenu } from './MultiSelectMenuSync-B_mXpTEe.js';
16
+ import { a as SelectMenuSync, S as SelectMenu } from './SelectMenuSync-DXrwecFt.js';
17
+ import { a as MultiSelectMenuSync, M as MultiSelectMenu } from './MultiSelectMenuSync-7C1wW4oO.js';
18
+ import { F as FieldLabel } from './FieldLabel-HO2VP-4B.js';
18
19
  import { S as SvgError } from './error-DR_wWdYY.js';
19
20
  import { S as SvgWarning } from './warning-c4Wj1rI4.js';
20
21
  import { T as Tooltip } from './Tooltip-C1PBRnJv.js';
21
22
  import { flushSync } from 'react-dom';
22
23
  import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-DMDdfIah.js';
23
- import './anvil-fonts.css';import './DataTable.css';/* empty css */
24
- import { P as Pagination } from './Pagination-CjGmJ_rU.js';
24
+ import { P as Pagination } from './Pagination-B5jqHYG3.js';
25
25
  import { T as ThemeProviderContext } from './ThemeProviderContext-l52GohYT.js';
26
+ import { u as useVirtualizer } from './index-DXeGMe23.js';
26
27
  import { S as Spinner } from './Spinner-BqmcE2pb.js';
27
28
  import { u as useOptionallyControlledState } from './useOptionallyControlledState-DbDuos5L.js';
28
29
  import { u as usePrefersColorScheme } from './usePrefersColorScheme-_hT7dK7_.js';
29
30
 
30
- const booleanFormatter = (value, { trueLabel = "True", falseLabel = "False" } = {}) => {
31
+ import './DataTable.css';const booleanFormatter = (value, { trueLabel = "True", falseLabel = "False" } = {}) => {
31
32
  if (value == null) {
32
33
  return null;
33
34
  }
34
35
  return value ? trueLabel : falseLabel;
35
36
  };
36
37
 
37
- const styles$e = {
38
- "table-header-cell": "_table-header-cell_1ffr7_2",
39
- "table-body-cell": "_table-body-cell_1ffr7_3",
40
- "table-footer-cell": "_table-footer-cell_1ffr7_4",
41
- "last-pinned-left-column": "_last-pinned-left-column_1ffr7_33",
42
- "first-pinned-right-column": "_first-pinned-right-column_1ffr7_33",
43
- "empty-cell": "_empty-cell_1ffr7_54",
44
- "table-cell-internal-select": "_table-cell-internal-select_1ffr7_71",
45
- "table-cell-internal-expand": "_table-cell-internal-expand_1ffr7_72",
46
- "table-header-cell-group": "_table-header-cell-group_1ffr7_91",
47
- "table-header-cell-sortable": "_table-header-cell-sortable_1ffr7_100"};
38
+ const styles$f = {
39
+ "table-header-cell": "_table-header-cell_nfkc_2",
40
+ "table-body-cell": "_table-body-cell_nfkc_3",
41
+ "table-footer-cell": "_table-footer-cell_nfkc_4",
42
+ "last-pinned-left-column": "_last-pinned-left-column_nfkc_33",
43
+ "first-pinned-right-column": "_first-pinned-right-column_nfkc_33",
44
+ "empty-cell": "_empty-cell_nfkc_54",
45
+ "table-cell-internal-select": "_table-cell-internal-select_nfkc_71",
46
+ "table-cell-internal-expand": "_table-cell-internal-expand_nfkc_72",
47
+ "table-header-cell-group": "_table-header-cell-group_nfkc_91",
48
+ "table-header-cell-sortable": "_table-header-cell-sortable_nfkc_100",
49
+ "table-header-cell-interactive": "_table-header-cell-interactive_nfkc_101"};
48
50
 
49
51
  const TableEmptyCellContent = () => {
50
- return /* @__PURE__ */ jsx("span", { "aria-label": "empty table cell", className: styles$e["empty-cell"], children: "—" });
52
+ return /* @__PURE__ */ jsx("span", { "aria-label": "empty table cell", className: styles$f["empty-cell"], children: "—" });
51
53
  };
52
54
 
53
- const styles$d = {
55
+ const styles$e = {
54
56
  "truncate-chips": "_truncate-chips_1lgyk_2"
55
57
  };
56
58
 
@@ -136,7 +138,7 @@ const TruncateChips = ({
136
138
  "div",
137
139
  {
138
140
  ref: containerRef,
139
- className: cx(styles$d["truncate-chips"], className),
141
+ className: cx(styles$e["truncate-chips"], className),
140
142
  style: {
141
143
  marginInlineEnd: plusChipWidth
142
144
  },
@@ -250,6 +252,238 @@ const dateTimeFormatter = (value, {
250
252
  return localizedDateTime.toLocaleString(formatOptions);
251
253
  };
252
254
 
255
+ const SUPPORTED_INLINE_TAGS = ["strong", "b", "em", "i", "code", "mark"];
256
+ const INLINE_TAG_REGEX = new RegExp(
257
+ `<(${SUPPORTED_INLINE_TAGS.join("|")})(\\s[^>]*)?>([\\s\\S]*?)</\\1>`,
258
+ "gi"
259
+ );
260
+ const INLINE_WRAPPERS = {
261
+ strong: ["**", "**"],
262
+ b: ["**", "**"],
263
+ em: ["*", "*"],
264
+ i: ["*", "*"],
265
+ code: ["`", "`"],
266
+ mark: ["==", "=="]
267
+ };
268
+ function convertInlineTags(html) {
269
+ let result = html;
270
+ let previous = "";
271
+ while (result !== previous) {
272
+ previous = result;
273
+ result = result.replace(INLINE_TAG_REGEX, (_, tag, _attrs, content) => {
274
+ const normalizedTag = tag.toLowerCase();
275
+ const wrapper = INLINE_WRAPPERS[normalizedTag];
276
+ if (!wrapper) return content;
277
+ return wrapper[0] + convertInlineTags(content) + wrapper[1];
278
+ });
279
+ }
280
+ return result;
281
+ }
282
+ const BR_REGEX = /<br\s*\/?>/gi;
283
+ const P_OPEN_REGEX = /<p(\s[^>]*)?>/gi;
284
+ const P_CLOSE_REGEX = /<\/p>/gi;
285
+ const NAMED_ENTITIES = {
286
+ amp: "&",
287
+ lt: "<",
288
+ gt: ">",
289
+ nbsp: " ",
290
+ quot: '"',
291
+ "#39": "'"
292
+ };
293
+ const ENTITY_REGEX = /&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z]+);/g;
294
+ function decodeEntities(text) {
295
+ return text.replace(ENTITY_REGEX, (match, entity) => {
296
+ if (entity.startsWith("#x")) {
297
+ return String.fromCharCode(parseInt(entity.slice(2), 16));
298
+ }
299
+ if (entity.startsWith("#")) {
300
+ return String.fromCharCode(parseInt(entity.slice(1), 10));
301
+ }
302
+ return NAMED_ENTITIES[entity] ?? match;
303
+ });
304
+ }
305
+ const SUPPORTED_TAGS = [
306
+ "strong",
307
+ "b",
308
+ "em",
309
+ "i",
310
+ "code",
311
+ "mark",
312
+ "ul",
313
+ "ol",
314
+ "li",
315
+ "br",
316
+ "p"
317
+ ];
318
+ const UNSUPPORTED_TAG_REGEX = new RegExp(
319
+ `<(?!/?(?:${SUPPORTED_TAGS.join("|")})\\b)[a-zA-Z][^>]*>[\\s\\S]*?</[a-zA-Z][^>]*>`,
320
+ "gi"
321
+ );
322
+ const ORPHANED_CLOSE_TAG_REGEX = new RegExp(
323
+ `</(?!(?:${SUPPORTED_TAGS.join("|")})\\b)[a-zA-Z][^>]*>`,
324
+ "gi"
325
+ );
326
+ function removeUnsupportedTags(html) {
327
+ let result = html;
328
+ let previous = "";
329
+ while (result !== previous) {
330
+ previous = result;
331
+ result = result.replace(UNSUPPORTED_TAG_REGEX, "");
332
+ }
333
+ result = result.replace(ORPHANED_CLOSE_TAG_REGEX, "");
334
+ return result;
335
+ }
336
+ const UL_REGEX = /<ul(\s[^>]*)?>[\s\S]*?<\/ul>/gi;
337
+ const OL_REGEX = /<ol(\s[^>]*)?>[\s\S]*?<\/ol>/gi;
338
+ const LI_REGEX = /<li(\s[^>]*)?>[\s\S]*?<\/li>/gi;
339
+ const LI_CONTENT_REGEX = /^<li(\s[^>]*)?>|<\/li>$/gi;
340
+ function convertList(listHtml, ordered) {
341
+ const items = listHtml.match(LI_REGEX);
342
+ if (!items) return "";
343
+ return items.map((item, index) => {
344
+ const content = convertInlineTags(
345
+ item.replace(LI_CONTENT_REGEX, "").trim()
346
+ );
347
+ return ordered ? `${index + 1}. ${content}` : `- ${content}`;
348
+ }).join("\n");
349
+ }
350
+ function convertLists(html) {
351
+ let result = html;
352
+ result = result.replace(UL_REGEX, (match) => convertList(match, false));
353
+ result = result.replace(OL_REGEX, (match) => convertList(match, true));
354
+ return result;
355
+ }
356
+ function htmlToMarkdown(value) {
357
+ if (value == null || value === "") {
358
+ return "";
359
+ }
360
+ let result = value;
361
+ result = removeUnsupportedTags(result);
362
+ result = result.replace(P_OPEN_REGEX, "");
363
+ result = result.replace(P_CLOSE_REGEX, "\n");
364
+ result = convertLists(result);
365
+ result = result.replace(BR_REGEX, "\n");
366
+ result = convertInlineTags(result);
367
+ result = decodeEntities(result);
368
+ result = result.replace(/\n+$/, "");
369
+ return result;
370
+ }
371
+
372
+ const code = "_code_1u8e7_1";
373
+ const highlight = "_highlight_1u8e7_2";
374
+ const list = "_list_1u8e7_3";
375
+ const container = "_container_1u8e7_4";
376
+ const styles$d = {
377
+ code: code,
378
+ highlight: highlight,
379
+ list: list,
380
+ container: container
381
+ };
382
+
383
+ const INLINE_REGEX = /\*\*\*(.+?)\*\*\*|\*\*(.+?)\*\*|\*(.+?)\*|==(.+?)==|`(.+?)`/g;
384
+ const UNORDERED_LIST_REGEX = /^- (.+)$/;
385
+ const ORDERED_LIST_REGEX = /^\d+\. (.+)$/;
386
+ function parseInline(text) {
387
+ const parts = [];
388
+ let lastIndex = 0;
389
+ INLINE_REGEX.lastIndex = 0;
390
+ let match;
391
+ while ((match = INLINE_REGEX.exec(text)) !== null) {
392
+ if (match.index > lastIndex) {
393
+ parts.push(text.substring(lastIndex, match.index));
394
+ }
395
+ const key = match.index;
396
+ const savedIndex = INLINE_REGEX.lastIndex;
397
+ if (match[1]) {
398
+ parts.push(
399
+ /* @__PURE__ */ jsx("strong", { children: /* @__PURE__ */ jsx("em", { children: parseInline(match[1]) }) }, key)
400
+ );
401
+ } else if (match[2]) {
402
+ parts.push(/* @__PURE__ */ jsx("strong", { children: parseInline(match[2]) }, key));
403
+ } else if (match[3]) {
404
+ parts.push(/* @__PURE__ */ jsx("em", { children: parseInline(match[3]) }, key));
405
+ } else if (match[4]) {
406
+ parts.push(
407
+ /* @__PURE__ */ jsx("mark", { className: styles$d.highlight, children: parseInline(match[4]) }, key)
408
+ );
409
+ } else if (match[5]) {
410
+ parts.push(
411
+ /* @__PURE__ */ jsx("code", { className: styles$d.code, children: match[5] }, key)
412
+ );
413
+ }
414
+ INLINE_REGEX.lastIndex = savedIndex;
415
+ lastIndex = savedIndex;
416
+ }
417
+ if (lastIndex < text.length) {
418
+ parts.push(text.substring(lastIndex));
419
+ }
420
+ return parts;
421
+ }
422
+ function parseBlocks(text) {
423
+ const lines = text.split("\n");
424
+ const blocks = [];
425
+ let i = 0;
426
+ while (i < lines.length) {
427
+ const line = lines[i];
428
+ const ulMatch = line.match(UNORDERED_LIST_REGEX);
429
+ const olMatch = line.match(ORDERED_LIST_REGEX);
430
+ if (ulMatch) {
431
+ const items = [ulMatch[1]];
432
+ i++;
433
+ while (i < lines.length) {
434
+ const nextUl = lines[i].match(UNORDERED_LIST_REGEX);
435
+ if (!nextUl) break;
436
+ items.push(nextUl[1]);
437
+ i++;
438
+ }
439
+ blocks.push({ type: "ul", items });
440
+ } else if (olMatch) {
441
+ const items = [olMatch[1]];
442
+ i++;
443
+ while (i < lines.length) {
444
+ const nextOl = lines[i].match(ORDERED_LIST_REGEX);
445
+ if (!nextOl) break;
446
+ items.push(nextOl[1]);
447
+ i++;
448
+ }
449
+ blocks.push({ type: "ol", items });
450
+ } else {
451
+ if (line !== "") {
452
+ blocks.push({ type: "text", content: line });
453
+ }
454
+ i++;
455
+ }
456
+ }
457
+ return blocks;
458
+ }
459
+ function renderBlocks(blocks) {
460
+ return blocks.map((block, index) => {
461
+ switch (block.type) {
462
+ case "text":
463
+ return /* @__PURE__ */ jsx("span", { children: parseInline(block.content) }, index);
464
+ case "ul":
465
+ return /* @__PURE__ */ jsx("ul", { className: styles$d.list, children: block.items.map((item, i) => /* @__PURE__ */ jsx("li", { children: parseInline(item) }, i)) }, index);
466
+ case "ol":
467
+ return /* @__PURE__ */ jsx("ol", { className: styles$d.list, children: block.items.map((item, i) => /* @__PURE__ */ jsx("li", { children: parseInline(item) }, i)) }, index);
468
+ }
469
+ });
470
+ }
471
+ const markdownFormatter = (value) => {
472
+ if (value == null || value === "") {
473
+ return null;
474
+ }
475
+ const blocks = parseBlocks(value);
476
+ if (blocks.length === 1 && blocks[0].type === "text") {
477
+ return /* @__PURE__ */ jsx(Fragment, { children: parseInline(blocks[0].content) });
478
+ }
479
+ return /* @__PURE__ */ jsx("div", { className: styles$d.container, children: renderBlocks(blocks) });
480
+ };
481
+
482
+ const htmlFormatter = (value) => {
483
+ const markdown = htmlToMarkdown(value);
484
+ return markdownFormatter(markdown);
485
+ };
486
+
253
487
  const numberFormatter = (value, options = {}) => {
254
488
  const {
255
489
  locale = "en-US",
@@ -391,6 +625,14 @@ const COLUMN_TYPE_DEFAULTS = {
391
625
  value,
392
626
  options
393
627
  )
628
+ },
629
+ markdown: {
630
+ align: "start",
631
+ createRenderCell: () => (value) => markdownFormatter(value)
632
+ },
633
+ html: {
634
+ align: "start",
635
+ createRenderCell: () => (value) => htmlFormatter(value)
394
636
  }
395
637
  };
396
638
  function resolveColumnTypeConfig(config) {
@@ -951,7 +1193,7 @@ const createRow = (table, id, original, rowIndex, depth, subRows, parentId) => {
951
1193
  var _row$getValue;
952
1194
  return (_row$getValue = row.getValue(columnId)) != null ? _row$getValue : table.options.renderFallbackValue;
953
1195
  },
954
- subRows: subRows != null ? subRows : [],
1196
+ subRows: [],
955
1197
  getLeafRows: () => flattenBy(row.subRows, d => d.subRows),
956
1198
  getParentRow: () => row.parentId ? table.getRow(row.parentId, true) : undefined,
957
1199
  getParentRows: () => {
@@ -3416,146 +3658,6 @@ function expandRows(rowModel) {
3416
3658
  };
3417
3659
  }
3418
3660
 
3419
- function getGroupedRowModel() {
3420
- return table => memo(() => [table.getState().grouping, table.getPreGroupedRowModel()], (grouping, rowModel) => {
3421
- if (!rowModel.rows.length || !grouping.length) {
3422
- rowModel.rows.forEach(row => {
3423
- row.depth = 0;
3424
- row.parentId = undefined;
3425
- });
3426
- return rowModel;
3427
- }
3428
-
3429
- // Filter the grouping list down to columns that exist
3430
- const existingGrouping = grouping.filter(columnId => table.getColumn(columnId));
3431
- const groupedFlatRows = [];
3432
- const groupedRowsById = {};
3433
- // const onlyGroupedFlatRows: Row[] = [];
3434
- // const onlyGroupedRowsById: Record<RowId, Row> = {};
3435
- // const nonGroupedFlatRows: Row[] = [];
3436
- // const nonGroupedRowsById: Record<RowId, Row> = {};
3437
-
3438
- // Recursively group the data
3439
- const groupUpRecursively = function (rows, depth, parentId) {
3440
- if (depth === void 0) {
3441
- depth = 0;
3442
- }
3443
- // Grouping depth has been been met
3444
- // Stop grouping and simply rewrite thd depth and row relationships
3445
- if (depth >= existingGrouping.length) {
3446
- return rows.map(row => {
3447
- row.depth = depth;
3448
- groupedFlatRows.push(row);
3449
- groupedRowsById[row.id] = row;
3450
- if (row.subRows) {
3451
- row.subRows = groupUpRecursively(row.subRows, depth + 1, row.id);
3452
- }
3453
- return row;
3454
- });
3455
- }
3456
- const columnId = existingGrouping[depth];
3457
-
3458
- // Group the rows together for this level
3459
- const rowGroupsMap = groupBy(rows, columnId);
3460
-
3461
- // Perform aggregations for each group
3462
- const aggregatedGroupedRows = Array.from(rowGroupsMap.entries()).map((_ref, index) => {
3463
- let [groupingValue, groupedRows] = _ref;
3464
- let id = `${columnId}:${groupingValue}`;
3465
- id = parentId ? `${parentId}>${id}` : id;
3466
-
3467
- // First, Recurse to group sub rows before aggregation
3468
- const subRows = groupUpRecursively(groupedRows, depth + 1, id);
3469
- subRows.forEach(subRow => {
3470
- subRow.parentId = id;
3471
- });
3472
-
3473
- // Flatten the leaf rows of the rows in this group
3474
- const leafRows = depth ? flattenBy(groupedRows, row => row.subRows) : groupedRows;
3475
- const row = createRow(table, id, leafRows[0].original, index, depth, undefined, parentId);
3476
- Object.assign(row, {
3477
- groupingColumnId: columnId,
3478
- groupingValue,
3479
- subRows,
3480
- leafRows,
3481
- getValue: columnId => {
3482
- // Don't aggregate columns that are in the grouping
3483
- if (existingGrouping.includes(columnId)) {
3484
- if (row._valuesCache.hasOwnProperty(columnId)) {
3485
- return row._valuesCache[columnId];
3486
- }
3487
- if (groupedRows[0]) {
3488
- var _groupedRows$0$getVal;
3489
- row._valuesCache[columnId] = (_groupedRows$0$getVal = groupedRows[0].getValue(columnId)) != null ? _groupedRows$0$getVal : undefined;
3490
- }
3491
- return row._valuesCache[columnId];
3492
- }
3493
- if (row._groupingValuesCache.hasOwnProperty(columnId)) {
3494
- return row._groupingValuesCache[columnId];
3495
- }
3496
-
3497
- // Aggregate the values
3498
- const column = table.getColumn(columnId);
3499
- const aggregateFn = column == null ? void 0 : column.getAggregationFn();
3500
- if (aggregateFn) {
3501
- row._groupingValuesCache[columnId] = aggregateFn(columnId, leafRows, groupedRows);
3502
- return row._groupingValuesCache[columnId];
3503
- }
3504
- }
3505
- });
3506
- subRows.forEach(subRow => {
3507
- groupedFlatRows.push(subRow);
3508
- groupedRowsById[subRow.id] = subRow;
3509
- // if (subRow.getIsGrouped?.()) {
3510
- // onlyGroupedFlatRows.push(subRow);
3511
- // onlyGroupedRowsById[subRow.id] = subRow;
3512
- // } else {
3513
- // nonGroupedFlatRows.push(subRow);
3514
- // nonGroupedRowsById[subRow.id] = subRow;
3515
- // }
3516
- });
3517
- return row;
3518
- });
3519
- return aggregatedGroupedRows;
3520
- };
3521
- const groupedRows = groupUpRecursively(rowModel.rows, 0);
3522
- groupedRows.forEach(subRow => {
3523
- groupedFlatRows.push(subRow);
3524
- groupedRowsById[subRow.id] = subRow;
3525
- // if (subRow.getIsGrouped?.()) {
3526
- // onlyGroupedFlatRows.push(subRow);
3527
- // onlyGroupedRowsById[subRow.id] = subRow;
3528
- // } else {
3529
- // nonGroupedFlatRows.push(subRow);
3530
- // nonGroupedRowsById[subRow.id] = subRow;
3531
- // }
3532
- });
3533
- return {
3534
- rows: groupedRows,
3535
- flatRows: groupedFlatRows,
3536
- rowsById: groupedRowsById
3537
- };
3538
- }, getMemoOptions(table.options, 'debugTable', 'getGroupedRowModel', () => {
3539
- table._queue(() => {
3540
- table._autoResetExpanded();
3541
- table._autoResetPageIndex();
3542
- });
3543
- }));
3544
- }
3545
- function groupBy(rows, columnId) {
3546
- const groupMap = new Map();
3547
- return rows.reduce((map, row) => {
3548
- const resKey = `${row.getGroupingValue(columnId)}`;
3549
- const previous = map.get(resKey);
3550
- if (!previous) {
3551
- map.set(resKey, [row]);
3552
- } else {
3553
- previous.push(row);
3554
- }
3555
- return map;
3556
- }, groupMap);
3557
- }
3558
-
3559
3661
  function getPaginationRowModel(opts) {
3560
3662
  return table => memo(() => [table.getState().pagination, table.getPrePaginationRowModel(), table.options.paginateExpandedRows ? undefined : table.getState().expanded], (pagination, rowModel) => {
3561
3663
  if (!rowModel.rows.length) {
@@ -3818,8 +3920,8 @@ function useDTFocusDispatchContext() {
3818
3920
  }
3819
3921
 
3820
3922
  const styles$c = {
3821
- "table-base": "_table-base_11xh7_2",
3822
- "data-table-base": "_data-table-base_11xh7_15"
3923
+ "table-base": "_table-base_1ihr3_2",
3924
+ "data-table-base": "_data-table-base_1ihr3_15"
3823
3925
  };
3824
3926
 
3825
3927
  const SimpleTableBase = ({
@@ -3847,7 +3949,7 @@ const DataTableBase = ({
3847
3949
  ...rest
3848
3950
  }) => {
3849
3951
  const tableBaseClassNames = cx(className, styles$c["data-table-base"]);
3850
- const { focusTableGenerally, blur } = useDTFocusDispatchContext();
3952
+ const { focusTableGenerally, blur, moveFocusToCell } = useDTFocusDispatchContext();
3851
3953
  const handleBlur = (event) => {
3852
3954
  if (!event.currentTarget.contains(event.relatedTarget)) {
3853
3955
  blur();
@@ -3856,6 +3958,16 @@ const DataTableBase = ({
3856
3958
  const handleFocus = (event) => {
3857
3959
  if (event.target === event.currentTarget) {
3858
3960
  focusTableGenerally();
3961
+ return;
3962
+ }
3963
+ const targetEl = event.target;
3964
+ const cellEl = targetEl.closest("[data-cell-pos]");
3965
+ const cellPosAttr = cellEl?.getAttribute("data-cell-pos");
3966
+ if (cellPosAttr) {
3967
+ const [rowIndex, columnIndex] = cellPosAttr.split(",").map(Number);
3968
+ if (!Number.isNaN(rowIndex) && !Number.isNaN(columnIndex)) {
3969
+ moveFocusToCell({ rowIndex, columnIndex });
3970
+ }
3859
3971
  }
3860
3972
  };
3861
3973
  return /* @__PURE__ */ jsx(
@@ -3913,10 +4025,10 @@ const getCommonPinningClasses = (column) => {
3913
4025
  const isLastLeftPinnedColumn = isPinned === "left" && column.getIsLastColumn("left");
3914
4026
  const isFirstRightPinnedColumn = isPinned === "right" && column.getIsFirstColumn("right");
3915
4027
  if (isLastLeftPinnedColumn) {
3916
- return styles$e["last-pinned-left-column"];
4028
+ return styles$f["last-pinned-left-column"];
3917
4029
  }
3918
4030
  if (isFirstRightPinnedColumn) {
3919
- return styles$e["first-pinned-right-column"];
4031
+ return styles$f["first-pinned-right-column"];
3920
4032
  }
3921
4033
  };
3922
4034
 
@@ -3939,9 +4051,9 @@ const DataTableEditableCellEditIcon = () => {
3939
4051
  };
3940
4052
 
3941
4053
  const TableBodyCell = forwardRef(({ type, children, className, isExpandCell, isSelectCell, ...rest }, ref) => {
3942
- const classes = cx(styles$e["table-body-cell"], className, {
3943
- [styles$e["table-cell-internal-expand"]]: isExpandCell,
3944
- [styles$e["table-cell-internal-select"]]: isSelectCell
4054
+ const classes = cx(styles$f["table-body-cell"], className, {
4055
+ [styles$f["table-cell-internal-expand"]]: isExpandCell,
4056
+ [styles$f["table-cell-internal-select"]]: isSelectCell
3945
4057
  });
3946
4058
  const CellElement = type === "simple" ? "td" : "div";
3947
4059
  return /* @__PURE__ */ jsx(
@@ -3959,19 +4071,19 @@ const TableBodyCell = forwardRef(({ type, children, className, isExpandCell, isS
3959
4071
  TableBodyCell.displayName = "TableBodyCell";
3960
4072
 
3961
4073
  const styles$9 = {
3962
- "data-table-body-cell": "_data-table-body-cell_l8lyo_2",
3963
- "data-table-body-cell-input": "_data-table-body-cell-input_l8lyo_3",
3964
- "table-body-cell": "_table-body-cell_l8lyo_18",
3965
- "table-header-cell": "_table-header-cell_l8lyo_19",
3966
- "table-footer-cell": "_table-footer-cell_l8lyo_20",
3967
- "data-table-body-cell-editing": "_data-table-body-cell-editing_l8lyo_32",
3968
- "data-table-header-cell": "_data-table-header-cell_l8lyo_33",
3969
- "data-table-footer-cell": "_data-table-footer-cell_l8lyo_36",
3970
- "data-table-body-cell-hovered": "_data-table-body-cell-hovered_l8lyo_82",
3971
- "data-table-body-cell-error": "_data-table-body-cell-error_l8lyo_85",
3972
- "data-table-body-cell-warning": "_data-table-body-cell-warning_l8lyo_102",
3973
- "cell-error-icon": "_cell-error-icon_l8lyo_111",
3974
- "cell-warning-icon": "_cell-warning-icon_l8lyo_112"
4074
+ "data-table-body-cell": "_data-table-body-cell_ab20z_2",
4075
+ "data-table-body-cell-input": "_data-table-body-cell-input_ab20z_3",
4076
+ "table-body-cell": "_table-body-cell_ab20z_18",
4077
+ "table-header-cell": "_table-header-cell_ab20z_19",
4078
+ "table-footer-cell": "_table-footer-cell_ab20z_20",
4079
+ "data-table-cell-content": "_data-table-cell-content_ab20z_30",
4080
+ "data-table-body-cell-editing": "_data-table-body-cell-editing_ab20z_51",
4081
+ "data-table-header-cell": "_data-table-header-cell_ab20z_52",
4082
+ "data-table-footer-cell": "_data-table-footer-cell_ab20z_55",
4083
+ "data-table-body-cell-error": "_data-table-body-cell-error_ab20z_104",
4084
+ "data-table-body-cell-warning": "_data-table-body-cell-warning_ab20z_121",
4085
+ "cell-error-icon": "_cell-error-icon_ab20z_130",
4086
+ "cell-warning-icon": "_cell-warning-icon_ab20z_131"
3975
4087
  };
3976
4088
 
3977
4089
  function formatCellPositionString(cellPosition) {
@@ -4018,37 +4130,33 @@ const getCommonPinningStyles = (column) => {
4018
4130
  zIndex: isPinned ? 1 : 0
4019
4131
  };
4020
4132
  };
4133
+ const EMPTY_PINNING_STYLES = Object.freeze({
4134
+ left: void 0,
4135
+ right: void 0,
4136
+ position: "relative",
4137
+ zIndex: 0
4138
+ });
4021
4139
  const useCommonPinningStyles = (column) => {
4140
+ const isPinned = column.getIsPinned();
4022
4141
  const left = column.getStart("left");
4023
4142
  const right = column.getAfter("right");
4024
- const isPinned = column.getIsPinned();
4025
- return useMemo(
4026
- () => ({
4143
+ return useMemo(() => {
4144
+ if (!isPinned) return EMPTY_PINNING_STYLES;
4145
+ return {
4027
4146
  left: isPinned === "left" ? `${left}px` : void 0,
4028
4147
  right: isPinned === "right" ? `${right}px` : void 0,
4029
- position: isPinned ? "sticky" : "relative",
4030
- zIndex: isPinned ? 1 : 0
4031
- }),
4032
- [left, right, isPinned]
4033
- );
4148
+ position: "sticky",
4149
+ zIndex: 1
4150
+ };
4151
+ }, [left, right, isPinned]);
4034
4152
  };
4035
4153
 
4036
4154
  const INTERNAL_ROW_ACTION_PRIMARY_COLUMN_ID = "a2-table-internal-row-action-primary";
4037
4155
  const INTERNAL_ROW_ACTION_SECONDARY_COLUMN_ID = "a2-table-internal-row-action-secondary";
4038
4156
 
4039
- const CellFocusContext = createContext(
4040
- null
4041
- );
4042
- function useCellFocusContext() {
4043
- return useContext(CellFocusContext);
4044
- }
4045
-
4046
4157
  function DataTableBodyImmutableCell(props) {
4047
- const { cell, cellPosition, children, isHovered, ...rest } = props;
4158
+ const { cell, cellPosition, children, ...rest } = props;
4048
4159
  const cellRef = useRef(null);
4049
- const [tabIndex, setTabIndex] = useState(-1);
4050
- const [isFocused, setIsFocused] = useState(false);
4051
- const { moveFocusToCell } = useDTFocusDispatchContext();
4052
4160
  const column = cell.column;
4053
4161
  const rowCanExpand = cell.row.getCanExpand();
4054
4162
  const rowIsExpanded = cell.row.getIsExpanded();
@@ -4063,11 +4171,10 @@ function DataTableBodyImmutableCell(props) {
4063
4171
  const cellError = meta?.errors?.[column.id];
4064
4172
  const cellWarning = meta?.warnings?.[column.id];
4065
4173
  const classes = cx(styles$9["data-table-body-cell"], rest.className, {
4066
- [styles$9["data-table-body-cell-hovered"]]: isHovered,
4067
4174
  [styles$9["data-table-body-cell-error"]]: !!cellError,
4068
4175
  [styles$9["data-table-body-cell-warning"]]: !cellError && !!cellWarning,
4069
- [styles$e["table-cell-internal-expand"]]: isExpandCell,
4070
- [styles$e["table-cell-internal-select"]]: isSelectCell
4176
+ [styles$f["table-cell-internal-expand"]]: isExpandCell,
4177
+ [styles$f["table-cell-internal-select"]]: isSelectCell
4071
4178
  });
4072
4179
  const commonPinningStyles = useCommonPinningStyles(column);
4073
4180
  const { jumpFocus, moveFocus } = useDTFocusDispatchContext();
@@ -4135,19 +4242,6 @@ function DataTableBodyImmutableCell(props) {
4135
4242
  toggleRowExpanded
4136
4243
  ]
4137
4244
  );
4138
- const handleFocus = useCallback(() => {
4139
- setTabIndex(0);
4140
- setIsFocused(true);
4141
- moveFocusToCell(cellPosition);
4142
- }, [moveFocusToCell, cellPosition]);
4143
- const handleBlur = useCallback(() => {
4144
- setTabIndex(-1);
4145
- setIsFocused(false);
4146
- }, []);
4147
- const cellFocusContextValue = useMemo(
4148
- () => ({ isCellFocused: isFocused }),
4149
- [isFocused]
4150
- );
4151
4245
  return /* @__PURE__ */ jsx(
4152
4246
  TableBodyCell,
4153
4247
  {
@@ -4155,13 +4249,11 @@ function DataTableBodyImmutableCell(props) {
4155
4249
  ...rest,
4156
4250
  className: classes,
4157
4251
  ref: cellRef,
4158
- tabIndex,
4159
- onFocus: handleFocus,
4160
- onBlur: handleBlur,
4252
+ tabIndex: -1,
4161
4253
  style: commonPinningStyles,
4162
4254
  onKeyDown: handleKeyDown,
4163
4255
  "data-cell-pos": formatCellPositionString(cellPosition),
4164
- children: /* @__PURE__ */ jsx(CellFocusContext.Provider, { value: cellFocusContextValue, children })
4256
+ children
4165
4257
  }
4166
4258
  );
4167
4259
  }
@@ -4290,10 +4382,6 @@ function DataTableEditableTextCellInner(props, ref) {
4290
4382
  },
4291
4383
  [beginEditing, cellPosition, moveFocusToCell]
4292
4384
  );
4293
- const cellFocusContextValue = useMemo(
4294
- () => ({ isCellFocused: tabIndex === 0 && !isEditing }),
4295
- [tabIndex, isEditing]
4296
- );
4297
4385
  useEffect(() => {
4298
4386
  if (isEditing) {
4299
4387
  inputRef.current?.focus();
@@ -4329,7 +4417,7 @@ function DataTableEditableTextCellInner(props, ref) {
4329
4417
  onBlur: handleInputBlur,
4330
4418
  onKeyDown: handleInputKeyDown
4331
4419
  }
4332
- ) }) : /* @__PURE__ */ jsxs(CellFocusContext.Provider, { value: cellFocusContextValue, children: [
4420
+ ) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
4333
4421
  children,
4334
4422
  !isEditing && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {})
4335
4423
  ] }),
@@ -4488,10 +4576,6 @@ function DataTableEditableNumberCellInner(props, ref) {
4488
4576
  },
4489
4577
  [beginEditing, cellPosition, moveFocusToCell]
4490
4578
  );
4491
- const cellFocusContextValue = useMemo(
4492
- () => ({ isCellFocused: tabIndex === 0 && !isEditing }),
4493
- [tabIndex, isEditing]
4494
- );
4495
4579
  useEffect(() => {
4496
4580
  if (isEditing) {
4497
4581
  localInputRef.current?.focus();
@@ -4527,7 +4611,7 @@ function DataTableEditableNumberCellInner(props, ref) {
4527
4611
  onBlur: handleInputBlur,
4528
4612
  onKeyDown: handleInputKeyDown
4529
4613
  }
4530
- ) }) : /* @__PURE__ */ jsxs(CellFocusContext.Provider, { value: cellFocusContextValue, children: [
4614
+ ) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
4531
4615
  children,
4532
4616
  !isEditing && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {})
4533
4617
  ] }),
@@ -4605,10 +4689,6 @@ function useEditableMenuCell({
4605
4689
  },
4606
4690
  []
4607
4691
  );
4608
- const cellFocusContextValue = useMemo(
4609
- () => ({ isCellFocused: tabIndex === 0 }),
4610
- [tabIndex]
4611
- );
4612
4692
  return {
4613
4693
  tabIndex,
4614
4694
  cellRef,
@@ -4618,8 +4698,7 @@ function useEditableMenuCell({
4618
4698
  handleImplicitClose,
4619
4699
  handleCellMouseDown,
4620
4700
  handleCellBlur,
4621
- handleCellFocus,
4622
- cellFocusContextValue
4701
+ handleCellFocus
4623
4702
  };
4624
4703
  }
4625
4704
 
@@ -4656,8 +4735,7 @@ function DataTableEditableSelectCellInner(props, ref) {
4656
4735
  handleImplicitClose,
4657
4736
  handleCellMouseDown,
4658
4737
  handleCellBlur,
4659
- handleCellFocus,
4660
- cellFocusContextValue
4738
+ handleCellFocus
4661
4739
  } = useEditableMenuCell({ cellPosition, onCellKeyDown, ref });
4662
4740
  const selectedOption = useMemo(() => {
4663
4741
  if (cellValue === void 0 || cellValue === null) return null;
@@ -4703,10 +4781,8 @@ function DataTableEditableSelectCellInner(props, ref) {
4703
4781
  "data-state": dataState,
4704
4782
  onKeyDown: (e) => handleCellKeyDown(e, menuKeyDown, isOpen),
4705
4783
  children: [
4706
- /* @__PURE__ */ jsxs(CellFocusContext.Provider, { value: cellFocusContextValue, children: [
4707
- children,
4708
- !isOpen && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {})
4709
- ] }),
4784
+ children,
4785
+ !isOpen && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {}),
4710
4786
  /* @__PURE__ */ jsx(SrOnly, { children: isOpen ? "Press Enter or Space to select a cell value. Press Escape or F2 to cancel." : "Press Enter or F2 to edit cell value." })
4711
4787
  ]
4712
4788
  }
@@ -4800,8 +4876,7 @@ function DataTableEditableSelectAsyncCellInner(props, ref) {
4800
4876
  handleImplicitClose,
4801
4877
  handleCellMouseDown,
4802
4878
  handleCellBlur,
4803
- handleCellFocus,
4804
- cellFocusContextValue
4879
+ handleCellFocus
4805
4880
  } = useEditableMenuCell({ cellPosition, onCellKeyDown, ref });
4806
4881
  const selectedOption = useMemo(() => {
4807
4882
  if (cellValue === void 0 || cellValue === null) return null;
@@ -4852,10 +4927,8 @@ function DataTableEditableSelectAsyncCellInner(props, ref) {
4852
4927
  "data-state": dataState,
4853
4928
  onKeyDown: (e) => handleCellKeyDown(e, menuKeyDown, isOpen),
4854
4929
  children: [
4855
- /* @__PURE__ */ jsxs(CellFocusContext.Provider, { value: cellFocusContextValue, children: [
4856
- children,
4857
- !isOpen && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {})
4858
- ] }),
4930
+ children,
4931
+ !isOpen && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {}),
4859
4932
  /* @__PURE__ */ jsx(SrOnly, { children: isOpen ? "Press Enter or Space to select a cell value. Press Escape or F2 to cancel." : "Press Enter or F2 to edit cell value." })
4860
4933
  ]
4861
4934
  }
@@ -4918,8 +4991,7 @@ function DataTableEditableMultiselectCellInner(props, ref) {
4918
4991
  handleImplicitClose,
4919
4992
  handleCellMouseDown,
4920
4993
  handleCellBlur,
4921
- handleCellFocus,
4922
- cellFocusContextValue
4994
+ handleCellFocus
4923
4995
  } = useEditableMenuCell({ cellPosition, onCellKeyDown, ref });
4924
4996
  const selectedOptions = useMemo(() => {
4925
4997
  if (!Array.isArray(cellValue)) return [];
@@ -4966,10 +5038,8 @@ function DataTableEditableMultiselectCellInner(props, ref) {
4966
5038
  "data-state": dataState,
4967
5039
  onKeyDown: (e) => handleCellKeyDown(e, menuKeyDown, isOpen),
4968
5040
  children: [
4969
- /* @__PURE__ */ jsxs(CellFocusContext.Provider, { value: cellFocusContextValue, children: [
4970
- children,
4971
- !isOpen && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {})
4972
- ] }),
5041
+ children,
5042
+ !isOpen && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {}),
4973
5043
  /* @__PURE__ */ jsx(SrOnly, { children: isOpen ? "Press Enter or Space to select cell values. Press Escape or F2 to close." : "Press Enter or F2 to edit cell value." })
4974
5044
  ]
4975
5045
  }
@@ -5064,8 +5134,7 @@ function DataTableEditableMultiselectAsyncCellInner(props, ref) {
5064
5134
  handleImplicitClose,
5065
5135
  handleCellMouseDown,
5066
5136
  handleCellBlur,
5067
- handleCellFocus,
5068
- cellFocusContextValue
5137
+ handleCellFocus
5069
5138
  } = useEditableMenuCell({ cellPosition, onCellKeyDown, ref });
5070
5139
  const selectedOptions = useMemo(() => {
5071
5140
  if (!Array.isArray(cellValue)) return [];
@@ -5115,10 +5184,8 @@ function DataTableEditableMultiselectAsyncCellInner(props, ref) {
5115
5184
  "data-state": dataState,
5116
5185
  onKeyDown: (e) => handleCellKeyDown(e, menuKeyDown, isOpen),
5117
5186
  children: [
5118
- /* @__PURE__ */ jsxs(CellFocusContext.Provider, { value: cellFocusContextValue, children: [
5119
- children,
5120
- !isOpen && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {})
5121
- ] }),
5187
+ children,
5188
+ !isOpen && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {}),
5122
5189
  /* @__PURE__ */ jsx(SrOnly, { children: isOpen ? "Press Enter or Space to select cell values. Press Escape or F2 to close." : "Press Enter or F2 to edit cell value." })
5123
5190
  ]
5124
5191
  }
@@ -5209,8 +5276,7 @@ function DataTableEditableBooleanCellInner(props, ref) {
5209
5276
  handleImplicitClose,
5210
5277
  handleCellMouseDown,
5211
5278
  handleCellBlur,
5212
- handleCellFocus,
5213
- cellFocusContextValue
5279
+ handleCellFocus
5214
5280
  } = useEditableMenuCell({ cellPosition, onCellKeyDown, ref });
5215
5281
  const selectedOption = useMemo(() => {
5216
5282
  if (cellValue === void 0) return null;
@@ -5255,10 +5321,8 @@ function DataTableEditableBooleanCellInner(props, ref) {
5255
5321
  "data-state": dataState,
5256
5322
  onKeyDown: (e) => handleCellKeyDown(e, menuKeyDown, isOpen),
5257
5323
  children: [
5258
- /* @__PURE__ */ jsxs(CellFocusContext.Provider, { value: cellFocusContextValue, children: [
5259
- children,
5260
- !isOpen && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {})
5261
- ] }),
5324
+ children,
5325
+ !isOpen && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {}),
5262
5326
  /* @__PURE__ */ jsx(SrOnly, { children: isOpen ? "Press Enter or Space to select a cell value. Press Escape or F2 to cancel." : "Press Enter or F2 to edit cell value." })
5263
5327
  ]
5264
5328
  }
@@ -5288,7 +5352,7 @@ const DataTableEditableBooleanCell = Object.assign(
5288
5352
  );
5289
5353
 
5290
5354
  function DataTableBodyMutableCell(props) {
5291
- const { cell, cellPosition, children, isHovered, ...rest } = props;
5355
+ const { cell, cellPosition, children, ...rest } = props;
5292
5356
  const editableCellRef = useRef(null);
5293
5357
  const column = cell.column;
5294
5358
  const rowCanExpand = cell.row.getCanExpand();
@@ -5298,7 +5362,6 @@ function DataTableBodyMutableCell(props) {
5298
5362
  const cellError = meta?.errors?.[column.id];
5299
5363
  const cellWarning = meta?.warnings?.[column.id];
5300
5364
  const classes = cx(styles$9["data-table-body-cell"], rest.className, {
5301
- [styles$9["data-table-body-cell-hovered"]]: isHovered,
5302
5365
  [styles$9["data-table-body-cell-error"]]: !!cellError,
5303
5366
  [styles$9["data-table-body-cell-warning"]]: !cellError && !!cellWarning
5304
5367
  });
@@ -5391,14 +5454,13 @@ function DataTableBodyMutableCell(props) {
5391
5454
  onKeyDown: handleKeyDown,
5392
5455
  style: commonPinningStyles
5393
5456
  },
5394
- isHovered,
5395
5457
  children
5396
5458
  }
5397
5459
  );
5398
5460
  }
5399
5461
 
5400
5462
  function DataTableBodyCell(props) {
5401
- const { cell, cellPosition, children, isHovered, ...rest } = props;
5463
+ const { cell, cellPosition, children, ...rest } = props;
5402
5464
  const column = cell.column;
5403
5465
  const editMode = column.columnDef.meta?.editMode;
5404
5466
  const Component = editMode ? DataTableBodyMutableCell : DataTableBodyImmutableCell;
@@ -5409,51 +5471,34 @@ function DataTableBodyCell(props) {
5409
5471
  cellPosition,
5410
5472
  ...rest,
5411
5473
  "data-cell-pos": formatCellPositionString(cellPosition),
5412
- isHovered,
5413
5474
  children
5414
5475
  }
5415
5476
  );
5416
5477
  }
5417
5478
 
5418
5479
  const styles$8 = {
5419
- "data-table-body-row": "_data-table-body-row_3jgem_2",
5420
- "data-table-body-sub-component-row": "_data-table-body-sub-component-row_3jgem_22",
5421
- "data-table-body-sub-component-container": "_data-table-body-sub-component-container_3jgem_26",
5422
- "data-table-body-sub-component-content": "_data-table-body-sub-component-content_3jgem_31",
5423
- "data-table-body-cell-group": "_data-table-body-cell-group_3jgem_37"
5480
+ "data-table-body-row": "_data-table-body-row_1lv2u_2",
5481
+ "data-table-body-sub-component-row": "_data-table-body-sub-component-row_1lv2u_22",
5482
+ "data-table-body-sub-component-container": "_data-table-body-sub-component-container_1lv2u_26",
5483
+ "data-table-body-sub-component-content": "_data-table-body-sub-component-content_1lv2u_31",
5484
+ "data-table-body-virtualized": "_data-table-body-virtualized_1lv2u_35",
5485
+ "data-table-body-row-virtualized": "_data-table-body-row-virtualized_1lv2u_40",
5486
+ "data-table-body-cell-group": "_data-table-body-cell-group_1lv2u_50"
5424
5487
  };
5425
5488
 
5426
- const DTHoverStateContext = createContext({
5427
- hoveredColumnId: null,
5428
- resizingColumnId: null
5429
- });
5430
- const DTHoverDispatchContext = createContext(() => {
5431
- });
5432
-
5433
- function useDTHoverStateContext() {
5434
- const state = useContext(DTHoverStateContext);
5435
- return {
5436
- getIsHovered: (columnId) => {
5437
- return state.hoveredColumnId === columnId && !state.resizingColumnId;
5438
- },
5439
- hoveredColumnId: state.hoveredColumnId
5440
- };
5441
- }
5442
-
5443
- function DataTableBodyRow({
5489
+ function DataTableBodyRowInner({
5444
5490
  columnOrder,
5445
5491
  row,
5446
5492
  rowIndex,
5447
- tableHasSubRows
5493
+ tableHasSubRows,
5494
+ isExpanded,
5495
+ canExpand,
5496
+ depth,
5497
+ parentRowCanExpand
5448
5498
  }) {
5449
5499
  const visibleCells = row.getVisibleCells();
5450
- const canExpand = row.getCanExpand();
5451
- const isExpanded = row.getIsExpanded();
5452
- const depth = row.depth;
5453
5500
  const id = row.id;
5454
5501
  const original = row.original;
5455
- const parentRowCanExpand = row.getParentRow()?.getCanExpand() ?? false;
5456
- const { hoveredColumnId } = useDTHoverStateContext();
5457
5502
  const { focusSubComponent, blurSubComponent } = useDTFocusDispatchContext();
5458
5503
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
5459
5504
  /* @__PURE__ */ jsx(
@@ -5477,7 +5522,7 @@ function DataTableBodyRow({
5477
5522
  cellPosition: { rowIndex, columnIndex },
5478
5523
  "aria-colindex": columnIndex + 1,
5479
5524
  className: cellClasses,
5480
- isHovered: hoveredColumnId === cell.column.id,
5525
+ "data-anv-column-id": cell.column.id,
5481
5526
  children: flexRender(cell.column.columnDef.cell, cell.getContext())
5482
5527
  },
5483
5528
  cell.id
@@ -5502,6 +5547,17 @@ function DataTableBodyRow({
5502
5547
  )
5503
5548
  ] }, row.id);
5504
5549
  }
5550
+ function areRowPropsEqual(prev, next) {
5551
+ const getRowVersion = next.getRowVersion;
5552
+ if (!getRowVersion) {
5553
+ return false;
5554
+ }
5555
+ return prev.row.id === next.row.id && getRowVersion(prev.row.original) === getRowVersion(next.row.original) && prev.rowIndex === next.rowIndex && prev.isExpanded === next.isExpanded && prev.canExpand === next.canExpand && prev.depth === next.depth && prev.parentRowCanExpand === next.parentRowCanExpand && prev.tableHasSubRows === next.tableHasSubRows && prev.columnOrder === next.columnOrder && prev.isSelected === next.isSelected && prev.isSomeSelected === next.isSomeSelected;
5556
+ }
5557
+ const DataTableBodyRow = memo$1(
5558
+ DataTableBodyRowInner,
5559
+ areRowPropsEqual
5560
+ );
5505
5561
 
5506
5562
  const useColumnOrder = ({ table }) => {
5507
5563
  const getColumnIndexes = useCallback((column) => {
@@ -5530,25 +5586,104 @@ const useColumnOrder = ({ table }) => {
5530
5586
  };
5531
5587
  };
5532
5588
 
5533
- const DataTableBodyContent = ({
5589
+ function NonVirtualizedContent({
5534
5590
  table,
5535
- hasSubRows
5536
- }) => {
5591
+ hasSubRows,
5592
+ getRowVersion
5593
+ }) {
5537
5594
  const { columnOrder } = useColumnOrder({ table });
5538
- return table.getRowModel().rows.map((row, rowIndex) => /* @__PURE__ */ jsx(
5595
+ const headerCount = table.getHeaderGroups().length;
5596
+ return /* @__PURE__ */ jsx(Fragment, { children: table.getRowModel().rows.map((row, rowIndex) => /* @__PURE__ */ jsx(
5539
5597
  DataTableBodyRow,
5540
5598
  {
5541
5599
  columnOrder,
5542
5600
  row,
5543
- rowIndex: rowIndex + table.getHeaderGroups().length,
5544
- tableHasSubRows: hasSubRows
5601
+ rowIndex: rowIndex + headerCount,
5602
+ tableHasSubRows: hasSubRows,
5603
+ isExpanded: row.getIsExpanded(),
5604
+ canExpand: row.getCanExpand(),
5605
+ depth: row.depth,
5606
+ parentRowCanExpand: row.getParentRow()?.getCanExpand() ?? false,
5607
+ isSelected: row.getIsSelected(),
5608
+ isSomeSelected: row.getIsSomeSelected(),
5609
+ getRowVersion
5545
5610
  },
5546
5611
  row.id
5547
- ));
5548
- };
5612
+ )) });
5613
+ }
5614
+ function VirtualizedContent({
5615
+ table,
5616
+ hasSubRows,
5617
+ virtualizer,
5618
+ getRowVersion
5619
+ }) {
5620
+ const { columnOrder } = useColumnOrder({ table });
5621
+ const headerCount = table.getHeaderGroups().length;
5622
+ const rows = table.getRowModel().rows;
5623
+ const virtualItems = virtualizer.getVirtualItems();
5624
+ const totalSize = virtualizer.getTotalSize();
5625
+ const measureRef = useMemo(
5626
+ () => (el) => {
5627
+ if (el) virtualizer.measureElement(el);
5628
+ },
5629
+ [virtualizer]
5630
+ );
5631
+ return /* @__PURE__ */ jsx(
5632
+ "div",
5633
+ {
5634
+ className: styles$8["data-table-body-virtualized"],
5635
+ "data-virtualized-body": "true",
5636
+ style: { height: `${totalSize}px` },
5637
+ children: virtualItems.map((virtualRow) => {
5638
+ const row = rows[virtualRow.index];
5639
+ return /* @__PURE__ */ jsx(
5640
+ "div",
5641
+ {
5642
+ ref: measureRef,
5643
+ "data-index": virtualRow.index,
5644
+ className: styles$8["data-table-body-row-virtualized"],
5645
+ style: { transform: `translateY(${virtualRow.start}px)` },
5646
+ children: /* @__PURE__ */ jsx(
5647
+ DataTableBodyRow,
5648
+ {
5649
+ columnOrder,
5650
+ row,
5651
+ rowIndex: virtualRow.index + headerCount,
5652
+ tableHasSubRows: hasSubRows,
5653
+ isExpanded: row.getIsExpanded(),
5654
+ canExpand: row.getCanExpand(),
5655
+ depth: row.depth,
5656
+ parentRowCanExpand: row.getParentRow()?.getCanExpand() ?? false,
5657
+ isSelected: row.getIsSelected(),
5658
+ isSomeSelected: row.getIsSomeSelected(),
5659
+ getRowVersion
5660
+ }
5661
+ )
5662
+ },
5663
+ row.id
5664
+ );
5665
+ })
5666
+ }
5667
+ );
5668
+ }
5549
5669
  function DataTableBody(props) {
5550
- const { table, hasSubRows, ...rest } = props;
5551
- return /* @__PURE__ */ jsx(TableBody, { type: "data-table", ...rest, children: /* @__PURE__ */ jsx(DataTableBodyContent, { table, hasSubRows }) });
5670
+ const { table, hasSubRows, virtualizer, getRowVersion, ...rest } = props;
5671
+ return /* @__PURE__ */ jsx(TableBody, { type: "data-table", ...rest, children: virtualizer ? /* @__PURE__ */ jsx(
5672
+ VirtualizedContent,
5673
+ {
5674
+ table,
5675
+ hasSubRows,
5676
+ virtualizer,
5677
+ getRowVersion
5678
+ }
5679
+ ) : /* @__PURE__ */ jsx(
5680
+ NonVirtualizedContent,
5681
+ {
5682
+ table,
5683
+ hasSubRows,
5684
+ getRowVersion
5685
+ }
5686
+ ) });
5552
5687
  }
5553
5688
 
5554
5689
  const styles$7 = {
@@ -5570,7 +5705,7 @@ function TableFooter({ type, children, ...rest }) {
5570
5705
 
5571
5706
  const TableFooterCell = forwardRef((props, ref) => {
5572
5707
  const { type, children, className, ...rest } = props;
5573
- const classes = cx(styles$e["table-footer-cell"], className);
5708
+ const classes = cx(styles$f["table-footer-cell"], className);
5574
5709
  const CellElement = type === "simple" ? "td" : "div";
5575
5710
  return /* @__PURE__ */ jsx(
5576
5711
  CellElement,
@@ -5588,16 +5723,7 @@ TableFooterCell.displayName = "TableFooterCell";
5588
5723
 
5589
5724
  function DataTableFooterCell(props) {
5590
5725
  const { cellPosition, children, className, ...rest } = props;
5591
- const [tabIndex, setTabIndex] = useState(-1);
5592
5726
  const footerCellRef = useRef(null);
5593
- const { moveFocusToCell } = useDTFocusDispatchContext();
5594
- const handleFocus = useCallback(() => {
5595
- moveFocusToCell(cellPosition);
5596
- setTabIndex(0);
5597
- }, [moveFocusToCell, cellPosition, setTabIndex]);
5598
- const handleBlur = useCallback(() => {
5599
- setTabIndex(-1);
5600
- }, [setTabIndex]);
5601
5727
  const { jumpFocus, moveFocus } = useDTFocusDispatchContext();
5602
5728
  const handleKeyDown = useCallback(
5603
5729
  (event) => {
@@ -5638,9 +5764,7 @@ function DataTableFooterCell(props) {
5638
5764
  type: "data-table",
5639
5765
  ...rest,
5640
5766
  ref: footerCellRef,
5641
- tabIndex,
5642
- onFocus: handleFocus,
5643
- onBlur: handleBlur,
5767
+ tabIndex: -1,
5644
5768
  onKeyDown: handleKeyDown,
5645
5769
  className: cx(styles$9["data-table-footer-cell"], className),
5646
5770
  "data-cell-pos": formatCellPositionString(cellPosition),
@@ -5795,6 +5919,27 @@ function DataTableFooter({
5795
5919
  ) : /* @__PURE__ */ jsx(DefaultTableFooterRows, { table, columns }) });
5796
5920
  }
5797
5921
 
5922
+ function useCellFocusListener(elementRef) {
5923
+ const [isFocused, setIsFocused] = useState(false);
5924
+ useEffect(() => {
5925
+ const el = elementRef.current;
5926
+ if (!el) return;
5927
+ const cell = el.closest('[data-anv="table-body-cell"]');
5928
+ if (!cell) return;
5929
+ const onFocusIn = () => setIsFocused(true);
5930
+ const onFocusOut = (e) => {
5931
+ if (!cell.contains(e.relatedTarget)) setIsFocused(false);
5932
+ };
5933
+ cell.addEventListener("focusin", onFocusIn);
5934
+ cell.addEventListener("focusout", onFocusOut);
5935
+ return () => {
5936
+ cell.removeEventListener("focusin", onFocusIn);
5937
+ cell.removeEventListener("focusout", onFocusOut);
5938
+ };
5939
+ }, [elementRef]);
5940
+ return isFocused;
5941
+ }
5942
+
5798
5943
  const variantConfig = {
5799
5944
  error: {
5800
5945
  icon: SvgError,
@@ -5809,7 +5954,8 @@ const variantConfig = {
5809
5954
  };
5810
5955
  function CellStatus({ status, variant }) {
5811
5956
  const message = typeof status === "string" ? status : void 0;
5812
- const cellFocusContext = useCellFocusContext();
5957
+ const ref = useRef(null);
5958
+ const isCellFocused = useCellFocusListener(ref);
5813
5959
  const [isHovered, setIsHovered] = useState(false);
5814
5960
  const config = variantConfig[variant];
5815
5961
  const icon = /* @__PURE__ */ jsx(
@@ -5821,13 +5967,14 @@ function CellStatus({ status, variant }) {
5821
5967
  }
5822
5968
  );
5823
5969
  if (!message) {
5824
- return icon;
5970
+ return /* @__PURE__ */ jsx("span", { ref, children: icon });
5825
5971
  }
5826
- const isTooltipOpen = cellFocusContext?.isCellFocused || isHovered;
5972
+ const isTooltipOpen = isCellFocused || isHovered;
5827
5973
  return /* @__PURE__ */ jsxs(Tooltip, { open: isTooltipOpen, children: [
5828
5974
  /* @__PURE__ */ jsx(
5829
5975
  Tooltip.Trigger,
5830
5976
  {
5977
+ ref,
5831
5978
  onMouseEnter: () => setIsHovered(true),
5832
5979
  onMouseLeave: () => setIsHovered(false),
5833
5980
  children: icon
@@ -5837,22 +5984,116 @@ function CellStatus({ status, variant }) {
5837
5984
  ] });
5838
5985
  }
5839
5986
 
5987
+ const sharedColumnHelper = createColumnHelper();
5988
+ function resolveHeaderAlign(align, isGroup = false) {
5989
+ if (isGroup) {
5990
+ return "start";
5991
+ }
5992
+ return align ?? "start";
5993
+ }
5994
+ function getHeaderJustifyContent(align) {
5995
+ if (align === "center") {
5996
+ return "center";
5997
+ }
5998
+ if (align === "end") {
5999
+ return "flex-end";
6000
+ }
6001
+ return "flex-start";
6002
+ }
6003
+ function normalizeColumnHeader(columnDef) {
6004
+ return {
6005
+ label: columnDef.header?.label ?? columnDef.headerLabel ?? String(columnDef.id),
6006
+ required: columnDef.header?.required,
6007
+ moreInfo: columnDef.header?.moreInfo
6008
+ };
6009
+ }
6010
+ function renderColumnHeader(header, {
6011
+ align,
6012
+ isGroup = false
6013
+ }) {
6014
+ const resolvedAlign = resolveHeaderAlign(align, isGroup);
6015
+ return /* @__PURE__ */ jsx(
6016
+ "div",
6017
+ {
6018
+ "data-a2-datatable-header-wrapper": "true",
6019
+ "data-a2-datatable-header-align": resolvedAlign,
6020
+ "data-a2-datatable-header-kind": isGroup ? "group" : "leaf",
6021
+ style: {
6022
+ justifyContent: getHeaderJustifyContent(resolvedAlign),
6023
+ maxWidth: "100%",
6024
+ width: "fit-content"
6025
+ },
6026
+ children: /* @__PURE__ */ jsx(
6027
+ "div",
6028
+ {
6029
+ "data-a2-datatable-header-content": "true",
6030
+ style: { maxWidth: "100%", width: "fit-content" },
6031
+ children: /* @__PURE__ */ jsx(
6032
+ FieldLabel,
6033
+ {
6034
+ el: "div",
6035
+ required: header.required,
6036
+ moreInfo: header.moreInfo,
6037
+ style: {
6038
+ maxWidth: "100%",
6039
+ textAlign: resolvedAlign,
6040
+ width: "fit-content"
6041
+ },
6042
+ children: header.label
6043
+ }
6044
+ )
6045
+ }
6046
+ )
6047
+ }
6048
+ );
6049
+ }
6050
+ function renderRawCellValue(value) {
6051
+ if (value === null || value === void 0) {
6052
+ return null;
6053
+ }
6054
+ if (value === "") {
6055
+ return "";
6056
+ }
6057
+ if (typeof value === "string" || typeof value === "number" || typeof value === "bigint") {
6058
+ return value;
6059
+ }
6060
+ if (typeof value === "boolean") {
6061
+ return String(value);
6062
+ }
6063
+ if (typeof value === "symbol") {
6064
+ return value.toString();
6065
+ }
6066
+ if (typeof value === "object" && isValidElement(value)) {
6067
+ return value;
6068
+ }
6069
+ if (Array.isArray(value)) {
6070
+ return value.map((item, index) => /* @__PURE__ */ jsx(Fragment$1, { children: renderRawCellValue(item) }, index));
6071
+ }
6072
+ return String(value);
6073
+ }
5840
6074
  function getTanStackColumnDef({
5841
6075
  columnDef,
5842
6076
  emptyCellContent
5843
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5844
6077
  }) {
5845
- const columnHelper = createColumnHelper();
6078
+ const normalizedHeader = normalizeColumnHeader(columnDef);
5846
6079
  if (columnDef.columns && columnDef.columns.length > 0) {
5847
- return columnHelper.group({
6080
+ return sharedColumnHelper.group({
5848
6081
  id: columnDef.id,
5849
- header: columnDef.headerLabel,
6082
+ header: () => renderColumnHeader(normalizedHeader, {
6083
+ align: columnDef.align,
6084
+ isGroup: true
6085
+ }),
5850
6086
  columns: columnDef.columns.map(
5851
6087
  (column) => getTanStackColumnDef({
5852
6088
  columnDef: column,
5853
6089
  emptyCellContent
5854
6090
  })
5855
6091
  ),
6092
+ meta: {
6093
+ columnDef,
6094
+ headerAlign: resolveHeaderAlign(columnDef.align, true),
6095
+ isGroupHeader: true
6096
+ },
5856
6097
  footer: columnDef.footerContent ? () => columnDef.footerContent : void 0,
5857
6098
  enableResizing: columnDef.resizable
5858
6099
  });
@@ -5874,17 +6115,22 @@ function getTanStackColumnDef({
5874
6115
  }
5875
6116
  }
5876
6117
  const resolvedEmptyContent = columnDef.emptyCellContent ?? emptyCellContent ?? /* @__PURE__ */ jsx(TableEmptyCellContent, {});
5877
- return columnHelper.accessor((row) => row[columnDef.id], {
6118
+ const metaColumnDef = {
6119
+ ...columnDef,
6120
+ headerLabel: normalizedHeader.label
6121
+ };
6122
+ return sharedColumnHelper.accessor((row) => row[columnDef.id], {
5878
6123
  id: columnDef.id,
5879
6124
  cell: (info) => {
6125
+ const rawCellValue = info.row.original[columnDef.id];
5880
6126
  let cellContent;
5881
6127
  if (resolvedRenderCell) {
5882
- cellContent = resolvedRenderCell(info.getValue(), {
6128
+ cellContent = resolvedRenderCell(rawCellValue, {
5883
6129
  row: info.row.original,
5884
6130
  depth: info.row.depth
5885
6131
  });
5886
6132
  } else {
5887
- cellContent = info.getValue();
6133
+ cellContent = renderRawCellValue(rawCellValue);
5888
6134
  }
5889
6135
  if (cellContent === "") {
5890
6136
  cellContent = resolvedEmptyContent;
@@ -5893,16 +6139,10 @@ function getTanStackColumnDef({
5893
6139
  const cellError = meta?.errors?.[columnDef.id];
5894
6140
  const cellWarning = meta?.warnings?.[columnDef.id];
5895
6141
  return /* @__PURE__ */ jsxs(
5896
- Flex,
6142
+ "div",
5897
6143
  {
5898
- justifyContent: resolvedAlign,
5899
- alignItems: "center",
5900
- wrap: "wrap",
5901
- gap: "1",
5902
- style: {
5903
- width: "100%",
5904
- textAlign: resolvedAlign
5905
- },
6144
+ className: styles$9["data-table-cell-content"],
6145
+ "data-align": resolvedAlign ?? "start",
5906
6146
  children: [
5907
6147
  cellError ? /* @__PURE__ */ jsx(CellStatus, { status: cellError, variant: "error" }) : cellWarning ? /* @__PURE__ */ jsx(CellStatus, { status: cellWarning, variant: "warning" }) : null,
5908
6148
  cellContent ?? resolvedEmptyContent
@@ -5910,17 +6150,25 @@ function getTanStackColumnDef({
5910
6150
  }
5911
6151
  );
5912
6152
  },
5913
- header: () => /* @__PURE__ */ jsx(Flex, { justifyContent: resolvedAlign, wrap: "wrap", grow: 1, children: columnDef.headerLabel }),
6153
+ header: () => renderColumnHeader(normalizedHeader, {
6154
+ align: resolvedAlign
6155
+ }),
5914
6156
  footer: columnDef.footerContent ? () => columnDef.footerContent : void 0,
5915
6157
  minSize: columnDef.minWidth,
5916
6158
  maxSize: columnDef.maxWidth,
6159
+ // TanStack's `size` is the column's starting width — we use `defaultWidth`
6160
+ // when provided and fall back to `minWidth` so the auto-sizing basis
6161
+ // matches the manual-resize floor by default.
6162
+ size: columnDef.defaultWidth ?? columnDef.minWidth,
5917
6163
  enableResizing: columnDef.resizable,
5918
6164
  enableSorting: !!columnDef.sortable,
5919
6165
  meta: {
5920
6166
  editMode: columnDef.editConfig?.mode,
5921
6167
  editConfig: columnDef.editConfig,
5922
- columnDef
6168
+ columnDef: metaColumnDef,
5923
6169
  // Store original for type narrowing
6170
+ headerAlign: resolveHeaderAlign(resolvedAlign),
6171
+ isGroupHeader: false
5924
6172
  },
5925
6173
  // If custom sorting function is provided, use it
5926
6174
  ...columnDef.sortable && typeof columnDef.sortable === "function" ? {
@@ -5937,12 +6185,20 @@ function getTanStackColumnDef({
5937
6185
  });
5938
6186
  }
5939
6187
 
6188
+ function shallowSortingEqual(a, b) {
6189
+ if (a.length !== b.length) return false;
6190
+ for (let i = 0; i < a.length; i++) {
6191
+ if (a[i].id !== b[i].id || a[i].desc !== b[i].desc) return false;
6192
+ }
6193
+ return true;
6194
+ }
6195
+
5940
6196
  const SvgArrowUpward = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0a.996.996 0 0 0 0-1.41l-6.59-6.59a.996.996 0 0 0-1.41 0l-6.6 6.58a.996.996 0 1 0 1.41 1.41L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1z" }));
5941
6197
 
5942
6198
  const SvgArrowDownward = (props) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React.createElement("path", { d: "M11 5v11.17l-4.88-4.88c-.39-.39-1.03-.39-1.42 0a.996.996 0 0 0 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0l6.59-6.59a.996.996 0 1 0-1.41-1.41L13 16.17V5c0-.55-.45-1-1-1s-1 .45-1 1z" }));
5943
6199
 
5944
6200
  const styles$5 = {
5945
- "table-header": "_table-header_y7cb1_2"
6201
+ "table-header": "_table-header_nz2nu_2"
5946
6202
  };
5947
6203
 
5948
6204
  function TableHeader({ type, children, ...rest }) {
@@ -5966,15 +6222,17 @@ const TableHeaderCell = forwardRef(
5966
6222
  className,
5967
6223
  isGroup,
5968
6224
  isSortable,
6225
+ isInteractiveHeaderCell,
5969
6226
  isSelectCell,
5970
6227
  isExpandCell,
5971
6228
  ...rest
5972
6229
  }, ref) => {
5973
- const classes = cx(styles$e["table-header-cell"], className, {
5974
- [styles$e["table-header-cell-group"]]: isGroup,
5975
- [styles$e["table-header-cell-sortable"]]: isSortable,
5976
- [styles$e["table-cell-internal-expand"]]: isExpandCell,
5977
- [styles$e["table-cell-internal-select"]]: isSelectCell
6230
+ const classes = cx(styles$f["table-header-cell"], className, {
6231
+ [styles$f["table-header-cell-group"]]: isGroup,
6232
+ [styles$f["table-header-cell-sortable"]]: isSortable,
6233
+ [styles$f["table-header-cell-interactive"]]: isInteractiveHeaderCell,
6234
+ [styles$f["table-cell-internal-expand"]]: isExpandCell,
6235
+ [styles$f["table-cell-internal-select"]]: isSelectCell
5978
6236
  });
5979
6237
  const CellElement = type === "simple" ? "th" : "div";
5980
6238
  return /* @__PURE__ */ jsx(
@@ -5992,6 +6250,23 @@ const TableHeaderCell = forwardRef(
5992
6250
  );
5993
6251
  TableHeaderCell.displayName = "TableHeaderCell";
5994
6252
 
6253
+ const INTERACTIVE_DESCENDANT_SELECTOR = [
6254
+ "button",
6255
+ "a[href]",
6256
+ "input",
6257
+ "select",
6258
+ "textarea",
6259
+ '[role="button"]',
6260
+ '[role="link"]',
6261
+ '[contenteditable="true"]'
6262
+ ].join(", ");
6263
+ function isInteractiveDescendant(target, currentTarget) {
6264
+ if (!(target instanceof Element)) {
6265
+ return false;
6266
+ }
6267
+ const interactiveElement = target.closest(INTERACTIVE_DESCENDANT_SELECTOR);
6268
+ return !!interactiveElement && currentTarget.contains(interactiveElement);
6269
+ }
5995
6270
  function DataTableHeaderCellInner(props, forwardedRef) {
5996
6271
  const { cellPosition, children, header, className, ...rest } = props;
5997
6272
  const internalRef = useRef(null);
@@ -6006,20 +6281,11 @@ function DataTableHeaderCellInner(props, forwardedRef) {
6006
6281
  },
6007
6282
  [forwardedRef]
6008
6283
  );
6009
- const { moveFocusToCell } = useDTFocusDispatchContext();
6010
- const [tabIndex, setTabIndex] = useState(-1);
6011
- const handleFocus = useCallback(() => {
6012
- moveFocusToCell(cellPosition);
6013
- setTabIndex(0);
6014
- }, [moveFocusToCell, cellPosition, setTabIndex]);
6015
- const handleBlur = useCallback(() => {
6016
- setTabIndex(-1);
6017
- }, [setTabIndex]);
6018
6284
  const { jumpFocus, moveFocus } = useDTFocusDispatchContext();
6019
6285
  const columnId = header.column.id;
6020
6286
  const isExpandCell = columnId === INTERNAL_ROW_ACTION_PRIMARY_COLUMN_ID;
6021
6287
  const isSelectCell = columnId === INTERNAL_ROW_ACTION_SECONDARY_COLUMN_ID;
6022
- const isSortingCell = header.column.columnDef.enableSorting;
6288
+ const isSortingCell = header.column.getCanSort();
6023
6289
  const handleKeyDown = useCallback(
6024
6290
  (event) => {
6025
6291
  switch (event.key) {
@@ -6051,6 +6317,9 @@ function DataTableHeaderCellInner(props, forwardedRef) {
6051
6317
  }
6052
6318
  case " ":
6053
6319
  case "Enter": {
6320
+ if (isInteractiveDescendant(event.target, event.currentTarget)) {
6321
+ return;
6322
+ }
6054
6323
  const isDisabled = header.column.columnDef.meta?.disableHeaderAction;
6055
6324
  if (isSelectCell && !isDisabled) {
6056
6325
  event.preventDefault();
@@ -6083,18 +6352,20 @@ function DataTableHeaderCellInner(props, forwardedRef) {
6083
6352
  );
6084
6353
  const handleClick = useCallback(
6085
6354
  (event) => {
6086
- if (header.column.columnDef.enableSorting) {
6087
- const target = event.target;
6088
- const resizeHandle = target.closest(
6355
+ if (isSortingCell) {
6356
+ if (!(event.target instanceof Element)) {
6357
+ return;
6358
+ }
6359
+ const resizeHandle = event.target.closest(
6089
6360
  '[aria-roledescription="Resize handle"]'
6090
6361
  );
6091
- if (resizeHandle) {
6362
+ if (resizeHandle || isInteractiveDescendant(event.target, event.currentTarget)) {
6092
6363
  return;
6093
6364
  }
6094
6365
  header.column.getToggleSortingHandler()?.(event);
6095
6366
  }
6096
6367
  },
6097
- [header.column]
6368
+ [header.column, isSortingCell]
6098
6369
  );
6099
6370
  return /* @__PURE__ */ jsxs(
6100
6371
  TableHeaderCell,
@@ -6102,17 +6373,15 @@ function DataTableHeaderCellInner(props, forwardedRef) {
6102
6373
  type: "data-table",
6103
6374
  ...rest,
6104
6375
  ref: setRefs,
6105
- tabIndex,
6106
- onFocus: handleFocus,
6376
+ tabIndex: -1,
6107
6377
  onClick: handleClick,
6108
- onBlur: handleBlur,
6109
6378
  onKeyDown: handleKeyDown,
6110
6379
  className: cx(styles$9["data-table-header-cell"], className),
6111
6380
  "data-cell-pos": formatCellPositionString(cellPosition),
6112
6381
  "aria-sort": header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : void 0,
6113
6382
  children: [
6114
6383
  children,
6115
- header.column.columnDef.enableSorting && /* @__PURE__ */ jsxs(SrOnly, { children: [
6384
+ isSortingCell && /* @__PURE__ */ jsxs(SrOnly, { children: [
6116
6385
  header.column.getIsSorted() === "asc" ? "Sorted ascending." : header.column.getIsSorted() === "desc" ? "Sorted descending." : "Not sorted.",
6117
6386
  " ",
6118
6387
  "Click to toggle sort."
@@ -6160,32 +6429,48 @@ function ResizeHandle({
6160
6429
  }
6161
6430
 
6162
6431
  const styles$3 = {
6163
- "data-table-header-row": "_data-table-header-row_6qs0u_17"
6432
+ "data-table-header-row": "_data-table-header-row_w353z_17"
6164
6433
  };
6165
6434
 
6166
- function useDTHoverDispatchContext() {
6167
- return useContext(DTHoverDispatchContext);
6435
+ function getHeaderContentAlign(align) {
6436
+ if (align === "center") {
6437
+ return "center";
6438
+ }
6439
+ if (align === "end") {
6440
+ return "flex-end";
6441
+ }
6442
+ return "flex-start";
6168
6443
  }
6169
-
6170
- function DataTableHeader({ table }) {
6171
- const dispatch = useDTHoverDispatchContext();
6444
+ function DataTableHeader({
6445
+ table,
6446
+ tableRef
6447
+ }) {
6448
+ const getTableBase = useCallback(
6449
+ () => tableRef.current?.querySelector(
6450
+ '[data-anv="data-table-base"]'
6451
+ ) ?? null,
6452
+ [tableRef]
6453
+ );
6172
6454
  const handleHoverColumn = useCallback(
6173
6455
  (columnId) => {
6174
- dispatch({
6175
- type: "HOVER_START",
6176
- payload: { columnId }
6177
- });
6456
+ const base = getTableBase();
6457
+ if (!base) return;
6458
+ base.setAttribute("data-anv-hover-col", columnId);
6459
+ base.querySelectorAll(`[data-anv-column-id="${CSS.escape(columnId)}"]`).forEach((el) => el.setAttribute("data-anv-is-hovered-col", "true"));
6178
6460
  },
6179
- [dispatch]
6461
+ [getTableBase]
6180
6462
  );
6181
6463
  const handleHoverColumnLeave = useCallback(
6182
6464
  (columnId) => {
6183
- dispatch({
6184
- type: "HOVER_END",
6185
- payload: { columnId }
6186
- });
6465
+ const base = getTableBase();
6466
+ if (!base) return;
6467
+ if (base.getAttribute("data-anv-hover-col") !== columnId) return;
6468
+ base.removeAttribute("data-anv-hover-col");
6469
+ base.querySelectorAll(
6470
+ `[data-anv-column-id="${CSS.escape(columnId)}"][data-anv-is-hovered-col="true"]`
6471
+ ).forEach((el) => el.removeAttribute("data-anv-is-hovered-col"));
6187
6472
  },
6188
- [dispatch]
6473
+ [getTableBase]
6189
6474
  );
6190
6475
  const cellRefs = useRef(/* @__PURE__ */ new Map());
6191
6476
  const createResizeStartHandler = useCallback(
@@ -6203,15 +6488,6 @@ function DataTableHeader({ table }) {
6203
6488
  },
6204
6489
  [table]
6205
6490
  );
6206
- const handleResizeEnd = useCallback(
6207
- (columnId) => {
6208
- dispatch({
6209
- type: "RESIZE_END",
6210
- payload: { columnId }
6211
- });
6212
- },
6213
- [dispatch]
6214
- );
6215
6491
  const { columnOrder } = useColumnOrder({ table });
6216
6492
  return /* @__PURE__ */ jsx(TableHeader, { type: "data-table", children: table.getHeaderGroups().map((headerGroup, index) => /* @__PURE__ */ jsx(
6217
6493
  "div",
@@ -6224,6 +6500,13 @@ function DataTableHeader({ table }) {
6224
6500
  const isInternalSelectColumn = header.column.id === INTERNAL_ROW_ACTION_SECONDARY_COLUMN_ID;
6225
6501
  const isInternalExpandColumn = header.column.id === INTERNAL_ROW_ACTION_PRIMARY_COLUMN_ID;
6226
6502
  const gridColumn = header.colSpan > 1 ? `span ${header.colSpan}` : void 0;
6503
+ const headerContentAlign = getHeaderContentAlign(
6504
+ header.column.columnDef.meta?.headerAlign
6505
+ );
6506
+ const isGroupHeader = header.subHeaders.length > 0;
6507
+ const hasGroupDivider = isGroupHeader || Boolean(header.column.parent && isLastInParentGroup);
6508
+ const isHeaderActionDisabled = header.column.columnDef.meta?.disableHeaderAction === true;
6509
+ const headerCellInteractive = !isGroupHeader && (header.column.getCanSort() || (isInternalExpandColumn || isInternalSelectColumn) && !isHeaderActionDisabled);
6227
6510
  return /* @__PURE__ */ jsx(
6228
6511
  DataTableHeaderCell,
6229
6512
  {
@@ -6236,17 +6519,19 @@ function DataTableHeader({ table }) {
6236
6519
  }
6237
6520
  },
6238
6521
  className: getCommonPinningClasses(header.column),
6522
+ "data-anv-column-id": header.column.id,
6239
6523
  style: {
6240
6524
  gridColumn,
6241
6525
  ...getCommonPinningStyles(header.column)
6242
6526
  },
6243
6527
  "aria-colspan": header.colSpan,
6244
- isGroup: "columns" in header.column.columnDef || header.getContext().header.column.parent && isLastInParentGroup,
6245
- isSortable: header.column.columnDef.enableSorting,
6528
+ isGroup: hasGroupDivider,
6529
+ isSortable: header.column.getCanSort(),
6530
+ isInteractiveHeaderCell: headerCellInteractive,
6246
6531
  isSelectCell: isInternalSelectColumn,
6247
6532
  isExpandCell: isInternalExpandColumn,
6248
- onMouseEnter: isInternalExpandColumn || isInternalSelectColumn ? void 0 : () => handleHoverColumn(header.column.id),
6249
- onMouseLeave: isInternalExpandColumn || isInternalSelectColumn ? void 0 : () => handleHoverColumnLeave(header.column.id),
6533
+ onMouseEnter: headerCellInteractive ? () => handleHoverColumn(header.column.id) : void 0,
6534
+ onMouseLeave: headerCellInteractive ? () => handleHoverColumnLeave(header.column.id) : void 0,
6250
6535
  cellPosition: {
6251
6536
  rowIndex: index,
6252
6537
  columnIndex: columnOrder.indexOf(header.column.getIndex())
@@ -6255,30 +6540,53 @@ function DataTableHeader({ table }) {
6255
6540
  Flex,
6256
6541
  {
6257
6542
  direction: "row",
6258
- alignItems: "flex-end",
6543
+ alignItems: "center",
6259
6544
  gap: 2,
6260
6545
  style: {
6261
6546
  width: "100%"
6262
6547
  },
6263
6548
  children: [
6264
- /* @__PURE__ */ jsxs(Flex, { direction: "row", alignItems: "center", gap: 2, grow: 1, children: [
6265
- flexRender(
6266
- header.column.columnDef.header,
6267
- header.getContext()
6268
- ),
6549
+ /* @__PURE__ */ jsxs(
6550
+ Flex,
6269
6551
  {
6270
- asc: /* @__PURE__ */ jsx(Icon, { svg: SvgArrowUpward, size: "small" }),
6271
- desc: /* @__PURE__ */ jsx(Icon, { svg: SvgArrowDownward, size: "small" })
6272
- }[header.column.getIsSorted()] ?? null
6273
- ] }),
6552
+ direction: "row",
6553
+ alignItems: "center",
6554
+ justifyContent: headerContentAlign,
6555
+ gap: 2,
6556
+ grow: 1,
6557
+ style: {
6558
+ minWidth: 0,
6559
+ width: "100%"
6560
+ },
6561
+ children: [
6562
+ flexRender(
6563
+ header.column.columnDef.header,
6564
+ header.getContext()
6565
+ ),
6566
+ header.column.getIsSorted() ? /* @__PURE__ */ jsx(
6567
+ "span",
6568
+ {
6569
+ style: {
6570
+ alignItems: "center",
6571
+ display: "flex",
6572
+ flexShrink: 0
6573
+ },
6574
+ children: {
6575
+ asc: /* @__PURE__ */ jsx(Icon, { svg: SvgArrowUpward, size: "small" }),
6576
+ desc: /* @__PURE__ */ jsx(Icon, { svg: SvgArrowDownward, size: "small" })
6577
+ }[header.column.getIsSorted()] ?? null
6578
+ }
6579
+ ) : null
6580
+ ]
6581
+ }
6582
+ ),
6274
6583
  header.column.columnDef.enableResizing && /* @__PURE__ */ jsx(
6275
6584
  ResizeHandle,
6276
6585
  {
6277
6586
  header,
6278
6587
  onResizeStart: createResizeStartHandler(
6279
6588
  header.column.id
6280
- ),
6281
- onResizeEnd: () => handleResizeEnd(header.column.id)
6589
+ )
6282
6590
  }
6283
6591
  )
6284
6592
  ]
@@ -6294,8 +6602,8 @@ function DataTableHeader({ table }) {
6294
6602
  }
6295
6603
 
6296
6604
  const styles$2 = {
6297
- "table-container": "_table-container_z7onx_2",
6298
- "table-scroll-container": "_table-scroll-container_z7onx_57"
6605
+ "table-container": "_table-container_vqc6w_2",
6606
+ "table-scroll-container": "_table-scroll-container_vqc6w_57"
6299
6607
  };
6300
6608
 
6301
6609
  const TableContainer = forwardRef(
@@ -6448,49 +6756,6 @@ function usePageDataCache(config) {
6448
6756
  return { getOrLoad, clearCache };
6449
6757
  }
6450
6758
 
6451
- function DTHoverProvider({ children }) {
6452
- const [state, dispatch] = useReducer(reducer$1, initialState$1);
6453
- return /* @__PURE__ */ jsx(DTHoverStateContext.Provider, { value: state, children: /* @__PURE__ */ jsx(DTHoverDispatchContext.Provider, { value: dispatch, children }) });
6454
- }
6455
- function reducer$1(state, action) {
6456
- switch (action.type) {
6457
- case "HOVER_START": {
6458
- return {
6459
- ...state,
6460
- hoveredColumnId: action.payload.columnId
6461
- };
6462
- }
6463
- case "HOVER_END": {
6464
- if (state.hoveredColumnId !== action.payload.columnId) {
6465
- return state;
6466
- }
6467
- return {
6468
- ...state,
6469
- hoveredColumnId: null
6470
- };
6471
- }
6472
- case "RESIZE_START": {
6473
- return {
6474
- ...state,
6475
- resizingColumnId: action.payload.columnId
6476
- };
6477
- }
6478
- case "RESIZE_END": {
6479
- return {
6480
- ...state,
6481
- resizingColumnId: null
6482
- };
6483
- }
6484
- default: {
6485
- throw new Error("Unknown action");
6486
- }
6487
- }
6488
- }
6489
- const initialState$1 = {
6490
- hoveredColumnId: null,
6491
- resizingColumnId: null
6492
- };
6493
-
6494
6759
  function scrollCellIntoView(element, stickyDimensions) {
6495
6760
  const isBodyCell = element.getAttribute("data-anv") === "table-body-cell";
6496
6761
  const scrollContainer = element.closest(
@@ -6676,9 +6941,32 @@ function DTFocusProvider({
6676
6941
  columnCount,
6677
6942
  tableRef,
6678
6943
  leftPinnedWidth,
6679
- rightPinnedWidth
6944
+ rightPinnedWidth,
6945
+ virtualizer,
6946
+ headerRowCount
6680
6947
  }) {
6681
6948
  const stateRef = useRef(initialState);
6949
+ const lastTabbablePosRef = useRef(null);
6950
+ const syncRovingTabindex = useCallback(() => {
6951
+ const restorePoint = stateRef.current.focusRestorePoint;
6952
+ const prev = lastTabbablePosRef.current;
6953
+ const nextEl = tableRef.current?.querySelector(
6954
+ `[data-cell-pos="${formatCellPositionString(restorePoint)}"]`
6955
+ );
6956
+ const restorePointUnchanged = prev && prev.rowIndex === restorePoint.rowIndex && prev.columnIndex === restorePoint.columnIndex;
6957
+ if (restorePointUnchanged && nextEl?.tabIndex === 0) {
6958
+ return;
6959
+ }
6960
+ const prevEl = prev && !restorePointUnchanged ? tableRef.current?.querySelector(
6961
+ `[data-cell-pos="${formatCellPositionString(prev)}"]`
6962
+ ) : null;
6963
+ if (prevEl) prevEl.tabIndex = -1;
6964
+ if (nextEl) nextEl.tabIndex = 0;
6965
+ lastTabbablePosRef.current = restorePoint;
6966
+ }, [tableRef]);
6967
+ useLayoutEffect(() => {
6968
+ syncRovingTabindex();
6969
+ }, [syncRovingTabindex, rowCount, columnCount]);
6682
6970
  const dispatch = useCallback(
6683
6971
  (action) => {
6684
6972
  const newState = reducer(stateRef.current, action, rowCount, columnCount);
@@ -6693,26 +6981,55 @@ function DTFocusProvider({
6693
6981
  }
6694
6982
  }
6695
6983
  stateRef.current = newState;
6984
+ syncRovingTabindex();
6696
6985
  if (!newState.focusedCell || shouldSkipFocusUpdate) {
6697
6986
  return;
6698
6987
  }
6699
- const element = tableRef.current?.querySelector(
6700
- `[data-cell-pos="${formatCellPositionString(newState.focusedCell)}"]`
6701
- );
6702
- if (element) {
6703
- element.focus();
6704
- scrollCellIntoView(element, {
6705
- leftWidth: leftPinnedWidth,
6706
- rightWidth: rightPinnedWidth
6707
- });
6708
- } else {
6709
- dispatch({
6710
- type: "FOCUS_CELL_MANUALLY",
6711
- payload: { cellPosition: { rowIndex: 0, columnIndex: 0 } }
6712
- });
6988
+ const focusTargetCell = () => {
6989
+ if (!newState.focusedCell) return;
6990
+ if (!areCellPositionsEqual(
6991
+ newState.focusedCell,
6992
+ stateRef.current.focusedCell
6993
+ )) {
6994
+ return;
6995
+ }
6996
+ const element = tableRef.current?.querySelector(
6997
+ `[data-cell-pos="${formatCellPositionString(newState.focusedCell)}"]`
6998
+ );
6999
+ if (element) {
7000
+ element.focus();
7001
+ scrollCellIntoView(element, {
7002
+ leftWidth: leftPinnedWidth,
7003
+ rightWidth: rightPinnedWidth
7004
+ });
7005
+ } else {
7006
+ dispatch({
7007
+ type: "FOCUS_CELL_MANUALLY",
7008
+ payload: { cellPosition: { rowIndex: 0, columnIndex: 0 } }
7009
+ });
7010
+ }
7011
+ };
7012
+ if (virtualizer && newState.focusedCell) {
7013
+ const virtualRowIndex = newState.focusedCell.rowIndex - headerRowCount;
7014
+ const bodyRowCount = virtualizer.options.count;
7015
+ if (virtualRowIndex >= 0 && virtualRowIndex < bodyRowCount) {
7016
+ virtualizer.scrollToIndex(virtualRowIndex, { align: "auto" });
7017
+ requestAnimationFrame(focusTargetCell);
7018
+ return;
7019
+ }
6713
7020
  }
7021
+ focusTargetCell();
6714
7022
  },
6715
- [rowCount, columnCount, tableRef, leftPinnedWidth, rightPinnedWidth]
7023
+ [
7024
+ rowCount,
7025
+ columnCount,
7026
+ tableRef,
7027
+ leftPinnedWidth,
7028
+ rightPinnedWidth,
7029
+ syncRovingTabindex,
7030
+ virtualizer,
7031
+ headerRowCount
7032
+ ]
6716
7033
  );
6717
7034
  const state = useMemo(
6718
7035
  () => ({ getFocusedCell: () => stateRef.current.focusedCell }),
@@ -6721,6 +7038,38 @@ function DTFocusProvider({
6721
7038
  return /* @__PURE__ */ jsx(DTFocusStateContext.Provider, { value: state, children: /* @__PURE__ */ jsx(DTFocusDispatchContext.Provider, { value: dispatch, children }) });
6722
7039
  }
6723
7040
 
7041
+ const VIRTUALIZATION_THRESHOLD = 101;
7042
+ const DEFAULT_ESTIMATED_ROW_HEIGHT = 35;
7043
+ function useDataTableVirtualizer({
7044
+ rowCount,
7045
+ scrollRef,
7046
+ disabled
7047
+ }) {
7048
+ const shouldVirtualize = !disabled && rowCount >= VIRTUALIZATION_THRESHOLD;
7049
+ const virtualizer = useVirtualizer({
7050
+ count: shouldVirtualize ? rowCount : 0,
7051
+ // `scrollRef` points at the outer TableContainer div, which does not
7052
+ // itself scroll — the nested [data-anv="table-scroll-container"] child
7053
+ // owns `overflow-y: auto`. Descend to that child so the virtualizer
7054
+ // tracks the right element. Fall back to `scrollRef.current` for
7055
+ // containers that one day collapse the scroll wrapper.
7056
+ getScrollElement: () => {
7057
+ const outer = scrollRef.current;
7058
+ if (!outer) return null;
7059
+ return outer.querySelector(
7060
+ '[data-anv="table-scroll-container"]'
7061
+ ) ?? outer;
7062
+ },
7063
+ estimateSize: () => DEFAULT_ESTIMATED_ROW_HEIGHT,
7064
+ overscan: 5,
7065
+ measureElement: typeof window !== "undefined" && typeof navigator !== "undefined" && navigator.userAgent.indexOf("jsdom") === -1 ? (el) => el?.getBoundingClientRect().height ?? DEFAULT_ESTIMATED_ROW_HEIGHT : void 0
7066
+ });
7067
+ return useMemo(
7068
+ () => shouldVirtualize ? virtualizer : void 0,
7069
+ [shouldVirtualize, virtualizer]
7070
+ );
7071
+ }
7072
+
6724
7073
  const EMPTY_DATA = [];
6725
7074
  function DataTableInner(props, ref) {
6726
7075
  const { layoutStyles, componentProps } = useLayoutPropsUtil(props);
@@ -6743,6 +7092,8 @@ function DataTableInner(props, ref) {
6743
7092
  sortedColumn,
6744
7093
  emptyState,
6745
7094
  emptyCellContent,
7095
+ disableVirtualization,
7096
+ getRowVersion,
6746
7097
  className,
6747
7098
  style,
6748
7099
  ...rest
@@ -6831,11 +7182,13 @@ function DataTableInner(props, ref) {
6831
7182
  isLoading
6832
7183
  } = useAsyncData(dataSource);
6833
7184
  const totalItemCount = paginationObject?.totalRowCount ?? resolvedData?.length ?? 0;
6834
- const hasSubRows = !!resolvedData?.some(
6835
- (row) => row?.subRows?.length ?? 0 > 0
7185
+ const hasSubRows = useMemo(
7186
+ () => !!resolvedData?.some((row) => (row?.subRows?.length ?? 0) > 0),
7187
+ [resolvedData]
6836
7188
  );
6837
- const hasSubComponent = !!resolvedData?.some(
6838
- (row) => row?.subComponent != null
7189
+ const hasSubComponent = useMemo(
7190
+ () => !!resolvedData?.some((row) => row?.subComponent != null),
7191
+ [resolvedData]
6839
7192
  );
6840
7193
  const isExpandable = hasSubRows || hasSubComponent;
6841
7194
  const [expanded, setExpanded] = useOptionallyControlledState({
@@ -7019,9 +7372,9 @@ function DataTableInner(props, ref) {
7019
7372
  columns,
7020
7373
  getCoreRowModel: getCoreRowModel(),
7021
7374
  getSortedRowModel: getSortedRowModel(),
7022
- getPaginationRowModel: getPaginationRowModel(),
7023
- getExpandedRowModel: getExpandedRowModel(),
7024
- getGroupedRowModel: getGroupedRowModel(),
7375
+ ...isPaginated && { getPaginationRowModel: getPaginationRowModel() },
7376
+ ...isExpandable && { getExpandedRowModel: getExpandedRowModel() },
7377
+ // Grouping row model is retained for future use; cheap to exclude now.
7025
7378
  getRowId: (row) => row.id.toString(),
7026
7379
  getSubRows: (row) => row.subRows ?? void 0,
7027
7380
  getRowCanExpand: (row) => {
@@ -7054,8 +7407,7 @@ function DataTableInner(props, ref) {
7054
7407
  },
7055
7408
  onSortingChange: (updaterOrValue) => {
7056
7409
  const newSorting = typeof updaterOrValue === "function" ? updaterOrValue(sorting) : updaterOrValue;
7057
- const sortingChanged = JSON.stringify(newSorting) !== JSON.stringify(sorting);
7058
- if (!sortingChanged) {
7410
+ if (shallowSortingEqual(newSorting, sorting ?? [])) {
7059
7411
  return;
7060
7412
  }
7061
7413
  setSorting(newSorting);
@@ -7064,6 +7416,11 @@ function DataTableInner(props, ref) {
7064
7416
  }
7065
7417
  }
7066
7418
  });
7419
+ const rowVirtualizer = useDataTableVirtualizer({
7420
+ rowCount: table.getRowModel().rows.length,
7421
+ scrollRef: tableRef,
7422
+ disabled: disableVirtualization
7423
+ });
7067
7424
  const headers = table.getFlatHeaders();
7068
7425
  const headerRowCount = table.getHeaderGroups().length;
7069
7426
  const bodyRowCount = table.getRowModel().rows.length;
@@ -7120,16 +7477,14 @@ function DataTableInner(props, ref) {
7120
7477
  if (hasBeenResized) {
7121
7478
  return `${currentSize}px`;
7122
7479
  }
7123
- const minSize = header.column.columnDef.minSize ?? currentSize;
7480
+ if (header.column.getIsPinned()) {
7481
+ return `${currentSize}px`;
7482
+ }
7124
7483
  const maxSize = header.column.columnDef.maxSize;
7125
- return `minmax(${minSize}px, ${maxSize ? `${maxSize}px` : "1fr"})`;
7484
+ return `minmax(${currentSize}px, ${maxSize ? `${maxSize}px` : "1fr"})`;
7126
7485
  }).join(" ");
7127
7486
  vars["--a2-grid-template-columns"] = gridColumns;
7128
7487
  vars["--a2-table-width"] = allHaveMaxWidth ? "max-content" : "100%";
7129
- for (let i = 0; i < headers.length; i++) {
7130
- const header = headers[i];
7131
- vars[`--a2-table-col-${header.column.getIndex()}-size`] = header.column.getSize();
7132
- }
7133
7488
  return vars;
7134
7489
  }, [headers, columnSizing]);
7135
7490
  const columnCount = useMemo(() => {
@@ -7143,7 +7498,9 @@ function DataTableInner(props, ref) {
7143
7498
  tableRef,
7144
7499
  leftPinnedWidth: table.getLeftTotalSize(),
7145
7500
  rightPinnedWidth: table.getRightTotalSize(),
7146
- children: /* @__PURE__ */ jsx(DTHoverProvider, { children: /* @__PURE__ */ jsxs(
7501
+ virtualizer: rowVirtualizer,
7502
+ headerRowCount,
7503
+ children: /* @__PURE__ */ jsxs(
7147
7504
  TableContainer,
7148
7505
  {
7149
7506
  ...rest,
@@ -7165,8 +7522,16 @@ function DataTableInner(props, ref) {
7165
7522
  colCount: columnCount,
7166
7523
  hasSubRows,
7167
7524
  children: [
7168
- /* @__PURE__ */ jsx(DataTableHeader, { table }),
7169
- /* @__PURE__ */ jsx(DataTableBody, { table, hasSubRows }),
7525
+ /* @__PURE__ */ jsx(DataTableHeader, { table, tableRef }),
7526
+ /* @__PURE__ */ jsx(
7527
+ DataTableBody,
7528
+ {
7529
+ table,
7530
+ hasSubRows,
7531
+ virtualizer: rowVirtualizer,
7532
+ getRowVersion
7533
+ }
7534
+ ),
7170
7535
  isEmpty && emptyState && /* @__PURE__ */ jsxs(Fragment, { children: [
7171
7536
  /* @__PURE__ */ jsx(SrOnly, { children: "No data to display." }),
7172
7537
  /* @__PURE__ */ jsx("div", { className: styles["empty-state-container"], children: /* @__PURE__ */ jsxs(
@@ -7243,11 +7608,11 @@ function DataTableInner(props, ref) {
7243
7608
  )
7244
7609
  ]
7245
7610
  }
7246
- ) })
7611
+ )
7247
7612
  }
7248
7613
  );
7249
7614
  }
7250
7615
  const DataTable = forwardRef(DataTableInner);
7251
7616
 
7252
- export { COLUMN_TYPE_DEFAULTS as C, DataTable as D, chipsFormatter as a, booleanFormatter as b, createColumnHelper$1 as c, currencyFormatter as d, dateFormatter as e, dateTimeFormatter as f, getColumnTypeDefaults as g, dateFormatPresets as h, timeFormatter as i, numberFormatter as n, percentFormatter as p, resolveColumnTypeConfig as r, timeFormatPresets as t, yearlessDateFormatter as y };
7253
- //# sourceMappingURL=DataTable-DK9xRjnq.js.map
7617
+ export { COLUMN_TYPE_DEFAULTS as C, DataTable as D, chipsFormatter as a, booleanFormatter as b, createColumnHelper$1 as c, currencyFormatter as d, dateFormatter as e, dateTimeFormatter as f, getColumnTypeDefaults as g, htmlFormatter as h, dateFormatPresets as i, timeFormatter as j, markdownFormatter as m, numberFormatter as n, percentFormatter as p, resolveColumnTypeConfig as r, timeFormatPresets as t, yearlessDateFormatter as y };
7618
+ //# sourceMappingURL=DataTable-JRxu2yTP.js.map