@tanstack/table-core 8.5.8 → 8.5.9
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/utils/getExpandedRowModel.js +8 -3
- package/build/cjs/utils/getExpandedRowModel.js.map +1 -1
- package/build/cjs/utils/getPaginationRowModel.js +2 -1
- package/build/cjs/utils/getPaginationRowModel.js.map +1 -1
- package/build/esm/index.js +10 -4
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +312 -312
- package/build/types/index.d.ts +1 -1
- package/build/umd/index.development.js +10 -4
- 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/utils/getExpandedRowModel.ts +8 -7
- package/src/utils/getPaginationRowModel.ts +14 -9
package/build/types/index.d.ts
CHANGED
|
@@ -795,7 +795,7 @@ declare function getSortedRowModel<TData extends RowData>(): (table: Table<TData
|
|
|
795
795
|
declare function getGroupedRowModel<TData extends RowData>(): (table: Table<TData>) => () => RowModel<TData>;
|
|
796
796
|
|
|
797
797
|
declare function getExpandedRowModel<TData extends RowData>(): (table: Table<TData>) => () => RowModel<TData>;
|
|
798
|
-
declare function expandRows<TData extends RowData>(rowModel: RowModel<TData
|
|
798
|
+
declare function expandRows<TData extends RowData>(rowModel: RowModel<TData>): {
|
|
799
799
|
rows: Row<TData>[];
|
|
800
800
|
flatRows: Row<TData>[];
|
|
801
801
|
rowsById: Record<string, Row<TData>>;
|
|
@@ -3785,8 +3785,13 @@
|
|
|
3785
3785
|
|
|
3786
3786
|
function getExpandedRowModel() {
|
|
3787
3787
|
return table => memo(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
|
|
3788
|
-
if (!rowModel.rows.length ||
|
|
3789
|
-
|
|
3788
|
+
if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
|
|
3789
|
+
return rowModel;
|
|
3790
|
+
}
|
|
3791
|
+
|
|
3792
|
+
if (!paginateExpandedRows) {
|
|
3793
|
+
// Only expand rows at this point if they are being paginated
|
|
3794
|
+
console.log(rowModel.rows);
|
|
3790
3795
|
return rowModel;
|
|
3791
3796
|
}
|
|
3792
3797
|
|
|
@@ -3800,7 +3805,7 @@
|
|
|
3800
3805
|
}
|
|
3801
3806
|
});
|
|
3802
3807
|
}
|
|
3803
|
-
function expandRows(rowModel
|
|
3808
|
+
function expandRows(rowModel) {
|
|
3804
3809
|
const expandedRows = [];
|
|
3805
3810
|
|
|
3806
3811
|
const handleRow = row => {
|
|
@@ -3822,7 +3827,7 @@
|
|
|
3822
3827
|
}
|
|
3823
3828
|
|
|
3824
3829
|
function getPaginationRowModel(opts) {
|
|
3825
|
-
return table => memo(() => [table.getState().pagination, table.getPrePaginationRowModel()], (pagination, rowModel) => {
|
|
3830
|
+
return table => memo(() => [table.getState().pagination, table.getPrePaginationRowModel(), table.options.paginateExpandedRows ? undefined : table.getState().expanded], (pagination, rowModel) => {
|
|
3826
3831
|
if (!rowModel.rows.length) {
|
|
3827
3832
|
return rowModel;
|
|
3828
3833
|
}
|
|
@@ -3855,6 +3860,7 @@
|
|
|
3855
3860
|
};
|
|
3856
3861
|
}
|
|
3857
3862
|
|
|
3863
|
+
console.log(paginatedRowModel.rows);
|
|
3858
3864
|
paginatedRowModel.flatRows = [];
|
|
3859
3865
|
|
|
3860
3866
|
const handleRow = row => {
|