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