@syncfusion/ej2-navigations 20.4.42 → 20.4.44

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.
@@ -1491,14 +1491,6 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1491
1491
  if (fliIdx === (e.action === DOWNARROW ? cul.childElementCount : -1)) {
1492
1492
  fliIdx = defaultIdx;
1493
1493
  }
1494
- if (cul.children[fliIdx].classList.contains(HIDE)) {
1495
- if (e.action === DOWNARROW && fliIdx === cul.childElementCount - 1) {
1496
- fliIdx = defaultIdx;
1497
- }
1498
- else if (e.action === UPARROW && fliIdx === 0) {
1499
- fliIdx = defaultIdx;
1500
- }
1501
- }
1502
1494
  }
1503
1495
  }
1504
1496
  var cli = cul.children[fliIdx];
@@ -1508,8 +1500,15 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1508
1500
  };
1509
1501
  MenuBase.prototype.isValidLI = function (cli, index, action) {
1510
1502
  var cul = this.getUlByNavIdx();
1503
+ var defaultIdx = (action === DOWNARROW || action === HOME || action === TAB) ? 0 : cul.childElementCount - 1;
1511
1504
  if (cli.classList.contains(SEPARATOR) || cli.classList.contains(DISABLED) || cli.classList.contains(HIDE)) {
1512
- if ((action === DOWNARROW) || (action === RIGHTARROW)) {
1505
+ if (action === DOWNARROW && index === cul.childElementCount - 1) {
1506
+ index = defaultIdx;
1507
+ }
1508
+ else if (action === UPARROW && index === 0) {
1509
+ index = defaultIdx;
1510
+ }
1511
+ else if ((action === DOWNARROW) || (action === RIGHTARROW)) {
1513
1512
  index++;
1514
1513
  }
1515
1514
  else {
@@ -1673,11 +1672,15 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1673
1672
  closedLi = trgtpopUp.querySelector('[id="' + trgtliId + '"]');
1674
1673
  trgtLi = (liElem_1 && trgtpopUp.querySelector('[id="' + liElem_1.id + '"]'));
1675
1674
  }
1675
+ else if (trgtpopUp) {
1676
+ closedLi = trgtpopUp.querySelector('.e-menu-item.e-selected');
1677
+ trgtLi = (liElem_1 && trgtpopUp.querySelector('[id="' + liElem_1.id + '"]'));
1678
+ }
1676
1679
  var submenus = liElem_1 && liElem_1.querySelectorAll('.e-menu-item');
1677
1680
  if (isOpen && _this.hamburgerMode && ulIndex && !(submenus.length)) {
1678
1681
  _this.afterCloseMenu(e);
1679
1682
  }
1680
- else if (isOpen && !_this.hamburgerMode && _this.navIdx.length && closedLi && !trgtLi && _this.keyType !== 'left') {
1683
+ else if (isOpen && !_this.hamburgerMode && closedLi && !trgtLi && _this.keyType !== 'left' && (_this.navIdx.length || !_this.isMenu && _this.navIdx.length === 0)) {
1681
1684
  var ele = (e && e.target.classList.contains('e-vscroll'))
1682
1685
  ? closest(e.target, '.e-menu-wrapper') : null;
1683
1686
  if (ele) {
@@ -1691,7 +1694,7 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1691
1694
  }
1692
1695
  }
1693
1696
  else if (isOpen && !isIterated && !ulIndex && ((_this.hamburgerMode && _this.navIdx.length) ||
1694
- _this.navIdx.length === 1)) {
1697
+ _this.navIdx.length === 1 && liElem_1 && trgtpopUp !== liElem_1.parentElement)) {
1695
1698
  _this.closeMenu(null, e);
1696
1699
  }
1697
1700
  else if (isOpen && isNullOrUndefined(ulIndex) && _this.navIdx.length) {
@@ -7590,7 +7593,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7590
7593
  * @returns {void}
7591
7594
  */
7592
7595
  Tab.prototype.destroy = function () {
7593
- var _this = this;
7594
7596
  if (this.isReact || this.isAngular) {
7595
7597
  this.clearTemplate();
7596
7598
  }
@@ -7599,9 +7601,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7599
7601
  this.tbObj = null;
7600
7602
  }
7601
7603
  this.unWireEvents();
7602
- ['role', 'aria-disabled', 'aria-activedescendant', 'tabindex', 'aria-orientation', 'aria-owns'].forEach(function (val) {
7603
- _this.element.removeAttribute(val);
7604
- });
7604
+ this.element.removeAttribute('aria-disabled');
7605
7605
  this.expTemplateContent();
7606
7606
  if (!this.isTemplate) {
7607
7607
  while (this.element.firstElementChild) {
@@ -7680,7 +7680,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7680
7680
  var css = (name === 'msie') ? 'e-ie' : (name === 'edge') ? 'e-edge' : (name === 'safari') ? 'e-safari' : '';
7681
7681
  setStyleAttribute(this.element, { 'width': formatUnit(this.width), 'height': formatUnit(this.height) });
7682
7682
  this.setCssClass(this.element, this.cssClass, true);
7683
- attributes(this.element, { role: 'tablist', 'aria-disabled': 'false', 'aria-activedescendant': '', 'aria-owns': this.element.id + '_' + 'tab_header_items' });
7683
+ attributes(this.element, { 'aria-disabled': 'false' });
7684
7684
  this.setCssClass(this.element, css, true);
7685
7685
  this.updatePopAnimationConfig();
7686
7686
  };
@@ -7776,8 +7776,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7776
7776
  hdrItems.forEach(function (item, index) {
7777
7777
  _this.lastIndex = index;
7778
7778
  var attr = {
7779
- className: CLS_ITEM$2, id: CLS_ITEM$2 + _this.tabId + '_' + index,
7780
- attrs: { role: 'tab', 'aria-controls': CLS_CONTENT$1 + _this.tabId + '_' + index, 'aria-selected': 'false' }
7779
+ className: CLS_ITEM$2, id: CLS_ITEM$2 + _this.tabId + '_' + index
7781
7780
  };
7782
7781
  var txt = _this.createElement('span', {
7783
7782
  className: CLS_TEXT, innerHTML: item, attrs: { 'role': 'presentation' }
@@ -7785,7 +7784,10 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7785
7784
  var cont = _this.createElement('div', {
7786
7785
  className: CLS_TEXT_WRAP, innerHTML: txt + _this.btnCls.outerHTML
7787
7786
  }).outerHTML;
7788
- var wrap = _this.createElement('div', { className: CLS_WRAP, innerHTML: cont, attrs: { tabIndex: '-1' } });
7787
+ var wrap = _this.createElement('div', {
7788
+ className: CLS_WRAP, innerHTML: cont,
7789
+ attrs: { role: 'tab', tabIndex: '-1', 'aria-selected': 'false', 'aria-controls': CLS_CONTENT$1 + _this.tabId + '_' + index }
7790
+ });
7789
7791
  tabItems_1.appendChild(_this.createElement('div', attr));
7790
7792
  selectAll('.' + CLS_ITEM$2, tabItems_1)[index].appendChild(wrap);
7791
7793
  });
@@ -7804,15 +7806,13 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7804
7806
  this.tbObj.isStringTemplate = true;
7805
7807
  this.tbObj.createElement = this.createElement;
7806
7808
  this.tbObj.appendTo(this.hdrEle);
7807
- attributes(this.hdrEle, { 'aria-label': 'tab-header' });
7808
- this.updateOrientationAttribute();
7809
+ attributes(this.hdrEle, { role: 'tablist' });
7809
7810
  this.setCloseButton(this.showCloseButton);
7810
7811
  var toolbarHeader = this.tbObj.element.querySelector('.' + CLS_TB_ITEMS);
7811
7812
  if (!isNullOrUndefined(toolbarHeader)) {
7812
7813
  if (isNullOrUndefined(toolbarHeader.id) || toolbarHeader.id === '') {
7813
7814
  toolbarHeader.id = this.element.id + '_' + 'tab_header_items';
7814
7815
  }
7815
- this.element.setAttribute('aria-owns', toolbarHeader.id);
7816
7816
  }
7817
7817
  };
7818
7818
  Tab.prototype.renderContent = function () {
@@ -7907,7 +7907,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7907
7907
  }
7908
7908
  }
7909
7909
  var tabIndex = isNullOrUndefined(item.tabIndex) ? '-1' : item.tabIndex.toString();
7910
- var wrapAttrs = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex };
7910
+ var wrapAttrs = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex, role: 'tab', 'aria-selected': 'false' };
7911
7911
  tCont.appendChild(_this.btnCls.cloneNode(true));
7912
7912
  var wrap = _this.createElement('div', { className: CLS_WRAP, attrs: wrapAttrs });
7913
7913
  wrap.appendChild(tCont);
@@ -7918,7 +7918,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7918
7918
  _this.itemIndexArray.splice((index + i), 0, CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex);
7919
7919
  }
7920
7920
  var attrObj = {
7921
- id: CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex, role: 'tab', 'aria-selected': 'false'
7921
+ id: CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex
7922
7922
  };
7923
7923
  var tItem = { htmlAttributes: attrObj, template: wrap };
7924
7924
  tItem.cssClass = ((item.cssClass !== undefined) ? item.cssClass : ' ') + ' ' + disabled + ' ' + hidden + ' '
@@ -7947,6 +7947,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7947
7947
  if (tabHeader) {
7948
7948
  var tabItems = selectAll('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE$1, tabHeader);
7949
7949
  [].slice.call(tabItems).forEach(function (node) { return node.classList.remove(CLS_ACTIVE$1); });
7950
+ [].slice.call(tabItems).forEach(function (node) { return node.firstElementChild.setAttribute('aria-selected', 'false'); });
7950
7951
  }
7951
7952
  };
7952
7953
  Tab.prototype.checkPopupOverflow = function (ele) {
@@ -7989,9 +7990,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7989
7990
  }
7990
7991
  return selectAll('.' + CLS_TB_ITEM, this.tbItems).length - 1;
7991
7992
  };
7992
- Tab.prototype.updateOrientationAttribute = function () {
7993
- attributes(this.element, { 'aria-orientation': (this.isVertical() ? 'vertical' : 'horizontal') });
7994
- };
7995
7993
  Tab.prototype.setCloseButton = function (val) {
7996
7994
  var trg = select('.' + CLS_HEADER$1, this.element);
7997
7995
  if (val === true) {
@@ -8298,7 +8296,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
8298
8296
  }
8299
8297
  }
8300
8298
  this.addVerticalClass();
8301
- this.updateOrientationAttribute();
8302
8299
  this.setActiveBorder();
8303
8300
  this.focusItem();
8304
8301
  };
@@ -8484,20 +8481,18 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
8484
8481
  if (!this.isTemplate) {
8485
8482
  var prev = this.tbItem[this.prevIndex];
8486
8483
  if (!isNullOrUndefined(prev)) {
8487
- prev.removeAttribute('aria-controls');
8484
+ prev.firstElementChild.removeAttribute('aria-controls');
8488
8485
  }
8489
- attributes(trg, { 'aria-controls': CLS_CONTENT$1 + this.tabId + '_' + value });
8486
+ attributes(trg.firstElementChild, { 'aria-controls': CLS_CONTENT$1 + this.tabId + '_' + value });
8490
8487
  }
8491
8488
  var id = trg.id;
8492
8489
  this.removeActiveClass();
8493
8490
  trg.classList.add(CLS_ACTIVE$1);
8494
- this.tbItem[this.prevIndex].setAttribute('aria-selected', 'false');
8495
- trg.setAttribute('aria-selected', 'true');
8491
+ trg.firstElementChild.setAttribute('aria-selected', 'true');
8496
8492
  var no = Number(this.extIndex(id));
8497
8493
  if (isNullOrUndefined(this.prevActiveEle)) {
8498
8494
  this.prevActiveEle = CLS_CONTENT$1 + this.tabId + '_' + no;
8499
8495
  }
8500
- attributes(this.element, { 'aria-activedescendant': id });
8501
8496
  if (this.isTemplate) {
8502
8497
  if (select('.' + CLS_CONTENT$1, this.element).children.length > 0) {
8503
8498
  var trg_1 = this.findEle(select('.' + CLS_CONTENT$1, this.element).children, CLS_CONTENT$1 + this.tabId + '_' + no);
@@ -9172,7 +9167,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9172
9167
  (textValue_1.length === 0) && !isNullOrUndefined(item.header) && isNullOrUndefined(item.header.iconCss))) {
9173
9168
  if (tabItems_2[place]) {
9174
9169
  if (isNullOrUndefined(item.id)) {
9175
- item.id = TABITEMPREFIX + (lastEleIndex + place).toString();
9170
+ item.id = CLS_ITEM$2 + _this.tabId + '_' + TABITEMPREFIX + (lastEleIndex + place).toString();
9176
9171
  }
9177
9172
  tabItems_2[place].htmlAttributes['data-id'] = item.id;
9178
9173
  }
@@ -9605,7 +9600,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9605
9600
  }
9606
9601
  }
9607
9602
  var tabIndex = isNullOrUndefined(item.tabIndex) ? '-1' : item.tabIndex.toString();
9608
- var wrapAtt = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex };
9603
+ var wrapAtt = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex, role: 'tab', 'aria-selected': 'true' };
9609
9604
  tConts.appendChild(this.btnCls.cloneNode(true));
9610
9605
  var wraper = this.createElement('div', { className: CLS_WRAP, attrs: wrapAtt });
9611
9606
  wraper.appendChild(tConts);
@@ -9656,11 +9651,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9656
9651
  detach(element);
9657
9652
  detach(detachContent);
9658
9653
  var attr = {
9659
- className: CLS_TB_ITEM + ' ' + CLS_TEMPLATE$1 + ' ' + CLS_ACTIVE$1, id: CLS_ITEM$2 + this.tabId + '_' + index,
9660
- attrs: {
9661
- role: 'tab', 'aria-controls': CLS_CONTENT$1 + this.tabId + '_' + index,
9662
- 'aria-disabled': 'false', 'aria-selected': 'true'
9663
- }
9654
+ className: CLS_TB_ITEM + ' ' + CLS_TEMPLATE$1 + ' ' + CLS_ACTIVE$1, id: CLS_ITEM$2 + this.tabId + '_' + index
9664
9655
  };
9665
9656
  var txtString = this.createElement('span', {
9666
9657
  className: CLS_TEXT, innerHTML: header, attrs: { 'role': 'presentation' }
@@ -9670,7 +9661,8 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9670
9661
  }).outerHTML;
9671
9662
  var tabIndex = element.firstElementChild.getAttribute('data-tabindex');
9672
9663
  var wrap = this.createElement('div', {
9673
- className: CLS_WRAP, innerHTML: conte, attrs: { tabIndex: tabIndex, 'data-tabindex': tabIndex }
9664
+ className: CLS_WRAP, innerHTML: conte,
9665
+ attrs: { tabIndex: tabIndex, 'data-tabindex': tabIndex, role: 'tab', 'aria-controls': CLS_CONTENT$1 + this.tabId + '_' + index, 'aria-selected': 'true' }
9674
9666
  });
9675
9667
  tabItems.insertBefore(this.createElement('div', attr), tabItems.children[index + 1]);
9676
9668
  this.element.querySelector('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE$1).appendChild(wrap);
@@ -11250,7 +11242,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11250
11242
  }
11251
11243
  };
11252
11244
  TreeView.prototype.clickHandler = function (event) {
11253
- var target = event.originalEvent.target;
11245
+ var target = Browser.isDevice ? document.elementFromPoint(event.originalEvent.changedTouches[0].clientX, event.originalEvent.changedTouches[0].clientY) : event.originalEvent.target;
11254
11246
  EventHandler.remove(this.element, 'contextmenu', this.preventContextMenu);
11255
11247
  if (!target || this.dragStartAction) {
11256
11248
  return;