@vavt/react-ui 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Col-CZjR94ac.js → Col-BZdKuXbj.js} +1 -1
- package/dist/{Col-qcq7T83y.cjs → Col-CvoVGKUn.cjs} +1 -1
- package/dist/Cron-B4S_KhO1.cjs +1 -0
- package/dist/{Cron-C3S1XI-J.js → Cron-B8cGD7-3.js} +352 -344
- package/dist/{DatePicker-B5uYQlzy.cjs → DatePicker-DwACFSC7.cjs} +1 -1
- package/dist/{DatePicker-DhRxFPCj.js → DatePicker-w6jWiNfz.js} +1 -1
- package/dist/{DateTimePicker-Bve5qoeh.cjs → DateTimePicker-B5atDTPW.cjs} +1 -1
- package/dist/{DateTimePicker-BjDD15Av.js → DateTimePicker-NP2aVE5R.js} +1 -1
- package/dist/Dropdown-Chx8SZPS.cjs +1 -0
- package/dist/Dropdown-CyVxoFAH.js +330 -0
- package/dist/Form-CyCbST4e.cjs +1 -0
- package/dist/Form-Fe4b1pS1.js +446 -0
- package/dist/{Pagination-DTRhw83o.js → Pagination-BrG1pKYw.js} +1 -1
- package/dist/{Pagination-BRxRbWlU.cjs → Pagination-D3ok8N9k.cjs} +1 -1
- package/dist/Row-BGzLSkCy.js +24 -0
- package/dist/Row-CRQKzpiH.cjs +1 -0
- package/dist/Select-GleCzXQB.js +497 -0
- package/dist/Select-Rx6AHue2.cjs +1 -0
- package/dist/Sidebar-2KVVRUEM.cjs +1 -0
- package/dist/Sidebar-ByLinOVm.js +77 -0
- package/dist/{Table-DdWKhZAZ.js → Table-ClWg25Wn.js} +10 -7
- package/dist/{Table-B1BEfBJC.cjs → Table-Dv2qxs8q.cjs} +1 -1
- package/dist/TimePicker-BCU7D6uD.cjs +1 -0
- package/dist/{TimePicker-77L1Vyxn.js → TimePicker-BVZbkBvJ.js} +89 -81
- package/dist/Tooltip-BbbIT5nt.js +198 -0
- package/dist/Tooltip-z6u7ChKj.cjs +1 -0
- package/dist/base.css +1 -1
- package/dist/cjs/Col.cjs +1 -1
- package/dist/cjs/Cron.cjs +1 -1
- package/dist/cjs/DatePicker.cjs +1 -1
- package/dist/cjs/DateTimePicker.cjs +1 -1
- package/dist/cjs/Dropdown.cjs +1 -1
- package/dist/cjs/Form.cjs +1 -1
- package/dist/cjs/Pagination.cjs +1 -1
- package/dist/cjs/Row.cjs +1 -1
- package/dist/cjs/Select.cjs +1 -1
- package/dist/cjs/Sidebar.cjs +1 -1
- package/dist/cjs/Table.cjs +1 -1
- package/dist/cjs/TimePicker.cjs +1 -1
- package/dist/cjs/Tooltip.cjs +1 -1
- package/dist/cjs/global.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/register.cjs +1 -1
- package/dist/css/Button.css +1 -1
- package/dist/css/Checkbox.css +1 -1
- package/dist/css/Radio.css +1 -1
- package/dist/css/Sidebar.css +1 -1
- package/dist/css/Switch.css +1 -1
- package/dist/date-picker-DVvBQnvF.cjs +1 -0
- package/dist/date-picker-pcnebTrf.js +639 -0
- package/dist/es/Col.mjs +1 -1
- package/dist/es/Cron.mjs +1 -1
- package/dist/es/DatePicker.mjs +1 -1
- package/dist/es/DateTimePicker.mjs +1 -1
- package/dist/es/Dropdown.mjs +1 -1
- package/dist/es/Form.mjs +1 -1
- package/dist/es/Pagination.mjs +1 -1
- package/dist/es/Row.mjs +1 -1
- package/dist/es/Select.mjs +1 -1
- package/dist/es/Sidebar.mjs +1 -1
- package/dist/es/Table.mjs +1 -1
- package/dist/es/TimePicker.mjs +1 -1
- package/dist/es/Tooltip.mjs +1 -1
- package/dist/es/global.mjs +1 -1
- package/dist/es/index.mjs +13 -13
- package/dist/es/register.mjs +1 -1
- package/dist/floating-BpTI3sWS.cjs +1 -0
- package/dist/{floating-CqdcJWk2.js → floating-BqCWEj83.js} +27 -15
- package/dist/index.css +1 -1
- package/dist/{registry-DbMCy1-n.js → registry-Cddoj83d.js} +12 -12
- package/dist/{registry-Chcx2tDO.cjs → registry-DvXvnY8T.cjs} +1 -1
- package/dist/style/Sidebar.cjs +1 -0
- package/dist/style/Sidebar.mjs +1 -0
- package/dist/types/Form/type.d.cts +2 -0
- package/dist/types/Form/type.d.ts +2 -0
- package/dist/types/Select/SelectList.d.cts +20 -0
- package/dist/types/Select/SelectList.d.ts +20 -0
- package/dist/types/_shared/date-calendar.d.cts +20 -0
- package/dist/types/_shared/date-calendar.d.ts +20 -0
- package/dist/types/_shared/floating.d.cts +13 -1
- package/dist/types/_shared/floating.d.ts +13 -1
- package/package.json +1 -1
- package/dist/Cron-CIZ9GKm0.cjs +0 -1
- package/dist/Dropdown-BcT4uaQT.js +0 -319
- package/dist/Dropdown-CPW-aSTx.cjs +0 -1
- package/dist/Form-LuUPwJc2.cjs +0 -1
- package/dist/Form-rXq9r3N-.js +0 -442
- package/dist/Row-BJZtEKxG.cjs +0 -1
- package/dist/Row-DpEse7PJ.js +0 -24
- package/dist/Select-B9umyfKd.cjs +0 -1
- package/dist/Select-DDsgKaDL.js +0 -466
- package/dist/Sidebar-BPXVnP7y.cjs +0 -1
- package/dist/Sidebar-u980T-QB.js +0 -76
- package/dist/TimePicker-CsaiM5CQ.cjs +0 -1
- package/dist/Tooltip-DH3oc4Wa.js +0 -205
- package/dist/Tooltip-DP2yxQpo.cjs +0 -1
- package/dist/date-picker-CIAVlMqv.cjs +0 -1
- package/dist/date-picker-Co0ySn01.js +0 -612
- package/dist/floating-5PRFyI8D.cjs +0 -1
|
@@ -3,19 +3,19 @@ import { n } from "./refs-D5IYOBaf.js";
|
|
|
3
3
|
import { t as r } from "./Transition-DiO4GsP3.js";
|
|
4
4
|
import { t as i } from "./Checkbox-CBMmX-R-.js";
|
|
5
5
|
import { t as a } from "./client-pj_wzx28.js";
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import { a as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { n as
|
|
13
|
-
import { Timer as
|
|
14
|
-
import { forwardRef as y, useCallback as b, useEffect as x, useMemo as S, useRef as C, useState as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { createPortal as
|
|
6
|
+
import { i as o, r as s, t as c } from "./floating-BqCWEj83.js";
|
|
7
|
+
import { t as l } from "./id-CHixuHb7.js";
|
|
8
|
+
import { a as u, r as d, t as f } from "./layer-C1yCY0MO.js";
|
|
9
|
+
import { t as p } from "./Input-BRy5Xuwy.js";
|
|
10
|
+
import { t as m } from "./Tabs-HWLkyrQR.js";
|
|
11
|
+
import { t as h } from "./NumberInput-CB-nKZgs.js";
|
|
12
|
+
import { n as g, t as _ } from "./RadioGroup-DYjQMXdB.js";
|
|
13
|
+
import { Timer as v, X as ee } from "lucide-react";
|
|
14
|
+
import { forwardRef as y, useCallback as b, useEffect as x, useMemo as S, useRef as C, useState as te } from "react";
|
|
15
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
16
|
+
import { createPortal as ne } from "react-dom";
|
|
17
17
|
//#region components/Cron/expression.ts
|
|
18
|
-
var
|
|
18
|
+
var D = {
|
|
19
19
|
JAN: 1,
|
|
20
20
|
FEB: 2,
|
|
21
21
|
MAR: 3,
|
|
@@ -28,7 +28,7 @@ var O = {
|
|
|
28
28
|
OCT: 10,
|
|
29
29
|
NOV: 11,
|
|
30
30
|
DEC: 12
|
|
31
|
-
},
|
|
31
|
+
}, O = {
|
|
32
32
|
unix: {
|
|
33
33
|
second: void 0,
|
|
34
34
|
minute: {
|
|
@@ -54,7 +54,7 @@ var O = {
|
|
|
54
54
|
label: "月",
|
|
55
55
|
min: 1,
|
|
56
56
|
max: 12,
|
|
57
|
-
aliases:
|
|
57
|
+
aliases: D
|
|
58
58
|
},
|
|
59
59
|
dayOfWeek: {
|
|
60
60
|
name: "dayOfWeek",
|
|
@@ -110,7 +110,7 @@ var O = {
|
|
|
110
110
|
label: "月",
|
|
111
111
|
min: 1,
|
|
112
112
|
max: 12,
|
|
113
|
-
aliases:
|
|
113
|
+
aliases: D
|
|
114
114
|
},
|
|
115
115
|
dayOfWeek: {
|
|
116
116
|
name: "dayOfWeek",
|
|
@@ -137,7 +137,7 @@ var O = {
|
|
|
137
137
|
max: 2099
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
},
|
|
140
|
+
}, k = (e, t = !1) => {
|
|
141
141
|
if (e === "unix") return [
|
|
142
142
|
"minute",
|
|
143
143
|
"hour",
|
|
@@ -154,11 +154,11 @@ var O = {
|
|
|
154
154
|
"dayOfWeek"
|
|
155
155
|
];
|
|
156
156
|
return t ? [...n, "year"] : n;
|
|
157
|
-
},
|
|
158
|
-
let n =
|
|
157
|
+
}, A = (e, t) => {
|
|
158
|
+
let n = O[e][t];
|
|
159
159
|
if (!n) throw Error(`${e} 方言不支持 ${t} 字段`);
|
|
160
160
|
return n;
|
|
161
|
-
},
|
|
161
|
+
}, j = (e, t) => `周${[
|
|
162
162
|
"日",
|
|
163
163
|
"一",
|
|
164
164
|
"二",
|
|
@@ -166,34 +166,34 @@ var O = {
|
|
|
166
166
|
"四",
|
|
167
167
|
"五",
|
|
168
168
|
"六"
|
|
169
|
-
][(e - t.min + 7) % 7] ?? e}`,
|
|
169
|
+
][(e - t.min + 7) % 7] ?? e}`, M = (e) => `${e} 月`, N = class extends Error {
|
|
170
170
|
field;
|
|
171
171
|
constructor(e, t) {
|
|
172
172
|
super(t), this.name = "CronFieldError", this.field = e;
|
|
173
173
|
}
|
|
174
|
-
},
|
|
174
|
+
}, P = (e, t) => {
|
|
175
175
|
let n = e.toUpperCase(), r = t.aliases?.[n];
|
|
176
176
|
if (r !== void 0) return r;
|
|
177
|
-
if (!/^\d+$/.test(e)) throw new
|
|
177
|
+
if (!/^\d+$/.test(e)) throw new N(t.name, `${t.label}字段包含无法识别的值「${e}」`);
|
|
178
178
|
let i = Number(e);
|
|
179
179
|
if (t.wrap && i === t.wrap.from) return t.wrap.to;
|
|
180
|
-
if (i < t.min || i > t.max) throw new
|
|
180
|
+
if (i < t.min || i > t.max) throw new N(t.name, `${t.label}字段的「${e}」超出 ${t.min}-${t.max} 范围`);
|
|
181
181
|
return i;
|
|
182
|
-
},
|
|
182
|
+
}, F = (e, t, n) => {
|
|
183
183
|
let r = [];
|
|
184
184
|
for (let i = e; i <= t; i += n) r.push(i);
|
|
185
185
|
return r;
|
|
186
|
-
},
|
|
186
|
+
}, re = (e, t, n) => {
|
|
187
187
|
let [r, i, ...a] = e.split("/");
|
|
188
|
-
if (a.length) throw new
|
|
188
|
+
if (a.length) throw new N(t.name, `${t.label}字段的「${e}」包含多个 / 步长`);
|
|
189
189
|
let o = null;
|
|
190
190
|
if (i !== void 0) {
|
|
191
|
-
if (!/^\d+$/.test(i) || Number(i) < 1) throw new
|
|
191
|
+
if (!/^\d+$/.test(i) || Number(i) < 1) throw new N(t.name, `${t.label}字段的步长「${i || "空"}」必须是正整数`);
|
|
192
192
|
o = Number(i);
|
|
193
193
|
}
|
|
194
194
|
if (o === null && t.allowLast && /^L(-\d+)?$/i.test(r)) {
|
|
195
195
|
let e = r.includes("-") ? Number(r.slice(2)) : 0;
|
|
196
|
-
if (e > t.max) throw new
|
|
196
|
+
if (e > t.max) throw new N(t.name, `${t.label}字段的「${r}」偏移超出范围`);
|
|
197
197
|
n.rules.push({
|
|
198
198
|
type: "lastDayOfMonth",
|
|
199
199
|
offset: e
|
|
@@ -205,7 +205,7 @@ var O = {
|
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
207
|
if (o === null && t.allowWeekday && /^\d+W$/i.test(r)) {
|
|
208
|
-
let e =
|
|
208
|
+
let e = P(r.slice(0, -1), t);
|
|
209
209
|
n.rules.push({
|
|
210
210
|
type: "nearestWeekday",
|
|
211
211
|
day: e
|
|
@@ -215,54 +215,54 @@ var O = {
|
|
|
215
215
|
if (o === null && t.allowLast && t.allowNth && /^([A-Za-z]+|\d+)L$/i.test(r)) {
|
|
216
216
|
n.rules.push({
|
|
217
217
|
type: "lastDayOfWeek",
|
|
218
|
-
dayOfWeek:
|
|
218
|
+
dayOfWeek: P(r.slice(0, -1), t)
|
|
219
219
|
});
|
|
220
220
|
return;
|
|
221
221
|
}
|
|
222
222
|
if (o === null && t.allowNth && r.includes("#")) {
|
|
223
223
|
let [e, i, ...a] = r.split("#");
|
|
224
|
-
if (a.length || i === void 0) throw new
|
|
225
|
-
if (!/^[1-5]$/.test(i)) throw new
|
|
224
|
+
if (a.length || i === void 0) throw new N(t.name, `${t.label}字段的「${r}」不是合法的 周#序号 写法`);
|
|
225
|
+
if (!/^[1-5]$/.test(i)) throw new N(t.name, `${t.label}字段的序号必须是 1-5`);
|
|
226
226
|
n.rules.push({
|
|
227
227
|
type: "nthDayOfWeek",
|
|
228
|
-
dayOfWeek:
|
|
228
|
+
dayOfWeek: P(e, t),
|
|
229
229
|
nth: Number(i)
|
|
230
230
|
});
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
233
|
if (r === "*") {
|
|
234
|
-
o === null ? n.wildcard = !0 : n.values.push(...
|
|
234
|
+
o === null ? n.wildcard = !0 : n.values.push(...F(t.min, t.max, o));
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
if (r.includes("-")) {
|
|
238
238
|
let [e, i, ...a] = r.split("-");
|
|
239
|
-
if (a.length || e === void 0 || i === void 0) throw new
|
|
240
|
-
let s =
|
|
241
|
-
if (s > c) throw new
|
|
242
|
-
n.values.push(...
|
|
239
|
+
if (a.length || e === void 0 || i === void 0) throw new N(t.name, `${t.label}字段的「${r}」不是合法区间`);
|
|
240
|
+
let s = P(e, t), c = P(i, t);
|
|
241
|
+
if (s > c) throw new N(t.name, `${t.label}字段区间「${r}」的起点大于终点`);
|
|
242
|
+
n.values.push(...F(s, c, o ?? 1));
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
245
|
-
let s =
|
|
246
|
-
o === null ? n.values.push(s) : n.values.push(...
|
|
247
|
-
},
|
|
245
|
+
let s = P(r, t);
|
|
246
|
+
o === null ? n.values.push(s) : n.values.push(...F(s, t.max, o));
|
|
247
|
+
}, ie = (e, t) => {
|
|
248
248
|
let n = {
|
|
249
249
|
values: [],
|
|
250
250
|
rules: [],
|
|
251
251
|
wildcard: !1,
|
|
252
252
|
unspecified: !1
|
|
253
253
|
}, r = e.trim();
|
|
254
|
-
if (!r) throw new
|
|
254
|
+
if (!r) throw new N(t.name, `${t.label}字段不能为空`);
|
|
255
255
|
if (r === "?") {
|
|
256
|
-
if (!t.allowUnspecified) throw new
|
|
256
|
+
if (!t.allowUnspecified) throw new N(t.name, `${t.label}字段不支持 ? 写法`);
|
|
257
257
|
return n.unspecified = !0, n;
|
|
258
258
|
}
|
|
259
259
|
for (let e of r.split(",")) {
|
|
260
|
-
if (!e) throw new
|
|
261
|
-
|
|
260
|
+
if (!e) throw new N(t.name, `${t.label}字段包含空的枚举项`);
|
|
261
|
+
re(e, t, n);
|
|
262
262
|
}
|
|
263
|
-
if (n.values = [...new Set(n.values)].sort((e, t) => e - t), !n.wildcard && !n.values.length && !n.rules.length) throw new
|
|
263
|
+
if (n.values = [...new Set(n.values)].sort((e, t) => e - t), !n.wildcard && !n.values.length && !n.rules.length) throw new N(t.name, `${t.label}字段没有任何可命中的值`);
|
|
264
264
|
return n;
|
|
265
|
-
},
|
|
265
|
+
}, ae = [
|
|
266
266
|
"year",
|
|
267
267
|
"month",
|
|
268
268
|
"dayOfMonth",
|
|
@@ -270,7 +270,7 @@ var O = {
|
|
|
270
270
|
"hour",
|
|
271
271
|
"minute",
|
|
272
272
|
"second"
|
|
273
|
-
],
|
|
273
|
+
], oe = (e, t) => O[e][t] ?? A("quartz", t), se = () => ({
|
|
274
274
|
second: "0",
|
|
275
275
|
minute: "*",
|
|
276
276
|
hour: "*",
|
|
@@ -278,7 +278,7 @@ var O = {
|
|
|
278
278
|
month: "*",
|
|
279
279
|
dayOfWeek: "*",
|
|
280
280
|
year: "*"
|
|
281
|
-
}),
|
|
281
|
+
}), I = (e) => !e.wildcard && !e.unspecified, ce = (e, t) => {
|
|
282
282
|
let n = e.trim().split(/\s+/).filter(Boolean);
|
|
283
283
|
if (!n.length) return {
|
|
284
284
|
ok: !1,
|
|
@@ -289,15 +289,15 @@ var O = {
|
|
|
289
289
|
ok: !1,
|
|
290
290
|
message: `${t === "unix" ? "Unix" : "Quartz"} 表达式应为 ${r.join(" 或 ")} 段,当前 ${n.length} 段`
|
|
291
291
|
};
|
|
292
|
-
let i = n.length === 7, a =
|
|
293
|
-
|
|
292
|
+
let i = n.length === 7, a = se();
|
|
293
|
+
k(t, i).forEach((e, t) => {
|
|
294
294
|
a[e] = n[t];
|
|
295
295
|
});
|
|
296
296
|
let o = {};
|
|
297
297
|
try {
|
|
298
|
-
for (let e of
|
|
298
|
+
for (let e of ae) o[e] = ie(a[e], oe(t, e));
|
|
299
299
|
} catch (e) {
|
|
300
|
-
if (e instanceof
|
|
300
|
+
if (e instanceof N) return {
|
|
301
301
|
ok: !1,
|
|
302
302
|
message: e.message,
|
|
303
303
|
field: e.field
|
|
@@ -309,7 +309,7 @@ var O = {
|
|
|
309
309
|
ok: !1,
|
|
310
310
|
message: "日和周不能同时为 ?,至少要指定一个",
|
|
311
311
|
field: "dayOfMonth"
|
|
312
|
-
} : t === "quartz" &&
|
|
312
|
+
} : t === "quartz" && I(s) && I(c) ? {
|
|
313
313
|
ok: !1,
|
|
314
314
|
message: "Quartz 不支持同时限定日和周,请把其中一个设为 ?",
|
|
315
315
|
field: "dayOfWeek"
|
|
@@ -322,10 +322,10 @@ var O = {
|
|
|
322
322
|
matches: o
|
|
323
323
|
}
|
|
324
324
|
};
|
|
325
|
-
},
|
|
326
|
-
...
|
|
325
|
+
}, L = (e, t, n = !1) => k(t, n).map((t) => e[t]).join(" "), le = (e, t = !1) => L({
|
|
326
|
+
...se(),
|
|
327
327
|
dayOfWeek: e === "quartz" ? "?" : "*"
|
|
328
|
-
}, e, t),
|
|
328
|
+
}, e, t), R = /^([A-Za-z]+|\d+)$/, z = (e, t) => {
|
|
329
329
|
let n = e.trim();
|
|
330
330
|
try {
|
|
331
331
|
if (n === "*") return { kind: "every" };
|
|
@@ -353,18 +353,18 @@ var O = {
|
|
|
353
353
|
kind: "last",
|
|
354
354
|
offset: 0,
|
|
355
355
|
weekday: !1,
|
|
356
|
-
dayOfWeek:
|
|
356
|
+
dayOfWeek: P(n.slice(0, -1), t)
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
359
|
if (t.allowWeekday && /^\d+W$/i.test(n)) return {
|
|
360
360
|
kind: "weekday",
|
|
361
|
-
day:
|
|
361
|
+
day: P(n.slice(0, -1), t)
|
|
362
362
|
};
|
|
363
363
|
if (t.allowNth && /^([A-Za-z]+|\d+)#[1-5]$/i.test(n)) {
|
|
364
364
|
let [e, r] = n.split("#");
|
|
365
365
|
return {
|
|
366
366
|
kind: "nth",
|
|
367
|
-
dayOfWeek:
|
|
367
|
+
dayOfWeek: P(e, t),
|
|
368
368
|
nth: Number(r)
|
|
369
369
|
};
|
|
370
370
|
}
|
|
@@ -377,32 +377,32 @@ var O = {
|
|
|
377
377
|
step: Number(r)
|
|
378
378
|
};
|
|
379
379
|
let [n, i, ...a] = e.split("-");
|
|
380
|
-
if (!a.length &&
|
|
380
|
+
if (!a.length && R.test(n ?? "")) {
|
|
381
381
|
if (i === void 0) return {
|
|
382
382
|
kind: "step",
|
|
383
|
-
from:
|
|
383
|
+
from: P(n, t),
|
|
384
384
|
to: null,
|
|
385
385
|
step: Number(r)
|
|
386
386
|
};
|
|
387
|
-
if (
|
|
387
|
+
if (R.test(i)) return {
|
|
388
388
|
kind: "step",
|
|
389
|
-
from:
|
|
390
|
-
to:
|
|
389
|
+
from: P(n, t),
|
|
390
|
+
to: P(i, t),
|
|
391
391
|
step: Number(r)
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
if (r === void 0) {
|
|
396
396
|
let [e, r, ...i] = n.split("-");
|
|
397
|
-
if (!i.length && r !== void 0 &&
|
|
397
|
+
if (!i.length && r !== void 0 && R.test(e ?? "") && R.test(r)) return {
|
|
398
398
|
kind: "range",
|
|
399
|
-
from:
|
|
400
|
-
to:
|
|
399
|
+
from: P(e, t),
|
|
400
|
+
to: P(r, t)
|
|
401
401
|
};
|
|
402
402
|
let a = n.split(",");
|
|
403
|
-
if (a.every((e) =>
|
|
403
|
+
if (a.every((e) => R.test(e))) return {
|
|
404
404
|
kind: "list",
|
|
405
|
-
values: [...new Set(a.map((e) =>
|
|
405
|
+
values: [...new Set(a.map((e) => P(e, t)))].sort((e, t) => e - t)
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
408
|
} catch {}
|
|
@@ -410,7 +410,7 @@ var O = {
|
|
|
410
410
|
kind: "custom",
|
|
411
411
|
text: n
|
|
412
412
|
};
|
|
413
|
-
},
|
|
413
|
+
}, ue = (e, t) => {
|
|
414
414
|
switch (e.kind) {
|
|
415
415
|
case "every": return "*";
|
|
416
416
|
case "unspecified": return "?";
|
|
@@ -422,7 +422,7 @@ var O = {
|
|
|
422
422
|
case "nth": return `${e.dayOfWeek}#${e.nth}`;
|
|
423
423
|
case "custom": return e.text;
|
|
424
424
|
}
|
|
425
|
-
},
|
|
425
|
+
}, de = {
|
|
426
426
|
every: "每一个",
|
|
427
427
|
unspecified: "不指定",
|
|
428
428
|
range: "区间",
|
|
@@ -432,10 +432,10 @@ var O = {
|
|
|
432
432
|
weekday: "工作日",
|
|
433
433
|
nth: "第 N 个",
|
|
434
434
|
custom: "自定义"
|
|
435
|
-
},
|
|
435
|
+
}, fe = (e, t) => {
|
|
436
436
|
let n = ["every"];
|
|
437
437
|
return e.allowUnspecified && n.push("unspecified"), n.push("range", "step", "list"), e.allowLast && n.push("last"), e.allowWeekday && n.push("weekday"), e.allowNth && n.push("nth"), t.kind === "custom" && n.push("custom"), n;
|
|
438
|
-
},
|
|
438
|
+
}, pe = (e, t) => t.name === "dayOfWeek" ? j(e, t) : t.name === "month" ? M(e) : String(e), me = (e, t, n) => {
|
|
439
439
|
let r = n.kind === "list" ? n.values[0] ?? t.min : n.kind === "range" || n.kind === "step" ? n.from ?? t.min : n.kind === "weekday" ? n.day : n.kind === "nth" ? n.dayOfWeek : t.min;
|
|
440
440
|
switch (e) {
|
|
441
441
|
case "every": return { kind: "every" };
|
|
@@ -475,10 +475,10 @@ var O = {
|
|
|
475
475
|
text: ""
|
|
476
476
|
};
|
|
477
477
|
}
|
|
478
|
-
},
|
|
479
|
-
let a = S(() =>
|
|
478
|
+
}, he = ({ spec: e, value: t, disabled: n = !1, onChange: r }) => {
|
|
479
|
+
let a = S(() => fe(e, t), [e, t]), o = S(() => Array.from({ length: e.max - e.min + 1 }, (t, n) => e.min + n), [e.max, e.min]), s = "vl-cron-field", c = (t, r, i) => {
|
|
480
480
|
let a = i.min ?? e.min;
|
|
481
|
-
return /* @__PURE__ */
|
|
481
|
+
return /* @__PURE__ */ T(h, {
|
|
482
482
|
className: `${s}__number`,
|
|
483
483
|
value: t,
|
|
484
484
|
min: a,
|
|
@@ -489,13 +489,13 @@ var O = {
|
|
|
489
489
|
"aria-label": i.label,
|
|
490
490
|
onChange: (e) => r(e ?? a)
|
|
491
491
|
});
|
|
492
|
-
}, l = (t) => /* @__PURE__ */
|
|
492
|
+
}, l = (t) => /* @__PURE__ */ T("div", {
|
|
493
493
|
className: `${s}__grid`,
|
|
494
494
|
role: "group",
|
|
495
495
|
"aria-label": `选择${e.label}`,
|
|
496
496
|
children: o.map((i) => {
|
|
497
497
|
let a = t.includes(i);
|
|
498
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ T("button", {
|
|
499
499
|
type: "button",
|
|
500
500
|
className: `${s}__cell${a ? " is-active" : ""}`,
|
|
501
501
|
"aria-pressed": a,
|
|
@@ -507,31 +507,31 @@ var O = {
|
|
|
507
507
|
values: e.length ? e.sort((e, t) => e - t) : [i]
|
|
508
508
|
});
|
|
509
509
|
},
|
|
510
|
-
children:
|
|
510
|
+
children: pe(i, e)
|
|
511
511
|
}, i);
|
|
512
512
|
})
|
|
513
513
|
});
|
|
514
|
-
return /* @__PURE__ */
|
|
514
|
+
return /* @__PURE__ */ E("div", {
|
|
515
515
|
className: s,
|
|
516
|
-
children: [/* @__PURE__ */
|
|
516
|
+
children: [/* @__PURE__ */ T(_, {
|
|
517
517
|
className: `${s}__kinds`,
|
|
518
518
|
value: t.kind,
|
|
519
519
|
size: "sm",
|
|
520
520
|
disabled: n,
|
|
521
|
-
onChange: (n) => r(
|
|
522
|
-
children: a.map((e) => /* @__PURE__ */
|
|
521
|
+
onChange: (n) => r(me(n, e, t)),
|
|
522
|
+
children: a.map((e) => /* @__PURE__ */ T(g, {
|
|
523
523
|
value: e,
|
|
524
|
-
label:
|
|
524
|
+
label: de[e]
|
|
525
525
|
}, e))
|
|
526
|
-
}), /* @__PURE__ */
|
|
526
|
+
}), /* @__PURE__ */ T("div", {
|
|
527
527
|
className: `${s}__params`,
|
|
528
528
|
children: (() => {
|
|
529
529
|
switch (t.kind) {
|
|
530
|
-
case "every": return /* @__PURE__ */
|
|
530
|
+
case "every": return /* @__PURE__ */ E("p", {
|
|
531
531
|
className: `${s}__hint`,
|
|
532
532
|
children: [e.label, "的每一个值都会触发"]
|
|
533
533
|
});
|
|
534
|
-
case "unspecified": return /* @__PURE__ */
|
|
534
|
+
case "unspecified": return /* @__PURE__ */ E("p", {
|
|
535
535
|
className: `${s}__hint`,
|
|
536
536
|
children: [
|
|
537
537
|
"不限定",
|
|
@@ -539,10 +539,10 @@ var O = {
|
|
|
539
539
|
",由另一侧的日期字段决定"
|
|
540
540
|
]
|
|
541
541
|
});
|
|
542
|
-
case "range": return /* @__PURE__ */
|
|
542
|
+
case "range": return /* @__PURE__ */ E("div", {
|
|
543
543
|
className: `${s}__row`,
|
|
544
544
|
children: [
|
|
545
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ T("span", {
|
|
546
546
|
className: `${s}__text`,
|
|
547
547
|
children: "从"
|
|
548
548
|
}),
|
|
@@ -551,7 +551,7 @@ var O = {
|
|
|
551
551
|
from: e,
|
|
552
552
|
to: Math.max(e, t.to)
|
|
553
553
|
}), { label: `${e.label}区间起点` }),
|
|
554
|
-
/* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ T("span", {
|
|
555
555
|
className: `${s}__text`,
|
|
556
556
|
children: "到"
|
|
557
557
|
}),
|
|
@@ -567,10 +567,10 @@ var O = {
|
|
|
567
567
|
});
|
|
568
568
|
case "step": {
|
|
569
569
|
let n = t.from ?? e.min;
|
|
570
|
-
return /* @__PURE__ */
|
|
570
|
+
return /* @__PURE__ */ E("div", {
|
|
571
571
|
className: `${s}__row`,
|
|
572
572
|
children: [
|
|
573
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ T("span", {
|
|
574
574
|
className: `${s}__text`,
|
|
575
575
|
children: "从"
|
|
576
576
|
}),
|
|
@@ -581,7 +581,7 @@ var O = {
|
|
|
581
581
|
max: t.to ?? e.max,
|
|
582
582
|
label: `${e.label}间隔起点`
|
|
583
583
|
}),
|
|
584
|
-
t.to === null ? null : /* @__PURE__ */
|
|
584
|
+
t.to === null ? null : /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("span", {
|
|
585
585
|
className: `${s}__text`,
|
|
586
586
|
children: "到"
|
|
587
587
|
}), c(t.to, (e) => r({
|
|
@@ -592,7 +592,7 @@ var O = {
|
|
|
592
592
|
min: n,
|
|
593
593
|
label: `${e.label}间隔终点`
|
|
594
594
|
})] }),
|
|
595
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ T("span", {
|
|
596
596
|
className: `${s}__text`,
|
|
597
597
|
children: ",每"
|
|
598
598
|
}),
|
|
@@ -604,7 +604,7 @@ var O = {
|
|
|
604
604
|
max: e.max - e.min + 1,
|
|
605
605
|
label: `${e.label}间隔步长`
|
|
606
606
|
}),
|
|
607
|
-
/* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ E("span", {
|
|
608
608
|
className: `${s}__text`,
|
|
609
609
|
children: [e.label, "执行一次"]
|
|
610
610
|
})
|
|
@@ -612,10 +612,10 @@ var O = {
|
|
|
612
612
|
});
|
|
613
613
|
}
|
|
614
614
|
case "list": return l(t.values);
|
|
615
|
-
case "last": return e.allowNth ? /* @__PURE__ */
|
|
615
|
+
case "last": return e.allowNth ? /* @__PURE__ */ E("div", {
|
|
616
616
|
className: `${s}__row`,
|
|
617
617
|
children: [
|
|
618
|
-
/* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ T("span", {
|
|
619
619
|
className: `${s}__text`,
|
|
620
620
|
children: "本月最后一个"
|
|
621
621
|
}),
|
|
@@ -623,21 +623,21 @@ var O = {
|
|
|
623
623
|
...t,
|
|
624
624
|
dayOfWeek: e
|
|
625
625
|
}), { label: "星期" }),
|
|
626
|
-
/* @__PURE__ */
|
|
626
|
+
/* @__PURE__ */ E("span", {
|
|
627
627
|
className: `${s}__text`,
|
|
628
628
|
children: [
|
|
629
629
|
"(",
|
|
630
|
-
|
|
630
|
+
j(t.dayOfWeek ?? e.min, e),
|
|
631
631
|
")"
|
|
632
632
|
]
|
|
633
633
|
})
|
|
634
634
|
]
|
|
635
|
-
}) : /* @__PURE__ */
|
|
635
|
+
}) : /* @__PURE__ */ E("div", {
|
|
636
636
|
className: `${s}__stack`,
|
|
637
|
-
children: [/* @__PURE__ */
|
|
637
|
+
children: [/* @__PURE__ */ E("div", {
|
|
638
638
|
className: `${s}__row`,
|
|
639
639
|
children: [
|
|
640
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ T("span", {
|
|
641
641
|
className: `${s}__text`,
|
|
642
642
|
children: "本月最后一天往前"
|
|
643
643
|
}),
|
|
@@ -650,12 +650,12 @@ var O = {
|
|
|
650
650
|
max: 30,
|
|
651
651
|
label: "偏移天数"
|
|
652
652
|
}),
|
|
653
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ T("span", {
|
|
654
654
|
className: `${s}__text`,
|
|
655
655
|
children: "天"
|
|
656
656
|
})
|
|
657
657
|
]
|
|
658
|
-
}), /* @__PURE__ */
|
|
658
|
+
}), /* @__PURE__ */ T(i, {
|
|
659
659
|
checked: t.weekday,
|
|
660
660
|
disabled: n,
|
|
661
661
|
size: "sm",
|
|
@@ -667,10 +667,10 @@ var O = {
|
|
|
667
667
|
})
|
|
668
668
|
})]
|
|
669
669
|
});
|
|
670
|
-
case "weekday": return /* @__PURE__ */
|
|
670
|
+
case "weekday": return /* @__PURE__ */ E("div", {
|
|
671
671
|
className: `${s}__row`,
|
|
672
672
|
children: [
|
|
673
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ T("span", {
|
|
674
674
|
className: `${s}__text`,
|
|
675
675
|
children: "离"
|
|
676
676
|
}),
|
|
@@ -678,16 +678,16 @@ var O = {
|
|
|
678
678
|
...t,
|
|
679
679
|
day: e
|
|
680
680
|
}), { label: "日期" }),
|
|
681
|
-
/* @__PURE__ */
|
|
681
|
+
/* @__PURE__ */ T("span", {
|
|
682
682
|
className: `${s}__text`,
|
|
683
683
|
children: "号最近的工作日"
|
|
684
684
|
})
|
|
685
685
|
]
|
|
686
686
|
});
|
|
687
|
-
case "nth": return /* @__PURE__ */
|
|
687
|
+
case "nth": return /* @__PURE__ */ E("div", {
|
|
688
688
|
className: `${s}__row`,
|
|
689
689
|
children: [
|
|
690
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ T("span", {
|
|
691
691
|
className: `${s}__text`,
|
|
692
692
|
children: "本月第"
|
|
693
693
|
}),
|
|
@@ -699,7 +699,7 @@ var O = {
|
|
|
699
699
|
max: 5,
|
|
700
700
|
label: "第几个"
|
|
701
701
|
}),
|
|
702
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ T("span", {
|
|
703
703
|
className: `${s}__text`,
|
|
704
704
|
children: "个"
|
|
705
705
|
}),
|
|
@@ -707,17 +707,17 @@ var O = {
|
|
|
707
707
|
...t,
|
|
708
708
|
dayOfWeek: e
|
|
709
709
|
}), { label: "星期" }),
|
|
710
|
-
/* @__PURE__ */
|
|
710
|
+
/* @__PURE__ */ E("span", {
|
|
711
711
|
className: `${s}__text`,
|
|
712
712
|
children: [
|
|
713
713
|
"(",
|
|
714
|
-
|
|
714
|
+
j(t.dayOfWeek, e),
|
|
715
715
|
")"
|
|
716
716
|
]
|
|
717
717
|
})
|
|
718
718
|
]
|
|
719
719
|
});
|
|
720
|
-
case "custom": return /* @__PURE__ */
|
|
720
|
+
case "custom": return /* @__PURE__ */ E("p", {
|
|
721
721
|
className: `${s}__hint`,
|
|
722
722
|
children: [
|
|
723
723
|
"当前写法为 ",
|
|
@@ -729,132 +729,132 @@ var O = {
|
|
|
729
729
|
})()
|
|
730
730
|
})]
|
|
731
731
|
});
|
|
732
|
-
},
|
|
732
|
+
}, B = (e) => String(e).padStart(2, "0"), V = (e, t) => e.map(t).join("、"), H = /[\u3000-\u303f\u4e00-\u9fff\uff00-\uffef]/, U = (e) => e.filter(Boolean).reduce((e, t) => e ? H.test(e.at(-1)) && H.test(t[0]) ? e + t : `${e} ${t}` : t, ""), W = (e) => e.kind === "list" && e.values.length === 1 ? e.values[0] : null, G = (e) => e.kind === "every" || e.kind === "step", K = (e, t, n) => {
|
|
733
733
|
let { unit: r, everyText: i, stepUnit: a } = n, o = n.format ?? String;
|
|
734
734
|
switch (e.kind) {
|
|
735
735
|
case "every": return i;
|
|
736
736
|
case "range": return `${o(e.from)} 到 ${o(e.to)}${r}`;
|
|
737
|
-
case "list": return `${
|
|
737
|
+
case "list": return `${V(e.values, o)}${r}`;
|
|
738
738
|
case "step": return e.from === null ? `每 ${e.step} ${a}` : e.to === null ? `从 ${o(e.from)}${r}起每 ${e.step} ${a}` : `${o(e.from)} 到 ${o(e.to)}${r}之间每 ${e.step} ${a}`;
|
|
739
|
-
default: return
|
|
739
|
+
default: return U([`${t.label}为`, e.kind === "custom" ? e.text : ""]);
|
|
740
740
|
}
|
|
741
|
-
},
|
|
741
|
+
}, q = (e, t) => K(e, t, {
|
|
742
742
|
unit: " 时",
|
|
743
743
|
everyText: "每小时",
|
|
744
744
|
stepUnit: "小时"
|
|
745
|
-
}),
|
|
745
|
+
}), ge = (e, t) => K(e, t, {
|
|
746
746
|
unit: " 分",
|
|
747
747
|
everyText: "每分钟",
|
|
748
748
|
stepUnit: "分钟"
|
|
749
|
-
}),
|
|
749
|
+
}), _e = (e, t) => K(e, t, {
|
|
750
750
|
unit: " 秒",
|
|
751
751
|
everyText: "每秒",
|
|
752
752
|
stepUnit: "秒"
|
|
753
|
-
}),
|
|
753
|
+
}), ve = (e, t) => e.kind === "every" ? "" : K(e, t, {
|
|
754
754
|
unit: " 月",
|
|
755
755
|
everyText: "每月",
|
|
756
756
|
stepUnit: "个月"
|
|
757
|
-
}),
|
|
757
|
+
}), J = (e, t) => e.kind === "every" ? "" : K(e, t, {
|
|
758
758
|
unit: " 年",
|
|
759
759
|
everyText: "每年",
|
|
760
760
|
stepUnit: "年"
|
|
761
|
-
}),
|
|
761
|
+
}), ye = (e, t) => {
|
|
762
762
|
switch (e.kind) {
|
|
763
763
|
case "last": return e.weekday ? "每月最后一个工作日" : e.offset > 0 ? `每月倒数第 ${e.offset + 1} 天` : "每月最后一天";
|
|
764
764
|
case "weekday": return `离每月 ${e.day} 号最近的工作日`;
|
|
765
|
-
default: return
|
|
765
|
+
default: return K(e, t, {
|
|
766
766
|
unit: " 号",
|
|
767
767
|
everyText: "每天",
|
|
768
768
|
stepUnit: "天"
|
|
769
769
|
});
|
|
770
770
|
}
|
|
771
|
-
},
|
|
772
|
-
let n = (e) =>
|
|
771
|
+
}, be = (e, t) => {
|
|
772
|
+
let n = (e) => j(e, t);
|
|
773
773
|
switch (e.kind) {
|
|
774
774
|
case "every": return "每天";
|
|
775
775
|
case "range": return `${n(e.from)}到${n(e.to)}`;
|
|
776
|
-
case "list": return
|
|
776
|
+
case "list": return V(e.values, n);
|
|
777
777
|
case "step": return e.from === null ? `每 ${e.step} 天` : e.to === null ? `从${n(e.from)}起每 ${e.step} 天` : `${n(e.from)}到${n(e.to)}之间每 ${e.step} 天`;
|
|
778
778
|
case "last": return e.dayOfWeek === null ? "每月最后一天" : `每月最后一个${n(e.dayOfWeek)}`;
|
|
779
779
|
case "nth": return `每月第 ${e.nth} 个${n(e.dayOfWeek)}`;
|
|
780
|
-
default: return
|
|
780
|
+
default: return U([`${t.label}为`, e.kind === "custom" ? e.text : ""]);
|
|
781
781
|
}
|
|
782
|
-
},
|
|
783
|
-
let t =
|
|
782
|
+
}, xe = (e) => {
|
|
783
|
+
let t = A(e.mode, "dayOfMonth"), n = A(e.mode, "dayOfWeek"), r = I(e.matches.dayOfMonth), i = I(e.matches.dayOfWeek);
|
|
784
784
|
if (!r && !i) return "每天";
|
|
785
|
-
let a = r ?
|
|
786
|
-
return a && o ?
|
|
785
|
+
let a = r ? ye(z(e.fields.dayOfMonth, t), t) : "", o = i ? be(z(e.fields.dayOfWeek, n), n) : "";
|
|
786
|
+
return a && o ? U([
|
|
787
787
|
a,
|
|
788
788
|
"或",
|
|
789
789
|
o
|
|
790
790
|
]) : a || o;
|
|
791
|
-
},
|
|
792
|
-
let t = e.mode === "quartz", n =
|
|
791
|
+
}, Se = (e) => {
|
|
792
|
+
let t = e.mode === "quartz", n = A(e.mode, "hour"), r = A(e.mode, "minute"), i = A("quartz", "second"), a = z(e.fields.hour, n), o = z(e.fields.minute, r), s = z(e.fields.second, i), c = W(a), l = W(o), u = W(s);
|
|
793
793
|
if (c !== null && l !== null && u !== null) {
|
|
794
|
-
let e = `${
|
|
795
|
-
return t ? `${e}:${
|
|
794
|
+
let e = `${B(c)}:${B(l)}`;
|
|
795
|
+
return t ? `${e}:${B(u)}` : e;
|
|
796
796
|
}
|
|
797
797
|
let d = [{
|
|
798
|
-
text:
|
|
799
|
-
frequency:
|
|
798
|
+
text: q(a, n),
|
|
799
|
+
frequency: G(a)
|
|
800
800
|
}, {
|
|
801
|
-
text:
|
|
802
|
-
frequency:
|
|
801
|
+
text: ge(o, r),
|
|
802
|
+
frequency: G(o)
|
|
803
803
|
}];
|
|
804
804
|
for (t && u !== 0 && d.push({
|
|
805
|
-
text:
|
|
806
|
-
frequency:
|
|
805
|
+
text: _e(s, i),
|
|
806
|
+
frequency: G(s)
|
|
807
807
|
}); d.length > 1 && d[0].frequency && d[1].frequency;) d.shift();
|
|
808
|
-
return
|
|
809
|
-
},
|
|
810
|
-
let t =
|
|
811
|
-
return (r !== "每天" || !i.startsWith("每")) && a.push(r), a.push(i),
|
|
812
|
-
}, Ce = 1e4,
|
|
813
|
-
let r =
|
|
808
|
+
return U(d.map((e) => e.text));
|
|
809
|
+
}, Y = (e) => {
|
|
810
|
+
let t = J(z(e.fields.year, A("quartz", "year")), A("quartz", "year")), n = ve(z(e.fields.month, A(e.mode, "month")), A(e.mode, "month")), r = xe(e), i = Se(e), a = [t, n];
|
|
811
|
+
return (r !== "每天" || !i.startsWith("每")) && a.push(r), a.push(i), U([...a, "执行"]);
|
|
812
|
+
}, Ce = 1e4, X = (e, t) => new Date(e, t, 0).getDate(), we = (e, t) => e + t.min, Te = (e, t) => e.wildcard || e.unspecified || e.values.includes(t), Z = (e, t, n) => {
|
|
813
|
+
let r = X(e, t), i = Math.min(n, r), a = new Date(e, t - 1, i).getDay();
|
|
814
814
|
return a >= 1 && a <= 5 ? i : a === 6 ? i > 1 ? i - 1 : i + 2 : i < r ? i + 1 : i - 2;
|
|
815
|
-
},
|
|
816
|
-
let n =
|
|
815
|
+
}, Ee = (e, t) => {
|
|
816
|
+
let n = X(e, t);
|
|
817
817
|
for (; n > 1;) {
|
|
818
818
|
let r = new Date(e, t - 1, n).getDay();
|
|
819
819
|
if (r >= 1 && r <= 5) break;
|
|
820
820
|
--n;
|
|
821
821
|
}
|
|
822
822
|
return n;
|
|
823
|
-
},
|
|
823
|
+
}, De = (e, t, n, r) => {
|
|
824
824
|
let i = 1 + (n - new Date(e, t - 1, 1).getDay() + 7) % 7 + (r - 1) * 7;
|
|
825
|
-
return i <=
|
|
825
|
+
return i <= X(e, t) ? i : null;
|
|
826
826
|
}, Oe = (e, t, n) => {
|
|
827
|
-
let r =
|
|
827
|
+
let r = X(e, t);
|
|
828
828
|
return r - (new Date(e, t - 1, r).getDay() - n + 7) % 7;
|
|
829
829
|
}, ke = (e, t, n, r, i) => {
|
|
830
|
-
let a =
|
|
830
|
+
let a = X(t, n);
|
|
831
831
|
switch (e.type) {
|
|
832
832
|
case "lastDayOfMonth": return r === a - e.offset;
|
|
833
|
-
case "lastWeekdayOfMonth": return r ===
|
|
834
|
-
case "nearestWeekday": return r ===
|
|
833
|
+
case "lastWeekdayOfMonth": return r === Ee(t, n);
|
|
834
|
+
case "nearestWeekday": return r === Z(t, n, e.day);
|
|
835
835
|
case "lastDayOfWeek": return r === Oe(t, n, (e.dayOfWeek - i.min + 7) % 7);
|
|
836
|
-
case "nthDayOfWeek": return r ===
|
|
836
|
+
case "nthDayOfWeek": return r === De(t, n, (e.dayOfWeek - i.min + 7) % 7, e.nth);
|
|
837
837
|
}
|
|
838
838
|
}, Ae = (e, t, n, r) => {
|
|
839
|
-
let { dayOfMonth: i, dayOfWeek: a } = e.matches, o =
|
|
839
|
+
let { dayOfMonth: i, dayOfWeek: a } = e.matches, o = A(e.mode, "dayOfWeek"), s = A(e.mode, "dayOfMonth"), c = () => Te(i, r) || i.rules.some((e) => ke(e, t, n, r, s)), l = () => {
|
|
840
840
|
let e = we(new Date(t, n - 1, r).getDay(), o);
|
|
841
841
|
return Te(a, e) || a.rules.some((e) => ke(e, t, n, r, o));
|
|
842
|
-
}, u =
|
|
842
|
+
}, u = I(i), d = I(a);
|
|
843
843
|
return u && d ? c() || l() : u ? c() : !d || l();
|
|
844
|
-
},
|
|
845
|
-
let { matches: n, mode: r } = e, i =
|
|
844
|
+
}, Q = (e, t, n) => e.wildcard || e.unspecified ? t <= n.max ? t : null : e.values.find((e) => e >= t) ?? null, je = (e, t) => {
|
|
845
|
+
let { matches: n, mode: r } = e, i = A("quartz", "year"), a = A(r, "month"), o = A(r, "hour"), s = A(r, "minute"), c = A("quartz", "second"), l = new Date(t.getTime() + 1e3);
|
|
846
846
|
l.setMilliseconds(0);
|
|
847
847
|
let u = l.getFullYear(), d = l.getMonth() + 1, f = l.getDate(), p = l.getHours(), m = l.getMinutes(), h = l.getSeconds();
|
|
848
848
|
for (let t = 0; t < Ce; t += 1) {
|
|
849
|
-
let t =
|
|
849
|
+
let t = Q(n.year, u, i);
|
|
850
850
|
if (t === null) return null;
|
|
851
851
|
t !== u && (u = t, d = 1, f = 1, p = 0, m = 0, h = 0);
|
|
852
|
-
let r =
|
|
852
|
+
let r = Q(n.month, d, a);
|
|
853
853
|
if (r === null) {
|
|
854
854
|
u += 1, d = 1, f = 1, p = 0, m = 0, h = 0;
|
|
855
855
|
continue;
|
|
856
856
|
}
|
|
857
|
-
if (r !== d && (d = r, f = 1, p = 0, m = 0, h = 0), f >
|
|
857
|
+
if (r !== d && (d = r, f = 1, p = 0, m = 0, h = 0), f > X(u, d)) {
|
|
858
858
|
d += 1, f = 1, p = 0, m = 0, h = 0, d > 12 && (d = 1, u += 1);
|
|
859
859
|
continue;
|
|
860
860
|
}
|
|
@@ -862,19 +862,19 @@ var O = {
|
|
|
862
862
|
f += 1, p = 0, m = 0, h = 0;
|
|
863
863
|
continue;
|
|
864
864
|
}
|
|
865
|
-
let l =
|
|
865
|
+
let l = Q(n.hour, p, o);
|
|
866
866
|
if (l === null) {
|
|
867
867
|
f += 1, p = 0, m = 0, h = 0;
|
|
868
868
|
continue;
|
|
869
869
|
}
|
|
870
870
|
l !== p && (p = l, m = 0, h = 0);
|
|
871
|
-
let g =
|
|
871
|
+
let g = Q(n.minute, m, s);
|
|
872
872
|
if (g === null) {
|
|
873
873
|
p += 1, m = 0, h = 0, p > o.max && (p = 0, f += 1);
|
|
874
874
|
continue;
|
|
875
875
|
}
|
|
876
876
|
g !== m && (m = g, h = 0);
|
|
877
|
-
let _ =
|
|
877
|
+
let _ = Q(n.second, h, c);
|
|
878
878
|
if (_ === null) {
|
|
879
879
|
m += 1, h = 0, m > s.max && (m = 0, p += 1, p > o.max && (p = 0, f += 1));
|
|
880
880
|
continue;
|
|
@@ -896,300 +896,308 @@ var O = {
|
|
|
896
896
|
r.push(t), i = t;
|
|
897
897
|
}
|
|
898
898
|
return r;
|
|
899
|
-
},
|
|
900
|
-
let d = "vl-cron-panel",
|
|
899
|
+
}, $ = (e, t = 2) => String(e).padStart(t, "0"), Ne = (e) => `${e.getFullYear()}-${$(e.getMonth() + 1)}-${$(e.getDate())} ${$(e.getHours())}:${$(e.getMinutes())}:${$(e.getSeconds())}`, Pe = ({ parsed: e, mode: t, hasYear: n, readonly: r = !1, shortcuts: i, showDescription: a = !0, showPreview: o = !0, previewCount: s = 5, onChange: c, onInvalid: u }) => {
|
|
900
|
+
let d = "vl-cron-panel", f = S(() => k(t, n), [t, n]), h = S(() => L(e.fields, t, n), [
|
|
901
901
|
e.fields,
|
|
902
902
|
t,
|
|
903
903
|
n
|
|
904
|
-
]), [g, _] =
|
|
904
|
+
]), [g, _] = te(f[0]), [v, ee] = te(h), [y, b] = te(null), C = l("cron-error");
|
|
905
905
|
x(() => {
|
|
906
|
-
_((e) =>
|
|
907
|
-
}, [
|
|
908
|
-
|
|
906
|
+
_((e) => f.includes(e) ? e : f[0]);
|
|
907
|
+
}, [f]), x(() => {
|
|
908
|
+
ee(h), b(null);
|
|
909
909
|
}, [h]);
|
|
910
|
-
let
|
|
910
|
+
let w = S(() => f.map((e) => ({
|
|
911
911
|
key: e,
|
|
912
|
-
label:
|
|
913
|
-
})), [
|
|
914
|
-
|
|
915
|
-
},
|
|
912
|
+
label: A(t, e).label
|
|
913
|
+
})), [f, t]), ne = (e) => {
|
|
914
|
+
b(null), c(L(e, t, n));
|
|
915
|
+
}, D = (n, r) => {
|
|
916
916
|
let i = {
|
|
917
917
|
...e.fields,
|
|
918
918
|
[n]: r
|
|
919
919
|
};
|
|
920
|
-
t === "quartz" && r !== "?" && r !== "*" && (n === "dayOfMonth" && (i.dayOfWeek = "?"), n === "dayOfWeek" && (i.dayOfMonth = "?")),
|
|
921
|
-
},
|
|
920
|
+
t === "quartz" && r !== "?" && r !== "*" && (n === "dayOfMonth" && (i.dayOfWeek = "?"), n === "dayOfWeek" && (i.dayOfMonth = "?")), ne(i);
|
|
921
|
+
}, O = (e) => {
|
|
922
922
|
let n = e.trim();
|
|
923
923
|
if (n === h) {
|
|
924
|
-
|
|
924
|
+
b(null);
|
|
925
925
|
return;
|
|
926
926
|
}
|
|
927
|
-
let r =
|
|
927
|
+
let r = ce(n, t);
|
|
928
928
|
if (r.ok) {
|
|
929
|
-
|
|
929
|
+
b(null), c(L(r.value.fields, t, r.value.hasYear));
|
|
930
930
|
return;
|
|
931
931
|
}
|
|
932
|
-
|
|
933
|
-
},
|
|
932
|
+
b(r.message), r.field && _(r.field), u?.(n, r.message);
|
|
933
|
+
}, j = A(t, g), M = S(() => o ? Me(e, s) : [], [
|
|
934
934
|
e,
|
|
935
935
|
s,
|
|
936
936
|
o
|
|
937
937
|
]);
|
|
938
|
-
return /* @__PURE__ */
|
|
938
|
+
return /* @__PURE__ */ E("div", {
|
|
939
939
|
className: d,
|
|
940
940
|
children: [
|
|
941
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ E("div", {
|
|
942
942
|
className: `${d}__expression`,
|
|
943
|
-
children: [/* @__PURE__ */
|
|
943
|
+
children: [/* @__PURE__ */ T(p, {
|
|
944
944
|
value: v,
|
|
945
945
|
size: "sm",
|
|
946
946
|
readOnly: r,
|
|
947
947
|
"aria-label": "Cron 表达式",
|
|
948
|
-
"aria-invalid":
|
|
949
|
-
"aria-describedby":
|
|
950
|
-
onChange:
|
|
951
|
-
onBlur: () =>
|
|
948
|
+
"aria-invalid": y ? !0 : void 0,
|
|
949
|
+
"aria-describedby": y ? C : void 0,
|
|
950
|
+
onChange: ee,
|
|
951
|
+
onBlur: () => O(v),
|
|
952
952
|
onKeyDown: (e) => {
|
|
953
|
-
e.key === "Enter" &&
|
|
953
|
+
e.key === "Enter" && O(v);
|
|
954
954
|
}
|
|
955
|
-
}),
|
|
955
|
+
}), y ? /* @__PURE__ */ T("p", {
|
|
956
956
|
className: `${d}__error`,
|
|
957
|
-
id:
|
|
957
|
+
id: C,
|
|
958
958
|
role: "alert",
|
|
959
|
-
children:
|
|
959
|
+
children: y
|
|
960
960
|
}) : null]
|
|
961
961
|
}),
|
|
962
|
-
i?.length ? /* @__PURE__ */
|
|
962
|
+
i?.length ? /* @__PURE__ */ T("div", {
|
|
963
963
|
className: `${d}__shortcuts`,
|
|
964
964
|
role: "group",
|
|
965
965
|
"aria-label": "快捷预设",
|
|
966
|
-
children: i.map((e) => /* @__PURE__ */
|
|
966
|
+
children: i.map((e) => /* @__PURE__ */ T("button", {
|
|
967
967
|
type: "button",
|
|
968
968
|
className: `${d}__shortcut`,
|
|
969
969
|
disabled: r,
|
|
970
|
-
onClick: () =>
|
|
970
|
+
onClick: () => O(e.value),
|
|
971
971
|
children: e.label
|
|
972
972
|
}, e.value))
|
|
973
973
|
}) : null,
|
|
974
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ T(m, {
|
|
975
975
|
className: `${d}__tabs`,
|
|
976
|
-
items:
|
|
976
|
+
items: w,
|
|
977
977
|
value: g,
|
|
978
978
|
size: "sm",
|
|
979
979
|
onChange: (e) => _(e)
|
|
980
980
|
}),
|
|
981
|
-
/* @__PURE__ */
|
|
981
|
+
/* @__PURE__ */ T("div", {
|
|
982
982
|
className: `${d}__editor`,
|
|
983
|
-
children: /* @__PURE__ */
|
|
984
|
-
spec:
|
|
985
|
-
value:
|
|
983
|
+
children: /* @__PURE__ */ T(he, {
|
|
984
|
+
spec: j,
|
|
985
|
+
value: z(e.fields[g], j),
|
|
986
986
|
disabled: r,
|
|
987
|
-
onChange: (e) =>
|
|
987
|
+
onChange: (e) => D(g, ue(e, j))
|
|
988
988
|
}, g)
|
|
989
989
|
}),
|
|
990
|
-
a ? /* @__PURE__ */
|
|
990
|
+
a ? /* @__PURE__ */ T("p", {
|
|
991
991
|
className: `${d}__description`,
|
|
992
|
-
children:
|
|
992
|
+
children: Y(e)
|
|
993
993
|
}) : null,
|
|
994
|
-
o ? /* @__PURE__ */
|
|
994
|
+
o ? /* @__PURE__ */ E("div", {
|
|
995
995
|
className: `${d}__preview`,
|
|
996
|
-
children: [/* @__PURE__ */
|
|
996
|
+
children: [/* @__PURE__ */ E("span", {
|
|
997
997
|
className: `${d}__preview-title`,
|
|
998
998
|
children: [
|
|
999
999
|
"接下来 ",
|
|
1000
|
-
|
|
1000
|
+
M.length || s,
|
|
1001
1001
|
" 次"
|
|
1002
1002
|
]
|
|
1003
|
-
}),
|
|
1003
|
+
}), M.length ? /* @__PURE__ */ T("ul", {
|
|
1004
1004
|
className: `${d}__preview-list`,
|
|
1005
|
-
children:
|
|
1006
|
-
}) : /* @__PURE__ */
|
|
1005
|
+
children: M.map((e) => /* @__PURE__ */ T("li", { children: Ne(e) }, e.getTime()))
|
|
1006
|
+
}) : /* @__PURE__ */ T("p", {
|
|
1007
1007
|
className: `${d}__preview-empty`,
|
|
1008
1008
|
children: "该表达式没有可执行的时间"
|
|
1009
1009
|
})]
|
|
1010
1010
|
}) : null
|
|
1011
1011
|
]
|
|
1012
1012
|
});
|
|
1013
|
-
},
|
|
1014
|
-
let { value:
|
|
1015
|
-
defaultZIndex:
|
|
1016
|
-
zIndex:
|
|
1017
|
-
}),
|
|
1018
|
-
value:
|
|
1019
|
-
defaultValue:
|
|
1020
|
-
controlled:
|
|
1021
|
-
}), [
|
|
1022
|
-
let e =
|
|
1013
|
+
}, Fe = y((i, p) => {
|
|
1014
|
+
let { value: m, defaultValue: h = null, mode: g = "quartz", withYear: _ = !1, inline: y = !1, placeholder: w = "请选择执行周期", disabled: D = !1, readonly: O = !1, clearable: k = !1, size: A = "md", placement: j = "bottom-start", offset: M = 8, zIndex: N, shortcuts: P, showDescription: F = !0, showPreview: re = !0, previewCount: ie = 5, className: ae, style: oe, id: se, "aria-label": I, "aria-labelledby": L, "aria-describedby": R, onChange: z, onInvalid: ue, onClear: de, onOpen: fe, onClose: pe, ...me } = i, he = C(null), B = C(null), V = C(null), H = a(), U = u({
|
|
1015
|
+
defaultZIndex: d.popover,
|
|
1016
|
+
zIndex: N
|
|
1017
|
+
}), W = t(i, "value"), [G, K] = e({
|
|
1018
|
+
value: m ?? null,
|
|
1019
|
+
defaultValue: h,
|
|
1020
|
+
controlled: W
|
|
1021
|
+
}), [q, ge] = te(!1), [{ style: _e, placement: ve }, J] = o(j), ye = _e.left !== void 0, be = l("vl-cron-control", se), xe = l("vl-cron-panel"), Se = S(() => n(he, p), [p]), Y = S(() => G ? ce(G, g) : null, [G, g]), Ce = Y?.ok && Y.value.hasYear || g === "quartz" && _, X = S(() => {
|
|
1022
|
+
let e = ce(le(g, Ce), g);
|
|
1023
1023
|
return e.ok ? e.value : null;
|
|
1024
|
-
}, [
|
|
1025
|
-
e &&
|
|
1024
|
+
}, [Ce, g]), we = Y?.ok ? Y.value : X, Te = !!(G && Y && !Y.ok), Z = b((e) => {
|
|
1025
|
+
e && D || e !== q && (ge(e), e ? (J({
|
|
1026
|
+
placement: j,
|
|
1027
|
+
style: {}
|
|
1028
|
+
}), fe?.()) : pe?.());
|
|
1026
1029
|
}, [
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1030
|
+
D,
|
|
1031
|
+
pe,
|
|
1032
|
+
fe,
|
|
1033
|
+
q,
|
|
1034
|
+
j,
|
|
1035
|
+
J
|
|
1036
|
+
]), Ee = b(() => {
|
|
1037
|
+
if (!q || !B.current || !V.current) return;
|
|
1038
|
+
let e = c({
|
|
1039
|
+
anchorRect: B.current.getBoundingClientRect(),
|
|
1040
|
+
floatingRect: V.current.getBoundingClientRect(),
|
|
1041
|
+
placement: j,
|
|
1042
|
+
offset: M
|
|
1043
|
+
});
|
|
1044
|
+
J({
|
|
1045
|
+
placement: e.placement,
|
|
1046
|
+
style: {
|
|
1047
|
+
left: `${Math.round(e.x)}px`,
|
|
1048
|
+
top: `${Math.round(e.y)}px`
|
|
1049
|
+
}
|
|
1039
1050
|
});
|
|
1040
|
-
be(e.placement), ge({
|
|
1041
|
-
left: `${Math.round(e.x)}px`,
|
|
1042
|
-
top: `${Math.round(e.y)}px`
|
|
1043
|
-
}), ve(!0);
|
|
1044
1051
|
}, [
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1052
|
+
M,
|
|
1053
|
+
q,
|
|
1054
|
+
j,
|
|
1055
|
+
J
|
|
1048
1056
|
]);
|
|
1049
1057
|
x(() => {
|
|
1050
|
-
|
|
1058
|
+
q && H && Ee();
|
|
1051
1059
|
}, [
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1060
|
+
H,
|
|
1061
|
+
q,
|
|
1062
|
+
Ee
|
|
1055
1063
|
]);
|
|
1056
|
-
let
|
|
1057
|
-
|
|
1058
|
-
}, [
|
|
1059
|
-
|
|
1060
|
-
active:
|
|
1061
|
-
rootRef:
|
|
1062
|
-
floatingRef:
|
|
1064
|
+
let De = b(() => Z(!1), [Z]), Oe = b(() => {
|
|
1065
|
+
Z(!1), B.current?.focus();
|
|
1066
|
+
}, [Z]);
|
|
1067
|
+
s({
|
|
1068
|
+
active: q && H && !y,
|
|
1069
|
+
rootRef: he,
|
|
1070
|
+
floatingRef: V,
|
|
1063
1071
|
ignoreEscapeInsideFloating: !1,
|
|
1064
|
-
onOutsideClick:
|
|
1065
|
-
onEscape:
|
|
1066
|
-
onViewportChange:
|
|
1072
|
+
onOutsideClick: De,
|
|
1073
|
+
onEscape: Oe,
|
|
1074
|
+
onViewportChange: Ee
|
|
1067
1075
|
}), x(() => {
|
|
1068
|
-
|
|
1076
|
+
D && q && Z(!1);
|
|
1069
1077
|
}, [
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1078
|
+
D,
|
|
1079
|
+
q,
|
|
1080
|
+
Z
|
|
1073
1081
|
]);
|
|
1074
|
-
let
|
|
1075
|
-
|
|
1076
|
-
},
|
|
1077
|
-
e?.stopPropagation(), !(
|
|
1078
|
-
},
|
|
1079
|
-
|
|
1080
|
-
},
|
|
1081
|
-
parsed:
|
|
1082
|
-
mode:
|
|
1083
|
-
hasYear:
|
|
1084
|
-
readonly:
|
|
1085
|
-
shortcuts:
|
|
1086
|
-
showDescription:
|
|
1087
|
-
showPreview:
|
|
1088
|
-
previewCount:
|
|
1089
|
-
onChange:
|
|
1090
|
-
onInvalid:
|
|
1082
|
+
let ke = (e) => {
|
|
1083
|
+
K(e), z?.(e);
|
|
1084
|
+
}, Ae = (e) => {
|
|
1085
|
+
e?.stopPropagation(), !(D || O) && (ke(null), de?.());
|
|
1086
|
+
}, Q = (e) => {
|
|
1087
|
+
D || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Z(!q));
|
|
1088
|
+
}, je = we ? /* @__PURE__ */ T(Pe, {
|
|
1089
|
+
parsed: we,
|
|
1090
|
+
mode: g,
|
|
1091
|
+
hasYear: Ce,
|
|
1092
|
+
readonly: O || D,
|
|
1093
|
+
shortcuts: P,
|
|
1094
|
+
showDescription: F,
|
|
1095
|
+
showPreview: re,
|
|
1096
|
+
previewCount: ie,
|
|
1097
|
+
onChange: ke,
|
|
1098
|
+
onInvalid: ue
|
|
1091
1099
|
}) : null;
|
|
1092
1100
|
if (y) {
|
|
1093
1101
|
let e = [
|
|
1094
1102
|
"vl-cron",
|
|
1095
1103
|
"is-inline",
|
|
1096
|
-
`size-${
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1104
|
+
`size-${A}`,
|
|
1105
|
+
D ? "is-disabled" : "",
|
|
1106
|
+
O ? "is-readonly" : "",
|
|
1107
|
+
ae || ""
|
|
1100
1108
|
].filter(Boolean).join(" ");
|
|
1101
|
-
return /* @__PURE__ */
|
|
1102
|
-
ref:
|
|
1103
|
-
id:
|
|
1109
|
+
return /* @__PURE__ */ T("div", {
|
|
1110
|
+
ref: Se,
|
|
1111
|
+
id: be,
|
|
1104
1112
|
className: e,
|
|
1105
|
-
style:
|
|
1113
|
+
style: oe,
|
|
1106
1114
|
role: "group",
|
|
1107
|
-
"aria-label":
|
|
1108
|
-
"aria-labelledby":
|
|
1109
|
-
"aria-describedby":
|
|
1110
|
-
"aria-disabled":
|
|
1111
|
-
...
|
|
1112
|
-
children:
|
|
1115
|
+
"aria-label": I ?? (L ? void 0 : "Cron 表达式编辑"),
|
|
1116
|
+
"aria-labelledby": L,
|
|
1117
|
+
"aria-describedby": R,
|
|
1118
|
+
"aria-disabled": D || void 0,
|
|
1119
|
+
...me,
|
|
1120
|
+
children: je
|
|
1113
1121
|
});
|
|
1114
1122
|
}
|
|
1115
|
-
let
|
|
1123
|
+
let Me = [
|
|
1116
1124
|
"vl-cron",
|
|
1117
|
-
`size-${
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
].filter(Boolean).join(" "), $ = /* @__PURE__ */
|
|
1124
|
-
show:
|
|
1125
|
+
`size-${A}`,
|
|
1126
|
+
q ? "is-open" : "",
|
|
1127
|
+
D ? "is-disabled" : "",
|
|
1128
|
+
O ? "is-readonly" : "",
|
|
1129
|
+
Te ? "is-invalid" : "",
|
|
1130
|
+
ae || ""
|
|
1131
|
+
].filter(Boolean).join(" "), $ = /* @__PURE__ */ T(r, {
|
|
1132
|
+
show: q,
|
|
1125
1133
|
name: "vl-cron",
|
|
1126
|
-
deferEffects: !
|
|
1127
|
-
children: /* @__PURE__ */
|
|
1128
|
-
ref:
|
|
1129
|
-
id:
|
|
1130
|
-
className: `vl-cron__panel is-${
|
|
1134
|
+
deferEffects: !H,
|
|
1135
|
+
children: /* @__PURE__ */ T("div", {
|
|
1136
|
+
ref: V,
|
|
1137
|
+
id: xe,
|
|
1138
|
+
className: `vl-cron__panel is-${ve}${ye ? " is-positioned" : ""}`,
|
|
1131
1139
|
style: {
|
|
1132
|
-
...
|
|
1133
|
-
zIndex:
|
|
1134
|
-
visibility:
|
|
1140
|
+
..._e,
|
|
1141
|
+
zIndex: U.zIndex,
|
|
1142
|
+
visibility: ye ? "visible" : "hidden"
|
|
1135
1143
|
},
|
|
1136
1144
|
role: "dialog",
|
|
1137
1145
|
"aria-label": "Cron 表达式编辑",
|
|
1138
|
-
children:
|
|
1146
|
+
children: je
|
|
1139
1147
|
})
|
|
1140
1148
|
});
|
|
1141
|
-
return /* @__PURE__ */
|
|
1142
|
-
layer:
|
|
1143
|
-
children: /* @__PURE__ */
|
|
1144
|
-
ref:
|
|
1149
|
+
return /* @__PURE__ */ T(f, {
|
|
1150
|
+
layer: U.layer,
|
|
1151
|
+
children: /* @__PURE__ */ E("div", {
|
|
1152
|
+
ref: Se,
|
|
1145
1153
|
className: "vl-cron-wrapper",
|
|
1146
|
-
style:
|
|
1147
|
-
...
|
|
1148
|
-
children: [/* @__PURE__ */
|
|
1149
|
-
ref:
|
|
1150
|
-
id:
|
|
1151
|
-
className:
|
|
1154
|
+
style: oe,
|
|
1155
|
+
...me,
|
|
1156
|
+
children: [/* @__PURE__ */ E("div", {
|
|
1157
|
+
ref: B,
|
|
1158
|
+
id: be,
|
|
1159
|
+
className: Me,
|
|
1152
1160
|
role: "combobox",
|
|
1153
|
-
"aria-expanded":
|
|
1154
|
-
"aria-controls":
|
|
1161
|
+
"aria-expanded": q,
|
|
1162
|
+
"aria-controls": xe,
|
|
1155
1163
|
"aria-haspopup": "dialog",
|
|
1156
|
-
"aria-disabled":
|
|
1157
|
-
"aria-invalid":
|
|
1158
|
-
"aria-label":
|
|
1159
|
-
"aria-labelledby":
|
|
1160
|
-
"aria-describedby":
|
|
1161
|
-
tabIndex:
|
|
1162
|
-
onClick: () =>
|
|
1163
|
-
onKeyDown:
|
|
1164
|
+
"aria-disabled": D || void 0,
|
|
1165
|
+
"aria-invalid": Te || void 0,
|
|
1166
|
+
"aria-label": I ?? (L ? void 0 : w),
|
|
1167
|
+
"aria-labelledby": L,
|
|
1168
|
+
"aria-describedby": R,
|
|
1169
|
+
tabIndex: D ? -1 : 0,
|
|
1170
|
+
onClick: () => Z(!q),
|
|
1171
|
+
onKeyDown: Q,
|
|
1164
1172
|
children: [
|
|
1165
|
-
/* @__PURE__ */
|
|
1173
|
+
/* @__PURE__ */ T("span", {
|
|
1166
1174
|
className: "vl-cron__icon",
|
|
1167
1175
|
"aria-hidden": "true",
|
|
1168
|
-
children: /* @__PURE__ */
|
|
1176
|
+
children: /* @__PURE__ */ T(v, { size: 16 })
|
|
1169
1177
|
}),
|
|
1170
|
-
/* @__PURE__ */
|
|
1171
|
-
className: `vl-cron__value${
|
|
1172
|
-
children:
|
|
1178
|
+
/* @__PURE__ */ T("span", {
|
|
1179
|
+
className: `vl-cron__value${G ? "" : " is-placeholder"}`,
|
|
1180
|
+
children: G || w
|
|
1173
1181
|
}),
|
|
1174
|
-
|
|
1182
|
+
k && G && !D && !O ? /* @__PURE__ */ T("button", {
|
|
1175
1183
|
type: "button",
|
|
1176
1184
|
className: "vl-cron__clear",
|
|
1177
1185
|
"aria-label": "清除表达式",
|
|
1178
|
-
onClick:
|
|
1186
|
+
onClick: Ae,
|
|
1179
1187
|
onMouseDown: (e) => e.preventDefault(),
|
|
1180
|
-
children: /* @__PURE__ */
|
|
1188
|
+
children: /* @__PURE__ */ T(ee, {
|
|
1181
1189
|
size: 16,
|
|
1182
1190
|
"aria-hidden": "true"
|
|
1183
1191
|
})
|
|
1184
1192
|
}) : null
|
|
1185
1193
|
]
|
|
1186
|
-
}),
|
|
1194
|
+
}), H ? ne($, document.body) : $]
|
|
1187
1195
|
})
|
|
1188
1196
|
});
|
|
1189
1197
|
});
|
|
1190
|
-
|
|
1198
|
+
Fe.displayName = "VlCron";
|
|
1191
1199
|
//#endregion
|
|
1192
1200
|
//#region components/Cron/index.ts
|
|
1193
|
-
var
|
|
1201
|
+
var Ie = Fe, Le = Fe;
|
|
1194
1202
|
//#endregion
|
|
1195
|
-
export {
|
|
1203
|
+
export { Ie as n, Le as t };
|