seam-react 0.8.0 → 0.9.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.
- package/dist/Select.d.ts +37 -10
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1350 -998
- package/dist/index.js.map +1 -1
- package/dist/motion.d.ts +11 -0
- package/dist/styles.cjs +238 -20
- package/dist/styles.cjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.js +236 -18
- package/dist/styles.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useControllableState as
|
|
4
|
-
import {
|
|
5
|
-
import { createPortal as
|
|
6
|
-
function
|
|
1
|
+
import { jsxs as D, jsx as c, Fragment as Te } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as A, useId as V, useState as S, useMemo as W, useCallback as j, useRef as $, useEffect as H, createContext as Z, useContext as ee, useSyncExternalStore as ae, useLayoutEffect as se, isValidElement as te, cloneElement as ne, Children as at } from "react";
|
|
3
|
+
import { useControllableState as J, useEventCallback as M, useLockBodyScroll as st, useFocusTrap as ct } from "seam-hooks";
|
|
4
|
+
import { useReducedMotion as U, AnimatePresence as z, motion as O, useIsPresent as ce, LayoutGroup as Ce, useMotionValue as lt, animate as ye, MotionConfig as me } from "motion/react";
|
|
5
|
+
import { createPortal as le } from "react-dom";
|
|
6
|
+
function L(...t) {
|
|
7
7
|
return t.filter(Boolean).join(" ");
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const Ne = A(function({
|
|
10
10
|
variant: e = "primary",
|
|
11
11
|
size: n = "md",
|
|
12
|
-
loading:
|
|
12
|
+
loading: r = !1,
|
|
13
13
|
iconOnly: i = !1,
|
|
14
14
|
type: s = "button",
|
|
15
15
|
className: a,
|
|
16
|
-
children:
|
|
16
|
+
children: d,
|
|
17
17
|
...p
|
|
18
|
-
},
|
|
19
|
-
return /* @__PURE__ */
|
|
18
|
+
}, l) {
|
|
19
|
+
return /* @__PURE__ */ D(
|
|
20
20
|
"button",
|
|
21
21
|
{
|
|
22
22
|
...p,
|
|
23
|
-
ref:
|
|
23
|
+
ref: l,
|
|
24
24
|
type: s,
|
|
25
|
-
className:
|
|
25
|
+
className: L("uk-button", a),
|
|
26
26
|
"data-variant": e,
|
|
27
27
|
"data-size": n,
|
|
28
|
-
"data-loading":
|
|
28
|
+
"data-loading": r ? "true" : void 0,
|
|
29
29
|
"data-icon-only": i ? "true" : void 0,
|
|
30
|
-
disabled: p.disabled ||
|
|
31
|
-
"aria-busy":
|
|
30
|
+
disabled: p.disabled || r,
|
|
31
|
+
"aria-busy": r || void 0,
|
|
32
32
|
children: [
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
r ? /* @__PURE__ */ c("span", { className: "uk-button__spinner", "aria-hidden": "true" }) : null,
|
|
34
|
+
d
|
|
35
35
|
]
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
|
-
}),
|
|
38
|
+
}), dt = A(function({
|
|
39
39
|
checked: e,
|
|
40
40
|
defaultChecked: n,
|
|
41
|
-
onCheckedChange:
|
|
41
|
+
onCheckedChange: r,
|
|
42
42
|
disabled: i,
|
|
43
43
|
className: s,
|
|
44
44
|
children: a,
|
|
45
|
-
id:
|
|
45
|
+
id: d,
|
|
46
46
|
...p
|
|
47
|
-
},
|
|
48
|
-
const
|
|
47
|
+
}, l) {
|
|
48
|
+
const h = V(), o = d ?? h, [f, v] = J({
|
|
49
49
|
value: e,
|
|
50
50
|
defaultValue: n ?? !1,
|
|
51
|
-
onChange:
|
|
51
|
+
onChange: r
|
|
52
52
|
});
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ D(
|
|
54
54
|
"label",
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
56
|
+
className: L("uk-checkbox", s),
|
|
57
57
|
"data-disabled": i ? "true" : void 0,
|
|
58
|
-
htmlFor:
|
|
58
|
+
htmlFor: o,
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ c(
|
|
61
61
|
"input",
|
|
62
62
|
{
|
|
63
63
|
...p,
|
|
64
|
-
ref:
|
|
65
|
-
id:
|
|
64
|
+
ref: l,
|
|
65
|
+
id: o,
|
|
66
66
|
type: "checkbox",
|
|
67
67
|
className: "uk-checkbox__input",
|
|
68
|
-
checked:
|
|
68
|
+
checked: f,
|
|
69
69
|
disabled: i,
|
|
70
|
-
onChange: (
|
|
71
|
-
i ||
|
|
70
|
+
onChange: (m) => {
|
|
71
|
+
i || v(m.target.checked);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ c("span", { className: "uk-checkbox__box", "aria-hidden": "true", children: /* @__PURE__ */ c(
|
|
76
76
|
"svg",
|
|
77
77
|
{
|
|
78
78
|
className: "uk-checkbox__check",
|
|
@@ -82,214 +82,443 @@ const we = N(function({
|
|
|
82
82
|
strokeWidth: 3.2,
|
|
83
83
|
strokeLinecap: "round",
|
|
84
84
|
strokeLinejoin: "round",
|
|
85
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ c("path", { d: "M4 12.5 L9.5 18 L20 7", pathLength: 1 })
|
|
86
86
|
}
|
|
87
87
|
) }),
|
|
88
|
-
a ? /* @__PURE__ */
|
|
88
|
+
a ? /* @__PURE__ */ c("span", { className: "uk-checkbox__label", children: a }) : null
|
|
89
89
|
]
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
});
|
|
93
|
-
|
|
94
|
-
const
|
|
93
|
+
dt.displayName = "CheckBox";
|
|
94
|
+
const Q = [0.23, 1, 0.32, 1], pe = [0.77, 0, 0.175, 1], ke = {
|
|
95
95
|
type: "spring",
|
|
96
96
|
bounce: 0,
|
|
97
97
|
duration: 0.3
|
|
98
|
-
},
|
|
98
|
+
}, xe = {
|
|
99
99
|
type: "spring",
|
|
100
100
|
bounce: 0.04,
|
|
101
101
|
duration: 0.38
|
|
102
|
-
},
|
|
102
|
+
}, de = {
|
|
103
103
|
type: "spring",
|
|
104
104
|
bounce: 0.08,
|
|
105
105
|
duration: 0.34
|
|
106
|
-
},
|
|
106
|
+
}, Ee = {
|
|
107
107
|
duration: 0.2,
|
|
108
|
-
ease:
|
|
109
|
-
},
|
|
108
|
+
ease: pe
|
|
109
|
+
}, ut = {
|
|
110
|
+
layout: { type: "spring", bounce: 0.04, duration: 0.22 },
|
|
111
|
+
opacity: { duration: 0.12, ease: Q },
|
|
112
|
+
x: { type: "spring", bounce: 0.08, duration: 0.26 },
|
|
113
|
+
scaleX: { type: "spring", bounce: 0.08, duration: 0.26 },
|
|
114
|
+
scaleY: { type: "spring", bounce: 0.08, duration: 0.26 }
|
|
115
|
+
}, pt = {
|
|
116
|
+
layout: { duration: 0.16, ease: pe },
|
|
117
|
+
opacity: { duration: 0.16, ease: Q },
|
|
118
|
+
x: { duration: 0.16, ease: pe }
|
|
119
|
+
}, Pe = {
|
|
110
120
|
duration: 0.12,
|
|
111
|
-
ease:
|
|
112
|
-
},
|
|
121
|
+
ease: Q
|
|
122
|
+
}, ft = {
|
|
113
123
|
layout: { type: "spring", bounce: 0, duration: 0.22 },
|
|
114
|
-
opacity: { duration: 0.12, ease:
|
|
115
|
-
scale: { duration: 0.12, ease:
|
|
116
|
-
},
|
|
124
|
+
opacity: { duration: 0.12, ease: Q },
|
|
125
|
+
scale: { duration: 0.12, ease: Q }
|
|
126
|
+
}, Y = {
|
|
117
127
|
duration: 0.12,
|
|
118
|
-
ease:
|
|
119
|
-
},
|
|
120
|
-
function
|
|
121
|
-
const e =
|
|
128
|
+
ease: Q
|
|
129
|
+
}, Le = Z(null);
|
|
130
|
+
function ge(t) {
|
|
131
|
+
const e = ee(Le);
|
|
122
132
|
if (!e)
|
|
123
133
|
throw new Error(`<${t}> must be rendered inside <Select>`);
|
|
124
134
|
return e;
|
|
125
135
|
}
|
|
126
|
-
const
|
|
127
|
-
},
|
|
128
|
-
function
|
|
136
|
+
const ht = () => () => {
|
|
137
|
+
}, mt = () => !0, gt = () => !1;
|
|
138
|
+
function Ie(t, e) {
|
|
129
139
|
return (n) => {
|
|
130
140
|
t?.(n), n.defaultPrevented || e(n);
|
|
131
141
|
};
|
|
132
142
|
}
|
|
133
|
-
function
|
|
143
|
+
function De(t, e, n) {
|
|
134
144
|
return n < e ? e : Math.min(Math.max(t, e), n);
|
|
135
145
|
}
|
|
136
|
-
function
|
|
146
|
+
function we(t, e) {
|
|
147
|
+
const n = e ? t ?? [] : t == null ? [] : [t];
|
|
148
|
+
return Array.from(new Set(n));
|
|
149
|
+
}
|
|
150
|
+
function bt(t) {
|
|
137
151
|
return t === "bottom" ? "center top" : "center bottom";
|
|
138
152
|
}
|
|
139
|
-
function
|
|
153
|
+
function vt(t, e = null, n = 0) {
|
|
154
|
+
let r = 0;
|
|
155
|
+
function i(s, a, d) {
|
|
156
|
+
return s.flatMap((p) => {
|
|
157
|
+
const l = p.children ?? [], h = {
|
|
158
|
+
option: p,
|
|
159
|
+
index: r,
|
|
160
|
+
parentIndex: a,
|
|
161
|
+
depth: d,
|
|
162
|
+
hasChildren: l.length > 0
|
|
163
|
+
};
|
|
164
|
+
return r += 1, [h, ...i(l, h.index, d + 1)];
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return i(t, e, n);
|
|
168
|
+
}
|
|
169
|
+
function Se(t, e) {
|
|
170
|
+
for (const n of t) {
|
|
171
|
+
if (n.value === e)
|
|
172
|
+
return n;
|
|
173
|
+
const r = Se(n.children ?? [], e);
|
|
174
|
+
if (r)
|
|
175
|
+
return r;
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
function Re(t, e) {
|
|
180
|
+
return (t.children ?? []).some(
|
|
181
|
+
(n) => e.includes(n.value) || Re(n, e)
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
function yt({
|
|
140
185
|
options: t,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
186
|
+
loading: e = !1,
|
|
187
|
+
value: n,
|
|
188
|
+
defaultValue: r = null,
|
|
189
|
+
onValueChange: i,
|
|
190
|
+
multiple: s = !1,
|
|
191
|
+
children: a
|
|
145
192
|
}) {
|
|
146
|
-
const s =
|
|
147
|
-
value:
|
|
148
|
-
defaultValue:
|
|
149
|
-
onChange: (
|
|
150
|
-
|
|
193
|
+
const d = V(), p = we(n, s), l = we(r, s), [h, o] = J({
|
|
194
|
+
value: n === void 0 ? void 0 : p,
|
|
195
|
+
defaultValue: l,
|
|
196
|
+
onChange: (E) => {
|
|
197
|
+
i?.(s ? E : E[0] ?? "");
|
|
151
198
|
}
|
|
152
|
-
}), [
|
|
199
|
+
}), [f, v] = S(!1), [m, k] = S(e);
|
|
200
|
+
m !== e && (k(e), e && v(!1));
|
|
201
|
+
const b = W(() => vt(t), [t]), I = b.findIndex(
|
|
202
|
+
(E) => E.option.value === h[0]
|
|
203
|
+
), [x, g] = S(
|
|
153
204
|
null
|
|
154
|
-
),
|
|
155
|
-
|
|
156
|
-
}, []),
|
|
157
|
-
const
|
|
158
|
-
!
|
|
159
|
-
}),
|
|
205
|
+
), u = x ?? Math.max(I, 0), _ = j((E) => {
|
|
206
|
+
g(E);
|
|
207
|
+
}, []), C = M((E) => {
|
|
208
|
+
const N = b[E], P = N?.option;
|
|
209
|
+
e || !P || P.disabled || N?.hasChildren || (o((R) => s ? R.includes(P.value) ? R.filter((K) => K !== P.value) : [...R, P.value] : R[0] === P.value ? R : [P.value]), s || (v(!1), g(null)));
|
|
210
|
+
}), y = M((E) => {
|
|
211
|
+
o(
|
|
212
|
+
(N) => N.filter((P) => P !== E)
|
|
213
|
+
);
|
|
214
|
+
}), w = M(() => {
|
|
215
|
+
o([]);
|
|
216
|
+
}), T = W(
|
|
160
217
|
() => ({
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
218
|
+
values: h,
|
|
219
|
+
multiple: s,
|
|
220
|
+
activeIndex: u,
|
|
221
|
+
open: f,
|
|
222
|
+
setOpen: v,
|
|
223
|
+
setActiveIndex: _,
|
|
224
|
+
commit: C,
|
|
225
|
+
removeValue: y,
|
|
226
|
+
clearValues: w,
|
|
227
|
+
triggerId: `${d}-trigger`,
|
|
228
|
+
contentId: `${d}-content`,
|
|
229
|
+
options: t,
|
|
230
|
+
optionNodes: b,
|
|
231
|
+
loading: e
|
|
170
232
|
}),
|
|
171
|
-
[
|
|
233
|
+
[
|
|
234
|
+
u,
|
|
235
|
+
d,
|
|
236
|
+
C,
|
|
237
|
+
s,
|
|
238
|
+
f,
|
|
239
|
+
t,
|
|
240
|
+
b,
|
|
241
|
+
e,
|
|
242
|
+
y,
|
|
243
|
+
w,
|
|
244
|
+
_,
|
|
245
|
+
h
|
|
246
|
+
]
|
|
172
247
|
);
|
|
173
|
-
return /* @__PURE__ */
|
|
248
|
+
return /* @__PURE__ */ c(Le.Provider, { value: T, children: a });
|
|
174
249
|
}
|
|
175
|
-
function
|
|
250
|
+
function re(t, e, n, r = !0) {
|
|
176
251
|
const i = t.length;
|
|
177
252
|
if (i === 0)
|
|
178
253
|
return -1;
|
|
179
254
|
for (let s = 1; s <= i; s += 1) {
|
|
180
|
-
const a =
|
|
255
|
+
const a = r ? (e + n * s + i * s) % i : e + n * s;
|
|
181
256
|
if (a < 0 || a >= i)
|
|
182
257
|
break;
|
|
183
|
-
if (!t[a]?.disabled)
|
|
258
|
+
if (!t[a]?.option.disabled)
|
|
184
259
|
return a;
|
|
185
260
|
}
|
|
186
261
|
return e;
|
|
187
262
|
}
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
263
|
+
function fe(t, e) {
|
|
264
|
+
const n = t[e];
|
|
265
|
+
if (!n?.hasChildren)
|
|
266
|
+
return e;
|
|
267
|
+
for (let r = e + 1; r < t.length && (t[r]?.depth ?? 0) > n.depth; r += 1)
|
|
268
|
+
if (t[r]?.depth === n.depth + 1 && !t[r]?.option.disabled)
|
|
269
|
+
return r;
|
|
270
|
+
return e;
|
|
271
|
+
}
|
|
272
|
+
const kt = A(function({
|
|
273
|
+
className: e,
|
|
274
|
+
placeholder: n = "请选择",
|
|
275
|
+
size: r = "md",
|
|
276
|
+
clear: i = !1,
|
|
277
|
+
loadingText: s = "加载中...",
|
|
278
|
+
disabled: a,
|
|
279
|
+
onPointerDown: d,
|
|
280
|
+
onKeyDown: p,
|
|
281
|
+
...l
|
|
282
|
+
}, h) {
|
|
283
|
+
const o = ge("Select.Trigger"), f = U() ?? !1, v = o.values.map((u) => Se(o.options, u) ?? { value: u, label: u }), m = v[0], k = $({ search: "", timer: null }), b = j(() => {
|
|
284
|
+
k.current.timer && (clearTimeout(k.current.timer), k.current.timer = null), k.current.search = "";
|
|
193
285
|
}, []);
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
(
|
|
206
|
-
), T =
|
|
207
|
-
(
|
|
208
|
-
),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
(
|
|
212
|
-
|
|
286
|
+
H(() => b, [b]);
|
|
287
|
+
const I = M((u) => {
|
|
288
|
+
if (o.loading)
|
|
289
|
+
return;
|
|
290
|
+
const _ = k.current;
|
|
291
|
+
_.timer && clearTimeout(_.timer), _.search += u.toLowerCase(), _.timer = setTimeout(b, 500);
|
|
292
|
+
const C = o.optionNodes.map((P) => {
|
|
293
|
+
const R = P.option.label;
|
|
294
|
+
return (typeof R == "string" ? R : P.option.value).toLowerCase();
|
|
295
|
+
}), y = o.open && o.activeIndex >= 0 ? o.activeIndex + 1 : 0, w = Array.from(
|
|
296
|
+
{ length: C.length },
|
|
297
|
+
(P, R) => (y + R) % C.length
|
|
298
|
+
), T = w.find(
|
|
299
|
+
(P) => !o.optionNodes[P]?.option.disabled && C[P]?.startsWith(_.search)
|
|
300
|
+
), E = w.find(
|
|
301
|
+
(P) => !o.optionNodes[P]?.option.disabled && C[P]?.includes(_.search)
|
|
302
|
+
), N = T ?? E;
|
|
303
|
+
N !== void 0 && (o.open ? o.setActiveIndex(N) : o.multiple || o.optionNodes[N]?.hasChildren ? (o.setActiveIndex(N), o.setOpen(!0)) : o.commit(N));
|
|
304
|
+
}), x = M(
|
|
305
|
+
(u) => {
|
|
306
|
+
a || o.loading || o.setOpen(!o.open);
|
|
213
307
|
}
|
|
214
|
-
),
|
|
215
|
-
(
|
|
216
|
-
if (
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
308
|
+
), g = M(
|
|
309
|
+
(u) => {
|
|
310
|
+
if (a || o.loading)
|
|
311
|
+
return;
|
|
312
|
+
if (u.key.length === 1 && !u.metaKey && !u.ctrlKey && !u.altKey) {
|
|
313
|
+
u.preventDefault(), I(u.key);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
if (u.key === "Backspace" && o.multiple) {
|
|
317
|
+
const C = o.values[o.values.length - 1];
|
|
318
|
+
C && (u.preventDefault(), o.removeValue(C));
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
if (!o.open) {
|
|
322
|
+
["ArrowDown", "ArrowUp", "Enter", " "].includes(u.key) && (u.preventDefault(), o.setOpen(!0), o.loading || o.setActiveIndex(
|
|
323
|
+
o.activeIndex >= 0 ? o.activeIndex : re(o.optionNodes, -1, 1)
|
|
324
|
+
));
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
if (u.key === "Escape" || u.key === "Tab") {
|
|
328
|
+
o.setOpen(!1), u.currentTarget.focus();
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const _ = o.optionNodes[o.activeIndex];
|
|
332
|
+
if (u.key === "Enter" || u.key === " ") {
|
|
333
|
+
if (u.preventDefault(), _?.hasChildren) {
|
|
334
|
+
o.setActiveIndex(
|
|
335
|
+
fe(o.optionNodes, o.activeIndex)
|
|
336
|
+
), u.currentTarget.focus();
|
|
233
337
|
return;
|
|
234
338
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
339
|
+
o.commit(o.activeIndex), u.currentTarget.focus();
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
if (u.key === "ArrowRight" && _?.hasChildren) {
|
|
343
|
+
u.preventDefault(), o.setActiveIndex(
|
|
344
|
+
fe(o.optionNodes, o.activeIndex)
|
|
345
|
+
);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
if (u.key === "ArrowLeft" && _?.parentIndex != null) {
|
|
349
|
+
u.preventDefault(), o.setActiveIndex(_.parentIndex);
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
if (!o.loading) {
|
|
353
|
+
if (u.key === "ArrowDown") {
|
|
354
|
+
u.preventDefault(), o.setActiveIndex(
|
|
355
|
+
re(o.optionNodes, o.activeIndex, 1)
|
|
238
356
|
);
|
|
239
357
|
return;
|
|
240
358
|
}
|
|
241
|
-
if (
|
|
242
|
-
|
|
243
|
-
|
|
359
|
+
if (u.key === "ArrowUp") {
|
|
360
|
+
u.preventDefault(), o.setActiveIndex(
|
|
361
|
+
re(o.optionNodes, o.activeIndex, -1)
|
|
244
362
|
);
|
|
245
363
|
return;
|
|
246
364
|
}
|
|
247
|
-
if (
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
365
|
+
if (u.key === "Home" || u.key === "End") {
|
|
366
|
+
u.preventDefault();
|
|
367
|
+
const C = u.key === "Home" ? 1 : -1, y = u.key === "Home" ? -1 : o.optionNodes.length;
|
|
368
|
+
o.setActiveIndex(
|
|
369
|
+
re(o.optionNodes, y, C, !1)
|
|
252
370
|
);
|
|
253
371
|
}
|
|
254
372
|
}
|
|
255
373
|
}
|
|
256
374
|
);
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
"
|
|
375
|
+
return /* @__PURE__ */ D(
|
|
376
|
+
"div",
|
|
259
377
|
{
|
|
260
|
-
...
|
|
261
|
-
ref:
|
|
262
|
-
id:
|
|
263
|
-
type: "button",
|
|
378
|
+
...l,
|
|
379
|
+
ref: h,
|
|
380
|
+
id: o.triggerId,
|
|
264
381
|
role: "combobox",
|
|
265
|
-
|
|
382
|
+
tabIndex: a || o.loading ? -1 : 0,
|
|
383
|
+
"aria-disabled": a || o.loading || void 0,
|
|
384
|
+
"aria-expanded": o.open,
|
|
385
|
+
"aria-busy": o.loading || void 0,
|
|
266
386
|
"aria-haspopup": "listbox",
|
|
267
|
-
"aria-controls":
|
|
268
|
-
"aria-activedescendant":
|
|
269
|
-
"data-size":
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
387
|
+
"aria-controls": o.open ? o.contentId : void 0,
|
|
388
|
+
"aria-activedescendant": o.open && o.optionNodes[o.activeIndex] ? `${o.contentId}-option-${o.activeIndex}` : void 0,
|
|
389
|
+
"data-size": r,
|
|
390
|
+
"data-multiple": o.multiple || void 0,
|
|
391
|
+
"data-loading": o.loading || void 0,
|
|
392
|
+
className: L("uk-select__trigger", e),
|
|
393
|
+
onPointerDown: Ie(d, x),
|
|
394
|
+
onKeyDown: Ie(p, g),
|
|
273
395
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
|
|
396
|
+
o.multiple ? /* @__PURE__ */ D("span", { className: "uk-select__tags", children: [
|
|
397
|
+
/* @__PURE__ */ c(z, { initial: !1, children: v.map((u) => {
|
|
398
|
+
const _ = u.label ?? u.value, C = typeof _ == "string" ? _ : u.value;
|
|
399
|
+
return /* @__PURE__ */ D(
|
|
400
|
+
O.span,
|
|
401
|
+
{
|
|
402
|
+
className: "uk-select__tag",
|
|
403
|
+
"data-slot": "select-tag",
|
|
404
|
+
layout: !0,
|
|
405
|
+
initial: f ? { opacity: 0 } : { opacity: 0, x: 12 },
|
|
406
|
+
animate: f ? { opacity: 1 } : { opacity: 1, x: 0 },
|
|
407
|
+
exit: f ? { opacity: 0 } : { opacity: 0, x: 4 },
|
|
408
|
+
transition: f ? { duration: 0 } : pt,
|
|
409
|
+
children: [
|
|
410
|
+
/* @__PURE__ */ c("span", { className: "uk-select__tag-label", children: _ }),
|
|
411
|
+
/* @__PURE__ */ c(
|
|
412
|
+
"button",
|
|
413
|
+
{
|
|
414
|
+
type: "button",
|
|
415
|
+
className: "uk-select__tag-remove",
|
|
416
|
+
disabled: a,
|
|
417
|
+
"aria-label": `移除 ${C}`,
|
|
418
|
+
onPointerDown: (y) => y.stopPropagation(),
|
|
419
|
+
onKeyDown: (y) => {
|
|
420
|
+
y.key === "Backspace" && y.stopPropagation();
|
|
421
|
+
},
|
|
422
|
+
onClick: (y) => {
|
|
423
|
+
y.stopPropagation(), o.removeValue(u.value);
|
|
424
|
+
},
|
|
425
|
+
children: /* @__PURE__ */ c("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ c(
|
|
426
|
+
"path",
|
|
427
|
+
{
|
|
428
|
+
d: "M5 5l6 6M11 5l-6 6",
|
|
429
|
+
stroke: "currentColor",
|
|
430
|
+
strokeWidth: "1.5",
|
|
431
|
+
strokeLinecap: "round"
|
|
432
|
+
}
|
|
433
|
+
) })
|
|
434
|
+
}
|
|
435
|
+
)
|
|
436
|
+
]
|
|
437
|
+
},
|
|
438
|
+
u.value
|
|
439
|
+
);
|
|
440
|
+
}) }),
|
|
441
|
+
v.length === 0 ? /* @__PURE__ */ c("span", { className: "uk-select__placeholder", children: n }) : null
|
|
442
|
+
] }) : /* @__PURE__ */ c("span", { className: "uk-select__value", children: m?.label ?? o.values[0] ?? n }),
|
|
443
|
+
/* @__PURE__ */ D("span", { className: "uk-select__actions", children: [
|
|
444
|
+
i && !a && !o.loading && o.values.length > 0 ? /* @__PURE__ */ c(
|
|
445
|
+
"button",
|
|
446
|
+
{
|
|
447
|
+
type: "button",
|
|
448
|
+
className: "uk-select__clear",
|
|
449
|
+
"aria-label": "清空",
|
|
450
|
+
onPointerDown: (u) => u.stopPropagation(),
|
|
451
|
+
onKeyDown: (u) => {
|
|
452
|
+
["Backspace", " "].includes(u.key) && u.stopPropagation();
|
|
453
|
+
},
|
|
454
|
+
onClick: (u) => {
|
|
455
|
+
u.stopPropagation(), document.getElementById(o.triggerId)?.focus(), o.clearValues();
|
|
456
|
+
},
|
|
457
|
+
children: /* @__PURE__ */ D(
|
|
458
|
+
"svg",
|
|
459
|
+
{
|
|
460
|
+
viewBox: "0 0 24 24",
|
|
461
|
+
fill: "none",
|
|
462
|
+
stroke: "currentColor",
|
|
463
|
+
strokeWidth: "2",
|
|
464
|
+
strokeLinecap: "round",
|
|
465
|
+
strokeLinejoin: "round",
|
|
466
|
+
"aria-hidden": "true",
|
|
467
|
+
children: [
|
|
468
|
+
/* @__PURE__ */ c("path", { d: "M18 6 6 18" }),
|
|
469
|
+
/* @__PURE__ */ c("path", { d: "m6 6 12 12" })
|
|
470
|
+
]
|
|
471
|
+
}
|
|
472
|
+
)
|
|
473
|
+
}
|
|
474
|
+
) : null,
|
|
475
|
+
/* @__PURE__ */ c(
|
|
476
|
+
"span",
|
|
477
|
+
{
|
|
478
|
+
"aria-hidden": "true",
|
|
479
|
+
className: L(
|
|
480
|
+
"uk-select__chevron",
|
|
481
|
+
o.loading && "uk-select__spinner"
|
|
482
|
+
),
|
|
483
|
+
children: o.loading ? null : /* @__PURE__ */ c("svg", { viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ c(
|
|
484
|
+
"path",
|
|
485
|
+
{
|
|
486
|
+
d: "m4 6.2 4 4 4-4",
|
|
487
|
+
stroke: "currentColor",
|
|
488
|
+
strokeWidth: "1.5",
|
|
489
|
+
strokeLinecap: "round",
|
|
490
|
+
strokeLinejoin: "round"
|
|
491
|
+
}
|
|
492
|
+
) })
|
|
493
|
+
}
|
|
494
|
+
)
|
|
495
|
+
] }),
|
|
496
|
+
o.loading ? /* @__PURE__ */ c(
|
|
497
|
+
"span",
|
|
498
|
+
{
|
|
499
|
+
className: "uk-select__loading-status",
|
|
500
|
+
role: "status",
|
|
501
|
+
"aria-live": "polite",
|
|
502
|
+
children: s
|
|
503
|
+
}
|
|
504
|
+
) : null
|
|
276
505
|
]
|
|
277
506
|
}
|
|
278
507
|
);
|
|
279
508
|
});
|
|
280
|
-
function
|
|
281
|
-
const [n,
|
|
509
|
+
function xt(t, e) {
|
|
510
|
+
const [n, r] = S(null), i = j(() => {
|
|
282
511
|
const s = e.current;
|
|
283
512
|
if (!t || !s)
|
|
284
513
|
return;
|
|
285
|
-
const a = t.getBoundingClientRect(),
|
|
514
|
+
const a = t.getBoundingClientRect(), d = s.getBoundingClientRect(), p = window.innerHeight - a.bottom - 8, l = a.top - 8, h = p >= Math.min(d.height, 320) || p >= l ? "bottom" : "top", o = h === "bottom" ? a.bottom + 6 : a.top - d.height - 6, f = De(
|
|
286
515
|
a.left,
|
|
287
516
|
8,
|
|
288
517
|
Math.max(8, window.innerWidth - a.width - 8)
|
|
289
518
|
);
|
|
290
|
-
|
|
519
|
+
r({ x: f, y: o, side: h });
|
|
291
520
|
}, [e, t]);
|
|
292
|
-
return
|
|
521
|
+
return se(() => {
|
|
293
522
|
if (!t)
|
|
294
523
|
return;
|
|
295
524
|
i(), window.addEventListener("resize", i), window.addEventListener("scroll", i, !0);
|
|
@@ -299,337 +528,460 @@ function ht(t, e) {
|
|
|
299
528
|
};
|
|
300
529
|
}, [e, t, i]), n;
|
|
301
530
|
}
|
|
302
|
-
function
|
|
531
|
+
function It({
|
|
303
532
|
emptyText: t
|
|
304
533
|
}) {
|
|
305
|
-
const e =
|
|
534
|
+
const e = ge("Select.Content"), n = e.triggerId, r = document.getElementById(
|
|
306
535
|
n
|
|
307
|
-
), i =
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
);
|
|
312
|
-
if (
|
|
536
|
+
), i = $(null), s = U() ?? !1, a = ce(), d = xt(r, i), p = ae(
|
|
537
|
+
ht,
|
|
538
|
+
mt,
|
|
539
|
+
gt
|
|
540
|
+
), [l, h] = S([]), [o, f] = S(0), v = $(/* @__PURE__ */ new Map()), m = $(/* @__PURE__ */ new Map()), [k, b] = S(e.open), [I, x] = S(!1);
|
|
541
|
+
if (k !== e.open && (b(e.open), x(!1), e.open || (h([]), f((y) => y + 1))), H(() => {
|
|
542
|
+
!e.open || !d || !I || h((y) => {
|
|
543
|
+
const w = e.optionNodes[e.activeIndex];
|
|
544
|
+
if (!w)
|
|
545
|
+
return y;
|
|
546
|
+
const T = w.hasChildren ? w.depth + 1 : w.depth, E = y.filter((F) => F.level <= T);
|
|
547
|
+
if (!w.hasChildren)
|
|
548
|
+
return E.length === y.length ? y : E;
|
|
549
|
+
const N = v.current.get(w.index);
|
|
550
|
+
if (!N)
|
|
551
|
+
return E;
|
|
552
|
+
const P = N.getBoundingClientRect(), R = 224, B = P.right + R + 14 > window.innerWidth ? P.left - R - 6 : P.right + 6, G = De(P.top - 6, 8, window.innerHeight - 8), X = E.find((F) => F.level === T);
|
|
553
|
+
return X?.parentIndex === w.index ? X.left === B && X.top === G ? y : [
|
|
554
|
+
...E.filter((F) => F.level !== T),
|
|
555
|
+
{ ...X, left: B, top: G }
|
|
556
|
+
] : [
|
|
557
|
+
...E.filter((F) => F.level !== T),
|
|
558
|
+
{
|
|
559
|
+
session: o,
|
|
560
|
+
level: T,
|
|
561
|
+
parentIndex: w.index,
|
|
562
|
+
left: B,
|
|
563
|
+
top: G
|
|
564
|
+
}
|
|
565
|
+
];
|
|
566
|
+
});
|
|
567
|
+
}, [
|
|
568
|
+
e.activeIndex,
|
|
569
|
+
e.open,
|
|
570
|
+
e.optionNodes,
|
|
571
|
+
o,
|
|
572
|
+
d,
|
|
573
|
+
I,
|
|
574
|
+
h
|
|
575
|
+
]), H(() => {
|
|
313
576
|
if (!e.open)
|
|
314
577
|
return;
|
|
315
|
-
const
|
|
316
|
-
const
|
|
317
|
-
|
|
578
|
+
const y = (E) => {
|
|
579
|
+
const N = E.target;
|
|
580
|
+
N instanceof Node && (r?.contains(N) || i.current?.contains(N) || Array.from(m.current.values()).some(
|
|
581
|
+
(P) => P.contains(N)
|
|
582
|
+
) || (e.setOpen(!1), r?.focus()));
|
|
318
583
|
};
|
|
319
|
-
document.addEventListener("pointerdown",
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
},
|
|
584
|
+
document.addEventListener("pointerdown", y, !0);
|
|
585
|
+
const w = (E) => {
|
|
586
|
+
E.key === "Escape" && (e.setOpen(!1), r?.focus());
|
|
587
|
+
}, T = () => {
|
|
323
588
|
e.setOpen(!1);
|
|
324
589
|
};
|
|
325
|
-
return document.addEventListener("keydown",
|
|
326
|
-
document.removeEventListener("pointerdown",
|
|
590
|
+
return document.addEventListener("keydown", w, !0), window.addEventListener("blur", T), () => {
|
|
591
|
+
document.removeEventListener("pointerdown", y, !0), document.removeEventListener("keydown", w, !0), window.removeEventListener("blur", T);
|
|
327
592
|
};
|
|
328
|
-
}, [e,
|
|
593
|
+
}, [e, r]), !p)
|
|
329
594
|
return null;
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
595
|
+
const g = r?.closest("dialog") ?? document.body, u = j(
|
|
596
|
+
(y, w) => {
|
|
597
|
+
w ? v.current.set(y, w) : v.current.delete(y);
|
|
598
|
+
},
|
|
599
|
+
[]
|
|
600
|
+
), _ = (y) => {
|
|
601
|
+
const w = y.option, T = e.values.includes(w.value), E = y.index === e.activeIndex;
|
|
602
|
+
return /* @__PURE__ */ D(
|
|
603
|
+
"li",
|
|
334
604
|
{
|
|
335
|
-
ref:
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
"
|
|
339
|
-
"aria-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
605
|
+
ref: (N) => u(y.index, N),
|
|
606
|
+
id: `${e.contentId}-option-${y.index}`,
|
|
607
|
+
role: "option",
|
|
608
|
+
"aria-disabled": w.disabled || void 0,
|
|
609
|
+
"aria-selected": T,
|
|
610
|
+
"data-disabled": w.disabled || void 0,
|
|
611
|
+
"data-selected": T || Re(w, e.values) || void 0,
|
|
612
|
+
"data-active": E || void 0,
|
|
613
|
+
"data-has-children": y.hasChildren || void 0,
|
|
614
|
+
"data-depth": y.depth,
|
|
615
|
+
className: "uk-select__option",
|
|
616
|
+
onPointerEnter: (N) => {
|
|
617
|
+
N.pointerType === "mouse" && !w.disabled && e.setActiveIndex(y.index);
|
|
345
618
|
},
|
|
346
|
-
|
|
347
|
-
|
|
619
|
+
onClick: (N) => {
|
|
620
|
+
if (N.stopPropagation(), y.hasChildren) {
|
|
621
|
+
e.setActiveIndex(
|
|
622
|
+
fe(e.optionNodes, y.index)
|
|
623
|
+
);
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
e.commit(y.index);
|
|
627
|
+
},
|
|
628
|
+
children: [
|
|
629
|
+
/* @__PURE__ */ c(z, { initial: !1, children: E ? /* @__PURE__ */ c(
|
|
630
|
+
O.span,
|
|
631
|
+
{
|
|
632
|
+
className: "uk-select__option-highlight",
|
|
633
|
+
"data-slot": "select-active-highlight",
|
|
634
|
+
layoutId: `${e.contentId}-active-${y.depth}`,
|
|
635
|
+
"aria-hidden": "true",
|
|
636
|
+
initial: { opacity: 0 },
|
|
637
|
+
animate: { opacity: 1 },
|
|
638
|
+
exit: { opacity: 0 },
|
|
639
|
+
transition: s ? { duration: 0 } : de
|
|
640
|
+
}
|
|
641
|
+
) : null }),
|
|
642
|
+
/* @__PURE__ */ c("span", { className: "uk-select__option-label", children: w.label ?? w.value }),
|
|
643
|
+
y.hasChildren ? /* @__PURE__ */ c("span", { "aria-hidden": "true", className: "uk-select__expand", children: /* @__PURE__ */ c("svg", { viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ c(
|
|
644
|
+
"path",
|
|
645
|
+
{
|
|
646
|
+
d: "m6 4 4 4-4 4",
|
|
647
|
+
stroke: "currentColor",
|
|
648
|
+
strokeWidth: "1.5",
|
|
649
|
+
strokeLinecap: "round",
|
|
650
|
+
strokeLinejoin: "round"
|
|
651
|
+
}
|
|
652
|
+
) }) }) : /* @__PURE__ */ c("span", { "aria-hidden": "true", className: "uk-select__check" })
|
|
653
|
+
]
|
|
654
|
+
},
|
|
655
|
+
w.value
|
|
656
|
+
);
|
|
657
|
+
}, C = e.open ? l : [];
|
|
658
|
+
return le(
|
|
659
|
+
/* @__PURE__ */ D(Ce, { id: `select-${e.contentId}`, children: [
|
|
660
|
+
/* @__PURE__ */ c(
|
|
661
|
+
"div",
|
|
662
|
+
{
|
|
663
|
+
ref: i,
|
|
664
|
+
className: "uk-select",
|
|
665
|
+
"data-side": d?.side ?? "bottom",
|
|
666
|
+
"data-state": a ? "open" : "closed",
|
|
667
|
+
"aria-hidden": a ? void 0 : !0,
|
|
668
|
+
style: {
|
|
669
|
+
left: d ? `${d.x}px` : 0,
|
|
670
|
+
top: d ? `${d.y}px` : 0,
|
|
671
|
+
"--uk-select-width": `${r?.offsetWidth ?? 220}px`,
|
|
672
|
+
visibility: d ? "visible" : "hidden"
|
|
673
|
+
},
|
|
674
|
+
children: /* @__PURE__ */ c(
|
|
675
|
+
O.div,
|
|
676
|
+
{
|
|
677
|
+
className: "uk-select__surface",
|
|
678
|
+
style: {
|
|
679
|
+
transformOrigin: bt(d?.side ?? "bottom")
|
|
680
|
+
},
|
|
681
|
+
initial: s ? { opacity: 0 } : { opacity: 0, scale: 0.97, y: -4 },
|
|
682
|
+
animate: s ? { opacity: 1 } : { opacity: 1, scale: 1, y: 0 },
|
|
683
|
+
exit: s ? { opacity: 0 } : { opacity: 0, scale: 0.97, y: -2 },
|
|
684
|
+
transition: s ? Y : Ee,
|
|
685
|
+
onAnimationComplete: () => {
|
|
686
|
+
e.open && x(!0);
|
|
687
|
+
},
|
|
688
|
+
children: e.options.length === 0 ? /* @__PURE__ */ c("p", { className: "uk-select__empty", children: t }) : /* @__PURE__ */ c(
|
|
689
|
+
"ul",
|
|
690
|
+
{
|
|
691
|
+
id: e.contentId,
|
|
692
|
+
className: "uk-select__list",
|
|
693
|
+
role: "listbox",
|
|
694
|
+
"aria-labelledby": n,
|
|
695
|
+
"aria-owns": C.map(
|
|
696
|
+
(y) => `${e.contentId}-submenu-${y.level}`
|
|
697
|
+
).join(" ") || void 0,
|
|
698
|
+
children: e.optionNodes.filter((y) => y.depth === 0).map(_)
|
|
699
|
+
}
|
|
700
|
+
)
|
|
701
|
+
}
|
|
702
|
+
)
|
|
703
|
+
}
|
|
704
|
+
),
|
|
705
|
+
C.map((y) => {
|
|
706
|
+
const w = e.optionNodes.filter(
|
|
707
|
+
(T) => T.parentIndex === y.parentIndex
|
|
708
|
+
);
|
|
709
|
+
return /* @__PURE__ */ c(
|
|
710
|
+
O.div,
|
|
348
711
|
{
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
712
|
+
ref: (T) => {
|
|
713
|
+
T ? m.current.set(y.level, T) : m.current.delete(y.level);
|
|
714
|
+
},
|
|
715
|
+
className: "uk-select__submenu",
|
|
716
|
+
"data-select-owner": e.contentId,
|
|
717
|
+
"data-state": a ? "open" : "closed",
|
|
718
|
+
layout: !0,
|
|
719
|
+
initial: {
|
|
720
|
+
opacity: 0,
|
|
721
|
+
x: -34,
|
|
722
|
+
scaleX: 0.18,
|
|
723
|
+
scaleY: 0.36
|
|
724
|
+
},
|
|
725
|
+
animate: { opacity: 1, x: 0, scaleX: 1, scaleY: 1 },
|
|
726
|
+
exit: { opacity: 0, x: -16, scaleX: 0.28, scaleY: 0.42 },
|
|
727
|
+
style: {
|
|
728
|
+
left: y.left,
|
|
729
|
+
top: y.top,
|
|
730
|
+
transformOrigin: "left center"
|
|
731
|
+
},
|
|
732
|
+
transition: s ? Y : ut,
|
|
733
|
+
children: /* @__PURE__ */ c(
|
|
356
734
|
"ul",
|
|
357
735
|
{
|
|
358
|
-
id: e.contentId
|
|
736
|
+
id: `${e.contentId}-submenu-${y.level}`,
|
|
359
737
|
className: "uk-select__list",
|
|
360
738
|
role: "listbox",
|
|
361
739
|
"aria-labelledby": n,
|
|
362
|
-
children:
|
|
363
|
-
"li",
|
|
364
|
-
{
|
|
365
|
-
id: `${e.contentId}-option-${h}`,
|
|
366
|
-
role: "option",
|
|
367
|
-
"aria-disabled": u.disabled || void 0,
|
|
368
|
-
"aria-selected": u.value === e.value,
|
|
369
|
-
"data-disabled": u.disabled || void 0,
|
|
370
|
-
"data-selected": u.value === e.value || void 0,
|
|
371
|
-
"data-active": h === e.activeIndex || void 0,
|
|
372
|
-
className: "uk-select__option",
|
|
373
|
-
onPointerEnter: (d) => {
|
|
374
|
-
d.pointerType === "mouse" && !u.disabled && e.setActiveIndex(h);
|
|
375
|
-
},
|
|
376
|
-
onClick: (d) => {
|
|
377
|
-
d.stopPropagation(), e.commit(h);
|
|
378
|
-
},
|
|
379
|
-
children: [
|
|
380
|
-
/* @__PURE__ */ l(A, { initial: !1, children: h === e.activeIndex ? /* @__PURE__ */ l(
|
|
381
|
-
D.span,
|
|
382
|
-
{
|
|
383
|
-
className: "uk-select__option-highlight",
|
|
384
|
-
"data-slot": "select-active-highlight",
|
|
385
|
-
layoutId: `${e.contentId}-active`,
|
|
386
|
-
"aria-hidden": "true",
|
|
387
|
-
initial: { opacity: 0 },
|
|
388
|
-
animate: { opacity: 1 },
|
|
389
|
-
exit: { opacity: 0 },
|
|
390
|
-
transition: s ? { duration: 0 } : ie
|
|
391
|
-
}
|
|
392
|
-
) : null }),
|
|
393
|
-
/* @__PURE__ */ l("span", { className: "uk-select__option-label", children: u.label ?? u.value }),
|
|
394
|
-
/* @__PURE__ */ l("span", { "aria-hidden": "true", className: "uk-select__check" })
|
|
395
|
-
]
|
|
396
|
-
},
|
|
397
|
-
u.value
|
|
398
|
-
))
|
|
740
|
+
children: w.map(_)
|
|
399
741
|
}
|
|
400
|
-
)
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
742
|
+
)
|
|
743
|
+
},
|
|
744
|
+
`${y.session}-${y.level}`
|
|
745
|
+
);
|
|
746
|
+
})
|
|
747
|
+
] }),
|
|
748
|
+
g
|
|
406
749
|
);
|
|
407
750
|
}
|
|
408
|
-
const
|
|
751
|
+
const Zt = A(function({
|
|
409
752
|
options: e,
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
753
|
+
multiple: n,
|
|
754
|
+
value: r,
|
|
755
|
+
defaultValue: i,
|
|
756
|
+
onValueChange: s,
|
|
757
|
+
placeholder: a,
|
|
758
|
+
size: d = "md",
|
|
759
|
+
clear: p,
|
|
760
|
+
disabled: l,
|
|
761
|
+
invalid: h,
|
|
762
|
+
emptyText: o = "暂无可选项",
|
|
763
|
+
loading: f = !1,
|
|
764
|
+
loadingText: v = "加载中...",
|
|
765
|
+
className: m,
|
|
766
|
+
...k
|
|
767
|
+
}, b) {
|
|
768
|
+
return /* @__PURE__ */ D(
|
|
769
|
+
yt,
|
|
423
770
|
{
|
|
424
771
|
options: e,
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
772
|
+
loading: f,
|
|
773
|
+
multiple: n,
|
|
774
|
+
value: r,
|
|
775
|
+
defaultValue: i,
|
|
776
|
+
onValueChange: s,
|
|
428
777
|
children: [
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
|
|
778
|
+
/* @__PURE__ */ c(
|
|
779
|
+
kt,
|
|
431
780
|
{
|
|
432
|
-
...
|
|
433
|
-
ref:
|
|
434
|
-
placeholder:
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
781
|
+
...k,
|
|
782
|
+
ref: b,
|
|
783
|
+
placeholder: a,
|
|
784
|
+
size: d,
|
|
785
|
+
clear: p,
|
|
786
|
+
loadingText: v,
|
|
787
|
+
disabled: l,
|
|
788
|
+
"aria-invalid": h || void 0,
|
|
789
|
+
"data-size": d,
|
|
790
|
+
className: m
|
|
439
791
|
}
|
|
440
792
|
),
|
|
441
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ c(wt, { emptyText: o })
|
|
442
794
|
]
|
|
443
795
|
}
|
|
444
796
|
);
|
|
445
797
|
});
|
|
446
|
-
function
|
|
447
|
-
const e =
|
|
448
|
-
return /* @__PURE__ */
|
|
798
|
+
function wt({ emptyText: t }) {
|
|
799
|
+
const e = ge("Select.Content");
|
|
800
|
+
return /* @__PURE__ */ c(z, { children: e.open ? /* @__PURE__ */ c(It, { emptyText: t }, "select-layer") : null });
|
|
449
801
|
}
|
|
450
|
-
const
|
|
802
|
+
const en = A(function({
|
|
451
803
|
inputSize: e = "md",
|
|
452
804
|
invalid: n = !1,
|
|
453
|
-
className:
|
|
805
|
+
className: r,
|
|
454
806
|
"aria-invalid": i,
|
|
455
807
|
...s
|
|
456
808
|
}, a) {
|
|
457
|
-
return /* @__PURE__ */
|
|
809
|
+
return /* @__PURE__ */ c(
|
|
458
810
|
"input",
|
|
459
811
|
{
|
|
460
812
|
...s,
|
|
461
813
|
ref: a,
|
|
462
|
-
className:
|
|
814
|
+
className: L("uk-input", r),
|
|
463
815
|
"data-size": e,
|
|
464
816
|
"aria-invalid": n ? !0 : i
|
|
465
817
|
}
|
|
466
818
|
);
|
|
467
|
-
}),
|
|
819
|
+
}), tn = A(function({
|
|
468
820
|
checked: e,
|
|
469
821
|
defaultChecked: n,
|
|
470
|
-
onCheckedChange:
|
|
822
|
+
onCheckedChange: r,
|
|
471
823
|
disabled: i,
|
|
472
824
|
className: s,
|
|
473
825
|
children: a,
|
|
474
|
-
id:
|
|
826
|
+
id: d,
|
|
475
827
|
...p
|
|
476
|
-
},
|
|
477
|
-
const
|
|
828
|
+
}, l) {
|
|
829
|
+
const h = V(), o = d ?? h, f = U() ?? !1, v = $(!1), m = $(null), [k, b] = J({
|
|
478
830
|
value: e,
|
|
479
831
|
defaultValue: n ?? !1,
|
|
480
|
-
onChange:
|
|
481
|
-
}),
|
|
482
|
-
|
|
483
|
-
if (
|
|
832
|
+
onChange: r
|
|
833
|
+
}), I = lt(k ? 16 : 0);
|
|
834
|
+
H(() => {
|
|
835
|
+
if (m.current)
|
|
484
836
|
return;
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
837
|
+
const g = ye(
|
|
838
|
+
I,
|
|
839
|
+
k ? 16 : 0,
|
|
840
|
+
f ? { duration: 0 } : ke
|
|
489
841
|
);
|
|
490
|
-
return () =>
|
|
491
|
-
}, [
|
|
492
|
-
const
|
|
493
|
-
const
|
|
494
|
-
if (!(!
|
|
495
|
-
if (
|
|
496
|
-
const
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
842
|
+
return () => g.stop();
|
|
843
|
+
}, [k, f, I]);
|
|
844
|
+
const x = (g) => {
|
|
845
|
+
const u = m.current;
|
|
846
|
+
if (!(!u || u.pointerId !== g.pointerId)) {
|
|
847
|
+
if (u.moved) {
|
|
848
|
+
const _ = u.samples[0], C = u.samples[u.samples.length - 1], y = _ && C ? Math.max(C.time - _.time, 1) : 1, w = _ && C ? (C.x - _.x) / y * 1e3 : 0, T = Math.abs(w) > 220 ? w > 0 : I.get() >= 8;
|
|
849
|
+
v.current = !0, m.current = null, b(T), ye(
|
|
850
|
+
I,
|
|
851
|
+
T ? 16 : 0,
|
|
852
|
+
f ? { duration: 0 } : { ...ke, velocity: w }
|
|
501
853
|
), window.setTimeout(() => {
|
|
502
|
-
|
|
854
|
+
v.current = !1;
|
|
503
855
|
}, 0);
|
|
504
856
|
} else
|
|
505
|
-
|
|
506
|
-
|
|
857
|
+
m.current = null;
|
|
858
|
+
g.currentTarget.hasPointerCapture(g.pointerId) && typeof g.currentTarget.releasePointerCapture == "function" && g.currentTarget.releasePointerCapture(g.pointerId);
|
|
507
859
|
}
|
|
508
860
|
};
|
|
509
|
-
return /* @__PURE__ */
|
|
861
|
+
return /* @__PURE__ */ D(
|
|
510
862
|
"label",
|
|
511
863
|
{
|
|
512
|
-
className:
|
|
864
|
+
className: L("uk-switch", s),
|
|
513
865
|
"data-disabled": i ? "true" : void 0,
|
|
514
|
-
htmlFor:
|
|
515
|
-
onClickCapture: (
|
|
516
|
-
|
|
866
|
+
htmlFor: o,
|
|
867
|
+
onClickCapture: (g) => {
|
|
868
|
+
v.current && (g.preventDefault(), g.stopPropagation());
|
|
517
869
|
},
|
|
518
870
|
children: [
|
|
519
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ c(
|
|
520
872
|
"input",
|
|
521
873
|
{
|
|
522
874
|
...p,
|
|
523
|
-
ref:
|
|
524
|
-
id:
|
|
875
|
+
ref: l,
|
|
876
|
+
id: o,
|
|
525
877
|
type: "checkbox",
|
|
526
878
|
role: "switch",
|
|
527
879
|
className: "uk-switch__input",
|
|
528
|
-
checked:
|
|
880
|
+
checked: k,
|
|
529
881
|
disabled: i,
|
|
530
|
-
"aria-checked":
|
|
531
|
-
onChange: (
|
|
882
|
+
"aria-checked": k,
|
|
883
|
+
onChange: (g) => b(g.target.checked)
|
|
532
884
|
}
|
|
533
885
|
),
|
|
534
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ c(
|
|
535
887
|
"span",
|
|
536
888
|
{
|
|
537
889
|
className: "uk-switch__track",
|
|
538
890
|
"aria-hidden": "true",
|
|
539
|
-
onPointerDown: (
|
|
540
|
-
i || (
|
|
541
|
-
pointerId:
|
|
542
|
-
startX:
|
|
543
|
-
startValue:
|
|
891
|
+
onPointerDown: (g) => {
|
|
892
|
+
i || (m.current = {
|
|
893
|
+
pointerId: g.pointerId,
|
|
894
|
+
startX: g.clientX,
|
|
895
|
+
startValue: I.get(),
|
|
544
896
|
moved: !1,
|
|
545
|
-
samples: [{ x:
|
|
546
|
-
}, typeof
|
|
897
|
+
samples: [{ x: g.clientX, time: performance.now() }]
|
|
898
|
+
}, typeof g.currentTarget.setPointerCapture == "function" && g.currentTarget.setPointerCapture(g.pointerId));
|
|
547
899
|
},
|
|
548
|
-
onPointerMove: (
|
|
549
|
-
const
|
|
550
|
-
if (!
|
|
900
|
+
onPointerMove: (g) => {
|
|
901
|
+
const u = m.current;
|
|
902
|
+
if (!u || u.pointerId !== g.pointerId)
|
|
551
903
|
return;
|
|
552
|
-
const
|
|
553
|
-
Math.abs(
|
|
554
|
-
(
|
|
904
|
+
const _ = g.clientX - u.startX;
|
|
905
|
+
Math.abs(_) > 4 && (u.moved = !0), u.moved && (g.preventDefault(), I.set(Math.max(0, Math.min(16, u.startValue + _))), u.samples.push({ x: g.clientX, time: performance.now() }), u.samples = u.samples.filter(
|
|
906
|
+
(C) => performance.now() - C.time < 120
|
|
555
907
|
));
|
|
556
908
|
},
|
|
557
|
-
onPointerUp:
|
|
558
|
-
onPointerCancel:
|
|
559
|
-
children: /* @__PURE__ */
|
|
909
|
+
onPointerUp: x,
|
|
910
|
+
onPointerCancel: x,
|
|
911
|
+
children: /* @__PURE__ */ c(O.span, { className: "uk-switch__thumb", style: { x: I } })
|
|
560
912
|
}
|
|
561
913
|
),
|
|
562
|
-
a ? /* @__PURE__ */
|
|
914
|
+
a ? /* @__PURE__ */ c("span", { className: "uk-switch__label", children: a }) : null
|
|
563
915
|
]
|
|
564
916
|
}
|
|
565
917
|
);
|
|
566
|
-
}),
|
|
567
|
-
function
|
|
568
|
-
const e =
|
|
918
|
+
}), Oe = Z(null);
|
|
919
|
+
function $e(t) {
|
|
920
|
+
const e = ee(Oe);
|
|
569
921
|
if (!e)
|
|
570
922
|
throw new Error(`<${t}> must be rendered inside <Sidebar>`);
|
|
571
923
|
return e;
|
|
572
924
|
}
|
|
573
|
-
function
|
|
925
|
+
function ue(t, e) {
|
|
574
926
|
return (n) => {
|
|
575
927
|
t?.(n), n.defaultPrevented || e(n);
|
|
576
928
|
};
|
|
577
929
|
}
|
|
578
|
-
function
|
|
930
|
+
function _t({
|
|
579
931
|
children: t,
|
|
580
932
|
className: e,
|
|
581
933
|
hoverPreview: n = !0,
|
|
582
|
-
hoverIndicator:
|
|
934
|
+
hoverIndicator: r = "rail",
|
|
583
935
|
groupGap: i,
|
|
584
936
|
style: s,
|
|
585
937
|
...a
|
|
586
938
|
}) {
|
|
587
|
-
const [
|
|
939
|
+
const [d, p] = S(null), l = V().replace(/:/g, ""), h = W(
|
|
588
940
|
() => ({
|
|
589
|
-
hoveredId:
|
|
941
|
+
hoveredId: d,
|
|
590
942
|
setHoveredId: p,
|
|
591
|
-
indicatorBaseId:
|
|
943
|
+
indicatorBaseId: l,
|
|
592
944
|
hoverPreview: n,
|
|
593
|
-
hoverIndicator:
|
|
945
|
+
hoverIndicator: r
|
|
594
946
|
}),
|
|
595
|
-
[
|
|
596
|
-
),
|
|
947
|
+
[d, l, n, r]
|
|
948
|
+
), o = typeof i == "number" ? `${i}px` : i, f = {
|
|
597
949
|
...s,
|
|
598
|
-
...
|
|
950
|
+
...o === void 0 ? {} : { "--uk-sidebar-group-gap": o }
|
|
599
951
|
};
|
|
600
|
-
return /* @__PURE__ */
|
|
952
|
+
return /* @__PURE__ */ c(Oe.Provider, { value: h, children: /* @__PURE__ */ c(Ce, { id: `sidebar-${l}`, children: /* @__PURE__ */ c(
|
|
601
953
|
"nav",
|
|
602
954
|
{
|
|
603
955
|
...a,
|
|
604
|
-
className:
|
|
605
|
-
style:
|
|
956
|
+
className: L("uk-sidebar", e),
|
|
957
|
+
style: f,
|
|
606
958
|
children: t
|
|
607
959
|
}
|
|
608
960
|
) }) });
|
|
609
961
|
}
|
|
610
|
-
function
|
|
962
|
+
function Tt({
|
|
611
963
|
title: t,
|
|
612
964
|
icon: e,
|
|
613
965
|
collapsible: n = !1,
|
|
614
|
-
open:
|
|
966
|
+
open: r,
|
|
615
967
|
defaultOpen: i = !0,
|
|
616
968
|
onOpenChange: s,
|
|
617
969
|
children: a,
|
|
618
|
-
className:
|
|
970
|
+
className: d,
|
|
619
971
|
...p
|
|
620
972
|
}) {
|
|
621
|
-
const
|
|
622
|
-
value:
|
|
973
|
+
const l = V(), h = V(), o = V(), f = $(null), v = $(null), m = $e("Sidebar.Group"), k = e != null, b = U() ?? !1, [I, x] = J({
|
|
974
|
+
value: r,
|
|
623
975
|
defaultValue: i,
|
|
624
976
|
onChange: s
|
|
625
|
-
}),
|
|
626
|
-
|
|
627
|
-
!n ||
|
|
628
|
-
}, [n,
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
-
n ? /* @__PURE__ */
|
|
977
|
+
}), g = n ? I : !0, u = m.hoveredId === o;
|
|
978
|
+
H(() => {
|
|
979
|
+
!n || g || v.current?.contains(document.activeElement) && f.current?.focus();
|
|
980
|
+
}, [n, g]);
|
|
981
|
+
const _ = /* @__PURE__ */ D(Te, { children: [
|
|
982
|
+
k ? /* @__PURE__ */ c("span", { className: "uk-sidebar__group-icon", "aria-hidden": "true", children: e }) : null,
|
|
983
|
+
/* @__PURE__ */ c("span", { className: "uk-sidebar__group-label", children: t }),
|
|
984
|
+
n ? /* @__PURE__ */ c("span", { className: "uk-sidebar__chevron", "aria-hidden": "true", children: /* @__PURE__ */ c("svg", { viewBox: "0 0 16 16", width: "12", height: "12", fill: "none", children: /* @__PURE__ */ c(
|
|
633
985
|
"path",
|
|
634
986
|
{
|
|
635
987
|
d: "m6 3.8 4.2 4.2L6 12.2",
|
|
@@ -640,94 +992,94 @@ function yt({
|
|
|
640
992
|
}
|
|
641
993
|
) }) }) : null
|
|
642
994
|
] });
|
|
643
|
-
return /* @__PURE__ */
|
|
995
|
+
return /* @__PURE__ */ D(
|
|
644
996
|
"section",
|
|
645
997
|
{
|
|
646
998
|
...p,
|
|
647
|
-
className:
|
|
648
|
-
"aria-labelledby": p["aria-labelledby"] ??
|
|
999
|
+
className: L("uk-sidebar__group", d),
|
|
1000
|
+
"aria-labelledby": p["aria-labelledby"] ?? l,
|
|
649
1001
|
"data-collapsible": n ? "true" : "false",
|
|
650
|
-
"data-has-icon":
|
|
651
|
-
"data-state":
|
|
1002
|
+
"data-has-icon": k ? "true" : "false",
|
|
1003
|
+
"data-state": g ? "open" : "closed",
|
|
652
1004
|
children: [
|
|
653
|
-
n ? /* @__PURE__ */
|
|
1005
|
+
n ? /* @__PURE__ */ D(
|
|
654
1006
|
"button",
|
|
655
1007
|
{
|
|
656
|
-
ref:
|
|
1008
|
+
ref: f,
|
|
657
1009
|
type: "button",
|
|
658
1010
|
className: "uk-sidebar__group-title uk-sidebar__group-trigger",
|
|
659
|
-
id:
|
|
660
|
-
"aria-controls":
|
|
661
|
-
"aria-expanded":
|
|
662
|
-
"data-preview":
|
|
663
|
-
onClick: () =>
|
|
664
|
-
onPointerEnter: (
|
|
665
|
-
|
|
1011
|
+
id: l,
|
|
1012
|
+
"aria-controls": h,
|
|
1013
|
+
"aria-expanded": g,
|
|
1014
|
+
"data-preview": m.hoverIndicator === "background" && u ? "true" : void 0,
|
|
1015
|
+
onClick: () => x((C) => !C),
|
|
1016
|
+
onPointerEnter: (C) => {
|
|
1017
|
+
m.hoverPreview && m.hoverIndicator === "background" && C.pointerType === "mouse" && m.setHoveredId(o);
|
|
666
1018
|
},
|
|
667
1019
|
onPointerLeave: () => {
|
|
668
|
-
|
|
1020
|
+
m.hoveredId === o && m.setHoveredId(null);
|
|
669
1021
|
},
|
|
670
1022
|
onPointerCancel: () => {
|
|
671
|
-
|
|
1023
|
+
m.hoveredId === o && m.setHoveredId(null);
|
|
672
1024
|
},
|
|
673
1025
|
children: [
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
|
|
1026
|
+
/* @__PURE__ */ c(z, { initial: !1, children: m.hoverPreview && m.hoverIndicator === "background" && u ? /* @__PURE__ */ c(
|
|
1027
|
+
O.span,
|
|
676
1028
|
{
|
|
677
1029
|
className: "uk-sidebar__group-surface",
|
|
678
1030
|
"data-kind": "hover",
|
|
679
1031
|
"data-slot": "sidebar-hover-highlight",
|
|
680
|
-
layoutId: `${
|
|
1032
|
+
layoutId: `${m.indicatorBaseId}-hover`,
|
|
681
1033
|
"aria-hidden": "true",
|
|
682
1034
|
initial: { opacity: 0 },
|
|
683
1035
|
animate: { opacity: 1 },
|
|
684
1036
|
exit: { opacity: 0 },
|
|
685
|
-
transition:
|
|
1037
|
+
transition: b ? { duration: 0 } : de
|
|
686
1038
|
}
|
|
687
1039
|
) : null }),
|
|
688
|
-
|
|
1040
|
+
_
|
|
689
1041
|
]
|
|
690
1042
|
}
|
|
691
|
-
) : /* @__PURE__ */
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
|
|
1043
|
+
) : /* @__PURE__ */ c("div", { className: "uk-sidebar__group-title", id: l, children: _ }),
|
|
1044
|
+
/* @__PURE__ */ c(
|
|
1045
|
+
O.div,
|
|
694
1046
|
{
|
|
695
|
-
ref:
|
|
1047
|
+
ref: v,
|
|
696
1048
|
className: "uk-sidebar__content",
|
|
697
|
-
id:
|
|
698
|
-
"data-state":
|
|
1049
|
+
id: h,
|
|
1050
|
+
"data-state": g ? "open" : "closed",
|
|
699
1051
|
initial: !1,
|
|
700
1052
|
animate: {
|
|
701
|
-
height:
|
|
702
|
-
opacity:
|
|
1053
|
+
height: g ? "auto" : 0,
|
|
1054
|
+
opacity: g ? 1 : 0
|
|
703
1055
|
},
|
|
704
|
-
transition:
|
|
705
|
-
inert: n && !
|
|
706
|
-
"aria-hidden": n && !
|
|
707
|
-
children: /* @__PURE__ */
|
|
1056
|
+
transition: b ? { duration: 0 } : Ee,
|
|
1057
|
+
inert: n && !g,
|
|
1058
|
+
"aria-hidden": n && !g ? !0 : void 0,
|
|
1059
|
+
children: /* @__PURE__ */ c("ul", { className: "uk-sidebar__list", children: a })
|
|
708
1060
|
}
|
|
709
1061
|
)
|
|
710
1062
|
]
|
|
711
1063
|
}
|
|
712
1064
|
);
|
|
713
1065
|
}
|
|
714
|
-
function
|
|
1066
|
+
function Ct({
|
|
715
1067
|
active: t = !1,
|
|
716
1068
|
children: e,
|
|
717
1069
|
className: n
|
|
718
1070
|
}) {
|
|
719
|
-
const
|
|
720
|
-
if (!
|
|
1071
|
+
const r = $e("Sidebar.Item"), i = V(), a = U() ?? !1 ? { duration: 0 } : de;
|
|
1072
|
+
if (!te(e))
|
|
721
1073
|
throw new Error("<Sidebar.Item> expects a single valid React element");
|
|
722
|
-
const
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
-
/* @__PURE__ */
|
|
725
|
-
|
|
1074
|
+
const d = e, p = d.props, l = p.className, h = typeof l == "function" ? (b) => L("uk-sidebar__link", l(b), n) : L("uk-sidebar__link", l, n), o = p.onPointerEnter, f = p.onPointerLeave, v = p.onPointerCancel, m = r.hoveredId === i, k = /* @__PURE__ */ D(Te, { children: [
|
|
1075
|
+
/* @__PURE__ */ c("span", { className: "uk-sidebar__rail", "aria-hidden": "true" }),
|
|
1076
|
+
/* @__PURE__ */ c(z, { initial: !1, children: r.hoverPreview && r.hoverIndicator === "rail" && m ? /* @__PURE__ */ c(
|
|
1077
|
+
O.span,
|
|
726
1078
|
{
|
|
727
1079
|
className: "uk-sidebar__rail-indicator",
|
|
728
1080
|
"data-kind": "hover",
|
|
729
1081
|
"data-slot": "sidebar-hover-rail-indicator",
|
|
730
|
-
layoutId: `${
|
|
1082
|
+
layoutId: `${r.indicatorBaseId}-hover-rail`,
|
|
731
1083
|
"aria-hidden": "true",
|
|
732
1084
|
initial: { opacity: 0 },
|
|
733
1085
|
animate: { opacity: 1 },
|
|
@@ -735,13 +1087,13 @@ function vt({
|
|
|
735
1087
|
transition: a
|
|
736
1088
|
}
|
|
737
1089
|
) : null }),
|
|
738
|
-
/* @__PURE__ */
|
|
739
|
-
|
|
1090
|
+
/* @__PURE__ */ c(z, { initial: !1, children: r.hoverIndicator === "rail" && t ? /* @__PURE__ */ c(
|
|
1091
|
+
O.span,
|
|
740
1092
|
{
|
|
741
1093
|
className: "uk-sidebar__rail-indicator",
|
|
742
1094
|
"data-kind": "active",
|
|
743
1095
|
"data-slot": "sidebar-active-rail-indicator",
|
|
744
|
-
layoutId: `${
|
|
1096
|
+
layoutId: `${r.indicatorBaseId}-active-rail`,
|
|
745
1097
|
"aria-hidden": "true",
|
|
746
1098
|
initial: { opacity: 0 },
|
|
747
1099
|
animate: { opacity: 1 },
|
|
@@ -749,13 +1101,13 @@ function vt({
|
|
|
749
1101
|
transition: a
|
|
750
1102
|
}
|
|
751
1103
|
) : null }),
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
-
|
|
1104
|
+
/* @__PURE__ */ c(z, { initial: !1, children: r.hoverPreview && r.hoverIndicator === "background" && m ? /* @__PURE__ */ c(
|
|
1105
|
+
O.span,
|
|
754
1106
|
{
|
|
755
1107
|
className: "uk-sidebar__surface",
|
|
756
1108
|
"data-kind": "hover",
|
|
757
1109
|
"data-slot": "sidebar-hover-highlight",
|
|
758
|
-
layoutId: `${
|
|
1110
|
+
layoutId: `${r.indicatorBaseId}-hover`,
|
|
759
1111
|
"aria-hidden": "true",
|
|
760
1112
|
initial: { opacity: 0 },
|
|
761
1113
|
animate: { opacity: 1 },
|
|
@@ -763,13 +1115,13 @@ function vt({
|
|
|
763
1115
|
transition: a
|
|
764
1116
|
}
|
|
765
1117
|
) : null }),
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
|
|
1118
|
+
/* @__PURE__ */ c(z, { initial: !1, children: r.hoverIndicator === "background" && t ? /* @__PURE__ */ c(
|
|
1119
|
+
O.span,
|
|
768
1120
|
{
|
|
769
1121
|
className: "uk-sidebar__surface",
|
|
770
1122
|
"data-kind": "active",
|
|
771
1123
|
"data-slot": "sidebar-active-highlight",
|
|
772
|
-
layoutId: `${
|
|
1124
|
+
layoutId: `${r.indicatorBaseId}-active`,
|
|
773
1125
|
"aria-hidden": "true",
|
|
774
1126
|
initial: { opacity: 0 },
|
|
775
1127
|
animate: { opacity: 1 },
|
|
@@ -777,361 +1129,361 @@ function vt({
|
|
|
777
1129
|
transition: a
|
|
778
1130
|
}
|
|
779
1131
|
) : null }),
|
|
780
|
-
/* @__PURE__ */
|
|
1132
|
+
/* @__PURE__ */ c("span", { className: "uk-sidebar__label", children: p.children })
|
|
781
1133
|
] });
|
|
782
|
-
return /* @__PURE__ */
|
|
783
|
-
|
|
1134
|
+
return /* @__PURE__ */ c("li", { className: "uk-sidebar__item", children: ne(
|
|
1135
|
+
d,
|
|
784
1136
|
{
|
|
785
|
-
className:
|
|
1137
|
+
className: h,
|
|
786
1138
|
"data-active": t ? "true" : "false",
|
|
787
|
-
"data-preview": t ||
|
|
1139
|
+
"data-preview": t || m ? "true" : "false",
|
|
788
1140
|
"aria-current": p["aria-current"] ?? (t ? "page" : void 0),
|
|
789
|
-
onPointerEnter:
|
|
790
|
-
|
|
791
|
-
(
|
|
792
|
-
|
|
1141
|
+
onPointerEnter: ue(
|
|
1142
|
+
o,
|
|
1143
|
+
(b) => {
|
|
1144
|
+
r.hoverPreview && b.pointerType === "mouse" && r.setHoveredId(i);
|
|
793
1145
|
}
|
|
794
1146
|
),
|
|
795
|
-
onPointerLeave:
|
|
796
|
-
|
|
1147
|
+
onPointerLeave: ue(f, () => {
|
|
1148
|
+
r.hoveredId === i && r.setHoveredId(null);
|
|
797
1149
|
}),
|
|
798
|
-
onPointerCancel:
|
|
799
|
-
|
|
1150
|
+
onPointerCancel: ue(v, () => {
|
|
1151
|
+
r.hoveredId === i && r.setHoveredId(null);
|
|
800
1152
|
})
|
|
801
1153
|
},
|
|
802
|
-
|
|
1154
|
+
k
|
|
803
1155
|
) });
|
|
804
1156
|
}
|
|
805
|
-
const
|
|
806
|
-
Group:
|
|
807
|
-
Item:
|
|
808
|
-
}),
|
|
809
|
-
function
|
|
810
|
-
const e =
|
|
1157
|
+
const nn = Object.assign(_t, {
|
|
1158
|
+
Group: Tt,
|
|
1159
|
+
Item: Ct
|
|
1160
|
+
}), Me = Z(null);
|
|
1161
|
+
function be(t) {
|
|
1162
|
+
const e = ee(Me);
|
|
811
1163
|
if (!e)
|
|
812
1164
|
throw new Error(`<${t}> must be rendered inside <Tabs>`);
|
|
813
1165
|
return e;
|
|
814
1166
|
}
|
|
815
|
-
function
|
|
1167
|
+
function Ae(t, e) {
|
|
816
1168
|
return `${t}-tab-${encodeURIComponent(e)}`;
|
|
817
1169
|
}
|
|
818
|
-
function
|
|
1170
|
+
function Be(t, e) {
|
|
819
1171
|
return `${t}-panel-${encodeURIComponent(e)}`;
|
|
820
1172
|
}
|
|
821
|
-
function
|
|
1173
|
+
function Nt({
|
|
822
1174
|
value: t,
|
|
823
1175
|
defaultValue: e,
|
|
824
1176
|
onValueChange: n,
|
|
825
|
-
orientation:
|
|
1177
|
+
orientation: r = "horizontal",
|
|
826
1178
|
className: i,
|
|
827
1179
|
children: s
|
|
828
1180
|
}) {
|
|
829
|
-
const a =
|
|
1181
|
+
const a = V(), [d, p] = J({
|
|
830
1182
|
value: t,
|
|
831
1183
|
defaultValue: e ?? "",
|
|
832
1184
|
onChange: n
|
|
833
|
-
}),
|
|
1185
|
+
}), l = W(
|
|
834
1186
|
() => ({
|
|
835
1187
|
baseId: a,
|
|
836
|
-
value:
|
|
1188
|
+
value: d,
|
|
837
1189
|
setValue: p,
|
|
838
|
-
orientation:
|
|
1190
|
+
orientation: r,
|
|
839
1191
|
indicatorId: `${a}-indicator`
|
|
840
1192
|
}),
|
|
841
|
-
[a,
|
|
1193
|
+
[a, d, r, p]
|
|
842
1194
|
);
|
|
843
|
-
return /* @__PURE__ */
|
|
1195
|
+
return /* @__PURE__ */ c(Me.Provider, { value: l, children: /* @__PURE__ */ c("div", { className: L("uk-tabs", i), "data-orientation": r, children: s }) });
|
|
844
1196
|
}
|
|
845
|
-
const
|
|
846
|
-
const { orientation: s } =
|
|
847
|
-
return /* @__PURE__ */
|
|
1197
|
+
const Et = A(function({ className: e, onKeyDown: n, ...r }, i) {
|
|
1198
|
+
const { orientation: s } = be("Tabs.List");
|
|
1199
|
+
return /* @__PURE__ */ c(
|
|
848
1200
|
"div",
|
|
849
1201
|
{
|
|
850
|
-
...
|
|
1202
|
+
...r,
|
|
851
1203
|
ref: i,
|
|
852
1204
|
role: "tablist",
|
|
853
1205
|
"aria-orientation": s,
|
|
854
1206
|
tabIndex: -1,
|
|
855
|
-
className:
|
|
1207
|
+
className: L("uk-tabs__list", e),
|
|
856
1208
|
onKeyDown: (a) => {
|
|
857
1209
|
if (n?.(a), a.defaultPrevented)
|
|
858
1210
|
return;
|
|
859
1211
|
const p = a.target?.closest('[role="tab"]');
|
|
860
1212
|
if (!p || p.hasAttribute("disabled"))
|
|
861
1213
|
return;
|
|
862
|
-
const
|
|
1214
|
+
const l = Array.from(
|
|
863
1215
|
a.currentTarget.querySelectorAll(
|
|
864
1216
|
'[role="tab"]:not([disabled])'
|
|
865
1217
|
)
|
|
866
|
-
),
|
|
867
|
-
if (
|
|
1218
|
+
), h = l.indexOf(p);
|
|
1219
|
+
if (h === -1)
|
|
868
1220
|
return;
|
|
869
|
-
const
|
|
870
|
-
let
|
|
1221
|
+
const o = s === "horizontal" ? "ArrowRight" : "ArrowDown", f = s === "horizontal" ? "ArrowLeft" : "ArrowUp";
|
|
1222
|
+
let v = -1;
|
|
871
1223
|
switch (a.key) {
|
|
872
|
-
case
|
|
873
|
-
|
|
1224
|
+
case o:
|
|
1225
|
+
v = (h + 1) % l.length;
|
|
874
1226
|
break;
|
|
875
|
-
case
|
|
876
|
-
|
|
1227
|
+
case f:
|
|
1228
|
+
v = (h - 1 + l.length) % l.length;
|
|
877
1229
|
break;
|
|
878
1230
|
case "Home":
|
|
879
|
-
|
|
1231
|
+
v = 0;
|
|
880
1232
|
break;
|
|
881
1233
|
case "End":
|
|
882
|
-
|
|
1234
|
+
v = l.length - 1;
|
|
883
1235
|
break;
|
|
884
1236
|
default:
|
|
885
1237
|
return;
|
|
886
1238
|
}
|
|
887
1239
|
a.preventDefault();
|
|
888
|
-
const
|
|
889
|
-
|
|
1240
|
+
const m = l[v];
|
|
1241
|
+
m && (m.focus(), m.click());
|
|
890
1242
|
}
|
|
891
1243
|
}
|
|
892
1244
|
);
|
|
893
|
-
}),
|
|
894
|
-
const p =
|
|
895
|
-
return /* @__PURE__ */
|
|
1245
|
+
}), Pt = A(function({ value: e, type: n = "button", className: r, onClick: i, children: s, ...a }, d) {
|
|
1246
|
+
const p = be("Tabs.Trigger"), l = p.value === e, h = U() ?? !1;
|
|
1247
|
+
return /* @__PURE__ */ D(
|
|
896
1248
|
"button",
|
|
897
1249
|
{
|
|
898
1250
|
...a,
|
|
899
|
-
ref:
|
|
1251
|
+
ref: d,
|
|
900
1252
|
type: n,
|
|
901
1253
|
role: "tab",
|
|
902
|
-
id:
|
|
903
|
-
"aria-selected":
|
|
904
|
-
"aria-controls":
|
|
905
|
-
tabIndex:
|
|
906
|
-
"data-state":
|
|
907
|
-
className:
|
|
908
|
-
onClick: (
|
|
909
|
-
i?.(
|
|
1254
|
+
id: Ae(p.baseId, e),
|
|
1255
|
+
"aria-selected": l,
|
|
1256
|
+
"aria-controls": Be(p.baseId, e),
|
|
1257
|
+
tabIndex: l ? 0 : -1,
|
|
1258
|
+
"data-state": l ? "active" : "inactive",
|
|
1259
|
+
className: L("uk-tabs__trigger", r),
|
|
1260
|
+
onClick: (o) => {
|
|
1261
|
+
i?.(o), o.defaultPrevented || p.setValue(e);
|
|
910
1262
|
},
|
|
911
1263
|
children: [
|
|
912
1264
|
s,
|
|
913
|
-
|
|
914
|
-
|
|
1265
|
+
l ? /* @__PURE__ */ c(
|
|
1266
|
+
O.span,
|
|
915
1267
|
{
|
|
916
1268
|
className: "uk-tabs__indicator",
|
|
917
1269
|
layoutId: p.indicatorId,
|
|
918
1270
|
"aria-hidden": "true",
|
|
919
|
-
transition:
|
|
1271
|
+
transition: h ? { duration: 0 } : de
|
|
920
1272
|
}
|
|
921
1273
|
) : null
|
|
922
1274
|
]
|
|
923
1275
|
}
|
|
924
1276
|
);
|
|
925
|
-
}),
|
|
926
|
-
const s =
|
|
927
|
-
return /* @__PURE__ */
|
|
1277
|
+
}), Lt = A(function({ value: e, className: n, ...r }, i) {
|
|
1278
|
+
const s = be("Tabs.Content"), a = s.value === e;
|
|
1279
|
+
return /* @__PURE__ */ c(
|
|
928
1280
|
"div",
|
|
929
1281
|
{
|
|
930
|
-
...
|
|
1282
|
+
...r,
|
|
931
1283
|
ref: i,
|
|
932
1284
|
role: "tabpanel",
|
|
933
|
-
id:
|
|
934
|
-
"aria-labelledby":
|
|
1285
|
+
id: Be(s.baseId, e),
|
|
1286
|
+
"aria-labelledby": Ae(s.baseId, e),
|
|
935
1287
|
hidden: !a,
|
|
936
1288
|
tabIndex: 0,
|
|
937
1289
|
"data-state": a ? "active" : "inactive",
|
|
938
|
-
className:
|
|
1290
|
+
className: L("uk-tabs__panel", n)
|
|
939
1291
|
}
|
|
940
1292
|
);
|
|
941
|
-
}),
|
|
942
|
-
List:
|
|
943
|
-
Trigger:
|
|
944
|
-
Content:
|
|
945
|
-
}),
|
|
946
|
-
},
|
|
947
|
-
function
|
|
948
|
-
const e =
|
|
1293
|
+
}), on = Object.assign(Nt, {
|
|
1294
|
+
List: Et,
|
|
1295
|
+
Trigger: Pt,
|
|
1296
|
+
Content: Lt
|
|
1297
|
+
}), Ve = Z(null), Dt = () => () => {
|
|
1298
|
+
}, St = () => !0, Rt = () => !1;
|
|
1299
|
+
function oe(t) {
|
|
1300
|
+
const e = ee(Ve);
|
|
949
1301
|
if (!e)
|
|
950
1302
|
throw new Error(`<${t}> must be rendered inside <Dialog.Root>`);
|
|
951
1303
|
return e;
|
|
952
1304
|
}
|
|
953
|
-
function
|
|
1305
|
+
function He(t, e) {
|
|
954
1306
|
return (n) => {
|
|
955
1307
|
t?.(n), n.defaultPrevented || e(n);
|
|
956
1308
|
};
|
|
957
1309
|
}
|
|
958
|
-
function
|
|
1310
|
+
function ze({
|
|
959
1311
|
children: t,
|
|
960
1312
|
open: e,
|
|
961
1313
|
defaultOpen: n,
|
|
962
|
-
onOpenChange:
|
|
1314
|
+
onOpenChange: r
|
|
963
1315
|
}) {
|
|
964
|
-
const i =
|
|
1316
|
+
const i = V(), [s, a] = S(!1), [d, p] = S(!1), [l, h] = J({
|
|
965
1317
|
value: e,
|
|
966
1318
|
defaultValue: n ?? !1,
|
|
967
|
-
onChange:
|
|
968
|
-
}),
|
|
1319
|
+
onChange: r
|
|
1320
|
+
}), o = W(
|
|
969
1321
|
() => ({
|
|
970
|
-
open:
|
|
971
|
-
setOpen:
|
|
1322
|
+
open: l,
|
|
1323
|
+
setOpen: h,
|
|
972
1324
|
triggerId: `${i}-trigger`,
|
|
973
1325
|
contentId: `${i}-content`,
|
|
974
1326
|
titleId: `${i}-title`,
|
|
975
1327
|
descriptionId: `${i}-description`,
|
|
976
1328
|
hasTitle: s,
|
|
977
1329
|
setHasTitle: a,
|
|
978
|
-
hasDescription:
|
|
1330
|
+
hasDescription: d,
|
|
979
1331
|
setHasDescription: p
|
|
980
1332
|
}),
|
|
981
|
-
[i,
|
|
1333
|
+
[i, l, d, s, h]
|
|
982
1334
|
);
|
|
983
|
-
return /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ c(Ve.Provider, { value: o, children: t });
|
|
984
1336
|
}
|
|
985
|
-
function
|
|
986
|
-
const e =
|
|
987
|
-
return
|
|
1337
|
+
function Ot({ children: t }) {
|
|
1338
|
+
const e = oe("Dialog.Trigger"), n = t, r = n.props.onClick;
|
|
1339
|
+
return ne(n, {
|
|
988
1340
|
id: e.triggerId,
|
|
989
1341
|
"aria-haspopup": "dialog",
|
|
990
1342
|
"aria-expanded": e.open,
|
|
991
1343
|
"aria-controls": e.open ? e.contentId : void 0,
|
|
992
|
-
onClick:
|
|
1344
|
+
onClick: He(r, () => {
|
|
993
1345
|
e.setOpen(!e.open);
|
|
994
1346
|
})
|
|
995
1347
|
});
|
|
996
1348
|
}
|
|
997
|
-
function
|
|
1349
|
+
function Ke({
|
|
998
1350
|
children: t,
|
|
999
1351
|
label: e = "Close"
|
|
1000
1352
|
}) {
|
|
1001
|
-
const n =
|
|
1002
|
-
if (
|
|
1003
|
-
const
|
|
1004
|
-
return
|
|
1005
|
-
onClick:
|
|
1353
|
+
const n = oe("Dialog.Close");
|
|
1354
|
+
if (te(t)) {
|
|
1355
|
+
const r = t, i = r.props.onClick;
|
|
1356
|
+
return ne(r, {
|
|
1357
|
+
onClick: He(i, () => {
|
|
1006
1358
|
n.setOpen(!1);
|
|
1007
1359
|
})
|
|
1008
1360
|
});
|
|
1009
1361
|
}
|
|
1010
|
-
return /* @__PURE__ */
|
|
1362
|
+
return /* @__PURE__ */ c(Ne, { variant: "ghost", onClick: () => n.setOpen(!1), children: e });
|
|
1011
1363
|
}
|
|
1012
|
-
const
|
|
1013
|
-
return /* @__PURE__ */
|
|
1364
|
+
const Fe = A(function({ className: e, ...n }, r) {
|
|
1365
|
+
return /* @__PURE__ */ c(
|
|
1014
1366
|
"header",
|
|
1015
1367
|
{
|
|
1016
1368
|
...n,
|
|
1017
|
-
ref:
|
|
1018
|
-
className:
|
|
1369
|
+
ref: r,
|
|
1370
|
+
className: L("uk-dialog__header", e)
|
|
1019
1371
|
}
|
|
1020
1372
|
);
|
|
1021
|
-
}),
|
|
1022
|
-
const s =
|
|
1023
|
-
return
|
|
1373
|
+
}), qe = A(function({ className: e, children: n, ...r }, i) {
|
|
1374
|
+
const s = oe("Dialog.Title"), a = s.setHasTitle;
|
|
1375
|
+
return H(() => (a(!0), () => a(!1)), [a]), /* @__PURE__ */ c(
|
|
1024
1376
|
"h2",
|
|
1025
1377
|
{
|
|
1026
|
-
...
|
|
1378
|
+
...r,
|
|
1027
1379
|
ref: i,
|
|
1028
1380
|
id: s.titleId,
|
|
1029
|
-
className:
|
|
1381
|
+
className: L("uk-dialog__title", e),
|
|
1030
1382
|
children: n
|
|
1031
1383
|
}
|
|
1032
1384
|
);
|
|
1033
|
-
}),
|
|
1034
|
-
function({ className: e, ...n },
|
|
1035
|
-
const i =
|
|
1036
|
-
return
|
|
1385
|
+
}), je = A(
|
|
1386
|
+
function({ className: e, ...n }, r) {
|
|
1387
|
+
const i = oe("Dialog.Description"), s = i.setHasDescription;
|
|
1388
|
+
return H(() => (s(!0), () => s(!1)), [s]), /* @__PURE__ */ c(
|
|
1037
1389
|
"p",
|
|
1038
1390
|
{
|
|
1039
1391
|
...n,
|
|
1040
|
-
ref:
|
|
1392
|
+
ref: r,
|
|
1041
1393
|
id: i.descriptionId,
|
|
1042
|
-
className:
|
|
1394
|
+
className: L("uk-dialog__description", e)
|
|
1043
1395
|
}
|
|
1044
1396
|
);
|
|
1045
1397
|
}
|
|
1046
|
-
),
|
|
1047
|
-
return /* @__PURE__ */
|
|
1048
|
-
}),
|
|
1049
|
-
return /* @__PURE__ */
|
|
1398
|
+
), Ge = A(function({ className: e, ...n }, r) {
|
|
1399
|
+
return /* @__PURE__ */ c("div", { ...n, ref: r, className: L("uk-dialog__body", e) });
|
|
1400
|
+
}), Ue = A(function({ className: e, ...n }, r) {
|
|
1401
|
+
return /* @__PURE__ */ c(
|
|
1050
1402
|
"footer",
|
|
1051
1403
|
{
|
|
1052
1404
|
...n,
|
|
1053
|
-
ref:
|
|
1054
|
-
className:
|
|
1405
|
+
ref: r,
|
|
1406
|
+
className: L("uk-dialog__footer", e)
|
|
1055
1407
|
}
|
|
1056
1408
|
);
|
|
1057
1409
|
});
|
|
1058
|
-
function
|
|
1410
|
+
function $t({
|
|
1059
1411
|
requestClose: t,
|
|
1060
1412
|
contentId: e,
|
|
1061
1413
|
titleId: n,
|
|
1062
|
-
descriptionId:
|
|
1414
|
+
descriptionId: r,
|
|
1063
1415
|
hasTitle: i,
|
|
1064
1416
|
hasDescription: s,
|
|
1065
1417
|
children: a,
|
|
1066
|
-
closeOnBackdropClick:
|
|
1418
|
+
closeOnBackdropClick: d = !0,
|
|
1067
1419
|
closeOnEscape: p = !0,
|
|
1068
|
-
initialFocusRef:
|
|
1069
|
-
returnFocusRef:
|
|
1070
|
-
className:
|
|
1071
|
-
"aria-label":
|
|
1072
|
-
"aria-labelledby":
|
|
1073
|
-
"aria-describedby":
|
|
1420
|
+
initialFocusRef: l,
|
|
1421
|
+
returnFocusRef: h,
|
|
1422
|
+
className: o,
|
|
1423
|
+
"aria-label": f,
|
|
1424
|
+
"aria-labelledby": v,
|
|
1425
|
+
"aria-describedby": m
|
|
1074
1426
|
}) {
|
|
1075
|
-
const
|
|
1076
|
-
return
|
|
1077
|
-
const
|
|
1078
|
-
|
|
1079
|
-
}, []),
|
|
1427
|
+
const k = $(null), b = $(null), I = ce(), x = U() ?? !1;
|
|
1428
|
+
return st(!0), se(() => {
|
|
1429
|
+
const g = k.current;
|
|
1430
|
+
g && (b.current ?? (b.current = document.activeElement instanceof HTMLElement ? document.activeElement : null), !g.open && (typeof g.showModal == "function" ? g.showModal() : g.setAttribute("open", "")));
|
|
1431
|
+
}, []), ct({
|
|
1080
1432
|
active: !0,
|
|
1081
|
-
containerRef:
|
|
1082
|
-
initialFocusRef:
|
|
1083
|
-
returnFocusRef:
|
|
1084
|
-
}),
|
|
1085
|
-
const
|
|
1086
|
-
if (!
|
|
1433
|
+
containerRef: k,
|
|
1434
|
+
initialFocusRef: l,
|
|
1435
|
+
returnFocusRef: h ?? b
|
|
1436
|
+
}), H(() => {
|
|
1437
|
+
const g = k.current;
|
|
1438
|
+
if (!g)
|
|
1087
1439
|
return;
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1090
|
-
},
|
|
1440
|
+
const u = () => {
|
|
1441
|
+
g.open || (typeof g.showModal == "function" ? g.showModal() : g.setAttribute("open", ""));
|
|
1442
|
+
}, _ = () => {
|
|
1091
1443
|
if (!p) {
|
|
1092
|
-
|
|
1444
|
+
u();
|
|
1093
1445
|
return;
|
|
1094
1446
|
}
|
|
1095
1447
|
t();
|
|
1096
|
-
},
|
|
1097
|
-
|
|
1098
|
-
},
|
|
1099
|
-
p ||
|
|
1100
|
-
},
|
|
1101
|
-
|
|
1448
|
+
}, C = (T) => {
|
|
1449
|
+
T.preventDefault(), p && t();
|
|
1450
|
+
}, y = (T) => {
|
|
1451
|
+
p || T.key !== "Escape" || T.defaultPrevented || (T.preventDefault(), T.stopPropagation());
|
|
1452
|
+
}, w = (T) => {
|
|
1453
|
+
d && T.target === g && t();
|
|
1102
1454
|
};
|
|
1103
|
-
return
|
|
1104
|
-
|
|
1455
|
+
return g.addEventListener("close", _), g.addEventListener("cancel", C), g.addEventListener("keydown", y, !0), g.addEventListener("click", w), () => {
|
|
1456
|
+
g.removeEventListener("close", _), g.removeEventListener("cancel", C), g.removeEventListener("keydown", y, !0), g.removeEventListener("click", w);
|
|
1105
1457
|
};
|
|
1106
|
-
}, [
|
|
1458
|
+
}, [d, p, t]), /* @__PURE__ */ c(
|
|
1107
1459
|
"dialog",
|
|
1108
1460
|
{
|
|
1109
|
-
ref:
|
|
1461
|
+
ref: k,
|
|
1110
1462
|
id: e,
|
|
1111
|
-
className:
|
|
1112
|
-
closedby: p ||
|
|
1113
|
-
"data-state":
|
|
1114
|
-
inert: !
|
|
1115
|
-
"aria-label":
|
|
1116
|
-
"aria-labelledby":
|
|
1117
|
-
"aria-describedby":
|
|
1118
|
-
children: /* @__PURE__ */
|
|
1119
|
-
|
|
1463
|
+
className: L("uk-dialog", o),
|
|
1464
|
+
closedby: p || d ? "any" : "none",
|
|
1465
|
+
"data-state": I ? "open" : "closed",
|
|
1466
|
+
inert: !I,
|
|
1467
|
+
"aria-label": f,
|
|
1468
|
+
"aria-labelledby": v ?? (f ? void 0 : i ? n : void 0),
|
|
1469
|
+
"aria-describedby": m ?? (s ? r : void 0),
|
|
1470
|
+
children: /* @__PURE__ */ c(
|
|
1471
|
+
O.div,
|
|
1120
1472
|
{
|
|
1121
1473
|
className: "uk-dialog__panel",
|
|
1122
|
-
initial:
|
|
1474
|
+
initial: x ? { opacity: 0 } : {
|
|
1123
1475
|
opacity: 0,
|
|
1124
1476
|
transform: "translateY(12px) scale(0.96)"
|
|
1125
1477
|
},
|
|
1126
1478
|
animate: {
|
|
1127
1479
|
opacity: 1,
|
|
1128
1480
|
transform: "translateY(0px) scale(1)",
|
|
1129
|
-
transition:
|
|
1481
|
+
transition: x ? Y : { ...xe, delay: 0.06 }
|
|
1130
1482
|
},
|
|
1131
|
-
exit:
|
|
1483
|
+
exit: x ? { opacity: 0, transition: Y } : {
|
|
1132
1484
|
opacity: 0,
|
|
1133
1485
|
transform: "translateY(8px) scale(0.97)",
|
|
1134
|
-
transition:
|
|
1486
|
+
transition: xe
|
|
1135
1487
|
},
|
|
1136
1488
|
children: a
|
|
1137
1489
|
}
|
|
@@ -1139,41 +1491,41 @@ function Et({
|
|
|
1139
1491
|
}
|
|
1140
1492
|
);
|
|
1141
1493
|
}
|
|
1142
|
-
function
|
|
1494
|
+
function Xe({
|
|
1143
1495
|
children: t,
|
|
1144
1496
|
closeOnBackdropClick: e = !0,
|
|
1145
1497
|
closeOnEscape: n = !0,
|
|
1146
|
-
initialFocusRef:
|
|
1498
|
+
initialFocusRef: r,
|
|
1147
1499
|
returnFocusRef: i,
|
|
1148
1500
|
className: s,
|
|
1149
1501
|
"aria-label": a,
|
|
1150
|
-
"aria-labelledby":
|
|
1502
|
+
"aria-labelledby": d,
|
|
1151
1503
|
"aria-describedby": p
|
|
1152
1504
|
}) {
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1505
|
+
const l = oe("Dialog.Content"), h = M(() => {
|
|
1506
|
+
l.setOpen(!1);
|
|
1155
1507
|
});
|
|
1156
|
-
return
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
) ?
|
|
1161
|
-
/* @__PURE__ */
|
|
1162
|
-
|
|
1508
|
+
return ae(
|
|
1509
|
+
Dt,
|
|
1510
|
+
St,
|
|
1511
|
+
Rt
|
|
1512
|
+
) ? le(
|
|
1513
|
+
/* @__PURE__ */ c(me, { reducedMotion: "user", children: /* @__PURE__ */ c(z, { children: l.open ? /* @__PURE__ */ c(
|
|
1514
|
+
$t,
|
|
1163
1515
|
{
|
|
1164
|
-
requestClose:
|
|
1165
|
-
contentId:
|
|
1166
|
-
titleId:
|
|
1167
|
-
descriptionId:
|
|
1168
|
-
hasTitle:
|
|
1169
|
-
hasDescription:
|
|
1516
|
+
requestClose: h,
|
|
1517
|
+
contentId: l.contentId,
|
|
1518
|
+
titleId: l.titleId,
|
|
1519
|
+
descriptionId: l.descriptionId,
|
|
1520
|
+
hasTitle: l.hasTitle,
|
|
1521
|
+
hasDescription: l.hasDescription,
|
|
1170
1522
|
closeOnBackdropClick: e,
|
|
1171
1523
|
closeOnEscape: n,
|
|
1172
|
-
initialFocusRef:
|
|
1524
|
+
initialFocusRef: r,
|
|
1173
1525
|
returnFocusRef: i,
|
|
1174
1526
|
className: s,
|
|
1175
1527
|
"aria-label": a,
|
|
1176
|
-
"aria-labelledby":
|
|
1528
|
+
"aria-labelledby": d,
|
|
1177
1529
|
"aria-describedby": p,
|
|
1178
1530
|
children: t
|
|
1179
1531
|
},
|
|
@@ -1182,53 +1534,53 @@ function ze({
|
|
|
1182
1534
|
document.body
|
|
1183
1535
|
) : null;
|
|
1184
1536
|
}
|
|
1185
|
-
function
|
|
1537
|
+
function Mt({
|
|
1186
1538
|
open: t,
|
|
1187
1539
|
onOpenChange: e,
|
|
1188
1540
|
title: n,
|
|
1189
|
-
description:
|
|
1541
|
+
description: r,
|
|
1190
1542
|
footer: i,
|
|
1191
1543
|
children: s,
|
|
1192
1544
|
closeLabel: a = "Close",
|
|
1193
|
-
showCloseButton:
|
|
1545
|
+
showCloseButton: d = !0,
|
|
1194
1546
|
closeOnBackdropClick: p = !0,
|
|
1195
|
-
closeOnEscape:
|
|
1196
|
-
initialFocusRef:
|
|
1197
|
-
returnFocusRef:
|
|
1198
|
-
className:
|
|
1199
|
-
"aria-label":
|
|
1547
|
+
closeOnEscape: l = !0,
|
|
1548
|
+
initialFocusRef: h,
|
|
1549
|
+
returnFocusRef: o,
|
|
1550
|
+
className: f,
|
|
1551
|
+
"aria-label": v
|
|
1200
1552
|
}) {
|
|
1201
|
-
return /* @__PURE__ */
|
|
1202
|
-
|
|
1553
|
+
return /* @__PURE__ */ c(ze, { open: t, onOpenChange: e, children: /* @__PURE__ */ D(
|
|
1554
|
+
Xe,
|
|
1203
1555
|
{
|
|
1204
|
-
className:
|
|
1556
|
+
className: f,
|
|
1205
1557
|
closeOnBackdropClick: p,
|
|
1206
|
-
closeOnEscape:
|
|
1207
|
-
initialFocusRef:
|
|
1208
|
-
returnFocusRef:
|
|
1209
|
-
"aria-label":
|
|
1558
|
+
closeOnEscape: l,
|
|
1559
|
+
initialFocusRef: h,
|
|
1560
|
+
returnFocusRef: o,
|
|
1561
|
+
"aria-label": v,
|
|
1210
1562
|
children: [
|
|
1211
|
-
n ||
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
n ? /* @__PURE__ */
|
|
1214
|
-
|
|
1563
|
+
n || r || d ? /* @__PURE__ */ D(Fe, { children: [
|
|
1564
|
+
/* @__PURE__ */ D("div", { className: "uk-dialog__heading", children: [
|
|
1565
|
+
n ? /* @__PURE__ */ c(qe, { children: n }) : null,
|
|
1566
|
+
r ? /* @__PURE__ */ c(je, { children: r }) : null
|
|
1215
1567
|
] }),
|
|
1216
|
-
|
|
1217
|
-
|
|
1568
|
+
d ? /* @__PURE__ */ c(Ke, { children: /* @__PURE__ */ c(
|
|
1569
|
+
Ne,
|
|
1218
1570
|
{
|
|
1219
1571
|
variant: "ghost",
|
|
1220
1572
|
size: "sm",
|
|
1221
1573
|
iconOnly: !0,
|
|
1222
1574
|
"aria-label": a,
|
|
1223
1575
|
className: "uk-dialog__close",
|
|
1224
|
-
children: /* @__PURE__ */
|
|
1576
|
+
children: /* @__PURE__ */ c(
|
|
1225
1577
|
"svg",
|
|
1226
1578
|
{
|
|
1227
1579
|
viewBox: "0 0 20 20",
|
|
1228
1580
|
width: "16",
|
|
1229
1581
|
height: "16",
|
|
1230
1582
|
"aria-hidden": "true",
|
|
1231
|
-
children: /* @__PURE__ */
|
|
1583
|
+
children: /* @__PURE__ */ c(
|
|
1232
1584
|
"path",
|
|
1233
1585
|
{
|
|
1234
1586
|
d: "M5 5l10 10M15 5L5 15",
|
|
@@ -1242,24 +1594,24 @@ function Pt({
|
|
|
1242
1594
|
}
|
|
1243
1595
|
) }) : null
|
|
1244
1596
|
] }) : null,
|
|
1245
|
-
/* @__PURE__ */
|
|
1246
|
-
i ? /* @__PURE__ */
|
|
1597
|
+
/* @__PURE__ */ c(Ge, { children: s }),
|
|
1598
|
+
i ? /* @__PURE__ */ c(Ue, { children: i }) : null
|
|
1247
1599
|
]
|
|
1248
1600
|
}
|
|
1249
1601
|
) });
|
|
1250
1602
|
}
|
|
1251
|
-
const
|
|
1252
|
-
Root:
|
|
1253
|
-
Trigger:
|
|
1254
|
-
Content:
|
|
1255
|
-
Header:
|
|
1256
|
-
Title:
|
|
1257
|
-
Description:
|
|
1258
|
-
Body:
|
|
1259
|
-
Footer:
|
|
1260
|
-
Close:
|
|
1603
|
+
const rn = Object.assign(Mt, {
|
|
1604
|
+
Root: ze,
|
|
1605
|
+
Trigger: Ot,
|
|
1606
|
+
Content: Xe,
|
|
1607
|
+
Header: Fe,
|
|
1608
|
+
Title: qe,
|
|
1609
|
+
Description: je,
|
|
1610
|
+
Body: Ge,
|
|
1611
|
+
Footer: Ue,
|
|
1612
|
+
Close: Ke
|
|
1261
1613
|
});
|
|
1262
|
-
function
|
|
1614
|
+
function At(t, e) {
|
|
1263
1615
|
if (!(e instanceof Element))
|
|
1264
1616
|
return !1;
|
|
1265
1617
|
const n = e.closest(
|
|
@@ -1267,196 +1619,196 @@ function Dt(t, e) {
|
|
|
1267
1619
|
);
|
|
1268
1620
|
return n !== null && n !== t;
|
|
1269
1621
|
}
|
|
1270
|
-
const
|
|
1622
|
+
const an = A(function({
|
|
1271
1623
|
children: e,
|
|
1272
1624
|
className: n,
|
|
1273
|
-
direction:
|
|
1625
|
+
direction: r = "left",
|
|
1274
1626
|
speed: i = 30,
|
|
1275
1627
|
pauseOnHover: s = !0,
|
|
1276
1628
|
gap: a = "1rem",
|
|
1277
|
-
fade:
|
|
1629
|
+
fade: d = !0,
|
|
1278
1630
|
paused: p = !1,
|
|
1279
|
-
items:
|
|
1280
|
-
onItemClick:
|
|
1281
|
-
...
|
|
1282
|
-
},
|
|
1283
|
-
const
|
|
1284
|
-
key:
|
|
1285
|
-
content:
|
|
1286
|
-
data:
|
|
1287
|
-
})) :
|
|
1288
|
-
key:
|
|
1289
|
-
content:
|
|
1631
|
+
items: l,
|
|
1632
|
+
onItemClick: h,
|
|
1633
|
+
...o
|
|
1634
|
+
}, f) {
|
|
1635
|
+
const v = l ? l.map((b) => ({
|
|
1636
|
+
key: b.key,
|
|
1637
|
+
content: b.content,
|
|
1638
|
+
data: b.data
|
|
1639
|
+
})) : at.toArray(e).map((b, I) => ({
|
|
1640
|
+
key: te(b) ? b.key ?? null : null,
|
|
1641
|
+
content: b,
|
|
1290
1642
|
data: void 0
|
|
1291
|
-
})),
|
|
1292
|
-
!
|
|
1293
|
-
},
|
|
1294
|
-
!
|
|
1643
|
+
})), m = (b, I, x) => {
|
|
1644
|
+
!h || x.defaultPrevented || At(x.currentTarget, x.target) || h({ index: I, key: b.key, data: b.data }, x);
|
|
1645
|
+
}, k = (b, I, x) => {
|
|
1646
|
+
!h || x.defaultPrevented || (x.key === "Enter" || x.key === " ") && (x.preventDefault(), h({ index: I, key: b.key, data: b.data }, x));
|
|
1295
1647
|
};
|
|
1296
|
-
return /* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ c(
|
|
1297
1649
|
"div",
|
|
1298
1650
|
{
|
|
1299
|
-
...
|
|
1300
|
-
ref:
|
|
1301
|
-
className:
|
|
1302
|
-
"data-direction":
|
|
1303
|
-
"data-fade":
|
|
1651
|
+
...o,
|
|
1652
|
+
ref: f,
|
|
1653
|
+
className: L("uk-marquee", n),
|
|
1654
|
+
"data-direction": r,
|
|
1655
|
+
"data-fade": d ? "true" : void 0,
|
|
1304
1656
|
"data-pause-on-hover": s ? "true" : void 0,
|
|
1305
1657
|
"data-paused": p ? "true" : "false",
|
|
1306
1658
|
style: {
|
|
1307
|
-
...
|
|
1659
|
+
...o.style,
|
|
1308
1660
|
"--uk-marquee-gap": a,
|
|
1309
1661
|
"--uk-marquee-duration": `${i}s`,
|
|
1310
1662
|
gap: a
|
|
1311
1663
|
},
|
|
1312
|
-
children: [!1, !0].map((
|
|
1664
|
+
children: [!1, !0].map((b) => /* @__PURE__ */ c(
|
|
1313
1665
|
"div",
|
|
1314
1666
|
{
|
|
1315
|
-
"aria-hidden":
|
|
1667
|
+
"aria-hidden": b,
|
|
1316
1668
|
className: "uk-marquee__track",
|
|
1317
|
-
"data-duplicate":
|
|
1318
|
-
inert:
|
|
1319
|
-
role:
|
|
1320
|
-
onFocusCapture:
|
|
1321
|
-
|
|
1669
|
+
"data-duplicate": b ? "true" : void 0,
|
|
1670
|
+
inert: b && !h,
|
|
1671
|
+
role: b ? "presentation" : void 0,
|
|
1672
|
+
onFocusCapture: b ? (I) => {
|
|
1673
|
+
I.target instanceof HTMLElement && I.target.blur();
|
|
1322
1674
|
} : void 0,
|
|
1323
|
-
children:
|
|
1675
|
+
children: v.map((I, x) => /* @__PURE__ */ c(
|
|
1324
1676
|
"div",
|
|
1325
1677
|
{
|
|
1326
1678
|
className: "uk-marquee__item",
|
|
1327
|
-
"data-clickable":
|
|
1328
|
-
...
|
|
1329
|
-
role:
|
|
1330
|
-
tabIndex:
|
|
1331
|
-
onClick: (
|
|
1332
|
-
onKeyDown:
|
|
1679
|
+
"data-clickable": h ? "true" : void 0,
|
|
1680
|
+
...h ? {
|
|
1681
|
+
role: b ? void 0 : "button",
|
|
1682
|
+
tabIndex: b ? -1 : 0,
|
|
1683
|
+
onClick: (g) => m(I, x, g),
|
|
1684
|
+
onKeyDown: b ? void 0 : (g) => k(I, x, g)
|
|
1333
1685
|
} : {},
|
|
1334
|
-
children:
|
|
1686
|
+
children: I.content
|
|
1335
1687
|
},
|
|
1336
|
-
|
|
1688
|
+
b ? `duplicate-${x}` : I.key ?? x
|
|
1337
1689
|
))
|
|
1338
1690
|
},
|
|
1339
|
-
|
|
1691
|
+
b ? "duplicate" : "primary"
|
|
1340
1692
|
))
|
|
1341
1693
|
}
|
|
1342
1694
|
);
|
|
1343
|
-
}),
|
|
1344
|
-
},
|
|
1345
|
-
function
|
|
1346
|
-
const e =
|
|
1695
|
+
}), We = Z(null), Ye = () => () => {
|
|
1696
|
+
}, Je = () => !0, Qe = () => !1;
|
|
1697
|
+
function Ze(t) {
|
|
1698
|
+
const e = ee(We);
|
|
1347
1699
|
if (!e)
|
|
1348
1700
|
throw new Error(`<${t}> must be rendered inside <Tooltip.Root>`);
|
|
1349
1701
|
return e;
|
|
1350
1702
|
}
|
|
1351
|
-
function
|
|
1703
|
+
function et(t, e) {
|
|
1352
1704
|
typeof t == "function" ? t(e) : t && (t.current = e);
|
|
1353
1705
|
}
|
|
1354
|
-
function
|
|
1706
|
+
function tt(t, e) {
|
|
1355
1707
|
const n = typeof t == "string" ? t.split(/\s+/).filter(Boolean) : [];
|
|
1356
1708
|
return Array.from(/* @__PURE__ */ new Set([...n, e])).join(" ");
|
|
1357
1709
|
}
|
|
1358
|
-
function
|
|
1710
|
+
function q(t, e) {
|
|
1359
1711
|
return (n) => {
|
|
1360
1712
|
t?.(n), n.defaultPrevented || e(n);
|
|
1361
1713
|
};
|
|
1362
1714
|
}
|
|
1363
|
-
function
|
|
1715
|
+
function Bt({
|
|
1364
1716
|
children: t,
|
|
1365
1717
|
open: e,
|
|
1366
1718
|
defaultOpen: n,
|
|
1367
|
-
onOpenChange:
|
|
1719
|
+
onOpenChange: r,
|
|
1368
1720
|
delayDuration: i = 300,
|
|
1369
1721
|
closeDelay: s = 80
|
|
1370
1722
|
}) {
|
|
1371
|
-
const a =
|
|
1723
|
+
const a = V(), [d, p] = S(
|
|
1372
1724
|
null
|
|
1373
|
-
),
|
|
1725
|
+
), l = $(null), h = $(null), [o, f] = J({
|
|
1374
1726
|
value: e,
|
|
1375
1727
|
defaultValue: n ?? !1,
|
|
1376
|
-
onChange:
|
|
1377
|
-
}),
|
|
1378
|
-
|
|
1379
|
-
}, []),
|
|
1380
|
-
|
|
1381
|
-
}, []),
|
|
1382
|
-
if (
|
|
1383
|
-
if (
|
|
1384
|
-
|
|
1728
|
+
onChange: r
|
|
1729
|
+
}), v = j(() => {
|
|
1730
|
+
l.current !== null && (clearTimeout(l.current), l.current = null);
|
|
1731
|
+
}, []), m = j(() => {
|
|
1732
|
+
h.current !== null && (clearTimeout(h.current), h.current = null);
|
|
1733
|
+
}, []), k = M((g = !1) => {
|
|
1734
|
+
if (v(), m(), !o) {
|
|
1735
|
+
if (g || i <= 0) {
|
|
1736
|
+
f(!0);
|
|
1385
1737
|
return;
|
|
1386
1738
|
}
|
|
1387
|
-
|
|
1388
|
-
|
|
1739
|
+
l.current = setTimeout(() => {
|
|
1740
|
+
l.current = null, f(!0);
|
|
1389
1741
|
}, i);
|
|
1390
1742
|
}
|
|
1391
|
-
}),
|
|
1392
|
-
if (
|
|
1743
|
+
}), b = M(() => {
|
|
1744
|
+
if (v(), m(), !!o) {
|
|
1393
1745
|
if (s <= 0) {
|
|
1394
|
-
|
|
1746
|
+
f(!1);
|
|
1395
1747
|
return;
|
|
1396
1748
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1749
|
+
h.current = setTimeout(() => {
|
|
1750
|
+
h.current = null, f(!1);
|
|
1399
1751
|
}, s);
|
|
1400
1752
|
}
|
|
1401
|
-
}),
|
|
1402
|
-
|
|
1753
|
+
}), I = M(() => {
|
|
1754
|
+
v(), m(), f(!1);
|
|
1403
1755
|
});
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
}, [
|
|
1756
|
+
H(() => {
|
|
1757
|
+
o ? m() : v();
|
|
1758
|
+
}, [m, v, o]), H(
|
|
1407
1759
|
() => () => {
|
|
1408
|
-
|
|
1760
|
+
v(), m();
|
|
1409
1761
|
},
|
|
1410
|
-
[
|
|
1762
|
+
[m, v]
|
|
1411
1763
|
);
|
|
1412
|
-
const
|
|
1764
|
+
const x = W(
|
|
1413
1765
|
() => ({
|
|
1414
|
-
open:
|
|
1415
|
-
triggerElement:
|
|
1766
|
+
open: o,
|
|
1767
|
+
triggerElement: d,
|
|
1416
1768
|
setTriggerElement: p,
|
|
1417
1769
|
contentId: a,
|
|
1418
|
-
requestOpen:
|
|
1419
|
-
requestClose:
|
|
1420
|
-
dismiss:
|
|
1770
|
+
requestOpen: k,
|
|
1771
|
+
requestClose: b,
|
|
1772
|
+
dismiss: I
|
|
1421
1773
|
}),
|
|
1422
|
-
[a,
|
|
1774
|
+
[a, o, I, b, k, d]
|
|
1423
1775
|
);
|
|
1424
|
-
return /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ c(We.Provider, { value: x, children: t });
|
|
1425
1777
|
}
|
|
1426
|
-
function
|
|
1427
|
-
const e =
|
|
1428
|
-
if (!
|
|
1778
|
+
function Vt({ children: t }) {
|
|
1779
|
+
const e = Ze("Tooltip.Trigger"), { setTriggerElement: n } = e;
|
|
1780
|
+
if (!te(t))
|
|
1429
1781
|
throw new Error("<Tooltip.Trigger> expects a single valid React element");
|
|
1430
|
-
const
|
|
1431
|
-
(
|
|
1432
|
-
|
|
1782
|
+
const r = t, i = r.props, s = i.ref ?? r.ref, a = i.onPointerEnter, d = i.onPointerLeave, p = i.onFocus, l = i.onBlur, h = i.onKeyDown, o = j(
|
|
1783
|
+
(f) => {
|
|
1784
|
+
et(s, f), n(f);
|
|
1433
1785
|
},
|
|
1434
1786
|
[s, n]
|
|
1435
1787
|
);
|
|
1436
|
-
return
|
|
1437
|
-
ref:
|
|
1438
|
-
"aria-describedby": e.open ?
|
|
1439
|
-
onPointerEnter:
|
|
1440
|
-
e.requestOpen(
|
|
1788
|
+
return ne(r, {
|
|
1789
|
+
ref: o,
|
|
1790
|
+
"aria-describedby": e.open ? tt(i["aria-describedby"], e.contentId) : i["aria-describedby"],
|
|
1791
|
+
onPointerEnter: q(a, (f) => {
|
|
1792
|
+
e.requestOpen(f.pointerType === "touch");
|
|
1441
1793
|
}),
|
|
1442
|
-
onPointerLeave:
|
|
1443
|
-
|
|
1794
|
+
onPointerLeave: q(d, (f) => {
|
|
1795
|
+
f.pointerType !== "touch" && e.requestClose();
|
|
1444
1796
|
}),
|
|
1445
|
-
onFocus:
|
|
1797
|
+
onFocus: q(p, () => {
|
|
1446
1798
|
e.requestOpen();
|
|
1447
1799
|
}),
|
|
1448
|
-
onBlur:
|
|
1800
|
+
onBlur: q(l, () => {
|
|
1449
1801
|
e.requestClose();
|
|
1450
1802
|
}),
|
|
1451
|
-
onKeyDown:
|
|
1452
|
-
|
|
1803
|
+
onKeyDown: q(h, (f) => {
|
|
1804
|
+
f.key === "Escape" && e.open && (f.preventDefault(), f.stopPropagation(), e.dismiss());
|
|
1453
1805
|
})
|
|
1454
1806
|
});
|
|
1455
1807
|
}
|
|
1456
|
-
function
|
|
1808
|
+
function ie(t, e, n) {
|
|
1457
1809
|
return n < e ? e : Math.min(Math.max(t, e), n);
|
|
1458
1810
|
}
|
|
1459
|
-
function
|
|
1811
|
+
function Ht(t) {
|
|
1460
1812
|
switch (t) {
|
|
1461
1813
|
case "top":
|
|
1462
1814
|
return "bottom";
|
|
@@ -1468,123 +1820,123 @@ function Rt(t) {
|
|
|
1468
1820
|
return "right";
|
|
1469
1821
|
}
|
|
1470
1822
|
}
|
|
1471
|
-
function
|
|
1823
|
+
function he(t, e, n, r, i) {
|
|
1472
1824
|
switch (e) {
|
|
1473
1825
|
case "top":
|
|
1474
1826
|
return t.top - i;
|
|
1475
1827
|
case "right":
|
|
1476
1828
|
return n - t.right - i;
|
|
1477
1829
|
case "bottom":
|
|
1478
|
-
return
|
|
1830
|
+
return r - t.bottom - i;
|
|
1479
1831
|
case "left":
|
|
1480
1832
|
return t.left - i;
|
|
1481
1833
|
}
|
|
1482
1834
|
}
|
|
1483
|
-
function
|
|
1484
|
-
return
|
|
1835
|
+
function _e(t, e, n, r, i, s, a) {
|
|
1836
|
+
return he(
|
|
1485
1837
|
t,
|
|
1486
1838
|
n,
|
|
1487
1839
|
i,
|
|
1488
1840
|
s,
|
|
1489
1841
|
a
|
|
1490
|
-
) >= (n === "top" || n === "bottom" ? e.height : e.width) +
|
|
1842
|
+
) >= (n === "top" || n === "bottom" ? e.height : e.width) + r;
|
|
1491
1843
|
}
|
|
1492
|
-
function
|
|
1844
|
+
function zt({
|
|
1493
1845
|
trigger: t,
|
|
1494
1846
|
tooltip: e,
|
|
1495
1847
|
side: n,
|
|
1496
|
-
align:
|
|
1848
|
+
align: r,
|
|
1497
1849
|
sideOffset: i,
|
|
1498
1850
|
collisionPadding: s,
|
|
1499
1851
|
avoidCollisions: a,
|
|
1500
|
-
viewportWidth:
|
|
1852
|
+
viewportWidth: d,
|
|
1501
1853
|
viewportHeight: p
|
|
1502
1854
|
}) {
|
|
1503
|
-
let
|
|
1504
|
-
if (a && !
|
|
1855
|
+
let l = n;
|
|
1856
|
+
if (a && !_e(
|
|
1505
1857
|
t,
|
|
1506
1858
|
e,
|
|
1507
1859
|
n,
|
|
1508
1860
|
i,
|
|
1509
|
-
|
|
1861
|
+
d,
|
|
1510
1862
|
p,
|
|
1511
1863
|
s
|
|
1512
1864
|
)) {
|
|
1513
|
-
const
|
|
1865
|
+
const b = Ht(n), I = _e(
|
|
1514
1866
|
t,
|
|
1515
1867
|
e,
|
|
1516
|
-
|
|
1868
|
+
b,
|
|
1517
1869
|
i,
|
|
1518
|
-
|
|
1870
|
+
d,
|
|
1519
1871
|
p,
|
|
1520
1872
|
s
|
|
1521
|
-
),
|
|
1873
|
+
), x = he(
|
|
1522
1874
|
t,
|
|
1523
1875
|
n,
|
|
1524
|
-
|
|
1876
|
+
d,
|
|
1525
1877
|
p,
|
|
1526
1878
|
s
|
|
1527
|
-
),
|
|
1879
|
+
), g = he(
|
|
1528
1880
|
t,
|
|
1529
|
-
|
|
1530
|
-
|
|
1881
|
+
b,
|
|
1882
|
+
d,
|
|
1531
1883
|
p,
|
|
1532
1884
|
s
|
|
1533
1885
|
);
|
|
1534
|
-
(
|
|
1886
|
+
(I || g > x) && (l = b);
|
|
1535
1887
|
}
|
|
1536
|
-
const
|
|
1537
|
-
let
|
|
1538
|
-
switch (
|
|
1888
|
+
const h = t.left + t.width / 2, o = t.top + t.height / 2;
|
|
1889
|
+
let f = 0, v = 0;
|
|
1890
|
+
switch (l) {
|
|
1539
1891
|
case "top":
|
|
1540
1892
|
case "bottom":
|
|
1541
|
-
|
|
1893
|
+
f = r === "start" ? t.left : r === "end" ? t.right - e.width : h - e.width / 2, v = l === "top" ? t.top - e.height - i : t.bottom + i;
|
|
1542
1894
|
break;
|
|
1543
1895
|
case "left":
|
|
1544
1896
|
case "right":
|
|
1545
|
-
|
|
1897
|
+
f = l === "left" ? t.left - e.width - i : t.right + i, v = r === "start" ? t.top : r === "end" ? t.bottom - e.height : o - e.height / 2;
|
|
1546
1898
|
break;
|
|
1547
1899
|
}
|
|
1548
|
-
a && (
|
|
1549
|
-
|
|
1900
|
+
a && (f = ie(
|
|
1901
|
+
f,
|
|
1550
1902
|
s,
|
|
1551
|
-
|
|
1552
|
-
),
|
|
1553
|
-
|
|
1903
|
+
d - e.width - s
|
|
1904
|
+
), v = ie(
|
|
1905
|
+
v,
|
|
1554
1906
|
s,
|
|
1555
1907
|
p - e.height - s
|
|
1556
1908
|
));
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
Math.max(
|
|
1561
|
-
) :
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
Math.max(
|
|
1909
|
+
const m = 10, k = l === "top" || l === "bottom" ? ie(
|
|
1910
|
+
h - f,
|
|
1911
|
+
m,
|
|
1912
|
+
Math.max(m, e.width - m)
|
|
1913
|
+
) : ie(
|
|
1914
|
+
o - v,
|
|
1915
|
+
m,
|
|
1916
|
+
Math.max(m, e.height - m)
|
|
1565
1917
|
);
|
|
1566
|
-
return { x:
|
|
1918
|
+
return { x: f, y: v, side: l, arrowOffset: k };
|
|
1567
1919
|
}
|
|
1568
|
-
function
|
|
1920
|
+
function nt(t, e, {
|
|
1569
1921
|
side: n,
|
|
1570
|
-
align:
|
|
1922
|
+
align: r,
|
|
1571
1923
|
sideOffset: i,
|
|
1572
1924
|
collisionPadding: s,
|
|
1573
1925
|
avoidCollisions: a
|
|
1574
1926
|
}) {
|
|
1575
|
-
const [
|
|
1576
|
-
return
|
|
1577
|
-
const
|
|
1578
|
-
if (!
|
|
1927
|
+
const [d, p] = S(null);
|
|
1928
|
+
return se(() => {
|
|
1929
|
+
const l = e.current;
|
|
1930
|
+
if (!l || !t)
|
|
1579
1931
|
return;
|
|
1580
|
-
const
|
|
1581
|
-
const
|
|
1932
|
+
const h = () => {
|
|
1933
|
+
const f = t.getBoundingClientRect(), v = l.getBoundingClientRect();
|
|
1582
1934
|
p(
|
|
1583
|
-
|
|
1584
|
-
trigger:
|
|
1585
|
-
tooltip:
|
|
1935
|
+
zt({
|
|
1936
|
+
trigger: f,
|
|
1937
|
+
tooltip: v,
|
|
1586
1938
|
side: n,
|
|
1587
|
-
align:
|
|
1939
|
+
align: r,
|
|
1588
1940
|
sideOffset: i,
|
|
1589
1941
|
collisionPadding: s,
|
|
1590
1942
|
avoidCollisions: a,
|
|
@@ -1593,38 +1945,38 @@ function Xe(t, e, {
|
|
|
1593
1945
|
})
|
|
1594
1946
|
);
|
|
1595
1947
|
};
|
|
1596
|
-
|
|
1597
|
-
const
|
|
1598
|
-
return
|
|
1599
|
-
window.removeEventListener("resize",
|
|
1948
|
+
h(), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0);
|
|
1949
|
+
const o = typeof ResizeObserver > "u" ? null : new ResizeObserver(h);
|
|
1950
|
+
return o?.observe(t), o?.observe(l), () => {
|
|
1951
|
+
window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0), o?.disconnect();
|
|
1600
1952
|
};
|
|
1601
1953
|
}, [
|
|
1602
|
-
|
|
1954
|
+
r,
|
|
1603
1955
|
a,
|
|
1604
1956
|
s,
|
|
1605
1957
|
e,
|
|
1606
1958
|
n,
|
|
1607
1959
|
i,
|
|
1608
1960
|
t
|
|
1609
|
-
]),
|
|
1961
|
+
]), d;
|
|
1610
1962
|
}
|
|
1611
|
-
function
|
|
1612
|
-
|
|
1613
|
-
const
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1963
|
+
function ot(t, e, n) {
|
|
1964
|
+
H(() => {
|
|
1965
|
+
const r = (a) => {
|
|
1966
|
+
const d = a.target;
|
|
1967
|
+
d instanceof Node && (t.contains(d) || e.current?.contains(d) || n());
|
|
1616
1968
|
}, i = () => {
|
|
1617
1969
|
document.visibilityState === "hidden" && n();
|
|
1618
1970
|
}, s = (a) => {
|
|
1619
|
-
const
|
|
1620
|
-
a.key !== "Escape" ||
|
|
1971
|
+
const d = a.target;
|
|
1972
|
+
a.key !== "Escape" || d instanceof Node && t.contains(d) || n();
|
|
1621
1973
|
};
|
|
1622
|
-
return document.addEventListener("pointerdown",
|
|
1623
|
-
document.removeEventListener("pointerdown",
|
|
1974
|
+
return document.addEventListener("pointerdown", r, !0), document.addEventListener("visibilitychange", i), document.addEventListener("keydown", s, !0), window.addEventListener("blur", n), () => {
|
|
1975
|
+
document.removeEventListener("pointerdown", r, !0), document.removeEventListener("visibilitychange", i), document.removeEventListener("keydown", s, !0), window.removeEventListener("blur", n);
|
|
1624
1976
|
};
|
|
1625
1977
|
}, [n, e, t]);
|
|
1626
1978
|
}
|
|
1627
|
-
function
|
|
1979
|
+
function rt(t) {
|
|
1628
1980
|
switch (t) {
|
|
1629
1981
|
case "top":
|
|
1630
1982
|
return "center bottom";
|
|
@@ -1638,83 +1990,83 @@ function Ye(t) {
|
|
|
1638
1990
|
return "center";
|
|
1639
1991
|
}
|
|
1640
1992
|
}
|
|
1641
|
-
function
|
|
1993
|
+
function Kt({
|
|
1642
1994
|
contentId: t,
|
|
1643
1995
|
triggerElement: e,
|
|
1644
1996
|
dismiss: n,
|
|
1645
|
-
children:
|
|
1997
|
+
children: r,
|
|
1646
1998
|
className: i,
|
|
1647
1999
|
style: s,
|
|
1648
2000
|
side: a = "top",
|
|
1649
|
-
align:
|
|
2001
|
+
align: d = "center",
|
|
1650
2002
|
sideOffset: p = 8,
|
|
1651
|
-
collisionPadding:
|
|
1652
|
-
avoidCollisions:
|
|
1653
|
-
...
|
|
2003
|
+
collisionPadding: l = 8,
|
|
2004
|
+
avoidCollisions: h = !0,
|
|
2005
|
+
...o
|
|
1654
2006
|
}) {
|
|
1655
|
-
const
|
|
2007
|
+
const f = $(null), v = U() ?? !1, m = ce(), k = nt(e, f, {
|
|
1656
2008
|
side: a,
|
|
1657
|
-
align:
|
|
2009
|
+
align: d,
|
|
1658
2010
|
sideOffset: p,
|
|
1659
|
-
collisionPadding:
|
|
1660
|
-
avoidCollisions:
|
|
2011
|
+
collisionPadding: l,
|
|
2012
|
+
avoidCollisions: h
|
|
1661
2013
|
});
|
|
1662
|
-
|
|
1663
|
-
const
|
|
2014
|
+
ot(e, f, n);
|
|
2015
|
+
const b = rt(k?.side ?? a), I = {
|
|
1664
2016
|
...s,
|
|
1665
|
-
left:
|
|
1666
|
-
top:
|
|
1667
|
-
visibility:
|
|
2017
|
+
left: k ? `${k.x}px` : 0,
|
|
2018
|
+
top: k ? `${k.y}px` : 0,
|
|
2019
|
+
visibility: k ? "visible" : "hidden"
|
|
1668
2020
|
};
|
|
1669
|
-
return /* @__PURE__ */
|
|
2021
|
+
return /* @__PURE__ */ c(
|
|
1670
2022
|
"div",
|
|
1671
2023
|
{
|
|
1672
|
-
...
|
|
1673
|
-
ref:
|
|
2024
|
+
...o,
|
|
2025
|
+
ref: f,
|
|
1674
2026
|
id: t,
|
|
1675
2027
|
role: "tooltip",
|
|
1676
|
-
"data-side":
|
|
1677
|
-
"data-align":
|
|
1678
|
-
"data-state":
|
|
1679
|
-
"aria-hidden":
|
|
1680
|
-
className:
|
|
1681
|
-
style:
|
|
1682
|
-
children: /* @__PURE__ */
|
|
1683
|
-
|
|
2028
|
+
"data-side": k?.side ?? a,
|
|
2029
|
+
"data-align": d,
|
|
2030
|
+
"data-state": m ? "open" : "closed",
|
|
2031
|
+
"aria-hidden": m ? void 0 : !0,
|
|
2032
|
+
className: L("uk-tooltip", i),
|
|
2033
|
+
style: I,
|
|
2034
|
+
children: /* @__PURE__ */ D(
|
|
2035
|
+
O.div,
|
|
1684
2036
|
{
|
|
1685
2037
|
className: "uk-tooltip__surface",
|
|
1686
|
-
style: { transformOrigin:
|
|
1687
|
-
initial:
|
|
2038
|
+
style: { transformOrigin: b },
|
|
2039
|
+
initial: v ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
|
|
1688
2040
|
animate: { opacity: 1, scale: 1 },
|
|
1689
|
-
exit:
|
|
1690
|
-
transition:
|
|
2041
|
+
exit: v ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
|
|
2042
|
+
transition: v ? Y : Pe,
|
|
1691
2043
|
children: [
|
|
1692
|
-
/* @__PURE__ */
|
|
2044
|
+
/* @__PURE__ */ c(
|
|
1693
2045
|
"span",
|
|
1694
2046
|
{
|
|
1695
2047
|
className: "uk-tooltip__arrow",
|
|
1696
2048
|
"aria-hidden": "true",
|
|
1697
2049
|
style: {
|
|
1698
|
-
"--uk-tooltip-arrow-offset": `${
|
|
2050
|
+
"--uk-tooltip-arrow-offset": `${k?.arrowOffset ?? 0}px`
|
|
1699
2051
|
}
|
|
1700
2052
|
}
|
|
1701
2053
|
),
|
|
1702
|
-
|
|
2054
|
+
r
|
|
1703
2055
|
]
|
|
1704
2056
|
}
|
|
1705
2057
|
)
|
|
1706
2058
|
}
|
|
1707
2059
|
);
|
|
1708
2060
|
}
|
|
1709
|
-
function
|
|
1710
|
-
const e =
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
2061
|
+
function Ft(t) {
|
|
2062
|
+
const e = Ze("Tooltip.Content"), r = ae(
|
|
2063
|
+
Ye,
|
|
2064
|
+
Je,
|
|
2065
|
+
Qe
|
|
1714
2066
|
) && e.triggerElement ? e.triggerElement.closest("dialog") ?? document.body : null;
|
|
1715
|
-
return !
|
|
1716
|
-
/* @__PURE__ */
|
|
1717
|
-
|
|
2067
|
+
return !r || !e.triggerElement ? null : le(
|
|
2068
|
+
/* @__PURE__ */ c(me, { reducedMotion: "user", children: /* @__PURE__ */ c(z, { children: e.open ? /* @__PURE__ */ c(
|
|
2069
|
+
Kt,
|
|
1718
2070
|
{
|
|
1719
2071
|
contentId: e.contentId,
|
|
1720
2072
|
triggerElement: e.triggerElement,
|
|
@@ -1723,86 +2075,86 @@ function Mt(t) {
|
|
|
1723
2075
|
},
|
|
1724
2076
|
"uk-tooltip"
|
|
1725
2077
|
) : null }) }),
|
|
1726
|
-
|
|
2078
|
+
r
|
|
1727
2079
|
);
|
|
1728
2080
|
}
|
|
1729
|
-
const
|
|
2081
|
+
const it = Z(
|
|
1730
2082
|
null
|
|
1731
2083
|
);
|
|
1732
|
-
function
|
|
1733
|
-
const e =
|
|
2084
|
+
function qt(t) {
|
|
2085
|
+
const e = ee(it);
|
|
1734
2086
|
if (!e)
|
|
1735
2087
|
throw new Error(`<${t}> must be rendered inside <Tooltip.Group>`);
|
|
1736
2088
|
return e;
|
|
1737
2089
|
}
|
|
1738
|
-
function
|
|
2090
|
+
function jt({
|
|
1739
2091
|
activeValue: t,
|
|
1740
2092
|
content: e,
|
|
1741
2093
|
contentClassName: n,
|
|
1742
|
-
contentId:
|
|
2094
|
+
contentId: r,
|
|
1743
2095
|
dismiss: i,
|
|
1744
2096
|
triggerElement: s,
|
|
1745
2097
|
side: a,
|
|
1746
|
-
align:
|
|
2098
|
+
align: d,
|
|
1747
2099
|
sideOffset: p,
|
|
1748
|
-
collisionPadding:
|
|
1749
|
-
avoidCollisions:
|
|
2100
|
+
collisionPadding: l,
|
|
2101
|
+
avoidCollisions: h
|
|
1750
2102
|
}) {
|
|
1751
|
-
const
|
|
2103
|
+
const o = $(null), f = U() ?? !1, v = ce(), m = nt(s, o, {
|
|
1752
2104
|
side: a,
|
|
1753
|
-
align:
|
|
2105
|
+
align: d,
|
|
1754
2106
|
sideOffset: p,
|
|
1755
|
-
collisionPadding:
|
|
1756
|
-
avoidCollisions:
|
|
2107
|
+
collisionPadding: l,
|
|
2108
|
+
avoidCollisions: h
|
|
1757
2109
|
});
|
|
1758
|
-
|
|
1759
|
-
const
|
|
1760
|
-
left:
|
|
1761
|
-
top:
|
|
1762
|
-
transformOrigin:
|
|
1763
|
-
visibility:
|
|
2110
|
+
ot(s, o, i);
|
|
2111
|
+
const k = {
|
|
2112
|
+
left: m ? `${m.x}px` : 0,
|
|
2113
|
+
top: m ? `${m.y}px` : 0,
|
|
2114
|
+
transformOrigin: rt(m?.side ?? a),
|
|
2115
|
+
visibility: m ? "visible" : "hidden"
|
|
1764
2116
|
};
|
|
1765
|
-
return /* @__PURE__ */
|
|
1766
|
-
|
|
2117
|
+
return /* @__PURE__ */ D(
|
|
2118
|
+
O.div,
|
|
1767
2119
|
{
|
|
1768
|
-
ref:
|
|
1769
|
-
id:
|
|
2120
|
+
ref: o,
|
|
2121
|
+
id: r,
|
|
1770
2122
|
role: "tooltip",
|
|
1771
|
-
layout: !
|
|
2123
|
+
layout: !f,
|
|
1772
2124
|
layoutDependency: t,
|
|
1773
|
-
"data-side":
|
|
1774
|
-
"data-align":
|
|
1775
|
-
"data-state":
|
|
1776
|
-
"aria-hidden":
|
|
1777
|
-
className:
|
|
2125
|
+
"data-side": m?.side ?? a,
|
|
2126
|
+
"data-align": d,
|
|
2127
|
+
"data-state": v ? "open" : "closed",
|
|
2128
|
+
"aria-hidden": v ? void 0 : !0,
|
|
2129
|
+
className: L(
|
|
1778
2130
|
"uk-tooltip",
|
|
1779
2131
|
"uk-tooltip__surface",
|
|
1780
2132
|
"uk-tooltip--group",
|
|
1781
2133
|
n
|
|
1782
2134
|
),
|
|
1783
|
-
style:
|
|
1784
|
-
initial:
|
|
2135
|
+
style: k,
|
|
2136
|
+
initial: f ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
|
|
1785
2137
|
animate: { opacity: 1, scale: 1 },
|
|
1786
|
-
exit:
|
|
1787
|
-
transition:
|
|
2138
|
+
exit: f ? { opacity: 0 } : { opacity: 0, scale: 0.96 },
|
|
2139
|
+
transition: f ? { ...Y, layout: { duration: 0 } } : ft,
|
|
1788
2140
|
children: [
|
|
1789
|
-
/* @__PURE__ */
|
|
2141
|
+
/* @__PURE__ */ c(
|
|
1790
2142
|
"span",
|
|
1791
2143
|
{
|
|
1792
2144
|
className: "uk-tooltip__arrow",
|
|
1793
2145
|
"aria-hidden": "true",
|
|
1794
2146
|
style: {
|
|
1795
|
-
"--uk-tooltip-arrow-offset": `${
|
|
2147
|
+
"--uk-tooltip-arrow-offset": `${m?.arrowOffset ?? 0}px`
|
|
1796
2148
|
}
|
|
1797
2149
|
}
|
|
1798
2150
|
),
|
|
1799
|
-
/* @__PURE__ */
|
|
1800
|
-
|
|
2151
|
+
/* @__PURE__ */ c(
|
|
2152
|
+
O.div,
|
|
1801
2153
|
{
|
|
1802
2154
|
className: "uk-tooltip__content",
|
|
1803
2155
|
initial: { opacity: 0 },
|
|
1804
2156
|
animate: { opacity: 1 },
|
|
1805
|
-
transition:
|
|
2157
|
+
transition: f ? Y : Pe,
|
|
1806
2158
|
children: e
|
|
1807
2159
|
},
|
|
1808
2160
|
t
|
|
@@ -1811,175 +2163,175 @@ function Bt({
|
|
|
1811
2163
|
}
|
|
1812
2164
|
);
|
|
1813
2165
|
}
|
|
1814
|
-
function
|
|
2166
|
+
function Gt({
|
|
1815
2167
|
children: t,
|
|
1816
2168
|
side: e = "top",
|
|
1817
2169
|
align: n = "center",
|
|
1818
|
-
sideOffset:
|
|
2170
|
+
sideOffset: r = 8,
|
|
1819
2171
|
collisionPadding: i = 8,
|
|
1820
2172
|
avoidCollisions: s = !0,
|
|
1821
2173
|
delayDuration: a = 180,
|
|
1822
|
-
closeDelay:
|
|
2174
|
+
closeDelay: d = 80,
|
|
1823
2175
|
contentClassName: p
|
|
1824
2176
|
}) {
|
|
1825
|
-
const
|
|
2177
|
+
const l = V(), [h, o] = S(
|
|
1826
2178
|
() => /* @__PURE__ */ new Map()
|
|
1827
|
-
), [
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
),
|
|
1832
|
-
|
|
1833
|
-
}, []),
|
|
1834
|
-
|
|
1835
|
-
}, []),
|
|
1836
|
-
if (
|
|
1837
|
-
if (
|
|
1838
|
-
|
|
2179
|
+
), [f, v] = S(!1), [m, k] = S(null), b = $(null), I = $(null), x = ae(
|
|
2180
|
+
Ye,
|
|
2181
|
+
Je,
|
|
2182
|
+
Qe
|
|
2183
|
+
), g = j(() => {
|
|
2184
|
+
b.current !== null && (clearTimeout(b.current), b.current = null);
|
|
2185
|
+
}, []), u = j(() => {
|
|
2186
|
+
I.current !== null && (clearTimeout(I.current), I.current = null);
|
|
2187
|
+
}, []), _ = M((K, B = !1) => {
|
|
2188
|
+
if (g(), u(), k(K), !f) {
|
|
2189
|
+
if (B || a <= 0) {
|
|
2190
|
+
v(!0);
|
|
1839
2191
|
return;
|
|
1840
2192
|
}
|
|
1841
|
-
|
|
1842
|
-
|
|
2193
|
+
b.current = setTimeout(() => {
|
|
2194
|
+
b.current = null, v(!0);
|
|
1843
2195
|
}, a);
|
|
1844
2196
|
}
|
|
1845
|
-
}),
|
|
1846
|
-
if (
|
|
1847
|
-
if (
|
|
1848
|
-
|
|
2197
|
+
}), C = M(() => {
|
|
2198
|
+
if (g(), u(), !!f) {
|
|
2199
|
+
if (d <= 0) {
|
|
2200
|
+
v(!1);
|
|
1849
2201
|
return;
|
|
1850
2202
|
}
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
},
|
|
2203
|
+
I.current = setTimeout(() => {
|
|
2204
|
+
I.current = null, v(!1);
|
|
2205
|
+
}, d);
|
|
1854
2206
|
}
|
|
1855
|
-
}),
|
|
1856
|
-
|
|
1857
|
-
}),
|
|
1858
|
-
(K,
|
|
1859
|
-
|
|
1860
|
-
const
|
|
1861
|
-
if (
|
|
1862
|
-
return
|
|
1863
|
-
const
|
|
1864
|
-
return
|
|
2207
|
+
}), y = M(() => {
|
|
2208
|
+
g(), u(), v(!1);
|
|
2209
|
+
}), w = M(
|
|
2210
|
+
(K, B, G) => {
|
|
2211
|
+
o((X) => {
|
|
2212
|
+
const F = X.get(K);
|
|
2213
|
+
if (F?.triggerElement === B && Object.is(F.content, G))
|
|
2214
|
+
return X;
|
|
2215
|
+
const ve = new Map(X);
|
|
2216
|
+
return ve.set(K, { triggerElement: B, content: G }), ve;
|
|
1865
2217
|
});
|
|
1866
2218
|
}
|
|
1867
|
-
),
|
|
1868
|
-
|
|
1869
|
-
if (!
|
|
1870
|
-
return
|
|
1871
|
-
const
|
|
1872
|
-
return
|
|
2219
|
+
), T = M((K) => {
|
|
2220
|
+
o((B) => {
|
|
2221
|
+
if (!B.has(K))
|
|
2222
|
+
return B;
|
|
2223
|
+
const G = new Map(B);
|
|
2224
|
+
return G.delete(K), G;
|
|
1873
2225
|
});
|
|
1874
2226
|
});
|
|
1875
|
-
|
|
2227
|
+
H(
|
|
1876
2228
|
() => () => {
|
|
1877
|
-
|
|
2229
|
+
g(), u();
|
|
1878
2230
|
},
|
|
1879
|
-
[
|
|
2231
|
+
[u, g]
|
|
1880
2232
|
);
|
|
1881
|
-
const
|
|
2233
|
+
const E = W(
|
|
1882
2234
|
() => ({
|
|
1883
|
-
open:
|
|
1884
|
-
activeValue:
|
|
1885
|
-
contentId:
|
|
1886
|
-
activate:
|
|
1887
|
-
requestClose:
|
|
1888
|
-
dismiss:
|
|
1889
|
-
register:
|
|
1890
|
-
unregister:
|
|
2235
|
+
open: f,
|
|
2236
|
+
activeValue: m,
|
|
2237
|
+
contentId: l,
|
|
2238
|
+
activate: _,
|
|
2239
|
+
requestClose: C,
|
|
2240
|
+
dismiss: y,
|
|
2241
|
+
register: w,
|
|
2242
|
+
unregister: T
|
|
1891
2243
|
}),
|
|
1892
2244
|
[
|
|
1893
|
-
T,
|
|
1894
|
-
f,
|
|
1895
|
-
c,
|
|
1896
2245
|
_,
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
2246
|
+
m,
|
|
2247
|
+
l,
|
|
2248
|
+
y,
|
|
2249
|
+
f,
|
|
2250
|
+
w,
|
|
2251
|
+
C,
|
|
2252
|
+
T
|
|
1901
2253
|
]
|
|
1902
|
-
),
|
|
1903
|
-
return /* @__PURE__ */
|
|
2254
|
+
), N = m ? h.get(m) : void 0, P = f && !!N, R = x && N ? N.triggerElement.closest("dialog") ?? document.body : null;
|
|
2255
|
+
return /* @__PURE__ */ D(it.Provider, { value: E, children: [
|
|
1904
2256
|
t,
|
|
1905
|
-
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
|
|
2257
|
+
R && N ? le(
|
|
2258
|
+
/* @__PURE__ */ c(me, { reducedMotion: "user", children: /* @__PURE__ */ c(z, { children: P ? /* @__PURE__ */ c(
|
|
2259
|
+
jt,
|
|
1908
2260
|
{
|
|
1909
|
-
activeValue:
|
|
1910
|
-
content:
|
|
2261
|
+
activeValue: m ?? "",
|
|
2262
|
+
content: N.content,
|
|
1911
2263
|
contentClassName: p,
|
|
1912
|
-
contentId:
|
|
1913
|
-
dismiss:
|
|
1914
|
-
triggerElement:
|
|
2264
|
+
contentId: l,
|
|
2265
|
+
dismiss: y,
|
|
2266
|
+
triggerElement: N.triggerElement,
|
|
1915
2267
|
side: e,
|
|
1916
2268
|
align: n,
|
|
1917
|
-
sideOffset:
|
|
2269
|
+
sideOffset: r,
|
|
1918
2270
|
collisionPadding: i,
|
|
1919
2271
|
avoidCollisions: s
|
|
1920
2272
|
},
|
|
1921
2273
|
"uk-tooltip-group"
|
|
1922
2274
|
) : null }) }),
|
|
1923
|
-
|
|
2275
|
+
R
|
|
1924
2276
|
) : null
|
|
1925
2277
|
] });
|
|
1926
2278
|
}
|
|
1927
|
-
function
|
|
2279
|
+
function Ut({
|
|
1928
2280
|
value: t,
|
|
1929
2281
|
content: e,
|
|
1930
2282
|
children: n
|
|
1931
2283
|
}) {
|
|
1932
|
-
const
|
|
2284
|
+
const r = qt("Tooltip.Item"), { register: i, unregister: s } = r, [a, d] = S(
|
|
1933
2285
|
null
|
|
1934
2286
|
);
|
|
1935
|
-
if (!
|
|
2287
|
+
if (!te(n))
|
|
1936
2288
|
throw new Error("<Tooltip.Item> expects a single valid React element");
|
|
1937
|
-
const p = n,
|
|
1938
|
-
(
|
|
1939
|
-
|
|
2289
|
+
const p = n, l = p.props, h = l.ref ?? p.ref, o = l.onPointerEnter, f = l.onPointerLeave, v = l.onFocus, m = l.onBlur, k = l.onKeyDown, b = r.open && r.activeValue === t, I = j(
|
|
2290
|
+
(x) => {
|
|
2291
|
+
et(h, x), d(x);
|
|
1940
2292
|
},
|
|
1941
|
-
[
|
|
2293
|
+
[h, d]
|
|
1942
2294
|
);
|
|
1943
|
-
return
|
|
2295
|
+
return se(() => {
|
|
1944
2296
|
if (a)
|
|
1945
2297
|
return i(t, a, e), () => s(t);
|
|
1946
|
-
}, [e, i, a, s, t]),
|
|
1947
|
-
ref:
|
|
1948
|
-
"aria-describedby":
|
|
1949
|
-
onPointerEnter:
|
|
1950
|
-
|
|
2298
|
+
}, [e, i, a, s, t]), ne(p, {
|
|
2299
|
+
ref: I,
|
|
2300
|
+
"aria-describedby": b ? tt(l["aria-describedby"], r.contentId) : l["aria-describedby"],
|
|
2301
|
+
onPointerEnter: q(o, (x) => {
|
|
2302
|
+
r.activate(t, x.pointerType === "touch");
|
|
1951
2303
|
}),
|
|
1952
|
-
onPointerLeave:
|
|
1953
|
-
|
|
2304
|
+
onPointerLeave: q(f, (x) => {
|
|
2305
|
+
x.pointerType !== "touch" && r.requestClose();
|
|
1954
2306
|
}),
|
|
1955
|
-
onFocus:
|
|
1956
|
-
|
|
2307
|
+
onFocus: q(v, () => {
|
|
2308
|
+
r.activate(t);
|
|
1957
2309
|
}),
|
|
1958
|
-
onBlur:
|
|
1959
|
-
|
|
2310
|
+
onBlur: q(m, () => {
|
|
2311
|
+
r.requestClose();
|
|
1960
2312
|
}),
|
|
1961
|
-
onKeyDown:
|
|
1962
|
-
|
|
2313
|
+
onKeyDown: q(k, (x) => {
|
|
2314
|
+
x.key === "Escape" && b && (x.preventDefault(), x.stopPropagation(), r.dismiss());
|
|
1963
2315
|
})
|
|
1964
2316
|
});
|
|
1965
2317
|
}
|
|
1966
|
-
const
|
|
1967
|
-
Root:
|
|
1968
|
-
Trigger:
|
|
1969
|
-
Content:
|
|
1970
|
-
Group:
|
|
1971
|
-
Item:
|
|
2318
|
+
const sn = {
|
|
2319
|
+
Root: Bt,
|
|
2320
|
+
Trigger: Vt,
|
|
2321
|
+
Content: Ft,
|
|
2322
|
+
Group: Gt,
|
|
2323
|
+
Item: Ut
|
|
1972
2324
|
};
|
|
1973
2325
|
export {
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
2326
|
+
Ne as Button,
|
|
2327
|
+
dt as CheckBox,
|
|
2328
|
+
rn as Dialog,
|
|
2329
|
+
en as Input,
|
|
2330
|
+
an as Marquee,
|
|
2331
|
+
Zt as Select,
|
|
2332
|
+
nn as Sidebar,
|
|
2333
|
+
tn as Switch,
|
|
2334
|
+
on as Tabs,
|
|
2335
|
+
sn as Tooltip
|
|
1984
2336
|
};
|
|
1985
2337
|
//# sourceMappingURL=index.js.map
|