@syncfusion/ej2-navigations 27.2.2 → 27.2.4

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.2.2
3
+ * version : 27.2.4
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.58",
3
+ "_id": "@syncfusion/ej2-navigations@27.2.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-NuGUkRUegiDf3K1JwEmZA5KTRuPPBQef7sVWP+qlW9nJuyckRl7gzgOgQ9yzbx+nakva45vcCB+KzpImZy6yGw==",
5
+ "_integrity": "sha512-FgzR7jNetZ4teQHosjoowAIJqhDGkWXsVONPIGryMZJh3tEdahKR+aqh2siKWbFpY2KwWbZashPMesbokcXZRw==",
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.58.tgz",
44
- "_shasum": "2a85735daee93b4d38ef699c1cb27c0ce0c0826d",
43
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-27.2.3.tgz",
44
+ "_shasum": "f93663011f32850535d4648526b4892e98116b3f",
45
45
  "_spec": "@syncfusion/ej2-navigations@*",
46
46
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
47
47
  "author": {
@@ -53,10 +53,10 @@
53
53
  "bundleDependencies": false,
54
54
  "dependencies": {
55
55
  "@syncfusion/ej2-base": "~27.2.2",
56
- "@syncfusion/ej2-buttons": "~27.2.2",
56
+ "@syncfusion/ej2-buttons": "~27.2.4",
57
57
  "@syncfusion/ej2-data": "~27.2.2",
58
- "@syncfusion/ej2-inputs": "~27.2.2",
59
- "@syncfusion/ej2-lists": "~27.2.2",
58
+ "@syncfusion/ej2-inputs": "~27.2.4",
59
+ "@syncfusion/ej2-lists": "~27.2.3",
60
60
  "@syncfusion/ej2-popups": "~27.2.2"
61
61
  },
62
62
  "deprecated": false,
@@ -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.2.2",
165
+ "version": "27.2.4",
166
166
  "sideEffects": false
167
167
  }
@@ -2265,6 +2265,10 @@ var MenuBase = /** @class */ (function (_super) {
2265
2265
  li = this.createItems(iitems).children[idx];
2266
2266
  var ul = this.isMenu ? select('.e-menu-parent', uls[navIdx.length]) : uls[navIdx.length];
2267
2267
  ul.insertBefore(li, ul.children[idx]);
2268
+ if (i === items.length - 1 && !this.isMenu && ul.style.display === 'block') {
2269
+ this.setPosition(null, ul, parseFloat(ul.style.top), parseFloat(ul.style.left));
2270
+ ul.style.display = 'block';
2271
+ }
2268
2272
  }
2269
2273
  }
2270
2274
  };
package/src/tab/tab.js CHANGED
@@ -1749,11 +1749,13 @@ var Tab = /** @class */ (function (_super) {
1749
1749
  else {
1750
1750
  _this.dragItem.querySelector('.' + CLS_WRAP).style.visibility = '';
1751
1751
  removeClass([_this.tbItems.querySelector('.' + CLS_INDICATOR)], CLS_HIDDEN);
1752
+ _this.droppedIndex = isNOU(_this.droppedIndex) ? _this.getEleIndex(_this.dragItem) : _this.droppedIndex;
1752
1753
  _this.selectTab(_this.droppedIndex, null, true);
1753
1754
  }
1754
1755
  }
1755
1756
  });
1756
1757
  this.dragItem = null;
1758
+ this.droppedIndex = null;
1757
1759
  };
1758
1760
  /**
1759
1761
  * Enables or disables the specified Tab item. On passing value as `false`, the item will be disabled.
@@ -973,6 +973,7 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
973
973
  * @event nodeSelecting
974
974
  */
975
975
  nodeSelecting: EmitType<NodeSelectEventArgs>;
976
+ isFilter: boolean;
976
977
  constructor(options?: TreeViewModel, element?: string | HTMLElement);
977
978
  /**
978
979
  * Get component name.
@@ -1298,6 +1299,7 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1298
1299
  * Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel
1299
1300
  *
1300
1301
  * @param {string} node - The unique identifier of the node.
1302
+ * @param {string[]} [nodes=[]] - The list of node IDs to check.
1301
1303
  * @returns {void}
1302
1304
  * @private
1303
1305
  */
@@ -1311,6 +1313,16 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1311
1313
  * @returns {void}
1312
1314
  * @private
1313
1315
  */
1316
+ /**
1317
+ * Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel(for hierarchical DS)
1318
+ *
1319
+ * @param {Object[]} childItems - The child items to check.
1320
+ * @param {string} node - The node to set the check state for.
1321
+ * @param {Object} [treeData] - The optional tree data.
1322
+ * @param {string[]} [nodes=[]] - The list of node IDs to check.
1323
+ * @returns {void}
1324
+ * @private
1325
+ */
1314
1326
  private setChildCheckState;
1315
1327
  private setIndeterminate;
1316
1328
  private updatePosition;
@@ -1073,20 +1073,37 @@ var TreeView = /** @class */ (function (_super) {
1073
1073
  .filter(function (childNode) {
1074
1074
  if (childNode && typeof childNode === 'object' && 'pid' in childNode) {
1075
1075
  var childNodePid = childNode.pid;
1076
- return childNodePid.toString() === dataUid;
1076
+ if (!isNOU(childNodePid)) {
1077
+ return childNodePid.toString() === dataUid;
1078
+ }
1077
1079
  }
1078
1080
  return false;
1079
1081
  });
1080
1082
  };
1081
1083
  TreeView.prototype.ensureChildCheckState = function (element, e, isFromExpandAll) {
1084
+ var _this = this;
1082
1085
  if (!isNOU(element)) {
1083
1086
  var childElement = select('.' + PARENTITEM, element);
1084
1087
  var checkBoxes = void 0;
1085
1088
  if (!isNOU(childElement)) {
1089
+ var childCheck = Array.from(childElement.querySelectorAll('li'));
1086
1090
  checkBoxes = selectAll('.' + CHECKBOXWRAP, childElement);
1091
+ if (this.isFilter) {
1092
+ checkBoxes = Array.from(checkBoxes).filter(function (checkbox) {
1093
+ var dataUID = checkbox.closest('li').getAttribute('data-uid');
1094
+ return dataUID !== null && _this.checkedNodes.indexOf(dataUID) !== -1;
1095
+ });
1096
+ childCheck = Array.from(childCheck).filter(function (li) {
1097
+ var childIds = li.getAttribute('data-uid');
1098
+ return childIds !== null && _this.checkedNodes.indexOf(childIds) !== -1;
1099
+ });
1100
+ if (checkBoxes.length === 0) {
1101
+ checkBoxes = selectAll('.' + CHECKBOXWRAP, childElement);
1102
+ childCheck = Array.from(childElement.querySelectorAll('li'));
1103
+ }
1104
+ }
1087
1105
  var isChecked = element.getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(CHECK);
1088
1106
  var parentCheck = element.getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(INDETERMINATE);
1089
- var childCheck = childElement.querySelectorAll('li');
1090
1107
  var checkedState = void 0;
1091
1108
  for (var index = 0; index < checkBoxes.length; index++) {
1092
1109
  var childId = childCheck[parseInt(index.toString(), 10)].getAttribute('data-uid');
@@ -1149,7 +1166,7 @@ var TreeView = /** @class */ (function (_super) {
1149
1166
  ? nodes[parseInt(len.toString(), 10)].toString()
1150
1167
  : null;
1151
1168
  if (node !== '' && doCheck && node) {
1152
- this.setValidCheckedNode(node);
1169
+ this.setValidCheckedNode(node, nodes);
1153
1170
  this.dynamicCheckState(node, doCheck);
1154
1171
  }
1155
1172
  else if (this.checkedNodes.indexOf(node) !== -1 && node !== '' && !doCheck) {
@@ -2616,11 +2633,20 @@ var TreeView = /** @class */ (function (_super) {
2616
2633
  * @returns {void}
2617
2634
  */
2618
2635
  TreeView.prototype.ensureStateChange = function (li, doCheck) {
2636
+ var _this = this;
2619
2637
  var childElement = select('.' + PARENTITEM, li);
2620
2638
  var parentIndex = li.getAttribute('data-uid');
2621
2639
  var mapper = this.fields;
2622
2640
  if (this.dataType === 1 && this.autoCheck) {
2623
2641
  var resultData = new DataManager(this.treeData).executeLocal(new Query().where(mapper.parentID, 'equal', parentIndex, true));
2642
+ var childMatchesCheckedNodes = resultData.filter(function (item) {
2643
+ return _this.checkedNodes.indexOf(item[mapper.id].toString()) !== -1;
2644
+ }, this);
2645
+ if (this.checkedNodes.indexOf(parentIndex) !== -1 && childMatchesCheckedNodes.length !== resultData.length && this.isFilter) {
2646
+ if (childMatchesCheckedNodes.length > 0) {
2647
+ resultData = childMatchesCheckedNodes;
2648
+ }
2649
+ }
2624
2650
  for (var i = 0; i < resultData.length; i++) {
2625
2651
  var resultId = resultData[parseInt(i.toString(), 10)][this.fields.id]
2626
2652
  ? resultData[parseInt(i.toString(), 10)][this.fields.id].toString()
@@ -2685,6 +2711,13 @@ var TreeView = /** @class */ (function (_super) {
2685
2711
  else {
2686
2712
  var childItems = this.getChildNodes(this.treeData, parentIndex);
2687
2713
  if (childItems) {
2714
+ var filteredChildItems = childItems.filter(function (item) {
2715
+ var itemValue = String(item[Object.keys(item)[0]]);
2716
+ return _this.checkedNodes.indexOf(itemValue) !== -1;
2717
+ });
2718
+ if (filteredChildItems.length > 0 && childItems.length && this.isFilter) {
2719
+ childItems = filteredChildItems;
2720
+ }
2688
2721
  this.childStateChange(childItems, parentIndex, childElement, doCheck);
2689
2722
  }
2690
2723
  }
@@ -2878,6 +2911,12 @@ var TreeView = /** @class */ (function (_super) {
2878
2911
  TreeView.prototype.getFocusedNode = function () {
2879
2912
  var selectedItem;
2880
2913
  var fNode = select('.' + LISTITEM + '[tabindex="0"]', this.element);
2914
+ if (!isNOU(fNode)) {
2915
+ var ariaChecked = fNode.getAttribute('aria-checked');
2916
+ if (ariaChecked === 'mixed' || ariaChecked === 'false') {
2917
+ this.isFilter = false;
2918
+ }
2919
+ }
2881
2920
  if (isNOU(fNode)) {
2882
2921
  selectedItem = select('.' + LISTITEM, this.element);
2883
2922
  }
@@ -3750,7 +3789,7 @@ var TreeView = /** @class */ (function (_super) {
3750
3789
  }
3751
3790
  };
3752
3791
  TreeView.prototype.expandParent = function (dropLi) {
3753
- var dropIcon = select('div.' + ICON, dropLi);
3792
+ var dropIcon = select('div.' + EXPANDABLE + ', div.' + COLLAPSIBLE, dropLi);
3754
3793
  if (dropIcon && dropIcon.classList.contains(EXPANDABLE) && this.preventExpand !== true) {
3755
3794
  this.expandAction(dropLi, dropIcon, null);
3756
3795
  }
@@ -4629,6 +4668,9 @@ var TreeView = /** @class */ (function (_super) {
4629
4668
  };
4630
4669
  TreeView.prototype.setCheckedNodes = function (nodes) {
4631
4670
  nodes = JSON.parse(JSON.stringify(nodes));
4671
+ if (nodes.length > 1 && typeof this.nodeChecked === 'function' && this.nodeChecked.length > 0) {
4672
+ this.isFilter = true;
4673
+ }
4632
4674
  this.uncheckAll(this.checkedNodes);
4633
4675
  this.setIndeterminate(nodes);
4634
4676
  if (nodes.length > 0) {
@@ -4639,15 +4681,17 @@ var TreeView = /** @class */ (function (_super) {
4639
4681
  * Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel
4640
4682
  *
4641
4683
  * @param {string} node - The unique identifier of the node.
4684
+ * @param {string[]} [nodes=[]] - The list of node IDs to check.
4642
4685
  * @returns {void}
4643
4686
  * @private
4644
4687
  */
4645
- TreeView.prototype.setValidCheckedNode = function (node) {
4688
+ TreeView.prototype.setValidCheckedNode = function (node, nodes) {
4689
+ if (nodes === void 0) { nodes = []; }
4646
4690
  if (this.dataType === 1) {
4647
4691
  var mapper = this.fields;
4648
4692
  var resultData = new DataManager(this.treeData).executeLocal(new Query().where(mapper.id, 'equal', node, true));
4649
4693
  if (resultData[0]) {
4650
- this.setChildCheckState(resultData, node, resultData[0]);
4694
+ this.setChildCheckState(resultData, node, resultData[0], nodes);
4651
4695
  if (this.autoCheck) {
4652
4696
  var parent_4 = resultData[0][this.fields.parentID] ? resultData[0][this.fields.parentID].toString() : null;
4653
4697
  var childNodes = this.getChildNodes(this.treeData, parent_4);
@@ -4673,7 +4717,7 @@ var TreeView = /** @class */ (function (_super) {
4673
4717
  }
4674
4718
  var childItems = getValue(this.fields.child.toString(), this.treeData[parseInt(a.toString(), 10)]);
4675
4719
  if (childItems) {
4676
- this.setChildCheckState(childItems, node, this.treeData[parseInt(a.toString(), 10)]);
4720
+ this.setChildCheckState(childItems, node, this.treeData[parseInt(a.toString(), 10)], nodes);
4677
4721
  }
4678
4722
  }
4679
4723
  }
@@ -4687,7 +4731,18 @@ var TreeView = /** @class */ (function (_super) {
4687
4731
  * @returns {void}
4688
4732
  * @private
4689
4733
  */
4690
- TreeView.prototype.setChildCheckState = function (childItems, node, treeData) {
4734
+ /**
4735
+ * Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel(for hierarchical DS)
4736
+ *
4737
+ * @param {Object[]} childItems - The child items to check.
4738
+ * @param {string} node - The node to set the check state for.
4739
+ * @param {Object} [treeData] - The optional tree data.
4740
+ * @param {string[]} [nodes=[]] - The list of node IDs to check.
4741
+ * @returns {void}
4742
+ * @private
4743
+ */
4744
+ TreeView.prototype.setChildCheckState = function (childItems, node, treeData, nodes) {
4745
+ if (nodes === void 0) { nodes = []; }
4691
4746
  var checkedParent;
4692
4747
  var count = 0;
4693
4748
  if (this.dataType === 1) {
@@ -4707,7 +4762,8 @@ var TreeView = /** @class */ (function (_super) {
4707
4762
  this.checkDisabledState(node);
4708
4763
  }
4709
4764
  var subChildItems = this.getChildNodes(this.treeData, checkNode);
4710
- if (subChildItems) {
4765
+ var isParentNodeCheck = (nodes.length === 1 && nodes[0] === checkNode);
4766
+ if (subChildItems.length === node.length || isParentNodeCheck) {
4711
4767
  this.setChildCheckState(subChildItems, node, treeData);
4712
4768
  }
4713
4769
  }
@@ -4718,8 +4774,10 @@ var TreeView = /** @class */ (function (_super) {
4718
4774
  }
4719
4775
  for (var index = 0; index < childItems.length; index++) {
4720
4776
  var checkedChild = childItems[parseInt(index.toString(), 10)][this.fields.id] ? childItems[parseInt(index.toString(), 10)][this.fields.id].toString() : '';
4777
+ var isParentNodeCheck = ([node].length === 1 && nodes.length === 0);
4721
4778
  if (treeData && checkedParent && this.autoCheck) {
4722
- if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1) {
4779
+ if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1
4780
+ && (checkedChild === node || isParentNodeCheck)) {
4723
4781
  this.checkDisabledState(checkedChild, childItems[index]);
4724
4782
  }
4725
4783
  }
@@ -4741,7 +4799,7 @@ var TreeView = /** @class */ (function (_super) {
4741
4799
  };
4742
4800
  TreeView.prototype.setIndeterminate = function (nodes) {
4743
4801
  for (var i = 0; i < nodes.length; i++) {
4744
- this.setValidCheckedNode(nodes[parseInt(i.toString(), 10)]);
4802
+ this.setValidCheckedNode(nodes[parseInt(i.toString(), 10)], nodes);
4745
4803
  }
4746
4804
  };
4747
4805
  TreeView.prototype.updatePosition = function (id, newData, isRefreshChild, childValue) {