time-runner 1.1.3 → 1.1.5
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 +101 -73
- package/README.zh-CN.md +184 -0
- package/dist/TimeRunner.d.ts +2 -1
- package/dist/Tools.d.ts +12 -0
- package/dist/index.css +1 -1
- package/dist/time-runner.es.js +339 -268
- package/dist/time-runner.umd.js +26 -2
- package/package.json +1 -1
package/dist/time-runner.es.js
CHANGED
|
@@ -1,401 +1,472 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import './index.css';function
|
|
4
|
-
return
|
|
1
|
+
import { jsx as l, Fragment as rt, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { memo as mt, useState as ht, useRef as st, useMemo as ot, useEffect as tt } from "react";
|
|
3
|
+
import './index.css';function $t(d) {
|
|
4
|
+
return d && d.__esModule && Object.prototype.hasOwnProperty.call(d, "default") ? d.default : d;
|
|
5
5
|
}
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
return
|
|
9
|
-
(function(
|
|
10
|
-
|
|
11
|
-
})(
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
return "[" + s + (
|
|
15
|
-
} },
|
|
16
|
-
var
|
|
17
|
-
return !
|
|
18
|
-
},
|
|
19
|
-
var
|
|
20
|
-
return (
|
|
21
|
-
}, m: function s(
|
|
22
|
-
if (
|
|
23
|
-
var
|
|
24
|
-
return +(-(
|
|
6
|
+
var K = { exports: {} }, pt = K.exports, ct;
|
|
7
|
+
function Mt() {
|
|
8
|
+
return ct || (ct = 1, (function(d, c) {
|
|
9
|
+
(function(u, o) {
|
|
10
|
+
d.exports = o();
|
|
11
|
+
})(pt, (function() {
|
|
12
|
+
var u = 1e3, o = 6e4, v = 36e5, $ = "millisecond", D = "second", S = "minute", x = "hour", w = "day", g = "week", f = "month", p = "quarter", m = "year", M = "date", b = "Invalid Date", V = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, U = /\[([^\]]+)]|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, et = { 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(s) {
|
|
13
|
+
var n = ["th", "st", "nd", "rd"], t = s % 100;
|
|
14
|
+
return "[" + s + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
|
|
15
|
+
} }, H = function(s, n, t) {
|
|
16
|
+
var r = String(s);
|
|
17
|
+
return !r || r.length >= n ? s : "" + Array(n + 1 - r.length).join(t) + s;
|
|
18
|
+
}, Z = { s: H, z: function(s) {
|
|
19
|
+
var n = -s.utcOffset(), t = Math.abs(n), r = Math.floor(t / 60), e = t % 60;
|
|
20
|
+
return (n <= 0 ? "+" : "-") + H(r, 2, "0") + ":" + H(e, 2, "0");
|
|
21
|
+
}, m: function s(n, t) {
|
|
22
|
+
if (n.date() < t.date()) return -s(t, n);
|
|
23
|
+
var r = 12 * (t.year() - n.year()) + (t.month() - n.month()), e = n.clone().add(r, f), i = t - e < 0, a = n.clone().add(r + (i ? -1 : 1), f);
|
|
24
|
+
return +(-(r + (t - e) / (i ? e - a : a - e)) || 0);
|
|
25
25
|
}, a: function(s) {
|
|
26
26
|
return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
|
|
27
27
|
}, p: function(s) {
|
|
28
|
-
return { M: f, y:
|
|
28
|
+
return { M: f, y: m, w: g, d: w, D: M, h: x, m: S, s: D, ms: $, Q: p }[s] || String(s || "").toLowerCase().replace(/s$/, "");
|
|
29
29
|
}, u: function(s) {
|
|
30
30
|
return s === void 0;
|
|
31
|
-
} },
|
|
32
|
-
j[
|
|
33
|
-
var
|
|
34
|
-
return s instanceof B || !(!s || !s[
|
|
35
|
-
},
|
|
31
|
+
} }, N = "en", j = {};
|
|
32
|
+
j[N] = et;
|
|
33
|
+
var E = "$isDayjsObject", nt = function(s) {
|
|
34
|
+
return s instanceof B || !(!s || !s[E]);
|
|
35
|
+
}, J = function s(n, t, r) {
|
|
36
36
|
var e;
|
|
37
|
-
if (!
|
|
38
|
-
if (typeof
|
|
39
|
-
var i =
|
|
37
|
+
if (!n) return N;
|
|
38
|
+
if (typeof n == "string") {
|
|
39
|
+
var i = n.toLowerCase();
|
|
40
40
|
j[i] && (e = i), t && (j[i] = t, e = i);
|
|
41
|
-
var a =
|
|
41
|
+
var a = n.split("-");
|
|
42
42
|
if (!e && a.length > 1) return s(a[0]);
|
|
43
43
|
} else {
|
|
44
|
-
var
|
|
45
|
-
j[
|
|
44
|
+
var y = n.name;
|
|
45
|
+
j[y] = n, e = y;
|
|
46
46
|
}
|
|
47
|
-
return !
|
|
48
|
-
},
|
|
49
|
-
if (
|
|
50
|
-
var t = typeof
|
|
47
|
+
return !r && e && (N = e), e || !r && N;
|
|
48
|
+
}, T = function(s, n) {
|
|
49
|
+
if (nt(s)) return s.clone();
|
|
50
|
+
var t = typeof n == "object" ? n : {};
|
|
51
51
|
return t.date = s, t.args = arguments, new B(t);
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
return
|
|
52
|
+
}, h = Z;
|
|
53
|
+
h.l = J, h.i = nt, h.w = function(s, n) {
|
|
54
|
+
return T(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
|
|
55
55
|
};
|
|
56
56
|
var B = (function() {
|
|
57
57
|
function s(t) {
|
|
58
|
-
this.$L =
|
|
58
|
+
this.$L = J(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[E] = !0;
|
|
59
59
|
}
|
|
60
|
-
var
|
|
61
|
-
return
|
|
62
|
-
this.$d = (function(
|
|
63
|
-
var e =
|
|
60
|
+
var n = s.prototype;
|
|
61
|
+
return n.parse = function(t) {
|
|
62
|
+
this.$d = (function(r) {
|
|
63
|
+
var e = r.date, i = r.utc;
|
|
64
64
|
if (e === null) return /* @__PURE__ */ new Date(NaN);
|
|
65
|
-
if (
|
|
65
|
+
if (h.u(e)) return /* @__PURE__ */ new Date();
|
|
66
66
|
if (e instanceof Date) return new Date(e);
|
|
67
67
|
if (typeof e == "string" && !/Z$/i.test(e)) {
|
|
68
|
-
var a = e.match(
|
|
68
|
+
var a = e.match(V);
|
|
69
69
|
if (a) {
|
|
70
|
-
var
|
|
71
|
-
return i ? new Date(Date.UTC(a[1],
|
|
70
|
+
var y = a[2] - 1 || 0, Y = (a[7] || "0").substring(0, 3);
|
|
71
|
+
return i ? new Date(Date.UTC(a[1], y, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, Y)) : new Date(a[1], y, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, Y);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
return new Date(e);
|
|
75
75
|
})(t), this.init();
|
|
76
|
-
},
|
|
76
|
+
}, n.init = function() {
|
|
77
77
|
var t = this.$d;
|
|
78
78
|
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
|
|
79
|
-
},
|
|
80
|
-
return
|
|
81
|
-
},
|
|
82
|
-
return this.$d.toString() !==
|
|
83
|
-
},
|
|
84
|
-
var e =
|
|
85
|
-
return this.startOf(
|
|
86
|
-
},
|
|
87
|
-
return
|
|
88
|
-
},
|
|
89
|
-
return this.endOf(
|
|
90
|
-
},
|
|
91
|
-
return
|
|
92
|
-
},
|
|
79
|
+
}, n.$utils = function() {
|
|
80
|
+
return h;
|
|
81
|
+
}, n.isValid = function() {
|
|
82
|
+
return this.$d.toString() !== b;
|
|
83
|
+
}, n.isSame = function(t, r) {
|
|
84
|
+
var e = T(t);
|
|
85
|
+
return this.startOf(r) <= e && e <= this.endOf(r);
|
|
86
|
+
}, n.isAfter = function(t, r) {
|
|
87
|
+
return T(t) < this.startOf(r);
|
|
88
|
+
}, n.isBefore = function(t, r) {
|
|
89
|
+
return this.endOf(r) < T(t);
|
|
90
|
+
}, n.$g = function(t, r, e) {
|
|
91
|
+
return h.u(t) ? this[r] : this.set(e, t);
|
|
92
|
+
}, n.unix = function() {
|
|
93
93
|
return Math.floor(this.valueOf() / 1e3);
|
|
94
|
-
},
|
|
94
|
+
}, n.valueOf = function() {
|
|
95
95
|
return this.$d.getTime();
|
|
96
|
-
},
|
|
97
|
-
var e = this, i = !!
|
|
98
|
-
var
|
|
99
|
-
return i ?
|
|
100
|
-
},
|
|
101
|
-
return
|
|
102
|
-
},
|
|
96
|
+
}, n.startOf = function(t, r) {
|
|
97
|
+
var e = this, i = !!h.u(r) || r, a = h.p(t), y = function(W, k) {
|
|
98
|
+
var I = h.w(e.$u ? Date.UTC(e.$y, k, W) : new Date(e.$y, k, W), e);
|
|
99
|
+
return i ? I : I.endOf(w);
|
|
100
|
+
}, Y = function(W, k) {
|
|
101
|
+
return h.w(e.toDate()[W].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(k)), e);
|
|
102
|
+
}, _ = this.$W, O = this.$M, C = this.$D, F = "set" + (this.$u ? "UTC" : "");
|
|
103
103
|
switch (a) {
|
|
104
|
-
case
|
|
105
|
-
return i ?
|
|
104
|
+
case m:
|
|
105
|
+
return i ? y(1, 0) : y(31, 11);
|
|
106
106
|
case f:
|
|
107
|
-
return i ?
|
|
108
|
-
case
|
|
109
|
-
var
|
|
110
|
-
return
|
|
111
|
-
case
|
|
107
|
+
return i ? y(1, O) : y(0, O + 1);
|
|
108
|
+
case g:
|
|
109
|
+
var R = this.$locale().weekStart || 0, X = (_ < R ? _ + 7 : _) - R;
|
|
110
|
+
return y(i ? C - X : C + (6 - X), O);
|
|
111
|
+
case w:
|
|
112
112
|
case M:
|
|
113
|
-
return
|
|
114
|
-
case
|
|
115
|
-
return
|
|
113
|
+
return Y(F + "Hours", 0);
|
|
114
|
+
case x:
|
|
115
|
+
return Y(F + "Minutes", 1);
|
|
116
116
|
case S:
|
|
117
|
-
return
|
|
118
|
-
case
|
|
119
|
-
return
|
|
117
|
+
return Y(F + "Seconds", 2);
|
|
118
|
+
case D:
|
|
119
|
+
return Y(F + "Milliseconds", 3);
|
|
120
120
|
default:
|
|
121
121
|
return this.clone();
|
|
122
122
|
}
|
|
123
|
-
},
|
|
123
|
+
}, n.endOf = function(t) {
|
|
124
124
|
return this.startOf(t, !1);
|
|
125
|
-
},
|
|
126
|
-
var e, i =
|
|
127
|
-
if (i === f || i ===
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
} else
|
|
125
|
+
}, n.$set = function(t, r) {
|
|
126
|
+
var e, i = h.p(t), a = "set" + (this.$u ? "UTC" : ""), y = (e = {}, e[w] = a + "Date", e[M] = a + "Date", e[f] = a + "Month", e[m] = a + "FullYear", e[x] = a + "Hours", e[S] = a + "Minutes", e[D] = a + "Seconds", e[$] = a + "Milliseconds", e)[i], Y = i === w ? this.$D + (r - this.$W) : r;
|
|
127
|
+
if (i === f || i === m) {
|
|
128
|
+
var _ = this.clone().set(M, 1);
|
|
129
|
+
_.$d[y](Y), _.init(), this.$d = _.set(M, Math.min(this.$D, _.daysInMonth())).$d;
|
|
130
|
+
} else y && this.$d[y](Y);
|
|
131
131
|
return this.init(), this;
|
|
132
|
-
},
|
|
133
|
-
return this.clone().$set(t,
|
|
134
|
-
},
|
|
135
|
-
return this[
|
|
136
|
-
},
|
|
132
|
+
}, n.set = function(t, r) {
|
|
133
|
+
return this.clone().$set(t, r);
|
|
134
|
+
}, n.get = function(t) {
|
|
135
|
+
return this[h.p(t)]();
|
|
136
|
+
}, n.add = function(t, r) {
|
|
137
137
|
var e, i = this;
|
|
138
138
|
t = Number(t);
|
|
139
|
-
var a =
|
|
140
|
-
var
|
|
141
|
-
return
|
|
139
|
+
var a = h.p(r), y = function(O) {
|
|
140
|
+
var C = T(i);
|
|
141
|
+
return h.w(C.date(C.date() + Math.round(O * t)), i);
|
|
142
142
|
};
|
|
143
143
|
if (a === f) return this.set(f, this.$M + t);
|
|
144
|
-
if (a ===
|
|
145
|
-
if (a ===
|
|
146
|
-
if (a ===
|
|
147
|
-
var
|
|
148
|
-
return
|
|
149
|
-
},
|
|
150
|
-
return this.add(-1 * t,
|
|
151
|
-
},
|
|
152
|
-
var
|
|
153
|
-
if (!this.isValid()) return e.invalidDate ||
|
|
154
|
-
var i = t || "YYYY-MM-DDTHH:mm:ssZ", a =
|
|
155
|
-
return
|
|
156
|
-
},
|
|
157
|
-
return
|
|
158
|
-
},
|
|
159
|
-
var Q =
|
|
160
|
-
return
|
|
144
|
+
if (a === m) return this.set(m, this.$y + t);
|
|
145
|
+
if (a === w) return y(1);
|
|
146
|
+
if (a === g) return y(7);
|
|
147
|
+
var Y = (e = {}, e[S] = o, e[x] = v, e[D] = u, e)[a] || 1, _ = this.$d.getTime() + t * Y;
|
|
148
|
+
return h.w(_, this);
|
|
149
|
+
}, n.subtract = function(t, r) {
|
|
150
|
+
return this.add(-1 * t, r);
|
|
151
|
+
}, n.format = function(t) {
|
|
152
|
+
var r = this, e = this.$locale();
|
|
153
|
+
if (!this.isValid()) return e.invalidDate || b;
|
|
154
|
+
var i = t || "YYYY-MM-DDTHH:mm:ssZ", a = h.z(this), y = this.$H, Y = this.$m, _ = this.$M, O = e.weekdays, C = e.months, F = e.meridiem, R = function(k, I, A, Q) {
|
|
155
|
+
return k && (k[I] || k(r, i)) || A[I].slice(0, Q);
|
|
156
|
+
}, X = function(k) {
|
|
157
|
+
return h.s(y % 12 || 12, k, "0");
|
|
158
|
+
}, W = F || function(k, I, A) {
|
|
159
|
+
var Q = k < 12 ? "AM" : "PM";
|
|
160
|
+
return A ? Q.toLowerCase() : Q;
|
|
161
161
|
};
|
|
162
|
-
return i.replace(
|
|
163
|
-
return
|
|
164
|
-
switch (
|
|
162
|
+
return i.replace(U, (function(k, I) {
|
|
163
|
+
return I || (function(A) {
|
|
164
|
+
switch (A) {
|
|
165
165
|
case "YY":
|
|
166
|
-
return String(
|
|
166
|
+
return String(r.$y).slice(-2);
|
|
167
167
|
case "YYYY":
|
|
168
|
-
return
|
|
168
|
+
return h.s(r.$y, 4, "0");
|
|
169
169
|
case "M":
|
|
170
|
-
return
|
|
170
|
+
return _ + 1;
|
|
171
171
|
case "MM":
|
|
172
|
-
return
|
|
172
|
+
return h.s(_ + 1, 2, "0");
|
|
173
173
|
case "MMM":
|
|
174
|
-
return
|
|
174
|
+
return R(e.monthsShort, _, C, 3);
|
|
175
175
|
case "MMMM":
|
|
176
|
-
return
|
|
176
|
+
return R(C, _);
|
|
177
177
|
case "D":
|
|
178
|
-
return
|
|
178
|
+
return r.$D;
|
|
179
179
|
case "DD":
|
|
180
|
-
return
|
|
180
|
+
return h.s(r.$D, 2, "0");
|
|
181
181
|
case "d":
|
|
182
|
-
return String(
|
|
182
|
+
return String(r.$W);
|
|
183
183
|
case "dd":
|
|
184
|
-
return
|
|
184
|
+
return R(e.weekdaysMin, r.$W, O, 2);
|
|
185
185
|
case "ddd":
|
|
186
|
-
return
|
|
186
|
+
return R(e.weekdaysShort, r.$W, O, 3);
|
|
187
187
|
case "dddd":
|
|
188
|
-
return
|
|
188
|
+
return O[r.$W];
|
|
189
189
|
case "H":
|
|
190
|
-
return String(
|
|
190
|
+
return String(y);
|
|
191
191
|
case "HH":
|
|
192
|
-
return
|
|
192
|
+
return h.s(y, 2, "0");
|
|
193
193
|
case "h":
|
|
194
|
-
return
|
|
194
|
+
return X(1);
|
|
195
195
|
case "hh":
|
|
196
|
-
return
|
|
196
|
+
return X(2);
|
|
197
197
|
case "a":
|
|
198
|
-
return
|
|
198
|
+
return W(y, Y, !0);
|
|
199
199
|
case "A":
|
|
200
|
-
return
|
|
200
|
+
return W(y, Y, !1);
|
|
201
201
|
case "m":
|
|
202
|
-
return String(
|
|
202
|
+
return String(Y);
|
|
203
203
|
case "mm":
|
|
204
|
-
return
|
|
204
|
+
return h.s(Y, 2, "0");
|
|
205
205
|
case "s":
|
|
206
|
-
return String(
|
|
206
|
+
return String(r.$s);
|
|
207
207
|
case "ss":
|
|
208
|
-
return
|
|
208
|
+
return h.s(r.$s, 2, "0");
|
|
209
209
|
case "SSS":
|
|
210
|
-
return
|
|
210
|
+
return h.s(r.$ms, 3, "0");
|
|
211
211
|
case "Z":
|
|
212
212
|
return a;
|
|
213
213
|
}
|
|
214
214
|
return null;
|
|
215
|
-
})(
|
|
215
|
+
})(k) || a.replace(":", "");
|
|
216
216
|
}));
|
|
217
|
-
},
|
|
217
|
+
}, n.utcOffset = function() {
|
|
218
218
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
219
|
-
},
|
|
220
|
-
var i, a = this,
|
|
221
|
-
return
|
|
219
|
+
}, n.diff = function(t, r, e) {
|
|
220
|
+
var i, a = this, y = h.p(r), Y = T(t), _ = (Y.utcOffset() - this.utcOffset()) * o, O = this - Y, C = function() {
|
|
221
|
+
return h.m(a, Y);
|
|
222
222
|
};
|
|
223
|
-
switch (
|
|
224
|
-
case
|
|
225
|
-
i =
|
|
223
|
+
switch (y) {
|
|
224
|
+
case m:
|
|
225
|
+
i = C() / 12;
|
|
226
226
|
break;
|
|
227
227
|
case f:
|
|
228
|
-
i =
|
|
229
|
-
break;
|
|
230
|
-
case Z:
|
|
231
|
-
i = T() / 3;
|
|
228
|
+
i = C();
|
|
232
229
|
break;
|
|
233
230
|
case p:
|
|
234
|
-
i = (
|
|
231
|
+
i = C() / 3;
|
|
232
|
+
break;
|
|
233
|
+
case g:
|
|
234
|
+
i = (O - _) / 6048e5;
|
|
235
235
|
break;
|
|
236
|
-
case
|
|
237
|
-
i = (
|
|
236
|
+
case w:
|
|
237
|
+
i = (O - _) / 864e5;
|
|
238
238
|
break;
|
|
239
|
-
case
|
|
240
|
-
i =
|
|
239
|
+
case x:
|
|
240
|
+
i = O / v;
|
|
241
241
|
break;
|
|
242
242
|
case S:
|
|
243
|
-
i =
|
|
243
|
+
i = O / o;
|
|
244
244
|
break;
|
|
245
|
-
case
|
|
246
|
-
i =
|
|
245
|
+
case D:
|
|
246
|
+
i = O / u;
|
|
247
247
|
break;
|
|
248
248
|
default:
|
|
249
|
-
i =
|
|
249
|
+
i = O;
|
|
250
250
|
}
|
|
251
|
-
return e ? i :
|
|
252
|
-
},
|
|
251
|
+
return e ? i : h.a(i);
|
|
252
|
+
}, n.daysInMonth = function() {
|
|
253
253
|
return this.endOf(f).$D;
|
|
254
|
-
},
|
|
254
|
+
}, n.$locale = function() {
|
|
255
255
|
return j[this.$L];
|
|
256
|
-
},
|
|
256
|
+
}, n.locale = function(t, r) {
|
|
257
257
|
if (!t) return this.$L;
|
|
258
|
-
var e = this.clone(), i =
|
|
258
|
+
var e = this.clone(), i = J(t, r, !0);
|
|
259
259
|
return i && (e.$L = i), e;
|
|
260
|
-
},
|
|
261
|
-
return
|
|
262
|
-
},
|
|
260
|
+
}, n.clone = function() {
|
|
261
|
+
return h.w(this.$d, this);
|
|
262
|
+
}, n.toDate = function() {
|
|
263
263
|
return new Date(this.valueOf());
|
|
264
|
-
},
|
|
264
|
+
}, n.toJSON = function() {
|
|
265
265
|
return this.isValid() ? this.toISOString() : null;
|
|
266
|
-
},
|
|
266
|
+
}, n.toISOString = function() {
|
|
267
267
|
return this.$d.toISOString();
|
|
268
|
-
},
|
|
268
|
+
}, n.toString = function() {
|
|
269
269
|
return this.$d.toUTCString();
|
|
270
270
|
}, s;
|
|
271
|
-
})(),
|
|
272
|
-
return
|
|
273
|
-
|
|
274
|
-
return this.$g(
|
|
271
|
+
})(), at = B.prototype;
|
|
272
|
+
return T.prototype = at, [["$ms", $], ["$s", D], ["$m", S], ["$H", x], ["$W", w], ["$M", f], ["$y", m], ["$D", M]].forEach((function(s) {
|
|
273
|
+
at[s[1]] = function(n) {
|
|
274
|
+
return this.$g(n, s[0], s[1]);
|
|
275
275
|
};
|
|
276
|
-
})),
|
|
277
|
-
return s.$i || (s(
|
|
278
|
-
},
|
|
279
|
-
return
|
|
280
|
-
},
|
|
276
|
+
})), T.extend = function(s, n) {
|
|
277
|
+
return s.$i || (s(n, B, T), s.$i = !0), T;
|
|
278
|
+
}, T.locale = J, T.isDayjs = nt, T.unix = function(s) {
|
|
279
|
+
return T(1e3 * s);
|
|
280
|
+
}, T.en = j[N], T.Ls = j, T.p = {}, T;
|
|
281
281
|
}));
|
|
282
|
-
})(
|
|
282
|
+
})(K)), K.exports;
|
|
283
283
|
}
|
|
284
|
-
var
|
|
285
|
-
const
|
|
284
|
+
var yt = Mt();
|
|
285
|
+
const z = /* @__PURE__ */ $t(yt), q = 60, gt = [
|
|
286
286
|
"YYYY-MM-DD",
|
|
287
287
|
"YYYY/MM/DD",
|
|
288
288
|
"YYYY-MM-DD HH:mm",
|
|
289
289
|
"YYYY/MM/DD HH:mm",
|
|
290
290
|
"YYYY-MM-DD HH:mm:ss",
|
|
291
291
|
"YYYY/MM/DD HH:mm:ss"
|
|
292
|
-
],
|
|
293
|
-
if (!
|
|
292
|
+
], ut = (d) => {
|
|
293
|
+
if (!it(d))
|
|
294
294
|
return "00:00:00";
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
295
|
+
const c = z(d).diff(z());
|
|
296
|
+
if (c <= 0)
|
|
297
297
|
return "00:00:00";
|
|
298
|
-
const
|
|
299
|
-
return `${
|
|
300
|
-
},
|
|
301
|
-
const
|
|
302
|
-
return `${
|
|
303
|
-
},
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
|
|
298
|
+
const u = Math.floor(c / 1e3), o = Math.floor(u / 86400), v = Math.floor(u % 86400 / 3600), $ = Math.floor(u % 3600 / 60), D = u % 60;
|
|
299
|
+
return `${o ? `${o}:` : ""}${`${v}`.padStart(2, "0")}:${`${$}`.padStart(2, "0")}:${`${D}`.padStart(2, "0")}`;
|
|
300
|
+
}, lt = (d) => {
|
|
301
|
+
const c = (u) => `${u}`.padStart(2, "0");
|
|
302
|
+
return `${c(Math.floor(d / q / q))}:${c(Math.floor(d / q) % q)}:${c(d % q)}`;
|
|
303
|
+
}, it = (d) => gt.some((c) => z(d, c, !0).isValid()), G = (d, c, u, o, v) => {
|
|
304
|
+
const $ = o - c, D = v - u, S = Math.sqrt($ * $ + D * D).toFixed(2), x = Math.atan2(D, $) * 180 / Math.PI, w = (c + o) / 2, g = (u + v) / 2;
|
|
305
|
+
d.style.left = `${w}px`, d.style.top = `${g}px`, d.style.height = `${S}px`, d.style.transform = `translate(-50%, -50%) rotate(${x + 90}deg)`;
|
|
306
|
+
}, vt = (d) => {
|
|
307
|
+
const c = d.clientWidth, u = d.clientHeight, o = Math.floor(Math.random() * 2);
|
|
308
|
+
let v = "", $ = "", D = 0, S = 0;
|
|
309
|
+
const x = d.querySelector(".l-line"), w = d.querySelector(".r-line");
|
|
310
|
+
if (o === 0) {
|
|
311
|
+
const g = 5 + Math.random() * 90, f = 100 - g;
|
|
312
|
+
D = Math.max(g, f), v = `
|
|
313
|
+
polygon(
|
|
314
|
+
0% 0%,
|
|
315
|
+
${g}% 0%,
|
|
316
|
+
${f}% 100%,
|
|
317
|
+
0% 100%
|
|
318
|
+
)`, $ = `
|
|
319
|
+
polygon(
|
|
320
|
+
${g}% 0%,
|
|
321
|
+
100% 0%,
|
|
322
|
+
100% 100%,
|
|
323
|
+
${f}% 100%
|
|
324
|
+
)`;
|
|
325
|
+
const p = c * g / 100, m = 0, M = c * f / 100, b = u;
|
|
326
|
+
G(x, p, m, M, b), G(w, p, m, M, b);
|
|
327
|
+
} else {
|
|
328
|
+
const g = 5 + Math.random() * 90, f = 100 - g;
|
|
329
|
+
S = Math.max(g, f), v = `
|
|
330
|
+
polygon(
|
|
331
|
+
0% 0%,
|
|
332
|
+
100% 0%,
|
|
333
|
+
100% ${f}%,
|
|
334
|
+
0% ${g}%
|
|
335
|
+
)`, $ = `
|
|
336
|
+
polygon(
|
|
337
|
+
0% ${g}%,
|
|
338
|
+
100% ${f}%,
|
|
339
|
+
100% 100%,
|
|
340
|
+
0% 100%
|
|
341
|
+
)`;
|
|
342
|
+
const p = 0, m = u * g / 100, M = c, b = u * f / 100;
|
|
343
|
+
G(x, p, m, M, b), G(w, p, m, M, b);
|
|
344
|
+
}
|
|
345
|
+
return {
|
|
346
|
+
lPath: v,
|
|
347
|
+
rPath: $,
|
|
348
|
+
lTranslate: o === 0 ? `translateX(-${D}%)` : `translateY(-${S}%)`,
|
|
349
|
+
rTranslate: o === 0 ? `translateX(${D}%)` : `translateY(${S}%)`
|
|
350
|
+
};
|
|
351
|
+
}, dt = "HH:mm:ss", ft = 900, wt = (d) => {
|
|
352
|
+
const { mode: c, showType: u = "default", size: o = 40, className: v, bgColor: $, borderColor: D, textShadowColor: S, finishCountFn: x } = d, [w, g] = ht(
|
|
353
|
+
u === "count" ? lt(0) : u === "default" ? z().format(dt) : ut(u)
|
|
354
|
+
), f = st({
|
|
307
355
|
t: null
|
|
308
|
-
}),
|
|
309
|
-
"--card-size": `${
|
|
310
|
-
"--card-w": `${
|
|
311
|
-
"--card-h": `${
|
|
356
|
+
}), p = {
|
|
357
|
+
"--card-size": `${o}px`,
|
|
358
|
+
"--card-w": `${o * 1.25}px`,
|
|
359
|
+
"--card-h": `${o * 2}px`,
|
|
312
360
|
// 下面两个必须是一个确定的数字,不能是表达式
|
|
313
|
-
"--transx": `${-
|
|
314
|
-
"--transy": `${-
|
|
315
|
-
"--delay": `${
|
|
316
|
-
"--bgColor":
|
|
317
|
-
"--borderColor":
|
|
361
|
+
"--transx": `${-o * 1.25 / 2}px`,
|
|
362
|
+
"--transy": `${-o}px`,
|
|
363
|
+
"--delay": `${ft / 1e3}s`,
|
|
364
|
+
"--bgColor": $,
|
|
365
|
+
"--borderColor": D,
|
|
318
366
|
"--textShadow": S ? `1px 2px 3px ${S}` : "none"
|
|
319
367
|
};
|
|
320
|
-
|
|
368
|
+
tt(() => {
|
|
321
369
|
let M = Date.now();
|
|
322
370
|
f.current.t && (clearInterval(f.current.t), f.current.t = null, M = Date.now()), f.current.t = setInterval(() => {
|
|
323
|
-
let
|
|
324
|
-
|
|
371
|
+
let b = () => "";
|
|
372
|
+
u === "count" ? b = () => lt(Math.floor((Date.now() - M) / 1e3)) : u === "default" ? b = () => z().format(dt) : b = () => ut(u), g(b());
|
|
325
373
|
}, 1e3);
|
|
326
|
-
}, [
|
|
327
|
-
|
|
328
|
-
|
|
374
|
+
}, [u]), tt(() => {
|
|
375
|
+
it(u) && w === "00:00:00" && x && setTimeout(() => {
|
|
376
|
+
x();
|
|
329
377
|
}, 1e3);
|
|
330
|
-
}, [
|
|
331
|
-
const
|
|
332
|
-
if (!
|
|
378
|
+
}, [w, u, x]);
|
|
379
|
+
const m = () => {
|
|
380
|
+
if (!w)
|
|
333
381
|
return null;
|
|
334
|
-
const M =
|
|
335
|
-
return /* @__PURE__ */
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
382
|
+
const M = w.split(":"), b = M[M.length - 3].split(""), V = M[M.length - 2].split(""), U = M[M.length - 1].split(""), et = M.length === 4 ? M[0].split("") : [], H = it(u), Z = et.map((j, E) => /* @__PURE__ */ l(P, { mode: c, time: +j, limit: H ? -9 : 9, size: o }, E)), N = /* @__PURE__ */ l("span", { children: ":" });
|
|
383
|
+
return /* @__PURE__ */ L(rt, { children: [
|
|
384
|
+
Z.length ? /* @__PURE__ */ L(rt, { children: [
|
|
385
|
+
Z,
|
|
386
|
+
H ? /* @__PURE__ */ l("p", { children: "天" }) : N
|
|
339
387
|
] }) : null,
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
|
|
388
|
+
/* @__PURE__ */ l(P, { mode: c, time: +b[0], limit: H ? -2 : 2, size: o }),
|
|
389
|
+
/* @__PURE__ */ l(P, { mode: c, time: +b[1], limit: H ? -9 : 9, size: o }),
|
|
390
|
+
H ? /* @__PURE__ */ l("p", { children: "小时" }) : N,
|
|
391
|
+
/* @__PURE__ */ l(P, { mode: c, time: +V[0], limit: H ? -5 : 5, size: o }),
|
|
392
|
+
/* @__PURE__ */ l(P, { mode: c, time: +V[1], limit: H ? -9 : 9, size: o }),
|
|
393
|
+
H ? /* @__PURE__ */ l("p", { children: "分" }) : N,
|
|
394
|
+
/* @__PURE__ */ l(P, { mode: c, time: +U[0], limit: H ? -5 : 5, size: o }),
|
|
395
|
+
/* @__PURE__ */ l(P, { mode: c, time: +U[1], limit: H ? -9 : 9, size: o }),
|
|
396
|
+
H && /* @__PURE__ */ l("p", { children: "秒" })
|
|
349
397
|
] });
|
|
350
398
|
};
|
|
351
|
-
return /* @__PURE__ */
|
|
352
|
-
},
|
|
353
|
-
const { time:
|
|
354
|
-
t:
|
|
355
|
-
}),
|
|
356
|
-
"--driftX": `${Math.floor(Math.random() * (-
|
|
357
|
-
"--driftY": `${Math.floor(Math.random() * (-
|
|
399
|
+
return /* @__PURE__ */ l("div", { className: `time-runner ${v || ""}`, style: p, children: m() });
|
|
400
|
+
}, Dt = (d) => {
|
|
401
|
+
const { time: c, limit: u, mode: o, size: v } = d, [$, D] = ht(!1), S = st({
|
|
402
|
+
t: c
|
|
403
|
+
}), x = st(null), w = ot(() => c !== S.current.t && o === "drift" ? {
|
|
404
|
+
"--driftX": `${Math.floor(Math.random() * (-v - v + 1)) + v}px`,
|
|
405
|
+
"--driftY": `${Math.floor(Math.random() * (-v * 2 - v * 2 + 1)) + v * 2}px`,
|
|
358
406
|
"--driftRZ": `${Math.floor(Math.random() * 151) + 50}deg`,
|
|
359
407
|
"--driftRX": `${Math.floor(Math.random() * 151) + 50}deg`
|
|
360
|
-
} : null, [
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
408
|
+
} : null, [c, v, o]), g = ot(() => {
|
|
409
|
+
if ($ && o === "cut") {
|
|
410
|
+
const { lPath: p, rPath: m, lTranslate: M, rTranslate: b } = vt(x.current);
|
|
411
|
+
return {
|
|
412
|
+
"--lPolygon": p,
|
|
413
|
+
"--rPolygon": m,
|
|
414
|
+
"--cutLTranslate": M,
|
|
415
|
+
"--cutRTranslate": b
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
return null;
|
|
419
|
+
}, [$, o]);
|
|
420
|
+
return tt(() => {
|
|
421
|
+
c !== S.current.t && D(!0);
|
|
422
|
+
}, [c]), tt(() => {
|
|
423
|
+
$ && setTimeout(() => {
|
|
424
|
+
S.current.t = c, D(!1);
|
|
425
|
+
}, ft);
|
|
426
|
+
}, [$, c]), /* @__PURE__ */ l(rt, { children: (() => {
|
|
368
427
|
const { t: p } = S.current;
|
|
369
|
-
let
|
|
370
|
-
switch (
|
|
428
|
+
let m = p;
|
|
429
|
+
switch (u > 0 ? m = p >= u ? 0 : p + 1 : m = p <= 0 ? Math.abs(u) : p - 1, o) {
|
|
371
430
|
case "card":
|
|
372
|
-
return /* @__PURE__ */
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
/* @__PURE__ */
|
|
375
|
-
/* @__PURE__ */
|
|
431
|
+
return /* @__PURE__ */ L("div", { className: "clock-card font-num", children: [
|
|
432
|
+
/* @__PURE__ */ L("div", { className: `clock-b ${$ ? "run" : ""}`, children: [
|
|
433
|
+
/* @__PURE__ */ l("p", { children: m }),
|
|
434
|
+
/* @__PURE__ */ l("p", { children: m })
|
|
376
435
|
] }),
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ L("div", { className: `clock-f ${$ ? "run" : ""}`, children: [
|
|
437
|
+
/* @__PURE__ */ l("p", { children: p }),
|
|
438
|
+
/* @__PURE__ */ l("p", { children: p })
|
|
380
439
|
] })
|
|
381
440
|
] });
|
|
382
441
|
case "cube-v":
|
|
383
|
-
return /* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
442
|
+
return /* @__PURE__ */ l("div", { className: `cube-v font-num ${$ ? "run" : ""}`, children: /* @__PURE__ */ L("div", { children: [
|
|
443
|
+
/* @__PURE__ */ l("p", { children: m }),
|
|
444
|
+
/* @__PURE__ */ l("p", { children: p })
|
|
386
445
|
] }) });
|
|
387
446
|
case "cube-h":
|
|
388
|
-
return /* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
447
|
+
return /* @__PURE__ */ l("div", { className: `cube-h font-num ${$ ? "run" : ""}`, children: /* @__PURE__ */ L("div", { children: [
|
|
448
|
+
/* @__PURE__ */ l("p", { children: m }),
|
|
449
|
+
/* @__PURE__ */ l("p", { children: p })
|
|
391
450
|
] }) });
|
|
392
451
|
case "drift":
|
|
393
|
-
return /* @__PURE__ */
|
|
452
|
+
return /* @__PURE__ */ l("div", { className: `drift font-num ${$ ? "run" : ""}`, "data-digit": p, style: w, children: m });
|
|
453
|
+
case "cut":
|
|
454
|
+
return /* @__PURE__ */ L("div", { ref: x, className: `cut font-num ${$ ? "run" : ""}`, style: g, children: [
|
|
455
|
+
/* @__PURE__ */ L("div", { children: [
|
|
456
|
+
/* @__PURE__ */ l("p", { children: p }),
|
|
457
|
+
/* @__PURE__ */ l("div", { className: "l-line" })
|
|
458
|
+
] }),
|
|
459
|
+
/* @__PURE__ */ L("div", { children: [
|
|
460
|
+
/* @__PURE__ */ l("p", { children: p }),
|
|
461
|
+
/* @__PURE__ */ l("div", { className: "r-line" })
|
|
462
|
+
] }),
|
|
463
|
+
/* @__PURE__ */ l("p", { children: m })
|
|
464
|
+
] });
|
|
394
465
|
default:
|
|
395
|
-
return /* @__PURE__ */
|
|
466
|
+
return /* @__PURE__ */ l("div", { className: "font-num", children: /* @__PURE__ */ l("p", { children: p }) });
|
|
396
467
|
}
|
|
397
468
|
})() });
|
|
398
|
-
},
|
|
469
|
+
}, P = mt(Dt);
|
|
399
470
|
export {
|
|
400
|
-
|
|
471
|
+
wt as TimeRunner
|
|
401
472
|
};
|