asterui 0.12.43 → 0.12.44
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/components/ContextMenu.d.ts +4 -4
- package/dist/components/ContextMenu.js +96 -89
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/Dropdown.d.ts +7 -6
- package/dist/components/Dropdown.js +192 -186
- package/dist/components/Dropdown.js.map +1 -1
- package/dist/components/Menu.d.ts +7 -5
- package/dist/components/Menu.js +106 -99
- package/dist/components/Menu.js.map +1 -1
- package/dist/components/Tabs.d.ts +0 -2
- package/dist/components/Tabs.js +46 -43
- package/dist/components/Tabs.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { jsxs as B, Fragment as ie, jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { jsxs as B, Fragment as ie, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import y, { useId as q, useState as j, useRef as K, useCallback as R, useEffect as L, createContext as ue, useContext as de } from "react";
|
|
3
|
+
const G = ue(void 0);
|
|
4
4
|
function V() {
|
|
5
|
-
const
|
|
6
|
-
if (!
|
|
5
|
+
const a = de(G);
|
|
6
|
+
if (!a)
|
|
7
7
|
throw new Error("Dropdown compound components must be used within Dropdown");
|
|
8
|
-
return
|
|
8
|
+
return a;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
children:
|
|
12
|
-
items:
|
|
13
|
-
hover:
|
|
14
|
-
trigger:
|
|
15
|
-
position:
|
|
16
|
-
align:
|
|
17
|
-
open:
|
|
18
|
-
onOpenChange:
|
|
19
|
-
disabled:
|
|
20
|
-
arrow:
|
|
21
|
-
mouseEnterDelay:
|
|
10
|
+
function fe({
|
|
11
|
+
children: a,
|
|
12
|
+
items: l,
|
|
13
|
+
hover: I = !1,
|
|
14
|
+
trigger: f = ["click"],
|
|
15
|
+
position: p = "bottom",
|
|
16
|
+
align: o = "start",
|
|
17
|
+
open: s,
|
|
18
|
+
onOpenChange: t,
|
|
19
|
+
disabled: m = !1,
|
|
20
|
+
arrow: b = !1,
|
|
21
|
+
mouseEnterDelay: w = 0.15,
|
|
22
22
|
mouseLeaveDelay: c = 0.1,
|
|
23
|
-
getPopupContainer:
|
|
24
|
-
destroyOnHidden:
|
|
23
|
+
getPopupContainer: h,
|
|
24
|
+
destroyOnHidden: r = !1,
|
|
25
25
|
className: k = "",
|
|
26
26
|
...S
|
|
27
27
|
}) {
|
|
28
|
-
const U = q(), v = q(), [e,
|
|
29
|
-
|
|
30
|
-
}, [
|
|
28
|
+
const U = q(), v = q(), [e, D] = j(!1), [i, x] = j(-1), [T, P] = j(0), [Y, z] = j(!r), W = K(/* @__PURE__ */ new Map()), $ = K(null), C = K(null), M = I ? ["hover"] : f, F = s !== void 0, A = F ? s : e, g = R((n, E = "trigger") => {
|
|
29
|
+
m || (F || D(n), n && z(!0), t?.(n, { source: E }));
|
|
30
|
+
}, [m, F, t]), Z = R(() => {
|
|
31
31
|
g(!1, "menu"), x(-1), document.getElementById(v)?.focus();
|
|
32
|
-
}, [g, v]), H = R((
|
|
33
|
-
E ? W.current.set(
|
|
32
|
+
}, [g, v]), H = R((n, E, u) => {
|
|
33
|
+
E ? W.current.set(n, { ref: E, disabled: u }) : W.current.delete(n);
|
|
34
34
|
}, []);
|
|
35
35
|
L(() => {
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
return () => clearTimeout(
|
|
36
|
+
if (r && !A) {
|
|
37
|
+
const n = setTimeout(() => z(!1), 300);
|
|
38
|
+
return () => clearTimeout(n);
|
|
39
39
|
}
|
|
40
|
-
}, [A,
|
|
41
|
-
const
|
|
40
|
+
}, [A, r]), L(() => {
|
|
41
|
+
const n = (E) => {
|
|
42
42
|
$.current && !$.current.contains(E.target) && (g(!1, "trigger"), x(-1));
|
|
43
43
|
};
|
|
44
44
|
if (A)
|
|
45
|
-
return document.addEventListener("mousedown",
|
|
45
|
+
return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
|
|
46
46
|
}, [A, g]);
|
|
47
47
|
const ee = R(() => {
|
|
48
48
|
M.includes("hover") && (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
|
|
49
49
|
g(!0, "trigger");
|
|
50
|
-
},
|
|
51
|
-
}, [M,
|
|
50
|
+
}, w * 1e3));
|
|
51
|
+
}, [M, w, g]), ne = R(() => {
|
|
52
52
|
M.includes("hover") && (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
|
|
53
53
|
g(!1, "trigger"), x(-1);
|
|
54
54
|
}, c * 1e3));
|
|
55
|
-
}, [M, c, g]), te = R((
|
|
56
|
-
M.includes("contextMenu") && (
|
|
55
|
+
}, [M, c, g]), te = R((n) => {
|
|
56
|
+
M.includes("contextMenu") && (n.preventDefault(), g(!0, "trigger"));
|
|
57
57
|
}, [M, g]);
|
|
58
58
|
L(() => () => {
|
|
59
59
|
C.current && clearTimeout(C.current);
|
|
@@ -67,82 +67,79 @@ function pe({
|
|
|
67
67
|
start: "",
|
|
68
68
|
center: "dropdown-center",
|
|
69
69
|
end: "dropdown-end"
|
|
70
|
-
}, se = typeof
|
|
70
|
+
}, se = typeof b == "boolean" ? b : !!b, ae = [
|
|
71
71
|
"dropdown",
|
|
72
|
-
re[
|
|
73
|
-
oe[
|
|
72
|
+
re[p],
|
|
73
|
+
oe[o],
|
|
74
74
|
M.includes("hover") && "dropdown-hover",
|
|
75
75
|
A && "dropdown-open",
|
|
76
76
|
k
|
|
77
|
-
].filter(Boolean).join(" "), le = () =>
|
|
78
|
-
if ("type" in
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
-
|
|
77
|
+
].filter(Boolean).join(" "), le = () => l ? l.map((n, E) => {
|
|
78
|
+
if ("type" in n && n.type === "divider")
|
|
79
|
+
return /* @__PURE__ */ d(X, {}, n.key || `divider-${E}`);
|
|
80
|
+
const u = n;
|
|
81
|
+
return u.children && u.children.length > 0 ? /* @__PURE__ */ d(
|
|
82
|
+
_,
|
|
83
83
|
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
children: a.children.map((K) => /* @__PURE__ */ i(
|
|
84
|
+
title: u.label,
|
|
85
|
+
icon: u.icon,
|
|
86
|
+
disabled: u.disabled,
|
|
87
|
+
children: u.children.map((N) => /* @__PURE__ */ d(
|
|
89
88
|
O,
|
|
90
89
|
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
children: K.label
|
|
90
|
+
icon: N.icon,
|
|
91
|
+
disabled: N.disabled,
|
|
92
|
+
danger: N.danger,
|
|
93
|
+
onClick: N.onClick,
|
|
94
|
+
children: N.label
|
|
97
95
|
},
|
|
98
|
-
|
|
96
|
+
N.key
|
|
99
97
|
))
|
|
100
98
|
},
|
|
101
|
-
|
|
102
|
-
) : /* @__PURE__ */
|
|
99
|
+
u.key
|
|
100
|
+
) : /* @__PURE__ */ d(
|
|
103
101
|
O,
|
|
104
102
|
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
children: a.label
|
|
103
|
+
icon: u.icon,
|
|
104
|
+
disabled: u.disabled,
|
|
105
|
+
danger: u.danger,
|
|
106
|
+
onClick: u.onClick,
|
|
107
|
+
children: u.label
|
|
111
108
|
},
|
|
112
|
-
|
|
109
|
+
u.key
|
|
113
110
|
);
|
|
114
|
-
}) : null, ce =
|
|
115
|
-
|
|
116
|
-
(
|
|
111
|
+
}) : null, ce = l ? /* @__PURE__ */ B(ie, { children: [
|
|
112
|
+
y.Children.toArray(a).find(
|
|
113
|
+
(n) => y.isValidElement(n) && n.type === J
|
|
117
114
|
),
|
|
118
|
-
(Y || !
|
|
119
|
-
] }) :
|
|
120
|
-
return /* @__PURE__ */
|
|
121
|
-
|
|
115
|
+
(Y || !r) && /* @__PURE__ */ d(Q, { children: le() })
|
|
116
|
+
] }) : a;
|
|
117
|
+
return /* @__PURE__ */ d(
|
|
118
|
+
G.Provider,
|
|
122
119
|
{
|
|
123
120
|
value: {
|
|
124
|
-
position:
|
|
125
|
-
align:
|
|
121
|
+
position: p,
|
|
122
|
+
align: o,
|
|
126
123
|
menuId: U,
|
|
127
124
|
triggerId: v,
|
|
128
125
|
isOpen: A,
|
|
129
126
|
setIsOpen: g,
|
|
130
|
-
focusedIndex:
|
|
127
|
+
focusedIndex: i,
|
|
131
128
|
setFocusedIndex: x,
|
|
132
129
|
registerItem: H,
|
|
133
130
|
itemCount: T,
|
|
134
131
|
setItemCount: P,
|
|
135
|
-
disabled:
|
|
132
|
+
disabled: m,
|
|
136
133
|
arrow: se,
|
|
137
134
|
closeDropdown: Z
|
|
138
135
|
},
|
|
139
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ d(
|
|
140
137
|
"div",
|
|
141
138
|
{
|
|
142
139
|
ref: $,
|
|
143
140
|
className: ae,
|
|
144
141
|
"data-state": A ? "open" : "closed",
|
|
145
|
-
"aria-disabled":
|
|
142
|
+
"aria-disabled": m || void 0,
|
|
146
143
|
onMouseEnter: ee,
|
|
147
144
|
onMouseLeave: ne,
|
|
148
145
|
onContextMenu: te,
|
|
@@ -153,70 +150,70 @@ function pe({
|
|
|
153
150
|
}
|
|
154
151
|
);
|
|
155
152
|
}
|
|
156
|
-
function
|
|
157
|
-
const { menuId:
|
|
158
|
-
switch (
|
|
153
|
+
function J({ children: a, className: l = "" }) {
|
|
154
|
+
const { menuId: I, triggerId: f, isOpen: p, setIsOpen: o, setFocusedIndex: s, itemCount: t, disabled: m } = V(), b = (r) => {
|
|
155
|
+
switch (r.key) {
|
|
159
156
|
case "Enter":
|
|
160
157
|
case " ":
|
|
161
158
|
case "ArrowDown":
|
|
162
|
-
|
|
159
|
+
r.preventDefault(), o(!0), s(0);
|
|
163
160
|
break;
|
|
164
161
|
case "ArrowUp":
|
|
165
|
-
|
|
162
|
+
r.preventDefault(), o(!0), s(t - 1);
|
|
166
163
|
break;
|
|
167
164
|
case "Escape":
|
|
168
|
-
|
|
165
|
+
r.preventDefault(), o(!1), s(-1);
|
|
169
166
|
break;
|
|
170
167
|
}
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
}, c =
|
|
174
|
-
return
|
|
175
|
-
id:
|
|
176
|
-
tabIndex:
|
|
168
|
+
}, w = () => {
|
|
169
|
+
o(!p), p || s(0);
|
|
170
|
+
}, c = y.Children.only(a), h = c.props;
|
|
171
|
+
return y.cloneElement(c, {
|
|
172
|
+
id: f,
|
|
173
|
+
tabIndex: m ? -1 : 0,
|
|
177
174
|
"aria-haspopup": "menu",
|
|
178
|
-
"aria-expanded":
|
|
179
|
-
"aria-controls":
|
|
180
|
-
onClick: (
|
|
181
|
-
|
|
175
|
+
"aria-expanded": p,
|
|
176
|
+
"aria-controls": I,
|
|
177
|
+
onClick: (r) => {
|
|
178
|
+
w(), h.onClick?.(r);
|
|
182
179
|
},
|
|
183
|
-
onKeyDown: (
|
|
184
|
-
|
|
180
|
+
onKeyDown: (r) => {
|
|
181
|
+
b(r), h.onKeyDown?.(r);
|
|
185
182
|
},
|
|
186
|
-
className: `${
|
|
183
|
+
className: `${h.className || ""} ${l}`.trim()
|
|
187
184
|
});
|
|
188
185
|
}
|
|
189
|
-
function
|
|
190
|
-
const { menuId:
|
|
191
|
-
(e) =>
|
|
186
|
+
function Q({ children: a, className: l = "" }) {
|
|
187
|
+
const { menuId: I, triggerId: f, isOpen: p, setIsOpen: o, focusedIndex: s, setFocusedIndex: t, setItemCount: m, arrow: b, position: w } = V(), c = K(null), h = y.Children.toArray(a).filter(
|
|
188
|
+
(e) => y.isValidElement(e) && e.type === O
|
|
192
189
|
);
|
|
193
190
|
L(() => {
|
|
194
|
-
|
|
195
|
-
}, [
|
|
196
|
-
|
|
197
|
-
}, [
|
|
198
|
-
const
|
|
199
|
-
const
|
|
200
|
-
(x) =>
|
|
191
|
+
m(h.length);
|
|
192
|
+
}, [h.length, m]), L(() => {
|
|
193
|
+
p && s >= 0 && c.current && c.current.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')[s]?.focus();
|
|
194
|
+
}, [p, s]);
|
|
195
|
+
const r = (e) => {
|
|
196
|
+
const i = h.filter(
|
|
197
|
+
(x) => y.isValidElement(x) && !x.props.disabled
|
|
201
198
|
).length;
|
|
202
199
|
switch (e.key) {
|
|
203
200
|
case "ArrowDown":
|
|
204
|
-
e.preventDefault(),
|
|
201
|
+
e.preventDefault(), t((s + 1) % i);
|
|
205
202
|
break;
|
|
206
203
|
case "ArrowUp":
|
|
207
|
-
e.preventDefault(),
|
|
204
|
+
e.preventDefault(), t((s - 1 + i) % i);
|
|
208
205
|
break;
|
|
209
206
|
case "Home":
|
|
210
|
-
e.preventDefault(),
|
|
207
|
+
e.preventDefault(), t(0);
|
|
211
208
|
break;
|
|
212
209
|
case "End":
|
|
213
|
-
e.preventDefault(),
|
|
210
|
+
e.preventDefault(), t(i - 1);
|
|
214
211
|
break;
|
|
215
212
|
case "Escape":
|
|
216
|
-
e.preventDefault(),
|
|
213
|
+
e.preventDefault(), o(!1), t(-1), document.getElementById(f)?.focus();
|
|
217
214
|
break;
|
|
218
215
|
case "Tab":
|
|
219
|
-
|
|
216
|
+
o(!1), t(-1);
|
|
220
217
|
break;
|
|
221
218
|
}
|
|
222
219
|
}, k = [
|
|
@@ -226,8 +223,17 @@ function J({ children: l, className: d = "" }) {
|
|
|
226
223
|
"rounded-box",
|
|
227
224
|
"z-50",
|
|
228
225
|
"shadow",
|
|
229
|
-
|
|
230
|
-
].filter(Boolean).join(" "), S =
|
|
226
|
+
l
|
|
227
|
+
].filter(Boolean).join(" "), S = y.Children.map(a, (e, D) => {
|
|
228
|
+
if (y.isValidElement(e)) {
|
|
229
|
+
const i = e.key != null ? String(e.key) : void 0;
|
|
230
|
+
if (e.type === O)
|
|
231
|
+
return y.cloneElement(e, { _index: D, _key: i });
|
|
232
|
+
if (e.type === _)
|
|
233
|
+
return y.cloneElement(e, { _key: i });
|
|
234
|
+
}
|
|
235
|
+
return e;
|
|
236
|
+
}), v = b ? /* @__PURE__ */ d(
|
|
231
237
|
"span",
|
|
232
238
|
{
|
|
233
239
|
className: `absolute w-0 h-0 border-8 border-solid ${{
|
|
@@ -235,7 +241,7 @@ function J({ children: l, className: d = "" }) {
|
|
|
235
241
|
bottom: "top-0 left-1/2 -translate-x-1/2 -translate-y-full border-b-base-100 border-l-transparent border-r-transparent border-t-transparent",
|
|
236
242
|
left: "right-0 top-1/2 -translate-y-1/2 translate-x-full border-l-base-100 border-t-transparent border-b-transparent border-r-transparent",
|
|
237
243
|
right: "left-0 top-1/2 -translate-y-1/2 -translate-x-full border-r-base-100 border-t-transparent border-b-transparent border-l-transparent"
|
|
238
|
-
}[
|
|
244
|
+
}[w || "bottom"]}`,
|
|
239
245
|
"aria-hidden": "true"
|
|
240
246
|
}
|
|
241
247
|
) : null;
|
|
@@ -243,12 +249,12 @@ function J({ children: l, className: d = "" }) {
|
|
|
243
249
|
"ul",
|
|
244
250
|
{
|
|
245
251
|
ref: c,
|
|
246
|
-
id:
|
|
252
|
+
id: I,
|
|
247
253
|
role: "menu",
|
|
248
|
-
"aria-labelledby":
|
|
254
|
+
"aria-labelledby": f,
|
|
249
255
|
tabIndex: -1,
|
|
250
|
-
className: `${k} ${
|
|
251
|
-
onKeyDown:
|
|
256
|
+
className: `${k} ${b ? "relative" : ""}`,
|
|
257
|
+
onKeyDown: r,
|
|
252
258
|
children: [
|
|
253
259
|
v,
|
|
254
260
|
S
|
|
@@ -257,142 +263,142 @@ function J({ children: l, className: d = "" }) {
|
|
|
257
263
|
);
|
|
258
264
|
}
|
|
259
265
|
function O({
|
|
260
|
-
children:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
266
|
+
children: a,
|
|
267
|
+
icon: l,
|
|
268
|
+
label: I,
|
|
269
|
+
onClick: f,
|
|
270
|
+
active: p = !1,
|
|
271
|
+
disabled: o = !1,
|
|
272
|
+
danger: s = !1,
|
|
273
|
+
className: t = "",
|
|
274
|
+
_key: m
|
|
269
275
|
}) {
|
|
270
|
-
const { closeDropdown:
|
|
271
|
-
|
|
276
|
+
const { closeDropdown: b } = V(), w = [p && "active", o && "disabled", t].filter(Boolean).join(" "), c = () => {
|
|
277
|
+
o || (f?.(), b());
|
|
272
278
|
};
|
|
273
|
-
return /* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ d("li", { className: w, role: "none", "data-key": m, children: /* @__PURE__ */ B(
|
|
274
280
|
"a",
|
|
275
281
|
{
|
|
276
282
|
role: "menuitem",
|
|
277
|
-
tabIndex:
|
|
278
|
-
"aria-disabled":
|
|
279
|
-
className:
|
|
283
|
+
tabIndex: o ? -1 : 0,
|
|
284
|
+
"aria-disabled": o || void 0,
|
|
285
|
+
className: s ? "text-error" : "",
|
|
280
286
|
onClick: c,
|
|
281
287
|
onKeyDown: (k) => {
|
|
282
|
-
(k.key === "Enter" || k.key === " ") && !
|
|
288
|
+
(k.key === "Enter" || k.key === " ") && !o && (k.preventDefault(), c());
|
|
283
289
|
},
|
|
284
290
|
children: [
|
|
285
|
-
|
|
286
|
-
|
|
291
|
+
l && /* @__PURE__ */ d("span", { className: "mr-2 inline-flex items-center", children: l }),
|
|
292
|
+
I || a
|
|
287
293
|
]
|
|
288
294
|
}
|
|
289
295
|
) });
|
|
290
296
|
}
|
|
291
|
-
function
|
|
292
|
-
children:
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
297
|
+
function _({
|
|
298
|
+
children: a,
|
|
299
|
+
title: l,
|
|
300
|
+
icon: I,
|
|
301
|
+
disabled: f = !1,
|
|
302
|
+
className: p = "",
|
|
303
|
+
_key: o
|
|
298
304
|
}) {
|
|
299
|
-
const [
|
|
300
|
-
|
|
301
|
-
},
|
|
302
|
-
|
|
305
|
+
const [s, t] = j(!1), m = K(null), b = K(null), w = K(null), c = q(), h = () => {
|
|
306
|
+
f || t(!0);
|
|
307
|
+
}, r = () => {
|
|
308
|
+
t(!1);
|
|
303
309
|
}, k = () => {
|
|
304
310
|
setTimeout(() => {
|
|
305
|
-
|
|
311
|
+
w.current?.querySelector('[role="menuitem"]:not([aria-disabled="true"])')?.focus();
|
|
306
312
|
}, 0);
|
|
307
313
|
}, S = (e) => {
|
|
308
|
-
if (!
|
|
314
|
+
if (!f)
|
|
309
315
|
switch (e.key) {
|
|
310
316
|
case "ArrowRight":
|
|
311
317
|
case "Enter":
|
|
312
318
|
case " ":
|
|
313
|
-
e.preventDefault(), e.stopPropagation(),
|
|
319
|
+
e.preventDefault(), e.stopPropagation(), t(!0), k();
|
|
314
320
|
break;
|
|
315
321
|
case "ArrowLeft":
|
|
316
322
|
case "Escape":
|
|
317
|
-
e.preventDefault(), e.stopPropagation(),
|
|
323
|
+
e.preventDefault(), e.stopPropagation(), t(!1);
|
|
318
324
|
break;
|
|
319
325
|
}
|
|
320
326
|
}, U = (e) => {
|
|
321
327
|
switch (e.key) {
|
|
322
328
|
case "ArrowLeft":
|
|
323
329
|
case "Escape":
|
|
324
|
-
e.preventDefault(), e.stopPropagation(),
|
|
330
|
+
e.preventDefault(), e.stopPropagation(), t(!1), b.current?.focus();
|
|
325
331
|
break;
|
|
326
332
|
case "ArrowDown":
|
|
327
333
|
e.preventDefault(), e.stopPropagation();
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
330
|
-
const T = (Array.from(
|
|
331
|
-
|
|
334
|
+
const D = w.current?.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');
|
|
335
|
+
if (D) {
|
|
336
|
+
const T = (Array.from(D).findIndex((P) => P === document.activeElement) + 1) % D.length;
|
|
337
|
+
D[T]?.focus();
|
|
332
338
|
}
|
|
333
339
|
break;
|
|
334
340
|
case "ArrowUp":
|
|
335
341
|
e.preventDefault(), e.stopPropagation();
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
338
|
-
const T = (Array.from(
|
|
339
|
-
|
|
342
|
+
const i = w.current?.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');
|
|
343
|
+
if (i) {
|
|
344
|
+
const T = (Array.from(i).findIndex((P) => P === document.activeElement) - 1 + i.length) % i.length;
|
|
345
|
+
i[T]?.focus();
|
|
340
346
|
}
|
|
341
347
|
break;
|
|
342
348
|
}
|
|
343
|
-
}, v = [
|
|
344
|
-
return /* @__PURE__ */
|
|
349
|
+
}, v = [f && "disabled", p].filter(Boolean).join(" ");
|
|
350
|
+
return /* @__PURE__ */ d(
|
|
345
351
|
"li",
|
|
346
352
|
{
|
|
347
|
-
ref:
|
|
353
|
+
ref: m,
|
|
348
354
|
className: v,
|
|
349
355
|
role: "none",
|
|
350
|
-
"data-key":
|
|
351
|
-
onMouseEnter:
|
|
352
|
-
onMouseLeave:
|
|
353
|
-
children: /* @__PURE__ */ B("details", { open:
|
|
356
|
+
"data-key": o,
|
|
357
|
+
onMouseEnter: h,
|
|
358
|
+
onMouseLeave: r,
|
|
359
|
+
children: /* @__PURE__ */ B("details", { open: s, children: [
|
|
354
360
|
/* @__PURE__ */ B(
|
|
355
361
|
"summary",
|
|
356
362
|
{
|
|
357
|
-
ref:
|
|
363
|
+
ref: b,
|
|
358
364
|
role: "menuitem",
|
|
359
|
-
tabIndex:
|
|
360
|
-
"aria-disabled":
|
|
365
|
+
tabIndex: f ? -1 : 0,
|
|
366
|
+
"aria-disabled": f || void 0,
|
|
361
367
|
"aria-haspopup": "menu",
|
|
362
|
-
"aria-expanded":
|
|
368
|
+
"aria-expanded": s,
|
|
363
369
|
"aria-controls": c,
|
|
364
370
|
onKeyDown: S,
|
|
365
371
|
children: [
|
|
366
|
-
|
|
367
|
-
|
|
372
|
+
I && /* @__PURE__ */ d("span", { className: "mr-2 inline-flex items-center", children: I }),
|
|
373
|
+
l
|
|
368
374
|
]
|
|
369
375
|
}
|
|
370
376
|
),
|
|
371
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ d(
|
|
372
378
|
"ul",
|
|
373
379
|
{
|
|
374
|
-
ref:
|
|
380
|
+
ref: w,
|
|
375
381
|
id: c,
|
|
376
382
|
className: "menu bg-base-100 rounded-box z-50 shadow",
|
|
377
383
|
role: "menu",
|
|
378
|
-
"aria-label": typeof
|
|
384
|
+
"aria-label": typeof l == "string" ? l : void 0,
|
|
379
385
|
onKeyDown: U,
|
|
380
|
-
children:
|
|
386
|
+
children: a
|
|
381
387
|
}
|
|
382
388
|
)
|
|
383
389
|
] })
|
|
384
390
|
}
|
|
385
391
|
);
|
|
386
392
|
}
|
|
387
|
-
function X({ className:
|
|
388
|
-
const
|
|
389
|
-
return /* @__PURE__ */
|
|
393
|
+
function X({ className: a = "" }) {
|
|
394
|
+
const l = ["border-base-content/10", a].filter(Boolean).join(" ");
|
|
395
|
+
return /* @__PURE__ */ d("li", { role: "separator", className: "my-1", children: /* @__PURE__ */ d("hr", { className: l }) });
|
|
390
396
|
}
|
|
391
|
-
const be = Object.assign(
|
|
392
|
-
Trigger:
|
|
393
|
-
Menu:
|
|
397
|
+
const be = Object.assign(fe, {
|
|
398
|
+
Trigger: J,
|
|
399
|
+
Menu: Q,
|
|
394
400
|
Item: O,
|
|
395
|
-
SubMenu:
|
|
401
|
+
SubMenu: _,
|
|
396
402
|
Divider: X
|
|
397
403
|
});
|
|
398
404
|
export {
|