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