@syncfusion/ej2-navigations 21.2.4 → 21.2.6

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.
@@ -6838,6 +6838,12 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6838
6838
  var itemObj = items[parseInt(index.toString(), 10)];
6839
6839
  items.splice(index, 1);
6840
6840
  this.restoreContent(index);
6841
+ var header = select('.' + CLS_HEADERCTN, item);
6842
+ var content = select('.' + CLS_CTENT, item);
6843
+ if (this.isReact || this.isAngular) {
6844
+ this.clearAccordionTemplate(header, 'header', CLS_HEADERCTN);
6845
+ this.clearAccordionTemplate(content, 'content', CLS_CTENT);
6846
+ }
6841
6847
  detach(item);
6842
6848
  this.addItem(itemObj, index);
6843
6849
  }
@@ -6858,6 +6864,30 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6858
6864
  });
6859
6865
  }
6860
6866
  };
6867
+ Accordion.prototype.clearAccordionTemplate = function (templateEle, templateName, className) {
6868
+ if (this.registeredTemplate && this.registeredTemplate["" + templateName]) {
6869
+ var registeredTemplates = this.registeredTemplate;
6870
+ for (var index = 0; index < registeredTemplates["" + templateName].length; index++) {
6871
+ var registeredItem = registeredTemplates["" + templateName][parseInt(index.toString(), 10)].rootNodes[0];
6872
+ var closestItem = closest(registeredItem.containerInfo, '.' + className);
6873
+ if (!isNullOrUndefined(closestItem) && closestItem === templateEle) {
6874
+ this.clearTemplate([templateName], [registeredTemplates["" + templateName][parseInt(index.toString(), 10)]]);
6875
+ break;
6876
+ }
6877
+ }
6878
+ }
6879
+ else if (this.portals && this.portals.length > 0) {
6880
+ var portals = this.portals;
6881
+ for (var index = 0; index < portals.length; index++) {
6882
+ var portalItem = portals[parseInt(index.toString(), 10)];
6883
+ var closestItem = closest(portalItem.containerInfo, '.' + className);
6884
+ if (!isNullOrUndefined(closestItem) && closestItem === templateEle) {
6885
+ this.clearTemplate([templateName], index);
6886
+ break;
6887
+ }
6888
+ }
6889
+ }
6890
+ };
6861
6891
  Accordion.prototype.getPersistData = function () {
6862
6892
  var keyEntity = ['expandedIndices'];
6863
6893
  return this.addOnPersist(keyEntity);
@@ -6881,44 +6911,50 @@ var Accordion = /** @__PURE__ @class */ (function (_super) {
6881
6911
  var changedProp = Object.keys(newProp.items);
6882
6912
  for (var j = 0; j < changedProp.length; j++) {
6883
6913
  var index = parseInt(Object.keys(newProp.items)[parseInt(j.toString(), 10)], 10);
6884
- var property = Object.keys(newProp.items[parseInt(index.toString(), 10)])[0];
6885
- var item = selectAll('.' + CLS_ITEM$1, this.element)[parseInt(index.toString(), 10)];
6886
- var oldVal = Object(oldProp.items[parseInt(index.toString(), 10)])["" + property];
6887
- var newVal = Object(newProp.items[parseInt(index.toString(), 10)])["" + property];
6888
- var temp = property;
6889
- if (temp === 'header' || temp === 'iconCss' || temp === 'expanded' || ((temp === 'content') && (oldVal === ''))) {
6890
- this.updateItem(item, index);
6891
- }
6892
- if (property === 'cssClass' && !isNullOrUndefined(item)) {
6893
- if (oldVal) {
6894
- removeClass([item], oldVal.split(' '));
6895
- }
6896
- if (newVal) {
6897
- addClass([item], newVal.split(' '));
6914
+ var property = Object.keys(newProp.items[parseInt(index.toString(), 10)]);
6915
+ for (var k = 0; k < property.length; k++) {
6916
+ var item = selectAll('.' + CLS_ITEM$1, this.element)[parseInt(index.toString(), 10)];
6917
+ var oldVal = Object(oldProp.items[parseInt(index.toString(), 10)])["" + property[parseInt(k.toString(), 10)]];
6918
+ var newVal = Object(newProp.items[parseInt(index.toString(), 10)])["" + property[parseInt(k.toString(), 10)]];
6919
+ var temp = property[parseInt(k.toString(), 10)];
6920
+ var content = select('.' + CLS_CTENT, item);
6921
+ if (temp === 'header' || temp === 'iconCss' || temp === 'expanded' || ((temp === 'content') && (oldVal === ''))) {
6922
+ this.updateItem(item, index);
6898
6923
  }
6899
- }
6900
- if (property === 'visible' && !isNullOrUndefined(item)) {
6901
- if (Object(newProp.items[parseInt(index.toString(), 10)])["" + property] === false) {
6902
- item.classList.add(CLS_ITEMHIDE);
6924
+ if (property[parseInt(k.toString(), 10)] === 'cssClass' && !isNullOrUndefined(item)) {
6925
+ if (oldVal) {
6926
+ removeClass([item], oldVal.split(' '));
6927
+ }
6928
+ if (newVal) {
6929
+ addClass([item], newVal.split(' '));
6930
+ }
6903
6931
  }
6904
- else {
6905
- item.classList.remove(CLS_ITEMHIDE);
6932
+ if (property[parseInt(k.toString(), 10)] === 'visible' && !isNullOrUndefined(item)) {
6933
+ if (Object(newProp.items[parseInt(index.toString(), 10)])["" + property[parseInt(k.toString(), 10)]] === false) {
6934
+ item.classList.add(CLS_ITEMHIDE);
6935
+ }
6936
+ else {
6937
+ item.classList.remove(CLS_ITEMHIDE);
6938
+ }
6906
6939
  }
6907
- }
6908
- if (property === 'disabled' && !isNullOrUndefined(item)) {
6909
- this.enableItem(index, !newVal);
6910
- }
6911
- if (property === 'content' && !isNullOrUndefined(item) && item.children.length === 2) {
6912
- if (typeof newVal === 'function') {
6913
- var activeContent = item.querySelector('.' + CLS_CTENT);
6914
- activeContent.innerHTML = '';
6915
- this.setTemplate(newVal, activeContent, index);
6940
+ if (property[parseInt(k.toString(), 10)] === 'disabled' && !isNullOrUndefined(item)) {
6941
+ this.enableItem(index, !newVal);
6916
6942
  }
6917
- else {
6918
- if (item.classList.contains(CLS_SLCTED)) {
6919
- this.expandItem(false, index);
6943
+ if (property[parseInt(k.toString(), 10)] === 'content' && !isNullOrUndefined(item) && item.children.length === 2) {
6944
+ if (typeof newVal === 'function') {
6945
+ if (this.isAngular || this.isReact) {
6946
+ this.clearAccordionTemplate(content, property[parseInt(k.toString(), 10)], CLS_CTENT);
6947
+ }
6948
+ var activeContent = item.querySelector('.' + CLS_CTENT);
6949
+ activeContent.innerHTML = '';
6950
+ this.setTemplate(newVal, activeContent, index);
6951
+ }
6952
+ else {
6953
+ if (item.classList.contains(CLS_SLCTED)) {
6954
+ this.expandItem(false, index);
6955
+ }
6956
+ detach(item.querySelector('.' + CLS_CONTENT));
6920
6957
  }
6921
- detach(item.querySelector('.' + CLS_CONTENT));
6922
6958
  }
6923
6959
  }
6924
6960
  }
@@ -7795,15 +7831,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7795
7831
  this.setContentHeight(true);
7796
7832
  this.select(this.selectedItem);
7797
7833
  }
7798
- this.tbItem = selectAll('.' + CLS_TB_ITEM, this.hdrEle);
7799
- if (!isNullOrUndefined(this.tbItem)) {
7800
- for (var i = 0; i < this.items.length; i++) {
7801
- if (this.tbItem[i]) {
7802
- var tabID = this.items[i].id;
7803
- this.tbItem[i].setAttribute('data-id', tabID);
7804
- }
7805
- }
7806
- }
7807
7834
  this.setRTL(this.enableRtl);
7808
7835
  }
7809
7836
  };
@@ -7982,7 +8009,7 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
7982
8009
  _this.itemIndexArray.splice((index + i), 0, CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex);
7983
8010
  }
7984
8011
  var attrObj = {
7985
- id: CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex
8012
+ id: CLS_ITEM$2 + _this.tabId + '_' + _this.lastIndex, 'data-id': item.id
7986
8013
  };
7987
8014
  var tItem = { htmlAttributes: attrObj, template: wrap };
7988
8015
  tItem.cssClass = ((item.cssClass !== undefined) ? item.cssClass : ' ') + ' ' + disabled + ' ' + hidden + ' '
@@ -9066,6 +9093,10 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
9066
9093
  };
9067
9094
  this.trigger('onDragStart', dragArgs, function (tabitemDragArgs) {
9068
9095
  if (tabitemDragArgs.cancel) {
9096
+ var dragObj = e.element.ej2_instances[0];
9097
+ if (!isNullOrUndefined(dragObj)) {
9098
+ dragObj.intDestroy(e.event);
9099
+ }
9069
9100
  detach(_this.cloneElement);
9070
9101
  }
9071
9102
  else {
@@ -12822,6 +12853,8 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
12822
12853
  enableTailMode: true, enableAutoScroll: true,
12823
12854
  dragArea: this.dragArea,
12824
12855
  dragTarget: '.' + TEXTWRAP,
12856
+ enableTapHold: true,
12857
+ tapHoldThreshold: 100,
12825
12858
  helper: function (e) {
12826
12859
  _this.dragTarget = e.sender.target;
12827
12860
  var dragRoot = closest(_this.dragTarget, '.' + ROOT);
@@ -13251,7 +13284,10 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13251
13284
  dropUl.style.display = 'none';
13252
13285
  }
13253
13286
  if (isNullOrUndefined(dropUl)) {
13254
- this.trigger('nodeExpanding', this.getExpandEvent(dropLi, null));
13287
+ var args = this.expandArgs;
13288
+ if (isNullOrUndefined(args) || args.name != 'nodeExpanding') {
13289
+ this.trigger('nodeExpanding', this.getExpandEvent(dropLi, null));
13290
+ }
13255
13291
  if (isNullOrUndefined(dropIcon)) {
13256
13292
  ListBase.generateIcon(this.createElement, dropLi, COLLAPSIBLE, this.listBaseOption);
13257
13293
  }
@@ -13601,6 +13637,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13601
13637
  }
13602
13638
  refNode = dropUl.childNodes[index];
13603
13639
  if (!this.isFirstRender || this.dataType === 1) {
13640
+ var args = this.expandArgs;
13604
13641
  if (refNode || this.sortOrder === 'None') {
13605
13642
  for (var i = 0; i < li.length; i++) {
13606
13643
  dropUl.insertBefore(li[i], refNode);
@@ -13608,7 +13645,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13608
13645
  if (this.dataType === 1 && !isNullOrUndefined(dropLi) && !isNullOrUndefined(this.element.offsetParent) && !this.element.offsetParent.parentElement.classList.contains('e-filemanager')) {
13609
13646
  this.preventExpand = false;
13610
13647
  var dropIcon = select('div.' + ICON, dropLi);
13611
- if (dropIcon && dropIcon.classList.contains(EXPANDABLE)) {
13648
+ if (dropIcon && dropIcon.classList.contains(EXPANDABLE) && (isNullOrUndefined(args) || args.name != 'nodeExpanding')) {
13612
13649
  this.expandAction(dropLi, dropIcon, null);
13613
13650
  }
13614
13651
  }
@@ -13621,7 +13658,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13621
13658
  if (this.dataType === 1 && !isNullOrUndefined(dropLi) && !isNullOrUndefined(this.element.offsetParent) && !this.element.offsetParent.parentElement.classList.contains('e-filemanager')) {
13622
13659
  this.preventExpand = false;
13623
13660
  var dropIcon = select('div.' + ICON, dropLi);
13624
- if (dropIcon && dropIcon.classList.contains(EXPANDABLE)) {
13661
+ if (dropIcon && dropIcon.classList.contains(EXPANDABLE) && (isNullOrUndefined(args) || args.name != 'nodeExpanding')) {
13625
13662
  this.expandAction(dropLi, dropIcon, null);
13626
13663
  }
13627
13664
  }