@tanstack/table-core 8.0.0-alpha.55 → 8.0.0-alpha.59

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 (88) hide show
  1. package/build/cjs/core.js +18 -404
  2. package/build/cjs/core.js.map +1 -1
  3. package/build/cjs/createTable.js +3 -3
  4. package/build/cjs/createTable.js.map +1 -1
  5. package/build/cjs/features/Cells.js +107 -0
  6. package/build/cjs/features/Cells.js.map +1 -0
  7. package/build/cjs/features/ColumnSizing.js +96 -54
  8. package/build/cjs/features/ColumnSizing.js.map +1 -1
  9. package/build/cjs/features/Columns.js +216 -0
  10. package/build/cjs/features/Columns.js.map +1 -0
  11. package/build/cjs/features/Expanding.js +13 -21
  12. package/build/cjs/features/Expanding.js.map +1 -1
  13. package/build/cjs/features/Filters.js +3 -3
  14. package/build/cjs/features/Filters.js.map +1 -1
  15. package/build/cjs/features/Grouping.js +8 -11
  16. package/build/cjs/features/Grouping.js.map +1 -1
  17. package/build/cjs/features/Headers.js +79 -220
  18. package/build/cjs/features/Headers.js.map +1 -1
  19. package/build/cjs/features/Ordering.js +1 -1
  20. package/build/cjs/features/Ordering.js.map +1 -1
  21. package/build/cjs/features/Pagination.js +5 -5
  22. package/build/cjs/features/Pagination.js.map +1 -1
  23. package/build/cjs/features/Pinning.js +172 -2
  24. package/build/cjs/features/Pinning.js.map +1 -1
  25. package/build/cjs/features/RowSelection.js +16 -48
  26. package/build/cjs/features/RowSelection.js.map +1 -1
  27. package/build/cjs/features/Rows.js +84 -0
  28. package/build/cjs/features/Rows.js.map +1 -0
  29. package/build/cjs/features/Sorting.js +9 -12
  30. package/build/cjs/features/Sorting.js.map +1 -1
  31. package/build/cjs/features/Visibility.js +59 -38
  32. package/build/cjs/features/Visibility.js.map +1 -1
  33. package/build/cjs/filterFns.js +16 -0
  34. package/build/cjs/filterFns.js.map +1 -1
  35. package/build/cjs/index.js +0 -1
  36. package/build/cjs/index.js.map +1 -1
  37. package/build/cjs/utils.js +0 -16
  38. package/build/cjs/utils.js.map +1 -1
  39. package/build/esm/index.js +866 -856
  40. package/build/esm/index.js.map +1 -1
  41. package/build/stats-html.html +1 -1
  42. package/build/stats-react.json +424 -322
  43. package/build/types/core.d.ts +9 -88
  44. package/build/types/createTable.d.ts +10 -11
  45. package/build/types/features/Cells.d.ts +13 -0
  46. package/build/types/features/ColumnSizing.d.ts +24 -30
  47. package/build/types/features/Columns.d.ts +54 -0
  48. package/build/types/features/Expanding.d.ts +6 -9
  49. package/build/types/features/Filters.d.ts +3 -1
  50. package/build/types/features/Grouping.d.ts +6 -9
  51. package/build/types/features/Headers.d.ts +3 -15
  52. package/build/types/features/Ordering.d.ts +1 -1
  53. package/build/types/features/Pagination.d.ts +6 -6
  54. package/build/types/features/Pinning.d.ts +18 -4
  55. package/build/types/features/RowSelection.d.ts +6 -13
  56. package/build/types/features/Rows.d.ts +27 -0
  57. package/build/types/features/Sorting.d.ts +5 -8
  58. package/build/types/features/Visibility.d.ts +9 -7
  59. package/build/types/filterFns.d.ts +5 -0
  60. package/build/types/types.d.ts +27 -69
  61. package/build/types/utils.d.ts +1 -5
  62. package/build/umd/index.development.js +844 -835
  63. package/build/umd/index.development.js.map +1 -1
  64. package/build/umd/index.production.js +1 -1
  65. package/build/umd/index.production.js.map +1 -1
  66. package/package.json +1 -1
  67. package/src/core.ts +55 -601
  68. package/src/createTable.ts +13 -17
  69. package/src/features/Cells.ts +130 -0
  70. package/src/features/ColumnSizing.ts +111 -89
  71. package/src/features/Columns.ts +288 -0
  72. package/src/features/Expanding.ts +20 -42
  73. package/src/features/Filters.ts +11 -3
  74. package/src/features/Grouping.ts +13 -39
  75. package/src/features/Headers.ts +49 -233
  76. package/src/features/Ordering.ts +1 -1
  77. package/src/features/Pagination.ts +14 -4
  78. package/src/features/Pinning.ts +194 -3
  79. package/src/features/RowSelection.ts +26 -88
  80. package/src/features/Rows.ts +123 -0
  81. package/src/features/Sorting.ts +20 -43
  82. package/src/features/Visibility.ts +82 -63
  83. package/src/filterFns.ts +20 -0
  84. package/src/types.ts +59 -133
  85. package/src/utils/getColumnFilteredRowModelAsync.ts +1 -5
  86. package/src/utils/getGlobalFilteredRowModelAsync.ts +2 -6
  87. package/src/utils/getSortedRowModelAsync.ts +0 -1
  88. package/src/utils.ts +2 -31
@@ -104,13 +104,6 @@
104
104
  return typeof key === "symbol" ? key : String(key);
105
105
  }
106
106
 
107
- // export type DefinedGenericKeys<T extends TableGenerics> = {
108
- // [K in keyof T]: 0 extends 1 & T[K] ? never : T[K] extends {} ? K : never
109
- // }[keyof T]
110
- // export type DefinedGenerics<T extends TableGenerics> = Pick<
111
- // T,
112
- // DefinedGenericKeys<T>
113
- // >
114
107
  function functionalUpdate(updater, input) {
115
108
  return typeof updater === 'function' ? updater(input) : updater;
116
109
  }
@@ -171,14 +164,6 @@
171
164
  recurse(arr);
172
165
  return flat;
173
166
  }
174
- // @ts-ignore // Just rely on the type, not the implementation
175
- var propGetter = function propGetter(initial, getter) {
176
- if (isFunction(getter)) {
177
- return getter(initial);
178
- }
179
-
180
- return _extends({}, initial, getter != null ? getter : {});
181
- };
182
167
  function memo(getDeps, fn, opts) {
183
168
  var deps = [];
184
169
  var result;
@@ -367,11 +352,355 @@
367
352
  };
368
353
  } // opts?.onChange?.(result, oldResult)
369
354
 
355
+ //
356
+ var Columns = {
357
+ createInstance: function createInstance(instance) {
358
+ return {
359
+ getDefaultColumn: memo(function () {
360
+ return [instance.options.defaultColumn];
361
+ }, function (defaultColumn) {
362
+ var _defaultColumn;
363
+
364
+ defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
365
+ return _extends({
366
+ header: function header(props) {
367
+ return props.header.column.id;
368
+ },
369
+ footer: function footer(props) {
370
+ return props.header.column.id;
371
+ },
372
+ cell: function cell(_ref) {
373
+ var _ref$value = _ref.value,
374
+ value = _ref$value === void 0 ? '' : _ref$value;
375
+ return typeof value === 'boolean' ? value.toString() : value;
376
+ }
377
+ }, instance._features.reduce(function (obj, feature) {
378
+ return Object.assign(obj, feature.getDefaultColumn == null ? void 0 : feature.getDefaultColumn());
379
+ }, {}), defaultColumn);
380
+ }, {
381
+ debug: function debug() {
382
+ var _instance$options$deb;
383
+
384
+ return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugColumns;
385
+ },
386
+ key: 'getDefaultColumn'
387
+ }),
388
+ getColumnDefs: function getColumnDefs() {
389
+ return instance.options.columns;
390
+ },
391
+ createColumn: function createColumn(columnDef, depth, parent) {
392
+ var _ref2, _columnDef$id;
393
+
394
+ var defaultColumn = instance.getDefaultColumn();
395
+ var id = (_ref2 = (_columnDef$id = columnDef.id) != null ? _columnDef$id : columnDef.accessorKey) != null ? _ref2 : typeof columnDef.header === 'string' ? columnDef.header : undefined;
396
+ var accessorFn;
397
+
398
+ if (columnDef.accessorFn) {
399
+ accessorFn = columnDef.accessorFn;
400
+ } else if (columnDef.accessorKey) {
401
+ accessorFn = function accessorFn(originalRow) {
402
+ return originalRow[columnDef.accessorKey];
403
+ };
404
+ }
405
+
406
+ if (!id) {
407
+ {
408
+ throw new Error(columnDef.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header");
409
+ }
410
+ }
411
+
412
+ var column = _extends({}, defaultColumn, columnDef, {
413
+ id: "" + id,
414
+ accessorFn: accessorFn,
415
+ parent: parent,
416
+ depth: depth,
417
+ columnDef: columnDef,
418
+ columnDefType: columnDef.columnDefType,
419
+ columns: [],
420
+ getFlatColumns: memo(function () {
421
+ return [true];
422
+ }, function () {
423
+ var _column$columns;
424
+
425
+ return [column].concat((_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap(function (d) {
426
+ return d.getFlatColumns();
427
+ }));
428
+ }, {
429
+ key: 'column.getFlatColumns',
430
+ debug: function debug() {
431
+ var _instance$options$deb2;
432
+
433
+ return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugColumns;
434
+ }
435
+ }),
436
+ getLeafColumns: memo(function () {
437
+ return [instance._getOrderColumnsFn()];
438
+ }, function (orderColumns) {
439
+ var _column$columns2;
440
+
441
+ if ((_column$columns2 = column.columns) != null && _column$columns2.length) {
442
+ var leafColumns = column.columns.flatMap(function (column) {
443
+ return column.getLeafColumns();
444
+ });
445
+ return orderColumns(leafColumns);
446
+ }
447
+
448
+ return [column];
449
+ }, {
450
+ key: 'column.getLeafColumns',
451
+ debug: function debug() {
452
+ var _instance$options$deb3;
453
+
454
+ return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugColumns;
455
+ }
456
+ })
457
+ });
458
+
459
+ column = instance._features.reduce(function (obj, feature) {
460
+ return Object.assign(obj, feature.createColumn == null ? void 0 : feature.createColumn(column, instance));
461
+ }, column); // Yes, we have to convert instance to uknown, because we know more than the compiler here.
462
+
463
+ return column;
464
+ },
465
+ getAllColumns: memo(function () {
466
+ return [instance.getColumnDefs()];
467
+ }, function (columnDefs) {
468
+ var recurseColumns = function recurseColumns(columnDefs, parent, depth) {
469
+ if (depth === void 0) {
470
+ depth = 0;
471
+ }
472
+
473
+ return columnDefs.map(function (columnDef) {
474
+ var column = instance.createColumn(columnDef, depth, parent);
475
+ column.columns = columnDef.columns ? recurseColumns(columnDef.columns, column, depth + 1) : [];
476
+ return column;
477
+ });
478
+ };
479
+
480
+ return recurseColumns(columnDefs);
481
+ }, {
482
+ key: 'getAllColumns',
483
+ debug: function debug() {
484
+ var _instance$options$deb4;
485
+
486
+ return (_instance$options$deb4 = instance.options.debugAll) != null ? _instance$options$deb4 : instance.options.debugColumns;
487
+ }
488
+ }),
489
+ getAllFlatColumns: memo(function () {
490
+ return [instance.getAllColumns()];
491
+ }, function (allColumns) {
492
+ return allColumns.flatMap(function (column) {
493
+ return column.getFlatColumns();
494
+ });
495
+ }, {
496
+ key: 'getAllFlatColumns',
497
+ debug: function debug() {
498
+ var _instance$options$deb5;
499
+
500
+ return (_instance$options$deb5 = instance.options.debugAll) != null ? _instance$options$deb5 : instance.options.debugColumns;
501
+ }
502
+ }),
503
+ getAllFlatColumnsById: memo(function () {
504
+ return [instance.getAllFlatColumns()];
505
+ }, function (flatColumns) {
506
+ return flatColumns.reduce(function (acc, column) {
507
+ acc[column.id] = column;
508
+ return acc;
509
+ }, {});
510
+ }, {
511
+ key: 'getAllFlatColumnsById',
512
+ debug: function debug() {
513
+ var _instance$options$deb6;
514
+
515
+ return (_instance$options$deb6 = instance.options.debugAll) != null ? _instance$options$deb6 : instance.options.debugColumns;
516
+ }
517
+ }),
518
+ getAllLeafColumns: memo(function () {
519
+ return [instance.getAllColumns(), instance._getOrderColumnsFn()];
520
+ }, function (allColumns, orderColumns) {
521
+ var leafColumns = allColumns.flatMap(function (column) {
522
+ return column.getLeafColumns();
523
+ });
524
+ return orderColumns(leafColumns);
525
+ }, {
526
+ key: 'getAllLeafColumns',
527
+ debug: function debug() {
528
+ var _instance$options$deb7;
529
+
530
+ return (_instance$options$deb7 = instance.options.debugAll) != null ? _instance$options$deb7 : instance.options.debugColumns;
531
+ }
532
+ }),
533
+ getColumn: function getColumn(columnId) {
534
+ var column = instance.getAllFlatColumnsById()[columnId];
535
+
536
+ if (!column) {
537
+ {
538
+ console.warn("[Table] Column with id " + columnId + " does not exist.");
539
+ }
540
+
541
+ throw new Error();
542
+ }
543
+
544
+ return column;
545
+ }
546
+ };
547
+ }
548
+ };
549
+
550
+ //
551
+ var Rows = {
552
+ // createRow: <TGenerics extends TableGenerics>(
553
+ // row: Row<TGenerics>,
554
+ // instance: TableInstance<TGenerics>
555
+ // ): CellsRow<TGenerics> => {
556
+ // return {}
557
+ // },
558
+ createInstance: function createInstance(instance) {
559
+ return {
560
+ getRowId: function getRowId(row, index, parent) {
561
+ var _instance$options$get;
562
+
563
+ return (_instance$options$get = instance.options.getRowId == null ? void 0 : instance.options.getRowId(row, index, parent)) != null ? _instance$options$get : "" + (parent ? [parent.id, index].join('.') : index);
564
+ },
565
+ createRow: function createRow(id, original, rowIndex, depth, values) {
566
+ var row = {
567
+ id: id,
568
+ index: rowIndex,
569
+ original: original,
570
+ depth: depth,
571
+ values: values,
572
+ subRows: [],
573
+ getLeafRows: function getLeafRows() {
574
+ return flattenBy(row.subRows, function (d) {
575
+ return d.subRows;
576
+ });
577
+ }
578
+ };
579
+
580
+ for (var i = 0; i < instance._features.length; i++) {
581
+ var feature = instance._features[i];
582
+ Object.assign(row, feature.createRow == null ? void 0 : feature.createRow(row, instance));
583
+ }
584
+
585
+ return row;
586
+ },
587
+ getCoreRowModel: function getCoreRowModel() {
588
+ if (!instance._getCoreRowModel) {
589
+ instance._getCoreRowModel = instance.options.getCoreRowModel(instance);
590
+ }
591
+
592
+ return instance._getCoreRowModel();
593
+ },
594
+ // The final calls start at the bottom of the model,
595
+ // expanded rows, which then work their way up
596
+ getRowModel: function getRowModel() {
597
+ return instance.getPaginationRowModel();
598
+ },
599
+ getRow: function getRow(id) {
600
+ var row = instance.getRowModel().rowsById[id];
601
+
602
+ if (!row) {
603
+ {
604
+ throw new Error("getRow expected an ID, but got " + id);
605
+ }
606
+ }
607
+
608
+ return row;
609
+ }
610
+ };
611
+ }
612
+ };
613
+
614
+ //
615
+ var Cells = {
616
+ createRow: function createRow(row, instance) {
617
+ return {
618
+ getAllCells: memo(function () {
619
+ return [instance.getAllLeafColumns()];
620
+ }, function (leafColumns) {
621
+ return leafColumns.map(function (column) {
622
+ return instance.createCell(row, column, row.values[column.id]);
623
+ });
624
+ }, {
625
+ key: 'row.getAllCells' ,
626
+ debug: function debug() {
627
+ var _instance$options$deb;
628
+
629
+ return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugRows;
630
+ }
631
+ }),
632
+ getAllCellsByColumnId: memo(function () {
633
+ return [row.getAllCells()];
634
+ }, function (allCells) {
635
+ return allCells.reduce(function (acc, cell) {
636
+ acc[cell.columnId] = cell;
637
+ return acc;
638
+ }, {});
639
+ }, {
640
+ key: 'row.getAllCellsByColumnId',
641
+ debug: function debug() {
642
+ var _instance$options$deb2;
643
+
644
+ return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugRows;
645
+ }
646
+ })
647
+ };
648
+ },
649
+ createInstance: function createInstance(instance) {
650
+ return {
651
+ createCell: function createCell(row, column, value) {
652
+ var cell = {
653
+ id: row.id + "_" + column.id,
654
+ rowId: row.id,
655
+ columnId: column.id,
656
+ row: row,
657
+ column: column,
658
+ value: value,
659
+ renderCell: function renderCell() {
660
+ return column.cell ? instance.render(column.cell, {
661
+ instance: instance,
662
+ column: column,
663
+ row: row,
664
+ cell: cell,
665
+ value: value
666
+ }) : null;
667
+ }
668
+ };
669
+
670
+ instance._features.forEach(function (feature) {
671
+ Object.assign(cell, feature.createCell == null ? void 0 : feature.createCell(cell, column, row, instance));
672
+ }, {});
673
+
674
+ return cell;
675
+ },
676
+ getCell: function getCell(rowId, columnId) {
677
+ var row = instance.getRow(rowId);
678
+
679
+ if (!row) {
680
+ {
681
+ throw new Error("[Table] could not find row with id " + rowId);
682
+ }
683
+ }
684
+
685
+ var cell = row.getAllCellsByColumnId()[columnId];
686
+
687
+ if (!cell) {
688
+ {
689
+ throw new Error("[Table] could not find cell " + columnId + " in row " + rowId);
690
+ }
691
+ }
692
+
693
+ return cell;
694
+ }
695
+ };
696
+ }
697
+ };
698
+
370
699
  //
371
700
  var defaultColumnSizing = {
372
- width: 150,
373
- minWidth: 20,
374
- maxWidth: Number.MAX_SAFE_INTEGER
701
+ size: 150,
702
+ minSize: 20,
703
+ maxSize: Number.MAX_SAFE_INTEGER
375
704
  };
376
705
  var ColumnSizing = {
377
706
  getDefaultColumn: function getDefaultColumn() {
@@ -397,10 +726,45 @@
397
726
  onColumnSizingInfoChange: makeStateUpdater('columnSizingInfo', instance)
398
727
  };
399
728
  },
400
- getInstance: function getInstance(instance) {
729
+ createColumn: function createColumn(column, instance) {
730
+ return {
731
+ getSize: function getSize() {
732
+ return instance.getColumnSize(column.id);
733
+ },
734
+ getStart: function getStart(position) {
735
+ return instance.getColumnStart(column.id, position);
736
+ },
737
+ getIsResizing: function getIsResizing() {
738
+ return instance.getColumnIsResizing(column.id);
739
+ },
740
+ getCanResize: function getCanResize() {
741
+ return instance.getColumnCanResize(column.id);
742
+ },
743
+ resetSize: function resetSize() {
744
+ return instance.resetColumnSize(column.id);
745
+ }
746
+ };
747
+ },
748
+ createHeader: function createHeader(header, instance) {
749
+ return {
750
+ getIsResizing: function getIsResizing() {
751
+ return instance.getColumnIsResizing(header.column.id);
752
+ },
753
+ getCanResize: function getCanResize() {
754
+ return instance.getColumnCanResize(header.column.id);
755
+ },
756
+ resetSize: function resetSize() {
757
+ return instance.resetColumnSize(header.column.id);
758
+ },
759
+ getResizeHandler: function getResizeHandler() {
760
+ return instance.getResizeHandler(header.id);
761
+ }
762
+ };
763
+ },
764
+ createInstance: function createInstance(instance) {
401
765
  return {
402
- getColumnWidth: function getColumnWidth(columnId) {
403
- var _column$minWidth, _ref, _column$maxWidth;
766
+ getColumnSize: function getColumnSize(columnId) {
767
+ var _column$minSize, _ref, _column$maxSize;
404
768
 
405
769
  var column = instance.getColumn(columnId);
406
770
 
@@ -409,7 +773,26 @@
409
773
  }
410
774
 
411
775
  var columnSize = instance.getState().columnSizing[column.id];
412
- return Math.min(Math.max((_column$minWidth = column.minWidth) != null ? _column$minWidth : defaultColumnSizing.minWidth, (_ref = columnSize != null ? columnSize : column.width) != null ? _ref : defaultColumnSizing.width), (_column$maxWidth = column.maxWidth) != null ? _column$maxWidth : defaultColumnSizing.maxWidth);
776
+ 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);
777
+ },
778
+ getColumnStart: function getColumnStart(columnId, position) {
779
+ var column = instance.getColumn(columnId);
780
+
781
+ if (!column) {
782
+ throw new Error();
783
+ }
784
+
785
+ var columns = !position ? instance.getVisibleLeafColumns() : position === 'left' ? instance.getLeftVisibleLeafColumns() : instance.getRightVisibleLeafColumns();
786
+ var index = columns.findIndex(function (d) {
787
+ return d.id === columnId;
788
+ });
789
+
790
+ if (index > 0) {
791
+ var prevSiblingColumn = columns[index - 1];
792
+ return instance.getColumnStart(prevSiblingColumn.id, position) + prevSiblingColumn.getSize();
793
+ }
794
+
795
+ return 0;
413
796
  },
414
797
  setColumnSizing: function setColumnSizing(updater) {
415
798
  return instance.options.onColumnSizingChange == null ? void 0 : instance.options.onColumnSizingChange(updater);
@@ -477,12 +860,16 @@
477
860
 
478
861
  return instance.getColumnIsResizing(header.column.id);
479
862
  },
480
- getHeaderResizerProps: function getHeaderResizerProps(headerId, userProps) {
863
+ getResizeHandler: function getResizeHandler(headerId) {
481
864
  var header = instance.getHeader(headerId);
482
865
  var column = instance.getColumn(header.column.id);
483
866
  var canResize = column.getCanResize();
867
+ return function (e) {
868
+ if (!canResize) {
869
+ return;
870
+ }
871
+ e.persist == null ? void 0 : e.persist();
484
872
 
485
- var onResizeStart = function onResizeStart(e) {
486
873
  if (isTouchStartEvent(e)) {
487
874
  // lets not respond to multiple touches (e.g. 2 or 3 fingers)
488
875
  if (e.touches && e.touches.length > 1) {
@@ -491,10 +878,10 @@
491
878
  }
492
879
 
493
880
  var header = headerId ? instance.getHeader(headerId) : undefined;
494
- var startSize = header ? header.getWidth() : column.getWidth();
881
+ var startSize = header ? header.getSize() : column.getSize();
495
882
  var columnSizingStart = header ? header.getLeafHeaders().map(function (d) {
496
- return [d.column.id, d.getWidth()];
497
- }) : [[column.id, column.getWidth()]];
883
+ return [d.column.id, d.getSize()];
884
+ }) : [[column.id, column.getSize()]];
498
885
  var clientX = isTouchStartEvent(e) ? Math.round(e.touches[0].clientX) : e.clientX;
499
886
 
500
887
  var updateOffset = function updateOffset(eventType, clientXPos) {
@@ -510,8 +897,8 @@
510
897
  var deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
511
898
  old.columnSizingStart.forEach(function (_ref5) {
512
899
  var columnId = _ref5[0],
513
- headerWidth = _ref5[1];
514
- newColumnSizing[columnId] = Math.round(Math.max(headerWidth + headerWidth * deltaPercentage, 0) * 100) / 100;
900
+ headerSize = _ref5[1];
901
+ newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
515
902
  });
516
903
  return _extends({}, old, {
517
904
  deltaOffset: deltaOffset,
@@ -599,50 +986,34 @@
599
986
  });
600
987
  });
601
988
  };
602
-
603
- var initialProps = canResize ? {
604
- title: 'Toggle Grouping',
605
- draggable: false,
606
- role: 'separator',
607
- onMouseDown: function onMouseDown(e) {
608
- e.persist == null ? void 0 : e.persist();
609
- onResizeStart(e);
610
- },
611
- onTouchStart: function onTouchStart(e) {
612
- e.persist == null ? void 0 : e.persist();
613
- onResizeStart(e);
614
- }
615
- } : {};
616
- return propGetter(initialProps, userProps);
617
- }
618
- };
619
- },
620
- createColumn: function createColumn(column, instance) {
621
- return {
622
- getIsResizing: function getIsResizing() {
623
- return instance.getColumnIsResizing(column.id);
624
- },
625
- getCanResize: function getCanResize() {
626
- return instance.getColumnCanResize(column.id);
627
989
  },
628
- resetSize: function resetSize() {
629
- return instance.resetColumnSize(column.id);
630
- }
631
- };
632
- },
633
- createHeader: function createHeader(header, instance) {
634
- return {
635
- getIsResizing: function getIsResizing() {
636
- return instance.getColumnIsResizing(header.column.id);
990
+ getTotalSize: function getTotalSize() {
991
+ var _instance$getHeaderGr, _instance$getHeaderGr2;
992
+
993
+ return (_instance$getHeaderGr = (_instance$getHeaderGr2 = instance.getHeaderGroups()[0]) == null ? void 0 : _instance$getHeaderGr2.headers.reduce(function (sum, header) {
994
+ return sum + header.getSize();
995
+ }, 0)) != null ? _instance$getHeaderGr : 0;
637
996
  },
638
- getCanResize: function getCanResize() {
639
- return instance.getColumnCanResize(header.column.id);
997
+ getLeftTotalSize: function getLeftTotalSize() {
998
+ var _instance$getLeftHead, _instance$getLeftHead2;
999
+
1000
+ return (_instance$getLeftHead = (_instance$getLeftHead2 = instance.getLeftHeaderGroups()[0]) == null ? void 0 : _instance$getLeftHead2.headers.reduce(function (sum, header) {
1001
+ return sum + header.getSize();
1002
+ }, 0)) != null ? _instance$getLeftHead : 0;
640
1003
  },
641
- resetSize: function resetSize() {
642
- return instance.resetColumnSize(header.column.id);
1004
+ getCenterTotalSize: function getCenterTotalSize() {
1005
+ var _instance$getCenterHe, _instance$getCenterHe2;
1006
+
1007
+ return (_instance$getCenterHe = (_instance$getCenterHe2 = instance.getCenterHeaderGroups()[0]) == null ? void 0 : _instance$getCenterHe2.headers.reduce(function (sum, header) {
1008
+ return sum + header.getSize();
1009
+ }, 0)) != null ? _instance$getCenterHe : 0;
643
1010
  },
644
- getResizerProps: function getResizerProps(userProps) {
645
- return instance.getHeaderResizerProps(header.id, userProps);
1011
+ getRightTotalSize: function getRightTotalSize() {
1012
+ var _instance$getRightHea, _instance$getRightHea2;
1013
+
1014
+ return (_instance$getRightHea = (_instance$getRightHea2 = instance.getRightHeaderGroups()[0]) == null ? void 0 : _instance$getRightHea2.headers.reduce(function (sum, header) {
1015
+ return sum + header.getSize();
1016
+ }, 0)) != null ? _instance$getRightHea : 0;
646
1017
  }
647
1018
  };
648
1019
  }
@@ -692,7 +1063,7 @@
692
1063
  paginateExpandedRows: true
693
1064
  };
694
1065
  },
695
- getInstance: function getInstance(instance) {
1066
+ createInstance: function createInstance(instance) {
696
1067
  var registered = false;
697
1068
  return {
698
1069
  queueResetExpanded: function queueResetExpanded() {
@@ -797,7 +1168,7 @@
797
1168
  return instance.getRowCanExpand(id);
798
1169
  });
799
1170
  },
800
- getToggleExpandedProps: function getToggleExpandedProps(rowId, userProps) {
1171
+ getToggleExpandedHandler: function getToggleExpandedHandler(rowId) {
801
1172
  var row = instance.getRow(rowId);
802
1173
 
803
1174
  if (!row) {
@@ -805,24 +1176,16 @@
805
1176
  }
806
1177
 
807
1178
  var canExpand = instance.getRowCanExpand(rowId);
808
- var initialProps = {
809
- title: canExpand ? 'Toggle Expanded' : undefined,
810
- onClick: canExpand ? function (e) {
811
- e.persist == null ? void 0 : e.persist();
812
- instance.toggleRowExpanded(rowId);
813
- } : undefined
1179
+ return function () {
1180
+ if (!canExpand) return;
1181
+ instance.toggleRowExpanded(rowId);
814
1182
  };
815
- return propGetter(initialProps, userProps);
816
- },
817
- getToggleAllRowsExpandedProps: function getToggleAllRowsExpandedProps(userProps) {
818
- var initialProps = {
819
- title: 'Toggle All Expanded',
820
- onClick: function onClick(e) {
821
- e.persist == null ? void 0 : e.persist();
822
- instance.toggleAllRowsExpanded();
823
- }
1183
+ },
1184
+ getToggleAllRowsExpandedHandler: function getToggleAllRowsExpandedHandler() {
1185
+ return function (e) {
1186
+ e.persist == null ? void 0 : e.persist();
1187
+ instance.toggleAllRowsExpanded();
824
1188
  };
825
- return propGetter(initialProps, userProps);
826
1189
  },
827
1190
  getIsSomeRowsExpanded: function getIsSomeRowsExpanded() {
828
1191
  var expanded = instance.getState().expanded;
@@ -862,7 +1225,7 @@
862
1225
  instance._getExpandedRowModel = instance.options.getExpandedRowModel(instance);
863
1226
  }
864
1227
 
865
- if (!instance._getExpandedRowModel) {
1228
+ if (instance.options.manualExpanding || !instance._getExpandedRowModel) {
866
1229
  return instance.getPreExpandedRowModel();
867
1230
  }
868
1231
 
@@ -881,8 +1244,8 @@
881
1244
  getCanExpand: function getCanExpand() {
882
1245
  return row.subRows && !!row.subRows.length;
883
1246
  },
884
- getToggleExpandedProps: function getToggleExpandedProps(userProps) {
885
- return instance.getToggleExpandedProps(row.id, userProps);
1247
+ getToggleExpandedHandler: function getToggleExpandedHandler() {
1248
+ return instance.getToggleExpandedHandler(row.id);
886
1249
  }
887
1250
  };
888
1251
  }
@@ -895,6 +1258,7 @@
895
1258
  equalsStringSensitive: equalsStringSensitive,
896
1259
  arrIncludes: arrIncludes,
897
1260
  arrIncludesAll: arrIncludesAll,
1261
+ arrIncludesSome: arrIncludesSome,
898
1262
  equals: equals,
899
1263
  weakEquals: weakEquals,
900
1264
  betweenNumberRange: betweenNumberRange
@@ -984,20 +1348,35 @@
984
1348
  return testFalsey(val) || !(val != null && val.length);
985
1349
  };
986
1350
 
987
- function equals(rows, columnIds, filterValue) {
1351
+ function arrIncludesSome(rows, columnIds, filterValue) {
988
1352
  return rows.filter(function (row) {
989
1353
  return columnIds.some(function (id) {
990
1354
  var rowValue = row.values[id];
991
- return rowValue === filterValue;
1355
+ return rowValue && rowValue.length && filterValue.some(function (val) {
1356
+ return rowValue.includes(val);
1357
+ });
992
1358
  });
993
1359
  });
994
1360
  }
995
1361
 
996
- equals.autoRemove = function (val) {
997
- return testFalsey(val);
1362
+ arrIncludesSome.autoRemove = function (val) {
1363
+ return testFalsey(val) || !(val != null && val.length);
998
1364
  };
999
1365
 
1000
- function weakEquals(rows, columnIds, filterValue) {
1366
+ function equals(rows, columnIds, filterValue) {
1367
+ return rows.filter(function (row) {
1368
+ return columnIds.some(function (id) {
1369
+ var rowValue = row.values[id];
1370
+ return rowValue === filterValue;
1371
+ });
1372
+ });
1373
+ }
1374
+
1375
+ equals.autoRemove = function (val) {
1376
+ return testFalsey(val);
1377
+ };
1378
+
1379
+ function weakEquals(rows, columnIds, filterValue) {
1001
1380
  return rows.filter(function (row) {
1002
1381
  return columnIds.some(function (id) {
1003
1382
  var rowValue = row.values[id]; // eslint-disable-next-line eqeqeq
@@ -1151,7 +1530,7 @@
1151
1530
  }
1152
1531
  };
1153
1532
  },
1154
- getInstance: function getInstance(instance) {
1533
+ createInstance: function createInstance(instance) {
1155
1534
  var registered = false;
1156
1535
  return {
1157
1536
  queueResetFilters: function queueResetFilters() {
@@ -1353,7 +1732,7 @@
1353
1732
  instance._getColumnFilteredRowModel = instance.options.getColumnFilteredRowModel(instance);
1354
1733
  }
1355
1734
 
1356
- if (!instance._getColumnFilteredRowModel) {
1735
+ if (instance.options.manualColumnFiltering || !instance._getColumnFilteredRowModel) {
1357
1736
  return instance.getPreColumnFilteredRowModel();
1358
1737
  }
1359
1738
 
@@ -1367,7 +1746,7 @@
1367
1746
  instance._getGlobalFilteredRowModel = instance.options.getGlobalFilteredRowModel(instance);
1368
1747
  }
1369
1748
 
1370
- if (!instance._getGlobalFilteredRowModel) {
1749
+ if (instance.options.manualGlobalFiltering || !instance._getGlobalFilteredRowModel) {
1371
1750
  return instance.getPreGlobalFilteredRowModel();
1372
1751
  }
1373
1752
 
@@ -1528,12 +1907,12 @@
1528
1907
  toggleGrouping: function toggleGrouping() {
1529
1908
  return instance.toggleColumnGrouping(column.id);
1530
1909
  },
1531
- getToggleGroupingProps: function getToggleGroupingProps(userProps) {
1532
- return instance.getToggleGroupingProps(column.id, userProps);
1910
+ getToggleGroupingHandler: function getToggleGroupingHandler() {
1911
+ return instance.getToggleGroupingHandler(column.id);
1533
1912
  }
1534
1913
  };
1535
1914
  },
1536
- getInstance: function getInstance(instance) {
1915
+ createInstance: function createInstance(instance) {
1537
1916
  var registered = false;
1538
1917
  return {
1539
1918
  queueResetGrouping: function queueResetGrouping() {
@@ -1619,16 +1998,13 @@
1619
1998
 
1620
1999
  instance.setGrouping((_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.grouping) != null ? _instance$initialStat : []);
1621
2000
  },
1622
- getToggleGroupingProps: function getToggleGroupingProps(columnId, userProps) {
2001
+ getToggleGroupingHandler: function getToggleGroupingHandler(columnId) {
1623
2002
  var column = instance.getColumn(columnId);
1624
2003
  var canGroup = column.getCanGroup();
1625
- var initialProps = {
1626
- title: canGroup ? 'Toggle Grouping' : undefined,
1627
- onClick: canGroup ? function (e) {
1628
- column.toggleGrouping == null ? void 0 : column.toggleGrouping();
1629
- } : undefined
2004
+ return function () {
2005
+ if (!canGroup) return;
2006
+ column.toggleGrouping == null ? void 0 : column.toggleGrouping();
1630
2007
  };
1631
- return propGetter(initialProps, userProps);
1632
2008
  },
1633
2009
  getRowIsGrouped: function getRowIsGrouped(rowId) {
1634
2010
  var _instance$getRow;
@@ -1643,7 +2019,7 @@
1643
2019
  instance._getGroupedRowModel = instance.options.getGroupedRowModel(instance);
1644
2020
  }
1645
2021
 
1646
- if (!instance._getGroupedRowModel) {
2022
+ if (instance.options.manualGrouping || !instance._getGroupedRowModel) {
1647
2023
  return instance.getPreGroupedRowModel();
1648
2024
  }
1649
2025
 
@@ -1719,7 +2095,7 @@
1719
2095
  onColumnOrderChange: makeStateUpdater('columnOrder', instance)
1720
2096
  };
1721
2097
  },
1722
- getInstance: function getInstance(instance) {
2098
+ createInstance: function createInstance(instance) {
1723
2099
  return {
1724
2100
  setColumnOrder: function setColumnOrder(updater) {
1725
2101
  return instance.options.onColumnOrderChange == null ? void 0 : instance.options.onColumnOrderChange(updater);
@@ -1776,13 +2152,13 @@
1776
2152
 
1777
2153
  //
1778
2154
  var Pagination = {
1779
- getInitialState: function getInitialState() {
2155
+ getInitialState: function getInitialState(initialState) {
1780
2156
  return {
1781
- pagination: {
2157
+ pagination: _extends({
1782
2158
  pageCount: -1,
1783
2159
  pageIndex: 0,
1784
2160
  pageSize: 10
1785
- }
2161
+ }, initialState == null ? void 0 : initialState.pagination)
1786
2162
  };
1787
2163
  },
1788
2164
  getDefaultOptions: function getDefaultOptions(instance) {
@@ -1791,7 +2167,7 @@
1791
2167
  autoResetPageIndex: true
1792
2168
  };
1793
2169
  },
1794
- getInstance: function getInstance(instance) {
2170
+ createInstance: function createInstance(instance) {
1795
2171
  var registered = false;
1796
2172
  return {
1797
2173
  queueResetPageIndex: function queueResetPageIndex() {
@@ -1922,7 +2298,7 @@
1922
2298
  instance._getPaginationRowModel = instance.options.getPaginationRowModel(instance);
1923
2299
  }
1924
2300
 
1925
- if (!instance._getPaginationRowModel) {
2301
+ if (instance.options.manualPagination || !instance._getPaginationRowModel) {
1926
2302
  return instance.getPrePaginationRowModel();
1927
2303
  }
1928
2304
 
@@ -1972,7 +2348,129 @@
1972
2348
  }
1973
2349
  };
1974
2350
  },
1975
- getInstance: function getInstance(instance) {
2351
+ createRow: function createRow(row, instance) {
2352
+ return {
2353
+ getCenterVisibleCells: memo(function () {
2354
+ return [row._getAllVisibleCells(), instance.getState().columnPinning.left, instance.getState().columnPinning.right];
2355
+ }, function (allCells, left, right) {
2356
+ var leftAndRight = [].concat(left != null ? left : [], right != null ? right : []);
2357
+ return allCells.filter(function (d) {
2358
+ return !leftAndRight.includes(d.columnId);
2359
+ });
2360
+ }, {
2361
+ key: 'row.getCenterVisibleCells',
2362
+ debug: function debug() {
2363
+ var _instance$options$deb;
2364
+
2365
+ return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugRows;
2366
+ }
2367
+ }),
2368
+ getLeftVisibleCells: memo(function () {
2369
+ return [row._getAllVisibleCells(), instance.getState().columnPinning.left,,];
2370
+ }, function (allCells, left) {
2371
+ var cells = (left != null ? left : []).map(function (columnId) {
2372
+ return allCells.find(function (cell) {
2373
+ return cell.columnId === columnId;
2374
+ });
2375
+ }).filter(Boolean).map(function (d) {
2376
+ return _extends({}, d, {
2377
+ position: 'left'
2378
+ });
2379
+ });
2380
+ return cells;
2381
+ }, {
2382
+ key: 'row.getLeftVisibleCells',
2383
+ debug: function debug() {
2384
+ var _instance$options$deb2;
2385
+
2386
+ return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugRows;
2387
+ }
2388
+ }),
2389
+ getRightVisibleCells: memo(function () {
2390
+ return [row._getAllVisibleCells(), instance.getState().columnPinning.right];
2391
+ }, function (allCells, right) {
2392
+ var cells = (right != null ? right : []).map(function (columnId) {
2393
+ return allCells.find(function (cell) {
2394
+ return cell.columnId === columnId;
2395
+ });
2396
+ }).filter(Boolean).map(function (d) {
2397
+ return _extends({}, d, {
2398
+ position: 'left'
2399
+ });
2400
+ });
2401
+ return cells;
2402
+ }, {
2403
+ key: 'row.getRightVisibleCells',
2404
+ debug: function debug() {
2405
+ var _instance$options$deb3;
2406
+
2407
+ return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugRows;
2408
+ }
2409
+ })
2410
+ };
2411
+ },
2412
+ createCell: function createCell(cell, instance) {
2413
+ return {
2414
+ getCenterVisibleCells: memo(function () {
2415
+ return [cell.row._getAllVisibleCells(), instance.getState().columnPinning.left, instance.getState().columnPinning.right];
2416
+ }, function (allCells, left, right) {
2417
+ var leftAndRight = [].concat(left != null ? left : [], right != null ? right : []);
2418
+ return allCells.filter(function (d) {
2419
+ return !leftAndRight.includes(d.columnId);
2420
+ });
2421
+ }, {
2422
+ key: 'row.getCenterVisibleCells',
2423
+ debug: function debug() {
2424
+ var _instance$options$deb4;
2425
+
2426
+ return (_instance$options$deb4 = instance.options.debugAll) != null ? _instance$options$deb4 : instance.options.debugRows;
2427
+ }
2428
+ }),
2429
+ getLeftVisibleCells: memo(function () {
2430
+ return [cell.row._getAllVisibleCells(), instance.getState().columnPinning.left,,];
2431
+ }, function (allCells, left) {
2432
+ var cells = (left != null ? left : []).map(function (columnId) {
2433
+ return allCells.find(function (cell) {
2434
+ return cell.columnId === columnId;
2435
+ });
2436
+ }).filter(Boolean).map(function (d) {
2437
+ return _extends({}, d, {
2438
+ position: 'left'
2439
+ });
2440
+ });
2441
+ return cells;
2442
+ }, {
2443
+ key: 'row.getLeftVisibleCells',
2444
+ debug: function debug() {
2445
+ var _instance$options$deb5;
2446
+
2447
+ return (_instance$options$deb5 = instance.options.debugAll) != null ? _instance$options$deb5 : instance.options.debugRows;
2448
+ }
2449
+ }),
2450
+ getRightVisibleCells: memo(function () {
2451
+ return [cell.row._getAllVisibleCells(), instance.getState().columnPinning.right];
2452
+ }, function (allCells, right) {
2453
+ var cells = (right != null ? right : []).map(function (columnId) {
2454
+ return allCells.find(function (cell) {
2455
+ return cell.columnId === columnId;
2456
+ });
2457
+ }).filter(Boolean).map(function (d) {
2458
+ return _extends({}, d, {
2459
+ position: 'left'
2460
+ });
2461
+ });
2462
+ return cells;
2463
+ }, {
2464
+ key: 'row.getRightVisibleCells',
2465
+ debug: function debug() {
2466
+ var _instance$options$deb6;
2467
+
2468
+ return (_instance$options$deb6 = instance.options.debugAll) != null ? _instance$options$deb6 : instance.options.debugRows;
2469
+ }
2470
+ })
2471
+ };
2472
+ },
2473
+ createInstance: function createInstance(instance) {
1976
2474
  return {
1977
2475
  setColumnPinning: function setColumnPinning(updater) {
1978
2476
  return instance.options.onColumnPinningChange == null ? void 0 : instance.options.onColumnPinningChange(updater);
@@ -2072,7 +2570,54 @@
2072
2570
  left = _instance$getState$co5.left,
2073
2571
  right = _instance$getState$co5.right;
2074
2572
  return Boolean((left == null ? void 0 : left.length) || (right == null ? void 0 : right.length));
2075
- }
2573
+ },
2574
+ getLeftLeafColumns: memo(function () {
2575
+ return [instance.getAllLeafColumns(), instance.getState().columnPinning.left];
2576
+ }, function (allColumns, left) {
2577
+ return (left != null ? left : []).map(function (columnId) {
2578
+ return allColumns.find(function (column) {
2579
+ return column.id === columnId;
2580
+ });
2581
+ }).filter(Boolean);
2582
+ }, {
2583
+ key: 'getLeftLeafColumns',
2584
+ debug: function debug() {
2585
+ var _instance$options$deb7;
2586
+
2587
+ return (_instance$options$deb7 = instance.options.debugAll) != null ? _instance$options$deb7 : instance.options.debugColumns;
2588
+ }
2589
+ }),
2590
+ getRightLeafColumns: memo(function () {
2591
+ return [instance.getAllLeafColumns(), instance.getState().columnPinning.right];
2592
+ }, function (allColumns, right) {
2593
+ return (right != null ? right : []).map(function (columnId) {
2594
+ return allColumns.find(function (column) {
2595
+ return column.id === columnId;
2596
+ });
2597
+ }).filter(Boolean);
2598
+ }, {
2599
+ key: 'getRightLeafColumns',
2600
+ debug: function debug() {
2601
+ var _instance$options$deb8;
2602
+
2603
+ return (_instance$options$deb8 = instance.options.debugAll) != null ? _instance$options$deb8 : instance.options.debugColumns;
2604
+ }
2605
+ }),
2606
+ getCenterLeafColumns: memo(function () {
2607
+ return [instance.getAllLeafColumns(), instance.getState().columnPinning.left, instance.getState().columnPinning.right];
2608
+ }, function (allColumns, left, right) {
2609
+ var leftAndRight = [].concat(left != null ? left : [], right != null ? right : []);
2610
+ return allColumns.filter(function (d) {
2611
+ return !leftAndRight.includes(d.id);
2612
+ });
2613
+ }, {
2614
+ key: 'getCenterLeafColumns',
2615
+ debug: function debug() {
2616
+ var _instance$options$deb9;
2617
+
2618
+ return (_instance$options$deb9 = instance.options.debugAll) != null ? _instance$options$deb9 : instance.options.debugColumns;
2619
+ }
2620
+ })
2076
2621
  };
2077
2622
  }
2078
2623
  };
@@ -2096,7 +2641,7 @@
2096
2641
 
2097
2642
  };
2098
2643
  },
2099
- getInstance: function getInstance(instance) {
2644
+ createInstance: function createInstance(instance) {
2100
2645
  var registered = false; // const pageRows = instance.getPageRows()
2101
2646
 
2102
2647
  return {
@@ -2423,59 +2968,27 @@
2423
2968
  var paginationFlatRows = instance.getPaginationRowModel().flatRows;
2424
2969
  return instance.getIsAllPageRowsSelected() ? false : !!(paginationFlatRows != null && paginationFlatRows.length);
2425
2970
  },
2426
- getToggleRowSelectedProps: function getToggleRowSelectedProps(rowId, userProps) {
2971
+ getToggleRowSelectedHandler: function getToggleRowSelectedHandler(rowId) {
2427
2972
  var row = instance.getRow(rowId);
2428
- var isSelected = row.getIsSelected();
2429
- var isSomeSelected = row.getIsSomeSelected();
2973
+ row.getIsSelected();
2974
+ row.getIsSomeSelected();
2430
2975
  var canSelect = row.getCanSelect();
2431
- var initialProps = {
2432
- onChange: canSelect ? function (e) {
2433
- row.toggleSelected(e.target.checked);
2434
- } : undefined,
2435
- checked: isSelected,
2436
- title: 'Toggle Row Selected',
2437
- indeterminate: isSomeSelected // onChange: forInput
2438
- // ? (e: Event) => e.stopPropagation()
2439
- // : (e: Event) => {
2440
- // if (instance.options.isAdditiveSelectEvent(e)) {
2441
- // row.toggleSelected()
2442
- // } else if (instance.options.isInclusiveSelectEvent(e)) {
2443
- // instance.addRowSelectionRange(row.id)
2444
- // } else {
2445
- // instance.setRowSelection({})
2446
- // row.toggleSelected()
2447
- // }
2448
- // if (props.onClick) props.onClick(e)
2449
- // },
2976
+ return function (e) {
2977
+ var _target;
2450
2978
 
2979
+ if (!canSelect) return;
2980
+ row.toggleSelected((_target = e.target) == null ? void 0 : _target.checked);
2451
2981
  };
2452
- return propGetter(initialProps, userProps);
2453
- },
2454
- getToggleAllRowsSelectedProps: function getToggleAllRowsSelectedProps(userProps) {
2455
- var isSomeRowsSelected = instance.getIsSomeRowsSelected();
2456
- var isAllRowsSelected = instance.getIsAllRowsSelected();
2457
- var initialProps = {
2458
- onChange: function onChange(e) {
2459
- instance.toggleAllRowsSelected(e.target.checked);
2460
- },
2461
- checked: isAllRowsSelected,
2462
- title: 'Toggle All Rows Selected',
2463
- indeterminate: isSomeRowsSelected
2982
+ },
2983
+ getToggleAllRowsSelectedHandler: function getToggleAllRowsSelectedHandler() {
2984
+ return function (e) {
2985
+ instance.toggleAllRowsSelected(e.target.checked);
2464
2986
  };
2465
- return propGetter(initialProps, userProps);
2466
- },
2467
- getToggleAllPageRowsSelectedProps: function getToggleAllPageRowsSelectedProps(userProps) {
2468
- var isSomePageRowsSelected = instance.getIsSomePageRowsSelected();
2469
- var isAllPageRowsSelected = instance.getIsAllPageRowsSelected();
2470
- var initialProps = {
2471
- onChange: function onChange(e) {
2472
- instance.toggleAllPageRowsSelected(e.target.checked);
2473
- },
2474
- checked: isAllPageRowsSelected,
2475
- title: 'Toggle All Current Page Rows Selected',
2476
- indeterminate: isSomePageRowsSelected
2987
+ },
2988
+ getToggleAllPageRowsSelectedHandler: function getToggleAllPageRowsSelectedHandler() {
2989
+ return function (e) {
2990
+ instance.toggleAllPageRowsSelected(e.target.checked);
2477
2991
  };
2478
- return propGetter(initialProps, userProps);
2479
2992
  }
2480
2993
  };
2481
2994
  },
@@ -2490,8 +3003,8 @@
2490
3003
  toggleSelected: function toggleSelected(value) {
2491
3004
  return instance.toggleRowSelected(row.id, value);
2492
3005
  },
2493
- getToggleSelectedProps: function getToggleSelectedProps(userProps) {
2494
- return instance.getToggleRowSelectedProps(row.id, userProps);
3006
+ getToggleSelectedHandler: function getToggleSelectedHandler() {
3007
+ return instance.getToggleRowSelectedHandler(row.id);
2495
3008
  },
2496
3009
  getCanMultiSelect: function getCanMultiSelect() {
2497
3010
  return instance.getRowCanMultiSelect(row.id);
@@ -2734,12 +3247,12 @@
2734
3247
  toggleSorting: function toggleSorting(desc, isMulti) {
2735
3248
  return instance.toggleColumnSorting(column.id, desc, isMulti);
2736
3249
  },
2737
- getToggleSortingProps: function getToggleSortingProps(userProps) {
2738
- return instance.getToggleSortingProps(column.id, userProps);
3250
+ getToggleSortingHandler: function getToggleSortingHandler() {
3251
+ return instance.getToggleSortingHandler(column.id);
2739
3252
  }
2740
3253
  };
2741
3254
  },
2742
- getInstance: function getInstance(instance) {
3255
+ createInstance: function createInstance(instance) {
2743
3256
  var registered = false;
2744
3257
  return {
2745
3258
  queueResetSorting: function queueResetSorting() {
@@ -2955,7 +3468,7 @@
2955
3468
  instance.setSorting((_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.sorting) != null ? _instance$initialStat : []);
2956
3469
  }
2957
3470
  },
2958
- getToggleSortingProps: function getToggleSortingProps(columnId, userProps) {
3471
+ getToggleSortingHandler: function getToggleSortingHandler(columnId) {
2959
3472
  var column = instance.getColumn(columnId);
2960
3473
 
2961
3474
  if (!column) {
@@ -2963,14 +3476,11 @@
2963
3476
  }
2964
3477
 
2965
3478
  var canSort = column.getCanSort();
2966
- var initialProps = {
2967
- title: canSort ? 'Toggle Sorting' : undefined,
2968
- onClick: canSort ? function (e) {
2969
- e.persist == null ? void 0 : e.persist();
2970
- column.toggleSorting == null ? void 0 : column.toggleSorting(undefined, column.getCanMultiSort() ? instance.options.isMultiSortEvent == null ? void 0 : instance.options.isMultiSortEvent(e) : false);
2971
- } : undefined
3479
+ return function (e) {
3480
+ if (!canSort) return;
3481
+ e.persist == null ? void 0 : e.persist();
3482
+ column.toggleSorting == null ? void 0 : column.toggleSorting(undefined, column.getCanMultiSort() ? instance.options.isMultiSortEvent == null ? void 0 : instance.options.isMultiSortEvent(e) : false);
2972
3483
  };
2973
- return propGetter(initialProps, userProps);
2974
3484
  },
2975
3485
  getPreSortedRowModel: function getPreSortedRowModel() {
2976
3486
  return instance.getGlobalFilteredRowModel();
@@ -2980,7 +3490,7 @@
2980
3490
  instance._getSortedRowModel = instance.options.getSortedRowModel(instance);
2981
3491
  }
2982
3492
 
2983
- if (!instance._getSortedRowModel) {
3493
+ if (instance.options.manualSorting || !instance._getSortedRowModel) {
2984
3494
  return instance.getPreSortedRowModel();
2985
3495
  }
2986
3496
 
@@ -3018,56 +3528,84 @@
3018
3528
  toggleVisibility: function toggleVisibility(value) {
3019
3529
  return instance.toggleColumnVisibility(column.id, value);
3020
3530
  },
3021
- getToggleVisibilityProps: function getToggleVisibilityProps(userProps) {
3022
- var props = {
3023
- type: 'checkbox',
3024
- checked: column.getIsVisible == null ? void 0 : column.getIsVisible(),
3025
- title: 'Toggle Column Visibility',
3026
- onChange: function onChange(e) {
3027
- column.toggleVisibility == null ? void 0 : column.toggleVisibility(e.target.checked);
3028
- }
3531
+ getToggleVisibilityHandler: function getToggleVisibilityHandler() {
3532
+ return function (e) {
3533
+ column.toggleVisibility == null ? void 0 : column.toggleVisibility(e.target.checked);
3029
3534
  };
3030
- return propGetter(props, userProps);
3031
3535
  }
3032
3536
  };
3033
3537
  },
3034
- getInstance: function getInstance(instance) {
3538
+ createRow: function createRow(row, instance) {
3035
3539
  return {
3036
- getVisibleFlatColumns: memo(function () {
3037
- return [instance.getAllFlatColumns(), instance.getAllFlatColumns().filter(function (d) {
3038
- return d.getIsVisible == null ? void 0 : d.getIsVisible();
3540
+ _getAllVisibleCells: memo(function () {
3541
+ return [row.getAllCells().filter(function (cell) {
3542
+ return cell.column.getIsVisible();
3039
3543
  }).map(function (d) {
3040
3544
  return d.id;
3041
3545
  }).join('_')];
3042
- }, function (allFlatColumns) {
3043
- return allFlatColumns.filter(function (d) {
3044
- return d.getIsVisible == null ? void 0 : d.getIsVisible();
3546
+ }, function (_) {
3547
+ return row.getAllCells().filter(function (cell) {
3548
+ return cell.column.getIsVisible();
3045
3549
  });
3046
3550
  }, {
3047
- key: 'getVisibleFlatColumns',
3551
+ key: 'row._getAllVisibleCells',
3048
3552
  debug: function debug() {
3049
3553
  var _instance$options$deb;
3050
3554
 
3051
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugColumns;
3555
+ return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugRows;
3052
3556
  }
3053
3557
  }),
3054
- getVisibleLeafColumns: memo(function () {
3055
- return [instance.getAllLeafColumns(), instance.getAllLeafColumns().filter(function (d) {
3056
- return d.getIsVisible == null ? void 0 : d.getIsVisible();
3558
+ getVisibleCells: memo(function () {
3559
+ return [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()];
3560
+ }, function (left, center, right) {
3561
+ return [].concat(left, center, right);
3562
+ }, {
3563
+ key: 'row.getVisibleCells',
3564
+ debug: function debug() {
3565
+ var _instance$options$deb2;
3566
+
3567
+ return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugRows;
3568
+ }
3569
+ })
3570
+ };
3571
+ },
3572
+ createInstance: function createInstance(instance) {
3573
+ var makeVisibleColumnsMethod = function makeVisibleColumnsMethod(key, getColumns) {
3574
+ return memo(function () {
3575
+ return [getColumns(), getColumns().filter(function (d) {
3576
+ return d.getIsVisible();
3057
3577
  }).map(function (d) {
3058
3578
  return d.id;
3059
3579
  }).join('_')];
3060
- }, function (allFlatColumns) {
3061
- return allFlatColumns.filter(function (d) {
3580
+ }, function (columns) {
3581
+ return columns.filter(function (d) {
3062
3582
  return d.getIsVisible == null ? void 0 : d.getIsVisible();
3063
3583
  });
3064
3584
  }, {
3065
- key: 'getVisibleLeafColumns',
3585
+ key: key,
3066
3586
  debug: function debug() {
3067
- var _instance$options$deb2;
3587
+ var _instance$options$deb3;
3068
3588
 
3069
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugColumns;
3589
+ return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugColumns;
3070
3590
  }
3591
+ });
3592
+ };
3593
+
3594
+ return {
3595
+ getVisibleFlatColumns: makeVisibleColumnsMethod('getVisibleFlatColumns', function () {
3596
+ return instance.getAllFlatColumns();
3597
+ }),
3598
+ getVisibleLeafColumns: makeVisibleColumnsMethod('getVisibleLeafColumns', function () {
3599
+ return instance.getAllLeafColumns();
3600
+ }),
3601
+ getLeftVisibleLeafColumns: makeVisibleColumnsMethod('getLeftVisibleLeafColumns', function () {
3602
+ return instance.getLeftLeafColumns();
3603
+ }),
3604
+ getRightVisibleLeafColumns: makeVisibleColumnsMethod('getRightVisibleLeafColumns', function () {
3605
+ return instance.getRightLeafColumns();
3606
+ }),
3607
+ getCenterVisibleLeafColumns: makeVisibleColumnsMethod('getCenterVisibleLeafColumns', function () {
3608
+ return instance.getCenterLeafColumns();
3071
3609
  }),
3072
3610
  setColumnVisibility: function setColumnVisibility(updater) {
3073
3611
  return instance.options.onColumnVisibilityChange == null ? void 0 : instance.options.onColumnVisibilityChange(updater);
@@ -3125,19 +3663,12 @@
3125
3663
  return column.getIsVisible == null ? void 0 : column.getIsVisible();
3126
3664
  });
3127
3665
  },
3128
- getToggleAllColumnsVisibilityProps: function getToggleAllColumnsVisibilityProps(userProps) {
3129
- var props = {
3130
- onChange: function onChange(e) {
3131
- var _e$target;
3666
+ getToggleAllColumnsVisibilityHandler: function getToggleAllColumnsVisibilityHandler() {
3667
+ return function (e) {
3668
+ var _target;
3132
3669
 
3133
- instance.toggleAllColumnsVisible((_e$target = e.target) == null ? void 0 : _e$target.checked);
3134
- },
3135
- type: 'checkbox',
3136
- title: 'Toggle visibility for all columns',
3137
- checked: instance.getIsAllColumnsVisible(),
3138
- indeterminate: !instance.getIsAllColumnsVisible() && instance.getIsSomeColumnsVisible() ? 'indeterminate' : undefined
3670
+ instance.toggleAllColumnsVisible((_target = e.target) == null ? void 0 : _target.checked);
3139
3671
  };
3140
- return propGetter(props, userProps);
3141
3672
  }
3142
3673
  };
3143
3674
  }
@@ -3145,90 +3676,7 @@
3145
3676
 
3146
3677
  //
3147
3678
  var Headers = {
3148
- createRow: function createRow(row, instance) {
3149
- return {
3150
- _getAllVisibleCells: memo(function () {
3151
- return [row.getAllCells().filter(function (cell) {
3152
- return cell.column.getIsVisible();
3153
- }).map(function (d) {
3154
- return d.id;
3155
- }).join('_')];
3156
- }, function (_) {
3157
- return row.getAllCells().filter(function (cell) {
3158
- return cell.column.getIsVisible();
3159
- });
3160
- }, {
3161
- key: 'row._getAllVisibleCells',
3162
- debug: function debug() {
3163
- var _instance$options$deb;
3164
-
3165
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugRows;
3166
- }
3167
- }),
3168
- getVisibleCells: memo(function () {
3169
- return [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()];
3170
- }, function (left, center, right) {
3171
- return [].concat(left, center, right);
3172
- }, {
3173
- key: 'row.getVisibleCells',
3174
- debug: function debug() {
3175
- var _instance$options$deb2;
3176
-
3177
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugRows;
3178
- }
3179
- }),
3180
- getCenterVisibleCells: memo(function () {
3181
- return [row._getAllVisibleCells(), instance.getState().columnPinning.left, instance.getState().columnPinning.right];
3182
- }, function (allCells, left, right) {
3183
- var leftAndRight = [].concat(left != null ? left : [], right != null ? right : []);
3184
- return allCells.filter(function (d) {
3185
- return !leftAndRight.includes(d.columnId);
3186
- });
3187
- }, {
3188
- key: 'row.getCenterVisibleCells',
3189
- debug: function debug() {
3190
- var _instance$options$deb3;
3191
-
3192
- return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugRows;
3193
- }
3194
- }),
3195
- getLeftVisibleCells: memo(function () {
3196
- return [row._getAllVisibleCells(), instance.getState().columnPinning.left,,];
3197
- }, function (allCells, left) {
3198
- var cells = (left != null ? left : []).map(function (columnId) {
3199
- return allCells.find(function (cell) {
3200
- return cell.columnId === columnId;
3201
- });
3202
- }).filter(Boolean);
3203
- return cells;
3204
- }, {
3205
- key: 'row.getLeftVisibleCells',
3206
- debug: function debug() {
3207
- var _instance$options$deb4;
3208
-
3209
- return (_instance$options$deb4 = instance.options.debugAll) != null ? _instance$options$deb4 : instance.options.debugRows;
3210
- }
3211
- }),
3212
- getRightVisibleCells: memo(function () {
3213
- return [row._getAllVisibleCells(), instance.getState().columnPinning.right];
3214
- }, function (allCells, right) {
3215
- var cells = (right != null ? right : []).map(function (columnId) {
3216
- return allCells.find(function (cell) {
3217
- return cell.columnId === columnId;
3218
- });
3219
- }).filter(Boolean);
3220
- return cells;
3221
- }, {
3222
- key: 'row.getRightVisibleCells',
3223
- debug: function debug() {
3224
- var _instance$options$deb5;
3225
-
3226
- return (_instance$options$deb5 = instance.options.debugAll) != null ? _instance$options$deb5 : instance.options.debugRows;
3227
- }
3228
- })
3229
- };
3230
- },
3231
- getInstance: function getInstance(instance) {
3679
+ createInstance: function createInstance(instance) {
3232
3680
  return {
3233
3681
  createHeader: function createHeader(column, options) {
3234
3682
  var _options$id;
@@ -3237,28 +3685,38 @@
3237
3685
  var header = {
3238
3686
  id: id,
3239
3687
  column: column,
3688
+ index: options.index,
3240
3689
  isPlaceholder: options.isPlaceholder,
3241
3690
  placeholderId: options.placeholderId,
3242
3691
  depth: options.depth,
3243
3692
  subHeaders: [],
3244
3693
  colSpan: 0,
3245
3694
  rowSpan: 0,
3246
- getWidth: function getWidth() {
3695
+ headerGroup: null,
3696
+ getSize: function getSize() {
3247
3697
  var sum = 0;
3248
3698
 
3249
3699
  var recurse = function recurse(header) {
3250
3700
  if (header.subHeaders.length) {
3251
3701
  header.subHeaders.forEach(recurse);
3252
3702
  } else {
3253
- var _header$column$getWid;
3703
+ var _header$column$getSiz;
3254
3704
 
3255
- sum += (_header$column$getWid = header.column.getWidth()) != null ? _header$column$getWid : 0;
3705
+ sum += (_header$column$getSiz = header.column.getSize()) != null ? _header$column$getSiz : 0;
3256
3706
  }
3257
3707
  };
3258
3708
 
3259
3709
  recurse(header);
3260
3710
  return sum;
3261
3711
  },
3712
+ getStart: function getStart() {
3713
+ if (header.index > 0) {
3714
+ var prevSiblingHeader = header.headerGroup.headers[header.index - 1];
3715
+ return prevSiblingHeader.getStart() + prevSiblingHeader.getSize();
3716
+ }
3717
+
3718
+ return 0;
3719
+ },
3262
3720
  getLeafHeaders: function getLeafHeaders() {
3263
3721
  var leafHeaders = [];
3264
3722
 
@@ -3273,12 +3731,6 @@
3273
3731
  recurseHeader(header);
3274
3732
  return leafHeaders;
3275
3733
  },
3276
- getHeaderProps: function getHeaderProps(userProps) {
3277
- return instance.getHeaderProps(header.id, userProps);
3278
- },
3279
- getFooterProps: function getFooterProps(userProps) {
3280
- return instance.getFooterProps(header.id, userProps);
3281
- },
3282
3734
  renderHeader: function renderHeader() {
3283
3735
  return column.header ? instance.render(column.header, {
3284
3736
  instance: instance,
@@ -3293,9 +3745,13 @@
3293
3745
  column: column
3294
3746
  }) : null;
3295
3747
  }
3296
- }; // Yes, we have to convert instance to unknown, because we know more than the compiler here.
3748
+ };
3297
3749
 
3298
- return Object.assign(header, ColumnSizing.createHeader(header, instance));
3750
+ instance._features.forEach(function (feature) {
3751
+ Object.assign(header, feature.createHeader == null ? void 0 : feature.createHeader(header, instance));
3752
+ });
3753
+
3754
+ return header;
3299
3755
  },
3300
3756
  // Header Groups
3301
3757
  getHeaderGroups: memo(function () {
@@ -3315,9 +3771,9 @@
3315
3771
  }, {
3316
3772
  key: 'getHeaderGroups',
3317
3773
  debug: function debug() {
3318
- var _instance$options$deb6;
3774
+ var _instance$options$deb;
3319
3775
 
3320
- return (_instance$options$deb6 = instance.options.debugAll) != null ? _instance$options$deb6 : instance.options.debugHeaders;
3776
+ return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugHeaders;
3321
3777
  }
3322
3778
  }),
3323
3779
  getCenterHeaderGroups: memo(function () {
@@ -3330,9 +3786,9 @@
3330
3786
  }, {
3331
3787
  key: 'getCenterHeaderGroups',
3332
3788
  debug: function debug() {
3333
- var _instance$options$deb7;
3789
+ var _instance$options$deb2;
3334
3790
 
3335
- return (_instance$options$deb7 = instance.options.debugAll) != null ? _instance$options$deb7 : instance.options.debugHeaders;
3791
+ return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugHeaders;
3336
3792
  }
3337
3793
  }),
3338
3794
  getLeftHeaderGroups: memo(function () {
@@ -3345,9 +3801,9 @@
3345
3801
  }, {
3346
3802
  key: 'getLeftHeaderGroups',
3347
3803
  debug: function debug() {
3348
- var _instance$options$deb8;
3804
+ var _instance$options$deb3;
3349
3805
 
3350
- return (_instance$options$deb8 = instance.options.debugAll) != null ? _instance$options$deb8 : instance.options.debugHeaders;
3806
+ return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugHeaders;
3351
3807
  }
3352
3808
  }),
3353
3809
  getRightHeaderGroups: memo(function () {
@@ -3360,9 +3816,9 @@
3360
3816
  }, {
3361
3817
  key: 'getRightHeaderGroups',
3362
3818
  debug: function debug() {
3363
- var _instance$options$deb9;
3819
+ var _instance$options$deb4;
3364
3820
 
3365
- return (_instance$options$deb9 = instance.options.debugAll) != null ? _instance$options$deb9 : instance.options.debugHeaders;
3821
+ return (_instance$options$deb4 = instance.options.debugAll) != null ? _instance$options$deb4 : instance.options.debugHeaders;
3366
3822
  }
3367
3823
  }),
3368
3824
  // Footer Groups
@@ -3373,9 +3829,9 @@
3373
3829
  }, {
3374
3830
  key: 'getFooterGroups',
3375
3831
  debug: function debug() {
3376
- var _instance$options$deb10;
3832
+ var _instance$options$deb5;
3377
3833
 
3378
- return (_instance$options$deb10 = instance.options.debugAll) != null ? _instance$options$deb10 : instance.options.debugHeaders;
3834
+ return (_instance$options$deb5 = instance.options.debugAll) != null ? _instance$options$deb5 : instance.options.debugHeaders;
3379
3835
  }
3380
3836
  }),
3381
3837
  getLeftFooterGroups: memo(function () {
@@ -3385,9 +3841,9 @@
3385
3841
  }, {
3386
3842
  key: 'getLeftFooterGroups',
3387
3843
  debug: function debug() {
3388
- var _instance$options$deb11;
3844
+ var _instance$options$deb6;
3389
3845
 
3390
- return (_instance$options$deb11 = instance.options.debugAll) != null ? _instance$options$deb11 : instance.options.debugHeaders;
3846
+ return (_instance$options$deb6 = instance.options.debugAll) != null ? _instance$options$deb6 : instance.options.debugHeaders;
3391
3847
  }
3392
3848
  }),
3393
3849
  getCenterFooterGroups: memo(function () {
@@ -3397,9 +3853,9 @@
3397
3853
  }, {
3398
3854
  key: 'getCenterFooterGroups',
3399
3855
  debug: function debug() {
3400
- var _instance$options$deb12;
3856
+ var _instance$options$deb7;
3401
3857
 
3402
- return (_instance$options$deb12 = instance.options.debugAll) != null ? _instance$options$deb12 : instance.options.debugHeaders;
3858
+ return (_instance$options$deb7 = instance.options.debugAll) != null ? _instance$options$deb7 : instance.options.debugHeaders;
3403
3859
  }
3404
3860
  }),
3405
3861
  getRightFooterGroups: memo(function () {
@@ -3409,9 +3865,9 @@
3409
3865
  }, {
3410
3866
  key: 'getRightFooterGroups',
3411
3867
  debug: function debug() {
3412
- var _instance$options$deb13;
3868
+ var _instance$options$deb8;
3413
3869
 
3414
- return (_instance$options$deb13 = instance.options.debugAll) != null ? _instance$options$deb13 : instance.options.debugHeaders;
3870
+ return (_instance$options$deb8 = instance.options.debugAll) != null ? _instance$options$deb8 : instance.options.debugHeaders;
3415
3871
  }
3416
3872
  }),
3417
3873
  // Flat Headers
@@ -3424,9 +3880,9 @@
3424
3880
  }, {
3425
3881
  key: 'getFlatHeaders',
3426
3882
  debug: function debug() {
3427
- var _instance$options$deb14;
3883
+ var _instance$options$deb9;
3428
3884
 
3429
- return (_instance$options$deb14 = instance.options.debugAll) != null ? _instance$options$deb14 : instance.options.debugHeaders;
3885
+ return (_instance$options$deb9 = instance.options.debugAll) != null ? _instance$options$deb9 : instance.options.debugHeaders;
3430
3886
  }
3431
3887
  }),
3432
3888
  getLeftFlatHeaders: memo(function () {
@@ -3438,9 +3894,9 @@
3438
3894
  }, {
3439
3895
  key: 'getLeftFlatHeaders',
3440
3896
  debug: function debug() {
3441
- var _instance$options$deb15;
3897
+ var _instance$options$deb10;
3442
3898
 
3443
- return (_instance$options$deb15 = instance.options.debugAll) != null ? _instance$options$deb15 : instance.options.debugHeaders;
3899
+ return (_instance$options$deb10 = instance.options.debugAll) != null ? _instance$options$deb10 : instance.options.debugHeaders;
3444
3900
  }
3445
3901
  }),
3446
3902
  getCenterFlatHeaders: memo(function () {
@@ -3452,9 +3908,9 @@
3452
3908
  }, {
3453
3909
  key: 'getCenterFlatHeaders',
3454
3910
  debug: function debug() {
3455
- var _instance$options$deb16;
3911
+ var _instance$options$deb11;
3456
3912
 
3457
- return (_instance$options$deb16 = instance.options.debugAll) != null ? _instance$options$deb16 : instance.options.debugHeaders;
3913
+ return (_instance$options$deb11 = instance.options.debugAll) != null ? _instance$options$deb11 : instance.options.debugHeaders;
3458
3914
  }
3459
3915
  }),
3460
3916
  getRightFlatHeaders: memo(function () {
@@ -3466,9 +3922,9 @@
3466
3922
  }, {
3467
3923
  key: 'getRightFlatHeaders',
3468
3924
  debug: function debug() {
3469
- var _instance$options$deb17;
3925
+ var _instance$options$deb12;
3470
3926
 
3471
- return (_instance$options$deb17 = instance.options.debugAll) != null ? _instance$options$deb17 : instance.options.debugHeaders;
3927
+ return (_instance$options$deb12 = instance.options.debugAll) != null ? _instance$options$deb12 : instance.options.debugHeaders;
3472
3928
  }
3473
3929
  }),
3474
3930
  // Leaf Headers
@@ -3483,9 +3939,9 @@
3483
3939
  }, {
3484
3940
  key: 'getCenterLeafHeaders',
3485
3941
  debug: function debug() {
3486
- var _instance$options$deb18;
3942
+ var _instance$options$deb13;
3487
3943
 
3488
- return (_instance$options$deb18 = instance.options.debugAll) != null ? _instance$options$deb18 : instance.options.debugHeaders;
3944
+ return (_instance$options$deb13 = instance.options.debugAll) != null ? _instance$options$deb13 : instance.options.debugHeaders;
3489
3945
  }
3490
3946
  }),
3491
3947
  getLeftLeafHeaders: memo(function () {
@@ -3499,9 +3955,9 @@
3499
3955
  }, {
3500
3956
  key: 'getLeftLeafHeaders',
3501
3957
  debug: function debug() {
3502
- var _instance$options$deb19;
3958
+ var _instance$options$deb14;
3503
3959
 
3504
- return (_instance$options$deb19 = instance.options.debugAll) != null ? _instance$options$deb19 : instance.options.debugHeaders;
3960
+ return (_instance$options$deb14 = instance.options.debugAll) != null ? _instance$options$deb14 : instance.options.debugHeaders;
3505
3961
  }
3506
3962
  }),
3507
3963
  getRightLeafHeaders: memo(function () {
@@ -3515,9 +3971,9 @@
3515
3971
  }, {
3516
3972
  key: 'getRightLeafHeaders',
3517
3973
  debug: function debug() {
3518
- var _instance$options$deb20;
3974
+ var _instance$options$deb15;
3519
3975
 
3520
- return (_instance$options$deb20 = instance.options.debugAll) != null ? _instance$options$deb20 : instance.options.debugHeaders;
3976
+ return (_instance$options$deb15 = instance.options.debugAll) != null ? _instance$options$deb15 : instance.options.debugHeaders;
3521
3977
  }
3522
3978
  }),
3523
3979
  getLeafHeaders: memo(function () {
@@ -3531,9 +3987,9 @@
3531
3987
  }, {
3532
3988
  key: 'getLeafHeaders',
3533
3989
  debug: function debug() {
3534
- var _instance$options$deb21;
3990
+ var _instance$options$deb16;
3535
3991
 
3536
- return (_instance$options$deb21 = instance.options.debugAll) != null ? _instance$options$deb21 : instance.options.debugHeaders;
3992
+ return (_instance$options$deb16 = instance.options.debugAll) != null ? _instance$options$deb16 : instance.options.debugHeaders;
3537
3993
  }
3538
3994
  }),
3539
3995
  getHeader: function getHeader(id) {
@@ -3550,69 +4006,6 @@
3550
4006
  }
3551
4007
 
3552
4008
  return header;
3553
- },
3554
- getHeaderGroupProps: function getHeaderGroupProps(id, userProps) {
3555
- var headerGroup = instance.getHeaderGroups().find(function (d) {
3556
- return d.id === id;
3557
- });
3558
-
3559
- if (!headerGroup) {
3560
- return;
3561
- }
3562
-
3563
- return propGetter({
3564
- key: headerGroup.id,
3565
- role: 'row'
3566
- }, userProps);
3567
- },
3568
- getFooterGroupProps: function getFooterGroupProps(id, userProps) {
3569
- var headerGroup = instance.getFooterGroups().find(function (d) {
3570
- return d.id === id;
3571
- });
3572
-
3573
- if (!headerGroup) {
3574
- return;
3575
- }
3576
-
3577
- var initialProps = {
3578
- key: headerGroup.id,
3579
- role: 'row'
3580
- };
3581
- return propGetter(initialProps, userProps);
3582
- },
3583
- getHeaderProps: function getHeaderProps(id, userProps) {
3584
- var header = instance.getHeader(id);
3585
-
3586
- if (!header) {
3587
- throw new Error();
3588
- }
3589
-
3590
- var initialProps = {
3591
- key: header.id,
3592
- role: 'columnheader',
3593
- colSpan: header.colSpan,
3594
- rowSpan: header.rowSpan
3595
- };
3596
- return propGetter(initialProps, userProps);
3597
- },
3598
- getFooterProps: function getFooterProps(id, userProps) {
3599
- var header = instance.getHeader(id);
3600
- var initialProps = {
3601
- key: header.id,
3602
- role: 'columnfooter',
3603
- colSpan: header.colSpan,
3604
- rowSpan: header.rowSpan
3605
- };
3606
- return propGetter(initialProps, userProps);
3607
- },
3608
- getTotalWidth: function getTotalWidth() {
3609
- var width = 0;
3610
- instance.getVisibleLeafColumns().forEach(function (column) {
3611
- var _column$getWidth;
3612
-
3613
- width += (_column$getWidth = column.getWidth()) != null ? _column$getWidth : 0;
3614
- });
3615
- return width;
3616
4009
  }
3617
4010
  };
3618
4011
  }
@@ -3652,20 +4045,14 @@
3652
4045
  var headerGroup = {
3653
4046
  depth: depth,
3654
4047
  id: [headerFamily, "" + depth].filter(Boolean).join('_'),
3655
- headers: [],
3656
- getHeaderGroupProps: function getHeaderGroupProps(getterValue) {
3657
- return instance.getHeaderGroupProps("" + depth, getterValue);
3658
- },
3659
- getFooterGroupProps: function getFooterGroupProps(getterValue) {
3660
- return instance.getFooterGroupProps("" + depth, getterValue);
3661
- }
4048
+ headers: []
3662
4049
  }; // The parent columns we're going to scan next
3663
4050
 
3664
- var parentHeaders = []; // Scan each column for parents
4051
+ var pendingParentHeaders = []; // Scan each column for parents
3665
4052
 
3666
4053
  headersToGroup.forEach(function (headerToGroup) {
3667
4054
  // What is the latest (last) parent column?
3668
- var latestParentHeader = [].concat(parentHeaders).reverse()[0];
4055
+ var latestPendingParentHeader = [].concat(pendingParentHeaders).reverse()[0];
3669
4056
  var isLeafHeader = headerToGroup.column.depth === headerGroup.depth;
3670
4057
  var column;
3671
4058
  var isPlaceholder = false;
@@ -3679,37 +4066,41 @@
3679
4066
  isPlaceholder = true;
3680
4067
  }
3681
4068
 
3682
- var header = instance.createHeader(column, {
3683
- id: [headerFamily, depth, column.id, headerToGroup == null ? void 0 : headerToGroup.id].filter(Boolean).join('_'),
3684
- isPlaceholder: isPlaceholder,
3685
- placeholderId: isPlaceholder ? "" + parentHeaders.filter(function (d) {
3686
- return d.column === column;
3687
- }).length : undefined,
3688
- depth: depth
3689
- });
3690
-
3691
- if (!latestParentHeader || latestParentHeader.column !== header.column) {
3692
- header.subHeaders.push(headerToGroup);
3693
- parentHeaders.push(header);
4069
+ if ((latestPendingParentHeader == null ? void 0 : latestPendingParentHeader.column) === column) {
4070
+ // This column is repeated. Add it as a sub header to the next batch
4071
+ latestPendingParentHeader.subHeaders.push(headerToGroup);
3694
4072
  } else {
3695
- latestParentHeader.subHeaders.push(headerToGroup);
3696
- } // if (!headerToGroup.isPlaceholder) {
3697
- // headerToGroup.column.header = headerToGroup;
3698
- // }
3699
-
4073
+ // This is a new header. Let's create it
4074
+ var header = instance.createHeader(column, {
4075
+ id: [headerFamily, depth, column.id, headerToGroup == null ? void 0 : headerToGroup.id].filter(Boolean).join('_'),
4076
+ isPlaceholder: isPlaceholder,
4077
+ placeholderId: isPlaceholder ? "" + pendingParentHeaders.filter(function (d) {
4078
+ return d.column === column;
4079
+ }).length : undefined,
4080
+ depth: depth,
4081
+ index: pendingParentHeaders.length
4082
+ }); // Add the headerToGroup as a subHeader of the new header
4083
+
4084
+ header.subHeaders.push(headerToGroup); // Add the new header to the pendingParentHeaders to get grouped
4085
+ // in the next batch
4086
+
4087
+ pendingParentHeaders.push(header);
4088
+ }
3700
4089
 
3701
4090
  headerGroup.headers.push(headerToGroup);
4091
+ headerToGroup.headerGroup = headerGroup;
3702
4092
  });
3703
4093
  headerGroups.push(headerGroup);
3704
4094
 
3705
4095
  if (depth > 0) {
3706
- createHeaderGroup(parentHeaders, depth - 1);
4096
+ createHeaderGroup(pendingParentHeaders, depth - 1);
3707
4097
  }
3708
4098
  };
3709
4099
 
3710
- var bottomHeaders = columnsToGroup.map(function (column) {
4100
+ var bottomHeaders = columnsToGroup.map(function (column, index) {
3711
4101
  return instance.createHeader(column, {
3712
- depth: maxDepth
4102
+ depth: maxDepth,
4103
+ index: index
3713
4104
  });
3714
4105
  });
3715
4106
  createHeaderGroup(bottomHeaders, maxDepth - 1);
@@ -3753,7 +4144,6 @@
3753
4144
  return headerGroups;
3754
4145
  }
3755
4146
 
3756
- var features = [Headers, Visibility, Ordering, Pinning, Filters, Sorting, Grouping, Expanding, Pagination, RowSelection, ColumnSizing];
3757
4147
  function createTableInstance(options) {
3758
4148
  var _options$initialState;
3759
4149
 
@@ -3762,28 +4152,34 @@
3762
4152
  }
3763
4153
 
3764
4154
  var instance = {};
3765
- var defaultOptions = features.reduce(function (obj, feature) {
4155
+ instance._features = [Columns, Rows, Cells, Headers, Visibility, Ordering, Pinning, Filters, Sorting, Grouping, Expanding, Pagination, RowSelection, ColumnSizing];
4156
+
4157
+ var defaultOptions = instance._features.reduce(function (obj, feature) {
3766
4158
  return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(instance));
3767
4159
  }, {});
3768
4160
 
3769
- var buildOptions = function buildOptions(options) {
4161
+ var mergeOptions = function mergeOptions(options) {
4162
+ if (instance.options.mergeOptions) {
4163
+ return instance.options.mergeOptions(defaultOptions, options);
4164
+ }
4165
+
3770
4166
  return _extends({}, defaultOptions, options);
3771
4167
  };
3772
4168
 
3773
- instance.options = buildOptions(options);
4169
+ instance.options = _extends({}, defaultOptions, options);
3774
4170
  var coreInitialState = {
3775
4171
  coreProgress: 1
3776
4172
  };
3777
4173
 
3778
- var initialState = _extends({}, coreInitialState, features.reduce(function (obj, feature) {
3779
- return Object.assign(obj, feature.getInitialState == null ? void 0 : feature.getInitialState());
3780
- }, {}), (_options$initialState = options.initialState) != null ? _options$initialState : {});
4174
+ var initialState = _extends({}, coreInitialState, (_options$initialState = options.initialState) != null ? _options$initialState : {}, instance._features.reduce(function (obj, feature) {
4175
+ return Object.assign(obj, feature.getInitialState == null ? void 0 : feature.getInitialState(options.initialState));
4176
+ }, {}));
3781
4177
 
3782
4178
  var queued = [];
3783
4179
  var queuedTimeout;
3784
4180
 
3785
- var finalInstance = _extends({}, instance, features.reduce(function (obj, feature) {
3786
- return Object.assign(obj, feature.getInstance == null ? void 0 : feature.getInstance(instance));
4181
+ var finalInstance = _extends({}, instance, instance._features.reduce(function (obj, feature) {
4182
+ return Object.assign(obj, feature.createInstance == null ? void 0 : feature.createInstance(instance));
3787
4183
  }, {}), {
3788
4184
  queue: function queue(cb) {
3789
4185
  queued.push(cb);
@@ -3809,12 +4205,7 @@
3809
4205
  },
3810
4206
  setOptions: function setOptions(updater) {
3811
4207
  var newOptions = functionalUpdate(updater, instance.options);
3812
-
3813
- if (instance.options.mergeOptions) {
3814
- instance.options = instance.options.mergeOptions(defaultOptions, newOptions);
3815
- } else {
3816
- instance.options = buildOptions(newOptions);
3817
- }
4208
+ instance.options = mergeOptions(newOptions);
3818
4209
  },
3819
4210
  render: function render(template, props) {
3820
4211
  if (typeof instance.options.render === 'function') {
@@ -3827,393 +4218,12 @@
3827
4218
 
3828
4219
  return template;
3829
4220
  },
3830
- getRowId: function getRowId(row, index, parent) {
3831
- var _instance$options$get;
3832
-
3833
- return (_instance$options$get = instance.options.getRowId == null ? void 0 : instance.options.getRowId(row, index, parent)) != null ? _instance$options$get : "" + (parent ? [parent.id, index].join('.') : index);
3834
- },
3835
4221
  getState: function getState() {
3836
4222
  return instance.options.state;
3837
4223
  },
3838
4224
  setState: function setState(updater) {
3839
4225
  instance.options.onStateChange == null ? void 0 : instance.options.onStateChange(updater);
3840
4226
  },
3841
- getDefaultColumn: memo(function () {
3842
- return [instance.options.defaultColumn];
3843
- }, function (defaultColumn) {
3844
- var _defaultColumn;
3845
-
3846
- defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
3847
- return _extends({
3848
- header: function header(props) {
3849
- return props.header.column.id;
3850
- },
3851
- footer: function footer(props) {
3852
- return props.header.column.id;
3853
- },
3854
- cell: function cell(_ref) {
3855
- var _ref$value = _ref.value,
3856
- value = _ref$value === void 0 ? '' : _ref$value;
3857
- return typeof value === 'boolean' ? value.toString() : value;
3858
- }
3859
- }, features.reduce(function (obj, feature) {
3860
- return Object.assign(obj, feature.getDefaultColumn == null ? void 0 : feature.getDefaultColumn());
3861
- }, {}), defaultColumn);
3862
- }, {
3863
- debug: function debug() {
3864
- var _instance$options$deb;
3865
-
3866
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugColumns;
3867
- },
3868
- key: 'getDefaultColumn'
3869
- }),
3870
- getColumnDefs: function getColumnDefs() {
3871
- return instance.options.columns;
3872
- },
3873
- createColumn: function createColumn(columnDef, depth, parent) {
3874
- var _ref2, _columnDef$id;
3875
-
3876
- var defaultColumn = instance.getDefaultColumn();
3877
- var id = (_ref2 = (_columnDef$id = columnDef.id) != null ? _columnDef$id : columnDef.accessorKey) != null ? _ref2 : typeof columnDef.header === 'string' ? columnDef.header : undefined;
3878
- var accessorFn;
3879
-
3880
- if (columnDef.accessorFn) {
3881
- accessorFn = columnDef.accessorFn;
3882
- } else if (columnDef.accessorKey) {
3883
- accessorFn = function accessorFn(originalRow) {
3884
- return originalRow[columnDef.accessorKey];
3885
- };
3886
- }
3887
-
3888
- if (!id) {
3889
- {
3890
- throw new Error(columnDef.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header");
3891
- }
3892
- }
3893
-
3894
- var column = _extends({}, defaultColumn, columnDef, {
3895
- id: "" + id,
3896
- accessorFn: accessorFn,
3897
- parent: parent,
3898
- depth: depth,
3899
- columnDef: columnDef,
3900
- columnDefType: columnDef.columnDefType,
3901
- columns: [],
3902
- getWidth: function getWidth() {
3903
- return instance.getColumnWidth(column.id);
3904
- },
3905
- getFlatColumns: memo(function () {
3906
- return [true];
3907
- }, function () {
3908
- var _column$columns;
3909
-
3910
- return [column].concat((_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap(function (d) {
3911
- return d.getFlatColumns();
3912
- }));
3913
- }, {
3914
- key: 'column.getFlatColumns',
3915
- debug: function debug() {
3916
- var _instance$options$deb2;
3917
-
3918
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugColumns;
3919
- }
3920
- }),
3921
- getLeafColumns: memo(function () {
3922
- return [instance._getOrderColumnsFn()];
3923
- }, function (orderColumns) {
3924
- var _column$columns2;
3925
-
3926
- if ((_column$columns2 = column.columns) != null && _column$columns2.length) {
3927
- var leafColumns = column.columns.flatMap(function (column) {
3928
- return column.getLeafColumns();
3929
- });
3930
- return orderColumns(leafColumns);
3931
- }
3932
-
3933
- return [column];
3934
- }, {
3935
- key: 'column.getLeafColumns',
3936
- debug: function debug() {
3937
- var _instance$options$deb3;
3938
-
3939
- return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugColumns;
3940
- }
3941
- })
3942
- });
3943
-
3944
- column = features.reduce(function (obj, feature) {
3945
- return Object.assign(obj, feature.createColumn == null ? void 0 : feature.createColumn(column, instance));
3946
- }, column); // Yes, we have to convert instance to uknown, because we know more than the compiler here.
3947
-
3948
- return column;
3949
- },
3950
- getAllColumns: memo(function () {
3951
- return [instance.getColumnDefs()];
3952
- }, function (columnDefs) {
3953
- var recurseColumns = function recurseColumns(columnDefs, parent, depth) {
3954
- if (depth === void 0) {
3955
- depth = 0;
3956
- }
3957
-
3958
- return columnDefs.map(function (columnDef) {
3959
- var column = instance.createColumn(columnDef, depth, parent);
3960
- column.columns = columnDef.columns ? recurseColumns(columnDef.columns, column, depth + 1) : [];
3961
- return column;
3962
- });
3963
- };
3964
-
3965
- return recurseColumns(columnDefs);
3966
- }, {
3967
- key: 'getAllColumns',
3968
- debug: function debug() {
3969
- var _instance$options$deb4;
3970
-
3971
- return (_instance$options$deb4 = instance.options.debugAll) != null ? _instance$options$deb4 : instance.options.debugColumns;
3972
- }
3973
- }),
3974
- getAllFlatColumns: memo(function () {
3975
- return [instance.getAllColumns()];
3976
- }, function (allColumns) {
3977
- return allColumns.flatMap(function (column) {
3978
- return column.getFlatColumns();
3979
- });
3980
- }, {
3981
- key: 'getAllFlatColumns',
3982
- debug: function debug() {
3983
- var _instance$options$deb5;
3984
-
3985
- return (_instance$options$deb5 = instance.options.debugAll) != null ? _instance$options$deb5 : instance.options.debugColumns;
3986
- }
3987
- }),
3988
- getAllFlatColumnsById: memo(function () {
3989
- return [instance.getAllFlatColumns()];
3990
- }, function (flatColumns) {
3991
- return flatColumns.reduce(function (acc, column) {
3992
- acc[column.id] = column;
3993
- return acc;
3994
- }, {});
3995
- }, {
3996
- key: 'getAllFlatColumnsById',
3997
- debug: function debug() {
3998
- var _instance$options$deb6;
3999
-
4000
- return (_instance$options$deb6 = instance.options.debugAll) != null ? _instance$options$deb6 : instance.options.debugColumns;
4001
- }
4002
- }),
4003
- getAllLeafColumns: memo(function () {
4004
- return [instance.getAllColumns(), instance._getOrderColumnsFn()];
4005
- }, function (allColumns, orderColumns) {
4006
- var leafColumns = allColumns.flatMap(function (column) {
4007
- return column.getLeafColumns();
4008
- });
4009
- return orderColumns(leafColumns);
4010
- }, {
4011
- key: 'getAllLeafColumns',
4012
- debug: function debug() {
4013
- var _instance$options$deb7;
4014
-
4015
- return (_instance$options$deb7 = instance.options.debugAll) != null ? _instance$options$deb7 : instance.options.debugColumns;
4016
- }
4017
- }),
4018
- getColumn: function getColumn(columnId) {
4019
- var column = instance.getAllFlatColumnsById()[columnId];
4020
-
4021
- if (!column) {
4022
- {
4023
- console.warn("[Table] Column with id " + columnId + " does not exist.");
4024
- }
4025
-
4026
- throw new Error();
4027
- }
4028
-
4029
- return column;
4030
- },
4031
- createCell: function createCell(row, column, value) {
4032
- var cell = {
4033
- id: row.id + "_" + column.id,
4034
- rowId: row.id,
4035
- columnId: column.id,
4036
- row: row,
4037
- column: column,
4038
- value: value,
4039
- getCellProps: function getCellProps(userProps) {
4040
- return instance.getCellProps(row.id, column.id, userProps);
4041
- },
4042
- renderCell: function renderCell() {
4043
- return column.cell ? instance.render(column.cell, {
4044
- instance: instance,
4045
- column: column,
4046
- row: row,
4047
- cell: cell,
4048
- value: value
4049
- }) : null;
4050
- }
4051
- };
4052
- features.forEach(function (feature) {
4053
- Object.assign(cell, feature.createCell == null ? void 0 : feature.createCell(cell, column, row, instance));
4054
- }, {});
4055
- return cell;
4056
- },
4057
- createRow: function createRow(id, original, rowIndex, depth, values) {
4058
- var row = {
4059
- id: id,
4060
- index: rowIndex,
4061
- original: original,
4062
- depth: depth,
4063
- values: values,
4064
- subRows: [],
4065
- getLeafRows: function getLeafRows() {
4066
- return flattenBy(row.subRows, function (d) {
4067
- return d.subRows;
4068
- });
4069
- },
4070
- getRowProps: function getRowProps(userProps) {
4071
- return instance.getRowProps(row.id, userProps);
4072
- },
4073
- getAllCells: undefined,
4074
- getAllCellsByColumnId: undefined
4075
- };
4076
- row.getAllCells = memo(function () {
4077
- return [instance.getAllLeafColumns()];
4078
- }, function (leafColumns) {
4079
- return leafColumns.map(function (column) {
4080
- return instance.createCell(row, column, row.values[column.id]);
4081
- });
4082
- }, {
4083
- key: 'row.getAllCells' ,
4084
- debug: function debug() {
4085
- var _instance$options$deb8;
4086
-
4087
- return (_instance$options$deb8 = instance.options.debugAll) != null ? _instance$options$deb8 : instance.options.debugRows;
4088
- }
4089
- });
4090
- row.getAllCellsByColumnId = memo(function () {
4091
- return [row.getAllCells()];
4092
- }, function (allCells) {
4093
- return allCells.reduce(function (acc, cell) {
4094
- acc[cell.columnId] = cell;
4095
- return acc;
4096
- }, {});
4097
- }, {
4098
- key: 'row.getAllCellsByColumnId',
4099
- debug: function debug() {
4100
- var _instance$options$deb9;
4101
-
4102
- return (_instance$options$deb9 = instance.options.debugAll) != null ? _instance$options$deb9 : instance.options.debugRows;
4103
- }
4104
- });
4105
-
4106
- for (var i = 0; i < features.length; i++) {
4107
- var feature = features[i];
4108
- Object.assign(row, feature.createRow == null ? void 0 : feature.createRow(row, instance));
4109
- }
4110
-
4111
- return row;
4112
- },
4113
- getCoreRowModel: function getCoreRowModel() {
4114
- if (!instance._getCoreRowModel) {
4115
- instance._getCoreRowModel = instance.options.getCoreRowModel(instance);
4116
- }
4117
-
4118
- return instance._getCoreRowModel();
4119
- },
4120
- // The final calls start at the bottom of the model,
4121
- // expanded rows, which then work their way up
4122
- getRowModel: function getRowModel() {
4123
- return instance.getPaginationRowModel();
4124
- },
4125
- getRow: function getRow(id) {
4126
- var row = instance.getRowModel().rowsById[id];
4127
-
4128
- if (!row) {
4129
- {
4130
- throw new Error("getRow expected an ID, but got " + id);
4131
- }
4132
- }
4133
-
4134
- return row;
4135
- },
4136
- getCell: function getCell(rowId, columnId) {
4137
- var row = instance.getRow(rowId);
4138
-
4139
- if (!row) {
4140
- {
4141
- throw new Error("[Table] could not find row with id " + rowId);
4142
- }
4143
- }
4144
-
4145
- var cell = row.getAllCellsByColumnId()[columnId];
4146
-
4147
- if (!cell) {
4148
- {
4149
- throw new Error("[Table] could not find cell " + columnId + " in row " + rowId);
4150
- }
4151
- }
4152
-
4153
- return cell;
4154
- },
4155
- getTableProps: function getTableProps(userProps) {
4156
- return propGetter({
4157
- role: 'table'
4158
- }, userProps);
4159
- },
4160
- getTableBodyProps: function getTableBodyProps(userProps) {
4161
- return propGetter({
4162
- role: 'rowgroup'
4163
- }, userProps);
4164
- },
4165
- getRowProps: function getRowProps(rowId, userProps) {
4166
- var row = instance.getRow(rowId);
4167
-
4168
- if (!row) {
4169
- return;
4170
- }
4171
-
4172
- return propGetter({
4173
- key: row.id,
4174
- role: 'row'
4175
- }, userProps);
4176
- },
4177
- getCellProps: function getCellProps(rowId, columnId, userProps) {
4178
- var cell = instance.getCell(rowId, columnId);
4179
-
4180
- if (!cell) {
4181
- return;
4182
- }
4183
-
4184
- return propGetter({
4185
- key: cell.id,
4186
- role: 'gridcell'
4187
- }, userProps);
4188
- },
4189
- getTableWidth: function getTableWidth() {
4190
- var _instance$getHeaderGr, _instance$getHeaderGr2;
4191
-
4192
- return (_instance$getHeaderGr = (_instance$getHeaderGr2 = instance.getHeaderGroups()[0]) == null ? void 0 : _instance$getHeaderGr2.headers.reduce(function (sum, header) {
4193
- return sum + header.getWidth();
4194
- }, 0)) != null ? _instance$getHeaderGr : 0;
4195
- },
4196
- getLeftTableWidth: function getLeftTableWidth() {
4197
- var _instance$getLeftHead, _instance$getLeftHead2;
4198
-
4199
- return (_instance$getLeftHead = (_instance$getLeftHead2 = instance.getLeftHeaderGroups()[0]) == null ? void 0 : _instance$getLeftHead2.headers.reduce(function (sum, header) {
4200
- return sum + header.getWidth();
4201
- }, 0)) != null ? _instance$getLeftHead : 0;
4202
- },
4203
- getCenterTableWidth: function getCenterTableWidth() {
4204
- var _instance$getCenterHe, _instance$getCenterHe2;
4205
-
4206
- return (_instance$getCenterHe = (_instance$getCenterHe2 = instance.getCenterHeaderGroups()[0]) == null ? void 0 : _instance$getCenterHe2.headers.reduce(function (sum, header) {
4207
- return sum + header.getWidth();
4208
- }, 0)) != null ? _instance$getCenterHe : 0;
4209
- },
4210
- getRightTableWidth: function getRightTableWidth() {
4211
- var _instance$getRightHea, _instance$getRightHea2;
4212
-
4213
- return (_instance$getRightHea = (_instance$getRightHea2 = instance.getRightHeaderGroups()[0]) == null ? void 0 : _instance$getRightHea2.headers.reduce(function (sum, header) {
4214
- return sum + header.getWidth();
4215
- }, 0)) != null ? _instance$getRightHea : 0;
4216
- },
4217
4227
  getOverallProgress: function getOverallProgress() {
4218
4228
  var _instance$getState = instance.getState(),
4219
4229
  coreProgress = _instance$getState.coreProgress,
@@ -4248,6 +4258,9 @@
4248
4258
  throw new Error('');
4249
4259
  }()
4250
4260
  },
4261
+ setGenerics: function setGenerics() {
4262
+ return table;
4263
+ },
4251
4264
  setRowType: function setRowType() {
4252
4265
  return table;
4253
4266
  },
@@ -4260,9 +4273,6 @@
4260
4273
  setOptions: function setOptions(newOptions) {
4261
4274
  return createTable(_, __, _extends({}, options, newOptions));
4262
4275
  },
4263
- createColumns: function createColumns(columns) {
4264
- return columns;
4265
- },
4266
4276
  createDisplayColumn: function createDisplayColumn(column) {
4267
4277
  return _extends({}, column, {
4268
4278
  columnDefType: 'display'
@@ -5119,7 +5129,6 @@
5119
5129
  exports.memo = memo;
5120
5130
  exports.noop = noop;
5121
5131
  exports.passiveEventSupported = passiveEventSupported;
5122
- exports.propGetter = propGetter;
5123
5132
  exports.selectRowsFn = selectRowsFn;
5124
5133
  exports.shouldAutoRemoveFilter = shouldAutoRemoveFilter;
5125
5134