@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/skills/core/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
metadata:
|
|
6
6
|
type: sub-skill
|
|
7
7
|
library: '@tanstack/table-core'
|
|
8
|
-
library_version: '9.0.0-beta.
|
|
8
|
+
library_version: '9.0.0-beta.51'
|
|
9
9
|
requires: ['core', 'table-features', 'typescript']
|
|
10
10
|
sources:
|
|
11
11
|
- 'TanStack/table:docs/framework/react/guide/custom-features.md'
|
package/skills/grouping/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
metadata:
|
|
6
6
|
type: lifecycle
|
|
7
7
|
library: '@tanstack/table-core'
|
|
8
|
-
library_version: '9.0.0-beta.
|
|
8
|
+
library_version: '9.0.0-beta.51'
|
|
9
9
|
requires: ['core', 'table-features', 'typescript']
|
|
10
10
|
sources:
|
|
11
11
|
- 'TanStack/table:docs/framework/react/guide/migrating.md'
|
|
@@ -68,18 +68,18 @@ V8 bundled all stock features. V9 exposes an API only when its feature is presen
|
|
|
68
68
|
|
|
69
69
|
| Capability | V9 feature |
|
|
70
70
|
| --------------------------- | ------------------------- |
|
|
71
|
+
| Aggregation | `rowAggregationFeature` |
|
|
71
72
|
| Column faceting | `columnFacetingFeature` |
|
|
72
73
|
| Column filtering | `columnFilteringFeature` |
|
|
73
|
-
| Aggregation | `aggregationFeature` |
|
|
74
|
-
| Grouping | `columnGroupingFeature` |
|
|
75
74
|
| Column ordering | `columnOrderingFeature` |
|
|
76
75
|
| Column pinning | `columnPinningFeature` |
|
|
77
|
-
| Interactive column resizing | `columnResizingFeature` |
|
|
78
76
|
| Column sizes and offsets | `columnSizingFeature` |
|
|
79
77
|
| Column visibility | `columnVisibilityFeature` |
|
|
80
78
|
| Global filtering | `globalFilteringFeature` |
|
|
81
|
-
|
|
|
79
|
+
| Grouping | `columnGroupingFeature` |
|
|
80
|
+
| Interactive column resizing | `columnResizingFeature` |
|
|
82
81
|
| Pagination | `rowPaginationFeature` |
|
|
82
|
+
| Row expansion | `rowExpandingFeature` |
|
|
83
83
|
| Row pinning | `rowPinningFeature` |
|
|
84
84
|
| Row selection | `rowSelectionFeature` |
|
|
85
85
|
| Sorting | `rowSortingFeature` |
|
|
@@ -91,7 +91,7 @@ Honor feature prerequisites in the same `tableFeatures` call:
|
|
|
91
91
|
- `columnResizingFeature` requires `columnSizingFeature`.
|
|
92
92
|
- `globalFilteringFeature` requires `columnFilteringFeature`.
|
|
93
93
|
- Every row-model or function-registry slot requires its associated feature.
|
|
94
|
-
- `aggregationFns` requires `
|
|
94
|
+
- `aggregationFns` requires `rowAggregationFeature`; grouped aggregation uses both `rowAggregationFeature` and `columnGroupingFeature`.
|
|
95
95
|
- Put prerequisite feature properties before dependent slots so inference and diagnostics remain clear.
|
|
96
96
|
|
|
97
97
|
### 2. Move row models into feature slots and rename factories
|
|
@@ -122,7 +122,7 @@ Move registries from table options or factory arguments into these feature slots
|
|
|
122
122
|
|
|
123
123
|
Register only the built-ins the table references by string name, importing each individually (`filterFn_includesString`, `sortFn_alphanumeric`, `aggregationFn_sum`, and so on) alongside any custom functions. The full registry objects (`filterFns`, `sortFns`, `aggregationFns` exports) still work but bundle every built-in. A slot's keys become the valid string names in column definitions, and `'auto'` resolves only registered functions.
|
|
124
124
|
|
|
125
|
-
Aggregation is independent from grouping. Add `
|
|
125
|
+
Aggregation is independent from grouping. Add `rowAggregationFeature` for
|
|
126
126
|
`aggregationFn`, `aggregatedCell`, `column.getAggregationValue(options?)`, and
|
|
127
127
|
`cell.getIsAggregated`. A root total does not require grouping. Convert legacy
|
|
128
128
|
custom callables `(columnId, leafRows, childRows) => result` to
|
|
@@ -300,7 +300,7 @@ Do not confuse new capabilities with required breakages. After the table works,
|
|
|
300
300
|
- [ ] Move all remaining `get*RowModel()` options or earlier-beta `rowModels` entries to `create*RowModel()` feature slots.
|
|
301
301
|
- [ ] Register each dependent feature before its row-model slot.
|
|
302
302
|
- [ ] Move `filterFns`, `sortingFns`/`sortFns`, and `aggregationFns` into feature slots, registering individually imported built-ins; pass no registries to factories.
|
|
303
|
-
- [ ] Register `
|
|
303
|
+
- [ ] Register `rowAggregationFeature` independently and migrate custom aggregation callables to context-based `AggregationFnDef` definitions.
|
|
304
304
|
- [ ] Register `columnFilteringFeature` before global filtering and filter/facet dependencies.
|
|
305
305
|
- [ ] Register `columnSizingFeature` before `columnResizingFeature`.
|
|
306
306
|
- [ ] Replace `table.getState()` and top-level `onStateChange` according to the adapter state guide.
|
package/skills/sorting/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
metadata:
|
|
6
6
|
type: sub-skill
|
|
7
7
|
library: '@tanstack/table-core'
|
|
8
|
-
library_version: '9.0.0-beta.
|
|
8
|
+
library_version: '9.0.0-beta.51'
|
|
9
9
|
requires: ['core']
|
|
10
10
|
sources:
|
|
11
11
|
- 'TanStack/table:docs/guide/row-models.md'
|
|
@@ -22,7 +22,7 @@ This skill builds on `core`. Read it first for the headless model and stable inp
|
|
|
22
22
|
|
|
23
23
|
```ts
|
|
24
24
|
import {
|
|
25
|
-
|
|
25
|
+
rowAggregationFeature,
|
|
26
26
|
aggregationFn_sum,
|
|
27
27
|
columnGroupingFeature,
|
|
28
28
|
createFilteredRowModel,
|
|
@@ -38,7 +38,7 @@ export const features = tableFeatures({
|
|
|
38
38
|
columnFilteringFeature,
|
|
39
39
|
filteredRowModel: createFilteredRowModel(),
|
|
40
40
|
filterFns: { includesString: filterFn_includesString },
|
|
41
|
-
|
|
41
|
+
rowAggregationFeature,
|
|
42
42
|
columnGroupingFeature,
|
|
43
43
|
aggregationFns: { sum: aggregationFn_sum },
|
|
44
44
|
rowSortingFeature,
|
|
@@ -68,7 +68,7 @@ const features = tableFeatures({
|
|
|
68
68
|
filterFns: { includesString: filterFn_includesString },
|
|
69
69
|
rowSortingFeature,
|
|
70
70
|
sortFns: { alphanumeric: sortFn_alphanumeric },
|
|
71
|
-
|
|
71
|
+
rowAggregationFeature,
|
|
72
72
|
columnGroupingFeature,
|
|
73
73
|
aggregationFns: { sum: aggregationFn_sum },
|
|
74
74
|
})
|
|
@@ -76,7 +76,7 @@ const features = tableFeatures({
|
|
|
76
76
|
|
|
77
77
|
`filterFns`, `sortFns`, and `aggregationFns` are feature slots, not table
|
|
78
78
|
options. They respectively require `columnFilteringFeature`,
|
|
79
|
-
`rowSortingFeature`, and `
|
|
79
|
+
`rowSortingFeature`, and `rowAggregationFeature`. Import individual built-ins
|
|
80
80
|
(`filterFn_*`, `sortFn_*`, `aggregationFn_*`) and register them under their
|
|
81
81
|
conventional keys; the full registry objects (`filterFns`, `sortFns`,
|
|
82
82
|
`aggregationFns` exports) still work but bundle every built-in. A registered
|
|
@@ -6,7 +6,7 @@ import { table_autoResetPageIndex } from '../row-pagination/rowPaginationFeature
|
|
|
6
6
|
import {
|
|
7
7
|
aggregateColumnValue,
|
|
8
8
|
normalizeAggregationRows,
|
|
9
|
-
} from '../aggregation/
|
|
9
|
+
} from '../row-aggregation/rowAggregationFeature.utils'
|
|
10
10
|
import { row_getGroupingValue } from './columnGroupingFeature.utils'
|
|
11
11
|
import type { Row_ColumnGrouping } from './columnGroupingFeature.types'
|
|
12
12
|
import type { TableFeatures } from '../../types/TableFeatures'
|
|
@@ -20,7 +20,7 @@ import type { RowData } from '../../types/type-utils'
|
|
|
20
20
|
*
|
|
21
21
|
* The factory reads the relevant table state atoms and options, then returns a row model function used by the table row-model pipeline.
|
|
22
22
|
*
|
|
23
|
-
* When
|
|
23
|
+
* When rowAggregationFeature is also registered, grouped rows use its shared
|
|
24
24
|
* executor for non-group values. Grouping remains useful without aggregation.
|
|
25
25
|
*/
|
|
26
26
|
export function createGroupedRowModel<
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { constructAggregationFn } from './
|
|
2
|
-
import type { AggregationContext } from './
|
|
1
|
+
import { constructAggregationFn } from './rowAggregationFeature.types'
|
|
2
|
+
import type { AggregationContext } from './rowAggregationFeature.types'
|
|
3
3
|
|
|
4
4
|
type RangeValue = Date | number
|
|
5
5
|
|
package/src/features/{aggregation/aggregationFeature.ts → row-aggregation/rowAggregationFeature.ts}
RENAMED
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
column_getAggregationValue,
|
|
6
6
|
column_getAutoAggregationFn,
|
|
7
7
|
formatAggregatedCellValue,
|
|
8
|
-
} from './
|
|
8
|
+
} from './rowAggregationFeature.utils'
|
|
9
9
|
import type { TableFeature } from '../../types/TableFeatures'
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Independent aggregation feature for grouped values and root/custom-row totals.
|
|
13
13
|
*/
|
|
14
|
-
export const
|
|
14
|
+
export const rowAggregationFeature: TableFeature = {
|
|
15
15
|
getDefaultColumnDef: () => ({
|
|
16
16
|
aggregatedCell: ({ column, getValue }: any) =>
|
|
17
17
|
formatAggregatedCellValue(getValue(), column.columnDef.aggregationFn),
|
|
@@ -24,7 +24,7 @@ export const aggregationFeature: TableFeature = {
|
|
|
24
24
|
}),
|
|
25
25
|
|
|
26
26
|
assignCellPrototype: (prototype, table) => {
|
|
27
|
-
assignPrototypeAPIs('
|
|
27
|
+
assignPrototypeAPIs('rowAggregationFeature', prototype, table, {
|
|
28
28
|
cell_getIsAggregated: {
|
|
29
29
|
fn: (cell) => cell_getIsAggregated(cell),
|
|
30
30
|
},
|
|
@@ -32,7 +32,7 @@ export const aggregationFeature: TableFeature = {
|
|
|
32
32
|
},
|
|
33
33
|
|
|
34
34
|
assignColumnPrototype: (prototype, table) => {
|
|
35
|
-
assignPrototypeAPIs('
|
|
35
|
+
assignPrototypeAPIs('rowAggregationFeature', prototype, table, {
|
|
36
36
|
column_getAggregationFns: {
|
|
37
37
|
fn: (column) => column_getAggregationFns(column),
|
|
38
38
|
},
|
|
@@ -229,7 +229,7 @@ export interface ResolvedAggregationFn<
|
|
|
229
229
|
id: string | undefined
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
/** Column-definition options installed by `
|
|
232
|
+
/** Column-definition options installed by `rowAggregationFeature`. */
|
|
233
233
|
export interface ColumnDef_Aggregation<
|
|
234
234
|
in out TFeatures extends TableFeatures,
|
|
235
235
|
in out TData extends RowData,
|
|
@@ -260,7 +260,7 @@ export interface ColumnDef_Aggregation<
|
|
|
260
260
|
) => AggregationValueResult | undefined
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
/** Column instance APIs installed by `
|
|
263
|
+
/** Column instance APIs installed by `rowAggregationFeature`. */
|
|
264
264
|
export interface Column_Aggregation<
|
|
265
265
|
in out TFeatures extends TableFeatures,
|
|
266
266
|
in out TData extends RowData,
|
|
@@ -294,7 +294,7 @@ export interface AggregationValueOptions<
|
|
|
294
294
|
rows?: ReadonlyArray<Row<TFeatures, TData>>
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
/** Cell instance APIs installed by `
|
|
297
|
+
/** Cell instance APIs installed by `rowAggregationFeature`. */
|
|
298
298
|
export interface Cell_Aggregation {
|
|
299
299
|
/** Whether this cell displays an aggregate on a synthetic grouped row. */
|
|
300
300
|
getIsAggregated: () => boolean
|
|
@@ -328,7 +328,7 @@ export interface AggregationValueResult<TResult = unknown> {
|
|
|
328
328
|
value: TResult
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
/** Table options installed by `
|
|
331
|
+
/** Table options installed by `rowAggregationFeature`. */
|
|
332
332
|
export interface TableOptions_Aggregation {
|
|
333
333
|
/**
|
|
334
334
|
* Disables local `column.getAggregationValue()` calculation when a column
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { columnFacetingFeature } from './column-faceting/columnFacetingFeature'
|
|
2
|
-
import {
|
|
2
|
+
import { rowAggregationFeature } from './row-aggregation/rowAggregationFeature'
|
|
3
3
|
import { columnFilteringFeature } from './column-filtering/columnFilteringFeature'
|
|
4
4
|
import { columnGroupingFeature } from './column-grouping/columnGroupingFeature'
|
|
5
5
|
import { columnOrderingFeature } from './column-ordering/columnOrderingFeature'
|
|
@@ -15,7 +15,7 @@ import { rowSelectionFeature } from './row-selection/rowSelectionFeature'
|
|
|
15
15
|
import { rowSortingFeature } from './row-sorting/rowSortingFeature'
|
|
16
16
|
|
|
17
17
|
export interface StockFeatures {
|
|
18
|
-
|
|
18
|
+
rowAggregationFeature: typeof rowAggregationFeature
|
|
19
19
|
columnFacetingFeature: typeof columnFacetingFeature
|
|
20
20
|
columnFilteringFeature: typeof columnFilteringFeature
|
|
21
21
|
columnGroupingFeature: typeof columnGroupingFeature
|
|
@@ -38,7 +38,7 @@ export interface StockFeatures {
|
|
|
38
38
|
* Use individual feature exports for tree-shaking, or this aggregate when a table should include every built-in feature.
|
|
39
39
|
*/
|
|
40
40
|
export const stockFeatures: StockFeatures = {
|
|
41
|
-
|
|
41
|
+
rowAggregationFeature,
|
|
42
42
|
columnFacetingFeature,
|
|
43
43
|
columnFilteringFeature,
|
|
44
44
|
columnGroupingFeature,
|
package/src/index.ts
CHANGED
|
@@ -64,10 +64,10 @@ export * from './core/table/coreTablesFeature.types'
|
|
|
64
64
|
|
|
65
65
|
export * from './features/stockFeatures'
|
|
66
66
|
|
|
67
|
-
//
|
|
68
|
-
export * from './features/aggregation/
|
|
69
|
-
export * from './features/aggregation/
|
|
70
|
-
export * from './features/aggregation/aggregationFns'
|
|
67
|
+
// rowAggregationFeature
|
|
68
|
+
export * from './features/row-aggregation/rowAggregationFeature'
|
|
69
|
+
export * from './features/row-aggregation/rowAggregationFeature.types'
|
|
70
|
+
export * from './features/row-aggregation/aggregationFns'
|
|
71
71
|
|
|
72
72
|
// columnFacetingFeature
|
|
73
73
|
export * from './features/column-faceting/columnFacetingFeature'
|
package/src/static-functions.ts
CHANGED
|
@@ -15,7 +15,7 @@ export * from './core/row-models/coreRowModelsFeature.utils'
|
|
|
15
15
|
export * from './core/table/coreTablesFeature.utils'
|
|
16
16
|
|
|
17
17
|
// Features
|
|
18
|
-
export * from './features/aggregation/
|
|
18
|
+
export * from './features/row-aggregation/rowAggregationFeature.utils'
|
|
19
19
|
export * from './features/column-faceting/columnFacetingFeature.utils'
|
|
20
20
|
export * from './features/column-filtering/columnFilteringFeature.utils'
|
|
21
21
|
export * from './features/column-grouping/columnGroupingFeature.utils'
|
package/src/types/Cell.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Cell_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
|
|
2
|
-
import type { Cell_Aggregation } from '../features/aggregation/
|
|
2
|
+
import type { Cell_Aggregation } from '../features/row-aggregation/rowAggregationFeature.types'
|
|
3
3
|
import type { CellData, RowData } from './type-utils'
|
|
4
4
|
import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
5
5
|
import type { Cell_Cell } from '../core/cells/coreCellsFeature.types'
|
|
@@ -11,7 +11,7 @@ export interface Cell_Core<
|
|
|
11
11
|
> extends Cell_Cell<TFeatures, TData, TValue> {}
|
|
12
12
|
|
|
13
13
|
export interface Cell_FeatureMap {
|
|
14
|
-
|
|
14
|
+
rowAggregationFeature: Cell_Aggregation
|
|
15
15
|
columnGroupingFeature: Cell_ColumnGrouping
|
|
16
16
|
}
|
|
17
17
|
|
package/src/types/Column.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Table_Internal } from './Table'
|
|
2
2
|
import type { Column_RowSorting } from '../features/row-sorting/rowSortingFeature.types'
|
|
3
|
-
import type { Column_Aggregation } from '../features/aggregation/
|
|
3
|
+
import type { Column_Aggregation } from '../features/row-aggregation/rowAggregationFeature.types'
|
|
4
4
|
import type { Column_ColumnFaceting } from '../features/column-faceting/columnFacetingFeature.types'
|
|
5
5
|
import type { Column_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
6
6
|
import type { Column_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
|
|
@@ -25,7 +25,7 @@ export interface Column_FeatureMap<
|
|
|
25
25
|
in out TFeatures extends TableFeatures,
|
|
26
26
|
in out TData extends RowData,
|
|
27
27
|
> {
|
|
28
|
-
|
|
28
|
+
rowAggregationFeature: Column_Aggregation<TFeatures, TData>
|
|
29
29
|
columnFacetingFeature: Column_ColumnFaceting<TFeatures, TData>
|
|
30
30
|
columnFilteringFeature: Column_ColumnFiltering<TFeatures, TData>
|
|
31
31
|
columnGroupingFeature: Column_ColumnGrouping
|
package/src/types/ColumnDef.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
import type { CellContext } from '../core/cells/coreCellsFeature.types'
|
|
8
8
|
import type { HeaderContext } from '../core/headers/coreHeadersFeature.types'
|
|
9
9
|
import type { ColumnDef_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
10
|
-
import type { ColumnDef_Aggregation } from '../features/aggregation/
|
|
10
|
+
import type { ColumnDef_Aggregation } from '../features/row-aggregation/rowAggregationFeature.types'
|
|
11
11
|
import type { ColumnDef_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
|
|
12
12
|
import type { ColumnDef_ColumnPinning } from '../features/column-pinning/columnPinningFeature.types'
|
|
13
13
|
import type { ColumnDef_ColumnResizing } from '../features/column-resizing/columnResizingFeature.types'
|
|
@@ -133,7 +133,7 @@ export interface ColumnDef_FeatureMap<
|
|
|
133
133
|
in out TData extends RowData,
|
|
134
134
|
TValue extends CellData,
|
|
135
135
|
> {
|
|
136
|
-
|
|
136
|
+
rowAggregationFeature: ColumnDef_Aggregation<TFeatures, TData, TValue>
|
|
137
137
|
columnVisibilityFeature: ColumnDef_ColumnVisibility
|
|
138
138
|
columnPinningFeature: ColumnDef_ColumnPinning
|
|
139
139
|
columnFilteringFeature: ColumnDef_ColumnFiltering<TFeatures, TData>
|
package/src/types/Row.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Row_ColumnVisibility } from '../features/column-visibility/columnVisibilityFeature.types'
|
|
2
|
-
import type { Row_Aggregation } from '../features/aggregation/
|
|
2
|
+
import type { Row_Aggregation } from '../features/row-aggregation/rowAggregationFeature.types'
|
|
3
3
|
import type { Row_ColumnPinning } from '../features/column-pinning/columnPinningFeature.types'
|
|
4
4
|
import type { Row_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
|
|
5
5
|
import type { Row_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
@@ -19,7 +19,7 @@ export interface Row_FeatureMap<
|
|
|
19
19
|
in out TFeatures extends TableFeatures,
|
|
20
20
|
in out TData extends RowData,
|
|
21
21
|
> {
|
|
22
|
-
|
|
22
|
+
rowAggregationFeature: Row_Aggregation
|
|
23
23
|
columnFilteringFeature: Row_ColumnFiltering<TFeatures, TData>
|
|
24
24
|
columnGroupingFeature: Row_ColumnGrouping
|
|
25
25
|
columnPinningFeature: Row_ColumnPinning<TFeatures, TData>
|
package/src/types/RowModelFns.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RowModelFns_RowSorting } from '../features/row-sorting/rowSortingFeature.types'
|
|
2
|
-
import type { RowModelFns_Aggregation } from '../features/aggregation/
|
|
2
|
+
import type { RowModelFns_Aggregation } from '../features/row-aggregation/rowAggregationFeature.types'
|
|
3
3
|
import type { RowData } from './type-utils'
|
|
4
4
|
import type { RowModelFns_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
5
5
|
import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
|
|
@@ -10,7 +10,7 @@ export interface RowModelFns_FeatureMap<
|
|
|
10
10
|
in out TFeatures extends TableFeatures,
|
|
11
11
|
in out TData extends RowData,
|
|
12
12
|
> {
|
|
13
|
-
|
|
13
|
+
rowAggregationFeature: RowModelFns_Aggregation<TFeatures, TData>
|
|
14
14
|
columnFilteringFeature: RowModelFns_ColumnFiltering<TFeatures, TData>
|
|
15
15
|
rowSortingFeature: RowModelFns_RowSorting<TFeatures, TData>
|
|
16
16
|
}
|
|
@@ -10,7 +10,7 @@ import type { StockFeatures } from '../features/stockFeatures'
|
|
|
10
10
|
import type { RowModel } from '../core/row-models/coreRowModelsFeature.types'
|
|
11
11
|
import type { FilterFn } from '../features/column-filtering/columnFilteringFeature.types'
|
|
12
12
|
import type { SortFn } from '../features/row-sorting/rowSortingFeature.types'
|
|
13
|
-
import type { AggregationFnDef } from '../features/aggregation/
|
|
13
|
+
import type { AggregationFnDef } from '../features/row-aggregation/rowAggregationFeature.types'
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Detects whether a type is `any`.
|
|
@@ -92,7 +92,7 @@ export interface FeatureSlotPrereqs {
|
|
|
92
92
|
/**
|
|
93
93
|
* Named aggregation functions require the independent aggregation feature.
|
|
94
94
|
*/
|
|
95
|
-
aggregationFns: '
|
|
95
|
+
aggregationFns: 'rowAggregationFeature'
|
|
96
96
|
/**
|
|
97
97
|
* Column resizing builds on the column sizing state and APIs.
|
|
98
98
|
*/
|
|
@@ -4,7 +4,7 @@ import type { TableOptions_Columns } from '../core/columns/coreColumnsFeature.ty
|
|
|
4
4
|
import type { TableOptions_Rows } from '../core/rows/coreRowsFeature.types'
|
|
5
5
|
import type { TableOptions_Table } from '../core/table/coreTablesFeature.types'
|
|
6
6
|
import type { TableOptions_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
|
|
7
|
-
import type { TableOptions_Aggregation } from '../features/aggregation/
|
|
7
|
+
import type { TableOptions_Aggregation } from '../features/row-aggregation/rowAggregationFeature.types'
|
|
8
8
|
import type { TableOptions_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
|
|
9
9
|
import type { TableOptions_ColumnOrdering } from '../features/column-ordering/columnOrderingFeature.types'
|
|
10
10
|
import type { TableOptions_ColumnPinning } from '../features/column-pinning/columnPinningFeature.types'
|
|
@@ -59,7 +59,7 @@ export interface TableOptions_FeatureMap<
|
|
|
59
59
|
in out TFeatures extends TableFeatures,
|
|
60
60
|
in out TData extends RowData,
|
|
61
61
|
> {
|
|
62
|
-
|
|
62
|
+
rowAggregationFeature: TableOptions_Aggregation
|
|
63
63
|
columnFilteringFeature: TableOptions_ColumnFiltering<TFeatures, TData>
|
|
64
64
|
columnGroupingFeature: TableOptions_ColumnGrouping
|
|
65
65
|
columnOrderingFeature: TableOptions_ColumnOrdering
|
|
@@ -76,7 +76,7 @@ export interface TableOptions_FeatureMap<
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
type TableOptions_StockFeatureKeys =
|
|
79
|
-
| '
|
|
79
|
+
| 'rowAggregationFeature'
|
|
80
80
|
| 'columnFilteringFeature'
|
|
81
81
|
| 'columnGroupingFeature'
|
|
82
82
|
| 'columnOrderingFeature'
|
|
@@ -84,7 +84,7 @@ export function initTableWorker<
|
|
|
84
84
|
// per group. Sync tables aggregate lazily (visible cells only), so
|
|
85
85
|
// auto-aggregating every column would explode on high-cardinality
|
|
86
86
|
// grouping for values nothing renders. Read the RAW column defs:
|
|
87
|
-
//
|
|
87
|
+
// rowAggregationFeature injects default aggregatedCell/aggregationFn
|
|
88
88
|
// into every resolved columnDef, so the resolved defs can't tell
|
|
89
89
|
// explicit from default.
|
|
90
90
|
aggregateColumnIds = flattenColumnDefs(config.columns as Array<any>)
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
maxAggregationDepth: 0
|
|
13
|
-
}),
|
|
14
|
-
getDefaultTableOptions: () => ({ manualAggregation: false }),
|
|
15
|
-
assignCellPrototype: (prototype, table) => {
|
|
16
|
-
require_utils.assignPrototypeAPIs("aggregationFeature", prototype, table, { cell_getIsAggregated: { fn: (cell) => require_aggregationFeature_utils.cell_getIsAggregated(cell) } });
|
|
17
|
-
},
|
|
18
|
-
assignColumnPrototype: (prototype, table) => {
|
|
19
|
-
require_utils.assignPrototypeAPIs("aggregationFeature", prototype, table, {
|
|
20
|
-
column_getAggregationFns: { fn: (column) => require_aggregationFeature_utils.column_getAggregationFns(column) },
|
|
21
|
-
column_getAggregationValue: { fn: (column, options) => require_aggregationFeature_utils.column_getAggregationValue(column, options) },
|
|
22
|
-
column_getAutoAggregationFn: {
|
|
23
|
-
fn: (column) => require_aggregationFeature_utils.column_getAutoAggregationFn(column),
|
|
24
|
-
memoDeps: (column) => [column.table.getCoreRowModel(), column.table._rowModelFns.aggregationFns]
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
initColumnInstanceData: (column) => {
|
|
29
|
-
column._aggregationValueCache = void 0;
|
|
30
|
-
column._resolvedAggregationFnsCache = void 0;
|
|
31
|
-
},
|
|
32
|
-
initRowInstanceData: (row) => {
|
|
33
|
-
row._aggregationValuesCache = require_utils.makeObjectMap();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
|
-
exports.aggregationFeature = aggregationFeature;
|
|
39
|
-
//# sourceMappingURL=aggregationFeature.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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 maxAggregationDepth: 0,\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, options) => column_getAggregationValue(column, options),\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;EACf,qBAAqB;CACvB;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,YAAYC,4DAA2B,QAAQ,OAAO,EACrE;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"}
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|