@tanstack/table-core 9.0.0-alpha.46 → 9.0.0-alpha.48

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 (339) hide show
  1. package/README.md +10 -0
  2. package/dist/core/cells/constructCell.cjs +4 -3
  3. package/dist/core/cells/constructCell.cjs.map +1 -1
  4. package/dist/core/cells/constructCell.js +4 -3
  5. package/dist/core/cells/constructCell.js.map +1 -1
  6. package/dist/core/cells/coreCellsFeature.utils.cjs +11 -8
  7. package/dist/core/cells/coreCellsFeature.utils.cjs.map +1 -1
  8. package/dist/core/cells/coreCellsFeature.utils.d.cts +11 -8
  9. package/dist/core/cells/coreCellsFeature.utils.d.ts +11 -8
  10. package/dist/core/cells/coreCellsFeature.utils.js +11 -8
  11. package/dist/core/cells/coreCellsFeature.utils.js.map +1 -1
  12. package/dist/core/columns/constructColumn.cjs +6 -4
  13. package/dist/core/columns/constructColumn.cjs.map +1 -1
  14. package/dist/core/columns/constructColumn.js +6 -4
  15. package/dist/core/columns/constructColumn.js.map +1 -1
  16. package/dist/core/columns/coreColumnsFeature.types.d.cts +7 -6
  17. package/dist/core/columns/coreColumnsFeature.types.d.ts +7 -6
  18. package/dist/core/columns/coreColumnsFeature.utils.cjs +47 -29
  19. package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
  20. package/dist/core/columns/coreColumnsFeature.utils.d.cts +37 -27
  21. package/dist/core/columns/coreColumnsFeature.utils.d.ts +37 -27
  22. package/dist/core/columns/coreColumnsFeature.utils.js +47 -29
  23. package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
  24. package/dist/core/headers/buildHeaderGroups.cjs +27 -19
  25. package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
  26. package/dist/core/headers/buildHeaderGroups.js +27 -19
  27. package/dist/core/headers/buildHeaderGroups.js.map +1 -1
  28. package/dist/core/headers/constructHeader.cjs +4 -3
  29. package/dist/core/headers/constructHeader.cjs.map +1 -1
  30. package/dist/core/headers/constructHeader.js +4 -3
  31. package/dist/core/headers/constructHeader.js.map +1 -1
  32. package/dist/core/headers/coreHeadersFeature.cjs +1 -6
  33. package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
  34. package/dist/core/headers/coreHeadersFeature.js +2 -7
  35. package/dist/core/headers/coreHeadersFeature.js.map +1 -1
  36. package/dist/core/headers/coreHeadersFeature.types.d.cts +6 -4
  37. package/dist/core/headers/coreHeadersFeature.types.d.ts +6 -4
  38. package/dist/core/headers/coreHeadersFeature.utils.cjs +43 -36
  39. package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
  40. package/dist/core/headers/coreHeadersFeature.utils.d.cts +24 -19
  41. package/dist/core/headers/coreHeadersFeature.utils.d.ts +24 -19
  42. package/dist/core/headers/coreHeadersFeature.utils.js +44 -37
  43. package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
  44. package/dist/core/reactivity/coreReactivityFeature.types.d.cts +4 -0
  45. package/dist/core/reactivity/coreReactivityFeature.types.d.ts +4 -0
  46. package/dist/core/row-models/coreRowModelsFeature.utils.cjs +48 -36
  47. package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
  48. package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +48 -36
  49. package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +48 -36
  50. package/dist/core/row-models/coreRowModelsFeature.utils.js +48 -36
  51. package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
  52. package/dist/core/rows/constructRow.cjs +8 -6
  53. package/dist/core/rows/constructRow.cjs.map +1 -1
  54. package/dist/core/rows/constructRow.js +8 -6
  55. package/dist/core/rows/constructRow.js.map +1 -1
  56. package/dist/core/rows/coreRowsFeature.types.d.cts +4 -4
  57. package/dist/core/rows/coreRowsFeature.types.d.ts +4 -4
  58. package/dist/core/rows/coreRowsFeature.utils.cjs +43 -32
  59. package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
  60. package/dist/core/rows/coreRowsFeature.utils.d.cts +34 -28
  61. package/dist/core/rows/coreRowsFeature.utils.d.ts +34 -28
  62. package/dist/core/rows/coreRowsFeature.utils.js +43 -32
  63. package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
  64. package/dist/core/table/constructTable.cjs +9 -5
  65. package/dist/core/table/constructTable.cjs.map +1 -1
  66. package/dist/core/table/constructTable.js +9 -5
  67. package/dist/core/table/constructTable.js.map +1 -1
  68. package/dist/core/table/coreTablesFeature.types.d.cts +6 -2
  69. package/dist/core/table/coreTablesFeature.types.d.ts +6 -2
  70. package/dist/core/table/coreTablesFeature.utils.cjs +7 -3
  71. package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
  72. package/dist/core/table/coreTablesFeature.utils.d.cts +2 -2
  73. package/dist/core/table/coreTablesFeature.utils.d.ts +2 -2
  74. package/dist/core/table/coreTablesFeature.utils.js +7 -3
  75. package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
  76. package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +16 -10
  77. package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +16 -10
  78. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +26 -18
  79. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
  80. package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +26 -18
  81. package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +26 -18
  82. package/dist/features/column-faceting/columnFacetingFeature.utils.js +26 -18
  83. package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
  84. package/dist/features/column-faceting/createFacetedMinMaxValues.cjs +8 -5
  85. package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
  86. package/dist/features/column-faceting/createFacetedMinMaxValues.js +8 -5
  87. package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
  88. package/dist/features/column-faceting/createFacetedRowModel.cjs +8 -3
  89. package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
  90. package/dist/features/column-faceting/createFacetedRowModel.js +8 -3
  91. package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
  92. package/dist/features/column-faceting/createFacetedUniqueValues.cjs +7 -4
  93. package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
  94. package/dist/features/column-faceting/createFacetedUniqueValues.js +7 -4
  95. package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
  96. package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +21 -11
  97. package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +21 -11
  98. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +39 -28
  99. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
  100. package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +39 -28
  101. package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +39 -28
  102. package/dist/features/column-filtering/columnFilteringFeature.utils.js +39 -28
  103. package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
  104. package/dist/features/column-filtering/createFilteredRowModel.cjs +11 -5
  105. package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
  106. package/dist/features/column-filtering/createFilteredRowModel.js +11 -5
  107. package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
  108. package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +18 -14
  109. package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +18 -14
  110. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +55 -43
  111. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
  112. package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +55 -43
  113. package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +55 -43
  114. package/dist/features/column-grouping/columnGroupingFeature.utils.js +55 -43
  115. package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
  116. package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +14 -5
  117. package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +14 -5
  118. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +46 -29
  119. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
  120. package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +30 -23
  121. package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +30 -23
  122. package/dist/features/column-ordering/columnOrderingFeature.utils.js +46 -29
  123. package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
  124. package/dist/features/column-pinning/columnPinningFeature.types.d.cts +43 -31
  125. package/dist/features/column-pinning/columnPinningFeature.types.d.ts +43 -31
  126. package/dist/features/column-pinning/columnPinningFeature.utils.cjs +152 -115
  127. package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
  128. package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +116 -95
  129. package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +116 -95
  130. package/dist/features/column-pinning/columnPinningFeature.utils.js +153 -116
  131. package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
  132. package/dist/features/column-resizing/columnResizingFeature.types.d.cts +9 -9
  133. package/dist/features/column-resizing/columnResizingFeature.types.d.ts +9 -9
  134. package/dist/features/column-resizing/columnResizingFeature.utils.cjs +28 -19
  135. package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
  136. package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +28 -19
  137. package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +28 -19
  138. package/dist/features/column-resizing/columnResizingFeature.utils.js +28 -19
  139. package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
  140. package/dist/features/column-sizing/columnSizingFeature.cjs +28 -4
  141. package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
  142. package/dist/features/column-sizing/columnSizingFeature.js +28 -4
  143. package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
  144. package/dist/features/column-sizing/columnSizingFeature.types.d.cts +19 -12
  145. package/dist/features/column-sizing/columnSizingFeature.types.d.ts +19 -12
  146. package/dist/features/column-sizing/columnSizingFeature.utils.cjs +52 -41
  147. package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
  148. package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +52 -41
  149. package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +52 -41
  150. package/dist/features/column-sizing/columnSizingFeature.utils.js +52 -41
  151. package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
  152. package/dist/features/column-visibility/columnVisibilityFeature.cjs +23 -14
  153. package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
  154. package/dist/features/column-visibility/columnVisibilityFeature.js +24 -15
  155. package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
  156. package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +19 -12
  157. package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +19 -12
  158. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +91 -52
  159. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
  160. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +63 -40
  161. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +63 -40
  162. package/dist/features/column-visibility/columnVisibilityFeature.utils.js +91 -53
  163. package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
  164. package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +10 -5
  165. package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +10 -5
  166. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +20 -14
  167. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
  168. package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +20 -14
  169. package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +20 -14
  170. package/dist/features/global-filtering/globalFilteringFeature.utils.js +20 -14
  171. package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
  172. package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +16 -15
  173. package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +16 -15
  174. package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +58 -43
  175. package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
  176. package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +56 -41
  177. package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +56 -41
  178. package/dist/features/row-expanding/rowExpandingFeature.utils.js +58 -43
  179. package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
  180. package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +19 -12
  181. package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +19 -12
  182. package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +49 -32
  183. package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -1
  184. package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +49 -32
  185. package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +49 -32
  186. package/dist/features/row-pagination/rowPaginationFeature.utils.js +49 -32
  187. package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -1
  188. package/dist/features/row-pinning/rowPinningFeature.types.d.cts +12 -8
  189. package/dist/features/row-pinning/rowPinningFeature.types.d.ts +12 -8
  190. package/dist/features/row-pinning/rowPinningFeature.utils.cjs +52 -36
  191. package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
  192. package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +39 -29
  193. package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +39 -29
  194. package/dist/features/row-pinning/rowPinningFeature.utils.js +52 -36
  195. package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
  196. package/dist/features/row-selection/rowSelectionFeature.types.d.cts +30 -24
  197. package/dist/features/row-selection/rowSelectionFeature.types.d.ts +30 -24
  198. package/dist/features/row-selection/rowSelectionFeature.utils.cjs +95 -72
  199. package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
  200. package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +89 -69
  201. package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +89 -69
  202. package/dist/features/row-selection/rowSelectionFeature.utils.js +95 -72
  203. package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
  204. package/dist/features/row-sorting/createSortedRowModel.cjs +13 -8
  205. package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
  206. package/dist/features/row-sorting/createSortedRowModel.js +13 -8
  207. package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
  208. package/dist/features/row-sorting/rowSortingFeature.types.d.cts +10 -8
  209. package/dist/features/row-sorting/rowSortingFeature.types.d.ts +10 -8
  210. package/dist/features/row-sorting/rowSortingFeature.utils.cjs +63 -46
  211. package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
  212. package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +61 -44
  213. package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +61 -44
  214. package/dist/features/row-sorting/rowSortingFeature.utils.js +63 -46
  215. package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
  216. package/dist/fns/aggregationFns.cjs +47 -16
  217. package/dist/fns/aggregationFns.cjs.map +1 -1
  218. package/dist/fns/aggregationFns.d.cts +33 -9
  219. package/dist/fns/aggregationFns.d.ts +33 -9
  220. package/dist/fns/aggregationFns.js +47 -17
  221. package/dist/fns/aggregationFns.js.map +1 -1
  222. package/dist/fns/filterFns.cjs +48 -17
  223. package/dist/fns/filterFns.cjs.map +1 -1
  224. package/dist/fns/filterFns.d.cts +42 -15
  225. package/dist/fns/filterFns.d.ts +42 -15
  226. package/dist/fns/filterFns.js +48 -17
  227. package/dist/fns/filterFns.js.map +1 -1
  228. package/dist/helpers/columnHelper.cjs +9 -4
  229. package/dist/helpers/columnHelper.cjs.map +1 -1
  230. package/dist/helpers/columnHelper.d.cts +9 -4
  231. package/dist/helpers/columnHelper.d.ts +9 -4
  232. package/dist/helpers/columnHelper.js +9 -4
  233. package/dist/helpers/columnHelper.js.map +1 -1
  234. package/dist/helpers/tableOptions.cjs.map +1 -1
  235. package/dist/helpers/tableOptions.d.cts +12 -9
  236. package/dist/helpers/tableOptions.d.ts +12 -9
  237. package/dist/helpers/tableOptions.js.map +1 -1
  238. package/dist/index.cjs +0 -4
  239. package/dist/index.d.cts +2 -2
  240. package/dist/index.d.ts +2 -2
  241. package/dist/index.js +2 -2
  242. package/dist/static-functions.cjs +1 -0
  243. package/dist/static-functions.d.cts +2 -2
  244. package/dist/static-functions.d.ts +2 -2
  245. package/dist/static-functions.js +2 -2
  246. package/dist/store-reactivity-bindings.cjs +1 -0
  247. package/dist/store-reactivity-bindings.cjs.map +1 -1
  248. package/dist/store-reactivity-bindings.js +1 -0
  249. package/dist/store-reactivity-bindings.js.map +1 -1
  250. package/dist/types/ColumnDef.d.cts +38 -0
  251. package/dist/types/ColumnDef.d.ts +38 -0
  252. package/dist/types/TableOptions.d.cts +15 -0
  253. package/dist/types/TableOptions.d.ts +15 -0
  254. package/dist/types/TableState.d.cts +12 -0
  255. package/dist/types/TableState.d.ts +12 -0
  256. package/dist/utils.cjs +18 -39
  257. package/dist/utils.cjs.map +1 -1
  258. package/dist/utils.d.cts +1 -23
  259. package/dist/utils.d.ts +1 -23
  260. package/dist/utils.js +19 -36
  261. package/dist/utils.js.map +1 -1
  262. package/package.json +5 -3
  263. package/skills/column-definitions/SKILL.md +333 -0
  264. package/skills/column-layout/SKILL.md +328 -0
  265. package/skills/column-layout/references/subsystems.md +220 -0
  266. package/skills/customizing-feature-behavior/SKILL.md +416 -0
  267. package/skills/filtering/SKILL.md +357 -0
  268. package/skills/filtering/references/faceting-and-fuzzy.md +191 -0
  269. package/skills/grouping/SKILL.md +448 -0
  270. package/skills/migrate-v8-to-v9/SKILL.md +495 -0
  271. package/skills/pagination/SKILL.md +385 -0
  272. package/skills/row-expanding/SKILL.md +348 -0
  273. package/skills/row-pinning/SKILL.md +269 -0
  274. package/skills/row-selection/SKILL.md +391 -0
  275. package/skills/setup/SKILL.md +400 -0
  276. package/skills/sorting/SKILL.md +344 -0
  277. package/skills/state-management/SKILL.md +388 -0
  278. package/src/core/cells/constructCell.ts +3 -2
  279. package/src/core/cells/coreCellsFeature.utils.ts +11 -8
  280. package/src/core/columns/constructColumn.ts +5 -3
  281. package/src/core/columns/coreColumnsFeature.types.ts +7 -6
  282. package/src/core/columns/coreColumnsFeature.utils.ts +43 -29
  283. package/src/core/headers/buildHeaderGroups.ts +29 -30
  284. package/src/core/headers/constructHeader.ts +3 -2
  285. package/src/core/headers/coreHeadersFeature.ts +2 -27
  286. package/src/core/headers/coreHeadersFeature.types.ts +6 -4
  287. package/src/core/headers/coreHeadersFeature.utils.ts +52 -61
  288. package/src/core/reactivity/coreReactivityFeature.types.ts +4 -0
  289. package/src/core/row-models/coreRowModelsFeature.utils.ts +48 -36
  290. package/src/core/rows/constructRow.ts +6 -4
  291. package/src/core/rows/coreRowsFeature.types.ts +4 -4
  292. package/src/core/rows/coreRowsFeature.utils.ts +45 -32
  293. package/src/core/table/constructTable.ts +6 -4
  294. package/src/core/table/coreTablesFeature.types.ts +6 -2
  295. package/src/core/table/coreTablesFeature.utils.ts +5 -3
  296. package/src/features/column-faceting/columnFacetingFeature.types.ts +16 -10
  297. package/src/features/column-faceting/columnFacetingFeature.utils.ts +26 -18
  298. package/src/features/column-faceting/createFacetedMinMaxValues.ts +8 -10
  299. package/src/features/column-faceting/createFacetedRowModel.ts +10 -6
  300. package/src/features/column-faceting/createFacetedUniqueValues.ts +4 -3
  301. package/src/features/column-filtering/columnFilteringFeature.types.ts +21 -11
  302. package/src/features/column-filtering/columnFilteringFeature.utils.ts +39 -28
  303. package/src/features/column-filtering/createFilteredRowModel.ts +14 -8
  304. package/src/features/column-grouping/columnGroupingFeature.types.ts +18 -14
  305. package/src/features/column-grouping/columnGroupingFeature.utils.ts +55 -43
  306. package/src/features/column-ordering/columnOrderingFeature.types.ts +14 -5
  307. package/src/features/column-ordering/columnOrderingFeature.utils.ts +44 -29
  308. package/src/features/column-pinning/columnPinningFeature.types.ts +43 -31
  309. package/src/features/column-pinning/columnPinningFeature.utils.ts +164 -128
  310. package/src/features/column-resizing/columnResizingFeature.types.ts +9 -9
  311. package/src/features/column-resizing/columnResizingFeature.utils.ts +28 -19
  312. package/src/features/column-sizing/columnSizingFeature.ts +16 -0
  313. package/src/features/column-sizing/columnSizingFeature.types.ts +19 -12
  314. package/src/features/column-sizing/columnSizingFeature.utils.ts +52 -41
  315. package/src/features/column-visibility/columnVisibilityFeature.ts +8 -0
  316. package/src/features/column-visibility/columnVisibilityFeature.types.ts +22 -12
  317. package/src/features/column-visibility/columnVisibilityFeature.utils.ts +101 -56
  318. package/src/features/global-filtering/globalFilteringFeature.types.ts +10 -5
  319. package/src/features/global-filtering/globalFilteringFeature.utils.ts +20 -14
  320. package/src/features/row-expanding/rowExpandingFeature.types.ts +16 -15
  321. package/src/features/row-expanding/rowExpandingFeature.utils.ts +58 -43
  322. package/src/features/row-pagination/rowPaginationFeature.types.ts +19 -12
  323. package/src/features/row-pagination/rowPaginationFeature.utils.ts +49 -32
  324. package/src/features/row-pinning/rowPinningFeature.types.ts +12 -8
  325. package/src/features/row-pinning/rowPinningFeature.utils.ts +59 -47
  326. package/src/features/row-selection/rowSelectionFeature.types.ts +30 -24
  327. package/src/features/row-selection/rowSelectionFeature.utils.ts +109 -88
  328. package/src/features/row-sorting/createSortedRowModel.ts +16 -13
  329. package/src/features/row-sorting/rowSortingFeature.types.ts +10 -8
  330. package/src/features/row-sorting/rowSortingFeature.utils.ts +63 -46
  331. package/src/fns/aggregationFns.ts +53 -17
  332. package/src/fns/filterFns.ts +48 -17
  333. package/src/helpers/columnHelper.ts +9 -4
  334. package/src/helpers/tableOptions.ts +12 -9
  335. package/src/store-reactivity-bindings.ts +1 -0
  336. package/src/types/ColumnDef.ts +38 -0
  337. package/src/types/TableOptions.ts +15 -0
  338. package/src/types/TableState.ts +12 -0
  339. package/src/utils.ts +19 -46
@@ -3,13 +3,14 @@ import { constructCell } from "../cells/constructCell.js";
3
3
 
4
4
  //#region src/core/rows/coreRowsFeature.utils.ts
5
5
  /**
6
- * Returns value for a row.
6
+ * Reads and caches this row's value for a column.
7
7
  *
8
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
8
+ * The value is produced by the column accessor. Missing columns or display
9
+ * columns without an accessor return `undefined`.
9
10
  *
10
11
  * @example
11
12
  * ```ts
12
- * const value = row_getValue(row)
13
+ * const firstName = row_getValue(row, 'firstName')
13
14
  * ```
14
15
  */
15
16
  function row_getValue(row, columnId) {
@@ -20,13 +21,14 @@ function row_getValue(row, columnId) {
20
21
  return row._valuesCache[columnId];
21
22
  }
22
23
  /**
23
- * Returns unique values for a row.
24
+ * Reads and caches the values used by faceting/grouping for a column.
24
25
  *
25
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
26
+ * If the column defines `getUniqueValues`, that result is used. Otherwise the
27
+ * row's accessor value is wrapped in a single-item array.
26
28
  *
27
29
  * @example
28
30
  * ```ts
29
- * const value = row_getUniqueValues(row)
31
+ * const values = row_getUniqueValues(row, 'tags')
30
32
  * ```
31
33
  */
32
34
  function row_getUniqueValues(row, columnId) {
@@ -48,46 +50,47 @@ function row_getUniqueValues(row, columnId) {
48
50
  *
49
51
  * @example
50
52
  * ```ts
51
- * const value = row_renderValue(row)
53
+ * const value = row_renderValue(row, 'firstName')
52
54
  * ```
53
55
  */
54
56
  function row_renderValue(row, columnId) {
55
57
  return row.getValue(columnId) ?? row.table.options.renderFallbackValue;
56
58
  }
57
59
  /**
58
- * Returns leaf rows for a row.
60
+ * Flattens this row's descendant tree into leaf rows.
59
61
  *
60
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
62
+ * The row itself is not included; only nested `subRows` are walked.
61
63
  *
62
64
  * @example
63
65
  * ```ts
64
- * const value = row_getLeafRows(row)
66
+ * const descendants = row_getLeafRows(row)
65
67
  * ```
66
68
  */
67
69
  function row_getLeafRows(row) {
68
70
  return flattenBy(row.subRows, (d) => d.subRows);
69
71
  }
70
72
  /**
71
- * Returns parent row for a row.
73
+ * Looks up this row's direct parent, if it has one.
72
74
  *
73
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
75
+ * Parent lookup searches the pre-pagination row model so parent relationships
76
+ * are available even when the parent is not on the current page.
74
77
  *
75
78
  * @example
76
79
  * ```ts
77
- * const value = row_getParentRow(row)
80
+ * const parent = row_getParentRow(row)
78
81
  * ```
79
82
  */
80
83
  function row_getParentRow(row) {
81
84
  return row.parentId ? row.table.getRow(row.parentId, true) : void 0;
82
85
  }
83
86
  /**
84
- * Returns parent rows for a row.
87
+ * Collects this row's ancestor chain from root to direct parent.
85
88
  *
86
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
89
+ * The current row is not included. Rows without a parent return an empty array.
87
90
  *
88
91
  * @example
89
92
  * ```ts
90
- * const value = row_getParentRows(row)
93
+ * const ancestors = row_getParentRows(row)
91
94
  * ```
92
95
  */
93
96
  function row_getParentRows(row) {
@@ -102,43 +105,50 @@ function row_getParentRows(row) {
102
105
  return parentRows.reverse();
103
106
  }
104
107
  /**
105
- * Returns all cells for a row.
108
+ * Constructs one cell for each leaf column in this row.
106
109
  *
107
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
110
+ * The result follows `table.getAllLeafColumns()` order and includes hidden
111
+ * columns; visibility-specific APIs filter this list later.
108
112
  *
109
113
  * @example
110
114
  * ```ts
111
- * const value = row_getAllCells(row)
115
+ * const cells = row_getAllCells(row)
112
116
  * ```
113
117
  */
114
118
  function row_getAllCells(row) {
115
- return row.table.getAllLeafColumns().map((column) => {
116
- return constructCell(column, row, row.table);
117
- });
119
+ const columns = row.table.getAllLeafColumns();
120
+ const cells = new Array(columns.length);
121
+ for (let i = 0; i < columns.length; i++) cells[i] = constructCell(columns[i], row, row.table);
122
+ return cells;
118
123
  }
119
124
  /**
120
- * Returns all cells by column id for a row.
125
+ * Builds a lookup map of this row's cells keyed by column id.
121
126
  *
122
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
127
+ * This is the static implementation behind `row.getAllCellsByColumnId()`.
123
128
  *
124
129
  * @example
125
130
  * ```ts
126
- * const value = row_getAllCellsByColumnId(row)
131
+ * const cellsById = row_getAllCellsByColumnId(row)
127
132
  * ```
128
133
  */
129
134
  function row_getAllCellsByColumnId(row) {
130
135
  const result = {};
131
- for (const cell of row.getAllCells()) result[cell.column.id] = cell;
136
+ const cells = row.getAllCells();
137
+ for (let i = 0; i < cells.length; i++) {
138
+ const cell = cells[i];
139
+ result[cell.column.id] = cell;
140
+ }
132
141
  return result;
133
142
  }
134
143
  /**
135
- * Returns row id for the table.
144
+ * Resolves the stable id for a row.
136
145
  *
137
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
146
+ * `options.getRowId` wins when provided. Otherwise root rows use their index
147
+ * and child rows append their index to the parent id, such as `0.2`.
138
148
  *
139
149
  * @example
140
150
  * ```ts
141
- * const value = table_getRowId(table)
151
+ * const id = table_getRowId(originalRow, table, index, parentRow)
142
152
  * ```
143
153
  */
144
154
  function table_getRowId(originalRow, table, index, parent) {
@@ -146,13 +156,14 @@ function table_getRowId(originalRow, table, index, parent) {
146
156
  return ((_table$options$getRow = (_table$options = table.options).getRowId) === null || _table$options$getRow === void 0 ? void 0 : _table$options$getRow.call(_table$options, originalRow, index, parent)) ?? `${parent ? [parent.id, index].join(".") : index}`;
147
157
  }
148
158
  /**
149
- * Returns row for the table.
159
+ * Looks up a row by id from the current or full row model.
150
160
  *
151
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
161
+ * By default this searches `table.getRowModel()`. Passing `searchAll` searches
162
+ * the pre-pagination model first, then falls back to the core model.
152
163
  *
153
164
  * @example
154
165
  * ```ts
155
- * const value = table_getRow(table)
166
+ * const row = table_getRow(table, rowId, true)
156
167
  * ```
157
168
  */
158
169
  function table_getRow(table, rowId, searchAll) {
@@ -1 +1 @@
1
- {"version":3,"file":"coreRowsFeature.utils.js","names":[],"sources":["../../../src/core/rows/coreRowsFeature.utils.ts"],"sourcesContent":["import { flattenBy } from '../../utils'\nimport { constructCell } from '../cells/constructCell'\nimport type { Table_Internal } from '../../types/Table'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Cell } from '../../types/Cell'\n\n/**\n * Returns value for a row.\n *\n * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.\n *\n * @example\n * ```ts\n * const value = row_getValue(row)\n * ```\n */\nexport function row_getValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (row._valuesCache.hasOwnProperty(columnId)) {\n return row._valuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n row._valuesCache[columnId] = column.accessorFn(row.original, row.index)\n\n return row._valuesCache[columnId]\n}\n\n/**\n * Returns unique values for a row.\n *\n * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.\n *\n * @example\n * ```ts\n * const value = row_getUniqueValues(row)\n * ```\n */\nexport function row_getUniqueValues<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (row._uniqueValuesCache.hasOwnProperty(columnId)) {\n return row._uniqueValuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n if (!column.columnDef.getUniqueValues) {\n row._uniqueValuesCache[columnId] = [row.getValue(columnId)]\n return row._uniqueValuesCache[columnId]\n }\n\n row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(\n row.original,\n row.index,\n )\n\n return row._uniqueValuesCache[columnId]\n}\n\n/**\n * Returns a renderable row value for a column.\n *\n * If the accessor value is nullish, the table's `renderFallbackValue` is used\n * instead.\n *\n * @example\n * ```ts\n * const value = row_renderValue(row)\n * ```\n */\nexport function row_renderValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n return row.getValue(columnId) ?? row.table.options.renderFallbackValue\n}\n\n/**\n * Returns leaf rows for a row.\n *\n * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.\n *\n * @example\n * ```ts\n * const value = row_getLeafRows(row)\n * ```\n */\nexport function row_getLeafRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n return flattenBy(row.subRows, (d) => d.subRows)\n}\n\n/**\n * Returns parent row for a row.\n *\n * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.\n *\n * @example\n * ```ts\n * const value = row_getParentRow(row)\n * ```\n */\nexport function row_getParentRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n return row.parentId ? row.table.getRow(row.parentId, true) : undefined\n}\n\n/**\n * Returns parent rows for a row.\n *\n * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.\n *\n * @example\n * ```ts\n * const value = row_getParentRows(row)\n * ```\n */\nexport function row_getParentRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const parentRows: Array<Row<TFeatures, TData>> = []\n let currentRow = row\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n const parentRow = currentRow.getParentRow()\n if (!parentRow) break\n parentRows.push(parentRow)\n currentRow = parentRow\n }\n return parentRows.reverse()\n}\n\n/**\n * Returns all cells for a row.\n *\n * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.\n *\n * @example\n * ```ts\n * const value = row_getAllCells(row)\n * ```\n */\nexport function row_getAllCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>> {\n return row.table.getAllLeafColumns().map((column) => {\n return constructCell(column, row, row.table)\n })\n}\n\n/**\n * Returns all cells by column id for a row.\n *\n * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.\n *\n * @example\n * ```ts\n * const value = row_getAllCellsByColumnId(row)\n * ```\n */\nexport function row_getAllCellsByColumnId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const result: Record<string, Cell<TFeatures, TData, unknown>> = {}\n for (const cell of row.getAllCells()) {\n result[cell.column.id] = cell\n }\n return result\n}\n\n/**\n * Returns row id for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getRowId(table)\n * ```\n */\nexport function table_getRowId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n originalRow: TData,\n table: Table_Internal<TFeatures, TData>,\n index: number,\n parent?: Row<TFeatures, TData>,\n) {\n return (\n table.options.getRowId?.(originalRow, index, parent) ??\n `${parent ? [parent.id, index].join('.') : index}`\n )\n}\n\n/**\n * Returns row for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getRow(table)\n * ```\n */\nexport function table_getRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n rowId: string,\n searchAll?: boolean,\n): Row<TFeatures, TData> {\n // TODO - simplify this across different row models\n let row = (searchAll ? table.getPrePaginatedRowModel() : table.getRowModel())\n .rowsById[rowId]\n\n if (!row) {\n row = table.getCoreRowModel().rowsById[rowId]\n if (!row) {\n if (process.env.NODE_ENV === 'development') {\n throw new Error(`getRow could not find row with ID: ${rowId}`)\n }\n throw new Error()\n }\n }\n\n return row\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,SAAgB,aAGd,KAA4B,UAAkB;CAC9C,IAAI,IAAI,aAAa,eAAe,SAAS,EAC3C,OAAO,IAAI,aAAa;CAG1B,MAAM,SAAS,IAAI,MAAM,UAAU,SAAS;CAE5C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,aAAa,YAAY,OAAO,WAAW,IAAI,UAAU,IAAI,MAAM;CAEvE,OAAO,IAAI,aAAa;;;;;;;;;;;;AAa1B,SAAgB,oBAGd,KAA4B,UAAkB;CAC9C,IAAI,IAAI,mBAAmB,eAAe,SAAS,EACjD,OAAO,IAAI,mBAAmB;CAGhC,MAAM,SAAS,IAAI,MAAM,UAAU,SAAS;CAE5C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,CAAC,OAAO,UAAU,iBAAiB;EACrC,IAAI,mBAAmB,YAAY,CAAC,IAAI,SAAS,SAAS,CAAC;EAC3D,OAAO,IAAI,mBAAmB;;CAGhC,IAAI,mBAAmB,YAAY,OAAO,UAAU,gBAClD,IAAI,UACJ,IAAI,MACL;CAED,OAAO,IAAI,mBAAmB;;;;;;;;;;;;;AAchC,SAAgB,gBAGd,KAA4B,UAAkB;CAC9C,OAAO,IAAI,SAAS,SAAS,IAAI,IAAI,MAAM,QAAQ;;;;;;;;;;;;AAarD,SAAgB,gBAGd,KAA0D;CAC1D,OAAO,UAAU,IAAI,UAAU,MAAM,EAAE,QAAQ;;;;;;;;;;;;AAajD,SAAgB,iBAGd,KAA4B;CAC5B,OAAO,IAAI,WAAW,IAAI,MAAM,OAAO,IAAI,UAAU,KAAK,GAAG;;;;;;;;;;;;AAa/D,SAAgB,kBAGd,KAA4B;CAC5B,MAAM,aAA2C,EAAE;CACnD,IAAI,aAAa;CAEjB,OAAO,MAAM;EACX,MAAM,YAAY,WAAW,cAAc;EAC3C,IAAI,CAAC,WAAW;EAChB,WAAW,KAAK,UAAU;EAC1B,aAAa;;CAEf,OAAO,WAAW,SAAS;;;;;;;;;;;;AAa7B,SAAgB,gBAGd,KAAoE;CACpE,OAAO,IAAI,MAAM,mBAAmB,CAAC,KAAK,WAAW;EACnD,OAAO,cAAc,QAAQ,KAAK,IAAI,MAAM;GAC5C;;;;;;;;;;;;AAaJ,SAAgB,0BAGd,KAA4B;CAC5B,MAAM,SAA0D,EAAE;CAClE,KAAK,MAAM,QAAQ,IAAI,aAAa,EAClC,OAAO,KAAK,OAAO,MAAM;CAE3B,OAAO;;;;;;;;;;;;AAaT,SAAgB,eAId,aACA,OACA,OACA,QACA;;CACA,mDACE,MAAM,SAAQ,6GAAW,aAAa,OAAO,OAAO,KACpD,GAAG,SAAS,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,IAAI,GAAG;;;;;;;;;;;;AAc/C,SAAgB,aAId,OACA,OACA,WACuB;CAEvB,IAAI,OAAO,YAAY,MAAM,yBAAyB,GAAG,MAAM,aAAa,EACzE,SAAS;CAEZ,IAAI,CAAC,KAAK;EACR,MAAM,MAAM,iBAAiB,CAAC,SAAS;EACvC,IAAI,CAAC,KAAK;GACR,IAAI,QAAQ,IAAI,aAAa,eAC3B,MAAM,IAAI,MAAM,sCAAsC,QAAQ;GAEhE,MAAM,IAAI,OAAO;;;CAIrB,OAAO"}
1
+ {"version":3,"file":"coreRowsFeature.utils.js","names":[],"sources":["../../../src/core/rows/coreRowsFeature.utils.ts"],"sourcesContent":["import { flattenBy } from '../../utils'\nimport { constructCell } from '../cells/constructCell'\nimport type { Table_Internal } from '../../types/Table'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Cell } from '../../types/Cell'\n\n/**\n * Reads and caches this row's value for a column.\n *\n * The value is produced by the column accessor. Missing columns or display\n * columns without an accessor return `undefined`.\n *\n * @example\n * ```ts\n * const firstName = row_getValue(row, 'firstName')\n * ```\n */\nexport function row_getValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (row._valuesCache.hasOwnProperty(columnId)) {\n return row._valuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n row._valuesCache[columnId] = column.accessorFn(row.original, row.index)\n\n return row._valuesCache[columnId]\n}\n\n/**\n * Reads and caches the values used by faceting/grouping for a column.\n *\n * If the column defines `getUniqueValues`, that result is used. Otherwise the\n * row's accessor value is wrapped in a single-item array.\n *\n * @example\n * ```ts\n * const values = row_getUniqueValues(row, 'tags')\n * ```\n */\nexport function row_getUniqueValues<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (row._uniqueValuesCache.hasOwnProperty(columnId)) {\n return row._uniqueValuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n if (!column.columnDef.getUniqueValues) {\n row._uniqueValuesCache[columnId] = [row.getValue(columnId)]\n return row._uniqueValuesCache[columnId]\n }\n\n row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(\n row.original,\n row.index,\n )\n\n return row._uniqueValuesCache[columnId]\n}\n\n/**\n * Returns a renderable row value for a column.\n *\n * If the accessor value is nullish, the table's `renderFallbackValue` is used\n * instead.\n *\n * @example\n * ```ts\n * const value = row_renderValue(row, 'firstName')\n * ```\n */\nexport function row_renderValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n return row.getValue(columnId) ?? row.table.options.renderFallbackValue\n}\n\n/**\n * Flattens this row's descendant tree into leaf rows.\n *\n * The row itself is not included; only nested `subRows` are walked.\n *\n * @example\n * ```ts\n * const descendants = row_getLeafRows(row)\n * ```\n */\nexport function row_getLeafRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n return flattenBy(row.subRows, (d) => d.subRows)\n}\n\n/**\n * Looks up this row's direct parent, if it has one.\n *\n * Parent lookup searches the pre-pagination row model so parent relationships\n * are available even when the parent is not on the current page.\n *\n * @example\n * ```ts\n * const parent = row_getParentRow(row)\n * ```\n */\nexport function row_getParentRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n return row.parentId ? row.table.getRow(row.parentId, true) : undefined\n}\n\n/**\n * Collects this row's ancestor chain from root to direct parent.\n *\n * The current row is not included. Rows without a parent return an empty array.\n *\n * @example\n * ```ts\n * const ancestors = row_getParentRows(row)\n * ```\n */\nexport function row_getParentRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const parentRows: Array<Row<TFeatures, TData>> = []\n let currentRow = row\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n const parentRow = currentRow.getParentRow()\n if (!parentRow) break\n parentRows.push(parentRow)\n currentRow = parentRow\n }\n return parentRows.reverse()\n}\n\n/**\n * Constructs one cell for each leaf column in this row.\n *\n * The result follows `table.getAllLeafColumns()` order and includes hidden\n * columns; visibility-specific APIs filter this list later.\n *\n * @example\n * ```ts\n * const cells = row_getAllCells(row)\n * ```\n */\nexport function row_getAllCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>> {\n const columns = row.table.getAllLeafColumns()\n const cells: Array<Cell<TFeatures, TData, unknown>> = new Array(\n columns.length,\n )\n for (let i = 0; i < columns.length; i++) {\n cells[i] = constructCell(columns[i]!, row, row.table)\n }\n return cells\n}\n\n/**\n * Builds a lookup map of this row's cells keyed by column id.\n *\n * This is the static implementation behind `row.getAllCellsByColumnId()`.\n *\n * @example\n * ```ts\n * const cellsById = row_getAllCellsByColumnId(row)\n * ```\n */\nexport function row_getAllCellsByColumnId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const result: Record<string, Cell<TFeatures, TData, unknown>> = {}\n const cells = row.getAllCells()\n for (let i = 0; i < cells.length; i++) {\n const cell = cells[i]!\n result[cell.column.id] = cell\n }\n return result\n}\n\n/**\n * Resolves the stable id for a row.\n *\n * `options.getRowId` wins when provided. Otherwise root rows use their index\n * and child rows append their index to the parent id, such as `0.2`.\n *\n * @example\n * ```ts\n * const id = table_getRowId(originalRow, table, index, parentRow)\n * ```\n */\nexport function table_getRowId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n originalRow: TData,\n table: Table_Internal<TFeatures, TData>,\n index: number,\n parent?: Row<TFeatures, TData>,\n) {\n return (\n table.options.getRowId?.(originalRow, index, parent) ??\n `${parent ? [parent.id, index].join('.') : index}`\n )\n}\n\n/**\n * Looks up a row by id from the current or full row model.\n *\n * By default this searches `table.getRowModel()`. Passing `searchAll` searches\n * the pre-pagination model first, then falls back to the core model.\n *\n * @example\n * ```ts\n * const row = table_getRow(table, rowId, true)\n * ```\n */\nexport function table_getRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n rowId: string,\n searchAll?: boolean,\n): Row<TFeatures, TData> {\n // TODO - simplify this across different row models\n let row = (searchAll ? table.getPrePaginatedRowModel() : table.getRowModel())\n .rowsById[rowId]\n\n if (!row) {\n row = table.getCoreRowModel().rowsById[rowId]\n if (!row) {\n if (process.env.NODE_ENV === 'development') {\n throw new Error(`getRow could not find row with ID: ${rowId}`)\n }\n throw new Error()\n }\n }\n\n return row\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,aAGd,KAA4B,UAAkB;CAC9C,IAAI,IAAI,aAAa,eAAe,SAAS,EAC3C,OAAO,IAAI,aAAa;CAG1B,MAAM,SAAS,IAAI,MAAM,UAAU,SAAS;CAE5C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,aAAa,YAAY,OAAO,WAAW,IAAI,UAAU,IAAI,MAAM;CAEvE,OAAO,IAAI,aAAa;;;;;;;;;;;;;AAc1B,SAAgB,oBAGd,KAA4B,UAAkB;CAC9C,IAAI,IAAI,mBAAmB,eAAe,SAAS,EACjD,OAAO,IAAI,mBAAmB;CAGhC,MAAM,SAAS,IAAI,MAAM,UAAU,SAAS;CAE5C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,CAAC,OAAO,UAAU,iBAAiB;EACrC,IAAI,mBAAmB,YAAY,CAAC,IAAI,SAAS,SAAS,CAAC;EAC3D,OAAO,IAAI,mBAAmB;;CAGhC,IAAI,mBAAmB,YAAY,OAAO,UAAU,gBAClD,IAAI,UACJ,IAAI,MACL;CAED,OAAO,IAAI,mBAAmB;;;;;;;;;;;;;AAchC,SAAgB,gBAGd,KAA4B,UAAkB;CAC9C,OAAO,IAAI,SAAS,SAAS,IAAI,IAAI,MAAM,QAAQ;;;;;;;;;;;;AAarD,SAAgB,gBAGd,KAA0D;CAC1D,OAAO,UAAU,IAAI,UAAU,MAAM,EAAE,QAAQ;;;;;;;;;;;;;AAcjD,SAAgB,iBAGd,KAA4B;CAC5B,OAAO,IAAI,WAAW,IAAI,MAAM,OAAO,IAAI,UAAU,KAAK,GAAG;;;;;;;;;;;;AAa/D,SAAgB,kBAGd,KAA4B;CAC5B,MAAM,aAA2C,EAAE;CACnD,IAAI,aAAa;CAEjB,OAAO,MAAM;EACX,MAAM,YAAY,WAAW,cAAc;EAC3C,IAAI,CAAC,WAAW;EAChB,WAAW,KAAK,UAAU;EAC1B,aAAa;;CAEf,OAAO,WAAW,SAAS;;;;;;;;;;;;;AAc7B,SAAgB,gBAGd,KAAoE;CACpE,MAAM,UAAU,IAAI,MAAM,mBAAmB;CAC7C,MAAM,QAAgD,IAAI,MACxD,QAAQ,OACT;CACD,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAClC,MAAM,KAAK,cAAc,QAAQ,IAAK,KAAK,IAAI,MAAM;CAEvD,OAAO;;;;;;;;;;;;AAaT,SAAgB,0BAGd,KAA4B;CAC5B,MAAM,SAA0D,EAAE;CAClE,MAAM,QAAQ,IAAI,aAAa;CAC/B,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,MAAM,OAAO,MAAM;EACnB,OAAO,KAAK,OAAO,MAAM;;CAE3B,OAAO;;;;;;;;;;;;;AAcT,SAAgB,eAId,aACA,OACA,OACA,QACA;;CACA,mDACE,MAAM,SAAQ,6GAAW,aAAa,OAAO,OAAO,KACpD,GAAG,SAAS,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,IAAI,GAAG;;;;;;;;;;;;;AAe/C,SAAgB,aAId,OACA,OACA,WACuB;CAEvB,IAAI,OAAO,YAAY,MAAM,yBAAyB,GAAG,MAAM,aAAa,EACzE,SAAS;CAEZ,IAAI,CAAC,KAAK;EACR,MAAM,MAAM,iBAAiB,CAAC,SAAS;EACvC,IAAI,CAAC,KAAK;GACR,IAAI,QAAQ,IAAI,aAAa,eAC3B,MAAM,IAAI,MAAM,sCAAsC,QAAQ;GAEhE,MAAM,IAAI,OAAO;;;CAIrB,OAAO"}
@@ -57,7 +57,8 @@ function constructTable(tableOptions) {
57
57
  } else table.options = mergedOptions;
58
58
  table.initialState = getInitialTableState(table._features, table.options.initialState);
59
59
  const stateKeys = Object.keys(table.initialState);
60
- for (const key of stateKeys) {
60
+ for (let i = 0; i < stateKeys.length; i++) {
61
+ const key = stateKeys[i];
61
62
  table.baseAtoms[key] = _reactivity.createWritableAtom(table.initialState[key], { debugName: `table/baseAtoms/${key}` });
62
63
  table.atoms[key] = _reactivity.createReadonlyAtom(() => {
63
64
  var _table$options$atoms;
@@ -69,7 +70,10 @@ function constructTable(tableOptions) {
69
70
  require_coreTablesFeature_utils.table_syncExternalStateToBaseAtoms(table);
70
71
  table.store = require_coreReactivityFeature_utils.atomToStore(_reactivity.createReadonlyAtom(() => {
71
72
  const snapshot = {};
72
- for (const key of stateKeys) snapshot[key] = table.atoms[key].get();
73
+ for (let i = 0; i < stateKeys.length; i++) {
74
+ const key = stateKeys[i];
75
+ snapshot[key] = table.atoms[key].get();
76
+ }
73
77
  return snapshot;
74
78
  }, { debugName: "table/store" }));
75
79
  if (process.env.NODE_ENV === "development" && (tableOptions.debugAll || tableOptions.debugTable)) {
@@ -84,9 +88,9 @@ function constructTable(tableOptions) {
84
88
 
85
89
  States: ${states.join("\n ")}\n`, { table });
86
90
  }
87
- for (const feature of featuresList) {
88
- var _feature$constructTab;
89
- (_feature$constructTab = feature.constructTableAPIs) === null || _feature$constructTab === void 0 || _feature$constructTab.call(feature, table);
91
+ for (let i = 0; i < featuresList.length; i++) {
92
+ var _constructTableAPIs, _ref;
93
+ (_constructTableAPIs = (_ref = featuresList[i]).constructTableAPIs) === null || _constructTableAPIs === void 0 || _constructTableAPIs.call(_ref, table);
90
94
  }
91
95
  return table;
92
96
  }
@@ -1 +1 @@
1
- {"version":3,"file":"constructTable.cjs","names":["cloneState","coreFeatures","atomToStore"],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState } from '../../types/TableState'\n\n/**\n * Builds the initial table state from registered features and user initial state.\n *\n * Each feature contributes its default state before user-provided `initialState` values are merged in.\n */\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\n/**\n * Constructs a table instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions._features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions._features },\n _rowModels: {},\n _rowModelFns: {},\n baseAtoms: {},\n atoms: {},\n } as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature<{}>> = Object.values(table._features)\n\n const defaultOptions = featuresList.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultTableOptions?.(table))\n }, {}) as TableOptions<TFeatures, TData>\n\n const mergedOptions = { ...defaultOptions, ...tableOptions }\n\n if (_reactivity.createOptionsStore) {\n // @ts-ignore - direct set\n table.optionsStore = _reactivity.createWritableAtom<\n TableOptions<TFeatures, TData>\n >(mergedOptions, { debugName: 'table/optionsStore' })\n Object.defineProperty(table, 'options', {\n configurable: true,\n enumerable: true,\n get() {\n return table.optionsStore!.get()\n },\n set(value) {\n table.optionsStore!.set(() => value) // or your real update shape\n },\n })\n } else {\n table.options = mergedOptions\n }\n\n table.initialState = getInitialTableState(\n table._features,\n table.options.initialState,\n )\n\n const stateKeys = Object.keys(table.initialState) as Array<\n string & keyof TableState<TFeatures>\n >\n\n for (const key of stateKeys) {\n // create writable base atom\n table.baseAtoms[key] = _reactivity.createWritableAtom(\n table.initialState[key],\n {\n debugName: `table/baseAtoms/${key}`,\n },\n ) as any\n\n // create readonly derived atom: on each get(), read either external atom or base atom\n ;(table.atoms as any)[key] = _reactivity.createReadonlyAtom(\n () => {\n const externalAtom = table.options.atoms?.[key]\n if (externalAtom) {\n return externalAtom.get()\n }\n return table.baseAtoms[key].get()\n },\n { debugName: `table/atoms/${key}` },\n )\n }\n\n table_syncExternalStateToBaseAtoms(table)\n\n table.store = atomToStore(\n _reactivity.createReadonlyAtom(\n () => {\n const snapshot = {} as TableState<TFeatures>\n for (const key of stateKeys) {\n snapshot[key] = table.atoms[key].get()\n }\n return snapshot\n },\n { debugName: 'table/store' },\n ),\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n (tableOptions.debugAll || tableOptions.debugTable)\n ) {\n const features = Object.keys(table._features)\n const rowModels = Object.keys(table.options._rowModels || {})\n const states = Object.keys(table.initialState)\n\n console.log(\n `Constructing Table Instance\n\n Features: ${features.join('\\n ')}\n\n Row Models: ${rowModels.length ? rowModels.join('\\n ') : '(none)'}\n\n States: ${states.join('\\n ')}\\n`,\n { table },\n )\n }\n\n for (const feature of featuresList) {\n feature.constructTableAPIs?.(table)\n }\n\n return table\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,qBACd,UACA,eAA2D,EAAE,EACtC;CACvB,OAAO,OAAO,SAAS,CAAC,SAAS,YAAY;;EAC3C,yCAAe,QAAQ,6GAAkB,aAAa,KAAI;GAC1D;CACF,OAAOA,yBAAW,aAAa;;;;;;;AAQjC,SAAgB,eAGd,cAAuE;CACvE,MAAM,cAAc,aAAa,UAAU;CAE3C,MAAM,QAAQ;EACZ;EACA,WAAW;GAAE,GAAGC;GAAc,GAAG,aAAa;GAAW;EACzD,YAAY,EAAE;EACd,cAAc,EAAE;EAChB,WAAW,EAAE;EACb,OAAO,EAAE;EACV;CAED,MAAM,eAAwC,OAAO,OAAO,MAAM,UAAU;CAM5E,MAAM,gBAAgB;EAAE,GAJD,aAAa,QAAQ,KAAK,YAAY;;GAC3D,OAAO,OAAO,OAAO,8BAAK,QAAQ,oHAAyB,MAAM,CAAC;KACjE,EAAE,CAEoC;EAAE,GAAG;EAAc;CAE5D,IAAI,YAAY,oBAAoB;EAElC,MAAM,eAAe,YAAY,mBAE/B,eAAe,EAAE,WAAW,sBAAsB,CAAC;EACrD,OAAO,eAAe,OAAO,WAAW;GACtC,cAAc;GACd,YAAY;GACZ,MAAM;IACJ,OAAO,MAAM,aAAc,KAAK;;GAElC,IAAI,OAAO;IACT,MAAM,aAAc,UAAU,MAAM;;GAEvC,CAAC;QAEF,MAAM,UAAU;CAGlB,MAAM,eAAe,qBACnB,MAAM,WACN,MAAM,QAAQ,aACf;CAED,MAAM,YAAY,OAAO,KAAK,MAAM,aAAa;CAIjD,KAAK,MAAM,OAAO,WAAW;EAE3B,MAAM,UAAU,OAAO,YAAY,mBACjC,MAAM,aAAa,MACnB,EACE,WAAW,mBAAmB,OAC/B,CACF;EAGA,AAAC,MAAM,MAAc,OAAO,YAAY,yBACjC;;GACJ,MAAM,uCAAe,MAAM,QAAQ,mFAAQ;GAC3C,IAAI,cACF,OAAO,aAAa,KAAK;GAE3B,OAAO,MAAM,UAAU,KAAK,KAAK;KAEnC,EAAE,WAAW,eAAe,OAAO,CACpC;;CAGH,mEAAmC,MAAM;CAEzC,MAAM,QAAQC,gDACZ,YAAY,yBACJ;EACJ,MAAM,WAAW,EAAE;EACnB,KAAK,MAAM,OAAO,WAChB,SAAS,OAAO,MAAM,MAAM,KAAK,KAAK;EAExC,OAAO;IAET,EAAE,WAAW,eAAe,CAC7B,CACF;CAED,IACE,QAAQ,IAAI,aAAa,kBACxB,aAAa,YAAY,aAAa,aACvC;EACA,MAAM,WAAW,OAAO,KAAK,MAAM,UAAU;EAC7C,MAAM,YAAY,OAAO,KAAK,MAAM,QAAQ,cAAc,EAAE,CAAC;EAC7D,MAAM,SAAS,OAAO,KAAK,MAAM,aAAa;EAE9C,QAAQ,IACN;;gBAEU,SAAS,KAAK,mBAAmB,CAAC;;gBAElC,UAAU,SAAS,UAAU,KAAK,mBAAmB,GAAG,SAAS;;gBAEjE,OAAO,KAAK,mBAAmB,CAAC,KAC1C,EAAE,OAAO,CACV;;CAGH,KAAK,MAAM,WAAW,cAAc;;EAClC,iCAAQ,wGAAqB,MAAM;;CAGrC,OAAO"}
1
+ {"version":3,"file":"constructTable.cjs","names":["cloneState","coreFeatures","atomToStore"],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState } from '../../types/TableState'\n\n/**\n * Builds the initial table state from registered features and user initial state.\n *\n * Each feature contributes its default state before user-provided `initialState` values are merged in.\n */\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\n/**\n * Constructs a table instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions._features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions._features },\n _rowModels: {},\n _rowModelFns: {},\n baseAtoms: {},\n atoms: {},\n } as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature<{}>> = Object.values(table._features)\n\n const defaultOptions = featuresList.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultTableOptions?.(table))\n }, {}) as TableOptions<TFeatures, TData>\n\n const mergedOptions = { ...defaultOptions, ...tableOptions }\n\n if (_reactivity.createOptionsStore) {\n // @ts-ignore - direct set\n table.optionsStore = _reactivity.createWritableAtom<\n TableOptions<TFeatures, TData>\n >(mergedOptions, { debugName: 'table/optionsStore' })\n Object.defineProperty(table, 'options', {\n configurable: true,\n enumerable: true,\n get() {\n return table.optionsStore!.get()\n },\n set(value) {\n table.optionsStore!.set(() => value) // or your real update shape\n },\n })\n } else {\n table.options = mergedOptions\n }\n\n table.initialState = getInitialTableState(\n table._features,\n table.options.initialState,\n )\n\n const stateKeys = Object.keys(table.initialState) as Array<\n string & keyof TableState<TFeatures>\n >\n\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n // create writable base atom\n table.baseAtoms[key] = _reactivity.createWritableAtom(\n table.initialState[key],\n {\n debugName: `table/baseAtoms/${key}`,\n },\n ) as any\n\n // create readonly derived atom: on each get(), read either external atom or base atom\n ;(table.atoms as any)[key] = _reactivity.createReadonlyAtom(\n () => {\n const externalAtom = table.options.atoms?.[key]\n if (externalAtom) {\n return externalAtom.get()\n }\n return table.baseAtoms[key].get()\n },\n { debugName: `table/atoms/${key}` },\n )\n }\n\n table_syncExternalStateToBaseAtoms(table)\n\n table.store = atomToStore(\n _reactivity.createReadonlyAtom(\n () => {\n const snapshot = {} as TableState<TFeatures>\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n snapshot[key] = table.atoms[key].get()\n }\n return snapshot\n },\n { debugName: 'table/store' },\n ),\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n (tableOptions.debugAll || tableOptions.debugTable)\n ) {\n const features = Object.keys(table._features)\n const rowModels = Object.keys(table.options._rowModels || {})\n const states = Object.keys(table.initialState)\n\n console.log(\n `Constructing Table Instance\n\n Features: ${features.join('\\n ')}\n\n Row Models: ${rowModels.length ? rowModels.join('\\n ') : '(none)'}\n\n States: ${states.join('\\n ')}\\n`,\n { table },\n )\n }\n\n for (let i = 0; i < featuresList.length; i++) {\n featuresList[i]!.constructTableAPIs?.(table)\n }\n\n return table\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,qBACd,UACA,eAA2D,EAAE,EACtC;CACvB,OAAO,OAAO,SAAS,CAAC,SAAS,YAAY;;EAC3C,yCAAe,QAAQ,6GAAkB,aAAa,KAAI;GAC1D;CACF,OAAOA,yBAAW,aAAa;;;;;;;AAQjC,SAAgB,eAGd,cAAuE;CACvE,MAAM,cAAc,aAAa,UAAU;CAE3C,MAAM,QAAQ;EACZ;EACA,WAAW;GAAE,GAAGC;GAAc,GAAG,aAAa;GAAW;EACzD,YAAY,EAAE;EACd,cAAc,EAAE;EAChB,WAAW,EAAE;EACb,OAAO,EAAE;EACV;CAED,MAAM,eAAwC,OAAO,OAAO,MAAM,UAAU;CAM5E,MAAM,gBAAgB;EAAE,GAJD,aAAa,QAAQ,KAAK,YAAY;;GAC3D,OAAO,OAAO,OAAO,8BAAK,QAAQ,oHAAyB,MAAM,CAAC;KACjE,EAAE,CAEoC;EAAE,GAAG;EAAc;CAE5D,IAAI,YAAY,oBAAoB;EAElC,MAAM,eAAe,YAAY,mBAE/B,eAAe,EAAE,WAAW,sBAAsB,CAAC;EACrD,OAAO,eAAe,OAAO,WAAW;GACtC,cAAc;GACd,YAAY;GACZ,MAAM;IACJ,OAAO,MAAM,aAAc,KAAK;;GAElC,IAAI,OAAO;IACT,MAAM,aAAc,UAAU,MAAM;;GAEvC,CAAC;QAEF,MAAM,UAAU;CAGlB,MAAM,eAAe,qBACnB,MAAM,WACN,MAAM,QAAQ,aACf;CAED,MAAM,YAAY,OAAO,KAAK,MAAM,aAAa;CAIjD,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;EACzC,MAAM,MAAM,UAAU;EAEtB,MAAM,UAAU,OAAO,YAAY,mBACjC,MAAM,aAAa,MACnB,EACE,WAAW,mBAAmB,OAC/B,CACF;EAGA,AAAC,MAAM,MAAc,OAAO,YAAY,yBACjC;;GACJ,MAAM,uCAAe,MAAM,QAAQ,mFAAQ;GAC3C,IAAI,cACF,OAAO,aAAa,KAAK;GAE3B,OAAO,MAAM,UAAU,KAAK,KAAK;KAEnC,EAAE,WAAW,eAAe,OAAO,CACpC;;CAGH,mEAAmC,MAAM;CAEzC,MAAM,QAAQC,gDACZ,YAAY,yBACJ;EACJ,MAAM,WAAW,EAAE;EACnB,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;GACzC,MAAM,MAAM,UAAU;GACtB,SAAS,OAAO,MAAM,MAAM,KAAK,KAAK;;EAExC,OAAO;IAET,EAAE,WAAW,eAAe,CAC7B,CACF;CAED,IACE,QAAQ,IAAI,aAAa,kBACxB,aAAa,YAAY,aAAa,aACvC;EACA,MAAM,WAAW,OAAO,KAAK,MAAM,UAAU;EAC7C,MAAM,YAAY,OAAO,KAAK,MAAM,QAAQ,cAAc,EAAE,CAAC;EAC7D,MAAM,SAAS,OAAO,KAAK,MAAM,aAAa;EAE9C,QAAQ,IACN;;gBAEU,SAAS,KAAK,mBAAmB,CAAC;;gBAElC,UAAU,SAAS,UAAU,KAAK,mBAAmB,GAAG,SAAS;;gBAEjE,OAAO,KAAK,mBAAmB,CAAC,KAC1C,EAAE,OAAO,CACV;;CAGH,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;;EAC5C,4CAAa,IAAI,iGAAqB,MAAM;;CAG9C,OAAO"}
@@ -57,7 +57,8 @@ function constructTable(tableOptions) {
57
57
  } else table.options = mergedOptions;
58
58
  table.initialState = getInitialTableState(table._features, table.options.initialState);
59
59
  const stateKeys = Object.keys(table.initialState);
60
- for (const key of stateKeys) {
60
+ for (let i = 0; i < stateKeys.length; i++) {
61
+ const key = stateKeys[i];
61
62
  table.baseAtoms[key] = _reactivity.createWritableAtom(table.initialState[key], { debugName: `table/baseAtoms/${key}` });
62
63
  table.atoms[key] = _reactivity.createReadonlyAtom(() => {
63
64
  var _table$options$atoms;
@@ -69,7 +70,10 @@ function constructTable(tableOptions) {
69
70
  table_syncExternalStateToBaseAtoms(table);
70
71
  table.store = atomToStore(_reactivity.createReadonlyAtom(() => {
71
72
  const snapshot = {};
72
- for (const key of stateKeys) snapshot[key] = table.atoms[key].get();
73
+ for (let i = 0; i < stateKeys.length; i++) {
74
+ const key = stateKeys[i];
75
+ snapshot[key] = table.atoms[key].get();
76
+ }
73
77
  return snapshot;
74
78
  }, { debugName: "table/store" }));
75
79
  if (process.env.NODE_ENV === "development" && (tableOptions.debugAll || tableOptions.debugTable)) {
@@ -84,9 +88,9 @@ function constructTable(tableOptions) {
84
88
 
85
89
  States: ${states.join("\n ")}\n`, { table });
86
90
  }
87
- for (const feature of featuresList) {
88
- var _feature$constructTab;
89
- (_feature$constructTab = feature.constructTableAPIs) === null || _feature$constructTab === void 0 || _feature$constructTab.call(feature, table);
91
+ for (let i = 0; i < featuresList.length; i++) {
92
+ var _constructTableAPIs, _ref;
93
+ (_constructTableAPIs = (_ref = featuresList[i]).constructTableAPIs) === null || _constructTableAPIs === void 0 || _constructTableAPIs.call(_ref, table);
90
94
  }
91
95
  return table;
92
96
  }
@@ -1 +1 @@
1
- {"version":3,"file":"constructTable.js","names":[],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState } from '../../types/TableState'\n\n/**\n * Builds the initial table state from registered features and user initial state.\n *\n * Each feature contributes its default state before user-provided `initialState` values are merged in.\n */\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\n/**\n * Constructs a table instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions._features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions._features },\n _rowModels: {},\n _rowModelFns: {},\n baseAtoms: {},\n atoms: {},\n } as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature<{}>> = Object.values(table._features)\n\n const defaultOptions = featuresList.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultTableOptions?.(table))\n }, {}) as TableOptions<TFeatures, TData>\n\n const mergedOptions = { ...defaultOptions, ...tableOptions }\n\n if (_reactivity.createOptionsStore) {\n // @ts-ignore - direct set\n table.optionsStore = _reactivity.createWritableAtom<\n TableOptions<TFeatures, TData>\n >(mergedOptions, { debugName: 'table/optionsStore' })\n Object.defineProperty(table, 'options', {\n configurable: true,\n enumerable: true,\n get() {\n return table.optionsStore!.get()\n },\n set(value) {\n table.optionsStore!.set(() => value) // or your real update shape\n },\n })\n } else {\n table.options = mergedOptions\n }\n\n table.initialState = getInitialTableState(\n table._features,\n table.options.initialState,\n )\n\n const stateKeys = Object.keys(table.initialState) as Array<\n string & keyof TableState<TFeatures>\n >\n\n for (const key of stateKeys) {\n // create writable base atom\n table.baseAtoms[key] = _reactivity.createWritableAtom(\n table.initialState[key],\n {\n debugName: `table/baseAtoms/${key}`,\n },\n ) as any\n\n // create readonly derived atom: on each get(), read either external atom or base atom\n ;(table.atoms as any)[key] = _reactivity.createReadonlyAtom(\n () => {\n const externalAtom = table.options.atoms?.[key]\n if (externalAtom) {\n return externalAtom.get()\n }\n return table.baseAtoms[key].get()\n },\n { debugName: `table/atoms/${key}` },\n )\n }\n\n table_syncExternalStateToBaseAtoms(table)\n\n table.store = atomToStore(\n _reactivity.createReadonlyAtom(\n () => {\n const snapshot = {} as TableState<TFeatures>\n for (const key of stateKeys) {\n snapshot[key] = table.atoms[key].get()\n }\n return snapshot\n },\n { debugName: 'table/store' },\n ),\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n (tableOptions.debugAll || tableOptions.debugTable)\n ) {\n const features = Object.keys(table._features)\n const rowModels = Object.keys(table.options._rowModels || {})\n const states = Object.keys(table.initialState)\n\n console.log(\n `Constructing Table Instance\n\n Features: ${features.join('\\n ')}\n\n Row Models: ${rowModels.length ? rowModels.join('\\n ') : '(none)'}\n\n States: ${states.join('\\n ')}\\n`,\n { table },\n )\n }\n\n for (const feature of featuresList) {\n feature.constructTableAPIs?.(table)\n }\n\n return table\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,qBACd,UACA,eAA2D,EAAE,EACtC;CACvB,OAAO,OAAO,SAAS,CAAC,SAAS,YAAY;;EAC3C,yCAAe,QAAQ,6GAAkB,aAAa,KAAI;GAC1D;CACF,OAAO,WAAW,aAAa;;;;;;;AAQjC,SAAgB,eAGd,cAAuE;CACvE,MAAM,cAAc,aAAa,UAAU;CAE3C,MAAM,QAAQ;EACZ;EACA,WAAW;GAAE,GAAG;GAAc,GAAG,aAAa;GAAW;EACzD,YAAY,EAAE;EACd,cAAc,EAAE;EAChB,WAAW,EAAE;EACb,OAAO,EAAE;EACV;CAED,MAAM,eAAwC,OAAO,OAAO,MAAM,UAAU;CAM5E,MAAM,gBAAgB;EAAE,GAJD,aAAa,QAAQ,KAAK,YAAY;;GAC3D,OAAO,OAAO,OAAO,8BAAK,QAAQ,oHAAyB,MAAM,CAAC;KACjE,EAAE,CAEoC;EAAE,GAAG;EAAc;CAE5D,IAAI,YAAY,oBAAoB;EAElC,MAAM,eAAe,YAAY,mBAE/B,eAAe,EAAE,WAAW,sBAAsB,CAAC;EACrD,OAAO,eAAe,OAAO,WAAW;GACtC,cAAc;GACd,YAAY;GACZ,MAAM;IACJ,OAAO,MAAM,aAAc,KAAK;;GAElC,IAAI,OAAO;IACT,MAAM,aAAc,UAAU,MAAM;;GAEvC,CAAC;QAEF,MAAM,UAAU;CAGlB,MAAM,eAAe,qBACnB,MAAM,WACN,MAAM,QAAQ,aACf;CAED,MAAM,YAAY,OAAO,KAAK,MAAM,aAAa;CAIjD,KAAK,MAAM,OAAO,WAAW;EAE3B,MAAM,UAAU,OAAO,YAAY,mBACjC,MAAM,aAAa,MACnB,EACE,WAAW,mBAAmB,OAC/B,CACF;EAGA,AAAC,MAAM,MAAc,OAAO,YAAY,yBACjC;;GACJ,MAAM,uCAAe,MAAM,QAAQ,mFAAQ;GAC3C,IAAI,cACF,OAAO,aAAa,KAAK;GAE3B,OAAO,MAAM,UAAU,KAAK,KAAK;KAEnC,EAAE,WAAW,eAAe,OAAO,CACpC;;CAGH,mCAAmC,MAAM;CAEzC,MAAM,QAAQ,YACZ,YAAY,yBACJ;EACJ,MAAM,WAAW,EAAE;EACnB,KAAK,MAAM,OAAO,WAChB,SAAS,OAAO,MAAM,MAAM,KAAK,KAAK;EAExC,OAAO;IAET,EAAE,WAAW,eAAe,CAC7B,CACF;CAED,IACE,QAAQ,IAAI,aAAa,kBACxB,aAAa,YAAY,aAAa,aACvC;EACA,MAAM,WAAW,OAAO,KAAK,MAAM,UAAU;EAC7C,MAAM,YAAY,OAAO,KAAK,MAAM,QAAQ,cAAc,EAAE,CAAC;EAC7D,MAAM,SAAS,OAAO,KAAK,MAAM,aAAa;EAE9C,QAAQ,IACN;;gBAEU,SAAS,KAAK,mBAAmB,CAAC;;gBAElC,UAAU,SAAS,UAAU,KAAK,mBAAmB,GAAG,SAAS;;gBAEjE,OAAO,KAAK,mBAAmB,CAAC,KAC1C,EAAE,OAAO,CACV;;CAGH,KAAK,MAAM,WAAW,cAAc;;EAClC,iCAAQ,wGAAqB,MAAM;;CAGrC,OAAO"}
1
+ {"version":3,"file":"constructTable.js","names":[],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState } from '../../types/TableState'\n\n/**\n * Builds the initial table state from registered features and user initial state.\n *\n * Each feature contributes its default state before user-provided `initialState` values are merged in.\n */\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\n/**\n * Constructs a table instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions._features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions._features },\n _rowModels: {},\n _rowModelFns: {},\n baseAtoms: {},\n atoms: {},\n } as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature<{}>> = Object.values(table._features)\n\n const defaultOptions = featuresList.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultTableOptions?.(table))\n }, {}) as TableOptions<TFeatures, TData>\n\n const mergedOptions = { ...defaultOptions, ...tableOptions }\n\n if (_reactivity.createOptionsStore) {\n // @ts-ignore - direct set\n table.optionsStore = _reactivity.createWritableAtom<\n TableOptions<TFeatures, TData>\n >(mergedOptions, { debugName: 'table/optionsStore' })\n Object.defineProperty(table, 'options', {\n configurable: true,\n enumerable: true,\n get() {\n return table.optionsStore!.get()\n },\n set(value) {\n table.optionsStore!.set(() => value) // or your real update shape\n },\n })\n } else {\n table.options = mergedOptions\n }\n\n table.initialState = getInitialTableState(\n table._features,\n table.options.initialState,\n )\n\n const stateKeys = Object.keys(table.initialState) as Array<\n string & keyof TableState<TFeatures>\n >\n\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n // create writable base atom\n table.baseAtoms[key] = _reactivity.createWritableAtom(\n table.initialState[key],\n {\n debugName: `table/baseAtoms/${key}`,\n },\n ) as any\n\n // create readonly derived atom: on each get(), read either external atom or base atom\n ;(table.atoms as any)[key] = _reactivity.createReadonlyAtom(\n () => {\n const externalAtom = table.options.atoms?.[key]\n if (externalAtom) {\n return externalAtom.get()\n }\n return table.baseAtoms[key].get()\n },\n { debugName: `table/atoms/${key}` },\n )\n }\n\n table_syncExternalStateToBaseAtoms(table)\n\n table.store = atomToStore(\n _reactivity.createReadonlyAtom(\n () => {\n const snapshot = {} as TableState<TFeatures>\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n snapshot[key] = table.atoms[key].get()\n }\n return snapshot\n },\n { debugName: 'table/store' },\n ),\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n (tableOptions.debugAll || tableOptions.debugTable)\n ) {\n const features = Object.keys(table._features)\n const rowModels = Object.keys(table.options._rowModels || {})\n const states = Object.keys(table.initialState)\n\n console.log(\n `Constructing Table Instance\n\n Features: ${features.join('\\n ')}\n\n Row Models: ${rowModels.length ? rowModels.join('\\n ') : '(none)'}\n\n States: ${states.join('\\n ')}\\n`,\n { table },\n )\n }\n\n for (let i = 0; i < featuresList.length; i++) {\n featuresList[i]!.constructTableAPIs?.(table)\n }\n\n return table\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,qBACd,UACA,eAA2D,EAAE,EACtC;CACvB,OAAO,OAAO,SAAS,CAAC,SAAS,YAAY;;EAC3C,yCAAe,QAAQ,6GAAkB,aAAa,KAAI;GAC1D;CACF,OAAO,WAAW,aAAa;;;;;;;AAQjC,SAAgB,eAGd,cAAuE;CACvE,MAAM,cAAc,aAAa,UAAU;CAE3C,MAAM,QAAQ;EACZ;EACA,WAAW;GAAE,GAAG;GAAc,GAAG,aAAa;GAAW;EACzD,YAAY,EAAE;EACd,cAAc,EAAE;EAChB,WAAW,EAAE;EACb,OAAO,EAAE;EACV;CAED,MAAM,eAAwC,OAAO,OAAO,MAAM,UAAU;CAM5E,MAAM,gBAAgB;EAAE,GAJD,aAAa,QAAQ,KAAK,YAAY;;GAC3D,OAAO,OAAO,OAAO,8BAAK,QAAQ,oHAAyB,MAAM,CAAC;KACjE,EAAE,CAEoC;EAAE,GAAG;EAAc;CAE5D,IAAI,YAAY,oBAAoB;EAElC,MAAM,eAAe,YAAY,mBAE/B,eAAe,EAAE,WAAW,sBAAsB,CAAC;EACrD,OAAO,eAAe,OAAO,WAAW;GACtC,cAAc;GACd,YAAY;GACZ,MAAM;IACJ,OAAO,MAAM,aAAc,KAAK;;GAElC,IAAI,OAAO;IACT,MAAM,aAAc,UAAU,MAAM;;GAEvC,CAAC;QAEF,MAAM,UAAU;CAGlB,MAAM,eAAe,qBACnB,MAAM,WACN,MAAM,QAAQ,aACf;CAED,MAAM,YAAY,OAAO,KAAK,MAAM,aAAa;CAIjD,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;EACzC,MAAM,MAAM,UAAU;EAEtB,MAAM,UAAU,OAAO,YAAY,mBACjC,MAAM,aAAa,MACnB,EACE,WAAW,mBAAmB,OAC/B,CACF;EAGA,AAAC,MAAM,MAAc,OAAO,YAAY,yBACjC;;GACJ,MAAM,uCAAe,MAAM,QAAQ,mFAAQ;GAC3C,IAAI,cACF,OAAO,aAAa,KAAK;GAE3B,OAAO,MAAM,UAAU,KAAK,KAAK;KAEnC,EAAE,WAAW,eAAe,OAAO,CACpC;;CAGH,mCAAmC,MAAM;CAEzC,MAAM,QAAQ,YACZ,YAAY,yBACJ;EACJ,MAAM,WAAW,EAAE;EACnB,KAAK,IAAI,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;GACzC,MAAM,MAAM,UAAU;GACtB,SAAS,OAAO,MAAM,MAAM,KAAK,KAAK;;EAExC,OAAO;IAET,EAAE,WAAW,eAAe,CAC7B,CACF;CAED,IACE,QAAQ,IAAI,aAAa,kBACxB,aAAa,YAAY,aAAa,aACvC;EACA,MAAM,WAAW,OAAO,KAAK,MAAM,UAAU;EAC7C,MAAM,YAAY,OAAO,KAAK,MAAM,QAAQ,cAAc,EAAE,CAAC;EAC7D,MAAM,SAAS,OAAO,KAAK,MAAM,aAAa;EAE9C,QAAQ,IACN;;gBAEU,SAAS,KAAK,mBAAmB,CAAC;;gBAElC,UAAU,SAAS,UAAU,KAAK,mBAAmB,GAAG,SAAS;;gBAEjE,OAAO,KAAK,mBAAmB,CAAC,KAC1C,EAAE,OAAO,CACV;;CAGH,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;;EAC5C,4CAAa,IAAI,iGAAqB,MAAM;;CAG9C,OAAO"}
@@ -44,11 +44,15 @@ type Atoms_All = { [K in keyof TableState_All]?: ReadonlyAtom<TableState_All[K]>
44
44
  type ExternalAtoms_All = Partial<{ [K in keyof TableState_All]: Atom<TableState_All[K]> }>;
45
45
  interface TableOptions_Table<TFeatures extends TableFeatures, TData extends RowData> {
46
46
  /**
47
- * The features that you want to enable for the table.
47
+ * The feature modules registered on this table instance.
48
+ *
49
+ * Feature registration controls which state slices, options, and prototype
50
+ * APIs are available.
48
51
  */
49
52
  readonly _features: TFeatures;
50
53
  /**
51
- * The row model options that you want to enable for the table.
54
+ * Row model factories used by features such as filtering, grouping, sorting,
55
+ * expansion, and pagination.
52
56
  */
53
57
  readonly _rowModels?: CreateRowModels_All<TFeatures, TData>;
54
58
  /**
@@ -44,11 +44,15 @@ type Atoms_All = { [K in keyof TableState_All]?: ReadonlyAtom<TableState_All[K]>
44
44
  type ExternalAtoms_All = Partial<{ [K in keyof TableState_All]: Atom<TableState_All[K]> }>;
45
45
  interface TableOptions_Table<TFeatures extends TableFeatures, TData extends RowData> {
46
46
  /**
47
- * The features that you want to enable for the table.
47
+ * The feature modules registered on this table instance.
48
+ *
49
+ * Feature registration controls which state slices, options, and prototype
50
+ * APIs are available.
48
51
  */
49
52
  readonly _features: TFeatures;
50
53
  /**
51
- * The row model options that you want to enable for the table.
54
+ * Row model factories used by features such as filtering, grouping, sorting,
55
+ * expansion, and pagination.
52
56
  */
53
57
  readonly _rowModels?: CreateRowModels_All<TFeatures, TData>;
54
58
  /**
@@ -9,7 +9,7 @@ const require_utils = require('../../utils.cjs');
9
9
  *
10
10
  * @example
11
11
  * ```ts
12
- * const value = table_syncExternalStateToBaseAtoms(table)
12
+ * table_syncExternalStateToBaseAtoms(table)
13
13
  * ```
14
14
  */
15
15
  function table_syncExternalStateToBaseAtoms(table) {
@@ -38,7 +38,11 @@ function table_syncExternalStateToBaseAtoms(table) {
38
38
  function table_reset(table) {
39
39
  const snap = require_utils.cloneState(table.initialState);
40
40
  table._reactivity.batch(() => {
41
- for (const key of Object.keys(snap)) table.baseAtoms[key].set(snap[key]);
41
+ const keys = Object.keys(snap);
42
+ for (let i = 0; i < keys.length; i++) {
43
+ const key = keys[i];
44
+ table.baseAtoms[key].set(snap[key]);
45
+ }
42
46
  });
43
47
  }
44
48
  /**
@@ -49,7 +53,7 @@ function table_reset(table) {
49
53
  *
50
54
  * @example
51
55
  * ```ts
52
- * const value = table_mergeOptions(table)
56
+ * const options = table_mergeOptions(table, nextOptions)
53
57
  * ```
54
58
  */
55
59
  function table_mergeOptions(table, newOptions) {
@@ -1 +1 @@
1
- {"version":3,"file":"coreTablesFeature.utils.cjs","names":["cloneState","functionalUpdate"],"sources":["../../../src/core/table/coreTablesFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\n\n/**\n * Synchronizes externally controlled state slices into the table's base atoms.\n *\n * This keeps legacy `options.state` values reflected in the atom graph so\n * derived atoms, stores, and table APIs read a consistent snapshot.\n *\n * @example\n * ```ts\n * const value = table_syncExternalStateToBaseAtoms(table)\n * ```\n */\nexport function table_syncExternalStateToBaseAtoms<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const state = table.options.state\n if (!state) {\n return\n }\n\n table._reactivity.batch(() => {\n for (const key in state) {\n const baseAtom = (table.baseAtoms as Record<string, any>)[key]\n if (!baseAtom) {\n continue\n }\n\n const externalState = state[key as keyof typeof state]\n if (externalState !== baseAtom.get()) {\n baseAtom.set(() => externalState)\n }\n }\n })\n}\n\n/**\n * Resets all internal table base atoms to `table.initialState`.\n *\n * This resets internally owned state slices in a single reactivity batch. Use\n * feature-specific reset APIs when a slice may be externally owned.\n *\n * @example\n * ```ts\n * table_reset(table)\n * ```\n */\nexport function table_reset<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const snap = cloneState(table.initialState)\n table._reactivity.batch(() => {\n for (const key of Object.keys(snap) as Array<keyof typeof snap>) {\n ;(table.baseAtoms as any)[key].set(snap[key] as any)\n }\n })\n}\n\n/**\n * Merges new table options with the current resolved options.\n *\n * If `options.mergeOptions` is provided, it owns the merge behavior; otherwise\n * options are shallow-merged.\n *\n * @example\n * ```ts\n * const value = table_mergeOptions(table)\n * ```\n */\nexport function table_mergeOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n newOptions: TableOptions<TFeatures, TData>,\n) {\n if (table.options.mergeOptions) {\n return table.options.mergeOptions(table.options, newOptions)\n }\n\n return {\n ...table.options,\n ...newOptions,\n }\n}\n\n/**\n * Updates the table options object.\n *\n * The updater receives the current resolved options and the merged result is\n * immediately assigned to the table instance.\n *\n * @example\n * ```ts\n * table_setOptions(table, (old) => old)\n * ```\n */\nexport function table_setOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<TableOptions<TFeatures, TData>>,\n): void {\n const newOptions = functionalUpdate(updater, table.options)\n const mergedOptions = table_mergeOptions(table, newOptions)\n if (table.optionsStore) {\n table.optionsStore.set(() => mergedOptions)\n } else {\n table.options = mergedOptions\n }\n table_syncExternalStateToBaseAtoms(table)\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,mCAGd,OAA+C;CAC/C,MAAM,QAAQ,MAAM,QAAQ;CAC5B,IAAI,CAAC,OACH;CAGF,MAAM,YAAY,YAAY;EAC5B,KAAK,MAAM,OAAO,OAAO;GACvB,MAAM,WAAY,MAAM,UAAkC;GAC1D,IAAI,CAAC,UACH;GAGF,MAAM,gBAAgB,MAAM;GAC5B,IAAI,kBAAkB,SAAS,KAAK,EAClC,SAAS,UAAU,cAAc;;GAGrC;;;;;;;;;;;;;AAcJ,SAAgB,YAGd,OAA+C;CAC/C,MAAM,OAAOA,yBAAW,MAAM,aAAa;CAC3C,MAAM,YAAY,YAAY;EAC5B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,EAChC,AAAC,MAAM,UAAkB,KAAK,IAAI,KAAK,KAAY;GAEtD;;;;;;;;;;;;;AAcJ,SAAgB,mBAId,OACA,YACA;CACA,IAAI,MAAM,QAAQ,cAChB,OAAO,MAAM,QAAQ,aAAa,MAAM,SAAS,WAAW;CAG9D,OAAO;EACL,GAAG,MAAM;EACT,GAAG;EACJ;;;;;;;;;;;;;AAcH,SAAgB,iBAId,OACA,SACM;CAEN,MAAM,gBAAgB,mBAAmB,OADtBC,+BAAiB,SAAS,MAAM,QACO,CAAC;CAC3D,IAAI,MAAM,cACR,MAAM,aAAa,UAAU,cAAc;MAE3C,MAAM,UAAU;CAElB,mCAAmC,MAAM"}
1
+ {"version":3,"file":"coreTablesFeature.utils.cjs","names":["cloneState","functionalUpdate"],"sources":["../../../src/core/table/coreTablesFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\n\n/**\n * Synchronizes externally controlled state slices into the table's base atoms.\n *\n * This keeps legacy `options.state` values reflected in the atom graph so\n * derived atoms, stores, and table APIs read a consistent snapshot.\n *\n * @example\n * ```ts\n * table_syncExternalStateToBaseAtoms(table)\n * ```\n */\nexport function table_syncExternalStateToBaseAtoms<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const state = table.options.state\n if (!state) {\n return\n }\n\n table._reactivity.batch(() => {\n for (const key in state) {\n const baseAtom = (table.baseAtoms as Record<string, any>)[key]\n if (!baseAtom) {\n continue\n }\n\n const externalState = state[key as keyof typeof state]\n if (externalState !== baseAtom.get()) {\n baseAtom.set(() => externalState)\n }\n }\n })\n}\n\n/**\n * Resets all internal table base atoms to `table.initialState`.\n *\n * This resets internally owned state slices in a single reactivity batch. Use\n * feature-specific reset APIs when a slice may be externally owned.\n *\n * @example\n * ```ts\n * table_reset(table)\n * ```\n */\nexport function table_reset<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const snap = cloneState(table.initialState)\n table._reactivity.batch(() => {\n const keys = Object.keys(snap) as Array<keyof typeof snap>\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]!\n ;(table.baseAtoms as any)[key].set(snap[key] as any)\n }\n })\n}\n\n/**\n * Merges new table options with the current resolved options.\n *\n * If `options.mergeOptions` is provided, it owns the merge behavior; otherwise\n * options are shallow-merged.\n *\n * @example\n * ```ts\n * const options = table_mergeOptions(table, nextOptions)\n * ```\n */\nexport function table_mergeOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n newOptions: TableOptions<TFeatures, TData>,\n) {\n if (table.options.mergeOptions) {\n return table.options.mergeOptions(table.options, newOptions)\n }\n\n return {\n ...table.options,\n ...newOptions,\n }\n}\n\n/**\n * Updates the table options object.\n *\n * The updater receives the current resolved options and the merged result is\n * immediately assigned to the table instance.\n *\n * @example\n * ```ts\n * table_setOptions(table, (old) => old)\n * ```\n */\nexport function table_setOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<TableOptions<TFeatures, TData>>,\n): void {\n const newOptions = functionalUpdate(updater, table.options)\n const mergedOptions = table_mergeOptions(table, newOptions)\n if (table.optionsStore) {\n table.optionsStore.set(() => mergedOptions)\n } else {\n table.options = mergedOptions\n }\n table_syncExternalStateToBaseAtoms(table)\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,mCAGd,OAA+C;CAC/C,MAAM,QAAQ,MAAM,QAAQ;CAC5B,IAAI,CAAC,OACH;CAGF,MAAM,YAAY,YAAY;EAC5B,KAAK,MAAM,OAAO,OAAO;GACvB,MAAM,WAAY,MAAM,UAAkC;GAC1D,IAAI,CAAC,UACH;GAGF,MAAM,gBAAgB,MAAM;GAC5B,IAAI,kBAAkB,SAAS,KAAK,EAClC,SAAS,UAAU,cAAc;;GAGrC;;;;;;;;;;;;;AAcJ,SAAgB,YAGd,OAA+C;CAC/C,MAAM,OAAOA,yBAAW,MAAM,aAAa;CAC3C,MAAM,YAAY,YAAY;EAC5B,MAAM,OAAO,OAAO,KAAK,KAAK;EAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;GACpC,MAAM,MAAM,KAAK;GAChB,AAAC,MAAM,UAAkB,KAAK,IAAI,KAAK,KAAY;;GAEtD;;;;;;;;;;;;;AAcJ,SAAgB,mBAId,OACA,YACA;CACA,IAAI,MAAM,QAAQ,cAChB,OAAO,MAAM,QAAQ,aAAa,MAAM,SAAS,WAAW;CAG9D,OAAO;EACL,GAAG,MAAM;EACT,GAAG;EACJ;;;;;;;;;;;;;AAcH,SAAgB,iBAId,OACA,SACM;CAEN,MAAM,gBAAgB,mBAAmB,OADtBC,+BAAiB,SAAS,MAAM,QACO,CAAC;CAC3D,IAAI,MAAM,cACR,MAAM,aAAa,UAAU,cAAc;MAE3C,MAAM,UAAU;CAElB,mCAAmC,MAAM"}
@@ -12,7 +12,7 @@ import { Table_Internal } from "../../types/Table.cjs";
12
12
  *
13
13
  * @example
14
14
  * ```ts
15
- * const value = table_syncExternalStateToBaseAtoms(table)
15
+ * table_syncExternalStateToBaseAtoms(table)
16
16
  * ```
17
17
  */
18
18
  declare function table_syncExternalStateToBaseAtoms<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): void;
@@ -36,7 +36,7 @@ declare function table_reset<TFeatures extends TableFeatures, TData extends RowD
36
36
  *
37
37
  * @example
38
38
  * ```ts
39
- * const value = table_mergeOptions(table)
39
+ * const options = table_mergeOptions(table, nextOptions)
40
40
  * ```
41
41
  */
42
42
  declare function table_mergeOptions<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, newOptions: TableOptions<TFeatures, TData>): TableOptions<TFeatures, TData>;
@@ -12,7 +12,7 @@ import { Table_Internal } from "../../types/Table.js";
12
12
  *
13
13
  * @example
14
14
  * ```ts
15
- * const value = table_syncExternalStateToBaseAtoms(table)
15
+ * table_syncExternalStateToBaseAtoms(table)
16
16
  * ```
17
17
  */
18
18
  declare function table_syncExternalStateToBaseAtoms<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): void;
@@ -36,7 +36,7 @@ declare function table_reset<TFeatures extends TableFeatures, TData extends RowD
36
36
  *
37
37
  * @example
38
38
  * ```ts
39
- * const value = table_mergeOptions(table)
39
+ * const options = table_mergeOptions(table, nextOptions)
40
40
  * ```
41
41
  */
42
42
  declare function table_mergeOptions<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, newOptions: TableOptions<TFeatures, TData>): TableOptions<TFeatures, TData>;
@@ -9,7 +9,7 @@ import { cloneState, functionalUpdate } from "../../utils.js";
9
9
  *
10
10
  * @example
11
11
  * ```ts
12
- * const value = table_syncExternalStateToBaseAtoms(table)
12
+ * table_syncExternalStateToBaseAtoms(table)
13
13
  * ```
14
14
  */
15
15
  function table_syncExternalStateToBaseAtoms(table) {
@@ -38,7 +38,11 @@ function table_syncExternalStateToBaseAtoms(table) {
38
38
  function table_reset(table) {
39
39
  const snap = cloneState(table.initialState);
40
40
  table._reactivity.batch(() => {
41
- for (const key of Object.keys(snap)) table.baseAtoms[key].set(snap[key]);
41
+ const keys = Object.keys(snap);
42
+ for (let i = 0; i < keys.length; i++) {
43
+ const key = keys[i];
44
+ table.baseAtoms[key].set(snap[key]);
45
+ }
42
46
  });
43
47
  }
44
48
  /**
@@ -49,7 +53,7 @@ function table_reset(table) {
49
53
  *
50
54
  * @example
51
55
  * ```ts
52
- * const value = table_mergeOptions(table)
56
+ * const options = table_mergeOptions(table, nextOptions)
53
57
  * ```
54
58
  */
55
59
  function table_mergeOptions(table, newOptions) {
@@ -1 +1 @@
1
- {"version":3,"file":"coreTablesFeature.utils.js","names":[],"sources":["../../../src/core/table/coreTablesFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\n\n/**\n * Synchronizes externally controlled state slices into the table's base atoms.\n *\n * This keeps legacy `options.state` values reflected in the atom graph so\n * derived atoms, stores, and table APIs read a consistent snapshot.\n *\n * @example\n * ```ts\n * const value = table_syncExternalStateToBaseAtoms(table)\n * ```\n */\nexport function table_syncExternalStateToBaseAtoms<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const state = table.options.state\n if (!state) {\n return\n }\n\n table._reactivity.batch(() => {\n for (const key in state) {\n const baseAtom = (table.baseAtoms as Record<string, any>)[key]\n if (!baseAtom) {\n continue\n }\n\n const externalState = state[key as keyof typeof state]\n if (externalState !== baseAtom.get()) {\n baseAtom.set(() => externalState)\n }\n }\n })\n}\n\n/**\n * Resets all internal table base atoms to `table.initialState`.\n *\n * This resets internally owned state slices in a single reactivity batch. Use\n * feature-specific reset APIs when a slice may be externally owned.\n *\n * @example\n * ```ts\n * table_reset(table)\n * ```\n */\nexport function table_reset<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const snap = cloneState(table.initialState)\n table._reactivity.batch(() => {\n for (const key of Object.keys(snap) as Array<keyof typeof snap>) {\n ;(table.baseAtoms as any)[key].set(snap[key] as any)\n }\n })\n}\n\n/**\n * Merges new table options with the current resolved options.\n *\n * If `options.mergeOptions` is provided, it owns the merge behavior; otherwise\n * options are shallow-merged.\n *\n * @example\n * ```ts\n * const value = table_mergeOptions(table)\n * ```\n */\nexport function table_mergeOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n newOptions: TableOptions<TFeatures, TData>,\n) {\n if (table.options.mergeOptions) {\n return table.options.mergeOptions(table.options, newOptions)\n }\n\n return {\n ...table.options,\n ...newOptions,\n }\n}\n\n/**\n * Updates the table options object.\n *\n * The updater receives the current resolved options and the merged result is\n * immediately assigned to the table instance.\n *\n * @example\n * ```ts\n * table_setOptions(table, (old) => old)\n * ```\n */\nexport function table_setOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<TableOptions<TFeatures, TData>>,\n): void {\n const newOptions = functionalUpdate(updater, table.options)\n const mergedOptions = table_mergeOptions(table, newOptions)\n if (table.optionsStore) {\n table.optionsStore.set(() => mergedOptions)\n } else {\n table.options = mergedOptions\n }\n table_syncExternalStateToBaseAtoms(table)\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,mCAGd,OAA+C;CAC/C,MAAM,QAAQ,MAAM,QAAQ;CAC5B,IAAI,CAAC,OACH;CAGF,MAAM,YAAY,YAAY;EAC5B,KAAK,MAAM,OAAO,OAAO;GACvB,MAAM,WAAY,MAAM,UAAkC;GAC1D,IAAI,CAAC,UACH;GAGF,MAAM,gBAAgB,MAAM;GAC5B,IAAI,kBAAkB,SAAS,KAAK,EAClC,SAAS,UAAU,cAAc;;GAGrC;;;;;;;;;;;;;AAcJ,SAAgB,YAGd,OAA+C;CAC/C,MAAM,OAAO,WAAW,MAAM,aAAa;CAC3C,MAAM,YAAY,YAAY;EAC5B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,EAChC,AAAC,MAAM,UAAkB,KAAK,IAAI,KAAK,KAAY;GAEtD;;;;;;;;;;;;;AAcJ,SAAgB,mBAId,OACA,YACA;CACA,IAAI,MAAM,QAAQ,cAChB,OAAO,MAAM,QAAQ,aAAa,MAAM,SAAS,WAAW;CAG9D,OAAO;EACL,GAAG,MAAM;EACT,GAAG;EACJ;;;;;;;;;;;;;AAcH,SAAgB,iBAId,OACA,SACM;CAEN,MAAM,gBAAgB,mBAAmB,OADtB,iBAAiB,SAAS,MAAM,QACO,CAAC;CAC3D,IAAI,MAAM,cACR,MAAM,aAAa,UAAU,cAAc;MAE3C,MAAM,UAAU;CAElB,mCAAmC,MAAM"}
1
+ {"version":3,"file":"coreTablesFeature.utils.js","names":[],"sources":["../../../src/core/table/coreTablesFeature.utils.ts"],"sourcesContent":["import { cloneState, functionalUpdate } from '../../utils'\nimport type { RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\n\n/**\n * Synchronizes externally controlled state slices into the table's base atoms.\n *\n * This keeps legacy `options.state` values reflected in the atom graph so\n * derived atoms, stores, and table APIs read a consistent snapshot.\n *\n * @example\n * ```ts\n * table_syncExternalStateToBaseAtoms(table)\n * ```\n */\nexport function table_syncExternalStateToBaseAtoms<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const state = table.options.state\n if (!state) {\n return\n }\n\n table._reactivity.batch(() => {\n for (const key in state) {\n const baseAtom = (table.baseAtoms as Record<string, any>)[key]\n if (!baseAtom) {\n continue\n }\n\n const externalState = state[key as keyof typeof state]\n if (externalState !== baseAtom.get()) {\n baseAtom.set(() => externalState)\n }\n }\n })\n}\n\n/**\n * Resets all internal table base atoms to `table.initialState`.\n *\n * This resets internally owned state slices in a single reactivity batch. Use\n * feature-specific reset APIs when a slice may be externally owned.\n *\n * @example\n * ```ts\n * table_reset(table)\n * ```\n */\nexport function table_reset<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): void {\n const snap = cloneState(table.initialState)\n table._reactivity.batch(() => {\n const keys = Object.keys(snap) as Array<keyof typeof snap>\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]!\n ;(table.baseAtoms as any)[key].set(snap[key] as any)\n }\n })\n}\n\n/**\n * Merges new table options with the current resolved options.\n *\n * If `options.mergeOptions` is provided, it owns the merge behavior; otherwise\n * options are shallow-merged.\n *\n * @example\n * ```ts\n * const options = table_mergeOptions(table, nextOptions)\n * ```\n */\nexport function table_mergeOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n newOptions: TableOptions<TFeatures, TData>,\n) {\n if (table.options.mergeOptions) {\n return table.options.mergeOptions(table.options, newOptions)\n }\n\n return {\n ...table.options,\n ...newOptions,\n }\n}\n\n/**\n * Updates the table options object.\n *\n * The updater receives the current resolved options and the merged result is\n * immediately assigned to the table instance.\n *\n * @example\n * ```ts\n * table_setOptions(table, (old) => old)\n * ```\n */\nexport function table_setOptions<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<TableOptions<TFeatures, TData>>,\n): void {\n const newOptions = functionalUpdate(updater, table.options)\n const mergedOptions = table_mergeOptions(table, newOptions)\n if (table.optionsStore) {\n table.optionsStore.set(() => mergedOptions)\n } else {\n table.options = mergedOptions\n }\n table_syncExternalStateToBaseAtoms(table)\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,mCAGd,OAA+C;CAC/C,MAAM,QAAQ,MAAM,QAAQ;CAC5B,IAAI,CAAC,OACH;CAGF,MAAM,YAAY,YAAY;EAC5B,KAAK,MAAM,OAAO,OAAO;GACvB,MAAM,WAAY,MAAM,UAAkC;GAC1D,IAAI,CAAC,UACH;GAGF,MAAM,gBAAgB,MAAM;GAC5B,IAAI,kBAAkB,SAAS,KAAK,EAClC,SAAS,UAAU,cAAc;;GAGrC;;;;;;;;;;;;;AAcJ,SAAgB,YAGd,OAA+C;CAC/C,MAAM,OAAO,WAAW,MAAM,aAAa;CAC3C,MAAM,YAAY,YAAY;EAC5B,MAAM,OAAO,OAAO,KAAK,KAAK;EAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;GACpC,MAAM,MAAM,KAAK;GAChB,AAAC,MAAM,UAAkB,KAAK,IAAI,KAAK,KAAY;;GAEtD;;;;;;;;;;;;;AAcJ,SAAgB,mBAId,OACA,YACA;CACA,IAAI,MAAM,QAAQ,cAChB,OAAO,MAAM,QAAQ,aAAa,MAAM,SAAS,WAAW;CAG9D,OAAO;EACL,GAAG,MAAM;EACT,GAAG;EACJ;;;;;;;;;;;;;AAcH,SAAgB,iBAId,OACA,SACM;CAEN,MAAM,gBAAgB,mBAAmB,OADtB,iBAAiB,SAAS,MAAM,QACO,CAAC;CAC3D,IAAI,MAAM,cACR,MAAM,aAAa,UAAU,cAAc;MAE3C,MAAM,UAAU;CAElB,mCAAmC,MAAM"}
@@ -6,32 +6,38 @@ import { RowModel } from "../../core/row-models/coreRowModelsFeature.types.cjs";
6
6
  //#region src/features/column-faceting/columnFacetingFeature.types.d.ts
7
7
  interface Column_ColumnFaceting<TFeatures extends TableFeatures, TData extends RowData> {
8
8
  /**
9
- * A function that **computes and returns** a min/max tuple derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.
9
+ * Computes min/max numeric facet values for this column.
10
10
  */
11
11
  getFacetedMinMaxValues: () => undefined | [number, number];
12
12
  /**
13
- * A function that **computes and returns** a row model with all other column filters applied, excluding its own filter. Useful for displaying faceted result counts.
13
+ * Computes the row model used to derive this column's facet values.
14
+ *
15
+ * Other column filters are applied, while this column's own filter is
16
+ * excluded.
14
17
  */
15
18
  getFacetedRowModel: () => RowModel<TFeatures, TData>;
16
19
  /**
17
- * Returns a `Map` of unique values and their occurrences derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.
20
+ * Computes unique facet values and occurrence counts for this column.
18
21
  */
19
22
  getFacetedUniqueValues: () => Map<any, number>;
20
23
  }
21
24
  interface Table_RowModels_Faceted<TFeatures extends TableFeatures, TData extends RowData> {
22
25
  /**
23
- * A function that **computes and returns** a min/max tuple derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.
24
- * > Requires that you pass a valid `facetedMinMaxValues` row model factory in `_rowModels`. A default implementation is provided via the exported `createFacetedMinMaxValues` function.
26
+ * Computes min/max numeric facet values for the active faceting context.
27
+ *
28
+ * Requires a `facetedMinMaxValues` row-model factory in `_rowModels`.
25
29
  */
26
30
  getFacetedMinMaxValues: () => undefined | [number, number];
27
31
  /**
28
- * Returns the row model with all other column filters applied, excluding its own filter. Useful for displaying faceted result counts.
29
- * > Requires that you pass a valid `facetedRowModel` row model factory in `_rowModels`. A default implementation is provided via the exported `createFacetedRowModel` function.
32
+ * Computes the row model used to derive facet values.
33
+ *
34
+ * Requires a `facetedRowModel` row-model factory in `_rowModels`.
30
35
  */
31
36
  getFacetedRowModel: () => RowModel<TFeatures, TData>;
32
37
  /**
33
- * A function that **computes and returns** a `Map` of unique values and their occurrences derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.
34
- * > Requires that you pass a valid `facetedUniqueValues` row model factory in `_rowModels`. A default implementation is provided via the exported `createFacetedUniqueValues` function.
38
+ * Computes unique facet values and occurrence counts.
39
+ *
40
+ * Requires a `facetedUniqueValues` row-model factory in `_rowModels`.
35
41
  */
36
42
  getFacetedUniqueValues: () => Map<any, number>;
37
43
  }
@@ -66,7 +72,7 @@ interface Table_ColumnFaceting<TFeatures extends TableFeatures, TData extends Ro
66
72
  */
67
73
  getGlobalFacetedMinMaxValues: () => undefined | [number, number];
68
74
  /**
69
- * Returns the row model for the table after **global** filtering has been applied.
75
+ * Computes the row model used to derive global facet values.
70
76
  */
71
77
  getGlobalFacetedRowModel: () => RowModel<TFeatures, TData>;
72
78
  /**