igniteui-angular 11.1.36 → 11.1.37
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/bundles/igniteui-angular.umd.js +27 -26
- package/bundles/igniteui-angular.umd.js.map +1 -1
- package/bundles/igniteui-angular.umd.min.js +1 -1
- package/bundles/igniteui-angular.umd.min.js.map +1 -1
- package/esm2015/lib/grids/tree-grid/tree-grid-selection.service.js +28 -27
- package/fesm2015/igniteui-angular.js +27 -26
- package/fesm2015/igniteui-angular.js.map +1 -1
- package/igniteui-angular.metadata.json +1 -1
- package/lib/grids/tree-grid/tree-grid-selection.service.d.ts +2 -1
- package/package.json +1 -1
|
@@ -66306,7 +66306,7 @@
|
|
|
66306
66306
|
if (!parents.size) {
|
|
66307
66307
|
return;
|
|
66308
66308
|
}
|
|
66309
|
-
visibleRowIDs = this.getRowIDs(this.allData);
|
|
66309
|
+
visibleRowIDs = new Set(this.getRowIDs(this.allData));
|
|
66310
66310
|
this.rowsToBeSelected = new Set(this.rowSelection);
|
|
66311
66311
|
this.rowsToBeIndeterminate = new Set(this.indeterminateRows);
|
|
66312
66312
|
if (crudRowID) {
|
|
@@ -66399,8 +66399,10 @@
|
|
|
66399
66399
|
* retrieve the rows which should be added/removed to/from the old selection
|
|
66400
66400
|
*/
|
|
66401
66401
|
IgxTreeGridSelectionService.prototype.handleAddedAndRemovedArgs = function (args) {
|
|
66402
|
-
|
|
66403
|
-
|
|
66402
|
+
var newSelectionSet = new Set(args.newSelection);
|
|
66403
|
+
var oldSelectionSet = new Set(args.oldSelection);
|
|
66404
|
+
args.removed = args.oldSelection.filter(function (x) { return !newSelectionSet.has(x); });
|
|
66405
|
+
args.added = args.newSelection.filter(function (x) { return !oldSelectionSet.has(x); });
|
|
66404
66406
|
};
|
|
66405
66407
|
/**
|
|
66406
66408
|
* adds to rowsToBeProcessed set all visible children of the rows which was initially within the rowsToBeProcessed set
|
|
@@ -66409,15 +66411,16 @@
|
|
|
66409
66411
|
* @param visibleRowIDs list of all visible rowIds
|
|
66410
66412
|
* @returns a new set with all direct parents of the rows within rowsToBeProcessed set
|
|
66411
66413
|
*/
|
|
66412
|
-
IgxTreeGridSelectionService.prototype.collectRowsChildrenAndDirectParents = function (rowsToBeProcessed, visibleRowIDs) {
|
|
66414
|
+
IgxTreeGridSelectionService.prototype.collectRowsChildrenAndDirectParents = function (rowsToBeProcessed, visibleRowIDs, adding) {
|
|
66413
66415
|
var _this = this;
|
|
66414
66416
|
var processedRowsParents = new Set();
|
|
66415
66417
|
Array.from(rowsToBeProcessed).forEach(function (rowID) {
|
|
66418
|
+
_this.selectDeselectRow(rowID, adding);
|
|
66416
66419
|
var rowTreeRecord = _this.grid.gridAPI.get_rec_by_id(rowID);
|
|
66417
66420
|
var rowAndAllChildren = _this.get_all_children(rowTreeRecord);
|
|
66418
66421
|
rowAndAllChildren.forEach(function (row) {
|
|
66419
|
-
if (visibleRowIDs.
|
|
66420
|
-
|
|
66422
|
+
if (visibleRowIDs.has(row.rowID)) {
|
|
66423
|
+
_this.selectDeselectRow(row.rowID, adding);
|
|
66421
66424
|
}
|
|
66422
66425
|
});
|
|
66423
66426
|
if (rowTreeRecord && rowTreeRecord.parent) {
|
|
@@ -66434,27 +66437,19 @@
|
|
|
66434
66437
|
var _this = this;
|
|
66435
66438
|
this.rowsToBeSelected = new Set(args.oldSelection ? args.oldSelection : this.getSelectedRows());
|
|
66436
66439
|
this.rowsToBeIndeterminate = new Set(this.getIndeterminateRows());
|
|
66437
|
-
var visibleRowIDs = this.getRowIDs(this.allData);
|
|
66440
|
+
var visibleRowIDs = new Set(this.getRowIDs(this.allData));
|
|
66438
66441
|
var removed = new Set(args.removed);
|
|
66439
66442
|
var added = new Set(args.added);
|
|
66440
66443
|
if (removed && removed.size) {
|
|
66441
66444
|
var removedRowsParents = new Set();
|
|
66442
|
-
removedRowsParents = this.collectRowsChildrenAndDirectParents(removed, visibleRowIDs);
|
|
66443
|
-
removed.forEach(function (removedRow) {
|
|
66444
|
-
_this.rowsToBeSelected.delete(removedRow);
|
|
66445
|
-
_this.rowsToBeIndeterminate.delete(removedRow);
|
|
66446
|
-
});
|
|
66445
|
+
removedRowsParents = this.collectRowsChildrenAndDirectParents(removed, visibleRowIDs, false);
|
|
66447
66446
|
Array.from(removedRowsParents).forEach(function (parent) {
|
|
66448
66447
|
_this.handleParentSelectionState(parent, visibleRowIDs);
|
|
66449
66448
|
});
|
|
66450
66449
|
}
|
|
66451
66450
|
if (added && added.size) {
|
|
66452
66451
|
var addedRowsParents = new Set();
|
|
66453
|
-
addedRowsParents = this.collectRowsChildrenAndDirectParents(added, visibleRowIDs);
|
|
66454
|
-
added.forEach(function (addedRow) {
|
|
66455
|
-
_this.rowsToBeSelected.add(addedRow);
|
|
66456
|
-
_this.rowsToBeIndeterminate.delete(addedRow);
|
|
66457
|
-
});
|
|
66452
|
+
addedRowsParents = this.collectRowsChildrenAndDirectParents(added, visibleRowIDs, true);
|
|
66458
66453
|
Array.from(addedRowsParents).forEach(function (parent) {
|
|
66459
66454
|
_this.handleParentSelectionState(parent, visibleRowIDs);
|
|
66460
66455
|
});
|
|
@@ -66479,31 +66474,27 @@
|
|
|
66479
66474
|
var _this = this;
|
|
66480
66475
|
var visibleChildren = [];
|
|
66481
66476
|
if (treeRow && treeRow.children) {
|
|
66482
|
-
visibleChildren = treeRow.children.filter(function (child) { return visibleRowIDs.
|
|
66477
|
+
visibleChildren = treeRow.children.filter(function (child) { return visibleRowIDs.has(child.rowID); });
|
|
66483
66478
|
}
|
|
66484
66479
|
if (visibleChildren.length) {
|
|
66485
66480
|
if (visibleChildren.every(function (row) { return _this.rowsToBeSelected.has(row.rowID); })) {
|
|
66486
|
-
this.
|
|
66487
|
-
this.rowsToBeIndeterminate.delete(treeRow.rowID);
|
|
66481
|
+
this.selectDeselectRow(treeRow.rowID, true);
|
|
66488
66482
|
}
|
|
66489
66483
|
else if (visibleChildren.some(function (row) { return _this.rowsToBeSelected.has(row.rowID) || _this.rowsToBeIndeterminate.has(row.rowID); })) {
|
|
66490
66484
|
this.rowsToBeIndeterminate.add(treeRow.rowID);
|
|
66491
66485
|
this.rowsToBeSelected.delete(treeRow.rowID);
|
|
66492
66486
|
}
|
|
66493
66487
|
else {
|
|
66494
|
-
this.
|
|
66495
|
-
this.rowsToBeSelected.delete(treeRow.rowID);
|
|
66488
|
+
this.selectDeselectRow(treeRow.rowID, false);
|
|
66496
66489
|
}
|
|
66497
66490
|
}
|
|
66498
66491
|
else {
|
|
66499
66492
|
// if the children of the row has been deleted and the row was selected do not change its state
|
|
66500
66493
|
if (this.isRowSelected(treeRow.rowID)) {
|
|
66501
|
-
this.
|
|
66502
|
-
this.rowsToBeIndeterminate.delete(treeRow.rowID);
|
|
66494
|
+
this.selectDeselectRow(treeRow.rowID, true);
|
|
66503
66495
|
}
|
|
66504
66496
|
else {
|
|
66505
|
-
this.
|
|
66506
|
-
this.rowsToBeIndeterminate.delete(treeRow.rowID);
|
|
66497
|
+
this.selectDeselectRow(treeRow.rowID, false);
|
|
66507
66498
|
}
|
|
66508
66499
|
}
|
|
66509
66500
|
};
|
|
@@ -66528,6 +66519,16 @@
|
|
|
66528
66519
|
}
|
|
66529
66520
|
return children;
|
|
66530
66521
|
};
|
|
66522
|
+
IgxTreeGridSelectionService.prototype.selectDeselectRow = function (rowID, select) {
|
|
66523
|
+
if (select) {
|
|
66524
|
+
this.rowsToBeSelected.add(rowID);
|
|
66525
|
+
this.rowsToBeIndeterminate.delete(rowID);
|
|
66526
|
+
}
|
|
66527
|
+
else {
|
|
66528
|
+
this.rowsToBeSelected.delete(rowID);
|
|
66529
|
+
this.rowsToBeIndeterminate.delete(rowID);
|
|
66530
|
+
}
|
|
66531
|
+
};
|
|
66531
66532
|
return IgxTreeGridSelectionService;
|
|
66532
66533
|
}(IgxGridSelectionService));
|
|
66533
66534
|
IgxTreeGridSelectionService.decorators = [
|