fansunited-widgets-cdn 0.0.84 → 0.0.86-RC1
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/chunks/Alert-CuOsmojH.js +149 -0
- package/chunks/AspectRatio-D3Sgxj7p.js +125 -0
- package/chunks/Avatar-BTsEKfhc.js +186 -0
- package/chunks/Button-BV7YIFkS.js +858 -0
- package/chunks/Card-DRIT0wtY.js +129 -0
- package/chunks/CardContent-CD-WZh1l.js +60 -0
- package/chunks/ChevronRight-BrCKlr3T.js +11 -0
- package/chunks/Chip-6HLNTHMI.js +281 -0
- package/chunks/ClassicQuizWrapper-t04e9_6c.js +4883 -0
- package/chunks/CollectLeadForm-DtmR2Vuf-B_3JkHJC.js +1560 -0
- package/chunks/CollectLeadWrapper-CVAVswua.js +1294 -0
- package/chunks/DialogActions-C5kAgHal.js +45 -0
- package/chunks/DialogContent-MIXff4nd.js +60 -0
- package/chunks/EitherOrById-CAo8gPjm.js +1496 -0
- package/chunks/EitherOrPreviewWrapper-DFi2bviS.js +47 -0
- package/chunks/Error-DhQL89pn-BwTV1meb.js +418 -0
- package/chunks/EventGameWrapper-BxyLL3eA.js +7633 -0
- package/chunks/Grid-Dpv_ZL23.js +279 -0
- package/chunks/IconButton-Lt9Xks7c.js +207 -0
- package/chunks/Link-DLuj1USf.js +228 -0
- package/chunks/List-DLPlZGTP.js +397 -0
- package/chunks/ListItemDecorator-CE2eQLip.js +1882 -0
- package/chunks/MatchPredictionContainer-Ct6gXvLw.js +751 -0
- package/chunks/MatchQuizWrapper-Fu6RfWVn.js +11046 -0
- package/chunks/ModalDialog-Ci3hulZA.js +619 -0
- package/chunks/NotFoundSkeleton-BYJTzYJR-Be3R34nS.js +2764 -0
- package/chunks/OverlayLeadAfterCollection-DnqztPJ5-CpELr0AC.js +896 -0
- package/chunks/OverlayScoreStateSkeleton-C9FUhcnd-DMFELrvA.js +146 -0
- package/chunks/PersonalityQuizWrapper-MpUK4n3Y.js +34374 -0
- package/chunks/PlayerOfTheMatch-D4vuR7pz.js +1406 -0
- package/chunks/PollWrapper-CzKj8xxE.js +4198 -0
- package/chunks/Portal-BWqqFvVm-TuHZWjxn.js +12717 -0
- package/chunks/Portal-DA1mxzSo.js +41 -0
- package/chunks/PreviewQuizById-WWS_LyJR.js +4864 -0
- package/chunks/Select-p_cHpLhi.js +3418 -0
- package/chunks/Sheet-BaCzogZK.js +167 -0
- package/chunks/Snackbar-DHxnbCA3.js +358 -0
- package/chunks/Stack-Dgf2LXN0.js +117 -0
- package/chunks/Tabs-CSu_cWNi.js +784 -0
- package/chunks/TeamNextMatchPrediction-C7HilNqW.js +6 -0
- package/chunks/Tutorial-DFNZxmAx.js +427 -0
- package/chunks/createLucideIcon-B6NxpYkb.js +79 -0
- package/chunks/createSvgIcon-7h7XC877.js +119 -0
- package/chunks/createSvgIcon-DVA0KIUd.js +2490 -0
- package/chunks/dataAttributeParser-CF9vxaVN.js +28 -0
- package/chunks/default-quiz-bg-CTzaADn7.js +4 -0
- package/chunks/getReactElementRef-BD-S8A24.js +25 -0
- package/chunks/index-24AwmTVJ.js +85 -0
- package/chunks/index-3vJS8JzK.js +63 -0
- package/chunks/index-BSD7mvEU.js +57 -0
- package/chunks/index-BU6iona7.js +57 -0
- package/chunks/index-BqCHiyI6.js +59 -0
- package/chunks/index-C5qRf4TV.js +20 -0
- package/chunks/index-C9MpfjqV.js +35 -0
- package/chunks/index-CMmQs5A5.js +56 -0
- package/chunks/index-CicEY2Jv.js +5 -0
- package/chunks/index-DNeawo0R.js +17 -0
- package/chunks/index-DePIySlY.js +29 -0
- package/chunks/index-DoRYU_1L.js +41 -0
- package/chunks/index-DvgG9XJj.js +20 -0
- package/chunks/index-QpZE-92Y.js +33 -0
- package/chunks/index-rgFj976B.js +17 -0
- package/chunks/index-tzsdMoo-.js +16 -0
- package/chunks/index.es-CHqz6mjo.js +6162 -0
- package/chunks/init-BEkECL0v.js +32 -0
- package/chunks/main-XP7dqk6g.js +39843 -0
- package/chunks/resolveProps-BfYZubfk.js +37 -0
- package/chunks/users-D_xgC4iQ.js +16 -0
- package/chunks/variantColorInheritance-DI3wUohX.js +28 -0
- package/fu-widgets-loader.es.js +76 -0
- package/fu-widgets-loader.js +1 -0
- package/fu-widgets.es.js +4 -0
- package/fu-widgets.iife.js +621 -682
- package/manifest.json +84 -0
- package/package.json +9 -2
|
@@ -0,0 +1,1882 @@
|
|
|
1
|
+
import { r as u, a0 as Pt, a1 as qt, w as i, v as he, _ as Q, x as R, y as O, E as $e, j as m, z as ne, D as xe, F as Ae, G as Ie, Z as Et } from "./main-XP7dqk6g.js";
|
|
2
|
+
import { c as Ot } from "./createSvgIcon-7h7XC877.js";
|
|
3
|
+
import { u as Bt, g as Ee, V as Gt } from "./variantColorInheritance-DI3wUohX.js";
|
|
4
|
+
import { S as Dt } from "./IconButton-Lt9Xks7c.js";
|
|
5
|
+
import { b as Ct, G as Kt, C as Yt, R as Xt, W as Zt, N as $t, g as Qt, l as St, d as eo, s as to, e as oo, f as ro, F as kt, h as no, P as so, L as lo, i as io, j as ao, k as co, m as uo, n as po } from "./Select-p_cHpLhi.js";
|
|
6
|
+
import { u as st } from "./getReactElementRef-BD-S8A24.js";
|
|
7
|
+
import { a as mo, C as fo } from "./Chip-6HLNTHMI.js";
|
|
8
|
+
import { i as go, u as vo, I as bo } from "./Button-BV7YIFkS.js";
|
|
9
|
+
const ho = (e) => {
|
|
10
|
+
const t = u.useRef({});
|
|
11
|
+
return u.useEffect(() => {
|
|
12
|
+
t.current = e;
|
|
13
|
+
}), t.current;
|
|
14
|
+
};
|
|
15
|
+
function zt(e) {
|
|
16
|
+
return typeof e.normalize < "u" ? e.normalize("NFD").replace(/[\u0300-\u036f]/g, "") : e;
|
|
17
|
+
}
|
|
18
|
+
function xo(e = {}) {
|
|
19
|
+
const {
|
|
20
|
+
ignoreAccents: t = !0,
|
|
21
|
+
ignoreCase: l = !0,
|
|
22
|
+
limit: n,
|
|
23
|
+
matchFrom: d = "any",
|
|
24
|
+
stringify: f,
|
|
25
|
+
trim: y = !1
|
|
26
|
+
} = e;
|
|
27
|
+
return (L, {
|
|
28
|
+
inputValue: C,
|
|
29
|
+
getOptionLabel: h
|
|
30
|
+
}) => {
|
|
31
|
+
let g = y ? C.trim() : C;
|
|
32
|
+
l && (g = g.toLowerCase()), t && (g = zt(g));
|
|
33
|
+
const D = g ? L.filter((T) => {
|
|
34
|
+
let x = (f || h)(T);
|
|
35
|
+
return l && (x = x.toLowerCase()), t && (x = zt(x)), d === "start" ? x.indexOf(g) === 0 : x.indexOf(g) > -1;
|
|
36
|
+
}) : L;
|
|
37
|
+
return typeof n == "number" ? D.slice(0, n) : D;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function lt(e, t) {
|
|
41
|
+
for (let l = 0; l < e.length; l += 1)
|
|
42
|
+
if (t(e[l]))
|
|
43
|
+
return l;
|
|
44
|
+
return -1;
|
|
45
|
+
}
|
|
46
|
+
const Io = xo(), Ft = 5, yo = (e) => {
|
|
47
|
+
var t;
|
|
48
|
+
return e.current !== null && ((t = e.current.parentElement) == null ? void 0 : t.contains(document.activeElement));
|
|
49
|
+
}, Lo = [];
|
|
50
|
+
function Co(e) {
|
|
51
|
+
const {
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
53
|
+
unstable_isActiveElementInListbox: t = yo,
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
55
|
+
unstable_classNamePrefix: l = "Mui",
|
|
56
|
+
autoComplete: n = !1,
|
|
57
|
+
autoHighlight: d = !1,
|
|
58
|
+
autoSelect: f = !1,
|
|
59
|
+
blurOnSelect: y = !1,
|
|
60
|
+
clearOnBlur: L = !e.freeSolo,
|
|
61
|
+
clearOnEscape: C = !1,
|
|
62
|
+
componentName: h = "useAutocomplete",
|
|
63
|
+
defaultValue: g = e.multiple ? Lo : null,
|
|
64
|
+
disableClearable: D = !1,
|
|
65
|
+
disableCloseOnSelect: T = !1,
|
|
66
|
+
disabled: x,
|
|
67
|
+
disabledItemsFocusable: k = !1,
|
|
68
|
+
disableListWrap: z = !1,
|
|
69
|
+
filterOptions: A = Io,
|
|
70
|
+
filterSelectedOptions: F = !1,
|
|
71
|
+
freeSolo: H = !1,
|
|
72
|
+
getOptionDisabled: _,
|
|
73
|
+
getOptionKey: J,
|
|
74
|
+
getOptionLabel: se = (r) => {
|
|
75
|
+
var o;
|
|
76
|
+
return (o = r.label) != null ? o : r;
|
|
77
|
+
},
|
|
78
|
+
groupBy: ee,
|
|
79
|
+
handleHomeEndKeys: ce = !e.freeSolo,
|
|
80
|
+
id: ue,
|
|
81
|
+
includeInputInList: me = !1,
|
|
82
|
+
inputValue: ye,
|
|
83
|
+
isOptionEqualToValue: U = (r, o) => r === o,
|
|
84
|
+
multiple: b = !1,
|
|
85
|
+
onChange: pe,
|
|
86
|
+
onClose: fe,
|
|
87
|
+
onHighlightChange: Le,
|
|
88
|
+
onInputChange: E,
|
|
89
|
+
onOpen: ze,
|
|
90
|
+
open: Fe,
|
|
91
|
+
openOnFocus: Be = !1,
|
|
92
|
+
options: Me,
|
|
93
|
+
readOnly: G = !1,
|
|
94
|
+
selectOnFocus: je = !e.freeSolo,
|
|
95
|
+
value: _e
|
|
96
|
+
} = e, K = Pt(ue);
|
|
97
|
+
let W = se;
|
|
98
|
+
W = (r) => {
|
|
99
|
+
const o = se(r);
|
|
100
|
+
return typeof o != "string" ? String(o) : o;
|
|
101
|
+
};
|
|
102
|
+
const Ve = u.useRef(!1), we = u.useRef(!0), M = u.useRef(null), te = u.useRef(null), [Y, at] = u.useState(null), [oe, Je] = u.useState(-1), Ge = d ? 0 : -1, S = u.useRef(Ge), [a, Ce] = Ct({
|
|
103
|
+
controlled: _e,
|
|
104
|
+
default: g,
|
|
105
|
+
name: h
|
|
106
|
+
}), [v, le] = Ct({
|
|
107
|
+
controlled: ye,
|
|
108
|
+
default: "",
|
|
109
|
+
name: h,
|
|
110
|
+
state: "inputValue"
|
|
111
|
+
}), [Re, We] = u.useState(!1), Ne = u.useCallback((r, o) => {
|
|
112
|
+
if (!(b ? a.length < o.length : o !== null) && !L)
|
|
113
|
+
return;
|
|
114
|
+
let c;
|
|
115
|
+
if (b)
|
|
116
|
+
c = "";
|
|
117
|
+
else if (o == null)
|
|
118
|
+
c = "";
|
|
119
|
+
else {
|
|
120
|
+
const I = W(o);
|
|
121
|
+
c = typeof I == "string" ? I : "";
|
|
122
|
+
}
|
|
123
|
+
v !== c && (le(c), E && E(r, c, "reset"));
|
|
124
|
+
}, [W, v, b, E, le, L, a]), [Se, Ke] = Ct({
|
|
125
|
+
controlled: Fe,
|
|
126
|
+
default: !1,
|
|
127
|
+
name: h,
|
|
128
|
+
state: "open"
|
|
129
|
+
}), [ct, Ye] = u.useState(!0), Te = !b && a != null && v === W(a), X = Se && !G, P = X ? A(
|
|
130
|
+
Me.filter((r) => !(F && (b ? a : [a]).some((o) => o !== null && U(r, o)))),
|
|
131
|
+
// we use the empty string to manipulate `filterOptions` to not filter any options
|
|
132
|
+
// i.e. the filter predicate always returns true
|
|
133
|
+
{
|
|
134
|
+
inputValue: Te && ct ? "" : v,
|
|
135
|
+
getOptionLabel: W
|
|
136
|
+
}
|
|
137
|
+
) : [], re = ho({
|
|
138
|
+
filteredOptions: P,
|
|
139
|
+
value: a,
|
|
140
|
+
inputValue: v
|
|
141
|
+
});
|
|
142
|
+
u.useEffect(() => {
|
|
143
|
+
const r = a !== re.value;
|
|
144
|
+
Re && !r || H && !r || Ne(null, a);
|
|
145
|
+
}, [a, Ne, Re, re.value, H]);
|
|
146
|
+
const Ue = Se && P.length > 0 && !G, ve = st((r) => {
|
|
147
|
+
r === -1 ? M.current.focus() : Y.querySelector(`[data-tag-index="${r}"]`).focus();
|
|
148
|
+
});
|
|
149
|
+
u.useEffect(() => {
|
|
150
|
+
b && oe > a.length - 1 && (Je(-1), ve(-1));
|
|
151
|
+
}, [a, b, oe, ve]);
|
|
152
|
+
function ut(r, o) {
|
|
153
|
+
if (!te.current || r < 0 || r >= P.length)
|
|
154
|
+
return -1;
|
|
155
|
+
let s = r;
|
|
156
|
+
for (; ; ) {
|
|
157
|
+
const c = te.current.querySelector(`[data-option-index="${s}"]`), I = k ? !1 : !c || c.disabled || c.getAttribute("aria-disabled") === "true";
|
|
158
|
+
if (c && c.hasAttribute("tabindex") && !I)
|
|
159
|
+
return s;
|
|
160
|
+
if (o === "next" ? s = (s + 1) % P.length : s = (s - 1 + P.length) % P.length, s === r)
|
|
161
|
+
return -1;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const be = st(({
|
|
165
|
+
event: r,
|
|
166
|
+
index: o,
|
|
167
|
+
reason: s = "auto"
|
|
168
|
+
}) => {
|
|
169
|
+
if (S.current = o, o === -1 ? M.current.removeAttribute("aria-activedescendant") : M.current.setAttribute("aria-activedescendant", `${K}-option-${o}`), Le && Le(r, o === -1 ? null : P[o], s), !te.current)
|
|
170
|
+
return;
|
|
171
|
+
const c = te.current.querySelector(`[role="option"].${l}-focused`);
|
|
172
|
+
c && (c.classList.remove(`${l}-focused`), c.classList.remove(`${l}-focusVisible`));
|
|
173
|
+
let I = te.current;
|
|
174
|
+
if (te.current.getAttribute("role") !== "listbox" && (I = te.current.parentElement.querySelector('[role="listbox"]')), !I)
|
|
175
|
+
return;
|
|
176
|
+
if (o === -1) {
|
|
177
|
+
I.scrollTop = 0;
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const $ = te.current.querySelector(`[data-option-index="${o}"]`);
|
|
181
|
+
if ($ && ($.classList.add(`${l}-focused`), s === "keyboard" && $.classList.add(`${l}-focusVisible`), I.scrollHeight > I.clientHeight && s !== "mouse" && s !== "touch")) {
|
|
182
|
+
const N = $, ie = I.clientHeight + I.scrollTop, nt = N.offsetTop + N.offsetHeight;
|
|
183
|
+
nt > ie ? I.scrollTop = nt - I.clientHeight : N.offsetTop - N.offsetHeight * (ee ? 1.3 : 0) < I.scrollTop && (I.scrollTop = N.offsetTop - N.offsetHeight * (ee ? 1.3 : 0));
|
|
184
|
+
}
|
|
185
|
+
}), Z = st(({
|
|
186
|
+
event: r,
|
|
187
|
+
diff: o,
|
|
188
|
+
direction: s = "next",
|
|
189
|
+
reason: c = "auto"
|
|
190
|
+
}) => {
|
|
191
|
+
if (!X)
|
|
192
|
+
return;
|
|
193
|
+
const $ = ut((() => {
|
|
194
|
+
const N = P.length - 1;
|
|
195
|
+
if (o === "reset")
|
|
196
|
+
return Ge;
|
|
197
|
+
if (o === "start")
|
|
198
|
+
return 0;
|
|
199
|
+
if (o === "end")
|
|
200
|
+
return N;
|
|
201
|
+
const ie = S.current + o;
|
|
202
|
+
return ie < 0 ? ie === -1 && me ? -1 : z && S.current !== -1 || Math.abs(o) > 1 ? 0 : N : ie > N ? ie === N + 1 && me ? -1 : z || Math.abs(o) > 1 ? N : 0 : ie;
|
|
203
|
+
})(), s);
|
|
204
|
+
if (be({
|
|
205
|
+
index: $,
|
|
206
|
+
reason: c,
|
|
207
|
+
event: r
|
|
208
|
+
}), n && o !== "reset")
|
|
209
|
+
if ($ === -1)
|
|
210
|
+
M.current.value = v;
|
|
211
|
+
else {
|
|
212
|
+
const N = W(P[$]);
|
|
213
|
+
M.current.value = N, N.toLowerCase().indexOf(v.toLowerCase()) === 0 && v.length > 0 && M.current.setSelectionRange(v.length, N.length);
|
|
214
|
+
}
|
|
215
|
+
}), Xe = () => {
|
|
216
|
+
const r = (o, s) => {
|
|
217
|
+
const c = o ? W(o) : "", I = s ? W(s) : "";
|
|
218
|
+
return c === I;
|
|
219
|
+
};
|
|
220
|
+
if (S.current !== -1 && re.filteredOptions && re.filteredOptions.length !== P.length && re.inputValue === v && (b ? a.length === re.value.length && re.value.every((o, s) => W(a[s]) === W(o)) : r(re.value, a))) {
|
|
221
|
+
const o = re.filteredOptions[S.current];
|
|
222
|
+
if (o)
|
|
223
|
+
return lt(P, (s) => W(s) === W(o));
|
|
224
|
+
}
|
|
225
|
+
return -1;
|
|
226
|
+
}, He = u.useCallback(() => {
|
|
227
|
+
if (!X)
|
|
228
|
+
return;
|
|
229
|
+
const r = Xe();
|
|
230
|
+
if (r !== -1) {
|
|
231
|
+
S.current = r;
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const o = b ? a[0] : a;
|
|
235
|
+
if (P.length === 0 || o == null) {
|
|
236
|
+
Z({
|
|
237
|
+
diff: "reset"
|
|
238
|
+
});
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (te.current) {
|
|
242
|
+
if (o != null) {
|
|
243
|
+
const s = P[S.current];
|
|
244
|
+
if (b && s && lt(a, (I) => U(s, I)) !== -1)
|
|
245
|
+
return;
|
|
246
|
+
const c = lt(P, (I) => U(I, o));
|
|
247
|
+
c === -1 ? Z({
|
|
248
|
+
diff: "reset"
|
|
249
|
+
}) : be({
|
|
250
|
+
index: c
|
|
251
|
+
});
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (S.current >= P.length - 1) {
|
|
255
|
+
be({
|
|
256
|
+
index: P.length - 1
|
|
257
|
+
});
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
be({
|
|
261
|
+
index: S.current
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}, [
|
|
265
|
+
// Only sync the highlighted index when the option switch between empty and not
|
|
266
|
+
P.length,
|
|
267
|
+
// Don't sync the highlighted index with the value when multiple
|
|
268
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
269
|
+
b ? !1 : a,
|
|
270
|
+
F,
|
|
271
|
+
Z,
|
|
272
|
+
be,
|
|
273
|
+
X,
|
|
274
|
+
v,
|
|
275
|
+
b
|
|
276
|
+
]), Ze = st((r) => {
|
|
277
|
+
qt(te, r), r && He();
|
|
278
|
+
});
|
|
279
|
+
u.useEffect(() => {
|
|
280
|
+
He();
|
|
281
|
+
}, [He]);
|
|
282
|
+
const ge = (r) => {
|
|
283
|
+
Se || (Ke(!0), Ye(!0), ze && ze(r));
|
|
284
|
+
}, w = (r, o) => {
|
|
285
|
+
Se && (Ke(!1), fe && fe(r, o));
|
|
286
|
+
}, B = (r, o, s, c) => {
|
|
287
|
+
if (b) {
|
|
288
|
+
if (a.length === o.length && a.every((I, $) => I === o[$]))
|
|
289
|
+
return;
|
|
290
|
+
} else if (a === o)
|
|
291
|
+
return;
|
|
292
|
+
pe && pe(r, o, s, c), Ce(o);
|
|
293
|
+
}, V = u.useRef(!1), q = (r, o, s = "selectOption", c = "options") => {
|
|
294
|
+
let I = s, $ = o;
|
|
295
|
+
if (b) {
|
|
296
|
+
$ = Array.isArray(a) ? a.slice() : [];
|
|
297
|
+
const N = lt($, (ie) => U(o, ie));
|
|
298
|
+
N === -1 ? $.push(o) : c !== "freeSolo" && ($.splice(N, 1), I = "removeOption");
|
|
299
|
+
}
|
|
300
|
+
Ne(r, $), B(r, $, I, {
|
|
301
|
+
option: o
|
|
302
|
+
}), !T && (!r || !r.ctrlKey && !r.metaKey) && w(r, I), (y === !0 || y === "touch" && V.current || y === "mouse" && !V.current) && M.current.blur();
|
|
303
|
+
};
|
|
304
|
+
function pt(r, o) {
|
|
305
|
+
if (r === -1)
|
|
306
|
+
return -1;
|
|
307
|
+
let s = r;
|
|
308
|
+
for (; ; ) {
|
|
309
|
+
if (o === "next" && s === a.length || o === "previous" && s === -1)
|
|
310
|
+
return -1;
|
|
311
|
+
const c = Y.querySelector(`[data-tag-index="${s}"]`);
|
|
312
|
+
if (!c || !c.hasAttribute("tabindex") || c.disabled || c.getAttribute("aria-disabled") === "true")
|
|
313
|
+
s += o === "next" ? 1 : -1;
|
|
314
|
+
else
|
|
315
|
+
return s;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
const Qe = (r, o) => {
|
|
319
|
+
if (!b)
|
|
320
|
+
return;
|
|
321
|
+
v === "" && w(r, "toggleInput");
|
|
322
|
+
let s = oe;
|
|
323
|
+
oe === -1 ? v === "" && o === "previous" && (s = a.length - 1) : (s += o === "next" ? 1 : -1, s < 0 && (s = 0), s === a.length && (s = -1)), s = pt(s, o), Je(s), ve(s);
|
|
324
|
+
}, et = (r) => {
|
|
325
|
+
Ve.current = !0, le(""), E && E(r, "", "clear"), B(r, b ? [] : null, "clear");
|
|
326
|
+
}, dt = (r) => (o) => {
|
|
327
|
+
if (r.onKeyDown && r.onKeyDown(o), !o.defaultMuiPrevented && (oe !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(o.key) === -1 && (Je(-1), ve(-1)), o.which !== 229))
|
|
328
|
+
switch (o.key) {
|
|
329
|
+
case "Home":
|
|
330
|
+
X && ce && (o.preventDefault(), Z({
|
|
331
|
+
diff: "start",
|
|
332
|
+
direction: "next",
|
|
333
|
+
reason: "keyboard",
|
|
334
|
+
event: o
|
|
335
|
+
}));
|
|
336
|
+
break;
|
|
337
|
+
case "End":
|
|
338
|
+
X && ce && (o.preventDefault(), Z({
|
|
339
|
+
diff: "end",
|
|
340
|
+
direction: "previous",
|
|
341
|
+
reason: "keyboard",
|
|
342
|
+
event: o
|
|
343
|
+
}));
|
|
344
|
+
break;
|
|
345
|
+
case "PageUp":
|
|
346
|
+
o.preventDefault(), Z({
|
|
347
|
+
diff: -Ft,
|
|
348
|
+
direction: "previous",
|
|
349
|
+
reason: "keyboard",
|
|
350
|
+
event: o
|
|
351
|
+
}), ge(o);
|
|
352
|
+
break;
|
|
353
|
+
case "PageDown":
|
|
354
|
+
o.preventDefault(), Z({
|
|
355
|
+
diff: Ft,
|
|
356
|
+
direction: "next",
|
|
357
|
+
reason: "keyboard",
|
|
358
|
+
event: o
|
|
359
|
+
}), ge(o);
|
|
360
|
+
break;
|
|
361
|
+
case "ArrowDown":
|
|
362
|
+
o.preventDefault(), Z({
|
|
363
|
+
diff: 1,
|
|
364
|
+
direction: "next",
|
|
365
|
+
reason: "keyboard",
|
|
366
|
+
event: o
|
|
367
|
+
}), ge(o);
|
|
368
|
+
break;
|
|
369
|
+
case "ArrowUp":
|
|
370
|
+
o.preventDefault(), Z({
|
|
371
|
+
diff: -1,
|
|
372
|
+
direction: "previous",
|
|
373
|
+
reason: "keyboard",
|
|
374
|
+
event: o
|
|
375
|
+
}), ge(o);
|
|
376
|
+
break;
|
|
377
|
+
case "ArrowLeft":
|
|
378
|
+
Qe(o, "previous");
|
|
379
|
+
break;
|
|
380
|
+
case "ArrowRight":
|
|
381
|
+
Qe(o, "next");
|
|
382
|
+
break;
|
|
383
|
+
case "Enter":
|
|
384
|
+
if (S.current !== -1 && X) {
|
|
385
|
+
const s = P[S.current], c = _ ? _(s) : !1;
|
|
386
|
+
if (o.preventDefault(), c)
|
|
387
|
+
return;
|
|
388
|
+
q(o, s, "selectOption"), n && M.current.setSelectionRange(M.current.value.length, M.current.value.length);
|
|
389
|
+
} else H && v !== "" && Te === !1 && (b && o.preventDefault(), q(o, v, "createOption", "freeSolo"));
|
|
390
|
+
break;
|
|
391
|
+
case "Escape":
|
|
392
|
+
X ? (o.preventDefault(), o.stopPropagation(), w(o, "escape")) : C && (v !== "" || b && a.length > 0) && (o.preventDefault(), o.stopPropagation(), et(o));
|
|
393
|
+
break;
|
|
394
|
+
case "Backspace":
|
|
395
|
+
if (b && !G && v === "" && a.length > 0) {
|
|
396
|
+
const s = oe === -1 ? a.length - 1 : oe, c = a.slice();
|
|
397
|
+
c.splice(s, 1), B(o, c, "removeOption", {
|
|
398
|
+
option: a[s]
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
break;
|
|
402
|
+
case "Delete":
|
|
403
|
+
if (b && !G && v === "" && a.length > 0 && oe !== -1) {
|
|
404
|
+
const s = oe, c = a.slice();
|
|
405
|
+
c.splice(s, 1), B(o, c, "removeOption", {
|
|
406
|
+
option: a[s]
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
}, mt = (r) => {
|
|
412
|
+
We(!0), Be && !Ve.current && ge(r);
|
|
413
|
+
}, tt = (r) => {
|
|
414
|
+
if (t(te)) {
|
|
415
|
+
M.current.focus();
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
We(!1), we.current = !0, Ve.current = !1, f && S.current !== -1 && X ? q(r, P[S.current], "blur") : f && H && v !== "" ? q(r, v, "blur", "freeSolo") : L && Ne(r, a), w(r, "blur");
|
|
419
|
+
}, ft = (r) => {
|
|
420
|
+
const o = r.target.value;
|
|
421
|
+
v !== o && (le(o), Ye(!1), E && E(r, o, "input")), o === "" ? !D && !b && B(r, null, "clear") : ge(r);
|
|
422
|
+
}, gt = (r) => {
|
|
423
|
+
const o = Number(r.currentTarget.getAttribute("data-option-index"));
|
|
424
|
+
S.current !== o && be({
|
|
425
|
+
event: r,
|
|
426
|
+
index: o,
|
|
427
|
+
reason: "mouse"
|
|
428
|
+
});
|
|
429
|
+
}, vt = (r) => {
|
|
430
|
+
be({
|
|
431
|
+
event: r,
|
|
432
|
+
index: Number(r.currentTarget.getAttribute("data-option-index")),
|
|
433
|
+
reason: "touch"
|
|
434
|
+
}), V.current = !0;
|
|
435
|
+
}, bt = (r) => {
|
|
436
|
+
const o = Number(r.currentTarget.getAttribute("data-option-index"));
|
|
437
|
+
q(r, P[o], "selectOption"), V.current = !1;
|
|
438
|
+
}, ht = (r) => (o) => {
|
|
439
|
+
const s = a.slice();
|
|
440
|
+
s.splice(r, 1), B(o, s, "removeOption", {
|
|
441
|
+
option: a[r]
|
|
442
|
+
});
|
|
443
|
+
}, ot = (r) => {
|
|
444
|
+
Se ? w(r, "toggleInput") : ge(r);
|
|
445
|
+
}, xt = (r) => {
|
|
446
|
+
r.currentTarget.contains(r.target) && r.target.getAttribute("id") !== K && r.preventDefault();
|
|
447
|
+
}, It = (r) => {
|
|
448
|
+
r.currentTarget.contains(r.target) && (M.current.focus(), je && we.current && M.current.selectionEnd - M.current.selectionStart === 0 && M.current.select(), we.current = !1);
|
|
449
|
+
}, yt = (r) => {
|
|
450
|
+
!x && (v === "" || !Se) && ot(r);
|
|
451
|
+
};
|
|
452
|
+
let qe = H && v.length > 0;
|
|
453
|
+
qe = qe || (b ? a.length > 0 : a !== null);
|
|
454
|
+
let rt = P;
|
|
455
|
+
return ee && (rt = P.reduce((r, o, s) => {
|
|
456
|
+
const c = ee(o);
|
|
457
|
+
return r.length > 0 && r[r.length - 1].group === c ? r[r.length - 1].options.push(o) : r.push({
|
|
458
|
+
key: s,
|
|
459
|
+
index: s,
|
|
460
|
+
group: c,
|
|
461
|
+
options: [o]
|
|
462
|
+
}), r;
|
|
463
|
+
}, [])), x && Re && tt(), {
|
|
464
|
+
getRootProps: (r = {}) => i({
|
|
465
|
+
"aria-owns": Ue ? `${K}-listbox` : null
|
|
466
|
+
}, r, {
|
|
467
|
+
onKeyDown: dt(r),
|
|
468
|
+
onMouseDown: xt,
|
|
469
|
+
onClick: It
|
|
470
|
+
}),
|
|
471
|
+
getInputLabelProps: () => ({
|
|
472
|
+
id: `${K}-label`,
|
|
473
|
+
htmlFor: K
|
|
474
|
+
}),
|
|
475
|
+
getInputProps: () => ({
|
|
476
|
+
id: K,
|
|
477
|
+
value: v,
|
|
478
|
+
onBlur: tt,
|
|
479
|
+
onFocus: mt,
|
|
480
|
+
onChange: ft,
|
|
481
|
+
onMouseDown: yt,
|
|
482
|
+
// if open then this is handled imperatively so don't let react override
|
|
483
|
+
// only have an opinion about this when closed
|
|
484
|
+
"aria-activedescendant": X ? "" : null,
|
|
485
|
+
"aria-autocomplete": n ? "both" : "list",
|
|
486
|
+
"aria-controls": Ue ? `${K}-listbox` : void 0,
|
|
487
|
+
"aria-expanded": Ue,
|
|
488
|
+
// Disable browser's suggestion that might overlap with the popup.
|
|
489
|
+
// Handle autocomplete but not autofill.
|
|
490
|
+
autoComplete: "off",
|
|
491
|
+
ref: M,
|
|
492
|
+
autoCapitalize: "none",
|
|
493
|
+
spellCheck: "false",
|
|
494
|
+
role: "combobox",
|
|
495
|
+
disabled: x
|
|
496
|
+
}),
|
|
497
|
+
getClearProps: () => ({
|
|
498
|
+
tabIndex: -1,
|
|
499
|
+
type: "button",
|
|
500
|
+
onClick: et
|
|
501
|
+
}),
|
|
502
|
+
getPopupIndicatorProps: () => ({
|
|
503
|
+
tabIndex: -1,
|
|
504
|
+
type: "button",
|
|
505
|
+
onClick: ot
|
|
506
|
+
}),
|
|
507
|
+
getTagProps: ({
|
|
508
|
+
index: r
|
|
509
|
+
}) => i({
|
|
510
|
+
key: r,
|
|
511
|
+
"data-tag-index": r,
|
|
512
|
+
tabIndex: -1
|
|
513
|
+
}, !G && {
|
|
514
|
+
onDelete: ht(r)
|
|
515
|
+
}),
|
|
516
|
+
getListboxProps: () => ({
|
|
517
|
+
role: "listbox",
|
|
518
|
+
id: `${K}-listbox`,
|
|
519
|
+
"aria-labelledby": `${K}-label`,
|
|
520
|
+
ref: Ze,
|
|
521
|
+
onMouseDown: (r) => {
|
|
522
|
+
r.preventDefault();
|
|
523
|
+
}
|
|
524
|
+
}),
|
|
525
|
+
getOptionProps: ({
|
|
526
|
+
index: r,
|
|
527
|
+
option: o
|
|
528
|
+
}) => {
|
|
529
|
+
var s;
|
|
530
|
+
const c = (b ? a : [a]).some(($) => $ != null && U(o, $)), I = _ ? _(o) : !1;
|
|
531
|
+
return {
|
|
532
|
+
key: (s = J == null ? void 0 : J(o)) != null ? s : W(o),
|
|
533
|
+
tabIndex: -1,
|
|
534
|
+
role: "option",
|
|
535
|
+
id: `${K}-option-${r}`,
|
|
536
|
+
onMouseMove: gt,
|
|
537
|
+
onClick: bt,
|
|
538
|
+
onTouchStart: vt,
|
|
539
|
+
"data-option-index": r,
|
|
540
|
+
"aria-disabled": I,
|
|
541
|
+
"aria-selected": c
|
|
542
|
+
};
|
|
543
|
+
},
|
|
544
|
+
id: K,
|
|
545
|
+
inputValue: v,
|
|
546
|
+
value: a,
|
|
547
|
+
dirty: qe,
|
|
548
|
+
expanded: X && Y,
|
|
549
|
+
popupOpen: X,
|
|
550
|
+
focused: Re || oe !== -1,
|
|
551
|
+
anchorEl: Y,
|
|
552
|
+
setAnchorEl: at,
|
|
553
|
+
focusedTag: oe,
|
|
554
|
+
groupedOptions: rt
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
const Mt = /* @__PURE__ */ u.createContext(void 0), So = ["component", "className", "children", "nested", "sticky", "variant", "color", "startAction", "endAction", "role", "slots", "slotProps"], Po = (e) => {
|
|
558
|
+
const {
|
|
559
|
+
sticky: t,
|
|
560
|
+
nested: l,
|
|
561
|
+
nesting: n,
|
|
562
|
+
variant: d,
|
|
563
|
+
color: f
|
|
564
|
+
} = e, y = {
|
|
565
|
+
root: ["root", l && "nested", n && "nesting", t && "sticky", f && `color${ne(f)}`, d && `variant${ne(d)}`],
|
|
566
|
+
startAction: ["startAction"],
|
|
567
|
+
endAction: ["endAction"]
|
|
568
|
+
};
|
|
569
|
+
return xe(y, Qt, {});
|
|
570
|
+
}, Oo = O("li")(({
|
|
571
|
+
theme: e,
|
|
572
|
+
ownerState: t
|
|
573
|
+
}) => {
|
|
574
|
+
var l;
|
|
575
|
+
return [
|
|
576
|
+
!t.nested && {
|
|
577
|
+
// add negative margin to ListItemButton equal to this ListItem padding
|
|
578
|
+
"--ListItemButton-marginInline": "calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",
|
|
579
|
+
"--ListItemButton-marginBlock": "calc(-1 * var(--ListItem-paddingY))",
|
|
580
|
+
alignItems: "center",
|
|
581
|
+
gap: "var(--ListItem-gap)",
|
|
582
|
+
marginInline: "var(--ListItem-marginInline)"
|
|
583
|
+
},
|
|
584
|
+
t.nested && {
|
|
585
|
+
// add negative margin to NestedList equal to this ListItem padding
|
|
586
|
+
"--NestedList-marginRight": "calc(-1 * var(--ListItem-paddingRight))",
|
|
587
|
+
"--NestedList-marginLeft": "calc(-1 * var(--ListItem-paddingLeft))",
|
|
588
|
+
"--NestedListItem-paddingLeft": "calc(var(--ListItem-paddingLeft) + var(--List-nestedInsetStart))",
|
|
589
|
+
// add negative margin to ListItem, ListItemButton to make them start from the edge.
|
|
590
|
+
"--ListItemButton-marginBlock": "0px",
|
|
591
|
+
"--ListItemButton-marginInline": "calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",
|
|
592
|
+
"--ListItem-marginInline": "calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",
|
|
593
|
+
flexDirection: "column"
|
|
594
|
+
},
|
|
595
|
+
// Base styles
|
|
596
|
+
i({
|
|
597
|
+
// Integration with control elements, for example Checkbox, Radio.
|
|
598
|
+
"--unstable_actionRadius": "calc(var(--ListItem-radius) - var(--variant-borderWidth, 0px))"
|
|
599
|
+
}, t.startAction && {
|
|
600
|
+
"--unstable_startActionWidth": "2rem"
|
|
601
|
+
// to add sufficient padding-left on ListItemButton
|
|
602
|
+
}, t.endAction && {
|
|
603
|
+
"--unstable_endActionWidth": "2.5rem"
|
|
604
|
+
// to add sufficient padding-right on ListItemButton
|
|
605
|
+
}, {
|
|
606
|
+
boxSizing: "border-box",
|
|
607
|
+
borderRadius: "var(--ListItem-radius)",
|
|
608
|
+
display: "var(--_ListItem-display)",
|
|
609
|
+
"&:not([hidden])": {
|
|
610
|
+
"--_ListItem-display": "var(--_List-markerDisplay, flex)"
|
|
611
|
+
},
|
|
612
|
+
flex: "none",
|
|
613
|
+
// prevent children from shrinking when the List's height is limited.
|
|
614
|
+
listStyleType: "var(--_List-markerType, disc)",
|
|
615
|
+
position: "relative",
|
|
616
|
+
paddingBlockStart: t.nested ? 0 : "var(--ListItem-paddingY)",
|
|
617
|
+
paddingBlockEnd: t.nested ? 0 : "var(--ListItem-paddingY)",
|
|
618
|
+
paddingInlineStart: "var(--ListItem-paddingLeft)",
|
|
619
|
+
paddingInlineEnd: "var(--ListItem-paddingRight)"
|
|
620
|
+
}, t["data-first-child"] === void 0 && i({}, t.row ? {
|
|
621
|
+
marginInlineStart: "var(--List-gap)"
|
|
622
|
+
} : {
|
|
623
|
+
marginBlockStart: "var(--List-gap)"
|
|
624
|
+
}), t.row && t.wrap && {
|
|
625
|
+
marginInlineStart: "var(--List-gap)",
|
|
626
|
+
marginBlockStart: "var(--List-gap)"
|
|
627
|
+
}, {
|
|
628
|
+
minBlockSize: "var(--ListItem-minHeight)"
|
|
629
|
+
}, t.sticky && {
|
|
630
|
+
// sticky in list item can be found in grouped options
|
|
631
|
+
position: "sticky",
|
|
632
|
+
top: "var(--ListItem-stickyTop, 0px)",
|
|
633
|
+
// integration with Menu and Select.
|
|
634
|
+
zIndex: 1,
|
|
635
|
+
background: `var(--ListItem-stickyBackground, ${e.vars.palette.background.body})`
|
|
636
|
+
}, {
|
|
637
|
+
[`.${St.nested} > &`]: {
|
|
638
|
+
"--_ListItem-display": "flex"
|
|
639
|
+
}
|
|
640
|
+
}),
|
|
641
|
+
(l = e.variants[t.variant]) == null ? void 0 : l[t.color]
|
|
642
|
+
];
|
|
643
|
+
}), Do = O(Oo, {
|
|
644
|
+
name: "JoyListItem",
|
|
645
|
+
slot: "Root",
|
|
646
|
+
overridesResolver: (e, t) => t.root
|
|
647
|
+
})({}), ko = O("div", {
|
|
648
|
+
name: "JoyListItem",
|
|
649
|
+
slot: "StartAction",
|
|
650
|
+
overridesResolver: (e, t) => t.startAction
|
|
651
|
+
})(({
|
|
652
|
+
ownerState: e
|
|
653
|
+
}) => ({
|
|
654
|
+
display: "inherit",
|
|
655
|
+
position: "absolute",
|
|
656
|
+
top: e.nested ? "calc(var(--ListItem-minHeight) / 2)" : "50%",
|
|
657
|
+
left: 0,
|
|
658
|
+
transform: "translate(var(--ListItem-startActionTranslateX), -50%)",
|
|
659
|
+
zIndex: 1
|
|
660
|
+
// to stay on top of ListItemButton (default `position: relative`).
|
|
661
|
+
})), Ao = O("div", {
|
|
662
|
+
name: "JoyListItem",
|
|
663
|
+
slot: "StartAction",
|
|
664
|
+
overridesResolver: (e, t) => t.startAction
|
|
665
|
+
})(({
|
|
666
|
+
ownerState: e
|
|
667
|
+
}) => ({
|
|
668
|
+
display: "inherit",
|
|
669
|
+
position: "absolute",
|
|
670
|
+
top: e.nested ? "calc(var(--ListItem-minHeight) / 2)" : "50%",
|
|
671
|
+
right: 0,
|
|
672
|
+
transform: "translate(var(--ListItem-endActionTranslateX), -50%)"
|
|
673
|
+
})), it = /* @__PURE__ */ u.forwardRef(function(t, l) {
|
|
674
|
+
const n = he({
|
|
675
|
+
props: t,
|
|
676
|
+
name: "JoyListItem"
|
|
677
|
+
}), d = u.useContext(Kt), f = u.useContext(Yt), y = u.useContext(Xt), L = u.useContext(Zt), C = u.useContext($t), {
|
|
678
|
+
component: h,
|
|
679
|
+
className: g,
|
|
680
|
+
children: D,
|
|
681
|
+
nested: T = !1,
|
|
682
|
+
sticky: x = !1,
|
|
683
|
+
variant: k = "plain",
|
|
684
|
+
color: z = "neutral",
|
|
685
|
+
startAction: A,
|
|
686
|
+
endAction: F,
|
|
687
|
+
role: H,
|
|
688
|
+
slots: _ = {},
|
|
689
|
+
slotProps: J = {}
|
|
690
|
+
} = n, se = Q(n, So), [ee, ce] = u.useState(""), [ue, me] = (f == null ? void 0 : f.split(":")) || ["", ""], ye = h || (ue && !ue.match(/^(ul|ol|menu)$/) ? "div" : void 0);
|
|
691
|
+
let U = d === "menu" ? "none" : void 0;
|
|
692
|
+
f && (U = {
|
|
693
|
+
menu: "none",
|
|
694
|
+
menubar: "none",
|
|
695
|
+
group: "presentation"
|
|
696
|
+
}[me]), H && (U = H);
|
|
697
|
+
const b = i({}, n, {
|
|
698
|
+
sticky: x,
|
|
699
|
+
startAction: A,
|
|
700
|
+
endAction: F,
|
|
701
|
+
row: y,
|
|
702
|
+
wrap: L,
|
|
703
|
+
variant: k,
|
|
704
|
+
color: z,
|
|
705
|
+
nesting: C,
|
|
706
|
+
nested: T,
|
|
707
|
+
component: ye,
|
|
708
|
+
role: U
|
|
709
|
+
}), pe = Po(b), fe = i({}, se, {
|
|
710
|
+
component: ye,
|
|
711
|
+
slots: _,
|
|
712
|
+
slotProps: J
|
|
713
|
+
}), [Le, E] = R("root", {
|
|
714
|
+
additionalProps: {
|
|
715
|
+
role: U
|
|
716
|
+
},
|
|
717
|
+
ref: l,
|
|
718
|
+
className: $e(pe.root, g),
|
|
719
|
+
elementType: Do,
|
|
720
|
+
externalForwardedProps: fe,
|
|
721
|
+
ownerState: b
|
|
722
|
+
}), [ze, Fe] = R("startAction", {
|
|
723
|
+
className: pe.startAction,
|
|
724
|
+
elementType: ko,
|
|
725
|
+
externalForwardedProps: fe,
|
|
726
|
+
ownerState: b
|
|
727
|
+
}), [Be, Me] = R("endAction", {
|
|
728
|
+
className: pe.endAction,
|
|
729
|
+
elementType: Ao,
|
|
730
|
+
externalForwardedProps: fe,
|
|
731
|
+
ownerState: b
|
|
732
|
+
});
|
|
733
|
+
return /* @__PURE__ */ m.jsx(Mt.Provider, {
|
|
734
|
+
value: ce,
|
|
735
|
+
children: /* @__PURE__ */ m.jsx($t.Provider, {
|
|
736
|
+
value: T ? ee || !0 : !1,
|
|
737
|
+
children: /* @__PURE__ */ m.jsxs(Le, i({}, E, {
|
|
738
|
+
children: [A && /* @__PURE__ */ m.jsx(ze, i({}, Fe, {
|
|
739
|
+
children: A
|
|
740
|
+
})), u.Children.map(D, (G, je) => {
|
|
741
|
+
var _e;
|
|
742
|
+
return /* @__PURE__ */ u.isValidElement(G) ? /* @__PURE__ */ u.cloneElement(G, i({}, je === 0 && {
|
|
743
|
+
"data-first-child": ""
|
|
744
|
+
}, go(G, ["ListItem"]) && {
|
|
745
|
+
// The ListItem of ListItem should not be 'li'
|
|
746
|
+
component: ((_e = G.props) == null ? void 0 : _e.component) || "div"
|
|
747
|
+
})) : G;
|
|
748
|
+
}), F && /* @__PURE__ */ m.jsx(Be, i({}, Me, {
|
|
749
|
+
children: F
|
|
750
|
+
}))]
|
|
751
|
+
}))
|
|
752
|
+
})
|
|
753
|
+
});
|
|
754
|
+
});
|
|
755
|
+
it.muiName = "ListItem";
|
|
756
|
+
const Ro = Ot(/* @__PURE__ */ m.jsx("path", {
|
|
757
|
+
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
758
|
+
}), "Close"), To = Ot(/* @__PURE__ */ m.jsx("path", {
|
|
759
|
+
d: "M7 10l5 5 5-5z"
|
|
760
|
+
}), "ArrowDropDown"), $o = Ot(/* @__PURE__ */ m.jsx("path", {
|
|
761
|
+
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
762
|
+
}), "Cancel");
|
|
763
|
+
function zo(e) {
|
|
764
|
+
return Ae("MuiChipDelete", e);
|
|
765
|
+
}
|
|
766
|
+
Ie("MuiChipDelete", ["root", "disabled", "focusVisible", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSolid", "variantSoft", "variantOutlined"]);
|
|
767
|
+
var _t;
|
|
768
|
+
const Fo = ["children", "variant", "color", "disabled", "onKeyDown", "onDelete", "onClick", "component", "slots", "slotProps"], _o = ["onDelete"], wo = (e) => {
|
|
769
|
+
const {
|
|
770
|
+
focusVisible: t,
|
|
771
|
+
variant: l,
|
|
772
|
+
color: n,
|
|
773
|
+
disabled: d
|
|
774
|
+
} = e, f = {
|
|
775
|
+
root: ["root", d && "disabled", t && "focusVisible", l && `variant${ne(l)}`, n && `color${ne(n)}`]
|
|
776
|
+
};
|
|
777
|
+
return xe(f, zo, {});
|
|
778
|
+
}, No = O(Dt, {
|
|
779
|
+
name: "JoyChipDelete",
|
|
780
|
+
slot: "Root",
|
|
781
|
+
overridesResolver: (e, t) => t.root
|
|
782
|
+
})(({
|
|
783
|
+
theme: e
|
|
784
|
+
}) => ({
|
|
785
|
+
"--IconButton-size": "var(--Chip-deleteSize, 2rem)",
|
|
786
|
+
"--Icon-fontSize": "calc(var(--IconButton-size, 2rem) / 1.3)",
|
|
787
|
+
minWidth: "var(--IconButton-size, 2rem)",
|
|
788
|
+
// use min-width instead of height to make the button resilient to its content
|
|
789
|
+
minHeight: "var(--IconButton-size, 2rem)",
|
|
790
|
+
// use min-height instead of height to make the button resilient to its content
|
|
791
|
+
fontSize: e.vars.fontSize.sm,
|
|
792
|
+
paddingInline: "2px",
|
|
793
|
+
// add a gap, in case the content is long, for example multiple icons
|
|
794
|
+
pointerEvents: "visible",
|
|
795
|
+
// force the ChipDelete to be hoverable because the decorator can have pointerEvents 'none'
|
|
796
|
+
borderRadius: "var(--Chip-deleteRadius, 50%)",
|
|
797
|
+
zIndex: 1,
|
|
798
|
+
// overflow above sibling button or anchor
|
|
799
|
+
padding: 0
|
|
800
|
+
// reset user agent stylesheet
|
|
801
|
+
})), Ho = /* @__PURE__ */ u.forwardRef(function(t, l) {
|
|
802
|
+
const n = he({
|
|
803
|
+
props: t,
|
|
804
|
+
name: "JoyChipDelete"
|
|
805
|
+
}), {
|
|
806
|
+
children: d,
|
|
807
|
+
variant: f = "plain",
|
|
808
|
+
color: y = "neutral",
|
|
809
|
+
disabled: L,
|
|
810
|
+
onKeyDown: C,
|
|
811
|
+
onDelete: h,
|
|
812
|
+
onClick: g,
|
|
813
|
+
component: D,
|
|
814
|
+
slots: T = {},
|
|
815
|
+
slotProps: x = {}
|
|
816
|
+
} = n, k = Q(n, Fo), z = u.useContext(mo), {
|
|
817
|
+
variant: A = f,
|
|
818
|
+
color: F = y
|
|
819
|
+
} = Bt(t.variant, t.color, !0), H = t.color || F, _ = L ?? z.disabled, J = u.useRef(null), se = Et(J, l), {
|
|
820
|
+
focusVisible: ee,
|
|
821
|
+
getRootProps: ce
|
|
822
|
+
} = vo(i({}, n, {
|
|
823
|
+
disabled: _,
|
|
824
|
+
rootRef: se
|
|
825
|
+
})), ue = i({}, n, {
|
|
826
|
+
disabled: _,
|
|
827
|
+
variant: A,
|
|
828
|
+
color: H,
|
|
829
|
+
focusVisible: ee
|
|
830
|
+
}), me = wo(ue), ye = i({}, k, {
|
|
831
|
+
component: D,
|
|
832
|
+
slots: T,
|
|
833
|
+
slotProps: x
|
|
834
|
+
}), U = (E) => {
|
|
835
|
+
!_ && h && h(E), g && g(E);
|
|
836
|
+
}, b = (E) => {
|
|
837
|
+
["Backspace", "Enter", "Delete"].includes(E.key) && (E.preventDefault(), !_ && h && h(E)), C && C(E);
|
|
838
|
+
}, [pe, fe] = R("root", {
|
|
839
|
+
ref: l,
|
|
840
|
+
elementType: No,
|
|
841
|
+
getSlotProps: ce,
|
|
842
|
+
externalForwardedProps: ye,
|
|
843
|
+
ownerState: ue,
|
|
844
|
+
additionalProps: {
|
|
845
|
+
as: D,
|
|
846
|
+
onKeyDown: b,
|
|
847
|
+
onClick: U
|
|
848
|
+
},
|
|
849
|
+
className: me.root
|
|
850
|
+
}), Le = Q(fe, _o);
|
|
851
|
+
return /* @__PURE__ */ m.jsx(pe, i({}, Le, {
|
|
852
|
+
children: d ?? (_t || (_t = /* @__PURE__ */ m.jsx($o, {})))
|
|
853
|
+
}));
|
|
854
|
+
});
|
|
855
|
+
function Eo(e) {
|
|
856
|
+
return Ae("MuiListSubheader", e);
|
|
857
|
+
}
|
|
858
|
+
Ie("MuiListSubheader", ["root", "sticky", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSoft", "variantOutlined", "variantSolid"]);
|
|
859
|
+
const Bo = ["component", "className", "children", "id", "sticky", "variant", "color", "slots", "slotProps"], Mo = (e) => {
|
|
860
|
+
const {
|
|
861
|
+
variant: t,
|
|
862
|
+
color: l,
|
|
863
|
+
sticky: n
|
|
864
|
+
} = e, d = {
|
|
865
|
+
root: ["root", n && "sticky", l && `color${ne(l)}`, t && `variant${ne(t)}`]
|
|
866
|
+
};
|
|
867
|
+
return xe(d, Eo, {});
|
|
868
|
+
}, jo = O("div", {
|
|
869
|
+
name: "JoyListSubheader",
|
|
870
|
+
slot: "Root",
|
|
871
|
+
overridesResolver: (e, t) => t.root
|
|
872
|
+
})(({
|
|
873
|
+
theme: e,
|
|
874
|
+
ownerState: t
|
|
875
|
+
}) => {
|
|
876
|
+
var l, n;
|
|
877
|
+
return i({
|
|
878
|
+
boxSizing: "border-box",
|
|
879
|
+
display: "flex",
|
|
880
|
+
alignItems: "center",
|
|
881
|
+
marginInline: "var(--ListItem-marginInline)",
|
|
882
|
+
paddingBlock: "var(--ListItem-paddingY)",
|
|
883
|
+
paddingInlineStart: "var(--ListItem-paddingLeft)",
|
|
884
|
+
paddingInlineEnd: "var(--ListItem-paddingRight)",
|
|
885
|
+
minBlockSize: "var(--ListItem-minHeight)"
|
|
886
|
+
}, e.typography["body-xs"], {
|
|
887
|
+
fontSize: "max(0.75em, 0.625rem)",
|
|
888
|
+
textTransform: "uppercase",
|
|
889
|
+
letterSpacing: "0.1em"
|
|
890
|
+
}, t.sticky && {
|
|
891
|
+
position: "sticky",
|
|
892
|
+
top: "var(--ListItem-stickyTop, 0px)",
|
|
893
|
+
// integration with Menu and Select.
|
|
894
|
+
zIndex: 1,
|
|
895
|
+
background: "var(--ListItem-stickyBackground)"
|
|
896
|
+
}, {
|
|
897
|
+
color: t.color ? `var(--_Link-color, rgba(${(l = e.vars.palette[t.color]) == null ? void 0 : l.mainChannel} / 1))` : e.vars.palette.text.tertiary
|
|
898
|
+
}, t.instanceColor && {
|
|
899
|
+
[`&:not([${bo}])`]: {
|
|
900
|
+
"--_Link-color": e.vars.palette.text.secondary
|
|
901
|
+
}
|
|
902
|
+
}, (n = e.variants[t.variant]) == null ? void 0 : n[t.color]);
|
|
903
|
+
}), Vo = /* @__PURE__ */ u.forwardRef(function(t, l) {
|
|
904
|
+
const n = he({
|
|
905
|
+
props: t,
|
|
906
|
+
name: "JoyListSubheader"
|
|
907
|
+
}), {
|
|
908
|
+
component: d,
|
|
909
|
+
className: f,
|
|
910
|
+
children: y,
|
|
911
|
+
id: L,
|
|
912
|
+
sticky: C = !1,
|
|
913
|
+
variant: h,
|
|
914
|
+
color: g,
|
|
915
|
+
slots: D = {},
|
|
916
|
+
slotProps: T = {}
|
|
917
|
+
} = n, x = Q(n, Bo), k = Pt(L), z = u.useContext(Mt);
|
|
918
|
+
u.useEffect(() => {
|
|
919
|
+
z && z(k || "");
|
|
920
|
+
}, [z, k]);
|
|
921
|
+
const A = i({
|
|
922
|
+
instanceColor: t.color
|
|
923
|
+
}, n, {
|
|
924
|
+
id: k,
|
|
925
|
+
sticky: C,
|
|
926
|
+
variant: h,
|
|
927
|
+
color: h ? g ?? "neutral" : g
|
|
928
|
+
}), F = Mo(A), H = i({}, x, {
|
|
929
|
+
component: d,
|
|
930
|
+
slots: D,
|
|
931
|
+
slotProps: T
|
|
932
|
+
}), [_, J] = R("root", {
|
|
933
|
+
ref: l,
|
|
934
|
+
className: $e(F.root, f),
|
|
935
|
+
elementType: jo,
|
|
936
|
+
externalForwardedProps: H,
|
|
937
|
+
ownerState: A,
|
|
938
|
+
additionalProps: {
|
|
939
|
+
as: d,
|
|
940
|
+
id: k
|
|
941
|
+
}
|
|
942
|
+
});
|
|
943
|
+
return /* @__PURE__ */ m.jsx(_, i({}, J, {
|
|
944
|
+
children: y
|
|
945
|
+
}));
|
|
946
|
+
});
|
|
947
|
+
function Jo(e) {
|
|
948
|
+
return Ae("MuiAutocomplete", e);
|
|
949
|
+
}
|
|
950
|
+
const ke = Ie("MuiAutocomplete", ["root", "wrapper", "input", "startDecorator", "endDecorator", "formControl", "focused", "disabled", "error", "multiple", "limitTag", "hasPopupIcon", "hasClearIcon", "clearIndicator", "popupIndicator", "popupIndicatorOpen", "listbox", "option", "loading", "noOptions", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantPlain", "variantOutlined", "variantSoft", "variantSolid"]), jt = O(eo)(({
|
|
951
|
+
theme: e,
|
|
952
|
+
ownerState: t
|
|
953
|
+
}) => {
|
|
954
|
+
var l;
|
|
955
|
+
const n = (l = e.variants[t.variant]) == null ? void 0 : l[t.color];
|
|
956
|
+
return i({
|
|
957
|
+
"--focus-outline-offset": `calc(${e.vars.focus.thickness} * -1)`,
|
|
958
|
+
// to prevent the focus outline from being cut by overflow
|
|
959
|
+
"--ListItem-stickyBackground": (n == null ? void 0 : n.backgroundColor) || (n == null ? void 0 : n.background) || e.vars.palette.background.popup,
|
|
960
|
+
"--ListItem-stickyTop": "calc(var(--List-padding, var(--ListDivider-gap)) * -1)"
|
|
961
|
+
}, to, {
|
|
962
|
+
boxShadow: e.shadow.md,
|
|
963
|
+
borderRadius: `var(--List-radius, ${e.vars.radius.sm})`
|
|
964
|
+
}, !(n != null && n.backgroundColor) && {
|
|
965
|
+
backgroundColor: e.vars.palette.background.popup
|
|
966
|
+
}, {
|
|
967
|
+
zIndex: e.vars.zIndex.popup,
|
|
968
|
+
overflow: "auto",
|
|
969
|
+
maxHeight: "40vh",
|
|
970
|
+
position: "relative",
|
|
971
|
+
// to make sure that the listbox is positioned for grouped options to work.
|
|
972
|
+
"&:empty": {
|
|
973
|
+
visibility: "hidden"
|
|
974
|
+
},
|
|
975
|
+
[`& .${St.nested}, & .${St.nested} .${oo.root}`]: {
|
|
976
|
+
// For grouped options autocomplete:
|
|
977
|
+
// Force the position to make the scroll into view logic works because the `element.offsetTop` should reference to the listbox, not the grouped list.
|
|
978
|
+
// See the implementation of the `useAutocomplete` line:370
|
|
979
|
+
//
|
|
980
|
+
// Resource: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetTop
|
|
981
|
+
position: "initial"
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
});
|
|
985
|
+
O(jt, {
|
|
986
|
+
name: "JoyAutocompleteListbox",
|
|
987
|
+
slot: "Root",
|
|
988
|
+
overridesResolver: (e, t) => t.root
|
|
989
|
+
})({});
|
|
990
|
+
function Wo(e) {
|
|
991
|
+
return Ae("MuiAutocompleteOption", e);
|
|
992
|
+
}
|
|
993
|
+
Ie("MuiAutocompleteOption", ["root", "focused", "focusVisible", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSoft", "variantOutlined", "variantSolid"]);
|
|
994
|
+
const Uo = ["children", "component", "color", "variant", "className", "slots", "slotProps"], qo = (e) => {
|
|
995
|
+
const {
|
|
996
|
+
color: t,
|
|
997
|
+
variant: l
|
|
998
|
+
} = e, n = {
|
|
999
|
+
root: ["root", t && `color${ne(t)}`, l && `variant${ne(l)}`]
|
|
1000
|
+
};
|
|
1001
|
+
return xe(n, Wo, {});
|
|
1002
|
+
}, Vt = O(ro)(({
|
|
1003
|
+
theme: e,
|
|
1004
|
+
ownerState: t
|
|
1005
|
+
}) => {
|
|
1006
|
+
var l, n;
|
|
1007
|
+
return {
|
|
1008
|
+
'&[aria-disabled="true"]': (l = e.variants[`${t.variant}Disabled`]) == null ? void 0 : l[t.color],
|
|
1009
|
+
'&[aria-selected="true"]': i({}, (n = e.variants[`${t.variant}Active`]) == null ? void 0 : n[t.color], {
|
|
1010
|
+
fontWeight: e.vars.fontWeight.md
|
|
1011
|
+
})
|
|
1012
|
+
};
|
|
1013
|
+
}), Go = O(Vt, {
|
|
1014
|
+
name: "JoyAutocompleteOption",
|
|
1015
|
+
slot: "Root",
|
|
1016
|
+
overridesResolver: (e, t) => t.root
|
|
1017
|
+
})({}), Jr = /* @__PURE__ */ u.forwardRef(function(t, l) {
|
|
1018
|
+
const n = he({
|
|
1019
|
+
props: t,
|
|
1020
|
+
name: "JoyAutocompleteOption"
|
|
1021
|
+
}), {
|
|
1022
|
+
children: d,
|
|
1023
|
+
component: f = "li",
|
|
1024
|
+
color: y = "neutral",
|
|
1025
|
+
variant: L = "plain",
|
|
1026
|
+
className: C,
|
|
1027
|
+
slots: h = {},
|
|
1028
|
+
slotProps: g = {}
|
|
1029
|
+
} = n, D = Q(n, Uo), {
|
|
1030
|
+
variant: T = L,
|
|
1031
|
+
color: x = y
|
|
1032
|
+
} = Bt(t.variant, t.color), k = i({}, n, {
|
|
1033
|
+
component: f,
|
|
1034
|
+
color: x,
|
|
1035
|
+
variant: T
|
|
1036
|
+
}), z = qo(k), A = i({}, D, {
|
|
1037
|
+
component: f,
|
|
1038
|
+
slots: h,
|
|
1039
|
+
slotProps: g
|
|
1040
|
+
}), [F, H] = R("root", {
|
|
1041
|
+
ref: l,
|
|
1042
|
+
className: $e(z.root, C),
|
|
1043
|
+
elementType: Go,
|
|
1044
|
+
externalForwardedProps: A,
|
|
1045
|
+
ownerState: k,
|
|
1046
|
+
additionalProps: {
|
|
1047
|
+
as: f,
|
|
1048
|
+
role: "option"
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
return /* @__PURE__ */ m.jsx(F, i({}, H, {
|
|
1052
|
+
children: d
|
|
1053
|
+
}));
|
|
1054
|
+
});
|
|
1055
|
+
var wt, Nt;
|
|
1056
|
+
const Ko = ["aria-describedby", "aria-label", "aria-labelledby", "autoComplete", "autoHighlight", "autoSelect", "autoFocus", "blurOnSelect", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "defaultValue", "disableCloseOnSelect", "disabledItemsFocusable", "disableListWrap", "disableClearable", "disabled", "endDecorator", "error", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "getLimitTagsText", "getOptionDisabled", "getOptionKey", "getOptionLabel", "handleHomeEndKeys", "includeInputInList", "isOptionEqualToValue", "groupBy", "id", "inputValue", "limitTags", "loading", "loadingText", "multiple", "name", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "placeholder", "popupIcon", "readOnly", "renderGroup", "renderOption", "renderTags", "required", "type", "startDecorator", "size", "color", "variant", "value", "component", "selectOnFocus", "slots", "slotProps"], Yo = ["onDelete"], Xo = ["key"], Zo = ["onBlur", "onFocus", "onMouseDown"], Qo = ["key"], er = (e) => e.current !== null && e.current.contains(document.activeElement), tr = (e) => {
|
|
1057
|
+
var t;
|
|
1058
|
+
return (t = e.label) != null ? t : e;
|
|
1059
|
+
}, or = (e) => `+${e}`, rr = (e) => /* @__PURE__ */ m.jsxs(it, {
|
|
1060
|
+
nested: !0,
|
|
1061
|
+
children: [/* @__PURE__ */ m.jsx(Vo, {
|
|
1062
|
+
sticky: !0,
|
|
1063
|
+
children: e.group
|
|
1064
|
+
}), /* @__PURE__ */ m.jsx(lo, {
|
|
1065
|
+
children: e.children
|
|
1066
|
+
})]
|
|
1067
|
+
}, e.key), nr = (e) => {
|
|
1068
|
+
const {
|
|
1069
|
+
disabled: t,
|
|
1070
|
+
focused: l,
|
|
1071
|
+
hasClearIcon: n,
|
|
1072
|
+
hasPopupIcon: d,
|
|
1073
|
+
popupOpen: f,
|
|
1074
|
+
variant: y,
|
|
1075
|
+
color: L,
|
|
1076
|
+
size: C,
|
|
1077
|
+
multiple: h
|
|
1078
|
+
} = e, g = {
|
|
1079
|
+
root: ["root", l && "focused", n && "hasClearIcon", d && "hasPopupIcon", y && `variant${ne(y)}`, L && `color${ne(L)}`, C && `size${ne(C)}`],
|
|
1080
|
+
wrapper: ["wrapper", h && "multiple"],
|
|
1081
|
+
input: ["input"],
|
|
1082
|
+
startDecorator: ["startDecorator"],
|
|
1083
|
+
endDecorator: ["endDecorator"],
|
|
1084
|
+
clearIndicator: ["clearIndicator"],
|
|
1085
|
+
popupIndicator: ["popupIndicator", f && "popupIndicatorOpen", t && "disabled"],
|
|
1086
|
+
listbox: ["listbox"],
|
|
1087
|
+
option: ["option"],
|
|
1088
|
+
loading: ["loading"],
|
|
1089
|
+
noOptions: ["noOptions"],
|
|
1090
|
+
limitTag: ["limitTag"]
|
|
1091
|
+
};
|
|
1092
|
+
return xe(g, Jo, {});
|
|
1093
|
+
}, sr = O(io, {
|
|
1094
|
+
name: "JoyAutocomplete",
|
|
1095
|
+
slot: "Root",
|
|
1096
|
+
overridesResolver: (e, t) => t.root
|
|
1097
|
+
})(({
|
|
1098
|
+
ownerState: e
|
|
1099
|
+
}) => i({}, e.size === "sm" && {
|
|
1100
|
+
"--Autocomplete-wrapperGap": "3px"
|
|
1101
|
+
}, e.size === "md" && {
|
|
1102
|
+
"--Autocomplete-wrapperGap": "3px"
|
|
1103
|
+
}, e.size === "lg" && {
|
|
1104
|
+
"--Autocomplete-wrapperGap": "4px"
|
|
1105
|
+
}, {
|
|
1106
|
+
/* Avoid double tap issue on iOS */
|
|
1107
|
+
"@media (pointer: fine)": {
|
|
1108
|
+
[`&:hover .${ke.clearIndicator}`]: {
|
|
1109
|
+
visibility: "visible"
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
}, e.multiple && !e.startDecorator && {
|
|
1113
|
+
paddingInlineStart: 0
|
|
1114
|
+
})), lr = O("div", {
|
|
1115
|
+
name: "JoyAutocomplete",
|
|
1116
|
+
slot: "Wrapper",
|
|
1117
|
+
overridesResolver: (e, t) => t.wrapper
|
|
1118
|
+
})(({
|
|
1119
|
+
ownerState: e
|
|
1120
|
+
}) => ({
|
|
1121
|
+
flex: 1,
|
|
1122
|
+
// stretch to fill the root slot
|
|
1123
|
+
minWidth: 0,
|
|
1124
|
+
// won't push end decorator out of the autocomplete
|
|
1125
|
+
display: "flex",
|
|
1126
|
+
alignItems: "center",
|
|
1127
|
+
flexWrap: "wrap",
|
|
1128
|
+
gap: "var(--Autocomplete-wrapperGap)",
|
|
1129
|
+
[`&.${ke.multiple}`]: i({
|
|
1130
|
+
paddingBlock: "var(--Autocomplete-wrapperGap)"
|
|
1131
|
+
}, !e.startDecorator && {
|
|
1132
|
+
paddingInlineStart: "var(--Autocomplete-wrapperGap)"
|
|
1133
|
+
}, !e.endDecorator && {
|
|
1134
|
+
paddingInlineEnd: "var(--Autocomplete-wrapperGap)"
|
|
1135
|
+
})
|
|
1136
|
+
})), ir = O(ao, {
|
|
1137
|
+
name: "JoyAutocomplete",
|
|
1138
|
+
slot: "Input",
|
|
1139
|
+
overridesResolver: (e, t) => t.input
|
|
1140
|
+
})(({
|
|
1141
|
+
ownerState: e
|
|
1142
|
+
}) => i({
|
|
1143
|
+
minWidth: 30,
|
|
1144
|
+
minHeight: "var(--Chip-minHeight)"
|
|
1145
|
+
}, e.multiple && {
|
|
1146
|
+
marginInlineStart: "calc(var(--Autocomplete-wrapperGap) * 2.5)"
|
|
1147
|
+
})), ar = O(co, {
|
|
1148
|
+
name: "JoyAutocomplete",
|
|
1149
|
+
slot: "StartDecorator",
|
|
1150
|
+
overridesResolver: (e, t) => t.startDecorator
|
|
1151
|
+
})({}), cr = O(uo, {
|
|
1152
|
+
name: "JoyAutocomplete",
|
|
1153
|
+
slot: "EndDecorator",
|
|
1154
|
+
overridesResolver: (e, t) => t.endDecorator
|
|
1155
|
+
})(({
|
|
1156
|
+
ownerState: e
|
|
1157
|
+
}) => i({}, (e.hasClearIcon || e.hasPopupIcon) && {
|
|
1158
|
+
"--Button-margin": "0px",
|
|
1159
|
+
"--IconButton-margin": "0px",
|
|
1160
|
+
"--Icon-margin": "0px"
|
|
1161
|
+
})), ur = O(Dt, {
|
|
1162
|
+
name: "JoyAutocomplete",
|
|
1163
|
+
slot: "ClearIndicator",
|
|
1164
|
+
overridesResolver: (e, t) => t.clearIndicator
|
|
1165
|
+
})(({
|
|
1166
|
+
ownerState: e
|
|
1167
|
+
}) => i({
|
|
1168
|
+
alignSelf: "center"
|
|
1169
|
+
}, !e.hasPopupIcon && {
|
|
1170
|
+
marginInlineEnd: "calc(var(--Input-decoratorChildOffset) * -1)"
|
|
1171
|
+
}, {
|
|
1172
|
+
marginInlineStart: "calc(var(--_Input-paddingBlock) / 2)",
|
|
1173
|
+
visibility: e.focused ? "visible" : "hidden"
|
|
1174
|
+
})), pr = O(Dt, {
|
|
1175
|
+
name: "JoyAutocomplete",
|
|
1176
|
+
slot: "PopupIndicator",
|
|
1177
|
+
overridesResolver: (e, t) => t.popupIndicator
|
|
1178
|
+
})({
|
|
1179
|
+
alignSelf: "center",
|
|
1180
|
+
marginInlineStart: "calc(var(--_Input-paddingBlock) / 2)",
|
|
1181
|
+
marginInlineEnd: "calc(var(--Input-decoratorChildOffset) * -1)",
|
|
1182
|
+
[`&.${ke.popupIndicatorOpen}`]: {
|
|
1183
|
+
transform: "rotate(180deg)",
|
|
1184
|
+
"--Icon-color": "currentColor"
|
|
1185
|
+
}
|
|
1186
|
+
}), dr = O(jt, {
|
|
1187
|
+
name: "JoyAutocomplete",
|
|
1188
|
+
slot: "Listbox",
|
|
1189
|
+
overridesResolver: (e, t) => t.listbox
|
|
1190
|
+
})(({
|
|
1191
|
+
theme: e
|
|
1192
|
+
}) => ({
|
|
1193
|
+
// `unstable_popup-zIndex` is a private variable that lets other component, for example Modal, to override the z-index so that the listbox can be displayed above the Modal.
|
|
1194
|
+
zIndex: `var(--unstable_popup-zIndex, ${e.vars.zIndex.popup})`
|
|
1195
|
+
})), mr = O(Vt, {
|
|
1196
|
+
name: "JoyAutocomplete",
|
|
1197
|
+
slot: "Option",
|
|
1198
|
+
overridesResolver: (e, t) => t.option
|
|
1199
|
+
})({}), fr = O(it, {
|
|
1200
|
+
name: "JoyAutocomplete",
|
|
1201
|
+
slot: "Loading",
|
|
1202
|
+
overridesResolver: (e, t) => t.loading
|
|
1203
|
+
})(({
|
|
1204
|
+
theme: e
|
|
1205
|
+
}) => ({
|
|
1206
|
+
color: (e.vars || e).palette.text.secondary
|
|
1207
|
+
})), gr = O(it, {
|
|
1208
|
+
name: "JoyAutocomplete",
|
|
1209
|
+
slot: "NoOptions",
|
|
1210
|
+
overridesResolver: (e, t) => t.noOptions
|
|
1211
|
+
})(({
|
|
1212
|
+
theme: e
|
|
1213
|
+
}) => ({
|
|
1214
|
+
color: (e.vars || e).palette.text.secondary
|
|
1215
|
+
})), vr = O("div", {
|
|
1216
|
+
name: "JoyAutocomplete",
|
|
1217
|
+
slot: "NoOptions",
|
|
1218
|
+
overridesResolver: (e, t) => t.noOptions
|
|
1219
|
+
})({
|
|
1220
|
+
marginInlineStart: "calc(var(--Input-paddingInline) / 2)",
|
|
1221
|
+
marginBlockStart: "var(--_Input-paddingBlock)"
|
|
1222
|
+
}), Wr = /* @__PURE__ */ u.forwardRef(function(t, l) {
|
|
1223
|
+
var n, d, f, y, L, C, h;
|
|
1224
|
+
const g = he({
|
|
1225
|
+
props: t,
|
|
1226
|
+
name: "JoyAutocomplete"
|
|
1227
|
+
}), {
|
|
1228
|
+
"aria-describedby": D,
|
|
1229
|
+
"aria-label": T,
|
|
1230
|
+
"aria-labelledby": x,
|
|
1231
|
+
autoFocus: k,
|
|
1232
|
+
clearIcon: z = wt || (wt = /* @__PURE__ */ m.jsx(Ro, {
|
|
1233
|
+
fontSize: "md"
|
|
1234
|
+
})),
|
|
1235
|
+
clearText: A = "Clear",
|
|
1236
|
+
closeText: F = "Close",
|
|
1237
|
+
disableClearable: H = !1,
|
|
1238
|
+
disabled: _,
|
|
1239
|
+
endDecorator: J,
|
|
1240
|
+
error: se = !1,
|
|
1241
|
+
forcePopupIcon: ee = "auto",
|
|
1242
|
+
freeSolo: ce = !1,
|
|
1243
|
+
getLimitTagsText: ue = or,
|
|
1244
|
+
getOptionLabel: me = tr,
|
|
1245
|
+
groupBy: ye,
|
|
1246
|
+
id: U,
|
|
1247
|
+
limitTags: b = -1,
|
|
1248
|
+
loading: pe = !1,
|
|
1249
|
+
loadingText: fe = "Loading…",
|
|
1250
|
+
multiple: Le = !1,
|
|
1251
|
+
name: E,
|
|
1252
|
+
noOptionsText: ze = "No options",
|
|
1253
|
+
openText: Fe = "Open",
|
|
1254
|
+
placeholder: Be,
|
|
1255
|
+
popupIcon: Me = Nt || (Nt = /* @__PURE__ */ m.jsx(To, {})),
|
|
1256
|
+
readOnly: G = !1,
|
|
1257
|
+
renderGroup: je = rr,
|
|
1258
|
+
renderOption: _e,
|
|
1259
|
+
renderTags: K,
|
|
1260
|
+
required: W,
|
|
1261
|
+
type: Ve,
|
|
1262
|
+
startDecorator: we,
|
|
1263
|
+
size: M = "md",
|
|
1264
|
+
color: te = "neutral",
|
|
1265
|
+
variant: Y = "outlined",
|
|
1266
|
+
component: at,
|
|
1267
|
+
slots: oe = {},
|
|
1268
|
+
slotProps: Je = {}
|
|
1269
|
+
} = g, Ge = Q(g, Ko), S = u.useContext(kt), a = (n = (d = t.error) != null ? d : S == null ? void 0 : S.error) != null ? n : se, Ce = (f = (y = t.size) != null ? y : S == null ? void 0 : S.size) != null ? f : M, v = (L = t.color) != null ? L : a ? "danger" : (C = S == null ? void 0 : S.color) != null ? C : te, le = (h = _ ?? (S == null ? void 0 : S.disabled)) != null ? h : !1, {
|
|
1270
|
+
getRootProps: Re,
|
|
1271
|
+
getInputProps: We,
|
|
1272
|
+
getPopupIndicatorProps: Ne,
|
|
1273
|
+
getClearProps: Se,
|
|
1274
|
+
getTagProps: Ke,
|
|
1275
|
+
getListboxProps: ct,
|
|
1276
|
+
getOptionProps: Ye,
|
|
1277
|
+
value: Te,
|
|
1278
|
+
dirty: X,
|
|
1279
|
+
popupOpen: P,
|
|
1280
|
+
focused: re,
|
|
1281
|
+
focusedTag: Ue,
|
|
1282
|
+
anchorEl: ve,
|
|
1283
|
+
setAnchorEl: ut,
|
|
1284
|
+
inputValue: be,
|
|
1285
|
+
groupedOptions: Z
|
|
1286
|
+
} = Co(i({}, g, {
|
|
1287
|
+
id: U ?? (S == null ? void 0 : S.htmlFor),
|
|
1288
|
+
componentName: "Autocomplete",
|
|
1289
|
+
unstable_classNamePrefix: "Mui",
|
|
1290
|
+
unstable_isActiveElementInListbox: er
|
|
1291
|
+
})), {
|
|
1292
|
+
onMouseDown: Xe
|
|
1293
|
+
} = We(), {
|
|
1294
|
+
onClick: He
|
|
1295
|
+
} = Re(), Ze = !H && !le && X && !G, ge = (!ce || ee === !0) && ee !== !1, w = i({
|
|
1296
|
+
instanceColor: t.color
|
|
1297
|
+
}, g, {
|
|
1298
|
+
value: Te,
|
|
1299
|
+
disabled: le,
|
|
1300
|
+
focused: re,
|
|
1301
|
+
getOptionLabel: me,
|
|
1302
|
+
hasOptions: !!Z.length,
|
|
1303
|
+
hasClearIcon: Ze,
|
|
1304
|
+
hasPopupIcon: ge,
|
|
1305
|
+
inputFocused: Ue === -1,
|
|
1306
|
+
popupOpen: P,
|
|
1307
|
+
size: Ce,
|
|
1308
|
+
color: v,
|
|
1309
|
+
variant: Y
|
|
1310
|
+
}), B = nr(w), V = i({}, Ge, {
|
|
1311
|
+
component: at,
|
|
1312
|
+
slots: oe,
|
|
1313
|
+
slotProps: Je
|
|
1314
|
+
});
|
|
1315
|
+
let q;
|
|
1316
|
+
if (Le && Te.length > 0) {
|
|
1317
|
+
const p = (ae) => {
|
|
1318
|
+
const j = Ke(ae), {
|
|
1319
|
+
onDelete: de
|
|
1320
|
+
} = j, Pe = Q(j, Yo);
|
|
1321
|
+
return i({
|
|
1322
|
+
disabled: le,
|
|
1323
|
+
size: Ce,
|
|
1324
|
+
onClick: de
|
|
1325
|
+
}, Pe);
|
|
1326
|
+
};
|
|
1327
|
+
K ? q = K(Te, p, w) : q = Te.map((ae, j) => {
|
|
1328
|
+
const de = p({
|
|
1329
|
+
index: j
|
|
1330
|
+
}), {
|
|
1331
|
+
key: Pe
|
|
1332
|
+
} = de, Lt = Q(de, Xo);
|
|
1333
|
+
return /* @__PURE__ */ m.jsx(fo, {
|
|
1334
|
+
size: Ce,
|
|
1335
|
+
variant: "soft",
|
|
1336
|
+
color: "neutral",
|
|
1337
|
+
endDecorator: /* @__PURE__ */ m.jsx(Ho, i({}, Lt), Pe),
|
|
1338
|
+
sx: {
|
|
1339
|
+
minWidth: 0
|
|
1340
|
+
},
|
|
1341
|
+
children: me(ae)
|
|
1342
|
+
}, j);
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
const pt = Et(l, ut), Qe = {
|
|
1346
|
+
[ke.disabled]: le,
|
|
1347
|
+
[ke.error]: a,
|
|
1348
|
+
[ke.focused]: re,
|
|
1349
|
+
[ke.formControl]: !!S
|
|
1350
|
+
}, [et, dt] = R("root", {
|
|
1351
|
+
ref: pt,
|
|
1352
|
+
className: [B.root, Qe],
|
|
1353
|
+
elementType: sr,
|
|
1354
|
+
externalForwardedProps: V,
|
|
1355
|
+
ownerState: w,
|
|
1356
|
+
getSlotProps: Re,
|
|
1357
|
+
additionalProps: {
|
|
1358
|
+
onClick: (p) => {
|
|
1359
|
+
He && He(p), p.currentTarget === p.target && Xe && Xe(p);
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
}), [mt, tt] = R("wrapper", {
|
|
1363
|
+
className: B.wrapper,
|
|
1364
|
+
elementType: lr,
|
|
1365
|
+
externalForwardedProps: V,
|
|
1366
|
+
ownerState: w
|
|
1367
|
+
}), ft = {
|
|
1368
|
+
[ke.disabled]: le
|
|
1369
|
+
}, [gt, vt] = R("input", {
|
|
1370
|
+
className: [B.input, ft],
|
|
1371
|
+
elementType: ir,
|
|
1372
|
+
getSlotProps: (p) => {
|
|
1373
|
+
const ae = We(), {
|
|
1374
|
+
onBlur: j,
|
|
1375
|
+
onFocus: de,
|
|
1376
|
+
onMouseDown: Pe
|
|
1377
|
+
} = ae, Lt = Q(ae, Zo);
|
|
1378
|
+
return i({}, Lt, {
|
|
1379
|
+
onBlur: (Oe) => {
|
|
1380
|
+
var De;
|
|
1381
|
+
j == null || j(Oe), (De = p.onBlur) == null || De.call(p, Oe);
|
|
1382
|
+
},
|
|
1383
|
+
onFocus: (Oe) => {
|
|
1384
|
+
var De;
|
|
1385
|
+
de == null || de(Oe), (De = p.onFocus) == null || De.call(p, Oe);
|
|
1386
|
+
},
|
|
1387
|
+
onMouseDown: (Oe) => {
|
|
1388
|
+
var De;
|
|
1389
|
+
Pe == null || Pe(Oe), (De = p.onMouseDown) == null || De.call(p, Oe);
|
|
1390
|
+
}
|
|
1391
|
+
});
|
|
1392
|
+
},
|
|
1393
|
+
externalForwardedProps: V,
|
|
1394
|
+
ownerState: w,
|
|
1395
|
+
additionalProps: {
|
|
1396
|
+
autoFocus: k,
|
|
1397
|
+
placeholder: Be,
|
|
1398
|
+
name: E,
|
|
1399
|
+
readOnly: G,
|
|
1400
|
+
disabled: le,
|
|
1401
|
+
required: W ?? (S == null ? void 0 : S.required),
|
|
1402
|
+
type: Ve,
|
|
1403
|
+
"aria-invalid": a || void 0,
|
|
1404
|
+
"aria-label": T,
|
|
1405
|
+
"aria-labelledby": x,
|
|
1406
|
+
"aria-describedby": D ?? (S == null ? void 0 : S["aria-describedby"])
|
|
1407
|
+
}
|
|
1408
|
+
}), [bt, ht] = R("startDecorator", {
|
|
1409
|
+
className: B.startDecorator,
|
|
1410
|
+
elementType: ar,
|
|
1411
|
+
externalForwardedProps: V,
|
|
1412
|
+
ownerState: w
|
|
1413
|
+
}), [ot, xt] = R("endDecorator", {
|
|
1414
|
+
className: B.endDecorator,
|
|
1415
|
+
elementType: cr,
|
|
1416
|
+
externalForwardedProps: V,
|
|
1417
|
+
ownerState: w
|
|
1418
|
+
}), [It, yt] = R("clearIndicator", {
|
|
1419
|
+
className: B.clearIndicator,
|
|
1420
|
+
elementType: ur,
|
|
1421
|
+
getSlotProps: Se,
|
|
1422
|
+
externalForwardedProps: V,
|
|
1423
|
+
ownerState: w,
|
|
1424
|
+
getSlotOwnerState: (p) => ({
|
|
1425
|
+
size: p.size || Ce,
|
|
1426
|
+
variant: p.variant || Ee(Y, v).variant || "plain",
|
|
1427
|
+
color: p.color || Ee(Y, v).color || "neutral",
|
|
1428
|
+
disableColorInversion: !!t.color
|
|
1429
|
+
}),
|
|
1430
|
+
additionalProps: {
|
|
1431
|
+
"aria-label": A,
|
|
1432
|
+
title: A
|
|
1433
|
+
}
|
|
1434
|
+
}), [qe, rt] = R("popupIndicator", {
|
|
1435
|
+
className: B.popupIndicator,
|
|
1436
|
+
elementType: pr,
|
|
1437
|
+
getSlotProps: Ne,
|
|
1438
|
+
externalForwardedProps: V,
|
|
1439
|
+
ownerState: w,
|
|
1440
|
+
getSlotOwnerState: (p) => ({
|
|
1441
|
+
size: p.size || Ce,
|
|
1442
|
+
variant: p.variant || Ee(Y, v).variant || "plain",
|
|
1443
|
+
color: p.color || Ee(Y, v).color || "neutral",
|
|
1444
|
+
disableColorInversion: !!t.color
|
|
1445
|
+
}),
|
|
1446
|
+
additionalProps: {
|
|
1447
|
+
disabled: le,
|
|
1448
|
+
"aria-label": P ? F : Fe,
|
|
1449
|
+
title: P ? F : Fe,
|
|
1450
|
+
type: "button"
|
|
1451
|
+
}
|
|
1452
|
+
}), [r, o] = R("listbox", {
|
|
1453
|
+
className: B.listbox,
|
|
1454
|
+
elementType: dr,
|
|
1455
|
+
getSlotProps: ct,
|
|
1456
|
+
externalForwardedProps: V,
|
|
1457
|
+
ownerState: w,
|
|
1458
|
+
getSlotOwnerState: (p) => ({
|
|
1459
|
+
size: p.size || Ce,
|
|
1460
|
+
variant: p.variant || Y,
|
|
1461
|
+
color: p.color || v,
|
|
1462
|
+
disableColorInversion: !p.disablePortal
|
|
1463
|
+
}),
|
|
1464
|
+
additionalProps: {
|
|
1465
|
+
anchorEl: ve,
|
|
1466
|
+
open: P,
|
|
1467
|
+
style: ve ? {
|
|
1468
|
+
width: ve.clientWidth
|
|
1469
|
+
} : {}
|
|
1470
|
+
}
|
|
1471
|
+
}), [s, c] = R("loading", {
|
|
1472
|
+
className: B.loading,
|
|
1473
|
+
elementType: fr,
|
|
1474
|
+
externalForwardedProps: V,
|
|
1475
|
+
ownerState: w
|
|
1476
|
+
}), [I, $] = R("noOptions", {
|
|
1477
|
+
className: B.noOptions,
|
|
1478
|
+
elementType: gr,
|
|
1479
|
+
externalForwardedProps: V,
|
|
1480
|
+
ownerState: w,
|
|
1481
|
+
additionalProps: {
|
|
1482
|
+
role: "presentation",
|
|
1483
|
+
onMouseDown: (p) => {
|
|
1484
|
+
p.preventDefault();
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
}), [N, ie] = R("limitTag", {
|
|
1488
|
+
className: B.limitTag,
|
|
1489
|
+
elementType: vr,
|
|
1490
|
+
externalForwardedProps: V,
|
|
1491
|
+
ownerState: w
|
|
1492
|
+
});
|
|
1493
|
+
if (b > -1 && Array.isArray(q)) {
|
|
1494
|
+
const p = q.length - b;
|
|
1495
|
+
!re && p > 0 && (q = q.splice(0, b), q.push(/* @__PURE__ */ m.jsx(N, i({}, ie, {
|
|
1496
|
+
children: ue(p)
|
|
1497
|
+
}), q.length)));
|
|
1498
|
+
}
|
|
1499
|
+
const [nt, Jt] = R("option", {
|
|
1500
|
+
className: B.option,
|
|
1501
|
+
elementType: mr,
|
|
1502
|
+
externalForwardedProps: V,
|
|
1503
|
+
ownerState: w,
|
|
1504
|
+
getSlotOwnerState: (p) => ({
|
|
1505
|
+
variant: p.variant || Ee(Y, v).variant || "plain",
|
|
1506
|
+
color: p.color || Ee(Y, v).color || "neutral",
|
|
1507
|
+
disableColorInversion: !o.disablePortal
|
|
1508
|
+
}),
|
|
1509
|
+
additionalProps: {
|
|
1510
|
+
as: "li"
|
|
1511
|
+
}
|
|
1512
|
+
}), Wt = _e || ((p, ae) => {
|
|
1513
|
+
const {
|
|
1514
|
+
key: j
|
|
1515
|
+
} = p, de = Q(p, Qo);
|
|
1516
|
+
return /* @__PURE__ */ m.jsx(nt, i({}, de, {
|
|
1517
|
+
children: me(ae)
|
|
1518
|
+
}), j);
|
|
1519
|
+
}), At = (p, ae) => {
|
|
1520
|
+
const j = Ye({
|
|
1521
|
+
option: p,
|
|
1522
|
+
index: ae
|
|
1523
|
+
});
|
|
1524
|
+
return Wt(i({}, Jt, j), p, {
|
|
1525
|
+
// `aria-selected` prop will always by boolean, see useAutocomplete hook.
|
|
1526
|
+
selected: !!j["aria-selected"],
|
|
1527
|
+
inputValue: be,
|
|
1528
|
+
ownerState: w
|
|
1529
|
+
});
|
|
1530
|
+
}, Ut = u.useMemo(() => [{
|
|
1531
|
+
name: "offset",
|
|
1532
|
+
options: {
|
|
1533
|
+
offset: [0, 4]
|
|
1534
|
+
}
|
|
1535
|
+
}, ...o.modifiers || []], [o.modifiers]);
|
|
1536
|
+
let Rt = null;
|
|
1537
|
+
if (ve) {
|
|
1538
|
+
var Tt;
|
|
1539
|
+
Rt = /* @__PURE__ */ m.jsx(Gt, {
|
|
1540
|
+
variant: Y,
|
|
1541
|
+
color: v,
|
|
1542
|
+
children: /* @__PURE__ */ m.jsx(no, {
|
|
1543
|
+
nested: !0,
|
|
1544
|
+
children: /* @__PURE__ */ m.jsxs(r, i({}, o, {
|
|
1545
|
+
className: $e(o.className),
|
|
1546
|
+
modifiers: Ut
|
|
1547
|
+
}, !((Tt = g.slots) != null && Tt.listbox) && {
|
|
1548
|
+
as: so,
|
|
1549
|
+
slots: {
|
|
1550
|
+
root: o.as || "ul"
|
|
1551
|
+
}
|
|
1552
|
+
}, {
|
|
1553
|
+
children: [Z.map((p, ae) => {
|
|
1554
|
+
if (ye) {
|
|
1555
|
+
const j = p;
|
|
1556
|
+
return je({
|
|
1557
|
+
key: String(j.key),
|
|
1558
|
+
group: j.group,
|
|
1559
|
+
children: j.options.map((de, Pe) => At(de, j.index + Pe))
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
return At(p, ae);
|
|
1563
|
+
}), pe && Z.length === 0 ? /* @__PURE__ */ m.jsx(s, i({}, c, {
|
|
1564
|
+
children: fe
|
|
1565
|
+
})) : null, Z.length === 0 && !ce && !pe ? /* @__PURE__ */ m.jsx(I, i({}, $, {
|
|
1566
|
+
children: ze
|
|
1567
|
+
})) : null]
|
|
1568
|
+
}))
|
|
1569
|
+
})
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
return /* @__PURE__ */ m.jsxs(u.Fragment, {
|
|
1573
|
+
children: [/* @__PURE__ */ m.jsxs(et, i({}, dt, {
|
|
1574
|
+
children: [we && /* @__PURE__ */ m.jsx(bt, i({}, ht, {
|
|
1575
|
+
children: we
|
|
1576
|
+
})), /* @__PURE__ */ m.jsxs(mt, i({}, tt, {
|
|
1577
|
+
children: [q, /* @__PURE__ */ m.jsx(gt, i({}, vt))]
|
|
1578
|
+
})), J && /* @__PURE__ */ m.jsx(ot, i({}, xt, {
|
|
1579
|
+
children: J
|
|
1580
|
+
})), Ze ? /* @__PURE__ */ m.jsx(It, i({}, yt, {
|
|
1581
|
+
children: z
|
|
1582
|
+
})) : null, ge ? /* @__PURE__ */ m.jsx(qe, i({}, rt, {
|
|
1583
|
+
children: Me
|
|
1584
|
+
})) : null]
|
|
1585
|
+
})), Rt]
|
|
1586
|
+
});
|
|
1587
|
+
});
|
|
1588
|
+
function br(e) {
|
|
1589
|
+
return Ae("MuiFormControl", e);
|
|
1590
|
+
}
|
|
1591
|
+
const Ht = Ie("MuiFormControl", ["root", "error", "disabled", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "sizeSm", "sizeMd", "sizeLg", "horizontal", "vertical"]), hr = Ie("MuiSwitch", ["root", "checked", "disabled", "action", "input", "thumb", "track", "focusVisible", "readOnly", "colorPrimary", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantOutlined", "variantSoft", "variantSolid", "startDecorator", "endDecorator"]), xr = ["id", "className", "component", "disabled", "required", "error", "color", "size", "orientation", "slots", "slotProps"], Ir = (e) => {
|
|
1592
|
+
const {
|
|
1593
|
+
disabled: t,
|
|
1594
|
+
error: l,
|
|
1595
|
+
size: n,
|
|
1596
|
+
color: d,
|
|
1597
|
+
orientation: f
|
|
1598
|
+
} = e, y = {
|
|
1599
|
+
root: ["root", f, t && "disabled", l && "error", d && `color${ne(d)}`, n && `size${ne(n)}`]
|
|
1600
|
+
};
|
|
1601
|
+
return xe(y, br, {});
|
|
1602
|
+
}, yr = O("div", {
|
|
1603
|
+
name: "JoyFormControl",
|
|
1604
|
+
slot: "Root",
|
|
1605
|
+
overridesResolver: (e, t) => t.root
|
|
1606
|
+
})(({
|
|
1607
|
+
theme: e,
|
|
1608
|
+
ownerState: t
|
|
1609
|
+
}) => {
|
|
1610
|
+
var l, n, d;
|
|
1611
|
+
return i({
|
|
1612
|
+
"--unstable_RadioGroup-margin": "0.5rem 0",
|
|
1613
|
+
"--FormLabel-alignSelf": t.orientation === "horizontal" ? "align-items" : "flex-start",
|
|
1614
|
+
"--FormLabel-asteriskColor": e.vars.palette.danger[500]
|
|
1615
|
+
}, t.size === "sm" && {
|
|
1616
|
+
"--FormLabel-fontSize": e.vars.fontSize.xs,
|
|
1617
|
+
"--FormLabel-lineHeight": e.vars.lineHeight.xl,
|
|
1618
|
+
"--FormLabel-margin": t.orientation === "horizontal" ? "0 0.5rem 0 0" : "0 0 0.25rem 0",
|
|
1619
|
+
"--FormHelperText-fontSize": e.vars.fontSize.xs,
|
|
1620
|
+
"--FormHelperText-lineHeight": e.vars.lineHeight.xl
|
|
1621
|
+
}, t.size === "md" && {
|
|
1622
|
+
"--FormLabel-fontSize": e.vars.fontSize.sm,
|
|
1623
|
+
"--FormLabel-lineHeight": e.vars.lineHeight.sm,
|
|
1624
|
+
"--FormLabel-margin": t.orientation === "horizontal" ? "0 0.75rem 0 0" : "0 0 0.375rem 0",
|
|
1625
|
+
"--FormHelperText-fontSize": e.vars.fontSize.sm,
|
|
1626
|
+
"--FormHelperText-lineHeight": e.vars.lineHeight.sm
|
|
1627
|
+
}, t.size === "lg" && {
|
|
1628
|
+
"--FormLabel-fontSize": e.vars.fontSize.md,
|
|
1629
|
+
"--FormLabel-lineHeight": e.vars.lineHeight.md,
|
|
1630
|
+
"--FormLabel-margin": t.orientation === "horizontal" ? "0 1rem 0 0" : "0 0 0.5rem 0",
|
|
1631
|
+
"--FormHelperText-fontSize": e.vars.fontSize.sm,
|
|
1632
|
+
"--FormHelperText-lineHeight": e.vars.lineHeight.sm
|
|
1633
|
+
}, t.color && {
|
|
1634
|
+
"--FormHelperText-color": (l = e.vars.palette[t.color]) == null ? void 0 : l[500]
|
|
1635
|
+
}, {
|
|
1636
|
+
"--FormHelperText-margin": "0.375rem 0 0 0",
|
|
1637
|
+
[`&.${Ht.error}`]: {
|
|
1638
|
+
"--FormHelperText-color": e.vars.palette.danger[500]
|
|
1639
|
+
},
|
|
1640
|
+
[`&.${Ht.disabled}`]: {
|
|
1641
|
+
"--FormLabel-color": (n = e.variants.plainDisabled) == null || (n = n[t.color || "neutral"]) == null ? void 0 : n.color,
|
|
1642
|
+
"--FormHelperText-color": (d = e.variants.plainDisabled) == null || (d = d[t.color || "neutral"]) == null ? void 0 : d.color
|
|
1643
|
+
},
|
|
1644
|
+
display: "flex",
|
|
1645
|
+
position: "relative",
|
|
1646
|
+
// for keeping the control action area, for example Switch
|
|
1647
|
+
flexDirection: t.orientation === "horizontal" ? "row" : "column"
|
|
1648
|
+
}, t.orientation === "horizontal" && {
|
|
1649
|
+
[`& > label ~ .${hr.root}`]: {
|
|
1650
|
+
"--unstable_Switch-margin": "0 0 0 auto"
|
|
1651
|
+
}
|
|
1652
|
+
});
|
|
1653
|
+
}), Ur = /* @__PURE__ */ u.forwardRef(function(t, l) {
|
|
1654
|
+
const n = he({
|
|
1655
|
+
props: t,
|
|
1656
|
+
name: "JoyFormControl"
|
|
1657
|
+
}), {
|
|
1658
|
+
id: d,
|
|
1659
|
+
className: f,
|
|
1660
|
+
component: y = "div",
|
|
1661
|
+
disabled: L = !1,
|
|
1662
|
+
required: C = !1,
|
|
1663
|
+
error: h = !1,
|
|
1664
|
+
color: g,
|
|
1665
|
+
size: D = "md",
|
|
1666
|
+
orientation: T = "vertical",
|
|
1667
|
+
slots: x = {},
|
|
1668
|
+
slotProps: k = {}
|
|
1669
|
+
} = n, z = Q(n, xr), A = Pt(d), [F, H] = u.useState(null), _ = i({}, n, {
|
|
1670
|
+
id: A,
|
|
1671
|
+
component: y,
|
|
1672
|
+
color: g,
|
|
1673
|
+
disabled: L,
|
|
1674
|
+
error: h,
|
|
1675
|
+
required: C,
|
|
1676
|
+
size: D,
|
|
1677
|
+
orientation: T
|
|
1678
|
+
});
|
|
1679
|
+
let J;
|
|
1680
|
+
const se = Ir(_), [ee, ce] = R("root", {
|
|
1681
|
+
ref: l,
|
|
1682
|
+
className: $e(se.root, f),
|
|
1683
|
+
elementType: yr,
|
|
1684
|
+
externalForwardedProps: i({}, z, {
|
|
1685
|
+
component: y,
|
|
1686
|
+
slots: x,
|
|
1687
|
+
slotProps: k
|
|
1688
|
+
}),
|
|
1689
|
+
ownerState: _
|
|
1690
|
+
}), ue = u.useMemo(() => ({
|
|
1691
|
+
disabled: L,
|
|
1692
|
+
required: C,
|
|
1693
|
+
error: h,
|
|
1694
|
+
color: g,
|
|
1695
|
+
size: D,
|
|
1696
|
+
htmlFor: A,
|
|
1697
|
+
labelId: `${A}-label`,
|
|
1698
|
+
"aria-describedby": F ? `${A}-helper-text` : void 0,
|
|
1699
|
+
setHelperText: H,
|
|
1700
|
+
registerEffect: J
|
|
1701
|
+
}), [g, L, h, F, A, J, C, D]);
|
|
1702
|
+
return /* @__PURE__ */ m.jsx(kt.Provider, {
|
|
1703
|
+
value: ue,
|
|
1704
|
+
children: /* @__PURE__ */ m.jsx(ee, i({}, ce))
|
|
1705
|
+
});
|
|
1706
|
+
});
|
|
1707
|
+
function Lr(e) {
|
|
1708
|
+
return Ae("MuiFormLabel", e);
|
|
1709
|
+
}
|
|
1710
|
+
Ie("MuiFormLabel", ["root", "asterisk"]);
|
|
1711
|
+
const Cr = ["children", "component", "htmlFor", "id", "slots", "slotProps"], Sr = () => xe({
|
|
1712
|
+
root: ["root"],
|
|
1713
|
+
asterisk: ["asterisk"]
|
|
1714
|
+
}, Lr, {}), Pr = O("label", {
|
|
1715
|
+
name: "JoyFormLabel",
|
|
1716
|
+
slot: "Root",
|
|
1717
|
+
overridesResolver: (e, t) => t.root
|
|
1718
|
+
})(({
|
|
1719
|
+
theme: e
|
|
1720
|
+
}) => ({
|
|
1721
|
+
"--Icon-fontSize": "calc(var(--FormLabel-lineHeight) * 1em)",
|
|
1722
|
+
WebkitTapHighlightColor: "transparent",
|
|
1723
|
+
alignSelf: "var(--FormLabel-alignSelf)",
|
|
1724
|
+
// to not fill the block space. It seems like a bug when clicking on empty space (within the label area), even though it is not.
|
|
1725
|
+
display: "flex",
|
|
1726
|
+
gap: "2px",
|
|
1727
|
+
alignItems: "center",
|
|
1728
|
+
flexWrap: "wrap",
|
|
1729
|
+
userSelect: "none",
|
|
1730
|
+
fontFamily: e.vars.fontFamily.body,
|
|
1731
|
+
fontSize: `var(--FormLabel-fontSize, ${e.vars.fontSize.sm})`,
|
|
1732
|
+
fontWeight: e.vars.fontWeight.md,
|
|
1733
|
+
lineHeight: `var(--FormLabel-lineHeight, ${e.vars.lineHeight.sm})`,
|
|
1734
|
+
color: `var(--FormLabel-color, ${e.vars.palette.text.primary})`,
|
|
1735
|
+
margin: "var(--FormLabel-margin, 0px)"
|
|
1736
|
+
})), Or = O("span", {
|
|
1737
|
+
name: "JoyFormLabel",
|
|
1738
|
+
slot: "Asterisk",
|
|
1739
|
+
overridesResolver: (e, t) => t.asterisk
|
|
1740
|
+
})({
|
|
1741
|
+
color: "var(--FormLabel-asteriskColor)"
|
|
1742
|
+
}), qr = /* @__PURE__ */ u.forwardRef(function(t, l) {
|
|
1743
|
+
var n, d;
|
|
1744
|
+
const f = he({
|
|
1745
|
+
props: t,
|
|
1746
|
+
name: "JoyFormLabel"
|
|
1747
|
+
}), {
|
|
1748
|
+
children: y,
|
|
1749
|
+
component: L = "label",
|
|
1750
|
+
htmlFor: C,
|
|
1751
|
+
id: h,
|
|
1752
|
+
slots: g = {},
|
|
1753
|
+
slotProps: D = {}
|
|
1754
|
+
} = f, T = Q(f, Cr), x = u.useContext(kt), k = (n = (d = t.required) != null ? d : x == null ? void 0 : x.required) != null ? n : !1, z = i({}, f, {
|
|
1755
|
+
required: k
|
|
1756
|
+
}), A = Sr(), F = i({}, T, {
|
|
1757
|
+
component: L,
|
|
1758
|
+
slots: g,
|
|
1759
|
+
slotProps: D
|
|
1760
|
+
}), [H, _] = R("root", {
|
|
1761
|
+
additionalProps: {
|
|
1762
|
+
htmlFor: C ?? (x == null ? void 0 : x.htmlFor),
|
|
1763
|
+
id: h ?? (x == null ? void 0 : x.labelId)
|
|
1764
|
+
},
|
|
1765
|
+
ref: l,
|
|
1766
|
+
className: A.root,
|
|
1767
|
+
elementType: Pr,
|
|
1768
|
+
externalForwardedProps: F,
|
|
1769
|
+
ownerState: z
|
|
1770
|
+
}), [J, se] = R("asterisk", {
|
|
1771
|
+
additionalProps: {
|
|
1772
|
+
"aria-hidden": !0
|
|
1773
|
+
},
|
|
1774
|
+
className: A.asterisk,
|
|
1775
|
+
elementType: Or,
|
|
1776
|
+
externalForwardedProps: F,
|
|
1777
|
+
ownerState: z
|
|
1778
|
+
});
|
|
1779
|
+
return /* @__PURE__ */ m.jsxs(H, i({}, _, {
|
|
1780
|
+
children: [y, k && /* @__PURE__ */ m.jsxs(J, i({}, se, {
|
|
1781
|
+
children: [" ", "*"]
|
|
1782
|
+
}))]
|
|
1783
|
+
}));
|
|
1784
|
+
});
|
|
1785
|
+
function Dr(e) {
|
|
1786
|
+
return Ae("MuiListItemContent", e);
|
|
1787
|
+
}
|
|
1788
|
+
Ie("MuiListItemContent", ["root"]);
|
|
1789
|
+
const kr = ["component", "className", "children", "slots", "slotProps"], Ar = () => xe({
|
|
1790
|
+
root: ["root"]
|
|
1791
|
+
}, Dr, {}), Rr = O("div", {
|
|
1792
|
+
name: "JoyListItemContent",
|
|
1793
|
+
slot: "Root",
|
|
1794
|
+
overridesResolver: (e, t) => t.root
|
|
1795
|
+
})({
|
|
1796
|
+
flex: "1 1 auto",
|
|
1797
|
+
minWidth: 0
|
|
1798
|
+
}), Gr = /* @__PURE__ */ u.forwardRef(function(t, l) {
|
|
1799
|
+
const n = he({
|
|
1800
|
+
props: t,
|
|
1801
|
+
name: "JoyListItemContent"
|
|
1802
|
+
}), {
|
|
1803
|
+
component: d,
|
|
1804
|
+
className: f,
|
|
1805
|
+
children: y,
|
|
1806
|
+
slots: L = {},
|
|
1807
|
+
slotProps: C = {}
|
|
1808
|
+
} = n, h = Q(n, kr), g = i({}, n), D = Ar(), T = i({}, h, {
|
|
1809
|
+
component: d,
|
|
1810
|
+
slots: L,
|
|
1811
|
+
slotProps: C
|
|
1812
|
+
}), [x, k] = R("root", {
|
|
1813
|
+
ref: l,
|
|
1814
|
+
className: $e(D.root, f),
|
|
1815
|
+
elementType: Rr,
|
|
1816
|
+
externalForwardedProps: T,
|
|
1817
|
+
ownerState: g
|
|
1818
|
+
});
|
|
1819
|
+
return /* @__PURE__ */ m.jsx(x, i({}, k, {
|
|
1820
|
+
children: y
|
|
1821
|
+
}));
|
|
1822
|
+
});
|
|
1823
|
+
function Tr(e) {
|
|
1824
|
+
return Ae("MuiListItemDecorator", e);
|
|
1825
|
+
}
|
|
1826
|
+
Ie("MuiListItemDecorator", ["root"]);
|
|
1827
|
+
const $r = ["component", "className", "children", "slots", "slotProps"], zr = () => xe({
|
|
1828
|
+
root: ["root"]
|
|
1829
|
+
}, Tr, {}), Fr = O("span", {
|
|
1830
|
+
name: "JoyListItemDecorator",
|
|
1831
|
+
slot: "Root",
|
|
1832
|
+
overridesResolver: (e, t) => t.root
|
|
1833
|
+
})(({
|
|
1834
|
+
ownerState: e
|
|
1835
|
+
}) => i({
|
|
1836
|
+
boxSizing: "border-box",
|
|
1837
|
+
display: "inline-flex",
|
|
1838
|
+
alignItems: `var(--unstable_ListItemDecorator-alignItems, ${e.parentOrientation === "horizontal" ? "center" : "initial"})`
|
|
1839
|
+
}, e.parentOrientation === "horizontal" ? {
|
|
1840
|
+
minInlineSize: "var(--ListItemDecorator-size)",
|
|
1841
|
+
marginInlineEnd: "calc(-1 * var(--ListItem-gap))"
|
|
1842
|
+
} : {
|
|
1843
|
+
minBlockSize: "var(--ListItemDecorator-size)",
|
|
1844
|
+
justifyContent: "center",
|
|
1845
|
+
marginBlockEnd: "calc(-1 * var(--ListItem-gap))"
|
|
1846
|
+
})), Kr = /* @__PURE__ */ u.forwardRef(function(t, l) {
|
|
1847
|
+
const n = he({
|
|
1848
|
+
props: t,
|
|
1849
|
+
name: "JoyListItemDecorator"
|
|
1850
|
+
}), {
|
|
1851
|
+
component: d,
|
|
1852
|
+
className: f,
|
|
1853
|
+
children: y,
|
|
1854
|
+
slots: L = {},
|
|
1855
|
+
slotProps: C = {}
|
|
1856
|
+
} = n, h = Q(n, $r), g = u.useContext(po), D = i({
|
|
1857
|
+
parentOrientation: g
|
|
1858
|
+
}, n), T = zr(), x = i({}, h, {
|
|
1859
|
+
component: d,
|
|
1860
|
+
slots: L,
|
|
1861
|
+
slotProps: C
|
|
1862
|
+
}), [k, z] = R("root", {
|
|
1863
|
+
ref: l,
|
|
1864
|
+
className: $e(T.root, f),
|
|
1865
|
+
elementType: Fr,
|
|
1866
|
+
externalForwardedProps: x,
|
|
1867
|
+
ownerState: D
|
|
1868
|
+
});
|
|
1869
|
+
return /* @__PURE__ */ m.jsx(k, i({}, z, {
|
|
1870
|
+
children: y
|
|
1871
|
+
}));
|
|
1872
|
+
});
|
|
1873
|
+
export {
|
|
1874
|
+
Wr as A,
|
|
1875
|
+
Ro as C,
|
|
1876
|
+
Ur as F,
|
|
1877
|
+
Kr as L,
|
|
1878
|
+
qr as a,
|
|
1879
|
+
Jr as b,
|
|
1880
|
+
Gr as c,
|
|
1881
|
+
it as d
|
|
1882
|
+
};
|