@syncfusion/ej2-base 20.2.36 → 20.2.43

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 : 20.2.36
3
+ * version : 20.2.43
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. 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-base@*",
3
- "_id": "@syncfusion/ej2-base@18.58.0",
3
+ "_id": "@syncfusion/ej2-base@20.2.38",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-rIaDhHUxi9+mx5Ju81+gwKF/QaAXqR86ATrDmUgKB2ePY2PuNHnJideD7QFdrYAqZAR5Hr5WGQyH66x76y9lCA==",
5
+ "_integrity": "sha512-BgSJmu755AFPhPBzfWxM3d+dA2iX9ltWIMYsNcFkaUKN1AhX9ApfAst3jOBROD0cpZ00qNyvVrFdOyJ765Jutg==",
6
6
  "_location": "/@syncfusion/ej2-base",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -155,8 +155,8 @@
155
155
  "/@syncfusion/ej2-vue-treegrid",
156
156
  "/@syncfusion/ej2-vue-treemap"
157
157
  ],
158
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-base/-/ej2-base-18.58.0.tgz",
159
- "_shasum": "1a8c8e230d4aae3ab630f56f19c1e1955c121ce7",
158
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-base/-/ej2-base-20.2.38.tgz",
159
+ "_shasum": "2dc689f29303104c0d7adfbe1c8c235821f02900",
160
160
  "_spec": "@syncfusion/ej2-base@*",
161
161
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
162
162
  "author": {
@@ -170,7 +170,7 @@
170
170
  },
171
171
  "bundleDependencies": false,
172
172
  "dependencies": {
173
- "@syncfusion/ej2-icons": "~20.2.36"
173
+ "@syncfusion/ej2-icons": "~20.2.43"
174
174
  },
175
175
  "deprecated": false,
176
176
  "description": "A common package of Essential JS 2 base libraries, methods and class definitions",
@@ -211,6 +211,6 @@
211
211
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
212
212
  },
213
213
  "typings": "index.d.ts",
214
- "version": "20.2.36",
214
+ "version": "20.2.43",
215
215
  "sideEffects": true
216
216
  }
@@ -331,6 +331,9 @@ export declare class Draggable extends Base<HTMLElement> implements INotifyPrope
331
331
  private getProcessedPositionValue;
332
332
  private calculateParentPosition;
333
333
  private intDrag;
334
+ private getScrollParent;
335
+ private getScrollPosition;
336
+ private getPathElements;
334
337
  private triggerOutFunction;
335
338
  private getDragPosition;
336
339
  private getDocumentWidthHeight;
package/src/draggable.js CHANGED
@@ -510,23 +510,30 @@ var Draggable = /** @class */ (function (_super) {
510
510
  draEleTop -= this.parentScrollY;
511
511
  draEleLeft -= this.parentScrollX;
512
512
  }
513
- if (this.helperElement.classList.contains('e-treeview')) {
514
- var body = document.body;
515
- var html = document.documentElement;
516
- var tempHeight = Math.max(body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
517
- var tempWidth = Math.max(body.offsetWidth, html.clientWidth, html.scrollWidth, html.offsetWidth);
518
- if (draEleTop > tempHeight) {
519
- draEleTop = tempHeight;
520
- }
521
- if (draEleLeft > tempWidth) {
522
- draEleLeft = tempWidth;
523
- }
524
- }
525
513
  var dragValue = this.getProcessedPositionValue({ top: draEleTop + 'px', left: draEleLeft + 'px' });
526
514
  setStyleAttribute(helperElement, this.getDragPosition(dragValue));
527
- if (!this.elementInViewport(helperElement) && this.enableAutoScroll) {
515
+ if (!this.elementInViewport(helperElement) && this.enableAutoScroll && !this.helperElement.classList.contains('e-treeview')) {
528
516
  this.helperElement.scrollIntoView();
529
517
  }
518
+ var elements = document.querySelectorAll(':hover');
519
+ if (this.enableAutoScroll && this.helperElement.classList.contains('e-treeview')) {
520
+ if (elements.length === 0) {
521
+ elements = this.getPathElements(evt);
522
+ }
523
+ /* tslint:disable no-any */
524
+ var scrollParent = this.getScrollParent(elements, false);
525
+ if (this.elementInViewport(this.helperElement)) {
526
+ this.getScrollPosition(scrollParent, draEleTop);
527
+ }
528
+ else if (!this.elementInViewport(this.helperElement)) {
529
+ elements = [].slice.call(document.querySelectorAll(':hover'));
530
+ if (elements.length === 0) {
531
+ elements = this.getPathElements(evt);
532
+ }
533
+ scrollParent = this.getScrollParent(elements, true);
534
+ this.getScrollPosition(scrollParent, draEleTop);
535
+ }
536
+ }
530
537
  this.dragProcessStarted = true;
531
538
  this.prevLeft = left;
532
539
  this.prevTop = top;
@@ -535,6 +542,48 @@ var Draggable = /** @class */ (function (_super) {
535
542
  this.pageX = pagex;
536
543
  this.pageY = pagey;
537
544
  };
545
+ /* tslint:disable no-any */
546
+ Draggable.prototype.getScrollParent = function (node, reverse) {
547
+ /* tslint:disable no-any */
548
+ var nodeEl = reverse ? node.reverse() : node;
549
+ var hasScroll;
550
+ for (var i = nodeEl.length - 1; i >= 0; i--) {
551
+ hasScroll = window.getComputedStyle(nodeEl[i])['overflow-y'];
552
+ if ((hasScroll === 'auto' || hasScroll === 'scroll')
553
+ && nodeEl[i].scrollHeight > nodeEl[i].clientHeight) {
554
+ return nodeEl[i];
555
+ }
556
+ }
557
+ hasScroll = window.getComputedStyle(document.scrollingElement)['overflow-y'];
558
+ if (hasScroll === 'visible') {
559
+ document.scrollingElement.style.overflow = 'auto';
560
+ return document.scrollingElement;
561
+ }
562
+ };
563
+ Draggable.prototype.getScrollPosition = function (nodeEle, draEleTop) {
564
+ if (nodeEle && nodeEle === document.scrollingElement) {
565
+ if ((nodeEle.clientHeight - nodeEle.getBoundingClientRect().top - this.helperElement.clientHeight) < draEleTop
566
+ && nodeEle.getBoundingClientRect().height > draEleTop) {
567
+ nodeEle.scrollTop += this.helperElement.clientHeight;
568
+ }
569
+ else if (nodeEle.scrollHeight - nodeEle.clientHeight > draEleTop) {
570
+ nodeEle.scrollTop -= this.helperElement.clientHeight;
571
+ }
572
+ }
573
+ else if (nodeEle && nodeEle !== document.scrollingElement) {
574
+ if ((nodeEle.clientHeight + nodeEle.getBoundingClientRect().top - this.helperElement.clientHeight) < draEleTop) {
575
+ nodeEle.scrollTop += this.helperElement.clientHeight;
576
+ }
577
+ else if (nodeEle.getBoundingClientRect().top > (draEleTop - this.helperElement.clientHeight)) {
578
+ nodeEle.scrollTop -= this.helperElement.clientHeight;
579
+ }
580
+ }
581
+ };
582
+ Draggable.prototype.getPathElements = function (evt) {
583
+ var elementTop = evt.clientX > 0 ? evt.clientX : 0;
584
+ var elementLeft = evt.clientY > 0 ? evt.clientY : 0;
585
+ return document.elementsFromPoint(elementTop, elementLeft);
586
+ };
538
587
  Draggable.prototype.triggerOutFunction = function (evt, eleObj) {
539
588
  this.hoverObject.instance.intOut(evt, eleObj.target);
540
589
  this.hoverObject.instance.dragData[this.scope] = null;
package/src/touch.js CHANGED
@@ -157,6 +157,10 @@ var Touch = /** @class */ (function (_super) {
157
157
  diffX = Math.floor(diffX < 0 ? -1 * diffX : diffX);
158
158
  diffY = Math.floor(diffY < 0 ? -1 * diffY : diffX);
159
159
  _this.isTouchMoved = diffX > 1 || diffY > 1;
160
+ var isFirefox = (/Firefox/).test(Browser.userAgent);
161
+ if (isFirefox && point.clientX === 0 && point.clientY === 0 && evt.type === 'mouseup') {
162
+ _this.isTouchMoved = false;
163
+ }
160
164
  _this.endPoint = point;
161
165
  _this.calcPoints(evt);
162
166
  var swipeArgs = {