@cgi-learning-hub/ui
Version:
@cgi-learning-hub/ui is an open-source React component library that implements UI for HUB's features
1,688 lines • 56.6 kB
JavaScript
import * as x from "react";
import { P as t } from "./index-Sy88PpwE.js";
import { F as Rt, G as Dt, H as Je, K as Ye, n as ct } from "./identifier-PWESmBq6.js";
import { A as zt, f as he, o as St, i as dt } from "./Select-CpNF3a57.js";
import { i as le } from "./InputBase-BS5oknUK.js";
import { C as jt } from "./Close-DEMecSZ6.js";
import { m as pe } from "./memoTheme-DAFDflPY.js";
import { u as ft } from "./useSlot-BzdKwDQ5.js";
import { jsx as A, jsxs as Ke } from "react/jsx-runtime";
import { u as Nt, s as H, c as Et } from "./DefaultPropsProvider-DqazQPtr.js";
import { u as Ut } from "./useId-CK6Kn3Tn.js";
import { u as gt } from "./useControlled-nm4pBabJ.js";
import { u as Bt } from "./usePreviousProps-ByGlbpJ6.js";
import { a as _e } from "./useEventCallback-Y2KwRxBw.js";
import { s as Wt } from "./Portal-BlK6ttxt.js";
import { P as Mt } from "./Paper-IQckggbn.js";
import { P as Vt } from "./Popper-CfFLBZ7-.js";
import { C as Gt } from "./Chip-DmjZbx_X.js";
import { I as Ft } from "./IconButton-BYvak8Nw.js";
import { c as Tt } from "./chainPropTypes-D9lkm76m.js";
import { i as qt } from "./integerPropType-BihGt2aU.js";
function vt(n) {
return n.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
}
function Kt(n = {}) {
const {
ignoreAccents: i = !0,
ignoreCase: d = !0,
limit: m,
matchFrom: T = "any",
stringify: D,
trim: v = !1
} = n;
return (N, {
inputValue: B,
getOptionLabel: I
}) => {
let $ = v ? B.trim() : B;
d && ($ = $.toLowerCase()), i && ($ = vt($));
const W = $ ? N.filter((ue) => {
let E = (D || I)(ue);
return d && (E = E.toLowerCase()), i && (E = vt(E)), T === "start" ? E.startsWith($) : E.includes($);
}) : N;
return typeof m == "number" ? W.slice(0, m) : W;
};
}
const _t = Kt(), wt = 5, Jt = (n) => {
var i;
return n.current !== null && ((i = n.current.parentElement) == null ? void 0 : i.contains(document.activeElement));
}, Xt = [];
function At(n, i, d, m) {
if (i || n == null || m)
return "";
const T = d(n);
return typeof T == "string" ? T : "";
}
function Yt(n) {
const {
// eslint-disable-next-line @typescript-eslint/naming-convention
unstable_isActiveElementInListbox: i = Jt,
// eslint-disable-next-line @typescript-eslint/naming-convention
unstable_classNamePrefix: d = "Mui",
autoComplete: m = !1,
autoHighlight: T = !1,
autoSelect: D = !1,
blurOnSelect: v = !1,
clearOnBlur: N = !n.freeSolo,
clearOnEscape: B = !1,
componentName: I = "useAutocomplete",
defaultValue: $ = n.multiple ? Xt : null,
disableClearable: W = !1,
disableCloseOnSelect: ue = !1,
disabled: E,
disabledItemsFocusable: Ae = !1,
disableListWrap: Le = !1,
filterOptions: mt = _t,
filterSelectedOptions: ke = !1,
freeSolo: ce = !1,
getOptionDisabled: G,
getOptionKey: Re,
getOptionLabel: Qe = (o) => o.label ?? o,
groupBy: oe,
handleHomeEndKeys: Ze = !n.freeSolo,
id: bt,
includeInputInList: ye = !1,
inputValue: De,
isOptionEqualToValue: Y = (o, e) => o === e,
multiple: u = !1,
onChange: et,
onClose: tt,
onHighlightChange: Ne,
onInputChange: Q,
onOpen: Ee,
open: ht,
openOnFocus: yt = !1,
options: xt,
readOnly: K = !1,
renderValue: L,
selectOnFocus: ot = !n.freeSolo,
value: Me
} = n, M = Ut(bt);
let S = Qe;
S = (o) => {
const e = Qe(o);
if (typeof e != "string") {
if (process.env.NODE_ENV !== "production") {
const r = e === void 0 ? "undefined" : `${typeof e} (${e})`;
console.error(`MUI: The \`getOptionLabel\` method of ${I} returned ${r} instead of a string for ${JSON.stringify(o)}.`);
}
return String(e);
}
return e;
};
const xe = x.useRef(!1), Ie = x.useRef(!0), h = x.useRef(null), F = x.useRef(null), [Oe, It] = x.useState(null), [V, Ve] = x.useState(-1), nt = T ? 0 : -1, C = x.useRef(nt), Ot = x.useRef(At($ ?? Me, u, S)).current, [s, Pe] = gt({
controlled: Me,
default: $,
name: I
}), [g, ne] = gt({
controlled: De,
default: Ot,
name: I,
state: "inputValue"
}), [de, Fe] = x.useState(!1), fe = x.useCallback((o, e, r) => {
if (!(u ? s.length < e.length : e !== null) && !N)
return;
const a = At(e, u, S, L);
g !== a && (ne(a), Q && Q(o, a, r));
}, [S, g, u, Q, ne, N, s, L]), [_, re] = gt({
controlled: ht,
default: !1,
name: I,
state: "open"
}), [Pt, ge] = x.useState(!0), He = !u && s != null && g === S(s), k = _ && !K, b = k ? mt(
xt.filter((o) => !(ke && (u ? s : [s]).some((e) => e !== null && Y(o, e)))),
// we use the empty string to manipulate `filterOptions` to not filter any options
// i.e. the filter predicate always returns true
{
inputValue: He && Pt ? "" : g,
getOptionLabel: S
}
) : [], z = Bt({
filteredOptions: b,
value: s,
inputValue: g
});
x.useEffect(() => {
const o = s !== z.value;
de && !o || ce && !o || fe(null, s, "reset");
}, [s, fe, de, z.value, ce]);
const ze = _ && b.length > 0 && !K, j = _e((o) => {
if (o === -1)
h.current.focus();
else {
const e = L ? "data-item-index" : "data-tag-index";
Oe.querySelector(`[${e}="${o}"]`).focus();
}
});
x.useEffect(() => {
u && V > s.length - 1 && (Ve(-1), j(-1));
}, [s, u, V, j]);
function rt(o, e) {
if (!F.current || o < 0 || o >= b.length)
return -1;
let r = o;
for (; ; ) {
const p = F.current.querySelector(`[data-option-index="${r}"]`), a = Ae ? !1 : !p || p.disabled || p.getAttribute("aria-disabled") === "true";
if (p && p.hasAttribute("tabindex") && !a)
return r;
if (e === "next" ? r = (r + 1) % b.length : r = (r - 1 + b.length) % b.length, r === o)
return -1;
}
}
const J = _e(({
event: o,
index: e,
reason: r
}) => {
if (C.current = e, e === -1 ? h.current.removeAttribute("aria-activedescendant") : h.current.setAttribute("aria-activedescendant", `${M}-option-${e}`), Ne && ["mouse", "keyboard", "touch"].includes(r) && Ne(o, e === -1 ? null : b[e], r), !F.current)
return;
const p = F.current.querySelector(`[role="option"].${d}-focused`);
p && (p.classList.remove(`${d}-focused`), p.classList.remove(`${d}-focusVisible`));
let a = F.current;
if (F.current.getAttribute("role") !== "listbox" && (a = F.current.parentElement.querySelector('[role="listbox"]')), !a)
return;
if (e === -1) {
a.scrollTop = 0;
return;
}
const f = F.current.querySelector(`[data-option-index="${e}"]`);
if (f && (f.classList.add(`${d}-focused`), r === "keyboard" && f.classList.add(`${d}-focusVisible`), a.scrollHeight > a.clientHeight && r !== "mouse" && r !== "touch")) {
const y = f, w = a.clientHeight + a.scrollTop, ve = y.offsetTop + y.offsetHeight;
ve > w ? a.scrollTop = ve - a.clientHeight : y.offsetTop - y.offsetHeight * (oe ? 1.3 : 0) < a.scrollTop && (a.scrollTop = y.offsetTop - y.offsetHeight * (oe ? 1.3 : 0));
}
}), U = _e(({
event: o,
diff: e,
direction: r = "next",
reason: p
}) => {
if (!k)
return;
const f = rt((() => {
const y = b.length - 1;
if (e === "reset")
return nt;
if (e === "start")
return 0;
if (e === "end")
return y;
const w = C.current + e;
return w < 0 ? w === -1 && ye ? -1 : Le && C.current !== -1 || Math.abs(e) > 1 ? 0 : y : w > y ? w === y + 1 && ye ? -1 : Le || Math.abs(e) > 1 ? y : 0 : w;
})(), r);
if (J({
index: f,
reason: p,
event: o
}), m && e !== "reset")
if (f === -1)
h.current.value = g;
else {
const y = S(b[f]);
h.current.value = y, y.toLowerCase().indexOf(g.toLowerCase()) === 0 && g.length > 0 && h.current.setSelectionRange(g.length, y.length);
}
}), at = () => {
const o = (e, r) => {
const p = e ? S(e) : "", a = r ? S(r) : "";
return p === a;
};
if (C.current !== -1 && z.filteredOptions && z.filteredOptions.length !== b.length && z.inputValue === g && (u ? s.length === z.value.length && z.value.every((e, r) => S(s[r]) === S(e)) : o(z.value, s))) {
const e = z.filteredOptions[C.current];
if (e)
return b.findIndex((r) => S(r) === S(e));
}
return -1;
}, Ce = x.useCallback(() => {
if (!k)
return;
const o = at();
if (o !== -1) {
C.current = o;
return;
}
const e = u ? s[0] : s;
if (b.length === 0 || e == null) {
U({
diff: "reset"
});
return;
}
if (F.current) {
if (e != null) {
const r = b[C.current];
if (u && r && s.findIndex((a) => Y(r, a)) !== -1)
return;
const p = b.findIndex((a) => Y(a, e));
p === -1 ? U({
diff: "reset"
}) : J({
index: p
});
return;
}
if (C.current >= b.length - 1) {
J({
index: b.length - 1
});
return;
}
J({
index: C.current
});
}
}, [
// Only sync the highlighted index when the option switch between empty and not
b.length,
// Don't sync the highlighted index with the value when multiple
// eslint-disable-next-line react-hooks/exhaustive-deps
u ? !1 : s,
ke,
U,
J,
k,
g,
u
]), it = _e((o) => {
Wt(F, o), o && Ce();
});
process.env.NODE_ENV !== "production" && x.useEffect(() => {
(!h.current || h.current.nodeName !== "INPUT") && (h.current && h.current.nodeName === "TEXTAREA" ? console.warn([`A textarea element was provided to ${I} where input was expected.`, "This is not a supported scenario but it may work under certain conditions.", "A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).", "Make sure to test keyboard navigation and add custom event handlers if necessary."].join(`
`)) : console.error([`MUI: Unable to find the input element. It was resolved to ${h.current} while an HTMLInputElement was expected.`, `Instead, ${I} expects an input element.`, "", I === "useAutocomplete" ? "Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed." : "Make sure you have customized the input component correctly."].join(`
`)));
}, [I]), x.useEffect(() => {
Ce();
}, [Ce]);
const R = (o) => {
_ || (re(!0), ge(!0), Ee && Ee(o));
}, ae = (o, e) => {
_ && (re(!1), tt && tt(o, e));
}, X = (o, e, r, p) => {
if (u) {
if (s.length === e.length && s.every((a, f) => a === e[f]))
return;
} else if (s === e)
return;
et && et(o, e, r, p), Pe(e);
}, me = x.useRef(!1), q = (o, e, r = "selectOption", p = "options") => {
let a = r, f = e;
if (u) {
if (f = Array.isArray(s) ? s.slice() : [], process.env.NODE_ENV !== "production") {
const w = f.filter((ve) => Y(e, ve));
w.length > 1 && console.error([`MUI: The \`isOptionEqualToValue\` method of ${I} does not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${w.length} matches.`].join(`
`));
}
const y = f.findIndex((w) => Y(e, w));
y === -1 ? f.push(e) : p !== "freeSolo" && (f.splice(y, 1), a = "removeOption");
}
fe(o, f, a), X(o, f, a, {
option: e
}), !ue && (!o || !o.ctrlKey && !o.metaKey) && ae(o, a), (v === !0 || v === "touch" && me.current || v === "mouse" && !me.current) && h.current.blur();
};
function je(o, e) {
if (o === -1)
return -1;
let r = o;
for (; ; ) {
if (e === "next" && r === s.length || e === "previous" && r === -1)
return -1;
const p = L ? "data-item-index" : "data-tag-index", a = Oe.querySelector(`[${p}="${r}"]`);
if (!a || !a.hasAttribute("tabindex") || a.disabled || a.getAttribute("aria-disabled") === "true")
r += e === "next" ? 1 : -1;
else
return r;
}
}
const Ue = (o, e) => {
if (!u)
return;
g === "" && ae(o, "toggleInput");
let r = V;
V === -1 ? g === "" && e === "previous" && (r = s.length - 1) : (r += e === "next" ? 1 : -1, r < 0 && (r = 0), r === s.length && (r = -1)), r = je(r, e), Ve(r), j(r);
}, ie = (o) => {
xe.current = !0, ne(""), Q && Q(o, "", "clear"), X(o, u ? [] : null, "clear");
}, st = (o) => (e) => {
if (o.onKeyDown && o.onKeyDown(e), !e.defaultMuiPrevented && (V !== -1 && !["ArrowLeft", "ArrowRight"].includes(e.key) && (Ve(-1), j(-1)), e.which !== 229))
switch (e.key) {
case "Home":
k && Ze && (e.preventDefault(), U({
diff: "start",
direction: "next",
reason: "keyboard",
event: e
}));
break;
case "End":
k && Ze && (e.preventDefault(), U({
diff: "end",
direction: "previous",
reason: "keyboard",
event: e
}));
break;
case "PageUp":
e.preventDefault(), U({
diff: -wt,
direction: "previous",
reason: "keyboard",
event: e
}), R(e);
break;
case "PageDown":
e.preventDefault(), U({
diff: wt,
direction: "next",
reason: "keyboard",
event: e
}), R(e);
break;
case "ArrowDown":
e.preventDefault(), U({
diff: 1,
direction: "next",
reason: "keyboard",
event: e
}), R(e);
break;
case "ArrowUp":
e.preventDefault(), U({
diff: -1,
direction: "previous",
reason: "keyboard",
event: e
}), R(e);
break;
case "ArrowLeft":
!u && L ? j(0) : Ue(e, "previous");
break;
case "ArrowRight":
!u && L ? j(-1) : Ue(e, "next");
break;
case "Enter":
if (C.current !== -1 && k) {
const r = b[C.current], p = G ? G(r) : !1;
if (e.preventDefault(), p)
return;
q(e, r, "selectOption"), m && h.current.setSelectionRange(h.current.value.length, h.current.value.length);
} else ce && g !== "" && He === !1 && (u && e.preventDefault(), q(e, g, "createOption", "freeSolo"));
break;
case "Escape":
k ? (e.preventDefault(), e.stopPropagation(), ae(e, "escape")) : B && (g !== "" || u && s.length > 0 || L) && (e.preventDefault(), e.stopPropagation(), ie(e));
break;
case "Backspace":
if (u && !K && g === "" && s.length > 0) {
const r = V === -1 ? s.length - 1 : V, p = s.slice();
p.splice(r, 1), X(e, p, "removeOption", {
option: s[r]
});
}
!u && L && !K && (Pe(null), j(-1));
break;
case "Delete":
if (u && !K && g === "" && s.length > 0 && V !== -1) {
const r = V, p = s.slice();
p.splice(r, 1), X(e, p, "removeOption", {
option: s[r]
});
}
!u && L && !K && (Pe(null), j(-1));
break;
}
}, lt = (o) => {
Fe(!0), yt && !xe.current && R(o);
}, se = (o) => {
if (i(F)) {
h.current.focus();
return;
}
Fe(!1), Ie.current = !0, xe.current = !1, D && C.current !== -1 && k ? q(o, b[C.current], "blur") : D && ce && g !== "" ? q(o, g, "blur", "freeSolo") : N && fe(o, s, "blur"), ae(o, "blur");
}, $e = (o) => {
const e = o.target.value;
g !== e && (ne(e), ge(!1), Q && Q(o, e, "input")), e === "" ? !W && !u && X(o, null, "clear") : R(o);
}, Se = (o) => {
const e = Number(o.currentTarget.getAttribute("data-option-index"));
C.current !== e && J({
event: o,
index: e,
reason: "mouse"
});
}, pt = (o) => {
J({
event: o,
index: Number(o.currentTarget.getAttribute("data-option-index")),
reason: "touch"
}), me.current = !0;
}, ut = (o) => {
const e = Number(o.currentTarget.getAttribute("data-option-index"));
q(o, b[e], "selectOption"), me.current = !1;
}, Be = (o) => (e) => {
const r = s.slice();
r.splice(o, 1), X(e, r, "removeOption", {
option: s[o]
});
}, Ct = (o) => {
X(o, null, "removeOption", {
option: s
});
}, be = (o) => {
_ ? ae(o, "toggleInput") : R(o);
}, O = (o) => {
o.currentTarget.contains(o.target) && o.target.getAttribute("id") !== M && o.preventDefault();
}, P = (o) => {
o.currentTarget.contains(o.target) && (h.current.focus(), ot && Ie.current && h.current.selectionEnd - h.current.selectionStart === 0 && h.current.select(), Ie.current = !1);
}, Z = (o) => {
!E && (g === "" || !_) && be(o);
};
let Te = ce && g.length > 0;
Te = Te || (u ? s.length > 0 : s !== null);
let We = b;
if (oe) {
const o = /* @__PURE__ */ new Map();
let e = !1;
We = b.reduce((r, p, a) => {
const f = oe(p);
return r.length > 0 && r[r.length - 1].group === f ? r[r.length - 1].options.push(p) : (process.env.NODE_ENV !== "production" && (o.get(f) && !e && (console.warn(`MUI: The options provided combined with the \`groupBy\` method of ${I} returns duplicated headers.`, "You can solve the issue by sorting the options with the output of `groupBy`."), e = !0), o.set(f, !0)), r.push({
key: a,
index: a,
group: f,
options: [p]
})), r;
}, []);
}
return E && de && se(), {
getRootProps: (o = {}) => ({
...o,
onKeyDown: st(o),
onMouseDown: O,
onClick: P
}),
getInputLabelProps: () => ({
id: `${M}-label`,
htmlFor: M
}),
getInputProps: () => ({
id: M,
value: g,
onBlur: se,
onFocus: lt,
onChange: $e,
onMouseDown: Z,
// if open then this is handled imperatively so don't let react override
// only have an opinion about this when closed
"aria-activedescendant": k ? "" : null,
"aria-autocomplete": m ? "both" : "list",
"aria-controls": ze ? `${M}-listbox` : void 0,
"aria-expanded": ze,
// Disable browser's suggestion that might overlap with the popup.
// Handle autocomplete but not autofill.
autoComplete: "off",
ref: h,
autoCapitalize: "none",
spellCheck: "false",
role: "combobox",
disabled: E
}),
getClearProps: () => ({
tabIndex: -1,
type: "button",
onClick: ie
}),
getItemProps: ({
index: o = 0
} = {}) => ({
...u && {
key: o
},
...L ? {
"data-item-index": o
} : {
"data-tag-index": o
},
tabIndex: -1,
...!K && {
onDelete: u ? Be(o) : Ct
}
}),
getPopupIndicatorProps: () => ({
tabIndex: -1,
type: "button",
onClick: be
}),
// deprecated
getTagProps: ({
index: o
}) => ({
key: o,
"data-tag-index": o,
tabIndex: -1,
...!K && {
onDelete: Be(o)
}
}),
getListboxProps: () => ({
role: "listbox",
id: `${M}-listbox`,
"aria-labelledby": `${M}-label`,
ref: it,
onMouseDown: (o) => {
o.preventDefault();
}
}),
getOptionProps: ({
index: o,
option: e
}) => {
const r = (u ? s : [s]).some((a) => a != null && Y(e, a)), p = G ? G(e) : !1;
return {
key: (Re == null ? void 0 : Re(e)) ?? S(e),
tabIndex: -1,
role: "option",
id: `${M}-option-${o}`,
onMouseMove: Se,
onClick: ut,
onTouchStart: pt,
"data-option-index": o,
"aria-disabled": p,
"aria-selected": r
};
},
id: M,
inputValue: g,
value: s,
dirty: Te,
expanded: k && Oe,
popupOpen: k,
focused: de || V !== -1,
anchorEl: Oe,
setAnchorEl: It,
focusedItem: V,
// deprecated
focusedTag: V,
groupedOptions: We
};
}
function Qt(n) {
return Dt("MuiListSubheader", n);
}
const Mo = Rt("MuiListSubheader", ["root", "colorPrimary", "colorInherit", "gutters", "inset", "sticky"]), Zt = (n) => {
const {
classes: i,
color: d,
disableGutters: m,
inset: T,
disableSticky: D
} = n, v = {
root: ["root", d !== "default" && `color${Ye(d)}`, !m && "gutters", T && "inset", !D && "sticky"]
};
return Et(v, Qt, i);
}, eo = H("li", {
name: "MuiListSubheader",
slot: "Root",
overridesResolver: (n, i) => {
const {
ownerState: d
} = n;
return [i.root, d.color !== "default" && i[`color${Ye(d.color)}`], !d.disableGutters && i.gutters, d.inset && i.inset, !d.disableSticky && i.sticky];
}
})(pe(({
theme: n
}) => ({
boxSizing: "border-box",
lineHeight: "48px",
listStyle: "none",
color: (n.vars || n).palette.text.secondary,
fontFamily: n.typography.fontFamily,
fontWeight: n.typography.fontWeightMedium,
fontSize: n.typography.pxToRem(14),
variants: [{
props: {
color: "primary"
},
style: {
color: (n.vars || n).palette.primary.main
}
}, {
props: {
color: "inherit"
},
style: {
color: "inherit"
}
}, {
props: ({
ownerState: i
}) => !i.disableGutters,
style: {
paddingLeft: 16,
paddingRight: 16
}
}, {
props: ({
ownerState: i
}) => i.inset,
style: {
paddingLeft: 72
}
}, {
props: ({
ownerState: i
}) => !i.disableSticky,
style: {
position: "sticky",
top: 0,
zIndex: 1,
backgroundColor: (n.vars || n).palette.background.paper
}
}]
}))), Xe = /* @__PURE__ */ x.forwardRef(function(i, d) {
const m = Nt({
props: i,
name: "MuiListSubheader"
}), {
className: T,
color: D = "default",
component: v = "li",
disableGutters: N = !1,
disableSticky: B = !1,
inset: I = !1,
...$
} = m, W = {
...m,
color: D,
component: v,
disableGutters: N,
disableSticky: B,
inset: I
}, ue = Zt(W);
return /* @__PURE__ */ A(eo, {
as: v,
className: Je(ue.root, T),
ref: d,
ownerState: W,
...$
});
});
Xe && (Xe.muiSkipListHighlight = !0);
process.env.NODE_ENV !== "production" && (Xe.propTypes = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* The content of the component.
*/
children: t.node,
/**
* Override or extend the styles applied to the component.
*/
classes: t.object,
/**
* @ignore
*/
className: t.string,
/**
* The color of the component. It supports those theme colors that make sense for this component.
* @default 'default'
*/
color: t.oneOf(["default", "inherit", "primary"]),
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: t.elementType,
/**
* If `true`, the List Subheader will not have gutters.
* @default false
*/
disableGutters: t.bool,
/**
* If `true`, the List Subheader will not stick to the top during scroll.
* @default false
*/
disableSticky: t.bool,
/**
* If `true`, the List Subheader is indented.
* @default false
*/
inset: t.bool,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
});
function to(n) {
return Dt("MuiAutocomplete", n);
}
const l = Rt("MuiAutocomplete", ["root", "expanded", "fullWidth", "focused", "focusVisible", "tag", "tagSizeSmall", "tagSizeMedium", "hasPopupIcon", "hasClearIcon", "inputRoot", "input", "inputFocused", "endAdornment", "clearIndicator", "popupIndicator", "popupIndicatorOpen", "popper", "popperDisablePortal", "paper", "listbox", "loading", "noOptions", "option", "groupLabel", "groupUl"]);
var Lt, kt;
const oo = (n) => {
const {
classes: i,
disablePortal: d,
expanded: m,
focused: T,
fullWidth: D,
hasClearIcon: v,
hasPopupIcon: N,
inputFocused: B,
popupOpen: I,
size: $
} = n, W = {
root: ["root", m && "expanded", T && "focused", D && "fullWidth", v && "hasClearIcon", N && "hasPopupIcon"],
inputRoot: ["inputRoot"],
input: ["input", B && "inputFocused"],
tag: ["tag", `tagSize${Ye($)}`],
endAdornment: ["endAdornment"],
clearIndicator: ["clearIndicator"],
popupIndicator: ["popupIndicator", I && "popupIndicatorOpen"],
popper: ["popper", d && "popperDisablePortal"],
paper: ["paper"],
listbox: ["listbox"],
loading: ["loading"],
noOptions: ["noOptions"],
option: ["option"],
groupLabel: ["groupLabel"],
groupUl: ["groupUl"]
};
return Et(W, to, i);
}, no = H("div", {
name: "MuiAutocomplete",
slot: "Root",
overridesResolver: (n, i) => {
const {
ownerState: d
} = n, {
fullWidth: m,
hasClearIcon: T,
hasPopupIcon: D,
inputFocused: v,
size: N
} = d;
return [{
[`& .${l.tag}`]: i.tag
}, {
[`& .${l.tag}`]: i[`tagSize${Ye(N)}`]
}, {
[`& .${l.inputRoot}`]: i.inputRoot
}, {
[`& .${l.input}`]: i.input
}, {
[`& .${l.input}`]: v && i.inputFocused
}, i.root, m && i.fullWidth, D && i.hasPopupIcon, T && i.hasClearIcon];
}
})({
[`&.${l.focused} .${l.clearIndicator}`]: {
visibility: "visible"
},
/* Avoid double tap issue on iOS */
"@media (pointer: fine)": {
[`&:hover .${l.clearIndicator}`]: {
visibility: "visible"
}
},
[`& .${l.tag}`]: {
margin: 3,
maxWidth: "calc(100% - 6px)"
},
[`& .${l.inputRoot}`]: {
[`.${l.hasPopupIcon}&, .${l.hasClearIcon}&`]: {
paddingRight: 30
},
[`.${l.hasPopupIcon}.${l.hasClearIcon}&`]: {
paddingRight: 56
},
[`& .${l.input}`]: {
width: 0,
minWidth: 30
}
},
[`& .${dt.root}`]: {
paddingBottom: 1,
"& .MuiInput-input": {
padding: "4px 4px 4px 0px"
}
},
[`& .${dt.root}.${le.sizeSmall}`]: {
[`& .${dt.input}`]: {
padding: "2px 4px 3px 0"
}
},
[`& .${St.root}`]: {
padding: 9,
[`.${l.hasPopupIcon}&, .${l.hasClearIcon}&`]: {
paddingRight: 39
},
[`.${l.hasPopupIcon}.${l.hasClearIcon}&`]: {
paddingRight: 65
},
[`& .${l.input}`]: {
padding: "7.5px 4px 7.5px 5px"
},
[`& .${l.endAdornment}`]: {
right: 9
}
},
[`& .${St.root}.${le.sizeSmall}`]: {
// Don't specify paddingRight, as it overrides the default value set when there is only
// one of the popup or clear icon as the specificity is equal so the latter one wins
paddingTop: 6,
paddingBottom: 6,
paddingLeft: 6,
[`& .${l.input}`]: {
padding: "2.5px 4px 2.5px 8px"
}
},
[`& .${he.root}`]: {
paddingTop: 19,
paddingLeft: 8,
[`.${l.hasPopupIcon}&, .${l.hasClearIcon}&`]: {
paddingRight: 39
},
[`.${l.hasPopupIcon}.${l.hasClearIcon}&`]: {
paddingRight: 65
},
[`& .${he.input}`]: {
padding: "7px 4px"
},
[`& .${l.endAdornment}`]: {
right: 9
}
},
[`& .${he.root}.${le.sizeSmall}`]: {
paddingBottom: 1,
[`& .${he.input}`]: {
padding: "2.5px 4px"
}
},
[`& .${le.hiddenLabel}`]: {
paddingTop: 8
},
[`& .${he.root}.${le.hiddenLabel}`]: {
paddingTop: 0,
paddingBottom: 0,
[`& .${l.input}`]: {
paddingTop: 16,
paddingBottom: 17
}
},
[`& .${he.root}.${le.hiddenLabel}.${le.sizeSmall}`]: {
[`& .${l.input}`]: {
paddingTop: 8,
paddingBottom: 9
}
},
[`& .${l.input}`]: {
flexGrow: 1,
textOverflow: "ellipsis",
opacity: 0
},
variants: [{
props: {
fullWidth: !0
},
style: {
width: "100%"
}
}, {
props: {
size: "small"
},
style: {
[`& .${l.tag}`]: {
margin: 2,
maxWidth: "calc(100% - 4px)"
}
}
}, {
props: {
inputFocused: !0
},
style: {
[`& .${l.input}`]: {
opacity: 1
}
}
}, {
props: {
multiple: !0
},
style: {
[`& .${l.inputRoot}`]: {
flexWrap: "wrap"
}
}
}]
}), ro = H("div", {
name: "MuiAutocomplete",
slot: "EndAdornment"
})({
// We use a position absolute to support wrapping tags.
position: "absolute",
right: 0,
top: "50%",
transform: "translate(0, -50%)"
}), ao = H(Ft, {
name: "MuiAutocomplete",
slot: "ClearIndicator"
})({
marginRight: -2,
padding: 4,
visibility: "hidden"
}), io = H(Ft, {
name: "MuiAutocomplete",
slot: "PopupIndicator",
overridesResolver: (n, i) => {
const {
ownerState: d
} = n;
return [i.popupIndicator, d.popupOpen && i.popupIndicatorOpen];
}
})({
padding: 2,
marginRight: -2,
variants: [{
props: {
popupOpen: !0
},
style: {
transform: "rotate(180deg)"
}
}]
}), so = H(Vt, {
name: "MuiAutocomplete",
slot: "Popper",
overridesResolver: (n, i) => {
const {
ownerState: d
} = n;
return [{
[`& .${l.option}`]: i.option
}, i.popper, d.disablePortal && i.popperDisablePortal];
}
})(pe(({
theme: n
}) => ({
zIndex: (n.vars || n).zIndex.modal,
variants: [{
props: {
disablePortal: !0
},
style: {
position: "absolute"
}
}]
}))), lo = H(Mt, {
name: "MuiAutocomplete",
slot: "Paper"
})(pe(({
theme: n
}) => ({
...n.typography.body1,
overflow: "auto"
}))), po = H("div", {
name: "MuiAutocomplete",
slot: "Loading"
})(pe(({
theme: n
}) => ({
color: (n.vars || n).palette.text.secondary,
padding: "14px 16px"
}))), uo = H("div", {
name: "MuiAutocomplete",
slot: "NoOptions"
})(pe(({
theme: n
}) => ({
color: (n.vars || n).palette.text.secondary,
padding: "14px 16px"
}))), co = H("ul", {
name: "MuiAutocomplete",
slot: "Listbox"
})(pe(({
theme: n
}) => ({
listStyle: "none",
margin: 0,
padding: "8px 0",
maxHeight: "40vh",
overflow: "auto",
position: "relative",
[`& .${l.option}`]: {
minHeight: 48,
display: "flex",
overflow: "hidden",
justifyContent: "flex-start",
alignItems: "center",
cursor: "pointer",
paddingTop: 6,
boxSizing: "border-box",
outline: "0",
WebkitTapHighlightColor: "transparent",
paddingBottom: 6,
paddingLeft: 16,
paddingRight: 16,
[n.breakpoints.up("sm")]: {
minHeight: "auto"
},
[`&.${l.focused}`]: {
backgroundColor: (n.vars || n).palette.action.hover,
// Reset on touch devices, it doesn't add specificity
"@media (hover: none)": {
backgroundColor: "transparent"
}
},
'&[aria-disabled="true"]': {
opacity: (n.vars || n).palette.action.disabledOpacity,
pointerEvents: "none"
},
[`&.${l.focusVisible}`]: {
backgroundColor: (n.vars || n).palette.action.focus
},
'&[aria-selected="true"]': {
backgroundColor: n.vars ? `rgba(${n.vars.palette.primary.mainChannel} / ${n.vars.palette.action.selectedOpacity})` : ct(n.palette.primary.main, n.palette.action.selectedOpacity),
[`&.${l.focused}`]: {
backgroundColor: n.vars ? `rgba(${n.vars.palette.primary.mainChannel} / calc(${n.vars.palette.action.selectedOpacity} + ${n.vars.palette.action.hoverOpacity}))` : ct(n.palette.primary.main, n.palette.action.selectedOpacity + n.palette.action.hoverOpacity),
// Reset on touch devices, it doesn't add specificity
"@media (hover: none)": {
backgroundColor: (n.vars || n).palette.action.selected
}
},
[`&.${l.focusVisible}`]: {
backgroundColor: n.vars ? `rgba(${n.vars.palette.primary.mainChannel} / calc(${n.vars.palette.action.selectedOpacity} + ${n.vars.palette.action.focusOpacity}))` : ct(n.palette.primary.main, n.palette.action.selectedOpacity + n.palette.action.focusOpacity)
}
}
}
}))), fo = H(Xe, {
name: "MuiAutocomplete",
slot: "GroupLabel"
})(pe(({
theme: n
}) => ({
backgroundColor: (n.vars || n).palette.background.paper,
top: -8
}))), go = H("ul", {
name: "MuiAutocomplete",
slot: "GroupUl"
})({
padding: 0,
[`& .${l.option}`]: {
paddingLeft: 24
}
}), mo = /* @__PURE__ */ x.forwardRef(function(i, d) {
const m = Nt({
props: i,
name: "MuiAutocomplete"
}), {
autoComplete: T = !1,
autoHighlight: D = !1,
autoSelect: v = !1,
blurOnSelect: N = !1,
ChipProps: B,
className: I,
clearIcon: $ = Lt || (Lt = /* @__PURE__ */ A(jt, {
fontSize: "small"
})),
clearOnBlur: W = !m.freeSolo,
clearOnEscape: ue = !1,
clearText: E = "Clear",
closeText: Ae = "Close",
componentsProps: Le,
defaultValue: mt = m.multiple ? [] : null,
disableClearable: ke = !1,
disableCloseOnSelect: ce = !1,
disabled: G = !1,
disabledItemsFocusable: Re = !1,
disableListWrap: Qe = !1,
disablePortal: oe = !1,
filterOptions: Ze,
filterSelectedOptions: bt = !1,
forcePopupIcon: ye = "auto",
freeSolo: De = !1,
fullWidth: Y = !1,
getLimitTagsText: u = (c) => `+${c}`,
getOptionDisabled: et,
getOptionKey: tt,
getOptionLabel: Ne,
isOptionEqualToValue: Q,
groupBy: Ee,
handleHomeEndKeys: ht = !m.freeSolo,
id: yt,
includeInputInList: xt = !1,
inputValue: K,
limitTags: L = -1,
ListboxComponent: ot,
ListboxProps: Me,
loading: M = !1,
loadingText: S = "Loading…",
multiple: xe = !1,
noOptionsText: Ie = "No options",
onChange: h,
onClose: F,
onHighlightChange: Oe,
onInputChange: It,
onOpen: V,
open: Ve,
openOnFocus: nt = !1,
openText: C = "Open",
options: Ot,
PaperComponent: s,
PopperComponent: Pe,
popupIcon: g = kt || (kt = /* @__PURE__ */ A(zt, {})),
readOnly: ne = !1,
renderGroup: de,
renderInput: Fe,
renderOption: fe,
renderTags: _,
renderValue: re,
selectOnFocus: Pt = !m.freeSolo,
size: ge = "medium",
slots: He = {},
slotProps: k = {},
value: b,
...z
} = m, {
getRootProps: ze,
getInputProps: j,
getInputLabelProps: rt,
getPopupIndicatorProps: J,
getClearProps: U,
getItemProps: at,
getListboxProps: Ce,
getOptionProps: it,
value: R,
dirty: ae,
expanded: X,
id: me,
popupOpen: q,
focused: je,
focusedItem: Ue,
anchorEl: ie,
setAnchorEl: st,
inputValue: lt,
groupedOptions: se
} = Yt({
...m,
componentName: "Autocomplete"
}), $e = !ke && !G && ae && !ne, Se = (!De || ye === !0) && ye !== !1, {
onMouseDown: pt
} = j(), {
ref: ut,
...Be
} = Ce(), be = Ne || ((c) => c.label ?? c), O = {
...m,
disablePortal: oe,
expanded: X,
focused: je,
fullWidth: Y,
getOptionLabel: be,
hasClearIcon: $e,
hasPopupIcon: Se,
inputFocused: Ue === -1,
popupOpen: q,
size: ge
}, P = oo(O), Z = {
slots: {
paper: s,
popper: Pe,
...He
},
slotProps: {
chip: B,
listbox: Me,
...Le,
...k
}
}, [Te, We] = ft("listbox", {
elementType: co,
externalForwardedProps: Z,
ownerState: O,
className: P.listbox,
additionalProps: Be,
ref: ut
}), [o, e] = ft("paper", {
elementType: Mt,
externalForwardedProps: Z,
ownerState: O,
className: P.paper
}), [r, p] = ft("popper", {
elementType: Vt,
externalForwardedProps: Z,
ownerState: O,
className: P.popper,
additionalProps: {
disablePortal: oe,
style: {
width: ie ? ie.clientWidth : null
},
role: "presentation",
anchorEl: ie,
open: q
}
});
let a;
const f = (c) => ({
className: P.tag,
disabled: G,
...at(c)
});
if (xe ? R.length > 0 && (_ ? a = _(R, f, O) : re ? a = re(R, f, O) : a = R.map((c, ee) => {
const {
key: te,
...we
} = f({
index: ee
});
return /* @__PURE__ */ A(Gt, {
label: be(c),
size: ge,
...we,
...Z.slotProps.chip
}, te);
})) : re && R != null && (a = re(R, f, O)), L > -1 && Array.isArray(a)) {
const c = a.length - L;
!je && c > 0 && (a = a.splice(0, L), a.push(/* @__PURE__ */ A("span", {
className: P.tag,
children: u(c)
}, a.length)));
}
const w = de || ((c) => /* @__PURE__ */ Ke("li", {
children: [/* @__PURE__ */ A(fo, {
className: P.groupLabel,
ownerState: O,
component: "div",
children: c.group
}), /* @__PURE__ */ A(go, {
className: P.groupUl,
ownerState: O,
children: c.children
})]
}, c.key)), Ht = fe || ((c, ee) => {
const {
key: te,
...we
} = c;
return /* @__PURE__ */ A("li", {
...we,
children: be(ee)
}, te);
}), $t = (c, ee) => {
const te = it({
option: c,
index: ee
});
return Ht({
...te,
className: P.option
}, c, {
selected: te["aria-selected"],
index: ee,
inputValue: lt
}, O);
}, Ge = Z.slotProps.clearIndicator, qe = Z.slotProps.popupIndicator;
return /* @__PURE__ */ Ke(x.Fragment, {
children: [/* @__PURE__ */ A(no, {
ref: d,
className: Je(P.root, I),
ownerState: O,
...ze(z),
children: Fe({
id: me,
disabled: G,
fullWidth: !0,
size: ge === "small" ? "small" : void 0,
InputLabelProps: rt(),
InputProps: {
ref: st,
className: P.inputRoot,
startAdornment: a,
onMouseDown: (c) => {
c.target === c.currentTarget && pt(c);
},
...($e || Se) && {
endAdornment: /* @__PURE__ */ Ke(ro, {
className: P.endAdornment,
ownerState: O,
children: [$e ? /* @__PURE__ */ A(ao, {
...U(),
"aria-label": E,
title: E,
ownerState: O,
...Ge,
className: Je(P.clearIndicator, Ge == null ? void 0 : Ge.className),
children: $
}) : null, Se ? /* @__PURE__ */ A(io, {
...J(),
disabled: G,
"aria-label": q ? Ae : C,
title: q ? Ae : C,
ownerState: O,
...qe,
className: Je(P.popupIndicator, qe == null ? void 0 : qe.className),
children: g
}) : null]
})
}
},
inputProps: {
className: P.input,
disabled: G,
readOnly: ne,
...j()
}
})
}), ie ? /* @__PURE__ */ A(so, {
as: r,
...p,
children: /* @__PURE__ */ Ke(lo, {
as: o,
...e,
children: [M && se.length === 0 ? /* @__PURE__ */ A(po, {
className: P.loading,
ownerState: O,
children: S
}) : null, se.length === 0 && !De && !M ? /* @__PURE__ */ A(uo, {
className: P.noOptions,
ownerState: O,
role: "presentation",
onMouseDown: (c) => {
c.preventDefault();
},
children: Ie
}) : null, se.length > 0 ? /* @__PURE__ */ A(Te, {
as: ot,
...We,
children: se.map((c, ee) => Ee ? w({
key: c.key,
group: c.group,
children: c.options.map((te, we) => $t(te, c.index + we))
}) : $t(c, ee))
}) : null]
})
}) : null]
});
});
process.env.NODE_ENV !== "production" && (mo.propTypes = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* If `true`, the portion of the selected suggestion that the user hasn't typed,
* known as the completion string, appears inline after the input cursor in the textbox.
* The inline completion string is visually highlighted and has a selected state.
* @default false
*/
autoComplete: t.bool,
/**
* If `true`, the first option is automatically highlighted.
* @default false
*/
autoHighlight: t.bool,
/**
* If `true`, the selected option becomes the value of the input
* when the Autocomplete loses focus unless the user chooses
* a different option or changes the character string in the input.
*
* When using the `freeSolo` mode, the typed value will be the input value
* if the Autocomplete loses focus without highlighting an option.
* @default false
*/
autoSelect: t.bool,
/**
* Control if the input should be blurred when an option is selected:
*
* - `false` the input is not blurred.
* - `true` the input is always blurred.
* - `touch` the input is blurred after a touch event.
* - `mouse` the input is blurred after a mouse event.
* @default false
*/
blurOnSelect: t.oneOfType([t.oneOf(["mouse", "touch"]), t.bool]),
/**
* Props applied to the [`Chip`](https://mui.com/material-ui/api/chip/) element.
* @deprecated Use `slotProps.chip` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
*/
ChipProps: t.object,
/**
* Override or extend the styles applied to the component.
*/
classes: t.object,
/**
* @ignore
*/
className: t.string,
/**
* The icon to display in place of the default clear icon.
* @default <ClearIcon fontSize="small" />
*/
clearIcon: t.node,
/**
* If `true`, the input's text is cleared on blur if no value is selected.
*
* Set it to `true` if you want to help the user enter a new value.
* Set it to `false` if you want to help the user resume their search.
* @default !props.freeSolo
*/
clearOnBlur: t.bool,
/**
* If `true`, clear all values when the user presses escape and the popup is closed.
* @default false
*/
clearOnEscape: t.bool,
/**
* Override the default text for the *clear* icon button.
*
* For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
* @default 'Clear'
*/
clearText: t.string,
/**
* Override the default text for the *close popup* icon button.
*
* For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
* @default 'Close'
*/
closeText: t.string,
/**
* The props used for each slot inside.
* @deprecated Use the `slotProps` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
*/
componentsProps: t.shape({
clearIndicator: t.object,
paper: t.object,
popper: t.object,
popupIndicator: t.object
}),
/**
* The default value. Use when the component is not controlled.
* @default props.multiple ? [] : null
*/
defaultValue: Tt(t.any, (n) => n.multiple && n.defaultValue !== void 0 && !Array.isArray(n.defaultValue) ? new Error(["MUI: The Autocomplete expects the `defaultValue` prop to be an array when `multiple={true}` or undefined.", `However, ${n.defaultValue} was provided.`].join(`
`)) : null),
/**
* If `true`, the input can't be cleared.
* @default false
*/
disableClearable: t.bool,
/**
* If `true`, the popup won't close when a value is selected.
* @default false
*/
disableCloseOnSelect: t.bool,
/**
* If `true`, the component is disabled.
* @default false
*/
disabled: t.bool,
/**
* If `true`, will allow focus on disabled items.
* @default false
*/
disabledItemsFocusable: t.bool,
/**
* If `true`, the list box in the popup will not wrap focus.
* @default false
*/
disableListWrap: t.bool,
/**
* If `true`, the `Popper` content will be under the DOM hierarchy of the parent component.
* @default false
*/
disablePortal: t.bool,
/**
* A function that determines the filtered options to be rendered on search.
*
* @default createFilterOptions()
* @param {Value[]} options The options to render.
* @param {object} state The state of the component.
* @returns {Value[]}
*/
filterOptions: t.func,
/**
* If `true`, hide the selected options from the list box.
* @default false
*/
filterSelectedOptions: t.bool,
/**
* Force the visibility display of the popup icon.
* @default 'auto'
*/
forcePopupIcon: t.oneOfType([t.oneOf(["auto"]), t.bool]),
/**
* If `true`, the Autocomplete is free solo, meaning that the user input is not bound to provided options.
* @default false
*/
freeSolo: t.bool,
/**
* If `true`, the input will take up the full width of its container.
* @default false
*/
fullWidth: t.bool,
/**
* The label to display when the tags are truncated (`limitTags`).
*
* @param {number} more The number of truncated tags.
* @returns {ReactNode}
* @default (more) => `+${more}`
*/
getLimitTagsText: t.func,
/**
* Used to determine the disabled state for a given option.
*
* @param {Value} option The option to test.
* @returns {boolean}
*/
getOptionDisabled: t.func,
/**
* Used to determine the key for a given option.
* This can be useful when the labels of options are not unique (since labels are used as keys by default).
*
* @param {Value} option The option to get the key for.
* @returns {string | number}
*/
getOptionKey: t.func,
/**
* Used to determine the string value for a given option.
* It's used to fill the input (and the list box options if `renderOption` is not provided).
*
* If used in free solo mode, it must accept both the type of the options and a string.
*
* @param {Value} option
* @returns {string}
* @default (option) => option.label ?? option
*/
getOptionLabel: t.func,
/**
* If provided, the options will be grouped under the returned string.
* The groupBy value is also used as the text for group headings when `renderGroup` is not provided.
*
* @param {Value} option The Autocomplete option.
* @returns {string}
*/
groupBy: t.func,
/**
* If `true`, the component handles the "Home" and "End" keys when the popup is open.
* It should move focus to the first option and last option, respectively.
* @default !props.freeSolo
*/
handleHomeEndKeys: t.bool,
/**
* This prop is used to help implement the accessibility logic.
* If you don't provide an id it will fall back to a randomly generated one.
*/
id: t.string,
/**
* If `true`, the highlight can move to the input.
* @default false
*/
includeInputInList: t.bool,
/**
* The input value.
*/
inputValue: t.string,
/**
* Used to determine if the option represents the given value.
* Uses strict equality by default.
* ⚠️ Both arguments need to be handled, an option can only match with one value.
*
* @param {Value} option The option to test.
* @param {Value} value The value to test against.
* @returns {boolean}
*/
isOptionEqualToValue: t.func,
/**
* The maximum number of tags that will be visible when not focused.
* Set `-1` to disable the limit.
* @default -1
*/
limitTags: qt,
/**
* The component used to render the listbox.
* @default 'ul'
* @deprecated Use `slotProps.listbox.component` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
*/
ListboxComponent: t.elementType,
/**
* Props applied to the Listbox element.
* @deprecated Use `slotProps.listbox` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
*/
ListboxProps: t.object,
/**
* If `true`, the component is in a loading state.
* This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, for example `options` are empty).
* @default false
*/
loading: t.bool,
/**
* Text to display when in a loading state.
*
* For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
* @default 'Loading…'
*/
loadingText: t.node,
/**
* If `true`, `value` must be an array and the menu will support multiple selections.
* @default false
*/
multiple: t.bool,
/**
* Text to display when there are no options.
*
* For localization purposes, you can use the provided [translations](https://mui.com/material-ui/guides/localization/).
* @default 'No options'
*/
noOptionsText: t.node,
/**
* Callback fired when the value changes.
*
* @param {React.SyntheticEvent} event The event source of the callback.
* @param {Value|Value[]} value The new value of the component.
* @param {string} reason One of "createOption", "selectOption", "removeOption", "blur" or "clear".
* @param {string} [details]
*/
onChange: t.func,
/**
* Callback fired when the popup requests to be closed.
* Use in controlled mode (see open).
*
* @param {React.SyntheticEvent} event The event source of the callback.
* @param {string} reason Can be: `"toggleInput"`,