@syncfusion/ej2-navigations 20.3.47 → 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
  };
@@ -6825,8 +6800,12 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6825
6800
  this.updateItem(item, index);
6826
6801
  }
6827
6802
  if (property === 'cssClass' && !isNullOrUndefined(item)) {
6828
- item.classList.remove(oldVal);
6829
- item.classList.add(newVal);
6803
+ if (oldVal) {
6804
+ removeClass([item], oldVal.split(' '));
6805
+ }
6806
+ if (newVal) {
6807
+ addClass([item], newVal.split(' '));
6808
+ }
6830
6809
  }
6831
6810
  if (property === 'visible' && !isNullOrUndefined(item)) {
6832
6811
  if (Object(newProp.items[index])[property] === false) {
@@ -6888,14 +6867,8 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6888
6867
  setStyleAttribute(this.element, { 'width': formatUnit(newProp.width) });
6889
6868
  break;
6890
6869
  case 'expandMode':
6891
- if (newProp.expandMode === 'Single') {
6892
- this.element.setAttribute('aria-multiselectable', 'false');
6893
- if (this.expandedIndices.length > 1) {
6894
- this.expandItem(false);
6895
- }
6896
- }
6897
- else {
6898
- this.element.setAttribute('aria-multiselectable', 'true');
6870
+ if (newProp.expandMode === 'Single' && this.expandedIndices.length > 1) {
6871
+ this.expandItem(false);
6899
6872
  }
6900
6873
  break;
6901
6874
  }
@@ -9970,6 +9943,8 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
9970
9943
  _this.changeDataSource = false;
9971
9944
  _this.hasTemplate = false;
9972
9945
  _this.isFirstRender = false;
9946
+ // Specifies whether the node is dropped or not
9947
+ _this.isNodeDropped = false;
9973
9948
  _this.mouseDownStatus = false;
9974
9949
  return _this;
9975
9950
  }
@@ -11182,11 +11157,12 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
11182
11157
  this.updateCheckedProp();
11183
11158
  this.isAnimate = true;
11184
11159
  this.isInitalExpand = false;
11185
- if (!this.isLoaded || this.isFieldChange) {
11160
+ if ((!this.isLoaded || this.isFieldChange) && !this.isNodeDropped) {
11186
11161
  var eventArgs = { data: this.treeData };
11187
11162
  this.trigger('dataBound', eventArgs);
11188
11163
  }
11189
11164
  this.isLoaded = true;
11165
+ this.isNodeDropped = false;
11190
11166
  };
11191
11167
  TreeView.prototype.doSelectionAction = function () {
11192
11168
  var sNodes = selectAll('.' + SELECTED$1, this.element);
@@ -12410,8 +12386,9 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
12410
12386
  var expanded = (currLi.getAttribute('aria-expanded') === 'true') ? true : false;
12411
12387
  var hasChildren = currLi.getAttribute('aria-expanded') !== null ? true : (select('.' + EXPANDABLE, currLi) || select('.' + COLLAPSIBLE, currLi)) != null ? true : false;
12412
12388
  var checked = null;
12413
- if (this.showCheckBox) {
12414
- checked = select('.' + CHECKBOXWRAP, currLi).getAttribute('aria-checked');
12389
+ var checkboxElement = select('.' + CHECKBOXWRAP, currLi);
12390
+ if (this.showCheckBox && checkboxElement) {
12391
+ checked = checkboxElement.getAttribute('aria-checked');
12415
12392
  }
12416
12393
  return {
12417
12394
  id: id, text: text, parentID: pid, selected: selected, expanded: expanded,
@@ -12922,6 +12899,8 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
12922
12899
  this.trigger('nodeDropped', this.getDragEvent(e.event, dragObj, dropTarget, e.target, e.dragData.draggedElement, null, level, drop));
12923
12900
  if (dragObj.element.id !== this.element.id) {
12924
12901
  dragObj.triggerEvent();
12902
+ this.isNodeDropped = true;
12903
+ this.fields.dataSource = this.treeData;
12925
12904
  }
12926
12905
  this.triggerEvent();
12927
12906
  };
@@ -14977,7 +14956,7 @@ var Sidebar = /** @__PURE__ @class */ (function (_super) {
14977
14956
  if (!isNullOrUndefined(classELement || this.targetEle)) {
14978
14957
  addClass([classELement || this.targetEle], [MAINCONTENTANIMATION]);
14979
14958
  }
14980
- this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
14959
+ this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : null;
14981
14960
  if (!this.enableDock && this.type !== 'Auto') {
14982
14961
  addClass([this.element], [VISIBILITY]);
14983
14962
  }
@@ -14987,7 +14966,9 @@ var Sidebar = /** @__PURE__ @class */ (function (_super) {
14987
14966
  if (this.enableDock) {
14988
14967
  addClass([this.element], DOCKER);
14989
14968
  }
14990
- this.element.setAttribute('tabindex', this.tabIndex);
14969
+ if (!isNullOrUndefined(this.tabIndex)) {
14970
+ this.element.setAttribute('tabindex', this.tabIndex);
14971
+ }
14991
14972
  if (this.type === 'Auto' && !Browser.isDevice) {
14992
14973
  this.show();
14993
14974
  }