@syncfusion/ej2-navigations 29.1.41 → 29.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.
@@ -2375,8 +2375,8 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
2375
2375
  ul.style.left = left + px;
2376
2376
  }
2377
2377
  };
2378
- MenuBase.prototype.getMenuWidth = function (cmenu, width, isRtl) {
2379
- var caretIcon = cmenu.getElementsByClassName(CARET)[0];
2378
+ MenuBase.prototype.getMenuWidth = function (menuElement, width, isRtl) {
2379
+ var caretIcon = menuElement.getElementsByClassName(CARET)[0];
2380
2380
  if (caretIcon) {
2381
2381
  width += parseInt(getComputedStyle(caretIcon)[isRtl ? 'marginRight' : 'marginLeft'], 10);
2382
2382
  }
@@ -5038,7 +5038,10 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
5038
5038
  };
5039
5039
  Toolbar.prototype.popupEleWidth = function (el) {
5040
5040
  el.style.position = 'absolute';
5041
- var elWidth = this.isVertical ? el.offsetHeight : el.offsetWidth;
5041
+ var style = window.getComputedStyle(el);
5042
+ var elWidth = this.isVertical
5043
+ ? el.offsetHeight
5044
+ : el.offsetWidth + parseFloat(style.marginLeft) + parseFloat(style.marginRight);
5042
5045
  var btnText = el.querySelector('.' + CLS_TBARBTNTEXT);
5043
5046
  if (el.classList.contains('e-tbtn-align') || el.classList.contains(CLS_TBARTEXT)) {
5044
5047
  var btn = el.children[0];
@@ -5676,6 +5679,10 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
5676
5679
  return isNullOrUndefined(ele.getAttribute('data-tabindex')) ? '-1' : ele.getAttribute('data-tabindex');
5677
5680
  };
5678
5681
  Toolbar.prototype.itemClick = function (e) {
5682
+ var itemClosest = !isNullOrUndefined(closest(e.currentTarget, '.' + CLS_TEMPLATE));
5683
+ if (itemClosest) {
5684
+ return;
5685
+ }
5679
5686
  this.activeEleSwitch(e.currentTarget);
5680
5687
  };
5681
5688
  Toolbar.prototype.activeEleSwitch = function (ele) {
@@ -12870,6 +12877,9 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
12870
12877
  else {
12871
12878
  this.isFirstRender = true;
12872
12879
  this.renderChildNodes(currLi, expandChild, callback, null, isFromExpandAll);
12880
+ if (isNullOrUndefined(this.expandChildren) || this.expandChildren.length === 0) {
12881
+ return;
12882
+ }
12873
12883
  var liEles = selectAll('.' + LISTITEM, currLi);
12874
12884
  for (var i = 0; i < liEles.length; i++) {
12875
12885
  var id = this.getId(liEles[parseInt(i.toString(), 10)]);
@@ -13500,11 +13510,11 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13500
13510
  removeClass(hoveredNode, HOVER);
13501
13511
  }
13502
13512
  };
13503
- TreeView.prototype.getNodeData = function (currLi, fromDS) {
13513
+ TreeView.prototype.getNodeData = function (currLi, fromDS, dragData) {
13504
13514
  if (!isNullOrUndefined(currLi) && currLi.classList.contains(LISTITEM) &&
13505
13515
  !isNullOrUndefined(closest(currLi, '.' + CONTROL)) && closest(currLi, '.' + CONTROL).classList.contains(ROOT)) {
13506
13516
  var id = currLi.getAttribute('data-uid');
13507
- var text = this.getText(currLi, fromDS);
13517
+ var text = this.getText(currLi, fromDS, dragData);
13508
13518
  var pNode = closest(currLi.parentNode, '.' + LISTITEM);
13509
13519
  var pid = pNode ? pNode.getAttribute('data-uid') : null;
13510
13520
  var selected = currLi.classList.contains(ACTIVE);
@@ -13523,12 +13533,12 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
13523
13533
  }
13524
13534
  return { id: '', text: '', parentID: '', selected: false, expanded: false, isChecked: '', hasChildren: false };
13525
13535
  };
13526
- TreeView.prototype.getText = function (currLi, fromDS) {
13536
+ TreeView.prototype.getText = function (currLi, fromDS, dragData) {
13527
13537
  if (fromDS) {
13528
- var nodeData = this.getNodeObject(currLi.getAttribute('data-uid'));
13538
+ var nodeData = !isNullOrUndefined(dragData) ? dragData : this.getNodeObject(currLi.getAttribute('data-uid'));
13529
13539
  var level = parseFloat(currLi.getAttribute('aria-level'));
13530
13540
  var nodeFields = this.getFields(this.fields, level, 1);
13531
- return getValue(nodeFields.text, nodeData);
13541
+ return !isNullOrUndefined(dragData) ? dragData.text : getValue(nodeFields.text, nodeData);
13532
13542
  }
13533
13543
  return select('.' + LISTTEXT, currLi).textContent;
13534
13544
  };
@@ -14084,8 +14094,9 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
14084
14094
  if (this.fields.dataSource instanceof DataManager === false) {
14085
14095
  this.preventExpand = false;
14086
14096
  }
14097
+ var dragData = isNullOrUndefined(dragObj) ? null : dragObj.dragData;
14087
14098
  for (var i = 0; i < liArray.length; i++) {
14088
- nodeData.push(this.getNode(liArray[parseInt(i.toString(), 10)]));
14099
+ nodeData.push(this.getNodeData(this.getElement(liArray[parseInt(i.toString(), 10)]), true, dragData));
14089
14100
  }
14090
14101
  this.trigger('nodeDropped', this.getDragEvent(e.event, dragObj, dropTarget, e.target, e.dragData.draggedElement, null, level, drop));
14091
14102
  if (dragObj.element.id !== this.element.id) {
@@ -14200,7 +14211,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
14200
14211
  var id = this.getId(dragLi);
14201
14212
  var removedData = dragObj.updateChildField(dragObj.treeData, dragObj.fields, id, null, null, true);
14202
14213
  var refId = this.getId(dropLi);
14203
- var index = this.getDataPos(this.treeData, this.fields, refId);
14214
+ var index = refId ? this.getDataPos(this.treeData, this.fields, refId) : null;
14204
14215
  var parentId = this.getId(dropParentLi);
14205
14216
  if (this.dataType === 1) {
14206
14217
  this.updateField(this.treeData, this.fields, parentId, 'hasChildren', true);