igniteui-angular 12.3.6 → 12.3.7
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/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
|
@@ -72699,7 +72699,7 @@
|
|
|
72699
72699
|
if (!parents.size) {
|
|
72700
72700
|
return;
|
|
72701
72701
|
}
|
|
72702
|
-
visibleRowIDs = this.getRowIDs(this.allData);
|
|
72702
|
+
visibleRowIDs = new Set(this.getRowIDs(this.allData));
|
|
72703
72703
|
this.rowsToBeSelected = new Set(this.rowSelection);
|
|
72704
72704
|
this.rowsToBeIndeterminate = new Set(this.indeterminateRows);
|
|
72705
72705
|
if (crudRowID) {
|
|
@@ -72794,8 +72794,10 @@
|
|
|
72794
72794
|
* retrieve the rows which should be added/removed to/from the old selection
|
|
72795
72795
|
*/
|
|
72796
72796
|
IgxTreeGridSelectionService.prototype.handleAddedAndRemovedArgs = function (args) {
|
|
72797
|
-
|
|
72798
|
-
|
|
72797
|
+
var newSelectionSet = new Set(args.newSelection);
|
|
72798
|
+
var oldSelectionSet = new Set(args.oldSelection);
|
|
72799
|
+
args.removed = args.oldSelection.filter(function (x) { return !newSelectionSet.has(x); });
|
|
72800
|
+
args.added = args.newSelection.filter(function (x) { return !oldSelectionSet.has(x); });
|
|
72799
72801
|
};
|
|
72800
72802
|
/**
|
|
72801
72803
|
* adds to rowsToBeProcessed set all visible children of the rows which was initially within the rowsToBeProcessed set
|
|
@@ -72804,15 +72806,16 @@
|
|
|
72804
72806
|
* @param visibleRowIDs list of all visible rowIds
|
|
72805
72807
|
* @returns a new set with all direct parents of the rows within rowsToBeProcessed set
|
|
72806
72808
|
*/
|
|
72807
|
-
IgxTreeGridSelectionService.prototype.collectRowsChildrenAndDirectParents = function (rowsToBeProcessed, visibleRowIDs) {
|
|
72809
|
+
IgxTreeGridSelectionService.prototype.collectRowsChildrenAndDirectParents = function (rowsToBeProcessed, visibleRowIDs, adding) {
|
|
72808
72810
|
var _this = this;
|
|
72809
72811
|
var processedRowsParents = new Set();
|
|
72810
72812
|
Array.from(rowsToBeProcessed).forEach(function (rowID) {
|
|
72813
|
+
_this.selectDeselectRow(rowID, adding);
|
|
72811
72814
|
var rowTreeRecord = _this.grid.gridAPI.get_rec_by_id(rowID);
|
|
72812
72815
|
var rowAndAllChildren = _this.get_all_children(rowTreeRecord);
|
|
72813
72816
|
rowAndAllChildren.forEach(function (row) {
|
|
72814
|
-
if (visibleRowIDs.
|
|
72815
|
-
|
|
72817
|
+
if (visibleRowIDs.has(row.rowID)) {
|
|
72818
|
+
_this.selectDeselectRow(row.rowID, adding);
|
|
72816
72819
|
}
|
|
72817
72820
|
});
|
|
72818
72821
|
if (rowTreeRecord && rowTreeRecord.parent) {
|
|
@@ -72829,27 +72832,19 @@
|
|
|
72829
72832
|
var _this = this;
|
|
72830
72833
|
this.rowsToBeSelected = new Set(args.oldSelection ? args.oldSelection : this.getSelectedRows());
|
|
72831
72834
|
this.rowsToBeIndeterminate = new Set(this.getIndeterminateRows());
|
|
72832
|
-
var visibleRowIDs = this.getRowIDs(this.allData);
|
|
72835
|
+
var visibleRowIDs = new Set(this.getRowIDs(this.allData));
|
|
72833
72836
|
var removed = new Set(args.removed);
|
|
72834
72837
|
var added = new Set(args.added);
|
|
72835
72838
|
if (removed && removed.size) {
|
|
72836
72839
|
var removedRowsParents = new Set();
|
|
72837
|
-
removedRowsParents = this.collectRowsChildrenAndDirectParents(removed, visibleRowIDs);
|
|
72838
|
-
removed.forEach(function (removedRow) {
|
|
72839
|
-
_this.rowsToBeSelected.delete(removedRow);
|
|
72840
|
-
_this.rowsToBeIndeterminate.delete(removedRow);
|
|
72841
|
-
});
|
|
72840
|
+
removedRowsParents = this.collectRowsChildrenAndDirectParents(removed, visibleRowIDs, false);
|
|
72842
72841
|
Array.from(removedRowsParents).forEach(function (parent) {
|
|
72843
72842
|
_this.handleParentSelectionState(parent, visibleRowIDs);
|
|
72844
72843
|
});
|
|
72845
72844
|
}
|
|
72846
72845
|
if (added && added.size) {
|
|
72847
72846
|
var addedRowsParents = new Set();
|
|
72848
|
-
addedRowsParents = this.collectRowsChildrenAndDirectParents(added, visibleRowIDs);
|
|
72849
|
-
added.forEach(function (addedRow) {
|
|
72850
|
-
_this.rowsToBeSelected.add(addedRow);
|
|
72851
|
-
_this.rowsToBeIndeterminate.delete(addedRow);
|
|
72852
|
-
});
|
|
72847
|
+
addedRowsParents = this.collectRowsChildrenAndDirectParents(added, visibleRowIDs, true);
|
|
72853
72848
|
Array.from(addedRowsParents).forEach(function (parent) {
|
|
72854
72849
|
_this.handleParentSelectionState(parent, visibleRowIDs);
|
|
72855
72850
|
});
|
|
@@ -72874,31 +72869,27 @@
|
|
|
72874
72869
|
var _this = this;
|
|
72875
72870
|
var visibleChildren = [];
|
|
72876
72871
|
if (treeRow && treeRow.children) {
|
|
72877
|
-
visibleChildren = treeRow.children.filter(function (child) { return visibleRowIDs.
|
|
72872
|
+
visibleChildren = treeRow.children.filter(function (child) { return visibleRowIDs.has(child.rowID); });
|
|
72878
72873
|
}
|
|
72879
72874
|
if (visibleChildren.length) {
|
|
72880
72875
|
if (visibleChildren.every(function (row) { return _this.rowsToBeSelected.has(row.rowID); })) {
|
|
72881
|
-
this.
|
|
72882
|
-
this.rowsToBeIndeterminate.delete(treeRow.rowID);
|
|
72876
|
+
this.selectDeselectRow(treeRow.rowID, true);
|
|
72883
72877
|
}
|
|
72884
72878
|
else if (visibleChildren.some(function (row) { return _this.rowsToBeSelected.has(row.rowID) || _this.rowsToBeIndeterminate.has(row.rowID); })) {
|
|
72885
72879
|
this.rowsToBeIndeterminate.add(treeRow.rowID);
|
|
72886
72880
|
this.rowsToBeSelected.delete(treeRow.rowID);
|
|
72887
72881
|
}
|
|
72888
72882
|
else {
|
|
72889
|
-
this.
|
|
72890
|
-
this.rowsToBeSelected.delete(treeRow.rowID);
|
|
72883
|
+
this.selectDeselectRow(treeRow.rowID, false);
|
|
72891
72884
|
}
|
|
72892
72885
|
}
|
|
72893
72886
|
else {
|
|
72894
72887
|
// if the children of the row has been deleted and the row was selected do not change its state
|
|
72895
72888
|
if (this.isRowSelected(treeRow.rowID)) {
|
|
72896
|
-
this.
|
|
72897
|
-
this.rowsToBeIndeterminate.delete(treeRow.rowID);
|
|
72889
|
+
this.selectDeselectRow(treeRow.rowID, true);
|
|
72898
72890
|
}
|
|
72899
72891
|
else {
|
|
72900
|
-
this.
|
|
72901
|
-
this.rowsToBeIndeterminate.delete(treeRow.rowID);
|
|
72892
|
+
this.selectDeselectRow(treeRow.rowID, false);
|
|
72902
72893
|
}
|
|
72903
72894
|
}
|
|
72904
72895
|
};
|
|
@@ -72923,6 +72914,16 @@
|
|
|
72923
72914
|
}
|
|
72924
72915
|
return children;
|
|
72925
72916
|
};
|
|
72917
|
+
IgxTreeGridSelectionService.prototype.selectDeselectRow = function (rowID, select) {
|
|
72918
|
+
if (select) {
|
|
72919
|
+
this.rowsToBeSelected.add(rowID);
|
|
72920
|
+
this.rowsToBeIndeterminate.delete(rowID);
|
|
72921
|
+
}
|
|
72922
|
+
else {
|
|
72923
|
+
this.rowsToBeSelected.delete(rowID);
|
|
72924
|
+
this.rowsToBeIndeterminate.delete(rowID);
|
|
72925
|
+
}
|
|
72926
|
+
};
|
|
72926
72927
|
return IgxTreeGridSelectionService;
|
|
72927
72928
|
}(IgxGridSelectionService));
|
|
72928
72929
|
IgxTreeGridSelectionService.decorators = [
|