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