@tanstack/table-core 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.
@@ -34,9 +34,6 @@ export declare type FiltersColumnDef<TGenerics extends TableGenerics> = {
34
34
  enableGlobalFilter?: boolean;
35
35
  };
36
36
  export declare type FiltersColumn<TGenerics extends TableGenerics> = {
37
- filterFn: FilterFnOption<Overwrite<TGenerics, {
38
- Value: any;
39
- }>>;
40
37
  getAutoFilterFn: () => FilterFn<TGenerics> | undefined;
41
38
  getFilterFn: () => FilterFn<TGenerics> | undefined;
42
39
  setFilterValue: (updater: Updater<any>) => void;
@@ -24,9 +24,6 @@ export declare type GroupingColumnDef<TGenerics extends TableGenerics> = {
24
24
  enableGrouping?: boolean;
25
25
  };
26
26
  export declare type GroupingColumn<TGenerics extends TableGenerics> = {
27
- aggregationFn?: AggregationFnOption<Overwrite<TGenerics, {
28
- Value: any;
29
- }>>;
30
27
  getCanGroup: () => boolean;
31
28
  getIsGrouped: () => boolean;
32
29
  getGroupedIndex: () => number;
@@ -1098,7 +1098,6 @@
1098
1098
  },
1099
1099
  createColumn: (column, instance) => {
1100
1100
  return {
1101
- filterFn: column.filterFn,
1102
1101
  getAutoFilterFn: () => {
1103
1102
  const firstRow = instance.getCoreRowModel().flatRows[0];
1104
1103
  const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
@@ -1129,7 +1128,7 @@
1129
1128
  var _ref;
1130
1129
 
1131
1130
  const userFilterFns = instance.options.filterFns;
1132
- return isFunction(column.filterFn) ? column.filterFn : column.filterFn === 'auto' ? column.getAutoFilterFn() : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.filterFn]) != null ? _ref : filterFns[column.filterFn];
1131
+ 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];
1133
1132
  },
1134
1133
  getCanFilter: () => {
1135
1134
  var _column$columnDef$ena, _instance$options$ena, _instance$options$ena2;
@@ -1418,6 +1417,11 @@
1418
1417
  const Grouping = {
1419
1418
  getDefaultColumnDef: () => {
1420
1419
  return {
1420
+ aggregatedCell: props => {
1421
+ var _props$getValue$toStr, _props$getValue;
1422
+
1423
+ 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;
1424
+ },
1421
1425
  aggregationFn: 'auto'
1422
1426
  };
1423
1427
  },
@@ -1478,8 +1482,6 @@
1478
1482
  if (Object.prototype.toString.call(value) === '[object Date]') {
1479
1483
  return aggregationFns.extent;
1480
1484
  }
1481
-
1482
- return aggregationFns.count;
1483
1485
  },
1484
1486
  getAggregationFn: () => {
1485
1487
  var _ref4;
@@ -1490,7 +1492,7 @@
1490
1492
  throw new Error();
1491
1493
  }
1492
1494
 
1493
- return isFunction(column.aggregationFn) ? column.aggregationFn : column.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_ref4 = userAggregationFns == null ? void 0 : userAggregationFns[column.aggregationFn]) != null ? _ref4 : aggregationFns[column.aggregationFn];
1495
+ 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];
1494
1496
  }
1495
1497
  };
1496
1498
  },
@@ -2885,9 +2887,9 @@
2885
2887
  header: props => props.header.column.id,
2886
2888
  footer: props => props.header.column.id,
2887
2889
  cell: props => {
2888
- var _props$getValue$toStr, _props$getValue$toStr2, _props$getValue;
2890
+ var _props$getValue$toStr, _props$getValue;
2889
2891
 
2890
- 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;
2892
+ 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;
2891
2893
  },
2892
2894
  ...instance._features.reduce((obj, feature) => {
2893
2895
  return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
@@ -3658,11 +3660,6 @@
3658
3660
  if (aggregateFn) {
3659
3661
  row._groupingValuesCache[columnId] = aggregateFn(columnId, leafRows, groupedRows);
3660
3662
  return row._groupingValuesCache[columnId];
3661
- } else if (column.aggregationFn) {
3662
- console.info({
3663
- column
3664
- });
3665
- throw new Error("Table: Invalid column.aggregateType option for column listed above" );
3666
3663
  }
3667
3664
  }
3668
3665
  });