@refinitiv-ui/efx-grid 6.0.136 → 6.0.138
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.
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +67 -62
- package/lib/core/dist/core.js +18 -16
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.js +2 -2
- package/lib/core/es6/grid/LayoutGrid.js +16 -14
- package/lib/filter-dialog/lib/filter-dialog.d.ts +1 -0
- package/lib/filter-dialog/lib/filter-dialog.js +74 -80
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +11 -18
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/RowDefinition.js +11 -18
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -1
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +14 -4
- package/lib/types/es6/RowFiltering.d.ts +2 -1
- package/lib/types/es6/Zoom.d.ts +14 -14
- package/lib/versions.json +4 -4
- package/lib/zoom/es6/Zoom.d.ts +14 -14
- package/lib/zoom/es6/Zoom.js +43 -31
- package/package.json +1 -1
@@ -515,8 +515,7 @@ RowDefinition.prototype.getConfigObject = function(rowOptions) {
|
|
515
515
|
obj["collapsed"] = val;
|
516
516
|
}
|
517
517
|
|
518
|
-
|
519
|
-
val = this._view.isHiddenRow(this._rowId);
|
518
|
+
val = this._view ? this._view.isHiddenRow(this._rowId) : false;
|
520
519
|
if(val) {
|
521
520
|
obj["hidden"] = val;
|
522
521
|
}
|
@@ -1090,19 +1089,6 @@ RowDefinition.deregisterFromView = function(rowIds, rowDef) {
|
|
1090
1089
|
rowDef._deregisterFromView(rowIds);
|
1091
1090
|
return rowIds;
|
1092
1091
|
};
|
1093
|
-
/** @private
|
1094
|
-
* @param {string} ric
|
1095
|
-
* @return {Object}
|
1096
|
-
*/
|
1097
|
-
RowDefinition.prototype._getChildStaticRowData = function(ric) {
|
1098
|
-
if(this._staticValues) {
|
1099
|
-
let childValues = this._staticValues[RowDefinition._childDataField];
|
1100
|
-
if(childValues) {
|
1101
|
-
return childValues[ric] || null;
|
1102
|
-
}
|
1103
|
-
}
|
1104
|
-
return null;
|
1105
|
-
};
|
1106
1092
|
|
1107
1093
|
/** @public
|
1108
1094
|
* @ignore
|
@@ -1157,9 +1143,16 @@ RowDefinition.prototype.addConstituent = function(ric) {
|
|
1157
1143
|
"parent": this
|
1158
1144
|
};
|
1159
1145
|
|
1160
|
-
|
1161
|
-
if(
|
1162
|
-
|
1146
|
+
// Get child static values stored in this row
|
1147
|
+
if(this._staticValues) {
|
1148
|
+
let children = this._staticValues[RowDefinition._childDataField];
|
1149
|
+
if(children) {
|
1150
|
+
let childValues = children[ric];
|
1151
|
+
if(childValues) {
|
1152
|
+
rowOptions["values"] = childValues;
|
1153
|
+
children[ric] = null;
|
1154
|
+
}
|
1155
|
+
}
|
1163
1156
|
}
|
1164
1157
|
|
1165
1158
|
return new RowDefinition(rowOptions); // childDef is added to this._children in the constructor
|
@@ -37,7 +37,8 @@ declare namespace RowFilteringPlugin {
|
|
37
37
|
itemList?: any[]|null,
|
38
38
|
additionalItems?: any[]|null,
|
39
39
|
compactMode?: boolean|null,
|
40
|
-
blankValues?: (boolean|string)|null
|
40
|
+
blankValues?: (boolean|string)|null,
|
41
|
+
dateTimeFormat?: string|null
|
41
42
|
};
|
42
43
|
|
43
44
|
type FilterEntry = {
|
@@ -91,7 +91,8 @@ The expression can take various forms:<br>
|
|
91
91
|
* @property {Array=} itemList Item list to be shown in the dialog. If this is not specified, the list will be collected from existing data on the grid
|
92
92
|
* @property {Array=} additionalItems Additional items to be put on the itemList
|
93
93
|
* @property {boolean=} compactMode=false force compact mode in dialog
|
94
|
-
* @property {(boolean|string)=} blankValues Display a "(Blanks)" item in the filter dialog to represent an empty value. If a string is passed, it will be used as the label for the blank item
|
94
|
+
* @property {(boolean|string)=} blankValues=false Display a "(Blanks)" item in the filter dialog to represent an empty value. If a string is passed, it will be used as the label for the blank item
|
95
|
+
* @property {string=} dateTimeFormat="dd-MM-yy" Specifies the string format for the date time picker in the filter dialog based on date-fns format, follow https://date-fns.org/v3.6.0/docs/format.
|
95
96
|
*/
|
96
97
|
|
97
98
|
/** @typedef {Object} RowFilteringPlugin~FilterEntry
|
@@ -1721,7 +1722,9 @@ RowFilteringPlugin._createDialog = function() {
|
|
1721
1722
|
}
|
1722
1723
|
return tag ? document.createElement(tag) : null;
|
1723
1724
|
};
|
1724
|
-
/**
|
1725
|
+
/** Prepare user's array expression to be displayed in Filter Dialog. Convert date string to date object. Format raw value for text input
|
1726
|
+
* @public
|
1727
|
+
* @ignore
|
1725
1728
|
* @function
|
1726
1729
|
* @param {Array} exp
|
1727
1730
|
* @param {string} field
|
@@ -1748,11 +1751,12 @@ RowFilteringPlugin._formatArrayExpression = function(exp, field, formatter) {
|
|
1748
1751
|
if(formattedVal) {
|
1749
1752
|
ary.rawValue = val;
|
1750
1753
|
ary.formattedValue = formattedVal;
|
1754
|
+
ary[1] = formattedVal;
|
1751
1755
|
} else {
|
1752
|
-
|
1756
|
+
ary[1] = val;
|
1753
1757
|
}
|
1758
|
+
|
1754
1759
|
}
|
1755
|
-
ary[1] = formattedVal;
|
1756
1760
|
return ary;
|
1757
1761
|
}
|
1758
1762
|
return null;
|
@@ -1869,6 +1873,7 @@ RowFilteringPlugin.prototype.openDialog = function(colIndex, runtimeDialogOption
|
|
1869
1873
|
advancedFilter: true,
|
1870
1874
|
compactMode: false,
|
1871
1875
|
fieldDataType: "",
|
1876
|
+
dateTimeFormat: "dd-MM-yy",
|
1872
1877
|
lang: "",
|
1873
1878
|
rawDataAccessor: null,
|
1874
1879
|
formattedDataAccessor: null,
|
@@ -2033,6 +2038,11 @@ RowFilteringPlugin._overrideConfig = function(config, userConfig) {
|
|
2033
2038
|
config.advancedFilter = advancedFilter;
|
2034
2039
|
}
|
2035
2040
|
|
2041
|
+
let dateTimeFormat = userConfig["dateTimeFormat"];
|
2042
|
+
if (dateTimeFormat != null) {
|
2043
|
+
config.dateTimeFormat = dateTimeFormat;
|
2044
|
+
}
|
2045
|
+
|
2036
2046
|
let compactMode = userConfig["compactMode"];
|
2037
2047
|
if (compactMode != null) {
|
2038
2048
|
config.compactMode = compactMode;
|
@@ -37,7 +37,8 @@ declare namespace RowFilteringPlugin {
|
|
37
37
|
itemList?: any[]|null,
|
38
38
|
additionalItems?: any[]|null,
|
39
39
|
compactMode?: boolean|null,
|
40
|
-
blankValues?: (boolean|string)|null
|
40
|
+
blankValues?: (boolean|string)|null,
|
41
|
+
dateTimeFormat?: string|null
|
41
42
|
};
|
42
43
|
|
43
44
|
type FilterEntry = {
|
package/lib/types/es6/Zoom.d.ts
CHANGED
@@ -4,23 +4,23 @@ import Ext from "../../tr-grid-util/es6/Ext.js";
|
|
4
4
|
declare namespace ZoomPlugin {
|
5
5
|
|
6
6
|
type Options = {
|
7
|
-
zoomFactor?: number,
|
8
|
-
step?: number,
|
9
|
-
wheel?: boolean,
|
10
|
-
maxFactor?: number,
|
11
|
-
minFactor?: number,
|
12
|
-
zoomChanged?: ((...params: any[]) => any)
|
7
|
+
zoomFactor?: number|null,
|
8
|
+
step?: number|null,
|
9
|
+
wheel?: boolean|null,
|
10
|
+
maxFactor?: number|null,
|
11
|
+
minFactor?: number|null,
|
12
|
+
zoomChanged?: ((...params: any[]) => any)|null
|
13
13
|
};
|
14
14
|
|
15
15
|
}
|
16
16
|
|
17
17
|
declare class ZoomPlugin extends GridPlugin {
|
18
18
|
|
19
|
-
constructor(options?: ZoomPlugin.Options);
|
19
|
+
constructor(options?: ZoomPlugin.Options|null);
|
20
20
|
|
21
21
|
public hasMultiTableSupport(): boolean;
|
22
22
|
|
23
|
-
public config(options?: ZoomPlugin.Options): void;
|
23
|
+
public config(options?: ZoomPlugin.Options|null): void;
|
24
24
|
|
25
25
|
public getConfigObject(gridOptions?: any): any;
|
26
26
|
|
@@ -30,21 +30,21 @@ declare class ZoomPlugin extends GridPlugin {
|
|
30
30
|
|
31
31
|
public zoomOut(): number;
|
32
32
|
|
33
|
-
public zoomTo(factor?: number): number;
|
33
|
+
public zoomTo(factor?: number|null): number;
|
34
34
|
|
35
35
|
public setStep(step: number): void;
|
36
36
|
|
37
|
-
public zoomDefault(zoomFactor?: number): number;
|
37
|
+
public zoomDefault(zoomFactor?: number|null): number;
|
38
38
|
|
39
|
-
public addElement(elem: Element): void;
|
39
|
+
public addElement(elem: Element|null): void;
|
40
40
|
|
41
|
-
public removeElement(elem: Element): Element;
|
41
|
+
public removeElement(elem: Element|null): Element|null;
|
42
42
|
|
43
43
|
public updateZoomedLayout(): void;
|
44
44
|
|
45
|
-
public enableWheelToZoom(bool?: boolean): void;
|
45
|
+
public enableWheelToZoom(bool?: boolean|null): void;
|
46
46
|
|
47
|
-
public getDefaultMouseWheelLogic(): ((...params: any[]) => any);
|
47
|
+
public getDefaultMouseWheelLogic(): ((...params: any[]) => any)|null;
|
48
48
|
|
49
49
|
}
|
50
50
|
|
package/lib/versions.json
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
"@grid/column-dragging": "1.0.21",
|
5
5
|
"@grid/row-segmenting": "1.0.35",
|
6
6
|
"@grid/statistics-row": "1.0.17",
|
7
|
-
"@grid/zoom": "1.0.
|
7
|
+
"@grid/zoom": "1.0.13",
|
8
8
|
"tr-grid-auto-tooltip": "1.1.9",
|
9
9
|
"tr-grid-cell-selection": "1.0.39",
|
10
10
|
"tr-grid-checkbox": "1.0.70",
|
@@ -24,14 +24,14 @@
|
|
24
24
|
"tr-grid-percent-bar": "1.0.24",
|
25
25
|
"tr-grid-range-bar": "2.0.9",
|
26
26
|
"tr-grid-row-dragging": "1.0.38",
|
27
|
-
"tr-grid-row-filtering": "1.0.
|
27
|
+
"tr-grid-row-filtering": "1.0.87",
|
28
28
|
"tr-grid-row-grouping": "1.0.88",
|
29
29
|
"tr-grid-row-selection": "1.0.33",
|
30
30
|
"tr-grid-rowcoloring": "1.0.26",
|
31
31
|
"tr-grid-textformatting": "1.0.49",
|
32
32
|
"tr-grid-titlewrap": "1.0.22",
|
33
33
|
"@grid/formatters": "1.0.55",
|
34
|
-
"@grid/column-selection-dialog": "4.0.
|
35
|
-
"@grid/filter-dialog": "4.0.
|
34
|
+
"@grid/column-selection-dialog": "4.0.59",
|
35
|
+
"@grid/filter-dialog": "4.0.79",
|
36
36
|
"@grid/column-format-dialog": "4.0.45"
|
37
37
|
}
|
package/lib/zoom/es6/Zoom.d.ts
CHANGED
@@ -4,23 +4,23 @@ import Ext from "../../tr-grid-util/es6/Ext.js";
|
|
4
4
|
declare namespace ZoomPlugin {
|
5
5
|
|
6
6
|
type Options = {
|
7
|
-
zoomFactor?: number,
|
8
|
-
step?: number,
|
9
|
-
wheel?: boolean,
|
10
|
-
maxFactor?: number,
|
11
|
-
minFactor?: number,
|
12
|
-
zoomChanged?: ((...params: any[]) => any)
|
7
|
+
zoomFactor?: number|null,
|
8
|
+
step?: number|null,
|
9
|
+
wheel?: boolean|null,
|
10
|
+
maxFactor?: number|null,
|
11
|
+
minFactor?: number|null,
|
12
|
+
zoomChanged?: ((...params: any[]) => any)|null
|
13
13
|
};
|
14
14
|
|
15
15
|
}
|
16
16
|
|
17
17
|
declare class ZoomPlugin extends GridPlugin {
|
18
18
|
|
19
|
-
constructor(options?: ZoomPlugin.Options);
|
19
|
+
constructor(options?: ZoomPlugin.Options|null);
|
20
20
|
|
21
21
|
public hasMultiTableSupport(): boolean;
|
22
22
|
|
23
|
-
public config(options?: ZoomPlugin.Options): void;
|
23
|
+
public config(options?: ZoomPlugin.Options|null): void;
|
24
24
|
|
25
25
|
public getConfigObject(gridOptions?: any): any;
|
26
26
|
|
@@ -30,21 +30,21 @@ declare class ZoomPlugin extends GridPlugin {
|
|
30
30
|
|
31
31
|
public zoomOut(): number;
|
32
32
|
|
33
|
-
public zoomTo(factor?: number): number;
|
33
|
+
public zoomTo(factor?: number|null): number;
|
34
34
|
|
35
35
|
public setStep(step: number): void;
|
36
36
|
|
37
|
-
public zoomDefault(zoomFactor?: number): number;
|
37
|
+
public zoomDefault(zoomFactor?: number|null): number;
|
38
38
|
|
39
|
-
public addElement(elem: Element): void;
|
39
|
+
public addElement(elem: Element|null): void;
|
40
40
|
|
41
|
-
public removeElement(elem: Element): Element;
|
41
|
+
public removeElement(elem: Element|null): Element|null;
|
42
42
|
|
43
43
|
public updateZoomedLayout(): void;
|
44
44
|
|
45
|
-
public enableWheelToZoom(bool?: boolean): void;
|
45
|
+
public enableWheelToZoom(bool?: boolean|null): void;
|
46
46
|
|
47
|
-
public getDefaultMouseWheelLogic(): ((...params: any[]) => any);
|
47
|
+
public getDefaultMouseWheelLogic(): ((...params: any[]) => any)|null;
|
48
48
|
|
49
49
|
}
|
50
50
|
|
package/lib/zoom/es6/Zoom.js
CHANGED
@@ -24,8 +24,8 @@ import Ext from "../../tr-grid-util/es6/Ext.js";
|
|
24
24
|
* @param {ZoomPlugin.Options=} options
|
25
25
|
* @extends {GridPlugin}
|
26
26
|
*/
|
27
|
-
|
28
|
-
|
27
|
+
let ZoomPlugin = function (options) {
|
28
|
+
let t = this;
|
29
29
|
|
30
30
|
t._updateZoomedLayout = t._updateZoomedLayout.bind(t);
|
31
31
|
t._updateElementLayout = t._updateElementLayout.bind(t);
|
@@ -81,7 +81,7 @@ ZoomPlugin.prototype.getName = function () {
|
|
81
81
|
|
82
82
|
/** @override */
|
83
83
|
ZoomPlugin.prototype.initialize = function (host, options) {
|
84
|
-
|
84
|
+
let t = this;
|
85
85
|
if (t._hosts.indexOf(host) >= 0) {
|
86
86
|
return;
|
87
87
|
}
|
@@ -104,8 +104,8 @@ ZoomPlugin.prototype.initialize = function (host, options) {
|
|
104
104
|
|
105
105
|
/** @override */
|
106
106
|
ZoomPlugin.prototype.unload = function (host) {
|
107
|
-
|
108
|
-
|
107
|
+
let t = this;
|
108
|
+
let at = t._hosts.indexOf(host);
|
109
109
|
if (at < 0) { return; }
|
110
110
|
|
111
111
|
if(t._hosts.length === 1) {
|
@@ -123,14 +123,14 @@ ZoomPlugin.prototype.unload = function (host) {
|
|
123
123
|
ZoomPlugin.prototype.config = function (options) {
|
124
124
|
if (!options) { return; }
|
125
125
|
|
126
|
-
|
126
|
+
let extOptions = options["zoom"];
|
127
127
|
|
128
128
|
if (!extOptions) {
|
129
129
|
return;
|
130
130
|
}
|
131
|
-
|
131
|
+
let t = this;
|
132
132
|
|
133
|
-
|
133
|
+
let val = extOptions["wheel"];
|
134
134
|
if (val != null) {
|
135
135
|
t._wheel = !!val;
|
136
136
|
}
|
@@ -163,14 +163,16 @@ ZoomPlugin.prototype.config = function (options) {
|
|
163
163
|
* @return {!Object}
|
164
164
|
*/
|
165
165
|
ZoomPlugin.prototype.getConfigObject = function (gridOptions) {
|
166
|
-
|
166
|
+
let obj = gridOptions || {};
|
167
167
|
|
168
|
-
|
168
|
+
let extOptions = obj.zoom;
|
169
169
|
if(!extOptions) {
|
170
170
|
extOptions = obj.zoom = {};
|
171
171
|
}
|
172
172
|
|
173
|
-
|
173
|
+
if(!this._wheel) {
|
174
|
+
extOptions.wheel = false;
|
175
|
+
}
|
174
176
|
|
175
177
|
if (this._step !== 0.25) {
|
176
178
|
extOptions.step = this._step;
|
@@ -201,7 +203,7 @@ ZoomPlugin.prototype.getZoomFactor = function () {
|
|
201
203
|
* @return {number} zoomFactor
|
202
204
|
*/
|
203
205
|
ZoomPlugin.prototype.zoomIn = function () {
|
204
|
-
|
206
|
+
let t = this;
|
205
207
|
t.zoomTo(t._zoomFactor + t._step);
|
206
208
|
return t._zoomFactor;
|
207
209
|
};
|
@@ -210,7 +212,7 @@ ZoomPlugin.prototype.zoomIn = function () {
|
|
210
212
|
* @return {number} zoomFactor
|
211
213
|
*/
|
212
214
|
ZoomPlugin.prototype.zoomOut = function () {
|
213
|
-
|
215
|
+
let t = this;
|
214
216
|
t.zoomTo(t._zoomFactor - t._step);
|
215
217
|
return t._zoomFactor;
|
216
218
|
};
|
@@ -220,7 +222,7 @@ ZoomPlugin.prototype.zoomOut = function () {
|
|
220
222
|
* @return {number} factor
|
221
223
|
*/
|
222
224
|
ZoomPlugin.prototype.zoomTo = function (factor) {
|
223
|
-
|
225
|
+
let t = this;
|
224
226
|
|
225
227
|
if (!factor) { // 0, NaN, undefined, empty string, and null
|
226
228
|
factor = 1;
|
@@ -239,11 +241,11 @@ ZoomPlugin.prototype.zoomTo = function (factor) {
|
|
239
241
|
return factor;
|
240
242
|
}
|
241
243
|
|
242
|
-
|
244
|
+
let prevZoomFactor = t._zoomFactor;
|
243
245
|
t._zoomFactor = factor;
|
244
246
|
|
245
247
|
// TODO: Refactor the logic, so that the zoom styles are applied directly to the parent element, eliminating margin-right styling
|
246
|
-
|
248
|
+
let i;
|
247
249
|
for (i = t._elems.length; --i >= 0;) {
|
248
250
|
t._applyZoom(t._elems[i]);
|
249
251
|
}
|
@@ -264,7 +266,7 @@ ZoomPlugin.prototype.zoomTo = function (factor) {
|
|
264
266
|
* @param {number} step
|
265
267
|
*/
|
266
268
|
ZoomPlugin.prototype.setStep = function (step) {
|
267
|
-
|
269
|
+
let s = step;
|
268
270
|
if (s != null) {
|
269
271
|
if (typeof s !== "number") {
|
270
272
|
s = parseFloat(s);
|
@@ -285,7 +287,7 @@ ZoomPlugin.prototype.zoomDefault = ZoomPlugin.prototype.zoomTo;
|
|
285
287
|
* @param {Element} elem
|
286
288
|
*/
|
287
289
|
ZoomPlugin.prototype.addElement = function (elem) {
|
288
|
-
|
290
|
+
let t = this;
|
289
291
|
if (elem && t._elems.indexOf(elem) < 0) {
|
290
292
|
t._applyZoom(elem);
|
291
293
|
t._elems.push(elem);
|
@@ -298,8 +300,8 @@ ZoomPlugin.prototype.addElement = function (elem) {
|
|
298
300
|
* @returns {Element}
|
299
301
|
*/
|
300
302
|
ZoomPlugin.prototype.removeElement = function (elem) {
|
301
|
-
|
302
|
-
|
303
|
+
let t = this;
|
304
|
+
let at = t._elems.indexOf(elem);
|
303
305
|
if (at >= 0) {
|
304
306
|
t._elems.splice(at, 1);
|
305
307
|
t._clearZoomStyles(elem);
|
@@ -317,11 +319,11 @@ ZoomPlugin.prototype.updateZoomedLayout = function() {
|
|
317
319
|
* @param {Element|tr.Grid} obj
|
318
320
|
*/
|
319
321
|
ZoomPlugin.prototype._applyZoom = function (obj) {
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
322
|
+
let t = this;
|
323
|
+
let elem = (obj && obj.getElement) ? obj.getElement() : obj;
|
324
|
+
if(!elem) {
|
325
|
+
return;
|
326
|
+
}
|
325
327
|
|
326
328
|
// This type of css scale is most compatable options
|
327
329
|
// alternative css can be more promising but not the most copatable (like: zoom)
|
@@ -343,7 +345,7 @@ ZoomPlugin.prototype._applyZoom = function (obj) {
|
|
343
345
|
* @param {Element} elem
|
344
346
|
*/
|
345
347
|
ZoomPlugin.prototype._updateElementLayout = function (elem) {
|
346
|
-
|
348
|
+
let domStyle = /** @type{CSSStyleDeclaration} */(elem.style);
|
347
349
|
if(this._zoomFactor !== 1) {
|
348
350
|
// After scaling there is empty space between elem and it's parent
|
349
351
|
// So it needs to correct the transformation shift of an inline-element
|
@@ -356,7 +358,7 @@ ZoomPlugin.prototype._updateElementLayout = function (elem) {
|
|
356
358
|
/** @private
|
357
359
|
*/
|
358
360
|
ZoomPlugin.prototype._updateZoomedLayout = function() {
|
359
|
-
|
361
|
+
let i, elem;
|
360
362
|
for(i = this._elems.length; --i >= 0;) {
|
361
363
|
elem = this._elems[i];
|
362
364
|
this._updateElementLayout(elem);
|
@@ -371,7 +373,7 @@ ZoomPlugin.prototype._updateZoomedLayout = function() {
|
|
371
373
|
* @param {Element} elem
|
372
374
|
*/
|
373
375
|
ZoomPlugin.prototype._clearZoomStyles = function (elem) {
|
374
|
-
|
376
|
+
let domStyle = /** @type{CSSStyleDeclaration} */(elem.style);
|
375
377
|
domStyle["transform"] = "";
|
376
378
|
domStyle["transformOrigin"] = "";
|
377
379
|
domStyle["marginRight"] = "";
|
@@ -382,11 +384,11 @@ ZoomPlugin.prototype._clearZoomStyles = function (elem) {
|
|
382
384
|
* @param {boolean=} bool
|
383
385
|
*/
|
384
386
|
ZoomPlugin.prototype.enableWheelToZoom = function (bool) {
|
385
|
-
|
387
|
+
let t = this;
|
386
388
|
bool = !!bool; // Force boolean
|
387
389
|
if (t._wheel !== bool) {
|
388
390
|
t._wheel = bool;
|
389
|
-
for (
|
391
|
+
for (let i = t._hosts.length; --i >= 0;) {
|
390
392
|
if (bool) {
|
391
393
|
t._hosts[i].listen("wheel", t._onWheel);
|
392
394
|
} else {
|
@@ -402,7 +404,7 @@ ZoomPlugin.prototype.enableWheelToZoom = function (bool) {
|
|
402
404
|
ZoomPlugin.prototype._onWheel = function (e) {
|
403
405
|
if (!e.ctrlKey || e.shiftKey || e.altKey) { return; } // Only handle Ctrl+wheel
|
404
406
|
|
405
|
-
|
407
|
+
let delta = e["deltaY"]; // Provided by WheelEvent >> https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent
|
406
408
|
if (!delta) { return; }
|
407
409
|
|
408
410
|
e.preventDefault(); // Disable browser default zoom behaviour
|
@@ -420,6 +422,16 @@ ZoomPlugin.prototype.getDefaultMouseWheelLogic = function () {
|
|
420
422
|
return this._onWheel;
|
421
423
|
};
|
422
424
|
|
425
|
+
/** @public
|
426
|
+
* @ignore
|
427
|
+
* @return {!Object}
|
428
|
+
*/
|
429
|
+
ZoomPlugin.prototype._getEventHandlers = function() {
|
430
|
+
return {
|
431
|
+
"wheel": this._onWheel
|
432
|
+
};
|
433
|
+
};
|
434
|
+
|
423
435
|
|
424
436
|
|
425
437
|
export default ZoomPlugin;
|
package/package.json
CHANGED