@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
|
@@ -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 = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "type"];
|
|
3
|
+
const _excluded = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { refType } from '@mui/utils';
|
|
@@ -133,6 +133,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
133
133
|
label,
|
|
134
134
|
multiline = false,
|
|
135
135
|
notched,
|
|
136
|
+
slots = {},
|
|
136
137
|
type = 'text'
|
|
137
138
|
} = props,
|
|
138
139
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -158,11 +159,13 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
|
|
|
158
159
|
type
|
|
159
160
|
});
|
|
160
161
|
|
|
162
|
+
const RootSlot = slots.root ?? components.Root ?? OutlinedInputRoot;
|
|
163
|
+
const InputSlot = slots.input ?? components.Input ?? OutlinedInputInput;
|
|
161
164
|
return /*#__PURE__*/_jsx(InputBase, _extends({
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
165
|
+
slots: {
|
|
166
|
+
root: RootSlot,
|
|
167
|
+
input: InputSlot
|
|
168
|
+
},
|
|
166
169
|
renderSuffix: state => /*#__PURE__*/_jsx(NotchedOutlineRoot, {
|
|
167
170
|
ownerState: ownerState,
|
|
168
171
|
className: classes.notchedOutline,
|
|
@@ -218,8 +221,11 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes
|
|
|
218
221
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
|
|
219
222
|
|
|
220
223
|
/**
|
|
221
|
-
* The components used for each slot inside
|
|
222
|
-
*
|
|
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
|
+
*
|
|
223
229
|
* @default {}
|
|
224
230
|
*/
|
|
225
231
|
components: PropTypes.shape({
|
|
@@ -347,6 +353,18 @@ process.env.NODE_ENV !== "production" ? OutlinedInput.propTypes
|
|
|
347
353
|
*/
|
|
348
354
|
rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
349
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
|
+
|
|
350
368
|
/**
|
|
351
369
|
* Start `InputAdornment` for this component.
|
|
352
370
|
*/
|
|
@@ -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 = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "type", "variant"];
|
|
3
|
+
const _excluded = ["className", "color", "component", "components", "disabled", "page", "selected", "shape", "size", "slots", "type", "variant"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -216,17 +216,13 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
|
|
|
216
216
|
className,
|
|
217
217
|
color = 'standard',
|
|
218
218
|
component,
|
|
219
|
-
components = {
|
|
220
|
-
first: FirstPageIcon,
|
|
221
|
-
last: LastPageIcon,
|
|
222
|
-
next: NavigateNextIcon,
|
|
223
|
-
previous: NavigateBeforeIcon
|
|
224
|
-
},
|
|
219
|
+
components = {},
|
|
225
220
|
disabled = false,
|
|
226
221
|
page,
|
|
227
222
|
selected = false,
|
|
228
223
|
shape = 'circular',
|
|
229
224
|
size = 'medium',
|
|
225
|
+
slots = {},
|
|
230
226
|
type = 'page',
|
|
231
227
|
variant = 'text'
|
|
232
228
|
} = props,
|
|
@@ -245,15 +241,15 @@ const PaginationItem = /*#__PURE__*/React.forwardRef(function PaginationItem(inP
|
|
|
245
241
|
const theme = useTheme();
|
|
246
242
|
const classes = useUtilityClasses(ownerState);
|
|
247
243
|
const normalizedIcons = theme.direction === 'rtl' ? {
|
|
248
|
-
previous: components.next || NavigateNextIcon,
|
|
249
|
-
next: components.previous || NavigateBeforeIcon,
|
|
250
|
-
last: components.first || FirstPageIcon,
|
|
251
|
-
first: components.last || LastPageIcon
|
|
244
|
+
previous: slots.next || components.next || NavigateNextIcon,
|
|
245
|
+
next: slots.previous || components.previous || NavigateBeforeIcon,
|
|
246
|
+
last: slots.first || components.first || FirstPageIcon,
|
|
247
|
+
first: slots.last || components.last || LastPageIcon
|
|
252
248
|
} : {
|
|
253
|
-
previous: components.previous || NavigateBeforeIcon,
|
|
254
|
-
next: components.next || NavigateNextIcon,
|
|
255
|
-
first: components.first || FirstPageIcon,
|
|
256
|
-
last: components.last || LastPageIcon
|
|
249
|
+
previous: slots.previous || components.previous || NavigateBeforeIcon,
|
|
250
|
+
next: slots.next || components.next || NavigateNextIcon,
|
|
251
|
+
first: slots.first || components.first || FirstPageIcon,
|
|
252
|
+
last: slots.last || components.last || LastPageIcon
|
|
257
253
|
};
|
|
258
254
|
const Icon = normalizedIcons[type];
|
|
259
255
|
return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/_jsx(PaginationItemEllipsis, {
|
|
@@ -315,13 +311,12 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes
|
|
|
315
311
|
component: PropTypes.elementType,
|
|
316
312
|
|
|
317
313
|
/**
|
|
318
|
-
* The components used for
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* }
|
|
314
|
+
* The components used for each slot inside.
|
|
315
|
+
*
|
|
316
|
+
* This prop is an alias for the `slots` prop.
|
|
317
|
+
* It's recommended to use the `slots` prop instead.
|
|
318
|
+
*
|
|
319
|
+
* @default {}
|
|
325
320
|
*/
|
|
326
321
|
components: PropTypes.shape({
|
|
327
322
|
first: PropTypes.elementType,
|
|
@@ -361,6 +356,20 @@ process.env.NODE_ENV !== "production" ? PaginationItem.propTypes
|
|
|
361
356
|
/* @typescript-to-proptypes-ignore */
|
|
362
357
|
.oneOfType([PropTypes.oneOf(['small', 'medium', 'large']), PropTypes.string]),
|
|
363
358
|
|
|
359
|
+
/**
|
|
360
|
+
* The components used for each slot inside.
|
|
361
|
+
*
|
|
362
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
363
|
+
*
|
|
364
|
+
* @default {}
|
|
365
|
+
*/
|
|
366
|
+
slots: PropTypes.shape({
|
|
367
|
+
first: PropTypes.elementType,
|
|
368
|
+
last: PropTypes.elementType,
|
|
369
|
+
next: PropTypes.elementType,
|
|
370
|
+
previous: PropTypes.elementType
|
|
371
|
+
}),
|
|
372
|
+
|
|
364
373
|
/**
|
|
365
374
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
366
375
|
*/
|
package/modern/Radio/Radio.js
CHANGED
|
@@ -42,7 +42,8 @@ const RadioRoot = styled(SwitchBase, {
|
|
|
42
42
|
theme,
|
|
43
43
|
ownerState
|
|
44
44
|
}) => _extends({
|
|
45
|
-
color: (theme.vars || theme).palette.text.secondary
|
|
45
|
+
color: (theme.vars || theme).palette.text.secondary
|
|
46
|
+
}, !ownerState.disableRipple && {
|
|
46
47
|
'&:hover': {
|
|
47
48
|
backgroundColor: theme.vars ? `rgba(${ownerState.color === 'default' ? theme.vars.palette.action.activeChannel : theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : alpha(ownerState.color === 'default' ? theme.palette.action.active : theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
|
|
48
49
|
// Reset on touch devices, it doesn't add specificity
|
|
@@ -42,22 +42,22 @@ const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(props, ref)
|
|
|
42
42
|
}
|
|
43
43
|
}), []);
|
|
44
44
|
const handleRef = useForkRef(ref, rootRef);
|
|
45
|
+
const name = useId(nameProp);
|
|
46
|
+
const contextValue = React.useMemo(() => ({
|
|
47
|
+
name,
|
|
45
48
|
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
onChange(event) {
|
|
50
|
+
setValueState(event.target.value);
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
if (onChange) {
|
|
53
|
+
onChange(event, event.target.value);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
value
|
|
58
|
+
}), [name, onChange, setValueState, value]);
|
|
55
59
|
return /*#__PURE__*/_jsx(RadioGroupContext.Provider, {
|
|
56
|
-
value:
|
|
57
|
-
name,
|
|
58
|
-
onChange: handleChange,
|
|
59
|
-
value
|
|
60
|
-
},
|
|
60
|
+
value: contextValue,
|
|
61
61
|
children: /*#__PURE__*/_jsx(FormGroup, _extends({
|
|
62
62
|
role: "radiogroup",
|
|
63
63
|
ref: handleRef
|
package/modern/Select/Select.js
CHANGED
|
@@ -244,14 +244,14 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
|
244
244
|
*
|
|
245
245
|
* @param {SelectChangeEvent<T>} event The event source of the callback.
|
|
246
246
|
* You can pull out the new value by accessing `event.target.value` (any).
|
|
247
|
-
* **Warning**: This is a generic event not a change event unless the change event is caused by browser autofill.
|
|
247
|
+
* **Warning**: This is a generic event, not a change event, unless the change event is caused by browser autofill.
|
|
248
248
|
* @param {object} [child] The react element that was selected when `native` is `false` (default).
|
|
249
249
|
*/
|
|
250
250
|
onChange: PropTypes.func,
|
|
251
251
|
|
|
252
252
|
/**
|
|
253
253
|
* Callback fired when the component requests to be closed.
|
|
254
|
-
* Use in controlled
|
|
254
|
+
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select collapes).
|
|
255
255
|
*
|
|
256
256
|
* @param {object} event The event source of the callback.
|
|
257
257
|
*/
|
|
@@ -259,7 +259,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes
|
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
261
|
* Callback fired when the component requests to be opened.
|
|
262
|
-
* Use in controlled
|
|
262
|
+
* Use it in either controlled (see the `open` prop), or uncontrolled mode (to detect when the Select expands).
|
|
263
263
|
*
|
|
264
264
|
* @param {object} event The event source of the callback.
|
|
265
265
|
*/
|
package/modern/Slider/Slider.js
CHANGED
|
@@ -581,8 +581,11 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
581
581
|
.oneOfType([PropTypes.oneOf(['primary', 'secondary']), PropTypes.string]),
|
|
582
582
|
|
|
583
583
|
/**
|
|
584
|
-
* The components used for each slot inside
|
|
585
|
-
*
|
|
584
|
+
* The components used for each slot inside.
|
|
585
|
+
*
|
|
586
|
+
* This prop is an alias for the `slots` prop.
|
|
587
|
+
* It's recommended to use the `slots` prop instead.
|
|
588
|
+
*
|
|
586
589
|
* @default {}
|
|
587
590
|
*/
|
|
588
591
|
components: PropTypes.shape({
|
|
@@ -597,7 +600,13 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
|
|
|
597
600
|
}),
|
|
598
601
|
|
|
599
602
|
/**
|
|
600
|
-
*
|
|
603
|
+
* The extra props for the slot components.
|
|
604
|
+
* You can override the existing props or add new ones.
|
|
605
|
+
*
|
|
606
|
+
* This prop is an alias for the `slotProps` prop.
|
|
607
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
608
|
+
*
|
|
609
|
+
* @default {}
|
|
601
610
|
*/
|
|
602
611
|
componentsProps: PropTypes.shape({
|
|
603
612
|
input: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
@@ -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", "componentsProps", "error", "icon", "optional", "StepIconComponent", "StepIconProps"];
|
|
3
|
+
const _excluded = ["children", "className", "componentsProps", "error", "icon", "optional", "slotProps", "StepIconComponent", "StepIconProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -122,6 +122,7 @@ const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref)
|
|
|
122
122
|
error = false,
|
|
123
123
|
icon: iconProp,
|
|
124
124
|
optional,
|
|
125
|
+
slotProps = {},
|
|
125
126
|
StepIconComponent: StepIconComponentProp,
|
|
126
127
|
StepIconProps
|
|
127
128
|
} = props,
|
|
@@ -154,6 +155,7 @@ const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref)
|
|
|
154
155
|
});
|
|
155
156
|
|
|
156
157
|
const classes = useUtilityClasses(ownerState);
|
|
158
|
+
const labelSlotProps = slotProps.label ?? componentsProps.label;
|
|
157
159
|
return /*#__PURE__*/_jsxs(StepLabelRoot, _extends({
|
|
158
160
|
className: clsx(classes.root, className),
|
|
159
161
|
ref: ref,
|
|
@@ -172,9 +174,9 @@ const StepLabel = /*#__PURE__*/React.forwardRef(function StepLabel(inProps, ref)
|
|
|
172
174
|
className: classes.labelContainer,
|
|
173
175
|
ownerState: ownerState,
|
|
174
176
|
children: [children ? /*#__PURE__*/_jsx(StepLabelLabel, _extends({
|
|
175
|
-
className: classes.label,
|
|
176
177
|
ownerState: ownerState
|
|
177
|
-
},
|
|
178
|
+
}, labelSlotProps, {
|
|
179
|
+
className: clsx(classes.label, labelSlotProps?.className),
|
|
178
180
|
children: children
|
|
179
181
|
})) : null, optional]
|
|
180
182
|
})]
|
|
@@ -227,6 +229,14 @@ process.env.NODE_ENV !== "production" ? StepLabel.propTypes
|
|
|
227
229
|
*/
|
|
228
230
|
optional: PropTypes.node,
|
|
229
231
|
|
|
232
|
+
/**
|
|
233
|
+
* The props used for each slot inside.
|
|
234
|
+
* @default {}
|
|
235
|
+
*/
|
|
236
|
+
slotProps: PropTypes.shape({
|
|
237
|
+
label: PropTypes.object
|
|
238
|
+
}),
|
|
239
|
+
|
|
230
240
|
/**
|
|
231
241
|
* The component to render in place of the [`StepIcon`](/material-ui/api/step-icon/).
|
|
232
242
|
*/
|
|
@@ -3,6 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["BackdropProps"],
|
|
4
4
|
_excluded2 = ["anchor", "disableBackdropTransition", "disableDiscovery", "disableSwipeToOpen", "hideBackdrop", "hysteresis", "minFlingVelocity", "ModalProps", "onClose", "onOpen", "open", "PaperProps", "SwipeAreaProps", "swipeAreaWidth", "transitionDuration", "variant"];
|
|
5
5
|
import * as React from 'react';
|
|
6
|
+
import { flushSync } from 'react-dom';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import { elementTypeAcceptingRef } from '@mui/utils';
|
|
8
9
|
import { useThemeProps } from '@mui/system';
|
|
@@ -218,7 +219,9 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
218
219
|
|
|
219
220
|
claimedSwipeInstance = null;
|
|
220
221
|
touchDetected.current = false;
|
|
221
|
-
|
|
222
|
+
flushSync(() => {
|
|
223
|
+
setMaybeSwiping(false);
|
|
224
|
+
}); // The swipe wasn't started.
|
|
222
225
|
|
|
223
226
|
if (!swipeInstance.current.isSwiping) {
|
|
224
227
|
swipeInstance.current.isSwiping = null;
|
|
@@ -420,7 +423,9 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
420
423
|
claimedSwipeInstance = null;
|
|
421
424
|
swipeInstance.current.startX = currentX;
|
|
422
425
|
swipeInstance.current.startY = currentY;
|
|
423
|
-
|
|
426
|
+
flushSync(() => {
|
|
427
|
+
setMaybeSwiping(true);
|
|
428
|
+
});
|
|
424
429
|
|
|
425
430
|
if (!open && paperRef.current) {
|
|
426
431
|
// The ref may be null when a parent component updates while swiping.
|
|
@@ -476,6 +481,8 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
476
481
|
BackdropProps: _extends({}, BackdropProps, {
|
|
477
482
|
ref: backdropRef
|
|
478
483
|
})
|
|
484
|
+
}, variant === 'temporary' && {
|
|
485
|
+
keepMounted: true
|
|
479
486
|
}, ModalPropsProp),
|
|
480
487
|
hideBackdrop: hideBackdrop,
|
|
481
488
|
PaperProps: _extends({}, PaperProps, {
|
|
@@ -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 = ["arrow", "children", "classes", "components", "componentsProps", "describeChild", "disableFocusListener", "disableHoverListener", "disableInteractive", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "followCursor", "id", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "title", "TransitionComponent", "TransitionProps"];
|
|
3
|
+
const _excluded = ["arrow", "children", "classes", "components", "componentsProps", "describeChild", "disableFocusListener", "disableHoverListener", "disableInteractive", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "followCursor", "id", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "slotProps", "slots", "title", "TransitionComponent", "TransitionProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -243,6 +243,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
243
243
|
placement = 'bottom',
|
|
244
244
|
PopperComponent: PopperComponentProp,
|
|
245
245
|
PopperProps = {},
|
|
246
|
+
slotProps = {},
|
|
247
|
+
slots = {},
|
|
246
248
|
title,
|
|
247
249
|
TransitionComponent: TransitionComponentProp = Grow,
|
|
248
250
|
TransitionProps
|
|
@@ -461,7 +463,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
461
463
|
}, [handleClose, open]);
|
|
462
464
|
const handleRef = useForkRef(children.ref, focusVisibleRef, setChildNode, ref); // There is no point in displaying an empty tooltip.
|
|
463
465
|
|
|
464
|
-
if (
|
|
466
|
+
if (!title && title !== 0) {
|
|
465
467
|
open = false;
|
|
466
468
|
}
|
|
467
469
|
|
|
@@ -579,14 +581,20 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
579
581
|
});
|
|
580
582
|
|
|
581
583
|
const classes = useUtilityClasses(ownerState);
|
|
582
|
-
const PopperComponent = components.Popper ?? TooltipPopper;
|
|
583
|
-
const TransitionComponent = components.Transition ?? TransitionComponentProp ?? Grow;
|
|
584
|
-
const TooltipComponent = components.Tooltip ?? TooltipTooltip;
|
|
585
|
-
const ArrowComponent = components.Arrow ?? TooltipArrow;
|
|
586
|
-
const popperProps = appendOwnerState(PopperComponent, _extends({}, PopperProps, componentsProps.popper
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
const
|
|
584
|
+
const PopperComponent = slots.popper ?? components.Popper ?? TooltipPopper;
|
|
585
|
+
const TransitionComponent = slots.transition ?? components.Transition ?? TransitionComponentProp ?? Grow;
|
|
586
|
+
const TooltipComponent = slots.tooltip ?? components.Tooltip ?? TooltipTooltip;
|
|
587
|
+
const ArrowComponent = slots.arrow ?? components.Arrow ?? TooltipArrow;
|
|
588
|
+
const popperProps = appendOwnerState(PopperComponent, _extends({}, PopperProps, slotProps.popper ?? componentsProps.popper, {
|
|
589
|
+
className: clsx(classes.popper, PopperProps?.className, (slotProps.popper ?? componentsProps.popper)?.className)
|
|
590
|
+
}), ownerState);
|
|
591
|
+
const transitionProps = appendOwnerState(TransitionComponent, _extends({}, TransitionProps, slotProps.transition ?? componentsProps.transition), ownerState);
|
|
592
|
+
const tooltipProps = appendOwnerState(TooltipComponent, _extends({}, slotProps.tooltip ?? componentsProps.tooltip, {
|
|
593
|
+
className: clsx(classes.tooltip, (slotProps.tooltip ?? componentsProps.tooltip)?.className)
|
|
594
|
+
}), ownerState);
|
|
595
|
+
const tooltipArrowProps = appendOwnerState(ArrowComponent, _extends({}, slotProps.arrow ?? componentsProps.arrow, {
|
|
596
|
+
className: clsx(classes.arrow, (slotProps.arrow ?? componentsProps.arrow)?.className)
|
|
597
|
+
}), ownerState);
|
|
590
598
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
591
599
|
children: [/*#__PURE__*/React.cloneElement(children, childrenProps), /*#__PURE__*/_jsx(PopperComponent, _extends({
|
|
592
600
|
as: PopperComponentProp ?? Popper,
|
|
@@ -606,17 +614,15 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
606
614
|
id: id,
|
|
607
615
|
transition: true
|
|
608
616
|
}, interactiveWrapperListeners, popperProps, {
|
|
609
|
-
className: clsx(classes.popper, PopperProps?.className, componentsProps.popper?.className),
|
|
610
617
|
popperOptions: popperOptions,
|
|
611
618
|
children: ({
|
|
612
619
|
TransitionProps: TransitionPropsInner
|
|
613
620
|
}) => /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
614
621
|
timeout: theme.transitions.duration.shorter
|
|
615
622
|
}, TransitionPropsInner, transitionProps, {
|
|
623
|
+
"data-foo": "bar",
|
|
616
624
|
children: /*#__PURE__*/_jsxs(TooltipComponent, _extends({}, tooltipProps, {
|
|
617
|
-
className: clsx(classes.tooltip, componentsProps.tooltip?.className),
|
|
618
625
|
children: [title, arrow ? /*#__PURE__*/_jsx(ArrowComponent, _extends({}, tooltipArrowProps, {
|
|
619
|
-
className: clsx(classes.arrow, componentsProps.arrow?.className),
|
|
620
626
|
ref: setArrowRef
|
|
621
627
|
})) : null]
|
|
622
628
|
}))
|
|
@@ -654,8 +660,11 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
|
|
|
654
660
|
className: PropTypes.string,
|
|
655
661
|
|
|
656
662
|
/**
|
|
657
|
-
* The components used for each slot inside
|
|
658
|
-
*
|
|
663
|
+
* The components used for each slot inside.
|
|
664
|
+
*
|
|
665
|
+
* This prop is an alias for the `slots` prop.
|
|
666
|
+
* It's recommended to use the `slots` prop instead.
|
|
667
|
+
*
|
|
659
668
|
* @default {}
|
|
660
669
|
*/
|
|
661
670
|
components: PropTypes.shape({
|
|
@@ -666,9 +675,12 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
|
|
|
666
675
|
}),
|
|
667
676
|
|
|
668
677
|
/**
|
|
669
|
-
* The props
|
|
670
|
-
*
|
|
671
|
-
*
|
|
678
|
+
* The extra props for the slot components.
|
|
679
|
+
* You can override the existing props or add new ones.
|
|
680
|
+
*
|
|
681
|
+
* This prop is an alias for the `slotProps` prop.
|
|
682
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
683
|
+
*
|
|
672
684
|
* @default {}
|
|
673
685
|
*/
|
|
674
686
|
componentsProps: PropTypes.shape({
|
|
@@ -791,6 +803,35 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes
|
|
|
791
803
|
*/
|
|
792
804
|
PopperProps: PropTypes.object,
|
|
793
805
|
|
|
806
|
+
/**
|
|
807
|
+
* The extra props for the slot components.
|
|
808
|
+
* You can override the existing props or add new ones.
|
|
809
|
+
*
|
|
810
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
811
|
+
*
|
|
812
|
+
* @default {}
|
|
813
|
+
*/
|
|
814
|
+
slotProps: PropTypes.shape({
|
|
815
|
+
arrow: PropTypes.object,
|
|
816
|
+
popper: PropTypes.object,
|
|
817
|
+
tooltip: PropTypes.object,
|
|
818
|
+
transition: PropTypes.object
|
|
819
|
+
}),
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* The components used for each slot inside.
|
|
823
|
+
*
|
|
824
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
825
|
+
*
|
|
826
|
+
* @default {}
|
|
827
|
+
*/
|
|
828
|
+
slots: PropTypes.shape({
|
|
829
|
+
arrow: PropTypes.elementType,
|
|
830
|
+
popper: PropTypes.elementType,
|
|
831
|
+
tooltip: PropTypes.elementType,
|
|
832
|
+
transition: PropTypes.elementType
|
|
833
|
+
}),
|
|
834
|
+
|
|
794
835
|
/**
|
|
795
836
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
796
837
|
*/
|
package/modern/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "5.10.
|
|
3
|
+
"version": "5.10.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "React components that implement Google's Material Design.",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/runtime": "^7.19.0",
|
|
49
|
-
"@mui/base": "5.0.0-alpha.
|
|
50
|
-
"@mui/core-downloads-tracker": "^5.10.
|
|
51
|
-
"@mui/system": "^5.10.
|
|
49
|
+
"@mui/base": "5.0.0-alpha.105",
|
|
50
|
+
"@mui/core-downloads-tracker": "^5.10.13",
|
|
51
|
+
"@mui/system": "^5.10.13",
|
|
52
52
|
"@mui/types": "^7.2.0",
|
|
53
53
|
"@mui/utils": "^5.10.9",
|
|
54
54
|
"@types/react-transition-group": "^4.4.5",
|