@syncfusion/ej2-navigations 20.4.51 → 20.4.52

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.
@@ -2105,6 +2105,9 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
2105
2105
  return;
2106
2106
  }
2107
2107
  var iconLi = menu.querySelector('.e-menu-item:not(.e-blankicon):not(.e-separator)');
2108
+ if (!iconLi) {
2109
+ return;
2110
+ }
2108
2111
  var icon = iconLi.querySelector('.e-menu-icon');
2109
2112
  if (!icon) {
2110
2113
  return;
@@ -10129,7 +10132,6 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
10129
10132
  };
10130
10133
  TreeView.prototype.initialize = function () {
10131
10134
  this.element.setAttribute('role', 'tree');
10132
- this.element.setAttribute('tabindex', '0');
10133
10135
  this.element.setAttribute('aria-activedescendant', this.element.id + '_active');
10134
10136
  this.setCssClass(null, this.cssClass);
10135
10137
  this.setEnableRtl();
@@ -10569,6 +10571,8 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
10569
10571
  var fields = e.fields;
10570
10572
  this.addActionClass(e, fields.selected, SELECTED$1);
10571
10573
  this.addActionClass(e, fields.expanded, EXPANDED);
10574
+ e.item.setAttribute("tabindex", "-1");
10575
+ EventHandler.add(e.item, 'focus', this.focusIn, this);
10572
10576
  if (!isNullOrUndefined(this.nodeTemplateFn)) {
10573
10577
  var textEle = e.item.querySelector('.' + LISTTEXT);
10574
10578
  var dataId = e.item.getAttribute('data-uid');
@@ -11130,7 +11134,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11130
11134
  this.setMultiSelect(this.allowMultiSelection);
11131
11135
  var firstNode = select('.' + LISTITEM, this.element);
11132
11136
  if (firstNode) {
11133
- addClass([firstNode], FOCUS);
11137
+ firstNode.setAttribute('tabindex', '0');
11134
11138
  this.updateIdAttr(null, firstNode);
11135
11139
  }
11136
11140
  if (this.allowTextWrap) {
@@ -11790,7 +11794,6 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11790
11794
  this.startNode = li;
11791
11795
  this.addSelect(li);
11792
11796
  }
11793
- this.setFocusElement(li);
11794
11797
  if (this.isLoaded) {
11795
11798
  eventArgs.nodeData = this.getNodeData(li);
11796
11799
  this.trigger('nodeSelected', eventArgs);
@@ -11825,8 +11828,11 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11825
11828
  var focusedNode = this.getFocusedNode();
11826
11829
  if (focusedNode) {
11827
11830
  removeClass([focusedNode], FOCUS);
11831
+ focusedNode.setAttribute("tabindex", "-1");
11828
11832
  }
11829
11833
  addClass([li], FOCUS);
11834
+ li.setAttribute('tabindex', '0');
11835
+ EventHandler.add(li, 'blur', this.focusOut, this);
11830
11836
  this.updateIdAttr(focusedNode, li);
11831
11837
  }
11832
11838
  };
@@ -11951,14 +11957,10 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11951
11957
  var inpEle = target;
11952
11958
  if (e.action === 'enter') {
11953
11959
  inpEle.blur();
11954
- this.element.focus();
11955
- addClass([focusedNode], HOVER);
11956
11960
  }
11957
11961
  else if (e.action === 'escape') {
11958
11962
  inpEle.value = this.oldText;
11959
11963
  inpEle.blur();
11960
- this.element.focus();
11961
- addClass([focusedNode], HOVER);
11962
11964
  }
11963
11965
  return;
11964
11966
  }
@@ -12342,7 +12344,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
12342
12344
  };
12343
12345
  TreeView.prototype.getFocusedNode = function () {
12344
12346
  var selectedItem;
12345
- var fNode = select('.' + LISTITEM + '.' + FOCUS, this.element);
12347
+ var fNode = select('.' + LISTITEM + '[tabindex="0"]', this.element);
12346
12348
  if (isNullOrUndefined(fNode)) {
12347
12349
  selectedItem = select('.' + LISTITEM, this.element);
12348
12350
  }
@@ -12412,8 +12414,12 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
12412
12414
  };
12413
12415
  TreeView.prototype.setFocus = function (preNode, nextNode) {
12414
12416
  removeClass([preNode], [HOVER, FOCUS]);
12417
+ preNode.setAttribute("tabindex", "-1");
12415
12418
  if (!nextNode.classList.contains('e-disable') && !nextNode.classList.contains(PREVENTSELECT)) {
12416
12419
  addClass([nextNode], [HOVER, FOCUS]);
12420
+ nextNode.setAttribute('tabindex', '0');
12421
+ nextNode.focus();
12422
+ EventHandler.add(nextNode, 'blur', this.focusOut, this);
12417
12423
  this.updateIdAttr(preNode, nextNode);
12418
12424
  }
12419
12425
  };
@@ -12427,12 +12433,19 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
12427
12433
  };
12428
12434
  TreeView.prototype.focusIn = function () {
12429
12435
  if (!this.mouseDownStatus) {
12430
- addClass([this.getFocusedNode()], HOVER);
12436
+ var focusedElement = this.getFocusedNode();
12437
+ focusedElement.setAttribute("tanindex", "0");
12438
+ addClass([focusedElement], [HOVER, FOCUS]);
12439
+ EventHandler.add(focusedElement, 'blur', this.focusOut, this);
12431
12440
  }
12432
12441
  this.mouseDownStatus = false;
12433
12442
  };
12434
- TreeView.prototype.focusOut = function () {
12435
- removeClass([this.getFocusedNode()], HOVER);
12443
+ TreeView.prototype.focusOut = function (event) {
12444
+ var focusedElement = this.getFocusedNode();
12445
+ if (event.target == focusedElement) {
12446
+ removeClass([focusedElement], [HOVER, FOCUS]);
12447
+ EventHandler.remove(focusedElement, 'blur', this.focusOut);
12448
+ }
12436
12449
  };
12437
12450
  TreeView.prototype.onMouseOver = function (e) {
12438
12451
  var target = e.target;
@@ -12640,7 +12653,9 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
12640
12653
  }
12641
12654
  if (isInput) {
12642
12655
  removeClass([liEle], EDITING);
12643
- txtEle.focus();
12656
+ liEle.focus();
12657
+ EventHandler.add(liEle, 'blur', this.focusOut, this);
12658
+ addClass([liEle], HOVER);
12644
12659
  }
12645
12660
  if (this.allowTextWrap) {
12646
12661
  this.calculateWrap(liEle);
@@ -13909,8 +13924,6 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13909
13924
  if (this.expandOnType !== 'None') {
13910
13925
  this.wireExpandOnEvent(true);
13911
13926
  }
13912
- EventHandler.add(this.element, 'focus', this.focusIn, this);
13913
- EventHandler.add(this.element, 'blur', this.focusOut, this);
13914
13927
  EventHandler.add(this.element, 'mouseover', this.onMouseOver, this);
13915
13928
  EventHandler.add(this.element, 'mouseout', this.onMouseLeave, this);
13916
13929
  this.keyboardModule = new KeyboardEvents(this.element, {
@@ -13923,8 +13936,6 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13923
13936
  EventHandler.remove(this.element, 'mousedown', this.mouseDownHandler);
13924
13937
  this.wireClickEvent(false);
13925
13938
  this.wireExpandOnEvent(false);
13926
- EventHandler.remove(this.element, 'focus', this.focusIn);
13927
- EventHandler.remove(this.element, 'blur', this.focusOut);
13928
13939
  EventHandler.remove(this.element, 'mouseover', this.onMouseOver);
13929
13940
  EventHandler.remove(this.element, 'mouseout', this.onMouseLeave);
13930
13941
  if (!this.disabled) {
@@ -14414,7 +14425,6 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
14414
14425
  TreeView.prototype.destroy = function () {
14415
14426
  this.clearTemplate();
14416
14427
  this.element.removeAttribute('aria-activedescendant');
14417
- this.element.removeAttribute('tabindex');
14418
14428
  this.unWireEvents();
14419
14429
  this.wireEditingEvents(false);
14420
14430
  if (!this.disabled) {
@@ -15757,7 +15767,9 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
15757
15767
  * @param {string | HTMLElement} element - Specifies the element.
15758
15768
  */
15759
15769
  function Breadcrumb(options, element) {
15760
- return _super.call(this, options, element) || this;
15770
+ var _this = _super.call(this, options, element) || this;
15771
+ _this.isPopupCreated = false;
15772
+ return _this;
15761
15773
  }
15762
15774
  /**
15763
15775
  * @private
@@ -16198,7 +16210,7 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
16198
16210
  this.isExpanded = true;
16199
16211
  this.reRenderItems();
16200
16212
  }
16201
- if (e.target.classList.contains(MENUCLASS)) {
16213
+ if (e.target.classList.contains(MENUCLASS) && !this.isPopupCreated) {
16202
16214
  this.renderPopup();
16203
16215
  }
16204
16216
  };
@@ -16206,6 +16218,7 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
16206
16218
  var _this = this;
16207
16219
  var wrapper = this.createElement('div', { className: POPUPCLASS + ' ' + this.cssClass + (this.enableRtl ? ' e-rtl' : '') });
16208
16220
  document.body.appendChild(wrapper);
16221
+ this.isPopupCreated = true;
16209
16222
  this.popupObj = new Popup(wrapper, {
16210
16223
  content: this.popupUl,
16211
16224
  relateTo: this.element.querySelector(DOT + MENUCLASS),
@@ -16223,6 +16236,7 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
16223
16236
  if (this.overflowMode === 'Menu' && this.popupObj && this.popupObj.element.classList.contains('e-popup-open') && !closest(e.target, DOT + MENUCLASS)) {
16224
16237
  this.popupObj.hide();
16225
16238
  this.popupObj.destroy();
16239
+ this.isPopupCreated = false;
16226
16240
  detach(this.popupObj.element);
16227
16241
  }
16228
16242
  };