@infinite-table/infinite-react 3.3.3 → 4.0.0
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/index.d.ts +13 -16
- package/index.dev.js +287 -424
- package/index.dev.mjs +226 -363
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +2 -2
package/index.dev.mjs
CHANGED
|
@@ -5680,11 +5680,11 @@ var getComputedColumns = ({
|
|
|
5680
5680
|
{}
|
|
5681
5681
|
);
|
|
5682
5682
|
const normalizedColumnOrder = adjustColumnOrderForPinning(
|
|
5683
|
-
columnOrder === true ?
|
|
5683
|
+
columnOrder === true ? Object.keys(columns) : columnOrder,
|
|
5684
5684
|
columnPinning
|
|
5685
5685
|
);
|
|
5686
5686
|
const visibleColumnOrder = normalizedColumnOrder.filter((colId) => {
|
|
5687
|
-
const col = columns
|
|
5687
|
+
const col = columns[colId];
|
|
5688
5688
|
if (!col) {
|
|
5689
5689
|
logError(
|
|
5690
5690
|
`Column with id "${colId}" specified in columnOrder array cannot be found in the columns map.`
|
|
@@ -5701,7 +5701,7 @@ var getComputedColumns = ({
|
|
|
5701
5701
|
const columnIdsToVisibleIndex = /* @__PURE__ */ new Map();
|
|
5702
5702
|
const visibleColumnsArray = visibleColumnOrder.map(
|
|
5703
5703
|
(columnId, index) => {
|
|
5704
|
-
const col = columns
|
|
5704
|
+
const col = columns[columnId];
|
|
5705
5705
|
columnIdsToVisibleIndex.set(columnId, index);
|
|
5706
5706
|
return col;
|
|
5707
5707
|
}
|
|
@@ -5722,7 +5722,7 @@ var getComputedColumns = ({
|
|
|
5722
5722
|
);
|
|
5723
5723
|
function getColSize(colId) {
|
|
5724
5724
|
var _a, _b, _c, _d, _e, _f;
|
|
5725
|
-
const column = columns
|
|
5725
|
+
const column = columns[colId];
|
|
5726
5726
|
const colType = getColumnComputedType(column, columnTypes);
|
|
5727
5727
|
const colTypeSizing = {
|
|
5728
5728
|
minWidth: colType == null ? void 0 : colType.minWidth,
|
|
@@ -5813,7 +5813,8 @@ var getComputedColumns = ({
|
|
|
5813
5813
|
orderedColumns.set(id, c);
|
|
5814
5814
|
});
|
|
5815
5815
|
const columnIdsInitialColumnOrder = [];
|
|
5816
|
-
columns.forEach((
|
|
5816
|
+
Object.keys(columns).forEach((key) => {
|
|
5817
|
+
const c = columns[key];
|
|
5817
5818
|
columnIdsInitialColumnOrder.push(key);
|
|
5818
5819
|
if (!orderedColumns.has(key)) {
|
|
5819
5820
|
orderedColumns.set(key, c);
|
|
@@ -9592,7 +9593,7 @@ function buildColumnAndGroupTree(columns, columnGroups, columnGroupsDepthsMap, c
|
|
|
9592
9593
|
let colGroupItem;
|
|
9593
9594
|
let prevGroupItem = colItem;
|
|
9594
9595
|
while (groupId) {
|
|
9595
|
-
const colGroup = columnGroups
|
|
9596
|
+
const colGroup = columnGroups[groupId];
|
|
9596
9597
|
if (colGroup) {
|
|
9597
9598
|
parentGroups.add(groupId);
|
|
9598
9599
|
const groupAbsoluteId = [colId, ...parentGroups];
|
|
@@ -10034,10 +10035,10 @@ function TableHeaderWrapper(props) {
|
|
|
10034
10035
|
showColumnFilters
|
|
10035
10036
|
}
|
|
10036
10037
|
} = tableContextValue;
|
|
10037
|
-
const rows = !computedColumnGroups || !computedColumnGroups.
|
|
10038
|
+
const rows = !computedColumnGroups || !Object.keys(computedColumnGroups).length ? 1 : columnGroupsMaxDepth + 2;
|
|
10038
10039
|
const height = rows * columnHeaderHeight + (showColumnFilters ? columnHeaderHeight : 0);
|
|
10039
10040
|
const columnAndGroupTreeInfo = React48.useMemo(() => {
|
|
10040
|
-
if (!computedColumnGroups || !computedColumnGroups.
|
|
10041
|
+
if (!computedColumnGroups || !Object.keys(computedColumnGroups).length) {
|
|
10041
10042
|
return void 0;
|
|
10042
10043
|
}
|
|
10043
10044
|
return buildColumnAndGroupTree(
|
|
@@ -11770,46 +11771,25 @@ function getPivotColumnsAndColumnGroups({
|
|
|
11770
11771
|
reducer: () => null
|
|
11771
11772
|
});
|
|
11772
11773
|
}
|
|
11773
|
-
const columns =
|
|
11774
|
-
|
|
11775
|
-
// 'labels',
|
|
11776
|
-
// {
|
|
11777
|
-
// header: 'Row labels',
|
|
11778
|
-
// pivotBy,
|
|
11779
|
-
// valueGetter: (params) => {
|
|
11780
|
-
// const { rowInfo } = params;
|
|
11781
|
-
// if (!rowInfo.data) {
|
|
11782
|
-
// // TODO replace with loading spinner
|
|
11783
|
-
// return 'Loading ...';
|
|
11784
|
-
// }
|
|
11785
|
-
// return rowInfo.groupKeys
|
|
11786
|
-
// ? rowInfo.groupKeys[rowInfo.groupKeys?.length - 1]
|
|
11787
|
-
// : null;
|
|
11788
|
-
// },
|
|
11789
|
-
// },
|
|
11790
|
-
// ],
|
|
11791
|
-
]);
|
|
11792
|
-
const columnGroups = /* @__PURE__ */ new Map();
|
|
11774
|
+
const columns = {};
|
|
11775
|
+
const columnGroups = {};
|
|
11793
11776
|
const addGrandTotalColumns = once(function() {
|
|
11794
11777
|
aggregationReducers.forEach((reducer, index) => {
|
|
11795
|
-
columns.
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
|
|
11801
|
-
|
|
11802
|
-
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
11810
|
-
}
|
|
11811
|
-
})
|
|
11812
|
-
);
|
|
11778
|
+
columns[`total:${reducer.id}`] = prepareColumn({
|
|
11779
|
+
header: `${reducer.name || reducer.id} total`,
|
|
11780
|
+
pivotBy,
|
|
11781
|
+
pivotColumn: true,
|
|
11782
|
+
pivotTotalColumn: true,
|
|
11783
|
+
pivotAggregator: reducer,
|
|
11784
|
+
pivotAggregatorIndex: index,
|
|
11785
|
+
pivotGroupKeys: [],
|
|
11786
|
+
pivotGroupKey: "",
|
|
11787
|
+
pivotIndex: -1,
|
|
11788
|
+
valueFormatter: ({ rowInfo }) => {
|
|
11789
|
+
var _a;
|
|
11790
|
+
return rowInfo.isGroupRow ? (_a = rowInfo.reducerResults) == null ? void 0 : _a[reducer.id] : null;
|
|
11791
|
+
}
|
|
11792
|
+
});
|
|
11813
11793
|
});
|
|
11814
11794
|
});
|
|
11815
11795
|
if (!pivotLength && pivotTotalColumnPosition === "start" || pivotGrandTotalColumnPosition === "start") {
|
|
@@ -11829,18 +11809,15 @@ function getPivotColumnsAndColumnGroups({
|
|
|
11829
11809
|
const columnGroupId = parentColumnGroupId;
|
|
11830
11810
|
parentColumnGroupId = keys.join("/");
|
|
11831
11811
|
const pivotGroupKey = keys[keys.length - 1];
|
|
11832
|
-
columnGroups
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
pivotGroupKey
|
|
11842
|
-
})
|
|
11843
|
-
);
|
|
11812
|
+
columnGroups[parentColumnGroupId] = prepareColumnGroup({
|
|
11813
|
+
header: `${pivotGroupKey}`,
|
|
11814
|
+
columnGroup: columnGroupId,
|
|
11815
|
+
pivotBy,
|
|
11816
|
+
pivotGroupKeys: keys,
|
|
11817
|
+
pivotByAtIndex: pivotByForColumn,
|
|
11818
|
+
pivotIndex: keys.length - 1,
|
|
11819
|
+
pivotGroupKey
|
|
11820
|
+
});
|
|
11844
11821
|
}
|
|
11845
11822
|
aggregationReducers.forEach((reducer, index) => {
|
|
11846
11823
|
const header = isSingleAggregationColumn ? `${keys[keys.length - 1]}` : reducer.name || reducer.id;
|
|
@@ -11866,42 +11843,36 @@ function getPivotColumnsAndColumnGroups({
|
|
|
11866
11843
|
}
|
|
11867
11844
|
});
|
|
11868
11845
|
const columnId = `${reducer.id}:${keys.join("/")}`;
|
|
11869
|
-
columns
|
|
11846
|
+
columns[columnId] = computedPivotColumn;
|
|
11870
11847
|
});
|
|
11871
11848
|
} else {
|
|
11872
11849
|
const colGroupId = keys.join("/");
|
|
11873
11850
|
const parentKeys = keys.slice(0, -1);
|
|
11874
|
-
columnGroups
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
pivotGroupKey: keys[keys.length - 1]
|
|
11884
|
-
})
|
|
11885
|
-
);
|
|
11851
|
+
columnGroups[colGroupId] = prepareColumnGroup({
|
|
11852
|
+
columnGroup: parentKeys.length ? parentKeys.join("/") : void 0,
|
|
11853
|
+
header: `${keys[keys.length - 1]}`,
|
|
11854
|
+
pivotBy,
|
|
11855
|
+
pivotGroupKeys: keys,
|
|
11856
|
+
pivotIndex: keys.length - 1,
|
|
11857
|
+
pivotByAtIndex: pivotBy[keys.length - 1],
|
|
11858
|
+
pivotGroupKey: keys[keys.length - 1]
|
|
11859
|
+
});
|
|
11886
11860
|
if (pivotTotalColumnPosition !== false) {
|
|
11887
11861
|
const pivotByForColumn = pivotBy[keys.length - 1];
|
|
11888
11862
|
let columnGroupId = parentKeys.length ? parentKeys.join("/") : void 0;
|
|
11889
11863
|
if (!isSingleAggregationColumn) {
|
|
11890
11864
|
const parentGroupForTotalsGroup = columnGroupId;
|
|
11891
11865
|
columnGroupId = `total:${keys.join("/")}`;
|
|
11892
|
-
columnGroups
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
pivotGroupKey: keys[keys.length - 1]
|
|
11903
|
-
})
|
|
11904
|
-
);
|
|
11866
|
+
columnGroups[columnGroupId] = prepareColumnGroup({
|
|
11867
|
+
header: `${keys[keys.length - 1]} total`,
|
|
11868
|
+
columnGroup: parentGroupForTotalsGroup,
|
|
11869
|
+
pivotBy,
|
|
11870
|
+
pivotTotalColumnGroup: true,
|
|
11871
|
+
pivotGroupKeys: keys,
|
|
11872
|
+
pivotIndex: keys.length - 1,
|
|
11873
|
+
pivotByAtIndex: pivotByForColumn,
|
|
11874
|
+
pivotGroupKey: keys[keys.length - 1]
|
|
11875
|
+
});
|
|
11905
11876
|
}
|
|
11906
11877
|
aggregationReducers.forEach((reducer, index) => {
|
|
11907
11878
|
const header = isSingleAggregationColumn ? `${keys[keys.length - 1]} total ` : `${reducer.name || reducer.id} total`;
|
|
@@ -11926,10 +11897,7 @@ function getPivotColumnsAndColumnGroups({
|
|
|
11926
11897
|
return (_b = (_a = rowInfo.pivotValuesMap) == null ? void 0 : _a.get(keys)) == null ? void 0 : _b.reducerResults[reducer.id];
|
|
11927
11898
|
}
|
|
11928
11899
|
});
|
|
11929
|
-
columns.
|
|
11930
|
-
`total:${reducer.id}:${keys.join("/")}`,
|
|
11931
|
-
computedPivotColumn
|
|
11932
|
-
);
|
|
11900
|
+
columns[`total:${reducer.id}:${keys.join("/")}`] = computedPivotColumn;
|
|
11933
11901
|
});
|
|
11934
11902
|
}
|
|
11935
11903
|
}
|
|
@@ -16852,7 +16820,7 @@ function useCellRendering(param) {
|
|
|
16852
16820
|
}
|
|
16853
16821
|
|
|
16854
16822
|
// src/components/InfiniteTable/hooks/useComputed.ts
|
|
16855
|
-
import { useEffect as
|
|
16823
|
+
import { useEffect as useEffect25, useState as useState17 } from "react";
|
|
16856
16824
|
|
|
16857
16825
|
// src/components/InfiniteTable/utils/MultiCellSelector.ts
|
|
16858
16826
|
var MultiCellSelector = class {
|
|
@@ -17043,129 +17011,6 @@ var MultiRowSelector = class {
|
|
|
17043
17011
|
}
|
|
17044
17012
|
};
|
|
17045
17013
|
|
|
17046
|
-
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
17047
|
-
import { useEffect as useEffect24 } from "react";
|
|
17048
|
-
|
|
17049
|
-
// src/components/hooks/useInterceptedMap.ts
|
|
17050
|
-
import { useEffect as useEffect23 } from "react";
|
|
17051
|
-
function interceptMap(map2, fns) {
|
|
17052
|
-
const { set, delete: deleteKey, clear } = map2;
|
|
17053
|
-
if (fns.set) {
|
|
17054
|
-
map2.set = (key, value) => {
|
|
17055
|
-
set.call(map2, key, value);
|
|
17056
|
-
fns.set(key, value);
|
|
17057
|
-
return map2;
|
|
17058
|
-
};
|
|
17059
|
-
}
|
|
17060
|
-
if (fns.delete) {
|
|
17061
|
-
map2.delete = (key) => {
|
|
17062
|
-
const removed = deleteKey.call(map2, key);
|
|
17063
|
-
fns.delete(key);
|
|
17064
|
-
return removed;
|
|
17065
|
-
};
|
|
17066
|
-
}
|
|
17067
|
-
if (fns.clear || fns.beforeClear) {
|
|
17068
|
-
map2.clear = () => {
|
|
17069
|
-
if (fns.beforeClear) {
|
|
17070
|
-
fns.beforeClear(map2);
|
|
17071
|
-
}
|
|
17072
|
-
const result = clear.call(map2);
|
|
17073
|
-
if (fns.clear) {
|
|
17074
|
-
fns.clear();
|
|
17075
|
-
}
|
|
17076
|
-
return result;
|
|
17077
|
-
};
|
|
17078
|
-
}
|
|
17079
|
-
return () => {
|
|
17080
|
-
if (set) {
|
|
17081
|
-
map2.set = set;
|
|
17082
|
-
}
|
|
17083
|
-
if (deleteKey) {
|
|
17084
|
-
map2.delete = deleteKey;
|
|
17085
|
-
}
|
|
17086
|
-
if (clear) {
|
|
17087
|
-
map2.clear = clear;
|
|
17088
|
-
}
|
|
17089
|
-
};
|
|
17090
|
-
}
|
|
17091
|
-
|
|
17092
|
-
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
17093
|
-
function computeColumnGroupsDepths(columnGroups) {
|
|
17094
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
17095
|
-
columnGroups.forEach((colGroup, colGroupId) => {
|
|
17096
|
-
let parentGroupId = colGroup.columnGroup;
|
|
17097
|
-
let depth = 0;
|
|
17098
|
-
while (parentGroupId) {
|
|
17099
|
-
const parent = columnGroups.get(parentGroupId);
|
|
17100
|
-
if (!parent) {
|
|
17101
|
-
if (false) {
|
|
17102
|
-
console.warn(`Cannot find column group ${parentGroupId}`);
|
|
17103
|
-
}
|
|
17104
|
-
break;
|
|
17105
|
-
}
|
|
17106
|
-
depth++;
|
|
17107
|
-
parentGroupId = parent.columnGroup;
|
|
17108
|
-
}
|
|
17109
|
-
map2.set(colGroupId, depth);
|
|
17110
|
-
});
|
|
17111
|
-
return map2;
|
|
17112
|
-
}
|
|
17113
|
-
|
|
17114
|
-
// src/components/InfiniteTable/hooks/useColumnGroups.ts
|
|
17115
|
-
function useColumnGroups() {
|
|
17116
|
-
const {
|
|
17117
|
-
componentState: {
|
|
17118
|
-
computedColumnGroups,
|
|
17119
|
-
collapsedColumnGroups
|
|
17120
|
-
},
|
|
17121
|
-
componentActions,
|
|
17122
|
-
getComponentState
|
|
17123
|
-
} = useComponentState();
|
|
17124
|
-
useEffect24(() => {
|
|
17125
|
-
const recompute = () => {
|
|
17126
|
-
componentActions.columnGroupsDepthsMap = computeColumnGroupsDepths(computedColumnGroups);
|
|
17127
|
-
};
|
|
17128
|
-
const update = rafFn(recompute);
|
|
17129
|
-
return interceptMap(computedColumnGroups, {
|
|
17130
|
-
clear: update,
|
|
17131
|
-
delete: update,
|
|
17132
|
-
set: update
|
|
17133
|
-
});
|
|
17134
|
-
}, [computedColumnGroups]);
|
|
17135
|
-
useEffect24(() => {
|
|
17136
|
-
return interceptMap(collapsedColumnGroups, {
|
|
17137
|
-
set: (key, visibleCol) => {
|
|
17138
|
-
const colIds = key.slice(1);
|
|
17139
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
17140
|
-
colIds.forEach((colId) => {
|
|
17141
|
-
columnVisibility[colId] = false;
|
|
17142
|
-
});
|
|
17143
|
-
delete columnVisibility[visibleCol];
|
|
17144
|
-
componentActions.columnVisibility = columnVisibility;
|
|
17145
|
-
},
|
|
17146
|
-
beforeClear: (currentCollapsedGroups) => {
|
|
17147
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
17148
|
-
const keys = [...currentCollapsedGroups.keys()];
|
|
17149
|
-
keys.forEach((key) => {
|
|
17150
|
-
const colIds = key.slice(1);
|
|
17151
|
-
colIds.forEach((colId) => {
|
|
17152
|
-
delete columnVisibility[colId];
|
|
17153
|
-
});
|
|
17154
|
-
});
|
|
17155
|
-
componentActions.columnVisibility = columnVisibility;
|
|
17156
|
-
},
|
|
17157
|
-
delete: (key) => {
|
|
17158
|
-
const columnVisibility = __spreadValues({}, getComponentState().columnVisibility);
|
|
17159
|
-
const colIds = key.slice(1);
|
|
17160
|
-
colIds.forEach((colId) => {
|
|
17161
|
-
delete columnVisibility[colId];
|
|
17162
|
-
});
|
|
17163
|
-
componentActions.columnVisibility = columnVisibility;
|
|
17164
|
-
}
|
|
17165
|
-
});
|
|
17166
|
-
}, [collapsedColumnGroups]);
|
|
17167
|
-
}
|
|
17168
|
-
|
|
17169
17014
|
// src/components/InfiniteTable/hooks/useColumnRowspan.ts
|
|
17170
17015
|
import { useMemo as useMemo10 } from "react";
|
|
17171
17016
|
function useColumnRowspan(computedVisibleColumns) {
|
|
@@ -17215,7 +17060,7 @@ function useColumnSizeFn(columns) {
|
|
|
17215
17060
|
}
|
|
17216
17061
|
|
|
17217
17062
|
// src/components/InfiniteTable/hooks/useColumnsWhen.ts
|
|
17218
|
-
import { useEffect as
|
|
17063
|
+
import { useEffect as useEffect23, useLayoutEffect as useLayoutEffect11, useMemo as useMemo11 } from "react";
|
|
17219
17064
|
|
|
17220
17065
|
// src/components/InfiniteTable/state/getInitialState.ts
|
|
17221
17066
|
import { createRef } from "react";
|
|
@@ -17255,22 +17100,27 @@ var ScrollListener = class {
|
|
|
17255
17100
|
}
|
|
17256
17101
|
};
|
|
17257
17102
|
|
|
17258
|
-
// src/components/InfiniteTable/
|
|
17259
|
-
function
|
|
17260
|
-
|
|
17261
|
-
|
|
17262
|
-
|
|
17263
|
-
|
|
17264
|
-
|
|
17265
|
-
|
|
17266
|
-
|
|
17267
|
-
|
|
17268
|
-
|
|
17269
|
-
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
|
|
17273
|
-
|
|
17103
|
+
// src/components/InfiniteTable/state/computeColumnGroupsDepths.ts
|
|
17104
|
+
function computeColumnGroupsDepths(columnGroups) {
|
|
17105
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
17106
|
+
Object.keys(columnGroups).forEach((colGroupId) => {
|
|
17107
|
+
const colGroup = columnGroups[colGroupId];
|
|
17108
|
+
let parentGroupId = colGroup.columnGroup;
|
|
17109
|
+
let depth = 0;
|
|
17110
|
+
while (parentGroupId) {
|
|
17111
|
+
const parent = columnGroups[parentGroupId];
|
|
17112
|
+
if (!parent) {
|
|
17113
|
+
if (false) {
|
|
17114
|
+
console.warn(`Cannot find column group ${parentGroupId}`);
|
|
17115
|
+
}
|
|
17116
|
+
break;
|
|
17117
|
+
}
|
|
17118
|
+
depth++;
|
|
17119
|
+
parentGroupId = parent.columnGroup;
|
|
17120
|
+
}
|
|
17121
|
+
map2.set(colGroupId, depth);
|
|
17122
|
+
});
|
|
17123
|
+
return map2;
|
|
17274
17124
|
}
|
|
17275
17125
|
|
|
17276
17126
|
// src/components/InfiniteTable/state/rowDetailRendererFromComponent.tsx
|
|
@@ -17301,7 +17151,7 @@ function getCellSelector(cellPosition) {
|
|
|
17301
17151
|
function initSetupState2({
|
|
17302
17152
|
debugId
|
|
17303
17153
|
}) {
|
|
17304
|
-
const columnsGeneratedForGrouping =
|
|
17154
|
+
const columnsGeneratedForGrouping = {};
|
|
17305
17155
|
const brain = new MatrixBrain(debugId);
|
|
17306
17156
|
const headerBrain = new MatrixBrain("header");
|
|
17307
17157
|
brain.onScroll((scrollPosition) => {
|
|
@@ -17377,7 +17227,7 @@ function initSetupState2({
|
|
|
17377
17227
|
editingCell: null
|
|
17378
17228
|
};
|
|
17379
17229
|
}
|
|
17380
|
-
var forwardProps4 = (
|
|
17230
|
+
var forwardProps4 = (_setupState) => {
|
|
17381
17231
|
return {
|
|
17382
17232
|
debugId: 1,
|
|
17383
17233
|
scrollTopKey: 1,
|
|
@@ -17463,7 +17313,7 @@ var forwardProps4 = (setupState) => {
|
|
|
17463
17313
|
rowHeight: (rowHeight) => typeof rowHeight === "number" || typeof rowHeight === "function" ? rowHeight : 0,
|
|
17464
17314
|
rowDetailHeight: (rowDetailHeight) => typeof rowDetailHeight === "number" || typeof rowDetailHeight === "function" ? rowDetailHeight : 300,
|
|
17465
17315
|
columnHeaderHeight: (columnHeaderHeight) => typeof columnHeaderHeight === "number" ? columnHeaderHeight : 30,
|
|
17466
|
-
columns:
|
|
17316
|
+
columns: 1,
|
|
17467
17317
|
columnVisibility: (columnVisibility) => columnVisibility != null ? columnVisibility : {},
|
|
17468
17318
|
// TODO check if columnPinning works when the value for a pinned col is `true` instead of `"start"`
|
|
17469
17319
|
columnSizing: (columnSizing) => columnSizing || {},
|
|
@@ -17477,7 +17327,7 @@ var forwardProps4 = (setupState) => {
|
|
|
17477
17327
|
onEditPersistSuccess: 1,
|
|
17478
17328
|
multiSortBehavior: (multiSortBehavior) => multiSortBehavior != null ? multiSortBehavior : "replace",
|
|
17479
17329
|
collapsedColumnGroups: (collapsedColumnGroups) => collapsedColumnGroups != null ? collapsedColumnGroups : /* @__PURE__ */ new Map(),
|
|
17480
|
-
columnGroups:
|
|
17330
|
+
columnGroups: 1
|
|
17481
17331
|
};
|
|
17482
17332
|
};
|
|
17483
17333
|
function getGroupRenderStrategy(options) {
|
|
@@ -17594,26 +17444,22 @@ var mapPropsToState = (params) => {
|
|
|
17594
17444
|
};
|
|
17595
17445
|
|
|
17596
17446
|
// src/components/InfiniteTable/state/getColumnVisibilityForHideEmptyGroupColumns.ts
|
|
17597
|
-
function
|
|
17598
|
-
const computedGroupColumns =
|
|
17599
|
-
computedColumns.forEach(
|
|
17600
|
-
|
|
17601
|
-
|
|
17602
|
-
|
|
17603
|
-
|
|
17604
|
-
}
|
|
17605
|
-
const { groupByForColumn } = col;
|
|
17606
|
-
const field = groupByForColumn.field || groupByForColumn.groupField;
|
|
17607
|
-
const groupInfoForColumn = field ? groupByMap.get(field) : null;
|
|
17608
|
-
if (!groupInfoForColumn) {
|
|
17609
|
-
return;
|
|
17610
|
-
}
|
|
17611
|
-
computedGroupColumns.set(
|
|
17612
|
-
colId,
|
|
17613
|
-
column
|
|
17614
|
-
);
|
|
17447
|
+
function getGroupColumnsForComputedColumns(computedColumns, groupByMap) {
|
|
17448
|
+
const computedGroupColumns = {};
|
|
17449
|
+
Object.keys(computedColumns).forEach((colId) => {
|
|
17450
|
+
const column = computedColumns[colId];
|
|
17451
|
+
const col = column;
|
|
17452
|
+
if (!col.groupByForColumn || Array.isArray(col.groupByForColumn)) {
|
|
17453
|
+
return;
|
|
17615
17454
|
}
|
|
17616
|
-
|
|
17455
|
+
const { groupByForColumn } = col;
|
|
17456
|
+
const field = groupByForColumn.field || groupByForColumn.groupField;
|
|
17457
|
+
const groupInfoForColumn = field ? groupByMap.get(field) : null;
|
|
17458
|
+
if (!groupInfoForColumn) {
|
|
17459
|
+
return;
|
|
17460
|
+
}
|
|
17461
|
+
computedGroupColumns[colId] = column;
|
|
17462
|
+
});
|
|
17617
17463
|
return computedGroupColumns;
|
|
17618
17464
|
}
|
|
17619
17465
|
function getColumnVisibilityForHideEmptyGroupColumns(params) {
|
|
@@ -17627,13 +17473,11 @@ function getColumnVisibilityForHideEmptyGroupColumns(params) {
|
|
|
17627
17473
|
} = params;
|
|
17628
17474
|
const columnVisibility = __spreadValues({}, params.columnVisibility);
|
|
17629
17475
|
if (!hideEmptyGroupColumns) {
|
|
17630
|
-
computedGroupColumns.forEach(
|
|
17631
|
-
(
|
|
17632
|
-
|
|
17633
|
-
delete columnVisibility[colId];
|
|
17634
|
-
}
|
|
17476
|
+
Object.keys(computedGroupColumns).forEach((colId) => {
|
|
17477
|
+
if (columnVisibility[colId] === false) {
|
|
17478
|
+
delete columnVisibility[colId];
|
|
17635
17479
|
}
|
|
17636
|
-
);
|
|
17480
|
+
});
|
|
17637
17481
|
return columnVisibility;
|
|
17638
17482
|
}
|
|
17639
17483
|
if (!groupRowsIndexesInDataArray || !groupRowsIndexesInDataArray.length) {
|
|
@@ -17656,30 +17500,29 @@ function getColumnVisibilityForHideEmptyGroupColumns(params) {
|
|
|
17656
17500
|
break;
|
|
17657
17501
|
}
|
|
17658
17502
|
}
|
|
17659
|
-
computedGroupColumns.forEach(
|
|
17660
|
-
|
|
17661
|
-
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
|
|
17665
|
-
|
|
17666
|
-
|
|
17667
|
-
|
|
17503
|
+
Object.keys(computedGroupColumns).forEach((colId) => {
|
|
17504
|
+
const column = computedGroupColumns[colId];
|
|
17505
|
+
const { groupByForColumn } = column;
|
|
17506
|
+
if (Array.isArray(groupByForColumn)) {
|
|
17507
|
+
return;
|
|
17508
|
+
}
|
|
17509
|
+
const field = groupByForColumn.field || groupByForColumn.groupField;
|
|
17510
|
+
if (!field) {
|
|
17511
|
+
return;
|
|
17512
|
+
}
|
|
17513
|
+
const groupInfoForColumn = groupByMap.get(field);
|
|
17514
|
+
const index = groupInfoForColumn.groupIndex;
|
|
17515
|
+
const shouldBeHidden = index > expandedGroupsLevel && hideEmptyGroupColumns;
|
|
17516
|
+
if (shouldBeHidden) {
|
|
17517
|
+
if (columnVisibility[colId] !== false) {
|
|
17518
|
+
columnVisibility[colId] = false;
|
|
17668
17519
|
}
|
|
17669
|
-
|
|
17670
|
-
|
|
17671
|
-
|
|
17672
|
-
if (shouldBeHidden) {
|
|
17673
|
-
if (columnVisibility[colId] !== false) {
|
|
17674
|
-
columnVisibility[colId] = false;
|
|
17675
|
-
}
|
|
17676
|
-
} else {
|
|
17677
|
-
if (columnVisibility.hasOwnProperty(colId)) {
|
|
17678
|
-
delete columnVisibility[colId];
|
|
17679
|
-
}
|
|
17520
|
+
} else {
|
|
17521
|
+
if (columnVisibility.hasOwnProperty(colId)) {
|
|
17522
|
+
delete columnVisibility[colId];
|
|
17680
17523
|
}
|
|
17681
17524
|
}
|
|
17682
|
-
);
|
|
17525
|
+
});
|
|
17683
17526
|
return columnVisibility;
|
|
17684
17527
|
}
|
|
17685
17528
|
|
|
@@ -17745,13 +17588,13 @@ function useColumnsWhen() {
|
|
|
17745
17588
|
pivotGrandTotalColumnPosition
|
|
17746
17589
|
}
|
|
17747
17590
|
} = useComponentState();
|
|
17748
|
-
|
|
17591
|
+
useEffect23(() => {
|
|
17749
17592
|
dataSourceActions.generateGroupRows = groupRenderStrategy !== "inline";
|
|
17750
17593
|
}, [groupRenderStrategy]);
|
|
17751
|
-
|
|
17594
|
+
useEffect23(() => {
|
|
17752
17595
|
dataSourceActions.pivotTotalColumnPosition = pivotTotalColumnPosition;
|
|
17753
17596
|
}, [pivotTotalColumnPosition]);
|
|
17754
|
-
|
|
17597
|
+
useEffect23(() => {
|
|
17755
17598
|
if (pivotGrandTotalColumnPosition != void 0) {
|
|
17756
17599
|
dataSourceActions.pivotGrandTotalColumnPosition = pivotGrandTotalColumnPosition;
|
|
17757
17600
|
}
|
|
@@ -17769,12 +17612,13 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
17769
17612
|
componentState: { columns, groupRenderStrategy }
|
|
17770
17613
|
} = useComponentState();
|
|
17771
17614
|
function computeColumnsWhenInlineGroupRenderStrategy(columns2, groupByMap2, groupRenderStrategy2, toggleGroupRow2) {
|
|
17772
|
-
const computedColumns =
|
|
17615
|
+
const computedColumns = {};
|
|
17773
17616
|
if (groupRenderStrategy2 !== "inline") {
|
|
17774
17617
|
return;
|
|
17775
17618
|
}
|
|
17776
|
-
columns2.forEach((
|
|
17619
|
+
Object.keys(columns2).forEach((id) => {
|
|
17777
17620
|
var _a, _b;
|
|
17621
|
+
const column = columns2[id];
|
|
17778
17622
|
let base = {};
|
|
17779
17623
|
const groupByForColumn = groupByMap2.get(column.field);
|
|
17780
17624
|
if (groupByForColumn && groupRenderStrategy2 === "inline") {
|
|
@@ -17828,11 +17672,11 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
17828
17672
|
};
|
|
17829
17673
|
}
|
|
17830
17674
|
const clone = __spreadValues(__spreadValues({}, base), column);
|
|
17831
|
-
computedColumns
|
|
17675
|
+
computedColumns[id] = clone;
|
|
17832
17676
|
});
|
|
17833
|
-
return computedColumns.
|
|
17677
|
+
return Object.keys(computedColumns).length === 0 ? void 0 : computedColumns;
|
|
17834
17678
|
}
|
|
17835
|
-
|
|
17679
|
+
useEffect23(() => {
|
|
17836
17680
|
const update = () => {
|
|
17837
17681
|
componentActions.columnsWhenInlineGroupRenderStrategy = computeColumnsWhenInlineGroupRenderStrategy(
|
|
17838
17682
|
columns,
|
|
@@ -17842,11 +17686,6 @@ function useColumnsWhenInlineGroupRenderStrategy(groupByMap) {
|
|
|
17842
17686
|
);
|
|
17843
17687
|
};
|
|
17844
17688
|
update();
|
|
17845
|
-
return interceptMap(columns, {
|
|
17846
|
-
set: update,
|
|
17847
|
-
delete: update,
|
|
17848
|
-
clear: update
|
|
17849
|
-
});
|
|
17850
17689
|
}, [columns, groupByMap, groupRenderStrategy, toggleGroupRow]);
|
|
17851
17690
|
}
|
|
17852
17691
|
function useColumnsWhenGrouping() {
|
|
@@ -17868,7 +17707,7 @@ function useColumnsWhenGrouping() {
|
|
|
17868
17707
|
getComponentState
|
|
17869
17708
|
} = useComponentState();
|
|
17870
17709
|
const toggleGroupRow = useToggleGroupRow();
|
|
17871
|
-
|
|
17710
|
+
useEffect23(() => {
|
|
17872
17711
|
const update = () => {
|
|
17873
17712
|
const { columns: columnsWhenGrouping, groupColumnIds } = getColumnsWhenGrouping({
|
|
17874
17713
|
columns,
|
|
@@ -17903,11 +17742,6 @@ function useColumnsWhenGrouping() {
|
|
|
17903
17742
|
}
|
|
17904
17743
|
};
|
|
17905
17744
|
update();
|
|
17906
|
-
return interceptMap(columns, {
|
|
17907
|
-
set: update,
|
|
17908
|
-
delete: update,
|
|
17909
|
-
clear: update
|
|
17910
|
-
});
|
|
17911
17745
|
}, [
|
|
17912
17746
|
columns,
|
|
17913
17747
|
groupBy,
|
|
@@ -17949,7 +17783,7 @@ function useHideColumns(groupByMap) {
|
|
|
17949
17783
|
return;
|
|
17950
17784
|
}
|
|
17951
17785
|
const currentState = getComponentState();
|
|
17952
|
-
const computedGroupColumns =
|
|
17786
|
+
const computedGroupColumns = getGroupColumnsForComputedColumns(
|
|
17953
17787
|
computedColumns,
|
|
17954
17788
|
groupByMap
|
|
17955
17789
|
);
|
|
@@ -17977,7 +17811,7 @@ function useHideColumns(groupByMap) {
|
|
|
17977
17811
|
hideEmptyGroupColumns ? groupRowsIndexesInDataArray : null,
|
|
17978
17812
|
hideEmptyGroupColumns
|
|
17979
17813
|
]);
|
|
17980
|
-
|
|
17814
|
+
useEffect23(() => {
|
|
17981
17815
|
const isGrouped = groupBy.length > 0;
|
|
17982
17816
|
const currentState = getComponentState();
|
|
17983
17817
|
const {
|
|
@@ -17990,7 +17824,8 @@ function useHideColumns(groupByMap) {
|
|
|
17990
17824
|
let updatedVisibilityWhenGrouping = false;
|
|
17991
17825
|
let newlyHiddenColumns = /* @__PURE__ */ new Set();
|
|
17992
17826
|
let newlyDisplayedColumns = /* @__PURE__ */ new Set();
|
|
17993
|
-
computedColumns.forEach((
|
|
17827
|
+
Object.keys(computedColumns).forEach((id) => {
|
|
17828
|
+
const col = computedColumns[id];
|
|
17994
17829
|
if (col.defaultHiddenWhenGroupedBy || hideColumnWhenGrouped2 != null) {
|
|
17995
17830
|
const hideWhenGrouped = col.defaultHiddenWhenGroupedBy === "*" && isGrouped || (col.defaultHiddenWhenGroupedBy === true || hideColumnWhenGrouped2) && col.field && groupByMap.get(col.field) || typeof col.defaultHiddenWhenGroupedBy === "string" && groupByMap.get(col.defaultHiddenWhenGroupedBy) || typeof col.defaultHiddenWhenGroupedBy === "object" && Object.keys(col.defaultHiddenWhenGroupedBy).reduce(
|
|
17996
17831
|
(acc, field) => acc || groupByMap.has(field),
|
|
@@ -18049,7 +17884,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
18049
17884
|
if (groupRenderStrategy === "inline") {
|
|
18050
17885
|
return { columns: void 0, groupColumnIds: [] };
|
|
18051
17886
|
}
|
|
18052
|
-
const computedColumns =
|
|
17887
|
+
const computedColumns = {};
|
|
18053
17888
|
const groupColumnIds = [];
|
|
18054
17889
|
if (groupRenderStrategy === "multi-column") {
|
|
18055
17890
|
groupBy.forEach((groupByForColumn, groupIndexForColumn, arr) => {
|
|
@@ -18068,7 +17903,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
18068
17903
|
);
|
|
18069
17904
|
const groupColumnId = generatedGroupColumn.id || `group-by-${groupByForColumn.field || groupByForColumn.groupField}`;
|
|
18070
17905
|
groupColumnIds.push(groupColumnId);
|
|
18071
|
-
computedColumns
|
|
17906
|
+
computedColumns[groupColumnId] = generatedGroupColumn;
|
|
18072
17907
|
});
|
|
18073
17908
|
} else if (groupRenderStrategy === "single-column" && groupBy.length) {
|
|
18074
17909
|
const singleGroupColumn = getSingleGroupColumn(
|
|
@@ -18084,17 +17919,19 @@ function getColumnsWhenGrouping(params) {
|
|
|
18084
17919
|
);
|
|
18085
17920
|
const groupColumnId = singleGroupColumn.id || "group-by";
|
|
18086
17921
|
groupColumnIds.push(groupColumnId);
|
|
18087
|
-
computedColumns
|
|
17922
|
+
computedColumns[groupColumnId] = singleGroupColumn;
|
|
18088
17923
|
}
|
|
18089
17924
|
if (pivotColumns) {
|
|
18090
17925
|
const columnsByField = {};
|
|
18091
|
-
columns.forEach((
|
|
17926
|
+
Object.keys(columns).forEach((colId) => {
|
|
17927
|
+
const col = columns[colId];
|
|
18092
17928
|
if (col.field) {
|
|
18093
17929
|
columnsByField[col.field] = col;
|
|
18094
17930
|
}
|
|
18095
17931
|
});
|
|
18096
|
-
pivotColumns.forEach((
|
|
17932
|
+
Object.keys(pivotColumns).forEach((key) => {
|
|
18097
17933
|
var _a, _b;
|
|
17934
|
+
const col = pivotColumns[key];
|
|
18098
17935
|
const isSimpleTotalColumn = col.pivotTotalColumn && col.columnGroup;
|
|
18099
17936
|
const isGrandTotalColumn = col.pivotTotalColumn && !col.columnGroup;
|
|
18100
17937
|
if (isSimpleTotalColumn && pivotTotalColumnPosition === false) {
|
|
@@ -18116,7 +17953,7 @@ function getColumnsWhenGrouping(params) {
|
|
|
18116
17953
|
}
|
|
18117
17954
|
}
|
|
18118
17955
|
if (column.inheritFromColumn !== false) {
|
|
18119
|
-
const colToInheritFrom = typeof column.inheritFromColumn === "string" ? columns
|
|
17956
|
+
const colToInheritFrom = typeof column.inheritFromColumn === "string" ? columns[column.inheritFromColumn] : ((_a = column.pivotAggregator) == null ? void 0 : _a.field) ? columnsByField[(_b = column.pivotAggregator) == null ? void 0 : _b.field] : void 0;
|
|
18120
17957
|
column = __spreadValues(__spreadValues({}, colToInheritFrom), column);
|
|
18121
17958
|
}
|
|
18122
17959
|
if (!column.render && column.renderValue) {
|
|
@@ -18124,38 +17961,22 @@ function getColumnsWhenGrouping(params) {
|
|
|
18124
17961
|
return column.renderValue(renderOptions);
|
|
18125
17962
|
};
|
|
18126
17963
|
}
|
|
18127
|
-
computedColumns
|
|
17964
|
+
computedColumns[key] = column;
|
|
18128
17965
|
});
|
|
18129
17966
|
} else {
|
|
18130
|
-
columns.forEach((
|
|
18131
|
-
|
|
17967
|
+
Object.keys(columns).forEach((colId) => {
|
|
17968
|
+
const col = columns[colId];
|
|
17969
|
+
computedColumns[colId] = col;
|
|
18132
17970
|
});
|
|
18133
17971
|
}
|
|
18134
17972
|
return {
|
|
18135
|
-
columns: computedColumns.
|
|
17973
|
+
columns: Object.keys(computedColumns).length ? computedColumns : void 0,
|
|
18136
17974
|
groupColumnIds
|
|
18137
17975
|
};
|
|
18138
17976
|
}
|
|
18139
17977
|
|
|
18140
17978
|
// src/components/InfiniteTable/hooks/useComputedColumns.ts
|
|
18141
17979
|
import { useMemo as useMemo12 } from "react";
|
|
18142
|
-
|
|
18143
|
-
// src/components/InfiniteTable/hooks/useRerenderOnKeyChange.ts
|
|
18144
|
-
import { useEffect as useEffect26 } from "react";
|
|
18145
|
-
var useRerenderOnKeyChange = (map2) => {
|
|
18146
|
-
const [renderId, rerender] = useRerender();
|
|
18147
|
-
useEffect26(() => {
|
|
18148
|
-
const update = rafFn(rerender);
|
|
18149
|
-
return interceptMap(map2, {
|
|
18150
|
-
set: update,
|
|
18151
|
-
clear: update,
|
|
18152
|
-
delete: update
|
|
18153
|
-
});
|
|
18154
|
-
}, [map2]);
|
|
18155
|
-
return renderId;
|
|
18156
|
-
};
|
|
18157
|
-
|
|
18158
|
-
// src/components/InfiniteTable/hooks/useComputedColumns.ts
|
|
18159
17980
|
var useComputedColumns = ({
|
|
18160
17981
|
columns,
|
|
18161
17982
|
bodySize,
|
|
@@ -18187,7 +18008,7 @@ var useComputedColumns = ({
|
|
|
18187
18008
|
columnVisibilityAssumeVisible,
|
|
18188
18009
|
columnSizing
|
|
18189
18010
|
}) => {
|
|
18190
|
-
const columnsRenderId =
|
|
18011
|
+
const columnsRenderId = 1;
|
|
18191
18012
|
const {
|
|
18192
18013
|
computedRemainingSpace,
|
|
18193
18014
|
computedColumnOrder,
|
|
@@ -18394,7 +18215,7 @@ function useComputedRowHeight(param) {
|
|
|
18394
18215
|
}
|
|
18395
18216
|
|
|
18396
18217
|
// src/components/InfiniteTable/hooks/useScrollbars.ts
|
|
18397
|
-
import { useState as useState16, useEffect as
|
|
18218
|
+
import { useState as useState16, useEffect as useEffect24, useLayoutEffect as useLayoutEffect12 } from "react";
|
|
18398
18219
|
var INITIAL_SCROLLBARS = {
|
|
18399
18220
|
vertical: false,
|
|
18400
18221
|
horizontal: false
|
|
@@ -18403,7 +18224,7 @@ function useScrollbars(brain) {
|
|
|
18403
18224
|
const { getComponentState: getInfiniteTableState } = useComponentState();
|
|
18404
18225
|
const { getState: getDataSourceState } = useDataSourceContextValue();
|
|
18405
18226
|
const [scrollbars, setScrollbars] = useState16(INITIAL_SCROLLBARS);
|
|
18406
|
-
|
|
18227
|
+
useEffect24(() => {
|
|
18407
18228
|
return brain.onRenderCountChange(() => {
|
|
18408
18229
|
const { scrollTopMax, scrollLeftMax } = brain;
|
|
18409
18230
|
setScrollbars({
|
|
@@ -18471,11 +18292,10 @@ function useComputed() {
|
|
|
18471
18292
|
}
|
|
18472
18293
|
);
|
|
18473
18294
|
});
|
|
18474
|
-
|
|
18295
|
+
useEffect25(() => {
|
|
18475
18296
|
dataSourceActions.showSeparatePivotColumnForSingleAggregation = showSeparatePivotColumnForSingleAggregation;
|
|
18476
18297
|
}, [showSeparatePivotColumnForSingleAggregation]);
|
|
18477
18298
|
const { multiSort, filterValue, filterTypes } = dataSourceState;
|
|
18478
|
-
useColumnGroups();
|
|
18479
18299
|
const { toggleGroupRow } = useColumnsWhen();
|
|
18480
18300
|
const columns = componentState.computedColumns;
|
|
18481
18301
|
const {
|
|
@@ -18773,7 +18593,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
18773
18593
|
}
|
|
18774
18594
|
let valid2 = isValidLicense(licenseKey, {
|
|
18775
18595
|
publishedAt: 1624970570587,
|
|
18776
|
-
version: "
|
|
18596
|
+
version: "4.0.0"
|
|
18777
18597
|
});
|
|
18778
18598
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
18779
18599
|
return true;
|
|
@@ -18784,18 +18604,18 @@ var useLicense = (licenseKey = "") => {
|
|
|
18784
18604
|
};
|
|
18785
18605
|
|
|
18786
18606
|
// src/components/InfiniteTable/hooks/useScrollToActiveCell.ts
|
|
18787
|
-
import { useRef as useRef25, useEffect as
|
|
18607
|
+
import { useRef as useRef25, useEffect as useEffect26 } from "react";
|
|
18788
18608
|
var RETRIES = 10;
|
|
18789
18609
|
function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
|
|
18790
18610
|
const didScrollRef = useRef25(false);
|
|
18791
18611
|
const rafId = useRef25(null);
|
|
18792
|
-
|
|
18612
|
+
useEffect26(() => {
|
|
18793
18613
|
if (activeCellIndex != null) {
|
|
18794
18614
|
didScrollRef.current = false;
|
|
18795
18615
|
cancelRaf(rafId.current);
|
|
18796
18616
|
}
|
|
18797
18617
|
}, [activeCellIndex]);
|
|
18798
|
-
|
|
18618
|
+
useEffect26(() => {
|
|
18799
18619
|
if (activeCellIndex != null && !didScrollRef.current) {
|
|
18800
18620
|
let tryScroll2 = function(times = 0) {
|
|
18801
18621
|
times++;
|
|
@@ -18823,18 +18643,18 @@ function useScrollToActiveCell(activeCellIndex, dataCount, imperativeApi) {
|
|
|
18823
18643
|
}
|
|
18824
18644
|
|
|
18825
18645
|
// src/components/InfiniteTable/hooks/useScrollToActiveRow.ts
|
|
18826
|
-
import { useRef as useRef26, useEffect as
|
|
18646
|
+
import { useRef as useRef26, useEffect as useEffect27 } from "react";
|
|
18827
18647
|
var RETRIES2 = 10;
|
|
18828
18648
|
function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
|
|
18829
18649
|
const didScrollRef = useRef26(false);
|
|
18830
18650
|
const rafId = useRef26(null);
|
|
18831
|
-
|
|
18651
|
+
useEffect27(() => {
|
|
18832
18652
|
if (activeRowIndex != null) {
|
|
18833
18653
|
didScrollRef.current = false;
|
|
18834
18654
|
cancelAnimationFrame(rafId.current);
|
|
18835
18655
|
}
|
|
18836
18656
|
}, [activeRowIndex]);
|
|
18837
|
-
|
|
18657
|
+
useEffect27(() => {
|
|
18838
18658
|
if (activeRowIndex != null && !didScrollRef.current) {
|
|
18839
18659
|
let tryScroll2 = function(times = 0) {
|
|
18840
18660
|
times++;
|
|
@@ -18863,7 +18683,7 @@ function useScrollToActiveRow(activeRowIndex, dataCount, imperativeApi) {
|
|
|
18863
18683
|
var toCSSVarName = (value) => `--infinite-${value}`;
|
|
18864
18684
|
|
|
18865
18685
|
// src/components/InfiniteTable/eventHandlers/index.ts
|
|
18866
|
-
import { useCallback as useCallback22, useMemo as useMemo15, useEffect as
|
|
18686
|
+
import { useCallback as useCallback22, useMemo as useMemo15, useEffect as useEffect28 } from "react";
|
|
18867
18687
|
|
|
18868
18688
|
// src/components/InfiniteTable/eventHandlers/onCellClick.ts
|
|
18869
18689
|
function onCellClick(context, event) {
|
|
@@ -19754,7 +19574,7 @@ function useEventHandlersContext() {
|
|
|
19754
19574
|
}
|
|
19755
19575
|
function handleDOMEvents() {
|
|
19756
19576
|
const context = useEventHandlersContext();
|
|
19757
|
-
|
|
19577
|
+
useEffect28(() => {
|
|
19758
19578
|
const removeOnKeyDown = context.getState().keyDown.onChange((event) => {
|
|
19759
19579
|
onKeyDown(context, event);
|
|
19760
19580
|
});
|
|
@@ -19809,13 +19629,13 @@ function useDOMEventHandlers() {
|
|
|
19809
19629
|
}
|
|
19810
19630
|
|
|
19811
19631
|
// src/components/InfiniteTable/hooks/useColumnMenu.ts
|
|
19812
|
-
import { useEffect as
|
|
19632
|
+
import { useEffect as useEffect32 } from "react";
|
|
19813
19633
|
|
|
19814
19634
|
// src/components/hooks/useOverlay/index.tsx
|
|
19815
19635
|
import * as React55 from "react";
|
|
19816
19636
|
import {
|
|
19817
19637
|
useCallback as useCallback23,
|
|
19818
|
-
useEffect as
|
|
19638
|
+
useEffect as useEffect30,
|
|
19819
19639
|
useLayoutEffect as useLayoutEffect13,
|
|
19820
19640
|
useState as useState18
|
|
19821
19641
|
} from "react";
|
|
@@ -20207,7 +20027,7 @@ function DefaultOverlayPortal(props) {
|
|
|
20207
20027
|
}
|
|
20208
20028
|
function OverlayContent(props) {
|
|
20209
20029
|
const nodeRef = React55.useRef(null);
|
|
20210
|
-
|
|
20030
|
+
useEffect30(() => {
|
|
20211
20031
|
return props.realign.onChange((handle) => {
|
|
20212
20032
|
if (nodeRef.current && handle) {
|
|
20213
20033
|
alignOverlayNode(nodeRef.current, handle);
|
|
@@ -20793,10 +20613,10 @@ function useMenuContext() {
|
|
|
20793
20613
|
}
|
|
20794
20614
|
|
|
20795
20615
|
// src/components/hooks/useMounted.ts
|
|
20796
|
-
import { useCallback as useCallback24, useEffect as
|
|
20616
|
+
import { useCallback as useCallback24, useEffect as useEffect31, useRef as useRef28 } from "react";
|
|
20797
20617
|
function useMounted() {
|
|
20798
20618
|
let mountedRef = useRef28(true);
|
|
20799
|
-
|
|
20619
|
+
useEffect31(() => {
|
|
20800
20620
|
mountedRef.current = true;
|
|
20801
20621
|
return () => {
|
|
20802
20622
|
mountedRef.current = false;
|
|
@@ -21635,7 +21455,7 @@ function useColumnMenu() {
|
|
|
21635
21455
|
} = useOverlay({
|
|
21636
21456
|
portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
|
|
21637
21457
|
});
|
|
21638
|
-
|
|
21458
|
+
useEffect32(() => {
|
|
21639
21459
|
const { actions: actions2, getState: getState2 } = context;
|
|
21640
21460
|
const state = getState2();
|
|
21641
21461
|
return state.onColumnMenuClick.onChange((info) => {
|
|
@@ -21650,7 +21470,7 @@ function useColumnMenu() {
|
|
|
21650
21470
|
});
|
|
21651
21471
|
}, []);
|
|
21652
21472
|
const { columnMenuVisibleForColumnId, columnMenuVisibleKey } = getState();
|
|
21653
|
-
|
|
21473
|
+
useEffect32(() => {
|
|
21654
21474
|
const { columnMenuVisibleForColumnId: columnMenuVisibleForColumnId2, columnMenuTargetRef } = getState();
|
|
21655
21475
|
if (columnMenuVisibleForColumnId2) {
|
|
21656
21476
|
let handleMouseDown2 = function(event) {
|
|
@@ -21730,13 +21550,13 @@ function FocusDetect() {
|
|
|
21730
21550
|
}
|
|
21731
21551
|
|
|
21732
21552
|
// src/components/InfiniteTable/hooks/useEditingCallbackProps.ts
|
|
21733
|
-
import { useEffect as
|
|
21553
|
+
import { useEffect as useEffect33 } from "react";
|
|
21734
21554
|
function useOnEditCancelled() {
|
|
21735
21555
|
const context = useInfiniteTable();
|
|
21736
21556
|
const { getState } = context;
|
|
21737
21557
|
const { editingCell } = getState();
|
|
21738
21558
|
const cancelled = editingCell && !editingCell.active ? editingCell.cancelled : void 0;
|
|
21739
|
-
|
|
21559
|
+
useEffect33(() => {
|
|
21740
21560
|
if (cancelled) {
|
|
21741
21561
|
const { rowIndex, columnId, initialValue } = getState().editingCell;
|
|
21742
21562
|
const { onEditCancelled } = getState();
|
|
@@ -21756,7 +21576,7 @@ function useOnEditRejected() {
|
|
|
21756
21576
|
state: { editingCell }
|
|
21757
21577
|
} = context;
|
|
21758
21578
|
const rejected = editingCell && !editingCell.active && editingCell.accepted instanceof Error ? editingCell.accepted : void 0;
|
|
21759
|
-
|
|
21579
|
+
useEffect33(() => {
|
|
21760
21580
|
if (rejected) {
|
|
21761
21581
|
const { rowIndex, columnId, value, initialValue } = getState().editingCell;
|
|
21762
21582
|
const { onEditRejected } = getState();
|
|
@@ -21778,7 +21598,7 @@ function useFocusOnEditStop() {
|
|
|
21778
21598
|
} = context;
|
|
21779
21599
|
const active = editingCell == null ? void 0 : editingCell.active;
|
|
21780
21600
|
const prevActive = usePrevious(active);
|
|
21781
|
-
|
|
21601
|
+
useEffect33(() => {
|
|
21782
21602
|
if (!active && prevActive) {
|
|
21783
21603
|
context.api.focus();
|
|
21784
21604
|
}
|
|
@@ -21791,7 +21611,7 @@ function useOnEditAccepted() {
|
|
|
21791
21611
|
getState
|
|
21792
21612
|
} = context;
|
|
21793
21613
|
const accepted = editingCell && !editingCell.active && !editingCell.cancelled && editingCell.accepted === true;
|
|
21794
|
-
|
|
21614
|
+
useEffect33(() => {
|
|
21795
21615
|
var _a, _b;
|
|
21796
21616
|
if (accepted) {
|
|
21797
21617
|
const { editingCell: editingCell2 } = getState();
|
|
@@ -21815,7 +21635,7 @@ function useOnEditPersisted() {
|
|
|
21815
21635
|
getState
|
|
21816
21636
|
} = context;
|
|
21817
21637
|
const persisted = editingCell ? editingCell.persisted : void 0;
|
|
21818
|
-
|
|
21638
|
+
useEffect33(() => {
|
|
21819
21639
|
if (persisted) {
|
|
21820
21640
|
const { editingCell: editingCell2, onEditPersistError, onEditPersistSuccess } = getState();
|
|
21821
21641
|
if (!editingCell2) {
|
|
@@ -21846,7 +21666,7 @@ function useEditingCallbackProps() {
|
|
|
21846
21666
|
}
|
|
21847
21667
|
|
|
21848
21668
|
// src/components/InfiniteTable/hooks/useColumnFilterOperatorMenu.ts
|
|
21849
|
-
import { useEffect as
|
|
21669
|
+
import { useEffect as useEffect34 } from "react";
|
|
21850
21670
|
|
|
21851
21671
|
// src/components/InfiniteTable/utils/getFilterOperatorMenuForColumn.tsx
|
|
21852
21672
|
import * as React65 from "react";
|
|
@@ -21989,7 +21809,7 @@ function useColumnFilterOperatorMenu() {
|
|
|
21989
21809
|
} = useOverlay({
|
|
21990
21810
|
portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
|
|
21991
21811
|
});
|
|
21992
|
-
|
|
21812
|
+
useEffect34(() => {
|
|
21993
21813
|
const { actions: actions2, getState: getState2 } = context;
|
|
21994
21814
|
const state = getState2();
|
|
21995
21815
|
return state.onFilterOperatorMenuClick.onChange((info) => {
|
|
@@ -22025,7 +21845,7 @@ function useColumnFilterOperatorMenu() {
|
|
|
22025
21845
|
actions2.filterOperatorMenuVisibleForColumnId = column.id;
|
|
22026
21846
|
});
|
|
22027
21847
|
}, []);
|
|
22028
|
-
|
|
21848
|
+
useEffect34(() => {
|
|
22029
21849
|
const { filterOperatorMenuVisibleForColumnId } = getState();
|
|
22030
21850
|
if (filterOperatorMenuVisibleForColumnId) {
|
|
22031
21851
|
let handleMouseDown2 = function(event) {
|
|
@@ -22052,7 +21872,7 @@ function useColumnFilterOperatorMenu() {
|
|
|
22052
21872
|
}
|
|
22053
21873
|
|
|
22054
21874
|
// src/components/InfiniteTable/hooks/useContextMenu.ts
|
|
22055
|
-
import { useEffect as
|
|
21875
|
+
import { useEffect as useEffect35 } from "react";
|
|
22056
21876
|
|
|
22057
21877
|
// src/components/InfiniteTable/utils/getCellContextMenu.tsx
|
|
22058
21878
|
import * as React66 from "react";
|
|
@@ -22197,7 +22017,7 @@ function useCellContextMenu() {
|
|
|
22197
22017
|
} = useOverlay({
|
|
22198
22018
|
portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
|
|
22199
22019
|
});
|
|
22200
|
-
|
|
22020
|
+
useEffect35(() => {
|
|
22201
22021
|
const { actions: actions2, getState: getState2, getDataSourceState } = context;
|
|
22202
22022
|
const state = getState2();
|
|
22203
22023
|
return state.cellContextMenu.onChange((info) => {
|
|
@@ -22247,7 +22067,7 @@ function useCellContextMenu() {
|
|
|
22247
22067
|
}
|
|
22248
22068
|
});
|
|
22249
22069
|
}, []);
|
|
22250
|
-
|
|
22070
|
+
useEffect35(() => {
|
|
22251
22071
|
const { cellContextMenuVisibleFor } = getState();
|
|
22252
22072
|
if (cellContextMenuVisibleFor) {
|
|
22253
22073
|
let handleMouseDown2 = function(event) {
|
|
@@ -22283,7 +22103,7 @@ function useTableContextMenu() {
|
|
|
22283
22103
|
} = useOverlay({
|
|
22284
22104
|
portalContainer: masterContext ? masterContext.getMasterState().portalDOMRef.current : false
|
|
22285
22105
|
});
|
|
22286
|
-
|
|
22106
|
+
useEffect35(() => {
|
|
22287
22107
|
const { actions: actions2, getState: getState2 } = context;
|
|
22288
22108
|
const state = getState2();
|
|
22289
22109
|
return state.contextMenu.onChange((info) => {
|
|
@@ -22328,7 +22148,7 @@ function useTableContextMenu() {
|
|
|
22328
22148
|
}
|
|
22329
22149
|
});
|
|
22330
22150
|
}, []);
|
|
22331
|
-
|
|
22151
|
+
useEffect35(() => {
|
|
22332
22152
|
const { contextMenuVisibleFor } = getState();
|
|
22333
22153
|
if (contextMenuVisibleFor) {
|
|
22334
22154
|
let handleMouseDown2 = function(event) {
|
|
@@ -22696,6 +22516,49 @@ var keyboardShortcuts = {
|
|
|
22696
22516
|
instantEdit
|
|
22697
22517
|
};
|
|
22698
22518
|
|
|
22519
|
+
// src/components/hooks/useInterceptedMap.ts
|
|
22520
|
+
import { useEffect as useEffect37 } from "react";
|
|
22521
|
+
function interceptMap(map2, fns) {
|
|
22522
|
+
const { set, delete: deleteKey, clear } = map2;
|
|
22523
|
+
if (fns.set) {
|
|
22524
|
+
map2.set = (key, value) => {
|
|
22525
|
+
set.call(map2, key, value);
|
|
22526
|
+
fns.set(key, value);
|
|
22527
|
+
return map2;
|
|
22528
|
+
};
|
|
22529
|
+
}
|
|
22530
|
+
if (fns.delete) {
|
|
22531
|
+
map2.delete = (key) => {
|
|
22532
|
+
const removed = deleteKey.call(map2, key);
|
|
22533
|
+
fns.delete(key);
|
|
22534
|
+
return removed;
|
|
22535
|
+
};
|
|
22536
|
+
}
|
|
22537
|
+
if (fns.clear || fns.beforeClear) {
|
|
22538
|
+
map2.clear = () => {
|
|
22539
|
+
if (fns.beforeClear) {
|
|
22540
|
+
fns.beforeClear(map2);
|
|
22541
|
+
}
|
|
22542
|
+
const result = clear.call(map2);
|
|
22543
|
+
if (fns.clear) {
|
|
22544
|
+
fns.clear();
|
|
22545
|
+
}
|
|
22546
|
+
return result;
|
|
22547
|
+
};
|
|
22548
|
+
}
|
|
22549
|
+
return () => {
|
|
22550
|
+
if (set) {
|
|
22551
|
+
map2.set = set;
|
|
22552
|
+
}
|
|
22553
|
+
if (deleteKey) {
|
|
22554
|
+
map2.delete = deleteKey;
|
|
22555
|
+
}
|
|
22556
|
+
if (clear) {
|
|
22557
|
+
map2.clear = clear;
|
|
22558
|
+
}
|
|
22559
|
+
};
|
|
22560
|
+
}
|
|
22561
|
+
|
|
22699
22562
|
// src/utils/FixedSizeSet.ts
|
|
22700
22563
|
var _FixedSizeSet = class {
|
|
22701
22564
|
constructor(clone, size) {
|