@tanstack/table-core 8.0.0-alpha.65 → 8.0.0-alpha.67
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.
- package/build/cjs/core.js +0 -2
- package/build/cjs/core.js.map +1 -1
- package/build/cjs/features/Cells.js +1 -1
- package/build/cjs/features/Cells.js.map +1 -1
- package/build/cjs/features/ColumnSizing.js +65 -140
- package/build/cjs/features/ColumnSizing.js.map +1 -1
- package/build/cjs/features/Columns.js +5 -5
- package/build/cjs/features/Columns.js.map +1 -1
- package/build/cjs/features/Expanding.js +49 -87
- package/build/cjs/features/Expanding.js.map +1 -1
- package/build/cjs/features/Filters.js +89 -145
- package/build/cjs/features/Filters.js.map +1 -1
- package/build/cjs/features/Grouping.js +30 -58
- package/build/cjs/features/Grouping.js.map +1 -1
- package/build/cjs/features/Headers.js +16 -40
- package/build/cjs/features/Headers.js.map +1 -1
- package/build/cjs/features/Ordering.js +1 -1
- package/build/cjs/features/Ordering.js.map +1 -1
- package/build/cjs/features/Pagination.js +1 -1
- package/build/cjs/features/Pagination.js.map +1 -1
- package/build/cjs/features/Pinning.js +70 -95
- package/build/cjs/features/Pinning.js.map +1 -1
- package/build/cjs/features/RowSelection.js +60 -112
- package/build/cjs/features/RowSelection.js.map +1 -1
- package/build/cjs/features/Sorting.js +33 -83
- package/build/cjs/features/Sorting.js.map +1 -1
- package/build/cjs/features/Visibility.js +16 -39
- package/build/cjs/features/Visibility.js.map +1 -1
- package/build/cjs/utils/getCoreRowModelAsync.js +1 -1
- package/build/cjs/utils/getCoreRowModelAsync.js.map +1 -1
- package/build/cjs/utils/getCoreRowModelSync.js +1 -1
- package/build/cjs/utils/getCoreRowModelSync.js.map +1 -1
- package/build/cjs/utils/getExpandedRowModel.js +2 -2
- package/build/cjs/utils/getExpandedRowModel.js.map +1 -1
- package/build/cjs/utils/getFilteredRowModelSync.js +64 -69
- package/build/cjs/utils/getFilteredRowModelSync.js.map +1 -1
- package/build/cjs/utils/getGroupedRowModel.js +1 -1
- package/build/cjs/utils/getGroupedRowModel.js.map +1 -1
- package/build/cjs/utils/getPaginationRowModel.js +1 -1
- package/build/cjs/utils/getPaginationRowModel.js.map +1 -1
- package/build/cjs/utils/getSortedRowModelSync.js +3 -3
- package/build/cjs/utils/getSortedRowModelSync.js.map +1 -1
- package/build/esm/index.js +546 -924
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +354 -354
- package/build/types/features/ColumnSizing.d.ts +2 -13
- package/build/types/features/Expanding.d.ts +1 -6
- package/build/types/features/Filters.d.ts +12 -14
- package/build/types/features/Grouping.d.ts +0 -7
- package/build/types/features/Pinning.d.ts +0 -4
- package/build/types/features/RowSelection.d.ts +1 -7
- package/build/types/features/Sorting.d.ts +3 -14
- package/build/types/features/Visibility.d.ts +0 -4
- package/build/types/types.d.ts +0 -2
- package/build/umd/index.development.js +534 -912
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/core.ts +0 -2
- package/src/features/Cells.ts +1 -1
- package/src/features/ColumnSizing.ts +67 -125
- package/src/features/Columns.ts +6 -5
- package/src/features/Expanding.ts +58 -105
- package/src/features/Filters.ts +122 -172
- package/src/features/Grouping.ts +36 -60
- package/src/features/Headers.ts +18 -40
- package/src/features/Ordering.ts +1 -1
- package/src/features/Pagination.ts +1 -1
- package/src/features/Pinning.ts +66 -89
- package/src/features/RowSelection.ts +63 -115
- package/src/features/Sorting.ts +36 -94
- package/src/features/Visibility.ts +19 -49
- package/src/types.ts +0 -2
- package/src/utils/getCoreRowModelAsync.ts +1 -1
- package/src/utils/getCoreRowModelSync.ts +1 -1
- package/src/utils/getExpandedRowModel.ts +2 -2
- package/src/utils/getFilteredRowModelAsync.ts +118 -10
- package/src/utils/getFilteredRowModelSync.ts +95 -104
- package/src/utils/getGroupedRowModel.ts +1 -1
- package/src/utils/getPaginationRowModel.ts +1 -1
- package/src/utils/getSortedRowModelAsync.ts +1 -1
- package/src/utils/getSortedRowModelSync.ts +4 -4
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
|
|
380
380
|
return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugColumns;
|
|
381
381
|
},
|
|
382
|
-
key:
|
|
382
|
+
key: 'getDefaultColumn'
|
|
383
383
|
}),
|
|
384
384
|
getColumnDefs: function getColumnDefs() {
|
|
385
385
|
return instance.options.columns;
|
|
@@ -475,7 +475,7 @@
|
|
|
475
475
|
|
|
476
476
|
return recurseColumns(columnDefs);
|
|
477
477
|
}, {
|
|
478
|
-
key:
|
|
478
|
+
key: 'getAllColumns',
|
|
479
479
|
debug: function debug() {
|
|
480
480
|
var _instance$options$deb4;
|
|
481
481
|
|
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
return column.getFlatColumns();
|
|
490
490
|
});
|
|
491
491
|
}, {
|
|
492
|
-
key:
|
|
492
|
+
key: 'getAllFlatColumns',
|
|
493
493
|
debug: function debug() {
|
|
494
494
|
var _instance$options$deb5;
|
|
495
495
|
|
|
@@ -504,7 +504,7 @@
|
|
|
504
504
|
return acc;
|
|
505
505
|
}, {});
|
|
506
506
|
}, {
|
|
507
|
-
key:
|
|
507
|
+
key: 'getAllFlatColumnsById',
|
|
508
508
|
debug: function debug() {
|
|
509
509
|
var _instance$options$deb6;
|
|
510
510
|
|
|
@@ -519,7 +519,7 @@
|
|
|
519
519
|
});
|
|
520
520
|
return orderColumns(leafColumns);
|
|
521
521
|
}, {
|
|
522
|
-
key:
|
|
522
|
+
key: 'getAllLeafColumns',
|
|
523
523
|
debug: function debug() {
|
|
524
524
|
var _instance$options$deb7;
|
|
525
525
|
|
|
@@ -725,139 +725,70 @@
|
|
|
725
725
|
createColumn: function createColumn(column, instance) {
|
|
726
726
|
return {
|
|
727
727
|
getSize: function getSize() {
|
|
728
|
-
return instance.getColumnSize(column.id);
|
|
729
|
-
},
|
|
730
|
-
getStart: function getStart(position) {
|
|
731
|
-
return instance.getColumnStart(column.id, position);
|
|
732
|
-
},
|
|
733
|
-
getIsResizing: function getIsResizing() {
|
|
734
|
-
return instance.getColumnIsResizing(column.id);
|
|
735
|
-
},
|
|
736
|
-
getCanResize: function getCanResize() {
|
|
737
|
-
return instance.getColumnCanResize(column.id);
|
|
738
|
-
},
|
|
739
|
-
resetSize: function resetSize() {
|
|
740
|
-
return instance.resetColumnSize(column.id);
|
|
741
|
-
}
|
|
742
|
-
};
|
|
743
|
-
},
|
|
744
|
-
createHeader: function createHeader(header, instance) {
|
|
745
|
-
return {
|
|
746
|
-
getIsResizing: function getIsResizing() {
|
|
747
|
-
return instance.getColumnIsResizing(header.column.id);
|
|
748
|
-
},
|
|
749
|
-
getCanResize: function getCanResize() {
|
|
750
|
-
return instance.getColumnCanResize(header.column.id);
|
|
751
|
-
},
|
|
752
|
-
resetSize: function resetSize() {
|
|
753
|
-
return instance.resetColumnSize(header.column.id);
|
|
754
|
-
},
|
|
755
|
-
getResizeHandler: function getResizeHandler() {
|
|
756
|
-
return instance.getResizeHandler(header.id);
|
|
757
|
-
}
|
|
758
|
-
};
|
|
759
|
-
},
|
|
760
|
-
createInstance: function createInstance(instance) {
|
|
761
|
-
return {
|
|
762
|
-
getColumnSize: function getColumnSize(columnId) {
|
|
763
728
|
var _column$minSize, _ref, _column$maxSize;
|
|
764
729
|
|
|
765
|
-
var column = instance.getColumn(columnId);
|
|
766
|
-
|
|
767
|
-
if (!column) {
|
|
768
|
-
throw new Error();
|
|
769
|
-
}
|
|
770
|
-
|
|
771
730
|
var columnSize = instance.getState().columnSizing[column.id];
|
|
772
731
|
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);
|
|
773
732
|
},
|
|
774
|
-
|
|
775
|
-
var column = instance.getColumn(columnId);
|
|
776
|
-
|
|
777
|
-
if (!column) {
|
|
778
|
-
throw new Error();
|
|
779
|
-
}
|
|
780
|
-
|
|
733
|
+
getStart: function getStart(position) {
|
|
781
734
|
var columns = !position ? instance.getVisibleLeafColumns() : position === 'left' ? instance.getLeftVisibleLeafColumns() : instance.getRightVisibleLeafColumns();
|
|
782
735
|
var index = columns.findIndex(function (d) {
|
|
783
|
-
return d.id ===
|
|
736
|
+
return d.id === column.id;
|
|
784
737
|
});
|
|
785
738
|
|
|
786
739
|
if (index > 0) {
|
|
787
740
|
var prevSiblingColumn = columns[index - 1];
|
|
788
|
-
return
|
|
741
|
+
return prevSiblingColumn.getStart(position) + prevSiblingColumn.getSize();
|
|
789
742
|
}
|
|
790
743
|
|
|
791
744
|
return 0;
|
|
792
745
|
},
|
|
793
|
-
|
|
794
|
-
return instance.options.onColumnSizingChange == null ? void 0 : instance.options.onColumnSizingChange(updater);
|
|
795
|
-
},
|
|
796
|
-
setColumnSizingInfo: function setColumnSizingInfo(updater) {
|
|
797
|
-
return instance.options.onColumnSizingInfoChange == null ? void 0 : instance.options.onColumnSizingInfoChange(updater);
|
|
798
|
-
},
|
|
799
|
-
resetColumnSizing: function resetColumnSizing() {
|
|
800
|
-
var _instance$initialStat;
|
|
801
|
-
|
|
802
|
-
instance.setColumnSizing((_instance$initialStat = instance.initialState.columnSizing) != null ? _instance$initialStat : {});
|
|
803
|
-
},
|
|
804
|
-
resetHeaderSizeInfo: function resetHeaderSizeInfo() {
|
|
805
|
-
var _instance$initialStat2;
|
|
806
|
-
|
|
807
|
-
instance.setColumnSizingInfo((_instance$initialStat2 = instance.initialState.columnSizingInfo) != null ? _instance$initialStat2 : {});
|
|
808
|
-
},
|
|
809
|
-
resetColumnSize: function resetColumnSize(columnId) {
|
|
746
|
+
resetSize: function resetSize() {
|
|
810
747
|
instance.setColumnSizing(function (_ref2) {
|
|
811
|
-
|
|
812
|
-
|
|
748
|
+
var _column$id = column.id;
|
|
749
|
+
_ref2[_column$id];
|
|
750
|
+
var rest = _objectWithoutPropertiesLoose(_ref2, [_column$id].map(_toPropertyKey));
|
|
813
751
|
|
|
814
752
|
return rest;
|
|
815
753
|
});
|
|
816
754
|
},
|
|
817
|
-
|
|
818
|
-
var
|
|
819
|
-
return instance.resetColumnSize(header.column.id);
|
|
820
|
-
},
|
|
821
|
-
getHeaderCanResize: function getHeaderCanResize(headerId) {
|
|
822
|
-
var header = instance.getHeader(headerId);
|
|
823
|
-
|
|
824
|
-
if (!header) {
|
|
825
|
-
throw new Error();
|
|
826
|
-
}
|
|
755
|
+
getCanResize: function getCanResize() {
|
|
756
|
+
var _column$enableResizin, _instance$options$ena;
|
|
827
757
|
|
|
828
|
-
return
|
|
758
|
+
return ((_column$enableResizin = column.enableResizing) != null ? _column$enableResizin : true) && ((_instance$options$ena = instance.options.enableColumnResizing) != null ? _instance$options$ena : true);
|
|
829
759
|
},
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
760
|
+
getIsResizing: function getIsResizing() {
|
|
761
|
+
return instance.getState().columnSizingInfo.isResizingColumn === column.id;
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
},
|
|
765
|
+
createHeader: function createHeader(header, instance) {
|
|
766
|
+
return {
|
|
767
|
+
getSize: function getSize() {
|
|
768
|
+
var sum = 0;
|
|
838
769
|
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
770
|
+
var recurse = function recurse(header) {
|
|
771
|
+
if (header.subHeaders.length) {
|
|
772
|
+
header.subHeaders.forEach(recurse);
|
|
773
|
+
} else {
|
|
774
|
+
var _header$column$getSiz;
|
|
843
775
|
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
}
|
|
776
|
+
sum += (_header$column$getSiz = header.column.getSize()) != null ? _header$column$getSiz : 0;
|
|
777
|
+
}
|
|
778
|
+
};
|
|
847
779
|
|
|
848
|
-
|
|
780
|
+
recurse(header);
|
|
781
|
+
return sum;
|
|
849
782
|
},
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
throw new Error();
|
|
783
|
+
getStart: function getStart() {
|
|
784
|
+
if (header.index > 0) {
|
|
785
|
+
var prevSiblingHeader = header.headerGroup.headers[header.index - 1];
|
|
786
|
+
return prevSiblingHeader.getStart() + prevSiblingHeader.getSize();
|
|
855
787
|
}
|
|
856
788
|
|
|
857
|
-
return
|
|
789
|
+
return 0;
|
|
858
790
|
},
|
|
859
|
-
getResizeHandler: function getResizeHandler(
|
|
860
|
-
var header = instance.getHeader(headerId);
|
|
791
|
+
getResizeHandler: function getResizeHandler() {
|
|
861
792
|
var column = instance.getColumn(header.column.id);
|
|
862
793
|
var canResize = column.getCanResize();
|
|
863
794
|
return function (e) {
|
|
@@ -873,10 +804,9 @@
|
|
|
873
804
|
}
|
|
874
805
|
}
|
|
875
806
|
|
|
876
|
-
var
|
|
877
|
-
var startSize = header ? header.getSize() : column.getSize();
|
|
807
|
+
var startSize = column.getSize();
|
|
878
808
|
var columnSizingStart = header ? header.getLeafHeaders().map(function (d) {
|
|
879
|
-
return [d.column.id, d.getSize()];
|
|
809
|
+
return [d.column.id, d.column.getSize()];
|
|
880
810
|
}) : [[column.id, column.getSize()]];
|
|
881
811
|
var clientX = isTouchStartEvent(e) ? Math.round(e.touches[0].clientX) : e.clientX;
|
|
882
812
|
|
|
@@ -891,9 +821,9 @@
|
|
|
891
821
|
|
|
892
822
|
var deltaOffset = clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0);
|
|
893
823
|
var deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
|
|
894
|
-
old.columnSizingStart.forEach(function (
|
|
895
|
-
var columnId =
|
|
896
|
-
headerSize =
|
|
824
|
+
old.columnSizingStart.forEach(function (_ref3) {
|
|
825
|
+
var columnId = _ref3[0],
|
|
826
|
+
headerSize = _ref3[1];
|
|
897
827
|
newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
|
|
898
828
|
});
|
|
899
829
|
return _extends({}, old, {
|
|
@@ -937,36 +867,11 @@
|
|
|
937
867
|
onEnd(e.clientX);
|
|
938
868
|
}
|
|
939
869
|
};
|
|
940
|
-
var touchEvents = {
|
|
941
|
-
moveHandler: function moveHandler(e) {
|
|
942
|
-
if (e.cancelable) {
|
|
943
|
-
e.preventDefault();
|
|
944
|
-
e.stopPropagation();
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
onMove(e.touches[0].clientX);
|
|
948
|
-
return false;
|
|
949
|
-
},
|
|
950
|
-
upHandler: function upHandler(e) {
|
|
951
|
-
document.removeEventListener('touchmove', touchEvents.moveHandler);
|
|
952
|
-
document.removeEventListener('touchend', touchEvents.upHandler);
|
|
953
|
-
|
|
954
|
-
if (e.cancelable) {
|
|
955
|
-
e.preventDefault();
|
|
956
|
-
e.stopPropagation();
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
onEnd(e.touches[0].clientX);
|
|
960
|
-
}
|
|
961
|
-
};
|
|
962
870
|
var passiveIfSupported = passiveEventSupported() ? {
|
|
963
871
|
passive: false
|
|
964
872
|
} : false;
|
|
965
873
|
|
|
966
|
-
if (isTouchStartEvent(e)) {
|
|
967
|
-
document.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
|
|
968
|
-
document.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
|
|
969
|
-
} else {
|
|
874
|
+
if (isTouchStartEvent(e)) ; else {
|
|
970
875
|
document.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
|
|
971
876
|
document.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
|
|
972
877
|
}
|
|
@@ -982,33 +887,53 @@
|
|
|
982
887
|
});
|
|
983
888
|
});
|
|
984
889
|
};
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
},
|
|
893
|
+
createInstance: function createInstance(instance) {
|
|
894
|
+
return {
|
|
895
|
+
setColumnSizing: function setColumnSizing(updater) {
|
|
896
|
+
return instance.options.onColumnSizingChange == null ? void 0 : instance.options.onColumnSizingChange(updater);
|
|
897
|
+
},
|
|
898
|
+
setColumnSizingInfo: function setColumnSizingInfo(updater) {
|
|
899
|
+
return instance.options.onColumnSizingInfoChange == null ? void 0 : instance.options.onColumnSizingInfoChange(updater);
|
|
900
|
+
},
|
|
901
|
+
resetColumnSizing: function resetColumnSizing() {
|
|
902
|
+
var _instance$initialStat;
|
|
903
|
+
|
|
904
|
+
instance.setColumnSizing((_instance$initialStat = instance.initialState.columnSizing) != null ? _instance$initialStat : {});
|
|
905
|
+
},
|
|
906
|
+
resetHeaderSizeInfo: function resetHeaderSizeInfo() {
|
|
907
|
+
var _instance$initialStat2;
|
|
908
|
+
|
|
909
|
+
instance.setColumnSizingInfo((_instance$initialStat2 = instance.initialState.columnSizingInfo) != null ? _instance$initialStat2 : {});
|
|
985
910
|
},
|
|
986
911
|
getTotalSize: function getTotalSize() {
|
|
987
912
|
var _instance$getHeaderGr, _instance$getHeaderGr2;
|
|
988
913
|
|
|
989
914
|
return (_instance$getHeaderGr = (_instance$getHeaderGr2 = instance.getHeaderGroups()[0]) == null ? void 0 : _instance$getHeaderGr2.headers.reduce(function (sum, header) {
|
|
990
|
-
return sum + header.getSize();
|
|
915
|
+
return sum + header.column.getSize();
|
|
991
916
|
}, 0)) != null ? _instance$getHeaderGr : 0;
|
|
992
917
|
},
|
|
993
918
|
getLeftTotalSize: function getLeftTotalSize() {
|
|
994
919
|
var _instance$getLeftHead, _instance$getLeftHead2;
|
|
995
920
|
|
|
996
921
|
return (_instance$getLeftHead = (_instance$getLeftHead2 = instance.getLeftHeaderGroups()[0]) == null ? void 0 : _instance$getLeftHead2.headers.reduce(function (sum, header) {
|
|
997
|
-
return sum + header.getSize();
|
|
922
|
+
return sum + header.column.getSize();
|
|
998
923
|
}, 0)) != null ? _instance$getLeftHead : 0;
|
|
999
924
|
},
|
|
1000
925
|
getCenterTotalSize: function getCenterTotalSize() {
|
|
1001
926
|
var _instance$getCenterHe, _instance$getCenterHe2;
|
|
1002
927
|
|
|
1003
928
|
return (_instance$getCenterHe = (_instance$getCenterHe2 = instance.getCenterHeaderGroups()[0]) == null ? void 0 : _instance$getCenterHe2.headers.reduce(function (sum, header) {
|
|
1004
|
-
return sum + header.getSize();
|
|
929
|
+
return sum + header.column.getSize();
|
|
1005
930
|
}, 0)) != null ? _instance$getCenterHe : 0;
|
|
1006
931
|
},
|
|
1007
932
|
getRightTotalSize: function getRightTotalSize() {
|
|
1008
933
|
var _instance$getRightHea, _instance$getRightHea2;
|
|
1009
934
|
|
|
1010
935
|
return (_instance$getRightHea = (_instance$getRightHea2 = instance.getRightHeaderGroups()[0]) == null ? void 0 : _instance$getRightHea2.headers.reduce(function (sum, header) {
|
|
1011
|
-
return sum + header.getSize();
|
|
936
|
+
return sum + header.column.getSize();
|
|
1012
937
|
}, 0)) != null ? _instance$getRightHea : 0;
|
|
1013
938
|
}
|
|
1014
939
|
};
|
|
@@ -1079,41 +1004,6 @@
|
|
|
1079
1004
|
setExpanded: function setExpanded(updater) {
|
|
1080
1005
|
return instance.options.onExpandedChange == null ? void 0 : instance.options.onExpandedChange(updater);
|
|
1081
1006
|
},
|
|
1082
|
-
toggleRowExpanded: function toggleRowExpanded(rowId, expanded) {
|
|
1083
|
-
if (!rowId) return;
|
|
1084
|
-
instance.setExpanded(function (old) {
|
|
1085
|
-
var _expanded;
|
|
1086
|
-
|
|
1087
|
-
var exists = old === true ? true : !!(old != null && old[rowId]);
|
|
1088
|
-
var oldExpanded = {};
|
|
1089
|
-
|
|
1090
|
-
if (old === true) {
|
|
1091
|
-
Object.keys(instance.getRowModel().rowsById).forEach(function (rowId) {
|
|
1092
|
-
oldExpanded[rowId] = true;
|
|
1093
|
-
});
|
|
1094
|
-
} else {
|
|
1095
|
-
oldExpanded = old;
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
expanded = (_expanded = expanded) != null ? _expanded : !exists;
|
|
1099
|
-
|
|
1100
|
-
if (!exists && expanded) {
|
|
1101
|
-
var _extends2;
|
|
1102
|
-
|
|
1103
|
-
return _extends({}, oldExpanded, (_extends2 = {}, _extends2[rowId] = true, _extends2));
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
if (exists && !expanded) {
|
|
1107
|
-
var _oldExpanded = oldExpanded;
|
|
1108
|
-
_oldExpanded[rowId];
|
|
1109
|
-
var rest = _objectWithoutPropertiesLoose(_oldExpanded, [rowId].map(_toPropertyKey));
|
|
1110
|
-
|
|
1111
|
-
return rest;
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
return old;
|
|
1115
|
-
});
|
|
1116
|
-
},
|
|
1117
1007
|
toggleAllRowsExpanded: function toggleAllRowsExpanded(expanded) {
|
|
1118
1008
|
if (expanded != null ? expanded : !instance.getIsAllRowsExpanded()) {
|
|
1119
1009
|
instance.setExpanded(true);
|
|
@@ -1126,55 +1016,11 @@
|
|
|
1126
1016
|
|
|
1127
1017
|
instance.setExpanded((_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.expanded) != null ? _instance$initialStat : {});
|
|
1128
1018
|
},
|
|
1129
|
-
getIsRowExpanded: function getIsRowExpanded(rowId) {
|
|
1130
|
-
var _instance$options$get;
|
|
1131
|
-
|
|
1132
|
-
var row = instance.getPreExpandedRowModel().rowsById[rowId];
|
|
1133
|
-
|
|
1134
|
-
if (!row) {
|
|
1135
|
-
{
|
|
1136
|
-
console.warn("[Table] getIsRowExpanded: no row found with id " + rowId);
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
throw new Error();
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
var expanded = instance.getState().expanded;
|
|
1143
|
-
return !!((_instance$options$get = instance.options.getIsRowExpanded == null ? void 0 : instance.options.getIsRowExpanded(row)) != null ? _instance$options$get : expanded === true || (expanded == null ? void 0 : expanded[rowId]));
|
|
1144
|
-
},
|
|
1145
|
-
getRowCanExpand: function getRowCanExpand(rowId) {
|
|
1146
|
-
var _ref, _ref2, _instance$options$get2, _row$subRows;
|
|
1147
|
-
|
|
1148
|
-
var row = instance.getRow(rowId);
|
|
1149
|
-
|
|
1150
|
-
if (!row) {
|
|
1151
|
-
{
|
|
1152
|
-
console.warn("[Table] getRowCanExpand: no row found with id " + rowId);
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
throw new Error();
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
return (_ref = (_ref2 = (_instance$options$get2 = instance.options.getRowCanExpand == null ? void 0 : instance.options.getRowCanExpand(row)) != null ? _instance$options$get2 : instance.options.enableExpanded) != null ? _ref2 : instance.options.defaultCanExpand) != null ? _ref : !!((_row$subRows = row.subRows) != null && _row$subRows.length);
|
|
1159
|
-
},
|
|
1160
1019
|
getCanSomeRowsExpand: function getCanSomeRowsExpand() {
|
|
1161
|
-
return
|
|
1162
|
-
return
|
|
1020
|
+
return instance.getRowModel().flatRows.some(function (row) {
|
|
1021
|
+
return row.getCanExpand();
|
|
1163
1022
|
});
|
|
1164
1023
|
},
|
|
1165
|
-
getToggleExpandedHandler: function getToggleExpandedHandler(rowId) {
|
|
1166
|
-
var row = instance.getRow(rowId);
|
|
1167
|
-
|
|
1168
|
-
if (!row) {
|
|
1169
|
-
return;
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
var canExpand = instance.getRowCanExpand(rowId);
|
|
1173
|
-
return function () {
|
|
1174
|
-
if (!canExpand) return;
|
|
1175
|
-
instance.toggleRowExpanded(rowId);
|
|
1176
|
-
};
|
|
1177
|
-
},
|
|
1178
1024
|
getToggleAllRowsExpandedHandler: function getToggleAllRowsExpandedHandler() {
|
|
1179
1025
|
return function (e) {
|
|
1180
1026
|
e.persist == null ? void 0 : e.persist();
|
|
@@ -1193,8 +1039,8 @@
|
|
|
1193
1039
|
} // If any row is not expanded, return false
|
|
1194
1040
|
|
|
1195
1041
|
|
|
1196
|
-
if (
|
|
1197
|
-
return
|
|
1042
|
+
if (instance.getRowModel().flatRows.some(function (row) {
|
|
1043
|
+
return row.getIsExpanded();
|
|
1198
1044
|
})) {
|
|
1199
1045
|
return false;
|
|
1200
1046
|
} // They must all be expanded :shrug:
|
|
@@ -1230,16 +1076,57 @@
|
|
|
1230
1076
|
createRow: function createRow(row, instance) {
|
|
1231
1077
|
return {
|
|
1232
1078
|
toggleExpanded: function toggleExpanded(expanded) {
|
|
1233
|
-
|
|
1079
|
+
instance.setExpanded(function (old) {
|
|
1080
|
+
var _expanded;
|
|
1081
|
+
|
|
1082
|
+
var exists = old === true ? true : !!(old != null && old[row.id]);
|
|
1083
|
+
var oldExpanded = {};
|
|
1084
|
+
|
|
1085
|
+
if (old === true) {
|
|
1086
|
+
Object.keys(instance.getRowModel().rowsById).forEach(function (rowId) {
|
|
1087
|
+
oldExpanded[rowId] = true;
|
|
1088
|
+
});
|
|
1089
|
+
} else {
|
|
1090
|
+
oldExpanded = old;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
expanded = (_expanded = expanded) != null ? _expanded : !exists;
|
|
1094
|
+
|
|
1095
|
+
if (!exists && expanded) {
|
|
1096
|
+
var _extends2;
|
|
1097
|
+
|
|
1098
|
+
return _extends({}, oldExpanded, (_extends2 = {}, _extends2[row.id] = true, _extends2));
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
if (exists && !expanded) {
|
|
1102
|
+
var _oldExpanded = oldExpanded,
|
|
1103
|
+
_row$id = row.id;
|
|
1104
|
+
_oldExpanded[_row$id];
|
|
1105
|
+
var rest = _objectWithoutPropertiesLoose(_oldExpanded, [_row$id].map(_toPropertyKey));
|
|
1106
|
+
|
|
1107
|
+
return rest;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
return old;
|
|
1111
|
+
});
|
|
1234
1112
|
},
|
|
1235
1113
|
getIsExpanded: function getIsExpanded() {
|
|
1236
|
-
|
|
1114
|
+
var _instance$options$get;
|
|
1115
|
+
|
|
1116
|
+
var expanded = instance.getState().expanded;
|
|
1117
|
+
return !!((_instance$options$get = instance.options.getIsRowExpanded == null ? void 0 : instance.options.getIsRowExpanded(row)) != null ? _instance$options$get : expanded === true || (expanded == null ? void 0 : expanded[row.id]));
|
|
1237
1118
|
},
|
|
1238
1119
|
getCanExpand: function getCanExpand() {
|
|
1239
|
-
|
|
1120
|
+
var _instance$options$get2, _instance$options$ena, _row$subRows;
|
|
1121
|
+
|
|
1122
|
+
return ((_instance$options$get2 = instance.options.getRowCanExpand == null ? void 0 : instance.options.getRowCanExpand(row)) != null ? _instance$options$get2 : true) && ((_instance$options$ena = instance.options.enableExpanding) != null ? _instance$options$ena : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
|
|
1240
1123
|
},
|
|
1241
1124
|
getToggleExpandedHandler: function getToggleExpandedHandler() {
|
|
1242
|
-
|
|
1125
|
+
var canExpand = row.getCanExpand();
|
|
1126
|
+
return function () {
|
|
1127
|
+
if (!canExpand) return;
|
|
1128
|
+
row.toggleExpanded();
|
|
1129
|
+
};
|
|
1243
1130
|
}
|
|
1244
1131
|
};
|
|
1245
1132
|
}
|
|
@@ -1495,28 +1382,105 @@
|
|
|
1495
1382
|
createColumn: function createColumn(column, instance) {
|
|
1496
1383
|
return {
|
|
1497
1384
|
filterFn: column.filterFn,
|
|
1498
|
-
|
|
1499
|
-
|
|
1385
|
+
getAutoFilterFn: function getAutoFilterFn() {
|
|
1386
|
+
var firstRow = instance.getCoreRowModel().flatRows[0];
|
|
1387
|
+
var value = firstRow == null ? void 0 : firstRow.values[column.id];
|
|
1388
|
+
|
|
1389
|
+
if (typeof value === 'string') {
|
|
1390
|
+
return filterFns.includesString;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
if (typeof value === 'number') {
|
|
1394
|
+
return filterFns.inNumberRange;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
if (value !== null && typeof value === 'object') {
|
|
1398
|
+
return filterFns.equals;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
if (Array.isArray(value)) {
|
|
1402
|
+
return filterFns.arrIncludes;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
return filterFns.weakEquals;
|
|
1500
1406
|
},
|
|
1501
|
-
|
|
1502
|
-
|
|
1407
|
+
getFilterFn: function getFilterFn() {
|
|
1408
|
+
var _ref;
|
|
1409
|
+
|
|
1410
|
+
var userFilterFns = instance.options.filterFns;
|
|
1411
|
+
return isFunction(column.filterFn) ? column.filterFn : column.filterFn === 'auto' ? column.getAutoFilterFn() : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.filterFn]) != null ? _ref : filterFns[column.filterFn];
|
|
1503
1412
|
},
|
|
1504
|
-
|
|
1505
|
-
|
|
1413
|
+
getCanFilter: function getCanFilter() {
|
|
1414
|
+
var _column$enableColumnF, _instance$options$ena, _instance$options$ena2;
|
|
1415
|
+
|
|
1416
|
+
return ((_column$enableColumnF = column.enableColumnFilter) != null ? _column$enableColumnF : true) && ((_instance$options$ena = instance.options.enableColumnFilters) != null ? _instance$options$ena : true) && ((_instance$options$ena2 = instance.options.enableFilters) != null ? _instance$options$ena2 : true) && !!column.accessorFn;
|
|
1506
1417
|
},
|
|
1507
|
-
|
|
1508
|
-
|
|
1418
|
+
getCanGlobalFilter: function getCanGlobalFilter() {
|
|
1419
|
+
var _column$enableGlobalF, _instance$options$ena3, _instance$options$ena4, _instance$options$get;
|
|
1420
|
+
|
|
1421
|
+
return ((_column$enableGlobalF = column.enableGlobalFilter) != null ? _column$enableGlobalF : true) && ((_instance$options$ena3 = instance.options.enableGlobalFilter) != null ? _instance$options$ena3 : true) && ((_instance$options$ena4 = instance.options.enableFilters) != null ? _instance$options$ena4 : true) && ((_instance$options$get = instance.options.getColumnCanGlobalFilter == null ? void 0 : instance.options.getColumnCanGlobalFilter(column)) != null ? _instance$options$get : true) && !!column.accessorFn;
|
|
1509
1422
|
},
|
|
1510
|
-
|
|
1511
|
-
return
|
|
1423
|
+
getIsFiltered: function getIsFiltered() {
|
|
1424
|
+
return column.getFilterIndex() > -1;
|
|
1512
1425
|
},
|
|
1513
|
-
|
|
1514
|
-
|
|
1426
|
+
getFilterValue: function getFilterValue() {
|
|
1427
|
+
var _instance$getState$co, _instance$getState$co2;
|
|
1428
|
+
|
|
1429
|
+
return (_instance$getState$co = instance.getState().columnFilters) == null ? void 0 : (_instance$getState$co2 = _instance$getState$co.find(function (d) {
|
|
1430
|
+
return d.id === column.id;
|
|
1431
|
+
})) == null ? void 0 : _instance$getState$co2.value;
|
|
1515
1432
|
},
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1433
|
+
getFilterIndex: function getFilterIndex() {
|
|
1434
|
+
var _instance$getState$co3, _instance$getState$co4;
|
|
1435
|
+
|
|
1436
|
+
return (_instance$getState$co3 = (_instance$getState$co4 = instance.getState().columnFilters) == null ? void 0 : _instance$getState$co4.findIndex(function (d) {
|
|
1437
|
+
return d.id === column.id;
|
|
1438
|
+
})) != null ? _instance$getState$co3 : -1;
|
|
1439
|
+
},
|
|
1440
|
+
setFilterValue: function setFilterValue(value) {
|
|
1441
|
+
instance.setColumnFilters(function (old) {
|
|
1442
|
+
var filterFn = column.getFilterFn();
|
|
1443
|
+
var previousfilter = old == null ? void 0 : old.find(function (d) {
|
|
1444
|
+
return d.id === column.id;
|
|
1445
|
+
});
|
|
1446
|
+
var newFilter = functionalUpdate(value, previousfilter ? previousfilter.value : undefined); //
|
|
1447
|
+
|
|
1448
|
+
if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {
|
|
1449
|
+
var _old$filter;
|
|
1450
|
+
|
|
1451
|
+
return (_old$filter = old == null ? void 0 : old.filter(function (d) {
|
|
1452
|
+
return d.id !== column.id;
|
|
1453
|
+
})) != null ? _old$filter : [];
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
var newFilterObj = {
|
|
1457
|
+
id: column.id,
|
|
1458
|
+
value: newFilter
|
|
1459
|
+
};
|
|
1460
|
+
|
|
1461
|
+
if (previousfilter) {
|
|
1462
|
+
var _old$map;
|
|
1463
|
+
|
|
1464
|
+
return (_old$map = old == null ? void 0 : old.map(function (d) {
|
|
1465
|
+
if (d.id === column.id) {
|
|
1466
|
+
return newFilterObj;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
return d;
|
|
1470
|
+
})) != null ? _old$map : [];
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
if (old != null && old.length) {
|
|
1474
|
+
return [].concat(old, [newFilterObj]);
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
return [newFilterObj];
|
|
1478
|
+
});
|
|
1479
|
+
},
|
|
1480
|
+
getFacetedRowModel: memo(function () {
|
|
1481
|
+
return [instance.getPreFilteredRowModel(), instance.getState().columnFilters, instance.getState().globalFilter, // Include this to force the filtered facet info to be calculated
|
|
1482
|
+
instance.getFilteredRowModel()];
|
|
1483
|
+
}, function (rowModel, columnFilters, globalFilter, _) {
|
|
1520
1484
|
if (!(columnFilters != null && columnFilters.length) && !globalFilter) {
|
|
1521
1485
|
return rowModel;
|
|
1522
1486
|
}
|
|
@@ -1568,52 +1532,9 @@
|
|
|
1568
1532
|
},
|
|
1569
1533
|
createInstance: function createInstance(instance) {
|
|
1570
1534
|
return {
|
|
1571
|
-
getColumnAutoFilterFn: function getColumnAutoFilterFn(columnId) {
|
|
1572
|
-
var firstRow = instance.getCoreRowModel().flatRows[0];
|
|
1573
|
-
var value = firstRow == null ? void 0 : firstRow.values[columnId];
|
|
1574
|
-
|
|
1575
|
-
if (typeof value === 'string') {
|
|
1576
|
-
return filterFns.includesString;
|
|
1577
|
-
}
|
|
1578
|
-
|
|
1579
|
-
if (typeof value === 'number') {
|
|
1580
|
-
return filterFns.inNumberRange;
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1583
|
-
if (value !== null && typeof value === 'object') {
|
|
1584
|
-
return filterFns.equals;
|
|
1585
|
-
}
|
|
1586
|
-
|
|
1587
|
-
if (Array.isArray(value)) {
|
|
1588
|
-
return filterFns.arrIncludes;
|
|
1589
|
-
}
|
|
1590
|
-
|
|
1591
|
-
return filterFns.weakEquals;
|
|
1592
|
-
},
|
|
1593
|
-
getColumnFacetedRowModel: function getColumnFacetedRowModel(columnId) {
|
|
1594
|
-
var column = instance.getColumn(columnId);
|
|
1595
|
-
|
|
1596
|
-
if (!column) {
|
|
1597
|
-
throw new Error();
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
return column.getFacetedRowModel();
|
|
1601
|
-
},
|
|
1602
1535
|
getGlobalAutoFilterFn: function getGlobalAutoFilterFn() {
|
|
1603
1536
|
return filterFns.includesString;
|
|
1604
1537
|
},
|
|
1605
|
-
getColumnFilterFn: function getColumnFilterFn(columnId) {
|
|
1606
|
-
var _ref;
|
|
1607
|
-
|
|
1608
|
-
var column = instance.getColumn(columnId);
|
|
1609
|
-
var userFilterFns = instance.options.filterFns;
|
|
1610
|
-
|
|
1611
|
-
if (!column) {
|
|
1612
|
-
throw new Error();
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
|
-
return isFunction(column.filterFn) ? column.filterFn : column.filterFn === 'auto' ? instance.getColumnAutoFilterFn(columnId) : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.filterFn]) != null ? _ref : filterFns[column.filterFn];
|
|
1616
|
-
},
|
|
1617
1538
|
getGlobalFilterFn: function getGlobalFilterFn() {
|
|
1618
1539
|
var _ref2;
|
|
1619
1540
|
|
|
@@ -1634,7 +1555,7 @@
|
|
|
1634
1555
|
});
|
|
1635
1556
|
|
|
1636
1557
|
if (column) {
|
|
1637
|
-
var filterFn =
|
|
1558
|
+
var filterFn = column.getFilterFn();
|
|
1638
1559
|
|
|
1639
1560
|
if (shouldAutoRemoveFilter(filterFn, filter.value, column)) {
|
|
1640
1561
|
return false;
|
|
@@ -1653,96 +1574,6 @@
|
|
|
1653
1574
|
resetGlobalFilter: function resetGlobalFilter() {
|
|
1654
1575
|
instance.setGlobalFilter(instance.initialState.globalFilter);
|
|
1655
1576
|
},
|
|
1656
|
-
getColumnCanColumnFilter: function getColumnCanColumnFilter(columnId) {
|
|
1657
|
-
var _column$enableColumnF, _instance$options$ena, _instance$options$ena2;
|
|
1658
|
-
|
|
1659
|
-
var column = instance.getColumn(columnId);
|
|
1660
|
-
|
|
1661
|
-
if (!column) {
|
|
1662
|
-
throw new Error();
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
return ((_column$enableColumnF = column.enableColumnFilter) != null ? _column$enableColumnF : true) && ((_instance$options$ena = instance.options.enableColumnFilters) != null ? _instance$options$ena : true) && ((_instance$options$ena2 = instance.options.enableFilters) != null ? _instance$options$ena2 : true) && !!column.accessorFn;
|
|
1666
|
-
},
|
|
1667
|
-
getColumnCanGlobalFilter: function getColumnCanGlobalFilter(columnId) {
|
|
1668
|
-
var _column$enableGlobalF, _instance$options$ena3, _instance$options$ena4, _instance$options$get;
|
|
1669
|
-
|
|
1670
|
-
var column = instance.getColumn(columnId);
|
|
1671
|
-
|
|
1672
|
-
if (!column) {
|
|
1673
|
-
throw new Error();
|
|
1674
|
-
}
|
|
1675
|
-
|
|
1676
|
-
return ((_column$enableGlobalF = column.enableGlobalFilter) != null ? _column$enableGlobalF : true) && ((_instance$options$ena3 = instance.options.enableGlobalFilter) != null ? _instance$options$ena3 : true) && ((_instance$options$ena4 = instance.options.enableFilters) != null ? _instance$options$ena4 : true) && ((_instance$options$get = instance.options.getColumnCanGlobalFilter == null ? void 0 : instance.options.getColumnCanGlobalFilter(column)) != null ? _instance$options$get : true) && !!column.accessorFn;
|
|
1677
|
-
},
|
|
1678
|
-
getColumnIsFiltered: function getColumnIsFiltered(columnId) {
|
|
1679
|
-
return instance.getColumnFilterIndex(columnId) > -1;
|
|
1680
|
-
},
|
|
1681
|
-
getColumnFilterValue: function getColumnFilterValue(columnId) {
|
|
1682
|
-
var _instance$getState$co, _instance$getState$co2;
|
|
1683
|
-
|
|
1684
|
-
return (_instance$getState$co = instance.getState().columnFilters) == null ? void 0 : (_instance$getState$co2 = _instance$getState$co.find(function (d) {
|
|
1685
|
-
return d.id === columnId;
|
|
1686
|
-
})) == null ? void 0 : _instance$getState$co2.value;
|
|
1687
|
-
},
|
|
1688
|
-
getColumnFilterIndex: function getColumnFilterIndex(columnId) {
|
|
1689
|
-
var _instance$getState$co3, _instance$getState$co4;
|
|
1690
|
-
|
|
1691
|
-
return (_instance$getState$co3 = (_instance$getState$co4 = instance.getState().columnFilters) == null ? void 0 : _instance$getState$co4.findIndex(function (d) {
|
|
1692
|
-
return d.id === columnId;
|
|
1693
|
-
})) != null ? _instance$getState$co3 : -1;
|
|
1694
|
-
},
|
|
1695
|
-
setColumnFilterValue: function setColumnFilterValue(columnId, value) {
|
|
1696
|
-
if (!columnId) return;
|
|
1697
|
-
instance.setColumnFilters(function (old) {
|
|
1698
|
-
var column = instance.getColumn(columnId);
|
|
1699
|
-
|
|
1700
|
-
if (!column) {
|
|
1701
|
-
{
|
|
1702
|
-
console.warn("Table: Could not find a column with id: " + columnId);
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
throw new Error();
|
|
1706
|
-
}
|
|
1707
|
-
|
|
1708
|
-
var filterFn = instance.getColumnFilterFn(column.id);
|
|
1709
|
-
var previousfilter = old == null ? void 0 : old.find(function (d) {
|
|
1710
|
-
return d.id === columnId;
|
|
1711
|
-
});
|
|
1712
|
-
var newFilter = functionalUpdate(value, previousfilter ? previousfilter.value : undefined); //
|
|
1713
|
-
|
|
1714
|
-
if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {
|
|
1715
|
-
var _old$filter;
|
|
1716
|
-
|
|
1717
|
-
return (_old$filter = old == null ? void 0 : old.filter(function (d) {
|
|
1718
|
-
return d.id !== columnId;
|
|
1719
|
-
})) != null ? _old$filter : [];
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
var newFilterObj = {
|
|
1723
|
-
id: columnId,
|
|
1724
|
-
value: newFilter
|
|
1725
|
-
};
|
|
1726
|
-
|
|
1727
|
-
if (previousfilter) {
|
|
1728
|
-
var _old$map;
|
|
1729
|
-
|
|
1730
|
-
return (_old$map = old == null ? void 0 : old.map(function (d) {
|
|
1731
|
-
if (d.id === columnId) {
|
|
1732
|
-
return newFilterObj;
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1735
|
-
return d;
|
|
1736
|
-
})) != null ? _old$map : [];
|
|
1737
|
-
}
|
|
1738
|
-
|
|
1739
|
-
if (old != null && old.length) {
|
|
1740
|
-
return [].concat(old, [newFilterObj]);
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
return [newFilterObj];
|
|
1744
|
-
});
|
|
1745
|
-
},
|
|
1746
1577
|
resetColumnFilters: function resetColumnFilters() {
|
|
1747
1578
|
var _instance$initialStat, _instance$initialStat2;
|
|
1748
1579
|
|
|
@@ -1984,21 +1815,39 @@
|
|
|
1984
1815
|
},
|
|
1985
1816
|
createColumn: function createColumn(column, instance) {
|
|
1986
1817
|
return {
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1818
|
+
toggleGrouping: function toggleGrouping() {
|
|
1819
|
+
instance.setGrouping(function (old) {
|
|
1820
|
+
// Find any existing grouping for this column
|
|
1821
|
+
if (old != null && old.includes(column.id)) {
|
|
1822
|
+
return old.filter(function (d) {
|
|
1823
|
+
return d !== column.id;
|
|
1824
|
+
});
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
return [].concat(old != null ? old : [], [column.id]);
|
|
1828
|
+
});
|
|
1990
1829
|
},
|
|
1991
|
-
|
|
1992
|
-
|
|
1830
|
+
getCanGroup: function getCanGroup() {
|
|
1831
|
+
var _ref, _ref2, _ref3, _column$enableGroupin;
|
|
1832
|
+
|
|
1833
|
+
return (_ref = (_ref2 = (_ref3 = (_column$enableGroupin = column.enableGrouping) != null ? _column$enableGroupin : true) != null ? _ref3 : instance.options.enableGrouping) != null ? _ref2 : true) != null ? _ref : !!column.accessorFn;
|
|
1993
1834
|
},
|
|
1994
1835
|
getIsGrouped: function getIsGrouped() {
|
|
1995
|
-
|
|
1836
|
+
var _instance$getState$gr;
|
|
1837
|
+
|
|
1838
|
+
return (_instance$getState$gr = instance.getState().grouping) == null ? void 0 : _instance$getState$gr.includes(column.id);
|
|
1996
1839
|
},
|
|
1997
|
-
|
|
1998
|
-
|
|
1840
|
+
getGroupedIndex: function getGroupedIndex() {
|
|
1841
|
+
var _instance$getState$gr2;
|
|
1842
|
+
|
|
1843
|
+
return (_instance$getState$gr2 = instance.getState().grouping) == null ? void 0 : _instance$getState$gr2.indexOf(column.id);
|
|
1999
1844
|
},
|
|
2000
1845
|
getToggleGroupingHandler: function getToggleGroupingHandler() {
|
|
2001
|
-
|
|
1846
|
+
var canGroup = column.getCanGroup();
|
|
1847
|
+
return function () {
|
|
1848
|
+
if (!canGroup) return;
|
|
1849
|
+
column.toggleGrouping();
|
|
1850
|
+
};
|
|
2002
1851
|
}
|
|
2003
1852
|
};
|
|
2004
1853
|
},
|
|
@@ -2019,7 +1868,7 @@
|
|
|
2019
1868
|
return aggregationFns.count;
|
|
2020
1869
|
},
|
|
2021
1870
|
getColumnAggregationFn: function getColumnAggregationFn(columnId) {
|
|
2022
|
-
var
|
|
1871
|
+
var _ref4;
|
|
2023
1872
|
|
|
2024
1873
|
var column = instance.getColumn(columnId);
|
|
2025
1874
|
var userAggregationFns = instance.options.aggregationFns;
|
|
@@ -2028,62 +1877,16 @@
|
|
|
2028
1877
|
throw new Error();
|
|
2029
1878
|
}
|
|
2030
1879
|
|
|
2031
|
-
return isFunction(column.aggregationFn) ? column.aggregationFn : column.aggregationFn === 'auto' ? instance.getColumnAutoAggregationFn(columnId) : (
|
|
1880
|
+
return isFunction(column.aggregationFn) ? column.aggregationFn : column.aggregationFn === 'auto' ? instance.getColumnAutoAggregationFn(columnId) : (_ref4 = userAggregationFns == null ? void 0 : userAggregationFns[column.aggregationFn]) != null ? _ref4 : aggregationFns[column.aggregationFn];
|
|
2032
1881
|
},
|
|
2033
1882
|
setGrouping: function setGrouping(updater) {
|
|
2034
1883
|
return instance.options.onGroupingChange == null ? void 0 : instance.options.onGroupingChange(updater);
|
|
2035
1884
|
},
|
|
2036
|
-
toggleColumnGrouping: function toggleColumnGrouping(columnId) {
|
|
2037
|
-
instance.setGrouping(function (old) {
|
|
2038
|
-
// Find any existing grouping for this column
|
|
2039
|
-
if (old != null && old.includes(columnId)) {
|
|
2040
|
-
return old.filter(function (d) {
|
|
2041
|
-
return d !== columnId;
|
|
2042
|
-
});
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2045
|
-
return [].concat(old != null ? old : [], [columnId]);
|
|
2046
|
-
});
|
|
2047
|
-
},
|
|
2048
|
-
getColumnCanGroup: function getColumnCanGroup(columnId) {
|
|
2049
|
-
var _ref2, _ref3, _column$enableGroupin;
|
|
2050
|
-
|
|
2051
|
-
var column = instance.getColumn(columnId);
|
|
2052
|
-
|
|
2053
|
-
if (!column) {
|
|
2054
|
-
throw new Error();
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
return (_ref2 = (_ref3 = (_column$enableGroupin = column.enableGrouping) != null ? _column$enableGroupin : instance.options.enableGrouping) != null ? _ref3 : column.defaultCanGroup) != null ? _ref2 : !!column.accessorFn;
|
|
2058
|
-
},
|
|
2059
|
-
getColumnIsGrouped: function getColumnIsGrouped(columnId) {
|
|
2060
|
-
var _instance$getState$gr;
|
|
2061
|
-
|
|
2062
|
-
return (_instance$getState$gr = instance.getState().grouping) == null ? void 0 : _instance$getState$gr.includes(columnId);
|
|
2063
|
-
},
|
|
2064
|
-
getColumnGroupedIndex: function getColumnGroupedIndex(columnId) {
|
|
2065
|
-
var _instance$getState$gr2;
|
|
2066
|
-
|
|
2067
|
-
return (_instance$getState$gr2 = instance.getState().grouping) == null ? void 0 : _instance$getState$gr2.indexOf(columnId);
|
|
2068
|
-
},
|
|
2069
1885
|
resetGrouping: function resetGrouping() {
|
|
2070
1886
|
var _instance$initialStat, _instance$initialStat2;
|
|
2071
1887
|
|
|
2072
1888
|
instance.setGrouping((_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.grouping) != null ? _instance$initialStat : []);
|
|
2073
1889
|
},
|
|
2074
|
-
getToggleGroupingHandler: function getToggleGroupingHandler(columnId) {
|
|
2075
|
-
var column = instance.getColumn(columnId);
|
|
2076
|
-
var canGroup = column.getCanGroup();
|
|
2077
|
-
return function () {
|
|
2078
|
-
if (!canGroup) return;
|
|
2079
|
-
column.toggleGrouping == null ? void 0 : column.toggleGrouping();
|
|
2080
|
-
};
|
|
2081
|
-
},
|
|
2082
|
-
getRowIsGrouped: function getRowIsGrouped(rowId) {
|
|
2083
|
-
var _instance$getRow;
|
|
2084
|
-
|
|
2085
|
-
return !!((_instance$getRow = instance.getRow(rowId)) != null && _instance$getRow.groupingColumnId);
|
|
2086
|
-
},
|
|
2087
1890
|
getPreGroupedRowModel: function getPreGroupedRowModel() {
|
|
2088
1891
|
return instance.getSortedRowModel();
|
|
2089
1892
|
},
|
|
@@ -2103,7 +1906,7 @@
|
|
|
2103
1906
|
createRow: function createRow(row, instance) {
|
|
2104
1907
|
return {
|
|
2105
1908
|
getIsGrouped: function getIsGrouped() {
|
|
2106
|
-
return
|
|
1909
|
+
return !!row.groupingColumnId;
|
|
2107
1910
|
}
|
|
2108
1911
|
};
|
|
2109
1912
|
},
|
|
@@ -2216,7 +2019,7 @@
|
|
|
2216
2019
|
return orderColumns(orderedColumns, grouping, groupedColumnMode);
|
|
2217
2020
|
};
|
|
2218
2021
|
}, {
|
|
2219
|
-
key:
|
|
2022
|
+
key: 'getOrderColumnsFn' // debug: () => instance.options.debugAll ?? instance.options.debugTable,
|
|
2220
2023
|
|
|
2221
2024
|
})
|
|
2222
2025
|
};
|
|
@@ -2329,7 +2132,7 @@
|
|
|
2329
2132
|
|
|
2330
2133
|
return pageOptions;
|
|
2331
2134
|
}, {
|
|
2332
|
-
key:
|
|
2135
|
+
key: 'getPageOptions',
|
|
2333
2136
|
debug: function debug() {
|
|
2334
2137
|
var _instance$options$deb;
|
|
2335
2138
|
|
|
@@ -2407,17 +2210,77 @@
|
|
|
2407
2210
|
},
|
|
2408
2211
|
createColumn: function createColumn(column, instance) {
|
|
2409
2212
|
return {
|
|
2410
|
-
|
|
2411
|
-
|
|
2213
|
+
pin: function pin(position) {
|
|
2214
|
+
var columnIds = column.getLeafColumns().map(function (d) {
|
|
2215
|
+
return d.id;
|
|
2216
|
+
}).filter(Boolean);
|
|
2217
|
+
instance.setColumnPinning(function (old) {
|
|
2218
|
+
var _old$left3, _old$right3;
|
|
2219
|
+
|
|
2220
|
+
if (position === 'right') {
|
|
2221
|
+
var _old$left, _old$right;
|
|
2222
|
+
|
|
2223
|
+
return {
|
|
2224
|
+
left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter(function (d) {
|
|
2225
|
+
return !(columnIds != null && columnIds.includes(d));
|
|
2226
|
+
}),
|
|
2227
|
+
right: [].concat(((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter(function (d) {
|
|
2228
|
+
return !(columnIds != null && columnIds.includes(d));
|
|
2229
|
+
}), columnIds)
|
|
2230
|
+
};
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
if (position === 'left') {
|
|
2234
|
+
var _old$left2, _old$right2;
|
|
2235
|
+
|
|
2236
|
+
return {
|
|
2237
|
+
left: [].concat(((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter(function (d) {
|
|
2238
|
+
return !(columnIds != null && columnIds.includes(d));
|
|
2239
|
+
}), columnIds),
|
|
2240
|
+
right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter(function (d) {
|
|
2241
|
+
return !(columnIds != null && columnIds.includes(d));
|
|
2242
|
+
})
|
|
2243
|
+
};
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
return {
|
|
2247
|
+
left: ((_old$left3 = old == null ? void 0 : old.left) != null ? _old$left3 : []).filter(function (d) {
|
|
2248
|
+
return !(columnIds != null && columnIds.includes(d));
|
|
2249
|
+
}),
|
|
2250
|
+
right: ((_old$right3 = old == null ? void 0 : old.right) != null ? _old$right3 : []).filter(function (d) {
|
|
2251
|
+
return !(columnIds != null && columnIds.includes(d));
|
|
2252
|
+
})
|
|
2253
|
+
};
|
|
2254
|
+
});
|
|
2412
2255
|
},
|
|
2413
|
-
|
|
2414
|
-
|
|
2256
|
+
getCanPin: function getCanPin() {
|
|
2257
|
+
var leafColumns = column.getLeafColumns();
|
|
2258
|
+
return leafColumns.some(function (d) {
|
|
2259
|
+
var _d$enablePinning, _instance$options$ena;
|
|
2260
|
+
|
|
2261
|
+
return ((_d$enablePinning = d.enablePinning) != null ? _d$enablePinning : true) && ((_instance$options$ena = instance.options.enablePinning) != null ? _instance$options$ena : true);
|
|
2262
|
+
});
|
|
2415
2263
|
},
|
|
2416
2264
|
getIsPinned: function getIsPinned() {
|
|
2417
|
-
|
|
2265
|
+
var leafColumnIds = column.getLeafColumns().map(function (d) {
|
|
2266
|
+
return d.id;
|
|
2267
|
+
});
|
|
2268
|
+
var _instance$getState$co = instance.getState().columnPinning,
|
|
2269
|
+
left = _instance$getState$co.left,
|
|
2270
|
+
right = _instance$getState$co.right;
|
|
2271
|
+
var isLeft = leafColumnIds.some(function (d) {
|
|
2272
|
+
return left == null ? void 0 : left.includes(d);
|
|
2273
|
+
});
|
|
2274
|
+
var isRight = leafColumnIds.some(function (d) {
|
|
2275
|
+
return right == null ? void 0 : right.includes(d);
|
|
2276
|
+
});
|
|
2277
|
+
return isLeft ? 'left' : isRight ? 'right' : false;
|
|
2418
2278
|
},
|
|
2419
|
-
|
|
2420
|
-
|
|
2279
|
+
getPinnedIndex: function getPinnedIndex() {
|
|
2280
|
+
var _instance$getState$co2, _instance$getState$co3, _instance$getState$co4;
|
|
2281
|
+
|
|
2282
|
+
var position = column.getIsPinned();
|
|
2283
|
+
return position ? (_instance$getState$co2 = (_instance$getState$co3 = instance.getState().columnPinning) == null ? void 0 : (_instance$getState$co4 = _instance$getState$co3[position]) == null ? void 0 : _instance$getState$co4.indexOf(column.id)) != null ? _instance$getState$co2 : -1 : 0;
|
|
2421
2284
|
}
|
|
2422
2285
|
};
|
|
2423
2286
|
},
|
|
@@ -2492,91 +2355,6 @@
|
|
|
2492
2355
|
|
|
2493
2356
|
return instance.setColumnPinning((_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.columnPinning) != null ? _instance$initialStat : {});
|
|
2494
2357
|
},
|
|
2495
|
-
pinColumn: function pinColumn(columnId, position) {
|
|
2496
|
-
var column = instance.getColumn(columnId);
|
|
2497
|
-
var columnIds = column == null ? void 0 : column.getLeafColumns().map(function (d) {
|
|
2498
|
-
return d.id;
|
|
2499
|
-
}).filter(Boolean);
|
|
2500
|
-
instance.setColumnPinning(function (old) {
|
|
2501
|
-
var _old$left3, _old$right3;
|
|
2502
|
-
|
|
2503
|
-
if (position === 'right') {
|
|
2504
|
-
var _old$left, _old$right;
|
|
2505
|
-
|
|
2506
|
-
return {
|
|
2507
|
-
left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter(function (d) {
|
|
2508
|
-
return !(columnIds != null && columnIds.includes(d));
|
|
2509
|
-
}),
|
|
2510
|
-
right: [].concat(((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter(function (d) {
|
|
2511
|
-
return !(columnIds != null && columnIds.includes(d));
|
|
2512
|
-
}), columnIds)
|
|
2513
|
-
};
|
|
2514
|
-
}
|
|
2515
|
-
|
|
2516
|
-
if (position === 'left') {
|
|
2517
|
-
var _old$left2, _old$right2;
|
|
2518
|
-
|
|
2519
|
-
return {
|
|
2520
|
-
left: [].concat(((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter(function (d) {
|
|
2521
|
-
return !(columnIds != null && columnIds.includes(d));
|
|
2522
|
-
}), columnIds),
|
|
2523
|
-
right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter(function (d) {
|
|
2524
|
-
return !(columnIds != null && columnIds.includes(d));
|
|
2525
|
-
})
|
|
2526
|
-
};
|
|
2527
|
-
}
|
|
2528
|
-
|
|
2529
|
-
return {
|
|
2530
|
-
left: ((_old$left3 = old == null ? void 0 : old.left) != null ? _old$left3 : []).filter(function (d) {
|
|
2531
|
-
return !(columnIds != null && columnIds.includes(d));
|
|
2532
|
-
}),
|
|
2533
|
-
right: ((_old$right3 = old == null ? void 0 : old.right) != null ? _old$right3 : []).filter(function (d) {
|
|
2534
|
-
return !(columnIds != null && columnIds.includes(d));
|
|
2535
|
-
})
|
|
2536
|
-
};
|
|
2537
|
-
});
|
|
2538
|
-
},
|
|
2539
|
-
getColumnCanPin: function getColumnCanPin(columnId) {
|
|
2540
|
-
var column = instance.getColumn(columnId);
|
|
2541
|
-
|
|
2542
|
-
if (!column) {
|
|
2543
|
-
throw new Error();
|
|
2544
|
-
}
|
|
2545
|
-
|
|
2546
|
-
var leafColumns = column.getLeafColumns();
|
|
2547
|
-
return leafColumns.some(function (d) {
|
|
2548
|
-
var _d$enablePinning, _instance$options$ena;
|
|
2549
|
-
|
|
2550
|
-
return ((_d$enablePinning = d.enablePinning) != null ? _d$enablePinning : true) && ((_instance$options$ena = instance.options.enablePinning) != null ? _instance$options$ena : true);
|
|
2551
|
-
});
|
|
2552
|
-
},
|
|
2553
|
-
getColumnIsPinned: function getColumnIsPinned(columnId) {
|
|
2554
|
-
var column = instance.getColumn(columnId);
|
|
2555
|
-
|
|
2556
|
-
if (!column) {
|
|
2557
|
-
throw new Error();
|
|
2558
|
-
}
|
|
2559
|
-
|
|
2560
|
-
var leafColumnIds = column.getLeafColumns().map(function (d) {
|
|
2561
|
-
return d.id;
|
|
2562
|
-
});
|
|
2563
|
-
var _instance$getState$co = instance.getState().columnPinning,
|
|
2564
|
-
left = _instance$getState$co.left,
|
|
2565
|
-
right = _instance$getState$co.right;
|
|
2566
|
-
var isLeft = leafColumnIds.some(function (d) {
|
|
2567
|
-
return left == null ? void 0 : left.includes(d);
|
|
2568
|
-
});
|
|
2569
|
-
var isRight = leafColumnIds.some(function (d) {
|
|
2570
|
-
return right == null ? void 0 : right.includes(d);
|
|
2571
|
-
});
|
|
2572
|
-
return isLeft ? 'left' : isRight ? 'right' : false;
|
|
2573
|
-
},
|
|
2574
|
-
getColumnPinnedIndex: function getColumnPinnedIndex(columnId) {
|
|
2575
|
-
var _instance$getState$co2, _instance$getState$co3, _instance$getState$co4;
|
|
2576
|
-
|
|
2577
|
-
var position = instance.getColumnIsPinned(columnId);
|
|
2578
|
-
return position ? (_instance$getState$co2 = (_instance$getState$co3 = instance.getState().columnPinning) == null ? void 0 : (_instance$getState$co4 = _instance$getState$co3[position]) == null ? void 0 : _instance$getState$co4.indexOf(columnId)) != null ? _instance$getState$co2 : -1 : 0;
|
|
2579
|
-
},
|
|
2580
2358
|
getIsSomeColumnsPinned: function getIsSomeColumnsPinned() {
|
|
2581
2359
|
var _instance$getState$co5 = instance.getState().columnPinning,
|
|
2582
2360
|
left = _instance$getState$co5.left,
|
|
@@ -2592,7 +2370,7 @@
|
|
|
2592
2370
|
});
|
|
2593
2371
|
}).filter(Boolean);
|
|
2594
2372
|
}, {
|
|
2595
|
-
key:
|
|
2373
|
+
key: 'getLeftLeafColumns',
|
|
2596
2374
|
debug: function debug() {
|
|
2597
2375
|
var _instance$options$deb4;
|
|
2598
2376
|
|
|
@@ -2608,7 +2386,7 @@
|
|
|
2608
2386
|
});
|
|
2609
2387
|
}).filter(Boolean);
|
|
2610
2388
|
}, {
|
|
2611
|
-
key:
|
|
2389
|
+
key: 'getRightLeafColumns',
|
|
2612
2390
|
debug: function debug() {
|
|
2613
2391
|
var _instance$options$deb5;
|
|
2614
2392
|
|
|
@@ -2623,7 +2401,7 @@
|
|
|
2623
2401
|
return !leftAndRight.includes(d.id);
|
|
2624
2402
|
});
|
|
2625
2403
|
}, {
|
|
2626
|
-
key:
|
|
2404
|
+
key: 'getCenterLeafColumns',
|
|
2627
2405
|
debug: function debug() {
|
|
2628
2406
|
var _instance$options$deb6;
|
|
2629
2407
|
|
|
@@ -2696,22 +2474,6 @@
|
|
|
2696
2474
|
return rowSelection;
|
|
2697
2475
|
});
|
|
2698
2476
|
},
|
|
2699
|
-
toggleRowSelected: function toggleRowSelected(rowId, value) {
|
|
2700
|
-
var row = instance.getRow(rowId);
|
|
2701
|
-
var isSelected = row.getIsSelected();
|
|
2702
|
-
instance.setRowSelection(function (old) {
|
|
2703
|
-
value = typeof value !== 'undefined' ? value : !isSelected;
|
|
2704
|
-
|
|
2705
|
-
if (isSelected === value) {
|
|
2706
|
-
return old;
|
|
2707
|
-
}
|
|
2708
|
-
|
|
2709
|
-
var selectedRowIds = _extends({}, old);
|
|
2710
|
-
|
|
2711
|
-
mutateRowIsSelected(selectedRowIds, rowId, value, instance);
|
|
2712
|
-
return selectedRowIds;
|
|
2713
|
-
});
|
|
2714
|
-
},
|
|
2715
2477
|
// addRowSelectionRange: rowId => {
|
|
2716
2478
|
// const {
|
|
2717
2479
|
// rows,
|
|
@@ -2778,7 +2540,7 @@
|
|
|
2778
2540
|
|
|
2779
2541
|
return selectRowsFn(instance, rowModel);
|
|
2780
2542
|
}, {
|
|
2781
|
-
key:
|
|
2543
|
+
key: 'getSelectedRowModel',
|
|
2782
2544
|
debug: function debug() {
|
|
2783
2545
|
var _instance$options$deb;
|
|
2784
2546
|
|
|
@@ -2799,102 +2561,33 @@
|
|
|
2799
2561
|
return selectRowsFn(instance, rowModel);
|
|
2800
2562
|
}, {
|
|
2801
2563
|
key: "development" === 'production' ,
|
|
2802
|
-
debug: function debug() {
|
|
2803
|
-
var _instance$options$deb2;
|
|
2804
|
-
|
|
2805
|
-
return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugTable;
|
|
2806
|
-
}
|
|
2807
|
-
}),
|
|
2808
|
-
getGroupedSelectedRowModel: memo(function () {
|
|
2809
|
-
return [instance.getState().rowSelection, instance.getGroupedRowModel()];
|
|
2810
|
-
}, function (rowSelection, rowModel) {
|
|
2811
|
-
if (!Object.keys(rowSelection).length) {
|
|
2812
|
-
return {
|
|
2813
|
-
rows: [],
|
|
2814
|
-
flatRows: [],
|
|
2815
|
-
rowsById: {}
|
|
2816
|
-
};
|
|
2817
|
-
}
|
|
2818
|
-
|
|
2819
|
-
return selectRowsFn(instance, rowModel);
|
|
2820
|
-
}, {
|
|
2821
|
-
key: "development" === 'production' ,
|
|
2822
|
-
debug: function debug() {
|
|
2823
|
-
var _instance$options$deb3;
|
|
2824
|
-
|
|
2825
|
-
return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugTable;
|
|
2826
|
-
}
|
|
2827
|
-
}),
|
|
2828
|
-
///
|
|
2829
|
-
getRowIsSelected: function getRowIsSelected(rowId) {
|
|
2830
|
-
var _instance$getState = instance.getState(),
|
|
2831
|
-
rowSelection = _instance$getState.rowSelection;
|
|
2832
|
-
|
|
2833
|
-
var row = instance.getRow(rowId);
|
|
2834
|
-
|
|
2835
|
-
if (!row) {
|
|
2836
|
-
throw new Error();
|
|
2837
|
-
}
|
|
2838
|
-
|
|
2839
|
-
return isRowSelected(row, rowSelection) === true;
|
|
2840
|
-
},
|
|
2841
|
-
getRowIsSomeSelected: function getRowIsSomeSelected(rowId) {
|
|
2842
|
-
var _instance$getState2 = instance.getState(),
|
|
2843
|
-
rowSelection = _instance$getState2.rowSelection;
|
|
2844
|
-
|
|
2845
|
-
var row = instance.getRow(rowId);
|
|
2846
|
-
|
|
2847
|
-
if (!row) {
|
|
2848
|
-
throw new Error();
|
|
2849
|
-
}
|
|
2850
|
-
|
|
2851
|
-
return isRowSelected(row, rowSelection) === 'some';
|
|
2852
|
-
},
|
|
2853
|
-
getRowCanSelect: function getRowCanSelect(rowId) {
|
|
2854
|
-
var _instance$options$ena;
|
|
2855
|
-
|
|
2856
|
-
var row = instance.getRow(rowId);
|
|
2857
|
-
|
|
2858
|
-
if (!row) {
|
|
2859
|
-
throw new Error();
|
|
2860
|
-
}
|
|
2861
|
-
|
|
2862
|
-
if (typeof instance.options.enableRowSelection === 'function') {
|
|
2863
|
-
return instance.options.enableRowSelection(row);
|
|
2864
|
-
}
|
|
2865
|
-
|
|
2866
|
-
return (_instance$options$ena = instance.options.enableRowSelection) != null ? _instance$options$ena : true;
|
|
2867
|
-
},
|
|
2868
|
-
getRowCanSelectSubRows: function getRowCanSelectSubRows(rowId) {
|
|
2869
|
-
var _instance$options$ena2;
|
|
2870
|
-
|
|
2871
|
-
var row = instance.getRow(rowId);
|
|
2872
|
-
|
|
2873
|
-
if (!row) {
|
|
2874
|
-
throw new Error();
|
|
2875
|
-
}
|
|
2876
|
-
|
|
2877
|
-
if (typeof instance.options.enableSubRowSelection === 'function') {
|
|
2878
|
-
return instance.options.enableSubRowSelection(row);
|
|
2879
|
-
}
|
|
2880
|
-
|
|
2881
|
-
return (_instance$options$ena2 = instance.options.enableSubRowSelection) != null ? _instance$options$ena2 : true;
|
|
2882
|
-
},
|
|
2883
|
-
getRowCanMultiSelect: function getRowCanMultiSelect(rowId) {
|
|
2884
|
-
var _instance$options$ena3;
|
|
2885
|
-
|
|
2886
|
-
var row = instance.getRow(rowId);
|
|
2564
|
+
debug: function debug() {
|
|
2565
|
+
var _instance$options$deb2;
|
|
2887
2566
|
|
|
2888
|
-
|
|
2889
|
-
throw new Error();
|
|
2567
|
+
return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugTable;
|
|
2890
2568
|
}
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2569
|
+
}),
|
|
2570
|
+
getGroupedSelectedRowModel: memo(function () {
|
|
2571
|
+
return [instance.getState().rowSelection, instance.getGroupedRowModel()];
|
|
2572
|
+
}, function (rowSelection, rowModel) {
|
|
2573
|
+
if (!Object.keys(rowSelection).length) {
|
|
2574
|
+
return {
|
|
2575
|
+
rows: [],
|
|
2576
|
+
flatRows: [],
|
|
2577
|
+
rowsById: {}
|
|
2578
|
+
};
|
|
2894
2579
|
}
|
|
2895
2580
|
|
|
2896
|
-
return (
|
|
2897
|
-
},
|
|
2581
|
+
return selectRowsFn(instance, rowModel);
|
|
2582
|
+
}, {
|
|
2583
|
+
key: "development" === 'production' ,
|
|
2584
|
+
debug: function debug() {
|
|
2585
|
+
var _instance$options$deb3;
|
|
2586
|
+
|
|
2587
|
+
return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugTable;
|
|
2588
|
+
}
|
|
2589
|
+
}),
|
|
2590
|
+
///
|
|
2898
2591
|
// getGroupingRowCanSelect: rowId => {
|
|
2899
2592
|
// const row = instance.getRow(rowId)
|
|
2900
2593
|
// if (!row) {
|
|
@@ -2908,8 +2601,8 @@
|
|
|
2908
2601
|
getIsAllRowsSelected: function getIsAllRowsSelected() {
|
|
2909
2602
|
var preFilteredFlatRows = instance.getPreFilteredRowModel().flatRows;
|
|
2910
2603
|
|
|
2911
|
-
var _instance$
|
|
2912
|
-
rowSelection = _instance$
|
|
2604
|
+
var _instance$getState = instance.getState(),
|
|
2605
|
+
rowSelection = _instance$getState.rowSelection;
|
|
2913
2606
|
|
|
2914
2607
|
var isAllRowsSelected = Boolean(preFilteredFlatRows.length && Object.keys(rowSelection).length);
|
|
2915
2608
|
|
|
@@ -2926,8 +2619,8 @@
|
|
|
2926
2619
|
getIsAllPageRowsSelected: function getIsAllPageRowsSelected() {
|
|
2927
2620
|
var paginationFlatRows = instance.getPaginationRowModel().flatRows;
|
|
2928
2621
|
|
|
2929
|
-
var _instance$
|
|
2930
|
-
rowSelection = _instance$
|
|
2622
|
+
var _instance$getState2 = instance.getState(),
|
|
2623
|
+
rowSelection = _instance$getState2.rowSelection;
|
|
2931
2624
|
|
|
2932
2625
|
var isAllPageRowsSelected = !!paginationFlatRows.length;
|
|
2933
2626
|
|
|
@@ -2948,18 +2641,6 @@
|
|
|
2948
2641
|
var paginationFlatRows = instance.getPaginationRowModel().flatRows;
|
|
2949
2642
|
return instance.getIsAllPageRowsSelected() ? false : !!(paginationFlatRows != null && paginationFlatRows.length);
|
|
2950
2643
|
},
|
|
2951
|
-
getToggleRowSelectedHandler: function getToggleRowSelectedHandler(rowId) {
|
|
2952
|
-
var row = instance.getRow(rowId);
|
|
2953
|
-
row.getIsSelected();
|
|
2954
|
-
row.getIsSomeSelected();
|
|
2955
|
-
var canSelect = row.getCanSelect();
|
|
2956
|
-
return function (e) {
|
|
2957
|
-
var _target;
|
|
2958
|
-
|
|
2959
|
-
if (!canSelect) return;
|
|
2960
|
-
row.toggleSelected((_target = e.target) == null ? void 0 : _target.checked);
|
|
2961
|
-
};
|
|
2962
|
-
},
|
|
2963
2644
|
getToggleAllRowsSelectedHandler: function getToggleAllRowsSelectedHandler() {
|
|
2964
2645
|
return function (e) {
|
|
2965
2646
|
instance.toggleAllRowsSelected(e.target.checked);
|
|
@@ -2974,23 +2655,68 @@
|
|
|
2974
2655
|
},
|
|
2975
2656
|
createRow: function createRow(row, instance) {
|
|
2976
2657
|
return {
|
|
2658
|
+
toggleSelected: function toggleSelected(value) {
|
|
2659
|
+
var isSelected = row.getIsSelected();
|
|
2660
|
+
instance.setRowSelection(function (old) {
|
|
2661
|
+
value = typeof value !== 'undefined' ? value : !isSelected;
|
|
2662
|
+
|
|
2663
|
+
if (isSelected === value) {
|
|
2664
|
+
return old;
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
var selectedRowIds = _extends({}, old);
|
|
2668
|
+
|
|
2669
|
+
mutateRowIsSelected(selectedRowIds, row.id, value, instance);
|
|
2670
|
+
return selectedRowIds;
|
|
2671
|
+
});
|
|
2672
|
+
},
|
|
2977
2673
|
getIsSelected: function getIsSelected() {
|
|
2978
|
-
|
|
2674
|
+
var _instance$getState3 = instance.getState(),
|
|
2675
|
+
rowSelection = _instance$getState3.rowSelection;
|
|
2676
|
+
|
|
2677
|
+
return isRowSelected(row, rowSelection) === true;
|
|
2979
2678
|
},
|
|
2980
2679
|
getIsSomeSelected: function getIsSomeSelected() {
|
|
2981
|
-
|
|
2680
|
+
var _instance$getState4 = instance.getState(),
|
|
2681
|
+
rowSelection = _instance$getState4.rowSelection;
|
|
2682
|
+
|
|
2683
|
+
return isRowSelected(row, rowSelection) === 'some';
|
|
2982
2684
|
},
|
|
2983
|
-
|
|
2984
|
-
|
|
2685
|
+
getCanSelect: function getCanSelect() {
|
|
2686
|
+
var _instance$options$ena;
|
|
2687
|
+
|
|
2688
|
+
if (typeof instance.options.enableRowSelection === 'function') {
|
|
2689
|
+
return instance.options.enableRowSelection(row);
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2692
|
+
return (_instance$options$ena = instance.options.enableRowSelection) != null ? _instance$options$ena : true;
|
|
2985
2693
|
},
|
|
2986
|
-
|
|
2987
|
-
|
|
2694
|
+
getCanSelectSubRows: function getCanSelectSubRows() {
|
|
2695
|
+
var _instance$options$ena2;
|
|
2696
|
+
|
|
2697
|
+
if (typeof instance.options.enableSubRowSelection === 'function') {
|
|
2698
|
+
return instance.options.enableSubRowSelection(row);
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
return (_instance$options$ena2 = instance.options.enableSubRowSelection) != null ? _instance$options$ena2 : true;
|
|
2988
2702
|
},
|
|
2989
2703
|
getCanMultiSelect: function getCanMultiSelect() {
|
|
2990
|
-
|
|
2704
|
+
var _instance$options$ena3;
|
|
2705
|
+
|
|
2706
|
+
if (typeof instance.options.enableMultiRowSelection === 'function') {
|
|
2707
|
+
return instance.options.enableMultiRowSelection(row);
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2710
|
+
return (_instance$options$ena3 = instance.options.enableMultiRowSelection) != null ? _instance$options$ena3 : true;
|
|
2991
2711
|
},
|
|
2992
|
-
|
|
2993
|
-
|
|
2712
|
+
getToggleSelectedHandler: function getToggleSelectedHandler() {
|
|
2713
|
+
var canSelect = row.getCanSelect();
|
|
2714
|
+
return function (e) {
|
|
2715
|
+
var _target;
|
|
2716
|
+
|
|
2717
|
+
if (!canSelect) return;
|
|
2718
|
+
row.toggleSelected((_target = e.target) == null ? void 0 : _target.checked);
|
|
2719
|
+
};
|
|
2994
2720
|
}
|
|
2995
2721
|
};
|
|
2996
2722
|
}
|
|
@@ -3012,7 +2738,7 @@
|
|
|
3012
2738
|
} // }
|
|
3013
2739
|
|
|
3014
2740
|
|
|
3015
|
-
if ((_row$subRows = row.subRows) != null && _row$subRows.length &&
|
|
2741
|
+
if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {
|
|
3016
2742
|
row.subRows.forEach(function (row) {
|
|
3017
2743
|
return mutateRowIsSelected(selectedRowIds, row.id, value, instance);
|
|
3018
2744
|
});
|
|
@@ -3207,39 +2933,13 @@
|
|
|
3207
2933
|
},
|
|
3208
2934
|
createColumn: function createColumn(column, instance) {
|
|
3209
2935
|
return {
|
|
3210
|
-
|
|
3211
|
-
getCanSort: function getCanSort() {
|
|
3212
|
-
return instance.getColumnCanSort(column.id);
|
|
3213
|
-
},
|
|
3214
|
-
getCanMultiSort: function getCanMultiSort() {
|
|
3215
|
-
return instance.getColumnCanMultiSort(column.id);
|
|
3216
|
-
},
|
|
3217
|
-
getSortIndex: function getSortIndex() {
|
|
3218
|
-
return instance.getColumnSortIndex(column.id);
|
|
3219
|
-
},
|
|
3220
|
-
getIsSorted: function getIsSorted() {
|
|
3221
|
-
return instance.getColumnIsSorted(column.id);
|
|
3222
|
-
},
|
|
3223
|
-
resetSorting: function resetSorting() {
|
|
3224
|
-
return instance.resetSorting(column.id);
|
|
3225
|
-
},
|
|
3226
|
-
toggleSorting: function toggleSorting(desc, isMulti) {
|
|
3227
|
-
return instance.toggleColumnSorting(column.id, desc, isMulti);
|
|
3228
|
-
},
|
|
3229
|
-
getToggleSortingHandler: function getToggleSortingHandler() {
|
|
3230
|
-
return instance.getToggleSortingHandler(column.id);
|
|
3231
|
-
}
|
|
3232
|
-
};
|
|
3233
|
-
},
|
|
3234
|
-
createInstance: function createInstance(instance) {
|
|
3235
|
-
return {
|
|
3236
|
-
getColumnAutoSortingFn: function getColumnAutoSortingFn(columnId) {
|
|
2936
|
+
getAutoSortingFn: function getAutoSortingFn() {
|
|
3237
2937
|
var firstRows = instance.getFilteredRowModel().flatRows.slice(100);
|
|
3238
2938
|
var isString = false;
|
|
3239
2939
|
|
|
3240
2940
|
for (var _iterator = _createForOfIteratorHelperLoose(firstRows), _step; !(_step = _iterator()).done;) {
|
|
3241
2941
|
var row = _step.value;
|
|
3242
|
-
var value = row == null ? void 0 : row.values[
|
|
2942
|
+
var value = row == null ? void 0 : row.values[column.id];
|
|
3243
2943
|
|
|
3244
2944
|
if (Object.prototype.toString.call(value) === '[object Date]') {
|
|
3245
2945
|
return sortingFns.datetime;
|
|
@@ -3260,9 +2960,9 @@
|
|
|
3260
2960
|
|
|
3261
2961
|
return sortingFns.basic;
|
|
3262
2962
|
},
|
|
3263
|
-
|
|
2963
|
+
getAutoSortDir: function getAutoSortDir() {
|
|
3264
2964
|
var firstRow = instance.getFilteredRowModel().flatRows[0];
|
|
3265
|
-
var value = firstRow == null ? void 0 : firstRow.values[
|
|
2965
|
+
var value = firstRow == null ? void 0 : firstRow.values[column.id];
|
|
3266
2966
|
|
|
3267
2967
|
if (typeof value === 'string') {
|
|
3268
2968
|
return 'asc';
|
|
@@ -3270,27 +2970,19 @@
|
|
|
3270
2970
|
|
|
3271
2971
|
return 'desc';
|
|
3272
2972
|
},
|
|
3273
|
-
|
|
2973
|
+
getSortingFn: function getSortingFn() {
|
|
3274
2974
|
var _ref;
|
|
3275
2975
|
|
|
3276
|
-
var column = instance.getColumn(columnId);
|
|
3277
2976
|
var userSortingFn = instance.options.sortingFns;
|
|
3278
2977
|
|
|
3279
2978
|
if (!column) {
|
|
3280
2979
|
throw new Error();
|
|
3281
2980
|
}
|
|
3282
2981
|
|
|
3283
|
-
return isFunction(column.sortingFn) ? column.sortingFn : column.sortingFn === 'auto' ?
|
|
2982
|
+
return isFunction(column.sortingFn) ? column.sortingFn : column.sortingFn === 'auto' ? column.getAutoSortingFn() : (_ref = userSortingFn == null ? void 0 : userSortingFn[column.sortingFn]) != null ? _ref : sortingFns[column.sortingFn];
|
|
3284
2983
|
},
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
},
|
|
3288
|
-
toggleColumnSorting: function toggleColumnSorting(columnId, desc, multi) {
|
|
3289
|
-
var column = instance.getColumn(columnId);
|
|
3290
|
-
|
|
3291
|
-
if (!column) {
|
|
3292
|
-
throw new Error();
|
|
3293
|
-
} // if (column.columns.length) {
|
|
2984
|
+
toggleSorting: function toggleSorting(desc, multi) {
|
|
2985
|
+
// if (column.columns.length) {
|
|
3294
2986
|
// column.columns.forEach((c, i) => {
|
|
3295
2987
|
// if (c.id) {
|
|
3296
2988
|
// instance.toggleColumnSorting(c.id, undefined, multi || !!i)
|
|
@@ -3298,17 +2990,15 @@
|
|
|
3298
2990
|
// })
|
|
3299
2991
|
// return
|
|
3300
2992
|
// }
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
2993
|
instance.setSorting(function (old) {
|
|
3304
2994
|
var _ref2, _column$sortDescFirst, _instance$options$ena, _instance$options$ena2;
|
|
3305
2995
|
|
|
3306
2996
|
// Find any existing sorting for this column
|
|
3307
2997
|
var existingSorting = old == null ? void 0 : old.find(function (d) {
|
|
3308
|
-
return d.id ===
|
|
2998
|
+
return d.id === column.id;
|
|
3309
2999
|
});
|
|
3310
3000
|
var existingIndex = old == null ? void 0 : old.findIndex(function (d) {
|
|
3311
|
-
return d.id ===
|
|
3001
|
+
return d.id === column.id;
|
|
3312
3002
|
});
|
|
3313
3003
|
var hasDescDefined = typeof desc !== 'undefined' && desc !== null;
|
|
3314
3004
|
var newSorting = []; // What should we do with this sort action?
|
|
@@ -3332,7 +3022,7 @@
|
|
|
3332
3022
|
}
|
|
3333
3023
|
}
|
|
3334
3024
|
|
|
3335
|
-
var sortDescFirst = (_ref2 = (_column$sortDescFirst = column.sortDescFirst) != null ? _column$sortDescFirst : instance.options.sortDescFirst) != null ? _ref2 :
|
|
3025
|
+
var sortDescFirst = (_ref2 = (_column$sortDescFirst = column.sortDescFirst) != null ? _column$sortDescFirst : instance.options.sortDescFirst) != null ? _ref2 : column.getAutoSortDir() === 'desc'; // Handle toggle states that will remove the sorting
|
|
3336
3026
|
|
|
3337
3027
|
if (sortAction === 'toggle' && ( // Must be toggling
|
|
3338
3028
|
(_instance$options$ena = instance.options.enableSortingRemoval) != null ? _instance$options$ena : true) && // If enableSortRemove, enable in general
|
|
@@ -3345,14 +3035,14 @@
|
|
|
3345
3035
|
|
|
3346
3036
|
if (sortAction === 'replace') {
|
|
3347
3037
|
newSorting = [{
|
|
3348
|
-
id:
|
|
3038
|
+
id: column.id,
|
|
3349
3039
|
desc: hasDescDefined ? desc : !!sortDescFirst
|
|
3350
3040
|
}];
|
|
3351
3041
|
} else if (sortAction === 'add' && old != null && old.length) {
|
|
3352
3042
|
var _instance$options$max;
|
|
3353
3043
|
|
|
3354
3044
|
newSorting = [].concat(old, [{
|
|
3355
|
-
id:
|
|
3045
|
+
id: column.id,
|
|
3356
3046
|
desc: hasDescDefined ? desc : !!sortDescFirst
|
|
3357
3047
|
}]); // Take latest n columns
|
|
3358
3048
|
|
|
@@ -3360,7 +3050,7 @@
|
|
|
3360
3050
|
} else if (sortAction === 'toggle' && old != null && old.length) {
|
|
3361
3051
|
// This flips (or sets) the
|
|
3362
3052
|
newSorting = old.map(function (d) {
|
|
3363
|
-
if (d.id ===
|
|
3053
|
+
if (d.id === column.id) {
|
|
3364
3054
|
return _extends({}, d, {
|
|
3365
3055
|
desc: hasDescDefined ? desc : !(existingSorting != null && existingSorting.desc)
|
|
3366
3056
|
});
|
|
@@ -3370,51 +3060,36 @@
|
|
|
3370
3060
|
});
|
|
3371
3061
|
} else if (sortAction === 'remove' && old != null && old.length) {
|
|
3372
3062
|
newSorting = old.filter(function (d) {
|
|
3373
|
-
return d.id !==
|
|
3063
|
+
return d.id !== column.id;
|
|
3374
3064
|
});
|
|
3375
3065
|
}
|
|
3376
3066
|
|
|
3377
3067
|
return newSorting;
|
|
3378
3068
|
});
|
|
3379
3069
|
},
|
|
3380
|
-
|
|
3381
|
-
var
|
|
3382
|
-
|
|
3383
|
-
var column = instance.getColumn(columnId);
|
|
3384
|
-
|
|
3385
|
-
if (!column) {
|
|
3386
|
-
throw new Error();
|
|
3387
|
-
}
|
|
3070
|
+
getCanSort: function getCanSort() {
|
|
3071
|
+
var _column$enableSorting, _instance$options$ena3;
|
|
3388
3072
|
|
|
3389
|
-
return (
|
|
3390
|
-
// column.columns?.some(c => c.id && instance.getColumnCanSort(c.id))) ??
|
|
3391
|
-
// false
|
|
3392
|
-
;
|
|
3073
|
+
return ((_column$enableSorting = column.enableSorting) != null ? _column$enableSorting : true) && ((_instance$options$ena3 = instance.options.enableSorting) != null ? _instance$options$ena3 : true) && !!column.accessorFn;
|
|
3393
3074
|
},
|
|
3394
|
-
|
|
3395
|
-
var
|
|
3396
|
-
|
|
3397
|
-
var column = instance.getColumn(columnId);
|
|
3398
|
-
|
|
3399
|
-
if (!column) {
|
|
3400
|
-
throw new Error();
|
|
3401
|
-
}
|
|
3075
|
+
getCanMultiSort: function getCanMultiSort() {
|
|
3076
|
+
var _ref3, _column$enableMultiSo;
|
|
3402
3077
|
|
|
3403
|
-
return (
|
|
3078
|
+
return (_ref3 = (_column$enableMultiSo = column.enableMultiSort) != null ? _column$enableMultiSo : instance.options.enableMultiSort) != null ? _ref3 : !!column.accessorFn;
|
|
3404
3079
|
},
|
|
3405
|
-
|
|
3080
|
+
getIsSorted: function getIsSorted() {
|
|
3406
3081
|
var _instance$getState$so;
|
|
3407
3082
|
|
|
3408
3083
|
var columnSort = (_instance$getState$so = instance.getState().sorting) == null ? void 0 : _instance$getState$so.find(function (d) {
|
|
3409
|
-
return d.id ===
|
|
3084
|
+
return d.id === column.id;
|
|
3410
3085
|
});
|
|
3411
3086
|
return !columnSort ? false : columnSort.desc ? 'desc' : 'asc';
|
|
3412
3087
|
},
|
|
3413
|
-
|
|
3088
|
+
getSortIndex: function getSortIndex() {
|
|
3414
3089
|
var _instance$getState$so2, _instance$getState$so3;
|
|
3415
3090
|
|
|
3416
3091
|
return (_instance$getState$so2 = (_instance$getState$so3 = instance.getState().sorting) == null ? void 0 : _instance$getState$so3.findIndex(function (d) {
|
|
3417
|
-
return d.id ===
|
|
3092
|
+
return d.id === column.id;
|
|
3418
3093
|
})) != null ? _instance$getState$so2 : -1;
|
|
3419
3094
|
},
|
|
3420
3095
|
resetSorting: function resetSorting(columnId) {
|
|
@@ -3430,19 +3105,20 @@
|
|
|
3430
3105
|
instance.setSorting((_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.sorting) != null ? _instance$initialStat : []);
|
|
3431
3106
|
}
|
|
3432
3107
|
},
|
|
3433
|
-
getToggleSortingHandler: function getToggleSortingHandler(
|
|
3434
|
-
var column = instance.getColumn(columnId);
|
|
3435
|
-
|
|
3436
|
-
if (!column) {
|
|
3437
|
-
throw new Error();
|
|
3438
|
-
}
|
|
3439
|
-
|
|
3108
|
+
getToggleSortingHandler: function getToggleSortingHandler() {
|
|
3440
3109
|
var canSort = column.getCanSort();
|
|
3441
3110
|
return function (e) {
|
|
3442
3111
|
if (!canSort) return;
|
|
3443
3112
|
e.persist == null ? void 0 : e.persist();
|
|
3444
3113
|
column.toggleSorting == null ? void 0 : column.toggleSorting(undefined, column.getCanMultiSort() ? instance.options.isMultiSortEvent == null ? void 0 : instance.options.isMultiSortEvent(e) : false);
|
|
3445
3114
|
};
|
|
3115
|
+
}
|
|
3116
|
+
};
|
|
3117
|
+
},
|
|
3118
|
+
createInstance: function createInstance(instance) {
|
|
3119
|
+
return {
|
|
3120
|
+
setSorting: function setSorting(updater) {
|
|
3121
|
+
return instance.options.onSortingChange == null ? void 0 : instance.options.onSortingChange(updater);
|
|
3446
3122
|
},
|
|
3447
3123
|
getPreSortedRowModel: function getPreSortedRowModel() {
|
|
3448
3124
|
return instance.getFilteredRowModel();
|
|
@@ -3481,14 +3157,24 @@
|
|
|
3481
3157
|
},
|
|
3482
3158
|
createColumn: function createColumn(column, instance) {
|
|
3483
3159
|
return {
|
|
3484
|
-
|
|
3485
|
-
|
|
3160
|
+
toggleVisibility: function toggleVisibility(value) {
|
|
3161
|
+
if (column.getCanHide()) {
|
|
3162
|
+
instance.setColumnVisibility(function (old) {
|
|
3163
|
+
var _extends2;
|
|
3164
|
+
|
|
3165
|
+
return _extends({}, old, (_extends2 = {}, _extends2[column.id] = value != null ? value : !column.getIsVisible(), _extends2));
|
|
3166
|
+
});
|
|
3167
|
+
}
|
|
3486
3168
|
},
|
|
3487
3169
|
getIsVisible: function getIsVisible() {
|
|
3488
|
-
|
|
3170
|
+
var _instance$getState$co, _instance$getState$co2;
|
|
3171
|
+
|
|
3172
|
+
return (_instance$getState$co = (_instance$getState$co2 = instance.getState().columnVisibility) == null ? void 0 : _instance$getState$co2[column.id]) != null ? _instance$getState$co : true;
|
|
3489
3173
|
},
|
|
3490
|
-
|
|
3491
|
-
|
|
3174
|
+
getCanHide: function getCanHide() {
|
|
3175
|
+
var _column$enableHiding, _instance$options$ena;
|
|
3176
|
+
|
|
3177
|
+
return ((_column$enableHiding = column.enableHiding) != null ? _column$enableHiding : true) && ((_instance$options$ena = instance.options.enableHiding) != null ? _instance$options$ena : true);
|
|
3492
3178
|
},
|
|
3493
3179
|
getToggleVisibilityHandler: function getToggleVisibilityHandler() {
|
|
3494
3180
|
return function (e) {
|
|
@@ -3522,7 +3208,7 @@
|
|
|
3522
3208
|
}, function (left, center, right) {
|
|
3523
3209
|
return [].concat(left, center, right);
|
|
3524
3210
|
}, {
|
|
3525
|
-
key:
|
|
3211
|
+
key: 'row.getVisibleCells',
|
|
3526
3212
|
debug: function debug() {
|
|
3527
3213
|
var _instance$options$deb2;
|
|
3528
3214
|
|
|
@@ -3572,17 +3258,6 @@
|
|
|
3572
3258
|
setColumnVisibility: function setColumnVisibility(updater) {
|
|
3573
3259
|
return instance.options.onColumnVisibilityChange == null ? void 0 : instance.options.onColumnVisibilityChange(updater);
|
|
3574
3260
|
},
|
|
3575
|
-
toggleColumnVisibility: function toggleColumnVisibility(columnId, value) {
|
|
3576
|
-
if (!columnId) return;
|
|
3577
|
-
|
|
3578
|
-
if (instance.getColumnCanHide(columnId)) {
|
|
3579
|
-
instance.setColumnVisibility(function (old) {
|
|
3580
|
-
var _extends2;
|
|
3581
|
-
|
|
3582
|
-
return _extends({}, old, (_extends2 = {}, _extends2[columnId] = value != null ? value : !instance.getColumnIsVisible(columnId), _extends2));
|
|
3583
|
-
});
|
|
3584
|
-
}
|
|
3585
|
-
},
|
|
3586
3261
|
toggleAllColumnsVisible: function toggleAllColumnsVisible(value) {
|
|
3587
3262
|
var _value;
|
|
3588
3263
|
|
|
@@ -3593,28 +3268,6 @@
|
|
|
3593
3268
|
return _extends({}, obj, (_extends3 = {}, _extends3[column.id] = !value ? !(column.getCanHide != null && column.getCanHide()) : value, _extends3));
|
|
3594
3269
|
}, {}));
|
|
3595
3270
|
},
|
|
3596
|
-
getColumnIsVisible: function getColumnIsVisible(columnId) {
|
|
3597
|
-
var _ref, _instance$getState$co, _instance$getState$co2;
|
|
3598
|
-
|
|
3599
|
-
var column = instance.getColumn(columnId);
|
|
3600
|
-
|
|
3601
|
-
if (!column) {
|
|
3602
|
-
throw new Error();
|
|
3603
|
-
}
|
|
3604
|
-
|
|
3605
|
-
return (_ref = (_instance$getState$co = (_instance$getState$co2 = instance.getState().columnVisibility) == null ? void 0 : _instance$getState$co2[columnId]) != null ? _instance$getState$co : column.defaultIsVisible) != null ? _ref : true;
|
|
3606
|
-
},
|
|
3607
|
-
getColumnCanHide: function getColumnCanHide(columnId) {
|
|
3608
|
-
var _ref2, _ref3, _instance$options$ena;
|
|
3609
|
-
|
|
3610
|
-
var column = instance.getColumn(columnId);
|
|
3611
|
-
|
|
3612
|
-
if (!column) {
|
|
3613
|
-
throw new Error();
|
|
3614
|
-
}
|
|
3615
|
-
|
|
3616
|
-
return (_ref2 = (_ref3 = (_instance$options$ena = instance.options.enableHiding) != null ? _instance$options$ena : column.enableHiding) != null ? _ref3 : column.defaultCanHide) != null ? _ref2 : true;
|
|
3617
|
-
},
|
|
3618
3271
|
getIsAllColumnsVisible: function getIsAllColumnsVisible() {
|
|
3619
3272
|
return !instance.getAllLeafColumns().some(function (column) {
|
|
3620
3273
|
return !(column.getIsVisible != null && column.getIsVisible());
|
|
@@ -3655,30 +3308,6 @@
|
|
|
3655
3308
|
colSpan: 0,
|
|
3656
3309
|
rowSpan: 0,
|
|
3657
3310
|
headerGroup: null,
|
|
3658
|
-
getSize: function getSize() {
|
|
3659
|
-
var sum = 0;
|
|
3660
|
-
|
|
3661
|
-
var recurse = function recurse(header) {
|
|
3662
|
-
if (header.subHeaders.length) {
|
|
3663
|
-
header.subHeaders.forEach(recurse);
|
|
3664
|
-
} else {
|
|
3665
|
-
var _header$column$getSiz;
|
|
3666
|
-
|
|
3667
|
-
sum += (_header$column$getSiz = header.column.getSize()) != null ? _header$column$getSiz : 0;
|
|
3668
|
-
}
|
|
3669
|
-
};
|
|
3670
|
-
|
|
3671
|
-
recurse(header);
|
|
3672
|
-
return sum;
|
|
3673
|
-
},
|
|
3674
|
-
getStart: function getStart() {
|
|
3675
|
-
if (header.index > 0) {
|
|
3676
|
-
var prevSiblingHeader = header.headerGroup.headers[header.index - 1];
|
|
3677
|
-
return prevSiblingHeader.getStart() + prevSiblingHeader.getSize();
|
|
3678
|
-
}
|
|
3679
|
-
|
|
3680
|
-
return 0;
|
|
3681
|
-
},
|
|
3682
3311
|
getLeafHeaders: function getLeafHeaders() {
|
|
3683
3312
|
var leafHeaders = [];
|
|
3684
3313
|
|
|
@@ -3731,7 +3360,7 @@
|
|
|
3731
3360
|
var headerGroups = buildHeaderGroups(allColumns, [].concat(leftColumns, centerColumns, rightColumns), instance);
|
|
3732
3361
|
return headerGroups;
|
|
3733
3362
|
}, {
|
|
3734
|
-
key:
|
|
3363
|
+
key: 'getHeaderGroups',
|
|
3735
3364
|
debug: function debug() {
|
|
3736
3365
|
var _instance$options$deb;
|
|
3737
3366
|
|
|
@@ -3746,7 +3375,7 @@
|
|
|
3746
3375
|
});
|
|
3747
3376
|
return buildHeaderGroups(allColumns, leafColumns, instance, 'center');
|
|
3748
3377
|
}, {
|
|
3749
|
-
key:
|
|
3378
|
+
key: 'getCenterHeaderGroups',
|
|
3750
3379
|
debug: function debug() {
|
|
3751
3380
|
var _instance$options$deb2;
|
|
3752
3381
|
|
|
@@ -3761,7 +3390,7 @@
|
|
|
3761
3390
|
});
|
|
3762
3391
|
return buildHeaderGroups(allColumns, leafColumns, instance, 'left');
|
|
3763
3392
|
}, {
|
|
3764
|
-
key:
|
|
3393
|
+
key: 'getLeftHeaderGroups',
|
|
3765
3394
|
debug: function debug() {
|
|
3766
3395
|
var _instance$options$deb3;
|
|
3767
3396
|
|
|
@@ -3776,7 +3405,7 @@
|
|
|
3776
3405
|
});
|
|
3777
3406
|
return buildHeaderGroups(allColumns, leafColumns, instance, 'right');
|
|
3778
3407
|
}, {
|
|
3779
|
-
key:
|
|
3408
|
+
key: 'getRightHeaderGroups',
|
|
3780
3409
|
debug: function debug() {
|
|
3781
3410
|
var _instance$options$deb4;
|
|
3782
3411
|
|
|
@@ -3789,7 +3418,7 @@
|
|
|
3789
3418
|
}, function (headerGroups) {
|
|
3790
3419
|
return [].concat(headerGroups).reverse();
|
|
3791
3420
|
}, {
|
|
3792
|
-
key:
|
|
3421
|
+
key: 'getFooterGroups',
|
|
3793
3422
|
debug: function debug() {
|
|
3794
3423
|
var _instance$options$deb5;
|
|
3795
3424
|
|
|
@@ -3801,7 +3430,7 @@
|
|
|
3801
3430
|
}, function (headerGroups) {
|
|
3802
3431
|
return [].concat(headerGroups).reverse();
|
|
3803
3432
|
}, {
|
|
3804
|
-
key:
|
|
3433
|
+
key: 'getLeftFooterGroups',
|
|
3805
3434
|
debug: function debug() {
|
|
3806
3435
|
var _instance$options$deb6;
|
|
3807
3436
|
|
|
@@ -3813,7 +3442,7 @@
|
|
|
3813
3442
|
}, function (headerGroups) {
|
|
3814
3443
|
return [].concat(headerGroups).reverse();
|
|
3815
3444
|
}, {
|
|
3816
|
-
key:
|
|
3445
|
+
key: 'getCenterFooterGroups',
|
|
3817
3446
|
debug: function debug() {
|
|
3818
3447
|
var _instance$options$deb7;
|
|
3819
3448
|
|
|
@@ -3825,7 +3454,7 @@
|
|
|
3825
3454
|
}, function (headerGroups) {
|
|
3826
3455
|
return [].concat(headerGroups).reverse();
|
|
3827
3456
|
}, {
|
|
3828
|
-
key:
|
|
3457
|
+
key: 'getRightFooterGroups',
|
|
3829
3458
|
debug: function debug() {
|
|
3830
3459
|
var _instance$options$deb8;
|
|
3831
3460
|
|
|
@@ -3840,7 +3469,7 @@
|
|
|
3840
3469
|
return headerGroup.headers;
|
|
3841
3470
|
}).flat();
|
|
3842
3471
|
}, {
|
|
3843
|
-
key:
|
|
3472
|
+
key: 'getFlatHeaders',
|
|
3844
3473
|
debug: function debug() {
|
|
3845
3474
|
var _instance$options$deb9;
|
|
3846
3475
|
|
|
@@ -3854,7 +3483,7 @@
|
|
|
3854
3483
|
return headerGroup.headers;
|
|
3855
3484
|
}).flat();
|
|
3856
3485
|
}, {
|
|
3857
|
-
key:
|
|
3486
|
+
key: 'getLeftFlatHeaders',
|
|
3858
3487
|
debug: function debug() {
|
|
3859
3488
|
var _instance$options$deb10;
|
|
3860
3489
|
|
|
@@ -3868,7 +3497,7 @@
|
|
|
3868
3497
|
return headerGroup.headers;
|
|
3869
3498
|
}).flat();
|
|
3870
3499
|
}, {
|
|
3871
|
-
key:
|
|
3500
|
+
key: 'getCenterFlatHeaders',
|
|
3872
3501
|
debug: function debug() {
|
|
3873
3502
|
var _instance$options$deb11;
|
|
3874
3503
|
|
|
@@ -3882,7 +3511,7 @@
|
|
|
3882
3511
|
return headerGroup.headers;
|
|
3883
3512
|
}).flat();
|
|
3884
3513
|
}, {
|
|
3885
|
-
key:
|
|
3514
|
+
key: 'getRightFlatHeaders',
|
|
3886
3515
|
debug: function debug() {
|
|
3887
3516
|
var _instance$options$deb12;
|
|
3888
3517
|
|
|
@@ -3899,7 +3528,7 @@
|
|
|
3899
3528
|
return !((_header$subHeaders = header.subHeaders) != null && _header$subHeaders.length);
|
|
3900
3529
|
});
|
|
3901
3530
|
}, {
|
|
3902
|
-
key:
|
|
3531
|
+
key: 'getCenterLeafHeaders',
|
|
3903
3532
|
debug: function debug() {
|
|
3904
3533
|
var _instance$options$deb13;
|
|
3905
3534
|
|
|
@@ -3915,7 +3544,7 @@
|
|
|
3915
3544
|
return !((_header$subHeaders2 = header.subHeaders) != null && _header$subHeaders2.length);
|
|
3916
3545
|
});
|
|
3917
3546
|
}, {
|
|
3918
|
-
key:
|
|
3547
|
+
key: 'getLeftLeafHeaders',
|
|
3919
3548
|
debug: function debug() {
|
|
3920
3549
|
var _instance$options$deb14;
|
|
3921
3550
|
|
|
@@ -3931,7 +3560,7 @@
|
|
|
3931
3560
|
return !((_header$subHeaders3 = header.subHeaders) != null && _header$subHeaders3.length);
|
|
3932
3561
|
});
|
|
3933
3562
|
}, {
|
|
3934
|
-
key:
|
|
3563
|
+
key: 'getRightLeafHeaders',
|
|
3935
3564
|
debug: function debug() {
|
|
3936
3565
|
var _instance$options$deb15;
|
|
3937
3566
|
|
|
@@ -3947,7 +3576,7 @@
|
|
|
3947
3576
|
return header.getLeafHeaders();
|
|
3948
3577
|
}).flat();
|
|
3949
3578
|
}, {
|
|
3950
|
-
key:
|
|
3579
|
+
key: 'getLeafHeaders',
|
|
3951
3580
|
debug: function debug() {
|
|
3952
3581
|
var _instance$options$deb16;
|
|
3953
3582
|
|
|
@@ -4156,7 +3785,6 @@
|
|
|
4156
3785
|
|
|
4157
3786
|
Promise.resolve().then(function () {
|
|
4158
3787
|
while (queued.length) {
|
|
4159
|
-
console.log('queue');
|
|
4160
3788
|
queued.shift()();
|
|
4161
3789
|
}
|
|
4162
3790
|
|
|
@@ -4168,7 +3796,6 @@
|
|
|
4168
3796
|
});
|
|
4169
3797
|
}
|
|
4170
3798
|
},
|
|
4171
|
-
// willUpdate: () => {},
|
|
4172
3799
|
initialState: initialState,
|
|
4173
3800
|
reset: function reset() {
|
|
4174
3801
|
instance.setState(instance.initialState);
|
|
@@ -4349,7 +3976,7 @@
|
|
|
4349
3976
|
rowsById: rowsById
|
|
4350
3977
|
};
|
|
4351
3978
|
}, {
|
|
4352
|
-
key:
|
|
3979
|
+
key: 'getRowModel',
|
|
4353
3980
|
debug: function debug() {
|
|
4354
3981
|
var _instance$options$deb;
|
|
4355
3982
|
|
|
@@ -4447,7 +4074,7 @@
|
|
|
4447
4074
|
};
|
|
4448
4075
|
};
|
|
4449
4076
|
}, {
|
|
4450
|
-
key:
|
|
4077
|
+
key: 'getRowModel',
|
|
4451
4078
|
initialSync: opts == null ? void 0 : opts.initialSync,
|
|
4452
4079
|
onProgress: function onProgress(progress) {
|
|
4453
4080
|
instance.setState(function (old) {
|
|
@@ -4475,98 +4102,93 @@
|
|
|
4475
4102
|
return memo(function () {
|
|
4476
4103
|
return [instance.getPreFilteredRowModel(), instance.getState().columnFilters, instance.getState().globalFilter];
|
|
4477
4104
|
}, function (rowModel, columnFilters, globalFilter) {
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
}
|
|
4105
|
+
if (!rowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
|
|
4106
|
+
return rowModel;
|
|
4107
|
+
}
|
|
4482
4108
|
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4109
|
+
var resolvedColumnFilters = [];
|
|
4110
|
+
var resolvedGlobalFilters = [];
|
|
4111
|
+
(columnFilters != null ? columnFilters : []).forEach(function (d) {
|
|
4112
|
+
var _filterFn$resolveFilt;
|
|
4487
4113
|
|
|
4488
|
-
|
|
4114
|
+
var column = instance.getColumn(d.id);
|
|
4489
4115
|
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
}
|
|
4116
|
+
if (!column) {
|
|
4117
|
+
{
|
|
4118
|
+
console.warn("Table: Could not find a column to filter with columnId: " + d.id);
|
|
4494
4119
|
}
|
|
4120
|
+
}
|
|
4495
4121
|
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
if (!filterFn) {
|
|
4499
|
-
{
|
|
4500
|
-
console.warn("Could not find a valid 'column.filterFn' for column with the ID: " + column.id + ".");
|
|
4501
|
-
}
|
|
4122
|
+
var filterFn = column.getFilterFn();
|
|
4502
4123
|
|
|
4503
|
-
|
|
4124
|
+
if (!filterFn) {
|
|
4125
|
+
{
|
|
4126
|
+
console.warn("Could not find a valid 'column.filterFn' for column with the ID: " + column.id + ".");
|
|
4504
4127
|
}
|
|
4505
4128
|
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
return d.id;
|
|
4514
|
-
});
|
|
4515
|
-
var globalFilterFn = instance.getGlobalFilterFn();
|
|
4516
|
-
var globallyFilterableColumns = instance.getAllLeafColumns().filter(function (column) {
|
|
4517
|
-
return column.getCanGlobalFilter();
|
|
4129
|
+
return;
|
|
4130
|
+
}
|
|
4131
|
+
|
|
4132
|
+
resolvedColumnFilters.push({
|
|
4133
|
+
id: d.id,
|
|
4134
|
+
filterFn: filterFn,
|
|
4135
|
+
resolvedValue: (_filterFn$resolveFilt = filterFn.resolveFilterValue == null ? void 0 : filterFn.resolveFilterValue(d.value)) != null ? _filterFn$resolveFilt : d.value
|
|
4518
4136
|
});
|
|
4137
|
+
});
|
|
4138
|
+
var filterableIds = columnFilters.map(function (d) {
|
|
4139
|
+
return d.id;
|
|
4140
|
+
});
|
|
4141
|
+
var globalFilterFn = instance.getGlobalFilterFn();
|
|
4142
|
+
var globallyFilterableColumns = instance.getAllLeafColumns().filter(function (column) {
|
|
4143
|
+
return column.getCanGlobalFilter();
|
|
4144
|
+
});
|
|
4519
4145
|
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4146
|
+
if (globalFilter && globalFilterFn && globallyFilterableColumns.length) {
|
|
4147
|
+
filterableIds.push('__global__');
|
|
4148
|
+
globallyFilterableColumns.forEach(function (column) {
|
|
4149
|
+
var _globalFilterFn$resol;
|
|
4524
4150
|
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
});
|
|
4151
|
+
resolvedGlobalFilters.push({
|
|
4152
|
+
id: column.id,
|
|
4153
|
+
filterFn: globalFilterFn,
|
|
4154
|
+
resolvedValue: (_globalFilterFn$resol = globalFilterFn.resolveFilterValue == null ? void 0 : globalFilterFn.resolveFilterValue(globalFilter)) != null ? _globalFilterFn$resol : globalFilter
|
|
4530
4155
|
});
|
|
4531
|
-
}
|
|
4156
|
+
});
|
|
4157
|
+
} // Flag the prefiltered row model with each filter state
|
|
4532
4158
|
|
|
4533
4159
|
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4160
|
+
for (var j = 0; j < rowModel.flatRows.length; j++) {
|
|
4161
|
+
var row = rowModel.flatRows[j];
|
|
4162
|
+
row.columnFilterMap = {};
|
|
4537
4163
|
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4164
|
+
if (resolvedColumnFilters.length) {
|
|
4165
|
+
for (var i = 0; i < resolvedColumnFilters.length; i++) {
|
|
4166
|
+
var columnFilter = resolvedColumnFilters[i]; // Tag the row with the column filter state
|
|
4541
4167
|
|
|
4542
|
-
|
|
4543
|
-
}
|
|
4168
|
+
row.columnFilterMap[columnFilter.id] = columnFilter.filterFn(row, columnFilter.id, columnFilter.resolvedValue);
|
|
4544
4169
|
}
|
|
4170
|
+
}
|
|
4545
4171
|
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
var _globalFilter = resolvedGlobalFilters[_i]; // Tag the row with the first truthy global filter state
|
|
4550
|
-
|
|
4551
|
-
if (_globalFilter.filterFn(row, _globalFilter.id, _globalFilter.resolvedFilterValue)) {
|
|
4552
|
-
row.columnFilterMap.__global__ = true;
|
|
4553
|
-
break;
|
|
4554
|
-
}
|
|
4555
|
-
}
|
|
4172
|
+
if (resolvedGlobalFilters.length) {
|
|
4173
|
+
for (var _i = 0; _i < resolvedGlobalFilters.length; _i++) {
|
|
4174
|
+
var _globalFilter = resolvedGlobalFilters[_i]; // Tag the row with the first truthy global filter state
|
|
4556
4175
|
|
|
4557
|
-
if (row.
|
|
4558
|
-
row.columnFilterMap.__global__ =
|
|
4176
|
+
if (_globalFilter.filterFn(row, _globalFilter.id, _globalFilter.resolvedValue)) {
|
|
4177
|
+
row.columnFilterMap.__global__ = true;
|
|
4178
|
+
break;
|
|
4559
4179
|
}
|
|
4560
4180
|
}
|
|
4561
|
-
} // Filter final rows using all of the active filters
|
|
4562
4181
|
|
|
4182
|
+
if (row.columnFilterMap.__global__ !== true) {
|
|
4183
|
+
row.columnFilterMap.__global__ = false;
|
|
4184
|
+
}
|
|
4185
|
+
}
|
|
4186
|
+
} // Filter final rows using all of the active filters
|
|
4563
4187
|
|
|
4564
|
-
return filterRows(rowModel.rows, filterableIds, instance);
|
|
4565
|
-
}();
|
|
4566
4188
|
|
|
4567
|
-
return
|
|
4189
|
+
return filterRows(rowModel.rows, filterableIds, instance);
|
|
4568
4190
|
}, {
|
|
4569
|
-
key:
|
|
4191
|
+
key: 'getFilteredRowModelSync',
|
|
4570
4192
|
debug: function debug() {
|
|
4571
4193
|
var _instance$options$deb;
|
|
4572
4194
|
|
|
@@ -4594,7 +4216,7 @@
|
|
|
4594
4216
|
var sortedFlatRows = []; // Filter out sortings that correspond to non existing columns
|
|
4595
4217
|
|
|
4596
4218
|
var availableSorting = sortingState.filter(function (sort) {
|
|
4597
|
-
return instance.
|
|
4219
|
+
return instance.getColumn(sort.id).getCanSort();
|
|
4598
4220
|
});
|
|
4599
4221
|
var columnInfoById = {};
|
|
4600
4222
|
availableSorting.forEach(function (sortEntry) {
|
|
@@ -4602,7 +4224,7 @@
|
|
|
4602
4224
|
columnInfoById[sortEntry.id] = {
|
|
4603
4225
|
sortUndefined: column.sortUndefined,
|
|
4604
4226
|
invertSorting: column.invertSorting,
|
|
4605
|
-
sortingFn:
|
|
4227
|
+
sortingFn: column.getSortingFn()
|
|
4606
4228
|
};
|
|
4607
4229
|
});
|
|
4608
4230
|
|
|
@@ -4666,7 +4288,7 @@
|
|
|
4666
4288
|
rowsById: rowModel.rowsById
|
|
4667
4289
|
};
|
|
4668
4290
|
}, {
|
|
4669
|
-
key:
|
|
4291
|
+
key: 'getSortedRowModel',
|
|
4670
4292
|
debug: function debug() {
|
|
4671
4293
|
var _instance$options$deb;
|
|
4672
4294
|
|
|
@@ -4808,7 +4430,7 @@
|
|
|
4808
4430
|
rowsById: groupedRowsById
|
|
4809
4431
|
};
|
|
4810
4432
|
}, {
|
|
4811
|
-
key:
|
|
4433
|
+
key: 'getGroupedRowModel',
|
|
4812
4434
|
debug: function debug() {
|
|
4813
4435
|
var _instance$options$deb;
|
|
4814
4436
|
|
|
@@ -4853,7 +4475,7 @@
|
|
|
4853
4475
|
|
|
4854
4476
|
return expandRows(rowModel, instance);
|
|
4855
4477
|
}, {
|
|
4856
|
-
key:
|
|
4478
|
+
key: 'getExpandedRowModel',
|
|
4857
4479
|
debug: function debug() {
|
|
4858
4480
|
var _instance$options$deb;
|
|
4859
4481
|
|
|
@@ -4870,7 +4492,7 @@
|
|
|
4870
4492
|
|
|
4871
4493
|
expandedRows.push(row);
|
|
4872
4494
|
|
|
4873
|
-
if (instance.options.expandSubRows && (_row$subRows = row.subRows) != null && _row$subRows.length &&
|
|
4495
|
+
if (instance.options.expandSubRows && (_row$subRows = row.subRows) != null && _row$subRows.length && row.getIsExpanded()) {
|
|
4874
4496
|
row.subRows.forEach(handleRow);
|
|
4875
4497
|
}
|
|
4876
4498
|
};
|
|
@@ -4915,7 +4537,7 @@
|
|
|
4915
4537
|
rowsById: rowsById
|
|
4916
4538
|
};
|
|
4917
4539
|
}, {
|
|
4918
|
-
key:
|
|
4540
|
+
key: 'getPaginationRowModel',
|
|
4919
4541
|
debug: function debug() {
|
|
4920
4542
|
var _instance$options$deb;
|
|
4921
4543
|
|