@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.
@@ -1458,7 +1458,14 @@ let MenuBase = class MenuBase extends Component {
1458
1458
  }
1459
1459
  getUlByNavIdx(navIdxLen = this.navIdx.length) {
1460
1460
  if (this.isMenu) {
1461
- const popup = [this.getWrapper()].concat([].slice.call(selectAll('.' + POPUP)))[navIdxLen];
1461
+ const popups = [];
1462
+ const allPopup = selectAll('.' + POPUP);
1463
+ allPopup.forEach((elem) => {
1464
+ if (this.element.id === elem.id.split('-')[2]) {
1465
+ popups.push(elem);
1466
+ }
1467
+ });
1468
+ const popup = [this.getWrapper()].concat([].slice.call(popups))[navIdxLen];
1462
1469
  return isNullOrUndefined(popup) ? null : select('.e-menu-parent', popup);
1463
1470
  }
1464
1471
  else {
@@ -3034,7 +3041,8 @@ let MenuBase = class MenuBase extends Component {
3034
3041
  index = navIdx.pop();
3035
3042
  ul = this.getUlByNavIdx(navIdx.length);
3036
3043
  if (ul) {
3037
- if (ishide) {
3044
+ let validUl = isUniqueId ? ul.children[index].id : ul.children[index].textContent;
3045
+ if (ishide && validUl === items[i]) {
3038
3046
  ul.children[index].classList.add(HIDE);
3039
3047
  }
3040
3048
  else {
@@ -3632,20 +3640,20 @@ let Toolbar = class Toolbar extends Component {
3632
3640
  if (isVisible(this.popObj.element)) {
3633
3641
  nodes = [].slice.call(popupCheck.children);
3634
3642
  if (e.action === 'home') {
3635
- ele = nodes[0];
3643
+ ele = this.focusFirstVisibleEle(nodes);
3636
3644
  }
3637
3645
  else {
3638
- ele = nodes[nodes.length - 1];
3646
+ ele = this.focusLastVisibleEle(nodes);
3639
3647
  }
3640
3648
  }
3641
3649
  }
3642
3650
  else {
3643
3651
  nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + ')');
3644
3652
  if (e.action === 'home') {
3645
- ele = nodes[0];
3653
+ ele = this.focusFirstVisibleEle(nodes);
3646
3654
  }
3647
3655
  else {
3648
- ele = nodes[nodes.length - 1];
3656
+ ele = this.focusLastVisibleEle(nodes);
3649
3657
  }
3650
3658
  }
3651
3659
  if (ele) {
@@ -3759,6 +3767,30 @@ let Toolbar = class Toolbar extends Component {
3759
3767
  eleContains(el) {
3760
3768
  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);
3761
3769
  }
3770
+ focusFirstVisibleEle(nodes) {
3771
+ let element;
3772
+ let index = 0;
3773
+ while (index < nodes.length) {
3774
+ const ele = nodes[parseInt(index.toString(), 10)];
3775
+ if (!ele.classList.contains(CLS_HIDDEN) && !ele.classList.contains(CLS_DISABLE$2)) {
3776
+ return ele;
3777
+ }
3778
+ index++;
3779
+ }
3780
+ return element;
3781
+ }
3782
+ focusLastVisibleEle(nodes) {
3783
+ let element;
3784
+ let index = nodes.length - 1;
3785
+ while (index >= 0) {
3786
+ const ele = nodes[parseInt(index.toString(), 10)];
3787
+ if (!ele.classList.contains(CLS_HIDDEN) && !ele.classList.contains(CLS_DISABLE$2)) {
3788
+ return ele;
3789
+ }
3790
+ index--;
3791
+ }
3792
+ return element;
3793
+ }
3762
3794
  eleFocus(closest$$1, pos) {
3763
3795
  const sib = Object(closest$$1)[pos + 'ElementSibling'];
3764
3796
  if (sib) {
@@ -4400,12 +4432,10 @@ let Toolbar = class Toolbar extends Component {
4400
4432
  if (checkoffset) {
4401
4433
  if (inEle[parseInt(i.toString(), 10)].classList.contains(CLS_SEPARATOR)) {
4402
4434
  if (this.overflowMode === 'Extended') {
4403
- if (itemCount === itemPopCount) {
4404
- const sepEle = inEle[parseInt(i.toString(), 10)];
4405
- if (checkClass(sepEle, [CLS_SEPARATOR, CLS_TBARIGNORE])) {
4406
- inEle[parseInt(i.toString(), 10)].classList.add(CLS_POPUP);
4407
- itemPopCount++;
4408
- }
4435
+ const sepEle = inEle[parseInt(i.toString(), 10)];
4436
+ if (checkClass(sepEle, [CLS_SEPARATOR, CLS_TBARIGNORE])) {
4437
+ inEle[parseInt(i.toString(), 10)].classList.add(CLS_POPUP);
4438
+ itemPopCount++;
4409
4439
  }
4410
4440
  itemCount++;
4411
4441
  }
@@ -5356,10 +5386,7 @@ let Toolbar = class Toolbar extends Component {
5356
5386
  break;
5357
5387
  case 'width':
5358
5388
  setStyleAttribute(tEle, { 'width': formatUnit(newProp.width) });
5359
- this.renderOverflowMode();
5360
- if (this.popObj && wid < tEle.offsetWidth) {
5361
- this.popupRefresh(this.popObj.element, false);
5362
- }
5389
+ this.refreshOverflow();
5363
5390
  break;
5364
5391
  case 'height':
5365
5392
  setStyleAttribute(this.element, { 'height': formatUnit(newProp.height) });