@syncfusion/ej2-navigations 20.4.40 → 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.
@@ -1292,7 +1292,7 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1292
1292
  }
1293
1293
  }
1294
1294
  if (this.cssClass) {
1295
- addClass([wrapper], this.cssClass.split(' '));
1295
+ addClass([wrapper], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
1296
1296
  }
1297
1297
  if (this.enableRtl) {
1298
1298
  wrapper.classList.add(RTL);
@@ -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 {
@@ -1847,7 +1846,7 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1847
1846
  }
1848
1847
  else {
1849
1848
  if (this.cssClass) {
1850
- addClass([this.popupWrapper], this.cssClass.split(' '));
1849
+ addClass([this.popupWrapper], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
1851
1850
  }
1852
1851
  this.popupObj.hide();
1853
1852
  }
@@ -2258,7 +2257,12 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
2258
2257
  }
2259
2258
  var ul = ListBase.createList(this.createElement, items, listBaseOptions, !this.template, this);
2260
2259
  ul.setAttribute('tabindex', '0');
2261
- this.isMenu ? ul.setAttribute('role', 'menu') : ul.setAttribute('role', 'menubar');
2260
+ if (this.isMenu) {
2261
+ ul.setAttribute('role', 'menu');
2262
+ }
2263
+ else {
2264
+ ul.setAttribute('role', 'menubar');
2265
+ }
2262
2266
  return ul;
2263
2267
  };
2264
2268
  MenuBase.prototype.moverHandler = function (e) {
@@ -2652,7 +2656,7 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
2652
2656
  removeClass([wrapper], oldProp.cssClass.split(' '));
2653
2657
  }
2654
2658
  if (newProp.cssClass) {
2655
- addClass([wrapper], newProp.cssClass.split(' '));
2659
+ addClass([wrapper], newProp.cssClass.replace(/\s+/g, ' ').trim().split(' '));
2656
2660
  }
2657
2661
  break;
2658
2662
  case 'enableRtl':
@@ -7585,7 +7589,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7585
7589
  * @returns {void}
7586
7590
  */
7587
7591
  Tab.prototype.destroy = function () {
7588
- var _this = this;
7589
7592
  if (this.isReact || this.isAngular) {
7590
7593
  this.clearTemplate();
7591
7594
  }
@@ -7594,9 +7597,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7594
7597
  this.tbObj = null;
7595
7598
  }
7596
7599
  this.unWireEvents();
7597
- ['role', 'aria-disabled', 'aria-activedescendant', 'tabindex', 'aria-orientation', 'aria-owns'].forEach(function (val) {
7598
- _this.element.removeAttribute(val);
7599
- });
7600
+ this.element.removeAttribute('aria-disabled');
7600
7601
  this.expTemplateContent();
7601
7602
  if (!this.isTemplate) {
7602
7603
  while (this.element.firstElementChild) {
@@ -7675,7 +7676,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7675
7676
  var css = (name === 'msie') ? 'e-ie' : (name === 'edge') ? 'e-edge' : (name === 'safari') ? 'e-safari' : '';
7676
7677
  setStyleAttribute(this.element, { 'width': formatUnit(this.width), 'height': formatUnit(this.height) });
7677
7678
  this.setCssClass(this.element, this.cssClass, true);
7678
- 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' });
7679
7680
  this.setCssClass(this.element, css, true);
7680
7681
  this.updatePopAnimationConfig();
7681
7682
  };
@@ -7771,8 +7772,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7771
7772
  hdrItems.forEach(function (item, index) {
7772
7773
  _this.lastIndex = index;
7773
7774
  var attr = {
7774
- className: CLS_ITEM$2, id: CLS_ITEM$2 + _this.tabId + '_' + index,
7775
- 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
7776
7776
  };
7777
7777
  var txt = _this.createElement('span', {
7778
7778
  className: CLS_TEXT, innerHTML: item, attrs: { 'role': 'presentation' }
@@ -7780,7 +7780,10 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7780
7780
  var cont = _this.createElement('div', {
7781
7781
  className: CLS_TEXT_WRAP, innerHTML: txt + _this.btnCls.outerHTML
7782
7782
  }).outerHTML;
7783
- 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
+ });
7784
7787
  tabItems_1.appendChild(_this.createElement('div', attr));
7785
7788
  selectAll('.' + CLS_ITEM$2, tabItems_1)[index].appendChild(wrap);
7786
7789
  });
@@ -7799,15 +7802,13 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7799
7802
  this.tbObj.isStringTemplate = true;
7800
7803
  this.tbObj.createElement = this.createElement;
7801
7804
  this.tbObj.appendTo(this.hdrEle);
7802
- attributes(this.hdrEle, { 'aria-label': 'tab-header' });
7803
- this.updateOrientationAttribute();
7805
+ attributes(this.hdrEle, { role: 'tablist' });
7804
7806
  this.setCloseButton(this.showCloseButton);
7805
7807
  var toolbarHeader = this.tbObj.element.querySelector('.' + CLS_TB_ITEMS);
7806
7808
  if (!isNullOrUndefined(toolbarHeader)) {
7807
7809
  if (isNullOrUndefined(toolbarHeader.id) || toolbarHeader.id === '') {
7808
7810
  toolbarHeader.id = this.element.id + '_' + 'tab_header_items';
7809
7811
  }
7810
- this.element.setAttribute('aria-owns', toolbarHeader.id);
7811
7812
  }
7812
7813
  };
7813
7814
  Tab.prototype.renderContent = function () {
@@ -7902,7 +7903,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7902
7903
  }
7903
7904
  }
7904
7905
  var tabIndex = isNullOrUndefined(item.tabIndex) ? '-1' : item.tabIndex.toString();
7905
- var wrapAttrs = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex };
7906
+ var wrapAttrs = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex, role: 'tab', 'aria-selected': 'false' };
7906
7907
  tCont.appendChild(_this.btnCls.cloneNode(true));
7907
7908
  var wrap = _this.createElement('div', { className: CLS_WRAP, attrs: wrapAttrs });
7908
7909
  wrap.appendChild(tCont);
@@ -7913,7 +7914,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7913
7914
  _this.itemIndexArray.splice((index + i), 0, CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex);
7914
7915
  }
7915
7916
  var attrObj = {
7916
- id: CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex, role: 'tab', 'aria-selected': 'false'
7917
+ id: CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex
7917
7918
  };
7918
7919
  var tItem = { htmlAttributes: attrObj, template: wrap };
7919
7920
  tItem.cssClass = ((item.cssClass !== undefined) ? item.cssClass : ' ') + ' ' + disabled + ' ' + hidden + ' '
@@ -7942,6 +7943,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7942
7943
  if (tabHeader) {
7943
7944
  var tabItems = selectAll('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE$1, tabHeader);
7944
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'); });
7945
7947
  }
7946
7948
  };
7947
7949
  Tab.prototype.checkPopupOverflow = function (ele) {
@@ -7984,9 +7986,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7984
7986
  }
7985
7987
  return selectAll('.' + CLS_TB_ITEM, this.tbItems).length - 1;
7986
7988
  };
7987
- Tab.prototype.updateOrientationAttribute = function () {
7988
- attributes(this.element, { 'aria-orientation': (this.isVertical() ? 'vertical' : 'horizontal') });
7989
- };
7990
7989
  Tab.prototype.setCloseButton = function (val) {
7991
7990
  var trg = select('.' + CLS_HEADER$1, this.element);
7992
7991
  if (val === true) {
@@ -8293,7 +8292,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
8293
8292
  }
8294
8293
  }
8295
8294
  this.addVerticalClass();
8296
- this.updateOrientationAttribute();
8297
8295
  this.setActiveBorder();
8298
8296
  this.focusItem();
8299
8297
  };
@@ -8479,20 +8477,18 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
8479
8477
  if (!this.isTemplate) {
8480
8478
  var prev = this.tbItem[this.prevIndex];
8481
8479
  if (!isNullOrUndefined(prev)) {
8482
- prev.removeAttribute('aria-controls');
8480
+ prev.firstElementChild.removeAttribute('aria-controls');
8483
8481
  }
8484
- attributes(trg, { 'aria-controls': CLS_CONTENT$1 + this.tabId + '_' + value });
8482
+ attributes(trg.firstElementChild, { 'aria-controls': CLS_CONTENT$1 + this.tabId + '_' + value });
8485
8483
  }
8486
8484
  var id = trg.id;
8487
8485
  this.removeActiveClass();
8488
8486
  trg.classList.add(CLS_ACTIVE$1);
8489
- this.tbItem[this.prevIndex].setAttribute('aria-selected', 'false');
8490
- trg.setAttribute('aria-selected', 'true');
8487
+ trg.firstElementChild.setAttribute('aria-selected', 'true');
8491
8488
  var no = Number(this.extIndex(id));
8492
8489
  if (isNullOrUndefined(this.prevActiveEle)) {
8493
8490
  this.prevActiveEle = CLS_CONTENT$1 + this.tabId + '_' + no;
8494
8491
  }
8495
- attributes(this.element, { 'aria-activedescendant': id });
8496
8492
  if (this.isTemplate) {
8497
8493
  if (select('.' + CLS_CONTENT$1, this.element).children.length > 0) {
8498
8494
  var trg_1 = this.findEle(select('.' + CLS_CONTENT$1, this.element).children, CLS_CONTENT$1 + this.tabId + '_' + no);
@@ -9167,7 +9163,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9167
9163
  (textValue_1.length === 0) && !isNullOrUndefined(item.header) && isNullOrUndefined(item.header.iconCss))) {
9168
9164
  if (tabItems_2[place]) {
9169
9165
  if (isNullOrUndefined(item.id)) {
9170
- item.id = TABITEMPREFIX + (lastEleIndex + place).toString();
9166
+ item.id = CLS_ITEM$2 + _this.tabId + '_' + TABITEMPREFIX + (lastEleIndex + place).toString();
9171
9167
  }
9172
9168
  tabItems_2[place].htmlAttributes['data-id'] = item.id;
9173
9169
  }
@@ -9600,7 +9596,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9600
9596
  }
9601
9597
  }
9602
9598
  var tabIndex = isNullOrUndefined(item.tabIndex) ? '-1' : item.tabIndex.toString();
9603
- var wrapAtt = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex };
9599
+ var wrapAtt = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex, role: 'tab', 'aria-selected': 'true' };
9604
9600
  tConts.appendChild(this.btnCls.cloneNode(true));
9605
9601
  var wraper = this.createElement('div', { className: CLS_WRAP, attrs: wrapAtt });
9606
9602
  wraper.appendChild(tConts);
@@ -9651,11 +9647,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9651
9647
  detach(element);
9652
9648
  detach(detachContent);
9653
9649
  var attr = {
9654
- className: CLS_TB_ITEM + ' ' + CLS_TEMPLATE$1 + ' ' + CLS_ACTIVE$1, id: CLS_ITEM$2 + this.tabId + '_' + index,
9655
- attrs: {
9656
- role: 'tab', 'aria-controls': CLS_CONTENT$1 + this.tabId + '_' + index,
9657
- 'aria-disabled': 'false', 'aria-selected': 'true'
9658
- }
9650
+ className: CLS_TB_ITEM + ' ' + CLS_TEMPLATE$1 + ' ' + CLS_ACTIVE$1, id: CLS_ITEM$2 + this.tabId + '_' + index
9659
9651
  };
9660
9652
  var txtString = this.createElement('span', {
9661
9653
  className: CLS_TEXT, innerHTML: header, attrs: { 'role': 'presentation' }
@@ -9665,7 +9657,8 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9665
9657
  }).outerHTML;
9666
9658
  var tabIndex = element.firstElementChild.getAttribute('data-tabindex');
9667
9659
  var wrap = this.createElement('div', {
9668
- 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' }
9669
9662
  });
9670
9663
  tabItems.insertBefore(this.createElement('div', attr), tabItems.children[index + 1]);
9671
9664
  this.element.querySelector('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE$1).appendChild(wrap);
@@ -9984,6 +9977,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
9984
9977
  _this.isFirstRender = false;
9985
9978
  // Specifies whether the node is dropped or not
9986
9979
  _this.isNodeDropped = false;
9980
+ _this.isInteracted = false;
9987
9981
  _this.mouseDownStatus = false;
9988
9982
  return _this;
9989
9983
  }
@@ -11244,7 +11238,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11244
11238
  }
11245
11239
  };
11246
11240
  TreeView.prototype.clickHandler = function (event) {
11247
- 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;
11248
11242
  EventHandler.remove(this.element, 'contextmenu', this.preventContextMenu);
11249
11243
  if (!target || this.dragStartAction) {
11250
11244
  return;
@@ -11383,6 +11377,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11383
11377
  }
11384
11378
  if (this.isLoaded && this.expandArgs && !this.isRefreshed) {
11385
11379
  this.expandArgs = this.getExpandEvent(currLi, null);
11380
+ this.expandArgs.isInteracted = this.isInteracted;
11386
11381
  this.trigger('nodeExpanded', this.expandArgs);
11387
11382
  }
11388
11383
  };
@@ -11405,6 +11400,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11405
11400
  var colArgs;
11406
11401
  if (this.isLoaded) {
11407
11402
  colArgs = this.getExpandEvent(currLi, e);
11403
+ this.isInteracted = colArgs.isInteracted;
11408
11404
  this.trigger('nodeCollapsing', colArgs, function (observedArgs) {
11409
11405
  if (observedArgs.cancel) {
11410
11406
  removeClass([icon], PROCESS);
@@ -11465,6 +11461,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11465
11461
  this.removeExpand(liEle);
11466
11462
  if (this.isLoaded) {
11467
11463
  colArgs = this.getExpandEvent(liEle, null);
11464
+ colArgs.isInteracted = this.isInteracted;
11468
11465
  this.trigger('nodeCollapsed', colArgs);
11469
11466
  }
11470
11467
  };
@@ -11878,6 +11875,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11878
11875
  }
11879
11876
  if (this.isLoaded && !this.isRefreshed) {
11880
11877
  this.expandArgs = this.getExpandEvent(currLi, e);
11878
+ this.isInteracted = this.expandArgs.isInteracted;
11881
11879
  this.trigger('nodeExpanding', this.expandArgs, function (observedArgs) {
11882
11880
  if (observedArgs.cancel) {
11883
11881
  removeClass([icon], PROCESS);
@@ -15698,7 +15696,7 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
15698
15696
  this._maxItems = this.maxItems;
15699
15697
  this.element.setAttribute('aria-label', 'breadcrumb');
15700
15698
  if (this.cssClass) {
15701
- addClass([this.element], this.cssClass.split(' '));
15699
+ addClass([this.element], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
15702
15700
  }
15703
15701
  if (this.enableRtl) {
15704
15702
  this.element.classList.add('e-rtl');
@@ -16212,7 +16210,7 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
16212
16210
  removeClass([this.element], oldProp.cssClass.split(' '));
16213
16211
  }
16214
16212
  if (newProp.cssClass) {
16215
- addClass([this.element], newProp.cssClass.split(' '));
16213
+ addClass([this.element], newProp.cssClass.replace(/\s+/g, ' ').trim().split(' '));
16216
16214
  }
16217
16215
  if ((oldProp.cssClass && oldProp.cssClass.indexOf(ICONRIGHT) > -1) && !(newProp.cssClass &&
16218
16216
  newProp.cssClass.indexOf(ICONRIGHT) > -1) || !(oldProp.cssClass && oldProp.cssClass.indexOf(ICONRIGHT) > -1) &&