vue3-ios-datepicker 0.0.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/README.md +72 -0
- package/dist/components/DatePicker.vue.d.ts +23 -0
- package/dist/components/Vue3IosDatepicker.vue.d.ts +32 -0
- package/dist/index.d.ts +2 -0
- package/dist/models/types.d.ts +4 -0
- package/dist/vue3-ios-datepicker.es.js +1587 -0
- package/dist/vue3-ios-datepicker.umd.js +23 -0
- package/package.json +35 -0
|
@@ -0,0 +1,1587 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`.rolldate-container .icon-close-roll-date{--default-url-icon: url("data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M14.7892%201.21077C15.0703%201.49181%2015.0703%201.94745%2014.7892%202.22848L2.22848%2014.7892C1.94745%2015.0703%201.49181%2015.0703%201.21077%2014.7892C0.929742%2014.5082%200.929742%2014.0526%201.21077%2013.7715L13.7715%201.21077C14.0526%200.929742%2014.5082%200.929742%2014.7892%201.21077Z'%20fill='%232E3A5B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.21077%201.21077C1.49181%200.929742%201.94745%200.929742%202.22848%201.21077L14.7892%2013.7715C15.0703%2014.0526%2015.0703%2014.5082%2014.7892%2014.7892C14.5082%2015.0703%2014.0526%2015.0703%2013.7715%2014.7892L1.21077%202.22848C0.929742%201.94745%200.929742%201.49181%201.21077%201.21077Z'%20fill='%232E3A5B'/%3e%3c/svg%3e");position:absolute;display:block;top:16px;right:16px;background-image:var(--default-url-icon);background-repeat:no-repeat;background-position:center;z-index:5;width:16px;height:16px}.v3-ios-datepicker{--v3-ios-datepicker-border-color: #dcdfe6;--v3-ios-datepicker-border-radius: 4px;--v3-ios-datepicker-font-size: 14px;--v3-ios-datepicker-icon-size: 14px;--v3-ios-datepicker-text-color: #606266}.vue3-ios-datepicker-container{display:flex;padding:4px 11px;border:1px solid var(--v3-ios-datepicker-border-color);border-radius:var(--v3-ios-datepicker-border-radius)}.vue3-ios-datepicker-icon{width:var(--v3-ios-datepicker-icon-size);margin-right:8px}.vue3-ios-datepicker-input{outline:none;border:none;padding:0;background:none;box-sizing:border-box;-webkit-appearance:none;font-family:inherit;font-size:var(--v3-ios-datepicker-font-size);color:var(--v3-ios-datepicker-text-color);width:100%}`)),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
|
+
import { defineComponent as Et, ref as Lt, computed as Dt, onMounted as Ot, onUnmounted as At, createElementBlock as Ht, openBlock as Tt, createElementVNode as Ct, normalizeClass as _t, nextTick as zt, useId as Pt, watch as Wt, createBlock as Vt, unref as Ft } from "vue";
|
|
3
|
+
function It(R) {
|
|
4
|
+
return R && R.__esModule && Object.prototype.hasOwnProperty.call(R, "default") ? R.default : R;
|
|
5
|
+
}
|
|
6
|
+
var Yt = { exports: {} }, Nt = Yt.exports, $t;
|
|
7
|
+
function Bt() {
|
|
8
|
+
return $t || ($t = 1, (function(R, G) {
|
|
9
|
+
(function(M, Q) {
|
|
10
|
+
R.exports = Q();
|
|
11
|
+
})(Nt, (function() {
|
|
12
|
+
var M = 1e3, Q = 6e4, I = 36e5, et = "millisecond", B = "second", it = "minute", b = "hour", P = "day", W = "week", tt = "month", ct = "quarter", ot = "year", _ = "date", c = "Invalid Date", s = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, r = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, f = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(v) {
|
|
13
|
+
var o = ["th", "st", "nd", "rd"], n = v % 100;
|
|
14
|
+
return "[" + v + (o[(n - 20) % 10] || o[n] || o[0]) + "]";
|
|
15
|
+
} }, y = function(v, o, n) {
|
|
16
|
+
var d = String(v);
|
|
17
|
+
return !d || d.length >= o ? v : "" + Array(o + 1 - d.length).join(n) + v;
|
|
18
|
+
}, A = { s: y, z: function(v) {
|
|
19
|
+
var o = -v.utcOffset(), n = Math.abs(o), d = Math.floor(n / 60), l = n % 60;
|
|
20
|
+
return (o <= 0 ? "+" : "-") + y(d, 2, "0") + ":" + y(l, 2, "0");
|
|
21
|
+
}, m: function v(o, n) {
|
|
22
|
+
if (o.date() < n.date()) return -v(n, o);
|
|
23
|
+
var d = 12 * (n.year() - o.year()) + (n.month() - o.month()), l = o.clone().add(d, tt), g = n - l < 0, p = o.clone().add(d + (g ? -1 : 1), tt);
|
|
24
|
+
return +(-(d + (n - l) / (g ? l - p : p - l)) || 0);
|
|
25
|
+
}, a: function(v) {
|
|
26
|
+
return v < 0 ? Math.ceil(v) || 0 : Math.floor(v);
|
|
27
|
+
}, p: function(v) {
|
|
28
|
+
return { M: tt, y: ot, w: W, d: P, D: _, h: b, m: it, s: B, ms: et, Q: ct }[v] || String(v || "").toLowerCase().replace(/s$/, "");
|
|
29
|
+
}, u: function(v) {
|
|
30
|
+
return v === void 0;
|
|
31
|
+
} }, T = "en", Y = {};
|
|
32
|
+
Y[T] = f;
|
|
33
|
+
var Z = "$isDayjsObject", X = function(v) {
|
|
34
|
+
return v instanceof U || !(!v || !v[Z]);
|
|
35
|
+
}, m = function v(o, n, d) {
|
|
36
|
+
var l;
|
|
37
|
+
if (!o) return T;
|
|
38
|
+
if (typeof o == "string") {
|
|
39
|
+
var g = o.toLowerCase();
|
|
40
|
+
Y[g] && (l = g), n && (Y[g] = n, l = g);
|
|
41
|
+
var p = o.split("-");
|
|
42
|
+
if (!l && p.length > 1) return v(p[0]);
|
|
43
|
+
} else {
|
|
44
|
+
var x = o.name;
|
|
45
|
+
Y[x] = o, l = x;
|
|
46
|
+
}
|
|
47
|
+
return !d && l && (T = l), l || !d && T;
|
|
48
|
+
}, D = function(v, o) {
|
|
49
|
+
if (X(v)) return v.clone();
|
|
50
|
+
var n = typeof o == "object" ? o : {};
|
|
51
|
+
return n.date = v, n.args = arguments, new U(n);
|
|
52
|
+
}, w = A;
|
|
53
|
+
w.l = m, w.i = X, w.w = function(v, o) {
|
|
54
|
+
return D(v, { locale: o.$L, utc: o.$u, x: o.$x, $offset: o.$offset });
|
|
55
|
+
};
|
|
56
|
+
var U = (function() {
|
|
57
|
+
function v(n) {
|
|
58
|
+
this.$L = m(n.locale, null, !0), this.parse(n), this.$x = this.$x || n.x || {}, this[Z] = !0;
|
|
59
|
+
}
|
|
60
|
+
var o = v.prototype;
|
|
61
|
+
return o.parse = function(n) {
|
|
62
|
+
this.$d = (function(d) {
|
|
63
|
+
var l = d.date, g = d.utc;
|
|
64
|
+
if (l === null) return /* @__PURE__ */ new Date(NaN);
|
|
65
|
+
if (w.u(l)) return /* @__PURE__ */ new Date();
|
|
66
|
+
if (l instanceof Date) return new Date(l);
|
|
67
|
+
if (typeof l == "string" && !/Z$/i.test(l)) {
|
|
68
|
+
var p = l.match(s);
|
|
69
|
+
if (p) {
|
|
70
|
+
var x = p[2] - 1 || 0, L = (p[7] || "0").substring(0, 3);
|
|
71
|
+
return g ? new Date(Date.UTC(p[1], x, p[3] || 1, p[4] || 0, p[5] || 0, p[6] || 0, L)) : new Date(p[1], x, p[3] || 1, p[4] || 0, p[5] || 0, p[6] || 0, L);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return new Date(l);
|
|
75
|
+
})(n), this.init();
|
|
76
|
+
}, o.init = function() {
|
|
77
|
+
var n = this.$d;
|
|
78
|
+
this.$y = n.getFullYear(), this.$M = n.getMonth(), this.$D = n.getDate(), this.$W = n.getDay(), this.$H = n.getHours(), this.$m = n.getMinutes(), this.$s = n.getSeconds(), this.$ms = n.getMilliseconds();
|
|
79
|
+
}, o.$utils = function() {
|
|
80
|
+
return w;
|
|
81
|
+
}, o.isValid = function() {
|
|
82
|
+
return this.$d.toString() !== c;
|
|
83
|
+
}, o.isSame = function(n, d) {
|
|
84
|
+
var l = D(n);
|
|
85
|
+
return this.startOf(d) <= l && l <= this.endOf(d);
|
|
86
|
+
}, o.isAfter = function(n, d) {
|
|
87
|
+
return D(n) < this.startOf(d);
|
|
88
|
+
}, o.isBefore = function(n, d) {
|
|
89
|
+
return this.endOf(d) < D(n);
|
|
90
|
+
}, o.$g = function(n, d, l) {
|
|
91
|
+
return w.u(n) ? this[d] : this.set(l, n);
|
|
92
|
+
}, o.unix = function() {
|
|
93
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
94
|
+
}, o.valueOf = function() {
|
|
95
|
+
return this.$d.getTime();
|
|
96
|
+
}, o.startOf = function(n, d) {
|
|
97
|
+
var l = this, g = !!w.u(d) || d, p = w.p(n), x = function(nt, E) {
|
|
98
|
+
var C = w.w(l.$u ? Date.UTC(l.$y, E, nt) : new Date(l.$y, E, nt), l);
|
|
99
|
+
return g ? C : C.endOf(P);
|
|
100
|
+
}, L = function(nt, E) {
|
|
101
|
+
return w.w(l.toDate()[nt].apply(l.toDate("s"), (g ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(E)), l);
|
|
102
|
+
}, V = this.$W, F = this.$M, J = this.$D, st = "set" + (this.$u ? "UTC" : "");
|
|
103
|
+
switch (p) {
|
|
104
|
+
case ot:
|
|
105
|
+
return g ? x(1, 0) : x(31, 11);
|
|
106
|
+
case tt:
|
|
107
|
+
return g ? x(1, F) : x(0, F + 1);
|
|
108
|
+
case W:
|
|
109
|
+
var N = this.$locale().weekStart || 0, pt = (V < N ? V + 7 : V) - N;
|
|
110
|
+
return x(g ? J - pt : J + (6 - pt), F);
|
|
111
|
+
case P:
|
|
112
|
+
case _:
|
|
113
|
+
return L(st + "Hours", 0);
|
|
114
|
+
case b:
|
|
115
|
+
return L(st + "Minutes", 1);
|
|
116
|
+
case it:
|
|
117
|
+
return L(st + "Seconds", 2);
|
|
118
|
+
case B:
|
|
119
|
+
return L(st + "Milliseconds", 3);
|
|
120
|
+
default:
|
|
121
|
+
return this.clone();
|
|
122
|
+
}
|
|
123
|
+
}, o.endOf = function(n) {
|
|
124
|
+
return this.startOf(n, !1);
|
|
125
|
+
}, o.$set = function(n, d) {
|
|
126
|
+
var l, g = w.p(n), p = "set" + (this.$u ? "UTC" : ""), x = (l = {}, l[P] = p + "Date", l[_] = p + "Date", l[tt] = p + "Month", l[ot] = p + "FullYear", l[b] = p + "Hours", l[it] = p + "Minutes", l[B] = p + "Seconds", l[et] = p + "Milliseconds", l)[g], L = g === P ? this.$D + (d - this.$W) : d;
|
|
127
|
+
if (g === tt || g === ot) {
|
|
128
|
+
var V = this.clone().set(_, 1);
|
|
129
|
+
V.$d[x](L), V.init(), this.$d = V.set(_, Math.min(this.$D, V.daysInMonth())).$d;
|
|
130
|
+
} else x && this.$d[x](L);
|
|
131
|
+
return this.init(), this;
|
|
132
|
+
}, o.set = function(n, d) {
|
|
133
|
+
return this.clone().$set(n, d);
|
|
134
|
+
}, o.get = function(n) {
|
|
135
|
+
return this[w.p(n)]();
|
|
136
|
+
}, o.add = function(n, d) {
|
|
137
|
+
var l, g = this;
|
|
138
|
+
n = Number(n);
|
|
139
|
+
var p = w.p(d), x = function(F) {
|
|
140
|
+
var J = D(g);
|
|
141
|
+
return w.w(J.date(J.date() + Math.round(F * n)), g);
|
|
142
|
+
};
|
|
143
|
+
if (p === tt) return this.set(tt, this.$M + n);
|
|
144
|
+
if (p === ot) return this.set(ot, this.$y + n);
|
|
145
|
+
if (p === P) return x(1);
|
|
146
|
+
if (p === W) return x(7);
|
|
147
|
+
var L = (l = {}, l[it] = Q, l[b] = I, l[B] = M, l)[p] || 1, V = this.$d.getTime() + n * L;
|
|
148
|
+
return w.w(V, this);
|
|
149
|
+
}, o.subtract = function(n, d) {
|
|
150
|
+
return this.add(-1 * n, d);
|
|
151
|
+
}, o.format = function(n) {
|
|
152
|
+
var d = this, l = this.$locale();
|
|
153
|
+
if (!this.isValid()) return l.invalidDate || c;
|
|
154
|
+
var g = n || "YYYY-MM-DDTHH:mm:ssZ", p = w.z(this), x = this.$H, L = this.$m, V = this.$M, F = l.weekdays, J = l.months, st = l.meridiem, N = function(E, C, rt, at) {
|
|
155
|
+
return E && (E[C] || E(d, g)) || rt[C].slice(0, at);
|
|
156
|
+
}, pt = function(E) {
|
|
157
|
+
return w.s(x % 12 || 12, E, "0");
|
|
158
|
+
}, nt = st || function(E, C, rt) {
|
|
159
|
+
var at = E < 12 ? "AM" : "PM";
|
|
160
|
+
return rt ? at.toLowerCase() : at;
|
|
161
|
+
};
|
|
162
|
+
return g.replace(r, (function(E, C) {
|
|
163
|
+
return C || (function(rt) {
|
|
164
|
+
switch (rt) {
|
|
165
|
+
case "YY":
|
|
166
|
+
return String(d.$y).slice(-2);
|
|
167
|
+
case "YYYY":
|
|
168
|
+
return w.s(d.$y, 4, "0");
|
|
169
|
+
case "M":
|
|
170
|
+
return V + 1;
|
|
171
|
+
case "MM":
|
|
172
|
+
return w.s(V + 1, 2, "0");
|
|
173
|
+
case "MMM":
|
|
174
|
+
return N(l.monthsShort, V, J, 3);
|
|
175
|
+
case "MMMM":
|
|
176
|
+
return N(J, V);
|
|
177
|
+
case "D":
|
|
178
|
+
return d.$D;
|
|
179
|
+
case "DD":
|
|
180
|
+
return w.s(d.$D, 2, "0");
|
|
181
|
+
case "d":
|
|
182
|
+
return String(d.$W);
|
|
183
|
+
case "dd":
|
|
184
|
+
return N(l.weekdaysMin, d.$W, F, 2);
|
|
185
|
+
case "ddd":
|
|
186
|
+
return N(l.weekdaysShort, d.$W, F, 3);
|
|
187
|
+
case "dddd":
|
|
188
|
+
return F[d.$W];
|
|
189
|
+
case "H":
|
|
190
|
+
return String(x);
|
|
191
|
+
case "HH":
|
|
192
|
+
return w.s(x, 2, "0");
|
|
193
|
+
case "h":
|
|
194
|
+
return pt(1);
|
|
195
|
+
case "hh":
|
|
196
|
+
return pt(2);
|
|
197
|
+
case "a":
|
|
198
|
+
return nt(x, L, !0);
|
|
199
|
+
case "A":
|
|
200
|
+
return nt(x, L, !1);
|
|
201
|
+
case "m":
|
|
202
|
+
return String(L);
|
|
203
|
+
case "mm":
|
|
204
|
+
return w.s(L, 2, "0");
|
|
205
|
+
case "s":
|
|
206
|
+
return String(d.$s);
|
|
207
|
+
case "ss":
|
|
208
|
+
return w.s(d.$s, 2, "0");
|
|
209
|
+
case "SSS":
|
|
210
|
+
return w.s(d.$ms, 3, "0");
|
|
211
|
+
case "Z":
|
|
212
|
+
return p;
|
|
213
|
+
}
|
|
214
|
+
return null;
|
|
215
|
+
})(E) || p.replace(":", "");
|
|
216
|
+
}));
|
|
217
|
+
}, o.utcOffset = function() {
|
|
218
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
219
|
+
}, o.diff = function(n, d, l) {
|
|
220
|
+
var g, p = this, x = w.p(d), L = D(n), V = (L.utcOffset() - this.utcOffset()) * Q, F = this - L, J = function() {
|
|
221
|
+
return w.m(p, L);
|
|
222
|
+
};
|
|
223
|
+
switch (x) {
|
|
224
|
+
case ot:
|
|
225
|
+
g = J() / 12;
|
|
226
|
+
break;
|
|
227
|
+
case tt:
|
|
228
|
+
g = J();
|
|
229
|
+
break;
|
|
230
|
+
case ct:
|
|
231
|
+
g = J() / 3;
|
|
232
|
+
break;
|
|
233
|
+
case W:
|
|
234
|
+
g = (F - V) / 6048e5;
|
|
235
|
+
break;
|
|
236
|
+
case P:
|
|
237
|
+
g = (F - V) / 864e5;
|
|
238
|
+
break;
|
|
239
|
+
case b:
|
|
240
|
+
g = F / I;
|
|
241
|
+
break;
|
|
242
|
+
case it:
|
|
243
|
+
g = F / Q;
|
|
244
|
+
break;
|
|
245
|
+
case B:
|
|
246
|
+
g = F / M;
|
|
247
|
+
break;
|
|
248
|
+
default:
|
|
249
|
+
g = F;
|
|
250
|
+
}
|
|
251
|
+
return l ? g : w.a(g);
|
|
252
|
+
}, o.daysInMonth = function() {
|
|
253
|
+
return this.endOf(tt).$D;
|
|
254
|
+
}, o.$locale = function() {
|
|
255
|
+
return Y[this.$L];
|
|
256
|
+
}, o.locale = function(n, d) {
|
|
257
|
+
if (!n) return this.$L;
|
|
258
|
+
var l = this.clone(), g = m(n, d, !0);
|
|
259
|
+
return g && (l.$L = g), l;
|
|
260
|
+
}, o.clone = function() {
|
|
261
|
+
return w.w(this.$d, this);
|
|
262
|
+
}, o.toDate = function() {
|
|
263
|
+
return new Date(this.valueOf());
|
|
264
|
+
}, o.toJSON = function() {
|
|
265
|
+
return this.isValid() ? this.toISOString() : null;
|
|
266
|
+
}, o.toISOString = function() {
|
|
267
|
+
return this.$d.toISOString();
|
|
268
|
+
}, o.toString = function() {
|
|
269
|
+
return this.$d.toUTCString();
|
|
270
|
+
}, v;
|
|
271
|
+
})(), q = U.prototype;
|
|
272
|
+
return D.prototype = q, [["$ms", et], ["$s", B], ["$m", it], ["$H", b], ["$W", P], ["$M", tt], ["$y", ot], ["$D", _]].forEach((function(v) {
|
|
273
|
+
q[v[1]] = function(o) {
|
|
274
|
+
return this.$g(o, v[0], v[1]);
|
|
275
|
+
};
|
|
276
|
+
})), D.extend = function(v, o) {
|
|
277
|
+
return v.$i || (v(o, U, D), v.$i = !0), D;
|
|
278
|
+
}, D.locale = m, D.isDayjs = X, D.unix = function(v) {
|
|
279
|
+
return D(1e3 * v);
|
|
280
|
+
}, D.en = Y[T], D.Ls = Y, D.p = {}, D;
|
|
281
|
+
}));
|
|
282
|
+
})(Yt)), Yt.exports;
|
|
283
|
+
}
|
|
284
|
+
var Ut = Bt();
|
|
285
|
+
const yt = /* @__PURE__ */ It(Ut);
|
|
286
|
+
var St = { exports: {} }, Rt = St.exports, Xt;
|
|
287
|
+
function jt() {
|
|
288
|
+
return Xt || (Xt = 1, (function(R, G) {
|
|
289
|
+
(function(M, Q) {
|
|
290
|
+
R.exports = Q();
|
|
291
|
+
})(Rt, (function() {
|
|
292
|
+
var M = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, Q = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, I = /\d/, et = /\d\d/, B = /\d\d?/, it = /\d*[^-_:/,()\s\d]+/, b = {}, P = function(s) {
|
|
293
|
+
return (s = +s) + (s > 68 ? 1900 : 2e3);
|
|
294
|
+
}, W = function(s) {
|
|
295
|
+
return function(r) {
|
|
296
|
+
this[s] = +r;
|
|
297
|
+
};
|
|
298
|
+
}, tt = [/[+-]\d\d:?(\d\d)?|Z/, function(s) {
|
|
299
|
+
(this.zone || (this.zone = {})).offset = (function(r) {
|
|
300
|
+
if (!r || r === "Z") return 0;
|
|
301
|
+
var f = r.match(/([+-]|\d\d)/g), y = 60 * f[1] + (+f[2] || 0);
|
|
302
|
+
return y === 0 ? 0 : f[0] === "+" ? -y : y;
|
|
303
|
+
})(s);
|
|
304
|
+
}], ct = function(s) {
|
|
305
|
+
var r = b[s];
|
|
306
|
+
return r && (r.indexOf ? r : r.s.concat(r.f));
|
|
307
|
+
}, ot = function(s, r) {
|
|
308
|
+
var f, y = b.meridiem;
|
|
309
|
+
if (y) {
|
|
310
|
+
for (var A = 1; A <= 24; A += 1) if (s.indexOf(y(A, 0, r)) > -1) {
|
|
311
|
+
f = A > 12;
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
} else f = s === (r ? "pm" : "PM");
|
|
315
|
+
return f;
|
|
316
|
+
}, _ = { A: [it, function(s) {
|
|
317
|
+
this.afternoon = ot(s, !1);
|
|
318
|
+
}], a: [it, function(s) {
|
|
319
|
+
this.afternoon = ot(s, !0);
|
|
320
|
+
}], Q: [I, function(s) {
|
|
321
|
+
this.month = 3 * (s - 1) + 1;
|
|
322
|
+
}], S: [I, function(s) {
|
|
323
|
+
this.milliseconds = 100 * +s;
|
|
324
|
+
}], SS: [et, function(s) {
|
|
325
|
+
this.milliseconds = 10 * +s;
|
|
326
|
+
}], SSS: [/\d{3}/, function(s) {
|
|
327
|
+
this.milliseconds = +s;
|
|
328
|
+
}], s: [B, W("seconds")], ss: [B, W("seconds")], m: [B, W("minutes")], mm: [B, W("minutes")], H: [B, W("hours")], h: [B, W("hours")], HH: [B, W("hours")], hh: [B, W("hours")], D: [B, W("day")], DD: [et, W("day")], Do: [it, function(s) {
|
|
329
|
+
var r = b.ordinal, f = s.match(/\d+/);
|
|
330
|
+
if (this.day = f[0], r) for (var y = 1; y <= 31; y += 1) r(y).replace(/\[|\]/g, "") === s && (this.day = y);
|
|
331
|
+
}], w: [B, W("week")], ww: [et, W("week")], M: [B, W("month")], MM: [et, W("month")], MMM: [it, function(s) {
|
|
332
|
+
var r = ct("months"), f = (ct("monthsShort") || r.map((function(y) {
|
|
333
|
+
return y.slice(0, 3);
|
|
334
|
+
}))).indexOf(s) + 1;
|
|
335
|
+
if (f < 1) throw new Error();
|
|
336
|
+
this.month = f % 12 || f;
|
|
337
|
+
}], MMMM: [it, function(s) {
|
|
338
|
+
var r = ct("months").indexOf(s) + 1;
|
|
339
|
+
if (r < 1) throw new Error();
|
|
340
|
+
this.month = r % 12 || r;
|
|
341
|
+
}], Y: [/[+-]?\d+/, W("year")], YY: [et, function(s) {
|
|
342
|
+
this.year = P(s);
|
|
343
|
+
}], YYYY: [/\d{4}/, W("year")], Z: tt, ZZ: tt };
|
|
344
|
+
function c(s) {
|
|
345
|
+
var r, f;
|
|
346
|
+
r = s, f = b && b.formats;
|
|
347
|
+
for (var y = (s = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(D, w, U) {
|
|
348
|
+
var q = U && U.toUpperCase();
|
|
349
|
+
return w || f[U] || M[U] || f[q].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(v, o, n) {
|
|
350
|
+
return o || n.slice(1);
|
|
351
|
+
}));
|
|
352
|
+
}))).match(Q), A = y.length, T = 0; T < A; T += 1) {
|
|
353
|
+
var Y = y[T], Z = _[Y], X = Z && Z[0], m = Z && Z[1];
|
|
354
|
+
y[T] = m ? { regex: X, parser: m } : Y.replace(/^\[|\]$/g, "");
|
|
355
|
+
}
|
|
356
|
+
return function(D) {
|
|
357
|
+
for (var w = {}, U = 0, q = 0; U < A; U += 1) {
|
|
358
|
+
var v = y[U];
|
|
359
|
+
if (typeof v == "string") q += v.length;
|
|
360
|
+
else {
|
|
361
|
+
var o = v.regex, n = v.parser, d = D.slice(q), l = o.exec(d)[0];
|
|
362
|
+
n.call(w, l), D = D.replace(l, "");
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return (function(g) {
|
|
366
|
+
var p = g.afternoon;
|
|
367
|
+
if (p !== void 0) {
|
|
368
|
+
var x = g.hours;
|
|
369
|
+
p ? x < 12 && (g.hours += 12) : x === 12 && (g.hours = 0), delete g.afternoon;
|
|
370
|
+
}
|
|
371
|
+
})(w), w;
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
return function(s, r, f) {
|
|
375
|
+
f.p.customParseFormat = !0, s && s.parseTwoDigitYear && (P = s.parseTwoDigitYear);
|
|
376
|
+
var y = r.prototype, A = y.parse;
|
|
377
|
+
y.parse = function(T) {
|
|
378
|
+
var Y = T.date, Z = T.utc, X = T.args;
|
|
379
|
+
this.$u = Z;
|
|
380
|
+
var m = X[1];
|
|
381
|
+
if (typeof m == "string") {
|
|
382
|
+
var D = X[2] === !0, w = X[3] === !0, U = D || w, q = X[2];
|
|
383
|
+
w && (q = X[2]), b = this.$locale(), !D && q && (b = f.Ls[q]), this.$d = (function(d, l, g, p) {
|
|
384
|
+
try {
|
|
385
|
+
if (["x", "X"].indexOf(l) > -1) return new Date((l === "X" ? 1e3 : 1) * d);
|
|
386
|
+
var x = c(l)(d), L = x.year, V = x.month, F = x.day, J = x.hours, st = x.minutes, N = x.seconds, pt = x.milliseconds, nt = x.zone, E = x.week, C = /* @__PURE__ */ new Date(), rt = F || (L || V ? 1 : C.getDate()), at = L || C.getFullYear(), ut = 0;
|
|
387
|
+
L && !V || (ut = V > 0 ? V - 1 : C.getMonth());
|
|
388
|
+
var dt, ft = J || 0, lt = st || 0, ht = N || 0, t = pt || 0;
|
|
389
|
+
return nt ? new Date(Date.UTC(at, ut, rt, ft, lt, ht, t + 60 * nt.offset * 1e3)) : g ? new Date(Date.UTC(at, ut, rt, ft, lt, ht, t)) : (dt = new Date(at, ut, rt, ft, lt, ht, t), E && (dt = p(dt).week(E).toDate()), dt);
|
|
390
|
+
} catch {
|
|
391
|
+
return /* @__PURE__ */ new Date("");
|
|
392
|
+
}
|
|
393
|
+
})(Y, m, Z, f), this.init(), q && q !== !0 && (this.$L = this.locale(q).$L), U && Y != this.format(m) && (this.$d = /* @__PURE__ */ new Date("")), b = {};
|
|
394
|
+
} else if (m instanceof Array) for (var v = m.length, o = 1; o <= v; o += 1) {
|
|
395
|
+
X[1] = m[o - 1];
|
|
396
|
+
var n = f.apply(this, X);
|
|
397
|
+
if (n.isValid()) {
|
|
398
|
+
this.$d = n.$d, this.$L = n.$L, this.init();
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
o === v && (this.$d = /* @__PURE__ */ new Date(""));
|
|
402
|
+
}
|
|
403
|
+
else A.call(this, T);
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
}));
|
|
407
|
+
})(St)), St.exports;
|
|
408
|
+
}
|
|
409
|
+
var Zt = jt();
|
|
410
|
+
const qt = /* @__PURE__ */ It(Zt);
|
|
411
|
+
yt.extend(qt);
|
|
412
|
+
function kt(R) {
|
|
413
|
+
"@babel/helpers - typeof";
|
|
414
|
+
return kt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(G) {
|
|
415
|
+
return typeof G;
|
|
416
|
+
} : function(G) {
|
|
417
|
+
return G && typeof Symbol == "function" && G.constructor === Symbol && G !== Symbol.prototype ? "symbol" : typeof G;
|
|
418
|
+
}, kt(R);
|
|
419
|
+
}
|
|
420
|
+
function Jt(R, G, M, Q, I, et, B, it) {
|
|
421
|
+
return (function(b, P) {
|
|
422
|
+
(typeof exports > "u" ? "undefined" : kt(exports)) == "object" && typeof module < "u" ? module.exports = P() : typeof define == "function" && define.amd ? define(P) : (b = b || self).Rolldate = P();
|
|
423
|
+
})(this, function() {
|
|
424
|
+
(function(_, c) {
|
|
425
|
+
c === void 0 && (c = {});
|
|
426
|
+
var s = c.insertAt;
|
|
427
|
+
if (typeof document < "u") {
|
|
428
|
+
var r = document.head || document.getElementsByTagName("head")[0], f = document.createElement("style");
|
|
429
|
+
f.type = "text/css", s === "top" && r.firstChild ? r.insertBefore(f, r.firstChild) : r.appendChild(f), f.styleSheet ? f.styleSheet.cssText = _ : f.appendChild(document.createTextNode(_));
|
|
430
|
+
}
|
|
431
|
+
})(
|
|
432
|
+
`.rolldate-container{font-size:20px;color:#333;text-align:center}.rolldate-container ul{margin:0;padding:0}.rolldate-container li{list-style-type:none}.rolldate-container header{
|
|
433
|
+
position:relative;
|
|
434
|
+
font-weight: 500;
|
|
435
|
+
line-height:50px;font-size:15px;border-bottom:1px solid #e0e0e0}.rolldate-container .rolldate-mask{position:fixed;width:100%;height:100%;top:0;left:0;z-index:1001;background-color:rgba(37,38,45,.4)}.rolldate-container .rolldate-panel{position:fixed;border-top-left-radius: 12px; border-top-right-radius: 12px;bottom:0;left:0;width:100%;height:340px;z-index:1002;background:#fff;-webkit-transition:all .3s ease-in-out;-o-transition:all .3s ease-in-out;transition:all .3s ease-in-out;-webkit-transform:translate3d(0,273px,0);transform:translate3d(0,273px,0)}.rolldate-container .rolldate-btn{}
|
|
436
|
+
.rolldate-container .rolldate-cancel{
|
|
437
|
+
|
|
438
|
+
}
|
|
439
|
+
.rolldate-container .rolldate-confirm{ display: block;background-color: #217B56;color: #fff;padding: 12px 0px;margin: 38px 16px 0px 16px;border-radius: 6px;font-size: 16px;font-weight: 500;}.rolldate-container .disabled.rolldate-confirm{ display: block;background-color: #BABABA;color: #fff;padding: 12px 0px;margin: 38px 16px 0px 16px;border-radius: 6px;font-size: 16px;font-weight: 500; pointer-events: none} .rolldate-content{position:relative;top:20px}.rolldate-container .rolldate-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.rolldate-container .rolldate-wrapper>div{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;height:173px;line-height:36px;overflow:hidden;-webkit-flex-basis:-8e;-ms-flex-preferred-size:-8e;flex-basis:-8e;width:1%}.rolldate-container .rolldate-wrapper ul{margin-top:68px}.rolldate-container .rolldate-wrapper li{height:36px; line-height: 36px;}.rolldate-container .rolldate-dim{position:absolute;left:0;top:0;width:100%;height:68px;background:-o-linear-gradient(bottom,hsla(0,0%,100%,.4),hsla(0,0%,100%,.8));background:-webkit-gradient(linear, left bottom, left top, from(hsla(0, 0%, 100%, 0.4)), to(hsla(0, 0%, 100%, 0.8))) !important;background:-o-linear-gradient(bottom, hsla(0, 0%, 100%, 0.4), hsla(0, 0%, 100%, 0.8));background:linear-gradient(0deg,hsla(0,0%,100%,.4),hsla(0,0%,100%,.8));pointer-events:none;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:10}.rolldate-container .mask-top{border-bottom:1px solid #ebebeb}.rolldate-container .mask-bottom{top:auto;bottom:1px;border-top:1px solid #ebebeb}.rolldate-container .fadeIn{-webkit-transform:translateZ(0);transform:translateZ(0)}.rolldate-container .fadeOut{-webkit-transform:translate3d(0,273px,0);transform:translate3d(0,273px,0)}@media screen and (max-width:414px){.rolldate-container{font-size:18px}}@media screen and (max-width:320px){.rolldate-container{font-size:15px}}`
|
|
440
|
+
);
|
|
441
|
+
function b(_, c) {
|
|
442
|
+
return typeof _ != "string" && _.nodeType ? _ : c ? document.querySelectorAll(_) : document.querySelector(_);
|
|
443
|
+
}
|
|
444
|
+
var P, W = ((function(_, c) {
|
|
445
|
+
_.exports = (function() {
|
|
446
|
+
function s(t, e) {
|
|
447
|
+
for (; e + 1 < t.length; e++) t[e] = t[e + 1];
|
|
448
|
+
t.pop();
|
|
449
|
+
}
|
|
450
|
+
var r = function(e, i) {
|
|
451
|
+
if (Array.isArray(e)) return e;
|
|
452
|
+
if (Symbol.iterator in Object(e))
|
|
453
|
+
return (function(a, h) {
|
|
454
|
+
var u = [], S = !0, k = !1, z = void 0;
|
|
455
|
+
try {
|
|
456
|
+
for (var H, O = a[Symbol.iterator](); !(S = (H = O.next()).done) && (u.push(H.value), !h || u.length !== h); S = !0) ;
|
|
457
|
+
} catch (K) {
|
|
458
|
+
k = !0, z = K;
|
|
459
|
+
} finally {
|
|
460
|
+
try {
|
|
461
|
+
!S && O.return && O.return();
|
|
462
|
+
} finally {
|
|
463
|
+
if (k) throw z;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return u;
|
|
467
|
+
})(e, i);
|
|
468
|
+
throw new TypeError(
|
|
469
|
+
"Invalid attempt to destructure non-iterable instance"
|
|
470
|
+
);
|
|
471
|
+
}, f = typeof window < "u", y = f && navigator.userAgent.toLowerCase(), A = y && /wechatdevtools/.test(y), T = y && 0 < y.indexOf("android");
|
|
472
|
+
function Y() {
|
|
473
|
+
return window.performance && window.performance.now ? window.performance.now() + window.performance.timing.navigationStart : +/* @__PURE__ */ new Date();
|
|
474
|
+
}
|
|
475
|
+
function Z(t) {
|
|
476
|
+
for (var e = arguments.length, i = Array(1 < e ? e - 1 : 0), a = 1; a < e; a++)
|
|
477
|
+
i[a - 1] = arguments[a];
|
|
478
|
+
for (var h = 0; h < i.length; h++) {
|
|
479
|
+
var u = i[h];
|
|
480
|
+
for (var S in u) t[S] = u[S];
|
|
481
|
+
}
|
|
482
|
+
return t;
|
|
483
|
+
}
|
|
484
|
+
function X(t) {
|
|
485
|
+
return t == null;
|
|
486
|
+
}
|
|
487
|
+
var m = f && document.createElement("div").style, D = (function() {
|
|
488
|
+
if (!f) return !1;
|
|
489
|
+
var t = {
|
|
490
|
+
webkit: "webkitTransform",
|
|
491
|
+
Moz: "MozTransform",
|
|
492
|
+
O: "OTransform",
|
|
493
|
+
ms: "msTransform",
|
|
494
|
+
standard: "transform"
|
|
495
|
+
};
|
|
496
|
+
for (var e in t) if (m[t[e]] !== void 0) return e;
|
|
497
|
+
return !1;
|
|
498
|
+
})();
|
|
499
|
+
function w(t) {
|
|
500
|
+
return D !== !1 && (D === "standard" ? t === "transitionEnd" ? "transitionend" : t : D + t.charAt(0).toUpperCase() + t.substr(1));
|
|
501
|
+
}
|
|
502
|
+
function U(t, e, i, a) {
|
|
503
|
+
t.addEventListener(e, i, {
|
|
504
|
+
passive: !1,
|
|
505
|
+
capture: !!a
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
function q(t, e, i, a) {
|
|
509
|
+
t.removeEventListener(e, i, {
|
|
510
|
+
passive: !1,
|
|
511
|
+
capture: !!a
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
function v(t) {
|
|
515
|
+
for (var e = 0, i = 0; t; )
|
|
516
|
+
e -= t.offsetLeft, i -= t.offsetTop, t = t.offsetParent;
|
|
517
|
+
return {
|
|
518
|
+
left: e,
|
|
519
|
+
top: i
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
D && D !== "standard" && D.toLowerCase();
|
|
523
|
+
var o = w("transform"), n = w("transition"), d = f && w("perspective") in m, l = f && ("ontouchstart" in window || A), g = o !== !1, p = f && n in m, x = {
|
|
524
|
+
transform: o,
|
|
525
|
+
transitionTimingFunction: w("transitionTimingFunction"),
|
|
526
|
+
transitionDuration: w("transitionDuration"),
|
|
527
|
+
transitionDelay: w("transitionDelay"),
|
|
528
|
+
transformOrigin: w("transformOrigin"),
|
|
529
|
+
transitionEnd: w("transitionEnd")
|
|
530
|
+
}, L = {
|
|
531
|
+
touchstart: 1,
|
|
532
|
+
touchmove: 1,
|
|
533
|
+
touchend: 1,
|
|
534
|
+
mousedown: 2,
|
|
535
|
+
mousemove: 2,
|
|
536
|
+
mouseup: 2
|
|
537
|
+
};
|
|
538
|
+
function V(t) {
|
|
539
|
+
if (t instanceof window.SVGElement) {
|
|
540
|
+
var e = t.getBoundingClientRect();
|
|
541
|
+
return {
|
|
542
|
+
top: e.top,
|
|
543
|
+
left: e.left,
|
|
544
|
+
width: e.width,
|
|
545
|
+
height: e.height
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
return {
|
|
549
|
+
top: t.offsetTop,
|
|
550
|
+
left: t.offsetLeft,
|
|
551
|
+
width: t.offsetWidth,
|
|
552
|
+
height: t.offsetHeight
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
function F(t, e) {
|
|
556
|
+
for (var i in e) if (e[i].test(t[i])) return !0;
|
|
557
|
+
return !1;
|
|
558
|
+
}
|
|
559
|
+
function J(t) {
|
|
560
|
+
var e = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : "click", i = void 0;
|
|
561
|
+
t.type === "mouseup" || t.type === "mousecancel" ? i = t : t.type !== "touchend" && t.type !== "touchcancel" || (i = t.changedTouches[0]);
|
|
562
|
+
var a = {};
|
|
563
|
+
i && (a.screenX = i.screenX || 0, a.screenY = i.screenY || 0, a.clientX = i.clientX || 0, a.clientY = i.clientY || 0);
|
|
564
|
+
var h = void 0, u = !0, S = !0;
|
|
565
|
+
if (typeof MouseEvent < "u")
|
|
566
|
+
try {
|
|
567
|
+
h = new MouseEvent(
|
|
568
|
+
e,
|
|
569
|
+
Z(
|
|
570
|
+
{
|
|
571
|
+
bubbles: u,
|
|
572
|
+
cancelable: S
|
|
573
|
+
},
|
|
574
|
+
a
|
|
575
|
+
)
|
|
576
|
+
);
|
|
577
|
+
} catch {
|
|
578
|
+
k();
|
|
579
|
+
}
|
|
580
|
+
else k();
|
|
581
|
+
function k() {
|
|
582
|
+
(h = document.createEvent("Event")).initEvent(e, u, S), Z(h, a);
|
|
583
|
+
}
|
|
584
|
+
h.forwardedTouchEvent = !0, h._constructed = !0, t.target.dispatchEvent(h);
|
|
585
|
+
}
|
|
586
|
+
var st = {
|
|
587
|
+
startX: 0,
|
|
588
|
+
startY: 0,
|
|
589
|
+
scrollX: !1,
|
|
590
|
+
scrollY: !0,
|
|
591
|
+
freeScroll: !1,
|
|
592
|
+
directionLockThreshold: 5,
|
|
593
|
+
eventPassthrough: "",
|
|
594
|
+
click: !1,
|
|
595
|
+
tap: !1,
|
|
596
|
+
bounce: !0,
|
|
597
|
+
bounceTime: 800,
|
|
598
|
+
momentum: !0,
|
|
599
|
+
momentumLimitTime: 300,
|
|
600
|
+
momentumLimitDistance: 15,
|
|
601
|
+
swipeTime: 2500,
|
|
602
|
+
swipeBounceTime: 500,
|
|
603
|
+
deceleration: 15e-4,
|
|
604
|
+
flickLimitTime: 200,
|
|
605
|
+
flickLimitDistance: 100,
|
|
606
|
+
resizePolling: 60,
|
|
607
|
+
probeType: 0,
|
|
608
|
+
preventDefault: !0,
|
|
609
|
+
preventDefaultException: {
|
|
610
|
+
tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT|AUDIO)$/
|
|
611
|
+
},
|
|
612
|
+
HWCompositing: !0,
|
|
613
|
+
useTransition: !0,
|
|
614
|
+
useTransform: !0,
|
|
615
|
+
bindToWrapper: !1,
|
|
616
|
+
disableMouse: l,
|
|
617
|
+
disableTouch: !l,
|
|
618
|
+
observeDOM: !0,
|
|
619
|
+
autoBlur: !0,
|
|
620
|
+
wheel: !1,
|
|
621
|
+
snap: !1,
|
|
622
|
+
scrollbar: !1,
|
|
623
|
+
pullDownRefresh: !1,
|
|
624
|
+
pullUpLoad: !1,
|
|
625
|
+
mouseWheel: !1,
|
|
626
|
+
stopPropagation: !1,
|
|
627
|
+
zoom: !1,
|
|
628
|
+
infinity: !1,
|
|
629
|
+
dblclick: !1
|
|
630
|
+
}, N = {
|
|
631
|
+
swipe: {
|
|
632
|
+
style: "cubic-bezier(0.23, 1, 0.32, 1)",
|
|
633
|
+
fn: function(e) {
|
|
634
|
+
return 1 + --e * e * e * e * e;
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
swipeBounce: {
|
|
638
|
+
style: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
639
|
+
fn: function(e) {
|
|
640
|
+
return e * (2 - e);
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
bounce: {
|
|
644
|
+
style: "cubic-bezier(0.165, 0.84, 0.44, 1)",
|
|
645
|
+
fn: function(e) {
|
|
646
|
+
return 1 - --e * e * e * e;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
function pt(t, e, i, a, h, u, S) {
|
|
651
|
+
var k = t - e, z = Math.abs(k) / i, H = S.deceleration, O = S.itemHeight, K = S.swipeBounceTime, j = S.wheel, $ = S.swipeTime, vt = j ? 4 : 15, mt = t + z / H * (k < 0 ? -1 : 1);
|
|
652
|
+
return j && O && (mt = Math.round(mt / O) * O), mt < a ? (mt = u ? Math.max(a - u / 4, a - u / vt * z) : a, $ = K) : h < mt && (mt = u ? Math.min(h + u / 4, h + u / vt * z) : h, $ = K), {
|
|
653
|
+
destination: Math.round(mt),
|
|
654
|
+
duration: $
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
function nt() {
|
|
658
|
+
}
|
|
659
|
+
var E, C, rt, at, ut, dt = f ? window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || function(t) {
|
|
660
|
+
return window.setTimeout(t, (t.interval || 100 / 60) / 2);
|
|
661
|
+
} : nt, ft = f ? window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || function(t) {
|
|
662
|
+
window.clearTimeout(t);
|
|
663
|
+
} : nt;
|
|
664
|
+
function lt(t) {
|
|
665
|
+
console.error("[BScroll warn]: " + t);
|
|
666
|
+
}
|
|
667
|
+
function ht(t, e) {
|
|
668
|
+
this.wrapper = typeof t == "string" ? document.querySelector(t) : t, this.wrapper || lt("Can not resolve the wrapper DOM."), this.scroller = this.wrapper.children[0], this.scroller || lt(
|
|
669
|
+
"The wrapper need at least one child element to be scroller."
|
|
670
|
+
), this.scrollerStyle = this.scroller.style, this._init(e);
|
|
671
|
+
}
|
|
672
|
+
return (E = ht).prototype._init = function(t) {
|
|
673
|
+
this._handleOptions(t), this._events = {}, this.x = 0, this.y = 0, this.directionX = 0, this.directionY = 0, this.setScale(1), this._addDOMEvents(), this._initExtFeatures(), this._watchTransition(), this.options.observeDOM && this._initDOMObserver(), this.options.autoBlur && this._handleAutoBlur(), this.refresh(), this.options.snap || this.scrollTo(this.options.startX, this.options.startY), this.enable();
|
|
674
|
+
}, E.prototype.setScale = function(t) {
|
|
675
|
+
this.lastScale = X(this.scale) ? t : this.scale, this.scale = t;
|
|
676
|
+
}, E.prototype._handleOptions = function(t) {
|
|
677
|
+
this.options = Z({}, st, t), this.translateZ = this.options.HWCompositing && d ? " translateZ(0)" : "", this.options.useTransition = this.options.useTransition && p, this.options.useTransform = this.options.useTransform && g, this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault, this.options.scrollX = this.options.eventPassthrough !== "horizontal" && this.options.scrollX, this.options.scrollY = this.options.eventPassthrough !== "vertical" && this.options.scrollY, this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough, this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold, this.options.tap === !0 && (this.options.tap = "tap");
|
|
678
|
+
}, E.prototype._addDOMEvents = function() {
|
|
679
|
+
var t = U;
|
|
680
|
+
this._handleDOMEvents(t);
|
|
681
|
+
}, E.prototype._removeDOMEvents = function() {
|
|
682
|
+
var t = q;
|
|
683
|
+
this._handleDOMEvents(t);
|
|
684
|
+
}, E.prototype._handleDOMEvents = function(t) {
|
|
685
|
+
var e = this.options.bindToWrapper ? this.wrapper : window;
|
|
686
|
+
t(window, "orientationchange", this), t(window, "resize", this), this.options.click && t(this.wrapper, "click", this, !0), this.options.disableMouse || (t(this.wrapper, "mousedown", this), t(e, "mousemove", this), t(e, "mousecancel", this), t(e, "mouseup", this)), l && !this.options.disableTouch && (t(this.wrapper, "touchstart", this), t(e, "touchmove", this), t(e, "touchcancel", this), t(e, "touchend", this)), t(this.scroller, x.transitionEnd, this);
|
|
687
|
+
}, E.prototype._initExtFeatures = function() {
|
|
688
|
+
this.options.snap && this._initSnap(), this.options.scrollbar && this._initScrollbar(), this.options.pullUpLoad && this._initPullUp(), this.options.pullDownRefresh && this._initPullDown(), this.options.wheel && this._initWheel(), this.options.mouseWheel && this._initMouseWheel(), this.options.zoom && this._initZoom(), this.options.infinity && this._initInfinite();
|
|
689
|
+
}, E.prototype._watchTransition = function() {
|
|
690
|
+
if (typeof Object.defineProperty == "function") {
|
|
691
|
+
var t = this, e = !1, i = this.options.useTransition ? "isInTransition" : "isAnimating";
|
|
692
|
+
Object.defineProperty(this, i, {
|
|
693
|
+
get: function() {
|
|
694
|
+
return e;
|
|
695
|
+
},
|
|
696
|
+
set: function(h) {
|
|
697
|
+
e = h;
|
|
698
|
+
for (var u = t.scroller.children.length ? t.scroller.children : [t.scroller], S = e && !t.pulling ? "none" : "auto", k = 0; k < u.length; k++)
|
|
699
|
+
u[k].style.pointerEvents = S;
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
}, E.prototype._handleAutoBlur = function() {
|
|
704
|
+
this.on("scrollStart", function() {
|
|
705
|
+
var t = document.activeElement;
|
|
706
|
+
!t || t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" || t.blur();
|
|
707
|
+
});
|
|
708
|
+
}, E.prototype._initDOMObserver = function() {
|
|
709
|
+
var t = this;
|
|
710
|
+
if (typeof MutationObserver < "u") {
|
|
711
|
+
var e = void 0, i = new MutationObserver(function(a) {
|
|
712
|
+
if (!t._shouldNotRefresh()) {
|
|
713
|
+
for (var h = !1, u = !1, S = 0; S < a.length; S++) {
|
|
714
|
+
var k = a[S];
|
|
715
|
+
if (k.type !== "attributes") {
|
|
716
|
+
h = !0;
|
|
717
|
+
break;
|
|
718
|
+
}
|
|
719
|
+
if (k.target !== t.scroller) {
|
|
720
|
+
u = !0;
|
|
721
|
+
break;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
h ? t.refresh() : u && (clearTimeout(e), e = setTimeout(function() {
|
|
725
|
+
t._shouldNotRefresh() || t.refresh();
|
|
726
|
+
}, 60));
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
i.observe(this.scroller, {
|
|
730
|
+
attributes: !0,
|
|
731
|
+
childList: !0,
|
|
732
|
+
subtree: !0
|
|
733
|
+
}), this.on("destroy", function() {
|
|
734
|
+
i.disconnect();
|
|
735
|
+
});
|
|
736
|
+
} else this._checkDOMUpdate();
|
|
737
|
+
}, E.prototype._shouldNotRefresh = function() {
|
|
738
|
+
var t = this.x > this.minScrollX || this.x < this.maxScrollX || this.y > this.minScrollY || this.y < this.maxScrollY;
|
|
739
|
+
return this.isInTransition || this.stopFromTransition || t;
|
|
740
|
+
}, E.prototype._checkDOMUpdate = function() {
|
|
741
|
+
var t = V(this.scroller), e = t.width, i = t.height;
|
|
742
|
+
(function a() {
|
|
743
|
+
var h = this;
|
|
744
|
+
setTimeout(function() {
|
|
745
|
+
(function() {
|
|
746
|
+
if (!this.destroyed) {
|
|
747
|
+
var u = (t = V(this.scroller)).width, S = t.height;
|
|
748
|
+
e === u && i === S || this.refresh(), e = u, i = S, a.call(this);
|
|
749
|
+
}
|
|
750
|
+
}).call(h);
|
|
751
|
+
}, 1e3);
|
|
752
|
+
}).call(this);
|
|
753
|
+
}, E.prototype.handleEvent = function(t) {
|
|
754
|
+
var e = this;
|
|
755
|
+
switch (t.type) {
|
|
756
|
+
case "touchstart":
|
|
757
|
+
case "mousedown":
|
|
758
|
+
this._start(t), this.options.zoom && t.touches && 1 < t.touches.length && this._zoomStart(t);
|
|
759
|
+
break;
|
|
760
|
+
case "touchmove":
|
|
761
|
+
case "mousemove":
|
|
762
|
+
this.options.zoom && t.touches && 1 < t.touches.length ? this._zoom(t) : this._move(t);
|
|
763
|
+
break;
|
|
764
|
+
case "touchend":
|
|
765
|
+
case "mouseup":
|
|
766
|
+
case "touchcancel":
|
|
767
|
+
case "mousecancel":
|
|
768
|
+
this.scaled ? this._zoomEnd(t) : this._end(t), setTimeout(function() {
|
|
769
|
+
e.trigger("scrollEnd");
|
|
770
|
+
}, 300);
|
|
771
|
+
break;
|
|
772
|
+
case "orientationchange":
|
|
773
|
+
case "resize":
|
|
774
|
+
this._resize();
|
|
775
|
+
break;
|
|
776
|
+
case "transitionend":
|
|
777
|
+
case "webkitTransitionEnd":
|
|
778
|
+
case "oTransitionEnd":
|
|
779
|
+
case "MSTransitionEnd":
|
|
780
|
+
this._transitionEnd(t);
|
|
781
|
+
break;
|
|
782
|
+
case "click":
|
|
783
|
+
this.enabled && !t._constructed && (F(t.target, this.options.preventDefaultException) || (t.preventDefault(), t.stopPropagation()));
|
|
784
|
+
break;
|
|
785
|
+
case "wheel":
|
|
786
|
+
case "DOMMouseScroll":
|
|
787
|
+
case "mousewheel":
|
|
788
|
+
this._onMouseWheel(t);
|
|
789
|
+
}
|
|
790
|
+
}, E.prototype.refresh = function() {
|
|
791
|
+
var t = window.getComputedStyle(this.wrapper, null).position === "static", e = V(this.wrapper);
|
|
792
|
+
this.wrapperWidth = e.width, this.wrapperHeight = e.height;
|
|
793
|
+
var i = V(this.scroller);
|
|
794
|
+
this.scrollerWidth = Math.round(i.width * this.scale), this.scrollerHeight = Math.round(i.height * this.scale), this.relativeX = i.left, this.relativeY = i.top, t && (this.relativeX -= e.left, this.relativeY -= e.top), this.minScrollX = 0, this.minScrollY = 0;
|
|
795
|
+
var a = this.options.wheel;
|
|
796
|
+
a ? (this.items = this.scroller.children, this.options.itemHeight = this.itemHeight = this.items.length ? this.scrollerHeight / this.items.length : 0, this.selectedIndex === void 0 && (this.selectedIndex = a.selectedIndex || 0), this.options.startY = -this.selectedIndex * this.itemHeight, this.maxScrollX = 0, this.maxScrollY = -this.itemHeight * (this.items.length - 1)) : (this.maxScrollX = this.wrapperWidth - this.scrollerWidth, this.options.infinity || (this.maxScrollY = this.wrapperHeight - this.scrollerHeight), this.maxScrollX < 0 ? (this.maxScrollX -= this.relativeX, this.minScrollX = -this.relativeX) : 1 < this.scale && (this.maxScrollX = this.maxScrollX / 2 - this.relativeX, this.minScrollX = this.maxScrollX), this.maxScrollY < 0 ? (this.maxScrollY -= this.relativeY, this.minScrollY = -this.relativeY) : 1 < this.scale && (this.maxScrollY = this.maxScrollY / 2 - this.relativeY, this.minScrollY = this.maxScrollY)), this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < this.minScrollX, this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < this.minScrollY, this.hasHorizontalScroll || (this.maxScrollX = this.minScrollX, this.scrollerWidth = this.wrapperWidth), this.hasVerticalScroll || (this.maxScrollY = this.minScrollY, this.scrollerHeight = this.wrapperHeight), this.endTime = 0, this.directionX = 0, this.directionY = 0, this.wrapperOffset = v(this.wrapper), this.trigger("refresh"), this.scaled || this.resetPosition();
|
|
797
|
+
}, E.prototype.enable = function() {
|
|
798
|
+
this.enabled = !0;
|
|
799
|
+
}, E.prototype.disable = function() {
|
|
800
|
+
this.enabled = !1;
|
|
801
|
+
}, (C = ht).prototype._start = function(t) {
|
|
802
|
+
this.trigger("scrollMove");
|
|
803
|
+
var e = L[t.type];
|
|
804
|
+
if ((e === 1 || t.button === 0) && !(!this.enabled || this.destroyed || this.initiated && this.initiated !== e)) {
|
|
805
|
+
this.initiated = e, this.options.preventDefault && !F(t.target, this.options.preventDefaultException) && t.preventDefault(), this.options.stopPropagation && t.stopPropagation(), this.moved = !1, this.distX = 0, this.distY = 0, this.directionX = 0, this.directionY = 0, this.movingDirectionX = 0, this.movingDirectionY = 0, this.directionLocked = 0, this._transitionTime(), this.startTime = Y(), this.options.wheel && (this.target = t.target), this.stop();
|
|
806
|
+
var i = t.touches ? t.touches[0] : t;
|
|
807
|
+
this.startX = this.x, this.startY = this.y, this.absStartX = this.x, this.absStartY = this.y, this.pointX = i.pageX, this.pointY = i.pageY, this.trigger("beforeScrollStart");
|
|
808
|
+
}
|
|
809
|
+
}, C.prototype._move = function(t) {
|
|
810
|
+
if (this.enabled && !this.destroyed && L[t.type] === this.initiated) {
|
|
811
|
+
this.options.preventDefault && t.preventDefault(), this.options.stopPropagation && t.stopPropagation();
|
|
812
|
+
var e = t.touches ? t.touches[0] : t, i = e.pageX - this.pointX, a = e.pageY - this.pointY;
|
|
813
|
+
this.pointX = e.pageX, this.pointY = e.pageY, this.distX += i, this.distY += a;
|
|
814
|
+
var h = Math.abs(this.distX), u = Math.abs(this.distY), S = Y();
|
|
815
|
+
if (!(S - this.endTime > this.options.momentumLimitTime && u < this.options.momentumLimitDistance && h < this.options.momentumLimitDistance)) {
|
|
816
|
+
if (this.directionLocked || this.options.freeScroll || (h > u + this.options.directionLockThreshold ? this.directionLocked = "h" : u >= h + this.options.directionLockThreshold ? this.directionLocked = "v" : this.directionLocked = "n"), this.directionLocked === "h") {
|
|
817
|
+
if (this.options.eventPassthrough === "vertical")
|
|
818
|
+
t.preventDefault();
|
|
819
|
+
else if (this.options.eventPassthrough === "horizontal")
|
|
820
|
+
return void (this.initiated = !1);
|
|
821
|
+
a = 0;
|
|
822
|
+
} else if (this.directionLocked === "v") {
|
|
823
|
+
if (this.options.eventPassthrough === "horizontal")
|
|
824
|
+
t.preventDefault();
|
|
825
|
+
else if (this.options.eventPassthrough === "vertical")
|
|
826
|
+
return void (this.initiated = !1);
|
|
827
|
+
i = 0;
|
|
828
|
+
}
|
|
829
|
+
i = this.hasHorizontalScroll ? i : 0, a = this.hasVerticalScroll ? a : 0, this.movingDirectionX = 0 < i ? -1 : i < 0 ? 1 : 0, this.movingDirectionY = 0 < a ? -1 : a < 0 ? 1 : 0;
|
|
830
|
+
var k = this.x + i, z = this.y + a, H = !1, O = !1, K = !1, j = !1, $ = this.options.bounce;
|
|
831
|
+
$ !== !1 && (H = $.top === void 0 || $.top, O = $.bottom === void 0 || $.bottom, K = $.left === void 0 || $.left, j = $.right === void 0 || $.right), (k > this.minScrollX || k < this.maxScrollX) && (k = k > this.minScrollX && K || k < this.maxScrollX && j ? this.x + i / 3 : k > this.minScrollX ? this.minScrollX : this.maxScrollX), (z > this.minScrollY || z < this.maxScrollY) && (z = z > this.minScrollY && H || z < this.maxScrollY && O ? this.y + a / 3 : z > this.minScrollY ? this.minScrollY : this.maxScrollY), this.moved || (this.moved = !0, this.trigger("scrollStart")), this._translate(k, z), S - this.startTime > this.options.momentumLimitTime && (this.startTime = S, this.startX = this.x, this.startY = this.y, this.options.probeType === 1 && this.trigger("scroll", {
|
|
832
|
+
x: this.x,
|
|
833
|
+
y: this.y
|
|
834
|
+
})), 1 < this.options.probeType && this.trigger("scroll", {
|
|
835
|
+
x: this.x,
|
|
836
|
+
y: this.y
|
|
837
|
+
});
|
|
838
|
+
var vt = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft, mt = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop, gt = this.pointX - vt, wt = this.pointY - mt;
|
|
839
|
+
(gt > document.documentElement.clientWidth - this.options.momentumLimitDistance || gt < this.options.momentumLimitDistance || wt < this.options.momentumLimitDistance || wt > document.documentElement.clientHeight - this.options.momentumLimitDistance) && this._end(t);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}, C.prototype._end = function(t) {
|
|
843
|
+
if (this.enabled && !this.destroyed && L[t.type] === this.initiated) {
|
|
844
|
+
this.initiated = !1, this.options.preventDefault && !F(t.target, this.options.preventDefaultException) && t.preventDefault(), this.options.stopPropagation && t.stopPropagation(), this.trigger("touchEnd", {
|
|
845
|
+
x: this.x,
|
|
846
|
+
y: this.y
|
|
847
|
+
}), this.isInTransition = !1;
|
|
848
|
+
var e = Math.round(this.x), i = Math.round(this.y), a = e - this.absStartX, h = i - this.absStartY;
|
|
849
|
+
if (this.directionX = 0 < a ? -1 : a < 0 ? 1 : 0, this.directionY = 0 < h ? -1 : h < 0 ? 1 : 0, !this.options.pullDownRefresh || !this._checkPullDown()) {
|
|
850
|
+
if (this._checkClick(t)) this.trigger("scrollCancel");
|
|
851
|
+
else if (!this.resetPosition(this.options.bounceTime, N.bounce)) {
|
|
852
|
+
this._translate(e, i), this.endTime = Y();
|
|
853
|
+
var u = this.endTime - this.startTime, S = Math.abs(e - this.startX), k = Math.abs(i - this.startY);
|
|
854
|
+
if (this._events.flick && u < this.options.flickLimitTime && S < this.options.flickLimitDistance && k < this.options.flickLimitDistance)
|
|
855
|
+
this.trigger("flick");
|
|
856
|
+
else {
|
|
857
|
+
var z = 0;
|
|
858
|
+
if (this.options.momentum && u < this.options.momentumLimitTime && (k > this.options.momentumLimitDistance || S > this.options.momentumLimitDistance)) {
|
|
859
|
+
var H = !1, O = !1, K = !1, j = !1, $ = this.options.bounce;
|
|
860
|
+
$ !== !1 && (H = $.top === void 0 || $.top, O = $.bottom === void 0 || $.bottom, K = $.left === void 0 || $.left, j = $.right === void 0 || $.right);
|
|
861
|
+
var vt = this.directionX === -1 && K || this.directionX === 1 && j ? this.wrapperWidth : 0, mt = this.directionY === -1 && H || this.directionY === 1 && O ? this.wrapperHeight : 0, gt = this.hasHorizontalScroll ? pt(
|
|
862
|
+
this.x,
|
|
863
|
+
this.startX,
|
|
864
|
+
u,
|
|
865
|
+
this.maxScrollX,
|
|
866
|
+
this.minScrollX,
|
|
867
|
+
vt,
|
|
868
|
+
this.options
|
|
869
|
+
) : {
|
|
870
|
+
destination: e,
|
|
871
|
+
duration: 0
|
|
872
|
+
}, wt = this.hasVerticalScroll ? pt(
|
|
873
|
+
this.y,
|
|
874
|
+
this.startY,
|
|
875
|
+
u,
|
|
876
|
+
this.maxScrollY,
|
|
877
|
+
this.minScrollY,
|
|
878
|
+
mt,
|
|
879
|
+
this.options
|
|
880
|
+
) : {
|
|
881
|
+
destination: i,
|
|
882
|
+
duration: 0
|
|
883
|
+
};
|
|
884
|
+
e = gt.destination, i = wt.destination, z = Math.max(gt.duration, wt.duration), this.isInTransition = !0;
|
|
885
|
+
} else
|
|
886
|
+
this.options.wheel && (i = Math.round(i / this.itemHeight) * this.itemHeight, z = this.options.wheel.adjustTime || 400);
|
|
887
|
+
var Mt = N.swipe;
|
|
888
|
+
if (this.options.snap) {
|
|
889
|
+
var xt = this._nearestSnap(e, i);
|
|
890
|
+
this.currentPage = xt, z = this.options.snapSpeed || Math.max(
|
|
891
|
+
Math.max(
|
|
892
|
+
Math.min(Math.abs(e - xt.x), 1e3),
|
|
893
|
+
Math.min(Math.abs(i - xt.y), 1e3)
|
|
894
|
+
),
|
|
895
|
+
300
|
|
896
|
+
), e = xt.x, i = xt.y, this.directionX = 0, this.directionY = 0, Mt = this.options.snap.easing || N.bounce;
|
|
897
|
+
}
|
|
898
|
+
if (e !== this.x || i !== this.y)
|
|
899
|
+
return (e > this.minScrollX || e < this.maxScrollX || i > this.minScrollY || i < this.maxScrollY) && (Mt = N.swipeBounce), void this.scrollTo(e, i, z, Mt);
|
|
900
|
+
this.options.wheel && (this.selectedIndex = Math.round(
|
|
901
|
+
Math.abs(this.y / this.itemHeight)
|
|
902
|
+
)), this.trigger("scrollEnd", {
|
|
903
|
+
x: this.x,
|
|
904
|
+
y: this.y
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
}, C.prototype._checkClick = function(t) {
|
|
911
|
+
var e, i, a, h, u, S = this.stopFromTransition && !this.pulling;
|
|
912
|
+
if (this.stopFromTransition = !1, this.moved) return !1;
|
|
913
|
+
if (this.options.wheel) {
|
|
914
|
+
if (this.target && this.target.classList.contains(
|
|
915
|
+
this.options.wheel.wheelWrapperClass
|
|
916
|
+
)) {
|
|
917
|
+
var k = Math.abs(Math.round(this.y / this.itemHeight)), z = Math.round(
|
|
918
|
+
(this.pointY + (h = this.wrapper, {
|
|
919
|
+
left: -((u = h.getBoundingClientRect()).left + window.pageXOffset),
|
|
920
|
+
top: -(u.top + window.pageYOffset)
|
|
921
|
+
}).top - this.wrapperHeight / 2) / this.itemHeight
|
|
922
|
+
);
|
|
923
|
+
this.target = this.items[k + z];
|
|
924
|
+
}
|
|
925
|
+
return this.scrollToElement(
|
|
926
|
+
this.target,
|
|
927
|
+
this.options.wheel.adjustTime || 400,
|
|
928
|
+
!0,
|
|
929
|
+
!0,
|
|
930
|
+
N.swipe
|
|
931
|
+
), !0;
|
|
932
|
+
}
|
|
933
|
+
if (S) return !1;
|
|
934
|
+
var H = this.options.dblclick, O = !1;
|
|
935
|
+
if (H && this.lastClickTime) {
|
|
936
|
+
var K = H.delay, j = K === void 0 ? 300 : K;
|
|
937
|
+
Y() - this.lastClickTime < j && (O = !0, J(t, "dblclick"));
|
|
938
|
+
}
|
|
939
|
+
return this.options.tap && (e = t, i = this.options.tap, (a = document.createEvent("Event")).initEvent(i, !0, !0), a.pageX = e.pageX, a.pageY = e.pageY, e.target.dispatchEvent(a)), this.options.click && !F(t.target, this.options.preventDefaultException) && J(t), this.lastClickTime = O ? null : Y(), !0;
|
|
940
|
+
}, C.prototype._resize = function() {
|
|
941
|
+
var t = this;
|
|
942
|
+
this.enabled && (T && (this.wrapper.scrollTop = 0), clearTimeout(this.resizeTimeout), this.resizeTimeout = setTimeout(function() {
|
|
943
|
+
t.refresh();
|
|
944
|
+
}, this.options.resizePolling));
|
|
945
|
+
}, C.prototype._startProbe = function() {
|
|
946
|
+
ft(this.probeTimer), this.probeTimer = dt(function e() {
|
|
947
|
+
var i = t.getComputedPosition();
|
|
948
|
+
t.trigger("scroll", i), t.isInTransition ? t.probeTimer = dt(e) : t.trigger("scrollEnd", i);
|
|
949
|
+
});
|
|
950
|
+
var t = this;
|
|
951
|
+
}, C.prototype._transitionTime = function() {
|
|
952
|
+
var t = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
953
|
+
if (this.scrollerStyle[x.transitionDuration] = t + "ms", this.options.wheel)
|
|
954
|
+
for (var e = 0; e < this.items.length; e++)
|
|
955
|
+
this.items[e].style[x.transitionDuration] = t + "ms";
|
|
956
|
+
if (this.indicators)
|
|
957
|
+
for (var i = 0; i < this.indicators.length; i++)
|
|
958
|
+
this.indicators[i].transitionTime(t);
|
|
959
|
+
}, C.prototype._transitionTimingFunction = function(t) {
|
|
960
|
+
if (this.scrollerStyle[x.transitionTimingFunction] = t, this.options.wheel)
|
|
961
|
+
for (var e = 0; e < this.items.length; e++)
|
|
962
|
+
this.items[e].style[x.transitionTimingFunction] = t;
|
|
963
|
+
if (this.indicators)
|
|
964
|
+
for (var i = 0; i < this.indicators.length; i++)
|
|
965
|
+
this.indicators[i].transitionTimingFunction(t);
|
|
966
|
+
}, C.prototype._transitionEnd = function(t) {
|
|
967
|
+
t.target === this.scroller && this.isInTransition && (this._transitionTime(), this.pulling && this.movingDirectionY !== 1 || this.resetPosition(this.options.bounceTime, N.bounce) || (this.isInTransition = !1, this.options.probeType !== 3 && this.trigger("scrollEnd", {
|
|
968
|
+
x: this.x,
|
|
969
|
+
y: this.y
|
|
970
|
+
})));
|
|
971
|
+
}, C.prototype._translate = function(t, e, i) {
|
|
972
|
+
if ((function(z) {
|
|
973
|
+
if (!z)
|
|
974
|
+
throw new Error(
|
|
975
|
+
"[BScroll] Translate x or y is null or undefined."
|
|
976
|
+
);
|
|
977
|
+
})(!X(t) && !X(e)), X(i) && (i = this.scale), this.options.useTransform ? this.scrollerStyle[x.transform] = "translate(" + t + "px," + e + "px) scale(" + i + ")" + this.translateZ : (t = Math.round(t), e = Math.round(e), this.scrollerStyle.left = t + "px", this.scrollerStyle.top = e + "px"), this.options.wheel)
|
|
978
|
+
for (var a = this.options.wheel.rotate, h = a === void 0 ? 25 : a, u = 0; u < this.items.length; u++) {
|
|
979
|
+
var S = h * (e / this.itemHeight + u);
|
|
980
|
+
this.items[u].style[x.transform] = "rotateX(" + S + "deg)";
|
|
981
|
+
}
|
|
982
|
+
if (this.x = t, this.y = e, this.setScale(i), this.indicators)
|
|
983
|
+
for (var k = 0; k < this.indicators.length; k++)
|
|
984
|
+
this.indicators[k].updatePosition();
|
|
985
|
+
}, C.prototype._animate = function(t, e, i, a) {
|
|
986
|
+
var h = this, u = this.x, S = this.y, k = this.lastScale, z = this.scale, H = Y(), O = H + i;
|
|
987
|
+
this.isAnimating = !0, ft(this.animateTimer), (function K() {
|
|
988
|
+
var j = Y();
|
|
989
|
+
if (O <= j)
|
|
990
|
+
return h.isAnimating = !1, h._translate(t, e, z), h.trigger("scroll", {
|
|
991
|
+
x: h.x,
|
|
992
|
+
y: h.y
|
|
993
|
+
}), void (h.pulling || h.resetPosition(h.options.bounceTime) || h.trigger("scrollEnd", {
|
|
994
|
+
x: h.x,
|
|
995
|
+
y: h.y
|
|
996
|
+
}));
|
|
997
|
+
var $ = a(j = (j - H) / i), vt = (t - u) * $ + u, mt = (e - S) * $ + S, gt = (z - k) * $ + k;
|
|
998
|
+
h._translate(vt, mt, gt), h.isAnimating && (h.animateTimer = dt(K)), h.options.probeType === 3 && h.trigger("scroll", {
|
|
999
|
+
x: h.x,
|
|
1000
|
+
y: h.y
|
|
1001
|
+
});
|
|
1002
|
+
})();
|
|
1003
|
+
}, C.prototype.scrollBy = function(t, e) {
|
|
1004
|
+
var i = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : 0, a = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : N.bounce;
|
|
1005
|
+
t = this.x + t, e = this.y + e, this.scrollTo(t, e, i, a);
|
|
1006
|
+
}, C.prototype.scrollTo = function(t, e) {
|
|
1007
|
+
var i = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : 0, a = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : N.bounce;
|
|
1008
|
+
this.x === t && this.y === e || (this.isInTransition = this.options.useTransition && 0 < i && (t !== this.x || e !== this.y), !i || this.options.useTransition ? (this._transitionTimingFunction(a.style), this._transitionTime(i), this._translate(t, e), i && this.options.probeType === 3 && this._startProbe(), i || (this.trigger("scroll", {
|
|
1009
|
+
x: t,
|
|
1010
|
+
y: e
|
|
1011
|
+
}), this._reflow = document.body.offsetHeight, this.resetPosition(this.options.bounceTime, N.bounce) || this.trigger("scrollEnd", {
|
|
1012
|
+
x: t,
|
|
1013
|
+
y: e
|
|
1014
|
+
})), this.options.wheel && (e > this.minScrollY ? this.selectedIndex = 0 : e < this.maxScrollY ? this.selectedIndex = this.items.length - 1 : this.selectedIndex = Math.round(
|
|
1015
|
+
Math.abs(e / this.itemHeight)
|
|
1016
|
+
))) : this._animate(t, e, i, a.fn));
|
|
1017
|
+
}, C.prototype.scrollToElement = function(t, e, i, a, h) {
|
|
1018
|
+
if (t && (t = t.nodeType ? t : this.scroller.querySelector(t), !this.options.wheel || t.classList.contains(this.options.wheel.wheelItemClass))) {
|
|
1019
|
+
var u = v(t);
|
|
1020
|
+
u.left -= this.wrapperOffset.left, u.top -= this.wrapperOffset.top, i === !0 && (i = Math.round(
|
|
1021
|
+
t.offsetWidth / 2 - this.wrapper.offsetWidth / 2
|
|
1022
|
+
)), a === !0 && (a = Math.round(
|
|
1023
|
+
t.offsetHeight / 2 - this.wrapper.offsetHeight / 2
|
|
1024
|
+
)), u.left -= i || 0, u.top -= a || 0, u.left = u.left > this.minScrollX ? this.minScrollX : u.left < this.maxScrollX ? this.maxScrollX : u.left, u.top = u.top > this.minScrollY ? this.minScrollY : u.top < this.maxScrollY ? this.maxScrollY : u.top, this.options.wheel && (u.top = Math.round(u.top / this.itemHeight) * this.itemHeight), this.scrollTo(u.left, u.top, e, h);
|
|
1025
|
+
}
|
|
1026
|
+
}, C.prototype.resetPosition = function() {
|
|
1027
|
+
var t = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : 0, e = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : N.bounce, i = this.x, a = Math.round(i);
|
|
1028
|
+
!this.hasHorizontalScroll || a > this.minScrollX ? i = this.minScrollX : a < this.maxScrollX && (i = this.maxScrollX);
|
|
1029
|
+
var h = this.y, u = Math.round(h);
|
|
1030
|
+
return !this.hasVerticalScroll || u > this.minScrollY ? h = this.minScrollY : u < this.maxScrollY && (h = this.maxScrollY), (i !== this.x || h !== this.y) && (this.scrollTo(i, h, t, e), !0);
|
|
1031
|
+
}, C.prototype.getComputedPosition = function() {
|
|
1032
|
+
var t = window.getComputedStyle(this.scroller, null), e = void 0, i = void 0;
|
|
1033
|
+
return i = this.options.useTransform ? (e = +((t = t[x.transform].split(")")[0].split(", "))[12] || t[4]), +(t[13] || t[5])) : (e = +t.left.replace(/[^-\d.]/g, ""), +t.top.replace(/[^-\d.]/g, "")), {
|
|
1034
|
+
x: e,
|
|
1035
|
+
y: i
|
|
1036
|
+
};
|
|
1037
|
+
}, C.prototype.stop = function() {
|
|
1038
|
+
if (this.options.useTransition && this.isInTransition) {
|
|
1039
|
+
this.isInTransition = !1, ft(this.probeTimer);
|
|
1040
|
+
var t = this.getComputedPosition();
|
|
1041
|
+
this._translate(t.x, t.y), this.options.wheel ? this.target = this.items[Math.round(-t.y / this.itemHeight)] : this.trigger("scrollEnd", {
|
|
1042
|
+
x: this.x,
|
|
1043
|
+
y: this.y
|
|
1044
|
+
}), this.stopFromTransition = !0;
|
|
1045
|
+
} else
|
|
1046
|
+
!this.options.useTransition && this.isAnimating && (this.isAnimating = !1, ft(this.animateTimer), this.trigger("scrollEnd", {
|
|
1047
|
+
x: this.x,
|
|
1048
|
+
y: this.y
|
|
1049
|
+
}), this.stopFromTransition = !0);
|
|
1050
|
+
}, C.prototype.destroy = function() {
|
|
1051
|
+
this.destroyed = !0, this.trigger("destroy"), this.options.useTransition ? ft(this.probeTimer) : ft(this.animateTimer), this._removeDOMEvents(), this._events = {};
|
|
1052
|
+
}, (rt = ht).prototype.on = function(t, e) {
|
|
1053
|
+
var i = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : this;
|
|
1054
|
+
this._events[t] || (this._events[t] = []), this._events[t].push([e, i]);
|
|
1055
|
+
}, rt.prototype.once = function(t, e) {
|
|
1056
|
+
var i = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : this;
|
|
1057
|
+
function a() {
|
|
1058
|
+
this.off(t, a), e.apply(i, arguments);
|
|
1059
|
+
}
|
|
1060
|
+
a.fn = e, this.on(t, a);
|
|
1061
|
+
}, rt.prototype.off = function(t, e) {
|
|
1062
|
+
var i = this._events[t];
|
|
1063
|
+
if (i)
|
|
1064
|
+
for (var a = i.length; a--; )
|
|
1065
|
+
(i[a][0] === e || i[a][0] && i[a][0].fn === e) && s(i, a);
|
|
1066
|
+
}, rt.prototype.trigger = function(t) {
|
|
1067
|
+
var e = this._events[t];
|
|
1068
|
+
if (e)
|
|
1069
|
+
for (var i = e.length, a = [].concat(
|
|
1070
|
+
(function(H) {
|
|
1071
|
+
if (Array.isArray(H)) {
|
|
1072
|
+
for (var O = 0, K = Array(H.length); O < H.length; O++)
|
|
1073
|
+
K[O] = H[O];
|
|
1074
|
+
return K;
|
|
1075
|
+
}
|
|
1076
|
+
return Array.from(H);
|
|
1077
|
+
})(e)
|
|
1078
|
+
), h = 0; h < i; h++) {
|
|
1079
|
+
var u = a[h], S = r(u, 2), k = S[0], z = S[1];
|
|
1080
|
+
k && k.apply(z, [].slice.call(arguments, 1));
|
|
1081
|
+
}
|
|
1082
|
+
}, (at = ht).prototype.wheelTo = function() {
|
|
1083
|
+
var t = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
1084
|
+
if (this.options.wheel) {
|
|
1085
|
+
var e = -t * this.itemHeight;
|
|
1086
|
+
this.scrollTo(0, e);
|
|
1087
|
+
}
|
|
1088
|
+
}, at.prototype.getSelectedIndex = function() {
|
|
1089
|
+
return this.options.wheel && this.selectedIndex;
|
|
1090
|
+
}, at.prototype._initWheel = function() {
|
|
1091
|
+
var t = this.options.wheel;
|
|
1092
|
+
t.wheelWrapperClass || (t.wheelWrapperClass = "wheel-scroll"), t.wheelItemClass || (t.wheelItemClass = "wheel-item"), t.selectedIndex === void 0 && (t.selectedIndex = 0, lt("wheel option selectedIndex is required!"));
|
|
1093
|
+
}, (ut = ht).prototype._initMouseWheel = function() {
|
|
1094
|
+
var t = this;
|
|
1095
|
+
this._handleMouseWheelEvent(U), this.on("destroy", function() {
|
|
1096
|
+
clearTimeout(t.mouseWheelTimer), clearTimeout(t.mouseWheelEndTimer), t._handleMouseWheelEvent(q);
|
|
1097
|
+
}), this.firstWheelOpreation = !0;
|
|
1098
|
+
}, ut.prototype._handleMouseWheelEvent = function(t) {
|
|
1099
|
+
t(this.wrapper, "wheel", this), t(this.wrapper, "mousewheel", this), t(this.wrapper, "DOMMouseScroll", this);
|
|
1100
|
+
}, ut.prototype._onMouseWheel = function(t) {
|
|
1101
|
+
var e = this;
|
|
1102
|
+
if (this.enabled) {
|
|
1103
|
+
t.preventDefault(), this.options.stopPropagation && t.stopPropagation(), this.firstWheelOpreation && this.trigger("scrollStart"), this.firstWheelOpreation = !1;
|
|
1104
|
+
var i = this.options.mouseWheel, a = i.speed, h = a === void 0 ? 20 : a, u = i.invert, S = u !== void 0 && u, k = i.easeTime, z = k === void 0 ? 300 : k;
|
|
1105
|
+
clearTimeout(this.mouseWheelTimer), this.mouseWheelTimer = setTimeout(function() {
|
|
1106
|
+
e.options.snap || z || e.trigger("scrollEnd", {
|
|
1107
|
+
x: e.x,
|
|
1108
|
+
y: e.y
|
|
1109
|
+
}), e.firstWheelOpreation = !0;
|
|
1110
|
+
}, 400);
|
|
1111
|
+
var H = void 0, O = void 0;
|
|
1112
|
+
switch (!0) {
|
|
1113
|
+
case "deltaX" in t:
|
|
1114
|
+
O = t.deltaMode === 1 ? (H = -t.deltaX * h, -t.deltaY * h) : (H = -t.deltaX, -t.deltaY);
|
|
1115
|
+
break;
|
|
1116
|
+
case "wheelDeltaX" in t:
|
|
1117
|
+
H = t.wheelDeltaX / 120 * h, O = t.wheelDeltaY / 120 * h;
|
|
1118
|
+
break;
|
|
1119
|
+
case "wheelDelta" in t:
|
|
1120
|
+
H = O = t.wheelDelta / 120 * h;
|
|
1121
|
+
break;
|
|
1122
|
+
case "detail" in t:
|
|
1123
|
+
H = O = -t.detail / 3 * h;
|
|
1124
|
+
break;
|
|
1125
|
+
default:
|
|
1126
|
+
return;
|
|
1127
|
+
}
|
|
1128
|
+
var K = S ? -1 : 1;
|
|
1129
|
+
H *= K, O *= K, this.hasVerticalScroll || (H = O, O = 0);
|
|
1130
|
+
var j = void 0, $ = void 0;
|
|
1131
|
+
if (this.options.snap)
|
|
1132
|
+
return j = this.currentPage.pageX, $ = this.currentPage.pageY, 0 < H ? j-- : H < 0 && j++, 0 < O ? $-- : O < 0 && $++, void this._goToPage(j, $);
|
|
1133
|
+
j = this.x + Math.round(this.hasHorizontalScroll ? H : 0), $ = this.y + Math.round(this.hasVerticalScroll ? O : 0), this.movingDirectionX = this.directionX = 0 < H ? -1 : H < 0 ? 1 : 0, this.movingDirectionY = this.directionY = 0 < O ? -1 : O < 0 ? 1 : 0, j > this.minScrollX ? j = this.minScrollX : j < this.maxScrollX && (j = this.maxScrollX), $ > this.minScrollY ? $ = this.minScrollY : $ < this.maxScrollY && ($ = this.maxScrollY);
|
|
1134
|
+
var vt = this.y === $;
|
|
1135
|
+
this.scrollTo(j, $, z, N.swipe), this.trigger("scroll", {
|
|
1136
|
+
x: this.x,
|
|
1137
|
+
y: this.y
|
|
1138
|
+
}), clearTimeout(this.mouseWheelEndTimer), vt && (this.mouseWheelEndTimer = setTimeout(function() {
|
|
1139
|
+
e.trigger("scrollEnd", {
|
|
1140
|
+
x: e.x,
|
|
1141
|
+
y: e.y
|
|
1142
|
+
});
|
|
1143
|
+
}, z));
|
|
1144
|
+
}
|
|
1145
|
+
}, ht.Version = "1.14.1", ht;
|
|
1146
|
+
})();
|
|
1147
|
+
})(
|
|
1148
|
+
P = {
|
|
1149
|
+
exports: {}
|
|
1150
|
+
},
|
|
1151
|
+
P.exports
|
|
1152
|
+
), P.exports);
|
|
1153
|
+
function tt(_, c, s) {
|
|
1154
|
+
if (!(Number(s) !== _ && Number(s) !== c)) {
|
|
1155
|
+
var r = "", f = 0, y = _, A = c;
|
|
1156
|
+
Number(s) === _ && (y = _ - 100, A = c - 100), Number(s) === c && (y = _ + 100, A = c + 100);
|
|
1157
|
+
for (var T = y; T <= A; T++)
|
|
1158
|
+
r += '<li class="wheel-item wheel-item-yy '.concat(T === Number(s) ? "active" : "", '" data-index=').concat(f, `>
|
|
1159
|
+
`).concat(T, `
|
|
1160
|
+
</li>`), f++;
|
|
1161
|
+
return {
|
|
1162
|
+
e: r,
|
|
1163
|
+
start: y,
|
|
1164
|
+
finish: A
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
function ct(_) {
|
|
1169
|
+
var c = _.split(/[: -]/), s = new Date(
|
|
1170
|
+
Number(c[0]),
|
|
1171
|
+
Number(c[1]) - 1,
|
|
1172
|
+
Number(c[2]),
|
|
1173
|
+
Number(c[3]),
|
|
1174
|
+
Number(c[4])
|
|
1175
|
+
), r = !0;
|
|
1176
|
+
if (I != null && I?.minDate) {
|
|
1177
|
+
let f = I?.minDate;
|
|
1178
|
+
r = s.getTime() >= f.getTime();
|
|
1179
|
+
}
|
|
1180
|
+
if (I != null && I?.maxDate && r) {
|
|
1181
|
+
let f = I?.maxDate;
|
|
1182
|
+
r = s.getTime() <= f.getTime();
|
|
1183
|
+
}
|
|
1184
|
+
return r;
|
|
1185
|
+
}
|
|
1186
|
+
function ot() {
|
|
1187
|
+
var _ = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : {}, c = this, s = void 0;
|
|
1188
|
+
if (c.extend(_), _.el) {
|
|
1189
|
+
if (!(s = b(_.el).closest(".vue3-ios-datepicker-container"))) return;
|
|
1190
|
+
s.bindRolldate = c, c.tap(s, () => {
|
|
1191
|
+
s.bindRolldate.show();
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
return ot.prototype = {
|
|
1196
|
+
constructor: ot,
|
|
1197
|
+
baseData: function() {
|
|
1198
|
+
return {
|
|
1199
|
+
domId: {
|
|
1200
|
+
YYYY: "rolldate-year",
|
|
1201
|
+
MM: "rolldate-month",
|
|
1202
|
+
DD: "rolldate-day",
|
|
1203
|
+
hh: "rolldate-hour",
|
|
1204
|
+
mm: "rolldate-min",
|
|
1205
|
+
ss: "rolldate-sec"
|
|
1206
|
+
},
|
|
1207
|
+
opts: {
|
|
1208
|
+
el: "",
|
|
1209
|
+
format: "YYYY-MM-DD",
|
|
1210
|
+
initValue: "",
|
|
1211
|
+
beginYear: 2e3,
|
|
1212
|
+
endYear: 2100,
|
|
1213
|
+
title: "",
|
|
1214
|
+
init: null,
|
|
1215
|
+
moveEnd: null,
|
|
1216
|
+
confirm: null,
|
|
1217
|
+
cancel: null,
|
|
1218
|
+
minStep: 1,
|
|
1219
|
+
trigger: "tap",
|
|
1220
|
+
lang: {
|
|
1221
|
+
cancel: "",
|
|
1222
|
+
confirm: B || "Chọn",
|
|
1223
|
+
year: "",
|
|
1224
|
+
month: "Tháng ",
|
|
1225
|
+
day: "",
|
|
1226
|
+
hour: "",
|
|
1227
|
+
min: "",
|
|
1228
|
+
sec: ""
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
};
|
|
1232
|
+
},
|
|
1233
|
+
extend: function(c) {
|
|
1234
|
+
var s = this.baseData().opts;
|
|
1235
|
+
for (var r in s)
|
|
1236
|
+
if (s[r] && Object.prototype.toString.call(s[r]) == "[object Object]")
|
|
1237
|
+
for (var f in c[r]) s[r][f] = c[r][f] == null ? s[r][f] : c[r][f];
|
|
1238
|
+
else s[r] = c[r] || s[r];
|
|
1239
|
+
this.config = s;
|
|
1240
|
+
},
|
|
1241
|
+
createUI: function() {
|
|
1242
|
+
b(this.config.el).focus();
|
|
1243
|
+
var c = yt(
|
|
1244
|
+
b(this.config.el).value,
|
|
1245
|
+
[this.config.format],
|
|
1246
|
+
!0
|
|
1247
|
+
).isValid() ? yt(b(this.config.el).value, [this.config.format]).toDate() : null, s = /* @__PURE__ */ new Date(), r = this.config.initValue, f = c || r || s, y = bt(f).beginYear, A = bt(f).endYear;
|
|
1248
|
+
const T = this.config.format.split(/-|\/|\s|:/g), Y = ["DD", "MM", "YYYY"], Z = ["HH", "mm", "ss"], X = [
|
|
1249
|
+
...Y.filter((ut) => T.includes(ut)),
|
|
1250
|
+
...Z.filter((ut) => T.includes(ut))
|
|
1251
|
+
];
|
|
1252
|
+
for (var m = this, D = m.baseData(), w = m.config, U = D.domId, q = X, v = q.length, o = "", n = f, d = w.lang, l = 0; l < v; l++) {
|
|
1253
|
+
var g = q[l], p = 0;
|
|
1254
|
+
if (o += '<div id="' + U[g] + '"><ul class="wheel-scroll">', g == "YYYY")
|
|
1255
|
+
for (var x = y; x <= A; x++)
|
|
1256
|
+
o += '<li class="wheel-item wheel-item-yy ' + (x == n.getFullYear() ? "active" : "") + '" data-index="' + p + '">' + x + d.year + "</li>", p++;
|
|
1257
|
+
else if (g == "MM")
|
|
1258
|
+
for (var L = 1; L <= 12; L++)
|
|
1259
|
+
o += '<li class="wheel-item wheel-item-month ' + (L == n.getMonth() + 1 ? "active" : "") + '" data-index="' + p + '">' + d.month + (L < 10 ? "0" + L : L) + "</li>", p++;
|
|
1260
|
+
else if (g == "DD")
|
|
1261
|
+
for (var V = m.getMonthlyDay(n.getFullYear(), n.getMonth() + 1), F = 1; F <= V; F++)
|
|
1262
|
+
o += '<li class="wheel-item wheel-item-dd ' + (F == n.getDate() ? "active" : "") + '" data-index="' + p + '">' + (F < 10 ? "0" + F : F) + d.day + "</li>", p++;
|
|
1263
|
+
else if (g == "HH")
|
|
1264
|
+
for (var J = 0; J <= 23; J++)
|
|
1265
|
+
o += '<li class="wheel-item wheel-item-hh ' + (J == n.getHours() ? "active" : "") + '" data-index="' + p + '">' + (J < 10 ? "0" + J : J) + d.hour + "</li>", p++;
|
|
1266
|
+
else if (g == "mm")
|
|
1267
|
+
for (var st = 0; st <= 59; st += w.minStep)
|
|
1268
|
+
o += '<li class="wheel-item wheel-item-mm ' + (st == n.getMinutes() ? "active" : "") + '" data-index="' + p + '">' + (st < 10 ? "0" + st : st) + d.min + "</li>", p++;
|
|
1269
|
+
else if (g == "ss")
|
|
1270
|
+
for (var N = 0; N <= 59; N++)
|
|
1271
|
+
o += '<li class="wheel-item ' + (N == n.getSeconds() ? "active" : "") + '" data-index="' + p + '">' + (N < 10 ? "0" + N : N) + d.sec + "</li>", p++;
|
|
1272
|
+
o += "</ul></div>";
|
|
1273
|
+
}
|
|
1274
|
+
var pt = `<div class="rolldate-mask"></div>
|
|
1275
|
+
<div class="rolldate-panel">
|
|
1276
|
+
<header>
|
|
1277
|
+
<span class="rolldate-cancel icon-close-roll-date"></span>
|
|
1278
|
+
` + w.title + `</header>
|
|
1279
|
+
<section class="rolldate-content">
|
|
1280
|
+
<div class="rolldate-dim mask-top"></div>
|
|
1281
|
+
<div class="rolldate-dim mask-bottom"></div>
|
|
1282
|
+
<div class="rolldate-wrapper">
|
|
1283
|
+
` + o + `
|
|
1284
|
+
</div>
|
|
1285
|
+
</section>
|
|
1286
|
+
<span class="rolldate-btn rolldate-confirm"> ` + d.confirm + " </span> </div>", nt = document.createElement("div");
|
|
1287
|
+
nt.className = "rolldate-container", nt.innerHTML = pt, document.body.appendChild(nt), m.scroll = {};
|
|
1288
|
+
for (var E = JSON.parse(JSON.stringify(y)), C = JSON.parse(JSON.stringify(A)), rt = function(dt) {
|
|
1289
|
+
var ft = U[q[dt]];
|
|
1290
|
+
m.scroll[q[dt]] = new W("#" + ft, {
|
|
1291
|
+
wheel: {
|
|
1292
|
+
selectedIndex: 0
|
|
1293
|
+
}
|
|
1294
|
+
});
|
|
1295
|
+
var lt = m.scroll[q[dt]], ht = b("#" + ft + " .active"), t = ht ? ht.getAttribute("data-index") : Math.round(n.getMinutes() / w.minStep), e = q[dt];
|
|
1296
|
+
lt.wheelTo(t), lt.on("scrollEnd", function() {
|
|
1297
|
+
if (w.moveEnd && w.moveEnd.call(m, lt), [U.YYYY, U.MM].indexOf(lt.wrapper.id) != -1 && m.scroll.YYYY && m.scroll.MM && m.scroll.DD) {
|
|
1298
|
+
var i = m.getMonthlyDay(
|
|
1299
|
+
m.getSelected(m.scroll.YYYY),
|
|
1300
|
+
m.getSelected(m.scroll.MM)
|
|
1301
|
+
), a = "";
|
|
1302
|
+
if (i != b("#" + U.DD + " li", 1).length) {
|
|
1303
|
+
for (var h = 1; h <= i; h++)
|
|
1304
|
+
a += '<li class="wheel-item">' + (h < 10 ? "0" + h : h) + d.day + "</li>";
|
|
1305
|
+
b("#" + U.DD + " ul").innerHTML = a, m.scroll.DD.refresh();
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
if (e === "YYYY") {
|
|
1309
|
+
var u = tt(
|
|
1310
|
+
E,
|
|
1311
|
+
C,
|
|
1312
|
+
m.getSelected(m.scroll.YYYY)
|
|
1313
|
+
);
|
|
1314
|
+
u && (b("#" + U.YYYY + " ul").innerHTML = u.e, E = u.start, C = u.finish, m.scroll.YYYY.selectedIndex = 100, lt.wheelTo("100"), m.scroll.YYYY.refresh());
|
|
1315
|
+
}
|
|
1316
|
+
var S = "".concat(m.getSelected(m.scroll.YYYY), "-").concat(m.getSelected(m.scroll.MM), "-").concat(m.getSelected(m.scroll.DD), " 23:59");
|
|
1317
|
+
ct(S) ? document.querySelector(".rolldate-confirm").classList.remove("disabled") : document.querySelector(".rolldate-confirm").classList.add("disabled");
|
|
1318
|
+
}), lt.on("scrollMove", function() {
|
|
1319
|
+
document.querySelector(".rolldate-confirm").classList.add("disabled");
|
|
1320
|
+
});
|
|
1321
|
+
}, at = 0; at < v; at++)
|
|
1322
|
+
rt(at);
|
|
1323
|
+
b(".rolldate-panel").className = "rolldate-panel fadeIn";
|
|
1324
|
+
},
|
|
1325
|
+
tap: function(c, s) {
|
|
1326
|
+
if ("ontouchstart" in window && this.config.trigger == "tap") {
|
|
1327
|
+
var r = {}, f = function(Y) {
|
|
1328
|
+
var Z = Y.touches[0];
|
|
1329
|
+
r.startX = Z.pageX, r.startY = Z.pageY, r.sTime = +/* @__PURE__ */ new Date();
|
|
1330
|
+
}, y = function(Y) {
|
|
1331
|
+
var Z = Y.changedTouches[0];
|
|
1332
|
+
r.endX = Z.pageX, r.endY = Z.pageY, +/* @__PURE__ */ new Date() - r.sTime < 300 && Math.abs(r.endX - r.startX) + Math.abs(r.endY - r.startY) < 20 && (Y.preventDefault(), s.call(this, Y)), r = {};
|
|
1333
|
+
};
|
|
1334
|
+
typeof s == "function" ? (c?.addEventListener("touchstart", f, {
|
|
1335
|
+
passive: !0
|
|
1336
|
+
}), c?.addEventListener("touchend", y)) : (c?.removeEventListener("touchstart", f, {
|
|
1337
|
+
passive: !0
|
|
1338
|
+
}), c?.removeEventListener("touchend", y));
|
|
1339
|
+
} else {
|
|
1340
|
+
var A = function(Y) {
|
|
1341
|
+
s.call(this, Y);
|
|
1342
|
+
};
|
|
1343
|
+
typeof s == "function" ? c.addEventListener("click", A) : c.removeEventListener("click", A);
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
show: function() {
|
|
1347
|
+
var c = this, s = this.config, r = void 0;
|
|
1348
|
+
if (s.el) {
|
|
1349
|
+
if (!(r = b(s.el)).closest(".vue3-ios-datepicker-container").bindRolldate)
|
|
1350
|
+
return;
|
|
1351
|
+
r.nodeName.toLowerCase() == "input" && r.blur();
|
|
1352
|
+
}
|
|
1353
|
+
b(".rolldate-container") || s.init && s.init.call(this) === !1 || (this.createUI(), this.event()), b(".rolldate-cancel").addEventListener("click", function() {
|
|
1354
|
+
c.hide(1);
|
|
1355
|
+
});
|
|
1356
|
+
},
|
|
1357
|
+
hide: function(c) {
|
|
1358
|
+
var s = b(".rolldate-panel.fadeIn");
|
|
1359
|
+
s && (s.className = "rolldate-panel fadeOut", this.destroy(c));
|
|
1360
|
+
},
|
|
1361
|
+
event: function() {
|
|
1362
|
+
var c = this, s = b(".rolldate-mask"), r = b(".rolldate-cancel"), f = b(".rolldate-confirm");
|
|
1363
|
+
c.tap(s, function() {
|
|
1364
|
+
c.hide(1);
|
|
1365
|
+
}), c.tap(r, function() {
|
|
1366
|
+
c.hide(1);
|
|
1367
|
+
}), c.tap(f, function() {
|
|
1368
|
+
var y = c.config, A = void 0, T = y.format, Y = /* @__PURE__ */ new Date();
|
|
1369
|
+
if ((I == null ? void 0 : !0) !== void 0) {
|
|
1370
|
+
var Z = "".concat(c.getSelected(c.scroll.YYYY), "-").concat(c.getSelected(c.scroll.MM), "-").concat(c.getSelected(c.scroll.DD), " 23:59");
|
|
1371
|
+
if (ct(Z)) {
|
|
1372
|
+
for (var X in c.scroll) {
|
|
1373
|
+
var m = c.getSelected(c.scroll[X]);
|
|
1374
|
+
T = T.replace(X, m), X == "YYYY" ? Y.setFullYear(m) : X == "MM" ? Y.setMonth(m - 1) : X == "DD" ? Y.setDate(m) : X == "HH" ? Y.setHours(m) : X == "mm" ? Y.setMinutes(m) : X == "ss" && Y.setSeconds(m);
|
|
1375
|
+
}
|
|
1376
|
+
if (y.confirm) {
|
|
1377
|
+
var D = y.confirm.call(c, T);
|
|
1378
|
+
if (D === !1) return !1;
|
|
1379
|
+
D && (T = D);
|
|
1380
|
+
}
|
|
1381
|
+
y.el ? ((A = b(y.el)).nodeName.toLowerCase() == "input" ? A.value = T : A.innerText = T, A.bindDate = Y) : c.bindDate = Y, c.hide();
|
|
1382
|
+
}
|
|
1383
|
+
} else {
|
|
1384
|
+
for (var X in c.scroll) {
|
|
1385
|
+
var m = c.getSelected(c.scroll[X]);
|
|
1386
|
+
T = T.replace(X, m), X == "YYYY" ? Y.setFullYear(m) : X == "MM" ? Y.setMonth(m - 1) : X == "DD" ? Y.setDate(m) : X == "HH" ? Y.setHours(m) : X == "mm" ? Y.setMinutes(m) : X == "ss" && Y.setSeconds(m);
|
|
1387
|
+
}
|
|
1388
|
+
if (y.confirm) {
|
|
1389
|
+
var D = y.confirm.call(c, T);
|
|
1390
|
+
if (D === !1) return !1;
|
|
1391
|
+
D && (T = D);
|
|
1392
|
+
}
|
|
1393
|
+
y.el ? ((A = b(y.el)).nodeName.toLowerCase() == "input" ? A.value = T : A.innerText = T, A.bindDate = Y) : c.bindDate = Y, c.hide();
|
|
1394
|
+
}
|
|
1395
|
+
it(T);
|
|
1396
|
+
});
|
|
1397
|
+
},
|
|
1398
|
+
getMonthlyDay: function(c, s) {
|
|
1399
|
+
var r = void 0;
|
|
1400
|
+
return s == 1 || s == 3 || s == 5 || s == 7 || s == 8 || s == 10 || s == 12 ? r = 31 : s == 4 || s == 6 || s == 11 || s == 9 ? r = 30 : s == 2 && (r = c % 4 != 0 || c % 100 == 0 && c % 400 != 0 ? 28 : 29), r;
|
|
1401
|
+
},
|
|
1402
|
+
destroy: function(c) {
|
|
1403
|
+
var s = this, r = s.config;
|
|
1404
|
+
for (var f in s.scroll) s.scroll[f].destroy();
|
|
1405
|
+
c && r.cancel && r.cancel.call(s), s.tap(b(".rolldate-mask"), 0), s.tap(b(".rolldate-cancel"), 0), s.tap(b(".rolldate-confirm"), 0), setTimeout(function() {
|
|
1406
|
+
var y = b(".rolldate-container");
|
|
1407
|
+
y && document.body.removeChild(y), y = null;
|
|
1408
|
+
}, 300);
|
|
1409
|
+
},
|
|
1410
|
+
getSelected: function(c) {
|
|
1411
|
+
var s;
|
|
1412
|
+
return (s = b("#" + c.wrapper.id + " li", 1)[c.getSelectedIndex()]) === null || s === void 0 ? void 0 : s.innerText.replace(/\D/g, "");
|
|
1413
|
+
}
|
|
1414
|
+
}, ot.version = "3.1.3", ot;
|
|
1415
|
+
}), new Rolldate({
|
|
1416
|
+
el: R,
|
|
1417
|
+
format: G,
|
|
1418
|
+
title: M,
|
|
1419
|
+
value: Q,
|
|
1420
|
+
beginYear: bt(Q || et, G).beginYear,
|
|
1421
|
+
endYear: bt(Q || et, G).endYear,
|
|
1422
|
+
initValue: et
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
function bt(R, G) {
|
|
1426
|
+
var M = R ? yt(R, [G]).isValid() ? yt(R, [G]).toDate() : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), Q = {
|
|
1427
|
+
beginYear: M.getFullYear() - 100,
|
|
1428
|
+
endYear: M.getFullYear() + 100
|
|
1429
|
+
};
|
|
1430
|
+
return Q;
|
|
1431
|
+
}
|
|
1432
|
+
const Gt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1433
|
+
let Qt = (R = 21) => {
|
|
1434
|
+
let G = "", M = crypto.getRandomValues(new Uint8Array(R |= 0));
|
|
1435
|
+
for (; R--; )
|
|
1436
|
+
G += Gt[M[R] & 63];
|
|
1437
|
+
return G;
|
|
1438
|
+
};
|
|
1439
|
+
const Kt = ["name", "value", "placeholder", "id", "aria-controls"], te = /* @__PURE__ */ Et({
|
|
1440
|
+
__name: "DatePicker",
|
|
1441
|
+
props: {
|
|
1442
|
+
modelValue: {},
|
|
1443
|
+
placeholder: {},
|
|
1444
|
+
id: {},
|
|
1445
|
+
name: {},
|
|
1446
|
+
class: {},
|
|
1447
|
+
format: {},
|
|
1448
|
+
title: {},
|
|
1449
|
+
defaultValue: {},
|
|
1450
|
+
confirmLabel: {},
|
|
1451
|
+
options: {}
|
|
1452
|
+
},
|
|
1453
|
+
emits: ["update:modelValue", "onChange"],
|
|
1454
|
+
setup(R, { emit: G }) {
|
|
1455
|
+
const M = Lt(null);
|
|
1456
|
+
let Q = null;
|
|
1457
|
+
const I = R, et = G, B = Dt(() => `${I.id}-${Qt()}`), it = (P) => {
|
|
1458
|
+
const W = {
|
|
1459
|
+
yyyy: "YYYY",
|
|
1460
|
+
yy: "YY",
|
|
1461
|
+
dd: "DD",
|
|
1462
|
+
d: "D",
|
|
1463
|
+
hh: "HH",
|
|
1464
|
+
h: "H",
|
|
1465
|
+
mm: "mm",
|
|
1466
|
+
// minute
|
|
1467
|
+
m: "M",
|
|
1468
|
+
// fallback
|
|
1469
|
+
MM: "MM"
|
|
1470
|
+
// month
|
|
1471
|
+
};
|
|
1472
|
+
return P.replace(/yyyy|yy|dd|d|HH|H|mm|MM|m/gi, (tt) => {
|
|
1473
|
+
const ct = tt.toLowerCase();
|
|
1474
|
+
return ct === "mm" && tt === "MM" ? "MM" : ct === "mm" ? "mm" : W[ct] || tt;
|
|
1475
|
+
});
|
|
1476
|
+
}, b = async () => {
|
|
1477
|
+
await zt(), Q = setTimeout(() => {
|
|
1478
|
+
M.value && Jt(
|
|
1479
|
+
'[aria-controls="' + B.value + '"]',
|
|
1480
|
+
it(I.format),
|
|
1481
|
+
I.title,
|
|
1482
|
+
I.modelValue,
|
|
1483
|
+
I.options,
|
|
1484
|
+
I.defaultValue,
|
|
1485
|
+
I.confirmLabel,
|
|
1486
|
+
(P) => {
|
|
1487
|
+
et("update:modelValue", P), et("onChange", P);
|
|
1488
|
+
}
|
|
1489
|
+
);
|
|
1490
|
+
}, 300);
|
|
1491
|
+
};
|
|
1492
|
+
return Ot(async () => {
|
|
1493
|
+
await b();
|
|
1494
|
+
}), At(() => {
|
|
1495
|
+
Q && clearTimeout(Q);
|
|
1496
|
+
}), (P, W) => (Tt(), Ht("div", null, [
|
|
1497
|
+
Ct("input", {
|
|
1498
|
+
ref_key: "EDatePicker",
|
|
1499
|
+
ref: M,
|
|
1500
|
+
autocorrect: "off",
|
|
1501
|
+
autocapitalize: "off",
|
|
1502
|
+
spellcheck: "false",
|
|
1503
|
+
type: "text",
|
|
1504
|
+
readonly: "",
|
|
1505
|
+
name: I.name || I.id,
|
|
1506
|
+
value: I.modelValue,
|
|
1507
|
+
placeholder: I.placeholder,
|
|
1508
|
+
class: _t(["vue3-ios-datepicker-input", I.class]),
|
|
1509
|
+
id: I.id,
|
|
1510
|
+
"aria-controls": B.value
|
|
1511
|
+
}, null, 10, Kt)
|
|
1512
|
+
]));
|
|
1513
|
+
}
|
|
1514
|
+
}), ee = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201024%201024'%3e%3cpath%20fill='rgb(168,%20171,%20178)'%20d='M128%20384v512h768V192H768v32a32%2032%200%201%201-64%200v-32H320v32a32%2032%200%200%201-64%200v-32H128v128h768v64zm192-256h384V96a32%2032%200%201%201%2064%200v32h160a32%2032%200%200%201%2032%2032v768a32%2032%200%200%201-32%2032H96a32%2032%200%200%201-32-32V160a32%2032%200%200%201%2032-32h160V96a32%2032%200%200%201%2064%200zm-32%20384h64a32%2032%200%200%201%200%2064h-64a32%2032%200%200%201%200-64m0%20192h64a32%2032%200%201%201%200%2064h-64a32%2032%200%201%201%200-64m192-192h64a32%2032%200%200%201%200%2064h-64a32%2032%200%200%201%200-64m0%20192h64a32%2032%200%201%201%200%2064h-64a32%2032%200%201%201%200-64m192-192h64a32%2032%200%201%201%200%2064h-64a32%2032%200%201%201%200-64m0%20192h64a32%2032%200%201%201%200%2064h-64a32%2032%200%201%201%200-64'%3e%3c/path%3e%3c/svg%3e", ie = ["src"], ne = /* @__PURE__ */ Et({
|
|
1515
|
+
__name: "Vue3IosDatepicker",
|
|
1516
|
+
props: {
|
|
1517
|
+
modelValue: {},
|
|
1518
|
+
placeholder: { default: "Select date" },
|
|
1519
|
+
id: {},
|
|
1520
|
+
name: {},
|
|
1521
|
+
format: { default: "YYYY-MM-DD" },
|
|
1522
|
+
iconClose: {},
|
|
1523
|
+
class: { default: "" },
|
|
1524
|
+
inputClass: { default: "" },
|
|
1525
|
+
title: { default: "Select Date" },
|
|
1526
|
+
defaultValue: {},
|
|
1527
|
+
confirmLabel: { default: "OK" },
|
|
1528
|
+
options: {},
|
|
1529
|
+
icon: { default: ee }
|
|
1530
|
+
},
|
|
1531
|
+
emits: ["update:modelValue", "onChange"],
|
|
1532
|
+
setup(R, { emit: G }) {
|
|
1533
|
+
const M = R, Q = G, I = Lt(0), et = Dt(() => M.id ?? `vue3-ios-date-picker-${Pt()}`), B = () => {
|
|
1534
|
+
if (M.iconClose) {
|
|
1535
|
+
const b = document.querySelector(
|
|
1536
|
+
".rolldate-container .icon-close-roll-date"
|
|
1537
|
+
);
|
|
1538
|
+
b && b.style.setProperty("--default-url-icon", `url(${M.iconClose})`);
|
|
1539
|
+
}
|
|
1540
|
+
}, it = Dt(() => M.modelValue ? yt(M.modelValue).format(M.format) : "");
|
|
1541
|
+
return Wt(
|
|
1542
|
+
() => [
|
|
1543
|
+
M.id,
|
|
1544
|
+
M.format,
|
|
1545
|
+
M.title,
|
|
1546
|
+
M.defaultValue,
|
|
1547
|
+
M.confirmLabel,
|
|
1548
|
+
M.placeholder,
|
|
1549
|
+
M.name,
|
|
1550
|
+
M.class,
|
|
1551
|
+
M.inputClass,
|
|
1552
|
+
M.iconClose
|
|
1553
|
+
],
|
|
1554
|
+
() => {
|
|
1555
|
+
I.value++, B();
|
|
1556
|
+
}
|
|
1557
|
+
), Ot(() => {
|
|
1558
|
+
B();
|
|
1559
|
+
}), (b, P) => (Tt(), Ht("div", {
|
|
1560
|
+
class: _t(["vue3-ios-datepicker-container v3-ios-datepicker", M.class])
|
|
1561
|
+
}, [
|
|
1562
|
+
Ct("img", {
|
|
1563
|
+
src: M.icon,
|
|
1564
|
+
alt: "icon date vue3-ios-datepicker",
|
|
1565
|
+
class: "vue3-ios-datepicker-icon"
|
|
1566
|
+
}, null, 8, ie),
|
|
1567
|
+
(Tt(), Vt(te, {
|
|
1568
|
+
key: I.value,
|
|
1569
|
+
"model-value": it.value,
|
|
1570
|
+
placeholder: M.placeholder,
|
|
1571
|
+
id: et.value,
|
|
1572
|
+
name: M.name || et.value,
|
|
1573
|
+
format: M.format,
|
|
1574
|
+
class: _t(M.inputClass),
|
|
1575
|
+
title: M.title,
|
|
1576
|
+
"default-value": M.defaultValue,
|
|
1577
|
+
"confirm-label": M.confirmLabel,
|
|
1578
|
+
options: M.options,
|
|
1579
|
+
"onUpdate:modelValue": P[0] || (P[0] = (W) => Q("update:modelValue", Ft(yt)(W, M.format).toDate())),
|
|
1580
|
+
onOnChange: P[1] || (P[1] = (W) => Q("onChange", W))
|
|
1581
|
+
}, null, 8, ["model-value", "placeholder", "id", "name", "format", "class", "title", "default-value", "confirm-label", "options"]))
|
|
1582
|
+
], 2));
|
|
1583
|
+
}
|
|
1584
|
+
});
|
|
1585
|
+
export {
|
|
1586
|
+
ne as Vue3IosDatepicker
|
|
1587
|
+
};
|