@infinite-table/infinite-react 6.2.11 → 7.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.css +1 -1
- package/index.d.ts +761 -558
- package/index.dev.js +976 -247
- package/index.dev.mjs +973 -244
- package/index.js +13 -9
- package/index.mjs +13 -9
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -143,7 +143,7 @@ function debounce(fn, { wait }) {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
// src/components/InfiniteTable/index.tsx
|
|
146
|
-
var
|
|
146
|
+
var React70 = __toESM(require("react"));
|
|
147
147
|
|
|
148
148
|
// src/utils/join.ts
|
|
149
149
|
var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
|
|
@@ -152,6 +152,49 @@ var join = (...args) => args.filter((x) => !!`${x}`).join(" ");
|
|
|
152
152
|
var React2 = __toESM(require("react"));
|
|
153
153
|
var import_react2 = require("react");
|
|
154
154
|
|
|
155
|
+
// src/components/utils/buildSubscriptionCallback.tsx
|
|
156
|
+
function buildSubscriptionCallback(withRaf = false) {
|
|
157
|
+
let lastCallValue = null;
|
|
158
|
+
let fns = [];
|
|
159
|
+
let rafId = null;
|
|
160
|
+
const updater = (items, callback) => {
|
|
161
|
+
const results = [];
|
|
162
|
+
if (withRaf) {
|
|
163
|
+
if (rafId != null) {
|
|
164
|
+
cancelAnimationFrame(rafId);
|
|
165
|
+
rafId = null;
|
|
166
|
+
}
|
|
167
|
+
requestAnimationFrame(() => {
|
|
168
|
+
lastCallValue = items;
|
|
169
|
+
rafId = null;
|
|
170
|
+
for (let i = 0, len = fns.length; i < len; i++) {
|
|
171
|
+
results.push(fns[i](items));
|
|
172
|
+
}
|
|
173
|
+
callback?.(results);
|
|
174
|
+
});
|
|
175
|
+
} else {
|
|
176
|
+
lastCallValue = items;
|
|
177
|
+
for (let i = 0, len = fns.length; i < len; i++) {
|
|
178
|
+
results.push(fns[i](items));
|
|
179
|
+
}
|
|
180
|
+
callback?.(results);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
updater.get = () => lastCallValue;
|
|
184
|
+
updater.onChange = (fn) => {
|
|
185
|
+
fns.push(fn);
|
|
186
|
+
return () => {
|
|
187
|
+
fns = fns.filter((f) => f !== fn);
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
updater.destroy = () => {
|
|
191
|
+
updater(null);
|
|
192
|
+
fns.length = 0;
|
|
193
|
+
};
|
|
194
|
+
updater.getListenersCount = () => fns.length;
|
|
195
|
+
return updater;
|
|
196
|
+
}
|
|
197
|
+
|
|
155
198
|
// src/utils/DeepMap/once.ts
|
|
156
199
|
function once(fn) {
|
|
157
200
|
let called = false;
|
|
@@ -782,6 +825,7 @@ var COLORS = [
|
|
|
782
825
|
];
|
|
783
826
|
var COLOR_SYMBOL = Symbol("color");
|
|
784
827
|
var USED_COLORS_MAP = /* @__PURE__ */ new WeakMap();
|
|
828
|
+
var GLOBAL_LOG_INTENT = buildSubscriptionCallback();
|
|
785
829
|
function initUsedColors(colors = COLORS) {
|
|
786
830
|
USED_COLORS_MAP.set(
|
|
787
831
|
colors,
|
|
@@ -832,7 +876,7 @@ function isChannelTargeted(channel, permissionToken) {
|
|
|
832
876
|
}
|
|
833
877
|
return void 0;
|
|
834
878
|
}
|
|
835
|
-
function
|
|
879
|
+
function isChannelEnabled(channel, permissions) {
|
|
836
880
|
const cacheKey = `channel=${channel}_permissions=${permissions}`;
|
|
837
881
|
if (enabledChannelsCache.has(cacheKey)) {
|
|
838
882
|
return enabledChannelsCache.get(cacheKey);
|
|
@@ -893,20 +937,32 @@ function debugPackage(channelName) {
|
|
|
893
937
|
function debugFactory(channelName2, parentChannel) {
|
|
894
938
|
const channel = parentChannel ? `${parentChannel}${CHANNEL_SEPARATOR}${channelName2}` : channelName2;
|
|
895
939
|
const channelParts = channel.split(CHANNEL_SEPARATOR);
|
|
896
|
-
|
|
897
|
-
|
|
940
|
+
const foundLogger = loggers.get(channelParts);
|
|
941
|
+
if (foundLogger) {
|
|
942
|
+
return foundLogger;
|
|
898
943
|
}
|
|
899
944
|
const parentLogger = loggers.get(channelParts.slice(0, -1));
|
|
900
945
|
const defaultLogFn = (parentLogger ? parentLogger.logFn : debug.logFn) ?? defaultLogger;
|
|
901
946
|
let logFn = defaultLogFn;
|
|
902
947
|
let enabled;
|
|
903
948
|
let lastMessageTimestamp = 0;
|
|
904
|
-
const isEnabled = () => enabled ??
|
|
949
|
+
const isEnabled = () => enabled ?? isChannelEnabled(channel, storageKeyValue);
|
|
905
950
|
const color = getNextColor(debug.colors);
|
|
906
|
-
const
|
|
951
|
+
const logger2 = Object.defineProperties(
|
|
907
952
|
(...args) => {
|
|
908
|
-
|
|
909
|
-
|
|
953
|
+
const intentListenersCount = GLOBAL_LOG_INTENT.getListenersCount();
|
|
954
|
+
let now;
|
|
955
|
+
if (intentListenersCount > 0) {
|
|
956
|
+
now = now ?? Date.now();
|
|
957
|
+
GLOBAL_LOG_INTENT({
|
|
958
|
+
color,
|
|
959
|
+
channel,
|
|
960
|
+
args,
|
|
961
|
+
timestamp: now
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
if (isEnabled()) {
|
|
965
|
+
now = now ?? Date.now();
|
|
910
966
|
if (lastMessageTimestamp && logDiffs) {
|
|
911
967
|
const diff = now - lastMessageTimestamp;
|
|
912
968
|
logFn(`%c[${channel}]`, `color: ${color}`, `+${diff}ms:`);
|
|
@@ -964,7 +1020,10 @@ function debugPackage(channelName) {
|
|
|
964
1020
|
}
|
|
965
1021
|
},
|
|
966
1022
|
enabled: {
|
|
967
|
-
get: () => isEnabled()
|
|
1023
|
+
get: () => isEnabled(),
|
|
1024
|
+
set: (value) => {
|
|
1025
|
+
enabled = value;
|
|
1026
|
+
}
|
|
968
1027
|
},
|
|
969
1028
|
logFn: {
|
|
970
1029
|
configurable: false,
|
|
@@ -980,8 +1039,8 @@ function debugPackage(channelName) {
|
|
|
980
1039
|
}
|
|
981
1040
|
}
|
|
982
1041
|
);
|
|
983
|
-
loggers.set(channelParts,
|
|
984
|
-
return
|
|
1042
|
+
loggers.set(channelParts, logger2);
|
|
1043
|
+
return logger2;
|
|
985
1044
|
}
|
|
986
1045
|
return debugFactory(channelName);
|
|
987
1046
|
}
|
|
@@ -997,22 +1056,45 @@ Object.defineProperty(debugPackage, "enable", {
|
|
|
997
1056
|
var debug = debugPackage;
|
|
998
1057
|
debug.colors = COLORS;
|
|
999
1058
|
debug.logFn = defaultLogger;
|
|
1059
|
+
var onLogIntentGlobal = (intentChannel, fn) => {
|
|
1060
|
+
return GLOBAL_LOG_INTENT.onChange((options) => {
|
|
1061
|
+
if (!options) {
|
|
1062
|
+
return;
|
|
1063
|
+
}
|
|
1064
|
+
const { channel, args, color, timestamp } = options;
|
|
1065
|
+
if (isChannelTargeted(channel, intentChannel)) {
|
|
1066
|
+
fn({
|
|
1067
|
+
channel,
|
|
1068
|
+
color,
|
|
1069
|
+
args,
|
|
1070
|
+
timestamp
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
});
|
|
1074
|
+
};
|
|
1075
|
+
debug.onLogIntent = onLogIntentGlobal;
|
|
1000
1076
|
debug.destroyAll = () => {
|
|
1001
1077
|
initUsedColors();
|
|
1002
1078
|
initUsedColors(debug.colors);
|
|
1003
1079
|
loggers.clear();
|
|
1004
1080
|
enabledChannelsCache.clear();
|
|
1005
1081
|
};
|
|
1082
|
+
if (false) {
|
|
1083
|
+
globalThis.debugPackage = debug;
|
|
1084
|
+
}
|
|
1006
1085
|
|
|
1007
|
-
// src/utils/
|
|
1008
|
-
var debugTable = debug(`InfiniteTable`);
|
|
1086
|
+
// src/utils/debugLoggers.ts
|
|
1009
1087
|
var dbg = (channelName) => {
|
|
1010
|
-
const result =
|
|
1088
|
+
const result = debug(
|
|
1089
|
+
channelName ? `${channelName}:TYPE=debug` : "TYPE=debug"
|
|
1090
|
+
);
|
|
1011
1091
|
result.logFn = console.log.bind(console);
|
|
1012
1092
|
return result;
|
|
1013
1093
|
};
|
|
1014
1094
|
var err = (channelName) => {
|
|
1015
|
-
const result =
|
|
1095
|
+
const result = debug(
|
|
1096
|
+
channelName ? `${channelName}:TYPE=error` : "TYPE=error"
|
|
1097
|
+
);
|
|
1016
1098
|
result.logFn = console.error.bind(console);
|
|
1017
1099
|
return result;
|
|
1018
1100
|
};
|
|
@@ -1363,49 +1445,6 @@ function AvoidReactDiffFn(props) {
|
|
|
1363
1445
|
}
|
|
1364
1446
|
var AvoidReactDiff = React8.memo(AvoidReactDiffFn);
|
|
1365
1447
|
|
|
1366
|
-
// src/components/utils/buildSubscriptionCallback.tsx
|
|
1367
|
-
function buildSubscriptionCallback(withRaf = false) {
|
|
1368
|
-
let lastCallValue = null;
|
|
1369
|
-
let fns = [];
|
|
1370
|
-
let rafId = null;
|
|
1371
|
-
const updater = (items, callback) => {
|
|
1372
|
-
const results = [];
|
|
1373
|
-
if (withRaf) {
|
|
1374
|
-
if (rafId != null) {
|
|
1375
|
-
cancelAnimationFrame(rafId);
|
|
1376
|
-
rafId = null;
|
|
1377
|
-
}
|
|
1378
|
-
requestAnimationFrame(() => {
|
|
1379
|
-
lastCallValue = items;
|
|
1380
|
-
rafId = null;
|
|
1381
|
-
for (let i = 0, len = fns.length; i < len; i++) {
|
|
1382
|
-
results.push(fns[i](items));
|
|
1383
|
-
}
|
|
1384
|
-
callback?.(results);
|
|
1385
|
-
});
|
|
1386
|
-
} else {
|
|
1387
|
-
lastCallValue = items;
|
|
1388
|
-
for (let i = 0, len = fns.length; i < len; i++) {
|
|
1389
|
-
results.push(fns[i](items));
|
|
1390
|
-
}
|
|
1391
|
-
callback?.(results);
|
|
1392
|
-
}
|
|
1393
|
-
};
|
|
1394
|
-
updater.get = () => lastCallValue;
|
|
1395
|
-
updater.onChange = (fn) => {
|
|
1396
|
-
fns.push(fn);
|
|
1397
|
-
return () => {
|
|
1398
|
-
fns = fns.filter((f) => f !== fn);
|
|
1399
|
-
};
|
|
1400
|
-
};
|
|
1401
|
-
updater.destroy = () => {
|
|
1402
|
-
updater(null);
|
|
1403
|
-
fns.length = 0;
|
|
1404
|
-
};
|
|
1405
|
-
updater.getListenersCount = () => fns.length;
|
|
1406
|
-
return updater;
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
1448
|
// src/utils/selectParent.ts
|
|
1410
1449
|
function selectParent(el, selector2) {
|
|
1411
1450
|
let node = el;
|
|
@@ -1623,6 +1662,15 @@ function getGreatestCountVisibleInSize(availableSize, itemSizes) {
|
|
|
1623
1662
|
return maxCount < 0 ? len : Math.min(maxCount, len);
|
|
1624
1663
|
}
|
|
1625
1664
|
|
|
1665
|
+
// src/utils/debugChannel.ts
|
|
1666
|
+
var PREFIX = "DebugID=";
|
|
1667
|
+
function getDebugChannel(debugId, channel) {
|
|
1668
|
+
if (channel && channel.startsWith(PREFIX)) {
|
|
1669
|
+
return channel;
|
|
1670
|
+
}
|
|
1671
|
+
return channel ? `${PREFIX}${debugId}:${channel}` : `${PREFIX}${debugId}`;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1626
1674
|
// src/components/VirtualBrain/MatrixBrain.ts
|
|
1627
1675
|
var DEFAULT_EXTEND_BY = {
|
|
1628
1676
|
start: 0,
|
|
@@ -1652,7 +1700,7 @@ function defaultShouldUpdateRenderCount(options) {
|
|
|
1652
1700
|
}
|
|
1653
1701
|
var MatrixBrain = class extends Logger {
|
|
1654
1702
|
constructor(name) {
|
|
1655
|
-
const logName =
|
|
1703
|
+
const logName = getDebugChannel(name, `${name}:MatrixBrain`);
|
|
1656
1704
|
super(logName);
|
|
1657
1705
|
this.scrolling = false;
|
|
1658
1706
|
this.RENDER_COUNT_SAFETY_MARGIN_START = 1;
|
|
@@ -2442,7 +2490,7 @@ var MatrixBrain = class extends Logger {
|
|
|
2442
2490
|
height: this.availableRenderHeight ?? this.availableHeight
|
|
2443
2491
|
};
|
|
2444
2492
|
};
|
|
2445
|
-
this.name =
|
|
2493
|
+
this.name = logName;
|
|
2446
2494
|
this.update = this.update.bind(this);
|
|
2447
2495
|
this.destroy = this.destroy.bind(this);
|
|
2448
2496
|
this.getCellOffset = this.getCellOffset.bind(this);
|
|
@@ -5044,9 +5092,9 @@ var HorizontalLayoutTableRenderer = class extends GridRenderer {
|
|
|
5044
5092
|
|
|
5045
5093
|
// src/components/HeadlessTable/createRenderer.ts
|
|
5046
5094
|
function createRenderer(brain) {
|
|
5047
|
-
const renderer = !brain.isHorizontalLayoutBrain ? new GridRenderer(brain,
|
|
5095
|
+
const renderer = !brain.isHorizontalLayoutBrain ? new GridRenderer(brain, `${brain.name}:ReactHeadlessTableRenderer`) : new HorizontalLayoutTableRenderer(
|
|
5048
5096
|
brain,
|
|
5049
|
-
|
|
5097
|
+
`${brain.name}:HorizontalLayoutTableRenderer`
|
|
5050
5098
|
);
|
|
5051
5099
|
const onRenderUpdater = buildSubscriptionCallback();
|
|
5052
5100
|
brain.onDestroy(() => {
|
|
@@ -5905,8 +5953,10 @@ function buildManagedComponent(config) {
|
|
|
5905
5953
|
}
|
|
5906
5954
|
});
|
|
5907
5955
|
if (updatedPropsToStateCount > 0 || newMappedStateCount > 0) {
|
|
5908
|
-
const
|
|
5909
|
-
|
|
5956
|
+
const logger2 = config.debugName ? dbg(
|
|
5957
|
+
typeof config.debugName === "function" ? `${config.debugName(currentProps)}:rerender` : `${config.debugName}:rerender`
|
|
5958
|
+
) : dbg("rerender");
|
|
5959
|
+
logger2(
|
|
5910
5960
|
"Triggered by new values for the following props",
|
|
5911
5961
|
...[
|
|
5912
5962
|
...Object.keys(newMappedState ?? {}),
|
|
@@ -9705,6 +9755,8 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
9705
9755
|
column,
|
|
9706
9756
|
onMouseLeave,
|
|
9707
9757
|
onMouseEnter,
|
|
9758
|
+
onRowMouseEnter,
|
|
9759
|
+
onRowMouseLeave,
|
|
9708
9760
|
// toggleGroupRow,
|
|
9709
9761
|
rowIndex,
|
|
9710
9762
|
rowHeight,
|
|
@@ -9776,6 +9828,24 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
9776
9828
|
const { align: align2, verticalAlign } = renderParams;
|
|
9777
9829
|
const renderParam = renderParams;
|
|
9778
9830
|
const renderParamRef = React37.useRef(renderParam);
|
|
9831
|
+
const handleMouseEnter = onRowMouseEnter && onMouseEnter ? (event) => {
|
|
9832
|
+
const rowInfoDiscriminator = formattedValueContext;
|
|
9833
|
+
const rowContext = {
|
|
9834
|
+
...rowInfoDiscriminator,
|
|
9835
|
+
rowIndex
|
|
9836
|
+
};
|
|
9837
|
+
onRowMouseEnter(rowContext, event);
|
|
9838
|
+
onMouseEnter(event);
|
|
9839
|
+
} : onMouseEnter;
|
|
9840
|
+
const handleMouseLeave = onRowMouseLeave && onMouseLeave ? (event) => {
|
|
9841
|
+
const rowContext = {
|
|
9842
|
+
...formattedValueContext,
|
|
9843
|
+
rowIndex,
|
|
9844
|
+
rowInfo
|
|
9845
|
+
};
|
|
9846
|
+
onRowMouseLeave(rowContext, event);
|
|
9847
|
+
onMouseLeave(event);
|
|
9848
|
+
} : onMouseLeave;
|
|
9779
9849
|
const onClick = (0, import_react24.useCallback)(
|
|
9780
9850
|
(event) => {
|
|
9781
9851
|
const colIndex = column.computedVisibleIndex;
|
|
@@ -10129,8 +10199,8 @@ function InfiniteTableColumnCellFn(props) {
|
|
|
10129
10199
|
rowId: rowInfo.id,
|
|
10130
10200
|
horizontalLayoutPageIndex,
|
|
10131
10201
|
style: memoizedStyle,
|
|
10132
|
-
onMouseLeave,
|
|
10133
|
-
onMouseEnter,
|
|
10202
|
+
onMouseLeave: handleMouseLeave,
|
|
10203
|
+
onMouseEnter: handleMouseEnter,
|
|
10134
10204
|
onClick,
|
|
10135
10205
|
afterChildren,
|
|
10136
10206
|
onMouseDown,
|
|
@@ -13834,7 +13904,6 @@ var RowSelectionState = class {
|
|
|
13834
13904
|
};
|
|
13835
13905
|
|
|
13836
13906
|
// src/components/DataSource/CellSelectionState.ts
|
|
13837
|
-
var debug3 = dbg("CellSelectionState");
|
|
13838
13907
|
var WILDCARD = "*";
|
|
13839
13908
|
var CellSelectionState = class {
|
|
13840
13909
|
constructor(clone) {
|
|
@@ -13845,6 +13914,7 @@ var CellSelectionState = class {
|
|
|
13845
13914
|
this.deselectedRowsToColumns = /* @__PURE__ */ new Map();
|
|
13846
13915
|
this.deselectedColumnsToRows = /* @__PURE__ */ new Map();
|
|
13847
13916
|
this.defaultSelection = false;
|
|
13917
|
+
this.debugId = "";
|
|
13848
13918
|
this.deselectAll = () => {
|
|
13849
13919
|
this.update({
|
|
13850
13920
|
defaultSelection: false,
|
|
@@ -14090,12 +14160,17 @@ var CellSelectionState = class {
|
|
|
14090
14160
|
}
|
|
14091
14161
|
return false;
|
|
14092
14162
|
}
|
|
14163
|
+
// private debug(message: string) {
|
|
14164
|
+
// const debug = dbg(`${this.debugId}:CellSelectionState`);
|
|
14165
|
+
// debug(message);
|
|
14166
|
+
// }
|
|
14167
|
+
error(message) {
|
|
14168
|
+
const error4 = err(`${this.debugId}:CellSelectionState`);
|
|
14169
|
+
error4(message);
|
|
14170
|
+
}
|
|
14093
14171
|
isCellSelected(rowId, colId) {
|
|
14094
14172
|
if (rowId === this.wildcard || colId === this.wildcard) {
|
|
14095
|
-
|
|
14096
|
-
`CellSelectionState.isCellSelected should not be called with wildcard`
|
|
14097
|
-
);
|
|
14098
|
-
debug3(
|
|
14173
|
+
this.error(
|
|
14099
14174
|
`CellSelectionState.isCellSelected should not be called with wildcard`
|
|
14100
14175
|
);
|
|
14101
14176
|
return false;
|
|
@@ -14178,6 +14253,7 @@ var CellSelectionState = class {
|
|
|
14178
14253
|
|
|
14179
14254
|
// src/utils/logger.ts
|
|
14180
14255
|
var log = debug("InfiniteTable");
|
|
14256
|
+
var COLOR_ERROR_VALUE = `#dc3545`;
|
|
14181
14257
|
var COLOR_WARN_VALUE = `#eb9316`;
|
|
14182
14258
|
var warnChannel = "Warn";
|
|
14183
14259
|
var errorChannel = "Error";
|
|
@@ -14190,9 +14266,18 @@ var warnLogger = logger.extend(warnChannel);
|
|
|
14190
14266
|
var errorLogger = logger.extend(errorChannel);
|
|
14191
14267
|
var successLogger = logger.extend(successChannel);
|
|
14192
14268
|
var logColorWarn = COLOR_WARN_VALUE;
|
|
14193
|
-
var
|
|
14194
|
-
|
|
14195
|
-
|
|
14269
|
+
var logColorError = COLOR_ERROR_VALUE;
|
|
14270
|
+
var warn = (message, logger2) => {
|
|
14271
|
+
logger2 = logger2 ? logger2.extend ? logger2.extend(warnChannel) : logger2 : warnLogger;
|
|
14272
|
+
logger2(
|
|
14273
|
+
typeof logger2.color === "function" ? logger2.color(logColorWarn, message) : message
|
|
14274
|
+
);
|
|
14275
|
+
};
|
|
14276
|
+
var error2 = (message, logger2) => {
|
|
14277
|
+
logger2 = logger2 ? logger2.extend ? logger2.extend(errorChannel) : logger2 : errorLogger;
|
|
14278
|
+
logger2(
|
|
14279
|
+
typeof logger2.color === "function" ? logger2.color(logColorError, message) : message
|
|
14280
|
+
);
|
|
14196
14281
|
};
|
|
14197
14282
|
var doOnceFlags = new DeepMap();
|
|
14198
14283
|
var doOnce = (func, ...keys) => {
|
|
@@ -14202,8 +14287,11 @@ var doOnce = (func, ...keys) => {
|
|
|
14202
14287
|
doOnceFlags.set(keys, true);
|
|
14203
14288
|
func();
|
|
14204
14289
|
};
|
|
14205
|
-
var warnOnce = (message, key = message,
|
|
14206
|
-
doOnce(() => warn(message,
|
|
14290
|
+
var warnOnce = (message, key = message, logger2) => {
|
|
14291
|
+
doOnce(() => warn(message, logger2), key, "warn");
|
|
14292
|
+
};
|
|
14293
|
+
var errorOnce = (message, key = message, logger2) => {
|
|
14294
|
+
doOnce(() => error2(message, logger2), key, "error");
|
|
14207
14295
|
};
|
|
14208
14296
|
|
|
14209
14297
|
// src/components/InfiniteTable/api/getRowSelectionApi.ts
|
|
@@ -16107,12 +16195,12 @@ var DataSourceApiImpl = class {
|
|
|
16107
16195
|
}
|
|
16108
16196
|
return this.waitForNodePath(nodePath, { timeout }).then((okay) => {
|
|
16109
16197
|
if (!okay) {
|
|
16110
|
-
const
|
|
16198
|
+
const error4 = `Cannot find node path "${nodePath.join(
|
|
16111
16199
|
"/"
|
|
16112
16200
|
)}" (we waited for it ${timeout}ms)`;
|
|
16113
|
-
console.error(
|
|
16201
|
+
console.error(error4);
|
|
16114
16202
|
return fn({
|
|
16115
|
-
error:
|
|
16203
|
+
error: error4,
|
|
16116
16204
|
resolved: false
|
|
16117
16205
|
});
|
|
16118
16206
|
}
|
|
@@ -16129,8 +16217,8 @@ var DataSourceApiImpl = class {
|
|
|
16129
16217
|
this.updateChildrenByNodePath = (childrenOrFn, nodePath, options) => {
|
|
16130
16218
|
return this.withWaitForNode(
|
|
16131
16219
|
nodePath,
|
|
16132
|
-
({ error:
|
|
16133
|
-
if (
|
|
16220
|
+
({ error: error4 }) => {
|
|
16221
|
+
if (error4) {
|
|
16134
16222
|
return false;
|
|
16135
16223
|
}
|
|
16136
16224
|
return this.updateChildrenByNodePath_Internal(
|
|
@@ -16158,8 +16246,8 @@ var DataSourceApiImpl = class {
|
|
|
16158
16246
|
if (!this.isNodePathAvailable(nodePath)) {
|
|
16159
16247
|
return this.withWaitForNode(
|
|
16160
16248
|
nodePath,
|
|
16161
|
-
({ error:
|
|
16162
|
-
if (
|
|
16249
|
+
({ error: error4 }) => {
|
|
16250
|
+
if (error4) {
|
|
16163
16251
|
return false;
|
|
16164
16252
|
}
|
|
16165
16253
|
return this.updateDataArrayByNodePath_Internal(
|
|
@@ -16192,7 +16280,7 @@ var DataSourceApiImpl = class {
|
|
|
16192
16280
|
const allNodePaths = updateInfo.map((info) => info.nodePath);
|
|
16193
16281
|
const promiseWithAll = Promise.allSettled(
|
|
16194
16282
|
allNodePaths.map((nodePath) => {
|
|
16195
|
-
return this.withWaitForNode(nodePath, ({ error:
|
|
16283
|
+
return this.withWaitForNode(nodePath, ({ error: error4 }) => !error4, options);
|
|
16196
16284
|
})
|
|
16197
16285
|
);
|
|
16198
16286
|
return promiseWithAll.then((allGood) => {
|
|
@@ -16311,8 +16399,8 @@ var DataSourceApiImpl = class {
|
|
|
16311
16399
|
if (isTree && nodePath?.length) {
|
|
16312
16400
|
return this.withWaitForNode(
|
|
16313
16401
|
nodePath,
|
|
16314
|
-
({ error:
|
|
16315
|
-
if (
|
|
16402
|
+
({ error: error4 }) => {
|
|
16403
|
+
if (error4) {
|
|
16316
16404
|
return false;
|
|
16317
16405
|
}
|
|
16318
16406
|
if (options.position === "before" || options.position === "after") {
|
|
@@ -16375,8 +16463,8 @@ var DataSourceApiImpl = class {
|
|
|
16375
16463
|
if (nodePath.length && !this.isNodePathAvailable(nodePath)) {
|
|
16376
16464
|
return this.withWaitForNode(
|
|
16377
16465
|
nodePath,
|
|
16378
|
-
({ error:
|
|
16379
|
-
if (
|
|
16466
|
+
({ error: error4 }) => {
|
|
16467
|
+
if (error4) {
|
|
16380
16468
|
return false;
|
|
16381
16469
|
}
|
|
16382
16470
|
const result2 = this.batchOperation({
|
|
@@ -16415,6 +16503,9 @@ var DataSourceApiImpl = class {
|
|
|
16415
16503
|
this.actions.sortInfo = sortInfo;
|
|
16416
16504
|
return;
|
|
16417
16505
|
};
|
|
16506
|
+
this.setGroupBy = (groupBy) => {
|
|
16507
|
+
this.actions.groupBy = groupBy;
|
|
16508
|
+
};
|
|
16418
16509
|
this.isRowDisabledAt = (rowIndex) => {
|
|
16419
16510
|
const rowInfo = this.getRowInfoByIndex(rowIndex);
|
|
16420
16511
|
return rowInfo?.rowDisabled ?? false;
|
|
@@ -17161,20 +17252,31 @@ function concludeReducer(params) {
|
|
|
17161
17252
|
}
|
|
17162
17253
|
if (shouldFilterClientSide) {
|
|
17163
17254
|
state.unfilteredCount = dataArray.length;
|
|
17164
|
-
|
|
17165
|
-
|
|
17166
|
-
|
|
17167
|
-
|
|
17168
|
-
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
|
|
17175
|
-
|
|
17176
|
-
|
|
17177
|
-
|
|
17255
|
+
let filterTimestamp = now;
|
|
17256
|
+
if (shouldFilterAgain) {
|
|
17257
|
+
if (state.devToolsDetected) {
|
|
17258
|
+
filterTimestamp = Date.now();
|
|
17259
|
+
}
|
|
17260
|
+
dataArray = filterDataSource({
|
|
17261
|
+
// tree-related stuff
|
|
17262
|
+
getNodeChildren,
|
|
17263
|
+
isLeafNode,
|
|
17264
|
+
nodesKey,
|
|
17265
|
+
treeFilterFunction,
|
|
17266
|
+
// ---
|
|
17267
|
+
dataArray,
|
|
17268
|
+
toPrimaryKey,
|
|
17269
|
+
filterTypes,
|
|
17270
|
+
operatorsByFilterType,
|
|
17271
|
+
filterFunction,
|
|
17272
|
+
filterValue
|
|
17273
|
+
});
|
|
17274
|
+
if (state.devToolsDetected) {
|
|
17275
|
+
state.debugTimings.set("filter", Date.now() - filterTimestamp);
|
|
17276
|
+
}
|
|
17277
|
+
} else {
|
|
17278
|
+
dataArray = state.lastFilterDataArray;
|
|
17279
|
+
}
|
|
17178
17280
|
state.lastFilterDataArray = dataArray;
|
|
17179
17281
|
state.filteredAt = now;
|
|
17180
17282
|
}
|
|
@@ -17184,6 +17286,10 @@ function concludeReducer(params) {
|
|
|
17184
17286
|
const prevKnownTypes = multisort.knownTypes;
|
|
17185
17287
|
multisort.knownTypes = { ...prevKnownTypes, ...state.sortTypes };
|
|
17186
17288
|
if (shouldSortAgain) {
|
|
17289
|
+
let sortTimestamp = now;
|
|
17290
|
+
if (state.devToolsDetected) {
|
|
17291
|
+
sortTimestamp = Date.now();
|
|
17292
|
+
}
|
|
17187
17293
|
if (state.sortFunction) {
|
|
17188
17294
|
dataArray = state.sortFunction(sortInfo, [...dataArray]);
|
|
17189
17295
|
} else {
|
|
@@ -17199,6 +17305,10 @@ function concludeReducer(params) {
|
|
|
17199
17305
|
dataArray = multisort(sortInfo, [...dataArray]);
|
|
17200
17306
|
}
|
|
17201
17307
|
}
|
|
17308
|
+
if (state.devToolsDetected) {
|
|
17309
|
+
const sortDuration = Date.now() - sortTimestamp;
|
|
17310
|
+
state.debugTimings.set("sort", sortDuration);
|
|
17311
|
+
}
|
|
17202
17312
|
} else {
|
|
17203
17313
|
dataArray = state.lastSortDataArray;
|
|
17204
17314
|
}
|
|
@@ -17245,6 +17355,10 @@ function concludeReducer(params) {
|
|
|
17245
17355
|
const rowInfoReducers = state.rowInfoReducers;
|
|
17246
17356
|
if (shouldGroup) {
|
|
17247
17357
|
if (shouldGroupAgain) {
|
|
17358
|
+
let groupTimestamp = now;
|
|
17359
|
+
if (state.devToolsDetected) {
|
|
17360
|
+
groupTimestamp = Date.now();
|
|
17361
|
+
}
|
|
17248
17362
|
let aggregationReducers = state.aggregationReducers;
|
|
17249
17363
|
const groupResult = state.lazyLoad ? lazyGroup(
|
|
17250
17364
|
{
|
|
@@ -17327,6 +17441,9 @@ function concludeReducer(params) {
|
|
|
17327
17441
|
}) : void 0;
|
|
17328
17442
|
state.pivotColumns = pivotGroupsAndCols?.columns;
|
|
17329
17443
|
state.pivotColumnGroups = pivotGroupsAndCols?.columnGroups;
|
|
17444
|
+
if (state.devToolsDetected) {
|
|
17445
|
+
state.debugTimings.set("group-and-pivot", Date.now() - groupTimestamp);
|
|
17446
|
+
}
|
|
17330
17447
|
} else {
|
|
17331
17448
|
rowInfoDataArray = state.lastGroupDataArray;
|
|
17332
17449
|
}
|
|
@@ -17334,6 +17451,10 @@ function concludeReducer(params) {
|
|
|
17334
17451
|
state.groupedAt = now;
|
|
17335
17452
|
} else if (shouldTree) {
|
|
17336
17453
|
if (shouldTreeAgain) {
|
|
17454
|
+
let treeTimestamp = now;
|
|
17455
|
+
if (state.devToolsDetected) {
|
|
17456
|
+
treeTimestamp = Date.now();
|
|
17457
|
+
}
|
|
17337
17458
|
let aggregationReducers = state.aggregationReducers;
|
|
17338
17459
|
const treeParams = {
|
|
17339
17460
|
isLeafNode,
|
|
@@ -17403,6 +17524,9 @@ function concludeReducer(params) {
|
|
|
17403
17524
|
state.reducerResults = treeResult.reducerResults;
|
|
17404
17525
|
state.totalLeafNodesCount = treeResult.deepMap.get([])?.totalLeafNodesCount ?? 0;
|
|
17405
17526
|
state.treeAt = now;
|
|
17527
|
+
if (state.devToolsDetected) {
|
|
17528
|
+
state.debugTimings.set("tree", Date.now() - treeTimestamp);
|
|
17529
|
+
}
|
|
17406
17530
|
} else {
|
|
17407
17531
|
rowInfoDataArray = state.lastTreeDataArray;
|
|
17408
17532
|
}
|
|
@@ -17500,6 +17624,155 @@ function getChangeDetect() {
|
|
|
17500
17624
|
return `${Date.now()}:${perfNow}`;
|
|
17501
17625
|
}
|
|
17502
17626
|
|
|
17627
|
+
// src/components/InfiniteTable/errorCodes.ts
|
|
17628
|
+
function buildErrorPayload(code, message, type) {
|
|
17629
|
+
message = message.replaceAll("$ERR_CODE", code);
|
|
17630
|
+
message = `${message}
|
|
17631
|
+
|
|
17632
|
+
ERROR_CODE = ${code}
|
|
17633
|
+
|
|
17634
|
+
See http://infinite-table.com/docs/reference/error-codes#${code} for more info.`;
|
|
17635
|
+
return {
|
|
17636
|
+
code,
|
|
17637
|
+
message,
|
|
17638
|
+
type: type ?? "error"
|
|
17639
|
+
};
|
|
17640
|
+
}
|
|
17641
|
+
function buildErrors(errors) {
|
|
17642
|
+
return Object.entries(errors).reduce((acc, [key, message]) => {
|
|
17643
|
+
const code = key;
|
|
17644
|
+
const payload = buildErrorPayload(
|
|
17645
|
+
code,
|
|
17646
|
+
typeof message === "string" ? message : message.message,
|
|
17647
|
+
typeof message === "string" ? void 0 : message.type
|
|
17648
|
+
);
|
|
17649
|
+
acc[code] = payload;
|
|
17650
|
+
return acc;
|
|
17651
|
+
}, {});
|
|
17652
|
+
}
|
|
17653
|
+
function warn2(strings) {
|
|
17654
|
+
return {
|
|
17655
|
+
message: strings.join(""),
|
|
17656
|
+
type: "warning"
|
|
17657
|
+
};
|
|
17658
|
+
}
|
|
17659
|
+
function error3(strings) {
|
|
17660
|
+
return {
|
|
17661
|
+
message: strings.join(""),
|
|
17662
|
+
type: "error"
|
|
17663
|
+
};
|
|
17664
|
+
}
|
|
17665
|
+
var DS_ERROR_CODES = buildErrors({
|
|
17666
|
+
DS001: warn2`The "data" prop of your DataSource seems to be updating too frequently.
|
|
17667
|
+
Make sure you don't pass a new reference on every render.`
|
|
17668
|
+
});
|
|
17669
|
+
var INFINITE_ERROR_CODES = buildErrors({
|
|
17670
|
+
CSS001_CSS: error3`It appears you have not loaded the CSS file for InfiniteTable.
|
|
17671
|
+
In most environments, you should be able to fix this by adding the following line:
|
|
17672
|
+
|
|
17673
|
+
import '@infinite-table/infinite-react/index.css'
|
|
17674
|
+
`
|
|
17675
|
+
});
|
|
17676
|
+
var ERROR_CODES = {
|
|
17677
|
+
...DS_ERROR_CODES,
|
|
17678
|
+
...INFINITE_ERROR_CODES
|
|
17679
|
+
};
|
|
17680
|
+
|
|
17681
|
+
// src/DEV_TOOLS_OVERRIDES.ts
|
|
17682
|
+
var DEV_TOOLS_INFINITE_OVERRIDES = /* @__PURE__ */ new Map();
|
|
17683
|
+
var DEV_TOOLS_DATASOURCE_OVERRIDES = /* @__PURE__ */ new Map();
|
|
17684
|
+
var DEV_TOOLS_INFINITE_INITIALS = /* @__PURE__ */ new Map();
|
|
17685
|
+
var DEV_TOOLS_DATASOURCE_INITIALS = /* @__PURE__ */ new Map();
|
|
17686
|
+
|
|
17687
|
+
// src/utils/debugModeUtils.ts
|
|
17688
|
+
var INSTANCES = /* @__PURE__ */ new Map();
|
|
17689
|
+
var deleteInstanceFromDevTools = (debugId) => {
|
|
17690
|
+
INSTANCES.delete(debugId);
|
|
17691
|
+
DEV_TOOLS_INFINITE_INITIALS.delete(debugId);
|
|
17692
|
+
DEV_TOOLS_INFINITE_OVERRIDES.delete(debugId);
|
|
17693
|
+
DEV_TOOLS_DATASOURCE_INITIALS.delete(debugId);
|
|
17694
|
+
DEV_TOOLS_DATASOURCE_OVERRIDES.delete(debugId);
|
|
17695
|
+
};
|
|
17696
|
+
function setDevToolInfinitePropertyOverride(debugId, property, value) {
|
|
17697
|
+
const instance = INSTANCES.get(debugId);
|
|
17698
|
+
if (!instance) {
|
|
17699
|
+
return;
|
|
17700
|
+
}
|
|
17701
|
+
const initial = DEV_TOOLS_INFINITE_INITIALS.get(debugId);
|
|
17702
|
+
if (!initial || !Object.hasOwn(initial, property)) {
|
|
17703
|
+
DEV_TOOLS_INFINITE_INITIALS.set(debugId, {
|
|
17704
|
+
...initial || {},
|
|
17705
|
+
[property]: instance.getState()[property]
|
|
17706
|
+
});
|
|
17707
|
+
}
|
|
17708
|
+
DEV_TOOLS_INFINITE_OVERRIDES.set(debugId, {
|
|
17709
|
+
...DEV_TOOLS_INFINITE_OVERRIDES.get(debugId) || {},
|
|
17710
|
+
[property]: value
|
|
17711
|
+
});
|
|
17712
|
+
instance.actions[property] = value;
|
|
17713
|
+
}
|
|
17714
|
+
function setDevToolDataSourcePropertyOverride(debugId, property, value) {
|
|
17715
|
+
const instance = INSTANCES.get(debugId);
|
|
17716
|
+
if (!instance) {
|
|
17717
|
+
return;
|
|
17718
|
+
}
|
|
17719
|
+
const initial = DEV_TOOLS_DATASOURCE_INITIALS.get(debugId);
|
|
17720
|
+
if (!initial || !Object.hasOwn(initial, property)) {
|
|
17721
|
+
DEV_TOOLS_DATASOURCE_INITIALS.set(debugId, {
|
|
17722
|
+
...initial || {},
|
|
17723
|
+
[property]: instance.getDataSourceState()[property]
|
|
17724
|
+
});
|
|
17725
|
+
}
|
|
17726
|
+
DEV_TOOLS_DATASOURCE_OVERRIDES.set(debugId, {
|
|
17727
|
+
...DEV_TOOLS_DATASOURCE_OVERRIDES.get(debugId) || {},
|
|
17728
|
+
[property]: value
|
|
17729
|
+
});
|
|
17730
|
+
instance.dataSourceActions[property] = value;
|
|
17731
|
+
}
|
|
17732
|
+
var warnKnownErrorOnce = (error4) => {
|
|
17733
|
+
const logger2 = error4.type === "error" ? err(error4.debugId) : dbg(error4.debugId);
|
|
17734
|
+
const onceLogger = error4.type === "error" ? errorOnce : warnOnce;
|
|
17735
|
+
const onceKey = error4.debugId ? `${error4.code}-${error4.debugId}` : error4.code;
|
|
17736
|
+
let message = error4.message;
|
|
17737
|
+
if (error4.debugId) {
|
|
17738
|
+
message = `${message}
|
|
17739
|
+
|
|
17740
|
+
Component DEBUG_ID = "${error4.debugId}"`;
|
|
17741
|
+
}
|
|
17742
|
+
onceLogger(message, onceKey, logger2);
|
|
17743
|
+
};
|
|
17744
|
+
var logDevToolsWarning = (options) => {
|
|
17745
|
+
const { debugId, key } = options;
|
|
17746
|
+
const knownError = ERROR_CODES[key];
|
|
17747
|
+
if (!knownError) {
|
|
17748
|
+
return;
|
|
17749
|
+
}
|
|
17750
|
+
warnKnownErrorOnce({ ...knownError, debugId });
|
|
17751
|
+
if (debugId && key) {
|
|
17752
|
+
const instance = INSTANCES.get(debugId);
|
|
17753
|
+
if (instance && instance.getState().devToolsDetected && knownError) {
|
|
17754
|
+
instance.getState().debugWarnings.set(key, {
|
|
17755
|
+
...knownError,
|
|
17756
|
+
debugId,
|
|
17757
|
+
status: "new"
|
|
17758
|
+
});
|
|
17759
|
+
updateDevToolsForInstance(debugId);
|
|
17760
|
+
}
|
|
17761
|
+
}
|
|
17762
|
+
};
|
|
17763
|
+
globalThis.logDevToolsWarning = logDevToolsWarning;
|
|
17764
|
+
var updateDevToolsForInstance = (debugId) => {
|
|
17765
|
+
const hookFn = window.__INFINITE_TABLE_DEVTOOLS_HOOK__;
|
|
17766
|
+
if (!hookFn) {
|
|
17767
|
+
return;
|
|
17768
|
+
}
|
|
17769
|
+
const instance = INSTANCES.get(debugId);
|
|
17770
|
+
if (!instance) {
|
|
17771
|
+
return;
|
|
17772
|
+
}
|
|
17773
|
+
hookFn(debugId, instance);
|
|
17774
|
+
};
|
|
17775
|
+
|
|
17503
17776
|
// src/components/DataSource/privateHooks/useLoadData.ts
|
|
17504
17777
|
var CACHE_DEFAULT = true;
|
|
17505
17778
|
var getRafPromise = () => new Promise((resolve) => {
|
|
@@ -17657,7 +17930,7 @@ function loadData(data, componentState, actions, overrides, masterContext) {
|
|
|
17657
17930
|
const theKey = [LAZY_ROOT_KEY_FOR_GROUPS, ...keys];
|
|
17658
17931
|
const dataArray2 = remoteData2.data;
|
|
17659
17932
|
const newGroupRowInfo = {
|
|
17660
|
-
cache:
|
|
17933
|
+
cache: remoteData2.cache ?? CACHE_DEFAULT,
|
|
17661
17934
|
childrenLoading: false,
|
|
17662
17935
|
childrenAvailable: true,
|
|
17663
17936
|
totalCount: remoteData2.totalCount ?? dataArray2.length,
|
|
@@ -17890,11 +18163,10 @@ function useLoadData(options) {
|
|
|
17890
18163
|
timestamps.push(now);
|
|
17891
18164
|
const timeDiff = now - timestamps[0];
|
|
17892
18165
|
if (timeDiff < 200 && timestamps.length >= 10) {
|
|
17893
|
-
|
|
17894
|
-
|
|
17895
|
-
|
|
17896
|
-
|
|
17897
|
-
);
|
|
18166
|
+
logDevToolsWarning({
|
|
18167
|
+
debugId: componentState2.debugId,
|
|
18168
|
+
key: "DS001"
|
|
18169
|
+
});
|
|
17898
18170
|
}
|
|
17899
18171
|
if (typeof componentState2.data !== "function") {
|
|
17900
18172
|
loadData(
|
|
@@ -18163,7 +18435,6 @@ var normalizeSortInfo = (initialSortInfo, weakMap3) => {
|
|
|
18163
18435
|
};
|
|
18164
18436
|
|
|
18165
18437
|
// src/components/DataSource/state/getInitialState.ts
|
|
18166
|
-
var DataSourceLogger = dbg("DataSource");
|
|
18167
18438
|
var defaultCursorId = Symbol("cursorId");
|
|
18168
18439
|
var isNodeReadOnly = (rowInfo) => {
|
|
18169
18440
|
return rowInfo.totalLeafNodesCount === 0;
|
|
@@ -18171,12 +18442,17 @@ var isNodeReadOnly = (rowInfo) => {
|
|
|
18171
18442
|
var isNodeSelectable = (rowInfo) => {
|
|
18172
18443
|
return rowInfo.isParentNode ? !isNodeReadOnly(rowInfo) : true;
|
|
18173
18444
|
};
|
|
18174
|
-
function initSetupState() {
|
|
18445
|
+
function initSetupState(props) {
|
|
18175
18446
|
const now = Date.now();
|
|
18176
18447
|
const originalDataArray = [];
|
|
18177
18448
|
const dataArray = [];
|
|
18178
18449
|
const originalLazyGroupData = new DeepMap();
|
|
18450
|
+
const DataSourceLogger = dbg(`${props.debugId}:DataSource`);
|
|
18179
18451
|
return {
|
|
18452
|
+
logger: DataSourceLogger,
|
|
18453
|
+
debugTimings: /* @__PURE__ */ new Map(),
|
|
18454
|
+
debugWarnings: /* @__PURE__ */ new Map(),
|
|
18455
|
+
devToolsDetected: !!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,
|
|
18180
18456
|
// TODO cleanup indexer on unmount
|
|
18181
18457
|
indexer: new Indexer(),
|
|
18182
18458
|
totalLeafNodesCount: 0,
|
|
@@ -18247,7 +18523,8 @@ function initSetupState() {
|
|
|
18247
18523
|
postSortDataArray: void 0,
|
|
18248
18524
|
postGroupDataArray: void 0,
|
|
18249
18525
|
lastSortDataArray: void 0,
|
|
18250
|
-
lastGroupDataArray: void 0
|
|
18526
|
+
lastGroupDataArray: void 0,
|
|
18527
|
+
forceRerenderTimestamp: 0
|
|
18251
18528
|
};
|
|
18252
18529
|
}
|
|
18253
18530
|
function getCompareObjectForDataParams(dataParams) {
|
|
@@ -18283,13 +18560,11 @@ var forwardProps3 = (setupState, props) => {
|
|
|
18283
18560
|
isNodeReadOnly: (isReadOnly) => isReadOnly ?? isNodeReadOnly,
|
|
18284
18561
|
isNodeSelectable: (isSelectable) => isSelectable ?? isNodeSelectable,
|
|
18285
18562
|
data: 1,
|
|
18286
|
-
debugId: 1,
|
|
18287
18563
|
nodesKey: 1,
|
|
18288
18564
|
isNodeExpanded: 1,
|
|
18289
18565
|
isNodeCollapsed: 1,
|
|
18290
18566
|
pivotBy: 1,
|
|
18291
18567
|
primaryKey: 1,
|
|
18292
|
-
debugMode: 1,
|
|
18293
18568
|
livePagination: 1,
|
|
18294
18569
|
treeSelection: 1,
|
|
18295
18570
|
refetchKey: (refetchKey) => refetchKey ?? "",
|
|
@@ -18312,7 +18587,7 @@ var forwardProps3 = (setupState, props) => {
|
|
|
18312
18587
|
state.idToIndexMap.clear();
|
|
18313
18588
|
},
|
|
18314
18589
|
reducer: (_, rowInfo) => {
|
|
18315
|
-
if (props.
|
|
18590
|
+
if (props.debugId && !props.nodesKey && state.idToIndexMap.has(rowInfo.id)) {
|
|
18316
18591
|
console.warn(`Duplicate id found in data source: ${rowInfo.id}`);
|
|
18317
18592
|
}
|
|
18318
18593
|
state.idToIndexMap.set(rowInfo.id, rowInfo.indexInAll);
|
|
@@ -18333,7 +18608,7 @@ var forwardProps3 = (setupState, props) => {
|
|
|
18333
18608
|
reducer: (_, rowInfo) => {
|
|
18334
18609
|
if (rowInfo.isTreeNode) {
|
|
18335
18610
|
state.idToPathMap.set(rowInfo.id, rowInfo.nodePath);
|
|
18336
|
-
if (props.
|
|
18611
|
+
if (props.debugId && state.pathToIndexMap.has(rowInfo.nodePath)) {
|
|
18337
18612
|
console.warn(
|
|
18338
18613
|
`Duplicate node path found in data source (debugId: ${props.debugId || "none"}): ${rowInfo.nodePath}`
|
|
18339
18614
|
);
|
|
@@ -18563,21 +18838,21 @@ function deriveStateFromProps(params) {
|
|
|
18563
18838
|
warnOnce(
|
|
18564
18839
|
`"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead`,
|
|
18565
18840
|
"groupMode deprecated",
|
|
18566
|
-
|
|
18841
|
+
state.logger
|
|
18567
18842
|
);
|
|
18568
18843
|
}
|
|
18569
18844
|
if (props.sortMode) {
|
|
18570
18845
|
warnOnce(
|
|
18571
18846
|
`"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead`,
|
|
18572
18847
|
"sortMode deprecated",
|
|
18573
|
-
|
|
18848
|
+
state.logger
|
|
18574
18849
|
);
|
|
18575
18850
|
}
|
|
18576
18851
|
if (props.filterMode) {
|
|
18577
18852
|
warnOnce(
|
|
18578
18853
|
`"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead`,
|
|
18579
18854
|
"filterMode deprecated",
|
|
18580
|
-
|
|
18855
|
+
state.logger
|
|
18581
18856
|
);
|
|
18582
18857
|
}
|
|
18583
18858
|
const groupMode = typeof props.data === "function" ? propsGroupMode ?? "local" : "local";
|
|
@@ -18597,7 +18872,8 @@ function deriveStateFromProps(params) {
|
|
|
18597
18872
|
weakMap.set(rowDisabledState, isRowDisabled);
|
|
18598
18873
|
}
|
|
18599
18874
|
}
|
|
18600
|
-
|
|
18875
|
+
let result = {
|
|
18876
|
+
debugId: state.debugId ?? props.debugId,
|
|
18601
18877
|
isTree,
|
|
18602
18878
|
selectionMode,
|
|
18603
18879
|
groupRowsState,
|
|
@@ -18637,6 +18913,17 @@ function deriveStateFromProps(params) {
|
|
|
18637
18913
|
const livePaginationCursor = typeof props.livePaginationCursor === "function" ? dataArrayChanged ? getLivePaginationCursorValue(props.livePaginationCursor, state) : state.livePaginationCursor : props.livePaginationCursor;
|
|
18638
18914
|
result.livePaginationCursor = livePaginationCursor;
|
|
18639
18915
|
}
|
|
18916
|
+
if (state.devToolsDetected && state.debugId) {
|
|
18917
|
+
const devToolsDataSourceOverrides = DEV_TOOLS_DATASOURCE_OVERRIDES.get(
|
|
18918
|
+
state.debugId
|
|
18919
|
+
);
|
|
18920
|
+
if (devToolsDataSourceOverrides) {
|
|
18921
|
+
result = {
|
|
18922
|
+
...result,
|
|
18923
|
+
...devToolsDataSourceOverrides
|
|
18924
|
+
};
|
|
18925
|
+
}
|
|
18926
|
+
}
|
|
18640
18927
|
return result;
|
|
18641
18928
|
}
|
|
18642
18929
|
var debugFullLazyLoad = dbg("DataSource:fullLazyLoad");
|
|
@@ -18654,7 +18941,6 @@ function onPropChange(params, props, actions) {
|
|
|
18654
18941
|
}
|
|
18655
18942
|
}
|
|
18656
18943
|
}
|
|
18657
|
-
var debugDataParams = dbg("DataSource:dataParams");
|
|
18658
18944
|
function getMappedCallbacks() {
|
|
18659
18945
|
return {
|
|
18660
18946
|
rowSelection: (rowSelection, state) => {
|
|
@@ -18830,6 +19116,9 @@ function getInterceptActions() {
|
|
|
18830
19116
|
)) {
|
|
18831
19117
|
return false;
|
|
18832
19118
|
}
|
|
19119
|
+
const debugDataParams = dbg(
|
|
19120
|
+
getDebugChannel(state.debugId, "DataSource:dataParams")
|
|
19121
|
+
);
|
|
18833
19122
|
debugDataParams(
|
|
18834
19123
|
"onDataParamsChange triggered because the following values have changed",
|
|
18835
19124
|
dataParams?.changes
|
|
@@ -19311,6 +19600,7 @@ var InfiniteTableCellSelectionApiImpl = class {
|
|
|
19311
19600
|
return;
|
|
19312
19601
|
}
|
|
19313
19602
|
const newCellSelection = new CellSelectionState(cellSelection);
|
|
19603
|
+
newCellSelection.debugId = dataSourceState.debugId ?? "";
|
|
19314
19604
|
const [startRowId, startColId] = this.getCellSelectionPosition(startOptions);
|
|
19315
19605
|
const [endRowId, endColId] = this.getCellSelectionPosition(endOptions);
|
|
19316
19606
|
const startCol = this.getComputed().computedVisibleColumnsMap.get(startColId);
|
|
@@ -19402,6 +19692,7 @@ var InfiniteTableCellSelectionApiImpl = class {
|
|
|
19402
19692
|
return;
|
|
19403
19693
|
}
|
|
19404
19694
|
const newCellSelection = new CellSelectionState(cellSelection);
|
|
19695
|
+
newCellSelection.debugId = dataSourceState.debugId ?? "";
|
|
19405
19696
|
newCellSelection.deselectAll();
|
|
19406
19697
|
this.dataSourceActions.cellSelection = newCellSelection;
|
|
19407
19698
|
};
|
|
@@ -19415,6 +19706,7 @@ var InfiniteTableCellSelectionApiImpl = class {
|
|
|
19415
19706
|
return;
|
|
19416
19707
|
}
|
|
19417
19708
|
const newCellSelection = new CellSelectionState(cellSelection);
|
|
19709
|
+
newCellSelection.debugId = dataSourceState.debugId ?? "";
|
|
19418
19710
|
newCellSelection.selectAll();
|
|
19419
19711
|
this.dataSourceActions.cellSelection = newCellSelection;
|
|
19420
19712
|
};
|
|
@@ -19429,22 +19721,26 @@ var InfiniteTableCellSelectionApiImpl = class {
|
|
|
19429
19721
|
return this.getDataSourceState().cellSelection?.isCellSelected(pk, colId) ?? false;
|
|
19430
19722
|
};
|
|
19431
19723
|
this.selectCell = (options) => {
|
|
19432
|
-
const
|
|
19724
|
+
const dataSourceState = this.getDataSourceState();
|
|
19725
|
+
const cellSelection = dataSourceState.cellSelection;
|
|
19433
19726
|
if (!cellSelection) {
|
|
19434
19727
|
return;
|
|
19435
19728
|
}
|
|
19436
19729
|
const [pk, colId] = this.getCellSelectionPosition(options);
|
|
19437
19730
|
const newCellSelection = options.clear ? new CellSelectionState() : new CellSelectionState(cellSelection);
|
|
19731
|
+
newCellSelection.debugId = dataSourceState.debugId ?? "";
|
|
19438
19732
|
newCellSelection.selectCell(pk, colId);
|
|
19439
19733
|
this.dataSourceActions.cellSelection = newCellSelection;
|
|
19440
19734
|
};
|
|
19441
19735
|
this.deselectCell = (options) => {
|
|
19442
|
-
const
|
|
19736
|
+
const dataSourceState = this.getDataSourceState();
|
|
19737
|
+
const cellSelection = dataSourceState.cellSelection;
|
|
19443
19738
|
if (!cellSelection) {
|
|
19444
19739
|
return;
|
|
19445
19740
|
}
|
|
19446
19741
|
const [pk, colId] = this.getCellSelectionPosition(options);
|
|
19447
19742
|
const newCellSelection = new CellSelectionState(cellSelection);
|
|
19743
|
+
newCellSelection.debugId = dataSourceState.debugId ?? "";
|
|
19448
19744
|
newCellSelection.deselectCell(pk, colId);
|
|
19449
19745
|
this.dataSourceActions.cellSelection = newCellSelection;
|
|
19450
19746
|
};
|
|
@@ -19452,20 +19748,24 @@ var InfiniteTableCellSelectionApiImpl = class {
|
|
|
19452
19748
|
if (options?.clear) {
|
|
19453
19749
|
this.deselectAll();
|
|
19454
19750
|
}
|
|
19455
|
-
const
|
|
19751
|
+
const dataSourceState = this.getDataSourceState();
|
|
19752
|
+
const cellSelection = dataSourceState.cellSelection;
|
|
19456
19753
|
if (!cellSelection) {
|
|
19457
19754
|
return;
|
|
19458
19755
|
}
|
|
19459
19756
|
const newCellSelection = new CellSelectionState(cellSelection);
|
|
19757
|
+
newCellSelection.debugId = dataSourceState.debugId ?? "";
|
|
19460
19758
|
newCellSelection.selectColumn(colId);
|
|
19461
19759
|
this.dataSourceActions.cellSelection = newCellSelection;
|
|
19462
19760
|
};
|
|
19463
19761
|
this.deselectColumn = (colId) => {
|
|
19464
|
-
const
|
|
19762
|
+
const dataSourceState = this.getDataSourceState();
|
|
19763
|
+
const cellSelection = dataSourceState.cellSelection;
|
|
19465
19764
|
if (!cellSelection) {
|
|
19466
19765
|
return;
|
|
19467
19766
|
}
|
|
19468
19767
|
const newCellSelection = new CellSelectionState(cellSelection);
|
|
19768
|
+
newCellSelection.debugId = dataSourceState.debugId ?? "";
|
|
19469
19769
|
newCellSelection.deselectColumn(colId);
|
|
19470
19770
|
this.dataSourceActions.cellSelection = newCellSelection;
|
|
19471
19771
|
};
|
|
@@ -19963,6 +20263,9 @@ var InfiniteTableApiImpl = class {
|
|
|
19963
20263
|
this.hideFilterOperatorMenu = () => {
|
|
19964
20264
|
this.actions.filterOperatorMenuVisibleForColumnId = null;
|
|
19965
20265
|
};
|
|
20266
|
+
this.setGroupRenderStrategy = (groupRenderStrategy) => {
|
|
20267
|
+
this.actions.groupRenderStrategy = groupRenderStrategy;
|
|
20268
|
+
};
|
|
19966
20269
|
this.getColumnOrder = () => {
|
|
19967
20270
|
return this.getComputed().computedColumnOrder;
|
|
19968
20271
|
};
|
|
@@ -21234,6 +21537,8 @@ function useCellRendering(param) {
|
|
|
21234
21537
|
const {
|
|
21235
21538
|
rowHeight,
|
|
21236
21539
|
rowDetailHeight,
|
|
21540
|
+
onRowMouseEnter,
|
|
21541
|
+
onRowMouseLeave,
|
|
21237
21542
|
groupRenderStrategy,
|
|
21238
21543
|
brain,
|
|
21239
21544
|
showZebraRows,
|
|
@@ -21375,6 +21680,8 @@ function useCellRendering(param) {
|
|
|
21375
21680
|
rowDetailState,
|
|
21376
21681
|
onMouseEnter,
|
|
21377
21682
|
onMouseLeave,
|
|
21683
|
+
onRowMouseEnter,
|
|
21684
|
+
onRowMouseLeave,
|
|
21378
21685
|
domRef,
|
|
21379
21686
|
width,
|
|
21380
21687
|
column,
|
|
@@ -21390,6 +21697,8 @@ function useCellRendering(param) {
|
|
|
21390
21697
|
[
|
|
21391
21698
|
rowHeight,
|
|
21392
21699
|
rowDetailHeight,
|
|
21700
|
+
onRowMouseEnter,
|
|
21701
|
+
onRowMouseLeave,
|
|
21393
21702
|
computedRowSizeCacheForDetails,
|
|
21394
21703
|
computedRowHeight,
|
|
21395
21704
|
isRowDetailsExpanded,
|
|
@@ -21708,13 +22017,13 @@ function useColumnRowspan(computedVisibleColumns) {
|
|
|
21708
22017
|
|
|
21709
22018
|
// src/components/InfiniteTable/hooks/useColumnSizeFn.ts
|
|
21710
22019
|
var import_react41 = require("react");
|
|
21711
|
-
var
|
|
22020
|
+
var debug3 = dbg("useColumnSizeFn");
|
|
21712
22021
|
function useColumnSizeFn(columns) {
|
|
21713
22022
|
const columnSize = (0, import_react41.useCallback)(
|
|
21714
22023
|
(index) => {
|
|
21715
22024
|
const column = columns[index];
|
|
21716
22025
|
if (false) {
|
|
21717
|
-
|
|
22026
|
+
debug3("cannot find column at index", index, columns);
|
|
21718
22027
|
}
|
|
21719
22028
|
return column ? column.computedWidth : 0;
|
|
21720
22029
|
},
|
|
@@ -21806,7 +22115,7 @@ function getRowDetailRendererFromComponent(RowDetail) {
|
|
|
21806
22115
|
// src/components/VirtualBrain/HorizontalLayoutMatrixBrain.ts
|
|
21807
22116
|
var HorizontalLayoutMatrixBrain = class extends MatrixBrain {
|
|
21808
22117
|
constructor(name, opts) {
|
|
21809
|
-
super(
|
|
22118
|
+
super(`${name}:HorizontalLayout`);
|
|
21810
22119
|
this.visiblePageCount = 0;
|
|
21811
22120
|
this.isHorizontalLayoutBrain = true;
|
|
21812
22121
|
this._totalPageCount = 0;
|
|
@@ -22085,10 +22394,11 @@ function getCellSelector(cellPosition) {
|
|
|
22085
22394
|
return selector2;
|
|
22086
22395
|
}
|
|
22087
22396
|
function createBrains(debugId, wrapRowsHorizontally) {
|
|
22088
|
-
const
|
|
22397
|
+
const debugChannel = getDebugChannel(debugId);
|
|
22398
|
+
const brain = !wrapRowsHorizontally ? new MatrixBrain(debugChannel) : new HorizontalLayoutMatrixBrain(debugChannel, {
|
|
22089
22399
|
isHeader: false
|
|
22090
22400
|
});
|
|
22091
|
-
const headerBrain = !wrapRowsHorizontally ? new MatrixBrain(
|
|
22401
|
+
const headerBrain = !wrapRowsHorizontally ? new MatrixBrain(debugChannel) : new HorizontalLayoutMatrixBrain(debugChannel, {
|
|
22092
22402
|
isHeader: true,
|
|
22093
22403
|
masterBrain: brain
|
|
22094
22404
|
});
|
|
@@ -22119,8 +22429,10 @@ function initSetupState2({
|
|
|
22119
22429
|
);
|
|
22120
22430
|
const domRef = (0, import_react42.createRef)();
|
|
22121
22431
|
return {
|
|
22432
|
+
debugWarnings: /* @__PURE__ */ new Map(),
|
|
22122
22433
|
renderer,
|
|
22123
22434
|
onRenderUpdater,
|
|
22435
|
+
devToolsDetected: !!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,
|
|
22124
22436
|
propsCache: /* @__PURE__ */ new Map([]),
|
|
22125
22437
|
lastRowToCollapseRef: { current: null },
|
|
22126
22438
|
lastRowToExpandRef: { current: null },
|
|
@@ -22190,7 +22502,6 @@ var forwardProps4 = (_setupState) => {
|
|
|
22190
22502
|
groupColumn: 1,
|
|
22191
22503
|
onReady: 1,
|
|
22192
22504
|
domProps: 1,
|
|
22193
|
-
debugMode: 1,
|
|
22194
22505
|
onKeyDown: 1,
|
|
22195
22506
|
onCellClick: 1,
|
|
22196
22507
|
onCellDoubleClick: 1,
|
|
@@ -22205,6 +22516,8 @@ var forwardProps4 = (_setupState) => {
|
|
|
22205
22516
|
onContextMenu: 1,
|
|
22206
22517
|
onCellContextMenu: 1,
|
|
22207
22518
|
onRenderRangeChange: 1,
|
|
22519
|
+
onRowMouseEnter: 1,
|
|
22520
|
+
onRowMouseLeave: 1,
|
|
22208
22521
|
onScrollToTop: 1,
|
|
22209
22522
|
onScrollToBottom: 1,
|
|
22210
22523
|
onScrollStop: 1,
|
|
@@ -22400,7 +22713,7 @@ var mapPropsToState = (params) => {
|
|
|
22400
22713
|
}
|
|
22401
22714
|
}
|
|
22402
22715
|
const isRowDetailEnabled = !rowDetailRenderer ? false : props.isRowDetailEnabled || true;
|
|
22403
|
-
|
|
22716
|
+
let result = {
|
|
22404
22717
|
isTree: parentState.isTree,
|
|
22405
22718
|
rowDetailRenderer,
|
|
22406
22719
|
rowDetailState,
|
|
@@ -22425,6 +22738,16 @@ var mapPropsToState = (params) => {
|
|
|
22425
22738
|
rowDetailHeightCSSVar: typeof props.rowDetailHeight === "string" ? props.rowDetailHeight : "",
|
|
22426
22739
|
columnHeaderHeightCSSVar: typeof props.columnHeaderHeight === "string" ? props.columnHeaderHeight || ThemeVars.components.Header.columnHeaderHeight : ""
|
|
22427
22740
|
};
|
|
22741
|
+
if (state.devToolsDetected && state.debugId) {
|
|
22742
|
+
const devToolsOverrides = DEV_TOOLS_INFINITE_OVERRIDES.get(state.debugId);
|
|
22743
|
+
if (devToolsOverrides) {
|
|
22744
|
+
result = {
|
|
22745
|
+
...result,
|
|
22746
|
+
...devToolsOverrides
|
|
22747
|
+
};
|
|
22748
|
+
}
|
|
22749
|
+
}
|
|
22750
|
+
return result;
|
|
22428
22751
|
};
|
|
22429
22752
|
|
|
22430
22753
|
// src/components/InfiniteTable/state/getColumnVisibilityForHideEmptyGroupColumns.ts
|
|
@@ -23602,7 +23925,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
23602
23925
|
}
|
|
23603
23926
|
let valid2 = isValidLicense(licenseKey, {
|
|
23604
23927
|
publishedAt: 1624970570587,
|
|
23605
|
-
version: "
|
|
23928
|
+
version: "7.0.0"
|
|
23606
23929
|
});
|
|
23607
23930
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
23608
23931
|
return true;
|
|
@@ -23742,10 +24065,11 @@ function updateCellSelectionOnCellClick(context, event) {
|
|
|
23742
24065
|
return;
|
|
23743
24066
|
}
|
|
23744
24067
|
const { multiCellSelector, computedVisibleColumns } = getComputed();
|
|
23745
|
-
const { brain } = getState();
|
|
24068
|
+
const { brain, debugId } = getState();
|
|
23746
24069
|
const { rowsPerPage } = brain;
|
|
23747
24070
|
const columnsPerSet = computedVisibleColumns.length;
|
|
23748
24071
|
const cellSelection = new CellSelectionState(existingCellSelection);
|
|
24072
|
+
cellSelection.debugId = debugId ?? "";
|
|
23749
24073
|
multiCellSelector.cellSelectionState = cellSelection;
|
|
23750
24074
|
const position2 = {
|
|
23751
24075
|
rowIndex,
|
|
@@ -27164,37 +27488,414 @@ function useHorizontalLayout() {
|
|
|
27164
27488
|
}
|
|
27165
27489
|
|
|
27166
27490
|
// src/components/InfiniteTable/hooks/useDebugMode.ts
|
|
27167
|
-
var
|
|
27168
|
-
var logWarning = once(() => {
|
|
27169
|
-
console.warn(
|
|
27170
|
-
`It appears you have not loaded the CSS file for InfiniteTable.
|
|
27171
|
-
In most environments, you should be able to fix this by adding the following line:
|
|
27491
|
+
var import_react66 = require("react");
|
|
27172
27492
|
|
|
27173
|
-
|
|
27493
|
+
// src/components/InfiniteTable/hooks/debugModeDevToolsOverlay.css.ts
|
|
27494
|
+
var DevToolsOverlay = createRuntimeFn({ defaultClassName: "_143ofgf0", variantClassNames: { active: { true: "_143ofgf1", false: "_143ofgf2" } }, defaultVariants: {}, compoundVariants: [] });
|
|
27495
|
+
var DevToolsOverlayBg = "_143ofgf5";
|
|
27496
|
+
var DevToolsOverlayText = "_143ofgf3";
|
|
27174
27497
|
|
|
27175
|
-
|
|
27176
|
-
);
|
|
27177
|
-
});
|
|
27498
|
+
// src/components/InfiniteTable/hooks/useDebugMode.ts
|
|
27178
27499
|
var cssFileLoadedVarName = stripVar(ThemeVars.loaded);
|
|
27179
|
-
|
|
27180
|
-
|
|
27181
|
-
|
|
27182
|
-
|
|
27183
|
-
|
|
27500
|
+
var messageBase = {
|
|
27501
|
+
source: "infinite-table-page",
|
|
27502
|
+
target: "infinite-table-devtools-background"
|
|
27503
|
+
};
|
|
27504
|
+
function buildMessageForExtension(params, options) {
|
|
27505
|
+
const { type, debugId } = params;
|
|
27506
|
+
if (type === "unmount") {
|
|
27507
|
+
return {
|
|
27508
|
+
...messageBase,
|
|
27509
|
+
url: getPageUrlOfWindow(),
|
|
27510
|
+
type,
|
|
27511
|
+
payload: {
|
|
27512
|
+
debugId
|
|
27513
|
+
}
|
|
27514
|
+
};
|
|
27515
|
+
}
|
|
27516
|
+
const opts = options;
|
|
27517
|
+
const computedValues = opts.getComputed();
|
|
27518
|
+
const dataSourceState = opts.getDataSourceState();
|
|
27519
|
+
const state = opts.getState();
|
|
27520
|
+
const message = {
|
|
27521
|
+
...messageBase,
|
|
27522
|
+
url: getPageUrlOfWindow(),
|
|
27523
|
+
type,
|
|
27524
|
+
payload: {
|
|
27525
|
+
debugId,
|
|
27526
|
+
columnVisibility: state.columnVisibility,
|
|
27527
|
+
columnOrder: computedValues.computedColumnOrder,
|
|
27528
|
+
visibleColumnIds: computedValues.computedVisibleColumns.map((c) => c.id),
|
|
27529
|
+
selectionMode: dataSourceState.selectionMode,
|
|
27530
|
+
columns: Object.fromEntries(
|
|
27531
|
+
computedValues.computedVisibleColumns.map((c) => [
|
|
27532
|
+
c.id,
|
|
27533
|
+
{
|
|
27534
|
+
field: c.field,
|
|
27535
|
+
dataType: c.computedDataType,
|
|
27536
|
+
sortType: c.computedSortType,
|
|
27537
|
+
filtered: c.computedFiltered,
|
|
27538
|
+
sorted: c.computedSorted,
|
|
27539
|
+
width: c.computedWidth
|
|
27540
|
+
}
|
|
27541
|
+
])
|
|
27542
|
+
),
|
|
27543
|
+
groupRenderStrategy: state.groupRenderStrategy,
|
|
27544
|
+
groupBy: dataSourceState.groupBy.map(
|
|
27545
|
+
(g) => g.field ? `${g.field}` : "<fn>"
|
|
27546
|
+
),
|
|
27547
|
+
sortInfo: (dataSourceState.sortInfo || []).filter((sortInfo) => typeof sortInfo.field === "string").map((s) => {
|
|
27548
|
+
return {
|
|
27549
|
+
field: `${s.field}`,
|
|
27550
|
+
dir: s.dir,
|
|
27551
|
+
type: Array.isArray(s.type) ? s.type[0] : s.type ?? "string"
|
|
27552
|
+
};
|
|
27553
|
+
}),
|
|
27554
|
+
multiSort: dataSourceState.multiSort,
|
|
27555
|
+
devToolsDetected: state.devToolsDetected,
|
|
27556
|
+
debugTimings: Object.fromEntries(dataSourceState.debugTimings),
|
|
27557
|
+
debugWarnings: {
|
|
27558
|
+
...Object.fromEntries(dataSourceState.debugWarnings),
|
|
27559
|
+
...Object.fromEntries(state.debugWarnings)
|
|
27560
|
+
}
|
|
27561
|
+
}
|
|
27562
|
+
};
|
|
27563
|
+
return message;
|
|
27184
27564
|
}
|
|
27185
|
-
|
|
27565
|
+
var getPageUrlOfWindow = once(function() {
|
|
27566
|
+
const url = new URL(window.location.href);
|
|
27567
|
+
return url.origin + url.pathname;
|
|
27568
|
+
});
|
|
27569
|
+
function postMessage(message) {
|
|
27570
|
+
window.postMessage(message);
|
|
27571
|
+
}
|
|
27572
|
+
var setupHook = once(() => {
|
|
27573
|
+
console.log("Infinite Table DevTools detected!");
|
|
27574
|
+
const hookFn = (debugId, options) => {
|
|
27575
|
+
if (options) {
|
|
27576
|
+
INSTANCES.set(debugId, options);
|
|
27577
|
+
const { devToolsDetected } = options.getState();
|
|
27578
|
+
if (!devToolsDetected) {
|
|
27579
|
+
options.actions.devToolsDetected = true;
|
|
27580
|
+
}
|
|
27581
|
+
const dataSourceState = options.getDataSourceState();
|
|
27582
|
+
if (dataSourceState.debugId !== debugId) {
|
|
27583
|
+
options.dataSourceActions.debugId = debugId;
|
|
27584
|
+
}
|
|
27585
|
+
if (!dataSourceState.devToolsDetected) {
|
|
27586
|
+
options.dataSourceActions.devToolsDetected = true;
|
|
27587
|
+
}
|
|
27588
|
+
window.postMessage(
|
|
27589
|
+
buildMessageForExtension({ type: "update", debugId }, options)
|
|
27590
|
+
);
|
|
27591
|
+
} else {
|
|
27592
|
+
deleteInstanceFromDevTools(debugId);
|
|
27593
|
+
window.postMessage(
|
|
27594
|
+
buildMessageForExtension({ type: "unmount", debugId }, null)
|
|
27595
|
+
);
|
|
27596
|
+
}
|
|
27597
|
+
};
|
|
27598
|
+
window.__INFINITE_TABLE_DEVTOOLS_HOOK__ = hookFn;
|
|
27599
|
+
debug.onLogIntent("*", (options) => {
|
|
27600
|
+
postMessage({
|
|
27601
|
+
...messageBase,
|
|
27602
|
+
url: getPageUrlOfWindow(),
|
|
27603
|
+
type: "log",
|
|
27604
|
+
payload: {
|
|
27605
|
+
debugId: void 0,
|
|
27606
|
+
channel: options.channel,
|
|
27607
|
+
color: options.color,
|
|
27608
|
+
args: options.args.map((arg) => {
|
|
27609
|
+
if (typeof arg === "object" && arg !== null) {
|
|
27610
|
+
return JSON.stringify(arg);
|
|
27611
|
+
}
|
|
27612
|
+
return String(arg);
|
|
27613
|
+
}),
|
|
27614
|
+
timestamp: options.timestamp
|
|
27615
|
+
}
|
|
27616
|
+
});
|
|
27617
|
+
});
|
|
27618
|
+
return hookFn;
|
|
27619
|
+
});
|
|
27620
|
+
function useDebugMode() {
|
|
27621
|
+
const { getState, getDataSourceState, dataSourceActions } = useInfiniteTable();
|
|
27186
27622
|
const state = getState();
|
|
27187
|
-
const {
|
|
27188
|
-
if (
|
|
27623
|
+
const { domRef, debugId } = state;
|
|
27624
|
+
if (debugId) {
|
|
27189
27625
|
if (domRef.current) {
|
|
27190
27626
|
const value = getComputedStyle(domRef.current).getPropertyValue(
|
|
27191
27627
|
cssFileLoadedVarName
|
|
27192
27628
|
);
|
|
27193
27629
|
if (value !== `${CSS_LOADED_VALUE}`) {
|
|
27194
|
-
|
|
27630
|
+
logDevToolsWarning({
|
|
27631
|
+
debugId,
|
|
27632
|
+
key: "CSS001_CSS"
|
|
27633
|
+
});
|
|
27195
27634
|
}
|
|
27196
27635
|
}
|
|
27197
27636
|
}
|
|
27637
|
+
(0, import_react66.useEffect)(() => {
|
|
27638
|
+
const dataSourceState = getDataSourceState();
|
|
27639
|
+
if (dataSourceState.debugId !== debugId) {
|
|
27640
|
+
dataSourceActions.debugId = debugId;
|
|
27641
|
+
}
|
|
27642
|
+
}, [debugId]);
|
|
27643
|
+
return useDevTools();
|
|
27644
|
+
}
|
|
27645
|
+
var HOOK_FN_SETUP_CALLBACK = buildSubscriptionCallback();
|
|
27646
|
+
var DEVTOOLS_MESSAGES = {
|
|
27647
|
+
revertAll: (payload) => {
|
|
27648
|
+
const instance = INSTANCES.get(payload.debugId);
|
|
27649
|
+
if (instance) {
|
|
27650
|
+
const infiniteInitials = DEV_TOOLS_INFINITE_INITIALS.get(payload.debugId);
|
|
27651
|
+
DEV_TOOLS_INFINITE_INITIALS.delete(payload.debugId);
|
|
27652
|
+
DEV_TOOLS_INFINITE_OVERRIDES.delete(payload.debugId);
|
|
27653
|
+
if (infiniteInitials) {
|
|
27654
|
+
Object.keys(infiniteInitials).forEach((key) => {
|
|
27655
|
+
instance.actions[key] = infiniteInitials[key];
|
|
27656
|
+
delete infiniteInitials[key];
|
|
27657
|
+
});
|
|
27658
|
+
}
|
|
27659
|
+
const dataSourceInitials = DEV_TOOLS_DATASOURCE_INITIALS.get(
|
|
27660
|
+
payload.debugId
|
|
27661
|
+
);
|
|
27662
|
+
DEV_TOOLS_DATASOURCE_INITIALS.delete(payload.debugId);
|
|
27663
|
+
DEV_TOOLS_DATASOURCE_OVERRIDES.delete(payload.debugId);
|
|
27664
|
+
if (dataSourceInitials) {
|
|
27665
|
+
Object.keys(dataSourceInitials).forEach((key) => {
|
|
27666
|
+
instance.dataSourceActions[key] = dataSourceInitials[key];
|
|
27667
|
+
delete dataSourceInitials[key];
|
|
27668
|
+
});
|
|
27669
|
+
}
|
|
27670
|
+
}
|
|
27671
|
+
},
|
|
27672
|
+
revertProperty: (payload) => {
|
|
27673
|
+
const instance = INSTANCES.get(payload.debugId);
|
|
27674
|
+
if (instance) {
|
|
27675
|
+
const property = payload.property;
|
|
27676
|
+
const infiniteOverrides = DEV_TOOLS_INFINITE_OVERRIDES.get(
|
|
27677
|
+
payload.debugId
|
|
27678
|
+
);
|
|
27679
|
+
const infiniteInitials = DEV_TOOLS_INFINITE_INITIALS.get(payload.debugId);
|
|
27680
|
+
const dataSourceOverrides = DEV_TOOLS_DATASOURCE_OVERRIDES.get(
|
|
27681
|
+
payload.debugId
|
|
27682
|
+
);
|
|
27683
|
+
const dataSourceInitials = DEV_TOOLS_DATASOURCE_INITIALS.get(
|
|
27684
|
+
payload.debugId
|
|
27685
|
+
);
|
|
27686
|
+
const infiniteStateProp = property;
|
|
27687
|
+
if (infiniteInitials && infiniteOverrides && infiniteOverrides[infiniteStateProp] !== void 0) {
|
|
27688
|
+
delete infiniteOverrides[infiniteStateProp];
|
|
27689
|
+
instance.actions[infiniteStateProp] = infiniteInitials[infiniteStateProp];
|
|
27690
|
+
delete infiniteInitials[infiniteStateProp];
|
|
27691
|
+
}
|
|
27692
|
+
const dataSourceStateProp = property;
|
|
27693
|
+
if (dataSourceInitials && dataSourceOverrides && dataSourceOverrides[dataSourceStateProp] !== void 0) {
|
|
27694
|
+
const dataSourceInitials2 = DEV_TOOLS_DATASOURCE_INITIALS.get(payload.debugId) || {};
|
|
27695
|
+
delete dataSourceOverrides[dataSourceStateProp];
|
|
27696
|
+
instance.dataSourceActions[dataSourceStateProp] = dataSourceInitials2[dataSourceStateProp];
|
|
27697
|
+
delete dataSourceInitials2[dataSourceStateProp];
|
|
27698
|
+
}
|
|
27699
|
+
}
|
|
27700
|
+
},
|
|
27701
|
+
discardWarning: (payload) => {
|
|
27702
|
+
const instance = INSTANCES.get(payload.debugId);
|
|
27703
|
+
if (instance) {
|
|
27704
|
+
const dsWarningKey = payload.warning;
|
|
27705
|
+
const dsWarnings = instance.getDataSourceState().debugWarnings;
|
|
27706
|
+
const obj = dsWarnings.get(dsWarningKey);
|
|
27707
|
+
if (obj) {
|
|
27708
|
+
dsWarnings.delete(dsWarningKey);
|
|
27709
|
+
updateDevToolsForInstance(payload.debugId);
|
|
27710
|
+
} else {
|
|
27711
|
+
const itWarningKey = payload.warning;
|
|
27712
|
+
const infiniteWarnings = instance.getState().debugWarnings;
|
|
27713
|
+
const obj2 = infiniteWarnings.get(itWarningKey);
|
|
27714
|
+
if (obj2) {
|
|
27715
|
+
infiniteWarnings.delete(itWarningKey);
|
|
27716
|
+
updateDevToolsForInstance(payload.debugId);
|
|
27717
|
+
}
|
|
27718
|
+
}
|
|
27719
|
+
}
|
|
27720
|
+
},
|
|
27721
|
+
discardAllWarnings: (payload) => {
|
|
27722
|
+
const instance = INSTANCES.get(payload.debugId);
|
|
27723
|
+
if (instance) {
|
|
27724
|
+
instance.getDataSourceState().debugWarnings.clear();
|
|
27725
|
+
instance.getState().debugWarnings.clear();
|
|
27726
|
+
updateDevToolsForInstance(payload.debugId);
|
|
27727
|
+
}
|
|
27728
|
+
},
|
|
27729
|
+
setColumnVisibility: (payload) => {
|
|
27730
|
+
setDevToolInfinitePropertyOverride(
|
|
27731
|
+
payload.debugId,
|
|
27732
|
+
"columnVisibility",
|
|
27733
|
+
payload.columnVisibility
|
|
27734
|
+
);
|
|
27735
|
+
},
|
|
27736
|
+
setGroupBy: (payload) => {
|
|
27737
|
+
setDevToolDataSourcePropertyOverride(
|
|
27738
|
+
payload.debugId,
|
|
27739
|
+
"groupBy",
|
|
27740
|
+
payload.groupBy
|
|
27741
|
+
);
|
|
27742
|
+
},
|
|
27743
|
+
setGroupRenderStrategy: (payload) => {
|
|
27744
|
+
setDevToolInfinitePropertyOverride(
|
|
27745
|
+
payload.debugId,
|
|
27746
|
+
"groupRenderStrategy",
|
|
27747
|
+
payload.groupRenderStrategy
|
|
27748
|
+
);
|
|
27749
|
+
},
|
|
27750
|
+
setSortInfo: (payload) => {
|
|
27751
|
+
setDevToolDataSourcePropertyOverride(
|
|
27752
|
+
payload.debugId,
|
|
27753
|
+
"sortInfo",
|
|
27754
|
+
payload.sortInfo
|
|
27755
|
+
);
|
|
27756
|
+
},
|
|
27757
|
+
setMultiSort: (payload) => {
|
|
27758
|
+
setDevToolDataSourcePropertyOverride(
|
|
27759
|
+
payload.debugId,
|
|
27760
|
+
"multiSort",
|
|
27761
|
+
payload.multiSort
|
|
27762
|
+
);
|
|
27763
|
+
},
|
|
27764
|
+
highlight: (payload) => {
|
|
27765
|
+
const instance = INSTANCES.get(payload.debugId);
|
|
27766
|
+
if (instance) {
|
|
27767
|
+
const domNode = instance.getState().domRef.current;
|
|
27768
|
+
if (domNode) {
|
|
27769
|
+
const rect = domNode.getBoundingClientRect();
|
|
27770
|
+
let overlay = document.querySelector(
|
|
27771
|
+
`.${DevToolsOverlay.classNames.base}`
|
|
27772
|
+
);
|
|
27773
|
+
if (!overlay) {
|
|
27774
|
+
overlay = document.createElement("div");
|
|
27775
|
+
overlay.classList.add(DevToolsOverlay.classNames.base);
|
|
27776
|
+
overlay.innerHTML = [
|
|
27777
|
+
`<div class="${DevToolsOverlayText}"></div>`,
|
|
27778
|
+
`<div class="${DevToolsOverlayBg}"></div>`
|
|
27779
|
+
].join("");
|
|
27780
|
+
document.body.appendChild(overlay);
|
|
27781
|
+
}
|
|
27782
|
+
let textDiv = overlay.firstElementChild;
|
|
27783
|
+
if (overlay) {
|
|
27784
|
+
overlay.style.left = `${rect.left}px`;
|
|
27785
|
+
overlay.style.top = `${rect.top}px`;
|
|
27786
|
+
overlay.style.width = `${rect.width}px`;
|
|
27787
|
+
overlay.style.height = `${rect.height}px`;
|
|
27788
|
+
textDiv.innerHTML = payload.debugId;
|
|
27789
|
+
const overlayBg = overlay.lastElementChild;
|
|
27790
|
+
const handleAnimationEnd = () => {
|
|
27791
|
+
overlay.classList.remove(
|
|
27792
|
+
DevToolsOverlay.classNames.variants.active.true
|
|
27793
|
+
);
|
|
27794
|
+
overlayBg.removeEventListener("animationend", handleAnimationEnd);
|
|
27795
|
+
};
|
|
27796
|
+
overlayBg.addEventListener("animationend", handleAnimationEnd);
|
|
27797
|
+
overlay.classList.add(
|
|
27798
|
+
DevToolsOverlay.classNames.variants.active.true
|
|
27799
|
+
);
|
|
27800
|
+
}
|
|
27801
|
+
}
|
|
27802
|
+
}
|
|
27803
|
+
}
|
|
27804
|
+
};
|
|
27805
|
+
function listenForDevTools() {
|
|
27806
|
+
if (typeof window !== "undefined") {
|
|
27807
|
+
window.addEventListener("message", (event) => {
|
|
27808
|
+
if (event.data.source.startsWith("infinite-table-devtools-contentscript") && event.data.target === "infinite-table-page") {
|
|
27809
|
+
if (!window.__INFINITE_TABLE_DEVTOOLS_HOOK__) {
|
|
27810
|
+
setupHook();
|
|
27811
|
+
HOOK_FN_SETUP_CALLBACK(
|
|
27812
|
+
window.__INFINITE_TABLE_DEVTOOLS_HOOK__
|
|
27813
|
+
);
|
|
27814
|
+
}
|
|
27815
|
+
if (typeof event.data.type === "string") {
|
|
27816
|
+
const eventType = event.data.type;
|
|
27817
|
+
const fn = DEVTOOLS_MESSAGES[eventType];
|
|
27818
|
+
if (fn) {
|
|
27819
|
+
fn(event.data.payload);
|
|
27820
|
+
}
|
|
27821
|
+
}
|
|
27822
|
+
}
|
|
27823
|
+
});
|
|
27824
|
+
}
|
|
27825
|
+
}
|
|
27826
|
+
listenForDevTools();
|
|
27827
|
+
function useDevTools() {
|
|
27828
|
+
const {
|
|
27829
|
+
getState,
|
|
27830
|
+
getComputed,
|
|
27831
|
+
getDataSourceState,
|
|
27832
|
+
dataSourceActions,
|
|
27833
|
+
actions,
|
|
27834
|
+
dataSourceApi,
|
|
27835
|
+
api
|
|
27836
|
+
} = useInfiniteTable();
|
|
27837
|
+
const state = getState();
|
|
27838
|
+
const debugId = state.debugId;
|
|
27839
|
+
const debugIdRef = (0, import_react66.useRef)(debugId);
|
|
27840
|
+
debugIdRef.current = debugId;
|
|
27841
|
+
(0, import_react66.useEffect)(() => {
|
|
27842
|
+
const debugId2 = debugIdRef.current;
|
|
27843
|
+
if (!debugId2) {
|
|
27844
|
+
return;
|
|
27845
|
+
}
|
|
27846
|
+
const withHookFn = (hookFn2) => {
|
|
27847
|
+
hookFn2(debugId2, {
|
|
27848
|
+
getState,
|
|
27849
|
+
getDataSourceState,
|
|
27850
|
+
getComputed,
|
|
27851
|
+
dataSourceActions,
|
|
27852
|
+
actions,
|
|
27853
|
+
api,
|
|
27854
|
+
dataSourceApi
|
|
27855
|
+
});
|
|
27856
|
+
};
|
|
27857
|
+
const hookFn = HOOK_FN_SETUP_CALLBACK.get();
|
|
27858
|
+
if (hookFn) {
|
|
27859
|
+
withHookFn(hookFn);
|
|
27860
|
+
return;
|
|
27861
|
+
}
|
|
27862
|
+
return HOOK_FN_SETUP_CALLBACK.onChange((hookFn2) => {
|
|
27863
|
+
if (!hookFn2) {
|
|
27864
|
+
return;
|
|
27865
|
+
}
|
|
27866
|
+
withHookFn(hookFn2);
|
|
27867
|
+
});
|
|
27868
|
+
}, []);
|
|
27869
|
+
(0, import_react66.useEffect)(() => {
|
|
27870
|
+
const debugId2 = debugIdRef.current;
|
|
27871
|
+
if (!debugId2) {
|
|
27872
|
+
return;
|
|
27873
|
+
}
|
|
27874
|
+
const hookFn = HOOK_FN_SETUP_CALLBACK.get();
|
|
27875
|
+
if (hookFn) {
|
|
27876
|
+
hookFn(debugId2, {
|
|
27877
|
+
getState,
|
|
27878
|
+
getDataSourceState,
|
|
27879
|
+
getComputed,
|
|
27880
|
+
dataSourceActions,
|
|
27881
|
+
actions,
|
|
27882
|
+
api,
|
|
27883
|
+
dataSourceApi
|
|
27884
|
+
});
|
|
27885
|
+
}
|
|
27886
|
+
});
|
|
27887
|
+
(0, import_react66.useEffect)(() => {
|
|
27888
|
+
if (!debugId) {
|
|
27889
|
+
return;
|
|
27890
|
+
}
|
|
27891
|
+
return () => {
|
|
27892
|
+
const devtoolsHookFn = globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;
|
|
27893
|
+
if (devtoolsHookFn) {
|
|
27894
|
+
devtoolsHookFn(debugId, null);
|
|
27895
|
+
}
|
|
27896
|
+
};
|
|
27897
|
+
}, [debugId]);
|
|
27898
|
+
return debugId;
|
|
27198
27899
|
}
|
|
27199
27900
|
|
|
27200
27901
|
// src/components/InfiniteTable/hooks/useInfinitePortalContainer.ts
|
|
@@ -27227,14 +27928,16 @@ var { ManagedComponentContextProvider: InfiniteTableRoot } = buildManagedCompone
|
|
|
27227
27928
|
mappedCallbacks: getMappedCallbacks2(),
|
|
27228
27929
|
// @ts-ignore
|
|
27229
27930
|
getParentState: () => useDataSourceState(),
|
|
27230
|
-
debugName:
|
|
27931
|
+
debugName: (props) => {
|
|
27932
|
+
return getDebugChannel(props.debugId, DEBUG_NAME);
|
|
27933
|
+
}
|
|
27231
27934
|
});
|
|
27232
27935
|
function InfiniteTableHeader2() {
|
|
27233
27936
|
const context = useInfiniteTable();
|
|
27234
27937
|
const { state: componentState, getComputed } = context;
|
|
27235
27938
|
const { header, brain, headerBrain, wrapRowsHorizontally } = componentState;
|
|
27236
27939
|
const { scrollbars } = getComputed();
|
|
27237
|
-
return header ? /* @__PURE__ */
|
|
27940
|
+
return header ? /* @__PURE__ */ React70.createElement(
|
|
27238
27941
|
TableHeaderWrapper,
|
|
27239
27942
|
{
|
|
27240
27943
|
wrapRowsHorizontally: !!wrapRowsHorizontally,
|
|
@@ -27251,7 +27954,7 @@ var InfiniteTableBodyCls = join(
|
|
|
27251
27954
|
transformTranslateZero
|
|
27252
27955
|
);
|
|
27253
27956
|
function InfiniteTableBodyContainer(props) {
|
|
27254
|
-
return /* @__PURE__ */
|
|
27957
|
+
return /* @__PURE__ */ React70.createElement(
|
|
27255
27958
|
"div",
|
|
27256
27959
|
{
|
|
27257
27960
|
...props,
|
|
@@ -27289,7 +27992,7 @@ function InfiniteTableBody() {
|
|
|
27289
27992
|
const {
|
|
27290
27993
|
componentState: { loading }
|
|
27291
27994
|
} = useDataSourceContextValue();
|
|
27292
|
-
const onContextMenu =
|
|
27995
|
+
const onContextMenu = React70.useCallback((event) => {
|
|
27293
27996
|
const state = context.getState();
|
|
27294
27997
|
const target = event.target;
|
|
27295
27998
|
if (!masterContext && event._from_row_detail) {
|
|
@@ -27335,7 +28038,7 @@ function InfiniteTableBody() {
|
|
|
27335
28038
|
});
|
|
27336
28039
|
const { autoFocus, tabIndex } = domProps ?? {};
|
|
27337
28040
|
useToggleWrapRowsHorizontally();
|
|
27338
|
-
return /* @__PURE__ */
|
|
28041
|
+
return /* @__PURE__ */ React70.createElement(InfiniteTableBodyContainer, { onContextMenu }, /* @__PURE__ */ React70.createElement(
|
|
27339
28042
|
HeadlessTable,
|
|
27340
28043
|
{
|
|
27341
28044
|
forceRerenderTimestamp: componentState.forceBodyRerenderTimestamp,
|
|
@@ -27357,9 +28060,9 @@ function InfiniteTableBody() {
|
|
|
27357
28060
|
scrollerDOMRef,
|
|
27358
28061
|
scrollVarHostRef: domRef
|
|
27359
28062
|
}
|
|
27360
|
-
), /* @__PURE__ */
|
|
28063
|
+
), /* @__PURE__ */ React70.createElement(LoadMaskCmp, { visible: loading }, loadingText));
|
|
27361
28064
|
}
|
|
27362
|
-
var InfiniteTableComponent =
|
|
28065
|
+
var InfiniteTableComponent = React70.memo(
|
|
27363
28066
|
function InfiniteTableComponent2() {
|
|
27364
28067
|
const context = useInfiniteTable();
|
|
27365
28068
|
const masterContext = useMasterDetailContext();
|
|
@@ -27391,7 +28094,7 @@ var InfiniteTableComponent = React71.memo(
|
|
|
27391
28094
|
useScrollToActiveRow(activeRowIndex, dataArray.length, api);
|
|
27392
28095
|
useScrollToActiveCell(activeCellIndex, dataArray.length, api);
|
|
27393
28096
|
const { onKeyDown: onKeyDown2 } = useDOMEventHandlers();
|
|
27394
|
-
|
|
28097
|
+
React70.useEffect(() => {
|
|
27395
28098
|
const dataSourceState = getDataSourceState();
|
|
27396
28099
|
const onChange = debounce(
|
|
27397
28100
|
(renderRange) => {
|
|
@@ -27414,7 +28117,7 @@ var InfiniteTableComponent = React71.memo(
|
|
|
27414
28117
|
...initialDOMProps
|
|
27415
28118
|
} = componentState.domProps ?? {};
|
|
27416
28119
|
const domProps = useDOMProps(initialDOMProps);
|
|
27417
|
-
|
|
28120
|
+
React70.useEffect(() => {
|
|
27418
28121
|
brain.setScrollStopDelay(scrollStopDelay);
|
|
27419
28122
|
dataSourceActions.scrollStopDelayUpdatedByTable = scrollStopDelay;
|
|
27420
28123
|
}, [scrollStopDelay]);
|
|
@@ -27425,7 +28128,7 @@ var InfiniteTableComponent = React71.memo(
|
|
|
27425
28128
|
const { menuPortal: cellContextMenuPortal } = useCellContextMenu();
|
|
27426
28129
|
const { menuPortal: tableContextMenuPortal } = useTableContextMenu();
|
|
27427
28130
|
const { menuPortal: filterOperatorMenuPortal } = useColumnFilterOperatorMenu();
|
|
27428
|
-
|
|
28131
|
+
React70.useEffect(() => {
|
|
27429
28132
|
if (typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY === "function") {
|
|
27430
28133
|
globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(
|
|
27431
28134
|
componentState.id,
|
|
@@ -27438,59 +28141,75 @@ var InfiniteTableComponent = React71.memo(
|
|
|
27438
28141
|
globalThis.infiniteApi = context.api;
|
|
27439
28142
|
}
|
|
27440
28143
|
}, [componentState.ready]);
|
|
27441
|
-
useDebugMode();
|
|
27442
|
-
|
|
28144
|
+
const debugId = useDebugMode();
|
|
28145
|
+
React70.useEffect(() => {
|
|
27443
28146
|
if (masterContext) {
|
|
27444
28147
|
portalDOMRef.current = masterContext.getMasterState().portalDOMRef.current;
|
|
27445
28148
|
}
|
|
27446
28149
|
}, []);
|
|
27447
|
-
const children = initialChildren ?? /* @__PURE__ */
|
|
27448
|
-
return /* @__PURE__ */
|
|
28150
|
+
const children = initialChildren ?? /* @__PURE__ */ React70.createElement(React70.Fragment, null, /* @__PURE__ */ React70.createElement(InfiniteTableHeader2, null), /* @__PURE__ */ React70.createElement(InfiniteTableBody, null));
|
|
28151
|
+
return /* @__PURE__ */ React70.createElement(
|
|
27449
28152
|
"div",
|
|
27450
28153
|
{
|
|
27451
|
-
|
|
27452
|
-
|
|
27453
|
-
|
|
27454
|
-
|
|
27455
|
-
position.absolute,
|
|
27456
|
-
top[0],
|
|
27457
|
-
left[0]
|
|
27458
|
-
)
|
|
28154
|
+
"data-debug-id": debugId,
|
|
28155
|
+
onKeyDown: onKeyDown2,
|
|
28156
|
+
ref: domRef,
|
|
28157
|
+
...domProps
|
|
27459
28158
|
},
|
|
27460
|
-
|
|
27461
|
-
|
|
27462
|
-
|
|
27463
|
-
|
|
27464
|
-
|
|
27465
|
-
|
|
27466
|
-
|
|
27467
|
-
|
|
27468
|
-
|
|
27469
|
-
|
|
27470
|
-
|
|
27471
|
-
|
|
27472
|
-
|
|
27473
|
-
|
|
27474
|
-
|
|
27475
|
-
|
|
27476
|
-
|
|
27477
|
-
|
|
27478
|
-
|
|
27479
|
-
|
|
27480
|
-
|
|
27481
|
-
|
|
27482
|
-
|
|
27483
|
-
|
|
27484
|
-
|
|
27485
|
-
|
|
27486
|
-
|
|
27487
|
-
|
|
27488
|
-
|
|
27489
|
-
|
|
27490
|
-
|
|
27491
|
-
|
|
27492
|
-
|
|
27493
|
-
|
|
28159
|
+
children,
|
|
28160
|
+
/* @__PURE__ */ React70.createElement(
|
|
28161
|
+
"div",
|
|
28162
|
+
{
|
|
28163
|
+
ref: portalDOMRef,
|
|
28164
|
+
className: join(
|
|
28165
|
+
`${rootClassName2}Portal`,
|
|
28166
|
+
zIndex[1e7],
|
|
28167
|
+
position.absolute,
|
|
28168
|
+
top[0],
|
|
28169
|
+
left[0]
|
|
28170
|
+
)
|
|
28171
|
+
},
|
|
28172
|
+
menuPortal,
|
|
28173
|
+
cellContextMenuPortal,
|
|
28174
|
+
tableContextMenuPortal,
|
|
28175
|
+
filterOperatorMenuPortal
|
|
28176
|
+
),
|
|
28177
|
+
rowHeightCSSVar ? /* @__PURE__ */ React70.createElement(
|
|
28178
|
+
CSSNumericVariableWatch,
|
|
28179
|
+
{
|
|
28180
|
+
key: "row-height",
|
|
28181
|
+
varName: rowHeightCSSVar,
|
|
28182
|
+
onChange: onRowHeightCSSVarChange
|
|
28183
|
+
}
|
|
28184
|
+
) : null,
|
|
28185
|
+
/* @__PURE__ */ React70.createElement(
|
|
28186
|
+
CSSNumericVariableWatch,
|
|
28187
|
+
{
|
|
28188
|
+
key: "flashing-duration",
|
|
28189
|
+
allowInts: true,
|
|
28190
|
+
varName: ThemeVars.components.Cell.flashingDuration,
|
|
28191
|
+
onChange: onFlashingDurationCSSVarChange
|
|
28192
|
+
}
|
|
28193
|
+
),
|
|
28194
|
+
rowDetailHeightCSSVar ? /* @__PURE__ */ React70.createElement(
|
|
28195
|
+
CSSNumericVariableWatch,
|
|
28196
|
+
{
|
|
28197
|
+
key: "row-detail-height",
|
|
28198
|
+
varName: rowDetailHeightCSSVar,
|
|
28199
|
+
onChange: onRowDetailHeightCSSVarChange
|
|
28200
|
+
}
|
|
28201
|
+
) : null,
|
|
28202
|
+
columnHeaderHeightCSSVar ? /* @__PURE__ */ React70.createElement(
|
|
28203
|
+
CSSNumericVariableWatch,
|
|
28204
|
+
{
|
|
28205
|
+
key: "column-header-height",
|
|
28206
|
+
varName: columnHeaderHeightCSSVar,
|
|
28207
|
+
onChange: onColumnHeaderHeightCSSVarChange
|
|
28208
|
+
}
|
|
28209
|
+
) : null,
|
|
28210
|
+
licenseValid ? null : /* @__PURE__ */ React70.createElement(InfiniteTableLicenseFooter, null),
|
|
28211
|
+
/* @__PURE__ */ React70.createElement(FocusDetect, null)
|
|
28212
|
+
);
|
|
27494
28213
|
}
|
|
27495
28214
|
);
|
|
27496
28215
|
function InfiniteTableContextProvider({
|
|
@@ -27507,6 +28226,16 @@ function InfiniteTableContextProvider({
|
|
|
27507
28226
|
globalThis.getComputed = getComputed;
|
|
27508
28227
|
globalThis.componentActions = componentActions;
|
|
27509
28228
|
globalThis.masterBrain = componentState.brain;
|
|
28229
|
+
globalThis.INFINITE = globalThis.INFINITE || {};
|
|
28230
|
+
if (getState().debugId) {
|
|
28231
|
+
const debugId = getState().debugId;
|
|
28232
|
+
globalThis.INFINITE[debugId] = {
|
|
28233
|
+
// @ts-ignore
|
|
28234
|
+
...globalThis.INFINITE[debugId] || {},
|
|
28235
|
+
getState,
|
|
28236
|
+
actions: componentActions
|
|
28237
|
+
};
|
|
28238
|
+
}
|
|
27510
28239
|
}
|
|
27511
28240
|
const {
|
|
27512
28241
|
getState: getDataSourceState,
|
|
@@ -27514,7 +28243,7 @@ function InfiniteTableContextProvider({
|
|
|
27514
28243
|
getDataSourceMasterContext,
|
|
27515
28244
|
api: dataSourceApi
|
|
27516
28245
|
} = useDataSourceContextValue();
|
|
27517
|
-
const [imperativeApi] =
|
|
28246
|
+
const [imperativeApi] = React70.useState(() => {
|
|
27518
28247
|
return getImperativeApi({
|
|
27519
28248
|
getComputed,
|
|
27520
28249
|
getState,
|
|
@@ -27550,20 +28279,20 @@ function InfiniteTableContextProvider({
|
|
|
27550
28279
|
},
|
|
27551
28280
|
{ earlyAttach: true, debounce: 50 }
|
|
27552
28281
|
);
|
|
27553
|
-
|
|
28282
|
+
React70.useEffect(() => {
|
|
27554
28283
|
if (scrollerDOMRef.current) {
|
|
27555
28284
|
scrollerDOMRef.current.scrollTop = 0;
|
|
27556
28285
|
}
|
|
27557
28286
|
}, [scrollTopKey, scrollerDOMRef]);
|
|
27558
28287
|
const TableContext2 = getInfiniteTableContext();
|
|
27559
|
-
return /* @__PURE__ */
|
|
28288
|
+
return /* @__PURE__ */ React70.createElement(TableContext2.Provider, { value: contextValue }, /* @__PURE__ */ React70.createElement(InfiniteTableComponent, null));
|
|
27560
28289
|
}
|
|
27561
28290
|
var DEFAULT_ROW_HEIGHT = 40;
|
|
27562
28291
|
var DEFAULT_COLUMN_HEADER_HEIGHT = toCSSVarName(columnHeaderHeightName);
|
|
27563
28292
|
var InfiniteTable = function(props) {
|
|
27564
28293
|
const table = (
|
|
27565
28294
|
//@ts-ignore
|
|
27566
|
-
/* @__PURE__ */
|
|
28295
|
+
/* @__PURE__ */ React70.createElement(
|
|
27567
28296
|
InfiniteTableRoot,
|
|
27568
28297
|
{
|
|
27569
28298
|
repeatWrappedGroupRows: !!props.wrapRowsHorizontally,
|
|
@@ -27571,34 +28300,33 @@ var InfiniteTable = function(props) {
|
|
|
27571
28300
|
columnHeaderHeight: DEFAULT_COLUMN_HEADER_HEIGHT,
|
|
27572
28301
|
...props
|
|
27573
28302
|
},
|
|
27574
|
-
/* @__PURE__ */
|
|
28303
|
+
/* @__PURE__ */ React70.createElement(InfiniteTableContextProvider, { children: props.children })
|
|
27575
28304
|
)
|
|
27576
28305
|
);
|
|
27577
28306
|
if (false) {
|
|
27578
|
-
return /* @__PURE__ */
|
|
28307
|
+
return /* @__PURE__ */ React70.createElement(React70.StrictMode, null, table);
|
|
27579
28308
|
}
|
|
27580
28309
|
return table;
|
|
27581
28310
|
};
|
|
27582
28311
|
InfiniteTable.Header = InfiniteTableHeader2;
|
|
27583
28312
|
InfiniteTable.Body = InfiniteTableBody;
|
|
27584
28313
|
InfiniteTable.HScrollSyncContent = HScrollSyncContent;
|
|
27585
|
-
InfiniteTable.Footer = () => /* @__PURE__ */
|
|
28314
|
+
InfiniteTable.Footer = () => /* @__PURE__ */ React70.createElement(InfiniteTableFooter, null);
|
|
27586
28315
|
|
|
27587
28316
|
// src/components/TreeGrid/TreeDataSource.tsx
|
|
27588
|
-
var
|
|
28317
|
+
var React71 = __toESM(require("react"));
|
|
27589
28318
|
function TreeDataSource(props) {
|
|
27590
28319
|
const { DataSource: DataSourceComponent } = useDataSourceInternal({ nodesKey: "children", ...props });
|
|
27591
|
-
return /* @__PURE__ */
|
|
28320
|
+
return /* @__PURE__ */ React71.createElement(DataSourceComponent, null, props.children ?? null);
|
|
27592
28321
|
}
|
|
27593
28322
|
|
|
27594
28323
|
// src/components/TreeGrid/TreeGrid.tsx
|
|
27595
|
-
var
|
|
28324
|
+
var React72 = __toESM(require("react"));
|
|
27596
28325
|
function TreeGrid(props) {
|
|
27597
|
-
return /* @__PURE__ */
|
|
28326
|
+
return /* @__PURE__ */ React72.createElement(InfiniteTable, { ...props });
|
|
27598
28327
|
}
|
|
27599
28328
|
|
|
27600
28329
|
// src/components/DataSource/DataLoader/DataQuery.ts
|
|
27601
|
-
var logger2 = debug("InfiniteTable:DataQuery");
|
|
27602
28330
|
var DataQuery = class {
|
|
27603
28331
|
constructor(debugName) {
|
|
27604
28332
|
this.state = "idle";
|
|
@@ -27612,21 +28340,21 @@ var DataQuery = class {
|
|
|
27612
28340
|
let resolvePending = () => {
|
|
27613
28341
|
};
|
|
27614
28342
|
try {
|
|
27615
|
-
|
|
28343
|
+
this.logger(`Fetching query ${this.debugName}...`);
|
|
27616
28344
|
this.pendingPromise = new Promise((resolve) => {
|
|
27617
28345
|
resolvePending = resolve;
|
|
27618
28346
|
});
|
|
27619
28347
|
this.result = await loadFn(...key);
|
|
27620
28348
|
this.state = "success";
|
|
27621
|
-
} catch (
|
|
28349
|
+
} catch (error4) {
|
|
27622
28350
|
this.result = void 0;
|
|
27623
|
-
this.error =
|
|
28351
|
+
this.error = error4;
|
|
27624
28352
|
this.state = "error";
|
|
27625
28353
|
}
|
|
27626
28354
|
this.doneAt = Date.now();
|
|
27627
28355
|
this.pendingPromise = void 0;
|
|
27628
28356
|
resolvePending(this);
|
|
27629
|
-
|
|
28357
|
+
this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`);
|
|
27630
28358
|
return this.getDoneSnapshot();
|
|
27631
28359
|
};
|
|
27632
28360
|
this.getCurrentSnapshot = () => {
|
|
@@ -27666,6 +28394,7 @@ var DataQuery = class {
|
|
|
27666
28394
|
this.isDone = () => this.state === "success" || this.state === "error";
|
|
27667
28395
|
this.isSuccess = () => this.state === "success";
|
|
27668
28396
|
this.debugName = debugName || "";
|
|
28397
|
+
this.logger = debug(`${debugName}:DataQuery`);
|
|
27669
28398
|
}
|
|
27670
28399
|
};
|
|
27671
28400
|
|
|
@@ -27724,7 +28453,7 @@ var _DataClient = class {
|
|
|
27724
28453
|
this.removeQueryIfErrored(cachedQuery, stringifiedCacheKey);
|
|
27725
28454
|
}
|
|
27726
28455
|
}
|
|
27727
|
-
const dataQuery = new DataQuery(options.name
|
|
28456
|
+
const dataQuery = new DataQuery(`${this.name}:${options.name}`);
|
|
27728
28457
|
this.queryCache.set(stringifiedCacheKey, dataQuery);
|
|
27729
28458
|
dataQuery.fetch(options.fn, options.key);
|
|
27730
28459
|
dataQuery.getCurrentSnapshot().promise?.then(() => {
|
|
@@ -27836,7 +28565,7 @@ var keyboardShortcuts = {
|
|
|
27836
28565
|
};
|
|
27837
28566
|
|
|
27838
28567
|
// src/components/hooks/useInterceptedMap.ts
|
|
27839
|
-
var
|
|
28568
|
+
var import_react67 = require("react");
|
|
27840
28569
|
function interceptMap(map2, fns) {
|
|
27841
28570
|
const { set, delete: deleteKey, clear } = map2;
|
|
27842
28571
|
if (fns.set) {
|
|
@@ -27998,21 +28727,21 @@ var WeakFixedSizeSet = _WeakFixedSizeSet;
|
|
|
27998
28727
|
WeakFixedSizeSet.DEFAULT_SIZE = 10;
|
|
27999
28728
|
|
|
28000
28729
|
// src/components/hooks/useEffectWhenSameDeps.ts
|
|
28001
|
-
var
|
|
28730
|
+
var import_react68 = require("react");
|
|
28002
28731
|
var isSameDeps = (deps, prevDeps) => {
|
|
28003
28732
|
return deps.every((dep, index) => dep === prevDeps[index]);
|
|
28004
28733
|
};
|
|
28005
28734
|
var useEffectWhenSameDeps = (callback, deps) => {
|
|
28006
|
-
const depsRef = (0,
|
|
28735
|
+
const depsRef = (0, import_react68.useRef)(deps);
|
|
28007
28736
|
const sameDeps = isSameDeps(deps, depsRef.current);
|
|
28008
|
-
const isInitialRef = (0,
|
|
28737
|
+
const isInitialRef = (0, import_react68.useRef)(true);
|
|
28009
28738
|
depsRef.current = deps;
|
|
28010
|
-
const effectDepsRef = (0,
|
|
28739
|
+
const effectDepsRef = (0, import_react68.useRef)(["same"]);
|
|
28011
28740
|
const effectDeps = sameDeps ? [Date.now()] : effectDepsRef.current;
|
|
28012
28741
|
effectDepsRef.current = effectDeps;
|
|
28013
|
-
const callbackRef = (0,
|
|
28742
|
+
const callbackRef = (0, import_react68.useRef)(callback);
|
|
28014
28743
|
callbackRef.current = callback;
|
|
28015
|
-
(0,
|
|
28744
|
+
(0, import_react68.useEffect)(() => {
|
|
28016
28745
|
if (isInitialRef.current) {
|
|
28017
28746
|
isInitialRef.current = false;
|
|
28018
28747
|
return;
|
|
@@ -28022,7 +28751,7 @@ var useEffectWhenSameDeps = (callback, deps) => {
|
|
|
28022
28751
|
};
|
|
28023
28752
|
|
|
28024
28753
|
// src/components/hooks/useEffectWhen.ts
|
|
28025
|
-
var
|
|
28754
|
+
var import_react69 = require("react");
|
|
28026
28755
|
var isSameDeps2 = (deps, prevDeps, compare) => {
|
|
28027
28756
|
return deps.every((dep, index) => {
|
|
28028
28757
|
if (compare) {
|
|
@@ -28033,26 +28762,26 @@ var isSameDeps2 = (deps, prevDeps, compare) => {
|
|
|
28033
28762
|
};
|
|
28034
28763
|
var useEffectWhen = (callback, options) => {
|
|
28035
28764
|
const { same: depsForSame, different: depsForDifferent, compare } = options;
|
|
28036
|
-
const sameDepsRef = (0,
|
|
28037
|
-
const differentDepsRef = (0,
|
|
28765
|
+
const sameDepsRef = (0, import_react69.useRef)(depsForSame);
|
|
28766
|
+
const differentDepsRef = (0, import_react69.useRef)(depsForDifferent);
|
|
28038
28767
|
const sameRespected = isSameDeps2(depsForSame, sameDepsRef.current, compare);
|
|
28039
28768
|
const differentRespected = !isSameDeps2(
|
|
28040
28769
|
depsForDifferent,
|
|
28041
28770
|
differentDepsRef.current,
|
|
28042
28771
|
compare
|
|
28043
28772
|
);
|
|
28044
|
-
const isInitialRef = (0,
|
|
28773
|
+
const isInitialRef = (0, import_react69.useRef)(true);
|
|
28045
28774
|
sameDepsRef.current = depsForSame;
|
|
28046
28775
|
differentDepsRef.current = depsForDifferent;
|
|
28047
|
-
const effectDepsRef = (0,
|
|
28776
|
+
const effectDepsRef = (0, import_react69.useRef)(["same"]);
|
|
28048
28777
|
const effectDeps = sameRespected && differentRespected ? [Date.now()] : effectDepsRef.current;
|
|
28049
28778
|
effectDepsRef.current = effectDeps;
|
|
28050
|
-
const callbackRef = (0,
|
|
28779
|
+
const callbackRef = (0, import_react69.useRef)(callback);
|
|
28051
28780
|
callbackRef.current = callback;
|
|
28052
28781
|
if (sameRespected && differentRespected) {
|
|
28053
28782
|
isInitialRef.current = false;
|
|
28054
28783
|
}
|
|
28055
|
-
(0,
|
|
28784
|
+
(0, import_react69.useEffect)(() => {
|
|
28056
28785
|
if (isInitialRef.current) {
|
|
28057
28786
|
return;
|
|
28058
28787
|
}
|
|
@@ -28061,12 +28790,12 @@ var useEffectWhen = (callback, options) => {
|
|
|
28061
28790
|
};
|
|
28062
28791
|
|
|
28063
28792
|
// src/components/InfiniteTable/components/InfiniteTableRow/FlashingColumnCell.tsx
|
|
28064
|
-
var
|
|
28793
|
+
var React73 = __toESM(require("react"));
|
|
28065
28794
|
var currentFlashingDurationVar = stripVar(
|
|
28066
28795
|
InternalVars.currentFlashingDuration
|
|
28067
28796
|
);
|
|
28068
28797
|
var defaultRender = ({ children }) => {
|
|
28069
|
-
return /* @__PURE__ */
|
|
28798
|
+
return /* @__PURE__ */ React73.createElement(React73.Fragment, null, children);
|
|
28070
28799
|
};
|
|
28071
28800
|
var DEFAULT_FLASH_DURATION = 1e3;
|
|
28072
28801
|
var INTERNAL_FLASH_CLS_FOR_DIRECTION = {
|
|
@@ -28088,7 +28817,7 @@ var createFlashingColumnCellComponent = (options = {}) => {
|
|
|
28088
28817
|
// fadeClassName,
|
|
28089
28818
|
render = defaultRender
|
|
28090
28819
|
} = options;
|
|
28091
|
-
const FlashingColumnCell2 =
|
|
28820
|
+
const FlashingColumnCell2 = React73.forwardRef(
|
|
28092
28821
|
(props, _ref) => {
|
|
28093
28822
|
const cellContext = useInfiniteColumnCell();
|
|
28094
28823
|
const {
|
|
@@ -28098,13 +28827,13 @@ var createFlashingColumnCellComponent = (options = {}) => {
|
|
|
28098
28827
|
const { domRef, value, column, rowInfo, htmlElementRef } = cellContext;
|
|
28099
28828
|
const rowId = rowInfo.id;
|
|
28100
28829
|
const columnId = column.id;
|
|
28101
|
-
const initialRef =
|
|
28102
|
-
const oldValueRef =
|
|
28830
|
+
const initialRef = React73.useRef(true);
|
|
28831
|
+
const oldValueRef = React73.useRef(value);
|
|
28103
28832
|
const oldValue = initialRef.current ? null : oldValueRef.current;
|
|
28104
28833
|
initialRef.current = false;
|
|
28105
|
-
const flashTimeoutIdRef =
|
|
28106
|
-
const flashDirectionRef =
|
|
28107
|
-
const fadeTimeoutIdRef =
|
|
28834
|
+
const flashTimeoutIdRef = React73.useRef();
|
|
28835
|
+
const flashDirectionRef = React73.useRef();
|
|
28836
|
+
const fadeTimeoutIdRef = React73.useRef();
|
|
28108
28837
|
useEffectWhen(
|
|
28109
28838
|
() => {
|
|
28110
28839
|
if (value === oldValueRef.current) {
|
|
@@ -28151,7 +28880,7 @@ var createFlashingColumnCellComponent = (options = {}) => {
|
|
|
28151
28880
|
different: [value]
|
|
28152
28881
|
}
|
|
28153
28882
|
);
|
|
28154
|
-
return /* @__PURE__ */
|
|
28883
|
+
return /* @__PURE__ */ React73.createElement("div", { ref: domRef, ...props, className: join(props.className) }, render({ children: props.children, oldValue }));
|
|
28155
28884
|
}
|
|
28156
28885
|
);
|
|
28157
28886
|
return FlashingColumnCell2;
|