@tanstack/react-table 8.0.0-alpha.84 → 8.0.0-alpha.85

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.
@@ -125,7 +125,6 @@ exports.getSortedRowModel = index.getSortedRowModel;
125
125
  exports.isFunction = index.isFunction;
126
126
  exports.isRowSelected = index.isRowSelected;
127
127
  exports.makeStateUpdater = index.makeStateUpdater;
128
- exports.mean = index.mean;
129
128
  exports.memo = index.memo;
130
129
  exports.noop = index.noop;
131
130
  exports.orderColumns = index.orderColumns;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\nexport * from '@tanstack/table-core'\n\nimport {\n createTableInstance,\n TableOptions,\n TableInstance,\n Table,\n TableGenerics,\n createTableFactory,\n Overwrite,\n PartialKeys,\n TableOptionsResolved,\n} from '@tanstack/table-core'\n\nexport type Renderable<TProps> =\n | React.ReactNode\n | React.FunctionComponent<TProps>\n | React.Component<TProps>\n\nexport type Render = <TProps extends {}>(\n Comp: Renderable<TProps>,\n props: TProps\n) => React.ReactNode | JSX.Element\n\nexport type ReactTableGenerics = Overwrite<\n TableGenerics,\n { Renderer: Render; Rendered: ReturnType<Render> }\n>\n\n//\n\nexport const render: Render = (Comp, props) =>\n !Comp ? null : isReactComponent(Comp) ? <Comp {...props} /> : Comp\n\nfunction isReactComponent(component: unknown): component is React.FC {\n return (\n isClassComponent(component) ||\n typeof component === 'function' ||\n isExoticComponent(component)\n )\n}\n\nfunction isClassComponent(component: any) {\n return (\n typeof component === 'function' &&\n (() => {\n const proto = Object.getPrototypeOf(component)\n return proto.prototype && proto.prototype.isReactComponent\n })()\n )\n}\n\nfunction isExoticComponent(component: any) {\n return (\n typeof component === 'object' &&\n typeof component.$$typeof === 'symbol' &&\n ['react.memo', 'react.forward_ref'].includes(component.$$typeof.description)\n )\n}\n\nexport const createTable = createTableFactory({ render })\n\n// const useIsomorphicLayoutEffect =\n// typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect\n\nexport type UseTableInstanceOptions<TGenerics extends ReactTableGenerics> =\n TableOptions<TGenerics>\n\nexport function useTableInstance<TGenerics extends ReactTableGenerics>(\n table: Table<TGenerics>,\n options: UseTableInstanceOptions<TGenerics>\n): TableInstance<TGenerics> {\n // Compose in the generic options to the user options\n const resolvedOptions: TableOptionsResolved<TGenerics> = {\n ...table.options,\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n render,\n ...options,\n }\n\n // Create a new table instance and store it in state\n const [instanceRef] = React.useState(() => ({\n current: createTableInstance<TGenerics>(resolvedOptions),\n }))\n\n // By default, manage table state here using the instance's initial state\n const [state, setState] = React.useState(\n () => instanceRef.current.initialState\n )\n\n // Compose the default state above with any user state. This will allow the user\n // to only control a subset of the state if desired.\n instanceRef.current.setOptions(prev => ({\n ...prev,\n ...options,\n state: {\n ...state,\n ...options.state,\n },\n // Similarly, we'll maintain both our internal state and any user-provided\n // state.\n onStateChange: updater => {\n setState(updater)\n options.onStateChange?.(updater)\n },\n }))\n\n return instanceRef.current\n}\n"],"names":["render","Comp","props","isReactComponent","React","component","isClassComponent","isExoticComponent","proto","Object","getPrototypeOf","prototype","$$typeof","includes","description","createTable","createTableFactory","useTableInstance","table","options","resolvedOptions","state","onStateChange","instanceRef","useState","current","createTableInstance","setState","initialState","setOptions","prev","updater"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AAEO,MAAMA,MAAc,GAAG,CAACC,IAAD,EAAOC,KAAP,KAC5B,CAACD,IAAD,GAAQ,IAAR,GAAeE,gBAAgB,CAACF,IAAD,CAAhB,gBAAyBG,gBAAA,CAAA,aAAA,CAAC,IAAD,EAAUF,KAAV,CAAzB,GAA+CD,KADzD;;AAGP,SAASE,gBAAT,CAA0BE,SAA1B,EAAqE;AACnE,EAAA,OACEC,gBAAgB,CAACD,SAAD,CAAhB,IACA,OAAOA,SAAP,KAAqB,UADrB,IAEAE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WAAW,CAACE,OAAZ,CAAoBG,YADF,CAA1B,CAhB0B;AAqB1B;;AACAL,EAAAA,WAAW,CAACE,OAAZ,CAAoBI,UAApB,CAA+BC,IAAI,KAAK,EACtC,GAAGA,IADmC;AAEtC,IAAA,GAAGX,OAFmC;AAGtCE,IAAAA,KAAK,EAAE,EACL,GAAGA,KADE;AAEL,MAAA,GAAGF,OAAO,CAACE,KAAAA;AAFN,KAH+B;AAOtC;AACA;AACAC,IAAAA,aAAa,EAAES,OAAO,IAAI;AACxBJ,MAAAA,QAAQ,CAACI,OAAD,CAAR,CAAA;AACAZ,MAAAA,OAAO,CAACG,aAAR,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAH,OAAO,CAACG,aAAR,CAAwBS,OAAxB,CAAA,CAAA;AACD,KAAA;AAZqC,GAAL,CAAnC,CAAA,CAAA;AAeA,EAAOR,OAAAA,WAAW,CAACE,OAAnB,CAAA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\nexport * from '@tanstack/table-core'\n\nimport {\n createTableInstance,\n TableOptions,\n TableInstance,\n Table,\n TableGenerics,\n createTableFactory,\n Overwrite,\n PartialKeys,\n TableOptionsResolved,\n} from '@tanstack/table-core'\n\nexport type Renderable<TProps> =\n | React.ReactNode\n | React.FunctionComponent<TProps>\n | React.Component<TProps>\n\nexport type Render = <TProps extends {}>(\n Comp: Renderable<TProps>,\n props: TProps\n) => React.ReactNode | JSX.Element\n\nexport type ReactTableGenerics = Overwrite<\n TableGenerics,\n { Renderer: Render; Rendered: ReturnType<Render> }\n>\n\n//\n\nexport const render: Render = (Comp, props) =>\n !Comp ? null : isReactComponent(Comp) ? <Comp {...props} /> : Comp\n\nfunction isReactComponent(component: unknown): component is React.FC {\n return (\n isClassComponent(component) ||\n typeof component === 'function' ||\n isExoticComponent(component)\n )\n}\n\nfunction isClassComponent(component: any) {\n return (\n typeof component === 'function' &&\n (() => {\n const proto = Object.getPrototypeOf(component)\n return proto.prototype && proto.prototype.isReactComponent\n })()\n )\n}\n\nfunction isExoticComponent(component: any) {\n return (\n typeof component === 'object' &&\n typeof component.$$typeof === 'symbol' &&\n ['react.memo', 'react.forward_ref'].includes(component.$$typeof.description)\n )\n}\n\nexport const createTable = createTableFactory({ render })\n\n// const useIsomorphicLayoutEffect =\n// typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect\n\nexport type UseTableInstanceOptions<TGenerics extends ReactTableGenerics> =\n TableOptions<TGenerics>\n\nexport function useTableInstance<TGenerics extends ReactTableGenerics>(\n table: Table<TGenerics>,\n options: UseTableInstanceOptions<TGenerics>\n): TableInstance<TGenerics> {\n // Compose in the generic options to the user options\n const resolvedOptions: TableOptionsResolved<TGenerics> = {\n ...table.options,\n state: {}, // Dummy state\n onStateChange: () => {}, // noop\n render,\n ...options,\n }\n\n // Create a new table instance and store it in state\n const [instanceRef] = React.useState(() => ({\n current: createTableInstance<TGenerics>(resolvedOptions),\n }))\n\n // By default, manage table state here using the instance's initial state\n const [state, setState] = React.useState(\n () => instanceRef.current.initialState\n )\n\n // Compose the default state above with any user state. This will allow the user\n // to only control a subset of the state if desired.\n instanceRef.current.setOptions(prev => ({\n ...prev,\n ...options,\n state: {\n ...state,\n ...options.state,\n },\n // Similarly, we'll maintain both our internal state and any user-provided\n // state.\n onStateChange: updater => {\n setState(updater)\n options.onStateChange?.(updater)\n },\n }))\n\n return instanceRef.current\n}\n"],"names":["render","Comp","props","isReactComponent","React","component","isClassComponent","isExoticComponent","proto","Object","getPrototypeOf","prototype","$$typeof","includes","description","createTable","createTableFactory","useTableInstance","table","options","resolvedOptions","state","onStateChange","instanceRef","useState","current","createTableInstance","setState","initialState","setOptions","prev","updater"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AAEO,MAAMA,MAAc,GAAG,CAACC,IAAD,EAAOC,KAAP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F0B;;AAW1B,EAAA,MAAM,CAACI,WAAD,CAAA,GAAgBnB,gBAAK,CAACoB,QAAN,CAAe,OAAO;AAC1CC,IAAAA,OAAO,EAAEC,yBAAmB,CAAYN,eAAZ,CAAA;AADc,GAAP,CAAf,CAAtB,CAX0B;;AAgB1B,EAAA,MAAM,CAACC,KAAD,EAAQM,QAAR,CAAA,GAAoBvB,gBAAK,CAACoB,QAAN,CACxB,MAAMD,WAAW,CAACE,OAAZ,CAAoBG,YADF,CAA1B,CAhB0B;AAqB1B;;AACAL,EAAAA,WAAW,CAACE,OAAZ,CAAoBI,UAApB,CAA+BC,IAAI,KAAK,EACtC,GAAGA,IADmC;AAEtC,IAAA,GAAGX,OAFmC;AAGtCE,IAAAA,KAAK,EAAE,EACL,GAAGA,KADE;AAEL,MAAA,GAAGF,OAAO,CAACE,KAAAA;AAFN,KAH+B;AAOtC;AACA;AACAC,IAAAA,aAAa,EAAES,OAAO,IAAI;AACxBJ,MAAAA,QAAQ,CAACI,OAAD,CAAR,CAAA;AACAZ,MAAAA,OAAO,CAACG,aAAR,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAH,OAAO,CAACG,aAAR,CAAwBS,OAAxB,CAAA,CAAA;AACD,KAAA;AAZqC,GAAL,CAAnC,CAAA,CAAA;AAeA,EAAOR,OAAAA,WAAW,CAACE,OAAnB,CAAA;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1226,8 +1226,7 @@ const Filters = {
1226
1226
  createRow: (row, instance) => {
1227
1227
  return {
1228
1228
  columnFilters: {},
1229
- columnFiltersMeta: {},
1230
- subRowsByFacetId: {}
1229
+ columnFiltersMeta: {}
1231
1230
  };
1232
1231
  },
1233
1232
  createInstance: instance => {
@@ -1318,53 +1317,42 @@ function shouldAutoRemoveFilter(filterFn, value, column) {
1318
1317
  return (filterFn && filterFn.autoRemove ? filterFn.autoRemove(value, column) : false) || typeof value === 'undefined' || typeof value === 'string' && !value;
1319
1318
  }
1320
1319
 
1321
- const aggregationFns = {
1322
- sum,
1323
- min,
1324
- max,
1325
- extent,
1326
- mean,
1327
- median,
1328
- unique,
1329
- uniqueCount,
1330
- count
1331
- };
1332
-
1333
- function sum(_getLeafValues, getChildValues) {
1320
+ const sum = (columnId, _leafRows, childRows) => {
1334
1321
  // It's faster to just add the aggregations together instead of
1335
1322
  // process leaf nodes individually
1336
- return getChildValues().reduce((sum, next) => sum + (typeof next === 'number' ? next : 0), 0);
1337
- }
1323
+ return childRows.reduce((sum, next) => sum + (typeof next === 'number' ? next : 0), 0);
1324
+ };
1338
1325
 
1339
- function min(_getLeafValues, getChildValues) {
1326
+ const min = (columnId, _leafRows, childRows) => {
1340
1327
  let min;
1328
+ childRows.forEach(row => {
1329
+ const value = row.getValue(columnId);
1341
1330
 
1342
- for (const value of getChildValues()) {
1343
1331
  if (value != null && (min > value || min === undefined && value >= value)) {
1344
1332
  min = value;
1345
1333
  }
1346
- }
1347
-
1334
+ });
1348
1335
  return min;
1349
- }
1336
+ };
1350
1337
 
1351
- function max(_getLeafValues, getChildValues) {
1338
+ const max = (columnId, _leafRows, childRows) => {
1352
1339
  let max;
1340
+ childRows.forEach(row => {
1341
+ const value = row.getValue(columnId);
1353
1342
 
1354
- for (const value of getChildValues()) {
1355
1343
  if (value != null && (max < value || max === undefined && value >= value)) {
1356
1344
  max = value;
1357
1345
  }
1358
- }
1359
-
1346
+ });
1360
1347
  return max;
1361
- }
1348
+ };
1362
1349
 
1363
- function extent(_getLeafValues, getChildValues) {
1350
+ const extent = (columnId, _leafRows, childRows) => {
1364
1351
  let min;
1365
1352
  let max;
1353
+ childRows.forEach(row => {
1354
+ const value = row.getValue(columnId);
1366
1355
 
1367
- for (const value of getChildValues()) {
1368
1356
  if (value != null) {
1369
1357
  if (min === undefined) {
1370
1358
  if (value >= value) min = max = value;
@@ -1373,54 +1361,65 @@ function extent(_getLeafValues, getChildValues) {
1373
1361
  if (max < value) max = value;
1374
1362
  }
1375
1363
  }
1376
- }
1377
-
1364
+ });
1378
1365
  return [min, max];
1379
- }
1366
+ };
1380
1367
 
1381
- function mean(getLeafValues) {
1368
+ const mean = (columnId, leafRows) => {
1382
1369
  let count = 0;
1383
1370
  let sum = 0;
1371
+ leafRows.forEach(row => {
1372
+ let value = row.getValue(columnId);
1384
1373
 
1385
- for (let value of getLeafValues()) {
1386
1374
  if (value != null && (value = +value) >= value) {
1387
1375
  ++count, sum += value;
1388
1376
  }
1389
- }
1390
-
1377
+ });
1391
1378
  if (count) return sum / count;
1392
1379
  return;
1393
- }
1394
-
1395
- function median(getLeafValues) {
1396
- const leafValues = getLeafValues();
1380
+ };
1397
1381
 
1398
- if (!leafValues.length) {
1382
+ const median = (columnId, leafRows) => {
1383
+ if (!leafRows.length) {
1399
1384
  return;
1400
1385
  }
1401
1386
 
1402
1387
  let min = 0;
1403
1388
  let max = 0;
1404
- leafValues.forEach(value => {
1389
+ leafRows.forEach(row => {
1390
+ let value = row.getValue(columnId);
1391
+
1405
1392
  if (typeof value === 'number') {
1406
1393
  min = Math.min(min, value);
1407
1394
  max = Math.max(max, value);
1408
1395
  }
1409
1396
  });
1410
1397
  return (min + max) / 2;
1411
- }
1398
+ };
1412
1399
 
1413
- function unique(getLeafValues) {
1414
- return Array.from(new Set(getLeafValues()).values());
1415
- }
1400
+ const unique = (columnId, leafRows) => {
1401
+ return Array.from(new Set(leafRows.map(d => d.getValue(columnId))).values());
1402
+ };
1416
1403
 
1417
- function uniqueCount(getLeafValues) {
1418
- return new Set(getLeafValues()).size;
1419
- }
1404
+ const uniqueCount = (columnId, leafRows) => {
1405
+ return new Set(leafRows.map(d => d.getValue(columnId))).size;
1406
+ };
1420
1407
 
1421
- function count(getLeafValues) {
1422
- return getLeafValues().length;
1423
- }
1408
+ const count = (_columnId, leafRows) => {
1409
+ return leafRows.length;
1410
+ };
1411
+
1412
+ const aggregationFns = {
1413
+ sum,
1414
+ min,
1415
+ max,
1416
+ extent,
1417
+ mean,
1418
+ median,
1419
+ unique,
1420
+ uniqueCount,
1421
+ count
1422
+ };
1424
1423
 
1425
1424
  //
1426
1425
  const Grouping = {
@@ -1475,7 +1474,7 @@ const Grouping = {
1475
1474
  column.toggleGrouping();
1476
1475
  };
1477
1476
  },
1478
- getColumnAutoAggregationFn: () => {
1477
+ getAutoAggregationFn: () => {
1479
1478
  const firstRow = instance.getCoreRowModel().flatRows[0];
1480
1479
  const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
1481
1480
 
@@ -1489,7 +1488,7 @@ const Grouping = {
1489
1488
 
1490
1489
  return aggregationFns.count;
1491
1490
  },
1492
- getColumnAggregationFn: () => {
1491
+ getAggregationFn: () => {
1493
1492
  var _ref4;
1494
1493
 
1495
1494
  const userAggregationFns = instance.options.aggregationFns;
@@ -1498,7 +1497,7 @@ const Grouping = {
1498
1497
  throw new Error();
1499
1498
  }
1500
1499
 
1501
- return isFunction(column.aggregationFn) ? column.aggregationFn : column.aggregationFn === 'auto' ? column.getColumnAutoAggregationFn() : (_ref4 = userAggregationFns == null ? void 0 : userAggregationFns[column.aggregationFn]) != null ? _ref4 : aggregationFns[column.aggregationFn];
1500
+ return isFunction(column.aggregationFn) ? column.aggregationFn : column.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_ref4 = userAggregationFns == null ? void 0 : userAggregationFns[column.aggregationFn]) != null ? _ref4 : aggregationFns[column.aggregationFn];
1502
1501
  }
1503
1502
  };
1504
1503
  },
@@ -1524,10 +1523,10 @@ const Grouping = {
1524
1523
  }
1525
1524
  };
1526
1525
  },
1527
- createRow: (row, instance) => {
1526
+ createRow: row => {
1528
1527
  return {
1529
1528
  getIsGrouped: () => !!row.groupingColumnId,
1530
- groupingValuesCache: {}
1529
+ _groupingValuesCache: {}
1531
1530
  };
1532
1531
  },
1533
1532
  createCell: (cell, column, row, instance) => {
@@ -3662,25 +3661,17 @@ function getGroupedRowModel() {
3662
3661
  return row._valuesCache[columnId];
3663
3662
  }
3664
3663
 
3665
- if (row.groupingValuesCache.hasOwnProperty(columnId)) {
3666
- return row.groupingValuesCache[columnId];
3664
+ if (row._groupingValuesCache.hasOwnProperty(columnId)) {
3665
+ return row._groupingValuesCache[columnId];
3667
3666
  } // Aggregate the values
3668
3667
 
3669
3668
 
3670
3669
  const column = instance.getColumn(columnId);
3671
- const aggregateFn = column.getColumnAggregationFn();
3670
+ const aggregateFn = column.getAggregationFn();
3672
3671
 
3673
3672
  if (aggregateFn) {
3674
- row.groupingValuesCache[columnId] = aggregateFn(() => leafRows.map(row => {
3675
- let columnValue = row.getValue(columnId);
3676
-
3677
- if (!depth && column.columnDef.aggregateValue) {
3678
- columnValue = column.columnDef.aggregateValue(columnValue);
3679
- }
3680
-
3681
- return columnValue;
3682
- }), () => groupedRows.map(row => row.getValue(columnId)));
3683
- return row.groupingValuesCache[columnId];
3673
+ row._groupingValuesCache[columnId] = aggregateFn(columnId, leafRows, groupedRows);
3674
+ return row._groupingValuesCache[columnId];
3684
3675
  } else if (column.aggregationFn) {
3685
3676
  console.info({
3686
3677
  column
@@ -3867,7 +3858,6 @@ exports.getSortedRowModel = getSortedRowModel;
3867
3858
  exports.isFunction = isFunction;
3868
3859
  exports.isRowSelected = isRowSelected;
3869
3860
  exports.makeStateUpdater = makeStateUpdater;
3870
- exports.mean = mean;
3871
3861
  exports.memo = memo;
3872
3862
  exports.noop = noop;
3873
3863
  exports.orderColumns = orderColumns;