@syncfusion/ej2-navigations 21.2.6 → 21.2.9

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.
@@ -1533,9 +1533,17 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1533
1533
  return index;
1534
1534
  };
1535
1535
  MenuBase.prototype.getUlByNavIdx = function (navIdxLen) {
1536
+ var _this = this;
1536
1537
  if (navIdxLen === void 0) { navIdxLen = this.navIdx.length; }
1537
1538
  if (this.isMenu) {
1538
- var popup = [this.getWrapper()].concat([].slice.call(selectAll('.' + POPUP)))[navIdxLen];
1539
+ var popups_1 = [];
1540
+ var allPopup = selectAll('.' + POPUP);
1541
+ allPopup.forEach(function (elem) {
1542
+ if (_this.element.id === elem.id.split('-')[2]) {
1543
+ popups_1.push(elem);
1544
+ }
1545
+ });
1546
+ var popup = [this.getWrapper()].concat([].slice.call(popups_1))[navIdxLen];
1539
1547
  return isNullOrUndefined(popup) ? null : select('.e-menu-parent', popup);
1540
1548
  }
1541
1549
  else {
@@ -3146,7 +3154,8 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
3146
3154
  index = navIdx.pop();
3147
3155
  ul = this.getUlByNavIdx(navIdx.length);
3148
3156
  if (ul) {
3149
- if (ishide) {
3157
+ var validUl = isUniqueId ? ul.children[index].id : ul.children[index].textContent;
3158
+ if (ishide && validUl === items[i]) {
3150
3159
  ul.children[index].classList.add(HIDE);
3151
3160
  }
3152
3161
  else {
@@ -3770,20 +3779,20 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3770
3779
  if (isVisible(this.popObj.element)) {
3771
3780
  nodes = [].slice.call(popupCheck.children);
3772
3781
  if (e.action === 'home') {
3773
- ele = nodes[0];
3782
+ ele = this.focusFirstVisibleEle(nodes);
3774
3783
  }
3775
3784
  else {
3776
- ele = nodes[nodes.length - 1];
3785
+ ele = this.focusLastVisibleEle(nodes);
3777
3786
  }
3778
3787
  }
3779
3788
  }
3780
3789
  else {
3781
3790
  nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + ')');
3782
3791
  if (e.action === 'home') {
3783
- ele = nodes[0];
3792
+ ele = this.focusFirstVisibleEle(nodes);
3784
3793
  }
3785
3794
  else {
3786
- ele = nodes[nodes.length - 1];
3795
+ ele = this.focusLastVisibleEle(nodes);
3787
3796
  }
3788
3797
  }
3789
3798
  if (ele) {
@@ -3897,6 +3906,30 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3897
3906
  Toolbar.prototype.eleContains = function (el) {
3898
3907
  return el.classList.contains(CLS_SEPARATOR) || el.classList.contains(CLS_DISABLE$2) || el.getAttribute('disabled') || el.classList.contains(CLS_HIDDEN) || !isVisible(el) || !el.classList.contains(CLS_ITEM);
3899
3908
  };
3909
+ Toolbar.prototype.focusFirstVisibleEle = function (nodes) {
3910
+ var element;
3911
+ var index = 0;
3912
+ while (index < nodes.length) {
3913
+ var ele = nodes[parseInt(index.toString(), 10)];
3914
+ if (!ele.classList.contains(CLS_HIDDEN) && !ele.classList.contains(CLS_DISABLE$2)) {
3915
+ return ele;
3916
+ }
3917
+ index++;
3918
+ }
3919
+ return element;
3920
+ };
3921
+ Toolbar.prototype.focusLastVisibleEle = function (nodes) {
3922
+ var element;
3923
+ var index = nodes.length - 1;
3924
+ while (index >= 0) {
3925
+ var ele = nodes[parseInt(index.toString(), 10)];
3926
+ if (!ele.classList.contains(CLS_HIDDEN) && !ele.classList.contains(CLS_DISABLE$2)) {
3927
+ return ele;
3928
+ }
3929
+ index--;
3930
+ }
3931
+ return element;
3932
+ };
3900
3933
  Toolbar.prototype.eleFocus = function (closest$$1, pos) {
3901
3934
  var sib = Object(closest$$1)[pos + 'ElementSibling'];
3902
3935
  if (sib) {
@@ -4540,12 +4573,10 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
4540
4573
  if (checkoffset) {
4541
4574
  if (inEle[parseInt(i.toString(), 10)].classList.contains(CLS_SEPARATOR)) {
4542
4575
  if (this.overflowMode === 'Extended') {
4543
- if (itemCount === itemPopCount) {
4544
- var sepEle = inEle[parseInt(i.toString(), 10)];
4545
- if (checkClass(sepEle, [CLS_SEPARATOR, CLS_TBARIGNORE])) {
4546
- inEle[parseInt(i.toString(), 10)].classList.add(CLS_POPUP);
4547
- itemPopCount++;
4548
- }
4576
+ var sepEle = inEle[parseInt(i.toString(), 10)];
4577
+ if (checkClass(sepEle, [CLS_SEPARATOR, CLS_TBARIGNORE])) {
4578
+ inEle[parseInt(i.toString(), 10)].classList.add(CLS_POPUP);
4579
+ itemPopCount++;
4549
4580
  }
4550
4581
  itemCount++;
4551
4582
  }
@@ -5509,10 +5540,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
5509
5540
  break;
5510
5541
  case 'width':
5511
5542
  setStyleAttribute(tEle, { 'width': formatUnit(newProp.width) });
5512
- this.renderOverflowMode();
5513
- if (this.popObj && wid < tEle.offsetWidth) {
5514
- this.popupRefresh(this.popObj.element, false);
5515
- }
5543
+ this.refreshOverflow();
5516
5544
  break;
5517
5545
  case 'height':
5518
5546
  setStyleAttribute(this.element, { 'height': formatUnit(newProp.height) });