@vavt/react-ui 1.0.1 → 1.0.3

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 (168) hide show
  1. package/README.md +50 -2
  2. package/dist/Card-BkZhLXQ5.cjs +1 -0
  3. package/dist/{Card-DlztNV-6.js → Card-DCLfLn1x.js} +13 -12
  4. package/dist/Cron-3D9GmlYf.cjs +1 -0
  5. package/dist/{Cron-Di7k2FTL.js → Cron-Go4yIqrd.js} +361 -353
  6. package/dist/{DatePicker-M-MwejjV.js → DatePicker-B-F5q_s_.js} +1 -1
  7. package/dist/{DatePicker-DAxv2h-d.cjs → DatePicker-CoHW85qm.cjs} +1 -1
  8. package/dist/{DateTimePicker-BcT3FtN-.js → DateTimePicker-BSBZZ7xV.js} +1 -1
  9. package/dist/{DateTimePicker-B3C3v99L.cjs → DateTimePicker-CAkdoY--.cjs} +1 -1
  10. package/dist/Divider-BXNZyvHY.js +48 -0
  11. package/dist/Divider-BnmUNmy2.cjs +1 -0
  12. package/dist/Drawer-C0toQ-fQ.js +112 -0
  13. package/dist/Drawer-D45miZ27.cjs +1 -0
  14. package/dist/Dropdown-BsXYVdt6.cjs +1 -0
  15. package/dist/Dropdown-DljKFnvO.js +319 -0
  16. package/dist/Empty-Dny96c3p.cjs +1 -0
  17. package/dist/Empty-MmxZitR8.js +40 -0
  18. package/dist/{MessageBox-CrIifoig.js → MessageBox-B4Qo1vs2.js} +1 -1
  19. package/dist/{MessageBox-Ddn-R2MS.cjs → MessageBox-CTJfdU29.cjs} +1 -1
  20. package/dist/Modal-i_Do8GsG.cjs +1 -0
  21. package/dist/Modal-otJ_9ldu.js +210 -0
  22. package/dist/{Pagination-DKEL6maR.js → Pagination-CSI5IzQB.js} +1 -1
  23. package/dist/{Pagination-DaMWXFn5.cjs → Pagination-ODU-i3gn.cjs} +1 -1
  24. package/dist/Select-BRKxpX-_.cjs +1 -0
  25. package/dist/Select-QedbJ4pD.js +468 -0
  26. package/dist/{Table-C8cSyts5.js → Table-B9NTkptC.js} +1 -1
  27. package/dist/{Table-JoJ9vpu-.cjs → Table-Bqjey5fw.cjs} +1 -1
  28. package/dist/TimePicker-CHZsr_jj.js +207 -0
  29. package/dist/TimePicker-Cpmvn8tx.cjs +1 -0
  30. package/dist/Tooltip-Buk5F9f_.js +205 -0
  31. package/dist/Tooltip-CP8rpNYG.cjs +1 -0
  32. package/dist/Upload-DZC_bt6G.js +183 -0
  33. package/dist/Upload-bxJz2avf.cjs +1 -0
  34. package/dist/base.css +1 -1
  35. package/dist/cjs/Card.cjs +1 -1
  36. package/dist/cjs/Cron.cjs +1 -1
  37. package/dist/cjs/DatePicker.cjs +1 -1
  38. package/dist/cjs/DateTimePicker.cjs +1 -1
  39. package/dist/cjs/Divider.cjs +1 -1
  40. package/dist/cjs/Drawer.cjs +1 -1
  41. package/dist/cjs/Dropdown.cjs +1 -1
  42. package/dist/cjs/Empty.cjs +1 -0
  43. package/dist/cjs/MessageBox.cjs +1 -1
  44. package/dist/cjs/Modal.cjs +1 -1
  45. package/dist/cjs/Pagination.cjs +1 -1
  46. package/dist/cjs/Select.cjs +1 -1
  47. package/dist/cjs/Table.cjs +1 -1
  48. package/dist/cjs/TimePicker.cjs +1 -1
  49. package/dist/cjs/Tooltip.cjs +1 -1
  50. package/dist/cjs/Upload.cjs +1 -0
  51. package/dist/cjs/global.cjs +1 -1
  52. package/dist/cjs/index.cjs +1 -1
  53. package/dist/cjs/register.cjs +1 -1
  54. package/dist/content-DCGQZQp8.cjs +1 -0
  55. package/dist/content-Dllrr-7G.js +11 -0
  56. package/dist/css/Alert.css +1 -1
  57. package/dist/css/Announcement.css +1 -1
  58. package/dist/css/Button.css +1 -1
  59. package/dist/css/Checkbox.css +1 -1
  60. package/dist/css/Cron.css +1 -1
  61. package/dist/css/DatePicker.css +1 -1
  62. package/dist/css/DateTimePicker.css +1 -1
  63. package/dist/css/Dropdown.css +1 -1
  64. package/dist/css/Empty.css +1 -0
  65. package/dist/css/Form.css +1 -1
  66. package/dist/css/Input.css +1 -1
  67. package/dist/css/MessageBox.css +1 -1
  68. package/dist/css/NumberInput.css +1 -1
  69. package/dist/css/Pagination.css +1 -1
  70. package/dist/css/Radio.css +1 -1
  71. package/dist/css/Scrollbar.css +1 -1
  72. package/dist/css/Select.css +1 -1
  73. package/dist/css/Sidebar.css +1 -1
  74. package/dist/css/Switch.css +1 -1
  75. package/dist/css/Table.css +1 -1
  76. package/dist/css/Tabs.css +1 -1
  77. package/dist/css/Tag.css +1 -1
  78. package/dist/css/Textarea.css +1 -1
  79. package/dist/css/TimePicker.css +1 -1
  80. package/dist/css/Timeline.css +1 -1
  81. package/dist/css/Upload.css +1 -0
  82. package/dist/date-picker-BsiNrLZC.js +592 -0
  83. package/dist/date-picker-DNN0BiRA.cjs +1 -0
  84. package/dist/es/Card.mjs +1 -1
  85. package/dist/es/Cron.mjs +1 -1
  86. package/dist/es/DatePicker.mjs +1 -1
  87. package/dist/es/DateTimePicker.mjs +1 -1
  88. package/dist/es/Divider.mjs +1 -1
  89. package/dist/es/Drawer.mjs +1 -1
  90. package/dist/es/Dropdown.mjs +1 -1
  91. package/dist/es/Empty.mjs +3 -0
  92. package/dist/es/MessageBox.mjs +1 -1
  93. package/dist/es/Modal.mjs +1 -1
  94. package/dist/es/Pagination.mjs +1 -1
  95. package/dist/es/Select.mjs +1 -1
  96. package/dist/es/Table.mjs +1 -1
  97. package/dist/es/TimePicker.mjs +1 -1
  98. package/dist/es/Tooltip.mjs +1 -1
  99. package/dist/es/Upload.mjs +3 -0
  100. package/dist/es/global.mjs +1 -1
  101. package/dist/es/index.mjs +31 -29
  102. package/dist/es/register.mjs +1 -1
  103. package/dist/index.css +1 -1
  104. package/dist/layer-BgiUZy_t.cjs +1 -0
  105. package/dist/layer-DDm97-sb.js +53 -0
  106. package/dist/registry-BGNWNSiC.cjs +1 -0
  107. package/dist/registry-q6UdMOyj.js +83 -0
  108. package/dist/style/Empty.cjs +7 -0
  109. package/dist/style/Empty.mjs +7 -0
  110. package/dist/style/Upload.cjs +7 -0
  111. package/dist/style/Upload.mjs +7 -0
  112. package/dist/types/Col/type.d.cts +5 -5
  113. package/dist/types/Col/type.d.ts +5 -5
  114. package/dist/types/Cron/type.d.cts +2 -0
  115. package/dist/types/Cron/type.d.ts +2 -0
  116. package/dist/types/DatePicker/type.d.cts +2 -0
  117. package/dist/types/DatePicker/type.d.ts +2 -0
  118. package/dist/types/Dropdown/type.d.cts +2 -0
  119. package/dist/types/Dropdown/type.d.ts +2 -0
  120. package/dist/types/Empty/Empty.d.cts +3 -0
  121. package/dist/types/Empty/Empty.d.ts +3 -0
  122. package/dist/types/Empty/index.d.cts +5 -0
  123. package/dist/types/Empty/index.d.ts +5 -0
  124. package/dist/types/Empty/type.d.cts +24 -0
  125. package/dist/types/Empty/type.d.ts +24 -0
  126. package/dist/types/Select/type.d.cts +2 -0
  127. package/dist/types/Select/type.d.ts +2 -0
  128. package/dist/types/TimePicker/type.d.cts +2 -0
  129. package/dist/types/TimePicker/type.d.ts +2 -0
  130. package/dist/types/Tooltip/type.d.cts +2 -0
  131. package/dist/types/Tooltip/type.d.ts +2 -0
  132. package/dist/types/Upload/Upload.d.cts +3 -0
  133. package/dist/types/Upload/Upload.d.ts +3 -0
  134. package/dist/types/Upload/index.d.cts +5 -0
  135. package/dist/types/Upload/index.d.ts +5 -0
  136. package/dist/types/Upload/type.d.cts +62 -0
  137. package/dist/types/Upload/type.d.ts +62 -0
  138. package/dist/types/_shared/content.d.cts +13 -0
  139. package/dist/types/_shared/content.d.ts +13 -0
  140. package/dist/types/_shared/layer.d.cts +63 -0
  141. package/dist/types/_shared/layer.d.ts +63 -0
  142. package/dist/types/global.d.cts +4 -0
  143. package/dist/types/global.d.ts +4 -0
  144. package/dist/types/index.d.cts +2 -0
  145. package/dist/types/index.d.ts +2 -0
  146. package/dist/types/registry.d.cts +2 -0
  147. package/dist/types/registry.d.ts +2 -0
  148. package/package.json +2 -4
  149. package/dist/Card-nILlh9c_.cjs +0 -1
  150. package/dist/Cron-CoO2Vnnm.cjs +0 -1
  151. package/dist/Divider-BfvQ6BVP.cjs +0 -1
  152. package/dist/Divider-vyftxh3F.js +0 -47
  153. package/dist/Drawer-D28QbyA3.js +0 -103
  154. package/dist/Drawer-OmMfdgKN.cjs +0 -1
  155. package/dist/Dropdown-CYx6RxVv.js +0 -311
  156. package/dist/Dropdown-swfND4yK.cjs +0 -1
  157. package/dist/Modal-B_VqN16m.js +0 -201
  158. package/dist/Modal-Dm48HmGu.cjs +0 -1
  159. package/dist/Select-DQLup8Y-.cjs +0 -1
  160. package/dist/Select-DccM9YpB.js +0 -458
  161. package/dist/TimePicker-ClQCHa6M.js +0 -199
  162. package/dist/TimePicker-DNBo2Rn5.cjs +0 -1
  163. package/dist/Tooltip-CbPYYr6R.cjs +0 -1
  164. package/dist/Tooltip-Ds4Odm7K.js +0 -197
  165. package/dist/date-picker-DkRwNu2m.js +0 -584
  166. package/dist/date-picker-DyGLrw5H.cjs +0 -1
  167. package/dist/registry-BYA5h9pE.cjs +0 -1
  168. package/dist/registry-rrmu3kvY.js +0 -79
@@ -1,458 +0,0 @@
1
- import { t as e } from "./icon-Cbvuv4yF.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 te } from "./floating-DBAmeQIq.js";
6
- import { t as ne } from "./id-CHixuHb7.js";
7
- import { t as re } from "./Transition-DiO4GsP3.js";
8
- import { ChevronDown as ie, LoaderCircle as ae, X as oe } from "lucide-react";
9
- import { forwardRef as a, useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
10
- import { Fragment as se, jsx as d, jsxs as f } from "react/jsx-runtime";
11
- import { createPortal as ce } from "react-dom";
12
- //#region components/Select/Select.tsx
13
- var p = (e) => !!(e && !e.disabled && !e.divider), m = a((a, m) => {
14
- let { value: le, defaultValue: ue, options: h = [], placeholder: g = "请选择", filterable: de = !1, filterPlaceholder: fe = "搜索", multiple: pe = !1, taggable: _ = !1, maxTagCount: v, disabled: y = !1, loading: b = !1, size: me = "md", clearable: he = !1, placement: x = "bottom-start", offset: ge = 8, emptyText: _e = "暂无数据", renderOption: ve, emptyContent: ye, className: be, style: xe, onChange: Se, onClear: Ce, onOpen: we, onClose: Te, onFocus: Ee, onBlur: De, id: Oe, "aria-label": ke, "aria-labelledby": Ae, "aria-describedby": je, tabIndex: Me, ...Ne } = a, Pe = l(null), S = l(null), C = l(null), Fe = l(null), Ie = l([]), Le = c(() => i(Pe, m), [m]), w = r(), T = de || _, E = pe || _, Re = c(() => E ? [] : null, [E]), ze = n(a, "value"), D = l(void 0), [O, Be] = t({
15
- value: le ?? Re,
16
- defaultValue: ue ?? Re,
17
- controlled: ze,
18
- onChange: (e) => {
19
- let t = D.current;
20
- D.current = void 0, Se?.(e, t);
21
- }
22
- }), [k, Ve] = u(!1), [He, Ue] = u(!1), [We, Ge] = u(!1), [A, j] = u(""), [Ke, M] = u([]), [qe, Je] = u({}), [Ye, Xe] = u(x), [N, P] = u(-1), Ze = ne("vl-select-control", Oe), F = ne("vl-select-listbox"), Qe = o((e) => `${F}-option-${e}`, [F]), $e = c(() => ["vl-select-wrapper", be || ""].filter(Boolean).join(" "), [be]), et = c(() => [
23
- "vl-select",
24
- `size-${me}`,
25
- E ? "is-multiple" : "",
26
- k ? "is-open" : "",
27
- We ? "is-focus-within" : "",
28
- y ? "is-disabled" : "",
29
- b ? "is-loading" : ""
30
- ].filter(Boolean).join(" "), [
31
- me,
32
- E,
33
- k,
34
- We,
35
- y,
36
- b
37
- ]), I = c(() => {
38
- if (!_) return h;
39
- let e = Ke.filter((e) => !h.some((t) => t.value === e.value));
40
- return [...h, ...e];
41
- }, [
42
- h,
43
- Ke,
44
- _
45
- ]), L = c(() => {
46
- if (!T || !k) return I;
47
- let e = A.trim().toLocaleLowerCase();
48
- return e ? I.filter((t) => !t.divider && t.label.toLocaleLowerCase().includes(e)) : I;
49
- }, [
50
- I,
51
- T,
52
- k,
53
- A
54
- ]), R = c(() => L.flatMap((e, t) => p(e) ? [t] : []), [L]), tt = L.some((e) => !e.divider), z = c(() => E && Array.isArray(O) ? O : [], [E, O]), B = c(() => {
55
- if (!(E || Array.isArray(O))) return I.find((e) => e.value === O);
56
- }, [
57
- I,
58
- E,
59
- O
60
- ]), V = c(() => E ? "" : B ? B.label : O === null || O === "" || Array.isArray(O) ? "" : String(O), [
61
- E,
62
- B,
63
- O
64
- ]), H = c(() => z.map((e) => ({
65
- value: e,
66
- label: I.find((t) => t.value === e)?.label ?? String(e)
67
- })), [z, I]), nt = c(() => !E || v === void 0 || !Number.isFinite(v) ? Infinity : Math.max(0, Math.floor(v)), [E, v]), rt = nt === Infinity ? H : H.slice(0, nt), U = Math.max(0, H.length - rt.length), it = E ? z.length > 0 : O !== null && O !== "" && !Array.isArray(O), at = he && !y && !b && it && (He || We || k), ot = N >= 0 && p(L[N]) ? Qe(N) : void 0, st = c(() => ["vl-select__panel", `is-${Ye}`].join(" "), [Ye]), W = o((e) => {
68
- e && (y || b) || k !== e && (Ve(e), e ? we?.() : Te?.());
69
- }, [
70
- y,
71
- b,
72
- we,
73
- Te,
74
- k
75
- ]), G = o((e) => E ? z.includes(e.value) : e.value === O, [
76
- E,
77
- z,
78
- O
79
- ]), K = o((e, t) => {
80
- D.current = t, Be(e), D.current = void 0;
81
- }, [Be]), q = o((e) => {
82
- _ && M((t) => t.filter((t) => e.includes(t.value)));
83
- }, [_]), J = o((e) => {
84
- if (p(e)) {
85
- if (E) {
86
- let t = z.includes(e.value) ? z.filter((t) => t !== e.value) : [...z, e.value];
87
- K(t, e), q(t), j("");
88
- return;
89
- }
90
- K(e.value, e), j(e.label), W(!1);
91
- }
92
- }, [
93
- E,
94
- z,
95
- K,
96
- q,
97
- W
98
- ]), ct = o((e) => {
99
- if (!_) return !1;
100
- let t = e.trim();
101
- if (!t) return !1;
102
- let n = t.toLocaleLowerCase(), r = I.find((e) => e.label.toLocaleLowerCase() === n || String(e.value).toLocaleLowerCase() === n);
103
- if (r) return G(r) ? j("") : J(r), !0;
104
- let i = {
105
- label: t,
106
- value: t
107
- };
108
- return M((e) => [...e, i]), J(i), !0;
109
- }, [
110
- _,
111
- I,
112
- G,
113
- J
114
- ]), Y = o(() => {
115
- let e = L.findIndex((e) => p(e) && G(e));
116
- return e >= 0 ? e : R[0] ?? -1;
117
- }, [
118
- L,
119
- R,
120
- G
121
- ]), X = o((e) => {
122
- p(L[e]) && (P(e), Ie.current[e]?.scrollIntoView?.({ block: "nearest" }));
123
- }, [L]), lt = o((e) => {
124
- if (!R.length) return;
125
- let t = R.indexOf(N), n = (t >= 0 ? t + e : (e > 0 ? -1 : 0) + e + R.length) % R.length;
126
- X(R[n]);
127
- }, [
128
- R,
129
- N,
130
- X
131
- ]), ut = o(() => {
132
- let e = R[0];
133
- e !== void 0 && X(e);
134
- }, [R, X]), dt = o(() => {
135
- let e = R.at(-1);
136
- e !== void 0 && X(e);
137
- }, [R, X]), Z = o(() => {
138
- if (!k) return;
139
- let e = S.current, t = C.current;
140
- if (!e || !t) return;
141
- let n = e.getBoundingClientRect(), r = te({
142
- anchorRect: n,
143
- floatingRect: t.getBoundingClientRect(),
144
- placement: x,
145
- offset: ge
146
- });
147
- Xe(r.placement), Je({
148
- left: `${Math.round(r.x)}px`,
149
- top: `${Math.round(r.y)}px`,
150
- minWidth: `${Math.round(n.width)}px`
151
- });
152
- }, [
153
- k,
154
- x,
155
- ge
156
- ]), Q = o(() => {
157
- T ? Fe.current?.focus() : S.current?.focus();
158
- }, [T]), $ = o((e = "first") => {
159
- if (y || b) return;
160
- k || (T && j(""), W(!0));
161
- let t = e === "last" ? R.at(-1) : Y();
162
- t !== void 0 && t >= 0 && P(t), window.requestAnimationFrame(() => {
163
- Q(), Z();
164
- });
165
- }, [
166
- y,
167
- b,
168
- k,
169
- T,
170
- W,
171
- R,
172
- Y,
173
- Q,
174
- Z
175
- ]), ft = o(() => {
176
- W(!1), window.requestAnimationFrame(Q);
177
- }, [W, Q]), pt = o(() => {
178
- let e = L[N];
179
- return p(e) ? (J(e), !0) : !1;
180
- }, [
181
- L,
182
- N,
183
- J
184
- ]), mt = (e) => {
185
- if (!(y || b) && !e.target.closest("button")) {
186
- if (T) {
187
- $();
188
- return;
189
- }
190
- k ? W(!1) : $();
191
- }
192
- }, ht = (e) => {
193
- if (!(y || b)) {
194
- if (e.key === "ArrowDown") {
195
- e.preventDefault(), k ? lt(1) : $("first");
196
- return;
197
- }
198
- if (e.key === "ArrowUp") {
199
- e.preventDefault(), k ? lt(-1) : $("last");
200
- return;
201
- }
202
- if (e.key === "Home" && k && !T) {
203
- e.preventDefault(), ut();
204
- return;
205
- }
206
- if (e.key === "End" && k && !T) {
207
- e.preventDefault(), dt();
208
- return;
209
- }
210
- if (e.key === "Escape" && k) {
211
- e.preventDefault(), ft();
212
- return;
213
- }
214
- if (e.key === "Tab" && k) {
215
- W(!1);
216
- return;
217
- }
218
- if (e.key === "Enter") {
219
- if (!k) {
220
- e.preventDefault(), $();
221
- return;
222
- }
223
- e.preventDefault(), !pt() && T && ct(A);
224
- return;
225
- }
226
- if (e.key === " " && !T) {
227
- e.preventDefault(), k ? pt() : $();
228
- return;
229
- }
230
- if (e.key === "Backspace" && T && E && !A && z.length) {
231
- let e = z.slice(0, -1);
232
- K(e), q(e);
233
- }
234
- }
235
- }, gt = () => {
236
- y || b || (K(E ? [] : null), Ce?.(), j(""), q([]), W(!1), Q());
237
- }, _t = (e) => {
238
- if (y || b) return;
239
- let t = z.filter((t) => t !== e);
240
- K(t), q(t);
241
- }, vt = (e) => {
242
- e.currentTarget.contains(e.relatedTarget) || (Ge(!0), Ee?.(e));
243
- }, yt = (e) => {
244
- e.currentTarget.contains(e.relatedTarget) || (Ge(!1), De?.(e));
245
- };
246
- s(() => {
247
- k || (j(E ? "" : V), P(-1));
248
- }, [
249
- k,
250
- E,
251
- V
252
- ]), s(() => {
253
- if (!k || !w) return;
254
- P(Y());
255
- let e = window.requestAnimationFrame(Z);
256
- return () => window.cancelAnimationFrame(e);
257
- }, [
258
- k,
259
- w,
260
- L,
261
- Y,
262
- Z
263
- ]), s(() => {
264
- if (!_ || !E) return;
265
- let e = new Set(I.map((e) => e.value)), t = z.filter((t) => !e.has(t));
266
- t.length && M((e) => [...e, ...t.map((e) => ({
267
- label: String(e),
268
- value: e
269
- }))]);
270
- }, [
271
- _,
272
- E,
273
- I,
274
- z
275
- ]), s(() => {
276
- (y || b) && k && W(!1);
277
- }, [
278
- y,
279
- b,
280
- k,
281
- W
282
- ]), ee({
283
- active: k && w,
284
- rootRef: Pe,
285
- floatingRef: C,
286
- onOutsideClick: () => W(!1),
287
- onViewportChange: Z
288
- });
289
- let bt = {
290
- role: "combobox",
291
- "aria-controls": F,
292
- "aria-expanded": k,
293
- "aria-haspopup": "listbox",
294
- "aria-activedescendant": k ? ot : void 0,
295
- "aria-disabled": y || b || void 0,
296
- "aria-busy": b || void 0,
297
- "aria-label": ke ?? (Ae ? void 0 : g),
298
- "aria-labelledby": Ae,
299
- "aria-describedby": je
300
- }, xt = T ? /* @__PURE__ */ d("input", {
301
- ref: Fe,
302
- id: Ze,
303
- className: "vl-select__input",
304
- type: "text",
305
- value: A,
306
- placeholder: k ? fe : E && z.length ? "" : g,
307
- disabled: y || b,
308
- autoComplete: "off",
309
- "aria-autocomplete": "list",
310
- ...bt,
311
- tabIndex: Me,
312
- onChange: (e) => {
313
- j(e.target.value), k || W(!0);
314
- },
315
- onFocus: () => {
316
- k || $();
317
- },
318
- onKeyDown: ht
319
- }) : null, St = /* @__PURE__ */ d(re, {
320
- show: k,
321
- name: "vl-select",
322
- deferEffects: !w,
323
- children: /* @__PURE__ */ d("div", {
324
- ref: C,
325
- id: F,
326
- className: st,
327
- style: qe,
328
- role: "listbox",
329
- "aria-hidden": !k || void 0,
330
- "aria-multiselectable": E || void 0,
331
- children: tt ? /* @__PURE__ */ d("div", {
332
- className: "vl-select__list",
333
- children: L.map((t, n) => {
334
- if (t.divider) return /* @__PURE__ */ d("div", {
335
- className: "vl-select__divider",
336
- role: "separator"
337
- }, `divider-${n}`);
338
- let r = G(t), i = [
339
- "vl-select__option",
340
- t.disabled ? "is-disabled" : "",
341
- r ? "is-selected" : "",
342
- N === n ? "is-active" : ""
343
- ].filter(Boolean).join(" ");
344
- return /* @__PURE__ */ d("div", {
345
- ref: (e) => {
346
- Ie.current[n] = e;
347
- },
348
- id: Qe(n),
349
- className: i,
350
- role: "option",
351
- "aria-disabled": t.disabled || void 0,
352
- "aria-selected": r,
353
- onPointerDown: (e) => e.preventDefault(),
354
- onMouseEnter: () => {
355
- p(t) && P(n);
356
- },
357
- onClick: () => J(t),
358
- children: ve ? ve(t, n, r) : /* @__PURE__ */ f(se, { children: [t.icon ? e(t.icon, "vl-select__option-icon") : null, /* @__PURE__ */ d("span", {
359
- className: "vl-select__option-label",
360
- children: t.label
361
- })] })
362
- }, `${String(t.value)}-${n}`);
363
- })
364
- }) : /* @__PURE__ */ d("div", {
365
- className: "vl-select__empty",
366
- role: "status",
367
- children: ye ?? _e
368
- })
369
- })
370
- });
371
- return /* @__PURE__ */ f("div", {
372
- ref: Le,
373
- className: $e,
374
- style: xe,
375
- ...Ne,
376
- onMouseEnter: () => Ue(!0),
377
- onMouseLeave: () => Ue(!1),
378
- children: [/* @__PURE__ */ f("div", {
379
- ref: S,
380
- id: T ? void 0 : Ze,
381
- className: et,
382
- ...T ? {} : bt,
383
- tabIndex: y || b || T ? -1 : Me ?? 0,
384
- onClick: mt,
385
- onKeyDown: T ? void 0 : ht,
386
- onFocus: vt,
387
- onBlur: yt,
388
- children: [/* @__PURE__ */ d("div", {
389
- className: "vl-select__value",
390
- children: E ? /* @__PURE__ */ f("div", {
391
- className: "vl-select__tags",
392
- children: [
393
- rt.map((e) => /* @__PURE__ */ f("span", {
394
- className: "vl-select__tag",
395
- children: [/* @__PURE__ */ d("span", {
396
- className: "vl-select__tag-label",
397
- children: e.label
398
- }), /* @__PURE__ */ d("button", {
399
- type: "button",
400
- className: "vl-select__tag-remove",
401
- "aria-label": `移除 ${e.label}`,
402
- disabled: y || b,
403
- onClick: () => _t(e.value),
404
- onPointerDown: (e) => e.stopPropagation(),
405
- children: /* @__PURE__ */ d(oe, {
406
- size: 12,
407
- "aria-hidden": "true"
408
- })
409
- })]
410
- }, e.value)),
411
- U > 0 ? /* @__PURE__ */ f("span", {
412
- className: "vl-select__tag is-collapsed",
413
- "aria-label": `另有 ${U} 项`,
414
- children: ["+", U]
415
- }) : null,
416
- T ? xt : H.length ? null : /* @__PURE__ */ d("span", {
417
- className: "vl-select__placeholder",
418
- children: g
419
- })
420
- ]
421
- }) : T ? xt : V ? /* @__PURE__ */ d("span", {
422
- className: "vl-select__label",
423
- children: V
424
- }) : /* @__PURE__ */ d("span", {
425
- className: "vl-select__placeholder",
426
- children: g
427
- })
428
- }), /* @__PURE__ */ f("div", {
429
- className: "vl-select__suffix",
430
- children: [at ? /* @__PURE__ */ d("button", {
431
- type: "button",
432
- className: "vl-select__clear",
433
- "aria-label": "清除已选",
434
- onClick: gt,
435
- onPointerDown: (e) => e.stopPropagation(),
436
- children: /* @__PURE__ */ d(oe, {
437
- size: 16,
438
- "aria-hidden": "true"
439
- })
440
- }) : null, b ? /* @__PURE__ */ d(ae, {
441
- className: "vl-select__loading",
442
- size: 16,
443
- "aria-hidden": "true"
444
- }) : /* @__PURE__ */ d("span", {
445
- className: "vl-select__arrow",
446
- "aria-hidden": "true",
447
- children: /* @__PURE__ */ d(ie, { size: 16 })
448
- })]
449
- })]
450
- }), w ? ce(St, document.body) : St]
451
- });
452
- });
453
- m.displayName = "VlSelect";
454
- //#endregion
455
- //#region components/Select/index.ts
456
- var le = m, ue = m;
457
- //#endregion
458
- export { le as n, ue as t };
@@ -1,199 +0,0 @@
1
- import { n as e, t } from "./state-oH-YwB7_.js";
2
- import { t as n } from "./client-pj_wzx28.js";
3
- import { n as ee } from "./refs-D5IYOBaf.js";
4
- import { r as te, t as ne } from "./floating-DBAmeQIq.js";
5
- import { t as r } from "./id-CHixuHb7.js";
6
- import { t as re } from "./Transition-DiO4GsP3.js";
7
- import { a as ie, d as ae, i as oe, n as se, o as ce, t as le, v as ue, y as i } from "./time-wheel-BtvYZI6H.js";
8
- import { Clock3 as a, X as de } from "lucide-react";
9
- import { forwardRef as o, useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
10
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
11
- import { createPortal as fe } from "react-dom";
12
- //#region components/TimePicker/TimePicker.tsx
13
- var m = o((o, m) => {
14
- let { value: h, defaultValue: g = null, format: pe = "HH:mm:ss", shortcuts: _ = [], minTime: v, maxTime: y, disabledTime: b, placeholder: x = "请选择时间", disabled: S = !1, clearable: me = !1, size: he = "md", placement: C = "bottom-start", offset: w = 8, className: ge, style: _e, id: ve, "aria-label": ye, "aria-labelledby": T, "aria-describedby": be, onChange: xe, onClear: E, onOpen: D, onClose: O, ...Se } = o, k = u(null), A = u(null), j = u(null), M = n(), Ce = t(o, "value"), [N, we] = e({
15
- value: h ?? null,
16
- defaultValue: g,
17
- controlled: Ce
18
- }), [P, Te] = d(!1), [Ee, F] = d({}), [I, L] = d(!1), [De, R] = d(C), Oe = r("vl-time-picker-control", ve), z = r("vl-time-picker-panel"), ke = l(() => ee(k, m), [m]), B = v ? i(v) : null, V = y ? i(y) : null, H = l(() => ({
19
- minSeconds: B,
20
- maxSeconds: V,
21
- disabledTime: b
22
- }), [
23
- b,
24
- V,
25
- B
26
- ]), U = N && i(N) !== null ? N : "", W = U ? ae(ue(U), pe) : "", G = i(U) ?? i("00:00:00") ?? 0, K = Math.floor(G / 3600), q = Math.floor(G % 3600 / 60), J = G % 60, Ae = s((e) => oe(e, H), [H]), Y = s((e, t, n) => se(e, t, n, H), [H]), X = s((e) => {
27
- e && S || e !== P && (Te(e), e ? (L(!1), R(C), F({}), D?.()) : O?.());
28
- }, [
29
- S,
30
- O,
31
- D,
32
- P,
33
- C
34
- ]), Z = s(() => {
35
- if (!P || !A.current || !j.current) return;
36
- let e = ne({
37
- anchorRect: A.current.getBoundingClientRect(),
38
- floatingRect: j.current.getBoundingClientRect(),
39
- placement: C,
40
- offset: w
41
- });
42
- R(e.placement), F({
43
- left: `${Math.round(e.x)}px`,
44
- top: `${Math.round(e.y)}px`
45
- }), L(!0);
46
- }, [
47
- w,
48
- P,
49
- C
50
- ]);
51
- c(() => {
52
- P && M && Z();
53
- }, [
54
- M,
55
- P,
56
- Z
57
- ]);
58
- let je = s(() => X(!1), [X]), Me = s(() => {
59
- X(!1), A.current?.focus();
60
- }, [X]);
61
- te({
62
- active: P && M,
63
- rootRef: k,
64
- floatingRef: j,
65
- onOutsideClick: je,
66
- onEscape: Me,
67
- onViewportChange: Z
68
- }), c(() => {
69
- S && P && X(!1);
70
- }, [
71
- S,
72
- P,
73
- X
74
- ]);
75
- let Q = (e) => {
76
- e !== null && Ae(e) || (we(e), xe?.(e));
77
- }, Ne = (e, t) => {
78
- let n = ce(e, t, {
79
- hours: K,
80
- minutes: q,
81
- seconds: J
82
- }, Y);
83
- n !== null && Q(n);
84
- }, Pe = s((e, t) => ie(e, t, {
85
- hours: K,
86
- minutes: q,
87
- seconds: J
88
- }, Y), [
89
- Y,
90
- K,
91
- q,
92
- J
93
- ]), Fe = (e) => {
94
- let t = e.getValue(/* @__PURE__ */ new Date());
95
- t && i(t) !== null && Q(t);
96
- }, Ie = (e) => {
97
- e?.stopPropagation(), !S && (Q(null), E?.());
98
- }, Le = (e) => {
99
- S || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), X(!P));
100
- }, Re = [
101
- "vl-time-picker",
102
- `size-${he}`,
103
- P ? "is-open" : "",
104
- S ? "is-disabled" : "",
105
- ge || ""
106
- ].filter(Boolean).join(" "), $ = /* @__PURE__ */ f(re, {
107
- show: P,
108
- name: "vl-time-picker",
109
- deferEffects: !M,
110
- children: /* @__PURE__ */ p("div", {
111
- ref: j,
112
- id: z,
113
- className: `vl-time-picker__panel is-${De}${I ? " is-positioned" : ""}`,
114
- style: {
115
- ...Ee,
116
- visibility: I ? "visible" : "hidden"
117
- },
118
- role: "dialog",
119
- "aria-label": "时间选择",
120
- children: [/* @__PURE__ */ p("div", {
121
- className: "vl-time-picker__controls",
122
- children: [/* @__PURE__ */ p("div", {
123
- className: "vl-time-picker__controls-title",
124
- children: [/* @__PURE__ */ f(a, {
125
- size: 16,
126
- "aria-hidden": "true"
127
- }), /* @__PURE__ */ f("span", { children: "时间" })]
128
- }), /* @__PURE__ */ f(le, {
129
- value: {
130
- hours: K,
131
- minutes: q,
132
- seconds: J
133
- },
134
- isOptionDisabled: Pe,
135
- onChange: Ne
136
- })]
137
- }), _.length ? /* @__PURE__ */ f("div", {
138
- className: "vl-time-picker__shortcuts",
139
- role: "group",
140
- "aria-label": "快捷选择",
141
- children: _.map((e) => /* @__PURE__ */ f("button", {
142
- type: "button",
143
- onClick: () => Fe(e),
144
- children: e.label
145
- }, e.label))
146
- }) : null]
147
- })
148
- });
149
- return /* @__PURE__ */ p("div", {
150
- ref: ke,
151
- className: "vl-time-picker-wrapper",
152
- style: _e,
153
- ...Se,
154
- children: [/* @__PURE__ */ p("div", {
155
- ref: A,
156
- id: Oe,
157
- className: Re,
158
- role: "combobox",
159
- "aria-expanded": P,
160
- "aria-controls": z,
161
- "aria-haspopup": "dialog",
162
- "aria-disabled": S || void 0,
163
- "aria-label": ye ?? (T ? void 0 : x),
164
- "aria-labelledby": T,
165
- "aria-describedby": be,
166
- tabIndex: S ? -1 : 0,
167
- onClick: () => X(!P),
168
- onKeyDown: Le,
169
- children: [
170
- /* @__PURE__ */ f("span", {
171
- className: "vl-time-picker__icon",
172
- "aria-hidden": "true",
173
- children: /* @__PURE__ */ f(a, { size: 16 })
174
- }),
175
- /* @__PURE__ */ f("span", {
176
- className: `vl-time-picker__value${W ? "" : " is-placeholder"}`,
177
- children: W || x
178
- }),
179
- me && U && !S ? /* @__PURE__ */ f("button", {
180
- type: "button",
181
- className: "vl-time-picker__clear",
182
- "aria-label": "清除已选",
183
- onClick: Ie,
184
- onMouseDown: (e) => e.preventDefault(),
185
- children: /* @__PURE__ */ f(de, {
186
- size: 16,
187
- "aria-hidden": "true"
188
- })
189
- }) : null
190
- ]
191
- }), M ? fe($, document.body) : $]
192
- });
193
- });
194
- m.displayName = "VlTimePicker";
195
- //#endregion
196
- //#region components/TimePicker/index.ts
197
- var h = m, g = m;
198
- //#endregion
199
- export { h as n, g as t };
@@ -1 +0,0 @@
1
- const e=require("./state-ZBA75xZ_.cjs"),t=require("./client-BkoqeUs3.cjs"),n=require("./refs-DCqd87V8.cjs"),r=require("./floating-DXRnx48N.cjs"),i=require("./id-CF0zOP1G.cjs"),ee=require("./Transition-X_89ga-e.cjs"),a=require("./time-wheel-BaCcA9nk.cjs");let o=require("lucide-react"),s=require("react"),c=require("react/jsx-runtime"),l=require("react-dom");var u=(0,s.forwardRef)((u,d)=>{let{value:f,defaultValue:te=null,format:ne=`HH:mm:ss`,shortcuts:p=[],minTime:m,maxTime:h,disabledTime:g,placeholder:_=`请选择时间`,disabled:v=!1,clearable:re=!1,size:ie=`md`,placement:y=`bottom-start`,offset:b=8,className:ae,style:oe,id:x,"aria-label":se,"aria-labelledby":S,"aria-describedby":ce,onChange:le,onClear:C,onOpen:w,onClose:T,...ue}=u,E=(0,s.useRef)(null),D=(0,s.useRef)(null),O=(0,s.useRef)(null),k=t.t(),de=e.t(u,`value`),[A,fe]=e.n({value:f??null,defaultValue:te,controlled:de}),[j,pe]=(0,s.useState)(!1),[me,M]=(0,s.useState)({}),[N,P]=(0,s.useState)(!1),[F,I]=(0,s.useState)(y),L=i.t(`vl-time-picker-control`,x),R=i.t(`vl-time-picker-panel`),he=(0,s.useMemo)(()=>n.n(E,d),[d]),z=m?a.y(m):null,B=h?a.y(h):null,V=(0,s.useMemo)(()=>({minSeconds:z,maxSeconds:B,disabledTime:g}),[g,B,z]),H=A&&a.y(A)!==null?A:``,U=H?a.d(a.v(H),ne):``,W=a.y(H)??a.y(`00:00:00`)??0,G=Math.floor(W/3600),K=Math.floor(W%3600/60),q=W%60,ge=(0,s.useCallback)(e=>a.i(e,V),[V]),J=(0,s.useCallback)((e,t,n)=>a.n(e,t,n,V),[V]),Y=(0,s.useCallback)(e=>{e&&v||e!==j&&(pe(e),e?(P(!1),I(y),M({}),w?.()):T?.())},[v,T,w,j,y]),X=(0,s.useCallback)(()=>{if(!j||!D.current||!O.current)return;let e=r.t({anchorRect:D.current.getBoundingClientRect(),floatingRect:O.current.getBoundingClientRect(),placement:y,offset:b});I(e.placement),M({left:`${Math.round(e.x)}px`,top:`${Math.round(e.y)}px`}),P(!0)},[b,j,y]);(0,s.useEffect)(()=>{j&&k&&X()},[k,j,X]);let _e=(0,s.useCallback)(()=>Y(!1),[Y]),Z=(0,s.useCallback)(()=>{Y(!1),D.current?.focus()},[Y]);r.r({active:j&&k,rootRef:E,floatingRef:O,onOutsideClick:_e,onEscape:Z,onViewportChange:X}),(0,s.useEffect)(()=>{v&&j&&Y(!1)},[v,j,Y]);let Q=e=>{e!==null&&ge(e)||(fe(e),le?.(e))},ve=(e,t)=>{let n=a.o(e,t,{hours:G,minutes:K,seconds:q},J);n!==null&&Q(n)},ye=(0,s.useCallback)((e,t)=>a.a(e,t,{hours:G,minutes:K,seconds:q},J),[J,G,K,q]),be=e=>{let t=e.getValue(new Date);t&&a.y(t)!==null&&Q(t)},xe=e=>{e?.stopPropagation(),!v&&(Q(null),C?.())},Se=e=>{v||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),Y(!j))},Ce=[`vl-time-picker`,`size-${ie}`,j?`is-open`:``,v?`is-disabled`:``,ae||``].filter(Boolean).join(` `),$=(0,c.jsx)(ee.t,{show:j,name:`vl-time-picker`,deferEffects:!k,children:(0,c.jsxs)(`div`,{ref:O,id:R,className:`vl-time-picker__panel is-${F}${N?` is-positioned`:``}`,style:{...me,visibility:N?`visible`:`hidden`},role:`dialog`,"aria-label":`时间选择`,children:[(0,c.jsxs)(`div`,{className:`vl-time-picker__controls`,children:[(0,c.jsxs)(`div`,{className:`vl-time-picker__controls-title`,children:[(0,c.jsx)(o.Clock3,{size:16,"aria-hidden":`true`}),(0,c.jsx)(`span`,{children:`时间`})]}),(0,c.jsx)(a.t,{value:{hours:G,minutes:K,seconds:q},isOptionDisabled:ye,onChange:ve})]}),p.length?(0,c.jsx)(`div`,{className:`vl-time-picker__shortcuts`,role:`group`,"aria-label":`快捷选择`,children:p.map(e=>(0,c.jsx)(`button`,{type:`button`,onClick:()=>be(e),children:e.label},e.label))}):null]})});return(0,c.jsxs)(`div`,{ref:he,className:`vl-time-picker-wrapper`,style:oe,...ue,children:[(0,c.jsxs)(`div`,{ref:D,id:L,className:Ce,role:`combobox`,"aria-expanded":j,"aria-controls":R,"aria-haspopup":`dialog`,"aria-disabled":v||void 0,"aria-label":se??(S?void 0:_),"aria-labelledby":S,"aria-describedby":ce,tabIndex:v?-1:0,onClick:()=>Y(!j),onKeyDown:Se,children:[(0,c.jsx)(`span`,{className:`vl-time-picker__icon`,"aria-hidden":`true`,children:(0,c.jsx)(o.Clock3,{size:16})}),(0,c.jsx)(`span`,{className:`vl-time-picker__value${U?``:` is-placeholder`}`,children:U||_}),re&&H&&!v?(0,c.jsx)(`button`,{type:`button`,className:`vl-time-picker__clear`,"aria-label":`清除已选`,onClick:xe,onMouseDown:e=>e.preventDefault(),children:(0,c.jsx)(o.X,{size:16,"aria-hidden":`true`})}):null]}),k?(0,l.createPortal)($,document.body):$]})});u.displayName=`VlTimePicker`;var d=u,f=u;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
@@ -1 +0,0 @@
1
- const e=require("./state-ZBA75xZ_.cjs"),t=require("./client-BkoqeUs3.cjs"),n=require("./refs-DCqd87V8.cjs"),r=require("./number-B7qJF_ZY.cjs"),i=require("./floating-DXRnx48N.cjs"),a=require("./id-CF0zOP1G.cjs"),o=require("./Transition-X_89ga-e.cjs"),s=require("./focus-D-h8CbGr.cjs");let c=require("react"),l=require("react/jsx-runtime"),ee=require("react-dom");var u=(0,c.forwardRef)((u,d)=>{let{content:f,placement:p=`top`,trigger:m=`hover`,disabled:h=!1,offset:g=8,showDelay:_=100,hideDelay:v=100,showArrow:te=!0,maxWidth:y=300,open:ne,defaultOpen:re=!1,className:b,children:x,onChange:ie,onShow:S,onHide:C,...w}=u,T=(0,c.useRef)(null),E=(0,c.useRef)(null),D=(0,c.useRef)(null),O=(0,c.useRef)(null),k=(0,c.useRef)(!1),A=(0,c.useRef)(!1),j=(0,c.useRef)(!1),M=(0,c.useRef)(null),N=(0,c.useRef)(null),ae=(0,c.useMemo)(()=>n.n(T,d),[d]),P=t.t(),oe=e.t(u,`open`),[F,I]=e.n({value:!!ne,defaultValue:re,controlled:oe,onChange:ie}),L=!h&&f!=null,R=L&&F,z=a.t(`vl-tooltip-popup`),[se,ce]=(0,c.useState)(p),[B,V]=(0,c.useState)({}),[H,U]=(0,c.useState)({}),W=(0,c.useMemo)(()=>[`vl-tooltip`,h?`is-disabled`:``,b||``].filter(Boolean).join(` `),[h,b]),le=`vl-tooltip__popup is-${se}`,G=(0,c.useCallback)(()=>{M.current!==null&&window.clearTimeout(M.current),N.current!==null&&window.clearTimeout(N.current),M.current=null,N.current=null},[]),K=(0,c.useCallback)(()=>{let e=O.current;if(e?.isConnected){e.focus();return}E.current?.querySelector(s.i)?.focus()},[]),q=(0,c.useCallback)((e,t=!1)=>{if(!(e&&!L)){if(F===e){t&&K();return}I(e),e?S?.():(C?.(),t&&window.requestAnimationFrame(K))}},[L,F,I,S,C,K]),J=(0,c.useCallback)(()=>{if(G(),L){if(_<=0){q(!0);return}M.current=window.setTimeout(()=>q(!0),_)}},[G,L,_,q]),Y=(0,c.useCallback)(()=>{if(G(),v<=0){q(!1);return}N.current=window.setTimeout(()=>q(!1),v)},[G,v,q]),X=(0,c.useCallback)(()=>{k.current||A.current||j.current||Y()},[Y]),Z=(0,c.useCallback)(()=>{if(!R)return;let e=E.current,t=D.current;if(!e||!t)return;let n=e.getBoundingClientRect(),a=t.getBoundingClientRect(),{placement:o,x:s,y:c}=i.n({anchorRect:n,floatingRect:a,placement:p,offset:g,edgePadding:8});if(ce(o),V({left:`${Math.round(s)}px`,top:`${Math.round(c)}px`}),o.startsWith(`top`)||o.startsWith(`bottom`)){let e=n.left+n.width/2-s;U({left:`${Math.round(r.t(e,10,Math.max(10,a.width-10)))}px`,top:void 0})}else{let e=n.top+n.height/2-c;U({left:void 0,top:`${Math.round(r.t(e,10,Math.max(10,a.height-10)))}px`})}},[R,p,g]),Q=()=>{m===`hover`&&(k.current=!0,J())},ue=()=>{m===`hover`&&(k.current=!1,X())},de=()=>{m===`hover`&&(A.current=!0,G())},fe=()=>{m===`hover`&&(A.current=!1,X())},pe=e=>{if(m!==`click`)return;let t=e.target;t.matches(`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`)&&(O.current=t),q(!R)},me=e=>{let t=e.target;t.matches(`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`)&&(O.current=t),j.current=!0,(m===`hover`||m===`focus`)&&J()},he=e=>{e.currentTarget.contains(e.relatedTarget)||(j.current=!1,m===`hover`?X():m===`focus`&&Y())};(0,c.useEffect)(()=>{if(!R||!P)return;let e=window.requestAnimationFrame(()=>{Z(),window.requestAnimationFrame(Z)});return()=>window.cancelAnimationFrame(e)},[R,P,Z]),(0,c.useEffect)(()=>{L||!F||q(!1)},[L,F,q]);let ge=(0,c.useCallback)(()=>q(!1),[q]),_e=(0,c.useCallback)(()=>q(!1,!0),[q]);i.r({active:R&&P,rootRef:T,floatingRef:D,closeOnOutsideClick:m===`click`,onOutsideClick:ge,onEscape:_e,onViewportChange:Z}),(0,c.useEffect)(()=>()=>G(),[G]);let ve=[(0,c.isValidElement)(x)?x.props[`aria-describedby`]:void 0,z].filter(Boolean).join(` `),ye=(0,c.isValidElement)(x)&&x.type!==c.Fragment?(0,c.cloneElement)(x,{"aria-describedby":ve}):x,be={...B,maxWidth:typeof y==`number`?`${y}px`:y},$=(0,l.jsx)(o.t,{show:R,name:`vl-tooltip`,unmountOnExit:!1,deferEffects:!P,children:(0,l.jsxs)(`div`,{ref:D,id:z,className:le,style:be,role:`tooltip`,"aria-hidden":!R||void 0,onMouseEnter:de,onMouseLeave:fe,children:[te?(0,l.jsx)(`span`,{className:`vl-tooltip__arrow`,style:H,"aria-hidden":`true`}):null,(0,l.jsx)(`div`,{className:`vl-tooltip__content`,children:f})]})});return(0,l.jsxs)(`div`,{ref:ae,className:W,...w,children:[(0,l.jsx)(`div`,{ref:E,className:`vl-tooltip__trigger`,"aria-describedby":(0,c.isValidElement)(x)?void 0:z,onMouseEnter:Q,onMouseLeave:ue,onClick:pe,onFocus:me,onBlur:he,children:ye}),P?(0,ee.createPortal)($,document.body):$]})});u.displayName=`VlTooltip`;var d=u,f=u;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});