@mui/material 5.10.11 → 5.10.13
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/Alert/Alert.d.ts +34 -3
- package/Alert/Alert.js +46 -9
- package/Autocomplete/Autocomplete.d.ts +10 -0
- package/Autocomplete/Autocomplete.js +27 -11
- package/AvatarGroup/AvatarGroup.d.ts +18 -1
- package/AvatarGroup/AvatarGroup.js +25 -6
- package/Backdrop/Backdrop.d.ts +33 -3
- package/Backdrop/Backdrop.js +46 -11
- package/Badge/Badge.d.ts +11 -3
- package/Badge/Badge.js +11 -3
- package/ButtonBase/TouchRipple.js +1 -1
- package/CHANGELOG.md +134 -0
- package/Chip/Chip.js +8 -4
- package/FilledInput/FilledInput.js +48 -9
- package/FormControl/FormControl.js +29 -29
- package/FormControlLabel/FormControlLabel.d.ts +12 -0
- package/FormControlLabel/FormControlLabel.js +17 -5
- package/Input/Input.js +49 -10
- package/InputBase/InputBase.d.ts +34 -3
- package/InputBase/InputBase.js +45 -8
- package/ListItem/ListItem.d.ts +32 -3
- package/ListItem/ListItem.js +43 -11
- package/ListItemButton/ListItemButton.js +2 -2
- package/MenuItem/MenuItem.js +2 -2
- package/Modal/Modal.d.ts +11 -3
- package/Modal/Modal.js +11 -3
- package/NativeSelect/NativeSelectInput.js +11 -9
- package/OutlinedInput/OutlinedInput.js +26 -8
- package/PaginationItem/PaginationItem.d.ts +19 -7
- package/PaginationItem/PaginationItem.js +31 -22
- package/README.md +1 -0
- package/Radio/Radio.js +2 -1
- package/RadioGroup/RadioGroup.js +12 -12
- package/Select/Select.d.ts +3 -3
- package/Select/Select.js +3 -3
- package/Slider/Slider.d.ts +14 -2
- package/Slider/Slider.js +12 -3
- package/StepLabel/StepLabel.d.ts +11 -0
- package/StepLabel/StepLabel.js +15 -3
- package/SwipeableDrawer/SwipeableDrawer.js +10 -2
- package/Tooltip/Tooltip.d.ts +43 -6
- package/Tooltip/Tooltip.js +69 -32
- package/Unstable_Grid2/Grid2Props.d.ts +1 -1
- package/esm/Alert/Alert.js +46 -9
- package/esm/Autocomplete/Autocomplete.js +27 -11
- package/esm/AvatarGroup/AvatarGroup.js +25 -6
- package/esm/Backdrop/Backdrop.js +46 -11
- package/esm/Badge/Badge.js +11 -3
- package/esm/ButtonBase/TouchRipple.js +1 -1
- package/esm/Chip/Chip.js +8 -4
- package/esm/FilledInput/FilledInput.js +48 -9
- package/esm/FormControl/FormControl.js +29 -29
- package/esm/FormControlLabel/FormControlLabel.js +17 -5
- package/esm/Input/Input.js +49 -10
- package/esm/InputBase/InputBase.js +45 -8
- package/esm/ListItem/ListItem.js +43 -11
- package/esm/ListItemButton/ListItemButton.js +2 -2
- package/esm/MenuItem/MenuItem.js +2 -2
- package/esm/Modal/Modal.js +11 -3
- package/esm/NativeSelect/NativeSelectInput.js +11 -9
- package/esm/OutlinedInput/OutlinedInput.js +26 -8
- package/esm/PaginationItem/PaginationItem.js +31 -22
- package/esm/Radio/Radio.js +2 -1
- package/esm/RadioGroup/RadioGroup.js +12 -12
- package/esm/Select/Select.js +3 -3
- package/esm/Slider/Slider.js +12 -3
- package/esm/StepLabel/StepLabel.js +15 -3
- package/esm/SwipeableDrawer/SwipeableDrawer.js +9 -2
- package/esm/Tooltip/Tooltip.js +69 -32
- package/index.js +1 -1
- package/legacy/Alert/Alert.js +48 -9
- package/legacy/Autocomplete/Autocomplete.js +27 -10
- package/legacy/AvatarGroup/AvatarGroup.js +26 -6
- package/legacy/Backdrop/Backdrop.js +48 -11
- package/legacy/Badge/Badge.js +11 -3
- package/legacy/ButtonBase/TouchRipple.js +1 -1
- package/legacy/Chip/Chip.js +8 -4
- package/legacy/FilledInput/FilledInput.js +49 -9
- package/legacy/FormControl/FormControl.js +29 -29
- package/legacy/FormControlLabel/FormControlLabel.js +17 -4
- package/legacy/Input/Input.js +50 -10
- package/legacy/InputBase/InputBase.js +47 -8
- package/legacy/ListItem/ListItem.js +49 -13
- package/legacy/ListItemButton/ListItemButton.js +7 -5
- package/legacy/MenuItem/MenuItem.js +6 -4
- package/legacy/Modal/Modal.js +11 -3
- package/legacy/NativeSelect/NativeSelectInput.js +11 -9
- package/legacy/OutlinedInput/OutlinedInput.js +27 -8
- package/legacy/PaginationItem/PaginationItem.js +32 -22
- package/legacy/Radio/Radio.js +2 -1
- package/legacy/RadioGroup/RadioGroup.js +14 -14
- package/legacy/Select/Select.js +3 -3
- package/legacy/Slider/Slider.js +12 -3
- package/legacy/StepLabel/StepLabel.js +16 -3
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +9 -2
- package/legacy/Tooltip/Tooltip.js +64 -23
- package/legacy/index.js +1 -1
- package/modern/Alert/Alert.js +45 -8
- package/modern/Autocomplete/Autocomplete.js +26 -10
- package/modern/AvatarGroup/AvatarGroup.js +24 -5
- package/modern/Backdrop/Backdrop.js +45 -10
- package/modern/Badge/Badge.js +11 -3
- package/modern/ButtonBase/TouchRipple.js +1 -1
- package/modern/Chip/Chip.js +8 -4
- package/modern/FilledInput/FilledInput.js +46 -9
- package/modern/FormControl/FormControl.js +29 -29
- package/modern/FormControlLabel/FormControlLabel.js +15 -5
- package/modern/Input/Input.js +47 -10
- package/modern/InputBase/InputBase.js +43 -8
- package/modern/ListItem/ListItem.js +43 -11
- package/modern/ListItemButton/ListItemButton.js +2 -2
- package/modern/MenuItem/MenuItem.js +2 -2
- package/modern/Modal/Modal.js +11 -3
- package/modern/NativeSelect/NativeSelectInput.js +11 -9
- package/modern/OutlinedInput/OutlinedInput.js +25 -7
- package/modern/PaginationItem/PaginationItem.js +31 -22
- package/modern/Radio/Radio.js +2 -1
- package/modern/RadioGroup/RadioGroup.js +12 -12
- package/modern/Select/Select.js +3 -3
- package/modern/Slider/Slider.js +12 -3
- package/modern/StepLabel/StepLabel.js +13 -3
- package/modern/SwipeableDrawer/SwipeableDrawer.js +9 -2
- package/modern/Tooltip/Tooltip.js +59 -18
- package/modern/index.js +1 -1
- package/package.json +4 -4
- package/umd/material-ui.development.js +617 -234
- package/umd/material-ui.production.min.js +20 -20
|
@@ -164,14 +164,20 @@ var ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
|
|
|
164
164
|
secondaryAction = props.secondaryAction,
|
|
165
165
|
_props$selected = props.selected,
|
|
166
166
|
selected = _props$selected === void 0 ? false : _props$selected,
|
|
167
|
-
|
|
167
|
+
_props$slotProps = props.slotProps,
|
|
168
|
+
slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
|
|
169
|
+
_props$slots = props.slots,
|
|
170
|
+
slots = _props$slots === void 0 ? {} : _props$slots,
|
|
171
|
+
other = _objectWithoutProperties(props, ["alignItems", "autoFocus", "button", "children", "className", "component", "components", "componentsProps", "ContainerComponent", "ContainerProps", "dense", "disabled", "disableGutters", "disablePadding", "divider", "focusVisibleClassName", "secondaryAction", "selected", "slotProps", "slots"]);
|
|
168
172
|
|
|
169
173
|
var context = React.useContext(ListContext);
|
|
170
|
-
var childContext = {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
var childContext = React.useMemo(function () {
|
|
175
|
+
return {
|
|
176
|
+
dense: dense || context.dense || false,
|
|
177
|
+
alignItems: alignItems,
|
|
178
|
+
disableGutters: disableGutters
|
|
179
|
+
};
|
|
180
|
+
}, [alignItems, context.dense, dense, disableGutters]);
|
|
175
181
|
var listItemRef = React.useRef(null);
|
|
176
182
|
useEnhancedEffect(function () {
|
|
177
183
|
if (autoFocus) {
|
|
@@ -201,8 +207,8 @@ var ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
|
|
|
201
207
|
|
|
202
208
|
var classes = useUtilityClasses(ownerState);
|
|
203
209
|
var handleRef = useForkRef(listItemRef, ref);
|
|
204
|
-
var Root = components.Root || ListItemRoot;
|
|
205
|
-
var rootProps = componentsProps.root || {};
|
|
210
|
+
var Root = slots.root || components.Root || ListItemRoot;
|
|
211
|
+
var rootProps = slotProps.root || componentsProps.root || {};
|
|
206
212
|
|
|
207
213
|
var componentProps = _extends({
|
|
208
214
|
className: clsx(classes.root, rootProps.className, className),
|
|
@@ -252,8 +258,7 @@ var ListItem = /*#__PURE__*/React.forwardRef(function ListItem(inProps, ref) {
|
|
|
252
258
|
value: childContext,
|
|
253
259
|
children: /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {
|
|
254
260
|
as: Component,
|
|
255
|
-
ref: handleRef
|
|
256
|
-
ownerState: ownerState
|
|
261
|
+
ref: handleRef
|
|
257
262
|
}, !isHostComponent(Root) && {
|
|
258
263
|
ownerState: _extends({}, ownerState, rootProps.ownerState)
|
|
259
264
|
}, componentProps, {
|
|
@@ -336,8 +341,11 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
|
|
|
336
341
|
component: PropTypes.elementType,
|
|
337
342
|
|
|
338
343
|
/**
|
|
339
|
-
* The components used for each slot inside
|
|
340
|
-
*
|
|
344
|
+
* The components used for each slot inside.
|
|
345
|
+
*
|
|
346
|
+
* This prop is an alias for the `slots` prop.
|
|
347
|
+
* It's recommended to use the `slots` prop instead.
|
|
348
|
+
*
|
|
341
349
|
* @default {}
|
|
342
350
|
*/
|
|
343
351
|
components: PropTypes.shape({
|
|
@@ -345,7 +353,12 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
|
|
|
345
353
|
}),
|
|
346
354
|
|
|
347
355
|
/**
|
|
348
|
-
* The props
|
|
356
|
+
* The extra props for the slot components.
|
|
357
|
+
* You can override the existing props or add new ones.
|
|
358
|
+
*
|
|
359
|
+
* This prop is an alias for the `slotProps` prop.
|
|
360
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
361
|
+
*
|
|
349
362
|
* @default {}
|
|
350
363
|
*/
|
|
351
364
|
componentsProps: PropTypes.shape({
|
|
@@ -415,6 +428,29 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes
|
|
|
415
428
|
*/
|
|
416
429
|
selected: PropTypes.bool,
|
|
417
430
|
|
|
431
|
+
/**
|
|
432
|
+
* The extra props for the slot components.
|
|
433
|
+
* You can override the existing props or add new ones.
|
|
434
|
+
*
|
|
435
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
436
|
+
*
|
|
437
|
+
* @default {}
|
|
438
|
+
*/
|
|
439
|
+
slotProps: PropTypes.shape({
|
|
440
|
+
root: PropTypes.object
|
|
441
|
+
}),
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* The components used for each slot inside.
|
|
445
|
+
*
|
|
446
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
447
|
+
*
|
|
448
|
+
* @default {}
|
|
449
|
+
*/
|
|
450
|
+
slots: PropTypes.shape({
|
|
451
|
+
root: PropTypes.elementType
|
|
452
|
+
}),
|
|
453
|
+
|
|
418
454
|
/**
|
|
419
455
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
420
456
|
*/
|
|
@@ -122,11 +122,13 @@ var ListItemButton = /*#__PURE__*/React.forwardRef(function ListItemButton(inPro
|
|
|
122
122
|
other = _objectWithoutProperties(props, ["alignItems", "autoFocus", "component", "children", "dense", "disableGutters", "divider", "focusVisibleClassName", "selected", "className"]);
|
|
123
123
|
|
|
124
124
|
var context = React.useContext(ListContext);
|
|
125
|
-
var childContext = {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
var childContext = React.useMemo(function () {
|
|
126
|
+
return {
|
|
127
|
+
dense: dense || context.dense || false,
|
|
128
|
+
alignItems: alignItems,
|
|
129
|
+
disableGutters: disableGutters
|
|
130
|
+
};
|
|
131
|
+
}, [alignItems, context.dense, dense, disableGutters]);
|
|
130
132
|
var listItemRef = React.useRef(null);
|
|
131
133
|
useEnhancedEffect(function () {
|
|
132
134
|
if (autoFocus) {
|
|
@@ -135,10 +135,12 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {
|
|
|
135
135
|
other = _objectWithoutProperties(props, ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex", "className"]);
|
|
136
136
|
|
|
137
137
|
var context = React.useContext(ListContext);
|
|
138
|
-
var childContext = {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
var childContext = React.useMemo(function () {
|
|
139
|
+
return {
|
|
140
|
+
dense: dense || context.dense || false,
|
|
141
|
+
disableGutters: disableGutters
|
|
142
|
+
};
|
|
143
|
+
}, [context.dense, dense, disableGutters]);
|
|
142
144
|
var menuItemRef = React.useRef(null);
|
|
143
145
|
useEnhancedEffect(function () {
|
|
144
146
|
if (autoFocus) {
|
package/legacy/Modal/Modal.js
CHANGED
|
@@ -206,8 +206,11 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
206
206
|
component: PropTypes.elementType,
|
|
207
207
|
|
|
208
208
|
/**
|
|
209
|
-
* The components used for each slot inside
|
|
210
|
-
*
|
|
209
|
+
* The components used for each slot inside.
|
|
210
|
+
*
|
|
211
|
+
* This prop is an alias for the `slots` prop.
|
|
212
|
+
* It's recommended to use the `slots` prop instead.
|
|
213
|
+
*
|
|
211
214
|
* @default {}
|
|
212
215
|
*/
|
|
213
216
|
components: PropTypes.shape({
|
|
@@ -216,7 +219,12 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes
|
|
|
216
219
|
}),
|
|
217
220
|
|
|
218
221
|
/**
|
|
219
|
-
* The props
|
|
222
|
+
* The extra props for the slot components.
|
|
223
|
+
* You can override the existing props or add new ones.
|
|
224
|
+
*
|
|
225
|
+
* This prop is an alias for the `slotProps` prop.
|
|
226
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
227
|
+
*
|
|
220
228
|
* @default {}
|
|
221
229
|
*/
|
|
222
230
|
componentsProps: PropTypes.shape({
|
|
@@ -41,12 +41,14 @@ export var nativeSelectSelectStyles = function nativeSelectSelectStyles(_ref) {
|
|
|
41
41
|
borderRadius: 0,
|
|
42
42
|
// Reset
|
|
43
43
|
cursor: 'pointer',
|
|
44
|
-
'&:focus': {
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
'&:focus': _extends({}, theme.vars ? {
|
|
45
|
+
backgroundColor: "rgba(".concat(theme.vars.palette.common.onBackgroundChannel, " / 0.05)")
|
|
46
|
+
} : {
|
|
47
|
+
backgroundColor: theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)'
|
|
48
|
+
}, {
|
|
47
49
|
borderRadius: 0 // Reset Chrome style
|
|
48
50
|
|
|
49
|
-
},
|
|
51
|
+
}),
|
|
50
52
|
// Remove IE11 arrow
|
|
51
53
|
'&::-ms-expand': {
|
|
52
54
|
display: 'none'
|
|
@@ -56,7 +58,7 @@ export var nativeSelectSelectStyles = function nativeSelectSelectStyles(_ref) {
|
|
|
56
58
|
}), _defineProperty(_extends2, '&[multiple]', {
|
|
57
59
|
height: 'auto'
|
|
58
60
|
}), _defineProperty(_extends2, '&:not([multiple]) option, &:not([multiple]) optgroup', {
|
|
59
|
-
backgroundColor: theme.palette.background.paper
|
|
61
|
+
backgroundColor: (theme.vars || theme).palette.background.paper
|
|
60
62
|
}), _defineProperty(_extends2, '&&&', {
|
|
61
63
|
paddingRight: 24,
|
|
62
64
|
minWidth: 16 // So it doesn't collapse.
|
|
@@ -66,9 +68,9 @@ export var nativeSelectSelectStyles = function nativeSelectSelectStyles(_ref) {
|
|
|
66
68
|
paddingRight: 32
|
|
67
69
|
}
|
|
68
70
|
}, ownerState.variant === 'outlined' && {
|
|
69
|
-
borderRadius: theme.shape.borderRadius,
|
|
71
|
+
borderRadius: (theme.vars || theme).shape.borderRadius,
|
|
70
72
|
'&:focus': {
|
|
71
|
-
borderRadius: theme.shape.borderRadius // Reset the reset for Chrome style
|
|
73
|
+
borderRadius: (theme.vars || theme).shape.borderRadius // Reset the reset for Chrome style
|
|
72
74
|
|
|
73
75
|
},
|
|
74
76
|
'&&&': {
|
|
@@ -97,9 +99,9 @@ export var nativeSelectIconStyles = function nativeSelectIconStyles(_ref3) {
|
|
|
97
99
|
// Center vertically, height is 1em
|
|
98
100
|
pointerEvents: 'none',
|
|
99
101
|
// Don't block pointer events on the select under the icon.
|
|
100
|
-
color: theme.palette.action.active
|
|
102
|
+
color: (theme.vars || theme).palette.action.active
|
|
101
103
|
}, "&.".concat(nativeSelectClasses.disabled), {
|
|
102
|
-
color: theme.palette.action.disabled
|
|
104
|
+
color: (theme.vars || theme).palette.action.disabled
|
|
103
105
|
}), ownerState.open && {
|
|
104
106
|
transform: 'rotate(180deg)'
|
|
105
107
|
}, ownerState.variant === 'filled' && {
|
|
@@ -113,7 +113,7 @@ var OutlinedInputInput = styled(InputBaseInput, {
|
|
|
113
113
|
});
|
|
114
114
|
});
|
|
115
115
|
var OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
|
|
116
|
-
var _React$Fragment;
|
|
116
|
+
var _ref5, _slots$root, _ref6, _slots$input, _React$Fragment;
|
|
117
117
|
|
|
118
118
|
var props = useThemeProps({
|
|
119
119
|
props: inProps,
|
|
@@ -130,9 +130,11 @@ var OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps
|
|
|
130
130
|
_props$multiline = props.multiline,
|
|
131
131
|
multiline = _props$multiline === void 0 ? false : _props$multiline,
|
|
132
132
|
notched = props.notched,
|
|
133
|
+
_props$slots = props.slots,
|
|
134
|
+
slots = _props$slots === void 0 ? {} : _props$slots,
|
|
133
135
|
_props$type = props.type,
|
|
134
136
|
type = _props$type === void 0 ? 'text' : _props$type,
|
|
135
|
-
other = _objectWithoutProperties(props, ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "type"]);
|
|
137
|
+
other = _objectWithoutProperties(props, ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"]);
|
|
136
138
|
|
|
137
139
|
var classes = useUtilityClasses(props);
|
|
138
140
|
var muiFormControl = useFormControl();
|
|
@@ -155,11 +157,13 @@ var OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps
|
|
|
155
157
|
type: type
|
|
156
158
|
});
|
|
157
159
|
|
|
160
|
+
var RootSlot = (_ref5 = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref5 : OutlinedInputRoot;
|
|
161
|
+
var InputSlot = (_ref6 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref6 : OutlinedInputInput;
|
|
158
162
|
return /*#__PURE__*/_jsx(InputBase, _extends({
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
+
slots: {
|
|
164
|
+
root: RootSlot,
|
|
165
|
+
input: InputSlot
|
|
166
|
+
},
|
|
163
167
|
renderSuffix: function renderSuffix(state) {
|
|
164
168
|
return /*#__PURE__*/_jsx(NotchedOutlineRoot, {
|
|
165
169
|
ownerState: ownerState,
|
|
@@ -217,8 +221,11 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes
|
|
|
217
221
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
|
|
218
222
|
|
|
219
223
|
/**
|
|
220
|
-
* The components used for each slot inside
|
|
221
|
-
*
|
|
224
|
+
* The components used for each slot inside.
|
|
225
|
+
*
|
|
226
|
+
* This prop is an alias for the `slots` prop.
|
|
227
|
+
* It's recommended to use the `slots` prop instead.
|
|
228
|
+
*
|
|
222
229
|
* @default {}
|
|
223
230
|
*/
|
|
224
231
|
components: PropTypes.shape({
|
|
@@ -346,6 +353,18 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes
|
|
|
346
353
|
*/
|
|
347
354
|
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
348
355
|
|
|
356
|
+
/**
|
|
357
|
+
* The components used for each slot inside.
|
|
358
|
+
*
|
|
359
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
360
|
+
*
|
|
361
|
+
* @default {}
|
|
362
|
+
*/
|
|
363
|
+
slots: PropTypes.shape({
|
|
364
|
+
input: PropTypes.elementType,
|
|
365
|
+
root: PropTypes.elementType
|
|
366
|
+
}),
|
|
367
|
+
|
|
349
368
|
/**
|
|
350
369
|
* Start `InputAdornment` for this component.
|
|
351
370
|
*/
|
|
@@ -204,12 +204,7 @@ var PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inPro
|
|
|
204
204
|
color = _props$color === void 0 ? 'standard' : _props$color,
|
|
205
205
|
component = props.component,
|
|
206
206
|
_props$components = props.components,
|
|
207
|
-
components = _props$components === void 0 ? {
|
|
208
|
-
first: FirstPageIcon,
|
|
209
|
-
last: LastPageIcon,
|
|
210
|
-
next: NavigateNextIcon,
|
|
211
|
-
previous: NavigateBeforeIcon
|
|
212
|
-
} : _props$components,
|
|
207
|
+
components = _props$components === void 0 ? {} : _props$components,
|
|
213
208
|
_props$disabled = props.disabled,
|
|
214
209
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
215
210
|
page = props.page,
|
|
@@ -219,11 +214,13 @@ var PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inPro
|
|
|
219
214
|
shape = _props$shape === void 0 ? 'circular' : _props$shape,
|
|
220
215
|
_props$size = props.size,
|
|
221
216
|
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
217
|
+
_props$slots = props.slots,
|
|
218
|
+
slots = _props$slots === void 0 ? {} : _props$slots,
|
|
222
219
|
_props$type = props.type,
|
|
223
220
|
type = _props$type === void 0 ? 'page' : _props$type,
|
|
224
221
|
_props$variant = props.variant,
|
|
225
222
|
variant = _props$variant === void 0 ? 'text' : _props$variant,
|
|
226
|
-
other = _objectWithoutProperties(props, ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "type", "variant"]);
|
|
223
|
+
other = _objectWithoutProperties(props, ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "type", "variant"]);
|
|
227
224
|
|
|
228
225
|
var ownerState = _extends({}, props, {
|
|
229
226
|
color: color,
|
|
@@ -238,15 +235,15 @@ var PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inPro
|
|
|
238
235
|
var theme = useTheme();
|
|
239
236
|
var classes = useUtilityClasses(ownerState);
|
|
240
237
|
var normalizedIcons = theme.direction === 'rtl' ? {
|
|
241
|
-
previous: components.next || NavigateNextIcon,
|
|
242
|
-
next: components.previous || NavigateBeforeIcon,
|
|
243
|
-
last: components.first || FirstPageIcon,
|
|
244
|
-
first: components.last || LastPageIcon
|
|
238
|
+
previous: slots.next || components.next || NavigateNextIcon,
|
|
239
|
+
next: slots.previous || components.previous || NavigateBeforeIcon,
|
|
240
|
+
last: slots.first || components.first || FirstPageIcon,
|
|
241
|
+
first: slots.last || components.last || LastPageIcon
|
|
245
242
|
} : {
|
|
246
|
-
previous: components.previous || NavigateBeforeIcon,
|
|
247
|
-
next: components.next || NavigateNextIcon,
|
|
248
|
-
first: components.first || FirstPageIcon,
|
|
249
|
-
last: components.last || LastPageIcon
|
|
243
|
+
previous: slots.previous || components.previous || NavigateBeforeIcon,
|
|
244
|
+
next: slots.next || components.next || NavigateNextIcon,
|
|
245
|
+
first: slots.first || components.first || FirstPageIcon,
|
|
246
|
+
last: slots.last || components.last || LastPageIcon
|
|
250
247
|
};
|
|
251
248
|
var Icon = normalizedIcons[type];
|
|
252
249
|
return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/_jsx(PaginationItemEllipsis, {
|
|
@@ -308,13 +305,12 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes
|
|
|
308
305
|
component: PropTypes.elementType,
|
|
309
306
|
|
|
310
307
|
/**
|
|
311
|
-
* The components used for
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
* }
|
|
308
|
+
* The components used for each slot inside.
|
|
309
|
+
*
|
|
310
|
+
* This prop is an alias for the `slots` prop.
|
|
311
|
+
* It's recommended to use the `slots` prop instead.
|
|
312
|
+
*
|
|
313
|
+
* @default {}
|
|
318
314
|
*/
|
|
319
315
|
components: PropTypes.shape({
|
|
320
316
|
first: PropTypes.elementType,
|
|
@@ -354,6 +350,20 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes
|
|
|
354
350
|
/* @typescript-to-proptypes-ignore */
|
|
355
351
|
.oneOfType([PropTypes.oneOf(['small', 'medium', 'large']), PropTypes.string]),
|
|
356
352
|
|
|
353
|
+
/**
|
|
354
|
+
* The components used for each slot inside.
|
|
355
|
+
*
|
|
356
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
357
|
+
*
|
|
358
|
+
* @default {}
|
|
359
|
+
*/
|
|
360
|
+
slots: PropTypes.shape({
|
|
361
|
+
first: PropTypes.elementType,
|
|
362
|
+
last: PropTypes.elementType,
|
|
363
|
+
next: PropTypes.elementType,
|
|
364
|
+
previous: PropTypes.elementType
|
|
365
|
+
}),
|
|
366
|
+
|
|
357
367
|
/**
|
|
358
368
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
359
369
|
*/
|
package/legacy/Radio/Radio.js
CHANGED
|
@@ -41,7 +41,8 @@ var RadioRoot = styled(SwitchBase, {
|
|
|
41
41
|
var theme = _ref.theme,
|
|
42
42
|
ownerState = _ref.ownerState;
|
|
43
43
|
return _extends({
|
|
44
|
-
color: (theme.vars || theme).palette.text.secondary
|
|
44
|
+
color: (theme.vars || theme).palette.text.secondary
|
|
45
|
+
}, !ownerState.disableRipple && {
|
|
45
46
|
'&:hover': {
|
|
46
47
|
backgroundColor: theme.vars ? "rgba(".concat(ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette[ownerState.color].mainChannel, " / ").concat(theme.vars.palette.action.hoverOpacity, ")") : alpha(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
47
48
|
// Reset on touch devices, it doesn't add specificity
|
|
@@ -14,7 +14,7 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
|
|
|
14
14
|
children = props.children,
|
|
15
15
|
defaultValue = props.defaultValue,
|
|
16
16
|
nameProp = props.name,
|
|
17
|
-
|
|
17
|
+
_onChange = props.onChange,
|
|
18
18
|
valueProp = props.value,
|
|
19
19
|
other = _objectWithoutProperties(props, ["actions", "children", "defaultValue", "name", "onChange", "value"]);
|
|
20
20
|
|
|
@@ -45,22 +45,22 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref) {
|
|
|
45
45
|
};
|
|
46
46
|
}, []);
|
|
47
47
|
var handleRef = useForkRef(ref, rootRef);
|
|
48
|
-
|
|
49
|
-
var handleChange = function handleChange(event) {
|
|
50
|
-
setValueState(event.target.value);
|
|
51
|
-
|
|
52
|
-
if (onChange) {
|
|
53
|
-
onChange(event, event.target.value);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
48
|
var name = useId(nameProp);
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
var contextValue = React.useMemo(function () {
|
|
50
|
+
return {
|
|
60
51
|
name: name,
|
|
61
|
-
onChange:
|
|
52
|
+
onChange: function onChange(event) {
|
|
53
|
+
setValueState(event.target.value);
|
|
54
|
+
|
|
55
|
+
if (_onChange) {
|
|
56
|
+
_onChange(event, event.target.value);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
62
59
|
value: value
|
|
63
|
-
}
|
|
60
|
+
};
|
|
61
|
+
}, [name, _onChange, setValueState, value]);
|
|
62
|
+
return /*#__PURE__*/_jsx(RadioGroupContext.Provider, {
|
|
63
|
+
value: contextValue,
|
|
64
64
|
children: /*#__PURE__*/_jsx(FormGroup, _extends({
|
|
65
65
|
role: "radiogroup",
|
|
66
66
|
ref: handleRef
|
package/legacy/Select/Select.js
CHANGED
|
@@ -251,14 +251,14 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
|
251
251
|
*
|
|
252
252
|
* @param {SelectChangeEvent<T>} event The event source of the callback.
|
|
253
253
|
* You can pull out the new value by accessing `event.target.value` (any).
|
|
254
|
-
* **Warning**: This is a generic event not a change event unless the change event is caused by browser autofill.
|
|
254
|
+
* **Warning**: This is a generic event, not a change event, unless the change event is caused by browser autofill.
|
|
255
255
|
* @param {object} [child] The react element that was selected when `native` is `false` (default).
|
|
256
256
|
*/
|
|
257
257
|
onChange: PropTypes.func,
|
|
258
258
|
|
|
259
259
|
/**
|
|
260
260
|
* Callback fired when the component requests to be closed.
|
|
261
|
-
* Use in controlled
|
|
261
|
+
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapes).
|
|
262
262
|
*
|
|
263
263
|
* @param {object} event The event source of the callback.
|
|
264
264
|
*/
|
|
@@ -266,7 +266,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
|
266
266
|
|
|
267
267
|
/**
|
|
268
268
|
* Callback fired when the component requests to be opened.
|
|
269
|
-
* Use in controlled
|
|
269
|
+
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select expands).
|
|
270
270
|
*
|
|
271
271
|
* @param {object} event The event source of the callback.
|
|
272
272
|
*/
|
package/legacy/Slider/Slider.js
CHANGED
|
@@ -594,8 +594,11 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
594
594
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
|
|
595
595
|
|
|
596
596
|
/**
|
|
597
|
-
* The components used for each slot inside
|
|
598
|
-
*
|
|
597
|
+
* The components used for each slot inside.
|
|
598
|
+
*
|
|
599
|
+
* This prop is an alias for the `slots` prop.
|
|
600
|
+
* It's recommended to use the `slots` prop instead.
|
|
601
|
+
*
|
|
599
602
|
* @default {}
|
|
600
603
|
*/
|
|
601
604
|
components: PropTypes.shape({
|
|
@@ -610,7 +613,13 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
610
613
|
}),
|
|
611
614
|
|
|
612
615
|
/**
|
|
613
|
-
*
|
|
616
|
+
* The extra props for the slot components.
|
|
617
|
+
* You can override the existing props or add new ones.
|
|
618
|
+
*
|
|
619
|
+
* This prop is an alias for the `slotProps` prop.
|
|
620
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
621
|
+
*
|
|
622
|
+
* @default {}
|
|
614
623
|
*/
|
|
615
624
|
componentsProps: PropTypes.shape({
|
|
616
625
|
input: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
@@ -113,6 +113,8 @@ var StepLabelLabelContainer = styled('span', {
|
|
|
113
113
|
});
|
|
114
114
|
});
|
|
115
115
|
var StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref) {
|
|
116
|
+
var _slotProps$label;
|
|
117
|
+
|
|
116
118
|
var props = useThemeProps({
|
|
117
119
|
props: inProps,
|
|
118
120
|
name: 'MuiStepLabel'
|
|
@@ -126,9 +128,11 @@ var StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref) {
|
|
|
126
128
|
error = _props$error === void 0 ? false : _props$error,
|
|
127
129
|
iconProp = props.icon,
|
|
128
130
|
optional = props.optional,
|
|
131
|
+
_props$slotProps = props.slotProps,
|
|
132
|
+
slotProps = _props$slotProps === void 0 ? {} : _props$slotProps,
|
|
129
133
|
StepIconComponentProp = props.StepIconComponent,
|
|
130
134
|
StepIconProps = props.StepIconProps,
|
|
131
|
-
other = _objectWithoutProperties(props, ["children", "className", "componentsProps", "error", "icon", "optional", "StepIconComponent", "StepIconProps"]);
|
|
135
|
+
other = _objectWithoutProperties(props, ["children", "className", "componentsProps", "error", "icon", "optional", "slotProps", "StepIconComponent", "StepIconProps"]);
|
|
132
136
|
|
|
133
137
|
var _React$useContext = React.useContext(StepperContext),
|
|
134
138
|
alternativeLabel = _React$useContext.alternativeLabel,
|
|
@@ -157,6 +161,7 @@ var StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref) {
|
|
|
157
161
|
});
|
|
158
162
|
|
|
159
163
|
var classes = useUtilityClasses(ownerState);
|
|
164
|
+
var labelSlotProps = (_slotProps$label = slotProps.label) != null ? _slotProps$label : componentsProps.label;
|
|
160
165
|
return /*#__PURE__*/_jsxs(StepLabelRoot, _extends({
|
|
161
166
|
className: clsx(classes.root, className),
|
|
162
167
|
ref: ref,
|
|
@@ -175,9 +180,9 @@ var StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref) {
|
|
|
175
180
|
className: classes.labelContainer,
|
|
176
181
|
ownerState: ownerState,
|
|
177
182
|
children: [children ? /*#__PURE__*/_jsx(StepLabelLabel, _extends({
|
|
178
|
-
className: classes.label,
|
|
179
183
|
ownerState: ownerState
|
|
180
|
-
},
|
|
184
|
+
}, labelSlotProps, {
|
|
185
|
+
className: clsx(classes.label, labelSlotProps == null ? void 0 : labelSlotProps.className),
|
|
181
186
|
children: children
|
|
182
187
|
})) : null, optional]
|
|
183
188
|
})]
|
|
@@ -230,6 +235,14 @@ process.env.NODE_ENV !== "production" ? StepLabel.propTypes
|
|
|
230
235
|
*/
|
|
231
236
|
optional: PropTypes.node,
|
|
232
237
|
|
|
238
|
+
/**
|
|
239
|
+
* The props used for each slot inside.
|
|
240
|
+
* @default {}
|
|
241
|
+
*/
|
|
242
|
+
slotProps: PropTypes.shape({
|
|
243
|
+
label: PropTypes.object
|
|
244
|
+
}),
|
|
245
|
+
|
|
233
246
|
/**
|
|
234
247
|
* The component to render in place of the [`StepIcon`](/material-ui/api/step-icon/).
|
|
235
248
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import { flushSync } from 'react-dom';
|
|
4
5
|
import PropTypes from 'prop-types';
|
|
5
6
|
import { elementTypeAcceptingRef } from '@mui/utils';
|
|
6
7
|
import { useThemeProps } from '@mui/system';
|
|
@@ -227,7 +228,9 @@ var SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(inP
|
|
|
227
228
|
|
|
228
229
|
claimedSwipeInstance = null;
|
|
229
230
|
touchDetected.current = false;
|
|
230
|
-
|
|
231
|
+
flushSync(function () {
|
|
232
|
+
setMaybeSwiping(false);
|
|
233
|
+
}); // The swipe wasn't started.
|
|
231
234
|
|
|
232
235
|
if (!swipeInstance.current.isSwiping) {
|
|
233
236
|
swipeInstance.current.isSwiping = null;
|
|
@@ -429,7 +432,9 @@ var SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(inP
|
|
|
429
432
|
claimedSwipeInstance = null;
|
|
430
433
|
swipeInstance.current.startX = currentX;
|
|
431
434
|
swipeInstance.current.startY = currentY;
|
|
432
|
-
|
|
435
|
+
flushSync(function () {
|
|
436
|
+
setMaybeSwiping(true);
|
|
437
|
+
});
|
|
433
438
|
|
|
434
439
|
if (!open && paperRef.current) {
|
|
435
440
|
// The ref may be null when a parent component updates while swiping.
|
|
@@ -487,6 +492,8 @@ var SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(inP
|
|
|
487
492
|
BackdropProps: _extends({}, BackdropProps, {
|
|
488
493
|
ref: backdropRef
|
|
489
494
|
})
|
|
495
|
+
}, variant === 'temporary' && {
|
|
496
|
+
keepMounted: true
|
|
490
497
|
}, ModalPropsProp),
|
|
491
498
|
hideBackdrop: hideBackdrop,
|
|
492
499
|
PaperProps: _extends({}, PaperProps, {
|