@tanstack/table-core 8.0.0-alpha.87 → 8.0.0-beta.0
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 +9 -7
- package/build/cjs/core/cell.js.map +1 -1
- package/build/cjs/core/column.js +1 -1
- package/build/cjs/core/column.js.map +1 -1
- package/build/cjs/features/Expanding.js +6 -2
- package/build/cjs/features/Expanding.js.map +1 -1
- package/build/cjs/features/Visibility.js +2 -2
- package/build/cjs/features/Visibility.js.map +1 -1
- package/build/cjs/utils/getCoreRowModel.js +4 -8
- package/build/cjs/utils/getCoreRowModel.js.map +1 -1
- package/build/esm/index.js +22 -20
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +315 -315
- package/build/types/index.d.ts +0 -2
- package/build/umd/index.development.js +22 -20
- 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 +4 -4
- package/src/.DS_Store +0 -0
- package/src/core/cell.ts +4 -3
- package/src/core/column.ts +0 -1
- package/src/features/Expanding.ts +6 -2
- package/src/features/Visibility.ts +3 -9
- package/src/index.ts +0 -2
- package/src/utils/getCoreRowModel.ts +8 -11
package/build/types/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from './core/column';
|
|
|
5
5
|
export * from './core/headers';
|
|
6
6
|
export * from './core/row';
|
|
7
7
|
export * from './features/ColumnSizing';
|
|
8
|
-
export * from './features/ColumnSizing';
|
|
9
8
|
export * from './features/Expanding';
|
|
10
9
|
export * from './features/Filters';
|
|
11
10
|
export * from './features/Grouping';
|
|
@@ -15,7 +14,6 @@ export * from './features/Pinning';
|
|
|
15
14
|
export * from './features/RowSelection';
|
|
16
15
|
export * from './features/Sorting';
|
|
17
16
|
export * from './features/Visibility';
|
|
18
|
-
export * from './features/Expanding';
|
|
19
17
|
export * from './filterFns';
|
|
20
18
|
export * from './sortingFns';
|
|
21
19
|
export * from './aggregationFns';
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
let column = {
|
|
117
|
+
let column = {
|
|
118
118
|
id: "" + id,
|
|
119
119
|
accessorFn,
|
|
120
120
|
parent: parent,
|
|
@@ -878,8 +878,12 @@
|
|
|
878
878
|
getIsAllRowsExpanded: () => {
|
|
879
879
|
const expanded = instance.getState().expanded; // If expanded is true, save some cycles and return true
|
|
880
880
|
|
|
881
|
-
if (expanded ===
|
|
882
|
-
return true;
|
|
881
|
+
if (typeof expanded === 'boolean') {
|
|
882
|
+
return expanded === true;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
if (!Object.keys(expanded).length) {
|
|
886
|
+
return false;
|
|
883
887
|
} // If any row is not expanded, return false
|
|
884
888
|
|
|
885
889
|
|
|
@@ -2690,8 +2694,8 @@
|
|
|
2690
2694
|
},
|
|
2691
2695
|
createRow: (row, instance) => {
|
|
2692
2696
|
return {
|
|
2693
|
-
_getAllVisibleCells: memo(() => [row.getAllCells()
|
|
2694
|
-
return
|
|
2697
|
+
_getAllVisibleCells: memo(() => [row.getAllCells(), instance.getState().columnVisibility], cells => {
|
|
2698
|
+
return cells.filter(cell => cell.column.getIsVisible());
|
|
2695
2699
|
}, {
|
|
2696
2700
|
key: "development" === 'production' ,
|
|
2697
2701
|
debug: () => {
|
|
@@ -3042,13 +3046,15 @@
|
|
|
3042
3046
|
row,
|
|
3043
3047
|
column,
|
|
3044
3048
|
getValue: () => row.getValue(columnId),
|
|
3045
|
-
renderCell: () =>
|
|
3046
|
-
instance,
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3049
|
+
renderCell: () => {
|
|
3050
|
+
return column.columnDef.cell ? instance._render(column.columnDef.cell, {
|
|
3051
|
+
instance,
|
|
3052
|
+
column,
|
|
3053
|
+
row,
|
|
3054
|
+
cell: cell,
|
|
3055
|
+
getValue: cell.getValue
|
|
3056
|
+
}) : null;
|
|
3057
|
+
}
|
|
3052
3058
|
};
|
|
3053
3059
|
|
|
3054
3060
|
instance._features.forEach(feature => {
|
|
@@ -3123,27 +3129,23 @@
|
|
|
3123
3129
|
flatRows: [],
|
|
3124
3130
|
rowsById: {}
|
|
3125
3131
|
};
|
|
3126
|
-
let rows;
|
|
3127
|
-
let row;
|
|
3128
|
-
let originalRow;
|
|
3129
3132
|
|
|
3130
3133
|
const accessRows = function (originalRows, depth, parent) {
|
|
3131
3134
|
if (depth === void 0) {
|
|
3132
3135
|
depth = 0;
|
|
3133
3136
|
}
|
|
3134
3137
|
|
|
3135
|
-
rows = [];
|
|
3138
|
+
const rows = [];
|
|
3136
3139
|
|
|
3137
3140
|
for (let i = 0; i < originalRows.length; i++) {
|
|
3138
|
-
|
|
3141
|
+
// This could be an expensive check at scale, so we should move it somewhere else, but where?
|
|
3139
3142
|
// if (!id) {
|
|
3140
3143
|
// if ("development" !== 'production') {
|
|
3141
3144
|
// throw new Error(`getRowId expected an ID, but got ${id}`)
|
|
3142
3145
|
// }
|
|
3143
3146
|
// }
|
|
3144
3147
|
// Make the row
|
|
3145
|
-
|
|
3146
|
-
row = createRow(instance, instance._getRowId(originalRow, i, parent), originalRow, i, depth); // Keep track of every row in a flat array
|
|
3148
|
+
const row = createRow(instance, instance._getRowId(originalRows[i], i, parent), originalRows[i], i, depth); // Keep track of every row in a flat array
|
|
3147
3149
|
|
|
3148
3150
|
rowModel.flatRows.push(row); // Also keep track of every row by its ID
|
|
3149
3151
|
|
|
@@ -3154,7 +3156,7 @@
|
|
|
3154
3156
|
if (instance.options.getSubRows) {
|
|
3155
3157
|
var _row$originalSubRows;
|
|
3156
3158
|
|
|
3157
|
-
row.originalSubRows = instance.options.getSubRows(
|
|
3159
|
+
row.originalSubRows = instance.options.getSubRows(originalRows[i], i); // Then recursively access them
|
|
3158
3160
|
|
|
3159
3161
|
if ((_row$originalSubRows = row.originalSubRows) != null && _row$originalSubRows.length) {
|
|
3160
3162
|
row.subRows = accessRows(row.originalSubRows, depth + 1, row);
|