@syncfusion/ej2-navigations 31.2.2 → 31.2.5

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.
Files changed (70) hide show
  1. package/README.md +11 -2
  2. package/dist/ej2-navigations.min.js +2 -2
  3. package/dist/ej2-navigations.umd.min.js +2 -2
  4. package/dist/ej2-navigations.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-navigations.es2015.js +44 -6
  6. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  7. package/dist/es6/ej2-navigations.es5.js +45 -6
  8. package/dist/es6/ej2-navigations.es5.js.map +1 -1
  9. package/dist/global/ej2-navigations.min.js +2 -2
  10. package/dist/global/ej2-navigations.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +6 -6
  13. package/src/breadcrumb/breadcrumb.js +4 -3
  14. package/src/treeview/treeview.d.ts +1 -0
  15. package/src/treeview/treeview.js +41 -3
  16. package/styles/bds-lite.css +0 -1
  17. package/styles/bds.css +0 -1
  18. package/styles/bootstrap-dark-lite.css +0 -1
  19. package/styles/bootstrap-dark.css +0 -1
  20. package/styles/bootstrap-lite.css +0 -1
  21. package/styles/bootstrap.css +0 -1
  22. package/styles/bootstrap4-lite.css +0 -1
  23. package/styles/bootstrap4.css +0 -1
  24. package/styles/bootstrap5-dark-lite.css +0 -1
  25. package/styles/bootstrap5-dark.css +0 -1
  26. package/styles/bootstrap5-lite.css +0 -1
  27. package/styles/bootstrap5.3-lite.css +0 -1
  28. package/styles/bootstrap5.3.css +0 -1
  29. package/styles/bootstrap5.css +0 -1
  30. package/styles/fabric-dark-lite.css +0 -1
  31. package/styles/fabric-dark.css +0 -1
  32. package/styles/fabric-lite.css +0 -1
  33. package/styles/fabric.css +0 -1
  34. package/styles/fluent-dark-lite.css +0 -1
  35. package/styles/fluent-dark.css +0 -1
  36. package/styles/fluent-lite.css +0 -1
  37. package/styles/fluent.css +0 -1
  38. package/styles/fluent2-lite.css +0 -1
  39. package/styles/fluent2.css +0 -1
  40. package/styles/highcontrast-light-lite.css +0 -1
  41. package/styles/highcontrast-light.css +0 -1
  42. package/styles/highcontrast-lite.css +0 -1
  43. package/styles/highcontrast.css +0 -1
  44. package/styles/material-dark-lite.css +0 -1
  45. package/styles/material-dark.css +0 -1
  46. package/styles/material-lite.css +0 -1
  47. package/styles/material.css +0 -1
  48. package/styles/tailwind-dark-lite.css +0 -1
  49. package/styles/tailwind-dark.css +0 -1
  50. package/styles/tailwind-lite.css +0 -1
  51. package/styles/tailwind.css +0 -1
  52. package/styles/treeview/_layout.scss +0 -3
  53. package/styles/treeview/bds.css +0 -1
  54. package/styles/treeview/bootstrap-dark.css +0 -1
  55. package/styles/treeview/bootstrap.css +0 -1
  56. package/styles/treeview/bootstrap4.css +0 -1
  57. package/styles/treeview/bootstrap5-dark.css +0 -1
  58. package/styles/treeview/bootstrap5.3.css +0 -1
  59. package/styles/treeview/bootstrap5.css +0 -1
  60. package/styles/treeview/fabric-dark.css +0 -1
  61. package/styles/treeview/fabric.css +0 -1
  62. package/styles/treeview/fluent-dark.css +0 -1
  63. package/styles/treeview/fluent.css +0 -1
  64. package/styles/treeview/fluent2.css +0 -1
  65. package/styles/treeview/highcontrast-light.css +0 -1
  66. package/styles/treeview/highcontrast.css +0 -1
  67. package/styles/treeview/material-dark.css +0 -1
  68. package/styles/treeview/material.css +0 -1
  69. package/styles/treeview/tailwind-dark.css +0 -1
  70. package/styles/treeview/tailwind.css +0 -1
@@ -11247,7 +11247,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11247
11247
  }
11248
11248
  this.changeState(node, 'check', null, true, true);
11249
11249
  }
11250
- else if (count === 0 && this.checkedNodes.length === 0) {
11250
+ else if (count === 0 && this.checkedNodes.length === 0 && indeterminate.length === 0) {
11251
11251
  this.changeState(node, 'uncheck', null, true, true);
11252
11252
  }
11253
11253
  }
@@ -11517,6 +11517,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11517
11517
  }
11518
11518
  };
11519
11519
  TreeView.prototype.ensureParentCheckState = function (element) {
11520
+ var _this = this;
11520
11521
  if (!isNullOrUndefined(element)) {
11521
11522
  if (element.classList.contains(ROOT)) {
11522
11523
  return;
@@ -11536,6 +11537,8 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11536
11537
  var dataUid_1 = element.getAttribute('data-uid');
11537
11538
  var rootNodeChecked_1 = true;
11538
11539
  var childNodeChecked_1 = false;
11540
+ var ChildNodeData = this.getAllChildNodes(this.DDTTreeData, dataUid_1);
11541
+ var selectedChildren_1 = 0;
11539
11542
  nodes.forEach(function (childNode) {
11540
11543
  if (childNode instanceof HTMLElement) {
11541
11544
  var ariaChecked = childNode.getAttribute('aria-checked');
@@ -11565,6 +11568,13 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11565
11568
  childItems = this.getChildNodes(this.DDTTreeData, dataUid_1);
11566
11569
  }
11567
11570
  count = childItems.length;
11571
+ ChildNodeData.forEach(function (child) {
11572
+ var childKey = String(child[_this.fields.id]);
11573
+ if (_this.checkedNodes.indexOf(childKey) !== -1 ||
11574
+ _this.OldCheckedData.some(function (oldNode) { return oldNode['parentID'] === childKey; })) {
11575
+ selectedChildren_1++;
11576
+ }
11577
+ });
11568
11578
  }
11569
11579
  if (this.autoCheck && this.showCheckBox && !(this.fields.dataSource instanceof DataManager)) {
11570
11580
  var selectedChildNodeDetails = this.getSelectedChildNodeDetails(dataUid_1);
@@ -11584,7 +11594,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11584
11594
  else if ((checkedCount > 0 && !parentNodeChecked && (this.autoCheck && this.showCheckBox))) {
11585
11595
  this.changeState(checkBoxEle, 'indeterminate', null, true, true);
11586
11596
  }
11587
- else if (checkedCount > 0 || indeterminateNodes.length > 0) {
11597
+ else if (checkedCount > 0 || indeterminateNodes.length > 0 || selectedChildren_1 > 0) {
11588
11598
  this.changeState(checkBoxEle, 'indeterminate', null, true, true);
11589
11599
  }
11590
11600
  else if (checkedCount === 0) {
@@ -11631,6 +11641,34 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11631
11641
  return false;
11632
11642
  });
11633
11643
  };
11644
+ TreeView.prototype.getAllChildNodes = function (data, parentId) {
11645
+ if (isNullOrUndefined(data) || isNullOrUndefined(parentId)) {
11646
+ return [];
11647
+ }
11648
+ if (this.dataType === 1) {
11649
+ var pidField_1 = this.fields.parentID;
11650
+ var target_1 = parentId.toString();
11651
+ return data.filter(function (item) {
11652
+ var pidVal = getValue(pidField_1, item);
11653
+ return !isNullOrUndefined(pidVal) && pidVal.toString() === target_1;
11654
+ });
11655
+ }
11656
+ if (this.dataType === 2) {
11657
+ var parentFieldId_1 = this.fields.id;
11658
+ var childField = this.fields.child.toString();
11659
+ var target_2 = parentId.toString();
11660
+ var node = data.find(function (n) {
11661
+ var idVal = getValue(parentFieldId_1, n);
11662
+ return !isNullOrUndefined(idVal) && idVal.toString() === target_2;
11663
+ });
11664
+ if (!node) {
11665
+ return [];
11666
+ }
11667
+ var children = getValue(childField, node);
11668
+ return Array.isArray(children) ? children : [];
11669
+ }
11670
+ return [];
11671
+ };
11634
11672
  TreeView.prototype.ensureChildCheckState = function (element, e, isFromExpandAll) {
11635
11673
  var _this = this;
11636
11674
  if (!isNullOrUndefined(element)) {
@@ -15842,7 +15880,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
15842
15880
  this.setNodeFocusable();
15843
15881
  }
15844
15882
  this.updateCheckedStateFromDS();
15845
- if (this.showCheckBox && dropLi) {
15883
+ if (this.showCheckBox && dropLi && this.autoCheck) {
15846
15884
  this.ensureParentCheckState(dropLi);
15847
15885
  }
15848
15886
  if ((this.fields.dataSource instanceof DataManager === false)) {
@@ -17410,6 +17448,10 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
17410
17448
  args.item.removeAttribute('role');
17411
17449
  if (isLastItem) {
17412
17450
  args.item.setAttribute('data-active-item', '');
17451
+ args.item.setAttribute('aria-current', 'page');
17452
+ }
17453
+ else {
17454
+ args.item.removeAttribute('aria-current');
17413
17455
  }
17414
17456
  if (!_this.itemTemplate) {
17415
17457
  _this.beforeItemRenderChanges(args.curData, eventArgs.item, args.item, containsRightIcon);
@@ -17601,9 +17643,6 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
17601
17643
  };
17602
17644
  Breadcrumb.prototype.beforeItemRenderChanges = function (prevItem, currItem, elem, isRightIcon) {
17603
17645
  var wrapElem = elem.querySelector('.e-anchor-wrap');
17604
- if (wrapElem) {
17605
- wrapElem.parentElement.setAttribute('aria-label', 'home');
17606
- }
17607
17646
  if (currItem.text !== prevItem.text && wrapElem) {
17608
17647
  wrapElem.childNodes.forEach(function (child) {
17609
17648
  if (child.nodeType === Node.TEXT_NODE) {