@syncfusion/ej2-navigations 31.2.2 → 31.2.3

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 31.2.2
3
+ * version : 31.2.3
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-navigations",
3
- "version": "31.2.2",
3
+ "version": "31.2.3",
4
4
  "description": "A package of Essential JS 2 navigation components such as Tree-view, Tab, Toolbar, Context-menu, and Accordion which is used to navigate from one page to another",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -9,8 +9,8 @@
9
9
  "es2015": "./dist/es6/ej2-navigations.es5.js",
10
10
  "dependencies": {
11
11
  "@syncfusion/ej2-base": "~31.2.2",
12
- "@syncfusion/ej2-buttons": "~31.2.2",
13
- "@syncfusion/ej2-data": "~31.2.2",
12
+ "@syncfusion/ej2-buttons": "~31.2.3",
13
+ "@syncfusion/ej2-data": "~31.2.3",
14
14
  "@syncfusion/ej2-inputs": "~31.2.2",
15
15
  "@syncfusion/ej2-lists": "~31.2.2",
16
16
  "@syncfusion/ej2-popups": "~31.2.2"
@@ -282,6 +282,10 @@ var Breadcrumb = /** @class */ (function (_super) {
282
282
  args.item.removeAttribute('role');
283
283
  if (isLastItem) {
284
284
  args.item.setAttribute('data-active-item', '');
285
+ args.item.setAttribute('aria-current', 'page');
286
+ }
287
+ else {
288
+ args.item.removeAttribute('aria-current');
285
289
  }
286
290
  if (!_this.itemTemplate) {
287
291
  _this.beforeItemRenderChanges(args.curData, eventArgs.item, args.item, containsRightIcon);
@@ -473,9 +477,6 @@ var Breadcrumb = /** @class */ (function (_super) {
473
477
  };
474
478
  Breadcrumb.prototype.beforeItemRenderChanges = function (prevItem, currItem, elem, isRightIcon) {
475
479
  var wrapElem = elem.querySelector('.e-anchor-wrap');
476
- if (wrapElem) {
477
- wrapElem.parentElement.setAttribute('aria-label', 'home');
478
- }
479
480
  if (currItem.text !== prevItem.text && wrapElem) {
480
481
  wrapElem.childNodes.forEach(function (child) {
481
482
  if (child.nodeType === Node.TEXT_NODE) {
@@ -1075,6 +1075,7 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1075
1075
  private ensureIndeterminate;
1076
1076
  private ensureParentCheckState;
1077
1077
  private getSelectedChildNodeDetails;
1078
+ private getAllChildNodes;
1078
1079
  private ensureChildCheckState;
1079
1080
  private doCheckBoxAction;
1080
1081
  private updateFieldChecked;
@@ -716,7 +716,7 @@ var TreeView = /** @class */ (function (_super) {
716
716
  }
717
717
  this.changeState(node, 'check', null, true, true);
718
718
  }
719
- else if (count === 0 && this.checkedNodes.length === 0) {
719
+ else if (count === 0 && this.checkedNodes.length === 0 && indeterminate.length === 0) {
720
720
  this.changeState(node, 'uncheck', null, true, true);
721
721
  }
722
722
  }
@@ -986,6 +986,7 @@ var TreeView = /** @class */ (function (_super) {
986
986
  }
987
987
  };
988
988
  TreeView.prototype.ensureParentCheckState = function (element) {
989
+ var _this = this;
989
990
  if (!isNOU(element)) {
990
991
  if (element.classList.contains(ROOT)) {
991
992
  return;
@@ -1005,6 +1006,8 @@ var TreeView = /** @class */ (function (_super) {
1005
1006
  var dataUid_1 = element.getAttribute('data-uid');
1006
1007
  var rootNodeChecked_1 = true;
1007
1008
  var childNodeChecked_1 = false;
1009
+ var ChildNodeData = this.getAllChildNodes(this.DDTTreeData, dataUid_1);
1010
+ var selectedChildren_1 = 0;
1008
1011
  nodes.forEach(function (childNode) {
1009
1012
  if (childNode instanceof HTMLElement) {
1010
1013
  var ariaChecked = childNode.getAttribute('aria-checked');
@@ -1034,6 +1037,13 @@ var TreeView = /** @class */ (function (_super) {
1034
1037
  childItems = this.getChildNodes(this.DDTTreeData, dataUid_1);
1035
1038
  }
1036
1039
  count = childItems.length;
1040
+ ChildNodeData.forEach(function (child) {
1041
+ var childKey = String(child[_this.fields.id]);
1042
+ if (_this.checkedNodes.indexOf(childKey) !== -1 ||
1043
+ _this.OldCheckedData.some(function (oldNode) { return oldNode['parentID'] === childKey; })) {
1044
+ selectedChildren_1++;
1045
+ }
1046
+ });
1037
1047
  }
1038
1048
  if (this.autoCheck && this.showCheckBox && !(this.fields.dataSource instanceof DataManager)) {
1039
1049
  var selectedChildNodeDetails = this.getSelectedChildNodeDetails(dataUid_1);
@@ -1053,7 +1063,7 @@ var TreeView = /** @class */ (function (_super) {
1053
1063
  else if ((checkedCount > 0 && !parentNodeChecked && (this.autoCheck && this.showCheckBox))) {
1054
1064
  this.changeState(checkBoxEle, 'indeterminate', null, true, true);
1055
1065
  }
1056
- else if (checkedCount > 0 || indeterminateNodes.length > 0) {
1066
+ else if (checkedCount > 0 || indeterminateNodes.length > 0 || selectedChildren_1 > 0) {
1057
1067
  this.changeState(checkBoxEle, 'indeterminate', null, true, true);
1058
1068
  }
1059
1069
  else if (checkedCount === 0) {
@@ -1100,6 +1110,34 @@ var TreeView = /** @class */ (function (_super) {
1100
1110
  return false;
1101
1111
  });
1102
1112
  };
1113
+ TreeView.prototype.getAllChildNodes = function (data, parentId) {
1114
+ if (isNOU(data) || isNOU(parentId)) {
1115
+ return [];
1116
+ }
1117
+ if (this.dataType === 1) {
1118
+ var pidField_1 = this.fields.parentID;
1119
+ var target_1 = parentId.toString();
1120
+ return data.filter(function (item) {
1121
+ var pidVal = getValue(pidField_1, item);
1122
+ return !isNOU(pidVal) && pidVal.toString() === target_1;
1123
+ });
1124
+ }
1125
+ if (this.dataType === 2) {
1126
+ var parentFieldId_1 = this.fields.id;
1127
+ var childField = this.fields.child.toString();
1128
+ var target_2 = parentId.toString();
1129
+ var node = data.find(function (n) {
1130
+ var idVal = getValue(parentFieldId_1, n);
1131
+ return !isNOU(idVal) && idVal.toString() === target_2;
1132
+ });
1133
+ if (!node) {
1134
+ return [];
1135
+ }
1136
+ var children = getValue(childField, node);
1137
+ return Array.isArray(children) ? children : [];
1138
+ }
1139
+ return [];
1140
+ };
1103
1141
  TreeView.prototype.ensureChildCheckState = function (element, e, isFromExpandAll) {
1104
1142
  var _this = this;
1105
1143
  if (!isNOU(element)) {