@syncfusion/ej2-navigations 29.1.40 → 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.
@@ -2285,8 +2285,8 @@ let MenuBase = class MenuBase extends Component {
2285
2285
  ul.style.left = left + px;
2286
2286
  }
2287
2287
  }
2288
- getMenuWidth(cmenu, width, isRtl) {
2289
- const caretIcon = cmenu.getElementsByClassName(CARET)[0];
2288
+ getMenuWidth(menuElement, width, isRtl) {
2289
+ const caretIcon = menuElement.getElementsByClassName(CARET)[0];
2290
2290
  if (caretIcon) {
2291
2291
  width += parseInt(getComputedStyle(caretIcon)[isRtl ? 'marginRight' : 'marginLeft'], 10);
2292
2292
  }
@@ -4895,7 +4895,10 @@ let Toolbar = class Toolbar extends Component {
4895
4895
  }
4896
4896
  popupEleWidth(el) {
4897
4897
  el.style.position = 'absolute';
4898
- let elWidth = this.isVertical ? el.offsetHeight : el.offsetWidth;
4898
+ const style = window.getComputedStyle(el);
4899
+ let elWidth = this.isVertical
4900
+ ? el.offsetHeight
4901
+ : el.offsetWidth + parseFloat(style.marginLeft) + parseFloat(style.marginRight);
4899
4902
  const btnText = el.querySelector('.' + CLS_TBARBTNTEXT);
4900
4903
  if (el.classList.contains('e-tbtn-align') || el.classList.contains(CLS_TBARTEXT)) {
4901
4904
  const btn = el.children[0];
@@ -5521,6 +5524,10 @@ let Toolbar = class Toolbar extends Component {
5521
5524
  return isNullOrUndefined(ele.getAttribute('data-tabindex')) ? '-1' : ele.getAttribute('data-tabindex');
5522
5525
  }
5523
5526
  itemClick(e) {
5527
+ const itemClosest = !isNullOrUndefined(closest(e.currentTarget, '.' + CLS_TEMPLATE));
5528
+ if (itemClosest) {
5529
+ return;
5530
+ }
5524
5531
  this.activeEleSwitch(e.currentTarget);
5525
5532
  }
5526
5533
  activeEleSwitch(ele) {
@@ -12516,6 +12523,9 @@ let TreeView = TreeView_1 = class TreeView extends Component {
12516
12523
  else {
12517
12524
  this.isFirstRender = true;
12518
12525
  this.renderChildNodes(currLi, expandChild, callback, null, isFromExpandAll);
12526
+ if (isNullOrUndefined(this.expandChildren) || this.expandChildren.length === 0) {
12527
+ return;
12528
+ }
12519
12529
  const liEles = selectAll('.' + LISTITEM, currLi);
12520
12530
  for (let i = 0; i < liEles.length; i++) {
12521
12531
  const id = this.getId(liEles[parseInt(i.toString(), 10)]);
@@ -13143,11 +13153,11 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13143
13153
  removeClass(hoveredNode, HOVER);
13144
13154
  }
13145
13155
  }
13146
- getNodeData(currLi, fromDS) {
13156
+ getNodeData(currLi, fromDS, dragData) {
13147
13157
  if (!isNullOrUndefined(currLi) && currLi.classList.contains(LISTITEM) &&
13148
13158
  !isNullOrUndefined(closest(currLi, '.' + CONTROL)) && closest(currLi, '.' + CONTROL).classList.contains(ROOT)) {
13149
13159
  const id = currLi.getAttribute('data-uid');
13150
- const text = this.getText(currLi, fromDS);
13160
+ const text = this.getText(currLi, fromDS, dragData);
13151
13161
  const pNode = closest(currLi.parentNode, '.' + LISTITEM);
13152
13162
  const pid = pNode ? pNode.getAttribute('data-uid') : null;
13153
13163
  const selected = currLi.classList.contains(ACTIVE);
@@ -13166,12 +13176,12 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13166
13176
  }
13167
13177
  return { id: '', text: '', parentID: '', selected: false, expanded: false, isChecked: '', hasChildren: false };
13168
13178
  }
13169
- getText(currLi, fromDS) {
13179
+ getText(currLi, fromDS, dragData) {
13170
13180
  if (fromDS) {
13171
- const nodeData = this.getNodeObject(currLi.getAttribute('data-uid'));
13181
+ const nodeData = !isNullOrUndefined(dragData) ? dragData : this.getNodeObject(currLi.getAttribute('data-uid'));
13172
13182
  const level = parseFloat(currLi.getAttribute('aria-level'));
13173
13183
  const nodeFields = this.getFields(this.fields, level, 1);
13174
- return getValue(nodeFields.text, nodeData);
13184
+ return !isNullOrUndefined(dragData) ? dragData.text : getValue(nodeFields.text, nodeData);
13175
13185
  }
13176
13186
  return select('.' + LISTTEXT, currLi).textContent;
13177
13187
  }
@@ -13724,8 +13734,9 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13724
13734
  if (this.fields.dataSource instanceof DataManager === false) {
13725
13735
  this.preventExpand = false;
13726
13736
  }
13737
+ const dragData = isNullOrUndefined(dragObj) ? null : dragObj.dragData;
13727
13738
  for (let i = 0; i < liArray.length; i++) {
13728
- nodeData.push(this.getNode(liArray[parseInt(i.toString(), 10)]));
13739
+ nodeData.push(this.getNodeData(this.getElement(liArray[parseInt(i.toString(), 10)]), true, dragData));
13729
13740
  }
13730
13741
  this.trigger('nodeDropped', this.getDragEvent(e.event, dragObj, dropTarget, e.target, e.dragData.draggedElement, null, level, drop));
13731
13742
  if (dragObj.element.id !== this.element.id) {
@@ -13840,7 +13851,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13840
13851
  const id = this.getId(dragLi);
13841
13852
  const removedData = dragObj.updateChildField(dragObj.treeData, dragObj.fields, id, null, null, true);
13842
13853
  const refId = this.getId(dropLi);
13843
- const index = this.getDataPos(this.treeData, this.fields, refId);
13854
+ const index = refId ? this.getDataPos(this.treeData, this.fields, refId) : null;
13844
13855
  const parentId = this.getId(dropParentLi);
13845
13856
  if (this.dataType === 1) {
13846
13857
  this.updateField(this.treeData, this.fields, parentId, 'hasChildren', true);