@tanstack/table-core 9.0.0-alpha.47 → 9.0.0-alpha.49

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 +29 -20
  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 +29 -20
  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 +62 -45
  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 +62 -45
  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 +29 -21
  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 +62 -45
  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 {
13
13
  } from './columnGroupingFeature.types'
14
14
 
15
15
  /**
16
- * Returns the default grouping state.
16
+ * Creates the default grouping state.
17
17
  *
18
- * Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
18
+ * The feature default is an empty array, meaning no columns are grouped. Reset
19
+ * APIs use this value when `defaultState` is `true`.
19
20
  *
20
21
  * @example
21
22
  * ```ts
22
- * const initialValue = getDefaultGroupingState()
23
+ * const grouping = getDefaultGroupingState()
23
24
  * ```
24
25
  */
25
26
  export function getDefaultGroupingState(): GroupingState {
@@ -27,9 +28,10 @@ export function getDefaultGroupingState(): GroupingState {
27
28
  }
28
29
 
29
30
  /**
30
- * Toggles grouping for a column.
31
+ * Adds or removes this column id from the grouping state.
31
32
  *
32
- * The update is applied through the owning table state slice and respects the feature options for that column.
33
+ * Existing grouped columns keep their order. A column already present in
34
+ * `state.grouping` is removed; otherwise it is appended.
33
35
  *
34
36
  * @example
35
37
  * ```ts
@@ -52,13 +54,14 @@ export function column_toggleGrouping<
52
54
  }
53
55
 
54
56
  /**
55
- * Returns whether a column can use group.
57
+ * Checks whether this column can be used for grouping.
56
58
  *
57
- * This combines column options, table options, and any required accessor or feature state for the capability.
59
+ * Grouping must be enabled at the column and table level, and the column must
60
+ * either have an accessor or provide `getGroupingValue`.
58
61
  *
59
62
  * @example
60
63
  * ```ts
61
- * const value = column_getCanGroup(column)
64
+ * const canGroup = column_getCanGroup(column)
62
65
  * ```
63
66
  */
64
67
  export function column_getCanGroup<
@@ -74,13 +77,14 @@ export function column_getCanGroup<
74
77
  }
75
78
 
76
79
  /**
77
- * Returns is grouped for a column.
80
+ * Checks whether this column id is present in `state.grouping`.
78
81
  *
79
- * This derives the value from the column definition, table options, and the feature state atoms registered on the table.
82
+ * The result only reflects grouping state, not whether the grouped row model has
83
+ * been calculated yet.
80
84
  *
81
85
  * @example
82
86
  * ```ts
83
- * const value = column_getIsGrouped(column)
87
+ * const isGrouped = column_getIsGrouped(column)
84
88
  * ```
85
89
  */
86
90
  export function column_getIsGrouped<
@@ -92,13 +96,13 @@ export function column_getIsGrouped<
92
96
  }
93
97
 
94
98
  /**
95
- * Returns grouped index for a column.
99
+ * Finds this column's position in the ordered grouping state.
96
100
  *
97
- * This derives the value from the column definition, table options, and the feature state atoms registered on the table.
101
+ * The result is `-1` when the column is not grouped.
98
102
  *
99
103
  * @example
100
104
  * ```ts
101
- * const value = column_getGroupedIndex(column)
105
+ * const index = column_getGroupedIndex(column)
102
106
  * ```
103
107
  */
104
108
  export function column_getGroupedIndex<
@@ -110,13 +114,13 @@ export function column_getGroupedIndex<
110
114
  }
111
115
 
112
116
  /**
113
- * Returns an event handler for toggling grouping handler.
117
+ * Creates a header/control handler that toggles grouping for this column.
114
118
  *
115
- * The handler is intended for direct use in column header controls such as buttons or checkboxes.
119
+ * The handler is a no-op when `column_getCanGroup(column)` is false.
116
120
  *
117
121
  * @example
118
122
  * ```ts
119
- * const value = column_getToggleGroupingHandler(column)
123
+ * const onClick = column_getToggleGroupingHandler(column)
120
124
  * ```
121
125
  */
122
126
  export function column_getToggleGroupingHandler<
@@ -133,13 +137,14 @@ export function column_getToggleGroupingHandler<
133
137
  }
134
138
 
135
139
  /**
136
- * Infers aggregation fn for a column.
140
+ * Chooses a built-in aggregation function from the first core row value.
137
141
  *
138
- * The inference uses the column definition, table options, and sampled row values when needed.
142
+ * Numeric columns default to `sum`, date-like values default to `extent`, and
143
+ * other value types leave aggregation unspecified.
139
144
  *
140
145
  * @example
141
146
  * ```ts
142
- * const value = column_getAutoAggregationFn(column)
147
+ * const aggregationFn = column_getAutoAggregationFn(column)
143
148
  * ```
144
149
  */
145
150
  export function column_getAutoAggregationFn<
@@ -165,13 +170,15 @@ export function column_getAutoAggregationFn<
165
170
  }
166
171
 
167
172
  /**
168
- * Returns aggregation fn for a column.
173
+ * Resolves the aggregation function configured for a column.
169
174
  *
170
- * This derives the value from the column definition, table options, and the feature state atoms registered on the table.
175
+ * Function-valued `columnDef.aggregationFn` is returned directly, `'auto'`
176
+ * delegates to `column_getAutoAggregationFn`, and string values are looked up in
177
+ * the table's aggregation function registry.
171
178
  *
172
179
  * @example
173
180
  * ```ts
174
- * const value = column_getAggregationFn(column)
181
+ * const aggregationFn = column_getAggregationFn(column)
175
182
  * ```
176
183
  */
177
184
  export function column_getAggregationFn<
@@ -191,13 +198,14 @@ export function column_getAggregationFn<
191
198
  }
192
199
 
193
200
  /**
194
- * Updates the table's grouping state slice.
201
+ * Routes a grouping updater through the table's grouping change handler.
195
202
  *
196
- * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
203
+ * The updater may be a next `GroupingState` array or a function of the previous
204
+ * grouping state, matching the instance `table.setGrouping` behavior.
197
205
  *
198
206
  * @example
199
207
  * ```ts
200
- * table_setGrouping(table, (old) => old)
208
+ * table_setGrouping(table, (old) => [...old, 'status'])
201
209
  * ```
202
210
  */
203
211
  export function table_setGrouping<
@@ -208,9 +216,10 @@ export function table_setGrouping<
208
216
  }
209
217
 
210
218
  /**
211
- * Resets the table's grouping state slice.
219
+ * Resets `grouping` to the configured initial state or feature default.
212
220
  *
213
- * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
221
+ * With no argument, the reset clones `table.initialState.grouping` when it
222
+ * exists. Passing `true` ignores initial state and resets to `[]`.
214
223
  *
215
224
  * @example
216
225
  * ```ts
@@ -229,13 +238,13 @@ export function table_resetGrouping<
229
238
  }
230
239
 
231
240
  /**
232
- * Returns is grouped for a row.
241
+ * Checks whether this row was created as a grouped row.
233
242
  *
234
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
243
+ * Grouped rows carry a `groupingColumnId`; ordinary leaf rows do not.
235
244
  *
236
245
  * @example
237
246
  * ```ts
238
- * const value = row_getIsGrouped(row)
247
+ * const isGrouped = row_getIsGrouped(row)
239
248
  * ```
240
249
  */
241
250
  export function row_getIsGrouped<
@@ -246,13 +255,14 @@ export function row_getIsGrouped<
246
255
  }
247
256
 
248
257
  /**
249
- * Returns grouping value for a row.
258
+ * Reads and caches this row's grouping value for a column.
250
259
  *
251
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
260
+ * `columnDef.getGroupingValue` wins when provided; otherwise the normal row
261
+ * accessor value is used.
252
262
  *
253
263
  * @example
254
264
  * ```ts
255
- * const value = row_getGroupingValue(row)
265
+ * const groupValue = row_getGroupingValue(row, 'status')
256
266
  * ```
257
267
  */
258
268
  export function row_getGroupingValue<
@@ -282,13 +292,13 @@ export function row_getGroupingValue<
282
292
  }
283
293
 
284
294
  /**
285
- * Returns is grouped for a cell.
295
+ * Checks whether this cell represents the grouped column for a grouped row.
286
296
  *
287
- * This is the static implementation behind the matching cell instance API and uses the owning row and column context.
297
+ * This is the cell that usually renders the grouped value and expansion control.
288
298
  *
289
299
  * @example
290
300
  * ```ts
291
- * const value = cell_getIsGrouped(cell)
301
+ * const isGroupedCell = cell_getIsGrouped(cell)
292
302
  * ```
293
303
  */
294
304
  export function cell_getIsGrouped<
@@ -303,13 +313,14 @@ export function cell_getIsGrouped<
303
313
  }
304
314
 
305
315
  /**
306
- * Returns is placeholder for a cell.
316
+ * Checks whether this cell is a placeholder hidden by grouping.
307
317
  *
308
- * This is the static implementation behind the matching cell instance API and uses the owning row and column context.
318
+ * Placeholder cells belong to grouped columns other than the row's active
319
+ * grouping column.
309
320
  *
310
321
  * @example
311
322
  * ```ts
312
- * const value = cell_getIsPlaceholder(cell)
323
+ * const isPlaceholder = cell_getIsPlaceholder(cell)
313
324
  * ```
314
325
  */
315
326
  export function cell_getIsPlaceholder<
@@ -321,13 +332,14 @@ export function cell_getIsPlaceholder<
321
332
  }
322
333
 
323
334
  /**
324
- * Returns is aggregated for a cell.
335
+ * Checks whether this cell should render an aggregated value.
325
336
  *
326
- * This is the static implementation behind the matching cell instance API and uses the owning row and column context.
337
+ * Aggregated cells are non-placeholder, non-grouped cells on rows that have
338
+ * subRows.
327
339
  *
328
340
  * @example
329
341
  * ```ts
330
- * const value = cell_getIsAggregated(cell)
342
+ * const isAggregated = cell_getIsAggregated(cell)
331
343
  * ```
332
344
  */
333
345
  export function cell_getIsAggregated<
@@ -19,15 +19,22 @@ export interface TableOptions_ColumnOrdering {
19
19
 
20
20
  export interface Column_ColumnOrdering {
21
21
  /**
22
- * Returns the index of the column in the order of the visible columns. Optionally pass a `position` parameter to get the index of the column in a sub-section of the table
22
+ * Finds this column's zero-based index among visible columns.
23
+ *
24
+ * Pass `'left'`, `'center'`, or `'right'` to measure within that pinned
25
+ * region instead of the full visible leaf order.
23
26
  */
24
27
  getIndex: (position?: ColumnPinningPosition | 'center') => number
25
28
  /**
26
- * Returns `true` if the column is the first column in the order of the visible columns. Optionally pass a `position` parameter to check if the column is the first in a sub-section of the table.
29
+ * Checks whether this column is the first visible column.
30
+ *
31
+ * Pass a pinned region to check the first column within that region.
27
32
  */
28
33
  getIsFirstColumn: (position?: ColumnPinningPosition | 'center') => boolean
29
34
  /**
30
- * Returns `true` if the column is the last column in the order of the visible columns. Optionally pass a `position` parameter to check if the column is the last in a sub-section of the table.
35
+ * Checks whether this column is the last visible column.
36
+ *
37
+ * Pass a pinned region to check the last column within that region.
31
38
  */
32
39
  getIsLastColumn: (position?: ColumnPinningPosition | 'center') => boolean
33
40
  }
@@ -41,11 +48,13 @@ export interface Table_ColumnOrdering<
41
48
  TData extends RowData,
42
49
  > {
43
50
  /**
44
- * Resets the **columnOrder** state to `initialState.columnOrder`, or `true` can be passed to force a default blank state reset to `[]`.
51
+ * Resets `columnOrder` to `initialState.columnOrder`.
52
+ *
53
+ * Pass `true` to ignore initial state and reset to `[]`.
45
54
  */
46
55
  resetColumnOrder: (defaultState?: boolean) => void
47
56
  /**
48
- * Sets column order state using a value or updater.
57
+ * Updates column order state with a next ordered id array or updater function.
49
58
  */
50
59
  setColumnOrder: (updater: Updater<ColumnOrderState>) => void
51
60
  }
@@ -9,13 +9,14 @@ import type { ColumnPinningPosition } from '../column-pinning/columnPinningFeatu
9
9
  import type { ColumnOrderState } from './columnOrderingFeature.types'
10
10
 
11
11
  /**
12
- * Returns the default column order state.
12
+ * Creates the default column order state.
13
13
  *
14
- * Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
14
+ * The feature default is an empty array, meaning leaf columns keep their natural
15
+ * definition order. Reset APIs use this value when `defaultState` is `true`.
15
16
  *
16
17
  * @example
17
18
  * ```ts
18
- * const initialValue = getDefaultColumnOrderState()
19
+ * const order = getDefaultColumnOrderState()
19
20
  * ```
20
21
  */
21
22
  export function getDefaultColumnOrderState(): ColumnOrderState {
@@ -23,13 +24,14 @@ export function getDefaultColumnOrderState(): ColumnOrderState {
23
24
  }
24
25
 
25
26
  /**
26
- * Returns index for a column.
27
+ * Finds this column's index within a visible pinning region.
27
28
  *
28
- * This derives the value from the column definition, table options, and the feature state atoms registered on the table.
29
+ * Pass `'left'`, `'center'`, or `'right'` to search that region; omit the
30
+ * position to search the full visible leaf column list.
29
31
  *
30
32
  * @example
31
33
  * ```ts
32
- * const value = column_getIndex(column)
34
+ * const index = column_getIndex(column, 'center')
33
35
  * ```
34
36
  */
35
37
  export function column_getIndex<
@@ -45,13 +47,13 @@ export function column_getIndex<
45
47
  }
46
48
 
47
49
  /**
48
- * Returns is first column for a column.
50
+ * Checks whether this column is the first visible column in a pinning region.
49
51
  *
50
- * This derives the value from the column definition, table options, and the feature state atoms registered on the table.
52
+ * The same `position` semantics as `column_getIndex` apply.
51
53
  *
52
54
  * @example
53
55
  * ```ts
54
- * const value = column_getIsFirstColumn(column)
56
+ * const isFirst = column_getIsFirstColumn(column, 'left')
55
57
  * ```
56
58
  */
57
59
  export function column_getIsFirstColumn<
@@ -67,13 +69,13 @@ export function column_getIsFirstColumn<
67
69
  }
68
70
 
69
71
  /**
70
- * Returns is last column for a column.
72
+ * Checks whether this column is the last visible column in a pinning region.
71
73
  *
72
- * This derives the value from the column definition, table options, and the feature state atoms registered on the table.
74
+ * The same `position` semantics as `column_getIndex` apply.
73
75
  *
74
76
  * @example
75
77
  * ```ts
76
- * const value = column_getIsLastColumn(column)
78
+ * const isLast = column_getIsLastColumn(column, 'right')
77
79
  * ```
78
80
  */
79
81
  export function column_getIsLastColumn<
@@ -89,13 +91,14 @@ export function column_getIsLastColumn<
89
91
  }
90
92
 
91
93
  /**
92
- * Updates the table's column order state slice.
94
+ * Routes a column order updater through the table's column-order change handler.
93
95
  *
94
- * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
96
+ * The updater may be a next ordered id array or a function of the previous
97
+ * array, matching the instance `table.setColumnOrder` behavior.
95
98
  *
96
99
  * @example
97
100
  * ```ts
98
- * table_setColumnOrder(table, (old) => old)
101
+ * table_setColumnOrder(table, ['firstName', 'lastName', 'age'])
99
102
  * ```
100
103
  */
101
104
  export function table_setColumnOrder<
@@ -106,9 +109,10 @@ export function table_setColumnOrder<
106
109
  }
107
110
 
108
111
  /**
109
- * Resets the table's column order state slice.
112
+ * Resets `columnOrder` to the configured initial state or feature default.
110
113
  *
111
- * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
114
+ * With no argument, the reset clones `table.initialState.columnOrder` when it
115
+ * exists. Passing `true` ignores initial state and resets to `[]`.
112
116
  *
113
117
  * @example
114
118
  * ```ts
@@ -127,13 +131,14 @@ export function table_resetColumnOrder<
127
131
  }
128
132
 
129
133
  /**
130
- * Returns order columns fn for the table.
134
+ * Creates the ordering function used to arrange leaf columns.
131
135
  *
132
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
136
+ * The returned function applies `state.columnOrder`, preserves unspecified
137
+ * columns in their original order, then delegates to grouping rules.
133
138
  *
134
139
  * @example
135
140
  * ```ts
136
- * const value = table_getOrderColumnsFn(table)
141
+ * const orderColumnsForTable = table_getOrderColumnsFn(table)
137
142
  * ```
138
143
  */
139
144
  export function table_getOrderColumnsFn<
@@ -184,13 +189,15 @@ export function table_getOrderColumnsFn<
184
189
  }
185
190
 
186
191
  /**
187
- * Orders leaf columns with manual ordering, grouping, and pinning rules.
192
+ * Applies grouped-column placement rules to an already ordered leaf-column list.
188
193
  *
189
- * This helper is used by the column ordering feature to produce the final visible column order.
194
+ * `groupedColumnMode: 'remove'` drops grouped columns from the list.
195
+ * `groupedColumnMode: 'reorder'` moves grouped columns to the front in grouping
196
+ * state order.
190
197
  *
191
198
  * @example
192
199
  * ```ts
193
- * const orderedColumns = orderColumns(leafColumns, columnOrder, grouping, groupedColumnMode)
200
+ * const orderedColumns = orderColumns(table, leafColumns)
194
201
  * ```
195
202
  */
196
203
  export function orderColumns<
@@ -18,7 +18,10 @@ export interface TableState_ColumnPinning {
18
18
 
19
19
  export interface TableOptions_ColumnPinning {
20
20
  /**
21
- * Enables/disables column pinning for the table. Defaults to `true`.
21
+ * Allows columns to be pinned into left and right regions.
22
+ *
23
+ * Defaults to `true`; column-level `enablePinning` can still opt individual
24
+ * columns out.
22
25
  */
23
26
  enableColumnPinning?: boolean
24
27
  /**
@@ -35,26 +38,30 @@ export interface ColumnPinningDefaultOptions {
35
38
 
36
39
  export interface ColumnDef_ColumnPinning {
37
40
  /**
38
- * Enables/disables column pinning for this column. Defaults to `true`.
41
+ * Allows this column's leaf columns to be pinned.
42
+ *
43
+ * Defaults to `true`; table-level `enableColumnPinning` must also allow
44
+ * pinning.
39
45
  */
40
46
  enablePinning?: boolean
41
47
  }
42
48
 
43
49
  export interface Column_ColumnPinning {
44
50
  /**
45
- * Returns whether or not the column can be pinned.
51
+ * Checks whether this column or any of its leaves can be pinned.
46
52
  */
47
53
  getCanPin: () => boolean
48
54
  /**
49
- * Returns the pinned position of the column. (`'left'`, `'right'` or `false`)
55
+ * Reads the column's pinned position: `'left'`, `'right'`, or `false`.
50
56
  */
51
57
  getIsPinned: () => ColumnPinningPosition
52
58
  /**
53
- * Returns the numeric pinned index of the column within a pinned column group.
59
+ * Finds this column's index within its pinned region.
54
60
  */
55
61
  getPinnedIndex: () => number
56
62
  /**
57
- * Pins a column to the `'left'` or `'right'`, or unpins the column to the center if `false` is passed.
63
+ * Pins this column's leaf columns left or right, or unpins them when `false`
64
+ * is passed.
58
65
  */
59
66
  pin: (position: ColumnPinningPosition) => void
60
67
  }
@@ -64,15 +71,15 @@ export interface Row_ColumnPinning<
64
71
  TData extends RowData,
65
72
  > {
66
73
  /**
67
- * Returns all center pinned (unpinned) leaf cells in the row.
74
+ * Gets visible row cells whose columns are not pinned left or right.
68
75
  */
69
76
  getCenterVisibleCells: () => Array<Cell<TFeatures, TData, unknown>>
70
77
  /**
71
- * Returns all left pinned leaf cells in the row.
78
+ * Gets visible row cells whose columns are pinned left.
72
79
  */
73
80
  getLeftVisibleCells: () => Array<Cell<TFeatures, TData, unknown>>
74
81
  /**
75
- * Returns all right pinned leaf cells in the row.
82
+ * Gets visible row cells whose columns are pinned right.
76
83
  */
77
84
  getRightVisibleCells: () => Array<Cell<TFeatures, TData, unknown>>
78
85
  }
@@ -82,87 +89,92 @@ export interface Table_ColumnPinning<
82
89
  TData extends RowData,
83
90
  > {
84
91
  /**
85
- * If pinning, returns headers for all columns that are not pinned, including parent headers.
92
+ * Builds flat center-region headers for columns that are not pinned,
93
+ * including parent headers.
86
94
  */
87
95
  getCenterFlatHeaders: () => Array<Header<TFeatures, TData, unknown>>
88
96
  /**
89
- * If pinning, returns the footer groups for columns that are not pinned.
97
+ * Builds footer groups for the center region of unpinned columns.
90
98
  */
91
99
  getCenterFooterGroups: () => Array<HeaderGroup<TFeatures, TData>>
92
100
  /**
93
- * If pinning, returns the header groups for columns that are not pinned.
101
+ * Builds header groups for the center region of unpinned columns.
94
102
  */
95
103
  getCenterHeaderGroups: () => Array<HeaderGroup<TFeatures, TData>>
96
104
  /**
97
- * Returns all center pinned (unpinned) leaf columns.
105
+ * Gets leaf columns that are not pinned left or right.
98
106
  */
99
107
  getCenterLeafColumns: () => Array<Column<TFeatures, TData, unknown>>
100
108
  /**
101
- * If pinning, returns headers for all columns that are not pinned, (not including parent headers).
109
+ * Builds center-region leaf headers for columns that are not pinned.
102
110
  */
103
111
  getCenterLeafHeaders: () => Array<Header<TFeatures, TData, unknown>>
104
112
  /**
105
- * If column pinning, returns a flat array of leaf-node columns that are visible in the unpinned/center portion of the table.
113
+ * Lists visible leaf columns in the unpinned center region.
106
114
  */
107
115
  getCenterVisibleLeafColumns: () => Array<Column<TFeatures, TData, unknown>>
108
116
  /**
109
- * Returns whether or not any columns are pinned. Optionally specify to only check for pinned columns in either the `left` or `right` position.
117
+ * Checks whether any columns are pinned, optionally limited to one side.
110
118
  */
111
119
  getIsSomeColumnsPinned: (position?: ColumnPinningPosition) => boolean
112
120
  /**
113
- * If pinning, returns headers for all left pinned columns in the table, including parent headers.
121
+ * Builds flat left-region headers for pinned columns, including parent
122
+ * headers.
114
123
  */
115
124
  getLeftFlatHeaders: () => Array<Header<TFeatures, TData, unknown>>
116
125
  /**
117
- * If pinning, returns the footer groups for the left pinned columns.
126
+ * Builds footer groups for left-pinned columns.
118
127
  */
119
128
  getLeftFooterGroups: () => Array<HeaderGroup<TFeatures, TData>>
120
129
  /**
121
- * If pinning, returns the header groups for the left pinned columns.
130
+ * Builds header groups for left-pinned columns.
122
131
  */
123
132
  getLeftHeaderGroups: () => Array<HeaderGroup<TFeatures, TData>>
124
133
  /**
125
- * Returns all left pinned leaf columns.
134
+ * Gets leaf columns pinned to the left region in pinning-state order.
126
135
  */
127
136
  getLeftLeafColumns: () => Array<Column<TFeatures, TData, unknown>>
128
137
  /**
129
- * If pinning, returns headers for all left pinned leaf columns in the table, (not including parent headers).
138
+ * Builds leaf headers for left-pinned columns.
130
139
  */
131
140
  getLeftLeafHeaders: () => Array<Header<TFeatures, TData, unknown>>
132
141
  /**
133
- * If column pinning, returns a flat array of leaf-node columns that are visible in the left portion of the table.
142
+ * Lists visible leaf columns in the left pinned region.
134
143
  */
135
144
  getLeftVisibleLeafColumns: () => Array<Column<TFeatures, TData, unknown>>
136
145
  /**
137
- * If pinning, returns headers for all right pinned columns in the table, including parent headers.
146
+ * Builds flat right-region headers for pinned columns, including parent
147
+ * headers.
138
148
  */
139
149
  getRightFlatHeaders: () => Array<Header<TFeatures, TData, unknown>>
140
150
  /**
141
- * If pinning, returns the footer groups for the right pinned columns.
151
+ * Builds footer groups for right-pinned columns.
142
152
  */
143
153
  getRightFooterGroups: () => Array<HeaderGroup<TFeatures, TData>>
144
154
  /**
145
- * If pinning, returns the header groups for the right pinned columns.
155
+ * Builds header groups for right-pinned columns.
146
156
  */
147
157
  getRightHeaderGroups: () => Array<HeaderGroup<TFeatures, TData>>
148
158
  /**
149
- * Returns all right pinned leaf columns.
159
+ * Gets leaf columns pinned to the right region in pinning-state order.
150
160
  */
151
161
  getRightLeafColumns: () => Array<Column<TFeatures, TData, unknown>>
152
162
  /**
153
- * If pinning, returns headers for all right pinned leaf columns in the table, (not including parent headers).
163
+ * Builds leaf headers for right-pinned columns.
154
164
  */
155
165
  getRightLeafHeaders: () => Array<Header<TFeatures, TData, unknown>>
156
166
  /**
157
- * If column pinning, returns a flat array of leaf-node columns that are visible in the right portion of the table.
167
+ * Lists visible leaf columns in the right pinned region.
158
168
  */
159
169
  getRightVisibleLeafColumns: () => Array<Column<TFeatures, TData, unknown>>
160
170
  /**
161
- * Resets the **columnPinning** state to `initialState.columnPinning`, or `true` can be passed to force a default blank state reset to `{ left: [], right: [], }`.
171
+ * Resets `columnPinning` to `initialState.columnPinning`.
172
+ *
173
+ * Pass `true` to ignore initial state and reset to empty left/right arrays.
162
174
  */
163
175
  resetColumnPinning: (defaultState?: boolean) => void
164
176
  /**
165
- * Sets column pinning state using a value or updater.
177
+ * Updates column pinning state with a next state or updater function.
166
178
  */
167
179
  setColumnPinning: (updater: Updater<ColumnPinningState>) => void
168
180
  /**
@@ -172,7 +184,7 @@ export interface Table_ColumnPinning<
172
184
  position: ColumnPinningPosition | 'center',
173
185
  ) => Array<Column<TFeatures, TData, unknown>>
174
186
  /**
175
- * Returns visible pinned leaf columns for the requested pinning region.
187
+ * Lists visible leaf columns for the requested pinning region.
176
188
  */
177
189
  getPinnedVisibleLeafColumns: (
178
190
  position: ColumnPinningPosition | 'center',