@tanstack/react-table 8.0.0-beta.2 → 8.0.0-beta.3
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/table-core/build/esm/index.js +9 -12
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +9 -12
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +17 -17
- package/build/umd/index.development.js +9 -12
- 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 +2 -2
|
@@ -1108,7 +1108,6 @@ const Filters = {
|
|
|
1108
1108
|
},
|
|
1109
1109
|
createColumn: (column, instance) => {
|
|
1110
1110
|
return {
|
|
1111
|
-
filterFn: column.filterFn,
|
|
1112
1111
|
getAutoFilterFn: () => {
|
|
1113
1112
|
const firstRow = instance.getCoreRowModel().flatRows[0];
|
|
1114
1113
|
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
@@ -1139,7 +1138,7 @@ const Filters = {
|
|
|
1139
1138
|
var _ref;
|
|
1140
1139
|
|
|
1141
1140
|
const userFilterFns = instance.options.filterFns;
|
|
1142
|
-
return isFunction(column.filterFn) ? column.filterFn : column.filterFn === 'auto' ? column.getAutoFilterFn() : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.filterFn]) != null ? _ref : filterFns[column.filterFn];
|
|
1141
|
+
return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn() : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.columnDef.filterFn]) != null ? _ref : filterFns[column.columnDef.filterFn];
|
|
1143
1142
|
},
|
|
1144
1143
|
getCanFilter: () => {
|
|
1145
1144
|
var _column$columnDef$ena, _instance$options$ena, _instance$options$ena2;
|
|
@@ -1428,6 +1427,11 @@ const aggregationFns = {
|
|
|
1428
1427
|
const Grouping = {
|
|
1429
1428
|
getDefaultColumnDef: () => {
|
|
1430
1429
|
return {
|
|
1430
|
+
aggregatedCell: props => {
|
|
1431
|
+
var _props$getValue$toStr, _props$getValue;
|
|
1432
|
+
|
|
1433
|
+
return (_props$getValue$toStr = (_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _props$getValue$toStr : null;
|
|
1434
|
+
},
|
|
1431
1435
|
aggregationFn: 'auto'
|
|
1432
1436
|
};
|
|
1433
1437
|
},
|
|
@@ -1488,8 +1492,6 @@ const Grouping = {
|
|
|
1488
1492
|
if (Object.prototype.toString.call(value) === '[object Date]') {
|
|
1489
1493
|
return aggregationFns.extent;
|
|
1490
1494
|
}
|
|
1491
|
-
|
|
1492
|
-
return aggregationFns.count;
|
|
1493
1495
|
},
|
|
1494
1496
|
getAggregationFn: () => {
|
|
1495
1497
|
var _ref4;
|
|
@@ -1500,7 +1502,7 @@ const Grouping = {
|
|
|
1500
1502
|
throw new Error();
|
|
1501
1503
|
}
|
|
1502
1504
|
|
|
1503
|
-
return isFunction(column.aggregationFn) ? column.aggregationFn : column.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_ref4 = userAggregationFns == null ? void 0 : userAggregationFns[column.aggregationFn]) != null ? _ref4 : aggregationFns[column.aggregationFn];
|
|
1505
|
+
return isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_ref4 = userAggregationFns == null ? void 0 : userAggregationFns[column.columnDef.aggregationFn]) != null ? _ref4 : aggregationFns[column.columnDef.aggregationFn];
|
|
1504
1506
|
}
|
|
1505
1507
|
};
|
|
1506
1508
|
},
|
|
@@ -2897,9 +2899,9 @@ function createTableInstance(options) {
|
|
|
2897
2899
|
header: props => props.header.column.id,
|
|
2898
2900
|
footer: props => props.header.column.id,
|
|
2899
2901
|
cell: props => {
|
|
2900
|
-
var _props$getValue$toStr, _props$getValue
|
|
2902
|
+
var _props$getValue$toStr, _props$getValue;
|
|
2901
2903
|
|
|
2902
|
-
return (_props$getValue$toStr = (_props$getValue
|
|
2904
|
+
return (_props$getValue$toStr = (_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _props$getValue$toStr : null;
|
|
2903
2905
|
},
|
|
2904
2906
|
...instance._features.reduce((obj, feature) => {
|
|
2905
2907
|
return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
|
|
@@ -3670,11 +3672,6 @@ function getGroupedRowModel() {
|
|
|
3670
3672
|
if (aggregateFn) {
|
|
3671
3673
|
row._groupingValuesCache[columnId] = aggregateFn(columnId, leafRows, groupedRows);
|
|
3672
3674
|
return row._groupingValuesCache[columnId];
|
|
3673
|
-
} else if (column.aggregationFn) {
|
|
3674
|
-
console.info({
|
|
3675
|
-
column
|
|
3676
|
-
});
|
|
3677
|
-
throw new Error(process.env.NODE_ENV !== 'production' ? "Table: Invalid column.aggregateType option for column listed above" : '');
|
|
3678
3675
|
}
|
|
3679
3676
|
}
|
|
3680
3677
|
});
|