@phillips/seldon 1.43.0 → 1.44.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/assets/chevronDown.svg.js +5 -0
- package/dist/components/Dropdown/Dropdown.d.ts +32 -0
- package/dist/components/Dropdown/Dropdown.js +49 -0
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/Dropdown/types.d.ts +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +33 -31
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +521 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +373 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +203 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +128 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +129 -0
- package/dist/node_modules/@radix-ui/number/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +220 -0
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +824 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +8 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +30 -0
- package/dist/scss/componentStyles.scss +1 -0
- package/dist/scss/components/Accordion/_accordion.scss +4 -4
- package/dist/scss/components/Dropdown/_dropdown.scss +86 -0
- package/package.json +2 -1
|
@@ -0,0 +1,824 @@
|
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
import * as be from "react-dom";
|
|
3
|
+
import { clamp as Ee } from "../../number/dist/index.js";
|
|
4
|
+
import { composeEventHandlers as b } from "../../primitive/dist/index.js";
|
|
5
|
+
import { createCollection as tt } from "../../react-collection/dist/index.js";
|
|
6
|
+
import { useComposedRefs as H } from "../../react-compose-refs/dist/index.js";
|
|
7
|
+
import { createContextScope as ot } from "../../react-context/dist/index.js";
|
|
8
|
+
import { useDirection as nt } from "../../react-direction/dist/index.js";
|
|
9
|
+
import { DismissableLayer as rt } from "../../react-dismissable-layer/dist/index.js";
|
|
10
|
+
import { useFocusGuards as st } from "../../react-focus-guards/dist/index.js";
|
|
11
|
+
import { FocusScope as lt } from "../../react-focus-scope/dist/index.js";
|
|
12
|
+
import { useId as Ie } from "../../react-id/dist/index.js";
|
|
13
|
+
import { createPopperScope as _e, Anchor as ct, Content as it, Arrow as at, Root as dt } from "../../react-popper/dist/index.js";
|
|
14
|
+
import { Portal as ut } from "../../react-portal/dist/index.js";
|
|
15
|
+
import { Primitive as A } from "../../react-primitive/dist/index.js";
|
|
16
|
+
import { Slot as pt } from "../../react-slot/dist/index.js";
|
|
17
|
+
import { useCallbackRef as ft } from "../../react-use-callback-ref/dist/index.js";
|
|
18
|
+
import { useControllableState as Re } from "../../react-use-controllable-state/dist/index.js";
|
|
19
|
+
import { useLayoutEffect as z } from "../../react-use-layout-effect/dist/index.js";
|
|
20
|
+
import { usePrevious as mt } from "../../react-use-previous/dist/index.js";
|
|
21
|
+
import { VisuallyHidden as ht } from "../../react-visually-hidden/dist/index.js";
|
|
22
|
+
import { hideOthers as vt } from "../../../aria-hidden/dist/es2015/index.js";
|
|
23
|
+
import gt from "../../../react-remove-scroll/dist/es2015/Combination.js";
|
|
24
|
+
import { jsx as p, Fragment as Te, jsxs as ce } from "react/jsx-runtime";
|
|
25
|
+
var St = [" ", "Enter", "ArrowUp", "ArrowDown"], wt = [" ", "Enter"], re = "Select", [ae, de, Ct] = tt(re), [ee, io] = ot(re, [
|
|
26
|
+
Ct,
|
|
27
|
+
_e
|
|
28
|
+
]), ue = _e(), [yt, j] = ee(re), [xt, It] = ee(re), Ne = (n) => {
|
|
29
|
+
const {
|
|
30
|
+
__scopeSelect: i,
|
|
31
|
+
children: e,
|
|
32
|
+
open: c,
|
|
33
|
+
defaultOpen: l,
|
|
34
|
+
onOpenChange: a,
|
|
35
|
+
value: s,
|
|
36
|
+
defaultValue: r,
|
|
37
|
+
onValueChange: o,
|
|
38
|
+
dir: d,
|
|
39
|
+
name: S,
|
|
40
|
+
autoComplete: y,
|
|
41
|
+
disabled: E,
|
|
42
|
+
required: P
|
|
43
|
+
} = n, m = ue(i), [v, I] = t.useState(null), [h, u] = t.useState(null), [g, F] = t.useState(!1), O = nt(d), [te = !1, _] = Re({
|
|
44
|
+
prop: c,
|
|
45
|
+
defaultProp: l,
|
|
46
|
+
onChange: a
|
|
47
|
+
}), [M, q] = Re({
|
|
48
|
+
prop: s,
|
|
49
|
+
defaultProp: r,
|
|
50
|
+
onChange: o
|
|
51
|
+
}), $ = t.useRef(null), X = v ? !!v.closest("form") : !0, [D, U] = t.useState(/* @__PURE__ */ new Set()), K = Array.from(D).map((R) => R.props.value).join(";");
|
|
52
|
+
return /* @__PURE__ */ p(dt, { ...m, children: /* @__PURE__ */ ce(
|
|
53
|
+
yt,
|
|
54
|
+
{
|
|
55
|
+
required: P,
|
|
56
|
+
scope: i,
|
|
57
|
+
trigger: v,
|
|
58
|
+
onTriggerChange: I,
|
|
59
|
+
valueNode: h,
|
|
60
|
+
onValueNodeChange: u,
|
|
61
|
+
valueNodeHasChildren: g,
|
|
62
|
+
onValueNodeHasChildrenChange: F,
|
|
63
|
+
contentId: Ie(),
|
|
64
|
+
value: M,
|
|
65
|
+
onValueChange: q,
|
|
66
|
+
open: te,
|
|
67
|
+
onOpenChange: _,
|
|
68
|
+
dir: O,
|
|
69
|
+
triggerPointerDownPosRef: $,
|
|
70
|
+
disabled: E,
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ p(ae.Provider, { scope: i, children: /* @__PURE__ */ p(
|
|
73
|
+
xt,
|
|
74
|
+
{
|
|
75
|
+
scope: n.__scopeSelect,
|
|
76
|
+
onNativeOptionAdd: t.useCallback((R) => {
|
|
77
|
+
U((L) => new Set(L).add(R));
|
|
78
|
+
}, []),
|
|
79
|
+
onNativeOptionRemove: t.useCallback((R) => {
|
|
80
|
+
U((L) => {
|
|
81
|
+
const V = new Set(L);
|
|
82
|
+
return V.delete(R), V;
|
|
83
|
+
});
|
|
84
|
+
}, []),
|
|
85
|
+
children: e
|
|
86
|
+
}
|
|
87
|
+
) }),
|
|
88
|
+
X ? /* @__PURE__ */ ce(
|
|
89
|
+
Je,
|
|
90
|
+
{
|
|
91
|
+
"aria-hidden": !0,
|
|
92
|
+
required: P,
|
|
93
|
+
tabIndex: -1,
|
|
94
|
+
name: S,
|
|
95
|
+
autoComplete: y,
|
|
96
|
+
value: M,
|
|
97
|
+
onChange: (R) => q(R.target.value),
|
|
98
|
+
disabled: E,
|
|
99
|
+
children: [
|
|
100
|
+
M === void 0 ? /* @__PURE__ */ p("option", { value: "" }) : null,
|
|
101
|
+
Array.from(D)
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
K
|
|
105
|
+
) : null
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
) });
|
|
109
|
+
};
|
|
110
|
+
Ne.displayName = re;
|
|
111
|
+
var Me = "SelectTrigger", Ae = t.forwardRef(
|
|
112
|
+
(n, i) => {
|
|
113
|
+
const { __scopeSelect: e, disabled: c = !1, ...l } = n, a = ue(e), s = j(Me, e), r = s.disabled || c, o = H(i, s.onTriggerChange), d = de(e), [S, y, E] = Qe((m) => {
|
|
114
|
+
const v = d().filter((u) => !u.disabled), I = v.find((u) => u.value === s.value), h = et(v, m, I);
|
|
115
|
+
h !== void 0 && s.onValueChange(h.value);
|
|
116
|
+
}), P = () => {
|
|
117
|
+
r || (s.onOpenChange(!0), E());
|
|
118
|
+
};
|
|
119
|
+
return /* @__PURE__ */ p(ct, { asChild: !0, ...a, children: /* @__PURE__ */ p(
|
|
120
|
+
A.button,
|
|
121
|
+
{
|
|
122
|
+
type: "button",
|
|
123
|
+
role: "combobox",
|
|
124
|
+
"aria-controls": s.contentId,
|
|
125
|
+
"aria-expanded": s.open,
|
|
126
|
+
"aria-required": s.required,
|
|
127
|
+
"aria-autocomplete": "none",
|
|
128
|
+
dir: s.dir,
|
|
129
|
+
"data-state": s.open ? "open" : "closed",
|
|
130
|
+
disabled: r,
|
|
131
|
+
"data-disabled": r ? "" : void 0,
|
|
132
|
+
"data-placeholder": $e(s.value) ? "" : void 0,
|
|
133
|
+
...l,
|
|
134
|
+
ref: o,
|
|
135
|
+
onClick: b(l.onClick, (m) => {
|
|
136
|
+
m.currentTarget.focus();
|
|
137
|
+
}),
|
|
138
|
+
onPointerDown: b(l.onPointerDown, (m) => {
|
|
139
|
+
const v = m.target;
|
|
140
|
+
v.hasPointerCapture(m.pointerId) && v.releasePointerCapture(m.pointerId), m.button === 0 && m.ctrlKey === !1 && (P(), s.triggerPointerDownPosRef.current = {
|
|
141
|
+
x: Math.round(m.pageX),
|
|
142
|
+
y: Math.round(m.pageY)
|
|
143
|
+
}, m.preventDefault());
|
|
144
|
+
}),
|
|
145
|
+
onKeyDown: b(l.onKeyDown, (m) => {
|
|
146
|
+
const v = S.current !== "";
|
|
147
|
+
!(m.ctrlKey || m.altKey || m.metaKey) && m.key.length === 1 && y(m.key), !(v && m.key === " ") && St.includes(m.key) && (P(), m.preventDefault());
|
|
148
|
+
})
|
|
149
|
+
}
|
|
150
|
+
) });
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
Ae.displayName = Me;
|
|
154
|
+
var Oe = "SelectValue", De = t.forwardRef(
|
|
155
|
+
(n, i) => {
|
|
156
|
+
const { __scopeSelect: e, className: c, style: l, children: a, placeholder: s = "", ...r } = n, o = j(Oe, e), { onValueNodeHasChildrenChange: d } = o, S = a !== void 0, y = H(i, o.onValueNodeChange);
|
|
157
|
+
return z(() => {
|
|
158
|
+
d(S);
|
|
159
|
+
}, [d, S]), /* @__PURE__ */ p(
|
|
160
|
+
A.span,
|
|
161
|
+
{
|
|
162
|
+
...r,
|
|
163
|
+
ref: y,
|
|
164
|
+
style: { pointerEvents: "none" },
|
|
165
|
+
children: $e(o.value) ? /* @__PURE__ */ p(Te, { children: s }) : a
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
De.displayName = Oe;
|
|
171
|
+
var Tt = "SelectIcon", Le = t.forwardRef(
|
|
172
|
+
(n, i) => {
|
|
173
|
+
const { __scopeSelect: e, children: c, ...l } = n;
|
|
174
|
+
return /* @__PURE__ */ p(A.span, { "aria-hidden": !0, ...l, ref: i, children: c || "▼" });
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
Le.displayName = Tt;
|
|
178
|
+
var Pt = "SelectPortal", ke = (n) => /* @__PURE__ */ p(ut, { asChild: !0, ...n });
|
|
179
|
+
ke.displayName = Pt;
|
|
180
|
+
var Z = "SelectContent", Be = t.forwardRef(
|
|
181
|
+
(n, i) => {
|
|
182
|
+
const e = j(Z, n.__scopeSelect), [c, l] = t.useState();
|
|
183
|
+
if (z(() => {
|
|
184
|
+
l(new DocumentFragment());
|
|
185
|
+
}, []), !e.open) {
|
|
186
|
+
const a = c;
|
|
187
|
+
return a ? be.createPortal(
|
|
188
|
+
/* @__PURE__ */ p(He, { scope: n.__scopeSelect, children: /* @__PURE__ */ p(ae.Slot, { scope: n.__scopeSelect, children: /* @__PURE__ */ p("div", { children: n.children }) }) }),
|
|
189
|
+
a
|
|
190
|
+
) : null;
|
|
191
|
+
}
|
|
192
|
+
return /* @__PURE__ */ p(Ve, { ...n, ref: i });
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
Be.displayName = Z;
|
|
196
|
+
var W = 10, [He, Y] = ee(Z), Et = "SelectContentImpl", Ve = t.forwardRef(
|
|
197
|
+
(n, i) => {
|
|
198
|
+
const {
|
|
199
|
+
__scopeSelect: e,
|
|
200
|
+
position: c = "item-aligned",
|
|
201
|
+
onCloseAutoFocus: l,
|
|
202
|
+
onEscapeKeyDown: a,
|
|
203
|
+
onPointerDownOutside: s,
|
|
204
|
+
//
|
|
205
|
+
// PopperContent props
|
|
206
|
+
side: r,
|
|
207
|
+
sideOffset: o,
|
|
208
|
+
align: d,
|
|
209
|
+
alignOffset: S,
|
|
210
|
+
arrowPadding: y,
|
|
211
|
+
collisionBoundary: E,
|
|
212
|
+
collisionPadding: P,
|
|
213
|
+
sticky: m,
|
|
214
|
+
hideWhenDetached: v,
|
|
215
|
+
avoidCollisions: I,
|
|
216
|
+
//
|
|
217
|
+
...h
|
|
218
|
+
} = n, u = j(Z, e), [g, F] = t.useState(null), [O, te] = t.useState(null), _ = H(i, (f) => F(f)), [M, q] = t.useState(null), [$, X] = t.useState(
|
|
219
|
+
null
|
|
220
|
+
), D = de(e), [U, K] = t.useState(!1), R = t.useRef(!1);
|
|
221
|
+
t.useEffect(() => {
|
|
222
|
+
if (g) return vt(g);
|
|
223
|
+
}, [g]), st();
|
|
224
|
+
const L = t.useCallback(
|
|
225
|
+
(f) => {
|
|
226
|
+
const [T, ...N] = D().map((C) => C.ref.current), [x] = N.slice(-1), w = document.activeElement;
|
|
227
|
+
for (const C of f)
|
|
228
|
+
if (C === w || (C == null || C.scrollIntoView({ block: "nearest" }), C === T && O && (O.scrollTop = 0), C === x && O && (O.scrollTop = O.scrollHeight), C == null || C.focus(), document.activeElement !== w)) return;
|
|
229
|
+
},
|
|
230
|
+
[D, O]
|
|
231
|
+
), V = t.useCallback(
|
|
232
|
+
() => L([M, g]),
|
|
233
|
+
[L, M, g]
|
|
234
|
+
);
|
|
235
|
+
t.useEffect(() => {
|
|
236
|
+
U && V();
|
|
237
|
+
}, [U, V]);
|
|
238
|
+
const { onOpenChange: J, triggerPointerDownPosRef: G } = u;
|
|
239
|
+
t.useEffect(() => {
|
|
240
|
+
if (g) {
|
|
241
|
+
let f = { x: 0, y: 0 };
|
|
242
|
+
const T = (x) => {
|
|
243
|
+
var w, C, k, B;
|
|
244
|
+
f = {
|
|
245
|
+
x: Math.abs(Math.round(x.pageX) - ((C = (w = G.current) == null ? void 0 : w.x) != null ? C : 0)),
|
|
246
|
+
y: Math.abs(Math.round(x.pageY) - ((B = (k = G.current) == null ? void 0 : k.y) != null ? B : 0))
|
|
247
|
+
};
|
|
248
|
+
}, N = (x) => {
|
|
249
|
+
f.x <= 10 && f.y <= 10 ? x.preventDefault() : g.contains(x.target) || J(!1), document.removeEventListener("pointermove", T), G.current = null;
|
|
250
|
+
};
|
|
251
|
+
return G.current !== null && (document.addEventListener("pointermove", T), document.addEventListener("pointerup", N, { capture: !0, once: !0 })), () => {
|
|
252
|
+
document.removeEventListener("pointermove", T), document.removeEventListener("pointerup", N, { capture: !0 });
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
}, [g, J, G]), t.useEffect(() => {
|
|
256
|
+
const f = () => J(!1);
|
|
257
|
+
return window.addEventListener("blur", f), window.addEventListener("resize", f), () => {
|
|
258
|
+
window.removeEventListener("blur", f), window.removeEventListener("resize", f);
|
|
259
|
+
};
|
|
260
|
+
}, [J]);
|
|
261
|
+
const [pe, se] = Qe((f) => {
|
|
262
|
+
const T = D().filter((w) => !w.disabled), N = T.find((w) => w.ref.current === document.activeElement), x = et(T, f, N);
|
|
263
|
+
x && setTimeout(() => x.ref.current.focus());
|
|
264
|
+
}), fe = t.useCallback(
|
|
265
|
+
(f, T, N) => {
|
|
266
|
+
const x = !R.current && !N;
|
|
267
|
+
(u.value !== void 0 && u.value === T || x) && (q(f), x && (R.current = !0));
|
|
268
|
+
},
|
|
269
|
+
[u.value]
|
|
270
|
+
), me = t.useCallback(() => g == null ? void 0 : g.focus(), [g]), Q = t.useCallback(
|
|
271
|
+
(f, T, N) => {
|
|
272
|
+
const x = !R.current && !N;
|
|
273
|
+
(u.value !== void 0 && u.value === T || x) && X(f);
|
|
274
|
+
},
|
|
275
|
+
[u.value]
|
|
276
|
+
), le = c === "popper" ? Se : We, oe = le === Se ? {
|
|
277
|
+
side: r,
|
|
278
|
+
sideOffset: o,
|
|
279
|
+
align: d,
|
|
280
|
+
alignOffset: S,
|
|
281
|
+
arrowPadding: y,
|
|
282
|
+
collisionBoundary: E,
|
|
283
|
+
collisionPadding: P,
|
|
284
|
+
sticky: m,
|
|
285
|
+
hideWhenDetached: v,
|
|
286
|
+
avoidCollisions: I
|
|
287
|
+
} : {};
|
|
288
|
+
return /* @__PURE__ */ p(
|
|
289
|
+
He,
|
|
290
|
+
{
|
|
291
|
+
scope: e,
|
|
292
|
+
content: g,
|
|
293
|
+
viewport: O,
|
|
294
|
+
onViewportChange: te,
|
|
295
|
+
itemRefCallback: fe,
|
|
296
|
+
selectedItem: M,
|
|
297
|
+
onItemLeave: me,
|
|
298
|
+
itemTextRefCallback: Q,
|
|
299
|
+
focusSelectedItem: V,
|
|
300
|
+
selectedItemText: $,
|
|
301
|
+
position: c,
|
|
302
|
+
isPositioned: U,
|
|
303
|
+
searchRef: pe,
|
|
304
|
+
children: /* @__PURE__ */ p(gt, { as: pt, allowPinchZoom: !0, children: /* @__PURE__ */ p(
|
|
305
|
+
lt,
|
|
306
|
+
{
|
|
307
|
+
asChild: !0,
|
|
308
|
+
trapped: u.open,
|
|
309
|
+
onMountAutoFocus: (f) => {
|
|
310
|
+
f.preventDefault();
|
|
311
|
+
},
|
|
312
|
+
onUnmountAutoFocus: b(l, (f) => {
|
|
313
|
+
var T;
|
|
314
|
+
(T = u.trigger) == null || T.focus({ preventScroll: !0 }), f.preventDefault();
|
|
315
|
+
}),
|
|
316
|
+
children: /* @__PURE__ */ p(
|
|
317
|
+
rt,
|
|
318
|
+
{
|
|
319
|
+
asChild: !0,
|
|
320
|
+
disableOutsidePointerEvents: !0,
|
|
321
|
+
onEscapeKeyDown: a,
|
|
322
|
+
onPointerDownOutside: s,
|
|
323
|
+
onFocusOutside: (f) => f.preventDefault(),
|
|
324
|
+
onDismiss: () => u.onOpenChange(!1),
|
|
325
|
+
children: /* @__PURE__ */ p(
|
|
326
|
+
le,
|
|
327
|
+
{
|
|
328
|
+
role: "listbox",
|
|
329
|
+
id: u.contentId,
|
|
330
|
+
"data-state": u.open ? "open" : "closed",
|
|
331
|
+
dir: u.dir,
|
|
332
|
+
onContextMenu: (f) => f.preventDefault(),
|
|
333
|
+
...h,
|
|
334
|
+
...oe,
|
|
335
|
+
onPlaced: () => K(!0),
|
|
336
|
+
ref: _,
|
|
337
|
+
style: {
|
|
338
|
+
// flex layout so we can place the scroll buttons properly
|
|
339
|
+
display: "flex",
|
|
340
|
+
flexDirection: "column",
|
|
341
|
+
// reset the outline by default as the content MAY get focused
|
|
342
|
+
outline: "none",
|
|
343
|
+
...h.style
|
|
344
|
+
},
|
|
345
|
+
onKeyDown: b(h.onKeyDown, (f) => {
|
|
346
|
+
const T = f.ctrlKey || f.altKey || f.metaKey;
|
|
347
|
+
if (f.key === "Tab" && f.preventDefault(), !T && f.key.length === 1 && se(f.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(f.key)) {
|
|
348
|
+
let x = D().filter((w) => !w.disabled).map((w) => w.ref.current);
|
|
349
|
+
if (["ArrowUp", "End"].includes(f.key) && (x = x.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(f.key)) {
|
|
350
|
+
const w = f.target, C = x.indexOf(w);
|
|
351
|
+
x = x.slice(C + 1);
|
|
352
|
+
}
|
|
353
|
+
setTimeout(() => L(x)), f.preventDefault();
|
|
354
|
+
}
|
|
355
|
+
})
|
|
356
|
+
}
|
|
357
|
+
)
|
|
358
|
+
}
|
|
359
|
+
)
|
|
360
|
+
}
|
|
361
|
+
) })
|
|
362
|
+
}
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
);
|
|
366
|
+
Ve.displayName = Et;
|
|
367
|
+
var Rt = "SelectItemAlignedPosition", We = t.forwardRef((n, i) => {
|
|
368
|
+
const { __scopeSelect: e, onPlaced: c, ...l } = n, a = j(Z, e), s = Y(Z, e), [r, o] = t.useState(null), [d, S] = t.useState(null), y = H(i, (_) => S(_)), E = de(e), P = t.useRef(!1), m = t.useRef(!0), { viewport: v, selectedItem: I, selectedItemText: h, focusSelectedItem: u } = s, g = t.useCallback(() => {
|
|
369
|
+
if (a.trigger && a.valueNode && r && d && v && I && h) {
|
|
370
|
+
const _ = a.trigger.getBoundingClientRect(), M = d.getBoundingClientRect(), q = a.valueNode.getBoundingClientRect(), $ = h.getBoundingClientRect();
|
|
371
|
+
if (a.dir !== "rtl") {
|
|
372
|
+
const w = $.left - M.left, C = q.left - w, k = _.left - C, B = _.width + k, he = Math.max(B, M.width), ve = window.innerWidth - W, ge = Ee(C, [W, ve - he]);
|
|
373
|
+
r.style.minWidth = B + "px", r.style.left = ge + "px";
|
|
374
|
+
} else {
|
|
375
|
+
const w = M.right - $.right, C = window.innerWidth - q.right - w, k = window.innerWidth - _.right - C, B = _.width + k, he = Math.max(B, M.width), ve = window.innerWidth - W, ge = Ee(C, [W, ve - he]);
|
|
376
|
+
r.style.minWidth = B + "px", r.style.right = ge + "px";
|
|
377
|
+
}
|
|
378
|
+
const X = E(), D = window.innerHeight - W * 2, U = v.scrollHeight, K = window.getComputedStyle(d), R = parseInt(K.borderTopWidth, 10), L = parseInt(K.paddingTop, 10), V = parseInt(K.borderBottomWidth, 10), J = parseInt(K.paddingBottom, 10), G = R + L + U + J + V, pe = Math.min(I.offsetHeight * 5, G), se = window.getComputedStyle(v), fe = parseInt(se.paddingTop, 10), me = parseInt(se.paddingBottom, 10), Q = _.top + _.height / 2 - W, le = D - Q, oe = I.offsetHeight / 2, f = I.offsetTop + oe, T = R + L + f, N = G - T;
|
|
379
|
+
if (T <= Q) {
|
|
380
|
+
const w = I === X[X.length - 1].ref.current;
|
|
381
|
+
r.style.bottom = "0px";
|
|
382
|
+
const C = d.clientHeight - v.offsetTop - v.offsetHeight, k = Math.max(
|
|
383
|
+
le,
|
|
384
|
+
oe + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
385
|
+
(w ? me : 0) + C + V
|
|
386
|
+
), B = T + k;
|
|
387
|
+
r.style.height = B + "px";
|
|
388
|
+
} else {
|
|
389
|
+
const w = I === X[0].ref.current;
|
|
390
|
+
r.style.top = "0px";
|
|
391
|
+
const k = Math.max(
|
|
392
|
+
Q,
|
|
393
|
+
R + v.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
394
|
+
(w ? fe : 0) + oe
|
|
395
|
+
) + N;
|
|
396
|
+
r.style.height = k + "px", v.scrollTop = T - Q + v.offsetTop;
|
|
397
|
+
}
|
|
398
|
+
r.style.margin = `${W}px 0`, r.style.minHeight = pe + "px", r.style.maxHeight = D + "px", c == null || c(), requestAnimationFrame(() => P.current = !0);
|
|
399
|
+
}
|
|
400
|
+
}, [
|
|
401
|
+
E,
|
|
402
|
+
a.trigger,
|
|
403
|
+
a.valueNode,
|
|
404
|
+
r,
|
|
405
|
+
d,
|
|
406
|
+
v,
|
|
407
|
+
I,
|
|
408
|
+
h,
|
|
409
|
+
a.dir,
|
|
410
|
+
c
|
|
411
|
+
]);
|
|
412
|
+
z(() => g(), [g]);
|
|
413
|
+
const [F, O] = t.useState();
|
|
414
|
+
z(() => {
|
|
415
|
+
d && O(window.getComputedStyle(d).zIndex);
|
|
416
|
+
}, [d]);
|
|
417
|
+
const te = t.useCallback(
|
|
418
|
+
(_) => {
|
|
419
|
+
_ && m.current === !0 && (g(), u == null || u(), m.current = !1);
|
|
420
|
+
},
|
|
421
|
+
[g, u]
|
|
422
|
+
);
|
|
423
|
+
return /* @__PURE__ */ p(
|
|
424
|
+
_t,
|
|
425
|
+
{
|
|
426
|
+
scope: e,
|
|
427
|
+
contentWrapper: r,
|
|
428
|
+
shouldExpandOnScrollRef: P,
|
|
429
|
+
onScrollButtonChange: te,
|
|
430
|
+
children: /* @__PURE__ */ p(
|
|
431
|
+
"div",
|
|
432
|
+
{
|
|
433
|
+
ref: o,
|
|
434
|
+
style: {
|
|
435
|
+
display: "flex",
|
|
436
|
+
flexDirection: "column",
|
|
437
|
+
position: "fixed",
|
|
438
|
+
zIndex: F
|
|
439
|
+
},
|
|
440
|
+
children: /* @__PURE__ */ p(
|
|
441
|
+
A.div,
|
|
442
|
+
{
|
|
443
|
+
...l,
|
|
444
|
+
ref: y,
|
|
445
|
+
style: {
|
|
446
|
+
// When we get the height of the content, it includes borders. If we were to set
|
|
447
|
+
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
448
|
+
boxSizing: "border-box",
|
|
449
|
+
// We need to ensure the content doesn't get taller than the wrapper
|
|
450
|
+
maxHeight: "100%",
|
|
451
|
+
...l.style
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
)
|
|
455
|
+
}
|
|
456
|
+
)
|
|
457
|
+
}
|
|
458
|
+
);
|
|
459
|
+
});
|
|
460
|
+
We.displayName = Rt;
|
|
461
|
+
var bt = "SelectPopperPosition", Se = t.forwardRef((n, i) => {
|
|
462
|
+
const {
|
|
463
|
+
__scopeSelect: e,
|
|
464
|
+
align: c = "start",
|
|
465
|
+
collisionPadding: l = W,
|
|
466
|
+
...a
|
|
467
|
+
} = n, s = ue(e);
|
|
468
|
+
return /* @__PURE__ */ p(
|
|
469
|
+
it,
|
|
470
|
+
{
|
|
471
|
+
...s,
|
|
472
|
+
...a,
|
|
473
|
+
ref: i,
|
|
474
|
+
align: c,
|
|
475
|
+
collisionPadding: l,
|
|
476
|
+
style: {
|
|
477
|
+
// Ensure border-box for floating-ui calculations
|
|
478
|
+
boxSizing: "border-box",
|
|
479
|
+
...a.style,
|
|
480
|
+
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
481
|
+
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
482
|
+
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
483
|
+
"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
|
|
484
|
+
"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
);
|
|
488
|
+
});
|
|
489
|
+
Se.displayName = bt;
|
|
490
|
+
var [_t, Pe] = ee(Z, {}), we = "SelectViewport", Fe = t.forwardRef(
|
|
491
|
+
(n, i) => {
|
|
492
|
+
const { __scopeSelect: e, nonce: c, ...l } = n, a = Y(we, e), s = Pe(we, e), r = H(i, a.onViewportChange), o = t.useRef(0);
|
|
493
|
+
return /* @__PURE__ */ ce(Te, { children: [
|
|
494
|
+
/* @__PURE__ */ p(
|
|
495
|
+
"style",
|
|
496
|
+
{
|
|
497
|
+
dangerouslySetInnerHTML: {
|
|
498
|
+
__html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
|
|
499
|
+
},
|
|
500
|
+
nonce: c
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
/* @__PURE__ */ p(ae.Slot, { scope: e, children: /* @__PURE__ */ p(
|
|
504
|
+
A.div,
|
|
505
|
+
{
|
|
506
|
+
"data-radix-select-viewport": "",
|
|
507
|
+
role: "presentation",
|
|
508
|
+
...l,
|
|
509
|
+
ref: r,
|
|
510
|
+
style: {
|
|
511
|
+
// we use position: 'relative' here on the `viewport` so that when we call
|
|
512
|
+
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
513
|
+
// (independent of the scrollUpButton).
|
|
514
|
+
position: "relative",
|
|
515
|
+
flex: 1,
|
|
516
|
+
overflow: "auto",
|
|
517
|
+
...l.style
|
|
518
|
+
},
|
|
519
|
+
onScroll: b(l.onScroll, (d) => {
|
|
520
|
+
const S = d.currentTarget, { contentWrapper: y, shouldExpandOnScrollRef: E } = s;
|
|
521
|
+
if (E != null && E.current && y) {
|
|
522
|
+
const P = Math.abs(o.current - S.scrollTop);
|
|
523
|
+
if (P > 0) {
|
|
524
|
+
const m = window.innerHeight - W * 2, v = parseFloat(y.style.minHeight), I = parseFloat(y.style.height), h = Math.max(v, I);
|
|
525
|
+
if (h < m) {
|
|
526
|
+
const u = h + P, g = Math.min(m, u), F = u - g;
|
|
527
|
+
y.style.height = g + "px", y.style.bottom === "0px" && (S.scrollTop = F > 0 ? F : 0, y.style.justifyContent = "flex-end");
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
o.current = S.scrollTop;
|
|
532
|
+
})
|
|
533
|
+
}
|
|
534
|
+
) })
|
|
535
|
+
] });
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
Fe.displayName = we;
|
|
539
|
+
var Ue = "SelectGroup", [Nt, Mt] = ee(Ue), At = t.forwardRef(
|
|
540
|
+
(n, i) => {
|
|
541
|
+
const { __scopeSelect: e, ...c } = n, l = Ie();
|
|
542
|
+
return /* @__PURE__ */ p(Nt, { scope: e, id: l, children: /* @__PURE__ */ p(A.div, { role: "group", "aria-labelledby": l, ...c, ref: i }) });
|
|
543
|
+
}
|
|
544
|
+
);
|
|
545
|
+
At.displayName = Ue;
|
|
546
|
+
var Ke = "SelectLabel", Ot = t.forwardRef(
|
|
547
|
+
(n, i) => {
|
|
548
|
+
const { __scopeSelect: e, ...c } = n, l = Mt(Ke, e);
|
|
549
|
+
return /* @__PURE__ */ p(A.div, { id: l.id, ...c, ref: i });
|
|
550
|
+
}
|
|
551
|
+
);
|
|
552
|
+
Ot.displayName = Ke;
|
|
553
|
+
var ie = "SelectItem", [Dt, Ge] = ee(ie), ze = t.forwardRef(
|
|
554
|
+
(n, i) => {
|
|
555
|
+
const {
|
|
556
|
+
__scopeSelect: e,
|
|
557
|
+
value: c,
|
|
558
|
+
disabled: l = !1,
|
|
559
|
+
textValue: a,
|
|
560
|
+
...s
|
|
561
|
+
} = n, r = j(ie, e), o = Y(ie, e), d = r.value === c, [S, y] = t.useState(a != null ? a : ""), [E, P] = t.useState(!1), m = H(
|
|
562
|
+
i,
|
|
563
|
+
(h) => {
|
|
564
|
+
var u;
|
|
565
|
+
return (u = o.itemRefCallback) == null ? void 0 : u.call(o, h, c, l);
|
|
566
|
+
}
|
|
567
|
+
), v = Ie(), I = () => {
|
|
568
|
+
l || (r.onValueChange(c), r.onOpenChange(!1));
|
|
569
|
+
};
|
|
570
|
+
if (c === "")
|
|
571
|
+
throw new Error(
|
|
572
|
+
"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
|
|
573
|
+
);
|
|
574
|
+
return /* @__PURE__ */ p(
|
|
575
|
+
Dt,
|
|
576
|
+
{
|
|
577
|
+
scope: e,
|
|
578
|
+
value: c,
|
|
579
|
+
disabled: l,
|
|
580
|
+
textId: v,
|
|
581
|
+
isSelected: d,
|
|
582
|
+
onItemTextChange: t.useCallback((h) => {
|
|
583
|
+
y((u) => {
|
|
584
|
+
var g;
|
|
585
|
+
return u || ((g = h == null ? void 0 : h.textContent) != null ? g : "").trim();
|
|
586
|
+
});
|
|
587
|
+
}, []),
|
|
588
|
+
children: /* @__PURE__ */ p(
|
|
589
|
+
ae.ItemSlot,
|
|
590
|
+
{
|
|
591
|
+
scope: e,
|
|
592
|
+
value: c,
|
|
593
|
+
disabled: l,
|
|
594
|
+
textValue: S,
|
|
595
|
+
children: /* @__PURE__ */ p(
|
|
596
|
+
A.div,
|
|
597
|
+
{
|
|
598
|
+
role: "option",
|
|
599
|
+
"aria-labelledby": v,
|
|
600
|
+
"data-highlighted": E ? "" : void 0,
|
|
601
|
+
"aria-selected": d && E,
|
|
602
|
+
"data-state": d ? "checked" : "unchecked",
|
|
603
|
+
"aria-disabled": l || void 0,
|
|
604
|
+
"data-disabled": l ? "" : void 0,
|
|
605
|
+
tabIndex: l ? void 0 : -1,
|
|
606
|
+
...s,
|
|
607
|
+
ref: m,
|
|
608
|
+
onFocus: b(s.onFocus, () => P(!0)),
|
|
609
|
+
onBlur: b(s.onBlur, () => P(!1)),
|
|
610
|
+
onPointerUp: b(s.onPointerUp, I),
|
|
611
|
+
onPointerMove: b(s.onPointerMove, (h) => {
|
|
612
|
+
var u;
|
|
613
|
+
l ? (u = o.onItemLeave) == null || u.call(o) : h.currentTarget.focus({ preventScroll: !0 });
|
|
614
|
+
}),
|
|
615
|
+
onPointerLeave: b(s.onPointerLeave, (h) => {
|
|
616
|
+
var u;
|
|
617
|
+
h.currentTarget === document.activeElement && ((u = o.onItemLeave) == null || u.call(o));
|
|
618
|
+
}),
|
|
619
|
+
onKeyDown: b(s.onKeyDown, (h) => {
|
|
620
|
+
var g;
|
|
621
|
+
((g = o.searchRef) == null ? void 0 : g.current) !== "" && h.key === " " || (wt.includes(h.key) && I(), h.key === " " && h.preventDefault());
|
|
622
|
+
})
|
|
623
|
+
}
|
|
624
|
+
)
|
|
625
|
+
}
|
|
626
|
+
)
|
|
627
|
+
}
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
);
|
|
631
|
+
ze.displayName = ie;
|
|
632
|
+
var ne = "SelectItemText", je = t.forwardRef(
|
|
633
|
+
(n, i) => {
|
|
634
|
+
const { __scopeSelect: e, className: c, style: l, ...a } = n, s = j(ne, e), r = Y(ne, e), o = Ge(ne, e), d = It(ne, e), [S, y] = t.useState(null), E = H(
|
|
635
|
+
i,
|
|
636
|
+
(h) => y(h),
|
|
637
|
+
o.onItemTextChange,
|
|
638
|
+
(h) => {
|
|
639
|
+
var u;
|
|
640
|
+
return (u = r.itemTextRefCallback) == null ? void 0 : u.call(r, h, o.value, o.disabled);
|
|
641
|
+
}
|
|
642
|
+
), P = S == null ? void 0 : S.textContent, m = t.useMemo(
|
|
643
|
+
() => /* @__PURE__ */ p("option", { value: o.value, disabled: o.disabled, children: P }, o.value),
|
|
644
|
+
[o.disabled, o.value, P]
|
|
645
|
+
), { onNativeOptionAdd: v, onNativeOptionRemove: I } = d;
|
|
646
|
+
return z(() => (v(m), () => I(m)), [v, I, m]), /* @__PURE__ */ ce(Te, { children: [
|
|
647
|
+
/* @__PURE__ */ p(A.span, { id: o.textId, ...a, ref: E }),
|
|
648
|
+
o.isSelected && s.valueNode && !s.valueNodeHasChildren ? be.createPortal(a.children, s.valueNode) : null
|
|
649
|
+
] });
|
|
650
|
+
}
|
|
651
|
+
);
|
|
652
|
+
je.displayName = ne;
|
|
653
|
+
var Ye = "SelectItemIndicator", Lt = t.forwardRef(
|
|
654
|
+
(n, i) => {
|
|
655
|
+
const { __scopeSelect: e, ...c } = n;
|
|
656
|
+
return Ge(Ye, e).isSelected ? /* @__PURE__ */ p(A.span, { "aria-hidden": !0, ...c, ref: i }) : null;
|
|
657
|
+
}
|
|
658
|
+
);
|
|
659
|
+
Lt.displayName = Ye;
|
|
660
|
+
var Ce = "SelectScrollUpButton", qe = t.forwardRef((n, i) => {
|
|
661
|
+
const e = Y(Ce, n.__scopeSelect), c = Pe(Ce, n.__scopeSelect), [l, a] = t.useState(!1), s = H(i, c.onScrollButtonChange);
|
|
662
|
+
return z(() => {
|
|
663
|
+
if (e.viewport && e.isPositioned) {
|
|
664
|
+
let r = function() {
|
|
665
|
+
const d = o.scrollTop > 0;
|
|
666
|
+
a(d);
|
|
667
|
+
};
|
|
668
|
+
const o = e.viewport;
|
|
669
|
+
return r(), o.addEventListener("scroll", r), () => o.removeEventListener("scroll", r);
|
|
670
|
+
}
|
|
671
|
+
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ p(
|
|
672
|
+
Ze,
|
|
673
|
+
{
|
|
674
|
+
...n,
|
|
675
|
+
ref: s,
|
|
676
|
+
onAutoScroll: () => {
|
|
677
|
+
const { viewport: r, selectedItem: o } = e;
|
|
678
|
+
r && o && (r.scrollTop = r.scrollTop - o.offsetHeight);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
) : null;
|
|
682
|
+
});
|
|
683
|
+
qe.displayName = Ce;
|
|
684
|
+
var ye = "SelectScrollDownButton", Xe = t.forwardRef((n, i) => {
|
|
685
|
+
const e = Y(ye, n.__scopeSelect), c = Pe(ye, n.__scopeSelect), [l, a] = t.useState(!1), s = H(i, c.onScrollButtonChange);
|
|
686
|
+
return z(() => {
|
|
687
|
+
if (e.viewport && e.isPositioned) {
|
|
688
|
+
let r = function() {
|
|
689
|
+
const d = o.scrollHeight - o.clientHeight, S = Math.ceil(o.scrollTop) < d;
|
|
690
|
+
a(S);
|
|
691
|
+
};
|
|
692
|
+
const o = e.viewport;
|
|
693
|
+
return r(), o.addEventListener("scroll", r), () => o.removeEventListener("scroll", r);
|
|
694
|
+
}
|
|
695
|
+
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ p(
|
|
696
|
+
Ze,
|
|
697
|
+
{
|
|
698
|
+
...n,
|
|
699
|
+
ref: s,
|
|
700
|
+
onAutoScroll: () => {
|
|
701
|
+
const { viewport: r, selectedItem: o } = e;
|
|
702
|
+
r && o && (r.scrollTop = r.scrollTop + o.offsetHeight);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
) : null;
|
|
706
|
+
});
|
|
707
|
+
Xe.displayName = ye;
|
|
708
|
+
var Ze = t.forwardRef((n, i) => {
|
|
709
|
+
const { __scopeSelect: e, onAutoScroll: c, ...l } = n, a = Y("SelectScrollButton", e), s = t.useRef(null), r = de(e), o = t.useCallback(() => {
|
|
710
|
+
s.current !== null && (window.clearInterval(s.current), s.current = null);
|
|
711
|
+
}, []);
|
|
712
|
+
return t.useEffect(() => () => o(), [o]), z(() => {
|
|
713
|
+
var S;
|
|
714
|
+
const d = r().find((y) => y.ref.current === document.activeElement);
|
|
715
|
+
(S = d == null ? void 0 : d.ref.current) == null || S.scrollIntoView({ block: "nearest" });
|
|
716
|
+
}, [r]), /* @__PURE__ */ p(
|
|
717
|
+
A.div,
|
|
718
|
+
{
|
|
719
|
+
"aria-hidden": !0,
|
|
720
|
+
...l,
|
|
721
|
+
ref: i,
|
|
722
|
+
style: { flexShrink: 0, ...l.style },
|
|
723
|
+
onPointerDown: b(l.onPointerDown, () => {
|
|
724
|
+
s.current === null && (s.current = window.setInterval(c, 50));
|
|
725
|
+
}),
|
|
726
|
+
onPointerMove: b(l.onPointerMove, () => {
|
|
727
|
+
var d;
|
|
728
|
+
(d = a.onItemLeave) == null || d.call(a), s.current === null && (s.current = window.setInterval(c, 50));
|
|
729
|
+
}),
|
|
730
|
+
onPointerLeave: b(l.onPointerLeave, () => {
|
|
731
|
+
o();
|
|
732
|
+
})
|
|
733
|
+
}
|
|
734
|
+
);
|
|
735
|
+
}), kt = "SelectSeparator", Bt = t.forwardRef(
|
|
736
|
+
(n, i) => {
|
|
737
|
+
const { __scopeSelect: e, ...c } = n;
|
|
738
|
+
return /* @__PURE__ */ p(A.div, { "aria-hidden": !0, ...c, ref: i });
|
|
739
|
+
}
|
|
740
|
+
);
|
|
741
|
+
Bt.displayName = kt;
|
|
742
|
+
var xe = "SelectArrow", Ht = t.forwardRef(
|
|
743
|
+
(n, i) => {
|
|
744
|
+
const { __scopeSelect: e, ...c } = n, l = ue(e), a = j(xe, e), s = Y(xe, e);
|
|
745
|
+
return a.open && s.position === "popper" ? /* @__PURE__ */ p(at, { ...l, ...c, ref: i }) : null;
|
|
746
|
+
}
|
|
747
|
+
);
|
|
748
|
+
Ht.displayName = xe;
|
|
749
|
+
function $e(n) {
|
|
750
|
+
return n === "" || n === void 0;
|
|
751
|
+
}
|
|
752
|
+
var Je = t.forwardRef(
|
|
753
|
+
(n, i) => {
|
|
754
|
+
const { value: e, ...c } = n, l = t.useRef(null), a = H(i, l), s = mt(e);
|
|
755
|
+
return t.useEffect(() => {
|
|
756
|
+
const r = l.current, o = window.HTMLSelectElement.prototype, S = Object.getOwnPropertyDescriptor(
|
|
757
|
+
o,
|
|
758
|
+
"value"
|
|
759
|
+
).set;
|
|
760
|
+
if (s !== e && S) {
|
|
761
|
+
const y = new Event("change", { bubbles: !0 });
|
|
762
|
+
S.call(r, e), r.dispatchEvent(y);
|
|
763
|
+
}
|
|
764
|
+
}, [s, e]), /* @__PURE__ */ p(ht, { asChild: !0, children: /* @__PURE__ */ p("select", { ...c, ref: a, defaultValue: e }) });
|
|
765
|
+
}
|
|
766
|
+
);
|
|
767
|
+
Je.displayName = "BubbleSelect";
|
|
768
|
+
function Qe(n) {
|
|
769
|
+
const i = ft(n), e = t.useRef(""), c = t.useRef(0), l = t.useCallback(
|
|
770
|
+
(s) => {
|
|
771
|
+
const r = e.current + s;
|
|
772
|
+
i(r), function o(d) {
|
|
773
|
+
e.current = d, window.clearTimeout(c.current), d !== "" && (c.current = window.setTimeout(() => o(""), 1e3));
|
|
774
|
+
}(r);
|
|
775
|
+
},
|
|
776
|
+
[i]
|
|
777
|
+
), a = t.useCallback(() => {
|
|
778
|
+
e.current = "", window.clearTimeout(c.current);
|
|
779
|
+
}, []);
|
|
780
|
+
return t.useEffect(() => () => window.clearTimeout(c.current), []), [e, l, a];
|
|
781
|
+
}
|
|
782
|
+
function et(n, i, e) {
|
|
783
|
+
const l = i.length > 1 && Array.from(i).every((d) => d === i[0]) ? i[0] : i, a = e ? n.indexOf(e) : -1;
|
|
784
|
+
let s = Vt(n, Math.max(a, 0));
|
|
785
|
+
l.length === 1 && (s = s.filter((d) => d !== e));
|
|
786
|
+
const o = s.find(
|
|
787
|
+
(d) => d.textValue.toLowerCase().startsWith(l.toLowerCase())
|
|
788
|
+
);
|
|
789
|
+
return o !== e ? o : void 0;
|
|
790
|
+
}
|
|
791
|
+
function Vt(n, i) {
|
|
792
|
+
return n.map((e, c) => n[(i + c) % n.length]);
|
|
793
|
+
}
|
|
794
|
+
var ao = Ne, uo = Ae, po = De, fo = Le, mo = ke, ho = Be, vo = Fe, go = ze, So = je, wo = qe, Co = Xe;
|
|
795
|
+
export {
|
|
796
|
+
ho as Content,
|
|
797
|
+
fo as Icon,
|
|
798
|
+
go as Item,
|
|
799
|
+
So as ItemText,
|
|
800
|
+
mo as Portal,
|
|
801
|
+
ao as Root,
|
|
802
|
+
Co as ScrollDownButton,
|
|
803
|
+
wo as ScrollUpButton,
|
|
804
|
+
Ne as Select,
|
|
805
|
+
Ht as SelectArrow,
|
|
806
|
+
Be as SelectContent,
|
|
807
|
+
At as SelectGroup,
|
|
808
|
+
Le as SelectIcon,
|
|
809
|
+
ze as SelectItem,
|
|
810
|
+
Lt as SelectItemIndicator,
|
|
811
|
+
je as SelectItemText,
|
|
812
|
+
Ot as SelectLabel,
|
|
813
|
+
ke as SelectPortal,
|
|
814
|
+
Xe as SelectScrollDownButton,
|
|
815
|
+
qe as SelectScrollUpButton,
|
|
816
|
+
Bt as SelectSeparator,
|
|
817
|
+
Ae as SelectTrigger,
|
|
818
|
+
De as SelectValue,
|
|
819
|
+
Fe as SelectViewport,
|
|
820
|
+
uo as Trigger,
|
|
821
|
+
po as Value,
|
|
822
|
+
vo as Viewport,
|
|
823
|
+
io as createSelectScope
|
|
824
|
+
};
|