@tanstack/table-core 9.0.0-beta.31 → 9.0.0-beta.34

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 (323) hide show
  1. package/dist/core/cells/constructCell.cjs +1 -4
  2. package/dist/core/cells/constructCell.cjs.map +1 -1
  3. package/dist/core/cells/constructCell.d.cts +1 -1
  4. package/dist/core/cells/constructCell.d.ts +1 -1
  5. package/dist/core/cells/constructCell.js +1 -4
  6. package/dist/core/cells/constructCell.js.map +1 -1
  7. package/dist/core/cells/coreCellsFeature.types.d.cts +1 -1
  8. package/dist/core/cells/coreCellsFeature.types.d.ts +1 -1
  9. package/dist/core/cells/coreCellsFeature.utils.d.cts +1 -1
  10. package/dist/core/cells/coreCellsFeature.utils.d.ts +1 -1
  11. package/dist/core/columns/constructColumn.cjs +3 -9
  12. package/dist/core/columns/constructColumn.cjs.map +1 -1
  13. package/dist/core/columns/constructColumn.js +3 -9
  14. package/dist/core/columns/constructColumn.js.map +1 -1
  15. package/dist/core/columns/coreColumnsFeature.cjs +12 -18
  16. package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
  17. package/dist/core/columns/coreColumnsFeature.js +12 -18
  18. package/dist/core/columns/coreColumnsFeature.js.map +1 -1
  19. package/dist/core/columns/coreColumnsFeature.utils.cjs +2 -6
  20. package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
  21. package/dist/core/columns/coreColumnsFeature.utils.js +2 -6
  22. package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
  23. package/dist/core/headers/buildHeaderGroups.cjs +1 -2
  24. package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
  25. package/dist/core/headers/buildHeaderGroups.js +1 -2
  26. package/dist/core/headers/buildHeaderGroups.js.map +1 -1
  27. package/dist/core/headers/constructHeader.cjs +1 -4
  28. package/dist/core/headers/constructHeader.cjs.map +1 -1
  29. package/dist/core/headers/constructHeader.js +1 -4
  30. package/dist/core/headers/constructHeader.js.map +1 -1
  31. package/dist/core/headers/coreHeadersFeature.cjs +8 -11
  32. package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
  33. package/dist/core/headers/coreHeadersFeature.js +8 -11
  34. package/dist/core/headers/coreHeadersFeature.js.map +1 -1
  35. package/dist/core/headers/coreHeadersFeature.utils.cjs +2 -4
  36. package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
  37. package/dist/core/headers/coreHeadersFeature.utils.js +2 -4
  38. package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
  39. package/dist/core/row-models/coreRowModelsFeature.types.d.cts +3 -3
  40. package/dist/core/row-models/coreRowModelsFeature.types.d.ts +3 -3
  41. package/dist/core/row-models/coreRowModelsFeature.utils.cjs +6 -24
  42. package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
  43. package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +1 -1
  44. package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +1 -1
  45. package/dist/core/row-models/coreRowModelsFeature.utils.js +6 -24
  46. package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
  47. package/dist/core/row-models/createCoreRowModel.cjs +2 -3
  48. package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
  49. package/dist/core/row-models/createCoreRowModel.d.cts +1 -1
  50. package/dist/core/row-models/createCoreRowModel.d.ts +1 -1
  51. package/dist/core/row-models/createCoreRowModel.js +2 -3
  52. package/dist/core/row-models/createCoreRowModel.js.map +1 -1
  53. package/dist/core/rows/constructRow.cjs +2 -8
  54. package/dist/core/rows/constructRow.cjs.map +1 -1
  55. package/dist/core/rows/constructRow.js +2 -8
  56. package/dist/core/rows/constructRow.js.map +1 -1
  57. package/dist/core/rows/coreRowsFeature.cjs +4 -1
  58. package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
  59. package/dist/core/rows/coreRowsFeature.js +4 -1
  60. package/dist/core/rows/coreRowsFeature.js.map +1 -1
  61. package/dist/core/rows/coreRowsFeature.types.d.cts +1 -1
  62. package/dist/core/rows/coreRowsFeature.types.d.ts +1 -1
  63. package/dist/core/rows/coreRowsFeature.utils.cjs +3 -4
  64. package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
  65. package/dist/core/rows/coreRowsFeature.utils.d.cts +1 -1
  66. package/dist/core/rows/coreRowsFeature.utils.d.ts +1 -1
  67. package/dist/core/rows/coreRowsFeature.utils.js +3 -4
  68. package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
  69. package/dist/core/table/constructTable.cjs +4 -10
  70. package/dist/core/table/constructTable.cjs.map +1 -1
  71. package/dist/core/table/constructTable.js +4 -10
  72. package/dist/core/table/constructTable.js.map +1 -1
  73. package/dist/experimental-worker-plugin.cjs +14 -0
  74. package/dist/experimental-worker-plugin.d.cts +5 -0
  75. package/dist/experimental-worker-plugin.d.ts +5 -0
  76. package/dist/experimental-worker-plugin.js +6 -0
  77. package/dist/features/column-faceting/columnFacetingFeature.cjs +12 -18
  78. package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
  79. package/dist/features/column-faceting/columnFacetingFeature.js +12 -18
  80. package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
  81. package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +1 -1
  82. package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +1 -1
  83. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +7 -25
  84. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
  85. package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +1 -1
  86. package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +1 -1
  87. package/dist/features/column-faceting/columnFacetingFeature.utils.js +7 -25
  88. package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
  89. package/dist/features/column-faceting/createFacetedRowModel.cjs +8 -14
  90. package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
  91. package/dist/features/column-faceting/createFacetedRowModel.d.cts +1 -1
  92. package/dist/features/column-faceting/createFacetedRowModel.d.ts +1 -1
  93. package/dist/features/column-faceting/createFacetedRowModel.js +8 -14
  94. package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
  95. package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +1 -1
  96. package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +1 -1
  97. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +10 -13
  98. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
  99. package/dist/features/column-filtering/columnFilteringFeature.utils.js +10 -13
  100. package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
  101. package/dist/features/column-filtering/createFilteredRowModel.cjs +12 -18
  102. package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
  103. package/dist/features/column-filtering/createFilteredRowModel.d.cts +1 -1
  104. package/dist/features/column-filtering/createFilteredRowModel.d.ts +1 -1
  105. package/dist/features/column-filtering/createFilteredRowModel.js +12 -18
  106. package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
  107. package/dist/features/column-grouping/columnGroupingFeature.cjs +1 -4
  108. package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
  109. package/dist/features/column-grouping/columnGroupingFeature.js +1 -4
  110. package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
  111. package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +4 -4
  112. package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +4 -4
  113. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +8 -13
  114. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
  115. package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +2 -2
  116. package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +2 -2
  117. package/dist/features/column-grouping/columnGroupingFeature.utils.js +8 -13
  118. package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
  119. package/dist/features/column-grouping/createGroupedRowModel.cjs +3 -7
  120. package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
  121. package/dist/features/column-grouping/createGroupedRowModel.d.cts +1 -1
  122. package/dist/features/column-grouping/createGroupedRowModel.d.ts +1 -1
  123. package/dist/features/column-grouping/createGroupedRowModel.js +3 -7
  124. package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
  125. package/dist/features/column-ordering/columnOrderingFeature.cjs +13 -19
  126. package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
  127. package/dist/features/column-ordering/columnOrderingFeature.js +13 -19
  128. package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
  129. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +6 -11
  130. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
  131. package/dist/features/column-ordering/columnOrderingFeature.utils.js +6 -11
  132. package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
  133. package/dist/features/column-pinning/columnPinningFeature.cjs +78 -114
  134. package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
  135. package/dist/features/column-pinning/columnPinningFeature.js +78 -114
  136. package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
  137. package/dist/features/column-pinning/columnPinningFeature.types.d.cts +1 -1
  138. package/dist/features/column-pinning/columnPinningFeature.types.d.ts +1 -1
  139. package/dist/features/column-pinning/columnPinningFeature.utils.cjs +15 -28
  140. package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
  141. package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +2 -2
  142. package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +2 -2
  143. package/dist/features/column-pinning/columnPinningFeature.utils.js +15 -28
  144. package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
  145. package/dist/features/column-resizing/columnResizingFeature.utils.cjs +12 -16
  146. package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
  147. package/dist/features/column-resizing/columnResizingFeature.utils.js +12 -16
  148. package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
  149. package/dist/features/column-sizing/columnSizingFeature.cjs +24 -48
  150. package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
  151. package/dist/features/column-sizing/columnSizingFeature.js +24 -48
  152. package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
  153. package/dist/features/column-sizing/columnSizingFeature.utils.cjs +11 -18
  154. package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
  155. package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +1 -1
  156. package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +1 -1
  157. package/dist/features/column-sizing/columnSizingFeature.utils.js +11 -18
  158. package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
  159. package/dist/features/column-visibility/columnVisibilityFeature.cjs +25 -40
  160. package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
  161. package/dist/features/column-visibility/columnVisibilityFeature.js +25 -40
  162. package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
  163. package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +1 -1
  164. package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +1 -1
  165. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +3 -6
  166. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
  167. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +1 -1
  168. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +1 -1
  169. package/dist/features/column-visibility/columnVisibilityFeature.utils.js +3 -6
  170. package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
  171. package/dist/features/global-filtering/globalFilteringFeature.cjs +1 -2
  172. package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
  173. package/dist/features/global-filtering/globalFilteringFeature.js +1 -2
  174. package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
  175. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +3 -5
  176. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
  177. package/dist/features/global-filtering/globalFilteringFeature.utils.js +3 -5
  178. package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
  179. package/dist/features/row-expanding/createExpandedRowModel.cjs +6 -10
  180. package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
  181. package/dist/features/row-expanding/createExpandedRowModel.d.cts +1 -1
  182. package/dist/features/row-expanding/createExpandedRowModel.d.ts +1 -1
  183. package/dist/features/row-expanding/createExpandedRowModel.js +6 -10
  184. package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
  185. package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +1 -1
  186. package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +1 -1
  187. package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +8 -15
  188. package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
  189. package/dist/features/row-expanding/rowExpandingFeature.utils.js +8 -15
  190. package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
  191. package/dist/features/row-pagination/createPaginatedRowModel.cjs +6 -10
  192. package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
  193. package/dist/features/row-pagination/createPaginatedRowModel.d.cts +1 -1
  194. package/dist/features/row-pagination/createPaginatedRowModel.d.ts +1 -1
  195. package/dist/features/row-pagination/createPaginatedRowModel.js +6 -10
  196. package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
  197. package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +1 -1
  198. package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +1 -1
  199. package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +8 -14
  200. package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -1
  201. package/dist/features/row-pagination/rowPaginationFeature.utils.js +8 -14
  202. package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -1
  203. package/dist/features/row-pinning/rowPinningFeature.cjs +4 -16
  204. package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
  205. package/dist/features/row-pinning/rowPinningFeature.js +4 -16
  206. package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
  207. package/dist/features/row-pinning/rowPinningFeature.utils.cjs +7 -12
  208. package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
  209. package/dist/features/row-pinning/rowPinningFeature.utils.js +7 -12
  210. package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
  211. package/dist/features/row-selection/rowSelectionFeature.cjs +30 -60
  212. package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
  213. package/dist/features/row-selection/rowSelectionFeature.js +30 -60
  214. package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
  215. package/dist/features/row-selection/rowSelectionFeature.types.d.cts +1 -1
  216. package/dist/features/row-selection/rowSelectionFeature.types.d.ts +1 -1
  217. package/dist/features/row-selection/rowSelectionFeature.utils.cjs +11 -18
  218. package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
  219. package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +1 -1
  220. package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +1 -1
  221. package/dist/features/row-selection/rowSelectionFeature.utils.js +12 -19
  222. package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
  223. package/dist/features/row-sorting/createSortedRowModel.cjs +20 -14
  224. package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
  225. package/dist/features/row-sorting/createSortedRowModel.d.cts +1 -1
  226. package/dist/features/row-sorting/createSortedRowModel.d.ts +1 -1
  227. package/dist/features/row-sorting/createSortedRowModel.js +21 -15
  228. package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
  229. package/dist/features/row-sorting/rowSortingFeature.types.d.cts +2 -2
  230. package/dist/features/row-sorting/rowSortingFeature.types.d.ts +2 -2
  231. package/dist/features/row-sorting/rowSortingFeature.utils.cjs +10 -14
  232. package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
  233. package/dist/features/row-sorting/rowSortingFeature.utils.js +10 -14
  234. package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
  235. package/dist/flex-render.d.cts +1 -1
  236. package/dist/flex-render.d.ts +1 -1
  237. package/dist/fns/filterFns.cjs +8 -12
  238. package/dist/fns/filterFns.cjs.map +1 -1
  239. package/dist/fns/filterFns.js +8 -12
  240. package/dist/fns/filterFns.js.map +1 -1
  241. package/dist/index.cjs +1 -0
  242. package/dist/index.d.cts +18 -18
  243. package/dist/index.d.ts +18 -18
  244. package/dist/index.js +2 -2
  245. package/dist/store-reactivity-bindings.cjs +2 -2
  246. package/dist/store-reactivity-bindings.cjs.map +1 -1
  247. package/dist/store-reactivity-bindings.js +2 -2
  248. package/dist/store-reactivity-bindings.js.map +1 -1
  249. package/dist/types/Cell.d.cts +1 -1
  250. package/dist/types/Cell.d.ts +1 -1
  251. package/dist/types/Column.d.cts +7 -7
  252. package/dist/types/Column.d.ts +7 -7
  253. package/dist/types/ColumnDef.d.cts +6 -6
  254. package/dist/types/ColumnDef.d.ts +6 -6
  255. package/dist/types/Header.d.cts +1 -1
  256. package/dist/types/Header.d.ts +1 -1
  257. package/dist/types/Row.d.cts +2 -2
  258. package/dist/types/Row.d.ts +2 -2
  259. package/dist/types/RowModel.d.cts +4 -4
  260. package/dist/types/RowModel.d.ts +4 -4
  261. package/dist/types/RowModelFns.d.cts +2 -2
  262. package/dist/types/RowModelFns.d.ts +2 -2
  263. package/dist/types/Table.d.cts +9 -9
  264. package/dist/types/Table.d.ts +9 -9
  265. package/dist/types/TableFeatures.d.cts +4 -4
  266. package/dist/types/TableFeatures.d.ts +4 -4
  267. package/dist/types/TableOptions.d.cts +7 -7
  268. package/dist/types/TableOptions.d.ts +7 -7
  269. package/dist/types/TableState.d.cts +6 -6
  270. package/dist/types/TableState.d.ts +6 -6
  271. package/dist/utils.cjs +23 -12
  272. package/dist/utils.cjs.map +1 -1
  273. package/dist/utils.d.cts +6 -1
  274. package/dist/utils.d.ts +6 -1
  275. package/dist/utils.js +23 -13
  276. package/dist/utils.js.map +1 -1
  277. package/dist/worker/createTableWorker.cjs +189 -0
  278. package/dist/worker/createTableWorker.cjs.map +1 -0
  279. package/dist/worker/createTableWorker.d.cts +102 -0
  280. package/dist/worker/createTableWorker.d.ts +102 -0
  281. package/dist/worker/createTableWorker.js +186 -0
  282. package/dist/worker/createTableWorker.js.map +1 -0
  283. package/dist/worker/createWorkerRowModel.cjs +78 -0
  284. package/dist/worker/createWorkerRowModel.cjs.map +1 -0
  285. package/dist/worker/createWorkerRowModel.d.cts +42 -0
  286. package/dist/worker/createWorkerRowModel.d.ts +42 -0
  287. package/dist/worker/createWorkerRowModel.js +78 -0
  288. package/dist/worker/createWorkerRowModel.js.map +1 -0
  289. package/dist/worker/initTableWorker.cjs +100 -0
  290. package/dist/worker/initTableWorker.cjs.map +1 -0
  291. package/dist/worker/initTableWorker.d.cts +33 -0
  292. package/dist/worker/initTableWorker.d.ts +33 -0
  293. package/dist/worker/initTableWorker.js +100 -0
  294. package/dist/worker/initTableWorker.js.map +1 -0
  295. package/dist/worker/rebuildRowModel.cjs +72 -0
  296. package/dist/worker/rebuildRowModel.cjs.map +1 -0
  297. package/dist/worker/rebuildRowModel.d.cts +9 -0
  298. package/dist/worker/rebuildRowModel.d.ts +9 -0
  299. package/dist/worker/rebuildRowModel.js +72 -0
  300. package/dist/worker/rebuildRowModel.js.map +1 -0
  301. package/dist/worker/serializeRowModel.cjs +53 -0
  302. package/dist/worker/serializeRowModel.cjs.map +1 -0
  303. package/dist/worker/serializeRowModel.js +52 -0
  304. package/dist/worker/serializeRowModel.js.map +1 -0
  305. package/dist/worker/tableWorkerProtocol.cjs +29 -0
  306. package/dist/worker/tableWorkerProtocol.cjs.map +1 -0
  307. package/dist/worker/tableWorkerProtocol.d.cts +88 -0
  308. package/dist/worker/tableWorkerProtocol.d.ts +88 -0
  309. package/dist/worker/tableWorkerProtocol.js +27 -0
  310. package/dist/worker/tableWorkerProtocol.js.map +1 -0
  311. package/package.json +6 -2
  312. package/src/core/rows/coreRowsFeature.ts +1 -0
  313. package/src/experimental-worker-plugin.ts +22 -0
  314. package/src/features/row-selection/rowSelectionFeature.utils.ts +2 -1
  315. package/src/features/row-sorting/createSortedRowModel.ts +31 -10
  316. package/src/features/row-sorting/rowSortingFeature.utils.ts +2 -10
  317. package/src/utils.ts +21 -0
  318. package/src/worker/createTableWorker.ts +357 -0
  319. package/src/worker/createWorkerRowModel.ts +121 -0
  320. package/src/worker/initTableWorker.ts +164 -0
  321. package/src/worker/rebuildRowModel.ts +117 -0
  322. package/src/worker/serializeRowModel.ts +80 -0
  323. package/src/worker/tableWorkerProtocol.ts +105 -0
@@ -9,7 +9,6 @@ import { constructHeader } from "./constructHeader.js";
9
9
  * The result accounts for visible leaf columns, pinned column groups, and placeholder headers needed to render multi-level headers.
10
10
  */
11
11
  function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
12
- var _headerGroups$;
13
12
  let maxDepth = 0;
14
13
  const findMaxDepth = (columns, depth = 1) => {
15
14
  maxDepth = Math.max(maxDepth, depth);
@@ -94,7 +93,7 @@ function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
94
93
  }
95
94
  return results;
96
95
  };
97
- recurseHeadersForSpans(((_headerGroups$ = headerGroups[0]) === null || _headerGroups$ === void 0 ? void 0 : _headerGroups$.headers) ?? []);
96
+ recurseHeadersForSpans(headerGroups[0]?.headers ?? []);
98
97
  return headerGroups;
99
98
  }
100
99
 
@@ -1 +1 @@
1
- {"version":3,"file":"buildHeaderGroups.js","names":[],"sources":["../../../src/core/headers/buildHeaderGroups.ts"],"sourcesContent":["import { callMemoOrStaticFn } from '../../utils'\nimport { column_getIsVisible } from '../../features/column-visibility/columnVisibilityFeature.utils'\nimport { constructHeader } from './constructHeader'\nimport type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header } from '../../types/Header'\nimport type { HeaderGroup } from '../../types/HeaderGroup'\nimport type { Column } from '../../types/Column'\n\n/**\n * Builds the nested header group structure for a table.\n *\n * The result accounts for visible leaf columns, pinned column groups, and placeholder headers needed to render multi-level headers.\n */\nexport function buildHeaderGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n allColumns: Array<Column<TFeatures, TData, TValue>>,\n columnsToGroup: Array<Column<TFeatures, TData, TValue>>,\n table: Table_Internal<TFeatures, TData>,\n headerFamily?: 'center' | 'left' | 'right',\n) {\n // Find the max depth of the columns:\n // build the leaf column row\n // build each buffer row going up\n // placeholder for non-existent level\n // real column for existing level\n\n let maxDepth = 0\n\n const findMaxDepth = (\n columns: Array<Column<TFeatures, TData, TValue>>,\n depth = 1,\n ) => {\n maxDepth = Math.max(maxDepth, depth)\n\n for (let i = 0; i < columns.length; i++) {\n const column = columns[i]!\n if (callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)) {\n if (column.columns.length) {\n findMaxDepth(column.columns, depth + 1)\n }\n }\n }\n }\n\n findMaxDepth(allColumns)\n\n const headerGroups: Array<HeaderGroup<TFeatures, TData>> = []\n\n const constructHeaderGroup = (\n headersToGroup: Array<Header<TFeatures, TData, TValue>>,\n depth: number,\n ) => {\n // The header group we are creating\n const headerGroup: HeaderGroup<TFeatures, TData> = {\n depth,\n id: [headerFamily, `${depth}`].filter(Boolean).join('_'),\n headers: [],\n }\n\n // The parent columns we're going to scan next\n const pendingParentHeaders: Array<Header<TFeatures, TData, TValue>> = []\n\n // Scan each column for parents\n headersToGroup.forEach((headerToGroup) => {\n // What is the latest (last) parent column?\n\n const latestPendingParentHeader =\n pendingParentHeaders[pendingParentHeaders.length - 1]\n\n const isLeafHeader = headerToGroup.column.depth === headerGroup.depth\n\n let column: Column<TFeatures, TData, TValue>\n let isPlaceholder = false\n\n if (isLeafHeader && headerToGroup.column.parent) {\n // The parent header is new\n column = headerToGroup.column.parent\n } else {\n // The parent header is repeated\n column = headerToGroup.column\n isPlaceholder = true\n }\n\n if (\n latestPendingParentHeader &&\n latestPendingParentHeader.column === column\n ) {\n // This column is repeated. Add it as a sub header to the next batch\n latestPendingParentHeader.subHeaders.push(headerToGroup)\n } else {\n // This is a new header. Let's create it\n const header = constructHeader(table, column, {\n id: [headerFamily, depth, column.id, headerToGroup.id]\n .filter(Boolean)\n .join('_'),\n isPlaceholder,\n placeholderId: isPlaceholder\n ? `${pendingParentHeaders.filter((d) => d.column === column).length}`\n : undefined,\n depth,\n index: pendingParentHeaders.length,\n })\n\n // Add the headerToGroup as a subHeader of the new header\n header.subHeaders.push(headerToGroup)\n // Add the new header to the pendingParentHeaders to get grouped\n // in the next batch\n pendingParentHeaders.push(header)\n }\n\n headerGroup.headers.push(\n headerToGroup as Header<TFeatures, TData, unknown>,\n )\n headerToGroup.headerGroup = headerGroup\n })\n\n headerGroups.push(headerGroup)\n\n if (depth > 0) {\n constructHeaderGroup(pendingParentHeaders, depth - 1)\n }\n }\n\n const bottomHeaders = columnsToGroup.map((column, index) =>\n constructHeader(table, column, {\n depth: maxDepth,\n index,\n }),\n )\n\n constructHeaderGroup(bottomHeaders, maxDepth - 1)\n\n headerGroups.reverse()\n\n const recurseHeadersForSpans = (\n headers: Array<Header<TFeatures, TData, TValue>>,\n ): Array<{ colSpan: number; rowSpan: number }> => {\n const results: Array<{ colSpan: number; rowSpan: number }> = []\n\n for (let i = 0; i < headers.length; i++) {\n const header = headers[i]!\n if (\n !callMemoOrStaticFn(header.column, 'getIsVisible', column_getIsVisible)\n ) {\n continue\n }\n\n let colSpan = 0\n let minChildRowSpan = Infinity\n\n if (header.subHeaders.length) {\n const childSpans = recurseHeadersForSpans(header.subHeaders)\n for (let j = 0; j < childSpans.length; j++) {\n const child = childSpans[j]!\n colSpan += child.colSpan\n if (child.rowSpan < minChildRowSpan) {\n minChildRowSpan = child.rowSpan\n }\n }\n } else {\n colSpan = 1\n minChildRowSpan = 0\n }\n\n header.colSpan = colSpan\n header.rowSpan = minChildRowSpan\n\n results.push({ colSpan, rowSpan: header.rowSpan })\n }\n\n return results\n }\n\n recurseHeadersForSpans(\n (headerGroups[0]?.headers ?? []) as Array<Header<TFeatures, TData, TValue>>,\n )\n\n return headerGroups\n}\n"],"mappings":";;;;;;;;;;AAeA,SAAgB,kBAKd,YACA,gBACA,OACA,cACA;;CAOA,IAAI,WAAW;CAEf,MAAM,gBACJ,SACA,QAAQ,MACL;EACH,WAAW,KAAK,IAAI,UAAU,KAAK;EAEnC,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;GACvC,MAAM,SAAS,QAAQ;GACvB,IAAI,mBAAmB,QAAQ,gBAAgB,mBAAmB,GAChE;QAAI,OAAO,QAAQ,QACjB,aAAa,OAAO,SAAS,QAAQ,CAAC;GACxC;EAEJ;CACF;CAEA,aAAa,UAAU;CAEvB,MAAM,eAAqD,CAAC;CAE5D,MAAM,wBACJ,gBACA,UACG;EAEH,MAAM,cAA6C;GACjD;GACA,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;GACvD,SAAS,CAAC;EACZ;EAGA,MAAM,uBAAgE,CAAC;EAGvE,eAAe,SAAS,kBAAkB;GAGxC,MAAM,4BACJ,qBAAqB,qBAAqB,SAAS;GAErD,MAAM,eAAe,cAAc,OAAO,UAAU,YAAY;GAEhE,IAAI;GACJ,IAAI,gBAAgB;GAEpB,IAAI,gBAAgB,cAAc,OAAO,QAEvC,SAAS,cAAc,OAAO;QACzB;IAEL,SAAS,cAAc;IACvB,gBAAgB;GAClB;GAEA,IACE,6BACA,0BAA0B,WAAW,QAGrC,0BAA0B,WAAW,KAAK,aAAa;QAClD;IAEL,MAAM,SAAS,gBAAgB,OAAO,QAAQ;KAC5C,IAAI;MAAC;MAAc;MAAO,OAAO;MAAI,cAAc;KAAE,CAAC,CACnD,OAAO,OAAO,CAAC,CACf,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sourcesContent":["import { callMemoOrStaticFn } from '../../utils'\nimport { column_getIsVisible } from '../../features/column-visibility/columnVisibilityFeature.utils'\nimport { constructHeader } from './constructHeader'\nimport type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header } from '../../types/Header'\nimport type { HeaderGroup } from '../../types/HeaderGroup'\nimport type { Column } from '../../types/Column'\n\n/**\n * Builds the nested header group structure for a table.\n *\n * The result accounts for visible leaf columns, pinned column groups, and placeholder headers needed to render multi-level headers.\n */\nexport function buildHeaderGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n allColumns: Array<Column<TFeatures, TData, TValue>>,\n columnsToGroup: Array<Column<TFeatures, TData, TValue>>,\n table: Table_Internal<TFeatures, TData>,\n headerFamily?: 'center' | 'left' | 'right',\n) {\n // Find the max depth of the columns:\n // build the leaf column row\n // build each buffer row going up\n // placeholder for non-existent level\n // real column for existing level\n\n let maxDepth = 0\n\n const findMaxDepth = (\n columns: Array<Column<TFeatures, TData, TValue>>,\n depth = 1,\n ) => {\n maxDepth = Math.max(maxDepth, depth)\n\n for (let i = 0; i < columns.length; i++) {\n const column = columns[i]!\n if (callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)) {\n if (column.columns.length) {\n findMaxDepth(column.columns, depth + 1)\n }\n }\n }\n }\n\n findMaxDepth(allColumns)\n\n const headerGroups: Array<HeaderGroup<TFeatures, TData>> = []\n\n const constructHeaderGroup = (\n headersToGroup: Array<Header<TFeatures, TData, TValue>>,\n depth: number,\n ) => {\n // The header group we are creating\n const headerGroup: HeaderGroup<TFeatures, TData> = {\n depth,\n id: [headerFamily, `${depth}`].filter(Boolean).join('_'),\n headers: [],\n }\n\n // The parent columns we're going to scan next\n const pendingParentHeaders: Array<Header<TFeatures, TData, TValue>> = []\n\n // Scan each column for parents\n headersToGroup.forEach((headerToGroup) => {\n // What is the latest (last) parent column?\n\n const latestPendingParentHeader =\n pendingParentHeaders[pendingParentHeaders.length - 1]\n\n const isLeafHeader = headerToGroup.column.depth === headerGroup.depth\n\n let column: Column<TFeatures, TData, TValue>\n let isPlaceholder = false\n\n if (isLeafHeader && headerToGroup.column.parent) {\n // The parent header is new\n column = headerToGroup.column.parent\n } else {\n // The parent header is repeated\n column = headerToGroup.column\n isPlaceholder = true\n }\n\n if (\n latestPendingParentHeader &&\n latestPendingParentHeader.column === column\n ) {\n // This column is repeated. Add it as a sub header to the next batch\n latestPendingParentHeader.subHeaders.push(headerToGroup)\n } else {\n // This is a new header. Let's create it\n const header = constructHeader(table, column, {\n id: [headerFamily, depth, column.id, headerToGroup.id]\n .filter(Boolean)\n .join('_'),\n isPlaceholder,\n placeholderId: isPlaceholder\n ? `${pendingParentHeaders.filter((d) => d.column === column).length}`\n : undefined,\n depth,\n index: pendingParentHeaders.length,\n })\n\n // Add the headerToGroup as a subHeader of the new header\n header.subHeaders.push(headerToGroup)\n // Add the new header to the pendingParentHeaders to get grouped\n // in the next batch\n pendingParentHeaders.push(header)\n }\n\n headerGroup.headers.push(\n headerToGroup as Header<TFeatures, TData, unknown>,\n )\n headerToGroup.headerGroup = headerGroup\n })\n\n headerGroups.push(headerGroup)\n\n if (depth > 0) {\n constructHeaderGroup(pendingParentHeaders, depth - 1)\n }\n }\n\n const bottomHeaders = columnsToGroup.map((column, index) =>\n constructHeader(table, column, {\n depth: maxDepth,\n index,\n }),\n )\n\n constructHeaderGroup(bottomHeaders, maxDepth - 1)\n\n headerGroups.reverse()\n\n const recurseHeadersForSpans = (\n headers: Array<Header<TFeatures, TData, TValue>>,\n ): Array<{ colSpan: number; rowSpan: number }> => {\n const results: Array<{ colSpan: number; rowSpan: number }> = []\n\n for (let i = 0; i < headers.length; i++) {\n const header = headers[i]!\n if (\n !callMemoOrStaticFn(header.column, 'getIsVisible', column_getIsVisible)\n ) {\n continue\n }\n\n let colSpan = 0\n let minChildRowSpan = Infinity\n\n if (header.subHeaders.length) {\n const childSpans = recurseHeadersForSpans(header.subHeaders)\n for (let j = 0; j < childSpans.length; j++) {\n const child = childSpans[j]!\n colSpan += child.colSpan\n if (child.rowSpan < minChildRowSpan) {\n minChildRowSpan = child.rowSpan\n }\n }\n } else {\n colSpan = 1\n minChildRowSpan = 0\n }\n\n header.colSpan = colSpan\n header.rowSpan = minChildRowSpan\n\n results.push({ colSpan, rowSpan: header.rowSpan })\n }\n\n return results\n }\n\n recurseHeadersForSpans(\n (headerGroups[0]?.headers ?? []) as Array<Header<TFeatures, TData, TValue>>,\n )\n\n return headerGroups\n}\n"],"mappings":";;;;;;;;;;AAeA,SAAgB,kBAKd,YACA,gBACA,OACA,cACA;CAOA,IAAI,WAAW;CAEf,MAAM,gBACJ,SACA,QAAQ,MACL;EACH,WAAW,KAAK,IAAI,UAAU,KAAK;EAEnC,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;GACvC,MAAM,SAAS,QAAQ;GACvB,IAAI,mBAAmB,QAAQ,gBAAgB,mBAAmB,GAChE;QAAI,OAAO,QAAQ,QACjB,aAAa,OAAO,SAAS,QAAQ,CAAC;GACxC;EAEJ;CACF;CAEA,aAAa,UAAU;CAEvB,MAAM,eAAqD,CAAC;CAE5D,MAAM,wBACJ,gBACA,UACG;EAEH,MAAM,cAA6C;GACjD;GACA,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;GACvD,SAAS,CAAC;EACZ;EAGA,MAAM,uBAAgE,CAAC;EAGvE,eAAe,SAAS,kBAAkB;GAGxC,MAAM,4BACJ,qBAAqB,qBAAqB,SAAS;GAErD,MAAM,eAAe,cAAc,OAAO,UAAU,YAAY;GAEhE,IAAI;GACJ,IAAI,gBAAgB;GAEpB,IAAI,gBAAgB,cAAc,OAAO,QAEvC,SAAS,cAAc,OAAO;QACzB;IAEL,SAAS,cAAc;IACvB,gBAAgB;GAClB;GAEA,IACE,6BACA,0BA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AS,OAAO;GAAQ,CAAC;EACnD;EAEA,OAAO;CACT;CAEA,uBACG,aAAa,EAAE,EAAE,WAAW,CAAC,CAChC;CAEA,OAAO;AACT"}
@@ -8,10 +8,7 @@ function getHeaderPrototype(table) {
8
8
  if (!table._headerPrototype) {
9
9
  table._headerPrototype = { table };
10
10
  const features = Object.values(table._features);
11
- for (let i = 0; i < features.length; i++) {
12
- var _assignHeaderPrototyp, _ref;
13
- (_assignHeaderPrototyp = (_ref = features[i]).assignHeaderPrototype) === null || _assignHeaderPrototyp === void 0 || _assignHeaderPrototyp.call(_ref, table._headerPrototype, table);
14
- }
11
+ for (let i = 0; i < features.length; i++) features[i].assignHeaderPrototype?.(table._headerPrototype, table);
15
12
  }
16
13
  return table._headerPrototype;
17
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"constructHeader.cjs","names":[],"sources":["../../../src/core/headers/constructHeader.ts"],"sourcesContent":["import type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header } from '../../types/Header'\nimport type { Column } from '../../types/Column'\nimport type { Header_CoreProperties } from './coreHeadersFeature.types'\n\n/**\n * Creates or retrieves the header prototype for a table.\n * The prototype is cached on the table and shared by all header instances.\n */\nfunction getHeaderPrototype<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): object {\n if (!table._headerPrototype) {\n table._headerPrototype = { table }\n const features = Object.values(table._features)\n for (let i = 0; i < features.length; i++) {\n features[i]!.assignHeaderPrototype?.(table._headerPrototype, table)\n }\n }\n return table._headerPrototype\n}\n\n/**\n * Constructs a header instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructHeader<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n table: Table_Internal<TFeatures, TData>,\n column: Column<TFeatures, TData, TValue>,\n options: {\n id?: string\n isPlaceholder?: boolean\n placeholderId?: string\n index: number\n depth: number\n },\n): Header<TFeatures, TData, TValue> {\n // Create header with shared prototype for memory efficiency\n const headerPrototype = getHeaderPrototype(table)\n const header = Object.create(headerPrototype) as Header_CoreProperties<\n TFeatures,\n TData,\n TValue\n >\n\n // Only assign instance-specific properties\n header.colSpan = 0\n header.column = column\n header.depth = options.depth\n header.headerGroup = null\n header.id = options.id ?? column.id\n header.index = options.index\n header.isPlaceholder = !!options.isPlaceholder\n header.placeholderId = options.placeholderId\n header.rowSpan = 0\n header.subHeaders = []\n\n return header as Header<TFeatures, TData, TValue>\n}\n"],"mappings":";;;;;;AAWA,SAAS,mBAGP,OAAiD;CACjD,IAAI,CAAC,MAAM,kBAAkB;EAC3B,MAAM,mBAAmB,EAAE,MAAM;EACjC,MAAM,WAAW,OAAO,OAAO,MAAM,SAAS;EAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;;GACxC,0CAAS,IAAI,wGAAwB,MAAM,kBAAkB,KAAK;EACpE;CACF;CACA,OAAO,MAAM;AACf;;;;;;AAOA,SAAgB,gBAKd,OACA,QACA,SAOkC;CAElC,MAAM,kBAAkB,mBAAmB,KAAK;CAChD,MAAM,SAAS,OAAO,OAAO,eAAe;CAO5C,OAAO,UAAU;CACjB,OAAO,SAAS;CAChB,OAAO,QAAQ,QAAQ;CACvB,OAAO,cAAc;CACrB,OAAO,KAAK,QAAQ,MAAM,OAAO;CACjC,OAAO,QAAQ,QAAQ;CACvB,OAAO,gBAAgB,CAAC,CAAC,QAAQ;CACjC,OAAO,gBAAgB,QAAQ;CAC/B,OAAO,UAAU;CACjB,OAAO,aAAa,CAAC;CAErB,OAAO;AACT"}
1
+ {"version":3,"file":"constructHeader.cjs","names":[],"sources":["../../../src/core/headers/constructHeader.ts"],"sourcesContent":["import type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header } from '../../types/Header'\nimport type { Column } from '../../types/Column'\nimport type { Header_CoreProperties } from './coreHeadersFeature.types'\n\n/**\n * Creates or retrieves the header prototype for a table.\n * The prototype is cached on the table and shared by all header instances.\n */\nfunction getHeaderPrototype<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): object {\n if (!table._headerPrototype) {\n table._headerPrototype = { table }\n const features = Object.values(table._features)\n for (let i = 0; i < features.length; i++) {\n features[i]!.assignHeaderPrototype?.(table._headerPrototype, table)\n }\n }\n return table._headerPrototype\n}\n\n/**\n * Constructs a header instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructHeader<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n table: Table_Internal<TFeatures, TData>,\n column: Column<TFeatures, TData, TValue>,\n options: {\n id?: string\n isPlaceholder?: boolean\n placeholderId?: string\n index: number\n depth: number\n },\n): Header<TFeatures, TData, TValue> {\n // Create header with shared prototype for memory efficiency\n const headerPrototype = getHeaderPrototype(table)\n const header = Object.create(headerPrototype) as Header_CoreProperties<\n TFeatures,\n TData,\n TValue\n >\n\n // Only assign instance-specific properties\n header.colSpan = 0\n header.column = column\n header.depth = options.depth\n header.headerGroup = null\n header.id = options.id ?? column.id\n header.index = options.index\n header.isPlaceholder = !!options.isPlaceholder\n header.placeholderId = options.placeholderId\n header.rowSpan = 0\n header.subHeaders = []\n\n return header as Header<TFeatures, TData, TValue>\n}\n"],"mappings":";;;;;;AAWA,SAAS,mBAGP,OAAiD;CACjD,IAAI,CAAC,MAAM,kBAAkB;EAC3B,MAAM,mBAAmB,EAAE,MAAM;EACjC,MAAM,WAAW,OAAO,OAAO,MAAM,SAAS;EAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KACnC,SAAS,EAAE,CAAE,wBAAwB,MAAM,kBAAkB,KAAK;CAEtE;CACA,OAAO,MAAM;AACf;;;;;;AAOA,SAAgB,gBAKd,OACA,QACA,SAOkC;CAElC,MAAM,kBAAkB,mBAAmB,KAAK;CAChD,MAAM,SAAS,OAAO,OAAO,eAAe;CAO5C,OAAO,UAAU;CACjB,OAAO,SAAS;CAChB,OAAO,QAAQ,QAAQ;CACvB,OAAO,cAAc;CACrB,OAAO,KAAK,QAAQ,MAAM,OAAO;CACjC,OAAO,QAAQ,QAAQ;CACvB,OAAO,gBAAgB,CAAC,CAAC,QAAQ;CACjC,OAAO,gBAAgB,QAAQ;CAC/B,OAAO,UAAU;CACjB,OAAO,aAAa,CAAC;CAErB,OAAO;AACT"}
@@ -7,10 +7,7 @@ function getHeaderPrototype(table) {
7
7
  if (!table._headerPrototype) {
8
8
  table._headerPrototype = { table };
9
9
  const features = Object.values(table._features);
10
- for (let i = 0; i < features.length; i++) {
11
- var _assignHeaderPrototyp, _ref;
12
- (_assignHeaderPrototyp = (_ref = features[i]).assignHeaderPrototype) === null || _assignHeaderPrototyp === void 0 || _assignHeaderPrototyp.call(_ref, table._headerPrototype, table);
13
- }
10
+ for (let i = 0; i < features.length; i++) features[i].assignHeaderPrototype?.(table._headerPrototype, table);
14
11
  }
15
12
  return table._headerPrototype;
16
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"constructHeader.js","names":[],"sources":["../../../src/core/headers/constructHeader.ts"],"sourcesContent":["import type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header } from '../../types/Header'\nimport type { Column } from '../../types/Column'\nimport type { Header_CoreProperties } from './coreHeadersFeature.types'\n\n/**\n * Creates or retrieves the header prototype for a table.\n * The prototype is cached on the table and shared by all header instances.\n */\nfunction getHeaderPrototype<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): object {\n if (!table._headerPrototype) {\n table._headerPrototype = { table }\n const features = Object.values(table._features)\n for (let i = 0; i < features.length; i++) {\n features[i]!.assignHeaderPrototype?.(table._headerPrototype, table)\n }\n }\n return table._headerPrototype\n}\n\n/**\n * Constructs a header instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructHeader<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n table: Table_Internal<TFeatures, TData>,\n column: Column<TFeatures, TData, TValue>,\n options: {\n id?: string\n isPlaceholder?: boolean\n placeholderId?: string\n index: number\n depth: number\n },\n): Header<TFeatures, TData, TValue> {\n // Create header with shared prototype for memory efficiency\n const headerPrototype = getHeaderPrototype(table)\n const header = Object.create(headerPrototype) as Header_CoreProperties<\n TFeatures,\n TData,\n TValue\n >\n\n // Only assign instance-specific properties\n header.colSpan = 0\n header.column = column\n header.depth = options.depth\n header.headerGroup = null\n header.id = options.id ?? column.id\n header.index = options.index\n header.isPlaceholder = !!options.isPlaceholder\n header.placeholderId = options.placeholderId\n header.rowSpan = 0\n header.subHeaders = []\n\n return header as Header<TFeatures, TData, TValue>\n}\n"],"mappings":";;;;;AAWA,SAAS,mBAGP,OAAiD;CACjD,IAAI,CAAC,MAAM,kBAAkB;EAC3B,MAAM,mBAAmB,EAAE,MAAM;EACjC,MAAM,WAAW,OAAO,OAAO,MAAM,SAAS;EAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;;GACxC,0CAAS,IAAI,wGAAwB,MAAM,kBAAkB,KAAK;EACpE;CACF;CACA,OAAO,MAAM;AACf;;;;;;AAOA,SAAgB,gBAKd,OACA,QACA,SAOkC;CAElC,MAAM,kBAAkB,mBAAmB,KAAK;CAChD,MAAM,SAAS,OAAO,OAAO,eAAe;CAO5C,OAAO,UAAU;CACjB,OAAO,SAAS;CAChB,OAAO,QAAQ,QAAQ;CACvB,OAAO,cAAc;CACrB,OAAO,KAAK,QAAQ,MAAM,OAAO;CACjC,OAAO,QAAQ,QAAQ;CACvB,OAAO,gBAAgB,CAAC,CAAC,QAAQ;CACjC,OAAO,gBAAgB,QAAQ;CAC/B,OAAO,UAAU;CACjB,OAAO,aAAa,CAAC;CAErB,OAAO;AACT"}
1
+ {"version":3,"file":"constructHeader.js","names":[],"sources":["../../../src/core/headers/constructHeader.ts"],"sourcesContent":["import type { Table_Internal } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header } from '../../types/Header'\nimport type { Column } from '../../types/Column'\nimport type { Header_CoreProperties } from './coreHeadersFeature.types'\n\n/**\n * Creates or retrieves the header prototype for a table.\n * The prototype is cached on the table and shared by all header instances.\n */\nfunction getHeaderPrototype<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): object {\n if (!table._headerPrototype) {\n table._headerPrototype = { table }\n const features = Object.values(table._features)\n for (let i = 0; i < features.length; i++) {\n features[i]!.assignHeaderPrototype?.(table._headerPrototype, table)\n }\n }\n return table._headerPrototype\n}\n\n/**\n * Constructs a header instance from normalized table internals.\n *\n * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.\n */\nexport function constructHeader<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(\n table: Table_Internal<TFeatures, TData>,\n column: Column<TFeatures, TData, TValue>,\n options: {\n id?: string\n isPlaceholder?: boolean\n placeholderId?: string\n index: number\n depth: number\n },\n): Header<TFeatures, TData, TValue> {\n // Create header with shared prototype for memory efficiency\n const headerPrototype = getHeaderPrototype(table)\n const header = Object.create(headerPrototype) as Header_CoreProperties<\n TFeatures,\n TData,\n TValue\n >\n\n // Only assign instance-specific properties\n header.colSpan = 0\n header.column = column\n header.depth = options.depth\n header.headerGroup = null\n header.id = options.id ?? column.id\n header.index = options.index\n header.isPlaceholder = !!options.isPlaceholder\n header.placeholderId = options.placeholderId\n header.rowSpan = 0\n header.subHeaders = []\n\n return header as Header<TFeatures, TData, TValue>\n}\n"],"mappings":";;;;;AAWA,SAAS,mBAGP,OAAiD;CACjD,IAAI,CAAC,MAAM,kBAAkB;EAC3B,MAAM,mBAAmB,EAAE,MAAM;EACjC,MAAM,WAAW,OAAO,OAAO,MAAM,SAAS;EAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KACnC,SAAS,EAAE,CAAE,wBAAwB,MAAM,kBAAkB,KAAK;CAEtE;CACA,OAAO,MAAM;AACf;;;;;;AAOA,SAAgB,gBAKd,OACA,QACA,SAOkC;CAElC,MAAM,kBAAkB,mBAAmB,KAAK;CAChD,MAAM,SAAS,OAAO,OAAO,eAAe;CAO5C,OAAO,UAAU;CACjB,OAAO,SAAS;CAChB,OAAO,QAAQ,QAAQ;CACvB,OAAO,cAAc;CACrB,OAAO,KAAK,QAAQ,MAAM,OAAO;CACjC,OAAO,QAAQ,QAAQ;CACvB,OAAO,gBAAgB,CAAC,CAAC,QAAQ;CACjC,OAAO,gBAAgB,QAAQ;CAC/B,OAAO,UAAU;CACjB,OAAO,aAAa,CAAC;CAErB,OAAO;AACT"}
@@ -22,17 +22,14 @@ const coreHeadersFeature = {
22
22
  require_utils.assignTableAPIs("coreHeadersFeature", table, {
23
23
  table_getHeaderGroups: {
24
24
  fn: () => require_coreHeadersFeature_utils.table_getHeaderGroups(table),
25
- memoDeps: () => {
26
- var _table$atoms$columnOr, _table$atoms$grouping, _table$atoms$columnPi, _table$atoms$columnVi;
27
- return [
28
- table.options.columns,
29
- (_table$atoms$columnOr = table.atoms.columnOrder) === null || _table$atoms$columnOr === void 0 ? void 0 : _table$atoms$columnOr.get(),
30
- (_table$atoms$grouping = table.atoms.grouping) === null || _table$atoms$grouping === void 0 ? void 0 : _table$atoms$grouping.get(),
31
- (_table$atoms$columnPi = table.atoms.columnPinning) === null || _table$atoms$columnPi === void 0 ? void 0 : _table$atoms$columnPi.get(),
32
- (_table$atoms$columnVi = table.atoms.columnVisibility) === null || _table$atoms$columnVi === void 0 ? void 0 : _table$atoms$columnVi.get(),
33
- table.options.groupedColumnMode
34
- ];
35
- }
25
+ memoDeps: () => [
26
+ table.options.columns,
27
+ table.atoms.columnOrder?.get(),
28
+ table.atoms.grouping?.get(),
29
+ table.atoms.columnPinning?.get(),
30
+ table.atoms.columnVisibility?.get(),
31
+ table.options.groupedColumnMode
32
+ ]
36
33
  },
37
34
  table_getFooterGroups: {
38
35
  fn: () => require_coreHeadersFeature_utils.table_getFooterGroups(table),
@@ -1 +1 @@
1
- {"version":3,"file":"coreHeadersFeature.cjs","names":["header_getLeafHeaders","header_getContext","table_getHeaderGroups","table_getFooterGroups","table_getFlatHeaders","table_getLeafHeaders"],"sources":["../../../src/core/headers/coreHeadersFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n header_getContext,\n header_getLeafHeaders,\n table_getFlatHeaders,\n table_getFooterGroups,\n table_getHeaderGroups,\n table_getLeafHeaders,\n} from './coreHeadersFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that builds header groups and exposes header context APIs.\n */\nexport const coreHeadersFeature: TableFeature = {\n assignHeaderPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreHeadersFeature', prototype, table, {\n header_getLeafHeaders: {\n fn: (header) => header_getLeafHeaders(header),\n memoDeps: (header) => [header.column.table.options.columns],\n },\n header_getContext: {\n fn: (header) => header_getContext(header),\n memoDeps: (header) => [header.column.table.options.columns],\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('coreHeadersFeature', table, {\n table_getHeaderGroups: {\n fn: () => table_getHeaderGroups(table),\n memoDeps: () => [\n table.options.columns,\n table.atoms.columnOrder?.get(),\n table.atoms.grouping?.get(),\n table.atoms.columnPinning?.get(),\n table.atoms.columnVisibility?.get(),\n table.options.groupedColumnMode,\n ],\n },\n table_getFooterGroups: {\n fn: () => table_getFooterGroups(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n table_getFlatHeaders: {\n fn: () => table_getFlatHeaders(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n table_getLeafHeaders: {\n fn: () => table_getLeafHeaders(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAcA,MAAa,qBAAmC;CAC9C,wBAAwB,WAAW,UAAU;EAC3C,kCAAoB,sBAAsB,WAAW,OAAO;GAC1D,uBAAuB;IACrB,KAAK,WAAWA,uDAAsB,MAAM;IAC5C,WAAW,WAAW,CAAC,OAAO,OAAO,MAAM,QAAQ,OAAO;GAC5D;GACA,mBAAmB;IACjB,KAAK,WAAWC,mDAAkB,MAAM;IACxC,WAAW,WAAW,CAAC,OAAO,OAAO,MAAM,QAAQ,OAAO;GAC5D;EACF,CAAC;CACH;CAEA,qBAAqB,UAAU;EAC7B,8BAAgB,sBAAsB,OAAO;GAC3C,uBAAuB;IACrB,UAAUC,uDAAsB,KAAK;IACrC,gBAAgB;;;MACd,MAAM,QAAQ;+BACd,MAAM,MAAM,2FAAa,IAAI;+BAC7B,MAAM,MAAM,wFAAU,IAAI;+BAC1B,MAAM,MAAM,6FAAe,IAAI;+BAC/B,MAAM,MAAM,gGAAkB,IAAI;MAClC,MAAM,QAAQ;KAChB;;GACF;GACA,uBAAuB;IACrB,UAAUC,uDAAsB,KAAK;IACrC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;GACA,sBAAsB;IACpB,UAAUC,sDAAqB,KAAK;IACpC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;GACA,sBAAsB;IACpB,UAAUC,sDAAqB,KAAK;IACpC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;EACF,CAAC;CACH;AACF"}
1
+ {"version":3,"file":"coreHeadersFeature.cjs","names":["header_getLeafHeaders","header_getContext","table_getHeaderGroups","table_getFooterGroups","table_getFlatHeaders","table_getLeafHeaders"],"sources":["../../../src/core/headers/coreHeadersFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n header_getContext,\n header_getLeafHeaders,\n table_getFlatHeaders,\n table_getFooterGroups,\n table_getHeaderGroups,\n table_getLeafHeaders,\n} from './coreHeadersFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that builds header groups and exposes header context APIs.\n */\nexport const coreHeadersFeature: TableFeature = {\n assignHeaderPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreHeadersFeature', prototype, table, {\n header_getLeafHeaders: {\n fn: (header) => header_getLeafHeaders(header),\n memoDeps: (header) => [header.column.table.options.columns],\n },\n header_getContext: {\n fn: (header) => header_getContext(header),\n memoDeps: (header) => [header.column.table.options.columns],\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('coreHeadersFeature', table, {\n table_getHeaderGroups: {\n fn: () => table_getHeaderGroups(table),\n memoDeps: () => [\n table.options.columns,\n table.atoms.columnOrder?.get(),\n table.atoms.grouping?.get(),\n table.atoms.columnPinning?.get(),\n table.atoms.columnVisibility?.get(),\n table.options.groupedColumnMode,\n ],\n },\n table_getFooterGroups: {\n fn: () => table_getFooterGroups(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n table_getFlatHeaders: {\n fn: () => table_getFlatHeaders(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n table_getLeafHeaders: {\n fn: () => table_getLeafHeaders(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAcA,MAAa,qBAAmC;CAC9C,wBAAwB,WAAW,UAAU;EAC3C,kCAAoB,sBAAsB,WAAW,OAAO;GAC1D,uBAAuB;IACrB,KAAK,WAAWA,uDAAsB,MAAM;IAC5C,WAAW,WAAW,CAAC,OAAO,OAAO,MAAM,QAAQ,OAAO;GAC5D;GACA,mBAAmB;IACjB,KAAK,WAAWC,mDAAkB,MAAM;IACxC,WAAW,WAAW,CAAC,OAAO,OAAO,MAAM,QAAQ,OAAO;GAC5D;EACF,CAAC;CACH;CAEA,qBAAqB,UAAU;EAC7B,8BAAgB,sBAAsB,OAAO;GAC3C,uBAAuB;IACrB,UAAUC,uDAAsB,KAAK;IACrC,gBAAgB;KACd,MAAM,QAAQ;KACd,MAAM,MAAM,aAAa,IAAI;KAC7B,MAAM,MAAM,UAAU,IAAI;KAC1B,MAAM,MAAM,eAAe,IAAI;KAC/B,MAAM,MAAM,kBAAkB,IAAI;KAClC,MAAM,QAAQ;IAChB;GACF;GACA,uBAAuB;IACrB,UAAUC,uDAAsB,KAAK;IACrC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;GACA,sBAAsB;IACpB,UAAUC,sDAAqB,KAAK;IACpC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;GACA,sBAAsB;IACpB,UAAUC,sDAAqB,KAAK;IACpC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;EACF,CAAC;CACH;AACF"}
@@ -22,17 +22,14 @@ const coreHeadersFeature = {
22
22
  assignTableAPIs("coreHeadersFeature", table, {
23
23
  table_getHeaderGroups: {
24
24
  fn: () => table_getHeaderGroups(table),
25
- memoDeps: () => {
26
- var _table$atoms$columnOr, _table$atoms$grouping, _table$atoms$columnPi, _table$atoms$columnVi;
27
- return [
28
- table.options.columns,
29
- (_table$atoms$columnOr = table.atoms.columnOrder) === null || _table$atoms$columnOr === void 0 ? void 0 : _table$atoms$columnOr.get(),
30
- (_table$atoms$grouping = table.atoms.grouping) === null || _table$atoms$grouping === void 0 ? void 0 : _table$atoms$grouping.get(),
31
- (_table$atoms$columnPi = table.atoms.columnPinning) === null || _table$atoms$columnPi === void 0 ? void 0 : _table$atoms$columnPi.get(),
32
- (_table$atoms$columnVi = table.atoms.columnVisibility) === null || _table$atoms$columnVi === void 0 ? void 0 : _table$atoms$columnVi.get(),
33
- table.options.groupedColumnMode
34
- ];
35
- }
25
+ memoDeps: () => [
26
+ table.options.columns,
27
+ table.atoms.columnOrder?.get(),
28
+ table.atoms.grouping?.get(),
29
+ table.atoms.columnPinning?.get(),
30
+ table.atoms.columnVisibility?.get(),
31
+ table.options.groupedColumnMode
32
+ ]
36
33
  },
37
34
  table_getFooterGroups: {
38
35
  fn: () => table_getFooterGroups(table),
@@ -1 +1 @@
1
- {"version":3,"file":"coreHeadersFeature.js","names":[],"sources":["../../../src/core/headers/coreHeadersFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n header_getContext,\n header_getLeafHeaders,\n table_getFlatHeaders,\n table_getFooterGroups,\n table_getHeaderGroups,\n table_getLeafHeaders,\n} from './coreHeadersFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that builds header groups and exposes header context APIs.\n */\nexport const coreHeadersFeature: TableFeature = {\n assignHeaderPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreHeadersFeature', prototype, table, {\n header_getLeafHeaders: {\n fn: (header) => header_getLeafHeaders(header),\n memoDeps: (header) => [header.column.table.options.columns],\n },\n header_getContext: {\n fn: (header) => header_getContext(header),\n memoDeps: (header) => [header.column.table.options.columns],\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('coreHeadersFeature', table, {\n table_getHeaderGroups: {\n fn: () => table_getHeaderGroups(table),\n memoDeps: () => [\n table.options.columns,\n table.atoms.columnOrder?.get(),\n table.atoms.grouping?.get(),\n table.atoms.columnPinning?.get(),\n table.atoms.columnVisibility?.get(),\n table.options.groupedColumnMode,\n ],\n },\n table_getFooterGroups: {\n fn: () => table_getFooterGroups(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n table_getFlatHeaders: {\n fn: () => table_getFlatHeaders(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n table_getLeafHeaders: {\n fn: () => table_getLeafHeaders(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAcA,MAAa,qBAAmC;CAC9C,wBAAwB,WAAW,UAAU;EAC3C,oBAAoB,sBAAsB,WAAW,OAAO;GAC1D,uBAAuB;IACrB,KAAK,WAAW,sBAAsB,MAAM;IAC5C,WAAW,WAAW,CAAC,OAAO,OAAO,MAAM,QAAQ,OAAO;GAC5D;GACA,mBAAmB;IACjB,KAAK,WAAW,kBAAkB,MAAM;IACxC,WAAW,WAAW,CAAC,OAAO,OAAO,MAAM,QAAQ,OAAO;GAC5D;EACF,CAAC;CACH;CAEA,qBAAqB,UAAU;EAC7B,gBAAgB,sBAAsB,OAAO;GAC3C,uBAAuB;IACrB,UAAU,sBAAsB,KAAK;IACrC,gBAAgB;;;MACd,MAAM,QAAQ;+BACd,MAAM,MAAM,2FAAa,IAAI;+BAC7B,MAAM,MAAM,wFAAU,IAAI;+BAC1B,MAAM,MAAM,6FAAe,IAAI;+BAC/B,MAAM,MAAM,gGAAkB,IAAI;MAClC,MAAM,QAAQ;KAChB;;GACF;GACA,uBAAuB;IACrB,UAAU,sBAAsB,KAAK;IACrC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;GACA,sBAAsB;IACpB,UAAU,qBAAqB,KAAK;IACpC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;GACA,sBAAsB;IACpB,UAAU,qBAAqB,KAAK;IACpC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;EACF,CAAC;CACH;AACF"}
1
+ {"version":3,"file":"coreHeadersFeature.js","names":[],"sources":["../../../src/core/headers/coreHeadersFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n header_getContext,\n header_getLeafHeaders,\n table_getFlatHeaders,\n table_getFooterGroups,\n table_getHeaderGroups,\n table_getLeafHeaders,\n} from './coreHeadersFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that builds header groups and exposes header context APIs.\n */\nexport const coreHeadersFeature: TableFeature = {\n assignHeaderPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreHeadersFeature', prototype, table, {\n header_getLeafHeaders: {\n fn: (header) => header_getLeafHeaders(header),\n memoDeps: (header) => [header.column.table.options.columns],\n },\n header_getContext: {\n fn: (header) => header_getContext(header),\n memoDeps: (header) => [header.column.table.options.columns],\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('coreHeadersFeature', table, {\n table_getHeaderGroups: {\n fn: () => table_getHeaderGroups(table),\n memoDeps: () => [\n table.options.columns,\n table.atoms.columnOrder?.get(),\n table.atoms.grouping?.get(),\n table.atoms.columnPinning?.get(),\n table.atoms.columnVisibility?.get(),\n table.options.groupedColumnMode,\n ],\n },\n table_getFooterGroups: {\n fn: () => table_getFooterGroups(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n table_getFlatHeaders: {\n fn: () => table_getFlatHeaders(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n table_getLeafHeaders: {\n fn: () => table_getLeafHeaders(table),\n memoDeps: () => [table.getHeaderGroups()],\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAcA,MAAa,qBAAmC;CAC9C,wBAAwB,WAAW,UAAU;EAC3C,oBAAoB,sBAAsB,WAAW,OAAO;GAC1D,uBAAuB;IACrB,KAAK,WAAW,sBAAsB,MAAM;IAC5C,WAAW,WAAW,CAAC,OAAO,OAAO,MAAM,QAAQ,OAAO;GAC5D;GACA,mBAAmB;IACjB,KAAK,WAAW,kBAAkB,MAAM;IACxC,WAAW,WAAW,CAAC,OAAO,OAAO,MAAM,QAAQ,OAAO;GAC5D;EACF,CAAC;CACH;CAEA,qBAAqB,UAAU;EAC7B,gBAAgB,sBAAsB,OAAO;GAC3C,uBAAuB;IACrB,UAAU,sBAAsB,KAAK;IACrC,gBAAgB;KACd,MAAM,QAAQ;KACd,MAAM,MAAM,aAAa,IAAI;KAC7B,MAAM,MAAM,UAAU,IAAI;KAC1B,MAAM,MAAM,eAAe,IAAI;KAC/B,MAAM,MAAM,kBAAkB,IAAI;KAClC,MAAM,QAAQ;IAChB;GACF;GACA,uBAAuB;IACrB,UAAU,sBAAsB,KAAK;IACrC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;GACA,sBAAsB;IACpB,UAAU,qBAAqB,KAAK;IACpC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;GACA,sBAAsB;IACpB,UAAU,qBAAqB,KAAK;IACpC,gBAAgB,CAAC,MAAM,gBAAgB,CAAC;GAC1C;EACF,CAAC;CACH;AACF"}
@@ -53,8 +53,7 @@ function header_getContext(header) {
53
53
  * ```
54
54
  */
55
55
  function table_getHeaderGroups(table) {
56
- var _table$atoms$columnPi;
57
- const { left, right } = ((_table$atoms$columnPi = table.atoms.columnPinning) === null || _table$atoms$columnPi === void 0 ? void 0 : _table$atoms$columnPi.get()) ?? require_columnPinningFeature_utils.getDefaultColumnPinningState();
56
+ const { left, right } = table.atoms.columnPinning?.get() ?? require_columnPinningFeature_utils.getDefaultColumnPinningState();
58
57
  const allColumns = table.getAllColumns();
59
58
  const leafColumns = require_utils.callMemoOrStaticFn(table, "getVisibleLeafColumns", require_columnVisibilityFeature_utils.table_getVisibleLeafColumns);
60
59
  if (!left.length && !right.length) return require_buildHeaderGroups.buildHeaderGroups(allColumns, leafColumns, table);
@@ -122,8 +121,7 @@ function table_getFlatHeaders(table) {
122
121
  * ```
123
122
  */
124
123
  function table_getLeafHeaders(table) {
125
- var _table$getHeaderGroup;
126
- const topHeaders = ((_table$getHeaderGroup = table.getHeaderGroups()[0]) === null || _table$getHeaderGroup === void 0 ? void 0 : _table$getHeaderGroup.headers) ?? [];
124
+ const topHeaders = table.getHeaderGroups()[0]?.headers ?? [];
127
125
  const result = [];
128
126
  for (let i = 0; i < topHeaders.length; i++) {
129
127
  const leafHeaders = topHeaders[i].getLeafHeaders();
@@ -1 +1 @@
1
- {"version":3,"file":"coreHeadersFeature.utils.cjs","names":["getDefaultColumnPinningState","callMemoOrStaticFn","table_getVisibleLeafColumns","buildHeaderGroups","column_getIsVisible"],"sources":["../../../src/core/headers/coreHeadersFeature.utils.ts"],"sourcesContent":["import { getDefaultColumnPinningState } from '../../features/column-pinning/columnPinningFeature.utils'\nimport {\n column_getIsVisible,\n table_getVisibleLeafColumns,\n} from '../../features/column-visibility/columnVisibilityFeature.utils'\nimport { callMemoOrStaticFn } from '../../utils'\nimport { buildHeaderGroups } from './buildHeaderGroups'\nimport type { Table_Internal } from '../../types/Table'\nimport type { Header } from '../../types/Header'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header_Header } from './coreHeadersFeature.types'\nimport type { Column } from '../../types/Column'\n\n/**\n * Walks a header tree and collects all descendant leaf headers.\n *\n * The header itself is included after its descendants, matching the recursive\n * shape used by nested header groups.\n *\n * @example\n * ```ts\n * const leafHeaders = header_getLeafHeaders(header)\n * ```\n */\nexport function header_getLeafHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue,\n>(header: Header<TFeatures, TData, TValue>) {\n const leafHeaders: Array<Header<TFeatures, TData, TValue>> = []\n\n const recurseHeader = (h: Header_Header<TFeatures, TData, TValue>) => {\n if (h.subHeaders.length) {\n h.subHeaders.map(recurseHeader)\n }\n leafHeaders.push(h as Header<TFeatures, TData, TValue>)\n }\n\n recurseHeader(header)\n\n return leafHeaders\n}\n\n/**\n * Builds the render context passed to a column's `header` or `footer` template.\n *\n * The context contains the header, its column, and the owning table instance.\n *\n * @example\n * ```ts\n * const context = header_getContext(header)\n * ```\n */\nexport function header_getContext<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue,\n>(header: Header<TFeatures, TData, TValue>) {\n return {\n column: header.column,\n header,\n table: header.column.table,\n }\n}\n\n/**\n * Builds visible header groups for the current column tree.\n *\n * Column visibility and pinning are applied before groups are built. When no\n * columns are pinned, the fast path skips pin partitioning.\n *\n * @example\n * ```ts\n * const headerGroups = table_getHeaderGroups(table)\n * ```\n */\nexport function table_getHeaderGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const { left, right } =\n table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()\n const allColumns = table.getAllColumns()\n const leafColumns = callMemoOrStaticFn(\n table,\n 'getVisibleLeafColumns',\n table_getVisibleLeafColumns,\n )\n\n // Fast path: no columns are pinned — skip per-side lookups, partition, and spread.\n if (!left.length && !right.length) {\n return buildHeaderGroups(allColumns, leafColumns, table)\n }\n\n const leafColumnsById = table.getAllLeafColumnsById()\n\n const leftColumns: typeof leafColumns = []\n for (let i = 0; i < left.length; i++) {\n const column = leafColumnsById[left[i]!]\n if (\n column &&\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)\n ) {\n leftColumns.push(column)\n }\n }\n\n const rightColumns: typeof leafColumns = []\n for (let i = 0; i < right.length; i++) {\n const column = leafColumnsById[right[i]!]\n if (\n column &&\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)\n ) {\n rightColumns.push(column)\n }\n }\n\n const centerColumns = leafColumns.filter(\n (column) => !left.includes(column.id) && !right.includes(column.id),\n )\n\n return buildHeaderGroups(\n allColumns,\n [...leftColumns, ...centerColumns, ...rightColumns],\n table,\n )\n}\n\n/**\n * Builds footer groups by reversing the current header groups.\n *\n * Footer rendering uses the same header objects and grouping structure, but\n * renders them from leaf level back toward the root.\n *\n * @example\n * ```ts\n * const footerGroups = table_getFooterGroups(table)\n * ```\n */\nexport function table_getFooterGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const headerGroups = table.getHeaderGroups()\n return [...headerGroups].reverse()\n}\n\n/**\n * Flattens every header from every header group into one array.\n *\n * The result includes parent headers and placeholder headers, in header-group\n * order from top to bottom.\n *\n * @example\n * ```ts\n * const flatHeaders = table_getFlatHeaders(table)\n * ```\n */\nexport function table_getFlatHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const headerGroups = table.getHeaderGroups()\n const result: Array<Header<TFeatures, TData, unknown>> = []\n for (let i = 0; i < headerGroups.length; i++) {\n const headers = headerGroups[i]!.headers\n for (let j = 0; j < headers.length; j++) {\n result.push(headers[j]!)\n }\n }\n return result\n}\n\n/**\n * Collects only the leaf headers from the current header tree.\n *\n * Parent/group headers are skipped, making the result suitable for rendering\n * one header per visible leaf column.\n *\n * @example\n * ```ts\n * const leafHeaders = table_getLeafHeaders(table)\n * ```\n */\nexport function table_getLeafHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const topHeaders = table.getHeaderGroups()[0]?.headers ?? []\n const result: Array<Header<TFeatures, TData, unknown>> = []\n for (let i = 0; i < topHeaders.length; i++) {\n const leafHeaders = topHeaders[i]!.getLeafHeaders()\n for (let j = 0; j < leafHeaders.length; j++) {\n result.push(leafHeaders[j]!)\n }\n }\n return result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,SAAgB,sBAId,QAA0C;CAC1C,MAAM,cAAuD,CAAC;CAE9D,MAAM,iBAAiB,MAA+C;EACpE,IAAI,EAAE,WAAW,QACf,EAAE,WAAW,IAAI,aAAa;EAEhC,YAAY,KAAK,CAAqC;CACxD;CAEA,cAAc,MAAM;CAEpB,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,kBAId,QAA0C;CAC1C,OAAO;EACL,QAAQ,OAAO;EACf;EACA,OAAO,OAAO,OAAO;CACvB;AACF;;;;;;;;;;;;AAaA,SAAgB,sBAGd,OAAyC;;CACzC,MAAM,EAAE,MAAM,oCACZ,MAAM,MAAM,6FAAe,IAAI,MAAKA,gEAA6B;CACnE,MAAM,aAAa,MAAM,cAAc;CACvC,MAAM,cAAcC,iCAClB,OACA,yBACAC,iEACF;CAGA,IAAI,CAAC,KAAK,UAAU,CAAC,MAAM,QACzB,OAAOC,4CAAkB,YAAY,aAAa,KAAK;CAGzD,MAAM,kBAAkB,MAAM,sBAAsB;CAEpD,MAAM,cAAkC,CAAC;CACzC,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,SAAS,gBAAgB,KAAK;E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":"coreHeadersFeature.utils.cjs","names":["getDefaultColumnPinningState","callMemoOrStaticFn","table_getVisibleLeafColumns","buildHeaderGroups","column_getIsVisible"],"sources":["../../../src/core/headers/coreHeadersFeature.utils.ts"],"sourcesContent":["import { getDefaultColumnPinningState } from '../../features/column-pinning/columnPinningFeature.utils'\nimport {\n column_getIsVisible,\n table_getVisibleLeafColumns,\n} from '../../features/column-visibility/columnVisibilityFeature.utils'\nimport { callMemoOrStaticFn } from '../../utils'\nimport { buildHeaderGroups } from './buildHeaderGroups'\nimport type { Table_Internal } from '../../types/Table'\nimport type { Header } from '../../types/Header'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header_Header } from './coreHeadersFeature.types'\nimport type { Column } from '../../types/Column'\n\n/**\n * Walks a header tree and collects all descendant leaf headers.\n *\n * The header itself is included after its descendants, matching the recursive\n * shape used by nested header groups.\n *\n * @example\n * ```ts\n * const leafHeaders = header_getLeafHeaders(header)\n * ```\n */\nexport function header_getLeafHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue,\n>(header: Header<TFeatures, TData, TValue>) {\n const leafHeaders: Array<Header<TFeatures, TData, TValue>> = []\n\n const recurseHeader = (h: Header_Header<TFeatures, TData, TValue>) => {\n if (h.subHeaders.length) {\n h.subHeaders.map(recurseHeader)\n }\n leafHeaders.push(h as Header<TFeatures, TData, TValue>)\n }\n\n recurseHeader(header)\n\n return leafHeaders\n}\n\n/**\n * Builds the render context passed to a column's `header` or `footer` template.\n *\n * The context contains the header, its column, and the owning table instance.\n *\n * @example\n * ```ts\n * const context = header_getContext(header)\n * ```\n */\nexport function header_getContext<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue,\n>(header: Header<TFeatures, TData, TValue>) {\n return {\n column: header.column,\n header,\n table: header.column.table,\n }\n}\n\n/**\n * Builds visible header groups for the current column tree.\n *\n * Column visibility and pinning are applied before groups are built. When no\n * columns are pinned, the fast path skips pin partitioning.\n *\n * @example\n * ```ts\n * const headerGroups = table_getHeaderGroups(table)\n * ```\n */\nexport function table_getHeaderGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const { left, right } =\n table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()\n const allColumns = table.getAllColumns()\n const leafColumns = callMemoOrStaticFn(\n table,\n 'getVisibleLeafColumns',\n table_getVisibleLeafColumns,\n )\n\n // Fast path: no columns are pinned — skip per-side lookups, partition, and spread.\n if (!left.length && !right.length) {\n return buildHeaderGroups(allColumns, leafColumns, table)\n }\n\n const leafColumnsById = table.getAllLeafColumnsById()\n\n const leftColumns: typeof leafColumns = []\n for (let i = 0; i < left.length; i++) {\n const column = leafColumnsById[left[i]!]\n if (\n column &&\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)\n ) {\n leftColumns.push(column)\n }\n }\n\n const rightColumns: typeof leafColumns = []\n for (let i = 0; i < right.length; i++) {\n const column = leafColumnsById[right[i]!]\n if (\n column &&\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)\n ) {\n rightColumns.push(column)\n }\n }\n\n const centerColumns = leafColumns.filter(\n (column) => !left.includes(column.id) && !right.includes(column.id),\n )\n\n return buildHeaderGroups(\n allColumns,\n [...leftColumns, ...centerColumns, ...rightColumns],\n table,\n )\n}\n\n/**\n * Builds footer groups by reversing the current header groups.\n *\n * Footer rendering uses the same header objects and grouping structure, but\n * renders them from leaf level back toward the root.\n *\n * @example\n * ```ts\n * const footerGroups = table_getFooterGroups(table)\n * ```\n */\nexport function table_getFooterGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const headerGroups = table.getHeaderGroups()\n return [...headerGroups].reverse()\n}\n\n/**\n * Flattens every header from every header group into one array.\n *\n * The result includes parent headers and placeholder headers, in header-group\n * order from top to bottom.\n *\n * @example\n * ```ts\n * const flatHeaders = table_getFlatHeaders(table)\n * ```\n */\nexport function table_getFlatHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const headerGroups = table.getHeaderGroups()\n const result: Array<Header<TFeatures, TData, unknown>> = []\n for (let i = 0; i < headerGroups.length; i++) {\n const headers = headerGroups[i]!.headers\n for (let j = 0; j < headers.length; j++) {\n result.push(headers[j]!)\n }\n }\n return result\n}\n\n/**\n * Collects only the leaf headers from the current header tree.\n *\n * Parent/group headers are skipped, making the result suitable for rendering\n * one header per visible leaf column.\n *\n * @example\n * ```ts\n * const leafHeaders = table_getLeafHeaders(table)\n * ```\n */\nexport function table_getLeafHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const topHeaders = table.getHeaderGroups()[0]?.headers ?? []\n const result: Array<Header<TFeatures, TData, unknown>> = []\n for (let i = 0; i < topHeaders.length; i++) {\n const leafHeaders = topHeaders[i]!.getLeafHeaders()\n for (let j = 0; j < leafHeaders.length; j++) {\n result.push(leafHeaders[j]!)\n }\n }\n return result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,SAAgB,sBAId,QAA0C;CAC1C,MAAM,cAAuD,CAAC;CAE9D,MAAM,iBAAiB,MAA+C;EACpE,IAAI,EAAE,WAAW,QACf,EAAE,WAAW,IAAI,aAAa;EAEhC,YAAY,KAAK,CAAqC;CACxD;CAEA,cAAc,MAAM;CAEpB,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,kBAId,QAA0C;CAC1C,OAAO;EACL,QAAQ,OAAO;EACf;EACA,OAAO,OAAO,OAAO;CACvB;AACF;;;;;;;;;;;;AAaA,SAAgB,sBAGd,OAAyC;CACzC,MAAM,EAAE,MAAM,UACZ,MAAM,MAAM,eAAe,IAAI,KAAKA,gEAA6B;CACnE,MAAM,aAAa,MAAM,cAAc;CACvC,MAAM,cAAcC,iCAClB,OACA,yBACAC,iEACF;CAGA,IAAI,CAAC,KAAK,UAAU,CAAC,MAAM,QACzB,OAAO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,WAAW,QAAQ,KAAK;EAC1C,MAAM,cAAc,WAAW,EAAE,CAAE,eAAe;EAClD,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,QAAQ,KACtC,OAAO,KAAK,YAAY,EAAG;CAE/B;CACA,OAAO;AACT"}
@@ -53,8 +53,7 @@ function header_getContext(header) {
53
53
  * ```
54
54
  */
55
55
  function table_getHeaderGroups(table) {
56
- var _table$atoms$columnPi;
57
- const { left, right } = ((_table$atoms$columnPi = table.atoms.columnPinning) === null || _table$atoms$columnPi === void 0 ? void 0 : _table$atoms$columnPi.get()) ?? getDefaultColumnPinningState();
56
+ const { left, right } = table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState();
58
57
  const allColumns = table.getAllColumns();
59
58
  const leafColumns = callMemoOrStaticFn(table, "getVisibleLeafColumns", table_getVisibleLeafColumns);
60
59
  if (!left.length && !right.length) return buildHeaderGroups(allColumns, leafColumns, table);
@@ -122,8 +121,7 @@ function table_getFlatHeaders(table) {
122
121
  * ```
123
122
  */
124
123
  function table_getLeafHeaders(table) {
125
- var _table$getHeaderGroup;
126
- const topHeaders = ((_table$getHeaderGroup = table.getHeaderGroups()[0]) === null || _table$getHeaderGroup === void 0 ? void 0 : _table$getHeaderGroup.headers) ?? [];
124
+ const topHeaders = table.getHeaderGroups()[0]?.headers ?? [];
127
125
  const result = [];
128
126
  for (let i = 0; i < topHeaders.length; i++) {
129
127
  const leafHeaders = topHeaders[i].getLeafHeaders();
@@ -1 +1 @@
1
- {"version":3,"file":"coreHeadersFeature.utils.js","names":[],"sources":["../../../src/core/headers/coreHeadersFeature.utils.ts"],"sourcesContent":["import { getDefaultColumnPinningState } from '../../features/column-pinning/columnPinningFeature.utils'\nimport {\n column_getIsVisible,\n table_getVisibleLeafColumns,\n} from '../../features/column-visibility/columnVisibilityFeature.utils'\nimport { callMemoOrStaticFn } from '../../utils'\nimport { buildHeaderGroups } from './buildHeaderGroups'\nimport type { Table_Internal } from '../../types/Table'\nimport type { Header } from '../../types/Header'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header_Header } from './coreHeadersFeature.types'\nimport type { Column } from '../../types/Column'\n\n/**\n * Walks a header tree and collects all descendant leaf headers.\n *\n * The header itself is included after its descendants, matching the recursive\n * shape used by nested header groups.\n *\n * @example\n * ```ts\n * const leafHeaders = header_getLeafHeaders(header)\n * ```\n */\nexport function header_getLeafHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue,\n>(header: Header<TFeatures, TData, TValue>) {\n const leafHeaders: Array<Header<TFeatures, TData, TValue>> = []\n\n const recurseHeader = (h: Header_Header<TFeatures, TData, TValue>) => {\n if (h.subHeaders.length) {\n h.subHeaders.map(recurseHeader)\n }\n leafHeaders.push(h as Header<TFeatures, TData, TValue>)\n }\n\n recurseHeader(header)\n\n return leafHeaders\n}\n\n/**\n * Builds the render context passed to a column's `header` or `footer` template.\n *\n * The context contains the header, its column, and the owning table instance.\n *\n * @example\n * ```ts\n * const context = header_getContext(header)\n * ```\n */\nexport function header_getContext<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue,\n>(header: Header<TFeatures, TData, TValue>) {\n return {\n column: header.column,\n header,\n table: header.column.table,\n }\n}\n\n/**\n * Builds visible header groups for the current column tree.\n *\n * Column visibility and pinning are applied before groups are built. When no\n * columns are pinned, the fast path skips pin partitioning.\n *\n * @example\n * ```ts\n * const headerGroups = table_getHeaderGroups(table)\n * ```\n */\nexport function table_getHeaderGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const { left, right } =\n table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()\n const allColumns = table.getAllColumns()\n const leafColumns = callMemoOrStaticFn(\n table,\n 'getVisibleLeafColumns',\n table_getVisibleLeafColumns,\n )\n\n // Fast path: no columns are pinned — skip per-side lookups, partition, and spread.\n if (!left.length && !right.length) {\n return buildHeaderGroups(allColumns, leafColumns, table)\n }\n\n const leafColumnsById = table.getAllLeafColumnsById()\n\n const leftColumns: typeof leafColumns = []\n for (let i = 0; i < left.length; i++) {\n const column = leafColumnsById[left[i]!]\n if (\n column &&\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)\n ) {\n leftColumns.push(column)\n }\n }\n\n const rightColumns: typeof leafColumns = []\n for (let i = 0; i < right.length; i++) {\n const column = leafColumnsById[right[i]!]\n if (\n column &&\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)\n ) {\n rightColumns.push(column)\n }\n }\n\n const centerColumns = leafColumns.filter(\n (column) => !left.includes(column.id) && !right.includes(column.id),\n )\n\n return buildHeaderGroups(\n allColumns,\n [...leftColumns, ...centerColumns, ...rightColumns],\n table,\n )\n}\n\n/**\n * Builds footer groups by reversing the current header groups.\n *\n * Footer rendering uses the same header objects and grouping structure, but\n * renders them from leaf level back toward the root.\n *\n * @example\n * ```ts\n * const footerGroups = table_getFooterGroups(table)\n * ```\n */\nexport function table_getFooterGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const headerGroups = table.getHeaderGroups()\n return [...headerGroups].reverse()\n}\n\n/**\n * Flattens every header from every header group into one array.\n *\n * The result includes parent headers and placeholder headers, in header-group\n * order from top to bottom.\n *\n * @example\n * ```ts\n * const flatHeaders = table_getFlatHeaders(table)\n * ```\n */\nexport function table_getFlatHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const headerGroups = table.getHeaderGroups()\n const result: Array<Header<TFeatures, TData, unknown>> = []\n for (let i = 0; i < headerGroups.length; i++) {\n const headers = headerGroups[i]!.headers\n for (let j = 0; j < headers.length; j++) {\n result.push(headers[j]!)\n }\n }\n return result\n}\n\n/**\n * Collects only the leaf headers from the current header tree.\n *\n * Parent/group headers are skipped, making the result suitable for rendering\n * one header per visible leaf column.\n *\n * @example\n * ```ts\n * const leafHeaders = table_getLeafHeaders(table)\n * ```\n */\nexport function table_getLeafHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const topHeaders = table.getHeaderGroups()[0]?.headers ?? []\n const result: Array<Header<TFeatures, TData, unknown>> = []\n for (let i = 0; i < topHeaders.length; i++) {\n const leafHeaders = topHeaders[i]!.getLeafHeaders()\n for (let j = 0; j < leafHeaders.length; j++) {\n result.push(leafHeaders[j]!)\n }\n }\n return result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,SAAgB,sBAId,QAA0C;CAC1C,MAAM,cAAuD,CAAC;CAE9D,MAAM,iBAAiB,MAA+C;EACpE,IAAI,EAAE,WAAW,QACf,EAAE,WAAW,IAAI,aAAa;EAEhC,YAAY,KAAK,CAAqC;CACxD;CAEA,cAAc,MAAM;CAEpB,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,kBAId,QAA0C;CAC1C,OAAO;EACL,QAAQ,OAAO;EACf;EACA,OAAO,OAAO,OAAO;CACvB;AACF;;;;;;;;;;;;AAaA,SAAgB,sBAGd,OAAyC;;CACzC,MAAM,EAAE,MAAM,oCACZ,MAAM,MAAM,6FAAe,IAAI,MAAK,6BAA6B;CACnE,MAAM,aAAa,MAAM,cAAc;CACvC,MAAM,cAAc,mBAClB,OACA,yBACA,2BACF;CAGA,IAAI,CAAC,KAAK,UAAU,CAAC,MAAM,QACzB,OAAO,kBAAkB,YAAY,aAAa,KAAK;CAGzD,MAAM,kBAAkB,MAAM,sBAAsB;CAEpD,MAAM,cAAkC,CAAC;CACzC,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,SAAS,gBAAgB,KAAK;EACpC,IACE,UACA,mBAAmB,QAAQ,gBAAgB,mBAAmB,GAE9D,YAAY,KAAK,MAAM;CAE3B;CAEA,MAAM,eAAmC,CAAC;CAC1C,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,MAAM,SAAS,gBAAgB,MAAM;EACrC,IACE,UACA,mBAAmB,QAAQ,gBAAgB,mBAAmB,GAE9D,aAAa,KAAK,MAAM;CAE5B;CAEA,MAAM,gBAAgB,YAAY,QAC/B,WAAW,CAAC,KAAK,SAAS,OAAO,EAAE,KAAK,CAAC,MAAM,SAAS,OAAO,EAAE,CACpE;CAEA,OAAO,kBACL,YACA;EAAC,GAAG;EAAa,GAAG;EAAe,GAAG;CAAY,GAClD,KACF;AACF;;;;;;;;;;;;AAaA,SAAgB,sBAGd,OAAyC;CAEzC,OAAO,CAAC,GADa,MAAM,gBACL,CAAC,CAAC,CAAC,QAAQ;AACnC;;;;;;;;;;;;AAaA,SAAgB,qBAGd,OAAyC;CACzC,MAAM,eAAe,MAAM,gBAAgB;CAC3C,MAAM,SAAmD,CAAC;CAC1D,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;EAC5C,MAAM,UAAU,aAAa,EAAE,CAAE;EACjC,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAClC,OAAO,KAAK,QAAQ,EAAG;CAE3B;CACA,OAAO;AACT;;;;;;;;;;;;AAaA,SAAgB,qBAGd,OAAyC;;CACzC,MAAM,uCAAa,MAAM,gBAAgB,CAAC,CAAC,kFAAI,YAAW,CAAC;CAC3D,MAAM,SAAmD,CAAC;CAC1D,KAAK,IAAI,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;EAC1C,MAAM,cAAc,WAAW,EAAE,CAAE,eAAe;EAClD,KAAK,IAAI,IAAI,GAAG,IAAI,YAAY,QAAQ,KACtC,OAAO,KAAK,YAAY,EAAG;CAE/B;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"coreHeadersFeature.utils.js","names":[],"sources":["../../../src/core/headers/coreHeadersFeature.utils.ts"],"sourcesContent":["import { getDefaultColumnPinningState } from '../../features/column-pinning/columnPinningFeature.utils'\nimport {\n column_getIsVisible,\n table_getVisibleLeafColumns,\n} from '../../features/column-visibility/columnVisibilityFeature.utils'\nimport { callMemoOrStaticFn } from '../../utils'\nimport { buildHeaderGroups } from './buildHeaderGroups'\nimport type { Table_Internal } from '../../types/Table'\nimport type { Header } from '../../types/Header'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Header_Header } from './coreHeadersFeature.types'\nimport type { Column } from '../../types/Column'\n\n/**\n * Walks a header tree and collects all descendant leaf headers.\n *\n * The header itself is included after its descendants, matching the recursive\n * shape used by nested header groups.\n *\n * @example\n * ```ts\n * const leafHeaders = header_getLeafHeaders(header)\n * ```\n */\nexport function header_getLeafHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue,\n>(header: Header<TFeatures, TData, TValue>) {\n const leafHeaders: Array<Header<TFeatures, TData, TValue>> = []\n\n const recurseHeader = (h: Header_Header<TFeatures, TData, TValue>) => {\n if (h.subHeaders.length) {\n h.subHeaders.map(recurseHeader)\n }\n leafHeaders.push(h as Header<TFeatures, TData, TValue>)\n }\n\n recurseHeader(header)\n\n return leafHeaders\n}\n\n/**\n * Builds the render context passed to a column's `header` or `footer` template.\n *\n * The context contains the header, its column, and the owning table instance.\n *\n * @example\n * ```ts\n * const context = header_getContext(header)\n * ```\n */\nexport function header_getContext<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue,\n>(header: Header<TFeatures, TData, TValue>) {\n return {\n column: header.column,\n header,\n table: header.column.table,\n }\n}\n\n/**\n * Builds visible header groups for the current column tree.\n *\n * Column visibility and pinning are applied before groups are built. When no\n * columns are pinned, the fast path skips pin partitioning.\n *\n * @example\n * ```ts\n * const headerGroups = table_getHeaderGroups(table)\n * ```\n */\nexport function table_getHeaderGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const { left, right } =\n table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()\n const allColumns = table.getAllColumns()\n const leafColumns = callMemoOrStaticFn(\n table,\n 'getVisibleLeafColumns',\n table_getVisibleLeafColumns,\n )\n\n // Fast path: no columns are pinned — skip per-side lookups, partition, and spread.\n if (!left.length && !right.length) {\n return buildHeaderGroups(allColumns, leafColumns, table)\n }\n\n const leafColumnsById = table.getAllLeafColumnsById()\n\n const leftColumns: typeof leafColumns = []\n for (let i = 0; i < left.length; i++) {\n const column = leafColumnsById[left[i]!]\n if (\n column &&\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)\n ) {\n leftColumns.push(column)\n }\n }\n\n const rightColumns: typeof leafColumns = []\n for (let i = 0; i < right.length; i++) {\n const column = leafColumnsById[right[i]!]\n if (\n column &&\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible)\n ) {\n rightColumns.push(column)\n }\n }\n\n const centerColumns = leafColumns.filter(\n (column) => !left.includes(column.id) && !right.includes(column.id),\n )\n\n return buildHeaderGroups(\n allColumns,\n [...leftColumns, ...centerColumns, ...rightColumns],\n table,\n )\n}\n\n/**\n * Builds footer groups by reversing the current header groups.\n *\n * Footer rendering uses the same header objects and grouping structure, but\n * renders them from leaf level back toward the root.\n *\n * @example\n * ```ts\n * const footerGroups = table_getFooterGroups(table)\n * ```\n */\nexport function table_getFooterGroups<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const headerGroups = table.getHeaderGroups()\n return [...headerGroups].reverse()\n}\n\n/**\n * Flattens every header from every header group into one array.\n *\n * The result includes parent headers and placeholder headers, in header-group\n * order from top to bottom.\n *\n * @example\n * ```ts\n * const flatHeaders = table_getFlatHeaders(table)\n * ```\n */\nexport function table_getFlatHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const headerGroups = table.getHeaderGroups()\n const result: Array<Header<TFeatures, TData, unknown>> = []\n for (let i = 0; i < headerGroups.length; i++) {\n const headers = headerGroups[i]!.headers\n for (let j = 0; j < headers.length; j++) {\n result.push(headers[j]!)\n }\n }\n return result\n}\n\n/**\n * Collects only the leaf headers from the current header tree.\n *\n * Parent/group headers are skipped, making the result suitable for rendering\n * one header per visible leaf column.\n *\n * @example\n * ```ts\n * const leafHeaders = table_getLeafHeaders(table)\n * ```\n */\nexport function table_getLeafHeaders<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n const topHeaders = table.getHeaderGroups()[0]?.headers ?? []\n const result: Array<Header<TFeatures, TData, unknown>> = []\n for (let i = 0; i < topHeaders.length; i++) {\n const leafHeaders = topHeaders[i]!.getLeafHeaders()\n for (let j = 0; j < leafHeaders.length; j++) {\n result.push(leafHeaders[j]!)\n }\n }\n return result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,SAAgB,sBAId,QAA0C;CAC1C,MAAM,cAAuD,CAAC;CAE9D,MAAM,iBAAiB,MAA+C;EACpE,IAAI,EAAE,WAAW,QACf,EAAE,WAAW,IAAI,aAAa;EAEhC,YAAY,KAAK,CAAqC;CACxD;CAEA,cAAc,MAAM;CAEpB,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,kBAId,QAA0C;CAC1C,OAAO;EACL,QAAQ,OAAO;EACf;EACA,OAAO,OAAO,OAAO;CACvB;AACF;;;;;;;;;;;;AAaA,SAAgB,sBAGd,OAAyC;CACzC,MAAM,EAAE,MAAM,UACZ,MAAM,MAAM,eAAe,IAAI,KAAK,6BAA6B;CACnE,MAAM,aAAa,MAAM,cAAc;CACvC,MAAM,cAAc,mBAClB,OACA,yBACA,2BACF;CAGA,IAAI,CAAC,KAAK,UAAU,CAAC,MAAM,QACzB,OAAO,kBAAkB,YAAY,aAAa,KAAK;CAGzD,MAAM,kBAAkB,MAAM,sBAAsB;CAEpD,MAAM,cAAkC,CAAC;CACzC,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,SAAS,gBAAgB,KAAK;EACpC,IACE,UACA,mBAAmB,QAAQ,gBAAgB,mBAAmB,GAE9D,YAAY,KAAK,MAAM;CAE3B;CAEA,MAAM,eAA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import { Table_RowModels_Grouped } from "../../features/column-grouping/columnGroupingFeature.types.cjs";
2
4
  import { Table_RowModels_Expanded } from "../../features/row-expanding/rowExpandingFeature.types.cjs";
3
5
  import { Row } from "../../types/Row.cjs";
4
6
  import { Table_RowModels_Filtered } from "../../features/column-filtering/columnFilteringFeature.types.cjs";
5
7
  import { Table_RowModels_Paginated } from "../../features/row-pagination/rowPaginationFeature.types.cjs";
6
- import { Table_RowModels_Sorted } from "../../features/row-sorting/rowSortingFeature.types.cjs";
7
- import { TableFeatures } from "../../types/TableFeatures.cjs";
8
8
  import { Table_RowModels_Faceted } from "../../features/column-faceting/columnFacetingFeature.types.cjs";
9
- import { Table_RowModels_Grouped } from "../../features/column-grouping/columnGroupingFeature.types.cjs";
9
+ import { TableFeatures } from "../../types/TableFeatures.cjs";
10
10
 
11
11
  //#region src/core/row-models/coreRowModelsFeature.types.d.ts
12
12
  interface RowModel<in out TFeatures extends TableFeatures, in out TData extends RowData> {
@@ -1,12 +1,12 @@
1
1
  import { RowData } from "../../types/type-utils.js";
2
+ import { Table_RowModels_Sorted } from "../../features/row-sorting/rowSortingFeature.types.js";
3
+ import { Table_RowModels_Grouped } from "../../features/column-grouping/columnGroupingFeature.types.js";
2
4
  import { Table_RowModels_Expanded } from "../../features/row-expanding/rowExpandingFeature.types.js";
3
5
  import { Row } from "../../types/Row.js";
4
6
  import { Table_RowModels_Filtered } from "../../features/column-filtering/columnFilteringFeature.types.js";
5
7
  import { Table_RowModels_Paginated } from "../../features/row-pagination/rowPaginationFeature.types.js";
6
- import { Table_RowModels_Sorted } from "../../features/row-sorting/rowSortingFeature.types.js";
7
- import { TableFeatures } from "../../types/TableFeatures.js";
8
8
  import { Table_RowModels_Faceted } from "../../features/column-faceting/columnFacetingFeature.types.js";
9
- import { Table_RowModels_Grouped } from "../../features/column-grouping/columnGroupingFeature.types.js";
9
+ import { TableFeatures } from "../../types/TableFeatures.js";
10
10
 
11
11
  //#region src/core/row-models/coreRowModelsFeature.types.d.ts
12
12
  interface RowModel<in out TFeatures extends TableFeatures, in out TData extends RowData> {
@@ -13,10 +13,7 @@ const require_createCoreRowModel = require('./createCoreRowModel.cjs');
13
13
  * ```
14
14
  */
15
15
  function table_getCoreRowModel(table) {
16
- if (!table._rowModels.coreRowModel) {
17
- var _table$options$featur, _table$options$featur2;
18
- table._rowModels.coreRowModel = ((_table$options$featur = (_table$options$featur2 = table.options.features).coreRowModel) === null || _table$options$featur === void 0 ? void 0 : _table$options$featur.call(_table$options$featur2, table)) ?? require_createCoreRowModel.createCoreRowModel()(table);
19
- }
16
+ if (!table._rowModels.coreRowModel) table._rowModels.coreRowModel = table.options.features.coreRowModel?.(table) ?? require_createCoreRowModel.createCoreRowModel()(table);
20
17
  return table._rowModels.coreRowModel();
21
18
  }
22
19
  /**
@@ -46,10 +43,7 @@ function table_getPreFilteredRowModel(table) {
46
43
  * ```
47
44
  */
48
45
  function table_getFilteredRowModel(table) {
49
- if (!table._rowModels.filteredRowModel) {
50
- var _table$options$featur3, _table$options$featur4;
51
- table._rowModels.filteredRowModel = (_table$options$featur3 = (_table$options$featur4 = table.options.features).filteredRowModel) === null || _table$options$featur3 === void 0 ? void 0 : _table$options$featur3.call(_table$options$featur4, table);
52
- }
46
+ if (!table._rowModels.filteredRowModel) table._rowModels.filteredRowModel = table.options.features.filteredRowModel?.(table);
53
47
  if (table.options.manualFiltering || !table._rowModels.filteredRowModel) return table.getPreFilteredRowModel();
54
48
  return table._rowModels.filteredRowModel();
55
49
  }
@@ -78,10 +72,7 @@ function table_getPreGroupedRowModel(table) {
78
72
  * ```
79
73
  */
80
74
  function table_getGroupedRowModel(table) {
81
- if (!table._rowModels.groupedRowModel) {
82
- var _table$options$featur5, _table$options$featur6;
83
- table._rowModels.groupedRowModel = (_table$options$featur5 = (_table$options$featur6 = table.options.features).groupedRowModel) === null || _table$options$featur5 === void 0 ? void 0 : _table$options$featur5.call(_table$options$featur6, table);
84
- }
75
+ if (!table._rowModels.groupedRowModel) table._rowModels.groupedRowModel = table.options.features.groupedRowModel?.(table);
85
76
  if (table.options.manualGrouping || !table._rowModels.groupedRowModel) return table.getPreGroupedRowModel();
86
77
  return table._rowModels.groupedRowModel();
87
78
  }
@@ -111,10 +102,7 @@ function table_getPreSortedRowModel(table) {
111
102
  * ```
112
103
  */
113
104
  function table_getSortedRowModel(table) {
114
- if (!table._rowModels.sortedRowModel) {
115
- var _table$options$featur7, _table$options$featur8;
116
- table._rowModels.sortedRowModel = (_table$options$featur7 = (_table$options$featur8 = table.options.features).sortedRowModel) === null || _table$options$featur7 === void 0 ? void 0 : _table$options$featur7.call(_table$options$featur8, table);
117
- }
105
+ if (!table._rowModels.sortedRowModel) table._rowModels.sortedRowModel = table.options.features.sortedRowModel?.(table);
118
106
  if (table.options.manualSorting || !table._rowModels.sortedRowModel) return table.getPreSortedRowModel();
119
107
  return table._rowModels.sortedRowModel();
120
108
  }
@@ -143,10 +131,7 @@ function table_getPreExpandedRowModel(table) {
143
131
  * ```
144
132
  */
145
133
  function table_getExpandedRowModel(table) {
146
- if (!table._rowModels.expandedRowModel) {
147
- var _table$options$featur9, _table$options$featur10;
148
- table._rowModels.expandedRowModel = (_table$options$featur9 = (_table$options$featur10 = table.options.features).expandedRowModel) === null || _table$options$featur9 === void 0 ? void 0 : _table$options$featur9.call(_table$options$featur10, table);
149
- }
134
+ if (!table._rowModels.expandedRowModel) table._rowModels.expandedRowModel = table.options.features.expandedRowModel?.(table);
150
135
  if (table.options.manualExpanding || !table._rowModels.expandedRowModel) return table.getPreExpandedRowModel();
151
136
  return table._rowModels.expandedRowModel();
152
137
  }
@@ -177,10 +162,7 @@ function table_getPrePaginatedRowModel(table) {
177
162
  * ```
178
163
  */
179
164
  function table_getPaginatedRowModel(table) {
180
- if (!table._rowModels.paginatedRowModel) {
181
- var _table$options$featur11, _table$options$featur12;
182
- table._rowModels.paginatedRowModel = (_table$options$featur11 = (_table$options$featur12 = table.options.features).paginatedRowModel) === null || _table$options$featur11 === void 0 ? void 0 : _table$options$featur11.call(_table$options$featur12, table);
183
- }
165
+ if (!table._rowModels.paginatedRowModel) table._rowModels.paginatedRowModel = table.options.features.paginatedRowModel?.(table);
184
166
  if (table.options.manualPagination || !table._rowModels.paginatedRowModel) return table.getPrePaginatedRowModel();
185
167
  return table._rowModels.paginatedRowModel();
186
168
  }
@@ -1 +1 @@
1
- {"version":3,"file":"coreRowModelsFeature.utils.cjs","names":["createCoreRowModel"],"sources":["../../../src/core/row-models/coreRowModelsFeature.utils.ts"],"sourcesContent":["import { createCoreRowModel } from './createCoreRowModel'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { RowData } from '../../types/type-utils'\nimport type { RowModel } from './coreRowModelsFeature.types'\n\n/**\n * Resolves the table's unmodified core row model.\n *\n * The factory is created once per table, either from the `coreRowModel` slot on the `features` option\n * or the built-in `createCoreRowModel()`, then reused for later calls.\n *\n * @example\n * ```ts\n * const coreRows = table_getCoreRowModel(table)\n * ```\n */\nexport function table_getCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.coreRowModel) {\n table._rowModels.coreRowModel =\n table.options.features.coreRowModel?.(table) ??\n createCoreRowModel<TFeatures, TData>()(table)\n }\n\n return table._rowModels.coreRowModel()\n}\n\n/**\n * Reads the row model immediately before column/global filtering.\n *\n * Filtering is the first derived row-model stage, so this currently aliases\n * `table.getCoreRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeFiltering = table_getPreFilteredRowModel(table)\n * ```\n */\nexport function table_getPreFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getCoreRowModel()\n}\n\n/**\n * Resolves the row model after column and global filtering.\n *\n * When `manualFiltering` is enabled, or no filtered row-model factory was\n * registered, this returns the pre-filtered row model because filtering is\n * expected to happen outside the table.\n *\n * @example\n * ```ts\n * const filteredRows = table_getFilteredRowModel(table)\n * ```\n */\nexport function table_getFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.filteredRowModel) {\n table._rowModels.filteredRowModel =\n table.options.features.filteredRowModel?.(table)\n }\n\n if (table.options.manualFiltering || !table._rowModels.filteredRowModel) {\n return table.getPreFilteredRowModel()\n }\n\n return table._rowModels.filteredRowModel()\n}\n\n/**\n * Reads the row model immediately before grouping.\n *\n * Grouping runs after filtering, so this aliases `table.getFilteredRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeGrouping = table_getPreGroupedRowModel(table)\n * ```\n */\nexport function table_getPreGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getFilteredRowModel()\n}\n\n/**\n * Resolves the row model after grouping has produced grouped and aggregated rows.\n *\n * When `manualGrouping` is enabled, or no grouped row-model factory was\n * registered, this returns the pre-grouped row model unchanged.\n *\n * @example\n * ```ts\n * const groupedRows = table_getGroupedRowModel(table)\n * ```\n */\nexport function table_getGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.groupedRowModel) {\n table._rowModels.groupedRowModel =\n table.options.features.groupedRowModel?.(table)\n }\n\n if (table.options.manualGrouping || !table._rowModels.groupedRowModel) {\n return table.getPreGroupedRowModel()\n }\n\n return table._rowModels.groupedRowModel()\n}\n\n/**\n * Reads the row model immediately before sorting.\n *\n * Sorting runs after grouping, so this aliases `table.getGroupedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeSorting = table_getPreSortedRowModel(table)\n * ```\n */\nexport function table_getPreSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getGroupedRowModel()\n}\n\n/**\n * Resolves the row model after sorting has been applied.\n *\n * When `manualSorting` is enabled, or no sorted row-model factory was\n * registered, this returns the pre-sorted row model because sorted data is\n * expected to be supplied by the caller.\n *\n * @example\n * ```ts\n * const sortedRows = table_getSortedRowModel(table)\n * ```\n */\nexport function table_getSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.sortedRowModel) {\n table._rowModels.sortedRowModel =\n table.options.features.sortedRowModel?.(table)\n }\n\n if (table.options.manualSorting || !table._rowModels.sortedRowModel) {\n return table.getPreSortedRowModel()\n }\n\n return table._rowModels.sortedRowModel()\n}\n\n/**\n * Reads the row model immediately before row expansion.\n *\n * Expansion runs after sorting, so this aliases `table.getSortedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeExpansion = table_getPreExpandedRowModel(table)\n * ```\n */\nexport function table_getPreExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getSortedRowModel()\n}\n\n/**\n * Resolves the row model after expanded rows have been flattened into view.\n *\n * When `manualExpanding` is enabled, or no expanded row-model factory was\n * registered, this returns the pre-expanded row model unchanged.\n *\n * @example\n * ```ts\n * const expandedRows = table_getExpandedRowModel(table)\n * ```\n */\nexport function table_getExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.expandedRowModel) {\n table._rowModels.expandedRowModel =\n table.options.features.expandedRowModel?.(table)\n }\n\n if (table.options.manualExpanding || !table._rowModels.expandedRowModel) {\n return table.getPreExpandedRowModel()\n }\n\n return table._rowModels.expandedRowModel()\n}\n\n/**\n * Reads the row model immediately before pagination.\n *\n * Pagination is the final built-in row-model stage, so this aliases\n * `table.getExpandedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforePagination = table_getPrePaginatedRowModel(table)\n * ```\n */\nexport function table_getPrePaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getExpandedRowModel()\n}\n\n/**\n * Resolves the row model after pagination has sliced rows for the current page.\n *\n * When `manualPagination` is enabled, or no paginated row-model factory was\n * registered, this returns the pre-paginated row model because pagination is\n * expected to happen before data reaches the table.\n *\n * @example\n * ```ts\n * const pageRows = table_getPaginatedRowModel(table)\n * ```\n */\nexport function table_getPaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.paginatedRowModel) {\n table._rowModels.paginatedRowModel =\n table.options.features.paginatedRowModel?.(table)\n }\n\n if (table.options.manualPagination || !table._rowModels.paginatedRowModel) {\n return table.getPrePaginatedRowModel()\n }\n\n return table._rowModels.paginatedRowModel()\n}\n\n/**\n * Resolves the final row model consumed by renderers.\n *\n * This is the end of the built-in row-model pipeline: core -> filtering ->\n * grouping -> sorting -> expanding -> pagination.\n *\n * @example\n * ```ts\n * const visibleRows = table_getRowModel(table)\n * ```\n */\nexport function table_getRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getPaginatedRowModel()\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,sBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,cAAc;;EAClC,MAAM,WAAW,mEACf,MAAM,QAAQ,UAAS,yHAAe,KAAK,MAC3CA,8CAAqC,CAAC,CAAC,KAAK;CAChD;CAEA,OAAO,MAAM,WAAW,aAAa;AACvC;;;;;;;;;;;;AAaA,SAAgB,6BAGd,OAAqE;CACrE,OAAO,MAAM,gBAAgB;AAC/B;;;;;;;;;;;;;AAcA,SAAgB,0BAGd,OAAqE;CACrE,IAAI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;;AAaA,SAAgB,8BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;;AAcA,SAAgB,2BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,mBAAmB;;EACvC,MAAM,WAAW,0EACf,MAAM,QAAQ,UAAS,mIAAoB,KAAK;CACpD;CAEA,IAAI,MAAM,QAAQ,oBAAoB,CAAC,MAAM,WAAW,mBACtD,OAAO,MAAM,wBAAwB;CAGvC,OAAO,MAAM,WAAW,kBAAkB;AAC5C;;;;;;;;;;;;AAaA,SAAgB,kBAGd,OAAqE;CACrE,OAAO,MAAM,qBAAqB;AACpC"}
1
+ {"version":3,"file":"coreRowModelsFeature.utils.cjs","names":["createCoreRowModel"],"sources":["../../../src/core/row-models/coreRowModelsFeature.utils.ts"],"sourcesContent":["import { createCoreRowModel } from './createCoreRowModel'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { RowData } from '../../types/type-utils'\nimport type { RowModel } from './coreRowModelsFeature.types'\n\n/**\n * Resolves the table's unmodified core row model.\n *\n * The factory is created once per table, either from the `coreRowModel` slot on the `features` option\n * or the built-in `createCoreRowModel()`, then reused for later calls.\n *\n * @example\n * ```ts\n * const coreRows = table_getCoreRowModel(table)\n * ```\n */\nexport function table_getCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.coreRowModel) {\n table._rowModels.coreRowModel =\n table.options.features.coreRowModel?.(table) ??\n createCoreRowModel<TFeatures, TData>()(table)\n }\n\n return table._rowModels.coreRowModel()\n}\n\n/**\n * Reads the row model immediately before column/global filtering.\n *\n * Filtering is the first derived row-model stage, so this currently aliases\n * `table.getCoreRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeFiltering = table_getPreFilteredRowModel(table)\n * ```\n */\nexport function table_getPreFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getCoreRowModel()\n}\n\n/**\n * Resolves the row model after column and global filtering.\n *\n * When `manualFiltering` is enabled, or no filtered row-model factory was\n * registered, this returns the pre-filtered row model because filtering is\n * expected to happen outside the table.\n *\n * @example\n * ```ts\n * const filteredRows = table_getFilteredRowModel(table)\n * ```\n */\nexport function table_getFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.filteredRowModel) {\n table._rowModels.filteredRowModel =\n table.options.features.filteredRowModel?.(table)\n }\n\n if (table.options.manualFiltering || !table._rowModels.filteredRowModel) {\n return table.getPreFilteredRowModel()\n }\n\n return table._rowModels.filteredRowModel()\n}\n\n/**\n * Reads the row model immediately before grouping.\n *\n * Grouping runs after filtering, so this aliases `table.getFilteredRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeGrouping = table_getPreGroupedRowModel(table)\n * ```\n */\nexport function table_getPreGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getFilteredRowModel()\n}\n\n/**\n * Resolves the row model after grouping has produced grouped and aggregated rows.\n *\n * When `manualGrouping` is enabled, or no grouped row-model factory was\n * registered, this returns the pre-grouped row model unchanged.\n *\n * @example\n * ```ts\n * const groupedRows = table_getGroupedRowModel(table)\n * ```\n */\nexport function table_getGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.groupedRowModel) {\n table._rowModels.groupedRowModel =\n table.options.features.groupedRowModel?.(table)\n }\n\n if (table.options.manualGrouping || !table._rowModels.groupedRowModel) {\n return table.getPreGroupedRowModel()\n }\n\n return table._rowModels.groupedRowModel()\n}\n\n/**\n * Reads the row model immediately before sorting.\n *\n * Sorting runs after grouping, so this aliases `table.getGroupedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeSorting = table_getPreSortedRowModel(table)\n * ```\n */\nexport function table_getPreSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getGroupedRowModel()\n}\n\n/**\n * Resolves the row model after sorting has been applied.\n *\n * When `manualSorting` is enabled, or no sorted row-model factory was\n * registered, this returns the pre-sorted row model because sorted data is\n * expected to be supplied by the caller.\n *\n * @example\n * ```ts\n * const sortedRows = table_getSortedRowModel(table)\n * ```\n */\nexport function table_getSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.sortedRowModel) {\n table._rowModels.sortedRowModel =\n table.options.features.sortedRowModel?.(table)\n }\n\n if (table.options.manualSorting || !table._rowModels.sortedRowModel) {\n return table.getPreSortedRowModel()\n }\n\n return table._rowModels.sortedRowModel()\n}\n\n/**\n * Reads the row model immediately before row expansion.\n *\n * Expansion runs after sorting, so this aliases `table.getSortedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeExpansion = table_getPreExpandedRowModel(table)\n * ```\n */\nexport function table_getPreExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getSortedRowModel()\n}\n\n/**\n * Resolves the row model after expanded rows have been flattened into view.\n *\n * When `manualExpanding` is enabled, or no expanded row-model factory was\n * registered, this returns the pre-expanded row model unchanged.\n *\n * @example\n * ```ts\n * const expandedRows = table_getExpandedRowModel(table)\n * ```\n */\nexport function table_getExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.expandedRowModel) {\n table._rowModels.expandedRowModel =\n table.options.features.expandedRowModel?.(table)\n }\n\n if (table.options.manualExpanding || !table._rowModels.expandedRowModel) {\n return table.getPreExpandedRowModel()\n }\n\n return table._rowModels.expandedRowModel()\n}\n\n/**\n * Reads the row model immediately before pagination.\n *\n * Pagination is the final built-in row-model stage, so this aliases\n * `table.getExpandedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforePagination = table_getPrePaginatedRowModel(table)\n * ```\n */\nexport function table_getPrePaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getExpandedRowModel()\n}\n\n/**\n * Resolves the row model after pagination has sliced rows for the current page.\n *\n * When `manualPagination` is enabled, or no paginated row-model factory was\n * registered, this returns the pre-paginated row model because pagination is\n * expected to happen before data reaches the table.\n *\n * @example\n * ```ts\n * const pageRows = table_getPaginatedRowModel(table)\n * ```\n */\nexport function table_getPaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.paginatedRowModel) {\n table._rowModels.paginatedRowModel =\n table.options.features.paginatedRowModel?.(table)\n }\n\n if (table.options.manualPagination || !table._rowModels.paginatedRowModel) {\n return table.getPrePaginatedRowModel()\n }\n\n return table._rowModels.paginatedRowModel()\n}\n\n/**\n * Resolves the final row model consumed by renderers.\n *\n * This is the end of the built-in row-model pipeline: core -> filtering ->\n * grouping -> sorting -> expanding -> pagination.\n *\n * @example\n * ```ts\n * const visibleRows = table_getRowModel(table)\n * ```\n */\nexport function table_getRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getPaginatedRowModel()\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,sBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,cACpB,MAAM,WAAW,eACf,MAAM,QAAQ,SAAS,eAAe,KAAK,KAC3CA,8CAAqC,CAAC,CA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I,MAAM,QAAQ,mBAAmB,CAAC,MAAM,WAAW,kBACrD,OAAO,MAAM,uBAAuB;CAGtC,OAAO,MAAM,WAAW,iBAAiB;AAC3C;;;;;;;;;;;;AAaA,SAAgB,8BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;;AAcA,SAAgB,2BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,mBACpB,MAAM,WAAW,oBACf,MAAM,QAAQ,SAAS,oBAAoB,KAAK;CAGpD,IAAI,MAAM,QAAQ,oBAAoB,CAAC,MAAM,WAAW,mBACtD,OAAO,MAAM,wBAAwB;CAGvC,OAAO,MAAM,WAAW,kBAAkB;AAC5C;;;;;;;;;;;;AAaA,SAAgB,kBAGd,OAAqE;CACrE,OAAO,MAAM,qBAAqB;AACpC"}
@@ -1,7 +1,7 @@
1
1
  import { RowData } from "../../types/type-utils.cjs";
2
+ import { RowModel } from "./coreRowModelsFeature.types.cjs";
2
3
  import { Table } from "../../types/Table.cjs";
3
4
  import { TableFeatures } from "../../types/TableFeatures.cjs";
4
- import { RowModel } from "./coreRowModelsFeature.types.cjs";
5
5
 
6
6
  //#region src/core/row-models/coreRowModelsFeature.utils.d.ts
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { RowData } from "../../types/type-utils.js";
2
+ import { RowModel } from "./coreRowModelsFeature.types.js";
2
3
  import { Table } from "../../types/Table.js";
3
4
  import { TableFeatures } from "../../types/TableFeatures.js";
4
- import { RowModel } from "./coreRowModelsFeature.types.js";
5
5
 
6
6
  //#region src/core/row-models/coreRowModelsFeature.utils.d.ts
7
7
  /**
@@ -13,10 +13,7 @@ import { createCoreRowModel } from "./createCoreRowModel.js";
13
13
  * ```
14
14
  */
15
15
  function table_getCoreRowModel(table) {
16
- if (!table._rowModels.coreRowModel) {
17
- var _table$options$featur, _table$options$featur2;
18
- table._rowModels.coreRowModel = ((_table$options$featur = (_table$options$featur2 = table.options.features).coreRowModel) === null || _table$options$featur === void 0 ? void 0 : _table$options$featur.call(_table$options$featur2, table)) ?? createCoreRowModel()(table);
19
- }
16
+ if (!table._rowModels.coreRowModel) table._rowModels.coreRowModel = table.options.features.coreRowModel?.(table) ?? createCoreRowModel()(table);
20
17
  return table._rowModels.coreRowModel();
21
18
  }
22
19
  /**
@@ -46,10 +43,7 @@ function table_getPreFilteredRowModel(table) {
46
43
  * ```
47
44
  */
48
45
  function table_getFilteredRowModel(table) {
49
- if (!table._rowModels.filteredRowModel) {
50
- var _table$options$featur3, _table$options$featur4;
51
- table._rowModels.filteredRowModel = (_table$options$featur3 = (_table$options$featur4 = table.options.features).filteredRowModel) === null || _table$options$featur3 === void 0 ? void 0 : _table$options$featur3.call(_table$options$featur4, table);
52
- }
46
+ if (!table._rowModels.filteredRowModel) table._rowModels.filteredRowModel = table.options.features.filteredRowModel?.(table);
53
47
  if (table.options.manualFiltering || !table._rowModels.filteredRowModel) return table.getPreFilteredRowModel();
54
48
  return table._rowModels.filteredRowModel();
55
49
  }
@@ -78,10 +72,7 @@ function table_getPreGroupedRowModel(table) {
78
72
  * ```
79
73
  */
80
74
  function table_getGroupedRowModel(table) {
81
- if (!table._rowModels.groupedRowModel) {
82
- var _table$options$featur5, _table$options$featur6;
83
- table._rowModels.groupedRowModel = (_table$options$featur5 = (_table$options$featur6 = table.options.features).groupedRowModel) === null || _table$options$featur5 === void 0 ? void 0 : _table$options$featur5.call(_table$options$featur6, table);
84
- }
75
+ if (!table._rowModels.groupedRowModel) table._rowModels.groupedRowModel = table.options.features.groupedRowModel?.(table);
85
76
  if (table.options.manualGrouping || !table._rowModels.groupedRowModel) return table.getPreGroupedRowModel();
86
77
  return table._rowModels.groupedRowModel();
87
78
  }
@@ -111,10 +102,7 @@ function table_getPreSortedRowModel(table) {
111
102
  * ```
112
103
  */
113
104
  function table_getSortedRowModel(table) {
114
- if (!table._rowModels.sortedRowModel) {
115
- var _table$options$featur7, _table$options$featur8;
116
- table._rowModels.sortedRowModel = (_table$options$featur7 = (_table$options$featur8 = table.options.features).sortedRowModel) === null || _table$options$featur7 === void 0 ? void 0 : _table$options$featur7.call(_table$options$featur8, table);
117
- }
105
+ if (!table._rowModels.sortedRowModel) table._rowModels.sortedRowModel = table.options.features.sortedRowModel?.(table);
118
106
  if (table.options.manualSorting || !table._rowModels.sortedRowModel) return table.getPreSortedRowModel();
119
107
  return table._rowModels.sortedRowModel();
120
108
  }
@@ -143,10 +131,7 @@ function table_getPreExpandedRowModel(table) {
143
131
  * ```
144
132
  */
145
133
  function table_getExpandedRowModel(table) {
146
- if (!table._rowModels.expandedRowModel) {
147
- var _table$options$featur9, _table$options$featur10;
148
- table._rowModels.expandedRowModel = (_table$options$featur9 = (_table$options$featur10 = table.options.features).expandedRowModel) === null || _table$options$featur9 === void 0 ? void 0 : _table$options$featur9.call(_table$options$featur10, table);
149
- }
134
+ if (!table._rowModels.expandedRowModel) table._rowModels.expandedRowModel = table.options.features.expandedRowModel?.(table);
150
135
  if (table.options.manualExpanding || !table._rowModels.expandedRowModel) return table.getPreExpandedRowModel();
151
136
  return table._rowModels.expandedRowModel();
152
137
  }
@@ -177,10 +162,7 @@ function table_getPrePaginatedRowModel(table) {
177
162
  * ```
178
163
  */
179
164
  function table_getPaginatedRowModel(table) {
180
- if (!table._rowModels.paginatedRowModel) {
181
- var _table$options$featur11, _table$options$featur12;
182
- table._rowModels.paginatedRowModel = (_table$options$featur11 = (_table$options$featur12 = table.options.features).paginatedRowModel) === null || _table$options$featur11 === void 0 ? void 0 : _table$options$featur11.call(_table$options$featur12, table);
183
- }
165
+ if (!table._rowModels.paginatedRowModel) table._rowModels.paginatedRowModel = table.options.features.paginatedRowModel?.(table);
184
166
  if (table.options.manualPagination || !table._rowModels.paginatedRowModel) return table.getPrePaginatedRowModel();
185
167
  return table._rowModels.paginatedRowModel();
186
168
  }