@syncfusion/ej2-navigations 20.4.42 → 20.4.43

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 {
@@ -7590,7 +7589,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7590
7589
  * @returns {void}
7591
7590
  */
7592
7591
  Tab.prototype.destroy = function () {
7593
- var _this = this;
7594
7592
  if (this.isReact || this.isAngular) {
7595
7593
  this.clearTemplate();
7596
7594
  }
@@ -7599,9 +7597,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7599
7597
  this.tbObj = null;
7600
7598
  }
7601
7599
  this.unWireEvents();
7602
- ['role', 'aria-disabled', 'aria-activedescendant', 'tabindex', 'aria-orientation', 'aria-owns'].forEach(function (val) {
7603
- _this.element.removeAttribute(val);
7604
- });
7600
+ this.element.removeAttribute('aria-disabled');
7605
7601
  this.expTemplateContent();
7606
7602
  if (!this.isTemplate) {
7607
7603
  while (this.element.firstElementChild) {
@@ -7680,7 +7676,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7680
7676
  var css = (name === 'msie') ? 'e-ie' : (name === 'edge') ? 'e-edge' : (name === 'safari') ? 'e-safari' : '';
7681
7677
  setStyleAttribute(this.element, { 'width': formatUnit(this.width), 'height': formatUnit(this.height) });
7682
7678
  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' });
7679
+ attributes(this.element, { 'aria-disabled': 'false' });
7684
7680
  this.setCssClass(this.element, css, true);
7685
7681
  this.updatePopAnimationConfig();
7686
7682
  };
@@ -7776,8 +7772,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7776
7772
  hdrItems.forEach(function (item, index) {
7777
7773
  _this.lastIndex = index;
7778
7774
  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' }
7775
+ className: CLS_ITEM$2, id: CLS_ITEM$2 + _this.tabId + '_' + index
7781
7776
  };
7782
7777
  var txt = _this.createElement('span', {
7783
7778
  className: CLS_TEXT, innerHTML: item, attrs: { 'role': 'presentation' }
@@ -7785,7 +7780,10 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7785
7780
  var cont = _this.createElement('div', {
7786
7781
  className: CLS_TEXT_WRAP, innerHTML: txt + _this.btnCls.outerHTML
7787
7782
  }).outerHTML;
7788
- var wrap = _this.createElement('div', { className: CLS_WRAP, innerHTML: cont, attrs: { tabIndex: '-1' } });
7783
+ var wrap = _this.createElement('div', {
7784
+ className: CLS_WRAP, innerHTML: cont,
7785
+ attrs: { role: 'tab', tabIndex: '-1', 'aria-selected': 'false', 'aria-controls': CLS_CONTENT$1 + _this.tabId + '_' + index }
7786
+ });
7789
7787
  tabItems_1.appendChild(_this.createElement('div', attr));
7790
7788
  selectAll('.' + CLS_ITEM$2, tabItems_1)[index].appendChild(wrap);
7791
7789
  });
@@ -7804,15 +7802,13 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7804
7802
  this.tbObj.isStringTemplate = true;
7805
7803
  this.tbObj.createElement = this.createElement;
7806
7804
  this.tbObj.appendTo(this.hdrEle);
7807
- attributes(this.hdrEle, { 'aria-label': 'tab-header' });
7808
- this.updateOrientationAttribute();
7805
+ attributes(this.hdrEle, { role: 'tablist' });
7809
7806
  this.setCloseButton(this.showCloseButton);
7810
7807
  var toolbarHeader = this.tbObj.element.querySelector('.' + CLS_TB_ITEMS);
7811
7808
  if (!isNullOrUndefined(toolbarHeader)) {
7812
7809
  if (isNullOrUndefined(toolbarHeader.id) || toolbarHeader.id === '') {
7813
7810
  toolbarHeader.id = this.element.id + '_' + 'tab_header_items';
7814
7811
  }
7815
- this.element.setAttribute('aria-owns', toolbarHeader.id);
7816
7812
  }
7817
7813
  };
7818
7814
  Tab.prototype.renderContent = function () {
@@ -7907,7 +7903,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7907
7903
  }
7908
7904
  }
7909
7905
  var tabIndex = isNullOrUndefined(item.tabIndex) ? '-1' : item.tabIndex.toString();
7910
- var wrapAttrs = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex };
7906
+ var wrapAttrs = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex, role: 'tab', 'aria-selected': 'false' };
7911
7907
  tCont.appendChild(_this.btnCls.cloneNode(true));
7912
7908
  var wrap = _this.createElement('div', { className: CLS_WRAP, attrs: wrapAttrs });
7913
7909
  wrap.appendChild(tCont);
@@ -7918,7 +7914,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7918
7914
  _this.itemIndexArray.splice((index + i), 0, CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex);
7919
7915
  }
7920
7916
  var attrObj = {
7921
- id: CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex, role: 'tab', 'aria-selected': 'false'
7917
+ id: CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex
7922
7918
  };
7923
7919
  var tItem = { htmlAttributes: attrObj, template: wrap };
7924
7920
  tItem.cssClass = ((item.cssClass !== undefined) ? item.cssClass : ' ') + ' ' + disabled + ' ' + hidden + ' '
@@ -7947,6 +7943,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7947
7943
  if (tabHeader) {
7948
7944
  var tabItems = selectAll('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE$1, tabHeader);
7949
7945
  [].slice.call(tabItems).forEach(function (node) { return node.classList.remove(CLS_ACTIVE$1); });
7946
+ [].slice.call(tabItems).forEach(function (node) { return node.firstElementChild.setAttribute('aria-selected', 'false'); });
7950
7947
  }
7951
7948
  };
7952
7949
  Tab.prototype.checkPopupOverflow = function (ele) {
@@ -7989,9 +7986,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7989
7986
  }
7990
7987
  return selectAll('.' + CLS_TB_ITEM, this.tbItems).length - 1;
7991
7988
  };
7992
- Tab.prototype.updateOrientationAttribute = function () {
7993
- attributes(this.element, { 'aria-orientation': (this.isVertical() ? 'vertical' : 'horizontal') });
7994
- };
7995
7989
  Tab.prototype.setCloseButton = function (val) {
7996
7990
  var trg = select('.' + CLS_HEADER$1, this.element);
7997
7991
  if (val === true) {
@@ -8298,7 +8292,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
8298
8292
  }
8299
8293
  }
8300
8294
  this.addVerticalClass();
8301
- this.updateOrientationAttribute();
8302
8295
  this.setActiveBorder();
8303
8296
  this.focusItem();
8304
8297
  };
@@ -8484,20 +8477,18 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
8484
8477
  if (!this.isTemplate) {
8485
8478
  var prev = this.tbItem[this.prevIndex];
8486
8479
  if (!isNullOrUndefined(prev)) {
8487
- prev.removeAttribute('aria-controls');
8480
+ prev.firstElementChild.removeAttribute('aria-controls');
8488
8481
  }
8489
- attributes(trg, { 'aria-controls': CLS_CONTENT$1 + this.tabId + '_' + value });
8482
+ attributes(trg.firstElementChild, { 'aria-controls': CLS_CONTENT$1 + this.tabId + '_' + value });
8490
8483
  }
8491
8484
  var id = trg.id;
8492
8485
  this.removeActiveClass();
8493
8486
  trg.classList.add(CLS_ACTIVE$1);
8494
- this.tbItem[this.prevIndex].setAttribute('aria-selected', 'false');
8495
- trg.setAttribute('aria-selected', 'true');
8487
+ trg.firstElementChild.setAttribute('aria-selected', 'true');
8496
8488
  var no = Number(this.extIndex(id));
8497
8489
  if (isNullOrUndefined(this.prevActiveEle)) {
8498
8490
  this.prevActiveEle = CLS_CONTENT$1 + this.tabId + '_' + no;
8499
8491
  }
8500
- attributes(this.element, { 'aria-activedescendant': id });
8501
8492
  if (this.isTemplate) {
8502
8493
  if (select('.' + CLS_CONTENT$1, this.element).children.length > 0) {
8503
8494
  var trg_1 = this.findEle(select('.' + CLS_CONTENT$1, this.element).children, CLS_CONTENT$1 + this.tabId + '_' + no);
@@ -9172,7 +9163,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9172
9163
  (textValue_1.length === 0) && !isNullOrUndefined(item.header) && isNullOrUndefined(item.header.iconCss))) {
9173
9164
  if (tabItems_2[place]) {
9174
9165
  if (isNullOrUndefined(item.id)) {
9175
- item.id = TABITEMPREFIX + (lastEleIndex + place).toString();
9166
+ item.id = CLS_ITEM$2 + _this.tabId + '_' + TABITEMPREFIX + (lastEleIndex + place).toString();
9176
9167
  }
9177
9168
  tabItems_2[place].htmlAttributes['data-id'] = item.id;
9178
9169
  }
@@ -9605,7 +9596,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9605
9596
  }
9606
9597
  }
9607
9598
  var tabIndex = isNullOrUndefined(item.tabIndex) ? '-1' : item.tabIndex.toString();
9608
- var wrapAtt = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex };
9599
+ var wrapAtt = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex, role: 'tab', 'aria-selected': 'true' };
9609
9600
  tConts.appendChild(this.btnCls.cloneNode(true));
9610
9601
  var wraper = this.createElement('div', { className: CLS_WRAP, attrs: wrapAtt });
9611
9602
  wraper.appendChild(tConts);
@@ -9656,11 +9647,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9656
9647
  detach(element);
9657
9648
  detach(detachContent);
9658
9649
  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
- }
9650
+ className: CLS_TB_ITEM + ' ' + CLS_TEMPLATE$1 + ' ' + CLS_ACTIVE$1, id: CLS_ITEM$2 + this.tabId + '_' + index
9664
9651
  };
9665
9652
  var txtString = this.createElement('span', {
9666
9653
  className: CLS_TEXT, innerHTML: header, attrs: { 'role': 'presentation' }
@@ -9670,7 +9657,8 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9670
9657
  }).outerHTML;
9671
9658
  var tabIndex = element.firstElementChild.getAttribute('data-tabindex');
9672
9659
  var wrap = this.createElement('div', {
9673
- className: CLS_WRAP, innerHTML: conte, attrs: { tabIndex: tabIndex, 'data-tabindex': tabIndex }
9660
+ className: CLS_WRAP, innerHTML: conte,
9661
+ attrs: { tabIndex: tabIndex, 'data-tabindex': tabIndex, role: 'tab', 'aria-controls': CLS_CONTENT$1 + this.tabId + '_' + index, 'aria-selected': 'true' }
9674
9662
  });
9675
9663
  tabItems.insertBefore(this.createElement('div', attr), tabItems.children[index + 1]);
9676
9664
  this.element.querySelector('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE$1).appendChild(wrap);
@@ -11250,7 +11238,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11250
11238
  }
11251
11239
  };
11252
11240
  TreeView.prototype.clickHandler = function (event) {
11253
- var target = event.originalEvent.target;
11241
+ var target = Browser.isDevice ? document.elementFromPoint(event.originalEvent.changedTouches[0].clientX, event.originalEvent.changedTouches[0].clientY) : event.originalEvent.target;
11254
11242
  EventHandler.remove(this.element, 'contextmenu', this.preventContextMenu);
11255
11243
  if (!target || this.dragStartAction) {
11256
11244
  return;