@syncfusion/ej2-navigations 21.2.8 → 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 {
@@ -3771,20 +3779,20 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3771
3779
  if (isVisible(this.popObj.element)) {
3772
3780
  nodes = [].slice.call(popupCheck.children);
3773
3781
  if (e.action === 'home') {
3774
- ele = nodes[0];
3782
+ ele = this.focusFirstVisibleEle(nodes);
3775
3783
  }
3776
3784
  else {
3777
- ele = nodes[nodes.length - 1];
3785
+ ele = this.focusLastVisibleEle(nodes);
3778
3786
  }
3779
3787
  }
3780
3788
  }
3781
3789
  else {
3782
3790
  nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + ')');
3783
3791
  if (e.action === 'home') {
3784
- ele = nodes[0];
3792
+ ele = this.focusFirstVisibleEle(nodes);
3785
3793
  }
3786
3794
  else {
3787
- ele = nodes[nodes.length - 1];
3795
+ ele = this.focusLastVisibleEle(nodes);
3788
3796
  }
3789
3797
  }
3790
3798
  if (ele) {
@@ -3898,6 +3906,30 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
3898
3906
  Toolbar.prototype.eleContains = function (el) {
3899
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);
3900
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
+ };
3901
3933
  Toolbar.prototype.eleFocus = function (closest$$1, pos) {
3902
3934
  var sib = Object(closest$$1)[pos + 'ElementSibling'];
3903
3935
  if (sib) {
@@ -4541,12 +4573,10 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
4541
4573
  if (checkoffset) {
4542
4574
  if (inEle[parseInt(i.toString(), 10)].classList.contains(CLS_SEPARATOR)) {
4543
4575
  if (this.overflowMode === 'Extended') {
4544
- if (itemCount === itemPopCount) {
4545
- var sepEle = inEle[parseInt(i.toString(), 10)];
4546
- if (checkClass(sepEle, [CLS_SEPARATOR, CLS_TBARIGNORE])) {
4547
- inEle[parseInt(i.toString(), 10)].classList.add(CLS_POPUP);
4548
- itemPopCount++;
4549
- }
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++;
4550
4580
  }
4551
4581
  itemCount++;
4552
4582
  }
@@ -5510,10 +5540,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
5510
5540
  break;
5511
5541
  case 'width':
5512
5542
  setStyleAttribute(tEle, { 'width': formatUnit(newProp.width) });
5513
- this.renderOverflowMode();
5514
- if (this.popObj && wid < tEle.offsetWidth) {
5515
- this.popupRefresh(this.popObj.element, false);
5516
- }
5543
+ this.refreshOverflow();
5517
5544
  break;
5518
5545
  case 'height':
5519
5546
  setStyleAttribute(this.element, { 'height': formatUnit(newProp.height) });