@tanstack/react-table 8.0.0-beta.0 → 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.
@@ -1106,7 +1106,6 @@ const Filters = {
1106
1106
  },
1107
1107
  createColumn: (column, instance) => {
1108
1108
  return {
1109
- filterFn: column.filterFn,
1110
1109
  getAutoFilterFn: () => {
1111
1110
  const firstRow = instance.getCoreRowModel().flatRows[0];
1112
1111
  const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
@@ -1137,7 +1136,7 @@ const Filters = {
1137
1136
  var _ref;
1138
1137
 
1139
1138
  const userFilterFns = instance.options.filterFns;
1140
- return isFunction(column.filterFn) ? column.filterFn : column.filterFn === 'auto' ? column.getAutoFilterFn() : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.filterFn]) != null ? _ref : filterFns[column.filterFn];
1139
+ 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];
1141
1140
  },
1142
1141
  getCanFilter: () => {
1143
1142
  var _column$columnDef$ena, _instance$options$ena, _instance$options$ena2;
@@ -1426,6 +1425,11 @@ const aggregationFns = {
1426
1425
  const Grouping = {
1427
1426
  getDefaultColumnDef: () => {
1428
1427
  return {
1428
+ aggregatedCell: props => {
1429
+ var _props$getValue$toStr, _props$getValue;
1430
+
1431
+ 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;
1432
+ },
1429
1433
  aggregationFn: 'auto'
1430
1434
  };
1431
1435
  },
@@ -1486,8 +1490,6 @@ const Grouping = {
1486
1490
  if (Object.prototype.toString.call(value) === '[object Date]') {
1487
1491
  return aggregationFns.extent;
1488
1492
  }
1489
-
1490
- return aggregationFns.count;
1491
1493
  },
1492
1494
  getAggregationFn: () => {
1493
1495
  var _ref4;
@@ -1498,7 +1500,7 @@ const Grouping = {
1498
1500
  throw new Error();
1499
1501
  }
1500
1502
 
1501
- return isFunction(column.aggregationFn) ? column.aggregationFn : column.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_ref4 = userAggregationFns == null ? void 0 : userAggregationFns[column.aggregationFn]) != null ? _ref4 : aggregationFns[column.aggregationFn];
1503
+ 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];
1502
1504
  }
1503
1505
  };
1504
1506
  },
@@ -2895,9 +2897,9 @@ function createTableInstance(options) {
2895
2897
  header: props => props.header.column.id,
2896
2898
  footer: props => props.header.column.id,
2897
2899
  cell: props => {
2898
- var _props$getValue$toStr, _props$getValue$toStr2, _props$getValue;
2900
+ var _props$getValue$toStr, _props$getValue;
2899
2901
 
2900
- return (_props$getValue$toStr = (_props$getValue$toStr2 = (_props$getValue = props.getValue()).toString) == null ? void 0 : _props$getValue$toStr2.call(_props$getValue)) != null ? _props$getValue$toStr : null;
2902
+ 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;
2901
2903
  },
2902
2904
  ...instance._features.reduce((obj, feature) => {
2903
2905
  return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
@@ -3668,11 +3670,6 @@ function getGroupedRowModel() {
3668
3670
  if (aggregateFn) {
3669
3671
  row._groupingValuesCache[columnId] = aggregateFn(columnId, leafRows, groupedRows);
3670
3672
  return row._groupingValuesCache[columnId];
3671
- } else if (column.aggregationFn) {
3672
- console.info({
3673
- column
3674
- });
3675
- throw new Error(process.env.NODE_ENV !== 'production' ? "Table: Invalid column.aggregateType option for column listed above" : '');
3676
3673
  }
3677
3674
  }
3678
3675
  });