@tanstack/table-core 8.0.0-alpha.82 → 8.0.0-alpha.83

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.
Files changed (53) hide show
  1. package/build/cjs/core.js.map +1 -1
  2. package/build/cjs/createTable.js +3 -2
  3. package/build/cjs/createTable.js.map +1 -1
  4. package/build/cjs/features/Cells.js +1 -1
  5. package/build/cjs/features/Cells.js.map +1 -1
  6. package/build/cjs/features/ColumnSizing.js +5 -5
  7. package/build/cjs/features/ColumnSizing.js.map +1 -1
  8. package/build/cjs/features/Columns.js +8 -6
  9. package/build/cjs/features/Columns.js.map +1 -1
  10. package/build/cjs/features/Filters.js +9 -5
  11. package/build/cjs/features/Filters.js.map +1 -1
  12. package/build/cjs/features/Grouping.js +5 -5
  13. package/build/cjs/features/Grouping.js.map +1 -1
  14. package/build/cjs/features/Headers.js +2 -2
  15. package/build/cjs/features/Headers.js.map +1 -1
  16. package/build/cjs/features/Pinning.js +14 -8
  17. package/build/cjs/features/Pinning.js.map +1 -1
  18. package/build/cjs/features/Sorting.js +8 -8
  19. package/build/cjs/features/Sorting.js.map +1 -1
  20. package/build/cjs/features/Visibility.js +3 -3
  21. package/build/cjs/features/Visibility.js.map +1 -1
  22. package/build/cjs/utils/getGroupedRowModel.js +2 -2
  23. package/build/cjs/utils/getGroupedRowModel.js.map +1 -1
  24. package/build/cjs/utils/getSortedRowModel.js +2 -2
  25. package/build/cjs/utils/getSortedRowModel.js.map +1 -1
  26. package/build/esm/index.js +62 -49
  27. package/build/esm/index.js.map +1 -1
  28. package/build/stats-html.html +1 -1
  29. package/build/stats-react.json +324 -324
  30. package/build/types/core.d.ts +4 -4
  31. package/build/types/createTable.d.ts +4 -4
  32. package/build/types/features/Columns.d.ts +2 -2
  33. package/build/types/features/Pinning.d.ts +1 -1
  34. package/build/types/types.d.ts +5 -3
  35. package/build/umd/index.development.js +62 -49
  36. package/build/umd/index.development.js.map +1 -1
  37. package/build/umd/index.production.js +1 -1
  38. package/build/umd/index.production.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/core.ts +6 -6
  41. package/src/createTable.ts +7 -4
  42. package/src/features/Cells.ts +2 -2
  43. package/src/features/ColumnSizing.ts +5 -5
  44. package/src/features/Columns.ts +12 -8
  45. package/src/features/Filters.ts +7 -3
  46. package/src/features/Grouping.ts +4 -3
  47. package/src/features/Headers.ts +4 -4
  48. package/src/features/Pinning.ts +10 -5
  49. package/src/features/Sorting.ts +9 -9
  50. package/src/features/Visibility.ts +2 -2
  51. package/src/types.ts +9 -5
  52. package/src/utils/getGroupedRowModel.ts +3 -2
  53. package/src/utils/getSortedRowModel.ts +2 -2
@@ -1,5 +1,5 @@
1
1
  import { RequiredKeys } from './utils';
2
- import { Updater, TableOptions, TableState, TableInstance, Renderable, TableFeature, TableGenerics, InitialTableState } from './types';
2
+ import { Updater, TableOptionsResolved, TableState, TableInstance, Renderable, TableFeature, TableGenerics, InitialTableState } from './types';
3
3
  export declare type CoreTableState = {};
4
4
  export declare type CoreOptions<TGenerics extends TableGenerics> = {
5
5
  data: TGenerics['Row'][];
@@ -19,12 +19,12 @@ export declare type CoreOptions<TGenerics extends TableGenerics> = {
19
19
  export declare type CoreInstance<TGenerics extends TableGenerics> = {
20
20
  initialState: TableState;
21
21
  reset: () => void;
22
- options: RequiredKeys<TableOptions<TGenerics>, 'state'>;
23
- setOptions: (newOptions: Updater<TableOptions<TGenerics>>) => void;
22
+ options: RequiredKeys<TableOptionsResolved<TGenerics>, 'state'>;
23
+ setOptions: (newOptions: Updater<TableOptionsResolved<TGenerics>>) => void;
24
24
  getState: () => TableState;
25
25
  setState: (updater: Updater<TableState>) => void;
26
26
  _queue: (cb: () => void) => void;
27
27
  _render: <TProps>(template: Renderable<TGenerics, TProps>, props: TProps) => string | null | TGenerics['Rendered'];
28
28
  _features: readonly TableFeature[];
29
29
  };
30
- export declare function createTableInstance<TGenerics extends TableGenerics>(options: TableOptions<TGenerics>): TableInstance<TGenerics>;
30
+ export declare function createTableInstance<TGenerics extends TableGenerics>(options: TableOptionsResolved<TGenerics>): TableInstance<TGenerics>;
@@ -1,7 +1,7 @@
1
1
  import { CustomFilterFns, FilterFn } from './features/Filters';
2
2
  import { AggregationFn, CustomAggregationFns } from './features/Grouping';
3
3
  import { CustomSortingFns, SortingFn } from './features/Sorting';
4
- import { ColumnDef, AccessorFn, AnyRender, TableGenerics, TableOptions } from './types';
4
+ import { ColumnDef, AccessorFn, AnyRender, TableGenerics, TableOptionsResolved, TableOptions } from './types';
5
5
  import { IfDefined, Overwrite } from './utils';
6
6
  export declare type TableFactory<TGenerics extends TableGenerics> = () => Table<TGenerics>;
7
7
  export declare type CreateTableOptions<TRender extends AnyRender, TFilterFns extends CustomFilterFns<any>, TSortingFns extends CustomSortingFns<any>, TAggregationFns extends CustomAggregationFns<any>, TGenerics extends TableGenerics> = Partial<{
@@ -9,11 +9,10 @@ export declare type CreateTableOptions<TRender extends AnyRender, TFilterFns ext
9
9
  filterFns?: TFilterFns;
10
10
  sortingFns?: TSortingFns;
11
11
  aggregationFns?: TAggregationFns;
12
- } & Omit<TableOptions<TGenerics>, 'filterFns' | 'sortingFns' | 'aggregationFns'>>;
12
+ } & Omit<TableOptionsResolved<TGenerics>, 'filterFns' | 'sortingFns' | 'aggregationFns'>>;
13
13
  export declare type Table<TGenerics extends TableGenerics> = {
14
14
  generics: TGenerics;
15
- options: Partial<TableOptions<TGenerics>>;
16
- setGenerics: <T extends TableGenerics>() => Table<T>;
15
+ options: Partial<TableOptionsResolved<TGenerics>>;
17
16
  setRowType: <TRow>() => Table<Overwrite<TGenerics, {
18
17
  Row: TRow;
19
18
  }>>;
@@ -54,6 +53,7 @@ export declare type Table<TGenerics extends TableGenerics> = {
54
53
  accessorKey?: never;
55
54
  columns?: ColumnDef<any>[];
56
55
  }>) => ColumnDef<TGenerics>;
56
+ createOptions: (options: TableOptions<TGenerics>) => TableOptions<TGenerics>;
57
57
  };
58
58
  export declare function createTableFactory<TRenderer extends AnyRender>(opts: {
59
59
  render: TRenderer;
@@ -37,10 +37,10 @@ export declare type CoreColumn<TGenerics extends TableGenerics> = {
37
37
  };
38
38
  export declare type ColumnsOptions<TGenerics extends TableGenerics> = {
39
39
  columns: ColumnDef<TGenerics>[];
40
- defaultColumn?: Partial<ColumnDef<TGenerics>>;
40
+ defaultColumnDef?: Partial<ColumnDef<TGenerics>>;
41
41
  };
42
42
  export declare type ColumnsInstance<TGenerics extends TableGenerics> = {
43
- getDefaultColumn: () => Partial<ColumnDef<TGenerics>>;
43
+ getDefaultColumnDef: () => Partial<ColumnDef<TGenerics>>;
44
44
  getColumnDefs: () => ColumnDef<TGenerics>[];
45
45
  createColumn: (columnDef: ColumnDef<TGenerics>, depth: number, parent?: Column<TGenerics>) => Column<TGenerics>;
46
46
  getAllColumns: () => Column<TGenerics>[];
@@ -31,7 +31,7 @@ export declare type ColumnPinningRow<TGenerics extends TableGenerics> = {
31
31
  export declare type ColumnPinningInstance<TGenerics extends TableGenerics> = {
32
32
  setColumnPinning: (updater: Updater<ColumnPinningState>) => void;
33
33
  resetColumnPinning: (defaultState?: boolean) => void;
34
- getIsSomeColumnsPinned: () => boolean;
34
+ getIsSomeColumnsPinned: (position?: ColumnPinningPosition) => boolean;
35
35
  getLeftLeafColumns: () => Column<TGenerics>[];
36
36
  getRightLeafColumns: () => Column<TGenerics>[];
37
37
  getCenterLeafColumns: () => Column<TGenerics>[];
@@ -8,6 +8,7 @@ import { FiltersColumn, FiltersColumnDef, FiltersInstance, FiltersOptions, Filte
8
8
  import { SortingColumn, SortingColumnDef, SortingInstance, SortingOptions, SortingTableState } from './features/Sorting';
9
9
  import { GroupingCell, GroupingColumn, GroupingColumnDef, GroupingInstance, GroupingOptions, GroupingRow, GroupingTableState } from './features/Grouping';
10
10
  import { ExpandedInstance, ExpandedOptions, ExpandedTableState, ExpandedRow } from './features/Expanding';
11
+ import { PartialKeys } from './utils';
11
12
  import { ColumnSizingColumn, ColumnSizingColumnDef, ColumnSizingHeader, ColumnSizingInstance, ColumnSizingOptions, ColumnSizingTableState } from './features/ColumnSizing';
12
13
  import { PaginationInitialTableState, PaginationInstance, PaginationOptions, PaginationTableState } from './features/Pagination';
13
14
  import { RowSelectionInstance, RowSelectionOptions, RowSelectionRow, RowSelectionTableState } from './features/RowSelection';
@@ -33,14 +34,15 @@ export declare type TableFeature = {
33
34
  getDefaultOptions?: (instance: any) => any;
34
35
  getInitialState?: (initialState?: InitialTableState) => any;
35
36
  createInstance?: (instance: any) => any;
36
- getDefaultColumn?: () => any;
37
+ getDefaultColumnDef?: () => any;
37
38
  createColumn?: (column: any, instance: any) => any;
38
39
  createHeader?: (column: any, instance: any) => any;
39
40
  createCell?: (cell: any, column: any, row: any, instance: any) => any;
40
41
  createRow?: (row: any, instance: any) => any;
41
42
  };
42
43
  export declare type TableInstance<TGenerics extends TableGenerics> = CoreInstance<TGenerics> & ColumnsInstance<TGenerics> & RowsInstance<TGenerics> & CellsInstance<TGenerics> & VisibilityInstance<TGenerics> & ColumnOrderInstance<TGenerics> & ColumnPinningInstance<TGenerics> & HeadersInstance<TGenerics> & FiltersInstance<TGenerics> & SortingInstance<TGenerics> & GroupingInstance<TGenerics> & ColumnSizingInstance<TGenerics> & ExpandedInstance<TGenerics> & PaginationInstance<TGenerics> & RowSelectionInstance<TGenerics>;
43
- export declare type TableOptions<TGenerics extends TableGenerics> = CoreOptions<TGenerics> & ColumnsOptions<TGenerics> & RowsOptions<TGenerics> & VisibilityOptions & ColumnOrderOptions & ColumnPinningOptions & FiltersOptions<TGenerics> & SortingOptions<TGenerics> & GroupingOptions<TGenerics> & ExpandedOptions<TGenerics> & ColumnSizingOptions & PaginationOptions<TGenerics> & RowSelectionOptions<TGenerics>;
44
+ export declare type TableOptionsResolved<TGenerics extends TableGenerics> = CoreOptions<TGenerics> & ColumnsOptions<TGenerics> & RowsOptions<TGenerics> & VisibilityOptions & ColumnOrderOptions & ColumnPinningOptions & FiltersOptions<TGenerics> & SortingOptions<TGenerics> & GroupingOptions<TGenerics> & ExpandedOptions<TGenerics> & ColumnSizingOptions & PaginationOptions<TGenerics> & RowSelectionOptions<TGenerics>;
45
+ export declare type TableOptions<TGenerics extends TableGenerics> = Omit<PartialKeys<TableOptionsResolved<TGenerics>, 'state' | 'onStateChange'>, 'render'>;
44
46
  export declare type TableState = CoreTableState & VisibilityTableState & ColumnOrderTableState & ColumnPinningTableState & FiltersTableState & SortingTableState & ExpandedTableState & GroupingTableState & ColumnSizingTableState & PaginationTableState & RowSelectionTableState;
45
47
  export declare type InitialTableState = Partial<CoreTableState & VisibilityTableState & ColumnOrderTableState & ColumnPinningTableState & FiltersTableState & SortingTableState & ExpandedTableState & GroupingTableState & ColumnSizingTableState & PaginationInitialTableState & RowSelectionTableState>;
46
48
  export declare type Row<TGenerics extends TableGenerics> = CoreRow<TGenerics> & CellsRow<TGenerics> & VisibilityRow<TGenerics> & ColumnPinningRow<TGenerics> & FiltersRow<TGenerics> & GroupingRow & RowSelectionRow & ExpandedRow;
@@ -55,7 +57,7 @@ export declare type RowModel<TGenerics extends TableGenerics> = {
55
57
  export declare type AccessorFn<TData> = (originalRow: TData, index: number) => any;
56
58
  export declare type Renderable<TGenerics extends TableGenerics, TProps> = string | ((props: TProps) => TGenerics['Rendered']);
57
59
  export declare type ColumnDef<TGenerics extends TableGenerics> = CoreColumnDef<TGenerics> & VisibilityColumnDef & ColumnPinningColumnDef & FiltersColumnDef<TGenerics> & SortingColumnDef<TGenerics> & GroupingColumnDef<TGenerics> & ColumnSizingColumnDef;
58
- export declare type Column<TGenerics extends TableGenerics> = ColumnDef<TGenerics> & CoreColumn<TGenerics> & ColumnVisibilityColumn & ColumnPinningColumn & FiltersColumn<TGenerics> & SortingColumn<TGenerics> & GroupingColumn<TGenerics> & ColumnSizingColumn<TGenerics>;
60
+ export declare type Column<TGenerics extends TableGenerics> = CoreColumn<TGenerics> & ColumnVisibilityColumn & ColumnPinningColumn & FiltersColumn<TGenerics> & SortingColumn<TGenerics> & GroupingColumn<TGenerics> & ColumnSizingColumn<TGenerics>;
59
61
  export declare type Cell<TGenerics extends TableGenerics> = CoreCell<TGenerics> & GroupingCell<TGenerics>;
60
62
  export declare type CoreCell<TGenerics extends TableGenerics> = {
61
63
  id: string;
@@ -95,7 +95,7 @@
95
95
  const Columns = {
96
96
  createInstance: instance => {
97
97
  return {
98
- getDefaultColumn: memo(() => [instance.options.defaultColumn], defaultColumn => {
98
+ getDefaultColumnDef: memo(() => [instance.options.defaultColumnDef], defaultColumn => {
99
99
  var _defaultColumn;
100
100
 
101
101
  defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
@@ -108,7 +108,7 @@
108
108
  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;
109
109
  },
110
110
  ...instance._features.reduce((obj, feature) => {
111
- return Object.assign(obj, feature.getDefaultColumn == null ? void 0 : feature.getDefaultColumn());
111
+ return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
112
112
  }, {}),
113
113
  ...defaultColumn
114
114
  };
@@ -118,13 +118,16 @@
118
118
 
119
119
  return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugColumns;
120
120
  },
121
- key: 'getDefaultColumn'
121
+ key: 'getDefaultColumnDef'
122
122
  }),
123
123
  getColumnDefs: () => instance.options.columns,
124
124
  createColumn: (columnDef, depth, parent) => {
125
125
  var _ref, _columnDef$id;
126
126
 
127
- const defaultColumn = instance.getDefaultColumn();
127
+ const defaultColumnDef = instance.getDefaultColumnDef();
128
+ columnDef = { ...defaultColumnDef,
129
+ ...columnDef
130
+ };
128
131
  let id = (_ref = (_columnDef$id = columnDef.id) != null ? _columnDef$id : columnDef.accessorKey) != null ? _ref : typeof columnDef.header === 'string' ? columnDef.header : undefined;
129
132
  let accessorFn;
130
133
 
@@ -140,8 +143,7 @@
140
143
  }
141
144
  }
142
145
 
143
- let column = { ...defaultColumn,
144
- ...columnDef,
146
+ let column = { ...columnDef,
145
147
  id: "" + id,
146
148
  accessorFn,
147
149
  parent: parent,
@@ -375,7 +377,7 @@
375
377
  row,
376
378
  column,
377
379
  getValue: () => row.getValue(columnId),
378
- renderCell: () => column.cell ? instance._render(column.cell, {
380
+ renderCell: () => column.columnDef.cell ? instance._render(column.columnDef.cell, {
379
381
  instance,
380
382
  column,
381
383
  row,
@@ -430,7 +432,7 @@
430
432
  });
431
433
 
432
434
  const ColumnSizing = {
433
- getDefaultColumn: () => {
435
+ getDefaultColumnDef: () => {
434
436
  return defaultColumnSizing;
435
437
  },
436
438
  getInitialState: state => {
@@ -450,10 +452,10 @@
450
452
  createColumn: (column, instance) => {
451
453
  return {
452
454
  getSize: () => {
453
- var _column$minSize, _ref, _column$maxSize;
455
+ var _column$columnDef$min, _ref, _column$columnDef$max;
454
456
 
455
457
  const columnSize = instance.getState().columnSizing[column.id];
456
- return Math.min(Math.max((_column$minSize = column.minSize) != null ? _column$minSize : defaultColumnSizing.minSize, (_ref = columnSize != null ? columnSize : column.size) != null ? _ref : defaultColumnSizing.size), (_column$maxSize = column.maxSize) != null ? _column$maxSize : defaultColumnSizing.maxSize);
458
+ return Math.min(Math.max((_column$columnDef$min = column.columnDef.minSize) != null ? _column$columnDef$min : defaultColumnSizing.minSize, (_ref = columnSize != null ? columnSize : column.columnDef.size) != null ? _ref : defaultColumnSizing.size), (_column$columnDef$max = column.columnDef.maxSize) != null ? _column$columnDef$max : defaultColumnSizing.maxSize);
457
459
  },
458
460
  getStart: position => {
459
461
  const columns = !position ? instance.getVisibleLeafColumns() : position === 'left' ? instance.getLeftVisibleLeafColumns() : instance.getRightVisibleLeafColumns();
@@ -476,9 +478,9 @@
476
478
  });
477
479
  },
478
480
  getCanResize: () => {
479
- var _column$enableResizin, _instance$options$ena;
481
+ var _column$columnDef$ena, _instance$options$ena;
480
482
 
481
- return ((_column$enableResizin = column.enableResizing) != null ? _column$enableResizin : true) && ((_instance$options$ena = instance.options.enableColumnResizing) != null ? _instance$options$ena : true);
483
+ return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableColumnResizing) != null ? _instance$options$ena : true);
482
484
  },
483
485
  getIsResizing: () => {
484
486
  return instance.getState().columnSizingInfo.isResizingColumn === column.id;
@@ -935,7 +937,7 @@
935
937
 
936
938
  //
937
939
  const Filters = {
938
- getDefaultColumn: () => {
940
+ getDefaultColumnDef: () => {
939
941
  return {
940
942
  filterFn: 'auto'
941
943
  };
@@ -978,6 +980,10 @@
978
980
  return filterFns.inNumberRange;
979
981
  }
980
982
 
983
+ if (typeof value === 'boolean') {
984
+ return filterFns.equals;
985
+ }
986
+
981
987
  if (value !== null && typeof value === 'object') {
982
988
  return filterFns.equals;
983
989
  }
@@ -995,14 +1001,14 @@
995
1001
  return isFunction(column.filterFn) ? column.filterFn : column.filterFn === 'auto' ? column.getAutoFilterFn() : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.filterFn]) != null ? _ref : filterFns[column.filterFn];
996
1002
  },
997
1003
  getCanFilter: () => {
998
- var _column$enableColumnF, _instance$options$ena, _instance$options$ena2;
1004
+ var _column$columnDef$ena, _instance$options$ena, _instance$options$ena2;
999
1005
 
1000
- return ((_column$enableColumnF = column.enableColumnFilter) != null ? _column$enableColumnF : true) && ((_instance$options$ena = instance.options.enableColumnFilters) != null ? _instance$options$ena : true) && ((_instance$options$ena2 = instance.options.enableFilters) != null ? _instance$options$ena2 : true) && !!column.accessorFn;
1006
+ return ((_column$columnDef$ena = column.columnDef.enableColumnFilter) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableColumnFilters) != null ? _instance$options$ena : true) && ((_instance$options$ena2 = instance.options.enableFilters) != null ? _instance$options$ena2 : true) && !!column.accessorFn;
1001
1007
  },
1002
1008
  getCanGlobalFilter: () => {
1003
- var _column$enableGlobalF, _instance$options$ena3, _instance$options$ena4, _instance$options$get;
1009
+ var _column$columnDef$ena2, _instance$options$ena3, _instance$options$ena4, _instance$options$get;
1004
1010
 
1005
- return ((_column$enableGlobalF = column.enableGlobalFilter) != null ? _column$enableGlobalF : true) && ((_instance$options$ena3 = instance.options.enableGlobalFilter) != null ? _instance$options$ena3 : true) && ((_instance$options$ena4 = instance.options.enableFilters) != null ? _instance$options$ena4 : true) && ((_instance$options$get = instance.options.getColumnCanGlobalFilter == null ? void 0 : instance.options.getColumnCanGlobalFilter(column)) != null ? _instance$options$get : true) && !!column.accessorFn;
1011
+ return ((_column$columnDef$ena2 = column.columnDef.enableGlobalFilter) != null ? _column$columnDef$ena2 : true) && ((_instance$options$ena3 = instance.options.enableGlobalFilter) != null ? _instance$options$ena3 : true) && ((_instance$options$ena4 = instance.options.enableFilters) != null ? _instance$options$ena4 : true) && ((_instance$options$get = instance.options.getColumnCanGlobalFilter == null ? void 0 : instance.options.getColumnCanGlobalFilter(column)) != null ? _instance$options$get : true) && !!column.accessorFn;
1006
1012
  },
1007
1013
  getIsFiltered: () => column.getFilterIndex() > -1,
1008
1014
  getFilterValue: () => {
@@ -1280,7 +1286,7 @@
1280
1286
 
1281
1287
  //
1282
1288
  const Grouping = {
1283
- getDefaultColumn: () => {
1289
+ getDefaultColumnDef: () => {
1284
1290
  return {
1285
1291
  aggregationFn: 'auto'
1286
1292
  };
@@ -1310,9 +1316,9 @@
1310
1316
  });
1311
1317
  },
1312
1318
  getCanGroup: () => {
1313
- var _ref, _ref2, _ref3, _column$enableGroupin;
1319
+ var _ref, _ref2, _ref3, _column$columnDef$ena;
1314
1320
 
1315
- return (_ref = (_ref2 = (_ref3 = (_column$enableGroupin = column.enableGrouping) != null ? _column$enableGroupin : true) != null ? _ref3 : instance.options.enableGrouping) != null ? _ref2 : true) != null ? _ref : !!column.accessorFn;
1321
+ return (_ref = (_ref2 = (_ref3 = (_column$columnDef$ena = column.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) != null ? _ref3 : instance.options.enableGrouping) != null ? _ref2 : true) != null ? _ref : !!column.accessorFn;
1316
1322
  },
1317
1323
  getIsGrouped: () => {
1318
1324
  var _instance$getState$gr;
@@ -1396,9 +1402,9 @@
1396
1402
  return !cell.getIsGrouped() && !cell.getIsPlaceholder() && ((_row$subRows = row.subRows) == null ? void 0 : _row$subRows.length) > 1;
1397
1403
  },
1398
1404
  renderAggregatedCell: () => {
1399
- var _column$aggregatedCel;
1405
+ var _column$columnDef$agg;
1400
1406
 
1401
- const template = (_column$aggregatedCel = column.aggregatedCell) != null ? _column$aggregatedCel : column.cell;
1407
+ const template = (_column$columnDef$agg = column.columnDef.aggregatedCell) != null ? _column$columnDef$agg : column.columnDef.cell;
1402
1408
  return template ? instance._render(template, {
1403
1409
  instance,
1404
1410
  column,
@@ -1705,9 +1711,9 @@
1705
1711
  getCanPin: () => {
1706
1712
  const leafColumns = column.getLeafColumns();
1707
1713
  return leafColumns.some(d => {
1708
- var _d$enablePinning, _instance$options$ena;
1714
+ var _d$columnDef$enablePi, _instance$options$ena;
1709
1715
 
1710
- return ((_d$enablePinning = d.enablePinning) != null ? _d$enablePinning : true) && ((_instance$options$ena = instance.options.enablePinning) != null ? _instance$options$ena : true);
1716
+ return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_instance$options$ena = instance.options.enablePinning) != null ? _instance$options$ena : true);
1711
1717
  });
1712
1718
  },
1713
1719
  getIsPinned: () => {
@@ -1777,12 +1783,18 @@
1777
1783
 
1778
1784
  return instance.setColumnPinning(defaultState ? getDefaultPinningState() : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.columnPinning) != null ? _instance$initialStat : getDefaultPinningState());
1779
1785
  },
1780
- getIsSomeColumnsPinned: () => {
1781
- const {
1782
- left,
1783
- right
1784
- } = instance.getState().columnPinning;
1785
- return Boolean((left == null ? void 0 : left.length) || (right == null ? void 0 : right.length));
1786
+ getIsSomeColumnsPinned: position => {
1787
+ var _pinningState$positio;
1788
+
1789
+ const pinningState = instance.getState().columnPinning;
1790
+
1791
+ if (!position) {
1792
+ var _pinningState$left, _pinningState$right;
1793
+
1794
+ return Boolean(((_pinningState$left = pinningState.left) == null ? void 0 : _pinningState$left.length) || ((_pinningState$right = pinningState.right) == null ? void 0 : _pinningState$right.length));
1795
+ }
1796
+
1797
+ return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
1786
1798
  },
1787
1799
  getLeftLeafColumns: memo(() => [instance.getAllLeafColumns(), instance.getState().columnPinning.left], (allColumns, left) => {
1788
1800
  return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
@@ -2308,7 +2320,7 @@
2308
2320
  ...state
2309
2321
  };
2310
2322
  },
2311
- getDefaultColumn: () => {
2323
+ getDefaultColumnDef: () => {
2312
2324
  return {
2313
2325
  sortingFn: 'auto'
2314
2326
  };
@@ -2368,7 +2380,7 @@
2368
2380
  throw new Error();
2369
2381
  }
2370
2382
 
2371
- return isFunction(column.sortingFn) ? column.sortingFn : column.sortingFn === 'auto' ? column.getAutoSortingFn() : (_ref = userSortingFn == null ? void 0 : userSortingFn[column.sortingFn]) != null ? _ref : sortingFns[column.sortingFn];
2383
+ return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : (_ref = userSortingFn == null ? void 0 : userSortingFn[column.columnDef.sortingFn]) != null ? _ref : sortingFns[column.columnDef.sortingFn];
2372
2384
  },
2373
2385
  toggleSorting: (desc, multi) => {
2374
2386
  // if (column.columns.length) {
@@ -2380,7 +2392,7 @@
2380
2392
  // return
2381
2393
  // }
2382
2394
  instance.setSorting(old => {
2383
- var _ref2, _column$sortDescFirst, _instance$options$ena, _instance$options$ena2;
2395
+ var _ref2, _column$columnDef$sor, _instance$options$ena, _instance$options$ena2;
2384
2396
 
2385
2397
  // Find any existing sorting for this column
2386
2398
  const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);
@@ -2407,7 +2419,7 @@
2407
2419
  }
2408
2420
  }
2409
2421
 
2410
- const sortDescFirst = (_ref2 = (_column$sortDescFirst = column.sortDescFirst) != null ? _column$sortDescFirst : instance.options.sortDescFirst) != null ? _ref2 : column.getAutoSortDir() === 'desc'; // Handle toggle states that will remove the sorting
2422
+ const sortDescFirst = (_ref2 = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : instance.options.sortDescFirst) != null ? _ref2 : column.getAutoSortDir() === 'desc'; // Handle toggle states that will remove the sorting
2411
2423
 
2412
2424
  if (sortAction === 'toggle' && ( // Must be toggling
2413
2425
  (_instance$options$ena = instance.options.enableSortingRemoval) != null ? _instance$options$ena : true) && // If enableSortRemove, enable in general
@@ -2451,14 +2463,14 @@
2451
2463
  });
2452
2464
  },
2453
2465
  getCanSort: () => {
2454
- var _column$enableSorting, _instance$options$ena3;
2466
+ var _column$columnDef$ena, _instance$options$ena3;
2455
2467
 
2456
- return ((_column$enableSorting = column.enableSorting) != null ? _column$enableSorting : true) && ((_instance$options$ena3 = instance.options.enableSorting) != null ? _instance$options$ena3 : true) && !!column.accessorFn;
2468
+ return ((_column$columnDef$ena = column.columnDef.enableSorting) != null ? _column$columnDef$ena : true) && ((_instance$options$ena3 = instance.options.enableSorting) != null ? _instance$options$ena3 : true) && !!column.accessorFn;
2457
2469
  },
2458
2470
  getCanMultiSort: () => {
2459
- var _ref3, _column$enableMultiSo;
2471
+ var _ref3, _column$columnDef$ena2;
2460
2472
 
2461
- return (_ref3 = (_column$enableMultiSo = column.enableMultiSort) != null ? _column$enableMultiSo : instance.options.enableMultiSort) != null ? _ref3 : !!column.accessorFn;
2473
+ return (_ref3 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : instance.options.enableMultiSort) != null ? _ref3 : !!column.accessorFn;
2462
2474
  },
2463
2475
  getIsSorted: () => {
2464
2476
  var _instance$getState$so;
@@ -2522,7 +2534,7 @@
2522
2534
  onColumnVisibilityChange: makeStateUpdater('columnVisibility', instance)
2523
2535
  };
2524
2536
  },
2525
- getDefaultColumn: () => {
2537
+ getDefaultColumnDef: () => {
2526
2538
  return {
2527
2539
  defaultIsVisible: true
2528
2540
  };
@@ -2542,9 +2554,9 @@
2542
2554
  return (_instance$getState$co = (_instance$getState$co2 = instance.getState().columnVisibility) == null ? void 0 : _instance$getState$co2[column.id]) != null ? _instance$getState$co : true;
2543
2555
  },
2544
2556
  getCanHide: () => {
2545
- var _column$enableHiding, _instance$options$ena;
2557
+ var _column$columnDef$ena, _instance$options$ena;
2546
2558
 
2547
- return ((_column$enableHiding = column.enableHiding) != null ? _column$enableHiding : true) && ((_instance$options$ena = instance.options.enableHiding) != null ? _instance$options$ena : true);
2559
+ return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableHiding) != null ? _instance$options$ena : true);
2548
2560
  },
2549
2561
  getToggleVisibilityHandler: () => {
2550
2562
  return e => {
@@ -2655,12 +2667,12 @@
2655
2667
  recurseHeader(header);
2656
2668
  return leafHeaders;
2657
2669
  },
2658
- renderHeader: () => column.header ? instance._render(column.header, {
2670
+ renderHeader: () => column.columnDef.header ? instance._render(column.columnDef.header, {
2659
2671
  instance,
2660
2672
  header: header,
2661
2673
  column
2662
2674
  }) : null,
2663
- renderFooter: () => column.footer ? instance._render(column.footer, {
2675
+ renderFooter: () => column.columnDef.footer ? instance._render(column.columnDef.footer, {
2664
2676
  instance,
2665
2677
  header: header,
2666
2678
  column
@@ -3168,7 +3180,7 @@
3168
3180
  throw new Error('');
3169
3181
  })()
3170
3182
  },
3171
- setGenerics: () => table,
3183
+ // setGenerics: () => table as any,
3172
3184
  setRowType: () => table,
3173
3185
  setTableMetaType: () => table,
3174
3186
  setColumnMetaType: () => table,
@@ -3204,7 +3216,8 @@
3204
3216
  }
3205
3217
 
3206
3218
  throw new Error('Invalid accessor');
3207
- }
3219
+ },
3220
+ createOptions: options => options
3208
3221
  };
3209
3222
  return table;
3210
3223
  }
@@ -3601,8 +3614,8 @@
3601
3614
  availableSorting.forEach(sortEntry => {
3602
3615
  const column = instance.getColumn(sortEntry.id);
3603
3616
  columnInfoById[sortEntry.id] = {
3604
- sortUndefined: column.sortUndefined,
3605
- invertSorting: column.invertSorting,
3617
+ sortUndefined: column.columnDef.sortUndefined,
3618
+ invertSorting: column.columnDef.invertSorting,
3606
3619
  sortingFn: column.getSortingFn()
3607
3620
  };
3608
3621
  });
@@ -3750,8 +3763,8 @@
3750
3763
  row.groupingValuesCache[columnId] = aggregateFn(() => leafRows.map(row => {
3751
3764
  let columnValue = row.getValue(columnId);
3752
3765
 
3753
- if (!depth && column.aggregateValue) {
3754
- columnValue = column.aggregateValue(columnValue);
3766
+ if (!depth && column.columnDef.aggregateValue) {
3767
+ columnValue = column.columnDef.aggregateValue(columnValue);
3755
3768
  }
3756
3769
 
3757
3770
  return columnValue;