@mui/material 5.2.8 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Autocomplete/Autocomplete.d.ts +7 -0
- package/Autocomplete/Autocomplete.js +20 -10
- package/AvatarGroup/AvatarGroup.d.ts +10 -0
- package/AvatarGroup/AvatarGroup.js +19 -7
- package/Badge/Badge.js +5 -8
- 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 +308 -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 +9 -9
- package/Radio/RadioButtonIcon.js +2 -6
- package/Rating/Rating.js +1 -1
- package/Select/Select.d.ts +9 -1
- package/Select/Select.js +10 -1
- package/Select/SelectInput.d.ts +1 -0
- package/Select/SelectInput.js +37 -14
- package/Slider/Slider.js +112 -55
- 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/index.d.ts +8 -3
- package/index.js +6 -3
- package/internal/SwitchBase.js +2 -6
- package/legacy/Autocomplete/Autocomplete.js +21 -10
- package/legacy/AvatarGroup/AvatarGroup.js +20 -7
- package/legacy/Badge/Badge.js +6 -8
- 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 +11 -1
- package/legacy/Select/SelectInput.js +41 -17
- package/legacy/Slider/Slider.js +113 -56
- 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/index.js +6 -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/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
- package/modern/Autocomplete/Autocomplete.js +19 -9
- package/modern/AvatarGroup/AvatarGroup.js +17 -7
- package/modern/Badge/Badge.js +5 -8
- 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 +10 -1
- package/modern/Select/SelectInput.js +37 -14
- package/modern/Slider/Slider.js +112 -55
- 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/index.js +6 -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/modern/utils/shouldSpreadAdditionalProps.js +7 -0
- package/node/Autocomplete/Autocomplete.js +20 -10
- package/node/AvatarGroup/AvatarGroup.js +19 -7
- package/node/Badge/Badge.js +7 -9
- 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 +10 -1
- package/node/Select/SelectInput.js +36 -14
- package/node/Slider/Slider.js +98 -47
- 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/index.js +41 -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/node/utils/shouldSpreadAdditionalProps.js +15 -0
- package/package.json +10 -10
- package/styles/ThemeProvider.d.ts +1 -1
- package/styles/components.d.ts +452 -113
- package/styles/createTheme.d.ts +12 -6
- package/styles/makeStyles.js +1 -1
- package/styles/overrides.d.ts +16 -4
- package/styles/useThemeProps.d.ts +2 -1
- package/styles/withStyles.js +1 -1
- package/styles/withTheme.js +1 -1
- package/umd/material-ui.development.js +5099 -7092
- package/umd/material-ui.production.min.js +21 -21
- package/useMediaQuery/useMediaQuery.d.ts +4 -0
- package/useMediaQuery/useMediaQuery.js +69 -27
- package/utils/shouldSpreadAdditionalProps.js +7 -0
|
@@ -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
|
|
|
@@ -389,7 +389,7 @@ const AutocompleteGroupUl = (0, _styled.default)('ul', {
|
|
|
389
389
|
}
|
|
390
390
|
});
|
|
391
391
|
const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps, ref) {
|
|
392
|
-
var _componentsProps$clea;
|
|
392
|
+
var _componentsProps$clea, _componentsProps$pape;
|
|
393
393
|
|
|
394
394
|
const props = (0, _useThemeProps.default)({
|
|
395
395
|
props: inProps,
|
|
@@ -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, {
|
|
@@ -607,10 +609,11 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
607
609
|
role: "presentation",
|
|
608
610
|
anchorEl: anchorEl,
|
|
609
611
|
open: true,
|
|
610
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(AutocompletePaper, {
|
|
611
|
-
as: PaperComponent,
|
|
612
|
-
className: classes.paper,
|
|
612
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(AutocompletePaper, (0, _extends2.default)({
|
|
613
613
|
ownerState: ownerState,
|
|
614
|
+
as: PaperComponent
|
|
615
|
+
}, componentsProps.paper, {
|
|
616
|
+
className: (0, _clsx.default)(classes.paper, (_componentsProps$pape = componentsProps.paper) == null ? void 0 : _componentsProps$pape.className),
|
|
614
617
|
children: [loading && groupedOptions.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AutocompleteLoading, {
|
|
615
618
|
className: classes.loading,
|
|
616
619
|
ownerState: ownerState,
|
|
@@ -641,7 +644,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
641
644
|
return renderListOption(option, index);
|
|
642
645
|
})
|
|
643
646
|
})) : null]
|
|
644
|
-
})
|
|
647
|
+
}))
|
|
645
648
|
}) : null]
|
|
646
649
|
});
|
|
647
650
|
});
|
|
@@ -711,7 +714,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
711
714
|
* If `true`, the input's text is cleared on blur if no value is selected.
|
|
712
715
|
*
|
|
713
716
|
* Set to `true` if you want to help the user enter a new value.
|
|
714
|
-
* 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.
|
|
715
718
|
* @default !props.freeSolo
|
|
716
719
|
*/
|
|
717
720
|
clearOnBlur: _propTypes.default.bool,
|
|
@@ -743,7 +746,8 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
743
746
|
* @default {}
|
|
744
747
|
*/
|
|
745
748
|
componentsProps: _propTypes.default.shape({
|
|
746
|
-
clearIndicator: _propTypes.default.object
|
|
749
|
+
clearIndicator: _propTypes.default.object,
|
|
750
|
+
paper: _propTypes.default.object
|
|
747
751
|
}),
|
|
748
752
|
|
|
749
753
|
/**
|
|
@@ -1032,6 +1036,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
1032
1036
|
*/
|
|
1033
1037
|
popupIcon: _propTypes.default.node,
|
|
1034
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
|
+
|
|
1035
1045
|
/**
|
|
1036
1046
|
* Render the group.
|
|
1037
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
|
@@ -27,6 +27,8 @@ var _styled = _interopRequireDefault(require("../styles/styled"));
|
|
|
27
27
|
|
|
28
28
|
var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
|
|
29
29
|
|
|
30
|
+
var _shouldSpreadAdditionalProps = _interopRequireDefault(require("../utils/shouldSpreadAdditionalProps"));
|
|
31
|
+
|
|
30
32
|
var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
31
33
|
|
|
32
34
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -179,11 +181,6 @@ const BadgeBadge = (0, _styled.default)('span', {
|
|
|
179
181
|
duration: theme.transitions.duration.leavingScreen
|
|
180
182
|
})
|
|
181
183
|
}));
|
|
182
|
-
|
|
183
|
-
const shouldSpreadAdditionalProps = Slot => {
|
|
184
|
-
return !Slot || !(0, _base.isHostComponent)(Slot);
|
|
185
|
-
};
|
|
186
|
-
|
|
187
184
|
const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
188
185
|
var _componentsProps$root, _componentsProps$badg;
|
|
189
186
|
|
|
@@ -201,7 +198,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
201
198
|
componentsProps = {},
|
|
202
199
|
overlap: overlapProp = 'rectangular',
|
|
203
200
|
color: colorProp = 'default',
|
|
204
|
-
invisible: invisibleProp,
|
|
201
|
+
invisible: invisibleProp = false,
|
|
205
202
|
badgeContent: badgeContentProp,
|
|
206
203
|
showZero = false,
|
|
207
204
|
variant: variantProp = 'standard'
|
|
@@ -214,7 +211,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
214
211
|
});
|
|
215
212
|
let invisible = invisibleProp;
|
|
216
213
|
|
|
217
|
-
if (invisibleProp
|
|
214
|
+
if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {
|
|
218
215
|
invisible = true;
|
|
219
216
|
}
|
|
220
217
|
|
|
@@ -242,14 +239,14 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
242
239
|
Badge: BadgeBadge
|
|
243
240
|
}, components),
|
|
244
241
|
componentsProps: {
|
|
245
|
-
root: (0, _extends2.default)({}, componentsProps.root,
|
|
242
|
+
root: (0, _extends2.default)({}, componentsProps.root, (0, _shouldSpreadAdditionalProps.default)(components.Root) && {
|
|
246
243
|
as: component,
|
|
247
244
|
ownerState: (0, _extends2.default)({}, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.ownerState, {
|
|
248
245
|
color,
|
|
249
246
|
overlap
|
|
250
247
|
})
|
|
251
248
|
}),
|
|
252
|
-
badge: (0, _extends2.default)({}, componentsProps.badge,
|
|
249
|
+
badge: (0, _extends2.default)({}, componentsProps.badge, (0, _shouldSpreadAdditionalProps.default)(components.Badge) && {
|
|
253
250
|
ownerState: (0, _extends2.default)({}, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.ownerState, {
|
|
254
251
|
color,
|
|
255
252
|
overlap
|
|
@@ -330,6 +327,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
330
327
|
|
|
331
328
|
/**
|
|
332
329
|
* If `true`, the badge is invisible.
|
|
330
|
+
* @default false
|
|
333
331
|
*/
|
|
334
332
|
invisible: _propTypes.default.bool,
|
|
335
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
|
package/node/Grid/Grid.js
CHANGED
|
@@ -286,10 +286,8 @@ const GridRoot = (0, _styled.default)('div', {
|
|
|
286
286
|
|
|
287
287
|
}, ownerState.zeroMinWidth && {
|
|
288
288
|
minWidth: 0
|
|
289
|
-
}, ownerState.wrap
|
|
290
|
-
flexWrap:
|
|
291
|
-
}, ownerState.wrap === 'reverse' && {
|
|
292
|
-
flexWrap: 'wrap-reverse'
|
|
289
|
+
}, ownerState.wrap !== 'wrap' && {
|
|
290
|
+
flexWrap: ownerState.wrap
|
|
293
291
|
}), generateDirection, generateRowGap, generateColumnGap, generateGrid);
|
|
294
292
|
|
|
295
293
|
const useUtilityClasses = ownerState => {
|