@blockend/widget 1.0.31 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AllRoutes-B04uZfaa.js +2209 -0
- package/dist/Box-BWDJCGbI.js +55 -0
- package/dist/EstGas-QSPrdq3Y.js +12863 -0
- package/dist/Grow-37t11tle.js +1656 -0
- package/dist/InputComp-bKVjlcbT.js +106 -0
- package/dist/LoadRoute-C3vokLk0.js +126 -0
- package/dist/QuotesProgress-DlgLQ2zo.js +28 -0
- package/dist/SwapAsset-tD6wSJDD.js +64 -0
- package/dist/Tooltip-BqYgFn1F.js +572 -0
- package/dist/TxnButton-DefErcCE.js +207 -0
- package/dist/WidgetForm.module-QHJ0-m5f.js +9 -0
- package/dist/{add-B8AfyNIx.js → add-D32G_xKI.js} +3 -3
- package/dist/{all-wallets-BaLLU39i.js → all-wallets-LjjqiTnJ.js} +3 -3
- package/dist/{app-store-DNpoABj1.js → app-store-S7C23kTz.js} +3 -3
- package/dist/{apple-DzzHtaL4.js → apple-DMd4RArz.js} +3 -3
- package/dist/{arrow-bottom-D2c13c51.js → arrow-bottom-C0cVMl2n.js} +3 -3
- package/dist/{arrow-bottom-circle-ls9OCLx1.js → arrow-bottom-circle-veMvHYVR.js} +3 -3
- package/dist/{arrow-left-BI3rQkNI.js → arrow-left-B6VdOxSY.js} +3 -3
- package/dist/{arrow-right-rnMzhVod.js → arrow-right-CyrokJyU.js} +3 -3
- package/dist/{arrow-top-CfA6PVMz.js → arrow-top-S8qh5z92.js} +3 -3
- package/dist/{bank-CmpAmHgg.js → bank-B9ySjxm-.js} +3 -3
- package/dist/basic-BXha5sM_.js +5783 -0
- package/dist/{browser-mEcjgS1H.js → browser-CWmyZDF1.js} +3 -3
- package/dist/{card-DkgIWcMc.js → card-TzoSVbiE.js} +3 -3
- package/dist/ccip-B97isPV8.js +228 -0
- package/dist/{checkmark-B_A013n2.js → checkmark-Be4tNZY8.js} +3 -3
- package/dist/{checkmark-bold-DestuG2T.js → checkmark-bold-sAoooMoy.js} +3 -3
- package/dist/{chevron-bottom-Di3S86dj.js → chevron-bottom-Cdd52Yir.js} +3 -3
- package/dist/{chevron-left-A9Wj-3tj.js → chevron-left-Dp8rM2qD.js} +3 -3
- package/dist/{chevron-right-UFxJogOZ.js → chevron-right-kH3Pgt8h.js} +3 -3
- package/dist/{chevron-top-BbZs3eaC.js → chevron-top-lx-9iWm1.js} +3 -3
- package/dist/{chrome-store-B4F6hJmy.js → chrome-store-BGxPgdkC.js} +3 -3
- package/dist/{clock-BbAQ09uV.js → clock-B3r9UiFY.js} +3 -3
- package/dist/clockIcon-C2W5xvyt.js +76 -0
- package/dist/{close-CY3oZP_D.js → close-Cc6SJ0A9.js} +3 -3
- package/dist/{coinPlaceholder-DpfsobZT.js → coinPlaceholder-DqH2n2v1.js} +3 -3
- package/dist/{compass-CHS7RZFk.js → compass-CiKYczAi.js} +3 -3
- package/dist/{copy-CEd4nGhs.js → copy-DR0dlbF5.js} +3 -3
- package/dist/core-D9oRINim.js +14967 -0
- package/dist/{cursor-transparent-Tm6k6Ws4.js → cursor-transparent-BABlb938.js} +3 -3
- package/dist/cursor-vv-pXAzC.js +7 -0
- package/dist/{desktop-CrSyXZkL.js → desktop-aFWdAU4O.js} +3 -3
- package/dist/{disconnect-BooT10E1.js → disconnect-Cz0MwjuJ.js} +3 -3
- package/dist/{discord-B982Qaml.js → discord-BkNiORDh.js} +3 -3
- package/dist/down-BAe_uoMx.js +606 -0
- package/dist/{etherscan-CFL0IcNl.js → etherscan-4wT3rhj5.js} +3 -3
- package/dist/ethertousd-CC_ezooz.js +6 -0
- package/dist/{exclamation-triangle-BBeGXYgt.js → exclamation-triangle-CSv7sjYs.js} +3 -3
- package/dist/{extension-C5WqJw73.js → extension-B4acJb16.js} +3 -3
- package/dist/{external-link-CcSxVDcd.js → external-link-zFdRyGh8.js} +3 -3
- package/dist/{facebook-DF0v9ED8.js → facebook-D2h4REjy.js} +3 -3
- package/dist/{farcaster-Boq7M4VK.js → farcaster-acRwWMSn.js} +3 -3
- package/dist/{filters-DfeymbPx.js → filters-DE1yHCJy.js} +3 -3
- package/dist/getChainIds-B4BLdhKd.js +1888 -0
- package/dist/getCosmosAddress-BfMdDDaH.js +9565 -0
- package/dist/{github-DQ8FV4bD.js → github-BrCBPjDS.js} +3 -3
- package/dist/{google-Dm8FDDZR.js → google-DYC6Um96.js} +3 -3
- package/dist/hamburger-sg42nvNd.js +3915 -0
- package/dist/{help-circle-CbgiAebR.js → help-circle-CKvIeM4J.js} +3 -3
- package/dist/{id-CzqxUksI.js → id-FXzF1V3L.js} +3 -3
- package/dist/{image-CsCGTIN-.js → image-rOZMtN9o.js} +3 -3
- package/dist/index-B0E-rGOh.js +159 -0
- package/dist/index-B5gV3APh.js +992 -0
- package/dist/index-CDq3vNnP.js +22 -0
- package/dist/index-CIjTGwYH.js +9 -0
- package/dist/index-Cmj3dp3U.js +473 -0
- package/dist/index-DEovHqJS.js +3010 -0
- package/dist/index-DOcwHfd3.js +13583 -0
- package/dist/index-DSlXIHtr.js +28701 -0
- package/dist/index-DTish3yr.js +1014 -0
- package/dist/index-PIAjHNgG.js +18613 -0
- package/dist/index-SiMIoFT9.js +331 -0
- package/dist/index-Y94UWILI.js +1460 -0
- package/dist/index-baetUfmH.js +252 -0
- package/dist/index.es-D6RvS0tB.js +366 -0
- package/dist/index.es-TLoHC_Sf.js +11678 -0
- package/dist/index.es.js +4 -4
- package/dist/{info-circle-Bt350Yzj.js → info-circle-BYfEprqC.js} +3 -3
- package/dist/{info-fKCfLW0k.js → info-dh7qmm_R.js} +3 -3
- package/dist/{lightbulb-BL9YBxiA.js → lightbulb-3S8w5B31.js} +3 -3
- package/dist/{mail-_g6CHQeQ.js → mail-DgcPoOPs.js} +3 -3
- package/dist/{mobile-B-EQ4IcH.js → mobile-C8egRR0V.js} +3 -3
- package/dist/{more-C3rpOdUy.js → more-CU_oPwwY.js} +3 -3
- package/dist/{network-placeholder-D9Ak7Xj_.js → network-placeholder-CqjaxlS7.js} +3 -3
- package/dist/{nftPlaceholder-CIIm2V_o.js → nftPlaceholder-D6mZlZmz.js} +3 -3
- package/dist/{off-DZjgI0eE.js → off-DHeUICx6.js} +3 -3
- package/dist/{play-store-DvRnagoF.js → play-store-DyGxjYv5.js} +3 -3
- package/dist/{plus-C2jN2huZ.js → plus-k4hEdLAH.js} +3 -3
- package/dist/{qr-code-B64HnZgi.js → qr-code-CkavLc0Z.js} +3 -3
- package/dist/{recycle-horizontal-CovcJGa_.js → recycle-horizontal-YzkyX2fY.js} +3 -3
- package/dist/{refresh-J1Vw6QMA.js → refresh-E1vpdqCO.js} +3 -3
- package/dist/{reown-logo-BsXoZ3KT.js → reown-logo-BZbc_-R6.js} +3 -3
- package/dist/{search-BC86wYXR.js → search-B9vQkIsQ.js} +3 -3
- package/dist/{send-BPA1bK5G.js → send-C9ROxhya.js} +3 -3
- package/dist/shareicon-CLveBf8l.js +262 -0
- package/dist/{sortDown-cDA6MpOw.js → sortDown-CjBaDQTU.js} +13 -13
- package/dist/{swapHorizontal-47_8ePle.js → swapHorizontal-BhLDDuiL.js} +3 -3
- package/dist/{swapHorizontalBold-CJ7TzeQP.js → swapHorizontalBold-B1IxJLem.js} +3 -3
- package/dist/{swapHorizontalMedium-CTACgUR9.js → swapHorizontalMedium--fvn_6KH.js} +3 -3
- package/dist/{swapHorizontalRoundedBold-Ht3_LABp.js → swapHorizontalRoundedBold-fZowAp5m.js} +3 -3
- package/dist/{swapVertical-DlS0V6DD.js → swapVertical-CDwndQ4s.js} +3 -3
- package/dist/{telegram-UZ00kvIE.js → telegram-BLbguJ3E.js} +3 -3
- package/dist/{three-dots-D9zVXr1j.js → three-dots-DyIG0Aiq.js} +3 -3
- package/dist/truncate-D9t92mVX.js +7 -0
- package/dist/{twitch-CP6rpz4m.js → twitch-054mPrps.js} +3 -3
- package/dist/{twitterIcon-Cm3I3FRU.js → twitterIcon-DrlgKmas.js} +3 -3
- package/dist/unsupportedProp-Dr6Tadlk.js +10 -0
- package/dist/useRegisterError-C52MuupC.js +9857 -0
- package/dist/validError-CDlJpg_f.js +6 -0
- package/dist/{verify-filled-CfgydKPa.js → verify-filled-Dw1_4VEj.js} +3 -3
- package/dist/{verify-DuUE85WT.js → verify-uz7q7EMX.js} +3 -3
- package/dist/w3m-modal-CJM8um8G.js +1471 -0
- package/dist/{wallet-BC2LSDlF.js → wallet-a9cCMI05.js} +3 -3
- package/dist/{wallet-placeholder-DugEJ7xM.js → wallet-placeholder-Cqiz2_rA.js} +3 -3
- package/dist/{walletconnect-wayCaYfk.js → walletconnect-96twp7MP.js} +7 -9
- package/dist/{warning-circle-Cy9YuvwU.js → warning-circle-C4mV6fIZ.js} +3 -3
- package/dist/{x-jggPFiy-.js → x-vRe7FHUS.js} +3 -3
- package/package.json +7 -19
- package/dist/AllRoutes-Bdi5ZW8W.js +0 -2604
- package/dist/Box-e4gA-y_H.js +0 -60
- package/dist/EstGas-C5ihS0Mw.js +0 -17108
- package/dist/Grow-B4K-I-E-.js +0 -2212
- package/dist/InputComp-C_UUZxNU.js +0 -114
- package/dist/LoadRoute-CnDhVKdh.js +0 -142
- package/dist/QuotesProgress-DxgPgPJE.js +0 -29
- package/dist/SwapAsset-CmmuxeQF.js +0 -65
- package/dist/Tooltip-D8YjOOKU.js +0 -718
- package/dist/TxnButton-CF-TLZrD.js +0 -302
- package/dist/WidgetForm.module-DhUUlwZP.js +0 -13
- package/dist/basic-Cx2xxgd9.js +0 -7109
- package/dist/ccip-BKpquA5i.js +0 -250
- package/dist/clockIcon-jSNFFrLy.js +0 -76
- package/dist/core-C-gr9X18.js +0 -17217
- package/dist/cursor-BTtIlTHP.js +0 -7
- package/dist/down-DDk8OoJG.js +0 -809
- package/dist/ethertousd-BOknTgU4.js +0 -7
- package/dist/getChainIds-6iugk2h0.js +0 -2431
- package/dist/getCosmosAddress-BgD5iV6f.js +0 -13998
- package/dist/hamburger-BYe_G11E.js +0 -4562
- package/dist/index-BAmjBHYR.js +0 -1087
- package/dist/index-BxHeZ9IF.js +0 -543
- package/dist/index-C7cb2O7r.js +0 -16078
- package/dist/index-CF9p4S_X.js +0 -11
- package/dist/index-C_vo1L7p.js +0 -24384
- package/dist/index-Ch7w83dW.js +0 -4217
- package/dist/index-Crhenmgw.js +0 -188
- package/dist/index-Cz5Dosd2.js +0 -412
- package/dist/index-D5OnT-__.js +0 -35858
- package/dist/index-DArR1lwi.js +0 -1759
- package/dist/index-hEJSpZe-.js +0 -308
- package/dist/index-m2O0cbD8.js +0 -1883
- package/dist/index-sLx4Edw4.js +0 -22
- package/dist/index.es-DIbGJsfa.js +0 -475
- package/dist/index.es-t6sHlseh.js +0 -12916
- package/dist/secp256k1-BkBK0mD5.js +0 -1681
- package/dist/shareicon-C88Wx-AM.js +0 -314
- package/dist/truncate-DSxFWEga.js +0 -7
- package/dist/unsupportedProp-DkeDzLfM.js +0 -14
- package/dist/useRegisterError-W_UfecIN.js +0 -19288
- package/dist/validError-rariWQ7G.js +0 -14
- package/dist/w3m-modal-Bl-DPlah.js +0 -1721
@@ -1,4562 +0,0 @@
|
|
1
|
-
import { n as useTheme, p as process$1, P as PropTypes, g as generateUtilityClass, _ as _objectWithoutPropertiesLoose, b as _extends, e as colorManipulatorExports, T as THEME_ID, o as defaultTheme, d as capitalize, q as formatMuiErrorMessage, s as deepmerge } from "./index-D5OnT-__.js";
|
2
|
-
import * as React from "react";
|
3
|
-
import { G as GlobalStyles$2, g as generateUtilityClasses, d as useDefaultProps, o as useTheme$1, s as styled, c as clsx, a as composeClasses, n as chainPropTypes, h as useForkRef, q as useEventCallback, e as useEnhancedEffect, p as isHostComponent, b as refType, r as rootShouldForwardProp, t as ownerDocument, v as useSlotProps, H as HTMLElementType, w as slotShouldForwardProp, x as getReactElementRef } from "./useRegisterError-W_UfecIN.js";
|
4
|
-
import { d as debounce, c as createSvgIcon, r as reactIsExports } from "./index-Cz5Dosd2.js";
|
5
|
-
import { G as Grow, b as useRtl, u as useControlled, a as useId } from "./Grow-B4K-I-E-.js";
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
7
|
-
import { o as ownerWindow, e as elementTypeAcceptingRef, c as getScrollbarSize, M as Modal } from "./getChainIds-6iugk2h0.js";
|
8
|
-
function GlobalStyles$1({
|
9
|
-
styles: styles2,
|
10
|
-
themeId,
|
11
|
-
defaultTheme: defaultTheme2 = {}
|
12
|
-
}) {
|
13
|
-
const upperTheme = useTheme(defaultTheme2);
|
14
|
-
const globalStyles = typeof styles2 === "function" ? styles2(themeId ? upperTheme[themeId] || upperTheme : upperTheme) : styles2;
|
15
|
-
return /* @__PURE__ */ jsx(GlobalStyles$2, {
|
16
|
-
styles: globalStyles
|
17
|
-
});
|
18
|
-
}
|
19
|
-
process$1.env.NODE_ENV !== "production" ? GlobalStyles$1.propTypes = {
|
20
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
21
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
22
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
23
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
24
|
-
/**
|
25
|
-
* @ignore
|
26
|
-
*/
|
27
|
-
defaultTheme: PropTypes.object,
|
28
|
-
/**
|
29
|
-
* @ignore
|
30
|
-
*/
|
31
|
-
styles: PropTypes.oneOfType([PropTypes.array, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),
|
32
|
-
/**
|
33
|
-
* @ignore
|
34
|
-
*/
|
35
|
-
themeId: PropTypes.string
|
36
|
-
} : void 0;
|
37
|
-
function getTypeByValue(value) {
|
38
|
-
const valueType = typeof value;
|
39
|
-
switch (valueType) {
|
40
|
-
case "number":
|
41
|
-
if (Number.isNaN(value)) {
|
42
|
-
return "NaN";
|
43
|
-
}
|
44
|
-
if (!Number.isFinite(value)) {
|
45
|
-
return "Infinity";
|
46
|
-
}
|
47
|
-
if (value !== Math.floor(value)) {
|
48
|
-
return "float";
|
49
|
-
}
|
50
|
-
return "number";
|
51
|
-
case "object":
|
52
|
-
if (value === null) {
|
53
|
-
return "null";
|
54
|
-
}
|
55
|
-
return value.constructor.name;
|
56
|
-
default:
|
57
|
-
return valueType;
|
58
|
-
}
|
59
|
-
}
|
60
|
-
function ponyfillIsInteger(x) {
|
61
|
-
return typeof x === "number" && isFinite(x) && Math.floor(x) === x;
|
62
|
-
}
|
63
|
-
const isInteger = Number.isInteger || ponyfillIsInteger;
|
64
|
-
function requiredInteger(props, propName, componentName, location) {
|
65
|
-
const propValue = props[propName];
|
66
|
-
if (propValue == null || !isInteger(propValue)) {
|
67
|
-
const propType = getTypeByValue(propValue);
|
68
|
-
return new RangeError(`Invalid ${location} \`${propName}\` of type \`${propType}\` supplied to \`${componentName}\`, expected \`integer\`.`);
|
69
|
-
}
|
70
|
-
return null;
|
71
|
-
}
|
72
|
-
function validator(props, propName, ...other) {
|
73
|
-
const propValue = props[propName];
|
74
|
-
if (propValue === void 0) {
|
75
|
-
return null;
|
76
|
-
}
|
77
|
-
return requiredInteger(props, propName, ...other);
|
78
|
-
}
|
79
|
-
function validatorNoop() {
|
80
|
-
return null;
|
81
|
-
}
|
82
|
-
validator.isRequired = requiredInteger;
|
83
|
-
validatorNoop.isRequired = validatorNoop;
|
84
|
-
const integerPropType = process$1.env.NODE_ENV === "production" ? validatorNoop : validator;
|
85
|
-
const getOverlayAlpha = (elevation) => {
|
86
|
-
let alphaValue;
|
87
|
-
if (elevation < 1) {
|
88
|
-
alphaValue = 5.11916 * elevation ** 2;
|
89
|
-
} else {
|
90
|
-
alphaValue = 4.5 * Math.log(elevation + 1) + 2;
|
91
|
-
}
|
92
|
-
return (alphaValue / 100).toFixed(2);
|
93
|
-
};
|
94
|
-
function getPaperUtilityClass(slot) {
|
95
|
-
return generateUtilityClass("MuiPaper", slot);
|
96
|
-
}
|
97
|
-
generateUtilityClasses("MuiPaper", ["root", "rounded", "outlined", "elevation", "elevation0", "elevation1", "elevation2", "elevation3", "elevation4", "elevation5", "elevation6", "elevation7", "elevation8", "elevation9", "elevation10", "elevation11", "elevation12", "elevation13", "elevation14", "elevation15", "elevation16", "elevation17", "elevation18", "elevation19", "elevation20", "elevation21", "elevation22", "elevation23", "elevation24"]);
|
98
|
-
const _excluded$d = ["className", "component", "elevation", "square", "variant"];
|
99
|
-
const useUtilityClasses$a = (ownerState) => {
|
100
|
-
const {
|
101
|
-
square,
|
102
|
-
elevation,
|
103
|
-
variant,
|
104
|
-
classes
|
105
|
-
} = ownerState;
|
106
|
-
const slots = {
|
107
|
-
root: ["root", variant, !square && "rounded", variant === "elevation" && `elevation${elevation}`]
|
108
|
-
};
|
109
|
-
return composeClasses(slots, getPaperUtilityClass, classes);
|
110
|
-
};
|
111
|
-
const PaperRoot = styled("div", {
|
112
|
-
name: "MuiPaper",
|
113
|
-
slot: "Root",
|
114
|
-
overridesResolver: (props, styles2) => {
|
115
|
-
const {
|
116
|
-
ownerState
|
117
|
-
} = props;
|
118
|
-
return [styles2.root, styles2[ownerState.variant], !ownerState.square && styles2.rounded, ownerState.variant === "elevation" && styles2[`elevation${ownerState.elevation}`]];
|
119
|
-
}
|
120
|
-
})(({
|
121
|
-
theme,
|
122
|
-
ownerState
|
123
|
-
}) => {
|
124
|
-
var _theme$vars$overlays;
|
125
|
-
return _extends({
|
126
|
-
backgroundColor: (theme.vars || theme).palette.background.paper,
|
127
|
-
color: (theme.vars || theme).palette.text.primary,
|
128
|
-
transition: theme.transitions.create("box-shadow")
|
129
|
-
}, !ownerState.square && {
|
130
|
-
borderRadius: theme.shape.borderRadius
|
131
|
-
}, ownerState.variant === "outlined" && {
|
132
|
-
border: `1px solid ${(theme.vars || theme).palette.divider}`
|
133
|
-
}, ownerState.variant === "elevation" && _extends({
|
134
|
-
boxShadow: (theme.vars || theme).shadows[ownerState.elevation]
|
135
|
-
}, !theme.vars && theme.palette.mode === "dark" && {
|
136
|
-
backgroundImage: `linear-gradient(${colorManipulatorExports.alpha("#fff", getOverlayAlpha(ownerState.elevation))}, ${colorManipulatorExports.alpha("#fff", getOverlayAlpha(ownerState.elevation))})`
|
137
|
-
}, theme.vars && {
|
138
|
-
backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation]
|
139
|
-
}));
|
140
|
-
});
|
141
|
-
const Paper = /* @__PURE__ */ React.forwardRef(function Paper2(inProps, ref) {
|
142
|
-
const props = useDefaultProps({
|
143
|
-
props: inProps,
|
144
|
-
name: "MuiPaper"
|
145
|
-
});
|
146
|
-
const {
|
147
|
-
className,
|
148
|
-
component = "div",
|
149
|
-
elevation = 1,
|
150
|
-
square = false,
|
151
|
-
variant = "elevation"
|
152
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded$d);
|
153
|
-
const ownerState = _extends({}, props, {
|
154
|
-
component,
|
155
|
-
elevation,
|
156
|
-
square,
|
157
|
-
variant
|
158
|
-
});
|
159
|
-
const classes = useUtilityClasses$a(ownerState);
|
160
|
-
if (process$1.env.NODE_ENV !== "production") {
|
161
|
-
const theme = useTheme$1();
|
162
|
-
if (theme.shadows[elevation] === void 0) {
|
163
|
-
}
|
164
|
-
}
|
165
|
-
return /* @__PURE__ */ jsx(PaperRoot, _extends({
|
166
|
-
as: component,
|
167
|
-
ownerState,
|
168
|
-
className: clsx(classes.root, className),
|
169
|
-
ref
|
170
|
-
}, other));
|
171
|
-
});
|
172
|
-
process$1.env.NODE_ENV !== "production" ? Paper.propTypes = {
|
173
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
174
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
175
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
176
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
177
|
-
/**
|
178
|
-
* The content of the component.
|
179
|
-
*/
|
180
|
-
children: PropTypes.node,
|
181
|
-
/**
|
182
|
-
* Override or extend the styles applied to the component.
|
183
|
-
*/
|
184
|
-
classes: PropTypes.object,
|
185
|
-
/**
|
186
|
-
* @ignore
|
187
|
-
*/
|
188
|
-
className: PropTypes.string,
|
189
|
-
/**
|
190
|
-
* The component used for the root node.
|
191
|
-
* Either a string to use a HTML element or a component.
|
192
|
-
*/
|
193
|
-
component: PropTypes.elementType,
|
194
|
-
/**
|
195
|
-
* Shadow depth, corresponds to `dp` in the spec.
|
196
|
-
* It accepts values between 0 and 24 inclusive.
|
197
|
-
* @default 1
|
198
|
-
*/
|
199
|
-
elevation: chainPropTypes(integerPropType, (props) => {
|
200
|
-
const {
|
201
|
-
elevation,
|
202
|
-
variant
|
203
|
-
} = props;
|
204
|
-
if (elevation > 0 && variant === "outlined") {
|
205
|
-
return new Error(`MUI: Combining \`elevation={${elevation}}\` with \`variant="${variant}"\` has no effect. Either use \`elevation={0}\` or use a different \`variant\`.`);
|
206
|
-
}
|
207
|
-
return null;
|
208
|
-
}),
|
209
|
-
/**
|
210
|
-
* If `true`, rounded corners are disabled.
|
211
|
-
* @default false
|
212
|
-
*/
|
213
|
-
square: PropTypes.bool,
|
214
|
-
/**
|
215
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
216
|
-
*/
|
217
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
218
|
-
/**
|
219
|
-
* The variant to use.
|
220
|
-
* @default 'elevation'
|
221
|
-
*/
|
222
|
-
variant: PropTypes.oneOfType([PropTypes.oneOf(["elevation", "outlined"]), PropTypes.string])
|
223
|
-
} : void 0;
|
224
|
-
const _excluded$c = ["onChange", "maxRows", "minRows", "style", "value"];
|
225
|
-
function getStyleValue(value) {
|
226
|
-
return parseInt(value, 10) || 0;
|
227
|
-
}
|
228
|
-
const styles = {
|
229
|
-
shadow: {
|
230
|
-
// Visibility needed to hide the extra text area on iPads
|
231
|
-
visibility: "hidden",
|
232
|
-
// Remove from the content flow
|
233
|
-
position: "absolute",
|
234
|
-
// Ignore the scrollbar width
|
235
|
-
overflow: "hidden",
|
236
|
-
height: 0,
|
237
|
-
top: 0,
|
238
|
-
left: 0,
|
239
|
-
// Create a new layer, increase the isolation of the computed values
|
240
|
-
transform: "translateZ(0)"
|
241
|
-
}
|
242
|
-
};
|
243
|
-
function isObjectEmpty(object) {
|
244
|
-
for (const _ in object) {
|
245
|
-
return false;
|
246
|
-
}
|
247
|
-
return true;
|
248
|
-
}
|
249
|
-
function isEmpty$1(obj) {
|
250
|
-
return isObjectEmpty(obj) || obj.outerHeightStyle === 0 && !obj.overflowing;
|
251
|
-
}
|
252
|
-
const TextareaAutosize = /* @__PURE__ */ React.forwardRef(function TextareaAutosize2(props, forwardedRef) {
|
253
|
-
const {
|
254
|
-
onChange,
|
255
|
-
maxRows,
|
256
|
-
minRows = 1,
|
257
|
-
style,
|
258
|
-
value
|
259
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded$c);
|
260
|
-
const {
|
261
|
-
current: isControlled
|
262
|
-
} = React.useRef(value != null);
|
263
|
-
const textareaRef = React.useRef(null);
|
264
|
-
const handleRef = useForkRef(forwardedRef, textareaRef);
|
265
|
-
const heightRef = React.useRef(null);
|
266
|
-
const hiddenTextareaRef = React.useRef(null);
|
267
|
-
const calculateTextareaStyles = React.useCallback(() => {
|
268
|
-
const textarea = textareaRef.current;
|
269
|
-
const hiddenTextarea = hiddenTextareaRef.current;
|
270
|
-
if (!textarea || !hiddenTextarea) {
|
271
|
-
return void 0;
|
272
|
-
}
|
273
|
-
const containerWindow = ownerWindow(textarea);
|
274
|
-
const computedStyle = containerWindow.getComputedStyle(textarea);
|
275
|
-
if (computedStyle.width === "0px") {
|
276
|
-
return {
|
277
|
-
outerHeightStyle: 0,
|
278
|
-
overflowing: false
|
279
|
-
};
|
280
|
-
}
|
281
|
-
hiddenTextarea.style.width = computedStyle.width;
|
282
|
-
hiddenTextarea.value = textarea.value || props.placeholder || "x";
|
283
|
-
if (hiddenTextarea.value.slice(-1) === "\n") {
|
284
|
-
hiddenTextarea.value += " ";
|
285
|
-
}
|
286
|
-
const boxSizing = computedStyle.boxSizing;
|
287
|
-
const padding = getStyleValue(computedStyle.paddingBottom) + getStyleValue(computedStyle.paddingTop);
|
288
|
-
const border = getStyleValue(computedStyle.borderBottomWidth) + getStyleValue(computedStyle.borderTopWidth);
|
289
|
-
const innerHeight = hiddenTextarea.scrollHeight;
|
290
|
-
hiddenTextarea.value = "x";
|
291
|
-
const singleRowHeight = hiddenTextarea.scrollHeight;
|
292
|
-
let outerHeight = innerHeight;
|
293
|
-
if (minRows) {
|
294
|
-
outerHeight = Math.max(Number(minRows) * singleRowHeight, outerHeight);
|
295
|
-
}
|
296
|
-
if (maxRows) {
|
297
|
-
outerHeight = Math.min(Number(maxRows) * singleRowHeight, outerHeight);
|
298
|
-
}
|
299
|
-
outerHeight = Math.max(outerHeight, singleRowHeight);
|
300
|
-
const outerHeightStyle = outerHeight + (boxSizing === "border-box" ? padding + border : 0);
|
301
|
-
const overflowing = Math.abs(outerHeight - innerHeight) <= 1;
|
302
|
-
return {
|
303
|
-
outerHeightStyle,
|
304
|
-
overflowing
|
305
|
-
};
|
306
|
-
}, [maxRows, minRows, props.placeholder]);
|
307
|
-
const didHeightChange = useEventCallback(() => {
|
308
|
-
const textarea = textareaRef.current;
|
309
|
-
const textareaStyles = calculateTextareaStyles();
|
310
|
-
if (!textarea || !textareaStyles || isEmpty$1(textareaStyles)) {
|
311
|
-
return false;
|
312
|
-
}
|
313
|
-
const outerHeightStyle = textareaStyles.outerHeightStyle;
|
314
|
-
return heightRef.current != null && heightRef.current !== outerHeightStyle;
|
315
|
-
});
|
316
|
-
const syncHeight = React.useCallback(() => {
|
317
|
-
const textarea = textareaRef.current;
|
318
|
-
const textareaStyles = calculateTextareaStyles();
|
319
|
-
if (!textarea || !textareaStyles || isEmpty$1(textareaStyles)) {
|
320
|
-
return;
|
321
|
-
}
|
322
|
-
const outerHeightStyle = textareaStyles.outerHeightStyle;
|
323
|
-
if (heightRef.current !== outerHeightStyle) {
|
324
|
-
heightRef.current = outerHeightStyle;
|
325
|
-
textarea.style.height = `${outerHeightStyle}px`;
|
326
|
-
}
|
327
|
-
textarea.style.overflow = textareaStyles.overflowing ? "hidden" : "";
|
328
|
-
}, [calculateTextareaStyles]);
|
329
|
-
const frameRef = React.useRef(-1);
|
330
|
-
useEnhancedEffect(() => {
|
331
|
-
const debouncedHandleResize = debounce(syncHeight);
|
332
|
-
const textarea = textareaRef == null ? void 0 : textareaRef.current;
|
333
|
-
if (!textarea) {
|
334
|
-
return void 0;
|
335
|
-
}
|
336
|
-
const containerWindow = ownerWindow(textarea);
|
337
|
-
containerWindow.addEventListener("resize", debouncedHandleResize);
|
338
|
-
let resizeObserver;
|
339
|
-
if (typeof ResizeObserver !== "undefined") {
|
340
|
-
resizeObserver = new ResizeObserver(() => {
|
341
|
-
if (didHeightChange()) {
|
342
|
-
resizeObserver.unobserve(textarea);
|
343
|
-
cancelAnimationFrame(frameRef.current);
|
344
|
-
syncHeight();
|
345
|
-
frameRef.current = requestAnimationFrame(() => {
|
346
|
-
resizeObserver.observe(textarea);
|
347
|
-
});
|
348
|
-
}
|
349
|
-
});
|
350
|
-
resizeObserver.observe(textarea);
|
351
|
-
}
|
352
|
-
return () => {
|
353
|
-
debouncedHandleResize.clear();
|
354
|
-
cancelAnimationFrame(frameRef.current);
|
355
|
-
containerWindow.removeEventListener("resize", debouncedHandleResize);
|
356
|
-
if (resizeObserver) {
|
357
|
-
resizeObserver.disconnect();
|
358
|
-
}
|
359
|
-
};
|
360
|
-
}, [calculateTextareaStyles, syncHeight, didHeightChange]);
|
361
|
-
useEnhancedEffect(() => {
|
362
|
-
syncHeight();
|
363
|
-
});
|
364
|
-
const handleChange = (event) => {
|
365
|
-
if (!isControlled) {
|
366
|
-
syncHeight();
|
367
|
-
}
|
368
|
-
if (onChange) {
|
369
|
-
onChange(event);
|
370
|
-
}
|
371
|
-
};
|
372
|
-
return /* @__PURE__ */ jsxs(React.Fragment, {
|
373
|
-
children: [/* @__PURE__ */ jsx("textarea", _extends({
|
374
|
-
value,
|
375
|
-
onChange: handleChange,
|
376
|
-
ref: handleRef,
|
377
|
-
rows: minRows,
|
378
|
-
style
|
379
|
-
}, other)), /* @__PURE__ */ jsx("textarea", {
|
380
|
-
"aria-hidden": true,
|
381
|
-
className: props.className,
|
382
|
-
readOnly: true,
|
383
|
-
ref: hiddenTextareaRef,
|
384
|
-
tabIndex: -1,
|
385
|
-
style: _extends({}, styles.shadow, style, {
|
386
|
-
paddingTop: 0,
|
387
|
-
paddingBottom: 0
|
388
|
-
})
|
389
|
-
})]
|
390
|
-
});
|
391
|
-
});
|
392
|
-
process$1.env.NODE_ENV !== "production" ? TextareaAutosize.propTypes = {
|
393
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
394
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
395
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
396
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
397
|
-
/**
|
398
|
-
* @ignore
|
399
|
-
*/
|
400
|
-
className: PropTypes.string,
|
401
|
-
/**
|
402
|
-
* Maximum number of rows to display.
|
403
|
-
*/
|
404
|
-
maxRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
405
|
-
/**
|
406
|
-
* Minimum number of rows to display.
|
407
|
-
* @default 1
|
408
|
-
*/
|
409
|
-
minRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
410
|
-
/**
|
411
|
-
* @ignore
|
412
|
-
*/
|
413
|
-
onChange: PropTypes.func,
|
414
|
-
/**
|
415
|
-
* @ignore
|
416
|
-
*/
|
417
|
-
placeholder: PropTypes.string,
|
418
|
-
/**
|
419
|
-
* @ignore
|
420
|
-
*/
|
421
|
-
style: PropTypes.object,
|
422
|
-
/**
|
423
|
-
* @ignore
|
424
|
-
*/
|
425
|
-
value: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.number, PropTypes.string])
|
426
|
-
} : void 0;
|
427
|
-
function formControlState({
|
428
|
-
props,
|
429
|
-
states,
|
430
|
-
muiFormControl
|
431
|
-
}) {
|
432
|
-
return states.reduce((acc, state) => {
|
433
|
-
acc[state] = props[state];
|
434
|
-
if (muiFormControl) {
|
435
|
-
if (typeof props[state] === "undefined") {
|
436
|
-
acc[state] = muiFormControl[state];
|
437
|
-
}
|
438
|
-
}
|
439
|
-
return acc;
|
440
|
-
}, {});
|
441
|
-
}
|
442
|
-
const FormControlContext = /* @__PURE__ */ React.createContext(void 0);
|
443
|
-
if (process$1.env.NODE_ENV !== "production") {
|
444
|
-
FormControlContext.displayName = "FormControlContext";
|
445
|
-
}
|
446
|
-
function useFormControl() {
|
447
|
-
return React.useContext(FormControlContext);
|
448
|
-
}
|
449
|
-
function GlobalStyles(props) {
|
450
|
-
return /* @__PURE__ */ jsx(GlobalStyles$1, _extends({}, props, {
|
451
|
-
defaultTheme,
|
452
|
-
themeId: THEME_ID
|
453
|
-
}));
|
454
|
-
}
|
455
|
-
process$1.env.NODE_ENV !== "production" ? GlobalStyles.propTypes = {
|
456
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
457
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
458
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
459
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
460
|
-
/**
|
461
|
-
* The styles you want to apply globally.
|
462
|
-
*/
|
463
|
-
styles: PropTypes.oneOfType([PropTypes.array, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool])
|
464
|
-
} : void 0;
|
465
|
-
function hasValue(value) {
|
466
|
-
return value != null && !(Array.isArray(value) && value.length === 0);
|
467
|
-
}
|
468
|
-
function isFilled(obj, SSR = false) {
|
469
|
-
return obj && (hasValue(obj.value) && obj.value !== "" || SSR && hasValue(obj.defaultValue) && obj.defaultValue !== "");
|
470
|
-
}
|
471
|
-
function isAdornedStart(obj) {
|
472
|
-
return obj.startAdornment;
|
473
|
-
}
|
474
|
-
function getInputBaseUtilityClass(slot) {
|
475
|
-
return generateUtilityClass("MuiInputBase", slot);
|
476
|
-
}
|
477
|
-
const inputBaseClasses = generateUtilityClasses("MuiInputBase", ["root", "formControl", "focused", "disabled", "adornedStart", "adornedEnd", "error", "sizeSmall", "multiline", "colorSecondary", "fullWidth", "hiddenLabel", "readOnly", "input", "inputSizeSmall", "inputMultiline", "inputTypeSearch", "inputAdornedStart", "inputAdornedEnd", "inputHiddenLabel"]);
|
478
|
-
const _excluded$b = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "slotProps", "slots", "startAdornment", "type", "value"];
|
479
|
-
const rootOverridesResolver = (props, styles2) => {
|
480
|
-
const {
|
481
|
-
ownerState
|
482
|
-
} = props;
|
483
|
-
return [styles2.root, ownerState.formControl && styles2.formControl, ownerState.startAdornment && styles2.adornedStart, ownerState.endAdornment && styles2.adornedEnd, ownerState.error && styles2.error, ownerState.size === "small" && styles2.sizeSmall, ownerState.multiline && styles2.multiline, ownerState.color && styles2[`color${capitalize(ownerState.color)}`], ownerState.fullWidth && styles2.fullWidth, ownerState.hiddenLabel && styles2.hiddenLabel];
|
484
|
-
};
|
485
|
-
const inputOverridesResolver = (props, styles2) => {
|
486
|
-
const {
|
487
|
-
ownerState
|
488
|
-
} = props;
|
489
|
-
return [styles2.input, ownerState.size === "small" && styles2.inputSizeSmall, ownerState.multiline && styles2.inputMultiline, ownerState.type === "search" && styles2.inputTypeSearch, ownerState.startAdornment && styles2.inputAdornedStart, ownerState.endAdornment && styles2.inputAdornedEnd, ownerState.hiddenLabel && styles2.inputHiddenLabel];
|
490
|
-
};
|
491
|
-
const useUtilityClasses$9 = (ownerState) => {
|
492
|
-
const {
|
493
|
-
classes,
|
494
|
-
color,
|
495
|
-
disabled,
|
496
|
-
error,
|
497
|
-
endAdornment,
|
498
|
-
focused,
|
499
|
-
formControl,
|
500
|
-
fullWidth,
|
501
|
-
hiddenLabel,
|
502
|
-
multiline,
|
503
|
-
readOnly,
|
504
|
-
size,
|
505
|
-
startAdornment,
|
506
|
-
type
|
507
|
-
} = ownerState;
|
508
|
-
const slots = {
|
509
|
-
root: ["root", `color${capitalize(color)}`, disabled && "disabled", error && "error", fullWidth && "fullWidth", focused && "focused", formControl && "formControl", size && size !== "medium" && `size${capitalize(size)}`, multiline && "multiline", startAdornment && "adornedStart", endAdornment && "adornedEnd", hiddenLabel && "hiddenLabel", readOnly && "readOnly"],
|
510
|
-
input: ["input", disabled && "disabled", type === "search" && "inputTypeSearch", multiline && "inputMultiline", size === "small" && "inputSizeSmall", hiddenLabel && "inputHiddenLabel", startAdornment && "inputAdornedStart", endAdornment && "inputAdornedEnd", readOnly && "readOnly"]
|
511
|
-
};
|
512
|
-
return composeClasses(slots, getInputBaseUtilityClass, classes);
|
513
|
-
};
|
514
|
-
const InputBaseRoot = styled("div", {
|
515
|
-
name: "MuiInputBase",
|
516
|
-
slot: "Root",
|
517
|
-
overridesResolver: rootOverridesResolver
|
518
|
-
})(({
|
519
|
-
theme,
|
520
|
-
ownerState
|
521
|
-
}) => _extends({}, theme.typography.body1, {
|
522
|
-
color: (theme.vars || theme).palette.text.primary,
|
523
|
-
lineHeight: "1.4375em",
|
524
|
-
// 23px
|
525
|
-
boxSizing: "border-box",
|
526
|
-
// Prevent padding issue with fullWidth.
|
527
|
-
position: "relative",
|
528
|
-
cursor: "text",
|
529
|
-
display: "inline-flex",
|
530
|
-
alignItems: "center",
|
531
|
-
[`&.${inputBaseClasses.disabled}`]: {
|
532
|
-
color: (theme.vars || theme).palette.text.disabled,
|
533
|
-
cursor: "default"
|
534
|
-
}
|
535
|
-
}, ownerState.multiline && _extends({
|
536
|
-
padding: "4px 0 5px"
|
537
|
-
}, ownerState.size === "small" && {
|
538
|
-
paddingTop: 1
|
539
|
-
}), ownerState.fullWidth && {
|
540
|
-
width: "100%"
|
541
|
-
}));
|
542
|
-
const InputBaseComponent = styled("input", {
|
543
|
-
name: "MuiInputBase",
|
544
|
-
slot: "Input",
|
545
|
-
overridesResolver: inputOverridesResolver
|
546
|
-
})(({
|
547
|
-
theme,
|
548
|
-
ownerState
|
549
|
-
}) => {
|
550
|
-
const light = theme.palette.mode === "light";
|
551
|
-
const placeholder = _extends({
|
552
|
-
color: "currentColor"
|
553
|
-
}, theme.vars ? {
|
554
|
-
opacity: theme.vars.opacity.inputPlaceholder
|
555
|
-
} : {
|
556
|
-
opacity: light ? 0.42 : 0.5
|
557
|
-
}, {
|
558
|
-
transition: theme.transitions.create("opacity", {
|
559
|
-
duration: theme.transitions.duration.shorter
|
560
|
-
})
|
561
|
-
});
|
562
|
-
const placeholderHidden = {
|
563
|
-
opacity: "0 !important"
|
564
|
-
};
|
565
|
-
const placeholderVisible = theme.vars ? {
|
566
|
-
opacity: theme.vars.opacity.inputPlaceholder
|
567
|
-
} : {
|
568
|
-
opacity: light ? 0.42 : 0.5
|
569
|
-
};
|
570
|
-
return _extends({
|
571
|
-
font: "inherit",
|
572
|
-
letterSpacing: "inherit",
|
573
|
-
color: "currentColor",
|
574
|
-
padding: "4px 0 5px",
|
575
|
-
border: 0,
|
576
|
-
boxSizing: "content-box",
|
577
|
-
background: "none",
|
578
|
-
height: "1.4375em",
|
579
|
-
// Reset 23pxthe native input line-height
|
580
|
-
margin: 0,
|
581
|
-
// Reset for Safari
|
582
|
-
WebkitTapHighlightColor: "transparent",
|
583
|
-
display: "block",
|
584
|
-
// Make the flex item shrink with Firefox
|
585
|
-
minWidth: 0,
|
586
|
-
width: "100%",
|
587
|
-
// Fix IE11 width issue
|
588
|
-
animationName: "mui-auto-fill-cancel",
|
589
|
-
animationDuration: "10ms",
|
590
|
-
"&::-webkit-input-placeholder": placeholder,
|
591
|
-
"&::-moz-placeholder": placeholder,
|
592
|
-
// Firefox 19+
|
593
|
-
"&:-ms-input-placeholder": placeholder,
|
594
|
-
// IE11
|
595
|
-
"&::-ms-input-placeholder": placeholder,
|
596
|
-
// Edge
|
597
|
-
"&:focus": {
|
598
|
-
outline: 0
|
599
|
-
},
|
600
|
-
// Reset Firefox invalid required input style
|
601
|
-
"&:invalid": {
|
602
|
-
boxShadow: "none"
|
603
|
-
},
|
604
|
-
"&::-webkit-search-decoration": {
|
605
|
-
// Remove the padding when type=search.
|
606
|
-
WebkitAppearance: "none"
|
607
|
-
},
|
608
|
-
// Show and hide the placeholder logic
|
609
|
-
[`label[data-shrink=false] + .${inputBaseClasses.formControl} &`]: {
|
610
|
-
"&::-webkit-input-placeholder": placeholderHidden,
|
611
|
-
"&::-moz-placeholder": placeholderHidden,
|
612
|
-
// Firefox 19+
|
613
|
-
"&:-ms-input-placeholder": placeholderHidden,
|
614
|
-
// IE11
|
615
|
-
"&::-ms-input-placeholder": placeholderHidden,
|
616
|
-
// Edge
|
617
|
-
"&:focus::-webkit-input-placeholder": placeholderVisible,
|
618
|
-
"&:focus::-moz-placeholder": placeholderVisible,
|
619
|
-
// Firefox 19+
|
620
|
-
"&:focus:-ms-input-placeholder": placeholderVisible,
|
621
|
-
// IE11
|
622
|
-
"&:focus::-ms-input-placeholder": placeholderVisible
|
623
|
-
// Edge
|
624
|
-
},
|
625
|
-
[`&.${inputBaseClasses.disabled}`]: {
|
626
|
-
opacity: 1,
|
627
|
-
// Reset iOS opacity
|
628
|
-
WebkitTextFillColor: (theme.vars || theme).palette.text.disabled
|
629
|
-
// Fix opacity Safari bug
|
630
|
-
},
|
631
|
-
"&:-webkit-autofill": {
|
632
|
-
animationDuration: "5000s",
|
633
|
-
animationName: "mui-auto-fill"
|
634
|
-
}
|
635
|
-
}, ownerState.size === "small" && {
|
636
|
-
paddingTop: 1
|
637
|
-
}, ownerState.multiline && {
|
638
|
-
height: "auto",
|
639
|
-
resize: "none",
|
640
|
-
padding: 0,
|
641
|
-
paddingTop: 0
|
642
|
-
}, ownerState.type === "search" && {
|
643
|
-
// Improve type search style.
|
644
|
-
MozAppearance: "textfield"
|
645
|
-
});
|
646
|
-
});
|
647
|
-
const inputGlobalStyles = /* @__PURE__ */ jsx(GlobalStyles, {
|
648
|
-
styles: {
|
649
|
-
"@keyframes mui-auto-fill": {
|
650
|
-
from: {
|
651
|
-
display: "block"
|
652
|
-
}
|
653
|
-
},
|
654
|
-
"@keyframes mui-auto-fill-cancel": {
|
655
|
-
from: {
|
656
|
-
display: "block"
|
657
|
-
}
|
658
|
-
}
|
659
|
-
}
|
660
|
-
});
|
661
|
-
const InputBase = /* @__PURE__ */ React.forwardRef(function InputBase2(inProps, ref) {
|
662
|
-
var _slotProps$input;
|
663
|
-
const props = useDefaultProps({
|
664
|
-
props: inProps,
|
665
|
-
name: "MuiInputBase"
|
666
|
-
});
|
667
|
-
const {
|
668
|
-
"aria-describedby": ariaDescribedby,
|
669
|
-
autoComplete,
|
670
|
-
autoFocus,
|
671
|
-
className,
|
672
|
-
components = {},
|
673
|
-
componentsProps = {},
|
674
|
-
defaultValue,
|
675
|
-
disabled,
|
676
|
-
disableInjectingGlobalStyles,
|
677
|
-
endAdornment,
|
678
|
-
fullWidth = false,
|
679
|
-
id,
|
680
|
-
inputComponent = "input",
|
681
|
-
inputProps: inputPropsProp = {},
|
682
|
-
inputRef: inputRefProp,
|
683
|
-
maxRows,
|
684
|
-
minRows,
|
685
|
-
multiline = false,
|
686
|
-
name,
|
687
|
-
onBlur,
|
688
|
-
onChange,
|
689
|
-
onClick,
|
690
|
-
onFocus,
|
691
|
-
onKeyDown,
|
692
|
-
onKeyUp,
|
693
|
-
placeholder,
|
694
|
-
readOnly,
|
695
|
-
renderSuffix,
|
696
|
-
rows,
|
697
|
-
slotProps = {},
|
698
|
-
slots = {},
|
699
|
-
startAdornment,
|
700
|
-
type = "text",
|
701
|
-
value: valueProp
|
702
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded$b);
|
703
|
-
const value = inputPropsProp.value != null ? inputPropsProp.value : valueProp;
|
704
|
-
const {
|
705
|
-
current: isControlled
|
706
|
-
} = React.useRef(value != null);
|
707
|
-
const inputRef = React.useRef();
|
708
|
-
const handleInputRefWarning = React.useCallback((instance) => {
|
709
|
-
if (process$1.env.NODE_ENV !== "production") {
|
710
|
-
if (instance && instance.nodeName !== "INPUT" && !instance.focus) {
|
711
|
-
}
|
712
|
-
}
|
713
|
-
}, []);
|
714
|
-
const handleInputRef = useForkRef(inputRef, inputRefProp, inputPropsProp.ref, handleInputRefWarning);
|
715
|
-
const [focused, setFocused] = React.useState(false);
|
716
|
-
const muiFormControl = useFormControl();
|
717
|
-
if (process$1.env.NODE_ENV !== "production") {
|
718
|
-
React.useEffect(() => {
|
719
|
-
if (muiFormControl) {
|
720
|
-
return muiFormControl.registerEffect();
|
721
|
-
}
|
722
|
-
return void 0;
|
723
|
-
}, [muiFormControl]);
|
724
|
-
}
|
725
|
-
const fcs = formControlState({
|
726
|
-
props,
|
727
|
-
muiFormControl,
|
728
|
-
states: ["color", "disabled", "error", "hiddenLabel", "size", "required", "filled"]
|
729
|
-
});
|
730
|
-
fcs.focused = muiFormControl ? muiFormControl.focused : focused;
|
731
|
-
React.useEffect(() => {
|
732
|
-
if (!muiFormControl && disabled && focused) {
|
733
|
-
setFocused(false);
|
734
|
-
if (onBlur) {
|
735
|
-
onBlur();
|
736
|
-
}
|
737
|
-
}
|
738
|
-
}, [muiFormControl, disabled, focused, onBlur]);
|
739
|
-
const onFilled = muiFormControl && muiFormControl.onFilled;
|
740
|
-
const onEmpty = muiFormControl && muiFormControl.onEmpty;
|
741
|
-
const checkDirty = React.useCallback((obj) => {
|
742
|
-
if (isFilled(obj)) {
|
743
|
-
if (onFilled) {
|
744
|
-
onFilled();
|
745
|
-
}
|
746
|
-
} else if (onEmpty) {
|
747
|
-
onEmpty();
|
748
|
-
}
|
749
|
-
}, [onFilled, onEmpty]);
|
750
|
-
useEnhancedEffect(() => {
|
751
|
-
if (isControlled) {
|
752
|
-
checkDirty({
|
753
|
-
value
|
754
|
-
});
|
755
|
-
}
|
756
|
-
}, [value, checkDirty, isControlled]);
|
757
|
-
const handleFocus = (event) => {
|
758
|
-
if (fcs.disabled) {
|
759
|
-
event.stopPropagation();
|
760
|
-
return;
|
761
|
-
}
|
762
|
-
if (onFocus) {
|
763
|
-
onFocus(event);
|
764
|
-
}
|
765
|
-
if (inputPropsProp.onFocus) {
|
766
|
-
inputPropsProp.onFocus(event);
|
767
|
-
}
|
768
|
-
if (muiFormControl && muiFormControl.onFocus) {
|
769
|
-
muiFormControl.onFocus(event);
|
770
|
-
} else {
|
771
|
-
setFocused(true);
|
772
|
-
}
|
773
|
-
};
|
774
|
-
const handleBlur = (event) => {
|
775
|
-
if (onBlur) {
|
776
|
-
onBlur(event);
|
777
|
-
}
|
778
|
-
if (inputPropsProp.onBlur) {
|
779
|
-
inputPropsProp.onBlur(event);
|
780
|
-
}
|
781
|
-
if (muiFormControl && muiFormControl.onBlur) {
|
782
|
-
muiFormControl.onBlur(event);
|
783
|
-
} else {
|
784
|
-
setFocused(false);
|
785
|
-
}
|
786
|
-
};
|
787
|
-
const handleChange = (event, ...args) => {
|
788
|
-
if (!isControlled) {
|
789
|
-
const element = event.target || inputRef.current;
|
790
|
-
if (element == null) {
|
791
|
-
throw new Error(process$1.env.NODE_ENV !== "production" ? `MUI: Expected valid input target. Did you use a custom \`inputComponent\` and forget to forward refs? See https://mui.com/r/input-component-ref-interface for more info.` : formatMuiErrorMessage(1));
|
792
|
-
}
|
793
|
-
checkDirty({
|
794
|
-
value: element.value
|
795
|
-
});
|
796
|
-
}
|
797
|
-
if (inputPropsProp.onChange) {
|
798
|
-
inputPropsProp.onChange(event, ...args);
|
799
|
-
}
|
800
|
-
if (onChange) {
|
801
|
-
onChange(event, ...args);
|
802
|
-
}
|
803
|
-
};
|
804
|
-
React.useEffect(() => {
|
805
|
-
checkDirty(inputRef.current);
|
806
|
-
}, []);
|
807
|
-
const handleClick = (event) => {
|
808
|
-
if (inputRef.current && event.currentTarget === event.target) {
|
809
|
-
inputRef.current.focus();
|
810
|
-
}
|
811
|
-
if (onClick) {
|
812
|
-
onClick(event);
|
813
|
-
}
|
814
|
-
};
|
815
|
-
let InputComponent = inputComponent;
|
816
|
-
let inputProps = inputPropsProp;
|
817
|
-
if (multiline && InputComponent === "input") {
|
818
|
-
if (rows) {
|
819
|
-
if (process$1.env.NODE_ENV !== "production") {
|
820
|
-
if (minRows || maxRows) {
|
821
|
-
}
|
822
|
-
}
|
823
|
-
inputProps = _extends({
|
824
|
-
type: void 0,
|
825
|
-
minRows: rows,
|
826
|
-
maxRows: rows
|
827
|
-
}, inputProps);
|
828
|
-
} else {
|
829
|
-
inputProps = _extends({
|
830
|
-
type: void 0,
|
831
|
-
maxRows,
|
832
|
-
minRows
|
833
|
-
}, inputProps);
|
834
|
-
}
|
835
|
-
InputComponent = TextareaAutosize;
|
836
|
-
}
|
837
|
-
const handleAutoFill = (event) => {
|
838
|
-
checkDirty(event.animationName === "mui-auto-fill-cancel" ? inputRef.current : {
|
839
|
-
value: "x"
|
840
|
-
});
|
841
|
-
};
|
842
|
-
React.useEffect(() => {
|
843
|
-
if (muiFormControl) {
|
844
|
-
muiFormControl.setAdornedStart(Boolean(startAdornment));
|
845
|
-
}
|
846
|
-
}, [muiFormControl, startAdornment]);
|
847
|
-
const ownerState = _extends({}, props, {
|
848
|
-
color: fcs.color || "primary",
|
849
|
-
disabled: fcs.disabled,
|
850
|
-
endAdornment,
|
851
|
-
error: fcs.error,
|
852
|
-
focused: fcs.focused,
|
853
|
-
formControl: muiFormControl,
|
854
|
-
fullWidth,
|
855
|
-
hiddenLabel: fcs.hiddenLabel,
|
856
|
-
multiline,
|
857
|
-
size: fcs.size,
|
858
|
-
startAdornment,
|
859
|
-
type
|
860
|
-
});
|
861
|
-
const classes = useUtilityClasses$9(ownerState);
|
862
|
-
const Root = slots.root || components.Root || InputBaseRoot;
|
863
|
-
const rootProps = slotProps.root || componentsProps.root || {};
|
864
|
-
const Input3 = slots.input || components.Input || InputBaseComponent;
|
865
|
-
inputProps = _extends({}, inputProps, (_slotProps$input = slotProps.input) != null ? _slotProps$input : componentsProps.input);
|
866
|
-
return /* @__PURE__ */ jsxs(React.Fragment, {
|
867
|
-
children: [!disableInjectingGlobalStyles && inputGlobalStyles, /* @__PURE__ */ jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
|
868
|
-
ownerState: _extends({}, ownerState, rootProps.ownerState)
|
869
|
-
}, {
|
870
|
-
ref,
|
871
|
-
onClick: handleClick
|
872
|
-
}, other, {
|
873
|
-
className: clsx(classes.root, rootProps.className, className, readOnly && "MuiInputBase-readOnly"),
|
874
|
-
children: [startAdornment, /* @__PURE__ */ jsx(FormControlContext.Provider, {
|
875
|
-
value: null,
|
876
|
-
children: /* @__PURE__ */ jsx(Input3, _extends({
|
877
|
-
ownerState,
|
878
|
-
"aria-invalid": fcs.error,
|
879
|
-
"aria-describedby": ariaDescribedby,
|
880
|
-
autoComplete,
|
881
|
-
autoFocus,
|
882
|
-
defaultValue,
|
883
|
-
disabled: fcs.disabled,
|
884
|
-
id,
|
885
|
-
onAnimationStart: handleAutoFill,
|
886
|
-
name,
|
887
|
-
placeholder,
|
888
|
-
readOnly,
|
889
|
-
required: fcs.required,
|
890
|
-
rows,
|
891
|
-
value,
|
892
|
-
onKeyDown,
|
893
|
-
onKeyUp,
|
894
|
-
type
|
895
|
-
}, inputProps, !isHostComponent(Input3) && {
|
896
|
-
as: InputComponent,
|
897
|
-
ownerState: _extends({}, ownerState, inputProps.ownerState)
|
898
|
-
}, {
|
899
|
-
ref: handleInputRef,
|
900
|
-
className: clsx(classes.input, inputProps.className, readOnly && "MuiInputBase-readOnly"),
|
901
|
-
onBlur: handleBlur,
|
902
|
-
onChange: handleChange,
|
903
|
-
onFocus: handleFocus
|
904
|
-
}))
|
905
|
-
}), endAdornment, renderSuffix ? renderSuffix(_extends({}, fcs, {
|
906
|
-
startAdornment
|
907
|
-
})) : null]
|
908
|
-
}))]
|
909
|
-
});
|
910
|
-
});
|
911
|
-
process$1.env.NODE_ENV !== "production" ? InputBase.propTypes = {
|
912
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
913
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
914
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
915
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
916
|
-
/**
|
917
|
-
* @ignore
|
918
|
-
*/
|
919
|
-
"aria-describedby": PropTypes.string,
|
920
|
-
/**
|
921
|
-
* This prop helps users to fill forms faster, especially on mobile devices.
|
922
|
-
* The name can be confusing, as it's more like an autofill.
|
923
|
-
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
924
|
-
*/
|
925
|
-
autoComplete: PropTypes.string,
|
926
|
-
/**
|
927
|
-
* If `true`, the `input` element is focused during the first mount.
|
928
|
-
*/
|
929
|
-
autoFocus: PropTypes.bool,
|
930
|
-
/**
|
931
|
-
* Override or extend the styles applied to the component.
|
932
|
-
*/
|
933
|
-
classes: PropTypes.object,
|
934
|
-
/**
|
935
|
-
* @ignore
|
936
|
-
*/
|
937
|
-
className: PropTypes.string,
|
938
|
-
/**
|
939
|
-
* The color of the component.
|
940
|
-
* It supports both default and custom theme colors, which can be added as shown in the
|
941
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
942
|
-
* The prop defaults to the value (`'primary'`) inherited from the parent FormControl component.
|
943
|
-
*/
|
944
|
-
color: PropTypes.oneOfType([PropTypes.oneOf(["primary", "secondary", "error", "info", "success", "warning"]), PropTypes.string]),
|
945
|
-
/**
|
946
|
-
* The components used for each slot inside.
|
947
|
-
*
|
948
|
-
* This prop is an alias for the `slots` prop.
|
949
|
-
* It's recommended to use the `slots` prop instead.
|
950
|
-
*
|
951
|
-
* @default {}
|
952
|
-
*/
|
953
|
-
components: PropTypes.shape({
|
954
|
-
Input: PropTypes.elementType,
|
955
|
-
Root: PropTypes.elementType
|
956
|
-
}),
|
957
|
-
/**
|
958
|
-
* The extra props for the slot components.
|
959
|
-
* You can override the existing props or add new ones.
|
960
|
-
*
|
961
|
-
* This prop is an alias for the `slotProps` prop.
|
962
|
-
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
963
|
-
*
|
964
|
-
* @default {}
|
965
|
-
*/
|
966
|
-
componentsProps: PropTypes.shape({
|
967
|
-
input: PropTypes.object,
|
968
|
-
root: PropTypes.object
|
969
|
-
}),
|
970
|
-
/**
|
971
|
-
* The default value. Use when the component is not controlled.
|
972
|
-
*/
|
973
|
-
defaultValue: PropTypes.any,
|
974
|
-
/**
|
975
|
-
* If `true`, the component is disabled.
|
976
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
977
|
-
*/
|
978
|
-
disabled: PropTypes.bool,
|
979
|
-
/**
|
980
|
-
* If `true`, GlobalStyles for the auto-fill keyframes will not be injected/removed on mount/unmount. Make sure to inject them at the top of your application.
|
981
|
-
* This option is intended to help with boosting the initial rendering performance if you are loading a big amount of Input components at once.
|
982
|
-
* @default false
|
983
|
-
*/
|
984
|
-
disableInjectingGlobalStyles: PropTypes.bool,
|
985
|
-
/**
|
986
|
-
* End `InputAdornment` for this component.
|
987
|
-
*/
|
988
|
-
endAdornment: PropTypes.node,
|
989
|
-
/**
|
990
|
-
* If `true`, the `input` will indicate an error.
|
991
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
992
|
-
*/
|
993
|
-
error: PropTypes.bool,
|
994
|
-
/**
|
995
|
-
* If `true`, the `input` will take up the full width of its container.
|
996
|
-
* @default false
|
997
|
-
*/
|
998
|
-
fullWidth: PropTypes.bool,
|
999
|
-
/**
|
1000
|
-
* The id of the `input` element.
|
1001
|
-
*/
|
1002
|
-
id: PropTypes.string,
|
1003
|
-
/**
|
1004
|
-
* The component used for the `input` element.
|
1005
|
-
* Either a string to use a HTML element or a component.
|
1006
|
-
* @default 'input'
|
1007
|
-
*/
|
1008
|
-
inputComponent: elementTypeAcceptingRef,
|
1009
|
-
/**
|
1010
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
|
1011
|
-
* @default {}
|
1012
|
-
*/
|
1013
|
-
inputProps: PropTypes.object,
|
1014
|
-
/**
|
1015
|
-
* Pass a ref to the `input` element.
|
1016
|
-
*/
|
1017
|
-
inputRef: refType,
|
1018
|
-
/**
|
1019
|
-
* If `dense`, will adjust vertical spacing. This is normally obtained via context from
|
1020
|
-
* FormControl.
|
1021
|
-
* The prop defaults to the value (`'none'`) inherited from the parent FormControl component.
|
1022
|
-
*/
|
1023
|
-
margin: PropTypes.oneOf(["dense", "none"]),
|
1024
|
-
/**
|
1025
|
-
* Maximum number of rows to display when multiline option is set to true.
|
1026
|
-
*/
|
1027
|
-
maxRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
1028
|
-
/**
|
1029
|
-
* Minimum number of rows to display when multiline option is set to true.
|
1030
|
-
*/
|
1031
|
-
minRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
1032
|
-
/**
|
1033
|
-
* If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.
|
1034
|
-
* @default false
|
1035
|
-
*/
|
1036
|
-
multiline: PropTypes.bool,
|
1037
|
-
/**
|
1038
|
-
* Name attribute of the `input` element.
|
1039
|
-
*/
|
1040
|
-
name: PropTypes.string,
|
1041
|
-
/**
|
1042
|
-
* Callback fired when the `input` is blurred.
|
1043
|
-
*
|
1044
|
-
* Notice that the first argument (event) might be undefined.
|
1045
|
-
*/
|
1046
|
-
onBlur: PropTypes.func,
|
1047
|
-
/**
|
1048
|
-
* Callback fired when the value is changed.
|
1049
|
-
*
|
1050
|
-
* @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
|
1051
|
-
* You can pull out the new value by accessing `event.target.value` (string).
|
1052
|
-
*/
|
1053
|
-
onChange: PropTypes.func,
|
1054
|
-
/**
|
1055
|
-
* @ignore
|
1056
|
-
*/
|
1057
|
-
onClick: PropTypes.func,
|
1058
|
-
/**
|
1059
|
-
* @ignore
|
1060
|
-
*/
|
1061
|
-
onFocus: PropTypes.func,
|
1062
|
-
/**
|
1063
|
-
* Callback fired when the `input` doesn't satisfy its constraints.
|
1064
|
-
*/
|
1065
|
-
onInvalid: PropTypes.func,
|
1066
|
-
/**
|
1067
|
-
* @ignore
|
1068
|
-
*/
|
1069
|
-
onKeyDown: PropTypes.func,
|
1070
|
-
/**
|
1071
|
-
* @ignore
|
1072
|
-
*/
|
1073
|
-
onKeyUp: PropTypes.func,
|
1074
|
-
/**
|
1075
|
-
* The short hint displayed in the `input` before the user enters a value.
|
1076
|
-
*/
|
1077
|
-
placeholder: PropTypes.string,
|
1078
|
-
/**
|
1079
|
-
* It prevents the user from changing the value of the field
|
1080
|
-
* (not from interacting with the field).
|
1081
|
-
*/
|
1082
|
-
readOnly: PropTypes.bool,
|
1083
|
-
/**
|
1084
|
-
* @ignore
|
1085
|
-
*/
|
1086
|
-
renderSuffix: PropTypes.func,
|
1087
|
-
/**
|
1088
|
-
* If `true`, the `input` element is required.
|
1089
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
1090
|
-
*/
|
1091
|
-
required: PropTypes.bool,
|
1092
|
-
/**
|
1093
|
-
* Number of rows to display when multiline option is set to true.
|
1094
|
-
*/
|
1095
|
-
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
1096
|
-
/**
|
1097
|
-
* The size of the component.
|
1098
|
-
*/
|
1099
|
-
size: PropTypes.oneOfType([PropTypes.oneOf(["medium", "small"]), PropTypes.string]),
|
1100
|
-
/**
|
1101
|
-
* The extra props for the slot components.
|
1102
|
-
* You can override the existing props or add new ones.
|
1103
|
-
*
|
1104
|
-
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
1105
|
-
*
|
1106
|
-
* @default {}
|
1107
|
-
*/
|
1108
|
-
slotProps: PropTypes.shape({
|
1109
|
-
input: PropTypes.object,
|
1110
|
-
root: PropTypes.object
|
1111
|
-
}),
|
1112
|
-
/**
|
1113
|
-
* The components used for each slot inside.
|
1114
|
-
*
|
1115
|
-
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
1116
|
-
*
|
1117
|
-
* @default {}
|
1118
|
-
*/
|
1119
|
-
slots: PropTypes.shape({
|
1120
|
-
input: PropTypes.elementType,
|
1121
|
-
root: PropTypes.elementType
|
1122
|
-
}),
|
1123
|
-
/**
|
1124
|
-
* Start `InputAdornment` for this component.
|
1125
|
-
*/
|
1126
|
-
startAdornment: PropTypes.node,
|
1127
|
-
/**
|
1128
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
1129
|
-
*/
|
1130
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
1131
|
-
/**
|
1132
|
-
* Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
|
1133
|
-
* @default 'text'
|
1134
|
-
*/
|
1135
|
-
type: PropTypes.string,
|
1136
|
-
/**
|
1137
|
-
* The value of the `input` element, required for a controlled component.
|
1138
|
-
*/
|
1139
|
-
value: PropTypes.any
|
1140
|
-
} : void 0;
|
1141
|
-
function getInputUtilityClass(slot) {
|
1142
|
-
return generateUtilityClass("MuiInput", slot);
|
1143
|
-
}
|
1144
|
-
const inputClasses = _extends({}, inputBaseClasses, generateUtilityClasses("MuiInput", ["root", "underline", "input"]));
|
1145
|
-
function getOutlinedInputUtilityClass(slot) {
|
1146
|
-
return generateUtilityClass("MuiOutlinedInput", slot);
|
1147
|
-
}
|
1148
|
-
const outlinedInputClasses = _extends({}, inputBaseClasses, generateUtilityClasses("MuiOutlinedInput", ["root", "notchedOutline", "input"]));
|
1149
|
-
function getFilledInputUtilityClass(slot) {
|
1150
|
-
return generateUtilityClass("MuiFilledInput", slot);
|
1151
|
-
}
|
1152
|
-
const filledInputClasses = _extends({}, inputBaseClasses, generateUtilityClasses("MuiFilledInput", ["root", "underline", "input"]));
|
1153
|
-
const ArrowDropDownIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
|
1154
|
-
d: "M7 10l5 5 5-5z"
|
1155
|
-
}), "ArrowDropDown");
|
1156
|
-
const _excluded$a = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "slotProps", "slots", "type"];
|
1157
|
-
const useUtilityClasses$8 = (ownerState) => {
|
1158
|
-
const {
|
1159
|
-
classes,
|
1160
|
-
disableUnderline
|
1161
|
-
} = ownerState;
|
1162
|
-
const slots = {
|
1163
|
-
root: ["root", !disableUnderline && "underline"],
|
1164
|
-
input: ["input"]
|
1165
|
-
};
|
1166
|
-
const composedClasses = composeClasses(slots, getFilledInputUtilityClass, classes);
|
1167
|
-
return _extends({}, classes, composedClasses);
|
1168
|
-
};
|
1169
|
-
const FilledInputRoot = styled(InputBaseRoot, {
|
1170
|
-
shouldForwardProp: (prop) => rootShouldForwardProp(prop) || prop === "classes",
|
1171
|
-
name: "MuiFilledInput",
|
1172
|
-
slot: "Root",
|
1173
|
-
overridesResolver: (props, styles2) => {
|
1174
|
-
const {
|
1175
|
-
ownerState
|
1176
|
-
} = props;
|
1177
|
-
return [...rootOverridesResolver(props, styles2), !ownerState.disableUnderline && styles2.underline];
|
1178
|
-
}
|
1179
|
-
})(({
|
1180
|
-
theme,
|
1181
|
-
ownerState
|
1182
|
-
}) => {
|
1183
|
-
var _palette;
|
1184
|
-
const light = theme.palette.mode === "light";
|
1185
|
-
const bottomLineColor = light ? "rgba(0, 0, 0, 0.42)" : "rgba(255, 255, 255, 0.7)";
|
1186
|
-
const backgroundColor = light ? "rgba(0, 0, 0, 0.06)" : "rgba(255, 255, 255, 0.09)";
|
1187
|
-
const hoverBackground = light ? "rgba(0, 0, 0, 0.09)" : "rgba(255, 255, 255, 0.13)";
|
1188
|
-
const disabledBackground = light ? "rgba(0, 0, 0, 0.12)" : "rgba(255, 255, 255, 0.12)";
|
1189
|
-
return _extends({
|
1190
|
-
position: "relative",
|
1191
|
-
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor,
|
1192
|
-
borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
|
1193
|
-
borderTopRightRadius: (theme.vars || theme).shape.borderRadius,
|
1194
|
-
transition: theme.transitions.create("background-color", {
|
1195
|
-
duration: theme.transitions.duration.shorter,
|
1196
|
-
easing: theme.transitions.easing.easeOut
|
1197
|
-
}),
|
1198
|
-
"&:hover": {
|
1199
|
-
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.hoverBg : hoverBackground,
|
1200
|
-
// Reset on touch devices, it doesn't add specificity
|
1201
|
-
"@media (hover: none)": {
|
1202
|
-
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor
|
1203
|
-
}
|
1204
|
-
},
|
1205
|
-
[`&.${filledInputClasses.focused}`]: {
|
1206
|
-
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor
|
1207
|
-
},
|
1208
|
-
[`&.${filledInputClasses.disabled}`]: {
|
1209
|
-
backgroundColor: theme.vars ? theme.vars.palette.FilledInput.disabledBg : disabledBackground
|
1210
|
-
}
|
1211
|
-
}, !ownerState.disableUnderline && {
|
1212
|
-
"&::after": {
|
1213
|
-
borderBottom: `2px solid ${(_palette = (theme.vars || theme).palette[ownerState.color || "primary"]) == null ? void 0 : _palette.main}`,
|
1214
|
-
left: 0,
|
1215
|
-
bottom: 0,
|
1216
|
-
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
1217
|
-
content: '""',
|
1218
|
-
position: "absolute",
|
1219
|
-
right: 0,
|
1220
|
-
transform: "scaleX(0)",
|
1221
|
-
transition: theme.transitions.create("transform", {
|
1222
|
-
duration: theme.transitions.duration.shorter,
|
1223
|
-
easing: theme.transitions.easing.easeOut
|
1224
|
-
}),
|
1225
|
-
pointerEvents: "none"
|
1226
|
-
// Transparent to the hover style.
|
1227
|
-
},
|
1228
|
-
[`&.${filledInputClasses.focused}:after`]: {
|
1229
|
-
// translateX(0) is a workaround for Safari transform scale bug
|
1230
|
-
// See https://github.com/mui/material-ui/issues/31766
|
1231
|
-
transform: "scaleX(1) translateX(0)"
|
1232
|
-
},
|
1233
|
-
[`&.${filledInputClasses.error}`]: {
|
1234
|
-
"&::before, &::after": {
|
1235
|
-
borderBottomColor: (theme.vars || theme).palette.error.main
|
1236
|
-
}
|
1237
|
-
},
|
1238
|
-
"&::before": {
|
1239
|
-
borderBottom: `1px solid ${theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / ${theme.vars.opacity.inputUnderline})` : bottomLineColor}`,
|
1240
|
-
left: 0,
|
1241
|
-
bottom: 0,
|
1242
|
-
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
1243
|
-
content: '"\\00a0"',
|
1244
|
-
position: "absolute",
|
1245
|
-
right: 0,
|
1246
|
-
transition: theme.transitions.create("border-bottom-color", {
|
1247
|
-
duration: theme.transitions.duration.shorter
|
1248
|
-
}),
|
1249
|
-
pointerEvents: "none"
|
1250
|
-
// Transparent to the hover style.
|
1251
|
-
},
|
1252
|
-
[`&:hover:not(.${filledInputClasses.disabled}, .${filledInputClasses.error}):before`]: {
|
1253
|
-
borderBottom: `1px solid ${(theme.vars || theme).palette.text.primary}`
|
1254
|
-
},
|
1255
|
-
[`&.${filledInputClasses.disabled}:before`]: {
|
1256
|
-
borderBottomStyle: "dotted"
|
1257
|
-
}
|
1258
|
-
}, ownerState.startAdornment && {
|
1259
|
-
paddingLeft: 12
|
1260
|
-
}, ownerState.endAdornment && {
|
1261
|
-
paddingRight: 12
|
1262
|
-
}, ownerState.multiline && _extends({
|
1263
|
-
padding: "25px 12px 8px"
|
1264
|
-
}, ownerState.size === "small" && {
|
1265
|
-
paddingTop: 21,
|
1266
|
-
paddingBottom: 4
|
1267
|
-
}, ownerState.hiddenLabel && {
|
1268
|
-
paddingTop: 16,
|
1269
|
-
paddingBottom: 17
|
1270
|
-
}, ownerState.hiddenLabel && ownerState.size === "small" && {
|
1271
|
-
paddingTop: 8,
|
1272
|
-
paddingBottom: 9
|
1273
|
-
}));
|
1274
|
-
});
|
1275
|
-
const FilledInputInput = styled(InputBaseComponent, {
|
1276
|
-
name: "MuiFilledInput",
|
1277
|
-
slot: "Input",
|
1278
|
-
overridesResolver: inputOverridesResolver
|
1279
|
-
})(({
|
1280
|
-
theme,
|
1281
|
-
ownerState
|
1282
|
-
}) => _extends({
|
1283
|
-
paddingTop: 25,
|
1284
|
-
paddingRight: 12,
|
1285
|
-
paddingBottom: 8,
|
1286
|
-
paddingLeft: 12
|
1287
|
-
}, !theme.vars && {
|
1288
|
-
"&:-webkit-autofill": {
|
1289
|
-
WebkitBoxShadow: theme.palette.mode === "light" ? null : "0 0 0 100px #266798 inset",
|
1290
|
-
WebkitTextFillColor: theme.palette.mode === "light" ? null : "#fff",
|
1291
|
-
caretColor: theme.palette.mode === "light" ? null : "#fff",
|
1292
|
-
borderTopLeftRadius: "inherit",
|
1293
|
-
borderTopRightRadius: "inherit"
|
1294
|
-
}
|
1295
|
-
}, theme.vars && {
|
1296
|
-
"&:-webkit-autofill": {
|
1297
|
-
borderTopLeftRadius: "inherit",
|
1298
|
-
borderTopRightRadius: "inherit"
|
1299
|
-
},
|
1300
|
-
[theme.getColorSchemeSelector("dark")]: {
|
1301
|
-
"&:-webkit-autofill": {
|
1302
|
-
WebkitBoxShadow: "0 0 0 100px #266798 inset",
|
1303
|
-
WebkitTextFillColor: "#fff",
|
1304
|
-
caretColor: "#fff"
|
1305
|
-
}
|
1306
|
-
}
|
1307
|
-
}, ownerState.size === "small" && {
|
1308
|
-
paddingTop: 21,
|
1309
|
-
paddingBottom: 4
|
1310
|
-
}, ownerState.hiddenLabel && {
|
1311
|
-
paddingTop: 16,
|
1312
|
-
paddingBottom: 17
|
1313
|
-
}, ownerState.startAdornment && {
|
1314
|
-
paddingLeft: 0
|
1315
|
-
}, ownerState.endAdornment && {
|
1316
|
-
paddingRight: 0
|
1317
|
-
}, ownerState.hiddenLabel && ownerState.size === "small" && {
|
1318
|
-
paddingTop: 8,
|
1319
|
-
paddingBottom: 9
|
1320
|
-
}, ownerState.multiline && {
|
1321
|
-
paddingTop: 0,
|
1322
|
-
paddingBottom: 0,
|
1323
|
-
paddingLeft: 0,
|
1324
|
-
paddingRight: 0
|
1325
|
-
}));
|
1326
|
-
const FilledInput = /* @__PURE__ */ React.forwardRef(function FilledInput2(inProps, ref) {
|
1327
|
-
var _ref, _slots$root, _ref2, _slots$input;
|
1328
|
-
const props = useDefaultProps({
|
1329
|
-
props: inProps,
|
1330
|
-
name: "MuiFilledInput"
|
1331
|
-
});
|
1332
|
-
const {
|
1333
|
-
components = {},
|
1334
|
-
componentsProps: componentsPropsProp,
|
1335
|
-
fullWidth = false,
|
1336
|
-
// declare here to prevent spreading to DOM
|
1337
|
-
inputComponent = "input",
|
1338
|
-
multiline = false,
|
1339
|
-
slotProps,
|
1340
|
-
slots = {},
|
1341
|
-
type = "text"
|
1342
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded$a);
|
1343
|
-
const ownerState = _extends({}, props, {
|
1344
|
-
fullWidth,
|
1345
|
-
inputComponent,
|
1346
|
-
multiline,
|
1347
|
-
type
|
1348
|
-
});
|
1349
|
-
const classes = useUtilityClasses$8(props);
|
1350
|
-
const filledInputComponentsProps = {
|
1351
|
-
root: {
|
1352
|
-
ownerState
|
1353
|
-
},
|
1354
|
-
input: {
|
1355
|
-
ownerState
|
1356
|
-
}
|
1357
|
-
};
|
1358
|
-
const componentsProps = (slotProps != null ? slotProps : componentsPropsProp) ? deepmerge(filledInputComponentsProps, slotProps != null ? slotProps : componentsPropsProp) : filledInputComponentsProps;
|
1359
|
-
const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : FilledInputRoot;
|
1360
|
-
const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : FilledInputInput;
|
1361
|
-
return /* @__PURE__ */ jsx(InputBase, _extends({
|
1362
|
-
slots: {
|
1363
|
-
root: RootSlot,
|
1364
|
-
input: InputSlot
|
1365
|
-
},
|
1366
|
-
componentsProps,
|
1367
|
-
fullWidth,
|
1368
|
-
inputComponent,
|
1369
|
-
multiline,
|
1370
|
-
ref,
|
1371
|
-
type
|
1372
|
-
}, other, {
|
1373
|
-
classes
|
1374
|
-
}));
|
1375
|
-
});
|
1376
|
-
process$1.env.NODE_ENV !== "production" ? FilledInput.propTypes = {
|
1377
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
1378
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
1379
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
1380
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
1381
|
-
/**
|
1382
|
-
* This prop helps users to fill forms faster, especially on mobile devices.
|
1383
|
-
* The name can be confusing, as it's more like an autofill.
|
1384
|
-
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
1385
|
-
*/
|
1386
|
-
autoComplete: PropTypes.string,
|
1387
|
-
/**
|
1388
|
-
* If `true`, the `input` element is focused during the first mount.
|
1389
|
-
*/
|
1390
|
-
autoFocus: PropTypes.bool,
|
1391
|
-
/**
|
1392
|
-
* Override or extend the styles applied to the component.
|
1393
|
-
*/
|
1394
|
-
classes: PropTypes.object,
|
1395
|
-
/**
|
1396
|
-
* The color of the component.
|
1397
|
-
* It supports both default and custom theme colors, which can be added as shown in the
|
1398
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
1399
|
-
* The prop defaults to the value (`'primary'`) inherited from the parent FormControl component.
|
1400
|
-
*/
|
1401
|
-
color: PropTypes.oneOfType([PropTypes.oneOf(["primary", "secondary"]), PropTypes.string]),
|
1402
|
-
/**
|
1403
|
-
* The components used for each slot inside.
|
1404
|
-
*
|
1405
|
-
* This prop is an alias for the `slots` prop.
|
1406
|
-
* It's recommended to use the `slots` prop instead.
|
1407
|
-
*
|
1408
|
-
* @default {}
|
1409
|
-
*/
|
1410
|
-
components: PropTypes.shape({
|
1411
|
-
Input: PropTypes.elementType,
|
1412
|
-
Root: PropTypes.elementType
|
1413
|
-
}),
|
1414
|
-
/**
|
1415
|
-
* The extra props for the slot components.
|
1416
|
-
* You can override the existing props or add new ones.
|
1417
|
-
*
|
1418
|
-
* This prop is an alias for the `slotProps` prop.
|
1419
|
-
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
1420
|
-
*
|
1421
|
-
* @default {}
|
1422
|
-
*/
|
1423
|
-
componentsProps: PropTypes.shape({
|
1424
|
-
input: PropTypes.object,
|
1425
|
-
root: PropTypes.object
|
1426
|
-
}),
|
1427
|
-
/**
|
1428
|
-
* The default value. Use when the component is not controlled.
|
1429
|
-
*/
|
1430
|
-
defaultValue: PropTypes.any,
|
1431
|
-
/**
|
1432
|
-
* If `true`, the component is disabled.
|
1433
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
1434
|
-
*/
|
1435
|
-
disabled: PropTypes.bool,
|
1436
|
-
/**
|
1437
|
-
* If `true`, the input will not have an underline.
|
1438
|
-
*/
|
1439
|
-
disableUnderline: PropTypes.bool,
|
1440
|
-
/**
|
1441
|
-
* End `InputAdornment` for this component.
|
1442
|
-
*/
|
1443
|
-
endAdornment: PropTypes.node,
|
1444
|
-
/**
|
1445
|
-
* If `true`, the `input` will indicate an error.
|
1446
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
1447
|
-
*/
|
1448
|
-
error: PropTypes.bool,
|
1449
|
-
/**
|
1450
|
-
* If `true`, the `input` will take up the full width of its container.
|
1451
|
-
* @default false
|
1452
|
-
*/
|
1453
|
-
fullWidth: PropTypes.bool,
|
1454
|
-
/**
|
1455
|
-
* If `true`, the label is hidden.
|
1456
|
-
* This is used to increase density for a `FilledInput`.
|
1457
|
-
* Be sure to add `aria-label` to the `input` element.
|
1458
|
-
* @default false
|
1459
|
-
*/
|
1460
|
-
hiddenLabel: PropTypes.bool,
|
1461
|
-
/**
|
1462
|
-
* The id of the `input` element.
|
1463
|
-
*/
|
1464
|
-
id: PropTypes.string,
|
1465
|
-
/**
|
1466
|
-
* The component used for the `input` element.
|
1467
|
-
* Either a string to use a HTML element or a component.
|
1468
|
-
* @default 'input'
|
1469
|
-
*/
|
1470
|
-
inputComponent: PropTypes.elementType,
|
1471
|
-
/**
|
1472
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
|
1473
|
-
* @default {}
|
1474
|
-
*/
|
1475
|
-
inputProps: PropTypes.object,
|
1476
|
-
/**
|
1477
|
-
* Pass a ref to the `input` element.
|
1478
|
-
*/
|
1479
|
-
inputRef: refType,
|
1480
|
-
/**
|
1481
|
-
* If `dense`, will adjust vertical spacing. This is normally obtained via context from
|
1482
|
-
* FormControl.
|
1483
|
-
* The prop defaults to the value (`'none'`) inherited from the parent FormControl component.
|
1484
|
-
*/
|
1485
|
-
margin: PropTypes.oneOf(["dense", "none"]),
|
1486
|
-
/**
|
1487
|
-
* Maximum number of rows to display when multiline option is set to true.
|
1488
|
-
*/
|
1489
|
-
maxRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
1490
|
-
/**
|
1491
|
-
* Minimum number of rows to display when multiline option is set to true.
|
1492
|
-
*/
|
1493
|
-
minRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
1494
|
-
/**
|
1495
|
-
* If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.
|
1496
|
-
* @default false
|
1497
|
-
*/
|
1498
|
-
multiline: PropTypes.bool,
|
1499
|
-
/**
|
1500
|
-
* Name attribute of the `input` element.
|
1501
|
-
*/
|
1502
|
-
name: PropTypes.string,
|
1503
|
-
/**
|
1504
|
-
* Callback fired when the value is changed.
|
1505
|
-
*
|
1506
|
-
* @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
|
1507
|
-
* You can pull out the new value by accessing `event.target.value` (string).
|
1508
|
-
*/
|
1509
|
-
onChange: PropTypes.func,
|
1510
|
-
/**
|
1511
|
-
* The short hint displayed in the `input` before the user enters a value.
|
1512
|
-
*/
|
1513
|
-
placeholder: PropTypes.string,
|
1514
|
-
/**
|
1515
|
-
* It prevents the user from changing the value of the field
|
1516
|
-
* (not from interacting with the field).
|
1517
|
-
*/
|
1518
|
-
readOnly: PropTypes.bool,
|
1519
|
-
/**
|
1520
|
-
* If `true`, the `input` element is required.
|
1521
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
1522
|
-
*/
|
1523
|
-
required: PropTypes.bool,
|
1524
|
-
/**
|
1525
|
-
* Number of rows to display when multiline option is set to true.
|
1526
|
-
*/
|
1527
|
-
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
1528
|
-
/**
|
1529
|
-
* The extra props for the slot components.
|
1530
|
-
* You can override the existing props or add new ones.
|
1531
|
-
*
|
1532
|
-
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
1533
|
-
*
|
1534
|
-
* @default {}
|
1535
|
-
*/
|
1536
|
-
slotProps: PropTypes.shape({
|
1537
|
-
input: PropTypes.object,
|
1538
|
-
root: PropTypes.object
|
1539
|
-
}),
|
1540
|
-
/**
|
1541
|
-
* The components used for each slot inside.
|
1542
|
-
*
|
1543
|
-
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
1544
|
-
*
|
1545
|
-
* @default {}
|
1546
|
-
*/
|
1547
|
-
slots: PropTypes.shape({
|
1548
|
-
input: PropTypes.elementType,
|
1549
|
-
root: PropTypes.elementType
|
1550
|
-
}),
|
1551
|
-
/**
|
1552
|
-
* Start `InputAdornment` for this component.
|
1553
|
-
*/
|
1554
|
-
startAdornment: PropTypes.node,
|
1555
|
-
/**
|
1556
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
1557
|
-
*/
|
1558
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
1559
|
-
/**
|
1560
|
-
* Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
|
1561
|
-
* @default 'text'
|
1562
|
-
*/
|
1563
|
-
type: PropTypes.string,
|
1564
|
-
/**
|
1565
|
-
* The value of the `input` element, required for a controlled component.
|
1566
|
-
*/
|
1567
|
-
value: PropTypes.any
|
1568
|
-
} : void 0;
|
1569
|
-
FilledInput.muiName = "Input";
|
1570
|
-
const _excluded$9 = ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "slotProps", "slots", "type"];
|
1571
|
-
const useUtilityClasses$7 = (ownerState) => {
|
1572
|
-
const {
|
1573
|
-
classes,
|
1574
|
-
disableUnderline
|
1575
|
-
} = ownerState;
|
1576
|
-
const slots = {
|
1577
|
-
root: ["root", !disableUnderline && "underline"],
|
1578
|
-
input: ["input"]
|
1579
|
-
};
|
1580
|
-
const composedClasses = composeClasses(slots, getInputUtilityClass, classes);
|
1581
|
-
return _extends({}, classes, composedClasses);
|
1582
|
-
};
|
1583
|
-
const InputRoot = styled(InputBaseRoot, {
|
1584
|
-
shouldForwardProp: (prop) => rootShouldForwardProp(prop) || prop === "classes",
|
1585
|
-
name: "MuiInput",
|
1586
|
-
slot: "Root",
|
1587
|
-
overridesResolver: (props, styles2) => {
|
1588
|
-
const {
|
1589
|
-
ownerState
|
1590
|
-
} = props;
|
1591
|
-
return [...rootOverridesResolver(props, styles2), !ownerState.disableUnderline && styles2.underline];
|
1592
|
-
}
|
1593
|
-
})(({
|
1594
|
-
theme,
|
1595
|
-
ownerState
|
1596
|
-
}) => {
|
1597
|
-
const light = theme.palette.mode === "light";
|
1598
|
-
let bottomLineColor = light ? "rgba(0, 0, 0, 0.42)" : "rgba(255, 255, 255, 0.7)";
|
1599
|
-
if (theme.vars) {
|
1600
|
-
bottomLineColor = `rgba(${theme.vars.palette.common.onBackgroundChannel} / ${theme.vars.opacity.inputUnderline})`;
|
1601
|
-
}
|
1602
|
-
return _extends({
|
1603
|
-
position: "relative"
|
1604
|
-
}, ownerState.formControl && {
|
1605
|
-
"label + &": {
|
1606
|
-
marginTop: 16
|
1607
|
-
}
|
1608
|
-
}, !ownerState.disableUnderline && {
|
1609
|
-
"&::after": {
|
1610
|
-
borderBottom: `2px solid ${(theme.vars || theme).palette[ownerState.color].main}`,
|
1611
|
-
left: 0,
|
1612
|
-
bottom: 0,
|
1613
|
-
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
1614
|
-
content: '""',
|
1615
|
-
position: "absolute",
|
1616
|
-
right: 0,
|
1617
|
-
transform: "scaleX(0)",
|
1618
|
-
transition: theme.transitions.create("transform", {
|
1619
|
-
duration: theme.transitions.duration.shorter,
|
1620
|
-
easing: theme.transitions.easing.easeOut
|
1621
|
-
}),
|
1622
|
-
pointerEvents: "none"
|
1623
|
-
// Transparent to the hover style.
|
1624
|
-
},
|
1625
|
-
[`&.${inputClasses.focused}:after`]: {
|
1626
|
-
// translateX(0) is a workaround for Safari transform scale bug
|
1627
|
-
// See https://github.com/mui/material-ui/issues/31766
|
1628
|
-
transform: "scaleX(1) translateX(0)"
|
1629
|
-
},
|
1630
|
-
[`&.${inputClasses.error}`]: {
|
1631
|
-
"&::before, &::after": {
|
1632
|
-
borderBottomColor: (theme.vars || theme).palette.error.main
|
1633
|
-
}
|
1634
|
-
},
|
1635
|
-
"&::before": {
|
1636
|
-
borderBottom: `1px solid ${bottomLineColor}`,
|
1637
|
-
left: 0,
|
1638
|
-
bottom: 0,
|
1639
|
-
// Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
|
1640
|
-
content: '"\\00a0"',
|
1641
|
-
position: "absolute",
|
1642
|
-
right: 0,
|
1643
|
-
transition: theme.transitions.create("border-bottom-color", {
|
1644
|
-
duration: theme.transitions.duration.shorter
|
1645
|
-
}),
|
1646
|
-
pointerEvents: "none"
|
1647
|
-
// Transparent to the hover style.
|
1648
|
-
},
|
1649
|
-
[`&:hover:not(.${inputClasses.disabled}, .${inputClasses.error}):before`]: {
|
1650
|
-
borderBottom: `2px solid ${(theme.vars || theme).palette.text.primary}`,
|
1651
|
-
// Reset on touch devices, it doesn't add specificity
|
1652
|
-
"@media (hover: none)": {
|
1653
|
-
borderBottom: `1px solid ${bottomLineColor}`
|
1654
|
-
}
|
1655
|
-
},
|
1656
|
-
[`&.${inputClasses.disabled}:before`]: {
|
1657
|
-
borderBottomStyle: "dotted"
|
1658
|
-
}
|
1659
|
-
});
|
1660
|
-
});
|
1661
|
-
const InputInput = styled(InputBaseComponent, {
|
1662
|
-
name: "MuiInput",
|
1663
|
-
slot: "Input",
|
1664
|
-
overridesResolver: inputOverridesResolver
|
1665
|
-
})({});
|
1666
|
-
const Input = /* @__PURE__ */ React.forwardRef(function Input2(inProps, ref) {
|
1667
|
-
var _ref, _slots$root, _ref2, _slots$input;
|
1668
|
-
const props = useDefaultProps({
|
1669
|
-
props: inProps,
|
1670
|
-
name: "MuiInput"
|
1671
|
-
});
|
1672
|
-
const {
|
1673
|
-
disableUnderline,
|
1674
|
-
components = {},
|
1675
|
-
componentsProps: componentsPropsProp,
|
1676
|
-
fullWidth = false,
|
1677
|
-
inputComponent = "input",
|
1678
|
-
multiline = false,
|
1679
|
-
slotProps,
|
1680
|
-
slots = {},
|
1681
|
-
type = "text"
|
1682
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded$9);
|
1683
|
-
const classes = useUtilityClasses$7(props);
|
1684
|
-
const ownerState = {
|
1685
|
-
disableUnderline
|
1686
|
-
};
|
1687
|
-
const inputComponentsProps = {
|
1688
|
-
root: {
|
1689
|
-
ownerState
|
1690
|
-
}
|
1691
|
-
};
|
1692
|
-
const componentsProps = (slotProps != null ? slotProps : componentsPropsProp) ? deepmerge(slotProps != null ? slotProps : componentsPropsProp, inputComponentsProps) : inputComponentsProps;
|
1693
|
-
const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : InputRoot;
|
1694
|
-
const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : InputInput;
|
1695
|
-
return /* @__PURE__ */ jsx(InputBase, _extends({
|
1696
|
-
slots: {
|
1697
|
-
root: RootSlot,
|
1698
|
-
input: InputSlot
|
1699
|
-
},
|
1700
|
-
slotProps: componentsProps,
|
1701
|
-
fullWidth,
|
1702
|
-
inputComponent,
|
1703
|
-
multiline,
|
1704
|
-
ref,
|
1705
|
-
type
|
1706
|
-
}, other, {
|
1707
|
-
classes
|
1708
|
-
}));
|
1709
|
-
});
|
1710
|
-
process$1.env.NODE_ENV !== "production" ? Input.propTypes = {
|
1711
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
1712
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
1713
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
1714
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
1715
|
-
/**
|
1716
|
-
* This prop helps users to fill forms faster, especially on mobile devices.
|
1717
|
-
* The name can be confusing, as it's more like an autofill.
|
1718
|
-
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
1719
|
-
*/
|
1720
|
-
autoComplete: PropTypes.string,
|
1721
|
-
/**
|
1722
|
-
* If `true`, the `input` element is focused during the first mount.
|
1723
|
-
*/
|
1724
|
-
autoFocus: PropTypes.bool,
|
1725
|
-
/**
|
1726
|
-
* Override or extend the styles applied to the component.
|
1727
|
-
*/
|
1728
|
-
classes: PropTypes.object,
|
1729
|
-
/**
|
1730
|
-
* The color of the component.
|
1731
|
-
* It supports both default and custom theme colors, which can be added as shown in the
|
1732
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
1733
|
-
* The prop defaults to the value (`'primary'`) inherited from the parent FormControl component.
|
1734
|
-
*/
|
1735
|
-
color: PropTypes.oneOfType([PropTypes.oneOf(["primary", "secondary"]), PropTypes.string]),
|
1736
|
-
/**
|
1737
|
-
* The components used for each slot inside.
|
1738
|
-
*
|
1739
|
-
* This prop is an alias for the `slots` prop.
|
1740
|
-
* It's recommended to use the `slots` prop instead.
|
1741
|
-
*
|
1742
|
-
* @default {}
|
1743
|
-
*/
|
1744
|
-
components: PropTypes.shape({
|
1745
|
-
Input: PropTypes.elementType,
|
1746
|
-
Root: PropTypes.elementType
|
1747
|
-
}),
|
1748
|
-
/**
|
1749
|
-
* The extra props for the slot components.
|
1750
|
-
* You can override the existing props or add new ones.
|
1751
|
-
*
|
1752
|
-
* This prop is an alias for the `slotProps` prop.
|
1753
|
-
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
1754
|
-
*
|
1755
|
-
* @default {}
|
1756
|
-
*/
|
1757
|
-
componentsProps: PropTypes.shape({
|
1758
|
-
input: PropTypes.object,
|
1759
|
-
root: PropTypes.object
|
1760
|
-
}),
|
1761
|
-
/**
|
1762
|
-
* The default value. Use when the component is not controlled.
|
1763
|
-
*/
|
1764
|
-
defaultValue: PropTypes.any,
|
1765
|
-
/**
|
1766
|
-
* If `true`, the component is disabled.
|
1767
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
1768
|
-
*/
|
1769
|
-
disabled: PropTypes.bool,
|
1770
|
-
/**
|
1771
|
-
* If `true`, the `input` will not have an underline.
|
1772
|
-
*/
|
1773
|
-
disableUnderline: PropTypes.bool,
|
1774
|
-
/**
|
1775
|
-
* End `InputAdornment` for this component.
|
1776
|
-
*/
|
1777
|
-
endAdornment: PropTypes.node,
|
1778
|
-
/**
|
1779
|
-
* If `true`, the `input` will indicate an error.
|
1780
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
1781
|
-
*/
|
1782
|
-
error: PropTypes.bool,
|
1783
|
-
/**
|
1784
|
-
* If `true`, the `input` will take up the full width of its container.
|
1785
|
-
* @default false
|
1786
|
-
*/
|
1787
|
-
fullWidth: PropTypes.bool,
|
1788
|
-
/**
|
1789
|
-
* The id of the `input` element.
|
1790
|
-
*/
|
1791
|
-
id: PropTypes.string,
|
1792
|
-
/**
|
1793
|
-
* The component used for the `input` element.
|
1794
|
-
* Either a string to use a HTML element or a component.
|
1795
|
-
* @default 'input'
|
1796
|
-
*/
|
1797
|
-
inputComponent: PropTypes.elementType,
|
1798
|
-
/**
|
1799
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
|
1800
|
-
* @default {}
|
1801
|
-
*/
|
1802
|
-
inputProps: PropTypes.object,
|
1803
|
-
/**
|
1804
|
-
* Pass a ref to the `input` element.
|
1805
|
-
*/
|
1806
|
-
inputRef: refType,
|
1807
|
-
/**
|
1808
|
-
* If `dense`, will adjust vertical spacing. This is normally obtained via context from
|
1809
|
-
* FormControl.
|
1810
|
-
* The prop defaults to the value (`'none'`) inherited from the parent FormControl component.
|
1811
|
-
*/
|
1812
|
-
margin: PropTypes.oneOf(["dense", "none"]),
|
1813
|
-
/**
|
1814
|
-
* Maximum number of rows to display when multiline option is set to true.
|
1815
|
-
*/
|
1816
|
-
maxRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
1817
|
-
/**
|
1818
|
-
* Minimum number of rows to display when multiline option is set to true.
|
1819
|
-
*/
|
1820
|
-
minRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
1821
|
-
/**
|
1822
|
-
* If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.
|
1823
|
-
* @default false
|
1824
|
-
*/
|
1825
|
-
multiline: PropTypes.bool,
|
1826
|
-
/**
|
1827
|
-
* Name attribute of the `input` element.
|
1828
|
-
*/
|
1829
|
-
name: PropTypes.string,
|
1830
|
-
/**
|
1831
|
-
* Callback fired when the value is changed.
|
1832
|
-
*
|
1833
|
-
* @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
|
1834
|
-
* You can pull out the new value by accessing `event.target.value` (string).
|
1835
|
-
*/
|
1836
|
-
onChange: PropTypes.func,
|
1837
|
-
/**
|
1838
|
-
* The short hint displayed in the `input` before the user enters a value.
|
1839
|
-
*/
|
1840
|
-
placeholder: PropTypes.string,
|
1841
|
-
/**
|
1842
|
-
* It prevents the user from changing the value of the field
|
1843
|
-
* (not from interacting with the field).
|
1844
|
-
*/
|
1845
|
-
readOnly: PropTypes.bool,
|
1846
|
-
/**
|
1847
|
-
* If `true`, the `input` element is required.
|
1848
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
1849
|
-
*/
|
1850
|
-
required: PropTypes.bool,
|
1851
|
-
/**
|
1852
|
-
* Number of rows to display when multiline option is set to true.
|
1853
|
-
*/
|
1854
|
-
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
1855
|
-
/**
|
1856
|
-
* The extra props for the slot components.
|
1857
|
-
* You can override the existing props or add new ones.
|
1858
|
-
*
|
1859
|
-
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
1860
|
-
*
|
1861
|
-
* @default {}
|
1862
|
-
*/
|
1863
|
-
slotProps: PropTypes.shape({
|
1864
|
-
input: PropTypes.object,
|
1865
|
-
root: PropTypes.object
|
1866
|
-
}),
|
1867
|
-
/**
|
1868
|
-
* The components used for each slot inside.
|
1869
|
-
*
|
1870
|
-
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
1871
|
-
*
|
1872
|
-
* @default {}
|
1873
|
-
*/
|
1874
|
-
slots: PropTypes.shape({
|
1875
|
-
input: PropTypes.elementType,
|
1876
|
-
root: PropTypes.elementType
|
1877
|
-
}),
|
1878
|
-
/**
|
1879
|
-
* Start `InputAdornment` for this component.
|
1880
|
-
*/
|
1881
|
-
startAdornment: PropTypes.node,
|
1882
|
-
/**
|
1883
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
1884
|
-
*/
|
1885
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
1886
|
-
/**
|
1887
|
-
* Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
|
1888
|
-
* @default 'text'
|
1889
|
-
*/
|
1890
|
-
type: PropTypes.string,
|
1891
|
-
/**
|
1892
|
-
* The value of the `input` element, required for a controlled component.
|
1893
|
-
*/
|
1894
|
-
value: PropTypes.any
|
1895
|
-
} : void 0;
|
1896
|
-
Input.muiName = "Input";
|
1897
|
-
const ListContext = /* @__PURE__ */ React.createContext({});
|
1898
|
-
if (process$1.env.NODE_ENV !== "production") {
|
1899
|
-
ListContext.displayName = "ListContext";
|
1900
|
-
}
|
1901
|
-
function getListUtilityClass(slot) {
|
1902
|
-
return generateUtilityClass("MuiList", slot);
|
1903
|
-
}
|
1904
|
-
generateUtilityClasses("MuiList", ["root", "padding", "dense", "subheader"]);
|
1905
|
-
const _excluded$8 = ["children", "className", "component", "dense", "disablePadding", "subheader"];
|
1906
|
-
const useUtilityClasses$6 = (ownerState) => {
|
1907
|
-
const {
|
1908
|
-
classes,
|
1909
|
-
disablePadding,
|
1910
|
-
dense,
|
1911
|
-
subheader
|
1912
|
-
} = ownerState;
|
1913
|
-
const slots = {
|
1914
|
-
root: ["root", !disablePadding && "padding", dense && "dense", subheader && "subheader"]
|
1915
|
-
};
|
1916
|
-
return composeClasses(slots, getListUtilityClass, classes);
|
1917
|
-
};
|
1918
|
-
const ListRoot = styled("ul", {
|
1919
|
-
name: "MuiList",
|
1920
|
-
slot: "Root",
|
1921
|
-
overridesResolver: (props, styles2) => {
|
1922
|
-
const {
|
1923
|
-
ownerState
|
1924
|
-
} = props;
|
1925
|
-
return [styles2.root, !ownerState.disablePadding && styles2.padding, ownerState.dense && styles2.dense, ownerState.subheader && styles2.subheader];
|
1926
|
-
}
|
1927
|
-
})(({
|
1928
|
-
ownerState
|
1929
|
-
}) => _extends({
|
1930
|
-
listStyle: "none",
|
1931
|
-
margin: 0,
|
1932
|
-
padding: 0,
|
1933
|
-
position: "relative"
|
1934
|
-
}, !ownerState.disablePadding && {
|
1935
|
-
paddingTop: 8,
|
1936
|
-
paddingBottom: 8
|
1937
|
-
}, ownerState.subheader && {
|
1938
|
-
paddingTop: 0
|
1939
|
-
}));
|
1940
|
-
const List = /* @__PURE__ */ React.forwardRef(function List2(inProps, ref) {
|
1941
|
-
const props = useDefaultProps({
|
1942
|
-
props: inProps,
|
1943
|
-
name: "MuiList"
|
1944
|
-
});
|
1945
|
-
const {
|
1946
|
-
children,
|
1947
|
-
className,
|
1948
|
-
component = "ul",
|
1949
|
-
dense = false,
|
1950
|
-
disablePadding = false,
|
1951
|
-
subheader
|
1952
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded$8);
|
1953
|
-
const context = React.useMemo(() => ({
|
1954
|
-
dense
|
1955
|
-
}), [dense]);
|
1956
|
-
const ownerState = _extends({}, props, {
|
1957
|
-
component,
|
1958
|
-
dense,
|
1959
|
-
disablePadding
|
1960
|
-
});
|
1961
|
-
const classes = useUtilityClasses$6(ownerState);
|
1962
|
-
return /* @__PURE__ */ jsx(ListContext.Provider, {
|
1963
|
-
value: context,
|
1964
|
-
children: /* @__PURE__ */ jsxs(ListRoot, _extends({
|
1965
|
-
as: component,
|
1966
|
-
className: clsx(classes.root, className),
|
1967
|
-
ref,
|
1968
|
-
ownerState
|
1969
|
-
}, other, {
|
1970
|
-
children: [subheader, children]
|
1971
|
-
}))
|
1972
|
-
});
|
1973
|
-
});
|
1974
|
-
process$1.env.NODE_ENV !== "production" ? List.propTypes = {
|
1975
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
1976
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
1977
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
1978
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
1979
|
-
/**
|
1980
|
-
* The content of the component.
|
1981
|
-
*/
|
1982
|
-
children: PropTypes.node,
|
1983
|
-
/**
|
1984
|
-
* Override or extend the styles applied to the component.
|
1985
|
-
*/
|
1986
|
-
classes: PropTypes.object,
|
1987
|
-
/**
|
1988
|
-
* @ignore
|
1989
|
-
*/
|
1990
|
-
className: PropTypes.string,
|
1991
|
-
/**
|
1992
|
-
* The component used for the root node.
|
1993
|
-
* Either a string to use a HTML element or a component.
|
1994
|
-
*/
|
1995
|
-
component: PropTypes.elementType,
|
1996
|
-
/**
|
1997
|
-
* If `true`, compact vertical padding designed for keyboard and mouse input is used for
|
1998
|
-
* the list and list items.
|
1999
|
-
* The prop is available to descendant components as the `dense` context.
|
2000
|
-
* @default false
|
2001
|
-
*/
|
2002
|
-
dense: PropTypes.bool,
|
2003
|
-
/**
|
2004
|
-
* If `true`, vertical padding is removed from the list.
|
2005
|
-
* @default false
|
2006
|
-
*/
|
2007
|
-
disablePadding: PropTypes.bool,
|
2008
|
-
/**
|
2009
|
-
* The content of the subheader, normally `ListSubheader`.
|
2010
|
-
*/
|
2011
|
-
subheader: PropTypes.node,
|
2012
|
-
/**
|
2013
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
2014
|
-
*/
|
2015
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
2016
|
-
} : void 0;
|
2017
|
-
const _excluded$7 = ["actions", "autoFocus", "autoFocusItem", "children", "className", "disabledItemsFocusable", "disableListWrap", "onKeyDown", "variant"];
|
2018
|
-
function nextItem(list, item, disableListWrap) {
|
2019
|
-
if (list === item) {
|
2020
|
-
return list.firstChild;
|
2021
|
-
}
|
2022
|
-
if (item && item.nextElementSibling) {
|
2023
|
-
return item.nextElementSibling;
|
2024
|
-
}
|
2025
|
-
return disableListWrap ? null : list.firstChild;
|
2026
|
-
}
|
2027
|
-
function previousItem(list, item, disableListWrap) {
|
2028
|
-
if (list === item) {
|
2029
|
-
return disableListWrap ? list.firstChild : list.lastChild;
|
2030
|
-
}
|
2031
|
-
if (item && item.previousElementSibling) {
|
2032
|
-
return item.previousElementSibling;
|
2033
|
-
}
|
2034
|
-
return disableListWrap ? null : list.lastChild;
|
2035
|
-
}
|
2036
|
-
function textCriteriaMatches(nextFocus, textCriteria) {
|
2037
|
-
if (textCriteria === void 0) {
|
2038
|
-
return true;
|
2039
|
-
}
|
2040
|
-
let text = nextFocus.innerText;
|
2041
|
-
if (text === void 0) {
|
2042
|
-
text = nextFocus.textContent;
|
2043
|
-
}
|
2044
|
-
text = text.trim().toLowerCase();
|
2045
|
-
if (text.length === 0) {
|
2046
|
-
return false;
|
2047
|
-
}
|
2048
|
-
if (textCriteria.repeating) {
|
2049
|
-
return text[0] === textCriteria.keys[0];
|
2050
|
-
}
|
2051
|
-
return text.indexOf(textCriteria.keys.join("")) === 0;
|
2052
|
-
}
|
2053
|
-
function moveFocus(list, currentFocus, disableListWrap, disabledItemsFocusable, traversalFunction, textCriteria) {
|
2054
|
-
let wrappedOnce = false;
|
2055
|
-
let nextFocus = traversalFunction(list, currentFocus, currentFocus ? disableListWrap : false);
|
2056
|
-
while (nextFocus) {
|
2057
|
-
if (nextFocus === list.firstChild) {
|
2058
|
-
if (wrappedOnce) {
|
2059
|
-
return false;
|
2060
|
-
}
|
2061
|
-
wrappedOnce = true;
|
2062
|
-
}
|
2063
|
-
const nextFocusDisabled = disabledItemsFocusable ? false : nextFocus.disabled || nextFocus.getAttribute("aria-disabled") === "true";
|
2064
|
-
if (!nextFocus.hasAttribute("tabindex") || !textCriteriaMatches(nextFocus, textCriteria) || nextFocusDisabled) {
|
2065
|
-
nextFocus = traversalFunction(list, nextFocus, disableListWrap);
|
2066
|
-
} else {
|
2067
|
-
nextFocus.focus();
|
2068
|
-
return true;
|
2069
|
-
}
|
2070
|
-
}
|
2071
|
-
return false;
|
2072
|
-
}
|
2073
|
-
const MenuList = /* @__PURE__ */ React.forwardRef(function MenuList2(props, ref) {
|
2074
|
-
const {
|
2075
|
-
// private
|
2076
|
-
// eslint-disable-next-line react/prop-types
|
2077
|
-
actions,
|
2078
|
-
autoFocus = false,
|
2079
|
-
autoFocusItem = false,
|
2080
|
-
children,
|
2081
|
-
className,
|
2082
|
-
disabledItemsFocusable = false,
|
2083
|
-
disableListWrap = false,
|
2084
|
-
onKeyDown,
|
2085
|
-
variant = "selectedMenu"
|
2086
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded$7);
|
2087
|
-
const listRef = React.useRef(null);
|
2088
|
-
const textCriteriaRef = React.useRef({
|
2089
|
-
keys: [],
|
2090
|
-
repeating: true,
|
2091
|
-
previousKeyMatched: true,
|
2092
|
-
lastTime: null
|
2093
|
-
});
|
2094
|
-
useEnhancedEffect(() => {
|
2095
|
-
if (autoFocus) {
|
2096
|
-
listRef.current.focus();
|
2097
|
-
}
|
2098
|
-
}, [autoFocus]);
|
2099
|
-
React.useImperativeHandle(actions, () => ({
|
2100
|
-
adjustStyleForScrollbar: (containerElement, {
|
2101
|
-
direction
|
2102
|
-
}) => {
|
2103
|
-
const noExplicitWidth = !listRef.current.style.width;
|
2104
|
-
if (containerElement.clientHeight < listRef.current.clientHeight && noExplicitWidth) {
|
2105
|
-
const scrollbarSize = `${getScrollbarSize(ownerDocument(containerElement))}px`;
|
2106
|
-
listRef.current.style[direction === "rtl" ? "paddingLeft" : "paddingRight"] = scrollbarSize;
|
2107
|
-
listRef.current.style.width = `calc(100% + ${scrollbarSize})`;
|
2108
|
-
}
|
2109
|
-
return listRef.current;
|
2110
|
-
}
|
2111
|
-
}), []);
|
2112
|
-
const handleKeyDown = (event) => {
|
2113
|
-
const list = listRef.current;
|
2114
|
-
const key = event.key;
|
2115
|
-
const currentFocus = ownerDocument(list).activeElement;
|
2116
|
-
if (key === "ArrowDown") {
|
2117
|
-
event.preventDefault();
|
2118
|
-
moveFocus(list, currentFocus, disableListWrap, disabledItemsFocusable, nextItem);
|
2119
|
-
} else if (key === "ArrowUp") {
|
2120
|
-
event.preventDefault();
|
2121
|
-
moveFocus(list, currentFocus, disableListWrap, disabledItemsFocusable, previousItem);
|
2122
|
-
} else if (key === "Home") {
|
2123
|
-
event.preventDefault();
|
2124
|
-
moveFocus(list, null, disableListWrap, disabledItemsFocusable, nextItem);
|
2125
|
-
} else if (key === "End") {
|
2126
|
-
event.preventDefault();
|
2127
|
-
moveFocus(list, null, disableListWrap, disabledItemsFocusable, previousItem);
|
2128
|
-
} else if (key.length === 1) {
|
2129
|
-
const criteria = textCriteriaRef.current;
|
2130
|
-
const lowerKey = key.toLowerCase();
|
2131
|
-
const currTime = performance.now();
|
2132
|
-
if (criteria.keys.length > 0) {
|
2133
|
-
if (currTime - criteria.lastTime > 500) {
|
2134
|
-
criteria.keys = [];
|
2135
|
-
criteria.repeating = true;
|
2136
|
-
criteria.previousKeyMatched = true;
|
2137
|
-
} else if (criteria.repeating && lowerKey !== criteria.keys[0]) {
|
2138
|
-
criteria.repeating = false;
|
2139
|
-
}
|
2140
|
-
}
|
2141
|
-
criteria.lastTime = currTime;
|
2142
|
-
criteria.keys.push(lowerKey);
|
2143
|
-
const keepFocusOnCurrent = currentFocus && !criteria.repeating && textCriteriaMatches(currentFocus, criteria);
|
2144
|
-
if (criteria.previousKeyMatched && (keepFocusOnCurrent || moveFocus(list, currentFocus, false, disabledItemsFocusable, nextItem, criteria))) {
|
2145
|
-
event.preventDefault();
|
2146
|
-
} else {
|
2147
|
-
criteria.previousKeyMatched = false;
|
2148
|
-
}
|
2149
|
-
}
|
2150
|
-
if (onKeyDown) {
|
2151
|
-
onKeyDown(event);
|
2152
|
-
}
|
2153
|
-
};
|
2154
|
-
const handleRef = useForkRef(listRef, ref);
|
2155
|
-
let activeItemIndex = -1;
|
2156
|
-
React.Children.forEach(children, (child, index) => {
|
2157
|
-
if (!/* @__PURE__ */ React.isValidElement(child)) {
|
2158
|
-
if (activeItemIndex === index) {
|
2159
|
-
activeItemIndex += 1;
|
2160
|
-
if (activeItemIndex >= children.length) {
|
2161
|
-
activeItemIndex = -1;
|
2162
|
-
}
|
2163
|
-
}
|
2164
|
-
return;
|
2165
|
-
}
|
2166
|
-
if (process$1.env.NODE_ENV !== "production") {
|
2167
|
-
if (reactIsExports.isFragment(child)) {
|
2168
|
-
}
|
2169
|
-
}
|
2170
|
-
if (!child.props.disabled) {
|
2171
|
-
if (variant === "selectedMenu" && child.props.selected) {
|
2172
|
-
activeItemIndex = index;
|
2173
|
-
} else if (activeItemIndex === -1) {
|
2174
|
-
activeItemIndex = index;
|
2175
|
-
}
|
2176
|
-
}
|
2177
|
-
if (activeItemIndex === index && (child.props.disabled || child.props.muiSkipListHighlight || child.type.muiSkipListHighlight)) {
|
2178
|
-
activeItemIndex += 1;
|
2179
|
-
if (activeItemIndex >= children.length) {
|
2180
|
-
activeItemIndex = -1;
|
2181
|
-
}
|
2182
|
-
}
|
2183
|
-
});
|
2184
|
-
const items = React.Children.map(children, (child, index) => {
|
2185
|
-
if (index === activeItemIndex) {
|
2186
|
-
const newChildProps = {};
|
2187
|
-
if (autoFocusItem) {
|
2188
|
-
newChildProps.autoFocus = true;
|
2189
|
-
}
|
2190
|
-
if (child.props.tabIndex === void 0 && variant === "selectedMenu") {
|
2191
|
-
newChildProps.tabIndex = 0;
|
2192
|
-
}
|
2193
|
-
return /* @__PURE__ */ React.cloneElement(child, newChildProps);
|
2194
|
-
}
|
2195
|
-
return child;
|
2196
|
-
});
|
2197
|
-
return /* @__PURE__ */ jsx(List, _extends({
|
2198
|
-
role: "menu",
|
2199
|
-
ref: handleRef,
|
2200
|
-
className,
|
2201
|
-
onKeyDown: handleKeyDown,
|
2202
|
-
tabIndex: autoFocus ? 0 : -1
|
2203
|
-
}, other, {
|
2204
|
-
children: items
|
2205
|
-
}));
|
2206
|
-
});
|
2207
|
-
process$1.env.NODE_ENV !== "production" ? MenuList.propTypes = {
|
2208
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
2209
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
2210
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
2211
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
2212
|
-
/**
|
2213
|
-
* If `true`, will focus the `[role="menu"]` container and move into tab order.
|
2214
|
-
* @default false
|
2215
|
-
*/
|
2216
|
-
autoFocus: PropTypes.bool,
|
2217
|
-
/**
|
2218
|
-
* If `true`, will focus the first menuitem if `variant="menu"` or selected item
|
2219
|
-
* if `variant="selectedMenu"`.
|
2220
|
-
* @default false
|
2221
|
-
*/
|
2222
|
-
autoFocusItem: PropTypes.bool,
|
2223
|
-
/**
|
2224
|
-
* MenuList contents, normally `MenuItem`s.
|
2225
|
-
*/
|
2226
|
-
children: PropTypes.node,
|
2227
|
-
/**
|
2228
|
-
* @ignore
|
2229
|
-
*/
|
2230
|
-
className: PropTypes.string,
|
2231
|
-
/**
|
2232
|
-
* If `true`, will allow focus on disabled items.
|
2233
|
-
* @default false
|
2234
|
-
*/
|
2235
|
-
disabledItemsFocusable: PropTypes.bool,
|
2236
|
-
/**
|
2237
|
-
* If `true`, the menu items will not wrap focus.
|
2238
|
-
* @default false
|
2239
|
-
*/
|
2240
|
-
disableListWrap: PropTypes.bool,
|
2241
|
-
/**
|
2242
|
-
* @ignore
|
2243
|
-
*/
|
2244
|
-
onKeyDown: PropTypes.func,
|
2245
|
-
/**
|
2246
|
-
* The variant to use. Use `menu` to prevent selected items from impacting the initial focus
|
2247
|
-
* and the vertical alignment relative to the anchor element.
|
2248
|
-
* @default 'selectedMenu'
|
2249
|
-
*/
|
2250
|
-
variant: PropTypes.oneOf(["menu", "selectedMenu"])
|
2251
|
-
} : void 0;
|
2252
|
-
function getPopoverUtilityClass(slot) {
|
2253
|
-
return generateUtilityClass("MuiPopover", slot);
|
2254
|
-
}
|
2255
|
-
generateUtilityClasses("MuiPopover", ["root", "paper"]);
|
2256
|
-
const _excluded$6 = ["onEntering"], _excluded2$2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps", "disableScrollLock"], _excluded3 = ["slotProps"];
|
2257
|
-
function getOffsetTop(rect, vertical) {
|
2258
|
-
let offset = 0;
|
2259
|
-
if (typeof vertical === "number") {
|
2260
|
-
offset = vertical;
|
2261
|
-
} else if (vertical === "center") {
|
2262
|
-
offset = rect.height / 2;
|
2263
|
-
} else if (vertical === "bottom") {
|
2264
|
-
offset = rect.height;
|
2265
|
-
}
|
2266
|
-
return offset;
|
2267
|
-
}
|
2268
|
-
function getOffsetLeft(rect, horizontal) {
|
2269
|
-
let offset = 0;
|
2270
|
-
if (typeof horizontal === "number") {
|
2271
|
-
offset = horizontal;
|
2272
|
-
} else if (horizontal === "center") {
|
2273
|
-
offset = rect.width / 2;
|
2274
|
-
} else if (horizontal === "right") {
|
2275
|
-
offset = rect.width;
|
2276
|
-
}
|
2277
|
-
return offset;
|
2278
|
-
}
|
2279
|
-
function getTransformOriginValue(transformOrigin) {
|
2280
|
-
return [transformOrigin.horizontal, transformOrigin.vertical].map((n) => typeof n === "number" ? `${n}px` : n).join(" ");
|
2281
|
-
}
|
2282
|
-
function resolveAnchorEl(anchorEl) {
|
2283
|
-
return typeof anchorEl === "function" ? anchorEl() : anchorEl;
|
2284
|
-
}
|
2285
|
-
const useUtilityClasses$5 = (ownerState) => {
|
2286
|
-
const {
|
2287
|
-
classes
|
2288
|
-
} = ownerState;
|
2289
|
-
const slots = {
|
2290
|
-
root: ["root"],
|
2291
|
-
paper: ["paper"]
|
2292
|
-
};
|
2293
|
-
return composeClasses(slots, getPopoverUtilityClass, classes);
|
2294
|
-
};
|
2295
|
-
const PopoverRoot = styled(Modal, {
|
2296
|
-
name: "MuiPopover",
|
2297
|
-
slot: "Root",
|
2298
|
-
overridesResolver: (props, styles2) => styles2.root
|
2299
|
-
})({});
|
2300
|
-
const PopoverPaper = styled(Paper, {
|
2301
|
-
name: "MuiPopover",
|
2302
|
-
slot: "Paper",
|
2303
|
-
overridesResolver: (props, styles2) => styles2.paper
|
2304
|
-
})({
|
2305
|
-
position: "absolute",
|
2306
|
-
overflowY: "auto",
|
2307
|
-
overflowX: "hidden",
|
2308
|
-
// So we see the popover when it's empty.
|
2309
|
-
// It's most likely on issue on userland.
|
2310
|
-
minWidth: 16,
|
2311
|
-
minHeight: 16,
|
2312
|
-
maxWidth: "calc(100% - 32px)",
|
2313
|
-
maxHeight: "calc(100% - 32px)",
|
2314
|
-
// We disable the focus ring for mouse, touch and keyboard users.
|
2315
|
-
outline: 0
|
2316
|
-
});
|
2317
|
-
const Popover = /* @__PURE__ */ React.forwardRef(function Popover2(inProps, ref) {
|
2318
|
-
var _slotProps$paper, _slots$root, _slots$paper;
|
2319
|
-
const props = useDefaultProps({
|
2320
|
-
props: inProps,
|
2321
|
-
name: "MuiPopover"
|
2322
|
-
});
|
2323
|
-
const {
|
2324
|
-
action,
|
2325
|
-
anchorEl,
|
2326
|
-
anchorOrigin = {
|
2327
|
-
vertical: "top",
|
2328
|
-
horizontal: "left"
|
2329
|
-
},
|
2330
|
-
anchorPosition,
|
2331
|
-
anchorReference = "anchorEl",
|
2332
|
-
children,
|
2333
|
-
className,
|
2334
|
-
container: containerProp,
|
2335
|
-
elevation = 8,
|
2336
|
-
marginThreshold = 16,
|
2337
|
-
open,
|
2338
|
-
PaperProps: PaperPropsProp = {},
|
2339
|
-
slots,
|
2340
|
-
slotProps,
|
2341
|
-
transformOrigin = {
|
2342
|
-
vertical: "top",
|
2343
|
-
horizontal: "left"
|
2344
|
-
},
|
2345
|
-
TransitionComponent = Grow,
|
2346
|
-
transitionDuration: transitionDurationProp = "auto",
|
2347
|
-
TransitionProps: {
|
2348
|
-
onEntering
|
2349
|
-
} = {},
|
2350
|
-
disableScrollLock = false
|
2351
|
-
} = props, TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$6), other = _objectWithoutPropertiesLoose(props, _excluded2$2);
|
2352
|
-
const externalPaperSlotProps = (_slotProps$paper = slotProps == null ? void 0 : slotProps.paper) != null ? _slotProps$paper : PaperPropsProp;
|
2353
|
-
const paperRef = React.useRef();
|
2354
|
-
const handlePaperRef = useForkRef(paperRef, externalPaperSlotProps.ref);
|
2355
|
-
const ownerState = _extends({}, props, {
|
2356
|
-
anchorOrigin,
|
2357
|
-
anchorReference,
|
2358
|
-
elevation,
|
2359
|
-
marginThreshold,
|
2360
|
-
externalPaperSlotProps,
|
2361
|
-
transformOrigin,
|
2362
|
-
TransitionComponent,
|
2363
|
-
transitionDuration: transitionDurationProp,
|
2364
|
-
TransitionProps
|
2365
|
-
});
|
2366
|
-
const classes = useUtilityClasses$5(ownerState);
|
2367
|
-
const getAnchorOffset = React.useCallback(() => {
|
2368
|
-
if (anchorReference === "anchorPosition") {
|
2369
|
-
if (process$1.env.NODE_ENV !== "production") {
|
2370
|
-
if (!anchorPosition) {
|
2371
|
-
}
|
2372
|
-
}
|
2373
|
-
return anchorPosition;
|
2374
|
-
}
|
2375
|
-
const resolvedAnchorEl = resolveAnchorEl(anchorEl);
|
2376
|
-
const anchorElement = resolvedAnchorEl && resolvedAnchorEl.nodeType === 1 ? resolvedAnchorEl : ownerDocument(paperRef.current).body;
|
2377
|
-
const anchorRect = anchorElement.getBoundingClientRect();
|
2378
|
-
if (process$1.env.NODE_ENV !== "production") {
|
2379
|
-
const box = anchorElement.getBoundingClientRect();
|
2380
|
-
if (process$1.env.NODE_ENV !== "test" && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
|
2381
|
-
}
|
2382
|
-
}
|
2383
|
-
return {
|
2384
|
-
top: anchorRect.top + getOffsetTop(anchorRect, anchorOrigin.vertical),
|
2385
|
-
left: anchorRect.left + getOffsetLeft(anchorRect, anchorOrigin.horizontal)
|
2386
|
-
};
|
2387
|
-
}, [anchorEl, anchorOrigin.horizontal, anchorOrigin.vertical, anchorPosition, anchorReference]);
|
2388
|
-
const getTransformOrigin = React.useCallback((elemRect) => {
|
2389
|
-
return {
|
2390
|
-
vertical: getOffsetTop(elemRect, transformOrigin.vertical),
|
2391
|
-
horizontal: getOffsetLeft(elemRect, transformOrigin.horizontal)
|
2392
|
-
};
|
2393
|
-
}, [transformOrigin.horizontal, transformOrigin.vertical]);
|
2394
|
-
const getPositioningStyle = React.useCallback((element) => {
|
2395
|
-
const elemRect = {
|
2396
|
-
width: element.offsetWidth,
|
2397
|
-
height: element.offsetHeight
|
2398
|
-
};
|
2399
|
-
const elemTransformOrigin = getTransformOrigin(elemRect);
|
2400
|
-
if (anchorReference === "none") {
|
2401
|
-
return {
|
2402
|
-
top: null,
|
2403
|
-
left: null,
|
2404
|
-
transformOrigin: getTransformOriginValue(elemTransformOrigin)
|
2405
|
-
};
|
2406
|
-
}
|
2407
|
-
const anchorOffset = getAnchorOffset();
|
2408
|
-
let top = anchorOffset.top - elemTransformOrigin.vertical;
|
2409
|
-
let left = anchorOffset.left - elemTransformOrigin.horizontal;
|
2410
|
-
const bottom = top + elemRect.height;
|
2411
|
-
const right = left + elemRect.width;
|
2412
|
-
const containerWindow = ownerWindow(resolveAnchorEl(anchorEl));
|
2413
|
-
const heightThreshold = containerWindow.innerHeight - marginThreshold;
|
2414
|
-
const widthThreshold = containerWindow.innerWidth - marginThreshold;
|
2415
|
-
if (marginThreshold !== null && top < marginThreshold) {
|
2416
|
-
const diff = top - marginThreshold;
|
2417
|
-
top -= diff;
|
2418
|
-
elemTransformOrigin.vertical += diff;
|
2419
|
-
} else if (marginThreshold !== null && bottom > heightThreshold) {
|
2420
|
-
const diff = bottom - heightThreshold;
|
2421
|
-
top -= diff;
|
2422
|
-
elemTransformOrigin.vertical += diff;
|
2423
|
-
}
|
2424
|
-
if (process$1.env.NODE_ENV !== "production") {
|
2425
|
-
if (elemRect.height > heightThreshold && elemRect.height && heightThreshold) {
|
2426
|
-
}
|
2427
|
-
}
|
2428
|
-
if (marginThreshold !== null && left < marginThreshold) {
|
2429
|
-
const diff = left - marginThreshold;
|
2430
|
-
left -= diff;
|
2431
|
-
elemTransformOrigin.horizontal += diff;
|
2432
|
-
} else if (right > widthThreshold) {
|
2433
|
-
const diff = right - widthThreshold;
|
2434
|
-
left -= diff;
|
2435
|
-
elemTransformOrigin.horizontal += diff;
|
2436
|
-
}
|
2437
|
-
return {
|
2438
|
-
top: `${Math.round(top)}px`,
|
2439
|
-
left: `${Math.round(left)}px`,
|
2440
|
-
transformOrigin: getTransformOriginValue(elemTransformOrigin)
|
2441
|
-
};
|
2442
|
-
}, [anchorEl, anchorReference, getAnchorOffset, getTransformOrigin, marginThreshold]);
|
2443
|
-
const [isPositioned, setIsPositioned] = React.useState(open);
|
2444
|
-
const setPositioningStyles = React.useCallback(() => {
|
2445
|
-
const element = paperRef.current;
|
2446
|
-
if (!element) {
|
2447
|
-
return;
|
2448
|
-
}
|
2449
|
-
const positioning = getPositioningStyle(element);
|
2450
|
-
if (positioning.top !== null) {
|
2451
|
-
element.style.top = positioning.top;
|
2452
|
-
}
|
2453
|
-
if (positioning.left !== null) {
|
2454
|
-
element.style.left = positioning.left;
|
2455
|
-
}
|
2456
|
-
element.style.transformOrigin = positioning.transformOrigin;
|
2457
|
-
setIsPositioned(true);
|
2458
|
-
}, [getPositioningStyle]);
|
2459
|
-
React.useEffect(() => {
|
2460
|
-
if (disableScrollLock) {
|
2461
|
-
window.addEventListener("scroll", setPositioningStyles);
|
2462
|
-
}
|
2463
|
-
return () => window.removeEventListener("scroll", setPositioningStyles);
|
2464
|
-
}, [anchorEl, disableScrollLock, setPositioningStyles]);
|
2465
|
-
const handleEntering = (element, isAppearing) => {
|
2466
|
-
if (onEntering) {
|
2467
|
-
onEntering(element, isAppearing);
|
2468
|
-
}
|
2469
|
-
setPositioningStyles();
|
2470
|
-
};
|
2471
|
-
const handleExited = () => {
|
2472
|
-
setIsPositioned(false);
|
2473
|
-
};
|
2474
|
-
React.useEffect(() => {
|
2475
|
-
if (open) {
|
2476
|
-
setPositioningStyles();
|
2477
|
-
}
|
2478
|
-
});
|
2479
|
-
React.useImperativeHandle(action, () => open ? {
|
2480
|
-
updatePosition: () => {
|
2481
|
-
setPositioningStyles();
|
2482
|
-
}
|
2483
|
-
} : null, [open, setPositioningStyles]);
|
2484
|
-
React.useEffect(() => {
|
2485
|
-
if (!open) {
|
2486
|
-
return void 0;
|
2487
|
-
}
|
2488
|
-
const handleResize = debounce(() => {
|
2489
|
-
setPositioningStyles();
|
2490
|
-
});
|
2491
|
-
const containerWindow = ownerWindow(anchorEl);
|
2492
|
-
containerWindow.addEventListener("resize", handleResize);
|
2493
|
-
return () => {
|
2494
|
-
handleResize.clear();
|
2495
|
-
containerWindow.removeEventListener("resize", handleResize);
|
2496
|
-
};
|
2497
|
-
}, [anchorEl, open, setPositioningStyles]);
|
2498
|
-
let transitionDuration = transitionDurationProp;
|
2499
|
-
if (transitionDurationProp === "auto" && !TransitionComponent.muiSupportAuto) {
|
2500
|
-
transitionDuration = void 0;
|
2501
|
-
}
|
2502
|
-
const container = containerProp || (anchorEl ? ownerDocument(resolveAnchorEl(anchorEl)).body : void 0);
|
2503
|
-
const RootSlot = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : PopoverRoot;
|
2504
|
-
const PaperSlot = (_slots$paper = slots == null ? void 0 : slots.paper) != null ? _slots$paper : PopoverPaper;
|
2505
|
-
const paperProps = useSlotProps({
|
2506
|
-
elementType: PaperSlot,
|
2507
|
-
externalSlotProps: _extends({}, externalPaperSlotProps, {
|
2508
|
-
style: isPositioned ? externalPaperSlotProps.style : _extends({}, externalPaperSlotProps.style, {
|
2509
|
-
opacity: 0
|
2510
|
-
})
|
2511
|
-
}),
|
2512
|
-
additionalProps: {
|
2513
|
-
elevation,
|
2514
|
-
ref: handlePaperRef
|
2515
|
-
},
|
2516
|
-
ownerState,
|
2517
|
-
className: clsx(classes.paper, externalPaperSlotProps == null ? void 0 : externalPaperSlotProps.className)
|
2518
|
-
});
|
2519
|
-
const _useSlotProps = useSlotProps({
|
2520
|
-
elementType: RootSlot,
|
2521
|
-
externalSlotProps: (slotProps == null ? void 0 : slotProps.root) || {},
|
2522
|
-
externalForwardedProps: other,
|
2523
|
-
additionalProps: {
|
2524
|
-
ref,
|
2525
|
-
slotProps: {
|
2526
|
-
backdrop: {
|
2527
|
-
invisible: true
|
2528
|
-
}
|
2529
|
-
},
|
2530
|
-
container,
|
2531
|
-
open
|
2532
|
-
},
|
2533
|
-
ownerState,
|
2534
|
-
className: clsx(classes.root, className)
|
2535
|
-
}), {
|
2536
|
-
slotProps: rootSlotPropsProp
|
2537
|
-
} = _useSlotProps, rootProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded3);
|
2538
|
-
return /* @__PURE__ */ jsx(RootSlot, _extends({}, rootProps, !isHostComponent(RootSlot) && {
|
2539
|
-
slotProps: rootSlotPropsProp,
|
2540
|
-
disableScrollLock
|
2541
|
-
}, {
|
2542
|
-
children: /* @__PURE__ */ jsx(TransitionComponent, _extends({
|
2543
|
-
appear: true,
|
2544
|
-
in: open,
|
2545
|
-
onEntering: handleEntering,
|
2546
|
-
onExited: handleExited,
|
2547
|
-
timeout: transitionDuration
|
2548
|
-
}, TransitionProps, {
|
2549
|
-
children: /* @__PURE__ */ jsx(PaperSlot, _extends({}, paperProps, {
|
2550
|
-
children
|
2551
|
-
}))
|
2552
|
-
}))
|
2553
|
-
}));
|
2554
|
-
});
|
2555
|
-
process$1.env.NODE_ENV !== "production" ? Popover.propTypes = {
|
2556
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
2557
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
2558
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
2559
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
2560
|
-
/**
|
2561
|
-
* A ref for imperative actions.
|
2562
|
-
* It currently only supports updatePosition() action.
|
2563
|
-
*/
|
2564
|
-
action: refType,
|
2565
|
-
/**
|
2566
|
-
* An HTML element, [PopoverVirtualElement](/material-ui/react-popover/#virtual-element),
|
2567
|
-
* or a function that returns either.
|
2568
|
-
* It's used to set the position of the popover.
|
2569
|
-
*/
|
2570
|
-
anchorEl: chainPropTypes(PropTypes.oneOfType([HTMLElementType, PropTypes.func]), (props) => {
|
2571
|
-
if (props.open && (!props.anchorReference || props.anchorReference === "anchorEl")) {
|
2572
|
-
const resolvedAnchorEl = resolveAnchorEl(props.anchorEl);
|
2573
|
-
if (resolvedAnchorEl && resolvedAnchorEl.nodeType === 1) {
|
2574
|
-
const box = resolvedAnchorEl.getBoundingClientRect();
|
2575
|
-
if (process$1.env.NODE_ENV !== "test" && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
|
2576
|
-
return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", "The anchor element should be part of the document layout.", "Make sure the element is present in the document or that it's not display none."].join("\n"));
|
2577
|
-
}
|
2578
|
-
} else {
|
2579
|
-
return new Error(["MUI: The `anchorEl` prop provided to the component is invalid.", `It should be an Element or PopoverVirtualElement instance but it's \`${resolvedAnchorEl}\` instead.`].join("\n"));
|
2580
|
-
}
|
2581
|
-
}
|
2582
|
-
return null;
|
2583
|
-
}),
|
2584
|
-
/**
|
2585
|
-
* This is the point on the anchor where the popover's
|
2586
|
-
* `anchorEl` will attach to. This is not used when the
|
2587
|
-
* anchorReference is 'anchorPosition'.
|
2588
|
-
*
|
2589
|
-
* Options:
|
2590
|
-
* vertical: [top, center, bottom];
|
2591
|
-
* horizontal: [left, center, right].
|
2592
|
-
* @default {
|
2593
|
-
* vertical: 'top',
|
2594
|
-
* horizontal: 'left',
|
2595
|
-
* }
|
2596
|
-
*/
|
2597
|
-
anchorOrigin: PropTypes.shape({
|
2598
|
-
horizontal: PropTypes.oneOfType([PropTypes.oneOf(["center", "left", "right"]), PropTypes.number]).isRequired,
|
2599
|
-
vertical: PropTypes.oneOfType([PropTypes.oneOf(["bottom", "center", "top"]), PropTypes.number]).isRequired
|
2600
|
-
}),
|
2601
|
-
/**
|
2602
|
-
* This is the position that may be used to set the position of the popover.
|
2603
|
-
* The coordinates are relative to the application's client area.
|
2604
|
-
*/
|
2605
|
-
anchorPosition: PropTypes.shape({
|
2606
|
-
left: PropTypes.number.isRequired,
|
2607
|
-
top: PropTypes.number.isRequired
|
2608
|
-
}),
|
2609
|
-
/**
|
2610
|
-
* This determines which anchor prop to refer to when setting
|
2611
|
-
* the position of the popover.
|
2612
|
-
* @default 'anchorEl'
|
2613
|
-
*/
|
2614
|
-
anchorReference: PropTypes.oneOf(["anchorEl", "anchorPosition", "none"]),
|
2615
|
-
/**
|
2616
|
-
* The content of the component.
|
2617
|
-
*/
|
2618
|
-
children: PropTypes.node,
|
2619
|
-
/**
|
2620
|
-
* Override or extend the styles applied to the component.
|
2621
|
-
*/
|
2622
|
-
classes: PropTypes.object,
|
2623
|
-
/**
|
2624
|
-
* @ignore
|
2625
|
-
*/
|
2626
|
-
className: PropTypes.string,
|
2627
|
-
/**
|
2628
|
-
* An HTML element, component instance, or function that returns either.
|
2629
|
-
* The `container` will passed to the Modal component.
|
2630
|
-
*
|
2631
|
-
* By default, it uses the body of the anchorEl's top-level document object,
|
2632
|
-
* so it's simply `document.body` most of the time.
|
2633
|
-
*/
|
2634
|
-
container: PropTypes.oneOfType([HTMLElementType, PropTypes.func]),
|
2635
|
-
/**
|
2636
|
-
* Disable the scroll lock behavior.
|
2637
|
-
* @default false
|
2638
|
-
*/
|
2639
|
-
disableScrollLock: PropTypes.bool,
|
2640
|
-
/**
|
2641
|
-
* The elevation of the popover.
|
2642
|
-
* @default 8
|
2643
|
-
*/
|
2644
|
-
elevation: integerPropType,
|
2645
|
-
/**
|
2646
|
-
* Specifies how close to the edge of the window the popover can appear.
|
2647
|
-
* If null, the popover will not be constrained by the window.
|
2648
|
-
* @default 16
|
2649
|
-
*/
|
2650
|
-
marginThreshold: PropTypes.number,
|
2651
|
-
/**
|
2652
|
-
* Callback fired when the component requests to be closed.
|
2653
|
-
* The `reason` parameter can optionally be used to control the response to `onClose`.
|
2654
|
-
*/
|
2655
|
-
onClose: PropTypes.func,
|
2656
|
-
/**
|
2657
|
-
* If `true`, the component is shown.
|
2658
|
-
*/
|
2659
|
-
open: PropTypes.bool.isRequired,
|
2660
|
-
/**
|
2661
|
-
* Props applied to the [`Paper`](/material-ui/api/paper/) element.
|
2662
|
-
*
|
2663
|
-
* This prop is an alias for `slotProps.paper` and will be overriden by it if both are used.
|
2664
|
-
* @deprecated Use `slotProps.paper` instead.
|
2665
|
-
*
|
2666
|
-
* @default {}
|
2667
|
-
*/
|
2668
|
-
PaperProps: PropTypes.shape({
|
2669
|
-
component: elementTypeAcceptingRef
|
2670
|
-
}),
|
2671
|
-
/**
|
2672
|
-
* The extra props for the slot components.
|
2673
|
-
* You can override the existing props or add new ones.
|
2674
|
-
*
|
2675
|
-
* @default {}
|
2676
|
-
*/
|
2677
|
-
slotProps: PropTypes.shape({
|
2678
|
-
paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
2679
|
-
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
2680
|
-
}),
|
2681
|
-
/**
|
2682
|
-
* The components used for each slot inside.
|
2683
|
-
*
|
2684
|
-
* @default {}
|
2685
|
-
*/
|
2686
|
-
slots: PropTypes.shape({
|
2687
|
-
paper: PropTypes.elementType,
|
2688
|
-
root: PropTypes.elementType
|
2689
|
-
}),
|
2690
|
-
/**
|
2691
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
2692
|
-
*/
|
2693
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
2694
|
-
/**
|
2695
|
-
* This is the point on the popover which
|
2696
|
-
* will attach to the anchor's origin.
|
2697
|
-
*
|
2698
|
-
* Options:
|
2699
|
-
* vertical: [top, center, bottom, x(px)];
|
2700
|
-
* horizontal: [left, center, right, x(px)].
|
2701
|
-
* @default {
|
2702
|
-
* vertical: 'top',
|
2703
|
-
* horizontal: 'left',
|
2704
|
-
* }
|
2705
|
-
*/
|
2706
|
-
transformOrigin: PropTypes.shape({
|
2707
|
-
horizontal: PropTypes.oneOfType([PropTypes.oneOf(["center", "left", "right"]), PropTypes.number]).isRequired,
|
2708
|
-
vertical: PropTypes.oneOfType([PropTypes.oneOf(["bottom", "center", "top"]), PropTypes.number]).isRequired
|
2709
|
-
}),
|
2710
|
-
/**
|
2711
|
-
* The component used for the transition.
|
2712
|
-
* [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
2713
|
-
* @default Grow
|
2714
|
-
*/
|
2715
|
-
TransitionComponent: PropTypes.elementType,
|
2716
|
-
/**
|
2717
|
-
* Set to 'auto' to automatically calculate transition time based on height.
|
2718
|
-
* @default 'auto'
|
2719
|
-
*/
|
2720
|
-
transitionDuration: PropTypes.oneOfType([PropTypes.oneOf(["auto"]), PropTypes.number, PropTypes.shape({
|
2721
|
-
appear: PropTypes.number,
|
2722
|
-
enter: PropTypes.number,
|
2723
|
-
exit: PropTypes.number
|
2724
|
-
})]),
|
2725
|
-
/**
|
2726
|
-
* Props applied to the transition element.
|
2727
|
-
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
2728
|
-
* @default {}
|
2729
|
-
*/
|
2730
|
-
TransitionProps: PropTypes.object
|
2731
|
-
} : void 0;
|
2732
|
-
function getMenuUtilityClass(slot) {
|
2733
|
-
return generateUtilityClass("MuiMenu", slot);
|
2734
|
-
}
|
2735
|
-
generateUtilityClasses("MuiMenu", ["root", "paper", "list"]);
|
2736
|
-
const _excluded$5 = ["onEntering"], _excluded2$1 = ["autoFocus", "children", "className", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant", "slots", "slotProps"];
|
2737
|
-
const RTL_ORIGIN = {
|
2738
|
-
vertical: "top",
|
2739
|
-
horizontal: "right"
|
2740
|
-
};
|
2741
|
-
const LTR_ORIGIN = {
|
2742
|
-
vertical: "top",
|
2743
|
-
horizontal: "left"
|
2744
|
-
};
|
2745
|
-
const useUtilityClasses$4 = (ownerState) => {
|
2746
|
-
const {
|
2747
|
-
classes
|
2748
|
-
} = ownerState;
|
2749
|
-
const slots = {
|
2750
|
-
root: ["root"],
|
2751
|
-
paper: ["paper"],
|
2752
|
-
list: ["list"]
|
2753
|
-
};
|
2754
|
-
return composeClasses(slots, getMenuUtilityClass, classes);
|
2755
|
-
};
|
2756
|
-
const MenuRoot = styled(Popover, {
|
2757
|
-
shouldForwardProp: (prop) => rootShouldForwardProp(prop) || prop === "classes",
|
2758
|
-
name: "MuiMenu",
|
2759
|
-
slot: "Root",
|
2760
|
-
overridesResolver: (props, styles2) => styles2.root
|
2761
|
-
})({});
|
2762
|
-
const MenuPaper = styled(PopoverPaper, {
|
2763
|
-
name: "MuiMenu",
|
2764
|
-
slot: "Paper",
|
2765
|
-
overridesResolver: (props, styles2) => styles2.paper
|
2766
|
-
})({
|
2767
|
-
// specZ: The maximum height of a simple menu should be one or more rows less than the view
|
2768
|
-
// height. This ensures a tappable area outside of the simple menu with which to dismiss
|
2769
|
-
// the menu.
|
2770
|
-
maxHeight: "calc(100% - 96px)",
|
2771
|
-
// Add iOS momentum scrolling for iOS < 13.0
|
2772
|
-
WebkitOverflowScrolling: "touch"
|
2773
|
-
});
|
2774
|
-
const MenuMenuList = styled(MenuList, {
|
2775
|
-
name: "MuiMenu",
|
2776
|
-
slot: "List",
|
2777
|
-
overridesResolver: (props, styles2) => styles2.list
|
2778
|
-
})({
|
2779
|
-
// We disable the focus ring for mouse, touch and keyboard users.
|
2780
|
-
outline: 0
|
2781
|
-
});
|
2782
|
-
const Menu = /* @__PURE__ */ React.forwardRef(function Menu2(inProps, ref) {
|
2783
|
-
var _slots$paper, _slotProps$paper;
|
2784
|
-
const props = useDefaultProps({
|
2785
|
-
props: inProps,
|
2786
|
-
name: "MuiMenu"
|
2787
|
-
});
|
2788
|
-
const {
|
2789
|
-
autoFocus = true,
|
2790
|
-
children,
|
2791
|
-
className,
|
2792
|
-
disableAutoFocusItem = false,
|
2793
|
-
MenuListProps = {},
|
2794
|
-
onClose,
|
2795
|
-
open,
|
2796
|
-
PaperProps = {},
|
2797
|
-
PopoverClasses,
|
2798
|
-
transitionDuration = "auto",
|
2799
|
-
TransitionProps: {
|
2800
|
-
onEntering
|
2801
|
-
} = {},
|
2802
|
-
variant = "selectedMenu",
|
2803
|
-
slots = {},
|
2804
|
-
slotProps = {}
|
2805
|
-
} = props, TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded$5), other = _objectWithoutPropertiesLoose(props, _excluded2$1);
|
2806
|
-
const isRtl = useRtl();
|
2807
|
-
const ownerState = _extends({}, props, {
|
2808
|
-
autoFocus,
|
2809
|
-
disableAutoFocusItem,
|
2810
|
-
MenuListProps,
|
2811
|
-
onEntering,
|
2812
|
-
PaperProps,
|
2813
|
-
transitionDuration,
|
2814
|
-
TransitionProps,
|
2815
|
-
variant
|
2816
|
-
});
|
2817
|
-
const classes = useUtilityClasses$4(ownerState);
|
2818
|
-
const autoFocusItem = autoFocus && !disableAutoFocusItem && open;
|
2819
|
-
const menuListActionsRef = React.useRef(null);
|
2820
|
-
const handleEntering = (element, isAppearing) => {
|
2821
|
-
if (menuListActionsRef.current) {
|
2822
|
-
menuListActionsRef.current.adjustStyleForScrollbar(element, {
|
2823
|
-
direction: isRtl ? "rtl" : "ltr"
|
2824
|
-
});
|
2825
|
-
}
|
2826
|
-
if (onEntering) {
|
2827
|
-
onEntering(element, isAppearing);
|
2828
|
-
}
|
2829
|
-
};
|
2830
|
-
const handleListKeyDown = (event) => {
|
2831
|
-
if (event.key === "Tab") {
|
2832
|
-
event.preventDefault();
|
2833
|
-
if (onClose) {
|
2834
|
-
onClose(event, "tabKeyDown");
|
2835
|
-
}
|
2836
|
-
}
|
2837
|
-
};
|
2838
|
-
let activeItemIndex = -1;
|
2839
|
-
React.Children.map(children, (child, index) => {
|
2840
|
-
if (!/* @__PURE__ */ React.isValidElement(child)) {
|
2841
|
-
return;
|
2842
|
-
}
|
2843
|
-
if (process$1.env.NODE_ENV !== "production") {
|
2844
|
-
if (reactIsExports.isFragment(child)) {
|
2845
|
-
}
|
2846
|
-
}
|
2847
|
-
if (!child.props.disabled) {
|
2848
|
-
if (variant === "selectedMenu" && child.props.selected) {
|
2849
|
-
activeItemIndex = index;
|
2850
|
-
} else if (activeItemIndex === -1) {
|
2851
|
-
activeItemIndex = index;
|
2852
|
-
}
|
2853
|
-
}
|
2854
|
-
});
|
2855
|
-
const PaperSlot = (_slots$paper = slots.paper) != null ? _slots$paper : MenuPaper;
|
2856
|
-
const paperExternalSlotProps = (_slotProps$paper = slotProps.paper) != null ? _slotProps$paper : PaperProps;
|
2857
|
-
const rootSlotProps = useSlotProps({
|
2858
|
-
elementType: slots.root,
|
2859
|
-
externalSlotProps: slotProps.root,
|
2860
|
-
ownerState,
|
2861
|
-
className: [classes.root, className]
|
2862
|
-
});
|
2863
|
-
const paperSlotProps = useSlotProps({
|
2864
|
-
elementType: PaperSlot,
|
2865
|
-
externalSlotProps: paperExternalSlotProps,
|
2866
|
-
ownerState,
|
2867
|
-
className: classes.paper
|
2868
|
-
});
|
2869
|
-
return /* @__PURE__ */ jsx(MenuRoot, _extends({
|
2870
|
-
onClose,
|
2871
|
-
anchorOrigin: {
|
2872
|
-
vertical: "bottom",
|
2873
|
-
horizontal: isRtl ? "right" : "left"
|
2874
|
-
},
|
2875
|
-
transformOrigin: isRtl ? RTL_ORIGIN : LTR_ORIGIN,
|
2876
|
-
slots: {
|
2877
|
-
paper: PaperSlot,
|
2878
|
-
root: slots.root
|
2879
|
-
},
|
2880
|
-
slotProps: {
|
2881
|
-
root: rootSlotProps,
|
2882
|
-
paper: paperSlotProps
|
2883
|
-
},
|
2884
|
-
open,
|
2885
|
-
ref,
|
2886
|
-
transitionDuration,
|
2887
|
-
TransitionProps: _extends({
|
2888
|
-
onEntering: handleEntering
|
2889
|
-
}, TransitionProps),
|
2890
|
-
ownerState
|
2891
|
-
}, other, {
|
2892
|
-
classes: PopoverClasses,
|
2893
|
-
children: /* @__PURE__ */ jsx(MenuMenuList, _extends({
|
2894
|
-
onKeyDown: handleListKeyDown,
|
2895
|
-
actions: menuListActionsRef,
|
2896
|
-
autoFocus: autoFocus && (activeItemIndex === -1 || disableAutoFocusItem),
|
2897
|
-
autoFocusItem,
|
2898
|
-
variant
|
2899
|
-
}, MenuListProps, {
|
2900
|
-
className: clsx(classes.list, MenuListProps.className),
|
2901
|
-
children
|
2902
|
-
}))
|
2903
|
-
}));
|
2904
|
-
});
|
2905
|
-
process$1.env.NODE_ENV !== "production" ? Menu.propTypes = {
|
2906
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
2907
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
2908
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
2909
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
2910
|
-
/**
|
2911
|
-
* An HTML element, or a function that returns one.
|
2912
|
-
* It's used to set the position of the menu.
|
2913
|
-
*/
|
2914
|
-
anchorEl: PropTypes.oneOfType([HTMLElementType, PropTypes.func]),
|
2915
|
-
/**
|
2916
|
-
* If `true` (Default) will focus the `[role="menu"]` if no focusable child is found. Disabled
|
2917
|
-
* children are not focusable. If you set this prop to `false` focus will be placed
|
2918
|
-
* on the parent modal container. This has severe accessibility implications
|
2919
|
-
* and should only be considered if you manage focus otherwise.
|
2920
|
-
* @default true
|
2921
|
-
*/
|
2922
|
-
autoFocus: PropTypes.bool,
|
2923
|
-
/**
|
2924
|
-
* Menu contents, normally `MenuItem`s.
|
2925
|
-
*/
|
2926
|
-
children: PropTypes.node,
|
2927
|
-
/**
|
2928
|
-
* Override or extend the styles applied to the component.
|
2929
|
-
*/
|
2930
|
-
classes: PropTypes.object,
|
2931
|
-
/**
|
2932
|
-
* @ignore
|
2933
|
-
*/
|
2934
|
-
className: PropTypes.string,
|
2935
|
-
/**
|
2936
|
-
* When opening the menu will not focus the active item but the `[role="menu"]`
|
2937
|
-
* unless `autoFocus` is also set to `false`. Not using the default means not
|
2938
|
-
* following WAI-ARIA authoring practices. Please be considerate about possible
|
2939
|
-
* accessibility implications.
|
2940
|
-
* @default false
|
2941
|
-
*/
|
2942
|
-
disableAutoFocusItem: PropTypes.bool,
|
2943
|
-
/**
|
2944
|
-
* Props applied to the [`MenuList`](/material-ui/api/menu-list/) element.
|
2945
|
-
* @default {}
|
2946
|
-
*/
|
2947
|
-
MenuListProps: PropTypes.object,
|
2948
|
-
/**
|
2949
|
-
* Callback fired when the component requests to be closed.
|
2950
|
-
*
|
2951
|
-
* @param {object} event The event source of the callback.
|
2952
|
-
* @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`, `"tabKeyDown"`.
|
2953
|
-
*/
|
2954
|
-
onClose: PropTypes.func,
|
2955
|
-
/**
|
2956
|
-
* If `true`, the component is shown.
|
2957
|
-
*/
|
2958
|
-
open: PropTypes.bool.isRequired,
|
2959
|
-
/**
|
2960
|
-
* @ignore
|
2961
|
-
*/
|
2962
|
-
PaperProps: PropTypes.object,
|
2963
|
-
/**
|
2964
|
-
* `classes` prop applied to the [`Popover`](/material-ui/api/popover/) element.
|
2965
|
-
*/
|
2966
|
-
PopoverClasses: PropTypes.object,
|
2967
|
-
/**
|
2968
|
-
* The extra props for the slot components.
|
2969
|
-
* You can override the existing props or add new ones.
|
2970
|
-
*
|
2971
|
-
* @default {}
|
2972
|
-
*/
|
2973
|
-
slotProps: PropTypes.shape({
|
2974
|
-
paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
2975
|
-
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
2976
|
-
}),
|
2977
|
-
/**
|
2978
|
-
* The components used for each slot inside.
|
2979
|
-
*
|
2980
|
-
* @default {}
|
2981
|
-
*/
|
2982
|
-
slots: PropTypes.shape({
|
2983
|
-
paper: PropTypes.elementType,
|
2984
|
-
root: PropTypes.elementType
|
2985
|
-
}),
|
2986
|
-
/**
|
2987
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
2988
|
-
*/
|
2989
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
2990
|
-
/**
|
2991
|
-
* The length of the transition in `ms`, or 'auto'
|
2992
|
-
* @default 'auto'
|
2993
|
-
*/
|
2994
|
-
transitionDuration: PropTypes.oneOfType([PropTypes.oneOf(["auto"]), PropTypes.number, PropTypes.shape({
|
2995
|
-
appear: PropTypes.number,
|
2996
|
-
enter: PropTypes.number,
|
2997
|
-
exit: PropTypes.number
|
2998
|
-
})]),
|
2999
|
-
/**
|
3000
|
-
* Props applied to the transition element.
|
3001
|
-
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
3002
|
-
* @default {}
|
3003
|
-
*/
|
3004
|
-
TransitionProps: PropTypes.object,
|
3005
|
-
/**
|
3006
|
-
* The variant to use. Use `menu` to prevent selected items from impacting the initial focus.
|
3007
|
-
* @default 'selectedMenu'
|
3008
|
-
*/
|
3009
|
-
variant: PropTypes.oneOf(["menu", "selectedMenu"])
|
3010
|
-
} : void 0;
|
3011
|
-
function getNativeSelectUtilityClasses(slot) {
|
3012
|
-
return generateUtilityClass("MuiNativeSelect", slot);
|
3013
|
-
}
|
3014
|
-
const nativeSelectClasses = generateUtilityClasses("MuiNativeSelect", ["root", "select", "multiple", "filled", "outlined", "standard", "disabled", "icon", "iconOpen", "iconFilled", "iconOutlined", "iconStandard", "nativeInput", "error"]);
|
3015
|
-
const _excluded$4 = ["className", "disabled", "error", "IconComponent", "inputRef", "variant"];
|
3016
|
-
const useUtilityClasses$3 = (ownerState) => {
|
3017
|
-
const {
|
3018
|
-
classes,
|
3019
|
-
variant,
|
3020
|
-
disabled,
|
3021
|
-
multiple,
|
3022
|
-
open,
|
3023
|
-
error
|
3024
|
-
} = ownerState;
|
3025
|
-
const slots = {
|
3026
|
-
select: ["select", variant, disabled && "disabled", multiple && "multiple", error && "error"],
|
3027
|
-
icon: ["icon", `icon${capitalize(variant)}`, open && "iconOpen", disabled && "disabled"]
|
3028
|
-
};
|
3029
|
-
return composeClasses(slots, getNativeSelectUtilityClasses, classes);
|
3030
|
-
};
|
3031
|
-
const nativeSelectSelectStyles = ({
|
3032
|
-
ownerState,
|
3033
|
-
theme
|
3034
|
-
}) => _extends({
|
3035
|
-
MozAppearance: "none",
|
3036
|
-
// Reset
|
3037
|
-
WebkitAppearance: "none",
|
3038
|
-
// Reset
|
3039
|
-
// When interacting quickly, the text can end up selected.
|
3040
|
-
// Native select can't be selected either.
|
3041
|
-
userSelect: "none",
|
3042
|
-
borderRadius: 0,
|
3043
|
-
// Reset
|
3044
|
-
cursor: "pointer",
|
3045
|
-
"&:focus": _extends({}, theme.vars ? {
|
3046
|
-
backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.05)`
|
3047
|
-
} : {
|
3048
|
-
backgroundColor: theme.palette.mode === "light" ? "rgba(0, 0, 0, 0.05)" : "rgba(255, 255, 255, 0.05)"
|
3049
|
-
}, {
|
3050
|
-
borderRadius: 0
|
3051
|
-
// Reset Chrome style
|
3052
|
-
}),
|
3053
|
-
// Remove IE11 arrow
|
3054
|
-
"&::-ms-expand": {
|
3055
|
-
display: "none"
|
3056
|
-
},
|
3057
|
-
[`&.${nativeSelectClasses.disabled}`]: {
|
3058
|
-
cursor: "default"
|
3059
|
-
},
|
3060
|
-
"&[multiple]": {
|
3061
|
-
height: "auto"
|
3062
|
-
},
|
3063
|
-
"&:not([multiple]) option, &:not([multiple]) optgroup": {
|
3064
|
-
backgroundColor: (theme.vars || theme).palette.background.paper
|
3065
|
-
},
|
3066
|
-
// Bump specificity to allow extending custom inputs
|
3067
|
-
"&&&": {
|
3068
|
-
paddingRight: 24,
|
3069
|
-
minWidth: 16
|
3070
|
-
// So it doesn't collapse.
|
3071
|
-
}
|
3072
|
-
}, ownerState.variant === "filled" && {
|
3073
|
-
"&&&": {
|
3074
|
-
paddingRight: 32
|
3075
|
-
}
|
3076
|
-
}, ownerState.variant === "outlined" && {
|
3077
|
-
borderRadius: (theme.vars || theme).shape.borderRadius,
|
3078
|
-
"&:focus": {
|
3079
|
-
borderRadius: (theme.vars || theme).shape.borderRadius
|
3080
|
-
// Reset the reset for Chrome style
|
3081
|
-
},
|
3082
|
-
"&&&": {
|
3083
|
-
paddingRight: 32
|
3084
|
-
}
|
3085
|
-
});
|
3086
|
-
const NativeSelectSelect = styled("select", {
|
3087
|
-
name: "MuiNativeSelect",
|
3088
|
-
slot: "Select",
|
3089
|
-
shouldForwardProp: rootShouldForwardProp,
|
3090
|
-
overridesResolver: (props, styles2) => {
|
3091
|
-
const {
|
3092
|
-
ownerState
|
3093
|
-
} = props;
|
3094
|
-
return [styles2.select, styles2[ownerState.variant], ownerState.error && styles2.error, {
|
3095
|
-
[`&.${nativeSelectClasses.multiple}`]: styles2.multiple
|
3096
|
-
}];
|
3097
|
-
}
|
3098
|
-
})(nativeSelectSelectStyles);
|
3099
|
-
const nativeSelectIconStyles = ({
|
3100
|
-
ownerState,
|
3101
|
-
theme
|
3102
|
-
}) => _extends({
|
3103
|
-
// We use a position absolute over a flexbox in order to forward the pointer events
|
3104
|
-
// to the input and to support wrapping tags..
|
3105
|
-
position: "absolute",
|
3106
|
-
right: 0,
|
3107
|
-
top: "calc(50% - .5em)",
|
3108
|
-
// Center vertically, height is 1em
|
3109
|
-
pointerEvents: "none",
|
3110
|
-
// Don't block pointer events on the select under the icon.
|
3111
|
-
color: (theme.vars || theme).palette.action.active,
|
3112
|
-
[`&.${nativeSelectClasses.disabled}`]: {
|
3113
|
-
color: (theme.vars || theme).palette.action.disabled
|
3114
|
-
}
|
3115
|
-
}, ownerState.open && {
|
3116
|
-
transform: "rotate(180deg)"
|
3117
|
-
}, ownerState.variant === "filled" && {
|
3118
|
-
right: 7
|
3119
|
-
}, ownerState.variant === "outlined" && {
|
3120
|
-
right: 7
|
3121
|
-
});
|
3122
|
-
const NativeSelectIcon = styled("svg", {
|
3123
|
-
name: "MuiNativeSelect",
|
3124
|
-
slot: "Icon",
|
3125
|
-
overridesResolver: (props, styles2) => {
|
3126
|
-
const {
|
3127
|
-
ownerState
|
3128
|
-
} = props;
|
3129
|
-
return [styles2.icon, ownerState.variant && styles2[`icon${capitalize(ownerState.variant)}`], ownerState.open && styles2.iconOpen];
|
3130
|
-
}
|
3131
|
-
})(nativeSelectIconStyles);
|
3132
|
-
const NativeSelectInput = /* @__PURE__ */ React.forwardRef(function NativeSelectInput2(props, ref) {
|
3133
|
-
const {
|
3134
|
-
className,
|
3135
|
-
disabled,
|
3136
|
-
error,
|
3137
|
-
IconComponent,
|
3138
|
-
inputRef,
|
3139
|
-
variant = "standard"
|
3140
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded$4);
|
3141
|
-
const ownerState = _extends({}, props, {
|
3142
|
-
disabled,
|
3143
|
-
variant,
|
3144
|
-
error
|
3145
|
-
});
|
3146
|
-
const classes = useUtilityClasses$3(ownerState);
|
3147
|
-
return /* @__PURE__ */ jsxs(React.Fragment, {
|
3148
|
-
children: [/* @__PURE__ */ jsx(NativeSelectSelect, _extends({
|
3149
|
-
ownerState,
|
3150
|
-
className: clsx(classes.select, className),
|
3151
|
-
disabled,
|
3152
|
-
ref: inputRef || ref
|
3153
|
-
}, other)), props.multiple ? null : /* @__PURE__ */ jsx(NativeSelectIcon, {
|
3154
|
-
as: IconComponent,
|
3155
|
-
ownerState,
|
3156
|
-
className: classes.icon
|
3157
|
-
})]
|
3158
|
-
});
|
3159
|
-
});
|
3160
|
-
process$1.env.NODE_ENV !== "production" ? NativeSelectInput.propTypes = {
|
3161
|
-
/**
|
3162
|
-
* The option elements to populate the select with.
|
3163
|
-
* Can be some `<option>` elements.
|
3164
|
-
*/
|
3165
|
-
children: PropTypes.node,
|
3166
|
-
/**
|
3167
|
-
* Override or extend the styles applied to the component.
|
3168
|
-
*/
|
3169
|
-
classes: PropTypes.object,
|
3170
|
-
/**
|
3171
|
-
* The CSS class name of the select element.
|
3172
|
-
*/
|
3173
|
-
className: PropTypes.string,
|
3174
|
-
/**
|
3175
|
-
* If `true`, the select is disabled.
|
3176
|
-
*/
|
3177
|
-
disabled: PropTypes.bool,
|
3178
|
-
/**
|
3179
|
-
* If `true`, the `select input` will indicate an error.
|
3180
|
-
*/
|
3181
|
-
error: PropTypes.bool,
|
3182
|
-
/**
|
3183
|
-
* The icon that displays the arrow.
|
3184
|
-
*/
|
3185
|
-
IconComponent: PropTypes.elementType.isRequired,
|
3186
|
-
/**
|
3187
|
-
* Use that prop to pass a ref to the native select element.
|
3188
|
-
* @deprecated
|
3189
|
-
*/
|
3190
|
-
inputRef: refType,
|
3191
|
-
/**
|
3192
|
-
* @ignore
|
3193
|
-
*/
|
3194
|
-
multiple: PropTypes.bool,
|
3195
|
-
/**
|
3196
|
-
* Name attribute of the `select` or hidden `input` element.
|
3197
|
-
*/
|
3198
|
-
name: PropTypes.string,
|
3199
|
-
/**
|
3200
|
-
* Callback fired when a menu item is selected.
|
3201
|
-
*
|
3202
|
-
* @param {object} event The event source of the callback.
|
3203
|
-
* You can pull out the new value by accessing `event.target.value` (string).
|
3204
|
-
*/
|
3205
|
-
onChange: PropTypes.func,
|
3206
|
-
/**
|
3207
|
-
* The input value.
|
3208
|
-
*/
|
3209
|
-
value: PropTypes.any,
|
3210
|
-
/**
|
3211
|
-
* The variant to use.
|
3212
|
-
*/
|
3213
|
-
variant: PropTypes.oneOf(["standard", "outlined", "filled"])
|
3214
|
-
} : void 0;
|
3215
|
-
var _span$1;
|
3216
|
-
const _excluded$3 = ["children", "classes", "className", "label", "notched"];
|
3217
|
-
const NotchedOutlineRoot$1 = styled("fieldset", {
|
3218
|
-
shouldForwardProp: rootShouldForwardProp
|
3219
|
-
})({
|
3220
|
-
textAlign: "left",
|
3221
|
-
position: "absolute",
|
3222
|
-
bottom: 0,
|
3223
|
-
right: 0,
|
3224
|
-
top: -5,
|
3225
|
-
left: 0,
|
3226
|
-
margin: 0,
|
3227
|
-
padding: "0 8px",
|
3228
|
-
pointerEvents: "none",
|
3229
|
-
borderRadius: "inherit",
|
3230
|
-
borderStyle: "solid",
|
3231
|
-
borderWidth: 1,
|
3232
|
-
overflow: "hidden",
|
3233
|
-
minWidth: "0%"
|
3234
|
-
});
|
3235
|
-
const NotchedOutlineLegend = styled("legend", {
|
3236
|
-
shouldForwardProp: rootShouldForwardProp
|
3237
|
-
})(({
|
3238
|
-
ownerState,
|
3239
|
-
theme
|
3240
|
-
}) => _extends({
|
3241
|
-
float: "unset",
|
3242
|
-
// Fix conflict with bootstrap
|
3243
|
-
width: "auto",
|
3244
|
-
// Fix conflict with bootstrap
|
3245
|
-
overflow: "hidden"
|
3246
|
-
}, !ownerState.withLabel && {
|
3247
|
-
padding: 0,
|
3248
|
-
lineHeight: "11px",
|
3249
|
-
// sync with `height` in `legend` styles
|
3250
|
-
transition: theme.transitions.create("width", {
|
3251
|
-
duration: 150,
|
3252
|
-
easing: theme.transitions.easing.easeOut
|
3253
|
-
})
|
3254
|
-
}, ownerState.withLabel && _extends({
|
3255
|
-
display: "block",
|
3256
|
-
// Fix conflict with normalize.css and sanitize.css
|
3257
|
-
padding: 0,
|
3258
|
-
height: 11,
|
3259
|
-
// sync with `lineHeight` in `legend` styles
|
3260
|
-
fontSize: "0.75em",
|
3261
|
-
visibility: "hidden",
|
3262
|
-
maxWidth: 0.01,
|
3263
|
-
transition: theme.transitions.create("max-width", {
|
3264
|
-
duration: 50,
|
3265
|
-
easing: theme.transitions.easing.easeOut
|
3266
|
-
}),
|
3267
|
-
whiteSpace: "nowrap",
|
3268
|
-
"& > span": {
|
3269
|
-
paddingLeft: 5,
|
3270
|
-
paddingRight: 5,
|
3271
|
-
display: "inline-block",
|
3272
|
-
opacity: 0,
|
3273
|
-
visibility: "visible"
|
3274
|
-
}
|
3275
|
-
}, ownerState.notched && {
|
3276
|
-
maxWidth: "100%",
|
3277
|
-
transition: theme.transitions.create("max-width", {
|
3278
|
-
duration: 100,
|
3279
|
-
easing: theme.transitions.easing.easeOut,
|
3280
|
-
delay: 50
|
3281
|
-
})
|
3282
|
-
})));
|
3283
|
-
function NotchedOutline(props) {
|
3284
|
-
const {
|
3285
|
-
className,
|
3286
|
-
label,
|
3287
|
-
notched
|
3288
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded$3);
|
3289
|
-
const withLabel = label != null && label !== "";
|
3290
|
-
const ownerState = _extends({}, props, {
|
3291
|
-
notched,
|
3292
|
-
withLabel
|
3293
|
-
});
|
3294
|
-
return /* @__PURE__ */ jsx(NotchedOutlineRoot$1, _extends({
|
3295
|
-
"aria-hidden": true,
|
3296
|
-
className,
|
3297
|
-
ownerState
|
3298
|
-
}, other, {
|
3299
|
-
children: /* @__PURE__ */ jsx(NotchedOutlineLegend, {
|
3300
|
-
ownerState,
|
3301
|
-
children: withLabel ? /* @__PURE__ */ jsx("span", {
|
3302
|
-
children: label
|
3303
|
-
}) : (
|
3304
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
3305
|
-
_span$1 || (_span$1 = /* @__PURE__ */ jsx("span", {
|
3306
|
-
className: "notranslate",
|
3307
|
-
children: ""
|
3308
|
-
}))
|
3309
|
-
)
|
3310
|
-
})
|
3311
|
-
}));
|
3312
|
-
}
|
3313
|
-
process$1.env.NODE_ENV !== "production" ? NotchedOutline.propTypes = {
|
3314
|
-
/**
|
3315
|
-
* The content of the component.
|
3316
|
-
*/
|
3317
|
-
children: PropTypes.node,
|
3318
|
-
/**
|
3319
|
-
* Override or extend the styles applied to the component.
|
3320
|
-
*/
|
3321
|
-
classes: PropTypes.object,
|
3322
|
-
/**
|
3323
|
-
* @ignore
|
3324
|
-
*/
|
3325
|
-
className: PropTypes.string,
|
3326
|
-
/**
|
3327
|
-
* The label.
|
3328
|
-
*/
|
3329
|
-
label: PropTypes.node,
|
3330
|
-
/**
|
3331
|
-
* If `true`, the outline is notched to accommodate the label.
|
3332
|
-
*/
|
3333
|
-
notched: PropTypes.bool.isRequired,
|
3334
|
-
/**
|
3335
|
-
* @ignore
|
3336
|
-
*/
|
3337
|
-
style: PropTypes.object
|
3338
|
-
} : void 0;
|
3339
|
-
const _excluded$2 = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"];
|
3340
|
-
const useUtilityClasses$2 = (ownerState) => {
|
3341
|
-
const {
|
3342
|
-
classes
|
3343
|
-
} = ownerState;
|
3344
|
-
const slots = {
|
3345
|
-
root: ["root"],
|
3346
|
-
notchedOutline: ["notchedOutline"],
|
3347
|
-
input: ["input"]
|
3348
|
-
};
|
3349
|
-
const composedClasses = composeClasses(slots, getOutlinedInputUtilityClass, classes);
|
3350
|
-
return _extends({}, classes, composedClasses);
|
3351
|
-
};
|
3352
|
-
const OutlinedInputRoot = styled(InputBaseRoot, {
|
3353
|
-
shouldForwardProp: (prop) => rootShouldForwardProp(prop) || prop === "classes",
|
3354
|
-
name: "MuiOutlinedInput",
|
3355
|
-
slot: "Root",
|
3356
|
-
overridesResolver: rootOverridesResolver
|
3357
|
-
})(({
|
3358
|
-
theme,
|
3359
|
-
ownerState
|
3360
|
-
}) => {
|
3361
|
-
const borderColor = theme.palette.mode === "light" ? "rgba(0, 0, 0, 0.23)" : "rgba(255, 255, 255, 0.23)";
|
3362
|
-
return _extends({
|
3363
|
-
position: "relative",
|
3364
|
-
borderRadius: (theme.vars || theme).shape.borderRadius,
|
3365
|
-
[`&:hover .${outlinedInputClasses.notchedOutline}`]: {
|
3366
|
-
borderColor: (theme.vars || theme).palette.text.primary
|
3367
|
-
},
|
3368
|
-
// Reset on touch devices, it doesn't add specificity
|
3369
|
-
"@media (hover: none)": {
|
3370
|
-
[`&:hover .${outlinedInputClasses.notchedOutline}`]: {
|
3371
|
-
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
3372
|
-
}
|
3373
|
-
},
|
3374
|
-
[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]: {
|
3375
|
-
borderColor: (theme.vars || theme).palette[ownerState.color].main,
|
3376
|
-
borderWidth: 2
|
3377
|
-
},
|
3378
|
-
[`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]: {
|
3379
|
-
borderColor: (theme.vars || theme).palette.error.main
|
3380
|
-
},
|
3381
|
-
[`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]: {
|
3382
|
-
borderColor: (theme.vars || theme).palette.action.disabled
|
3383
|
-
}
|
3384
|
-
}, ownerState.startAdornment && {
|
3385
|
-
paddingLeft: 14
|
3386
|
-
}, ownerState.endAdornment && {
|
3387
|
-
paddingRight: 14
|
3388
|
-
}, ownerState.multiline && _extends({
|
3389
|
-
padding: "16.5px 14px"
|
3390
|
-
}, ownerState.size === "small" && {
|
3391
|
-
padding: "8.5px 14px"
|
3392
|
-
}));
|
3393
|
-
});
|
3394
|
-
const NotchedOutlineRoot = styled(NotchedOutline, {
|
3395
|
-
name: "MuiOutlinedInput",
|
3396
|
-
slot: "NotchedOutline",
|
3397
|
-
overridesResolver: (props, styles2) => styles2.notchedOutline
|
3398
|
-
})(({
|
3399
|
-
theme
|
3400
|
-
}) => {
|
3401
|
-
const borderColor = theme.palette.mode === "light" ? "rgba(0, 0, 0, 0.23)" : "rgba(255, 255, 255, 0.23)";
|
3402
|
-
return {
|
3403
|
-
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
3404
|
-
};
|
3405
|
-
});
|
3406
|
-
const OutlinedInputInput = styled(InputBaseComponent, {
|
3407
|
-
name: "MuiOutlinedInput",
|
3408
|
-
slot: "Input",
|
3409
|
-
overridesResolver: inputOverridesResolver
|
3410
|
-
})(({
|
3411
|
-
theme,
|
3412
|
-
ownerState
|
3413
|
-
}) => _extends({
|
3414
|
-
padding: "16.5px 14px"
|
3415
|
-
}, !theme.vars && {
|
3416
|
-
"&:-webkit-autofill": {
|
3417
|
-
WebkitBoxShadow: theme.palette.mode === "light" ? null : "0 0 0 100px #266798 inset",
|
3418
|
-
WebkitTextFillColor: theme.palette.mode === "light" ? null : "#fff",
|
3419
|
-
caretColor: theme.palette.mode === "light" ? null : "#fff",
|
3420
|
-
borderRadius: "inherit"
|
3421
|
-
}
|
3422
|
-
}, theme.vars && {
|
3423
|
-
"&:-webkit-autofill": {
|
3424
|
-
borderRadius: "inherit"
|
3425
|
-
},
|
3426
|
-
[theme.getColorSchemeSelector("dark")]: {
|
3427
|
-
"&:-webkit-autofill": {
|
3428
|
-
WebkitBoxShadow: "0 0 0 100px #266798 inset",
|
3429
|
-
WebkitTextFillColor: "#fff",
|
3430
|
-
caretColor: "#fff"
|
3431
|
-
}
|
3432
|
-
}
|
3433
|
-
}, ownerState.size === "small" && {
|
3434
|
-
padding: "8.5px 14px"
|
3435
|
-
}, ownerState.multiline && {
|
3436
|
-
padding: 0
|
3437
|
-
}, ownerState.startAdornment && {
|
3438
|
-
paddingLeft: 0
|
3439
|
-
}, ownerState.endAdornment && {
|
3440
|
-
paddingRight: 0
|
3441
|
-
}));
|
3442
|
-
const OutlinedInput = /* @__PURE__ */ React.forwardRef(function OutlinedInput2(inProps, ref) {
|
3443
|
-
var _ref, _slots$root, _ref2, _slots$input, _React$Fragment;
|
3444
|
-
const props = useDefaultProps({
|
3445
|
-
props: inProps,
|
3446
|
-
name: "MuiOutlinedInput"
|
3447
|
-
});
|
3448
|
-
const {
|
3449
|
-
components = {},
|
3450
|
-
fullWidth = false,
|
3451
|
-
inputComponent = "input",
|
3452
|
-
label,
|
3453
|
-
multiline = false,
|
3454
|
-
notched,
|
3455
|
-
slots = {},
|
3456
|
-
type = "text"
|
3457
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded$2);
|
3458
|
-
const classes = useUtilityClasses$2(props);
|
3459
|
-
const muiFormControl = useFormControl();
|
3460
|
-
const fcs = formControlState({
|
3461
|
-
props,
|
3462
|
-
muiFormControl,
|
3463
|
-
states: ["color", "disabled", "error", "focused", "hiddenLabel", "size", "required"]
|
3464
|
-
});
|
3465
|
-
const ownerState = _extends({}, props, {
|
3466
|
-
color: fcs.color || "primary",
|
3467
|
-
disabled: fcs.disabled,
|
3468
|
-
error: fcs.error,
|
3469
|
-
focused: fcs.focused,
|
3470
|
-
formControl: muiFormControl,
|
3471
|
-
fullWidth,
|
3472
|
-
hiddenLabel: fcs.hiddenLabel,
|
3473
|
-
multiline,
|
3474
|
-
size: fcs.size,
|
3475
|
-
type
|
3476
|
-
});
|
3477
|
-
const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : OutlinedInputRoot;
|
3478
|
-
const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : OutlinedInputInput;
|
3479
|
-
return /* @__PURE__ */ jsx(InputBase, _extends({
|
3480
|
-
slots: {
|
3481
|
-
root: RootSlot,
|
3482
|
-
input: InputSlot
|
3483
|
-
},
|
3484
|
-
renderSuffix: (state) => /* @__PURE__ */ jsx(NotchedOutlineRoot, {
|
3485
|
-
ownerState,
|
3486
|
-
className: classes.notchedOutline,
|
3487
|
-
label: label != null && label !== "" && fcs.required ? _React$Fragment || (_React$Fragment = /* @__PURE__ */ jsxs(React.Fragment, {
|
3488
|
-
children: [label, " ", "*"]
|
3489
|
-
})) : label,
|
3490
|
-
notched: typeof notched !== "undefined" ? notched : Boolean(state.startAdornment || state.filled || state.focused)
|
3491
|
-
}),
|
3492
|
-
fullWidth,
|
3493
|
-
inputComponent,
|
3494
|
-
multiline,
|
3495
|
-
ref,
|
3496
|
-
type
|
3497
|
-
}, other, {
|
3498
|
-
classes: _extends({}, classes, {
|
3499
|
-
notchedOutline: null
|
3500
|
-
})
|
3501
|
-
}));
|
3502
|
-
});
|
3503
|
-
process$1.env.NODE_ENV !== "production" ? OutlinedInput.propTypes = {
|
3504
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
3505
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
3506
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
3507
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
3508
|
-
/**
|
3509
|
-
* This prop helps users to fill forms faster, especially on mobile devices.
|
3510
|
-
* The name can be confusing, as it's more like an autofill.
|
3511
|
-
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
3512
|
-
*/
|
3513
|
-
autoComplete: PropTypes.string,
|
3514
|
-
/**
|
3515
|
-
* If `true`, the `input` element is focused during the first mount.
|
3516
|
-
*/
|
3517
|
-
autoFocus: PropTypes.bool,
|
3518
|
-
/**
|
3519
|
-
* Override or extend the styles applied to the component.
|
3520
|
-
*/
|
3521
|
-
classes: PropTypes.object,
|
3522
|
-
/**
|
3523
|
-
* The color of the component.
|
3524
|
-
* It supports both default and custom theme colors, which can be added as shown in the
|
3525
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
3526
|
-
* The prop defaults to the value (`'primary'`) inherited from the parent FormControl component.
|
3527
|
-
*/
|
3528
|
-
color: PropTypes.oneOfType([PropTypes.oneOf(["primary", "secondary"]), PropTypes.string]),
|
3529
|
-
/**
|
3530
|
-
* The components used for each slot inside.
|
3531
|
-
*
|
3532
|
-
* This prop is an alias for the `slots` prop.
|
3533
|
-
* It's recommended to use the `slots` prop instead.
|
3534
|
-
*
|
3535
|
-
* @default {}
|
3536
|
-
*/
|
3537
|
-
components: PropTypes.shape({
|
3538
|
-
Input: PropTypes.elementType,
|
3539
|
-
Root: PropTypes.elementType
|
3540
|
-
}),
|
3541
|
-
/**
|
3542
|
-
* The default value. Use when the component is not controlled.
|
3543
|
-
*/
|
3544
|
-
defaultValue: PropTypes.any,
|
3545
|
-
/**
|
3546
|
-
* If `true`, the component is disabled.
|
3547
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
3548
|
-
*/
|
3549
|
-
disabled: PropTypes.bool,
|
3550
|
-
/**
|
3551
|
-
* End `InputAdornment` for this component.
|
3552
|
-
*/
|
3553
|
-
endAdornment: PropTypes.node,
|
3554
|
-
/**
|
3555
|
-
* If `true`, the `input` will indicate an error.
|
3556
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
3557
|
-
*/
|
3558
|
-
error: PropTypes.bool,
|
3559
|
-
/**
|
3560
|
-
* If `true`, the `input` will take up the full width of its container.
|
3561
|
-
* @default false
|
3562
|
-
*/
|
3563
|
-
fullWidth: PropTypes.bool,
|
3564
|
-
/**
|
3565
|
-
* The id of the `input` element.
|
3566
|
-
*/
|
3567
|
-
id: PropTypes.string,
|
3568
|
-
/**
|
3569
|
-
* The component used for the `input` element.
|
3570
|
-
* Either a string to use a HTML element or a component.
|
3571
|
-
* @default 'input'
|
3572
|
-
*/
|
3573
|
-
inputComponent: PropTypes.elementType,
|
3574
|
-
/**
|
3575
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
|
3576
|
-
* @default {}
|
3577
|
-
*/
|
3578
|
-
inputProps: PropTypes.object,
|
3579
|
-
/**
|
3580
|
-
* Pass a ref to the `input` element.
|
3581
|
-
*/
|
3582
|
-
inputRef: refType,
|
3583
|
-
/**
|
3584
|
-
* The label of the `input`. It is only used for layout. The actual labelling
|
3585
|
-
* is handled by `InputLabel`.
|
3586
|
-
*/
|
3587
|
-
label: PropTypes.node,
|
3588
|
-
/**
|
3589
|
-
* If `dense`, will adjust vertical spacing. This is normally obtained via context from
|
3590
|
-
* FormControl.
|
3591
|
-
* The prop defaults to the value (`'none'`) inherited from the parent FormControl component.
|
3592
|
-
*/
|
3593
|
-
margin: PropTypes.oneOf(["dense", "none"]),
|
3594
|
-
/**
|
3595
|
-
* Maximum number of rows to display when multiline option is set to true.
|
3596
|
-
*/
|
3597
|
-
maxRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
3598
|
-
/**
|
3599
|
-
* Minimum number of rows to display when multiline option is set to true.
|
3600
|
-
*/
|
3601
|
-
minRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
3602
|
-
/**
|
3603
|
-
* If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.
|
3604
|
-
* @default false
|
3605
|
-
*/
|
3606
|
-
multiline: PropTypes.bool,
|
3607
|
-
/**
|
3608
|
-
* Name attribute of the `input` element.
|
3609
|
-
*/
|
3610
|
-
name: PropTypes.string,
|
3611
|
-
/**
|
3612
|
-
* If `true`, the outline is notched to accommodate the label.
|
3613
|
-
*/
|
3614
|
-
notched: PropTypes.bool,
|
3615
|
-
/**
|
3616
|
-
* Callback fired when the value is changed.
|
3617
|
-
*
|
3618
|
-
* @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
|
3619
|
-
* You can pull out the new value by accessing `event.target.value` (string).
|
3620
|
-
*/
|
3621
|
-
onChange: PropTypes.func,
|
3622
|
-
/**
|
3623
|
-
* The short hint displayed in the `input` before the user enters a value.
|
3624
|
-
*/
|
3625
|
-
placeholder: PropTypes.string,
|
3626
|
-
/**
|
3627
|
-
* It prevents the user from changing the value of the field
|
3628
|
-
* (not from interacting with the field).
|
3629
|
-
*/
|
3630
|
-
readOnly: PropTypes.bool,
|
3631
|
-
/**
|
3632
|
-
* If `true`, the `input` element is required.
|
3633
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
3634
|
-
*/
|
3635
|
-
required: PropTypes.bool,
|
3636
|
-
/**
|
3637
|
-
* Number of rows to display when multiline option is set to true.
|
3638
|
-
*/
|
3639
|
-
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
3640
|
-
/**
|
3641
|
-
* The components used for each slot inside.
|
3642
|
-
*
|
3643
|
-
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
3644
|
-
*
|
3645
|
-
* @default {}
|
3646
|
-
*/
|
3647
|
-
slots: PropTypes.shape({
|
3648
|
-
input: PropTypes.elementType,
|
3649
|
-
root: PropTypes.elementType
|
3650
|
-
}),
|
3651
|
-
/**
|
3652
|
-
* Start `InputAdornment` for this component.
|
3653
|
-
*/
|
3654
|
-
startAdornment: PropTypes.node,
|
3655
|
-
/**
|
3656
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
3657
|
-
*/
|
3658
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
3659
|
-
/**
|
3660
|
-
* Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
|
3661
|
-
* @default 'text'
|
3662
|
-
*/
|
3663
|
-
type: PropTypes.string,
|
3664
|
-
/**
|
3665
|
-
* The value of the `input` element, required for a controlled component.
|
3666
|
-
*/
|
3667
|
-
value: PropTypes.any
|
3668
|
-
} : void 0;
|
3669
|
-
OutlinedInput.muiName = "Input";
|
3670
|
-
function getSelectUtilityClasses(slot) {
|
3671
|
-
return generateUtilityClass("MuiSelect", slot);
|
3672
|
-
}
|
3673
|
-
const selectClasses = generateUtilityClasses("MuiSelect", ["root", "select", "multiple", "filled", "outlined", "standard", "disabled", "focused", "icon", "iconOpen", "iconFilled", "iconOutlined", "iconStandard", "nativeInput", "error"]);
|
3674
|
-
var _span;
|
3675
|
-
const _excluded$1 = ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "error", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"];
|
3676
|
-
const SelectSelect = styled("div", {
|
3677
|
-
name: "MuiSelect",
|
3678
|
-
slot: "Select",
|
3679
|
-
overridesResolver: (props, styles2) => {
|
3680
|
-
const {
|
3681
|
-
ownerState
|
3682
|
-
} = props;
|
3683
|
-
return [
|
3684
|
-
// Win specificity over the input base
|
3685
|
-
{
|
3686
|
-
[`&.${selectClasses.select}`]: styles2.select
|
3687
|
-
},
|
3688
|
-
{
|
3689
|
-
[`&.${selectClasses.select}`]: styles2[ownerState.variant]
|
3690
|
-
},
|
3691
|
-
{
|
3692
|
-
[`&.${selectClasses.error}`]: styles2.error
|
3693
|
-
},
|
3694
|
-
{
|
3695
|
-
[`&.${selectClasses.multiple}`]: styles2.multiple
|
3696
|
-
}
|
3697
|
-
];
|
3698
|
-
}
|
3699
|
-
})(nativeSelectSelectStyles, {
|
3700
|
-
// Win specificity over the input base
|
3701
|
-
[`&.${selectClasses.select}`]: {
|
3702
|
-
height: "auto",
|
3703
|
-
// Resets for multiple select with chips
|
3704
|
-
minHeight: "1.4375em",
|
3705
|
-
// Required for select\text-field height consistency
|
3706
|
-
textOverflow: "ellipsis",
|
3707
|
-
whiteSpace: "nowrap",
|
3708
|
-
overflow: "hidden"
|
3709
|
-
}
|
3710
|
-
});
|
3711
|
-
const SelectIcon = styled("svg", {
|
3712
|
-
name: "MuiSelect",
|
3713
|
-
slot: "Icon",
|
3714
|
-
overridesResolver: (props, styles2) => {
|
3715
|
-
const {
|
3716
|
-
ownerState
|
3717
|
-
} = props;
|
3718
|
-
return [styles2.icon, ownerState.variant && styles2[`icon${capitalize(ownerState.variant)}`], ownerState.open && styles2.iconOpen];
|
3719
|
-
}
|
3720
|
-
})(nativeSelectIconStyles);
|
3721
|
-
const SelectNativeInput = styled("input", {
|
3722
|
-
shouldForwardProp: (prop) => slotShouldForwardProp(prop) && prop !== "classes",
|
3723
|
-
name: "MuiSelect",
|
3724
|
-
slot: "NativeInput",
|
3725
|
-
overridesResolver: (props, styles2) => styles2.nativeInput
|
3726
|
-
})({
|
3727
|
-
bottom: 0,
|
3728
|
-
left: 0,
|
3729
|
-
position: "absolute",
|
3730
|
-
opacity: 0,
|
3731
|
-
pointerEvents: "none",
|
3732
|
-
width: "100%",
|
3733
|
-
boxSizing: "border-box"
|
3734
|
-
});
|
3735
|
-
function areEqualValues(a, b) {
|
3736
|
-
if (typeof b === "object" && b !== null) {
|
3737
|
-
return a === b;
|
3738
|
-
}
|
3739
|
-
return String(a) === String(b);
|
3740
|
-
}
|
3741
|
-
function isEmpty(display) {
|
3742
|
-
return display == null || typeof display === "string" && !display.trim();
|
3743
|
-
}
|
3744
|
-
const useUtilityClasses$1 = (ownerState) => {
|
3745
|
-
const {
|
3746
|
-
classes,
|
3747
|
-
variant,
|
3748
|
-
disabled,
|
3749
|
-
multiple,
|
3750
|
-
open,
|
3751
|
-
error
|
3752
|
-
} = ownerState;
|
3753
|
-
const slots = {
|
3754
|
-
select: ["select", variant, disabled && "disabled", multiple && "multiple", error && "error"],
|
3755
|
-
icon: ["icon", `icon${capitalize(variant)}`, open && "iconOpen", disabled && "disabled"],
|
3756
|
-
nativeInput: ["nativeInput"]
|
3757
|
-
};
|
3758
|
-
return composeClasses(slots, getSelectUtilityClasses, classes);
|
3759
|
-
};
|
3760
|
-
const SelectInput = /* @__PURE__ */ React.forwardRef(function SelectInput2(props, ref) {
|
3761
|
-
var _MenuProps$slotProps;
|
3762
|
-
const {
|
3763
|
-
"aria-describedby": ariaDescribedby,
|
3764
|
-
"aria-label": ariaLabel,
|
3765
|
-
autoFocus,
|
3766
|
-
autoWidth,
|
3767
|
-
children,
|
3768
|
-
className,
|
3769
|
-
defaultOpen,
|
3770
|
-
defaultValue,
|
3771
|
-
disabled,
|
3772
|
-
displayEmpty,
|
3773
|
-
error = false,
|
3774
|
-
IconComponent,
|
3775
|
-
inputRef: inputRefProp,
|
3776
|
-
labelId,
|
3777
|
-
MenuProps = {},
|
3778
|
-
multiple,
|
3779
|
-
name,
|
3780
|
-
onBlur,
|
3781
|
-
onChange,
|
3782
|
-
onClose,
|
3783
|
-
onFocus,
|
3784
|
-
onOpen,
|
3785
|
-
open: openProp,
|
3786
|
-
readOnly,
|
3787
|
-
renderValue,
|
3788
|
-
SelectDisplayProps = {},
|
3789
|
-
tabIndex: tabIndexProp,
|
3790
|
-
value: valueProp,
|
3791
|
-
variant = "standard"
|
3792
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded$1);
|
3793
|
-
const [value, setValueState] = useControlled({
|
3794
|
-
controlled: valueProp,
|
3795
|
-
default: defaultValue,
|
3796
|
-
name: "Select"
|
3797
|
-
});
|
3798
|
-
const [openState, setOpenState] = useControlled({
|
3799
|
-
controlled: openProp,
|
3800
|
-
default: defaultOpen,
|
3801
|
-
name: "Select"
|
3802
|
-
});
|
3803
|
-
const inputRef = React.useRef(null);
|
3804
|
-
const displayRef = React.useRef(null);
|
3805
|
-
const [displayNode, setDisplayNode] = React.useState(null);
|
3806
|
-
const {
|
3807
|
-
current: isOpenControlled
|
3808
|
-
} = React.useRef(openProp != null);
|
3809
|
-
const [menuMinWidthState, setMenuMinWidthState] = React.useState();
|
3810
|
-
const handleRef = useForkRef(ref, inputRefProp);
|
3811
|
-
const handleDisplayRef = React.useCallback((node) => {
|
3812
|
-
displayRef.current = node;
|
3813
|
-
if (node) {
|
3814
|
-
setDisplayNode(node);
|
3815
|
-
}
|
3816
|
-
}, []);
|
3817
|
-
const anchorElement = displayNode == null ? void 0 : displayNode.parentNode;
|
3818
|
-
React.useImperativeHandle(handleRef, () => ({
|
3819
|
-
focus: () => {
|
3820
|
-
displayRef.current.focus();
|
3821
|
-
},
|
3822
|
-
node: inputRef.current,
|
3823
|
-
value
|
3824
|
-
}), [value]);
|
3825
|
-
React.useEffect(() => {
|
3826
|
-
if (defaultOpen && openState && displayNode && !isOpenControlled) {
|
3827
|
-
setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
|
3828
|
-
displayRef.current.focus();
|
3829
|
-
}
|
3830
|
-
}, [displayNode, autoWidth]);
|
3831
|
-
React.useEffect(() => {
|
3832
|
-
if (autoFocus) {
|
3833
|
-
displayRef.current.focus();
|
3834
|
-
}
|
3835
|
-
}, [autoFocus]);
|
3836
|
-
React.useEffect(() => {
|
3837
|
-
if (!labelId) {
|
3838
|
-
return void 0;
|
3839
|
-
}
|
3840
|
-
const label = ownerDocument(displayRef.current).getElementById(labelId);
|
3841
|
-
if (label) {
|
3842
|
-
const handler = () => {
|
3843
|
-
if (getSelection().isCollapsed) {
|
3844
|
-
displayRef.current.focus();
|
3845
|
-
}
|
3846
|
-
};
|
3847
|
-
label.addEventListener("click", handler);
|
3848
|
-
return () => {
|
3849
|
-
label.removeEventListener("click", handler);
|
3850
|
-
};
|
3851
|
-
}
|
3852
|
-
return void 0;
|
3853
|
-
}, [labelId]);
|
3854
|
-
const update = (open2, event) => {
|
3855
|
-
if (open2) {
|
3856
|
-
if (onOpen) {
|
3857
|
-
onOpen(event);
|
3858
|
-
}
|
3859
|
-
} else if (onClose) {
|
3860
|
-
onClose(event);
|
3861
|
-
}
|
3862
|
-
if (!isOpenControlled) {
|
3863
|
-
setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
|
3864
|
-
setOpenState(open2);
|
3865
|
-
}
|
3866
|
-
};
|
3867
|
-
const handleMouseDown = (event) => {
|
3868
|
-
if (event.button !== 0) {
|
3869
|
-
return;
|
3870
|
-
}
|
3871
|
-
event.preventDefault();
|
3872
|
-
displayRef.current.focus();
|
3873
|
-
update(true, event);
|
3874
|
-
};
|
3875
|
-
const handleClose = (event) => {
|
3876
|
-
update(false, event);
|
3877
|
-
};
|
3878
|
-
const childrenArray = React.Children.toArray(children);
|
3879
|
-
const handleChange = (event) => {
|
3880
|
-
const child = childrenArray.find((childItem) => childItem.props.value === event.target.value);
|
3881
|
-
if (child === void 0) {
|
3882
|
-
return;
|
3883
|
-
}
|
3884
|
-
setValueState(child.props.value);
|
3885
|
-
if (onChange) {
|
3886
|
-
onChange(event, child);
|
3887
|
-
}
|
3888
|
-
};
|
3889
|
-
const handleItemClick = (child) => (event) => {
|
3890
|
-
let newValue;
|
3891
|
-
if (!event.currentTarget.hasAttribute("tabindex")) {
|
3892
|
-
return;
|
3893
|
-
}
|
3894
|
-
if (multiple) {
|
3895
|
-
newValue = Array.isArray(value) ? value.slice() : [];
|
3896
|
-
const itemIndex = value.indexOf(child.props.value);
|
3897
|
-
if (itemIndex === -1) {
|
3898
|
-
newValue.push(child.props.value);
|
3899
|
-
} else {
|
3900
|
-
newValue.splice(itemIndex, 1);
|
3901
|
-
}
|
3902
|
-
} else {
|
3903
|
-
newValue = child.props.value;
|
3904
|
-
}
|
3905
|
-
if (child.props.onClick) {
|
3906
|
-
child.props.onClick(event);
|
3907
|
-
}
|
3908
|
-
if (value !== newValue) {
|
3909
|
-
setValueState(newValue);
|
3910
|
-
if (onChange) {
|
3911
|
-
const nativeEvent = event.nativeEvent || event;
|
3912
|
-
const clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
|
3913
|
-
Object.defineProperty(clonedEvent, "target", {
|
3914
|
-
writable: true,
|
3915
|
-
value: {
|
3916
|
-
value: newValue,
|
3917
|
-
name
|
3918
|
-
}
|
3919
|
-
});
|
3920
|
-
onChange(clonedEvent, child);
|
3921
|
-
}
|
3922
|
-
}
|
3923
|
-
if (!multiple) {
|
3924
|
-
update(false, event);
|
3925
|
-
}
|
3926
|
-
};
|
3927
|
-
const handleKeyDown = (event) => {
|
3928
|
-
if (!readOnly) {
|
3929
|
-
const validKeys = [
|
3930
|
-
" ",
|
3931
|
-
"ArrowUp",
|
3932
|
-
"ArrowDown",
|
3933
|
-
// The native select doesn't respond to enter on macOS, but it's recommended by
|
3934
|
-
// https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
|
3935
|
-
"Enter"
|
3936
|
-
];
|
3937
|
-
if (validKeys.indexOf(event.key) !== -1) {
|
3938
|
-
event.preventDefault();
|
3939
|
-
update(true, event);
|
3940
|
-
}
|
3941
|
-
}
|
3942
|
-
};
|
3943
|
-
const open = displayNode !== null && openState;
|
3944
|
-
const handleBlur = (event) => {
|
3945
|
-
if (!open && onBlur) {
|
3946
|
-
Object.defineProperty(event, "target", {
|
3947
|
-
writable: true,
|
3948
|
-
value: {
|
3949
|
-
value,
|
3950
|
-
name
|
3951
|
-
}
|
3952
|
-
});
|
3953
|
-
onBlur(event);
|
3954
|
-
}
|
3955
|
-
};
|
3956
|
-
delete other["aria-invalid"];
|
3957
|
-
let display;
|
3958
|
-
let displaySingle;
|
3959
|
-
const displayMultiple = [];
|
3960
|
-
let computeDisplay = false;
|
3961
|
-
let foundMatch = false;
|
3962
|
-
if (isFilled({
|
3963
|
-
value
|
3964
|
-
}) || displayEmpty) {
|
3965
|
-
if (renderValue) {
|
3966
|
-
display = renderValue(value);
|
3967
|
-
} else {
|
3968
|
-
computeDisplay = true;
|
3969
|
-
}
|
3970
|
-
}
|
3971
|
-
const items = childrenArray.map((child) => {
|
3972
|
-
if (!/* @__PURE__ */ React.isValidElement(child)) {
|
3973
|
-
return null;
|
3974
|
-
}
|
3975
|
-
if (process$1.env.NODE_ENV !== "production") {
|
3976
|
-
if (reactIsExports.isFragment(child)) {
|
3977
|
-
}
|
3978
|
-
}
|
3979
|
-
let selected;
|
3980
|
-
if (multiple) {
|
3981
|
-
if (!Array.isArray(value)) {
|
3982
|
-
throw new Error(process$1.env.NODE_ENV !== "production" ? `MUI: The \`value\` prop must be an array when using the \`Select\` component with \`multiple\`.` : formatMuiErrorMessage(2));
|
3983
|
-
}
|
3984
|
-
selected = value.some((v) => areEqualValues(v, child.props.value));
|
3985
|
-
if (selected && computeDisplay) {
|
3986
|
-
displayMultiple.push(child.props.children);
|
3987
|
-
}
|
3988
|
-
} else {
|
3989
|
-
selected = areEqualValues(value, child.props.value);
|
3990
|
-
if (selected && computeDisplay) {
|
3991
|
-
displaySingle = child.props.children;
|
3992
|
-
}
|
3993
|
-
}
|
3994
|
-
if (selected) {
|
3995
|
-
foundMatch = true;
|
3996
|
-
}
|
3997
|
-
return /* @__PURE__ */ React.cloneElement(child, {
|
3998
|
-
"aria-selected": selected ? "true" : "false",
|
3999
|
-
onClick: handleItemClick(child),
|
4000
|
-
onKeyUp: (event) => {
|
4001
|
-
if (event.key === " ") {
|
4002
|
-
event.preventDefault();
|
4003
|
-
}
|
4004
|
-
if (child.props.onKeyUp) {
|
4005
|
-
child.props.onKeyUp(event);
|
4006
|
-
}
|
4007
|
-
},
|
4008
|
-
role: "option",
|
4009
|
-
selected,
|
4010
|
-
value: void 0,
|
4011
|
-
// The value is most likely not a valid HTML attribute.
|
4012
|
-
"data-value": child.props.value
|
4013
|
-
// Instead, we provide it as a data attribute.
|
4014
|
-
});
|
4015
|
-
});
|
4016
|
-
if (process$1.env.NODE_ENV !== "production") {
|
4017
|
-
React.useEffect(() => {
|
4018
|
-
if (!foundMatch && !multiple && value !== "") {
|
4019
|
-
const values = childrenArray.map((child) => child.props.value);
|
4020
|
-
}
|
4021
|
-
}, [foundMatch, childrenArray, multiple, name, value]);
|
4022
|
-
}
|
4023
|
-
if (computeDisplay) {
|
4024
|
-
if (multiple) {
|
4025
|
-
if (displayMultiple.length === 0) {
|
4026
|
-
display = null;
|
4027
|
-
} else {
|
4028
|
-
display = displayMultiple.reduce((output, child, index) => {
|
4029
|
-
output.push(child);
|
4030
|
-
if (index < displayMultiple.length - 1) {
|
4031
|
-
output.push(", ");
|
4032
|
-
}
|
4033
|
-
return output;
|
4034
|
-
}, []);
|
4035
|
-
}
|
4036
|
-
} else {
|
4037
|
-
display = displaySingle;
|
4038
|
-
}
|
4039
|
-
}
|
4040
|
-
let menuMinWidth = menuMinWidthState;
|
4041
|
-
if (!autoWidth && isOpenControlled && displayNode) {
|
4042
|
-
menuMinWidth = anchorElement.clientWidth;
|
4043
|
-
}
|
4044
|
-
let tabIndex;
|
4045
|
-
if (typeof tabIndexProp !== "undefined") {
|
4046
|
-
tabIndex = tabIndexProp;
|
4047
|
-
} else {
|
4048
|
-
tabIndex = disabled ? null : 0;
|
4049
|
-
}
|
4050
|
-
const buttonId = SelectDisplayProps.id || (name ? `mui-component-select-${name}` : void 0);
|
4051
|
-
const ownerState = _extends({}, props, {
|
4052
|
-
variant,
|
4053
|
-
value,
|
4054
|
-
open,
|
4055
|
-
error
|
4056
|
-
});
|
4057
|
-
const classes = useUtilityClasses$1(ownerState);
|
4058
|
-
const paperProps = _extends({}, MenuProps.PaperProps, (_MenuProps$slotProps = MenuProps.slotProps) == null ? void 0 : _MenuProps$slotProps.paper);
|
4059
|
-
const listboxId = useId();
|
4060
|
-
return /* @__PURE__ */ jsxs(React.Fragment, {
|
4061
|
-
children: [/* @__PURE__ */ jsx(SelectSelect, _extends({
|
4062
|
-
ref: handleDisplayRef,
|
4063
|
-
tabIndex,
|
4064
|
-
role: "combobox",
|
4065
|
-
"aria-controls": listboxId,
|
4066
|
-
"aria-disabled": disabled ? "true" : void 0,
|
4067
|
-
"aria-expanded": open ? "true" : "false",
|
4068
|
-
"aria-haspopup": "listbox",
|
4069
|
-
"aria-label": ariaLabel,
|
4070
|
-
"aria-labelledby": [labelId, buttonId].filter(Boolean).join(" ") || void 0,
|
4071
|
-
"aria-describedby": ariaDescribedby,
|
4072
|
-
onKeyDown: handleKeyDown,
|
4073
|
-
onMouseDown: disabled || readOnly ? null : handleMouseDown,
|
4074
|
-
onBlur: handleBlur,
|
4075
|
-
onFocus
|
4076
|
-
}, SelectDisplayProps, {
|
4077
|
-
ownerState,
|
4078
|
-
className: clsx(SelectDisplayProps.className, classes.select, className),
|
4079
|
-
id: buttonId,
|
4080
|
-
children: isEmpty(display) ? (
|
4081
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
4082
|
-
_span || (_span = /* @__PURE__ */ jsx("span", {
|
4083
|
-
className: "notranslate",
|
4084
|
-
children: ""
|
4085
|
-
}))
|
4086
|
-
) : display
|
4087
|
-
})), /* @__PURE__ */ jsx(SelectNativeInput, _extends({
|
4088
|
-
"aria-invalid": error,
|
4089
|
-
value: Array.isArray(value) ? value.join(",") : value,
|
4090
|
-
name,
|
4091
|
-
ref: inputRef,
|
4092
|
-
"aria-hidden": true,
|
4093
|
-
onChange: handleChange,
|
4094
|
-
tabIndex: -1,
|
4095
|
-
disabled,
|
4096
|
-
className: classes.nativeInput,
|
4097
|
-
autoFocus,
|
4098
|
-
ownerState
|
4099
|
-
}, other)), /* @__PURE__ */ jsx(SelectIcon, {
|
4100
|
-
as: IconComponent,
|
4101
|
-
className: classes.icon,
|
4102
|
-
ownerState
|
4103
|
-
}), /* @__PURE__ */ jsx(Menu, _extends({
|
4104
|
-
id: `menu-${name || ""}`,
|
4105
|
-
anchorEl: anchorElement,
|
4106
|
-
open,
|
4107
|
-
onClose: handleClose,
|
4108
|
-
anchorOrigin: {
|
4109
|
-
vertical: "bottom",
|
4110
|
-
horizontal: "center"
|
4111
|
-
},
|
4112
|
-
transformOrigin: {
|
4113
|
-
vertical: "top",
|
4114
|
-
horizontal: "center"
|
4115
|
-
}
|
4116
|
-
}, MenuProps, {
|
4117
|
-
MenuListProps: _extends({
|
4118
|
-
"aria-labelledby": labelId,
|
4119
|
-
role: "listbox",
|
4120
|
-
"aria-multiselectable": multiple ? "true" : void 0,
|
4121
|
-
disableListWrap: true,
|
4122
|
-
id: listboxId
|
4123
|
-
}, MenuProps.MenuListProps),
|
4124
|
-
slotProps: _extends({}, MenuProps.slotProps, {
|
4125
|
-
paper: _extends({}, paperProps, {
|
4126
|
-
style: _extends({
|
4127
|
-
minWidth: menuMinWidth
|
4128
|
-
}, paperProps != null ? paperProps.style : null)
|
4129
|
-
})
|
4130
|
-
}),
|
4131
|
-
children: items
|
4132
|
-
}))]
|
4133
|
-
});
|
4134
|
-
});
|
4135
|
-
process$1.env.NODE_ENV !== "production" ? SelectInput.propTypes = {
|
4136
|
-
/**
|
4137
|
-
* @ignore
|
4138
|
-
*/
|
4139
|
-
"aria-describedby": PropTypes.string,
|
4140
|
-
/**
|
4141
|
-
* @ignore
|
4142
|
-
*/
|
4143
|
-
"aria-label": PropTypes.string,
|
4144
|
-
/**
|
4145
|
-
* @ignore
|
4146
|
-
*/
|
4147
|
-
autoFocus: PropTypes.bool,
|
4148
|
-
/**
|
4149
|
-
* If `true`, the width of the popover will automatically be set according to the items inside the
|
4150
|
-
* menu, otherwise it will be at least the width of the select input.
|
4151
|
-
*/
|
4152
|
-
autoWidth: PropTypes.bool,
|
4153
|
-
/**
|
4154
|
-
* The option elements to populate the select with.
|
4155
|
-
* Can be some `<MenuItem>` elements.
|
4156
|
-
*/
|
4157
|
-
children: PropTypes.node,
|
4158
|
-
/**
|
4159
|
-
* Override or extend the styles applied to the component.
|
4160
|
-
*/
|
4161
|
-
classes: PropTypes.object,
|
4162
|
-
/**
|
4163
|
-
* The CSS class name of the select element.
|
4164
|
-
*/
|
4165
|
-
className: PropTypes.string,
|
4166
|
-
/**
|
4167
|
-
* If `true`, the component is toggled on mount. Use when the component open state is not controlled.
|
4168
|
-
* You can only use it when the `native` prop is `false` (default).
|
4169
|
-
*/
|
4170
|
-
defaultOpen: PropTypes.bool,
|
4171
|
-
/**
|
4172
|
-
* The default value. Use when the component is not controlled.
|
4173
|
-
*/
|
4174
|
-
defaultValue: PropTypes.any,
|
4175
|
-
/**
|
4176
|
-
* If `true`, the select is disabled.
|
4177
|
-
*/
|
4178
|
-
disabled: PropTypes.bool,
|
4179
|
-
/**
|
4180
|
-
* If `true`, the selected item is displayed even if its value is empty.
|
4181
|
-
*/
|
4182
|
-
displayEmpty: PropTypes.bool,
|
4183
|
-
/**
|
4184
|
-
* If `true`, the `select input` will indicate an error.
|
4185
|
-
*/
|
4186
|
-
error: PropTypes.bool,
|
4187
|
-
/**
|
4188
|
-
* The icon that displays the arrow.
|
4189
|
-
*/
|
4190
|
-
IconComponent: PropTypes.elementType.isRequired,
|
4191
|
-
/**
|
4192
|
-
* Imperative handle implementing `{ value: T, node: HTMLElement, focus(): void }`
|
4193
|
-
* Equivalent to `ref`
|
4194
|
-
*/
|
4195
|
-
inputRef: refType,
|
4196
|
-
/**
|
4197
|
-
* The ID of an element that acts as an additional label. The Select will
|
4198
|
-
* be labelled by the additional label and the selected value.
|
4199
|
-
*/
|
4200
|
-
labelId: PropTypes.string,
|
4201
|
-
/**
|
4202
|
-
* Props applied to the [`Menu`](/material-ui/api/menu/) element.
|
4203
|
-
*/
|
4204
|
-
MenuProps: PropTypes.object,
|
4205
|
-
/**
|
4206
|
-
* If `true`, `value` must be an array and the menu will support multiple selections.
|
4207
|
-
*/
|
4208
|
-
multiple: PropTypes.bool,
|
4209
|
-
/**
|
4210
|
-
* Name attribute of the `select` or hidden `input` element.
|
4211
|
-
*/
|
4212
|
-
name: PropTypes.string,
|
4213
|
-
/**
|
4214
|
-
* @ignore
|
4215
|
-
*/
|
4216
|
-
onBlur: PropTypes.func,
|
4217
|
-
/**
|
4218
|
-
* Callback fired when a menu item is selected.
|
4219
|
-
*
|
4220
|
-
* @param {object} event The event source of the callback.
|
4221
|
-
* You can pull out the new value by accessing `event.target.value` (any).
|
4222
|
-
* @param {object} [child] The react element that was selected.
|
4223
|
-
*/
|
4224
|
-
onChange: PropTypes.func,
|
4225
|
-
/**
|
4226
|
-
* Callback fired when the component requests to be closed.
|
4227
|
-
* Use in controlled mode (see open).
|
4228
|
-
*
|
4229
|
-
* @param {object} event The event source of the callback.
|
4230
|
-
*/
|
4231
|
-
onClose: PropTypes.func,
|
4232
|
-
/**
|
4233
|
-
* @ignore
|
4234
|
-
*/
|
4235
|
-
onFocus: PropTypes.func,
|
4236
|
-
/**
|
4237
|
-
* Callback fired when the component requests to be opened.
|
4238
|
-
* Use in controlled mode (see open).
|
4239
|
-
*
|
4240
|
-
* @param {object} event The event source of the callback.
|
4241
|
-
*/
|
4242
|
-
onOpen: PropTypes.func,
|
4243
|
-
/**
|
4244
|
-
* If `true`, the component is shown.
|
4245
|
-
*/
|
4246
|
-
open: PropTypes.bool,
|
4247
|
-
/**
|
4248
|
-
* @ignore
|
4249
|
-
*/
|
4250
|
-
readOnly: PropTypes.bool,
|
4251
|
-
/**
|
4252
|
-
* Render the selected value.
|
4253
|
-
*
|
4254
|
-
* @param {any} value The `value` provided to the component.
|
4255
|
-
* @returns {ReactNode}
|
4256
|
-
*/
|
4257
|
-
renderValue: PropTypes.func,
|
4258
|
-
/**
|
4259
|
-
* Props applied to the clickable div element.
|
4260
|
-
*/
|
4261
|
-
SelectDisplayProps: PropTypes.object,
|
4262
|
-
/**
|
4263
|
-
* @ignore
|
4264
|
-
*/
|
4265
|
-
tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
4266
|
-
/**
|
4267
|
-
* @ignore
|
4268
|
-
*/
|
4269
|
-
type: PropTypes.any,
|
4270
|
-
/**
|
4271
|
-
* The input value.
|
4272
|
-
*/
|
4273
|
-
value: PropTypes.any,
|
4274
|
-
/**
|
4275
|
-
* The variant to use.
|
4276
|
-
*/
|
4277
|
-
variant: PropTypes.oneOf(["standard", "outlined", "filled"])
|
4278
|
-
} : void 0;
|
4279
|
-
const _excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"], _excluded2 = ["root"];
|
4280
|
-
const useUtilityClasses = (ownerState) => {
|
4281
|
-
const {
|
4282
|
-
classes
|
4283
|
-
} = ownerState;
|
4284
|
-
return classes;
|
4285
|
-
};
|
4286
|
-
const styledRootConfig = {
|
4287
|
-
name: "MuiSelect",
|
4288
|
-
overridesResolver: (props, styles2) => styles2.root,
|
4289
|
-
shouldForwardProp: (prop) => rootShouldForwardProp(prop) && prop !== "variant",
|
4290
|
-
slot: "Root"
|
4291
|
-
};
|
4292
|
-
const StyledInput = styled(Input, styledRootConfig)("");
|
4293
|
-
const StyledOutlinedInput = styled(OutlinedInput, styledRootConfig)("");
|
4294
|
-
const StyledFilledInput = styled(FilledInput, styledRootConfig)("");
|
4295
|
-
const Select = /* @__PURE__ */ React.forwardRef(function Select2(inProps, ref) {
|
4296
|
-
const props = useDefaultProps({
|
4297
|
-
name: "MuiSelect",
|
4298
|
-
props: inProps
|
4299
|
-
});
|
4300
|
-
const {
|
4301
|
-
autoWidth = false,
|
4302
|
-
children,
|
4303
|
-
classes: classesProp = {},
|
4304
|
-
className,
|
4305
|
-
defaultOpen = false,
|
4306
|
-
displayEmpty = false,
|
4307
|
-
IconComponent = ArrowDropDownIcon,
|
4308
|
-
id,
|
4309
|
-
input,
|
4310
|
-
inputProps,
|
4311
|
-
label,
|
4312
|
-
labelId,
|
4313
|
-
MenuProps,
|
4314
|
-
multiple = false,
|
4315
|
-
native = false,
|
4316
|
-
onClose,
|
4317
|
-
onOpen,
|
4318
|
-
open,
|
4319
|
-
renderValue,
|
4320
|
-
SelectDisplayProps,
|
4321
|
-
variant: variantProp = "outlined"
|
4322
|
-
} = props, other = _objectWithoutPropertiesLoose(props, _excluded);
|
4323
|
-
const inputComponent = native ? NativeSelectInput : SelectInput;
|
4324
|
-
const muiFormControl = useFormControl();
|
4325
|
-
const fcs = formControlState({
|
4326
|
-
props,
|
4327
|
-
muiFormControl,
|
4328
|
-
states: ["variant", "error"]
|
4329
|
-
});
|
4330
|
-
const variant = fcs.variant || variantProp;
|
4331
|
-
const ownerState = _extends({}, props, {
|
4332
|
-
variant,
|
4333
|
-
classes: classesProp
|
4334
|
-
});
|
4335
|
-
const classes = useUtilityClasses(ownerState);
|
4336
|
-
const restOfClasses = _objectWithoutPropertiesLoose(classes, _excluded2);
|
4337
|
-
const InputComponent = input || {
|
4338
|
-
standard: /* @__PURE__ */ jsx(StyledInput, {
|
4339
|
-
ownerState
|
4340
|
-
}),
|
4341
|
-
outlined: /* @__PURE__ */ jsx(StyledOutlinedInput, {
|
4342
|
-
label,
|
4343
|
-
ownerState
|
4344
|
-
}),
|
4345
|
-
filled: /* @__PURE__ */ jsx(StyledFilledInput, {
|
4346
|
-
ownerState
|
4347
|
-
})
|
4348
|
-
}[variant];
|
4349
|
-
const inputComponentRef = useForkRef(ref, getReactElementRef(InputComponent));
|
4350
|
-
return /* @__PURE__ */ jsx(React.Fragment, {
|
4351
|
-
children: /* @__PURE__ */ React.cloneElement(InputComponent, _extends({
|
4352
|
-
// Most of the logic is implemented in `SelectInput`.
|
4353
|
-
// The `Select` component is a simple API wrapper to expose something better to play with.
|
4354
|
-
inputComponent,
|
4355
|
-
inputProps: _extends({
|
4356
|
-
children,
|
4357
|
-
error: fcs.error,
|
4358
|
-
IconComponent,
|
4359
|
-
variant,
|
4360
|
-
type: void 0,
|
4361
|
-
// We render a select. We can ignore the type provided by the `Input`.
|
4362
|
-
multiple
|
4363
|
-
}, native ? {
|
4364
|
-
id
|
4365
|
-
} : {
|
4366
|
-
autoWidth,
|
4367
|
-
defaultOpen,
|
4368
|
-
displayEmpty,
|
4369
|
-
labelId,
|
4370
|
-
MenuProps,
|
4371
|
-
onClose,
|
4372
|
-
onOpen,
|
4373
|
-
open,
|
4374
|
-
renderValue,
|
4375
|
-
SelectDisplayProps: _extends({
|
4376
|
-
id
|
4377
|
-
}, SelectDisplayProps)
|
4378
|
-
}, inputProps, {
|
4379
|
-
classes: inputProps ? deepmerge(restOfClasses, inputProps.classes) : restOfClasses
|
4380
|
-
}, input ? input.props.inputProps : {})
|
4381
|
-
}, (multiple && native || displayEmpty) && variant === "outlined" ? {
|
4382
|
-
notched: true
|
4383
|
-
} : {}, {
|
4384
|
-
ref: inputComponentRef,
|
4385
|
-
className: clsx(InputComponent.props.className, className, classes.root)
|
4386
|
-
}, !input && {
|
4387
|
-
variant
|
4388
|
-
}, other))
|
4389
|
-
});
|
4390
|
-
});
|
4391
|
-
process$1.env.NODE_ENV !== "production" ? Select.propTypes = {
|
4392
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
4393
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
4394
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
4395
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
4396
|
-
/**
|
4397
|
-
* If `true`, the width of the popover will automatically be set according to the items inside the
|
4398
|
-
* menu, otherwise it will be at least the width of the select input.
|
4399
|
-
* @default false
|
4400
|
-
*/
|
4401
|
-
autoWidth: PropTypes.bool,
|
4402
|
-
/**
|
4403
|
-
* The option elements to populate the select with.
|
4404
|
-
* Can be some `MenuItem` when `native` is false and `option` when `native` is true.
|
4405
|
-
*
|
4406
|
-
* ⚠️The `MenuItem` elements **must** be direct descendants when `native` is false.
|
4407
|
-
*/
|
4408
|
-
children: PropTypes.node,
|
4409
|
-
/**
|
4410
|
-
* Override or extend the styles applied to the component.
|
4411
|
-
* @default {}
|
4412
|
-
*/
|
4413
|
-
classes: PropTypes.object,
|
4414
|
-
/**
|
4415
|
-
* @ignore
|
4416
|
-
*/
|
4417
|
-
className: PropTypes.string,
|
4418
|
-
/**
|
4419
|
-
* If `true`, the component is initially open. Use when the component open state is not controlled (i.e. the `open` prop is not defined).
|
4420
|
-
* You can only use it when the `native` prop is `false` (default).
|
4421
|
-
* @default false
|
4422
|
-
*/
|
4423
|
-
defaultOpen: PropTypes.bool,
|
4424
|
-
/**
|
4425
|
-
* The default value. Use when the component is not controlled.
|
4426
|
-
*/
|
4427
|
-
defaultValue: PropTypes.any,
|
4428
|
-
/**
|
4429
|
-
* If `true`, a value is displayed even if no items are selected.
|
4430
|
-
*
|
4431
|
-
* In order to display a meaningful value, a function can be passed to the `renderValue` prop which
|
4432
|
-
* returns the value to be displayed when no items are selected.
|
4433
|
-
*
|
4434
|
-
* ⚠️ When using this prop, make sure the label doesn't overlap with the empty displayed value.
|
4435
|
-
* The label should either be hidden or forced to a shrunk state.
|
4436
|
-
* @default false
|
4437
|
-
*/
|
4438
|
-
displayEmpty: PropTypes.bool,
|
4439
|
-
/**
|
4440
|
-
* The icon that displays the arrow.
|
4441
|
-
* @default ArrowDropDownIcon
|
4442
|
-
*/
|
4443
|
-
IconComponent: PropTypes.elementType,
|
4444
|
-
/**
|
4445
|
-
* The `id` of the wrapper element or the `select` element when `native`.
|
4446
|
-
*/
|
4447
|
-
id: PropTypes.string,
|
4448
|
-
/**
|
4449
|
-
* An `Input` element; does not have to be a material-ui specific `Input`.
|
4450
|
-
*/
|
4451
|
-
input: PropTypes.element,
|
4452
|
-
/**
|
4453
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
|
4454
|
-
* When `native` is `true`, the attributes are applied on the `select` element.
|
4455
|
-
*/
|
4456
|
-
inputProps: PropTypes.object,
|
4457
|
-
/**
|
4458
|
-
* See [OutlinedInput#label](/material-ui/api/outlined-input/#props)
|
4459
|
-
*/
|
4460
|
-
label: PropTypes.node,
|
4461
|
-
/**
|
4462
|
-
* The ID of an element that acts as an additional label. The Select will
|
4463
|
-
* be labelled by the additional label and the selected value.
|
4464
|
-
*/
|
4465
|
-
labelId: PropTypes.string,
|
4466
|
-
/**
|
4467
|
-
* Props applied to the [`Menu`](/material-ui/api/menu/) element.
|
4468
|
-
*/
|
4469
|
-
MenuProps: PropTypes.object,
|
4470
|
-
/**
|
4471
|
-
* If `true`, `value` must be an array and the menu will support multiple selections.
|
4472
|
-
* @default false
|
4473
|
-
*/
|
4474
|
-
multiple: PropTypes.bool,
|
4475
|
-
/**
|
4476
|
-
* If `true`, the component uses a native `select` element.
|
4477
|
-
* @default false
|
4478
|
-
*/
|
4479
|
-
native: PropTypes.bool,
|
4480
|
-
/**
|
4481
|
-
* Callback fired when a menu item is selected.
|
4482
|
-
*
|
4483
|
-
* @param {SelectChangeEvent<Value>} event The event source of the callback.
|
4484
|
-
* You can pull out the new value by accessing `event.target.value` (any).
|
4485
|
-
* **Warning**: This is a generic event, not a change event, unless the change event is caused by browser autofill.
|
4486
|
-
* @param {object} [child] The react element that was selected when `native` is `false` (default).
|
4487
|
-
*/
|
4488
|
-
onChange: PropTypes.func,
|
4489
|
-
/**
|
4490
|
-
* Callback fired when the component requests to be closed.
|
4491
|
-
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapses).
|
4492
|
-
*
|
4493
|
-
* @param {object} event The event source of the callback.
|
4494
|
-
*/
|
4495
|
-
onClose: PropTypes.func,
|
4496
|
-
/**
|
4497
|
-
* Callback fired when the component requests to be opened.
|
4498
|
-
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select expands).
|
4499
|
-
*
|
4500
|
-
* @param {object} event The event source of the callback.
|
4501
|
-
*/
|
4502
|
-
onOpen: PropTypes.func,
|
4503
|
-
/**
|
4504
|
-
* If `true`, the component is shown.
|
4505
|
-
* You can only use it when the `native` prop is `false` (default).
|
4506
|
-
*/
|
4507
|
-
open: PropTypes.bool,
|
4508
|
-
/**
|
4509
|
-
* Render the selected value.
|
4510
|
-
* You can only use it when the `native` prop is `false` (default).
|
4511
|
-
*
|
4512
|
-
* @param {any} value The `value` provided to the component.
|
4513
|
-
* @returns {ReactNode}
|
4514
|
-
*/
|
4515
|
-
renderValue: PropTypes.func,
|
4516
|
-
/**
|
4517
|
-
* Props applied to the clickable div element.
|
4518
|
-
*/
|
4519
|
-
SelectDisplayProps: PropTypes.object,
|
4520
|
-
/**
|
4521
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
4522
|
-
*/
|
4523
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
4524
|
-
/**
|
4525
|
-
* The `input` value. Providing an empty string will select no options.
|
4526
|
-
* Set to an empty string `''` if you don't want any of the available options to be selected.
|
4527
|
-
*
|
4528
|
-
* If the value is an object it must have reference equality with the option in order to be selected.
|
4529
|
-
* If the value is not an object, the string representation must match with the string representation of the option in order to be selected.
|
4530
|
-
*/
|
4531
|
-
value: PropTypes.oneOfType([PropTypes.oneOf([""]), PropTypes.any]),
|
4532
|
-
/**
|
4533
|
-
* The variant to use.
|
4534
|
-
* @default 'outlined'
|
4535
|
-
*/
|
4536
|
-
variant: PropTypes.oneOf(["filled", "outlined", "standard"])
|
4537
|
-
} : void 0;
|
4538
|
-
Select.muiName = "Select";
|
4539
|
-
function Hamburger({ fill }) {
|
4540
|
-
return /* @__PURE__ */ jsxs("svg", { width: "23", height: "17", viewBox: "0 0 23 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
4541
|
-
/* @__PURE__ */ jsx("path", { d: "M1.25781 1.98389H21.6779", stroke: fill, "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }),
|
4542
|
-
/* @__PURE__ */ jsx("path", { d: "M1.25781 8.98828H21.6779", stroke: fill, "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }),
|
4543
|
-
/* @__PURE__ */ jsx("path", { d: "M1.25781 15.9937H21.6779", stroke: fill, "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })
|
4544
|
-
] });
|
4545
|
-
}
|
4546
|
-
export {
|
4547
|
-
FormControlContext as F,
|
4548
|
-
Hamburger as H,
|
4549
|
-
Input as I,
|
4550
|
-
ListContext as L,
|
4551
|
-
Menu as M,
|
4552
|
-
OutlinedInput as O,
|
4553
|
-
Paper as P,
|
4554
|
-
Select as S,
|
4555
|
-
MenuList as a,
|
4556
|
-
isFilled as b,
|
4557
|
-
FilledInput as c,
|
4558
|
-
List as d,
|
4559
|
-
formControlState as f,
|
4560
|
-
isAdornedStart as i,
|
4561
|
-
useFormControl as u
|
4562
|
-
};
|