@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
@@ -10913,7 +10913,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
10913
10913
  }
10914
10914
  this.changeState(node, 'check', null, true, true);
10915
10915
  }
10916
- else if (count === 0 && this.checkedNodes.length === 0) {
10916
+ else if (count === 0 && this.checkedNodes.length === 0 && indeterminate.length === 0) {
10917
10917
  this.changeState(node, 'uncheck', null, true, true);
10918
10918
  }
10919
10919
  }
@@ -11201,6 +11201,8 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11201
11201
  const dataUid = element.getAttribute('data-uid');
11202
11202
  let rootNodeChecked = true;
11203
11203
  let childNodeChecked = false;
11204
+ const ChildNodeData = this.getAllChildNodes(this.DDTTreeData, dataUid);
11205
+ let selectedChildren = 0;
11204
11206
  nodes.forEach((childNode) => {
11205
11207
  if (childNode instanceof HTMLElement) {
11206
11208
  const ariaChecked = childNode.getAttribute('aria-checked');
@@ -11230,6 +11232,13 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11230
11232
  childItems = this.getChildNodes(this.DDTTreeData, dataUid);
11231
11233
  }
11232
11234
  count = childItems.length;
11235
+ ChildNodeData.forEach((child) => {
11236
+ const childKey = String(child[this.fields.id]);
11237
+ if (this.checkedNodes.indexOf(childKey) !== -1 ||
11238
+ this.OldCheckedData.some((oldNode) => oldNode['parentID'] === childKey)) {
11239
+ selectedChildren++;
11240
+ }
11241
+ });
11233
11242
  }
11234
11243
  if (this.autoCheck && this.showCheckBox && !(this.fields.dataSource instanceof DataManager)) {
11235
11244
  const selectedChildNodeDetails = this.getSelectedChildNodeDetails(dataUid);
@@ -11249,7 +11258,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11249
11258
  else if ((checkedCount > 0 && !parentNodeChecked && (this.autoCheck && this.showCheckBox))) {
11250
11259
  this.changeState(checkBoxEle, 'indeterminate', null, true, true);
11251
11260
  }
11252
- else if (checkedCount > 0 || indeterminateNodes.length > 0) {
11261
+ else if (checkedCount > 0 || indeterminateNodes.length > 0 || selectedChildren > 0) {
11253
11262
  this.changeState(checkBoxEle, 'indeterminate', null, true, true);
11254
11263
  }
11255
11264
  else if (checkedCount === 0) {
@@ -11295,6 +11304,34 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11295
11304
  return false;
11296
11305
  });
11297
11306
  }
11307
+ getAllChildNodes(data, parentId) {
11308
+ if (isNullOrUndefined(data) || isNullOrUndefined(parentId)) {
11309
+ return [];
11310
+ }
11311
+ if (this.dataType === 1) {
11312
+ const pidField = this.fields.parentID;
11313
+ const target = parentId.toString();
11314
+ return data.filter((item) => {
11315
+ const pidVal = getValue(pidField, item);
11316
+ return !isNullOrUndefined(pidVal) && pidVal.toString() === target;
11317
+ });
11318
+ }
11319
+ if (this.dataType === 2) {
11320
+ const parentFieldId = this.fields.id;
11321
+ const childField = this.fields.child.toString();
11322
+ const target = parentId.toString();
11323
+ const node = data.find((n) => {
11324
+ const idVal = getValue(parentFieldId, n);
11325
+ return !isNullOrUndefined(idVal) && idVal.toString() === target;
11326
+ });
11327
+ if (!node) {
11328
+ return [];
11329
+ }
11330
+ const children = getValue(childField, node);
11331
+ return Array.isArray(children) ? children : [];
11332
+ }
11333
+ return [];
11334
+ }
11298
11335
  ensureChildCheckState(element, e, isFromExpandAll) {
11299
11336
  if (!isNullOrUndefined(element)) {
11300
11337
  const childElement = select('.' + PARENTITEM, element);
@@ -15462,7 +15499,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
15462
15499
  this.setNodeFocusable();
15463
15500
  }
15464
15501
  this.updateCheckedStateFromDS();
15465
- if (this.showCheckBox && dropLi) {
15502
+ if (this.showCheckBox && dropLi && this.autoCheck) {
15466
15503
  this.ensureParentCheckState(dropLi);
15467
15504
  }
15468
15505
  if ((this.fields.dataSource instanceof DataManager === false)) {
@@ -16986,6 +17023,10 @@ let Breadcrumb = class Breadcrumb extends Component {
16986
17023
  args.item.removeAttribute('role');
16987
17024
  if (isLastItem) {
16988
17025
  args.item.setAttribute('data-active-item', '');
17026
+ args.item.setAttribute('aria-current', 'page');
17027
+ }
17028
+ else {
17029
+ args.item.removeAttribute('aria-current');
16989
17030
  }
16990
17031
  if (!this.itemTemplate) {
16991
17032
  this.beforeItemRenderChanges(args.curData, eventArgs.item, args.item, containsRightIcon);
@@ -17177,9 +17218,6 @@ let Breadcrumb = class Breadcrumb extends Component {
17177
17218
  }
17178
17219
  beforeItemRenderChanges(prevItem, currItem, elem, isRightIcon) {
17179
17220
  const wrapElem = elem.querySelector('.e-anchor-wrap');
17180
- if (wrapElem) {
17181
- wrapElem.parentElement.setAttribute('aria-label', 'home');
17182
- }
17183
17221
  if (currItem.text !== prevItem.text && wrapElem) {
17184
17222
  wrapElem.childNodes.forEach((child) => {
17185
17223
  if (child.nodeType === Node.TEXT_NODE) {