@tanstack/table-core 9.0.0-beta.47 → 9.0.0-beta.49

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 (186) hide show
  1. package/dist/core/row-models/coreRowModelsFeature.types.d.cts +1 -1
  2. package/dist/core/row-models/coreRowModelsFeature.types.d.ts +1 -1
  3. package/dist/core/row-models/coreRowModelsFeature.utils.cjs +1 -1
  4. package/dist/core/row-models/coreRowModelsFeature.utils.cjs.map +1 -1
  5. package/dist/core/row-models/coreRowModelsFeature.utils.d.cts +1 -1
  6. package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +1 -1
  7. package/dist/core/row-models/coreRowModelsFeature.utils.js +1 -1
  8. package/dist/core/row-models/coreRowModelsFeature.utils.js.map +1 -1
  9. package/dist/features/aggregation/aggregationFeature.cjs +38 -0
  10. package/dist/features/aggregation/aggregationFeature.cjs.map +1 -0
  11. package/dist/features/aggregation/aggregationFeature.d.cts +10 -0
  12. package/dist/features/aggregation/aggregationFeature.d.ts +10 -0
  13. package/dist/features/aggregation/aggregationFeature.js +38 -0
  14. package/dist/features/aggregation/aggregationFeature.js.map +1 -0
  15. package/dist/features/aggregation/aggregationFeature.types.cjs +13 -0
  16. package/dist/features/aggregation/aggregationFeature.types.cjs.map +1 -0
  17. package/dist/features/aggregation/aggregationFeature.types.d.cts +172 -0
  18. package/dist/features/aggregation/aggregationFeature.types.d.ts +172 -0
  19. package/dist/features/aggregation/aggregationFeature.types.js +12 -0
  20. package/dist/features/aggregation/aggregationFeature.types.js.map +1 -0
  21. package/dist/features/aggregation/aggregationFeature.utils.cjs +198 -0
  22. package/dist/features/aggregation/aggregationFeature.utils.cjs.map +1 -0
  23. package/dist/features/aggregation/aggregationFeature.utils.d.cts +33 -0
  24. package/dist/features/aggregation/aggregationFeature.utils.d.ts +33 -0
  25. package/dist/features/aggregation/aggregationFeature.utils.js +192 -0
  26. package/dist/features/aggregation/aggregationFeature.utils.js.map +1 -0
  27. package/dist/features/aggregation/aggregationFns.cjs +240 -0
  28. package/dist/features/aggregation/aggregationFns.cjs.map +1 -0
  29. package/dist/features/aggregation/aggregationFns.d.cts +67 -0
  30. package/dist/features/aggregation/aggregationFns.d.ts +67 -0
  31. package/dist/features/aggregation/aggregationFns.js +229 -0
  32. package/dist/features/aggregation/aggregationFns.js.map +1 -0
  33. package/dist/features/column-faceting/createFacetedMinMaxValues.cjs +7 -4
  34. package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
  35. package/dist/features/column-faceting/createFacetedMinMaxValues.js +8 -5
  36. package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
  37. package/dist/features/column-faceting/createFacetedRowModel.cjs +1 -1
  38. package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
  39. package/dist/features/column-faceting/createFacetedRowModel.js +1 -1
  40. package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
  41. package/dist/features/column-faceting/createFacetedUniqueValues.cjs +8 -4
  42. package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
  43. package/dist/features/column-faceting/createFacetedUniqueValues.js +9 -5
  44. package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
  45. package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +1 -1
  46. package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +1 -1
  47. package/dist/{fns → features/column-filtering}/filterFns.cjs +1 -1
  48. package/dist/features/column-filtering/filterFns.cjs.map +1 -0
  49. package/dist/{fns → features/column-filtering}/filterFns.d.cts +4 -4
  50. package/dist/{fns → features/column-filtering}/filterFns.d.ts +4 -4
  51. package/dist/{fns → features/column-filtering}/filterFns.js +1 -1
  52. package/dist/features/column-filtering/filterFns.js.map +1 -0
  53. package/dist/features/column-grouping/columnGroupingFeature.cjs +3 -12
  54. package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
  55. package/dist/features/column-grouping/columnGroupingFeature.d.cts +1 -1
  56. package/dist/features/column-grouping/columnGroupingFeature.d.ts +1 -1
  57. package/dist/features/column-grouping/columnGroupingFeature.js +4 -13
  58. package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
  59. package/dist/features/column-grouping/columnGroupingFeature.types.d.cts +6 -87
  60. package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +6 -87
  61. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs +0 -64
  62. package/dist/features/column-grouping/columnGroupingFeature.utils.cjs.map +1 -1
  63. package/dist/features/column-grouping/columnGroupingFeature.utils.d.cts +2 -44
  64. package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +2 -44
  65. package/dist/features/column-grouping/columnGroupingFeature.utils.js +2 -63
  66. package/dist/features/column-grouping/columnGroupingFeature.utils.js.map +1 -1
  67. package/dist/features/column-grouping/createGroupedRowModel.cjs +23 -16
  68. package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
  69. package/dist/features/column-grouping/createGroupedRowModel.d.cts +2 -6
  70. package/dist/features/column-grouping/createGroupedRowModel.d.ts +2 -6
  71. package/dist/features/column-grouping/createGroupedRowModel.js +25 -18
  72. package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
  73. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs +1 -1
  74. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
  75. package/dist/features/global-filtering/globalFilteringFeature.utils.js +1 -1
  76. package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
  77. package/dist/features/row-sorting/rowSortingFeature.types.d.cts +1 -1
  78. package/dist/features/row-sorting/rowSortingFeature.types.d.ts +1 -1
  79. package/dist/features/row-sorting/rowSortingFeature.utils.cjs +1 -1
  80. package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
  81. package/dist/features/row-sorting/rowSortingFeature.utils.js +1 -1
  82. package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
  83. package/dist/{fns → features/row-sorting}/sortFns.cjs +1 -1
  84. package/dist/{fns/sortFns.js.map → features/row-sorting/sortFns.cjs.map} +1 -1
  85. package/dist/{fns → features/row-sorting}/sortFns.d.cts +4 -4
  86. package/dist/{fns → features/row-sorting}/sortFns.d.ts +4 -4
  87. package/dist/{fns → features/row-sorting}/sortFns.js +1 -1
  88. package/dist/features/row-sorting/sortFns.js.map +1 -0
  89. package/dist/features/stockFeatures.cjs +2 -0
  90. package/dist/features/stockFeatures.cjs.map +1 -1
  91. package/dist/features/stockFeatures.d.cts +2 -0
  92. package/dist/features/stockFeatures.d.ts +2 -0
  93. package/dist/features/stockFeatures.js +2 -0
  94. package/dist/features/stockFeatures.js.map +1 -1
  95. package/dist/index.cjs +7 -4
  96. package/dist/index.d.cts +7 -5
  97. package/dist/index.d.ts +7 -5
  98. package/dist/index.js +6 -4
  99. package/dist/static-functions.cjs +8 -3
  100. package/dist/static-functions.d.cts +3 -2
  101. package/dist/static-functions.d.ts +3 -2
  102. package/dist/static-functions.js +3 -2
  103. package/dist/types/Cell.d.cts +3 -1
  104. package/dist/types/Cell.d.ts +3 -1
  105. package/dist/types/Column.d.cts +4 -2
  106. package/dist/types/Column.d.ts +4 -2
  107. package/dist/types/ColumnDef.d.cts +5 -3
  108. package/dist/types/ColumnDef.d.ts +5 -3
  109. package/dist/types/Row.d.cts +3 -1
  110. package/dist/types/Row.d.ts +3 -1
  111. package/dist/types/RowModel.d.cts +1 -1
  112. package/dist/types/RowModel.d.ts +1 -1
  113. package/dist/types/RowModelFns.d.cts +3 -3
  114. package/dist/types/RowModelFns.d.ts +3 -3
  115. package/dist/types/Table.d.cts +1 -1
  116. package/dist/types/Table.d.ts +1 -1
  117. package/dist/types/TableFeatures.d.cts +4 -4
  118. package/dist/types/TableFeatures.d.ts +4 -4
  119. package/dist/types/TableOptions.d.cts +5 -3
  120. package/dist/types/TableOptions.d.ts +5 -3
  121. package/dist/types/TableState.d.cts +1 -1
  122. package/dist/types/TableState.d.ts +1 -1
  123. package/dist/worker/initTableWorker.cjs.map +1 -1
  124. package/dist/worker/initTableWorker.js.map +1 -1
  125. package/package.json +1 -1
  126. package/skills/aggregation/SKILL.md +131 -0
  127. package/skills/api-not-found/SKILL.md +1 -1
  128. package/skills/client-vs-server/SKILL.md +1 -1
  129. package/skills/column-faceting/SKILL.md +1 -1
  130. package/skills/column-filtering/SKILL.md +1 -1
  131. package/skills/column-ordering/SKILL.md +1 -1
  132. package/skills/column-pinning/SKILL.md +1 -1
  133. package/skills/column-resizing/SKILL.md +1 -1
  134. package/skills/column-sizing/SKILL.md +1 -1
  135. package/skills/column-visibility/SKILL.md +1 -1
  136. package/skills/core/SKILL.md +1 -1
  137. package/skills/custom-features/SKILL.md +1 -1
  138. package/skills/expanding/SKILL.md +1 -1
  139. package/skills/global-filtering/SKILL.md +1 -1
  140. package/skills/grouping/SKILL.md +12 -18
  141. package/skills/migrate-v8-to-v9/SKILL.md +15 -2
  142. package/skills/pagination/SKILL.md +1 -1
  143. package/skills/row-pinning/SKILL.md +1 -1
  144. package/skills/row-selection/SKILL.md +1 -1
  145. package/skills/sorting/SKILL.md +1 -1
  146. package/skills/table-features/SKILL.md +5 -2
  147. package/skills/typescript/SKILL.md +1 -1
  148. package/src/core/row-models/coreRowModelsFeature.utils.ts +1 -1
  149. package/src/features/aggregation/aggregationFeature.ts +59 -0
  150. package/src/features/aggregation/aggregationFeature.types.ts +312 -0
  151. package/src/features/aggregation/aggregationFeature.utils.ts +401 -0
  152. package/src/features/aggregation/aggregationFns.ts +336 -0
  153. package/src/features/column-faceting/createFacetedMinMaxValues.ts +33 -7
  154. package/src/features/column-faceting/createFacetedRowModel.ts +4 -1
  155. package/src/features/column-faceting/createFacetedUniqueValues.ts +45 -11
  156. package/src/features/column-filtering/columnFilteringFeature.types.ts +1 -1
  157. package/src/{fns → features/column-filtering}/filterFns.ts +4 -4
  158. package/src/features/column-grouping/columnGroupingFeature.ts +1 -20
  159. package/src/features/column-grouping/columnGroupingFeature.types.ts +4 -141
  160. package/src/features/column-grouping/columnGroupingFeature.utils.ts +1 -122
  161. package/src/features/column-grouping/createGroupedRowModel.ts +32 -41
  162. package/src/features/global-filtering/globalFilteringFeature.utils.ts +1 -1
  163. package/src/features/row-sorting/rowSortingFeature.types.ts +1 -1
  164. package/src/features/row-sorting/rowSortingFeature.utils.ts +1 -1
  165. package/src/{fns → features/row-sorting}/sortFns.ts +4 -7
  166. package/src/features/stockFeatures.ts +3 -0
  167. package/src/index.ts +7 -8
  168. package/src/static-functions.ts +1 -0
  169. package/src/types/Cell.ts +2 -0
  170. package/src/types/Column.ts +3 -1
  171. package/src/types/ColumnDef.ts +6 -3
  172. package/src/types/Row.ts +2 -0
  173. package/src/types/RowModelFns.ts +3 -3
  174. package/src/types/TableFeatures.ts +4 -4
  175. package/src/types/TableOptions.ts +5 -1
  176. package/src/worker/initTableWorker.ts +1 -1
  177. package/dist/fns/aggregationFns.cjs +0 -234
  178. package/dist/fns/aggregationFns.cjs.map +0 -1
  179. package/dist/fns/aggregationFns.d.cts +0 -139
  180. package/dist/fns/aggregationFns.d.ts +0 -139
  181. package/dist/fns/aggregationFns.js +0 -221
  182. package/dist/fns/aggregationFns.js.map +0 -1
  183. package/dist/fns/filterFns.cjs.map +0 -1
  184. package/dist/fns/filterFns.js.map +0 -1
  185. package/dist/fns/sortFns.cjs.map +0 -1
  186. package/src/fns/aggregationFns.ts +0 -303
@@ -1,6 +1,6 @@
1
1
  import { RowData } from "../../types/type-utils.cjs";
2
- import { Table_RowModels_Sorted } from "../../features/row-sorting/rowSortingFeature.types.cjs";
3
2
  import { Table_RowModels_Grouped } from "../../features/column-grouping/columnGroupingFeature.types.cjs";
3
+ import { Table_RowModels_Sorted } from "../../features/row-sorting/rowSortingFeature.types.cjs";
4
4
  import { Table_RowModels_Expanded } from "../../features/row-expanding/rowExpandingFeature.types.cjs";
5
5
  import { Row } from "../../types/Row.cjs";
6
6
  import { Table_RowModels_Filtered } from "../../features/column-filtering/columnFilteringFeature.types.cjs";
@@ -1,6 +1,6 @@
1
1
  import { RowData } from "../../types/type-utils.js";
2
- import { Table_RowModels_Sorted } from "../../features/row-sorting/rowSortingFeature.types.js";
3
2
  import { Table_RowModels_Grouped } from "../../features/column-grouping/columnGroupingFeature.types.js";
3
+ import { Table_RowModels_Sorted } from "../../features/row-sorting/rowSortingFeature.types.js";
4
4
  import { Table_RowModels_Expanded } from "../../features/row-expanding/rowExpandingFeature.types.js";
5
5
  import { Row } from "../../types/Row.js";
6
6
  import { Table_RowModels_Filtered } from "../../features/column-filtering/columnFilteringFeature.types.js";
@@ -61,7 +61,7 @@ function table_getPreGroupedRowModel(table) {
61
61
  return table.getFilteredRowModel();
62
62
  }
63
63
  /**
64
- * Resolves the row model after grouping has produced grouped and aggregated rows.
64
+ * Resolves the row model after grouping has produced grouped rows.
65
65
  *
66
66
  * When `manualGrouping` is enabled, or no grouped row-model factory was
67
67
  * registered, this returns the pre-grouped row model unchanged.
@@ -1 +1 @@
1
- {"version":3,"file":"coreRowModelsFeature.utils.cjs","names":["createCoreRowModel"],"sources":["../../../src/core/row-models/coreRowModelsFeature.utils.ts"],"sourcesContent":["import { createCoreRowModel } from './createCoreRowModel'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { RowData } from '../../types/type-utils'\nimport type { RowModel } from './coreRowModelsFeature.types'\n\n/**\n * Resolves the table's unmodified core row model.\n *\n * The factory is created once per table, either from the `coreRowModel` slot on the `features` option\n * or the built-in `createCoreRowModel()`, then reused for later calls.\n *\n * @example\n * ```ts\n * const coreRows = table_getCoreRowModel(table)\n * ```\n */\nexport function table_getCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.coreRowModel) {\n table._rowModels.coreRowModel =\n table.options.features.coreRowModel?.(table) ??\n createCoreRowModel<TFeatures, TData>()(table)\n }\n\n return table._rowModels.coreRowModel()\n}\n\n/**\n * Reads the row model immediately before column/global filtering.\n *\n * Filtering is the first derived row-model stage, so this currently aliases\n * `table.getCoreRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeFiltering = table_getPreFilteredRowModel(table)\n * ```\n */\nexport function table_getPreFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getCoreRowModel()\n}\n\n/**\n * Resolves the row model after column and global filtering.\n *\n * When `manualFiltering` is enabled, or no filtered row-model factory was\n * registered, this returns the pre-filtered row model because filtering is\n * expected to happen outside the table.\n *\n * @example\n * ```ts\n * const filteredRows = table_getFilteredRowModel(table)\n * ```\n */\nexport function table_getFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.filteredRowModel) {\n table._rowModels.filteredRowModel =\n table.options.features.filteredRowModel?.(table)\n }\n\n if (table.options.manualFiltering || !table._rowModels.filteredRowModel) {\n return table.getPreFilteredRowModel()\n }\n\n return table._rowModels.filteredRowModel()\n}\n\n/**\n * Reads the row model immediately before grouping.\n *\n * Grouping runs after filtering, so this aliases `table.getFilteredRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeGrouping = table_getPreGroupedRowModel(table)\n * ```\n */\nexport function table_getPreGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getFilteredRowModel()\n}\n\n/**\n * Resolves the row model after grouping has produced grouped and aggregated rows.\n *\n * When `manualGrouping` is enabled, or no grouped row-model factory was\n * registered, this returns the pre-grouped row model unchanged.\n *\n * @example\n * ```ts\n * const groupedRows = table_getGroupedRowModel(table)\n * ```\n */\nexport function table_getGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.groupedRowModel) {\n table._rowModels.groupedRowModel =\n table.options.features.groupedRowModel?.(table)\n }\n\n if (table.options.manualGrouping || !table._rowModels.groupedRowModel) {\n return table.getPreGroupedRowModel()\n }\n\n return table._rowModels.groupedRowModel()\n}\n\n/**\n * Reads the row model immediately before sorting.\n *\n * Sorting runs after grouping, so this aliases `table.getGroupedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeSorting = table_getPreSortedRowModel(table)\n * ```\n */\nexport function table_getPreSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getGroupedRowModel()\n}\n\n/**\n * Resolves the row model after sorting has been applied.\n *\n * When `manualSorting` is enabled, or no sorted row-model factory was\n * registered, this returns the pre-sorted row model because sorted data is\n * expected to be supplied by the caller.\n *\n * @example\n * ```ts\n * const sortedRows = table_getSortedRowModel(table)\n * ```\n */\nexport function table_getSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.sortedRowModel) {\n table._rowModels.sortedRowModel =\n table.options.features.sortedRowModel?.(table)\n }\n\n if (table.options.manualSorting || !table._rowModels.sortedRowModel) {\n return table.getPreSortedRowModel()\n }\n\n return table._rowModels.sortedRowModel()\n}\n\n/**\n * Reads the row model immediately before row expansion.\n *\n * Expansion runs after sorting, so this aliases `table.getSortedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeExpansion = table_getPreExpandedRowModel(table)\n * ```\n */\nexport function table_getPreExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getSortedRowModel()\n}\n\n/**\n * Resolves the row model after expanded rows have been flattened into view.\n *\n * When `manualExpanding` is enabled, or no expanded row-model factory was\n * registered, this returns the pre-expanded row model unchanged.\n *\n * @example\n * ```ts\n * const expandedRows = table_getExpandedRowModel(table)\n * ```\n */\nexport function table_getExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.expandedRowModel) {\n table._rowModels.expandedRowModel =\n table.options.features.expandedRowModel?.(table)\n }\n\n if (table.options.manualExpanding || !table._rowModels.expandedRowModel) {\n return table.getPreExpandedRowModel()\n }\n\n return table._rowModels.expandedRowModel()\n}\n\n/**\n * Reads the row model immediately before pagination.\n *\n * Pagination is the final built-in row-model stage, so this aliases\n * `table.getExpandedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforePagination = table_getPrePaginatedRowModel(table)\n * ```\n */\nexport function table_getPrePaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getExpandedRowModel()\n}\n\n/**\n * Resolves the row model after pagination has sliced rows for the current page.\n *\n * When `manualPagination` is enabled, or no paginated row-model factory was\n * registered, this returns the pre-paginated row model because pagination is\n * expected to happen before data reaches the table.\n *\n * @example\n * ```ts\n * const pageRows = table_getPaginatedRowModel(table)\n * ```\n */\nexport function table_getPaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.paginatedRowModel) {\n table._rowModels.paginatedRowModel =\n table.options.features.paginatedRowModel?.(table)\n }\n\n if (table.options.manualPagination || !table._rowModels.paginatedRowModel) {\n return table.getPrePaginatedRowModel()\n }\n\n return table._rowModels.paginatedRowModel()\n}\n\n/**\n * Resolves the final row model consumed by renderers.\n *\n * This is the end of the built-in row-model pipeline: core -> filtering ->\n * grouping -> sorting -> expanding -> pagination.\n *\n * @example\n * ```ts\n * const visibleRows = table_getRowModel(table)\n * ```\n */\nexport function table_getRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getPaginatedRowModel()\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,sBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,cACpB,MAAM,WAAW,eACf,MAAM,QAAQ,SAAS,eAAe,KAAK,KAC3CA,8CAAqC,CAAC,CAAC,KAAK;CAGhD,OAAO,MAAM,WAAW,aAAa;AACvC;;;;;;;;;;;;AAaA,SAAgB,6BAGd,OAAqE;CACrE,OAAO,MAAM,gBAAgB;AAC/B;;;;;;;;;;;;;AAcA,SAAgB,0BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,kBACpB,MAAM,WAAW,mBACf,MAAM,QAAQ,SAAS,mBAAmB,KAAK;CAGnD,IAAI,MAAM,QAAQ,mBAAmB,CAAC,MAAM,WAAW,kBACrD,OAAO,MAAM,uBAAuB;CAGtC,OAAO,MAAM,WAAW,iBAAiB;AAC3C;;;;;;;;;;;AAYA,SAAgB,4BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;AAaA,SAAgB,yBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,iBACpB,MAAM,WAAW,kBACf,MAAM,QAAQ,SAAS,kBAAkB,KAAK;CAGlD,IAAI,MAAM,QAAQ,kBAAkB,CAAC,MAAM,WAAW,iBACpD,OAAO,MAAM,sBAAsB;CAGrC,OAAO,MAAM,WAAW,gBAAgB;AAC1C;;;;;;;;;;;AAYA,SAAgB,2BAGd,OAAqE;CACrE,OAAO,MAAM,mBAAmB;AAClC;;;;;;;;;;;;;AAcA,SAAgB,wBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,gBACpB,MAAM,WAAW,iBACf,MAAM,QAAQ,SAAS,iBAAiB,KAAK;CAGjD,IAAI,MAAM,QAAQ,iBAAiB,CAAC,MAAM,WAAW,gBACnD,OAAO,MAAM,qBAAqB;CAGpC,OAAO,MAAM,WAAW,eAAe;AACzC;;;;;;;;;;;AAYA,SAAgB,6BAGd,OAAqE;CACrE,OAAO,MAAM,kBAAkB;AACjC;;;;;;;;;;;;AAaA,SAAgB,0BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,kBACpB,MAAM,WAAW,mBACf,MAAM,QAAQ,SAAS,mBAAmB,KAAK;CAGnD,IAAI,MAAM,QAAQ,mBAAmB,CAAC,MAAM,WAAW,kBACrD,OAAO,MAAM,uBAAuB;CAGtC,OAAO,MAAM,WAAW,iBAAiB;AAC3C;;;;;;;;;;;;AAaA,SAAgB,8BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;;AAcA,SAAgB,2BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,mBACpB,MAAM,WAAW,oBACf,MAAM,QAAQ,SAAS,oBAAoB,KAAK;CAGpD,IAAI,MAAM,QAAQ,oBAAoB,CAAC,MAAM,WAAW,mBACtD,OAAO,MAAM,wBAAwB;CAGvC,OAAO,MAAM,WAAW,kBAAkB;AAC5C;;;;;;;;;;;;AAaA,SAAgB,kBAGd,OAAqE;CACrE,OAAO,MAAM,qBAAqB;AACpC"}
1
+ {"version":3,"file":"coreRowModelsFeature.utils.cjs","names":["createCoreRowModel"],"sources":["../../../src/core/row-models/coreRowModelsFeature.utils.ts"],"sourcesContent":["import { createCoreRowModel } from './createCoreRowModel'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { RowData } from '../../types/type-utils'\nimport type { RowModel } from './coreRowModelsFeature.types'\n\n/**\n * Resolves the table's unmodified core row model.\n *\n * The factory is created once per table, either from the `coreRowModel` slot on the `features` option\n * or the built-in `createCoreRowModel()`, then reused for later calls.\n *\n * @example\n * ```ts\n * const coreRows = table_getCoreRowModel(table)\n * ```\n */\nexport function table_getCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.coreRowModel) {\n table._rowModels.coreRowModel =\n table.options.features.coreRowModel?.(table) ??\n createCoreRowModel<TFeatures, TData>()(table)\n }\n\n return table._rowModels.coreRowModel()\n}\n\n/**\n * Reads the row model immediately before column/global filtering.\n *\n * Filtering is the first derived row-model stage, so this currently aliases\n * `table.getCoreRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeFiltering = table_getPreFilteredRowModel(table)\n * ```\n */\nexport function table_getPreFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getCoreRowModel()\n}\n\n/**\n * Resolves the row model after column and global filtering.\n *\n * When `manualFiltering` is enabled, or no filtered row-model factory was\n * registered, this returns the pre-filtered row model because filtering is\n * expected to happen outside the table.\n *\n * @example\n * ```ts\n * const filteredRows = table_getFilteredRowModel(table)\n * ```\n */\nexport function table_getFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.filteredRowModel) {\n table._rowModels.filteredRowModel =\n table.options.features.filteredRowModel?.(table)\n }\n\n if (table.options.manualFiltering || !table._rowModels.filteredRowModel) {\n return table.getPreFilteredRowModel()\n }\n\n return table._rowModels.filteredRowModel()\n}\n\n/**\n * Reads the row model immediately before grouping.\n *\n * Grouping runs after filtering, so this aliases `table.getFilteredRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeGrouping = table_getPreGroupedRowModel(table)\n * ```\n */\nexport function table_getPreGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getFilteredRowModel()\n}\n\n/**\n * Resolves the row model after grouping has produced grouped rows.\n *\n * When `manualGrouping` is enabled, or no grouped row-model factory was\n * registered, this returns the pre-grouped row model unchanged.\n *\n * @example\n * ```ts\n * const groupedRows = table_getGroupedRowModel(table)\n * ```\n */\nexport function table_getGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.groupedRowModel) {\n table._rowModels.groupedRowModel =\n table.options.features.groupedRowModel?.(table)\n }\n\n if (table.options.manualGrouping || !table._rowModels.groupedRowModel) {\n return table.getPreGroupedRowModel()\n }\n\n return table._rowModels.groupedRowModel()\n}\n\n/**\n * Reads the row model immediately before sorting.\n *\n * Sorting runs after grouping, so this aliases `table.getGroupedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeSorting = table_getPreSortedRowModel(table)\n * ```\n */\nexport function table_getPreSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getGroupedRowModel()\n}\n\n/**\n * Resolves the row model after sorting has been applied.\n *\n * When `manualSorting` is enabled, or no sorted row-model factory was\n * registered, this returns the pre-sorted row model because sorted data is\n * expected to be supplied by the caller.\n *\n * @example\n * ```ts\n * const sortedRows = table_getSortedRowModel(table)\n * ```\n */\nexport function table_getSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.sortedRowModel) {\n table._rowModels.sortedRowModel =\n table.options.features.sortedRowModel?.(table)\n }\n\n if (table.options.manualSorting || !table._rowModels.sortedRowModel) {\n return table.getPreSortedRowModel()\n }\n\n return table._rowModels.sortedRowModel()\n}\n\n/**\n * Reads the row model immediately before row expansion.\n *\n * Expansion runs after sorting, so this aliases `table.getSortedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeExpansion = table_getPreExpandedRowModel(table)\n * ```\n */\nexport function table_getPreExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getSortedRowModel()\n}\n\n/**\n * Resolves the row model after expanded rows have been flattened into view.\n *\n * When `manualExpanding` is enabled, or no expanded row-model factory was\n * registered, this returns the pre-expanded row model unchanged.\n *\n * @example\n * ```ts\n * const expandedRows = table_getExpandedRowModel(table)\n * ```\n */\nexport function table_getExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.expandedRowModel) {\n table._rowModels.expandedRowModel =\n table.options.features.expandedRowModel?.(table)\n }\n\n if (table.options.manualExpanding || !table._rowModels.expandedRowModel) {\n return table.getPreExpandedRowModel()\n }\n\n return table._rowModels.expandedRowModel()\n}\n\n/**\n * Reads the row model immediately before pagination.\n *\n * Pagination is the final built-in row-model stage, so this aliases\n * `table.getExpandedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforePagination = table_getPrePaginatedRowModel(table)\n * ```\n */\nexport function table_getPrePaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getExpandedRowModel()\n}\n\n/**\n * Resolves the row model after pagination has sliced rows for the current page.\n *\n * When `manualPagination` is enabled, or no paginated row-model factory was\n * registered, this returns the pre-paginated row model because pagination is\n * expected to happen before data reaches the table.\n *\n * @example\n * ```ts\n * const pageRows = table_getPaginatedRowModel(table)\n * ```\n */\nexport function table_getPaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.paginatedRowModel) {\n table._rowModels.paginatedRowModel =\n table.options.features.paginatedRowModel?.(table)\n }\n\n if (table.options.manualPagination || !table._rowModels.paginatedRowModel) {\n return table.getPrePaginatedRowModel()\n }\n\n return table._rowModels.paginatedRowModel()\n}\n\n/**\n * Resolves the final row model consumed by renderers.\n *\n * This is the end of the built-in row-model pipeline: core -> filtering ->\n * grouping -> sorting -> expanding -> pagination.\n *\n * @example\n * ```ts\n * const visibleRows = table_getRowModel(table)\n * ```\n */\nexport function table_getRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getPaginatedRowModel()\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,sBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,cACpB,MAAM,WAAW,eACf,MAAM,QAAQ,SAAS,eAAe,KAAK,KAC3CA,8CAAqC,CAAC,CAAC,KAAK;CAGhD,OAAO,MAAM,WAAW,aAAa;AACvC;;;;;;;;;;;;AAaA,SAAgB,6BAGd,OAAqE;CACrE,OAAO,MAAM,gBAAgB;AAC/B;;;;;;;;;;;;;AAcA,SAAgB,0BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,kBACpB,MAAM,WAAW,mBACf,MAAM,QAAQ,SAAS,mBAAmB,KAAK;CAGnD,IAAI,MAAM,QAAQ,mBAAmB,CAAC,MAAM,WAAW,kBACrD,OAAO,MAAM,uBAAuB;CAGtC,OAAO,MAAM,WAAW,iBAAiB;AAC3C;;;;;;;;;;;AAYA,SAAgB,4BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;AAaA,SAAgB,yBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,iBACpB,MAAM,WAAW,kBACf,MAAM,QAAQ,SAAS,kBAAkB,KAAK;CAGlD,IAAI,MAAM,QAAQ,kBAAkB,CAAC,MAAM,WAAW,iBACpD,OAAO,MAAM,sBAAsB;CAGrC,OAAO,MAAM,WAAW,gBAAgB;AAC1C;;;;;;;;;;;AAYA,SAAgB,2BAGd,OAAqE;CACrE,OAAO,MAAM,mBAAmB;AAClC;;;;;;;;;;;;;AAcA,SAAgB,wBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,gBACpB,MAAM,WAAW,iBACf,MAAM,QAAQ,SAAS,iBAAiB,KAAK;CAGjD,IAAI,MAAM,QAAQ,iBAAiB,CAAC,MAAM,WAAW,gBACnD,OAAO,MAAM,qBAAqB;CAGpC,OAAO,MAAM,WAAW,eAAe;AACzC;;;;;;;;;;;AAYA,SAAgB,6BAGd,OAAqE;CACrE,OAAO,MAAM,kBAAkB;AACjC;;;;;;;;;;;;AAaA,SAAgB,0BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,kBACpB,MAAM,WAAW,mBACf,MAAM,QAAQ,SAAS,mBAAmB,KAAK;CAGnD,IAAI,MAAM,QAAQ,mBAAmB,CAAC,MAAM,WAAW,kBACrD,OAAO,MAAM,uBAAuB;CAGtC,OAAO,MAAM,WAAW,iBAAiB;AAC3C;;;;;;;;;;;;AAaA,SAAgB,8BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;;AAcA,SAAgB,2BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,mBACpB,MAAM,WAAW,oBACf,MAAM,QAAQ,SAAS,oBAAoB,KAAK;CAGpD,IAAI,MAAM,QAAQ,oBAAoB,CAAC,MAAM,WAAW,mBACtD,OAAO,MAAM,wBAAwB;CAGvC,OAAO,MAAM,WAAW,kBAAkB;AAC5C;;;;;;;;;;;;AAaA,SAAgB,kBAGd,OAAqE;CACrE,OAAO,MAAM,qBAAqB;AACpC"}
@@ -53,7 +53,7 @@ declare function table_getFilteredRowModel<TFeatures extends TableFeatures, TDat
53
53
  */
54
54
  declare function table_getPreGroupedRowModel<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>): RowModel<TFeatures, TData>;
55
55
  /**
56
- * Resolves the row model after grouping has produced grouped and aggregated rows.
56
+ * Resolves the row model after grouping has produced grouped rows.
57
57
  *
58
58
  * When `manualGrouping` is enabled, or no grouped row-model factory was
59
59
  * registered, this returns the pre-grouped row model unchanged.
@@ -53,7 +53,7 @@ declare function table_getFilteredRowModel<TFeatures extends TableFeatures, TDat
53
53
  */
54
54
  declare function table_getPreGroupedRowModel<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>): RowModel<TFeatures, TData>;
55
55
  /**
56
- * Resolves the row model after grouping has produced grouped and aggregated rows.
56
+ * Resolves the row model after grouping has produced grouped rows.
57
57
  *
58
58
  * When `manualGrouping` is enabled, or no grouped row-model factory was
59
59
  * registered, this returns the pre-grouped row model unchanged.
@@ -61,7 +61,7 @@ function table_getPreGroupedRowModel(table) {
61
61
  return table.getFilteredRowModel();
62
62
  }
63
63
  /**
64
- * Resolves the row model after grouping has produced grouped and aggregated rows.
64
+ * Resolves the row model after grouping has produced grouped rows.
65
65
  *
66
66
  * When `manualGrouping` is enabled, or no grouped row-model factory was
67
67
  * registered, this returns the pre-grouped row model unchanged.
@@ -1 +1 @@
1
- {"version":3,"file":"coreRowModelsFeature.utils.js","names":[],"sources":["../../../src/core/row-models/coreRowModelsFeature.utils.ts"],"sourcesContent":["import { createCoreRowModel } from './createCoreRowModel'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { RowData } from '../../types/type-utils'\nimport type { RowModel } from './coreRowModelsFeature.types'\n\n/**\n * Resolves the table's unmodified core row model.\n *\n * The factory is created once per table, either from the `coreRowModel` slot on the `features` option\n * or the built-in `createCoreRowModel()`, then reused for later calls.\n *\n * @example\n * ```ts\n * const coreRows = table_getCoreRowModel(table)\n * ```\n */\nexport function table_getCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.coreRowModel) {\n table._rowModels.coreRowModel =\n table.options.features.coreRowModel?.(table) ??\n createCoreRowModel<TFeatures, TData>()(table)\n }\n\n return table._rowModels.coreRowModel()\n}\n\n/**\n * Reads the row model immediately before column/global filtering.\n *\n * Filtering is the first derived row-model stage, so this currently aliases\n * `table.getCoreRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeFiltering = table_getPreFilteredRowModel(table)\n * ```\n */\nexport function table_getPreFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getCoreRowModel()\n}\n\n/**\n * Resolves the row model after column and global filtering.\n *\n * When `manualFiltering` is enabled, or no filtered row-model factory was\n * registered, this returns the pre-filtered row model because filtering is\n * expected to happen outside the table.\n *\n * @example\n * ```ts\n * const filteredRows = table_getFilteredRowModel(table)\n * ```\n */\nexport function table_getFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.filteredRowModel) {\n table._rowModels.filteredRowModel =\n table.options.features.filteredRowModel?.(table)\n }\n\n if (table.options.manualFiltering || !table._rowModels.filteredRowModel) {\n return table.getPreFilteredRowModel()\n }\n\n return table._rowModels.filteredRowModel()\n}\n\n/**\n * Reads the row model immediately before grouping.\n *\n * Grouping runs after filtering, so this aliases `table.getFilteredRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeGrouping = table_getPreGroupedRowModel(table)\n * ```\n */\nexport function table_getPreGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getFilteredRowModel()\n}\n\n/**\n * Resolves the row model after grouping has produced grouped and aggregated rows.\n *\n * When `manualGrouping` is enabled, or no grouped row-model factory was\n * registered, this returns the pre-grouped row model unchanged.\n *\n * @example\n * ```ts\n * const groupedRows = table_getGroupedRowModel(table)\n * ```\n */\nexport function table_getGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.groupedRowModel) {\n table._rowModels.groupedRowModel =\n table.options.features.groupedRowModel?.(table)\n }\n\n if (table.options.manualGrouping || !table._rowModels.groupedRowModel) {\n return table.getPreGroupedRowModel()\n }\n\n return table._rowModels.groupedRowModel()\n}\n\n/**\n * Reads the row model immediately before sorting.\n *\n * Sorting runs after grouping, so this aliases `table.getGroupedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeSorting = table_getPreSortedRowModel(table)\n * ```\n */\nexport function table_getPreSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getGroupedRowModel()\n}\n\n/**\n * Resolves the row model after sorting has been applied.\n *\n * When `manualSorting` is enabled, or no sorted row-model factory was\n * registered, this returns the pre-sorted row model because sorted data is\n * expected to be supplied by the caller.\n *\n * @example\n * ```ts\n * const sortedRows = table_getSortedRowModel(table)\n * ```\n */\nexport function table_getSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.sortedRowModel) {\n table._rowModels.sortedRowModel =\n table.options.features.sortedRowModel?.(table)\n }\n\n if (table.options.manualSorting || !table._rowModels.sortedRowModel) {\n return table.getPreSortedRowModel()\n }\n\n return table._rowModels.sortedRowModel()\n}\n\n/**\n * Reads the row model immediately before row expansion.\n *\n * Expansion runs after sorting, so this aliases `table.getSortedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeExpansion = table_getPreExpandedRowModel(table)\n * ```\n */\nexport function table_getPreExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getSortedRowModel()\n}\n\n/**\n * Resolves the row model after expanded rows have been flattened into view.\n *\n * When `manualExpanding` is enabled, or no expanded row-model factory was\n * registered, this returns the pre-expanded row model unchanged.\n *\n * @example\n * ```ts\n * const expandedRows = table_getExpandedRowModel(table)\n * ```\n */\nexport function table_getExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.expandedRowModel) {\n table._rowModels.expandedRowModel =\n table.options.features.expandedRowModel?.(table)\n }\n\n if (table.options.manualExpanding || !table._rowModels.expandedRowModel) {\n return table.getPreExpandedRowModel()\n }\n\n return table._rowModels.expandedRowModel()\n}\n\n/**\n * Reads the row model immediately before pagination.\n *\n * Pagination is the final built-in row-model stage, so this aliases\n * `table.getExpandedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforePagination = table_getPrePaginatedRowModel(table)\n * ```\n */\nexport function table_getPrePaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getExpandedRowModel()\n}\n\n/**\n * Resolves the row model after pagination has sliced rows for the current page.\n *\n * When `manualPagination` is enabled, or no paginated row-model factory was\n * registered, this returns the pre-paginated row model because pagination is\n * expected to happen before data reaches the table.\n *\n * @example\n * ```ts\n * const pageRows = table_getPaginatedRowModel(table)\n * ```\n */\nexport function table_getPaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.paginatedRowModel) {\n table._rowModels.paginatedRowModel =\n table.options.features.paginatedRowModel?.(table)\n }\n\n if (table.options.manualPagination || !table._rowModels.paginatedRowModel) {\n return table.getPrePaginatedRowModel()\n }\n\n return table._rowModels.paginatedRowModel()\n}\n\n/**\n * Resolves the final row model consumed by renderers.\n *\n * This is the end of the built-in row-model pipeline: core -> filtering ->\n * grouping -> sorting -> expanding -> pagination.\n *\n * @example\n * ```ts\n * const visibleRows = table_getRowModel(table)\n * ```\n */\nexport function table_getRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getPaginatedRowModel()\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,sBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,cACpB,MAAM,WAAW,eACf,MAAM,QAAQ,SAAS,eAAe,KAAK,KAC3C,mBAAqC,CAAC,CAAC,KAAK;CAGhD,OAAO,MAAM,WAAW,aAAa;AACvC;;;;;;;;;;;;AAaA,SAAgB,6BAGd,OAAqE;CACrE,OAAO,MAAM,gBAAgB;AAC/B;;;;;;;;;;;;;AAcA,SAAgB,0BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,kBACpB,MAAM,WAAW,mBACf,MAAM,QAAQ,SAAS,mBAAmB,KAAK;CAGnD,IAAI,MAAM,QAAQ,mBAAmB,CAAC,MAAM,WAAW,kBACrD,OAAO,MAAM,uBAAuB;CAGtC,OAAO,MAAM,WAAW,iBAAiB;AAC3C;;;;;;;;;;;AAYA,SAAgB,4BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;AAaA,SAAgB,yBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,iBACpB,MAAM,WAAW,kBACf,MAAM,QAAQ,SAAS,kBAAkB,KAAK;CAGlD,IAAI,MAAM,QAAQ,kBAAkB,CAAC,MAAM,WAAW,iBACpD,OAAO,MAAM,sBAAsB;CAGrC,OAAO,MAAM,WAAW,gBAAgB;AAC1C;;;;;;;;;;;AAYA,SAAgB,2BAGd,OAAqE;CACrE,OAAO,MAAM,mBAAmB;AAClC;;;;;;;;;;;;;AAcA,SAAgB,wBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,gBACpB,MAAM,WAAW,iBACf,MAAM,QAAQ,SAAS,iBAAiB,KAAK;CAGjD,IAAI,MAAM,QAAQ,iBAAiB,CAAC,MAAM,WAAW,gBACnD,OAAO,MAAM,qBAAqB;CAGpC,OAAO,MAAM,WAAW,eAAe;AACzC;;;;;;;;;;;AAYA,SAAgB,6BAGd,OAAqE;CACrE,OAAO,MAAM,kBAAkB;AACjC;;;;;;;;;;;;AAaA,SAAgB,0BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,kBACpB,MAAM,WAAW,mBACf,MAAM,QAAQ,SAAS,mBAAmB,KAAK;CAGnD,IAAI,MAAM,QAAQ,mBAAmB,CAAC,MAAM,WAAW,kBACrD,OAAO,MAAM,uBAAuB;CAGtC,OAAO,MAAM,WAAW,iBAAiB;AAC3C;;;;;;;;;;;;AAaA,SAAgB,8BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;;AAcA,SAAgB,2BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,mBACpB,MAAM,WAAW,oBACf,MAAM,QAAQ,SAAS,oBAAoB,KAAK;CAGpD,IAAI,MAAM,QAAQ,oBAAoB,CAAC,MAAM,WAAW,mBACtD,OAAO,MAAM,wBAAwB;CAGvC,OAAO,MAAM,WAAW,kBAAkB;AAC5C;;;;;;;;;;;;AAaA,SAAgB,kBAGd,OAAqE;CACrE,OAAO,MAAM,qBAAqB;AACpC"}
1
+ {"version":3,"file":"coreRowModelsFeature.utils.js","names":[],"sources":["../../../src/core/row-models/coreRowModelsFeature.utils.ts"],"sourcesContent":["import { createCoreRowModel } from './createCoreRowModel'\nimport type { Table_Internal } from '../../types/Table'\nimport type { TableFeatures } from '../../types/TableFeatures'\nimport type { RowData } from '../../types/type-utils'\nimport type { RowModel } from './coreRowModelsFeature.types'\n\n/**\n * Resolves the table's unmodified core row model.\n *\n * The factory is created once per table, either from the `coreRowModel` slot on the `features` option\n * or the built-in `createCoreRowModel()`, then reused for later calls.\n *\n * @example\n * ```ts\n * const coreRows = table_getCoreRowModel(table)\n * ```\n */\nexport function table_getCoreRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.coreRowModel) {\n table._rowModels.coreRowModel =\n table.options.features.coreRowModel?.(table) ??\n createCoreRowModel<TFeatures, TData>()(table)\n }\n\n return table._rowModels.coreRowModel()\n}\n\n/**\n * Reads the row model immediately before column/global filtering.\n *\n * Filtering is the first derived row-model stage, so this currently aliases\n * `table.getCoreRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeFiltering = table_getPreFilteredRowModel(table)\n * ```\n */\nexport function table_getPreFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getCoreRowModel()\n}\n\n/**\n * Resolves the row model after column and global filtering.\n *\n * When `manualFiltering` is enabled, or no filtered row-model factory was\n * registered, this returns the pre-filtered row model because filtering is\n * expected to happen outside the table.\n *\n * @example\n * ```ts\n * const filteredRows = table_getFilteredRowModel(table)\n * ```\n */\nexport function table_getFilteredRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.filteredRowModel) {\n table._rowModels.filteredRowModel =\n table.options.features.filteredRowModel?.(table)\n }\n\n if (table.options.manualFiltering || !table._rowModels.filteredRowModel) {\n return table.getPreFilteredRowModel()\n }\n\n return table._rowModels.filteredRowModel()\n}\n\n/**\n * Reads the row model immediately before grouping.\n *\n * Grouping runs after filtering, so this aliases `table.getFilteredRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeGrouping = table_getPreGroupedRowModel(table)\n * ```\n */\nexport function table_getPreGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getFilteredRowModel()\n}\n\n/**\n * Resolves the row model after grouping has produced grouped rows.\n *\n * When `manualGrouping` is enabled, or no grouped row-model factory was\n * registered, this returns the pre-grouped row model unchanged.\n *\n * @example\n * ```ts\n * const groupedRows = table_getGroupedRowModel(table)\n * ```\n */\nexport function table_getGroupedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.groupedRowModel) {\n table._rowModels.groupedRowModel =\n table.options.features.groupedRowModel?.(table)\n }\n\n if (table.options.manualGrouping || !table._rowModels.groupedRowModel) {\n return table.getPreGroupedRowModel()\n }\n\n return table._rowModels.groupedRowModel()\n}\n\n/**\n * Reads the row model immediately before sorting.\n *\n * Sorting runs after grouping, so this aliases `table.getGroupedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeSorting = table_getPreSortedRowModel(table)\n * ```\n */\nexport function table_getPreSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getGroupedRowModel()\n}\n\n/**\n * Resolves the row model after sorting has been applied.\n *\n * When `manualSorting` is enabled, or no sorted row-model factory was\n * registered, this returns the pre-sorted row model because sorted data is\n * expected to be supplied by the caller.\n *\n * @example\n * ```ts\n * const sortedRows = table_getSortedRowModel(table)\n * ```\n */\nexport function table_getSortedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.sortedRowModel) {\n table._rowModels.sortedRowModel =\n table.options.features.sortedRowModel?.(table)\n }\n\n if (table.options.manualSorting || !table._rowModels.sortedRowModel) {\n return table.getPreSortedRowModel()\n }\n\n return table._rowModels.sortedRowModel()\n}\n\n/**\n * Reads the row model immediately before row expansion.\n *\n * Expansion runs after sorting, so this aliases `table.getSortedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforeExpansion = table_getPreExpandedRowModel(table)\n * ```\n */\nexport function table_getPreExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getSortedRowModel()\n}\n\n/**\n * Resolves the row model after expanded rows have been flattened into view.\n *\n * When `manualExpanding` is enabled, or no expanded row-model factory was\n * registered, this returns the pre-expanded row model unchanged.\n *\n * @example\n * ```ts\n * const expandedRows = table_getExpandedRowModel(table)\n * ```\n */\nexport function table_getExpandedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.expandedRowModel) {\n table._rowModels.expandedRowModel =\n table.options.features.expandedRowModel?.(table)\n }\n\n if (table.options.manualExpanding || !table._rowModels.expandedRowModel) {\n return table.getPreExpandedRowModel()\n }\n\n return table._rowModels.expandedRowModel()\n}\n\n/**\n * Reads the row model immediately before pagination.\n *\n * Pagination is the final built-in row-model stage, so this aliases\n * `table.getExpandedRowModel()`.\n *\n * @example\n * ```ts\n * const rowsBeforePagination = table_getPrePaginatedRowModel(table)\n * ```\n */\nexport function table_getPrePaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getExpandedRowModel()\n}\n\n/**\n * Resolves the row model after pagination has sliced rows for the current page.\n *\n * When `manualPagination` is enabled, or no paginated row-model factory was\n * registered, this returns the pre-paginated row model because pagination is\n * expected to happen before data reaches the table.\n *\n * @example\n * ```ts\n * const pageRows = table_getPaginatedRowModel(table)\n * ```\n */\nexport function table_getPaginatedRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n if (!table._rowModels.paginatedRowModel) {\n table._rowModels.paginatedRowModel =\n table.options.features.paginatedRowModel?.(table)\n }\n\n if (table.options.manualPagination || !table._rowModels.paginatedRowModel) {\n return table.getPrePaginatedRowModel()\n }\n\n return table._rowModels.paginatedRowModel()\n}\n\n/**\n * Resolves the final row model consumed by renderers.\n *\n * This is the end of the built-in row-model pipeline: core -> filtering ->\n * grouping -> sorting -> expanding -> pagination.\n *\n * @example\n * ```ts\n * const visibleRows = table_getRowModel(table)\n * ```\n */\nexport function table_getRowModel<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(table: Table_Internal<TFeatures, TData>): RowModel<TFeatures, TData> {\n return table.getPaginatedRowModel()\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,sBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,cACpB,MAAM,WAAW,eACf,MAAM,QAAQ,SAAS,eAAe,KAAK,KAC3C,mBAAqC,CAAC,CAAC,KAAK;CAGhD,OAAO,MAAM,WAAW,aAAa;AACvC;;;;;;;;;;;;AAaA,SAAgB,6BAGd,OAAqE;CACrE,OAAO,MAAM,gBAAgB;AAC/B;;;;;;;;;;;;;AAcA,SAAgB,0BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,kBACpB,MAAM,WAAW,mBACf,MAAM,QAAQ,SAAS,mBAAmB,KAAK;CAGnD,IAAI,MAAM,QAAQ,mBAAmB,CAAC,MAAM,WAAW,kBACrD,OAAO,MAAM,uBAAuB;CAGtC,OAAO,MAAM,WAAW,iBAAiB;AAC3C;;;;;;;;;;;AAYA,SAAgB,4BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;AAaA,SAAgB,yBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,iBACpB,MAAM,WAAW,kBACf,MAAM,QAAQ,SAAS,kBAAkB,KAAK;CAGlD,IAAI,MAAM,QAAQ,kBAAkB,CAAC,MAAM,WAAW,iBACpD,OAAO,MAAM,sBAAsB;CAGrC,OAAO,MAAM,WAAW,gBAAgB;AAC1C;;;;;;;;;;;AAYA,SAAgB,2BAGd,OAAqE;CACrE,OAAO,MAAM,mBAAmB;AAClC;;;;;;;;;;;;;AAcA,SAAgB,wBAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,gBACpB,MAAM,WAAW,iBACf,MAAM,QAAQ,SAAS,iBAAiB,KAAK;CAGjD,IAAI,MAAM,QAAQ,iBAAiB,CAAC,MAAM,WAAW,gBACnD,OAAO,MAAM,qBAAqB;CAGpC,OAAO,MAAM,WAAW,eAAe;AACzC;;;;;;;;;;;AAYA,SAAgB,6BAGd,OAAqE;CACrE,OAAO,MAAM,kBAAkB;AACjC;;;;;;;;;;;;AAaA,SAAgB,0BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,kBACpB,MAAM,WAAW,mBACf,MAAM,QAAQ,SAAS,mBAAmB,KAAK;CAGnD,IAAI,MAAM,QAAQ,mBAAmB,CAAC,MAAM,WAAW,kBACrD,OAAO,MAAM,uBAAuB;CAGtC,OAAO,MAAM,WAAW,iBAAiB;AAC3C;;;;;;;;;;;;AAaA,SAAgB,8BAGd,OAAqE;CACrE,OAAO,MAAM,oBAAoB;AACnC;;;;;;;;;;;;;AAcA,SAAgB,2BAGd,OAAqE;CACrE,IAAI,CAAC,MAAM,WAAW,mBACpB,MAAM,WAAW,oBACf,MAAM,QAAQ,SAAS,oBAAoB,KAAK;CAGpD,IAAI,MAAM,QAAQ,oBAAoB,CAAC,MAAM,WAAW,mBACtD,OAAO,MAAM,wBAAwB;CAGvC,OAAO,MAAM,WAAW,kBAAkB;AAC5C;;;;;;;;;;;;AAaA,SAAgB,kBAGd,OAAqE;CACrE,OAAO,MAAM,qBAAqB;AACpC"}
@@ -0,0 +1,38 @@
1
+ const require_utils = require('../../utils.cjs');
2
+ const require_aggregationFeature_utils = require('./aggregationFeature.utils.cjs');
3
+
4
+ //#region src/features/aggregation/aggregationFeature.ts
5
+ /**
6
+ * Independent aggregation feature for grouped values and root/custom-row totals.
7
+ */
8
+ const aggregationFeature = {
9
+ getDefaultColumnDef: () => ({
10
+ aggregatedCell: ({ column, getValue }) => require_aggregationFeature_utils.formatAggregatedCellValue(getValue(), column.columnDef.aggregationFn),
11
+ aggregationFn: "auto"
12
+ }),
13
+ getDefaultTableOptions: () => ({ manualAggregation: false }),
14
+ assignCellPrototype: (prototype, table) => {
15
+ require_utils.assignPrototypeAPIs("aggregationFeature", prototype, table, { cell_getIsAggregated: { fn: (cell) => require_aggregationFeature_utils.cell_getIsAggregated(cell) } });
16
+ },
17
+ assignColumnPrototype: (prototype, table) => {
18
+ require_utils.assignPrototypeAPIs("aggregationFeature", prototype, table, {
19
+ column_getAggregationFns: { fn: (column) => require_aggregationFeature_utils.column_getAggregationFns(column) },
20
+ column_getAggregationValue: { fn: (column, rows) => require_aggregationFeature_utils.column_getAggregationValue(column, rows) },
21
+ column_getAutoAggregationFn: {
22
+ fn: (column) => require_aggregationFeature_utils.column_getAutoAggregationFn(column),
23
+ memoDeps: (column) => [column.table.getCoreRowModel(), column.table._rowModelFns.aggregationFns]
24
+ }
25
+ });
26
+ },
27
+ initColumnInstanceData: (column) => {
28
+ column._aggregationValueCache = void 0;
29
+ column._resolvedAggregationFnsCache = void 0;
30
+ },
31
+ initRowInstanceData: (row) => {
32
+ row._aggregationValuesCache = require_utils.makeObjectMap();
33
+ }
34
+ };
35
+
36
+ //#endregion
37
+ exports.aggregationFeature = aggregationFeature;
38
+ //# sourceMappingURL=aggregationFeature.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregationFeature.cjs","names":["formatAggregatedCellValue","cell_getIsAggregated","column_getAggregationFns","column_getAggregationValue","column_getAutoAggregationFn","makeObjectMap"],"sources":["../../../src/features/aggregation/aggregationFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, makeObjectMap } from '../../utils'\nimport {\n cell_getIsAggregated,\n column_getAggregationFns,\n column_getAggregationValue,\n column_getAutoAggregationFn,\n formatAggregatedCellValue,\n} from './aggregationFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Independent aggregation feature for grouped values and root/custom-row totals.\n */\nexport const aggregationFeature: TableFeature = {\n getDefaultColumnDef: () => ({\n aggregatedCell: ({ column, getValue }: any) =>\n formatAggregatedCellValue(getValue(), column.columnDef.aggregationFn),\n aggregationFn: 'auto',\n }),\n\n getDefaultTableOptions: () => ({\n manualAggregation: false,\n }),\n\n assignCellPrototype: (prototype, table) => {\n assignPrototypeAPIs('aggregationFeature', prototype, table, {\n cell_getIsAggregated: {\n fn: (cell) => cell_getIsAggregated(cell),\n },\n })\n },\n\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('aggregationFeature', prototype, table, {\n column_getAggregationFns: {\n fn: (column) => column_getAggregationFns(column),\n },\n column_getAggregationValue: {\n fn: (column, rows) => column_getAggregationValue(column, rows),\n },\n column_getAutoAggregationFn: {\n fn: (column) => column_getAutoAggregationFn(column),\n memoDeps: (column) => [\n column.table.getCoreRowModel(),\n column.table._rowModelFns.aggregationFns,\n ],\n },\n })\n },\n\n initColumnInstanceData: (column) => {\n ;(column as any)._aggregationValueCache = undefined\n ;(column as any)._resolvedAggregationFnsCache = undefined\n },\n\n initRowInstanceData: (row) => {\n ;(row as any)._aggregationValuesCache = makeObjectMap()\n },\n}\n"],"mappings":";;;;;;;AAaA,MAAa,qBAAmC;CAC9C,4BAA4B;EAC1B,iBAAiB,EAAE,QAAQ,eACzBA,2DAA0B,SAAS,GAAG,OAAO,UAAU,aAAa;EACtE,eAAe;CACjB;CAEA,+BAA+B,EAC7B,mBAAmB,MACrB;CAEA,sBAAsB,WAAW,UAAU;EACzC,kCAAoB,sBAAsB,WAAW,OAAO,EAC1D,sBAAsB,EACpB,KAAK,SAASC,sDAAqB,IAAI,EACzC,EACF,CAAC;CACH;CAEA,wBAAwB,WAAW,UAAU;EAC3C,kCAAoB,sBAAsB,WAAW,OAAO;GAC1D,0BAA0B,EACxB,KAAK,WAAWC,0DAAyB,MAAM,EACjD;GACA,4BAA4B,EAC1B,KAAK,QAAQ,SAASC,4DAA2B,QAAQ,IAAI,EAC/D;GACA,6BAA6B;IAC3B,KAAK,WAAWC,6DAA4B,MAAM;IAClD,WAAW,WAAW,CACpB,OAAO,MAAM,gBAAgB,GAC7B,OAAO,MAAM,aAAa,cAC5B;GACF;EACF,CAAC;CACH;CAEA,yBAAyB,WAAW;EACjC,AAAC,OAAe,yBAAyB;EACzC,AAAC,OAAe,+BAA+B;CAClD;CAEA,sBAAsB,QAAQ;EAC3B,AAAC,IAAY,0BAA0BC,4BAAc;CACxD;AACF"}
@@ -0,0 +1,10 @@
1
+ import { TableFeature } from "../../types/TableFeatures.cjs";
2
+
3
+ //#region src/features/aggregation/aggregationFeature.d.ts
4
+ /**
5
+ * Independent aggregation feature for grouped values and root/custom-row totals.
6
+ */
7
+ declare const aggregationFeature: TableFeature;
8
+ //#endregion
9
+ export { aggregationFeature };
10
+ //# sourceMappingURL=aggregationFeature.d.cts.map
@@ -0,0 +1,10 @@
1
+ import { TableFeature } from "../../types/TableFeatures.js";
2
+
3
+ //#region src/features/aggregation/aggregationFeature.d.ts
4
+ /**
5
+ * Independent aggregation feature for grouped values and root/custom-row totals.
6
+ */
7
+ declare const aggregationFeature: TableFeature;
8
+ //#endregion
9
+ export { aggregationFeature };
10
+ //# sourceMappingURL=aggregationFeature.d.ts.map
@@ -0,0 +1,38 @@
1
+ import { assignPrototypeAPIs, makeObjectMap } from "../../utils.js";
2
+ import { cell_getIsAggregated, column_getAggregationFns, column_getAggregationValue, column_getAutoAggregationFn, formatAggregatedCellValue } from "./aggregationFeature.utils.js";
3
+
4
+ //#region src/features/aggregation/aggregationFeature.ts
5
+ /**
6
+ * Independent aggregation feature for grouped values and root/custom-row totals.
7
+ */
8
+ const aggregationFeature = {
9
+ getDefaultColumnDef: () => ({
10
+ aggregatedCell: ({ column, getValue }) => formatAggregatedCellValue(getValue(), column.columnDef.aggregationFn),
11
+ aggregationFn: "auto"
12
+ }),
13
+ getDefaultTableOptions: () => ({ manualAggregation: false }),
14
+ assignCellPrototype: (prototype, table) => {
15
+ assignPrototypeAPIs("aggregationFeature", prototype, table, { cell_getIsAggregated: { fn: (cell) => cell_getIsAggregated(cell) } });
16
+ },
17
+ assignColumnPrototype: (prototype, table) => {
18
+ assignPrototypeAPIs("aggregationFeature", prototype, table, {
19
+ column_getAggregationFns: { fn: (column) => column_getAggregationFns(column) },
20
+ column_getAggregationValue: { fn: (column, rows) => column_getAggregationValue(column, rows) },
21
+ column_getAutoAggregationFn: {
22
+ fn: (column) => column_getAutoAggregationFn(column),
23
+ memoDeps: (column) => [column.table.getCoreRowModel(), column.table._rowModelFns.aggregationFns]
24
+ }
25
+ });
26
+ },
27
+ initColumnInstanceData: (column) => {
28
+ column._aggregationValueCache = void 0;
29
+ column._resolvedAggregationFnsCache = void 0;
30
+ },
31
+ initRowInstanceData: (row) => {
32
+ row._aggregationValuesCache = makeObjectMap();
33
+ }
34
+ };
35
+
36
+ //#endregion
37
+ export { aggregationFeature };
38
+ //# sourceMappingURL=aggregationFeature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregationFeature.js","names":[],"sources":["../../../src/features/aggregation/aggregationFeature.ts"],"sourcesContent":["import { assignPrototypeAPIs, makeObjectMap } from '../../utils'\nimport {\n cell_getIsAggregated,\n column_getAggregationFns,\n column_getAggregationValue,\n column_getAutoAggregationFn,\n formatAggregatedCellValue,\n} from './aggregationFeature.utils'\nimport type { TableFeature } from '../../types/TableFeatures'\n\n/**\n * Independent aggregation feature for grouped values and root/custom-row totals.\n */\nexport const aggregationFeature: TableFeature = {\n getDefaultColumnDef: () => ({\n aggregatedCell: ({ column, getValue }: any) =>\n formatAggregatedCellValue(getValue(), column.columnDef.aggregationFn),\n aggregationFn: 'auto',\n }),\n\n getDefaultTableOptions: () => ({\n manualAggregation: false,\n }),\n\n assignCellPrototype: (prototype, table) => {\n assignPrototypeAPIs('aggregationFeature', prototype, table, {\n cell_getIsAggregated: {\n fn: (cell) => cell_getIsAggregated(cell),\n },\n })\n },\n\n assignColumnPrototype: (prototype, table) => {\n assignPrototypeAPIs('aggregationFeature', prototype, table, {\n column_getAggregationFns: {\n fn: (column) => column_getAggregationFns(column),\n },\n column_getAggregationValue: {\n fn: (column, rows) => column_getAggregationValue(column, rows),\n },\n column_getAutoAggregationFn: {\n fn: (column) => column_getAutoAggregationFn(column),\n memoDeps: (column) => [\n column.table.getCoreRowModel(),\n column.table._rowModelFns.aggregationFns,\n ],\n },\n })\n },\n\n initColumnInstanceData: (column) => {\n ;(column as any)._aggregationValueCache = undefined\n ;(column as any)._resolvedAggregationFnsCache = undefined\n },\n\n initRowInstanceData: (row) => {\n ;(row as any)._aggregationValuesCache = makeObjectMap()\n },\n}\n"],"mappings":";;;;;;;AAaA,MAAa,qBAAmC;CAC9C,4BAA4B;EAC1B,iBAAiB,EAAE,QAAQ,eACzB,0BAA0B,SAAS,GAAG,OAAO,UAAU,aAAa;EACtE,eAAe;CACjB;CAEA,+BAA+B,EAC7B,mBAAmB,MACrB;CAEA,sBAAsB,WAAW,UAAU;EACzC,oBAAoB,sBAAsB,WAAW,OAAO,EAC1D,sBAAsB,EACpB,KAAK,SAAS,qBAAqB,IAAI,EACzC,EACF,CAAC;CACH;CAEA,wBAAwB,WAAW,UAAU;EAC3C,oBAAoB,sBAAsB,WAAW,OAAO;GAC1D,0BAA0B,EACxB,KAAK,WAAW,yBAAyB,MAAM,EACjD;GACA,4BAA4B,EAC1B,KAAK,QAAQ,SAAS,2BAA2B,QAAQ,IAAI,EAC/D;GACA,6BAA6B;IAC3B,KAAK,WAAW,4BAA4B,MAAM;IAClD,WAAW,WAAW,CACpB,OAAO,MAAM,gBAAgB,GAC7B,OAAO,MAAM,aAAa,cAC5B;GACF;EACF,CAAC;CACH;CAEA,yBAAyB,WAAW;EACjC,AAAC,OAAe,yBAAyB;EACzC,AAAC,OAAe,+BAA+B;CAClD;CAEA,sBAAsB,QAAQ;EAC3B,AAAC,IAAY,0BAA0B,cAAc;CACxD;AACF"}
@@ -0,0 +1,13 @@
1
+
2
+ //#region src/features/aggregation/aggregationFeature.types.ts
3
+ /**
4
+ * Creates a typed context-based aggregation definition for a column or
5
+ * aggregation-function registry.
6
+ */
7
+ function constructAggregationFn(definition) {
8
+ return definition;
9
+ }
10
+
11
+ //#endregion
12
+ exports.constructAggregationFn = constructAggregationFn;
13
+ //# sourceMappingURL=aggregationFeature.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregationFeature.types.cjs","names":[],"sources":["../../../src/features/aggregation/aggregationFeature.types.ts"],"sourcesContent":["import type { BuiltInAggregationFn } from './aggregationFns'\nimport type { Cell } from '../../types/Cell'\nimport type { Column } from '../../types/Column'\nimport type { ColumnDefTemplate } from '../../types/ColumnDef'\nimport type { IsAny, TableFeatures } from '../../types/TableFeatures'\nimport type { Row } from '../../types/Row'\nimport type { Table } from '../../types/Table'\nimport type { CellData, RowData } from '../../types/type-utils'\n\n/** Declaration-merging fallback for named aggregation definitions. */\nexport interface AggregationFns {}\n\n/** Values and table objects available while one aggregation is evaluated. */\nexport interface AggregationContext<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue = unknown,\n> {\n /** The column whose values are being aggregated. */\n column: Column<TFeatures, TData, TValue>\n /** Convenience alias for `column.id`. */\n columnId: string\n /** Reads this column's value from one of `rows`. */\n getValue: (row: Row<TFeatures, TData>) => TValue\n /**\n * The synthetic grouped row receiving this result. This property is omitted\n * for root or caller-supplied-row aggregation. Its `depth` identifies the\n * grouping level when grouped aggregation needs that distinction.\n */\n groupingRow?: Row<TFeatures, TData>\n /**\n * Terminal leaf rows included in this aggregation. The executor normalizes\n * hierarchical and duplicate row inputs before invoking the definition.\n */\n rows: ReadonlyArray<Row<TFeatures, TData>>\n /** The table that owns the column and rows. */\n table: Table<TFeatures, TData>\n}\n\n/** Additional values available when merging nested grouped results. */\nexport interface AggregationMergeContext<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue,\n TResult,\n> extends AggregationContext<TFeatures, TData, TValue> {\n /** Results produced for each immediate child group, in child-row order. */\n childResults: ReadonlyArray<TResult>\n /** Immediate child group rows corresponding to `childResults`. */\n childRows: ReadonlyArray<Row<TFeatures, TData>>\n}\n\n/** A context-based aggregation definition and optional grouped-result merge. */\nexport interface AggregationFnDef<\n TFeatures extends TableFeatures = any,\n TData extends RowData = any,\n TValue = unknown,\n TResult = unknown,\n> {\n /** Computes a result directly from normalized terminal rows. */\n aggregate: (context: AggregationContext<TFeatures, TData, TValue>) => TResult\n /**\n * Combines already-computed immediate child-group results. When omitted,\n * nested grouping falls back to `aggregate` over the group's terminal rows.\n */\n merge?: (\n context: AggregationMergeContext<TFeatures, TData, TValue, TResult>,\n ) => TResult\n}\n\n/**\n * Creates a typed context-based aggregation definition for a column or\n * aggregation-function registry.\n */\nexport function constructAggregationFn<\n TFeatures extends TableFeatures = any,\n TData extends RowData = any,\n TValue = unknown,\n TResult = unknown,\n>(\n definition: AggregationFnDef<TFeatures, TData, TValue, TResult>,\n): AggregationFnDef<TFeatures, TData, TValue, TResult> {\n return definition\n}\n\n/** Aggregation-definition registry carried by a table feature set. */\nexport interface RowModelFns_Aggregation<\n in out TFeatures extends TableFeatures,\n in out TData extends RowData,\n> {\n aggregationFns: Record<string, AggregationFnDef<TFeatures, TData, any, any>>\n}\n\n/** Named context-based aggregation definitions registered on a feature set. */\nexport type CustomAggregationFns<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> = Record<string, AggregationFnDef<TFeatures, TData, any, any>>\n\n/** String names available from a feature set's aggregation registry. */\nexport type ExtractAggregationFnKeys<TFeatures extends TableFeatures> =\n IsAny<TFeatures> extends true\n ? keyof AggregationFns | BuiltInAggregationFn\n : TFeatures extends { aggregationFns: infer TAggregationFns extends object }\n ? Extract<keyof TAggregationFns, string>\n : keyof AggregationFns\n\n/** A registered name, automatic inference, or inline aggregation definition. */\nexport type AggregationFnRef<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue = unknown,\n TResult = unknown,\n> =\n | 'auto'\n | ExtractAggregationFnKeys<TFeatures>\n | AggregationFnDef<TFeatures, TData, TValue, TResult>\n\n/** Gives an aggregation reference a stable key in a multiple result. */\nexport interface AggregationFnDescriptor<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue = unknown,\n TResult = unknown,\n> {\n /** The named, automatic, or inline definition to execute. */\n aggregationFn: AggregationFnRef<TFeatures, TData, TValue, TResult>\n /** Stable key used in the object returned by a multiple aggregation. */\n id: string\n}\n\n/** One named or explicitly keyed entry in a multiple aggregation option. */\nexport type AggregationFnListItem<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue = unknown,\n> =\n | 'auto'\n | ExtractAggregationFnKeys<TFeatures>\n | AggregationFnDescriptor<TFeatures, TData, TValue, any>\n\n/** A scalar aggregation reference or a list that produces a keyed object. */\nexport type AggregationFnOption<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue = unknown,\n> =\n | AggregationFnRef<TFeatures, TData, TValue, any>\n | ReadonlyArray<AggregationFnListItem<TFeatures, TData, TValue>>\n\n/** Extracts the result type produced by an aggregation definition. */\nexport type AggregationResultOf<TDefinition> =\n TDefinition extends AggregationFnDef<any, any, any, infer TResult>\n ? TResult\n : unknown\n\ntype RegisteredAggregationDefinition<\n TFeatures extends TableFeatures,\n TKey extends PropertyKey,\n> = TFeatures extends {\n aggregationFns: infer TRegistry extends Record<PropertyKey, unknown>\n}\n ? TKey extends keyof TRegistry\n ? TRegistry[TKey]\n : never\n : never\n\ntype AggregationResultOfRef<TRef, TFeatures extends TableFeatures> =\n TRef extends AggregationFnDef<any, any, any, any>\n ? AggregationResultOf<TRef>\n : TRef extends 'auto'\n ? RegisteredAggregationResult<TFeatures>\n : TRef extends PropertyKey\n ? AggregationResultOf<RegisteredAggregationDefinition<TFeatures, TRef>>\n : unknown\n\ntype AggregationEntryId<TEntry> = TEntry extends string\n ? TEntry\n : TEntry extends { id: infer TId extends string }\n ? TId\n : never\n\ntype AggregationEntryDefinition<TEntry> = TEntry extends {\n aggregationFn: infer TDefinition\n}\n ? TDefinition\n : TEntry\n\n/** Infers the scalar or keyed result produced by an aggregation option. */\nexport type AggregationResult<TOption, TFeatures extends TableFeatures = any> =\n TOption extends ReadonlyArray<infer TEntry>\n ? {\n [TKey in AggregationEntryId<TEntry>]: AggregationResultOfRef<\n AggregationEntryDefinition<Extract<TEntry, TKey | { id: TKey }>>,\n TFeatures\n >\n }\n : AggregationResultOfRef<TOption, TFeatures>\n\ntype RegisteredAggregationResult<TFeatures extends TableFeatures> =\n TFeatures extends {\n aggregationFns: infer TRegistry extends Record<string, unknown>\n }\n ? AggregationResultOf<TRegistry[keyof TRegistry]>\n : unknown\n\n/** Default public result union when a column's precise option is not known. */\nexport type ColumnAggregationValue<TFeatures extends TableFeatures> =\n | RegisteredAggregationResult<TFeatures>\n | Record<string, RegisteredAggregationResult<TFeatures> | undefined>\n | undefined\n\n/** A validated aggregation entry returned by `column.getAggregationFns()`. */\nexport interface ResolvedAggregationFn<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> {\n /** Resolved definition, or `undefined` when configuration is invalid. */\n aggregationFn: AggregationFnDef<TFeatures, TData, any, any> | undefined\n /** Key used for a multiple result; scalar inline definitions have no id. */\n id: string | undefined\n}\n\n/** Column-definition options installed by `aggregationFeature`. */\nexport interface ColumnDef_Aggregation<\n in out TFeatures extends TableFeatures,\n in out TData extends RowData,\n TValue extends CellData = CellData,\n> {\n /** Renderer used for a grouped row's aggregated cell. */\n aggregatedCell?: ColumnDefTemplate<\n ReturnType<Cell<TFeatures, TData, TValue>['getContext']>\n >\n /**\n * One aggregation reference for a scalar result, or an array for a keyed\n * result object. Inline definitions in an array require an explicit `id`.\n */\n aggregationFn?: AggregationFnOption<TFeatures, TData, TValue>\n /**\n * Optionally supplies a precomputed aggregation value for this column.\n * Return `{ value }` to handle the request, including `{ value: undefined }`;\n * return `undefined` to use the local aggregation fallback.\n */\n getAggregationValue?: (\n context: AggregationValueContext<TFeatures, TData, TValue>,\n ) => AggregationValueResult | undefined\n}\n\n/** Column instance APIs installed by `aggregationFeature`. */\nexport interface Column_Aggregation<\n in out TFeatures extends TableFeatures,\n in out TData extends RowData,\n> {\n /** Resolves the configured scalar or multiple aggregation definitions. */\n getAggregationFns: () => ReadonlyArray<\n ResolvedAggregationFn<TFeatures, TData>\n >\n /**\n * Aggregates this column over the default pre-grouped row model, or over a\n * caller-provided array of rows. Explicit rows are normalized to unique\n * terminal leaves and are intentionally not cached.\n */\n getAggregationValue: <TResult = ColumnAggregationValue<TFeatures>>(\n rows?: ReadonlyArray<Row<TFeatures, TData>>,\n ) => TResult\n /** Infers `sum` for a numeric first row and `extent` for a Date first row. */\n getAutoAggregationFn: () =>\n | AggregationFnDef<TFeatures, TData, any, any>\n | undefined\n}\n\n/** Cell instance APIs installed by `aggregationFeature`. */\nexport interface Cell_Aggregation {\n /** Whether this cell displays an aggregate on a synthetic grouped row. */\n getIsAggregated: () => boolean\n}\n\n/** Internal per-row cache used while grouped aggregates are evaluated. */\nexport interface Row_Aggregation {\n /** Cached aggregate results keyed by column id. */\n _aggregationValuesCache: Record<string, unknown>\n}\n\n/** Values passed to a column-level aggregation-value provider. */\nexport interface AggregationValueContext<\n TFeatures extends TableFeatures,\n TData extends RowData,\n TValue extends CellData = CellData,\n> {\n /** The column whose value was requested. */\n column: Column<TFeatures, TData, TValue>\n /** Caller-provided rows, or `undefined` for the default row model. */\n rows?: ReadonlyArray<Row<TFeatures, TData>>\n /** The table that owns the column. */\n table: Table<TFeatures, TData>\n}\n\n/** Marks an aggregation-value override as handled. */\nexport interface AggregationValueResult<TResult = unknown> {\n /** The supplied value. `undefined` is still a handled result. */\n value: TResult\n}\n\n/** Table options installed by `aggregationFeature`. */\nexport interface TableOptions_Aggregation {\n /**\n * Disables local `column.getAggregationValue()` calculation when a column\n * override does not handle the request. Group values supplied by manually\n * grouped rows remain the responsibility of the data owner.\n */\n manualAggregation?: boolean\n}\n"],"mappings":";;;;;;AA0EA,SAAgB,uBAMd,YACqD;CACrD,OAAO;AACT"}
@@ -0,0 +1,172 @@
1
+ import { CellData, RowData } from "../../types/type-utils.cjs";
2
+ import { BuiltInAggregationFn } from "./aggregationFns.cjs";
3
+ import { ColumnDefTemplate } from "../../types/ColumnDef.cjs";
4
+ import { Cell } from "../../types/Cell.cjs";
5
+ import { Row } from "../../types/Row.cjs";
6
+ import { Table } from "../../types/Table.cjs";
7
+ import { Column } from "../../types/Column.cjs";
8
+ import { IsAny, TableFeatures } from "../../types/TableFeatures.cjs";
9
+
10
+ //#region src/features/aggregation/aggregationFeature.types.d.ts
11
+ /** Declaration-merging fallback for named aggregation definitions. */
12
+ interface AggregationFns {}
13
+ /** Values and table objects available while one aggregation is evaluated. */
14
+ interface AggregationContext<TFeatures extends TableFeatures, TData extends RowData, TValue = unknown> {
15
+ /** The column whose values are being aggregated. */
16
+ column: Column<TFeatures, TData, TValue>;
17
+ /** Convenience alias for `column.id`. */
18
+ columnId: string;
19
+ /** Reads this column's value from one of `rows`. */
20
+ getValue: (row: Row<TFeatures, TData>) => TValue;
21
+ /**
22
+ * The synthetic grouped row receiving this result. This property is omitted
23
+ * for root or caller-supplied-row aggregation. Its `depth` identifies the
24
+ * grouping level when grouped aggregation needs that distinction.
25
+ */
26
+ groupingRow?: Row<TFeatures, TData>;
27
+ /**
28
+ * Terminal leaf rows included in this aggregation. The executor normalizes
29
+ * hierarchical and duplicate row inputs before invoking the definition.
30
+ */
31
+ rows: ReadonlyArray<Row<TFeatures, TData>>;
32
+ /** The table that owns the column and rows. */
33
+ table: Table<TFeatures, TData>;
34
+ }
35
+ /** Additional values available when merging nested grouped results. */
36
+ interface AggregationMergeContext<TFeatures extends TableFeatures, TData extends RowData, TValue, TResult> extends AggregationContext<TFeatures, TData, TValue> {
37
+ /** Results produced for each immediate child group, in child-row order. */
38
+ childResults: ReadonlyArray<TResult>;
39
+ /** Immediate child group rows corresponding to `childResults`. */
40
+ childRows: ReadonlyArray<Row<TFeatures, TData>>;
41
+ }
42
+ /** A context-based aggregation definition and optional grouped-result merge. */
43
+ interface AggregationFnDef<TFeatures extends TableFeatures = any, TData extends RowData = any, TValue = unknown, TResult = unknown> {
44
+ /** Computes a result directly from normalized terminal rows. */
45
+ aggregate: (context: AggregationContext<TFeatures, TData, TValue>) => TResult;
46
+ /**
47
+ * Combines already-computed immediate child-group results. When omitted,
48
+ * nested grouping falls back to `aggregate` over the group's terminal rows.
49
+ */
50
+ merge?: (context: AggregationMergeContext<TFeatures, TData, TValue, TResult>) => TResult;
51
+ }
52
+ /**
53
+ * Creates a typed context-based aggregation definition for a column or
54
+ * aggregation-function registry.
55
+ */
56
+ declare function constructAggregationFn<TFeatures extends TableFeatures = any, TData extends RowData = any, TValue = unknown, TResult = unknown>(definition: AggregationFnDef<TFeatures, TData, TValue, TResult>): AggregationFnDef<TFeatures, TData, TValue, TResult>;
57
+ /** Aggregation-definition registry carried by a table feature set. */
58
+ interface RowModelFns_Aggregation<in out TFeatures extends TableFeatures, in out TData extends RowData> {
59
+ aggregationFns: Record<string, AggregationFnDef<TFeatures, TData, any, any>>;
60
+ }
61
+ /** Named context-based aggregation definitions registered on a feature set. */
62
+ type CustomAggregationFns<TFeatures extends TableFeatures, TData extends RowData> = Record<string, AggregationFnDef<TFeatures, TData, any, any>>;
63
+ /** String names available from a feature set's aggregation registry. */
64
+ type ExtractAggregationFnKeys<TFeatures extends TableFeatures> = IsAny<TFeatures> extends true ? keyof AggregationFns | BuiltInAggregationFn : TFeatures extends {
65
+ aggregationFns: infer TAggregationFns extends object;
66
+ } ? Extract<keyof TAggregationFns, string> : keyof AggregationFns;
67
+ /** A registered name, automatic inference, or inline aggregation definition. */
68
+ type AggregationFnRef<TFeatures extends TableFeatures, TData extends RowData, TValue = unknown, TResult = unknown> = 'auto' | ExtractAggregationFnKeys<TFeatures> | AggregationFnDef<TFeatures, TData, TValue, TResult>;
69
+ /** Gives an aggregation reference a stable key in a multiple result. */
70
+ interface AggregationFnDescriptor<TFeatures extends TableFeatures, TData extends RowData, TValue = unknown, TResult = unknown> {
71
+ /** The named, automatic, or inline definition to execute. */
72
+ aggregationFn: AggregationFnRef<TFeatures, TData, TValue, TResult>;
73
+ /** Stable key used in the object returned by a multiple aggregation. */
74
+ id: string;
75
+ }
76
+ /** One named or explicitly keyed entry in a multiple aggregation option. */
77
+ type AggregationFnListItem<TFeatures extends TableFeatures, TData extends RowData, TValue = unknown> = 'auto' | ExtractAggregationFnKeys<TFeatures> | AggregationFnDescriptor<TFeatures, TData, TValue, any>;
78
+ /** A scalar aggregation reference or a list that produces a keyed object. */
79
+ type AggregationFnOption<TFeatures extends TableFeatures, TData extends RowData, TValue = unknown> = AggregationFnRef<TFeatures, TData, TValue, any> | ReadonlyArray<AggregationFnListItem<TFeatures, TData, TValue>>;
80
+ /** Extracts the result type produced by an aggregation definition. */
81
+ type AggregationResultOf<TDefinition> = TDefinition extends AggregationFnDef<any, any, any, infer TResult> ? TResult : unknown;
82
+ type RegisteredAggregationDefinition<TFeatures extends TableFeatures, TKey extends PropertyKey> = TFeatures extends {
83
+ aggregationFns: infer TRegistry extends Record<PropertyKey, unknown>;
84
+ } ? TKey extends keyof TRegistry ? TRegistry[TKey] : never : never;
85
+ type AggregationResultOfRef<TRef, TFeatures extends TableFeatures> = TRef extends AggregationFnDef<any, any, any, any> ? AggregationResultOf<TRef> : TRef extends 'auto' ? RegisteredAggregationResult<TFeatures> : TRef extends PropertyKey ? AggregationResultOf<RegisteredAggregationDefinition<TFeatures, TRef>> : unknown;
86
+ type AggregationEntryId<TEntry> = TEntry extends string ? TEntry : TEntry extends {
87
+ id: infer TId extends string;
88
+ } ? TId : never;
89
+ type AggregationEntryDefinition<TEntry> = TEntry extends {
90
+ aggregationFn: infer TDefinition;
91
+ } ? TDefinition : TEntry;
92
+ /** Infers the scalar or keyed result produced by an aggregation option. */
93
+ type AggregationResult<TOption, TFeatures extends TableFeatures = any> = TOption extends ReadonlyArray<infer TEntry> ? { [TKey in AggregationEntryId<TEntry>]: AggregationResultOfRef<AggregationEntryDefinition<Extract<TEntry, TKey | {
94
+ id: TKey;
95
+ }>>, TFeatures> } : AggregationResultOfRef<TOption, TFeatures>;
96
+ type RegisteredAggregationResult<TFeatures extends TableFeatures> = TFeatures extends {
97
+ aggregationFns: infer TRegistry extends Record<string, unknown>;
98
+ } ? AggregationResultOf<TRegistry[keyof TRegistry]> : unknown;
99
+ /** Default public result union when a column's precise option is not known. */
100
+ type ColumnAggregationValue<TFeatures extends TableFeatures> = RegisteredAggregationResult<TFeatures> | Record<string, RegisteredAggregationResult<TFeatures> | undefined> | undefined;
101
+ /** A validated aggregation entry returned by `column.getAggregationFns()`. */
102
+ interface ResolvedAggregationFn<TFeatures extends TableFeatures, TData extends RowData> {
103
+ /** Resolved definition, or `undefined` when configuration is invalid. */
104
+ aggregationFn: AggregationFnDef<TFeatures, TData, any, any> | undefined;
105
+ /** Key used for a multiple result; scalar inline definitions have no id. */
106
+ id: string | undefined;
107
+ }
108
+ /** Column-definition options installed by `aggregationFeature`. */
109
+ interface ColumnDef_Aggregation<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue extends CellData = CellData> {
110
+ /** Renderer used for a grouped row's aggregated cell. */
111
+ aggregatedCell?: ColumnDefTemplate<ReturnType<Cell<TFeatures, TData, TValue>['getContext']>>;
112
+ /**
113
+ * One aggregation reference for a scalar result, or an array for a keyed
114
+ * result object. Inline definitions in an array require an explicit `id`.
115
+ */
116
+ aggregationFn?: AggregationFnOption<TFeatures, TData, TValue>;
117
+ /**
118
+ * Optionally supplies a precomputed aggregation value for this column.
119
+ * Return `{ value }` to handle the request, including `{ value: undefined }`;
120
+ * return `undefined` to use the local aggregation fallback.
121
+ */
122
+ getAggregationValue?: (context: AggregationValueContext<TFeatures, TData, TValue>) => AggregationValueResult | undefined;
123
+ }
124
+ /** Column instance APIs installed by `aggregationFeature`. */
125
+ interface Column_Aggregation<in out TFeatures extends TableFeatures, in out TData extends RowData> {
126
+ /** Resolves the configured scalar or multiple aggregation definitions. */
127
+ getAggregationFns: () => ReadonlyArray<ResolvedAggregationFn<TFeatures, TData>>;
128
+ /**
129
+ * Aggregates this column over the default pre-grouped row model, or over a
130
+ * caller-provided array of rows. Explicit rows are normalized to unique
131
+ * terminal leaves and are intentionally not cached.
132
+ */
133
+ getAggregationValue: <TResult = ColumnAggregationValue<TFeatures>>(rows?: ReadonlyArray<Row<TFeatures, TData>>) => TResult;
134
+ /** Infers `sum` for a numeric first row and `extent` for a Date first row. */
135
+ getAutoAggregationFn: () => AggregationFnDef<TFeatures, TData, any, any> | undefined;
136
+ }
137
+ /** Cell instance APIs installed by `aggregationFeature`. */
138
+ interface Cell_Aggregation {
139
+ /** Whether this cell displays an aggregate on a synthetic grouped row. */
140
+ getIsAggregated: () => boolean;
141
+ }
142
+ /** Internal per-row cache used while grouped aggregates are evaluated. */
143
+ interface Row_Aggregation {
144
+ /** Cached aggregate results keyed by column id. */
145
+ _aggregationValuesCache: Record<string, unknown>;
146
+ }
147
+ /** Values passed to a column-level aggregation-value provider. */
148
+ interface AggregationValueContext<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> {
149
+ /** The column whose value was requested. */
150
+ column: Column<TFeatures, TData, TValue>;
151
+ /** Caller-provided rows, or `undefined` for the default row model. */
152
+ rows?: ReadonlyArray<Row<TFeatures, TData>>;
153
+ /** The table that owns the column. */
154
+ table: Table<TFeatures, TData>;
155
+ }
156
+ /** Marks an aggregation-value override as handled. */
157
+ interface AggregationValueResult<TResult = unknown> {
158
+ /** The supplied value. `undefined` is still a handled result. */
159
+ value: TResult;
160
+ }
161
+ /** Table options installed by `aggregationFeature`. */
162
+ interface TableOptions_Aggregation {
163
+ /**
164
+ * Disables local `column.getAggregationValue()` calculation when a column
165
+ * override does not handle the request. Group values supplied by manually
166
+ * grouped rows remain the responsibility of the data owner.
167
+ */
168
+ manualAggregation?: boolean;
169
+ }
170
+ //#endregion
171
+ export { AggregationContext, AggregationFnDef, AggregationFnDescriptor, AggregationFnListItem, AggregationFnOption, AggregationFnRef, AggregationFns, AggregationMergeContext, AggregationResult, AggregationResultOf, AggregationValueContext, AggregationValueResult, Cell_Aggregation, ColumnAggregationValue, ColumnDef_Aggregation, Column_Aggregation, CustomAggregationFns, ExtractAggregationFnKeys, ResolvedAggregationFn, RowModelFns_Aggregation, Row_Aggregation, TableOptions_Aggregation, constructAggregationFn };
172
+ //# sourceMappingURL=aggregationFeature.types.d.cts.map