@infinite-table/infinite-react 7.2.1 → 7.2.2
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 +43 -6
- package/index.dev.js +174 -40
- package/index.dev.mjs +174 -40
- package/index.js +7 -7
- package/index.mjs +6 -6
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -42,6 +42,18 @@ type Pair<KeyType, ValueType> = {
|
|
|
42
42
|
length: number;
|
|
43
43
|
revision?: number;
|
|
44
44
|
};
|
|
45
|
+
type PairWithKeys<KeyType, ValueType> = Pair<KeyType, ValueType> & {
|
|
46
|
+
keys: KeyType[];
|
|
47
|
+
};
|
|
48
|
+
type StartingWithMethodOptions = {
|
|
49
|
+
excludeSelf?: boolean;
|
|
50
|
+
depthLimit?: number;
|
|
51
|
+
};
|
|
52
|
+
type StartingWithMethodOptionsWithOrder = {
|
|
53
|
+
excludeSelf?: boolean;
|
|
54
|
+
depthLimit?: number;
|
|
55
|
+
respectOrder?: boolean;
|
|
56
|
+
};
|
|
45
57
|
type DeepMapVisitFn<KeyType, ValueType, ReturnType = void> = (pair: Pair<KeyType, ValueType>, keys: KeyType[], next: VoidFn$1) => ReturnType;
|
|
46
58
|
declare class DeepMap<KeyType, ValueType> {
|
|
47
59
|
private map;
|
|
@@ -51,10 +63,19 @@ declare class DeepMap<KeyType, ValueType> {
|
|
|
51
63
|
static clone<KeyType, ValueType>(map: DeepMap<KeyType, ValueType>): DeepMap<KeyType, ValueType>;
|
|
52
64
|
constructor(initial?: [KeyType[], ValueType][]);
|
|
53
65
|
fill(initial?: [KeyType[], ValueType][]): void;
|
|
54
|
-
getValuesStartingWith(keys: KeyType[],
|
|
55
|
-
getEntriesStartingWith(keys: KeyType[],
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
getValuesStartingWith(keys: KeyType[], options?: StartingWithMethodOptions): ValueType[];
|
|
67
|
+
getEntriesStartingWith(keys: KeyType[], options?: StartingWithMethodOptions): [KeyType[], ValueType][];
|
|
68
|
+
getLeafNodesStartingWith<T>(keys: KeyType[], withPair: (pair: PairWithKeys<KeyType, ValueType>) => T, options?: StartingWithMethodOptionsWithOrder): T[];
|
|
69
|
+
getKeysForLeafNodesStartingWith(keys: KeyType[], options?: StartingWithMethodOptionsWithOrder): KeyType[][];
|
|
70
|
+
getKeysAndValuesForLeafNodesStartingWith(keys: KeyType[], options?: StartingWithMethodOptionsWithOrder): [KeyType[], ValueType][];
|
|
71
|
+
/**
|
|
72
|
+
* @param keys - the keys of the node to start from
|
|
73
|
+
* @param excludeSelf - whether to exclude the start node
|
|
74
|
+
* @param depthLimit - the depth limit
|
|
75
|
+
* @returns the keys of the first child on each branch (starting from the node with the given keys)
|
|
76
|
+
*/
|
|
77
|
+
getKeysOfFirstChildOnEachBranchStartingWith(keys: KeyType[], options?: StartingWithMethodOptionsWithOrder): KeyType[][];
|
|
78
|
+
getKeysStartingWith(keys: KeyType[], options?: StartingWithMethodOptions): KeyType[][];
|
|
58
79
|
private getStartingWith;
|
|
59
80
|
private getMapAt;
|
|
60
81
|
getAllChildrenSizeFor(keys: KeyType[]): number;
|
|
@@ -244,6 +265,8 @@ declare class TreeSelectionState<T = any> {
|
|
|
244
265
|
cache: DeepMap<NodePath, NodeSelectionState>;
|
|
245
266
|
getConfig: GetTreeSelectionStateConfig<T>;
|
|
246
267
|
getTreeDeepMap(): DeepMap<any, DeepMapTreeValueType<any, any>>;
|
|
268
|
+
getSelectedLeafNodePaths(rootNodePath?: NodePath, treeDeepMap?: DeepMap<any, any>): NodePath[];
|
|
269
|
+
getDeselectedLeafNodePaths(rootNodePath?: NodePath, treeDeepMap?: DeepMap<any, any>): NodePath[];
|
|
247
270
|
isLeafNode(nodePath: NodePath): boolean;
|
|
248
271
|
getLeafNodesCount(nodePath: NodePath): number;
|
|
249
272
|
static from<T>(treeSelectionState: TreeSelectionStateObject, getConfig: GetTreeSelectionStateConfig<T>): TreeSelectionState<T>;
|
|
@@ -1430,7 +1453,7 @@ type TreeExpandStateApi<T> = {
|
|
|
1430
1453
|
getNodeDataByPath(nodePath: any[]): T | null;
|
|
1431
1454
|
getRowInfoByPath(nodePath: any[]): InfiniteTableRowInfo<T> | null;
|
|
1432
1455
|
};
|
|
1433
|
-
type TreeSelectionApi<
|
|
1456
|
+
type TreeSelectionApi<T = any> = {
|
|
1434
1457
|
get allRowsSelected(): boolean;
|
|
1435
1458
|
isNodeSelected(nodePath: NodePath$1): boolean | null;
|
|
1436
1459
|
selectNode(nodePath: NodePath$1, options?: ForceOptions): void;
|
|
@@ -1441,6 +1464,18 @@ type TreeSelectionApi<_T = any> = {
|
|
|
1441
1464
|
expandAll(): void;
|
|
1442
1465
|
collapseAll(): void;
|
|
1443
1466
|
deselectAll(): void;
|
|
1467
|
+
getSelectedLeafNodePaths(config?: {
|
|
1468
|
+
rootNodePath?: NodePath$1;
|
|
1469
|
+
treeSelectionState?: TreeSelectionState<T>;
|
|
1470
|
+
}): NodePath$1[];
|
|
1471
|
+
getDeselectedLeafNodePaths(config?: {
|
|
1472
|
+
rootNodePath?: NodePath$1;
|
|
1473
|
+
treeSelectionState?: TreeSelectionState<T>;
|
|
1474
|
+
}): NodePath$1[];
|
|
1475
|
+
getSelectedLeafRowInfos(config?: {
|
|
1476
|
+
rootNodePath?: NodePath$1;
|
|
1477
|
+
treeSelectionState?: TreeSelectionState<T>;
|
|
1478
|
+
}): InfiniteTable_Tree_RowInfoLeafNode<T>[];
|
|
1444
1479
|
};
|
|
1445
1480
|
type TreeApi<T> = TreeExpandStateApi<T> & TreeSelectionApi<T>;
|
|
1446
1481
|
|
|
@@ -1969,10 +2004,12 @@ type DataSourcePropCellSelection_SingleCell = null | CellSelectionPosition;
|
|
|
1969
2004
|
type DataSourcePropCellSelection = DataSourcePropCellSelection_MultiCell | DataSourcePropCellSelection_SingleCell;
|
|
1970
2005
|
type DataSourcePropSelectionMode = false | 'single-cell' | 'single-row' | 'multi-cell' | 'multi-row';
|
|
1971
2006
|
type DataSourcePropOnRowSelectionChange_MultiRow = (rowSelection: DataSourcePropRowSelection_MultiRow, selectionMode: 'multi-row') => void;
|
|
1972
|
-
type DataSourcePropOnTreeSelectionChange_MultiNode<T = any> = (
|
|
2007
|
+
type DataSourcePropOnTreeSelectionChange_MultiNode<T = any> = (treeSelectionStateObject: TreeSelectionStateObject, params: {
|
|
2008
|
+
treeSelectionState: TreeSelectionState<T>;
|
|
1973
2009
|
selectionMode: 'multi-row';
|
|
1974
2010
|
lastUpdatedNodePath: NodePath$1 | null;
|
|
1975
2011
|
dataSourceApi: DataSourceApi<T>;
|
|
2012
|
+
treeApi: TreeApi<T>;
|
|
1976
2013
|
}) => void;
|
|
1977
2014
|
type DataSourcePropOnRowSelectionChange_SingleRow = (rowSelection: DataSourcePropRowSelection_SingleRow, selectionMode: 'single-row') => void;
|
|
1978
2015
|
type DataSourcePropOnTreeSelectionChange_SingleNode = (treeSelection: DataSourcePropTreeSelection_SingleNode, params: {
|
package/index.dev.js
CHANGED
|
@@ -305,34 +305,76 @@ var DeepMap = class _DeepMap {
|
|
|
305
305
|
});
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
getValuesStartingWith(keys,
|
|
308
|
+
getValuesStartingWith(keys, options) {
|
|
309
309
|
const result = [];
|
|
310
310
|
this.getStartingWith(
|
|
311
311
|
keys,
|
|
312
312
|
(_keys, value) => {
|
|
313
313
|
result.push(value);
|
|
314
314
|
},
|
|
315
|
-
|
|
316
|
-
depthLimit
|
|
315
|
+
options
|
|
317
316
|
);
|
|
318
317
|
return result;
|
|
319
318
|
}
|
|
320
|
-
getEntriesStartingWith(keys,
|
|
319
|
+
getEntriesStartingWith(keys, options) {
|
|
321
320
|
const result = [];
|
|
322
321
|
this.getStartingWith(
|
|
323
322
|
keys,
|
|
324
323
|
(keys2, value) => {
|
|
325
324
|
result.push([keys2, value]);
|
|
326
325
|
},
|
|
327
|
-
|
|
328
|
-
depthLimit
|
|
326
|
+
options
|
|
329
327
|
);
|
|
330
328
|
return result;
|
|
331
329
|
}
|
|
332
|
-
|
|
330
|
+
getLeafNodesStartingWith(keys, withPair, options) {
|
|
331
|
+
const { respectOrder = false } = options || {};
|
|
333
332
|
const pairs = [];
|
|
333
|
+
const result = [];
|
|
334
|
+
this.getStartingWith(
|
|
335
|
+
keys,
|
|
336
|
+
(_keys, _value, pair) => {
|
|
337
|
+
if (!pair.map && pair.hasOwnProperty("value")) {
|
|
338
|
+
if (respectOrder) {
|
|
339
|
+
pairs.push(pair);
|
|
340
|
+
} else {
|
|
341
|
+
result.push(withPair(pair));
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
options
|
|
346
|
+
);
|
|
347
|
+
if (respectOrder) {
|
|
348
|
+
return pairs.sort(SORT_ASC_REVISION).map(withPair);
|
|
349
|
+
}
|
|
350
|
+
return result;
|
|
351
|
+
}
|
|
352
|
+
getKeysForLeafNodesStartingWith(keys, options) {
|
|
353
|
+
return this.getLeafNodesStartingWith(keys, (pair) => pair.keys, options);
|
|
354
|
+
}
|
|
355
|
+
getKeysAndValuesForLeafNodesStartingWith(keys, options) {
|
|
356
|
+
return this.getLeafNodesStartingWith(
|
|
357
|
+
keys,
|
|
358
|
+
(pair) => [pair.keys, pair.value],
|
|
359
|
+
options
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* @param keys - the keys of the node to start from
|
|
364
|
+
* @param excludeSelf - whether to exclude the start node
|
|
365
|
+
* @param depthLimit - the depth limit
|
|
366
|
+
* @returns the keys of the first child on each branch (starting from the node with the given keys)
|
|
367
|
+
*/
|
|
368
|
+
getKeysOfFirstChildOnEachBranchStartingWith(keys, options) {
|
|
369
|
+
const { excludeSelf, depthLimit, respectOrder = true } = options || {};
|
|
370
|
+
const pairs = [];
|
|
371
|
+
const result = [];
|
|
334
372
|
const fn = (pair2) => {
|
|
335
|
-
|
|
373
|
+
if (respectOrder) {
|
|
374
|
+
pairs.push(pair2);
|
|
375
|
+
} else {
|
|
376
|
+
result.push(pair2.keys);
|
|
377
|
+
}
|
|
336
378
|
};
|
|
337
379
|
let currentMap = this.map;
|
|
338
380
|
let pair;
|
|
@@ -367,7 +409,10 @@ var DeepMap = class _DeepMap {
|
|
|
367
409
|
}
|
|
368
410
|
}
|
|
369
411
|
if (stop) {
|
|
370
|
-
|
|
412
|
+
if (respectOrder) {
|
|
413
|
+
return pairs.sort(SORT_ASC_REVISION).map((pair2) => pair2.keys);
|
|
414
|
+
}
|
|
415
|
+
return result;
|
|
371
416
|
}
|
|
372
417
|
this.visitWithNext(
|
|
373
418
|
keys,
|
|
@@ -379,21 +424,24 @@ var DeepMap = class _DeepMap {
|
|
|
379
424
|
depthLimit,
|
|
380
425
|
excludeSelf
|
|
381
426
|
);
|
|
382
|
-
|
|
427
|
+
if (respectOrder) {
|
|
428
|
+
return pairs.sort(SORT_ASC_REVISION).map((pair2) => pair2.keys);
|
|
429
|
+
}
|
|
430
|
+
return result;
|
|
383
431
|
}
|
|
384
|
-
getKeysStartingWith(keys,
|
|
432
|
+
getKeysStartingWith(keys, options) {
|
|
385
433
|
const result = [];
|
|
386
434
|
this.getStartingWith(
|
|
387
435
|
keys,
|
|
388
436
|
(keys2) => {
|
|
389
437
|
result.push(keys2);
|
|
390
438
|
},
|
|
391
|
-
|
|
392
|
-
depthLimit
|
|
439
|
+
options
|
|
393
440
|
);
|
|
394
441
|
return result;
|
|
395
442
|
}
|
|
396
|
-
getStartingWith(keys, fn,
|
|
443
|
+
getStartingWith(keys, fn, options) {
|
|
444
|
+
const { excludeSelf, depthLimit } = options || {};
|
|
397
445
|
let currentMap = this.map;
|
|
398
446
|
let pair;
|
|
399
447
|
let stop = false;
|
|
@@ -415,7 +463,7 @@ var DeepMap = class _DeepMap {
|
|
|
415
463
|
}
|
|
416
464
|
if (pair && pair.value !== void 0) {
|
|
417
465
|
if (!excludeSelf) {
|
|
418
|
-
fn(keys, pair.value);
|
|
466
|
+
fn(keys, pair.value, { ...pair, keys });
|
|
419
467
|
}
|
|
420
468
|
}
|
|
421
469
|
if (stop) {
|
|
@@ -423,8 +471,8 @@ var DeepMap = class _DeepMap {
|
|
|
423
471
|
}
|
|
424
472
|
this.visitWithNext(
|
|
425
473
|
keys,
|
|
426
|
-
(value, keys2, _i, next) => {
|
|
427
|
-
fn(keys2, value);
|
|
474
|
+
(value, keys2, _i, next, pair2) => {
|
|
475
|
+
fn(keys2, value, { ...pair2, keys: keys2 });
|
|
428
476
|
next?.();
|
|
429
477
|
},
|
|
430
478
|
false,
|
|
@@ -741,6 +789,7 @@ var DeepMap = class _DeepMap {
|
|
|
741
789
|
// return makeIterator();
|
|
742
790
|
// }
|
|
743
791
|
};
|
|
792
|
+
globalThis.DeepMap = DeepMap;
|
|
744
793
|
|
|
745
794
|
// src/utils/getGlobal.ts
|
|
746
795
|
function getGlobal() {
|
|
@@ -870,7 +919,9 @@ function isChannelTargeted(channel, permissionToken) {
|
|
|
870
919
|
const hasWildcard = new Set(tokenParts).has(CHANNEL_WILDCARD);
|
|
871
920
|
const indexOfToken = tokenParts.indexOf(CHANNEL_WILDCARD);
|
|
872
921
|
const storagePartsWithoutWildcard = hasWildcard ? tokenParts.slice(0, indexOfToken) : tokenParts;
|
|
873
|
-
if (partsMap.getKeysStartingWith(storagePartsWithoutWildcard,
|
|
922
|
+
if (partsMap.getKeysStartingWith(storagePartsWithoutWildcard, {
|
|
923
|
+
excludeSelf: hasWildcard
|
|
924
|
+
}).length > 0) {
|
|
874
925
|
const remainingParts = tokenParts.slice(indexOfToken + 1);
|
|
875
926
|
if (remainingParts.length) {
|
|
876
927
|
return channel.endsWith(remainingParts.join(CHANNEL_SEPARATOR));
|
|
@@ -3389,7 +3440,10 @@ var GridCellManager = class extends Logger {
|
|
|
3389
3440
|
return this.matrix.rawKeysAt([]).sort(ASC_SORT);
|
|
3390
3441
|
}
|
|
3391
3442
|
getColumnsWithCells() {
|
|
3392
|
-
const positions = this.matrix.
|
|
3443
|
+
const positions = this.matrix.getKeysOfFirstChildOnEachBranchStartingWith(
|
|
3444
|
+
[],
|
|
3445
|
+
{ excludeSelf: true }
|
|
3446
|
+
);
|
|
3393
3447
|
const columns = new Set(positions.map((pos) => pos[1]));
|
|
3394
3448
|
return [...columns.values()].sort(ASC_SORT);
|
|
3395
3449
|
}
|
|
@@ -14599,7 +14653,10 @@ function toTreeDataArray(data, options) {
|
|
|
14599
14653
|
treeMap.set(path, item);
|
|
14600
14654
|
}
|
|
14601
14655
|
function traverse(path, arr) {
|
|
14602
|
-
const nextLevelKeys = treeMap.getKeysStartingWith(path,
|
|
14656
|
+
const nextLevelKeys = treeMap.getKeysStartingWith(path, {
|
|
14657
|
+
excludeSelf: true,
|
|
14658
|
+
depthLimit: 1
|
|
14659
|
+
});
|
|
14603
14660
|
for (const nextLevelKey of nextLevelKeys) {
|
|
14604
14661
|
const p = [...path, nextLevelKey[nextLevelKey.length - 1]];
|
|
14605
14662
|
let item = treeMap.get(p);
|
|
@@ -15081,12 +15138,18 @@ var RowSelectionState = class _RowSelectionState {
|
|
|
15081
15138
|
}
|
|
15082
15139
|
getGroupKeysDirectlyInsideGroup(groupKeys) {
|
|
15083
15140
|
const { groupDeepMap } = this.getConfig();
|
|
15084
|
-
return groupDeepMap?.getKeysStartingWith(groupKeys,
|
|
15141
|
+
return groupDeepMap?.getKeysStartingWith(groupKeys, {
|
|
15142
|
+
excludeSelf: true,
|
|
15143
|
+
depthLimit: 1
|
|
15144
|
+
}) || [];
|
|
15085
15145
|
}
|
|
15086
15146
|
getAllPrimaryKeysInsideGroup(groupKeys) {
|
|
15087
15147
|
const { groupDeepMap } = this.getConfig();
|
|
15088
15148
|
if (!groupKeys.length) {
|
|
15089
|
-
const topLevelKeys = groupDeepMap?.getKeysStartingWith([],
|
|
15149
|
+
const topLevelKeys = groupDeepMap?.getKeysStartingWith([], {
|
|
15150
|
+
excludeSelf: true,
|
|
15151
|
+
depthLimit: 1
|
|
15152
|
+
}) || [];
|
|
15090
15153
|
return topLevelKeys.map((groupKeys2) => this.getAllPrimaryKeysInsideGroup(groupKeys2)).flat();
|
|
15091
15154
|
}
|
|
15092
15155
|
const group2 = groupDeepMap?.get(groupKeys);
|
|
@@ -15292,7 +15355,9 @@ var RowSelectionState = class _RowSelectionState {
|
|
|
15292
15355
|
this.xcache();
|
|
15293
15356
|
return;
|
|
15294
15357
|
}
|
|
15295
|
-
const selectedKeys = this.selectedMap.getKeysStartingWith(groupKeys,
|
|
15358
|
+
const selectedKeys = this.selectedMap.getKeysStartingWith(groupKeys, {
|
|
15359
|
+
excludeSelf: true
|
|
15360
|
+
});
|
|
15296
15361
|
selectedKeys.forEach((groupKeys2) => {
|
|
15297
15362
|
this.selectedMap.delete(groupKeys2);
|
|
15298
15363
|
});
|
|
@@ -15318,10 +15383,9 @@ var RowSelectionState = class _RowSelectionState {
|
|
|
15318
15383
|
this.xcache();
|
|
15319
15384
|
return;
|
|
15320
15385
|
}
|
|
15321
|
-
const deselectedKeys = this.deselectedMap.getKeysStartingWith(
|
|
15322
|
-
|
|
15323
|
-
|
|
15324
|
-
);
|
|
15386
|
+
const deselectedKeys = this.deselectedMap.getKeysStartingWith(groupKeys, {
|
|
15387
|
+
excludeSelf: true
|
|
15388
|
+
});
|
|
15325
15389
|
deselectedKeys.forEach((groupKeys2) => {
|
|
15326
15390
|
this.deselectedMap.delete(groupKeys2);
|
|
15327
15391
|
});
|
|
@@ -15448,16 +15512,14 @@ var RowSelectionState = class _RowSelectionState {
|
|
|
15448
15512
|
if (groupKeys.length === this.getGroupByLength()) {
|
|
15449
15513
|
const selectionState = this.selectedMap.has(groupKeys) ? true : this.deselectedMap.has(groupKeys) ? false : parentSelected;
|
|
15450
15514
|
const totalCount = this.getGroupCount(groupKeys);
|
|
15451
|
-
let selectedCount2 = this.selectedMap.getKeysStartingWith(
|
|
15452
|
-
|
|
15453
|
-
|
|
15454
|
-
|
|
15455
|
-
|
|
15456
|
-
|
|
15457
|
-
|
|
15458
|
-
|
|
15459
|
-
1
|
|
15460
|
-
).length;
|
|
15515
|
+
let selectedCount2 = this.selectedMap.getKeysStartingWith(groupKeys, {
|
|
15516
|
+
excludeSelf: true,
|
|
15517
|
+
depthLimit: 1
|
|
15518
|
+
}).length;
|
|
15519
|
+
let deselectedCount2 = this.deselectedMap.getKeysStartingWith(groupKeys, {
|
|
15520
|
+
excludeSelf: true,
|
|
15521
|
+
depthLimit: 1
|
|
15522
|
+
}).length;
|
|
15461
15523
|
const notSpecifiedCount = totalCount - (selectedCount2 + deselectedCount2);
|
|
15462
15524
|
const result2 = {
|
|
15463
15525
|
selectedCount: selectedCount2 + (selectionState ? notSpecifiedCount : 0),
|
|
@@ -17012,6 +17074,26 @@ var TreeSelectionState = class _TreeSelectionState {
|
|
|
17012
17074
|
getTreeDeepMap() {
|
|
17013
17075
|
return this.getConfig().treeDeepMap;
|
|
17014
17076
|
}
|
|
17077
|
+
getSelectedLeafNodePaths(rootNodePath = [], treeDeepMap) {
|
|
17078
|
+
treeDeepMap = treeDeepMap || this.getConfig().treeDeepMap;
|
|
17079
|
+
const selectedLeafPaths = [];
|
|
17080
|
+
treeDeepMap.getLeafNodesStartingWith(rootNodePath, (pair) => {
|
|
17081
|
+
if (this.isNodeSelected(pair.keys)) {
|
|
17082
|
+
selectedLeafPaths.push(pair.keys);
|
|
17083
|
+
}
|
|
17084
|
+
});
|
|
17085
|
+
return selectedLeafPaths;
|
|
17086
|
+
}
|
|
17087
|
+
getDeselectedLeafNodePaths(rootNodePath = [], treeDeepMap) {
|
|
17088
|
+
treeDeepMap = treeDeepMap || this.getConfig().treeDeepMap;
|
|
17089
|
+
const deselectedLeafPaths = [];
|
|
17090
|
+
treeDeepMap.getLeafNodesStartingWith(rootNodePath, (pair) => {
|
|
17091
|
+
if (!this.isNodeSelected(pair.keys)) {
|
|
17092
|
+
deselectedLeafPaths.push(pair.keys);
|
|
17093
|
+
}
|
|
17094
|
+
});
|
|
17095
|
+
return deselectedLeafPaths;
|
|
17096
|
+
}
|
|
17015
17097
|
isLeafNode(nodePath) {
|
|
17016
17098
|
return !this.getTreeDeepMap().has(nodePath);
|
|
17017
17099
|
}
|
|
@@ -17109,7 +17191,9 @@ var TreeSelectionState = class _TreeSelectionState {
|
|
|
17109
17191
|
const leafCount = this.getLeafNodesCount(nodePath);
|
|
17110
17192
|
let currentSelectionState = this.isSelfSelected(nodePath);
|
|
17111
17193
|
const { selectionMap } = this;
|
|
17112
|
-
const childPaths = selectionMap.
|
|
17194
|
+
const childPaths = selectionMap.getKeysOfFirstChildOnEachBranchStartingWith(nodePath, {
|
|
17195
|
+
excludeSelf: true
|
|
17196
|
+
}).sort(shortestToLongest);
|
|
17113
17197
|
if (!childPaths.length) {
|
|
17114
17198
|
if (currentSelectionState !== null) {
|
|
17115
17199
|
const res2 = leafCount ? currentSelectionState : (
|
|
@@ -17298,6 +17382,52 @@ var TreeApiImpl = class {
|
|
|
17298
17382
|
this.actions = param.actions;
|
|
17299
17383
|
this.dataSourceApi = param.dataSourceApi;
|
|
17300
17384
|
}
|
|
17385
|
+
getSelectedLeafNodePaths(config) {
|
|
17386
|
+
const { treePaths } = this.getState();
|
|
17387
|
+
const treeSelectionState = config?.treeSelectionState || this.getState().treeSelectionState;
|
|
17388
|
+
if (!treeSelectionState) {
|
|
17389
|
+
return [];
|
|
17390
|
+
}
|
|
17391
|
+
return treeSelectionState.getSelectedLeafNodePaths(
|
|
17392
|
+
config?.rootNodePath,
|
|
17393
|
+
treePaths
|
|
17394
|
+
);
|
|
17395
|
+
}
|
|
17396
|
+
getDeselectedLeafNodePaths(config) {
|
|
17397
|
+
const { treePaths } = this.getState();
|
|
17398
|
+
const treeSelectionState = config?.treeSelectionState || this.getState().treeSelectionState;
|
|
17399
|
+
if (!treeSelectionState) {
|
|
17400
|
+
return [];
|
|
17401
|
+
}
|
|
17402
|
+
return treeSelectionState.getDeselectedLeafNodePaths(
|
|
17403
|
+
config?.rootNodePath,
|
|
17404
|
+
treePaths
|
|
17405
|
+
);
|
|
17406
|
+
}
|
|
17407
|
+
getSelectedLeafRowInfos(config) {
|
|
17408
|
+
const { treePaths } = this.getState();
|
|
17409
|
+
const treeSelectionState = config?.treeSelectionState || this.getState().treeSelectionState;
|
|
17410
|
+
if (!treePaths || !treeSelectionState) {
|
|
17411
|
+
return [];
|
|
17412
|
+
}
|
|
17413
|
+
const rootNodePath = config?.rootNodePath || [];
|
|
17414
|
+
const selectedLeafRowInfos = [];
|
|
17415
|
+
treePaths.getLeafNodesStartingWith(
|
|
17416
|
+
rootNodePath,
|
|
17417
|
+
(pair) => {
|
|
17418
|
+
if (treeSelectionState.isNodeSelected(pair.keys)) {
|
|
17419
|
+
const rowInfo = this.getRowInfoByPath(
|
|
17420
|
+
pair.keys
|
|
17421
|
+
);
|
|
17422
|
+
if (rowInfo) {
|
|
17423
|
+
selectedLeafRowInfos.push(rowInfo);
|
|
17424
|
+
}
|
|
17425
|
+
}
|
|
17426
|
+
},
|
|
17427
|
+
{ excludeSelf: true }
|
|
17428
|
+
);
|
|
17429
|
+
return selectedLeafRowInfos;
|
|
17430
|
+
}
|
|
17301
17431
|
get allRowsSelected() {
|
|
17302
17432
|
return this.getState().allRowsSelected;
|
|
17303
17433
|
}
|
|
@@ -20604,12 +20734,16 @@ function getMappedCallbacks() {
|
|
|
20604
20734
|
callbackParams: callbackParams2
|
|
20605
20735
|
};
|
|
20606
20736
|
}
|
|
20737
|
+
const dataSourceApi = state.__apiRef.current;
|
|
20738
|
+
const treeApi = dataSourceApi.treeApi;
|
|
20607
20739
|
const callbackParams = [
|
|
20608
20740
|
treeSelection2.getState(),
|
|
20609
20741
|
{
|
|
20742
|
+
treeSelectionState: treeSelection2,
|
|
20610
20743
|
selectionMode: "multi-row",
|
|
20611
20744
|
lastUpdatedNodePath: state.lastSelectionUpdatedNodePathRef.current,
|
|
20612
|
-
dataSourceApi
|
|
20745
|
+
dataSourceApi,
|
|
20746
|
+
treeApi
|
|
20613
20747
|
}
|
|
20614
20748
|
];
|
|
20615
20749
|
return {
|
|
@@ -25585,7 +25719,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
25585
25719
|
}
|
|
25586
25720
|
let valid2 = isValidLicense(licenseKey, {
|
|
25587
25721
|
publishedAt: 1624970570587,
|
|
25588
|
-
version: "7.2.
|
|
25722
|
+
version: "7.2.2"
|
|
25589
25723
|
});
|
|
25590
25724
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
25591
25725
|
return true;
|