@tanstack/table-core 9.0.0-beta.2 → 9.0.0-beta.20

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 (524) hide show
  1. package/dist/core/cells/constructCell.d.cts +3 -3
  2. package/dist/core/cells/constructCell.d.ts +3 -3
  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 +6 -6
  10. package/dist/core/cells/coreCellsFeature.types.d.ts +6 -6
  11. package/dist/core/cells/coreCellsFeature.utils.d.cts +3 -3
  12. package/dist/core/cells/coreCellsFeature.utils.d.ts +3 -3
  13. package/dist/core/columns/constructColumn.cjs +5 -0
  14. package/dist/core/columns/constructColumn.cjs.map +1 -1
  15. package/dist/core/columns/constructColumn.d.cts +3 -3
  16. package/dist/core/columns/constructColumn.d.ts +3 -3
  17. package/dist/core/columns/constructColumn.js +5 -0
  18. package/dist/core/columns/constructColumn.js.map +1 -1
  19. package/dist/core/columns/coreColumnsFeature.cjs +59 -68
  20. package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
  21. package/dist/core/columns/coreColumnsFeature.d.cts +4 -12
  22. package/dist/core/columns/coreColumnsFeature.d.ts +4 -12
  23. package/dist/core/columns/coreColumnsFeature.js +60 -68
  24. package/dist/core/columns/coreColumnsFeature.js.map +1 -1
  25. package/dist/core/columns/coreColumnsFeature.types.d.cts +7 -7
  26. package/dist/core/columns/coreColumnsFeature.types.d.ts +7 -7
  27. package/dist/core/columns/coreColumnsFeature.utils.cjs +2 -2
  28. package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
  29. package/dist/core/columns/coreColumnsFeature.utils.d.cts +9 -9
  30. package/dist/core/columns/coreColumnsFeature.utils.d.ts +9 -9
  31. package/dist/core/columns/coreColumnsFeature.utils.js +3 -3
  32. package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
  33. package/dist/core/coreFeatures.cjs.map +1 -1
  34. package/dist/core/coreFeatures.d.cts +1 -1
  35. package/dist/core/coreFeatures.d.ts +1 -1
  36. package/dist/core/coreFeatures.js.map +1 -1
  37. package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
  38. package/dist/core/headers/buildHeaderGroups.d.cts +2 -2
  39. package/dist/core/headers/buildHeaderGroups.d.ts +2 -2
  40. package/dist/core/headers/buildHeaderGroups.js.map +1 -1
  41. package/dist/core/headers/constructHeader.d.cts +2 -2
  42. package/dist/core/headers/constructHeader.d.ts +2 -2
  43. package/dist/core/headers/coreHeadersFeature.cjs +44 -53
  44. package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
  45. package/dist/core/headers/coreHeadersFeature.d.cts +4 -12
  46. package/dist/core/headers/coreHeadersFeature.d.ts +4 -12
  47. package/dist/core/headers/coreHeadersFeature.js +45 -53
  48. package/dist/core/headers/coreHeadersFeature.js.map +1 -1
  49. package/dist/core/headers/coreHeadersFeature.types.d.cts +6 -6
  50. package/dist/core/headers/coreHeadersFeature.types.d.ts +6 -6
  51. package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
  52. package/dist/core/headers/coreHeadersFeature.utils.d.cts +6 -6
  53. package/dist/core/headers/coreHeadersFeature.utils.d.ts +6 -6
  54. package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
  55. package/dist/core/row-models/coreRowModelsFeature.cjs +17 -26
  56. package/dist/core/row-models/coreRowModelsFeature.cjs.map +1 -1
  57. package/dist/core/row-models/coreRowModelsFeature.d.cts +4 -12
  58. package/dist/core/row-models/coreRowModelsFeature.d.ts +4 -12
  59. package/dist/core/row-models/coreRowModelsFeature.js +18 -26
  60. package/dist/core/row-models/coreRowModelsFeature.js.map +1 -1
  61. package/dist/core/row-models/coreRowModelsFeature.types.d.cts +6 -16
  62. package/dist/core/row-models/coreRowModelsFeature.types.d.ts +6 -16
  63. package/dist/core/row-models/coreRowModelsFeature.utils.cjs +13 -13
  64. package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
  65. package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +14 -14
  66. package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +14 -14
  67. package/dist/core/row-models/coreRowModelsFeature.utils.js +13 -13
  68. package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
  69. package/dist/core/row-models/createCoreRowModel.cjs +2 -3
  70. package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
  71. package/dist/core/row-models/createCoreRowModel.d.cts +1 -1
  72. package/dist/core/row-models/createCoreRowModel.d.ts +1 -1
  73. package/dist/core/row-models/createCoreRowModel.js +3 -4
  74. package/dist/core/row-models/createCoreRowModel.js.map +1 -1
  75. package/dist/core/rows/constructRow.cjs +3 -2
  76. package/dist/core/rows/constructRow.cjs.map +1 -1
  77. package/dist/core/rows/constructRow.d.cts +2 -2
  78. package/dist/core/rows/constructRow.d.ts +2 -2
  79. package/dist/core/rows/constructRow.js +4 -2
  80. package/dist/core/rows/constructRow.js.map +1 -1
  81. package/dist/core/rows/coreRowsFeature.cjs +27 -36
  82. package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
  83. package/dist/core/rows/coreRowsFeature.d.cts +4 -12
  84. package/dist/core/rows/coreRowsFeature.d.ts +4 -12
  85. package/dist/core/rows/coreRowsFeature.js +28 -36
  86. package/dist/core/rows/coreRowsFeature.js.map +1 -1
  87. package/dist/core/rows/coreRowsFeature.types.d.cts +6 -6
  88. package/dist/core/rows/coreRowsFeature.types.d.ts +6 -6
  89. package/dist/core/rows/coreRowsFeature.utils.cjs +3 -3
  90. package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
  91. package/dist/core/rows/coreRowsFeature.utils.d.cts +3 -3
  92. package/dist/core/rows/coreRowsFeature.utils.d.ts +3 -3
  93. package/dist/core/rows/coreRowsFeature.utils.js +4 -4
  94. package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
  95. package/dist/core/table/constructTable.cjs +21 -6
  96. package/dist/core/table/constructTable.cjs.map +1 -1
  97. package/dist/core/table/constructTable.d.cts +1 -1
  98. package/dist/core/table/constructTable.d.ts +1 -1
  99. package/dist/core/table/constructTable.js +21 -6
  100. package/dist/core/table/constructTable.js.map +1 -1
  101. package/dist/core/table/coreTablesFeature.cjs +7 -16
  102. package/dist/core/table/coreTablesFeature.cjs.map +1 -1
  103. package/dist/core/table/coreTablesFeature.d.cts +4 -12
  104. package/dist/core/table/coreTablesFeature.d.ts +4 -12
  105. package/dist/core/table/coreTablesFeature.js +8 -16
  106. package/dist/core/table/coreTablesFeature.js.map +1 -1
  107. package/dist/core/table/coreTablesFeature.types.d.cts +28 -16
  108. package/dist/core/table/coreTablesFeature.types.d.ts +28 -16
  109. package/dist/core/table/coreTablesFeature.utils.cjs +33 -12
  110. package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
  111. package/dist/core/table/coreTablesFeature.utils.d.cts +8 -6
  112. package/dist/core/table/coreTablesFeature.utils.d.ts +8 -6
  113. package/dist/core/table/coreTablesFeature.utils.js +33 -12
  114. package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
  115. package/dist/features/column-faceting/columnFacetingFeature.cjs +49 -61
  116. package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
  117. package/dist/features/column-faceting/columnFacetingFeature.d.cts +4 -15
  118. package/dist/features/column-faceting/columnFacetingFeature.d.ts +4 -15
  119. package/dist/features/column-faceting/columnFacetingFeature.js +50 -61
  120. package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
  121. package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +8 -29
  122. package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +8 -29
  123. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +12 -12
  124. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
  125. package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +8 -8
  126. package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +8 -8
  127. package/dist/features/column-faceting/columnFacetingFeature.utils.js +12 -12
  128. package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
  129. package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
  130. package/dist/features/column-faceting/createFacetedMinMaxValues.d.cts +1 -1
  131. package/dist/features/column-faceting/createFacetedMinMaxValues.d.ts +1 -1
  132. package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
  133. package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
  134. package/dist/features/column-faceting/createFacetedRowModel.d.cts +1 -1
  135. package/dist/features/column-faceting/createFacetedRowModel.d.ts +1 -1
  136. package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
  137. package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
  138. package/dist/features/column-faceting/createFacetedUniqueValues.d.cts +1 -1
  139. package/dist/features/column-faceting/createFacetedUniqueValues.d.ts +1 -1
  140. package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
  141. package/dist/features/column-filtering/columnFilteringFeature.cjs +40 -53
  142. package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -1
  143. package/dist/features/column-filtering/columnFilteringFeature.d.cts +4 -16
  144. package/dist/features/column-filtering/columnFilteringFeature.d.ts +4 -16
  145. package/dist/features/column-filtering/columnFilteringFeature.js +42 -54
  146. package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -1
  147. package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +40 -26
  148. package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +40 -26
  149. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +1 -1
  150. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
  151. package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +12 -12
  152. package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +12 -12
  153. package/dist/features/column-filtering/columnFilteringFeature.utils.js +1 -1
  154. package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
  155. package/dist/features/column-filtering/createFilteredRowModel.cjs +12 -7
  156. package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
  157. package/dist/features/column-filtering/createFilteredRowModel.d.cts +5 -3
  158. package/dist/features/column-filtering/createFilteredRowModel.d.ts +5 -3
  159. package/dist/features/column-filtering/createFilteredRowModel.js +13 -8
  160. package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
  161. package/dist/features/column-filtering/filterRowsUtils.cjs +3 -2
  162. package/dist/features/column-filtering/filterRowsUtils.cjs.map +1 -1
  163. package/dist/features/column-filtering/filterRowsUtils.js +3 -2
  164. package/dist/features/column-filtering/filterRowsUtils.js.map +1 -1
  165. package/dist/features/column-grouping/columnGroupingFeature.cjs +57 -69
  166. package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
  167. package/dist/features/column-grouping/columnGroupingFeature.d.cts +4 -15
  168. package/dist/features/column-grouping/columnGroupingFeature.d.ts +4 -15
  169. package/dist/features/column-grouping/columnGroupingFeature.js +59 -70
  170. package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
  171. package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +23 -19
  172. package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +23 -19
  173. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +3 -3
  174. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
  175. package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +11 -11
  176. package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +11 -11
  177. package/dist/features/column-grouping/columnGroupingFeature.utils.js +4 -4
  178. package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
  179. package/dist/features/column-grouping/createGroupedRowModel.cjs +9 -7
  180. package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
  181. package/dist/features/column-grouping/createGroupedRowModel.d.cts +6 -3
  182. package/dist/features/column-grouping/createGroupedRowModel.d.ts +6 -3
  183. package/dist/features/column-grouping/createGroupedRowModel.js +10 -8
  184. package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
  185. package/dist/features/column-ordering/columnOrderingFeature.cjs +47 -59
  186. package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
  187. package/dist/features/column-ordering/columnOrderingFeature.d.cts +4 -15
  188. package/dist/features/column-ordering/columnOrderingFeature.d.ts +4 -15
  189. package/dist/features/column-ordering/columnOrderingFeature.js +48 -59
  190. package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
  191. package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +1 -1
  192. package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +1 -1
  193. package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +9 -9
  194. package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +9 -9
  195. package/dist/features/column-pinning/columnPinningFeature.cjs +209 -221
  196. package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
  197. package/dist/features/column-pinning/columnPinningFeature.d.cts +4 -15
  198. package/dist/features/column-pinning/columnPinningFeature.d.ts +4 -15
  199. package/dist/features/column-pinning/columnPinningFeature.js +210 -221
  200. package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
  201. package/dist/features/column-pinning/columnPinningFeature.types.d.cts +2 -2
  202. package/dist/features/column-pinning/columnPinningFeature.types.d.ts +2 -2
  203. package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
  204. package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +31 -30
  205. package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +31 -30
  206. package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
  207. package/dist/features/column-resizing/columnResizingFeature.cjs +31 -43
  208. package/dist/features/column-resizing/columnResizingFeature.cjs.map +1 -1
  209. package/dist/features/column-resizing/columnResizingFeature.d.cts +4 -15
  210. package/dist/features/column-resizing/columnResizingFeature.d.ts +4 -15
  211. package/dist/features/column-resizing/columnResizingFeature.js +32 -43
  212. package/dist/features/column-resizing/columnResizingFeature.js.map +1 -1
  213. package/dist/features/column-resizing/columnResizingFeature.types.d.cts +1 -4
  214. package/dist/features/column-resizing/columnResizingFeature.types.d.ts +1 -4
  215. package/dist/features/column-resizing/columnResizingFeature.utils.cjs +2 -5
  216. package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
  217. package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +6 -6
  218. package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +6 -6
  219. package/dist/features/column-resizing/columnResizingFeature.utils.js +3 -6
  220. package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
  221. package/dist/features/column-sizing/columnSizingFeature.cjs +112 -125
  222. package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
  223. package/dist/features/column-sizing/columnSizingFeature.d.cts +4 -16
  224. package/dist/features/column-sizing/columnSizingFeature.d.ts +4 -16
  225. package/dist/features/column-sizing/columnSizingFeature.js +113 -125
  226. package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
  227. package/dist/features/column-sizing/columnSizingFeature.utils.cjs +11 -4
  228. package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
  229. package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +12 -12
  230. package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +12 -12
  231. package/dist/features/column-sizing/columnSizingFeature.utils.js +12 -5
  232. package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
  233. package/dist/features/column-visibility/columnVisibilityFeature.cjs +83 -95
  234. package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
  235. package/dist/features/column-visibility/columnVisibilityFeature.d.cts +4 -15
  236. package/dist/features/column-visibility/columnVisibilityFeature.d.ts +4 -15
  237. package/dist/features/column-visibility/columnVisibilityFeature.js +84 -95
  238. package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
  239. package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +2 -2
  240. package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +2 -2
  241. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +12 -9
  242. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
  243. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +14 -14
  244. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +14 -14
  245. package/dist/features/column-visibility/columnVisibilityFeature.utils.js +13 -10
  246. package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
  247. package/dist/features/global-filtering/globalFilteringFeature.cjs +31 -43
  248. package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
  249. package/dist/features/global-filtering/globalFilteringFeature.d.cts +4 -15
  250. package/dist/features/global-filtering/globalFilteringFeature.d.ts +4 -15
  251. package/dist/features/global-filtering/globalFilteringFeature.js +32 -43
  252. package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
  253. package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +2 -2
  254. package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +2 -2
  255. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
  256. package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +10 -8
  257. package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +10 -8
  258. package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
  259. package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
  260. package/dist/features/row-expanding/createExpandedRowModel.d.cts +1 -1
  261. package/dist/features/row-expanding/createExpandedRowModel.d.ts +1 -1
  262. package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
  263. package/dist/features/row-expanding/rowExpandingFeature.cjs +37 -49
  264. package/dist/features/row-expanding/rowExpandingFeature.cjs.map +1 -1
  265. package/dist/features/row-expanding/rowExpandingFeature.d.cts +4 -15
  266. package/dist/features/row-expanding/rowExpandingFeature.d.ts +4 -15
  267. package/dist/features/row-expanding/rowExpandingFeature.js +38 -49
  268. package/dist/features/row-expanding/rowExpandingFeature.js.map +1 -1
  269. package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +5 -14
  270. package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +5 -14
  271. package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +21 -12
  272. package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
  273. package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +10 -10
  274. package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +10 -10
  275. package/dist/features/row-expanding/rowExpandingFeature.utils.js +22 -13
  276. package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
  277. package/dist/features/row-pagination/createPaginatedRowModel.cjs +1 -1
  278. package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
  279. package/dist/features/row-pagination/createPaginatedRowModel.d.cts +1 -1
  280. package/dist/features/row-pagination/createPaginatedRowModel.d.ts +1 -1
  281. package/dist/features/row-pagination/createPaginatedRowModel.js +1 -1
  282. package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
  283. package/dist/features/row-pagination/rowPaginationFeature.cjs +35 -47
  284. package/dist/features/row-pagination/rowPaginationFeature.cjs.map +1 -1
  285. package/dist/features/row-pagination/rowPaginationFeature.d.cts +4 -15
  286. package/dist/features/row-pagination/rowPaginationFeature.d.ts +4 -15
  287. package/dist/features/row-pagination/rowPaginationFeature.js +36 -47
  288. package/dist/features/row-pagination/rowPaginationFeature.js.map +1 -1
  289. package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +4 -13
  290. package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +4 -13
  291. package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +17 -17
  292. package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +17 -17
  293. package/dist/features/row-pinning/rowPinningFeature.cjs +55 -67
  294. package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
  295. package/dist/features/row-pinning/rowPinningFeature.d.cts +4 -15
  296. package/dist/features/row-pinning/rowPinningFeature.d.ts +4 -15
  297. package/dist/features/row-pinning/rowPinningFeature.js +56 -67
  298. package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
  299. package/dist/features/row-pinning/rowPinningFeature.types.d.cts +2 -2
  300. package/dist/features/row-pinning/rowPinningFeature.types.d.ts +2 -2
  301. package/dist/features/row-pinning/rowPinningFeature.utils.cjs +2 -2
  302. package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
  303. package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +7 -7
  304. package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +7 -7
  305. package/dist/features/row-pinning/rowPinningFeature.utils.js +2 -2
  306. package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
  307. package/dist/features/row-selection/rowSelectionFeature.cjs +108 -77
  308. package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
  309. package/dist/features/row-selection/rowSelectionFeature.d.cts +4 -15
  310. package/dist/features/row-selection/rowSelectionFeature.d.ts +4 -15
  311. package/dist/features/row-selection/rowSelectionFeature.js +110 -78
  312. package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
  313. package/dist/features/row-selection/rowSelectionFeature.types.d.cts +13 -5
  314. package/dist/features/row-selection/rowSelectionFeature.types.d.ts +13 -5
  315. package/dist/features/row-selection/rowSelectionFeature.utils.cjs +76 -60
  316. package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
  317. package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +48 -23
  318. package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +48 -23
  319. package/dist/features/row-selection/rowSelectionFeature.utils.js +77 -62
  320. package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
  321. package/dist/features/row-sorting/createSortedRowModel.cjs +5 -3
  322. package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
  323. package/dist/features/row-sorting/createSortedRowModel.d.cts +5 -3
  324. package/dist/features/row-sorting/createSortedRowModel.d.ts +5 -3
  325. package/dist/features/row-sorting/createSortedRowModel.js +6 -4
  326. package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
  327. package/dist/features/row-sorting/rowSortingFeature.cjs +45 -57
  328. package/dist/features/row-sorting/rowSortingFeature.cjs.map +1 -1
  329. package/dist/features/row-sorting/rowSortingFeature.d.cts +4 -15
  330. package/dist/features/row-sorting/rowSortingFeature.d.ts +4 -15
  331. package/dist/features/row-sorting/rowSortingFeature.js +46 -57
  332. package/dist/features/row-sorting/rowSortingFeature.js.map +1 -1
  333. package/dist/features/row-sorting/rowSortingFeature.types.d.cts +24 -21
  334. package/dist/features/row-sorting/rowSortingFeature.types.d.ts +24 -21
  335. package/dist/features/row-sorting/rowSortingFeature.utils.cjs +8 -5
  336. package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
  337. package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +16 -16
  338. package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +16 -16
  339. package/dist/features/row-sorting/rowSortingFeature.utils.js +8 -5
  340. package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
  341. package/dist/fns/aggregationFns.cjs +18 -18
  342. package/dist/fns/aggregationFns.cjs.map +1 -1
  343. package/dist/fns/aggregationFns.d.cts +21 -19
  344. package/dist/fns/aggregationFns.d.ts +21 -19
  345. package/dist/fns/aggregationFns.js +18 -18
  346. package/dist/fns/aggregationFns.js.map +1 -1
  347. package/dist/fns/filterFns.cjs +51 -65
  348. package/dist/fns/filterFns.cjs.map +1 -1
  349. package/dist/fns/filterFns.d.cts +82 -28
  350. package/dist/fns/filterFns.d.ts +82 -28
  351. package/dist/fns/filterFns.js +51 -65
  352. package/dist/fns/filterFns.js.map +1 -1
  353. package/dist/fns/sortFns.cjs +18 -6
  354. package/dist/fns/sortFns.cjs.map +1 -1
  355. package/dist/fns/sortFns.d.cts +15 -13
  356. package/dist/fns/sortFns.d.ts +15 -13
  357. package/dist/fns/sortFns.js +18 -6
  358. package/dist/fns/sortFns.js.map +1 -1
  359. package/dist/helpers/columnHelper.cjs.map +1 -1
  360. package/dist/helpers/columnHelper.d.cts +2 -2
  361. package/dist/helpers/columnHelper.d.ts +2 -2
  362. package/dist/helpers/columnHelper.js.map +1 -1
  363. package/dist/helpers/metaHelper.cjs +30 -0
  364. package/dist/helpers/metaHelper.cjs.map +1 -0
  365. package/dist/helpers/metaHelper.d.cts +26 -0
  366. package/dist/helpers/metaHelper.d.ts +26 -0
  367. package/dist/helpers/metaHelper.js +29 -0
  368. package/dist/helpers/metaHelper.js.map +1 -0
  369. package/dist/helpers/tableFeatures.cjs +31 -3
  370. package/dist/helpers/tableFeatures.cjs.map +1 -1
  371. package/dist/helpers/tableFeatures.d.cts +33 -5
  372. package/dist/helpers/tableFeatures.d.ts +33 -5
  373. package/dist/helpers/tableFeatures.js +31 -3
  374. package/dist/helpers/tableFeatures.js.map +1 -1
  375. package/dist/index.cjs +4 -20
  376. package/dist/index.d.cts +50 -49
  377. package/dist/index.d.ts +50 -49
  378. package/dist/index.js +23 -22
  379. package/dist/static-functions.cjs +1 -0
  380. package/dist/static-functions.d.cts +2 -2
  381. package/dist/static-functions.d.ts +2 -2
  382. package/dist/static-functions.js +2 -2
  383. package/dist/store-reactivity-bindings.cjs +1 -1
  384. package/dist/store-reactivity-bindings.cjs.map +1 -1
  385. package/dist/store-reactivity-bindings.d.cts +1 -1
  386. package/dist/store-reactivity-bindings.d.ts +1 -1
  387. package/dist/store-reactivity-bindings.js +1 -1
  388. package/dist/store-reactivity-bindings.js.map +1 -1
  389. package/dist/types/Cell.d.cts +4 -9
  390. package/dist/types/Cell.d.ts +4 -9
  391. package/dist/types/Column.d.cts +11 -18
  392. package/dist/types/Column.d.ts +11 -18
  393. package/dist/types/ColumnDef.d.cts +23 -14
  394. package/dist/types/ColumnDef.d.ts +23 -14
  395. package/dist/types/Header.d.cts +5 -10
  396. package/dist/types/Header.d.ts +5 -10
  397. package/dist/types/HeaderGroup.d.cts +4 -9
  398. package/dist/types/HeaderGroup.d.ts +4 -9
  399. package/dist/types/Row.d.cts +7 -12
  400. package/dist/types/Row.d.ts +7 -12
  401. package/dist/types/RowModel.d.cts +12 -28
  402. package/dist/types/RowModel.d.ts +12 -28
  403. package/dist/types/RowModelFns.d.cts +6 -11
  404. package/dist/types/RowModelFns.d.ts +6 -11
  405. package/dist/types/Table.d.cts +26 -36
  406. package/dist/types/Table.d.ts +26 -36
  407. package/dist/types/TableFeatures.d.cts +328 -54
  408. package/dist/types/TableFeatures.d.ts +328 -54
  409. package/dist/types/TableOptions.d.cts +22 -17
  410. package/dist/types/TableOptions.d.ts +22 -17
  411. package/dist/types/TableState.d.cts +11 -16
  412. package/dist/types/TableState.d.ts +11 -16
  413. package/dist/utils.cjs +24 -2
  414. package/dist/utils.cjs.map +1 -1
  415. package/dist/utils.d.cts +23 -7
  416. package/dist/utils.d.ts +23 -7
  417. package/dist/utils.js +23 -3
  418. package/dist/utils.js.map +1 -1
  419. package/package.json +2 -2
  420. package/skills/column-definitions/SKILL.md +3 -6
  421. package/skills/column-layout/SKILL.md +0 -2
  422. package/skills/customizing-feature-behavior/SKILL.md +63 -56
  423. package/skills/filtering/SKILL.md +60 -42
  424. package/skills/filtering/references/faceting-and-fuzzy.md +59 -32
  425. package/skills/grouping/SKILL.md +49 -54
  426. package/skills/migrate-v8-to-v9/SKILL.md +30 -33
  427. package/skills/pagination/SKILL.md +22 -20
  428. package/skills/row-expanding/SKILL.md +33 -25
  429. package/skills/row-pinning/SKILL.md +11 -7
  430. package/skills/row-selection/SKILL.md +0 -3
  431. package/skills/setup/SKILL.md +55 -65
  432. package/skills/sorting/SKILL.md +21 -21
  433. package/skills/state-management/SKILL.md +40 -25
  434. package/src/core/cells/coreCellsFeature.ts +17 -39
  435. package/src/core/cells/coreCellsFeature.types.ts +6 -6
  436. package/src/core/columns/constructColumn.ts +6 -0
  437. package/src/core/columns/coreColumnsFeature.ts +56 -83
  438. package/src/core/columns/coreColumnsFeature.types.ts +8 -8
  439. package/src/core/columns/coreColumnsFeature.utils.ts +4 -4
  440. package/src/core/coreFeatures.ts +1 -1
  441. package/src/core/headers/buildHeaderGroups.ts +4 -2
  442. package/src/core/headers/coreHeadersFeature.ts +42 -64
  443. package/src/core/headers/coreHeadersFeature.types.ts +12 -12
  444. package/src/core/headers/coreHeadersFeature.utils.ts +1 -1
  445. package/src/core/row-models/coreRowModelsFeature.ts +43 -64
  446. package/src/core/row-models/coreRowModelsFeature.types.ts +7 -24
  447. package/src/core/row-models/coreRowModelsFeature.utils.ts +7 -7
  448. package/src/core/row-models/createCoreRowModel.ts +7 -6
  449. package/src/core/rows/constructRow.ts +3 -2
  450. package/src/core/rows/coreRowsFeature.ts +45 -72
  451. package/src/core/rows/coreRowsFeature.types.ts +8 -8
  452. package/src/core/rows/coreRowsFeature.utils.ts +4 -4
  453. package/src/core/table/constructTable.ts +50 -13
  454. package/src/core/table/coreTablesFeature.ts +13 -35
  455. package/src/core/table/coreTablesFeature.types.ts +40 -17
  456. package/src/core/table/coreTablesFeature.utils.ts +52 -18
  457. package/src/features/column-faceting/columnFacetingFeature.ts +71 -102
  458. package/src/features/column-faceting/columnFacetingFeature.types.ts +11 -44
  459. package/src/features/column-faceting/columnFacetingFeature.utils.ts +6 -6
  460. package/src/features/column-faceting/createFacetedMinMaxValues.ts +1 -1
  461. package/src/features/column-faceting/createFacetedRowModel.ts +1 -1
  462. package/src/features/column-faceting/createFacetedUniqueValues.ts +1 -1
  463. package/src/features/column-filtering/columnFilteringFeature.ts +61 -103
  464. package/src/features/column-filtering/columnFilteringFeature.types.ts +55 -39
  465. package/src/features/column-filtering/columnFilteringFeature.utils.ts +2 -2
  466. package/src/features/column-filtering/createFilteredRowModel.ts +18 -17
  467. package/src/features/column-filtering/filterRowsUtils.ts +3 -2
  468. package/src/features/column-grouping/columnGroupingFeature.ts +83 -126
  469. package/src/features/column-grouping/columnGroupingFeature.types.ts +32 -31
  470. package/src/features/column-grouping/columnGroupingFeature.utils.ts +2 -2
  471. package/src/features/column-grouping/createGroupedRowModel.ts +17 -16
  472. package/src/features/column-ordering/columnOrderingFeature.ts +52 -84
  473. package/src/features/column-ordering/columnOrderingFeature.types.ts +2 -2
  474. package/src/features/column-pinning/columnPinningFeature.ts +268 -304
  475. package/src/features/column-pinning/columnPinningFeature.types.ts +4 -4
  476. package/src/features/column-pinning/columnPinningFeature.utils.ts +11 -19
  477. package/src/features/column-resizing/columnResizingFeature.ts +44 -78
  478. package/src/features/column-resizing/columnResizingFeature.types.ts +1 -4
  479. package/src/features/column-resizing/columnResizingFeature.utils.ts +5 -6
  480. package/src/features/column-sizing/columnSizingFeature.ts +115 -152
  481. package/src/features/column-sizing/columnSizingFeature.utils.ts +27 -5
  482. package/src/features/column-visibility/columnVisibilityFeature.ts +92 -129
  483. package/src/features/column-visibility/columnVisibilityFeature.types.ts +4 -4
  484. package/src/features/column-visibility/columnVisibilityFeature.utils.ts +31 -15
  485. package/src/features/global-filtering/globalFilteringFeature.ts +45 -79
  486. package/src/features/global-filtering/globalFilteringFeature.types.ts +4 -4
  487. package/src/features/global-filtering/globalFilteringFeature.utils.ts +5 -3
  488. package/src/features/row-expanding/createExpandedRowModel.ts +1 -1
  489. package/src/features/row-expanding/rowExpandingFeature.ts +65 -101
  490. package/src/features/row-expanding/rowExpandingFeature.types.ts +8 -22
  491. package/src/features/row-expanding/rowExpandingFeature.utils.ts +38 -13
  492. package/src/features/row-pagination/createPaginatedRowModel.ts +2 -2
  493. package/src/features/row-pagination/rowPaginationFeature.ts +69 -103
  494. package/src/features/row-pagination/rowPaginationFeature.types.ts +6 -20
  495. package/src/features/row-pinning/rowPinningFeature.ts +72 -104
  496. package/src/features/row-pinning/rowPinningFeature.types.ts +4 -4
  497. package/src/features/row-selection/rowSelectionFeature.ts +125 -135
  498. package/src/features/row-selection/rowSelectionFeature.types.ts +17 -7
  499. package/src/features/row-selection/rowSelectionFeature.utils.ts +144 -66
  500. package/src/features/row-sorting/createSortedRowModel.ts +12 -15
  501. package/src/features/row-sorting/rowSortingFeature.ts +73 -114
  502. package/src/features/row-sorting/rowSortingFeature.types.ts +33 -32
  503. package/src/features/row-sorting/rowSortingFeature.utils.ts +8 -6
  504. package/src/fns/aggregationFns.ts +26 -42
  505. package/src/fns/filterFns.ts +237 -264
  506. package/src/fns/sortFns.ts +51 -29
  507. package/src/helpers/columnHelper.ts +4 -4
  508. package/src/helpers/metaHelper.ts +24 -0
  509. package/src/helpers/tableFeatures.ts +36 -5
  510. package/src/index.ts +1 -0
  511. package/src/store-reactivity-bindings.ts +1 -1
  512. package/src/types/Cell.ts +5 -21
  513. package/src/types/Column.ts +12 -26
  514. package/src/types/ColumnDef.ts +28 -18
  515. package/src/types/Header.ts +4 -20
  516. package/src/types/HeaderGroup.ts +7 -18
  517. package/src/types/Row.ts +6 -21
  518. package/src/types/RowModel.ts +15 -88
  519. package/src/types/RowModelFns.ts +9 -24
  520. package/src/types/Table.ts +54 -44
  521. package/src/types/TableFeatures.ts +402 -123
  522. package/src/types/TableOptions.ts +59 -21
  523. package/src/types/TableState.ts +5 -17
  524. package/src/utils.ts +40 -8
@@ -1,3 +1,5 @@
1
+ import { makeObjectMap } from "../../utils.js";
2
+
1
3
  //#region src/core/rows/constructRow.ts
2
4
  /**
3
5
  * Creates or retrieves the row prototype for a table.
@@ -22,8 +24,8 @@ function getRowPrototype(table) {
22
24
  const constructRow = (table, id, original, rowIndex, depth, subRows, parentId) => {
23
25
  const rowPrototype = getRowPrototype(table);
24
26
  const row = Object.create(rowPrototype);
25
- row._uniqueValuesCache = {};
26
- row._valuesCache = {};
27
+ row._uniqueValuesCache = makeObjectMap();
28
+ row._valuesCache = makeObjectMap();
27
29
  row.depth = depth;
28
30
  row.id = id;
29
31
  row.index = rowIndex;
@@ -1 +1 @@
1
- {"version":3,"file":"constructRow.js","names":[],"sources":["../../../src/core/rows/constructRow.ts"],"sourcesContent":["import type { Table_Internal } from '../../types/Table'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Row_CoreProperties } from './coreRowsFeature.types'\n\n/**\n * Creates or retrieves the row prototype for a table.\n * The prototype is cached on the table and shared by all row instances.\n */\nfunction getRowPrototype<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): object {\n if (!table._rowPrototype) {\n table._rowPrototype = { table }\n const features = Object.values(table._features)\n for (let i = 0; i < features.length; i++) {\n features[i]!.assignRowPrototype?.(table._rowPrototype, table)\n }\n }\n return table._rowPrototype\n}\n\n/**\n * Constructs a row 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 const constructRow = <\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n id: string,\n original: TData,\n rowIndex: number,\n depth: number,\n subRows?: Array<Row<TFeatures, TData>>,\n parentId?: string,\n): Row<TFeatures, TData> => {\n // Create row with shared prototype for memory efficiency\n const rowPrototype = getRowPrototype(table)\n const row = Object.create(rowPrototype) as Row_CoreProperties<\n TFeatures,\n TData\n >\n\n // Only assign instance-specific properties\n row._uniqueValuesCache = {}\n row._valuesCache = {}\n row.depth = depth\n row.id = id\n row.index = rowIndex\n row.original = original\n row.parentId = parentId\n row.subRows = subRows ?? []\n\n // Initialize instance-specific data (e.g., caches) for features that need it\n const features = Object.values(table._features)\n for (let i = 0; i < features.length; i++) {\n features[i]!.initRowInstanceData?.(row)\n }\n\n return row as Row<TFeatures, TData>\n}\n"],"mappings":";;;;;AAUA,SAAS,gBAGP,OAAiD;CACjD,IAAI,CAAC,MAAM,eAAe;EACxB,MAAM,gBAAgB,EAAE,MAAM;EAC9B,MAAM,WAAW,OAAO,OAAO,MAAM,SAAS;EAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;;GACxC,wCAAS,IAAI,iGAAqB,MAAM,eAAe,KAAK;EAC9D;CACF;CACA,OAAO,MAAM;AACf;;;;;;AAOA,MAAa,gBAIX,OACA,IACA,UACA,UACA,OACA,SACA,aAC0B;CAE1B,MAAM,eAAe,gBAAgB,KAAK;CAC1C,MAAM,MAAM,OAAO,OAAO,YAAY;CAMtC,IAAI,qBAAqB,CAAC;CAC1B,IAAI,eAAe,CAAC;CACpB,IAAI,QAAQ;CACZ,IAAI,KAAK;CACT,IAAI,QAAQ;CACZ,IAAI,WAAW;CACf,IAAI,WAAW;CACf,IAAI,UAAU,WAAW,CAAC;CAG1B,MAAM,WAAW,OAAO,OAAO,MAAM,SAAS;CAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;;EACxC,0CAAS,IAAI,qGAAsB,GAAG;CACxC;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"constructRow.js","names":[],"sources":["../../../src/core/rows/constructRow.ts"],"sourcesContent":["import { makeObjectMap } from '../../utils'\nimport type { Table_Internal } from '../../types/Table'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Row_CoreProperties } from './coreRowsFeature.types'\n\n/**\n * Creates or retrieves the row prototype for a table.\n * The prototype is cached on the table and shared by all row instances.\n */\nfunction getRowPrototype<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): object {\n if (!table._rowPrototype) {\n table._rowPrototype = { table }\n const features = Object.values(table._features)\n for (let i = 0; i < features.length; i++) {\n features[i]!.assignRowPrototype?.(table._rowPrototype, table)\n }\n }\n return table._rowPrototype\n}\n\n/**\n * Constructs a row 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 const constructRow = <\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n id: string,\n original: TData,\n rowIndex: number,\n depth: number,\n subRows?: Array<Row<TFeatures, TData>>,\n parentId?: string,\n): Row<TFeatures, TData> => {\n // Create row with shared prototype for memory efficiency\n const rowPrototype = getRowPrototype(table)\n const row = Object.create(rowPrototype) as Row_CoreProperties<\n TFeatures,\n TData\n >\n\n // Only assign instance-specific properties\n row._uniqueValuesCache = makeObjectMap()\n row._valuesCache = makeObjectMap()\n row.depth = depth\n row.id = id\n row.index = rowIndex\n row.original = original\n row.parentId = parentId\n row.subRows = subRows ?? []\n\n // Initialize instance-specific data (e.g., caches) for features that need it\n const features = Object.values(table._features)\n for (let i = 0; i < features.length; i++) {\n features[i]!.initRowInstanceData?.(row)\n }\n\n return row as Row<TFeatures, TData>\n}\n"],"mappings":";;;;;;;AAWA,SAAS,gBAGP,OAAiD;CACjD,IAAI,CAAC,MAAM,eAAe;EACxB,MAAM,gBAAgB,EAAE,MAAM;EAC9B,MAAM,WAAW,OAAO,OAAO,MAAM,SAAS;EAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;;GACxC,wCAAS,IAAI,iGAAqB,MAAM,eAAe,KAAK;EAC9D;CACF;CACA,OAAO,MAAM;AACf;;;;;;AAOA,MAAa,gBAIX,OACA,IACA,UACA,UACA,OACA,SACA,aAC0B;CAE1B,MAAM,eAAe,gBAAgB,KAAK;CAC1C,MAAM,MAAM,OAAO,OAAO,YAAY;CAMtC,IAAI,qBAAqB,cAAc;CACvC,IAAI,eAAe,cAAc;CACjC,IAAI,QAAQ;CACZ,IAAI,KAAK;CACT,IAAI,QAAQ;CACZ,IAAI,WAAW;CACf,IAAI,WAAW;CACf,IAAI,UAAU,WAAW,CAAC;CAG1B,MAAM,WAAW,OAAO,OAAO,MAAM,SAAS;CAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;;EACxC,0CAAS,IAAI,qGAAsB,GAAG;CACxC;CAEA,OAAO;AACT"}
@@ -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,11 +1,11 @@
1
1
  import { RowData } from "../../types/type-utils.cjs";
2
2
  import { Row } from "../../types/Row.cjs";
3
+ import { Table } from "../../types/Table.cjs";
3
4
  import { TableFeatures } from "../../types/TableFeatures.cjs";
4
- import { Table_Internal } from "../../types/Table.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
  /**
@@ -39,9 +39,9 @@ interface Row_CoreProperties<TFeatures extends TableFeatures, TData extends RowD
39
39
  /**
40
40
  * Reference to the parent table instance.
41
41
  */
42
- table: Table_Internal<TFeatures, TData>;
42
+ table: Table<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 { Table } from "../../types/Table.js";
3
4
  import { TableFeatures } from "../../types/TableFeatures.js";
4
- import { Table_Internal } from "../../types/Table.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
  /**
@@ -39,9 +39,9 @@ interface Row_CoreProperties<TFeatures extends TableFeatures, TData extends RowD
39
39
  /**
40
40
  * Reference to the parent table instance.
41
41
  */
42
- table: Table_Internal<TFeatures, TData>;
42
+ table: Table<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.
@@ -14,7 +14,7 @@ const require_constructCell = require('../cells/constructCell.cjs');
14
14
  * ```
15
15
  */
16
16
  function row_getValue(row, columnId) {
17
- if (row._valuesCache.hasOwnProperty(columnId)) return row._valuesCache[columnId];
17
+ if (require_utils.hasOwn(row._valuesCache, columnId)) return row._valuesCache[columnId];
18
18
  const column = row.table.getColumn(columnId);
19
19
  if (!(column === null || column === void 0 ? void 0 : column.accessorFn)) return;
20
20
  row._valuesCache[columnId] = column.accessorFn(row.original, row.index);
@@ -32,7 +32,7 @@ function row_getValue(row, columnId) {
32
32
  * ```
33
33
  */
34
34
  function row_getUniqueValues(row, columnId) {
35
- if (row._uniqueValuesCache.hasOwnProperty(columnId)) return row._uniqueValuesCache[columnId];
35
+ if (require_utils.hasOwn(row._uniqueValuesCache, columnId)) return row._uniqueValuesCache[columnId];
36
36
  const column = row.table.getColumn(columnId);
37
37
  if (!(column === null || column === void 0 ? void 0 : column.accessorFn)) return;
38
38
  if (!column.columnDef.getUniqueValues) {
@@ -132,7 +132,7 @@ function row_getAllCells(row) {
132
132
  * ```
133
133
  */
134
134
  function row_getAllCellsByColumnId(row) {
135
- const result = {};
135
+ const result = require_utils.makeObjectMap();
136
136
  const cells = row.getAllCells();
137
137
  for (let i = 0; i < cells.length; i++) {
138
138
  const cell = cells[i];
@@ -1 +1 @@
1
- {"version":3,"file":"coreRowsFeature.utils.cjs","names":["flattenBy","constructCell"],"sources":["../../../src/core/rows/coreRowsFeature.utils.ts"],"sourcesContent":["import { flattenBy } from '../../utils'\nimport { constructCell } from '../cells/constructCell'\nimport type { Table_Internal } from '../../types/Table'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Cell } from '../../types/Cell'\n\n/**\n * Reads and caches this row's value for a column.\n *\n * The value is produced by the column accessor. Missing columns or display\n * columns without an accessor return `undefined`.\n *\n * @example\n * ```ts\n * const firstName = row_getValue(row, 'firstName')\n * ```\n */\nexport function row_getValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (row._valuesCache.hasOwnProperty(columnId)) {\n return row._valuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n row._valuesCache[columnId] = column.accessorFn(row.original, row.index)\n\n return row._valuesCache[columnId]\n}\n\n/**\n * Reads and caches the values used by faceting/grouping for a column.\n *\n * If the column defines `getUniqueValues`, that result is used. Otherwise the\n * row's accessor value is wrapped in a single-item array.\n *\n * @example\n * ```ts\n * const values = row_getUniqueValues(row, 'tags')\n * ```\n */\nexport function row_getUniqueValues<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (row._uniqueValuesCache.hasOwnProperty(columnId)) {\n return row._uniqueValuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n if (!column.columnDef.getUniqueValues) {\n row._uniqueValuesCache[columnId] = [row.getValue(columnId)]\n return row._uniqueValuesCache[columnId]\n }\n\n row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(\n row.original,\n row.index,\n )\n\n return row._uniqueValuesCache[columnId]\n}\n\n/**\n * Returns a renderable row value for a column.\n *\n * If the accessor value is nullish, the table's `renderFallbackValue` is used\n * instead.\n *\n * @example\n * ```ts\n * const value = row_renderValue(row, 'firstName')\n * ```\n */\nexport function row_renderValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n return row.getValue(columnId) ?? row.table.options.renderFallbackValue\n}\n\n/**\n * Flattens this row's descendant tree into leaf rows.\n *\n * The row itself is not included; only nested `subRows` are walked.\n *\n * @example\n * ```ts\n * const descendants = row_getLeafRows(row)\n * ```\n */\nexport function row_getLeafRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n return flattenBy(row.subRows, (d) => d.subRows)\n}\n\n/**\n * Looks up this row's direct parent, if it has one.\n *\n * Parent lookup searches the pre-pagination row model so parent relationships\n * are available even when the parent is not on the current page.\n *\n * @example\n * ```ts\n * const parent = row_getParentRow(row)\n * ```\n */\nexport function row_getParentRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n return row.parentId ? row.table.getRow(row.parentId, true) : undefined\n}\n\n/**\n * Collects this row's ancestor chain from root to direct parent.\n *\n * The current row is not included. Rows without a parent return an empty array.\n *\n * @example\n * ```ts\n * const ancestors = row_getParentRows(row)\n * ```\n */\nexport function row_getParentRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const parentRows: Array<Row<TFeatures, TData>> = []\n let currentRow = row\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n const parentRow = currentRow.getParentRow()\n if (!parentRow) break\n parentRows.push(parentRow)\n currentRow = parentRow\n }\n return parentRows.reverse()\n}\n\n/**\n * Constructs one cell for each leaf column in this row.\n *\n * The result follows `table.getAllLeafColumns()` order and includes hidden\n * columns; visibility-specific APIs filter this list later.\n *\n * @example\n * ```ts\n * const cells = row_getAllCells(row)\n * ```\n */\nexport function row_getAllCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>> {\n const columns = row.table.getAllLeafColumns()\n const cells: Array<Cell<TFeatures, TData, unknown>> = new Array(\n columns.length,\n )\n for (let i = 0; i < columns.length; i++) {\n cells[i] = constructCell(columns[i]!, row, row.table)\n }\n return cells\n}\n\n/**\n * Builds a lookup map of this row's cells keyed by column id.\n *\n * This is the static implementation behind `row.getAllCellsByColumnId()`.\n *\n * @example\n * ```ts\n * const cellsById = row_getAllCellsByColumnId(row)\n * ```\n */\nexport function row_getAllCellsByColumnId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const result: Record<string, Cell<TFeatures, TData, unknown>> = {}\n const cells = row.getAllCells()\n for (let i = 0; i < cells.length; i++) {\n const cell = cells[i]!\n result[cell.column.id] = cell\n }\n return result\n}\n\n/**\n * Resolves the stable id for a row.\n *\n * `options.getRowId` wins when provided. Otherwise root rows use their index\n * and child rows append their index to the parent id, such as `0.2`.\n *\n * @example\n * ```ts\n * const id = table_getRowId(originalRow, table, index, parentRow)\n * ```\n */\nexport function table_getRowId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n originalRow: TData,\n table: Table_Internal<TFeatures, TData>,\n index: number,\n parent?: Row<TFeatures, TData>,\n) {\n return (\n table.options.getRowId?.(originalRow, index, parent) ??\n `${parent ? [parent.id, index].join('.') : index}`\n )\n}\n\n/**\n * Looks up a row by id from the current or full row model.\n *\n * By default this searches `table.getRowModel()`. Passing `searchAll` searches\n * the pre-pagination model first, then falls back to the core model.\n *\n * @example\n * ```ts\n * const row = table_getRow(table, rowId, true)\n * ```\n */\nexport function table_getRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n rowId: string,\n searchAll?: boolean,\n): Row<TFeatures, TData> {\n // TODO - simplify this across different row models\n let row = (searchAll ? table.getPrePaginatedRowModel() : table.getRowModel())\n .rowsById[rowId]\n\n if (!row) {\n row = table.getCoreRowModel().rowsById[rowId]\n if (!row) {\n if (process.env.NODE_ENV === 'development') {\n throw new Error(`getRow could not find row with ID: ${rowId}`)\n }\n throw new Error()\n }\n }\n\n return row\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,aAGd,KAA4B,UAAkB;CAC9C,IAAI,IAAI,aAAa,eAAe,QAAQ,GAC1C,OAAO,IAAI,aAAa;CAG1B,MAAM,SAAS,IAAI,MAAM,UAAU,QAAQ;CAE3C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,aAAa,YAAY,OAAO,WAAW,IAAI,UAAU,IAAI,KAAK;CAEtE,OAAO,IAAI,aAAa;AAC1B;;;;;;;;;;;;AAaA,SAAgB,oBAGd,KAA4B,UAAkB;CAC9C,IAAI,IAAI,mBAAmB,eAAe,QAAQ,GAChD,OAAO,IAAI,mBAAmB;CAGhC,MAAM,SAAS,IAAI,MAAM,UAAU,QAAQ;CAE3C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,CAAC,OAAO,UAAU,iBAAiB;EACrC,IAAI,mBAAmB,YAAY,CAAC,IAAI,SAAS,QAAQ,CAAC;EAC1D,OAAO,IAAI,mBAAmB;CAChC;CAEA,IAAI,mBAAmB,YAAY,OAAO,UAAU,gBAClD,IAAI,UACJ,IAAI,KACN;CAEA,OAAO,IAAI,mBAAmB;AAChC;;;;;;;;;;;;AAaA,SAAgB,gBAGd,KAA4B,UAAkB;CAC9C,OAAO,IAAI,SAAS,QAAQ,KAAK,IAAI,MAAM,QAAQ;AACrD;;;;;;;;;;;AAYA,SAAgB,gBAGd,KAA0D;CAC1D,OAAOA,wBAAU,IAAI,UAAU,MAAM,EAAE,OAAO;AAChD;;;;;;;;;;;;AAaA,SAAgB,iBAGd,KAA4B;CAC5B,OAAO,IAAI,WAAW,IAAI,MAAM,OAAO,IAAI,UAAU,IAAI,IAAI;AAC/D;;;;;;;;;;;AAYA,SAAgB,kBAGd,KAA4B;CAC5B,MAAM,aAA2C,CAAC;CAClD,IAAI,aAAa;CAEjB,OAAO,MAAM;EACX,MAAM,YAAY,WAAW,aAAa;EAC1C,IAAI,CAAC,WAAW;EAChB,WAAW,KAAK,SAAS;EACzB,aAAa;CACf;CACA,OAAO,WAAW,QAAQ;AAC5B;;;;;;;;;;;;AAaA,SAAgB,gBAGd,KAAoE;CACpE,MAAM,UAAU,IAAI,MAAM,kBAAkB;CAC5C,MAAM,QAAgD,IAAI,MACxD,QAAQ,MACV;CACA,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAClC,MAAM,KAAKC,oCAAc,QAAQ,IAAK,KAAK,IAAI,KAAK;CAEtD,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,0BAGd,KAA4B;CAC5B,MAAM,SAA0D,CAAC;CACjE,MAAM,QAAQ,IAAI,YAAY;CAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,MAAM,OAAO,MAAM;EACnB,OAAO,KAAK,OAAO,MAAM;CAC3B;CACA,OAAO;AACT;;;;;;;;;;;;AAaA,SAAgB,eAId,aACA,OACA,OACA,QACA;;CACA,mDACE,MAAM,SAAQ,6GAAW,aAAa,OAAO,MAAM,MACnD,GAAG,SAAS,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC,KAAK,GAAG,IAAI;AAE/C;;;;;;;;;;;;AAaA,SAAgB,aAId,OACA,OACA,WACuB;CAEvB,IAAI,OAAO,YAAY,MAAM,wBAAwB,IAAI,MAAM,YAAY,EAAC,CACzE,SAAS;CAEZ,IAAI,CAAC,KAAK;EACR,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS;EACvC,IAAI,CAAC,KAAK;GACR,IAAI,QAAQ,IAAI,aAAa,eAC3B,MAAM,IAAI,MAAM,sCAAsC,OAAO;GAE/D,MAAM,IAAI,MAAM;EAClB;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"coreRowsFeature.utils.cjs","names":["hasOwn","flattenBy","constructCell","makeObjectMap"],"sources":["../../../src/core/rows/coreRowsFeature.utils.ts"],"sourcesContent":["import { flattenBy, hasOwn, makeObjectMap } from '../../utils'\nimport { constructCell } from '../cells/constructCell'\nimport type { Table_Internal } from '../../types/Table'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Cell } from '../../types/Cell'\n\n/**\n * Reads and caches this row's value for a column.\n *\n * The value is produced by the column accessor. Missing columns or display\n * columns without an accessor return `undefined`.\n *\n * @example\n * ```ts\n * const firstName = row_getValue(row, 'firstName')\n * ```\n */\nexport function row_getValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (hasOwn(row._valuesCache, columnId)) {\n return row._valuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n row._valuesCache[columnId] = column.accessorFn(row.original, row.index)\n\n return row._valuesCache[columnId]\n}\n\n/**\n * Reads and caches the values used by faceting/grouping for a column.\n *\n * If the column defines `getUniqueValues`, that result is used. Otherwise the\n * row's accessor value is wrapped in a single-item array.\n *\n * @example\n * ```ts\n * const values = row_getUniqueValues(row, 'tags')\n * ```\n */\nexport function row_getUniqueValues<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (hasOwn(row._uniqueValuesCache, columnId)) {\n return row._uniqueValuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n if (!column.columnDef.getUniqueValues) {\n row._uniqueValuesCache[columnId] = [row.getValue(columnId)]\n return row._uniqueValuesCache[columnId]\n }\n\n row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(\n row.original,\n row.index,\n )\n\n return row._uniqueValuesCache[columnId]\n}\n\n/**\n * Returns a renderable row value for a column.\n *\n * If the accessor value is nullish, the table's `renderFallbackValue` is used\n * instead.\n *\n * @example\n * ```ts\n * const value = row_renderValue(row, 'firstName')\n * ```\n */\nexport function row_renderValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n return row.getValue(columnId) ?? row.table.options.renderFallbackValue\n}\n\n/**\n * Flattens this row's descendant tree into leaf rows.\n *\n * The row itself is not included; only nested `subRows` are walked.\n *\n * @example\n * ```ts\n * const descendants = row_getLeafRows(row)\n * ```\n */\nexport function row_getLeafRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n return flattenBy(row.subRows, (d) => d.subRows)\n}\n\n/**\n * Looks up this row's direct parent, if it has one.\n *\n * Parent lookup searches the pre-pagination row model so parent relationships\n * are available even when the parent is not on the current page.\n *\n * @example\n * ```ts\n * const parent = row_getParentRow(row)\n * ```\n */\nexport function row_getParentRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n return row.parentId ? row.table.getRow(row.parentId, true) : undefined\n}\n\n/**\n * Collects this row's ancestor chain from root to direct parent.\n *\n * The current row is not included. Rows without a parent return an empty array.\n *\n * @example\n * ```ts\n * const ancestors = row_getParentRows(row)\n * ```\n */\nexport function row_getParentRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const parentRows: Array<Row<TFeatures, TData>> = []\n let currentRow = row\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n const parentRow = currentRow.getParentRow()\n if (!parentRow) break\n parentRows.push(parentRow)\n currentRow = parentRow\n }\n return parentRows.reverse()\n}\n\n/**\n * Constructs one cell for each leaf column in this row.\n *\n * The result follows `table.getAllLeafColumns()` order and includes hidden\n * columns; visibility-specific APIs filter this list later.\n *\n * @example\n * ```ts\n * const cells = row_getAllCells(row)\n * ```\n */\nexport function row_getAllCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>> {\n const columns = row.table.getAllLeafColumns()\n const cells: Array<Cell<TFeatures, TData, unknown>> = new Array(\n columns.length,\n )\n for (let i = 0; i < columns.length; i++) {\n cells[i] = constructCell(columns[i]!, row, row.table)\n }\n return cells\n}\n\n/**\n * Builds a lookup map of this row's cells keyed by column id.\n *\n * This is the static implementation behind `row.getAllCellsByColumnId()`.\n *\n * @example\n * ```ts\n * const cellsById = row_getAllCellsByColumnId(row)\n * ```\n */\nexport function row_getAllCellsByColumnId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const result = makeObjectMap<Cell<TFeatures, TData, unknown>>()\n const cells = row.getAllCells()\n for (let i = 0; i < cells.length; i++) {\n const cell = cells[i]!\n result[cell.column.id] = cell\n }\n return result\n}\n\n/**\n * Resolves the stable id for a row.\n *\n * `options.getRowId` wins when provided. Otherwise root rows use their index\n * and child rows append their index to the parent id, such as `0.2`.\n *\n * @example\n * ```ts\n * const id = table_getRowId(originalRow, table, index, parentRow)\n * ```\n */\nexport function table_getRowId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n originalRow: TData,\n table: Table_Internal<TFeatures, TData>,\n index: number,\n parent?: Row<TFeatures, TData>,\n) {\n return (\n table.options.getRowId?.(originalRow, index, parent) ??\n `${parent ? [parent.id, index].join('.') : index}`\n )\n}\n\n/**\n * Looks up a row by id from the current or full row model.\n *\n * By default this searches `table.getRowModel()`. Passing `searchAll` searches\n * the pre-pagination model first, then falls back to the core model.\n *\n * @example\n * ```ts\n * const row = table_getRow(table, rowId, true)\n * ```\n */\nexport function table_getRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n rowId: string,\n searchAll?: boolean,\n): Row<TFeatures, TData> {\n // TODO - simplify this across different row models\n let row = (searchAll ? table.getPrePaginatedRowModel() : table.getRowModel())\n .rowsById[rowId]\n\n if (!row) {\n row = table.getCoreRowModel().rowsById[rowId]\n if (!row) {\n if (process.env.NODE_ENV === 'development') {\n throw new Error(`getRow could not find row with ID: ${rowId}`)\n }\n throw new Error()\n }\n }\n\n return row\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,aAGd,KAA4B,UAAkB;CAC9C,IAAIA,qBAAO,IAAI,cAAc,QAAQ,GACnC,OAAO,IAAI,aAAa;CAG1B,MAAM,SAAS,IAAI,MAAM,UAAU,QAAQ;CAE3C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,aAAa,YAAY,OAAO,WAAW,IAAI,UAAU,IAAI,KAAK;CAEtE,OAAO,IAAI,aAAa;AAC1B;;;;;;;;;;;;AAaA,SAAgB,oBAGd,KAA4B,UAAkB;CAC9C,IAAIA,qBAAO,IAAI,oBAAoB,QAAQ,GACzC,OAAO,IAAI,mBAAmB;CAGhC,MAAM,SAAS,IAAI,MAAM,UAAU,QAAQ;CAE3C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,CAAC,OAAO,UAAU,iBAAiB;EACrC,IAAI,mBAAmB,YAAY,CAAC,IAAI,SAAS,QAAQ,CAAC;EAC1D,OAAO,IAAI,mBAAmB;CAChC;CAEA,IAAI,mBAAmB,YAAY,OAAO,UAAU,gBAClD,IAAI,UACJ,IAAI,KACN;CAEA,OAAO,IAAI,mBAAmB;AAChC;;;;;;;;;;;;AAaA,SAAgB,gBAGd,KAA4B,UAAkB;CAC9C,OAAO,IAAI,SAAS,QAAQ,KAAK,IAAI,MAAM,QAAQ;AACrD;;;;;;;;;;;AAYA,SAAgB,gBAGd,KAA0D;CAC1D,OAAOC,wBAAU,IAAI,UAAU,MAAM,EAAE,OAAO;AAChD;;;;;;;;;;;;AAaA,SAAgB,iBAGd,KAA4B;CAC5B,OAAO,IAAI,WAAW,IAAI,MAAM,OAAO,IAAI,UAAU,IAAI,IAAI;AAC/D;;;;;;;;;;;AAYA,SAAgB,kBAGd,KAA4B;CAC5B,MAAM,aAA2C,CAAC;CAClD,IAAI,aAAa;CAEjB,OAAO,MAAM;EACX,MAAM,YAAY,WAAW,aAAa;EAC1C,IAAI,CAAC,WAAW;EAChB,WAAW,KAAK,SAAS;EACzB,aAAa;CACf;CACA,OAAO,WAAW,QAAQ;AAC5B;;;;;;;;;;;;AAaA,SAAgB,gBAGd,KAAoE;CACpE,MAAM,UAAU,IAAI,MAAM,kBAAkB;CAC5C,MAAM,QAAgD,IAAI,MACxD,QAAQ,MACV;CACA,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAClC,MAAM,KAAKC,oCAAc,QAAQ,IAAK,KAAK,IAAI,KAAK;CAEtD,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,0BAGd,KAA4B;CAC5B,MAAM,SAASC,4BAA+C;CAC9D,MAAM,QAAQ,IAAI,YAAY;CAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,MAAM,OAAO,MAAM;EACnB,OAAO,KAAK,OAAO,MAAM;CAC3B;CACA,OAAO;AACT;;;;;;;;;;;;AAaA,SAAgB,eAId,aACA,OACA,OACA,QACA;;CACA,mDACE,MAAM,SAAQ,6GAAW,aAAa,OAAO,MAAM,MACnD,GAAG,SAAS,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC,KAAK,GAAG,IAAI;AAE/C;;;;;;;;;;;;AAaA,SAAgB,aAId,OACA,OACA,WACuB;CAEvB,IAAI,OAAO,YAAY,MAAM,wBAAwB,IAAI,MAAM,YAAY,EAAC,CACzE,SAAS;CAEZ,IAAI,CAAC,KAAK;EACR,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS;EACvC,IAAI,CAAC,KAAK;GACR,IAAI,QAAQ,IAAI,aAAa,eAC3B,MAAM,IAAI,MAAM,sCAAsC,OAAO;GAE/D,MAAM,IAAI,MAAM;EAClB;CACF;CAEA,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 { Table } from "../../types/Table.cjs";
3
4
  import { TableFeatures } from "../../types/TableFeatures.cjs";
4
- import { Table_Internal } from "../../types/Table.cjs";
5
5
  import { Cell } from "../../types/Cell.cjs";
6
6
 
7
7
  //#region src/core/rows/coreRowsFeature.utils.d.ts
@@ -109,7 +109,7 @@ declare function row_getAllCellsByColumnId<TFeatures extends TableFeatures, TDat
109
109
  * const id = table_getRowId(originalRow, table, index, parentRow)
110
110
  * ```
111
111
  */
112
- declare function table_getRowId<TFeatures extends TableFeatures, TData extends RowData>(originalRow: TData, table: Table_Internal<TFeatures, TData>, index: number, parent?: Row<TFeatures, TData>): string;
112
+ declare function table_getRowId<TFeatures extends TableFeatures, TData extends RowData>(originalRow: TData, table: Table<TFeatures, TData>, index: number, parent?: Row<TFeatures, TData>): string;
113
113
  /**
114
114
  * Looks up a row by id from the current or full row model.
115
115
  *
@@ -121,7 +121,7 @@ declare function table_getRowId<TFeatures extends TableFeatures, TData extends R
121
121
  * const row = table_getRow(table, rowId, true)
122
122
  * ```
123
123
  */
124
- declare function table_getRow<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, rowId: string, searchAll?: boolean): Row<TFeatures, TData>;
124
+ declare function table_getRow<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>, rowId: string, searchAll?: boolean): Row<TFeatures, TData>;
125
125
  //#endregion
126
126
  export { row_getAllCells, row_getAllCellsByColumnId, row_getLeafRows, row_getParentRow, row_getParentRows, row_getUniqueValues, row_getValue, row_renderValue, table_getRow, table_getRowId };
127
127
  //# sourceMappingURL=coreRowsFeature.utils.d.cts.map
@@ -1,7 +1,7 @@
1
1
  import { RowData } from "../../types/type-utils.js";
2
2
  import { Row } from "../../types/Row.js";
3
+ import { Table } from "../../types/Table.js";
3
4
  import { TableFeatures } from "../../types/TableFeatures.js";
4
- import { Table_Internal } from "../../types/Table.js";
5
5
  import { Cell } from "../../types/Cell.js";
6
6
 
7
7
  //#region src/core/rows/coreRowsFeature.utils.d.ts
@@ -109,7 +109,7 @@ declare function row_getAllCellsByColumnId<TFeatures extends TableFeatures, TDat
109
109
  * const id = table_getRowId(originalRow, table, index, parentRow)
110
110
  * ```
111
111
  */
112
- declare function table_getRowId<TFeatures extends TableFeatures, TData extends RowData>(originalRow: TData, table: Table_Internal<TFeatures, TData>, index: number, parent?: Row<TFeatures, TData>): string;
112
+ declare function table_getRowId<TFeatures extends TableFeatures, TData extends RowData>(originalRow: TData, table: Table<TFeatures, TData>, index: number, parent?: Row<TFeatures, TData>): string;
113
113
  /**
114
114
  * Looks up a row by id from the current or full row model.
115
115
  *
@@ -121,7 +121,7 @@ declare function table_getRowId<TFeatures extends TableFeatures, TData extends R
121
121
  * const row = table_getRow(table, rowId, true)
122
122
  * ```
123
123
  */
124
- declare function table_getRow<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, rowId: string, searchAll?: boolean): Row<TFeatures, TData>;
124
+ declare function table_getRow<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>, rowId: string, searchAll?: boolean): Row<TFeatures, TData>;
125
125
  //#endregion
126
126
  export { row_getAllCells, row_getAllCellsByColumnId, row_getLeafRows, row_getParentRow, row_getParentRows, row_getUniqueValues, row_getValue, row_renderValue, table_getRow, table_getRowId };
127
127
  //# sourceMappingURL=coreRowsFeature.utils.d.ts.map
@@ -1,4 +1,4 @@
1
- import { flattenBy } from "../../utils.js";
1
+ import { flattenBy, hasOwn, makeObjectMap } from "../../utils.js";
2
2
  import { constructCell } from "../cells/constructCell.js";
3
3
 
4
4
  //#region src/core/rows/coreRowsFeature.utils.ts
@@ -14,7 +14,7 @@ import { constructCell } from "../cells/constructCell.js";
14
14
  * ```
15
15
  */
16
16
  function row_getValue(row, columnId) {
17
- if (row._valuesCache.hasOwnProperty(columnId)) return row._valuesCache[columnId];
17
+ if (hasOwn(row._valuesCache, columnId)) return row._valuesCache[columnId];
18
18
  const column = row.table.getColumn(columnId);
19
19
  if (!(column === null || column === void 0 ? void 0 : column.accessorFn)) return;
20
20
  row._valuesCache[columnId] = column.accessorFn(row.original, row.index);
@@ -32,7 +32,7 @@ function row_getValue(row, columnId) {
32
32
  * ```
33
33
  */
34
34
  function row_getUniqueValues(row, columnId) {
35
- if (row._uniqueValuesCache.hasOwnProperty(columnId)) return row._uniqueValuesCache[columnId];
35
+ if (hasOwn(row._uniqueValuesCache, columnId)) return row._uniqueValuesCache[columnId];
36
36
  const column = row.table.getColumn(columnId);
37
37
  if (!(column === null || column === void 0 ? void 0 : column.accessorFn)) return;
38
38
  if (!column.columnDef.getUniqueValues) {
@@ -132,7 +132,7 @@ function row_getAllCells(row) {
132
132
  * ```
133
133
  */
134
134
  function row_getAllCellsByColumnId(row) {
135
- const result = {};
135
+ const result = makeObjectMap();
136
136
  const cells = row.getAllCells();
137
137
  for (let i = 0; i < cells.length; i++) {
138
138
  const cell = cells[i];
@@ -1 +1 @@
1
- {"version":3,"file":"coreRowsFeature.utils.js","names":[],"sources":["../../../src/core/rows/coreRowsFeature.utils.ts"],"sourcesContent":["import { flattenBy } from '../../utils'\nimport { constructCell } from '../cells/constructCell'\nimport type { Table_Internal } from '../../types/Table'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Cell } from '../../types/Cell'\n\n/**\n * Reads and caches this row's value for a column.\n *\n * The value is produced by the column accessor. Missing columns or display\n * columns without an accessor return `undefined`.\n *\n * @example\n * ```ts\n * const firstName = row_getValue(row, 'firstName')\n * ```\n */\nexport function row_getValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (row._valuesCache.hasOwnProperty(columnId)) {\n return row._valuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n row._valuesCache[columnId] = column.accessorFn(row.original, row.index)\n\n return row._valuesCache[columnId]\n}\n\n/**\n * Reads and caches the values used by faceting/grouping for a column.\n *\n * If the column defines `getUniqueValues`, that result is used. Otherwise the\n * row's accessor value is wrapped in a single-item array.\n *\n * @example\n * ```ts\n * const values = row_getUniqueValues(row, 'tags')\n * ```\n */\nexport function row_getUniqueValues<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (row._uniqueValuesCache.hasOwnProperty(columnId)) {\n return row._uniqueValuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n if (!column.columnDef.getUniqueValues) {\n row._uniqueValuesCache[columnId] = [row.getValue(columnId)]\n return row._uniqueValuesCache[columnId]\n }\n\n row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(\n row.original,\n row.index,\n )\n\n return row._uniqueValuesCache[columnId]\n}\n\n/**\n * Returns a renderable row value for a column.\n *\n * If the accessor value is nullish, the table's `renderFallbackValue` is used\n * instead.\n *\n * @example\n * ```ts\n * const value = row_renderValue(row, 'firstName')\n * ```\n */\nexport function row_renderValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n return row.getValue(columnId) ?? row.table.options.renderFallbackValue\n}\n\n/**\n * Flattens this row's descendant tree into leaf rows.\n *\n * The row itself is not included; only nested `subRows` are walked.\n *\n * @example\n * ```ts\n * const descendants = row_getLeafRows(row)\n * ```\n */\nexport function row_getLeafRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n return flattenBy(row.subRows, (d) => d.subRows)\n}\n\n/**\n * Looks up this row's direct parent, if it has one.\n *\n * Parent lookup searches the pre-pagination row model so parent relationships\n * are available even when the parent is not on the current page.\n *\n * @example\n * ```ts\n * const parent = row_getParentRow(row)\n * ```\n */\nexport function row_getParentRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n return row.parentId ? row.table.getRow(row.parentId, true) : undefined\n}\n\n/**\n * Collects this row's ancestor chain from root to direct parent.\n *\n * The current row is not included. Rows without a parent return an empty array.\n *\n * @example\n * ```ts\n * const ancestors = row_getParentRows(row)\n * ```\n */\nexport function row_getParentRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const parentRows: Array<Row<TFeatures, TData>> = []\n let currentRow = row\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n const parentRow = currentRow.getParentRow()\n if (!parentRow) break\n parentRows.push(parentRow)\n currentRow = parentRow\n }\n return parentRows.reverse()\n}\n\n/**\n * Constructs one cell for each leaf column in this row.\n *\n * The result follows `table.getAllLeafColumns()` order and includes hidden\n * columns; visibility-specific APIs filter this list later.\n *\n * @example\n * ```ts\n * const cells = row_getAllCells(row)\n * ```\n */\nexport function row_getAllCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>> {\n const columns = row.table.getAllLeafColumns()\n const cells: Array<Cell<TFeatures, TData, unknown>> = new Array(\n columns.length,\n )\n for (let i = 0; i < columns.length; i++) {\n cells[i] = constructCell(columns[i]!, row, row.table)\n }\n return cells\n}\n\n/**\n * Builds a lookup map of this row's cells keyed by column id.\n *\n * This is the static implementation behind `row.getAllCellsByColumnId()`.\n *\n * @example\n * ```ts\n * const cellsById = row_getAllCellsByColumnId(row)\n * ```\n */\nexport function row_getAllCellsByColumnId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const result: Record<string, Cell<TFeatures, TData, unknown>> = {}\n const cells = row.getAllCells()\n for (let i = 0; i < cells.length; i++) {\n const cell = cells[i]!\n result[cell.column.id] = cell\n }\n return result\n}\n\n/**\n * Resolves the stable id for a row.\n *\n * `options.getRowId` wins when provided. Otherwise root rows use their index\n * and child rows append their index to the parent id, such as `0.2`.\n *\n * @example\n * ```ts\n * const id = table_getRowId(originalRow, table, index, parentRow)\n * ```\n */\nexport function table_getRowId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n originalRow: TData,\n table: Table_Internal<TFeatures, TData>,\n index: number,\n parent?: Row<TFeatures, TData>,\n) {\n return (\n table.options.getRowId?.(originalRow, index, parent) ??\n `${parent ? [parent.id, index].join('.') : index}`\n )\n}\n\n/**\n * Looks up a row by id from the current or full row model.\n *\n * By default this searches `table.getRowModel()`. Passing `searchAll` searches\n * the pre-pagination model first, then falls back to the core model.\n *\n * @example\n * ```ts\n * const row = table_getRow(table, rowId, true)\n * ```\n */\nexport function table_getRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n rowId: string,\n searchAll?: boolean,\n): Row<TFeatures, TData> {\n // TODO - simplify this across different row models\n let row = (searchAll ? table.getPrePaginatedRowModel() : table.getRowModel())\n .rowsById[rowId]\n\n if (!row) {\n row = table.getCoreRowModel().rowsById[rowId]\n if (!row) {\n if (process.env.NODE_ENV === 'development') {\n throw new Error(`getRow could not find row with ID: ${rowId}`)\n }\n throw new Error()\n }\n }\n\n return row\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,aAGd,KAA4B,UAAkB;CAC9C,IAAI,IAAI,aAAa,eAAe,QAAQ,GAC1C,OAAO,IAAI,aAAa;CAG1B,MAAM,SAAS,IAAI,MAAM,UAAU,QAAQ;CAE3C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,aAAa,YAAY,OAAO,WAAW,IAAI,UAAU,IAAI,KAAK;CAEtE,OAAO,IAAI,aAAa;AAC1B;;;;;;;;;;;;AAaA,SAAgB,oBAGd,KAA4B,UAAkB;CAC9C,IAAI,IAAI,mBAAmB,eAAe,QAAQ,GAChD,OAAO,IAAI,mBAAmB;CAGhC,MAAM,SAAS,IAAI,MAAM,UAAU,QAAQ;CAE3C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,CAAC,OAAO,UAAU,iBAAiB;EACrC,IAAI,mBAAmB,YAAY,CAAC,IAAI,SAAS,QAAQ,CAAC;EAC1D,OAAO,IAAI,mBAAmB;CAChC;CAEA,IAAI,mBAAmB,YAAY,OAAO,UAAU,gBAClD,IAAI,UACJ,IAAI,KACN;CAEA,OAAO,IAAI,mBAAmB;AAChC;;;;;;;;;;;;AAaA,SAAgB,gBAGd,KAA4B,UAAkB;CAC9C,OAAO,IAAI,SAAS,QAAQ,KAAK,IAAI,MAAM,QAAQ;AACrD;;;;;;;;;;;AAYA,SAAgB,gBAGd,KAA0D;CAC1D,OAAO,UAAU,IAAI,UAAU,MAAM,EAAE,OAAO;AAChD;;;;;;;;;;;;AAaA,SAAgB,iBAGd,KAA4B;CAC5B,OAAO,IAAI,WAAW,IAAI,MAAM,OAAO,IAAI,UAAU,IAAI,IAAI;AAC/D;;;;;;;;;;;AAYA,SAAgB,kBAGd,KAA4B;CAC5B,MAAM,aAA2C,CAAC;CAClD,IAAI,aAAa;CAEjB,OAAO,MAAM;EACX,MAAM,YAAY,WAAW,aAAa;EAC1C,IAAI,CAAC,WAAW;EAChB,WAAW,KAAK,SAAS;EACzB,aAAa;CACf;CACA,OAAO,WAAW,QAAQ;AAC5B;;;;;;;;;;;;AAaA,SAAgB,gBAGd,KAAoE;CACpE,MAAM,UAAU,IAAI,MAAM,kBAAkB;CAC5C,MAAM,QAAgD,IAAI,MACxD,QAAQ,MACV;CACA,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAClC,MAAM,KAAK,cAAc,QAAQ,IAAK,KAAK,IAAI,KAAK;CAEtD,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,0BAGd,KAA4B;CAC5B,MAAM,SAA0D,CAAC;CACjE,MAAM,QAAQ,IAAI,YAAY;CAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,MAAM,OAAO,MAAM;EACnB,OAAO,KAAK,OAAO,MAAM;CAC3B;CACA,OAAO;AACT;;;;;;;;;;;;AAaA,SAAgB,eAId,aACA,OACA,OACA,QACA;;CACA,mDACE,MAAM,SAAQ,6GAAW,aAAa,OAAO,MAAM,MACnD,GAAG,SAAS,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC,KAAK,GAAG,IAAI;AAE/C;;;;;;;;;;;;AAaA,SAAgB,aAId,OACA,OACA,WACuB;CAEvB,IAAI,OAAO,YAAY,MAAM,wBAAwB,IAAI,MAAM,YAAY,EAAC,CACzE,SAAS;CAEZ,IAAI,CAAC,KAAK;EACR,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS;EACvC,IAAI,CAAC,KAAK;GACR,IAAI,QAAQ,IAAI,aAAa,eAC3B,MAAM,IAAI,MAAM,sCAAsC,OAAO;GAE/D,MAAM,IAAI,MAAM;EAClB;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"coreRowsFeature.utils.js","names":[],"sources":["../../../src/core/rows/coreRowsFeature.utils.ts"],"sourcesContent":["import { flattenBy, hasOwn, makeObjectMap } from '../../utils'\nimport { constructCell } from '../cells/constructCell'\nimport type { Table_Internal } from '../../types/Table'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Cell } from '../../types/Cell'\n\n/**\n * Reads and caches this row's value for a column.\n *\n * The value is produced by the column accessor. Missing columns or display\n * columns without an accessor return `undefined`.\n *\n * @example\n * ```ts\n * const firstName = row_getValue(row, 'firstName')\n * ```\n */\nexport function row_getValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (hasOwn(row._valuesCache, columnId)) {\n return row._valuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n row._valuesCache[columnId] = column.accessorFn(row.original, row.index)\n\n return row._valuesCache[columnId]\n}\n\n/**\n * Reads and caches the values used by faceting/grouping for a column.\n *\n * If the column defines `getUniqueValues`, that result is used. Otherwise the\n * row's accessor value is wrapped in a single-item array.\n *\n * @example\n * ```ts\n * const values = row_getUniqueValues(row, 'tags')\n * ```\n */\nexport function row_getUniqueValues<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n if (hasOwn(row._uniqueValuesCache, columnId)) {\n return row._uniqueValuesCache[columnId]\n }\n\n const column = row.table.getColumn(columnId)\n\n if (!column?.accessorFn) {\n return undefined\n }\n\n if (!column.columnDef.getUniqueValues) {\n row._uniqueValuesCache[columnId] = [row.getValue(columnId)]\n return row._uniqueValuesCache[columnId]\n }\n\n row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(\n row.original,\n row.index,\n )\n\n return row._uniqueValuesCache[columnId]\n}\n\n/**\n * Returns a renderable row value for a column.\n *\n * If the accessor value is nullish, the table's `renderFallbackValue` is used\n * instead.\n *\n * @example\n * ```ts\n * const value = row_renderValue(row, 'firstName')\n * ```\n */\nexport function row_renderValue<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>, columnId: string) {\n return row.getValue(columnId) ?? row.table.options.renderFallbackValue\n}\n\n/**\n * Flattens this row's descendant tree into leaf rows.\n *\n * The row itself is not included; only nested `subRows` are walked.\n *\n * @example\n * ```ts\n * const descendants = row_getLeafRows(row)\n * ```\n */\nexport function row_getLeafRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Row<TFeatures, TData>> {\n return flattenBy(row.subRows, (d) => d.subRows)\n}\n\n/**\n * Looks up this row's direct parent, if it has one.\n *\n * Parent lookup searches the pre-pagination row model so parent relationships\n * are available even when the parent is not on the current page.\n *\n * @example\n * ```ts\n * const parent = row_getParentRow(row)\n * ```\n */\nexport function row_getParentRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n return row.parentId ? row.table.getRow(row.parentId, true) : undefined\n}\n\n/**\n * Collects this row's ancestor chain from root to direct parent.\n *\n * The current row is not included. Rows without a parent return an empty array.\n *\n * @example\n * ```ts\n * const ancestors = row_getParentRows(row)\n * ```\n */\nexport function row_getParentRows<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const parentRows: Array<Row<TFeatures, TData>> = []\n let currentRow = row\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n const parentRow = currentRow.getParentRow()\n if (!parentRow) break\n parentRows.push(parentRow)\n currentRow = parentRow\n }\n return parentRows.reverse()\n}\n\n/**\n * Constructs one cell for each leaf column in this row.\n *\n * The result follows `table.getAllLeafColumns()` order and includes hidden\n * columns; visibility-specific APIs filter this list later.\n *\n * @example\n * ```ts\n * const cells = row_getAllCells(row)\n * ```\n */\nexport function row_getAllCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>> {\n const columns = row.table.getAllLeafColumns()\n const cells: Array<Cell<TFeatures, TData, unknown>> = new Array(\n columns.length,\n )\n for (let i = 0; i < columns.length; i++) {\n cells[i] = constructCell(columns[i]!, row, row.table)\n }\n return cells\n}\n\n/**\n * Builds a lookup map of this row's cells keyed by column id.\n *\n * This is the static implementation behind `row.getAllCellsByColumnId()`.\n *\n * @example\n * ```ts\n * const cellsById = row_getAllCellsByColumnId(row)\n * ```\n */\nexport function row_getAllCellsByColumnId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n const result = makeObjectMap<Cell<TFeatures, TData, unknown>>()\n const cells = row.getAllCells()\n for (let i = 0; i < cells.length; i++) {\n const cell = cells[i]!\n result[cell.column.id] = cell\n }\n return result\n}\n\n/**\n * Resolves the stable id for a row.\n *\n * `options.getRowId` wins when provided. Otherwise root rows use their index\n * and child rows append their index to the parent id, such as `0.2`.\n *\n * @example\n * ```ts\n * const id = table_getRowId(originalRow, table, index, parentRow)\n * ```\n */\nexport function table_getRowId<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n originalRow: TData,\n table: Table_Internal<TFeatures, TData>,\n index: number,\n parent?: Row<TFeatures, TData>,\n) {\n return (\n table.options.getRowId?.(originalRow, index, parent) ??\n `${parent ? [parent.id, index].join('.') : index}`\n )\n}\n\n/**\n * Looks up a row by id from the current or full row model.\n *\n * By default this searches `table.getRowModel()`. Passing `searchAll` searches\n * the pre-pagination model first, then falls back to the core model.\n *\n * @example\n * ```ts\n * const row = table_getRow(table, rowId, true)\n * ```\n */\nexport function table_getRow<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n rowId: string,\n searchAll?: boolean,\n): Row<TFeatures, TData> {\n // TODO - simplify this across different row models\n let row = (searchAll ? table.getPrePaginatedRowModel() : table.getRowModel())\n .rowsById[rowId]\n\n if (!row) {\n row = table.getCoreRowModel().rowsById[rowId]\n if (!row) {\n if (process.env.NODE_ENV === 'development') {\n throw new Error(`getRow could not find row with ID: ${rowId}`)\n }\n throw new Error()\n }\n }\n\n return row\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,aAGd,KAA4B,UAAkB;CAC9C,IAAI,OAAO,IAAI,cAAc,QAAQ,GACnC,OAAO,IAAI,aAAa;CAG1B,MAAM,SAAS,IAAI,MAAM,UAAU,QAAQ;CAE3C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,aAAa,YAAY,OAAO,WAAW,IAAI,UAAU,IAAI,KAAK;CAEtE,OAAO,IAAI,aAAa;AAC1B;;;;;;;;;;;;AAaA,SAAgB,oBAGd,KAA4B,UAAkB;CAC9C,IAAI,OAAO,IAAI,oBAAoB,QAAQ,GACzC,OAAO,IAAI,mBAAmB;CAGhC,MAAM,SAAS,IAAI,MAAM,UAAU,QAAQ;CAE3C,IAAI,kDAAC,OAAQ,aACX;CAGF,IAAI,CAAC,OAAO,UAAU,iBAAiB;EACrC,IAAI,mBAAmB,YAAY,CAAC,IAAI,SAAS,QAAQ,CAAC;EAC1D,OAAO,IAAI,mBAAmB;CAChC;CAEA,IAAI,mBAAmB,YAAY,OAAO,UAAU,gBAClD,IAAI,UACJ,IAAI,KACN;CAEA,OAAO,IAAI,mBAAmB;AAChC;;;;;;;;;;;;AAaA,SAAgB,gBAGd,KAA4B,UAAkB;CAC9C,OAAO,IAAI,SAAS,QAAQ,KAAK,IAAI,MAAM,QAAQ;AACrD;;;;;;;;;;;AAYA,SAAgB,gBAGd,KAA0D;CAC1D,OAAO,UAAU,IAAI,UAAU,MAAM,EAAE,OAAO;AAChD;;;;;;;;;;;;AAaA,SAAgB,iBAGd,KAA4B;CAC5B,OAAO,IAAI,WAAW,IAAI,MAAM,OAAO,IAAI,UAAU,IAAI,IAAI;AAC/D;;;;;;;;;;;AAYA,SAAgB,kBAGd,KAA4B;CAC5B,MAAM,aAA2C,CAAC;CAClD,IAAI,aAAa;CAEjB,OAAO,MAAM;EACX,MAAM,YAAY,WAAW,aAAa;EAC1C,IAAI,CAAC,WAAW;EAChB,WAAW,KAAK,SAAS;EACzB,aAAa;CACf;CACA,OAAO,WAAW,QAAQ;AAC5B;;;;;;;;;;;;AAaA,SAAgB,gBAGd,KAAoE;CACpE,MAAM,UAAU,IAAI,MAAM,kBAAkB;CAC5C,MAAM,QAAgD,IAAI,MACxD,QAAQ,MACV;CACA,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAClC,MAAM,KAAK,cAAc,QAAQ,IAAK,KAAK,IAAI,KAAK;CAEtD,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,0BAGd,KAA4B;CAC5B,MAAM,SAAS,cAA+C;CAC9D,MAAM,QAAQ,IAAI,YAAY;CAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,MAAM,OAAO,MAAM;EACnB,OAAO,KAAK,OAAO,MAAM;CAC3B;CACA,OAAO;AACT;;;;;;;;;;;;AAaA,SAAgB,eAId,aACA,OACA,OACA,QACA;;CACA,mDACE,MAAM,SAAQ,6GAAW,aAAa,OAAO,MAAM,MACnD,GAAG,SAAS,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC,KAAK,GAAG,IAAI;AAE/C;;;;;;;;;;;;AAaA,SAAgB,aAId,OACA,OACA,WACuB;CAEvB,IAAI,OAAO,YAAY,MAAM,wBAAwB,IAAI,MAAM,YAAY,EAAC,CACzE,SAAS;CAEZ,IAAI,CAAC,KAAK;EACR,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS;EACvC,IAAI,CAAC,KAAK;GACR,IAAI,QAAQ,IAAI,aAAa,eAC3B,MAAM,IAAI,MAAM,sCAAsC,OAAO;GAE/D,MAAM,IAAI,MAAM;EAClB;CACF;CAEA,OAAO;AACT"}