@whitesev/pops 1.7.3 → 1.7.4
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/dist/index.amd.js +36 -1402
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +36 -1402
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +36 -1402
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +36 -1402
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +36 -1402
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +36 -1402
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +1 -1
- package/dist/types/src/utils/PopsUtils.d.ts +2 -1
- package/package.json +2 -1
- package/src/Pops.ts +1 -1
- package/src/components/panel/PanelHandleContentDetails.ts +1 -1
- package/src/css/index.css +8 -0
- package/src/utils/PopsInstanceUtils.ts +109 -119
- package/src/utils/PopsUtils.ts +5 -2
- package/dist/types/src/utils/AnyTouch.d.ts +0 -17
- package/src/utils/AnyTouch.js +0 -1394
package/dist/index.amd.js
CHANGED
|
@@ -34,1405 +34,37 @@ define((function () { 'use strict';
|
|
|
34
34
|
return PopsCoreEnv.self;
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
|
-
const OriginPrototype
|
|
37
|
+
const OriginPrototype = {
|
|
38
38
|
Object: {
|
|
39
39
|
defineProperty: Object.defineProperty,
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Object.setPrototypeOf ||
|
|
69
|
-
({ __proto__: [] } instanceof Array &&
|
|
70
|
-
function (d, b) {
|
|
71
|
-
d.__proto__ = b;
|
|
72
|
-
}) ||
|
|
73
|
-
function (d, b) {
|
|
74
|
-
for (var p in b) if (Object.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
75
|
-
};
|
|
76
|
-
return extendStatics(d, b);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
function __extends(d, b) {
|
|
80
|
-
if (typeof b !== "function" && b !== null)
|
|
81
|
-
throw new TypeError(
|
|
82
|
-
"Class extends value " + String(b) + " is not a constructor or null"
|
|
83
|
-
);
|
|
84
|
-
extendStatics(d, b);
|
|
85
|
-
function __() {
|
|
86
|
-
this.constructor = d;
|
|
87
|
-
}
|
|
88
|
-
d.prototype =
|
|
89
|
-
b === null
|
|
90
|
-
? Object.create(b)
|
|
91
|
-
: ((__.prototype = b.prototype), new __());
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
var __assign = function () {
|
|
95
|
-
__assign =
|
|
96
|
-
Object.assign ||
|
|
97
|
-
function __assign(t) {
|
|
98
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
99
|
-
s = arguments[i];
|
|
100
|
-
for (var p in s) if (Object.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
101
|
-
}
|
|
102
|
-
return t;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
return __assign.apply(this, arguments);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
function __values(o) {
|
|
109
|
-
var s = typeof Symbol === "function" && Symbol.iterator,
|
|
110
|
-
m = s && o[s],
|
|
111
|
-
i = 0;
|
|
112
|
-
if (m) return m.call(o);
|
|
113
|
-
if (o && typeof o.length === "number")
|
|
114
|
-
return {
|
|
115
|
-
next: function () {
|
|
116
|
-
if (o && i >= o.length) o = void 0;
|
|
117
|
-
return { value: o && o[i++], done: !o };
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
throw new TypeError(
|
|
121
|
-
s ? "Object is not iterable." : "Symbol.iterator is not defined."
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
var AnyEvent = (function () {
|
|
126
|
-
function AnyEvent() {
|
|
127
|
-
this.__map = {};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
AnyEvent.prototype.beforeEach = function (interceptor) {
|
|
131
|
-
this.__interceptor = interceptor;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
AnyEvent.prototype.on = function (typeOrTypes, listener) {
|
|
135
|
-
var e_1, _a;
|
|
136
|
-
var types = Array.isArray(typeOrTypes) ? typeOrTypes : [typeOrTypes];
|
|
137
|
-
try {
|
|
138
|
-
for (
|
|
139
|
-
var types_1 = __values(types), types_1_1 = types_1.next();
|
|
140
|
-
!types_1_1.done;
|
|
141
|
-
types_1_1 = types_1.next()
|
|
142
|
-
) {
|
|
143
|
-
var type = types_1_1.value;
|
|
144
|
-
|
|
145
|
-
this.__map[type] = this.__map[type] || [];
|
|
146
|
-
|
|
147
|
-
var listeners = this.__map[type];
|
|
148
|
-
if (listeners) {
|
|
149
|
-
listeners.push(listener);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
} catch (e_1_1) {
|
|
153
|
-
e_1 = { error: e_1_1 };
|
|
154
|
-
} finally {
|
|
155
|
-
try {
|
|
156
|
-
if (types_1_1 && !types_1_1.done && (_a = types_1.return))
|
|
157
|
-
_a.call(types_1);
|
|
158
|
-
} finally {
|
|
159
|
-
if (e_1) throw e_1.error;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return this;
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
AnyEvent.prototype.emit = function (type, payload, callback) {
|
|
166
|
-
var _this = this;
|
|
167
|
-
if (void 0 !== this.__interceptor) {
|
|
168
|
-
this.__interceptor(type, function () {
|
|
169
|
-
_this.__emit(type, payload);
|
|
170
|
-
callback && callback();
|
|
171
|
-
});
|
|
172
|
-
} else {
|
|
173
|
-
this.__emit(type, payload);
|
|
174
|
-
callback && callback();
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
AnyEvent.prototype.__emit = function (type, event) {
|
|
179
|
-
var e_2, _a;
|
|
180
|
-
|
|
181
|
-
var listeners = this.__map[type];
|
|
182
|
-
if (
|
|
183
|
-
Array.isArray(listeners) &&
|
|
184
|
-
(listeners === null || listeners === void 0
|
|
185
|
-
? void 0
|
|
186
|
-
: listeners.length)
|
|
187
|
-
) {
|
|
188
|
-
try {
|
|
189
|
-
for (
|
|
190
|
-
var listeners_1 = __values(listeners),
|
|
191
|
-
listeners_1_1 = listeners_1.next();
|
|
192
|
-
!listeners_1_1.done;
|
|
193
|
-
listeners_1_1 = listeners_1.next()
|
|
194
|
-
) {
|
|
195
|
-
var listener = listeners_1_1.value;
|
|
196
|
-
listener(event, type);
|
|
197
|
-
}
|
|
198
|
-
} catch (e_2_1) {
|
|
199
|
-
e_2 = { error: e_2_1 };
|
|
200
|
-
} finally {
|
|
201
|
-
try {
|
|
202
|
-
if (
|
|
203
|
-
listeners_1_1 &&
|
|
204
|
-
!listeners_1_1.done &&
|
|
205
|
-
(_a = listeners_1.return)
|
|
206
|
-
)
|
|
207
|
-
_a.call(listeners_1);
|
|
208
|
-
} finally {
|
|
209
|
-
if (e_2) throw e_2.error;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
this.event = event;
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
AnyEvent.prototype.off = function (type, listener) {
|
|
217
|
-
var listeners = this.__map[type];
|
|
218
|
-
if (void 0 !== listeners) {
|
|
219
|
-
if (void 0 === listener) {
|
|
220
|
-
delete this.__map[type];
|
|
221
|
-
} else {
|
|
222
|
-
var index = listeners.findIndex(function (cb) {
|
|
223
|
-
return cb === listener;
|
|
224
|
-
});
|
|
225
|
-
listeners.splice(index, 1);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
AnyEvent.prototype.destroy = function () {
|
|
230
|
-
this.__map = {};
|
|
231
|
-
};
|
|
232
|
-
return AnyEvent;
|
|
233
|
-
})();
|
|
234
|
-
|
|
235
|
-
var TOUCH_START = "touchstart";
|
|
236
|
-
var TOUCH_MOVE = "touchmove";
|
|
237
|
-
var TOUCH_END = "touchend";
|
|
238
|
-
var TOUCH_CANCEL = "touchcancel";
|
|
239
|
-
var MOUSE_UP = "mouseup";
|
|
240
|
-
var MOUSE_MOVE = "mousemove";
|
|
241
|
-
var MOUSE_DOWN = "mousedown";
|
|
242
|
-
var TYPE_START$1 = "start";
|
|
243
|
-
var TYPE_MOVE$1 = "move";
|
|
244
|
-
var TYPE_END$1 = "end";
|
|
245
|
-
|
|
246
|
-
function isFunction(input) {
|
|
247
|
-
return "[object Function]" === Object.prototype.toString.call(input);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
var CLIENT_X = "clientX";
|
|
251
|
-
var CLIENT_Y = "clientY";
|
|
252
|
-
var COMPUTE_INTERVAL = 16;
|
|
253
|
-
var TYPE_START = "start";
|
|
254
|
-
var TYPE_MOVE = "move";
|
|
255
|
-
var TYPE_CANCEL = "cancel";
|
|
256
|
-
var TYPE_END = "end";
|
|
257
|
-
var DIRECTION_LEFT = "left";
|
|
258
|
-
var DIRECTION_RIGHT = "right";
|
|
259
|
-
var DIRECTION_UP = "up";
|
|
260
|
-
var DIRECTION_DOWN = "down";
|
|
261
|
-
|
|
262
|
-
var _a;
|
|
263
|
-
var STATUS_CODE_AND_NAME_MAP =
|
|
264
|
-
((_a = {}),
|
|
265
|
-
(_a[4] = TYPE_START),
|
|
266
|
-
(_a[5] = TYPE_MOVE),
|
|
267
|
-
(_a[1] = TYPE_END),
|
|
268
|
-
(_a[3] = TYPE_CANCEL),
|
|
269
|
-
_a);
|
|
270
|
-
|
|
271
|
-
function getStatusName(code) {
|
|
272
|
-
return STATUS_CODE_AND_NAME_MAP[code];
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
function flow(isVaild, lastStatus, phase) {
|
|
276
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
277
|
-
var STATE_MAP = {
|
|
278
|
-
1:
|
|
279
|
-
((_a = {}),
|
|
280
|
-
(_a[0] = ((_b = {}), (_b[TYPE_MOVE] = 4), _b)),
|
|
281
|
-
(_a[4] =
|
|
282
|
-
((_c = {}),
|
|
283
|
-
(_c[TYPE_MOVE] = 5),
|
|
284
|
-
(_c[TYPE_END] = 1),
|
|
285
|
-
(_c[TYPE_CANCEL] = 3),
|
|
286
|
-
_c)),
|
|
287
|
-
(_a[5] =
|
|
288
|
-
((_d = {}),
|
|
289
|
-
(_d[TYPE_MOVE] = 5),
|
|
290
|
-
(_d[TYPE_END] = 1),
|
|
291
|
-
(_d[TYPE_CANCEL] = 3),
|
|
292
|
-
_d)),
|
|
293
|
-
_a),
|
|
294
|
-
0:
|
|
295
|
-
((_e = {}),
|
|
296
|
-
(_e[4] =
|
|
297
|
-
((_f = {}),
|
|
298
|
-
(_f[TYPE_MOVE] = 2),
|
|
299
|
-
(_f[TYPE_END] = 1),
|
|
300
|
-
(_f[TYPE_CANCEL] = 3),
|
|
301
|
-
_f)),
|
|
302
|
-
(_e[5] =
|
|
303
|
-
((_g = {}),
|
|
304
|
-
(_g[TYPE_START] = 2),
|
|
305
|
-
(_g[TYPE_MOVE] = 2),
|
|
306
|
-
(_g[TYPE_END] = 1),
|
|
307
|
-
(_g[TYPE_CANCEL] = 3),
|
|
308
|
-
_g)),
|
|
309
|
-
_e),
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
var map = STATE_MAP[Number(isVaild)][lastStatus];
|
|
313
|
-
return (void 0 !== map && map[phase]) || 0;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
function resetState(context) {
|
|
317
|
-
if ([1, 3, 2].includes(context.state)) {
|
|
318
|
-
context.state = 0;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
function isMoveOrEndOrCancel(state) {
|
|
323
|
-
return [5, 1, 3].includes(state);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
function isDisabled(context) {
|
|
327
|
-
if (context.disabled) {
|
|
328
|
-
context.state = 0;
|
|
329
|
-
return true;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
function createPluginContext(defaultOptions, options) {
|
|
334
|
-
return __assign(__assign(__assign({}, defaultOptions), options), {
|
|
335
|
-
state: 0,
|
|
336
|
-
disabled: false,
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function round2(n) {
|
|
341
|
-
return Math.round(n * 100) / 100;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
function inputCreator() {
|
|
345
|
-
var id = 0;
|
|
346
|
-
var prevInput;
|
|
347
|
-
|
|
348
|
-
var activeInput;
|
|
349
|
-
|
|
350
|
-
var startInput;
|
|
351
|
-
|
|
352
|
-
var startMultiInput;
|
|
353
|
-
|
|
354
|
-
return function (basicsInput) {
|
|
355
|
-
prevInput = activeInput;
|
|
356
|
-
if (void 0 !== basicsInput) {
|
|
357
|
-
id = Number.MAX_SAFE_INTEGER > id ? ++id : 1;
|
|
358
|
-
var pureInput = extendInput(basicsInput, id);
|
|
359
|
-
activeInput = pureInput;
|
|
360
|
-
var isStart = pureInput.isStart,
|
|
361
|
-
pointLength = pureInput.pointLength;
|
|
362
|
-
if (isStart) {
|
|
363
|
-
startInput = pureInput;
|
|
364
|
-
prevInput = void 0;
|
|
365
|
-
if (1 < pointLength) {
|
|
366
|
-
startMultiInput = pureInput;
|
|
367
|
-
} else {
|
|
368
|
-
startMultiInput = void 0;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
return __assign(__assign({}, pureInput), {
|
|
372
|
-
prevInput: prevInput,
|
|
373
|
-
|
|
374
|
-
startMultiInput: startMultiInput,
|
|
375
|
-
|
|
376
|
-
startInput: startInput,
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
function getCenter(points) {
|
|
383
|
-
var length = points.length;
|
|
384
|
-
if (0 < length) {
|
|
385
|
-
if (1 === length) {
|
|
386
|
-
var _a = points[0],
|
|
387
|
-
clientX = _a.clientX,
|
|
388
|
-
clientY = _a.clientY;
|
|
389
|
-
return { x: Math.round(clientX), y: Math.round(clientY) };
|
|
390
|
-
}
|
|
391
|
-
var countPoint = points.reduce(
|
|
392
|
-
function (countPoint, point) {
|
|
393
|
-
countPoint.x += point[CLIENT_X];
|
|
394
|
-
countPoint.y += point[CLIENT_Y];
|
|
395
|
-
return countPoint;
|
|
396
|
-
},
|
|
397
|
-
{ x: 0, y: 0 }
|
|
398
|
-
);
|
|
399
|
-
return {
|
|
400
|
-
x: Math.round(countPoint.x / length),
|
|
401
|
-
y: Math.round(countPoint.y / length),
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
function extendInput(basicsInput, id) {
|
|
407
|
-
var phase = basicsInput.phase,
|
|
408
|
-
points = basicsInput.points,
|
|
409
|
-
changedPoints = basicsInput.changedPoints,
|
|
410
|
-
nativeEvent = basicsInput.nativeEvent;
|
|
411
|
-
var pointLength = points.length;
|
|
412
|
-
var isStart = TYPE_START === phase;
|
|
413
|
-
var isEnd =
|
|
414
|
-
(TYPE_END === phase && 0 === pointLength) || TYPE_CANCEL === phase;
|
|
415
|
-
var timestamp = Date.now();
|
|
416
|
-
var _a = getCenter(points) || getCenter(changedPoints),
|
|
417
|
-
x = _a.x,
|
|
418
|
-
y = _a.y;
|
|
419
|
-
var currentTarget = nativeEvent.currentTarget;
|
|
420
|
-
return Object.assign(basicsInput, {
|
|
421
|
-
id: id,
|
|
422
|
-
x: x,
|
|
423
|
-
y: y,
|
|
424
|
-
timestamp: timestamp,
|
|
425
|
-
isStart: isStart,
|
|
426
|
-
isEnd: isEnd,
|
|
427
|
-
pointLength: pointLength,
|
|
428
|
-
currentTarget: currentTarget,
|
|
429
|
-
|
|
430
|
-
getOffset: function (el) {
|
|
431
|
-
if (el === void 0) {
|
|
432
|
-
el = currentTarget;
|
|
433
|
-
}
|
|
434
|
-
var rect = el.getBoundingClientRect();
|
|
435
|
-
return {
|
|
436
|
-
x: x - Math.round(rect.left),
|
|
437
|
-
y: y - Math.round(rect.top),
|
|
438
|
-
};
|
|
439
|
-
},
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
function mouse() {
|
|
444
|
-
var prevPoints;
|
|
445
|
-
var isPressed = false;
|
|
446
|
-
|
|
447
|
-
var _target = null;
|
|
448
|
-
var createInput = inputCreator();
|
|
449
|
-
|
|
450
|
-
return function (event) {
|
|
451
|
-
var clientX = event.clientX,
|
|
452
|
-
clientY = event.clientY,
|
|
453
|
-
type = event.type,
|
|
454
|
-
button = event.button,
|
|
455
|
-
target = event.target;
|
|
456
|
-
var points = [{ clientX: clientX, clientY: clientY, target: target }];
|
|
457
|
-
var phase;
|
|
458
|
-
if (MOUSE_DOWN === type && 0 === button) {
|
|
459
|
-
_target = target;
|
|
460
|
-
isPressed = true;
|
|
461
|
-
phase = TYPE_START$1;
|
|
462
|
-
} else if (isPressed) {
|
|
463
|
-
if (MOUSE_MOVE === type) {
|
|
464
|
-
phase = TYPE_MOVE$1;
|
|
465
|
-
} else if (MOUSE_UP === type) {
|
|
466
|
-
points = [];
|
|
467
|
-
phase = TYPE_END$1;
|
|
468
|
-
isPressed = false;
|
|
469
|
-
}
|
|
470
|
-
} else {
|
|
471
|
-
return;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
var changedPoints = prevPoints || [
|
|
475
|
-
{ clientX: clientX, clientY: clientY, target: target },
|
|
476
|
-
];
|
|
477
|
-
prevPoints = [{ clientX: clientX, clientY: clientY, target: target }];
|
|
478
|
-
if (void 0 !== phase) {
|
|
479
|
-
return createInput({
|
|
480
|
-
phase: phase,
|
|
481
|
-
changedPoints: changedPoints,
|
|
482
|
-
points: points,
|
|
483
|
-
|
|
484
|
-
target: _target,
|
|
485
|
-
|
|
486
|
-
targets: [_target],
|
|
487
|
-
nativeEvent: event,
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
function touch(el) {
|
|
494
|
-
var createInput = inputCreator();
|
|
495
|
-
|
|
496
|
-
return function (event) {
|
|
497
|
-
var targets = [];
|
|
498
|
-
|
|
499
|
-
var points = [];
|
|
500
|
-
Array.from(event.touches).forEach(function (_a) {
|
|
501
|
-
var clientX = _a.clientX,
|
|
502
|
-
clientY = _a.clientY,
|
|
503
|
-
target = _a.target;
|
|
504
|
-
if (el === null || el === void 0 ? void 0 : el.contains(target)) {
|
|
505
|
-
targets.push(target);
|
|
506
|
-
points.push({
|
|
507
|
-
clientX: clientX,
|
|
508
|
-
clientY: clientY,
|
|
509
|
-
target: target,
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
var changedPoints = Array.from(event.changedTouches).map(function (_a) {
|
|
514
|
-
var clientX = _a.clientX,
|
|
515
|
-
clientY = _a.clientY,
|
|
516
|
-
target = _a.target;
|
|
517
|
-
return { clientX: clientX, clientY: clientY, target: target };
|
|
518
|
-
});
|
|
519
|
-
return createInput({
|
|
520
|
-
phase: event.type.replace("touch", ""),
|
|
521
|
-
changedPoints: changedPoints,
|
|
522
|
-
|
|
523
|
-
points: points,
|
|
524
|
-
nativeEvent: event,
|
|
525
|
-
target: event.target,
|
|
526
|
-
|
|
527
|
-
targets: targets,
|
|
528
|
-
});
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
function dispatchDomEvent(typeName, el, payload, eventInit) {
|
|
533
|
-
var data = {};
|
|
534
|
-
for (var key in payload) {
|
|
535
|
-
if (!["target", "currentTarget", "type"].includes(key)) {
|
|
536
|
-
data[key] = payload[key];
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
var event;
|
|
541
|
-
if (document.createEvent) {
|
|
542
|
-
event = document.createEvent("HTMLEvents");
|
|
543
|
-
event.initEvent(
|
|
544
|
-
typeName,
|
|
545
|
-
eventInit === null || eventInit === void 0
|
|
546
|
-
? void 0
|
|
547
|
-
: eventInit.bubbles,
|
|
548
|
-
eventInit === null || eventInit === void 0
|
|
549
|
-
? void 0
|
|
550
|
-
: eventInit.cancelable
|
|
551
|
-
);
|
|
552
|
-
} else {
|
|
553
|
-
event = new Event(typeName, eventInit);
|
|
554
|
-
}
|
|
555
|
-
Object.assign(event, data, {
|
|
556
|
-
match: function () {
|
|
557
|
-
return (
|
|
558
|
-
payload.targets &&
|
|
559
|
-
0 < payload.targets.length &&
|
|
560
|
-
payload.targets.every(function (target) {
|
|
561
|
-
return event.currentTarget.contains(target);
|
|
562
|
-
})
|
|
563
|
-
);
|
|
564
|
-
},
|
|
565
|
-
});
|
|
566
|
-
return el.dispatchEvent(event);
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
function canPreventDefault(event, options) {
|
|
570
|
-
var preventDefault = options.preventDefault;
|
|
571
|
-
if (isFunction(preventDefault)) {
|
|
572
|
-
return preventDefault(event);
|
|
573
|
-
} else {
|
|
574
|
-
return !!preventDefault;
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
var ELEMENT_TYPES = [
|
|
579
|
-
TOUCH_START,
|
|
580
|
-
TOUCH_MOVE,
|
|
581
|
-
TOUCH_END,
|
|
582
|
-
TOUCH_CANCEL,
|
|
583
|
-
MOUSE_DOWN,
|
|
584
|
-
];
|
|
585
|
-
var WINDOW_TYPES = [MOUSE_MOVE, MOUSE_UP];
|
|
586
|
-
|
|
587
|
-
function bindElement(el, catchEvent, options) {
|
|
588
|
-
ELEMENT_TYPES.forEach(function (type) {
|
|
589
|
-
el.addEventListener(type, catchEvent, options);
|
|
590
|
-
});
|
|
591
|
-
WINDOW_TYPES.forEach(function (type) {
|
|
592
|
-
window.addEventListener(type, catchEvent, options);
|
|
593
|
-
});
|
|
594
|
-
return function () {
|
|
595
|
-
ELEMENT_TYPES.forEach(function (types) {
|
|
596
|
-
el.removeEventListener(types, catchEvent);
|
|
597
|
-
});
|
|
598
|
-
WINDOW_TYPES.forEach(function (type) {
|
|
599
|
-
window.removeEventListener(type, catchEvent);
|
|
600
|
-
});
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
var TYPE_COMPUTED = "computed";
|
|
605
|
-
var DEFAULT_OPTIONS$6 = {
|
|
606
|
-
domEvents: { bubbles: true, cancelable: true },
|
|
607
|
-
|
|
608
|
-
preventDefault: function (event) {
|
|
609
|
-
if (event.target && "tagName" in event.target) {
|
|
610
|
-
var tagName = event.target.tagName;
|
|
611
|
-
return !/^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(tagName);
|
|
612
|
-
}
|
|
613
|
-
return false;
|
|
614
|
-
},
|
|
615
|
-
};
|
|
616
|
-
var TYPE_UNBIND = "u";
|
|
617
|
-
var TYPE_INPUT = "input";
|
|
618
|
-
var TYPE_AT_AFTER = "at:after";
|
|
619
|
-
var default_1$1 = (function (_super) {
|
|
620
|
-
__extends(default_1, _super);
|
|
621
|
-
|
|
622
|
-
function default_1(el, options) {
|
|
623
|
-
var _a;
|
|
624
|
-
|
|
625
|
-
var _this = _super.call(this) || this;
|
|
626
|
-
|
|
627
|
-
_this.v = "2.1.3";
|
|
628
|
-
|
|
629
|
-
_this.__computeFunctionList = [];
|
|
630
|
-
|
|
631
|
-
_this.__computeFunctionCreatorList = [];
|
|
632
|
-
|
|
633
|
-
_this.__pluginContexts = [];
|
|
634
|
-
_this.__isIgnoreMouse = false;
|
|
635
|
-
|
|
636
|
-
_this.el = el;
|
|
637
|
-
_this.c = {};
|
|
638
|
-
_this.__options = __assign(__assign({}, DEFAULT_OPTIONS$6), options);
|
|
639
|
-
|
|
640
|
-
var createInputFromTouch = touch(_this.el);
|
|
641
|
-
var createInputFromMouse = mouse();
|
|
642
|
-
|
|
643
|
-
_this.__inputCreatorMap =
|
|
644
|
-
((_a = {}),
|
|
645
|
-
(_a[TOUCH_START] = createInputFromTouch),
|
|
646
|
-
(_a[TOUCH_MOVE] = createInputFromTouch),
|
|
647
|
-
(_a[TOUCH_END] = createInputFromTouch),
|
|
648
|
-
(_a[TOUCH_CANCEL] = createInputFromTouch),
|
|
649
|
-
(_a[MOUSE_DOWN] = createInputFromMouse),
|
|
650
|
-
(_a[MOUSE_MOVE] = createInputFromMouse),
|
|
651
|
-
(_a[MOUSE_UP] = createInputFromMouse),
|
|
652
|
-
_a);
|
|
653
|
-
|
|
654
|
-
_this.on(TYPE_AT_AFTER, function (payload) {
|
|
655
|
-
var target = payload.target,
|
|
656
|
-
__type = payload.__type;
|
|
657
|
-
var domEvents = _this.__options.domEvents;
|
|
658
|
-
|
|
659
|
-
if (!!domEvents && void 0 !== _this.el && !!target) {
|
|
660
|
-
dispatchDomEvent(__type, target, payload, domEvents);
|
|
661
|
-
dispatchDomEvent(TYPE_AT_AFTER, target, payload, domEvents);
|
|
662
|
-
}
|
|
663
|
-
});
|
|
664
|
-
if (void 0 !== el) {
|
|
665
|
-
el.style.webkitTapHighlightColor = "rgba(0,0,0,0)";
|
|
666
|
-
var supportsPassive_1 = false;
|
|
667
|
-
try {
|
|
668
|
-
var opts = {};
|
|
669
|
-
OriginPrototype.Object.defineProperty(opts, "passive", {
|
|
670
|
-
get: function () {
|
|
671
|
-
supportsPassive_1 = true;
|
|
672
|
-
},
|
|
673
|
-
});
|
|
674
|
-
window.addEventListener(
|
|
675
|
-
"_",
|
|
676
|
-
function () {
|
|
677
|
-
return void 0;
|
|
678
|
-
},
|
|
679
|
-
opts
|
|
680
|
-
);
|
|
681
|
-
} catch (_b) {}
|
|
682
|
-
|
|
683
|
-
_this.on(
|
|
684
|
-
TYPE_UNBIND,
|
|
685
|
-
bindElement(
|
|
686
|
-
el,
|
|
687
|
-
_this.catchEvent.bind(_this),
|
|
688
|
-
false === _this.__options.preventDefault && supportsPassive_1
|
|
689
|
-
? { passive: true }
|
|
690
|
-
: { passive: false }
|
|
691
|
-
)
|
|
692
|
-
);
|
|
693
|
-
}
|
|
694
|
-
return _this;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
default_1.prototype.use = function (plugin, pluginOptions) {
|
|
698
|
-
this.__pluginContexts.push(plugin(this, pluginOptions));
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
default_1.prototype.catchEvent = function (event) {
|
|
702
|
-
var input = this.__inputCreatorMap[event.type](event);
|
|
703
|
-
if (void 0 !== input) {
|
|
704
|
-
var stopPropagation = function () {
|
|
705
|
-
return event.stopPropagation();
|
|
706
|
-
};
|
|
707
|
-
var stopImmediatePropagation = function () {
|
|
708
|
-
return event.stopImmediatePropagation();
|
|
709
|
-
};
|
|
710
|
-
var preventDefault = function () {
|
|
711
|
-
return event.preventDefault();
|
|
712
|
-
};
|
|
713
|
-
if (canPreventDefault(event, this.__options)) {
|
|
714
|
-
preventDefault();
|
|
715
|
-
} else {
|
|
716
|
-
if ("touchstart" === event.type) {
|
|
717
|
-
this.__isIgnoreMouse = true;
|
|
718
|
-
} else if ("touchmove" === event.type) {
|
|
719
|
-
this.__isIgnoreMouse = false;
|
|
720
|
-
}
|
|
721
|
-
if (this.__isIgnoreMouse && event.type.startsWith("mouse")) {
|
|
722
|
-
if ("mouseup" === event.type) {
|
|
723
|
-
this.__isIgnoreMouse = false;
|
|
724
|
-
}
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
this.emit(TYPE_INPUT, input);
|
|
730
|
-
this.emit2("at:".concat(input.phase), input, {});
|
|
731
|
-
var computed_1 = {};
|
|
732
|
-
|
|
733
|
-
this.__computeFunctionList.forEach(function (compute) {
|
|
734
|
-
var result = compute(input, computed_1);
|
|
735
|
-
if (void 0 !== result) {
|
|
736
|
-
for (var key in result) {
|
|
737
|
-
computed_1[key] = result[key];
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
});
|
|
741
|
-
|
|
742
|
-
this.emit(
|
|
743
|
-
TYPE_COMPUTED,
|
|
744
|
-
__assign(__assign(__assign({}, input), computed_1), {
|
|
745
|
-
stopPropagation: stopPropagation,
|
|
746
|
-
stopImmediatePropagation: stopImmediatePropagation,
|
|
747
|
-
preventDefault: preventDefault,
|
|
748
|
-
})
|
|
749
|
-
);
|
|
750
|
-
}
|
|
751
|
-
};
|
|
752
|
-
default_1.prototype.compute = function (
|
|
753
|
-
computeFunctionCreatorList,
|
|
754
|
-
|
|
755
|
-
callback
|
|
756
|
-
) {
|
|
757
|
-
var e_1, _a;
|
|
758
|
-
try {
|
|
759
|
-
for (
|
|
760
|
-
var computeFunctionCreatorList_1 = __values(
|
|
761
|
-
computeFunctionCreatorList
|
|
762
|
-
),
|
|
763
|
-
computeFunctionCreatorList_1_1 =
|
|
764
|
-
computeFunctionCreatorList_1.next();
|
|
765
|
-
!computeFunctionCreatorList_1_1.done;
|
|
766
|
-
computeFunctionCreatorList_1_1 = computeFunctionCreatorList_1.next()
|
|
767
|
-
) {
|
|
768
|
-
var computeFunctionCreator = computeFunctionCreatorList_1_1.value;
|
|
769
|
-
if (
|
|
770
|
-
!this.__computeFunctionCreatorList.includes(
|
|
771
|
-
computeFunctionCreator
|
|
772
|
-
)
|
|
773
|
-
) {
|
|
774
|
-
this.__computeFunctionCreatorList.push(computeFunctionCreator);
|
|
775
|
-
|
|
776
|
-
this.__computeFunctionList.push(computeFunctionCreator());
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
} catch (e_1_1) {
|
|
780
|
-
e_1 = { error: e_1_1 };
|
|
781
|
-
} finally {
|
|
782
|
-
try {
|
|
783
|
-
if (
|
|
784
|
-
computeFunctionCreatorList_1_1 &&
|
|
785
|
-
!computeFunctionCreatorList_1_1.done &&
|
|
786
|
-
(_a = computeFunctionCreatorList_1.return)
|
|
787
|
-
)
|
|
788
|
-
_a.call(computeFunctionCreatorList_1);
|
|
789
|
-
} finally {
|
|
790
|
-
if (e_1) throw e_1.error;
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
this.on(TYPE_COMPUTED, callback);
|
|
795
|
-
};
|
|
796
|
-
|
|
797
|
-
default_1.prototype.beforeEach = function (interceptor) {
|
|
798
|
-
var _this = this;
|
|
799
|
-
|
|
800
|
-
_super.prototype.beforeEach.call(this, function (type, next) {
|
|
801
|
-
var _a;
|
|
802
|
-
if ((_a = _this.c) === null || _a === void 0 ? void 0 : _a.name) {
|
|
803
|
-
interceptor(type, next);
|
|
804
|
-
} else {
|
|
805
|
-
next();
|
|
806
|
-
}
|
|
807
|
-
});
|
|
808
|
-
};
|
|
809
|
-
|
|
810
|
-
default_1.prototype.get = function (name) {
|
|
811
|
-
return this.__pluginContexts.find(function (pluginContext) {
|
|
812
|
-
return name === pluginContext.name;
|
|
813
|
-
});
|
|
814
|
-
};
|
|
815
|
-
|
|
816
|
-
default_1.prototype.set = function (newOptions) {
|
|
817
|
-
this.__options = __assign(__assign({}, this.__options), newOptions);
|
|
818
|
-
};
|
|
819
|
-
|
|
820
|
-
default_1.prototype.emit2 = function (type, payload, pluginContext) {
|
|
821
|
-
var _this = this;
|
|
822
|
-
this.c = pluginContext;
|
|
823
|
-
|
|
824
|
-
this.emit(
|
|
825
|
-
type,
|
|
826
|
-
__assign(__assign({}, payload), { type: type }),
|
|
827
|
-
function () {
|
|
828
|
-
_this.emit(
|
|
829
|
-
TYPE_AT_AFTER,
|
|
830
|
-
__assign(__assign({}, payload), { name: type, __type: type })
|
|
831
|
-
);
|
|
832
|
-
}
|
|
833
|
-
);
|
|
834
|
-
};
|
|
835
|
-
default_1.prototype.destroy = function () {
|
|
836
|
-
this.emit(TYPE_UNBIND);
|
|
837
|
-
_super.prototype.destroy.call(this);
|
|
838
|
-
};
|
|
839
|
-
return default_1;
|
|
840
|
-
})(AnyEvent);
|
|
841
|
-
|
|
842
|
-
var getVLength = function (v) {
|
|
843
|
-
return Math.sqrt(v.x * v.x + v.y * v.y);
|
|
844
|
-
};
|
|
845
|
-
|
|
846
|
-
var getDotProduct = function (v1, v2) {
|
|
847
|
-
return v1.x * v2.x + v1.y * v2.y;
|
|
848
|
-
};
|
|
849
|
-
|
|
850
|
-
var getRadian = function (v1, v2) {
|
|
851
|
-
var mr = getVLength(v1) * getVLength(v2);
|
|
852
|
-
if (mr === 0) return 0;
|
|
853
|
-
var r = getDotProduct(v1, v2) / mr;
|
|
854
|
-
if (r > 1) r = 1;
|
|
855
|
-
return Math.acos(r);
|
|
856
|
-
};
|
|
857
|
-
|
|
858
|
-
var getCross = function (v1, v2) {
|
|
859
|
-
return v1.x * v2.y - v2.x * v1.y;
|
|
860
|
-
};
|
|
861
|
-
|
|
862
|
-
var radianToAngle = function (radian) {
|
|
863
|
-
return (radian / Math.PI) * 180;
|
|
864
|
-
};
|
|
865
|
-
|
|
866
|
-
var getAngle = function (v1, v2) {
|
|
867
|
-
var angle = getRadian(v1, v2);
|
|
868
|
-
if (getCross(v1, v2) > 0) {
|
|
869
|
-
angle *= -1;
|
|
870
|
-
}
|
|
871
|
-
return radianToAngle(angle);
|
|
872
|
-
};
|
|
873
|
-
|
|
874
|
-
var getDirection = function (x, y) {
|
|
875
|
-
if (0 === x && 0 === y) {
|
|
876
|
-
return;
|
|
877
|
-
}
|
|
878
|
-
if (Math.abs(x) >= Math.abs(y)) {
|
|
879
|
-
return 0 < x ? DIRECTION_RIGHT : DIRECTION_LEFT;
|
|
880
|
-
} else {
|
|
881
|
-
return 0 < y ? DIRECTION_DOWN : DIRECTION_UP;
|
|
882
|
-
}
|
|
883
|
-
};
|
|
884
|
-
|
|
885
|
-
function ComputeAngle() {
|
|
886
|
-
var angle = 0;
|
|
887
|
-
var deltaAngle = 0;
|
|
888
|
-
|
|
889
|
-
return function (input, computed) {
|
|
890
|
-
var prevVecotr = computed.prevVecotr,
|
|
891
|
-
startVecotr = computed.startVecotr,
|
|
892
|
-
activeVecotr = computed.activeVecotr;
|
|
893
|
-
if (activeVecotr) {
|
|
894
|
-
deltaAngle = Math.round(getAngle(activeVecotr, prevVecotr));
|
|
895
|
-
angle = Math.round(getAngle(activeVecotr, startVecotr));
|
|
896
|
-
}
|
|
897
|
-
return { angle: angle, deltaAngle: deltaAngle };
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
function ComputeDeltaXY() {
|
|
902
|
-
return function (input) {
|
|
903
|
-
var prevInput = input.prevInput;
|
|
904
|
-
var deltaX = 0;
|
|
905
|
-
var deltaY = 0;
|
|
906
|
-
var deltaXYAngle = 0;
|
|
907
|
-
if (void 0 !== prevInput) {
|
|
908
|
-
deltaX = input.x - prevInput.x;
|
|
909
|
-
deltaY = input.y - prevInput.y;
|
|
910
|
-
if (0 !== deltaX || 0 !== deltaY) {
|
|
911
|
-
var deltaXY = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));
|
|
912
|
-
deltaXYAngle = Math.round(
|
|
913
|
-
radianToAngle(Math.acos(Math.abs(deltaX) / deltaXY))
|
|
914
|
-
);
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
return {
|
|
918
|
-
deltaX: deltaX,
|
|
919
|
-
deltaY: deltaY,
|
|
920
|
-
deltaXYAngle: deltaXYAngle,
|
|
921
|
-
};
|
|
922
|
-
};
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
function ComputeDistance() {
|
|
926
|
-
var displacementX = 0;
|
|
927
|
-
var displacementY = 0;
|
|
928
|
-
var distanceX = 0;
|
|
929
|
-
var distanceY = 0;
|
|
930
|
-
var distance = 0;
|
|
931
|
-
|
|
932
|
-
var overallDirection;
|
|
933
|
-
|
|
934
|
-
return function (input) {
|
|
935
|
-
var phase = input.phase,
|
|
936
|
-
startInput = input.startInput;
|
|
937
|
-
if (TYPE_START === phase) {
|
|
938
|
-
displacementX = 0;
|
|
939
|
-
displacementY = 0;
|
|
940
|
-
distanceX = 0;
|
|
941
|
-
distanceY = 0;
|
|
942
|
-
distance = 0;
|
|
943
|
-
} else if (TYPE_MOVE === phase) {
|
|
944
|
-
displacementX = Math.round(
|
|
945
|
-
input.points[0][CLIENT_X] - startInput.points[0][CLIENT_X]
|
|
946
|
-
);
|
|
947
|
-
displacementY = Math.round(
|
|
948
|
-
input.points[0][CLIENT_Y] - startInput.points[0][CLIENT_Y]
|
|
949
|
-
);
|
|
950
|
-
distanceX = Math.abs(displacementX);
|
|
951
|
-
distanceY = Math.abs(displacementY);
|
|
952
|
-
distance = Math.round(getVLength({ x: distanceX, y: distanceY }));
|
|
953
|
-
overallDirection = getDirection(displacementX, displacementY);
|
|
954
|
-
}
|
|
955
|
-
return {
|
|
956
|
-
displacementX: displacementX,
|
|
957
|
-
displacementY: displacementY,
|
|
958
|
-
distanceX: distanceX,
|
|
959
|
-
distanceY: distanceY,
|
|
960
|
-
distance: distance,
|
|
961
|
-
|
|
962
|
-
overallDirection: overallDirection,
|
|
963
|
-
};
|
|
964
|
-
};
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
function ComputeScale() {
|
|
968
|
-
var scale = 1;
|
|
969
|
-
|
|
970
|
-
return function (input, computed) {
|
|
971
|
-
var deltaScale = 1;
|
|
972
|
-
var prevVecotr = computed.prevVecotr,
|
|
973
|
-
startVecotr = computed.startVecotr,
|
|
974
|
-
activeVecotr = computed.activeVecotr;
|
|
975
|
-
if (activeVecotr) {
|
|
976
|
-
deltaScale = round2(
|
|
977
|
-
getVLength(activeVecotr) / getVLength(prevVecotr)
|
|
978
|
-
);
|
|
979
|
-
scale = round2(getVLength(activeVecotr) / getVLength(startVecotr));
|
|
980
|
-
}
|
|
981
|
-
return { scale: scale, deltaScale: deltaScale };
|
|
982
|
-
};
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
function ComputeVAndDir() {
|
|
986
|
-
var velocityX = 0;
|
|
987
|
-
var velocityY = 0;
|
|
988
|
-
var speedX = 0;
|
|
989
|
-
var speedY = 0;
|
|
990
|
-
|
|
991
|
-
var direction;
|
|
992
|
-
|
|
993
|
-
var lastValidInput;
|
|
994
|
-
|
|
995
|
-
return function (input) {
|
|
996
|
-
if (void 0 !== input) {
|
|
997
|
-
lastValidInput = lastValidInput || input.startInput;
|
|
998
|
-
var deltaTime = input.timestamp - lastValidInput.timestamp;
|
|
999
|
-
if (COMPUTE_INTERVAL < deltaTime) {
|
|
1000
|
-
var deltaX = input.x - lastValidInput.x;
|
|
1001
|
-
var deltaY = input.y - lastValidInput.y;
|
|
1002
|
-
speedX = Math.round((deltaX / deltaTime) * 100) / 100;
|
|
1003
|
-
speedY = Math.round((deltaY / deltaTime) * 100) / 100;
|
|
1004
|
-
velocityX = Math.abs(speedX);
|
|
1005
|
-
velocityY = Math.abs(speedY);
|
|
1006
|
-
direction = getDirection(deltaX, deltaY);
|
|
1007
|
-
lastValidInput = input;
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
return {
|
|
1011
|
-
velocityX: velocityX,
|
|
1012
|
-
velocityY: velocityY,
|
|
1013
|
-
speedX: speedX,
|
|
1014
|
-
speedY: speedY,
|
|
1015
|
-
|
|
1016
|
-
direction: direction,
|
|
1017
|
-
};
|
|
1018
|
-
};
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
function ComputeMaxLength() {
|
|
1022
|
-
var maxPointLength = 0;
|
|
1023
|
-
|
|
1024
|
-
return function (input) {
|
|
1025
|
-
var phase = input.phase;
|
|
1026
|
-
if (TYPE_START === phase) {
|
|
1027
|
-
maxPointLength = input.pointLength;
|
|
1028
|
-
}
|
|
1029
|
-
return { maxPointLength: maxPointLength };
|
|
1030
|
-
};
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
function computeVector(input) {
|
|
1034
|
-
return {
|
|
1035
|
-
x: input.points[1][CLIENT_X] - input.points[0][CLIENT_X],
|
|
1036
|
-
y: input.points[1][CLIENT_Y] - input.points[0][CLIENT_Y],
|
|
1037
|
-
};
|
|
1038
|
-
}
|
|
1039
|
-
function ComputeVectorForMutli() {
|
|
1040
|
-
var startVecotr;
|
|
1041
|
-
|
|
1042
|
-
var prevVecotr;
|
|
1043
|
-
var activeVecotr;
|
|
1044
|
-
|
|
1045
|
-
return function (input) {
|
|
1046
|
-
var prevInput = input.prevInput,
|
|
1047
|
-
startMultiInput = input.startMultiInput;
|
|
1048
|
-
if (
|
|
1049
|
-
void 0 !== startMultiInput &&
|
|
1050
|
-
void 0 !== prevInput &&
|
|
1051
|
-
input.id !== startMultiInput.id &&
|
|
1052
|
-
1 < prevInput.pointLength &&
|
|
1053
|
-
1 < input.pointLength
|
|
1054
|
-
) {
|
|
1055
|
-
startVecotr = computeVector(startMultiInput);
|
|
1056
|
-
prevVecotr = computeVector(prevInput);
|
|
1057
|
-
activeVecotr = computeVector(input);
|
|
1058
|
-
} else {
|
|
1059
|
-
activeVecotr = void 0;
|
|
1060
|
-
}
|
|
1061
|
-
return {
|
|
1062
|
-
startVecotr: startVecotr,
|
|
1063
|
-
|
|
1064
|
-
prevVecotr: prevVecotr,
|
|
1065
|
-
activeVecotr: activeVecotr,
|
|
1066
|
-
};
|
|
1067
|
-
};
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
var DEFAULT_OPTIONS$5 = {
|
|
1071
|
-
name: "tap",
|
|
1072
|
-
pointLength: 1,
|
|
1073
|
-
tapTimes: 1,
|
|
1074
|
-
waitNextTapTime: 300,
|
|
1075
|
-
maxDistance: 2,
|
|
1076
|
-
maxDistanceFromPrevTap: 9,
|
|
1077
|
-
maxPressTime: 250,
|
|
1078
|
-
};
|
|
1079
|
-
|
|
1080
|
-
function tap(at, options) {
|
|
1081
|
-
var context = createPluginContext(DEFAULT_OPTIONS$5, options);
|
|
1082
|
-
var tapCount = 0;
|
|
1083
|
-
|
|
1084
|
-
var prevTapPoint;
|
|
1085
|
-
|
|
1086
|
-
var prevTapTime;
|
|
1087
|
-
|
|
1088
|
-
var countDownToFailTimer;
|
|
1089
|
-
function reset() {
|
|
1090
|
-
tapCount = 0;
|
|
1091
|
-
prevTapPoint = void 0;
|
|
1092
|
-
prevTapTime = void 0;
|
|
1093
|
-
}
|
|
1094
|
-
function countDownToFail() {
|
|
1095
|
-
countDownToFailTimer = setTimeout(function () {
|
|
1096
|
-
context.state = 2;
|
|
1097
|
-
reset();
|
|
1098
|
-
}, context.waitNextTapTime);
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
function isValidDistanceFromPrevTap(center, options) {
|
|
1102
|
-
if (void 0 !== prevTapPoint) {
|
|
1103
|
-
var distanceFromPreviousTap = getVLength({
|
|
1104
|
-
x: center.x - prevTapPoint.x,
|
|
1105
|
-
|
|
1106
|
-
y: center.y - prevTapPoint.y,
|
|
1107
|
-
});
|
|
1108
|
-
prevTapPoint = center;
|
|
1109
|
-
return options.maxDistanceFromPrevTap >= distanceFromPreviousTap;
|
|
1110
|
-
} else {
|
|
1111
|
-
prevTapPoint = center;
|
|
1112
|
-
return true;
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
function isValidInterval(waitNextTapTime) {
|
|
1117
|
-
var now = performance.now();
|
|
1118
|
-
|
|
1119
|
-
if (void 0 === prevTapTime) {
|
|
1120
|
-
prevTapTime = now;
|
|
1121
|
-
return true;
|
|
1122
|
-
} else {
|
|
1123
|
-
var interval = now - prevTapTime;
|
|
1124
|
-
prevTapTime = now;
|
|
1125
|
-
return interval < waitNextTapTime;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
at.compute([ComputeDistance, ComputeMaxLength], function (computed) {
|
|
1130
|
-
if (isDisabled(context)) return;
|
|
1131
|
-
var phase = computed.phase,
|
|
1132
|
-
x = computed.x,
|
|
1133
|
-
y = computed.y;
|
|
1134
|
-
if (TYPE_END !== phase) return;
|
|
1135
|
-
context.state = 0;
|
|
1136
|
-
if (test()) {
|
|
1137
|
-
clearTimeout(countDownToFailTimer);
|
|
1138
|
-
if (
|
|
1139
|
-
isValidDistanceFromPrevTap({ x: x, y: y }, context) &&
|
|
1140
|
-
isValidInterval(context.waitNextTapTime)
|
|
1141
|
-
) {
|
|
1142
|
-
tapCount++;
|
|
1143
|
-
} else {
|
|
1144
|
-
tapCount = 1;
|
|
1145
|
-
}
|
|
1146
|
-
if (0 === tapCount % context.tapTimes) {
|
|
1147
|
-
context.state = 1;
|
|
1148
|
-
at.emit2(context.name, computed, context);
|
|
1149
|
-
reset();
|
|
1150
|
-
} else {
|
|
1151
|
-
countDownToFail();
|
|
1152
|
-
}
|
|
1153
|
-
} else {
|
|
1154
|
-
reset();
|
|
1155
|
-
context.state = 2;
|
|
1156
|
-
}
|
|
1157
|
-
function test() {
|
|
1158
|
-
var startInput = computed.startInput,
|
|
1159
|
-
pointLength = computed.pointLength,
|
|
1160
|
-
timestamp = computed.timestamp;
|
|
1161
|
-
var deltaTime = timestamp - startInput.timestamp;
|
|
1162
|
-
var distance = computed.distance,
|
|
1163
|
-
maxPointLength = computed.maxPointLength;
|
|
1164
|
-
return (
|
|
1165
|
-
maxPointLength === context.pointLength &&
|
|
1166
|
-
0 === pointLength &&
|
|
1167
|
-
context.maxDistance >= distance &&
|
|
1168
|
-
context.maxPressTime > deltaTime
|
|
1169
|
-
);
|
|
1170
|
-
}
|
|
1171
|
-
});
|
|
1172
|
-
return context;
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
var DEFAULT_OPTIONS$4 = { name: "pan", threshold: 10, pointLength: 1 };
|
|
1176
|
-
|
|
1177
|
-
function pan(at, options) {
|
|
1178
|
-
var context = createPluginContext(DEFAULT_OPTIONS$4, options);
|
|
1179
|
-
at.compute(
|
|
1180
|
-
[ComputeVAndDir, ComputeDistance, ComputeDeltaXY],
|
|
1181
|
-
|
|
1182
|
-
function (computed) {
|
|
1183
|
-
resetState(context);
|
|
1184
|
-
if (isDisabled(context)) return;
|
|
1185
|
-
var isValid = test();
|
|
1186
|
-
context.state = flow(isValid, context.state, computed.phase);
|
|
1187
|
-
if (isValid || isMoveOrEndOrCancel(context.state)) {
|
|
1188
|
-
var name_1 = context.name;
|
|
1189
|
-
at.emit2(name_1, computed, context);
|
|
1190
|
-
at.emit2(name_1 + getStatusName(context.state), computed, context);
|
|
1191
|
-
if (
|
|
1192
|
-
![TYPE_END, TYPE_CANCEL].includes(computed.phase) &&
|
|
1193
|
-
computed.direction
|
|
1194
|
-
) {
|
|
1195
|
-
at.emit2(name_1 + computed.direction, computed, context);
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
function test() {
|
|
1199
|
-
var pointLength = computed.pointLength,
|
|
1200
|
-
distance = computed.distance;
|
|
1201
|
-
return (
|
|
1202
|
-
context.pointLength === pointLength &&
|
|
1203
|
-
context.threshold <= distance
|
|
1204
|
-
);
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
);
|
|
1208
|
-
return context;
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
var DEFAULT_OPTIONS$3 = {
|
|
1212
|
-
name: "swipe",
|
|
1213
|
-
threshold: 10,
|
|
1214
|
-
velocity: 0.3,
|
|
1215
|
-
pointLength: 1,
|
|
1216
|
-
};
|
|
1217
|
-
|
|
1218
|
-
function swipe(at, options) {
|
|
1219
|
-
var context = createPluginContext(DEFAULT_OPTIONS$3, options);
|
|
1220
|
-
at.compute(
|
|
1221
|
-
[ComputeDistance, ComputeVAndDir, ComputeMaxLength],
|
|
1222
|
-
|
|
1223
|
-
function (computed) {
|
|
1224
|
-
context.state = 0;
|
|
1225
|
-
if (context.disabled) return;
|
|
1226
|
-
if (test()) {
|
|
1227
|
-
var name_1 = context.name;
|
|
1228
|
-
context.state = 1;
|
|
1229
|
-
at.emit2(name_1, computed, context);
|
|
1230
|
-
at.emit2(name_1 + computed.direction, computed, context);
|
|
1231
|
-
}
|
|
1232
|
-
function test() {
|
|
1233
|
-
if (TYPE_END !== computed.phase) return false;
|
|
1234
|
-
var velocityX = computed.velocityX,
|
|
1235
|
-
velocityY = computed.velocityY,
|
|
1236
|
-
distance = computed.distance,
|
|
1237
|
-
maxPointLength = computed.maxPointLength;
|
|
1238
|
-
return (
|
|
1239
|
-
maxPointLength === context.pointLength &&
|
|
1240
|
-
0 === computed.points.length &&
|
|
1241
|
-
context.threshold < distance &&
|
|
1242
|
-
context.velocity < Math.max(velocityX, velocityY)
|
|
1243
|
-
);
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
);
|
|
1247
|
-
return context;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
var DEFAULT_OPTIONS$2 = {
|
|
1251
|
-
name: "press",
|
|
1252
|
-
pointLength: 1,
|
|
1253
|
-
maxDistance: 9,
|
|
1254
|
-
minPressTime: 251,
|
|
1255
|
-
};
|
|
1256
|
-
|
|
1257
|
-
function press(at, options) {
|
|
1258
|
-
var context = createPluginContext(DEFAULT_OPTIONS$2, options);
|
|
1259
|
-
var timeoutId = 0;
|
|
1260
|
-
|
|
1261
|
-
at.compute([ComputeDistance], function (computed) {
|
|
1262
|
-
if (isDisabled(context)) return;
|
|
1263
|
-
var phase = computed.phase,
|
|
1264
|
-
startInput = computed.startInput,
|
|
1265
|
-
pointLength = computed.pointLength;
|
|
1266
|
-
if (TYPE_START === phase && context.pointLength === pointLength) {
|
|
1267
|
-
resetState(context);
|
|
1268
|
-
clearTimeout(timeoutId);
|
|
1269
|
-
timeoutId = setTimeout(function () {
|
|
1270
|
-
context.state = 1;
|
|
1271
|
-
at.emit2(context.name, computed, context);
|
|
1272
|
-
}, context.minPressTime);
|
|
1273
|
-
} else if (TYPE_END === phase && 1 === context.state) {
|
|
1274
|
-
at.emit2(
|
|
1275
|
-
"".concat(context.name).concat(DIRECTION_UP),
|
|
1276
|
-
computed,
|
|
1277
|
-
context
|
|
1278
|
-
);
|
|
1279
|
-
} else if (1 !== context.state) {
|
|
1280
|
-
var deltaTime = computed.timestamp - startInput.timestamp;
|
|
1281
|
-
if (
|
|
1282
|
-
!test() ||
|
|
1283
|
-
(context.minPressTime > deltaTime &&
|
|
1284
|
-
[TYPE_END, TYPE_CANCEL].includes(phase))
|
|
1285
|
-
) {
|
|
1286
|
-
clearTimeout(timeoutId);
|
|
1287
|
-
context.state = 2;
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
function test() {
|
|
1291
|
-
var distance = computed.distance;
|
|
1292
|
-
return distance && context.maxDistance > distance;
|
|
1293
|
-
}
|
|
1294
|
-
});
|
|
1295
|
-
return context;
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
var DEFAULT_OPTIONS$1 = {
|
|
1299
|
-
name: "pinch",
|
|
1300
|
-
threshold: 0,
|
|
1301
|
-
pointLength: 2,
|
|
1302
|
-
};
|
|
1303
|
-
|
|
1304
|
-
function pinch(at, options) {
|
|
1305
|
-
var context = createPluginContext(DEFAULT_OPTIONS$1, options);
|
|
1306
|
-
at.compute(
|
|
1307
|
-
[ComputeVectorForMutli, ComputeScale],
|
|
1308
|
-
|
|
1309
|
-
function (computed) {
|
|
1310
|
-
resetState(context);
|
|
1311
|
-
if (isDisabled(context)) return;
|
|
1312
|
-
var isValid = test();
|
|
1313
|
-
context.state = flow(isValid, context.state, computed.phase);
|
|
1314
|
-
var name = context.name;
|
|
1315
|
-
if (isValid || isMoveOrEndOrCancel(context.state)) {
|
|
1316
|
-
at.emit2(name, computed, context);
|
|
1317
|
-
var deltaScale = computed.deltaScale;
|
|
1318
|
-
if (1 !== deltaScale) {
|
|
1319
|
-
at.emit2(
|
|
1320
|
-
name + (1 < deltaScale ? "in" : "out"),
|
|
1321
|
-
computed,
|
|
1322
|
-
context
|
|
1323
|
-
);
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
var stateName = getStatusName(context.state);
|
|
1327
|
-
if (stateName) {
|
|
1328
|
-
at.emit2(name + stateName, computed, context);
|
|
1329
|
-
}
|
|
1330
|
-
function test() {
|
|
1331
|
-
var pointLength = computed.pointLength,
|
|
1332
|
-
scale = computed.scale;
|
|
1333
|
-
computed.deltaScale;
|
|
1334
|
-
computed.phase;
|
|
1335
|
-
return (
|
|
1336
|
-
context.pointLength === pointLength &&
|
|
1337
|
-
context.threshold < Math.abs(scale - 1)
|
|
1338
|
-
);
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
);
|
|
1342
|
-
return context;
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
var DEFAULT_OPTIONS = {
|
|
1346
|
-
name: "rotate",
|
|
1347
|
-
threshold: 0,
|
|
1348
|
-
pointLength: 2,
|
|
1349
|
-
};
|
|
1350
|
-
|
|
1351
|
-
function rotate(at, options) {
|
|
1352
|
-
var context = createPluginContext(DEFAULT_OPTIONS, options);
|
|
1353
|
-
at.compute(
|
|
1354
|
-
[ComputeVectorForMutli, ComputeAngle],
|
|
1355
|
-
|
|
1356
|
-
function (computed) {
|
|
1357
|
-
if (isDisabled(context)) return;
|
|
1358
|
-
resetState(context);
|
|
1359
|
-
var isValid = test();
|
|
1360
|
-
context.state = flow(isValid, context.state, computed.phase);
|
|
1361
|
-
var name = context.name;
|
|
1362
|
-
if (isValid || isMoveOrEndOrCancel(context.state)) {
|
|
1363
|
-
at.emit2(name, computed, context);
|
|
1364
|
-
}
|
|
1365
|
-
var stateName = getStatusName(context.state);
|
|
1366
|
-
if (stateName) {
|
|
1367
|
-
at.emit2(name + stateName, computed, context);
|
|
1368
|
-
}
|
|
1369
|
-
function test() {
|
|
1370
|
-
var pointLength = computed.pointLength,
|
|
1371
|
-
angle = computed.angle;
|
|
1372
|
-
return (
|
|
1373
|
-
context.pointLength === pointLength &&
|
|
1374
|
-
context.threshold < Math.abs(angle)
|
|
1375
|
-
);
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
);
|
|
1379
|
-
return context;
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
function doubletap(at) {
|
|
1383
|
-
at.use(tap, { name: "doubletap", tapTimes: 2 });
|
|
1384
|
-
var doubleTapContext = at.get("doubletap");
|
|
1385
|
-
|
|
1386
|
-
var timeID;
|
|
1387
|
-
|
|
1388
|
-
at.beforeEach(function (type, next) {
|
|
1389
|
-
if ("tap" === type) {
|
|
1390
|
-
clearTimeout(timeID);
|
|
1391
|
-
timeID = setTimeout(function () {
|
|
1392
|
-
if ([0, 2].includes(doubleTapContext.state)) {
|
|
1393
|
-
next();
|
|
1394
|
-
}
|
|
1395
|
-
}, 300);
|
|
1396
|
-
} else {
|
|
1397
|
-
next();
|
|
1398
|
-
}
|
|
1399
|
-
});
|
|
1400
|
-
return doubleTapContext;
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
var default_1 = (function (_super) {
|
|
1404
|
-
__extends(default_1, _super);
|
|
1405
|
-
|
|
1406
|
-
function default_1(el, options) {
|
|
1407
|
-
var _this = _super.call(this, el, options) || this;
|
|
1408
|
-
_this.use(tap);
|
|
1409
|
-
_this.use(pan);
|
|
1410
|
-
_this.use(swipe);
|
|
1411
|
-
_this.use(press);
|
|
1412
|
-
_this.use(pinch);
|
|
1413
|
-
_this.use(rotate);
|
|
1414
|
-
return _this;
|
|
1415
|
-
}
|
|
1416
|
-
default_1.STATE_POSSIBLE = 0;
|
|
1417
|
-
default_1.STATE_START = 4;
|
|
1418
|
-
default_1.STATE_MOVE = 5;
|
|
1419
|
-
default_1.STATE_END = 1;
|
|
1420
|
-
default_1.STATE_CANCELLED = 3;
|
|
1421
|
-
default_1.STATE_FAILED = 2;
|
|
1422
|
-
default_1.STATE_RECOGNIZED = 1;
|
|
1423
|
-
default_1.tap = tap;
|
|
1424
|
-
default_1.pan = pan;
|
|
1425
|
-
default_1.swipe = swipe;
|
|
1426
|
-
default_1.press = press;
|
|
1427
|
-
default_1.rotate = rotate;
|
|
1428
|
-
default_1.pinch = pinch;
|
|
1429
|
-
default_1.doubletap = doubletap;
|
|
1430
|
-
return default_1;
|
|
1431
|
-
})(default_1$1);
|
|
1432
|
-
|
|
1433
|
-
return default_1;
|
|
1434
|
-
});
|
|
1435
|
-
};
|
|
43
|
+
let t$1 = class t{constructor(){this.__map={};}beforeEach(t){this.__interceptor=t;}on(t,i){const s=Array.isArray(t)?t:[t];for(const t of s){this.__map[t]=this.__map[t]||[];const s=this.__map[t];s&&s.push(i);}return this}emit(t,i,s){void 0!==this.__interceptor?this.__interceptor(t,(()=>{this.__emit(t,i),s&&s();})):(this.__emit(t,i),s&&s());}__emit(t,i){const s=this.__map[t];if(Array.isArray(s)&&(null==s?void 0:s.length))for(const _ of s)_(i,t);this.event=i;}off(t,i){const s=this.__map[t];if(void 0!==s)if(void 0===i)delete this.__map[t];else {const t=s.findIndex((t=>t===i));s.splice(t,1);}}destroy(){this.__map={};}};
|
|
44
|
+
|
|
45
|
+
const n$1="clientX",e$2="clientY",t=16,c$3="start",o$1="move",s$1="cancel",u$3="end",a$2="left",i$3="right",r$4="up",d$1="down",m$2={4:"start",5:"move",1:"end",3:"cancel"};function v$1(n){return m$2[n]}function b(n,e,t){const c={1:{0:{move:4},4:{move:5,end:1,cancel:3},5:{move:5,end:1,cancel:3}},0:{4:{move:2,end:1,cancel:3},5:{start:2,move:2,end:1,cancel:3}}}[Number(n)][e];return void 0!==c&&c[t]||0}function g$1(n){[1,3,2].includes(n.state)&&(n.state=0);}function h$3(n){return [5,1,3].includes(n)}function j(n){if(n.disabled)return n.state=0,!0}function O(n,e){return Object.assign(Object.assign(Object.assign({},n),e),{state:0,disabled:!1})}function p$3(n){return Math.round(100*n)/100}
|
|
46
|
+
|
|
47
|
+
function r$3(){let t,o,i,r,a=0;return function(u){if(t=o,void 0!==u){a=Number.MAX_SAFE_INTEGER>a?++a:1;const h=function(t,o){const{phase:i,points:r,changedPoints:a,nativeEvent:u}=t,h=r.length,p=c$3===i,g=u$3===i&&0===h||s$1===i,l=Date.now(),{x:d,y:m}=c$2(r)||c$2(a),{currentTarget:v}=u;return Object.assign(t,{id:o,x:d,y:m,timestamp:l,isStart:p,isEnd:g,pointLength:h,currentTarget:v,getOffset(t=v){const e=t.getBoundingClientRect();return {x:d-Math.round(e.left),y:m-Math.round(e.top)}}})}(u,a);o=h;const{isStart:p,pointLength:g}=h;return p&&(i=h,t=void 0,r=1<g?h:void 0),Object.assign(Object.assign({},h),{prevInput:t,startMultiInput:r,startInput:i})}}}function c$2(t){const{length:e}=t;if(0<e){if(1===e){const{clientX:e,clientY:n}=t[0];return {x:Math.round(e),y:Math.round(n)}}const n=t.reduce(((t,e)=>(t.x+=e[n$1],t.y+=e[e$2],t)),{x:0,y:0});return {x:Math.round(n.x/e),y:Math.round(n.y/e)}}}function a$1(t,e,n,s){const o={};for(const t in n)["target","currentTarget","type"].includes(t)||(o[t]=n[t]);let i;return document.createEvent?(i=document.createEvent("HTMLEvents"),i.initEvent(t,null==s?void 0:s.bubbles,null==s?void 0:s.cancelable)):i=new Event(t,s),Object.assign(i,o,{match:()=>n.targets&&0<n.targets.length&&n.targets.every((t=>i.currentTarget.contains(t)))}),e.dispatchEvent(i)}function u$2(t,e){const{preventDefault:n}=e;return s=n,"[object Function]"===Object.prototype.toString.call(s)?n(t):!!n;var s;}const h$2=["touchstart","touchmove","touchend","touchcancel","mousedown"],p$2=["mousemove","mouseup"];const g={domEvents:{bubbles:!0,cancelable:!0},preventDefault:t=>{if(t.target&&"tagName"in t.target){const{tagName:e}=t.target;return !/^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(e)}return !1}};let l$1 = class l extends t$1{constructor(t,e){super(),this.v="2.1.3",this.__computeFunctionList=[],this.__computeFunctionCreatorList=[],this.__pluginContexts=[],this.__isIgnoreMouse=!1,this.el=t,this.c={},this.__options=Object.assign(Object.assign({},g),e);const n=function(t){const e=r$3();return function(n){const s=[],o=[];Array.from(n.touches).forEach((({clientX:e,clientY:n,target:i})=>{(null==t?void 0:t.contains(i))&&(s.push(i),o.push({clientX:e,clientY:n,target:i}));}));const i=Array.from(n.changedTouches).map((({clientX:t,clientY:e,target:n})=>({clientX:t,clientY:e,target:n})));return e({phase:n.type.replace("touch",""),changedPoints:i,points:o,nativeEvent:n,target:n.target,targets:s})}}(this.el),s=function(){let t,e=!1,n=null;const s=r$3();return function(o){const{clientX:i,clientY:r,type:c,button:a,target:u}=o;let h,p=[{clientX:i,clientY:r,target:u}];if("mousedown"===c&&0===a)n=u,e=!0,h="start";else {if(!e)return;"mousemove"===c?h="move":"mouseup"===c&&(p=[],h="end",e=!1);}const g=t||[{clientX:i,clientY:r,target:u}];if(t=[{clientX:i,clientY:r,target:u}],void 0!==h)return s({phase:h,changedPoints:g,points:p,target:n,targets:[n],nativeEvent:o})}}();if(this.__inputCreatorMap={touchstart:n,touchmove:n,touchend:n,touchcancel:n,mousedown:s,mousemove:s,mouseup:s},this.on("at:after",(t=>{const{target:e,__type:n}=t,{domEvents:s}=this.__options;s&&void 0!==this.el&&e&&(a$1(n,e,t,s),a$1("at:after",e,t,s));})),void 0!==t){t.style.webkitTapHighlightColor="rgba(0,0,0,0)";let e=!1;try{const t={};Object.defineProperty(t,"passive",{get(){e=!0;}}),window.addEventListener("_",(()=>{}),t);}catch(t){}this.on("u",function(t,e,n){return h$2.forEach((s=>{t.addEventListener(s,e,n);})),p$2.forEach((t=>{window.addEventListener(t,e,n);})),()=>{h$2.forEach((n=>{t.removeEventListener(n,e);})),p$2.forEach((t=>{window.removeEventListener(t,e);}));}}(t,this.catchEvent.bind(this),!1===this.__options.preventDefault&&e?{passive:!0}:{passive:!1}));}}use(t,e){this.__pluginContexts.push(t(this,e));}catchEvent(t){const e=this.__inputCreatorMap[t.type](t);if(void 0!==e){const n=()=>t.stopPropagation(),s=()=>t.stopImmediatePropagation(),o=()=>t.preventDefault();if(u$2(t,this.__options))o();else if("touchstart"===t.type?this.__isIgnoreMouse=!0:"touchmove"===t.type&&(this.__isIgnoreMouse=!1),this.__isIgnoreMouse&&t.type.startsWith("mouse"))return void("mouseup"===t.type&&(this.__isIgnoreMouse=!1));this.emit("input",e),this.emit2(`at:${e.phase}`,e,{});const i={};this.__computeFunctionList.forEach((t=>{const n=t(e,i);if(void 0!==n)for(const t in n)i[t]=n[t];})),this.emit("computed",Object.assign(Object.assign(Object.assign({},e),i),{stopPropagation:n,stopImmediatePropagation:s,preventDefault:o}));}}compute(t,e){for(const e of t)this.__computeFunctionCreatorList.includes(e)||(this.__computeFunctionCreatorList.push(e),this.__computeFunctionList.push(e()));this.on("computed",e);}beforeEach(t){super.beforeEach(((e,n)=>{var s;(null===(s=this.c)||void 0===s?void 0:s.name)?t(e,n):n();}));}get(t){return this.__pluginContexts.find((e=>t===e.name))}set(t){this.__options=Object.assign(Object.assign({},this.__options),t);}emit2(t,e,n){this.c=n,this.emit(t,Object.assign(Object.assign({},e),{type:t}),(()=>{this.emit("at:after",Object.assign(Object.assign({},e),{name:t,__type:t}));}));}destroy(){this.emit("u"),super.destroy();}};
|
|
48
|
+
|
|
49
|
+
var x=r=>Math.sqrt(r.x*r.x+r.y*r.y),y=(r,a)=>r.x*a.x+r.y*a.y,e$1=(r,a)=>{var t=x(r)*x(a);if(0===t)return 0;var h=y(r,a)/t;return h>1&&(h=1),Math.acos(h)},n=(r,a)=>r.x*a.y-a.x*r.y,o=r=>r/Math.PI*180,s=(r,a)=>{var t=e$1(r,a);return n(r,a)>0&&(t*=-1),o(t)},u$1=(x,y)=>{if(0!==x||0!==y)return Math.abs(x)>=Math.abs(y)?0<x?i$3:a$2:0<y?d$1:r$4};
|
|
50
|
+
|
|
51
|
+
function p$1(){let n=0,e=0;return function(o,r){const{prevVecotr:i,startVecotr:a,activeVecotr:c}=r;return c&&(e=Math.round(s(c,i)),n=Math.round(s(c,a))),{angle:n,deltaAngle:e}}}function d(){return function(t){const{prevInput:e}=t;let o$1=0,r=0,i=0;if(void 0!==e&&(o$1=t.x-e.x,r=t.y-e.y,0!==o$1||0!==r)){const t=Math.sqrt(Math.pow(o$1,2)+Math.pow(r,2));i=Math.round(o(Math.acos(Math.abs(o$1)/t)));}return {deltaX:o$1,deltaY:r,deltaXYAngle:i}}}function h$1(){let t,n=0,u=0,s=0,p=0,d=0;return function(h){const{phase:l,startInput:f}=h;return c$3===l?(n=0,u=0,s=0,p=0,d=0):o$1===l&&(n=Math.round(h.points[0][n$1]-f.points[0][n$1]),u=Math.round(h.points[0][e$2]-f.points[0][e$2]),s=Math.abs(n),p=Math.abs(u),d=Math.round(x({x:s,y:p})),t=u$1(n,u)),{displacementX:n,displacementY:u,distanceX:s,distanceY:p,distance:d,overallDirection:t}}}function l(){let t=1;return function(n,o){let r=1;const{prevVecotr:i,startVecotr:a,activeVecotr:c}=o;return c&&(r=p$3(x(c)/x(i)),t=p$3(x(c)/x(a))),{scale:t,deltaScale:r}}}function f(){let t$1,n,e=0,r=0,i=0,a=0;return function(c){if(void 0!==c){n=n||c.startInput;const u=c.timestamp-n.timestamp;if(t<u){const s=c.x-n.x,p=c.y-n.y;i=Math.round(s/u*100)/100,a=Math.round(p/u*100)/100,e=Math.abs(i),r=Math.abs(a),t$1=u$1(s,p),n=c;}}return {velocityX:e,velocityY:r,speedX:i,speedY:a,direction:t$1}}}function M(){let t=0;return function(n){const{phase:e}=n;return c$3===e&&(t=n.pointLength),{maxPointLength:t}}}function v(t){return {x:t.points[1][n$1]-t.points[0][n$1],y:t.points[1][e$2]-t.points[0][e$2]}}function m$1(){let t,n,e;return function(o){const{prevInput:r,startMultiInput:i}=o;return void 0!==i&&void 0!==r&&o.id!==i.id&&1<r.pointLength&&1<o.pointLength?(t=v(i),n=v(r),e=v(o)):e=void 0,{startVecotr:t,prevVecotr:n,activeVecotr:e}}}
|
|
52
|
+
|
|
53
|
+
const m={name:"tap",pointLength:1,tapTimes:1,waitNextTapTime:300,maxDistance:2,maxDistanceFromPrevTap:9,maxPressTime:250};function r$2(r,s){const c=O(m,s);let p,u,x$1,T=0;function f(){T=0,p=void 0,u=void 0;}return r.compute([h$1,M],(t=>{if(j(c))return;const{phase:i,x:o,y:m}=t;u$3===i&&(c.state=0,!function(){const{startInput:e,pointLength:n,timestamp:a}=t,i=a-e.timestamp,{distance:o,maxPointLength:m}=t;return m===c.pointLength&&0===n&&c.maxDistance>=o&&c.maxPressTime>i}()?(f(),c.state=2):(clearTimeout(x$1),function(t,e){if(void 0!==p){const n=x({x:t.x-p.x,y:t.y-p.y});return p=t,e.maxDistanceFromPrevTap>=n}return p=t,!0}({x:o,y:m},c)&&function(t){const e=performance.now();if(void 0===u)return u=e,!0;{const n=e-u;return u=e,n<t}}(c.waitNextTapTime)?T++:T=1,0==T%c.tapTimes?(c.state=1,r.emit2(c.name,t,c),f()):x$1=setTimeout((()=>{c.state=2,f();}),c.waitNextTapTime)));})),c}
|
|
54
|
+
|
|
55
|
+
const p={name:"pan",threshold:10,pointLength:1};function u(u,d$1){const f$1=O(p,d$1);return u.compute([f,h$1,d],(t=>{if(g$1(f$1),j(f$1))return;const c=function(){const{pointLength:e,distance:n}=t;return f$1.pointLength===e&&f$1.threshold<=n}();if(f$1.state=b(c,f$1.state,t.phase),c||h$3(f$1.state)){const{name:e}=f$1;u.emit2(e,t,f$1),u.emit2(e+v$1(f$1.state),t,f$1),![u$3,s$1].includes(t.phase)&&t.direction&&u.emit2(e+t.direction,t,f$1);}})),f$1}
|
|
56
|
+
|
|
57
|
+
const c$1={name:"swipe",threshold:10,velocity:.3,pointLength:1};function a(a,r){const s=O(c$1,r);return a.compute([h$1,f,M],(t=>{if(s.state=0,!s.disabled&&function(){if(u$3!==t.phase)return !1;const{velocityX:o,velocityY:n,distance:i,maxPointLength:c}=t;return c===s.pointLength&&0===t.points.length&&s.threshold<i&&s.velocity<Math.max(o,n)}()){const{name:e}=s;s.state=1,a.emit2(e,t,s),a.emit2(e+t.direction,t,s);}})),s}
|
|
58
|
+
|
|
59
|
+
const r$1={name:"press",pointLength:1,maxDistance:9,minPressTime:251};function c(c,u){const p=O(r$1,u);let f=0;return c.compute([h$1],(t=>{if(j(p))return;const{phase:o,startInput:r,pointLength:u}=t;if(c$3===o&&p.pointLength===u)g$1(p),clearTimeout(f),f=setTimeout((()=>{p.state=1,c.emit2(p.name,t,p);}),p.minPressTime);else if(u$3===o&&1===p.state)c.emit2(`${p.name}${r$4}`,t,p);else if(1!==p.state){const e=t.timestamp-r.timestamp;(!function(){const{distance:e}=t;return e&&p.maxDistance>e}()||p.minPressTime>e&&[u$3,s$1].includes(o))&&(clearTimeout(f),p.state=2);}})),p}
|
|
60
|
+
|
|
61
|
+
const i$2={name:"pinch",threshold:0,pointLength:2};function r(r,m){const p=O(i$2,m);return r.compute([m$1,l],(t=>{if(g$1(p),j(p))return;const c=function(){const{pointLength:e,scale:n,deltaScale:o,phase:a}=t;return p.pointLength===e&&p.threshold<Math.abs(n-1)}();p.state=b(c,p.state,t.phase);const{name:h}=p;if(c||h$3(p.state)){r.emit2(h,t,p);const{deltaScale:e}=t;1!==e&&r.emit2(h+(1<e?"in":"out"),t,p);}const i=v$1(p.state);i&&r.emit2(h+i,t,p);})),p}
|
|
62
|
+
|
|
63
|
+
const h={name:"rotate",threshold:0,pointLength:2};function i$1(i,m){const u=O(h,m);return i.compute([m$1,p$1],(t=>{if(j(u))return;g$1(u);const r=function(){const{pointLength:e,angle:n}=t;return u.pointLength===e&&u.threshold<Math.abs(n)}();u.state=b(r,u.state,t.phase);const{name:c}=u;(r||h$3(u.state))&&i.emit2(c,t,u);const h=v$1(u.state);h&&i.emit2(c+h,t,u);})),u}
|
|
64
|
+
|
|
65
|
+
function e(e){e.use(r$2,{name:"doubletap",tapTimes:2});const a=e.get("doubletap");let o;return e.beforeEach(((t,e)=>{"tap"===t?(clearTimeout(o),o=setTimeout((()=>{[0,2].includes(a.state)&&e();}),300)):e();})),a}
|
|
66
|
+
|
|
67
|
+
class i extends l$1{constructor(t,u$1){super(t,u$1),this.use(r$2),this.use(u),this.use(a),this.use(c),this.use(r),this.use(i$1);}}i.STATE_POSSIBLE=0,i.STATE_START=4,i.STATE_MOVE=5,i.STATE_END=1,i.STATE_CANCELLED=3,i.STATE_FAILED=2,i.STATE_RECOGNIZED=1,i.tap=r$2,i.pan=u,i.swipe=a,i.press=c,i.rotate=i$1,i.pinch=r,i.doubletap=e;
|
|
1436
68
|
|
|
1437
69
|
class PopsUtils {
|
|
1438
70
|
/**
|
|
@@ -1671,7 +303,9 @@ define((function () { 'use strict';
|
|
|
1671
303
|
: parseFloat(result.toString());
|
|
1672
304
|
return result;
|
|
1673
305
|
}
|
|
1674
|
-
AnyTouch =
|
|
306
|
+
AnyTouch = () => {
|
|
307
|
+
return i;
|
|
308
|
+
};
|
|
1675
309
|
}
|
|
1676
310
|
const popsUtils = new PopsUtils();
|
|
1677
311
|
|
|
@@ -1769,7 +403,7 @@ define((function () { 'use strict';
|
|
|
1769
403
|
/* 在上层与主元素之间寻找可以被selector所匹配到的 */
|
|
1770
404
|
let closestElement = target.closest(_selector_);
|
|
1771
405
|
/* event的target值不能直接修改 */
|
|
1772
|
-
OriginPrototype
|
|
406
|
+
OriginPrototype.Object.defineProperty(event, "target", {
|
|
1773
407
|
get() {
|
|
1774
408
|
return closestElement;
|
|
1775
409
|
},
|
|
@@ -3401,7 +2035,7 @@ define((function () { 'use strict';
|
|
|
3401
2035
|
let clickElementTopOffset = 0;
|
|
3402
2036
|
let AnyTouch = popsUtils.AnyTouch();
|
|
3403
2037
|
let anyTouchElement = new AnyTouch(options.dragElement, {
|
|
3404
|
-
|
|
2038
|
+
preventDefault(event) {
|
|
3405
2039
|
if (typeof options.preventEvent === "function") {
|
|
3406
2040
|
return options.preventEvent(event);
|
|
3407
2041
|
}
|
|
@@ -3569,7 +2203,7 @@ define((function () { 'use strict';
|
|
|
3569
2203
|
}
|
|
3570
2204
|
});
|
|
3571
2205
|
/* 因为会覆盖上面的点击事件,主动触发一下 */
|
|
3572
|
-
anyTouchElement.on(["
|
|
2206
|
+
anyTouchElement.on(["tap"], function (event) {
|
|
3573
2207
|
event.changedPoints.forEach((item) => {
|
|
3574
2208
|
popsDOMUtils.trigger(item.target, "click", void 0, true);
|
|
3575
2209
|
});
|
|
@@ -3617,7 +2251,7 @@ define((function () { 'use strict';
|
|
|
3617
2251
|
},
|
|
3618
2252
|
};
|
|
3619
2253
|
|
|
3620
|
-
var indexCSS = "@charset \"utf-8\";\r\n* {\r\n\t-webkit-box-sizing: border-box;\r\n\tbox-sizing: border-box;\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\t-webkit-tap-highlight-color: transparent;\r\n\t/* 代替::-webkit-scrollbar */\r\n\tscrollbar-width: thin;\r\n}\r\n.pops {\r\n\t--pops-bg-opacity: 1;\r\n\t--pops-bd-opacity: 1;\r\n\t--pops-font-size: 16px;\r\n}\r\n.pops-mask {\r\n\t--pops-mask-bg-opacity: 0.4;\r\n}\r\n.pops {\r\n\tbackground-color: rgb(255, 255, 255, var(--pops-bg-opacity));\r\n\tborder-radius: 4px;\r\n\tborder: 1px solid rgb(235, 238, 245, var(--pops-bd-opacity));\r\n\tfont-size: var(--pops-font-size);\r\n\tbox-shadow: 0 0 12px rgba(0, 0, 0, 0.12);\r\n\tbox-sizing: border-box;\r\n\toverflow: hidden;\r\n\ttransition: all 0.35s;\r\n}\r\n.pops-anim {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n}\r\n.pops-anim[anim=\"\"] {\r\n\ttop: unset;\r\n\tright: unset;\r\n\tbottom: unset;\r\n\tleft: unset;\r\n\twidth: unset;\r\n\theight: unset;\r\n\ttransition: none;\r\n}\r\n/* 底部图标动画和样式 */\r\n.pops i.pops-bottom-icon[is-loading=\"true\"] {\r\n\tanimation: rotating 2s linear infinite;\r\n}\r\n.pops i.pops-bottom-icon {\r\n\theight: 1em;\r\n\twidth: 1em;\r\n\tline-height: 1em;\r\n\tdisplay: inline-flex;\r\n\tjustify-content: center;\r\n\talign-items: center;\r\n\tposition: relative;\r\n\tfill: currentColor;\r\n\tcolor: inherit;\r\n\tfont-size: inherit;\r\n}\r\n\r\n/* 遮罩层样式 */\r\n.pops-mask {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\tborder: 0;\r\n\tborder-radius: 0;\r\n\tbackground-color: rgba(0, 0, 0, var(--pops-mask-bg-opacity));\r\n\tbox-shadow: none;\r\n\ttransition: none;\r\n}\r\n\r\n.pops-header-controls button.pops-header-control[type][data-header] {\r\n\tfloat: right;\r\n\tmargin: 0 0;\r\n\toutline: 0;\r\n\tborder: 0;\r\n\tborder-color: rgb(136, 136, 136, var(--pops-bd-opacity));\r\n\tbackground-color: transparent;\r\n\tcolor: #888;\r\n\tcursor: pointer;\r\n}\r\n.pops-header-controls button.pops-header-control[type=\"max\"],\r\n.pops-header-controls button.pops-header-control[type=\"mise\"],\r\n.pops-header-controls button.pops-header-control[type=\"min\"] {\r\n\tposition: relative;\r\n\tfloat: right;\r\n\tmargin: 0 2px;\r\n\toutline: 0 !important;\r\n\tborder: 0;\r\n\tborder-color: rgb(136, 136, 136, var(--pops-bd-opacity));\r\n\tbackground-color: transparent;\r\n\tcolor: rgb(136, 136, 136);\r\n\tcursor: pointer;\r\n\ttransition: all 0.3s ease-in-out;\r\n}\r\nbutton.pops-header-control i {\r\n\tcolor: rgb(144, 147, 153);\r\n\tfont-size: inherit;\r\n\tdisplay: inline-flex;\r\n\tjustify-content: center;\r\n\talign-items: center;\r\n\tposition: relative;\r\n\tfill: currentColor;\r\n}\r\nbutton.pops-header-control svg {\r\n\theight: 1.25em;\r\n\twidth: 1.25em;\r\n}\r\nbutton.pops-header-control {\r\n\tright: 15px;\r\n\tpadding: 0;\r\n\tborder: none;\r\n\toutline: 0;\r\n\tbackground: 0 0;\r\n\tcursor: pointer;\r\n\tposition: unset;\r\n\tline-height: 1.15;\r\n}\r\nbutton.pops-header-control i:hover {\r\n\tcolor: rgb(64, 158, 255);\r\n}\r\n.pops-header-controls[data-margin] button.pops-header-control {\r\n\tmargin: 0 6px;\r\n}\r\n.pops[type-value] .pops-header-controls {\r\n\tdisplay: flex;\r\n}\r\n";
|
|
2254
|
+
var indexCSS = "@charset \"utf-8\";\r\n* {\r\n\t-webkit-box-sizing: border-box;\r\n\tbox-sizing: border-box;\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\t-webkit-tap-highlight-color: transparent;\r\n\t/* 代替::-webkit-scrollbar */\r\n\tscrollbar-width: thin;\r\n}\r\n.pops {\r\n\t--pops-bg-opacity: 1;\r\n\t--pops-bd-opacity: 1;\r\n\t--pops-font-size: 16px;\r\n}\r\n.pops-mask {\r\n\t--pops-mask-bg-opacity: 0.4;\r\n}\r\n.pops {\r\n\tbackground-color: rgb(255, 255, 255, var(--pops-bg-opacity));\r\n\tborder-radius: 4px;\r\n\tborder: 1px solid rgb(235, 238, 245, var(--pops-bd-opacity));\r\n\tfont-size: var(--pops-font-size);\r\n\tbox-shadow: 0 0 12px rgba(0, 0, 0, 0.12);\r\n\tbox-sizing: border-box;\r\n\toverflow: hidden;\r\n\ttransition: all 0.35s;\r\n}\r\n.pops-anim {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n}\r\n.pops-anim[anim=\"\"] {\r\n\ttop: unset;\r\n\tright: unset;\r\n\tbottom: unset;\r\n\tleft: unset;\r\n\twidth: unset;\r\n\theight: unset;\r\n\ttransition: none;\r\n}\r\n/* 底部图标动画和样式 */\r\n.pops i.pops-bottom-icon[is-loading=\"true\"] {\r\n\tanimation: rotating 2s linear infinite;\r\n}\r\n.pops i.pops-bottom-icon {\r\n\theight: 1em;\r\n\twidth: 1em;\r\n\tline-height: 1em;\r\n\tdisplay: inline-flex;\r\n\tjustify-content: center;\r\n\talign-items: center;\r\n\tposition: relative;\r\n\tfill: currentColor;\r\n\tcolor: inherit;\r\n\tfont-size: inherit;\r\n}\r\n\r\n/* 遮罩层样式 */\r\n.pops-mask {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\tleft: 0;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\tborder: 0;\r\n\tborder-radius: 0;\r\n\tbackground-color: rgba(0, 0, 0, var(--pops-mask-bg-opacity));\r\n\tbox-shadow: none;\r\n\ttransition: none;\r\n}\r\n\r\n.pops-header-controls button.pops-header-control[type][data-header] {\r\n\tfloat: right;\r\n\tmargin: 0 0;\r\n\toutline: 0;\r\n\tborder: 0;\r\n\tborder-color: rgb(136, 136, 136, var(--pops-bd-opacity));\r\n\tbackground-color: transparent;\r\n\tcolor: #888;\r\n\tcursor: pointer;\r\n}\r\n.pops-header-controls button.pops-header-control[type=\"max\"],\r\n.pops-header-controls button.pops-header-control[type=\"mise\"],\r\n.pops-header-controls button.pops-header-control[type=\"min\"] {\r\n\tposition: relative;\r\n\tfloat: right;\r\n\tmargin: 0 2px;\r\n\toutline: 0 !important;\r\n\tborder: 0;\r\n\tborder-color: rgb(136, 136, 136, var(--pops-bd-opacity));\r\n\tbackground-color: transparent;\r\n\tcolor: rgb(136, 136, 136);\r\n\tcursor: pointer;\r\n\ttransition: all 0.3s ease-in-out;\r\n}\r\nbutton.pops-header-control i {\r\n\tcolor: rgb(144, 147, 153);\r\n\tfont-size: inherit;\r\n\tdisplay: inline-flex;\r\n\tjustify-content: center;\r\n\talign-items: center;\r\n\tposition: relative;\r\n\tfill: currentColor;\r\n}\r\nbutton.pops-header-control svg {\r\n\theight: 1.25em;\r\n\twidth: 1.25em;\r\n}\r\nbutton.pops-header-control {\r\n\tright: 15px;\r\n\tpadding: 0;\r\n\tborder: none;\r\n\toutline: 0;\r\n\tbackground: 0 0;\r\n\tcursor: pointer;\r\n\tposition: unset;\r\n\tline-height: 1.15;\r\n}\r\nbutton.pops-header-control i:hover {\r\n\tcolor: rgb(64, 158, 255);\r\n}\r\n.pops-header-controls[data-margin] button.pops-header-control {\r\n\tmargin: 0 6px;\r\n}\r\n.pops[type-value] .pops-header-controls {\r\n\tdisplay: flex;\r\n}\r\n\r\n/* 标题禁止选中文字 */\r\n.pops [class^=\"pops\"][class*=\"-title\"] p[pops] {\r\n\t-webkit-user-select: none;\r\n\t-moz-user-select: none;\r\n\t-ms-user-select: none;\r\n\tuser-select: none;\r\n}\r\n";
|
|
3621
2255
|
|
|
3622
2256
|
var ninePalaceGridPositionCSS = ".pops[position=\"top_left\"] {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tleft: 0;\r\n}\r\n.pops[position=\"top\"] {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tleft: 50%;\r\n\ttransform: translateX(-50%);\r\n}\r\n.pops[position=\"top_right\"] {\r\n\tposition: fixed;\r\n\ttop: 0;\r\n\tright: 0;\r\n}\r\n.pops[position=\"center_left\"] {\r\n\tposition: fixed;\r\n\ttop: 50%;\r\n\tleft: 0;\r\n\ttransform: translateY(-50%);\r\n}\r\n.pops[position=\"center\"] {\r\n\tposition: fixed;\r\n\ttop: 50%;\r\n\tleft: 50%;\r\n\ttransform: translate(-50%, -50%);\r\n}\r\n.pops[position=\"center_right\"] {\r\n\tposition: fixed;\r\n\ttop: 50%;\r\n\tright: 0;\r\n\ttransform: translateY(-50%);\r\n}\r\n.pops[position=\"bottom_left\"] {\r\n\tposition: fixed;\r\n\tbottom: 0;\r\n\tleft: 0;\r\n}\r\n.pops[position=\"bottom\"] {\r\n\tposition: fixed;\r\n\tbottom: 0;\r\n\tleft: 50%;\r\n\ttransform: translate(-50%, 0);\r\n}\r\n.pops[position=\"bottom_right\"] {\r\n\tposition: fixed;\r\n\tright: 0;\r\n\tbottom: 0;\r\n}\r\n";
|
|
3623
2257
|
|
|
@@ -8131,7 +6765,7 @@ define((function () { 'use strict';
|
|
|
8131
6765
|
setPanEvent() {
|
|
8132
6766
|
const AnyTouch = popsUtils.AnyTouch();
|
|
8133
6767
|
this.$tooltip = new AnyTouch(this.$ele.button, {
|
|
8134
|
-
|
|
6768
|
+
preventDefault() {
|
|
8135
6769
|
return false;
|
|
8136
6770
|
},
|
|
8137
6771
|
});
|
|
@@ -10294,7 +8928,7 @@ define((function () { 'use strict';
|
|
|
10294
8928
|
*/
|
|
10295
8929
|
async function liElementClickEvent(clickEvent) {
|
|
10296
8930
|
if (typeof item.callback === "function") {
|
|
10297
|
-
OriginPrototype
|
|
8931
|
+
OriginPrototype.Object.defineProperty(menuEvent, "target", {
|
|
10298
8932
|
get() {
|
|
10299
8933
|
return menuEventTarget;
|
|
10300
8934
|
},
|
|
@@ -10937,7 +9571,7 @@ define((function () { 'use strict';
|
|
|
10937
9571
|
/** 配置 */
|
|
10938
9572
|
config = {
|
|
10939
9573
|
/** 版本号 */
|
|
10940
|
-
version: "2024.10.
|
|
9574
|
+
version: "2024.10.19",
|
|
10941
9575
|
cssText: {
|
|
10942
9576
|
/** 主CSS */
|
|
10943
9577
|
index: indexCSS,
|