@infinite-table/infinite-react 7.2.0 → 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 +180 -48
- package/index.dev.mjs +180 -48
- package/index.js +8 -8
- package/index.mjs +8 -8
- 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
|
}
|
|
@@ -6048,7 +6102,6 @@ var cursor = { pointer: "_16lm1iwk", "default": "_16lm1iwl", colResize: "_16lm1i
|
|
|
6048
6102
|
var display = { flex: "_16lm1iw1p", contents: "_16lm1iw1q", none: "_16lm1iw1r", block: "_16lm1iw1s", grid: "_16lm1iw1t", inlineBlock: "_16lm1iw1u", inlineFlex: "_16lm1iw1v", inlineGrid: "_16lm1iw1w" };
|
|
6049
6103
|
var flex = { "1": "_16lm1iw1c", none: "_16lm1iw1d" };
|
|
6050
6104
|
var flexFlow = { column: "_16lm1iw2f", columnReverse: "_16lm1iw2g", row: "_16lm1iw2h", rowReverse: "_16lm1iw2i" };
|
|
6051
|
-
var gap = { "0": "_16lm1iw2o", "1": "_16lm1iw2p", "2": "_16lm1iw2q", "3": "_16lm1iw2r", "4": "_16lm1iw2s", "5": "_16lm1iw2t", "6": "_16lm1iw2u", "7": "_16lm1iw2v", "8": "_16lm1iw2w", "9": "_16lm1iw2x", "10": "_16lm1iw2y", none: "_16lm1iw2z" };
|
|
6052
6105
|
var height = { "0": "_16lm1iw1y", "100%": "_16lm1iw1z", "50%": "_16lm1iw20" };
|
|
6053
6106
|
var justifyContent = { center: "_16lm1iw30", spaceBetween: "_16lm1iw31", spaceAround: "_16lm1iw32", start: "_16lm1iw33", end: "_16lm1iw34" };
|
|
6054
6107
|
var left = { "0": "_16lm1iw26", "100%": "_16lm1iw27", "50%": "_16lm1iw28", auto: "_16lm1iw29" };
|
|
@@ -12238,7 +12291,7 @@ var DragList = (props) => {
|
|
|
12238
12291
|
[DRAG_LIST_ATTRIBUTE]: props.dragListId
|
|
12239
12292
|
};
|
|
12240
12293
|
const children = typeof props.children === "function" ? props.children(domProps, contextValue) : props.children;
|
|
12241
|
-
return /* @__PURE__ */ React44.createElement(DragListContext, { value: contextValue }, children);
|
|
12294
|
+
return /* @__PURE__ */ React44.createElement(DragListContext.Provider, { value: contextValue }, children);
|
|
12242
12295
|
};
|
|
12243
12296
|
var DRAG_LIST_ATTRIBUTE = "data-drag-list-id";
|
|
12244
12297
|
var DRAG_ITEM_ATTRIBUTE = "data-drag-item-id";
|
|
@@ -14600,7 +14653,10 @@ function toTreeDataArray(data, options) {
|
|
|
14600
14653
|
treeMap.set(path, item);
|
|
14601
14654
|
}
|
|
14602
14655
|
function traverse(path, arr) {
|
|
14603
|
-
const nextLevelKeys = treeMap.getKeysStartingWith(path,
|
|
14656
|
+
const nextLevelKeys = treeMap.getKeysStartingWith(path, {
|
|
14657
|
+
excludeSelf: true,
|
|
14658
|
+
depthLimit: 1
|
|
14659
|
+
});
|
|
14604
14660
|
for (const nextLevelKey of nextLevelKeys) {
|
|
14605
14661
|
const p = [...path, nextLevelKey[nextLevelKey.length - 1]];
|
|
14606
14662
|
let item = treeMap.get(p);
|
|
@@ -15082,12 +15138,18 @@ var RowSelectionState = class _RowSelectionState {
|
|
|
15082
15138
|
}
|
|
15083
15139
|
getGroupKeysDirectlyInsideGroup(groupKeys) {
|
|
15084
15140
|
const { groupDeepMap } = this.getConfig();
|
|
15085
|
-
return groupDeepMap?.getKeysStartingWith(groupKeys,
|
|
15141
|
+
return groupDeepMap?.getKeysStartingWith(groupKeys, {
|
|
15142
|
+
excludeSelf: true,
|
|
15143
|
+
depthLimit: 1
|
|
15144
|
+
}) || [];
|
|
15086
15145
|
}
|
|
15087
15146
|
getAllPrimaryKeysInsideGroup(groupKeys) {
|
|
15088
15147
|
const { groupDeepMap } = this.getConfig();
|
|
15089
15148
|
if (!groupKeys.length) {
|
|
15090
|
-
const topLevelKeys = groupDeepMap?.getKeysStartingWith([],
|
|
15149
|
+
const topLevelKeys = groupDeepMap?.getKeysStartingWith([], {
|
|
15150
|
+
excludeSelf: true,
|
|
15151
|
+
depthLimit: 1
|
|
15152
|
+
}) || [];
|
|
15091
15153
|
return topLevelKeys.map((groupKeys2) => this.getAllPrimaryKeysInsideGroup(groupKeys2)).flat();
|
|
15092
15154
|
}
|
|
15093
15155
|
const group2 = groupDeepMap?.get(groupKeys);
|
|
@@ -15293,7 +15355,9 @@ var RowSelectionState = class _RowSelectionState {
|
|
|
15293
15355
|
this.xcache();
|
|
15294
15356
|
return;
|
|
15295
15357
|
}
|
|
15296
|
-
const selectedKeys = this.selectedMap.getKeysStartingWith(groupKeys,
|
|
15358
|
+
const selectedKeys = this.selectedMap.getKeysStartingWith(groupKeys, {
|
|
15359
|
+
excludeSelf: true
|
|
15360
|
+
});
|
|
15297
15361
|
selectedKeys.forEach((groupKeys2) => {
|
|
15298
15362
|
this.selectedMap.delete(groupKeys2);
|
|
15299
15363
|
});
|
|
@@ -15319,10 +15383,9 @@ var RowSelectionState = class _RowSelectionState {
|
|
|
15319
15383
|
this.xcache();
|
|
15320
15384
|
return;
|
|
15321
15385
|
}
|
|
15322
|
-
const deselectedKeys = this.deselectedMap.getKeysStartingWith(
|
|
15323
|
-
|
|
15324
|
-
|
|
15325
|
-
);
|
|
15386
|
+
const deselectedKeys = this.deselectedMap.getKeysStartingWith(groupKeys, {
|
|
15387
|
+
excludeSelf: true
|
|
15388
|
+
});
|
|
15326
15389
|
deselectedKeys.forEach((groupKeys2) => {
|
|
15327
15390
|
this.deselectedMap.delete(groupKeys2);
|
|
15328
15391
|
});
|
|
@@ -15449,16 +15512,14 @@ var RowSelectionState = class _RowSelectionState {
|
|
|
15449
15512
|
if (groupKeys.length === this.getGroupByLength()) {
|
|
15450
15513
|
const selectionState = this.selectedMap.has(groupKeys) ? true : this.deselectedMap.has(groupKeys) ? false : parentSelected;
|
|
15451
15514
|
const totalCount = this.getGroupCount(groupKeys);
|
|
15452
|
-
let selectedCount2 = this.selectedMap.getKeysStartingWith(
|
|
15453
|
-
|
|
15454
|
-
|
|
15455
|
-
|
|
15456
|
-
|
|
15457
|
-
|
|
15458
|
-
|
|
15459
|
-
|
|
15460
|
-
1
|
|
15461
|
-
).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;
|
|
15462
15523
|
const notSpecifiedCount = totalCount - (selectedCount2 + deselectedCount2);
|
|
15463
15524
|
const result2 = {
|
|
15464
15525
|
selectedCount: selectedCount2 + (selectionState ? notSpecifiedCount : 0),
|
|
@@ -17013,6 +17074,26 @@ var TreeSelectionState = class _TreeSelectionState {
|
|
|
17013
17074
|
getTreeDeepMap() {
|
|
17014
17075
|
return this.getConfig().treeDeepMap;
|
|
17015
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
|
+
}
|
|
17016
17097
|
isLeafNode(nodePath) {
|
|
17017
17098
|
return !this.getTreeDeepMap().has(nodePath);
|
|
17018
17099
|
}
|
|
@@ -17110,7 +17191,9 @@ var TreeSelectionState = class _TreeSelectionState {
|
|
|
17110
17191
|
const leafCount = this.getLeafNodesCount(nodePath);
|
|
17111
17192
|
let currentSelectionState = this.isSelfSelected(nodePath);
|
|
17112
17193
|
const { selectionMap } = this;
|
|
17113
|
-
const childPaths = selectionMap.
|
|
17194
|
+
const childPaths = selectionMap.getKeysOfFirstChildOnEachBranchStartingWith(nodePath, {
|
|
17195
|
+
excludeSelf: true
|
|
17196
|
+
}).sort(shortestToLongest);
|
|
17114
17197
|
if (!childPaths.length) {
|
|
17115
17198
|
if (currentSelectionState !== null) {
|
|
17116
17199
|
const res2 = leafCount ? currentSelectionState : (
|
|
@@ -17299,6 +17382,52 @@ var TreeApiImpl = class {
|
|
|
17299
17382
|
this.actions = param.actions;
|
|
17300
17383
|
this.dataSourceApi = param.dataSourceApi;
|
|
17301
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
|
+
}
|
|
17302
17431
|
get allRowsSelected() {
|
|
17303
17432
|
return this.getState().allRowsSelected;
|
|
17304
17433
|
}
|
|
@@ -20605,12 +20734,16 @@ function getMappedCallbacks() {
|
|
|
20605
20734
|
callbackParams: callbackParams2
|
|
20606
20735
|
};
|
|
20607
20736
|
}
|
|
20737
|
+
const dataSourceApi = state.__apiRef.current;
|
|
20738
|
+
const treeApi = dataSourceApi.treeApi;
|
|
20608
20739
|
const callbackParams = [
|
|
20609
20740
|
treeSelection2.getState(),
|
|
20610
20741
|
{
|
|
20742
|
+
treeSelectionState: treeSelection2,
|
|
20611
20743
|
selectionMode: "multi-row",
|
|
20612
20744
|
lastUpdatedNodePath: state.lastSelectionUpdatedNodePathRef.current,
|
|
20613
|
-
dataSourceApi
|
|
20745
|
+
dataSourceApi,
|
|
20746
|
+
treeApi
|
|
20614
20747
|
}
|
|
20615
20748
|
];
|
|
20616
20749
|
return {
|
|
@@ -25586,7 +25719,7 @@ var useLicense = (licenseKey = "") => {
|
|
|
25586
25719
|
}
|
|
25587
25720
|
let valid2 = isValidLicense(licenseKey, {
|
|
25588
25721
|
publishedAt: 1624970570587,
|
|
25589
|
-
version: "7.2.
|
|
25722
|
+
version: "7.2.2"
|
|
25590
25723
|
});
|
|
25591
25724
|
if (!licenseKey && !valid2 && isInsidePlayground) {
|
|
25592
25725
|
return true;
|
|
@@ -29407,7 +29540,7 @@ var import_react70 = require("react");
|
|
|
29407
29540
|
|
|
29408
29541
|
// src/components/InfiniteTable/components/GroupingToolbar/index.css.ts
|
|
29409
29542
|
var GroupingToolbarItemClearCls = "hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n";
|
|
29410
|
-
var GroupingToolbarItemRecipe = createRuntimeFn({ defaultClassName: "hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p
|
|
29543
|
+
var GroupingToolbarItemRecipe = createRuntimeFn({ defaultClassName: "hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p", variantClassNames: { active: { true: "hs68h8f _16lm1iwn _16lm1iw1h", false: "_16lm1iwo" }, draggingInProgress: { true: "hs68h8h", false: "hs68h8i" } }, defaultVariants: {}, compoundVariants: [] });
|
|
29411
29544
|
var GroupingToolbarPlaceholderCls = "hs68h81";
|
|
29412
29545
|
var GroupingToolbarRecipe = createRuntimeFn({ defaultClassName: "hs68h80 _16lm1iw1p", variantClassNames: { orientation: { horizontal: "_16lm1iw2h _16lm1iw2j", vertical: "_16lm1iw2f" }, draggingInProgress: { true: "_16lm1iw1h", false: "hs68h86" }, dropRejected: { true: "hs68h87", false: "hs68h88" }, active: { true: "hs68h89", false: "hs68h8a" } }, defaultVariants: {}, compoundVariants: [[{ dropRejected: true, active: true }, "hs68h8b"], [{ dropRejected: false, active: true }, "hs68h8c"], [{ active: false, dropRejected: false }, "hs68h8d"]] });
|
|
29413
29546
|
|
|
@@ -29427,7 +29560,7 @@ function GroupingToolbarItemDefault(props) {
|
|
|
29427
29560
|
props.onClear?.();
|
|
29428
29561
|
}
|
|
29429
29562
|
};
|
|
29430
|
-
return /* @__PURE__ */ React74.createElement("div", { ...props.domProps }, props.label, /* @__PURE__ */ React74.createElement(
|
|
29563
|
+
return /* @__PURE__ */ React74.createElement("div", { ...props.domProps }, props.label, /* @__PURE__ */ React74.createElement("div", { className: flex[1] }), /* @__PURE__ */ React74.createElement(
|
|
29431
29564
|
"div",
|
|
29432
29565
|
{
|
|
29433
29566
|
tabIndex: 0,
|
|
@@ -29487,7 +29620,7 @@ function GroupingToolbarItem(props) {
|
|
|
29487
29620
|
direction: column.computedSortedAsc ? 1 : column.computedSortedDesc ? -1 : 0
|
|
29488
29621
|
}
|
|
29489
29622
|
) : null;
|
|
29490
|
-
const header = /* @__PURE__ */ React75.createElement(
|
|
29623
|
+
const header = /* @__PURE__ */ React75.createElement(React75.Fragment, null, columnHeader, sortIcon);
|
|
29491
29624
|
const active = dragItemId === id && dragSourceListId === GROUPING_TOOLBAR_DRAG_LIST_ID;
|
|
29492
29625
|
const className = join(
|
|
29493
29626
|
GroupingToolbarItemRecipe({
|
|
@@ -29553,9 +29686,8 @@ function GroupingToolbar(props) {
|
|
|
29553
29686
|
}
|
|
29554
29687
|
},
|
|
29555
29688
|
onClear: () => {
|
|
29556
|
-
|
|
29557
|
-
|
|
29558
|
-
);
|
|
29689
|
+
const newGroupBy = groupBy.filter((g) => g !== group2).filter(Boolean);
|
|
29690
|
+
dataSourceApi.setGroupBy(newGroupBy);
|
|
29559
29691
|
}
|
|
29560
29692
|
}
|
|
29561
29693
|
);
|