@syncfusion/ej2-navigations 31.2.12 → 31.2.16

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.
@@ -3955,6 +3955,10 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3955
3955
  };
3956
3956
  Toolbar.prototype.docEvent = function (e) {
3957
3957
  var popEle = closest(e.target, '.e-popup');
3958
+ if (this.popupTriggeredByToolbar) {
3959
+ this.popupTriggeredByToolbar = false;
3960
+ return;
3961
+ }
3958
3962
  if (this.popObj && isVisible(this.popObj.element) && !popEle && this.overflowMode === 'Popup') {
3959
3963
  this.popObj.hide({ name: 'FadeOut', duration: 100 });
3960
3964
  }
@@ -4331,6 +4335,10 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
4331
4335
  var isPopupElement = !isNullOrUndefined(closest(trgt, '.' + CLS_POPUPCLASS));
4332
4336
  var clsList = trgt.classList;
4333
4337
  var popupNav = closest(trgt, ('.' + CLS_TBARNAV));
4338
+ var popupDownIcon = closest(trgt, ('.' + CLS_POPUPDOWN));
4339
+ if (popupDownIcon || popupNav) {
4340
+ this.popupTriggeredByToolbar = true;
4341
+ }
4334
4342
  if (!popupNav) {
4335
4343
  popupNav = trgt;
4336
4344
  }
@@ -11615,25 +11623,23 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11615
11623
  var childKey = typeof this.fields.child === 'string' ? this.fields.child : null;
11616
11624
  var dataId = this.fields.id;
11617
11625
  var parentKey = this.fields.parentID;
11626
+ if (!this.nodeIndex) {
11627
+ this.nodeIndex = new Map();
11628
+ this.buildNodeIndex(this.treeData);
11629
+ }
11618
11630
  var matchesDataUid = function (childNode) {
11619
11631
  if (!isNullOrUndefined(childKey) && childKey in childNode && Array.isArray(childNode[childKey])) {
11620
11632
  var matchNode = childNode[dataId];
11621
- if (!isNullOrUndefined(matchNode)) {
11622
- return matchNode.toString() === dataUid;
11623
- }
11633
+ return !isNullOrUndefined(matchNode) &&
11634
+ matchNode.toString() === dataUid;
11624
11635
  }
11625
11636
  else {
11626
11637
  var childNodePid = childNode[parentKey];
11627
- if (!isNullOrUndefined(childNodePid)) {
11628
- return childNodePid.toString() === dataUid;
11629
- }
11638
+ return !isNullOrUndefined(childNodePid) && childNodePid.toString() === dataUid;
11630
11639
  }
11631
- return false;
11632
11640
  };
11633
11641
  return this.checkedNodes
11634
- .map(function (checkedNodeId) {
11635
- return _this.getNodeObject(checkedNodeId);
11636
- })
11642
+ .map(function (id) { return _this.nodeIndex.get(id); })
11637
11643
  .filter(function (childNode) {
11638
11644
  if (childNode && typeof childNode === 'object' && (childKey in childNode)) {
11639
11645
  return matchesDataUid(childNode);
@@ -11644,6 +11650,25 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11644
11650
  return false;
11645
11651
  });
11646
11652
  };
11653
+ TreeView.prototype.buildNodeIndex = function (nodes) {
11654
+ var _this = this;
11655
+ var childKey = typeof this.fields.child === 'string' ? this.fields.child : null;
11656
+ nodes.forEach(function (node) {
11657
+ var idVal = getValue(_this.fields.id, node);
11658
+ if (idVal != null) {
11659
+ if (!_this.nodeIndex) {
11660
+ _this.nodeIndex = new Map();
11661
+ }
11662
+ _this.nodeIndex.set(idVal.toString(), node);
11663
+ }
11664
+ if (childKey) {
11665
+ var children = getValue(childKey, node);
11666
+ if (Array.isArray(children)) {
11667
+ _this.buildNodeIndex(children);
11668
+ }
11669
+ }
11670
+ });
11671
+ };
11647
11672
  TreeView.prototype.getAllChildNodes = function (data, parentId) {
11648
11673
  if (isNullOrUndefined(data) || isNullOrUndefined(parentId)) {
11649
11674
  return [];