@component-hook/picker 0.1.5 → 0.2.0-alpha.0
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/README.md +108 -17
- package/dist/react/index.css +1 -0
- package/dist/react/picker.es.d.ts +60 -0
- package/dist/react/picker.es.js +3797 -0
- package/dist/react/picker.umd.js +71 -0
- package/dist/vue/index.css +1 -0
- package/dist/{index.d.ts → vue/picker.es.d.ts} +21 -19
- package/dist/{picker.es.js → vue/picker.es.js} +415 -424
- package/dist/{picker.umd.js → vue/picker.umd.js} +4 -4
- package/package.json +21 -12
- package/dist/index.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import { ref as L, computed as
|
|
2
|
+
import { ref as L, computed as b, watch as ht, nextTick as ne, defineComponent as se, openBlock as W, createElementBlock as z, createVNode as Pt, Transition as Et, withCtx as Ct, withDirectives as Dt, createElementVNode as S, unref as D, vShow as Bt, normalizeClass as ct, normalizeStyle as ut, toDisplayString as j, Fragment as xt, renderList as At } from "vue";
|
|
3
3
|
/*!
|
|
4
4
|
* better-scroll / core
|
|
5
5
|
* (c) 2016-2023 ustbhuangyi
|
|
@@ -19,15 +19,15 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
19
19
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
20
20
|
PERFORMANCE OF THIS SOFTWARE.
|
|
21
21
|
***************************************************************************** */
|
|
22
|
-
var
|
|
23
|
-
return
|
|
22
|
+
var yt = function(o, t) {
|
|
23
|
+
return yt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
24
24
|
e.__proto__ = r;
|
|
25
25
|
} || function(e, r) {
|
|
26
26
|
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
27
|
-
},
|
|
27
|
+
}, yt(o, t);
|
|
28
28
|
};
|
|
29
29
|
function rt(o, t) {
|
|
30
|
-
|
|
30
|
+
yt(o, t);
|
|
31
31
|
function e() {
|
|
32
32
|
this.constructor = o;
|
|
33
33
|
}
|
|
@@ -49,7 +49,7 @@ function Kt() {
|
|
|
49
49
|
r[i] = n[s];
|
|
50
50
|
return r;
|
|
51
51
|
}
|
|
52
|
-
var
|
|
52
|
+
var ae = [
|
|
53
53
|
{
|
|
54
54
|
sourceKey: "scroller.scrollBehaviorX.currentPos",
|
|
55
55
|
key: "x"
|
|
@@ -138,9 +138,9 @@ var ce = [
|
|
|
138
138
|
function Q(o) {
|
|
139
139
|
console.error("[BScroll warn]: " + o);
|
|
140
140
|
}
|
|
141
|
-
var
|
|
142
|
-
if (typeof
|
|
143
|
-
var o = /os (\d\d?_\d(_\d)?)/, t = o.exec(
|
|
141
|
+
var w = typeof window < "u", F = w && navigator.userAgent.toLowerCase(), le = !!(F && /wechatdevtools/.test(F)), he = F && F.indexOf("android") > 0, ce = function() {
|
|
142
|
+
if (typeof F == "string") {
|
|
143
|
+
var o = /os (\d\d?_\d(_\d)?)/, t = o.exec(F);
|
|
144
144
|
if (!t)
|
|
145
145
|
return !1;
|
|
146
146
|
var e = t[1].split("_").map(function(r) {
|
|
@@ -149,36 +149,36 @@ var E = typeof window < "u", W = E && navigator.userAgent.toLowerCase(), he = !!
|
|
|
149
149
|
return e[0] === 13 && e[1] >= 4;
|
|
150
150
|
}
|
|
151
151
|
return !1;
|
|
152
|
-
}(),
|
|
153
|
-
if (
|
|
154
|
-
var
|
|
152
|
+
}(), Rt = !1;
|
|
153
|
+
if (w) {
|
|
154
|
+
var ue = "test-passive";
|
|
155
155
|
try {
|
|
156
|
-
var
|
|
157
|
-
Object.defineProperty(
|
|
156
|
+
var Yt = {};
|
|
157
|
+
Object.defineProperty(Yt, "passive", {
|
|
158
158
|
get: function() {
|
|
159
|
-
|
|
159
|
+
Rt = !0;
|
|
160
160
|
}
|
|
161
|
-
}), window.addEventListener(
|
|
162
|
-
},
|
|
161
|
+
}), window.addEventListener(ue, function() {
|
|
162
|
+
}, Yt);
|
|
163
163
|
} catch {
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function X() {
|
|
167
167
|
return window.performance && window.performance.now && window.performance.timing ? window.performance.now() + window.performance.timing.navigationStart : +/* @__PURE__ */ new Date();
|
|
168
168
|
}
|
|
169
|
-
var
|
|
169
|
+
var gt = function(o, t) {
|
|
170
170
|
for (var e in t)
|
|
171
171
|
o[e] = t[e];
|
|
172
172
|
return o;
|
|
173
173
|
};
|
|
174
|
-
function
|
|
174
|
+
function kt(o) {
|
|
175
175
|
return o == null;
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function Mt(o, t, e) {
|
|
178
178
|
return o < t ? t : o > e ? e : o;
|
|
179
179
|
}
|
|
180
|
-
var
|
|
181
|
-
if (!
|
|
180
|
+
var St = w && document.createElement("div").style, I = function() {
|
|
181
|
+
if (!w)
|
|
182
182
|
return !1;
|
|
183
183
|
for (var o = [
|
|
184
184
|
{
|
|
@@ -203,33 +203,33 @@ var kt = E && document.createElement("div").style, H = function() {
|
|
|
203
203
|
}
|
|
204
204
|
], t = 0, e = o; t < e.length; t++) {
|
|
205
205
|
var r = e[t];
|
|
206
|
-
if (
|
|
206
|
+
if (St[r.value] !== void 0)
|
|
207
207
|
return r.key;
|
|
208
208
|
}
|
|
209
209
|
return !1;
|
|
210
210
|
}();
|
|
211
|
-
function
|
|
212
|
-
return
|
|
211
|
+
function E(o) {
|
|
212
|
+
return I === !1 ? o : I === "standard" ? o === "transitionEnd" ? "transitionend" : o : I + o.charAt(0).toUpperCase() + o.substr(1);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Vt(o) {
|
|
215
215
|
return typeof o == "string" ? document.querySelector(o) : o;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
var i =
|
|
217
|
+
function pe(o, t, e, r) {
|
|
218
|
+
var i = Rt ? {
|
|
219
219
|
passive: !1,
|
|
220
220
|
capture: !!r
|
|
221
221
|
} : !!r;
|
|
222
222
|
o.addEventListener(t, e, i);
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function fe(o, t, e, r) {
|
|
225
225
|
o.removeEventListener(t, e, {
|
|
226
226
|
capture: !!r
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function $t(o) {
|
|
230
230
|
o.cancelable && o.preventDefault();
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function Xt(o) {
|
|
233
233
|
for (var t = 0, e = 0; o; )
|
|
234
234
|
t -= o.offsetLeft, e -= o.offsetTop, o = o.offsetParent;
|
|
235
235
|
return {
|
|
@@ -237,17 +237,17 @@ function Yt(o) {
|
|
|
237
237
|
top: e
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
|
-
|
|
241
|
-
var
|
|
242
|
-
transform:
|
|
243
|
-
transition:
|
|
244
|
-
transitionTimingFunction:
|
|
245
|
-
transitionDuration:
|
|
246
|
-
transitionDelay:
|
|
247
|
-
transformOrigin:
|
|
248
|
-
transitionEnd:
|
|
249
|
-
transitionProperty:
|
|
250
|
-
},
|
|
240
|
+
I && I !== "standard" && "" + I.toLowerCase();
|
|
241
|
+
var ve = E("transform"), jt = E("transition"), de = w && E("perspective") in St, Ot = w && ("ontouchstart" in window || le), me = w && jt in St, M = {
|
|
242
|
+
transform: ve,
|
|
243
|
+
transition: jt,
|
|
244
|
+
transitionTimingFunction: E("transitionTimingFunction"),
|
|
245
|
+
transitionDuration: E("transitionDuration"),
|
|
246
|
+
transitionDelay: E("transitionDelay"),
|
|
247
|
+
transformOrigin: E("transformOrigin"),
|
|
248
|
+
transitionEnd: E("transitionEnd"),
|
|
249
|
+
transitionProperty: E("transitionProperty")
|
|
250
|
+
}, pt = {
|
|
251
251
|
touchstart: 1,
|
|
252
252
|
touchmove: 1,
|
|
253
253
|
touchend: 1,
|
|
@@ -256,7 +256,7 @@ var me = D("transform"), $t = D("transition"), ye = E && D("perspective") in kt,
|
|
|
256
256
|
mousemove: 2,
|
|
257
257
|
mouseup: 2
|
|
258
258
|
};
|
|
259
|
-
function
|
|
259
|
+
function _t(o) {
|
|
260
260
|
if (o instanceof window.SVGElement) {
|
|
261
261
|
var t = o.getBoundingClientRect();
|
|
262
262
|
return {
|
|
@@ -273,32 +273,32 @@ function Xt(o) {
|
|
|
273
273
|
height: o.offsetHeight
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function K(o, t) {
|
|
277
277
|
for (var e in t)
|
|
278
278
|
if (t[e].test(o[e]))
|
|
279
279
|
return !0;
|
|
280
280
|
return !1;
|
|
281
281
|
}
|
|
282
|
-
var
|
|
283
|
-
function
|
|
282
|
+
var ye = K;
|
|
283
|
+
function ge(o, t) {
|
|
284
284
|
var e = document.createEvent("Event");
|
|
285
285
|
e.initEvent(t, !0, !0), e.pageX = o.pageX, e.pageY = o.pageY, o.target.dispatchEvent(e);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function Ut(o, t) {
|
|
288
288
|
t === void 0 && (t = "click");
|
|
289
289
|
var e;
|
|
290
290
|
o.type === "mouseup" ? e = o : (o.type === "touchend" || o.type === "touchcancel") && (e = o.changedTouches[0]);
|
|
291
291
|
var r = {};
|
|
292
292
|
e && (r.screenX = e.screenX || 0, r.screenY = e.screenY || 0, r.clientX = e.clientX || 0, r.clientY = e.clientY || 0);
|
|
293
|
-
var i, n = !0, s = !0, l = o.ctrlKey,
|
|
293
|
+
var i, n = !0, s = !0, l = o.ctrlKey, h = o.shiftKey, a = o.altKey, c = o.metaKey, u = {
|
|
294
294
|
ctrlKey: l,
|
|
295
|
-
shiftKey:
|
|
295
|
+
shiftKey: h,
|
|
296
296
|
altKey: a,
|
|
297
|
-
metaKey:
|
|
297
|
+
metaKey: c
|
|
298
298
|
};
|
|
299
299
|
if (typeof MouseEvent < "u")
|
|
300
300
|
try {
|
|
301
|
-
i = new MouseEvent(t,
|
|
301
|
+
i = new MouseEvent(t, gt(N({
|
|
302
302
|
bubbles: n,
|
|
303
303
|
cancelable: s
|
|
304
304
|
}, u), r));
|
|
@@ -308,14 +308,14 @@ function jt(o, t) {
|
|
|
308
308
|
else
|
|
309
309
|
v();
|
|
310
310
|
function v() {
|
|
311
|
-
i = document.createEvent("Event"), i.initEvent(t, n, s),
|
|
311
|
+
i = document.createEvent("Event"), i.initEvent(t, n, s), gt(i, r);
|
|
312
312
|
}
|
|
313
313
|
i.forwardedTouchEvent = !0, i._constructed = !0, o.target.dispatchEvent(i);
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
|
|
315
|
+
function ke(o) {
|
|
316
|
+
Ut(o, "dblclick");
|
|
317
317
|
}
|
|
318
|
-
var
|
|
318
|
+
var Y = {
|
|
319
319
|
// easeOutQuint
|
|
320
320
|
swipe: {
|
|
321
321
|
style: "cubic-bezier(0.23, 1, 0.32, 1)",
|
|
@@ -337,25 +337,25 @@ var X = {
|
|
|
337
337
|
return 1 - --o * o * o * o;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
},
|
|
341
|
-
function
|
|
340
|
+
}, Te = 1e3 / 60, B = w && window;
|
|
341
|
+
function qt() {
|
|
342
342
|
}
|
|
343
|
-
var
|
|
344
|
-
return
|
|
343
|
+
var Gt = function() {
|
|
344
|
+
return w ? B.requestAnimationFrame || B.webkitRequestAnimationFrame || B.mozRequestAnimationFrame || B.oRequestAnimationFrame || // if all else fails, use setTimeout
|
|
345
345
|
function(o) {
|
|
346
|
-
return window.setTimeout(o, o.interval ||
|
|
347
|
-
} :
|
|
348
|
-
}(),
|
|
349
|
-
return
|
|
346
|
+
return window.setTimeout(o, o.interval || Te);
|
|
347
|
+
} : qt;
|
|
348
|
+
}(), O = function() {
|
|
349
|
+
return w ? B.cancelAnimationFrame || B.webkitCancelAnimationFrame || B.mozCancelAnimationFrame || B.oCancelAnimationFrame || function(o) {
|
|
350
350
|
window.clearTimeout(o);
|
|
351
|
-
} :
|
|
352
|
-
}(),
|
|
353
|
-
},
|
|
351
|
+
} : qt;
|
|
352
|
+
}(), Lt = function(o) {
|
|
353
|
+
}, ft = {
|
|
354
354
|
enumerable: !0,
|
|
355
355
|
configurable: !0,
|
|
356
|
-
get:
|
|
357
|
-
set:
|
|
358
|
-
},
|
|
356
|
+
get: Lt,
|
|
357
|
+
set: Lt
|
|
358
|
+
}, Se = function(o, t) {
|
|
359
359
|
for (var e = t.split("."), r = 0; r < e.length - 1; r++)
|
|
360
360
|
if (o = o[e[r]], typeof o != "object" || !o)
|
|
361
361
|
return;
|
|
@@ -363,19 +363,19 @@ var qt = function() {
|
|
|
363
363
|
return typeof o[i] == "function" ? function() {
|
|
364
364
|
return o[i].apply(o, arguments);
|
|
365
365
|
} : o[i];
|
|
366
|
-
},
|
|
366
|
+
}, be = function(o, t, e) {
|
|
367
367
|
for (var r = t.split("."), i, n = 0; n < r.length - 1; n++)
|
|
368
368
|
i = r[n], o[i] || (o[i] = {}), o = o[i];
|
|
369
369
|
o[r.pop()] = e;
|
|
370
370
|
};
|
|
371
|
-
function
|
|
372
|
-
|
|
373
|
-
return
|
|
374
|
-
},
|
|
375
|
-
|
|
376
|
-
}, Object.defineProperty(o, e,
|
|
371
|
+
function we(o, t, e) {
|
|
372
|
+
ft.get = function() {
|
|
373
|
+
return Se(this, t);
|
|
374
|
+
}, ft.set = function(i) {
|
|
375
|
+
be(this, t, i);
|
|
376
|
+
}, Object.defineProperty(o, e, ft);
|
|
377
377
|
}
|
|
378
|
-
var
|
|
378
|
+
var x = (
|
|
379
379
|
/** @class */
|
|
380
380
|
function() {
|
|
381
381
|
function o(t) {
|
|
@@ -390,9 +390,9 @@ var Y = (
|
|
|
390
390
|
for (var s = [], l = 0; l < arguments.length; l++)
|
|
391
391
|
s[l] = arguments[l];
|
|
392
392
|
i.off(t, n);
|
|
393
|
-
var
|
|
394
|
-
if (
|
|
395
|
-
return
|
|
393
|
+
var h = e.apply(r, s);
|
|
394
|
+
if (h === !0)
|
|
395
|
+
return h;
|
|
396
396
|
};
|
|
397
397
|
return n.fn = e, this.on(t, n), this;
|
|
398
398
|
}, o.prototype.off = function(t, e) {
|
|
@@ -414,9 +414,9 @@ var Y = (
|
|
|
414
414
|
this.hasType(t);
|
|
415
415
|
var i = this.events[t];
|
|
416
416
|
if (i)
|
|
417
|
-
for (var n = i.length, s = Kt(i), l,
|
|
418
|
-
var a = s[
|
|
419
|
-
if (
|
|
417
|
+
for (var n = i.length, s = Kt(i), l, h = 0; h < n; h++) {
|
|
418
|
+
var a = s[h], c = a[0], u = a[1];
|
|
419
|
+
if (c && (l = c.apply(u, e), l === !0))
|
|
420
420
|
return l;
|
|
421
421
|
}
|
|
422
422
|
}, o.prototype.registerType = function(t) {
|
|
@@ -442,9 +442,9 @@ var Y = (
|
|
|
442
442
|
return o.prototype.destroy = function() {
|
|
443
443
|
this.removeDOMEvents(), this.events = [];
|
|
444
444
|
}, o.prototype.addDOMEvents = function() {
|
|
445
|
-
this.handleDOMEvents(
|
|
445
|
+
this.handleDOMEvents(pe);
|
|
446
446
|
}, o.prototype.removeDOMEvents = function() {
|
|
447
|
-
this.handleDOMEvents(
|
|
447
|
+
this.handleDOMEvents(fe);
|
|
448
448
|
}, o.prototype.handleDOMEvents = function(t) {
|
|
449
449
|
var e = this, r = this.wrapper;
|
|
450
450
|
this.events.forEach(function(i) {
|
|
@@ -457,14 +457,14 @@ var Y = (
|
|
|
457
457
|
});
|
|
458
458
|
}, o;
|
|
459
459
|
}()
|
|
460
|
-
),
|
|
460
|
+
), Pe = (
|
|
461
461
|
/** @class */
|
|
462
462
|
/* @__PURE__ */ function() {
|
|
463
463
|
function o() {
|
|
464
464
|
}
|
|
465
465
|
return o;
|
|
466
466
|
}()
|
|
467
|
-
),
|
|
467
|
+
), Ee = (
|
|
468
468
|
/** @class */
|
|
469
469
|
function(o) {
|
|
470
470
|
rt(t, o);
|
|
@@ -479,7 +479,7 @@ var Y = (
|
|
|
479
479
|
tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/
|
|
480
480
|
}, e.tagException = {
|
|
481
481
|
tagName: /^TEXTAREA$/
|
|
482
|
-
}, e.HWCompositing = !0, e.useTransition = !0, e.bindToWrapper = !1, e.bindToTarget = !1, e.disableMouse =
|
|
482
|
+
}, e.HWCompositing = !0, e.useTransition = !0, e.bindToWrapper = !1, e.bindToTarget = !1, e.disableMouse = Ot, e.disableTouch = !Ot, e.autoBlur = !0, e.autoEndDistance = 5, e.outOfBoundaryDampingFactor = 1 / 3, e.specifiedIndexAsContent = 0, e.quadrant = 1, e;
|
|
483
483
|
}
|
|
484
484
|
return t.prototype.merge = function(e) {
|
|
485
485
|
if (!e)
|
|
@@ -493,7 +493,7 @@ var Y = (
|
|
|
493
493
|
}
|
|
494
494
|
return this;
|
|
495
495
|
}, t.prototype.process = function() {
|
|
496
|
-
return this.translateZ = this.HWCompositing &&
|
|
496
|
+
return this.translateZ = this.HWCompositing && de ? " translateZ(1px)" : "", this.useTransition = this.useTransition && me, this.preventDefault = !this.eventPassthrough && this.preventDefault, this.scrollX = this.eventPassthrough === "horizontal" ? !1 : this.scrollX, this.scrollY = this.eventPassthrough === "vertical" ? !1 : this.scrollY, this.freeScroll = this.freeScroll && !this.eventPassthrough, this.scrollX = this.freeScroll ? !0 : this.scrollX, this.scrollY = this.freeScroll ? !0 : this.scrollY, this.directionLockThreshold = this.eventPassthrough ? 0 : this.directionLockThreshold, this;
|
|
497
497
|
}, t.prototype.resolveBounce = function(e) {
|
|
498
498
|
var r = {
|
|
499
499
|
top: !0,
|
|
@@ -506,14 +506,14 @@ var Y = (
|
|
|
506
506
|
bottom: !1,
|
|
507
507
|
left: !1
|
|
508
508
|
}, n;
|
|
509
|
-
return typeof e == "object" ? n =
|
|
509
|
+
return typeof e == "object" ? n = gt(r, e) : n = e ? r : i, n;
|
|
510
510
|
}, t;
|
|
511
|
-
}(
|
|
512
|
-
),
|
|
511
|
+
}(Pe)
|
|
512
|
+
), Ce = (
|
|
513
513
|
/** @class */
|
|
514
514
|
function() {
|
|
515
515
|
function o(t, e) {
|
|
516
|
-
this.wrapper = t, this.options = e, this.hooks = new
|
|
516
|
+
this.wrapper = t, this.options = e, this.hooks = new x([
|
|
517
517
|
"beforeStart",
|
|
518
518
|
"start",
|
|
519
519
|
"move",
|
|
@@ -522,12 +522,12 @@ var Y = (
|
|
|
522
522
|
]), this.handleDOMEvents();
|
|
523
523
|
}
|
|
524
524
|
return o.prototype.handleDOMEvents = function() {
|
|
525
|
-
var t = this.options, e = t.bindToWrapper, r = t.disableMouse, i = t.disableTouch, n = t.click, s = this.wrapper, l = e ? s : window,
|
|
526
|
-
n &&
|
|
525
|
+
var t = this.options, e = t.bindToWrapper, r = t.disableMouse, i = t.disableTouch, n = t.click, s = this.wrapper, l = e ? s : window, h = [], a = [], c = !i, u = !r;
|
|
526
|
+
n && h.push({
|
|
527
527
|
name: "click",
|
|
528
528
|
handler: this.click.bind(this),
|
|
529
529
|
capture: !0
|
|
530
|
-
}),
|
|
530
|
+
}), c && (h.push({
|
|
531
531
|
name: "touchstart",
|
|
532
532
|
handler: this.start.bind(this)
|
|
533
533
|
}), a.push({
|
|
@@ -539,7 +539,7 @@ var Y = (
|
|
|
539
539
|
}, {
|
|
540
540
|
name: "touchcancel",
|
|
541
541
|
handler: this.end.bind(this)
|
|
542
|
-
})), u && (
|
|
542
|
+
})), u && (h.push({
|
|
543
543
|
name: "mousedown",
|
|
544
544
|
handler: this.start.bind(this)
|
|
545
545
|
}), a.push({
|
|
@@ -548,14 +548,14 @@ var Y = (
|
|
|
548
548
|
}, {
|
|
549
549
|
name: "mouseup",
|
|
550
550
|
handler: this.end.bind(this)
|
|
551
|
-
})), this.wrapperEventRegister = new tt(s,
|
|
551
|
+
})), this.wrapperEventRegister = new tt(s, h), this.targetEventRegister = new tt(l, a);
|
|
552
552
|
}, o.prototype.beforeHandler = function(t, e) {
|
|
553
553
|
var r = this.options, i = r.preventDefault, n = r.stopPropagation, s = r.preventDefaultException, l = {
|
|
554
554
|
start: function() {
|
|
555
|
-
return i && !
|
|
555
|
+
return i && !K(t.target, s);
|
|
556
556
|
},
|
|
557
557
|
end: function() {
|
|
558
|
-
return i && !
|
|
558
|
+
return i && !K(t.target, s);
|
|
559
559
|
},
|
|
560
560
|
move: function() {
|
|
561
561
|
return i;
|
|
@@ -565,9 +565,9 @@ var Y = (
|
|
|
565
565
|
}, o.prototype.setInitiated = function(t) {
|
|
566
566
|
t === void 0 && (t = 0), this.initiated = t;
|
|
567
567
|
}, o.prototype.start = function(t) {
|
|
568
|
-
var e =
|
|
568
|
+
var e = pt[t.type];
|
|
569
569
|
if (!(this.initiated && this.initiated !== e)) {
|
|
570
|
-
if (this.setInitiated(e),
|
|
570
|
+
if (this.setInitiated(e), ye(t.target, this.options.tagException)) {
|
|
571
571
|
this.setInitiated();
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
@@ -578,7 +578,7 @@ var Y = (
|
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
}, o.prototype.move = function(t) {
|
|
581
|
-
if (
|
|
581
|
+
if (pt[t.type] === this.initiated) {
|
|
582
582
|
this.beforeHandler(t, "move");
|
|
583
583
|
var e = t.touches ? t.touches[0] : t, r = e.pageX - this.pointX, i = e.pageY - this.pointY;
|
|
584
584
|
if (this.pointX = e.pageX, this.pointY = e.pageY, !this.hooks.trigger(this.hooks.eventTypes.move, {
|
|
@@ -586,12 +586,12 @@ var Y = (
|
|
|
586
586
|
deltaY: i,
|
|
587
587
|
e: t
|
|
588
588
|
})) {
|
|
589
|
-
var n = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft, s = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop, l = this.pointX - n,
|
|
590
|
-
(l > document.documentElement.clientWidth - a ||
|
|
589
|
+
var n = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft, s = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop, l = this.pointX - n, h = this.pointY - s, a = this.options.autoEndDistance;
|
|
590
|
+
(l > document.documentElement.clientWidth - a || h > document.documentElement.clientHeight - a || l < a || h < a) && this.end(t);
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
593
|
}, o.prototype.end = function(t) {
|
|
594
|
-
|
|
594
|
+
pt[t.type] === this.initiated && (this.setInitiated(), this.beforeHandler(t, "end"), this.hooks.trigger(this.hooks.eventTypes.end, t));
|
|
595
595
|
}, o.prototype.click = function(t) {
|
|
596
596
|
this.hooks.trigger(this.hooks.eventTypes.click, t);
|
|
597
597
|
}, o.prototype.setContent = function(t) {
|
|
@@ -602,17 +602,17 @@ var Y = (
|
|
|
602
602
|
this.wrapperEventRegister.destroy(), this.targetEventRegister.destroy(), this.hooks.destroy();
|
|
603
603
|
}, o;
|
|
604
604
|
}()
|
|
605
|
-
),
|
|
605
|
+
), vt = {
|
|
606
606
|
x: ["translateX", "px"],
|
|
607
607
|
y: ["translateY", "px"]
|
|
608
|
-
},
|
|
608
|
+
}, De = (
|
|
609
609
|
/** @class */
|
|
610
610
|
function() {
|
|
611
611
|
function o(t) {
|
|
612
|
-
this.setContent(t), this.hooks = new
|
|
612
|
+
this.setContent(t), this.hooks = new x(["beforeTranslate", "translate"]);
|
|
613
613
|
}
|
|
614
614
|
return o.prototype.getComputedPosition = function() {
|
|
615
|
-
var t = window.getComputedStyle(this.content, null), e = t[
|
|
615
|
+
var t = window.getComputedStyle(this.content, null), e = t[M.transform].split(")")[0].split(", "), r = +(e[12] || e[4]) || 0, i = +(e[13] || e[5]) || 0;
|
|
616
616
|
return {
|
|
617
617
|
x: r,
|
|
618
618
|
y: i
|
|
@@ -620,25 +620,25 @@ var Y = (
|
|
|
620
620
|
}, o.prototype.translate = function(t) {
|
|
621
621
|
var e = [];
|
|
622
622
|
Object.keys(t).forEach(function(r) {
|
|
623
|
-
if (
|
|
624
|
-
var i =
|
|
623
|
+
if (vt[r]) {
|
|
624
|
+
var i = vt[r][0];
|
|
625
625
|
if (i) {
|
|
626
|
-
var n =
|
|
626
|
+
var n = vt[r][1], s = t[r];
|
|
627
627
|
e.push(i + "(" + s + n + ")");
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
}), this.hooks.trigger(this.hooks.eventTypes.beforeTranslate, e, t), this.style[
|
|
630
|
+
}), this.hooks.trigger(this.hooks.eventTypes.beforeTranslate, e, t), this.style[M.transform] = e.join(" "), this.hooks.trigger(this.hooks.eventTypes.translate, t);
|
|
631
631
|
}, o.prototype.setContent = function(t) {
|
|
632
632
|
this.content !== t && (this.content = t, this.style = t.style);
|
|
633
633
|
}, o.prototype.destroy = function() {
|
|
634
634
|
this.hooks.destroy();
|
|
635
635
|
}, o;
|
|
636
636
|
}()
|
|
637
|
-
),
|
|
637
|
+
), Zt = (
|
|
638
638
|
/** @class */
|
|
639
639
|
function() {
|
|
640
640
|
function o(t, e, r) {
|
|
641
|
-
this.translater = e, this.options = r, this.timer = 0, this.hooks = new
|
|
641
|
+
this.translater = e, this.options = r, this.timer = 0, this.hooks = new x([
|
|
642
642
|
"move",
|
|
643
643
|
"end",
|
|
644
644
|
"beforeForceStop",
|
|
@@ -659,18 +659,18 @@ var Y = (
|
|
|
659
659
|
}, o.prototype.setContent = function(t) {
|
|
660
660
|
this.content !== t && (this.content = t, this.style = t.style, this.stop());
|
|
661
661
|
}, o.prototype.clearTimer = function() {
|
|
662
|
-
this.timer && (
|
|
662
|
+
this.timer && (O(this.timer), this.timer = 0);
|
|
663
663
|
}, o.prototype.destroy = function() {
|
|
664
|
-
this.hooks.destroy(),
|
|
664
|
+
this.hooks.destroy(), O(this.timer);
|
|
665
665
|
}, o;
|
|
666
666
|
}()
|
|
667
|
-
),
|
|
668
|
-
var i = function(a,
|
|
669
|
-
var u = a -
|
|
667
|
+
), Be = function(o, t, e, r) {
|
|
668
|
+
var i = function(a, c) {
|
|
669
|
+
var u = a - c, v = u > 0 ? -1 : u < 0 ? 1 : 0;
|
|
670
670
|
return v;
|
|
671
|
-
}, n = i(t.x, o.x), s = i(t.y, o.y), l = e.x - r.x,
|
|
672
|
-
return n * l <= 0 && s *
|
|
673
|
-
},
|
|
671
|
+
}, n = i(t.x, o.x), s = i(t.y, o.y), l = e.x - r.x, h = e.y - r.y;
|
|
672
|
+
return n * l <= 0 && s * h <= 0;
|
|
673
|
+
}, xe = (
|
|
674
674
|
/** @class */
|
|
675
675
|
function(o) {
|
|
676
676
|
rt(t, o);
|
|
@@ -680,15 +680,15 @@ var Y = (
|
|
|
680
680
|
return t.prototype.startProbe = function(e, r) {
|
|
681
681
|
var i = this, n = e, s = function() {
|
|
682
682
|
var l = i.translater.getComputedPosition();
|
|
683
|
-
|
|
683
|
+
Be(e, r, l, n) && i.hooks.trigger(i.hooks.eventTypes.move, l), i.pending || (i.callStopWhenPending ? i.callStopWhenPending = !1 : i.hooks.trigger(i.hooks.eventTypes.end, l)), n = l, i.pending && (i.timer = Gt(s));
|
|
684
684
|
};
|
|
685
|
-
this.callStopWhenPending && this.setCallStop(!1),
|
|
685
|
+
this.callStopWhenPending && this.setCallStop(!1), O(this.timer), s();
|
|
686
686
|
}, t.prototype.transitionTime = function(e) {
|
|
687
|
-
e === void 0 && (e = 0), this.style[
|
|
687
|
+
e === void 0 && (e = 0), this.style[M.transitionDuration] = e + "ms", this.hooks.trigger(this.hooks.eventTypes.time, e);
|
|
688
688
|
}, t.prototype.transitionTimingFunction = function(e) {
|
|
689
|
-
this.style[
|
|
689
|
+
this.style[M.transitionTimingFunction] = e, this.hooks.trigger(this.hooks.eventTypes.timeFunction, e);
|
|
690
690
|
}, t.prototype.transitionProperty = function() {
|
|
691
|
-
this.style[
|
|
691
|
+
this.style[M.transitionProperty] = M.transform;
|
|
692
692
|
}, t.prototype.move = function(e, r, i, n) {
|
|
693
693
|
this.setPending(i > 0), this.transitionTimingFunction(n), this.transitionProperty(), this.transitionTime(i), this.translate(r);
|
|
694
694
|
var s = this.options.probeType === 3;
|
|
@@ -696,7 +696,7 @@ var Y = (
|
|
|
696
696
|
}, t.prototype.doStop = function() {
|
|
697
697
|
var e = this.pending;
|
|
698
698
|
if (this.setForceStopped(!1), this.setCallStop(!1), e) {
|
|
699
|
-
this.setPending(!1),
|
|
699
|
+
this.setPending(!1), O(this.timer);
|
|
700
700
|
var r = this.translater.getComputedPosition(), i = r.x, n = r.y;
|
|
701
701
|
this.transitionTime(), this.translate({ x: i, y: n }), this.setForceStopped(!0), this.setCallStop(!0), this.hooks.trigger(this.hooks.eventTypes.forceStop, { x: i, y: n });
|
|
702
702
|
}
|
|
@@ -705,8 +705,8 @@ var Y = (
|
|
|
705
705
|
var e = this.doStop();
|
|
706
706
|
e && this.hooks.trigger(this.hooks.eventTypes.callStop);
|
|
707
707
|
}, t;
|
|
708
|
-
}(
|
|
709
|
-
),
|
|
708
|
+
}(Zt)
|
|
709
|
+
), Ae = (
|
|
710
710
|
/** @class */
|
|
711
711
|
function(o) {
|
|
712
712
|
rt(t, o);
|
|
@@ -720,24 +720,24 @@ var Y = (
|
|
|
720
720
|
}
|
|
721
721
|
this.animate(e, r, i, n);
|
|
722
722
|
}, t.prototype.animate = function(e, r, i, n) {
|
|
723
|
-
var s = this, l =
|
|
724
|
-
var u =
|
|
725
|
-
if (u >=
|
|
723
|
+
var s = this, l = X(), h = l + i, a = this.options.probeType === 3, c = function() {
|
|
724
|
+
var u = X();
|
|
725
|
+
if (u >= h) {
|
|
726
726
|
s.translate(r), a && s.hooks.trigger(s.hooks.eventTypes.move, r), s.hooks.trigger(s.hooks.eventTypes.end, r);
|
|
727
727
|
return;
|
|
728
728
|
}
|
|
729
729
|
u = (u - l) / i;
|
|
730
|
-
var v = n(u),
|
|
731
|
-
Object.keys(r).forEach(function(
|
|
732
|
-
var
|
|
733
|
-
|
|
734
|
-
}), s.translate(
|
|
730
|
+
var v = n(u), g = {};
|
|
731
|
+
Object.keys(r).forEach(function(f) {
|
|
732
|
+
var y = e[f], m = r[f];
|
|
733
|
+
g[f] = (m - y) * v + y;
|
|
734
|
+
}), s.translate(g), a && s.hooks.trigger(s.hooks.eventTypes.move, g), s.pending && (s.timer = Gt(c)), s.pending || (s.callStopWhenPending ? s.callStopWhenPending = !1 : s.hooks.trigger(s.hooks.eventTypes.end, r));
|
|
735
735
|
};
|
|
736
|
-
this.setPending(!0), this.callStopWhenPending && this.setCallStop(!1),
|
|
736
|
+
this.setPending(!0), this.callStopWhenPending && this.setCallStop(!1), O(this.timer), c();
|
|
737
737
|
}, t.prototype.doStop = function() {
|
|
738
738
|
var e = this.pending;
|
|
739
739
|
if (this.setForceStopped(!1), this.setCallStop(!1), e) {
|
|
740
|
-
this.setPending(!1),
|
|
740
|
+
this.setPending(!1), O(this.timer);
|
|
741
741
|
var r = this.translater.getComputedPosition();
|
|
742
742
|
this.setForceStopped(!0), this.setCallStop(!0), this.hooks.trigger(this.hooks.eventTypes.forceStop, r);
|
|
743
743
|
}
|
|
@@ -746,9 +746,9 @@ var Y = (
|
|
|
746
746
|
var e = this.doStop();
|
|
747
747
|
e && this.hooks.trigger(this.hooks.eventTypes.callStop);
|
|
748
748
|
}, t;
|
|
749
|
-
}(
|
|
749
|
+
}(Zt)
|
|
750
750
|
);
|
|
751
|
-
function
|
|
751
|
+
function Ye(o, t, e) {
|
|
752
752
|
var r = e.useTransition, i = {};
|
|
753
753
|
return Object.defineProperty(i, "probeType", {
|
|
754
754
|
enumerable: !0,
|
|
@@ -756,13 +756,13 @@ function Xe(o, t, e) {
|
|
|
756
756
|
get: function() {
|
|
757
757
|
return e.probeType;
|
|
758
758
|
}
|
|
759
|
-
}), r ? new
|
|
759
|
+
}), r ? new xe(o, t, i) : new Ae(o, t, i);
|
|
760
760
|
}
|
|
761
|
-
var
|
|
761
|
+
var It = (
|
|
762
762
|
/** @class */
|
|
763
763
|
function() {
|
|
764
764
|
function o(t, e, r) {
|
|
765
|
-
this.wrapper = t, this.options = r, this.hooks = new
|
|
765
|
+
this.wrapper = t, this.options = r, this.hooks = new x([
|
|
766
766
|
"beforeComputeBoundary",
|
|
767
767
|
"computeBoundary",
|
|
768
768
|
"momentum",
|
|
@@ -799,19 +799,19 @@ var Ot = (
|
|
|
799
799
|
return e;
|
|
800
800
|
}, o.prototype.momentum = function(t, e, r, i, n, s, l) {
|
|
801
801
|
l === void 0 && (l = this.options);
|
|
802
|
-
var
|
|
803
|
-
destination: t + a * a /
|
|
804
|
-
duration:
|
|
802
|
+
var h = t - e, a = Math.abs(h) / r, c = l.deceleration, u = l.swipeBounceTime, v = l.swipeTime, g = Math.min(v, a * 2 / c), f = {
|
|
803
|
+
destination: t + a * a / c * (h < 0 ? -1 : 1),
|
|
804
|
+
duration: g,
|
|
805
805
|
rate: 15
|
|
806
806
|
};
|
|
807
|
-
return this.hooks.trigger(this.hooks.eventTypes.momentum,
|
|
807
|
+
return this.hooks.trigger(this.hooks.eventTypes.momentum, f, h), f.destination < i ? (f.destination = s ? Math.max(i - s / 4, i - s / f.rate * a) : i, f.duration = u) : f.destination > n && (f.destination = s ? Math.min(n + s / 4, n + s / f.rate * a) : n, f.duration = u), f.destination = Math.round(f.destination), f;
|
|
808
808
|
}, o.prototype.updateDirection = function() {
|
|
809
809
|
var t = this.currentPos - this.absStartPos;
|
|
810
810
|
this.setDirection(t);
|
|
811
811
|
}, o.prototype.refresh = function(t) {
|
|
812
|
-
var e = this.options.rect, r = e.size, i = e.position, n = window.getComputedStyle(this.wrapper, null).position === "static", s =
|
|
812
|
+
var e = this.options.rect, r = e.size, i = e.position, n = window.getComputedStyle(this.wrapper, null).position === "static", s = _t(this.wrapper);
|
|
813
813
|
this.wrapperSize = this.wrapper[r === "width" ? "clientWidth" : "clientHeight"], this.setContent(t);
|
|
814
|
-
var l =
|
|
814
|
+
var l = _t(this.content);
|
|
815
815
|
this.contentSize = l[r], this.relativeOffset = l[i], n && (this.relativeOffset -= s[i]), this.computeBoundary(), this.setDirection(
|
|
816
816
|
0
|
|
817
817
|
/* Default */
|
|
@@ -857,11 +857,11 @@ var Ot = (
|
|
|
857
857
|
this.hooks.destroy();
|
|
858
858
|
}, o;
|
|
859
859
|
}()
|
|
860
|
-
), U, q, G, Z,
|
|
860
|
+
), U, q, G, Z, Ht = (U = {}, U.yes = function(o) {
|
|
861
861
|
return !0;
|
|
862
862
|
}, U.no = function(o) {
|
|
863
|
-
return
|
|
864
|
-
}, U),
|
|
863
|
+
return $t(o), !1;
|
|
864
|
+
}, U), Me = (q = {}, q.horizontal = (G = {}, G.yes = "horizontal", G.no = "vertical", G), q.vertical = (Z = {}, Z.yes = "vertical", Z.no = "horizontal", Z), q), Xe = (
|
|
865
865
|
/** @class */
|
|
866
866
|
function() {
|
|
867
867
|
function o(t, e, r) {
|
|
@@ -879,23 +879,23 @@ var Ot = (
|
|
|
879
879
|
}, o.prototype.computeDirectionLock = function(t, e) {
|
|
880
880
|
this.directionLocked === "" && !this.freeScroll && (t > e + this.directionLockThreshold ? this.directionLocked = "horizontal" : e >= t + this.directionLockThreshold ? this.directionLocked = "vertical" : this.directionLocked = "none");
|
|
881
881
|
}, o.prototype.handleEventPassthrough = function(t) {
|
|
882
|
-
var e =
|
|
882
|
+
var e = Me[this.directionLocked];
|
|
883
883
|
if (e) {
|
|
884
884
|
if (this.eventPassthrough === e.yes)
|
|
885
|
-
return
|
|
885
|
+
return Ht.yes(t);
|
|
886
886
|
if (this.eventPassthrough === e.no)
|
|
887
|
-
return
|
|
887
|
+
return Ht.no(t);
|
|
888
888
|
}
|
|
889
889
|
return !1;
|
|
890
890
|
}, o;
|
|
891
891
|
}()
|
|
892
|
-
),
|
|
892
|
+
), Oe = function(o, t, e) {
|
|
893
893
|
return e === 2 ? [t, -o] : e === 3 ? [-o, -t] : e === 4 ? [-t, o] : [o, t];
|
|
894
|
-
},
|
|
894
|
+
}, _e = (
|
|
895
895
|
/** @class */
|
|
896
896
|
function() {
|
|
897
897
|
function o(t, e, r, i, n) {
|
|
898
|
-
this.hooks = new
|
|
898
|
+
this.hooks = new x([
|
|
899
899
|
"start",
|
|
900
900
|
"beforeMove",
|
|
901
901
|
"scrollStart",
|
|
@@ -906,7 +906,7 @@ var Ot = (
|
|
|
906
906
|
"contentNotMoved",
|
|
907
907
|
"detectMovingDirection",
|
|
908
908
|
"coordinateTransformation"
|
|
909
|
-
]), this.scrollBehaviorX = t, this.scrollBehaviorY = e, this.actionsHandler = r, this.animater = i, this.options = n, this.directionLockAction = new
|
|
909
|
+
]), this.scrollBehaviorX = t, this.scrollBehaviorY = e, this.actionsHandler = r, this.animater = i, this.options = n, this.directionLockAction = new Xe(n.directionLockThreshold, n.freeScroll, n.eventPassthrough), this.enabled = !0, this.bindActionsHandler();
|
|
910
910
|
}
|
|
911
911
|
return o.prototype.bindActionsHandler = function() {
|
|
912
912
|
var t = this;
|
|
@@ -916,9 +916,9 @@ var Ot = (
|
|
|
916
916
|
var r = e.deltaX, i = e.deltaY, n = e.e;
|
|
917
917
|
if (!t.enabled)
|
|
918
918
|
return !0;
|
|
919
|
-
var s =
|
|
919
|
+
var s = Oe(r, i, t.options.quadrant), l = s[0], h = s[1], a = {
|
|
920
920
|
deltaX: l,
|
|
921
|
-
deltaY:
|
|
921
|
+
deltaY: h
|
|
922
922
|
};
|
|
923
923
|
return t.hooks.trigger(t.hooks.eventTypes.coordinateTransformation, a), t.handleMove(a.deltaX, a.deltaY, n);
|
|
924
924
|
}), this.actionsHandler.hooks.on(this.actionsHandler.hooks.eventTypes.end, function(e) {
|
|
@@ -927,19 +927,19 @@ var Ot = (
|
|
|
927
927
|
t.enabled && !e._constructed && t.handleClick(e);
|
|
928
928
|
});
|
|
929
929
|
}, o.prototype.handleStart = function(t) {
|
|
930
|
-
var e =
|
|
930
|
+
var e = X();
|
|
931
931
|
this.fingerMoved = !1, this.contentMoved = !1, this.startTime = e, this.directionLockAction.reset(), this.scrollBehaviorX.start(), this.scrollBehaviorY.start(), this.animater.doStop(), this.scrollBehaviorX.resetStartPos(), this.scrollBehaviorY.resetStartPos(), this.hooks.trigger(this.hooks.eventTypes.start, t);
|
|
932
932
|
}, o.prototype.handleMove = function(t, e, r) {
|
|
933
933
|
if (!this.hooks.trigger(this.hooks.eventTypes.beforeMove, r)) {
|
|
934
|
-
var i = this.scrollBehaviorX.getAbsDist(t), n = this.scrollBehaviorY.getAbsDist(e), s =
|
|
934
|
+
var i = this.scrollBehaviorX.getAbsDist(t), n = this.scrollBehaviorY.getAbsDist(e), s = X();
|
|
935
935
|
if (this.checkMomentum(i, n, s))
|
|
936
936
|
return !0;
|
|
937
937
|
if (this.directionLockAction.checkMovingDirection(i, n, r))
|
|
938
938
|
return this.actionsHandler.setInitiated(), !0;
|
|
939
|
-
var l = this.directionLockAction.adjustDelta(t, e),
|
|
939
|
+
var l = this.directionLockAction.adjustDelta(t, e), h = this.scrollBehaviorX.getCurrentPos(), a = this.scrollBehaviorX.move(l.deltaX), c = this.scrollBehaviorY.getCurrentPos(), u = this.scrollBehaviorY.move(l.deltaY);
|
|
940
940
|
if (!this.hooks.trigger(this.hooks.eventTypes.detectMovingDirection)) {
|
|
941
941
|
this.fingerMoved || (this.fingerMoved = !0);
|
|
942
|
-
var v = a !==
|
|
942
|
+
var v = a !== h || u !== c;
|
|
943
943
|
!this.contentMoved && !v && this.hooks.trigger(this.hooks.eventTypes.contentNotMoved), !this.contentMoved && v && (this.contentMoved = !0, this.hooks.trigger(this.hooks.eventTypes.scrollStart)), this.contentMoved && v && (this.animater.translate({
|
|
944
944
|
x: a,
|
|
945
945
|
y: u
|
|
@@ -955,16 +955,16 @@ var Ot = (
|
|
|
955
955
|
var e = this.getCurrentPos();
|
|
956
956
|
if (this.scrollBehaviorX.updateDirection(), this.scrollBehaviorY.updateDirection(), this.hooks.trigger(this.hooks.eventTypes.end, t, e))
|
|
957
957
|
return !0;
|
|
958
|
-
e = this.ensureIntegerPos(e), this.animater.translate(e), this.endTime =
|
|
958
|
+
e = this.ensureIntegerPos(e), this.animater.translate(e), this.endTime = X();
|
|
959
959
|
var r = this.endTime - this.startTime;
|
|
960
960
|
this.hooks.trigger(this.hooks.eventTypes.scrollEnd, e, r);
|
|
961
961
|
}
|
|
962
962
|
}, o.prototype.ensureIntegerPos = function(t) {
|
|
963
963
|
this.ensuringInteger = !0;
|
|
964
|
-
var e = t.x, r = t.y, i = this.scrollBehaviorX, n = i.minScrollPos, s = i.maxScrollPos, l = this.scrollBehaviorY,
|
|
965
|
-
return e = e > 0 ? Math.ceil(e) : Math.floor(e), r = r > 0 ? Math.ceil(r) : Math.floor(r), e =
|
|
964
|
+
var e = t.x, r = t.y, i = this.scrollBehaviorX, n = i.minScrollPos, s = i.maxScrollPos, l = this.scrollBehaviorY, h = l.minScrollPos, a = l.maxScrollPos;
|
|
965
|
+
return e = e > 0 ? Math.ceil(e) : Math.floor(e), r = r > 0 ? Math.ceil(r) : Math.floor(r), e = Mt(e, s, n), r = Mt(r, a, h), { x: e, y: r };
|
|
966
966
|
}, o.prototype.handleClick = function(t) {
|
|
967
|
-
|
|
967
|
+
K(t.target, this.options.preventDefaultException) || ($t(t), t.stopPropagation());
|
|
968
968
|
}, o.prototype.getCurrentPos = function() {
|
|
969
969
|
return {
|
|
970
970
|
x: this.scrollBehaviorX.getCurrentPos(),
|
|
@@ -977,7 +977,7 @@ var Ot = (
|
|
|
977
977
|
}, o;
|
|
978
978
|
}()
|
|
979
979
|
);
|
|
980
|
-
function
|
|
980
|
+
function Le(o) {
|
|
981
981
|
var t = [
|
|
982
982
|
"click",
|
|
983
983
|
"bindToWrapper",
|
|
@@ -993,7 +993,7 @@ function He(o) {
|
|
|
993
993
|
}, {});
|
|
994
994
|
return t;
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function Ft(o, t, e, r) {
|
|
997
997
|
var i = [
|
|
998
998
|
"momentum",
|
|
999
999
|
"momentumLimitTime",
|
|
@@ -1008,7 +1008,7 @@ function Lt(o, t, e, r) {
|
|
|
1008
1008
|
}, {});
|
|
1009
1009
|
return i.scrollable = !!o[t], i.bounces = e, i.rect = r, i;
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function Tt(o, t, e) {
|
|
1012
1012
|
e.forEach(function(r) {
|
|
1013
1013
|
var i, n;
|
|
1014
1014
|
typeof r == "string" ? i = n = r : (i = r.source, n = r.target), o.on(i, function() {
|
|
@@ -1018,7 +1018,7 @@ function gt(o, t, e) {
|
|
|
1018
1018
|
});
|
|
1019
1019
|
});
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1021
|
+
function Ie(o, t) {
|
|
1022
1022
|
for (var e = Object.keys(o), r = 0, i = e; r < i.length; r++) {
|
|
1023
1023
|
var n = i[r];
|
|
1024
1024
|
if (o[n] !== t[n])
|
|
@@ -1026,11 +1026,11 @@ function Fe(o, t) {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
return !0;
|
|
1028
1028
|
}
|
|
1029
|
-
var
|
|
1029
|
+
var Wt = 1, He = (
|
|
1030
1030
|
/** @class */
|
|
1031
1031
|
function() {
|
|
1032
1032
|
function o(t, e, r) {
|
|
1033
|
-
this.wrapper = t, this.content = e, this.resizeTimeout = 0, this.hooks = new
|
|
1033
|
+
this.wrapper = t, this.content = e, this.resizeTimeout = 0, this.hooks = new x([
|
|
1034
1034
|
"beforeStart",
|
|
1035
1035
|
"beforeMove",
|
|
1036
1036
|
"beforeScrollStart",
|
|
@@ -1049,14 +1049,14 @@ var Ht = 1, We = (
|
|
|
1049
1049
|
"scrollToElement",
|
|
1050
1050
|
"beforeRefresh"
|
|
1051
1051
|
]), this.options = r;
|
|
1052
|
-
var i = this.options.bounce, n = i.left, s = i.right, l = i.top,
|
|
1053
|
-
this.scrollBehaviorX = new
|
|
1052
|
+
var i = this.options.bounce, n = i.left, s = i.right, l = i.top, h = i.bottom;
|
|
1053
|
+
this.scrollBehaviorX = new It(t, e, Ft(r, "scrollX", [n, s], {
|
|
1054
1054
|
size: "width",
|
|
1055
1055
|
position: "left"
|
|
1056
|
-
})), this.scrollBehaviorY = new
|
|
1056
|
+
})), this.scrollBehaviorY = new It(t, e, Ft(r, "scrollY", [l, h], {
|
|
1057
1057
|
size: "height",
|
|
1058
1058
|
position: "top"
|
|
1059
|
-
})), this.translater = new
|
|
1059
|
+
})), this.translater = new De(this.content), this.animater = Ye(this.content, this.translater, this.options), this.actionsHandler = new Ce(this.options.bindToTarget ? this.content : t, Le(this.options)), this.actions = new _e(this.scrollBehaviorX, this.scrollBehaviorY, this.actionsHandler, this.animater, this.options);
|
|
1060
1060
|
var a = this.resize.bind(this);
|
|
1061
1061
|
this.resizeRegister = new tt(window, [
|
|
1062
1062
|
{
|
|
@@ -1077,7 +1077,7 @@ var Ht = 1, We = (
|
|
|
1077
1077
|
}, o.prototype.registerTransitionEnd = function() {
|
|
1078
1078
|
this.transitionEndRegister = new tt(this.content, [
|
|
1079
1079
|
{
|
|
1080
|
-
name:
|
|
1080
|
+
name: M.transitionEnd,
|
|
1081
1081
|
handler: this.transitionEnd.bind(this)
|
|
1082
1082
|
}
|
|
1083
1083
|
]);
|
|
@@ -1097,7 +1097,7 @@ var Ht = 1, We = (
|
|
|
1097
1097
|
var t = this;
|
|
1098
1098
|
this.animater.hooks.on(this.animater.hooks.eventTypes.end, function(e) {
|
|
1099
1099
|
t.resetPosition(t.options.bounceTime) || (t.animater.setPending(!1), t.hooks.trigger(t.hooks.eventTypes.scrollEnd, e));
|
|
1100
|
-
}),
|
|
1100
|
+
}), Tt(this.animater.hooks, this.hooks, [
|
|
1101
1101
|
{
|
|
1102
1102
|
source: this.animater.hooks.eventTypes.move,
|
|
1103
1103
|
target: this.hooks.eventTypes.scroll
|
|
@@ -1109,7 +1109,7 @@ var Ht = 1, We = (
|
|
|
1109
1109
|
]);
|
|
1110
1110
|
}, o.prototype.bindActions = function() {
|
|
1111
1111
|
var t = this, e = this.actions;
|
|
1112
|
-
|
|
1112
|
+
Tt(e.hooks, this.hooks, [
|
|
1113
1113
|
{
|
|
1114
1114
|
source: e.hooks.eventTypes.start,
|
|
1115
1115
|
target: this.hooks.eventTypes.beforeStart
|
|
@@ -1137,7 +1137,7 @@ var Ht = 1, We = (
|
|
|
1137
1137
|
]), e.hooks.on(e.hooks.eventTypes.end, function(r, i) {
|
|
1138
1138
|
if (t.hooks.trigger(t.hooks.eventTypes.touchEnd, i), t.hooks.trigger(t.hooks.eventTypes.end, i) || !e.fingerMoved && (t.hooks.trigger(t.hooks.eventTypes.scrollCancel), t.checkClick(r)))
|
|
1139
1139
|
return !0;
|
|
1140
|
-
if (t.resetPosition(t.options.bounceTime,
|
|
1140
|
+
if (t.resetPosition(t.options.bounceTime, Y.bounce))
|
|
1141
1141
|
return t.animater.setForceStopped(!1), !0;
|
|
1142
1142
|
}), e.hooks.on(e.hooks.eventTypes.scrollEnd, function(r, i) {
|
|
1143
1143
|
var n = Math.abs(r.x - t.scrollBehaviorX.startPos), s = Math.abs(r.y - t.scrollBehaviorY.startPos);
|
|
@@ -1158,12 +1158,12 @@ var Ht = 1, We = (
|
|
|
1158
1158
|
}, o.prototype.momentum = function(t, e) {
|
|
1159
1159
|
var r = {
|
|
1160
1160
|
time: 0,
|
|
1161
|
-
easing:
|
|
1161
|
+
easing: Y.swiper,
|
|
1162
1162
|
newX: t.x,
|
|
1163
1163
|
newY: t.y
|
|
1164
1164
|
}, i = this.scrollBehaviorX.end(e), n = this.scrollBehaviorY.end(e);
|
|
1165
|
-
if (r.newX =
|
|
1166
|
-
return (r.newX > this.scrollBehaviorX.minScrollPos || r.newX < this.scrollBehaviorX.maxScrollPos || r.newY > this.scrollBehaviorY.minScrollPos || r.newY < this.scrollBehaviorY.maxScrollPos) && (r.easing =
|
|
1165
|
+
if (r.newX = kt(i.destination) ? r.newX : i.destination, r.newY = kt(n.destination) ? r.newY : n.destination, r.time = Math.max(i.duration, n.duration), this.hooks.trigger(this.hooks.eventTypes.momentum, r, this), r.newX !== t.x || r.newY !== t.y)
|
|
1166
|
+
return (r.newX > this.scrollBehaviorX.minScrollPos || r.newX < this.scrollBehaviorX.maxScrollPos || r.newY > this.scrollBehaviorY.minScrollPos || r.newY < this.scrollBehaviorY.maxScrollPos) && (r.easing = Y.swipeBounce), this.scrollTo(r.newX, r.newY, r.time, r.easing), !0;
|
|
1167
1167
|
}, o.prototype.checkClick = function(t) {
|
|
1168
1168
|
var e = {
|
|
1169
1169
|
preventClick: this.animater.forceStopped
|
|
@@ -1174,20 +1174,20 @@ var Ht = 1, We = (
|
|
|
1174
1174
|
var r = this.options.dblclick, i = !1;
|
|
1175
1175
|
if (r && this.lastClickTime) {
|
|
1176
1176
|
var n = r.delay, s = n === void 0 ? 300 : n;
|
|
1177
|
-
|
|
1177
|
+
X() - this.lastClickTime < s && (i = !0, ke(t));
|
|
1178
1178
|
}
|
|
1179
|
-
return this.options.tap &&
|
|
1179
|
+
return this.options.tap && ge(t, this.options.tap), this.options.click && !K(t.target, this.options.preventDefaultException) && Ut(t), this.lastClickTime = i ? null : X(), !0;
|
|
1180
1180
|
}
|
|
1181
1181
|
return !1;
|
|
1182
1182
|
}, o.prototype.resize = function() {
|
|
1183
1183
|
var t = this;
|
|
1184
|
-
this.actions.enabled && (
|
|
1184
|
+
this.actions.enabled && (he && (this.wrapper.scrollTop = 0), clearTimeout(this.resizeTimeout), this.resizeTimeout = window.setTimeout(function() {
|
|
1185
1185
|
t.hooks.trigger(t.hooks.eventTypes.resize);
|
|
1186
1186
|
}, this.options.resizePolling));
|
|
1187
1187
|
}, o.prototype.transitionEnd = function(t) {
|
|
1188
1188
|
if (!(t.target !== this.content || !this.animater.pending)) {
|
|
1189
1189
|
var e = this.animater;
|
|
1190
|
-
e.transitionTime(), this.resetPosition(this.options.bounceTime,
|
|
1190
|
+
e.transitionTime(), this.resetPosition(this.options.bounceTime, Y.bounce) || (this.animater.setPending(!1), this.options.probeType !== 3 && this.hooks.trigger(this.hooks.eventTypes.scrollEnd, this.getCurrentPos()));
|
|
1191
1191
|
}
|
|
1192
1192
|
}, o.prototype.togglePointerEvents = function(t) {
|
|
1193
1193
|
t === void 0 && (t = !0);
|
|
@@ -1197,40 +1197,40 @@ var Ht = 1, We = (
|
|
|
1197
1197
|
}
|
|
1198
1198
|
}, o.prototype.refresh = function(t) {
|
|
1199
1199
|
var e = this.setContent(t);
|
|
1200
|
-
this.hooks.trigger(this.hooks.eventTypes.beforeRefresh), this.scrollBehaviorX.refresh(t), this.scrollBehaviorY.refresh(t), e && (this.translater.setContent(t), this.animater.setContent(t), this.transitionEndRegister.destroy(), this.registerTransitionEnd(), this.options.bindToTarget && this.actionsHandler.setContent(t)), this.actions.refresh(), this.wrapperOffset =
|
|
1200
|
+
this.hooks.trigger(this.hooks.eventTypes.beforeRefresh), this.scrollBehaviorX.refresh(t), this.scrollBehaviorY.refresh(t), e && (this.translater.setContent(t), this.animater.setContent(t), this.transitionEndRegister.destroy(), this.registerTransitionEnd(), this.options.bindToTarget && this.actionsHandler.setContent(t)), this.actions.refresh(), this.wrapperOffset = Xt(this.wrapper);
|
|
1201
1201
|
}, o.prototype.setContent = function(t) {
|
|
1202
1202
|
var e = t !== this.content;
|
|
1203
1203
|
return e && (this.content = t), e;
|
|
1204
1204
|
}, o.prototype.scrollBy = function(t, e, r, i) {
|
|
1205
1205
|
r === void 0 && (r = 0);
|
|
1206
1206
|
var n = this.getCurrentPos(), s = n.x, l = n.y;
|
|
1207
|
-
i = i ||
|
|
1207
|
+
i = i || Y.bounce, t += s, e += l, this.scrollTo(t, e, r, i);
|
|
1208
1208
|
}, o.prototype.scrollTo = function(t, e, r, i, n) {
|
|
1209
|
-
r === void 0 && (r = 0), i === void 0 && (i =
|
|
1209
|
+
r === void 0 && (r = 0), i === void 0 && (i = Y.bounce), n === void 0 && (n = {
|
|
1210
1210
|
start: {},
|
|
1211
1211
|
end: {}
|
|
1212
1212
|
});
|
|
1213
|
-
var s = this.options.useTransition ? i.style : i.fn, l = this.getCurrentPos(),
|
|
1213
|
+
var s = this.options.useTransition ? i.style : i.fn, l = this.getCurrentPos(), h = N({ x: l.x, y: l.y }, n.start), a = N({
|
|
1214
1214
|
x: t,
|
|
1215
1215
|
y: e
|
|
1216
1216
|
}, n.end);
|
|
1217
|
-
if (this.hooks.trigger(this.hooks.eventTypes.scrollTo, a), !
|
|
1218
|
-
var
|
|
1219
|
-
|
|
1217
|
+
if (this.hooks.trigger(this.hooks.eventTypes.scrollTo, a), !Ie(h, a)) {
|
|
1218
|
+
var c = Math.abs(a.x - h.x), u = Math.abs(a.y - h.y);
|
|
1219
|
+
c < Wt && u < Wt && (r = 0, this.hooks.trigger(this.hooks.eventTypes.minDistanceScroll)), this.animater.move(h, a, r, s);
|
|
1220
1220
|
}
|
|
1221
1221
|
}, o.prototype.scrollToElement = function(t, e, r, i, n) {
|
|
1222
|
-
var s =
|
|
1223
|
-
return typeof
|
|
1222
|
+
var s = Vt(t), l = Xt(s), h = function(c, u, v) {
|
|
1223
|
+
return typeof c == "number" ? c : c ? Math.round(u / 2 - v / 2) : 0;
|
|
1224
1224
|
};
|
|
1225
|
-
r =
|
|
1226
|
-
var a = function(
|
|
1227
|
-
return
|
|
1225
|
+
r = h(r, s.offsetWidth, this.wrapper.offsetWidth), i = h(i, s.offsetHeight, this.wrapper.offsetHeight);
|
|
1226
|
+
var a = function(c, u, v, g) {
|
|
1227
|
+
return c -= u, c = g.adjustPosition(c - v), c;
|
|
1228
1228
|
};
|
|
1229
1229
|
l.left = a(l.left, this.wrapperOffset.left, r, this.scrollBehaviorX), l.top = a(l.top, this.wrapperOffset.top, i, this.scrollBehaviorY), !this.hooks.trigger(this.hooks.eventTypes.scrollToElement, s, l) && this.scrollTo(l.left, l.top, e, n);
|
|
1230
1230
|
}, o.prototype.resetPosition = function(t, e) {
|
|
1231
|
-
t === void 0 && (t = 0), e === void 0 && (e =
|
|
1232
|
-
var r = this.scrollBehaviorX.checkInBoundary(), i = r.position, n = r.inBoundary, s = this.scrollBehaviorY.checkInBoundary(), l = s.position,
|
|
1233
|
-
return n &&
|
|
1231
|
+
t === void 0 && (t = 0), e === void 0 && (e = Y.bounce);
|
|
1232
|
+
var r = this.scrollBehaviorX.checkInBoundary(), i = r.position, n = r.inBoundary, s = this.scrollBehaviorY.checkInBoundary(), l = s.position, h = s.inBoundary;
|
|
1233
|
+
return n && h ? !1 : (ce && this.reflow(), this.scrollTo(i, l, t, e), !0);
|
|
1234
1234
|
}, o.prototype.reflow = function() {
|
|
1235
1235
|
this._reflow = this.content.offsetHeight;
|
|
1236
1236
|
}, o.prototype.updatePositions = function(t) {
|
|
@@ -1240,7 +1240,7 @@ var Ht = 1, We = (
|
|
|
1240
1240
|
}, o.prototype.enable = function() {
|
|
1241
1241
|
this.actions.enabled = !0;
|
|
1242
1242
|
}, o.prototype.disable = function() {
|
|
1243
|
-
|
|
1243
|
+
O(this.animater.timer), this.actions.enabled = !1;
|
|
1244
1244
|
}, o.prototype.destroy = function() {
|
|
1245
1245
|
var t = this, e = [
|
|
1246
1246
|
"resizeRegister",
|
|
@@ -1276,8 +1276,8 @@ var Ht = 1, We = (
|
|
|
1276
1276
|
"touchEnd",
|
|
1277
1277
|
"flick",
|
|
1278
1278
|
"destroy"
|
|
1279
|
-
]) || this, n =
|
|
1280
|
-
return n ? (i.plugins = {}, i.options = new
|
|
1279
|
+
]) || this, n = Vt(e);
|
|
1280
|
+
return n ? (i.plugins = {}, i.options = new Ee().merge(r).process(), i.setContent(n).valid && (i.hooks = new x([
|
|
1281
1281
|
"refresh",
|
|
1282
1282
|
"enable",
|
|
1283
1283
|
"disable",
|
|
@@ -1290,7 +1290,7 @@ var Ht = 1, We = (
|
|
|
1290
1290
|
var r = e.pluginName, i = t.plugins.some(function(n) {
|
|
1291
1291
|
return e === n.ctor;
|
|
1292
1292
|
});
|
|
1293
|
-
return i ? t :
|
|
1293
|
+
return i ? t : kt(r) ? (Q("Plugin Class must specify plugin's name in static property by 'pluginName' field."), t) : (t.pluginsMap[r] = !0, t.plugins.push({
|
|
1294
1294
|
name: r,
|
|
1295
1295
|
applyOrder: e.applyOrder,
|
|
1296
1296
|
ctor: e
|
|
@@ -1303,9 +1303,9 @@ var Ht = 1, We = (
|
|
|
1303
1303
|
};
|
|
1304
1304
|
}, t.prototype.init = function(e) {
|
|
1305
1305
|
var r = this;
|
|
1306
|
-
this.wrapper = e, e.isBScrollContainer = !0, this.scroller = new
|
|
1306
|
+
this.wrapper = e, e.isBScrollContainer = !0, this.scroller = new He(e, this.content, this.options), this.scroller.hooks.on(this.scroller.hooks.eventTypes.resize, function() {
|
|
1307
1307
|
r.refresh();
|
|
1308
|
-
}), this.eventBubbling(), this.handleAutoBlur(), this.enable(), this.proxy(
|
|
1308
|
+
}), this.eventBubbling(), this.handleAutoBlur(), this.enable(), this.proxy(ae), this.applyPlugins(), this.refreshWithoutReset(this.content);
|
|
1309
1309
|
var i = this.options, n = i.startX, s = i.startY, l = {
|
|
1310
1310
|
x: n,
|
|
1311
1311
|
y: s
|
|
@@ -1314,8 +1314,8 @@ var Ht = 1, We = (
|
|
|
1314
1314
|
}, t.prototype.applyPlugins = function() {
|
|
1315
1315
|
var e = this, r = this.options;
|
|
1316
1316
|
t.plugins.sort(function(i, n) {
|
|
1317
|
-
var s, l = (s = {}, s.pre = -1, s.post = 1, s),
|
|
1318
|
-
return
|
|
1317
|
+
var s, l = (s = {}, s.pre = -1, s.post = 1, s), h = i.applyOrder ? l[i.applyOrder] : 0, a = n.applyOrder ? l[n.applyOrder] : 0;
|
|
1318
|
+
return h - a;
|
|
1319
1319
|
}).forEach(function(i) {
|
|
1320
1320
|
var n = i.ctor;
|
|
1321
1321
|
r[i.name] && typeof n == "function" && (e.plugins[i.name] = new n(e));
|
|
@@ -1326,7 +1326,7 @@ var Ht = 1, We = (
|
|
|
1326
1326
|
e && (e.tagName === "INPUT" || e.tagName === "TEXTAREA") && e.blur();
|
|
1327
1327
|
});
|
|
1328
1328
|
}, t.prototype.eventBubbling = function() {
|
|
1329
|
-
|
|
1329
|
+
Tt(this.scroller.hooks, this, [
|
|
1330
1330
|
this.eventTypes.beforeScrollStart,
|
|
1331
1331
|
this.eventTypes.scrollStart,
|
|
1332
1332
|
this.eventTypes.scroll,
|
|
@@ -1341,7 +1341,7 @@ var Ht = 1, We = (
|
|
|
1341
1341
|
var r = this;
|
|
1342
1342
|
e.forEach(function(i) {
|
|
1343
1343
|
var n = i.key, s = i.sourceKey;
|
|
1344
|
-
|
|
1344
|
+
we(r, s, n);
|
|
1345
1345
|
});
|
|
1346
1346
|
}, t.prototype.refresh = function() {
|
|
1347
1347
|
var e = this.setContent(this.wrapper), r = e.contentChanged, i = e.valid;
|
|
@@ -1358,22 +1358,22 @@ var Ht = 1, We = (
|
|
|
1358
1358
|
}, t.prototype.eventRegister = function(e) {
|
|
1359
1359
|
this.registerType(e);
|
|
1360
1360
|
}, t.plugins = [], t.pluginsMap = {}, t;
|
|
1361
|
-
}(
|
|
1361
|
+
}(x)
|
|
1362
1362
|
);
|
|
1363
|
-
function
|
|
1363
|
+
function R(o, t) {
|
|
1364
1364
|
var e = new it(o, t);
|
|
1365
1365
|
return e;
|
|
1366
1366
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
var
|
|
1367
|
+
R.use = it.use;
|
|
1368
|
+
R.plugins = it.plugins;
|
|
1369
|
+
R.pluginsMap = it.pluginsMap;
|
|
1370
|
+
var Fe = R;
|
|
1371
1371
|
/*!
|
|
1372
1372
|
* better-scroll / wheel
|
|
1373
1373
|
* (c) 2016-2023 ustbhuangyi
|
|
1374
1374
|
* Released under the MIT License.
|
|
1375
1375
|
*/
|
|
1376
|
-
var
|
|
1376
|
+
var V = typeof window < "u", et = V && navigator.userAgent.toLowerCase();
|
|
1377
1377
|
et && et.indexOf("android") > 0;
|
|
1378
1378
|
(function() {
|
|
1379
1379
|
if (typeof et == "string") {
|
|
@@ -1387,26 +1387,26 @@ et && et.indexOf("android") > 0;
|
|
|
1387
1387
|
}
|
|
1388
1388
|
return !1;
|
|
1389
1389
|
})();
|
|
1390
|
-
var
|
|
1391
|
-
if (
|
|
1392
|
-
var
|
|
1390
|
+
var We = !1;
|
|
1391
|
+
if (V) {
|
|
1392
|
+
var ze = "test-passive";
|
|
1393
1393
|
try {
|
|
1394
|
-
var
|
|
1395
|
-
Object.defineProperty(
|
|
1394
|
+
var zt = {};
|
|
1395
|
+
Object.defineProperty(zt, "passive", {
|
|
1396
1396
|
get: function() {
|
|
1397
|
-
|
|
1397
|
+
We = !0;
|
|
1398
1398
|
}
|
|
1399
|
-
}), window.addEventListener(
|
|
1400
|
-
},
|
|
1399
|
+
}), window.addEventListener(ze, function() {
|
|
1400
|
+
}, zt);
|
|
1401
1401
|
} catch {
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
|
-
var
|
|
1404
|
+
var Ne = function(o, t) {
|
|
1405
1405
|
for (var e in t)
|
|
1406
1406
|
o[e] = t[e];
|
|
1407
1407
|
return o;
|
|
1408
|
-
},
|
|
1409
|
-
if (
|
|
1408
|
+
}, Jt = V && document.createElement("div").style, H = function() {
|
|
1409
|
+
if (!V)
|
|
1410
1410
|
return !1;
|
|
1411
1411
|
for (var o = [
|
|
1412
1412
|
{
|
|
@@ -1431,35 +1431,35 @@ var Re = function(o, t) {
|
|
|
1431
1431
|
}
|
|
1432
1432
|
], t = 0, e = o; t < e.length; t++) {
|
|
1433
1433
|
var r = e[t];
|
|
1434
|
-
if (
|
|
1434
|
+
if (Jt[r.value] !== void 0)
|
|
1435
1435
|
return r.key;
|
|
1436
1436
|
}
|
|
1437
1437
|
return !1;
|
|
1438
1438
|
}();
|
|
1439
|
-
function
|
|
1440
|
-
return
|
|
1439
|
+
function C(o) {
|
|
1440
|
+
return H === !1 ? o : H === "standard" ? o === "transitionEnd" ? "transitionend" : o : H + o.charAt(0).toUpperCase() + o.substr(1);
|
|
1441
1441
|
}
|
|
1442
|
-
|
|
1443
|
-
var
|
|
1444
|
-
|
|
1445
|
-
var
|
|
1446
|
-
transform:
|
|
1447
|
-
transition:
|
|
1448
|
-
transitionTimingFunction:
|
|
1449
|
-
transitionDuration:
|
|
1450
|
-
transitionDelay:
|
|
1451
|
-
transformOrigin:
|
|
1452
|
-
transitionEnd:
|
|
1453
|
-
transitionProperty:
|
|
1442
|
+
H && H !== "standard" && "" + H.toLowerCase();
|
|
1443
|
+
var Ke = C("transform"), Re = C("transition");
|
|
1444
|
+
V && C("perspective") in Jt;
|
|
1445
|
+
var dt = {
|
|
1446
|
+
transform: Ke,
|
|
1447
|
+
transition: Re,
|
|
1448
|
+
transitionTimingFunction: C("transitionTimingFunction"),
|
|
1449
|
+
transitionDuration: C("transitionDuration"),
|
|
1450
|
+
transitionDelay: C("transitionDelay"),
|
|
1451
|
+
transformOrigin: C("transformOrigin"),
|
|
1452
|
+
transitionEnd: C("transitionEnd"),
|
|
1453
|
+
transitionProperty: C("transitionProperty")
|
|
1454
1454
|
};
|
|
1455
1455
|
function J(o, t) {
|
|
1456
1456
|
var e = new RegExp("(^|\\s)" + t + "(\\s|$)");
|
|
1457
1457
|
return e.test(o.className);
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1459
|
+
function Ve(o) {
|
|
1460
1460
|
return Array.prototype.slice.call(o, 0);
|
|
1461
1461
|
}
|
|
1462
|
-
var
|
|
1462
|
+
var $e = {
|
|
1463
1463
|
// easeOutQuint
|
|
1464
1464
|
swipe: {
|
|
1465
1465
|
style: "cubic-bezier(0.23, 1, 0.32, 1)",
|
|
@@ -1481,7 +1481,7 @@ var Ue = {
|
|
|
1481
1481
|
return 1 - --o * o * o * o;
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
|
-
},
|
|
1484
|
+
}, je = "plugins.wheel", Ue = [
|
|
1485
1485
|
{
|
|
1486
1486
|
key: "wheelTo",
|
|
1487
1487
|
name: "wheelTo"
|
|
@@ -1494,14 +1494,14 @@ var Ue = {
|
|
|
1494
1494
|
key: "restorePosition",
|
|
1495
1495
|
name: "restorePosition"
|
|
1496
1496
|
}
|
|
1497
|
-
],
|
|
1497
|
+
], qe = Ue.map(function(o) {
|
|
1498
1498
|
return {
|
|
1499
1499
|
key: o.key,
|
|
1500
|
-
sourceKey:
|
|
1500
|
+
sourceKey: je + "." + o.name
|
|
1501
1501
|
};
|
|
1502
|
-
}),
|
|
1502
|
+
}), Nt = "wheelIndexChanged", Ge = {
|
|
1503
1503
|
rate: 4
|
|
1504
|
-
},
|
|
1504
|
+
}, Ze = (
|
|
1505
1505
|
/** @class */
|
|
1506
1506
|
function() {
|
|
1507
1507
|
function o(t) {
|
|
@@ -1510,7 +1510,7 @@ var Ue = {
|
|
|
1510
1510
|
return o.prototype.init = function() {
|
|
1511
1511
|
this.handleBScroll(), this.handleOptions(), this.handleHooks(), this.refreshBoundary(), this.setSelectedIndex(this.options.selectedIndex);
|
|
1512
1512
|
}, o.prototype.handleBScroll = function() {
|
|
1513
|
-
this.scroll.proxy(
|
|
1513
|
+
this.scroll.proxy(qe), this.scroll.registerType([Nt]);
|
|
1514
1514
|
}, o.prototype.handleOptions = function() {
|
|
1515
1515
|
var t = this.scroll.options.wheel === !0 ? {} : this.scroll.options.wheel, e = {
|
|
1516
1516
|
wheelWrapperClass: "wheel-scroll",
|
|
@@ -1520,29 +1520,29 @@ var Ue = {
|
|
|
1520
1520
|
selectedIndex: 0,
|
|
1521
1521
|
wheelDisabledItemClass: "wheel-disabled-item"
|
|
1522
1522
|
};
|
|
1523
|
-
this.options =
|
|
1523
|
+
this.options = Ne(e, t);
|
|
1524
1524
|
}, o.prototype.handleHooks = function() {
|
|
1525
|
-
var t = this, e = this.scroll, r = this.scroll.scroller, i = r.actionsHandler, n = r.scrollBehaviorX, s = r.scrollBehaviorY, l = r.animater,
|
|
1525
|
+
var t = this, e = this.scroll, r = this.scroll.scroller, i = r.actionsHandler, n = r.scrollBehaviorX, s = r.scrollBehaviorY, l = r.animater, h = r.content;
|
|
1526
1526
|
e.on(e.eventTypes.scrollEnd, function(a) {
|
|
1527
|
-
var
|
|
1527
|
+
var c = t.findNearestValidWheel(a.y).index;
|
|
1528
1528
|
if (r.animater.forceStopped && !t.isAdjustingPosition)
|
|
1529
|
-
return t.target = t.items[
|
|
1530
|
-
t.setSelectedIndex(
|
|
1529
|
+
return t.target = t.items[c], !0;
|
|
1530
|
+
t.setSelectedIndex(c), t.isAdjustingPosition && (t.isAdjustingPosition = !1);
|
|
1531
1531
|
}), this.scroll.hooks.on(this.scroll.hooks.eventTypes.refresh, function(a) {
|
|
1532
|
-
a !==
|
|
1532
|
+
a !== h && (h = a, t.setSelectedIndex(t.options.selectedIndex, !0)), t.rotateX(t.scroll.y), t.wheelTo(t.selectedIndex, 0);
|
|
1533
1533
|
}), this.scroll.hooks.on(this.scroll.hooks.eventTypes.beforeInitialScrollTo, function(a) {
|
|
1534
1534
|
a.x = 0, a.y = -(t.selectedIndex * t.itemHeight);
|
|
1535
1535
|
}), r.hooks.on(r.hooks.eventTypes.checkClick, function() {
|
|
1536
|
-
var a =
|
|
1537
|
-
return a === -1 || t.wheelTo(a, t.options.adjustTime,
|
|
1536
|
+
var a = Ve(t.items).indexOf(t.target);
|
|
1537
|
+
return a === -1 || t.wheelTo(a, t.options.adjustTime, $e.swipe), !0;
|
|
1538
1538
|
}), r.hooks.on(r.hooks.eventTypes.scrollTo, function(a) {
|
|
1539
1539
|
a.y = t.findNearestValidWheel(a.y).y;
|
|
1540
1540
|
}), r.hooks.on(r.hooks.eventTypes.minDistanceScroll, function() {
|
|
1541
1541
|
var a = r.animater;
|
|
1542
1542
|
a.forceStopped === !0 && (a.forceStopped = !1);
|
|
1543
|
-
}), r.hooks.on(r.hooks.eventTypes.scrollToElement, function(a,
|
|
1543
|
+
}), r.hooks.on(r.hooks.eventTypes.scrollToElement, function(a, c) {
|
|
1544
1544
|
if (J(a, t.options.wheelItemClass))
|
|
1545
|
-
|
|
1545
|
+
c.top = t.findNearestValidWheel(c.top).y;
|
|
1546
1546
|
else
|
|
1547
1547
|
return !0;
|
|
1548
1548
|
}), i.hooks.on(i.hooks.eventTypes.beforeStart, function(a) {
|
|
@@ -1552,10 +1552,10 @@ var Ue = {
|
|
|
1552
1552
|
}), s.hooks.on(s.hooks.eventTypes.computeBoundary, function(a) {
|
|
1553
1553
|
t.items = t.scroll.scroller.content.children, t.checkWheelAllDisabled(), t.itemHeight = t.items.length > 0 ? s.contentSize / t.items.length : 0, a.maxScrollPos = -t.itemHeight * (t.items.length - 1), a.minScrollPos = 0;
|
|
1554
1554
|
}), s.hooks.on(s.hooks.eventTypes.momentum, function(a) {
|
|
1555
|
-
a.rate =
|
|
1555
|
+
a.rate = Ge.rate, a.destination = t.findNearestValidWheel(a.destination).y;
|
|
1556
1556
|
}), s.hooks.on(s.hooks.eventTypes.end, function(a) {
|
|
1557
|
-
var
|
|
1558
|
-
a.destination =
|
|
1557
|
+
var c = t.findNearestValidWheel(s.currentPos);
|
|
1558
|
+
a.destination = c.y, a.duration = t.options.adjustTime;
|
|
1559
1559
|
}), l.hooks.on(l.hooks.eventTypes.time, function(a) {
|
|
1560
1560
|
t.transitionDuration(a);
|
|
1561
1561
|
}), l.hooks.on(l.hooks.eventTypes.timeFunction, function(a) {
|
|
@@ -1572,7 +1572,7 @@ var Ue = {
|
|
|
1572
1572
|
}, o.prototype.setSelectedIndex = function(t, e) {
|
|
1573
1573
|
e === void 0 && (e = !1);
|
|
1574
1574
|
var r = this.selectedIndex;
|
|
1575
|
-
this.selectedIndex = t, r !== t && !e && this.scroll.trigger(
|
|
1575
|
+
this.selectedIndex = t, r !== t && !e && this.scroll.trigger(Nt, t);
|
|
1576
1576
|
}, o.prototype.getSelectedIndex = function() {
|
|
1577
1577
|
return this.selectedIndex;
|
|
1578
1578
|
}, o.prototype.wheelTo = function(t, e, r) {
|
|
@@ -1587,14 +1587,14 @@ var Ue = {
|
|
|
1587
1587
|
}
|
|
1588
1588
|
}, o.prototype.transitionDuration = function(t) {
|
|
1589
1589
|
for (var e = 0; e < this.items.length; e++)
|
|
1590
|
-
this.items[e].style[
|
|
1590
|
+
this.items[e].style[dt.transitionDuration] = t + "ms";
|
|
1591
1591
|
}, o.prototype.timeFunction = function(t) {
|
|
1592
1592
|
for (var e = 0; e < this.items.length; e++)
|
|
1593
|
-
this.items[e].style[
|
|
1593
|
+
this.items[e].style[dt.transitionTimingFunction] = t;
|
|
1594
1594
|
}, o.prototype.rotateX = function(t) {
|
|
1595
1595
|
for (var e = this.options.rotate, r = e === void 0 ? 25 : e, i = 0; i < this.items.length; i++) {
|
|
1596
1596
|
var n = r * (t / this.itemHeight + i), s = n.toFixed(3);
|
|
1597
|
-
this.items[i].style[
|
|
1597
|
+
this.items[i].style[dt.transform] = "rotateX(" + s + "deg)";
|
|
1598
1598
|
}
|
|
1599
1599
|
}, o.prototype.findNearestValidWheel = function(t) {
|
|
1600
1600
|
t = t > 0 ? 0 : t < this.scroll.maxScrollY ? this.scroll.maxScrollY : t;
|
|
@@ -1618,161 +1618,171 @@ var Ue = {
|
|
|
1618
1618
|
}, o.pluginName = "wheel", o;
|
|
1619
1619
|
}()
|
|
1620
1620
|
);
|
|
1621
|
-
|
|
1622
|
-
|
|
1621
|
+
Fe.use(Ze);
|
|
1622
|
+
const ot = Array.isArray, Je = (o) => typeof o == "object" && o !== null;
|
|
1623
|
+
function bt(o) {
|
|
1623
1624
|
return ot(o) && o.length === 3;
|
|
1624
1625
|
}
|
|
1625
|
-
function
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1626
|
+
function Qe(o) {
|
|
1627
|
+
return o % 4 === 0 && (o % 100 !== 0 || o % 400 === 0);
|
|
1628
|
+
}
|
|
1629
|
+
function _(o, t) {
|
|
1630
|
+
const e = [];
|
|
1631
|
+
for (let r = o; r <= t; r++)
|
|
1632
|
+
e.push(r);
|
|
1633
|
+
return e;
|
|
1634
|
+
}
|
|
1635
|
+
function mt(o, t) {
|
|
1636
|
+
const e = [];
|
|
1637
|
+
for (let r = o; r <= t; r++)
|
|
1638
|
+
e.push(`${r}`.padStart(2, "0"));
|
|
1639
|
+
return e;
|
|
1640
|
+
}
|
|
1641
|
+
function to() {
|
|
1642
|
+
const o = mt(0, 23), t = mt(0, 59), e = mt(0, 59), r = L([]);
|
|
1643
|
+
i();
|
|
1644
|
+
function i() {
|
|
1645
|
+
const s = /* @__PURE__ */ new Date(), l = s.getHours(), h = s.getMinutes(), a = s.getSeconds();
|
|
1646
|
+
r.value = [l, h, a];
|
|
1632
1647
|
}
|
|
1633
|
-
function
|
|
1634
|
-
|
|
1635
|
-
for (let C = f; C <= S; C++)
|
|
1636
|
-
T.push(C);
|
|
1637
|
-
return T;
|
|
1648
|
+
function n(s) {
|
|
1649
|
+
return (bt(s) ? s : r.value).map((h) => +h);
|
|
1638
1650
|
}
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1651
|
+
return {
|
|
1652
|
+
timeList: [o, t, e],
|
|
1653
|
+
updateDefaultTime: i,
|
|
1654
|
+
getTimeAnchors: n
|
|
1655
|
+
};
|
|
1656
|
+
}
|
|
1657
|
+
function eo() {
|
|
1658
|
+
const e = /* @__PURE__ */ new Date(), r = e.getFullYear(), i = e.getMonth() + 1, n = e.getDate(), s = L(r), l = L(i), h = _(1900, 2100), a = _(1, 12), c = b(() => {
|
|
1659
|
+
const f = [4, 6, 9, 11], y = [1, 3, 5, 7, 8, 10, 12];
|
|
1660
|
+
return f.includes(l.value) ? _(1, 30) : y.includes(l.value) ? _(1, 31) : Qe(s.value) ? _(1, 29) : _(1, 28);
|
|
1661
|
+
}), u = b(() => [h, a, c.value]);
|
|
1662
|
+
function v(f) {
|
|
1663
|
+
return (bt(f) ? f : [r, i, n]).map((m, A) => {
|
|
1664
|
+
const P = u.value[A].indexOf(m);
|
|
1665
|
+
return P !== -1 ? P : 0;
|
|
1643
1666
|
});
|
|
1644
1667
|
}
|
|
1645
|
-
function
|
|
1646
|
-
const [
|
|
1647
|
-
s.value = u.value[0][
|
|
1668
|
+
function g(f) {
|
|
1669
|
+
const [y, m] = f;
|
|
1670
|
+
s.value = u.value[0][y], l.value = u.value[1][m];
|
|
1648
1671
|
}
|
|
1649
1672
|
return {
|
|
1650
1673
|
selectYear: s,
|
|
1651
1674
|
selectMonth: l,
|
|
1652
1675
|
dateList: u,
|
|
1653
|
-
updateDateSelect:
|
|
1654
|
-
getDateAnchors:
|
|
1676
|
+
updateDateSelect: g,
|
|
1677
|
+
getDateAnchors: v
|
|
1655
1678
|
};
|
|
1656
1679
|
}
|
|
1657
|
-
function oo() {
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
const a = [];
|
|
1662
|
-
for (let h = l; h <= c; h++)
|
|
1663
|
-
a.push(`${h}`.padStart(2, "0"));
|
|
1664
|
-
return a;
|
|
1680
|
+
function oo(o, t) {
|
|
1681
|
+
const e = L([]), r = L(), i = L([]), n = b(() => o.type === "date"), s = b(() => o.type === "time"), { selectYear: l, selectMonth: h, dateList: a, updateDateSelect: c, getDateAnchors: u } = eo(), { timeList: v, updateDefaultTime: g, getTimeAnchors: f } = to(), y = b(() => n.value ? u(o.anchor) : s.value ? f(o.anchor) : ot(o.anchor) ? o.anchor : [o.anchor]);
|
|
1682
|
+
async function m(p = !1) {
|
|
1683
|
+
p ? A() : P(), await ne(), e.value.forEach((k, d) => nt(d)), p || Qt(), te();
|
|
1665
1684
|
}
|
|
1666
|
-
function
|
|
1667
|
-
const l = /* @__PURE__ */ new Date(), c = l.getHours(), a = l.getMinutes(), h = l.getSeconds();
|
|
1668
|
-
r.value = [c, a, h];
|
|
1669
|
-
}
|
|
1670
|
-
function s(l) {
|
|
1671
|
-
return (Tt(l) ? l : r.value).map((a) => +a);
|
|
1672
|
-
}
|
|
1673
|
-
return {
|
|
1674
|
-
timeList: [o, t, e],
|
|
1675
|
-
updateDefaultTime: n,
|
|
1676
|
-
getTimeAnchors: s
|
|
1677
|
-
};
|
|
1678
|
-
}
|
|
1679
|
-
ze.use(Qe);
|
|
1680
|
-
function ro(o, t) {
|
|
1681
|
-
const e = L([]), r = L(), i = L([]), n = P(() => o.type === "date"), s = P(() => o.type === "time"), { selectYear: l, selectMonth: c, dateList: a, updateDateSelect: h, getDateAnchors: u } = eo(), { timeList: v, updateDefaultTime: y, getTimeAnchors: d } = oo(), k = P(() => n.value ? u(o.anchor) : s.value ? d(o.anchor) : ot(o.anchor) ? o.anchor : [o.anchor]);
|
|
1682
|
-
async function f(p = !1) {
|
|
1683
|
-
p ? S() : T(), await ne(), e.value.forEach((g, m) => C(m)), p || Qt(), te();
|
|
1684
|
-
}
|
|
1685
|
-
function S() {
|
|
1685
|
+
function A() {
|
|
1686
1686
|
const p = {
|
|
1687
1687
|
date: a == null ? void 0 : a.value,
|
|
1688
1688
|
time: v
|
|
1689
|
-
},
|
|
1690
|
-
e.value = p[
|
|
1689
|
+
}, k = o.type, T = ot(o.data[0]) ? [...o.data] : [o.data];
|
|
1690
|
+
e.value = p[k] ?? T;
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1693
|
-
!n.value && !s.value || (n.value &&
|
|
1692
|
+
function P() {
|
|
1693
|
+
!n.value && !s.value || (n.value && c(y.value), s.value && !bt(o.anchor) && g());
|
|
1694
1694
|
}
|
|
1695
|
-
function
|
|
1696
|
-
var
|
|
1697
|
-
const
|
|
1698
|
-
if (!
|
|
1699
|
-
let
|
|
1700
|
-
if (
|
|
1701
|
-
|
|
1695
|
+
function nt(p) {
|
|
1696
|
+
var T;
|
|
1697
|
+
const k = (T = r.value) == null ? void 0 : T.children[p];
|
|
1698
|
+
if (!k) return;
|
|
1699
|
+
let d = i.value[p];
|
|
1700
|
+
if (d)
|
|
1701
|
+
d.refresh();
|
|
1702
1702
|
else {
|
|
1703
|
-
const
|
|
1703
|
+
const at = R(k, {
|
|
1704
1704
|
wheel: {
|
|
1705
1705
|
selectedIndex: 0,
|
|
1706
1706
|
rotate: 25
|
|
1707
1707
|
},
|
|
1708
1708
|
swipeTime: o.swipeTime ?? 500
|
|
1709
1709
|
});
|
|
1710
|
-
|
|
1710
|
+
d = i.value[p] = at, d.on("scrollEnd", () => $(p));
|
|
1711
1711
|
}
|
|
1712
|
-
return
|
|
1712
|
+
return d;
|
|
1713
1713
|
}
|
|
1714
|
-
function
|
|
1714
|
+
function $(p) {
|
|
1715
1715
|
if (!n.value || p === 2) return;
|
|
1716
|
-
const
|
|
1717
|
-
p === 0 && (l.value =
|
|
1716
|
+
const k = i.value[p].getSelectedIndex(), d = a.value[p][k];
|
|
1717
|
+
p === 0 && (l.value = d), p === 1 && (h.value = d), m(!0);
|
|
1718
1718
|
}
|
|
1719
1719
|
function Qt() {
|
|
1720
|
-
i.value.forEach((p,
|
|
1721
|
-
var
|
|
1722
|
-
const
|
|
1723
|
-
p.wheelTo(
|
|
1720
|
+
i.value.forEach((p, k) => {
|
|
1721
|
+
var T;
|
|
1722
|
+
const d = (T = y.value) == null ? void 0 : T[k];
|
|
1723
|
+
p.wheelTo(d ?? 0);
|
|
1724
1724
|
});
|
|
1725
1725
|
}
|
|
1726
1726
|
function te() {
|
|
1727
1727
|
const p = e.value.length;
|
|
1728
1728
|
if (i.value.length <= p) return;
|
|
1729
|
-
i.value.splice(p).forEach((
|
|
1729
|
+
i.value.splice(p).forEach((d) => d.destroy());
|
|
1730
1730
|
}
|
|
1731
1731
|
function ee() {
|
|
1732
|
-
t("cancel"),
|
|
1732
|
+
t("cancel"), st();
|
|
1733
1733
|
}
|
|
1734
1734
|
function oe() {
|
|
1735
|
-
i.value.some((
|
|
1736
|
-
const { item:
|
|
1737
|
-
t("confirm",
|
|
1735
|
+
i.value.some((T) => T.isInTransition) && re();
|
|
1736
|
+
const { item: k, anchor: d } = ie();
|
|
1737
|
+
t("confirm", k), t("update:anchor", d), st();
|
|
1738
1738
|
}
|
|
1739
|
-
function
|
|
1739
|
+
function st() {
|
|
1740
1740
|
t("update:isShowPicker", !1);
|
|
1741
1741
|
}
|
|
1742
1742
|
function re() {
|
|
1743
1743
|
i.value.forEach((p) => p.stop());
|
|
1744
1744
|
}
|
|
1745
1745
|
function ie() {
|
|
1746
|
-
const { item: p, anchor:
|
|
1747
|
-
(
|
|
1748
|
-
const
|
|
1749
|
-
return
|
|
1746
|
+
const { item: p, anchor: k } = i.value.reduce(
|
|
1747
|
+
(d, T, at) => {
|
|
1748
|
+
const wt = T.getSelectedIndex(), lt = e.value[at][wt];
|
|
1749
|
+
return d.item.push(s.value ? +lt : lt), d.anchor.push(n.value ? lt : wt), d;
|
|
1750
1750
|
},
|
|
1751
1751
|
{ item: [], anchor: [] }
|
|
1752
1752
|
);
|
|
1753
|
-
return p.length > 1 ? { item: p, anchor:
|
|
1753
|
+
return p.length > 1 ? { item: p, anchor: k } : { item: p[0], anchor: k[0] };
|
|
1754
1754
|
}
|
|
1755
|
-
return
|
|
1755
|
+
return ht(
|
|
1756
1756
|
() => o.data,
|
|
1757
|
-
() =>
|
|
1757
|
+
() => m(!0),
|
|
1758
1758
|
{ immediate: !0 }
|
|
1759
|
-
),
|
|
1759
|
+
), ht(
|
|
1760
1760
|
() => o.isShowPicker,
|
|
1761
|
-
(p) => p &&
|
|
1762
|
-
),
|
|
1761
|
+
(p) => p && m()
|
|
1762
|
+
), ht(
|
|
1763
1763
|
() => o.type,
|
|
1764
1764
|
() => {
|
|
1765
|
-
|
|
1765
|
+
P(), m(!0);
|
|
1766
1766
|
}
|
|
1767
1767
|
), {
|
|
1768
1768
|
pickerData: e,
|
|
1769
1769
|
wheelWrapper: r,
|
|
1770
1770
|
cancel: ee,
|
|
1771
1771
|
confirm: oe,
|
|
1772
|
-
closePicker:
|
|
1772
|
+
closePicker: st
|
|
1773
1773
|
};
|
|
1774
1774
|
}
|
|
1775
|
-
const
|
|
1775
|
+
const ro = {
|
|
1776
|
+
cancelClass: "",
|
|
1777
|
+
confirmClass: "",
|
|
1778
|
+
titleClass: "",
|
|
1779
|
+
cancelColor: "#999",
|
|
1780
|
+
confirmColor: "#42b983",
|
|
1781
|
+
titleColor: "",
|
|
1782
|
+
cancelText: "Cancel",
|
|
1783
|
+
confirmText: "Confirm",
|
|
1784
|
+
titleText: ""
|
|
1785
|
+
}, io = { class: "picker" }, no = { class: "picker_title" }, so = { class: "picker_panel" }, ao = /* @__PURE__ */ S("div", { class: "picker_mask_top" }, null, -1), lo = /* @__PURE__ */ S("div", { class: "picker_mask_bottom" }, null, -1), ho = { class: "picker_wheel_scroll" }, uo = /* @__PURE__ */ se({
|
|
1776
1786
|
__name: "Picker",
|
|
1777
1787
|
props: {
|
|
1778
1788
|
data: { default: () => [] },
|
|
@@ -1785,93 +1795,74 @@ const Jt = (o) => (ae("data-v-7105b26a"), o = o(), le(), o), io = { class: "pick
|
|
|
1785
1795
|
},
|
|
1786
1796
|
emits: ["update:isShowPicker", "update:anchor", "cancel", "confirm"],
|
|
1787
1797
|
setup(o, { emit: t }) {
|
|
1788
|
-
const e = o, r = t, i =
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
confirmColor: "#42b983",
|
|
1794
|
-
titleColor: "",
|
|
1795
|
-
cancelText: "Cancel",
|
|
1796
|
-
confirmText: "Confirm",
|
|
1797
|
-
titleText: "",
|
|
1798
|
-
...e.options
|
|
1799
|
-
})), n = P(() => i.value.cancelColor), s = P(() => i.value.confirmColor), l = P(() => i.value.titleColor), c = P(() => ot(e.showKey) ? e.showKey : [e.showKey]), { pickerData: a, wheelWrapper: h, cancel: u, confirm: v, closePicker: y } = ro(e, r);
|
|
1800
|
-
return (d, k) => (z(), K("div", null, [
|
|
1801
|
-
bt(wt, { name: "fade" }, {
|
|
1802
|
-
default: Pt(() => [
|
|
1803
|
-
Et(w("div", {
|
|
1798
|
+
const e = o, r = t, i = b(() => ({ ...ro, ...e.options })), n = b(() => i.value.cancelColor), s = b(() => i.value.confirmColor), l = b(() => i.value.titleColor), h = b(() => ot(e.showKey) ? e.showKey : [e.showKey]), { pickerData: a, wheelWrapper: c, cancel: u, confirm: v, closePicker: g } = oo(e, r);
|
|
1799
|
+
return (f, y) => (W(), z("div", null, [
|
|
1800
|
+
Pt(Et, { name: "fade" }, {
|
|
1801
|
+
default: Ct(() => [
|
|
1802
|
+
Dt(S("div", {
|
|
1804
1803
|
class: "mask",
|
|
1805
|
-
onClick:
|
|
1806
|
-
(...
|
|
1804
|
+
onClick: y[0] || (y[0] = //@ts-ignore
|
|
1805
|
+
(...m) => D(g) && D(g)(...m))
|
|
1807
1806
|
}, null, 512), [
|
|
1808
|
-
[
|
|
1807
|
+
[Bt, f.isShowPicker]
|
|
1809
1808
|
])
|
|
1810
1809
|
]),
|
|
1811
1810
|
_: 1
|
|
1812
1811
|
}),
|
|
1813
|
-
|
|
1814
|
-
default:
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1812
|
+
Pt(Et, { name: "slide" }, {
|
|
1813
|
+
default: Ct(() => [
|
|
1814
|
+
Dt(S("div", io, [
|
|
1815
|
+
S("div", no, [
|
|
1816
|
+
S("button", {
|
|
1818
1817
|
class: ct(["picker_cancel", i.value.cancelClass]),
|
|
1819
|
-
style:
|
|
1820
|
-
onClick:
|
|
1821
|
-
(...
|
|
1818
|
+
style: ut({ color: n.value }),
|
|
1819
|
+
onClick: y[1] || (y[1] = //@ts-ignore
|
|
1820
|
+
(...m) => D(u) && D(u)(...m))
|
|
1822
1821
|
}, j(i.value.cancelText), 7),
|
|
1823
|
-
|
|
1822
|
+
S("button", {
|
|
1824
1823
|
class: ct(["picker_confirm", i.value.confirmClass]),
|
|
1825
|
-
style:
|
|
1826
|
-
onClick:
|
|
1827
|
-
(...
|
|
1824
|
+
style: ut({ color: s.value }),
|
|
1825
|
+
onClick: y[2] || (y[2] = //@ts-ignore
|
|
1826
|
+
(...m) => D(v) && D(v)(...m))
|
|
1828
1827
|
}, j(i.value.confirmText), 7),
|
|
1829
|
-
|
|
1828
|
+
S("h4", {
|
|
1830
1829
|
class: ct([i.value.titleClass]),
|
|
1831
|
-
style:
|
|
1830
|
+
style: ut({ color: l.value })
|
|
1832
1831
|
}, j(i.value.titleText), 7)
|
|
1833
1832
|
]),
|
|
1834
|
-
|
|
1833
|
+
S("div", so, [
|
|
1835
1834
|
ao,
|
|
1836
1835
|
lo,
|
|
1837
|
-
|
|
1836
|
+
S("div", {
|
|
1838
1837
|
ref_key: "wheelWrapper",
|
|
1839
|
-
ref:
|
|
1838
|
+
ref: c,
|
|
1840
1839
|
class: "picker_wheel_wrapper"
|
|
1841
1840
|
}, [
|
|
1842
|
-
(
|
|
1843
|
-
key:
|
|
1841
|
+
(W(!0), z(xt, null, At(D(a), (m, A) => (W(), z("div", {
|
|
1842
|
+
key: A,
|
|
1844
1843
|
class: "picker_wheel"
|
|
1845
1844
|
}, [
|
|
1846
|
-
|
|
1847
|
-
(
|
|
1848
|
-
var
|
|
1849
|
-
return
|
|
1850
|
-
key:
|
|
1845
|
+
S("ul", ho, [
|
|
1846
|
+
(W(!0), z(xt, null, At(m, (P, nt) => {
|
|
1847
|
+
var $;
|
|
1848
|
+
return W(), z("li", {
|
|
1849
|
+
key: nt,
|
|
1851
1850
|
class: "picker_wheel_item"
|
|
1852
|
-
}, j((
|
|
1851
|
+
}, j(($ = h.value) != null && $[A] && D(Je)(P) ? P[h.value[A]] : P), 1);
|
|
1853
1852
|
}), 128))
|
|
1854
1853
|
])
|
|
1855
1854
|
]))), 128))
|
|
1856
1855
|
], 512)
|
|
1857
1856
|
])
|
|
1858
1857
|
], 512), [
|
|
1859
|
-
[
|
|
1858
|
+
[Bt, f.isShowPicker]
|
|
1860
1859
|
])
|
|
1861
1860
|
]),
|
|
1862
1861
|
_: 1
|
|
1863
1862
|
})
|
|
1864
1863
|
]));
|
|
1865
1864
|
}
|
|
1866
|
-
})
|
|
1867
|
-
const e = o.__vccOpts || o;
|
|
1868
|
-
for (const [r, i] of t)
|
|
1869
|
-
e[r] = i;
|
|
1870
|
-
return e;
|
|
1871
|
-
}, zt = /* @__PURE__ */ uo(ho, [["__scopeId", "data-v-7105b26a"]]);
|
|
1872
|
-
zt.install = function(o) {
|
|
1873
|
-
o.component("Picker", zt);
|
|
1874
|
-
};
|
|
1865
|
+
});
|
|
1875
1866
|
export {
|
|
1876
|
-
|
|
1867
|
+
uo as default
|
|
1877
1868
|
};
|