@syncfusion/ej2-navigations 27.2.2 → 27.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 : 27.2.2
3
+ * version : 27.2.3
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.2",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-NuGUkRUegiDf3K1JwEmZA5KTRuPPBQef7sVWP+qlW9nJuyckRl7gzgOgQ9yzbx+nakva45vcCB+KzpImZy6yGw==",
5
+ "_integrity": "sha512-wdKjMJAp1fCj8Lh+EcSicpaZ/dwG50/giQQAcaCTrDPrn0oGT9+/MS3gzDtxNgSOuDDANSCtJ8+2wFacDtAXRA==",
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.2.tgz",
44
+ "_shasum": "b90419d23da0d3a8d0300f21f00b07015f3ea1b3",
45
45
  "_spec": "@syncfusion/ej2-navigations@*",
46
46
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
47
47
  "author": {
@@ -56,7 +56,7 @@
56
56
  "@syncfusion/ej2-buttons": "~27.2.2",
57
57
  "@syncfusion/ej2-data": "~27.2.2",
58
58
  "@syncfusion/ej2-inputs": "~27.2.2",
59
- "@syncfusion/ej2-lists": "~27.2.2",
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.3",
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;
@@ -1079,14 +1079,29 @@ var TreeView = /** @class */ (function (_super) {
1079
1079
  });
1080
1080
  };
1081
1081
  TreeView.prototype.ensureChildCheckState = function (element, e, isFromExpandAll) {
1082
+ var _this = this;
1082
1083
  if (!isNOU(element)) {
1083
1084
  var childElement = select('.' + PARENTITEM, element);
1084
1085
  var checkBoxes = void 0;
1085
1086
  if (!isNOU(childElement)) {
1087
+ var childCheck = Array.from(childElement.querySelectorAll('li'));
1086
1088
  checkBoxes = selectAll('.' + CHECKBOXWRAP, childElement);
1089
+ if (this.isFilter) {
1090
+ checkBoxes = Array.from(checkBoxes).filter(function (checkbox) {
1091
+ var dataUID = checkbox.closest('li').getAttribute('data-uid');
1092
+ return dataUID !== null && _this.checkedNodes.indexOf(dataUID) !== -1;
1093
+ });
1094
+ childCheck = Array.from(childCheck).filter(function (li) {
1095
+ var childIds = li.getAttribute('data-uid');
1096
+ return childIds !== null && _this.checkedNodes.indexOf(childIds) !== -1;
1097
+ });
1098
+ if (checkBoxes.length === 0) {
1099
+ checkBoxes = selectAll('.' + CHECKBOXWRAP, childElement);
1100
+ childCheck = Array.from(childElement.querySelectorAll('li'));
1101
+ }
1102
+ }
1087
1103
  var isChecked = element.getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(CHECK);
1088
1104
  var parentCheck = element.getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(INDETERMINATE);
1089
- var childCheck = childElement.querySelectorAll('li');
1090
1105
  var checkedState = void 0;
1091
1106
  for (var index = 0; index < checkBoxes.length; index++) {
1092
1107
  var childId = childCheck[parseInt(index.toString(), 10)].getAttribute('data-uid');
@@ -1149,7 +1164,7 @@ var TreeView = /** @class */ (function (_super) {
1149
1164
  ? nodes[parseInt(len.toString(), 10)].toString()
1150
1165
  : null;
1151
1166
  if (node !== '' && doCheck && node) {
1152
- this.setValidCheckedNode(node);
1167
+ this.setValidCheckedNode(node, nodes);
1153
1168
  this.dynamicCheckState(node, doCheck);
1154
1169
  }
1155
1170
  else if (this.checkedNodes.indexOf(node) !== -1 && node !== '' && !doCheck) {
@@ -2616,11 +2631,20 @@ var TreeView = /** @class */ (function (_super) {
2616
2631
  * @returns {void}
2617
2632
  */
2618
2633
  TreeView.prototype.ensureStateChange = function (li, doCheck) {
2634
+ var _this = this;
2619
2635
  var childElement = select('.' + PARENTITEM, li);
2620
2636
  var parentIndex = li.getAttribute('data-uid');
2621
2637
  var mapper = this.fields;
2622
2638
  if (this.dataType === 1 && this.autoCheck) {
2623
2639
  var resultData = new DataManager(this.treeData).executeLocal(new Query().where(mapper.parentID, 'equal', parentIndex, true));
2640
+ var childMatchesCheckedNodes = resultData.filter(function (item) {
2641
+ return _this.checkedNodes.indexOf(item[mapper.id].toString()) !== -1;
2642
+ }, this);
2643
+ if (this.checkedNodes.indexOf(parentIndex) !== -1 && childMatchesCheckedNodes.length !== resultData.length && this.isFilter) {
2644
+ if (childMatchesCheckedNodes.length > 0) {
2645
+ resultData = childMatchesCheckedNodes;
2646
+ }
2647
+ }
2624
2648
  for (var i = 0; i < resultData.length; i++) {
2625
2649
  var resultId = resultData[parseInt(i.toString(), 10)][this.fields.id]
2626
2650
  ? resultData[parseInt(i.toString(), 10)][this.fields.id].toString()
@@ -2685,6 +2709,13 @@ var TreeView = /** @class */ (function (_super) {
2685
2709
  else {
2686
2710
  var childItems = this.getChildNodes(this.treeData, parentIndex);
2687
2711
  if (childItems) {
2712
+ var filteredChildItems = childItems.filter(function (item) {
2713
+ var itemValue = String(item[Object.keys(item)[0]]);
2714
+ return _this.checkedNodes.indexOf(itemValue) !== -1;
2715
+ });
2716
+ if (filteredChildItems.length > 0 && childItems.length && this.isFilter) {
2717
+ childItems = filteredChildItems;
2718
+ }
2688
2719
  this.childStateChange(childItems, parentIndex, childElement, doCheck);
2689
2720
  }
2690
2721
  }
@@ -2878,6 +2909,12 @@ var TreeView = /** @class */ (function (_super) {
2878
2909
  TreeView.prototype.getFocusedNode = function () {
2879
2910
  var selectedItem;
2880
2911
  var fNode = select('.' + LISTITEM + '[tabindex="0"]', this.element);
2912
+ if (!isNOU(fNode)) {
2913
+ var ariaChecked = fNode.getAttribute('aria-checked');
2914
+ if (ariaChecked === 'mixed' || ariaChecked === 'false') {
2915
+ this.isFilter = false;
2916
+ }
2917
+ }
2881
2918
  if (isNOU(fNode)) {
2882
2919
  selectedItem = select('.' + LISTITEM, this.element);
2883
2920
  }
@@ -3750,7 +3787,7 @@ var TreeView = /** @class */ (function (_super) {
3750
3787
  }
3751
3788
  };
3752
3789
  TreeView.prototype.expandParent = function (dropLi) {
3753
- var dropIcon = select('div.' + ICON, dropLi);
3790
+ var dropIcon = select('div.' + EXPANDABLE + ', div.' + COLLAPSIBLE, dropLi);
3754
3791
  if (dropIcon && dropIcon.classList.contains(EXPANDABLE) && this.preventExpand !== true) {
3755
3792
  this.expandAction(dropLi, dropIcon, null);
3756
3793
  }
@@ -4629,6 +4666,9 @@ var TreeView = /** @class */ (function (_super) {
4629
4666
  };
4630
4667
  TreeView.prototype.setCheckedNodes = function (nodes) {
4631
4668
  nodes = JSON.parse(JSON.stringify(nodes));
4669
+ if (nodes.length > 1 && typeof this.nodeChecked === 'function' && this.nodeChecked.length > 0) {
4670
+ this.isFilter = true;
4671
+ }
4632
4672
  this.uncheckAll(this.checkedNodes);
4633
4673
  this.setIndeterminate(nodes);
4634
4674
  if (nodes.length > 0) {
@@ -4639,15 +4679,17 @@ var TreeView = /** @class */ (function (_super) {
4639
4679
  * Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel
4640
4680
  *
4641
4681
  * @param {string} node - The unique identifier of the node.
4682
+ * @param {string[]} [nodes=[]] - The list of node IDs to check.
4642
4683
  * @returns {void}
4643
4684
  * @private
4644
4685
  */
4645
- TreeView.prototype.setValidCheckedNode = function (node) {
4686
+ TreeView.prototype.setValidCheckedNode = function (node, nodes) {
4687
+ if (nodes === void 0) { nodes = []; }
4646
4688
  if (this.dataType === 1) {
4647
4689
  var mapper = this.fields;
4648
4690
  var resultData = new DataManager(this.treeData).executeLocal(new Query().where(mapper.id, 'equal', node, true));
4649
4691
  if (resultData[0]) {
4650
- this.setChildCheckState(resultData, node, resultData[0]);
4692
+ this.setChildCheckState(resultData, node, resultData[0], nodes);
4651
4693
  if (this.autoCheck) {
4652
4694
  var parent_4 = resultData[0][this.fields.parentID] ? resultData[0][this.fields.parentID].toString() : null;
4653
4695
  var childNodes = this.getChildNodes(this.treeData, parent_4);
@@ -4673,7 +4715,7 @@ var TreeView = /** @class */ (function (_super) {
4673
4715
  }
4674
4716
  var childItems = getValue(this.fields.child.toString(), this.treeData[parseInt(a.toString(), 10)]);
4675
4717
  if (childItems) {
4676
- this.setChildCheckState(childItems, node, this.treeData[parseInt(a.toString(), 10)]);
4718
+ this.setChildCheckState(childItems, node, this.treeData[parseInt(a.toString(), 10)], nodes);
4677
4719
  }
4678
4720
  }
4679
4721
  }
@@ -4687,7 +4729,18 @@ var TreeView = /** @class */ (function (_super) {
4687
4729
  * @returns {void}
4688
4730
  * @private
4689
4731
  */
4690
- TreeView.prototype.setChildCheckState = function (childItems, node, treeData) {
4732
+ /**
4733
+ * Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel(for hierarchical DS)
4734
+ *
4735
+ * @param {Object[]} childItems - The child items to check.
4736
+ * @param {string} node - The node to set the check state for.
4737
+ * @param {Object} [treeData] - The optional tree data.
4738
+ * @param {string[]} [nodes=[]] - The list of node IDs to check.
4739
+ * @returns {void}
4740
+ * @private
4741
+ */
4742
+ TreeView.prototype.setChildCheckState = function (childItems, node, treeData, nodes) {
4743
+ if (nodes === void 0) { nodes = []; }
4691
4744
  var checkedParent;
4692
4745
  var count = 0;
4693
4746
  if (this.dataType === 1) {
@@ -4707,7 +4760,8 @@ var TreeView = /** @class */ (function (_super) {
4707
4760
  this.checkDisabledState(node);
4708
4761
  }
4709
4762
  var subChildItems = this.getChildNodes(this.treeData, checkNode);
4710
- if (subChildItems) {
4763
+ var isParentNodeCheck = (nodes.length === 1 && nodes[0] === checkNode);
4764
+ if (subChildItems.length === node.length || isParentNodeCheck) {
4711
4765
  this.setChildCheckState(subChildItems, node, treeData);
4712
4766
  }
4713
4767
  }
@@ -4718,8 +4772,10 @@ var TreeView = /** @class */ (function (_super) {
4718
4772
  }
4719
4773
  for (var index = 0; index < childItems.length; index++) {
4720
4774
  var checkedChild = childItems[parseInt(index.toString(), 10)][this.fields.id] ? childItems[parseInt(index.toString(), 10)][this.fields.id].toString() : '';
4775
+ var isParentNodeCheck = ([node].length === 1 && nodes.length === 0);
4721
4776
  if (treeData && checkedParent && this.autoCheck) {
4722
- if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1) {
4777
+ if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1
4778
+ && (checkedChild === node || isParentNodeCheck)) {
4723
4779
  this.checkDisabledState(checkedChild, childItems[index]);
4724
4780
  }
4725
4781
  }
@@ -4741,7 +4797,7 @@ var TreeView = /** @class */ (function (_super) {
4741
4797
  };
4742
4798
  TreeView.prototype.setIndeterminate = function (nodes) {
4743
4799
  for (var i = 0; i < nodes.length; i++) {
4744
- this.setValidCheckedNode(nodes[parseInt(i.toString(), 10)]);
4800
+ this.setValidCheckedNode(nodes[parseInt(i.toString(), 10)], nodes);
4745
4801
  }
4746
4802
  };
4747
4803
  TreeView.prototype.updatePosition = function (id, newData, isRefreshChild, childValue) {