@tanstack/table-core 8.0.0-alpha.72 → 8.0.0-alpha.73
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.js +2 -2
- package/build/cjs/core.js.map +1 -1
- package/build/cjs/features/Cells.js +1 -1
- package/build/cjs/features/Cells.js.map +1 -1
- package/build/cjs/features/Expanding.js +4 -2
- package/build/cjs/features/Expanding.js.map +1 -1
- package/build/cjs/features/Grouping.js +1 -1
- package/build/cjs/features/Grouping.js.map +1 -1
- package/build/cjs/features/Headers.js +2 -2
- package/build/cjs/features/Headers.js.map +1 -1
- package/build/cjs/features/Pagination.js +8 -9
- package/build/cjs/features/Pagination.js.map +1 -1
- package/build/cjs/utils/getGroupedRowModel.js +1 -1
- package/build/cjs/utils/getGroupedRowModel.js.map +1 -1
- package/build/esm/index.js +19 -18
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +305 -305
- package/build/types/core.d.ts +2 -3
- package/build/types/features/Pagination.d.ts +0 -1
- package/build/umd/index.development.js +19 -18
- 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.ts +6 -6
- package/src/features/Cells.ts +1 -1
- package/src/features/Expanding.ts +2 -2
- package/src/features/Grouping.ts +1 -1
- package/src/features/Headers.ts +2 -2
- package/src/features/Pagination.ts +6 -11
- package/src/utils/getGroupedRowModel.ts +1 -1
package/build/types/core.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export declare type CoreOptions<TGenerics extends TableGenerics> = {
|
|
|
14
14
|
initialState?: InitialTableState;
|
|
15
15
|
autoResetAll?: boolean;
|
|
16
16
|
mergeOptions?: <T>(defaultOptions: T, options: Partial<T>) => T;
|
|
17
|
-
keepPreviousData?: boolean;
|
|
18
17
|
meta?: TGenerics['TableMeta'];
|
|
19
18
|
};
|
|
20
19
|
export declare type CoreInstance<TGenerics extends TableGenerics> = {
|
|
@@ -22,10 +21,10 @@ export declare type CoreInstance<TGenerics extends TableGenerics> = {
|
|
|
22
21
|
reset: () => void;
|
|
23
22
|
options: RequiredKeys<TableOptions<TGenerics>, 'state'>;
|
|
24
23
|
setOptions: (newOptions: Updater<TableOptions<TGenerics>>) => void;
|
|
25
|
-
queue: (cb: () => void) => void;
|
|
26
24
|
getState: () => TableState;
|
|
27
25
|
setState: (updater: Updater<TableState>) => void;
|
|
28
|
-
|
|
26
|
+
_queue: (cb: () => void) => void;
|
|
27
|
+
_render: <TProps>(template: Renderable<TGenerics, TProps>, props: TProps) => string | null | TGenerics['Rendered'];
|
|
29
28
|
_features: readonly TableFeature[];
|
|
30
29
|
};
|
|
31
30
|
export declare function createTableInstance<TGenerics extends TableGenerics>(options: TableOptions<TGenerics>): TableInstance<TGenerics>;
|
|
@@ -18,7 +18,6 @@ export declare type PaginationOptions<TGenerics extends TableGenerics> = {
|
|
|
18
18
|
};
|
|
19
19
|
export declare type PaginationDefaultOptions = {
|
|
20
20
|
onPaginationChange: OnChangeFn<PaginationState>;
|
|
21
|
-
autoResetPageIndex: boolean;
|
|
22
21
|
};
|
|
23
22
|
export declare type PaginationInstance<TGenerics extends TableGenerics> = {
|
|
24
23
|
_autoResetPageIndex: () => void;
|
|
@@ -375,7 +375,7 @@
|
|
|
375
375
|
row,
|
|
376
376
|
column,
|
|
377
377
|
getValue: () => row.getValue(columnId),
|
|
378
|
-
renderCell: () => column.cell ? instance.
|
|
378
|
+
renderCell: () => column.cell ? instance._render(column.cell, {
|
|
379
379
|
instance,
|
|
380
380
|
column,
|
|
381
381
|
row,
|
|
@@ -699,9 +699,10 @@
|
|
|
699
699
|
return {
|
|
700
700
|
_autoResetExpanded: () => {
|
|
701
701
|
if (!registered) {
|
|
702
|
-
instance.
|
|
702
|
+
instance._queue(() => {
|
|
703
703
|
registered = true;
|
|
704
704
|
});
|
|
705
|
+
|
|
705
706
|
return;
|
|
706
707
|
}
|
|
707
708
|
|
|
@@ -712,7 +713,8 @@
|
|
|
712
713
|
if (instance.options.autoResetAll === true || instance.options.autoResetExpanded) {
|
|
713
714
|
if (queued) return;
|
|
714
715
|
queued = true;
|
|
715
|
-
|
|
716
|
+
|
|
717
|
+
instance._queue(() => {
|
|
716
718
|
instance.resetExpanded();
|
|
717
719
|
queued = false;
|
|
718
720
|
});
|
|
@@ -1396,7 +1398,7 @@
|
|
|
1396
1398
|
var _column$aggregatedCel;
|
|
1397
1399
|
|
|
1398
1400
|
const template = (_column$aggregatedCel = column.aggregatedCell) != null ? _column$aggregatedCel : column.cell;
|
|
1399
|
-
return template ? instance.
|
|
1401
|
+
return template ? instance._render(template, {
|
|
1400
1402
|
instance,
|
|
1401
1403
|
column,
|
|
1402
1404
|
row,
|
|
@@ -1497,8 +1499,7 @@
|
|
|
1497
1499
|
},
|
|
1498
1500
|
getDefaultOptions: instance => {
|
|
1499
1501
|
return {
|
|
1500
|
-
onPaginationChange: makeStateUpdater('pagination', instance)
|
|
1501
|
-
autoResetPageIndex: true
|
|
1502
|
+
onPaginationChange: makeStateUpdater('pagination', instance)
|
|
1502
1503
|
};
|
|
1503
1504
|
},
|
|
1504
1505
|
createInstance: instance => {
|
|
@@ -1506,21 +1507,21 @@
|
|
|
1506
1507
|
let queued = false;
|
|
1507
1508
|
return {
|
|
1508
1509
|
_autoResetPageIndex: () => {
|
|
1510
|
+
var _ref, _instance$options$aut;
|
|
1511
|
+
|
|
1509
1512
|
if (!registered) {
|
|
1510
|
-
instance.
|
|
1513
|
+
instance._queue(() => {
|
|
1511
1514
|
registered = true;
|
|
1512
1515
|
});
|
|
1513
|
-
return;
|
|
1514
|
-
}
|
|
1515
1516
|
|
|
1516
|
-
if (instance.options.autoResetAll === false) {
|
|
1517
1517
|
return;
|
|
1518
1518
|
}
|
|
1519
1519
|
|
|
1520
|
-
if (instance.options.autoResetAll
|
|
1520
|
+
if ((_ref = (_instance$options$aut = instance.options.autoResetAll) != null ? _instance$options$aut : instance.options.autoResetPageIndex) != null ? _ref : !instance.options.manualPagination) {
|
|
1521
1521
|
if (queued) return;
|
|
1522
1522
|
queued = true;
|
|
1523
|
-
|
|
1523
|
+
|
|
1524
|
+
instance._queue(() => {
|
|
1524
1525
|
instance.resetPageIndex();
|
|
1525
1526
|
queued = false;
|
|
1526
1527
|
});
|
|
@@ -1542,7 +1543,7 @@
|
|
|
1542
1543
|
setPageIndex: updater => {
|
|
1543
1544
|
instance.setPagination(old => {
|
|
1544
1545
|
let pageIndex = functionalUpdate(updater, old.pageIndex);
|
|
1545
|
-
const maxPageIndex =
|
|
1546
|
+
const maxPageIndex = typeof old.pageCount !== 'undefined' ? old.pageCount - 1 : Number.MAX_SAFE_INTEGER;
|
|
1546
1547
|
pageIndex = Math.min(Math.max(0, pageIndex), maxPageIndex);
|
|
1547
1548
|
return { ...old,
|
|
1548
1549
|
pageIndex
|
|
@@ -2653,12 +2654,12 @@
|
|
|
2653
2654
|
recurseHeader(header);
|
|
2654
2655
|
return leafHeaders;
|
|
2655
2656
|
},
|
|
2656
|
-
renderHeader: () => column.header ? instance.
|
|
2657
|
+
renderHeader: () => column.header ? instance._render(column.header, {
|
|
2657
2658
|
instance,
|
|
2658
2659
|
header: header,
|
|
2659
2660
|
column
|
|
2660
2661
|
}) : null,
|
|
2661
|
-
renderFooter: () => column.footer ? instance.
|
|
2662
|
+
renderFooter: () => column.footer ? instance._render(column.footer, {
|
|
2662
2663
|
instance,
|
|
2663
2664
|
header: header,
|
|
2664
2665
|
column
|
|
@@ -3132,7 +3133,7 @@
|
|
|
3132
3133
|
...options
|
|
3133
3134
|
},
|
|
3134
3135
|
initialState,
|
|
3135
|
-
|
|
3136
|
+
_queue: cb => {
|
|
3136
3137
|
queued.push(cb);
|
|
3137
3138
|
|
|
3138
3139
|
if (!queuedTimeout) {
|
|
@@ -3190,7 +3191,7 @@
|
|
|
3190
3191
|
const newOptions = functionalUpdate(updater, instance.options);
|
|
3191
3192
|
instance.options = mergeOptions(newOptions);
|
|
3192
3193
|
},
|
|
3193
|
-
|
|
3194
|
+
_render: (template, props) => {
|
|
3194
3195
|
if (typeof instance.options.render === 'function') {
|
|
3195
3196
|
return instance.options.render(template, props);
|
|
3196
3197
|
}
|
|
@@ -3889,7 +3890,7 @@
|
|
|
3889
3890
|
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
|
|
3890
3891
|
},
|
|
3891
3892
|
onChange: () => {
|
|
3892
|
-
instance.
|
|
3893
|
+
instance._queue(() => {
|
|
3893
3894
|
instance._autoResetExpanded();
|
|
3894
3895
|
|
|
3895
3896
|
instance._autoResetPageIndex();
|