@tanstack/table-core 9.0.0-beta.50 → 9.0.0-beta.51
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.
- package/dist/features/column-grouping/createGroupedRowModel.cjs +4 -4
- package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.d.cts +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.d.ts +1 -1
- package/dist/features/column-grouping/createGroupedRowModel.js +2 -2
- package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
- package/dist/features/{aggregation → row-aggregation}/aggregationFns.cjs +13 -13
- package/dist/features/row-aggregation/aggregationFns.cjs.map +1 -0
- package/dist/features/{aggregation → row-aggregation}/aggregationFns.d.cts +2 -2
- package/dist/features/{aggregation → row-aggregation}/aggregationFns.d.ts +2 -2
- package/dist/features/{aggregation → row-aggregation}/aggregationFns.js +2 -2
- package/dist/features/row-aggregation/aggregationFns.js.map +1 -0
- package/dist/features/row-aggregation/rowAggregationFeature.cjs +39 -0
- package/dist/features/row-aggregation/rowAggregationFeature.cjs.map +1 -0
- package/dist/features/row-aggregation/rowAggregationFeature.d.cts +10 -0
- package/dist/features/row-aggregation/rowAggregationFeature.d.ts +10 -0
- package/dist/features/{aggregation/aggregationFeature.js → row-aggregation/rowAggregationFeature.js} +7 -7
- package/dist/features/row-aggregation/rowAggregationFeature.js.map +1 -0
- package/dist/features/{aggregation/aggregationFeature.types.cjs → row-aggregation/rowAggregationFeature.types.cjs} +2 -2
- package/dist/features/row-aggregation/rowAggregationFeature.types.cjs.map +1 -0
- package/dist/features/{aggregation/aggregationFeature.types.d.cts → row-aggregation/rowAggregationFeature.types.d.cts} +6 -6
- package/dist/features/{aggregation/aggregationFeature.types.d.ts → row-aggregation/rowAggregationFeature.types.d.ts} +6 -6
- package/dist/features/{aggregation/aggregationFeature.types.js → row-aggregation/rowAggregationFeature.types.js} +2 -2
- package/dist/features/row-aggregation/rowAggregationFeature.types.js.map +1 -0
- package/dist/features/{aggregation/aggregationFeature.utils.cjs → row-aggregation/rowAggregationFeature.utils.cjs} +2 -2
- package/dist/features/row-aggregation/rowAggregationFeature.utils.cjs.map +1 -0
- package/dist/features/{aggregation/aggregationFeature.utils.d.cts → row-aggregation/rowAggregationFeature.utils.d.cts} +3 -3
- package/dist/features/{aggregation/aggregationFeature.utils.d.ts → row-aggregation/rowAggregationFeature.utils.d.ts} +3 -3
- package/dist/features/{aggregation/aggregationFeature.utils.js → row-aggregation/rowAggregationFeature.utils.js} +2 -2
- package/dist/features/row-aggregation/rowAggregationFeature.utils.js.map +1 -0
- package/dist/features/stockFeatures.cjs +2 -2
- package/dist/features/stockFeatures.cjs.map +1 -1
- package/dist/features/stockFeatures.d.cts +2 -2
- package/dist/features/stockFeatures.d.ts +2 -2
- package/dist/features/stockFeatures.js +2 -2
- package/dist/features/stockFeatures.js.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/static-functions.cjs +8 -8
- package/dist/static-functions.d.cts +1 -1
- package/dist/static-functions.d.ts +1 -1
- package/dist/static-functions.js +1 -1
- package/dist/types/Cell.d.cts +2 -2
- package/dist/types/Cell.d.ts +2 -2
- package/dist/types/Column.d.cts +2 -2
- package/dist/types/Column.d.ts +2 -2
- package/dist/types/ColumnDef.d.cts +2 -2
- package/dist/types/ColumnDef.d.ts +2 -2
- package/dist/types/Row.d.cts +2 -2
- package/dist/types/Row.d.ts +2 -2
- package/dist/types/RowModelFns.d.cts +2 -2
- package/dist/types/RowModelFns.d.ts +2 -2
- package/dist/types/TableFeatures.d.cts +2 -2
- package/dist/types/TableFeatures.d.ts +2 -2
- package/dist/types/TableOptions.d.cts +3 -3
- package/dist/types/TableOptions.d.ts +3 -3
- package/dist/worker/initTableWorker.cjs.map +1 -1
- package/dist/worker/initTableWorker.js.map +1 -1
- package/package.json +1 -1
- package/skills/aggregation/SKILL.md +6 -6
- package/skills/api-not-found/SKILL.md +1 -1
- package/skills/client-vs-server/SKILL.md +1 -1
- package/skills/column-faceting/SKILL.md +1 -1
- package/skills/column-filtering/SKILL.md +1 -1
- package/skills/column-ordering/SKILL.md +1 -1
- package/skills/column-pinning/SKILL.md +1 -1
- package/skills/column-resizing/SKILL.md +1 -1
- package/skills/column-sizing/SKILL.md +1 -1
- package/skills/column-visibility/SKILL.md +1 -1
- package/skills/core/SKILL.md +1 -1
- package/skills/custom-features/SKILL.md +1 -1
- package/skills/expanding/SKILL.md +1 -1
- package/skills/global-filtering/SKILL.md +1 -1
- package/skills/grouping/SKILL.md +1 -1
- package/skills/migrate-v8-to-v9/SKILL.md +8 -8
- package/skills/pagination/SKILL.md +1 -1
- package/skills/row-pinning/SKILL.md +1 -1
- package/skills/row-selection/SKILL.md +1 -1
- package/skills/sorting/SKILL.md +1 -1
- package/skills/table-features/SKILL.md +5 -5
- package/skills/typescript/SKILL.md +1 -1
- package/src/features/column-grouping/createGroupedRowModel.ts +2 -2
- package/src/features/{aggregation → row-aggregation}/aggregationFns.ts +2 -2
- package/src/features/{aggregation/aggregationFeature.ts → row-aggregation/rowAggregationFeature.ts} +4 -4
- package/src/features/{aggregation/aggregationFeature.types.ts → row-aggregation/rowAggregationFeature.types.ts} +4 -4
- package/src/features/{aggregation/aggregationFeature.utils.ts → row-aggregation/rowAggregationFeature.utils.ts} +1 -1
- package/src/features/stockFeatures.ts +3 -3
- package/src/index.ts +4 -4
- package/src/static-functions.ts +1 -1
- package/src/types/Cell.ts +2 -2
- package/src/types/Column.ts +2 -2
- package/src/types/ColumnDef.ts +2 -2
- package/src/types/Row.ts +2 -2
- package/src/types/RowModelFns.ts +2 -2
- package/src/types/TableFeatures.ts +2 -2
- package/src/types/TableOptions.ts +3 -3
- package/src/worker/initTableWorker.ts +1 -1
- package/dist/features/aggregation/aggregationFeature.cjs +0 -39
- package/dist/features/aggregation/aggregationFeature.cjs.map +0 -1
- package/dist/features/aggregation/aggregationFeature.d.cts +0 -10
- package/dist/features/aggregation/aggregationFeature.d.ts +0 -10
- package/dist/features/aggregation/aggregationFeature.js.map +0 -1
- package/dist/features/aggregation/aggregationFeature.types.cjs.map +0 -1
- package/dist/features/aggregation/aggregationFeature.types.js.map +0 -1
- package/dist/features/aggregation/aggregationFeature.utils.cjs.map +0 -1
- package/dist/features/aggregation/aggregationFeature.utils.js.map +0 -1
- package/dist/features/aggregation/aggregationFns.cjs.map +0 -1
- package/dist/features/aggregation/aggregationFns.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import { tableFeatures } from "./helpers/tableFeatures.js";
|
|
|
18
18
|
import { tableOptions } from "./helpers/tableOptions.js";
|
|
19
19
|
import { constructTable, getInitialTableState } from "./core/table/constructTable.js";
|
|
20
20
|
import { columnFacetingFeature } from "./features/column-faceting/columnFacetingFeature.js";
|
|
21
|
-
import {
|
|
21
|
+
import { rowAggregationFeature } from "./features/row-aggregation/rowAggregationFeature.js";
|
|
22
22
|
import { columnFilteringFeature } from "./features/column-filtering/columnFilteringFeature.js";
|
|
23
23
|
import { columnGroupingFeature } from "./features/column-grouping/columnGroupingFeature.js";
|
|
24
24
|
import { columnOrderingFeature } from "./features/column-ordering/columnOrderingFeature.js";
|
|
@@ -35,8 +35,8 @@ import { rowSelectionFeature } from "./features/row-selection/rowSelectionFeatur
|
|
|
35
35
|
import { constructSortFn, reSplitAlphaNumeric, sortFn_alphanumeric, sortFn_alphanumericCaseSensitive, sortFn_basic, sortFn_datetime, sortFn_text, sortFn_textCaseSensitive, sortFns } from "./features/row-sorting/sortFns.js";
|
|
36
36
|
import { rowSortingFeature } from "./features/row-sorting/rowSortingFeature.js";
|
|
37
37
|
import { stockFeatures } from "./features/stockFeatures.js";
|
|
38
|
-
import { constructAggregationFn } from "./features/aggregation/
|
|
39
|
-
import { aggregationFn_count, aggregationFn_extent, aggregationFn_first, aggregationFn_last, aggregationFn_max, aggregationFn_mean, aggregationFn_median, aggregationFn_min, aggregationFn_sum, aggregationFn_unique, aggregationFn_uniqueCount, aggregationFns } from "./features/aggregation/aggregationFns.js";
|
|
38
|
+
import { constructAggregationFn } from "./features/row-aggregation/rowAggregationFeature.types.js";
|
|
39
|
+
import { aggregationFn_count, aggregationFn_extent, aggregationFn_first, aggregationFn_last, aggregationFn_max, aggregationFn_mean, aggregationFn_median, aggregationFn_min, aggregationFn_sum, aggregationFn_unique, aggregationFn_uniqueCount, aggregationFns } from "./features/row-aggregation/aggregationFns.js";
|
|
40
40
|
import { createFacetedMinMaxValues } from "./features/column-faceting/createFacetedMinMaxValues.js";
|
|
41
41
|
import { createFacetedRowModel } from "./features/column-faceting/createFacetedRowModel.js";
|
|
42
42
|
import { createFacetedUniqueValues } from "./features/column-faceting/createFacetedUniqueValues.js";
|
|
@@ -46,4 +46,4 @@ import { createExpandedRowModel, expandRows } from "./features/row-expanding/cre
|
|
|
46
46
|
import { createPaginatedRowModel } from "./features/row-pagination/createPaginatedRowModel.js";
|
|
47
47
|
import { createSortedRowModel } from "./features/row-sorting/createSortedRowModel.js";
|
|
48
48
|
|
|
49
|
-
export {
|
|
49
|
+
export { aggregationFn_count, aggregationFn_extent, aggregationFn_first, aggregationFn_last, aggregationFn_max, aggregationFn_mean, aggregationFn_median, aggregationFn_min, aggregationFn_sum, aggregationFn_unique, aggregationFn_uniqueCount, aggregationFns, assignPrototypeAPIs, assignTableAPIs, buildHeaderGroups, callMemoOrStaticFn, cloneState, columnFacetingFeature, columnFilteringFeature, columnGroupingFeature, columnOrderingFeature, columnPinningFeature, columnResizingFeature, columnSizingFeature, columnVisibilityFeature, constructAggregationFn, constructCell, constructColumn, constructFilterFn, constructHeader, constructRow, constructSortFn, constructTable, copyInstancePropertiesWithoutMemos, coreCellsFeature, coreColumnsFeature, coreFeatures, coreHeadersFeature, coreRowModelsFeature, coreRowsFeature, coreTablesFeature, createColumnHelper, createCoreRowModel, createExpandedRowModel, createFacetedMinMaxValues, createFacetedRowModel, createFacetedUniqueValues, createFilteredRowModel, createGroupedRowModel, createPaginatedRowModel, createSortedRowModel, expandRows, filterFn_arrHas, filterFn_arrIncludes, filterFn_arrIncludesAll, filterFn_arrIncludesSome, filterFn_between, filterFn_betweenInclusive, filterFn_empty, filterFn_endsWith, filterFn_equals, filterFn_equalsString, filterFn_equalsStringSensitive, filterFn_greaterThan, filterFn_greaterThanOrEqualTo, filterFn_inDateRange, filterFn_inNumberRange, filterFn_includesString, filterFn_includesStringSensitive, filterFn_lessThan, filterFn_lessThanOrEqualTo, filterFn_notEmpty, filterFn_startsWith, filterFn_weakEquals, filterFns, flattenBy, functionalUpdate, getFunctionNameInfo, getInitialTableState, globalFilteringFeature, hasOwn, isFunction, makeObjectMap, makeStateUpdater, memo, metaHelper, reSplitAlphaNumeric, rowAggregationFeature, rowExpandingFeature, rowPaginationFeature, rowPinningFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_alphanumericCaseSensitive, sortFn_basic, sortFn_datetime, sortFn_text, sortFn_textCaseSensitive, sortFns, stockFeatures, tableFeatures, tableMemo, tableOptions };
|
|
@@ -10,7 +10,7 @@ const require_coreRowModelsFeature_utils = require('./core/row-models/coreRowMod
|
|
|
10
10
|
const require_coreRowsFeature_utils = require('./core/rows/coreRowsFeature.utils.cjs');
|
|
11
11
|
const require_coreTablesFeature_utils = require('./core/table/coreTablesFeature.utils.cjs');
|
|
12
12
|
const require_columnFacetingFeature_utils = require('./features/column-faceting/columnFacetingFeature.utils.cjs');
|
|
13
|
-
const
|
|
13
|
+
const require_rowAggregationFeature_utils = require('./features/row-aggregation/rowAggregationFeature.utils.cjs');
|
|
14
14
|
const require_columnFilteringFeature_utils = require('./features/column-filtering/columnFilteringFeature.utils.cjs');
|
|
15
15
|
const require_columnGroupingFeature_utils = require('./features/column-grouping/columnGroupingFeature.utils.cjs');
|
|
16
16
|
const require_columnSizingFeature_utils = require('./features/column-sizing/columnSizingFeature.utils.cjs');
|
|
@@ -21,18 +21,18 @@ const require_rowPinningFeature_utils = require('./features/row-pinning/rowPinni
|
|
|
21
21
|
const require_rowSelectionFeature_utils = require('./features/row-selection/rowSelectionFeature.utils.cjs');
|
|
22
22
|
const require_rowSortingFeature_utils = require('./features/row-sorting/rowSortingFeature.utils.cjs');
|
|
23
23
|
|
|
24
|
-
exports.aggregateColumnValue =
|
|
24
|
+
exports.aggregateColumnValue = require_rowAggregationFeature_utils.aggregateColumnValue;
|
|
25
25
|
exports.cell_getContext = require_coreCellsFeature_utils.cell_getContext;
|
|
26
|
-
exports.cell_getIsAggregated =
|
|
26
|
+
exports.cell_getIsAggregated = require_rowAggregationFeature_utils.cell_getIsAggregated;
|
|
27
27
|
exports.cell_getIsGrouped = require_columnGroupingFeature_utils.cell_getIsGrouped;
|
|
28
28
|
exports.cell_getIsPlaceholder = require_columnGroupingFeature_utils.cell_getIsPlaceholder;
|
|
29
29
|
exports.cell_getValue = require_coreCellsFeature_utils.cell_getValue;
|
|
30
30
|
exports.cell_renderValue = require_coreCellsFeature_utils.cell_renderValue;
|
|
31
31
|
exports.column_clearSorting = require_rowSortingFeature_utils.column_clearSorting;
|
|
32
32
|
exports.column_getAfter = require_columnSizingFeature_utils.column_getAfter;
|
|
33
|
-
exports.column_getAggregationFns =
|
|
34
|
-
exports.column_getAggregationValue =
|
|
35
|
-
exports.column_getAutoAggregationFn =
|
|
33
|
+
exports.column_getAggregationFns = require_rowAggregationFeature_utils.column_getAggregationFns;
|
|
34
|
+
exports.column_getAggregationValue = require_rowAggregationFeature_utils.column_getAggregationValue;
|
|
35
|
+
exports.column_getAutoAggregationFn = require_rowAggregationFeature_utils.column_getAutoAggregationFn;
|
|
36
36
|
exports.column_getAutoFilterFn = require_columnFilteringFeature_utils.column_getAutoFilterFn;
|
|
37
37
|
exports.column_getAutoSortDir = require_rowSortingFeature_utils.column_getAutoSortDir;
|
|
38
38
|
exports.column_getAutoSortFn = require_rowSortingFeature_utils.column_getAutoSortFn;
|
|
@@ -78,7 +78,7 @@ exports.column_setFilterValue = require_columnFilteringFeature_utils.column_setF
|
|
|
78
78
|
exports.column_toggleGrouping = require_columnGroupingFeature_utils.column_toggleGrouping;
|
|
79
79
|
exports.column_toggleSorting = require_rowSortingFeature_utils.column_toggleSorting;
|
|
80
80
|
exports.column_toggleVisibility = require_columnVisibilityFeature_utils.column_toggleVisibility;
|
|
81
|
-
exports.formatAggregatedCellValue =
|
|
81
|
+
exports.formatAggregatedCellValue = require_rowAggregationFeature_utils.formatAggregatedCellValue;
|
|
82
82
|
exports.getDefaultColumnFiltersState = require_columnFilteringFeature_utils.getDefaultColumnFiltersState;
|
|
83
83
|
exports.getDefaultColumnOrderState = require_columnOrderingFeature_utils.getDefaultColumnOrderState;
|
|
84
84
|
exports.getDefaultColumnPinningState = require_columnPinningFeature_utils.getDefaultColumnPinningState;
|
|
@@ -100,7 +100,7 @@ exports.header_getStart = require_columnSizingFeature_utils.header_getStart;
|
|
|
100
100
|
exports.isRowSelected = require_rowSelectionFeature_utils.isRowSelected;
|
|
101
101
|
exports.isSubRowSelected = require_rowSelectionFeature_utils.isSubRowSelected;
|
|
102
102
|
exports.isTouchStartEvent = require_columnResizingFeature_utils.isTouchStartEvent;
|
|
103
|
-
exports.normalizeAggregationRows =
|
|
103
|
+
exports.normalizeAggregationRows = require_rowAggregationFeature_utils.normalizeAggregationRows;
|
|
104
104
|
exports.orderColumns = require_columnOrderingFeature_utils.orderColumns;
|
|
105
105
|
exports.passiveEventSupported = require_columnResizingFeature_utils.passiveEventSupported;
|
|
106
106
|
exports.row_getAllCells = require_coreRowsFeature_utils.row_getAllCells;
|
|
@@ -4,7 +4,7 @@ import { header_getContext, header_getLeafHeaders, table_getFlatHeaders, table_g
|
|
|
4
4
|
import { row_getAllCells, row_getAllCellsByColumnId, row_getDisplayIndex, row_getLeafRows, row_getParentRow, row_getParentRows, row_getUniqueValues, row_getValue, row_renderValue, table_getMaxSubRowDepth, table_getRow, table_getRowId, table_getRowsInDisplayOrder } from "./core/rows/coreRowsFeature.utils.cjs";
|
|
5
5
|
import { table_getCoreRowModel, table_getExpandedRowModel, table_getFilteredRowModel, table_getGroupedRowModel, table_getPaginatedRowModel, table_getPreExpandedRowModel, table_getPreFilteredRowModel, table_getPreGroupedRowModel, table_getPrePaginatedRowModel, table_getPreSortedRowModel, table_getRowModel, table_getSortedRowModel } from "./core/row-models/coreRowModelsFeature.utils.cjs";
|
|
6
6
|
import { table_mergeOptions, table_reset, table_setOptions, table_syncExternalStateToBaseAtoms } from "./core/table/coreTablesFeature.utils.cjs";
|
|
7
|
-
import { aggregateColumnValue, cell_getIsAggregated, column_getAggregationFns, column_getAggregationValue, column_getAutoAggregationFn, formatAggregatedCellValue, normalizeAggregationRows } from "./features/aggregation/
|
|
7
|
+
import { aggregateColumnValue, cell_getIsAggregated, column_getAggregationFns, column_getAggregationValue, column_getAutoAggregationFn, formatAggregatedCellValue, normalizeAggregationRows } from "./features/row-aggregation/rowAggregationFeature.utils.cjs";
|
|
8
8
|
import { column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues } from "./features/column-faceting/columnFacetingFeature.utils.cjs";
|
|
9
9
|
import { column_getAutoFilterFn, column_getCanFilter, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getIsFiltered, column_setFilterValue, getDefaultColumnFiltersState, shouldAutoRemoveFilter, table_resetColumnFilters, table_setColumnFilters } from "./features/column-filtering/columnFilteringFeature.utils.cjs";
|
|
10
10
|
import { cell_getIsGrouped, cell_getIsPlaceholder, column_getCanGroup, column_getGroupedIndex, column_getIsGrouped, column_getToggleGroupingHandler, column_toggleGrouping, getDefaultGroupingState, row_getGroupingValue, row_getIsGrouped, table_resetGrouping, table_setGrouping } from "./features/column-grouping/columnGroupingFeature.utils.cjs";
|
|
@@ -4,7 +4,7 @@ import { header_getContext, header_getLeafHeaders, table_getFlatHeaders, table_g
|
|
|
4
4
|
import { row_getAllCells, row_getAllCellsByColumnId, row_getDisplayIndex, row_getLeafRows, row_getParentRow, row_getParentRows, row_getUniqueValues, row_getValue, row_renderValue, table_getMaxSubRowDepth, table_getRow, table_getRowId, table_getRowsInDisplayOrder } from "./core/rows/coreRowsFeature.utils.js";
|
|
5
5
|
import { table_getCoreRowModel, table_getExpandedRowModel, table_getFilteredRowModel, table_getGroupedRowModel, table_getPaginatedRowModel, table_getPreExpandedRowModel, table_getPreFilteredRowModel, table_getPreGroupedRowModel, table_getPrePaginatedRowModel, table_getPreSortedRowModel, table_getRowModel, table_getSortedRowModel } from "./core/row-models/coreRowModelsFeature.utils.js";
|
|
6
6
|
import { table_mergeOptions, table_reset, table_setOptions, table_syncExternalStateToBaseAtoms } from "./core/table/coreTablesFeature.utils.js";
|
|
7
|
-
import { aggregateColumnValue, cell_getIsAggregated, column_getAggregationFns, column_getAggregationValue, column_getAutoAggregationFn, formatAggregatedCellValue, normalizeAggregationRows } from "./features/aggregation/
|
|
7
|
+
import { aggregateColumnValue, cell_getIsAggregated, column_getAggregationFns, column_getAggregationValue, column_getAutoAggregationFn, formatAggregatedCellValue, normalizeAggregationRows } from "./features/row-aggregation/rowAggregationFeature.utils.js";
|
|
8
8
|
import { column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues } from "./features/column-faceting/columnFacetingFeature.utils.js";
|
|
9
9
|
import { column_getAutoFilterFn, column_getCanFilter, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getIsFiltered, column_setFilterValue, getDefaultColumnFiltersState, shouldAutoRemoveFilter, table_resetColumnFilters, table_setColumnFilters } from "./features/column-filtering/columnFilteringFeature.utils.js";
|
|
10
10
|
import { cell_getIsGrouped, cell_getIsPlaceholder, column_getCanGroup, column_getGroupedIndex, column_getIsGrouped, column_getToggleGroupingHandler, column_toggleGrouping, getDefaultGroupingState, row_getGroupingValue, row_getIsGrouped, table_resetGrouping, table_setGrouping } from "./features/column-grouping/columnGroupingFeature.utils.js";
|
package/dist/static-functions.js
CHANGED
|
@@ -9,7 +9,7 @@ import { table_getCoreRowModel, table_getExpandedRowModel, table_getFilteredRowM
|
|
|
9
9
|
import { row_getAllCells, row_getAllCellsByColumnId, row_getDisplayIndex, row_getLeafRows, row_getParentRow, row_getParentRows, row_getUniqueValues, row_getValue, row_renderValue, table_getMaxSubRowDepth, table_getRow, table_getRowId, table_getRowsInDisplayOrder } from "./core/rows/coreRowsFeature.utils.js";
|
|
10
10
|
import { table_mergeOptions, table_reset, table_setOptions, table_syncExternalStateToBaseAtoms } from "./core/table/coreTablesFeature.utils.js";
|
|
11
11
|
import { column_getFacetedMinMaxValues, column_getFacetedRowModel, column_getFacetedUniqueValues, table_getGlobalFacetedMinMaxValues, table_getGlobalFacetedRowModel, table_getGlobalFacetedUniqueValues } from "./features/column-faceting/columnFacetingFeature.utils.js";
|
|
12
|
-
import { aggregateColumnValue, cell_getIsAggregated, column_getAggregationFns, column_getAggregationValue, column_getAutoAggregationFn, formatAggregatedCellValue, normalizeAggregationRows } from "./features/aggregation/
|
|
12
|
+
import { aggregateColumnValue, cell_getIsAggregated, column_getAggregationFns, column_getAggregationValue, column_getAutoAggregationFn, formatAggregatedCellValue, normalizeAggregationRows } from "./features/row-aggregation/rowAggregationFeature.utils.js";
|
|
13
13
|
import { column_getAutoFilterFn, column_getCanFilter, column_getFilterFn, column_getFilterIndex, column_getFilterValue, column_getIsFiltered, column_setFilterValue, getDefaultColumnFiltersState, shouldAutoRemoveFilter, table_resetColumnFilters, table_setColumnFilters } from "./features/column-filtering/columnFilteringFeature.utils.js";
|
|
14
14
|
import { cell_getIsGrouped, cell_getIsPlaceholder, column_getCanGroup, column_getGroupedIndex, column_getIsGrouped, column_getToggleGroupingHandler, column_toggleGrouping, getDefaultGroupingState, row_getGroupingValue, row_getIsGrouped, table_resetGrouping, table_setGrouping } from "./features/column-grouping/columnGroupingFeature.utils.js";
|
|
15
15
|
import { column_getAfter, column_getSize, column_getStart, column_resetSize, getDefaultColumnSizingColumnDef, getDefaultColumnSizingState, header_getSize, header_getStart, table_getCenterTotalSize, table_getColumnOffsets, table_getEndTotalSize, table_getStartTotalSize, table_getTotalSize, table_resetColumnSizing, table_setColumnSizing } from "./features/column-sizing/columnSizingFeature.utils.js";
|
package/dist/types/Cell.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { CellData, RowData } from "./type-utils.cjs";
|
|
2
2
|
import { Cell_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.cjs";
|
|
3
3
|
import { Cell_Cell } from "../core/cells/coreCellsFeature.types.cjs";
|
|
4
|
-
import { Cell_Aggregation } from "../features/aggregation/
|
|
4
|
+
import { Cell_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.cjs";
|
|
5
5
|
import { ExtractFeatureMapTypes, TableFeatures } from "./TableFeatures.cjs";
|
|
6
6
|
|
|
7
7
|
//#region src/types/Cell.d.ts
|
|
8
8
|
interface Cell_Core<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue extends CellData = CellData> extends Cell_Cell<TFeatures, TData, TValue> {}
|
|
9
9
|
interface Cell_FeatureMap {
|
|
10
|
-
|
|
10
|
+
rowAggregationFeature: Cell_Aggregation;
|
|
11
11
|
columnGroupingFeature: Cell_ColumnGrouping;
|
|
12
12
|
}
|
|
13
13
|
type Cell<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> = Cell_Core<TFeatures, TData, TValue> & ExtractFeatureMapTypes<TFeatures, Cell_FeatureMap>;
|
package/dist/types/Cell.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { CellData, RowData } from "./type-utils.js";
|
|
2
2
|
import { Cell_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.js";
|
|
3
3
|
import { Cell_Cell } from "../core/cells/coreCellsFeature.types.js";
|
|
4
|
-
import { Cell_Aggregation } from "../features/aggregation/
|
|
4
|
+
import { Cell_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.js";
|
|
5
5
|
import { ExtractFeatureMapTypes, TableFeatures } from "./TableFeatures.js";
|
|
6
6
|
|
|
7
7
|
//#region src/types/Cell.d.ts
|
|
8
8
|
interface Cell_Core<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue extends CellData = CellData> extends Cell_Cell<TFeatures, TData, TValue> {}
|
|
9
9
|
interface Cell_FeatureMap {
|
|
10
|
-
|
|
10
|
+
rowAggregationFeature: Cell_Aggregation;
|
|
11
11
|
columnGroupingFeature: Cell_ColumnGrouping;
|
|
12
12
|
}
|
|
13
13
|
type Cell<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData> = Cell_Core<TFeatures, TData, TValue> & ExtractFeatureMapTypes<TFeatures, Cell_FeatureMap>;
|
package/dist/types/Column.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ import { Column_ColumnResizing } from "../features/column-resizing/columnResizin
|
|
|
6
6
|
import { Column_GlobalFiltering } from "../features/global-filtering/globalFilteringFeature.types.cjs";
|
|
7
7
|
import { Column_RowSorting } from "../features/row-sorting/rowSortingFeature.types.cjs";
|
|
8
8
|
import { ColumnDefBase_All } from "./ColumnDef.cjs";
|
|
9
|
-
import { Column_Aggregation } from "../features/aggregation/
|
|
9
|
+
import { Column_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.cjs";
|
|
10
10
|
import { Column_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.cjs";
|
|
11
11
|
import { Column_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.cjs";
|
|
12
12
|
import { Column_ColumnFaceting } from "../features/column-faceting/columnFacetingFeature.types.cjs";
|
|
@@ -18,7 +18,7 @@ import { ExtractFeatureMapTypes, TableFeatures } from "./TableFeatures.cjs";
|
|
|
18
18
|
//#region src/types/Column.d.ts
|
|
19
19
|
interface Column_Core<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue = unknown> extends Column_Column<TFeatures, TData, TValue> {}
|
|
20
20
|
interface Column_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
21
|
-
|
|
21
|
+
rowAggregationFeature: Column_Aggregation<TFeatures, TData>;
|
|
22
22
|
columnFacetingFeature: Column_ColumnFaceting<TFeatures, TData>;
|
|
23
23
|
columnFilteringFeature: Column_ColumnFiltering<TFeatures, TData>;
|
|
24
24
|
columnGroupingFeature: Column_ColumnGrouping;
|
package/dist/types/Column.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { Column_ColumnResizing } from "../features/column-resizing/columnResizin
|
|
|
6
6
|
import { Column_GlobalFiltering } from "../features/global-filtering/globalFilteringFeature.types.js";
|
|
7
7
|
import { Column_RowSorting } from "../features/row-sorting/rowSortingFeature.types.js";
|
|
8
8
|
import { ColumnDefBase_All } from "./ColumnDef.js";
|
|
9
|
-
import { Column_Aggregation } from "../features/aggregation/
|
|
9
|
+
import { Column_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.js";
|
|
10
10
|
import { Column_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.js";
|
|
11
11
|
import { Column_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.js";
|
|
12
12
|
import { Column_ColumnFaceting } from "../features/column-faceting/columnFacetingFeature.types.js";
|
|
@@ -18,7 +18,7 @@ import { ExtractFeatureMapTypes, TableFeatures } from "./TableFeatures.js";
|
|
|
18
18
|
//#region src/types/Column.d.ts
|
|
19
19
|
interface Column_Core<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue = unknown> extends Column_Column<TFeatures, TData, TValue> {}
|
|
20
20
|
interface Column_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
21
|
-
|
|
21
|
+
rowAggregationFeature: Column_Aggregation<TFeatures, TData>;
|
|
22
22
|
columnFacetingFeature: Column_ColumnFaceting<TFeatures, TData>;
|
|
23
23
|
columnFilteringFeature: Column_ColumnFiltering<TFeatures, TData>;
|
|
24
24
|
columnGroupingFeature: Column_ColumnGrouping;
|
|
@@ -7,7 +7,7 @@ import { ColumnDef_ColumnResizing } from "../features/column-resizing/columnResi
|
|
|
7
7
|
import { HeaderContext } from "../core/headers/coreHeadersFeature.types.cjs";
|
|
8
8
|
import { ColumnDef_GlobalFiltering } from "../features/global-filtering/globalFilteringFeature.types.cjs";
|
|
9
9
|
import { ColumnDef_RowSorting } from "../features/row-sorting/rowSortingFeature.types.cjs";
|
|
10
|
-
import { ColumnDef_Aggregation } from "../features/aggregation/
|
|
10
|
+
import { ColumnDef_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.cjs";
|
|
11
11
|
import { ColumnDef_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.cjs";
|
|
12
12
|
import { ColumnDef_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.cjs";
|
|
13
13
|
import { ExtractFeatureMapTypes, IsAny, TableFeatures } from "./TableFeatures.cjs";
|
|
@@ -85,7 +85,7 @@ interface ColumnDefBase_Core<TFeatures extends TableFeatures, TData extends RowD
|
|
|
85
85
|
meta?: ExtractColumnMeta<TFeatures, TData, TValue>;
|
|
86
86
|
}
|
|
87
87
|
interface ColumnDef_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue extends CellData> {
|
|
88
|
-
|
|
88
|
+
rowAggregationFeature: ColumnDef_Aggregation<TFeatures, TData, TValue>;
|
|
89
89
|
columnVisibilityFeature: ColumnDef_ColumnVisibility;
|
|
90
90
|
columnPinningFeature: ColumnDef_ColumnPinning;
|
|
91
91
|
columnFilteringFeature: ColumnDef_ColumnFiltering<TFeatures, TData>;
|
|
@@ -7,7 +7,7 @@ import { ColumnDef_ColumnResizing } from "../features/column-resizing/columnResi
|
|
|
7
7
|
import { HeaderContext } from "../core/headers/coreHeadersFeature.types.js";
|
|
8
8
|
import { ColumnDef_GlobalFiltering } from "../features/global-filtering/globalFilteringFeature.types.js";
|
|
9
9
|
import { ColumnDef_RowSorting } from "../features/row-sorting/rowSortingFeature.types.js";
|
|
10
|
-
import { ColumnDef_Aggregation } from "../features/aggregation/
|
|
10
|
+
import { ColumnDef_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.js";
|
|
11
11
|
import { ColumnDef_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.js";
|
|
12
12
|
import { ColumnDef_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.js";
|
|
13
13
|
import { ExtractFeatureMapTypes, IsAny, TableFeatures } from "./TableFeatures.js";
|
|
@@ -85,7 +85,7 @@ interface ColumnDefBase_Core<TFeatures extends TableFeatures, TData extends RowD
|
|
|
85
85
|
meta?: ExtractColumnMeta<TFeatures, TData, TValue>;
|
|
86
86
|
}
|
|
87
87
|
interface ColumnDef_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue extends CellData> {
|
|
88
|
-
|
|
88
|
+
rowAggregationFeature: ColumnDef_Aggregation<TFeatures, TData, TValue>;
|
|
89
89
|
columnVisibilityFeature: ColumnDef_ColumnVisibility;
|
|
90
90
|
columnPinningFeature: ColumnDef_ColumnPinning;
|
|
91
91
|
columnFilteringFeature: ColumnDef_ColumnFiltering<TFeatures, TData>;
|
package/dist/types/Row.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RowData } from "./type-utils.cjs";
|
|
2
2
|
import { Row_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.cjs";
|
|
3
3
|
import { Row_ColumnPinning } from "../features/column-pinning/columnPinningFeature.types.cjs";
|
|
4
|
-
import { Row_Aggregation } from "../features/aggregation/
|
|
4
|
+
import { Row_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.cjs";
|
|
5
5
|
import { Row_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.cjs";
|
|
6
6
|
import { Row_RowExpanding } from "../features/row-expanding/rowExpandingFeature.types.cjs";
|
|
7
7
|
import { Row_RowPinning } from "../features/row-pinning/rowPinningFeature.types.cjs";
|
|
@@ -13,7 +13,7 @@ import { ExtractFeatureMapTypes, TableFeatures } from "./TableFeatures.cjs";
|
|
|
13
13
|
//#region src/types/Row.d.ts
|
|
14
14
|
interface Row_Core<in out TFeatures extends TableFeatures, in out TData extends RowData> extends Row_Row<TFeatures, TData> {}
|
|
15
15
|
interface Row_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
16
|
-
|
|
16
|
+
rowAggregationFeature: Row_Aggregation;
|
|
17
17
|
columnFilteringFeature: Row_ColumnFiltering<TFeatures, TData>;
|
|
18
18
|
columnGroupingFeature: Row_ColumnGrouping;
|
|
19
19
|
columnPinningFeature: Row_ColumnPinning<TFeatures, TData>;
|
package/dist/types/Row.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RowData } from "./type-utils.js";
|
|
2
2
|
import { Row_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.js";
|
|
3
3
|
import { Row_ColumnPinning } from "../features/column-pinning/columnPinningFeature.types.js";
|
|
4
|
-
import { Row_Aggregation } from "../features/aggregation/
|
|
4
|
+
import { Row_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.js";
|
|
5
5
|
import { Row_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.js";
|
|
6
6
|
import { Row_RowExpanding } from "../features/row-expanding/rowExpandingFeature.types.js";
|
|
7
7
|
import { Row_RowPinning } from "../features/row-pinning/rowPinningFeature.types.js";
|
|
@@ -13,7 +13,7 @@ import { ExtractFeatureMapTypes, TableFeatures } from "./TableFeatures.js";
|
|
|
13
13
|
//#region src/types/Row.d.ts
|
|
14
14
|
interface Row_Core<in out TFeatures extends TableFeatures, in out TData extends RowData> extends Row_Row<TFeatures, TData> {}
|
|
15
15
|
interface Row_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
16
|
-
|
|
16
|
+
rowAggregationFeature: Row_Aggregation;
|
|
17
17
|
columnFilteringFeature: Row_ColumnFiltering<TFeatures, TData>;
|
|
18
18
|
columnGroupingFeature: Row_ColumnGrouping;
|
|
19
19
|
columnPinningFeature: Row_ColumnPinning<TFeatures, TData>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { RowData } from "./type-utils.cjs";
|
|
2
2
|
import { RowModelFns_RowSorting } from "../features/row-sorting/rowSortingFeature.types.cjs";
|
|
3
|
-
import { RowModelFns_Aggregation } from "../features/aggregation/
|
|
3
|
+
import { RowModelFns_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.cjs";
|
|
4
4
|
import { RowModelFns_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.cjs";
|
|
5
5
|
import { ExtractFeatureMapTypes, TableFeatures } from "./TableFeatures.cjs";
|
|
6
6
|
|
|
7
7
|
//#region src/types/RowModelFns.d.ts
|
|
8
8
|
interface RowModelFns_Core {}
|
|
9
9
|
interface RowModelFns_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
10
|
-
|
|
10
|
+
rowAggregationFeature: RowModelFns_Aggregation<TFeatures, TData>;
|
|
11
11
|
columnFilteringFeature: RowModelFns_ColumnFiltering<TFeatures, TData>;
|
|
12
12
|
rowSortingFeature: RowModelFns_RowSorting<TFeatures, TData>;
|
|
13
13
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { RowData } from "./type-utils.js";
|
|
2
2
|
import { RowModelFns_RowSorting } from "../features/row-sorting/rowSortingFeature.types.js";
|
|
3
|
-
import { RowModelFns_Aggregation } from "../features/aggregation/
|
|
3
|
+
import { RowModelFns_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.js";
|
|
4
4
|
import { RowModelFns_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.js";
|
|
5
5
|
import { ExtractFeatureMapTypes, TableFeatures } from "./TableFeatures.js";
|
|
6
6
|
|
|
7
7
|
//#region src/types/RowModelFns.d.ts
|
|
8
8
|
interface RowModelFns_Core {}
|
|
9
9
|
interface RowModelFns_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
10
|
-
|
|
10
|
+
rowAggregationFeature: RowModelFns_Aggregation<TFeatures, TData>;
|
|
11
11
|
columnFilteringFeature: RowModelFns_ColumnFiltering<TFeatures, TData>;
|
|
12
12
|
rowSortingFeature: RowModelFns_RowSorting<TFeatures, TData>;
|
|
13
13
|
}
|
|
@@ -2,7 +2,7 @@ import { CellData, RowData, UnionToIntersection } from "./type-utils.cjs";
|
|
|
2
2
|
import { CoreFeatures } from "../core/coreFeatures.cjs";
|
|
3
3
|
import { SortFn } from "../features/row-sorting/rowSortingFeature.types.cjs";
|
|
4
4
|
import { ColumnDefBase_All } from "./ColumnDef.cjs";
|
|
5
|
-
import { AggregationFnDef } from "../features/aggregation/
|
|
5
|
+
import { AggregationFnDef } from "../features/row-aggregation/rowAggregationFeature.types.cjs";
|
|
6
6
|
import { Row } from "./Row.cjs";
|
|
7
7
|
import { FilterFn } from "../features/column-filtering/columnFilteringFeature.types.cjs";
|
|
8
8
|
import { RowModel } from "../core/row-models/coreRowModelsFeature.types.cjs";
|
|
@@ -63,7 +63,7 @@ interface FeatureSlotPrereqs {
|
|
|
63
63
|
/**
|
|
64
64
|
* Named aggregation functions require the independent aggregation feature.
|
|
65
65
|
*/
|
|
66
|
-
aggregationFns: '
|
|
66
|
+
aggregationFns: 'rowAggregationFeature';
|
|
67
67
|
/**
|
|
68
68
|
* Column resizing builds on the column sizing state and APIs.
|
|
69
69
|
*/
|
|
@@ -2,7 +2,7 @@ import { CellData, RowData, UnionToIntersection } from "./type-utils.js";
|
|
|
2
2
|
import { CoreFeatures } from "../core/coreFeatures.js";
|
|
3
3
|
import { SortFn } from "../features/row-sorting/rowSortingFeature.types.js";
|
|
4
4
|
import { ColumnDefBase_All } from "./ColumnDef.js";
|
|
5
|
-
import { AggregationFnDef } from "../features/aggregation/
|
|
5
|
+
import { AggregationFnDef } from "../features/row-aggregation/rowAggregationFeature.types.js";
|
|
6
6
|
import { Row } from "./Row.js";
|
|
7
7
|
import { FilterFn } from "../features/column-filtering/columnFilteringFeature.types.js";
|
|
8
8
|
import { RowModel } from "../core/row-models/coreRowModelsFeature.types.js";
|
|
@@ -63,7 +63,7 @@ interface FeatureSlotPrereqs {
|
|
|
63
63
|
/**
|
|
64
64
|
* Named aggregation functions require the independent aggregation feature.
|
|
65
65
|
*/
|
|
66
|
-
aggregationFns: '
|
|
66
|
+
aggregationFns: 'rowAggregationFeature';
|
|
67
67
|
/**
|
|
68
68
|
* Column resizing builds on the column sizing state and APIs.
|
|
69
69
|
*/
|
|
@@ -7,7 +7,7 @@ import { TableOptions_ColumnSizing } from "../features/column-sizing/columnSizin
|
|
|
7
7
|
import { TableOptions_ColumnResizing } from "../features/column-resizing/columnResizingFeature.types.cjs";
|
|
8
8
|
import { TableOptions_GlobalFiltering } from "../features/global-filtering/globalFilteringFeature.types.cjs";
|
|
9
9
|
import { TableOptions_RowSorting } from "../features/row-sorting/rowSortingFeature.types.cjs";
|
|
10
|
-
import { TableOptions_Aggregation } from "../features/aggregation/
|
|
10
|
+
import { TableOptions_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.cjs";
|
|
11
11
|
import { TableOptions_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.cjs";
|
|
12
12
|
import { TableOptions_RowExpanding } from "../features/row-expanding/rowExpandingFeature.types.cjs";
|
|
13
13
|
import { TableOptions_RowPinning } from "../features/row-pinning/rowPinningFeature.types.cjs";
|
|
@@ -37,7 +37,7 @@ type DebugOptions<TFeatures extends TableFeatures> = {
|
|
|
37
37
|
debugTable?: boolean;
|
|
38
38
|
} & DebugKeysFor<CoreFeatures & TFeatures>;
|
|
39
39
|
interface TableOptions_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
40
|
-
|
|
40
|
+
rowAggregationFeature: TableOptions_Aggregation;
|
|
41
41
|
columnFilteringFeature: TableOptions_ColumnFiltering<TFeatures, TData>;
|
|
42
42
|
columnGroupingFeature: TableOptions_ColumnGrouping;
|
|
43
43
|
columnOrderingFeature: TableOptions_ColumnOrdering;
|
|
@@ -52,7 +52,7 @@ interface TableOptions_FeatureMap<in out TFeatures extends TableFeatures, in out
|
|
|
52
52
|
rowSelectionFeature: TableOptions_RowSelection<TFeatures, TData>;
|
|
53
53
|
rowSortingFeature: TableOptions_RowSorting;
|
|
54
54
|
}
|
|
55
|
-
type TableOptions_StockFeatureKeys = '
|
|
55
|
+
type TableOptions_StockFeatureKeys = 'rowAggregationFeature' | 'columnFilteringFeature' | 'columnGroupingFeature' | 'columnOrderingFeature' | 'columnPinningFeature' | 'columnResizingFeature' | 'columnSizingFeature' | 'columnVisibilityFeature' | 'globalFilteringFeature' | 'rowExpandingFeature' | 'rowPaginationFeature' | 'rowPinningFeature' | 'rowSelectionFeature' | 'rowSortingFeature';
|
|
56
56
|
/**
|
|
57
57
|
* Plugin entries declaration-merged into `TableOptions_FeatureMap`, i.e. keys
|
|
58
58
|
* beyond the stock set. Resolves to `unknown` (an intersection no-op) when no
|
|
@@ -7,7 +7,7 @@ import { TableOptions_ColumnSizing } from "../features/column-sizing/columnSizin
|
|
|
7
7
|
import { TableOptions_ColumnResizing } from "../features/column-resizing/columnResizingFeature.types.js";
|
|
8
8
|
import { TableOptions_GlobalFiltering } from "../features/global-filtering/globalFilteringFeature.types.js";
|
|
9
9
|
import { TableOptions_RowSorting } from "../features/row-sorting/rowSortingFeature.types.js";
|
|
10
|
-
import { TableOptions_Aggregation } from "../features/aggregation/
|
|
10
|
+
import { TableOptions_Aggregation } from "../features/row-aggregation/rowAggregationFeature.types.js";
|
|
11
11
|
import { TableOptions_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.js";
|
|
12
12
|
import { TableOptions_RowExpanding } from "../features/row-expanding/rowExpandingFeature.types.js";
|
|
13
13
|
import { TableOptions_RowPinning } from "../features/row-pinning/rowPinningFeature.types.js";
|
|
@@ -37,7 +37,7 @@ type DebugOptions<TFeatures extends TableFeatures> = {
|
|
|
37
37
|
debugTable?: boolean;
|
|
38
38
|
} & DebugKeysFor<CoreFeatures & TFeatures>;
|
|
39
39
|
interface TableOptions_FeatureMap<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
40
|
-
|
|
40
|
+
rowAggregationFeature: TableOptions_Aggregation;
|
|
41
41
|
columnFilteringFeature: TableOptions_ColumnFiltering<TFeatures, TData>;
|
|
42
42
|
columnGroupingFeature: TableOptions_ColumnGrouping;
|
|
43
43
|
columnOrderingFeature: TableOptions_ColumnOrdering;
|
|
@@ -52,7 +52,7 @@ interface TableOptions_FeatureMap<in out TFeatures extends TableFeatures, in out
|
|
|
52
52
|
rowSelectionFeature: TableOptions_RowSelection<TFeatures, TData>;
|
|
53
53
|
rowSortingFeature: TableOptions_RowSorting;
|
|
54
54
|
}
|
|
55
|
-
type TableOptions_StockFeatureKeys = '
|
|
55
|
+
type TableOptions_StockFeatureKeys = 'rowAggregationFeature' | 'columnFilteringFeature' | 'columnGroupingFeature' | 'columnOrderingFeature' | 'columnPinningFeature' | 'columnResizingFeature' | 'columnSizingFeature' | 'columnVisibilityFeature' | 'globalFilteringFeature' | 'rowExpandingFeature' | 'rowPaginationFeature' | 'rowPinningFeature' | 'rowSelectionFeature' | 'rowSortingFeature';
|
|
56
56
|
/**
|
|
57
57
|
* Plugin entries declaration-merged into `TableOptions_FeatureMap`, i.e. keys
|
|
58
58
|
* beyond the stock set. Resolves to `unknown` (an intersection no-op) when no
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initTableWorker.cjs","names":["makeObjectMap","constructTable","storeReactivityBindings","serializeRowModel"],"sources":["../../src/worker/initTableWorker.ts"],"sourcesContent":["import { constructTable } from '../core/table/constructTable'\nimport { storeReactivityBindings } from '../store-reactivity-bindings'\nimport { makeObjectMap } from '../utils'\nimport { serializeRowModel } from './serializeRowModel'\nimport type { RowData } from '../types/type-utils'\nimport type { TableFeatures } from '../types/TableFeatures'\nimport type { TableOptions } from '../types/TableOptions'\nimport type { Table_Internal } from '../types/Table'\nimport type {\n TableWorkerRequest,\n TableWorkerResult,\n TableWorkerStage,\n TableWorkerStagePayload,\n} from './tableWorkerProtocol'\n\nexport type TableWorkerConfig<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> = Omit<TableOptions<TFeatures, TData>, 'data'>\n\nfunction capitalize(stage: string) {\n return stage.charAt(0).toUpperCase() + stage.slice(1)\n}\n\n/** Flatten column-group defs to leaf defs (mirrors core's id resolution). */\nfunction flattenColumnDefs(defs: Array<any>): Array<any> {\n return defs.flatMap((def) =>\n def.columns ? flattenColumnDefs(def.columns) : [def],\n )\n}\n\n/**\n * Runs a headless \"shadow table\" inside a dedicated Web Worker.\n *\n * Call this from a user-authored worker entry file, passing the same columns\n * and processing features used on the main thread. The shadow table runs the\n * real table-core row model pipeline (real fns, real Row objects) off the\n * main thread and posts back one payload per stage the main thread requested:\n * a transferable index permutation for flat results, a serialized row tree\n * (with eagerly computed aggregates) when grouping produces synthetic rows.\n *\n * Everything passed here must be thread-portable: `accessorKey` columns or\n * accessors defined in a shared module, and fns from registries or shared\n * modules (no closures over app state).\n *\n * @example\n * ```ts\n * // table.worker.ts\n * import { initTableWorker } from '@tanstack/table-core/experimental-worker-plugin'\n * import { columns, sharedFeatures } from './tableConfig'\n *\n * initTableWorker({ features: sharedFeatures, columns })\n * ```\n */\nexport function initTableWorker<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(config: TableWorkerConfig<TFeatures, TData>): void {\n let table: Table_Internal<TFeatures, TData> | undefined\n let dataVersion = 0\n let coreIndexById: Record<string, number> = makeObjectMap()\n let aggregateColumnIds: Array<string> = []\n // Last-sent model identity per stage: the memoized getters return stable\n // objects when their inputs did not change, so identity equality is exactly\n // \"this stage's result is unchanged\".\n let lastSentModels: { [K in TableWorkerStage]?: unknown } = {}\n\n self.onmessage = (event: MessageEvent<TableWorkerRequest<TData>>) => {\n const message = event.data\n\n if (message.type === 'data') {\n dataVersion = message.dataVersion\n lastSentModels = {}\n if (!table) {\n table = constructTable<TFeatures, TData>({\n ...(config as TableOptions<TFeatures, TData>),\n features: {\n coreReactivityFeature: storeReactivityBindings(),\n ...config.features,\n },\n data: message.data,\n })\n // Only columns with an explicit aggregation get eagerly aggregated\n // per group. Sync tables aggregate lazily (visible cells only), so\n // auto-aggregating every column would explode on high-cardinality\n // grouping for values nothing renders. Read the RAW column defs:\n //
|
|
1
|
+
{"version":3,"file":"initTableWorker.cjs","names":["makeObjectMap","constructTable","storeReactivityBindings","serializeRowModel"],"sources":["../../src/worker/initTableWorker.ts"],"sourcesContent":["import { constructTable } from '../core/table/constructTable'\nimport { storeReactivityBindings } from '../store-reactivity-bindings'\nimport { makeObjectMap } from '../utils'\nimport { serializeRowModel } from './serializeRowModel'\nimport type { RowData } from '../types/type-utils'\nimport type { TableFeatures } from '../types/TableFeatures'\nimport type { TableOptions } from '../types/TableOptions'\nimport type { Table_Internal } from '../types/Table'\nimport type {\n TableWorkerRequest,\n TableWorkerResult,\n TableWorkerStage,\n TableWorkerStagePayload,\n} from './tableWorkerProtocol'\n\nexport type TableWorkerConfig<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> = Omit<TableOptions<TFeatures, TData>, 'data'>\n\nfunction capitalize(stage: string) {\n return stage.charAt(0).toUpperCase() + stage.slice(1)\n}\n\n/** Flatten column-group defs to leaf defs (mirrors core's id resolution). */\nfunction flattenColumnDefs(defs: Array<any>): Array<any> {\n return defs.flatMap((def) =>\n def.columns ? flattenColumnDefs(def.columns) : [def],\n )\n}\n\n/**\n * Runs a headless \"shadow table\" inside a dedicated Web Worker.\n *\n * Call this from a user-authored worker entry file, passing the same columns\n * and processing features used on the main thread. The shadow table runs the\n * real table-core row model pipeline (real fns, real Row objects) off the\n * main thread and posts back one payload per stage the main thread requested:\n * a transferable index permutation for flat results, a serialized row tree\n * (with eagerly computed aggregates) when grouping produces synthetic rows.\n *\n * Everything passed here must be thread-portable: `accessorKey` columns or\n * accessors defined in a shared module, and fns from registries or shared\n * modules (no closures over app state).\n *\n * @example\n * ```ts\n * // table.worker.ts\n * import { initTableWorker } from '@tanstack/table-core/experimental-worker-plugin'\n * import { columns, sharedFeatures } from './tableConfig'\n *\n * initTableWorker({ features: sharedFeatures, columns })\n * ```\n */\nexport function initTableWorker<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(config: TableWorkerConfig<TFeatures, TData>): void {\n let table: Table_Internal<TFeatures, TData> | undefined\n let dataVersion = 0\n let coreIndexById: Record<string, number> = makeObjectMap()\n let aggregateColumnIds: Array<string> = []\n // Last-sent model identity per stage: the memoized getters return stable\n // objects when their inputs did not change, so identity equality is exactly\n // \"this stage's result is unchanged\".\n let lastSentModels: { [K in TableWorkerStage]?: unknown } = {}\n\n self.onmessage = (event: MessageEvent<TableWorkerRequest<TData>>) => {\n const message = event.data\n\n if (message.type === 'data') {\n dataVersion = message.dataVersion\n lastSentModels = {}\n if (!table) {\n table = constructTable<TFeatures, TData>({\n ...(config as TableOptions<TFeatures, TData>),\n features: {\n coreReactivityFeature: storeReactivityBindings(),\n ...config.features,\n },\n data: message.data,\n })\n // Only columns with an explicit aggregation get eagerly aggregated\n // per group. Sync tables aggregate lazily (visible cells only), so\n // auto-aggregating every column would explode on high-cardinality\n // grouping for values nothing renders. Read the RAW column defs:\n // rowAggregationFeature injects default aggregatedCell/aggregationFn\n // into every resolved columnDef, so the resolved defs can't tell\n // explicit from default.\n aggregateColumnIds = flattenColumnDefs(config.columns as Array<any>)\n .filter(\n (def) => def.aggregationFn != null || def.aggregatedCell != null,\n )\n .map(\n (def) =>\n def.id ??\n (typeof def.accessorKey === 'string'\n ? def.accessorKey.replaceAll('.', '_')\n : undefined),\n )\n .filter((id): id is string => id != null)\n } else {\n table.setOptions((prev) => ({ ...prev, data: message.data }))\n }\n // Map row ids to data positions once per dataset; serialization uses it\n // to express every stage result in terms of core row positions.\n const coreFlatRows = table.getCoreRowModel().flatRows\n coreIndexById = makeObjectMap()\n for (let i = 0; i < coreFlatRows.length; i++) {\n coreIndexById[coreFlatRows[i]!.id] = i\n }\n return\n }\n\n if (!table) return\n\n const start = performance.now()\n\n // Apply the serializable state slices to the shadow table's base atoms.\n table._reactivity.batch(() => {\n for (const [key, value] of Object.entries(message.state)) {\n const baseAtom = (table!.baseAtoms as Record<string, any>)[key]\n if (baseAtom && value !== undefined) {\n baseAtom.set(value)\n }\n }\n })\n\n // Compute exactly the stages the main thread requested, skipping any this\n // shadow table has no row model factory for (the main thread warns).\n const stages: { [K in TableWorkerStage]?: TableWorkerStagePayload } = {}\n const transfer: Array<Transferable> = []\n\n for (const stage of message.stages) {\n if (!(config.features as Record<string, unknown>)[`${stage}RowModel`]) {\n continue\n }\n const model = (table as any)[`get${capitalize(stage)}RowModel`]()\n // Memoized getters return the same object when inputs are unchanged;\n // skip re-serializing (and the main thread skips rebuilding). Safe under\n // single-flight: results are never dropped within a dataVersion.\n if (lastSentModels[stage] === model) {\n stages[stage] = { kind: 'unchanged' }\n continue\n }\n lastSentModels[stage] = model\n stages[stage] = serializeRowModel(\n model,\n coreIndexById,\n aggregateColumnIds,\n transfer,\n )\n }\n\n const response: TableWorkerResult = {\n type: 'result',\n requestId: message.requestId,\n dataVersion,\n stages,\n computeMs: performance.now() - start,\n }\n postMessage(response, { transfer })\n }\n}\n"],"mappings":";;;;;;AAoBA,SAAS,WAAW,OAAe;CACjC,OAAO,MAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,MAAM,MAAM,CAAC;AACtD;;AAGA,SAAS,kBAAkB,MAA8B;CACvD,OAAO,KAAK,SAAS,QACnB,IAAI,UAAU,kBAAkB,IAAI,OAAO,IAAI,CAAC,GAAG,CACrD;AACF;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,gBAGd,QAAmD;CACnD,IAAI;CACJ,IAAI,cAAc;CAClB,IAAI,gBAAwCA,4BAAc;CAC1D,IAAI,qBAAoC,CAAC;CAIzC,IAAI,iBAAwD,CAAC;CAE7D,KAAK,aAAa,UAAmD;EACnE,MAAM,UAAU,MAAM;EAEtB,IAAI,QAAQ,SAAS,QAAQ;GAC3B,cAAc,QAAQ;GACtB,iBAAiB,CAAC;GAClB,IAAI,CAAC,OAAO;IACV,QAAQC,sCAAiC;KACvC,GAAI;KACJ,UAAU;MACR,uBAAuBC,0DAAwB;MAC/C,GAAG,OAAO;KACZ;KACA,MAAM,QAAQ;IAChB,CAAC;IAQD,qBAAqB,kBAAkB,OAAO,OAAqB,CAAC,CACjE,QACE,QAAQ,IAAI,iBAAiB,QAAQ,IAAI,kBAAkB,IAC9D,CAAC,CACA,KACE,QACC,IAAI,OACH,OAAO,IAAI,gBAAgB,WACxB,IAAI,YAAY,WAAW,KAAK,GAAG,IACnC,OACR,CAAC,CACA,QAAQ,OAAqB,MAAM,IAAI;GAC5C,OACE,MAAM,YAAY,UAAU;IAAE,GAAG;IAAM,MAAM,QAAQ;GAAK,EAAE;GAI9D,MAAM,eAAe,MAAM,gBAAgB,CAAC,CAAC;GAC7C,gBAAgBF,4BAAc;GAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KACvC,cAAc,aAAa,EAAE,CAAE,MAAM;GAEvC;EACF;EAEA,IAAI,CAAC,OAAO;EAEZ,MAAM,QAAQ,YAAY,IAAI;EAG9B,MAAM,YAAY,YAAY;GAC5B,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,QAAQ,KAAK,GAAG;IACxD,MAAM,WAAY,MAAO,UAAkC;IAC3D,IAAI,YAAY,UAAU,QACxB,SAAS,IAAI,KAAK;GAEtB;EACF,CAAC;EAID,MAAM,SAAgE,CAAC;EACvE,MAAM,WAAgC,CAAC;EAEvC,KAAK,MAAM,SAAS,QAAQ,QAAQ;GAClC,IAAI,CAAE,OAAO,SAAqC,GAAG,MAAM,YACzD;GAEF,MAAM,QAAS,MAAc,MAAM,WAAW,KAAK,EAAE,UAAU,CAAC;GAIhE,IAAI,eAAe,WAAW,OAAO;IACnC,OAAO,SAAS,EAAE,MAAM,YAAY;IACpC;GACF;GACA,eAAe,SAAS;GACxB,OAAO,SAASG,4CACd,OACA,eACA,oBACA,QACF;EACF;EAEA,MAAM,WAA8B;GAClC,MAAM;GACN,WAAW,QAAQ;GACnB;GACA;GACA,WAAW,YAAY,IAAI,IAAI;EACjC;EACA,YAAY,UAAU,EAAE,SAAS,CAAC;CACpC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initTableWorker.js","names":[],"sources":["../../src/worker/initTableWorker.ts"],"sourcesContent":["import { constructTable } from '../core/table/constructTable'\nimport { storeReactivityBindings } from '../store-reactivity-bindings'\nimport { makeObjectMap } from '../utils'\nimport { serializeRowModel } from './serializeRowModel'\nimport type { RowData } from '../types/type-utils'\nimport type { TableFeatures } from '../types/TableFeatures'\nimport type { TableOptions } from '../types/TableOptions'\nimport type { Table_Internal } from '../types/Table'\nimport type {\n TableWorkerRequest,\n TableWorkerResult,\n TableWorkerStage,\n TableWorkerStagePayload,\n} from './tableWorkerProtocol'\n\nexport type TableWorkerConfig<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> = Omit<TableOptions<TFeatures, TData>, 'data'>\n\nfunction capitalize(stage: string) {\n return stage.charAt(0).toUpperCase() + stage.slice(1)\n}\n\n/** Flatten column-group defs to leaf defs (mirrors core's id resolution). */\nfunction flattenColumnDefs(defs: Array<any>): Array<any> {\n return defs.flatMap((def) =>\n def.columns ? flattenColumnDefs(def.columns) : [def],\n )\n}\n\n/**\n * Runs a headless \"shadow table\" inside a dedicated Web Worker.\n *\n * Call this from a user-authored worker entry file, passing the same columns\n * and processing features used on the main thread. The shadow table runs the\n * real table-core row model pipeline (real fns, real Row objects) off the\n * main thread and posts back one payload per stage the main thread requested:\n * a transferable index permutation for flat results, a serialized row tree\n * (with eagerly computed aggregates) when grouping produces synthetic rows.\n *\n * Everything passed here must be thread-portable: `accessorKey` columns or\n * accessors defined in a shared module, and fns from registries or shared\n * modules (no closures over app state).\n *\n * @example\n * ```ts\n * // table.worker.ts\n * import { initTableWorker } from '@tanstack/table-core/experimental-worker-plugin'\n * import { columns, sharedFeatures } from './tableConfig'\n *\n * initTableWorker({ features: sharedFeatures, columns })\n * ```\n */\nexport function initTableWorker<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(config: TableWorkerConfig<TFeatures, TData>): void {\n let table: Table_Internal<TFeatures, TData> | undefined\n let dataVersion = 0\n let coreIndexById: Record<string, number> = makeObjectMap()\n let aggregateColumnIds: Array<string> = []\n // Last-sent model identity per stage: the memoized getters return stable\n // objects when their inputs did not change, so identity equality is exactly\n // \"this stage's result is unchanged\".\n let lastSentModels: { [K in TableWorkerStage]?: unknown } = {}\n\n self.onmessage = (event: MessageEvent<TableWorkerRequest<TData>>) => {\n const message = event.data\n\n if (message.type === 'data') {\n dataVersion = message.dataVersion\n lastSentModels = {}\n if (!table) {\n table = constructTable<TFeatures, TData>({\n ...(config as TableOptions<TFeatures, TData>),\n features: {\n coreReactivityFeature: storeReactivityBindings(),\n ...config.features,\n },\n data: message.data,\n })\n // Only columns with an explicit aggregation get eagerly aggregated\n // per group. Sync tables aggregate lazily (visible cells only), so\n // auto-aggregating every column would explode on high-cardinality\n // grouping for values nothing renders. Read the RAW column defs:\n //
|
|
1
|
+
{"version":3,"file":"initTableWorker.js","names":[],"sources":["../../src/worker/initTableWorker.ts"],"sourcesContent":["import { constructTable } from '../core/table/constructTable'\nimport { storeReactivityBindings } from '../store-reactivity-bindings'\nimport { makeObjectMap } from '../utils'\nimport { serializeRowModel } from './serializeRowModel'\nimport type { RowData } from '../types/type-utils'\nimport type { TableFeatures } from '../types/TableFeatures'\nimport type { TableOptions } from '../types/TableOptions'\nimport type { Table_Internal } from '../types/Table'\nimport type {\n TableWorkerRequest,\n TableWorkerResult,\n TableWorkerStage,\n TableWorkerStagePayload,\n} from './tableWorkerProtocol'\n\nexport type TableWorkerConfig<\n TFeatures extends TableFeatures,\n TData extends RowData,\n> = Omit<TableOptions<TFeatures, TData>, 'data'>\n\nfunction capitalize(stage: string) {\n return stage.charAt(0).toUpperCase() + stage.slice(1)\n}\n\n/** Flatten column-group defs to leaf defs (mirrors core's id resolution). */\nfunction flattenColumnDefs(defs: Array<any>): Array<any> {\n return defs.flatMap((def) =>\n def.columns ? flattenColumnDefs(def.columns) : [def],\n )\n}\n\n/**\n * Runs a headless \"shadow table\" inside a dedicated Web Worker.\n *\n * Call this from a user-authored worker entry file, passing the same columns\n * and processing features used on the main thread. The shadow table runs the\n * real table-core row model pipeline (real fns, real Row objects) off the\n * main thread and posts back one payload per stage the main thread requested:\n * a transferable index permutation for flat results, a serialized row tree\n * (with eagerly computed aggregates) when grouping produces synthetic rows.\n *\n * Everything passed here must be thread-portable: `accessorKey` columns or\n * accessors defined in a shared module, and fns from registries or shared\n * modules (no closures over app state).\n *\n * @example\n * ```ts\n * // table.worker.ts\n * import { initTableWorker } from '@tanstack/table-core/experimental-worker-plugin'\n * import { columns, sharedFeatures } from './tableConfig'\n *\n * initTableWorker({ features: sharedFeatures, columns })\n * ```\n */\nexport function initTableWorker<\n TFeatures extends TableFeatures,\n TData extends RowData,\n>(config: TableWorkerConfig<TFeatures, TData>): void {\n let table: Table_Internal<TFeatures, TData> | undefined\n let dataVersion = 0\n let coreIndexById: Record<string, number> = makeObjectMap()\n let aggregateColumnIds: Array<string> = []\n // Last-sent model identity per stage: the memoized getters return stable\n // objects when their inputs did not change, so identity equality is exactly\n // \"this stage's result is unchanged\".\n let lastSentModels: { [K in TableWorkerStage]?: unknown } = {}\n\n self.onmessage = (event: MessageEvent<TableWorkerRequest<TData>>) => {\n const message = event.data\n\n if (message.type === 'data') {\n dataVersion = message.dataVersion\n lastSentModels = {}\n if (!table) {\n table = constructTable<TFeatures, TData>({\n ...(config as TableOptions<TFeatures, TData>),\n features: {\n coreReactivityFeature: storeReactivityBindings(),\n ...config.features,\n },\n data: message.data,\n })\n // Only columns with an explicit aggregation get eagerly aggregated\n // per group. Sync tables aggregate lazily (visible cells only), so\n // auto-aggregating every column would explode on high-cardinality\n // grouping for values nothing renders. Read the RAW column defs:\n // rowAggregationFeature injects default aggregatedCell/aggregationFn\n // into every resolved columnDef, so the resolved defs can't tell\n // explicit from default.\n aggregateColumnIds = flattenColumnDefs(config.columns as Array<any>)\n .filter(\n (def) => def.aggregationFn != null || def.aggregatedCell != null,\n )\n .map(\n (def) =>\n def.id ??\n (typeof def.accessorKey === 'string'\n ? def.accessorKey.replaceAll('.', '_')\n : undefined),\n )\n .filter((id): id is string => id != null)\n } else {\n table.setOptions((prev) => ({ ...prev, data: message.data }))\n }\n // Map row ids to data positions once per dataset; serialization uses it\n // to express every stage result in terms of core row positions.\n const coreFlatRows = table.getCoreRowModel().flatRows\n coreIndexById = makeObjectMap()\n for (let i = 0; i < coreFlatRows.length; i++) {\n coreIndexById[coreFlatRows[i]!.id] = i\n }\n return\n }\n\n if (!table) return\n\n const start = performance.now()\n\n // Apply the serializable state slices to the shadow table's base atoms.\n table._reactivity.batch(() => {\n for (const [key, value] of Object.entries(message.state)) {\n const baseAtom = (table!.baseAtoms as Record<string, any>)[key]\n if (baseAtom && value !== undefined) {\n baseAtom.set(value)\n }\n }\n })\n\n // Compute exactly the stages the main thread requested, skipping any this\n // shadow table has no row model factory for (the main thread warns).\n const stages: { [K in TableWorkerStage]?: TableWorkerStagePayload } = {}\n const transfer: Array<Transferable> = []\n\n for (const stage of message.stages) {\n if (!(config.features as Record<string, unknown>)[`${stage}RowModel`]) {\n continue\n }\n const model = (table as any)[`get${capitalize(stage)}RowModel`]()\n // Memoized getters return the same object when inputs are unchanged;\n // skip re-serializing (and the main thread skips rebuilding). Safe under\n // single-flight: results are never dropped within a dataVersion.\n if (lastSentModels[stage] === model) {\n stages[stage] = { kind: 'unchanged' }\n continue\n }\n lastSentModels[stage] = model\n stages[stage] = serializeRowModel(\n model,\n coreIndexById,\n aggregateColumnIds,\n transfer,\n )\n }\n\n const response: TableWorkerResult = {\n type: 'result',\n requestId: message.requestId,\n dataVersion,\n stages,\n computeMs: performance.now() - start,\n }\n postMessage(response, { transfer })\n }\n}\n"],"mappings":";;;;;;AAoBA,SAAS,WAAW,OAAe;CACjC,OAAO,MAAM,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,MAAM,MAAM,CAAC;AACtD;;AAGA,SAAS,kBAAkB,MAA8B;CACvD,OAAO,KAAK,SAAS,QACnB,IAAI,UAAU,kBAAkB,IAAI,OAAO,IAAI,CAAC,GAAG,CACrD;AACF;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,gBAGd,QAAmD;CACnD,IAAI;CACJ,IAAI,cAAc;CAClB,IAAI,gBAAwC,cAAc;CAC1D,IAAI,qBAAoC,CAAC;CAIzC,IAAI,iBAAwD,CAAC;CAE7D,KAAK,aAAa,UAAmD;EACnE,MAAM,UAAU,MAAM;EAEtB,IAAI,QAAQ,SAAS,QAAQ;GAC3B,cAAc,QAAQ;GACtB,iBAAiB,CAAC;GAClB,IAAI,CAAC,OAAO;IACV,QAAQ,eAAiC;KACvC,GAAI;KACJ,UAAU;MACR,uBAAuB,wBAAwB;MAC/C,GAAG,OAAO;KACZ;KACA,MAAM,QAAQ;IAChB,CAAC;IAQD,qBAAqB,kBAAkB,OAAO,OAAqB,CAAC,CACjE,QACE,QAAQ,IAAI,iBAAiB,QAAQ,IAAI,kBAAkB,IAC9D,CAAC,CACA,KACE,QACC,IAAI,OACH,OAAO,IAAI,gBAAgB,WACxB,IAAI,YAAY,WAAW,KAAK,GAAG,IACnC,OACR,CAAC,CACA,QAAQ,OAAqB,MAAM,IAAI;GAC5C,OACE,MAAM,YAAY,UAAU;IAAE,GAAG;IAAM,MAAM,QAAQ;GAAK,EAAE;GAI9D,MAAM,eAAe,MAAM,gBAAgB,CAAC,CAAC;GAC7C,gBAAgB,cAAc;GAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KACvC,cAAc,aAAa,EAAE,CAAE,MAAM;GAEvC;EACF;EAEA,IAAI,CAAC,OAAO;EAEZ,MAAM,QAAQ,YAAY,IAAI;EAG9B,MAAM,YAAY,YAAY;GAC5B,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,QAAQ,KAAK,GAAG;IACxD,MAAM,WAAY,MAAO,UAAkC;IAC3D,IAAI,YAAY,UAAU,QACxB,SAAS,IAAI,KAAK;GAEtB;EACF,CAAC;EAID,MAAM,SAAgE,CAAC;EACvE,MAAM,WAAgC,CAAC;EAEvC,KAAK,MAAM,SAAS,QAAQ,QAAQ;GAClC,IAAI,CAAE,OAAO,SAAqC,GAAG,MAAM,YACzD;GAEF,MAAM,QAAS,MAAc,MAAM,WAAW,KAAK,EAAE,UAAU,CAAC;GAIhE,IAAI,eAAe,WAAW,OAAO;IACnC,OAAO,SAAS,EAAE,MAAM,YAAY;IACpC;GACF;GACA,eAAe,SAAS;GACxB,OAAO,SAAS,kBACd,OACA,eACA,oBACA,QACF;EACF;EAEA,MAAM,WAA8B;GAClC,MAAM;GACN,WAAW,QAAQ;GACnB;GACA;GACA,WAAW,YAAY,IAAI,IAAI;EACjC;EACA,YAAY,UAAU,EAAE,SAAS,CAAC;CACpC;AACF"}
|
package/package.json
CHANGED
|
@@ -6,13 +6,13 @@ metadata:
|
|
|
6
6
|
{
|
|
7
7
|
type: sub-skill,
|
|
8
8
|
library: '@tanstack/table-core',
|
|
9
|
-
library_version: '9.0.0-beta.
|
|
9
|
+
library_version: '9.0.0-beta.51',
|
|
10
10
|
}
|
|
11
11
|
requires: ['core', 'table-features']
|
|
12
12
|
sources:
|
|
13
13
|
- 'TanStack/table:docs/guide/aggregation.md'
|
|
14
14
|
- 'TanStack/table:docs/framework/react/guide/aggregation.md'
|
|
15
|
-
- 'TanStack/table:packages/table-core/src/features/aggregation'
|
|
15
|
+
- 'TanStack/table:packages/table-core/src/features/row-aggregation'
|
|
16
16
|
- 'TanStack/table:examples/react/aggregation'
|
|
17
17
|
- 'TanStack/table:examples/react/grouped-aggregation'
|
|
18
18
|
---
|
|
@@ -27,14 +27,14 @@ for synthetic grouped rows.
|
|
|
27
27
|
|
|
28
28
|
```ts
|
|
29
29
|
import {
|
|
30
|
-
|
|
30
|
+
rowAggregationFeature,
|
|
31
31
|
aggregationFn_mean,
|
|
32
32
|
aggregationFn_sum,
|
|
33
33
|
tableFeatures,
|
|
34
34
|
} from '@tanstack/table-core'
|
|
35
35
|
|
|
36
36
|
export const features = tableFeatures({
|
|
37
|
-
|
|
37
|
+
rowAggregationFeature,
|
|
38
38
|
aggregationFns: {
|
|
39
39
|
mean: aggregationFn_mean,
|
|
40
40
|
sum: aggregationFn_sum,
|
|
@@ -113,7 +113,7 @@ disables that local fallback.
|
|
|
113
113
|
|
|
114
114
|
Wrong: registering `columnGroupingFeature` solely to total a column.
|
|
115
115
|
|
|
116
|
-
Correct: register `
|
|
116
|
+
Correct: register `rowAggregationFeature` and call
|
|
117
117
|
`column.getAggregationValue()`. Grouping is only required for grouped rows.
|
|
118
118
|
|
|
119
119
|
### [HIGH] Passing a scope label and rows
|
|
@@ -136,6 +136,6 @@ grouped results sent by the worker must be structured-cloneable.
|
|
|
136
136
|
|
|
137
137
|
## API Discovery
|
|
138
138
|
|
|
139
|
-
Inspect `node_modules/@tanstack/table-core/src/features/aggregation/` and the
|
|
139
|
+
Inspect `node_modules/@tanstack/table-core/src/features/row-aggregation/` and the
|
|
140
140
|
Aggregation Guide. Use `Column_Aggregation`, `AggregationFnDef`,
|
|
141
141
|
`AggregationContext`, and `AggregationResult` for the typed public surface.
|