@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.
Files changed (99) hide show
  1. package/dist/{Col-CZjR94ac.js → Col-BZdKuXbj.js} +1 -1
  2. package/dist/{Col-qcq7T83y.cjs → Col-CvoVGKUn.cjs} +1 -1
  3. package/dist/Cron-B4S_KhO1.cjs +1 -0
  4. package/dist/{Cron-C3S1XI-J.js → Cron-B8cGD7-3.js} +352 -344
  5. package/dist/{DatePicker-B5uYQlzy.cjs → DatePicker-DwACFSC7.cjs} +1 -1
  6. package/dist/{DatePicker-DhRxFPCj.js → DatePicker-w6jWiNfz.js} +1 -1
  7. package/dist/{DateTimePicker-Bve5qoeh.cjs → DateTimePicker-B5atDTPW.cjs} +1 -1
  8. package/dist/{DateTimePicker-BjDD15Av.js → DateTimePicker-NP2aVE5R.js} +1 -1
  9. package/dist/Dropdown-Chx8SZPS.cjs +1 -0
  10. package/dist/Dropdown-CyVxoFAH.js +330 -0
  11. package/dist/Form-CyCbST4e.cjs +1 -0
  12. package/dist/Form-Fe4b1pS1.js +446 -0
  13. package/dist/{Pagination-DTRhw83o.js → Pagination-BrG1pKYw.js} +1 -1
  14. package/dist/{Pagination-BRxRbWlU.cjs → Pagination-D3ok8N9k.cjs} +1 -1
  15. package/dist/Row-BGzLSkCy.js +24 -0
  16. package/dist/Row-CRQKzpiH.cjs +1 -0
  17. package/dist/Select-GleCzXQB.js +497 -0
  18. package/dist/Select-Rx6AHue2.cjs +1 -0
  19. package/dist/Sidebar-2KVVRUEM.cjs +1 -0
  20. package/dist/Sidebar-ByLinOVm.js +77 -0
  21. package/dist/{Table-DdWKhZAZ.js → Table-ClWg25Wn.js} +10 -7
  22. package/dist/{Table-B1BEfBJC.cjs → Table-Dv2qxs8q.cjs} +1 -1
  23. package/dist/TimePicker-BCU7D6uD.cjs +1 -0
  24. package/dist/{TimePicker-77L1Vyxn.js → TimePicker-BVZbkBvJ.js} +89 -81
  25. package/dist/Tooltip-BbbIT5nt.js +198 -0
  26. package/dist/Tooltip-z6u7ChKj.cjs +1 -0
  27. package/dist/base.css +1 -1
  28. package/dist/cjs/Col.cjs +1 -1
  29. package/dist/cjs/Cron.cjs +1 -1
  30. package/dist/cjs/DatePicker.cjs +1 -1
  31. package/dist/cjs/DateTimePicker.cjs +1 -1
  32. package/dist/cjs/Dropdown.cjs +1 -1
  33. package/dist/cjs/Form.cjs +1 -1
  34. package/dist/cjs/Pagination.cjs +1 -1
  35. package/dist/cjs/Row.cjs +1 -1
  36. package/dist/cjs/Select.cjs +1 -1
  37. package/dist/cjs/Sidebar.cjs +1 -1
  38. package/dist/cjs/Table.cjs +1 -1
  39. package/dist/cjs/TimePicker.cjs +1 -1
  40. package/dist/cjs/Tooltip.cjs +1 -1
  41. package/dist/cjs/global.cjs +1 -1
  42. package/dist/cjs/index.cjs +1 -1
  43. package/dist/cjs/register.cjs +1 -1
  44. package/dist/css/Button.css +1 -1
  45. package/dist/css/Checkbox.css +1 -1
  46. package/dist/css/Radio.css +1 -1
  47. package/dist/css/Sidebar.css +1 -1
  48. package/dist/css/Switch.css +1 -1
  49. package/dist/date-picker-DVvBQnvF.cjs +1 -0
  50. package/dist/date-picker-pcnebTrf.js +639 -0
  51. package/dist/es/Col.mjs +1 -1
  52. package/dist/es/Cron.mjs +1 -1
  53. package/dist/es/DatePicker.mjs +1 -1
  54. package/dist/es/DateTimePicker.mjs +1 -1
  55. package/dist/es/Dropdown.mjs +1 -1
  56. package/dist/es/Form.mjs +1 -1
  57. package/dist/es/Pagination.mjs +1 -1
  58. package/dist/es/Row.mjs +1 -1
  59. package/dist/es/Select.mjs +1 -1
  60. package/dist/es/Sidebar.mjs +1 -1
  61. package/dist/es/Table.mjs +1 -1
  62. package/dist/es/TimePicker.mjs +1 -1
  63. package/dist/es/Tooltip.mjs +1 -1
  64. package/dist/es/global.mjs +1 -1
  65. package/dist/es/index.mjs +13 -13
  66. package/dist/es/register.mjs +1 -1
  67. package/dist/floating-BpTI3sWS.cjs +1 -0
  68. package/dist/{floating-CqdcJWk2.js → floating-BqCWEj83.js} +27 -15
  69. package/dist/index.css +1 -1
  70. package/dist/{registry-DbMCy1-n.js → registry-Cddoj83d.js} +12 -12
  71. package/dist/{registry-Chcx2tDO.cjs → registry-DvXvnY8T.cjs} +1 -1
  72. package/dist/style/Sidebar.cjs +1 -0
  73. package/dist/style/Sidebar.mjs +1 -0
  74. package/dist/types/Form/type.d.cts +2 -0
  75. package/dist/types/Form/type.d.ts +2 -0
  76. package/dist/types/Select/SelectList.d.cts +20 -0
  77. package/dist/types/Select/SelectList.d.ts +20 -0
  78. package/dist/types/_shared/date-calendar.d.cts +20 -0
  79. package/dist/types/_shared/date-calendar.d.ts +20 -0
  80. package/dist/types/_shared/floating.d.cts +13 -1
  81. package/dist/types/_shared/floating.d.ts +13 -1
  82. package/package.json +1 -1
  83. package/dist/Cron-CIZ9GKm0.cjs +0 -1
  84. package/dist/Dropdown-BcT4uaQT.js +0 -319
  85. package/dist/Dropdown-CPW-aSTx.cjs +0 -1
  86. package/dist/Form-LuUPwJc2.cjs +0 -1
  87. package/dist/Form-rXq9r3N-.js +0 -442
  88. package/dist/Row-BJZtEKxG.cjs +0 -1
  89. package/dist/Row-DpEse7PJ.js +0 -24
  90. package/dist/Select-B9umyfKd.cjs +0 -1
  91. package/dist/Select-DDsgKaDL.js +0 -466
  92. package/dist/Sidebar-BPXVnP7y.cjs +0 -1
  93. package/dist/Sidebar-u980T-QB.js +0 -76
  94. package/dist/TimePicker-CsaiM5CQ.cjs +0 -1
  95. package/dist/Tooltip-DH3oc4Wa.js +0 -205
  96. package/dist/Tooltip-DP2yxQpo.cjs +0 -1
  97. package/dist/date-picker-CIAVlMqv.cjs +0 -1
  98. package/dist/date-picker-Co0ySn01.js +0 -612
  99. package/dist/floating-5PRFyI8D.cjs +0 -1
@@ -0,0 +1,639 @@
1
+ import { t as e } from "./effect-nifYL_rH.js";
2
+ import { n as t, t as n } from "./state-BSDh-Ob2.js";
3
+ import { n as r } from "./refs-D5IYOBaf.js";
4
+ import { t as i } from "./Transition-DiO4GsP3.js";
5
+ import { t as a } from "./client-pj_wzx28.js";
6
+ import { i as ee, r as o, t as te } from "./floating-BqCWEj83.js";
7
+ import { t as ne } from "./id-CHixuHb7.js";
8
+ import { a as s, r as re, t as c } from "./layer-C1yCY0MO.js";
9
+ import { t as l } from "./Input-BRy5Xuwy.js";
10
+ import { _ as u, a as d, b as f, c as p, d as m, f as ie, g as h, h as g, i as ae, l as _, m as oe, n as se, p as v, r as ce, s as y, t as le, u as b, y as ue } from "./time-wheel-BtvYZI6H.js";
11
+ import { t as de } from "./Dropdown-CyVxoFAH.js";
12
+ import { CalendarDays as fe, ChevronLeft as pe, ChevronRight as me, ChevronsLeft as he, ChevronsRight as ge, Clock3 as _e, X as ve } from "lucide-react";
13
+ import { forwardRef as x, useCallback as S, useEffect as ye, useMemo as C, useRef as be, useState as w } from "react";
14
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
15
+ import { createPortal as xe } from "react-dom";
16
+ //#region components/_shared/date-calendar.tsx
17
+ var Se = [
18
+ "日",
19
+ "一",
20
+ "二",
21
+ "三",
22
+ "四",
23
+ "五",
24
+ "六"
25
+ ], Ce = ({ classPrefix: e, month: t, monthLabel: n, range: r, rangeValue: i, previewDate: a, selectedDate: ee, isDateDisabled: o, onSelect: te, onKeyDown: ne, onPreview: s }) => {
26
+ let re = C(() => ie(t), [t]), c = r ? i[0] : null, l = r ? i[1] : null, u = r && c && !l ? a : null, d = l ?? u, f = c && d && b(c, d) <= 0 ? c : d, p = c && d && b(c, d) <= 0 ? d : c, m = r ? null : ee, g = (r ? i : [m]).find((e) => e && oe(e, t) && !o(e)) ?? re.find((e) => oe(e, t) && !o(e)), ae = /* @__PURE__ */ new Date(), _ = c ? h(c) : null, se = l ? h(l) : null, ce = f ? h(f) : null, y = p ? h(p) : null;
27
+ return /* @__PURE__ */ E("section", {
28
+ className: `${e}__calendar`,
29
+ "aria-label": n,
30
+ children: [
31
+ r ? /* @__PURE__ */ T("div", {
32
+ className: `${e}__month-title`,
33
+ children: n
34
+ }) : null,
35
+ /* @__PURE__ */ T("div", {
36
+ className: `${e}__weekdays`,
37
+ role: "row",
38
+ children: Se.map((e) => /* @__PURE__ */ T("span", {
39
+ role: "columnheader",
40
+ children: e
41
+ }, e))
42
+ }),
43
+ /* @__PURE__ */ T("div", {
44
+ className: `${e}__grid`,
45
+ role: "grid",
46
+ onMouseLeave: () => s(null),
47
+ onBlur: (e) => {
48
+ let t = e.relatedTarget;
49
+ t instanceof Node && e.currentTarget.contains(t) || s(null);
50
+ },
51
+ children: re.map((n) => {
52
+ let i = !oe(n, t), a = i || o(n), ee = !!(_ && se && b(n, _) >= 0 && b(n, se) <= 0), re = !!(c && u && ce && y && b(n, ce) >= 0 && b(n, y) <= 0), d = ee || re, ie = !!(f && d && v(n, f)), h = !!(p && d && v(n, p)), le = !!(u && v(n, u)), ue = v(n, ae), de = [
53
+ `${e}__day`,
54
+ i ? "is-other-month" : "",
55
+ ue ? "is-today" : "",
56
+ r && c && v(n, c) ? "is-range-start is-selected" : "",
57
+ r && l && v(n, l) ? "is-range-end is-selected" : "",
58
+ m && v(n, m) ? "is-selected" : "",
59
+ d ? "is-in-range" : "",
60
+ ie ? "is-range-edge-start" : "",
61
+ h ? "is-range-edge-end" : "",
62
+ le ? "is-range-preview-end" : "",
63
+ a ? "is-disabled" : ""
64
+ ].filter(Boolean).join(" ");
65
+ return /* @__PURE__ */ T("button", {
66
+ type: "button",
67
+ className: de,
68
+ role: "gridcell",
69
+ "data-time": n.getTime(),
70
+ "aria-label": `${n.getFullYear()}年${n.getMonth() + 1}月${n.getDate()}日`,
71
+ "aria-selected": r ? ee : !!(m && v(n, m)),
72
+ "aria-current": ue ? "date" : void 0,
73
+ "aria-hidden": i || void 0,
74
+ "aria-disabled": a || void 0,
75
+ disabled: a,
76
+ tabIndex: !a && g && v(n, g) ? 0 : -1,
77
+ onClick: () => te(n),
78
+ onKeyDown: (e) => ne(e, n),
79
+ onMouseEnter: () => s(n),
80
+ onFocus: () => s(n),
81
+ children: /* @__PURE__ */ T("span", {
82
+ className: `${e}__day-content`,
83
+ children: n.getDate()
84
+ })
85
+ }, n.toISOString());
86
+ })
87
+ })
88
+ ]
89
+ });
90
+ }, we = "data-vl-date-picker-popup-owner", Te = [
91
+ "一月",
92
+ "二月",
93
+ "三月",
94
+ "四月",
95
+ "五月",
96
+ "六月",
97
+ "七月",
98
+ "八月",
99
+ "九月",
100
+ "十月",
101
+ "十一月",
102
+ "十二月"
103
+ ], D = (e) => Array.isArray(e) && e.length === 2, O = (e, t) => f(e, t), Ee = (e, t) => {
104
+ if (D(e)) {
105
+ let n = O(e[0], t), r = O(e[1], t);
106
+ return n && r ? `${m(n, t)} ~ ${m(r, t)}` : "";
107
+ }
108
+ let n = O(e, t);
109
+ return n ? m(n, t) : "";
110
+ }, De = (e) => [e[0] ? _(e[0]) : null, e[1] ? _(e[1]) : null], Oe = (e) => `${e.getFullYear()}年 ${Te[e.getMonth()]}`, ke = (e, t) => t ? _(e) : h(e), Ae = (e, t, n) => {
111
+ let r = (e) => {
112
+ let t = O(e, n);
113
+ return t ? t.getTime() : null;
114
+ };
115
+ return D(e) || D(t) ? !D(e) || !D(t) ? !1 : r(e[0]) === r(t[0]) && r(e[1]) === r(t[1]) : r(e) === r(t);
116
+ }, je = x((f, ie) => {
117
+ let { componentName: v, withTime: x = !1, value: Se, defaultValue: Te, valueType: je = "date", format: k = x ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD", range: A = !1, shortcuts: Me = [], minDate: Ne, maxDate: Pe, disabledDate: Fe, minTime: Ie, maxTime: Le, disabledTime: Re, placeholder: ze = A ? "请选择日期范围" : x ? "请选择日期时间" : "请选择日期", disabled: j = !1, clearable: Be = !1, size: Ve = "md", placement: M = "bottom-start", offset: He = 8, zIndex: Ue, className: We, style: Ge, id: Ke, "aria-label": qe, "aria-labelledby": Je, "aria-describedby": Ye, onChange: Xe, onClear: Ze, onOpen: Qe, onClose: $e, ...et } = f, N = Xe, tt = be(null), P = be(null), F = be(null), nt = be(null), rt = a(), it = s({
118
+ defaultZIndex: re.popover,
119
+ zIndex: Ue
120
+ }), at = n(f, "value"), [I, L] = t({
121
+ value: Se ?? null,
122
+ defaultValue: Te ?? null,
123
+ controlled: at
124
+ }), [R, ot] = w(!1), [st, z] = w(() => {
125
+ let e = D(I) ? O(I[0], k) : O(I, k);
126
+ return u(e ?? /* @__PURE__ */ new Date());
127
+ }), [B, ct] = w(null), [V, H] = w([null, null]), [lt, ut] = w(null), [U, W] = w("start"), [dt, ft] = w(!1), [G, pt] = w(null), [{ style: mt, placement: ht }, gt] = ee(M), _t = mt.left !== void 0, [vt, yt] = w(null), bt = ne(`vl-${v}-control`, Ke), K = ne(`vl-${v}-panel`), xt = C(() => r(tt, ie), [ie]), St = S(() => {
128
+ ft(!1), pt(null);
129
+ }, []), Ct = C(() => A ? D(I) ? [O(I[0], k), O(I[1], k)] : [null, null] : Array.isArray(I) ? null : O(I, k), [
130
+ k,
131
+ A,
132
+ I
133
+ ]), wt = A ? Ct : null, q = A ? null : Ct, Tt = Ee(I, k), Et = st, Dt = C(() => p(st, 1), [st]), Ot = O(Ne, k), kt = O(Pe, k), At = Ie ? ue(Ie) : null, jt = Le ? ue(Le) : null, Mt = C(() => ({
134
+ minSeconds: At,
135
+ maxSeconds: jt,
136
+ disabledTime: Re
137
+ }), [
138
+ Re,
139
+ jt,
140
+ At
141
+ ]), J = S((e) => {
142
+ let t = h(e);
143
+ return !!(Ot && b(t, h(Ot)) < 0 || kt && b(t, h(kt)) > 0 || Fe?.(t));
144
+ }, [
145
+ Fe,
146
+ kt,
147
+ Ot
148
+ ]), Y = S((e) => ae(e, Mt), [Mt]), Nt = S((e, t, n) => se(e, t, n, Mt), [Mt]), Pt = S((e) => x && Y(m(e, "HH:mm:ss")), [Y, x]), X = S((e) => {
149
+ if (!(e && (j || R)) && !(!e && !R)) {
150
+ if (e) {
151
+ let e = (A ? wt?.[0] : q) ?? /* @__PURE__ */ new Date();
152
+ z(u(e)), A ? H(De(wt ?? [null, null])) : ct(q ? _(q) : null), ut(null), W("start"), gt({
153
+ placement: M,
154
+ style: {}
155
+ }), yt(null), St(), ot(!0), Qe?.();
156
+ } else yt(null), ut(null), St(), ot(!1), $e?.();
157
+ }
158
+ }, [
159
+ j,
160
+ $e,
161
+ Qe,
162
+ R,
163
+ M,
164
+ A,
165
+ St,
166
+ q,
167
+ wt,
168
+ gt
169
+ ]), Ft = S(() => {
170
+ if (!R || !P.current || !F.current) return;
171
+ let e = P.current.getBoundingClientRect(), t = te({
172
+ anchorRect: e,
173
+ floatingRect: F.current.getBoundingClientRect(),
174
+ placement: M,
175
+ offset: He
176
+ });
177
+ gt({
178
+ placement: t.placement,
179
+ style: {
180
+ left: `${Math.round(t.x)}px`,
181
+ top: `${Math.round(t.y)}px`
182
+ }
183
+ });
184
+ }, [
185
+ He,
186
+ R,
187
+ M,
188
+ gt
189
+ ]);
190
+ e(() => {
191
+ if (!R || !rt) return;
192
+ Ft();
193
+ let e = window.requestAnimationFrame(Ft);
194
+ return () => window.cancelAnimationFrame(e);
195
+ }, [
196
+ rt,
197
+ R,
198
+ Ft
199
+ ]), e(() => {
200
+ if (!R || !_t || !vt) return;
201
+ let e = F.current?.querySelector(`[data-time="${vt.getTime()}"]:not(:disabled)`);
202
+ e && (e.focus(), yt(null));
203
+ }, [
204
+ st,
205
+ vt,
206
+ _t,
207
+ R
208
+ ]);
209
+ let It = S((e) => e.some((e) => e instanceof HTMLElement && (e.getAttribute(we) === K || e.classList.contains("vl-dropdown__panel") && e.querySelector(`[${we}]`)?.getAttribute(we) === K)), [K]), Lt = S(() => X(!1), [X]), Rt = S(() => {
210
+ dt || (X(!1), P.current?.focus());
211
+ }, [X, dt]);
212
+ o({
213
+ active: R,
214
+ rootRef: tt,
215
+ floatingRef: F,
216
+ isOwnedPopup: It,
217
+ onOutsideClick: Lt,
218
+ onEscape: Rt,
219
+ onViewportChange: Ft
220
+ }), ye(() => {
221
+ j && R && X(!1);
222
+ }, [
223
+ j,
224
+ R,
225
+ X
226
+ ]);
227
+ let zt = S((e) => je === "string" ? m(e, k) : _(e), [k, je]), Bt = S((e) => {
228
+ let t = ke(e, x);
229
+ if (J(t) || x && Y(m(t, "HH:mm:ss"))) return;
230
+ let n = zt(t);
231
+ Ae(I, n, k) || (L(n), N?.(n)), X(!1), P.current?.focus();
232
+ }, [
233
+ N,
234
+ k,
235
+ J,
236
+ Y,
237
+ zt,
238
+ I,
239
+ X,
240
+ L,
241
+ x
242
+ ]), Vt = S((e) => {
243
+ if (!e[0] || !e[1]) return;
244
+ let t = b(e[0], e[1]) <= 0 ? e : [e[1], e[0]], n = ke(t[0], x), r = ke(t[1], x);
245
+ if (J(n) || J(r) || x && (Y(m(n, "HH:mm:ss")) || Y(m(r, "HH:mm:ss")))) return;
246
+ let i = [zt(n), zt(r)];
247
+ Ae(I, i, k) || (L(i), N?.(i)), X(!1), P.current?.focus();
248
+ }, [
249
+ N,
250
+ k,
251
+ J,
252
+ Y,
253
+ zt,
254
+ I,
255
+ X,
256
+ L,
257
+ x
258
+ ]), Ht = (e) => {
259
+ if (J(e)) return;
260
+ ut(null);
261
+ let t = A ? V[U === "start" ? 0 : 1] : B, n = h(e);
262
+ if (x) {
263
+ if (t) n = g(e, t.getHours(), t.getMinutes(), t.getSeconds());
264
+ else {
265
+ let t = Nt(0, 86399, 0);
266
+ n = t === null ? _(e) : g(e, Math.floor(t / 3600), Math.floor(t % 3600 / 60), t % 60);
267
+ }
268
+ }
269
+ if (!A) {
270
+ ct(n), x || Bt(n);
271
+ return;
272
+ }
273
+ let [r, i] = V;
274
+ if (!r || i) {
275
+ H([n, null]), W("start");
276
+ return;
277
+ }
278
+ b(n, r) < 0 ? (H([n, r]), W("end")) : (H([r, n]), W("end"));
279
+ }, Ut = (e) => {
280
+ if (!A || !e || V[1] || J(e)) {
281
+ ut(null);
282
+ return;
283
+ }
284
+ ut(h(e));
285
+ }, Z = S((e, t = !1) => {
286
+ if (e && G) {
287
+ if (A) {
288
+ let e = De(V);
289
+ e[U === "start" ? 0 : 1] = _(G), H(e);
290
+ } else ct(_(G));
291
+ }
292
+ St(), t && window.requestAnimationFrame(() => nt.current?.focus());
293
+ }, [
294
+ U,
295
+ V,
296
+ A,
297
+ St,
298
+ G
299
+ ]), Wt = (e, t) => {
300
+ let n = G ? _(G) : /* @__PURE__ */ new Date(), r = {
301
+ hours: n.getHours(),
302
+ minutes: n.getMinutes(),
303
+ seconds: n.getSeconds()
304
+ }, { start: i, end: a, preferred: ee } = ce(e, t, r), o = Nt(i, a, ee);
305
+ if (o === null) return;
306
+ let te = g(n, Math.floor(o / 3600), Math.floor(o % 3600 / 60), o % 60);
307
+ pt(te);
308
+ }, Gt = (e) => {
309
+ let t = e.getValue(/* @__PURE__ */ new Date());
310
+ if (t === null) return;
311
+ if (A) {
312
+ if (!D(t)) return;
313
+ let e = O(t[0], k), n = O(t[1], k);
314
+ if (!e || !n || J(e) || J(n) || Pt(e) || Pt(n)) return;
315
+ H(b(e, n) <= 0 ? [e, n] : [n, e]), W("end");
316
+ return;
317
+ }
318
+ if (D(t)) return;
319
+ let n = O(t, k);
320
+ !n || J(n) || Pt(n) || Bt(n);
321
+ }, Kt = (e) => {
322
+ e?.stopPropagation(), !j && (L(null), N?.(null), Ze?.(), ct(null), H([null, null]));
323
+ }, Q = (e, t, n = !1) => {
324
+ let r = n ? h(e) : y(h(e), t);
325
+ for (let e = 0; e < 3660; e += 1) {
326
+ if (t < 0 && Ot && b(r, h(Ot)) < 0 || t > 0 && kt && b(r, h(kt)) > 0) return null;
327
+ if (!J(r)) return r;
328
+ r = y(r, t);
329
+ }
330
+ return null;
331
+ }, qt = (e) => {
332
+ if (!j) {
333
+ if (e.key === "Enter" || e.key === " ") {
334
+ if (e.preventDefault(), R) X(!1);
335
+ else {
336
+ let e = (A ? wt?.[0] : q) ?? /* @__PURE__ */ new Date(), t = Q(e, 1, !0) ?? Q(e, -1, !0) ?? null;
337
+ X(!0), t && yt(t);
338
+ }
339
+ } else e.key === "Escape" && R && (e.preventDefault(), X(!1));
340
+ }
341
+ }, Jt = (e) => {
342
+ !oe(e, Et) && !(A && oe(e, Dt)) && z(u(e)), yt(h(e));
343
+ }, Yt = (e, t) => {
344
+ let n = null;
345
+ if (e.key === "ArrowLeft") n = Q(t, -1);
346
+ else if (e.key === "ArrowRight") n = Q(t, 1);
347
+ else if (e.key === "ArrowUp") n = Q(t, -7);
348
+ else if (e.key === "ArrowDown") n = Q(t, 7);
349
+ else if (e.key === "Home" || e.key === "End") {
350
+ let r = e.key === "Home" ? y(t, -t.getDay()) : y(t, 6 - t.getDay()), i = e.key === "Home" ? 1 : -1;
351
+ for (let e = 0; e < 7; e += 1) {
352
+ let t = y(r, e * i);
353
+ if (!J(t)) {
354
+ n = t;
355
+ break;
356
+ }
357
+ }
358
+ }
359
+ n && (e.preventDefault(), Jt(n));
360
+ }, $ = A ? V[U === "start" ? 0 : 1] : B, Xt = S((e) => {
361
+ if (e) {
362
+ if (!$) return;
363
+ pt(_($)), ft(!0);
364
+ return;
365
+ }
366
+ Z(!1);
367
+ }, [$, Z]), Zt = G ?? $ ?? /* @__PURE__ */ new Date(), Qt = Zt.getHours(), $t = Zt.getMinutes(), en = Zt.getSeconds(), tn = $ ? m(Zt, "HH:mm:ss") : "", nn = A ? U === "start" ? "开始时间" : "结束时间" : "时间", rn = S((e, t) => d(e, t, {
368
+ hours: Qt,
369
+ minutes: $t,
370
+ seconds: en
371
+ }, Nt), [
372
+ Nt,
373
+ Qt,
374
+ $t,
375
+ en
376
+ ]), an = A ? !!(V[0] && V[1] && !J(V[0]) && !J(V[1]) && (!x || !Y(m(V[0], "HH:mm:ss")) && !Y(m(V[1], "HH:mm:ss")))) : !!(B && !J(B) && (!x || !Y(m(B, "HH:mm:ss")))), on = !!Tt, sn = [
377
+ `vl-${v}`,
378
+ `size-${Ve}`,
379
+ R ? "is-open" : "",
380
+ j ? "is-disabled" : "",
381
+ A ? "is-range" : "",
382
+ x ? "has-time" : "",
383
+ We || ""
384
+ ].filter(Boolean).join(" "), cn = {
385
+ classPrefix: `vl-${v}`,
386
+ range: A,
387
+ rangeValue: V,
388
+ previewDate: lt,
389
+ selectedDate: B ?? q,
390
+ isDateDisabled: J,
391
+ onSelect: Ht,
392
+ onKeyDown: Yt,
393
+ onPreview: Ut
394
+ }, ln = /* @__PURE__ */ T(i, {
395
+ show: R,
396
+ name: `vl-${v}`,
397
+ deferEffects: !rt,
398
+ children: /* @__PURE__ */ E("div", {
399
+ ref: F,
400
+ id: K,
401
+ className: `vl-${v}__panel is-${ht}${_t ? " is-positioned" : ""}`,
402
+ style: {
403
+ ...mt,
404
+ zIndex: it.zIndex,
405
+ visibility: _t ? "visible" : "hidden"
406
+ },
407
+ role: "dialog",
408
+ "aria-label": A ? "日期范围选择" : x ? "日期时间选择" : "日期选择",
409
+ children: [
410
+ /* @__PURE__ */ E("div", {
411
+ className: `vl-${v}__header`,
412
+ children: [
413
+ /* @__PURE__ */ E("div", {
414
+ className: `vl-${v}__header-actions`,
415
+ children: [/* @__PURE__ */ T("button", {
416
+ type: "button",
417
+ "aria-label": "上一年",
418
+ onClick: () => z((e) => p(e, -12)),
419
+ children: /* @__PURE__ */ T(he, {
420
+ size: 16,
421
+ "aria-hidden": "true"
422
+ })
423
+ }), /* @__PURE__ */ T("button", {
424
+ type: "button",
425
+ "aria-label": "上一个月",
426
+ onClick: () => z((e) => p(e, -1)),
427
+ children: /* @__PURE__ */ T(pe, {
428
+ size: 16,
429
+ "aria-hidden": "true"
430
+ })
431
+ })]
432
+ }),
433
+ A ? null : /* @__PURE__ */ T("span", { children: Oe(Et) }),
434
+ /* @__PURE__ */ E("div", {
435
+ className: `vl-${v}__header-actions`,
436
+ children: [/* @__PURE__ */ T("button", {
437
+ type: "button",
438
+ "aria-label": "下一个月",
439
+ onClick: () => z((e) => p(e, 1)),
440
+ children: /* @__PURE__ */ T(me, {
441
+ size: 16,
442
+ "aria-hidden": "true"
443
+ })
444
+ }), /* @__PURE__ */ T("button", {
445
+ type: "button",
446
+ "aria-label": "下一年",
447
+ onClick: () => z((e) => p(e, 12)),
448
+ children: /* @__PURE__ */ T(ge, {
449
+ size: 16,
450
+ "aria-hidden": "true"
451
+ })
452
+ })]
453
+ })
454
+ ]
455
+ }),
456
+ /* @__PURE__ */ E("div", {
457
+ className: `vl-${v}__calendars`,
458
+ children: [/* @__PURE__ */ T(Ce, {
459
+ ...cn,
460
+ month: Et,
461
+ monthLabel: Oe(Et)
462
+ }), A ? /* @__PURE__ */ T(Ce, {
463
+ ...cn,
464
+ month: Dt,
465
+ monthLabel: Oe(Dt)
466
+ }) : null]
467
+ }),
468
+ x ? /* @__PURE__ */ T("div", {
469
+ className: `vl-${v}__time`,
470
+ children: /* @__PURE__ */ E("div", {
471
+ className: `vl-${v}__time-toolbar`,
472
+ children: [
473
+ /* @__PURE__ */ T("span", {
474
+ className: `vl-${v}__time-title`,
475
+ children: "时间"
476
+ }),
477
+ A ? /* @__PURE__ */ E("div", {
478
+ className: `vl-${v}__time-range`,
479
+ children: [/* @__PURE__ */ T("button", {
480
+ type: "button",
481
+ className: U === "start" ? "is-active" : "",
482
+ "aria-pressed": U === "start",
483
+ disabled: !V[0],
484
+ onClick: () => {
485
+ Z(!1), W("start");
486
+ },
487
+ children: "开始时间"
488
+ }), /* @__PURE__ */ T("button", {
489
+ type: "button",
490
+ className: U === "end" ? "is-active" : "",
491
+ "aria-pressed": U === "end",
492
+ disabled: !V[1],
493
+ onClick: () => {
494
+ Z(!1), W("end");
495
+ },
496
+ children: "结束时间"
497
+ })]
498
+ }) : null,
499
+ /* @__PURE__ */ T(de, {
500
+ className: `vl-${v}__time-dropdown`,
501
+ open: dt,
502
+ disabled: !$,
503
+ trigger: "click",
504
+ placement: "bottom-end",
505
+ offset: 4,
506
+ closeOnContentClick: !1,
507
+ "aria-label": nn,
508
+ menuLabel: `${nn}选择器`,
509
+ triggerContent: /* @__PURE__ */ T(l, {
510
+ ref: nt,
511
+ className: `vl-${v}__time-input`,
512
+ value: tn,
513
+ placeholder: "请先选择日期",
514
+ size: "sm",
515
+ suffixIcon: _e,
516
+ readOnly: !0,
517
+ disabled: !$
518
+ }),
519
+ onChange: Xt,
520
+ children: /* @__PURE__ */ E("div", {
521
+ className: `vl-${v}__time-popover`,
522
+ [we]: K,
523
+ children: [/* @__PURE__ */ T(le, {
524
+ value: {
525
+ hours: Qt,
526
+ minutes: $t,
527
+ seconds: en
528
+ },
529
+ disabled: !$,
530
+ ariaLabel: nn,
531
+ visibleItemCount: 3,
532
+ itemHeight: 30,
533
+ isOptionDisabled: rn,
534
+ onChange: Wt
535
+ }), /* @__PURE__ */ E("div", {
536
+ className: `vl-${v}__footer`,
537
+ children: [/* @__PURE__ */ T("button", {
538
+ type: "button",
539
+ className: "is-cancel",
540
+ "aria-label": "取消时间",
541
+ onClick: () => Z(!1, !0),
542
+ children: "取消"
543
+ }), /* @__PURE__ */ T("button", {
544
+ type: "button",
545
+ className: "is-confirm",
546
+ "aria-label": "确定时间",
547
+ disabled: !G,
548
+ onClick: () => Z(!0, !0),
549
+ children: "确定"
550
+ })]
551
+ })]
552
+ })
553
+ })
554
+ ]
555
+ })
556
+ }) : null,
557
+ Me.length ? /* @__PURE__ */ T("div", {
558
+ className: `vl-${v}__shortcuts`,
559
+ role: "group",
560
+ "aria-label": "快捷选择",
561
+ children: Me.map((e) => /* @__PURE__ */ T("button", {
562
+ type: "button",
563
+ onClick: () => Gt(e),
564
+ children: e.label
565
+ }, e.label))
566
+ }) : null,
567
+ A || x ? /* @__PURE__ */ E("div", {
568
+ className: `vl-${v}__footer`,
569
+ children: [/* @__PURE__ */ T("button", {
570
+ type: "button",
571
+ className: "is-cancel",
572
+ onClick: () => {
573
+ X(!1), P.current?.focus();
574
+ },
575
+ children: "取消"
576
+ }), /* @__PURE__ */ T("button", {
577
+ type: "button",
578
+ className: "is-confirm",
579
+ disabled: !an,
580
+ onClick: () => {
581
+ A ? Vt(V) : B && Bt(B);
582
+ },
583
+ children: "确定"
584
+ })]
585
+ }) : null
586
+ ]
587
+ })
588
+ });
589
+ return /* @__PURE__ */ T(c, {
590
+ layer: it.layer,
591
+ children: /* @__PURE__ */ E("div", {
592
+ ref: xt,
593
+ className: `vl-${v}-wrapper`,
594
+ style: Ge,
595
+ ...et,
596
+ children: [/* @__PURE__ */ E("div", {
597
+ ref: P,
598
+ id: bt,
599
+ className: sn,
600
+ role: "combobox",
601
+ "aria-expanded": R,
602
+ "aria-controls": K,
603
+ "aria-haspopup": "dialog",
604
+ "aria-disabled": j || void 0,
605
+ "aria-label": qe ?? (Je ? void 0 : ze),
606
+ "aria-labelledby": Je,
607
+ "aria-describedby": Ye,
608
+ tabIndex: j ? -1 : 0,
609
+ onClick: () => X(!R),
610
+ onKeyDown: qt,
611
+ children: [
612
+ /* @__PURE__ */ T("span", {
613
+ className: `vl-${v}__icon`,
614
+ "aria-hidden": "true",
615
+ children: /* @__PURE__ */ T(fe, { size: 16 })
616
+ }),
617
+ /* @__PURE__ */ T("span", {
618
+ className: `vl-${v}__value${Tt ? "" : " is-placeholder"}`,
619
+ children: Tt || ze
620
+ }),
621
+ Be && on && !j ? /* @__PURE__ */ T("button", {
622
+ type: "button",
623
+ className: `vl-${v}__clear`,
624
+ "aria-label": "清除已选",
625
+ onClick: Kt,
626
+ onMouseDown: (e) => e.preventDefault(),
627
+ children: /* @__PURE__ */ T(ve, {
628
+ size: 16,
629
+ "aria-hidden": "true"
630
+ })
631
+ }) : null
632
+ ]
633
+ }), rt ? xe(ln, document.body) : ln]
634
+ })
635
+ });
636
+ });
637
+ je.displayName = "VlDatePickerCore";
638
+ //#endregion
639
+ export { je as t };
package/dist/es/Col.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import { n as e, t } from "../Col-CZjR94ac.js";
2
+ import { n as e, t } from "../Col-BZdKuXbj.js";
3
3
  export { e as VlCol, t as default };
package/dist/es/Cron.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import { n as e, t } from "../Cron-C3S1XI-J.js";
2
+ import { n as e, t } from "../Cron-B8cGD7-3.js";
3
3
  export { e as VlCron, t as default };
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import { n as e, t } from "../DatePicker-DhRxFPCj.js";
2
+ import { n as e, t } from "../DatePicker-w6jWiNfz.js";
3
3
  export { e as VlDatePicker, t as default };
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import { n as e, t } from "../DateTimePicker-BjDD15Av.js";
2
+ import { n as e, t } from "../DateTimePicker-NP2aVE5R.js";
3
3
  export { e as VlDateTimePicker, t as default };
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import { n as e, t } from "../Dropdown-BcT4uaQT.js";
2
+ import { n as e, t } from "../Dropdown-CyVxoFAH.js";
3
3
  export { e as VlDropdown, t as default };
package/dist/es/Form.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import { n as e, t } from "../Form-rXq9r3N-.js";
2
+ import { n as e, t } from "../Form-Fe4b1pS1.js";
3
3
  export { t as VlForm, t as default, e as VlFormItem };
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import { n as e, t } from "../Pagination-DTRhw83o.js";
2
+ import { n as e, t } from "../Pagination-BrG1pKYw.js";
3
3
  export { e as VlPagination, t as default };
package/dist/es/Row.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { t as e } from "../Row-DpEse7PJ.js";
2
+ import { t as e } from "../Row-BGzLSkCy.js";
3
3
  //#region components/Row/index.ts
4
4
  var t = e, n = e;
5
5
  //#endregion
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import { n as e, t } from "../Select-DDsgKaDL.js";
2
+ import { n as e, t } from "../Select-GleCzXQB.js";
3
3
  export { e as VlSelect, t as default };
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- import { n as e, t } from "../Sidebar-u980T-QB.js";
2
+ import { n as e, t } from "../Sidebar-ByLinOVm.js";
3
3
  export { e as VlSidebar, t as default };