@syncfusion/ej2-navigations 29.1.41 → 29.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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 29.1.41
3
+ * version : 29.2.5
4
4
  * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-navigations@*",
3
- "_id": "@syncfusion/ej2-navigations@29.1.38",
3
+ "_id": "@syncfusion/ej2-navigations@29.2.4",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-/OPUPqbnwIXo36+W0w/F8pH6cNjrJsgEEaZpZP7uklGeqIpyFLrPo4f4uDFKdbgrX+K3Bs01loThHmaB1447ig==",
5
+ "_integrity": "sha512-imYNz0vrZSUIKlzJTHj+DMHkBWJ/Ze3FW6WNMmX1i43qCgABxXM/hsOWQK3+g217Sw0nF0GKWY0d8N6CVJDC7Q==",
6
6
  "_location": "/@syncfusion/ej2-navigations",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -40,8 +40,8 @@
40
40
  "/@syncfusion/ej2-spreadsheet",
41
41
  "/@syncfusion/ej2-vue-navigations"
42
42
  ],
43
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-29.1.38.tgz",
44
- "_shasum": "f3d612527b73d8271adacdf1811bfdec8e76b0f5",
43
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-29.2.4.tgz",
44
+ "_shasum": "637997deedf0d6e1670061ec8612e26648b589d1",
45
45
  "_spec": "@syncfusion/ej2-navigations@*",
46
46
  "_where": "/jenkins/workspace/elease-automation_release_29.1.1/packages/included",
47
47
  "author": {
@@ -52,12 +52,12 @@
52
52
  },
53
53
  "bundleDependencies": false,
54
54
  "dependencies": {
55
- "@syncfusion/ej2-base": "~29.1.36",
56
- "@syncfusion/ej2-buttons": "~29.1.34",
57
- "@syncfusion/ej2-data": "~29.1.33",
58
- "@syncfusion/ej2-inputs": "~29.1.39",
59
- "@syncfusion/ej2-lists": "~29.1.40",
60
- "@syncfusion/ej2-popups": "~29.1.37"
55
+ "@syncfusion/ej2-base": "~29.2.4",
56
+ "@syncfusion/ej2-buttons": "~29.2.5",
57
+ "@syncfusion/ej2-data": "~29.2.4",
58
+ "@syncfusion/ej2-inputs": "~29.2.5",
59
+ "@syncfusion/ej2-lists": "~29.2.4",
60
+ "@syncfusion/ej2-popups": "~29.2.4"
61
61
  },
62
62
  "deprecated": false,
63
63
  "description": "A package of Essential JS 2 navigation components such as Tree-view, Tab, Toolbar, Context-menu, and Accordion which is used to navigate from one page to another",
@@ -162,6 +162,6 @@
162
162
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
163
163
  },
164
164
  "typings": "index.d.ts",
165
- "version": "29.1.41",
165
+ "version": "29.2.5",
166
166
  "sideEffects": false
167
167
  }
@@ -385,7 +385,7 @@ export declare abstract class MenuBase extends Component<HTMLUListElement> imple
385
385
  protected setBlankIconStyle(menu: HTMLElement): void;
386
386
  private checkScrollOffset;
387
387
  private setPosition;
388
- getMenuWidth(cmenu: Element, width: number, isRtl: boolean): number;
388
+ getMenuWidth(menuElement: Element, width: number, isRtl: boolean): number;
389
389
  private toggleVisiblity;
390
390
  private createItems;
391
391
  private moverHandler;
@@ -1318,8 +1318,8 @@ var MenuBase = /** @class */ (function (_super) {
1318
1318
  ul.style.left = left + px;
1319
1319
  }
1320
1320
  };
1321
- MenuBase.prototype.getMenuWidth = function (cmenu, width, isRtl) {
1322
- var caretIcon = cmenu.getElementsByClassName(CARET)[0];
1321
+ MenuBase.prototype.getMenuWidth = function (menuElement, width, isRtl) {
1322
+ var caretIcon = menuElement.getElementsByClassName(CARET)[0];
1323
1323
  if (caretIcon) {
1324
1324
  width += parseInt(getComputedStyle(caretIcon)[isRtl ? 'marginRight' : 'marginLeft'], 10);
1325
1325
  }
@@ -1399,7 +1399,7 @@ var MenuBase = /** @class */ (function (_super) {
1399
1399
  args.item.setAttribute('aria-expanded', 'false');
1400
1400
  args.item.classList.add('e-menu-caret-icon');
1401
1401
  }
1402
- if (_this.isMenu && _this.template) {
1402
+ if (_this.template) {
1403
1403
  args.item.setAttribute('id', args.curData[args.fields.id].toString());
1404
1404
  args.item.removeAttribute('data-uid');
1405
1405
  if (args.item.classList.contains('e-level-1')) {
@@ -1407,7 +1407,10 @@ var Toolbar = /** @class */ (function (_super) {
1407
1407
  };
1408
1408
  Toolbar.prototype.popupEleWidth = function (el) {
1409
1409
  el.style.position = 'absolute';
1410
- var elWidth = this.isVertical ? el.offsetHeight : el.offsetWidth;
1410
+ var style = window.getComputedStyle(el);
1411
+ var elWidth = this.isVertical
1412
+ ? el.offsetHeight
1413
+ : el.offsetWidth + parseFloat(style.marginLeft) + parseFloat(style.marginRight);
1411
1414
  var btnText = el.querySelector('.' + CLS_TBARBTNTEXT);
1412
1415
  if (el.classList.contains('e-tbtn-align') || el.classList.contains(CLS_TBARTEXT)) {
1413
1416
  var btn = el.children[0];
@@ -2045,6 +2048,10 @@ var Toolbar = /** @class */ (function (_super) {
2045
2048
  return isNOU(ele.getAttribute('data-tabindex')) ? '-1' : ele.getAttribute('data-tabindex');
2046
2049
  };
2047
2050
  Toolbar.prototype.itemClick = function (e) {
2051
+ var itemClosest = !isNOU(closest(e.currentTarget, '.' + CLS_TEMPLATE));
2052
+ if (itemClosest) {
2053
+ return;
2054
+ }
2048
2055
  this.activeEleSwitch(e.currentTarget);
2049
2056
  };
2050
2057
  Toolbar.prototype.activeEleSwitch = function (ele) {
@@ -457,6 +457,13 @@ export interface TreeViewModel extends ComponentModel{
457
457
  */
458
458
  showCheckBox?: boolean;
459
459
 
460
+ /**
461
+ * Specifies whether the item should be checked or unchecked when the node is clicked.
462
+ *
463
+ * @default false
464
+ */
465
+ checkOnClick?: boolean;
466
+
460
467
  /**
461
468
  * Allow us to specify the parent and child nodes to get auto check while we check or uncheck a node.
462
469
  *
@@ -828,6 +828,12 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
828
828
  * @default false
829
829
  */
830
830
  showCheckBox: boolean;
831
+ /**
832
+ * Specifies whether the item should be checked or unchecked when the node is clicked.
833
+ *
834
+ * @default false
835
+ */
836
+ checkOnClick: boolean;
831
837
  /**
832
838
  * Allow us to specify the parent and child nodes to get auto check while we check or uncheck a node.
833
839
  *
@@ -1172,6 +1178,7 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1172
1178
  private checkNode;
1173
1179
  private validateCheckNode;
1174
1180
  private nodeCheckingAction;
1181
+ private updateActiveClass;
1175
1182
  /**
1176
1183
  * Update checkedNodes when UI interaction happens before the child node renders in DOM
1177
1184
  *
@@ -1700,8 +1700,9 @@ var TreeView = /** @class */ (function (_super) {
1700
1700
  var rippleIcons = select('.' + ICON, li);
1701
1701
  this.removeHover();
1702
1702
  this.setFocusElement(li);
1703
- if (this.showCheckBox && !li.classList.contains('e-disable')) {
1704
- var checkWrapper = closest(target, '.' + CHECKBOXWRAP);
1703
+ var isExpandCollapseIcon = classList.contains(EXPANDABLE) || classList.contains(COLLAPSIBLE);
1704
+ if (this.showCheckBox && !li.classList.contains('e-disable') && !isExpandCollapseIcon) {
1705
+ var checkWrapper = this.checkOnClick ? select('.' + CHECKBOXWRAP, li) : closest(target, '.' + CHECKBOXWRAP);
1705
1706
  if (!isNOU(checkWrapper)) {
1706
1707
  var checkElement = select('.' + CHECKBOXFRAME, checkWrapper);
1707
1708
  this.validateCheckNode(checkWrapper, checkElement.classList.contains(CHECK), li, event.originalEvent);
@@ -2263,6 +2264,15 @@ var TreeView = /** @class */ (function (_super) {
2263
2264
  TreeView.prototype.selectNode = function (li, e, multiSelect) {
2264
2265
  var _this = this;
2265
2266
  if (isNOU(li) || (!this.allowMultiSelection && this.isActive(li) && !isNOU(e))) {
2267
+ if (this.checkOnClick) {
2268
+ var checkboxElement = select(' .' + CHECKBOXFRAME, li);
2269
+ if (!isNOU(checkboxElement) && checkboxElement.classList.contains(CHECK)) {
2270
+ addClass([li], ACTIVE);
2271
+ }
2272
+ else {
2273
+ removeClass([li], ACTIVE);
2274
+ }
2275
+ }
2266
2276
  this.setFocusElement(li);
2267
2277
  return;
2268
2278
  }
@@ -2450,6 +2460,9 @@ var TreeView = /** @class */ (function (_super) {
2450
2460
  else {
2451
2461
  this.isFirstRender = true;
2452
2462
  this.renderChildNodes(currLi, expandChild, callback, null, isFromExpandAll);
2463
+ if (isNullOrUndefined(this.expandChildren) || this.expandChildren.length === 0) {
2464
+ return;
2465
+ }
2453
2466
  var liEles = selectAll('.' + LISTITEM, currLi);
2454
2467
  for (var i = 0; i < liEles.length; i++) {
2455
2468
  var id = this.getId(liEles[parseInt(i.toString(), 10)]);
@@ -2633,6 +2646,7 @@ var TreeView = /** @class */ (function (_super) {
2633
2646
  }
2634
2647
  }
2635
2648
  this.changeState(checkWrap, isCheck ? 'uncheck' : 'check', e, true);
2649
+ this.updateActiveClass(li, isCheck);
2636
2650
  if (this.autoCheck) {
2637
2651
  this.ensureChildCheckState(li);
2638
2652
  this.updateOldCheckedData([this.getNodeData(li)]);
@@ -2648,6 +2662,17 @@ var TreeView = /** @class */ (function (_super) {
2648
2662
  }
2649
2663
  this.nodeCheckedEvent(checkWrap, isCheck, e);
2650
2664
  };
2665
+ TreeView.prototype.updateActiveClass = function (liElement, checkStatus) {
2666
+ if (this.showCheckBox && this.checkOnClick) {
2667
+ if (checkStatus === 'check' || checkStatus === false) {
2668
+ this.removeSelectAll();
2669
+ addClass([liElement], ACTIVE);
2670
+ }
2671
+ else if (checkStatus === 'uncheck' || checkStatus === 'indeterminate' || checkStatus === true) {
2672
+ removeClass([liElement], ACTIVE);
2673
+ }
2674
+ }
2675
+ };
2651
2676
  /**
2652
2677
  * Update checkedNodes when UI interaction happens before the child node renders in DOM
2653
2678
  *
@@ -3080,11 +3105,11 @@ var TreeView = /** @class */ (function (_super) {
3080
3105
  removeClass(hoveredNode, HOVER);
3081
3106
  }
3082
3107
  };
3083
- TreeView.prototype.getNodeData = function (currLi, fromDS) {
3108
+ TreeView.prototype.getNodeData = function (currLi, fromDS, dragData) {
3084
3109
  if (!isNOU(currLi) && currLi.classList.contains(LISTITEM) &&
3085
3110
  !isNOU(closest(currLi, '.' + CONTROL)) && closest(currLi, '.' + CONTROL).classList.contains(ROOT)) {
3086
3111
  var id = currLi.getAttribute('data-uid');
3087
- var text = this.getText(currLi, fromDS);
3112
+ var text = this.getText(currLi, fromDS, dragData);
3088
3113
  var pNode = closest(currLi.parentNode, '.' + LISTITEM);
3089
3114
  var pid = pNode ? pNode.getAttribute('data-uid') : null;
3090
3115
  var selected = currLi.classList.contains(ACTIVE);
@@ -3103,12 +3128,12 @@ var TreeView = /** @class */ (function (_super) {
3103
3128
  }
3104
3129
  return { id: '', text: '', parentID: '', selected: false, expanded: false, isChecked: '', hasChildren: false };
3105
3130
  };
3106
- TreeView.prototype.getText = function (currLi, fromDS) {
3131
+ TreeView.prototype.getText = function (currLi, fromDS, dragData) {
3107
3132
  if (fromDS) {
3108
- var nodeData = this.getNodeObject(currLi.getAttribute('data-uid'));
3133
+ var nodeData = !isNullOrUndefined(dragData) ? dragData : this.getNodeObject(currLi.getAttribute('data-uid'));
3109
3134
  var level = parseFloat(currLi.getAttribute('aria-level'));
3110
3135
  var nodeFields = this.getFields(this.fields, level, 1);
3111
- return getValue(nodeFields.text, nodeData);
3136
+ return !isNullOrUndefined(dragData) ? dragData.text : getValue(nodeFields.text, nodeData);
3112
3137
  }
3113
3138
  return select('.' + LISTTEXT, currLi).textContent;
3114
3139
  };
@@ -3667,8 +3692,9 @@ var TreeView = /** @class */ (function (_super) {
3667
3692
  if (this.fields.dataSource instanceof DataManager === false) {
3668
3693
  this.preventExpand = false;
3669
3694
  }
3695
+ var dragData = isNullOrUndefined(dragObj) ? null : dragObj.dragData;
3670
3696
  for (var i = 0; i < liArray.length; i++) {
3671
- nodeData.push(this.getNode(liArray[parseInt(i.toString(), 10)]));
3697
+ nodeData.push(this.getNodeData(this.getElement(liArray[parseInt(i.toString(), 10)]), true, dragData));
3672
3698
  }
3673
3699
  this.trigger('nodeDropped', this.getDragEvent(e.event, dragObj, dropTarget, e.target, e.dragData.draggedElement, null, level, drop));
3674
3700
  if (dragObj.element.id !== this.element.id) {
@@ -3783,7 +3809,7 @@ var TreeView = /** @class */ (function (_super) {
3783
3809
  var id = this.getId(dragLi);
3784
3810
  var removedData = dragObj.updateChildField(dragObj.treeData, dragObj.fields, id, null, null, true);
3785
3811
  var refId = this.getId(dropLi);
3786
- var index = this.getDataPos(this.treeData, this.fields, refId);
3812
+ var index = refId ? this.getDataPos(this.treeData, this.fields, refId) : null;
3787
3813
  var parentId = this.getId(dropParentLi);
3788
3814
  if (this.dataType === 1) {
3789
3815
  this.updateField(this.treeData, this.fields, parentId, 'hasChildren', true);
@@ -5711,6 +5737,9 @@ var TreeView = /** @class */ (function (_super) {
5711
5737
  __decorate([
5712
5738
  Property(false)
5713
5739
  ], TreeView.prototype, "showCheckBox", void 0);
5740
+ __decorate([
5741
+ Property(false)
5742
+ ], TreeView.prototype, "checkOnClick", void 0);
5714
5743
  __decorate([
5715
5744
  Property(true)
5716
5745
  ], TreeView.prototype, "autoCheck", void 0);