@syncfusion/ej2-navigations 27.1.55 → 27.1.57

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 : 27.1.55
3
+ * version : 27.1.57
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. 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,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-navigations@*",
3
- "_id": "@syncfusion/ej2-navigations@27.1.53",
3
+ "_id": "@syncfusion/ej2-navigations@27.1.56",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-x30d0mBseMFXvbDeqlcOT8NH3AaqpgqCFCyQjYw1K3ncPN97y8waIrlt3d+cfp60Qno8zJ66mFguzb6BrMpYnA==",
5
+ "_integrity": "sha512-ZDAWdA6fBNMFkRYrcHpnXH2hWArR6H8bnNZjKUVMlNYtFip7BocpLDscSblqIUP6DQmnfX6TGKwb5Voai/KIMQ==",
6
6
  "_location": "/@syncfusion/ej2-navigations",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -40,8 +40,8 @@
40
40
  "/@syncfusion/ej2-spreadsheet",
41
41
  "/@syncfusion/ej2-vue-navigations"
42
42
  ],
43
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-27.1.53.tgz",
44
- "_shasum": "77edfe11e474e4d992b2f56aecdb6970e66d2ab0",
43
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-27.1.56.tgz",
44
+ "_shasum": "276263b5f6d2e6fdd2e161b7142b894edfb7cd53",
45
45
  "_spec": "@syncfusion/ej2-navigations@*",
46
46
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
47
47
  "author": {
@@ -57,7 +57,7 @@
57
57
  "@syncfusion/ej2-data": "~27.1.52",
58
58
  "@syncfusion/ej2-inputs": "~27.1.55",
59
59
  "@syncfusion/ej2-lists": "~27.1.50",
60
- "@syncfusion/ej2-popups": "~27.1.55"
60
+ "@syncfusion/ej2-popups": "~27.1.57"
61
61
  },
62
62
  "deprecated": false,
63
63
  "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",
@@ -162,6 +162,6 @@
162
162
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
163
163
  },
164
164
  "typings": "index.d.ts",
165
- "version": "27.1.55",
165
+ "version": "27.1.57",
166
166
  "sideEffects": false
167
167
  }
@@ -749,6 +749,11 @@ var Breadcrumb = /** @class */ (function (_super) {
749
749
  */
750
750
  Breadcrumb.prototype.destroy = function () {
751
751
  var _this = this;
752
+ if (this.popupObj && this.popupObj.element.classList.contains('e-popup-open')) {
753
+ this.popupObj.destroy();
754
+ this.isPopupCreated = false;
755
+ detach(this.popupObj.element);
756
+ }
752
757
  var classes = [];
753
758
  var attributes = ['aria-label'];
754
759
  if (this.cssClass) {
@@ -587,7 +587,8 @@ var Carousel = /** @class */ (function (_super) {
587
587
  this.applySlideInterval();
588
588
  };
589
589
  Carousel.prototype.autoSlideChange = function () {
590
- var activeSlide = this.element.querySelector("." + CLS_ACTIVE);
590
+ var activeSlide = this.element.querySelector("." + CLS_ITEM + "." + CLS_ACTIVE)
591
+ || this.element.querySelector("." + CLS_INDICATORS + " ." + CLS_ACTIVE);
591
592
  if (isNullOrUndefined(activeSlide)) {
592
593
  return;
593
594
  }
@@ -400,6 +400,9 @@ var Sidebar = /** @class */ (function (_super) {
400
400
  }
401
401
  };
402
402
  Sidebar.prototype.resize = function () {
403
+ if (!isNullOrUndefined(this.width) && this.width !== 'auto' && typeof this.width === 'string' && !this.width.includes('px')) {
404
+ this.setType(this.type);
405
+ }
403
406
  if (this.type === 'Auto') {
404
407
  if (Browser.isDevice) {
405
408
  addClass([this.element], OVER);
@@ -1064,6 +1064,7 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1064
1064
  private updateCheckedProp;
1065
1065
  private ensureIndeterminate;
1066
1066
  private ensureParentCheckState;
1067
+ private getSelectedChildNodeDetails;
1067
1068
  private ensureChildCheckState;
1068
1069
  private doCheckBoxAction;
1069
1070
  private updateFieldChecked;
@@ -1464,6 +1465,15 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1464
1465
  * @param {string | Element} target - Specifies the ID of TreeView node or TreeView node as target element.
1465
1466
  * @param {Object[]} newData - Specifies the new data of TreeView node.
1466
1467
  * @returns {void}
1468
+ * ```typescript
1469
+ * var treeObj = document.getElementById("treeview").ej2_instances[0];
1470
+ * var data = treeObj.getTreeData("01");
1471
+ * var newData = {
1472
+ * id: data[0].id,
1473
+ * name: "new Text",
1474
+ * };
1475
+ * treeObj.refreshNode("01", [newData]);
1476
+ * ```
1467
1477
  */
1468
1478
  refreshNode(target: string | Element, newData: {
1469
1479
  [key: string]: Object;
@@ -1476,7 +1486,7 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1476
1486
  */
1477
1487
  removeNodes(nodes: string[] | Element[]): void;
1478
1488
  /**
1479
- * Replaces the text of the TreeView node with the given text.
1489
+ * Replaces the text of the TreeView node with the given text only when the `allowEditing` property is enabled.
1480
1490
  *
1481
1491
  * @param {string | Element} target - Specifies ID of TreeView node/TreeView node as target element.
1482
1492
  * @param {string} newText - Specifies the new text of TreeView node.
@@ -998,13 +998,31 @@ var TreeView = /** @class */ (function (_super) {
998
998
  var checkBoxEle = element.getElementsByClassName(CHECKBOXWRAP)[0];
999
999
  var count = nodes.length;
1000
1000
  var checkedCount = checkedNodes.length;
1001
+ var matchedChildNodes = [];
1002
+ var oldChildCount = [];
1001
1003
  var dataUid_1 = element.getAttribute('data-uid');
1004
+ var rootNodeChecked_1 = true;
1005
+ var childNodeChecked_1 = false;
1006
+ nodes.forEach(function (childNode) {
1007
+ if (childNode instanceof HTMLElement) {
1008
+ var ariaChecked = childNode.getAttribute('aria-checked');
1009
+ if (ariaChecked === 'true') {
1010
+ childNodeChecked_1 = true;
1011
+ }
1012
+ else {
1013
+ rootNodeChecked_1 = false;
1014
+ }
1015
+ }
1016
+ });
1017
+ var parentNodeChecked = false;
1002
1018
  if (this.element.classList.contains('e-filtering')) {
1003
1019
  var oldCheckedNodes = new DataManager(this.OldCheckedData).executeLocal(new Query().where('parentID', 'equal', dataUid_1, true));
1004
1020
  checkedCount = oldCheckedNodes.length;
1005
1021
  var parentNode = new DataManager(this.OldCheckedData).executeLocal(new Query().where('hasChildren', 'equal', true, true));
1006
- if ((parentNode.length > 0) && (this.OldCheckedData.some(function (oldNode) { return oldNode.id === dataUid_1; }))) {
1022
+ if (parentNode.length > 0
1023
+ && (this.OldCheckedData.some(function (oldNode) { return oldNode.id === dataUid_1; }) && childNodeChecked_1)) {
1007
1024
  checkedCount = parentNode.length;
1025
+ parentNodeChecked = true;
1008
1026
  }
1009
1027
  var childItems = [];
1010
1028
  if (this.dataType === 1) {
@@ -1015,12 +1033,23 @@ var TreeView = /** @class */ (function (_super) {
1015
1033
  }
1016
1034
  count = childItems.length;
1017
1035
  }
1036
+ if (this.autoCheck && this.showCheckBox) {
1037
+ var selectedChildNodeDetails = this.getSelectedChildNodeDetails(dataUid_1);
1038
+ matchedChildNodes = selectedChildNodeDetails;
1039
+ oldChildCount = new DataManager(this.checkActionNodes)
1040
+ .executeLocal(new Query().where('parentID', 'equal', dataUid_1, true));
1041
+ }
1018
1042
  if (count === 0 && checkedCount === 0) {
1019
1043
  return;
1020
1044
  }
1021
- else if (count === checkedCount) {
1045
+ else if (count === checkedCount || ((parentNodeChecked && count > 0) && (oldChildCount.length === matchedChildNodes.length)
1046
+ && (oldChildCount.length !== 0 && matchedChildNodes.length !== 0) && rootNodeChecked_1
1047
+ && (this.autoCheck && this.showCheckBox))) {
1022
1048
  this.changeState(checkBoxEle, 'check', null, true, true);
1023
1049
  }
1050
+ else if ((checkedCount > 0 && !parentNodeChecked && (this.autoCheck && this.showCheckBox))) {
1051
+ this.changeState(checkBoxEle, 'indeterminate', null, true, true);
1052
+ }
1024
1053
  else if (checkedCount > 0 || indeterminateNodes.length > 0) {
1025
1054
  this.changeState(checkBoxEle, 'indeterminate', null, true, true);
1026
1055
  }
@@ -1034,6 +1063,21 @@ var TreeView = /** @class */ (function (_super) {
1034
1063
  }
1035
1064
  }
1036
1065
  };
1066
+ TreeView.prototype.getSelectedChildNodeDetails = function (dataUid) {
1067
+ var _this = this;
1068
+ return this.checkedNodes
1069
+ .map(function (checkedNodeId) {
1070
+ return new DataManager(_this.DDTTreeData)
1071
+ .executeLocal(new Query().where('id', 'equal', checkedNodeId, true))[0];
1072
+ })
1073
+ .filter(function (childNode) {
1074
+ if (childNode && typeof childNode === 'object' && 'pid' in childNode) {
1075
+ var childNodePid = childNode.pid;
1076
+ return childNodePid.toString() === dataUid;
1077
+ }
1078
+ return false;
1079
+ });
1080
+ };
1037
1081
  TreeView.prototype.ensureChildCheckState = function (element, e, isFromExpandAll) {
1038
1082
  if (!isNOU(element)) {
1039
1083
  var childElement = select('.' + PARENTITEM, element);
@@ -1665,6 +1709,7 @@ var TreeView = /** @class */ (function (_super) {
1665
1709
  this.trigger('nodeChecked', eventArgs);
1666
1710
  };
1667
1711
  TreeView.prototype.updateOldCheckedData = function (data) {
1712
+ var _this = this;
1668
1713
  var dataManager = new DataManager(data);
1669
1714
  var childItems = dataManager.executeLocal(new Query().where('isChecked', 'equal', 'true', true));
1670
1715
  var uncheckedItems = dataManager.executeLocal(new Query().where('isChecked', 'equal', 'false', true));
@@ -1672,6 +1717,15 @@ var TreeView = /** @class */ (function (_super) {
1672
1717
  var index = this.OldCheckedData.findIndex(function (e) { return e['id'] === uncheckedItems[0]['id']; });
1673
1718
  if (index !== -1) {
1674
1719
  this.OldCheckedData.splice(index, 1);
1720
+ var childNodes = this.OldCheckedData.filter(function (e) { return e['parentID'] === uncheckedItems[0]['id']; });
1721
+ if (childNodes.length > 0) {
1722
+ childNodes.forEach(function (child) {
1723
+ var childIndex = _this.OldCheckedData.findIndex(function (e) { return e['id'] === child.id; });
1724
+ if (childIndex !== -1) {
1725
+ _this.OldCheckedData.splice(childIndex, 1);
1726
+ }
1727
+ });
1728
+ }
1675
1729
  return;
1676
1730
  }
1677
1731
  }
@@ -5094,6 +5148,12 @@ var TreeView = /** @class */ (function (_super) {
5094
5148
  for (var i = 0; i < nodes.length; i++) {
5095
5149
  var pid = getValue(this.fields.parentID, nodes[parseInt(i.toString(), 10)]);
5096
5150
  dropLi = pid ? this.getElement(pid.toString()) : pid;
5151
+ if (!isNullOrUndefined(pid) && isNullOrUndefined(dropLi)) {
5152
+ this.preventExpand = false;
5153
+ this.ensureVisible(pid);
5154
+ this.preventExpand = preventTargetExpand;
5155
+ dropLi = this.getElement(pid.toString());
5156
+ }
5097
5157
  this.addGivenNodes([nodes[parseInt(i.toString(), 10)]], dropLi, index);
5098
5158
  }
5099
5159
  }
@@ -5325,6 +5385,15 @@ var TreeView = /** @class */ (function (_super) {
5325
5385
  * @param {string | Element} target - Specifies the ID of TreeView node or TreeView node as target element.
5326
5386
  * @param {Object[]} newData - Specifies the new data of TreeView node.
5327
5387
  * @returns {void}
5388
+ * ```typescript
5389
+ * var treeObj = document.getElementById("treeview").ej2_instances[0];
5390
+ * var data = treeObj.getTreeData("01");
5391
+ * var newData = {
5392
+ * id: data[0].id,
5393
+ * name: "new Text",
5394
+ * };
5395
+ * treeObj.refreshNode("01", [newData]);
5396
+ * ```
5328
5397
  */
5329
5398
  TreeView.prototype.refreshNode = function (target, newData) {
5330
5399
  if (isNOU(target) || isNOU(newData)) {
@@ -5440,7 +5509,7 @@ var TreeView = /** @class */ (function (_super) {
5440
5509
  }
5441
5510
  };
5442
5511
  /**
5443
- * Replaces the text of the TreeView node with the given text.
5512
+ * Replaces the text of the TreeView node with the given text only when the `allowEditing` property is enabled.
5444
5513
  *
5445
5514
  * @param {string | Element} target - Specifies ID of TreeView node/TreeView node as target element.
5446
5515
  * @param {string} newText - Specifies the new text of TreeView node.