@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
package/legacy/Select/Select.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _StyledInput, _StyledFilledInput;
|
|
5
5
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -17,6 +17,7 @@ import FilledInput from '../FilledInput';
|
|
|
17
17
|
import OutlinedInput from '../OutlinedInput';
|
|
18
18
|
import useThemeProps from '../styles/useThemeProps';
|
|
19
19
|
import useForkRef from '../utils/useForkRef';
|
|
20
|
+
import styled, { rootShouldForwardProp } from '../styles/styled';
|
|
20
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
22
|
|
|
22
23
|
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
@@ -24,6 +25,19 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
24
25
|
return classes;
|
|
25
26
|
};
|
|
26
27
|
|
|
28
|
+
var styledRootConfig = {
|
|
29
|
+
name: 'MuiSelect',
|
|
30
|
+
overridesResolver: function overridesResolver(props, styles) {
|
|
31
|
+
return styles.root;
|
|
32
|
+
},
|
|
33
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
34
|
+
return rootShouldForwardProp(prop) && prop !== 'variant';
|
|
35
|
+
},
|
|
36
|
+
slot: 'Root'
|
|
37
|
+
};
|
|
38
|
+
var StyledInput = styled(Input, styledRootConfig)('');
|
|
39
|
+
var StyledOutlinedInput = styled(OutlinedInput, styledRootConfig)('');
|
|
40
|
+
var StyledFilledInput = styled(FilledInput, styledRootConfig)('');
|
|
27
41
|
var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
28
42
|
var props = useThemeProps({
|
|
29
43
|
name: 'MuiSelect',
|
|
@@ -58,7 +72,7 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
58
72
|
renderValue = props.renderValue,
|
|
59
73
|
SelectDisplayProps = props.SelectDisplayProps,
|
|
60
74
|
_props$variant = props.variant,
|
|
61
|
-
|
|
75
|
+
variantProp = _props$variant === void 0 ? 'outlined' : _props$variant,
|
|
62
76
|
other = _objectWithoutProperties(props, ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"]);
|
|
63
77
|
|
|
64
78
|
var inputComponent = native ? NativeSelectInput : SelectInput;
|
|
@@ -68,16 +82,17 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
68
82
|
muiFormControl: muiFormControl,
|
|
69
83
|
states: ['variant']
|
|
70
84
|
});
|
|
71
|
-
var variant = fcs.variant ||
|
|
85
|
+
var variant = fcs.variant || variantProp;
|
|
72
86
|
var InputComponent = input || {
|
|
73
|
-
standard:
|
|
74
|
-
outlined: /*#__PURE__*/_jsx(
|
|
87
|
+
standard: _StyledInput || (_StyledInput = /*#__PURE__*/_jsx(StyledInput, {})),
|
|
88
|
+
outlined: /*#__PURE__*/_jsx(StyledOutlinedInput, {
|
|
75
89
|
label: label
|
|
76
90
|
}),
|
|
77
|
-
filled:
|
|
91
|
+
filled: _StyledFilledInput || (_StyledFilledInput = /*#__PURE__*/_jsx(StyledFilledInput, {}))
|
|
78
92
|
}[variant];
|
|
79
93
|
|
|
80
94
|
var ownerState = _extends({}, props, {
|
|
95
|
+
variant: variant,
|
|
81
96
|
classes: classesProp
|
|
82
97
|
});
|
|
83
98
|
|
|
@@ -116,7 +131,8 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
116
131
|
notched: true
|
|
117
132
|
} : {}, {
|
|
118
133
|
ref: inputComponentRef,
|
|
119
|
-
className: clsx(InputComponent.props.className, className)
|
|
134
|
+
className: clsx(InputComponent.props.className, className),
|
|
135
|
+
variant: variant
|
|
120
136
|
}, other));
|
|
121
137
|
});
|
|
122
138
|
process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
@@ -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';
|
|
@@ -196,6 +199,10 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
196
199
|
}
|
|
197
200
|
}, [autoFocus]);
|
|
198
201
|
React.useEffect(function () {
|
|
202
|
+
if (!labelId) {
|
|
203
|
+
return undefined;
|
|
204
|
+
}
|
|
205
|
+
|
|
199
206
|
var label = ownerDocument(displayRef.current).getElementById(labelId);
|
|
200
207
|
|
|
201
208
|
if (label) {
|
|
@@ -295,7 +302,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
295
302
|
if (onChange) {
|
|
296
303
|
// Redefine target to allow name and value to be read.
|
|
297
304
|
// This allows seamless integration with the most popular form libraries.
|
|
298
|
-
// https://github.com/mui
|
|
305
|
+
// https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
|
|
299
306
|
// Clone the event to not override `target` of the original event.
|
|
300
307
|
var nativeEvent = event.nativeEvent || event;
|
|
301
308
|
var clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
|
|
@@ -504,16 +511,11 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, ref)
|
|
|
504
511
|
className: clsx(classes.select, className, SelectDisplayProps.className) // The id is required for proper a11y
|
|
505
512
|
,
|
|
506
513
|
id: buttonId,
|
|
507
|
-
children: isEmpty(display) ?
|
|
508
|
-
/*#__PURE__*/
|
|
509
|
-
// notranslate needed while Google Translate will not fix zero-width space issue
|
|
510
|
-
// eslint-disable-next-line react/no-danger
|
|
511
|
-
_jsx("span", {
|
|
514
|
+
children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
515
|
+
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
512
516
|
className: "notranslate",
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
}) : display
|
|
517
|
+
children: "\u200B"
|
|
518
|
+
})) : display
|
|
517
519
|
})), /*#__PURE__*/_jsx(SelectNativeInput, _extends({
|
|
518
520
|
value: Array.isArray(value) ? value.join(',') : value,
|
|
519
521
|
name: name,
|
package/legacy/Slider/Slider.js
CHANGED
|
@@ -707,7 +707,9 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
707
707
|
* The size of the slider.
|
|
708
708
|
* @default 'medium'
|
|
709
709
|
*/
|
|
710
|
-
size: PropTypes
|
|
710
|
+
size: PropTypes
|
|
711
|
+
/* @typescript-to-proptypes-ignore */
|
|
712
|
+
.oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
|
|
711
713
|
|
|
712
714
|
/**
|
|
713
715
|
* The granularity with which the slider can step through values. (A "discrete" slider.)
|
|
@@ -289,7 +289,10 @@ var Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
289
289
|
onMouseEnter: handleMouseEnter,
|
|
290
290
|
onMouseLeave: handleMouseLeave,
|
|
291
291
|
ownerState: ownerState,
|
|
292
|
-
ref: ref
|
|
292
|
+
ref: ref // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
|
|
293
|
+
// See https://github.com/mui-org/material-ui/issues/29080
|
|
294
|
+
,
|
|
295
|
+
role: "presentation"
|
|
293
296
|
}, other, {
|
|
294
297
|
children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
295
298
|
appear: true,
|
|
@@ -29,7 +29,7 @@ var SvgIconRoot = styled('svg', {
|
|
|
29
29
|
return [styles.root, ownerState.color !== 'inherit' && styles["color".concat(capitalize(ownerState.color))], styles["fontSize".concat(capitalize(ownerState.fontSize))]];
|
|
30
30
|
}
|
|
31
31
|
})(function (_ref) {
|
|
32
|
-
var _theme$palette$ownerS, _theme$palette$ownerS2;
|
|
32
|
+
var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$transitions2$d, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _theme$palette$ownerS, _theme$palette, _theme$palette$ownerS2, _theme$palette2, _theme$palette2$actio, _theme$palette3, _theme$palette3$actio;
|
|
33
33
|
|
|
34
34
|
var theme = _ref.theme,
|
|
35
35
|
ownerState = _ref.ownerState;
|
|
@@ -40,19 +40,19 @@ var SvgIconRoot = styled('svg', {
|
|
|
40
40
|
display: 'inline-block',
|
|
41
41
|
fill: 'currentColor',
|
|
42
42
|
flexShrink: 0,
|
|
43
|
-
transition: theme.transitions.create('fill', {
|
|
44
|
-
duration: theme.transitions.duration.shorter
|
|
43
|
+
transition: (_theme$transitions = theme.transitions) == null ? void 0 : (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
|
|
44
|
+
duration: (_theme$transitions2 = theme.transitions) == null ? void 0 : (_theme$transitions2$d = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2$d.shorter
|
|
45
45
|
}),
|
|
46
46
|
fontSize: {
|
|
47
47
|
inherit: 'inherit',
|
|
48
|
-
small: theme.typography.pxToRem(20),
|
|
49
|
-
medium: theme.typography.pxToRem(24),
|
|
50
|
-
large: theme.typography.pxToRem(35)
|
|
48
|
+
small: ((_theme$typography = theme.typography) == null ? void 0 : (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',
|
|
49
|
+
medium: ((_theme$typography2 = theme.typography) == null ? void 0 : (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',
|
|
50
|
+
large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875'
|
|
51
51
|
}[ownerState.fontSize],
|
|
52
52
|
// TODO v5 deprecate, v6 remove for sx
|
|
53
|
-
color: (_theme$palette$ownerS = (_theme$palette
|
|
54
|
-
action: theme.palette.action.active,
|
|
55
|
-
disabled: theme.palette.action.disabled,
|
|
53
|
+
color: (_theme$palette$ownerS = (_theme$palette = theme.palette) == null ? void 0 : (_theme$palette$ownerS2 = _theme$palette[ownerState.color]) == null ? void 0 : _theme$palette$ownerS2.main) != null ? _theme$palette$ownerS : {
|
|
54
|
+
action: (_theme$palette2 = theme.palette) == null ? void 0 : (_theme$palette2$actio = _theme$palette2.action) == null ? void 0 : _theme$palette2$actio.active,
|
|
55
|
+
disabled: (_theme$palette3 = theme.palette) == null ? void 0 : (_theme$palette3$actio = _theme$palette3.action) == null ? void 0 : _theme$palette3$actio.disabled,
|
|
56
56
|
inherit: undefined
|
|
57
57
|
}[ownerState.color]
|
|
58
58
|
};
|
|
@@ -8,9 +8,7 @@ import styled from '../styles/styled';
|
|
|
8
8
|
import capitalize from '../utils/capitalize';
|
|
9
9
|
import { isHorizontal } from '../Drawer/Drawer';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
var SwipeAreaRoot = styled('div'
|
|
12
|
-
skipSx: true
|
|
13
|
-
})(function (_ref) {
|
|
11
|
+
var SwipeAreaRoot = styled('div')(function (_ref) {
|
|
14
12
|
var theme = _ref.theme,
|
|
15
13
|
ownerState = _ref.ownerState;
|
|
16
14
|
return _extends({
|
|
@@ -197,7 +197,7 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
|
|
|
197
197
|
variant: variant,
|
|
198
198
|
ownerState: ownerState
|
|
199
199
|
}, other, {
|
|
200
|
-
children: [label && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
200
|
+
children: [label != null && label !== '' && /*#__PURE__*/_jsx(InputLabel, _extends({
|
|
201
201
|
htmlFor: id,
|
|
202
202
|
id: inputLabelId
|
|
203
203
|
}, InputLabelProps, {
|
|
@@ -196,12 +196,18 @@ process.env.NODE_ENV !== "production" ? ToggleButton.propTypes
|
|
|
196
196
|
fullWidth: PropTypes.bool,
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
|
-
*
|
|
199
|
+
* Callback fired when the state changes.
|
|
200
|
+
*
|
|
201
|
+
* @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
|
|
202
|
+
* @param {any} value of the selected button.
|
|
200
203
|
*/
|
|
201
204
|
onChange: PropTypes.func,
|
|
202
205
|
|
|
203
206
|
/**
|
|
204
|
-
*
|
|
207
|
+
* Callback fired when the button is clicked.
|
|
208
|
+
*
|
|
209
|
+
* @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
|
|
210
|
+
* @param {any} value of the selected button.
|
|
205
211
|
*/
|
|
206
212
|
onClick: PropTypes.func,
|
|
207
213
|
|
package/legacy/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';
|
|
@@ -27,9 +27,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
27
27
|
return composeClasses(slots, getSwitchBaseUtilityClass, classes);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
var SwitchBaseRoot = styled(ButtonBase
|
|
31
|
-
skipSx: true
|
|
32
|
-
})(function (_ref) {
|
|
30
|
+
var SwitchBaseRoot = styled(ButtonBase)(function (_ref) {
|
|
33
31
|
var ownerState = _ref.ownerState;
|
|
34
32
|
return _extends({
|
|
35
33
|
padding: 9,
|
|
@@ -40,9 +38,7 @@ var SwitchBaseRoot = styled(ButtonBase, {
|
|
|
40
38
|
marginRight: ownerState.size === 'small' ? -3 : -12
|
|
41
39
|
});
|
|
42
40
|
});
|
|
43
|
-
var SwitchBaseInput = styled('input'
|
|
44
|
-
skipSx: true
|
|
45
|
-
})({
|
|
41
|
+
var SwitchBaseInput = styled('input')({
|
|
46
42
|
cursor: 'inherit',
|
|
47
43
|
position: 'absolute',
|
|
48
44
|
opacity: 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
2
2
|
export default function makeStyles() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: makeStyles is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#material-
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: makeStyles is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#mui-material-styles for more details." : _formatMuiErrorMessage(14));
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
2
2
|
export default function withStyles() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: withStyles is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#material-
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: withStyles is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#mui-material-styles for more details." : _formatMuiErrorMessage(15));
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
|
|
2
2
|
export default function withTheme() {
|
|
3
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: withTheme is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#material-
|
|
3
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: withTheme is not longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#mui-material-styles for more details." : _formatMuiErrorMessage(16));
|
|
4
4
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { getThemeProps, useThemeWithoutDefault as useTheme } from '@mui/system';
|
|
3
4
|
import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
@@ -5,38 +6,9 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
|
|
|
5
6
|
* @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.
|
|
6
7
|
*/
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10
|
-
var theme = useTheme(); // Wait for jsdom to support the match media feature.
|
|
11
|
-
// All the browsers MUI support have this built-in.
|
|
12
|
-
// This defensive check is here for simplicity.
|
|
13
|
-
// Most of the time, the match media logic isn't central to people tests.
|
|
14
|
-
|
|
9
|
+
function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
|
|
15
10
|
var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
|
16
11
|
|
|
17
|
-
var _getThemeProps = getThemeProps({
|
|
18
|
-
name: 'MuiUseMediaQuery',
|
|
19
|
-
props: options,
|
|
20
|
-
theme: theme
|
|
21
|
-
}),
|
|
22
|
-
_getThemeProps$defaul = _getThemeProps.defaultMatches,
|
|
23
|
-
defaultMatches = _getThemeProps$defaul === void 0 ? false : _getThemeProps$defaul,
|
|
24
|
-
_getThemeProps$matchM = _getThemeProps.matchMedia,
|
|
25
|
-
matchMedia = _getThemeProps$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _getThemeProps$matchM,
|
|
26
|
-
_getThemeProps$noSsr = _getThemeProps.noSsr,
|
|
27
|
-
noSsr = _getThemeProps$noSsr === void 0 ? false : _getThemeProps$noSsr,
|
|
28
|
-
_getThemeProps$ssrMat = _getThemeProps.ssrMatchMedia,
|
|
29
|
-
ssrMatchMedia = _getThemeProps$ssrMat === void 0 ? null : _getThemeProps$ssrMat;
|
|
30
|
-
|
|
31
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
32
|
-
if (typeof queryInput === 'function' && theme === null) {
|
|
33
|
-
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'));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
38
|
-
query = query.replace(/^@media( ?)/m, '');
|
|
39
|
-
|
|
40
12
|
var _React$useState = React.useState(function () {
|
|
41
13
|
if (noSsr && supportMatchMedia) {
|
|
42
14
|
return matchMedia(query).matches;
|
|
@@ -67,19 +39,102 @@ export default function useMediaQuery(queryInput) {
|
|
|
67
39
|
var updateMatch = function updateMatch() {
|
|
68
40
|
// Workaround Safari wrong implementation of matchMedia
|
|
69
41
|
// TODO can we remove it?
|
|
70
|
-
// https://github.com/mui
|
|
42
|
+
// https://github.com/mui/material-ui/pull/17315#issuecomment-528286677
|
|
71
43
|
if (active) {
|
|
72
44
|
setMatch(queryList.matches);
|
|
73
45
|
}
|
|
74
46
|
};
|
|
75
47
|
|
|
76
|
-
updateMatch();
|
|
48
|
+
updateMatch(); // TODO: Use `addEventListener` once support for Safari < 14 is dropped
|
|
49
|
+
|
|
77
50
|
queryList.addListener(updateMatch);
|
|
78
51
|
return function () {
|
|
79
52
|
active = false;
|
|
80
53
|
queryList.removeListener(updateMatch);
|
|
81
54
|
};
|
|
82
55
|
}, [query, matchMedia, supportMatchMedia]);
|
|
56
|
+
return match;
|
|
57
|
+
} // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
var maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];
|
|
61
|
+
|
|
62
|
+
function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
|
|
63
|
+
var getDefaultSnapshot = React.useCallback(function () {
|
|
64
|
+
return defaultMatches;
|
|
65
|
+
}, [defaultMatches]);
|
|
66
|
+
var getServerSnapshot = React.useMemo(function () {
|
|
67
|
+
if (ssrMatchMedia !== null) {
|
|
68
|
+
var _ssrMatchMedia = ssrMatchMedia(query),
|
|
69
|
+
matches = _ssrMatchMedia.matches;
|
|
70
|
+
|
|
71
|
+
return function () {
|
|
72
|
+
return matches;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return getDefaultSnapshot;
|
|
77
|
+
}, [getDefaultSnapshot, query, ssrMatchMedia]);
|
|
78
|
+
|
|
79
|
+
var _React$useMemo = React.useMemo(function () {
|
|
80
|
+
if (matchMedia === null) {
|
|
81
|
+
return [getDefaultSnapshot, function () {
|
|
82
|
+
return function () {};
|
|
83
|
+
}];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
var mediaQueryList = matchMedia(query);
|
|
87
|
+
return [function () {
|
|
88
|
+
return mediaQueryList.matches;
|
|
89
|
+
}, function (notify) {
|
|
90
|
+
// TODO: Use `addEventListener` once support for Safari < 14 is dropped
|
|
91
|
+
mediaQueryList.addListener(notify);
|
|
92
|
+
return function () {
|
|
93
|
+
mediaQueryList.removeListener(notify);
|
|
94
|
+
};
|
|
95
|
+
}];
|
|
96
|
+
}, [getDefaultSnapshot, matchMedia, query]),
|
|
97
|
+
_React$useMemo2 = _slicedToArray(_React$useMemo, 2),
|
|
98
|
+
getSnapshot = _React$useMemo2[0],
|
|
99
|
+
subscribe = _React$useMemo2[1];
|
|
100
|
+
|
|
101
|
+
var match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
102
|
+
return match;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export default function useMediaQuery(queryInput) {
|
|
106
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
107
|
+
var theme = useTheme(); // Wait for jsdom to support the match media feature.
|
|
108
|
+
// All the browsers MUI support have this built-in.
|
|
109
|
+
// This defensive check is here for simplicity.
|
|
110
|
+
// Most of the time, the match media logic isn't central to people tests.
|
|
111
|
+
|
|
112
|
+
var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
|
|
113
|
+
|
|
114
|
+
var _getThemeProps = getThemeProps({
|
|
115
|
+
name: 'MuiUseMediaQuery',
|
|
116
|
+
props: options,
|
|
117
|
+
theme: theme
|
|
118
|
+
}),
|
|
119
|
+
_getThemeProps$defaul = _getThemeProps.defaultMatches,
|
|
120
|
+
defaultMatches = _getThemeProps$defaul === void 0 ? false : _getThemeProps$defaul,
|
|
121
|
+
_getThemeProps$matchM = _getThemeProps.matchMedia,
|
|
122
|
+
matchMedia = _getThemeProps$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _getThemeProps$matchM,
|
|
123
|
+
_getThemeProps$ssrMat = _getThemeProps.ssrMatchMedia,
|
|
124
|
+
ssrMatchMedia = _getThemeProps$ssrMat === void 0 ? null : _getThemeProps$ssrMat,
|
|
125
|
+
noSsr = _getThemeProps.noSsr;
|
|
126
|
+
|
|
127
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
128
|
+
if (typeof queryInput === 'function' && theme === null) {
|
|
129
|
+
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'));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
|
|
134
|
+
query = query.replace(/^@media( ?)/m, ''); // TODO: Drop `useMediaQueryOld` and use `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable
|
|
135
|
+
|
|
136
|
+
var useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;
|
|
137
|
+
var match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);
|
|
83
138
|
|
|
84
139
|
if (process.env.NODE_ENV !== 'production') {
|
|
85
140
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
|
|
4
4
|
var _ClearIcon, _ArrowDropDownIcon;
|
|
5
5
|
|
|
6
|
-
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"];
|
|
6
|
+
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"];
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import clsx from 'clsx';
|
|
@@ -398,6 +398,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
398
398
|
PaperComponent = Paper,
|
|
399
399
|
PopperComponent = Popper,
|
|
400
400
|
popupIcon = _ArrowDropDownIcon || (_ArrowDropDownIcon = /*#__PURE__*/_jsx(ArrowDropDownIcon, {})),
|
|
401
|
+
readOnly = false,
|
|
401
402
|
renderGroup: renderGroupProp,
|
|
402
403
|
renderInput,
|
|
403
404
|
renderOption: renderOptionProp,
|
|
@@ -431,7 +432,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
431
432
|
} = useAutocomplete(_extends({}, props, {
|
|
432
433
|
componentName: 'Autocomplete'
|
|
433
434
|
}));
|
|
434
|
-
const hasClearIcon = !disableClearable && !disabled && dirty;
|
|
435
|
+
const hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
|
|
435
436
|
const hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
|
|
436
437
|
|
|
437
438
|
const ownerState = _extends({}, props, {
|
|
@@ -550,7 +551,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
|
|
|
550
551
|
},
|
|
551
552
|
inputProps: _extends({
|
|
552
553
|
className: clsx(classes.input),
|
|
553
|
-
disabled
|
|
554
|
+
disabled,
|
|
555
|
+
readOnly
|
|
554
556
|
}, getInputProps())
|
|
555
557
|
})
|
|
556
558
|
})), popupOpen && anchorEl ? /*#__PURE__*/_jsx(AutocompletePopper, {
|
|
@@ -669,7 +671,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
669
671
|
* If `true`, the input's text is cleared on blur if no value is selected.
|
|
670
672
|
*
|
|
671
673
|
* Set to `true` if you want to help the user enter a new value.
|
|
672
|
-
* Set to `false` if you want to help the user resume
|
|
674
|
+
* Set to `false` if you want to help the user resume their search.
|
|
673
675
|
* @default !props.freeSolo
|
|
674
676
|
*/
|
|
675
677
|
clearOnBlur: PropTypes.bool,
|
|
@@ -991,6 +993,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
|
|
|
991
993
|
*/
|
|
992
994
|
popupIcon: PropTypes.node,
|
|
993
995
|
|
|
996
|
+
/**
|
|
997
|
+
* If `true`, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.
|
|
998
|
+
* @default false
|
|
999
|
+
*/
|
|
1000
|
+
readOnly: PropTypes.bool,
|
|
1001
|
+
|
|
994
1002
|
/**
|
|
995
1003
|
* Render the group.
|
|
996
1004
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["children", "className", "max", "spacing", "total", "variant"];
|
|
3
|
+
const _excluded = ["children", "className", "componentsProps", "max", "spacing", "total", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { isFragment } from 'react-is';
|
|
@@ -71,6 +71,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
71
71
|
const {
|
|
72
72
|
children: childrenProp,
|
|
73
73
|
className,
|
|
74
|
+
componentsProps = {},
|
|
74
75
|
max = 5,
|
|
75
76
|
spacing = 'medium',
|
|
76
77
|
total,
|
|
@@ -111,15 +112,16 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
|
|
|
111
112
|
className: clsx(classes.root, className),
|
|
112
113
|
ref: ref
|
|
113
114
|
}, other, {
|
|
114
|
-
children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, {
|
|
115
|
+
children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, _extends({
|
|
115
116
|
ownerState: ownerState,
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
variant: variant
|
|
118
|
+
}, componentsProps.additionalAvatar, {
|
|
119
|
+
className: clsx(classes.avatar, componentsProps.additionalAvatar?.className),
|
|
120
|
+
style: _extends({
|
|
118
121
|
marginLeft
|
|
119
|
-
},
|
|
120
|
-
variant: variant,
|
|
122
|
+
}, componentsProps.additionalAvatar?.style),
|
|
121
123
|
children: ["+", extraAvatars]
|
|
122
|
-
}) : null, children.slice(0, maxAvatars).reverse().map(child => {
|
|
124
|
+
})) : null, children.slice(0, maxAvatars).reverse().map(child => {
|
|
123
125
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
124
126
|
className: clsx(child.props.className, classes.avatar),
|
|
125
127
|
style: _extends({
|
|
@@ -153,6 +155,14 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
|
|
|
153
155
|
*/
|
|
154
156
|
className: PropTypes.string,
|
|
155
157
|
|
|
158
|
+
/**
|
|
159
|
+
* The props used for each slot inside the AvatarGroup.
|
|
160
|
+
* @default {}
|
|
161
|
+
*/
|
|
162
|
+
componentsProps: PropTypes.shape({
|
|
163
|
+
additionalAvatar: PropTypes.object
|
|
164
|
+
}),
|
|
165
|
+
|
|
156
166
|
/**
|
|
157
167
|
* Max avatars to show before +x.
|
|
158
168
|
* @default 5
|
package/modern/Badge/Badge.js
CHANGED
|
@@ -169,7 +169,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
169
169
|
componentsProps = {},
|
|
170
170
|
overlap: overlapProp = 'rectangular',
|
|
171
171
|
color: colorProp = 'default',
|
|
172
|
-
invisible: invisibleProp,
|
|
172
|
+
invisible: invisibleProp = false,
|
|
173
173
|
badgeContent: badgeContentProp,
|
|
174
174
|
showZero = false,
|
|
175
175
|
variant: variantProp = 'standard'
|
|
@@ -183,7 +183,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
|
|
|
183
183
|
});
|
|
184
184
|
let invisible = invisibleProp;
|
|
185
185
|
|
|
186
|
-
if (invisibleProp
|
|
186
|
+
if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {
|
|
187
187
|
invisible = true;
|
|
188
188
|
}
|
|
189
189
|
|
|
@@ -301,6 +301,7 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
|
|
|
301
301
|
|
|
302
302
|
/**
|
|
303
303
|
* If `true`, the badge is invisible.
|
|
304
|
+
* @default false
|
|
304
305
|
*/
|
|
305
306
|
invisible: PropTypes.bool,
|
|
306
307
|
|
|
@@ -6,9 +6,7 @@ import styled from '../styles/styled';
|
|
|
6
6
|
import MoreHorizIcon from '../internal/svg-icons/MoreHoriz';
|
|
7
7
|
import ButtonBase from '../ButtonBase';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const BreadcrumbCollapsedButton = styled(ButtonBase
|
|
10
|
-
skipSx: true
|
|
11
|
-
})(({
|
|
9
|
+
const BreadcrumbCollapsedButton = styled(ButtonBase)(({
|
|
12
10
|
theme
|
|
13
11
|
}) => _extends({
|
|
14
12
|
display: 'flex',
|