@servicetitan/anvil2 2.9.2 → 2.9.3

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 (156) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/{AiMark-DhgDh95y.js → AiMark-Dge6ktmW.js} +2 -2
  3. package/dist/{AiMark-DhgDh95y.js.map → AiMark-Dge6ktmW.js.map} +1 -1
  4. package/dist/AiMark.js +1 -1
  5. package/dist/{Alert-DffLPz0l.js → Alert-B83r7r7T.js} +2 -2
  6. package/dist/{Alert-DffLPz0l.js.map → Alert-B83r7r7T.js.map} +1 -1
  7. package/dist/Alert.js +1 -1
  8. package/dist/{Breadcrumbs-CkPZHJGM.js → Breadcrumbs-c-0298cq.js} +2 -2
  9. package/dist/{Breadcrumbs-CkPZHJGM.js.map → Breadcrumbs-c-0298cq.js.map} +1 -1
  10. package/dist/Breadcrumbs.js +1 -1
  11. package/dist/{Calendar-0DG2so95.js → Calendar-BHH6BxIs.js} +2 -2
  12. package/dist/{Calendar-0DG2so95.js.map → Calendar-BHH6BxIs.js.map} +1 -1
  13. package/dist/{Calendar-CaWPwtb3.js → Calendar-Bl6ZSodE.js} +2 -2
  14. package/dist/{Calendar-CaWPwtb3.js.map → Calendar-Bl6ZSodE.js.map} +1 -1
  15. package/dist/Calendar.js +2 -2
  16. package/dist/{Checkbox-CTR7JfWk.js → Checkbox-CmuW0fml.js} +2 -2
  17. package/dist/{Checkbox-CTR7JfWk.js.map → Checkbox-CmuW0fml.js.map} +1 -1
  18. package/dist/{Checkbox-B1I1OfZU.js → Checkbox-DuQLvvM8.js} +3 -3
  19. package/dist/{Checkbox-B1I1OfZU.js.map → Checkbox-DuQLvvM8.js.map} +1 -1
  20. package/dist/Checkbox.js +1 -1
  21. package/dist/{Chip-lIWu8uXb.js → Chip-DVzFbbgS.js} +2 -2
  22. package/dist/{Chip-lIWu8uXb.js.map → Chip-DVzFbbgS.js.map} +1 -1
  23. package/dist/Chip.js +1 -1
  24. package/dist/{Combobox-Dt3AnO9Z.js → Combobox-BlFWPOin.js} +3 -3
  25. package/dist/{Combobox-Dt3AnO9Z.js.map → Combobox-BlFWPOin.js.map} +1 -1
  26. package/dist/Combobox.js +1 -1
  27. package/dist/{DataTable-bMoIuYBK.js → DataTable-BA-Kn63l.js} +327 -117
  28. package/dist/DataTable-BA-Kn63l.js.map +1 -0
  29. package/dist/DataTable.css +200 -121
  30. package/dist/{DateFieldRange-B_D6v-F7.js → DateFieldRange-4axIJ9QU.js} +4 -4
  31. package/dist/{DateFieldRange-B_D6v-F7.js.map → DateFieldRange-4axIJ9QU.js.map} +1 -1
  32. package/dist/DateFieldRange.js +1 -1
  33. package/dist/{DateFieldSingle-D_Ve0E6q.js → DateFieldSingle-qGf_thDE.js} +4 -4
  34. package/dist/{DateFieldSingle-D_Ve0E6q.js.map → DateFieldSingle-qGf_thDE.js.map} +1 -1
  35. package/dist/DateFieldSingle.js +1 -1
  36. package/dist/{DateFieldYearless-Bg7OLIsT.js → DateFieldYearless-UTq-FBLX.js} +4 -4
  37. package/dist/{DateFieldYearless-Bg7OLIsT.js.map → DateFieldYearless-UTq-FBLX.js.map} +1 -1
  38. package/dist/DateFieldYearless.js +1 -1
  39. package/dist/{DateFieldYearlessRange-C40uUmLK.js → DateFieldYearlessRange-Bdf7R_tb.js} +3 -3
  40. package/dist/{DateFieldYearlessRange-C40uUmLK.js.map → DateFieldYearlessRange-Bdf7R_tb.js.map} +1 -1
  41. package/dist/DateFieldYearlessRange.js +1 -1
  42. package/dist/{DaysOfTheWeek-2a8Ukq59.js → DaysOfTheWeek-DneS1Y3_.js} +3 -3
  43. package/dist/{DaysOfTheWeek-2a8Ukq59.js.map → DaysOfTheWeek-DneS1Y3_.js.map} +1 -1
  44. package/dist/DaysOfTheWeek.js +1 -1
  45. package/dist/{Dialog-zxpNOCDS.js → Dialog-C6tkX_v7.js} +3 -3
  46. package/dist/{Dialog-zxpNOCDS.js.map → Dialog-C6tkX_v7.js.map} +1 -1
  47. package/dist/Dialog.js +1 -1
  48. package/dist/{Drawer-DkCcE434.js → Drawer-5Hj96MyV.js} +3 -3
  49. package/dist/{Drawer-DkCcE434.js.map → Drawer-5Hj96MyV.js.map} +1 -1
  50. package/dist/Drawer.js +1 -1
  51. package/dist/DrillDown.js +1 -1
  52. package/dist/{EditCard-BKHmnbKP.js → EditCard-CJWjBx2_.js} +2 -2
  53. package/dist/{EditCard-BKHmnbKP.js.map → EditCard-CJWjBx2_.js.map} +1 -1
  54. package/dist/EditCard.js +1 -1
  55. package/dist/{FieldLabel-M5v4-PAV.js → FieldLabel-Qxe_2xNX.js} +3 -3
  56. package/dist/{FieldLabel-M5v4-PAV.js.map → FieldLabel-Qxe_2xNX.js.map} +1 -1
  57. package/dist/FieldLabel.js +1 -1
  58. package/dist/{InputMask-PVCfJodz.js → InputMask-CcbJbNCy.js} +3 -3
  59. package/dist/{InputMask-PVCfJodz.js.map → InputMask-CcbJbNCy.js.map} +1 -1
  60. package/dist/InputMask.js +1 -1
  61. package/dist/{ListView-DT32FdKH.js → ListView-D724tdzO.js} +2 -2
  62. package/dist/{ListView-DT32FdKH.js.map → ListView-D724tdzO.js.map} +1 -1
  63. package/dist/ListView.js +1 -1
  64. package/dist/{Listbox-BR0HTJaM.js → Listbox-C7IBAFy_.js} +2 -2
  65. package/dist/{Listbox-BR0HTJaM.js.map → Listbox-C7IBAFy_.js.map} +1 -1
  66. package/dist/Listbox.js +1 -1
  67. package/dist/MultiSelectField.js +1 -1
  68. package/dist/{MultiSelectFieldSync-fV2O5J0N.js → MultiSelectFieldSync-BRXRCOvC.js} +5 -5
  69. package/dist/{MultiSelectFieldSync-fV2O5J0N.js.map → MultiSelectFieldSync-BRXRCOvC.js.map} +1 -1
  70. package/dist/MultiSelectMenu.js +1 -1
  71. package/dist/{MultiSelectMenuSync-BViWKlX1.js → MultiSelectMenuSync-DRs3iDQN.js} +3 -3
  72. package/dist/{MultiSelectMenuSync-BViWKlX1.js.map → MultiSelectMenuSync-DRs3iDQN.js.map} +1 -1
  73. package/dist/{NumberField-BxWTjbmF.js → NumberField-Ca-B_7Q5.js} +3 -3
  74. package/dist/{NumberField-BxWTjbmF.js.map → NumberField-Ca-B_7Q5.js.map} +1 -1
  75. package/dist/NumberField.js +1 -1
  76. package/dist/{Page-DFjOwTzH.js → Page-DJIcjeg7.js} +8 -8
  77. package/dist/{Page-DFjOwTzH.js.map → Page-DJIcjeg7.js.map} +1 -1
  78. package/dist/Page.js +1 -1
  79. package/dist/{Pagination-B9pdkp_V.js → Pagination-C7O7o6tl.js} +2 -2
  80. package/dist/{Pagination-B9pdkp_V.js.map → Pagination-C7O7o6tl.js.map} +1 -1
  81. package/dist/Pagination.js +1 -1
  82. package/dist/{ProgressBar-CFKKuXeN.js → ProgressBar-gMNOCMkq.js} +2 -2
  83. package/dist/{ProgressBar-CFKKuXeN.js.map → ProgressBar-gMNOCMkq.js.map} +1 -1
  84. package/dist/ProgressBar.js +1 -1
  85. package/dist/{Radio-CeVjHOXe.js → Radio-B_TLtNDx.js} +2 -2
  86. package/dist/{Radio-CeVjHOXe.js.map → Radio-B_TLtNDx.js.map} +1 -1
  87. package/dist/{Radio-Dda5sh2r.js → Radio-Cm_MS-YF.js} +3 -3
  88. package/dist/{Radio-Dda5sh2r.js.map → Radio-Cm_MS-YF.js.map} +1 -1
  89. package/dist/Radio.js +1 -1
  90. package/dist/{SelectCard-COJn0wT6.js → SelectCard-BbZcAhq1.js} +3 -3
  91. package/dist/{SelectCard-COJn0wT6.js.map → SelectCard-BbZcAhq1.js.map} +1 -1
  92. package/dist/SelectCard.js +1 -1
  93. package/dist/SelectField.js +1 -1
  94. package/dist/{SelectFieldLabel-ChEvk0uS.js → SelectFieldLabel-CktsTa2n.js} +2 -2
  95. package/dist/{SelectFieldLabel-ChEvk0uS.js.map → SelectFieldLabel-CktsTa2n.js.map} +1 -1
  96. package/dist/{SelectFieldSync-CDIRIYv2.js → SelectFieldSync-DFnRsT54.js} +4 -4
  97. package/dist/{SelectFieldSync-CDIRIYv2.js.map → SelectFieldSync-DFnRsT54.js.map} +1 -1
  98. package/dist/SelectMenu.js +1 -1
  99. package/dist/{SelectMenuSync-DkQrikHz.js → SelectMenuSync-ghETSNCu.js} +3 -3
  100. package/dist/{SelectMenuSync-DkQrikHz.js.map → SelectMenuSync-ghETSNCu.js.map} +1 -1
  101. package/dist/{SelectOptions-BN1tCi7P.js → SelectOptions-D4VTheY3.js} +2 -2
  102. package/dist/{SelectOptions-BN1tCi7P.js.map → SelectOptions-D4VTheY3.js.map} +1 -1
  103. package/dist/{SelectTrigger-LZUtpAFW.js → SelectTrigger-BpqY5C5I.js} +2 -2
  104. package/dist/{SelectTrigger-LZUtpAFW.js.map → SelectTrigger-BpqY5C5I.js.map} +1 -1
  105. package/dist/SelectTrigger.js +1 -1
  106. package/dist/{SelectTriggerBase-qeFownmF.js → SelectTriggerBase-CuchBk53.js} +3 -3
  107. package/dist/{SelectTriggerBase-qeFownmF.js.map → SelectTriggerBase-CuchBk53.js.map} +1 -1
  108. package/dist/{Switch-3u7oAQQV.js → Switch-rvb_rYeS.js} +2 -2
  109. package/dist/{Switch-3u7oAQQV.js.map → Switch-rvb_rYeS.js.map} +1 -1
  110. package/dist/Switch.js +1 -1
  111. package/dist/Table.js +1 -1
  112. package/dist/{Text-DQ78JchQ.js → Text-BRUESjpN.js} +2 -2
  113. package/dist/{Text-DQ78JchQ.js.map → Text-BRUESjpN.js.map} +1 -1
  114. package/dist/Text.js +1 -1
  115. package/dist/{TextField-DHk1k3cf.js → TextField-Be-VJZPT.js} +3 -3
  116. package/dist/{TextField-DHk1k3cf.js.map → TextField-Be-VJZPT.js.map} +1 -1
  117. package/dist/{TextField-Bu5kAe9_.js → TextField-CMkLsLLk.js} +2 -2
  118. package/dist/{TextField-Bu5kAe9_.js.map → TextField-CMkLsLLk.js.map} +1 -1
  119. package/dist/TextField.js +1 -1
  120. package/dist/{Textarea-CYv02rxW.js → Textarea-DLUFxF7O.js} +3 -3
  121. package/dist/{Textarea-CYv02rxW.js.map → Textarea-DLUFxF7O.js.map} +1 -1
  122. package/dist/Textarea.js +1 -1
  123. package/dist/{TimeField-BYtP64Qx.js → TimeField-D7pAP5pv.js} +4 -4
  124. package/dist/{TimeField-BYtP64Qx.js.map → TimeField-D7pAP5pv.js.map} +1 -1
  125. package/dist/TimeField.js +1 -1
  126. package/dist/Toast.js +2 -2
  127. package/dist/{Toaster-DO83u5o3.js → Toaster-C7j9mOgX.js} +2 -2
  128. package/dist/{Toaster-DO83u5o3.js.map → Toaster-C7j9mOgX.js.map} +1 -1
  129. package/dist/{Toaster-BRjGoIQu.js → Toaster-Da6LU4h-.js} +3 -3
  130. package/dist/{Toaster-BRjGoIQu.js.map → Toaster-Da6LU4h-.js.map} +1 -1
  131. package/dist/{Toolbar-Dsaufi65.js → Toolbar-CmiI43BR.js} +12 -12
  132. package/dist/{Toolbar-Dsaufi65.js.map → Toolbar-CmiI43BR.js.map} +1 -1
  133. package/dist/Toolbar.js +1 -1
  134. package/dist/{Tooltip-C1PBRnJv.js → Tooltip-Drml7OMN.js} +5 -5
  135. package/dist/{Tooltip-C1PBRnJv.js.map → Tooltip-Drml7OMN.js.map} +1 -1
  136. package/dist/Tooltip.css +9 -8
  137. package/dist/Tooltip.js +1 -1
  138. package/dist/{YearlessDateInputWithPicker-CChqr1gR.js → YearlessDateInputWithPicker-BCUWcF_p.js} +2 -2
  139. package/dist/{YearlessDateInputWithPicker-CChqr1gR.js.map → YearlessDateInputWithPicker-BCUWcF_p.js.map} +1 -1
  140. package/dist/beta/components/Table/DataTable/DataTable.d.ts +40 -1
  141. package/dist/beta/components/Table/DataTable/internal/DataTableBody.d.ts +22 -0
  142. package/dist/beta/components/Table/DataTable/internal/DataTableBodyRow.d.ts +18 -1
  143. package/dist/beta/components/Table/DataTable/internal/useDataTableVirtualizer.d.ts +9 -5
  144. package/dist/beta/components/Table/internal/getCommonPinningClasses.d.ts +1 -1
  145. package/dist/beta.js +9 -9
  146. package/dist/index.js +36 -36
  147. package/dist/{stripInlineMarkdown-V3M_UxQ8.js → stripInlineMarkdown-BvoVEz8b.js} +2 -2
  148. package/dist/{stripInlineMarkdown-V3M_UxQ8.js.map → stripInlineMarkdown-BvoVEz8b.js.map} +1 -1
  149. package/dist/{syncFilterUtils-DtOBvzdr.js → syncFilterUtils-v2Mrjxg-.js} +3 -3
  150. package/dist/{syncFilterUtils-DtOBvzdr.js.map → syncFilterUtils-v2Mrjxg-.js.map} +1 -1
  151. package/dist/{useDrilldown-CK9KzXvI.js → useDrilldown-5Tl36ntS.js} +2 -2
  152. package/dist/{useDrilldown-CK9KzXvI.js.map → useDrilldown-5Tl36ntS.js.map} +1 -1
  153. package/dist/{useToggleSelection-BMXohj4f.js → useToggleSelection-CxDdyrDJ.js} +2 -2
  154. package/dist/{useToggleSelection-BMXohj4f.js.map → useToggleSelection-CxDdyrDJ.js.map} +1 -1
  155. package/package.json +3 -3
  156. package/dist/DataTable-bMoIuYBK.js.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { C as Chip } from './Chip-lIWu8uXb.js';
2
+ import { C as Chip } from './Chip-DVzFbbgS.js';
3
3
  import { F as Flex } from './Flex-WyyZm1bf.js';
4
4
  import * as React from 'react';
5
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-CTR7JfWk.js';
8
+ import { C as Checkbox } from './Checkbox-CmuW0fml.js';
9
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';
@@ -13,15 +13,15 @@ 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-DkQrikHz.js';
17
- import { a as MultiSelectMenuSync, M as MultiSelectMenu } from './MultiSelectMenuSync-BViWKlX1.js';
18
- import { F as FieldLabel } from './FieldLabel-M5v4-PAV.js';
16
+ import { a as SelectMenuSync, S as SelectMenu } from './SelectMenuSync-ghETSNCu.js';
17
+ import { a as MultiSelectMenuSync, M as MultiSelectMenu } from './MultiSelectMenuSync-DRs3iDQN.js';
18
+ import { F as FieldLabel } from './FieldLabel-Qxe_2xNX.js';
19
19
  import { S as SvgError } from './error-DR_wWdYY.js';
20
20
  import { S as SvgWarning } from './warning-c4Wj1rI4.js';
21
- import { T as Tooltip } from './Tooltip-C1PBRnJv.js';
21
+ import { T as Tooltip } from './Tooltip-Drml7OMN.js';
22
22
  import { flushSync } from 'react-dom';
23
23
  import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-DMDdfIah.js';
24
- import { P as Pagination } from './Pagination-B9pdkp_V.js';
24
+ import { P as Pagination } from './Pagination-C7O7o6tl.js';
25
25
  import { T as ThemeProviderContext } from './ThemeProviderContext-l52GohYT.js';
26
26
  import { u as useVirtualizer } from './index-DXeGMe23.js';
27
27
  import { S as Spinner } from './Spinner-BqmcE2pb.js';
@@ -36,17 +36,19 @@ import './DataTable.css';const booleanFormatter = (value, { trueLabel = "True",
36
36
  };
37
37
 
38
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"};
39
+ "table-header-cell": "_table-header-cell_1dk64_2",
40
+ "table-body-cell": "_table-body-cell_1dk64_3",
41
+ "table-footer-cell": "_table-footer-cell_1dk64_4",
42
+ "last-pinned-left-column": "_last-pinned-left-column_1dk64_33",
43
+ "first-pinned-right-column": "_first-pinned-right-column_1dk64_33",
44
+ "first-pinned-left-column": "_first-pinned-left-column_1dk64_54",
45
+ "last-pinned-right-column": "_last-pinned-right-column_1dk64_59",
46
+ "empty-cell": "_empty-cell_1dk64_64",
47
+ "table-cell-internal-select": "_table-cell-internal-select_1dk64_81",
48
+ "table-cell-internal-expand": "_table-cell-internal-expand_1dk64_82",
49
+ "table-header-cell-group": "_table-header-cell-group_1dk64_101",
50
+ "table-header-cell-sortable": "_table-header-cell-sortable_1dk64_110",
51
+ "table-header-cell-interactive": "_table-header-cell-interactive_1dk64_111"};
50
52
 
51
53
  const TableEmptyCellContent = () => {
52
54
  return /* @__PURE__ */ jsx("span", { "aria-label": "empty table cell", className: styles$f["empty-cell"], children: "—" });
@@ -4013,6 +4015,7 @@ function TableBody({ type, children, ...rest }) {
4013
4015
  Element,
4014
4016
  {
4015
4017
  ...rest,
4018
+ "data-anv": "table-body",
4016
4019
  className: classes,
4017
4020
  role: type === "simple" ? void 0 : "rowgroup",
4018
4021
  children
@@ -4022,20 +4025,19 @@ function TableBody({ type, children, ...rest }) {
4022
4025
 
4023
4026
  const getCommonPinningClasses = (column) => {
4024
4027
  const isPinned = column.getIsPinned();
4025
- const isLastLeftPinnedColumn = isPinned === "left" && column.getIsLastColumn("left");
4026
- const isFirstRightPinnedColumn = isPinned === "right" && column.getIsFirstColumn("right");
4027
- if (isLastLeftPinnedColumn) {
4028
- return styles$f["last-pinned-left-column"];
4029
- }
4030
- if (isFirstRightPinnedColumn) {
4031
- return styles$f["first-pinned-right-column"];
4032
- }
4028
+ if (!isPinned) return void 0;
4029
+ return cx({
4030
+ [styles$f["first-pinned-left-column"]]: isPinned === "left" && column.getIsFirstColumn("left"),
4031
+ [styles$f["last-pinned-left-column"]]: isPinned === "left" && column.getIsLastColumn("left"),
4032
+ [styles$f["first-pinned-right-column"]]: isPinned === "right" && column.getIsFirstColumn("right"),
4033
+ [styles$f["last-pinned-right-column"]]: isPinned === "right" && column.getIsLastColumn("right")
4034
+ });
4033
4035
  };
4034
4036
 
4035
4037
  const styles$a = {
4036
- "data-table-body-cell-input": "_data-table-body-cell-input_wnkkd_2",
4037
- "data-table-body-cell-editable": "_data-table-body-cell-editable_wnkkd_36",
4038
- "data-table-body-cell-edit-icon-container": "_data-table-body-cell-edit-icon-container_wnkkd_36"
4038
+ "data-table-body-cell-input": "_data-table-body-cell-input_16wma_2",
4039
+ "data-table-body-cell-editable": "_data-table-body-cell-editable_16wma_36",
4040
+ "data-table-body-cell-edit-icon-container": "_data-table-body-cell-edit-icon-container_16wma_36"
4039
4041
  };
4040
4042
 
4041
4043
  const DataTableEditableCellEditIcon = () => {
@@ -4071,19 +4073,19 @@ const TableBodyCell = forwardRef(({ type, children, className, isExpandCell, isS
4071
4073
  TableBodyCell.displayName = "TableBodyCell";
4072
4074
 
4073
4075
  const styles$9 = {
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"
4076
+ "data-table-body-cell": "_data-table-body-cell_n8pkj_2",
4077
+ "data-table-body-cell-input": "_data-table-body-cell-input_n8pkj_3",
4078
+ "table-body-cell": "_table-body-cell_n8pkj_18",
4079
+ "table-header-cell": "_table-header-cell_n8pkj_19",
4080
+ "table-footer-cell": "_table-footer-cell_n8pkj_20",
4081
+ "data-table-cell-content": "_data-table-cell-content_n8pkj_30",
4082
+ "data-table-body-cell-editing": "_data-table-body-cell-editing_n8pkj_53",
4083
+ "data-table-header-cell": "_data-table-header-cell_n8pkj_54",
4084
+ "data-table-footer-cell": "_data-table-footer-cell_n8pkj_57",
4085
+ "data-table-body-cell-error": "_data-table-body-cell-error_n8pkj_106",
4086
+ "data-table-body-cell-warning": "_data-table-body-cell-warning_n8pkj_123",
4087
+ "cell-error-icon": "_cell-error-icon_n8pkj_132",
4088
+ "cell-warning-icon": "_cell-warning-icon_n8pkj_133"
4087
4089
  };
4088
4090
 
4089
4091
  function formatCellPositionString(cellPosition) {
@@ -5477,15 +5479,36 @@ function DataTableBodyCell(props) {
5477
5479
  }
5478
5480
 
5479
5481
  const styles$8 = {
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"
5482
+ "data-table-body-row": "_data-table-body-row_wgr33_2",
5483
+ "data-table-body-sub-component-row": "_data-table-body-sub-component-row_wgr33_22",
5484
+ "data-table-body-sub-component-container": "_data-table-body-sub-component-container_wgr33_26",
5485
+ "data-table-body-sub-component-content": "_data-table-body-sub-component-content_wgr33_31",
5486
+ "data-table-body-virtualized": "_data-table-body-virtualized_wgr33_35",
5487
+ "data-table-body-row-virtualized": "_data-table-body-row-virtualized_wgr33_40",
5488
+ "data-table-body-cell-group": "_data-table-body-cell-group_wgr33_50",
5489
+ "data-table-body-cell-depth-indent": "_data-table-body-cell-depth-indent_wgr33_59",
5490
+ "data-table-body-row-activatable": "_data-table-body-row-activatable_wgr33_68",
5491
+ "data-table-body-row-active": "_data-table-body-row-active_wgr33_73",
5492
+ "data-table-body-row-ancestor-hovered": "_data-table-body-row-ancestor-hovered_wgr33_83",
5493
+ "data-table-body-sub-component-row-active": "_data-table-body-sub-component-row-active_wgr33_86",
5494
+ "data-table-body-row-read-only": "_data-table-body-row-read-only_wgr33_89",
5495
+ "data-table-body-row-top-active": "_data-table-body-row-top-active_wgr33_104"
5487
5496
  };
5488
5497
 
5498
+ const ACTIVATE_IGNORE_SELECTOR = 'button, a, input, select, textarea, label, [role="button"], [role="checkbox"], [role="menuitem"], [data-anv="checkbox"], [class*="data-table-body-cell-editable"]';
5499
+ function collectDescendantIds(row) {
5500
+ const out = [];
5501
+ const stack = [...row.subRows ?? []];
5502
+ while (stack.length) {
5503
+ const current = stack.pop();
5504
+ if (!current) continue;
5505
+ out.push(current.id);
5506
+ if (current.subRows?.length) {
5507
+ stack.push(...current.subRows);
5508
+ }
5509
+ }
5510
+ return out;
5511
+ }
5489
5512
  function DataTableBodyRowInner({
5490
5513
  columnOrder,
5491
5514
  row,
@@ -5494,40 +5517,125 @@ function DataTableBodyRowInner({
5494
5517
  isExpanded,
5495
5518
  canExpand,
5496
5519
  depth,
5497
- parentRowCanExpand
5520
+ parentRowCanExpand,
5521
+ isActivatable,
5522
+ isActive,
5523
+ isTopMostActive,
5524
+ isReadOnly,
5525
+ onToggleActive
5498
5526
  }) {
5499
5527
  const visibleCells = row.getVisibleCells();
5500
5528
  const id = row.id;
5501
5529
  const original = row.original;
5502
5530
  const { focusSubComponent, blurSubComponent } = useDTFocusDispatchContext();
5531
+ const handleRowClick = useCallback(
5532
+ (event) => {
5533
+ if (!isActivatable) return;
5534
+ if (isReadOnly) return;
5535
+ const target = event.target;
5536
+ if (target?.closest(ACTIVATE_IGNORE_SELECTOR)) return;
5537
+ onToggleActive(
5538
+ row.id,
5539
+ collectDescendantIds(row)
5540
+ );
5541
+ },
5542
+ [isActivatable, isReadOnly, onToggleActive, row]
5543
+ );
5544
+ const shouldCascadeHover = isActivatable && canExpand;
5545
+ const handleMouseEnter = useCallback(
5546
+ (event) => {
5547
+ if (!shouldCascadeHover) return;
5548
+ const doc = event.currentTarget.ownerDocument ?? document;
5549
+ const className = styles$8["data-table-body-row-ancestor-hovered"];
5550
+ for (const descendantId of collectDescendantIds(row)) {
5551
+ const el = doc.querySelector(
5552
+ `[data-row-id="${CSS.escape(String(descendantId))}"]`
5553
+ );
5554
+ el?.classList.add(className);
5555
+ }
5556
+ },
5557
+ [shouldCascadeHover, row]
5558
+ );
5559
+ const handleMouseLeave = useCallback(
5560
+ (event) => {
5561
+ if (!shouldCascadeHover) return;
5562
+ const doc = event.currentTarget.ownerDocument ?? document;
5563
+ const className = styles$8["data-table-body-row-ancestor-hovered"];
5564
+ for (const descendantId of collectDescendantIds(row)) {
5565
+ const el = doc.querySelector(
5566
+ `[data-row-id="${CSS.escape(String(descendantId))}"]`
5567
+ );
5568
+ el?.classList.remove(className);
5569
+ }
5570
+ },
5571
+ [shouldCascadeHover, row]
5572
+ );
5573
+ const rowRef = useRef(null);
5574
+ useLayoutEffect(() => {
5575
+ const el = rowRef.current;
5576
+ if (!el) return;
5577
+ const ownerDoc = el.ownerDocument ?? document;
5578
+ const className = styles$8["data-table-body-row-ancestor-hovered"];
5579
+ let ancestor = row.getParentRow();
5580
+ while (ancestor) {
5581
+ const ancestorEl = ownerDoc.querySelector(
5582
+ `[data-row-id="${CSS.escape(String(ancestor.id))}"]`
5583
+ );
5584
+ if (ancestorEl?.matches(":hover")) {
5585
+ el.classList.add(className);
5586
+ return;
5587
+ }
5588
+ ancestor = ancestor.getParentRow();
5589
+ }
5590
+ }, [row]);
5503
5591
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
5504
5592
  /* @__PURE__ */ jsx(
5505
5593
  "div",
5506
5594
  {
5595
+ ref: rowRef,
5507
5596
  role: "row",
5508
5597
  "aria-rowindex": rowIndex + 1,
5509
5598
  "aria-expanded": tableHasSubRows && canExpand ? isExpanded : void 0,
5510
5599
  "aria-level": tableHasSubRows && (canExpand || parentRowCanExpand) ? depth + 1 : void 0,
5511
- className: styles$8["data-table-body-row"],
5512
- children: visibleCells.map((cell) => {
5513
- const isLastInParentGroup = cell.column.parent ? cell.column.parent.getLeafColumns().slice(-1)[0] === cell.column : false;
5514
- const cellClasses = cx(getCommonPinningClasses(cell.column), {
5515
- [styles$8["data-table-body-cell-group"]]: "columns" in cell.column.columnDef || cell.column.parent && isLastInParentGroup
5600
+ "data-row-id": row.id,
5601
+ className: cx(styles$8["data-table-body-row"], {
5602
+ [styles$8["data-table-body-row-activatable"]]: isActivatable,
5603
+ [styles$8["data-table-body-row-active"]]: isActive,
5604
+ [styles$8["data-table-body-row-top-active"]]: isTopMostActive,
5605
+ [styles$8["data-table-body-row-read-only"]]: isReadOnly
5606
+ }),
5607
+ style: depth > 0 ? { "--a2-row-depth": depth } : void 0,
5608
+ onClick: isActivatable ? handleRowClick : void 0,
5609
+ onMouseEnter: shouldCascadeHover ? handleMouseEnter : void 0,
5610
+ onMouseLeave: shouldCascadeHover ? handleMouseLeave : void 0,
5611
+ children: (() => {
5612
+ let firstDataCellClaimed = false;
5613
+ return visibleCells.map((cell) => {
5614
+ const isLastInParentGroup = cell.column.parent ? cell.column.parent.getLeafColumns().slice(-1)[0] === cell.column : false;
5615
+ const isInternalActionColumn = cell.column.id === INTERNAL_ROW_ACTION_PRIMARY_COLUMN_ID || cell.column.id === INTERNAL_ROW_ACTION_SECONDARY_COLUMN_ID;
5616
+ const isFirstDataCell = !isInternalActionColumn && !firstDataCellClaimed;
5617
+ if (!isInternalActionColumn) {
5618
+ firstDataCellClaimed = true;
5619
+ }
5620
+ const cellClasses = cx(getCommonPinningClasses(cell.column), {
5621
+ [styles$8["data-table-body-cell-group"]]: "columns" in cell.column.columnDef || cell.column.parent && isLastInParentGroup,
5622
+ [styles$8["data-table-body-cell-depth-indent"]]: isFirstDataCell
5623
+ });
5624
+ const columnIndex = columnOrder.indexOf(cell.column.getIndex());
5625
+ return /* @__PURE__ */ jsx(
5626
+ DataTableBodyCell,
5627
+ {
5628
+ cell,
5629
+ cellPosition: { rowIndex, columnIndex },
5630
+ "aria-colindex": columnIndex + 1,
5631
+ className: cellClasses,
5632
+ "data-anv-column-id": cell.column.id,
5633
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
5634
+ },
5635
+ cell.id
5636
+ );
5516
5637
  });
5517
- const columnIndex = columnOrder.indexOf(cell.column.getIndex());
5518
- return /* @__PURE__ */ jsx(
5519
- DataTableBodyCell,
5520
- {
5521
- cell,
5522
- cellPosition: { rowIndex, columnIndex },
5523
- "aria-colindex": columnIndex + 1,
5524
- className: cellClasses,
5525
- "data-anv-column-id": cell.column.id,
5526
- children: flexRender(cell.column.columnDef.cell, cell.getContext())
5527
- },
5528
- cell.id
5529
- );
5530
- })
5638
+ })()
5531
5639
  }
5532
5640
  ),
5533
5641
  isExpanded && "subComponent" in original && /* @__PURE__ */ jsx(
@@ -5535,7 +5643,9 @@ function DataTableBodyRowInner({
5535
5643
  {
5536
5644
  id: `${id}-sub-component`,
5537
5645
  "aria-hidden": !isExpanded,
5538
- className: styles$8["data-table-body-sub-component-row"],
5646
+ className: cx(styles$8["data-table-body-sub-component-row"], {
5647
+ [styles$8["data-table-body-sub-component-row-active"]]: isActive
5648
+ }),
5539
5649
  onFocus: () => {
5540
5650
  focusSubComponent();
5541
5651
  },
@@ -5552,7 +5662,7 @@ function areRowPropsEqual(prev, next) {
5552
5662
  if (!getRowVersion) {
5553
5663
  return false;
5554
5664
  }
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;
5665
+ 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 && prev.isActivatable === next.isActivatable && prev.isActive === next.isActive && prev.isTopMostActive === next.isTopMostActive && prev.isReadOnly === next.isReadOnly && prev.onToggleActive === next.onToggleActive;
5556
5666
  }
5557
5667
  const DataTableBodyRow = memo$1(
5558
5668
  DataTableBodyRowInner,
@@ -5586,10 +5696,31 @@ const useColumnOrder = ({ table }) => {
5586
5696
  };
5587
5697
  };
5588
5698
 
5699
+ function getIsRowActivatable(row, isActivatable) {
5700
+ if (!isActivatable) return false;
5701
+ if (typeof isActivatable === "function") {
5702
+ return isActivatable(row.original);
5703
+ }
5704
+ return true;
5705
+ }
5706
+ function getIsRowTopMostActive(row, activeRowMap) {
5707
+ if (!activeRowMap[row.id]) return false;
5708
+ if (!row.getCanExpand()) return false;
5709
+ let ancestor = row.getParentRow();
5710
+ while (ancestor) {
5711
+ if (activeRowMap[ancestor.id]) return false;
5712
+ ancestor = ancestor.getParentRow();
5713
+ }
5714
+ return true;
5715
+ }
5589
5716
  function NonVirtualizedContent({
5590
5717
  table,
5591
5718
  hasSubRows,
5592
- getRowVersion
5719
+ getRowVersion,
5720
+ isActivatable,
5721
+ activeRowMap,
5722
+ readOnlyRowMap,
5723
+ onToggleActive
5593
5724
  }) {
5594
5725
  const { columnOrder } = useColumnOrder({ table });
5595
5726
  const headerCount = table.getHeaderGroups().length;
@@ -5606,6 +5737,11 @@ function NonVirtualizedContent({
5606
5737
  parentRowCanExpand: row.getParentRow()?.getCanExpand() ?? false,
5607
5738
  isSelected: row.getIsSelected(),
5608
5739
  isSomeSelected: row.getIsSomeSelected(),
5740
+ isActivatable: getIsRowActivatable(row, isActivatable),
5741
+ isActive: !!activeRowMap[row.id],
5742
+ isTopMostActive: getIsRowTopMostActive(row, activeRowMap),
5743
+ isReadOnly: !!readOnlyRowMap[row.id],
5744
+ onToggleActive,
5609
5745
  getRowVersion
5610
5746
  },
5611
5747
  row.id
@@ -5615,7 +5751,11 @@ function VirtualizedContent({
5615
5751
  table,
5616
5752
  hasSubRows,
5617
5753
  virtualizer,
5618
- getRowVersion
5754
+ getRowVersion,
5755
+ isActivatable,
5756
+ activeRowMap,
5757
+ readOnlyRowMap,
5758
+ onToggleActive
5619
5759
  }) {
5620
5760
  const { columnOrder } = useColumnOrder({ table });
5621
5761
  const headerCount = table.getHeaderGroups().length;
@@ -5656,6 +5796,11 @@ function VirtualizedContent({
5656
5796
  parentRowCanExpand: row.getParentRow()?.getCanExpand() ?? false,
5657
5797
  isSelected: row.getIsSelected(),
5658
5798
  isSomeSelected: row.getIsSomeSelected(),
5799
+ isActivatable: getIsRowActivatable(row, isActivatable),
5800
+ isActive: !!activeRowMap[row.id],
5801
+ isTopMostActive: getIsRowTopMostActive(row, activeRowMap),
5802
+ isReadOnly: !!readOnlyRowMap[row.id],
5803
+ onToggleActive,
5659
5804
  getRowVersion
5660
5805
  }
5661
5806
  )
@@ -5667,27 +5812,45 @@ function VirtualizedContent({
5667
5812
  );
5668
5813
  }
5669
5814
  function DataTableBody(props) {
5670
- const { table, hasSubRows, virtualizer, getRowVersion, ...rest } = props;
5815
+ const {
5816
+ table,
5817
+ hasSubRows,
5818
+ virtualizer,
5819
+ getRowVersion,
5820
+ isActivatable,
5821
+ activeRowMap,
5822
+ readOnlyRowMap,
5823
+ onToggleActive,
5824
+ ...rest
5825
+ } = props;
5671
5826
  return /* @__PURE__ */ jsx(TableBody, { type: "data-table", ...rest, children: virtualizer ? /* @__PURE__ */ jsx(
5672
5827
  VirtualizedContent,
5673
5828
  {
5674
5829
  table,
5675
5830
  hasSubRows,
5676
5831
  virtualizer,
5677
- getRowVersion
5832
+ getRowVersion,
5833
+ isActivatable,
5834
+ activeRowMap,
5835
+ readOnlyRowMap,
5836
+ onToggleActive
5678
5837
  }
5679
5838
  ) : /* @__PURE__ */ jsx(
5680
5839
  NonVirtualizedContent,
5681
5840
  {
5682
5841
  table,
5683
5842
  hasSubRows,
5684
- getRowVersion
5843
+ getRowVersion,
5844
+ isActivatable,
5845
+ activeRowMap,
5846
+ readOnlyRowMap,
5847
+ onToggleActive
5685
5848
  }
5686
5849
  ) });
5687
5850
  }
5688
5851
 
5689
5852
  const styles$7 = {
5690
- "table-footer": "_table-footer_9bv2z_2"};
5853
+ "table-footer": "_table-footer_k57n3_2"};
5691
5854
 
5692
5855
  function TableFooter({ type, children, ...rest }) {
5693
5856
  const classes = cx(styles$7["table-footer"], rest.className);
@@ -6602,8 +6765,8 @@ function DataTableHeader({
6602
6765
  }
6603
6766
 
6604
6767
  const styles$2 = {
6605
- "table-container": "_table-container_vqc6w_2",
6606
- "table-scroll-container": "_table-scroll-container_vqc6w_57"
6768
+ "table-container": "_table-container_idn5c_2",
6769
+ "table-scroll-container": "_table-scroll-container_idn5c_57"
6607
6770
  };
6608
6771
 
6609
6772
  const TableContainer = forwardRef(
@@ -6637,7 +6800,7 @@ const TableContainer = forwardRef(
6637
6800
  );
6638
6801
  TableContainer.displayName = "TableContainer";
6639
6802
 
6640
- const pagination = "_pagination_d700v_2";
6803
+ const pagination = "_pagination_p29ed_2";
6641
6804
  const styles$1 = {
6642
6805
  pagination: pagination
6643
6806
  };
@@ -6770,6 +6933,8 @@ function scrollCellIntoView(element, stickyDimensions) {
6770
6933
  leftWidth: stickyDimensions.leftWidth,
6771
6934
  rightWidth: stickyDimensions.rightWidth
6772
6935
  };
6936
+ const cellStyle = window.getComputedStyle(element);
6937
+ const isHorizontallySticky = cellStyle.position === "sticky" && (cellStyle.left !== "auto" || cellStyle.right !== "auto");
6773
6938
  const elementRect = element.getBoundingClientRect();
6774
6939
  const scrollContainerRect = scrollContainer.getBoundingClientRect();
6775
6940
  const contentWidth = scrollContainer.clientWidth;
@@ -6781,6 +6946,7 @@ function scrollCellIntoView(element, stickyDimensions) {
6781
6946
  const isFullyVisible = elementRect.x >= visibleLeft && elementRect.x + elementRect.width <= visibleRight && (isBodyCell ? elementRect.y >= visibleTop && elementRect.y + elementRect.height <= visibleBottom : true);
6782
6947
  if (isFullyVisible) return;
6783
6948
  const getScrollByLeft = () => {
6949
+ if (isHorizontallySticky) return 0;
6784
6950
  if (elementRect.x < visibleLeft) {
6785
6951
  return elementRect.x - visibleLeft;
6786
6952
  }
@@ -7038,14 +7204,15 @@ function DTFocusProvider({
7038
7204
  return /* @__PURE__ */ jsx(DTFocusStateContext.Provider, { value: state, children: /* @__PURE__ */ jsx(DTFocusDispatchContext.Provider, { value: dispatch, children }) });
7039
7205
  }
7040
7206
 
7041
- const VIRTUALIZATION_THRESHOLD = 101;
7207
+ const VIRTUALIZATION_THRESHOLD = 50;
7042
7208
  const DEFAULT_ESTIMATED_ROW_HEIGHT = 35;
7043
7209
  function useDataTableVirtualizer({
7044
7210
  rowCount,
7045
7211
  scrollRef,
7046
- disabled
7212
+ disabled,
7213
+ forced
7047
7214
  }) {
7048
- const shouldVirtualize = !disabled && rowCount >= VIRTUALIZATION_THRESHOLD;
7215
+ const shouldVirtualize = !disabled && (forced || rowCount >= VIRTUALIZATION_THRESHOLD);
7049
7216
  const virtualizer = useVirtualizer({
7050
7217
  count: shouldVirtualize ? rowCount : 0,
7051
7218
  // `scrollRef` points at the outer TableContainer div, which does not
@@ -7077,14 +7244,19 @@ function DataTableInner(props, ref) {
7077
7244
  data: dataProp,
7078
7245
  columns: columnsProp,
7079
7246
  customFooter,
7247
+ defaultActiveRowIds,
7080
7248
  defaultExpandedRowIds,
7081
7249
  defaultSelectedRowIds,
7082
7250
  defaultSortedColumn,
7083
7251
  disableExpandAll,
7084
7252
  disableSelectAll,
7085
7253
  expandedRowIds,
7254
+ activeRowIds,
7255
+ isActivatable,
7086
7256
  isSelectable,
7257
+ onActivateRow,
7087
7258
  onSelectRow,
7259
+ readOnlyRowIds,
7088
7260
  onSort,
7089
7261
  onExpandRow,
7090
7262
  pagination,
@@ -7093,6 +7265,7 @@ function DataTableInner(props, ref) {
7093
7265
  emptyState,
7094
7266
  emptyCellContent,
7095
7267
  disableVirtualization,
7268
+ forceVirtualization,
7096
7269
  getRowVersion,
7097
7270
  className,
7098
7271
  style,
@@ -7103,6 +7276,7 @@ function DataTableInner(props, ref) {
7103
7276
  ...layoutStyles
7104
7277
  };
7105
7278
  const tableRef = useRef(null);
7279
+ const lastBodyHeightRef = useRef(null);
7106
7280
  const [rowSelection, setRowSelection] = useOptionallyControlledState({
7107
7281
  controlledValue: isSelectable && selectedRowIds ? Object.fromEntries(selectedRowIds.map((id) => [id, true])) : void 0,
7108
7282
  defaultValue: isSelectable ? defaultSelectedRowIds ? Object.fromEntries(defaultSelectedRowIds.map((id) => [id, true])) : {} : {},
@@ -7110,6 +7284,41 @@ function DataTableInner(props, ref) {
7110
7284
  onSelectRow?.(Object.keys(newRowSelection));
7111
7285
  }
7112
7286
  });
7287
+ const [rowActivation, setRowActivation] = useOptionallyControlledState({
7288
+ controlledValue: isActivatable && activeRowIds ? Object.fromEntries(activeRowIds.map((id) => [id, true])) : void 0,
7289
+ defaultValue: isActivatable ? defaultActiveRowIds ? Object.fromEntries(defaultActiveRowIds.map((id) => [id, true])) : {} : {},
7290
+ onChange: (newRowActivation) => {
7291
+ onActivateRow?.(Object.keys(newRowActivation));
7292
+ }
7293
+ });
7294
+ const activeRowMap = rowActivation ?? {};
7295
+ const readOnlyRowMap = useMemo(
7296
+ () => readOnlyRowIds ? Object.fromEntries(readOnlyRowIds.map((id) => [String(id), true])) : {},
7297
+ [readOnlyRowIds]
7298
+ );
7299
+ const setRowActivationRef = useRef(setRowActivation);
7300
+ setRowActivationRef.current = setRowActivation;
7301
+ const toggleRowActivation = useCallback(
7302
+ (rowId, descendantIds = []) => {
7303
+ setRowActivationRef.current((prev) => {
7304
+ const prevMap = prev ?? {};
7305
+ const rowKey = String(rowId);
7306
+ const descendantKeys = descendantIds.map(String);
7307
+ const next = { ...prevMap };
7308
+ if (prevMap[rowKey]) {
7309
+ delete next[rowKey];
7310
+ descendantKeys.forEach((key) => delete next[key]);
7311
+ } else {
7312
+ next[rowKey] = true;
7313
+ descendantKeys.forEach((key) => {
7314
+ next[key] = true;
7315
+ });
7316
+ }
7317
+ return next;
7318
+ });
7319
+ },
7320
+ []
7321
+ );
7113
7322
  const [sorting, setSorting] = useOptionallyControlledState({
7114
7323
  controlledValue: sortedColumn ? [sortedColumn] : void 0,
7115
7324
  defaultValue: defaultSortedColumn ? [defaultSortedColumn] : void 0,
@@ -7203,6 +7412,15 @@ function DataTableInner(props, ref) {
7203
7412
  }
7204
7413
  });
7205
7414
  const tableData = isLoading ? EMPTY_DATA : resolvedData;
7415
+ useLayoutEffect(() => {
7416
+ if (isLoading) return;
7417
+ const body = tableRef.current?.querySelector(
7418
+ '[data-anv="table-body"]'
7419
+ );
7420
+ if (body && body.offsetHeight > 0) {
7421
+ lastBodyHeightRef.current = body.offsetHeight;
7422
+ }
7423
+ }, [isLoading]);
7206
7424
  const hasRowStatus = useMemo(() => {
7207
7425
  return tableData?.some((row) => {
7208
7426
  const meta = row.meta;
@@ -7299,20 +7517,8 @@ function DataTableInner(props, ref) {
7299
7517
  "data-cell-action": "expand"
7300
7518
  }
7301
7519
  );
7302
- } else if (row.getParentRow()?.getCanExpand() && isSelectable) {
7303
- return /* @__PURE__ */ jsx(
7304
- Checkbox,
7305
- {
7306
- tabIndex: -1,
7307
- "aria-label": row.getIsSelected() ? "Deselect row" : "Select row",
7308
- checked: row.getIsSelected(),
7309
- disabled: !row.getCanSelect(),
7310
- indeterminate: row.getIsSomeSelected(),
7311
- onChange: row.getToggleSelectedHandler(),
7312
- "data-cell-action": "select"
7313
- }
7314
- );
7315
7520
  }
7521
+ return null;
7316
7522
  }
7317
7523
  });
7318
7524
  }
@@ -7337,23 +7543,18 @@ function DataTableInner(props, ref) {
7337
7543
  }
7338
7544
  ) });
7339
7545
  },
7340
- cell: ({ row }) => {
7341
- if (row.getParentRow()?.getCanExpand() && isSelectable) {
7342
- return null;
7546
+ cell: ({ row }) => /* @__PURE__ */ jsx(
7547
+ Checkbox,
7548
+ {
7549
+ tabIndex: -1,
7550
+ "aria-label": row.getIsSelected() ? "Deselect row" : "Select row",
7551
+ checked: row.getIsSelected(),
7552
+ disabled: !row.getCanSelect(),
7553
+ indeterminate: row.getIsSomeSelected(),
7554
+ onChange: row.getToggleSelectedHandler(),
7555
+ "data-cell-action": "select"
7343
7556
  }
7344
- return /* @__PURE__ */ jsx(
7345
- Checkbox,
7346
- {
7347
- tabIndex: -1,
7348
- "aria-label": row.getIsSelected() ? "Deselect row" : "Select row",
7349
- checked: row.getIsSelected(),
7350
- disabled: !row.getCanSelect(),
7351
- indeterminate: row.getIsSomeSelected(),
7352
- onChange: row.getToggleSelectedHandler(),
7353
- "data-cell-action": "select"
7354
- }
7355
- );
7356
- }
7557
+ )
7357
7558
  });
7358
7559
  }
7359
7560
  return tableColumns;
@@ -7398,7 +7599,11 @@ function DataTableInner(props, ref) {
7398
7599
  manualSorting: isAsyncPaginated,
7399
7600
  autoResetPageIndex: false,
7400
7601
  columnResizeMode: "onChange",
7401
- enableRowSelection: typeof isSelectable === "function" ? (row) => isSelectable(row.original) : isSelectable,
7602
+ enableRowSelection: !isSelectable ? false : (row) => {
7603
+ const original = row.original;
7604
+ if (readOnlyRowMap[String(original.id)]) return false;
7605
+ return typeof isSelectable === "function" ? isSelectable(original) : true;
7606
+ },
7402
7607
  onRowSelectionChange: (newRowSelection) => {
7403
7608
  setRowSelection(newRowSelection);
7404
7609
  },
@@ -7419,7 +7624,8 @@ function DataTableInner(props, ref) {
7419
7624
  const rowVirtualizer = useDataTableVirtualizer({
7420
7625
  rowCount: table.getRowModel().rows.length,
7421
7626
  scrollRef: tableRef,
7422
- disabled: disableVirtualization
7627
+ disabled: disableVirtualization,
7628
+ forced: forceVirtualization
7423
7629
  });
7424
7630
  const headers = table.getFlatHeaders();
7425
7631
  const headerRowCount = table.getHeaderGroups().length;
@@ -7529,7 +7735,11 @@ function DataTableInner(props, ref) {
7529
7735
  table,
7530
7736
  hasSubRows,
7531
7737
  virtualizer: rowVirtualizer,
7532
- getRowVersion
7738
+ getRowVersion,
7739
+ isActivatable,
7740
+ activeRowMap,
7741
+ readOnlyRowMap,
7742
+ onToggleActive: toggleRowActivation
7533
7743
  }
7534
7744
  ),
7535
7745
  isEmpty && emptyState && /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -7554,7 +7764,7 @@ function DataTableInner(props, ref) {
7554
7764
  "div",
7555
7765
  {
7556
7766
  style: {
7557
- height: rowsPerPage ? `${rowsPerPage * 35}px` : "200px"
7767
+ height: `${lastBodyHeightRef.current ?? (rowsPerPage ? rowsPerPage * 35 : 200)}px`
7558
7768
  },
7559
7769
  role: "presentation",
7560
7770
  "aria-hidden": "true",
@@ -7615,4 +7825,4 @@ function DataTableInner(props, ref) {
7615
7825
  const DataTable = forwardRef(DataTableInner);
7616
7826
 
7617
7827
  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-bMoIuYBK.js.map
7828
+ //# sourceMappingURL=DataTable-BA-Kn63l.js.map