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

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 (454) 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 +4 -4
  10. package/dist/core/cells/coreCellsFeature.types.d.ts +4 -4
  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 +5 -5
  22. package/dist/core/columns/coreColumnsFeature.types.d.ts +5 -5
  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 +6 -6
  42. package/dist/core/headers/coreHeadersFeature.types.d.ts +6 -6
  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 +5 -15
  54. package/dist/core/row-models/coreRowModelsFeature.types.d.ts +5 -15
  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 +1 -2
  62. package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
  63. package/dist/core/row-models/createCoreRowModel.d.cts +2 -2
  64. package/dist/core/row-models/createCoreRowModel.d.ts +2 -2
  65. package/dist/core/row-models/createCoreRowModel.js +1 -2
  66. package/dist/core/row-models/createCoreRowModel.js.map +1 -1
  67. package/dist/core/rows/constructRow.d.cts +1 -1
  68. package/dist/core/rows/constructRow.d.ts +1 -1
  69. package/dist/core/rows/coreRowsFeature.cjs +27 -36
  70. package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
  71. package/dist/core/rows/coreRowsFeature.d.cts +4 -12
  72. package/dist/core/rows/coreRowsFeature.d.ts +4 -12
  73. package/dist/core/rows/coreRowsFeature.js +28 -36
  74. package/dist/core/rows/coreRowsFeature.js.map +1 -1
  75. package/dist/core/rows/coreRowsFeature.types.d.cts +5 -5
  76. package/dist/core/rows/coreRowsFeature.types.d.ts +5 -5
  77. package/dist/core/rows/coreRowsFeature.utils.d.cts +1 -1
  78. package/dist/core/rows/coreRowsFeature.utils.d.ts +1 -1
  79. package/dist/core/table/constructTable.cjs +21 -6
  80. package/dist/core/table/constructTable.cjs.map +1 -1
  81. package/dist/core/table/constructTable.d.cts +1 -1
  82. package/dist/core/table/constructTable.d.ts +1 -1
  83. package/dist/core/table/constructTable.js +21 -6
  84. package/dist/core/table/constructTable.js.map +1 -1
  85. package/dist/core/table/coreTablesFeature.cjs +7 -16
  86. package/dist/core/table/coreTablesFeature.cjs.map +1 -1
  87. package/dist/core/table/coreTablesFeature.d.cts +4 -12
  88. package/dist/core/table/coreTablesFeature.d.ts +4 -12
  89. package/dist/core/table/coreTablesFeature.js +8 -16
  90. package/dist/core/table/coreTablesFeature.js.map +1 -1
  91. package/dist/core/table/coreTablesFeature.types.d.cts +27 -15
  92. package/dist/core/table/coreTablesFeature.types.d.ts +27 -15
  93. package/dist/core/table/coreTablesFeature.utils.cjs +1 -2
  94. package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
  95. package/dist/core/table/coreTablesFeature.utils.d.cts +1 -1
  96. package/dist/core/table/coreTablesFeature.utils.d.ts +1 -1
  97. package/dist/core/table/coreTablesFeature.utils.js +1 -2
  98. package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
  99. package/dist/features/column-faceting/columnFacetingFeature.cjs +49 -61
  100. package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
  101. package/dist/features/column-faceting/columnFacetingFeature.d.cts +4 -15
  102. package/dist/features/column-faceting/columnFacetingFeature.d.ts +4 -15
  103. package/dist/features/column-faceting/columnFacetingFeature.js +50 -61
  104. package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
  105. package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +8 -29
  106. package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +8 -29
  107. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +12 -12
  108. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
  109. package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +1 -1
  110. package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +1 -1
  111. package/dist/features/column-faceting/columnFacetingFeature.utils.js +12 -12
  112. package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
  113. package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
  114. package/dist/features/column-faceting/createFacetedMinMaxValues.d.cts +1 -1
  115. package/dist/features/column-faceting/createFacetedMinMaxValues.d.ts +1 -1
  116. package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
  117. package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
  118. package/dist/features/column-faceting/createFacetedRowModel.d.cts +1 -1
  119. package/dist/features/column-faceting/createFacetedRowModel.d.ts +1 -1
  120. package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
  121. package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
  122. package/dist/features/column-faceting/createFacetedUniqueValues.d.cts +1 -1
  123. package/dist/features/column-faceting/createFacetedUniqueValues.d.ts +1 -1
  124. package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
  125. package/dist/features/column-filtering/columnFilteringFeature.cjs +40 -53
  126. package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -1
  127. package/dist/features/column-filtering/columnFilteringFeature.d.cts +4 -16
  128. package/dist/features/column-filtering/columnFilteringFeature.d.ts +4 -16
  129. package/dist/features/column-filtering/columnFilteringFeature.js +41 -53
  130. package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -1
  131. package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +40 -26
  132. package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +40 -26
  133. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +1 -1
  134. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
  135. package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +2 -2
  136. package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +2 -2
  137. package/dist/features/column-filtering/columnFilteringFeature.utils.js +1 -1
  138. package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
  139. package/dist/features/column-filtering/createFilteredRowModel.cjs +4 -2
  140. package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
  141. package/dist/features/column-filtering/createFilteredRowModel.d.cts +5 -3
  142. package/dist/features/column-filtering/createFilteredRowModel.d.ts +5 -3
  143. package/dist/features/column-filtering/createFilteredRowModel.js +4 -2
  144. package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
  145. package/dist/features/column-grouping/columnGroupingFeature.cjs +57 -69
  146. package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
  147. package/dist/features/column-grouping/columnGroupingFeature.d.cts +4 -15
  148. package/dist/features/column-grouping/columnGroupingFeature.d.ts +4 -15
  149. package/dist/features/column-grouping/columnGroupingFeature.js +58 -69
  150. package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
  151. package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +23 -19
  152. package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +23 -19
  153. package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +1 -1
  154. package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +1 -1
  155. package/dist/features/column-grouping/createGroupedRowModel.cjs +5 -2
  156. package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
  157. package/dist/features/column-grouping/createGroupedRowModel.d.cts +6 -3
  158. package/dist/features/column-grouping/createGroupedRowModel.d.ts +6 -3
  159. package/dist/features/column-grouping/createGroupedRowModel.js +5 -2
  160. package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
  161. package/dist/features/column-ordering/columnOrderingFeature.cjs +47 -59
  162. package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
  163. package/dist/features/column-ordering/columnOrderingFeature.d.cts +4 -15
  164. package/dist/features/column-ordering/columnOrderingFeature.d.ts +4 -15
  165. package/dist/features/column-ordering/columnOrderingFeature.js +48 -59
  166. package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
  167. package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +1 -1
  168. package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +1 -1
  169. package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +1 -1
  170. package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +1 -1
  171. package/dist/features/column-pinning/columnPinningFeature.cjs +209 -221
  172. package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
  173. package/dist/features/column-pinning/columnPinningFeature.d.cts +4 -15
  174. package/dist/features/column-pinning/columnPinningFeature.d.ts +4 -15
  175. package/dist/features/column-pinning/columnPinningFeature.js +210 -221
  176. package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
  177. package/dist/features/column-pinning/columnPinningFeature.types.d.cts +2 -2
  178. package/dist/features/column-pinning/columnPinningFeature.types.d.ts +2 -2
  179. package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
  180. package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +13 -13
  181. package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +13 -13
  182. package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
  183. package/dist/features/column-resizing/columnResizingFeature.cjs +31 -43
  184. package/dist/features/column-resizing/columnResizingFeature.cjs.map +1 -1
  185. package/dist/features/column-resizing/columnResizingFeature.d.cts +4 -15
  186. package/dist/features/column-resizing/columnResizingFeature.d.ts +4 -15
  187. package/dist/features/column-resizing/columnResizingFeature.js +32 -43
  188. package/dist/features/column-resizing/columnResizingFeature.js.map +1 -1
  189. package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +1 -1
  190. package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +1 -1
  191. package/dist/features/column-sizing/columnSizingFeature.cjs +112 -125
  192. package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
  193. package/dist/features/column-sizing/columnSizingFeature.d.cts +4 -16
  194. package/dist/features/column-sizing/columnSizingFeature.d.ts +4 -16
  195. package/dist/features/column-sizing/columnSizingFeature.js +113 -125
  196. package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
  197. package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +4 -4
  198. package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +4 -4
  199. package/dist/features/column-visibility/columnVisibilityFeature.cjs +83 -95
  200. package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
  201. package/dist/features/column-visibility/columnVisibilityFeature.d.cts +4 -15
  202. package/dist/features/column-visibility/columnVisibilityFeature.d.ts +4 -15
  203. package/dist/features/column-visibility/columnVisibilityFeature.js +84 -95
  204. package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
  205. package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +2 -2
  206. package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +2 -2
  207. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +1 -1
  208. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +1 -1
  209. package/dist/features/global-filtering/globalFilteringFeature.cjs +31 -43
  210. package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
  211. package/dist/features/global-filtering/globalFilteringFeature.d.cts +4 -15
  212. package/dist/features/global-filtering/globalFilteringFeature.d.ts +4 -15
  213. package/dist/features/global-filtering/globalFilteringFeature.js +32 -43
  214. package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
  215. package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +3 -3
  216. package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +3 -3
  217. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
  218. package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +7 -5
  219. package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +7 -5
  220. package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
  221. package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
  222. package/dist/features/row-expanding/createExpandedRowModel.d.cts +1 -1
  223. package/dist/features/row-expanding/createExpandedRowModel.d.ts +1 -1
  224. package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
  225. package/dist/features/row-expanding/rowExpandingFeature.cjs +37 -49
  226. package/dist/features/row-expanding/rowExpandingFeature.cjs.map +1 -1
  227. package/dist/features/row-expanding/rowExpandingFeature.d.cts +4 -15
  228. package/dist/features/row-expanding/rowExpandingFeature.d.ts +4 -15
  229. package/dist/features/row-expanding/rowExpandingFeature.js +38 -49
  230. package/dist/features/row-expanding/rowExpandingFeature.js.map +1 -1
  231. package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +5 -14
  232. package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +5 -14
  233. package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +1 -1
  234. package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +1 -1
  235. package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
  236. package/dist/features/row-pagination/createPaginatedRowModel.d.cts +1 -1
  237. package/dist/features/row-pagination/createPaginatedRowModel.d.ts +1 -1
  238. package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
  239. package/dist/features/row-pagination/rowPaginationFeature.cjs +35 -47
  240. package/dist/features/row-pagination/rowPaginationFeature.cjs.map +1 -1
  241. package/dist/features/row-pagination/rowPaginationFeature.d.cts +4 -15
  242. package/dist/features/row-pagination/rowPaginationFeature.d.ts +4 -15
  243. package/dist/features/row-pagination/rowPaginationFeature.js +36 -47
  244. package/dist/features/row-pagination/rowPaginationFeature.js.map +1 -1
  245. package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +4 -13
  246. package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +4 -13
  247. package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +1 -1
  248. package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +1 -1
  249. package/dist/features/row-pinning/rowPinningFeature.cjs +55 -67
  250. package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
  251. package/dist/features/row-pinning/rowPinningFeature.d.cts +4 -15
  252. package/dist/features/row-pinning/rowPinningFeature.d.ts +4 -15
  253. package/dist/features/row-pinning/rowPinningFeature.js +56 -67
  254. package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
  255. package/dist/features/row-pinning/rowPinningFeature.types.d.cts +2 -2
  256. package/dist/features/row-pinning/rowPinningFeature.types.d.ts +2 -2
  257. package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +1 -1
  258. package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +1 -1
  259. package/dist/features/row-selection/rowSelectionFeature.cjs +65 -77
  260. package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
  261. package/dist/features/row-selection/rowSelectionFeature.d.cts +4 -15
  262. package/dist/features/row-selection/rowSelectionFeature.d.ts +4 -15
  263. package/dist/features/row-selection/rowSelectionFeature.js +66 -77
  264. package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
  265. package/dist/features/row-selection/rowSelectionFeature.types.d.cts +2 -2
  266. package/dist/features/row-selection/rowSelectionFeature.types.d.ts +2 -2
  267. package/dist/features/row-selection/rowSelectionFeature.utils.cjs +10 -6
  268. package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
  269. package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +1 -1
  270. package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +1 -1
  271. package/dist/features/row-selection/rowSelectionFeature.utils.js +10 -6
  272. package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
  273. package/dist/features/row-sorting/createSortedRowModel.cjs +4 -2
  274. package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
  275. package/dist/features/row-sorting/createSortedRowModel.d.cts +5 -3
  276. package/dist/features/row-sorting/createSortedRowModel.d.ts +5 -3
  277. package/dist/features/row-sorting/createSortedRowModel.js +4 -2
  278. package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
  279. package/dist/features/row-sorting/rowSortingFeature.cjs +45 -57
  280. package/dist/features/row-sorting/rowSortingFeature.cjs.map +1 -1
  281. package/dist/features/row-sorting/rowSortingFeature.d.cts +4 -15
  282. package/dist/features/row-sorting/rowSortingFeature.d.ts +4 -15
  283. package/dist/features/row-sorting/rowSortingFeature.js +46 -57
  284. package/dist/features/row-sorting/rowSortingFeature.js.map +1 -1
  285. package/dist/features/row-sorting/rowSortingFeature.types.d.cts +23 -20
  286. package/dist/features/row-sorting/rowSortingFeature.types.d.ts +23 -20
  287. package/dist/features/row-sorting/rowSortingFeature.utils.cjs +8 -5
  288. package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
  289. package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +1 -1
  290. package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +1 -1
  291. package/dist/features/row-sorting/rowSortingFeature.utils.js +8 -5
  292. package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
  293. package/dist/fns/aggregationFns.cjs +18 -18
  294. package/dist/fns/aggregationFns.cjs.map +1 -1
  295. package/dist/fns/aggregationFns.d.cts +21 -19
  296. package/dist/fns/aggregationFns.d.ts +21 -19
  297. package/dist/fns/aggregationFns.js +18 -18
  298. package/dist/fns/aggregationFns.js.map +1 -1
  299. package/dist/fns/filterFns.cjs +51 -65
  300. package/dist/fns/filterFns.cjs.map +1 -1
  301. package/dist/fns/filterFns.d.cts +82 -28
  302. package/dist/fns/filterFns.d.ts +82 -28
  303. package/dist/fns/filterFns.js +51 -65
  304. package/dist/fns/filterFns.js.map +1 -1
  305. package/dist/fns/sortFns.cjs +18 -6
  306. package/dist/fns/sortFns.cjs.map +1 -1
  307. package/dist/fns/sortFns.d.cts +15 -13
  308. package/dist/fns/sortFns.d.ts +15 -13
  309. package/dist/fns/sortFns.js +18 -6
  310. package/dist/fns/sortFns.js.map +1 -1
  311. package/dist/helpers/metaHelper.cjs +30 -0
  312. package/dist/helpers/metaHelper.cjs.map +1 -0
  313. package/dist/helpers/metaHelper.d.cts +26 -0
  314. package/dist/helpers/metaHelper.d.ts +26 -0
  315. package/dist/helpers/metaHelper.js +29 -0
  316. package/dist/helpers/metaHelper.js.map +1 -0
  317. package/dist/helpers/tableFeatures.cjs +31 -3
  318. package/dist/helpers/tableFeatures.cjs.map +1 -1
  319. package/dist/helpers/tableFeatures.d.cts +33 -5
  320. package/dist/helpers/tableFeatures.d.ts +33 -5
  321. package/dist/helpers/tableFeatures.js +31 -3
  322. package/dist/helpers/tableFeatures.js.map +1 -1
  323. package/dist/index.cjs +2 -20
  324. package/dist/index.d.cts +44 -43
  325. package/dist/index.d.ts +44 -43
  326. package/dist/index.js +22 -21
  327. package/dist/store-reactivity-bindings.cjs +1 -1
  328. package/dist/store-reactivity-bindings.cjs.map +1 -1
  329. package/dist/store-reactivity-bindings.d.cts +1 -1
  330. package/dist/store-reactivity-bindings.d.ts +1 -1
  331. package/dist/store-reactivity-bindings.js +1 -1
  332. package/dist/store-reactivity-bindings.js.map +1 -1
  333. package/dist/types/Cell.d.cts +8 -10
  334. package/dist/types/Cell.d.ts +8 -10
  335. package/dist/types/Column.d.cts +19 -12
  336. package/dist/types/Column.d.ts +19 -12
  337. package/dist/types/ColumnDef.d.cts +30 -11
  338. package/dist/types/ColumnDef.d.ts +30 -11
  339. package/dist/types/Header.d.cts +10 -11
  340. package/dist/types/Header.d.ts +10 -11
  341. package/dist/types/HeaderGroup.d.cts +4 -9
  342. package/dist/types/HeaderGroup.d.ts +4 -9
  343. package/dist/types/Row.d.cts +15 -11
  344. package/dist/types/Row.d.ts +15 -11
  345. package/dist/types/RowModel.d.cts +19 -19
  346. package/dist/types/RowModel.d.ts +19 -19
  347. package/dist/types/RowModelFns.d.cts +9 -9
  348. package/dist/types/RowModelFns.d.ts +9 -9
  349. package/dist/types/Table.d.cts +52 -24
  350. package/dist/types/Table.d.ts +52 -24
  351. package/dist/types/TableFeatures.d.cts +178 -41
  352. package/dist/types/TableFeatures.d.ts +178 -41
  353. package/dist/types/TableOptions.d.cts +31 -10
  354. package/dist/types/TableOptions.d.ts +31 -10
  355. package/dist/types/TableState.d.cts +22 -13
  356. package/dist/types/TableState.d.ts +22 -13
  357. package/dist/utils.cjs.map +1 -1
  358. package/dist/utils.d.cts +8 -3
  359. package/dist/utils.d.ts +8 -3
  360. package/dist/utils.js.map +1 -1
  361. package/package.json +1 -1
  362. package/skills/column-definitions/SKILL.md +3 -6
  363. package/skills/column-layout/SKILL.md +0 -2
  364. package/skills/customizing-feature-behavior/SKILL.md +63 -56
  365. package/skills/filtering/SKILL.md +60 -42
  366. package/skills/filtering/references/faceting-and-fuzzy.md +59 -32
  367. package/skills/grouping/SKILL.md +49 -54
  368. package/skills/migrate-v8-to-v9/SKILL.md +30 -33
  369. package/skills/pagination/SKILL.md +22 -20
  370. package/skills/row-expanding/SKILL.md +33 -25
  371. package/skills/row-pinning/SKILL.md +11 -7
  372. package/skills/row-selection/SKILL.md +0 -3
  373. package/skills/setup/SKILL.md +55 -65
  374. package/skills/sorting/SKILL.md +21 -21
  375. package/skills/state-management/SKILL.md +40 -25
  376. package/src/core/cells/coreCellsFeature.ts +17 -39
  377. package/src/core/cells/coreCellsFeature.types.ts +6 -6
  378. package/src/core/columns/coreColumnsFeature.ts +56 -83
  379. package/src/core/columns/coreColumnsFeature.types.ts +8 -8
  380. package/src/core/coreFeatures.ts +1 -1
  381. package/src/core/headers/buildHeaderGroups.ts +1 -1
  382. package/src/core/headers/coreHeadersFeature.ts +42 -64
  383. package/src/core/headers/coreHeadersFeature.types.ts +10 -10
  384. package/src/core/headers/coreHeadersFeature.utils.ts +1 -1
  385. package/src/core/row-models/coreRowModelsFeature.ts +43 -64
  386. package/src/core/row-models/coreRowModelsFeature.types.ts +7 -24
  387. package/src/core/row-models/coreRowModelsFeature.utils.ts +7 -7
  388. package/src/core/row-models/createCoreRowModel.ts +5 -4
  389. package/src/core/rows/coreRowsFeature.ts +45 -72
  390. package/src/core/rows/coreRowsFeature.types.ts +8 -8
  391. package/src/core/table/constructTable.ts +50 -13
  392. package/src/core/table/coreTablesFeature.ts +13 -35
  393. package/src/core/table/coreTablesFeature.types.ts +40 -17
  394. package/src/core/table/coreTablesFeature.utils.ts +10 -5
  395. package/src/features/column-faceting/columnFacetingFeature.ts +71 -102
  396. package/src/features/column-faceting/columnFacetingFeature.types.ts +11 -44
  397. package/src/features/column-faceting/columnFacetingFeature.utils.ts +6 -6
  398. package/src/features/column-faceting/createFacetedMinMaxValues.ts +1 -1
  399. package/src/features/column-faceting/createFacetedRowModel.ts +1 -1
  400. package/src/features/column-faceting/createFacetedUniqueValues.ts +1 -1
  401. package/src/features/column-filtering/columnFilteringFeature.ts +60 -103
  402. package/src/features/column-filtering/columnFilteringFeature.types.ts +55 -39
  403. package/src/features/column-filtering/columnFilteringFeature.utils.ts +2 -2
  404. package/src/features/column-filtering/createFilteredRowModel.ts +5 -7
  405. package/src/features/column-grouping/columnGroupingFeature.ts +82 -126
  406. package/src/features/column-grouping/columnGroupingFeature.types.ts +32 -31
  407. package/src/features/column-grouping/createGroupedRowModel.ts +7 -11
  408. package/src/features/column-ordering/columnOrderingFeature.ts +52 -84
  409. package/src/features/column-ordering/columnOrderingFeature.types.ts +2 -2
  410. package/src/features/column-pinning/columnPinningFeature.ts +268 -304
  411. package/src/features/column-pinning/columnPinningFeature.types.ts +4 -4
  412. package/src/features/column-pinning/columnPinningFeature.utils.ts +5 -5
  413. package/src/features/column-resizing/columnResizingFeature.ts +44 -78
  414. package/src/features/column-sizing/columnSizingFeature.ts +115 -152
  415. package/src/features/column-visibility/columnVisibilityFeature.ts +92 -129
  416. package/src/features/column-visibility/columnVisibilityFeature.types.ts +4 -4
  417. package/src/features/global-filtering/globalFilteringFeature.ts +45 -79
  418. package/src/features/global-filtering/globalFilteringFeature.types.ts +4 -4
  419. package/src/features/global-filtering/globalFilteringFeature.utils.ts +4 -2
  420. package/src/features/row-expanding/createExpandedRowModel.ts +1 -1
  421. package/src/features/row-expanding/rowExpandingFeature.ts +65 -101
  422. package/src/features/row-expanding/rowExpandingFeature.types.ts +8 -22
  423. package/src/features/row-pagination/createPaginatedRowModel.ts +1 -1
  424. package/src/features/row-pagination/rowPaginationFeature.ts +69 -103
  425. package/src/features/row-pagination/rowPaginationFeature.types.ts +6 -20
  426. package/src/features/row-pinning/rowPinningFeature.ts +72 -104
  427. package/src/features/row-pinning/rowPinningFeature.types.ts +4 -4
  428. package/src/features/row-selection/rowSelectionFeature.ts +103 -135
  429. package/src/features/row-selection/rowSelectionFeature.types.ts +4 -4
  430. package/src/features/row-selection/rowSelectionFeature.utils.ts +12 -7
  431. package/src/features/row-sorting/createSortedRowModel.ts +6 -6
  432. package/src/features/row-sorting/rowSortingFeature.ts +73 -114
  433. package/src/features/row-sorting/rowSortingFeature.types.ts +33 -32
  434. package/src/features/row-sorting/rowSortingFeature.utils.ts +8 -6
  435. package/src/fns/aggregationFns.ts +26 -42
  436. package/src/fns/filterFns.ts +231 -264
  437. package/src/fns/sortFns.ts +51 -29
  438. package/src/helpers/metaHelper.ts +24 -0
  439. package/src/helpers/tableFeatures.ts +36 -5
  440. package/src/index.ts +1 -0
  441. package/src/store-reactivity-bindings.ts +1 -1
  442. package/src/types/Cell.ts +10 -30
  443. package/src/types/Column.ts +21 -56
  444. package/src/types/ColumnDef.ts +48 -49
  445. package/src/types/Header.ts +10 -32
  446. package/src/types/HeaderGroup.ts +4 -15
  447. package/src/types/Row.ts +18 -39
  448. package/src/types/RowModel.ts +24 -114
  449. package/src/types/RowModelFns.ts +12 -31
  450. package/src/types/Table.ts +85 -80
  451. package/src/types/TableFeatures.ts +253 -108
  452. package/src/types/TableOptions.ts +70 -60
  453. package/src/types/TableState.ts +20 -73
  454. package/src/utils.ts +16 -6
@@ -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,11 +1,11 @@
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
8
- interface Row_CoreProperties<TFeatures extends TableFeatures, TData extends RowData> {
8
+ interface Row_CoreProperties<in out TFeatures extends TableFeatures, in out TData extends RowData> {
9
9
  _uniqueValuesCache: Record<string, unknown>;
10
10
  _valuesCache: Record<string, unknown>;
11
11
  /**
@@ -41,7 +41,7 @@ interface Row_CoreProperties<TFeatures extends TableFeatures, TData extends RowD
41
41
  */
42
42
  table: Table_Internal<TFeatures, TData>;
43
43
  }
44
- interface Row_Row<TFeatures extends TableFeatures, TData extends RowData> extends Row_CoreProperties<TFeatures, TData> {
44
+ interface Row_Row<in out TFeatures extends TableFeatures, in out TData extends RowData> extends Row_CoreProperties<TFeatures, TData> {
45
45
  /**
46
46
  * Builds a lookup of this row's cells keyed by leaf column id.
47
47
  */
@@ -75,7 +75,7 @@ interface Row_Row<TFeatures extends TableFeatures, TData extends RowData> extend
75
75
  */
76
76
  renderValue: <TValue>(columnId: string) => TValue;
77
77
  }
78
- interface TableOptions_Rows<TFeatures extends TableFeatures, TData extends RowData> {
78
+ interface TableOptions_Rows<in out TFeatures extends TableFeatures, in out TData extends RowData> {
79
79
  /**
80
80
  * This optional function is used to derive a unique ID for any given row. If not provided the rows index is used (nested rows join together with `.` using their grandparents' index eg. `index.index.index`). If you need to identify individual rows that are originating from any server-side operations, it's suggested you use this function to return an ID that makes sense regardless of network IO/ambiguity eg. a userId, taskId, database ID field, etc.
81
81
  * @example getRowId: row => row.userId
@@ -87,7 +87,7 @@ interface TableOptions_Rows<TFeatures extends TableFeatures, TData extends RowDa
87
87
  */
88
88
  getSubRows?: (originalRow: TData, index: number) => undefined | ReadonlyArray<TData>;
89
89
  }
90
- interface Table_Rows<TFeatures extends TableFeatures, TData extends RowData> {
90
+ interface Table_Rows<in out TFeatures extends TableFeatures, in out TData extends RowData> {
91
91
  getRowId: (_: TData, index: number, parent?: Row<TFeatures, TData>) => string;
92
92
  /**
93
93
  * Returns the row with the given ID.
@@ -1,11 +1,11 @@
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
8
- interface Row_CoreProperties<TFeatures extends TableFeatures, TData extends RowData> {
8
+ interface Row_CoreProperties<in out TFeatures extends TableFeatures, in out TData extends RowData> {
9
9
  _uniqueValuesCache: Record<string, unknown>;
10
10
  _valuesCache: Record<string, unknown>;
11
11
  /**
@@ -41,7 +41,7 @@ interface Row_CoreProperties<TFeatures extends TableFeatures, TData extends RowD
41
41
  */
42
42
  table: Table_Internal<TFeatures, TData>;
43
43
  }
44
- interface Row_Row<TFeatures extends TableFeatures, TData extends RowData> extends Row_CoreProperties<TFeatures, TData> {
44
+ interface Row_Row<in out TFeatures extends TableFeatures, in out TData extends RowData> extends Row_CoreProperties<TFeatures, TData> {
45
45
  /**
46
46
  * Builds a lookup of this row's cells keyed by leaf column id.
47
47
  */
@@ -75,7 +75,7 @@ interface Row_Row<TFeatures extends TableFeatures, TData extends RowData> extend
75
75
  */
76
76
  renderValue: <TValue>(columnId: string) => TValue;
77
77
  }
78
- interface TableOptions_Rows<TFeatures extends TableFeatures, TData extends RowData> {
78
+ interface TableOptions_Rows<in out TFeatures extends TableFeatures, in out TData extends RowData> {
79
79
  /**
80
80
  * This optional function is used to derive a unique ID for any given row. If not provided the rows index is used (nested rows join together with `.` using their grandparents' index eg. `index.index.index`). If you need to identify individual rows that are originating from any server-side operations, it's suggested you use this function to return an ID that makes sense regardless of network IO/ambiguity eg. a userId, taskId, database ID field, etc.
81
81
  * @example getRowId: row => row.userId
@@ -87,7 +87,7 @@ interface TableOptions_Rows<TFeatures extends TableFeatures, TData extends RowDa
87
87
  */
88
88
  getSubRows?: (originalRow: TData, index: number) => undefined | ReadonlyArray<TData>;
89
89
  }
90
- interface Table_Rows<TFeatures extends TableFeatures, TData extends RowData> {
90
+ interface Table_Rows<in out TFeatures extends TableFeatures, in out TData extends RowData> {
91
91
  getRowId: (_: TData, index: number, parent?: Row<TFeatures, TData>) => string;
92
92
  /**
93
93
  * Returns the row with the given ID.
@@ -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 as unknown as Table<TFeatures, TData>\n}\n"],"mappings":"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"}
@@ -1,8 +1,8 @@
1
1
  import { RowData } from "../../types/type-utils.cjs";
2
2
  import { TableState } from "../../types/TableState.cjs";
3
3
  import { TableOptions } from "../../types/TableOptions.cjs";
4
- import { TableFeatures } from "../../types/TableFeatures.cjs";
5
4
  import { Table } from "../../types/Table.cjs";
5
+ import { TableFeatures } from "../../types/TableFeatures.cjs";
6
6
 
7
7
  //#region src/core/table/constructTable.d.ts
8
8
  /**
@@ -1,8 +1,8 @@
1
1
  import { RowData } from "../../types/type-utils.js";
2
2
  import { TableState } from "../../types/TableState.js";
3
3
  import { TableOptions } from "../../types/TableOptions.js";
4
- import { TableFeatures } from "../../types/TableFeatures.js";
5
4
  import { Table } from "../../types/Table.js";
5
+ import { TableFeatures } from "../../types/TableFeatures.js";
6
6
 
7
7
  //#region src/core/table/constructTable.d.ts
8
8
  /**
@@ -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
  ...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.js","names":[],"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.js","names":[],"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 as unknown as Table<TFeatures, TData>\n}\n"],"mappings":"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"}
@@ -3,24 +3,15 @@ const require_coreTablesFeature_utils = require('./coreTablesFeature.utils.cjs')
3
3
 
4
4
  //#region src/core/table/coreTablesFeature.ts
5
5
  /**
6
- * Creates the stock core tables 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 adds base table instance APIs such as reset and setOptions.
9
7
  */
10
- function constructCoreTablesFeature() {
11
- return { constructTableAPIs: (table) => {
12
- require_utils.assignTableAPIs("coreTablesFeature", table, {
13
- table_reset: { fn: () => require_coreTablesFeature_utils.table_reset(table) },
14
- table_setOptions: { fn: (updater) => require_coreTablesFeature_utils.table_setOptions(table, updater) }
15
- });
16
- } };
17
- }
18
- /**
19
- * The Core Tables feature provides the core table functionality for handling state and options.
20
- */
21
- const coreTablesFeature = constructCoreTablesFeature();
8
+ const coreTablesFeature = { constructTableAPIs: (table) => {
9
+ require_utils.assignTableAPIs("coreTablesFeature", table, {
10
+ table_reset: { fn: () => require_coreTablesFeature_utils.table_reset(table) },
11
+ table_setOptions: { fn: (updater) => require_coreTablesFeature_utils.table_setOptions(table, updater) }
12
+ });
13
+ } };
22
14
 
23
15
  //#endregion
24
- exports.constructCoreTablesFeature = constructCoreTablesFeature;
25
16
  exports.coreTablesFeature = coreTablesFeature;
26
17
  //# sourceMappingURL=coreTablesFeature.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"coreTablesFeature.cjs","names":["table_reset","table_setOptions"],"sources":["../../../src/core/table/coreTablesFeature.ts"],"sourcesContent":["import { assignTableAPIs } from '../../utils'\nimport { table_reset, table_setOptions } from './coreTablesFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type { TableOptions_Table, Table_Table } from './coreTablesFeature.types'\n\nexport interface CoreTablesFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Table: Table_Table<TFeatures, TData>\n // TableOptions: TableOptions_Table<TFeatures, TData>\n}\n\n/**\n * Creates the stock core tables 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 constructCoreTablesFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<CoreTablesFeatureConstructors<TFeatures, TData>> {\n return {\n constructTableAPIs: (table) => {\n assignTableAPIs('coreTablesFeature', table, {\n table_reset: {\n fn: () => table_reset(table),\n },\n table_setOptions: {\n fn: (updater) => table_setOptions(table, updater),\n },\n })\n },\n }\n}\n\n/**\n * The Core Tables feature provides the core table functionality for handling state and options.\n */\nexport const coreTablesFeature = constructCoreTablesFeature()\n"],"mappings":";;;;;;;;;AAmBA,SAAgB,6BAGmD;CACjE,OAAO,EACL,qBAAqB,UAAU;EAC7B,8BAAgB,qBAAqB,OAAO;GAC1C,aAAa,EACX,UAAUA,4CAAY,KAAK,EAC7B;GACA,kBAAkB,EAChB,KAAK,YAAYC,iDAAiB,OAAO,OAAO,EAClD;EACF,CAAC;CACH,EACF;AACF;;;;AAKA,MAAa,oBAAoB,2BAA2B"}
1
+ {"version":3,"file":"coreTablesFeature.cjs","names":["table_reset","table_setOptions"],"sources":["../../../src/core/table/coreTablesFeature.ts"],"sourcesContent":["import { assignTableAPIs } from '../../utils'\nimport { table_reset, table_setOptions } from './coreTablesFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that adds base table instance APIs such as reset and setOptions.\n */\nexport const coreTablesFeature: TableFeature = {\n constructTableAPIs: (table) => {\n assignTableAPIs('coreTablesFeature', table, {\n table_reset: {\n fn: () => table_reset(table),\n },\n table_setOptions: {\n fn: (updater) => table_setOptions(table, updater),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAOA,MAAa,oBAAkC,EAC7C,qBAAqB,UAAU;CAC7B,8BAAgB,qBAAqB,OAAO;EAC1C,aAAa,EACX,UAAUA,4CAAY,KAAK,EAC7B;EACA,kBAAkB,EAChB,KAAK,YAAYC,iDAAiB,OAAO,OAAO,EAClD;CACF,CAAC;AACH,EACF"}
@@ -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/table/coreTablesFeature.d.ts
5
- interface CoreTablesFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
6
4
  /**
7
- * Creates the stock core tables 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 adds base table instance APIs such as reset and setOptions.
10
6
  */
11
- declare function constructCoreTablesFeature<TFeatures extends TableFeatures, TData extends RowData>(): TableFeature<CoreTablesFeatureConstructors<TFeatures, TData>>;
12
- /**
13
- * The Core Tables feature provides the core table functionality for handling state and options.
14
- */
15
- declare const coreTablesFeature: TableFeature<CoreTablesFeatureConstructors<TableFeatures, RowData>>;
7
+ declare const coreTablesFeature: TableFeature;
16
8
  //#endregion
17
- export { CoreTablesFeatureConstructors, constructCoreTablesFeature, coreTablesFeature };
9
+ export { coreTablesFeature };
18
10
  //# sourceMappingURL=coreTablesFeature.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/table/coreTablesFeature.d.ts
5
- interface CoreTablesFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
6
4
  /**
7
- * Creates the stock core tables 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 adds base table instance APIs such as reset and setOptions.
10
6
  */
11
- declare function constructCoreTablesFeature<TFeatures extends TableFeatures, TData extends RowData>(): TableFeature<CoreTablesFeatureConstructors<TFeatures, TData>>;
12
- /**
13
- * The Core Tables feature provides the core table functionality for handling state and options.
14
- */
15
- declare const coreTablesFeature: TableFeature<CoreTablesFeatureConstructors<TableFeatures, RowData>>;
7
+ declare const coreTablesFeature: TableFeature;
16
8
  //#endregion
17
- export { CoreTablesFeatureConstructors, constructCoreTablesFeature, coreTablesFeature };
9
+ export { coreTablesFeature };
18
10
  //# sourceMappingURL=coreTablesFeature.d.ts.map
@@ -3,23 +3,15 @@ import { table_reset, table_setOptions } from "./coreTablesFeature.utils.js";
3
3
 
4
4
  //#region src/core/table/coreTablesFeature.ts
5
5
  /**
6
- * Creates the stock core tables 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 adds base table instance APIs such as reset and setOptions.
9
7
  */
10
- function constructCoreTablesFeature() {
11
- return { constructTableAPIs: (table) => {
12
- assignTableAPIs("coreTablesFeature", table, {
13
- table_reset: { fn: () => table_reset(table) },
14
- table_setOptions: { fn: (updater) => table_setOptions(table, updater) }
15
- });
16
- } };
17
- }
18
- /**
19
- * The Core Tables feature provides the core table functionality for handling state and options.
20
- */
21
- const coreTablesFeature = constructCoreTablesFeature();
8
+ const coreTablesFeature = { constructTableAPIs: (table) => {
9
+ assignTableAPIs("coreTablesFeature", table, {
10
+ table_reset: { fn: () => table_reset(table) },
11
+ table_setOptions: { fn: (updater) => table_setOptions(table, updater) }
12
+ });
13
+ } };
22
14
 
23
15
  //#endregion
24
- export { constructCoreTablesFeature, coreTablesFeature };
16
+ export { coreTablesFeature };
25
17
  //# sourceMappingURL=coreTablesFeature.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"coreTablesFeature.js","names":[],"sources":["../../../src/core/table/coreTablesFeature.ts"],"sourcesContent":["import { assignTableAPIs } from '../../utils'\nimport { table_reset, table_setOptions } from './coreTablesFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type { TableOptions_Table, Table_Table } from './coreTablesFeature.types'\n\nexport interface CoreTablesFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Table: Table_Table<TFeatures, TData>\n // TableOptions: TableOptions_Table<TFeatures, TData>\n}\n\n/**\n * Creates the stock core tables 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 constructCoreTablesFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<CoreTablesFeatureConstructors<TFeatures, TData>> {\n return {\n constructTableAPIs: (table) => {\n assignTableAPIs('coreTablesFeature', table, {\n table_reset: {\n fn: () => table_reset(table),\n },\n table_setOptions: {\n fn: (updater) => table_setOptions(table, updater),\n },\n })\n },\n }\n}\n\n/**\n * The Core Tables feature provides the core table functionality for handling state and options.\n */\nexport const coreTablesFeature = constructCoreTablesFeature()\n"],"mappings":";;;;;;;;;AAmBA,SAAgB,6BAGmD;CACjE,OAAO,EACL,qBAAqB,UAAU;EAC7B,gBAAgB,qBAAqB,OAAO;GAC1C,aAAa,EACX,UAAU,YAAY,KAAK,EAC7B;GACA,kBAAkB,EAChB,KAAK,YAAY,iBAAiB,OAAO,OAAO,EAClD;EACF,CAAC;CACH,EACF;AACF;;;;AAKA,MAAa,oBAAoB,2BAA2B"}
1
+ {"version":3,"file":"coreTablesFeature.js","names":[],"sources":["../../../src/core/table/coreTablesFeature.ts"],"sourcesContent":["import { assignTableAPIs } from '../../utils'\nimport { table_reset, table_setOptions } from './coreTablesFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Core feature that adds base table instance APIs such as reset and setOptions.\n */\nexport const coreTablesFeature: TableFeature = {\n constructTableAPIs: (table) => {\n assignTableAPIs('coreTablesFeature', table, {\n table_reset: {\n fn: () => table_reset(table),\n },\n table_setOptions: {\n fn: (updater) => table_setOptions(table, updater),\n },\n })\n },\n}\n"],"mappings":";;;;;;;AAOA,MAAa,oBAAkC,EAC7C,qBAAqB,UAAU;CAC7B,gBAAgB,qBAAqB,OAAO;EAC1C,aAAa,EACX,UAAU,YAAY,KAAK,EAC7B;EACA,kBAAkB,EAChB,KAAK,YAAY,iBAAiB,OAAO,OAAO,EAClD;CACF,CAAC;AACH,EACF"}