@tanstack/table-core 9.0.0-beta.65 → 9.0.0-beta.69
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/README.md +3 -1
- package/dist/core/cells/constructCell.d.ts +0 -1
- package/dist/core/cells/coreCellsFeature.d.ts +0 -1
- package/dist/core/cells/coreCellsFeature.types.d.ts +0 -1
- package/dist/core/cells/coreCellsFeature.utils.d.ts +1 -0
- package/dist/core/columns/constructColumn.d.ts +0 -1
- package/dist/core/columns/coreColumnsFeature.d.ts +0 -1
- package/dist/core/columns/coreColumnsFeature.types.d.ts +5 -6
- package/dist/core/columns/coreColumnsFeature.utils.d.ts +0 -1
- package/dist/core/coreFeatures.d.ts +1 -0
- package/dist/core/headers/buildHeaderGroups.d.ts +0 -1
- package/dist/core/headers/buildHeaderGroups.js +11 -7
- package/dist/core/headers/constructHeader.d.ts +0 -1
- package/dist/core/headers/coreHeadersFeature.d.ts +0 -1
- package/dist/core/headers/coreHeadersFeature.types.d.ts +14 -3
- package/dist/core/headers/coreHeadersFeature.utils.d.ts +1 -0
- package/dist/core/reactivity/coreReactivityFeature.types.d.ts +0 -1
- package/dist/core/reactivity/coreReactivityFeature.utils.d.ts +0 -1
- package/dist/core/reactivity/renderPhaseReactivity.d.ts +0 -1
- package/dist/core/row-models/coreRowModelsFeature.d.ts +0 -1
- package/dist/core/row-models/coreRowModelsFeature.types.d.ts +0 -1
- package/dist/core/row-models/coreRowModelsFeature.utils.d.ts +0 -1
- package/dist/core/row-models/createCoreRowModel.d.ts +0 -1
- package/dist/core/rows/constructRow.d.ts +0 -1
- package/dist/core/rows/coreRowsFeature.d.ts +0 -1
- package/dist/core/rows/coreRowsFeature.types.d.ts +0 -1
- package/dist/core/rows/coreRowsFeature.utils.d.ts +0 -1
- package/dist/core/table/constructTable.d.ts +0 -1
- package/dist/core/table/coreTablesFeature.d.ts +0 -1
- package/dist/core/table/coreTablesFeature.types.d.ts +6 -7
- package/dist/core/table/coreTablesFeature.utils.d.ts +0 -1
- package/dist/features/cell-selection/cellSelectionFeature.d.ts +0 -1
- package/dist/features/cell-selection/cellSelectionFeature.types.d.ts +30 -16
- package/dist/features/cell-selection/cellSelectionFeature.utils.d.ts +9 -10
- package/dist/features/cell-selection/cellSelectionFeature.utils.js +37 -24
- package/dist/features/cell-selection/cellSelectionGeometry.js +90 -0
- package/dist/features/column-faceting/columnFacetingFeature.d.ts +0 -1
- package/dist/features/column-faceting/columnFacetingFeature.types.d.ts +0 -1
- package/dist/features/column-faceting/columnFacetingFeature.utils.d.ts +0 -1
- package/dist/features/column-faceting/createFacetedMinMaxValues.d.ts +0 -1
- package/dist/features/column-faceting/createFacetedRowModel.d.ts +0 -1
- package/dist/features/column-faceting/createFacetedUniqueValues.d.ts +0 -1
- package/dist/features/column-filtering/columnFilteringFeature.d.ts +0 -1
- package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +3 -4
- package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +0 -1
- package/dist/features/column-filtering/createFilteredRowModel.d.ts +0 -1
- package/dist/features/column-filtering/filterFns.d.ts +0 -1
- package/dist/features/column-grouping/columnGroupingFeature.d.ts +0 -1
- package/dist/features/column-grouping/columnGroupingFeature.types.d.ts +0 -1
- package/dist/features/column-grouping/columnGroupingFeature.utils.d.ts +0 -1
- package/dist/features/column-grouping/createGroupedRowModel.d.ts +0 -1
- package/dist/features/column-ordering/columnOrderingFeature.d.ts +0 -1
- package/dist/features/column-ordering/columnOrderingFeature.types.d.ts +0 -1
- package/dist/features/column-ordering/columnOrderingFeature.utils.d.ts +0 -1
- package/dist/features/column-pinning/columnPinningFeature.d.ts +0 -1
- package/dist/features/column-pinning/columnPinningFeature.types.d.ts +0 -1
- package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +0 -1
- package/dist/features/column-resizing/columnResizingFeature.d.ts +0 -1
- package/dist/features/column-resizing/columnResizingFeature.types.d.ts +0 -1
- package/dist/features/column-resizing/columnResizingFeature.utils.d.ts +0 -1
- package/dist/features/column-sizing/columnSizingFeature.d.ts +0 -1
- package/dist/features/column-sizing/columnSizingFeature.types.d.ts +0 -1
- package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +0 -1
- package/dist/features/column-visibility/columnVisibilityFeature.d.ts +0 -1
- package/dist/features/column-visibility/columnVisibilityFeature.types.d.ts +0 -1
- package/dist/features/column-visibility/columnVisibilityFeature.utils.d.ts +1 -0
- package/dist/features/global-filtering/globalFilteringFeature.d.ts +0 -1
- package/dist/features/global-filtering/globalFilteringFeature.types.d.ts +0 -1
- package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +1 -0
- package/dist/features/row-aggregation/aggregationFns.d.ts +0 -1
- package/dist/features/row-aggregation/rowAggregationFeature.d.ts +0 -1
- package/dist/features/row-aggregation/rowAggregationFeature.types.d.ts +1 -2
- package/dist/features/row-aggregation/rowAggregationFeature.utils.d.ts +0 -1
- package/dist/features/row-expanding/createExpandedRowModel.d.ts +0 -1
- package/dist/features/row-expanding/rowExpandingFeature.d.ts +0 -1
- package/dist/features/row-expanding/rowExpandingFeature.types.d.ts +0 -1
- package/dist/features/row-expanding/rowExpandingFeature.utils.d.ts +0 -1
- package/dist/features/row-pagination/createPaginatedRowModel.d.ts +0 -1
- package/dist/features/row-pagination/rowPaginationFeature.d.ts +0 -1
- package/dist/features/row-pagination/rowPaginationFeature.types.d.ts +0 -1
- package/dist/features/row-pagination/rowPaginationFeature.utils.d.ts +0 -1
- package/dist/features/row-pinning/rowPinningFeature.d.ts +0 -1
- package/dist/features/row-pinning/rowPinningFeature.types.d.ts +0 -1
- package/dist/features/row-pinning/rowPinningFeature.utils.d.ts +0 -1
- package/dist/features/row-selection/rowSelectionFeature.d.ts +0 -1
- package/dist/features/row-selection/rowSelectionFeature.types.d.ts +2 -3
- package/dist/features/row-selection/rowSelectionFeature.utils.d.ts +3 -4
- package/dist/features/row-selection/rowSelectionFeature.utils.js +3 -3
- package/dist/features/row-sorting/createSortedRowModel.d.ts +0 -1
- package/dist/features/row-sorting/rowSortingFeature.d.ts +0 -1
- package/dist/features/row-sorting/rowSortingFeature.types.d.ts +0 -1
- package/dist/features/row-sorting/rowSortingFeature.utils.d.ts +0 -1
- package/dist/features/row-sorting/sortFns.d.ts +0 -1
- package/dist/features/stockFeatures.d.ts +0 -1
- package/dist/flex-render.d.ts +0 -1
- package/dist/flex-render.js +9 -1
- package/dist/helpers/columnHelper.d.ts +0 -1
- package/dist/helpers/tableFeatures.d.ts +0 -1
- package/dist/helpers/tableOptions.d.ts +0 -1
- package/dist/index.d.ts +2 -2
- package/dist/store-reactivity-bindings.d.ts +0 -1
- package/dist/types/Cell.d.ts +0 -1
- package/dist/types/Column.d.ts +0 -1
- package/dist/types/ColumnDef.d.ts +0 -1
- package/dist/types/Header.d.ts +0 -1
- package/dist/types/HeaderGroup.d.ts +0 -1
- package/dist/types/Row.d.ts +0 -1
- package/dist/types/RowModel.d.ts +0 -1
- package/dist/types/RowModelFns.d.ts +0 -1
- package/dist/types/Table.d.ts +0 -1
- package/dist/types/TableFeatures.d.ts +1 -2
- package/dist/types/TableOptions.d.ts +1 -2
- package/dist/types/TableState.d.ts +0 -1
- package/dist/types/type-utils.d.ts +1 -1
- package/dist/utils.d.ts +2 -17
- package/dist/utils.js +3 -1
- package/dist/worker/createTableWorker.d.ts +2 -3
- package/dist/worker/createWorkerRowModel.d.ts +0 -1
- package/dist/worker/initTableWorker.d.ts +0 -1
- package/dist/worker/rebuildRowModel.d.ts +3 -0
- package/dist/worker/tableWorkerProtocol.d.ts +5 -4
- package/package.json +1 -1
- package/skills/aggregation/SKILL.md +1 -1
- package/skills/api-not-found/SKILL.md +1 -1
- package/skills/cell-selection/SKILL.md +33 -9
- 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 +3 -2
- 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 +1 -1
- package/skills/typescript/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
>
|
|
36
36
|
> - [Angular Table](https://tanstack.com/table/alpha/docs/framework/angular/angular-table)
|
|
37
37
|
> - [Lit Table](https://tanstack.com/table/alpha/docs/framework/lit/lit-table)
|
|
38
|
+
> - [Octane Table](https://tanstack.com/table/beta/docs/framework/octane/quick-start)
|
|
39
|
+
> - [Preact Table](https://tanstack.com/table/beta/docs/framework/preact/quick-start)
|
|
38
40
|
> - [React Table](https://tanstack.com/table/alpha/docs/framework/react/react-table)
|
|
39
41
|
> - [Solid Table](https://tanstack.com/table/alpha/docs/framework/solid/solid-table)
|
|
40
42
|
> - [Svelte Table](https://tanstack.com/table/alpha/docs/framework/svelte/svelte-table)
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
|
|
45
47
|
A headless table library for building powerful datagrids with full control over markup, styles, and behavior.
|
|
46
48
|
|
|
47
|
-
- Framework
|
|
49
|
+
- Framework-agnostic core with bindings for React, Preact, Octane, Vue, Solid, Svelte, Angular, Ember, Lit, and Alpine
|
|
48
50
|
- 100% customizable — bring your own UI, components, and styles
|
|
49
51
|
- Sorting, filtering, grouping, aggregation & row selection
|
|
50
52
|
- Lightweight, virtualizable & server‑side friendly
|
|
@@ -4,7 +4,6 @@ import { Column } from "../../types/Column.js";
|
|
|
4
4
|
import { Row } from "../../types/Row.js";
|
|
5
5
|
import { Cell } from "../../types/Cell.js";
|
|
6
6
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
7
|
-
|
|
8
7
|
//#region src/core/cells/constructCell.d.ts
|
|
9
8
|
/**
|
|
10
9
|
* Constructs a cell instance from normalized table internals.
|
|
@@ -4,7 +4,6 @@ import { Column } from "../../types/Column.js";
|
|
|
4
4
|
import { Row } from "../../types/Row.js";
|
|
5
5
|
import { Cell } from "../../types/Cell.js";
|
|
6
6
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
7
|
-
|
|
8
7
|
//#region src/core/cells/coreCellsFeature.types.d.ts
|
|
9
8
|
interface CellContext<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue extends CellData = CellData> {
|
|
10
9
|
cell: Cell<TFeatures, TData, TValue>;
|
|
@@ -4,6 +4,7 @@ import { Column } from "../../types/Column.js";
|
|
|
4
4
|
import { Row } from "../../types/Row.js";
|
|
5
5
|
import { Cell } from "../../types/Cell.js";
|
|
6
6
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
7
|
+
import "../../index.js";
|
|
7
8
|
//#region src/core/cells/coreCellsFeature.utils.d.ts
|
|
8
9
|
/**
|
|
9
10
|
* Reads this cell's accessor value from its owning row and column.
|
|
@@ -3,7 +3,6 @@ import { ColumnDef } from "../../types/ColumnDef.js";
|
|
|
3
3
|
import { Table } from "../../types/Table.js";
|
|
4
4
|
import { Column } from "../../types/Column.js";
|
|
5
5
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
6
|
-
|
|
7
6
|
//#region src/core/columns/constructColumn.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Constructs a column instance from normalized table internals.
|
|
@@ -3,7 +3,6 @@ import { AccessorFn, ColumnDef } from "../../types/ColumnDef.js";
|
|
|
3
3
|
import { Table } from "../../types/Table.js";
|
|
4
4
|
import { Column } from "../../types/Column.js";
|
|
5
5
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
6
|
-
|
|
7
6
|
//#region src/core/columns/coreColumnsFeature.types.d.ts
|
|
8
7
|
interface Column_CoreProperties<in out TFeatures extends TableFeatures, in out TData extends RowData, TValue extends CellData = CellData> {
|
|
9
8
|
/**
|
|
@@ -23,11 +22,11 @@ interface Column_CoreProperties<in out TFeatures extends TableFeatures, in out T
|
|
|
23
22
|
*/
|
|
24
23
|
depth: number;
|
|
25
24
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
* The resolved unique identifier for the column resolved in this priority:
|
|
26
|
+
- A manual `id` property from the column def
|
|
27
|
+
- The accessor key from the column def
|
|
28
|
+
- The header string from the column def
|
|
29
|
+
*/
|
|
31
30
|
id: string;
|
|
32
31
|
/**
|
|
33
32
|
* The parent column for this column. Will be undefined if this is a root column.
|
|
@@ -3,7 +3,6 @@ import { ColumnDef } from "../../types/ColumnDef.js";
|
|
|
3
3
|
import { Table } from "../../types/Table.js";
|
|
4
4
|
import { Column } from "../../types/Column.js";
|
|
5
5
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
6
|
-
|
|
7
6
|
//#region src/core/columns/coreColumnsFeature.utils.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Flattens this column and every descendant column into a single array.
|
|
@@ -5,6 +5,7 @@ import { coreRowModelsFeature } from "./row-models/coreRowModelsFeature.js";
|
|
|
5
5
|
import { coreRowsFeature } from "./rows/coreRowsFeature.js";
|
|
6
6
|
import { coreTablesFeature } from "./table/coreTablesFeature.js";
|
|
7
7
|
import { TableReactivityBindings } from "./reactivity/coreReactivityFeature.types.js";
|
|
8
|
+
import "../reactivity.js";
|
|
8
9
|
//#region src/core/coreFeatures.d.ts
|
|
9
10
|
interface CoreFeatures {
|
|
10
11
|
coreReactivityFeature?: TableReactivityBindings;
|
|
@@ -3,7 +3,6 @@ import { HeaderGroup } from "../../types/HeaderGroup.js";
|
|
|
3
3
|
import { Table } from "../../types/Table.js";
|
|
4
4
|
import { Column } from "../../types/Column.js";
|
|
5
5
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
6
|
-
|
|
7
6
|
//#region src/core/headers/buildHeaderGroups.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Builds the nested header group structure for a table.
|
|
@@ -69,21 +69,25 @@ function updateHeaderSpans(headers) {
|
|
|
69
69
|
const header = headers[i];
|
|
70
70
|
if (!callMemoOrStaticFn(header.column, "getIsVisible", column_getIsVisible)) continue;
|
|
71
71
|
let colSpan = 0;
|
|
72
|
-
let minChildRowSpan = Infinity;
|
|
73
72
|
if (header.subHeaders.length) {
|
|
74
73
|
updateHeaderSpans(header.subHeaders);
|
|
75
74
|
for (let j = 0; j < header.subHeaders.length; j++) {
|
|
76
75
|
const child = header.subHeaders[j];
|
|
77
76
|
if (!callMemoOrStaticFn(child.column, "getIsVisible", column_getIsVisible)) continue;
|
|
78
77
|
colSpan += child.colSpan;
|
|
79
|
-
if (child.rowSpan < minChildRowSpan) minChildRowSpan = child.rowSpan;
|
|
80
78
|
}
|
|
81
|
-
} else
|
|
82
|
-
colSpan = 1;
|
|
83
|
-
minChildRowSpan = 0;
|
|
84
|
-
}
|
|
79
|
+
} else colSpan = 1;
|
|
85
80
|
header.colSpan = colSpan;
|
|
86
|
-
header.
|
|
81
|
+
if (header.isPlaceholder && header.subHeaders.length === 1 && header.subHeaders[0].column === header.column) {
|
|
82
|
+
let rowSpan = 1;
|
|
83
|
+
let chainChild = header.subHeaders[0];
|
|
84
|
+
while (chainChild) {
|
|
85
|
+
chainChild.rowSpan = 0;
|
|
86
|
+
rowSpan++;
|
|
87
|
+
chainChild = chainChild.subHeaders.length === 1 && chainChild.subHeaders[0].column === header.column ? chainChild.subHeaders[0] : void 0;
|
|
88
|
+
}
|
|
89
|
+
header.rowSpan = rowSpan;
|
|
90
|
+
} else header.rowSpan = 1;
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
93
|
/**
|
|
@@ -3,7 +3,6 @@ import { Header } from "../../types/Header.js";
|
|
|
3
3
|
import { Table } from "../../types/Table.js";
|
|
4
4
|
import { Column } from "../../types/Column.js";
|
|
5
5
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
6
|
-
|
|
7
6
|
//#region src/core/headers/constructHeader.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Constructs a header instance from normalized table internals.
|
|
@@ -4,7 +4,6 @@ import { Header } from "../../types/Header.js";
|
|
|
4
4
|
import { Table } from "../../types/Table.js";
|
|
5
5
|
import { Column } from "../../types/Column.js";
|
|
6
6
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
7
|
-
|
|
8
7
|
//#region src/core/headers/coreHeadersFeature.types.d.ts
|
|
9
8
|
interface Table_Headers<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
10
9
|
/**
|
|
@@ -66,7 +65,11 @@ interface Header_CoreProperties<in out TFeatures extends TableFeatures, in out T
|
|
|
66
65
|
*/
|
|
67
66
|
index: number;
|
|
68
67
|
/**
|
|
69
|
-
* A boolean denoting if the header is a placeholder header.
|
|
68
|
+
* A boolean denoting if the header is a placeholder header. Placeholder
|
|
69
|
+
* headers fill the rows above a shallow leaf column's real header so that
|
|
70
|
+
* every header group row accounts for every visible column. Render them as
|
|
71
|
+
* empty cells, or use `header.rowSpan` to merge each chain of placeholders
|
|
72
|
+
* into one vertically spanning header cell.
|
|
70
73
|
*/
|
|
71
74
|
isPlaceholder: boolean;
|
|
72
75
|
/**
|
|
@@ -74,7 +77,15 @@ interface Header_CoreProperties<in out TFeatures extends TableFeatures, in out T
|
|
|
74
77
|
*/
|
|
75
78
|
placeholderId?: string;
|
|
76
79
|
/**
|
|
77
|
-
* The
|
|
80
|
+
* The number of header group rows the header should span when merging header
|
|
81
|
+
* cells vertically. A leaf column that is shallower than the deepest leaf
|
|
82
|
+
* column produces a chain of placeholder headers above its real header; the
|
|
83
|
+
* placeholder at the top of the chain reports the chain's full span, and
|
|
84
|
+
* every header it covers (including the real leaf header in the bottom row)
|
|
85
|
+
* reports 0. To merge vertically, skip headers with a rowSpan of 0 and
|
|
86
|
+
* render every other header with the `rowSpan` attribute and its column's
|
|
87
|
+
* header content, even when it is a placeholder. Headers in even column
|
|
88
|
+
* trees always report 1.
|
|
78
89
|
*/
|
|
79
90
|
rowSpan: number;
|
|
80
91
|
/**
|
|
@@ -4,6 +4,7 @@ import { Header } from "../../types/Header.js";
|
|
|
4
4
|
import { Table } from "../../types/Table.js";
|
|
5
5
|
import { Column } from "../../types/Column.js";
|
|
6
6
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
7
|
+
import "../../index.js";
|
|
7
8
|
//#region src/core/headers/coreHeadersFeature.utils.d.ts
|
|
8
9
|
/**
|
|
9
10
|
* Walks a header tree and collects all descendant leaf headers.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TableReactivityBindings } from "./coreReactivityFeature.types.js";
|
|
2
2
|
import { Atom, AtomOptions, ReadonlyAtom } from "@tanstack/store";
|
|
3
|
-
|
|
4
3
|
//#region src/core/reactivity/renderPhaseReactivity.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Reactivity bindings for adapters whose options are plain values synchronized
|
|
@@ -7,7 +7,6 @@ import { Row } from "../../types/Row.js";
|
|
|
7
7
|
import { Table_RowModels_Filtered } from "../../features/column-filtering/columnFilteringFeature.types.js";
|
|
8
8
|
import { Table_RowModels_Grouped } from "../../features/column-grouping/columnGroupingFeature.types.js";
|
|
9
9
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
10
|
-
|
|
11
10
|
//#region src/core/row-models/coreRowModelsFeature.types.d.ts
|
|
12
11
|
interface RowModel<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
13
12
|
rows: Array<Row<TFeatures, TData>>;
|
|
@@ -2,7 +2,6 @@ import { RowData } from "../../types/type-utils.js";
|
|
|
2
2
|
import { Table } from "../../types/Table.js";
|
|
3
3
|
import { RowModel } from "./coreRowModelsFeature.types.js";
|
|
4
4
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
5
|
-
|
|
6
5
|
//#region src/core/row-models/coreRowModelsFeature.utils.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Resolves the table's unmodified core row model.
|
|
@@ -2,7 +2,6 @@ import { RowData } from "../../types/type-utils.js";
|
|
|
2
2
|
import { Table } from "../../types/Table.js";
|
|
3
3
|
import { RowModel } from "./coreRowModelsFeature.types.js";
|
|
4
4
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
5
|
-
|
|
6
5
|
//#region src/core/row-models/createCoreRowModel.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Creates a memoized core row model factory.
|
|
@@ -2,7 +2,6 @@ import { RowData } from "../../types/type-utils.js";
|
|
|
2
2
|
import { Table } from "../../types/Table.js";
|
|
3
3
|
import { Row } from "../../types/Row.js";
|
|
4
4
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
5
|
-
|
|
6
5
|
//#region src/core/rows/constructRow.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Constructs a row instance from normalized table internals.
|
|
@@ -4,7 +4,6 @@ import { Column } from "../../types/Column.js";
|
|
|
4
4
|
import { Row } from "../../types/Row.js";
|
|
5
5
|
import { Cell } from "../../types/Cell.js";
|
|
6
6
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
7
|
-
|
|
8
7
|
//#region src/core/rows/coreRowsFeature.types.d.ts
|
|
9
8
|
interface Row_CoreProperties<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
10
9
|
_cellsCache?: WeakMap<Column<TFeatures, TData, unknown>, Cell<TFeatures, TData, unknown>>;
|
|
@@ -3,7 +3,6 @@ import { Table } from "../../types/Table.js";
|
|
|
3
3
|
import { Row } from "../../types/Row.js";
|
|
4
4
|
import { Cell } from "../../types/Cell.js";
|
|
5
5
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
6
|
-
|
|
7
6
|
//#region src/core/rows/coreRowsFeature.utils.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Returns this row's zero-based position in the current pre-pagination row
|
|
@@ -3,7 +3,6 @@ import { TableState } from "../../types/TableState.js";
|
|
|
3
3
|
import { TableOptions } from "../../types/TableOptions.js";
|
|
4
4
|
import { Table } from "../../types/Table.js";
|
|
5
5
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
6
|
-
|
|
7
6
|
//#region src/core/table/constructTable.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Builds the initial table state from registered features and user initial state.
|
|
@@ -7,7 +7,6 @@ import { TableState, TableState_All } from "../../types/TableState.js";
|
|
|
7
7
|
import { TableOptions } from "../../types/TableOptions.js";
|
|
8
8
|
import { IsAny, TableFeature, TableFeatures, ValidateFeatureSlots } from "../../types/TableFeatures.js";
|
|
9
9
|
import { Atom, ReadonlyAtom, ReadonlyStore } from "@tanstack/store";
|
|
10
|
-
|
|
11
10
|
//#region src/core/table/coreTablesFeature.types.d.ts
|
|
12
11
|
interface TableMeta<in out TFeatures extends TableFeatures, in out TData extends RowData> {}
|
|
13
12
|
/**
|
|
@@ -25,7 +24,7 @@ type ExtractTableMeta<TFeatures extends TableFeatures, TData extends RowData> =
|
|
|
25
24
|
* A map of writable atoms, one per `TableState` slice. These are the internal
|
|
26
25
|
* writable atoms that the library always writes to via `makeStateUpdater`.
|
|
27
26
|
*/
|
|
28
|
-
type BaseAtoms<TFeatures extends TableFeatures> = { [K in keyof TableState<TFeatures>]-?: Atom<TableState<TFeatures>[K]
|
|
27
|
+
type BaseAtoms<TFeatures extends TableFeatures> = { [K in keyof TableState<TFeatures>]-?: Atom<TableState<TFeatures>[K]>; };
|
|
29
28
|
/**
|
|
30
29
|
* A map of readonly derived atoms, one per `TableState` slice. Each derives
|
|
31
30
|
* from its corresponding `baseAtom` plus, optionally, a per-slice external
|
|
@@ -33,13 +32,13 @@ type BaseAtoms<TFeatures extends TableFeatures> = { [K in keyof TableState<TFeat
|
|
|
33
32
|
*
|
|
34
33
|
* Precedence: `options.atoms[key]` > `options.state[key]` > `baseAtoms[key]`.
|
|
35
34
|
*/
|
|
36
|
-
type Atoms<TFeatures extends TableFeatures> = { [K in keyof TableState<TFeatures>]-?: ReadonlyAtom<TableState<TFeatures>[K]
|
|
35
|
+
type Atoms<TFeatures extends TableFeatures> = { [K in keyof TableState<TFeatures>]-?: ReadonlyAtom<TableState<TFeatures>[K]>; };
|
|
37
36
|
/**
|
|
38
37
|
* A map of optional external atoms, one per `TableState` slice. Consumers can
|
|
39
38
|
* provide their own writable atom for any state slice to take over ownership
|
|
40
39
|
* of that slice.
|
|
41
40
|
*/
|
|
42
|
-
type ExternalAtoms<TFeatures extends TableFeatures> = Partial<{ [K in keyof TableState<TFeatures>]: Atom<TableState<TFeatures>[K]
|
|
41
|
+
type ExternalAtoms<TFeatures extends TableFeatures> = Partial<{ [K in keyof TableState<TFeatures>]: Atom<TableState<TFeatures>[K]>; }>;
|
|
43
42
|
/**
|
|
44
43
|
* Internal "all features" flat variants of the atom types. `Table`
|
|
45
44
|
* uses these so feature code (written generically over `TFeatures`) can access
|
|
@@ -50,9 +49,9 @@ type ExternalAtoms<TFeatures extends TableFeatures> = Partial<{ [K in keyof Tabl
|
|
|
50
49
|
* but those slices may not be registered on the current table. Consumers must
|
|
51
50
|
* use optional chaining (`table.atoms.columnPinning?.get() ?? default`).
|
|
52
51
|
*/
|
|
53
|
-
type BaseAtoms_All = { [K in keyof TableState_All]?: Atom<Exclude<TableState_All[K], undefined
|
|
54
|
-
type Atoms_All = { [K in keyof TableState_All]?: ReadonlyAtom<TableState_All[K]
|
|
55
|
-
type ExternalAtoms_All = Partial<{ [K in keyof TableState_All]: Atom<Exclude<TableState_All[K], undefined
|
|
52
|
+
type BaseAtoms_All = { [K in keyof TableState_All]?: Atom<Exclude<TableState_All[K], undefined>>; };
|
|
53
|
+
type Atoms_All = { [K in keyof TableState_All]?: ReadonlyAtom<TableState_All[K]>; };
|
|
54
|
+
type ExternalAtoms_All = Partial<{ [K in keyof TableState_All]: Atom<Exclude<TableState_All[K], undefined>>; }>;
|
|
56
55
|
interface TableOptions_Table<in out TFeatures extends TableFeatures, in out TData extends RowData> {
|
|
57
56
|
/**
|
|
58
57
|
* The feature modules registered on this table instance.
|
|
@@ -3,7 +3,6 @@ import { TableState } from "../../types/TableState.js";
|
|
|
3
3
|
import { TableOptions } from "../../types/TableOptions.js";
|
|
4
4
|
import { Table } from "../../types/Table.js";
|
|
5
5
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
6
|
-
|
|
7
6
|
//#region src/core/table/coreTablesFeature.utils.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Synchronizes externally controlled state slices into the table's base atoms.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CellData, OnChangeFn, RowData, Updater } from "../../types/type-utils.js";
|
|
2
2
|
import { Cell } from "../../types/Cell.js";
|
|
3
3
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
4
|
-
|
|
5
4
|
//#region src/features/cell-selection/cellSelectionFeature.types.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* A single rectangular cell selection, stored as its two defining corners.
|
|
@@ -17,10 +16,16 @@ interface CellSelectionRange {
|
|
|
17
16
|
anchorRowId: string;
|
|
18
17
|
focusColumnId: string;
|
|
19
18
|
focusRowId: string;
|
|
19
|
+
/**
|
|
20
|
+
* How this range changes the selection produced by the ranges before it.
|
|
21
|
+
* Defaults to `include`.
|
|
22
|
+
*/
|
|
23
|
+
operation?: CellSelectionRangeOperation;
|
|
20
24
|
}
|
|
25
|
+
type CellSelectionRangeOperation = 'include' | 'exclude';
|
|
21
26
|
/**
|
|
22
|
-
*
|
|
23
|
-
* and drag operate on.
|
|
27
|
+
* Ordered range operations that produce the final selection. The last entry is
|
|
28
|
+
* the active operation that shift-extend and drag operate on.
|
|
24
29
|
*
|
|
25
30
|
* A bare array, matching `SortingState` and `ColumnFiltersState`. Drag session
|
|
26
31
|
* state deliberately lives outside this slice as non-reactive instance data, so
|
|
@@ -52,10 +57,18 @@ interface CellSelectionEdges {
|
|
|
52
57
|
top: boolean;
|
|
53
58
|
}
|
|
54
59
|
type CellSelectionDirection = 'up' | 'down' | 'left' | 'right';
|
|
60
|
+
type CellSelectionRangeMode = 'replace' | 'include' | 'exclude';
|
|
55
61
|
interface SelectCellRangeOptions {
|
|
62
|
+
/**
|
|
63
|
+
* Whether to replace the selection, add the range, or subtract the range.
|
|
64
|
+
* Defaults to `replace`.
|
|
65
|
+
*/
|
|
66
|
+
mode?: CellSelectionRangeMode;
|
|
56
67
|
/**
|
|
57
68
|
* Whether the range should be added alongside existing ranges rather than
|
|
58
69
|
* replacing them. Defaults to `false`.
|
|
70
|
+
*
|
|
71
|
+
* @deprecated Use `mode: 'include'` instead.
|
|
59
72
|
*/
|
|
60
73
|
additive?: boolean;
|
|
61
74
|
}
|
|
@@ -87,8 +100,7 @@ interface TableOptions_CellSelection<in out TFeatures extends TableFeatures, in
|
|
|
87
100
|
*/
|
|
88
101
|
enableCellSelectionDrag?: boolean;
|
|
89
102
|
/**
|
|
90
|
-
* Allows
|
|
91
|
-
* `true`.
|
|
103
|
+
* Allows modifier interactions to add or subtract ranges. Defaults to `true`.
|
|
92
104
|
*/
|
|
93
105
|
enableMultiCellRangeSelection?: boolean;
|
|
94
106
|
/**
|
|
@@ -100,8 +112,8 @@ interface TableOptions_CellSelection<in out TFeatures extends TableFeatures, in
|
|
|
100
112
|
*/
|
|
101
113
|
isCellRangeSelectionEvent?: (event: unknown) => boolean;
|
|
102
114
|
/**
|
|
103
|
-
* Determines whether a selection-start event should add a new
|
|
104
|
-
*
|
|
115
|
+
* Determines whether a selection-start event should add or subtract a new
|
|
116
|
+
* rectangle. The operation depends on whether the starting cell is selected.
|
|
105
117
|
*
|
|
106
118
|
* By default, events with `ctrlKey` or `metaKey` directly on the event or on
|
|
107
119
|
* `event.nativeEvent` are treated as multi-range events.
|
|
@@ -134,7 +146,7 @@ interface Cell_CellSelection {
|
|
|
134
146
|
*/
|
|
135
147
|
getIsFocused: () => boolean;
|
|
136
148
|
/**
|
|
137
|
-
* Checks whether this cell falls inside
|
|
149
|
+
* Checks whether this cell falls inside the final positive selection.
|
|
138
150
|
*/
|
|
139
151
|
getIsSelected: () => boolean;
|
|
140
152
|
/**
|
|
@@ -192,7 +204,8 @@ interface Table_CellSelection<in out TFeatures extends TableFeatures, in out TDa
|
|
|
192
204
|
*/
|
|
193
205
|
extendCellSelection: (direction: CellSelectionDirection) => void;
|
|
194
206
|
/**
|
|
195
|
-
* Returns the
|
|
207
|
+
* Returns the final positive selection as disjoint, inclusive display-order
|
|
208
|
+
* index rectangles after all include and exclude operations are applied.
|
|
196
209
|
*
|
|
197
210
|
* This is the memoized cache every per-cell read goes through. Ranges whose
|
|
198
211
|
* corners no longer resolve are omitted.
|
|
@@ -216,14 +229,15 @@ interface Table_CellSelection<in out TFeatures extends TableFeatures, in out TDa
|
|
|
216
229
|
*/
|
|
217
230
|
getCellSelectionRowIds: () => Array<string>;
|
|
218
231
|
/**
|
|
219
|
-
* Returns the active cell, i.e. the anchor of the most recent
|
|
232
|
+
* Returns the active cell, i.e. the anchor of the most recent operation.
|
|
233
|
+
* An exclusion's active cell is focused even though it is not selected.
|
|
220
234
|
*/
|
|
221
235
|
getFocusedCell: () => Cell<TFeatures, TData, any> | undefined;
|
|
222
236
|
/**
|
|
223
237
|
* Returns the number of selected cells.
|
|
224
238
|
*
|
|
225
|
-
* Computed
|
|
226
|
-
*
|
|
239
|
+
* Computed with rectangle arithmetic unless a per-cell
|
|
240
|
+
* `enableCellSelection` predicate requires enumeration.
|
|
227
241
|
*/
|
|
228
242
|
getSelectedCellCount: () => number;
|
|
229
243
|
/**
|
|
@@ -234,9 +248,9 @@ interface Table_CellSelection<in out TFeatures extends TableFeatures, in out TDa
|
|
|
234
248
|
*/
|
|
235
249
|
getSelectedCellIds: () => Array<string>;
|
|
236
250
|
/**
|
|
237
|
-
* Returns each
|
|
251
|
+
* Returns each final positive selection region's values as a row-major grid.
|
|
238
252
|
*
|
|
239
|
-
* Indexed as `[
|
|
253
|
+
* Indexed as `[regionIndex][rowIndex][columnIndex]`. Serializing this to
|
|
240
254
|
* clipboard text is left to userland, since the delimiter, the null
|
|
241
255
|
* representation, and any quoting rules are application decisions.
|
|
242
256
|
*/
|
|
@@ -257,7 +271,7 @@ interface Table_CellSelection<in out TFeatures extends TableFeatures, in out TDa
|
|
|
257
271
|
*/
|
|
258
272
|
selectAllCells: () => void;
|
|
259
273
|
/**
|
|
260
|
-
* Selects a rectangle
|
|
274
|
+
* Selects a rectangle using the requested replace/include/exclude mode.
|
|
261
275
|
*/
|
|
262
276
|
selectCellRange: (range: CellSelectionRange, opts?: SelectCellRangeOptions) => void;
|
|
263
277
|
/**
|
|
@@ -270,4 +284,4 @@ interface Table_CellSelection<in out TFeatures extends TableFeatures, in out TDa
|
|
|
270
284
|
setFocusedCell: (rowId: string, columnId: string) => void;
|
|
271
285
|
}
|
|
272
286
|
//#endregion
|
|
273
|
-
export { CellSelectionBounds, CellSelectionDirection, CellSelectionEdges, CellSelectionRange, CellSelectionState, Cell_CellSelection, ColumnDef_CellSelection, SelectCellRangeOptions, TableOptions_CellSelection, TableState_CellSelection, Table_CellSelection };
|
|
287
|
+
export { CellSelectionBounds, CellSelectionDirection, CellSelectionEdges, CellSelectionRange, CellSelectionRangeMode, CellSelectionRangeOperation, CellSelectionState, Cell_CellSelection, ColumnDef_CellSelection, SelectCellRangeOptions, TableOptions_CellSelection, TableState_CellSelection, Table_CellSelection };
|
|
@@ -3,7 +3,6 @@ import { CellSelectionBounds, CellSelectionDirection, CellSelectionEdges, CellSe
|
|
|
3
3
|
import { Table } from "../../types/Table.js";
|
|
4
4
|
import { Cell } from "../../types/Cell.js";
|
|
5
5
|
import { TableFeatures } from "../../types/TableFeatures.js";
|
|
6
|
-
|
|
7
6
|
//#region src/features/cell-selection/cellSelectionFeature.utils.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Creates the default cell selection state.
|
|
@@ -70,7 +69,8 @@ declare function table_autoResetCellSelection<TFeatures extends TableFeatures, T
|
|
|
70
69
|
*/
|
|
71
70
|
declare function table_getCellSelectionColumnIndexes<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>): Record<string, number>;
|
|
72
71
|
/**
|
|
73
|
-
* Resolves
|
|
72
|
+
* Resolves ordered range operations into disjoint, positive display-order
|
|
73
|
+
* index rectangles.
|
|
74
74
|
*
|
|
75
75
|
* This is the single cache every per-cell read goes through, so index lookups
|
|
76
76
|
* happen once per invalidation rather than once per cell. A range whose corners
|
|
@@ -97,7 +97,7 @@ declare function table_getCellSelectionBounds<TFeatures extends TableFeatures, T
|
|
|
97
97
|
*/
|
|
98
98
|
declare function cell_getCanSelect<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(cell: Cell<TFeatures, TData, TValue>): boolean;
|
|
99
99
|
/**
|
|
100
|
-
* Checks whether this cell falls inside
|
|
100
|
+
* Checks whether this cell falls inside the final positive selection.
|
|
101
101
|
*
|
|
102
102
|
* Deliberately not memoized. Registering this through `assignPrototypeAPIs`
|
|
103
103
|
* with `memoDeps` would allocate a memo closure and dependency array per cell,
|
|
@@ -141,7 +141,7 @@ declare function cell_getTabIndex<TFeatures extends TableFeatures, TData extends
|
|
|
141
141
|
*/
|
|
142
142
|
declare function cell_getSelectionEdges<TFeatures extends TableFeatures, TData extends RowData, TValue extends CellData = CellData>(cell: Cell<TFeatures, TData, TValue>): CellSelectionEdges;
|
|
143
143
|
/**
|
|
144
|
-
* Returns the active cell, i.e. the anchor of the most recent
|
|
144
|
+
* Returns the active cell, i.e. the anchor of the most recent operation.
|
|
145
145
|
*
|
|
146
146
|
* Focus is derived rather than stored: in spreadsheet semantics, dragging from
|
|
147
147
|
* A1 to C5 leaves the active cell at A1, so the active range's anchor already
|
|
@@ -163,11 +163,11 @@ declare function table_getFocusedCell<TFeatures extends TableFeatures, TData ext
|
|
|
163
163
|
*/
|
|
164
164
|
declare function table_setFocusedCell<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>, rowId: string, columnId: string): void;
|
|
165
165
|
/**
|
|
166
|
-
* Selects a rectangle
|
|
166
|
+
* Selects a rectangle using replace, include, or exclude semantics.
|
|
167
167
|
*
|
|
168
168
|
* @example
|
|
169
169
|
* ```ts
|
|
170
|
-
* table_selectCellRange(table, range, {
|
|
170
|
+
* table_selectCellRange(table, range, { mode: 'exclude' })
|
|
171
171
|
* ```
|
|
172
172
|
*/
|
|
173
173
|
declare function table_selectCellRange<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>, range: CellSelectionRange, opts?: SelectCellRangeOptions): void;
|
|
@@ -214,7 +214,7 @@ declare function table_extendCellSelection<TFeatures extends TableFeatures, TDat
|
|
|
214
214
|
*/
|
|
215
215
|
declare function table_getSelectedCellIds<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData>): Array<string>;
|
|
216
216
|
/**
|
|
217
|
-
* Returns each
|
|
217
|
+
* Returns each final positive region's values as a row-major grid.
|
|
218
218
|
*
|
|
219
219
|
* This is the raw material for clipboard export. Serializing it to text is left
|
|
220
220
|
* to userland, since the delimiter, the null representation, and whether values
|
|
@@ -229,9 +229,8 @@ declare function table_getSelectedCellRangesData<TFeatures extends TableFeatures
|
|
|
229
229
|
/**
|
|
230
230
|
* Returns the number of selected cells.
|
|
231
231
|
*
|
|
232
|
-
* Uses rectangle arithmetic
|
|
233
|
-
*
|
|
234
|
-
* per-cell `enableCellSelection` predicate also requires enumeration.
|
|
232
|
+
* Uses rectangle arithmetic over the normalized, disjoint positive regions.
|
|
233
|
+
* A per-cell `enableCellSelection` predicate requires enumeration.
|
|
235
234
|
*
|
|
236
235
|
* @example
|
|
237
236
|
* ```ts
|