@tanstack/table-core 9.0.0-alpha.47 → 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 (246) hide show
  1. package/README.md +10 -0
  2. package/dist/core/cells/coreCellsFeature.utils.cjs +11 -8
  3. package/dist/core/cells/coreCellsFeature.utils.cjs.map +1 -1
  4. package/dist/core/cells/coreCellsFeature.utils.d.cts +11 -8
  5. package/dist/core/cells/coreCellsFeature.utils.d.ts +11 -8
  6. package/dist/core/cells/coreCellsFeature.utils.js +11 -8
  7. package/dist/core/cells/coreCellsFeature.utils.js.map +1 -1
  8. package/dist/core/columns/coreColumnsFeature.types.d.cts +7 -6
  9. package/dist/core/columns/coreColumnsFeature.types.d.ts +7 -6
  10. package/dist/core/columns/coreColumnsFeature.utils.cjs +37 -27
  11. package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
  12. package/dist/core/columns/coreColumnsFeature.utils.d.cts +37 -27
  13. package/dist/core/columns/coreColumnsFeature.utils.d.ts +37 -27
  14. package/dist/core/columns/coreColumnsFeature.utils.js +37 -27
  15. package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
  16. package/dist/core/headers/coreHeadersFeature.types.d.cts +6 -4
  17. package/dist/core/headers/coreHeadersFeature.types.d.ts +6 -4
  18. package/dist/core/headers/coreHeadersFeature.utils.cjs +23 -18
  19. package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
  20. package/dist/core/headers/coreHeadersFeature.utils.d.cts +23 -18
  21. package/dist/core/headers/coreHeadersFeature.utils.d.ts +23 -18
  22. package/dist/core/headers/coreHeadersFeature.utils.js +23 -18
  23. package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
  24. package/dist/core/row-models/coreRowModelsFeature.utils.cjs +48 -36
  25. package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
  26. package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +48 -36
  27. package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +48 -36
  28. package/dist/core/row-models/coreRowModelsFeature.utils.js +48 -36
  29. package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
  30. package/dist/core/rows/coreRowsFeature.types.d.cts +4 -4
  31. package/dist/core/rows/coreRowsFeature.types.d.ts +4 -4
  32. package/dist/core/rows/coreRowsFeature.utils.cjs +34 -28
  33. package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
  34. package/dist/core/rows/coreRowsFeature.utils.d.cts +34 -28
  35. package/dist/core/rows/coreRowsFeature.utils.d.ts +34 -28
  36. package/dist/core/rows/coreRowsFeature.utils.js +34 -28
  37. package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
  38. package/dist/core/table/coreTablesFeature.types.d.cts +6 -2
  39. package/dist/core/table/coreTablesFeature.types.d.ts +6 -2
  40. package/dist/core/table/coreTablesFeature.utils.cjs +2 -2
  41. package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
  42. package/dist/core/table/coreTablesFeature.utils.d.cts +2 -2
  43. package/dist/core/table/coreTablesFeature.utils.d.ts +2 -2
  44. package/dist/core/table/coreTablesFeature.utils.js +2 -2
  45. package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
  46. package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +16 -10
  47. package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +16 -10
  48. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +26 -18
  49. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
  50. package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +26 -18
  51. package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +26 -18
  52. package/dist/features/column-faceting/columnFacetingFeature.utils.js +26 -18
  53. package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
  54. package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +21 -11
  55. package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +21 -11
  56. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +39 -28
  57. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
  58. package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +39 -28
  59. package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +39 -28
  60. package/dist/features/column-filtering/columnFilteringFeature.utils.js +39 -28
  61. package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
  62. package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +18 -14
  63. package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +18 -14
  64. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +55 -43
  65. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
  66. package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +55 -43
  67. package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +55 -43
  68. package/dist/features/column-grouping/columnGroupingFeature.utils.js +55 -43
  69. package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
  70. package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +14 -5
  71. package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +14 -5
  72. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +30 -23
  73. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
  74. package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +30 -23
  75. package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +30 -23
  76. package/dist/features/column-ordering/columnOrderingFeature.utils.js +30 -23
  77. package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
  78. package/dist/features/column-pinning/columnPinningFeature.types.d.cts +43 -31
  79. package/dist/features/column-pinning/columnPinningFeature.types.d.ts +43 -31
  80. package/dist/features/column-pinning/columnPinningFeature.utils.cjs +111 -91
  81. package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
  82. package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +111 -91
  83. package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +111 -91
  84. package/dist/features/column-pinning/columnPinningFeature.utils.js +111 -91
  85. package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
  86. package/dist/features/column-resizing/columnResizingFeature.types.d.cts +9 -9
  87. package/dist/features/column-resizing/columnResizingFeature.types.d.ts +9 -9
  88. package/dist/features/column-resizing/columnResizingFeature.utils.cjs +28 -19
  89. package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
  90. package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +28 -19
  91. package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +28 -19
  92. package/dist/features/column-resizing/columnResizingFeature.utils.js +28 -19
  93. package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
  94. package/dist/features/column-sizing/columnSizingFeature.types.d.cts +19 -12
  95. package/dist/features/column-sizing/columnSizingFeature.types.d.ts +19 -12
  96. package/dist/features/column-sizing/columnSizingFeature.utils.cjs +52 -41
  97. package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
  98. package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +52 -41
  99. package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +52 -41
  100. package/dist/features/column-sizing/columnSizingFeature.utils.js +52 -41
  101. package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
  102. package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +16 -13
  103. package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +16 -13
  104. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +54 -42
  105. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
  106. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +54 -42
  107. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +54 -42
  108. package/dist/features/column-visibility/columnVisibilityFeature.utils.js +54 -42
  109. package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
  110. package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +10 -5
  111. package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +10 -5
  112. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +20 -14
  113. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
  114. package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +20 -14
  115. package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +20 -14
  116. package/dist/features/global-filtering/globalFilteringFeature.utils.js +20 -14
  117. package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
  118. package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +16 -15
  119. package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +16 -15
  120. package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +56 -41
  121. package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
  122. package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +56 -41
  123. package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +56 -41
  124. package/dist/features/row-expanding/rowExpandingFeature.utils.js +56 -41
  125. package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
  126. package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +19 -12
  127. package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +19 -12
  128. package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +49 -32
  129. package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -1
  130. package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +49 -32
  131. package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +49 -32
  132. package/dist/features/row-pagination/rowPaginationFeature.utils.js +49 -32
  133. package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -1
  134. package/dist/features/row-pinning/rowPinningFeature.types.d.cts +12 -8
  135. package/dist/features/row-pinning/rowPinningFeature.types.d.ts +12 -8
  136. package/dist/features/row-pinning/rowPinningFeature.utils.cjs +39 -29
  137. package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
  138. package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +39 -29
  139. package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +39 -29
  140. package/dist/features/row-pinning/rowPinningFeature.utils.js +39 -29
  141. package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
  142. package/dist/features/row-selection/rowSelectionFeature.types.d.cts +30 -24
  143. package/dist/features/row-selection/rowSelectionFeature.types.d.ts +30 -24
  144. package/dist/features/row-selection/rowSelectionFeature.utils.cjs +89 -69
  145. package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
  146. package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +89 -69
  147. package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +89 -69
  148. package/dist/features/row-selection/rowSelectionFeature.utils.js +89 -69
  149. package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
  150. package/dist/features/row-sorting/rowSortingFeature.types.d.cts +10 -8
  151. package/dist/features/row-sorting/rowSortingFeature.types.d.ts +10 -8
  152. package/dist/features/row-sorting/rowSortingFeature.utils.cjs +61 -44
  153. package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
  154. package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +61 -44
  155. package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +61 -44
  156. package/dist/features/row-sorting/rowSortingFeature.utils.js +61 -44
  157. package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
  158. package/dist/fns/aggregationFns.cjs +33 -9
  159. package/dist/fns/aggregationFns.cjs.map +1 -1
  160. package/dist/fns/aggregationFns.d.cts +33 -9
  161. package/dist/fns/aggregationFns.d.ts +33 -9
  162. package/dist/fns/aggregationFns.js +33 -9
  163. package/dist/fns/aggregationFns.js.map +1 -1
  164. package/dist/fns/filterFns.cjs +48 -17
  165. package/dist/fns/filterFns.cjs.map +1 -1
  166. package/dist/fns/filterFns.d.cts +42 -15
  167. package/dist/fns/filterFns.d.ts +42 -15
  168. package/dist/fns/filterFns.js +48 -17
  169. package/dist/fns/filterFns.js.map +1 -1
  170. package/dist/helpers/columnHelper.cjs +9 -4
  171. package/dist/helpers/columnHelper.cjs.map +1 -1
  172. package/dist/helpers/columnHelper.d.cts +9 -4
  173. package/dist/helpers/columnHelper.d.ts +9 -4
  174. package/dist/helpers/columnHelper.js +9 -4
  175. package/dist/helpers/columnHelper.js.map +1 -1
  176. package/dist/helpers/tableOptions.cjs.map +1 -1
  177. package/dist/helpers/tableOptions.d.cts +12 -9
  178. package/dist/helpers/tableOptions.d.ts +12 -9
  179. package/dist/helpers/tableOptions.js.map +1 -1
  180. package/dist/types/ColumnDef.d.cts +38 -0
  181. package/dist/types/ColumnDef.d.ts +38 -0
  182. package/dist/types/TableOptions.d.cts +15 -0
  183. package/dist/types/TableOptions.d.ts +15 -0
  184. package/dist/types/TableState.d.cts +12 -0
  185. package/dist/types/TableState.d.ts +12 -0
  186. package/package.json +5 -3
  187. package/skills/column-definitions/SKILL.md +333 -0
  188. package/skills/column-layout/SKILL.md +328 -0
  189. package/skills/column-layout/references/subsystems.md +220 -0
  190. package/skills/customizing-feature-behavior/SKILL.md +416 -0
  191. package/skills/filtering/SKILL.md +357 -0
  192. package/skills/filtering/references/faceting-and-fuzzy.md +191 -0
  193. package/skills/grouping/SKILL.md +448 -0
  194. package/skills/migrate-v8-to-v9/SKILL.md +495 -0
  195. package/skills/pagination/SKILL.md +385 -0
  196. package/skills/row-expanding/SKILL.md +348 -0
  197. package/skills/row-pinning/SKILL.md +269 -0
  198. package/skills/row-selection/SKILL.md +391 -0
  199. package/skills/setup/SKILL.md +400 -0
  200. package/skills/sorting/SKILL.md +344 -0
  201. package/skills/state-management/SKILL.md +388 -0
  202. package/src/core/cells/coreCellsFeature.utils.ts +11 -8
  203. package/src/core/columns/coreColumnsFeature.types.ts +7 -6
  204. package/src/core/columns/coreColumnsFeature.utils.ts +37 -27
  205. package/src/core/headers/coreHeadersFeature.types.ts +6 -4
  206. package/src/core/headers/coreHeadersFeature.utils.ts +23 -18
  207. package/src/core/row-models/coreRowModelsFeature.utils.ts +48 -36
  208. package/src/core/rows/coreRowsFeature.types.ts +4 -4
  209. package/src/core/rows/coreRowsFeature.utils.ts +34 -28
  210. package/src/core/table/coreTablesFeature.types.ts +6 -2
  211. package/src/core/table/coreTablesFeature.utils.ts +2 -2
  212. package/src/features/column-faceting/columnFacetingFeature.types.ts +16 -10
  213. package/src/features/column-faceting/columnFacetingFeature.utils.ts +26 -18
  214. package/src/features/column-filtering/columnFilteringFeature.types.ts +21 -11
  215. package/src/features/column-filtering/columnFilteringFeature.utils.ts +39 -28
  216. package/src/features/column-grouping/columnGroupingFeature.types.ts +18 -14
  217. package/src/features/column-grouping/columnGroupingFeature.utils.ts +55 -43
  218. package/src/features/column-ordering/columnOrderingFeature.types.ts +14 -5
  219. package/src/features/column-ordering/columnOrderingFeature.utils.ts +30 -23
  220. package/src/features/column-pinning/columnPinningFeature.types.ts +43 -31
  221. package/src/features/column-pinning/columnPinningFeature.utils.ts +111 -91
  222. package/src/features/column-resizing/columnResizingFeature.types.ts +9 -9
  223. package/src/features/column-resizing/columnResizingFeature.utils.ts +28 -19
  224. package/src/features/column-sizing/columnSizingFeature.types.ts +19 -12
  225. package/src/features/column-sizing/columnSizingFeature.utils.ts +52 -41
  226. package/src/features/column-visibility/columnVisibilityFeature.types.ts +16 -13
  227. package/src/features/column-visibility/columnVisibilityFeature.utils.ts +54 -42
  228. package/src/features/global-filtering/globalFilteringFeature.types.ts +10 -5
  229. package/src/features/global-filtering/globalFilteringFeature.utils.ts +20 -14
  230. package/src/features/row-expanding/rowExpandingFeature.types.ts +16 -15
  231. package/src/features/row-expanding/rowExpandingFeature.utils.ts +56 -41
  232. package/src/features/row-pagination/rowPaginationFeature.types.ts +19 -12
  233. package/src/features/row-pagination/rowPaginationFeature.utils.ts +49 -32
  234. package/src/features/row-pinning/rowPinningFeature.types.ts +12 -8
  235. package/src/features/row-pinning/rowPinningFeature.utils.ts +39 -29
  236. package/src/features/row-selection/rowSelectionFeature.types.ts +30 -24
  237. package/src/features/row-selection/rowSelectionFeature.utils.ts +89 -69
  238. package/src/features/row-sorting/rowSortingFeature.types.ts +10 -8
  239. package/src/features/row-sorting/rowSortingFeature.utils.ts +61 -44
  240. package/src/fns/aggregationFns.ts +33 -9
  241. package/src/fns/filterFns.ts +48 -17
  242. package/src/helpers/columnHelper.ts +9 -4
  243. package/src/helpers/tableOptions.ts +12 -9
  244. package/src/types/ColumnDef.ts +38 -0
  245. package/src/types/TableOptions.ts +15 -0
  246. package/src/types/TableState.ts +12 -0
@@ -13,13 +13,14 @@ import type { Header_Header } from './coreHeadersFeature.types'
13
13
  import type { Column } from '../../types/Column'
14
14
 
15
15
  /**
16
- * Returns leaf headers for a header.
16
+ * Walks a header tree and collects all descendant leaf headers.
17
17
  *
18
- * This is the static implementation behind the matching header instance API and can account for nested header groups.
18
+ * The header itself is included after its descendants, matching the recursive
19
+ * shape used by nested header groups.
19
20
  *
20
21
  * @example
21
22
  * ```ts
22
- * const value = header_getLeafHeaders(header)
23
+ * const leafHeaders = header_getLeafHeaders(header)
23
24
  * ```
24
25
  */
25
26
  export function header_getLeafHeaders<
@@ -42,13 +43,13 @@ export function header_getLeafHeaders<
42
43
  }
43
44
 
44
45
  /**
45
- * Returns context for a header.
46
+ * Builds the render context passed to a column's `header` or `footer` template.
46
47
  *
47
- * This is the static implementation behind the matching header instance API and can account for nested header groups.
48
+ * The context contains the header, its column, and the owning table instance.
48
49
  *
49
50
  * @example
50
51
  * ```ts
51
- * const value = header_getContext(header)
52
+ * const context = header_getContext(header)
52
53
  * ```
53
54
  */
54
55
  export function header_getContext<
@@ -64,13 +65,14 @@ export function header_getContext<
64
65
  }
65
66
 
66
67
  /**
67
- * Returns header groups for the table.
68
+ * Builds visible header groups for the current column tree.
68
69
  *
69
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
70
+ * Column visibility and pinning are applied before groups are built. When no
71
+ * columns are pinned, the fast path skips pin partitioning.
70
72
  *
71
73
  * @example
72
74
  * ```ts
73
- * const value = table_getHeaderGroups(table)
75
+ * const headerGroups = table_getHeaderGroups(table)
74
76
  * ```
75
77
  */
76
78
  export function table_getHeaderGroups<
@@ -127,13 +129,14 @@ export function table_getHeaderGroups<
127
129
  }
128
130
 
129
131
  /**
130
- * Returns footer groups for the table.
132
+ * Builds footer groups by reversing the current header groups.
131
133
  *
132
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
134
+ * Footer rendering uses the same header objects and grouping structure, but
135
+ * renders them from leaf level back toward the root.
133
136
  *
134
137
  * @example
135
138
  * ```ts
136
- * const value = table_getFooterGroups(table)
139
+ * const footerGroups = table_getFooterGroups(table)
137
140
  * ```
138
141
  */
139
142
  export function table_getFooterGroups<
@@ -145,13 +148,14 @@ export function table_getFooterGroups<
145
148
  }
146
149
 
147
150
  /**
148
- * Returns flat headers for the table.
151
+ * Flattens every header from every header group into one array.
149
152
  *
150
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
153
+ * The result includes parent headers and placeholder headers, in header-group
154
+ * order from top to bottom.
151
155
  *
152
156
  * @example
153
157
  * ```ts
154
- * const value = table_getFlatHeaders(table)
158
+ * const flatHeaders = table_getFlatHeaders(table)
155
159
  * ```
156
160
  */
157
161
  export function table_getFlatHeaders<
@@ -170,13 +174,14 @@ export function table_getFlatHeaders<
170
174
  }
171
175
 
172
176
  /**
173
- * Returns leaf headers for the table.
177
+ * Collects only the leaf headers from the current header tree.
174
178
  *
175
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
179
+ * Parent/group headers are skipped, making the result suitable for rendering
180
+ * one header per visible leaf column.
176
181
  *
177
182
  * @example
178
183
  * ```ts
179
- * const value = table_getLeafHeaders(table)
184
+ * const leafHeaders = table_getLeafHeaders(table)
180
185
  * ```
181
186
  */
182
187
  export function table_getLeafHeaders<
@@ -5,13 +5,14 @@ import type { RowData } from '../../types/type-utils'
5
5
  import type { RowModel } from './coreRowModelsFeature.types'
6
6
 
7
7
  /**
8
- * Returns core row model for the table.
8
+ * Resolves the table's unmodified core row model.
9
9
  *
10
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
10
+ * The factory is created once per table, either from `options._rowModels.coreRowModel`
11
+ * or the built-in `createCoreRowModel()`, then reused for later calls.
11
12
  *
12
13
  * @example
13
14
  * ```ts
14
- * const value = table_getCoreRowModel(table)
15
+ * const coreRows = table_getCoreRowModel(table)
15
16
  * ```
16
17
  */
17
18
  export function table_getCoreRowModel<
@@ -28,13 +29,14 @@ export function table_getCoreRowModel<
28
29
  }
29
30
 
30
31
  /**
31
- * Returns pre filtered row model for the table.
32
+ * Reads the row model immediately before column/global filtering.
32
33
  *
33
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
34
+ * Filtering is the first derived row-model stage, so this currently aliases
35
+ * `table.getCoreRowModel()`.
34
36
  *
35
37
  * @example
36
38
  * ```ts
37
- * const value = table_getPreFilteredRowModel(table)
39
+ * const rowsBeforeFiltering = table_getPreFilteredRowModel(table)
38
40
  * ```
39
41
  */
40
42
  export function table_getPreFilteredRowModel<
@@ -45,13 +47,15 @@ export function table_getPreFilteredRowModel<
45
47
  }
46
48
 
47
49
  /**
48
- * Returns filtered row model for the table.
50
+ * Resolves the row model after column and global filtering.
49
51
  *
50
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
52
+ * When `manualFiltering` is enabled, or no filtered row-model factory was
53
+ * registered, this returns the pre-filtered row model because filtering is
54
+ * expected to happen outside the table.
51
55
  *
52
56
  * @example
53
57
  * ```ts
54
- * const value = table_getFilteredRowModel(table)
58
+ * const filteredRows = table_getFilteredRowModel(table)
55
59
  * ```
56
60
  */
57
61
  export function table_getFilteredRowModel<
@@ -71,13 +75,13 @@ export function table_getFilteredRowModel<
71
75
  }
72
76
 
73
77
  /**
74
- * Returns pre grouped row model for the table.
78
+ * Reads the row model immediately before grouping.
75
79
  *
76
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
80
+ * Grouping runs after filtering, so this aliases `table.getFilteredRowModel()`.
77
81
  *
78
82
  * @example
79
83
  * ```ts
80
- * const value = table_getPreGroupedRowModel(table)
84
+ * const rowsBeforeGrouping = table_getPreGroupedRowModel(table)
81
85
  * ```
82
86
  */
83
87
  export function table_getPreGroupedRowModel<
@@ -88,13 +92,14 @@ export function table_getPreGroupedRowModel<
88
92
  }
89
93
 
90
94
  /**
91
- * Returns grouped row model for the table.
95
+ * Resolves the row model after grouping has produced grouped and aggregated rows.
92
96
  *
93
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
97
+ * When `manualGrouping` is enabled, or no grouped row-model factory was
98
+ * registered, this returns the pre-grouped row model unchanged.
94
99
  *
95
100
  * @example
96
101
  * ```ts
97
- * const value = table_getGroupedRowModel(table)
102
+ * const groupedRows = table_getGroupedRowModel(table)
98
103
  * ```
99
104
  */
100
105
  export function table_getGroupedRowModel<
@@ -114,13 +119,13 @@ export function table_getGroupedRowModel<
114
119
  }
115
120
 
116
121
  /**
117
- * Returns pre sorted row model for the table.
122
+ * Reads the row model immediately before sorting.
118
123
  *
119
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
124
+ * Sorting runs after grouping, so this aliases `table.getGroupedRowModel()`.
120
125
  *
121
126
  * @example
122
127
  * ```ts
123
- * const value = table_getPreSortedRowModel(table)
128
+ * const rowsBeforeSorting = table_getPreSortedRowModel(table)
124
129
  * ```
125
130
  */
126
131
  export function table_getPreSortedRowModel<
@@ -131,13 +136,15 @@ export function table_getPreSortedRowModel<
131
136
  }
132
137
 
133
138
  /**
134
- * Returns sorted row model for the table.
139
+ * Resolves the row model after sorting has been applied.
135
140
  *
136
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
141
+ * When `manualSorting` is enabled, or no sorted row-model factory was
142
+ * registered, this returns the pre-sorted row model because sorted data is
143
+ * expected to be supplied by the caller.
137
144
  *
138
145
  * @example
139
146
  * ```ts
140
- * const value = table_getSortedRowModel(table)
147
+ * const sortedRows = table_getSortedRowModel(table)
141
148
  * ```
142
149
  */
143
150
  export function table_getSortedRowModel<
@@ -157,13 +164,13 @@ export function table_getSortedRowModel<
157
164
  }
158
165
 
159
166
  /**
160
- * Returns pre expanded row model for the table.
167
+ * Reads the row model immediately before row expansion.
161
168
  *
162
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
169
+ * Expansion runs after sorting, so this aliases `table.getSortedRowModel()`.
163
170
  *
164
171
  * @example
165
172
  * ```ts
166
- * const value = table_getPreExpandedRowModel(table)
173
+ * const rowsBeforeExpansion = table_getPreExpandedRowModel(table)
167
174
  * ```
168
175
  */
169
176
  export function table_getPreExpandedRowModel<
@@ -174,13 +181,14 @@ export function table_getPreExpandedRowModel<
174
181
  }
175
182
 
176
183
  /**
177
- * Returns expanded row model for the table.
184
+ * Resolves the row model after expanded rows have been flattened into view.
178
185
  *
179
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
186
+ * When `manualExpanding` is enabled, or no expanded row-model factory was
187
+ * registered, this returns the pre-expanded row model unchanged.
180
188
  *
181
189
  * @example
182
190
  * ```ts
183
- * const value = table_getExpandedRowModel(table)
191
+ * const expandedRows = table_getExpandedRowModel(table)
184
192
  * ```
185
193
  */
186
194
  export function table_getExpandedRowModel<
@@ -200,13 +208,14 @@ export function table_getExpandedRowModel<
200
208
  }
201
209
 
202
210
  /**
203
- * Returns pre paginated row model for the table.
211
+ * Reads the row model immediately before pagination.
204
212
  *
205
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
213
+ * Pagination is the final built-in row-model stage, so this aliases
214
+ * `table.getExpandedRowModel()`.
206
215
  *
207
216
  * @example
208
217
  * ```ts
209
- * const value = table_getPrePaginatedRowModel(table)
218
+ * const rowsBeforePagination = table_getPrePaginatedRowModel(table)
210
219
  * ```
211
220
  */
212
221
  export function table_getPrePaginatedRowModel<
@@ -217,13 +226,15 @@ export function table_getPrePaginatedRowModel<
217
226
  }
218
227
 
219
228
  /**
220
- * Returns paginated row model for the table.
229
+ * Resolves the row model after pagination has sliced rows for the current page.
221
230
  *
222
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
231
+ * When `manualPagination` is enabled, or no paginated row-model factory was
232
+ * registered, this returns the pre-paginated row model because pagination is
233
+ * expected to happen before data reaches the table.
223
234
  *
224
235
  * @example
225
236
  * ```ts
226
- * const value = table_getPaginatedRowModel(table)
237
+ * const pageRows = table_getPaginatedRowModel(table)
227
238
  * ```
228
239
  */
229
240
  export function table_getPaginatedRowModel<
@@ -243,13 +254,14 @@ export function table_getPaginatedRowModel<
243
254
  }
244
255
 
245
256
  /**
246
- * Returns row model for the table.
257
+ * Resolves the final row model consumed by renderers.
247
258
  *
248
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
259
+ * This is the end of the built-in row-model pipeline: core -> filtering ->
260
+ * grouping -> sorting -> expanding -> pagination.
249
261
  *
250
262
  * @example
251
263
  * ```ts
252
- * const value = table_getRowModel(table)
264
+ * const visibleRows = table_getRowModel(table)
253
265
  * ```
254
266
  */
255
267
  export function table_getRowModel<
@@ -49,11 +49,11 @@ export interface Row_Row<
49
49
  TData extends RowData,
50
50
  > extends Row_CoreProperties<TFeatures, TData> {
51
51
  /**
52
- * Returns all of the cells for the row by column id.
52
+ * Builds a lookup of this row's cells keyed by leaf column id.
53
53
  */
54
54
  getAllCellsByColumnId: () => Record<string, Cell<TFeatures, TData, unknown>>
55
55
  /**
56
- * Returns all of the cells for the row.
56
+ * Builds one cell for each leaf column, including cells for hidden columns.
57
57
  */
58
58
  getAllCells: () => Array<Cell<TFeatures, TData, unknown>>
59
59
  /**
@@ -69,11 +69,11 @@ export interface Row_Row<
69
69
  */
70
70
  getParentRows: () => Array<Row<TFeatures, TData>>
71
71
  /**
72
- * Returns a unique array of values from the row for a given columnId.
72
+ * Reads the values this row contributes to faceting/grouping for a column.
73
73
  */
74
74
  getUniqueValues: <TValue>(columnId: string) => Array<TValue>
75
75
  /**
76
- * Returns the value from the row for a given columnId.
76
+ * Reads this row's accessor value for a column id and caches the result.
77
77
  */
78
78
  getValue: <TValue>(columnId: string) => TValue
79
79
  /**
@@ -7,13 +7,14 @@ import type { Row } from '../../types/Row'
7
7
  import type { Cell } from '../../types/Cell'
8
8
 
9
9
  /**
10
- * Returns value for a row.
10
+ * Reads and caches this row's value for a column.
11
11
  *
12
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
12
+ * The value is produced by the column accessor. Missing columns or display
13
+ * columns without an accessor return `undefined`.
13
14
  *
14
15
  * @example
15
16
  * ```ts
16
- * const value = row_getValue(row)
17
+ * const firstName = row_getValue(row, 'firstName')
17
18
  * ```
18
19
  */
19
20
  export function row_getValue<
@@ -36,13 +37,14 @@ export function row_getValue<
36
37
  }
37
38
 
38
39
  /**
39
- * Returns unique values for a row.
40
+ * Reads and caches the values used by faceting/grouping for a column.
40
41
  *
41
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
42
+ * If the column defines `getUniqueValues`, that result is used. Otherwise the
43
+ * row's accessor value is wrapped in a single-item array.
42
44
  *
43
45
  * @example
44
46
  * ```ts
45
- * const value = row_getUniqueValues(row)
47
+ * const values = row_getUniqueValues(row, 'tags')
46
48
  * ```
47
49
  */
48
50
  export function row_getUniqueValues<
@@ -80,7 +82,7 @@ export function row_getUniqueValues<
80
82
  *
81
83
  * @example
82
84
  * ```ts
83
- * const value = row_renderValue(row)
85
+ * const value = row_renderValue(row, 'firstName')
84
86
  * ```
85
87
  */
86
88
  export function row_renderValue<
@@ -91,13 +93,13 @@ export function row_renderValue<
91
93
  }
92
94
 
93
95
  /**
94
- * Returns leaf rows for a row.
96
+ * Flattens this row's descendant tree into leaf rows.
95
97
  *
96
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
98
+ * The row itself is not included; only nested `subRows` are walked.
97
99
  *
98
100
  * @example
99
101
  * ```ts
100
- * const value = row_getLeafRows(row)
102
+ * const descendants = row_getLeafRows(row)
101
103
  * ```
102
104
  */
103
105
  export function row_getLeafRows<
@@ -108,13 +110,14 @@ export function row_getLeafRows<
108
110
  }
109
111
 
110
112
  /**
111
- * Returns parent row for a row.
113
+ * Looks up this row's direct parent, if it has one.
112
114
  *
113
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
115
+ * Parent lookup searches the pre-pagination row model so parent relationships
116
+ * are available even when the parent is not on the current page.
114
117
  *
115
118
  * @example
116
119
  * ```ts
117
- * const value = row_getParentRow(row)
120
+ * const parent = row_getParentRow(row)
118
121
  * ```
119
122
  */
120
123
  export function row_getParentRow<
@@ -125,13 +128,13 @@ export function row_getParentRow<
125
128
  }
126
129
 
127
130
  /**
128
- * Returns parent rows for a row.
131
+ * Collects this row's ancestor chain from root to direct parent.
129
132
  *
130
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
133
+ * The current row is not included. Rows without a parent return an empty array.
131
134
  *
132
135
  * @example
133
136
  * ```ts
134
- * const value = row_getParentRows(row)
137
+ * const ancestors = row_getParentRows(row)
135
138
  * ```
136
139
  */
137
140
  export function row_getParentRows<
@@ -151,13 +154,14 @@ export function row_getParentRows<
151
154
  }
152
155
 
153
156
  /**
154
- * Returns all cells for a row.
157
+ * Constructs one cell for each leaf column in this row.
155
158
  *
156
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
159
+ * The result follows `table.getAllLeafColumns()` order and includes hidden
160
+ * columns; visibility-specific APIs filter this list later.
157
161
  *
158
162
  * @example
159
163
  * ```ts
160
- * const value = row_getAllCells(row)
164
+ * const cells = row_getAllCells(row)
161
165
  * ```
162
166
  */
163
167
  export function row_getAllCells<
@@ -175,13 +179,13 @@ export function row_getAllCells<
175
179
  }
176
180
 
177
181
  /**
178
- * Returns all cells by column id for a row.
182
+ * Builds a lookup map of this row's cells keyed by column id.
179
183
  *
180
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
184
+ * This is the static implementation behind `row.getAllCellsByColumnId()`.
181
185
  *
182
186
  * @example
183
187
  * ```ts
184
- * const value = row_getAllCellsByColumnId(row)
188
+ * const cellsById = row_getAllCellsByColumnId(row)
185
189
  * ```
186
190
  */
187
191
  export function row_getAllCellsByColumnId<
@@ -198,13 +202,14 @@ export function row_getAllCellsByColumnId<
198
202
  }
199
203
 
200
204
  /**
201
- * Returns row id for the table.
205
+ * Resolves the stable id for a row.
202
206
  *
203
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
207
+ * `options.getRowId` wins when provided. Otherwise root rows use their index
208
+ * and child rows append their index to the parent id, such as `0.2`.
204
209
  *
205
210
  * @example
206
211
  * ```ts
207
- * const value = table_getRowId(table)
212
+ * const id = table_getRowId(originalRow, table, index, parentRow)
208
213
  * ```
209
214
  */
210
215
  export function table_getRowId<
@@ -223,13 +228,14 @@ export function table_getRowId<
223
228
  }
224
229
 
225
230
  /**
226
- * Returns row for the table.
231
+ * Looks up a row by id from the current or full row model.
227
232
  *
228
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
233
+ * By default this searches `table.getRowModel()`. Passing `searchAll` searches
234
+ * the pre-pagination model first, then falls back to the core model.
229
235
  *
230
236
  * @example
231
237
  * ```ts
232
- * const value = table_getRow(table)
238
+ * const row = table_getRow(table, rowId, true)
233
239
  * ```
234
240
  */
235
241
  export function table_getRow<
@@ -66,11 +66,15 @@ export interface TableOptions_Table<
66
66
  TData extends RowData,
67
67
  > {
68
68
  /**
69
- * The features that you want to enable for the table.
69
+ * The feature modules registered on this table instance.
70
+ *
71
+ * Feature registration controls which state slices, options, and prototype
72
+ * APIs are available.
70
73
  */
71
74
  readonly _features: TFeatures
72
75
  /**
73
- * The row model options that you want to enable for the table.
76
+ * Row model factories used by features such as filtering, grouping, sorting,
77
+ * expansion, and pagination.
74
78
  */
75
79
  readonly _rowModels?: CreateRowModels_All<TFeatures, TData>
76
80
  /**
@@ -12,7 +12,7 @@ import type { TableOptions } from '../../types/TableOptions'
12
12
  *
13
13
  * @example
14
14
  * ```ts
15
- * const value = table_syncExternalStateToBaseAtoms(table)
15
+ * table_syncExternalStateToBaseAtoms(table)
16
16
  * ```
17
17
  */
18
18
  export function table_syncExternalStateToBaseAtoms<
@@ -72,7 +72,7 @@ export function table_reset<
72
72
  *
73
73
  * @example
74
74
  * ```ts
75
- * const value = table_mergeOptions(table)
75
+ * const options = table_mergeOptions(table, nextOptions)
76
76
  * ```
77
77
  */
78
78
  export function table_mergeOptions<
@@ -8,15 +8,18 @@ export interface Column_ColumnFaceting<
8
8
  TData extends RowData,
9
9
  > {
10
10
  /**
11
- * A function that **computes and returns** a min/max tuple derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.
11
+ * Computes min/max numeric facet values for this column.
12
12
  */
13
13
  getFacetedMinMaxValues: () => undefined | [number, number]
14
14
  /**
15
- * 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.
15
+ * Computes the row model used to derive this column's facet values.
16
+ *
17
+ * Other column filters are applied, while this column's own filter is
18
+ * excluded.
16
19
  */
17
20
  getFacetedRowModel: () => RowModel<TFeatures, TData>
18
21
  /**
19
- * Returns a `Map` of unique values and their occurrences derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.
22
+ * Computes unique facet values and occurrence counts for this column.
20
23
  */
21
24
  getFacetedUniqueValues: () => Map<any, number>
22
25
  }
@@ -26,18 +29,21 @@ export interface Table_RowModels_Faceted<
26
29
  TData extends RowData,
27
30
  > {
28
31
  /**
29
- * A function that **computes and returns** a min/max tuple derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.
30
- * > Requires that you pass a valid `facetedMinMaxValues` row model factory in `_rowModels`. A default implementation is provided via the exported `createFacetedMinMaxValues` function.
32
+ * Computes min/max numeric facet values for the active faceting context.
33
+ *
34
+ * Requires a `facetedMinMaxValues` row-model factory in `_rowModels`.
31
35
  */
32
36
  getFacetedMinMaxValues: () => undefined | [number, number]
33
37
  /**
34
- * Returns the row model with all other column filters applied, excluding its own filter. Useful for displaying faceted result counts.
35
- * > Requires that you pass a valid `facetedRowModel` row model factory in `_rowModels`. A default implementation is provided via the exported `createFacetedRowModel` function.
38
+ * Computes the row model used to derive facet values.
39
+ *
40
+ * Requires a `facetedRowModel` row-model factory in `_rowModels`.
36
41
  */
37
42
  getFacetedRowModel: () => RowModel<TFeatures, TData>
38
43
  /**
39
- * A function that **computes and returns** a `Map` of unique values and their occurrences derived from `column.getFacetedRowModel`. Useful for displaying faceted result values.
40
- * > Requires that you pass a valid `facetedUniqueValues` row model factory in `_rowModels`. A default implementation is provided via the exported `createFacetedUniqueValues` function.
44
+ * Computes unique facet values and occurrence counts.
45
+ *
46
+ * Requires a `facetedUniqueValues` row-model factory in `_rowModels`.
41
47
  */
42
48
  getFacetedUniqueValues: () => Map<any, number>
43
49
  }
@@ -93,7 +99,7 @@ export interface Table_ColumnFaceting<
93
99
  */
94
100
  getGlobalFacetedMinMaxValues: () => undefined | [number, number]
95
101
  /**
96
- * Returns the row model for the table after **global** filtering has been applied.
102
+ * Computes the row model used to derive global facet values.
97
103
  */
98
104
  getGlobalFacetedRowModel: () => RowModel<TFeatures, TData>
99
105
  /**