@syncfusion/ej2-navigations 20.3.48 → 20.3.50

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.
@@ -2894,9 +2894,9 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
2894
2894
  ul.querySelector('.' + FOCUSED).focus();
2895
2895
  }
2896
2896
  else {
2897
+ var ele = this.getWrapper().children[this.getIdx(this.getWrapper(), ul) - 1];
2897
2898
  if (this.currentTarget) {
2898
- if (!(this.currentTarget.classList.contains("e-numerictextbox") || this.currentTarget.classList.contains("e-textbox"))) {
2899
- var ele = this.getWrapper().children[this.getIdx(this.getWrapper(), ul) - 1];
2899
+ if (!(this.currentTarget.classList.contains("e-numerictextbox") || this.currentTarget.classList.contains("e-textbox") || this.currentTarget.tagName === 'INPUT')) {
2900
2900
  if (ele) {
2901
2901
  ele.querySelector('.' + SELECTED).focus();
2902
2902
  }
@@ -2905,6 +2905,14 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
2905
2905
  }
2906
2906
  }
2907
2907
  }
2908
+ else {
2909
+ if (ele) {
2910
+ ele.querySelector('.' + SELECTED).focus();
2911
+ }
2912
+ else {
2913
+ this.element.focus();
2914
+ }
2915
+ }
2908
2916
  }
2909
2917
  }
2910
2918
  else {
@@ -3149,7 +3157,7 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
3149
3157
  menuitem = new MenuItem(iitems[0], 'items', items[i], true);
3150
3158
  iitems.splice(isAfter ? idx + 1 : idx, 0, menuitem);
3151
3159
  var uls = this.isMenu ? [this.getWrapper()].concat(this.getPopups()) : [].slice.call(this.getWrapper().children);
3152
- if (navIdx.length < uls.length) {
3160
+ if (!isNullOrUndefined(idx) && navIdx.length < uls.length) {
3153
3161
  idx = isAfter ? idx + 1 : idx;
3154
3162
  li = this.createItems(iitems).children[idx];
3155
3163
  var ul = this.isMenu ? select('.e-menu-parent', uls[navIdx.length]) : uls[navIdx.length];
@@ -5732,7 +5740,6 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
5732
5740
  * @returns {void}
5733
5741
  */
5734
5742
  Accordion.prototype.destroy = function () {
5735
- var _this = this;
5736
5743
  if (this.isReact || this.isAngular || this.isVue) {
5737
5744
  this.clearTemplate();
5738
5745
  }
@@ -5753,9 +5760,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
5753
5760
  }
5754
5761
  ele.classList.remove(CLS_ACRDN_ROOT);
5755
5762
  ele.removeAttribute('style');
5756
- ['aria-disabled', 'aria-multiselectable', 'role', 'data-ripple'].forEach(function (attrb) {
5757
- _this.element.removeAttribute(attrb);
5758
- });
5763
+ this.element.removeAttribute('data-ripple');
5759
5764
  if (!this.isNested && isRippleEnabled) {
5760
5765
  this.removeRippleEffect();
5761
5766
  }
@@ -5804,19 +5809,12 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
5804
5809
  var width = formatUnit(this.width);
5805
5810
  var height = formatUnit(this.height);
5806
5811
  setStyleAttribute(this.element, { 'width': width, 'height': height });
5807
- var ariaAttr = {
5808
- 'aria-disabled': 'false', 'role': 'presentation', 'aria-multiselectable': 'true'
5809
- };
5810
5812
  if (isNullOrUndefined(this.initExpand)) {
5811
5813
  this.initExpand = [];
5812
5814
  }
5813
5815
  if (this.expandedIndices.length > 0) {
5814
5816
  this.initExpand = this.expandedIndices;
5815
5817
  }
5816
- attributes(this.element, ariaAttr);
5817
- if (this.expandMode === 'Single') {
5818
- this.element.setAttribute('aria-multiselectable', 'false');
5819
- }
5820
5818
  };
5821
5819
  Accordion.prototype.renderControl = function () {
5822
5820
  this.trgtEle = (this.element.children.length > 0) ? select('div', this.element) : null;
@@ -6127,18 +6125,15 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6127
6125
  };
6128
6126
  Accordion.prototype.headerEleGenerate = function () {
6129
6127
  var header = this.createElement('div', { className: CLS_HEADER, id: getUniqueID('acrdn_header') });
6130
- var items = this.getItems();
6131
6128
  var ariaAttr = {
6132
- 'tabindex': '0', 'role': 'heading', 'aria-label': 'collapsed',
6133
- 'aria-disabled': 'false', 'aria-level': items.length.toString()
6129
+ 'tabindex': '0', 'role': 'button', 'aria-disabled': 'false', 'aria-expanded': 'false'
6134
6130
  };
6135
6131
  attributes(header, ariaAttr);
6136
6132
  return header;
6137
6133
  };
6138
6134
  Accordion.prototype.renderInnerItem = function (item, index) {
6139
6135
  var innerEle = this.createElement('div', {
6140
- className: CLS_ITEM$1, id: item.id || getUniqueID('acrdn_item'),
6141
- attrs: { 'aria-expanded': 'false', 'role': 'row' }
6136
+ className: CLS_ITEM$1, id: item.id || getUniqueID('acrdn_item')
6142
6137
  });
6143
6138
  if (this.headerTemplate) {
6144
6139
  var ctnEle = this.headerEleGenerate();
@@ -6286,7 +6281,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6286
6281
  var content = select('.' + CLS_CONTENT, itemEle);
6287
6282
  header.setAttribute('aria-controls', content.id);
6288
6283
  content.setAttribute('aria-labelledby', header.id);
6289
- content.setAttribute('role', 'definition');
6284
+ content.setAttribute('role', 'region');
6290
6285
  };
6291
6286
  Accordion.prototype.contentRendering = function (index) {
6292
6287
  var itemcnt = this.createElement('div', { className: CLS_CONTENT + ' ' + CLS_CTNHIDE, id: getUniqueID('acrdn_panel') });
@@ -6385,8 +6380,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6385
6380
  if (progress === 'end') {
6386
6381
  this.add(trgtItemEle, CLS_ACTIVE);
6387
6382
  trgt.setAttribute('aria-hidden', 'false');
6388
- attributes(trgtItemEle, { 'aria-expanded': 'true' });
6389
- attributes(trgt.previousElementSibling, { 'aria-label': 'expanded' });
6383
+ attributes(trgt.previousElementSibling, { 'aria-expanded': 'true' });
6390
6384
  icon.classList.remove(CLS_TOGANIMATE);
6391
6385
  this.trigger('expanded', eventArgs);
6392
6386
  }
@@ -6502,8 +6496,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6502
6496
  icon.classList.remove(CLS_TOGANIMATE);
6503
6497
  this.remove(trgtItemEle, CLS_ACTIVE);
6504
6498
  trgt.setAttribute('aria-hidden', 'true');
6505
- attributes(trgtItemEle, { 'aria-expanded': 'false' });
6506
- attributes(trgt.previousElementSibling, { 'aria-label': 'collapsed' });
6499
+ attributes(trgt.previousElementSibling, { 'aria-expanded': 'false' });
6507
6500
  this.trigger('expanded', eventArgs);
6508
6501
  }
6509
6502
  };
@@ -6516,14 +6509,6 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6516
6509
  Accordion.prototype.getModuleName = function () {
6517
6510
  return 'accordion';
6518
6511
  };
6519
- Accordion.prototype.itemAttribUpdate = function () {
6520
- var items = this.getItems();
6521
- var itemEle = this.getItemElements();
6522
- var itemLen = items.length;
6523
- itemEle.forEach(function (ele) {
6524
- select('.' + CLS_HEADER, ele).setAttribute('aria-level', '' + itemLen);
6525
- });
6526
- };
6527
6512
  Accordion.prototype.getItems = function () {
6528
6513
  var items;
6529
6514
  if (this.itemTemplate && this.headerTemplate) {
@@ -6564,7 +6549,6 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6564
6549
  }
6565
6550
  EventHandler.add(innerItemEle.querySelector('.' + CLS_HEADER), 'focus', _this.focusIn, _this);
6566
6551
  EventHandler.add(innerItemEle.querySelector('.' + CLS_HEADER), 'blur', _this.focusOut, _this);
6567
- _this.itemAttribUpdate();
6568
6552
  _this.expandedIndices = [];
6569
6553
  _this.expandedItemRefresh(ele);
6570
6554
  if (addItem && addItem.expanded) {
@@ -6605,7 +6589,6 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6605
6589
  this.restoreContent(index);
6606
6590
  detach(ele);
6607
6591
  items.splice(index, 1);
6608
- this.itemAttribUpdate();
6609
6592
  this.expandedIndices = [];
6610
6593
  this.expandedItemRefresh(this.element);
6611
6594
  };
@@ -6892,14 +6875,8 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6892
6875
  setStyleAttribute(this.element, { 'width': formatUnit(newProp.width) });
6893
6876
  break;
6894
6877
  case 'expandMode':
6895
- if (newProp.expandMode === 'Single') {
6896
- this.element.setAttribute('aria-multiselectable', 'false');
6897
- if (this.expandedIndices.length > 1) {
6898
- this.expandItem(false);
6899
- }
6900
- }
6901
- else {
6902
- this.element.setAttribute('aria-multiselectable', 'true');
6878
+ if (newProp.expandMode === 'Single' && this.expandedIndices.length > 1) {
6879
+ this.expandItem(false);
6903
6880
  }
6904
6881
  break;
6905
6882
  }
@@ -14987,7 +14964,7 @@ var Sidebar = /** @__PURE__ @class */ (function (_super) {
14987
14964
  if (!isNullOrUndefined(classELement || this.targetEle)) {
14988
14965
  addClass([classELement || this.targetEle], [MAINCONTENTANIMATION]);
14989
14966
  }
14990
- this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
14967
+ this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : null;
14991
14968
  if (!this.enableDock && this.type !== 'Auto') {
14992
14969
  addClass([this.element], [VISIBILITY]);
14993
14970
  }
@@ -14997,7 +14974,9 @@ var Sidebar = /** @__PURE__ @class */ (function (_super) {
14997
14974
  if (this.enableDock) {
14998
14975
  addClass([this.element], DOCKER);
14999
14976
  }
15000
- this.element.setAttribute('tabindex', this.tabIndex);
14977
+ if (!isNullOrUndefined(this.tabIndex)) {
14978
+ this.element.setAttribute('tabindex', this.tabIndex);
14979
+ }
15001
14980
  if (this.type === 'Auto' && !Browser.isDevice) {
15002
14981
  this.show();
15003
14982
  }