@syncfusion/ej2-navigations 20.3.48 → 20.3.49

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.
@@ -3149,7 +3149,7 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
3149
3149
  menuitem = new MenuItem(iitems[0], 'items', items[i], true);
3150
3150
  iitems.splice(isAfter ? idx + 1 : idx, 0, menuitem);
3151
3151
  var uls = this.isMenu ? [this.getWrapper()].concat(this.getPopups()) : [].slice.call(this.getWrapper().children);
3152
- if (navIdx.length < uls.length) {
3152
+ if (!isNullOrUndefined(idx) && navIdx.length < uls.length) {
3153
3153
  idx = isAfter ? idx + 1 : idx;
3154
3154
  li = this.createItems(iitems).children[idx];
3155
3155
  var ul = this.isMenu ? select('.e-menu-parent', uls[navIdx.length]) : uls[navIdx.length];
@@ -5732,7 +5732,6 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
5732
5732
  * @returns {void}
5733
5733
  */
5734
5734
  Accordion.prototype.destroy = function () {
5735
- var _this = this;
5736
5735
  if (this.isReact || this.isAngular || this.isVue) {
5737
5736
  this.clearTemplate();
5738
5737
  }
@@ -5753,9 +5752,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
5753
5752
  }
5754
5753
  ele.classList.remove(CLS_ACRDN_ROOT);
5755
5754
  ele.removeAttribute('style');
5756
- ['aria-disabled', 'aria-multiselectable', 'role', 'data-ripple'].forEach(function (attrb) {
5757
- _this.element.removeAttribute(attrb);
5758
- });
5755
+ this.element.removeAttribute('data-ripple');
5759
5756
  if (!this.isNested && isRippleEnabled) {
5760
5757
  this.removeRippleEffect();
5761
5758
  }
@@ -5804,19 +5801,12 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
5804
5801
  var width = formatUnit(this.width);
5805
5802
  var height = formatUnit(this.height);
5806
5803
  setStyleAttribute(this.element, { 'width': width, 'height': height });
5807
- var ariaAttr = {
5808
- 'aria-disabled': 'false', 'role': 'presentation', 'aria-multiselectable': 'true'
5809
- };
5810
5804
  if (isNullOrUndefined(this.initExpand)) {
5811
5805
  this.initExpand = [];
5812
5806
  }
5813
5807
  if (this.expandedIndices.length > 0) {
5814
5808
  this.initExpand = this.expandedIndices;
5815
5809
  }
5816
- attributes(this.element, ariaAttr);
5817
- if (this.expandMode === 'Single') {
5818
- this.element.setAttribute('aria-multiselectable', 'false');
5819
- }
5820
5810
  };
5821
5811
  Accordion.prototype.renderControl = function () {
5822
5812
  this.trgtEle = (this.element.children.length > 0) ? select('div', this.element) : null;
@@ -6127,18 +6117,15 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6127
6117
  };
6128
6118
  Accordion.prototype.headerEleGenerate = function () {
6129
6119
  var header = this.createElement('div', { className: CLS_HEADER, id: getUniqueID('acrdn_header') });
6130
- var items = this.getItems();
6131
6120
  var ariaAttr = {
6132
- 'tabindex': '0', 'role': 'heading', 'aria-label': 'collapsed',
6133
- 'aria-disabled': 'false', 'aria-level': items.length.toString()
6121
+ 'tabindex': '0', 'role': 'button', 'aria-disabled': 'false', 'aria-expanded': 'false'
6134
6122
  };
6135
6123
  attributes(header, ariaAttr);
6136
6124
  return header;
6137
6125
  };
6138
6126
  Accordion.prototype.renderInnerItem = function (item, index) {
6139
6127
  var innerEle = this.createElement('div', {
6140
- className: CLS_ITEM$1, id: item.id || getUniqueID('acrdn_item'),
6141
- attrs: { 'aria-expanded': 'false', 'role': 'row' }
6128
+ className: CLS_ITEM$1, id: item.id || getUniqueID('acrdn_item')
6142
6129
  });
6143
6130
  if (this.headerTemplate) {
6144
6131
  var ctnEle = this.headerEleGenerate();
@@ -6286,7 +6273,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6286
6273
  var content = select('.' + CLS_CONTENT, itemEle);
6287
6274
  header.setAttribute('aria-controls', content.id);
6288
6275
  content.setAttribute('aria-labelledby', header.id);
6289
- content.setAttribute('role', 'definition');
6276
+ content.setAttribute('role', 'region');
6290
6277
  };
6291
6278
  Accordion.prototype.contentRendering = function (index) {
6292
6279
  var itemcnt = this.createElement('div', { className: CLS_CONTENT + ' ' + CLS_CTNHIDE, id: getUniqueID('acrdn_panel') });
@@ -6385,8 +6372,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6385
6372
  if (progress === 'end') {
6386
6373
  this.add(trgtItemEle, CLS_ACTIVE);
6387
6374
  trgt.setAttribute('aria-hidden', 'false');
6388
- attributes(trgtItemEle, { 'aria-expanded': 'true' });
6389
- attributes(trgt.previousElementSibling, { 'aria-label': 'expanded' });
6375
+ attributes(trgt.previousElementSibling, { 'aria-expanded': 'true' });
6390
6376
  icon.classList.remove(CLS_TOGANIMATE);
6391
6377
  this.trigger('expanded', eventArgs);
6392
6378
  }
@@ -6502,8 +6488,7 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6502
6488
  icon.classList.remove(CLS_TOGANIMATE);
6503
6489
  this.remove(trgtItemEle, CLS_ACTIVE);
6504
6490
  trgt.setAttribute('aria-hidden', 'true');
6505
- attributes(trgtItemEle, { 'aria-expanded': 'false' });
6506
- attributes(trgt.previousElementSibling, { 'aria-label': 'collapsed' });
6491
+ attributes(trgt.previousElementSibling, { 'aria-expanded': 'false' });
6507
6492
  this.trigger('expanded', eventArgs);
6508
6493
  }
6509
6494
  };
@@ -6516,14 +6501,6 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6516
6501
  Accordion.prototype.getModuleName = function () {
6517
6502
  return 'accordion';
6518
6503
  };
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
6504
  Accordion.prototype.getItems = function () {
6528
6505
  var items;
6529
6506
  if (this.itemTemplate && this.headerTemplate) {
@@ -6564,7 +6541,6 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6564
6541
  }
6565
6542
  EventHandler.add(innerItemEle.querySelector('.' + CLS_HEADER), 'focus', _this.focusIn, _this);
6566
6543
  EventHandler.add(innerItemEle.querySelector('.' + CLS_HEADER), 'blur', _this.focusOut, _this);
6567
- _this.itemAttribUpdate();
6568
6544
  _this.expandedIndices = [];
6569
6545
  _this.expandedItemRefresh(ele);
6570
6546
  if (addItem && addItem.expanded) {
@@ -6605,7 +6581,6 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6605
6581
  this.restoreContent(index);
6606
6582
  detach(ele);
6607
6583
  items.splice(index, 1);
6608
- this.itemAttribUpdate();
6609
6584
  this.expandedIndices = [];
6610
6585
  this.expandedItemRefresh(this.element);
6611
6586
  };
@@ -6892,14 +6867,8 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6892
6867
  setStyleAttribute(this.element, { 'width': formatUnit(newProp.width) });
6893
6868
  break;
6894
6869
  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');
6870
+ if (newProp.expandMode === 'Single' && this.expandedIndices.length > 1) {
6871
+ this.expandItem(false);
6903
6872
  }
6904
6873
  break;
6905
6874
  }
@@ -14987,7 +14956,7 @@ var Sidebar = /** @__PURE__ @class */ (function (_super) {
14987
14956
  if (!isNullOrUndefined(classELement || this.targetEle)) {
14988
14957
  addClass([classELement || this.targetEle], [MAINCONTENTANIMATION]);
14989
14958
  }
14990
- this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
14959
+ this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : null;
14991
14960
  if (!this.enableDock && this.type !== 'Auto') {
14992
14961
  addClass([this.element], [VISIBILITY]);
14993
14962
  }
@@ -14997,7 +14966,9 @@ var Sidebar = /** @__PURE__ @class */ (function (_super) {
14997
14966
  if (this.enableDock) {
14998
14967
  addClass([this.element], DOCKER);
14999
14968
  }
15000
- this.element.setAttribute('tabindex', this.tabIndex);
14969
+ if (!isNullOrUndefined(this.tabIndex)) {
14970
+ this.element.setAttribute('tabindex', this.tabIndex);
14971
+ }
15001
14972
  if (this.type === 'Auto' && !Browser.isDevice) {
15002
14973
  this.show();
15003
14974
  }