@epam/ai-dial-ui-kit 0.16.0-dev.12 → 0.16.0-dev.13
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/README.md +1 -0
- package/dist/CHANGELOG.md +2 -0
- package/dist/{DateCellRenderer-xHilQEYj.cjs → DateCellRenderer-CkDF66wX.cjs} +28 -28
- package/dist/components/New/Dropdown/Dropdown.js +320 -251
- package/dist/components/New/Dropdown/constants.js +20 -17
- package/dist/components/New/Dropdown/search.js +37 -0
- package/dist/components-manifest.json +56 -4
- package/dist/constants/public-class-names.js +2 -0
- package/dist/dial-ui-kit.cjs +3 -3
- package/dist/grid.cjs +1 -1
- package/dist/src/components/New/Dropdown/Dropdown.d.ts +42 -0
- package/dist/src/components/New/Dropdown/constants.d.ts +6 -0
- package/dist/src/components/New/Dropdown/search.d.ts +9 -0
- package/dist/src/constants/public-class-names.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,316 +1,385 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useFloatingNodeId as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { InteractiveTooltip as
|
|
5
|
-
import { DIAL_KIT_CLASS as
|
|
6
|
-
import { DropdownTrigger as
|
|
7
|
-
import { MenuItemMark as
|
|
8
|
-
import { dropdownGap as
|
|
9
|
-
import { CloseButton as
|
|
10
|
-
import { MenuItem as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
1
|
+
import { jsxs as S, Fragment as R, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useFloatingNodeId as Te, useFloating as Le, autoUpdate as Oe, offset as Re, autoPlacement as be, flip as _e, shift as $e, size as Be, useClick as Ye, useHover as He, safePolygon as Ke, useDismiss as Ue, useRole as We, useInteractions as je, FloatingTree as ze, FloatingNode as Qe, FloatingPortal as qe, FloatingFocusManager as Xe } from "@floating-ui/react";
|
|
3
|
+
import { useState as b, useRef as Ge, useCallback as h, useId as Je, useEffect as oe, useMemo as ne, Fragment as Ze } from "react";
|
|
4
|
+
import { InteractiveTooltip as Ve } from "../InteractiveTooltip/InteractiveTooltip.js";
|
|
5
|
+
import { DIAL_KIT_CLASS as _ } from "../../../constants/public-class-names.js";
|
|
6
|
+
import { DropdownTrigger as k, DropdownItemType as re } from "../../../types/dropdown.js";
|
|
7
|
+
import { MenuItemMark as et } from "../../../types/menu-item.js";
|
|
8
|
+
import { dropdownGap as N, dropdownSearchClassName as tt, dropdownNoResultsClassName as ot, dropdownDividerClassName as nt, getDropdownListHeight as rt, dropdownItemListClassName as st, dropdownBaseClassName as lt, dropdownListBaseClassName as it } from "./constants.js";
|
|
9
|
+
import { CloseButton as ct } from "../CloseButton/CloseButton.js";
|
|
10
|
+
import { MenuItem as at } from "../MenuItem/MenuItem.js";
|
|
11
|
+
import { Search as dt } from "../Search/Search.js";
|
|
12
|
+
import { useThemeScope as ut } from "../ThemeScope/ThemeScope.js";
|
|
13
|
+
import { ElementSize as ft } from "../../../types/size.js";
|
|
14
|
+
import { mergeClasses as y } from "../../../utils/merge-classes.js";
|
|
15
|
+
import { DropdownSubMenuItem as pt } from "./DropdownSubMenuItem.js";
|
|
16
|
+
import { resolveItemMark as mt, getItemRole as ht } from "./item-mark.js";
|
|
17
|
+
import { highlightDropdownItems as gt, filterDropdownItems as wt } from "./search.js";
|
|
18
|
+
const yt = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"]', vt = (l) => !l.hasAttribute("disabled") && l.getAttribute("aria-disabled") !== "true", Ct = ["ArrowDown", "ArrowUp", "Home", "End"], xt = (l, d, f) => {
|
|
16
19
|
if (l === "Home") return 0;
|
|
17
|
-
if (l === "End") return
|
|
18
|
-
const
|
|
19
|
-
return d === -1 ?
|
|
20
|
-
},
|
|
20
|
+
if (l === "End") return f - 1;
|
|
21
|
+
const u = l === "ArrowDown" ? 1 : -1;
|
|
22
|
+
return d === -1 ? u === 1 ? 0 : f - 1 : (d + u + f) % f;
|
|
23
|
+
}, kt = (l) => "clientWidth" in l ? l.clientWidth : l.getBoundingClientRect?.()?.width ?? 0, Yt = ({
|
|
21
24
|
children: l,
|
|
22
25
|
items: d,
|
|
23
|
-
onItemClick:
|
|
24
|
-
menuHeader:
|
|
25
|
-
menuFooter:
|
|
26
|
-
renderOverlay:
|
|
27
|
-
trigger:
|
|
28
|
-
placement:
|
|
29
|
-
disabled:
|
|
30
|
-
open:
|
|
31
|
-
defaultOpen:
|
|
32
|
-
onOpenChange:
|
|
33
|
-
closable:
|
|
34
|
-
onClose:
|
|
35
|
-
className:
|
|
36
|
-
overlayContentClassName:
|
|
37
|
-
separatorClassName:
|
|
38
|
-
listClassName:
|
|
39
|
-
listStyle:
|
|
40
|
-
outsidePressIgnoreRef:
|
|
41
|
-
outsideClosable:
|
|
42
|
-
allowedPlacements:
|
|
43
|
-
anchorToMouse:
|
|
44
|
-
matchReferenceWidth:
|
|
45
|
-
maxDropdownHeight:
|
|
46
|
-
initialFocus:
|
|
26
|
+
onItemClick: f,
|
|
27
|
+
menuHeader: u,
|
|
28
|
+
menuFooter: v,
|
|
29
|
+
renderOverlay: E,
|
|
30
|
+
trigger: g = [k.Click],
|
|
31
|
+
placement: $,
|
|
32
|
+
disabled: c = !1,
|
|
33
|
+
open: B,
|
|
34
|
+
defaultOpen: se = !1,
|
|
35
|
+
onOpenChange: Y,
|
|
36
|
+
closable: le = !1,
|
|
37
|
+
onClose: ie,
|
|
38
|
+
className: ce,
|
|
39
|
+
overlayContentClassName: H,
|
|
40
|
+
separatorClassName: K,
|
|
41
|
+
listClassName: ae,
|
|
42
|
+
listStyle: U,
|
|
43
|
+
outsidePressIgnoreRef: W,
|
|
44
|
+
outsideClosable: de = !0,
|
|
45
|
+
allowedPlacements: ue,
|
|
46
|
+
anchorToMouse: D = !1,
|
|
47
|
+
matchReferenceWidth: F = !0,
|
|
48
|
+
maxDropdownHeight: j,
|
|
49
|
+
initialFocus: z,
|
|
50
|
+
searchable: i = !1,
|
|
51
|
+
searchValue: T,
|
|
52
|
+
onSearchChange: Q,
|
|
53
|
+
searchPlaceholder: L = "Search",
|
|
54
|
+
searchClearLabel: q = "Clear search",
|
|
55
|
+
noResultsLabel: X = "No results found",
|
|
56
|
+
filterItem: G,
|
|
57
|
+
maxVisibleItems: C
|
|
47
58
|
}) => {
|
|
48
|
-
const
|
|
49
|
-
(
|
|
50
|
-
|
|
59
|
+
const fe = ut(), [pe, me] = b(se), O = B !== void 0, a = O ? !!B : pe, I = Ge(null), [he, ge] = b(""), p = T ?? he, M = h(
|
|
60
|
+
(t) => {
|
|
61
|
+
T === void 0 && ge(t), Q?.(t);
|
|
51
62
|
},
|
|
52
|
-
[
|
|
53
|
-
),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
[T, Q]
|
|
64
|
+
), [we, ye] = b(!0), n = h(
|
|
65
|
+
(t, e, r) => {
|
|
66
|
+
t ? ye(r !== "hover" && r !== "safe-polygon") : i && p && M(""), O || me(t), Y?.(t);
|
|
67
|
+
},
|
|
68
|
+
[O, Y, i, p, M]
|
|
69
|
+
), J = Je(), ve = $ === void 0, Z = Te(), { refs: w, floatingStyles: V, context: x } = Le({
|
|
70
|
+
nodeId: Z,
|
|
71
|
+
placement: $,
|
|
72
|
+
open: a,
|
|
73
|
+
onOpenChange: n,
|
|
74
|
+
whileElementsMounted: Oe,
|
|
59
75
|
middleware: [
|
|
60
|
-
|
|
61
|
-
|
|
76
|
+
Re({ mainAxis: N, crossAxis: 0 }),
|
|
77
|
+
ve ? be({
|
|
62
78
|
alignment: "start",
|
|
63
79
|
crossAxis: !0,
|
|
64
|
-
padding:
|
|
65
|
-
allowedPlacements:
|
|
66
|
-
}) :
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
padding:
|
|
70
|
-
apply({ availableWidth:
|
|
71
|
-
const s = r.floating,
|
|
80
|
+
padding: N,
|
|
81
|
+
allowedPlacements: ue
|
|
82
|
+
}) : _e({ padding: N }),
|
|
83
|
+
$e({ padding: N }),
|
|
84
|
+
Be({
|
|
85
|
+
padding: N,
|
|
86
|
+
apply({ availableWidth: t, availableHeight: e, elements: r }) {
|
|
87
|
+
const s = r.floating, m = kt(r.reference);
|
|
72
88
|
s.style.setProperty(
|
|
73
89
|
"--fui-available-height",
|
|
74
|
-
`${Math.floor(
|
|
90
|
+
`${Math.floor(e)}px`
|
|
75
91
|
), s.style.setProperty(
|
|
76
92
|
"--reference-width",
|
|
77
|
-
|
|
78
|
-
),
|
|
79
|
-
const
|
|
80
|
-
s.style.maxHeight = `${
|
|
93
|
+
F ? `${Math.round(m)}px` : "0px"
|
|
94
|
+
), F ? s.style.minWidth = `${Math.round(m)}px` : s.style.removeProperty("min-width"), s.style.maxWidth = `${Math.floor(t)}px`;
|
|
95
|
+
const te = Math.floor(e);
|
|
96
|
+
s.style.maxHeight = `${j ? Math.min(te, j) : te}px`;
|
|
81
97
|
}
|
|
82
98
|
})
|
|
83
99
|
]
|
|
84
|
-
}),
|
|
85
|
-
enabled:
|
|
86
|
-
}),
|
|
87
|
-
enabled:
|
|
100
|
+
}), Ce = Ye(x, {
|
|
101
|
+
enabled: g.includes(k.Click) && !c
|
|
102
|
+
}), xe = He(x, {
|
|
103
|
+
enabled: g.includes(k.Hover) && !c,
|
|
88
104
|
move: !1,
|
|
89
105
|
restMs: 40,
|
|
90
|
-
handleClose:
|
|
106
|
+
handleClose: Ke(),
|
|
91
107
|
delay: { open: 80, close: 80 }
|
|
92
|
-
}),
|
|
108
|
+
}), ke = Ue(x, {
|
|
93
109
|
bubbles: !0,
|
|
94
110
|
referencePress: !1,
|
|
95
|
-
outsidePress: (
|
|
96
|
-
if (!
|
|
97
|
-
const
|
|
98
|
-
return !(
|
|
111
|
+
outsidePress: (t) => {
|
|
112
|
+
if (!de) return !1;
|
|
113
|
+
const e = t.target;
|
|
114
|
+
return !(W?.current && e instanceof Node && W.current.contains(e));
|
|
99
115
|
}
|
|
100
|
-
}),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
]),
|
|
106
|
-
(
|
|
107
|
-
|
|
116
|
+
}), Ne = We(x, { role: "menu" }), { getReferenceProps: Ee, getFloatingProps: De } = je([
|
|
117
|
+
Ce,
|
|
118
|
+
xe,
|
|
119
|
+
ke,
|
|
120
|
+
Ne
|
|
121
|
+
]), P = h(
|
|
122
|
+
(t, e) => {
|
|
123
|
+
w.setPositionReference({
|
|
108
124
|
getBoundingClientRect: () => ({
|
|
109
125
|
width: 0,
|
|
110
126
|
height: 0,
|
|
111
|
-
x:
|
|
112
|
-
y:
|
|
113
|
-
top:
|
|
114
|
-
left:
|
|
115
|
-
right:
|
|
116
|
-
bottom:
|
|
127
|
+
x: t,
|
|
128
|
+
y: e,
|
|
129
|
+
top: e,
|
|
130
|
+
left: t,
|
|
131
|
+
right: t,
|
|
132
|
+
bottom: e
|
|
117
133
|
})
|
|
118
134
|
});
|
|
119
135
|
},
|
|
120
|
-
[
|
|
121
|
-
),
|
|
122
|
-
(
|
|
123
|
-
!
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
)),
|
|
136
|
+
[w]
|
|
137
|
+
), Ie = h(
|
|
138
|
+
(t) => {
|
|
139
|
+
!g.includes(k.ContextMenu) || c || (t.preventDefault(), D && (P(t.clientX, t.clientY), I.current = document.elementFromPoint(
|
|
140
|
+
t.clientX,
|
|
141
|
+
t.clientY
|
|
142
|
+
)), n(!0));
|
|
127
143
|
},
|
|
128
|
-
[
|
|
129
|
-
),
|
|
130
|
-
(
|
|
131
|
-
!
|
|
132
|
-
|
|
133
|
-
|
|
144
|
+
[D, c, n, P, g]
|
|
145
|
+
), Me = h(
|
|
146
|
+
(t) => {
|
|
147
|
+
!D || c || (g.includes(k.ContextMenu) && a && n(!1), P(t.clientX, t.clientY), I.current = document.elementFromPoint(
|
|
148
|
+
t.clientX,
|
|
149
|
+
t.clientY
|
|
134
150
|
));
|
|
135
151
|
},
|
|
136
|
-
[
|
|
152
|
+
[D, c, P, a, g, n]
|
|
137
153
|
);
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}, [
|
|
141
|
-
const
|
|
142
|
-
(
|
|
143
|
-
if (
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
154
|
+
oe(() => {
|
|
155
|
+
c && a && n(!1);
|
|
156
|
+
}, [c, a, n]);
|
|
157
|
+
const Pe = h(
|
|
158
|
+
(t) => {
|
|
159
|
+
if (t.defaultPrevented || !Ct.includes(t.key) || !t.currentTarget.contains(t.target) || t.target instanceof HTMLInputElement && (t.key === "Home" || t.key === "End"))
|
|
160
|
+
return;
|
|
161
|
+
const e = Array.from(
|
|
162
|
+
t.currentTarget.querySelectorAll(
|
|
163
|
+
yt
|
|
147
164
|
)
|
|
148
|
-
).filter(
|
|
149
|
-
if (
|
|
150
|
-
|
|
151
|
-
const r =
|
|
152
|
-
|
|
165
|
+
).filter(vt);
|
|
166
|
+
if (e.length === 0) return;
|
|
167
|
+
t.preventDefault();
|
|
168
|
+
const r = t.currentTarget.ownerDocument.activeElement, s = e.findIndex((m) => m === r);
|
|
169
|
+
e[xt(t.key, s, e.length)]?.focus();
|
|
153
170
|
},
|
|
154
171
|
[]
|
|
155
|
-
),
|
|
156
|
-
(
|
|
157
|
-
|
|
172
|
+
), ee = h(
|
|
173
|
+
(t) => (e) => {
|
|
174
|
+
t.disabled || (t.onClick?.({ key: t.key, domEvent: e }), f?.({ key: t.key, domEvent: e }), t.selectable || n(!1));
|
|
158
175
|
},
|
|
159
|
-
[
|
|
160
|
-
),
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
className: v(
|
|
179
|
-
Ke,
|
|
180
|
-
O
|
|
181
|
-
)
|
|
182
|
-
},
|
|
183
|
-
e.key
|
|
184
|
-
);
|
|
185
|
-
if (e.type === X.PlainText)
|
|
186
|
-
return /* @__PURE__ */ n(
|
|
187
|
-
"div",
|
|
188
|
-
{
|
|
189
|
-
className: v(
|
|
190
|
-
"px-3 py-2 text-secondary dial-caption-text",
|
|
191
|
-
e.className
|
|
192
|
-
),
|
|
193
|
-
children: e.label
|
|
194
|
-
},
|
|
195
|
-
e.key
|
|
196
|
-
);
|
|
197
|
-
if (e.children?.length)
|
|
198
|
-
return /* @__PURE__ */ n(
|
|
199
|
-
ze,
|
|
200
|
-
{
|
|
201
|
-
item: e,
|
|
202
|
-
onRootClose: () => o(!1)
|
|
203
|
-
},
|
|
204
|
-
e.key
|
|
205
|
-
);
|
|
206
|
-
const t = Ge(e), r = He(e), s = /* @__PURE__ */ n(
|
|
207
|
-
Xe,
|
|
208
|
-
{
|
|
209
|
-
role: r,
|
|
210
|
-
"aria-checked": r === "menuitem" ? void 0 : !!e.checked,
|
|
211
|
-
"aria-current": t === Ye.Highlight && e.checked ? !0 : void 0,
|
|
212
|
-
"aria-disabled": !!e.disabled,
|
|
213
|
-
disabled: e.disabled,
|
|
214
|
-
mark: t,
|
|
215
|
-
selected: !!e.checked,
|
|
216
|
-
danger: e.danger,
|
|
217
|
-
icon: e.icon,
|
|
218
|
-
label: e.label,
|
|
219
|
-
className: e.className,
|
|
220
|
-
rightControl: e.rightControl,
|
|
221
|
-
onClick: K(e),
|
|
222
|
-
children: e.renderItem?.(e)
|
|
223
|
-
}
|
|
224
|
-
);
|
|
225
|
-
return /* @__PURE__ */ n($e, { children: e.interactiveTooltip ? /* @__PURE__ */ n(
|
|
226
|
-
Be,
|
|
176
|
+
[f, n]
|
|
177
|
+
), A = ne(() => !d || !i ? d : gt(
|
|
178
|
+
wt(d, p, G),
|
|
179
|
+
p
|
|
180
|
+
), [d, i, p, G]), Ae = ne(() => {
|
|
181
|
+
if (E) return E();
|
|
182
|
+
if (!A) return null;
|
|
183
|
+
const t = i && A.length === 0;
|
|
184
|
+
return /* @__PURE__ */ S(R, { children: [
|
|
185
|
+
u && /* @__PURE__ */ o(R, { children: typeof u == "function" ? u() : u }),
|
|
186
|
+
i && /* @__PURE__ */ o(
|
|
187
|
+
"div",
|
|
188
|
+
{
|
|
189
|
+
className: y(
|
|
190
|
+
tt,
|
|
191
|
+
_.dropdownSearch
|
|
192
|
+
),
|
|
193
|
+
children: /* @__PURE__ */ o(
|
|
194
|
+
dt,
|
|
227
195
|
{
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
196
|
+
value: p,
|
|
197
|
+
placeholder: L,
|
|
198
|
+
"aria-label": L,
|
|
199
|
+
clearLabel: q,
|
|
200
|
+
size: ft.Small,
|
|
201
|
+
onChange: (e) => M(e ?? "")
|
|
233
202
|
}
|
|
234
|
-
)
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
/* @__PURE__ */ S(
|
|
207
|
+
"div",
|
|
208
|
+
{
|
|
209
|
+
role: "none",
|
|
210
|
+
className: y(
|
|
211
|
+
st,
|
|
212
|
+
/* Under a search field or a row cap the list scrolls by itself,
|
|
213
|
+
so the field stays in view; the panel's own height cap still
|
|
214
|
+
shrinks it through `min-h-0`. */
|
|
215
|
+
(i || C != null) && "min-h-0 flex-1 overflow-auto",
|
|
216
|
+
H,
|
|
217
|
+
_.dropdownList
|
|
218
|
+
),
|
|
219
|
+
style: C != null ? { maxHeight: rt(C) } : void 0,
|
|
220
|
+
"aria-label": "dropdown",
|
|
221
|
+
children: [
|
|
222
|
+
i && /* Always mounted, so a screen reader announces the text when a
|
|
223
|
+
query empties the list rather than missing a fresh region. */
|
|
224
|
+
/* @__PURE__ */ o(
|
|
225
|
+
"div",
|
|
226
|
+
{
|
|
227
|
+
role: "status",
|
|
228
|
+
className: t ? ot : "sr-only",
|
|
229
|
+
children: t ? X : ""
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
A.map((e) => {
|
|
233
|
+
if (e.type === re.Divider)
|
|
234
|
+
return /* @__PURE__ */ o(
|
|
235
|
+
"div",
|
|
236
|
+
{
|
|
237
|
+
role: "separator",
|
|
238
|
+
className: y(
|
|
239
|
+
nt,
|
|
240
|
+
K
|
|
241
|
+
)
|
|
242
|
+
},
|
|
243
|
+
e.key
|
|
244
|
+
);
|
|
245
|
+
if (e.type === re.PlainText)
|
|
246
|
+
return /* @__PURE__ */ o(
|
|
247
|
+
"div",
|
|
248
|
+
{
|
|
249
|
+
className: y(
|
|
250
|
+
"px-3 py-2 text-secondary dial-caption-text",
|
|
251
|
+
e.className
|
|
252
|
+
),
|
|
253
|
+
children: e.label
|
|
254
|
+
},
|
|
255
|
+
e.key
|
|
256
|
+
);
|
|
257
|
+
if (e.children?.length)
|
|
258
|
+
return /* @__PURE__ */ o(
|
|
259
|
+
pt,
|
|
260
|
+
{
|
|
261
|
+
item: e,
|
|
262
|
+
onRootClose: () => n(!1)
|
|
263
|
+
},
|
|
264
|
+
e.key
|
|
265
|
+
);
|
|
266
|
+
const r = mt(e), s = ht(e), m = /* @__PURE__ */ o(
|
|
267
|
+
at,
|
|
268
|
+
{
|
|
269
|
+
role: s,
|
|
270
|
+
"aria-checked": s === "menuitem" ? void 0 : !!e.checked,
|
|
271
|
+
"aria-current": r === et.Highlight && e.checked ? !0 : void 0,
|
|
272
|
+
"aria-disabled": !!e.disabled,
|
|
273
|
+
disabled: e.disabled,
|
|
274
|
+
mark: r,
|
|
275
|
+
selected: !!e.checked,
|
|
276
|
+
danger: e.danger,
|
|
277
|
+
icon: e.icon,
|
|
278
|
+
label: e.label,
|
|
279
|
+
className: e.className,
|
|
280
|
+
rightControl: e.rightControl,
|
|
281
|
+
onClick: ee(e),
|
|
282
|
+
children: e.renderItem?.(e)
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
return /* @__PURE__ */ o(Ze, { children: e.interactiveTooltip ? /* @__PURE__ */ o(
|
|
286
|
+
Ve,
|
|
287
|
+
{
|
|
288
|
+
asChild: !0,
|
|
289
|
+
placement: e.interactiveTooltip.placement,
|
|
290
|
+
content: e.interactiveTooltip.content,
|
|
291
|
+
contentClassName: e.interactiveTooltip.contentClassName,
|
|
292
|
+
children: m
|
|
293
|
+
}
|
|
294
|
+
) : m }, e.key);
|
|
295
|
+
})
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
),
|
|
299
|
+
v && /* @__PURE__ */ o(R, { children: typeof v == "function" ? v() : v })
|
|
300
|
+
] });
|
|
301
|
+
}, [
|
|
302
|
+
ee,
|
|
303
|
+
A,
|
|
304
|
+
v,
|
|
305
|
+
u,
|
|
306
|
+
E,
|
|
307
|
+
n,
|
|
308
|
+
H,
|
|
240
309
|
K,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
]),
|
|
249
|
-
onContextMenu:
|
|
250
|
-
onMouseDown:
|
|
310
|
+
i,
|
|
311
|
+
p,
|
|
312
|
+
M,
|
|
313
|
+
L,
|
|
314
|
+
q,
|
|
315
|
+
X,
|
|
316
|
+
C
|
|
317
|
+
]), Se = !E && (i || C != null), Fe = Ee({
|
|
318
|
+
onContextMenu: Ie,
|
|
319
|
+
onMouseDown: Me
|
|
251
320
|
});
|
|
252
|
-
return
|
|
253
|
-
if (!
|
|
254
|
-
const
|
|
255
|
-
let
|
|
256
|
-
if (
|
|
321
|
+
return oe(() => {
|
|
322
|
+
if (!a) return;
|
|
323
|
+
const t = w.reference.current;
|
|
324
|
+
let e = null;
|
|
325
|
+
if (t instanceof Element ? e = t : I.current instanceof Element && (e = I.current), !e) return;
|
|
257
326
|
const r = new IntersectionObserver(
|
|
258
327
|
([s]) => {
|
|
259
|
-
s.isIntersecting ||
|
|
328
|
+
s.isIntersecting || n(!1);
|
|
260
329
|
},
|
|
261
330
|
{ root: null, threshold: 0 }
|
|
262
331
|
);
|
|
263
|
-
return r.observe(
|
|
264
|
-
}, [
|
|
265
|
-
/* @__PURE__ */
|
|
332
|
+
return r.observe(e), () => r.disconnect();
|
|
333
|
+
}, [a, w.reference, n]), /* @__PURE__ */ o(ze, { children: /* @__PURE__ */ S(Qe, { id: Z, children: [
|
|
334
|
+
/* @__PURE__ */ o(
|
|
266
335
|
"span",
|
|
267
336
|
{
|
|
268
|
-
ref:
|
|
269
|
-
className:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
337
|
+
ref: w.setReference,
|
|
338
|
+
className: y(
|
|
339
|
+
lt,
|
|
340
|
+
c && "!cursor-not-allowed opacity-75",
|
|
341
|
+
ce,
|
|
342
|
+
_.dropdown
|
|
274
343
|
),
|
|
275
344
|
"aria-haspopup": "menu",
|
|
276
|
-
"aria-expanded":
|
|
277
|
-
"aria-controls":
|
|
278
|
-
...
|
|
345
|
+
"aria-expanded": a,
|
|
346
|
+
"aria-controls": J,
|
|
347
|
+
...Fe,
|
|
279
348
|
children: l
|
|
280
349
|
}
|
|
281
350
|
),
|
|
282
|
-
|
|
283
|
-
|
|
351
|
+
a && /* @__PURE__ */ o(qe, { children: /* @__PURE__ */ o(
|
|
352
|
+
Xe,
|
|
284
353
|
{
|
|
285
|
-
context:
|
|
354
|
+
context: x,
|
|
286
355
|
modal: !1,
|
|
287
|
-
initialFocus:
|
|
356
|
+
initialFocus: z !== void 0 ? z : we ? 0 : -1,
|
|
288
357
|
returnFocus: !0,
|
|
289
|
-
children: /* @__PURE__ */
|
|
358
|
+
children: /* @__PURE__ */ S(
|
|
290
359
|
"div",
|
|
291
360
|
{
|
|
292
|
-
id:
|
|
293
|
-
ref:
|
|
294
|
-
style:
|
|
295
|
-
className:
|
|
296
|
-
|
|
297
|
-
!
|
|
298
|
-
"overflow-auto",
|
|
299
|
-
|
|
300
|
-
|
|
361
|
+
id: J,
|
|
362
|
+
ref: w.setFloating,
|
|
363
|
+
style: U ? { ...U, ...V } : V,
|
|
364
|
+
className: y(
|
|
365
|
+
it,
|
|
366
|
+
!F && "w-max",
|
|
367
|
+
Se ? "flex flex-col overflow-hidden" : "overflow-auto",
|
|
368
|
+
fe,
|
|
369
|
+
ae
|
|
301
370
|
),
|
|
302
|
-
...
|
|
371
|
+
...De({ onKeyDown: Pe }),
|
|
303
372
|
children: [
|
|
304
|
-
|
|
305
|
-
|
|
373
|
+
le && /* @__PURE__ */ o("div", { className: "flex items-center justify-between px-2 pt-2", children: /* @__PURE__ */ o(
|
|
374
|
+
ct,
|
|
306
375
|
{
|
|
307
376
|
ariaLabel: "Close dropdown",
|
|
308
|
-
onClose: (
|
|
309
|
-
|
|
377
|
+
onClose: (t) => {
|
|
378
|
+
ie?.(t), n(!1);
|
|
310
379
|
}
|
|
311
380
|
}
|
|
312
381
|
) }),
|
|
313
|
-
|
|
382
|
+
Ae
|
|
314
383
|
]
|
|
315
384
|
}
|
|
316
385
|
)
|
|
@@ -319,5 +388,5 @@ const Je = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]
|
|
|
319
388
|
] }) });
|
|
320
389
|
};
|
|
321
390
|
export {
|
|
322
|
-
|
|
391
|
+
Yt as Dropdown
|
|
323
392
|
};
|