@tanstack/table-core 9.0.0-alpha.42 → 9.0.0-alpha.46

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 (539) hide show
  1. package/dist/core/cells/constructCell.cjs +5 -0
  2. package/dist/core/cells/constructCell.cjs.map +1 -1
  3. package/dist/core/cells/constructCell.d.cts +5 -0
  4. package/dist/core/cells/constructCell.d.ts +5 -0
  5. package/dist/core/cells/constructCell.js +5 -0
  6. package/dist/core/cells/constructCell.js.map +1 -1
  7. package/dist/core/cells/coreCellsFeature.cjs +5 -0
  8. package/dist/core/cells/coreCellsFeature.cjs.map +1 -1
  9. package/dist/core/cells/coreCellsFeature.d.cts +5 -0
  10. package/dist/core/cells/coreCellsFeature.d.ts +5 -0
  11. package/dist/core/cells/coreCellsFeature.js +5 -0
  12. package/dist/core/cells/coreCellsFeature.js.map +1 -1
  13. package/dist/core/cells/coreCellsFeature.utils.cjs +30 -0
  14. package/dist/core/cells/coreCellsFeature.utils.cjs.map +1 -1
  15. package/dist/core/cells/coreCellsFeature.utils.d.cts +30 -0
  16. package/dist/core/cells/coreCellsFeature.utils.d.ts +30 -0
  17. package/dist/core/cells/coreCellsFeature.utils.js +30 -0
  18. package/dist/core/cells/coreCellsFeature.utils.js.map +1 -1
  19. package/dist/core/columns/constructColumn.cjs +16 -9
  20. package/dist/core/columns/constructColumn.cjs.map +1 -1
  21. package/dist/core/columns/constructColumn.d.cts +5 -0
  22. package/dist/core/columns/constructColumn.d.ts +5 -0
  23. package/dist/core/columns/constructColumn.js +16 -9
  24. package/dist/core/columns/constructColumn.js.map +1 -1
  25. package/dist/core/columns/coreColumnsFeature.cjs +9 -0
  26. package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
  27. package/dist/core/columns/coreColumnsFeature.d.cts +5 -0
  28. package/dist/core/columns/coreColumnsFeature.d.ts +5 -0
  29. package/dist/core/columns/coreColumnsFeature.js +10 -1
  30. package/dist/core/columns/coreColumnsFeature.js.map +1 -1
  31. package/dist/core/columns/coreColumnsFeature.types.d.cts +4 -0
  32. package/dist/core/columns/coreColumnsFeature.types.d.ts +4 -0
  33. package/dist/core/columns/coreColumnsFeature.utils.cjs +99 -4
  34. package/dist/core/columns/coreColumnsFeature.utils.cjs.map +1 -1
  35. package/dist/core/columns/coreColumnsFeature.utils.d.cts +92 -1
  36. package/dist/core/columns/coreColumnsFeature.utils.d.ts +92 -1
  37. package/dist/core/columns/coreColumnsFeature.utils.js +99 -5
  38. package/dist/core/columns/coreColumnsFeature.utils.js.map +1 -1
  39. package/dist/core/coreFeatures.cjs +5 -0
  40. package/dist/core/coreFeatures.cjs.map +1 -1
  41. package/dist/core/coreFeatures.d.cts +5 -0
  42. package/dist/core/coreFeatures.d.ts +5 -0
  43. package/dist/core/coreFeatures.js +5 -0
  44. package/dist/core/coreFeatures.js.map +1 -1
  45. package/dist/core/headers/buildHeaderGroups.cjs +6 -1
  46. package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
  47. package/dist/core/headers/buildHeaderGroups.d.cts +5 -0
  48. package/dist/core/headers/buildHeaderGroups.d.ts +5 -0
  49. package/dist/core/headers/buildHeaderGroups.js +6 -1
  50. package/dist/core/headers/buildHeaderGroups.js.map +1 -1
  51. package/dist/core/headers/constructHeader.cjs +5 -0
  52. package/dist/core/headers/constructHeader.cjs.map +1 -1
  53. package/dist/core/headers/constructHeader.d.cts +5 -0
  54. package/dist/core/headers/constructHeader.d.ts +5 -0
  55. package/dist/core/headers/constructHeader.js +5 -0
  56. package/dist/core/headers/constructHeader.js.map +1 -1
  57. package/dist/core/headers/coreHeadersFeature.cjs +5 -0
  58. package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
  59. package/dist/core/headers/coreHeadersFeature.d.cts +5 -0
  60. package/dist/core/headers/coreHeadersFeature.d.ts +5 -0
  61. package/dist/core/headers/coreHeadersFeature.js +5 -0
  62. package/dist/core/headers/coreHeadersFeature.js.map +1 -1
  63. package/dist/core/headers/coreHeadersFeature.utils.cjs +71 -2
  64. package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
  65. package/dist/core/headers/coreHeadersFeature.utils.d.cts +60 -0
  66. package/dist/core/headers/coreHeadersFeature.utils.d.ts +60 -0
  67. package/dist/core/headers/coreHeadersFeature.utils.js +72 -3
  68. package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
  69. package/dist/core/reactivity/coreReactivityFeature.types.d.cts +1 -0
  70. package/dist/core/reactivity/coreReactivityFeature.types.d.ts +1 -0
  71. package/dist/core/reactivity/coreReactivityFeature.utils.cjs +5 -0
  72. package/dist/core/reactivity/coreReactivityFeature.utils.cjs.map +1 -1
  73. package/dist/core/reactivity/coreReactivityFeature.utils.d.cts +10 -0
  74. package/dist/core/reactivity/coreReactivityFeature.utils.d.ts +10 -0
  75. package/dist/core/reactivity/coreReactivityFeature.utils.js +5 -0
  76. package/dist/core/reactivity/coreReactivityFeature.utils.js.map +1 -1
  77. package/dist/core/row-models/coreRowModelsFeature.cjs +5 -0
  78. package/dist/core/row-models/coreRowModelsFeature.cjs.map +1 -1
  79. package/dist/core/row-models/coreRowModelsFeature.d.cts +5 -0
  80. package/dist/core/row-models/coreRowModelsFeature.d.ts +5 -0
  81. package/dist/core/row-models/coreRowModelsFeature.js +5 -0
  82. package/dist/core/row-models/coreRowModelsFeature.js.map +1 -1
  83. package/dist/core/row-models/coreRowModelsFeature.types.d.cts +2 -1
  84. package/dist/core/row-models/coreRowModelsFeature.types.d.ts +2 -1
  85. package/dist/core/row-models/coreRowModelsFeature.utils.cjs +120 -0
  86. package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
  87. package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +120 -0
  88. package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +120 -0
  89. package/dist/core/row-models/coreRowModelsFeature.utils.js +120 -0
  90. package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
  91. package/dist/core/row-models/createCoreRowModel.cjs +5 -0
  92. package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
  93. package/dist/core/row-models/createCoreRowModel.d.cts +5 -0
  94. package/dist/core/row-models/createCoreRowModel.d.ts +5 -0
  95. package/dist/core/row-models/createCoreRowModel.js +5 -0
  96. package/dist/core/row-models/createCoreRowModel.js.map +1 -1
  97. package/dist/core/rows/constructRow.cjs +5 -0
  98. package/dist/core/rows/constructRow.cjs.map +1 -1
  99. package/dist/core/rows/constructRow.d.cts +5 -0
  100. package/dist/core/rows/constructRow.d.ts +5 -0
  101. package/dist/core/rows/constructRow.js +5 -0
  102. package/dist/core/rows/constructRow.js.map +1 -1
  103. package/dist/core/rows/coreRowsFeature.cjs +5 -0
  104. package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
  105. package/dist/core/rows/coreRowsFeature.d.cts +5 -0
  106. package/dist/core/rows/coreRowsFeature.d.ts +5 -0
  107. package/dist/core/rows/coreRowsFeature.js +5 -0
  108. package/dist/core/rows/coreRowsFeature.js.map +1 -1
  109. package/dist/core/rows/coreRowsFeature.types.d.cts +3 -0
  110. package/dist/core/rows/coreRowsFeature.types.d.ts +3 -0
  111. package/dist/core/rows/coreRowsFeature.utils.cjs +104 -4
  112. package/dist/core/rows/coreRowsFeature.utils.cjs.map +1 -1
  113. package/dist/core/rows/coreRowsFeature.utils.d.cts +101 -0
  114. package/dist/core/rows/coreRowsFeature.utils.d.ts +101 -0
  115. package/dist/core/rows/coreRowsFeature.utils.js +104 -4
  116. package/dist/core/rows/coreRowsFeature.utils.js.map +1 -1
  117. package/dist/core/table/constructTable.cjs +34 -19
  118. package/dist/core/table/constructTable.cjs.map +1 -1
  119. package/dist/core/table/constructTable.d.cts +10 -0
  120. package/dist/core/table/constructTable.d.ts +10 -0
  121. package/dist/core/table/constructTable.js +34 -19
  122. package/dist/core/table/constructTable.js.map +1 -1
  123. package/dist/core/table/coreTablesFeature.cjs +5 -0
  124. package/dist/core/table/coreTablesFeature.cjs.map +1 -1
  125. package/dist/core/table/coreTablesFeature.d.cts +5 -0
  126. package/dist/core/table/coreTablesFeature.d.ts +5 -0
  127. package/dist/core/table/coreTablesFeature.js +5 -0
  128. package/dist/core/table/coreTablesFeature.js.map +1 -1
  129. package/dist/core/table/coreTablesFeature.types.d.cts +23 -10
  130. package/dist/core/table/coreTablesFeature.types.d.ts +23 -10
  131. package/dist/core/table/coreTablesFeature.utils.cjs +60 -1
  132. package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
  133. package/dist/core/table/coreTablesFeature.utils.d.cts +46 -1
  134. package/dist/core/table/coreTablesFeature.utils.d.ts +46 -1
  135. package/dist/core/table/coreTablesFeature.utils.js +60 -2
  136. package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
  137. package/dist/features/column-faceting/columnFacetingFeature.cjs +9 -1
  138. package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
  139. package/dist/features/column-faceting/columnFacetingFeature.d.cts +9 -1
  140. package/dist/features/column-faceting/columnFacetingFeature.d.ts +9 -1
  141. package/dist/features/column-faceting/columnFacetingFeature.js +9 -1
  142. package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
  143. package/dist/features/column-faceting/columnFacetingFeature.types.d.cts +12 -6
  144. package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +12 -6
  145. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs +60 -0
  146. package/dist/features/column-faceting/columnFacetingFeature.utils.cjs.map +1 -1
  147. package/dist/features/column-faceting/columnFacetingFeature.utils.d.cts +60 -0
  148. package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +60 -0
  149. package/dist/features/column-faceting/columnFacetingFeature.utils.js +60 -0
  150. package/dist/features/column-faceting/columnFacetingFeature.utils.js.map +1 -1
  151. package/dist/features/column-faceting/createFacetedMinMaxValues.cjs +5 -0
  152. package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
  153. package/dist/features/column-faceting/createFacetedMinMaxValues.d.cts +5 -0
  154. package/dist/features/column-faceting/createFacetedMinMaxValues.d.ts +5 -0
  155. package/dist/features/column-faceting/createFacetedMinMaxValues.js +5 -0
  156. package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
  157. package/dist/features/column-faceting/createFacetedRowModel.cjs +5 -0
  158. package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
  159. package/dist/features/column-faceting/createFacetedRowModel.d.cts +5 -0
  160. package/dist/features/column-faceting/createFacetedRowModel.d.ts +5 -0
  161. package/dist/features/column-faceting/createFacetedRowModel.js +5 -0
  162. package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
  163. package/dist/features/column-faceting/createFacetedUniqueValues.cjs +5 -0
  164. package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
  165. package/dist/features/column-faceting/createFacetedUniqueValues.d.cts +5 -0
  166. package/dist/features/column-faceting/createFacetedUniqueValues.d.ts +5 -0
  167. package/dist/features/column-faceting/createFacetedUniqueValues.js +5 -0
  168. package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
  169. package/dist/features/column-filtering/columnFilteringFeature.cjs +10 -2
  170. package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -1
  171. package/dist/features/column-filtering/columnFilteringFeature.d.cts +10 -2
  172. package/dist/features/column-filtering/columnFilteringFeature.d.ts +10 -2
  173. package/dist/features/column-filtering/columnFilteringFeature.js +10 -2
  174. package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -1
  175. package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +7 -4
  176. package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +7 -4
  177. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs +113 -2
  178. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
  179. package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +111 -0
  180. package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +111 -0
  181. package/dist/features/column-filtering/columnFilteringFeature.utils.js +113 -2
  182. package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
  183. package/dist/features/column-filtering/createFilteredRowModel.cjs +5 -0
  184. package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
  185. package/dist/features/column-filtering/createFilteredRowModel.d.cts +5 -0
  186. package/dist/features/column-filtering/createFilteredRowModel.d.ts +5 -0
  187. package/dist/features/column-filtering/createFilteredRowModel.js +5 -0
  188. package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
  189. package/dist/features/column-filtering/filterRowsUtils.cjs +5 -0
  190. package/dist/features/column-filtering/filterRowsUtils.cjs.map +1 -1
  191. package/dist/features/column-filtering/filterRowsUtils.js +5 -0
  192. package/dist/features/column-filtering/filterRowsUtils.js.map +1 -1
  193. package/dist/features/column-grouping/columnGroupingFeature.cjs +9 -1
  194. package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
  195. package/dist/features/column-grouping/columnGroupingFeature.d.cts +9 -1
  196. package/dist/features/column-grouping/columnGroupingFeature.d.ts +9 -1
  197. package/dist/features/column-grouping/columnGroupingFeature.js +9 -1
  198. package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
  199. package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +7 -3
  200. package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +7 -3
  201. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +151 -0
  202. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
  203. package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +151 -0
  204. package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +151 -0
  205. package/dist/features/column-grouping/columnGroupingFeature.utils.js +151 -0
  206. package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
  207. package/dist/features/column-grouping/createGroupedRowModel.cjs +5 -0
  208. package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
  209. package/dist/features/column-grouping/createGroupedRowModel.d.cts +5 -0
  210. package/dist/features/column-grouping/createGroupedRowModel.d.ts +5 -0
  211. package/dist/features/column-grouping/createGroupedRowModel.js +5 -0
  212. package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
  213. package/dist/features/column-ordering/columnOrderingFeature.cjs +12 -3
  214. package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
  215. package/dist/features/column-ordering/columnOrderingFeature.d.cts +9 -1
  216. package/dist/features/column-ordering/columnOrderingFeature.d.ts +9 -1
  217. package/dist/features/column-ordering/columnOrderingFeature.js +12 -3
  218. package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
  219. package/dist/features/column-ordering/columnOrderingFeature.types.d.cts +4 -2
  220. package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +4 -2
  221. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs +98 -8
  222. package/dist/features/column-ordering/columnOrderingFeature.utils.cjs.map +1 -1
  223. package/dist/features/column-ordering/columnOrderingFeature.utils.d.cts +81 -0
  224. package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +81 -0
  225. package/dist/features/column-ordering/columnOrderingFeature.utils.js +98 -8
  226. package/dist/features/column-ordering/columnOrderingFeature.utils.js.map +1 -1
  227. package/dist/features/column-pinning/columnPinningFeature.cjs +17 -30
  228. package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
  229. package/dist/features/column-pinning/columnPinningFeature.d.cts +9 -1
  230. package/dist/features/column-pinning/columnPinningFeature.d.ts +9 -1
  231. package/dist/features/column-pinning/columnPinningFeature.js +17 -30
  232. package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
  233. package/dist/features/column-pinning/columnPinningFeature.types.d.cts +6 -2
  234. package/dist/features/column-pinning/columnPinningFeature.types.d.ts +6 -2
  235. package/dist/features/column-pinning/columnPinningFeature.utils.cjs +360 -17
  236. package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
  237. package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +314 -3
  238. package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +314 -3
  239. package/dist/features/column-pinning/columnPinningFeature.utils.js +361 -18
  240. package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
  241. package/dist/features/column-resizing/columnResizingFeature.cjs +9 -2
  242. package/dist/features/column-resizing/columnResizingFeature.cjs.map +1 -1
  243. package/dist/features/column-resizing/columnResizingFeature.d.cts +9 -2
  244. package/dist/features/column-resizing/columnResizingFeature.d.ts +9 -2
  245. package/dist/features/column-resizing/columnResizingFeature.js +9 -2
  246. package/dist/features/column-resizing/columnResizingFeature.js.map +1 -1
  247. package/dist/features/column-resizing/columnResizingFeature.types.d.cts +14 -6
  248. package/dist/features/column-resizing/columnResizingFeature.types.d.ts +14 -6
  249. package/dist/features/column-resizing/columnResizingFeature.utils.cjs +81 -0
  250. package/dist/features/column-resizing/columnResizingFeature.utils.cjs.map +1 -1
  251. package/dist/features/column-resizing/columnResizingFeature.utils.d.cts +81 -0
  252. package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +81 -0
  253. package/dist/features/column-resizing/columnResizingFeature.utils.js +81 -0
  254. package/dist/features/column-resizing/columnResizingFeature.utils.js.map +1 -1
  255. package/dist/features/column-sizing/columnSizingFeature.cjs +50 -12
  256. package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
  257. package/dist/features/column-sizing/columnSizingFeature.d.cts +10 -2
  258. package/dist/features/column-sizing/columnSizingFeature.d.ts +10 -2
  259. package/dist/features/column-sizing/columnSizingFeature.js +51 -13
  260. package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
  261. package/dist/features/column-sizing/columnSizingFeature.types.d.cts +6 -3
  262. package/dist/features/column-sizing/columnSizingFeature.types.d.ts +6 -3
  263. package/dist/features/column-sizing/columnSizingFeature.utils.cjs +151 -3
  264. package/dist/features/column-sizing/columnSizingFeature.utils.cjs.map +1 -1
  265. package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +141 -0
  266. package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +141 -0
  267. package/dist/features/column-sizing/columnSizingFeature.utils.js +151 -3
  268. package/dist/features/column-sizing/columnSizingFeature.utils.js.map +1 -1
  269. package/dist/features/column-visibility/columnVisibilityFeature.cjs +26 -25
  270. package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
  271. package/dist/features/column-visibility/columnVisibilityFeature.d.cts +9 -1
  272. package/dist/features/column-visibility/columnVisibilityFeature.d.ts +9 -1
  273. package/dist/features/column-visibility/columnVisibilityFeature.js +27 -26
  274. package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
  275. package/dist/features/column-visibility/columnVisibilityFeature.types.d.cts +4 -3
  276. package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +4 -3
  277. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs +172 -12
  278. package/dist/features/column-visibility/columnVisibilityFeature.utils.cjs.map +1 -1
  279. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.cts +143 -3
  280. package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +143 -3
  281. package/dist/features/column-visibility/columnVisibilityFeature.utils.js +173 -12
  282. package/dist/features/column-visibility/columnVisibilityFeature.utils.js.map +1 -1
  283. package/dist/features/global-filtering/globalFilteringFeature.cjs +9 -2
  284. package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
  285. package/dist/features/global-filtering/globalFilteringFeature.d.cts +9 -2
  286. package/dist/features/global-filtering/globalFilteringFeature.d.ts +9 -2
  287. package/dist/features/global-filtering/globalFilteringFeature.js +9 -2
  288. package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
  289. package/dist/features/global-filtering/globalFilteringFeature.types.d.cts +4 -2
  290. package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +4 -2
  291. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +51 -0
  292. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
  293. package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +51 -0
  294. package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +51 -0
  295. package/dist/features/global-filtering/globalFilteringFeature.utils.js +51 -0
  296. package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
  297. package/dist/features/row-expanding/createExpandedRowModel.cjs +10 -0
  298. package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
  299. package/dist/features/row-expanding/createExpandedRowModel.d.cts +10 -0
  300. package/dist/features/row-expanding/createExpandedRowModel.d.ts +10 -0
  301. package/dist/features/row-expanding/createExpandedRowModel.js +10 -0
  302. package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
  303. package/dist/features/row-expanding/rowExpandingFeature.cjs +9 -1
  304. package/dist/features/row-expanding/rowExpandingFeature.cjs.map +1 -1
  305. package/dist/features/row-expanding/rowExpandingFeature.d.cts +9 -1
  306. package/dist/features/row-expanding/rowExpandingFeature.d.ts +9 -1
  307. package/dist/features/row-expanding/rowExpandingFeature.js +9 -1
  308. package/dist/features/row-expanding/rowExpandingFeature.js.map +1 -1
  309. package/dist/features/row-expanding/rowExpandingFeature.types.d.cts +10 -5
  310. package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +10 -5
  311. package/dist/features/row-expanding/rowExpandingFeature.utils.cjs +151 -0
  312. package/dist/features/row-expanding/rowExpandingFeature.utils.cjs.map +1 -1
  313. package/dist/features/row-expanding/rowExpandingFeature.utils.d.cts +151 -0
  314. package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +151 -0
  315. package/dist/features/row-expanding/rowExpandingFeature.utils.js +151 -0
  316. package/dist/features/row-expanding/rowExpandingFeature.utils.js.map +1 -1
  317. package/dist/features/row-pagination/createPaginatedRowModel.cjs +5 -0
  318. package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
  319. package/dist/features/row-pagination/createPaginatedRowModel.d.cts +5 -0
  320. package/dist/features/row-pagination/createPaginatedRowModel.d.ts +5 -0
  321. package/dist/features/row-pagination/createPaginatedRowModel.js +5 -0
  322. package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
  323. package/dist/features/row-pagination/rowPaginationFeature.cjs +9 -1
  324. package/dist/features/row-pagination/rowPaginationFeature.cjs.map +1 -1
  325. package/dist/features/row-pagination/rowPaginationFeature.d.cts +9 -1
  326. package/dist/features/row-pagination/rowPaginationFeature.d.ts +9 -1
  327. package/dist/features/row-pagination/rowPaginationFeature.js +9 -1
  328. package/dist/features/row-pagination/rowPaginationFeature.js.map +1 -1
  329. package/dist/features/row-pagination/rowPaginationFeature.types.d.cts +11 -7
  330. package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +11 -7
  331. package/dist/features/row-pagination/rowPaginationFeature.utils.cjs +175 -0
  332. package/dist/features/row-pagination/rowPaginationFeature.utils.cjs.map +1 -1
  333. package/dist/features/row-pagination/rowPaginationFeature.utils.d.cts +175 -0
  334. package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +175 -0
  335. package/dist/features/row-pagination/rowPaginationFeature.utils.js +175 -0
  336. package/dist/features/row-pagination/rowPaginationFeature.utils.js.map +1 -1
  337. package/dist/features/row-pinning/rowPinningFeature.cjs +9 -1
  338. package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
  339. package/dist/features/row-pinning/rowPinningFeature.d.cts +9 -1
  340. package/dist/features/row-pinning/rowPinningFeature.d.ts +9 -1
  341. package/dist/features/row-pinning/rowPinningFeature.js +9 -1
  342. package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
  343. package/dist/features/row-pinning/rowPinningFeature.types.d.cts +4 -2
  344. package/dist/features/row-pinning/rowPinningFeature.types.d.ts +4 -2
  345. package/dist/features/row-pinning/rowPinningFeature.utils.cjs +112 -0
  346. package/dist/features/row-pinning/rowPinningFeature.utils.cjs.map +1 -1
  347. package/dist/features/row-pinning/rowPinningFeature.utils.d.cts +112 -0
  348. package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +112 -0
  349. package/dist/features/row-pinning/rowPinningFeature.utils.js +112 -0
  350. package/dist/features/row-pinning/rowPinningFeature.utils.js.map +1 -1
  351. package/dist/features/row-selection/rowSelectionFeature.cjs +9 -1
  352. package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
  353. package/dist/features/row-selection/rowSelectionFeature.d.cts +9 -1
  354. package/dist/features/row-selection/rowSelectionFeature.d.ts +9 -1
  355. package/dist/features/row-selection/rowSelectionFeature.js +9 -1
  356. package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
  357. package/dist/features/row-selection/rowSelectionFeature.types.d.cts +4 -2
  358. package/dist/features/row-selection/rowSelectionFeature.types.d.ts +4 -2
  359. package/dist/features/row-selection/rowSelectionFeature.utils.cjs +259 -0
  360. package/dist/features/row-selection/rowSelectionFeature.utils.cjs.map +1 -1
  361. package/dist/features/row-selection/rowSelectionFeature.utils.d.cts +259 -0
  362. package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +259 -0
  363. package/dist/features/row-selection/rowSelectionFeature.utils.js +259 -0
  364. package/dist/features/row-selection/rowSelectionFeature.utils.js.map +1 -1
  365. package/dist/features/row-sorting/createSortedRowModel.cjs +5 -0
  366. package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
  367. package/dist/features/row-sorting/createSortedRowModel.d.cts +5 -0
  368. package/dist/features/row-sorting/createSortedRowModel.d.ts +5 -0
  369. package/dist/features/row-sorting/createSortedRowModel.js +5 -0
  370. package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
  371. package/dist/features/row-sorting/rowSortingFeature.cjs +11 -3
  372. package/dist/features/row-sorting/rowSortingFeature.cjs.map +1 -1
  373. package/dist/features/row-sorting/rowSortingFeature.d.cts +9 -1
  374. package/dist/features/row-sorting/rowSortingFeature.d.ts +9 -1
  375. package/dist/features/row-sorting/rowSortingFeature.js +11 -3
  376. package/dist/features/row-sorting/rowSortingFeature.js.map +1 -1
  377. package/dist/features/row-sorting/rowSortingFeature.types.d.cts +7 -3
  378. package/dist/features/row-sorting/rowSortingFeature.types.d.ts +7 -3
  379. package/dist/features/row-sorting/rowSortingFeature.utils.cjs +151 -0
  380. package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
  381. package/dist/features/row-sorting/rowSortingFeature.utils.d.cts +151 -0
  382. package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +151 -0
  383. package/dist/features/row-sorting/rowSortingFeature.utils.js +151 -0
  384. package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
  385. package/dist/features/stockFeatures.cjs +5 -0
  386. package/dist/features/stockFeatures.cjs.map +1 -1
  387. package/dist/features/stockFeatures.d.cts +5 -0
  388. package/dist/features/stockFeatures.d.ts +5 -0
  389. package/dist/features/stockFeatures.js +5 -0
  390. package/dist/features/stockFeatures.js.map +1 -1
  391. package/dist/flex-render.cjs +10 -0
  392. package/dist/flex-render.cjs.map +1 -1
  393. package/dist/flex-render.d.cts +10 -0
  394. package/dist/flex-render.d.ts +10 -0
  395. package/dist/flex-render.js +10 -0
  396. package/dist/flex-render.js.map +1 -1
  397. package/dist/fns/aggregationFns.cjs +5 -0
  398. package/dist/fns/aggregationFns.cjs.map +1 -1
  399. package/dist/fns/aggregationFns.d.cts +5 -0
  400. package/dist/fns/aggregationFns.d.ts +5 -0
  401. package/dist/fns/aggregationFns.js +5 -0
  402. package/dist/fns/aggregationFns.js.map +1 -1
  403. package/dist/fns/filterFns.cjs +5 -0
  404. package/dist/fns/filterFns.cjs.map +1 -1
  405. package/dist/fns/filterFns.d.cts +5 -0
  406. package/dist/fns/filterFns.d.ts +5 -0
  407. package/dist/fns/filterFns.js +5 -0
  408. package/dist/fns/filterFns.js.map +1 -1
  409. package/dist/fns/sortFns.cjs +49 -4
  410. package/dist/fns/sortFns.cjs.map +1 -1
  411. package/dist/fns/sortFns.d.cts +41 -0
  412. package/dist/fns/sortFns.d.ts +41 -0
  413. package/dist/fns/sortFns.js +49 -4
  414. package/dist/fns/sortFns.js.map +1 -1
  415. package/dist/helpers/columnHelper.cjs.map +1 -1
  416. package/dist/helpers/columnHelper.js.map +1 -1
  417. package/dist/helpers/tableFeatures.cjs.map +1 -1
  418. package/dist/helpers/tableFeatures.js.map +1 -1
  419. package/dist/helpers/tableOptions.cjs +6 -0
  420. package/dist/helpers/tableOptions.cjs.map +1 -1
  421. package/dist/helpers/tableOptions.d.cts +26 -0
  422. package/dist/helpers/tableOptions.d.ts +26 -0
  423. package/dist/helpers/tableOptions.js +6 -0
  424. package/dist/helpers/tableOptions.js.map +1 -1
  425. package/dist/reactivity.cjs +1 -3
  426. package/dist/reactivity.d.cts +1 -2
  427. package/dist/reactivity.d.ts +1 -2
  428. package/dist/reactivity.js +1 -2
  429. package/dist/static-functions.cjs +2 -1
  430. package/dist/static-functions.d.cts +4 -4
  431. package/dist/static-functions.d.ts +4 -4
  432. package/dist/static-functions.js +4 -4
  433. package/dist/store-reactivity-bindings.cjs +36 -0
  434. package/dist/store-reactivity-bindings.cjs.map +1 -0
  435. package/dist/store-reactivity-bindings.d.cts +22 -0
  436. package/dist/store-reactivity-bindings.d.ts +22 -0
  437. package/dist/store-reactivity-bindings.js +35 -0
  438. package/dist/store-reactivity-bindings.js.map +1 -0
  439. package/dist/utils.cjs +45 -0
  440. package/dist/utils.cjs.map +1 -1
  441. package/dist/utils.d.cts +45 -0
  442. package/dist/utils.d.ts +45 -0
  443. package/dist/utils.js +45 -0
  444. package/dist/utils.js.map +1 -1
  445. package/package.json +5 -1
  446. package/src/core/cells/constructCell.ts +5 -0
  447. package/src/core/cells/coreCellsFeature.ts +5 -0
  448. package/src/core/cells/coreCellsFeature.utils.ts +30 -0
  449. package/src/core/columns/constructColumn.ts +7 -1
  450. package/src/core/columns/coreColumnsFeature.ts +10 -0
  451. package/src/core/columns/coreColumnsFeature.types.ts +4 -0
  452. package/src/core/columns/coreColumnsFeature.utils.ts +109 -8
  453. package/src/core/coreFeatures.ts +5 -0
  454. package/src/core/headers/buildHeaderGroups.ts +7 -1
  455. package/src/core/headers/constructHeader.ts +5 -0
  456. package/src/core/headers/coreHeadersFeature.ts +5 -0
  457. package/src/core/headers/coreHeadersFeature.utils.ts +86 -8
  458. package/src/core/reactivity/coreReactivityFeature.types.ts +1 -0
  459. package/src/core/reactivity/coreReactivityFeature.utils.ts +15 -0
  460. package/src/core/row-models/coreRowModelsFeature.ts +5 -0
  461. package/src/core/row-models/coreRowModelsFeature.types.ts +2 -1
  462. package/src/core/row-models/coreRowModelsFeature.utils.ts +120 -0
  463. package/src/core/row-models/createCoreRowModel.ts +5 -0
  464. package/src/core/rows/constructRow.ts +5 -0
  465. package/src/core/rows/coreRowsFeature.ts +5 -0
  466. package/src/core/rows/coreRowsFeature.types.ts +3 -0
  467. package/src/core/rows/coreRowsFeature.utils.ts +106 -7
  468. package/src/core/table/constructTable.ts +37 -19
  469. package/src/core/table/coreTablesFeature.ts +5 -0
  470. package/src/core/table/coreTablesFeature.types.ts +23 -10
  471. package/src/core/table/coreTablesFeature.utils.ts +74 -1
  472. package/src/features/column-faceting/columnFacetingFeature.ts +9 -1
  473. package/src/features/column-faceting/columnFacetingFeature.types.ts +12 -6
  474. package/src/features/column-faceting/columnFacetingFeature.utils.ts +60 -0
  475. package/src/features/column-faceting/createFacetedMinMaxValues.ts +5 -0
  476. package/src/features/column-faceting/createFacetedRowModel.ts +5 -0
  477. package/src/features/column-faceting/createFacetedUniqueValues.ts +5 -0
  478. package/src/features/column-filtering/columnFilteringFeature.ts +10 -2
  479. package/src/features/column-filtering/columnFilteringFeature.types.ts +7 -4
  480. package/src/features/column-filtering/columnFilteringFeature.utils.ts +113 -2
  481. package/src/features/column-filtering/createFilteredRowModel.ts +5 -0
  482. package/src/features/column-filtering/filterRowsUtils.ts +5 -0
  483. package/src/features/column-grouping/columnGroupingFeature.ts +9 -1
  484. package/src/features/column-grouping/columnGroupingFeature.types.ts +7 -3
  485. package/src/features/column-grouping/columnGroupingFeature.utils.ts +151 -0
  486. package/src/features/column-grouping/createGroupedRowModel.ts +5 -0
  487. package/src/features/column-ordering/columnOrderingFeature.ts +10 -1
  488. package/src/features/column-ordering/columnOrderingFeature.types.ts +4 -2
  489. package/src/features/column-ordering/columnOrderingFeature.utils.ts +110 -18
  490. package/src/features/column-pinning/columnPinningFeature.ts +11 -12
  491. package/src/features/column-pinning/columnPinningFeature.types.ts +6 -2
  492. package/src/features/column-pinning/columnPinningFeature.utils.ts +390 -57
  493. package/src/features/column-resizing/columnResizingFeature.ts +9 -2
  494. package/src/features/column-resizing/columnResizingFeature.types.ts +14 -6
  495. package/src/features/column-resizing/columnResizingFeature.utils.ts +81 -0
  496. package/src/features/column-sizing/columnSizingFeature.ts +38 -18
  497. package/src/features/column-sizing/columnSizingFeature.types.ts +6 -3
  498. package/src/features/column-sizing/columnSizingFeature.utils.ts +168 -9
  499. package/src/features/column-visibility/columnVisibilityFeature.ts +15 -21
  500. package/src/features/column-visibility/columnVisibilityFeature.types.ts +4 -3
  501. package/src/features/column-visibility/columnVisibilityFeature.utils.ts +179 -23
  502. package/src/features/global-filtering/globalFilteringFeature.ts +9 -2
  503. package/src/features/global-filtering/globalFilteringFeature.types.ts +4 -2
  504. package/src/features/global-filtering/globalFilteringFeature.utils.ts +51 -0
  505. package/src/features/row-expanding/createExpandedRowModel.ts +10 -0
  506. package/src/features/row-expanding/rowExpandingFeature.ts +9 -1
  507. package/src/features/row-expanding/rowExpandingFeature.types.ts +10 -5
  508. package/src/features/row-expanding/rowExpandingFeature.utils.ts +151 -0
  509. package/src/features/row-pagination/createPaginatedRowModel.ts +5 -0
  510. package/src/features/row-pagination/rowPaginationFeature.ts +9 -1
  511. package/src/features/row-pagination/rowPaginationFeature.types.ts +11 -7
  512. package/src/features/row-pagination/rowPaginationFeature.utils.ts +175 -0
  513. package/src/features/row-pinning/rowPinningFeature.ts +9 -1
  514. package/src/features/row-pinning/rowPinningFeature.types.ts +4 -2
  515. package/src/features/row-pinning/rowPinningFeature.utils.ts +112 -0
  516. package/src/features/row-selection/rowSelectionFeature.ts +9 -1
  517. package/src/features/row-selection/rowSelectionFeature.types.ts +4 -2
  518. package/src/features/row-selection/rowSelectionFeature.utils.ts +259 -0
  519. package/src/features/row-sorting/createSortedRowModel.ts +5 -0
  520. package/src/features/row-sorting/rowSortingFeature.ts +11 -3
  521. package/src/features/row-sorting/rowSortingFeature.types.ts +7 -3
  522. package/src/features/row-sorting/rowSortingFeature.utils.ts +151 -0
  523. package/src/features/stockFeatures.ts +5 -0
  524. package/src/flex-render.ts +10 -0
  525. package/src/fns/aggregationFns.ts +5 -0
  526. package/src/fns/filterFns.ts +5 -0
  527. package/src/fns/sortFns.ts +50 -5
  528. package/src/helpers/tableOptions.ts +32 -0
  529. package/src/reactivity.ts +0 -1
  530. package/src/store-reactivity-bindings.ts +35 -0
  531. package/src/types/Table.ts +1 -1
  532. package/src/utils.ts +45 -0
  533. package/dist/core/reactivity/constructReactivityBindings.cjs +0 -19
  534. package/dist/core/reactivity/constructReactivityBindings.cjs.map +0 -1
  535. package/dist/core/reactivity/constructReactivityBindings.d.cts +0 -7
  536. package/dist/core/reactivity/constructReactivityBindings.d.ts +0 -7
  537. package/dist/core/reactivity/constructReactivityBindings.js +0 -19
  538. package/dist/core/reactivity/constructReactivityBindings.js.map +0 -1
  539. package/src/core/reactivity/constructReactivityBindings.ts +0 -19
@@ -1,64 +1,225 @@
1
1
  import { callMemoOrStaticFn, cloneState } from "../../utils.js";
2
+ import { getDefaultColumnPinningState } from "../column-pinning/columnPinningFeature.utils.js";
2
3
 
3
4
  //#region src/features/column-visibility/columnVisibilityFeature.utils.ts
5
+ /**
6
+ * Returns the default column visibility state.
7
+ *
8
+ * Feature constructors use this value to initialize the table state or option defaults when no user value is provided.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const initialValue = getDefaultColumnVisibilityState()
13
+ * ```
14
+ */
4
15
  function getDefaultColumnVisibilityState() {
5
16
  return {};
6
17
  }
18
+ /**
19
+ * Toggles visibility for a column.
20
+ *
21
+ * The update is applied through the owning table state slice and respects the feature options for that column.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * column_toggleVisibility(column)
26
+ * ```
27
+ */
7
28
  function column_toggleVisibility(column, visible) {
8
29
  if (column_getCanHide(column)) table_setColumnVisibility(column.table, (old) => ({
9
30
  ...old,
10
31
  [column.id]: visible ?? !callMemoOrStaticFn(column, "getIsVisible", column_getIsVisible)
11
32
  }));
12
33
  }
34
+ /**
35
+ * Returns is visible for a column.
36
+ *
37
+ * This derives the value from the column definition, table options, and the feature state atoms registered on the table.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const value = column_getIsVisible(column)
42
+ * ```
43
+ */
13
44
  function column_getIsVisible(column) {
14
45
  var _column$table$atoms$c;
15
46
  const childColumns = column.columns;
16
47
  return (childColumns.length ? childColumns.some((childColumn) => callMemoOrStaticFn(childColumn, "getIsVisible", column_getIsVisible)) : (_column$table$atoms$c = column.table.atoms.columnVisibility) === null || _column$table$atoms$c === void 0 || (_column$table$atoms$c = _column$table$atoms$c.get()) === null || _column$table$atoms$c === void 0 ? void 0 : _column$table$atoms$c[column.id]) ?? true;
17
48
  }
49
+ /**
50
+ * Returns whether a column can use hide.
51
+ *
52
+ * This combines column options, table options, and any required accessor or feature state for the capability.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const value = column_getCanHide(column)
57
+ * ```
58
+ */
18
59
  function column_getCanHide(column) {
19
60
  return (column.columnDef.enableHiding ?? true) && (column.table.options.enableHiding ?? true);
20
61
  }
62
+ /**
63
+ * Returns an event handler for toggling visibility handler.
64
+ *
65
+ * The handler is intended for direct use in column header controls such as buttons or checkboxes.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * const value = column_getToggleVisibilityHandler(column)
70
+ * ```
71
+ */
21
72
  function column_getToggleVisibilityHandler(column) {
22
73
  return (e) => {
23
74
  column_toggleVisibility(column, e.target.checked);
24
75
  };
25
76
  }
26
- function row_getAllVisibleCells(row) {
27
- return row.getAllCells().filter((cell) => callMemoOrStaticFn(cell.column, "getIsVisible", column_getIsVisible));
28
- }
29
- function row_getVisibleCells(left, center, right) {
77
+ /**
78
+ * Returns visible cells for a row.
79
+ *
80
+ * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const value = row_getVisibleCells(row)
85
+ * ```
86
+ */
87
+ function row_getVisibleCells(row) {
88
+ var _row$table$atoms$colu;
89
+ const cells = row.getAllCells().filter((cell) => callMemoOrStaticFn(cell.column, "getIsVisible", column_getIsVisible));
90
+ const { left, right } = ((_row$table$atoms$colu = row.table.atoms.columnPinning) === null || _row$table$atoms$colu === void 0 ? void 0 : _row$table$atoms$colu.get()) ?? getDefaultColumnPinningState();
91
+ if (!left.length && !right.length) return cells;
92
+ const cellsByColumnId = /* @__PURE__ */ new Map();
93
+ for (const cell of cells) cellsByColumnId.set(cell.column.id, cell);
94
+ const leftCells = [];
95
+ for (const columnId of left) {
96
+ const cell = cellsByColumnId.get(columnId);
97
+ if (cell) leftCells.push(cell);
98
+ }
99
+ const rightCells = [];
100
+ for (const columnId of right) {
101
+ const cell = cellsByColumnId.get(columnId);
102
+ if (cell) rightCells.push(cell);
103
+ }
104
+ const leftSet = new Set(left);
105
+ const rightSet = new Set(right);
106
+ const centerCells = [];
107
+ for (const cell of cells) {
108
+ const id = cell.column.id;
109
+ if (!leftSet.has(id) && !rightSet.has(id)) centerCells.push(cell);
110
+ }
30
111
  return [
31
- ...left,
32
- ...center,
33
- ...right
112
+ ...leftCells,
113
+ ...centerCells,
114
+ ...rightCells
34
115
  ];
35
116
  }
117
+ /**
118
+ * Returns visible flat columns for the table.
119
+ *
120
+ * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
121
+ *
122
+ * @example
123
+ * ```ts
124
+ * const value = table_getVisibleFlatColumns(table)
125
+ * ```
126
+ */
36
127
  function table_getVisibleFlatColumns(table) {
37
128
  return table.getAllFlatColumns().filter((column) => callMemoOrStaticFn(column, "getIsVisible", column_getIsVisible));
38
129
  }
130
+ /**
131
+ * Returns visible leaf columns for the table.
132
+ *
133
+ * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
134
+ *
135
+ * @example
136
+ * ```ts
137
+ * const value = table_getVisibleLeafColumns(table)
138
+ * ```
139
+ */
39
140
  function table_getVisibleLeafColumns(table) {
40
141
  return table.getAllLeafColumns().filter((column) => callMemoOrStaticFn(column, "getIsVisible", column_getIsVisible));
41
142
  }
143
+ /**
144
+ * Updates the table's column visibility state slice.
145
+ *
146
+ * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
147
+ *
148
+ * @example
149
+ * ```ts
150
+ * table_setColumnVisibility(table, (old) => old)
151
+ * ```
152
+ */
42
153
  function table_setColumnVisibility(table, updater) {
43
154
  var _table$options$onColu, _table$options;
44
155
  (_table$options$onColu = (_table$options = table.options).onColumnVisibilityChange) === null || _table$options$onColu === void 0 || _table$options$onColu.call(_table$options, updater);
45
156
  }
157
+ /**
158
+ * Resets the table's column visibility state slice.
159
+ *
160
+ * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
161
+ *
162
+ * @example
163
+ * ```ts
164
+ * table_resetColumnVisibility(table)
165
+ * table_resetColumnVisibility(table, true)
166
+ * ```
167
+ */
46
168
  function table_resetColumnVisibility(table, defaultState) {
47
169
  table_setColumnVisibility(table, defaultState ? {} : cloneState(table.initialState.columnVisibility ?? {}));
48
170
  }
171
+ /**
172
+ * Toggles all columns visible for the table.
173
+ *
174
+ * This is the table-level convenience API used by UI controls that affect many columns or rows at once.
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * table_toggleAllColumnsVisible(table)
179
+ * ```
180
+ */
49
181
  function table_toggleAllColumnsVisible(table, value) {
50
182
  value = value ?? !table_getIsAllColumnsVisible(table);
51
- table_setColumnVisibility(table, table.getAllLeafColumns().reduce((obj, column) => ({
52
- ...obj,
53
- [column.id]: !value ? !column_getCanHide(column) : value
54
- }), {}));
183
+ const visibility = {};
184
+ for (const column of table.getAllLeafColumns()) visibility[column.id] = !value ? !column_getCanHide(column) : value;
185
+ table_setColumnVisibility(table, visibility);
55
186
  }
187
+ /**
188
+ * Returns is all columns visible for the table.
189
+ *
190
+ * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
191
+ *
192
+ * @example
193
+ * ```ts
194
+ * const value = table_getIsAllColumnsVisible(table)
195
+ * ```
196
+ */
56
197
  function table_getIsAllColumnsVisible(table) {
57
198
  return !table.getAllLeafColumns().some((column) => !callMemoOrStaticFn(column, "getIsVisible", column_getIsVisible));
58
199
  }
200
+ /**
201
+ * Returns is some columns visible for the table.
202
+ *
203
+ * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
204
+ *
205
+ * @example
206
+ * ```ts
207
+ * const value = table_getIsSomeColumnsVisible(table)
208
+ * ```
209
+ */
59
210
  function table_getIsSomeColumnsVisible(table) {
60
211
  return table.getAllLeafColumns().some((column) => callMemoOrStaticFn(column, "getIsVisible", column_getIsVisible));
61
212
  }
213
+ /**
214
+ * Returns an event handler for all columns visibility handler.
215
+ *
216
+ * The handler calls the matching table toggle API and can be attached directly to checkbox or button UI.
217
+ *
218
+ * @example
219
+ * ```ts
220
+ * const value = table_getToggleAllColumnsVisibilityHandler(table)
221
+ * ```
222
+ */
62
223
  function table_getToggleAllColumnsVisibilityHandler(table) {
63
224
  return (e) => {
64
225
  table_toggleAllColumnsVisible(table, e.target.checked);
@@ -66,5 +227,5 @@ function table_getToggleAllColumnsVisibilityHandler(table) {
66
227
  }
67
228
 
68
229
  //#endregion
69
- export { column_getCanHide, column_getIsVisible, column_getToggleVisibilityHandler, column_toggleVisibility, getDefaultColumnVisibilityState, row_getAllVisibleCells, row_getVisibleCells, table_getIsAllColumnsVisible, table_getIsSomeColumnsVisible, table_getToggleAllColumnsVisibilityHandler, table_getVisibleFlatColumns, table_getVisibleLeafColumns, table_resetColumnVisibility, table_setColumnVisibility, table_toggleAllColumnsVisible };
230
+ export { column_getCanHide, column_getIsVisible, column_getToggleVisibilityHandler, column_toggleVisibility, getDefaultColumnVisibilityState, row_getVisibleCells, table_getIsAllColumnsVisible, table_getIsSomeColumnsVisible, table_getToggleAllColumnsVisibilityHandler, table_getVisibleFlatColumns, table_getVisibleLeafColumns, table_resetColumnVisibility, table_setColumnVisibility, table_toggleAllColumnsVisible };
70
231
  //# sourceMappingURL=columnVisibilityFeature.utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"columnVisibilityFeature.utils.js","names":[],"sources":["../../../src/features/column-visibility/columnVisibilityFeature.utils.ts"],"sourcesContent":["import { callMemoOrStaticFn, cloneState } from '../../utils'\nimport type { CellData, RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { Cell } from '../../types/Cell'\nimport type { Column_Internal } from '../../types/Column'\nimport type { ColumnVisibilityState } from './columnVisibilityFeature.types'\nimport type { Row } from '../../types/Row'\n\nexport function getDefaultColumnVisibilityState(): ColumnVisibilityState {\n return {}\n}\n\nexport function column_toggleVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>, visible?: boolean): void {\n if (column_getCanHide(column)) {\n table_setColumnVisibility(column.table, (old) => ({\n ...old,\n [column.id]:\n visible ??\n !callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n }))\n }\n}\n\nexport function column_getIsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>): boolean {\n const childColumns = column.columns\n return (\n (childColumns.length\n ? childColumns.some((childColumn) =>\n callMemoOrStaticFn(childColumn, 'getIsVisible', column_getIsVisible),\n )\n : column.table.atoms.columnVisibility?.get()?.[column.id]) ?? true\n )\n}\n\nexport function column_getCanHide<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>) {\n return (\n (column.columnDef.enableHiding ?? true) &&\n (column.table.options.enableHiding ?? true)\n )\n}\n\nexport function column_getToggleVisibilityHandler<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>) {\n return (e: unknown) => {\n column_toggleVisibility(\n column,\n ((e as MouseEvent).target as HTMLInputElement).checked,\n )\n }\n}\n\nexport function row_getAllVisibleCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>) {\n return row\n .getAllCells()\n .filter((cell) =>\n callMemoOrStaticFn(cell.column, 'getIsVisible', column_getIsVisible),\n )\n}\n\nexport function row_getVisibleCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n left: Array<Cell<TFeatures, TData, unknown>>,\n center: Array<Cell<TFeatures, TData, unknown>>,\n right: Array<Cell<TFeatures, TData, unknown>>,\n) {\n return [...left, ...center, ...right]\n}\n\nexport function table_getVisibleFlatColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllFlatColumns()\n .filter((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\nexport function table_getVisibleLeafColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllLeafColumns()\n .filter((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\nexport function table_setColumnVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<ColumnVisibilityState>,\n) {\n table.options.onColumnVisibilityChange?.(updater)\n}\n\nexport function table_resetColumnVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n table_setColumnVisibility(\n table,\n defaultState ? {} : cloneState(table.initialState.columnVisibility ?? {}),\n )\n}\n\nexport function table_toggleAllColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, value?: boolean) {\n value = value ?? !table_getIsAllColumnsVisible(table)\n\n table_setColumnVisibility(\n table,\n table.getAllLeafColumns().reduce(\n (obj, column) => ({\n ...obj,\n [column.id]: !value ? !column_getCanHide(column) : value,\n }),\n {},\n ),\n )\n}\n\nexport function table_getIsAllColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return !table\n .getAllLeafColumns()\n .some(\n (column) =>\n !callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\nexport function table_getIsSomeColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllLeafColumns()\n .some((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\nexport function table_getToggleAllColumnsVisibilityHandler<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return (e: unknown) => {\n table_toggleAllColumnsVisible(\n table,\n ((e as MouseEvent).target as HTMLInputElement).checked,\n )\n }\n}\n"],"mappings":";;;AASA,SAAgB,kCAAyD;AACvE,QAAO,EAAE;;AAGX,SAAgB,wBAId,QAAmD,SAAyB;AAC5E,KAAI,kBAAkB,OAAO,CAC3B,2BAA0B,OAAO,QAAQ,SAAS;EAChD,GAAG;GACF,OAAO,KACN,WACA,CAAC,mBAAmB,QAAQ,gBAAgB,oBAAoB;EACnE,EAAE;;AAIP,SAAgB,oBAId,QAA4D;;CAC5D,MAAM,eAAe,OAAO;AAC5B,SACG,aAAa,SACV,aAAa,MAAM,gBACjB,mBAAmB,aAAa,gBAAgB,oBAAoB,CACrE,4BACD,OAAO,MAAM,MAAM,iHAAkB,KAAK,gFAAG,OAAO,QAAQ;;AAIpE,SAAgB,kBAId,QAAmD;AACnD,SACG,OAAO,UAAU,gBAAgB,UACjC,OAAO,MAAM,QAAQ,gBAAgB;;AAI1C,SAAgB,kCAId,QAAmD;AACnD,SAAQ,MAAe;AACrB,0BACE,QACE,EAAiB,OAA4B,QAChD;;;AAIL,SAAgB,uBAGd,KAA4B;AAC5B,QAAO,IACJ,aAAa,CACb,QAAQ,SACP,mBAAmB,KAAK,QAAQ,gBAAgB,oBAAoB,CACrE;;AAGL,SAAgB,oBAId,MACA,QACA,OACA;AACA,QAAO;EAAC,GAAG;EAAM,GAAG;EAAQ,GAAG;EAAM;;AAGvC,SAAgB,4BAGd,OAAyC;AACzC,QAAO,MACJ,mBAAmB,CACnB,QAAQ,WACP,mBAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;AAGL,SAAgB,4BAGd,OAAyC;AACzC,QAAO,MACJ,mBAAmB,CACnB,QAAQ,WACP,mBAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;AAGL,SAAgB,0BAId,OACA,SACA;;AACA,kDAAM,SAAQ,qHAA2B,QAAQ;;AAGnD,SAAgB,4BAGd,OAAyC,cAAwB;AACjE,2BACE,OACA,eAAe,EAAE,GAAG,WAAW,MAAM,aAAa,oBAAoB,EAAE,CAAC,CAC1E;;AAGH,SAAgB,8BAGd,OAAyC,OAAiB;AAC1D,SAAQ,SAAS,CAAC,6BAA6B,MAAM;AAErD,2BACE,OACA,MAAM,mBAAmB,CAAC,QACvB,KAAK,YAAY;EAChB,GAAG;GACF,OAAO,KAAK,CAAC,QAAQ,CAAC,kBAAkB,OAAO,GAAG;EACpD,GACD,EAAE,CACH,CACF;;AAGH,SAAgB,6BAGd,OAAyC;AACzC,QAAO,CAAC,MACL,mBAAmB,CACnB,MACE,WACC,CAAC,mBAAmB,QAAQ,gBAAgB,oBAAoB,CACnE;;AAGL,SAAgB,8BAGd,OAAyC;AACzC,QAAO,MACJ,mBAAmB,CACnB,MAAM,WACL,mBAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;AAGL,SAAgB,2CAGd,OAAyC;AACzC,SAAQ,MAAe;AACrB,gCACE,OACE,EAAiB,OAA4B,QAChD"}
1
+ {"version":3,"file":"columnVisibilityFeature.utils.js","names":[],"sources":["../../../src/features/column-visibility/columnVisibilityFeature.utils.ts"],"sourcesContent":["import { callMemoOrStaticFn, cloneState } from '../../utils'\nimport { getDefaultColumnPinningState } from '../column-pinning/columnPinningFeature.utils'\nimport type { CellData, RowData, Updater } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\nimport type { Cell } from '../../types/Cell'\nimport type { Column_Internal } from '../../types/Column'\nimport type { ColumnVisibilityState } from './columnVisibilityFeature.types'\nimport type { Row } from '../../types/Row'\n\n/**\n * Returns the default column visibility state.\n *\n * Feature constructors use this value to initialize the table state or option defaults when no user value is provided.\n *\n * @example\n * ```ts\n * const initialValue = getDefaultColumnVisibilityState()\n * ```\n */\nexport function getDefaultColumnVisibilityState(): ColumnVisibilityState {\n return {}\n}\n\n/**\n * Toggles visibility for a column.\n *\n * The update is applied through the owning table state slice and respects the feature options for that column.\n *\n * @example\n * ```ts\n * column_toggleVisibility(column)\n * ```\n */\nexport function column_toggleVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>, visible?: boolean): void {\n if (column_getCanHide(column)) {\n table_setColumnVisibility(column.table, (old) => ({\n ...old,\n [column.id]:\n visible ??\n !callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n }))\n }\n}\n\n/**\n * Returns is visible for a column.\n *\n * This derives the value from the column definition, table options, and the feature state atoms registered on the table.\n *\n * @example\n * ```ts\n * const value = column_getIsVisible(column)\n * ```\n */\nexport function column_getIsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>): boolean {\n const childColumns = column.columns\n return (\n (childColumns.length\n ? childColumns.some((childColumn) =>\n callMemoOrStaticFn(childColumn, 'getIsVisible', column_getIsVisible),\n )\n : column.table.atoms.columnVisibility?.get()?.[column.id]) ?? true\n )\n}\n\n/**\n * Returns whether a column can use hide.\n *\n * This combines column options, table options, and any required accessor or feature state for the capability.\n *\n * @example\n * ```ts\n * const value = column_getCanHide(column)\n * ```\n */\nexport function column_getCanHide<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>) {\n return (\n (column.columnDef.enableHiding ?? true) &&\n (column.table.options.enableHiding ?? true)\n )\n}\n\n/**\n * Returns an event handler for toggling visibility handler.\n *\n * The handler is intended for direct use in column header controls such as buttons or checkboxes.\n *\n * @example\n * ```ts\n * const value = column_getToggleVisibilityHandler(column)\n * ```\n */\nexport function column_getToggleVisibilityHandler<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>) {\n return (e: unknown) => {\n column_toggleVisibility(\n column,\n ((e as MouseEvent).target as HTMLInputElement).checked,\n )\n }\n}\n\n/**\n * Returns visible cells for a row.\n *\n * This is the static implementation behind the matching row instance API and may read row caches or table state atoms.\n *\n * @example\n * ```ts\n * const value = row_getVisibleCells(row)\n * ```\n */\nexport function row_getVisibleCells<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(row: Row<TFeatures, TData>): Array<Cell<TFeatures, TData, unknown>> {\n const cells = row\n .getAllCells()\n .filter((cell) =>\n callMemoOrStaticFn(cell.column, 'getIsVisible', column_getIsVisible),\n )\n const { left, right } =\n row.table.atoms.columnPinning?.get() ?? getDefaultColumnPinningState()\n if (!left.length && !right.length) return cells // no pinning, return early\n\n const cellsByColumnId = new Map<string, Cell<TFeatures, TData, unknown>>()\n for (const cell of cells) cellsByColumnId.set(cell.column.id, cell)\n\n const leftCells: Array<Cell<TFeatures, TData, unknown>> = []\n for (const columnId of left) {\n const cell = cellsByColumnId.get(columnId)\n if (cell) leftCells.push(cell)\n }\n\n const rightCells: Array<Cell<TFeatures, TData, unknown>> = []\n for (const columnId of right) {\n const cell = cellsByColumnId.get(columnId)\n if (cell) rightCells.push(cell)\n }\n\n // Center cells: visible cells in natural column order, minus pinned ones.\n const leftSet = new Set(left)\n const rightSet = new Set(right)\n const centerCells: Array<Cell<TFeatures, TData, unknown>> = []\n for (const cell of cells) {\n const id = cell.column.id\n if (!leftSet.has(id) && !rightSet.has(id)) centerCells.push(cell)\n }\n\n return [...leftCells, ...centerCells, ...rightCells]\n}\n\n/**\n * Returns visible flat columns for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getVisibleFlatColumns(table)\n * ```\n */\nexport function table_getVisibleFlatColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllFlatColumns()\n .filter((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\n/**\n * Returns visible leaf columns for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getVisibleLeafColumns(table)\n * ```\n */\nexport function table_getVisibleLeafColumns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllLeafColumns()\n .filter((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\n/**\n * Updates the table's column visibility state slice.\n *\n * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.\n *\n * @example\n * ```ts\n * table_setColumnVisibility(table, (old) => old)\n * ```\n */\nexport function table_setColumnVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n updater: Updater<ColumnVisibilityState>,\n) {\n table.options.onColumnVisibilityChange?.(updater)\n}\n\n/**\n * Resets the table's column visibility state slice.\n *\n * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.\n *\n * @example\n * ```ts\n * table_resetColumnVisibility(table)\n * table_resetColumnVisibility(table, true)\n * ```\n */\nexport function table_resetColumnVisibility<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n table_setColumnVisibility(\n table,\n defaultState ? {} : cloneState(table.initialState.columnVisibility ?? {}),\n )\n}\n\n/**\n * Toggles all columns visible for the table.\n *\n * This is the table-level convenience API used by UI controls that affect many columns or rows at once.\n *\n * @example\n * ```ts\n * table_toggleAllColumnsVisible(table)\n * ```\n */\nexport function table_toggleAllColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, value?: boolean) {\n value = value ?? !table_getIsAllColumnsVisible(table)\n\n const visibility: Record<string, boolean> = {}\n for (const column of table.getAllLeafColumns()) {\n visibility[column.id] = !value ? !column_getCanHide(column) : value\n }\n\n table_setColumnVisibility(table, visibility)\n}\n\n/**\n * Returns is all columns visible for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getIsAllColumnsVisible(table)\n * ```\n */\nexport function table_getIsAllColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return !table\n .getAllLeafColumns()\n .some(\n (column) =>\n !callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\n/**\n * Returns is some columns visible for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getIsSomeColumnsVisible(table)\n * ```\n */\nexport function table_getIsSomeColumnsVisible<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return table\n .getAllLeafColumns()\n .some((column) =>\n callMemoOrStaticFn(column, 'getIsVisible', column_getIsVisible),\n )\n}\n\n/**\n * Returns an event handler for all columns visibility handler.\n *\n * The handler calls the matching table toggle API and can be attached directly to checkbox or button UI.\n *\n * @example\n * ```ts\n * const value = table_getToggleAllColumnsVisibilityHandler(table)\n * ```\n */\nexport function table_getToggleAllColumnsVisibilityHandler<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>) {\n return (e: unknown) => {\n table_toggleAllColumnsVisible(\n table,\n ((e as MouseEvent).target as HTMLInputElement).checked,\n )\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAAgB,kCAAyD;CACvE,OAAO,EAAE;;;;;;;;;;;;AAaX,SAAgB,wBAId,QAAmD,SAAyB;CAC5E,IAAI,kBAAkB,OAAO,EAC3B,0BAA0B,OAAO,QAAQ,SAAS;EAChD,GAAG;GACF,OAAO,KACN,WACA,CAAC,mBAAmB,QAAQ,gBAAgB,oBAAoB;EACnE,EAAE;;;;;;;;;;;;AAcP,SAAgB,oBAId,QAA4D;;CAC5D,MAAM,eAAe,OAAO;CAC5B,QACG,aAAa,SACV,aAAa,MAAM,gBACjB,mBAAmB,aAAa,gBAAgB,oBAAoB,CACrE,4BACD,OAAO,MAAM,MAAM,iHAAkB,KAAK,gFAAG,OAAO,QAAQ;;;;;;;;;;;;AAcpE,SAAgB,kBAId,QAAmD;CACnD,QACG,OAAO,UAAU,gBAAgB,UACjC,OAAO,MAAM,QAAQ,gBAAgB;;;;;;;;;;;;AAc1C,SAAgB,kCAId,QAAmD;CACnD,QAAQ,MAAe;EACrB,wBACE,QACE,EAAiB,OAA4B,QAChD;;;;;;;;;;;;;AAcL,SAAgB,oBAGd,KAAoE;;CACpE,MAAM,QAAQ,IACX,aAAa,CACb,QAAQ,SACP,mBAAmB,KAAK,QAAQ,gBAAgB,oBAAoB,CACrE;CACH,MAAM,EAAE,MAAM,oCACZ,IAAI,MAAM,MAAM,6FAAe,KAAK,KAAI,8BAA8B;CACxE,IAAI,CAAC,KAAK,UAAU,CAAC,MAAM,QAAQ,OAAO;CAE1C,MAAM,kCAAkB,IAAI,KAA8C;CAC1E,KAAK,MAAM,QAAQ,OAAO,gBAAgB,IAAI,KAAK,OAAO,IAAI,KAAK;CAEnE,MAAM,YAAoD,EAAE;CAC5D,KAAK,MAAM,YAAY,MAAM;EAC3B,MAAM,OAAO,gBAAgB,IAAI,SAAS;EAC1C,IAAI,MAAM,UAAU,KAAK,KAAK;;CAGhC,MAAM,aAAqD,EAAE;CAC7D,KAAK,MAAM,YAAY,OAAO;EAC5B,MAAM,OAAO,gBAAgB,IAAI,SAAS;EAC1C,IAAI,MAAM,WAAW,KAAK,KAAK;;CAIjC,MAAM,UAAU,IAAI,IAAI,KAAK;CAC7B,MAAM,WAAW,IAAI,IAAI,MAAM;CAC/B,MAAM,cAAsD,EAAE;CAC9D,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,KAAK,KAAK,OAAO;EACvB,IAAI,CAAC,QAAQ,IAAI,GAAG,IAAI,CAAC,SAAS,IAAI,GAAG,EAAE,YAAY,KAAK,KAAK;;CAGnE,OAAO;EAAC,GAAG;EAAW,GAAG;EAAa,GAAG;EAAW;;;;;;;;;;;;AAatD,SAAgB,4BAGd,OAAyC;CACzC,OAAO,MACJ,mBAAmB,CACnB,QAAQ,WACP,mBAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;;;;;;;;;;;AAaL,SAAgB,4BAGd,OAAyC;CACzC,OAAO,MACJ,mBAAmB,CACnB,QAAQ,WACP,mBAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;;;;;;;;;;;AAaL,SAAgB,0BAId,OACA,SACA;;CACA,iDAAM,SAAQ,qHAA2B,QAAQ;;;;;;;;;;;;;AAcnD,SAAgB,4BAGd,OAAyC,cAAwB;CACjE,0BACE,OACA,eAAe,EAAE,GAAG,WAAW,MAAM,aAAa,oBAAoB,EAAE,CAAC,CAC1E;;;;;;;;;;;;AAaH,SAAgB,8BAGd,OAAyC,OAAiB;CAC1D,QAAQ,SAAS,CAAC,6BAA6B,MAAM;CAErD,MAAM,aAAsC,EAAE;CAC9C,KAAK,MAAM,UAAU,MAAM,mBAAmB,EAC5C,WAAW,OAAO,MAAM,CAAC,QAAQ,CAAC,kBAAkB,OAAO,GAAG;CAGhE,0BAA0B,OAAO,WAAW;;;;;;;;;;;;AAa9C,SAAgB,6BAGd,OAAyC;CACzC,OAAO,CAAC,MACL,mBAAmB,CACnB,MACE,WACC,CAAC,mBAAmB,QAAQ,gBAAgB,oBAAoB,CACnE;;;;;;;;;;;;AAaL,SAAgB,8BAGd,OAAyC;CACzC,OAAO,MACJ,mBAAmB,CACnB,MAAM,WACL,mBAAmB,QAAQ,gBAAgB,oBAAoB,CAChE;;;;;;;;;;;;AAaL,SAAgB,2CAGd,OAAyC;CACzC,QAAQ,MAAe;EACrB,8BACE,OACE,EAAiB,OAA4B,QAChD"}
@@ -2,6 +2,11 @@ const require_utils = require('../../utils.cjs');
2
2
  const require_globalFilteringFeature_utils = require('./globalFilteringFeature.utils.cjs');
3
3
 
4
4
  //#region src/features/global-filtering/globalFilteringFeature.ts
5
+ /**
6
+ * Creates the stock global filtering feature.
7
+ *
8
+ * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
9
+ */
5
10
  function constructGlobalFilteringFeature() {
6
11
  return {
7
12
  getInitialState: (initialState) => {
@@ -35,8 +40,10 @@ function constructGlobalFilteringFeature() {
35
40
  };
36
41
  }
37
42
  /**
38
- * The Global Filtering feature adds global filtering state and APIs to the table and column objects.
39
- * **Note:** This is dependent on the columnFilteringFeature feature.
43
+ * The stock global filtering feature.
44
+ *
45
+ * Register this feature with column filtering support to add global filter
46
+ * state, global filter function resolution, and column eligibility APIs.
40
47
  */
41
48
  const globalFilteringFeature = constructGlobalFilteringFeature();
42
49
 
@@ -1 +1 @@
1
- {"version":3,"file":"globalFilteringFeature.cjs","names":["makeStateUpdater","column_getCanGlobalFilter","table_getGlobalAutoFilterFn","table_getGlobalFilterFn","table_setGlobalFilter","table_resetGlobalFilter"],"sources":["../../../src/features/global-filtering/globalFilteringFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n column_getCanGlobalFilter,\n table_getGlobalAutoFilterFn,\n table_getGlobalFilterFn,\n table_resetGlobalFilter,\n table_setGlobalFilter,\n} from './globalFilteringFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type {\n// ColumnDef_GlobalFiltering,\n// Column_GlobalFiltering,\n// TableOptions_GlobalFiltering,\n// TableState_GlobalFiltering,\n// Table_GlobalFiltering,\n// } from './globalFilteringFeature.types'\n\nexport interface GlobalFilteringFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Column: Column_GlobalFiltering\n // ColumnDef: ColumnDef_GlobalFiltering\n // Table: Table_GlobalFiltering<TFeatures, TData>\n // TableOptions: TableOptions_GlobalFiltering<TFeatures, TData>\n // TableState: TableState_GlobalFiltering\n}\n\nexport function constructGlobalFilteringFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<GlobalFilteringFeatureConstructors<TFeatures, TData>> {\n return {\n getInitialState: (initialState) => {\n return {\n globalFilter: undefined,\n ...initialState,\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onGlobalFilterChange: makeStateUpdater('globalFilter', table),\n globalFilterFn: 'auto',\n getColumnCanGlobalFilter: (column) => {\n const value = table\n .getCoreRowModel()\n .flatRows[0]?.getAllCellsByColumnId()\n [column.id]?.getValue()\n\n return typeof value === 'string' || typeof value === 'number'\n },\n }\n },\n\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('globalFilteringFeature', prototype, table, {\n column_getCanGlobalFilter: {\n fn: (column) => column_getCanGlobalFilter(column),\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('globalFilteringFeature', table, {\n table_getGlobalAutoFilterFn: {\n fn: () => table_getGlobalAutoFilterFn(),\n },\n table_getGlobalFilterFn: {\n fn: () => table_getGlobalFilterFn(table),\n },\n table_setGlobalFilter: {\n fn: (updater) => table_setGlobalFilter(table, updater),\n },\n table_resetGlobalFilter: {\n fn: (defaultState) => table_resetGlobalFilter(table, defaultState),\n },\n })\n },\n }\n}\n\n/**\n * The Global Filtering feature adds global filtering state and APIs to the table and column objects.\n * **Note:** This is dependent on the columnFilteringFeature feature.\n */\nexport const globalFilteringFeature = constructGlobalFilteringFeature()\n"],"mappings":";;;;AAiCA,SAAgB,kCAGwD;AACtE,QAAO;EACL,kBAAkB,iBAAiB;AACjC,UAAO;IACL,cAAc;IACd,GAAG;IACJ;;EAGH,yBAAyB,UAAU;AACjC,UAAO;IACL,sBAAsBA,+BAAiB,gBAAgB,MAAM;IAC7D,gBAAgB;IAChB,2BAA2B,WAAW;;KACpC,MAAM,iCAAQ,MACX,iBAAiB,CACjB,SAAS,mGAAI,uBAAuB,CACpC,OAAO,mFAAK,UAAU;AAEzB,YAAO,OAAO,UAAU,YAAY,OAAO,UAAU;;IAExD;;EAGH,wBAAwB,WAAW,UAAU;AAC3C,qCAAoB,0BAA0B,WAAW,OAAO,EAC9D,2BAA2B,EACzB,KAAK,WAAWC,+DAA0B,OAAO,EAClD,EACF,CAAC;;EAGJ,qBAAqB,UAAU;AAC7B,iCAAgB,0BAA0B,OAAO;IAC/C,6BAA6B,EAC3B,UAAUC,kEAA6B,EACxC;IACD,yBAAyB,EACvB,UAAUC,6DAAwB,MAAM,EACzC;IACD,uBAAuB,EACrB,KAAK,YAAYC,2DAAsB,OAAO,QAAQ,EACvD;IACD,yBAAyB,EACvB,KAAK,iBAAiBC,6DAAwB,OAAO,aAAa,EACnE;IACF,CAAC;;EAEL;;;;;;AAOH,MAAa,yBAAyB,iCAAiC"}
1
+ {"version":3,"file":"globalFilteringFeature.cjs","names":["makeStateUpdater","column_getCanGlobalFilter","table_getGlobalAutoFilterFn","table_getGlobalFilterFn","table_setGlobalFilter","table_resetGlobalFilter"],"sources":["../../../src/features/global-filtering/globalFilteringFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n column_getCanGlobalFilter,\n table_getGlobalAutoFilterFn,\n table_getGlobalFilterFn,\n table_resetGlobalFilter,\n table_setGlobalFilter,\n} from './globalFilteringFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type {\n// ColumnDef_GlobalFiltering,\n// Column_GlobalFiltering,\n// TableOptions_GlobalFiltering,\n// TableState_GlobalFiltering,\n// Table_GlobalFiltering,\n// } from './globalFilteringFeature.types'\n\nexport interface GlobalFilteringFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Column: Column_GlobalFiltering\n // ColumnDef: ColumnDef_GlobalFiltering\n // Table: Table_GlobalFiltering<TFeatures, TData>\n // TableOptions: TableOptions_GlobalFiltering<TFeatures, TData>\n // TableState: TableState_GlobalFiltering\n}\n\n/**\n * Creates the stock global filtering 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 constructGlobalFilteringFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<GlobalFilteringFeatureConstructors<TFeatures, TData>> {\n return {\n getInitialState: (initialState) => {\n return {\n globalFilter: undefined,\n ...initialState,\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onGlobalFilterChange: makeStateUpdater('globalFilter', table),\n globalFilterFn: 'auto',\n getColumnCanGlobalFilter: (column) => {\n const value = table\n .getCoreRowModel()\n .flatRows[0]?.getAllCellsByColumnId()\n [column.id]?.getValue()\n\n return typeof value === 'string' || typeof value === 'number'\n },\n }\n },\n\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('globalFilteringFeature', prototype, table, {\n column_getCanGlobalFilter: {\n fn: (column) => column_getCanGlobalFilter(column),\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('globalFilteringFeature', table, {\n table_getGlobalAutoFilterFn: {\n fn: () => table_getGlobalAutoFilterFn(),\n },\n table_getGlobalFilterFn: {\n fn: () => table_getGlobalFilterFn(table),\n },\n table_setGlobalFilter: {\n fn: (updater) => table_setGlobalFilter(table, updater),\n },\n table_resetGlobalFilter: {\n fn: (defaultState) => table_resetGlobalFilter(table, defaultState),\n },\n })\n },\n }\n}\n\n/**\n * The stock global filtering feature.\n *\n * Register this feature with column filtering support to add global filter\n * state, global filter function resolution, and column eligibility APIs.\n */\nexport const globalFilteringFeature = constructGlobalFilteringFeature()\n"],"mappings":";;;;;;;;;AAsCA,SAAgB,kCAGwD;CACtE,OAAO;EACL,kBAAkB,iBAAiB;GACjC,OAAO;IACL,cAAc;IACd,GAAG;IACJ;;EAGH,yBAAyB,UAAU;GACjC,OAAO;IACL,sBAAsBA,+BAAiB,gBAAgB,MAAM;IAC7D,gBAAgB;IAChB,2BAA2B,WAAW;;KACpC,MAAM,iCAAQ,MACX,iBAAiB,CACjB,SAAS,mGAAI,uBAAuB,CACpC,OAAO,mFAAK,UAAU;KAEzB,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU;;IAExD;;EAGH,wBAAwB,WAAW,UAAU;GAC3C,kCAAoB,0BAA0B,WAAW,OAAO,EAC9D,2BAA2B,EACzB,KAAK,WAAWC,+DAA0B,OAAO,EAClD,EACF,CAAC;;EAGJ,qBAAqB,UAAU;GAC7B,8BAAgB,0BAA0B,OAAO;IAC/C,6BAA6B,EAC3B,UAAUC,kEAA6B,EACxC;IACD,yBAAyB,EACvB,UAAUC,6DAAwB,MAAM,EACzC;IACD,uBAAuB,EACrB,KAAK,YAAYC,2DAAsB,OAAO,QAAQ,EACvD;IACD,yBAAyB,EACvB,KAAK,iBAAiBC,6DAAwB,OAAO,aAAa,EACnE;IACF,CAAC;;EAEL;;;;;;;;AASH,MAAa,yBAAyB,iCAAiC"}
@@ -3,10 +3,17 @@ import { TableFeature, TableFeatures } from "../../types/TableFeatures.cjs";
3
3
 
4
4
  //#region src/features/global-filtering/globalFilteringFeature.d.ts
5
5
  interface GlobalFilteringFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
6
+ /**
7
+ * Creates the stock global filtering feature.
8
+ *
9
+ * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
10
+ */
6
11
  declare function constructGlobalFilteringFeature<TFeatures extends TableFeatures, TData extends RowData>(): TableFeature<GlobalFilteringFeatureConstructors<TFeatures, TData>>;
7
12
  /**
8
- * The Global Filtering feature adds global filtering state and APIs to the table and column objects.
9
- * **Note:** This is dependent on the columnFilteringFeature feature.
13
+ * The stock global filtering feature.
14
+ *
15
+ * Register this feature with column filtering support to add global filter
16
+ * state, global filter function resolution, and column eligibility APIs.
10
17
  */
11
18
  declare const globalFilteringFeature: TableFeature<GlobalFilteringFeatureConstructors<TableFeatures, RowData>>;
12
19
  //#endregion
@@ -3,10 +3,17 @@ import { TableFeature, TableFeatures } from "../../types/TableFeatures.js";
3
3
 
4
4
  //#region src/features/global-filtering/globalFilteringFeature.d.ts
5
5
  interface GlobalFilteringFeatureConstructors<TFeatures extends TableFeatures, TData extends RowData> {}
6
+ /**
7
+ * Creates the stock global filtering feature.
8
+ *
9
+ * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
10
+ */
6
11
  declare function constructGlobalFilteringFeature<TFeatures extends TableFeatures, TData extends RowData>(): TableFeature<GlobalFilteringFeatureConstructors<TFeatures, TData>>;
7
12
  /**
8
- * The Global Filtering feature adds global filtering state and APIs to the table and column objects.
9
- * **Note:** This is dependent on the columnFilteringFeature feature.
13
+ * The stock global filtering feature.
14
+ *
15
+ * Register this feature with column filtering support to add global filter
16
+ * state, global filter function resolution, and column eligibility APIs.
10
17
  */
11
18
  declare const globalFilteringFeature: TableFeature<GlobalFilteringFeatureConstructors<TableFeatures, RowData>>;
12
19
  //#endregion
@@ -2,6 +2,11 @@ import { assignPrototypeAPIs, assignTableAPIs, makeStateUpdater } from "../../ut
2
2
  import { column_getCanGlobalFilter, table_getGlobalAutoFilterFn, table_getGlobalFilterFn, table_resetGlobalFilter, table_setGlobalFilter } from "./globalFilteringFeature.utils.js";
3
3
 
4
4
  //#region src/features/global-filtering/globalFilteringFeature.ts
5
+ /**
6
+ * Creates the stock global filtering feature.
7
+ *
8
+ * The returned feature registers its state defaults, option defaults, and instance APIs so it can be included in a `tableFeatures({ ... })` call.
9
+ */
5
10
  function constructGlobalFilteringFeature() {
6
11
  return {
7
12
  getInitialState: (initialState) => {
@@ -35,8 +40,10 @@ function constructGlobalFilteringFeature() {
35
40
  };
36
41
  }
37
42
  /**
38
- * The Global Filtering feature adds global filtering state and APIs to the table and column objects.
39
- * **Note:** This is dependent on the columnFilteringFeature feature.
43
+ * The stock global filtering feature.
44
+ *
45
+ * Register this feature with column filtering support to add global filter
46
+ * state, global filter function resolution, and column eligibility APIs.
40
47
  */
41
48
  const globalFilteringFeature = constructGlobalFilteringFeature();
42
49
 
@@ -1 +1 @@
1
- {"version":3,"file":"globalFilteringFeature.js","names":[],"sources":["../../../src/features/global-filtering/globalFilteringFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n column_getCanGlobalFilter,\n table_getGlobalAutoFilterFn,\n table_getGlobalFilterFn,\n table_resetGlobalFilter,\n table_setGlobalFilter,\n} from './globalFilteringFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type {\n// ColumnDef_GlobalFiltering,\n// Column_GlobalFiltering,\n// TableOptions_GlobalFiltering,\n// TableState_GlobalFiltering,\n// Table_GlobalFiltering,\n// } from './globalFilteringFeature.types'\n\nexport interface GlobalFilteringFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Column: Column_GlobalFiltering\n // ColumnDef: ColumnDef_GlobalFiltering\n // Table: Table_GlobalFiltering<TFeatures, TData>\n // TableOptions: TableOptions_GlobalFiltering<TFeatures, TData>\n // TableState: TableState_GlobalFiltering\n}\n\nexport function constructGlobalFilteringFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<GlobalFilteringFeatureConstructors<TFeatures, TData>> {\n return {\n getInitialState: (initialState) => {\n return {\n globalFilter: undefined,\n ...initialState,\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onGlobalFilterChange: makeStateUpdater('globalFilter', table),\n globalFilterFn: 'auto',\n getColumnCanGlobalFilter: (column) => {\n const value = table\n .getCoreRowModel()\n .flatRows[0]?.getAllCellsByColumnId()\n [column.id]?.getValue()\n\n return typeof value === 'string' || typeof value === 'number'\n },\n }\n },\n\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('globalFilteringFeature', prototype, table, {\n column_getCanGlobalFilter: {\n fn: (column) => column_getCanGlobalFilter(column),\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('globalFilteringFeature', table, {\n table_getGlobalAutoFilterFn: {\n fn: () => table_getGlobalAutoFilterFn(),\n },\n table_getGlobalFilterFn: {\n fn: () => table_getGlobalFilterFn(table),\n },\n table_setGlobalFilter: {\n fn: (updater) => table_setGlobalFilter(table, updater),\n },\n table_resetGlobalFilter: {\n fn: (defaultState) => table_resetGlobalFilter(table, defaultState),\n },\n })\n },\n }\n}\n\n/**\n * The Global Filtering feature adds global filtering state and APIs to the table and column objects.\n * **Note:** This is dependent on the columnFilteringFeature feature.\n */\nexport const globalFilteringFeature = constructGlobalFilteringFeature()\n"],"mappings":";;;;AAiCA,SAAgB,kCAGwD;AACtE,QAAO;EACL,kBAAkB,iBAAiB;AACjC,UAAO;IACL,cAAc;IACd,GAAG;IACJ;;EAGH,yBAAyB,UAAU;AACjC,UAAO;IACL,sBAAsB,iBAAiB,gBAAgB,MAAM;IAC7D,gBAAgB;IAChB,2BAA2B,WAAW;;KACpC,MAAM,iCAAQ,MACX,iBAAiB,CACjB,SAAS,mGAAI,uBAAuB,CACpC,OAAO,mFAAK,UAAU;AAEzB,YAAO,OAAO,UAAU,YAAY,OAAO,UAAU;;IAExD;;EAGH,wBAAwB,WAAW,UAAU;AAC3C,uBAAoB,0BAA0B,WAAW,OAAO,EAC9D,2BAA2B,EACzB,KAAK,WAAW,0BAA0B,OAAO,EAClD,EACF,CAAC;;EAGJ,qBAAqB,UAAU;AAC7B,mBAAgB,0BAA0B,OAAO;IAC/C,6BAA6B,EAC3B,UAAU,6BAA6B,EACxC;IACD,yBAAyB,EACvB,UAAU,wBAAwB,MAAM,EACzC;IACD,uBAAuB,EACrB,KAAK,YAAY,sBAAsB,OAAO,QAAQ,EACvD;IACD,yBAAyB,EACvB,KAAK,iBAAiB,wBAAwB,OAAO,aAAa,EACnE;IACF,CAAC;;EAEL;;;;;;AAOH,MAAa,yBAAyB,iCAAiC"}
1
+ {"version":3,"file":"globalFilteringFeature.js","names":[],"sources":["../../../src/features/global-filtering/globalFilteringFeature.ts"],"sourcesContent":["import {\n assignPrototypeAPIs,\n assignTableAPIs,\n makeStateUpdater,\n} from '../../utils'\nimport {\n column_getCanGlobalFilter,\n table_getGlobalAutoFilterFn,\n table_getGlobalFilterFn,\n table_resetGlobalFilter,\n table_setGlobalFilter,\n} from './globalFilteringFeature.utils'\nimport type { RowData } from '../../types/type-utils'\nimport type { TableFeature, TableFeatures } from '../../types/TableFeatures'\n// import type {\n// ColumnDef_GlobalFiltering,\n// Column_GlobalFiltering,\n// TableOptions_GlobalFiltering,\n// TableState_GlobalFiltering,\n// Table_GlobalFiltering,\n// } from './globalFilteringFeature.types'\n\nexport interface GlobalFilteringFeatureConstructors<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n // Column: Column_GlobalFiltering\n // ColumnDef: ColumnDef_GlobalFiltering\n // Table: Table_GlobalFiltering<TFeatures, TData>\n // TableOptions: TableOptions_GlobalFiltering<TFeatures, TData>\n // TableState: TableState_GlobalFiltering\n}\n\n/**\n * Creates the stock global filtering 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 constructGlobalFilteringFeature<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(): TableFeature<GlobalFilteringFeatureConstructors<TFeatures, TData>> {\n return {\n getInitialState: (initialState) => {\n return {\n globalFilter: undefined,\n ...initialState,\n }\n },\n\n getDefaultTableOptions: (table) => {\n return {\n onGlobalFilterChange: makeStateUpdater('globalFilter', table),\n globalFilterFn: 'auto',\n getColumnCanGlobalFilter: (column) => {\n const value = table\n .getCoreRowModel()\n .flatRows[0]?.getAllCellsByColumnId()\n [column.id]?.getValue()\n\n return typeof value === 'string' || typeof value === 'number'\n },\n }\n },\n\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('globalFilteringFeature', prototype, table, {\n column_getCanGlobalFilter: {\n fn: (column) => column_getCanGlobalFilter(column),\n },\n })\n },\n\n constructTableAPIs: (table) => {\n assignTableAPIs('globalFilteringFeature', table, {\n table_getGlobalAutoFilterFn: {\n fn: () => table_getGlobalAutoFilterFn(),\n },\n table_getGlobalFilterFn: {\n fn: () => table_getGlobalFilterFn(table),\n },\n table_setGlobalFilter: {\n fn: (updater) => table_setGlobalFilter(table, updater),\n },\n table_resetGlobalFilter: {\n fn: (defaultState) => table_resetGlobalFilter(table, defaultState),\n },\n })\n },\n }\n}\n\n/**\n * The stock global filtering feature.\n *\n * Register this feature with column filtering support to add global filter\n * state, global filter function resolution, and column eligibility APIs.\n */\nexport const globalFilteringFeature = constructGlobalFilteringFeature()\n"],"mappings":";;;;;;;;;AAsCA,SAAgB,kCAGwD;CACtE,OAAO;EACL,kBAAkB,iBAAiB;GACjC,OAAO;IACL,cAAc;IACd,GAAG;IACJ;;EAGH,yBAAyB,UAAU;GACjC,OAAO;IACL,sBAAsB,iBAAiB,gBAAgB,MAAM;IAC7D,gBAAgB;IAChB,2BAA2B,WAAW;;KACpC,MAAM,iCAAQ,MACX,iBAAiB,CACjB,SAAS,mGAAI,uBAAuB,CACpC,OAAO,mFAAK,UAAU;KAEzB,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU;;IAExD;;EAGH,wBAAwB,WAAW,UAAU;GAC3C,oBAAoB,0BAA0B,WAAW,OAAO,EAC9D,2BAA2B,EACzB,KAAK,WAAW,0BAA0B,OAAO,EAClD,EACF,CAAC;;EAGJ,qBAAqB,UAAU;GAC7B,gBAAgB,0BAA0B,OAAO;IAC/C,6BAA6B,EAC3B,UAAU,6BAA6B,EACxC;IACD,yBAAyB,EACvB,UAAU,wBAAwB,MAAM,EACzC;IACD,uBAAuB,EACrB,KAAK,YAAY,sBAAsB,OAAO,QAAQ,EACvD;IACD,yBAAyB,EACvB,KAAK,iBAAiB,wBAAwB,OAAO,aAAa,EACnE;IACF,CAAC;;EAEL;;;;;;;;AASH,MAAa,yBAAyB,iCAAiC"}
@@ -37,7 +37,9 @@ interface TableOptions_GlobalFiltering<TFeatures extends TableFeatures, TData ex
37
37
  */
38
38
  globalFilterFn?: FilterFnOption<TFeatures, TData>;
39
39
  /**
40
- * If provided, this function will be called with an `updaterFn` when `state.globalFilter` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table.
40
+ * Called with an updater when global filter state changes. Pair this with
41
+ * `state.globalFilter` when using external state; external atoms can own the
42
+ * slice without this callback.
41
43
  */
42
44
  onGlobalFilterChange?: OnChangeFn<any>;
43
45
  }
@@ -55,7 +57,7 @@ interface Table_GlobalFiltering<TFeatures extends TableFeatures, TData extends R
55
57
  */
56
58
  resetGlobalFilter: (defaultState?: boolean) => void;
57
59
  /**
58
- * Sets or updates the `state.globalFilter` state.
60
+ * Sets global filter state using a value or updater.
59
61
  */
60
62
  setGlobalFilter: (updater: Updater<any>) => void;
61
63
  }
@@ -37,7 +37,9 @@ interface TableOptions_GlobalFiltering<TFeatures extends TableFeatures, TData ex
37
37
  */
38
38
  globalFilterFn?: FilterFnOption<TFeatures, TData>;
39
39
  /**
40
- * If provided, this function will be called with an `updaterFn` when `state.globalFilter` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table.
40
+ * Called with an updater when global filter state changes. Pair this with
41
+ * `state.globalFilter` when using external state; external atoms can own the
42
+ * slice without this callback.
41
43
  */
42
44
  onGlobalFilterChange?: OnChangeFn<any>;
43
45
  }
@@ -55,7 +57,7 @@ interface Table_GlobalFiltering<TFeatures extends TableFeatures, TData extends R
55
57
  */
56
58
  resetGlobalFilter: (defaultState?: boolean) => void;
57
59
  /**
58
- * Sets or updates the `state.globalFilter` state.
60
+ * Sets global filter state using a value or updater.
59
61
  */
60
62
  setGlobalFilter: (updater: Updater<any>) => void;
61
63
  }
@@ -2,22 +2,73 @@ const require_utils = require('../../utils.cjs');
2
2
  const require_filterFns = require('../../fns/filterFns.cjs');
3
3
 
4
4
  //#region src/features/global-filtering/globalFilteringFeature.utils.ts
5
+ /**
6
+ * Returns whether a column can use global filter.
7
+ *
8
+ * This combines column options, table options, and any required accessor or feature state for the capability.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const value = column_getCanGlobalFilter(column)
13
+ * ```
14
+ */
5
15
  function column_getCanGlobalFilter(column) {
6
16
  var _column$table$options, _column$table$options2;
7
17
  return (column.columnDef.enableGlobalFilter ?? true) && (column.table.options.enableGlobalFilter ?? true) && (column.table.options.enableFilters ?? true) && (((_column$table$options = (_column$table$options2 = column.table.options).getColumnCanGlobalFilter) === null || _column$table$options === void 0 ? void 0 : _column$table$options.call(_column$table$options2, column)) ?? true) && !!column.accessorFn;
8
18
  }
19
+ /**
20
+ * Returns global auto filter fn for the table.
21
+ *
22
+ * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const value = table_getGlobalAutoFilterFn(table)
27
+ * ```
28
+ */
9
29
  function table_getGlobalAutoFilterFn() {
10
30
  return require_filterFns.filterFn_includesString;
11
31
  }
32
+ /**
33
+ * Returns global filter fn for the table.
34
+ *
35
+ * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const value = table_getGlobalFilterFn(table)
40
+ * ```
41
+ */
12
42
  function table_getGlobalFilterFn(table) {
13
43
  const { globalFilterFn } = table.options;
14
44
  const filterFns = table._rowModelFns.filterFns;
15
45
  return require_utils.isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === "auto" ? table_getGlobalAutoFilterFn() : filterFns === null || filterFns === void 0 ? void 0 : filterFns[globalFilterFn];
16
46
  }
47
+ /**
48
+ * Updates the table's global filter state slice.
49
+ *
50
+ * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * table_setGlobalFilter(table, (old) => old)
55
+ * ```
56
+ */
17
57
  function table_setGlobalFilter(table, updater) {
18
58
  var _table$options$onGlob, _table$options;
19
59
  (_table$options$onGlob = (_table$options = table.options).onGlobalFilterChange) === null || _table$options$onGlob === void 0 || _table$options$onGlob.call(_table$options, updater);
20
60
  }
61
+ /**
62
+ * Resets the table's global filter state slice.
63
+ *
64
+ * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * table_resetGlobalFilter(table)
69
+ * table_resetGlobalFilter(table, true)
70
+ * ```
71
+ */
21
72
  function table_resetGlobalFilter(table, defaultState) {
22
73
  table_setGlobalFilter(table, defaultState ? void 0 : require_utils.cloneState(table.initialState.globalFilter));
23
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"globalFilteringFeature.utils.cjs","names":["filterFn_includesString","isFunction","cloneState"],"sources":["../../../src/features/global-filtering/globalFilteringFeature.utils.ts"],"sourcesContent":["import { filterFn_includesString } from '../../fns/filterFns'\nimport { cloneState, isFunction } from '../../utils'\nimport type { Column_Internal } from '../../types/Column'\nimport type { FilterFn } from '../column-filtering/columnFilteringFeature.types'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\n\nexport function column_getCanGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>): boolean {\n return (\n (column.columnDef.enableGlobalFilter ?? true) &&\n (column.table.options.enableGlobalFilter ?? true) &&\n (column.table.options.enableFilters ?? true) &&\n (column.table.options.getColumnCanGlobalFilter?.(column) ?? true) &&\n !!column.accessorFn\n )\n}\n\nexport function table_getGlobalAutoFilterFn() {\n return filterFn_includesString\n}\n\nexport function table_getGlobalFilterFn<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): FilterFn<TFeatures, TData> | FilterFn<TFeatures, TData> | undefined {\n const { globalFilterFn: globalFilterFn } = table.options\n const filterFns: Record<string, FilterFn<TFeatures, TData>> | undefined =\n table._rowModelFns.filterFns\n\n return isFunction(globalFilterFn)\n ? globalFilterFn\n : globalFilterFn === 'auto'\n ? table_getGlobalAutoFilterFn()\n : filterFns?.[globalFilterFn as string]\n}\n\nexport function table_setGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, updater: any) {\n table.options.onGlobalFilterChange?.(updater)\n}\n\nexport function table_resetGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n table_setGlobalFilter(\n table,\n defaultState ? undefined : cloneState(table.initialState.globalFilter),\n )\n}\n"],"mappings":";;;;AAQA,SAAgB,0BAId,QAA4D;;AAC5D,SACG,OAAO,UAAU,sBAAsB,UACvC,OAAO,MAAM,QAAQ,sBAAsB,UAC3C,OAAO,MAAM,QAAQ,iBAAiB,8DACtC,OAAO,MAAM,SAAQ,qIAA2B,OAAO,KAAI,SAC5D,CAAC,CAAC,OAAO;;AAIb,SAAgB,8BAA8B;AAC5C,QAAOA;;AAGT,SAAgB,wBAId,OACqE;CACrE,MAAM,EAAkB,mBAAmB,MAAM;CACjD,MAAM,YACJ,MAAM,aAAa;AAErB,QAAOC,yBAAW,eAAe,GAC7B,iBACA,mBAAmB,SACjB,6BAA6B,yDAC7B,UAAY;;AAGpB,SAAgB,sBAGd,OAAyC,SAAc;;AACvD,kDAAM,SAAQ,iHAAuB,QAAQ;;AAG/C,SAAgB,wBAGd,OAAyC,cAAwB;AACjE,uBACE,OACA,eAAe,SAAYC,yBAAW,MAAM,aAAa,aAAa,CACvE"}
1
+ {"version":3,"file":"globalFilteringFeature.utils.cjs","names":["filterFn_includesString","isFunction","cloneState"],"sources":["../../../src/features/global-filtering/globalFilteringFeature.utils.ts"],"sourcesContent":["import { filterFn_includesString } from '../../fns/filterFns'\nimport { cloneState, isFunction } from '../../utils'\nimport type { Column_Internal } from '../../types/Column'\nimport type { FilterFn } from '../column-filtering/columnFilteringFeature.types'\nimport type { CellData, RowData } from '../../types/type-utils'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { Table_Internal } from '../../types/Table'\n\n/**\n * Returns whether a column can use global filter.\n *\n * This combines column options, table options, and any required accessor or feature state for the capability.\n *\n * @example\n * ```ts\n * const value = column_getCanGlobalFilter(column)\n * ```\n */\nexport function column_getCanGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n>(column: Column_Internal<TFeatures, TData, TValue>): boolean {\n return (\n (column.columnDef.enableGlobalFilter ?? true) &&\n (column.table.options.enableGlobalFilter ?? true) &&\n (column.table.options.enableFilters ?? true) &&\n (column.table.options.getColumnCanGlobalFilter?.(column) ?? true) &&\n !!column.accessorFn\n )\n}\n\n/**\n * Returns global auto filter fn for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getGlobalAutoFilterFn(table)\n * ```\n */\nexport function table_getGlobalAutoFilterFn() {\n return filterFn_includesString\n}\n\n/**\n * Returns global filter fn for the table.\n *\n * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.\n *\n * @example\n * ```ts\n * const value = table_getGlobalFilterFn(table)\n * ```\n */\nexport function table_getGlobalFilterFn<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(\n table: Table_Internal<TFeatures, TData>,\n): FilterFn<TFeatures, TData> | FilterFn<TFeatures, TData> | undefined {\n const { globalFilterFn: globalFilterFn } = table.options\n const filterFns: Record<string, FilterFn<TFeatures, TData>> | undefined =\n table._rowModelFns.filterFns\n\n return isFunction(globalFilterFn)\n ? globalFilterFn\n : globalFilterFn === 'auto'\n ? table_getGlobalAutoFilterFn()\n : filterFns?.[globalFilterFn as string]\n}\n\n/**\n * Updates the table's global filter state slice.\n *\n * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.\n *\n * @example\n * ```ts\n * table_setGlobalFilter(table, (old) => old)\n * ```\n */\nexport function table_setGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, updater: any) {\n table.options.onGlobalFilterChange?.(updater)\n}\n\n/**\n * Resets the table's global filter state slice.\n *\n * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.\n *\n * @example\n * ```ts\n * table_resetGlobalFilter(table)\n * table_resetGlobalFilter(table, true)\n * ```\n */\nexport function table_resetGlobalFilter<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean) {\n table_setGlobalFilter(\n table,\n defaultState ? undefined : cloneState(table.initialState.globalFilter),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,SAAgB,0BAId,QAA4D;;CAC5D,QACG,OAAO,UAAU,sBAAsB,UACvC,OAAO,MAAM,QAAQ,sBAAsB,UAC3C,OAAO,MAAM,QAAQ,iBAAiB,8DACtC,OAAO,MAAM,SAAQ,qIAA2B,OAAO,KAAI,SAC5D,CAAC,CAAC,OAAO;;;;;;;;;;;;AAcb,SAAgB,8BAA8B;CAC5C,OAAOA;;;;;;;;;;;;AAaT,SAAgB,wBAId,OACqE;CACrE,MAAM,EAAkB,mBAAmB,MAAM;CACjD,MAAM,YACJ,MAAM,aAAa;CAErB,OAAOC,yBAAW,eAAe,GAC7B,iBACA,mBAAmB,SACjB,6BAA6B,yDAC7B,UAAY;;;;;;;;;;;;AAapB,SAAgB,sBAGd,OAAyC,SAAc;;CACvD,iDAAM,SAAQ,iHAAuB,QAAQ;;;;;;;;;;;;;AAc/C,SAAgB,wBAGd,OAAyC,cAAwB;CACjE,sBACE,OACA,eAAe,SAAYC,yBAAW,MAAM,aAAa,aAAa,CACvE"}
@@ -5,10 +5,61 @@ import { TableFeatures } from "../../types/TableFeatures.cjs";
5
5
  import { Table_Internal } from "../../types/Table.cjs";
6
6
 
7
7
  //#region src/features/global-filtering/globalFilteringFeature.utils.d.ts
8
+ /**
9
+ * Returns whether a column can use global filter.
10
+ *
11
+ * This combines column options, table options, and any required accessor or feature state for the capability.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const value = column_getCanGlobalFilter(column)
16
+ * ```
17
+ */
8
18
  declare function column_getCanGlobalFilter<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(column: Column_Internal<TFeatures, TData, TValue>): boolean;
19
+ /**
20
+ * Returns global auto filter fn for the table.
21
+ *
22
+ * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const value = table_getGlobalAutoFilterFn(table)
27
+ * ```
28
+ */
9
29
  declare function table_getGlobalAutoFilterFn(): FilterFn<any, any>;
30
+ /**
31
+ * Returns global filter fn for the table.
32
+ *
33
+ * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const value = table_getGlobalFilterFn(table)
38
+ * ```
39
+ */
10
40
  declare function table_getGlobalFilterFn<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>): FilterFn<TFeatures, TData> | FilterFn<TFeatures, TData> | undefined;
41
+ /**
42
+ * Updates the table's global filter state slice.
43
+ *
44
+ * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * table_setGlobalFilter(table, (old) => old)
49
+ * ```
50
+ */
11
51
  declare function table_setGlobalFilter<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, updater: any): void;
52
+ /**
53
+ * Resets the table's global filter state slice.
54
+ *
55
+ * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * table_resetGlobalFilter(table)
60
+ * table_resetGlobalFilter(table, true)
61
+ * ```
62
+ */
12
63
  declare function table_resetGlobalFilter<TFeatures extends TableFeatures, TData extends RowData>(table: Table_Internal<TFeatures, TData>, defaultState?: boolean): void;
13
64
  //#endregion
14
65
  export { column_getCanGlobalFilter, table_getGlobalAutoFilterFn, table_getGlobalFilterFn, table_resetGlobalFilter, table_setGlobalFilter };