@syncfusion/ej2-navigations 21.2.3 → 21.2.4

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);
@@ -7803,12 +7823,9 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7803
7823
  var count = this.hdrEle.children.length;
7804
7824
  var hdrItems = [];
7805
7825
  for (var i = 0; i < count; i++) {
7806
- hdrItems.push(this.hdrEle.children.item(i).innerHTML);
7826
+ hdrItems.push(this.hdrEle.children.item(i));
7807
7827
  }
7808
7828
  if (count > 0) {
7809
- while (this.hdrEle.firstElementChild) {
7810
- detach(this.hdrEle.firstElementChild);
7811
- }
7812
7829
  var tabItems_1 = this.createElement('div', { className: CLS_ITEMS$1 });
7813
7830
  this.hdrEle.appendChild(tabItems_1);
7814
7831
  hdrItems.forEach(function (item, index) {
@@ -7817,7 +7834,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7817
7834
  className: CLS_ITEM$2, id: CLS_ITEM$2 + _this.tabId + '_' + index
7818
7835
  };
7819
7836
  var txt = _this.createElement('span', {
7820
- className: CLS_TEXT, innerHTML: item, attrs: { 'role': 'presentation' }
7837
+ className: CLS_TEXT, attrs: { 'role': 'presentation' }
7821
7838
  }).outerHTML;
7822
7839
  var cont = _this.createElement('div', {
7823
7840
  className: CLS_TEXT_WRAP, innerHTML: txt + _this.btnCls.outerHTML
@@ -7826,6 +7843,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7826
7843
  className: CLS_WRAP, innerHTML: cont,
7827
7844
  attrs: { role: 'tab', tabIndex: '-1', 'aria-selected': 'false', 'aria-controls': CLS_CONTENT$1 + _this.tabId + '_' + index, 'aria-disabled': 'false' }
7828
7845
  });
7846
+ wrap.querySelector('.' + CLS_TEXT).appendChild(item);
7829
7847
  tabItems_1.appendChild(_this.createElement('div', attr));
7830
7848
  selectAll('.' + CLS_ITEM$2, tabItems_1)[index].appendChild(wrap);
7831
7849
  });