@syncfusion/ej2-navigations 21.2.3 → 21.2.5

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.
@@ -1896,9 +1896,29 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1896
1896
  else {
1897
1897
  this.uList = this.element;
1898
1898
  this.uList.style.zIndex = getZindexPartial(target ? target : this.element).toString();
1899
- this.triggerBeforeOpen(li, this.uList, item, e, top, left, 'none');
1899
+ if (isNullOrUndefined(e)) {
1900
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1901
+ var ev = document.createEvent('MouseEvents');
1902
+ ev.initEvent("click", true, false);
1903
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1904
+ var targetEvent = this.copyObject(ev, {});
1905
+ targetEvent.target = targetEvent.srcElement = target;
1906
+ targetEvent.currentTarget = target;
1907
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1908
+ this.triggerBeforeOpen(li, this.uList, item, targetEvent, top, left, 'none');
1909
+ }
1910
+ else {
1911
+ this.triggerBeforeOpen(li, this.uList, item, e, top, left, 'none');
1912
+ }
1900
1913
  }
1901
1914
  };
1915
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1916
+ MenuBase.prototype.copyObject = function (source, destination) {
1917
+ for (var prop in source) {
1918
+ destination["" + prop] = source["" + prop];
1919
+ }
1920
+ return destination;
1921
+ };
1902
1922
  MenuBase.prototype.calculateIndentSize = function (ul, li) {
1903
1923
  var liStyle = getComputedStyle(li);
1904
1924
  var liIndent = parseInt(liStyle.textIndent, 10);
@@ -3065,7 +3085,7 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
3065
3085
  }
3066
3086
  idx = navIdx.pop();
3067
3087
  ul = this.getUlByNavIdx(navIdx.length);
3068
- if (ul) {
3088
+ if (ul && !isNullOrUndefined(idx)) {
3069
3089
  if (enable) {
3070
3090
  if (this.isMenu) {
3071
3091
  ul.children[idx].classList.remove(disabled);
@@ -7775,15 +7795,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7775
7795
  this.setContentHeight(true);
7776
7796
  this.select(this.selectedItem);
7777
7797
  }
7778
- this.tbItem = selectAll('.' + CLS_TB_ITEM, this.hdrEle);
7779
- if (!isNullOrUndefined(this.tbItem)) {
7780
- for (var i = 0; i < this.items.length; i++) {
7781
- if (this.tbItem[i]) {
7782
- var tabID = this.items[i].id;
7783
- this.tbItem[i].setAttribute('data-id', tabID);
7784
- }
7785
- }
7786
- }
7787
7798
  this.setRTL(this.enableRtl);
7788
7799
  }
7789
7800
  };
@@ -7803,12 +7814,9 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7803
7814
  var count = this.hdrEle.children.length;
7804
7815
  var hdrItems = [];
7805
7816
  for (var i = 0; i < count; i++) {
7806
- hdrItems.push(this.hdrEle.children.item(i).innerHTML);
7817
+ hdrItems.push(this.hdrEle.children.item(i));
7807
7818
  }
7808
7819
  if (count > 0) {
7809
- while (this.hdrEle.firstElementChild) {
7810
- detach(this.hdrEle.firstElementChild);
7811
- }
7812
7820
  var tabItems_1 = this.createElement('div', { className: CLS_ITEMS$1 });
7813
7821
  this.hdrEle.appendChild(tabItems_1);
7814
7822
  hdrItems.forEach(function (item, index) {
@@ -7817,7 +7825,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7817
7825
  className: CLS_ITEM$2, id: CLS_ITEM$2 + _this.tabId + '_' + index
7818
7826
  };
7819
7827
  var txt = _this.createElement('span', {
7820
- className: CLS_TEXT, innerHTML: item, attrs: { 'role': 'presentation' }
7828
+ className: CLS_TEXT, attrs: { 'role': 'presentation' }
7821
7829
  }).outerHTML;
7822
7830
  var cont = _this.createElement('div', {
7823
7831
  className: CLS_TEXT_WRAP, innerHTML: txt + _this.btnCls.outerHTML
@@ -7826,6 +7834,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7826
7834
  className: CLS_WRAP, innerHTML: cont,
7827
7835
  attrs: { role: 'tab', tabIndex: '-1', 'aria-selected': 'false', 'aria-controls': CLS_CONTENT$1 + _this.tabId + '_' + index, 'aria-disabled': 'false' }
7828
7836
  });
7837
+ wrap.querySelector('.' + CLS_TEXT).appendChild(item);
7829
7838
  tabItems_1.appendChild(_this.createElement('div', attr));
7830
7839
  selectAll('.' + CLS_ITEM$2, tabItems_1)[index].appendChild(wrap);
7831
7840
  });
@@ -7964,7 +7973,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7964
7973
  _this.itemIndexArray.splice((index + i), 0, CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex);
7965
7974
  }
7966
7975
  var attrObj = {
7967
- id: CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex
7976
+ id: CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex, 'data-id': item.id
7968
7977
  };
7969
7978
  var tItem = { htmlAttributes: attrObj, template: wrap };
7970
7979
  tItem.cssClass = ((item.cssClass !== undefined) ? item.cssClass : ' ') + ' ' + disabled + ' ' + hidden + ' '
@@ -9048,6 +9057,10 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9048
9057
  };
9049
9058
  this.trigger('onDragStart', dragArgs, function (tabitemDragArgs) {
9050
9059
  if (tabitemDragArgs.cancel) {
9060
+ var dragObj = e.element.ej2_instances[0];
9061
+ if (!isNullOrUndefined(dragObj)) {
9062
+ dragObj.intDestroy(e.event);
9063
+ }
9051
9064
  detach(_this.cloneElement);
9052
9065
  }
9053
9066
  else {
@@ -12804,6 +12817,8 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
12804
12817
  enableTailMode: true, enableAutoScroll: true,
12805
12818
  dragArea: this.dragArea,
12806
12819
  dragTarget: '.' + TEXTWRAP,
12820
+ enableTapHold: true,
12821
+ tapHoldThreshold: 100,
12807
12822
  helper: function (e) {
12808
12823
  _this.dragTarget = e.sender.target;
12809
12824
  var dragRoot = closest(_this.dragTarget, '.' + ROOT);
@@ -13233,7 +13248,10 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13233
13248
  dropUl.style.display = 'none';
13234
13249
  }
13235
13250
  if (isNullOrUndefined(dropUl)) {
13236
- this.trigger('nodeExpanding', this.getExpandEvent(dropLi, null));
13251
+ var args = this.expandArgs;
13252
+ if (isNullOrUndefined(args) || args.name != 'nodeExpanding') {
13253
+ this.trigger('nodeExpanding', this.getExpandEvent(dropLi, null));
13254
+ }
13237
13255
  if (isNullOrUndefined(dropIcon)) {
13238
13256
  ListBase.generateIcon(this.createElement, dropLi, COLLAPSIBLE, this.listBaseOption);
13239
13257
  }
@@ -13583,6 +13601,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13583
13601
  }
13584
13602
  refNode = dropUl.childNodes[index];
13585
13603
  if (!this.isFirstRender || this.dataType === 1) {
13604
+ var args = this.expandArgs;
13586
13605
  if (refNode || this.sortOrder === 'None') {
13587
13606
  for (var i = 0; i < li.length; i++) {
13588
13607
  dropUl.insertBefore(li[i], refNode);
@@ -13590,7 +13609,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13590
13609
  if (this.dataType === 1 && !isNullOrUndefined(dropLi) && !isNullOrUndefined(this.element.offsetParent) && !this.element.offsetParent.parentElement.classList.contains('e-filemanager')) {
13591
13610
  this.preventExpand = false;
13592
13611
  var dropIcon = select('div.' + ICON, dropLi);
13593
- if (dropIcon && dropIcon.classList.contains(EXPANDABLE)) {
13612
+ if (dropIcon && dropIcon.classList.contains(EXPANDABLE) && (isNullOrUndefined(args) || args.name != 'nodeExpanding')) {
13594
13613
  this.expandAction(dropLi, dropIcon, null);
13595
13614
  }
13596
13615
  }
@@ -13603,7 +13622,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13603
13622
  if (this.dataType === 1 && !isNullOrUndefined(dropLi) && !isNullOrUndefined(this.element.offsetParent) && !this.element.offsetParent.parentElement.classList.contains('e-filemanager')) {
13604
13623
  this.preventExpand = false;
13605
13624
  var dropIcon = select('div.' + ICON, dropLi);
13606
- if (dropIcon && dropIcon.classList.contains(EXPANDABLE)) {
13625
+ if (dropIcon && dropIcon.classList.contains(EXPANDABLE) && (isNullOrUndefined(args) || args.name != 'nodeExpanding')) {
13607
13626
  this.expandAction(dropLi, dropIcon, null);
13608
13627
  }
13609
13628
  }