@vavt/react-ui 1.3.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) 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-C3S1XI-J.js → Cron-HRBggBRO.js} +352 -344
  4. package/dist/Cron-vQ7RSsws.cjs +1 -0
  5. package/dist/{DatePicker-DhRxFPCj.js → DatePicker-B0f4Nh8h.js} +1 -1
  6. package/dist/{DatePicker-B5uYQlzy.cjs → DatePicker-DFTqHT8i.cjs} +1 -1
  7. package/dist/{DateTimePicker-BjDD15Av.js → DateTimePicker-BzkWgjkq.js} +1 -1
  8. package/dist/{DateTimePicker-Bve5qoeh.cjs → DateTimePicker-McwH-cWl.cjs} +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/Input-BbJ4Q_xu.cjs +1 -0
  14. package/dist/Input-DpoSxIdb.js +113 -0
  15. package/dist/{Pagination-DTRhw83o.js → Pagination-BrG1pKYw.js} +1 -1
  16. package/dist/{Pagination-BRxRbWlU.cjs → Pagination-D3ok8N9k.cjs} +1 -1
  17. package/dist/Row-BGzLSkCy.js +24 -0
  18. package/dist/Row-CRQKzpiH.cjs +1 -0
  19. package/dist/Select-GleCzXQB.js +497 -0
  20. package/dist/Select-Rx6AHue2.cjs +1 -0
  21. package/dist/Sidebar-2KVVRUEM.cjs +1 -0
  22. package/dist/Sidebar-ByLinOVm.js +77 -0
  23. package/dist/{Table-DdWKhZAZ.js → Table-ClWg25Wn.js} +10 -7
  24. package/dist/{Table-B1BEfBJC.cjs → Table-Dv2qxs8q.cjs} +1 -1
  25. package/dist/TimePicker-BCU7D6uD.cjs +1 -0
  26. package/dist/{TimePicker-77L1Vyxn.js → TimePicker-BVZbkBvJ.js} +89 -81
  27. package/dist/Tooltip-BbbIT5nt.js +198 -0
  28. package/dist/Tooltip-z6u7ChKj.cjs +1 -0
  29. package/dist/base.css +1 -1
  30. package/dist/cjs/Col.cjs +1 -1
  31. package/dist/cjs/Cron.cjs +1 -1
  32. package/dist/cjs/DatePicker.cjs +1 -1
  33. package/dist/cjs/DateTimePicker.cjs +1 -1
  34. package/dist/cjs/Dropdown.cjs +1 -1
  35. package/dist/cjs/Form.cjs +1 -1
  36. package/dist/cjs/Input.cjs +1 -1
  37. package/dist/cjs/Pagination.cjs +1 -1
  38. package/dist/cjs/Row.cjs +1 -1
  39. package/dist/cjs/Select.cjs +1 -1
  40. package/dist/cjs/Sidebar.cjs +1 -1
  41. package/dist/cjs/Table.cjs +1 -1
  42. package/dist/cjs/TimePicker.cjs +1 -1
  43. package/dist/cjs/Tooltip.cjs +1 -1
  44. package/dist/cjs/global.cjs +1 -1
  45. package/dist/cjs/index.cjs +1 -1
  46. package/dist/cjs/register.cjs +1 -1
  47. package/dist/css/Button.css +1 -1
  48. package/dist/css/Checkbox.css +1 -1
  49. package/dist/css/Input.css +1 -1
  50. package/dist/css/Radio.css +1 -1
  51. package/dist/css/Sidebar.css +1 -1
  52. package/dist/css/Switch.css +1 -1
  53. package/dist/date-picker-BKXFZDN2.js +639 -0
  54. package/dist/date-picker-Dp0BXURF.cjs +1 -0
  55. package/dist/es/Col.mjs +1 -1
  56. package/dist/es/Cron.mjs +1 -1
  57. package/dist/es/DatePicker.mjs +1 -1
  58. package/dist/es/DateTimePicker.mjs +1 -1
  59. package/dist/es/Dropdown.mjs +1 -1
  60. package/dist/es/Form.mjs +1 -1
  61. package/dist/es/Input.mjs +1 -1
  62. package/dist/es/Pagination.mjs +1 -1
  63. package/dist/es/Row.mjs +1 -1
  64. package/dist/es/Select.mjs +1 -1
  65. package/dist/es/Sidebar.mjs +1 -1
  66. package/dist/es/Table.mjs +1 -1
  67. package/dist/es/TimePicker.mjs +1 -1
  68. package/dist/es/Tooltip.mjs +1 -1
  69. package/dist/es/global.mjs +1 -1
  70. package/dist/es/index.mjs +14 -14
  71. package/dist/es/register.mjs +1 -1
  72. package/dist/floating-BpTI3sWS.cjs +1 -0
  73. package/dist/{floating-CqdcJWk2.js → floating-BqCWEj83.js} +27 -15
  74. package/dist/index.css +1 -1
  75. package/dist/{registry-DbMCy1-n.js → registry-BXGVMimF.js} +13 -13
  76. package/dist/{registry-Chcx2tDO.cjs → registry-C-Mo3vuy.cjs} +1 -1
  77. package/dist/style/Sidebar.cjs +1 -0
  78. package/dist/style/Sidebar.mjs +1 -0
  79. package/dist/types/Form/type.d.cts +2 -0
  80. package/dist/types/Form/type.d.ts +2 -0
  81. package/dist/types/Input/type.d.cts +4 -2
  82. package/dist/types/Input/type.d.ts +4 -2
  83. package/dist/types/Select/SelectList.d.cts +20 -0
  84. package/dist/types/Select/SelectList.d.ts +20 -0
  85. package/dist/types/_shared/date-calendar.d.cts +20 -0
  86. package/dist/types/_shared/date-calendar.d.ts +20 -0
  87. package/dist/types/_shared/floating.d.cts +13 -1
  88. package/dist/types/_shared/floating.d.ts +13 -1
  89. package/package.json +1 -1
  90. package/dist/Cron-CIZ9GKm0.cjs +0 -1
  91. package/dist/Dropdown-BcT4uaQT.js +0 -319
  92. package/dist/Dropdown-CPW-aSTx.cjs +0 -1
  93. package/dist/Form-LuUPwJc2.cjs +0 -1
  94. package/dist/Form-rXq9r3N-.js +0 -442
  95. package/dist/Input-BRy5Xuwy.js +0 -104
  96. package/dist/Input-C9ESmbJ7.cjs +0 -1
  97. package/dist/Row-BJZtEKxG.cjs +0 -1
  98. package/dist/Row-DpEse7PJ.js +0 -24
  99. package/dist/Select-B9umyfKd.cjs +0 -1
  100. package/dist/Select-DDsgKaDL.js +0 -466
  101. package/dist/Sidebar-BPXVnP7y.cjs +0 -1
  102. package/dist/Sidebar-u980T-QB.js +0 -76
  103. package/dist/TimePicker-CsaiM5CQ.cjs +0 -1
  104. package/dist/Tooltip-DH3oc4Wa.js +0 -205
  105. package/dist/Tooltip-DP2yxQpo.cjs +0 -1
  106. package/dist/date-picker-CIAVlMqv.cjs +0 -1
  107. package/dist/date-picker-Co0ySn01.js +0 -612
  108. package/dist/floating-5PRFyI8D.cjs +0 -1
@@ -1,442 +0,0 @@
1
- import { t as e } from "./effect-nifYL_rH.js";
2
- import { t } from "./state-BSDh-Ob2.js";
3
- import { t as n } from "./refs-D5IYOBaf.js";
4
- import { t as r } from "./id-CHixuHb7.js";
5
- import { n as i } from "./focus-BDDJyKk3.js";
6
- import { t as a } from "./Tooltip-DH3oc4Wa.js";
7
- import { cloneElement as o, createContext as s, forwardRef as c, isValidElement as l, memo as u, useCallback as d, useContext as f, useEffect as ee, useImperativeHandle as p, useMemo as m, useRef as h, useState as g, useSyncExternalStore as _ } from "react";
8
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
9
- //#region components/Form/context.ts
10
- var b = [], x = Object.freeze({
11
- value: void 0,
12
- errors: b,
13
- isValidating: !1
14
- }), S = s(null), te = S.Provider, C = () => f(S), w = s(null), ne = w.Provider, T = () => f(w), E = s(null).Provider, D = (e) => {
15
- let t = C(), n = d((n) => !e || !t ? () => {} : t.subscribeField(e, n), [t, e]), r = d(() => !e || !t ? x : t.getFieldState(e), [t, e]);
16
- return _(n, r, r);
17
- }, O = ["blur", "submit"], k = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, re = (e) => e ? Array.isArray(e) ? e : [e] : O, A = (e) => e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) && e.length === 0, j = (e, t, n, r) => {
18
- let i = t ?? e;
19
- if (n.required && A(r)) return n.message ?? `请输入${i}`;
20
- if (A(r)) return;
21
- if (n.type && !(n.type === "array" ? Array.isArray(r) : n.type === "email" ? typeof r == "string" && k.test(r) : typeof r === n.type) || (n.pattern && (n.pattern.lastIndex = 0), n.pattern && (typeof r != "string" || !n.pattern.test(r)))) return n.message ?? `${i}格式不正确`;
22
- let a = typeof r == "number" ? r : typeof r == "string" || Array.isArray(r) ? r.length : null;
23
- if (n.len !== void 0 && a !== null && a !== n.len) return n.message ?? `${i}长度必须为 ${n.len}`;
24
- if (n.min !== void 0 && a !== null && a < n.min) return n.message ?? `${i}不能小于 ${n.min}`;
25
- if (n.max !== void 0 && a !== null && a > n.max) return n.message ?? `${i}不能大于 ${n.max}`;
26
- }, M = c((n, r) => {
27
- let { values: a, defaultValues: o = {}, layout: s = "vertical", labelWidth: c, labelAlign: l = s === "horizontal" ? "right" : "left", validateTrigger: u, className: f, style: ee, children: _, onValuesChange: y, onFinish: x, onFinishError: S, onFinishFailed: C, noValidate: w = !0, ...T } = n, D = t(n, "values"), O = m(() => D ? a ?? {} : null, [D, a]), k = h(O ?? o), A = h({}), M = h({}), N = h(!1), [P, F] = g(!1), I = h(null), L = h(/* @__PURE__ */ new Map()), R = h(/* @__PURE__ */ new Map()), z = h(/* @__PURE__ */ new Map()), B = h(/* @__PURE__ */ new Map()), V = h(y), H = h(x), U = h(S), W = h(C);
28
- e(() => {
29
- V.current = y, H.current = x, U.current = S, W.current = C;
30
- });
31
- let G = m(() => re(u), [u]), K = d((e) => {
32
- let t = z.current.get(e);
33
- t && t.forEach((e) => e());
34
- }, []), ie = d((e, t) => {
35
- let n = z.current.get(e);
36
- return n || (n = /* @__PURE__ */ new Set(), z.current.set(e, n)), n.add(t), () => {
37
- n?.delete(t), n && n.size === 0 && z.current.delete(e);
38
- };
39
- }, []), ae = d((e) => {
40
- let t = D ? void 0 : k.current[e], n = A.current[e] ?? b, r = !!M.current[e], i = B.current.get(e);
41
- if (i && Object.is(i.value, t) && i.errors === n && i.isValidating === r) return i;
42
- let a = {
43
- value: t,
44
- errors: n,
45
- isValidating: r
46
- };
47
- return B.current.set(e, a), a;
48
- }, [D]);
49
- e(() => {
50
- O !== null && (k.current = O);
51
- }, [O]);
52
- let q = d((e) => {
53
- let t = A.current;
54
- A.current = e;
55
- let n = /* @__PURE__ */ new Set();
56
- for (let r of Object.keys(t)) t[r] !== e[r] && n.add(r);
57
- for (let r of Object.keys(e)) t[r] !== e[r] && n.add(r);
58
- n.forEach((e) => {
59
- K(e);
60
- });
61
- }, [K]), J = d((e) => (L.current.set(e.name, e), () => {
62
- if (L.current.get(e.name)?.token === e.token) {
63
- if (L.current.delete(e.name), R.current.delete(e.name), B.current.delete(e.name), Object.prototype.hasOwnProperty.call(A.current, e.name)) {
64
- let t = { ...A.current };
65
- delete t[e.name], q(t);
66
- }
67
- if (M.current[e.name]) {
68
- let t = { ...M.current };
69
- delete t[e.name], M.current = t, K(e.name);
70
- }
71
- }
72
- }), [q, K]), Y = d((e, t) => {
73
- let n = {
74
- ...k.current,
75
- [e]: t
76
- };
77
- return D || (k.current = n, K(e)), V.current?.({ [e]: t }, n), n;
78
- }, [D, K]), X = d(async (e, t) => {
79
- let n = L.current.get(e);
80
- if (!n) return [];
81
- let r = t ?? k.current, i = r[e], a = Symbol(e);
82
- R.current.set(e, a), M.current = {
83
- ...M.current,
84
- [e]: !0
85
- }, K(e);
86
- let o = [], { rules: s, label: c } = n.metaRef.current;
87
- for (let t of s) {
88
- let n = j(e, c, t, i);
89
- if (n && o.push(n), t.validator) try {
90
- let e = await t.validator(i, r);
91
- e && o.push(t.message ?? e);
92
- } catch (e) {
93
- let n = e instanceof Error ? e.message : "校验失败";
94
- o.push(t.message ?? n);
95
- }
96
- }
97
- if (L.current.get(e)?.token !== n.token || R.current.get(e) !== a) return o;
98
- let l = { ...A.current };
99
- return o.length ? l[e] = o : delete l[e], q(l), M.current = {
100
- ...M.current,
101
- [e]: !1
102
- }, K(e), o;
103
- }, [q, K]), Z = d(async () => {
104
- let e = k.current, t = [...L.current.values()], n = await Promise.all(t.map(async (t) => {
105
- let n = X(t.name, e);
106
- return [
107
- t,
108
- R.current.get(t.name),
109
- await n
110
- ];
111
- })), r = { ...A.current };
112
- return n.forEach(([e, t, n]) => {
113
- L.current.get(e.name)?.token === e.token && R.current.get(e.name) === t && (n.length ? r[e.name] = n : delete r[e.name]);
114
- }), q(r), {
115
- valid: Object.keys(r).length === 0,
116
- values: e,
117
- errors: r
118
- };
119
- }, [q, X]), Q = d(() => {
120
- if (I.current) return I.current;
121
- let e = (async () => {
122
- N.current = !0, F(!0);
123
- try {
124
- let e = await Z();
125
- if (e.valid) try {
126
- await H.current?.(e.values);
127
- } catch (t) {
128
- U.current?.(t, e.values);
129
- }
130
- else {
131
- W.current?.(e.errors, e.values);
132
- let t = [...L.current.keys()].find((t) => e.errors[t]);
133
- t && i(L.current.get(t)?.metaRef.current.element ?? null);
134
- }
135
- return e;
136
- } finally {
137
- N.current = !1, F(!1);
138
- }
139
- })();
140
- return I.current = e, e.then(() => {
141
- I.current === e && (I.current = null);
142
- }, () => {
143
- I.current === e && (I.current = null);
144
- }), e;
145
- }, [Z]), oe = d((e) => {
146
- let t = k.current, n = {
147
- ...t,
148
- ...e
149
- };
150
- k.current = n;
151
- for (let r of Object.keys(e)) Object.is(t[r], n[r]) || K(r);
152
- V.current?.(e, n);
153
- }, [K]), $ = d(() => {
154
- let e = { ...o }, t = k.current;
155
- k.current = e;
156
- let n = /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(e)]), r = Object.fromEntries([...n].filter((n) => !Object.is(t[n], e[n])).map((t) => [t, e[t]]));
157
- Object.keys(r).length && V.current?.(r, e), n.forEach((n) => {
158
- Object.is(t[n], e[n]) || K(n);
159
- }), q({}), R.current.clear();
160
- let i = M.current;
161
- M.current = {}, Object.keys(i).forEach((e) => {
162
- i[e] && K(e);
163
- });
164
- }, [
165
- q,
166
- o,
167
- K
168
- ]);
169
- p(r, () => ({
170
- getValues: () => k.current,
171
- setValues: oe,
172
- reset: $,
173
- validate: Z,
174
- submit: Q,
175
- isSubmitting: () => N.current,
176
- getErrors: () => A.current
177
- }), [
178
- $,
179
- oe,
180
- Q,
181
- Z
182
- ]);
183
- let se = m(() => ({
184
- defaultValidateTrigger: G,
185
- registerField: J,
186
- updateField: Y,
187
- validateField: X,
188
- subscribeField: ie,
189
- getFieldState: ae
190
- }), [
191
- G,
192
- ae,
193
- J,
194
- ie,
195
- Y,
196
- X
197
- ]), ce = m(() => ({
198
- get values() {
199
- return k.current;
200
- },
201
- get errors() {
202
- return A.current;
203
- },
204
- get validating() {
205
- return M.current;
206
- },
207
- defaultValidateTrigger: G,
208
- registerField: J,
209
- updateField: Y,
210
- validateField: X
211
- }), [
212
- G,
213
- J,
214
- Y,
215
- X
216
- ]), le = {
217
- ...ee,
218
- ...c === void 0 ? null : { "--vl-form-label-width": typeof c == "number" ? `${c}px` : c }
219
- }, ue = [
220
- "vl-form",
221
- `vl-form--${s}`,
222
- `vl-form--label-${l}`,
223
- P ? "is-submitting" : "",
224
- f || ""
225
- ].filter(Boolean).join(" "), de = (e) => {
226
- e.preventDefault(), Q();
227
- }, fe = (e) => {
228
- e.preventDefault(), $();
229
- };
230
- return /* @__PURE__ */ v(te, {
231
- value: se,
232
- children: /* @__PURE__ */ v(ne, {
233
- value: O,
234
- children: /* @__PURE__ */ v(E, {
235
- value: ce,
236
- children: /* @__PURE__ */ v("form", {
237
- ...T,
238
- className: ue,
239
- style: le,
240
- "aria-busy": P || void 0,
241
- noValidate: w,
242
- onSubmit: de,
243
- onReset: fe,
244
- children: _
245
- })
246
- })
247
- })
248
- });
249
- });
250
- M.displayName = "VlForm";
251
- //#endregion
252
- //#region components/Form/FormItem.tsx
253
- var N = [], P = [], F = (e, t) => e ? Array.isArray(e) ? e : [e] : t, I = (e, t) => {
254
- if (e === "checked" && typeof t[1] == "boolean") return t[1];
255
- let n = t[0];
256
- if (n && typeof n == "object" && "target" in n) {
257
- let t = n.target;
258
- if (t) return e === "checked" ? t.checked : t.value;
259
- }
260
- return n;
261
- }, L = ({ id: t, content: n }) => {
262
- let r = h(null), [i, o] = g(!1), s = d(() => {
263
- let e = r.current;
264
- if (!e) return;
265
- let t = e.scrollWidth > e.clientWidth;
266
- o((e) => e === t ? e : t);
267
- }, []);
268
- return e(() => {
269
- s();
270
- let e = r.current, t = typeof ResizeObserver > "u" ? null : new ResizeObserver(s);
271
- return e && t?.observe(e), window.addEventListener("resize", s, { passive: !0 }), () => {
272
- t?.disconnect(), window.removeEventListener("resize", s);
273
- };
274
- }, [n, s]), /* @__PURE__ */ v(a, {
275
- id: t,
276
- className: "vl-form-item__help-tooltip",
277
- content: n,
278
- disabled: !i,
279
- children: /* @__PURE__ */ v("div", {
280
- ref: r,
281
- className: "vl-form-item__help is-text",
282
- tabIndex: i ? 0 : void 0,
283
- children: n
284
- })
285
- });
286
- }, R = c((t, i) => {
287
- let { formControlled: a, formValue: s, name: c, label: u, required: d = !1, rules: f = N, help: p, valuePropName: _ = "value", trigger: b = "onChange", getValueFromEvent: x, validateTrigger: S, className: te, children: w, ...ne } = t, T = C(), E = T?.registerField, O = l(w) ? w : null, k = O?.props ?? {}, re = r("vl-form-control", k.id), A = r("vl-form-label"), j = r("vl-form-help"), M = r("vl-form-error"), R = h(null), z = T?.defaultValidateTrigger ?? P, B = m(() => F(S, z), [z, S]), V = m(() => d && !f.some((e) => e.required) ? [{ required: !0 }, ...f] : f, [d, f]), H = d || V.some((e) => e.required), U = p != null && typeof p != "boolean" && p !== "", W = D(c), G = W.errors, K = W.isValidating, ie = a ? s : W.value, ae = B.includes("change") || G.length > 0, [q] = g(() => Symbol("form-field")), J = h({
288
- label: void 0,
289
- rules: N,
290
- element: null
291
- });
292
- e(() => {
293
- J.current.label = typeof u == "string" ? u : void 0, J.current.rules = V;
294
- }, [V, u]), ee(() => {
295
- if (!(!c || !E)) return E({
296
- name: c,
297
- token: q,
298
- metaRef: J
299
- });
300
- }, [
301
- q,
302
- c,
303
- E
304
- ]);
305
- let Y = G.length > 0, X = U && !Y, Z = {
306
- id: re,
307
- "aria-describedby": [
308
- k["aria-describedby"],
309
- Y ? M : void 0,
310
- X ? j : void 0
311
- ].filter(Boolean).join(" ") || void 0,
312
- "aria-labelledby": [k["aria-labelledby"], u === void 0 ? void 0 : A].filter(Boolean).join(" ") || void 0,
313
- "aria-invalid": G.length > 0 || void 0,
314
- "aria-busy": K || void 0,
315
- ref: (e) => {
316
- R.current = e, J.current.element = e, n(k.ref, e);
317
- }
318
- };
319
- if (c && T) {
320
- Z[_] = ie;
321
- let e = k[b];
322
- if (Z[b] = (...t) => {
323
- typeof e == "function" && e(...t);
324
- let n = x ? x(...t) : I(_, t), r = T.updateField(c, n);
325
- (ae || b === "onBlur" && B.includes("blur")) && T.validateField(c, r);
326
- }, b !== "onBlur") {
327
- let e = k.onBlur;
328
- Z.onBlur = (t) => {
329
- typeof e == "function" && e(t), B.includes("blur") && T.validateField(c);
330
- };
331
- }
332
- }
333
- let Q = O ? o(O, Z) : w, oe = [
334
- "vl-form-item",
335
- c ? "has-name" : "",
336
- u === void 0 ? "" : "has-label",
337
- U ? "has-help" : "",
338
- G.length ? "is-error" : "",
339
- K ? "is-validating" : "",
340
- H ? "is-required" : "",
341
- te || ""
342
- ].filter(Boolean).join(" "), $ = K || G.length > 0;
343
- return /* @__PURE__ */ y("div", {
344
- ...ne,
345
- ref: i,
346
- className: oe,
347
- children: [u === void 0 ? null : /* @__PURE__ */ y("label", {
348
- id: A,
349
- className: "vl-form-item__label",
350
- htmlFor: re,
351
- children: [H ? /* @__PURE__ */ v("span", {
352
- className: "vl-form-item__required",
353
- "aria-hidden": "true",
354
- children: "*"
355
- }) : null, u]
356
- }), /* @__PURE__ */ y("div", {
357
- className: "vl-form-item__control",
358
- children: [/* @__PURE__ */ y("div", {
359
- className: "vl-form-item__field",
360
- children: [/* @__PURE__ */ v("div", {
361
- className: "vl-form-item__control-input",
362
- children: Q
363
- }), c ? /* @__PURE__ */ y("div", {
364
- className: `vl-form-item__validation${$ ? "" : " is-empty"}`,
365
- "aria-hidden": !$ || void 0,
366
- children: [K ? /* @__PURE__ */ y("div", {
367
- className: "vl-form-item__status",
368
- role: "status",
369
- "aria-label": "校验中",
370
- children: [/* @__PURE__ */ v("span", {
371
- className: "vl-form-item__spinner",
372
- "aria-hidden": "true"
373
- }), /* @__PURE__ */ v("span", { children: "校验中" })]
374
- }) : null, G.length ? /* @__PURE__ */ v("div", {
375
- id: M,
376
- className: "vl-form-item__error",
377
- role: "alert",
378
- children: G.map((e) => /* @__PURE__ */ v("div", { children: e }, e))
379
- }) : null]
380
- }) : null]
381
- }), X ? /* @__PURE__ */ v("div", {
382
- className: "vl-form-item__feedback",
383
- children: typeof p == "string" || typeof p == "number" ? /* @__PURE__ */ v(L, {
384
- id: j,
385
- content: p
386
- }) : /* @__PURE__ */ v("div", {
387
- id: j,
388
- className: "vl-form-item__help",
389
- children: p
390
- })
391
- }) : null]
392
- })]
393
- });
394
- }), z = u(R, (e, t) => {
395
- if (e.formControlled !== t.formControlled || !Object.is(e.formValue, t.formValue) || e.name !== t.name || e.label !== t.label || e.required !== t.required || e.help !== t.help || e.valuePropName !== t.valuePropName || e.trigger !== t.trigger || e.getValueFromEvent !== t.getValueFromEvent || e.validateTrigger !== t.validateTrigger || e.className !== t.className || e.style !== t.style) return !1;
396
- if (e.rules !== t.rules) {
397
- let n = e.rules ?? N, r = t.rules ?? N;
398
- if (n.length !== r.length) return !1;
399
- for (let e = 0; e < n.length; e++) if (n[e] !== r[e]) return !1;
400
- }
401
- if (e.children !== t.children) {
402
- let n = e.children, r = t.children;
403
- if (!l(n) || !l(r)) return Object.is(n, r);
404
- if (n.type !== r.type || n.key !== r.key) return !1;
405
- let i = n.props, a = r.props, o = Object.keys(i), s = Object.keys(a);
406
- if (o.length !== s.length) return !1;
407
- for (let e of o) if (!Object.is(i[e], a[e])) return !1;
408
- }
409
- let n = /* @__PURE__ */ new Set([
410
- "formControlled",
411
- "formValue",
412
- "name",
413
- "label",
414
- "required",
415
- "rules",
416
- "help",
417
- "valuePropName",
418
- "trigger",
419
- "getValueFromEvent",
420
- "validateTrigger",
421
- "className",
422
- "style",
423
- "children"
424
- ]), r = e, i = t;
425
- for (let t of Object.keys(e)) if (!n.has(t) && !Object.is(r[t], i[t])) return !1;
426
- for (let e of Object.keys(t)) if (!n.has(e) && !Object.is(r[e], i[e])) return !1;
427
- return !0;
428
- }), B = c((e, t) => {
429
- let n = T();
430
- return /* @__PURE__ */ v(z, {
431
- ...e,
432
- ref: t,
433
- formControlled: n !== null,
434
- formValue: e.name ? n?.[e.name] : void 0
435
- });
436
- });
437
- B.displayName = "VlFormItem";
438
- //#endregion
439
- //#region components/Form/index.ts
440
- var V = Object.assign(M, { Item: B }), H = B;
441
- //#endregion
442
- export { H as n, V as t };
@@ -1,104 +0,0 @@
1
- import { n as e } from "./icon-Cbvuv4yF.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 "./id-CHixuHb7.js";
5
- import { X as a } from "lucide-react";
6
- import { forwardRef as o, useMemo as s, useRef as c, useState as l } from "react";
7
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
- //#region components/Input/Input.tsx
9
- var f = o((o, f) => {
10
- let { value: p, defaultValue: m = "", placeholder: h, disabled: g = !1, loading: _ = !1, size: v = "md", type: y = "text", clearable: b = !1, prefixIcon: x, suffixIcon: S, tips: C, prefix: w, suffix: T, id: E, "aria-describedby": D, className: O, style: k, onClear: A, onInput: j, onChange: M, onFocus: N, onBlur: P, onKeyDown: F, ...I } = o, L = c(null), R = s(() => r(L, f), [f]), [z, B] = l(!1), V = n(o, "value"), [H, U] = t({
11
- value: p == null ? "" : String(p),
12
- defaultValue: m == null ? "" : String(m),
13
- controlled: V,
14
- onChange: M
15
- }), W = i("vl-input", E), G = i("vl-input-tips"), K = [D, C ? G : void 0].filter(Boolean).join(" ") || void 0, q = [
16
- "vl-input-wrapper",
17
- C ? "has-tips" : "",
18
- O || ""
19
- ].filter(Boolean).join(" "), J = [
20
- "vl-input",
21
- v ? `size-${v}` : "",
22
- g ? "is-disabled" : "",
23
- _ ? "is-loading" : "",
24
- z ? "is-focused" : ""
25
- ].filter(Boolean).join(" "), Y = b && !g && !_ && H !== "" && H != null, X = (e) => {
26
- j?.(e);
27
- }, Z = (e) => {
28
- let t = e.target;
29
- U(t.value);
30
- }, Q = (e) => {
31
- B(!0), N?.(e);
32
- }, $ = (e) => {
33
- B(!1), P?.(e);
34
- }, ee = (e) => {
35
- F?.(e);
36
- }, te = () => {
37
- U(""), A?.(), L.current?.focus();
38
- };
39
- return /* @__PURE__ */ d("div", {
40
- className: q,
41
- style: k,
42
- children: [/* @__PURE__ */ d("div", {
43
- className: J,
44
- children: [
45
- w ? /* @__PURE__ */ u("div", {
46
- className: "vl-input__prefix",
47
- children: w
48
- }) : null,
49
- x ? /* @__PURE__ */ u("div", {
50
- className: "vl-input__prefix-icon",
51
- children: e(x)
52
- }) : null,
53
- /* @__PURE__ */ u("input", {
54
- ref: R,
55
- id: W,
56
- className: "vl-input__inner",
57
- type: y,
58
- value: H,
59
- placeholder: h,
60
- disabled: g || _,
61
- "aria-busy": _ || void 0,
62
- "aria-describedby": K,
63
- onInput: X,
64
- onChange: Z,
65
- onFocus: Q,
66
- onBlur: $,
67
- onKeyDown: ee,
68
- ...I
69
- }),
70
- b && !g && !_ ? /* @__PURE__ */ u("button", {
71
- type: "button",
72
- className: `vl-input__clear${Y ? " can-clear" : ""}`,
73
- "aria-label": "清空输入",
74
- "aria-hidden": !Y || void 0,
75
- tabIndex: Y ? 0 : -1,
76
- onClick: te,
77
- onMouseDown: (e) => e.preventDefault(),
78
- children: /* @__PURE__ */ u(a, {
79
- size: 16,
80
- "aria-hidden": "true"
81
- })
82
- }) : null,
83
- S ? /* @__PURE__ */ u("div", {
84
- className: "vl-input__suffix-icon",
85
- children: e(S)
86
- }) : null,
87
- T ? /* @__PURE__ */ u("div", {
88
- className: "vl-input__suffix",
89
- children: T
90
- }) : null
91
- ]
92
- }), C ? /* @__PURE__ */ u("div", {
93
- id: G,
94
- className: "vl-input__tips",
95
- children: C
96
- }) : null]
97
- });
98
- });
99
- f.displayName = "VlInput";
100
- //#endregion
101
- //#region components/Input/index.ts
102
- var p = f, m = f;
103
- //#endregion
104
- export { p as n, m as t };
@@ -1 +0,0 @@
1
- const e=require("./icon-DRLyKu8p.cjs"),t=require("./state-BuUx1onZ.cjs"),n=require("./refs-DCqd87V8.cjs"),r=require("./id-CF0zOP1G.cjs");let i=require("lucide-react"),a=require("react"),o=require("react/jsx-runtime");var s=(0,a.forwardRef)((s,c)=>{let{value:l,defaultValue:u=``,placeholder:d,disabled:f=!1,loading:p=!1,size:m=`md`,type:h=`text`,clearable:g=!1,prefixIcon:_,suffixIcon:v,tips:y,prefix:b,suffix:x,id:S,"aria-describedby":C,className:w,style:T,onClear:E,onInput:D,onChange:O,onFocus:k,onBlur:A,onKeyDown:j,...M}=s,N=(0,a.useRef)(null),P=(0,a.useMemo)(()=>n.n(N,c),[c]),[F,I]=(0,a.useState)(!1),L=t.t(s,`value`),[R,z]=t.n({value:l==null?``:String(l),defaultValue:u==null?``:String(u),controlled:L,onChange:O}),B=r.t(`vl-input`,S),V=r.t(`vl-input-tips`),H=[C,y?V:void 0].filter(Boolean).join(` `)||void 0,U=[`vl-input-wrapper`,y?`has-tips`:``,w||``].filter(Boolean).join(` `),W=[`vl-input`,m?`size-${m}`:``,f?`is-disabled`:``,p?`is-loading`:``,F?`is-focused`:``].filter(Boolean).join(` `),G=g&&!f&&!p&&R!==``&&R!=null,K=e=>{D?.(e)},q=e=>{let t=e.target;z(t.value)},J=e=>{I(!0),k?.(e)},Y=e=>{I(!1),A?.(e)},X=e=>{j?.(e)},Z=()=>{z(``),E?.(),N.current?.focus()};return(0,o.jsxs)(`div`,{className:U,style:T,children:[(0,o.jsxs)(`div`,{className:W,children:[b?(0,o.jsx)(`div`,{className:`vl-input__prefix`,children:b}):null,_?(0,o.jsx)(`div`,{className:`vl-input__prefix-icon`,children:e.n(_)}):null,(0,o.jsx)(`input`,{ref:P,id:B,className:`vl-input__inner`,type:h,value:R,placeholder:d,disabled:f||p,"aria-busy":p||void 0,"aria-describedby":H,onInput:K,onChange:q,onFocus:J,onBlur:Y,onKeyDown:X,...M}),g&&!f&&!p?(0,o.jsx)(`button`,{type:`button`,className:`vl-input__clear${G?` can-clear`:``}`,"aria-label":`清空输入`,"aria-hidden":!G||void 0,tabIndex:G?0:-1,onClick:Z,onMouseDown:e=>e.preventDefault(),children:(0,o.jsx)(i.X,{size:16,"aria-hidden":`true`})}):null,v?(0,o.jsx)(`div`,{className:`vl-input__suffix-icon`,children:e.n(v)}):null,x?(0,o.jsx)(`div`,{className:`vl-input__suffix`,children:x}):null]}),y?(0,o.jsx)(`div`,{id:V,className:`vl-input__tips`,children:y}):null]})});s.displayName=`VlInput`;var c=s,l=s;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
@@ -1 +0,0 @@
1
- let e=require("react"),t=require("react/jsx-runtime");var n=(0,e.createContext)({gutter:0}),r=(0,e.forwardRef)((e,r)=>{let{tag:i=`div`,gutter:a=0,justify:o=`start`,align:s=`top`,className:c,style:l,children:u,...d}=e,f=Number.isFinite(a)?Math.max(0,a):0,p=[`vl-row`,`is-justify-${o}`,`is-align-${s}`,c||``].filter(Boolean).join(` `),m={...l};return f&&(m.marginLeft=`-${f/2}px`,m.marginRight=`-${f/2}px`),(0,t.jsx)(n.Provider,{value:{gutter:f},children:(0,t.jsx)(i,{ref:r,className:p,style:m,...d,children:u})})});r.displayName=`VlRow`,Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
@@ -1,24 +0,0 @@
1
- import { createContext as e, forwardRef as t } from "react";
2
- import { jsx as n } from "react/jsx-runtime";
3
- //#region components/Row/Row.tsx
4
- var r = e({ gutter: 0 }), i = t((e, t) => {
5
- let { tag: i = "div", gutter: a = 0, justify: o = "start", align: s = "top", className: c, style: l, children: u, ...d } = e, f = Number.isFinite(a) ? Math.max(0, a) : 0, p = [
6
- "vl-row",
7
- `is-justify-${o}`,
8
- `is-align-${s}`,
9
- c || ""
10
- ].filter(Boolean).join(" "), m = { ...l };
11
- return f && (m.marginLeft = `-${f / 2}px`, m.marginRight = `-${f / 2}px`), /* @__PURE__ */ n(r.Provider, {
12
- value: { gutter: f },
13
- children: /* @__PURE__ */ n(i, {
14
- ref: t,
15
- className: p,
16
- style: m,
17
- ...d,
18
- children: u
19
- })
20
- });
21
- });
22
- i.displayName = "VlRow";
23
- //#endregion
24
- export { r as n, i as t };
@@ -1 +0,0 @@
1
- const e=require("./icon-DRLyKu8p.cjs"),t=require("./state-BuUx1onZ.cjs"),n=require("./refs-DCqd87V8.cjs"),r=require("./Transition-X_89ga-e.cjs"),i=require("./client-BkoqeUs3.cjs"),ee=require("./floating-5PRFyI8D.cjs"),te=require("./id-CF0zOP1G.cjs"),a=require("./layer-DL1xVbJT.cjs");let o=require("lucide-react"),s=require("react"),c=require("react/jsx-runtime"),ne=require("react-dom");var l=e=>!!(e&&!e.disabled&&!e.divider),u=(0,s.forwardRef)((u,d)=>{let{value:re,defaultValue:ie,options:f=[],placeholder:p=`请选择`,filterable:ae=!1,filterPlaceholder:oe=`搜索`,multiple:se=!1,taggable:m=!1,maxTagCount:h,disabled:g=!1,loading:_=!1,size:ce=`md`,clearable:le=!1,placement:v=`bottom-start`,offset:ue=8,zIndex:de,emptyText:fe=`暂无数据`,renderOption:pe,emptyContent:me,className:he,style:ge,onChange:_e,onClear:ve,onOpen:y,onClose:ye,onFocus:be,onBlur:xe,id:Se,"aria-label":Ce,"aria-labelledby":we,"aria-describedby":Te,tabIndex:Ee,...De}=u,Oe=(0,s.useRef)(null),b=(0,s.useRef)(null),x=(0,s.useRef)(null),ke=(0,s.useRef)(null),Ae=(0,s.useRef)([]),je=(0,s.useMemo)(()=>n.n(Oe,d),[d]),S=i.t(),Me=a.a({defaultZIndex:a.r.dropdown,zIndex:de}),C=ae||m,w=se||m,Ne=(0,s.useMemo)(()=>w?[]:null,[w]),Pe=t.t(u,`value`),T=(0,s.useRef)(void 0),[E,Fe]=t.n({value:re??Ne,defaultValue:ie??Ne,controlled:Pe,onChange:e=>{let t=T.current;T.current=void 0,_e?.(e,t)}}),[D,Ie]=(0,s.useState)(!1),[Le,O]=(0,s.useState)(!1),[k,A]=(0,s.useState)(``),[Re,j]=(0,s.useState)([]),[ze,Be]=(0,s.useState)({}),[M,Ve]=(0,s.useState)(v),[N,P]=(0,s.useState)(-1),He=te.t(`vl-select-control`,Se),F=te.t(`vl-select-listbox`),Ue=(0,s.useCallback)(e=>`${F}-option-${e}`,[F]),We=(0,s.useMemo)(()=>[`vl-select-wrapper`,he||``].filter(Boolean).join(` `),[he]),Ge=(0,s.useMemo)(()=>[`vl-select`,`size-${ce}`,w?`is-multiple`:``,D?`is-open`:``,Le?`is-focus-within`:``,g?`is-disabled`:``,_?`is-loading`:``].filter(Boolean).join(` `),[ce,w,D,Le,g,_]),I=(0,s.useMemo)(()=>{if(!m)return f;let e=Re.filter(e=>!f.some(t=>t.value===e.value));return[...f,...e]},[f,Re,m]),L=(0,s.useMemo)(()=>{if(!C||!D)return I;let e=k.trim().toLocaleLowerCase();return e?I.filter(t=>!t.divider&&t.label.toLocaleLowerCase().includes(e)):I},[I,C,D,k]),R=(0,s.useMemo)(()=>L.flatMap((e,t)=>l(e)?[t]:[]),[L]),Ke=L.some(e=>!e.divider),z=(0,s.useMemo)(()=>w&&Array.isArray(E)?E:[],[w,E]),B=(0,s.useMemo)(()=>{if(!(w||Array.isArray(E)))return I.find(e=>e.value===E)},[I,w,E]),V=(0,s.useMemo)(()=>w?``:B?B.label:E===null||E===``||Array.isArray(E)?``:String(E),[w,B,E]),H=(0,s.useMemo)(()=>z.map(e=>({value:e,label:I.find(t=>t.value===e)?.label??String(e)})),[z,I]),qe=(0,s.useMemo)(()=>!w||h===void 0||!Number.isFinite(h)?1/0:Math.max(0,Math.floor(h)),[w,h]),Je=qe===1/0?H:H.slice(0,qe),U=Math.max(0,H.length-Je.length),Ye=w?z.length>0:E!==null&&E!==``&&!Array.isArray(E),Xe=le&&!g&&!_&&Ye,Ze=N>=0&&l(L[N])?Ue(N):void 0,Qe=(0,s.useMemo)(()=>[`vl-select__panel`,`is-${M}`].join(` `),[M]),W=(0,s.useCallback)(e=>{e&&(g||_)||D!==e&&(Ie(e),e?y?.():ye?.())},[g,_,y,ye,D]),G=(0,s.useCallback)(e=>w?z.includes(e.value):e.value===E,[w,z,E]),K=(0,s.useCallback)((e,t)=>{T.current=t,Fe(e),T.current=void 0},[Fe]),q=(0,s.useCallback)(e=>{m&&j(t=>t.filter(t=>e.includes(t.value)))},[m]),J=(0,s.useCallback)(e=>{if(l(e)){if(w){let t=z.includes(e.value)?z.filter(t=>t!==e.value):[...z,e.value];K(t,e),q(t),A(``);return}K(e.value,e),A(e.label),W(!1)}},[w,z,K,q,W]),$e=(0,s.useCallback)(e=>{if(!m)return!1;let t=e.trim();if(!t)return!1;let n=t.toLocaleLowerCase(),r=I.find(e=>e.label.toLocaleLowerCase()===n||String(e.value).toLocaleLowerCase()===n);if(r)return G(r)?A(``):J(r),!0;let i={label:t,value:t};return j(e=>[...e,i]),J(i),!0},[m,I,G,J]),Y=(0,s.useCallback)(()=>{let e=L.findIndex(e=>l(e)&&G(e));return e>=0?e:R[0]??-1},[L,R,G]),X=(0,s.useCallback)(e=>{l(L[e])&&(P(e),Ae.current[e]?.scrollIntoView?.({block:`nearest`}))},[L]),et=(0,s.useCallback)(e=>{if(!R.length)return;let t=R.indexOf(N),n=(t>=0?t+e:(e>0?-1:0)+e+R.length)%R.length;X(R[n])},[R,N,X]),tt=(0,s.useCallback)(()=>{let e=R[0];e!==void 0&&X(e)},[R,X]),nt=(0,s.useCallback)(()=>{let e=R.at(-1);e!==void 0&&X(e)},[R,X]),Z=(0,s.useCallback)(()=>{if(!D)return;let e=b.current,t=x.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=ee.t({anchorRect:n,floatingRect:t.getBoundingClientRect(),placement:v,offset:ue});Ve(r.placement),Be({left:`${Math.round(r.x)}px`,top:`${Math.round(r.y)}px`,minWidth:`${Math.round(n.width)}px`})},[D,v,ue]),Q=(0,s.useCallback)(()=>{C?ke.current?.focus():b.current?.focus()},[C]),$=(0,s.useCallback)((e=`first`)=>{if(g||_)return;D||(C&&A(``),W(!0));let t=e===`last`?R.at(-1):Y();t!==void 0&&t>=0&&P(t),window.requestAnimationFrame(()=>{Q(),Z()})},[g,_,D,C,W,R,Y,Q,Z]),rt=(0,s.useCallback)(()=>{W(!1),window.requestAnimationFrame(Q)},[W,Q]),it=(0,s.useCallback)(()=>{let e=L[N];return l(e)?(J(e),!0):!1},[L,N,J]),at=e=>{if(!(g||_)&&!e.target.closest(`button`)){if(C){$();return}D?W(!1):$()}},ot=e=>{if(!(g||_)){if(e.key===`ArrowDown`){e.preventDefault(),D?et(1):$(`first`);return}if(e.key===`ArrowUp`){e.preventDefault(),D?et(-1):$(`last`);return}if(e.key===`Home`&&D&&!C){e.preventDefault(),tt();return}if(e.key===`End`&&D&&!C){e.preventDefault(),nt();return}if(e.key===`Escape`&&D){e.preventDefault(),rt();return}if(e.key===`Tab`&&D){W(!1);return}if(e.key===`Enter`){if(!D){e.preventDefault(),$();return}e.preventDefault(),!it()&&C&&$e(k);return}if(e.key===` `&&!C){e.preventDefault(),D?it():$();return}if(e.key===`Backspace`&&C&&w&&!k&&z.length){let e=z.slice(0,-1);K(e),q(e)}}},st=()=>{g||_||(K(w?[]:null),ve?.(),A(``),q([]),W(!1),Q())},ct=e=>{if(g||_)return;let t=z.filter(t=>t!==e);K(t),q(t)},lt=e=>{e.currentTarget.contains(e.relatedTarget)||(O(!0),be?.(e))},ut=e=>{e.currentTarget.contains(e.relatedTarget)||(O(!1),xe?.(e))};(0,s.useEffect)(()=>{D||(A(w?``:V),P(-1))},[D,w,V]),(0,s.useEffect)(()=>{if(!D||!S)return;P(Y());let e=window.requestAnimationFrame(Z);return()=>window.cancelAnimationFrame(e)},[D,S,L,Y,Z]),(0,s.useEffect)(()=>{if(!m||!w)return;let e=new Set(I.map(e=>e.value)),t=z.filter(t=>!e.has(t));t.length&&j(e=>[...e,...t.map(e=>({label:String(e),value:e}))])},[m,w,I,z]),(0,s.useEffect)(()=>{(g||_)&&D&&W(!1)},[g,_,D,W]),ee.r({active:D&&S,rootRef:Oe,floatingRef:x,onOutsideClick:()=>W(!1),onViewportChange:Z});let dt={role:`combobox`,"aria-controls":F,"aria-expanded":D,"aria-haspopup":`listbox`,"aria-activedescendant":D?Ze:void 0,"aria-disabled":g||_||void 0,"aria-busy":_||void 0,"aria-label":Ce??(we?void 0:p),"aria-labelledby":we,"aria-describedby":Te},ft=C?(0,c.jsx)(`input`,{ref:ke,id:He,className:`vl-select__input`,type:`text`,value:k,placeholder:D?oe:w&&z.length?``:p,disabled:g||_,autoComplete:`off`,"aria-autocomplete":`list`,...dt,tabIndex:Ee,onChange:e=>{A(e.target.value),D||W(!0)},onFocus:()=>{D||$()},onKeyDown:ot}):null,pt=(0,c.jsx)(r.t,{show:D,name:`vl-select`,deferEffects:!S,children:(0,c.jsx)(`div`,{ref:x,id:F,className:Qe,style:{...ze,zIndex:Me.zIndex},role:`listbox`,"aria-hidden":!D||void 0,"aria-multiselectable":w||void 0,children:Ke?(0,c.jsx)(`div`,{className:`vl-select__list`,children:L.map((t,n)=>{if(t.divider)return(0,c.jsx)(`div`,{className:`vl-select__divider`,role:`separator`},`divider-${n}`);let r=G(t),i=[`vl-select__option`,t.disabled?`is-disabled`:``,r?`is-selected`:``,N===n?`is-active`:``].filter(Boolean).join(` `);return(0,c.jsx)(`div`,{ref:e=>{Ae.current[n]=e},id:Ue(n),className:i,role:`option`,"aria-disabled":t.disabled||void 0,"aria-selected":r,onPointerDown:e=>e.preventDefault(),onMouseEnter:()=>{l(t)&&P(n)},onClick:()=>J(t),children:pe?pe(t,n,r):(0,c.jsxs)(c.Fragment,{children:[t.icon?e.t(t.icon,`vl-select__option-icon`):null,(0,c.jsx)(`span`,{className:`vl-select__option-label`,children:t.label})]})},`${String(t.value)}-${n}`)})}):(0,c.jsx)(`div`,{className:`vl-select__empty`,role:`status`,children:me??fe})})});return(0,c.jsx)(a.t,{layer:Me.layer,children:(0,c.jsxs)(`div`,{ref:je,className:We,style:ge,...De,children:[(0,c.jsxs)(`div`,{ref:b,id:C?void 0:He,className:Ge,...C?{}:dt,tabIndex:g||_||C?-1:Ee??0,onClick:at,onKeyDown:C?void 0:ot,onFocus:lt,onBlur:ut,children:[(0,c.jsx)(`div`,{className:`vl-select__value`,children:w?(0,c.jsxs)(`div`,{className:`vl-select__tags`,children:[Je.map(e=>(0,c.jsxs)(`span`,{className:`vl-select__tag`,children:[(0,c.jsx)(`span`,{className:`vl-select__tag-label`,children:e.label}),(0,c.jsx)(`button`,{type:`button`,className:`vl-select__tag-remove`,"aria-label":`移除 ${e.label}`,disabled:g||_,onClick:()=>ct(e.value),onPointerDown:e=>e.stopPropagation(),children:(0,c.jsx)(o.X,{size:12,"aria-hidden":`true`})})]},e.value)),U>0?(0,c.jsxs)(`span`,{className:`vl-select__tag is-collapsed`,"aria-label":`另有 ${U} 项`,children:[`+`,U]}):null,C?ft:H.length?null:(0,c.jsx)(`span`,{className:`vl-select__placeholder`,children:p})]}):C?ft:V?(0,c.jsx)(`span`,{className:`vl-select__label`,children:V}):(0,c.jsx)(`span`,{className:`vl-select__placeholder`,children:p})}),(0,c.jsxs)(`div`,{className:`vl-select__suffix`,children:[Xe?(0,c.jsx)(`button`,{type:`button`,className:`vl-select__clear`,"aria-label":`清除已选`,onClick:st,onPointerDown:e=>e.stopPropagation(),children:(0,c.jsx)(o.X,{size:16,"aria-hidden":`true`})}):null,_?(0,c.jsx)(o.LoaderCircle,{className:`vl-select__loading`,size:16,"aria-hidden":`true`}):(0,c.jsx)(`span`,{className:`vl-select__arrow`,"aria-hidden":`true`,children:(0,c.jsx)(o.ChevronDown,{size:16})})]})]}),S?(0,ne.createPortal)(pt,document.body):pt]})})});u.displayName=`VlSelect`;var d=u,re=u;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return re}});