@infinite-table/infinite-react 6.0.17 → 6.0.19
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 +63 -24
- package/index.dev.js +139 -12
- package/index.dev.mjs +139 -12
- package/index.js +139 -12
- package/index.mjs +139 -12
- package/package.json +2 -2
package/index.dev.js
CHANGED
|
@@ -4117,6 +4117,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
4117
4117
|
}
|
|
4118
4118
|
const visitedCells = /* @__PURE__ */ new Map();
|
|
4119
4119
|
const visitedRows = /* @__PURE__ */ new Map();
|
|
4120
|
+
const elementsRenderedOnTheFly = /* @__PURE__ */ new Set();
|
|
4120
4121
|
ranges.forEach((range2) => {
|
|
4121
4122
|
const { start: start2, end: end2 } = range2;
|
|
4122
4123
|
const [startRow, startCol] = start2;
|
|
@@ -4157,8 +4158,14 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
4157
4158
|
);
|
|
4158
4159
|
if (elementIndex == null) {
|
|
4159
4160
|
for (let i = this.itemDOMElements.length; i <= this.itemDOMRefs.length; i++) {
|
|
4160
|
-
if (!this.itemDOMElements[i] && this.itemDOMRefs[i]) {
|
|
4161
|
+
if (!this.itemDOMElements[i] && this.itemDOMRefs[i] && !elementsRenderedOnTheFly.has(i)) {
|
|
4161
4162
|
elementIndex = i;
|
|
4163
|
+
elementsRenderedOnTheFly.add(i);
|
|
4164
|
+
if (false) {
|
|
4165
|
+
this.debug(
|
|
4166
|
+
`Last-moment recovery of element ${elementIndex} to render cell ${row}:${col}`
|
|
4167
|
+
);
|
|
4168
|
+
}
|
|
4162
4169
|
break;
|
|
4163
4170
|
}
|
|
4164
4171
|
}
|
|
@@ -16259,12 +16266,82 @@ function toRowInfo(data, id, index, isRowSelected, isRowDisabled, cellSelectionS
|
|
|
16259
16266
|
}
|
|
16260
16267
|
return rowInfo;
|
|
16261
16268
|
}
|
|
16269
|
+
var warnIncorrectTreeFilterOnce = once(() => {
|
|
16270
|
+
console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
16271
|
+
|
|
16272
|
+
Your filtering function probably looks like this:
|
|
16273
|
+
|
|
16274
|
+
function treeFilterFunction({ data }) {
|
|
16275
|
+
data.children = data.children.filter(...) // <-- THIS MUTATION IS NOT SUPPORTED!
|
|
16276
|
+
return data
|
|
16277
|
+
}
|
|
16278
|
+
|
|
16279
|
+
Make sure you avoid mutations.
|
|
16280
|
+
|
|
16281
|
+
`);
|
|
16282
|
+
});
|
|
16283
|
+
function filterTreeDataSource(params) {
|
|
16284
|
+
const {
|
|
16285
|
+
dataArray,
|
|
16286
|
+
treeFilterFunction,
|
|
16287
|
+
toPrimaryKey,
|
|
16288
|
+
getNodeChildren,
|
|
16289
|
+
isLeafNode,
|
|
16290
|
+
nodesKey
|
|
16291
|
+
} = params;
|
|
16292
|
+
let treeDataArray = [];
|
|
16293
|
+
const filterTreeNode = (data) => {
|
|
16294
|
+
const children = getNodeChildren(data);
|
|
16295
|
+
if (isLeafNode(data) || !Array.isArray(children)) {
|
|
16296
|
+
return data;
|
|
16297
|
+
}
|
|
16298
|
+
const newChildren = filterTreeDataSource({
|
|
16299
|
+
...params,
|
|
16300
|
+
dataArray: children
|
|
16301
|
+
});
|
|
16302
|
+
if (newChildren.length === 0) {
|
|
16303
|
+
return false;
|
|
16304
|
+
}
|
|
16305
|
+
data = {
|
|
16306
|
+
...data,
|
|
16307
|
+
[nodesKey]: newChildren
|
|
16308
|
+
};
|
|
16309
|
+
return data;
|
|
16310
|
+
};
|
|
16311
|
+
for (let i = 0, len = dataArray.length; i < len; i++) {
|
|
16312
|
+
const data = dataArray[i];
|
|
16313
|
+
const initialChildren = getNodeChildren(data);
|
|
16314
|
+
let res = treeFilterFunction({
|
|
16315
|
+
data,
|
|
16316
|
+
index: i,
|
|
16317
|
+
dataArray,
|
|
16318
|
+
primaryKey: toPrimaryKey(data, i),
|
|
16319
|
+
filterTreeNode
|
|
16320
|
+
});
|
|
16321
|
+
if (!res) {
|
|
16322
|
+
continue;
|
|
16323
|
+
}
|
|
16324
|
+
if (res === true) {
|
|
16325
|
+
res = data;
|
|
16326
|
+
} else if (typeof res === "object") {
|
|
16327
|
+
if (res === data && initialChildren !== getNodeChildren(res)) {
|
|
16328
|
+
warnIncorrectTreeFilterOnce();
|
|
16329
|
+
}
|
|
16330
|
+
}
|
|
16331
|
+
treeDataArray.push(res);
|
|
16332
|
+
}
|
|
16333
|
+
return treeDataArray;
|
|
16334
|
+
}
|
|
16262
16335
|
function filterDataSource(params) {
|
|
16263
16336
|
const {
|
|
16264
16337
|
filterTypes,
|
|
16265
16338
|
operatorsByFilterType,
|
|
16266
16339
|
filterFunction,
|
|
16267
|
-
toPrimaryKey
|
|
16340
|
+
toPrimaryKey,
|
|
16341
|
+
treeFilterFunction,
|
|
16342
|
+
getNodeChildren,
|
|
16343
|
+
nodesKey,
|
|
16344
|
+
isLeafNode
|
|
16268
16345
|
} = params;
|
|
16269
16346
|
let { dataArray } = params;
|
|
16270
16347
|
if (filterFunction) {
|
|
@@ -16277,6 +16354,15 @@ function filterDataSource(params) {
|
|
|
16277
16354
|
})
|
|
16278
16355
|
);
|
|
16279
16356
|
}
|
|
16357
|
+
if (treeFilterFunction) {
|
|
16358
|
+
dataArray = filterTreeDataSource({
|
|
16359
|
+
...params,
|
|
16360
|
+
treeFilterFunction,
|
|
16361
|
+
getNodeChildren,
|
|
16362
|
+
nodesKey,
|
|
16363
|
+
isLeafNode
|
|
16364
|
+
});
|
|
16365
|
+
}
|
|
16280
16366
|
const filterValueArray = cleanupEmptyFilterValues(params.filterValue, filterTypes) || [];
|
|
16281
16367
|
if (filterValueArray && filterValueArray.length) {
|
|
16282
16368
|
return dataArray.filter((data, index, arr) => {
|
|
@@ -16391,11 +16477,18 @@ function concludeReducer(params) {
|
|
|
16391
16477
|
cache.clear();
|
|
16392
16478
|
state.cache = void 0;
|
|
16393
16479
|
}
|
|
16394
|
-
const {
|
|
16395
|
-
|
|
16480
|
+
const {
|
|
16481
|
+
filterFunction,
|
|
16482
|
+
treeFilterFunction,
|
|
16483
|
+
filterValue,
|
|
16484
|
+
filterTypes,
|
|
16485
|
+
operatorsByFilterType
|
|
16486
|
+
} = state;
|
|
16487
|
+
const shouldFilter = !!filterFunction || !!treeFilterFunction || Array.isArray(filterValue) && filterValue.length;
|
|
16396
16488
|
const shouldFilterClientSide = shouldFilter && state.filterMode === "local";
|
|
16397
16489
|
const filterDepsChanged = haveDepsChanged(previousState, state, [
|
|
16398
16490
|
"filterFunction",
|
|
16491
|
+
"treeFilterFunction",
|
|
16399
16492
|
"filterValue",
|
|
16400
16493
|
"filterTypes"
|
|
16401
16494
|
]);
|
|
@@ -16461,6 +16554,12 @@ function concludeReducer(params) {
|
|
|
16461
16554
|
if (shouldFilterClientSide) {
|
|
16462
16555
|
state.unfilteredCount = dataArray.length;
|
|
16463
16556
|
dataArray = shouldFilterAgain ? filterDataSource({
|
|
16557
|
+
// tree-related stuff
|
|
16558
|
+
getNodeChildren,
|
|
16559
|
+
isLeafNode,
|
|
16560
|
+
nodesKey,
|
|
16561
|
+
treeFilterFunction,
|
|
16562
|
+
// ---
|
|
16464
16563
|
dataArray,
|
|
16465
16564
|
toPrimaryKey,
|
|
16466
16565
|
filterTypes,
|
|
@@ -17587,6 +17686,7 @@ var forwardProps3 = (setupState, props) => {
|
|
|
17587
17686
|
treeSelection: 1,
|
|
17588
17687
|
refetchKey: (refetchKey) => refetchKey ?? "",
|
|
17589
17688
|
filterFunction: 1,
|
|
17689
|
+
treeFilterFunction: 1,
|
|
17590
17690
|
filterValue: 1,
|
|
17591
17691
|
useGroupKeysForMultiRowSelection: (useGroupKeysForMultiRowSelection) => useGroupKeysForMultiRowSelection ?? false,
|
|
17592
17692
|
filterDelay: (filterDelay) => filterDelay ?? 200,
|
|
@@ -17874,7 +17974,7 @@ function deriveStateFromProps(params) {
|
|
|
17874
17974
|
}
|
|
17875
17975
|
const groupMode = typeof props.data === "function" ? propsGroupMode ?? "local" : "local";
|
|
17876
17976
|
const sortMode = props.sortFunction ? "local" : propsSortMode ?? (controlledSort ? "remote" : "local");
|
|
17877
|
-
const filterMode = typeof props.filterFunction === "function" ? "local" : propsFilterMode ?? (typeof props.data === "function" ? "remote" : "local");
|
|
17977
|
+
const filterMode = typeof props.filterFunction === "function" || typeof props.treeFilterFunction === "function" ? "local" : propsFilterMode ?? (typeof props.data === "function" ? "remote" : "local");
|
|
17878
17978
|
const pivotMode = shouldReloadData.pivotBy ? "remote" : "local";
|
|
17879
17979
|
const rowDisabledState = state.rowDisabledState;
|
|
17880
17980
|
let isRowDisabled = props.isRowDisabled;
|
|
@@ -21101,6 +21201,7 @@ var forwardProps4 = (_setupState) => {
|
|
|
21101
21201
|
debugMode: 1,
|
|
21102
21202
|
onKeyDown: 1,
|
|
21103
21203
|
onCellClick: 1,
|
|
21204
|
+
onCellDoubleClick: 1,
|
|
21104
21205
|
focusedClassName: 1,
|
|
21105
21206
|
focusedWithinClassName: 1,
|
|
21106
21207
|
focusedStyle: 1,
|
|
@@ -22509,7 +22610,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
22509
22610
|
}
|
|
22510
22611
|
let valid2 = isValidLicense(licenseKey, {
|
|
22511
22612
|
publishedAt: 1624970570587,
|
|
22512
|
-
version: "6.0.
|
|
22613
|
+
version: "6.0.19"
|
|
22513
22614
|
});
|
|
22514
22615
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
22515
22616
|
return true;
|
|
@@ -22610,7 +22711,20 @@ function onCellClick(context, event) {
|
|
|
22610
22711
|
}
|
|
22611
22712
|
context.getState().onCellClick?.(context, event);
|
|
22612
22713
|
}
|
|
22613
|
-
function onCellDoubleClick(context,
|
|
22714
|
+
function onCellDoubleClick(context, event) {
|
|
22715
|
+
const { onCellDoubleClick: onCellDoubleClick2 } = context.getState();
|
|
22716
|
+
let dblClickResult = {
|
|
22717
|
+
preventEdit: false
|
|
22718
|
+
};
|
|
22719
|
+
if (onCellDoubleClick2) {
|
|
22720
|
+
const result = onCellDoubleClick2(context, event);
|
|
22721
|
+
if (result && typeof result === "object") {
|
|
22722
|
+
dblClickResult = { ...dblClickResult, ...result };
|
|
22723
|
+
}
|
|
22724
|
+
}
|
|
22725
|
+
if (dblClickResult.preventEdit) {
|
|
22726
|
+
return;
|
|
22727
|
+
}
|
|
22614
22728
|
const computed = context.getComputed();
|
|
22615
22729
|
const column = computed.computedVisibleColumns[context.colIndex];
|
|
22616
22730
|
context.api.startEdit({
|
|
@@ -23488,7 +23602,21 @@ async function onKeyDown(context, event) {
|
|
|
23488
23602
|
return cloneTreeSelection(treeSelection2, context.getDataSourceState);
|
|
23489
23603
|
}
|
|
23490
23604
|
};
|
|
23491
|
-
|
|
23605
|
+
const { onKeyDown: onKeyDownProp } = context.getState();
|
|
23606
|
+
let keyDownResult = {
|
|
23607
|
+
preventEdit: false,
|
|
23608
|
+
preventEditStop: false,
|
|
23609
|
+
preventDefaultForTabKeyWhenEditing: true,
|
|
23610
|
+
preventSelection: false,
|
|
23611
|
+
preventNavigation: false
|
|
23612
|
+
};
|
|
23613
|
+
if (onKeyDownProp) {
|
|
23614
|
+
const result = onKeyDownProp(context, event);
|
|
23615
|
+
if (result && typeof result === "object") {
|
|
23616
|
+
keyDownResult = { ...keyDownResult, ...result };
|
|
23617
|
+
}
|
|
23618
|
+
}
|
|
23619
|
+
if (!keyDownResult.preventSelection && handleKeyboardSelection(keyboardHandlerContext, event)) {
|
|
23492
23620
|
event.preventDefault();
|
|
23493
23621
|
}
|
|
23494
23622
|
if (handleBrowserFocusChangeOnKeyboardNavigation(keyboardHandlerContext, event)) {
|
|
@@ -23498,7 +23626,7 @@ async function onKeyDown(context, event) {
|
|
|
23498
23626
|
event.preventDefault();
|
|
23499
23627
|
}
|
|
23500
23628
|
}
|
|
23501
|
-
if (event.key === "Enter" && !context.api.isEditInProgress()) {
|
|
23629
|
+
if (!keyDownResult.preventEdit && event.key === "Enter" && !context.api.isEditInProgress()) {
|
|
23502
23630
|
const { activeCellIndex } = context.getState();
|
|
23503
23631
|
if (activeCellIndex) {
|
|
23504
23632
|
const [rowIndex, colIndex] = activeCellIndex;
|
|
@@ -23512,14 +23640,13 @@ async function onKeyDown(context, event) {
|
|
|
23512
23640
|
}
|
|
23513
23641
|
}
|
|
23514
23642
|
if (context.api.isEditInProgress()) {
|
|
23515
|
-
if (event.key === "Escape") {
|
|
23643
|
+
if (event.key === "Escape" && !keyDownResult.preventEditStop) {
|
|
23516
23644
|
context.api.stopEdit({ cancel: true });
|
|
23517
23645
|
}
|
|
23518
|
-
if (event.key === "Tab") {
|
|
23646
|
+
if (event.key === "Tab" && keyDownResult.preventDefaultForTabKeyWhenEditing) {
|
|
23519
23647
|
event.preventDefault();
|
|
23520
23648
|
}
|
|
23521
23649
|
}
|
|
23522
|
-
context.getState().onKeyDown?.(context, event);
|
|
23523
23650
|
const { keyboardShortcuts: keyboardShortcuts2 } = context.getState();
|
|
23524
23651
|
if (keyboardShortcuts2) {
|
|
23525
23652
|
for await (const shortcut of keyboardShortcuts2) {
|
package/index.dev.mjs
CHANGED
|
@@ -4058,6 +4058,7 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
4058
4058
|
}
|
|
4059
4059
|
const visitedCells = /* @__PURE__ */ new Map();
|
|
4060
4060
|
const visitedRows = /* @__PURE__ */ new Map();
|
|
4061
|
+
const elementsRenderedOnTheFly = /* @__PURE__ */ new Set();
|
|
4061
4062
|
ranges.forEach((range2) => {
|
|
4062
4063
|
const { start: start2, end: end2 } = range2;
|
|
4063
4064
|
const [startRow, startCol] = start2;
|
|
@@ -4098,8 +4099,14 @@ var ReactHeadlessTableRenderer = class extends Logger {
|
|
|
4098
4099
|
);
|
|
4099
4100
|
if (elementIndex == null) {
|
|
4100
4101
|
for (let i = this.itemDOMElements.length; i <= this.itemDOMRefs.length; i++) {
|
|
4101
|
-
if (!this.itemDOMElements[i] && this.itemDOMRefs[i]) {
|
|
4102
|
+
if (!this.itemDOMElements[i] && this.itemDOMRefs[i] && !elementsRenderedOnTheFly.has(i)) {
|
|
4102
4103
|
elementIndex = i;
|
|
4104
|
+
elementsRenderedOnTheFly.add(i);
|
|
4105
|
+
if (false) {
|
|
4106
|
+
this.debug(
|
|
4107
|
+
`Last-moment recovery of element ${elementIndex} to render cell ${row}:${col}`
|
|
4108
|
+
);
|
|
4109
|
+
}
|
|
4103
4110
|
break;
|
|
4104
4111
|
}
|
|
4105
4112
|
}
|
|
@@ -16208,12 +16215,82 @@ function toRowInfo(data, id, index, isRowSelected, isRowDisabled, cellSelectionS
|
|
|
16208
16215
|
}
|
|
16209
16216
|
return rowInfo;
|
|
16210
16217
|
}
|
|
16218
|
+
var warnIncorrectTreeFilterOnce = once(() => {
|
|
16219
|
+
console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
16220
|
+
|
|
16221
|
+
Your filtering function probably looks like this:
|
|
16222
|
+
|
|
16223
|
+
function treeFilterFunction({ data }) {
|
|
16224
|
+
data.children = data.children.filter(...) // <-- THIS MUTATION IS NOT SUPPORTED!
|
|
16225
|
+
return data
|
|
16226
|
+
}
|
|
16227
|
+
|
|
16228
|
+
Make sure you avoid mutations.
|
|
16229
|
+
|
|
16230
|
+
`);
|
|
16231
|
+
});
|
|
16232
|
+
function filterTreeDataSource(params) {
|
|
16233
|
+
const {
|
|
16234
|
+
dataArray,
|
|
16235
|
+
treeFilterFunction,
|
|
16236
|
+
toPrimaryKey,
|
|
16237
|
+
getNodeChildren,
|
|
16238
|
+
isLeafNode,
|
|
16239
|
+
nodesKey
|
|
16240
|
+
} = params;
|
|
16241
|
+
let treeDataArray = [];
|
|
16242
|
+
const filterTreeNode = (data) => {
|
|
16243
|
+
const children = getNodeChildren(data);
|
|
16244
|
+
if (isLeafNode(data) || !Array.isArray(children)) {
|
|
16245
|
+
return data;
|
|
16246
|
+
}
|
|
16247
|
+
const newChildren = filterTreeDataSource({
|
|
16248
|
+
...params,
|
|
16249
|
+
dataArray: children
|
|
16250
|
+
});
|
|
16251
|
+
if (newChildren.length === 0) {
|
|
16252
|
+
return false;
|
|
16253
|
+
}
|
|
16254
|
+
data = {
|
|
16255
|
+
...data,
|
|
16256
|
+
[nodesKey]: newChildren
|
|
16257
|
+
};
|
|
16258
|
+
return data;
|
|
16259
|
+
};
|
|
16260
|
+
for (let i = 0, len = dataArray.length; i < len; i++) {
|
|
16261
|
+
const data = dataArray[i];
|
|
16262
|
+
const initialChildren = getNodeChildren(data);
|
|
16263
|
+
let res = treeFilterFunction({
|
|
16264
|
+
data,
|
|
16265
|
+
index: i,
|
|
16266
|
+
dataArray,
|
|
16267
|
+
primaryKey: toPrimaryKey(data, i),
|
|
16268
|
+
filterTreeNode
|
|
16269
|
+
});
|
|
16270
|
+
if (!res) {
|
|
16271
|
+
continue;
|
|
16272
|
+
}
|
|
16273
|
+
if (res === true) {
|
|
16274
|
+
res = data;
|
|
16275
|
+
} else if (typeof res === "object") {
|
|
16276
|
+
if (res === data && initialChildren !== getNodeChildren(res)) {
|
|
16277
|
+
warnIncorrectTreeFilterOnce();
|
|
16278
|
+
}
|
|
16279
|
+
}
|
|
16280
|
+
treeDataArray.push(res);
|
|
16281
|
+
}
|
|
16282
|
+
return treeDataArray;
|
|
16283
|
+
}
|
|
16211
16284
|
function filterDataSource(params) {
|
|
16212
16285
|
const {
|
|
16213
16286
|
filterTypes,
|
|
16214
16287
|
operatorsByFilterType,
|
|
16215
16288
|
filterFunction,
|
|
16216
|
-
toPrimaryKey
|
|
16289
|
+
toPrimaryKey,
|
|
16290
|
+
treeFilterFunction,
|
|
16291
|
+
getNodeChildren,
|
|
16292
|
+
nodesKey,
|
|
16293
|
+
isLeafNode
|
|
16217
16294
|
} = params;
|
|
16218
16295
|
let { dataArray } = params;
|
|
16219
16296
|
if (filterFunction) {
|
|
@@ -16226,6 +16303,15 @@ function filterDataSource(params) {
|
|
|
16226
16303
|
})
|
|
16227
16304
|
);
|
|
16228
16305
|
}
|
|
16306
|
+
if (treeFilterFunction) {
|
|
16307
|
+
dataArray = filterTreeDataSource({
|
|
16308
|
+
...params,
|
|
16309
|
+
treeFilterFunction,
|
|
16310
|
+
getNodeChildren,
|
|
16311
|
+
nodesKey,
|
|
16312
|
+
isLeafNode
|
|
16313
|
+
});
|
|
16314
|
+
}
|
|
16229
16315
|
const filterValueArray = cleanupEmptyFilterValues(params.filterValue, filterTypes) || [];
|
|
16230
16316
|
if (filterValueArray && filterValueArray.length) {
|
|
16231
16317
|
return dataArray.filter((data, index, arr) => {
|
|
@@ -16340,11 +16426,18 @@ function concludeReducer(params) {
|
|
|
16340
16426
|
cache.clear();
|
|
16341
16427
|
state.cache = void 0;
|
|
16342
16428
|
}
|
|
16343
|
-
const {
|
|
16344
|
-
|
|
16429
|
+
const {
|
|
16430
|
+
filterFunction,
|
|
16431
|
+
treeFilterFunction,
|
|
16432
|
+
filterValue,
|
|
16433
|
+
filterTypes,
|
|
16434
|
+
operatorsByFilterType
|
|
16435
|
+
} = state;
|
|
16436
|
+
const shouldFilter = !!filterFunction || !!treeFilterFunction || Array.isArray(filterValue) && filterValue.length;
|
|
16345
16437
|
const shouldFilterClientSide = shouldFilter && state.filterMode === "local";
|
|
16346
16438
|
const filterDepsChanged = haveDepsChanged(previousState, state, [
|
|
16347
16439
|
"filterFunction",
|
|
16440
|
+
"treeFilterFunction",
|
|
16348
16441
|
"filterValue",
|
|
16349
16442
|
"filterTypes"
|
|
16350
16443
|
]);
|
|
@@ -16410,6 +16503,12 @@ function concludeReducer(params) {
|
|
|
16410
16503
|
if (shouldFilterClientSide) {
|
|
16411
16504
|
state.unfilteredCount = dataArray.length;
|
|
16412
16505
|
dataArray = shouldFilterAgain ? filterDataSource({
|
|
16506
|
+
// tree-related stuff
|
|
16507
|
+
getNodeChildren,
|
|
16508
|
+
isLeafNode,
|
|
16509
|
+
nodesKey,
|
|
16510
|
+
treeFilterFunction,
|
|
16511
|
+
// ---
|
|
16413
16512
|
dataArray,
|
|
16414
16513
|
toPrimaryKey,
|
|
16415
16514
|
filterTypes,
|
|
@@ -17536,6 +17635,7 @@ var forwardProps3 = (setupState, props) => {
|
|
|
17536
17635
|
treeSelection: 1,
|
|
17537
17636
|
refetchKey: (refetchKey) => refetchKey ?? "",
|
|
17538
17637
|
filterFunction: 1,
|
|
17638
|
+
treeFilterFunction: 1,
|
|
17539
17639
|
filterValue: 1,
|
|
17540
17640
|
useGroupKeysForMultiRowSelection: (useGroupKeysForMultiRowSelection) => useGroupKeysForMultiRowSelection ?? false,
|
|
17541
17641
|
filterDelay: (filterDelay) => filterDelay ?? 200,
|
|
@@ -17823,7 +17923,7 @@ function deriveStateFromProps(params) {
|
|
|
17823
17923
|
}
|
|
17824
17924
|
const groupMode = typeof props.data === "function" ? propsGroupMode ?? "local" : "local";
|
|
17825
17925
|
const sortMode = props.sortFunction ? "local" : propsSortMode ?? (controlledSort ? "remote" : "local");
|
|
17826
|
-
const filterMode = typeof props.filterFunction === "function" ? "local" : propsFilterMode ?? (typeof props.data === "function" ? "remote" : "local");
|
|
17926
|
+
const filterMode = typeof props.filterFunction === "function" || typeof props.treeFilterFunction === "function" ? "local" : propsFilterMode ?? (typeof props.data === "function" ? "remote" : "local");
|
|
17827
17927
|
const pivotMode = shouldReloadData.pivotBy ? "remote" : "local";
|
|
17828
17928
|
const rowDisabledState = state.rowDisabledState;
|
|
17829
17929
|
let isRowDisabled = props.isRowDisabled;
|
|
@@ -21059,6 +21159,7 @@ var forwardProps4 = (_setupState) => {
|
|
|
21059
21159
|
debugMode: 1,
|
|
21060
21160
|
onKeyDown: 1,
|
|
21061
21161
|
onCellClick: 1,
|
|
21162
|
+
onCellDoubleClick: 1,
|
|
21062
21163
|
focusedClassName: 1,
|
|
21063
21164
|
focusedWithinClassName: 1,
|
|
21064
21165
|
focusedStyle: 1,
|
|
@@ -22467,7 +22568,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
22467
22568
|
}
|
|
22468
22569
|
let valid2 = isValidLicense(licenseKey, {
|
|
22469
22570
|
publishedAt: 1624970570587,
|
|
22470
|
-
version: "6.0.
|
|
22571
|
+
version: "6.0.19"
|
|
22471
22572
|
});
|
|
22472
22573
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
22473
22574
|
return true;
|
|
@@ -22568,7 +22669,20 @@ function onCellClick(context, event) {
|
|
|
22568
22669
|
}
|
|
22569
22670
|
context.getState().onCellClick?.(context, event);
|
|
22570
22671
|
}
|
|
22571
|
-
function onCellDoubleClick(context,
|
|
22672
|
+
function onCellDoubleClick(context, event) {
|
|
22673
|
+
const { onCellDoubleClick: onCellDoubleClick2 } = context.getState();
|
|
22674
|
+
let dblClickResult = {
|
|
22675
|
+
preventEdit: false
|
|
22676
|
+
};
|
|
22677
|
+
if (onCellDoubleClick2) {
|
|
22678
|
+
const result = onCellDoubleClick2(context, event);
|
|
22679
|
+
if (result && typeof result === "object") {
|
|
22680
|
+
dblClickResult = { ...dblClickResult, ...result };
|
|
22681
|
+
}
|
|
22682
|
+
}
|
|
22683
|
+
if (dblClickResult.preventEdit) {
|
|
22684
|
+
return;
|
|
22685
|
+
}
|
|
22572
22686
|
const computed = context.getComputed();
|
|
22573
22687
|
const column = computed.computedVisibleColumns[context.colIndex];
|
|
22574
22688
|
context.api.startEdit({
|
|
@@ -23446,7 +23560,21 @@ async function onKeyDown(context, event) {
|
|
|
23446
23560
|
return cloneTreeSelection(treeSelection2, context.getDataSourceState);
|
|
23447
23561
|
}
|
|
23448
23562
|
};
|
|
23449
|
-
|
|
23563
|
+
const { onKeyDown: onKeyDownProp } = context.getState();
|
|
23564
|
+
let keyDownResult = {
|
|
23565
|
+
preventEdit: false,
|
|
23566
|
+
preventEditStop: false,
|
|
23567
|
+
preventDefaultForTabKeyWhenEditing: true,
|
|
23568
|
+
preventSelection: false,
|
|
23569
|
+
preventNavigation: false
|
|
23570
|
+
};
|
|
23571
|
+
if (onKeyDownProp) {
|
|
23572
|
+
const result = onKeyDownProp(context, event);
|
|
23573
|
+
if (result && typeof result === "object") {
|
|
23574
|
+
keyDownResult = { ...keyDownResult, ...result };
|
|
23575
|
+
}
|
|
23576
|
+
}
|
|
23577
|
+
if (!keyDownResult.preventSelection && handleKeyboardSelection(keyboardHandlerContext, event)) {
|
|
23450
23578
|
event.preventDefault();
|
|
23451
23579
|
}
|
|
23452
23580
|
if (handleBrowserFocusChangeOnKeyboardNavigation(keyboardHandlerContext, event)) {
|
|
@@ -23456,7 +23584,7 @@ async function onKeyDown(context, event) {
|
|
|
23456
23584
|
event.preventDefault();
|
|
23457
23585
|
}
|
|
23458
23586
|
}
|
|
23459
|
-
if (event.key === "Enter" && !context.api.isEditInProgress()) {
|
|
23587
|
+
if (!keyDownResult.preventEdit && event.key === "Enter" && !context.api.isEditInProgress()) {
|
|
23460
23588
|
const { activeCellIndex } = context.getState();
|
|
23461
23589
|
if (activeCellIndex) {
|
|
23462
23590
|
const [rowIndex, colIndex] = activeCellIndex;
|
|
@@ -23470,14 +23598,13 @@ async function onKeyDown(context, event) {
|
|
|
23470
23598
|
}
|
|
23471
23599
|
}
|
|
23472
23600
|
if (context.api.isEditInProgress()) {
|
|
23473
|
-
if (event.key === "Escape") {
|
|
23601
|
+
if (event.key === "Escape" && !keyDownResult.preventEditStop) {
|
|
23474
23602
|
context.api.stopEdit({ cancel: true });
|
|
23475
23603
|
}
|
|
23476
|
-
if (event.key === "Tab") {
|
|
23604
|
+
if (event.key === "Tab" && keyDownResult.preventDefaultForTabKeyWhenEditing) {
|
|
23477
23605
|
event.preventDefault();
|
|
23478
23606
|
}
|
|
23479
23607
|
}
|
|
23480
|
-
context.getState().onKeyDown?.(context, event);
|
|
23481
23608
|
const { keyboardShortcuts: keyboardShortcuts2 } = context.getState();
|
|
23482
23609
|
if (keyboardShortcuts2) {
|
|
23483
23610
|
for await (const shortcut of keyboardShortcuts2) {
|