@syncfusion/ej2-base 20.2.38 → 20.2.39

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,12 +1,3 @@
1
- /*!
2
- * filename: index.d.ts
3
- * version : 20.2.38
4
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
- * Use of this code is subject to the terms of our license.
6
- * A copy of the current license can be obtained at any time by e-mailing
7
- * licensing@syncfusion.com. Any infringement will be prosecuted under
8
- * applicable laws.
9
- */
10
1
  import * as _base from '@syncfusion/ej2-base';
11
2
 
12
3
  export declare namespace ej {
package/package.json CHANGED
@@ -1,164 +1,5 @@
1
1
  {
2
- "_from": "@syncfusion/ej2-base@*",
3
- "_id": "@syncfusion/ej2-base@20.2.36",
4
- "_inBundle": false,
5
- "_integrity": "sha512-PVVdLzKeoDUW4CQ7OC3O+gWeFMLnll6YsVnM/pJkUYo7ny/CZ6FvlHF7YZvTqcUCM6ndZebEom30WKk4YtKecA==",
6
- "_location": "/@syncfusion/ej2-base",
7
- "_phantomChildren": {},
8
- "_requested": {
9
- "type": "range",
10
- "registry": true,
11
- "raw": "@syncfusion/ej2-base@*",
12
- "name": "@syncfusion/ej2-base",
13
- "escapedName": "@syncfusion%2fej2-base",
14
- "scope": "@syncfusion",
15
- "rawSpec": "*",
16
- "saveSpec": null,
17
- "fetchSpec": "*"
18
- },
19
- "_requiredBy": [
20
- "/",
21
- "/@syncfusion/ej2",
22
- "/@syncfusion/ej2-angular-barcode-generator",
23
- "/@syncfusion/ej2-angular-base",
24
- "/@syncfusion/ej2-angular-buttons",
25
- "/@syncfusion/ej2-angular-calendars",
26
- "/@syncfusion/ej2-angular-charts",
27
- "/@syncfusion/ej2-angular-circulargauge",
28
- "/@syncfusion/ej2-angular-diagrams",
29
- "/@syncfusion/ej2-angular-documenteditor",
30
- "/@syncfusion/ej2-angular-dropdowns",
31
- "/@syncfusion/ej2-angular-filemanager",
32
- "/@syncfusion/ej2-angular-gantt",
33
- "/@syncfusion/ej2-angular-grids",
34
- "/@syncfusion/ej2-angular-heatmap",
35
- "/@syncfusion/ej2-angular-inplace-editor",
36
- "/@syncfusion/ej2-angular-inputs",
37
- "/@syncfusion/ej2-angular-kanban",
38
- "/@syncfusion/ej2-angular-layouts",
39
- "/@syncfusion/ej2-angular-lineargauge",
40
- "/@syncfusion/ej2-angular-lists",
41
- "/@syncfusion/ej2-angular-maps",
42
- "/@syncfusion/ej2-angular-navigations",
43
- "/@syncfusion/ej2-angular-notifications",
44
- "/@syncfusion/ej2-angular-pdfviewer",
45
- "/@syncfusion/ej2-angular-pivotview",
46
- "/@syncfusion/ej2-angular-popups",
47
- "/@syncfusion/ej2-angular-progressbar",
48
- "/@syncfusion/ej2-angular-querybuilder",
49
- "/@syncfusion/ej2-angular-richtexteditor",
50
- "/@syncfusion/ej2-angular-schedule",
51
- "/@syncfusion/ej2-angular-splitbuttons",
52
- "/@syncfusion/ej2-angular-spreadsheet",
53
- "/@syncfusion/ej2-angular-treegrid",
54
- "/@syncfusion/ej2-angular-treemap",
55
- "/@syncfusion/ej2-barcode-generator",
56
- "/@syncfusion/ej2-buttons",
57
- "/@syncfusion/ej2-calendars",
58
- "/@syncfusion/ej2-charts",
59
- "/@syncfusion/ej2-circulargauge",
60
- "/@syncfusion/ej2-data",
61
- "/@syncfusion/ej2-diagrams",
62
- "/@syncfusion/ej2-documenteditor",
63
- "/@syncfusion/ej2-drawings",
64
- "/@syncfusion/ej2-dropdowns",
65
- "/@syncfusion/ej2-excel-export",
66
- "/@syncfusion/ej2-filemanager",
67
- "/@syncfusion/ej2-gantt",
68
- "/@syncfusion/ej2-grids",
69
- "/@syncfusion/ej2-heatmap",
70
- "/@syncfusion/ej2-inplace-editor",
71
- "/@syncfusion/ej2-inputs",
72
- "/@syncfusion/ej2-kanban",
73
- "/@syncfusion/ej2-layouts",
74
- "/@syncfusion/ej2-lineargauge",
75
- "/@syncfusion/ej2-lists",
76
- "/@syncfusion/ej2-maps",
77
- "/@syncfusion/ej2-navigations",
78
- "/@syncfusion/ej2-notifications",
79
- "/@syncfusion/ej2-pdfviewer",
80
- "/@syncfusion/ej2-pivotview",
81
- "/@syncfusion/ej2-popups",
82
- "/@syncfusion/ej2-progressbar",
83
- "/@syncfusion/ej2-querybuilder",
84
- "/@syncfusion/ej2-react-barcode-generator",
85
- "/@syncfusion/ej2-react-base",
86
- "/@syncfusion/ej2-react-buttons",
87
- "/@syncfusion/ej2-react-calendars",
88
- "/@syncfusion/ej2-react-charts",
89
- "/@syncfusion/ej2-react-circulargauge",
90
- "/@syncfusion/ej2-react-diagrams",
91
- "/@syncfusion/ej2-react-documenteditor",
92
- "/@syncfusion/ej2-react-dropdowns",
93
- "/@syncfusion/ej2-react-filemanager",
94
- "/@syncfusion/ej2-react-gantt",
95
- "/@syncfusion/ej2-react-grids",
96
- "/@syncfusion/ej2-react-heatmap",
97
- "/@syncfusion/ej2-react-inplace-editor",
98
- "/@syncfusion/ej2-react-inputs",
99
- "/@syncfusion/ej2-react-kanban",
100
- "/@syncfusion/ej2-react-layouts",
101
- "/@syncfusion/ej2-react-lineargauge",
102
- "/@syncfusion/ej2-react-lists",
103
- "/@syncfusion/ej2-react-maps",
104
- "/@syncfusion/ej2-react-navigations",
105
- "/@syncfusion/ej2-react-notifications",
106
- "/@syncfusion/ej2-react-pdfviewer",
107
- "/@syncfusion/ej2-react-pivotview",
108
- "/@syncfusion/ej2-react-popups",
109
- "/@syncfusion/ej2-react-progressbar",
110
- "/@syncfusion/ej2-react-querybuilder",
111
- "/@syncfusion/ej2-react-richtexteditor",
112
- "/@syncfusion/ej2-react-schedule",
113
- "/@syncfusion/ej2-react-splitbuttons",
114
- "/@syncfusion/ej2-react-spreadsheet",
115
- "/@syncfusion/ej2-react-treegrid",
116
- "/@syncfusion/ej2-react-treemap",
117
- "/@syncfusion/ej2-richtexteditor",
118
- "/@syncfusion/ej2-schedule",
119
- "/@syncfusion/ej2-splitbuttons",
120
- "/@syncfusion/ej2-spreadsheet",
121
- "/@syncfusion/ej2-svg-base",
122
- "/@syncfusion/ej2-treegrid",
123
- "/@syncfusion/ej2-treemap",
124
- "/@syncfusion/ej2-vue-barcode-generator",
125
- "/@syncfusion/ej2-vue-base",
126
- "/@syncfusion/ej2-vue-buttons",
127
- "/@syncfusion/ej2-vue-calendars",
128
- "/@syncfusion/ej2-vue-charts",
129
- "/@syncfusion/ej2-vue-circulargauge",
130
- "/@syncfusion/ej2-vue-diagrams",
131
- "/@syncfusion/ej2-vue-documenteditor",
132
- "/@syncfusion/ej2-vue-dropdowns",
133
- "/@syncfusion/ej2-vue-filemanager",
134
- "/@syncfusion/ej2-vue-gantt",
135
- "/@syncfusion/ej2-vue-grids",
136
- "/@syncfusion/ej2-vue-heatmap",
137
- "/@syncfusion/ej2-vue-inplace-editor",
138
- "/@syncfusion/ej2-vue-inputs",
139
- "/@syncfusion/ej2-vue-kanban",
140
- "/@syncfusion/ej2-vue-layouts",
141
- "/@syncfusion/ej2-vue-lineargauge",
142
- "/@syncfusion/ej2-vue-lists",
143
- "/@syncfusion/ej2-vue-maps",
144
- "/@syncfusion/ej2-vue-navigations",
145
- "/@syncfusion/ej2-vue-notifications",
146
- "/@syncfusion/ej2-vue-pdfviewer",
147
- "/@syncfusion/ej2-vue-pivotview",
148
- "/@syncfusion/ej2-vue-popups",
149
- "/@syncfusion/ej2-vue-progressbar",
150
- "/@syncfusion/ej2-vue-querybuilder",
151
- "/@syncfusion/ej2-vue-richtexteditor",
152
- "/@syncfusion/ej2-vue-schedule",
153
- "/@syncfusion/ej2-vue-splitbuttons",
154
- "/@syncfusion/ej2-vue-spreadsheet",
155
- "/@syncfusion/ej2-vue-treegrid",
156
- "/@syncfusion/ej2-vue-treemap"
157
- ],
158
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-base/-/ej2-base-20.2.36.tgz",
159
- "_shasum": "32d82d3499a3fb502a4e982ec6725dc535c1f06a",
160
- "_spec": "@syncfusion/ej2-base@*",
161
- "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
2
+
162
3
  "author": {
163
4
  "name": "Syncfusion Inc."
164
5
  },
@@ -210,7 +51,7 @@
210
51
  "type": "git",
211
52
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
212
53
  },
54
+ "sideEffects": true,
213
55
  "typings": "index.d.ts",
214
- "version": "20.2.38",
215
- "sideEffects": true
216
- }
56
+ "version": "20.2.39"
57
+ }
@@ -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;