@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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.4.42
3
+ * version : 20.4.44
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-navigations@*",
3
- "_id": "@syncfusion/ej2-navigations@20.4.40",
3
+ "_id": "@syncfusion/ej2-navigations@20.4.43",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-aqL/RI3bBPueDC7mWSyWeklsuP5bQwak+fzLnB4ZqGi/uLtJ6A98lICKz6vGjLlyU45CfvCwIOC9Uf7aTz68EA==",
5
+ "_integrity": "sha512-i+34uRyNysO690StEyuw9/rOtO+ZTePBjmZkoChF7+FhbQx4cE3c/0EPfBsVioKxkwS9iFd1hnJSLL3NpVCiZQ==",
6
6
  "_location": "/@syncfusion/ej2-navigations",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -38,8 +38,8 @@
38
38
  "/@syncfusion/ej2-spreadsheet",
39
39
  "/@syncfusion/ej2-vue-navigations"
40
40
  ],
41
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-20.4.40.tgz",
42
- "_shasum": "9b232a4a3f24893f4b6611b4a1927d2e72a9823b",
41
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-20.4.43.tgz",
42
+ "_shasum": "a06a120de2a3bb809ab71836f16e3377c797d5ae",
43
43
  "_spec": "@syncfusion/ej2-navigations@*",
44
44
  "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
45
45
  "author": {
@@ -50,12 +50,12 @@
50
50
  },
51
51
  "bundleDependencies": false,
52
52
  "dependencies": {
53
- "@syncfusion/ej2-base": "~20.4.42",
54
- "@syncfusion/ej2-buttons": "~20.4.42",
55
- "@syncfusion/ej2-data": "~20.4.42",
53
+ "@syncfusion/ej2-base": "~20.4.44",
54
+ "@syncfusion/ej2-buttons": "~20.4.44",
55
+ "@syncfusion/ej2-data": "~20.4.44",
56
56
  "@syncfusion/ej2-inputs": "~20.4.42",
57
57
  "@syncfusion/ej2-lists": "~20.4.42",
58
- "@syncfusion/ej2-popups": "~20.4.42"
58
+ "@syncfusion/ej2-popups": "~20.4.44"
59
59
  },
60
60
  "deprecated": false,
61
61
  "description": "A package of Essential JS 2 navigation components such as Tree-view, Tab, Toolbar, Context-menu, and Accordion which is used to navigate from one page to another",
@@ -160,6 +160,6 @@
160
160
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
161
161
  },
162
162
  "typings": "index.d.ts",
163
- "version": "20.4.42",
163
+ "version": "20.4.44",
164
164
  "sideEffects": false
165
165
  }
@@ -438,14 +438,6 @@ var MenuBase = /** @class */ (function (_super) {
438
438
  if (fliIdx === (e.action === DOWNARROW ? cul.childElementCount : -1)) {
439
439
  fliIdx = defaultIdx;
440
440
  }
441
- if (cul.children[fliIdx].classList.contains(HIDE)) {
442
- if (e.action === DOWNARROW && fliIdx === cul.childElementCount - 1) {
443
- fliIdx = defaultIdx;
444
- }
445
- else if (e.action === UPARROW && fliIdx === 0) {
446
- fliIdx = defaultIdx;
447
- }
448
- }
449
441
  }
450
442
  }
451
443
  var cli = cul.children[fliIdx];
@@ -455,8 +447,15 @@ var MenuBase = /** @class */ (function (_super) {
455
447
  };
456
448
  MenuBase.prototype.isValidLI = function (cli, index, action) {
457
449
  var cul = this.getUlByNavIdx();
450
+ var defaultIdx = (action === DOWNARROW || action === HOME || action === TAB) ? 0 : cul.childElementCount - 1;
458
451
  if (cli.classList.contains(SEPARATOR) || cli.classList.contains(DISABLED) || cli.classList.contains(HIDE)) {
459
- if ((action === DOWNARROW) || (action === RIGHTARROW)) {
452
+ if (action === DOWNARROW && index === cul.childElementCount - 1) {
453
+ index = defaultIdx;
454
+ }
455
+ else if (action === UPARROW && index === 0) {
456
+ index = defaultIdx;
457
+ }
458
+ else if ((action === DOWNARROW) || (action === RIGHTARROW)) {
460
459
  index++;
461
460
  }
462
461
  else {
@@ -620,11 +619,15 @@ var MenuBase = /** @class */ (function (_super) {
620
619
  closedLi = trgtpopUp.querySelector('[id="' + trgtliId + '"]');
621
620
  trgtLi = (liElem_1 && trgtpopUp.querySelector('[id="' + liElem_1.id + '"]'));
622
621
  }
622
+ else if (trgtpopUp) {
623
+ closedLi = trgtpopUp.querySelector('.e-menu-item.e-selected');
624
+ trgtLi = (liElem_1 && trgtpopUp.querySelector('[id="' + liElem_1.id + '"]'));
625
+ }
623
626
  var submenus = liElem_1 && liElem_1.querySelectorAll('.e-menu-item');
624
627
  if (isOpen && _this.hamburgerMode && ulIndex && !(submenus.length)) {
625
628
  _this.afterCloseMenu(e);
626
629
  }
627
- else if (isOpen && !_this.hamburgerMode && _this.navIdx.length && closedLi && !trgtLi && _this.keyType !== 'left') {
630
+ else if (isOpen && !_this.hamburgerMode && closedLi && !trgtLi && _this.keyType !== 'left' && (_this.navIdx.length || !_this.isMenu && _this.navIdx.length === 0)) {
628
631
  var ele = (e && e.target.classList.contains('e-vscroll'))
629
632
  ? closest(e.target, '.e-menu-wrapper') : null;
630
633
  if (ele) {
@@ -638,7 +641,7 @@ var MenuBase = /** @class */ (function (_super) {
638
641
  }
639
642
  }
640
643
  else if (isOpen && !isIterated && !ulIndex && ((_this.hamburgerMode && _this.navIdx.length) ||
641
- _this.navIdx.length === 1)) {
644
+ _this.navIdx.length === 1 && liElem_1 && trgtpopUp !== liElem_1.parentElement)) {
642
645
  _this.closeMenu(null, e);
643
646
  }
644
647
  else if (isOpen && isNullOrUndefined(ulIndex) && _this.navIdx.length) {
package/src/tab/tab.d.ts CHANGED
@@ -515,7 +515,6 @@ export declare class Tab extends Component<HTMLElement> implements INotifyProper
515
515
  private removeActiveClass;
516
516
  private checkPopupOverflow;
517
517
  private popupHandler;
518
- private updateOrientationAttribute;
519
518
  private setCloseButton;
520
519
  private prevCtnAnimation;
521
520
  private triggerPrevAnimation;
package/src/tab/tab.js CHANGED
@@ -213,7 +213,6 @@ var Tab = /** @class */ (function (_super) {
213
213
  * @returns {void}
214
214
  */
215
215
  Tab.prototype.destroy = function () {
216
- var _this = this;
217
216
  if (this.isReact || this.isAngular) {
218
217
  this.clearTemplate();
219
218
  }
@@ -222,9 +221,7 @@ var Tab = /** @class */ (function (_super) {
222
221
  this.tbObj = null;
223
222
  }
224
223
  this.unWireEvents();
225
- ['role', 'aria-disabled', 'aria-activedescendant', 'tabindex', 'aria-orientation', 'aria-owns'].forEach(function (val) {
226
- _this.element.removeAttribute(val);
227
- });
224
+ this.element.removeAttribute('aria-disabled');
228
225
  this.expTemplateContent();
229
226
  if (!this.isTemplate) {
230
227
  while (this.element.firstElementChild) {
@@ -303,7 +300,7 @@ var Tab = /** @class */ (function (_super) {
303
300
  var css = (name === 'msie') ? 'e-ie' : (name === 'edge') ? 'e-edge' : (name === 'safari') ? 'e-safari' : '';
304
301
  setStyle(this.element, { 'width': formatUnit(this.width), 'height': formatUnit(this.height) });
305
302
  this.setCssClass(this.element, this.cssClass, true);
306
- attributes(this.element, { role: 'tablist', 'aria-disabled': 'false', 'aria-activedescendant': '', 'aria-owns': this.element.id + '_' + 'tab_header_items' });
303
+ attributes(this.element, { 'aria-disabled': 'false' });
307
304
  this.setCssClass(this.element, css, true);
308
305
  this.updatePopAnimationConfig();
309
306
  };
@@ -399,8 +396,7 @@ var Tab = /** @class */ (function (_super) {
399
396
  hdrItems.forEach(function (item, index) {
400
397
  _this.lastIndex = index;
401
398
  var attr = {
402
- className: CLS_ITEM, id: CLS_ITEM + _this.tabId + '_' + index,
403
- attrs: { role: 'tab', 'aria-controls': CLS_CONTENT + _this.tabId + '_' + index, 'aria-selected': 'false' }
399
+ className: CLS_ITEM, id: CLS_ITEM + _this.tabId + '_' + index
404
400
  };
405
401
  var txt = _this.createElement('span', {
406
402
  className: CLS_TEXT, innerHTML: item, attrs: { 'role': 'presentation' }
@@ -408,7 +404,10 @@ var Tab = /** @class */ (function (_super) {
408
404
  var cont = _this.createElement('div', {
409
405
  className: CLS_TEXT_WRAP, innerHTML: txt + _this.btnCls.outerHTML
410
406
  }).outerHTML;
411
- var wrap = _this.createElement('div', { className: CLS_WRAP, innerHTML: cont, attrs: { tabIndex: '-1' } });
407
+ var wrap = _this.createElement('div', {
408
+ className: CLS_WRAP, innerHTML: cont,
409
+ attrs: { role: 'tab', tabIndex: '-1', 'aria-selected': 'false', 'aria-controls': CLS_CONTENT + _this.tabId + '_' + index }
410
+ });
412
411
  tabItems_1.appendChild(_this.createElement('div', attr));
413
412
  selectAll('.' + CLS_ITEM, tabItems_1)[index].appendChild(wrap);
414
413
  });
@@ -427,15 +426,13 @@ var Tab = /** @class */ (function (_super) {
427
426
  this.tbObj.isStringTemplate = true;
428
427
  this.tbObj.createElement = this.createElement;
429
428
  this.tbObj.appendTo(this.hdrEle);
430
- attributes(this.hdrEle, { 'aria-label': 'tab-header' });
431
- this.updateOrientationAttribute();
429
+ attributes(this.hdrEle, { role: 'tablist' });
432
430
  this.setCloseButton(this.showCloseButton);
433
431
  var toolbarHeader = this.tbObj.element.querySelector('.' + CLS_TB_ITEMS);
434
432
  if (!isNOU(toolbarHeader)) {
435
433
  if (isNOU(toolbarHeader.id) || toolbarHeader.id === '') {
436
434
  toolbarHeader.id = this.element.id + '_' + 'tab_header_items';
437
435
  }
438
- this.element.setAttribute('aria-owns', toolbarHeader.id);
439
436
  }
440
437
  };
441
438
  Tab.prototype.renderContent = function () {
@@ -531,7 +528,7 @@ var Tab = /** @class */ (function (_super) {
531
528
  }
532
529
  }
533
530
  var tabIndex = isNOU(item.tabIndex) ? '-1' : item.tabIndex.toString();
534
- var wrapAttrs = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex };
531
+ var wrapAttrs = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex, role: 'tab', 'aria-selected': 'false' };
535
532
  tCont.appendChild(_this.btnCls.cloneNode(true));
536
533
  var wrap = _this.createElement('div', { className: CLS_WRAP, attrs: wrapAttrs });
537
534
  wrap.appendChild(tCont);
@@ -542,7 +539,7 @@ var Tab = /** @class */ (function (_super) {
542
539
  _this.itemIndexArray.splice((index + i), 0, CLS_ITEM + _this.tabId + '_' + _this.lastIndex);
543
540
  }
544
541
  var attrObj = {
545
- id: CLS_ITEM + _this.tabId + '_' + _this.lastIndex, role: 'tab', 'aria-selected': 'false'
542
+ id: CLS_ITEM + _this.tabId + '_' + _this.lastIndex
546
543
  };
547
544
  var tItem = { htmlAttributes: attrObj, template: wrap };
548
545
  tItem.cssClass = ((item.cssClass !== undefined) ? item.cssClass : ' ') + ' ' + disabled + ' ' + hidden + ' '
@@ -571,6 +568,7 @@ var Tab = /** @class */ (function (_super) {
571
568
  if (tabHeader) {
572
569
  var tabItems = selectAll('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE, tabHeader);
573
570
  [].slice.call(tabItems).forEach(function (node) { return node.classList.remove(CLS_ACTIVE); });
571
+ [].slice.call(tabItems).forEach(function (node) { return node.firstElementChild.setAttribute('aria-selected', 'false'); });
574
572
  }
575
573
  };
576
574
  Tab.prototype.checkPopupOverflow = function (ele) {
@@ -613,9 +611,6 @@ var Tab = /** @class */ (function (_super) {
613
611
  }
614
612
  return selectAll('.' + CLS_TB_ITEM, this.tbItems).length - 1;
615
613
  };
616
- Tab.prototype.updateOrientationAttribute = function () {
617
- attributes(this.element, { 'aria-orientation': (this.isVertical() ? 'vertical' : 'horizontal') });
618
- };
619
614
  Tab.prototype.setCloseButton = function (val) {
620
615
  var trg = select('.' + CLS_HEADER, this.element);
621
616
  if (val === true) {
@@ -922,7 +917,6 @@ var Tab = /** @class */ (function (_super) {
922
917
  }
923
918
  }
924
919
  this.addVerticalClass();
925
- this.updateOrientationAttribute();
926
920
  this.setActiveBorder();
927
921
  this.focusItem();
928
922
  };
@@ -1108,20 +1102,18 @@ var Tab = /** @class */ (function (_super) {
1108
1102
  if (!this.isTemplate) {
1109
1103
  var prev = this.tbItem[this.prevIndex];
1110
1104
  if (!isNOU(prev)) {
1111
- prev.removeAttribute('aria-controls');
1105
+ prev.firstElementChild.removeAttribute('aria-controls');
1112
1106
  }
1113
- attributes(trg, { 'aria-controls': CLS_CONTENT + this.tabId + '_' + value });
1107
+ attributes(trg.firstElementChild, { 'aria-controls': CLS_CONTENT + this.tabId + '_' + value });
1114
1108
  }
1115
1109
  var id = trg.id;
1116
1110
  this.removeActiveClass();
1117
1111
  trg.classList.add(CLS_ACTIVE);
1118
- this.tbItem[this.prevIndex].setAttribute('aria-selected', 'false');
1119
- trg.setAttribute('aria-selected', 'true');
1112
+ trg.firstElementChild.setAttribute('aria-selected', 'true');
1120
1113
  var no = Number(this.extIndex(id));
1121
1114
  if (isNOU(this.prevActiveEle)) {
1122
1115
  this.prevActiveEle = CLS_CONTENT + this.tabId + '_' + no;
1123
1116
  }
1124
- attributes(this.element, { 'aria-activedescendant': id });
1125
1117
  if (this.isTemplate) {
1126
1118
  if (select('.' + CLS_CONTENT, this.element).children.length > 0) {
1127
1119
  var trg_1 = this.findEle(select('.' + CLS_CONTENT, this.element).children, CLS_CONTENT + this.tabId + '_' + no);
@@ -1796,7 +1788,7 @@ var Tab = /** @class */ (function (_super) {
1796
1788
  (textValue_1.length === 0) && !isNOU(item.header) && isNOU(item.header.iconCss))) {
1797
1789
  if (tabItems_2[place]) {
1798
1790
  if (isNOU(item.id)) {
1799
- item.id = TABITEMPREFIX + (lastEleIndex + place).toString();
1791
+ item.id = CLS_ITEM + _this.tabId + '_' + TABITEMPREFIX + (lastEleIndex + place).toString();
1800
1792
  }
1801
1793
  tabItems_2[place].htmlAttributes['data-id'] = item.id;
1802
1794
  }
@@ -2229,7 +2221,7 @@ var Tab = /** @class */ (function (_super) {
2229
2221
  }
2230
2222
  }
2231
2223
  var tabIndex = isNOU(item.tabIndex) ? '-1' : item.tabIndex.toString();
2232
- var wrapAtt = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex };
2224
+ var wrapAtt = (item.disabled) ? {} : { tabIndex: tabIndex, 'data-tabindex': tabIndex, role: 'tab', 'aria-selected': 'true' };
2233
2225
  tConts.appendChild(this.btnCls.cloneNode(true));
2234
2226
  var wraper = this.createElement('div', { className: CLS_WRAP, attrs: wrapAtt });
2235
2227
  wraper.appendChild(tConts);
@@ -2280,11 +2272,7 @@ var Tab = /** @class */ (function (_super) {
2280
2272
  detach(element);
2281
2273
  detach(detachContent);
2282
2274
  var attr = {
2283
- className: CLS_TB_ITEM + ' ' + CLS_TEMPLATE + ' ' + CLS_ACTIVE, id: CLS_ITEM + this.tabId + '_' + index,
2284
- attrs: {
2285
- role: 'tab', 'aria-controls': CLS_CONTENT + this.tabId + '_' + index,
2286
- 'aria-disabled': 'false', 'aria-selected': 'true'
2287
- }
2275
+ className: CLS_TB_ITEM + ' ' + CLS_TEMPLATE + ' ' + CLS_ACTIVE, id: CLS_ITEM + this.tabId + '_' + index
2288
2276
  };
2289
2277
  var txtString = this.createElement('span', {
2290
2278
  className: CLS_TEXT, innerHTML: header, attrs: { 'role': 'presentation' }
@@ -2294,7 +2282,8 @@ var Tab = /** @class */ (function (_super) {
2294
2282
  }).outerHTML;
2295
2283
  var tabIndex = element.firstElementChild.getAttribute('data-tabindex');
2296
2284
  var wrap = this.createElement('div', {
2297
- className: CLS_WRAP, innerHTML: conte, attrs: { tabIndex: tabIndex, 'data-tabindex': tabIndex }
2285
+ className: CLS_WRAP, innerHTML: conte,
2286
+ attrs: { tabIndex: tabIndex, 'data-tabindex': tabIndex, role: 'tab', 'aria-controls': CLS_CONTENT + this.tabId + '_' + index, 'aria-selected': 'true' }
2298
2287
  });
2299
2288
  tabItems.insertBefore(this.createElement('div', attr), tabItems.children[index + 1]);
2300
2289
  this.element.querySelector('.' + CLS_TB_ITEM + '.' + CLS_ACTIVE).appendChild(wrap);
@@ -1478,7 +1478,7 @@ var TreeView = /** @class */ (function (_super) {
1478
1478
  }
1479
1479
  };
1480
1480
  TreeView.prototype.clickHandler = function (event) {
1481
- var target = event.originalEvent.target;
1481
+ var target = Browser.isDevice ? document.elementFromPoint(event.originalEvent.changedTouches[0].clientX, event.originalEvent.changedTouches[0].clientY) : event.originalEvent.target;
1482
1482
  EventHandler.remove(this.element, 'contextmenu', this.preventContextMenu);
1483
1483
  if (!target || this.dragStartAction) {
1484
1484
  return;