@tanstack/table-core 8.0.0-alpha.83 → 8.0.0-alpha.84
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/build/cjs/core/cell.js +38 -0
- package/build/cjs/core/cell.js.map +1 -0
- package/build/cjs/core/column.js +88 -0
- package/build/cjs/core/column.js.map +1 -0
- package/build/cjs/{features/Headers.js → core/headers.js} +54 -66
- package/build/cjs/core/headers.js.map +1 -0
- package/build/cjs/core/instance.js +255 -0
- package/build/cjs/core/instance.js.map +1 -0
- package/build/cjs/core/row.js +77 -0
- package/build/cjs/core/row.js.map +1 -0
- package/build/cjs/features/ColumnSizing.js.map +1 -1
- package/build/cjs/features/Expanding.js.map +1 -1
- package/build/cjs/features/Filters.js +1 -1
- package/build/cjs/features/Filters.js.map +1 -1
- package/build/cjs/features/Grouping.js.map +1 -1
- package/build/cjs/features/Ordering.js.map +1 -1
- package/build/cjs/features/Pagination.js.map +1 -1
- package/build/cjs/features/Pinning.js +3 -3
- package/build/cjs/features/Pinning.js.map +1 -1
- package/build/cjs/features/RowSelection.js.map +1 -1
- package/build/cjs/features/Sorting.js.map +1 -1
- package/build/cjs/features/Visibility.js.map +1 -1
- package/build/cjs/index.js +9 -5
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/utils/filterRowsUtils.js +23 -21
- package/build/cjs/utils/filterRowsUtils.js.map +1 -1
- package/build/cjs/utils/getCoreRowModel.js +9 -8
- package/build/cjs/utils/getCoreRowModel.js.map +1 -1
- package/build/cjs/utils/getGroupedRowModel.js +12 -11
- package/build/cjs/utils/getGroupedRowModel.js.map +1 -1
- package/build/esm/index.js +656 -761
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +391 -368
- package/build/types/core/cell.d.ts +9 -0
- package/build/types/{features/Columns.d.ts → core/column.d.ts} +3 -17
- package/build/types/{features/Headers.d.ts → core/headers.d.ts} +26 -11
- package/build/types/core/instance.d.ts +57 -0
- package/build/types/core/row.d.ts +15 -0
- package/build/types/features/ColumnSizing.d.ts +2 -1
- package/build/types/features/Expanding.d.ts +2 -1
- package/build/types/features/Filters.d.ts +2 -1
- package/build/types/features/Grouping.d.ts +2 -1
- package/build/types/features/Ordering.d.ts +2 -1
- package/build/types/features/Pagination.d.ts +2 -1
- package/build/types/features/Pinning.d.ts +2 -1
- package/build/types/features/RowSelection.d.ts +2 -1
- package/build/types/features/Sorting.d.ts +2 -1
- package/build/types/features/Visibility.d.ts +2 -1
- package/build/types/index.d.ts +4 -2
- package/build/types/sortingFns.d.ts +4 -4
- package/build/types/types.d.ts +10 -53
- package/build/umd/index.development.js +660 -759
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/core/cell.ts +47 -0
- package/src/core/column.ts +148 -0
- package/src/{features/Headers.ts → core/headers.ts} +98 -99
- package/src/core/instance.ts +361 -0
- package/src/core/row.ts +85 -0
- package/src/features/ColumnSizing.ts +1 -1
- package/src/features/Expanding.ts +1 -2
- package/src/features/Filters.ts +2 -2
- package/src/features/Grouping.ts +1 -1
- package/src/features/Ordering.ts +1 -1
- package/src/features/Pagination.ts +1 -1
- package/src/features/Pinning.ts +8 -4
- package/src/features/RowSelection.ts +1 -1
- package/src/features/Sorting.ts +1 -1
- package/src/features/Visibility.ts +1 -1
- package/src/index.ts +4 -8
- package/src/types.ts +9 -61
- package/src/utils/filterRowsUtils.ts +4 -2
- package/src/utils/getCoreRowModel.ts +4 -2
- package/src/utils/getGroupedRowModel.ts +6 -6
- package/build/cjs/core.js +0 -168
- package/build/cjs/core.js.map +0 -1
- package/build/cjs/features/Cells.js +0 -101
- package/build/cjs/features/Cells.js.map +0 -1
- package/build/cjs/features/Columns.js +0 -191
- package/build/cjs/features/Columns.js.map +0 -1
- package/build/cjs/features/Headers.js.map +0 -1
- package/build/cjs/features/Rows.js +0 -94
- package/build/cjs/features/Rows.js.map +0 -1
- package/build/types/core.d.ts +0 -30
- package/build/types/features/Cells.d.ts +0 -13
- package/build/types/features/Rows.d.ts +0 -28
- package/src/core.ts +0 -246
- package/src/features/Cells.ts +0 -128
- package/src/features/Columns.ts +0 -293
- package/src/features/Rows.ts +0 -142
package/src/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CoreOptions, CoreTableState, CoreInstance } from './core'
|
|
2
|
-
import {
|
|
1
|
+
import { CoreOptions, CoreTableState, CoreInstance } from './core/instance'
|
|
2
|
+
import { CoreColumn, CoreColumnDef } from './core/column'
|
|
3
3
|
import {
|
|
4
4
|
VisibilityInstance,
|
|
5
5
|
VisibilityTableState,
|
|
@@ -18,11 +18,10 @@ import {
|
|
|
18
18
|
ColumnPinningColumnDef,
|
|
19
19
|
ColumnPinningInstance,
|
|
20
20
|
ColumnPinningOptions,
|
|
21
|
-
ColumnPinningPosition,
|
|
22
21
|
ColumnPinningRow,
|
|
23
22
|
ColumnPinningTableState,
|
|
24
23
|
} from './features/Pinning'
|
|
25
|
-
import { HeadersInstance } from './
|
|
24
|
+
import { CoreHeader, CoreHeaderGroup, HeadersInstance } from './core/headers'
|
|
26
25
|
import {
|
|
27
26
|
FiltersColumn,
|
|
28
27
|
FiltersColumnDef,
|
|
@@ -53,7 +52,6 @@ import {
|
|
|
53
52
|
ExpandedTableState,
|
|
54
53
|
ExpandedRow,
|
|
55
54
|
} from './features/Expanding'
|
|
56
|
-
import { Overwrite, PartialKeys } from './utils'
|
|
57
55
|
import {
|
|
58
56
|
ColumnSizingColumn,
|
|
59
57
|
ColumnSizingColumnDef,
|
|
@@ -74,9 +72,9 @@ import {
|
|
|
74
72
|
RowSelectionRow,
|
|
75
73
|
RowSelectionTableState,
|
|
76
74
|
} from './features/RowSelection'
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
75
|
+
import { CoreRow } from './core/row'
|
|
76
|
+
import { PartialKeys } from './utils'
|
|
77
|
+
import { CoreCell } from './core/cell'
|
|
80
78
|
|
|
81
79
|
export type Updater<T> = T | ((old: T) => T)
|
|
82
80
|
export type OnChangeFn<T> = (updaterOrValue: Updater<T>) => void
|
|
@@ -96,26 +94,12 @@ export type TableGenerics = {
|
|
|
96
94
|
|
|
97
95
|
export type AnyRender = (Comp: any, props: any) => any
|
|
98
96
|
|
|
99
|
-
export type TableFeature = {
|
|
100
|
-
getDefaultOptions?: (instance: any) => any
|
|
101
|
-
getInitialState?: (initialState?: InitialTableState) => any
|
|
102
|
-
createInstance?: (instance: any) => any
|
|
103
|
-
getDefaultColumnDef?: () => any
|
|
104
|
-
createColumn?: (column: any, instance: any) => any
|
|
105
|
-
createHeader?: (column: any, instance: any) => any
|
|
106
|
-
createCell?: (cell: any, column: any, row: any, instance: any) => any
|
|
107
|
-
createRow?: (row: any, instance: any) => any
|
|
108
|
-
}
|
|
109
|
-
|
|
110
97
|
export type TableInstance<TGenerics extends TableGenerics> =
|
|
111
98
|
CoreInstance<TGenerics> &
|
|
112
|
-
|
|
113
|
-
RowsInstance<TGenerics> &
|
|
114
|
-
CellsInstance<TGenerics> &
|
|
99
|
+
HeadersInstance<TGenerics> &
|
|
115
100
|
VisibilityInstance<TGenerics> &
|
|
116
101
|
ColumnOrderInstance<TGenerics> &
|
|
117
102
|
ColumnPinningInstance<TGenerics> &
|
|
118
|
-
HeadersInstance<TGenerics> &
|
|
119
103
|
FiltersInstance<TGenerics> &
|
|
120
104
|
SortingInstance<TGenerics> &
|
|
121
105
|
GroupingInstance<TGenerics> &
|
|
@@ -126,8 +110,6 @@ export type TableInstance<TGenerics extends TableGenerics> =
|
|
|
126
110
|
|
|
127
111
|
export type TableOptionsResolved<TGenerics extends TableGenerics> =
|
|
128
112
|
CoreOptions<TGenerics> &
|
|
129
|
-
ColumnsOptions<TGenerics> &
|
|
130
|
-
RowsOptions<TGenerics> &
|
|
131
113
|
VisibilityOptions &
|
|
132
114
|
ColumnOrderOptions &
|
|
133
115
|
ColumnPinningOptions &
|
|
@@ -171,7 +153,6 @@ export type InitialTableState = Partial<
|
|
|
171
153
|
>
|
|
172
154
|
|
|
173
155
|
export type Row<TGenerics extends TableGenerics> = CoreRow<TGenerics> &
|
|
174
|
-
CellsRow<TGenerics> &
|
|
175
156
|
VisibilityRow<TGenerics> &
|
|
176
157
|
ColumnPinningRow<TGenerics> &
|
|
177
158
|
FiltersRow<TGenerics> &
|
|
@@ -215,43 +196,10 @@ export type Column<TGenerics extends TableGenerics> = CoreColumn<TGenerics> &
|
|
|
215
196
|
export type Cell<TGenerics extends TableGenerics> = CoreCell<TGenerics> &
|
|
216
197
|
GroupingCell<TGenerics>
|
|
217
198
|
|
|
218
|
-
export type CoreCell<TGenerics extends TableGenerics> = {
|
|
219
|
-
id: string
|
|
220
|
-
rowId: string
|
|
221
|
-
columnId: string
|
|
222
|
-
getValue: () => TGenerics['Value']
|
|
223
|
-
row: Row<TGenerics>
|
|
224
|
-
column: Column<TGenerics>
|
|
225
|
-
renderCell: () => string | null | TGenerics['Rendered']
|
|
226
|
-
}
|
|
227
|
-
|
|
228
199
|
export type Header<TGenerics extends TableGenerics> = CoreHeader<TGenerics> &
|
|
229
200
|
ColumnSizingHeader<TGenerics>
|
|
230
201
|
|
|
231
|
-
export type
|
|
232
|
-
|
|
233
|
-
index: number
|
|
234
|
-
depth: number
|
|
235
|
-
column: Column<TGenerics>
|
|
236
|
-
headerGroup: HeaderGroup<TGenerics>
|
|
237
|
-
subHeaders: Header<TGenerics>[]
|
|
238
|
-
colSpan?: number
|
|
239
|
-
rowSpan?: number
|
|
240
|
-
getLeafHeaders: () => Header<TGenerics>[]
|
|
241
|
-
isPlaceholder?: boolean
|
|
242
|
-
placeholderId?: string
|
|
243
|
-
renderHeader: (options?: {
|
|
244
|
-
renderPlaceholder?: boolean
|
|
245
|
-
}) => string | null | TGenerics['Rendered']
|
|
246
|
-
renderFooter: (options?: {
|
|
247
|
-
renderPlaceholder?: boolean
|
|
248
|
-
}) => string | null | TGenerics['Rendered']
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
export type HeaderGroup<TGenerics extends TableGenerics> = {
|
|
252
|
-
id: string
|
|
253
|
-
depth: number
|
|
254
|
-
headers: Header<TGenerics>[]
|
|
255
|
-
}
|
|
202
|
+
export type HeaderGroup<TGenerics extends TableGenerics> =
|
|
203
|
+
CoreHeaderGroup<TGenerics>
|
|
256
204
|
|
|
257
205
|
export type NoInfer<A extends any> = [A][A extends any ? 0 : never]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRow } from '../core/row'
|
|
1
2
|
import { TableGenerics, Row, RowModel, TableInstance } from '../types'
|
|
2
3
|
|
|
3
4
|
export function filterRows<TGenerics extends TableGenerics>(
|
|
@@ -31,7 +32,7 @@ export function filterRowModelFromLeafs<TGenerics extends TableGenerics>(
|
|
|
31
32
|
row = rowsToFilter[i]!
|
|
32
33
|
|
|
33
34
|
if (row.subRows?.length) {
|
|
34
|
-
newRow =
|
|
35
|
+
newRow = createRow(instance, row.id, row.original, row.index, row.depth)
|
|
35
36
|
newRow.columnFilters = row.columnFilters
|
|
36
37
|
newRow.subRows = recurseFilterRows(row.subRows, depth + 1)
|
|
37
38
|
if (!newRow.subRows.length) {
|
|
@@ -83,7 +84,8 @@ export function filterRowModelFromRoot<TGenerics extends TableGenerics>(
|
|
|
83
84
|
|
|
84
85
|
if (pass) {
|
|
85
86
|
if (row.subRows?.length) {
|
|
86
|
-
newRow =
|
|
87
|
+
newRow = createRow(
|
|
88
|
+
instance,
|
|
87
89
|
row.id,
|
|
88
90
|
row.original,
|
|
89
91
|
row.index,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRow } from '../core/row'
|
|
1
2
|
import { TableInstance, Row, RowModel, TableGenerics } from '../types'
|
|
2
3
|
import { memo } from '../utils'
|
|
3
4
|
|
|
@@ -42,8 +43,9 @@ export function getCoreRowModel<TGenerics extends TableGenerics>(): (
|
|
|
42
43
|
// }
|
|
43
44
|
|
|
44
45
|
// Make the row
|
|
45
|
-
row =
|
|
46
|
-
instance
|
|
46
|
+
row = createRow(
|
|
47
|
+
instance,
|
|
48
|
+
instance._getRowId(originalRow, i, parent),
|
|
47
49
|
originalRow,
|
|
48
50
|
i,
|
|
49
51
|
depth
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createRow } from '../core/row'
|
|
2
2
|
import { TableInstance, Row, RowModel, TableGenerics } from '../types'
|
|
3
3
|
import { flattenBy, memo } from '../utils'
|
|
4
4
|
|
|
@@ -55,7 +55,7 @@ export function getGroupedRowModel<TGenerics extends TableGenerics>(): (
|
|
|
55
55
|
? flattenBy(groupedRows, row => row.subRows)
|
|
56
56
|
: groupedRows
|
|
57
57
|
|
|
58
|
-
const row =
|
|
58
|
+
const row = createRow(instance, id, undefined, index, depth)
|
|
59
59
|
|
|
60
60
|
Object.assign(row, {
|
|
61
61
|
groupingColumnId: columnId,
|
|
@@ -65,16 +65,16 @@ export function getGroupedRowModel<TGenerics extends TableGenerics>(): (
|
|
|
65
65
|
getValue: (columnId: string) => {
|
|
66
66
|
// Don't aggregate columns that are in the grouping
|
|
67
67
|
if (existingGrouping.includes(columnId)) {
|
|
68
|
-
if (row.
|
|
69
|
-
return row.
|
|
68
|
+
if (row._valuesCache.hasOwnProperty(columnId)) {
|
|
69
|
+
return row._valuesCache[columnId]
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
if (groupedRows[0]) {
|
|
73
|
-
row.
|
|
73
|
+
row._valuesCache[columnId] =
|
|
74
74
|
groupedRows[0].getValue(columnId) ?? undefined
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
return row.
|
|
77
|
+
return row._valuesCache[columnId]
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
if (row.groupingValuesCache.hasOwnProperty(columnId)) {
|
package/build/cjs/core.js
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* table-core
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) TanStack
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
-
*
|
|
9
|
-
* @license MIT
|
|
10
|
-
*/
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14
|
-
|
|
15
|
-
var utils = require('./utils.js');
|
|
16
|
-
var Columns = require('./features/Columns.js');
|
|
17
|
-
var Rows = require('./features/Rows.js');
|
|
18
|
-
var Cells = require('./features/Cells.js');
|
|
19
|
-
var ColumnSizing = require('./features/ColumnSizing.js');
|
|
20
|
-
var Expanding = require('./features/Expanding.js');
|
|
21
|
-
var Filters = require('./features/Filters.js');
|
|
22
|
-
var Grouping = require('./features/Grouping.js');
|
|
23
|
-
var Ordering = require('./features/Ordering.js');
|
|
24
|
-
var Pagination = require('./features/Pagination.js');
|
|
25
|
-
var Pinning = require('./features/Pinning.js');
|
|
26
|
-
var RowSelection = require('./features/RowSelection.js');
|
|
27
|
-
var Sorting = require('./features/Sorting.js');
|
|
28
|
-
var Visibility = require('./features/Visibility.js');
|
|
29
|
-
var Headers = require('./features/Headers.js');
|
|
30
|
-
|
|
31
|
-
// export type Batch = {
|
|
32
|
-
// id: number
|
|
33
|
-
// priority: keyof CoreBatches
|
|
34
|
-
// tasks: (() => void)[]
|
|
35
|
-
// schedule: (cb: () => void) => void
|
|
36
|
-
// cancel: () => void
|
|
37
|
-
// }
|
|
38
|
-
// type CoreBatches = {
|
|
39
|
-
// data: Batch[]
|
|
40
|
-
// facets: Batch[]
|
|
41
|
-
// }
|
|
42
|
-
function createTableInstance(options) {
|
|
43
|
-
var _options$initialState;
|
|
44
|
-
|
|
45
|
-
if (options.debugAll || options.debugTable) {
|
|
46
|
-
console.info('Creating Table Instance...');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
let instance = {
|
|
50
|
-
_features: [Columns.Columns, Rows.Rows, Cells.Cells, Headers.Headers, Visibility.Visibility, Ordering.Ordering, Pinning.Pinning, Filters.Filters, Sorting.Sorting, Grouping.Grouping, Expanding.Expanding, Pagination.Pagination, RowSelection.RowSelection, ColumnSizing.ColumnSizing]
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const defaultOptions = instance._features.reduce((obj, feature) => {
|
|
54
|
-
return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(instance));
|
|
55
|
-
}, {});
|
|
56
|
-
|
|
57
|
-
const mergeOptions = options => {
|
|
58
|
-
if (instance.options.mergeOptions) {
|
|
59
|
-
return instance.options.mergeOptions(defaultOptions, options);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return { ...defaultOptions,
|
|
63
|
-
...options
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const coreInitialState = {// coreProgress: 1,
|
|
68
|
-
};
|
|
69
|
-
let initialState = { ...coreInitialState,
|
|
70
|
-
...((_options$initialState = options.initialState) != null ? _options$initialState : {})
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
instance._features.forEach(feature => {
|
|
74
|
-
var _feature$getInitialSt;
|
|
75
|
-
|
|
76
|
-
initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
const queued = [];
|
|
80
|
-
let queuedTimeout = false;
|
|
81
|
-
const midInstance = { ...instance,
|
|
82
|
-
// init: () => {
|
|
83
|
-
// startWork()
|
|
84
|
-
// },
|
|
85
|
-
// willUpdate: () => {
|
|
86
|
-
// startWork()
|
|
87
|
-
// },
|
|
88
|
-
// destroy: () => {
|
|
89
|
-
// stopWork()
|
|
90
|
-
// },
|
|
91
|
-
options: { ...defaultOptions,
|
|
92
|
-
...options
|
|
93
|
-
},
|
|
94
|
-
initialState,
|
|
95
|
-
_queue: cb => {
|
|
96
|
-
queued.push(cb);
|
|
97
|
-
|
|
98
|
-
if (!queuedTimeout) {
|
|
99
|
-
queuedTimeout = true; // Schedule a microtask to run the queued callbacks after
|
|
100
|
-
// the current call stack (render, etc) has finished.
|
|
101
|
-
|
|
102
|
-
Promise.resolve().then(() => {
|
|
103
|
-
while (queued.length) {
|
|
104
|
-
queued.shift()();
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
queuedTimeout = false;
|
|
108
|
-
}).catch(error => setTimeout(() => {
|
|
109
|
-
throw error;
|
|
110
|
-
}));
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
reset: () => {
|
|
114
|
-
instance.setState(instance.initialState);
|
|
115
|
-
},
|
|
116
|
-
setOptions: updater => {
|
|
117
|
-
const newOptions = utils.functionalUpdate(updater, instance.options);
|
|
118
|
-
instance.options = mergeOptions(newOptions);
|
|
119
|
-
},
|
|
120
|
-
_render: (template, props) => {
|
|
121
|
-
if (typeof instance.options.render === 'function') {
|
|
122
|
-
return instance.options.render(template, props);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (typeof template === 'function') {
|
|
126
|
-
return template(props);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return template;
|
|
130
|
-
},
|
|
131
|
-
getState: () => {
|
|
132
|
-
return instance.options.state;
|
|
133
|
-
},
|
|
134
|
-
setState: updater => {
|
|
135
|
-
instance.options.onStateChange == null ? void 0 : instance.options.onStateChange(updater);
|
|
136
|
-
} // getOverallProgress: () => {
|
|
137
|
-
// const { coreProgress, filtersProgress, facetProgress } =
|
|
138
|
-
// instance.getState()
|
|
139
|
-
// return mean(() =>
|
|
140
|
-
// [coreProgress, filtersProgress].filter(d => d < 1)
|
|
141
|
-
// ) as number
|
|
142
|
-
// },
|
|
143
|
-
// getProgressStage: () => {
|
|
144
|
-
// const { coreProgress, filtersProgress, facetProgress } =
|
|
145
|
-
// instance.getState()
|
|
146
|
-
// if (coreProgress < 1) {
|
|
147
|
-
// return 'coreRowModel'
|
|
148
|
-
// }
|
|
149
|
-
// if (filtersProgress < 1) {
|
|
150
|
-
// return 'filteredRowModel'
|
|
151
|
-
// }
|
|
152
|
-
// if (Object.values(facetProgress).some(d => d < 1)) {
|
|
153
|
-
// return 'facetedRowModel'
|
|
154
|
-
// }
|
|
155
|
-
// },
|
|
156
|
-
|
|
157
|
-
};
|
|
158
|
-
instance = Object.assign(instance, midInstance);
|
|
159
|
-
|
|
160
|
-
instance._features.forEach(feature => {
|
|
161
|
-
return Object.assign(instance, feature.createInstance == null ? void 0 : feature.createInstance(instance));
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
return instance;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
exports.createTableInstance = createTableInstance;
|
|
168
|
-
//# sourceMappingURL=core.js.map
|
package/build/cjs/core.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sources":["../../src/core.ts"],"sourcesContent":["import { functionalUpdate, RequiredKeys } from './utils'\n\nimport {\n Updater,\n TableOptionsResolved,\n TableState,\n TableInstance,\n Renderable,\n TableFeature,\n TableGenerics,\n InitialTableState,\n} from './types'\n\nimport { Columns } from './features/Columns'\nimport { Rows } from './features/Rows'\nimport { Cells } from './features/Cells'\nimport { ColumnSizing } from './features/ColumnSizing'\nimport { Expanding } from './features/Expanding'\nimport { Filters } from './features/Filters'\nimport { Grouping } from './features/Grouping'\nimport { Ordering } from './features/Ordering'\nimport { Pagination } from './features/Pagination'\nimport { Pinning } from './features/Pinning'\nimport { RowSelection } from './features/RowSelection'\nimport { Sorting } from './features/Sorting'\nimport { Visibility } from './features/Visibility'\nimport { Headers } from './features/Headers'\n//\n\nexport type CoreTableState = {\n // coreProgress: number\n}\n\nexport type CoreOptions<TGenerics extends TableGenerics> = {\n data: TGenerics['Row'][]\n state: Partial<TableState>\n onStateChange: (updater: Updater<TableState>) => void\n render: TGenerics['Renderer']\n debugAll?: boolean\n debugTable?: boolean\n debugHeaders?: boolean\n debugColumns?: boolean\n debugRows?: boolean\n initialState?: InitialTableState\n autoResetAll?: boolean\n mergeOptions?: <T>(defaultOptions: T, options: Partial<T>) => T\n meta?: TGenerics['TableMeta']\n // keepPreviousData?: boolean\n}\n\nexport type CoreInstance<TGenerics extends TableGenerics> = {\n // generics: TGenerics\n initialState: TableState\n reset: () => void\n options: RequiredKeys<TableOptionsResolved<TGenerics>, 'state'>\n setOptions: (newOptions: Updater<TableOptionsResolved<TGenerics>>) => void\n getState: () => TableState\n setState: (updater: Updater<TableState>) => void\n _queue: (cb: () => void) => void\n _render: <TProps>(\n template: Renderable<TGenerics, TProps>,\n props: TProps\n ) => string | null | TGenerics['Rendered']\n _features: readonly TableFeature[]\n // getOverallProgress: () => number\n // getProgressStage: () =>\n // | undefined\n // | 'coreRowModel'\n // | 'filteredRowModel'\n // | 'facetedRowModel'\n // createBatch: (priority: keyof CoreBatches) => Batch\n // init: () => void\n // willUpdate: () => void\n // destroy: () => void\n // batches: CoreBatches\n}\n\n// export type Batch = {\n// id: number\n// priority: keyof CoreBatches\n// tasks: (() => void)[]\n// schedule: (cb: () => void) => void\n// cancel: () => void\n// }\n\n// type CoreBatches = {\n// data: Batch[]\n// facets: Batch[]\n// }\n\nexport function createTableInstance<TGenerics extends TableGenerics>(\n options: TableOptionsResolved<TGenerics>\n): TableInstance<TGenerics> {\n if (options.debugAll || options.debugTable) {\n console.info('Creating Table Instance...')\n }\n\n let instance = {\n _features: [\n Columns,\n Rows,\n Cells,\n Headers,\n Visibility,\n Ordering,\n Pinning,\n Filters,\n Sorting,\n Grouping,\n Expanding,\n Pagination,\n RowSelection,\n ColumnSizing,\n ] as const,\n } as unknown as CoreInstance<TGenerics>\n\n const defaultOptions = instance._features.reduce((obj, feature) => {\n return Object.assign(obj, feature.getDefaultOptions?.(instance))\n }, {}) as TableOptionsResolved<TGenerics>\n\n const mergeOptions = (options: TableOptionsResolved<TGenerics>) => {\n if (instance.options.mergeOptions) {\n return instance.options.mergeOptions(defaultOptions, options)\n }\n\n return {\n ...defaultOptions,\n ...options,\n }\n }\n\n const coreInitialState: CoreTableState = {\n // coreProgress: 1,\n }\n\n let initialState = {\n ...coreInitialState,\n ...(options.initialState ?? {}),\n } as TableState\n\n instance._features.forEach(feature => {\n initialState = feature.getInitialState?.(initialState) ?? initialState\n })\n\n const queued: (() => void)[] = []\n let queuedTimeout = false\n\n const midInstance: CoreInstance<TGenerics> = {\n ...instance,\n // init: () => {\n // startWork()\n // },\n // willUpdate: () => {\n // startWork()\n // },\n // destroy: () => {\n // stopWork()\n // },\n options: {\n ...defaultOptions,\n ...options,\n },\n initialState,\n _queue: cb => {\n queued.push(cb)\n\n if (!queuedTimeout) {\n queuedTimeout = true\n\n // Schedule a microtask to run the queued callbacks after\n // the current call stack (render, etc) has finished.\n Promise.resolve()\n .then(() => {\n while (queued.length) {\n queued.shift()!()\n }\n queuedTimeout = false\n })\n .catch(error =>\n setTimeout(() => {\n throw error\n })\n )\n }\n },\n reset: () => {\n instance.setState(instance.initialState)\n },\n setOptions: updater => {\n const newOptions = functionalUpdate(updater, instance.options)\n instance.options = mergeOptions(newOptions)\n },\n _render: (template, props) => {\n if (typeof instance.options.render === 'function') {\n return instance.options.render(template, props)\n }\n\n if (typeof template === 'function') {\n return (template as Function)(props)\n }\n\n return template\n },\n\n getState: () => {\n return instance.options.state as TableState\n },\n\n setState: (updater: Updater<TableState>) => {\n instance.options.onStateChange?.(updater)\n },\n\n // getOverallProgress: () => {\n // const { coreProgress, filtersProgress, facetProgress } =\n // instance.getState()\n\n // return mean(() =>\n // [coreProgress, filtersProgress].filter(d => d < 1)\n // ) as number\n // },\n // getProgressStage: () => {\n // const { coreProgress, filtersProgress, facetProgress } =\n // instance.getState()\n\n // if (coreProgress < 1) {\n // return 'coreRowModel'\n // }\n\n // if (filtersProgress < 1) {\n // return 'filteredRowModel'\n // }\n\n // if (Object.values(facetProgress).some(d => d < 1)) {\n // return 'facetedRowModel'\n // }\n // },\n }\n\n instance = Object.assign(instance, midInstance)\n\n instance._features.forEach(feature => {\n return Object.assign(instance, feature.createInstance?.(instance))\n })\n\n return instance as TableInstance<TGenerics>\n}\n"],"names":["createTableInstance","options","debugAll","debugTable","console","info","instance","_features","Columns","Rows","Cells","Headers","Visibility","Ordering","Pinning","Filters","Sorting","Grouping","Expanding","Pagination","RowSelection","ColumnSizing","defaultOptions","reduce","obj","feature","Object","assign","getDefaultOptions","mergeOptions","coreInitialState","initialState","forEach","getInitialState","queued","queuedTimeout","midInstance","_queue","cb","push","Promise","resolve","then","length","shift","catch","error","setTimeout","reset","setState","setOptions","updater","newOptions","functionalUpdate","_render","template","props","render","getState","state","onStateChange","createInstance"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEO,SAASA,mBAAT,CACLC,OADK,EAEqB;AAAA,EAAA,IAAA,qBAAA,CAAA;;AAC1B,EAAA,IAAIA,OAAO,CAACC,QAAR,IAAoBD,OAAO,CAACE,UAAhC,EAA4C;AAC1CC,IAAAA,OAAO,CAACC,IAAR,CAAa,4BAAb,CAAA,CAAA;AACD,GAAA;;AAED,EAAA,IAAIC,QAAQ,GAAG;AACbC,IAAAA,SAAS,EAAE,CACTC,eADS,EAETC,SAFS,EAGTC,WAHS,EAITC,eAJS,EAKTC,qBALS,EAMTC,iBANS,EAOTC,eAPS,EAQTC,eARS,EASTC,eATS,EAUTC,iBAVS,EAWTC,mBAXS,EAYTC,qBAZS,EAaTC,yBAbS,EAcTC,yBAdS,CAAA;AADE,GAAf,CAAA;;AAmBA,EAAA,MAAMC,cAAc,GAAGhB,QAAQ,CAACC,SAAT,CAAmBgB,MAAnB,CAA0B,CAACC,GAAD,EAAMC,OAAN,KAAkB;AACjE,IAAA,OAAOC,MAAM,CAACC,MAAP,CAAcH,GAAd,EAAmBC,OAAO,CAACG,iBAA3B,IAAA,IAAA,GAAA,KAAA,CAAA,GAAmBH,OAAO,CAACG,iBAAR,CAA4BtB,QAA5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AP,CAAA;AACD,OAAA;;AAED,MAAA,OAAOD,QAAP,CAAA;AACD,KAvD0C;AAyD3CG,IAAAA,QAAQ,EAAE,MAAM;AACd,MAAA,OAAOpD,QAAQ,CAACL,OAAT,CAAiB0D,KAAxB,CAAA;AACD,KA3D0C;AA6D3CV,IAAAA,QAAQ,EAAGE,OAAD,IAAkC;AAC1C7C,MAAAA,QAAQ,CAACL,OAAT,CAAiB2D,aAAjB,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAtD,QAAQ,CAACL,OAAT,CAAiB2D,aAAjB,CAAiCT,OAAjC,CAAA,CAAA;AACD,KA/D0C;AAkE3C;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;;AAxF2C,GAA7C,CAAA;AA2FA7C,EAAAA,QAAQ,GAAGoB,MAAM,CAACC,MAAP,CAAcrB,QAAd,EAAwB8B,WAAxB,CAAX,CAAA;;AAEA9B,EAAAA,QAAQ,CAACC,SAAT,CAAmByB,OAAnB,CAA2BP,OAAO,IAAI;AACpC,IAAA,OAAOC,MAAM,CAACC,MAAP,CAAcrB,QAAd,EAAwBmB,OAAO,CAACoC,cAAhC,IAAA,IAAA,GAAA,KAAA,CAAA,GAAwBpC,OAAO,CAACoC,cAAR,CAAyBvD,QAAzB,CAAxB,CAAP,CAAA;AACD,GAFD,CAAA,CAAA;;AAIA,EAAA,OAAOA,QAAP,CAAA;AACD;;;;"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* table-core
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) TanStack
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
-
*
|
|
9
|
-
* @license MIT
|
|
10
|
-
*/
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14
|
-
|
|
15
|
-
var utils = require('../utils.js');
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
const Cells = {
|
|
19
|
-
createRow: (row, instance) => {
|
|
20
|
-
return {
|
|
21
|
-
getAllCells: utils.memo(() => [instance.getAllLeafColumns()], leafColumns => {
|
|
22
|
-
return leafColumns.map(column => {
|
|
23
|
-
return instance.createCell(row, column, column.id);
|
|
24
|
-
});
|
|
25
|
-
}, {
|
|
26
|
-
key: process.env.NODE_ENV === 'development' && 'row.getAllCells',
|
|
27
|
-
debug: () => {
|
|
28
|
-
var _instance$options$deb;
|
|
29
|
-
|
|
30
|
-
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugRows;
|
|
31
|
-
}
|
|
32
|
-
}),
|
|
33
|
-
getAllCellsByColumnId: utils.memo(() => [row.getAllCells()], allCells => {
|
|
34
|
-
return allCells.reduce((acc, cell) => {
|
|
35
|
-
acc[cell.columnId] = cell;
|
|
36
|
-
return acc;
|
|
37
|
-
}, {});
|
|
38
|
-
}, {
|
|
39
|
-
key: process.env.NODE_ENV === 'production' && 'row.getAllCellsByColumnId',
|
|
40
|
-
debug: () => {
|
|
41
|
-
var _instance$options$deb2;
|
|
42
|
-
|
|
43
|
-
return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugRows;
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
createInstance: instance => {
|
|
49
|
-
return {
|
|
50
|
-
createCell: (row, column, columnId) => {
|
|
51
|
-
const cell = {
|
|
52
|
-
id: row.id + "_" + column.id,
|
|
53
|
-
rowId: row.id,
|
|
54
|
-
columnId,
|
|
55
|
-
row,
|
|
56
|
-
column,
|
|
57
|
-
getValue: () => row.getValue(columnId),
|
|
58
|
-
renderCell: () => column.columnDef.cell ? instance._render(column.columnDef.cell, {
|
|
59
|
-
instance,
|
|
60
|
-
column,
|
|
61
|
-
row,
|
|
62
|
-
cell: cell,
|
|
63
|
-
getValue: cell.getValue
|
|
64
|
-
}) : null
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
instance._features.forEach(feature => {
|
|
68
|
-
Object.assign(cell, feature.createCell == null ? void 0 : feature.createCell(cell, column, row, instance));
|
|
69
|
-
}, {});
|
|
70
|
-
|
|
71
|
-
return cell;
|
|
72
|
-
},
|
|
73
|
-
getCell: (rowId, columnId) => {
|
|
74
|
-
const row = instance.getRow(rowId);
|
|
75
|
-
|
|
76
|
-
if (!row) {
|
|
77
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
78
|
-
throw new Error("[Table] could not find row with id " + rowId);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
throw new Error();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const cell = row.getAllCellsByColumnId()[columnId];
|
|
85
|
-
|
|
86
|
-
if (!cell) {
|
|
87
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
88
|
-
throw new Error("[Table] could not find cell " + columnId + " in row " + rowId);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
throw new Error();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return cell;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
exports.Cells = Cells;
|
|
101
|
-
//# sourceMappingURL=Cells.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Cells.js","sources":["../../../src/features/Cells.ts"],"sourcesContent":["import {\n Cell,\n TableGenerics,\n TableInstance,\n Row,\n Column,\n CoreCell,\n} from '../types'\nimport { memo } from '../utils'\n\nexport type CellsRow<TGenerics extends TableGenerics> = {\n getAllCells: () => Cell<TGenerics>[]\n getAllCellsByColumnId: () => Record<string, Cell<TGenerics>>\n}\n\nexport type CellsInstance<TGenerics extends TableGenerics> = {\n createCell: (\n row: Row<TGenerics>,\n column: Column<TGenerics>,\n columnId: string\n ) => Cell<TGenerics>\n getCell: (rowId: string, columnId: string) => Cell<TGenerics>\n}\n\n//\n\nexport const Cells = {\n createRow: <TGenerics extends TableGenerics>(\n row: Row<TGenerics>,\n instance: TableInstance<TGenerics>\n ): CellsRow<TGenerics> => {\n return {\n getAllCells: memo(\n () => [instance.getAllLeafColumns()],\n leafColumns => {\n return leafColumns.map(column => {\n return instance.createCell(row as Row<TGenerics>, column, column.id)\n })\n },\n {\n key: process.env.NODE_ENV === 'development' && 'row.getAllCells',\n debug: () => instance.options.debugAll ?? instance.options.debugRows,\n }\n ),\n\n getAllCellsByColumnId: memo(\n () => [row.getAllCells()],\n allCells => {\n return allCells.reduce((acc, cell) => {\n acc[cell.columnId] = cell\n return acc\n }, {} as Record<string, Cell<TGenerics>>)\n },\n {\n key:\n process.env.NODE_ENV === 'production' &&\n 'row.getAllCellsByColumnId',\n debug: () => instance.options.debugAll ?? instance.options.debugRows,\n }\n ),\n }\n },\n\n createInstance: <TGenerics extends TableGenerics>(\n instance: TableInstance<TGenerics>\n ): CellsInstance<TGenerics> => {\n return {\n createCell: (row, column, columnId) => {\n const cell: CoreCell<TGenerics> = {\n id: `${row.id}_${column.id}`,\n rowId: row.id,\n columnId,\n row,\n column,\n getValue: () => row.getValue(columnId),\n renderCell: () =>\n column.columnDef.cell\n ? instance._render(column.columnDef.cell, {\n instance,\n column,\n row,\n cell: cell as Cell<TGenerics>,\n getValue: cell.getValue,\n })\n : null,\n }\n\n instance._features.forEach(feature => {\n Object.assign(\n cell,\n feature.createCell?.(\n cell as Cell<TGenerics>,\n column,\n row as Row<TGenerics>,\n instance\n )\n )\n }, {})\n\n return cell as Cell<TGenerics>\n },\n\n getCell: (rowId: string, columnId: string) => {\n const row = instance.getRow(rowId)\n\n if (!row) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(`[Table] could not find row with id ${rowId}`)\n }\n throw new Error()\n }\n\n const cell = row.getAllCellsByColumnId()[columnId]\n\n if (!cell) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `[Table] could not find cell ${columnId} in row ${rowId}`\n )\n }\n throw new Error()\n }\n\n return cell\n },\n }\n },\n}\n"],"names":["Cells","createRow","row","instance","getAllCells","memo","getAllLeafColumns","leafColumns","map","column","createCell","id","key","process","env","NODE_ENV","debug","options","debugAll","debugRows","getAllCellsByColumnId","allCells","reduce","acc","cell","columnId","createInstance","rowId","getValue","renderCell","columnDef","_render","_features","forEach","feature","Object","assign","getCell","getRow","Error"],"mappings":";;;;;;;;;;;;;;;;AAwBA;AAEO,MAAMA,KAAK,GAAG;AACnBC,EAAAA,SAAS,EAAE,CACTC,GADS,EAETC,QAFS,KAGe;AACxB,IAAO,OAAA;AACLC,MAAAA,WAAW,EAAEC,UAAI,CACf,MAAM,CAACF,QAAQ,CAACG,iBAAT,EAAD,CADS,EAEfC,WAAW,IAAI;AACb,QAAA,OAAOA,WAAW,CAACC,GAAZ,CAAgBC,MAAM,IAAI;AAC/B,UAAON,OAAAA,QAAQ,CAACO,UAAT,CAAoBR,GAApB,EAA2CO,MAA3C,EAAmDA,MAAM,CAACE,EAA1D,CAAP,CAAA;AACD,SAFM,CAAP,CAAA;AAGD,OANc,EAOf;AACEC,QAAAA,GAAG,EAAEC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAAzB,IAA0C,iBADjD;AAEEC,QAAAA,KAAK,EAAE,MAAA;AAAA,UAAA,IAAA,qBAAA,CAAA;;AAAA,UAAMb,OAAAA,CAAAA,qBAAAA,GAAAA,QAAQ,CAACc,OAAT,CAAiBC,QAAvB,oCAAmCf,QAAQ,CAACc,OAAT,CAAiBE,SAApD,CAAA;AAAA,SAAA;AAFT,OAPe,CADZ;AAcLC,MAAAA,qBAAqB,EAAEf,UAAI,CACzB,MAAM,CAACH,GAAG,CAACE,WAAJ,EAAD,CADmB,EAEzBiB,QAAQ,IAAI;AACV,QAAOA,OAAAA,QAAQ,CAACC,MAAT,CAAgB,CAACC,GAAD,EAAMC,IAAN,KAAe;AACpCD,UAA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