@component-hook/picker 0.1.6 → 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} +258 -267
- 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
|
|
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
|
|
@@ -33,23 +33,23 @@ function rt(o, t) {
|
|
|
33
33
|
}
|
|
34
34
|
o.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
|
|
35
35
|
}
|
|
36
|
-
var
|
|
37
|
-
return
|
|
36
|
+
var N = function() {
|
|
37
|
+
return N = Object.assign || function(t) {
|
|
38
38
|
for (var e, r = 1, i = arguments.length; r < i; r++) {
|
|
39
39
|
e = arguments[r];
|
|
40
40
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
|
|
41
41
|
}
|
|
42
42
|
return t;
|
|
43
|
-
},
|
|
43
|
+
}, N.apply(this, arguments);
|
|
44
44
|
};
|
|
45
|
-
function
|
|
45
|
+
function Kt() {
|
|
46
46
|
for (var o = 0, t = 0, e = arguments.length; t < e; t++) o += arguments[t].length;
|
|
47
47
|
for (var r = Array(o), i = 0, t = 0; t < e; t++)
|
|
48
48
|
for (var n = arguments[t], s = 0, l = n.length; s < l; s++, i++)
|
|
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,7 +138,7 @@ var ue = [
|
|
|
138
138
|
function Q(o) {
|
|
139
139
|
console.error("[BScroll warn]: " + o);
|
|
140
140
|
}
|
|
141
|
-
var w = typeof window < "u", F = w && navigator.userAgent.toLowerCase(),
|
|
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
142
|
if (typeof F == "string") {
|
|
143
143
|
var o = /os (\d\d?_\d(_\d)?)/, t = o.exec(F);
|
|
144
144
|
if (!t)
|
|
@@ -149,16 +149,16 @@ var w = typeof window < "u", F = w && navigator.userAgent.toLowerCase(), pe = !!
|
|
|
149
149
|
return e[0] === 13 && e[1] >= 4;
|
|
150
150
|
}
|
|
151
151
|
return !1;
|
|
152
|
-
}(),
|
|
152
|
+
}(), Rt = !1;
|
|
153
153
|
if (w) {
|
|
154
|
-
var
|
|
154
|
+
var ue = "test-passive";
|
|
155
155
|
try {
|
|
156
156
|
var Yt = {};
|
|
157
157
|
Object.defineProperty(Yt, "passive", {
|
|
158
158
|
get: function() {
|
|
159
|
-
|
|
159
|
+
Rt = !0;
|
|
160
160
|
}
|
|
161
|
-
}), window.addEventListener(
|
|
161
|
+
}), window.addEventListener(ue, function() {
|
|
162
162
|
}, Yt);
|
|
163
163
|
} catch {
|
|
164
164
|
}
|
|
@@ -177,7 +177,7 @@ function kt(o) {
|
|
|
177
177
|
function Mt(o, t, e) {
|
|
178
178
|
return o < t ? t : o > e ? e : o;
|
|
179
179
|
}
|
|
180
|
-
var St = w && document.createElement("div").style,
|
|
180
|
+
var St = w && document.createElement("div").style, I = function() {
|
|
181
181
|
if (!w)
|
|
182
182
|
return !1;
|
|
183
183
|
for (var o = [
|
|
@@ -209,24 +209,24 @@ var St = w && document.createElement("div").style, L = function() {
|
|
|
209
209
|
return !1;
|
|
210
210
|
}();
|
|
211
211
|
function E(o) {
|
|
212
|
-
return
|
|
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
232
|
function Xt(o) {
|
|
@@ -237,10 +237,10 @@ function Xt(o) {
|
|
|
237
237
|
top: e
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
|
-
|
|
241
|
-
var
|
|
242
|
-
transform:
|
|
243
|
-
transition:
|
|
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
244
|
transitionTimingFunction: E("transitionTimingFunction"),
|
|
245
245
|
transitionDuration: E("transitionDuration"),
|
|
246
246
|
transitionDelay: E("transitionDelay"),
|
|
@@ -256,7 +256,7 @@ var ge = E("transform"), Ut = E("transition"), ke = w && E("perspective") in St,
|
|
|
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 Ot(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, gt(
|
|
301
|
+
i = new MouseEvent(t, gt(N({
|
|
302
302
|
bubbles: n,
|
|
303
303
|
cancelable: s
|
|
304
304
|
}, u), r));
|
|
@@ -312,8 +312,8 @@ function qt(o, t) {
|
|
|
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
318
|
var Y = {
|
|
319
319
|
// easeOutQuint
|
|
@@ -337,25 +337,25 @@ var Y = {
|
|
|
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
|
|
343
|
+
var Gt = function() {
|
|
344
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
|
-
}(),
|
|
346
|
+
return window.setTimeout(o, o.interval || Te);
|
|
347
|
+
} : qt;
|
|
348
|
+
}(), O = function() {
|
|
349
349
|
return w ? B.cancelAnimationFrame || B.webkitCancelAnimationFrame || B.mozCancelAnimationFrame || B.oCancelAnimationFrame || function(o) {
|
|
350
350
|
window.clearTimeout(o);
|
|
351
|
-
} :
|
|
352
|
-
}(),
|
|
351
|
+
} : qt;
|
|
352
|
+
}(), Lt = function(o) {
|
|
353
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,16 +363,16 @@ var Zt = 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
|
|
371
|
+
function we(o, t, e) {
|
|
372
372
|
ft.get = function() {
|
|
373
|
-
return
|
|
373
|
+
return Se(this, t);
|
|
374
374
|
}, ft.set = function(i) {
|
|
375
|
-
|
|
375
|
+
be(this, t, i);
|
|
376
376
|
}, Object.defineProperty(o, e, ft);
|
|
377
377
|
}
|
|
378
378
|
var x = (
|
|
@@ -390,9 +390,9 @@ var x = (
|
|
|
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 x = (
|
|
|
414
414
|
this.hasType(t);
|
|
415
415
|
var i = this.events[t];
|
|
416
416
|
if (i)
|
|
417
|
-
for (var n = i.length, s =
|
|
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 x = (
|
|
|
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 x = (
|
|
|
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 x = (
|
|
|
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 x = (
|
|
|
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,
|
|
@@ -508,8 +508,8 @@ var x = (
|
|
|
508
508
|
}, n;
|
|
509
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) {
|
|
@@ -522,12 +522,12 @@ var x = (
|
|
|
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 x = (
|
|
|
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 x = (
|
|
|
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;
|
|
@@ -567,7 +567,7 @@ var x = (
|
|
|
567
567
|
}, o.prototype.start = function(t) {
|
|
568
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
|
}
|
|
@@ -586,8 +586,8 @@ var x = (
|
|
|
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) {
|
|
@@ -605,7 +605,7 @@ var x = (
|
|
|
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) {
|
|
@@ -634,7 +634,7 @@ var x = (
|
|
|
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) {
|
|
@@ -659,18 +659,18 @@ var x = (
|
|
|
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,9 +680,9 @@ var x = (
|
|
|
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
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) {
|
|
@@ -696,7 +696,7 @@ var x = (
|
|
|
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 x = (
|
|
|
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,9 +720,9 @@ var x = (
|
|
|
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 = X(),
|
|
723
|
+
var s = this, l = X(), h = l + i, a = this.options.probeType === 3, c = function() {
|
|
724
724
|
var u = X();
|
|
725
|
-
if (u >=
|
|
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
|
}
|
|
@@ -731,13 +731,13 @@ var x = (
|
|
|
731
731
|
Object.keys(r).forEach(function(f) {
|
|
732
732
|
var y = e[f], m = r[f];
|
|
733
733
|
g[f] = (m - y) * v + y;
|
|
734
|
-
}), s.translate(g), a && s.hooks.trigger(s.hooks.eventTypes.move, g), s.pending && (s.timer =
|
|
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 x = (
|
|
|
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,9 +756,9 @@ function Oe(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) {
|
|
@@ -799,19 +799,19 @@ var Lt = (
|
|
|
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 /
|
|
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
804
|
duration: g,
|
|
805
805
|
rate: 15
|
|
806
806
|
};
|
|
807
|
-
return this.hooks.trigger(this.hooks.eventTypes.momentum, f,
|
|
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 */
|
|
@@ -860,8 +860,8 @@ var Lt = (
|
|
|
860
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,7 +879,7 @@ var Lt = (
|
|
|
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
885
|
return Ht.yes(t);
|
|
@@ -889,9 +889,9 @@ var Lt = (
|
|
|
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) {
|
|
@@ -906,7 +906,7 @@ var Lt = (
|
|
|
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 Lt = (
|
|
|
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) {
|
|
@@ -936,10 +936,10 @@ var Lt = (
|
|
|
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
|
|
@@ -961,10 +961,10 @@ var Lt = (
|
|
|
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 = Mt(e, s, n), r = Mt(r, a,
|
|
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 Lt = (
|
|
|
977
977
|
}, o;
|
|
978
978
|
}()
|
|
979
979
|
);
|
|
980
|
-
function
|
|
980
|
+
function Le(o) {
|
|
981
981
|
var t = [
|
|
982
982
|
"click",
|
|
983
983
|
"bindToWrapper",
|
|
@@ -1014,11 +1014,11 @@ function Tt(o, t, e) {
|
|
|
1014
1014
|
typeof r == "string" ? i = n = r : (i = r.source, n = r.target), o.on(i, function() {
|
|
1015
1015
|
for (var s = [], l = 0; l < arguments.length; l++)
|
|
1016
1016
|
s[l] = arguments[l];
|
|
1017
|
-
return t.trigger.apply(t,
|
|
1017
|
+
return t.trigger.apply(t, Kt([n], s));
|
|
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,7 +1026,7 @@ function ze(o, t) {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
return !0;
|
|
1028
1028
|
}
|
|
1029
|
-
var Wt = 1,
|
|
1029
|
+
var Wt = 1, He = (
|
|
1030
1030
|
/** @class */
|
|
1031
1031
|
function() {
|
|
1032
1032
|
function o(t, e, r) {
|
|
@@ -1049,14 +1049,14 @@ var Wt = 1, Ke = (
|
|
|
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
|
{
|
|
@@ -1174,14 +1174,14 @@ var Wt = 1, Ke = (
|
|
|
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
|
-
X() - this.lastClickTime < s && (i = !0,
|
|
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) {
|
|
@@ -1210,27 +1210,27 @@ var Wt = 1, Ke = (
|
|
|
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
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,
|
|
1233
|
-
return n &&
|
|
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 Wt = 1, Ke = (
|
|
|
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 Wt = 1, Ke = (
|
|
|
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",
|
|
@@ -1303,9 +1303,9 @@ var Wt = 1, Ke = (
|
|
|
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 Wt = 1, Ke = (
|
|
|
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));
|
|
@@ -1341,7 +1341,7 @@ var Wt = 1, Ke = (
|
|
|
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;
|
|
@@ -1367,7 +1367,7 @@ function R(o, t) {
|
|
|
1367
1367
|
R.use = it.use;
|
|
1368
1368
|
R.plugins = it.plugins;
|
|
1369
1369
|
R.pluginsMap = it.pluginsMap;
|
|
1370
|
-
var
|
|
1370
|
+
var Fe = R;
|
|
1371
1371
|
/*!
|
|
1372
1372
|
* better-scroll / wheel
|
|
1373
1373
|
* (c) 2016-2023 ustbhuangyi
|
|
@@ -1387,25 +1387,25 @@ et && et.indexOf("android") > 0;
|
|
|
1387
1387
|
}
|
|
1388
1388
|
return !1;
|
|
1389
1389
|
})();
|
|
1390
|
-
var
|
|
1390
|
+
var We = !1;
|
|
1391
1391
|
if (V) {
|
|
1392
|
-
var
|
|
1392
|
+
var ze = "test-passive";
|
|
1393
1393
|
try {
|
|
1394
1394
|
var zt = {};
|
|
1395
1395
|
Object.defineProperty(zt, "passive", {
|
|
1396
1396
|
get: function() {
|
|
1397
|
-
|
|
1397
|
+
We = !0;
|
|
1398
1398
|
}
|
|
1399
|
-
}), window.addEventListener(
|
|
1399
|
+
}), window.addEventListener(ze, function() {
|
|
1400
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
|
-
},
|
|
1408
|
+
}, Jt = V && document.createElement("div").style, H = function() {
|
|
1409
1409
|
if (!V)
|
|
1410
1410
|
return !1;
|
|
1411
1411
|
for (var o = [
|
|
@@ -1431,7 +1431,7 @@ var $e = 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;
|
|
@@ -1440,11 +1440,11 @@ function C(o) {
|
|
|
1440
1440
|
return H === !1 ? o : H === "standard" ? o === "transitionEnd" ? "transitionend" : o : H + o.charAt(0).toUpperCase() + o.substr(1);
|
|
1441
1441
|
}
|
|
1442
1442
|
H && H !== "standard" && "" + H.toLowerCase();
|
|
1443
|
-
var
|
|
1444
|
-
V && C("perspective") in
|
|
1443
|
+
var Ke = C("transform"), Re = C("transition");
|
|
1444
|
+
V && C("perspective") in Jt;
|
|
1445
1445
|
var dt = {
|
|
1446
|
-
transform:
|
|
1447
|
-
transition:
|
|
1446
|
+
transform: Ke,
|
|
1447
|
+
transition: Re,
|
|
1448
1448
|
transitionTimingFunction: C("transitionTimingFunction"),
|
|
1449
1449
|
transitionDuration: C("transitionDuration"),
|
|
1450
1450
|
transitionDelay: C("transitionDelay"),
|
|
@@ -1456,10 +1456,10 @@ 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 Ge = {
|
|
|
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 Ge = {
|
|
|
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 Ge = {
|
|
|
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 Ge = {
|
|
|
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 Ge = {
|
|
|
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 Ge = {
|
|
|
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) {
|
|
@@ -1618,51 +1618,35 @@ var Ge = {
|
|
|
1618
1618
|
}, o.pluginName = "wheel", o;
|
|
1619
1619
|
}()
|
|
1620
1620
|
);
|
|
1621
|
-
|
|
1621
|
+
Fe.use(Ze);
|
|
1622
|
+
const ot = Array.isArray, Je = (o) => typeof o == "object" && o !== null;
|
|
1622
1623
|
function bt(o) {
|
|
1623
1624
|
return ot(o) && o.length === 3;
|
|
1624
1625
|
}
|
|
1625
|
-
function
|
|
1626
|
-
const e = /* @__PURE__ */ new Date(), r = e.getFullYear(), i = e.getMonth() + 1, n = e.getDate(), s = I(r), l = I(i), c = O(1900, 2100), a = O(1, 12), h = b(() => {
|
|
1627
|
-
const f = [4, 6, 9, 11], y = [1, 3, 5, 7, 8, 10, 12];
|
|
1628
|
-
return f.includes(l.value) ? O(1, 30) : y.includes(l.value) ? O(1, 31) : io(s.value) ? O(1, 29) : O(1, 28);
|
|
1629
|
-
}), u = b(() => [c, a, h.value]);
|
|
1630
|
-
function v(f) {
|
|
1631
|
-
return (bt(f) ? f : [r, i, n]).map((m, A) => {
|
|
1632
|
-
const P = u.value[A].indexOf(m);
|
|
1633
|
-
return P !== -1 ? P : 0;
|
|
1634
|
-
});
|
|
1635
|
-
}
|
|
1636
|
-
function g(f) {
|
|
1637
|
-
const [y, m] = f;
|
|
1638
|
-
s.value = u.value[0][y], l.value = u.value[1][m];
|
|
1639
|
-
}
|
|
1640
|
-
return {
|
|
1641
|
-
selectYear: s,
|
|
1642
|
-
selectMonth: l,
|
|
1643
|
-
dateList: u,
|
|
1644
|
-
updateDateSelect: g,
|
|
1645
|
-
getDateAnchors: v
|
|
1646
|
-
};
|
|
1647
|
-
}
|
|
1648
|
-
function io(o) {
|
|
1626
|
+
function Qe(o) {
|
|
1649
1627
|
return o % 4 === 0 && (o % 100 !== 0 || o % 400 === 0);
|
|
1650
1628
|
}
|
|
1651
|
-
function
|
|
1629
|
+
function _(o, t) {
|
|
1652
1630
|
const e = [];
|
|
1653
1631
|
for (let r = o; r <= t; r++)
|
|
1654
1632
|
e.push(r);
|
|
1655
1633
|
return e;
|
|
1656
1634
|
}
|
|
1657
|
-
function
|
|
1658
|
-
const
|
|
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([]);
|
|
1659
1643
|
i();
|
|
1660
1644
|
function i() {
|
|
1661
|
-
const s = /* @__PURE__ */ new Date(), l = s.getHours(),
|
|
1662
|
-
r.value = [l,
|
|
1645
|
+
const s = /* @__PURE__ */ new Date(), l = s.getHours(), h = s.getMinutes(), a = s.getSeconds();
|
|
1646
|
+
r.value = [l, h, a];
|
|
1663
1647
|
}
|
|
1664
1648
|
function n(s) {
|
|
1665
|
-
return (bt(s) ? s : r.value).map((
|
|
1649
|
+
return (bt(s) ? s : r.value).map((h) => +h);
|
|
1666
1650
|
}
|
|
1667
1651
|
return {
|
|
1668
1652
|
timeList: [o, t, e],
|
|
@@ -1670,17 +1654,33 @@ function no() {
|
|
|
1670
1654
|
getTimeAnchors: n
|
|
1671
1655
|
};
|
|
1672
1656
|
}
|
|
1673
|
-
function
|
|
1674
|
-
const e =
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
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;
|
|
1666
|
+
});
|
|
1667
|
+
}
|
|
1668
|
+
function g(f) {
|
|
1669
|
+
const [y, m] = f;
|
|
1670
|
+
s.value = u.value[0][y], l.value = u.value[1][m];
|
|
1671
|
+
}
|
|
1672
|
+
return {
|
|
1673
|
+
selectYear: s,
|
|
1674
|
+
selectMonth: l,
|
|
1675
|
+
dateList: u,
|
|
1676
|
+
updateDateSelect: g,
|
|
1677
|
+
getDateAnchors: v
|
|
1678
|
+
};
|
|
1678
1679
|
}
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
const e = I([]), r = I(), i = I([]), n = b(() => o.type === "date"), s = b(() => o.type === "time"), { selectYear: l, selectMonth: c, dateList: a, updateDateSelect: h, getDateAnchors: u } = ro(), { timeList: v, updateDefaultTime: g, getTimeAnchors: f } = no(), y = b(() => n.value ? u(o.anchor) : s.value ? f(o.anchor) : ot(o.anchor) ? o.anchor : [o.anchor]);
|
|
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
1682
|
async function m(p = !1) {
|
|
1683
|
-
p ? A() : P(), await
|
|
1683
|
+
p ? A() : P(), await ne(), e.value.forEach((k, d) => nt(d)), p || Qt(), te();
|
|
1684
1684
|
}
|
|
1685
1685
|
function A() {
|
|
1686
1686
|
const p = {
|
|
@@ -1690,7 +1690,7 @@ function so(o, t) {
|
|
|
1690
1690
|
e.value = p[k] ?? T;
|
|
1691
1691
|
}
|
|
1692
1692
|
function P() {
|
|
1693
|
-
!n.value && !s.value || (n.value &&
|
|
1693
|
+
!n.value && !s.value || (n.value && c(y.value), s.value && !bt(o.anchor) && g());
|
|
1694
1694
|
}
|
|
1695
1695
|
function nt(p) {
|
|
1696
1696
|
var T;
|
|
@@ -1714,35 +1714,35 @@ function so(o, t) {
|
|
|
1714
1714
|
function $(p) {
|
|
1715
1715
|
if (!n.value || p === 2) return;
|
|
1716
1716
|
const k = i.value[p].getSelectedIndex(), d = a.value[p][k];
|
|
1717
|
-
p === 0 && (l.value = d), p === 1 && (
|
|
1717
|
+
p === 0 && (l.value = d), p === 1 && (h.value = d), m(!0);
|
|
1718
1718
|
}
|
|
1719
|
-
function
|
|
1719
|
+
function Qt() {
|
|
1720
1720
|
i.value.forEach((p, k) => {
|
|
1721
1721
|
var T;
|
|
1722
1722
|
const d = (T = y.value) == null ? void 0 : T[k];
|
|
1723
1723
|
p.wheelTo(d ?? 0);
|
|
1724
1724
|
});
|
|
1725
1725
|
}
|
|
1726
|
-
function
|
|
1726
|
+
function te() {
|
|
1727
1727
|
const p = e.value.length;
|
|
1728
1728
|
if (i.value.length <= p) return;
|
|
1729
1729
|
i.value.splice(p).forEach((d) => d.destroy());
|
|
1730
1730
|
}
|
|
1731
|
-
function
|
|
1731
|
+
function ee() {
|
|
1732
1732
|
t("cancel"), st();
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1735
|
-
i.value.some((T) => T.isInTransition) &&
|
|
1736
|
-
const { item: k, anchor: d } =
|
|
1734
|
+
function oe() {
|
|
1735
|
+
i.value.some((T) => T.isInTransition) && re();
|
|
1736
|
+
const { item: k, anchor: d } = ie();
|
|
1737
1737
|
t("confirm", k), t("update:anchor", d), st();
|
|
1738
1738
|
}
|
|
1739
1739
|
function st() {
|
|
1740
1740
|
t("update:isShowPicker", !1);
|
|
1741
1741
|
}
|
|
1742
|
-
function
|
|
1742
|
+
function re() {
|
|
1743
1743
|
i.value.forEach((p) => p.stop());
|
|
1744
1744
|
}
|
|
1745
|
-
function
|
|
1745
|
+
function ie() {
|
|
1746
1746
|
const { item: p, anchor: k } = i.value.reduce(
|
|
1747
1747
|
(d, T, at) => {
|
|
1748
1748
|
const wt = T.getSelectedIndex(), lt = e.value[at][wt];
|
|
@@ -1752,14 +1752,14 @@ function so(o, t) {
|
|
|
1752
1752
|
);
|
|
1753
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
1761
|
(p) => p && m()
|
|
1762
|
-
),
|
|
1762
|
+
), ht(
|
|
1763
1763
|
() => o.type,
|
|
1764
1764
|
() => {
|
|
1765
1765
|
P(), m(!0);
|
|
@@ -1767,12 +1767,22 @@ function so(o, t) {
|
|
|
1767
1767
|
), {
|
|
1768
1768
|
pickerData: e,
|
|
1769
1769
|
wheelWrapper: r,
|
|
1770
|
-
cancel:
|
|
1771
|
-
confirm:
|
|
1770
|
+
cancel: ee,
|
|
1771
|
+
confirm: oe,
|
|
1772
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,18 +1795,7 @@ const te = (o) => (ce("data-v-8b355dbe"), o = o(), he(), o), ao = { 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 = b(() => ({
|
|
1789
|
-
cancelClass: "",
|
|
1790
|
-
confirmClass: "",
|
|
1791
|
-
titleClass: "",
|
|
1792
|
-
cancelColor: "#999",
|
|
1793
|
-
confirmColor: "#42b983",
|
|
1794
|
-
titleColor: "",
|
|
1795
|
-
cancelText: "Cancel",
|
|
1796
|
-
confirmText: "Confirm",
|
|
1797
|
-
titleText: "",
|
|
1798
|
-
...e.options
|
|
1799
|
-
})), n = b(() => i.value.cancelColor), s = b(() => i.value.confirmColor), l = b(() => i.value.titleColor), c = b(() => ot(e.showKey) ? e.showKey : [e.showKey]), { pickerData: a, wheelWrapper: h, cancel: u, confirm: v, closePicker: g } = so(e, r);
|
|
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);
|
|
1800
1799
|
return (f, y) => (W(), z("div", null, [
|
|
1801
1800
|
Pt(Et, { name: "fade" }, {
|
|
1802
1801
|
default: Ct(() => [
|
|
@@ -1812,44 +1811,44 @@ const te = (o) => (ce("data-v-8b355dbe"), o = o(), he(), o), ao = { class: "pick
|
|
|
1812
1811
|
}),
|
|
1813
1812
|
Pt(Et, { name: "slide" }, {
|
|
1814
1813
|
default: Ct(() => [
|
|
1815
|
-
Dt(S("div",
|
|
1816
|
-
S("div",
|
|
1814
|
+
Dt(S("div", io, [
|
|
1815
|
+
S("div", no, [
|
|
1817
1816
|
S("button", {
|
|
1818
|
-
class:
|
|
1817
|
+
class: ct(["picker_cancel", i.value.cancelClass]),
|
|
1819
1818
|
style: ut({ color: n.value }),
|
|
1820
1819
|
onClick: y[1] || (y[1] = //@ts-ignore
|
|
1821
1820
|
(...m) => D(u) && D(u)(...m))
|
|
1822
1821
|
}, j(i.value.cancelText), 7),
|
|
1823
1822
|
S("button", {
|
|
1824
|
-
class:
|
|
1823
|
+
class: ct(["picker_confirm", i.value.confirmClass]),
|
|
1825
1824
|
style: ut({ color: s.value }),
|
|
1826
1825
|
onClick: y[2] || (y[2] = //@ts-ignore
|
|
1827
1826
|
(...m) => D(v) && D(v)(...m))
|
|
1828
1827
|
}, j(i.value.confirmText), 7),
|
|
1829
1828
|
S("h4", {
|
|
1830
|
-
class:
|
|
1829
|
+
class: ct([i.value.titleClass]),
|
|
1831
1830
|
style: ut({ color: l.value })
|
|
1832
1831
|
}, j(i.value.titleText), 7)
|
|
1833
1832
|
]),
|
|
1834
|
-
S("div",
|
|
1835
|
-
|
|
1836
|
-
|
|
1833
|
+
S("div", so, [
|
|
1834
|
+
ao,
|
|
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
1841
|
(W(!0), z(xt, null, At(D(a), (m, A) => (W(), z("div", {
|
|
1843
1842
|
key: A,
|
|
1844
1843
|
class: "picker_wheel"
|
|
1845
1844
|
}, [
|
|
1846
|
-
S("ul",
|
|
1845
|
+
S("ul", ho, [
|
|
1847
1846
|
(W(!0), z(xt, null, At(m, (P, nt) => {
|
|
1848
1847
|
var $;
|
|
1849
1848
|
return W(), z("li", {
|
|
1850
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))
|
|
@@ -1863,15 +1862,7 @@ const te = (o) => (ce("data-v-8b355dbe"), o = o(), he(), o), ao = { class: "pick
|
|
|
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
|
-
}, Nt = /* @__PURE__ */ vo(fo, [["__scopeId", "data-v-8b355dbe"]]);
|
|
1872
|
-
Nt.install = function(o) {
|
|
1873
|
-
o.component("Picker", Nt);
|
|
1874
|
-
};
|
|
1865
|
+
});
|
|
1875
1866
|
export {
|
|
1876
|
-
|
|
1867
|
+
uo as default
|
|
1877
1868
|
};
|