@syncfusion/ej2-navigations 27.1.48 → 27.1.50

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 : 27.1.48
3
+ * version : 27.1.50
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. 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@22.42.3",
3
+ "_id": "@syncfusion/ej2-navigations@27.1.48",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-7fIDmwOChdR7LY3qhB5kbsOc3Hak5TWmTAgdanWSrUxBbsPdfHryhb+Czk3ZJX7iCK2fXDrpKu7nyRf941QH2Q==",
5
+ "_integrity": "sha512-7Arx+jDFckJ+5vQHFH+04Hqb/P7w9pTiGSVVcXU0s1q8DO6JNMgcf1dd/S8c/VaTfxfv6dWIqA9zEnBKcSjzyg==",
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-release/@syncfusion/ej2-navigations/-/ej2-navigations-22.42.3.tgz",
44
- "_shasum": "9eb4ca9556e9c18ca117e157d2dc48ede696d677",
43
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-navigations/-/ej2-navigations-27.1.48.tgz",
44
+ "_shasum": "2c208da5381c64ddc0433b2404d540ae991107fa",
45
45
  "_spec": "@syncfusion/ej2-navigations@*",
46
46
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
47
47
  "author": {
@@ -52,13 +52,12 @@
52
52
  },
53
53
  "bundleDependencies": false,
54
54
  "dependencies": {
55
- "@syncfusion/ej2-base": "~27.1.48",
56
- "@syncfusion/ej2-buttons": "~27.1.48",
57
- "@syncfusion/ej2-data": "~27.1.48",
58
- "@syncfusion/ej2-inputs": "~27.1.48",
59
- "@syncfusion/ej2-lists": "~27.1.48",
60
- "@syncfusion/ej2-popups": "~27.1.48",
61
- "markdown-spellcheck": "^1.3.1"
55
+ "@syncfusion/ej2-base": "~27.1.50",
56
+ "@syncfusion/ej2-buttons": "~27.1.50",
57
+ "@syncfusion/ej2-data": "~27.1.50",
58
+ "@syncfusion/ej2-inputs": "~27.1.50",
59
+ "@syncfusion/ej2-lists": "~27.1.50",
60
+ "@syncfusion/ej2-popups": "~27.1.50"
62
61
  },
63
62
  "deprecated": false,
64
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",
@@ -163,6 +162,6 @@
163
162
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
164
163
  },
165
164
  "typings": "index.d.ts",
166
- "version": "27.1.48",
165
+ "version": "27.1.50",
167
166
  "sideEffects": false
168
167
  }
@@ -173,6 +173,7 @@ export declare abstract class MenuBase extends Component<HTMLUListElement> imple
173
173
  private isClosed;
174
174
  private liTrgt;
175
175
  private isMenusClosed;
176
+ private isContextMenuClosed;
176
177
  private isCMenu;
177
178
  private pageX;
178
179
  private pageY;
@@ -641,6 +641,7 @@ var MenuBase = /** @class */ (function (_super) {
641
641
  detach(popupEle);
642
642
  }
643
643
  else {
644
+ _this.isContextMenuClosed = false;
644
645
  _this.toggleAnimation(ul_1, false);
645
646
  }
646
647
  closeArgs = { element: ul_1, parentItem: item_1, items: items_1 };
@@ -1046,6 +1047,7 @@ var MenuBase = /** @class */ (function (_super) {
1046
1047
  case 'none':
1047
1048
  _this.top = observedOpenArgs.top;
1048
1049
  _this.left = observedOpenArgs.left;
1050
+ _this.isContextMenuClosed = true;
1049
1051
  break;
1050
1052
  case 'hamburger':
1051
1053
  if (!observedOpenArgs.cancel) {
@@ -1983,7 +1985,7 @@ var MenuBase = /** @class */ (function (_super) {
1983
1985
  }
1984
1986
  };
1985
1987
  MenuBase.prototype.end = function (ul, isMenuOpen) {
1986
- if (isMenuOpen) {
1988
+ if (isMenuOpen && (this.isMenu || (!this.isMenu && this.isContextMenuClosed))) {
1987
1989
  if (this.isMenu || !Browser.isDevice) {
1988
1990
  ul.style.display = 'block';
1989
1991
  }
@@ -42,6 +42,7 @@ export declare class Sidebar extends Component<HTMLElement> implements INotifyPr
42
42
  private windowWidth;
43
43
  private targetEle;
44
44
  private firstRender;
45
+ private documentClickContext;
45
46
  /**
46
47
  * Specifies the size of the Sidebar in dock state.
47
48
  * > For more details about dockSize refer to
@@ -56,7 +56,9 @@ var SIDEBARABSOLUTE = 'e-sidebar-absolute';
56
56
  var Sidebar = /** @class */ (function (_super) {
57
57
  __extends(Sidebar, _super);
58
58
  function Sidebar(options, element) {
59
- return _super.call(this, options, element) || this;
59
+ var _this = _super.call(this, options, element) || this;
60
+ _this.documentClickContext = _this.documentclickHandler.bind(_this);
61
+ return _this;
60
62
  }
61
63
  Sidebar.prototype.preRender = function () {
62
64
  this.setWidth();
@@ -116,10 +118,12 @@ var Sidebar = /** @class */ (function (_super) {
116
118
  };
117
119
  Sidebar.prototype.setCloseOnDocumentClick = function () {
118
120
  if (this.closeOnDocumentClick) {
119
- EventHandler.add(document, 'mousedown touchstart', this.documentclickHandler, this);
121
+ document.addEventListener('mousedown', this.documentClickContext);
122
+ document.addEventListener('touchstart', this.documentClickContext);
120
123
  }
121
124
  else {
122
- EventHandler.remove(document, 'mousedown touchstart', this.documentclickHandler);
125
+ document.removeEventListener('mousedown', this.documentClickContext);
126
+ document.removeEventListener('touchstart', this.documentClickContext);
123
127
  }
124
128
  };
125
129
  Sidebar.prototype.setWidth = function () {
@@ -421,10 +425,10 @@ var Sidebar = /** @class */ (function (_super) {
421
425
  this.show();
422
426
  }
423
427
  else if (this.isOpen && this.position === 'Left' && args.swipeDirection === 'Left') {
424
- this.hide();
428
+ this.hide(args.originalEvent);
425
429
  }
426
430
  else if (this.isOpen && this.position === 'Right' && args.swipeDirection === 'Right') {
427
- this.hide();
431
+ this.hide(args.originalEvent);
428
432
  }
429
433
  else if (!this.isOpen && this.position === 'Right' && args.swipeDirection === 'Left'
430
434
  && (window.innerWidth - args.startX <= 20 && args.distanceX >= 50 && args.velocity >= 0.5)) {
@@ -1229,6 +1229,8 @@ export declare class TreeView extends Component<HTMLElement> implements INotifyP
1229
1229
  private setDragAndDrop;
1230
1230
  private initializeDrag;
1231
1231
  private dragCancelAction;
1232
+ private getOffsetX;
1233
+ private getOffsetY;
1232
1234
  private dragAction;
1233
1235
  private appendIndicator;
1234
1236
  private dropAction;
@@ -2636,7 +2636,7 @@ var TreeView = /** @class */ (function (_super) {
2636
2636
  currentItem = isNOU(currentItem) ? currentItem : this.getNodeObject(resultId);
2637
2637
  if (!isNOU(currentItem)) {
2638
2638
  var htmlAttributes = currentItem[this.fields.htmlAttributes];
2639
- if (htmlAttributes && htmlAttributes.class.indexOf(DISABLE) !== -1) {
2639
+ if (htmlAttributes && !isNOU(htmlAttributes.class) && htmlAttributes.class.indexOf(DISABLE) !== -1) {
2640
2640
  shouldPreventUpdate = false;
2641
2641
  }
2642
2642
  }
@@ -3371,6 +3371,22 @@ var TreeView = /** @class */ (function (_super) {
3371
3371
  removeClass([this.element], DRAGGING);
3372
3372
  this.dragStartAction = false;
3373
3373
  };
3374
+ TreeView.prototype.getOffsetX = function (event, target) {
3375
+ if (event instanceof TouchEvent && event.changedTouches.length > 0) {
3376
+ return event.changedTouches[0].clientX - target.getBoundingClientRect().left;
3377
+ }
3378
+ else {
3379
+ return event.offsetX;
3380
+ }
3381
+ };
3382
+ TreeView.prototype.getOffsetY = function (event, target) {
3383
+ if (event instanceof TouchEvent && event.changedTouches.length > 0) {
3384
+ return event.changedTouches[0].clientY - target.getBoundingClientRect().top;
3385
+ }
3386
+ else {
3387
+ return event.offsetY;
3388
+ }
3389
+ };
3374
3390
  TreeView.prototype.dragAction = function (e, virtualEle) {
3375
3391
  var dropRoot = closest(e.target, '.' + DROPPABLE);
3376
3392
  var dropWrap = closest(e.target, '.' + TEXTWRAP);
@@ -3380,6 +3396,9 @@ var TreeView = /** @class */ (function (_super) {
3380
3396
  this.removeVirtualEle();
3381
3397
  document.body.style.cursor = '';
3382
3398
  var classList = e.target.classList;
3399
+ var event = e.event;
3400
+ var offsetY = this.getOffsetY(event, e.target);
3401
+ var offsetX = this.getOffsetX(event, e.target);
3383
3402
  if (this.fullRowSelect && !dropWrap && !isNOU(classList) && classList.contains(FULLROW)) {
3384
3403
  dropWrap = e.target.nextElementSibling;
3385
3404
  }
@@ -3392,14 +3411,14 @@ var TreeView = /** @class */ (function (_super) {
3392
3411
  (!dropLi.isSameNode(this.dragLi) && !this.isDescendant(this.dragLi, dropLi)))) {
3393
3412
  if (this.hasTemplate && dropLi) {
3394
3413
  var templateTarget = select(this.fullRowSelect ? '.' + FULLROW : '.' + TEXTWRAP, dropLi);
3395
- if ((e && (!expand && !collapse) && e.event.offsetY < 7 && !checkWrapper) ||
3396
- (((expand && e.event.offsetY < 5) || (collapse && e.event.offsetX < 3)))) {
3414
+ if ((e && (!expand && !collapse) && offsetY < 7 && !checkWrapper) ||
3415
+ (((expand && offsetY < 5) || (collapse && offsetX < 3)))) {
3397
3416
  var index = this.fullRowSelect ? (1) : (0);
3398
3417
  this.appendIndicator(dropLi, icon, index);
3399
3418
  }
3400
3419
  else if ((e && (!expand && !collapse) &&
3401
- !checkWrapper && templateTarget && e.event.offsetY > templateTarget.offsetHeight - 10) ||
3402
- ((expand && e.event.offsetY > 19) || (collapse && e.event.offsetX > 19))) {
3420
+ !checkWrapper && templateTarget && offsetY > templateTarget.offsetHeight - 10) ||
3421
+ ((expand && offsetY > 19) || (collapse && offsetX > 19))) {
3403
3422
  var index = this.fullRowSelect ? (2) : (1);
3404
3423
  this.appendIndicator(dropLi, icon, index);
3405
3424
  }
@@ -3409,14 +3428,14 @@ var TreeView = /** @class */ (function (_super) {
3409
3428
  }
3410
3429
  }
3411
3430
  else {
3412
- if ((dropLi && e && (!expand && !collapse) && (e.event.offsetY < 7) && !checkWrapper) ||
3413
- (((expand && e.event.offsetY < 5) || (collapse && e.event.offsetX < 3)))) {
3431
+ if ((dropLi && e && (!expand && !collapse) && (offsetY < 7) && !checkWrapper) ||
3432
+ (((expand && offsetY < 5) || (collapse && offsetX < 3)))) {
3414
3433
  var index = this.fullRowSelect ? (1) : (0);
3415
3434
  this.appendIndicator(dropLi, icon, index);
3416
3435
  }
3417
3436
  else if ((dropLi && e && (!expand && !collapse) &&
3418
- (e.target.offsetHeight > 0 && e.event.offsetY > (e.target.offsetHeight - 10)) && !checkWrapper) ||
3419
- (((expand && e.event.offsetY > 19) || (collapse && e.event.offsetX > 19)))) {
3437
+ (e.target.offsetHeight > 0 && offsetY > (e.target.offsetHeight - 10)) && !checkWrapper) ||
3438
+ (((expand && offsetY > 19) || (collapse && offsetX > 19)))) {
3420
3439
  var index = this.fullRowSelect ? (2) : (1);
3421
3440
  this.appendIndicator(dropLi, icon, index);
3422
3441
  }
@@ -3461,7 +3480,8 @@ var TreeView = /** @class */ (function (_super) {
3461
3480
  dropLi.insertBefore(virEle, dropLi.children[parseInt(index.toString(), 10)]);
3462
3481
  };
3463
3482
  TreeView.prototype.dropAction = function (e) {
3464
- var offsetY = e.event.offsetY;
3483
+ var event = e.event;
3484
+ var offsetY = this.getOffsetY(event, e.target);
3465
3485
  var dropTarget = e.target;
3466
3486
  var dragObj;
3467
3487
  var level;
@@ -3752,10 +3772,12 @@ var TreeView = /** @class */ (function (_super) {
3752
3772
  };
3753
3773
  TreeView.prototype.renderVirtualEle = function (e) {
3754
3774
  var pre;
3755
- if (e.event.offsetY > e.target.offsetHeight - 2) {
3775
+ var event = e.event;
3776
+ var offsetY = this.getOffsetY(event, e.target);
3777
+ if (offsetY > e.target.offsetHeight - 2) {
3756
3778
  pre = false;
3757
3779
  }
3758
- else if (e.event.offsetY < 2) {
3780
+ else if (offsetY < 2) {
3759
3781
  pre = true;
3760
3782
  }
3761
3783
  var virEle = this.createElement('div', { className: SIBLING });