@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
|
@@ -127,11 +127,13 @@ var ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, ref)
|
|
|
127
127
|
_props$tabIndex = props.tabIndex,
|
|
128
128
|
tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
|
|
129
129
|
TouchRippleProps = props.TouchRippleProps,
|
|
130
|
+
touchRippleRef = props.touchRippleRef,
|
|
130
131
|
type = props.type,
|
|
131
|
-
other = _objectWithoutProperties(props, ["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"]);
|
|
132
|
+
other = _objectWithoutProperties(props, ["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"]);
|
|
132
133
|
|
|
133
134
|
var buttonRef = React.useRef(null);
|
|
134
135
|
var rippleRef = React.useRef(null);
|
|
136
|
+
var handleRippleRef = useForkRef(rippleRef, touchRippleRef);
|
|
135
137
|
|
|
136
138
|
var _useIsFocusVisible = useIsFocusVisible(),
|
|
137
139
|
isFocusVisibleRef = _useIsFocusVisible.isFocusVisibleRef,
|
|
@@ -361,7 +363,7 @@ var ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, ref)
|
|
|
361
363
|
|
|
362
364
|
/* TouchRipple is only needed client-side, x2 boost on the server. */
|
|
363
365
|
_jsx(TouchRipple, _extends({
|
|
364
|
-
ref:
|
|
366
|
+
ref: handleRippleRef,
|
|
365
367
|
center: centerRipple
|
|
366
368
|
}, TouchRippleProps)) : null]
|
|
367
369
|
}));
|
|
@@ -544,6 +546,17 @@ process.env.NODE_ENV !== "production" ? ButtonBase.propTypes
|
|
|
544
546
|
*/
|
|
545
547
|
TouchRippleProps: PropTypes.object,
|
|
546
548
|
|
|
549
|
+
/**
|
|
550
|
+
* A ref that points to the `TouchRippple` element.
|
|
551
|
+
*/
|
|
552
|
+
touchRippleRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
553
|
+
current: PropTypes.shape({
|
|
554
|
+
pulsate: PropTypes.func.isRequired,
|
|
555
|
+
start: PropTypes.func.isRequired,
|
|
556
|
+
stop: PropTypes.func.isRequired
|
|
557
|
+
})
|
|
558
|
+
})]),
|
|
559
|
+
|
|
547
560
|
/**
|
|
548
561
|
* @ignore
|
|
549
562
|
*/
|
|
@@ -22,8 +22,7 @@ var exitKeyframe = keyframes(_templateObject2 || (_templateObject2 = _taggedTemp
|
|
|
22
22
|
var pulsateKeyframe = keyframes(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n"])));
|
|
23
23
|
export var TouchRippleRoot = styled('span', {
|
|
24
24
|
name: 'MuiTouchRipple',
|
|
25
|
-
slot: 'Root'
|
|
26
|
-
skipSx: true
|
|
25
|
+
slot: 'Root'
|
|
27
26
|
})({
|
|
28
27
|
overflow: 'hidden',
|
|
29
28
|
pointerEvents: 'none',
|
package/legacy/Fab/Fab.js
CHANGED
|
@@ -18,7 +18,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
18
18
|
classes = ownerState.classes,
|
|
19
19
|
size = ownerState.size;
|
|
20
20
|
var slots = {
|
|
21
|
-
root: ['root', variant, "size".concat(capitalize(size)), color === 'inherit'
|
|
21
|
+
root: ['root', variant, "size".concat(capitalize(size)), color === 'inherit' ? 'colorInherit' : color]
|
|
22
22
|
};
|
|
23
23
|
return composeClasses(slots, getFabUtilityClass, classes);
|
|
24
24
|
};
|
|
@@ -28,7 +28,7 @@ var FabRoot = styled(ButtonBase, {
|
|
|
28
28
|
slot: 'Root',
|
|
29
29
|
overridesResolver: function overridesResolver(props, styles) {
|
|
30
30
|
var ownerState = props.ownerState;
|
|
31
|
-
return [styles.root, styles[ownerState.variant], styles["size".concat(capitalize(ownerState.size))], ownerState.color === 'inherit' && styles.colorInherit, ownerState.
|
|
31
|
+
return [styles.root, styles[ownerState.variant], styles["size".concat(capitalize(ownerState.size))], ownerState.color === 'inherit' && styles.colorInherit, styles[capitalize(ownerState.size)], styles[ownerState.color]];
|
|
32
32
|
}
|
|
33
33
|
})(function (_ref) {
|
|
34
34
|
var _extends2;
|
|
@@ -96,24 +96,14 @@ var FabRoot = styled(ButtonBase, {
|
|
|
96
96
|
}, function (_ref2) {
|
|
97
97
|
var theme = _ref2.theme,
|
|
98
98
|
ownerState = _ref2.ownerState;
|
|
99
|
-
return _extends({}, ownerState.color
|
|
100
|
-
color: theme.palette.
|
|
101
|
-
backgroundColor: theme.palette.
|
|
99
|
+
return _extends({}, ownerState.color !== 'inherit' && ownerState.color !== 'default' && theme.palette[ownerState.color] != null && {
|
|
100
|
+
color: theme.palette[ownerState.color].contrastText,
|
|
101
|
+
backgroundColor: theme.palette[ownerState.color].main,
|
|
102
102
|
'&:hover': {
|
|
103
|
-
backgroundColor: theme.palette.
|
|
103
|
+
backgroundColor: theme.palette[ownerState.color].dark,
|
|
104
104
|
// Reset on touch devices, it doesn't add specificity
|
|
105
105
|
'@media (hover: none)': {
|
|
106
|
-
backgroundColor: theme.palette.
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}, ownerState.color === 'secondary' && {
|
|
110
|
-
color: theme.palette.secondary.contrastText,
|
|
111
|
-
backgroundColor: theme.palette.secondary.main,
|
|
112
|
-
'&:hover': {
|
|
113
|
-
backgroundColor: theme.palette.secondary.dark,
|
|
114
|
-
// Reset on touch devices, it doesn't add specificity
|
|
115
|
-
'@media (hover: none)': {
|
|
116
|
-
backgroundColor: theme.palette.secondary.main
|
|
106
|
+
backgroundColor: theme.palette[ownerState.color].main
|
|
117
107
|
}
|
|
118
108
|
}
|
|
119
109
|
});
|
|
@@ -190,9 +180,7 @@ process.env.NODE_ENV !== "production" ? Fab.propTypes
|
|
|
190
180
|
* The color of the component. It supports those theme colors that make sense for this component.
|
|
191
181
|
* @default 'default'
|
|
192
182
|
*/
|
|
193
|
-
color: PropTypes
|
|
194
|
-
/* @typescript-to-proptypes-ignore */
|
|
195
|
-
.oneOfType([PropTypes.oneOf(['default', 'inherit', 'primary', 'secondary']), PropTypes.string]),
|
|
183
|
+
color: PropTypes.oneOf(['default', 'error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
|
|
196
184
|
|
|
197
185
|
/**
|
|
198
186
|
* The component used for the root node.
|
package/legacy/Fab/fabClasses.js
CHANGED
|
@@ -2,5 +2,5 @@ import { generateUtilityClass, generateUtilityClasses } from '@mui/base';
|
|
|
2
2
|
export function getFabUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiFab', slot);
|
|
4
4
|
}
|
|
5
|
-
var fabClasses = generateUtilityClasses('MuiFab', ['root', 'primary', 'secondary', 'extended', 'circular', 'focusVisible', 'disabled', 'colorInherit', 'sizeSmall', 'sizeMedium', 'sizeLarge']);
|
|
5
|
+
var fabClasses = generateUtilityClasses('MuiFab', ['root', 'primary', 'secondary', 'extended', 'circular', 'focusVisible', 'disabled', 'colorInherit', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'info', 'error', 'warning', 'success']);
|
|
6
6
|
export default fabClasses;
|
|
@@ -12,15 +12,17 @@ import capitalize from '../utils/capitalize';
|
|
|
12
12
|
import styled from '../styles/styled';
|
|
13
13
|
import useThemeProps from '../styles/useThemeProps';
|
|
14
14
|
import formControlLabelClasses, { getFormControlLabelUtilityClasses } from './formControlLabelClasses';
|
|
15
|
+
import formControlState from '../FormControl/formControlState';
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
|
|
18
19
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
19
20
|
var classes = ownerState.classes,
|
|
20
21
|
disabled = ownerState.disabled,
|
|
21
|
-
labelPlacement = ownerState.labelPlacement
|
|
22
|
+
labelPlacement = ownerState.labelPlacement,
|
|
23
|
+
error = ownerState.error;
|
|
22
24
|
var slots = {
|
|
23
|
-
root: ['root', disabled && 'disabled', "labelPlacement".concat(capitalize(labelPlacement))],
|
|
25
|
+
root: ['root', disabled && 'disabled', "labelPlacement".concat(capitalize(labelPlacement)), error && 'error'],
|
|
24
26
|
label: ['label', disabled && 'disabled']
|
|
25
27
|
};
|
|
26
28
|
return composeClasses(slots, getFormControlLabelUtilityClasses, classes);
|
|
@@ -108,11 +110,17 @@ var FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel(i
|
|
|
108
110
|
controlProps[key] = props[key];
|
|
109
111
|
}
|
|
110
112
|
});
|
|
113
|
+
var fcs = formControlState({
|
|
114
|
+
props: props,
|
|
115
|
+
muiFormControl: muiFormControl,
|
|
116
|
+
states: ['error']
|
|
117
|
+
});
|
|
111
118
|
|
|
112
119
|
var ownerState = _extends({}, props, {
|
|
113
120
|
disabled: disabled,
|
|
114
121
|
label: label,
|
|
115
|
-
labelPlacement: labelPlacement
|
|
122
|
+
labelPlacement: labelPlacement,
|
|
123
|
+
error: fcs.error
|
|
116
124
|
});
|
|
117
125
|
|
|
118
126
|
var classes = useUtilityClasses(ownerState);
|
|
@@ -2,5 +2,5 @@ import { generateUtilityClasses, generateUtilityClass } from '@mui/base';
|
|
|
2
2
|
export function getFormControlLabelUtilityClasses(slot) {
|
|
3
3
|
return generateUtilityClass('MuiFormControlLabel', slot);
|
|
4
4
|
}
|
|
5
|
-
var formControlLabelClasses = generateUtilityClasses('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label']);
|
|
5
|
+
var formControlLabelClasses = generateUtilityClasses('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error']);
|
|
6
6
|
export default formControlLabelClasses;
|
|
@@ -7,13 +7,16 @@ import { unstable_composeClasses as composeClasses } from '@mui/base';
|
|
|
7
7
|
import styled from '../styles/styled';
|
|
8
8
|
import useThemeProps from '../styles/useThemeProps';
|
|
9
9
|
import { getFormGroupUtilityClass } from './formGroupClasses';
|
|
10
|
+
import useFormControl from '../FormControl/useFormControl';
|
|
11
|
+
import formControlState from '../FormControl/formControlState';
|
|
10
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
13
|
|
|
12
14
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
13
15
|
var classes = ownerState.classes,
|
|
14
|
-
row = ownerState.row
|
|
16
|
+
row = ownerState.row,
|
|
17
|
+
error = ownerState.error;
|
|
15
18
|
var slots = {
|
|
16
|
-
root: ['root', row && 'row']
|
|
19
|
+
root: ['root', row && 'row', error && 'error']
|
|
17
20
|
};
|
|
18
21
|
return composeClasses(slots, getFormGroupUtilityClass, classes);
|
|
19
22
|
};
|
|
@@ -52,8 +55,16 @@ var FormGroup = /*#__PURE__*/React.forwardRef(function FormGroup(inProps, ref) {
|
|
|
52
55
|
row = _props$row === void 0 ? false : _props$row,
|
|
53
56
|
other = _objectWithoutProperties(props, ["className", "row"]);
|
|
54
57
|
|
|
58
|
+
var muiFormControl = useFormControl();
|
|
59
|
+
var fcs = formControlState({
|
|
60
|
+
props: props,
|
|
61
|
+
muiFormControl: muiFormControl,
|
|
62
|
+
states: ['error']
|
|
63
|
+
});
|
|
64
|
+
|
|
55
65
|
var ownerState = _extends({}, props, {
|
|
56
|
-
row: row
|
|
66
|
+
row: row,
|
|
67
|
+
error: fcs.error
|
|
57
68
|
});
|
|
58
69
|
|
|
59
70
|
var classes = useUtilityClasses(ownerState);
|
|
@@ -2,5 +2,5 @@ import { generateUtilityClass, generateUtilityClasses } from '@mui/base';
|
|
|
2
2
|
export function getFormGroupUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiFormGroup', slot);
|
|
4
4
|
}
|
|
5
|
-
var formGroupClasses = generateUtilityClasses('MuiFormGroup', ['root', 'row']);
|
|
5
|
+
var formGroupClasses = generateUtilityClasses('MuiFormGroup', ['root', 'row', 'error']);
|
|
6
6
|
export default formGroupClasses;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
|
|
5
|
+
var _span;
|
|
6
|
+
|
|
4
7
|
import * as React from 'react';
|
|
5
8
|
import PropTypes from 'prop-types';
|
|
6
9
|
import clsx from 'clsx';
|
|
@@ -104,16 +107,11 @@ var FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inPro
|
|
|
104
107
|
className: clsx(classes.root, className),
|
|
105
108
|
ref: ref
|
|
106
109
|
}, other, {
|
|
107
|
-
children: children === ' ' ?
|
|
108
|
-
/*#__PURE__*/
|
|
109
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
110
|
-
// eslint-disable-next-line react/no-danger
|
|
111
|
-
_jsx("span", {
|
|
110
|
+
children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
111
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
112
112
|
className: "notranslate",
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
}) : children
|
|
113
|
+
children: "\u200B"
|
|
114
|
+
})) : children
|
|
117
115
|
}));
|
|
118
116
|
});
|
|
119
117
|
process.env.NODE_ENV !== "production" ? FormHelperText.propTypes
|
package/legacy/Grid/Grid.js
CHANGED
|
@@ -251,10 +251,8 @@ var GridRoot = styled('div', {
|
|
|
251
251
|
|
|
252
252
|
}, ownerState.zeroMinWidth && {
|
|
253
253
|
minWidth: 0
|
|
254
|
-
}, ownerState.wrap
|
|
255
|
-
flexWrap:
|
|
256
|
-
}, ownerState.wrap === 'reverse' && {
|
|
257
|
-
flexWrap: 'wrap-reverse'
|
|
254
|
+
}, ownerState.wrap !== 'wrap' && {
|
|
255
|
+
flexWrap: ownerState.wrap
|
|
258
256
|
});
|
|
259
257
|
}, generateDirection, generateRowGap, generateColumnGap, generateGrid);
|
|
260
258
|
|
|
@@ -168,6 +168,8 @@ process.env.NODE_ENV !== "production" ? ImageList.propTypes
|
|
|
168
168
|
* The variant to use.
|
|
169
169
|
* @default 'standard'
|
|
170
170
|
*/
|
|
171
|
-
variant: PropTypes
|
|
171
|
+
variant: PropTypes
|
|
172
|
+
/* @typescript-to-proptypes-ignore */
|
|
173
|
+
.oneOfType([PropTypes.oneOf(['masonry', 'quilted', 'standard', 'woven']), PropTypes.string])
|
|
172
174
|
} : void 0;
|
|
173
175
|
export default ImageList;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
|
|
5
|
+
var _span;
|
|
6
|
+
|
|
4
7
|
import * as React from 'react';
|
|
5
8
|
import PropTypes from 'prop-types';
|
|
6
9
|
import clsx from 'clsx';
|
|
@@ -116,17 +119,11 @@ var InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inPro
|
|
|
116
119
|
children: children
|
|
117
120
|
}) : /*#__PURE__*/_jsxs(React.Fragment, {
|
|
118
121
|
children: [position === 'start' ?
|
|
119
|
-
/*#__PURE__*/
|
|
120
|
-
|
|
121
122
|
/* notranslate needed while Google Translate will not fix zero-width space issue */
|
|
122
|
-
|
|
123
|
-
/* eslint-disable-next-line react/no-danger */
|
|
124
|
-
_jsx("span", {
|
|
123
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
125
124
|
className: "notranslate",
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
}) : null, children]
|
|
125
|
+
children: "\u200B"
|
|
126
|
+
})) : null, children]
|
|
130
127
|
})
|
|
131
128
|
}))
|
|
132
129
|
});
|
package/legacy/Modal/Modal.js
CHANGED
|
@@ -243,7 +243,7 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
243
243
|
|
|
244
244
|
/**
|
|
245
245
|
* If `true`, the modal will not restore focus to previously focused element once
|
|
246
|
-
* modal is hidden.
|
|
246
|
+
* modal is hidden or unmounted.
|
|
247
247
|
* @default false
|
|
248
248
|
*/
|
|
249
249
|
disableRestoreFocus: PropTypes.bool,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
|
|
4
|
+
var _span;
|
|
5
|
+
|
|
3
6
|
import * as React from 'react';
|
|
4
7
|
import PropTypes from 'prop-types';
|
|
5
8
|
import styled from '../styles/styled';
|
|
@@ -20,14 +23,12 @@ var NotchedOutlineRoot = styled('fieldset')({
|
|
|
20
23
|
overflow: 'hidden',
|
|
21
24
|
minWidth: '0%'
|
|
22
25
|
});
|
|
23
|
-
var NotchedOutlineLegend = styled('legend'
|
|
24
|
-
skipSx: true
|
|
25
|
-
})(function (_ref) {
|
|
26
|
+
var NotchedOutlineLegend = styled('legend')(function (_ref) {
|
|
26
27
|
var ownerState = _ref.ownerState,
|
|
27
28
|
theme = _ref.theme;
|
|
28
29
|
return _extends({
|
|
29
30
|
float: 'unset'
|
|
30
|
-
}, ownerState.
|
|
31
|
+
}, !ownerState.withLabel && {
|
|
31
32
|
padding: 0,
|
|
32
33
|
lineHeight: '11px',
|
|
33
34
|
// sync with `height` in `legend` styles
|
|
@@ -35,7 +36,7 @@ var NotchedOutlineLegend = styled('legend', {
|
|
|
35
36
|
duration: 150,
|
|
36
37
|
easing: theme.transitions.easing.easeOut
|
|
37
38
|
})
|
|
38
|
-
}, ownerState.
|
|
39
|
+
}, ownerState.withLabel && _extends({
|
|
39
40
|
display: 'block',
|
|
40
41
|
// Fix conflict with normalize.css and sanitize.css
|
|
41
42
|
width: 'auto',
|
|
@@ -77,9 +78,11 @@ export default function NotchedOutline(props) {
|
|
|
77
78
|
notched = props.notched,
|
|
78
79
|
other = _objectWithoutProperties(props, ["children", "classes", "className", "label", "notched"]);
|
|
79
80
|
|
|
81
|
+
var withLabel = label != null && label !== '';
|
|
82
|
+
|
|
80
83
|
var ownerState = _extends({}, props, {
|
|
81
84
|
notched: notched,
|
|
82
|
-
|
|
85
|
+
withLabel: withLabel
|
|
83
86
|
});
|
|
84
87
|
|
|
85
88
|
return /*#__PURE__*/_jsx(NotchedOutlineRoot, _extends({
|
|
@@ -89,18 +92,13 @@ export default function NotchedOutline(props) {
|
|
|
89
92
|
}, other, {
|
|
90
93
|
children: /*#__PURE__*/_jsx(NotchedOutlineLegend, {
|
|
91
94
|
ownerState: ownerState,
|
|
92
|
-
children:
|
|
95
|
+
children: withLabel ? /*#__PURE__*/_jsx("span", {
|
|
93
96
|
children: label
|
|
94
|
-
}) :
|
|
95
|
-
/*#__PURE__*/
|
|
96
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
97
|
-
// eslint-disable-next-line react/no-danger
|
|
98
|
-
_jsx("span", {
|
|
97
|
+
}) : // notranslate needed while Google Translate will not fix zero-width space issue
|
|
98
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
99
99
|
className: "notranslate",
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
})
|
|
100
|
+
children: "\u200B"
|
|
101
|
+
}))
|
|
104
102
|
})
|
|
105
103
|
}));
|
|
106
104
|
}
|
|
@@ -137,7 +137,7 @@ var OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps
|
|
|
137
137
|
renderSuffix: function renderSuffix(state) {
|
|
138
138
|
return /*#__PURE__*/_jsx(NotchedOutlineRoot, {
|
|
139
139
|
className: classes.notchedOutline,
|
|
140
|
-
label: label && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
140
|
+
label: label != null && label !== '' && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
|
|
141
141
|
children: [label, "\xA0", '*']
|
|
142
142
|
})) : label,
|
|
143
143
|
notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
|
|
@@ -10,15 +10,11 @@ var RadioButtonIconRoot = styled('span')({
|
|
|
10
10
|
position: 'relative',
|
|
11
11
|
display: 'flex'
|
|
12
12
|
});
|
|
13
|
-
var RadioButtonIconBackground = styled(RadioButtonUncheckedIcon
|
|
14
|
-
skipSx: true
|
|
15
|
-
})({
|
|
13
|
+
var RadioButtonIconBackground = styled(RadioButtonUncheckedIcon)({
|
|
16
14
|
// Scale applied to prevent dot misalignment in Safari
|
|
17
15
|
transform: 'scale(1)'
|
|
18
16
|
});
|
|
19
|
-
var RadioButtonIconDot = styled(RadioButtonCheckedIcon
|
|
20
|
-
skipSx: true
|
|
21
|
-
})(function (_ref) {
|
|
17
|
+
var RadioButtonIconDot = styled(RadioButtonCheckedIcon)(function (_ref) {
|
|
22
18
|
var theme = _ref.theme,
|
|
23
19
|
ownerState = _ref.ownerState;
|
|
24
20
|
return _extends({
|
package/legacy/Rating/Rating.js
CHANGED
|
@@ -425,7 +425,7 @@ var Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
|
|
|
425
425
|
|
|
426
426
|
var handleChange = function handleChange(event) {
|
|
427
427
|
var newValue = event.target.value === '' ? null : parseFloat(event.target.value); // Give mouse priority over keyboard
|
|
428
|
-
// Fix https://github.com/mui
|
|
428
|
+
// Fix https://github.com/mui/material-ui/issues/22827
|
|
429
429
|
|
|
430
430
|
if (hover !== -1) {
|
|
431
431
|
newValue = hover;
|
package/legacy/Select/Select.js
CHANGED
|
@@ -36,6 +36,8 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
36
36
|
_props$classes = props.classes,
|
|
37
37
|
classesProp = _props$classes === void 0 ? {} : _props$classes,
|
|
38
38
|
className = props.className,
|
|
39
|
+
_props$defaultOpen = props.defaultOpen,
|
|
40
|
+
defaultOpen = _props$defaultOpen === void 0 ? false : _props$defaultOpen,
|
|
39
41
|
_props$displayEmpty = props.displayEmpty,
|
|
40
42
|
displayEmpty = _props$displayEmpty === void 0 ? false : _props$displayEmpty,
|
|
41
43
|
_props$IconComponent = props.IconComponent,
|
|
@@ -57,7 +59,7 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
57
59
|
SelectDisplayProps = props.SelectDisplayProps,
|
|
58
60
|
_props$variant = props.variant,
|
|
59
61
|
variantProps = _props$variant === void 0 ? 'outlined' : _props$variant,
|
|
60
|
-
other = _objectWithoutProperties(props, ["autoWidth", "children", "classes", "className", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]);
|
|
62
|
+
other = _objectWithoutProperties(props, ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]);
|
|
61
63
|
|
|
62
64
|
var inputComponent = native ? NativeSelectInput : SelectInput;
|
|
63
65
|
var muiFormControl = useFormControl();
|
|
@@ -96,6 +98,7 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
96
98
|
id: id
|
|
97
99
|
} : {
|
|
98
100
|
autoWidth: autoWidth,
|
|
101
|
+
defaultOpen: defaultOpen,
|
|
99
102
|
displayEmpty: displayEmpty,
|
|
100
103
|
labelId: labelId,
|
|
101
104
|
MenuProps: MenuProps,
|
|
@@ -150,6 +153,13 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
|
150
153
|
*/
|
|
151
154
|
className: PropTypes.string,
|
|
152
155
|
|
|
156
|
+
/**
|
|
157
|
+
* If `true`, the component is initially open. Use when the component open state is not controlled (i.e. the `open` prop is not defined).
|
|
158
|
+
* You can only use it when the `native` prop is `false` (default).
|
|
159
|
+
* @default false
|
|
160
|
+
*/
|
|
161
|
+
defaultOpen: PropTypes.bool,
|
|
162
|
+
|
|
153
163
|
/**
|
|
154
164
|
* The default value. Use when the component is not controlled.
|
|
155
165
|
*/
|
|
@@ -4,6 +4,9 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
4
4
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
6
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
7
|
+
|
|
8
|
+
var _span;
|
|
9
|
+
|
|
7
10
|
import * as React from 'react';
|
|
8
11
|
import { isFragment } from 'react-is';
|
|
9
12
|
import PropTypes from 'prop-types';
|
|
@@ -103,6 +106,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
103
106
|
autoWidth = props.autoWidth,
|
|
104
107
|
children = props.children,
|
|
105
108
|
className = props.className,
|
|
109
|
+
defaultOpen = props.defaultOpen,
|
|
106
110
|
defaultValue = props.defaultValue,
|
|
107
111
|
disabled = props.disabled,
|
|
108
112
|
displayEmpty = props.displayEmpty,
|
|
@@ -128,7 +132,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
128
132
|
valueProp = props.value,
|
|
129
133
|
_props$variant = props.variant,
|
|
130
134
|
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
131
|
-
other = _objectWithoutProperties(props, ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"]);
|
|
135
|
+
other = _objectWithoutProperties(props, ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"]);
|
|
132
136
|
|
|
133
137
|
var _useControlled = useControlled({
|
|
134
138
|
controlled: valueProp,
|
|
@@ -139,6 +143,15 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
139
143
|
value = _useControlled2[0],
|
|
140
144
|
setValueState = _useControlled2[1];
|
|
141
145
|
|
|
146
|
+
var _useControlled3 = useControlled({
|
|
147
|
+
controlled: openProp,
|
|
148
|
+
default: defaultOpen,
|
|
149
|
+
name: 'Select'
|
|
150
|
+
}),
|
|
151
|
+
_useControlled4 = _slicedToArray(_useControlled3, 2),
|
|
152
|
+
openState = _useControlled4[0],
|
|
153
|
+
setOpenState = _useControlled4[1];
|
|
154
|
+
|
|
142
155
|
var inputRef = React.useRef(null);
|
|
143
156
|
var displayRef = React.useRef(null);
|
|
144
157
|
|
|
@@ -153,10 +166,6 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
153
166
|
menuMinWidthState = _React$useState2[0],
|
|
154
167
|
setMenuMinWidthState = _React$useState2[1];
|
|
155
168
|
|
|
156
|
-
var _React$useState3 = React.useState(false),
|
|
157
|
-
openState = _React$useState3[0],
|
|
158
|
-
setOpenState = _React$useState3[1];
|
|
159
|
-
|
|
160
169
|
var handleRef = useForkRef(ref, inputRefProp);
|
|
161
170
|
var handleDisplayRef = React.useCallback(function (node) {
|
|
162
171
|
displayRef.current = node;
|
|
@@ -173,13 +182,27 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
173
182
|
node: inputRef.current,
|
|
174
183
|
value: value
|
|
175
184
|
};
|
|
176
|
-
}, [value]);
|
|
185
|
+
}, [value]); // Resize menu on `defaultOpen` automatic toggle.
|
|
186
|
+
|
|
187
|
+
React.useEffect(function () {
|
|
188
|
+
if (defaultOpen && openState && displayNode && !isOpenControlled) {
|
|
189
|
+
setMenuMinWidthState(autoWidth ? null : displayNode.clientWidth);
|
|
190
|
+
displayRef.current.focus();
|
|
191
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
192
|
+
|
|
193
|
+
}, [displayNode, autoWidth]); // `isOpenControlled` is ignored because the component should never switch between controlled and uncontrolled modes.
|
|
194
|
+
// `defaultOpen` and `openState` are ignored to avoid unnecessary callbacks.
|
|
195
|
+
|
|
177
196
|
React.useEffect(function () {
|
|
178
197
|
if (autoFocus) {
|
|
179
198
|
displayRef.current.focus();
|
|
180
199
|
}
|
|
181
200
|
}, [autoFocus]);
|
|
182
201
|
React.useEffect(function () {
|
|
202
|
+
if (!labelId) {
|
|
203
|
+
return undefined;
|
|
204
|
+
}
|
|
205
|
+
|
|
183
206
|
var label = ownerDocument(displayRef.current).getElementById(labelId);
|
|
184
207
|
|
|
185
208
|
if (label) {
|
|
@@ -279,7 +302,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
279
302
|
if (onChange) {
|
|
280
303
|
// Redefine target to allow name and value to be read.
|
|
281
304
|
// This allows seamless integration with the most popular form libraries.
|
|
282
|
-
// https://github.com/mui
|
|
305
|
+
// https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
|
|
283
306
|
// Clone the event to not override `target` of the original event.
|
|
284
307
|
var nativeEvent = event.nativeEvent || event;
|
|
285
308
|
var clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
|
|
@@ -313,7 +336,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
313
336
|
}
|
|
314
337
|
};
|
|
315
338
|
|
|
316
|
-
var open = displayNode !== null &&
|
|
339
|
+
var open = displayNode !== null && openState;
|
|
317
340
|
|
|
318
341
|
var handleBlur = function handleBlur(event) {
|
|
319
342
|
// if open event.stopImmediatePropagation
|
|
@@ -488,16 +511,11 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
488
511
|
className: clsx(classes.select, className, SelectDisplayProps.className) // The id is required for proper a11y
|
|
489
512
|
,
|
|
490
513
|
id: buttonId,
|
|
491
|
-
children: isEmpty(display) ?
|
|
492
|
-
/*#__PURE__*/
|
|
493
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
494
|
-
// eslint-disable-next-line react/no-danger
|
|
495
|
-
_jsx("span", {
|
|
514
|
+
children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
515
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
496
516
|
className: "notranslate",
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
}) : display
|
|
517
|
+
children: "\u200B"
|
|
518
|
+
})) : display
|
|
501
519
|
})), /*#__PURE__*/_jsx(SelectNativeInput, _extends({
|
|
502
520
|
value: Array.isArray(value) ? value.join(',') : value,
|
|
503
521
|
name: name,
|
|
@@ -580,6 +598,12 @@ process.env.NODE_ENV !== "production" ? SelectInput.propTypes = {
|
|
|
580
598
|
*/
|
|
581
599
|
className: PropTypes.string,
|
|
582
600
|
|
|
601
|
+
/**
|
|
602
|
+
* If `true`, the component is toggled on mount. Use when the component open state is not controlled.
|
|
603
|
+
* You can only use it when the `native` prop is `false` (default).
|
|
604
|
+
*/
|
|
605
|
+
defaultOpen: PropTypes.bool,
|
|
606
|
+
|
|
583
607
|
/**
|
|
584
608
|
* The default value. Use when the component is not controlled.
|
|
585
609
|
*/
|