@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
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  column_getIsVisible,
3
3
  row_getVisibleCells,
4
+ row_getVisibleCellsByColumnId,
4
5
  table_getVisibleLeafColumns,
5
6
  } from '../column-visibility/columnVisibilityFeature.utils'
6
7
  import { buildHeaderGroups } from '../../core/headers/buildHeaderGroups'
7
8
  import { callMemoOrStaticFn, cloneState } from '../../utils'
9
+ import type { Header } from '../../types/Header'
8
10
  import type { HeaderGroup } from '../../types/HeaderGroup'
9
11
  import type { Cell } from '../../types/Cell'
10
12
  import type { Row } from '../../types/Row'
@@ -20,13 +22,14 @@ import type {
20
22
  // State
21
23
 
22
24
  /**
23
- * Returns the default column pinning state.
25
+ * Creates the default column pinning state.
24
26
  *
25
- * Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
27
+ * Both pinning regions start empty. Reset APIs use this value when
28
+ * `defaultState` is `true`.
26
29
  *
27
30
  * @example
28
31
  * ```ts
29
- * const initialValue = getDefaultColumnPinningState()
32
+ * const pinning = getDefaultColumnPinningState()
30
33
  * ```
31
34
  */
32
35
  export function getDefaultColumnPinningState(): ColumnPinningState {
@@ -39,9 +42,11 @@ export function getDefaultColumnPinningState(): ColumnPinningState {
39
42
  // Column APIs
40
43
 
41
44
  /**
42
- * Pin. for a column.
45
+ * Moves this column's leaf column ids into a pinning region.
43
46
  *
44
- * This is the static implementation behind the matching column instance API.
47
+ * Pinning a group column pins all of its leaves. The leaf ids are first removed
48
+ * from both regions, then appended to the requested `'left'` or `'right'`
49
+ * region. Passing `false` unpins them back to the center.
45
50
  *
46
51
  * @example
47
52
  * ```ts
@@ -56,10 +61,13 @@ export function column_pin<
56
61
  column: Column_Internal<TFeatures, TData, TValue>,
57
62
  position: ColumnPinningPosition,
58
63
  ) {
59
- const columnIds = column
60
- .getLeafColumns()
61
- .map((d) => d.id)
62
- .filter(Boolean)
64
+ // Single pass: collect non-empty leaf-column ids.
65
+ const leafColumns = column.getLeafColumns()
66
+ const columnIds: Array<string> = []
67
+ for (let i = 0; i < leafColumns.length; i++) {
68
+ const id = leafColumns[i]!.id
69
+ if (id) columnIds.push(id)
70
+ }
63
71
 
64
72
  table_setColumnPinning(column.table, (old) => {
65
73
  if (position === 'right') {
@@ -87,13 +95,14 @@ export function column_pin<
87
95
  }
88
96
 
89
97
  /**
90
- * Returns whether a column can use pin.
98
+ * Checks whether this column or any of its leaf columns can be pinned.
91
99
  *
92
- * This combines column options, table options, and any required accessor or feature state for the capability.
100
+ * Column-level `enablePinning` and table `enableColumnPinning` both default to
101
+ * `true`; at least one leaf column must allow pinning.
93
102
  *
94
103
  * @example
95
104
  * ```ts
96
- * const value = column_getCanPin(column)
105
+ * const canPin = column_getCanPin(column)
97
106
  * ```
98
107
  */
99
108
  export function column_getCanPin<
@@ -113,13 +122,14 @@ export function column_getCanPin<
113
122
  }
114
123
 
115
124
  /**
116
- * Returns is pinned for a column.
125
+ * Reads this column's current pinning region.
117
126
  *
118
- * This derives the value from the column definition, table options, and the feature state atoms registered on the table.
127
+ * Group columns report `'left'` or `'right'` when any leaf column is pinned in
128
+ * that region. Unpinned columns return `false`.
119
129
  *
120
130
  * @example
121
131
  * ```ts
122
- * const value = column_getIsPinned(column)
132
+ * const position = column_getIsPinned(column)
123
133
  * ```
124
134
  */
125
135
  export function column_getIsPinned<
@@ -141,13 +151,14 @@ export function column_getIsPinned<
141
151
  }
142
152
 
143
153
  /**
144
- * Returns pinned index for a column.
154
+ * Finds this column's index within its pinned region.
145
155
  *
146
- * This derives the value from the column definition, table options, and the feature state atoms registered on the table.
156
+ * Unpinned columns return `0`; pinned columns return their position in
157
+ * `state.columnPinning.left` or `state.columnPinning.right`.
147
158
  *
148
159
  * @example
149
160
  * ```ts
150
- * const value = column_getPinnedIndex(column)
161
+ * const index = column_getPinnedIndex(column)
151
162
  * ```
152
163
  */
153
164
  export function column_getPinnedIndex<
@@ -166,13 +177,13 @@ export function column_getPinnedIndex<
166
177
  // Row APIs
167
178
 
168
179
  /**
169
- * Returns center visible cells for a row.
180
+ * Collects visible cells whose columns are not pinned left or right.
170
181
  *
171
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
182
+ * The result preserves the row's visible-cell order for center columns.
172
183
  *
173
184
  * @example
174
185
  * ```ts
175
- * const value = row_getCenterVisibleCells(row)
186
+ * const centerCells = row_getCenterVisibleCells(row)
176
187
  * ```
177
188
  */
178
189
  export function row_getCenterVisibleCells<
@@ -191,13 +202,14 @@ export function row_getCenterVisibleCells<
191
202
  }
192
203
 
193
204
  /**
194
- * Returns left visible cells for a row.
205
+ * Collects visible cells for columns pinned to the left region.
195
206
  *
196
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
207
+ * Cells are returned in `state.columnPinning.left` order and are marked with
208
+ * `cell.position = 'left'`.
197
209
  *
198
210
  * @example
199
211
  * ```ts
200
- * const value = row_getLeftVisibleCells(row)
212
+ * const leftCells = row_getLeftVisibleCells(row)
201
213
  * ```
202
214
  */
203
215
  export function row_getLeftVisibleCells<
@@ -209,12 +221,13 @@ export function row_getLeftVisibleCells<
209
221
  if (!left.length) return []
210
222
  const allVisibleCells = callMemoOrStaticFn(
211
223
  row,
212
- 'getVisibleCells',
213
- row_getVisibleCells,
224
+ 'getVisibleCellsByColumnId',
225
+ row_getVisibleCellsByColumnId,
214
226
  )
215
- const cells: typeof allVisibleCells = []
216
- for (const columnId of left) {
217
- const cell = allVisibleCells.find((c) => c.column.id === columnId)
227
+ const cells: Array<Cell<TFeatures, TData, unknown>> = []
228
+ for (let i = 0; i < left.length; i++) {
229
+ const columnId = left[i]!
230
+ const cell = allVisibleCells[columnId]
218
231
  if (cell) {
219
232
  // Assign position property directly to preserve prototype chain
220
233
  cell.position = 'left'
@@ -225,13 +238,14 @@ export function row_getLeftVisibleCells<
225
238
  }
226
239
 
227
240
  /**
228
- * Returns right visible cells for a row.
241
+ * Collects visible cells for columns pinned to the right region.
229
242
  *
230
- * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
243
+ * Cells are returned in `state.columnPinning.right` order and are marked with
244
+ * `cell.position = 'right'`.
231
245
  *
232
246
  * @example
233
247
  * ```ts
234
- * const value = row_getRightVisibleCells(row)
248
+ * const rightCells = row_getRightVisibleCells(row)
235
249
  * ```
236
250
  */
237
251
  export function row_getRightVisibleCells<
@@ -243,12 +257,13 @@ export function row_getRightVisibleCells<
243
257
  if (!right.length) return [] as Array<Cell<TFeatures, TData, unknown>>
244
258
  const allVisibleCells = callMemoOrStaticFn(
245
259
  row,
246
- 'getVisibleCells',
247
- row_getVisibleCells,
260
+ 'getVisibleCellsByColumnId',
261
+ row_getVisibleCellsByColumnId,
248
262
  )
249
- const cells: typeof allVisibleCells = []
250
- for (const columnId of right) {
251
- const cell = allVisibleCells.find((c) => c.column.id === columnId)
263
+ const cells: Array<Cell<TFeatures, TData, unknown>> = []
264
+ for (let i = 0; i < right.length; i++) {
265
+ const columnId = right[i]!
266
+ const cell = allVisibleCells[columnId]
252
267
  if (cell) {
253
268
  // Assign position property directly to preserve prototype chain
254
269
  cell.position = 'right'
@@ -261,13 +276,14 @@ export function row_getRightVisibleCells<
261
276
  // Table APIs
262
277
 
263
278
  /**
264
- * Updates the table's column pinning state slice.
279
+ * Routes a column pinning updater through the table's pinning change handler.
265
280
  *
266
- * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
281
+ * The updater may be a next `{ left, right }` state or a function of the
282
+ * previous state, matching the instance `table.setColumnPinning` behavior.
267
283
  *
268
284
  * @example
269
285
  * ```ts
270
- * table_setColumnPinning(table, (old) => old)
286
+ * table_setColumnPinning(table, (old) => ({ ...old, left: ['select'] }))
271
287
  * ```
272
288
  */
273
289
  export function table_setColumnPinning<
@@ -281,9 +297,11 @@ export function table_setColumnPinning<
281
297
  }
282
298
 
283
299
  /**
284
- * Resets the table's column pinning state slice.
300
+ * Resets `columnPinning` to the configured initial state or feature default.
285
301
  *
286
- * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
302
+ * With no argument, the reset clones `table.initialState.columnPinning` when it
303
+ * exists. Passing `true` ignores initial state and resets to empty left/right
304
+ * arrays.
287
305
  *
288
306
  * @example
289
307
  * ```ts
@@ -306,13 +324,14 @@ export function table_resetColumnPinning<
306
324
  }
307
325
 
308
326
  /**
309
- * Returns is some columns pinned for the table.
327
+ * Checks whether any columns are pinned.
310
328
  *
311
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
329
+ * Omit `position` to check both sides, or pass `'left'`/`'right'` to inspect a
330
+ * single pinning region.
312
331
  *
313
332
  * @example
314
333
  * ```ts
315
- * const value = table_getIsSomeColumnsPinned(table)
334
+ * const hasPinnedColumns = table_getIsSomeColumnsPinned(table)
316
335
  * ```
317
336
  */
318
337
  export function table_getIsSomeColumnsPinned<
@@ -330,13 +349,14 @@ export function table_getIsSomeColumnsPinned<
330
349
  // header groups
331
350
 
332
351
  /**
333
- * Returns left header groups for the table.
352
+ * Builds header groups for visible columns pinned to the left region.
334
353
  *
335
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
354
+ * The leaf columns are read in `state.columnPinning.left` order and then passed
355
+ * through the same header-group builder as the unpinned table.
336
356
  *
337
357
  * @example
338
358
  * ```ts
339
- * const value = table_getLeftHeaderGroups(table)
359
+ * const headerGroups = table_getLeftHeaderGroups(table)
340
360
  * ```
341
361
  */
342
362
  export function table_getLeftHeaderGroups<
@@ -353,8 +373,8 @@ export function table_getLeftHeaderGroups<
353
373
 
354
374
  const orderedLeafColumns: Array<Column_Internal<TFeatures, TData, unknown>> =
355
375
  []
356
- for (const columnId of left) {
357
- const column = leafColumnsById[columnId]
376
+ for (let i = 0; i < left.length; i++) {
377
+ const column = leafColumnsById[left[i]!]
358
378
  if (
359
379
  column &&
360
380
  callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)
@@ -367,13 +387,14 @@ export function table_getLeftHeaderGroups<
367
387
  }
368
388
 
369
389
  /**
370
- * Returns right header groups for the table.
390
+ * Builds header groups for visible columns pinned to the right region.
371
391
  *
372
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
392
+ * The leaf columns are read in `state.columnPinning.right` order and then
393
+ * passed through the same header-group builder as the unpinned table.
373
394
  *
374
395
  * @example
375
396
  * ```ts
376
- * const value = table_getRightHeaderGroups(table)
397
+ * const headerGroups = table_getRightHeaderGroups(table)
377
398
  * ```
378
399
  */
379
400
  export function table_getRightHeaderGroups<
@@ -390,8 +411,8 @@ export function table_getRightHeaderGroups<
390
411
 
391
412
  const orderedLeafColumns: Array<Column_Internal<TFeatures, TData, unknown>> =
392
413
  []
393
- for (const columnId of right) {
394
- const column = leafColumnsById[columnId]
414
+ for (let i = 0; i < right.length; i++) {
415
+ const column = leafColumnsById[right[i]!]
395
416
  if (
396
417
  column &&
397
418
  callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)
@@ -404,13 +425,14 @@ export function table_getRightHeaderGroups<
404
425
  }
405
426
 
406
427
  /**
407
- * Returns center header groups for the table.
428
+ * Builds header groups for visible columns that are not pinned.
408
429
  *
409
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
430
+ * Left- and right-pinned column ids are removed from the visible leaf column
431
+ * list before header groups are built for the center region.
410
432
  *
411
433
  * @example
412
434
  * ```ts
413
- * const value = table_getCenterHeaderGroups(table)
435
+ * const headerGroups = table_getCenterHeaderGroups(table)
414
436
  * ```
415
437
  */
416
438
  export function table_getCenterHeaderGroups<
@@ -438,13 +460,13 @@ export function table_getCenterHeaderGroups<
438
460
  // footer groups
439
461
 
440
462
  /**
441
- * Returns left footer groups for the table.
463
+ * Builds footer groups for the left pinned region.
442
464
  *
443
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
465
+ * Footer groups reuse the left header groups in reverse order.
444
466
  *
445
467
  * @example
446
468
  * ```ts
447
- * const value = table_getLeftFooterGroups(table)
469
+ * const footerGroups = table_getLeftFooterGroups(table)
448
470
  * ```
449
471
  */
450
472
  export function table_getLeftFooterGroups<
@@ -460,13 +482,13 @@ export function table_getLeftFooterGroups<
460
482
  }
461
483
 
462
484
  /**
463
- * Returns right footer groups for the table.
485
+ * Builds footer groups for the right pinned region.
464
486
  *
465
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
487
+ * Footer groups reuse the right header groups in reverse order.
466
488
  *
467
489
  * @example
468
490
  * ```ts
469
- * const value = table_getRightFooterGroups(table)
491
+ * const footerGroups = table_getRightFooterGroups(table)
470
492
  * ```
471
493
  */
472
494
  export function table_getRightFooterGroups<
@@ -482,13 +504,13 @@ export function table_getRightFooterGroups<
482
504
  }
483
505
 
484
506
  /**
485
- * Returns center footer groups for the table.
507
+ * Builds footer groups for the center, unpinned region.
486
508
  *
487
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
509
+ * Footer groups reuse the center header groups in reverse order.
488
510
  *
489
511
  * @example
490
512
  * ```ts
491
- * const value = table_getCenterFooterGroups(table)
513
+ * const footerGroups = table_getCenterFooterGroups(table)
492
514
  * ```
493
515
  */
494
516
  export function table_getCenterFooterGroups<
@@ -506,13 +528,13 @@ export function table_getCenterFooterGroups<
506
528
  // flat headers
507
529
 
508
530
  /**
509
- * Returns left flat headers for the table.
531
+ * Flattens every header from the left pinned header groups.
510
532
  *
511
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
533
+ * Parent headers and placeholder headers are included.
512
534
  *
513
535
  * @example
514
536
  * ```ts
515
- * const value = table_getLeftFlatHeaders(table)
537
+ * const headers = table_getLeftFlatHeaders(table)
516
538
  * ```
517
539
  */
518
540
  export function table_getLeftFlatHeaders<
@@ -524,21 +546,24 @@ export function table_getLeftFlatHeaders<
524
546
  'getLeftHeaderGroups',
525
547
  table_getLeftHeaderGroups,
526
548
  )
527
- return leftHeaderGroups
528
- .map((headerGroup) => {
529
- return headerGroup.headers
530
- })
531
- .flat()
549
+ const result: Array<Header<TFeatures, TData, unknown>> = []
550
+ for (let i = 0; i < leftHeaderGroups.length; i++) {
551
+ const headers = leftHeaderGroups[i]!.headers
552
+ for (let j = 0; j < headers.length; j++) {
553
+ result.push(headers[j])
554
+ }
555
+ }
556
+ return result
532
557
  }
533
558
 
534
559
  /**
535
- * Returns right flat headers for the table.
560
+ * Flattens every header from the right pinned header groups.
536
561
  *
537
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
562
+ * Parent headers and placeholder headers are included.
538
563
  *
539
564
  * @example
540
565
  * ```ts
541
- * const value = table_getRightFlatHeaders(table)
566
+ * const headers = table_getRightFlatHeaders(table)
542
567
  * ```
543
568
  */
544
569
  export function table_getRightFlatHeaders<
@@ -550,21 +575,24 @@ export function table_getRightFlatHeaders<
550
575
  'getRightHeaderGroups',
551
576
  table_getRightHeaderGroups,
552
577
  )
553
- return rightHeaderGroups
554
- .map((headerGroup) => {
555
- return headerGroup.headers
556
- })
557
- .flat()
578
+ const result: Array<Header<TFeatures, TData, unknown>> = []
579
+ for (let i = 0; i < rightHeaderGroups.length; i++) {
580
+ const headers = rightHeaderGroups[i]!.headers
581
+ for (let j = 0; j < headers.length; j++) {
582
+ result.push(headers[j])
583
+ }
584
+ }
585
+ return result
558
586
  }
559
587
 
560
588
  /**
561
- * Returns center flat headers for the table.
589
+ * Flattens every header from the center header groups.
562
590
  *
563
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
591
+ * Parent headers and placeholder headers are included.
564
592
  *
565
593
  * @example
566
594
  * ```ts
567
- * const value = table_getCenterFlatHeaders(table)
595
+ * const headers = table_getCenterFlatHeaders(table)
568
596
  * ```
569
597
  */
570
598
  export function table_getCenterFlatHeaders<
@@ -576,23 +604,26 @@ export function table_getCenterFlatHeaders<
576
604
  'getCenterHeaderGroups',
577
605
  table_getCenterHeaderGroups,
578
606
  )
579
- return centerHeaderGroups
580
- .map((headerGroup) => {
581
- return headerGroup.headers
582
- })
583
- .flat()
607
+ const result: Array<Header<TFeatures, TData, unknown>> = []
608
+ for (let i = 0; i < centerHeaderGroups.length; i++) {
609
+ const headers = centerHeaderGroups[i]!.headers
610
+ for (let j = 0; j < headers.length; j++) {
611
+ result.push(headers[j])
612
+ }
613
+ }
614
+ return result
584
615
  }
585
616
 
586
617
  // leaf headers
587
618
 
588
619
  /**
589
- * Returns left leaf headers for the table.
620
+ * Collects leaf headers for the left pinned region.
590
621
  *
591
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
622
+ * Parent headers are filtered out from the left flat header list.
592
623
  *
593
624
  * @example
594
625
  * ```ts
595
- * const value = table_getLeftLeafHeaders(table)
626
+ * const headers = table_getLeftLeafHeaders(table)
596
627
  * ```
597
628
  */
598
629
  export function table_getLeftLeafHeaders<
@@ -607,13 +638,13 @@ export function table_getLeftLeafHeaders<
607
638
  }
608
639
 
609
640
  /**
610
- * Returns right leaf headers for the table.
641
+ * Collects leaf headers for the right pinned region.
611
642
  *
612
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
643
+ * Parent headers are filtered out from the right flat header list.
613
644
  *
614
645
  * @example
615
646
  * ```ts
616
- * const value = table_getRightLeafHeaders(table)
647
+ * const headers = table_getRightLeafHeaders(table)
617
648
  * ```
618
649
  */
619
650
  export function table_getRightLeafHeaders<
@@ -628,13 +659,13 @@ export function table_getRightLeafHeaders<
628
659
  }
629
660
 
630
661
  /**
631
- * Returns center leaf headers for the table.
662
+ * Collects leaf headers for the center, unpinned region.
632
663
  *
633
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
664
+ * Parent headers are filtered out from the center flat header list.
634
665
  *
635
666
  * @example
636
667
  * ```ts
637
- * const value = table_getCenterLeafHeaders(table)
668
+ * const headers = table_getCenterLeafHeaders(table)
638
669
  * ```
639
670
  */
640
671
  export function table_getCenterLeafHeaders<
@@ -651,13 +682,14 @@ export function table_getCenterLeafHeaders<
651
682
  // leaf columns
652
683
 
653
684
  /**
654
- * Returns left leaf columns for the table.
685
+ * Resolves leaf columns pinned to the left region.
655
686
  *
656
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
687
+ * The result follows `state.columnPinning.left` order and skips stale ids that
688
+ * no longer correspond to a leaf column.
657
689
  *
658
690
  * @example
659
691
  * ```ts
660
- * const value = table_getLeftLeafColumns(table)
692
+ * const columns = table_getLeftLeafColumns(table)
661
693
  * ```
662
694
  */
663
695
  export function table_getLeftLeafColumns<
@@ -668,21 +700,22 @@ export function table_getLeftLeafColumns<
668
700
  table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
669
701
  const leafColumnsById = table.getAllLeafColumnsById()
670
702
  const result: Array<Column_Internal<TFeatures, TData, unknown>> = []
671
- for (const columnId of left) {
672
- const column = leafColumnsById[columnId]
703
+ for (let i = 0; i < left.length; i++) {
704
+ const column = leafColumnsById[left[i]!]
673
705
  if (column) result.push(column)
674
706
  }
675
707
  return result
676
708
  }
677
709
 
678
710
  /**
679
- * Returns right leaf columns for the table.
711
+ * Resolves leaf columns pinned to the right region.
680
712
  *
681
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
713
+ * The result follows `state.columnPinning.right` order and skips stale ids that
714
+ * no longer correspond to a leaf column.
682
715
  *
683
716
  * @example
684
717
  * ```ts
685
- * const value = table_getRightLeafColumns(table)
718
+ * const columns = table_getRightLeafColumns(table)
686
719
  * ```
687
720
  */
688
721
  export function table_getRightLeafColumns<
@@ -693,21 +726,21 @@ export function table_getRightLeafColumns<
693
726
  table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()
694
727
  const leafColumnsById = table.getAllLeafColumnsById()
695
728
  const result: Array<Column_Internal<TFeatures, TData, unknown>> = []
696
- for (const columnId of right) {
697
- const column = leafColumnsById[columnId]
729
+ for (let i = 0; i < right.length; i++) {
730
+ const column = leafColumnsById[right[i]!]
698
731
  if (column) result.push(column)
699
732
  }
700
733
  return result
701
734
  }
702
735
 
703
736
  /**
704
- * Returns center leaf columns for the table.
737
+ * Resolves leaf columns that are not pinned to either side.
705
738
  *
706
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
739
+ * Left- and right-pinned ids are removed from `table.getAllLeafColumns()`.
707
740
  *
708
741
  * @example
709
742
  * ```ts
710
- * const value = table_getCenterLeafColumns(table)
743
+ * const columns = table_getCenterLeafColumns(table)
711
744
  * ```
712
745
  */
713
746
  export function table_getCenterLeafColumns<
@@ -721,13 +754,14 @@ export function table_getCenterLeafColumns<
721
754
  }
722
755
 
723
756
  /**
724
- * Returns pinned leaf columns for the table.
757
+ * Resolves leaf columns for a requested pinning region.
725
758
  *
726
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
759
+ * Pass `'left'`, `'center'`, or `'right'` for a partition, or pass `false` to
760
+ * read all leaf columns without partitioning.
727
761
  *
728
762
  * @example
729
763
  * ```ts
730
- * const value = table_getPinnedLeafColumns(table)
764
+ * const columns = table_getPinnedLeafColumns(table, 'center')
731
765
  * ```
732
766
  */
733
767
  export function table_getPinnedLeafColumns<
@@ -761,13 +795,13 @@ export function table_getPinnedLeafColumns<
761
795
  // visible leaf columns
762
796
 
763
797
  /**
764
- * Returns left visible leaf columns for the table.
798
+ * Resolves visible leaf columns pinned to the left region.
765
799
  *
766
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
800
+ * Hidden pinned columns are filtered out after the left pin order is applied.
767
801
  *
768
802
  * @example
769
803
  * ```ts
770
- * const value = table_getLeftVisibleLeafColumns(table)
804
+ * const columns = table_getLeftVisibleLeafColumns(table)
771
805
  * ```
772
806
  */
773
807
  export function table_getLeftVisibleLeafColumns<
@@ -784,13 +818,13 @@ export function table_getLeftVisibleLeafColumns<
784
818
  }
785
819
 
786
820
  /**
787
- * Returns right visible leaf columns for the table.
821
+ * Resolves visible leaf columns pinned to the right region.
788
822
  *
789
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
823
+ * Hidden pinned columns are filtered out after the right pin order is applied.
790
824
  *
791
825
  * @example
792
826
  * ```ts
793
- * const value = table_getRightVisibleLeafColumns(table)
827
+ * const columns = table_getRightVisibleLeafColumns(table)
794
828
  * ```
795
829
  */
796
830
  export function table_getRightVisibleLeafColumns<
@@ -807,13 +841,14 @@ export function table_getRightVisibleLeafColumns<
807
841
  }
808
842
 
809
843
  /**
810
- * Returns center visible leaf columns for the table.
844
+ * Resolves visible leaf columns that are not pinned.
811
845
  *
812
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
846
+ * This is the center partition used by layouts that render pinned columns
847
+ * separately from the scrollable middle region.
813
848
  *
814
849
  * @example
815
850
  * ```ts
816
- * const value = table_getCenterVisibleLeafColumns(table)
851
+ * const columns = table_getCenterVisibleLeafColumns(table)
817
852
  * ```
818
853
  */
819
854
  export function table_getCenterVisibleLeafColumns<
@@ -830,13 +865,14 @@ export function table_getCenterVisibleLeafColumns<
830
865
  }
831
866
 
832
867
  /**
833
- * Returns pinned visible leaf columns for the table.
868
+ * Resolves visible leaf columns for a requested pinning region.
834
869
  *
835
- * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
870
+ * Omit `position` to get all visible leaf columns, or pass `'left'`, `'center'`,
871
+ * or `'right'` to get one partition.
836
872
  *
837
873
  * @example
838
874
  * ```ts
839
- * const value = table_getPinnedVisibleLeafColumns(table)
875
+ * const columns = table_getPinnedVisibleLeafColumns(table, 'left')
840
876
  * ```
841
877
  */
842
878
  export function table_getPinnedVisibleLeafColumns<