@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
@@ -12,13 +12,14 @@ import type {
12
12
  // State Utils
13
13
 
14
14
  /**
15
- * Returns the default row pinning state.
15
+ * Creates the default row pinning state.
16
16
  *
17
- * Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
17
+ * Both pinning regions start empty. Reset APIs use this value when
18
+ * `defaultState` is `true`.
18
19
  *
19
20
  * @example
20
21
  * ```ts
21
- * const initialValue = getDefaultRowPinningState()
22
+ * const pinning = getDefaultRowPinningState()
22
23
  * ```
23
24
  */
24
25
  export function getDefaultRowPinningState(): RowPinningState {
@@ -29,13 +30,14 @@ export function getDefaultRowPinningState(): RowPinningState {
29
30
  }
30
31
 
31
32
  /**
32
- * Updates the table's row pinning state slice.
33
+ * Routes a row pinning updater through the table's row-pinning change handler.
33
34
  *
34
- * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
35
+ * The updater may be a next `{ top, bottom }` state or a function of the
36
+ * previous state, matching the instance `table.setRowPinning` behavior.
35
37
  *
36
38
  * @example
37
39
  * ```ts
38
- * table_setRowPinning(table, (old) => old)
40
+ * table_setRowPinning(table, (old) => ({ ...old, top: [rowId] }))
39
41
  * ```
40
42
  */
41
43
  export function table_setRowPinning<
@@ -49,9 +51,11 @@ export function table_setRowPinning<
49
51
  }
50
52
 
51
53
  /**
52
- * Resets the table's row pinning state slice.
54
+ * Resets `rowPinning` to the configured initial state or feature default.
53
55
  *
54
- * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
56
+ * With no argument, the reset clones `table.initialState.rowPinning` when it
57
+ * exists. Passing `true` ignores initial state and resets to empty top/bottom
58
+ * arrays.
55
59
  *
56
60
  * @example
57
61
  * ```ts
@@ -76,13 +80,14 @@ export function table_resetRowPinning<
76
80
  // Table Utils
77
81
 
78
82
  /**
79
- * Returns is some rows pinned for the table.
83
+ * Checks whether any rows are pinned.
80
84
  *
81
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
85
+ * Omit `position` to check both regions, or pass `'top'`/`'bottom'` to inspect
86
+ * one region.
82
87
  *
83
88
  * @example
84
89
  * ```ts
85
- * const value = table_getIsSomeRowsPinned(table)
90
+ * const hasPinnedRows = table_getIsSomeRowsPinned(table)
86
91
  * ```
87
92
  */
88
93
  export function table_getIsSomeRowsPinned<
@@ -109,36 +114,39 @@ function table_getPinnedRows<
109
114
  ): Array<Row<TFeatures, TData>> {
110
115
  const visibleRows = table.getRowModel().rows
111
116
  const pinnedRowIds = table.atoms.rowPinning?.get()?.[position] ?? []
117
+ const keepPinnedRows = table.options.keepPinnedRows ?? true
112
118
 
113
- const rows =
114
- (table.options.keepPinnedRows ?? true)
115
- ? // get all rows that are pinned even if they would not be otherwise visible
116
- // account for expanded parent rows, but not pagination or filtering
117
- pinnedRowIds.map((rowId) => {
118
- const row = table.getRow(rowId, true)
119
- return row_getIsAllParentsExpanded(row) ? row : null
120
- })
121
- : // else get only visible rows that are pinned
122
- pinnedRowIds.map(
123
- (rowId) => visibleRows.find((row) => row.id === rowId)!,
124
- )
125
-
126
- const filteredRows = rows.filter((r) => !!r)
127
- // Assign position property directly to preserve prototype chain
128
- filteredRows.forEach((row) => {
119
+ const result: Array<Row<TFeatures, TData>> = []
120
+ for (let i = 0; i < pinnedRowIds.length; i++) {
121
+ const rowId = pinnedRowIds[i]!
122
+ let row: Row<TFeatures, TData> | undefined
123
+ if (keepPinnedRows) {
124
+ // get all rows that are pinned even if they would not be otherwise
125
+ // visible; account for expanded parent rows, but not pagination/filtering
126
+ const fullRow = table.getRow(rowId, true)
127
+ if (row_getIsAllParentsExpanded(fullRow)) row = fullRow
128
+ } else {
129
+ // else get only visible rows that are pinned
130
+ row = visibleRows.find((r) => r.id === rowId)
131
+ }
132
+ if (!row)
133
+ continue
134
+ // Assign position property directly to preserve prototype chain
129
135
  ;(row as any).position = position
130
- })
131
- return filteredRows
136
+ result.push(row)
137
+ }
138
+ return result
132
139
  }
133
140
 
134
141
  /**
135
- * Returns top rows for the table.
142
+ * Resolves the visible rows pinned to the top region.
136
143
  *
137
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
144
+ * The result follows `state.rowPinning.top` order and marks each row with
145
+ * `position = 'top'`.
138
146
  *
139
147
  * @example
140
148
  * ```ts
141
- * const value = table_getTopRows(table)
149
+ * const rows = table_getTopRows(table)
142
150
  * ```
143
151
  */
144
152
  export function table_getTopRows<
@@ -149,13 +157,14 @@ export function table_getTopRows<
149
157
  }
150
158
 
151
159
  /**
152
- * Returns bottom rows for the table.
160
+ * Resolves the visible rows pinned to the bottom region.
153
161
  *
154
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
162
+ * The result follows `state.rowPinning.bottom` order and marks each row with
163
+ * `position = 'bottom'`.
155
164
  *
156
165
  * @example
157
166
  * ```ts
158
- * const value = table_getBottomRows(table)
167
+ * const rows = table_getBottomRows(table)
159
168
  * ```
160
169
  */
161
170
  export function table_getBottomRows<
@@ -166,13 +175,14 @@ export function table_getBottomRows<
166
175
  }
167
176
 
168
177
  /**
169
- * Returns center rows for the table.
178
+ * Resolves rows that are not pinned to top or bottom.
170
179
  *
171
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
180
+ * The current row model is filtered by `state.rowPinning.top` and
181
+ * `state.rowPinning.bottom`.
172
182
  *
173
183
  * @example
174
184
  * ```ts
175
- * const value = table_getCenterRows(table)
185
+ * const rows = table_getCenterRows(table)
176
186
  * ```
177
187
  */
178
188
  export function table_getCenterRows<
@@ -190,13 +200,14 @@ export function table_getCenterRows<
190
200
  // Row Utils
191
201
 
192
202
  /**
193
- * Returns whether a row can use pin.
203
+ * Checks whether this row can be pinned.
194
204
  *
195
- * This evaluates row data, table options, and feature-specific enablement rules.
205
+ * `options.enableRowPinning` may be a boolean or a row predicate; it defaults
206
+ * to `true`.
196
207
  *
197
208
  * @example
198
209
  * ```ts
199
- * const value = row_getCanPin(row)
210
+ * const canPin = row_getCanPin(row)
200
211
  * ```
201
212
  */
202
213
  export function row_getCanPin<
@@ -211,13 +222,14 @@ export function row_getCanPin<
211
222
  }
212
223
 
213
224
  /**
214
- * Returns is pinned for a row.
225
+ * Reads this row's current pinning region.
215
226
  *
216
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
227
+ * Rows listed in `state.rowPinning.top` return `'top'`, rows listed in
228
+ * `bottom` return `'bottom'`, and unpinned rows return `false`.
217
229
  *
218
230
  * @example
219
231
  * ```ts
220
- * const value = row_getIsPinned(row)
232
+ * const position = row_getIsPinned(row)
221
233
  * ```
222
234
  */
223
235
  export function row_getIsPinned<
@@ -235,13 +247,13 @@ export function row_getIsPinned<
235
247
  }
236
248
 
237
249
  /**
238
- * Returns pinned index for a row.
250
+ * Finds this row's visible index within its pinned region.
239
251
  *
240
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
252
+ * Unpinned rows return `-1`.
241
253
  *
242
254
  * @example
243
255
  * ```ts
244
- * const value = row_getPinnedIndex(row)
256
+ * const index = row_getPinnedIndex(row)
245
257
  * ```
246
258
  */
247
259
  export function row_getPinnedIndex<
@@ -14,18 +14,22 @@ export interface TableOptions_RowSelection<
14
14
  TData extends RowData,
15
15
  > {
16
16
  /**
17
- * - Enables/disables multiple row selection for all rows in the table OR
18
- * - A function that given a row, returns whether to enable/disable multiple row selection for that row's children/grandchildren
17
+ * Allows rows to be selected alongside other rows.
18
+ *
19
+ * Provide a predicate to decide per row. Defaults to `true`.
19
20
  */
20
21
  enableMultiRowSelection?: boolean | ((row: Row<TFeatures, TData>) => boolean)
21
22
  /**
22
- * - Enables/disables row selection for all rows in the table OR
23
- * - A function that given a row, returns whether to enable/disable row selection for that row
23
+ * Allows rows to be selected.
24
+ *
25
+ * Provide a predicate to decide per row. Defaults to `true`.
24
26
  */
25
27
  enableRowSelection?: boolean | ((row: Row<TFeatures, TData>) => boolean)
26
28
  /**
27
- * Enables/disables automatic sub-row selection when a parent row is selected, or a function that enables/disables automatic sub-row selection for each row.
28
- * (Use in combination with expanding or grouping features)
29
+ * Controls whether selecting a parent row also selects its subRows.
30
+ *
31
+ * Provide a predicate to decide per row. This is most useful with expanding or
32
+ * grouping features and defaults to `true`.
29
33
  */
30
34
  enableSubRowSelection?: boolean | ((row: Row<TFeatures, TData>) => boolean)
31
35
  /**
@@ -49,31 +53,31 @@ export interface TableOptions_RowSelection<
49
53
 
50
54
  export interface Row_RowSelection {
51
55
  /**
52
- * Returns whether or not the row can multi-select.
56
+ * Checks whether this row can be selected alongside other rows.
53
57
  */
54
58
  getCanMultiSelect: () => boolean
55
59
  /**
56
- * Returns whether or not the row can be selected.
60
+ * Checks whether this row can currently be selected.
57
61
  */
58
62
  getCanSelect: () => boolean
59
63
  /**
60
- * Returns whether or not the row can select sub rows automatically when the parent row is selected.
64
+ * Checks whether selecting this row should also select its subRows.
61
65
  */
62
66
  getCanSelectSubRows: () => boolean
63
67
  /**
64
- * Returns whether or not all of the row's sub rows are selected.
68
+ * Checks whether all selectable descendants are selected.
65
69
  */
66
70
  getIsAllSubRowsSelected: () => boolean
67
71
  /**
68
- * Returns whether or not the row is selected.
72
+ * Checks whether this row id is selected.
69
73
  */
70
74
  getIsSelected: () => boolean
71
75
  /**
72
- * Returns whether or not some of the row's sub rows are selected.
76
+ * Checks whether some selectable descendants are selected.
73
77
  */
74
78
  getIsSomeSelected: () => boolean
75
79
  /**
76
- * Returns a handler that can be used to toggle the row.
80
+ * Creates a checkbox-style handler that toggles this row's selected state.
77
81
  */
78
82
  getToggleSelectedHandler: () => (event: unknown) => void
79
83
  /**
@@ -87,27 +91,27 @@ export interface Table_RowSelection<
87
91
  TData extends RowData,
88
92
  > {
89
93
  /**
90
- * Returns the row model of all rows that are selected after filtering has been applied.
94
+ * Builds a selected-row model from rows after filtering.
91
95
  */
92
96
  getFilteredSelectedRowModel: () => RowModel<TFeatures, TData>
93
97
  /**
94
- * Returns the row model of all rows that are selected after grouping has been applied.
98
+ * Builds a selected-row model from rows after grouping.
95
99
  */
96
100
  getGroupedSelectedRowModel: () => RowModel<TFeatures, TData>
97
101
  /**
98
- * Returns whether or not all rows on the current page are selected.
102
+ * Checks whether every selectable row on the current page is selected.
99
103
  */
100
104
  getIsAllPageRowsSelected: () => boolean
101
105
  /**
102
- * Returns whether or not all rows in the table are selected.
106
+ * Checks whether every selectable filtered row is selected.
103
107
  */
104
108
  getIsAllRowsSelected: () => boolean
105
109
  /**
106
- * Returns whether or not any rows on the current page are selected.
110
+ * Checks whether the current page has a partial row selection.
107
111
  */
108
112
  getIsSomePageRowsSelected: () => boolean
109
113
  /**
110
- * Returns whether or not any rows in the table are selected.
114
+ * Checks whether filtered rows have a partial row selection.
111
115
  */
112
116
  getIsSomeRowsSelected: () => boolean
113
117
  /**
@@ -115,23 +119,25 @@ export interface Table_RowSelection<
115
119
  */
116
120
  getPreSelectedRowModel: () => RowModel<TFeatures, TData>
117
121
  /**
118
- * Returns the row model of all rows that are selected.
122
+ * Builds a selected-row model from the core row model.
119
123
  */
120
124
  getSelectedRowModel: () => RowModel<TFeatures, TData>
121
125
  /**
122
- * Returns a handler that can be used to toggle all rows on the current page.
126
+ * Creates a checkbox-style handler that toggles all current-page rows.
123
127
  */
124
128
  getToggleAllPageRowsSelectedHandler: () => (event: unknown) => void
125
129
  /**
126
- * Returns a handler that can be used to toggle all rows in the table.
130
+ * Creates a checkbox-style handler that toggles all selectable rows.
127
131
  */
128
132
  getToggleAllRowsSelectedHandler: () => (event: unknown) => void
129
133
  /**
130
- * Resets the **rowSelection** state to the `initialState.rowSelection`, or `true` can be passed to force a default blank state reset to `{}`.
134
+ * Resets `rowSelection` to `initialState.rowSelection`.
135
+ *
136
+ * Pass `true` to ignore initial state and reset to `{}`.
131
137
  */
132
138
  resetRowSelection: (defaultState?: boolean) => void
133
139
  /**
134
- * Sets row selection state using a value or updater.
140
+ * Updates row selection state with a next map or updater function.
135
141
  */
136
142
  setRowSelection: (updater: Updater<RowSelectionState>) => void
137
143
  /**