@vavt/react-ui 1.0.4 → 1.1.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.
Files changed (92) hide show
  1. package/dist/{DatePicker-CoHW85qm.cjs → DatePicker-D3tdU7GY.cjs} +1 -1
  2. package/dist/{DatePicker-B-F5q_s_.js → DatePicker-D75NqBYX.js} +1 -1
  3. package/dist/{DateTimePicker-CAkdoY--.cjs → DateTimePicker-CCe5NUkC.cjs} +1 -1
  4. package/dist/{DateTimePicker-BSBZZ7xV.js → DateTimePicker-CG-yv54X.js} +1 -1
  5. package/dist/{Drawer-D45miZ27.cjs → Drawer-CeBlbSjY.cjs} +1 -1
  6. package/dist/{Drawer-C0toQ-fQ.js → Drawer-CgaSQfT_.js} +1 -1
  7. package/dist/Form-BfXRwX6y.js +353 -0
  8. package/dist/Form-QpWOfQpR.cjs +1 -0
  9. package/dist/{MessageBox-B4Qo1vs2.js → MessageBox-DlAv_jQm.js} +1 -1
  10. package/dist/{MessageBox-CTJfdU29.cjs → MessageBox-nHLRzRJS.cjs} +1 -1
  11. package/dist/Modal-CAZ8vap0.cjs +1 -0
  12. package/dist/Modal-DnLKpKvW.js +238 -0
  13. package/dist/{Table-B9NTkptC.js → Table-BFqTvxt1.js} +10 -10
  14. package/dist/{Table-Bqjey5fw.cjs → Table-D4csqW47.cjs} +1 -1
  15. package/dist/Upload-CIOunhpr.cjs +1 -0
  16. package/dist/{Upload-DZC_bt6G.js → Upload-CVIzg2Px.js} +65 -64
  17. package/dist/base.css +1 -1
  18. package/dist/cjs/DatePicker.cjs +1 -1
  19. package/dist/cjs/DateTimePicker.cjs +1 -1
  20. package/dist/cjs/Drawer.cjs +1 -1
  21. package/dist/cjs/Form.cjs +1 -1
  22. package/dist/cjs/MessageBox.cjs +1 -1
  23. package/dist/cjs/Modal.cjs +1 -1
  24. package/dist/cjs/Table.cjs +1 -1
  25. package/dist/cjs/Upload.cjs +1 -1
  26. package/dist/cjs/global.cjs +1 -1
  27. package/dist/cjs/index.cjs +1 -1
  28. package/dist/cjs/register.cjs +1 -1
  29. package/dist/css/Alert.css +1 -1
  30. package/dist/css/Announcement.css +1 -1
  31. package/dist/css/Button.css +1 -1
  32. package/dist/css/Card.css +1 -1
  33. package/dist/css/Checkbox.css +1 -1
  34. package/dist/css/Cron.css +1 -1
  35. package/dist/css/DatePicker.css +1 -1
  36. package/dist/css/DateTimePicker.css +1 -1
  37. package/dist/css/Drawer.css +1 -1
  38. package/dist/css/Dropdown.css +1 -1
  39. package/dist/css/Empty.css +1 -1
  40. package/dist/css/Form.css +1 -1
  41. package/dist/css/Input.css +1 -1
  42. package/dist/css/MessageBox.css +1 -1
  43. package/dist/css/Modal.css +1 -1
  44. package/dist/css/NumberInput.css +1 -1
  45. package/dist/css/Progress.css +1 -1
  46. package/dist/css/Radio.css +1 -1
  47. package/dist/css/Select.css +1 -1
  48. package/dist/css/Sidebar.css +1 -1
  49. package/dist/css/Switch.css +1 -1
  50. package/dist/css/Tag.css +1 -1
  51. package/dist/css/Textarea.css +1 -1
  52. package/dist/css/TimePicker.css +1 -1
  53. package/dist/css/Tooltip.css +1 -1
  54. package/dist/css/Upload.css +1 -1
  55. package/dist/date-picker-BH--Nh7g.js +612 -0
  56. package/dist/date-picker-pwA2wCag.cjs +1 -0
  57. package/dist/{dialog-shell-DehX3PNh.js → dialog-shell-CdYlPT9f.js} +12 -12
  58. package/dist/dialog-shell-CzeGytVj.cjs +1 -0
  59. package/dist/es/DatePicker.mjs +1 -1
  60. package/dist/es/DateTimePicker.mjs +1 -1
  61. package/dist/es/Drawer.mjs +1 -1
  62. package/dist/es/Form.mjs +1 -1
  63. package/dist/es/MessageBox.mjs +1 -1
  64. package/dist/es/Modal.mjs +1 -1
  65. package/dist/es/Table.mjs +1 -1
  66. package/dist/es/Upload.mjs +1 -1
  67. package/dist/es/global.mjs +1 -1
  68. package/dist/es/index.mjs +22 -22
  69. package/dist/es/register.mjs +1 -1
  70. package/dist/index.css +1 -1
  71. package/dist/registry-BO2ao8Jc.cjs +1 -0
  72. package/dist/{registry-q6UdMOyj.js → registry-macDoSyW.js} +34 -34
  73. package/dist/style/Form.cjs +1 -0
  74. package/dist/style/Form.mjs +1 -0
  75. package/dist/style/Modal.cjs +1 -0
  76. package/dist/style/Modal.mjs +1 -0
  77. package/dist/types/Form/type.d.cts +3 -1
  78. package/dist/types/Form/type.d.ts +3 -1
  79. package/dist/types/Modal/type.d.cts +3 -3
  80. package/dist/types/Modal/type.d.ts +3 -3
  81. package/dist/types/Upload/type.d.cts +4 -0
  82. package/dist/types/Upload/type.d.ts +4 -0
  83. package/package.json +1 -1
  84. package/dist/Form-7un_DeDk.cjs +0 -1
  85. package/dist/Form-CwgaAZWr.js +0 -323
  86. package/dist/Modal-i_Do8GsG.cjs +0 -1
  87. package/dist/Modal-otJ_9ldu.js +0 -210
  88. package/dist/Upload-bxJz2avf.cjs +0 -1
  89. package/dist/date-picker-BsiNrLZC.js +0 -592
  90. package/dist/date-picker-DNN0BiRA.cjs +0 -1
  91. package/dist/dialog-shell-DT1EoKQG.cjs +0 -1
  92. package/dist/registry-BGNWNSiC.cjs +0 -1
@@ -1,592 +0,0 @@
1
- import { t as e } from "./effect-nifYL_rH.js";
2
- import { n as t, t as n } from "./state-oH-YwB7_.js";
3
- import { t as r } from "./client-pj_wzx28.js";
4
- import { n as i } from "./refs-D5IYOBaf.js";
5
- import { r as ee, t as a } from "./floating-DBAmeQIq.js";
6
- import { t as o } from "./id-CHixuHb7.js";
7
- import { n as s, r as te, t as ne } from "./layer-DDm97-sb.js";
8
- import { t as re } from "./Transition-DiO4GsP3.js";
9
- import { t as ie } from "./Input-CIB_TY2n.js";
10
- import { _ as ae, a as oe, b as se, c, d as l, f as ce, g as u, h as le, i as ue, l as d, m as f, n as de, p, r as fe, s as m, t as pe, u as h, y as me } from "./time-wheel-BtvYZI6H.js";
11
- import { t as he } from "./Dropdown-DljKFnvO.js";
12
- import { CalendarDays as ge, ChevronLeft as _e, ChevronRight as ve, ChevronsLeft as ye, ChevronsRight as be, Clock3 as xe, X as Se } from "lucide-react";
13
- import { forwardRef as Ce, useCallback as g, useEffect as we, useMemo as Te, useRef as Ee, useState as _ } from "react";
14
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
15
- import { createPortal as De } from "react-dom";
16
- //#region components/_shared/date-picker.tsx
17
- var Oe = "data-vl-date-picker-popup-owner", ke = [
18
- "日",
19
- "一",
20
- "二",
21
- "三",
22
- "四",
23
- "五",
24
- "六"
25
- ], b = [
26
- "一月",
27
- "二月",
28
- "三月",
29
- "四月",
30
- "五月",
31
- "六月",
32
- "七月",
33
- "八月",
34
- "九月",
35
- "十月",
36
- "十一月",
37
- "十二月"
38
- ], x = (e) => Array.isArray(e) && e.length === 2, S = (e, t) => se(e, t), Ae = (e, t) => {
39
- if (x(e)) {
40
- let n = S(e[0], t), r = S(e[1], t);
41
- return n && r ? `${l(n, t)} ~ ${l(r, t)}` : "";
42
- }
43
- let n = S(e, t);
44
- return n ? l(n, t) : "";
45
- }, je = (e) => [e[0] ? d(e[0]) : null, e[1] ? d(e[1]) : null], Me = (e) => `${e.getFullYear()}年 ${b[e.getMonth()]}`, Ne = (e, t) => t ? d(e) : u(e), Pe = (e, t, n) => {
46
- let r = (e) => {
47
- let t = S(e, n);
48
- return t ? t.getTime() : null;
49
- };
50
- return x(e) || x(t) ? !x(e) || !x(t) ? !1 : r(e[0]) === r(t[0]) && r(e[1]) === r(t[1]) : r(e) === r(t);
51
- }, C = Ce((se, Ce) => {
52
- let { componentName: b, withTime: C = !1, value: Fe, defaultValue: Ie, valueType: Le = "date", format: w = C ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD", range: T = !1, shortcuts: Re = [], minDate: ze, maxDate: Be, disabledDate: Ve, minTime: He, maxTime: Ue, disabledTime: We, placeholder: Ge = T ? "请选择日期范围" : C ? "请选择日期时间" : "请选择日期", disabled: E = !1, clearable: Ke = !1, size: qe = "md", placement: D = "bottom-start", offset: Je = 8, zIndex: Ye, className: Xe, style: Ze, id: Qe, "aria-label": $e, "aria-labelledby": et, "aria-describedby": tt, onChange: nt, onClear: rt, onOpen: it, onClose: at, ...ot } = se, O = nt, st = Ee(null), k = Ee(null), A = Ee(null), ct = Ee(null), lt = r(), ut = te({
53
- defaultZIndex: s.popover,
54
- zIndex: Ye
55
- }), dt = n(se, "value"), [j, M] = t({
56
- value: Fe ?? null,
57
- defaultValue: Ie ?? null,
58
- controlled: dt
59
- }), [N, ft] = _(!1), [pt, P] = _(() => {
60
- let e = x(j) ? S(j[0], w) : S(j, w);
61
- return ae(e ?? /* @__PURE__ */ new Date());
62
- }), [F, mt] = _(null), [I, L] = _([null, null]), [R, z] = _("start"), [ht, gt] = _(!1), [B, _t] = _(null), [vt, yt] = _({}), [bt, xt] = _(D), [St, Ct] = _(!1), [wt, V] = _(null), Tt = o(`vl-${b}-control`, Qe), H = o(`vl-${b}-panel`), Et = Te(() => i(st, Ce), [Ce]), U = g(() => {
63
- gt(!1), _t(null);
64
- }, []), Dt = Te(() => T ? x(j) ? [S(j[0], w), S(j[1], w)] : [null, null] : Array.isArray(j) ? null : S(j, w), [
65
- w,
66
- T,
67
- j
68
- ]), Ot = T ? Dt : null, W = T ? null : Dt, kt = Ae(j, w), At = pt, jt = c(pt, 1), G = S(ze, w), K = S(Be, w), Mt = He ? me(He) : null, Nt = Ue ? me(Ue) : null, Pt = Te(() => ({
69
- minSeconds: Mt,
70
- maxSeconds: Nt,
71
- disabledTime: We
72
- }), [
73
- We,
74
- Nt,
75
- Mt
76
- ]), q = g((e) => {
77
- let t = u(e);
78
- return !!(G && h(t, u(G)) < 0 || K && h(t, u(K)) > 0 || Ve?.(t));
79
- }, [
80
- Ve,
81
- K,
82
- G
83
- ]), J = g((e) => ue(e, Pt), [Pt]), Ft = g((e, t, n) => de(e, t, n, Pt), [Pt]), It = g((e) => C && J(l(e, "HH:mm:ss")), [J, C]), Y = g((e) => {
84
- if (!(e && (E || N)) && !(!e && !N)) {
85
- if (e) {
86
- let e = (T ? Ot?.[0] : W) ?? /* @__PURE__ */ new Date();
87
- P(ae(e)), T ? L(je(Ot ?? [null, null])) : mt(W ? d(W) : null), z("start"), Ct(!1), yt({}), xt(D), V(null), U(), ft(!0), it?.();
88
- } else V(null), U(), ft(!1), at?.();
89
- }
90
- }, [
91
- E,
92
- at,
93
- it,
94
- N,
95
- D,
96
- T,
97
- U,
98
- W,
99
- Ot
100
- ]), Lt = g(() => {
101
- if (!N || !k.current || !A.current) return;
102
- let e = k.current.getBoundingClientRect(), t = a({
103
- anchorRect: e,
104
- floatingRect: A.current.getBoundingClientRect(),
105
- placement: D,
106
- offset: Je
107
- });
108
- xt(t.placement), yt({
109
- left: `${Math.round(t.x)}px`,
110
- top: `${Math.round(t.y)}px`
111
- }), Ct(!0);
112
- }, [
113
- Je,
114
- N,
115
- D
116
- ]);
117
- e(() => {
118
- if (!N || !lt) return;
119
- Lt();
120
- let e = window.requestAnimationFrame(Lt);
121
- return () => window.cancelAnimationFrame(e);
122
- }, [
123
- lt,
124
- N,
125
- Lt
126
- ]), e(() => {
127
- if (!N || !wt) return;
128
- let e = A.current?.querySelector(`[data-time="${wt.getTime()}"]:not(:disabled)`);
129
- e && (e.focus(), V(null));
130
- }, [
131
- pt,
132
- wt,
133
- N
134
- ]);
135
- let Rt = g((e) => e.some((e) => e instanceof HTMLElement && (e.getAttribute(Oe) === H || e.classList.contains("vl-dropdown__panel") && e.querySelector(`[${Oe}]`)?.getAttribute(Oe) === H)), [H]), zt = g(() => Y(!1), [Y]), Bt = g(() => {
136
- ht || (Y(!1), k.current?.focus());
137
- }, [Y, ht]);
138
- ee({
139
- active: N,
140
- rootRef: st,
141
- floatingRef: A,
142
- isOwnedPopup: Rt,
143
- onOutsideClick: zt,
144
- onEscape: Bt,
145
- onViewportChange: Lt
146
- }), we(() => {
147
- E && N && Y(!1);
148
- }, [
149
- E,
150
- N,
151
- Y
152
- ]);
153
- let X = g((e) => Le === "string" ? l(e, w) : d(e), [w, Le]), Vt = g((e) => {
154
- let t = Ne(e, C);
155
- if (q(t) || C && J(l(t, "HH:mm:ss"))) return;
156
- let n = X(t);
157
- Pe(j, n, w) || (M(n), O?.(n)), Y(!1), k.current?.focus();
158
- }, [
159
- O,
160
- w,
161
- q,
162
- J,
163
- X,
164
- j,
165
- Y,
166
- M,
167
- C
168
- ]), Ht = g((e) => {
169
- if (!e[0] || !e[1]) return;
170
- let t = h(e[0], e[1]) <= 0 ? e : [e[1], e[0]], n = Ne(t[0], C), r = Ne(t[1], C);
171
- if (q(n) || q(r) || C && (J(l(n, "HH:mm:ss")) || J(l(r, "HH:mm:ss")))) return;
172
- let i = [X(n), X(r)];
173
- Pe(j, i, w) || (M(i), O?.(i)), Y(!1), k.current?.focus();
174
- }, [
175
- O,
176
- w,
177
- q,
178
- J,
179
- X,
180
- j,
181
- Y,
182
- M,
183
- C
184
- ]), Ut = (e) => {
185
- if (q(e)) return;
186
- let t = T ? I[R === "start" ? 0 : 1] : F, n = u(e);
187
- if (C) {
188
- if (t) n = le(e, t.getHours(), t.getMinutes(), t.getSeconds());
189
- else {
190
- let t = Ft(0, 86399, 0);
191
- n = t === null ? d(e) : le(e, Math.floor(t / 3600), Math.floor(t % 3600 / 60), t % 60);
192
- }
193
- }
194
- if (!T) {
195
- mt(n), C || Vt(n);
196
- return;
197
- }
198
- let [r, i] = I;
199
- if (!r || i) {
200
- L([n, null]), z("start");
201
- return;
202
- }
203
- h(n, r) < 0 ? (L([n, r]), z("end")) : (L([r, n]), z("end"));
204
- }, Z = g((e, t = !1) => {
205
- if (e && B) {
206
- if (T) {
207
- let e = je(I);
208
- e[R === "start" ? 0 : 1] = d(B), L(e);
209
- } else mt(d(B));
210
- }
211
- U(), t && window.requestAnimationFrame(() => ct.current?.focus());
212
- }, [
213
- R,
214
- I,
215
- T,
216
- U,
217
- B
218
- ]), Wt = (e, t) => {
219
- let n = B ? d(B) : /* @__PURE__ */ new Date(), r = {
220
- hours: n.getHours(),
221
- minutes: n.getMinutes(),
222
- seconds: n.getSeconds()
223
- }, { start: i, end: ee, preferred: a } = fe(e, t, r), o = Ft(i, ee, a);
224
- if (o === null) return;
225
- let s = le(n, Math.floor(o / 3600), Math.floor(o % 3600 / 60), o % 60);
226
- _t(s);
227
- }, Gt = (e) => {
228
- let t = e.getValue(/* @__PURE__ */ new Date());
229
- if (t === null) return;
230
- if (T) {
231
- if (!x(t)) return;
232
- let e = S(t[0], w), n = S(t[1], w);
233
- if (!e || !n || q(e) || q(n) || It(e) || It(n)) return;
234
- L(h(e, n) <= 0 ? [e, n] : [n, e]), z("end");
235
- return;
236
- }
237
- if (x(t)) return;
238
- let n = S(t, w);
239
- !n || q(n) || It(n) || Vt(n);
240
- }, Kt = (e) => {
241
- e?.stopPropagation(), !E && (M(null), O?.(null), rt?.(), mt(null), L([null, null]));
242
- }, Q = (e, t, n = !1) => {
243
- let r = n ? u(e) : m(u(e), t);
244
- for (let e = 0; e < 3660; e += 1) {
245
- if (t < 0 && G && h(r, u(G)) < 0 || t > 0 && K && h(r, u(K)) > 0) return null;
246
- if (!q(r)) return r;
247
- r = m(r, t);
248
- }
249
- return null;
250
- }, qt = (e) => {
251
- if (!E) {
252
- if (e.key === "Enter" || e.key === " ") {
253
- if (e.preventDefault(), N) Y(!1);
254
- else {
255
- let e = (T ? Ot?.[0] : W) ?? /* @__PURE__ */ new Date(), t = Q(e, 1, !0) ?? Q(e, -1, !0) ?? null;
256
- Y(!0), t && V(t);
257
- }
258
- } else e.key === "Escape" && N && (e.preventDefault(), Y(!1));
259
- }
260
- }, Jt = (e) => {
261
- !f(e, At) && !(T && f(e, jt)) && P(ae(e)), V(u(e));
262
- }, Yt = (e, t) => {
263
- let n = null;
264
- if (e.key === "ArrowLeft") n = Q(t, -1);
265
- else if (e.key === "ArrowRight") n = Q(t, 1);
266
- else if (e.key === "ArrowUp") n = Q(t, -7);
267
- else if (e.key === "ArrowDown") n = Q(t, 7);
268
- else if (e.key === "Home" || e.key === "End") {
269
- let r = e.key === "Home" ? m(t, -t.getDay()) : m(t, 6 - t.getDay()), i = e.key === "Home" ? 1 : -1;
270
- for (let e = 0; e < 7; e += 1) {
271
- let t = m(r, e * i);
272
- if (!q(t)) {
273
- n = t;
274
- break;
275
- }
276
- }
277
- }
278
- n && (e.preventDefault(), Jt(n));
279
- }, $ = T ? I[R === "start" ? 0 : 1] : F, Xt = g((e) => {
280
- if (e) {
281
- if (!$) return;
282
- _t(d($)), gt(!0);
283
- return;
284
- }
285
- Z(!1);
286
- }, [$, Z]), Zt = B ?? $ ?? /* @__PURE__ */ new Date(), Qt = Zt.getHours(), $t = Zt.getMinutes(), en = Zt.getSeconds(), tn = $ ? l(Zt, "HH:mm:ss") : "", nn = T ? R === "start" ? "开始时间" : "结束时间" : "时间", rn = g((e, t) => oe(e, t, {
287
- hours: Qt,
288
- minutes: $t,
289
- seconds: en
290
- }, Ft), [
291
- Ft,
292
- Qt,
293
- $t,
294
- en
295
- ]), an = T ? !!(I[0] && I[1] && !q(I[0]) && !q(I[1]) && (!C || !J(l(I[0], "HH:mm:ss")) && !J(l(I[1], "HH:mm:ss")))) : !!(F && !q(F) && (!C || !J(l(F, "HH:mm:ss")))), on = !!kt, sn = [
296
- `vl-${b}`,
297
- `size-${qe}`,
298
- N ? "is-open" : "",
299
- E ? "is-disabled" : "",
300
- T ? "is-range" : "",
301
- C ? "has-time" : "",
302
- Xe || ""
303
- ].filter(Boolean).join(" "), cn = (e) => {
304
- let t = ce(e), n = T ? I[0] : null, r = T ? I[1] : null, i = T ? null : F ?? W, ee = (T ? [I[0], I[1]] : [i]).find((t) => t && f(t, e) && !q(t)) ?? t.find((t) => f(t, e) && !q(t));
305
- return /* @__PURE__ */ y("section", {
306
- className: `vl-${b}__calendar`,
307
- "aria-label": Me(e),
308
- children: [
309
- T ? /* @__PURE__ */ v("div", {
310
- className: `vl-${b}__month-title`,
311
- children: Me(e)
312
- }) : null,
313
- /* @__PURE__ */ v("div", {
314
- className: `vl-${b}__weekdays`,
315
- role: "row",
316
- children: ke.map((e) => /* @__PURE__ */ v("span", {
317
- role: "columnheader",
318
- children: e
319
- }, e))
320
- }),
321
- /* @__PURE__ */ v("div", {
322
- className: `vl-${b}__grid`,
323
- role: "grid",
324
- children: t.map((t) => {
325
- let a = !f(t, e), o = a || q(t), s = !!(n && r && h(t, u(n)) >= 0 && h(t, u(r)) <= 0), te = [
326
- `vl-${b}__day`,
327
- a ? "is-other-month" : "",
328
- p(t, /* @__PURE__ */ new Date()) ? "is-today" : "",
329
- T && n && p(t, n) ? "is-range-start is-selected" : "",
330
- T && r && p(t, r) ? "is-range-end is-selected" : "",
331
- i && p(t, i) ? "is-selected" : "",
332
- s ? "is-in-range" : "",
333
- o ? "is-disabled" : ""
334
- ].filter(Boolean).join(" ");
335
- return /* @__PURE__ */ v("button", {
336
- type: "button",
337
- className: te,
338
- role: "gridcell",
339
- "data-time": t.getTime(),
340
- "aria-label": `${t.getFullYear()}年${t.getMonth() + 1}月${t.getDate()}日`,
341
- "aria-selected": T ? s : !!(i && p(t, i)),
342
- "aria-current": p(t, /* @__PURE__ */ new Date()) ? "date" : void 0,
343
- "aria-hidden": a || void 0,
344
- "aria-disabled": o || void 0,
345
- disabled: o,
346
- tabIndex: !o && ee && p(t, ee) ? 0 : -1,
347
- onClick: () => Ut(t),
348
- onKeyDown: (e) => Yt(e, t),
349
- children: t.getDate()
350
- }, t.toISOString());
351
- })
352
- })
353
- ]
354
- });
355
- }, ln = /* @__PURE__ */ v(re, {
356
- show: N,
357
- name: `vl-${b}`,
358
- deferEffects: !lt,
359
- children: /* @__PURE__ */ y("div", {
360
- ref: A,
361
- id: H,
362
- className: `vl-${b}__panel is-${bt}${St ? " is-positioned" : ""}`,
363
- style: {
364
- ...vt,
365
- zIndex: ut.zIndex,
366
- visibility: St ? "visible" : "hidden"
367
- },
368
- role: "dialog",
369
- "aria-label": T ? "日期范围选择" : C ? "日期时间选择" : "日期选择",
370
- children: [
371
- /* @__PURE__ */ y("div", {
372
- className: `vl-${b}__header`,
373
- children: [
374
- /* @__PURE__ */ y("div", {
375
- className: `vl-${b}__header-actions`,
376
- children: [/* @__PURE__ */ v("button", {
377
- type: "button",
378
- "aria-label": "上一年",
379
- onClick: () => P((e) => c(e, -12)),
380
- children: /* @__PURE__ */ v(ye, {
381
- size: 16,
382
- "aria-hidden": "true"
383
- })
384
- }), /* @__PURE__ */ v("button", {
385
- type: "button",
386
- "aria-label": "上一个月",
387
- onClick: () => P((e) => c(e, -1)),
388
- children: /* @__PURE__ */ v(_e, {
389
- size: 16,
390
- "aria-hidden": "true"
391
- })
392
- })]
393
- }),
394
- T ? null : /* @__PURE__ */ v("span", { children: Me(At) }),
395
- /* @__PURE__ */ y("div", {
396
- className: `vl-${b}__header-actions`,
397
- children: [/* @__PURE__ */ v("button", {
398
- type: "button",
399
- "aria-label": "下一个月",
400
- onClick: () => P((e) => c(e, 1)),
401
- children: /* @__PURE__ */ v(ve, {
402
- size: 16,
403
- "aria-hidden": "true"
404
- })
405
- }), /* @__PURE__ */ v("button", {
406
- type: "button",
407
- "aria-label": "下一年",
408
- onClick: () => P((e) => c(e, 12)),
409
- children: /* @__PURE__ */ v(be, {
410
- size: 16,
411
- "aria-hidden": "true"
412
- })
413
- })]
414
- })
415
- ]
416
- }),
417
- /* @__PURE__ */ y("div", {
418
- className: `vl-${b}__calendars`,
419
- children: [cn(At), T ? cn(jt) : null]
420
- }),
421
- C ? /* @__PURE__ */ v("div", {
422
- className: `vl-${b}__time`,
423
- children: /* @__PURE__ */ y("div", {
424
- className: `vl-${b}__time-toolbar`,
425
- children: [
426
- /* @__PURE__ */ v("span", {
427
- className: `vl-${b}__time-title`,
428
- children: "时间"
429
- }),
430
- T ? /* @__PURE__ */ y("div", {
431
- className: `vl-${b}__time-range`,
432
- children: [/* @__PURE__ */ v("button", {
433
- type: "button",
434
- className: R === "start" ? "is-active" : "",
435
- "aria-pressed": R === "start",
436
- disabled: !I[0],
437
- onClick: () => {
438
- Z(!1), z("start");
439
- },
440
- children: "开始时间"
441
- }), /* @__PURE__ */ v("button", {
442
- type: "button",
443
- className: R === "end" ? "is-active" : "",
444
- "aria-pressed": R === "end",
445
- disabled: !I[1],
446
- onClick: () => {
447
- Z(!1), z("end");
448
- },
449
- children: "结束时间"
450
- })]
451
- }) : null,
452
- /* @__PURE__ */ v(he, {
453
- className: `vl-${b}__time-dropdown`,
454
- open: ht,
455
- disabled: !$,
456
- trigger: "click",
457
- placement: "bottom-end",
458
- offset: 4,
459
- closeOnContentClick: !1,
460
- "aria-label": nn,
461
- menuLabel: `${nn}选择器`,
462
- triggerContent: /* @__PURE__ */ v(ie, {
463
- ref: ct,
464
- className: `vl-${b}__time-input`,
465
- value: tn,
466
- placeholder: "请先选择日期",
467
- size: "sm",
468
- suffixIcon: xe,
469
- readOnly: !0,
470
- disabled: !$
471
- }),
472
- onChange: Xt,
473
- children: /* @__PURE__ */ y("div", {
474
- className: `vl-${b}__time-popover`,
475
- [Oe]: H,
476
- children: [/* @__PURE__ */ v(pe, {
477
- value: {
478
- hours: Qt,
479
- minutes: $t,
480
- seconds: en
481
- },
482
- disabled: !$,
483
- ariaLabel: nn,
484
- visibleItemCount: 3,
485
- itemHeight: 30,
486
- isOptionDisabled: rn,
487
- onChange: Wt
488
- }), /* @__PURE__ */ y("div", {
489
- className: `vl-${b}__footer`,
490
- children: [/* @__PURE__ */ v("button", {
491
- type: "button",
492
- className: "is-cancel",
493
- "aria-label": "取消时间",
494
- onClick: () => Z(!1, !0),
495
- children: "取消"
496
- }), /* @__PURE__ */ v("button", {
497
- type: "button",
498
- className: "is-confirm",
499
- "aria-label": "确定时间",
500
- disabled: !B,
501
- onClick: () => Z(!0, !0),
502
- children: "确定"
503
- })]
504
- })]
505
- })
506
- })
507
- ]
508
- })
509
- }) : null,
510
- Re.length ? /* @__PURE__ */ v("div", {
511
- className: `vl-${b}__shortcuts`,
512
- role: "group",
513
- "aria-label": "快捷选择",
514
- children: Re.map((e) => /* @__PURE__ */ v("button", {
515
- type: "button",
516
- onClick: () => Gt(e),
517
- children: e.label
518
- }, e.label))
519
- }) : null,
520
- T || C ? /* @__PURE__ */ y("div", {
521
- className: `vl-${b}__footer`,
522
- children: [/* @__PURE__ */ v("button", {
523
- type: "button",
524
- className: "is-cancel",
525
- onClick: () => {
526
- Y(!1), k.current?.focus();
527
- },
528
- children: "取消"
529
- }), /* @__PURE__ */ v("button", {
530
- type: "button",
531
- className: "is-confirm",
532
- disabled: !an,
533
- onClick: () => {
534
- T ? Ht(I) : F && Vt(F);
535
- },
536
- children: "确定"
537
- })]
538
- }) : null
539
- ]
540
- })
541
- });
542
- return /* @__PURE__ */ v(ne, {
543
- layer: ut.layer,
544
- children: /* @__PURE__ */ y("div", {
545
- ref: Et,
546
- className: `vl-${b}-wrapper`,
547
- style: Ze,
548
- ...ot,
549
- children: [/* @__PURE__ */ y("div", {
550
- ref: k,
551
- id: Tt,
552
- className: sn,
553
- role: "combobox",
554
- "aria-expanded": N,
555
- "aria-controls": H,
556
- "aria-haspopup": "dialog",
557
- "aria-disabled": E || void 0,
558
- "aria-label": $e ?? (et ? void 0 : Ge),
559
- "aria-labelledby": et,
560
- "aria-describedby": tt,
561
- tabIndex: E ? -1 : 0,
562
- onClick: () => Y(!N),
563
- onKeyDown: qt,
564
- children: [
565
- /* @__PURE__ */ v("span", {
566
- className: `vl-${b}__icon`,
567
- "aria-hidden": "true",
568
- children: /* @__PURE__ */ v(ge, { size: 16 })
569
- }),
570
- /* @__PURE__ */ v("span", {
571
- className: `vl-${b}__value${kt ? "" : " is-placeholder"}`,
572
- children: kt || Ge
573
- }),
574
- Ke && on && !E ? /* @__PURE__ */ v("button", {
575
- type: "button",
576
- className: `vl-${b}__clear`,
577
- "aria-label": "清除已选",
578
- onClick: Kt,
579
- onMouseDown: (e) => e.preventDefault(),
580
- children: /* @__PURE__ */ v(Se, {
581
- size: 16,
582
- "aria-hidden": "true"
583
- })
584
- }) : null
585
- ]
586
- }), lt ? De(ln, document.body) : ln]
587
- })
588
- });
589
- });
590
- C.displayName = "VlDatePickerCore";
591
- //#endregion
592
- export { C as t };
@@ -1 +0,0 @@
1
- const e=require("./effect-BpNxm_06.cjs"),t=require("./state-ZBA75xZ_.cjs"),n=require("./client-BkoqeUs3.cjs"),r=require("./refs-DCqd87V8.cjs"),i=require("./floating-DXRnx48N.cjs"),a=require("./id-CF0zOP1G.cjs"),o=require("./layer-BgiUZy_t.cjs"),s=require("./Transition-X_89ga-e.cjs"),c=require("./Input-CoDZggqc.cjs"),l=require("./time-wheel-BaCcA9nk.cjs"),ee=require("./Dropdown-BsXYVdt6.cjs");let u=require("lucide-react"),d=require("react"),f=require("react/jsx-runtime"),te=require("react-dom");var p=`data-vl-date-picker-popup-owner`,ne=[`日`,`一`,`二`,`三`,`四`,`五`,`六`],re=[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],m=e=>Array.isArray(e)&&e.length===2,h=(e,t)=>l.b(e,t),ie=(e,t)=>{if(m(e)){let n=h(e[0],t),r=h(e[1],t);return n&&r?`${l.d(n,t)} ~ ${l.d(r,t)}`:``}let n=h(e,t);return n?l.d(n,t):``},ae=e=>[e[0]?l.l(e[0]):null,e[1]?l.l(e[1]):null],oe=e=>`${e.getFullYear()}年 ${re[e.getMonth()]}`,se=(e,t)=>t?l.l(e):l.g(e),ce=(e,t,n)=>{let r=e=>{let t=h(e,n);return t?t.getTime():null};return m(e)||m(t)?!m(e)||!m(t)?!1:r(e[0])===r(t[0])&&r(e[1])===r(t[1]):r(e)===r(t)},g=(0,d.forwardRef)((re,g)=>{let{componentName:_,withTime:v=!1,value:le,defaultValue:ue,valueType:de=`date`,format:y=v?`YYYY-MM-DD HH:mm:ss`:`YYYY-MM-DD`,range:b=!1,shortcuts:fe=[],minDate:pe,maxDate:me,disabledDate:he,minTime:ge,maxTime:_e,disabledTime:ve,placeholder:ye=b?`请选择日期范围`:v?`请选择日期时间`:`请选择日期`,disabled:x=!1,clearable:be=!1,size:xe=`md`,placement:S=`bottom-start`,offset:Se=8,zIndex:Ce,className:we,style:Te,id:Ee,"aria-label":De,"aria-labelledby":Oe,"aria-describedby":ke,onChange:Ae,onClear:je,onOpen:Me,onClose:Ne,...Pe}=re,C=Ae,Fe=(0,d.useRef)(null),w=(0,d.useRef)(null),T=(0,d.useRef)(null),Ie=(0,d.useRef)(null),E=n.t(),Le=o.r({defaultZIndex:o.n.popover,zIndex:Ce}),Re=t.t(re,`value`),[D,O]=t.n({value:le??null,defaultValue:ue??null,controlled:Re}),[k,ze]=(0,d.useState)(!1),[Be,A]=(0,d.useState)(()=>{let e=m(D)?h(D[0],y):h(D,y);return l._(e??new Date)}),[j,M]=(0,d.useState)(null),[N,P]=(0,d.useState)([null,null]),[F,I]=(0,d.useState)(`start`),[Ve,He]=(0,d.useState)(!1),[L,Ue]=(0,d.useState)(null),[We,Ge]=(0,d.useState)({}),[Ke,qe]=(0,d.useState)(S),[Je,Ye]=(0,d.useState)(!1),[Xe,R]=(0,d.useState)(null),Ze=a.t(`vl-${_}-control`,Ee),z=a.t(`vl-${_}-panel`),Qe=(0,d.useMemo)(()=>r.n(Fe,g),[g]),B=(0,d.useCallback)(()=>{He(!1),Ue(null)},[]),$e=(0,d.useMemo)(()=>b?m(D)?[h(D[0],y),h(D[1],y)]:[null,null]:Array.isArray(D)?null:h(D,y),[y,b,D]),V=b?$e:null,H=b?null:$e,et=ie(D,y),tt=Be,nt=l.c(Be,1),U=h(pe,y),W=h(me,y),rt=ge?l.y(ge):null,it=_e?l.y(_e):null,G=(0,d.useMemo)(()=>({minSeconds:rt,maxSeconds:it,disabledTime:ve}),[ve,it,rt]),K=(0,d.useCallback)(e=>{let t=l.g(e);return!!(U&&l.u(t,l.g(U))<0||W&&l.u(t,l.g(W))>0||he?.(t))},[he,W,U]),q=(0,d.useCallback)(e=>l.i(e,G),[G]),at=(0,d.useCallback)((e,t,n)=>l.n(e,t,n,G),[G]),ot=(0,d.useCallback)(e=>v&&q(l.d(e,`HH:mm:ss`)),[q,v]),J=(0,d.useCallback)(e=>{if(!(e&&(x||k))&&!(!e&&!k)){if(e){let e=(b?V?.[0]:H)??new Date;A(l._(e)),b?P(ae(V??[null,null])):M(H?l.l(H):null),I(`start`),Ye(!1),Ge({}),qe(S),R(null),B(),ze(!0),Me?.()}else R(null),B(),ze(!1),Ne?.()}},[x,Ne,Me,k,S,b,B,H,V]),st=(0,d.useCallback)(()=>{if(!k||!w.current||!T.current)return;let e=w.current.getBoundingClientRect(),t=i.t({anchorRect:e,floatingRect:T.current.getBoundingClientRect(),placement:S,offset:Se});qe(t.placement),Ge({left:`${Math.round(t.x)}px`,top:`${Math.round(t.y)}px`}),Ye(!0)},[Se,k,S]);e.t(()=>{if(!k||!E)return;st();let e=window.requestAnimationFrame(st);return()=>window.cancelAnimationFrame(e)},[E,k,st]),e.t(()=>{if(!k||!Xe)return;let e=T.current?.querySelector(`[data-time="${Xe.getTime()}"]:not(:disabled)`);e&&(e.focus(),R(null))},[Be,Xe,k]);let ct=(0,d.useCallback)(e=>e.some(e=>e instanceof HTMLElement&&(e.getAttribute(p)===z||e.classList.contains(`vl-dropdown__panel`)&&e.querySelector(`[${p}]`)?.getAttribute(p)===z)),[z]),lt=(0,d.useCallback)(()=>J(!1),[J]),ut=(0,d.useCallback)(()=>{Ve||(J(!1),w.current?.focus())},[J,Ve]);i.r({active:k,rootRef:Fe,floatingRef:T,isOwnedPopup:ct,onOutsideClick:lt,onEscape:ut,onViewportChange:st}),(0,d.useEffect)(()=>{x&&k&&J(!1)},[x,k,J]);let Y=(0,d.useCallback)(e=>de===`string`?l.d(e,y):l.l(e),[y,de]),dt=(0,d.useCallback)(e=>{let t=se(e,v);if(K(t)||v&&q(l.d(t,`HH:mm:ss`)))return;let n=Y(t);ce(D,n,y)||(O(n),C?.(n)),J(!1),w.current?.focus()},[C,y,K,q,Y,D,J,O,v]),ft=(0,d.useCallback)(e=>{if(!e[0]||!e[1])return;let t=l.u(e[0],e[1])<=0?e:[e[1],e[0]],n=se(t[0],v),r=se(t[1],v);if(K(n)||K(r)||v&&(q(l.d(n,`HH:mm:ss`))||q(l.d(r,`HH:mm:ss`))))return;let i=[Y(n),Y(r)];ce(D,i,y)||(O(i),C?.(i)),J(!1),w.current?.focus()},[C,y,K,q,Y,D,J,O,v]),pt=e=>{if(K(e))return;let t=b?N[F===`start`?0:1]:j,n=l.g(e);if(v){if(t)n=l.h(e,t.getHours(),t.getMinutes(),t.getSeconds());else{let t=at(0,86399,0);n=t===null?l.l(e):l.h(e,Math.floor(t/3600),Math.floor(t%3600/60),t%60)}}if(!b){M(n),v||dt(n);return}let[r,i]=N;if(!r||i){P([n,null]),I(`start`);return}l.u(n,r)<0?(P([n,r]),I(`end`)):(P([r,n]),I(`end`))},X=(0,d.useCallback)((e,t=!1)=>{if(e&&L){if(b){let e=ae(N);e[F===`start`?0:1]=l.l(L),P(e)}else M(l.l(L))}B(),t&&window.requestAnimationFrame(()=>Ie.current?.focus())},[F,N,b,B,L]),mt=(e,t)=>{let n=L?l.l(L):new Date,r={hours:n.getHours(),minutes:n.getMinutes(),seconds:n.getSeconds()},{start:i,end:a,preferred:o}=l.r(e,t,r),s=at(i,a,o);if(s===null)return;let c=l.h(n,Math.floor(s/3600),Math.floor(s%3600/60),s%60);Ue(c)},ht=e=>{let t=e.getValue(new Date);if(t===null)return;if(b){if(!m(t))return;let e=h(t[0],y),n=h(t[1],y);if(!e||!n||K(e)||K(n)||ot(e)||ot(n))return;P(l.u(e,n)<=0?[e,n]:[n,e]),I(`end`);return}if(m(t))return;let n=h(t,y);!n||K(n)||ot(n)||dt(n)},gt=e=>{e?.stopPropagation(),!x&&(O(null),C?.(null),je?.(),M(null),P([null,null]))},Z=(e,t,n=!1)=>{let r=n?l.g(e):l.s(l.g(e),t);for(let e=0;e<3660;e+=1){if(t<0&&U&&l.u(r,l.g(U))<0||t>0&&W&&l.u(r,l.g(W))>0)return null;if(!K(r))return r;r=l.s(r,t)}return null},_t=e=>{if(!x){if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),k)J(!1);else{let e=(b?V?.[0]:H)??new Date,t=Z(e,1,!0)??Z(e,-1,!0)??null;J(!0),t&&R(t)}}else e.key===`Escape`&&k&&(e.preventDefault(),J(!1))}},vt=e=>{!l.m(e,tt)&&!(b&&l.m(e,nt))&&A(l._(e)),R(l.g(e))},yt=(e,t)=>{let n=null;if(e.key===`ArrowLeft`)n=Z(t,-1);else if(e.key===`ArrowRight`)n=Z(t,1);else if(e.key===`ArrowUp`)n=Z(t,-7);else if(e.key===`ArrowDown`)n=Z(t,7);else if(e.key===`Home`||e.key===`End`){let r=e.key===`Home`?l.s(t,-t.getDay()):l.s(t,6-t.getDay()),i=e.key===`Home`?1:-1;for(let e=0;e<7;e+=1){let t=l.s(r,e*i);if(!K(t)){n=t;break}}}n&&(e.preventDefault(),vt(n))},Q=b?N[F===`start`?0:1]:j,bt=(0,d.useCallback)(e=>{if(e){if(!Q)return;Ue(l.l(Q)),He(!0);return}X(!1)},[Q,X]),$=L??Q??new Date,xt=$.getHours(),St=$.getMinutes(),Ct=$.getSeconds(),wt=Q?l.d($,`HH:mm:ss`):``,Tt=b?F===`start`?`开始时间`:`结束时间`:`时间`,Et=(0,d.useCallback)((e,t)=>l.a(e,t,{hours:xt,minutes:St,seconds:Ct},at),[at,xt,St,Ct]),Dt=b?!!(N[0]&&N[1]&&!K(N[0])&&!K(N[1])&&(!v||!q(l.d(N[0],`HH:mm:ss`))&&!q(l.d(N[1],`HH:mm:ss`)))):!!(j&&!K(j)&&(!v||!q(l.d(j,`HH:mm:ss`)))),Ot=!!et,kt=[`vl-${_}`,`size-${xe}`,k?`is-open`:``,x?`is-disabled`:``,b?`is-range`:``,v?`has-time`:``,we||``].filter(Boolean).join(` `),At=e=>{let t=l.f(e),n=b?N[0]:null,r=b?N[1]:null,i=b?null:j??H,a=(b?[N[0],N[1]]:[i]).find(t=>t&&l.m(t,e)&&!K(t))??t.find(t=>l.m(t,e)&&!K(t));return(0,f.jsxs)(`section`,{className:`vl-${_}__calendar`,"aria-label":oe(e),children:[b?(0,f.jsx)(`div`,{className:`vl-${_}__month-title`,children:oe(e)}):null,(0,f.jsx)(`div`,{className:`vl-${_}__weekdays`,role:`row`,children:ne.map(e=>(0,f.jsx)(`span`,{role:`columnheader`,children:e},e))}),(0,f.jsx)(`div`,{className:`vl-${_}__grid`,role:`grid`,children:t.map(t=>{let o=!l.m(t,e),s=o||K(t),c=!!(n&&r&&l.u(t,l.g(n))>=0&&l.u(t,l.g(r))<=0),ee=[`vl-${_}__day`,o?`is-other-month`:``,l.p(t,new Date)?`is-today`:``,b&&n&&l.p(t,n)?`is-range-start is-selected`:``,b&&r&&l.p(t,r)?`is-range-end is-selected`:``,i&&l.p(t,i)?`is-selected`:``,c?`is-in-range`:``,s?`is-disabled`:``].filter(Boolean).join(` `);return(0,f.jsx)(`button`,{type:`button`,className:ee,role:`gridcell`,"data-time":t.getTime(),"aria-label":`${t.getFullYear()}年${t.getMonth()+1}月${t.getDate()}日`,"aria-selected":b?c:!!(i&&l.p(t,i)),"aria-current":l.p(t,new Date)?`date`:void 0,"aria-hidden":o||void 0,"aria-disabled":s||void 0,disabled:s,tabIndex:!s&&a&&l.p(t,a)?0:-1,onClick:()=>pt(t),onKeyDown:e=>yt(e,t),children:t.getDate()},t.toISOString())})})]})},jt=(0,f.jsx)(s.t,{show:k,name:`vl-${_}`,deferEffects:!E,children:(0,f.jsxs)(`div`,{ref:T,id:z,className:`vl-${_}__panel is-${Ke}${Je?` is-positioned`:``}`,style:{...We,zIndex:Le.zIndex,visibility:Je?`visible`:`hidden`},role:`dialog`,"aria-label":b?`日期范围选择`:v?`日期时间选择`:`日期选择`,children:[(0,f.jsxs)(`div`,{className:`vl-${_}__header`,children:[(0,f.jsxs)(`div`,{className:`vl-${_}__header-actions`,children:[(0,f.jsx)(`button`,{type:`button`,"aria-label":`上一年`,onClick:()=>A(e=>l.c(e,-12)),children:(0,f.jsx)(u.ChevronsLeft,{size:16,"aria-hidden":`true`})}),(0,f.jsx)(`button`,{type:`button`,"aria-label":`上一个月`,onClick:()=>A(e=>l.c(e,-1)),children:(0,f.jsx)(u.ChevronLeft,{size:16,"aria-hidden":`true`})})]}),b?null:(0,f.jsx)(`span`,{children:oe(tt)}),(0,f.jsxs)(`div`,{className:`vl-${_}__header-actions`,children:[(0,f.jsx)(`button`,{type:`button`,"aria-label":`下一个月`,onClick:()=>A(e=>l.c(e,1)),children:(0,f.jsx)(u.ChevronRight,{size:16,"aria-hidden":`true`})}),(0,f.jsx)(`button`,{type:`button`,"aria-label":`下一年`,onClick:()=>A(e=>l.c(e,12)),children:(0,f.jsx)(u.ChevronsRight,{size:16,"aria-hidden":`true`})})]})]}),(0,f.jsxs)(`div`,{className:`vl-${_}__calendars`,children:[At(tt),b?At(nt):null]}),v?(0,f.jsx)(`div`,{className:`vl-${_}__time`,children:(0,f.jsxs)(`div`,{className:`vl-${_}__time-toolbar`,children:[(0,f.jsx)(`span`,{className:`vl-${_}__time-title`,children:`时间`}),b?(0,f.jsxs)(`div`,{className:`vl-${_}__time-range`,children:[(0,f.jsx)(`button`,{type:`button`,className:F===`start`?`is-active`:``,"aria-pressed":F===`start`,disabled:!N[0],onClick:()=>{X(!1),I(`start`)},children:`开始时间`}),(0,f.jsx)(`button`,{type:`button`,className:F===`end`?`is-active`:``,"aria-pressed":F===`end`,disabled:!N[1],onClick:()=>{X(!1),I(`end`)},children:`结束时间`})]}):null,(0,f.jsx)(ee.t,{className:`vl-${_}__time-dropdown`,open:Ve,disabled:!Q,trigger:`click`,placement:`bottom-end`,offset:4,closeOnContentClick:!1,"aria-label":Tt,menuLabel:`${Tt}选择器`,triggerContent:(0,f.jsx)(c.t,{ref:Ie,className:`vl-${_}__time-input`,value:wt,placeholder:`请先选择日期`,size:`sm`,suffixIcon:u.Clock3,readOnly:!0,disabled:!Q}),onChange:bt,children:(0,f.jsxs)(`div`,{className:`vl-${_}__time-popover`,[p]:z,children:[(0,f.jsx)(l.t,{value:{hours:xt,minutes:St,seconds:Ct},disabled:!Q,ariaLabel:Tt,visibleItemCount:3,itemHeight:30,isOptionDisabled:Et,onChange:mt}),(0,f.jsxs)(`div`,{className:`vl-${_}__footer`,children:[(0,f.jsx)(`button`,{type:`button`,className:`is-cancel`,"aria-label":`取消时间`,onClick:()=>X(!1,!0),children:`取消`}),(0,f.jsx)(`button`,{type:`button`,className:`is-confirm`,"aria-label":`确定时间`,disabled:!L,onClick:()=>X(!0,!0),children:`确定`})]})]})})]})}):null,fe.length?(0,f.jsx)(`div`,{className:`vl-${_}__shortcuts`,role:`group`,"aria-label":`快捷选择`,children:fe.map(e=>(0,f.jsx)(`button`,{type:`button`,onClick:()=>ht(e),children:e.label},e.label))}):null,b||v?(0,f.jsxs)(`div`,{className:`vl-${_}__footer`,children:[(0,f.jsx)(`button`,{type:`button`,className:`is-cancel`,onClick:()=>{J(!1),w.current?.focus()},children:`取消`}),(0,f.jsx)(`button`,{type:`button`,className:`is-confirm`,disabled:!Dt,onClick:()=>{b?ft(N):j&&dt(j)},children:`确定`})]}):null]})});return(0,f.jsx)(o.t,{layer:Le.layer,children:(0,f.jsxs)(`div`,{ref:Qe,className:`vl-${_}-wrapper`,style:Te,...Pe,children:[(0,f.jsxs)(`div`,{ref:w,id:Ze,className:kt,role:`combobox`,"aria-expanded":k,"aria-controls":z,"aria-haspopup":`dialog`,"aria-disabled":x||void 0,"aria-label":De??(Oe?void 0:ye),"aria-labelledby":Oe,"aria-describedby":ke,tabIndex:x?-1:0,onClick:()=>J(!k),onKeyDown:_t,children:[(0,f.jsx)(`span`,{className:`vl-${_}__icon`,"aria-hidden":`true`,children:(0,f.jsx)(u.CalendarDays,{size:16})}),(0,f.jsx)(`span`,{className:`vl-${_}__value${et?``:` is-placeholder`}`,children:et||ye}),be&&Ot&&!x?(0,f.jsx)(`button`,{type:`button`,className:`vl-${_}__clear`,"aria-label":`清除已选`,onClick:gt,onMouseDown:e=>e.preventDefault(),children:(0,f.jsx)(u.X,{size:16,"aria-hidden":`true`})}):null]}),E?(0,te.createPortal)(jt,document.body):jt]})})});g.displayName=`VlDatePickerCore`,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}});
@@ -1 +0,0 @@
1
- const e=require("./Transition-X_89ga-e.cjs"),t=require("./focus-D-h8CbGr.cjs");let n=require("react"),r=require("react/jsx-runtime"),i=require("react-dom");var a=[],o=new Set,s=0,c=0,l=``,u=``,d=``,f=e=>(a.push(e),o.forEach(e=>e()),()=>{let t=a.lastIndexOf(e);t>=0&&a.splice(t,1),o.forEach(e=>e())}),p=e=>a.at(-1)===e,m=()=>{if(s===0){l=document.body.style.overflow,u=document.body.style.paddingRight;let e=document.documentElement.clientWidth,t=e>0?Math.max(0,window.innerWidth-e):0;if(t>0){let e=Number.parseFloat(window.getComputedStyle(document.body).paddingRight)||0;document.body.style.paddingRight=`${e+t}px`}document.body.style.overflow=`hidden`}s+=1;let e=!1;return()=>{e||(e=!0,s=Math.max(0,s-1),s===0&&(document.body.style.overflow=l,document.body.style.paddingRight=u))}},h=()=>{c===0&&(d=document.body.style.userSelect,document.body.style.userSelect=`none`),c+=1;let e=!1;return()=>{e||(e=!0,c=Math.max(0,c-1),c===0&&(document.body.style.userSelect=d))}},g=({active:e,containerRef:r,closeOnPressEscape:i,lockScroll:a,onRequestClose:s})=>{let c=(0,n.useRef)(Symbol(`vl-dialog`)),l=(0,n.useRef)(null),u=(0,n.useCallback)(()=>p(c.current),[]);return(0,n.useEffect)(()=>{if(!e)return;let n=c.current;l.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let u=f(n),d=a?m():()=>{},h=()=>{let e=r.current;e&&t.r(e)},g=window.requestAnimationFrame(h),_=()=>{p(n)&&(r.current?.contains(document.activeElement)||window.requestAnimationFrame(h))};o.add(_);let v=e=>{if(!p(n))return;if(e.key===`Escape`&&i){e.preventDefault(),s();return}if(e.key!==`Tab`)return;let a=r.current;if(!a)return;let o=t.a(a);if(!o.length){e.preventDefault(),a.focus({preventScroll:!0});return}let c=o[0],l=o.at(-1)??c,u=document.activeElement;e.shiftKey&&(u===c||!a.contains(u))?(e.preventDefault(),l.focus()):!e.shiftKey&&(u===l||!a.contains(u))&&(e.preventDefault(),c.focus())},y=e=>{if(!p(n))return;let i=r.current;!i||i.contains(e.target)||t.r(i)};return document.addEventListener(`keydown`,v),document.addEventListener(`focusin`,y),()=>{window.cancelAnimationFrame(g),document.removeEventListener(`keydown`,v),document.removeEventListener(`focusin`,y),o.delete(_),u(),d();let e=l.current;l.current=null,window.requestAnimationFrame(()=>{e?.isConnected&&e.focus({preventScroll:!0})})}},[e,i,r,a,s]),{isTopLayer:u}},_=({clientReady:t,open:n,mask:a,destroyOnClose:o,maskUnmountOnExit:s=!1,maskTransitionName:c,transitionName:l,maskClassName:u,panelClassName:d,panelStyle:f,maskStyle:p,panelRef:m,role:h,ariaModal:g=!0,ariaLabel:_,ariaLabelledBy:v,ariaDescribedBy:y,onMaskClick:b,onPanelClick:x,onAfterLeave:S,panelProps:C,children:w})=>t?(0,i.createPortal)((0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e.t,{show:n&&a,name:c,unmountOnExit:s,children:(0,r.jsx)(`div`,{className:u,style:p,"aria-hidden":`true`,onClick:b})}),(0,r.jsx)(e.t,{show:n,name:l,unmountOnExit:o,onAfterLeave:S,children:(0,r.jsx)(`div`,{ref:m,className:d,style:f,role:h,"aria-modal":g,"aria-label":_,"aria-labelledby":v,"aria-describedby":y,"aria-hidden":!n||void 0,tabIndex:-1,onClick:x,...C,children:w})})]}),document.body):null;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return _}});
@@ -1 +0,0 @@
1
- const e=require("./Alert-tPSJmCXK.cjs"),t=require("./Anchor-iriRYxEs.cjs"),n=require("./Announcement-XjJyJ28N.cjs"),r=require("./Button-qURrKHQ0.cjs"),i=require("./Card-BkZhLXQ5.cjs"),a=require("./Checkbox-CQZSg9Xu.cjs"),o=require("./Col-qcq7T83y.cjs"),s=require("./Transition-X_89ga-e.cjs"),c=require("./Input-CoDZggqc.cjs"),l=require("./Tabs-BhjvKN84.cjs"),u=require("./NumberInput-CYVj89_s.cjs"),d=require("./Cron-3D9GmlYf.cjs"),f=require("./Dropdown-BsXYVdt6.cjs"),p=require("./DatePicker-CoHW85qm.cjs"),m=require("./DateTimePicker-CAkdoY--.cjs"),h=require("./Divider-BnmUNmy2.cjs"),g=require("./Drawer-D45miZ27.cjs"),_=require("./Empty-Dny96c3p.cjs"),v=require("./Form-7un_DeDk.cjs"),y=require("./Loading-C2pY-4fA.cjs"),b=require("./Modal-i_Do8GsG.cjs"),x=require("./MessageBox-CTJfdU29.cjs"),S=require("./Select-BRKxpX-_.cjs"),C=require("./Pagination-ODU-i3gn.cjs"),w=require("./Progress-DTAjlgwZ.cjs"),T=require("./cjs/Radio.cjs"),E=require("./cjs/Row.cjs"),D=require("./Scrollbar-CEQT6Ao_.cjs"),O=require("./Sidebar-BPXVnP7y.cjs"),k=require("./Slider-DCIUxcBa.cjs"),A=require("./Space-DJGRG2rt.cjs"),j=require("./Switch-7yJ-Q_o_.cjs"),M=require("./Tooltip-CP8rpNYG.cjs"),N=require("./Table-Bqjey5fw.cjs"),P=require("./Tag-Cf9M_HT6.cjs"),F=require("./Textarea-C2dNYM0F.cjs"),I=require("./Timeline-ROggEQnD.cjs"),L=require("./TimePicker-Cpmvn8tx.cjs"),R=require("./Upload-bxJz2avf.cjs");var z={VlAlert:e.n,VlAnchor:t.n,VlAnnouncement:n.n,VlButton:r.n,VlCard:i.n,VlCheckbox:a.n,VlCol:o.n,VlCron:d.n,VlDatePicker:p.n,VlDateTimePicker:m.n,VlDivider:h.n,VlDrawer:g.n,VlDropdown:f.n,VlEmpty:_.n,VlForm:v.t,VlInput:c.n,VlLoading:y.n,VlMessageBox:x.t,VlModal:b.n,VlNumberInput:u.n,VlPagination:C.n,VlProgress:w.n,VlRadio:T.VlRadio,VlRow:E.VlRow,VlScrollbar:D.n,VlSelect:S.n,VlSidebar:O.n,VlSlider:k.n,VlSpace:A.n,VlSwitch:j.n,VlTable:N.n,VlTabs:l.n,VlTag:P.n,VlTextarea:F.n,VlTimeline:I.n,VlTimePicker:L.n,VlTooltip:M.n,VlTransition:s.n,VlUpload:R.n},B=(e=globalThis)=>(Object.assign(e,z),z);Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return z}});