@tanstack/table-core 9.0.0-beta.1 → 9.0.0-beta.10

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 (432) hide show
  1. package/dist/core/cells/constructCell.d.cts +1 -1
  2. package/dist/core/cells/constructCell.d.ts +1 -1
  3. package/dist/core/cells/coreCellsFeature.cjs +11 -20
  4. package/dist/core/cells/coreCellsFeature.cjs.map +1 -1
  5. package/dist/core/cells/coreCellsFeature.d.cts +4 -12
  6. package/dist/core/cells/coreCellsFeature.d.ts +4 -12
  7. package/dist/core/cells/coreCellsFeature.js +12 -20
  8. package/dist/core/cells/coreCellsFeature.js.map +1 -1
  9. package/dist/core/cells/coreCellsFeature.types.d.cts +1 -1
  10. package/dist/core/cells/coreCellsFeature.types.d.ts +1 -1
  11. package/dist/core/cells/coreCellsFeature.utils.d.cts +1 -1
  12. package/dist/core/cells/coreCellsFeature.utils.d.ts +1 -1
  13. package/dist/core/columns/constructColumn.d.cts +1 -1
  14. package/dist/core/columns/constructColumn.d.ts +1 -1
  15. package/dist/core/columns/coreColumnsFeature.cjs +59 -68
  16. package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
  17. package/dist/core/columns/coreColumnsFeature.d.cts +4 -12
  18. package/dist/core/columns/coreColumnsFeature.d.ts +4 -12
  19. package/dist/core/columns/coreColumnsFeature.js +60 -68
  20. package/dist/core/columns/coreColumnsFeature.js.map +1 -1
  21. package/dist/core/columns/coreColumnsFeature.types.d.cts +1 -1
  22. package/dist/core/columns/coreColumnsFeature.types.d.ts +1 -1
  23. package/dist/core/columns/coreColumnsFeature.utils.d.cts +1 -1
  24. package/dist/core/columns/coreColumnsFeature.utils.d.ts +1 -1
  25. package/dist/core/coreFeatures.cjs.map +1 -1
  26. package/dist/core/coreFeatures.d.cts +1 -1
  27. package/dist/core/coreFeatures.d.ts +1 -1
  28. package/dist/core/coreFeatures.js.map +1 -1
  29. package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
  30. package/dist/core/headers/buildHeaderGroups.d.cts +1 -1
  31. package/dist/core/headers/buildHeaderGroups.d.ts +1 -1
  32. package/dist/core/headers/buildHeaderGroups.js.map +1 -1
  33. package/dist/core/headers/constructHeader.d.cts +1 -1
  34. package/dist/core/headers/constructHeader.d.ts +1 -1
  35. package/dist/core/headers/coreHeadersFeature.cjs +44 -53
  36. package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
  37. package/dist/core/headers/coreHeadersFeature.d.cts +4 -12
  38. package/dist/core/headers/coreHeadersFeature.d.ts +4 -12
  39. package/dist/core/headers/coreHeadersFeature.js +45 -53
  40. package/dist/core/headers/coreHeadersFeature.js.map +1 -1
  41. package/dist/core/headers/coreHeadersFeature.types.d.cts +1 -1
  42. package/dist/core/headers/coreHeadersFeature.types.d.ts +1 -1
  43. package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
  44. package/dist/core/headers/coreHeadersFeature.utils.d.cts +1 -1
  45. package/dist/core/headers/coreHeadersFeature.utils.d.ts +1 -1
  46. package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
  47. package/dist/core/row-models/coreRowModelsFeature.cjs +17 -26
  48. package/dist/core/row-models/coreRowModelsFeature.cjs.map +1 -1
  49. package/dist/core/row-models/coreRowModelsFeature.d.cts +4 -12
  50. package/dist/core/row-models/coreRowModelsFeature.d.ts +4 -12
  51. package/dist/core/row-models/coreRowModelsFeature.js +18 -26
  52. package/dist/core/row-models/coreRowModelsFeature.js.map +1 -1
  53. package/dist/core/row-models/coreRowModelsFeature.types.d.cts +3 -13
  54. package/dist/core/row-models/coreRowModelsFeature.types.d.ts +3 -13
  55. package/dist/core/row-models/coreRowModelsFeature.utils.cjs +13 -13
  56. package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
  57. package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +2 -2
  58. package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +2 -2
  59. package/dist/core/row-models/coreRowModelsFeature.utils.js +13 -13
  60. package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
  61. package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
  62. package/dist/core/row-models/createCoreRowModel.d.cts +1 -1
  63. package/dist/core/row-models/createCoreRowModel.d.ts +1 -1
  64. package/dist/core/row-models/createCoreRowModel.js.map +1 -1
  65. package/dist/core/rows/constructRow.d.cts +1 -1
  66. package/dist/core/rows/constructRow.d.ts +1 -1
  67. package/dist/core/rows/coreRowsFeature.cjs +27 -36
  68. package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
  69. package/dist/core/rows/coreRowsFeature.d.cts +4 -12
  70. package/dist/core/rows/coreRowsFeature.d.ts +4 -12
  71. package/dist/core/rows/coreRowsFeature.js +28 -36
  72. package/dist/core/rows/coreRowsFeature.js.map +1 -1
  73. package/dist/core/rows/coreRowsFeature.types.d.cts +1 -1
  74. package/dist/core/rows/coreRowsFeature.types.d.ts +1 -1
  75. package/dist/core/rows/coreRowsFeature.utils.d.cts +1 -1
  76. package/dist/core/rows/coreRowsFeature.utils.d.ts +1 -1
  77. package/dist/core/table/constructTable.cjs +21 -6
  78. package/dist/core/table/constructTable.cjs.map +1 -1
  79. package/dist/core/table/constructTable.d.cts +1 -1
  80. package/dist/core/table/constructTable.d.ts +1 -1
  81. package/dist/core/table/constructTable.js +21 -6
  82. package/dist/core/table/constructTable.js.map +1 -1
  83. package/dist/core/table/coreTablesFeature.cjs +7 -16
  84. package/dist/core/table/coreTablesFeature.cjs.map +1 -1
  85. package/dist/core/table/coreTablesFeature.d.cts +4 -12
  86. package/dist/core/table/coreTablesFeature.d.ts +4 -12
  87. package/dist/core/table/coreTablesFeature.js +8 -16
  88. package/dist/core/table/coreTablesFeature.js.map +1 -1
  89. package/dist/core/table/coreTablesFeature.types.d.cts +23 -11
  90. package/dist/core/table/coreTablesFeature.types.d.ts +23 -11
  91. package/dist/core/table/coreTablesFeature.utils.cjs +1 -2
  92. package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
  93. package/dist/core/table/coreTablesFeature.utils.d.cts +1 -1
  94. package/dist/core/table/coreTablesFeature.utils.d.ts +1 -1
  95. package/dist/core/table/coreTablesFeature.utils.js +1 -2
  96. package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
  97. package/dist/features/column-faceting/columnFacetingFeature.cjs +49 -61
  98. package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
  99. package/dist/features/column-faceting/columnFacetingFeature.d.cts +4 -15
  100. package/dist/features/column-faceting/columnFacetingFeature.d.ts +4 -15
  101. package/dist/features/column-faceting/columnFacetingFeature.js +50 -61
  102. package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
  103. package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +4 -25
  104. package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +4 -25
  105. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +12 -12
  106. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
  107. package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +1 -1
  108. package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +1 -1
  109. package/dist/features/column-faceting/columnFacetingFeature.utils.js +12 -12
  110. package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
  111. package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
  112. package/dist/features/column-faceting/createFacetedMinMaxValues.d.cts +1 -1
  113. package/dist/features/column-faceting/createFacetedMinMaxValues.d.ts +1 -1
  114. package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
  115. package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
  116. package/dist/features/column-faceting/createFacetedRowModel.d.cts +1 -1
  117. package/dist/features/column-faceting/createFacetedRowModel.d.ts +1 -1
  118. package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
  119. package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
  120. package/dist/features/column-faceting/createFacetedUniqueValues.d.cts +1 -1
  121. package/dist/features/column-faceting/createFacetedUniqueValues.d.ts +1 -1
  122. package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
  123. package/dist/features/column-filtering/columnFilteringFeature.cjs +40 -53
  124. package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -1
  125. package/dist/features/column-filtering/columnFilteringFeature.d.cts +4 -16
  126. package/dist/features/column-filtering/columnFilteringFeature.d.ts +4 -16
  127. package/dist/features/column-filtering/columnFilteringFeature.js +41 -53
  128. package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -1
  129. package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +31 -17
  130. package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +31 -17
  131. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +1 -1
  132. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
  133. package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +2 -2
  134. package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +2 -2
  135. package/dist/features/column-filtering/columnFilteringFeature.utils.js +1 -1
  136. package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
  137. package/dist/features/column-filtering/createFilteredRowModel.cjs +4 -2
  138. package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
  139. package/dist/features/column-filtering/createFilteredRowModel.d.cts +5 -3
  140. package/dist/features/column-filtering/createFilteredRowModel.d.ts +5 -3
  141. package/dist/features/column-filtering/createFilteredRowModel.js +4 -2
  142. package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
  143. package/dist/features/column-grouping/columnGroupingFeature.cjs +57 -69
  144. package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
  145. package/dist/features/column-grouping/columnGroupingFeature.d.cts +4 -15
  146. package/dist/features/column-grouping/columnGroupingFeature.d.ts +4 -15
  147. package/dist/features/column-grouping/columnGroupingFeature.js +58 -69
  148. package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
  149. package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +17 -13
  150. package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +17 -13
  151. package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +1 -1
  152. package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +1 -1
  153. package/dist/features/column-grouping/createGroupedRowModel.cjs +5 -2
  154. package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
  155. package/dist/features/column-grouping/createGroupedRowModel.d.cts +6 -3
  156. package/dist/features/column-grouping/createGroupedRowModel.d.ts +6 -3
  157. package/dist/features/column-grouping/createGroupedRowModel.js +5 -2
  158. package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
  159. package/dist/features/column-ordering/columnOrderingFeature.cjs +47 -59
  160. package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
  161. package/dist/features/column-ordering/columnOrderingFeature.d.cts +4 -15
  162. package/dist/features/column-ordering/columnOrderingFeature.d.ts +4 -15
  163. package/dist/features/column-ordering/columnOrderingFeature.js +48 -59
  164. package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
  165. package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +1 -1
  166. package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +1 -1
  167. package/dist/features/column-pinning/columnPinningFeature.cjs +209 -221
  168. package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
  169. package/dist/features/column-pinning/columnPinningFeature.d.cts +4 -15
  170. package/dist/features/column-pinning/columnPinningFeature.d.ts +4 -15
  171. package/dist/features/column-pinning/columnPinningFeature.js +210 -221
  172. package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
  173. package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
  174. package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +13 -13
  175. package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +13 -13
  176. package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
  177. package/dist/features/column-resizing/columnResizingFeature.cjs +31 -43
  178. package/dist/features/column-resizing/columnResizingFeature.cjs.map +1 -1
  179. package/dist/features/column-resizing/columnResizingFeature.d.cts +4 -15
  180. package/dist/features/column-resizing/columnResizingFeature.d.ts +4 -15
  181. package/dist/features/column-resizing/columnResizingFeature.js +32 -43
  182. package/dist/features/column-resizing/columnResizingFeature.js.map +1 -1
  183. package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +1 -1
  184. package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +1 -1
  185. package/dist/features/column-sizing/columnSizingFeature.cjs +112 -125
  186. package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
  187. package/dist/features/column-sizing/columnSizingFeature.d.cts +4 -16
  188. package/dist/features/column-sizing/columnSizingFeature.d.ts +4 -16
  189. package/dist/features/column-sizing/columnSizingFeature.js +113 -125
  190. package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
  191. package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +4 -4
  192. package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +4 -4
  193. package/dist/features/column-visibility/columnVisibilityFeature.cjs +83 -95
  194. package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
  195. package/dist/features/column-visibility/columnVisibilityFeature.d.cts +4 -15
  196. package/dist/features/column-visibility/columnVisibilityFeature.d.ts +4 -15
  197. package/dist/features/column-visibility/columnVisibilityFeature.js +84 -95
  198. package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
  199. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +1 -1
  200. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +1 -1
  201. package/dist/features/global-filtering/globalFilteringFeature.cjs +31 -43
  202. package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
  203. package/dist/features/global-filtering/globalFilteringFeature.d.cts +4 -15
  204. package/dist/features/global-filtering/globalFilteringFeature.d.ts +4 -15
  205. package/dist/features/global-filtering/globalFilteringFeature.js +32 -43
  206. package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
  207. package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +1 -1
  208. package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +1 -1
  209. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
  210. package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +7 -5
  211. package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +7 -5
  212. package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
  213. package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
  214. package/dist/features/row-expanding/createExpandedRowModel.d.cts +1 -1
  215. package/dist/features/row-expanding/createExpandedRowModel.d.ts +1 -1
  216. package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
  217. package/dist/features/row-expanding/rowExpandingFeature.cjs +37 -49
  218. package/dist/features/row-expanding/rowExpandingFeature.cjs.map +1 -1
  219. package/dist/features/row-expanding/rowExpandingFeature.d.cts +4 -15
  220. package/dist/features/row-expanding/rowExpandingFeature.d.ts +4 -15
  221. package/dist/features/row-expanding/rowExpandingFeature.js +38 -49
  222. package/dist/features/row-expanding/rowExpandingFeature.js.map +1 -1
  223. package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +1 -10
  224. package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +1 -10
  225. package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +1 -1
  226. package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +1 -1
  227. package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
  228. package/dist/features/row-pagination/createPaginatedRowModel.d.cts +1 -1
  229. package/dist/features/row-pagination/createPaginatedRowModel.d.ts +1 -1
  230. package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
  231. package/dist/features/row-pagination/rowPaginationFeature.cjs +35 -47
  232. package/dist/features/row-pagination/rowPaginationFeature.cjs.map +1 -1
  233. package/dist/features/row-pagination/rowPaginationFeature.d.cts +4 -15
  234. package/dist/features/row-pagination/rowPaginationFeature.d.ts +4 -15
  235. package/dist/features/row-pagination/rowPaginationFeature.js +36 -47
  236. package/dist/features/row-pagination/rowPaginationFeature.js.map +1 -1
  237. package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +1 -10
  238. package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +1 -10
  239. package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +1 -1
  240. package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +1 -1
  241. package/dist/features/row-pinning/rowPinningFeature.cjs +55 -67
  242. package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
  243. package/dist/features/row-pinning/rowPinningFeature.d.cts +4 -15
  244. package/dist/features/row-pinning/rowPinningFeature.d.ts +4 -15
  245. package/dist/features/row-pinning/rowPinningFeature.js +56 -67
  246. package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
  247. package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +1 -1
  248. package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +1 -1
  249. package/dist/features/row-selection/rowSelectionFeature.cjs +65 -77
  250. package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
  251. package/dist/features/row-selection/rowSelectionFeature.d.cts +4 -15
  252. package/dist/features/row-selection/rowSelectionFeature.d.ts +4 -15
  253. package/dist/features/row-selection/rowSelectionFeature.js +66 -77
  254. package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
  255. package/dist/features/row-selection/rowSelectionFeature.utils.cjs +10 -6
  256. package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
  257. package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +1 -1
  258. package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +1 -1
  259. package/dist/features/row-selection/rowSelectionFeature.utils.js +10 -6
  260. package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
  261. package/dist/features/row-sorting/createSortedRowModel.cjs +4 -2
  262. package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
  263. package/dist/features/row-sorting/createSortedRowModel.d.cts +5 -3
  264. package/dist/features/row-sorting/createSortedRowModel.d.ts +5 -3
  265. package/dist/features/row-sorting/createSortedRowModel.js +4 -2
  266. package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
  267. package/dist/features/row-sorting/rowSortingFeature.cjs +45 -57
  268. package/dist/features/row-sorting/rowSortingFeature.cjs.map +1 -1
  269. package/dist/features/row-sorting/rowSortingFeature.d.cts +4 -15
  270. package/dist/features/row-sorting/rowSortingFeature.d.ts +4 -15
  271. package/dist/features/row-sorting/rowSortingFeature.js +46 -57
  272. package/dist/features/row-sorting/rowSortingFeature.js.map +1 -1
  273. package/dist/features/row-sorting/rowSortingFeature.types.d.cts +16 -13
  274. package/dist/features/row-sorting/rowSortingFeature.types.d.ts +16 -13
  275. package/dist/features/row-sorting/rowSortingFeature.utils.cjs +8 -5
  276. package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
  277. package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +1 -1
  278. package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +1 -1
  279. package/dist/features/row-sorting/rowSortingFeature.utils.js +8 -5
  280. package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
  281. package/dist/fns/aggregationFns.cjs +18 -18
  282. package/dist/fns/aggregationFns.cjs.map +1 -1
  283. package/dist/fns/aggregationFns.d.cts +21 -19
  284. package/dist/fns/aggregationFns.d.ts +21 -19
  285. package/dist/fns/aggregationFns.js +18 -18
  286. package/dist/fns/aggregationFns.js.map +1 -1
  287. package/dist/fns/filterFns.cjs +51 -65
  288. package/dist/fns/filterFns.cjs.map +1 -1
  289. package/dist/fns/filterFns.d.cts +82 -28
  290. package/dist/fns/filterFns.d.ts +82 -28
  291. package/dist/fns/filterFns.js +51 -65
  292. package/dist/fns/filterFns.js.map +1 -1
  293. package/dist/fns/sortFns.cjs +18 -6
  294. package/dist/fns/sortFns.cjs.map +1 -1
  295. package/dist/fns/sortFns.d.cts +15 -13
  296. package/dist/fns/sortFns.d.ts +15 -13
  297. package/dist/fns/sortFns.js +18 -6
  298. package/dist/fns/sortFns.js.map +1 -1
  299. package/dist/helpers/metaHelper.cjs +30 -0
  300. package/dist/helpers/metaHelper.cjs.map +1 -0
  301. package/dist/helpers/metaHelper.d.cts +26 -0
  302. package/dist/helpers/metaHelper.d.ts +26 -0
  303. package/dist/helpers/metaHelper.js +29 -0
  304. package/dist/helpers/metaHelper.js.map +1 -0
  305. package/dist/helpers/tableFeatures.cjs +31 -3
  306. package/dist/helpers/tableFeatures.cjs.map +1 -1
  307. package/dist/helpers/tableFeatures.d.cts +33 -5
  308. package/dist/helpers/tableFeatures.d.ts +33 -5
  309. package/dist/helpers/tableFeatures.js +31 -3
  310. package/dist/helpers/tableFeatures.js.map +1 -1
  311. package/dist/index.cjs +2 -20
  312. package/dist/index.d.cts +44 -43
  313. package/dist/index.d.ts +44 -43
  314. package/dist/index.js +22 -21
  315. package/dist/store-reactivity-bindings.cjs +1 -1
  316. package/dist/store-reactivity-bindings.cjs.map +1 -1
  317. package/dist/store-reactivity-bindings.d.cts +1 -1
  318. package/dist/store-reactivity-bindings.d.ts +1 -1
  319. package/dist/store-reactivity-bindings.js +1 -1
  320. package/dist/store-reactivity-bindings.js.map +1 -1
  321. package/dist/types/Cell.d.cts +7 -9
  322. package/dist/types/Cell.d.ts +7 -9
  323. package/dist/types/Column.d.cts +18 -11
  324. package/dist/types/Column.d.ts +18 -11
  325. package/dist/types/ColumnDef.d.cts +29 -10
  326. package/dist/types/ColumnDef.d.ts +29 -10
  327. package/dist/types/Header.d.cts +9 -10
  328. package/dist/types/Header.d.ts +9 -10
  329. package/dist/types/HeaderGroup.d.cts +3 -8
  330. package/dist/types/HeaderGroup.d.ts +3 -8
  331. package/dist/types/Row.d.cts +14 -10
  332. package/dist/types/Row.d.ts +14 -10
  333. package/dist/types/RowModel.d.cts +19 -19
  334. package/dist/types/RowModel.d.ts +19 -19
  335. package/dist/types/RowModelFns.d.cts +9 -9
  336. package/dist/types/RowModelFns.d.ts +9 -9
  337. package/dist/types/Table.d.cts +25 -15
  338. package/dist/types/Table.d.ts +25 -15
  339. package/dist/types/TableFeatures.d.cts +178 -41
  340. package/dist/types/TableFeatures.d.ts +178 -41
  341. package/dist/types/TableOptions.d.cts +24 -9
  342. package/dist/types/TableOptions.d.ts +24 -9
  343. package/dist/types/TableState.d.cts +22 -13
  344. package/dist/types/TableState.d.ts +22 -13
  345. package/dist/utils.cjs.map +1 -1
  346. package/dist/utils.d.cts +2 -2
  347. package/dist/utils.d.ts +2 -2
  348. package/dist/utils.js.map +1 -1
  349. package/package.json +1 -1
  350. package/skills/column-definitions/SKILL.md +3 -6
  351. package/skills/column-layout/SKILL.md +0 -2
  352. package/skills/customizing-feature-behavior/SKILL.md +63 -56
  353. package/skills/filtering/SKILL.md +60 -42
  354. package/skills/filtering/references/faceting-and-fuzzy.md +59 -32
  355. package/skills/grouping/SKILL.md +49 -54
  356. package/skills/migrate-v8-to-v9/SKILL.md +30 -33
  357. package/skills/pagination/SKILL.md +22 -20
  358. package/skills/row-expanding/SKILL.md +33 -25
  359. package/skills/row-pinning/SKILL.md +11 -7
  360. package/skills/row-selection/SKILL.md +0 -3
  361. package/skills/setup/SKILL.md +55 -65
  362. package/skills/sorting/SKILL.md +21 -21
  363. package/skills/state-management/SKILL.md +40 -25
  364. package/src/core/cells/coreCellsFeature.ts +17 -39
  365. package/src/core/columns/coreColumnsFeature.ts +56 -83
  366. package/src/core/coreFeatures.ts +1 -1
  367. package/src/core/headers/buildHeaderGroups.ts +1 -1
  368. package/src/core/headers/coreHeadersFeature.ts +42 -64
  369. package/src/core/headers/coreHeadersFeature.utils.ts +1 -1
  370. package/src/core/row-models/coreRowModelsFeature.ts +43 -64
  371. package/src/core/row-models/coreRowModelsFeature.types.ts +1 -18
  372. package/src/core/row-models/coreRowModelsFeature.utils.ts +7 -7
  373. package/src/core/row-models/createCoreRowModel.ts +1 -1
  374. package/src/core/rows/coreRowsFeature.ts +45 -72
  375. package/src/core/table/constructTable.ts +49 -12
  376. package/src/core/table/coreTablesFeature.ts +13 -35
  377. package/src/core/table/coreTablesFeature.types.ts +33 -10
  378. package/src/core/table/coreTablesFeature.utils.ts +2 -3
  379. package/src/features/column-faceting/columnFacetingFeature.ts +71 -102
  380. package/src/features/column-faceting/columnFacetingFeature.types.ts +3 -36
  381. package/src/features/column-faceting/columnFacetingFeature.utils.ts +6 -6
  382. package/src/features/column-faceting/createFacetedMinMaxValues.ts +1 -1
  383. package/src/features/column-faceting/createFacetedRowModel.ts +1 -1
  384. package/src/features/column-faceting/createFacetedUniqueValues.ts +1 -1
  385. package/src/features/column-filtering/columnFilteringFeature.ts +60 -103
  386. package/src/features/column-filtering/columnFilteringFeature.types.ts +37 -21
  387. package/src/features/column-filtering/columnFilteringFeature.utils.ts +2 -2
  388. package/src/features/column-filtering/createFilteredRowModel.ts +5 -7
  389. package/src/features/column-grouping/columnGroupingFeature.ts +82 -126
  390. package/src/features/column-grouping/columnGroupingFeature.types.ts +20 -19
  391. package/src/features/column-grouping/createGroupedRowModel.ts +7 -11
  392. package/src/features/column-ordering/columnOrderingFeature.ts +52 -84
  393. package/src/features/column-pinning/columnPinningFeature.ts +268 -304
  394. package/src/features/column-pinning/columnPinningFeature.utils.ts +5 -5
  395. package/src/features/column-resizing/columnResizingFeature.ts +44 -78
  396. package/src/features/column-sizing/columnSizingFeature.ts +115 -152
  397. package/src/features/column-visibility/columnVisibilityFeature.ts +92 -129
  398. package/src/features/global-filtering/globalFilteringFeature.ts +45 -79
  399. package/src/features/global-filtering/globalFilteringFeature.utils.ts +4 -2
  400. package/src/features/row-expanding/createExpandedRowModel.ts +1 -1
  401. package/src/features/row-expanding/rowExpandingFeature.ts +65 -101
  402. package/src/features/row-expanding/rowExpandingFeature.types.ts +0 -14
  403. package/src/features/row-pagination/createPaginatedRowModel.ts +1 -1
  404. package/src/features/row-pagination/rowPaginationFeature.ts +69 -103
  405. package/src/features/row-pagination/rowPaginationFeature.types.ts +0 -14
  406. package/src/features/row-pinning/rowPinningFeature.ts +72 -104
  407. package/src/features/row-selection/rowSelectionFeature.ts +103 -135
  408. package/src/features/row-selection/rowSelectionFeature.utils.ts +12 -7
  409. package/src/features/row-sorting/createSortedRowModel.ts +6 -6
  410. package/src/features/row-sorting/rowSortingFeature.ts +73 -114
  411. package/src/features/row-sorting/rowSortingFeature.types.ts +19 -18
  412. package/src/features/row-sorting/rowSortingFeature.utils.ts +8 -6
  413. package/src/fns/aggregationFns.ts +26 -42
  414. package/src/fns/filterFns.ts +231 -264
  415. package/src/fns/sortFns.ts +51 -29
  416. package/src/helpers/metaHelper.ts +24 -0
  417. package/src/helpers/tableFeatures.ts +36 -5
  418. package/src/index.ts +1 -0
  419. package/src/store-reactivity-bindings.ts +1 -1
  420. package/src/types/Cell.ts +8 -28
  421. package/src/types/Column.ts +18 -53
  422. package/src/types/ColumnDef.ts +44 -45
  423. package/src/types/Header.ts +8 -30
  424. package/src/types/HeaderGroup.ts +2 -13
  425. package/src/types/Row.ts +15 -36
  426. package/src/types/RowModel.ts +21 -111
  427. package/src/types/RowModelFns.ts +11 -30
  428. package/src/types/Table.ts +24 -66
  429. package/src/types/TableFeatures.ts +253 -108
  430. package/src/types/TableOptions.ts +40 -72
  431. package/src/types/TableState.ts +20 -73
  432. package/src/utils.ts +5 -4
@@ -4,7 +4,7 @@ import { createCoreRowModel } from "./createCoreRowModel.js";
4
4
  /**
5
5
  * Resolves the table's unmodified core row model.
6
6
  *
7
- * The factory is created once per table, either from `options.rowModels.coreRowModel`
7
+ * The factory is created once per table, either from the `coreRowModel` slot on the `features` option
8
8
  * or the built-in `createCoreRowModel()`, then reused for later calls.
9
9
  *
10
10
  * @example
@@ -14,8 +14,8 @@ import { createCoreRowModel } from "./createCoreRowModel.js";
14
14
  */
15
15
  function table_getCoreRowModel(table) {
16
16
  if (!table._rowModels.coreRowModel) {
17
- var _table$options$rowMod, _table$options$rowMod2;
18
- table._rowModels.coreRowModel = ((_table$options$rowMod = table.options.rowModels) === null || _table$options$rowMod === void 0 || (_table$options$rowMod2 = _table$options$rowMod.coreRowModel) === null || _table$options$rowMod2 === void 0 ? void 0 : _table$options$rowMod2.call(_table$options$rowMod, table)) ?? createCoreRowModel()(table);
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
19
  }
20
20
  return table._rowModels.coreRowModel();
21
21
  }
@@ -47,8 +47,8 @@ function table_getPreFilteredRowModel(table) {
47
47
  */
48
48
  function table_getFilteredRowModel(table) {
49
49
  if (!table._rowModels.filteredRowModel) {
50
- var _table$options$rowMod3, _table$options$rowMod4;
51
- table._rowModels.filteredRowModel = (_table$options$rowMod3 = table.options.rowModels) === null || _table$options$rowMod3 === void 0 || (_table$options$rowMod4 = _table$options$rowMod3.filteredRowModel) === null || _table$options$rowMod4 === void 0 ? void 0 : _table$options$rowMod4.call(_table$options$rowMod3, table);
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
52
  }
53
53
  if (table.options.manualFiltering || !table._rowModels.filteredRowModel) return table.getPreFilteredRowModel();
54
54
  return table._rowModels.filteredRowModel();
@@ -79,8 +79,8 @@ function table_getPreGroupedRowModel(table) {
79
79
  */
80
80
  function table_getGroupedRowModel(table) {
81
81
  if (!table._rowModels.groupedRowModel) {
82
- var _table$options$rowMod5, _table$options$rowMod6;
83
- table._rowModels.groupedRowModel = (_table$options$rowMod5 = table.options.rowModels) === null || _table$options$rowMod5 === void 0 || (_table$options$rowMod6 = _table$options$rowMod5.groupedRowModel) === null || _table$options$rowMod6 === void 0 ? void 0 : _table$options$rowMod6.call(_table$options$rowMod5, table);
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
84
  }
85
85
  if (table.options.manualGrouping || !table._rowModels.groupedRowModel) return table.getPreGroupedRowModel();
86
86
  return table._rowModels.groupedRowModel();
@@ -112,8 +112,8 @@ function table_getPreSortedRowModel(table) {
112
112
  */
113
113
  function table_getSortedRowModel(table) {
114
114
  if (!table._rowModels.sortedRowModel) {
115
- var _table$options$rowMod7, _table$options$rowMod8;
116
- table._rowModels.sortedRowModel = (_table$options$rowMod7 = table.options.rowModels) === null || _table$options$rowMod7 === void 0 || (_table$options$rowMod8 = _table$options$rowMod7.sortedRowModel) === null || _table$options$rowMod8 === void 0 ? void 0 : _table$options$rowMod8.call(_table$options$rowMod7, table);
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
117
  }
118
118
  if (table.options.manualSorting || !table._rowModels.sortedRowModel) return table.getPreSortedRowModel();
119
119
  return table._rowModels.sortedRowModel();
@@ -144,8 +144,8 @@ function table_getPreExpandedRowModel(table) {
144
144
  */
145
145
  function table_getExpandedRowModel(table) {
146
146
  if (!table._rowModels.expandedRowModel) {
147
- var _table$options$rowMod9, _table$options$rowMod10;
148
- table._rowModels.expandedRowModel = (_table$options$rowMod9 = table.options.rowModels) === null || _table$options$rowMod9 === void 0 || (_table$options$rowMod10 = _table$options$rowMod9.expandedRowModel) === null || _table$options$rowMod10 === void 0 ? void 0 : _table$options$rowMod10.call(_table$options$rowMod9, table);
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
149
  }
150
150
  if (table.options.manualExpanding || !table._rowModels.expandedRowModel) return table.getPreExpandedRowModel();
151
151
  return table._rowModels.expandedRowModel();
@@ -178,8 +178,8 @@ function table_getPrePaginatedRowModel(table) {
178
178
  */
179
179
  function table_getPaginatedRowModel(table) {
180
180
  if (!table._rowModels.paginatedRowModel) {
181
- var _table$options$rowMod11, _table$options$rowMod12;
182
- table._rowModels.paginatedRowModel = (_table$options$rowMod11 = table.options.rowModels) === null || _table$options$rowMod11 === void 0 || (_table$options$rowMod12 = _table$options$rowMod11.paginatedRowModel) === null || _table$options$rowMod12 === void 0 ? void 0 : _table$options$rowMod12.call(_table$options$rowMod11, table);
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
183
  }
184
184
  if (table.options.manualPagination || !table._rowModels.paginatedRowModel) return table.getPrePaginatedRowModel();
185
185
  return table._rowModels.paginatedRowModel();
@@ -1 +1 @@
1
- {"version":3,"file":"coreRowModelsFeature.utils.js","names":[],"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 `options.rowModels.coreRowModel`\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.rowModels?.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.rowModels?.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.rowModels?.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.rowModels?.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.rowModels?.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.rowModels?.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,yCACf,MAAM,QAAQ,2GAAW,0HAAe,KAAK,MAC7C,mBAAqC,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,CAAC,MAAM,WAAW,kBAAkB;;EACtC,MAAM,WAAW,6CACf,MAAM,QAAQ,6GAAW,+HAAmB,KAAK;CACrD;CAEA,IAAI,MAAM,QAAQ,mBAAmB,CAAC,MAAM,WAAW,kBACrD,OAAO,MAAM,uBAAuB;CAGtC,OAAO,MAAM,WAAW,iBAAiB;AAC3C;;;;;;;;;;;AAYA,SAAgB,4BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;AAaA,SAAgB,yBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,iBAAiB;;EACrC,MAAM,WAAW,4CACf,MAAM,QAAQ,6GAAW,8HAAkB,KAAK;CACpD;CAEA,IAAI,MAAM,QAAQ,kBAAkB,CAAC,MAAM,WAAW,iBACpD,OAAO,MAAM,sBAAsB;CAGrC,OAAO,MAAM,WAAW,gBAAgB;AAC1C;;;;;;;;;;;AAYA,SAAgB,2BAGd,OAAqE;CACrE,OAAO,MAAM,mBAAmB;AAClC;;;;;;;;;;;;;AAcA,SAAgB,wBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,gBAAgB;;EACpC,MAAM,WAAW,2CACf,MAAM,QAAQ,6GAAW,6HAAiB,KAAK;CACnD;CAEA,IAAI,MAAM,QAAQ,iBAAiB,CAAC,MAAM,WAAW,gBACnD,OAAO,MAAM,qBAAqB;CAGpC,OAAO,MAAM,WAAW,eAAe;AACzC;;;;;;;;;;;AAYA,SAAgB,6BAGd,OAAqE;CACrE,OAAO,MAAM,kBAAkB;AACjC;;;;;;;;;;;;AAaA,SAAgB,0BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,kBAAkB;;EACtC,MAAM,WAAW,6CACf,MAAM,QAAQ,8GAAW,iIAAmB,KAAK;CACrD;CAEA,IAAI,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,mBAAmB;;EACvC,MAAM,WAAW,+CACf,MAAM,QAAQ,gHAAW,mIAAoB,KAAK;CACtD;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.js","names":[],"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,MAC3C,mBAAqC,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,CAAC,MAAM,WAAW,kBAAkB;;EACtC,MAAM,WAAW,uEACf,MAAM,QAAQ,UAAS,+HAAmB,KAAK;CACnD;CAEA,IAAI,MAAM,QAAQ,mBAAmB,CAAC,MAAM,WAAW,kBACrD,OAAO,MAAM,uBAAuB;CAGtC,OAAO,MAAM,WAAW,iBAAiB;AAC3C;;;;;;;;;;;AAYA,SAAgB,4BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;AAaA,SAAgB,yBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,iBAAiB;;EACrC,MAAM,WAAW,sEACf,MAAM,QAAQ,UAAS,8HAAkB,KAAK;CAClD;CAEA,IAAI,MAAM,QAAQ,kBAAkB,CAAC,MAAM,WAAW,iBACpD,OAAO,MAAM,sBAAsB;CAGrC,OAAO,MAAM,WAAW,gBAAgB;AAC1C;;;;;;;;;;;AAYA,SAAgB,2BAGd,OAAqE;CACrE,OAAO,MAAM,mBAAmB;AAClC;;;;;;;;;;;;;AAcA,SAAgB,wBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,gBAAgB;;EACpC,MAAM,WAAW,qEACf,MAAM,QAAQ,UAAS,6HAAiB,KAAK;CACjD;CAEA,IAAI,MAAM,QAAQ,iBAAiB,CAAC,MAAM,WAAW,gBACnD,OAAO,MAAM,qBAAqB;CAGpC,OAAO,MAAM,WAAW,eAAe;AACzC;;;;;;;;;;;AAYA,SAAgB,6BAGd,OAAqE;CACrE,OAAO,MAAM,kBAAkB;AACjC;;;;;;;;;;;;AAaA,SAAgB,0BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,kBAAkB;;EACtC,MAAM,WAAW,wEACf,MAAM,QAAQ,UAAS,gIAAmB,KAAK;CACnD;CAEA,IAAI,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,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 +1 @@
1
- {"version":3,"file":"createCoreRowModel.cjs","names":["tableMemo","table_autoResetPageIndex","constructRow"],"sources":["../../../src/core/row-models/createCoreRowModel.ts"],"sourcesContent":["import { constructRow } from '../rows/constructRow'\nimport { tableMemo } from '../../utils'\nimport { table_autoResetPageIndex } from '../../features/row-pagination/rowPaginationFeature.utils'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { RowModel } from './coreRowModelsFeature.types'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Creates a memoized core row model factory.\n *\n * The factory reads the relevant table state atoms and options, then returns a row model function used by the table row-model pipeline.\n */\nexport function createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData> {\n return (_table) => {\n const table: Table_Internal<TFeatures, TData> = _table\n return tableMemo({\n feature: 'coreRowModelsFeature',\n table,\n fnName: 'table.getCoreRowModel',\n memoDeps: () => [table.options.data],\n fn: () => _createCoreRowModel(table, table.options.data),\n onAfterUpdate: () => table_autoResetPageIndex(table),\n })\n }\n}\n\nfunction _createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n data: ReadonlyArray<TData>,\n): {\n rows: Array<Row<TFeatures, TData>>\n flatRows: Array<Row<TFeatures, TData>>\n rowsById: Record<string, Row<TFeatures, TData>>\n} {\n const rowModel: RowModel<TFeatures, TData> = {\n rows: [],\n flatRows: [],\n rowsById: {},\n }\n\n const accessRows = (\n originalRows: ReadonlyArray<TData>,\n depth = 0,\n parentRow?: Row<TFeatures, TData>,\n ): Array<Row<TFeatures, TData>> => {\n const rows = [] as Array<Row<TFeatures, TData>>\n\n for (let i = 0; i < originalRows.length; i++) {\n const originalRow = originalRows[i]!\n // Make the row\n const row = constructRow(\n table,\n table.getRowId(originalRow, i, parentRow),\n originalRow,\n i,\n depth,\n undefined,\n parentRow?.id,\n )\n\n // Keep track of every row in a flat array\n rowModel.flatRows.push(row)\n // Also keep track of every row by its ID\n rowModel.rowsById[row.id] = row\n // Push table row into parent\n rows.push(row)\n\n // Get the original subrows\n if (table.options.getSubRows) {\n row.originalSubRows = table.options.getSubRows(originalRow, i)\n\n // Then recursively access them\n if (row.originalSubRows?.length) {\n row.subRows = accessRows(row.originalSubRows, depth + 1, row)\n }\n }\n }\n\n return rows\n }\n\n rowModel.rows = accessRows(data)\n\n return rowModel\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,qBAG0D;CACxE,QAAQ,WAAW;EACjB,MAAM,QAA0C;EAChD,OAAOA,wBAAU;GACf,SAAS;GACT;GACA,QAAQ;GACR,gBAAgB,CAAC,MAAM,QAAQ,IAAI;GACnC,UAAU,oBAAoB,OAAO,MAAM,QAAQ,IAAI;GACvD,qBAAqBC,4DAAyB,KAAK;EACrD,CAAC;CACH;AACF;AAEA,SAAS,oBAIP,OACA,MAKA;CACA,MAAM,WAAuC;EAC3C,MAAM,CAAC;EACP,UAAU,CAAC;EACX,UAAU,CAAC;CACb;CAEA,MAAM,cACJ,cACA,QAAQ,GACR,cACiC;EACjC,MAAM,OAAO,CAAC;EAEd,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;GAC5C,MAAM,cAAc,aAAa;GAEjC,MAAM,MAAMC,kCACV,OACA,MAAM,SAAS,aAAa,GAAG,SAAS,GACxC,aACA,GACA,OACA,8DACA,UAAW,EACb;GAGA,SAAS,SAAS,KAAK,GAAG;GAE1B,SAAS,SAAS,IAAI,MAAM;GAE5B,KAAK,KAAK,GAAG;GAGb,IAAI,MAAM,QAAQ,YAAY;;IAC5B,IAAI,kBAAkB,MAAM,QAAQ,WAAW,aAAa,CAAC;IAG7D,4BAAI,IAAI,6FAAiB,QACvB,IAAI,UAAU,WAAW,IAAI,iBAAiB,QAAQ,GAAG,GAAG;GAEhE;EACF;EAEA,OAAO;CACT;CAEA,SAAS,OAAO,WAAW,IAAI;CAE/B,OAAO;AACT"}
1
+ {"version":3,"file":"createCoreRowModel.cjs","names":["tableMemo","table_autoResetPageIndex","constructRow"],"sources":["../../../src/core/row-models/createCoreRowModel.ts"],"sourcesContent":["import { constructRow } from '../rows/constructRow'\nimport { tableMemo } from '../../utils'\nimport { table_autoResetPageIndex } from '../../features/row-pagination/rowPaginationFeature.utils'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { RowModel } from './coreRowModelsFeature.types'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Creates a memoized core row model factory.\n *\n * The factory reads the relevant table state atoms and options, then returns a row model function used by the table row-model pipeline.\n */\nexport function createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData> {\n return (_table) => {\n const table = _table as unknown as Table_Internal<TFeatures, TData>\n return tableMemo({\n feature: 'coreRowModelsFeature',\n table,\n fnName: 'table.getCoreRowModel',\n memoDeps: () => [table.options.data],\n fn: () => _createCoreRowModel(table, table.options.data),\n onAfterUpdate: () => table_autoResetPageIndex(table),\n })\n }\n}\n\nfunction _createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n data: ReadonlyArray<TData>,\n): {\n rows: Array<Row<TFeatures, TData>>\n flatRows: Array<Row<TFeatures, TData>>\n rowsById: Record<string, Row<TFeatures, TData>>\n} {\n const rowModel: RowModel<TFeatures, TData> = {\n rows: [],\n flatRows: [],\n rowsById: {},\n }\n\n const accessRows = (\n originalRows: ReadonlyArray<TData>,\n depth = 0,\n parentRow?: Row<TFeatures, TData>,\n ): Array<Row<TFeatures, TData>> => {\n const rows = [] as Array<Row<TFeatures, TData>>\n\n for (let i = 0; i < originalRows.length; i++) {\n const originalRow = originalRows[i]!\n // Make the row\n const row = constructRow(\n table,\n table.getRowId(originalRow, i, parentRow),\n originalRow,\n i,\n depth,\n undefined,\n parentRow?.id,\n )\n\n // Keep track of every row in a flat array\n rowModel.flatRows.push(row)\n // Also keep track of every row by its ID\n rowModel.rowsById[row.id] = row\n // Push table row into parent\n rows.push(row)\n\n // Get the original subrows\n if (table.options.getSubRows) {\n row.originalSubRows = table.options.getSubRows(originalRow, i)\n\n // Then recursively access them\n if (row.originalSubRows?.length) {\n row.subRows = accessRows(row.originalSubRows, depth + 1, row)\n }\n }\n }\n\n return rows\n }\n\n rowModel.rows = accessRows(data)\n\n return rowModel\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,qBAG0D;CACxE,QAAQ,WAAW;EACjB,MAAM,QAAQ;EACd,OAAOA,wBAAU;GACf,SAAS;GACT;GACA,QAAQ;GACR,gBAAgB,CAAC,MAAM,QAAQ,IAAI;GACnC,UAAU,oBAAoB,OAAO,MAAM,QAAQ,IAAI;GACvD,qBAAqBC,4DAAyB,KAAK;EACrD,CAAC;CACH;AACF;AAEA,SAAS,oBAIP,OACA,MAKA;CACA,MAAM,WAAuC;EAC3C,MAAM,CAAC;EACP,UAAU,CAAC;EACX,UAAU,CAAC;CACb;CAEA,MAAM,cACJ,cACA,QAAQ,GACR,cACiC;EACjC,MAAM,OAAO,CAAC;EAEd,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;GAC5C,MAAM,cAAc,aAAa;GAEjC,MAAM,MAAMC,kCACV,OACA,MAAM,SAAS,aAAa,GAAG,SAAS,GACxC,aACA,GACA,OACA,8DACA,UAAW,EACb;GAGA,SAAS,SAAS,KAAK,GAAG;GAE1B,SAAS,SAAS,IAAI,MAAM;GAE5B,KAAK,KAAK,GAAG;GAGb,IAAI,MAAM,QAAQ,YAAY;;IAC5B,IAAI,kBAAkB,MAAM,QAAQ,WAAW,aAAa,CAAC;IAG7D,4BAAI,IAAI,6FAAiB,QACvB,IAAI,UAAU,WAAW,IAAI,iBAAiB,QAAQ,GAAG,GAAG;GAEhE;EACF;EAEA,OAAO;CACT;CAEA,SAAS,OAAO,WAAW,IAAI;CAE/B,OAAO;AACT"}
@@ -1,6 +1,6 @@
1
1
  import { RowData } from "../../types/type-utils.cjs";
2
- import { TableFeatures } from "../../types/TableFeatures.cjs";
3
2
  import { Table } from "../../types/Table.cjs";
3
+ import { TableFeatures } from "../../types/TableFeatures.cjs";
4
4
  import { RowModel } from "./coreRowModelsFeature.types.cjs";
5
5
 
6
6
  //#region src/core/row-models/createCoreRowModel.d.ts
@@ -1,6 +1,6 @@
1
1
  import { RowData } from "../../types/type-utils.js";
2
- import { TableFeatures } from "../../types/TableFeatures.js";
3
2
  import { Table } from "../../types/Table.js";
3
+ import { TableFeatures } from "../../types/TableFeatures.js";
4
4
  import { RowModel } from "./coreRowModelsFeature.types.js";
5
5
 
6
6
  //#region src/core/row-models/createCoreRowModel.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"createCoreRowModel.js","names":[],"sources":["../../../src/core/row-models/createCoreRowModel.ts"],"sourcesContent":["import { constructRow } from '../rows/constructRow'\nimport { tableMemo } from '../../utils'\nimport { table_autoResetPageIndex } from '../../features/row-pagination/rowPaginationFeature.utils'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { RowModel } from './coreRowModelsFeature.types'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Creates a memoized core row model factory.\n *\n * The factory reads the relevant table state atoms and options, then returns a row model function used by the table row-model pipeline.\n */\nexport function createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData> {\n return (_table) => {\n const table: Table_Internal<TFeatures, TData> = _table\n return tableMemo({\n feature: 'coreRowModelsFeature',\n table,\n fnName: 'table.getCoreRowModel',\n memoDeps: () => [table.options.data],\n fn: () => _createCoreRowModel(table, table.options.data),\n onAfterUpdate: () => table_autoResetPageIndex(table),\n })\n }\n}\n\nfunction _createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n data: ReadonlyArray<TData>,\n): {\n rows: Array<Row<TFeatures, TData>>\n flatRows: Array<Row<TFeatures, TData>>\n rowsById: Record<string, Row<TFeatures, TData>>\n} {\n const rowModel: RowModel<TFeatures, TData> = {\n rows: [],\n flatRows: [],\n rowsById: {},\n }\n\n const accessRows = (\n originalRows: ReadonlyArray<TData>,\n depth = 0,\n parentRow?: Row<TFeatures, TData>,\n ): Array<Row<TFeatures, TData>> => {\n const rows = [] as Array<Row<TFeatures, TData>>\n\n for (let i = 0; i < originalRows.length; i++) {\n const originalRow = originalRows[i]!\n // Make the row\n const row = constructRow(\n table,\n table.getRowId(originalRow, i, parentRow),\n originalRow,\n i,\n depth,\n undefined,\n parentRow?.id,\n )\n\n // Keep track of every row in a flat array\n rowModel.flatRows.push(row)\n // Also keep track of every row by its ID\n rowModel.rowsById[row.id] = row\n // Push table row into parent\n rows.push(row)\n\n // Get the original subrows\n if (table.options.getSubRows) {\n row.originalSubRows = table.options.getSubRows(originalRow, i)\n\n // Then recursively access them\n if (row.originalSubRows?.length) {\n row.subRows = accessRows(row.originalSubRows, depth + 1, row)\n }\n }\n }\n\n return rows\n }\n\n rowModel.rows = accessRows(data)\n\n return rowModel\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,qBAG0D;CACxE,QAAQ,WAAW;EACjB,MAAM,QAA0C;EAChD,OAAO,UAAU;GACf,SAAS;GACT;GACA,QAAQ;GACR,gBAAgB,CAAC,MAAM,QAAQ,IAAI;GACnC,UAAU,oBAAoB,OAAO,MAAM,QAAQ,IAAI;GACvD,qBAAqB,yBAAyB,KAAK;EACrD,CAAC;CACH;AACF;AAEA,SAAS,oBAIP,OACA,MAKA;CACA,MAAM,WAAuC;EAC3C,MAAM,CAAC;EACP,UAAU,CAAC;EACX,UAAU,CAAC;CACb;CAEA,MAAM,cACJ,cACA,QAAQ,GACR,cACiC;EACjC,MAAM,OAAO,CAAC;EAEd,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;GAC5C,MAAM,cAAc,aAAa;GAEjC,MAAM,MAAM,aACV,OACA,MAAM,SAAS,aAAa,GAAG,SAAS,GACxC,aACA,GACA,OACA,8DACA,UAAW,EACb;GAGA,SAAS,SAAS,KAAK,GAAG;GAE1B,SAAS,SAAS,IAAI,MAAM;GAE5B,KAAK,KAAK,GAAG;GAGb,IAAI,MAAM,QAAQ,YAAY;;IAC5B,IAAI,kBAAkB,MAAM,QAAQ,WAAW,aAAa,CAAC;IAG7D,4BAAI,IAAI,6FAAiB,QACvB,IAAI,UAAU,WAAW,IAAI,iBAAiB,QAAQ,GAAG,GAAG;GAEhE;EACF;EAEA,OAAO;CACT;CAEA,SAAS,OAAO,WAAW,IAAI;CAE/B,OAAO;AACT"}
1
+ {"version":3,"file":"createCoreRowModel.js","names":[],"sources":["../../../src/core/row-models/createCoreRowModel.ts"],"sourcesContent":["import { constructRow } from '../rows/constructRow'\nimport { tableMemo } from '../../utils'\nimport { table_autoResetPageIndex } from '../../features/row-pagination/rowPaginationFeature.utils'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { RowModel } from './coreRowModelsFeature.types'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { RowData } from '../../types/type-utils'\n\n/**\n * Creates a memoized core row model factory.\n *\n * The factory reads the relevant table state atoms and options, then returns a row model function used by the table row-model pipeline.\n */\nexport function createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): (table: Table<TFeatures, TData>) => () => RowModel<TFeatures, TData> {\n return (_table) => {\n const table = _table as unknown as Table_Internal<TFeatures, TData>\n return tableMemo({\n feature: 'coreRowModelsFeature',\n table,\n fnName: 'table.getCoreRowModel',\n memoDeps: () => [table.options.data],\n fn: () => _createCoreRowModel(table, table.options.data),\n onAfterUpdate: () => table_autoResetPageIndex(table),\n })\n }\n}\n\nfunction _createCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n data: ReadonlyArray<TData>,\n): {\n rows: Array<Row<TFeatures, TData>>\n flatRows: Array<Row<TFeatures, TData>>\n rowsById: Record<string, Row<TFeatures, TData>>\n} {\n const rowModel: RowModel<TFeatures, TData> = {\n rows: [],\n flatRows: [],\n rowsById: {},\n }\n\n const accessRows = (\n originalRows: ReadonlyArray<TData>,\n depth = 0,\n parentRow?: Row<TFeatures, TData>,\n ): Array<Row<TFeatures, TData>> => {\n const rows = [] as Array<Row<TFeatures, TData>>\n\n for (let i = 0; i < originalRows.length; i++) {\n const originalRow = originalRows[i]!\n // Make the row\n const row = constructRow(\n table,\n table.getRowId(originalRow, i, parentRow),\n originalRow,\n i,\n depth,\n undefined,\n parentRow?.id,\n )\n\n // Keep track of every row in a flat array\n rowModel.flatRows.push(row)\n // Also keep track of every row by its ID\n rowModel.rowsById[row.id] = row\n // Push table row into parent\n rows.push(row)\n\n // Get the original subrows\n if (table.options.getSubRows) {\n row.originalSubRows = table.options.getSubRows(originalRow, i)\n\n // Then recursively access them\n if (row.originalSubRows?.length) {\n row.subRows = accessRows(row.originalSubRows, depth + 1, row)\n }\n }\n }\n\n return rows\n }\n\n rowModel.rows = accessRows(data)\n\n return rowModel\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,qBAG0D;CACxE,QAAQ,WAAW;EACjB,MAAM,QAAQ;EACd,OAAO,UAAU;GACf,SAAS;GACT;GACA,QAAQ;GACR,gBAAgB,CAAC,MAAM,QAAQ,IAAI;GACnC,UAAU,oBAAoB,OAAO,MAAM,QAAQ,IAAI;GACvD,qBAAqB,yBAAyB,KAAK;EACrD,CAAC;CACH;AACF;AAEA,SAAS,oBAIP,OACA,MAKA;CACA,MAAM,WAAuC;EAC3C,MAAM,CAAC;EACP,UAAU,CAAC;EACX,UAAU,CAAC;CACb;CAEA,MAAM,cACJ,cACA,QAAQ,GACR,cACiC;EACjC,MAAM,OAAO,CAAC;EAEd,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;GAC5C,MAAM,cAAc,aAAa;GAEjC,MAAM,MAAM,aACV,OACA,MAAM,SAAS,aAAa,GAAG,SAAS,GACxC,aACA,GACA,OACA,8DACA,UAAW,EACb;GAGA,SAAS,SAAS,KAAK,GAAG;GAE1B,SAAS,SAAS,IAAI,MAAM;GAE5B,KAAK,KAAK,GAAG;GAGb,IAAI,MAAM,QAAQ,YAAY;;IAC5B,IAAI,kBAAkB,MAAM,QAAQ,WAAW,aAAa,CAAC;IAG7D,4BAAI,IAAI,6FAAiB,QACvB,IAAI,UAAU,WAAW,IAAI,iBAAiB,QAAQ,GAAG,GAAG;GAEhE;EACF;EAEA,OAAO;CACT;CAEA,SAAS,OAAO,WAAW,IAAI;CAE/B,OAAO;AACT"}
@@ -1,7 +1,7 @@
1
1
  import { RowData } from "../../types/type-utils.cjs";
2
2
  import { Row } from "../../types/Row.cjs";
3
- import { TableFeatures } from "../../types/TableFeatures.cjs";
4
3
  import { Table_Internal } from "../../types/Table.cjs";
4
+ import { TableFeatures } from "../../types/TableFeatures.cjs";
5
5
 
6
6
  //#region src/core/rows/constructRow.d.ts
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { RowData } from "../../types/type-utils.js";
2
2
  import { Row } from "../../types/Row.js";
3
- import { TableFeatures } from "../../types/TableFeatures.js";
4
3
  import { Table_Internal } from "../../types/Table.js";
4
+ import { TableFeatures } from "../../types/TableFeatures.js";
5
5
 
6
6
  //#region src/core/rows/constructRow.d.ts
7
7
  /**
@@ -3,44 +3,35 @@ const require_coreRowsFeature_utils = require('./coreRowsFeature.utils.cjs');
3
3
 
4
4
  //#region src/core/rows/coreRowsFeature.ts
5
5
  /**
6
- * Creates the stock core rows feature.
7
- *
8
- * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
6
+ * Core feature that creates row APIs for values, cells, and tree traversal.
9
7
  */
10
- function constructCoreRowsFeature() {
11
- return {
12
- assignRowPrototype: (prototype, table) => {
13
- require_utils.assignPrototypeAPIs("coreRowsFeature", prototype, table, {
14
- row_getAllCellsByColumnId: {
15
- fn: (row) => require_coreRowsFeature_utils.row_getAllCellsByColumnId(row),
16
- memoDeps: (row) => [row.getAllCells()]
17
- },
18
- row_getAllCells: {
19
- fn: (row) => require_coreRowsFeature_utils.row_getAllCells(row),
20
- memoDeps: (row) => [row.table.getAllLeafColumns()]
21
- },
22
- row_getLeafRows: { fn: (row) => require_coreRowsFeature_utils.row_getLeafRows(row) },
23
- row_getParentRow: { fn: (row) => require_coreRowsFeature_utils.row_getParentRow(row) },
24
- row_getParentRows: { fn: (row) => require_coreRowsFeature_utils.row_getParentRows(row) },
25
- row_getUniqueValues: { fn: (row, columnId) => require_coreRowsFeature_utils.row_getUniqueValues(row, columnId) },
26
- row_getValue: { fn: (row, columnId) => require_coreRowsFeature_utils.row_getValue(row, columnId) },
27
- row_renderValue: { fn: (row, columnId) => require_coreRowsFeature_utils.row_renderValue(row, columnId) }
28
- });
29
- },
30
- constructTableAPIs: (table) => {
31
- require_utils.assignTableAPIs("coreRowsFeature", table, {
32
- table_getRowId: { fn: (originalRow, index, parent) => require_coreRowsFeature_utils.table_getRowId(originalRow, table, index, parent) },
33
- table_getRow: { fn: (id, searchAll) => require_coreRowsFeature_utils.table_getRow(table, id, searchAll) }
34
- });
35
- }
36
- };
37
- }
38
- /**
39
- * The Core Rows feature provides the core row functionality.
40
- */
41
- const coreRowsFeature = constructCoreRowsFeature();
8
+ const coreRowsFeature = {
9
+ assignRowPrototype: (prototype, table) => {
10
+ require_utils.assignPrototypeAPIs("coreRowsFeature", prototype, table, {
11
+ row_getAllCellsByColumnId: {
12
+ fn: (row) => require_coreRowsFeature_utils.row_getAllCellsByColumnId(row),
13
+ memoDeps: (row) => [row.getAllCells()]
14
+ },
15
+ row_getAllCells: {
16
+ fn: (row) => require_coreRowsFeature_utils.row_getAllCells(row),
17
+ memoDeps: (row) => [row.table.getAllLeafColumns()]
18
+ },
19
+ row_getLeafRows: { fn: (row) => require_coreRowsFeature_utils.row_getLeafRows(row) },
20
+ row_getParentRow: { fn: (row) => require_coreRowsFeature_utils.row_getParentRow(row) },
21
+ row_getParentRows: { fn: (row) => require_coreRowsFeature_utils.row_getParentRows(row) },
22
+ row_getUniqueValues: { fn: (row, columnId) => require_coreRowsFeature_utils.row_getUniqueValues(row, columnId) },
23
+ row_getValue: { fn: (row, columnId) => require_coreRowsFeature_utils.row_getValue(row, columnId) },
24
+ row_renderValue: { fn: (row, columnId) => require_coreRowsFeature_utils.row_renderValue(row, columnId) }
25
+ });
26
+ },
27
+ constructTableAPIs: (table) => {
28
+ require_utils.assignTableAPIs("coreRowsFeature", table, {
29
+ table_getRowId: { fn: (originalRow, index, parent) => require_coreRowsFeature_utils.table_getRowId(originalRow, table, index, parent) },
30
+ table_getRow: { fn: (id, searchAll) => require_coreRowsFeature_utils.table_getRow(table, id, searchAll) }
31
+ });
32
+ }
33
+ };
42
34
 
43
35
  //#endregion
44
- exports.constructCoreRowsFeature = constructCoreRowsFeature;
45
36
  exports.coreRowsFeature = coreRowsFeature;
46
37
  //# sourceMappingURL=coreRowsFeature.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"coreRowsFeature.cjs","names":["row_getAllCellsByColumnId","row_getAllCells","row_getLeafRows","row_getParentRow","row_getParentRows","row_getUniqueValues","row_getValue","row_renderValue","table_getRowId","table_getRow"],"sources":["../../../src/core/rows/coreRowsFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n row_getAllCells,\n row_getAllCellsByColumnId,\n row_getLeafRows,\n row_getParentRow,\n row_getParentRows,\n row_getUniqueValues,\n row_getValue,\n row_renderValue,\n table_getRow,\n table_getRowId,\n} from './coreRowsFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type {\n// Row_Row,\n// TableOptions_Rows,\n// Table_Rows,\n// } from './coreRowsFeature.types'\n\nexport interface CoreRowsFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Row: Row_Row<TFeatures, TData>\n // TableOptions: TableOptions_Rows<TFeatures, TData>\n // Table: Table_Rows<TFeatures, TData>\n}\n\n/**\n * Creates the stock core rows feature.\n *\n * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.\n */\nexport function constructCoreRowsFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<CoreRowsFeatureConstructors<TFeatures, TData>> {\n return {\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreRowsFeature', prototype, table, {\n row_getAllCellsByColumnId: {\n fn: (row) => row_getAllCellsByColumnId(row),\n memoDeps: (row) => [row.getAllCells()],\n },\n row_getAllCells: {\n fn: (row) => row_getAllCells(row),\n memoDeps: (row) => [row.table.getAllLeafColumns()],\n },\n row_getLeafRows: {\n fn: (row) => row_getLeafRows(row),\n },\n row_getParentRow: {\n fn: (row) => row_getParentRow(row),\n },\n row_getParentRows: {\n fn: (row) => row_getParentRows(row),\n },\n row_getUniqueValues: {\n fn: (row, columnId) => row_getUniqueValues(row, columnId),\n },\n row_getValue: {\n fn: (row, columnId) => row_getValue(row, columnId),\n },\n row_renderValue: {\n fn: (row, columnId) => row_renderValue(row, columnId),\n },\n })\n },\n constructTableAPIs: (table) => {\n assignTableAPIs('coreRowsFeature', table, {\n table_getRowId: {\n fn: (originalRow, index, parent) =>\n table_getRowId(originalRow, table, index, parent),\n },\n table_getRow: {\n fn: (id: string, searchAll?: boolean) =>\n table_getRow(table, id, searchAll),\n },\n })\n },\n }\n}\n\n/**\n * The Core Rows feature provides the core row functionality.\n */\nexport const coreRowsFeature = constructCoreRowsFeature()\n"],"mappings":";;;;;;;;;AAmCA,SAAgB,2BAGiD;CAC/D,OAAO;EACL,qBAAqB,WAAW,UAAU;GACxC,kCAAoB,mBAAmB,WAAW,OAAO;IACvD,2BAA2B;KACzB,KAAK,QAAQA,wDAA0B,GAAG;KAC1C,WAAW,QAAQ,CAAC,IAAI,YAAY,CAAC;IACvC;IACA,iBAAiB;KACf,KAAK,QAAQC,8CAAgB,GAAG;KAChC,WAAW,QAAQ,CAAC,IAAI,MAAM,kBAAkB,CAAC;IACnD;IACA,iBAAiB,EACf,KAAK,QAAQC,8CAAgB,GAAG,EAClC;IACA,kBAAkB,EAChB,KAAK,QAAQC,+CAAiB,GAAG,EACnC;IACA,mBAAmB,EACjB,KAAK,QAAQC,gDAAkB,GAAG,EACpC;IACA,qBAAqB,EACnB,KAAK,KAAK,aAAaC,kDAAoB,KAAK,QAAQ,EAC1D;IACA,cAAc,EACZ,KAAK,KAAK,aAAaC,2CAAa,KAAK,QAAQ,EACnD;IACA,iBAAiB,EACf,KAAK,KAAK,aAAaC,8CAAgB,KAAK,QAAQ,EACtD;GACF,CAAC;EACH;EACA,qBAAqB,UAAU;GAC7B,8BAAgB,mBAAmB,OAAO;IACxC,gBAAgB,EACd,KAAK,aAAa,OAAO,WACvBC,6CAAe,aAAa,OAAO,OAAO,MAAM,EACpD;IACA,cAAc,EACZ,KAAK,IAAY,cACfC,2CAAa,OAAO,IAAI,SAAS,EACrC;GACF,CAAC;EACH;CACF;AACF;;;;AAKA,MAAa,kBAAkB,yBAAyB"}
1
+ {"version":3,"file":"coreRowsFeature.cjs","names":["row_getAllCellsByColumnId","row_getAllCells","row_getLeafRows","row_getParentRow","row_getParentRows","row_getUniqueValues","row_getValue","row_renderValue","table_getRowId","table_getRow"],"sources":["../../../src/core/rows/coreRowsFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n row_getAllCells,\n row_getAllCellsByColumnId,\n row_getLeafRows,\n row_getParentRow,\n row_getParentRows,\n row_getUniqueValues,\n row_getValue,\n row_renderValue,\n table_getRow,\n table_getRowId,\n} from './coreRowsFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that creates row APIs for values, cells, and tree traversal.\n */\nexport const coreRowsFeature: TableFeature = {\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreRowsFeature', prototype, table, {\n row_getAllCellsByColumnId: {\n fn: (row) => row_getAllCellsByColumnId(row),\n memoDeps: (row) => [row.getAllCells()],\n },\n row_getAllCells: {\n fn: (row) => row_getAllCells(row),\n memoDeps: (row) => [row.table.getAllLeafColumns()],\n },\n row_getLeafRows: {\n fn: (row) => row_getLeafRows(row),\n },\n row_getParentRow: {\n fn: (row) => row_getParentRow(row),\n },\n row_getParentRows: {\n fn: (row) => row_getParentRows(row),\n },\n row_getUniqueValues: {\n fn: (row, columnId) => row_getUniqueValues(row, columnId),\n },\n row_getValue: {\n fn: (row, columnId) => row_getValue(row, columnId),\n },\n row_renderValue: {\n fn: (row, columnId) => row_renderValue(row, columnId),\n },\n })\n },\n constructTableAPIs: (table) => {\n assignTableAPIs('coreRowsFeature', table, {\n table_getRowId: {\n fn: (originalRow, index, parent) =>\n table_getRowId(originalRow, table, index, parent),\n },\n table_getRow: {\n fn: (id: string, searchAll?: boolean) =>\n table_getRow(table, id, searchAll),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAkBA,MAAa,kBAAgC;CAC3C,qBAAqB,WAAW,UAAU;EACxC,kCAAoB,mBAAmB,WAAW,OAAO;GACvD,2BAA2B;IACzB,KAAK,QAAQA,wDAA0B,GAAG;IAC1C,WAAW,QAAQ,CAAC,IAAI,YAAY,CAAC;GACvC;GACA,iBAAiB;IACf,KAAK,QAAQC,8CAAgB,GAAG;IAChC,WAAW,QAAQ,CAAC,IAAI,MAAM,kBAAkB,CAAC;GACnD;GACA,iBAAiB,EACf,KAAK,QAAQC,8CAAgB,GAAG,EAClC;GACA,kBAAkB,EAChB,KAAK,QAAQC,+CAAiB,GAAG,EACnC;GACA,mBAAmB,EACjB,KAAK,QAAQC,gDAAkB,GAAG,EACpC;GACA,qBAAqB,EACnB,KAAK,KAAK,aAAaC,kDAAoB,KAAK,QAAQ,EAC1D;GACA,cAAc,EACZ,KAAK,KAAK,aAAaC,2CAAa,KAAK,QAAQ,EACnD;GACA,iBAAiB,EACf,KAAK,KAAK,aAAaC,8CAAgB,KAAK,QAAQ,EACtD;EACF,CAAC;CACH;CACA,qBAAqB,UAAU;EAC7B,8BAAgB,mBAAmB,OAAO;GACxC,gBAAgB,EACd,KAAK,aAAa,OAAO,WACvBC,6CAAe,aAAa,OAAO,OAAO,MAAM,EACpD;GACA,cAAc,EACZ,KAAK,IAAY,cACfC,2CAAa,OAAO,IAAI,SAAS,EACrC;EACF,CAAC;CACH;AACF"}
@@ -1,18 +1,10 @@
1
- import { RowData } from "../../types/type-utils.cjs";
2
- import { TableFeature, TableFeatures } from "../../types/TableFeatures.cjs";
1
+ import { TableFeature } from "../../types/TableFeatures.cjs";
3
2
 
4
3
  //#region src/core/rows/coreRowsFeature.d.ts
5
- interface CoreRowsFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
6
4
  /**
7
- * Creates the stock core rows feature.
8
- *
9
- * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
5
+ * Core feature that creates row APIs for values, cells, and tree traversal.
10
6
  */
11
- declare function constructCoreRowsFeature<TFeatures extends TableFeatures, TData extends RowData>(): TableFeature<CoreRowsFeatureConstructors<TFeatures, TData>>;
12
- /**
13
- * The Core Rows feature provides the core row functionality.
14
- */
15
- declare const coreRowsFeature: TableFeature<CoreRowsFeatureConstructors<TableFeatures, RowData>>;
7
+ declare const coreRowsFeature: TableFeature;
16
8
  //#endregion
17
- export { CoreRowsFeatureConstructors, constructCoreRowsFeature, coreRowsFeature };
9
+ export { coreRowsFeature };
18
10
  //# sourceMappingURL=coreRowsFeature.d.cts.map
@@ -1,18 +1,10 @@
1
- import { RowData } from "../../types/type-utils.js";
2
- import { TableFeature, TableFeatures } from "../../types/TableFeatures.js";
1
+ import { TableFeature } from "../../types/TableFeatures.js";
3
2
 
4
3
  //#region src/core/rows/coreRowsFeature.d.ts
5
- interface CoreRowsFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
6
4
  /**
7
- * Creates the stock core rows feature.
8
- *
9
- * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
5
+ * Core feature that creates row APIs for values, cells, and tree traversal.
10
6
  */
11
- declare function constructCoreRowsFeature<TFeatures extends TableFeatures, TData extends RowData>(): TableFeature<CoreRowsFeatureConstructors<TFeatures, TData>>;
12
- /**
13
- * The Core Rows feature provides the core row functionality.
14
- */
15
- declare const coreRowsFeature: TableFeature<CoreRowsFeatureConstructors<TableFeatures, RowData>>;
7
+ declare const coreRowsFeature: TableFeature;
16
8
  //#endregion
17
- export { CoreRowsFeatureConstructors, constructCoreRowsFeature, coreRowsFeature };
9
+ export { coreRowsFeature };
18
10
  //# sourceMappingURL=coreRowsFeature.d.ts.map
@@ -3,43 +3,35 @@ import { row_getAllCells, row_getAllCellsByColumnId, row_getLeafRows, row_getPar
3
3
 
4
4
  //#region src/core/rows/coreRowsFeature.ts
5
5
  /**
6
- * Creates the stock core rows feature.
7
- *
8
- * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
6
+ * Core feature that creates row APIs for values, cells, and tree traversal.
9
7
  */
10
- function constructCoreRowsFeature() {
11
- return {
12
- assignRowPrototype: (prototype, table) => {
13
- assignPrototypeAPIs("coreRowsFeature", prototype, table, {
14
- row_getAllCellsByColumnId: {
15
- fn: (row) => row_getAllCellsByColumnId(row),
16
- memoDeps: (row) => [row.getAllCells()]
17
- },
18
- row_getAllCells: {
19
- fn: (row) => row_getAllCells(row),
20
- memoDeps: (row) => [row.table.getAllLeafColumns()]
21
- },
22
- row_getLeafRows: { fn: (row) => row_getLeafRows(row) },
23
- row_getParentRow: { fn: (row) => row_getParentRow(row) },
24
- row_getParentRows: { fn: (row) => row_getParentRows(row) },
25
- row_getUniqueValues: { fn: (row, columnId) => row_getUniqueValues(row, columnId) },
26
- row_getValue: { fn: (row, columnId) => row_getValue(row, columnId) },
27
- row_renderValue: { fn: (row, columnId) => row_renderValue(row, columnId) }
28
- });
29
- },
30
- constructTableAPIs: (table) => {
31
- assignTableAPIs("coreRowsFeature", table, {
32
- table_getRowId: { fn: (originalRow, index, parent) => table_getRowId(originalRow, table, index, parent) },
33
- table_getRow: { fn: (id, searchAll) => table_getRow(table, id, searchAll) }
34
- });
35
- }
36
- };
37
- }
38
- /**
39
- * The Core Rows feature provides the core row functionality.
40
- */
41
- const coreRowsFeature = constructCoreRowsFeature();
8
+ const coreRowsFeature = {
9
+ assignRowPrototype: (prototype, table) => {
10
+ assignPrototypeAPIs("coreRowsFeature", prototype, table, {
11
+ row_getAllCellsByColumnId: {
12
+ fn: (row) => row_getAllCellsByColumnId(row),
13
+ memoDeps: (row) => [row.getAllCells()]
14
+ },
15
+ row_getAllCells: {
16
+ fn: (row) => row_getAllCells(row),
17
+ memoDeps: (row) => [row.table.getAllLeafColumns()]
18
+ },
19
+ row_getLeafRows: { fn: (row) => row_getLeafRows(row) },
20
+ row_getParentRow: { fn: (row) => row_getParentRow(row) },
21
+ row_getParentRows: { fn: (row) => row_getParentRows(row) },
22
+ row_getUniqueValues: { fn: (row, columnId) => row_getUniqueValues(row, columnId) },
23
+ row_getValue: { fn: (row, columnId) => row_getValue(row, columnId) },
24
+ row_renderValue: { fn: (row, columnId) => row_renderValue(row, columnId) }
25
+ });
26
+ },
27
+ constructTableAPIs: (table) => {
28
+ assignTableAPIs("coreRowsFeature", table, {
29
+ table_getRowId: { fn: (originalRow, index, parent) => table_getRowId(originalRow, table, index, parent) },
30
+ table_getRow: { fn: (id, searchAll) => table_getRow(table, id, searchAll) }
31
+ });
32
+ }
33
+ };
42
34
 
43
35
  //#endregion
44
- export { constructCoreRowsFeature, coreRowsFeature };
36
+ export { coreRowsFeature };
45
37
  //# sourceMappingURL=coreRowsFeature.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"coreRowsFeature.js","names":[],"sources":["../../../src/core/rows/coreRowsFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n row_getAllCells,\n row_getAllCellsByColumnId,\n row_getLeafRows,\n row_getParentRow,\n row_getParentRows,\n row_getUniqueValues,\n row_getValue,\n row_renderValue,\n table_getRow,\n table_getRowId,\n} from './coreRowsFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type {\n// Row_Row,\n// TableOptions_Rows,\n// Table_Rows,\n// } from './coreRowsFeature.types'\n\nexport interface CoreRowsFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Row: Row_Row<TFeatures, TData>\n // TableOptions: TableOptions_Rows<TFeatures, TData>\n // Table: Table_Rows<TFeatures, TData>\n}\n\n/**\n * Creates the stock core rows feature.\n *\n * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.\n */\nexport function constructCoreRowsFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<CoreRowsFeatureConstructors<TFeatures, TData>> {\n return {\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreRowsFeature', prototype, table, {\n row_getAllCellsByColumnId: {\n fn: (row) => row_getAllCellsByColumnId(row),\n memoDeps: (row) => [row.getAllCells()],\n },\n row_getAllCells: {\n fn: (row) => row_getAllCells(row),\n memoDeps: (row) => [row.table.getAllLeafColumns()],\n },\n row_getLeafRows: {\n fn: (row) => row_getLeafRows(row),\n },\n row_getParentRow: {\n fn: (row) => row_getParentRow(row),\n },\n row_getParentRows: {\n fn: (row) => row_getParentRows(row),\n },\n row_getUniqueValues: {\n fn: (row, columnId) => row_getUniqueValues(row, columnId),\n },\n row_getValue: {\n fn: (row, columnId) => row_getValue(row, columnId),\n },\n row_renderValue: {\n fn: (row, columnId) => row_renderValue(row, columnId),\n },\n })\n },\n constructTableAPIs: (table) => {\n assignTableAPIs('coreRowsFeature', table, {\n table_getRowId: {\n fn: (originalRow, index, parent) =>\n table_getRowId(originalRow, table, index, parent),\n },\n table_getRow: {\n fn: (id: string, searchAll?: boolean) =>\n table_getRow(table, id, searchAll),\n },\n })\n },\n }\n}\n\n/**\n * The Core Rows feature provides the core row functionality.\n */\nexport const coreRowsFeature = constructCoreRowsFeature()\n"],"mappings":";;;;;;;;;AAmCA,SAAgB,2BAGiD;CAC/D,OAAO;EACL,qBAAqB,WAAW,UAAU;GACxC,oBAAoB,mBAAmB,WAAW,OAAO;IACvD,2BAA2B;KACzB,KAAK,QAAQ,0BAA0B,GAAG;KAC1C,WAAW,QAAQ,CAAC,IAAI,YAAY,CAAC;IACvC;IACA,iBAAiB;KACf,KAAK,QAAQ,gBAAgB,GAAG;KAChC,WAAW,QAAQ,CAAC,IAAI,MAAM,kBAAkB,CAAC;IACnD;IACA,iBAAiB,EACf,KAAK,QAAQ,gBAAgB,GAAG,EAClC;IACA,kBAAkB,EAChB,KAAK,QAAQ,iBAAiB,GAAG,EACnC;IACA,mBAAmB,EACjB,KAAK,QAAQ,kBAAkB,GAAG,EACpC;IACA,qBAAqB,EACnB,KAAK,KAAK,aAAa,oBAAoB,KAAK,QAAQ,EAC1D;IACA,cAAc,EACZ,KAAK,KAAK,aAAa,aAAa,KAAK,QAAQ,EACnD;IACA,iBAAiB,EACf,KAAK,KAAK,aAAa,gBAAgB,KAAK,QAAQ,EACtD;GACF,CAAC;EACH;EACA,qBAAqB,UAAU;GAC7B,gBAAgB,mBAAmB,OAAO;IACxC,gBAAgB,EACd,KAAK,aAAa,OAAO,WACvB,eAAe,aAAa,OAAO,OAAO,MAAM,EACpD;IACA,cAAc,EACZ,KAAK,IAAY,cACf,aAAa,OAAO,IAAI,SAAS,EACrC;GACF,CAAC;EACH;CACF;AACF;;;;AAKA,MAAa,kBAAkB,yBAAyB"}
1
+ {"version":3,"file":"coreRowsFeature.js","names":[],"sources":["../../../src/core/rows/coreRowsFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, assignTableAPIs } from '../../utils'\nimport {\n row_getAllCells,\n row_getAllCellsByColumnId,\n row_getLeafRows,\n row_getParentRow,\n row_getParentRows,\n row_getUniqueValues,\n row_getValue,\n row_renderValue,\n table_getRow,\n table_getRowId,\n} from './coreRowsFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that creates row APIs for values, cells, and tree traversal.\n */\nexport const coreRowsFeature: TableFeature = {\n assignRowPrototype: (prototype, table) => {\n assignPrototypeAPIs('coreRowsFeature', prototype, table, {\n row_getAllCellsByColumnId: {\n fn: (row) => row_getAllCellsByColumnId(row),\n memoDeps: (row) => [row.getAllCells()],\n },\n row_getAllCells: {\n fn: (row) => row_getAllCells(row),\n memoDeps: (row) => [row.table.getAllLeafColumns()],\n },\n row_getLeafRows: {\n fn: (row) => row_getLeafRows(row),\n },\n row_getParentRow: {\n fn: (row) => row_getParentRow(row),\n },\n row_getParentRows: {\n fn: (row) => row_getParentRows(row),\n },\n row_getUniqueValues: {\n fn: (row, columnId) => row_getUniqueValues(row, columnId),\n },\n row_getValue: {\n fn: (row, columnId) => row_getValue(row, columnId),\n },\n row_renderValue: {\n fn: (row, columnId) => row_renderValue(row, columnId),\n },\n })\n },\n constructTableAPIs: (table) => {\n assignTableAPIs('coreRowsFeature', table, {\n table_getRowId: {\n fn: (originalRow, index, parent) =>\n table_getRowId(originalRow, table, index, parent),\n },\n table_getRow: {\n fn: (id: string, searchAll?: boolean) =>\n table_getRow(table, id, searchAll),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAkBA,MAAa,kBAAgC;CAC3C,qBAAqB,WAAW,UAAU;EACxC,oBAAoB,mBAAmB,WAAW,OAAO;GACvD,2BAA2B;IACzB,KAAK,QAAQ,0BAA0B,GAAG;IAC1C,WAAW,QAAQ,CAAC,IAAI,YAAY,CAAC;GACvC;GACA,iBAAiB;IACf,KAAK,QAAQ,gBAAgB,GAAG;IAChC,WAAW,QAAQ,CAAC,IAAI,MAAM,kBAAkB,CAAC;GACnD;GACA,iBAAiB,EACf,KAAK,QAAQ,gBAAgB,GAAG,EAClC;GACA,kBAAkB,EAChB,KAAK,QAAQ,iBAAiB,GAAG,EACnC;GACA,mBAAmB,EACjB,KAAK,QAAQ,kBAAkB,GAAG,EACpC;GACA,qBAAqB,EACnB,KAAK,KAAK,aAAa,oBAAoB,KAAK,QAAQ,EAC1D;GACA,cAAc,EACZ,KAAK,KAAK,aAAa,aAAa,KAAK,QAAQ,EACnD;GACA,iBAAiB,EACf,KAAK,KAAK,aAAa,gBAAgB,KAAK,QAAQ,EACtD;EACF,CAAC;CACH;CACA,qBAAqB,UAAU;EAC7B,gBAAgB,mBAAmB,OAAO;GACxC,gBAAgB,EACd,KAAK,aAAa,OAAO,WACvB,eAAe,aAAa,OAAO,OAAO,MAAM,EACpD;GACA,cAAc,EACZ,KAAK,IAAY,cACf,aAAa,OAAO,IAAI,SAAS,EACrC;EACF,CAAC;CACH;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { RowData } from "../../types/type-utils.cjs";
2
2
  import { Row } from "../../types/Row.cjs";
3
- import { TableFeatures } from "../../types/TableFeatures.cjs";
4
3
  import { Table_Internal } from "../../types/Table.cjs";
4
+ import { TableFeatures } from "../../types/TableFeatures.cjs";
5
5
  import { Cell } from "../../types/Cell.cjs";
6
6
 
7
7
  //#region src/core/rows/coreRowsFeature.types.d.ts
@@ -1,7 +1,7 @@
1
1
  import { RowData } from "../../types/type-utils.js";
2
2
  import { Row } from "../../types/Row.js";
3
- import { TableFeatures } from "../../types/TableFeatures.js";
4
3
  import { Table_Internal } from "../../types/Table.js";
4
+ import { TableFeatures } from "../../types/TableFeatures.js";
5
5
  import { Cell } from "../../types/Cell.js";
6
6
 
7
7
  //#region src/core/rows/coreRowsFeature.types.d.ts
@@ -1,7 +1,7 @@
1
1
  import { RowData } from "../../types/type-utils.cjs";
2
2
  import { Row } from "../../types/Row.cjs";
3
- import { TableFeatures } from "../../types/TableFeatures.cjs";
4
3
  import { Table_Internal } from "../../types/Table.cjs";
4
+ import { TableFeatures } from "../../types/TableFeatures.cjs";
5
5
  import { Cell } from "../../types/Cell.cjs";
6
6
 
7
7
  //#region src/core/rows/coreRowsFeature.utils.d.ts
@@ -1,7 +1,7 @@
1
1
  import { RowData } from "../../types/type-utils.js";
2
2
  import { Row } from "../../types/Row.js";
3
- import { TableFeatures } from "../../types/TableFeatures.js";
4
3
  import { Table_Internal } from "../../types/Table.js";
4
+ import { TableFeatures } from "../../types/TableFeatures.js";
5
5
  import { Cell } from "../../types/Cell.js";
6
6
 
7
7
  //#region src/core/rows/coreRowsFeature.utils.d.ts
@@ -22,15 +22,20 @@ function getInitialTableState(features, initialState = {}) {
22
22
  * This wires core properties, feature prototype APIs, and instance data used by table rendering and row-model operations.
23
23
  */
24
24
  function constructTable(tableOptions) {
25
- const _reactivity = tableOptions.features.coreReativityFeature;
25
+ const _reactivity = tableOptions.features.coreReactivityFeature;
26
+ const { aggregationFns, columnMeta: _columnMeta, coreRowModel, expandedRowModel, facetedMinMaxValues, facetedRowModel, facetedUniqueValues, filterFns, filterMeta: _filterMeta, filteredRowModel, groupedRowModel, paginatedRowModel, sortFns, sortedRowModel, tableMeta: _tableMeta, ...features } = tableOptions.features;
26
27
  const table = {
27
28
  _reactivity,
28
29
  _features: {
29
30
  ...require_coreFeatures.coreFeatures,
30
- ...tableOptions.features
31
+ ...features
31
32
  },
32
33
  _rowModels: {},
33
- _rowModelFns: {},
34
+ _rowModelFns: {
35
+ aggregationFns,
36
+ filterFns,
37
+ sortFns
38
+ },
34
39
  baseAtoms: {},
35
40
  atoms: {}
36
41
  };
@@ -78,8 +83,8 @@ function constructTable(tableOptions) {
78
83
  const key = stateKeys[i];
79
84
  table.baseAtoms[key] = _reactivity.createWritableAtom(table.initialState[key], { debugName: `table/baseAtoms/${key}` });
80
85
  table.atoms[key] = _reactivity.createReadonlyAtom(() => {
81
- var _table$options$atoms;
82
- const externalAtom = (_table$options$atoms = table.options.atoms) === null || _table$options$atoms === void 0 ? void 0 : _table$options$atoms[key];
86
+ const externalAtoms = table.options.atoms;
87
+ const externalAtom = externalAtoms === null || externalAtoms === void 0 ? void 0 : externalAtoms[key];
83
88
  if (externalAtom) return externalAtom.get();
84
89
  return table.baseAtoms[key].get();
85
90
  }, { debugName: `table/atoms/${key}` });
@@ -95,7 +100,17 @@ function constructTable(tableOptions) {
95
100
  }, { debugName: "table/store" }));
96
101
  if (process.env.NODE_ENV === "development" && (tableOptions.debugAll || tableOptions.debugTable)) {
97
102
  const features = Object.keys(table._features);
98
- const rowModels = Object.keys(table.options.rowModels || {});
103
+ const rowModels = Object.entries({
104
+ coreRowModel,
105
+ filteredRowModel,
106
+ groupedRowModel,
107
+ sortedRowModel,
108
+ expandedRowModel,
109
+ paginatedRowModel,
110
+ facetedRowModel,
111
+ facetedMinMaxValues,
112
+ facetedUniqueValues
113
+ }).filter(([, factory]) => factory).map(([key]) => key);
99
114
  const states = Object.keys(table.initialState);
100
115
  console.log(`Constructing Table Instance
101
116
 
@@ -1 +1 @@
1
- {"version":3,"file":"constructTable.cjs","names":["cloneState","coreFeatures","atomToStore"],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { Atom } from '@tanstack/store'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState } from '../../types/TableState'\n\n/**\n * Builds the initial table state from registered features and user initial state.\n *\n * Each feature contributes its default state before user-provided `initialState` values are merged in.\n */\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\n/**\n * Constructs a table 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 constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions.features.coreReativityFeature!\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...tableOptions.features },\n _rowModels: {},\n _rowModelFns: {},\n baseAtoms: {},\n atoms: {},\n } as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature<{}>> = Object.values(table._features)\n\n const defaultOptions = featuresList.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultTableOptions?.(table))\n }, {}) as TableOptions<TFeatures, TData>\n\n const mergedOptions = { ...defaultOptions, ...tableOptions }\n\n if (_reactivity.wrapExternalAtoms && mergedOptions.atoms) {\n for (const [atomKey, _atom] of Object.entries(mergedOptions.atoms)) {\n const atom = _atom as Atom<any>\n const wrappedAtom = _reactivity.createWritableAtom(atom.get(), {\n debugName: `externalAtom/${atomKey}`,\n })\n ;(mergedOptions.atoms as any)[atomKey] = wrappedAtom\n // Two-way syncing between the original atom and the wrapped one.\n let syncExternal = false\n const syncAtomToWrappedSub = atom.subscribe((value) => {\n if (syncExternal) return\n wrappedAtom.set(value)\n })\n const syncWrappedToAtomSub = wrappedAtom.subscribe((value) => {\n syncExternal = true\n atom.set(value)\n syncExternal = false\n })\n _reactivity.addSubscription(syncAtomToWrappedSub)\n _reactivity.addSubscription(syncWrappedToAtomSub)\n }\n }\n\n if (_reactivity.createOptionsStore) {\n // @ts-ignore - direct set\n table.optionsStore = _reactivity.createWritableAtom<\n TableOptions<TFeatures, TData>\n >(mergedOptions, { debugName: 'table/optionsStore' })\n Object.defineProperty(table, 'options', {\n configurable: true,\n enumerable: true,\n get() {\n return table.optionsStore!.get()\n },\n set(value) {\n table.optionsStore!.set(() => value) // or your real update shape\n },\n })\n } else {\n table.options = mergedOptions\n }\n\n table.initialState = getInitialTableState(\n table._features,\n table.options.initialState,\n )\n\n const stateKeys = Object.keys(table.initialState) as Array<\n string & keyof TableState<TFeatures>\n >\n\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n table.baseAtoms[key] = _reactivity.createWritableAtom(\n table.initialState[key],\n {\n debugName: `table/baseAtoms/${key}`,\n },\n ) as any\n\n // create readonly derived atom: on each get(), read either external atom or base atom\n ;(table.atoms as any)[key] = _reactivity.createReadonlyAtom(\n () => {\n const externalAtom = table.options.atoms?.[key]\n if (externalAtom) {\n return externalAtom.get()\n }\n return table.baseAtoms[key].get()\n },\n { debugName: `table/atoms/${key}` },\n )\n }\n\n table_syncExternalStateToBaseAtoms(table)\n\n table.store = atomToStore(\n _reactivity.createReadonlyAtom(\n () => {\n const snapshot = {} as TableState<TFeatures>\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n snapshot[key] = table.atoms[key].get()\n }\n return snapshot\n },\n { debugName: 'table/store' },\n ),\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n (tableOptions.debugAll || tableOptions.debugTable)\n ) {\n const features = Object.keys(table._features)\n const rowModels = Object.keys(table.options.rowModels || {})\n const states = Object.keys(table.initialState)\n\n console.log(\n `Constructing Table Instance\n\n Features: ${features.join('\\n ')}\n\n Row Models: ${rowModels.length ? rowModels.join('\\n ') : '(none)'}\n\n States: ${states.join('\\n ')}\\n`,\n { table },\n )\n }\n\n for (let i = 0; i < featuresList.length; i++) {\n featuresList[i]!.constructTableAPIs?.(table)\n }\n\n return table\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"constructTable.cjs","names":["cloneState","coreFeatures","atomToStore"],"sources":["../../../src/core/table/constructTable.ts"],"sourcesContent":["import { coreFeatures } from '../coreFeatures'\nimport { cloneState } from '../../utils'\nimport { atomToStore } from '../reactivity/coreReactivityFeature.utils'\nimport { table_syncExternalStateToBaseAtoms } from './coreTablesFeature.utils'\nimport type { Atom } from '@tanstack/store'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\nimport type { Table, Table_Internal } from '../../types/Table'\nimport type { TableOptions } from '../../types/TableOptions'\nimport type { TableState, TableState_All } from '../../types/TableState'\n\n/**\n * Builds the initial table state from registered features and user initial state.\n *\n * Each feature contributes its default state before user-provided `initialState` values are merged in.\n */\nexport function getInitialTableState<TFeatures extends TableFeatures>(\n features: TFeatures,\n initialState: Partial<TableState<TFeatures>> | undefined = {},\n): TableState<TFeatures> {\n Object.values(features).forEach((feature) => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n return cloneState(initialState) as TableState<TFeatures>\n}\n\n/**\n * Constructs a table 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 constructTable<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(tableOptions: TableOptions<TFeatures, TData>): Table<TFeatures, TData> {\n const _reactivity = tableOptions.features.coreReactivityFeature!\n\n // Strip the non-feature slots: type-only meta slots, row model factories,\n // and row model fn registries all live on the `features` option but are not\n // table features themselves.\n const {\n aggregationFns,\n columnMeta: _columnMeta,\n coreRowModel,\n expandedRowModel,\n facetedMinMaxValues,\n facetedRowModel,\n facetedUniqueValues,\n filterFns,\n filterMeta: _filterMeta,\n filteredRowModel,\n groupedRowModel,\n paginatedRowModel,\n sortFns,\n sortedRowModel,\n tableMeta: _tableMeta,\n ...features\n } = tableOptions.features\n\n const table = {\n _reactivity,\n _features: { ...coreFeatures, ...features },\n _rowModels: {},\n _rowModelFns: { aggregationFns, filterFns, sortFns },\n baseAtoms: {},\n atoms: {},\n } as unknown as Table_Internal<TFeatures, TData>\n\n const featuresList: Array<TableFeature> = Object.values(table._features)\n\n const defaultOptions = featuresList.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultTableOptions?.(table))\n }, {}) as TableOptions<TFeatures, TData>\n\n const mergedOptions = { ...defaultOptions, ...tableOptions }\n\n if (_reactivity.wrapExternalAtoms && mergedOptions.atoms) {\n for (const [atomKey, _atom] of Object.entries(mergedOptions.atoms)) {\n const atom = _atom as Atom<any>\n const wrappedAtom = _reactivity.createWritableAtom(atom.get(), {\n debugName: `externalAtom/${atomKey}`,\n })\n ;(mergedOptions.atoms as any)[atomKey] = wrappedAtom\n // Two-way syncing between the original atom and the wrapped one.\n let syncExternal = false\n const syncAtomToWrappedSub = atom.subscribe((value) => {\n if (syncExternal) return\n wrappedAtom.set(value)\n })\n const syncWrappedToAtomSub = wrappedAtom.subscribe((value) => {\n syncExternal = true\n atom.set(value)\n syncExternal = false\n })\n _reactivity.addSubscription(syncAtomToWrappedSub)\n _reactivity.addSubscription(syncWrappedToAtomSub)\n }\n }\n\n if (_reactivity.createOptionsStore) {\n // @ts-ignore - direct set\n table.optionsStore = _reactivity.createWritableAtom<\n TableOptions<TFeatures, TData>\n >(mergedOptions, { debugName: 'table/optionsStore' })\n Object.defineProperty(table, 'options', {\n configurable: true,\n enumerable: true,\n get() {\n return table.optionsStore!.get()\n },\n set(value) {\n table.optionsStore!.set(() => value) // or your real update shape\n },\n })\n } else {\n table.options = mergedOptions\n }\n\n table.initialState = getInitialTableState(\n table._features,\n table.options.initialState,\n )\n\n const stateKeys = Object.keys(table.initialState) as Array<\n string & keyof TableState_All\n >\n\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n table.baseAtoms[key] = _reactivity.createWritableAtom(\n table.initialState[key],\n {\n debugName: `table/baseAtoms/${key}`,\n },\n ) as any\n\n // create readonly derived atom: on each get(), read either external atom or base atom\n ;(table.atoms as any)[key] = _reactivity.createReadonlyAtom(\n () => {\n const externalAtoms = table.options.atoms as\n | Partial<Record<keyof TableState_All, Atom<unknown>>>\n | undefined\n const externalAtom = externalAtoms?.[key]\n if (externalAtom) {\n return externalAtom.get()\n }\n return table.baseAtoms[key]!.get()\n },\n { debugName: `table/atoms/${key}` },\n )\n }\n\n table_syncExternalStateToBaseAtoms(table)\n\n table.store = atomToStore(\n _reactivity.createReadonlyAtom(\n () => {\n const snapshot = {} as TableState<TFeatures> & TableState_All\n for (let i = 0; i < stateKeys.length; i++) {\n const key = stateKeys[i]!\n ;(snapshot as Record<string, unknown>)[key] = table.atoms[key]!.get()\n }\n return snapshot\n },\n { debugName: 'table/store' },\n ),\n )\n\n if (\n process.env.NODE_ENV === 'development' &&\n (tableOptions.debugAll || tableOptions.debugTable)\n ) {\n const features = Object.keys(table._features)\n const rowModels = Object.entries({\n coreRowModel,\n filteredRowModel,\n groupedRowModel,\n sortedRowModel,\n expandedRowModel,\n paginatedRowModel,\n facetedRowModel,\n facetedMinMaxValues,\n facetedUniqueValues,\n })\n .filter(([, factory]) => factory)\n .map(([key]) => key)\n const states = Object.keys(table.initialState)\n\n console.log(\n `Constructing Table Instance\n\n Features: ${features.join('\\n ')}\n\n Row Models: ${rowModels.length ? rowModels.join('\\n ') : '(none)'}\n\n States: ${states.join('\\n ')}\\n`,\n { table },\n )\n }\n\n for (let i = 0; i < featuresList.length; i++) {\n featuresList[i]!.constructTableAPIs?.(table)\n }\n\n return table\n}\n"],"mappings":"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"}