@mui/material 5.3.0 → 5.4.2
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/Autocomplete/Autocomplete.d.ts +5 -0
- package/Autocomplete/Autocomplete.js +12 -4
- package/AvatarGroup/AvatarGroup.d.ts +10 -0
- package/AvatarGroup/AvatarGroup.js +19 -7
- package/Badge/Badge.js +3 -2
- package/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/Button/buttonClasses.d.ts +1 -1
- package/ButtonBase/ButtonBase.d.ts +5 -1
- package/ButtonBase/ButtonBase.js +15 -2
- package/ButtonBase/TouchRipple.js +1 -2
- package/CHANGELOG.md +300 -28
- package/Fab/Fab.d.ts +4 -1
- package/Fab/Fab.js +8 -20
- package/Fab/fabClasses.js +1 -1
- package/FormControlLabel/FormControlLabel.js +11 -3
- package/FormControlLabel/formControlLabelClasses.d.ts +2 -0
- package/FormControlLabel/formControlLabelClasses.js +1 -1
- package/FormGroup/FormGroup.js +14 -3
- package/FormGroup/formGroupClasses.d.ts +2 -0
- package/FormGroup/formGroupClasses.js +1 -1
- package/FormHelperText/FormHelperText.js +7 -9
- package/Grid/Grid.js +2 -4
- package/ImageList/ImageList.js +3 -1
- package/InputAdornment/InputAdornment.js +6 -9
- package/Modal/Modal.js +1 -1
- package/OutlinedInput/NotchedOutline.js +14 -16
- package/OutlinedInput/OutlinedInput.js +1 -1
- package/README.md +6 -6
- package/Radio/RadioButtonIcon.js +2 -6
- package/Rating/Rating.js +1 -1
- package/Select/Select.js +19 -7
- package/Select/SelectInput.js +12 -10
- package/Slider/Slider.js +3 -1
- package/Snackbar/Snackbar.js +4 -1
- package/SvgIcon/SvgIcon.js +9 -9
- package/SwipeableDrawer/SwipeArea.js +1 -3
- package/TextField/TextField.js +1 -1
- package/ToggleButton/ToggleButton.d.ts +15 -0
- package/ToggleButton/ToggleButton.js +8 -2
- package/index.d.ts +11 -3
- package/index.js +8 -3
- package/internal/SwitchBase.js +2 -6
- package/legacy/Autocomplete/Autocomplete.js +13 -4
- package/legacy/AvatarGroup/AvatarGroup.js +20 -7
- package/legacy/Badge/Badge.js +4 -2
- package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/legacy/ButtonBase/ButtonBase.js +15 -2
- package/legacy/ButtonBase/TouchRipple.js +1 -2
- package/legacy/Fab/Fab.js +8 -20
- package/legacy/Fab/fabClasses.js +1 -1
- package/legacy/FormControlLabel/FormControlLabel.js +11 -3
- package/legacy/FormControlLabel/formControlLabelClasses.js +1 -1
- package/legacy/FormGroup/FormGroup.js +14 -3
- package/legacy/FormGroup/formGroupClasses.js +1 -1
- package/legacy/FormHelperText/FormHelperText.js +7 -9
- package/legacy/Grid/Grid.js +2 -4
- package/legacy/ImageList/ImageList.js +3 -1
- package/legacy/InputAdornment/InputAdornment.js +6 -9
- package/legacy/Modal/Modal.js +1 -1
- package/legacy/OutlinedInput/NotchedOutline.js +14 -16
- package/legacy/OutlinedInput/OutlinedInput.js +1 -1
- package/legacy/Radio/RadioButtonIcon.js +2 -6
- package/legacy/Rating/Rating.js +1 -1
- package/legacy/Select/Select.js +23 -7
- package/legacy/Select/SelectInput.js +12 -10
- package/legacy/Slider/Slider.js +3 -1
- package/legacy/Snackbar/Snackbar.js +4 -1
- package/legacy/SvgIcon/SvgIcon.js +9 -9
- package/legacy/SwipeableDrawer/SwipeArea.js +1 -3
- package/legacy/TextField/TextField.js +1 -1
- package/legacy/ToggleButton/ToggleButton.js +8 -2
- package/legacy/index.js +8 -3
- package/legacy/internal/SwitchBase.js +2 -6
- package/legacy/styles/makeStyles.js +1 -1
- package/legacy/styles/withStyles.js +1 -1
- package/legacy/styles/withTheme.js +1 -1
- package/legacy/useMediaQuery/useMediaQuery.js +87 -32
- package/modern/Autocomplete/Autocomplete.js +12 -4
- package/modern/AvatarGroup/AvatarGroup.js +17 -7
- package/modern/Badge/Badge.js +3 -2
- package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/modern/ButtonBase/ButtonBase.js +15 -2
- package/modern/ButtonBase/TouchRipple.js +1 -2
- package/modern/Fab/Fab.js +8 -20
- package/modern/Fab/fabClasses.js +1 -1
- package/modern/FormControlLabel/FormControlLabel.js +11 -3
- package/modern/FormControlLabel/formControlLabelClasses.js +1 -1
- package/modern/FormGroup/FormGroup.js +14 -3
- package/modern/FormGroup/formGroupClasses.js +1 -1
- package/modern/FormHelperText/FormHelperText.js +7 -9
- package/modern/Grid/Grid.js +2 -4
- package/modern/ImageList/ImageList.js +3 -1
- package/modern/InputAdornment/InputAdornment.js +6 -9
- package/modern/Modal/Modal.js +1 -1
- package/modern/OutlinedInput/NotchedOutline.js +14 -16
- package/modern/OutlinedInput/OutlinedInput.js +1 -1
- package/modern/Radio/RadioButtonIcon.js +2 -6
- package/modern/Rating/Rating.js +1 -1
- package/modern/Select/Select.js +19 -7
- package/modern/Select/SelectInput.js +12 -10
- package/modern/Slider/Slider.js +3 -1
- package/modern/Snackbar/Snackbar.js +4 -1
- package/modern/SvgIcon/SvgIcon.js +8 -8
- package/modern/SwipeableDrawer/SwipeArea.js +1 -3
- package/modern/TextField/TextField.js +1 -1
- package/modern/ToggleButton/ToggleButton.js +8 -2
- package/modern/index.js +8 -3
- package/modern/internal/SwitchBase.js +2 -6
- package/modern/styles/makeStyles.js +1 -1
- package/modern/styles/withStyles.js +1 -1
- package/modern/styles/withTheme.js +1 -1
- package/modern/useMediaQuery/useMediaQuery.js +69 -27
- package/node/Autocomplete/Autocomplete.js +12 -4
- package/node/AvatarGroup/AvatarGroup.js +19 -7
- package/node/Badge/Badge.js +3 -2
- package/node/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
- package/node/ButtonBase/ButtonBase.js +15 -2
- package/node/ButtonBase/TouchRipple.js +1 -2
- package/node/Fab/Fab.js +8 -20
- package/node/Fab/fabClasses.js +1 -1
- package/node/FormControlLabel/FormControlLabel.js +12 -3
- package/node/FormControlLabel/formControlLabelClasses.js +1 -1
- package/node/FormGroup/FormGroup.js +15 -3
- package/node/FormGroup/formGroupClasses.js +1 -1
- package/node/FormHelperText/FormHelperText.js +6 -9
- package/node/Grid/Grid.js +2 -4
- package/node/ImageList/ImageList.js +3 -1
- package/node/InputAdornment/InputAdornment.js +5 -9
- package/node/Modal/Modal.js +1 -1
- package/node/OutlinedInput/NotchedOutline.js +12 -16
- package/node/OutlinedInput/OutlinedInput.js +1 -1
- package/node/Radio/RadioButtonIcon.js +2 -6
- package/node/Rating/Rating.js +1 -1
- package/node/Select/Select.js +22 -9
- package/node/Select/SelectInput.js +11 -10
- package/node/Slider/Slider.js +3 -1
- package/node/Snackbar/Snackbar.js +4 -1
- package/node/SvgIcon/SvgIcon.js +9 -9
- package/node/SwipeableDrawer/SwipeArea.js +1 -3
- package/node/TextField/TextField.js +1 -1
- package/node/ToggleButton/ToggleButton.js +8 -2
- package/node/index.js +62 -16
- package/node/internal/SwitchBase.js +2 -6
- package/node/styles/makeStyles.js +1 -1
- package/node/styles/withStyles.js +1 -1
- package/node/styles/withTheme.js +1 -1
- package/node/useMediaQuery/useMediaQuery.js +69 -27
- package/package.json +8 -8
- package/styles/ThemeProvider.d.ts +1 -1
- package/styles/index.d.ts +3 -0
- package/styles/makeStyles.js +1 -1
- package/styles/withStyles.js +1 -1
- package/styles/withTheme.js +1 -1
- package/umd/material-ui.development.js +5056 -7204
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +4 -0
- package/useMediaQuery/useMediaQuery.js +69 -27
|
@@ -200,12 +200,18 @@ process.env.NODE_ENV !== "production" ? ToggleButton.propTypes
|
|
|
200
200
|
fullWidth: PropTypes.bool,
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
|
-
*
|
|
203
|
+
* Callback fired when the state changes.
|
|
204
|
+
*
|
|
205
|
+
* @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
|
|
206
|
+
* @param {any} value of the selected button.
|
|
204
207
|
*/
|
|
205
208
|
onChange: PropTypes.func,
|
|
206
209
|
|
|
207
210
|
/**
|
|
208
|
-
*
|
|
211
|
+
* Callback fired when the button is clicked.
|
|
212
|
+
*
|
|
213
|
+
* @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
|
|
214
|
+
* @param {any} value of the selected button.
|
|
209
215
|
*/
|
|
210
216
|
onClick: PropTypes.func,
|
|
211
217
|
|
package/modern/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.4.2
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -8,7 +8,6 @@ import * as colors from './colors';
|
|
|
8
8
|
export { colors };
|
|
9
9
|
export * from './styles';
|
|
10
10
|
export * from './utils';
|
|
11
|
-
export * from '@mui/base';
|
|
12
11
|
export { default as Accordion } from './Accordion';
|
|
13
12
|
export * from './Accordion';
|
|
14
13
|
export { default as AccordionActions } from './AccordionActions';
|
|
@@ -175,6 +174,8 @@ export { default as Popover } from './Popover';
|
|
|
175
174
|
export * from './Popover';
|
|
176
175
|
export { default as Popper } from './Popper';
|
|
177
176
|
export * from './Popper';
|
|
177
|
+
export { default as Portal } from './Portal';
|
|
178
|
+
export * from './Portal';
|
|
178
179
|
export { default as Radio } from './Radio';
|
|
179
180
|
export * from './Radio';
|
|
180
181
|
export { default as RadioGroup } from './RadioGroup';
|
|
@@ -273,4 +274,8 @@ export * from './Zoom'; // createFilterOptions is exported from Autocomplete
|
|
|
273
274
|
export { default as useAutocomplete } from './useAutocomplete';
|
|
274
275
|
export { default as GlobalStyles } from './GlobalStyles';
|
|
275
276
|
export * from './GlobalStyles';
|
|
276
|
-
export { StyledEngineProvider } from './styles';
|
|
277
|
+
export { StyledEngineProvider } from './styles';
|
|
278
|
+
export { default as unstable_composeClasses } from '@mui/base/composeClasses';
|
|
279
|
+
export { default as generateUtilityClass } from '@mui/base/generateUtilityClass';
|
|
280
|
+
export * from '@mui/base/generateUtilityClass';
|
|
281
|
+
export { default as generateUtilityClasses } from '@mui/base/generateUtilityClasses';
|
|
@@ -29,9 +29,7 @@ const useUtilityClasses = ownerState => {
|
|
|
29
29
|
return composeClasses(slots, getSwitchBaseUtilityClass, classes);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const SwitchBaseRoot = styled(ButtonBase
|
|
33
|
-
skipSx: true
|
|
34
|
-
})(({
|
|
32
|
+
const SwitchBaseRoot = styled(ButtonBase)(({
|
|
35
33
|
ownerState
|
|
36
34
|
}) => _extends({
|
|
37
35
|
padding: 9,
|
|
@@ -41,9 +39,7 @@ const SwitchBaseRoot = styled(ButtonBase, {
|
|
|
41
39
|
}, ownerState.edge === 'end' && {
|
|
42
40
|
marginRight: ownerState.size === 'small' ? -3 : -12
|
|
43
41
|
}));
|
|
44
|
-
const SwitchBaseInput = styled('input'
|
|
45
|
-
skipSx: true
|
|
46
|
-
})({
|
|
42
|
+
const SwitchBaseInput = styled('input')({
|
|
47
43
|
cursor: 'inherit',
|
|
48
44
|
position: 'absolute',
|
|
49
45
|
opacity: 0,
|
|
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
|
2
2
|
export default function makeStyles() {
|
|
3
3
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: makeStyles is not longer exported from @mui/material/styles.
|
|
4
4
|
You have to import it from @mui/styles.
|
|
5
|
-
See https://mui.com/r/migration-v4/#material-
|
|
5
|
+
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(14));
|
|
6
6
|
}
|
|
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
|
2
2
|
export default function withStyles() {
|
|
3
3
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withStyles is not longer exported from @mui/material/styles.
|
|
4
4
|
You have to import it from @mui/styles.
|
|
5
|
-
See https://mui.com/r/migration-v4/#material-
|
|
5
|
+
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(15));
|
|
6
6
|
}
|
|
@@ -2,5 +2,5 @@ import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
|
2
2
|
export default function withTheme() {
|
|
3
3
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withTheme is not longer exported from @mui/material/styles.
|
|
4
4
|
You have to import it from @mui/styles.
|
|
5
|
-
See https://mui.com/r/migration-v4/#material-
|
|
5
|
+
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(16));
|
|
6
6
|
}
|
|
@@ -5,32 +5,8 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
|
5
5
|
* @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
const theme = useTheme(); // Wait for jsdom to support the match media feature.
|
|
10
|
-
// All the browsers MUI support have this built-in.
|
|
11
|
-
// This defensive check is here for simplicity.
|
|
12
|
-
// Most of the time, the match media logic isn't central to people tests.
|
|
13
|
-
|
|
8
|
+
function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
|
|
14
9
|
const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
|
15
|
-
const {
|
|
16
|
-
defaultMatches = false,
|
|
17
|
-
matchMedia = supportMatchMedia ? window.matchMedia : null,
|
|
18
|
-
noSsr = false,
|
|
19
|
-
ssrMatchMedia = null
|
|
20
|
-
} = getThemeProps({
|
|
21
|
-
name: 'MuiUseMediaQuery',
|
|
22
|
-
props: options,
|
|
23
|
-
theme
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
27
|
-
if (typeof queryInput === 'function' && theme === null) {
|
|
28
|
-
console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
33
|
-
query = query.replace(/^@media( ?)/m, '');
|
|
34
10
|
const [match, setMatch] = React.useState(() => {
|
|
35
11
|
if (noSsr && supportMatchMedia) {
|
|
36
12
|
return matchMedia(query).matches;
|
|
@@ -56,19 +32,85 @@ export default function useMediaQuery(queryInput, options = {}) {
|
|
|
56
32
|
const updateMatch = () => {
|
|
57
33
|
// Workaround Safari wrong implementation of matchMedia
|
|
58
34
|
// TODO can we remove it?
|
|
59
|
-
// https://github.com/mui
|
|
35
|
+
// https://github.com/mui/material-ui/pull/17315#issuecomment-528286677
|
|
60
36
|
if (active) {
|
|
61
37
|
setMatch(queryList.matches);
|
|
62
38
|
}
|
|
63
39
|
};
|
|
64
40
|
|
|
65
|
-
updateMatch();
|
|
41
|
+
updateMatch(); // TODO: Use `addEventListener` once support for Safari < 14 is dropped
|
|
42
|
+
|
|
66
43
|
queryList.addListener(updateMatch);
|
|
67
44
|
return () => {
|
|
68
45
|
active = false;
|
|
69
46
|
queryList.removeListener(updateMatch);
|
|
70
47
|
};
|
|
71
48
|
}, [query, matchMedia, supportMatchMedia]);
|
|
49
|
+
return match;
|
|
50
|
+
} // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
const maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];
|
|
54
|
+
|
|
55
|
+
function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
|
|
56
|
+
const getDefaultSnapshot = React.useCallback(() => defaultMatches, [defaultMatches]);
|
|
57
|
+
const getServerSnapshot = React.useMemo(() => {
|
|
58
|
+
if (ssrMatchMedia !== null) {
|
|
59
|
+
const {
|
|
60
|
+
matches
|
|
61
|
+
} = ssrMatchMedia(query);
|
|
62
|
+
return () => matches;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return getDefaultSnapshot;
|
|
66
|
+
}, [getDefaultSnapshot, query, ssrMatchMedia]);
|
|
67
|
+
const [getSnapshot, subscribe] = React.useMemo(() => {
|
|
68
|
+
if (matchMedia === null) {
|
|
69
|
+
return [getDefaultSnapshot, () => () => {}];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const mediaQueryList = matchMedia(query);
|
|
73
|
+
return [() => mediaQueryList.matches, notify => {
|
|
74
|
+
// TODO: Use `addEventListener` once support for Safari < 14 is dropped
|
|
75
|
+
mediaQueryList.addListener(notify);
|
|
76
|
+
return () => {
|
|
77
|
+
mediaQueryList.removeListener(notify);
|
|
78
|
+
};
|
|
79
|
+
}];
|
|
80
|
+
}, [getDefaultSnapshot, matchMedia, query]);
|
|
81
|
+
const match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
82
|
+
return match;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default function useMediaQuery(queryInput, options = {}) {
|
|
86
|
+
const theme = useTheme(); // Wait for jsdom to support the match media feature.
|
|
87
|
+
// All the browsers MUI support have this built-in.
|
|
88
|
+
// This defensive check is here for simplicity.
|
|
89
|
+
// Most of the time, the match media logic isn't central to people tests.
|
|
90
|
+
|
|
91
|
+
const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
|
92
|
+
const {
|
|
93
|
+
defaultMatches = false,
|
|
94
|
+
matchMedia = supportMatchMedia ? window.matchMedia : null,
|
|
95
|
+
ssrMatchMedia = null,
|
|
96
|
+
noSsr
|
|
97
|
+
} = getThemeProps({
|
|
98
|
+
name: 'MuiUseMediaQuery',
|
|
99
|
+
props: options,
|
|
100
|
+
theme
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
104
|
+
if (typeof queryInput === 'function' && theme === null) {
|
|
105
|
+
console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
110
|
+
query = query.replace(/^@media( ?)/m, ''); // TODO: Drop `useMediaQueryOld` and use `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable
|
|
111
|
+
|
|
112
|
+
const useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;
|
|
113
|
+
const match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);
|
|
72
114
|
|
|
73
115
|
if (process.env.NODE_ENV !== 'production') {
|
|
74
116
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -63,7 +63,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
63
63
|
|
|
64
64
|
var _ClearIcon, _ArrowDropDownIcon;
|
|
65
65
|
|
|
66
|
-
const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"];
|
|
66
|
+
const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"];
|
|
67
67
|
|
|
68
68
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
69
69
|
|
|
@@ -444,6 +444,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
444
444
|
PaperComponent = _Paper.default,
|
|
445
445
|
PopperComponent = _Popper.default,
|
|
446
446
|
popupIcon = _ArrowDropDownIcon || (_ArrowDropDownIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_ArrowDropDown.default, {})),
|
|
447
|
+
readOnly = false,
|
|
447
448
|
renderGroup: renderGroupProp,
|
|
448
449
|
renderInput,
|
|
449
450
|
renderOption: renderOptionProp,
|
|
@@ -476,7 +477,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
476
477
|
} = (0, _base.useAutocomplete)((0, _extends2.default)({}, props, {
|
|
477
478
|
componentName: 'Autocomplete'
|
|
478
479
|
}));
|
|
479
|
-
const hasClearIcon = !disableClearable && !disabled && dirty;
|
|
480
|
+
const hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
|
|
480
481
|
const hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
|
|
481
482
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
482
483
|
disablePortal,
|
|
@@ -593,7 +594,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
593
594
|
},
|
|
594
595
|
inputProps: (0, _extends2.default)({
|
|
595
596
|
className: (0, _clsx.default)(classes.input),
|
|
596
|
-
disabled
|
|
597
|
+
disabled,
|
|
598
|
+
readOnly
|
|
597
599
|
}, getInputProps())
|
|
598
600
|
})
|
|
599
601
|
})), popupOpen && anchorEl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AutocompletePopper, {
|
|
@@ -712,7 +714,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
712
714
|
* If `true`, the input's text is cleared on blur if no value is selected.
|
|
713
715
|
*
|
|
714
716
|
* Set to `true` if you want to help the user enter a new value.
|
|
715
|
-
* Set to `false` if you want to help the user resume
|
|
717
|
+
* Set to `false` if you want to help the user resume their search.
|
|
716
718
|
* @default !props.freeSolo
|
|
717
719
|
*/
|
|
718
720
|
clearOnBlur: _propTypes.default.bool,
|
|
@@ -1034,6 +1036,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
1034
1036
|
*/
|
|
1035
1037
|
popupIcon: _propTypes.default.node,
|
|
1036
1038
|
|
|
1039
|
+
/**
|
|
1040
|
+
* If `true`, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.
|
|
1041
|
+
* @default false
|
|
1042
|
+
*/
|
|
1043
|
+
readOnly: _propTypes.default.bool,
|
|
1044
|
+
|
|
1037
1045
|
/**
|
|
1038
1046
|
* Render the group.
|
|
1039
1047
|
*
|
|
@@ -33,7 +33,7 @@ var _avatarGroupClasses = _interopRequireWildcard(require("./avatarGroupClasses"
|
|
|
33
33
|
|
|
34
34
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
35
35
|
|
|
36
|
-
const _excluded = ["children", "className", "max", "spacing", "total", "variant"];
|
|
36
|
+
const _excluded = ["children", "className", "componentsProps", "max", "spacing", "total", "variant"];
|
|
37
37
|
|
|
38
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
39
|
|
|
@@ -90,6 +90,8 @@ const AvatarGroupAvatar = (0, _styled.default)(_Avatar.default, {
|
|
|
90
90
|
}
|
|
91
91
|
}));
|
|
92
92
|
const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
|
|
93
|
+
var _componentsProps$addi, _componentsProps$addi2;
|
|
94
|
+
|
|
93
95
|
const props = (0, _useThemeProps.default)({
|
|
94
96
|
props: inProps,
|
|
95
97
|
name: 'MuiAvatarGroup'
|
|
@@ -97,6 +99,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
97
99
|
const {
|
|
98
100
|
children: childrenProp,
|
|
99
101
|
className,
|
|
102
|
+
componentsProps = {},
|
|
100
103
|
max = 5,
|
|
101
104
|
spacing = 'medium',
|
|
102
105
|
total,
|
|
@@ -134,15 +137,16 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
134
137
|
className: (0, _clsx.default)(classes.root, className),
|
|
135
138
|
ref: ref
|
|
136
139
|
}, other, {
|
|
137
|
-
children: [extraAvatars ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(AvatarGroupAvatar, {
|
|
140
|
+
children: [extraAvatars ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(AvatarGroupAvatar, (0, _extends2.default)({
|
|
138
141
|
ownerState: ownerState,
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
variant: variant
|
|
143
|
+
}, componentsProps.additionalAvatar, {
|
|
144
|
+
className: (0, _clsx.default)(classes.avatar, (_componentsProps$addi = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi.className),
|
|
145
|
+
style: (0, _extends2.default)({
|
|
141
146
|
marginLeft
|
|
142
|
-
},
|
|
143
|
-
variant: variant,
|
|
147
|
+
}, (_componentsProps$addi2 = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi2.style),
|
|
144
148
|
children: ["+", extraAvatars]
|
|
145
|
-
}) : null, children.slice(0, maxAvatars).reverse().map(child => {
|
|
149
|
+
})) : null, children.slice(0, maxAvatars).reverse().map(child => {
|
|
146
150
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
147
151
|
className: (0, _clsx.default)(child.props.className, classes.avatar),
|
|
148
152
|
style: (0, _extends2.default)({
|
|
@@ -176,6 +180,14 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
176
180
|
*/
|
|
177
181
|
className: _propTypes.default.string,
|
|
178
182
|
|
|
183
|
+
/**
|
|
184
|
+
* The props used for each slot inside the AvatarGroup.
|
|
185
|
+
* @default {}
|
|
186
|
+
*/
|
|
187
|
+
componentsProps: _propTypes.default.shape({
|
|
188
|
+
additionalAvatar: _propTypes.default.object
|
|
189
|
+
}),
|
|
190
|
+
|
|
179
191
|
/**
|
|
180
192
|
* Max avatars to show before +x.
|
|
181
193
|
* @default 5
|
package/node/Badge/Badge.js
CHANGED
|
@@ -198,7 +198,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
198
198
|
componentsProps = {},
|
|
199
199
|
overlap: overlapProp = 'rectangular',
|
|
200
200
|
color: colorProp = 'default',
|
|
201
|
-
invisible: invisibleProp,
|
|
201
|
+
invisible: invisibleProp = false,
|
|
202
202
|
badgeContent: badgeContentProp,
|
|
203
203
|
showZero = false,
|
|
204
204
|
variant: variantProp = 'standard'
|
|
@@ -211,7 +211,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
211
211
|
});
|
|
212
212
|
let invisible = invisibleProp;
|
|
213
213
|
|
|
214
|
-
if (invisibleProp
|
|
214
|
+
if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {
|
|
215
215
|
invisible = true;
|
|
216
216
|
}
|
|
217
217
|
|
|
@@ -327,6 +327,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
327
327
|
|
|
328
328
|
/**
|
|
329
329
|
* If `true`, the badge is invisible.
|
|
330
|
+
* @default false
|
|
330
331
|
*/
|
|
331
332
|
invisible: _propTypes.default.bool,
|
|
332
333
|
|
|
@@ -27,9 +27,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
27
|
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
|
|
30
|
-
const BreadcrumbCollapsedButton = (0, _styled.default)(_ButtonBase.default
|
|
31
|
-
skipSx: true
|
|
32
|
-
})(({
|
|
30
|
+
const BreadcrumbCollapsedButton = (0, _styled.default)(_ButtonBase.default)(({
|
|
33
31
|
theme
|
|
34
32
|
}) => (0, _extends2.default)({
|
|
35
33
|
display: 'flex',
|
|
@@ -37,7 +37,7 @@ var _buttonBaseClasses = _interopRequireWildcard(require("./buttonBaseClasses"))
|
|
|
37
37
|
|
|
38
38
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
39
39
|
|
|
40
|
-
const _excluded = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "type"];
|
|
40
|
+
const _excluded = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"];
|
|
41
41
|
|
|
42
42
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
43
43
|
|
|
@@ -145,11 +145,13 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
145
145
|
onTouchStart,
|
|
146
146
|
tabIndex = 0,
|
|
147
147
|
TouchRippleProps,
|
|
148
|
+
touchRippleRef,
|
|
148
149
|
type
|
|
149
150
|
} = props,
|
|
150
151
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
151
152
|
const buttonRef = React.useRef(null);
|
|
152
153
|
const rippleRef = React.useRef(null);
|
|
154
|
+
const handleRippleRef = (0, _useForkRef.default)(rippleRef, touchRippleRef);
|
|
153
155
|
const {
|
|
154
156
|
isFocusVisibleRef,
|
|
155
157
|
onFocus: handleFocusVisible,
|
|
@@ -368,7 +370,7 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
368
370
|
|
|
369
371
|
/* TouchRipple is only needed client-side, x2 boost on the server. */
|
|
370
372
|
(0, _jsxRuntime.jsx)(_TouchRipple.default, (0, _extends2.default)({
|
|
371
|
-
ref:
|
|
373
|
+
ref: handleRippleRef,
|
|
372
374
|
center: centerRipple
|
|
373
375
|
}, TouchRippleProps)) : null]
|
|
374
376
|
}));
|
|
@@ -551,6 +553,17 @@ process.env.NODE_ENV !== "production" ? ButtonBase.propTypes
|
|
|
551
553
|
*/
|
|
552
554
|
TouchRippleProps: _propTypes.default.object,
|
|
553
555
|
|
|
556
|
+
/**
|
|
557
|
+
* A ref that points to the `TouchRippple` element.
|
|
558
|
+
*/
|
|
559
|
+
touchRippleRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
560
|
+
current: _propTypes.default.shape({
|
|
561
|
+
pulsate: _propTypes.default.func.isRequired,
|
|
562
|
+
start: _propTypes.default.func.isRequired,
|
|
563
|
+
stop: _propTypes.default.func.isRequired
|
|
564
|
+
})
|
|
565
|
+
})]),
|
|
566
|
+
|
|
554
567
|
/**
|
|
555
568
|
* @ignore
|
|
556
569
|
*/
|
package/node/Fab/Fab.js
CHANGED
|
@@ -45,7 +45,7 @@ const useUtilityClasses = ownerState => {
|
|
|
45
45
|
size
|
|
46
46
|
} = ownerState;
|
|
47
47
|
const slots = {
|
|
48
|
-
root: ['root', variant, `size${(0, _capitalize.default)(size)}`, color === 'inherit'
|
|
48
|
+
root: ['root', variant, `size${(0, _capitalize.default)(size)}`, color === 'inherit' ? 'colorInherit' : color]
|
|
49
49
|
};
|
|
50
50
|
return (0, _base.unstable_composeClasses)(slots, _fabClasses.getFabUtilityClass, classes);
|
|
51
51
|
};
|
|
@@ -57,7 +57,7 @@ const FabRoot = (0, _styled.default)(_ButtonBase.default, {
|
|
|
57
57
|
const {
|
|
58
58
|
ownerState
|
|
59
59
|
} = props;
|
|
60
|
-
return [styles.root, styles[ownerState.variant], styles[`size${(0, _capitalize.default)(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit,
|
|
60
|
+
return [styles.root, styles[ownerState.variant], styles[`size${(0, _capitalize.default)(ownerState.size)}`], ownerState.color === 'inherit' && styles.colorInherit, styles[(0, _capitalize.default)(ownerState.size)], styles[ownerState.color]];
|
|
61
61
|
}
|
|
62
62
|
})(({
|
|
63
63
|
theme,
|
|
@@ -124,24 +124,14 @@ const FabRoot = (0, _styled.default)(_ButtonBase.default, {
|
|
|
124
124
|
}), ({
|
|
125
125
|
theme,
|
|
126
126
|
ownerState
|
|
127
|
-
}) => (0, _extends2.default)({}, ownerState.color
|
|
128
|
-
color: theme.palette.
|
|
129
|
-
backgroundColor: theme.palette.
|
|
127
|
+
}) => (0, _extends2.default)({}, ownerState.color !== 'inherit' && ownerState.color !== 'default' && theme.palette[ownerState.color] != null && {
|
|
128
|
+
color: theme.palette[ownerState.color].contrastText,
|
|
129
|
+
backgroundColor: theme.palette[ownerState.color].main,
|
|
130
130
|
'&:hover': {
|
|
131
|
-
backgroundColor: theme.palette.
|
|
131
|
+
backgroundColor: theme.palette[ownerState.color].dark,
|
|
132
132
|
// Reset on touch devices, it doesn't add specificity
|
|
133
133
|
'@media (hover: none)': {
|
|
134
|
-
backgroundColor: theme.palette.
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}, ownerState.color === 'secondary' && {
|
|
138
|
-
color: theme.palette.secondary.contrastText,
|
|
139
|
-
backgroundColor: theme.palette.secondary.main,
|
|
140
|
-
'&:hover': {
|
|
141
|
-
backgroundColor: theme.palette.secondary.dark,
|
|
142
|
-
// Reset on touch devices, it doesn't add specificity
|
|
143
|
-
'@media (hover: none)': {
|
|
144
|
-
backgroundColor: theme.palette.secondary.main
|
|
134
|
+
backgroundColor: theme.palette[ownerState.color].main
|
|
145
135
|
}
|
|
146
136
|
}
|
|
147
137
|
}));
|
|
@@ -210,9 +200,7 @@ process.env.NODE_ENV !== "production" ? Fab.propTypes
|
|
|
210
200
|
* The color of the component. It supports those theme colors that make sense for this component.
|
|
211
201
|
* @default 'default'
|
|
212
202
|
*/
|
|
213
|
-
color: _propTypes.default
|
|
214
|
-
/* @typescript-to-proptypes-ignore */
|
|
215
|
-
.oneOfType([_propTypes.default.oneOf(['default', 'inherit', 'primary', 'secondary']), _propTypes.default.string]),
|
|
203
|
+
color: _propTypes.default.oneOf(['default', 'error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
|
|
216
204
|
|
|
217
205
|
/**
|
|
218
206
|
* The component used for the root node.
|
package/node/Fab/fabClasses.js
CHANGED
|
@@ -12,6 +12,6 @@ function getFabUtilityClass(slot) {
|
|
|
12
12
|
return (0, _base.generateUtilityClass)('MuiFab', slot);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const fabClasses = (0, _base.generateUtilityClasses)('MuiFab', ['root', 'primary', 'secondary', 'extended', 'circular', 'focusVisible', 'disabled', 'colorInherit', 'sizeSmall', 'sizeMedium', 'sizeLarge']);
|
|
15
|
+
const fabClasses = (0, _base.generateUtilityClasses)('MuiFab', ['root', 'primary', 'secondary', 'extended', 'circular', 'focusVisible', 'disabled', 'colorInherit', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'info', 'error', 'warning', 'success']);
|
|
16
16
|
var _default = fabClasses;
|
|
17
17
|
exports.default = _default;
|
|
@@ -33,6 +33,8 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
33
33
|
|
|
34
34
|
var _formControlLabelClasses = _interopRequireWildcard(require("./formControlLabelClasses"));
|
|
35
35
|
|
|
36
|
+
var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
|
|
37
|
+
|
|
36
38
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
37
39
|
|
|
38
40
|
const _excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "value"];
|
|
@@ -45,10 +47,11 @@ const useUtilityClasses = ownerState => {
|
|
|
45
47
|
const {
|
|
46
48
|
classes,
|
|
47
49
|
disabled,
|
|
48
|
-
labelPlacement
|
|
50
|
+
labelPlacement,
|
|
51
|
+
error
|
|
49
52
|
} = ownerState;
|
|
50
53
|
const slots = {
|
|
51
|
-
root: ['root', disabled && 'disabled', `labelPlacement${(0, _capitalize.default)(labelPlacement)}
|
|
54
|
+
root: ['root', disabled && 'disabled', `labelPlacement${(0, _capitalize.default)(labelPlacement)}`, error && 'error'],
|
|
52
55
|
label: ['label', disabled && 'disabled']
|
|
53
56
|
};
|
|
54
57
|
return (0, _base.unstable_composeClasses)(slots, _formControlLabelClasses.getFormControlLabelUtilityClasses, classes);
|
|
@@ -139,10 +142,16 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
|
|
|
139
142
|
controlProps[key] = props[key];
|
|
140
143
|
}
|
|
141
144
|
});
|
|
145
|
+
const fcs = (0, _formControlState.default)({
|
|
146
|
+
props,
|
|
147
|
+
muiFormControl,
|
|
148
|
+
states: ['error']
|
|
149
|
+
});
|
|
142
150
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
143
151
|
disabled,
|
|
144
152
|
label,
|
|
145
|
-
labelPlacement
|
|
153
|
+
labelPlacement,
|
|
154
|
+
error: fcs.error
|
|
146
155
|
});
|
|
147
156
|
const classes = useUtilityClasses(ownerState);
|
|
148
157
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(FormControlLabelRoot, (0, _extends2.default)({
|
|
@@ -12,6 +12,6 @@ function getFormControlLabelUtilityClasses(slot) {
|
|
|
12
12
|
return (0, _base.generateUtilityClass)('MuiFormControlLabel', slot);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const formControlLabelClasses = (0, _base.generateUtilityClasses)('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label']);
|
|
15
|
+
const formControlLabelClasses = (0, _base.generateUtilityClasses)('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error']);
|
|
16
16
|
var _default = formControlLabelClasses;
|
|
17
17
|
exports.default = _default;
|
|
@@ -25,6 +25,10 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
25
25
|
|
|
26
26
|
var _formGroupClasses = require("./formGroupClasses");
|
|
27
27
|
|
|
28
|
+
var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
|
|
29
|
+
|
|
30
|
+
var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
|
|
31
|
+
|
|
28
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
33
|
|
|
30
34
|
const _excluded = ["className", "row"];
|
|
@@ -36,10 +40,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
36
40
|
const useUtilityClasses = ownerState => {
|
|
37
41
|
const {
|
|
38
42
|
classes,
|
|
39
|
-
row
|
|
43
|
+
row,
|
|
44
|
+
error
|
|
40
45
|
} = ownerState;
|
|
41
46
|
const slots = {
|
|
42
|
-
root: ['root', row && 'row']
|
|
47
|
+
root: ['root', row && 'row', error && 'error']
|
|
43
48
|
};
|
|
44
49
|
return (0, _base.unstable_composeClasses)(slots, _formGroupClasses.getFormGroupUtilityClass, classes);
|
|
45
50
|
};
|
|
@@ -78,8 +83,15 @@ const FormGroup = /*#__PURE__*/React.forwardRef(function FormGroup(inProps, ref)
|
|
|
78
83
|
row = false
|
|
79
84
|
} = props,
|
|
80
85
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
86
|
+
const muiFormControl = (0, _useFormControl.default)();
|
|
87
|
+
const fcs = (0, _formControlState.default)({
|
|
88
|
+
props,
|
|
89
|
+
muiFormControl,
|
|
90
|
+
states: ['error']
|
|
91
|
+
});
|
|
81
92
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
82
|
-
row
|
|
93
|
+
row,
|
|
94
|
+
error: fcs.error
|
|
83
95
|
});
|
|
84
96
|
const classes = useUtilityClasses(ownerState);
|
|
85
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormGroupRoot, (0, _extends2.default)({
|
|
@@ -12,6 +12,6 @@ function getFormGroupUtilityClass(slot) {
|
|
|
12
12
|
return (0, _base.generateUtilityClass)('MuiFormGroup', slot);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const formGroupClasses = (0, _base.generateUtilityClasses)('MuiFormGroup', ['root', 'row']);
|
|
15
|
+
const formGroupClasses = (0, _base.generateUtilityClasses)('MuiFormGroup', ['root', 'row', 'error']);
|
|
16
16
|
var _default = formGroupClasses;
|
|
17
17
|
exports.default = _default;
|
|
@@ -33,6 +33,8 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
|
33
33
|
|
|
34
34
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
35
35
|
|
|
36
|
+
var _span;
|
|
37
|
+
|
|
36
38
|
const _excluded = ["children", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"];
|
|
37
39
|
|
|
38
40
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -123,16 +125,11 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
|
|
|
123
125
|
className: (0, _clsx.default)(classes.root, className),
|
|
124
126
|
ref: ref
|
|
125
127
|
}, other, {
|
|
126
|
-
children: children === ' ' ?
|
|
127
|
-
/*#__PURE__*/
|
|
128
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
129
|
-
// eslint-disable-next-line react/no-danger
|
|
130
|
-
(0, _jsxRuntime.jsx)("span", {
|
|
128
|
+
children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
129
|
+
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
131
130
|
className: "notranslate",
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
}) : children
|
|
131
|
+
children: "\u200B"
|
|
132
|
+
})) : children
|
|
136
133
|
}));
|
|
137
134
|
});
|
|
138
135
|
process.env.NODE_ENV !== "production" ? FormHelperText.propTypes
|