@syncfusion/ej2-navigations 28.2.11 → 28.2.12

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.
@@ -11028,8 +11028,8 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11028
11028
  const oldCheckedNodes = new DataManager(this.OldCheckedData).executeLocal(new Query().where('parentID', 'equal', dataUid, true));
11029
11029
  checkedCount = oldCheckedNodes.length;
11030
11030
  const parentNode = new DataManager(this.OldCheckedData).executeLocal(new Query().where('hasChildren', 'equal', true, true));
11031
- if (parentNode.length > 0
11032
- && (this.OldCheckedData.some((oldNode) => oldNode.id === dataUid) && childNodeChecked)) {
11031
+ if (parentNode.length > 0 && childNodeChecked && ((this.OldCheckedData.some((oldNode) => oldNode.id === dataUid)) ||
11032
+ this.parentNodeCheck.indexOf(dataUid) !== -1)) {
11033
11033
  checkedCount = parentNode.length;
11034
11034
  parentNodeChecked = true;
11035
11035
  }
@@ -11051,7 +11051,8 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11051
11051
  if (count === 0 && checkedCount === 0) {
11052
11052
  return;
11053
11053
  }
11054
- else if (count === checkedCount || ((parentNodeChecked && count > 0) && (oldChildCount.length === matchedChildNodes.length)
11054
+ else if (count === checkedCount || ((parentNodeChecked && count > 0) && ((oldChildCount.length === matchedChildNodes.length)
11055
+ || (oldChildCount.length !== matchedChildNodes.length))
11055
11056
  && (oldChildCount.length !== 0 && matchedChildNodes.length !== 0) && rootNodeChecked
11056
11057
  && (this.autoCheck && this.showCheckBox))) {
11057
11058
  this.changeState(checkBoxEle, 'check', null, true, true);
@@ -11076,25 +11077,31 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11076
11077
  const childKey = typeof this.fields.child === 'string' ? this.fields.child : null;
11077
11078
  const dataId = this.fields.id;
11078
11079
  const parentKey = this.fields.parentID;
11080
+ const matchesDataUid = (childNode) => {
11081
+ if (!isNullOrUndefined(childKey) && childKey in childNode && Array.isArray(childNode[childKey])) {
11082
+ const matchNode = childNode[dataId];
11083
+ if (!isNullOrUndefined(matchNode)) {
11084
+ return matchNode.toString() === dataUid;
11085
+ }
11086
+ }
11087
+ else {
11088
+ const childNodePid = childNode[parentKey];
11089
+ if (!isNullOrUndefined(childNodePid)) {
11090
+ return childNodePid.toString() === dataUid;
11091
+ }
11092
+ }
11093
+ return false;
11094
+ };
11079
11095
  return this.checkedNodes
11080
11096
  .map((checkedNodeId) => {
11081
- return new DataManager(this.DDTTreeData)
11082
- .executeLocal(new Query().where('id', 'equal', checkedNodeId, true))[0];
11097
+ return this.getNodeObject(checkedNodeId);
11083
11098
  })
11084
11099
  .filter((childNode) => {
11085
- if (childNode && typeof childNode === 'object' && (parentKey in childNode || childKey in childNode)) {
11086
- if (!isNullOrUndefined(childKey) && childKey in childNode && Array.isArray(childNode[childKey])) {
11087
- const matchNode = childNode[dataId];
11088
- if (!isNullOrUndefined(matchNode)) {
11089
- return matchNode.toString() === dataUid;
11090
- }
11091
- }
11092
- else {
11093
- const childNodePid = childNode[parentKey];
11094
- if (!isNullOrUndefined(childNodePid)) {
11095
- return childNodePid.toString() === dataUid;
11096
- }
11097
- }
11100
+ if (childNode && typeof childNode === 'object' && (childKey in childNode)) {
11101
+ return matchesDataUid(childNode);
11102
+ }
11103
+ else if (this.dataType !== 2 && typeof childNode === 'object' && (parentKey in childNode || childKey in childNode)) {
11104
+ return matchesDataUid(childNode);
11098
11105
  }
11099
11106
  return false;
11100
11107
  });