@component-hook/picker 0.1.0 → 0.1.1
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/LICENSE +21 -0
- package/README.md +30 -118
- package/dist/index.css +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/picker.es.js +248 -245
- package/dist/picker.umd.js +3 -3
- package/package.json +6 -8
package/dist/picker.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import { ref as L, computed as
|
|
2
|
+
import { ref as L, computed as P, watch as lt, nextTick as ne, defineComponent as se, openBlock as z, createElementBlock as K, Fragment as ct, createVNode as wt, Transition as Pt, withCtx as Et, withDirectives as Ct, createElementVNode as w, unref as x, vShow as Dt, normalizeClass as ht, normalizeStyle as ut, toDisplayString as j, renderList as Bt, pushScopeId as ae, popScopeId as le } from "vue";
|
|
3
3
|
/*!
|
|
4
4
|
* better-scroll / core
|
|
5
5
|
* (c) 2016-2023 ustbhuangyi
|
|
@@ -26,7 +26,7 @@ var mt = function(o, t) {
|
|
|
26
26
|
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
27
27
|
}, mt(o, t);
|
|
28
28
|
};
|
|
29
|
-
function
|
|
29
|
+
function rt(o, t) {
|
|
30
30
|
mt(o, t);
|
|
31
31
|
function e() {
|
|
32
32
|
this.constructor = o;
|
|
@@ -42,7 +42,7 @@ var N = function() {
|
|
|
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++)
|
|
@@ -135,10 +135,10 @@ var ce = [
|
|
|
135
135
|
key: "resetPosition"
|
|
136
136
|
}
|
|
137
137
|
];
|
|
138
|
-
function
|
|
138
|
+
function Q(o) {
|
|
139
139
|
console.error("[BScroll warn]: " + o);
|
|
140
140
|
}
|
|
141
|
-
var
|
|
141
|
+
var E = typeof window < "u", W = E && navigator.userAgent.toLowerCase(), he = !!(W && /wechatdevtools/.test(W)), ue = W && W.indexOf("android") > 0, pe = function() {
|
|
142
142
|
if (typeof W == "string") {
|
|
143
143
|
var o = /os (\d\d?_\d(_\d)?)/, t = o.exec(W);
|
|
144
144
|
if (!t)
|
|
@@ -149,17 +149,17 @@ var D = typeof window < "u", W = D && navigator.userAgent.toLowerCase(), he = !!
|
|
|
149
149
|
return e[0] === 13 && e[1] >= 4;
|
|
150
150
|
}
|
|
151
151
|
return !1;
|
|
152
|
-
}(),
|
|
153
|
-
if (
|
|
152
|
+
}(), Nt = !1;
|
|
153
|
+
if (E) {
|
|
154
154
|
var fe = "test-passive";
|
|
155
155
|
try {
|
|
156
|
-
var
|
|
157
|
-
Object.defineProperty(
|
|
156
|
+
var xt = {};
|
|
157
|
+
Object.defineProperty(xt, "passive", {
|
|
158
158
|
get: function() {
|
|
159
|
-
|
|
159
|
+
Nt = !0;
|
|
160
160
|
}
|
|
161
161
|
}), window.addEventListener(fe, function() {
|
|
162
|
-
},
|
|
162
|
+
}, xt);
|
|
163
163
|
} catch {
|
|
164
164
|
}
|
|
165
165
|
}
|
|
@@ -174,11 +174,11 @@ var yt = function(o, t) {
|
|
|
174
174
|
function gt(o) {
|
|
175
175
|
return o == null;
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function At(o, t, e) {
|
|
178
178
|
return o < t ? t : o > e ? e : o;
|
|
179
179
|
}
|
|
180
|
-
var Tt =
|
|
181
|
-
if (!
|
|
180
|
+
var Tt = E && document.createElement("div").style, H = function() {
|
|
181
|
+
if (!E)
|
|
182
182
|
return !1;
|
|
183
183
|
for (var o = [
|
|
184
184
|
{
|
|
@@ -208,14 +208,14 @@ var Tt = D && document.createElement("div").style, H = function() {
|
|
|
208
208
|
}
|
|
209
209
|
return !1;
|
|
210
210
|
}();
|
|
211
|
-
function
|
|
211
|
+
function D(o) {
|
|
212
212
|
return H === !1 ? o : H === "standard" ? o === "transitionEnd" ? "transitionend" : o : H + o.charAt(0).toUpperCase() + o.substr(1);
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Rt(o) {
|
|
215
215
|
return typeof o == "string" ? document.querySelector(o) : o;
|
|
216
216
|
}
|
|
217
217
|
function ve(o, t, e, r) {
|
|
218
|
-
var i =
|
|
218
|
+
var i = Nt ? {
|
|
219
219
|
passive: !1,
|
|
220
220
|
capture: !!r
|
|
221
221
|
} : !!r;
|
|
@@ -226,7 +226,7 @@ function de(o, t, e, r) {
|
|
|
226
226
|
capture: !!r
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function Vt(o) {
|
|
230
230
|
o.cancelable && o.preventDefault();
|
|
231
231
|
}
|
|
232
232
|
function Yt(o) {
|
|
@@ -238,15 +238,15 @@ function Yt(o) {
|
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
240
|
H && H !== "standard" && "" + H.toLowerCase();
|
|
241
|
-
var me =
|
|
241
|
+
var me = D("transform"), $t = D("transition"), ye = E && D("perspective") in Tt, Mt = E && ("ontouchstart" in window || he), ge = E && $t in Tt, _ = {
|
|
242
242
|
transform: me,
|
|
243
|
-
transition:
|
|
244
|
-
transitionTimingFunction:
|
|
245
|
-
transitionDuration:
|
|
246
|
-
transitionDelay:
|
|
247
|
-
transformOrigin:
|
|
248
|
-
transitionEnd:
|
|
249
|
-
transitionProperty:
|
|
243
|
+
transition: $t,
|
|
244
|
+
transitionTimingFunction: D("transitionTimingFunction"),
|
|
245
|
+
transitionDuration: D("transitionDuration"),
|
|
246
|
+
transitionDelay: D("transitionDelay"),
|
|
247
|
+
transformOrigin: D("transformOrigin"),
|
|
248
|
+
transitionEnd: D("transitionEnd"),
|
|
249
|
+
transitionProperty: D("transitionProperty")
|
|
250
250
|
}, pt = {
|
|
251
251
|
touchstart: 1,
|
|
252
252
|
touchmove: 1,
|
|
@@ -256,7 +256,7 @@ var me = B("transform"), jt = B("transition"), ye = D && B("perspective") in Tt,
|
|
|
256
256
|
mousemove: 2,
|
|
257
257
|
mouseup: 2
|
|
258
258
|
};
|
|
259
|
-
function
|
|
259
|
+
function Xt(o) {
|
|
260
260
|
if (o instanceof window.SVGElement) {
|
|
261
261
|
var t = o.getBoundingClientRect();
|
|
262
262
|
return {
|
|
@@ -284,7 +284,7 @@ function Te(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 jt(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]);
|
|
@@ -303,17 +303,17 @@ function Ut(o, t) {
|
|
|
303
303
|
cancelable: s
|
|
304
304
|
}, u), r));
|
|
305
305
|
} catch {
|
|
306
|
-
|
|
306
|
+
v();
|
|
307
307
|
}
|
|
308
308
|
else
|
|
309
|
-
|
|
310
|
-
function
|
|
309
|
+
v();
|
|
310
|
+
function v() {
|
|
311
311
|
i = document.createEvent("Event"), i.initEvent(t, n, s), yt(i, r);
|
|
312
312
|
}
|
|
313
313
|
i.forwardedTouchEvent = !0, i._constructed = !0, o.target.dispatchEvent(i);
|
|
314
314
|
}
|
|
315
315
|
function Se(o) {
|
|
316
|
-
|
|
316
|
+
jt(o, "dblclick");
|
|
317
317
|
}
|
|
318
318
|
var X = {
|
|
319
319
|
// easeOutQuint
|
|
@@ -337,25 +337,25 @@ var X = {
|
|
|
337
337
|
return 1 - --o * o * o * o;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
},
|
|
341
|
-
function
|
|
340
|
+
}, be = 1e3 / 60, A = E && window;
|
|
341
|
+
function Ut() {
|
|
342
342
|
}
|
|
343
|
-
var
|
|
344
|
-
return
|
|
343
|
+
var qt = function() {
|
|
344
|
+
return E ? A.requestAnimationFrame || A.webkitRequestAnimationFrame || A.mozRequestAnimationFrame || A.oRequestAnimationFrame || // if all else fails, use setTimeout
|
|
345
345
|
function(o) {
|
|
346
|
-
return window.setTimeout(o, o.interval ||
|
|
347
|
-
} :
|
|
346
|
+
return window.setTimeout(o, o.interval || be);
|
|
347
|
+
} : Ut;
|
|
348
348
|
}(), I = function() {
|
|
349
|
-
return
|
|
349
|
+
return E ? A.cancelAnimationFrame || A.webkitCancelAnimationFrame || A.mozCancelAnimationFrame || A.oCancelAnimationFrame || function(o) {
|
|
350
350
|
window.clearTimeout(o);
|
|
351
|
-
} :
|
|
352
|
-
}(),
|
|
351
|
+
} : Ut;
|
|
352
|
+
}(), _t = function(o) {
|
|
353
353
|
}, ft = {
|
|
354
354
|
enumerable: !0,
|
|
355
355
|
configurable: !0,
|
|
356
|
-
get:
|
|
357
|
-
set:
|
|
358
|
-
},
|
|
356
|
+
get: _t,
|
|
357
|
+
set: _t
|
|
358
|
+
}, we = 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;
|
|
@@ -370,7 +370,7 @@ var Gt = function() {
|
|
|
370
370
|
};
|
|
371
371
|
function Ee(o, t, e) {
|
|
372
372
|
ft.get = function() {
|
|
373
|
-
return
|
|
373
|
+
return we(this, t);
|
|
374
374
|
}, ft.set = function(i) {
|
|
375
375
|
Pe(this, t, i);
|
|
376
376
|
}, Object.defineProperty(o, e, ft);
|
|
@@ -414,7 +414,7 @@ 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 =
|
|
417
|
+
for (var n = i.length, s = Kt(i), l, c = 0; c < n; c++) {
|
|
418
418
|
var a = s[c], h = a[0], u = a[1];
|
|
419
419
|
if (h && (l = h.apply(u, e), l === !0))
|
|
420
420
|
return l;
|
|
@@ -428,12 +428,12 @@ var Y = (
|
|
|
428
428
|
this.events = {}, this.eventTypes = {};
|
|
429
429
|
}, o.prototype.hasType = function(t) {
|
|
430
430
|
var e = this.eventTypes, r = e[t] === t;
|
|
431
|
-
r ||
|
|
431
|
+
r || Q('EventEmitter has used unknown event type: "' + t + '", should be oneof [' + ("" + Object.keys(e).map(function(i) {
|
|
432
432
|
return JSON.stringify(i);
|
|
433
433
|
})) + "]");
|
|
434
434
|
}, o;
|
|
435
435
|
}()
|
|
436
|
-
),
|
|
436
|
+
), tt = (
|
|
437
437
|
/** @class */
|
|
438
438
|
function() {
|
|
439
439
|
function o(t, e) {
|
|
@@ -467,7 +467,7 @@ var Y = (
|
|
|
467
467
|
), De = (
|
|
468
468
|
/** @class */
|
|
469
469
|
function(o) {
|
|
470
|
-
|
|
470
|
+
rt(t, o);
|
|
471
471
|
function t() {
|
|
472
472
|
var e = o.call(this) || this;
|
|
473
473
|
return e.startX = 0, e.startY = 0, e.scrollX = !1, e.scrollY = !0, e.freeScroll = !1, e.directionLockThreshold = 0, e.eventPassthrough = "", e.click = !1, e.dblclick = !1, e.tap = "", e.bounce = {
|
|
@@ -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 = Mt, e.disableTouch = !Mt, 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)
|
|
@@ -548,7 +548,7 @@ var Y = (
|
|
|
548
548
|
}, {
|
|
549
549
|
name: "mouseup",
|
|
550
550
|
handler: this.end.bind(this)
|
|
551
|
-
})), this.wrapperEventRegister = new
|
|
551
|
+
})), this.wrapperEventRegister = new tt(s, c), 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() {
|
|
@@ -634,7 +634,7 @@ var Y = (
|
|
|
634
634
|
this.hooks.destroy();
|
|
635
635
|
}, o;
|
|
636
636
|
}()
|
|
637
|
-
),
|
|
637
|
+
), Gt = (
|
|
638
638
|
/** @class */
|
|
639
639
|
function() {
|
|
640
640
|
function o(t, e, r) {
|
|
@@ -666,21 +666,21 @@ var Y = (
|
|
|
666
666
|
}()
|
|
667
667
|
), Ae = function(o, t, e, r) {
|
|
668
668
|
var i = function(a, h) {
|
|
669
|
-
var u = a - h,
|
|
670
|
-
return
|
|
669
|
+
var u = a - h, v = u > 0 ? -1 : u < 0 ? 1 : 0;
|
|
670
|
+
return v;
|
|
671
671
|
}, n = i(t.x, o.x), s = i(t.y, o.y), l = e.x - r.x, c = e.y - r.y;
|
|
672
672
|
return n * l <= 0 && s * c <= 0;
|
|
673
|
-
},
|
|
673
|
+
}, Ye = (
|
|
674
674
|
/** @class */
|
|
675
675
|
function(o) {
|
|
676
|
-
|
|
676
|
+
rt(t, o);
|
|
677
677
|
function t() {
|
|
678
678
|
return o !== null && o.apply(this, arguments) || this;
|
|
679
679
|
}
|
|
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
|
-
Ae(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 =
|
|
683
|
+
Ae(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 = qt(s));
|
|
684
684
|
};
|
|
685
685
|
this.callStopWhenPending && this.setCallStop(!1), I(this.timer), s();
|
|
686
686
|
}, t.prototype.transitionTime = function(e) {
|
|
@@ -705,11 +705,11 @@ var Y = (
|
|
|
705
705
|
var e = this.doStop();
|
|
706
706
|
e && this.hooks.trigger(this.hooks.eventTypes.callStop);
|
|
707
707
|
}, t;
|
|
708
|
-
}(
|
|
709
|
-
),
|
|
708
|
+
}(Gt)
|
|
709
|
+
), Me = (
|
|
710
710
|
/** @class */
|
|
711
711
|
function(o) {
|
|
712
|
-
|
|
712
|
+
rt(t, o);
|
|
713
713
|
function t() {
|
|
714
714
|
return o !== null && o.apply(this, arguments) || this;
|
|
715
715
|
}
|
|
@@ -727,11 +727,11 @@ var Y = (
|
|
|
727
727
|
return;
|
|
728
728
|
}
|
|
729
729
|
u = (u - l) / i;
|
|
730
|
-
var
|
|
731
|
-
Object.keys(r).forEach(function(
|
|
732
|
-
var T = e[
|
|
733
|
-
y[
|
|
734
|
-
}), s.translate(y), a && s.hooks.trigger(s.hooks.eventTypes.move, y), s.pending && (s.timer =
|
|
730
|
+
var v = n(u), y = {};
|
|
731
|
+
Object.keys(r).forEach(function(d) {
|
|
732
|
+
var T = e[d], f = r[d];
|
|
733
|
+
y[d] = (f - T) * v + T;
|
|
734
|
+
}), s.translate(y), a && s.hooks.trigger(s.hooks.eventTypes.move, y), s.pending && (s.timer = qt(h)), s.pending || (s.callStopWhenPending ? s.callStopWhenPending = !1 : s.hooks.trigger(s.hooks.eventTypes.end, r));
|
|
735
735
|
};
|
|
736
736
|
this.setPending(!0), this.callStopWhenPending && this.setCallStop(!1), I(this.timer), h();
|
|
737
737
|
}, t.prototype.doStop = function() {
|
|
@@ -746,7 +746,7 @@ var Y = (
|
|
|
746
746
|
var e = this.doStop();
|
|
747
747
|
e && this.hooks.trigger(this.hooks.eventTypes.callStop);
|
|
748
748
|
}, t;
|
|
749
|
-
}(
|
|
749
|
+
}(Gt)
|
|
750
750
|
);
|
|
751
751
|
function Xe(o, t, e) {
|
|
752
752
|
var r = e.useTransition, i = {};
|
|
@@ -756,9 +756,9 @@ function Xe(o, t, e) {
|
|
|
756
756
|
get: function() {
|
|
757
757
|
return e.probeType;
|
|
758
758
|
}
|
|
759
|
-
}), r ? new
|
|
759
|
+
}), r ? new Ye(o, t, i) : new Me(o, t, i);
|
|
760
760
|
}
|
|
761
|
-
var
|
|
761
|
+
var Ot = (
|
|
762
762
|
/** @class */
|
|
763
763
|
function() {
|
|
764
764
|
function o(t, e, r) {
|
|
@@ -799,19 +799,19 @@ var It = (
|
|
|
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 c = t - e, a = Math.abs(c) / r, h = l.deceleration, u = l.swipeBounceTime,
|
|
802
|
+
var c = t - e, a = Math.abs(c) / r, h = l.deceleration, u = l.swipeBounceTime, v = l.swipeTime, y = Math.min(v, a * 2 / h), d = {
|
|
803
803
|
destination: t + a * a / h * (c < 0 ? -1 : 1),
|
|
804
804
|
duration: y,
|
|
805
805
|
rate: 15
|
|
806
806
|
};
|
|
807
|
-
return this.hooks.trigger(this.hooks.eventTypes.momentum,
|
|
807
|
+
return this.hooks.trigger(this.hooks.eventTypes.momentum, d, c), d.destination < i ? (d.destination = s ? Math.max(i - s / 4, i - s / d.rate * a) : i, d.duration = u) : d.destination > n && (d.destination = s ? Math.min(n + s / 4, n + s / d.rate * a) : n, d.duration = u), d.destination = Math.round(d.destination), d;
|
|
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 = Xt(this.wrapper);
|
|
813
813
|
this.wrapperSize = this.wrapper[r === "width" ? "clientWidth" : "clientHeight"], this.setContent(t);
|
|
814
|
-
var l =
|
|
814
|
+
var l = Xt(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 It = (
|
|
|
857
857
|
this.hooks.destroy();
|
|
858
858
|
}, o;
|
|
859
859
|
}()
|
|
860
|
-
), q, G, Z,
|
|
860
|
+
), U, q, G, Z, It = (U = {}, U.yes = function(o) {
|
|
861
861
|
return !0;
|
|
862
|
-
},
|
|
863
|
-
return
|
|
864
|
-
},
|
|
862
|
+
}, U.no = function(o) {
|
|
863
|
+
return Vt(o), !1;
|
|
864
|
+
}, U), _e = (q = {}, q.horizontal = (G = {}, G.yes = "horizontal", G.no = "vertical", G), q.vertical = (Z = {}, Z.yes = "vertical", Z.no = "horizontal", Z), q), Oe = (
|
|
865
865
|
/** @class */
|
|
866
866
|
function() {
|
|
867
867
|
function o(t, e, r) {
|
|
@@ -882,9 +882,9 @@ var It = (
|
|
|
882
882
|
var e = _e[this.directionLocked];
|
|
883
883
|
if (e) {
|
|
884
884
|
if (this.eventPassthrough === e.yes)
|
|
885
|
-
return
|
|
885
|
+
return It.yes(t);
|
|
886
886
|
if (this.eventPassthrough === e.no)
|
|
887
|
-
return
|
|
887
|
+
return It.no(t);
|
|
888
888
|
}
|
|
889
889
|
return !1;
|
|
890
890
|
}, o;
|
|
@@ -939,8 +939,8 @@ var It = (
|
|
|
939
939
|
var l = this.directionLockAction.adjustDelta(t, e), c = this.scrollBehaviorX.getCurrentPos(), a = this.scrollBehaviorX.move(l.deltaX), h = 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
|
|
943
|
-
!this.contentMoved && !
|
|
942
|
+
var v = a !== c || u !== h;
|
|
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
|
|
946
946
|
}), this.dispatchScroll(s));
|
|
@@ -962,9 +962,9 @@ var It = (
|
|
|
962
962
|
}, o.prototype.ensureIntegerPos = function(t) {
|
|
963
963
|
this.ensuringInteger = !0;
|
|
964
964
|
var e = t.x, r = t.y, i = this.scrollBehaviorX, n = i.minScrollPos, s = i.maxScrollPos, l = this.scrollBehaviorY, c = 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 =
|
|
965
|
+
return e = e > 0 ? Math.ceil(e) : Math.floor(e), r = r > 0 ? Math.ceil(r) : Math.floor(r), e = At(e, s, n), r = At(r, a, c), { x: e, y: r };
|
|
966
966
|
}, o.prototype.handleClick = function(t) {
|
|
967
|
-
R(t.target, this.options.preventDefaultException) || (
|
|
967
|
+
R(t.target, this.options.preventDefaultException) || (Vt(t), t.stopPropagation());
|
|
968
968
|
}, o.prototype.getCurrentPos = function() {
|
|
969
969
|
return {
|
|
970
970
|
x: this.scrollBehaviorX.getCurrentPos(),
|
|
@@ -993,7 +993,7 @@ function He(o) {
|
|
|
993
993
|
}, {});
|
|
994
994
|
return t;
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function Lt(o, t, e, r) {
|
|
997
997
|
var i = [
|
|
998
998
|
"momentum",
|
|
999
999
|
"momentumLimitTime",
|
|
@@ -1014,7 +1014,7 @@ function kt(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
|
}
|
|
@@ -1026,7 +1026,7 @@ function Fe(o, t) {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
return !0;
|
|
1028
1028
|
}
|
|
1029
|
-
var
|
|
1029
|
+
var Ht = 1, We = (
|
|
1030
1030
|
/** @class */
|
|
1031
1031
|
function() {
|
|
1032
1032
|
function o(t, e, r) {
|
|
@@ -1050,15 +1050,15 @@ var Ft = 1, We = (
|
|
|
1050
1050
|
"beforeRefresh"
|
|
1051
1051
|
]), this.options = r;
|
|
1052
1052
|
var i = this.options.bounce, n = i.left, s = i.right, l = i.top, c = i.bottom;
|
|
1053
|
-
this.scrollBehaviorX = new
|
|
1053
|
+
this.scrollBehaviorX = new Ot(t, e, Lt(r, "scrollX", [n, s], {
|
|
1054
1054
|
size: "width",
|
|
1055
1055
|
position: "left"
|
|
1056
|
-
})), this.scrollBehaviorY = new
|
|
1056
|
+
})), this.scrollBehaviorY = new Ot(t, e, Lt(r, "scrollY", [l, c], {
|
|
1057
1057
|
size: "height",
|
|
1058
1058
|
position: "top"
|
|
1059
1059
|
})), this.translater = new xe(this.content), this.animater = Xe(this.content, this.translater, this.options), this.actionsHandler = new Be(this.options.bindToTarget ? this.content : t, He(this.options)), this.actions = new Le(this.scrollBehaviorX, this.scrollBehaviorY, this.actionsHandler, this.animater, this.options);
|
|
1060
1060
|
var a = this.resize.bind(this);
|
|
1061
|
-
this.resizeRegister = new
|
|
1061
|
+
this.resizeRegister = new tt(window, [
|
|
1062
1062
|
{
|
|
1063
1063
|
name: "orientationchange",
|
|
1064
1064
|
handler: a
|
|
@@ -1075,7 +1075,7 @@ var Ft = 1, We = (
|
|
|
1075
1075
|
t.togglePointerEvents(!0);
|
|
1076
1076
|
});
|
|
1077
1077
|
}, o.prototype.registerTransitionEnd = function() {
|
|
1078
|
-
this.transitionEndRegister = new
|
|
1078
|
+
this.transitionEndRegister = new tt(this.content, [
|
|
1079
1079
|
{
|
|
1080
1080
|
name: _.transitionEnd,
|
|
1081
1081
|
handler: this.transitionEnd.bind(this)
|
|
@@ -1176,7 +1176,7 @@ var Ft = 1, We = (
|
|
|
1176
1176
|
var n = r.delay, s = n === void 0 ? 300 : n;
|
|
1177
1177
|
O() - this.lastClickTime < s && (i = !0, Se(t));
|
|
1178
1178
|
}
|
|
1179
|
-
return this.options.tap && Te(t, this.options.tap), this.options.click && !R(t.target, this.options.preventDefaultException) &&
|
|
1179
|
+
return this.options.tap && Te(t, this.options.tap), this.options.click && !R(t.target, this.options.preventDefaultException) && jt(t), this.lastClickTime = i ? null : O(), !0;
|
|
1180
1180
|
}
|
|
1181
1181
|
return !1;
|
|
1182
1182
|
}, o.prototype.resize = function() {
|
|
@@ -1216,15 +1216,15 @@ var Ft = 1, We = (
|
|
|
1216
1216
|
}, n.end);
|
|
1217
1217
|
if (this.hooks.trigger(this.hooks.eventTypes.scrollTo, a), !Fe(c, a)) {
|
|
1218
1218
|
var h = Math.abs(a.x - c.x), u = Math.abs(a.y - c.y);
|
|
1219
|
-
h <
|
|
1219
|
+
h < Ht && u < Ht && (r = 0, this.hooks.trigger(this.hooks.eventTypes.minDistanceScroll)), this.animater.move(c, a, r, s);
|
|
1220
1220
|
}
|
|
1221
1221
|
}, o.prototype.scrollToElement = function(t, e, r, i, n) {
|
|
1222
|
-
var s =
|
|
1223
|
-
return typeof h == "number" ? h : h ? Math.round(u / 2 -
|
|
1222
|
+
var s = Rt(t), l = Yt(s), c = function(h, u, v) {
|
|
1223
|
+
return typeof h == "number" ? h : h ? Math.round(u / 2 - v / 2) : 0;
|
|
1224
1224
|
};
|
|
1225
1225
|
r = c(r, s.offsetWidth, this.wrapper.offsetWidth), i = c(i, s.offsetHeight, this.wrapper.offsetHeight);
|
|
1226
|
-
var a = function(h, u,
|
|
1227
|
-
return h -= u, h = y.adjustPosition(h -
|
|
1226
|
+
var a = function(h, u, v, y) {
|
|
1227
|
+
return h -= u, h = y.adjustPosition(h - v), h;
|
|
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) {
|
|
@@ -1258,10 +1258,10 @@ var Ft = 1, We = (
|
|
|
1258
1258
|
});
|
|
1259
1259
|
}, o;
|
|
1260
1260
|
}()
|
|
1261
|
-
),
|
|
1261
|
+
), it = (
|
|
1262
1262
|
/** @class */
|
|
1263
1263
|
function(o) {
|
|
1264
|
-
|
|
1264
|
+
rt(t, o);
|
|
1265
1265
|
function t(e, r) {
|
|
1266
1266
|
var i = o.call(this, [
|
|
1267
1267
|
"refresh",
|
|
@@ -1276,7 +1276,7 @@ var Ft = 1, We = (
|
|
|
1276
1276
|
"touchEnd",
|
|
1277
1277
|
"flick",
|
|
1278
1278
|
"destroy"
|
|
1279
|
-
]) || this, n =
|
|
1279
|
+
]) || this, n = Rt(e);
|
|
1280
1280
|
return n ? (i.plugins = {}, i.options = new De().merge(r).process(), i.setContent(n).valid && (i.hooks = new Y([
|
|
1281
1281
|
"refresh",
|
|
1282
1282
|
"enable",
|
|
@@ -1284,20 +1284,20 @@ var Ft = 1, We = (
|
|
|
1284
1284
|
"destroy",
|
|
1285
1285
|
"beforeInitialScrollTo",
|
|
1286
1286
|
"contentChanged"
|
|
1287
|
-
]), i.init(n)), i) : (
|
|
1287
|
+
]), i.init(n)), i) : (Q("Can not resolve the wrapper DOM."), i);
|
|
1288
1288
|
}
|
|
1289
1289
|
return t.use = function(e) {
|
|
1290
1290
|
var r = e.pluginName, i = t.plugins.some(function(n) {
|
|
1291
1291
|
return e === n.ctor;
|
|
1292
1292
|
});
|
|
1293
|
-
return i ? t : gt(r) ? (
|
|
1293
|
+
return i ? t : gt(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
|
|
1297
1297
|
}), t);
|
|
1298
1298
|
}, t.prototype.setContent = function(e) {
|
|
1299
1299
|
var r = !1, i = !0, n = e.children[this.options.specifiedIndexAsContent];
|
|
1300
|
-
return n ? (r = this.content !== n, r && (this.content = n)) : (
|
|
1300
|
+
return n ? (r = this.content !== n, r && (this.content = n)) : (Q("The wrapper need at least one child element to be content element to scroll."), i = !1), {
|
|
1301
1301
|
valid: i,
|
|
1302
1302
|
contentChanged: r
|
|
1303
1303
|
};
|
|
@@ -1361,23 +1361,23 @@ var Ft = 1, We = (
|
|
|
1361
1361
|
}(Y)
|
|
1362
1362
|
);
|
|
1363
1363
|
function V(o, t) {
|
|
1364
|
-
var e = new
|
|
1364
|
+
var e = new it(o, t);
|
|
1365
1365
|
return e;
|
|
1366
1366
|
}
|
|
1367
|
-
V.use =
|
|
1368
|
-
V.plugins =
|
|
1369
|
-
V.pluginsMap =
|
|
1367
|
+
V.use = it.use;
|
|
1368
|
+
V.plugins = it.plugins;
|
|
1369
|
+
V.pluginsMap = it.pluginsMap;
|
|
1370
1370
|
var ze = V;
|
|
1371
1371
|
/*!
|
|
1372
1372
|
* better-scroll / wheel
|
|
1373
1373
|
* (c) 2016-2023 ustbhuangyi
|
|
1374
1374
|
* Released under the MIT License.
|
|
1375
1375
|
*/
|
|
1376
|
-
var $ = typeof window < "u",
|
|
1377
|
-
|
|
1376
|
+
var $ = typeof window < "u", et = $ && navigator.userAgent.toLowerCase();
|
|
1377
|
+
et && et.indexOf("android") > 0;
|
|
1378
1378
|
(function() {
|
|
1379
|
-
if (typeof
|
|
1380
|
-
var o = /os (\d\d?_\d(_\d)?)/, t = o.exec(
|
|
1379
|
+
if (typeof et == "string") {
|
|
1380
|
+
var o = /os (\d\d?_\d(_\d)?)/, t = o.exec(et);
|
|
1381
1381
|
if (!t)
|
|
1382
1382
|
return !1;
|
|
1383
1383
|
var e = t[1].split("_").map(function(r) {
|
|
@@ -1391,13 +1391,13 @@ var Ke = !1;
|
|
|
1391
1391
|
if ($) {
|
|
1392
1392
|
var Ne = "test-passive";
|
|
1393
1393
|
try {
|
|
1394
|
-
var
|
|
1395
|
-
Object.defineProperty(
|
|
1394
|
+
var Ft = {};
|
|
1395
|
+
Object.defineProperty(Ft, "passive", {
|
|
1396
1396
|
get: function() {
|
|
1397
1397
|
Ke = !0;
|
|
1398
1398
|
}
|
|
1399
1399
|
}), window.addEventListener(Ne, function() {
|
|
1400
|
-
},
|
|
1400
|
+
}, Ft);
|
|
1401
1401
|
} catch {
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
@@ -1405,7 +1405,7 @@ var Re = function(o, t) {
|
|
|
1405
1405
|
for (var e in t)
|
|
1406
1406
|
o[e] = t[e];
|
|
1407
1407
|
return o;
|
|
1408
|
-
},
|
|
1408
|
+
}, Zt = $ && document.createElement("div").style, F = function() {
|
|
1409
1409
|
if (!$)
|
|
1410
1410
|
return !1;
|
|
1411
1411
|
for (var o = [
|
|
@@ -1431,28 +1431,28 @@ 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 (Zt[r.value] !== void 0)
|
|
1435
1435
|
return r.key;
|
|
1436
1436
|
}
|
|
1437
1437
|
return !1;
|
|
1438
1438
|
}();
|
|
1439
|
-
function
|
|
1439
|
+
function B(o) {
|
|
1440
1440
|
return F === !1 ? o : F === "standard" ? o === "transitionEnd" ? "transitionend" : o : F + o.charAt(0).toUpperCase() + o.substr(1);
|
|
1441
1441
|
}
|
|
1442
1442
|
F && F !== "standard" && "" + F.toLowerCase();
|
|
1443
|
-
var Ve =
|
|
1444
|
-
$ &&
|
|
1443
|
+
var Ve = B("transform"), $e = B("transition");
|
|
1444
|
+
$ && B("perspective") in Zt;
|
|
1445
1445
|
var dt = {
|
|
1446
1446
|
transform: Ve,
|
|
1447
1447
|
transition: $e,
|
|
1448
|
-
transitionTimingFunction:
|
|
1449
|
-
transitionDuration:
|
|
1450
|
-
transitionDelay:
|
|
1451
|
-
transformOrigin:
|
|
1452
|
-
transitionEnd:
|
|
1453
|
-
transitionProperty:
|
|
1448
|
+
transitionTimingFunction: B("transitionTimingFunction"),
|
|
1449
|
+
transitionDuration: B("transitionDuration"),
|
|
1450
|
+
transitionDelay: B("transitionDelay"),
|
|
1451
|
+
transformOrigin: B("transformOrigin"),
|
|
1452
|
+
transitionEnd: B("transitionEnd"),
|
|
1453
|
+
transitionProperty: B("transitionProperty")
|
|
1454
1454
|
};
|
|
1455
|
-
function
|
|
1455
|
+
function J(o, t) {
|
|
1456
1456
|
var e = new RegExp("(^|\\s)" + t + "(\\s|$)");
|
|
1457
1457
|
return e.test(o.className);
|
|
1458
1458
|
}
|
|
@@ -1499,7 +1499,7 @@ var Ue = {
|
|
|
1499
1499
|
key: o.key,
|
|
1500
1500
|
sourceKey: qe + "." + o.name
|
|
1501
1501
|
};
|
|
1502
|
-
}),
|
|
1502
|
+
}), Wt = "wheelIndexChanged", Je = {
|
|
1503
1503
|
rate: 4
|
|
1504
1504
|
}, Qe = (
|
|
1505
1505
|
/** @class */
|
|
@@ -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(Ze), this.scroll.registerType([
|
|
1513
|
+
this.scroll.proxy(Ze), this.scroll.registerType([Wt]);
|
|
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",
|
|
@@ -1541,7 +1541,7 @@ var Ue = {
|
|
|
1541
1541
|
var a = r.animater;
|
|
1542
1542
|
a.forceStopped === !0 && (a.forceStopped = !1);
|
|
1543
1543
|
}), r.hooks.on(r.hooks.eventTypes.scrollToElement, function(a, h) {
|
|
1544
|
-
if (
|
|
1544
|
+
if (J(a, t.options.wheelItemClass))
|
|
1545
1545
|
h.top = t.findNearestValidWheel(h.top).y;
|
|
1546
1546
|
else
|
|
1547
1547
|
return !0;
|
|
@@ -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(Wt, t);
|
|
1576
1576
|
}, o.prototype.getSelectedIndex = function() {
|
|
1577
1577
|
return this.selectedIndex;
|
|
1578
1578
|
}, o.prototype.wheelTo = function(t, e, r) {
|
|
@@ -1598,10 +1598,10 @@ var Ue = {
|
|
|
1598
1598
|
}
|
|
1599
1599
|
}, o.prototype.findNearestValidWheel = function(t) {
|
|
1600
1600
|
t = t > 0 ? 0 : t < this.scroll.maxScrollY ? this.scroll.maxScrollY : t;
|
|
1601
|
-
for (var e = Math.abs(Math.round(-t / this.itemHeight)), r = e, i = this.items, n = this.options.wheelDisabledItemClass; e >= 0 &&
|
|
1601
|
+
for (var e = Math.abs(Math.round(-t / this.itemHeight)), r = e, i = this.items, n = this.options.wheelDisabledItemClass; e >= 0 && J(i[e], n); )
|
|
1602
1602
|
e--;
|
|
1603
1603
|
if (e < 0)
|
|
1604
|
-
for (e = r; e <= i.length - 1 &&
|
|
1604
|
+
for (e = r; e <= i.length - 1 && J(i[e], n); )
|
|
1605
1605
|
e++;
|
|
1606
1606
|
return e === i.length && (e = r), {
|
|
1607
1607
|
index: this.wheelItemsAllDisabled ? -1 : e,
|
|
@@ -1611,134 +1611,132 @@ var Ue = {
|
|
|
1611
1611
|
var t = this.options.wheelDisabledItemClass, e = this.items;
|
|
1612
1612
|
this.wheelItemsAllDisabled = !0;
|
|
1613
1613
|
for (var r = 0; r < e.length; r++)
|
|
1614
|
-
if (!
|
|
1614
|
+
if (!J(e[r], t)) {
|
|
1615
1615
|
this.wheelItemsAllDisabled = !1;
|
|
1616
1616
|
break;
|
|
1617
1617
|
}
|
|
1618
1618
|
}, o.pluginName = "wheel", o;
|
|
1619
1619
|
}()
|
|
1620
1620
|
);
|
|
1621
|
-
const
|
|
1621
|
+
const ot = Array.isArray, to = (o) => typeof o == "object" && o !== null;
|
|
1622
1622
|
function St(o) {
|
|
1623
|
-
return
|
|
1623
|
+
return ot(o) && o.length === 3;
|
|
1624
1624
|
}
|
|
1625
|
-
function eo(
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
return m % 4 === 0 && (m % 100 !== 0 || m % 400 === 0);
|
|
1625
|
+
function eo() {
|
|
1626
|
+
const e = /* @__PURE__ */ new Date(), r = e.getFullYear(), i = e.getMonth() + 1, n = e.getDate(), s = L(r), l = L(i), c = y(1900, 2100), a = y(1, 12), h = P(() => {
|
|
1627
|
+
const f = [4, 6, 9, 11], S = [1, 3, 5, 7, 8, 10, 12], g = f.includes(l.value) ? 30 : S.includes(l.value) ? 31 : v(s.value) ? 29 : 28;
|
|
1628
|
+
return y(1, g);
|
|
1629
|
+
}), u = P(() => [c, a, h.value]);
|
|
1630
|
+
function v(f) {
|
|
1631
|
+
return f % 4 === 0 && (f % 100 !== 0 || f % 400 === 0);
|
|
1633
1632
|
}
|
|
1634
|
-
function
|
|
1635
|
-
const
|
|
1636
|
-
for (let
|
|
1637
|
-
|
|
1638
|
-
return
|
|
1633
|
+
function y(f, S) {
|
|
1634
|
+
const g = [];
|
|
1635
|
+
for (let C = f; C <= S; C++)
|
|
1636
|
+
g.push(C);
|
|
1637
|
+
return g;
|
|
1639
1638
|
}
|
|
1640
|
-
function
|
|
1641
|
-
return (St(
|
|
1642
|
-
const
|
|
1643
|
-
return
|
|
1639
|
+
function d(f) {
|
|
1640
|
+
return (St(f) ? f : [r, i, n]).map((g, C) => {
|
|
1641
|
+
const M = u.value[C].indexOf(g);
|
|
1642
|
+
return M > -1 ? M : 0;
|
|
1644
1643
|
});
|
|
1645
1644
|
}
|
|
1646
|
-
function
|
|
1647
|
-
const [S,
|
|
1648
|
-
|
|
1645
|
+
function T(f) {
|
|
1646
|
+
const [S, g] = f;
|
|
1647
|
+
s.value = u.value[0][S], l.value = u.value[1][g];
|
|
1649
1648
|
}
|
|
1650
1649
|
return {
|
|
1651
|
-
selectYear:
|
|
1652
|
-
selectMonth:
|
|
1653
|
-
dateList:
|
|
1654
|
-
updateDateSelect:
|
|
1655
|
-
getDateAnchors:
|
|
1650
|
+
selectYear: s,
|
|
1651
|
+
selectMonth: l,
|
|
1652
|
+
dateList: u,
|
|
1653
|
+
updateDateSelect: T,
|
|
1654
|
+
getDateAnchors: d
|
|
1656
1655
|
};
|
|
1657
1656
|
}
|
|
1658
|
-
function oo(
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
return h;
|
|
1657
|
+
function oo() {
|
|
1658
|
+
const o = i(0, 23), t = i(0, 59), e = i(0, 59), r = L([]);
|
|
1659
|
+
n();
|
|
1660
|
+
function i(l, c) {
|
|
1661
|
+
const a = [];
|
|
1662
|
+
for (let h = l; h <= c; h++)
|
|
1663
|
+
a.push(`${h}`.padStart(2, "0"));
|
|
1664
|
+
return a;
|
|
1667
1665
|
}
|
|
1668
|
-
function
|
|
1669
|
-
const
|
|
1670
|
-
|
|
1666
|
+
function n() {
|
|
1667
|
+
const l = /* @__PURE__ */ new Date(), c = l.getHours(), a = l.getMinutes(), h = l.getSeconds();
|
|
1668
|
+
r.value = [c, a, h];
|
|
1671
1669
|
}
|
|
1672
|
-
function l
|
|
1673
|
-
return (St(
|
|
1670
|
+
function s(l) {
|
|
1671
|
+
return (St(l) ? l : r.value).map((a) => +a);
|
|
1674
1672
|
}
|
|
1675
1673
|
return {
|
|
1676
|
-
timeList: [t, e
|
|
1677
|
-
updateDefaultTime:
|
|
1678
|
-
getTimeAnchors:
|
|
1674
|
+
timeList: [o, t, e],
|
|
1675
|
+
updateDefaultTime: n,
|
|
1676
|
+
getTimeAnchors: s
|
|
1679
1677
|
};
|
|
1680
1678
|
}
|
|
1681
1679
|
ze.use(Qe);
|
|
1682
1680
|
function ro(o, t) {
|
|
1683
|
-
const e = L([]), r = L(), i = L([]), n =
|
|
1684
|
-
async function
|
|
1685
|
-
p ?
|
|
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(), T = 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() : g(), await ne(), e.value.forEach((k, m) => C(m)), !p && Qt(), te();
|
|
1686
1684
|
}
|
|
1687
|
-
function
|
|
1685
|
+
function S() {
|
|
1688
1686
|
const p = {
|
|
1689
1687
|
date: a == null ? void 0 : a.value,
|
|
1690
|
-
time:
|
|
1691
|
-
}, k = o.type, b =
|
|
1688
|
+
time: v
|
|
1689
|
+
}, k = o.type, b = ot(o.data[0]) ? [...o.data] : [o.data];
|
|
1692
1690
|
e.value = p[k] ?? b;
|
|
1693
1691
|
}
|
|
1694
|
-
function
|
|
1695
|
-
n.value && h(T.value), s.value && !St(o.anchor) && y();
|
|
1692
|
+
function g() {
|
|
1693
|
+
!n.value && !s.value || (n.value && h(T.value), s.value && !St(o.anchor) && y());
|
|
1696
1694
|
}
|
|
1697
|
-
function
|
|
1695
|
+
function C(p) {
|
|
1698
1696
|
var b;
|
|
1699
1697
|
const k = (b = r.value) == null ? void 0 : b.children[p];
|
|
1700
|
-
if (!k)
|
|
1701
|
-
let
|
|
1702
|
-
if (
|
|
1703
|
-
|
|
1698
|
+
if (!k) return;
|
|
1699
|
+
let m = i.value[p];
|
|
1700
|
+
if (m)
|
|
1701
|
+
m.refresh();
|
|
1704
1702
|
else {
|
|
1705
|
-
const
|
|
1703
|
+
const st = V(k, {
|
|
1706
1704
|
wheel: {
|
|
1707
1705
|
selectedIndex: 0,
|
|
1708
1706
|
rotate: 25
|
|
1709
1707
|
},
|
|
1710
1708
|
swipeTime: o.swipeTime ?? 500
|
|
1711
1709
|
});
|
|
1712
|
-
|
|
1710
|
+
m = i.value[p] = st, m.on("scrollEnd", () => M(p));
|
|
1713
1711
|
}
|
|
1714
|
-
return
|
|
1712
|
+
return m;
|
|
1715
1713
|
}
|
|
1716
|
-
function
|
|
1714
|
+
function M(p) {
|
|
1717
1715
|
if (!n.value || p === 2) return;
|
|
1718
|
-
const k = i.value[p].getSelectedIndex(),
|
|
1719
|
-
p === 0 && (l.value =
|
|
1716
|
+
const k = i.value[p].getSelectedIndex(), m = a.value[p][k];
|
|
1717
|
+
p === 0 && (l.value = m), p === 1 && (c.value = m), f(!0);
|
|
1720
1718
|
}
|
|
1721
|
-
function
|
|
1719
|
+
function Qt() {
|
|
1722
1720
|
i.value.forEach((p, k) => {
|
|
1723
1721
|
var b;
|
|
1724
|
-
const
|
|
1725
|
-
p.wheelTo(
|
|
1722
|
+
const m = (b = T.value) == null ? void 0 : b[k];
|
|
1723
|
+
p.wheelTo(m ?? 0);
|
|
1726
1724
|
});
|
|
1727
1725
|
}
|
|
1728
1726
|
function te() {
|
|
1729
1727
|
const p = e.value.length;
|
|
1730
1728
|
if (i.value.length <= p) return;
|
|
1731
|
-
i.value.splice(p).forEach((
|
|
1729
|
+
i.value.splice(p).forEach((m) => m.destroy());
|
|
1732
1730
|
}
|
|
1733
1731
|
function ee() {
|
|
1734
|
-
t("cancel"),
|
|
1732
|
+
t("cancel"), nt();
|
|
1735
1733
|
}
|
|
1736
1734
|
function oe() {
|
|
1737
1735
|
i.value.some((b) => b.isInTransition) && re();
|
|
1738
|
-
const { item: k, anchor:
|
|
1739
|
-
t("confirm", k), t("update:anchor",
|
|
1736
|
+
const { item: k, anchor: m } = ie();
|
|
1737
|
+
t("confirm", k), t("update:anchor", m), nt();
|
|
1740
1738
|
}
|
|
1741
|
-
function
|
|
1739
|
+
function nt() {
|
|
1742
1740
|
t("update:isShowPicker", !1);
|
|
1743
1741
|
}
|
|
1744
1742
|
function re() {
|
|
@@ -1746,30 +1744,35 @@ function ro(o, t) {
|
|
|
1746
1744
|
}
|
|
1747
1745
|
function ie() {
|
|
1748
1746
|
const { item: p, anchor: k } = i.value.reduce(
|
|
1749
|
-
(
|
|
1750
|
-
const
|
|
1751
|
-
return
|
|
1747
|
+
(m, b, st) => {
|
|
1748
|
+
const bt = b.getSelectedIndex(), at = e.value[st][bt];
|
|
1749
|
+
return m.item.push(s.value ? +at : at), m.anchor.push(n.value ? at : bt), m;
|
|
1752
1750
|
},
|
|
1753
1751
|
{ item: [], anchor: [] }
|
|
1754
1752
|
);
|
|
1755
1753
|
return p.length > 1 ? { item: p, anchor: k } : { item: p[0], anchor: k[0] };
|
|
1756
1754
|
}
|
|
1757
|
-
return
|
|
1755
|
+
return lt(
|
|
1758
1756
|
() => o.data,
|
|
1759
|
-
() =>
|
|
1757
|
+
() => f(!0),
|
|
1760
1758
|
{ immediate: !0 }
|
|
1761
|
-
),
|
|
1759
|
+
), lt(
|
|
1762
1760
|
() => o.isShowPicker,
|
|
1763
|
-
(p) => p &&
|
|
1761
|
+
(p) => p && f()
|
|
1762
|
+
), lt(
|
|
1763
|
+
() => o.type,
|
|
1764
|
+
() => {
|
|
1765
|
+
g(), f(!0);
|
|
1766
|
+
}
|
|
1764
1767
|
), {
|
|
1765
1768
|
pickerData: e,
|
|
1766
1769
|
wheelWrapper: r,
|
|
1767
1770
|
cancel: ee,
|
|
1768
1771
|
confirm: oe,
|
|
1769
|
-
closePicker:
|
|
1772
|
+
closePicker: nt
|
|
1770
1773
|
};
|
|
1771
1774
|
}
|
|
1772
|
-
const
|
|
1775
|
+
const Jt = (o) => (ae("data-v-78632b89"), o = o(), le(), o), io = { class: "picker" }, no = { class: "picker_title" }, so = { class: "picker_panel" }, ao = /* @__PURE__ */ Jt(() => /* @__PURE__ */ w("div", { class: "picker_mask_top" }, null, -1)), lo = /* @__PURE__ */ Jt(() => /* @__PURE__ */ w("div", { class: "picker_mask_bottom" }, null, -1)), co = { class: "picker_wheel_scroll" }, ho = /* @__PURE__ */ se({
|
|
1773
1776
|
__name: "Picker",
|
|
1774
1777
|
props: {
|
|
1775
1778
|
data: { default: () => [] },
|
|
@@ -1782,7 +1785,7 @@ const Qt = (o) => (ae("data-v-f4d0313e"), o = o(), le(), o), io = { class: "pick
|
|
|
1782
1785
|
},
|
|
1783
1786
|
emits: ["update:isShowPicker", "update:anchor", "cancel", "confirm"],
|
|
1784
1787
|
setup(o, { emit: t }) {
|
|
1785
|
-
const e = o, r = t, i =
|
|
1788
|
+
const e = o, r = t, i = P(() => ({
|
|
1786
1789
|
cancelClass: "",
|
|
1787
1790
|
confirmClass: "",
|
|
1788
1791
|
titleClass: "",
|
|
@@ -1793,67 +1796,67 @@ const Qt = (o) => (ae("data-v-f4d0313e"), o = o(), le(), o), io = { class: "pick
|
|
|
1793
1796
|
confirmText: "Confirm",
|
|
1794
1797
|
titleText: "",
|
|
1795
1798
|
...e.options
|
|
1796
|
-
})), n =
|
|
1797
|
-
return (
|
|
1798
|
-
Pt
|
|
1799
|
-
default:
|
|
1800
|
-
|
|
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, T) => (z(), K(ct, null, [
|
|
1801
|
+
wt(Pt, { name: "fade" }, {
|
|
1802
|
+
default: Et(() => [
|
|
1803
|
+
Ct(w("div", {
|
|
1801
1804
|
class: "mask",
|
|
1802
1805
|
onClick: T[0] || (T[0] = //@ts-ignore
|
|
1803
|
-
(...
|
|
1806
|
+
(...f) => x(y) && x(y)(...f))
|
|
1804
1807
|
}, null, 512), [
|
|
1805
|
-
[
|
|
1808
|
+
[Dt, d.isShowPicker]
|
|
1806
1809
|
])
|
|
1807
1810
|
]),
|
|
1808
1811
|
_: 1
|
|
1809
1812
|
}),
|
|
1810
|
-
Pt
|
|
1811
|
-
default:
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1813
|
+
wt(Pt, { name: "slide" }, {
|
|
1814
|
+
default: Et(() => [
|
|
1815
|
+
Ct(w("div", io, [
|
|
1816
|
+
w("div", no, [
|
|
1817
|
+
w("button", {
|
|
1815
1818
|
class: ht(["picker_cancel", i.value.cancelClass]),
|
|
1816
1819
|
style: ut({ color: n.value }),
|
|
1817
1820
|
onClick: T[1] || (T[1] = //@ts-ignore
|
|
1818
|
-
(...
|
|
1819
|
-
},
|
|
1820
|
-
|
|
1821
|
+
(...f) => x(u) && x(u)(...f))
|
|
1822
|
+
}, j(i.value.cancelText), 7),
|
|
1823
|
+
w("button", {
|
|
1821
1824
|
class: ht(["picker_confirm", i.value.confirmClass]),
|
|
1822
1825
|
style: ut({ color: s.value }),
|
|
1823
1826
|
onClick: T[2] || (T[2] = //@ts-ignore
|
|
1824
|
-
(...
|
|
1825
|
-
},
|
|
1826
|
-
|
|
1827
|
+
(...f) => x(v) && x(v)(...f))
|
|
1828
|
+
}, j(i.value.confirmText), 7),
|
|
1829
|
+
w("h4", {
|
|
1827
1830
|
class: ht([i.value.titleClass]),
|
|
1828
1831
|
style: ut({ color: l.value })
|
|
1829
|
-
},
|
|
1832
|
+
}, j(i.value.titleText), 7)
|
|
1830
1833
|
]),
|
|
1831
|
-
|
|
1834
|
+
w("div", so, [
|
|
1832
1835
|
ao,
|
|
1833
1836
|
lo,
|
|
1834
|
-
|
|
1837
|
+
w("div", {
|
|
1835
1838
|
ref_key: "wheelWrapper",
|
|
1836
1839
|
ref: h,
|
|
1837
1840
|
class: "picker_wheel_wrapper"
|
|
1838
1841
|
}, [
|
|
1839
|
-
(z(!0), K(ct, null,
|
|
1840
|
-
key:
|
|
1842
|
+
(z(!0), K(ct, null, Bt(x(a), (f, S) => (z(), K("div", {
|
|
1843
|
+
key: S,
|
|
1841
1844
|
class: "picker_wheel"
|
|
1842
1845
|
}, [
|
|
1843
|
-
|
|
1844
|
-
(z(!0), K(ct, null,
|
|
1845
|
-
var
|
|
1846
|
+
w("ul", co, [
|
|
1847
|
+
(z(!0), K(ct, null, Bt(f, (g, C) => {
|
|
1848
|
+
var M;
|
|
1846
1849
|
return z(), K("li", {
|
|
1847
|
-
key:
|
|
1850
|
+
key: C,
|
|
1848
1851
|
class: "picker_wheel_item"
|
|
1849
|
-
},
|
|
1852
|
+
}, j((M = c.value) != null && M[S] && x(to)(g) ? g[c.value[S]] : g), 1);
|
|
1850
1853
|
}), 128))
|
|
1851
1854
|
])
|
|
1852
1855
|
]))), 128))
|
|
1853
1856
|
], 512)
|
|
1854
1857
|
])
|
|
1855
1858
|
], 512), [
|
|
1856
|
-
[
|
|
1859
|
+
[Dt, d.isShowPicker]
|
|
1857
1860
|
])
|
|
1858
1861
|
]),
|
|
1859
1862
|
_: 1
|
|
@@ -1865,10 +1868,10 @@ const Qt = (o) => (ae("data-v-f4d0313e"), o = o(), le(), o), io = { class: "pick
|
|
|
1865
1868
|
for (const [r, i] of t)
|
|
1866
1869
|
e[r] = i;
|
|
1867
1870
|
return e;
|
|
1868
|
-
},
|
|
1869
|
-
|
|
1870
|
-
o.component("Picker",
|
|
1871
|
+
}, zt = /* @__PURE__ */ uo(ho, [["__scopeId", "data-v-78632b89"]]);
|
|
1872
|
+
zt.install = function(o) {
|
|
1873
|
+
o.component("Picker", zt);
|
|
1871
1874
|
};
|
|
1872
1875
|
export {
|
|
1873
|
-
|
|
1876
|
+
zt as default
|
|
1874
1877
|
};
|