jqtree 1.6.1 → 1.6.2
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/.eslintrc +1 -0
- package/_config.yml +1 -1
- package/_entries/10_changelog.md +5 -0
- package/_layouts/base.html +0 -22
- package/babel.config.json +11 -0
- package/babel.coverage.config.json +4 -0
- package/bower.json +1 -1
- package/jest-browser.config.js +0 -3
- package/jest-jsdom.config.js +1 -2
- package/jqtree.css +4 -1
- package/jqtree.postcss +3 -0
- package/lib/dataLoader.js +146 -98
- package/lib/dragAndDropHandler.js +668 -472
- package/lib/elementsRenderer.js +282 -197
- package/lib/jqtreeOptions.js +1 -2
- package/lib/keyHandler.js +134 -87
- package/lib/mouse.widget.js +285 -186
- package/lib/node.js +691 -505
- package/lib/nodeElement.js +329 -207
- package/lib/playwright/playwright.test.js +216 -189
- package/lib/playwright/testUtil.js +429 -193
- package/lib/playwright/visualRegression.js +182 -117
- package/lib/saveStateHandler.js +311 -204
- package/lib/scrollHandler.js +293 -199
- package/lib/selectNodeHandler.js +140 -100
- package/lib/simple.widget.js +184 -109
- package/lib/test/global.d.js +3 -0
- package/lib/test/jqTree/create.test.js +44 -40
- package/lib/test/jqTree/events.test.js +185 -138
- package/lib/test/jqTree/keyboard.test.js +216 -199
- package/lib/test/jqTree/loadOnDemand.test.js +233 -157
- package/lib/test/jqTree/methods.test.js +1269 -1019
- package/lib/test/jqTree/options.test.js +467 -398
- package/lib/test/node.test.js +1036 -873
- package/lib/test/nodeUtil.test.js +21 -20
- package/lib/test/support/exampleData.js +35 -23
- package/lib/test/support/jqTreeMatchers.js +72 -54
- package/lib/test/support/matchers.d.js +1 -0
- package/lib/test/support/setupTests.js +9 -3
- package/lib/test/support/testUtil.js +35 -15
- package/lib/test/support/treeStructure.js +41 -32
- package/lib/test/util.test.js +21 -20
- package/lib/tree.jquery.d.js +1 -0
- package/lib/tree.jquery.js +1264 -892
- package/lib/types.js +1 -2
- package/lib/typings.d.js +2 -0
- package/lib/util.js +19 -8
- package/lib/version.js +8 -3
- package/package.json +42 -34
- package/production +4 -4
- package/rollup.config.js +16 -11
- package/src/dataLoader.ts +6 -6
- package/src/dragAndDropHandler.ts +0 -4
- package/src/elementsRenderer.ts +4 -0
- package/src/jqtreeOptions.ts +1 -1
- package/src/mouse.widget.ts +19 -15
- package/src/node.ts +27 -41
- package/src/nodeElement.ts +17 -9
- package/src/playwright/.eslintrc +5 -0
- package/src/playwright/playwright.test.ts +29 -29
- package/src/saveStateHandler.ts +11 -6
- package/src/selectNodeHandler.ts +1 -1
- package/src/simple.widget.ts +1 -1
- package/src/test/.eslintrc +4 -0
- package/src/test/jqTree/create.test.ts +0 -1
- package/src/test/jqTree/events.test.ts +0 -1
- package/src/test/jqTree/keyboard.test.ts +0 -1
- package/src/test/jqTree/loadOnDemand.test.ts +46 -1
- package/src/test/jqTree/methods.test.ts +35 -10
- package/src/test/jqTree/options.test.ts +4 -5
- package/src/test/node.test.ts +2 -2
- package/src/test/support/jqTreeMatchers.ts +8 -9
- package/src/test/support/matchers.d.ts +2 -4
- package/src/test/support/setupTests.ts +2 -1
- package/src/tree.jquery.d.ts +18 -12
- package/src/tree.jquery.ts +25 -21
- package/src/version.ts +1 -1
- package/static/example.postcss +13 -0
- package/static/example_data.js +33 -36
- package/tree.jquery.debug.js +4806 -3325
- package/tree.jquery.debug.js.map +1 -1
- package/tree.jquery.js +2 -2
- package/tree.jquery.js.map +1 -1
- package/tsconfig.json +1 -0
package/lib/mouse.widget.js
CHANGED
|
@@ -1,207 +1,306 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _simple = _interopRequireDefault(require("./simple.widget"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
|
+
|
|
16
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
17
|
+
|
|
18
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
+
|
|
20
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21
|
+
|
|
22
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23
|
+
|
|
24
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
25
|
+
|
|
26
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
27
|
+
|
|
28
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
29
|
+
|
|
30
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
|
+
|
|
32
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
|
+
|
|
34
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
+
|
|
36
|
+
var getPositionInfoFromMouseEvent = function getPositionInfoFromMouseEvent(e) {
|
|
37
|
+
return {
|
|
23
38
|
pageX: e.pageX,
|
|
24
39
|
pageY: e.pageY,
|
|
25
40
|
target: e.target,
|
|
26
41
|
originalEvent: e
|
|
27
|
-
}
|
|
28
|
-
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var getPositionInfoFromTouch = function getPositionInfoFromTouch(touch, e) {
|
|
46
|
+
return {
|
|
29
47
|
pageX: touch.pageX,
|
|
30
48
|
pageY: touch.pageY,
|
|
31
49
|
target: touch.target,
|
|
32
50
|
originalEvent: e
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
_this.mouseMove = function (e) {
|
|
49
|
-
_this.handleMouseMove(e, getPositionInfoFromMouseEvent(e));
|
|
50
|
-
};
|
|
51
|
-
_this.mouseUp = function (e) {
|
|
52
|
-
_this.handleMouseUp(getPositionInfoFromMouseEvent(e));
|
|
53
|
-
};
|
|
54
|
-
_this.touchStart = function (e) {
|
|
55
|
-
if (!e) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (e.touches.length > 1) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
var touch = e.changedTouches[0];
|
|
62
|
-
_this.handleMouseDown(getPositionInfoFromTouch(touch, e));
|
|
63
|
-
};
|
|
64
|
-
_this.touchMove = function (e) {
|
|
65
|
-
if (!e) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
if (e.touches.length > 1) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
var touch = e.changedTouches[0];
|
|
72
|
-
_this.handleMouseMove(e, getPositionInfoFromTouch(touch, e));
|
|
73
|
-
};
|
|
74
|
-
_this.touchEnd = function (e) {
|
|
75
|
-
if (!e) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (e.touches.length > 1) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
var touch = e.changedTouches[0];
|
|
82
|
-
_this.handleMouseUp(getPositionInfoFromTouch(touch, e));
|
|
83
|
-
};
|
|
84
|
-
return _this;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var MouseWidget = /*#__PURE__*/function (_SimpleWidget) {
|
|
55
|
+
_inherits(MouseWidget, _SimpleWidget);
|
|
56
|
+
|
|
57
|
+
var _super = _createSuper(MouseWidget);
|
|
58
|
+
|
|
59
|
+
function MouseWidget() {
|
|
60
|
+
var _this;
|
|
61
|
+
|
|
62
|
+
_classCallCheck(this, MouseWidget);
|
|
63
|
+
|
|
64
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
65
|
+
args[_key] = arguments[_key];
|
|
85
66
|
}
|
|
86
|
-
|
|
87
|
-
|
|
67
|
+
|
|
68
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
69
|
+
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "isMouseStarted", void 0);
|
|
71
|
+
|
|
72
|
+
_defineProperty(_assertThisInitialized(_this), "mouseDownInfo", void 0);
|
|
73
|
+
|
|
74
|
+
_defineProperty(_assertThisInitialized(_this), "mouseDelayTimer", void 0);
|
|
75
|
+
|
|
76
|
+
_defineProperty(_assertThisInitialized(_this), "isMouseDelayMet", void 0);
|
|
77
|
+
|
|
78
|
+
_defineProperty(_assertThisInitialized(_this), "mouseDown", function (e) {
|
|
79
|
+
// Left mouse button?
|
|
80
|
+
if (e.button !== 0) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
var result = _this.handleMouseDown(getPositionInfoFromMouseEvent(e));
|
|
85
|
+
|
|
86
|
+
if (result && e.cancelable) {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
_defineProperty(_assertThisInitialized(_this), "mouseMove", function (e) {
|
|
92
|
+
_this.handleMouseMove(e, getPositionInfoFromMouseEvent(e));
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "mouseUp", function (e) {
|
|
96
|
+
_this.handleMouseUp(getPositionInfoFromMouseEvent(e));
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
_defineProperty(_assertThisInitialized(_this), "touchStart", function (e) {
|
|
100
|
+
if (!e) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (e.touches.length > 1) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var touch = e.changedTouches[0];
|
|
109
|
+
|
|
110
|
+
_this.handleMouseDown(getPositionInfoFromTouch(touch, e));
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
_defineProperty(_assertThisInitialized(_this), "touchMove", function (e) {
|
|
114
|
+
if (!e) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (e.touches.length > 1) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var touch = e.changedTouches[0];
|
|
123
|
+
|
|
124
|
+
_this.handleMouseMove(e, getPositionInfoFromTouch(touch, e));
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
_defineProperty(_assertThisInitialized(_this), "touchEnd", function (e) {
|
|
128
|
+
if (!e) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (e.touches.length > 1) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
var touch = e.changedTouches[0];
|
|
137
|
+
|
|
138
|
+
_this.handleMouseUp(getPositionInfoFromTouch(touch, e));
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
return _this;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
_createClass(MouseWidget, [{
|
|
145
|
+
key: "init",
|
|
146
|
+
value: function init() {
|
|
147
|
+
var element = this.$el.get(0);
|
|
148
|
+
|
|
149
|
+
if (element) {
|
|
88
150
|
element.addEventListener("mousedown", this.mouseDown, {
|
|
89
|
-
|
|
151
|
+
passive: false
|
|
90
152
|
});
|
|
91
153
|
element.addEventListener("touchstart", this.touchStart, {
|
|
92
|
-
|
|
154
|
+
passive: false
|
|
93
155
|
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
this.isMouseStarted = false;
|
|
159
|
+
this.mouseDelayTimer = null;
|
|
160
|
+
this.isMouseDelayMet = false;
|
|
161
|
+
this.mouseDownInfo = null;
|
|
162
|
+
}
|
|
163
|
+
}, {
|
|
164
|
+
key: "deinit",
|
|
165
|
+
value: function deinit() {
|
|
166
|
+
var el = this.$el.get(0);
|
|
167
|
+
|
|
168
|
+
if (el) {
|
|
101
169
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
102
170
|
el.removeEventListener("mousedown", this.mouseDown, {
|
|
103
|
-
|
|
104
|
-
});
|
|
105
|
-
|
|
171
|
+
passive: false
|
|
172
|
+
}); // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
173
|
+
|
|
106
174
|
el.removeEventListener("touchstart", this.touchStart, {
|
|
107
|
-
|
|
108
|
-
});
|
|
109
|
-
this.removeMouseMoveEventListeners();
|
|
110
|
-
};
|
|
111
|
-
MouseWidget.prototype.handleMouseDown = function (positionInfo) {
|
|
112
|
-
// We may have missed mouseup (out of window)
|
|
113
|
-
if (this.isMouseStarted) {
|
|
114
|
-
this.handleMouseUp(positionInfo);
|
|
115
|
-
}
|
|
116
|
-
this.mouseDownInfo = positionInfo;
|
|
117
|
-
if (!this.mouseCapture(positionInfo)) {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
this.handleStartMouse();
|
|
121
|
-
return true;
|
|
122
|
-
};
|
|
123
|
-
MouseWidget.prototype.handleStartMouse = function () {
|
|
124
|
-
document.addEventListener("mousemove", this.mouseMove, {
|
|
125
|
-
passive: false
|
|
126
|
-
});
|
|
127
|
-
document.addEventListener("touchmove", this.touchMove, {
|
|
128
|
-
passive: false
|
|
175
|
+
passive: false
|
|
129
176
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
this.removeMouseMoveEventListeners();
|
|
180
|
+
}
|
|
181
|
+
}, {
|
|
182
|
+
key: "handleMouseDown",
|
|
183
|
+
value: function handleMouseDown(positionInfo) {
|
|
184
|
+
// We may have missed mouseup (out of window)
|
|
185
|
+
if (this.isMouseStarted) {
|
|
186
|
+
this.handleMouseUp(positionInfo);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
this.mouseDownInfo = positionInfo;
|
|
190
|
+
|
|
191
|
+
if (!this.mouseCapture(positionInfo)) {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
this.handleStartMouse();
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
}, {
|
|
199
|
+
key: "handleStartMouse",
|
|
200
|
+
value: function handleStartMouse() {
|
|
201
|
+
document.addEventListener("mousemove", this.mouseMove, {
|
|
202
|
+
passive: false
|
|
203
|
+
});
|
|
204
|
+
document.addEventListener("touchmove", this.touchMove, {
|
|
205
|
+
passive: false
|
|
206
|
+
});
|
|
207
|
+
document.addEventListener("mouseup", this.mouseUp, {
|
|
208
|
+
passive: false
|
|
209
|
+
});
|
|
210
|
+
document.addEventListener("touchend", this.touchEnd, {
|
|
211
|
+
passive: false
|
|
212
|
+
});
|
|
213
|
+
var mouseDelay = this.getMouseDelay();
|
|
214
|
+
|
|
215
|
+
if (mouseDelay) {
|
|
216
|
+
this.startMouseDelayTimer(mouseDelay);
|
|
217
|
+
} else {
|
|
218
|
+
this.isMouseDelayMet = true;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}, {
|
|
222
|
+
key: "startMouseDelayTimer",
|
|
223
|
+
value: function startMouseDelayTimer(mouseDelay) {
|
|
224
|
+
var _this2 = this;
|
|
225
|
+
|
|
226
|
+
if (this.mouseDelayTimer) {
|
|
227
|
+
clearTimeout(this.mouseDelayTimer);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
this.mouseDelayTimer = window.setTimeout(function () {
|
|
231
|
+
if (_this2.mouseDownInfo) {
|
|
232
|
+
_this2.isMouseDelayMet = true;
|
|
173
233
|
}
|
|
174
|
-
|
|
175
|
-
|
|
234
|
+
}, mouseDelay);
|
|
235
|
+
this.isMouseDelayMet = false;
|
|
236
|
+
}
|
|
237
|
+
}, {
|
|
238
|
+
key: "handleMouseMove",
|
|
239
|
+
value: function handleMouseMove(e, positionInfo) {
|
|
240
|
+
if (this.isMouseStarted) {
|
|
241
|
+
this.mouseDrag(positionInfo);
|
|
242
|
+
|
|
243
|
+
if (e.cancelable) {
|
|
244
|
+
e.preventDefault();
|
|
176
245
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
246
|
+
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (!this.isMouseDelayMet) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (this.mouseDownInfo) {
|
|
255
|
+
this.isMouseStarted = this.mouseStart(this.mouseDownInfo) !== false;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (this.isMouseStarted) {
|
|
259
|
+
this.mouseDrag(positionInfo);
|
|
260
|
+
|
|
261
|
+
if (e.cancelable) {
|
|
262
|
+
e.preventDefault();
|
|
185
263
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
264
|
+
} else {
|
|
265
|
+
this.handleMouseUp(positionInfo);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}, {
|
|
269
|
+
key: "handleMouseUp",
|
|
270
|
+
value: function handleMouseUp(positionInfo) {
|
|
271
|
+
this.removeMouseMoveEventListeners();
|
|
272
|
+
this.isMouseDelayMet = false;
|
|
273
|
+
this.mouseDownInfo = null;
|
|
274
|
+
|
|
275
|
+
if (this.isMouseStarted) {
|
|
276
|
+
this.isMouseStarted = false;
|
|
277
|
+
this.mouseStop(positionInfo);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}, {
|
|
281
|
+
key: "removeMouseMoveEventListeners",
|
|
282
|
+
value: function removeMouseMoveEventListeners() {
|
|
283
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
284
|
+
document.removeEventListener("mousemove", this.mouseMove, {
|
|
285
|
+
passive: false
|
|
286
|
+
}); // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
287
|
+
|
|
288
|
+
document.removeEventListener("touchmove", this.touchMove, {
|
|
289
|
+
passive: false
|
|
290
|
+
}); // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
291
|
+
|
|
292
|
+
document.removeEventListener("mouseup", this.mouseUp, {
|
|
293
|
+
passive: false
|
|
294
|
+
}); // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
295
|
+
|
|
296
|
+
document.removeEventListener("touchend", this.touchEnd, {
|
|
297
|
+
passive: false
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}]);
|
|
301
|
+
|
|
302
|
+
return MouseWidget;
|
|
303
|
+
}(_simple["default"]);
|
|
304
|
+
|
|
305
|
+
var _default = MouseWidget;
|
|
306
|
+
exports["default"] = _default;
|