@syncfusion/ej2-navigations 27.1.48 → 27.1.51

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.
@@ -1617,6 +1617,7 @@ let MenuBase = class MenuBase extends Component {
1617
1617
  detach(popupEle);
1618
1618
  }
1619
1619
  else {
1620
+ this.isContextMenuClosed = false;
1620
1621
  this.toggleAnimation(ul, false);
1621
1622
  }
1622
1623
  closeArgs = { element: ul, parentItem: item, items: items };
@@ -2013,6 +2014,7 @@ let MenuBase = class MenuBase extends Component {
2013
2014
  case 'none':
2014
2015
  this.top = observedOpenArgs.top;
2015
2016
  this.left = observedOpenArgs.left;
2017
+ this.isContextMenuClosed = true;
2016
2018
  break;
2017
2019
  case 'hamburger':
2018
2020
  if (!observedOpenArgs.cancel) {
@@ -2932,7 +2934,7 @@ let MenuBase = class MenuBase extends Component {
2932
2934
  }
2933
2935
  }
2934
2936
  end(ul, isMenuOpen) {
2935
- if (isMenuOpen) {
2937
+ if (isMenuOpen && (this.isMenu || (!this.isMenu && this.isContextMenuClosed))) {
2936
2938
  if (this.isMenu || !Browser.isDevice) {
2937
2939
  ul.style.display = 'block';
2938
2940
  }
@@ -12371,7 +12373,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
12371
12373
  currentItem = isNullOrUndefined(currentItem) ? currentItem : this.getNodeObject(resultId);
12372
12374
  if (!isNullOrUndefined(currentItem)) {
12373
12375
  const htmlAttributes = currentItem[this.fields.htmlAttributes];
12374
- if (htmlAttributes && htmlAttributes.class.indexOf(DISABLE) !== -1) {
12376
+ if (htmlAttributes && !isNullOrUndefined(htmlAttributes.class) && htmlAttributes.class.indexOf(DISABLE) !== -1) {
12375
12377
  shouldPreventUpdate = false;
12376
12378
  }
12377
12379
  }
@@ -13100,6 +13102,24 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13100
13102
  removeClass([this.element], DRAGGING);
13101
13103
  this.dragStartAction = false;
13102
13104
  }
13105
+ getOffsetX(event, target) {
13106
+ const touchList = event.changedTouches;
13107
+ if (touchList && touchList.length > 0) {
13108
+ return touchList[0].clientX - target.getBoundingClientRect().left;
13109
+ }
13110
+ else {
13111
+ return event.offsetX;
13112
+ }
13113
+ }
13114
+ getOffsetY(event, target) {
13115
+ const touchList = event.changedTouches;
13116
+ if (touchList && touchList.length > 0) {
13117
+ return touchList[0].clientY - target.getBoundingClientRect().top;
13118
+ }
13119
+ else {
13120
+ return event.offsetY;
13121
+ }
13122
+ }
13103
13123
  dragAction(e, virtualEle) {
13104
13124
  const dropRoot = closest(e.target, '.' + DROPPABLE);
13105
13125
  let dropWrap = closest(e.target, '.' + TEXTWRAP);
@@ -13109,6 +13129,9 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13109
13129
  this.removeVirtualEle();
13110
13130
  document.body.style.cursor = '';
13111
13131
  const classList = e.target.classList;
13132
+ const event = e.event;
13133
+ const offsetY = this.getOffsetY(event, e.target);
13134
+ const offsetX = this.getOffsetX(event, e.target);
13112
13135
  if (this.fullRowSelect && !dropWrap && !isNullOrUndefined(classList) && classList.contains(FULLROW)) {
13113
13136
  dropWrap = e.target.nextElementSibling;
13114
13137
  }
@@ -13121,14 +13144,14 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13121
13144
  (!dropLi.isSameNode(this.dragLi) && !this.isDescendant(this.dragLi, dropLi)))) {
13122
13145
  if (this.hasTemplate && dropLi) {
13123
13146
  const templateTarget = select(this.fullRowSelect ? '.' + FULLROW : '.' + TEXTWRAP, dropLi);
13124
- if ((e && (!expand && !collapse) && e.event.offsetY < 7 && !checkWrapper) ||
13125
- (((expand && e.event.offsetY < 5) || (collapse && e.event.offsetX < 3)))) {
13147
+ if ((e && (!expand && !collapse) && offsetY < 7 && !checkWrapper) ||
13148
+ (((expand && offsetY < 5) || (collapse && offsetX < 3)))) {
13126
13149
  const index = this.fullRowSelect ? (1) : (0);
13127
13150
  this.appendIndicator(dropLi, icon, index);
13128
13151
  }
13129
13152
  else if ((e && (!expand && !collapse) &&
13130
- !checkWrapper && templateTarget && e.event.offsetY > templateTarget.offsetHeight - 10) ||
13131
- ((expand && e.event.offsetY > 19) || (collapse && e.event.offsetX > 19))) {
13153
+ !checkWrapper && templateTarget && offsetY > templateTarget.offsetHeight - 10) ||
13154
+ ((expand && offsetY > 19) || (collapse && offsetX > 19))) {
13132
13155
  const index = this.fullRowSelect ? (2) : (1);
13133
13156
  this.appendIndicator(dropLi, icon, index);
13134
13157
  }
@@ -13138,14 +13161,14 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13138
13161
  }
13139
13162
  }
13140
13163
  else {
13141
- if ((dropLi && e && (!expand && !collapse) && (e.event.offsetY < 7) && !checkWrapper) ||
13142
- (((expand && e.event.offsetY < 5) || (collapse && e.event.offsetX < 3)))) {
13164
+ if ((dropLi && e && (!expand && !collapse) && (offsetY < 7) && !checkWrapper) ||
13165
+ (((expand && offsetY < 5) || (collapse && offsetX < 3)))) {
13143
13166
  const index = this.fullRowSelect ? (1) : (0);
13144
13167
  this.appendIndicator(dropLi, icon, index);
13145
13168
  }
13146
13169
  else if ((dropLi && e && (!expand && !collapse) &&
13147
- (e.target.offsetHeight > 0 && e.event.offsetY > (e.target.offsetHeight - 10)) && !checkWrapper) ||
13148
- (((expand && e.event.offsetY > 19) || (collapse && e.event.offsetX > 19)))) {
13170
+ (e.target.offsetHeight > 0 && offsetY > (e.target.offsetHeight - 10)) && !checkWrapper) ||
13171
+ (((expand && offsetY > 19) || (collapse && offsetX > 19)))) {
13149
13172
  const index = this.fullRowSelect ? (2) : (1);
13150
13173
  this.appendIndicator(dropLi, icon, index);
13151
13174
  }
@@ -13190,7 +13213,8 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13190
13213
  dropLi.insertBefore(virEle, dropLi.children[parseInt(index.toString(), 10)]);
13191
13214
  }
13192
13215
  dropAction(e) {
13193
- const offsetY = e.event.offsetY;
13216
+ const event = e.event;
13217
+ const offsetY = this.getOffsetY(event, e.target);
13194
13218
  const dropTarget = e.target;
13195
13219
  let dragObj;
13196
13220
  let level;
@@ -13481,10 +13505,12 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13481
13505
  }
13482
13506
  renderVirtualEle(e) {
13483
13507
  let pre;
13484
- if (e.event.offsetY > e.target.offsetHeight - 2) {
13508
+ const event = e.event;
13509
+ const offsetY = this.getOffsetY(event, e.target);
13510
+ if (offsetY > e.target.offsetHeight - 2) {
13485
13511
  pre = false;
13486
13512
  }
13487
- else if (e.event.offsetY < 2) {
13513
+ else if (offsetY < 2) {
13488
13514
  pre = true;
13489
13515
  }
13490
13516
  const virEle = this.createElement('div', { className: SIBLING });
@@ -15347,6 +15373,7 @@ const SIDEBARABSOLUTE = 'e-sidebar-absolute';
15347
15373
  let Sidebar = class Sidebar extends Component {
15348
15374
  constructor(options, element) {
15349
15375
  super(options, element);
15376
+ this.documentClickContext = this.documentclickHandler.bind(this);
15350
15377
  }
15351
15378
  preRender() {
15352
15379
  this.setWidth();
@@ -15406,10 +15433,12 @@ let Sidebar = class Sidebar extends Component {
15406
15433
  }
15407
15434
  setCloseOnDocumentClick() {
15408
15435
  if (this.closeOnDocumentClick) {
15409
- EventHandler.add(document, 'mousedown touchstart', this.documentclickHandler, this);
15436
+ document.addEventListener('mousedown', this.documentClickContext);
15437
+ document.addEventListener('touchstart', this.documentClickContext);
15410
15438
  }
15411
15439
  else {
15412
- EventHandler.remove(document, 'mousedown touchstart', this.documentclickHandler);
15440
+ document.removeEventListener('mousedown', this.documentClickContext);
15441
+ document.removeEventListener('touchstart', this.documentClickContext);
15413
15442
  }
15414
15443
  }
15415
15444
  setWidth() {
@@ -15709,10 +15738,10 @@ let Sidebar = class Sidebar extends Component {
15709
15738
  this.show();
15710
15739
  }
15711
15740
  else if (this.isOpen && this.position === 'Left' && args.swipeDirection === 'Left') {
15712
- this.hide();
15741
+ this.hide(args.originalEvent);
15713
15742
  }
15714
15743
  else if (this.isOpen && this.position === 'Right' && args.swipeDirection === 'Right') {
15715
- this.hide();
15744
+ this.hide(args.originalEvent);
15716
15745
  }
15717
15746
  else if (!this.isOpen && this.position === 'Right' && args.swipeDirection === 'Left'
15718
15747
  && (window.innerWidth - args.startX <= 20 && args.distanceX >= 50 && args.velocity >= 0.5)) {
@@ -18734,7 +18763,7 @@ let Stepper = class Stepper extends StepperBase {
18734
18763
  if (this.stepperItemList && this.progressbar && this.element.classList.contains(HORIZSTEP)) {
18735
18764
  this.setProgressPosition(this.element, true);
18736
18765
  }
18737
- this.navigateToStep(this.activeStep, null, null, false);
18766
+ this.navigateToStep(this.activeStep, null, null, false, false);
18738
18767
  }
18739
18768
  updateStepFocus() {
18740
18769
  if (this.isKeyNavFocus) {
@@ -19438,7 +19467,7 @@ let Stepper = class Stepper extends StepperBase {
19438
19467
  if (this.stepperItemList && this.progressbar) {
19439
19468
  this.setProgressPosition(this.element);
19440
19469
  }
19441
- this.navigateToStep(this.activeStep, null, null, false);
19470
+ this.navigateToStep(this.activeStep, null, null, false, false);
19442
19471
  }
19443
19472
  updateElementClassArray() {
19444
19473
  const classArray = [RTL$3, READONLY, 'e-steps-focus', LABELAFTER, LABELBEFORE, 'e-label-top',