@mui/material 6.4.3 → 7.0.0-alpha.0
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/Accordion/Accordion.d.ts +3 -3
- package/AccordionActions/AccordionActions.d.ts +2 -2
- package/AccordionDetails/AccordionDetails.d.ts +2 -2
- package/AccordionSummary/AccordionSummary.d.ts +3 -3
- package/Alert/Alert.d.ts +3 -3
- package/AlertTitle/AlertTitle.d.ts +3 -3
- package/AppBar/AppBar.d.ts +3 -3
- package/Autocomplete/Autocomplete.d.ts +2 -2
- package/Avatar/Avatar.d.ts +2 -2
- package/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/Backdrop/Backdrop.d.ts +3 -3
- package/Badge/Badge.d.ts +3 -3
- package/BottomNavigation/BottomNavigation.d.ts +2 -2
- package/BottomNavigationAction/BottomNavigationAction.d.ts +3 -3
- package/Box/Box.d.ts +2 -2
- package/Breadcrumbs/Breadcrumbs.d.ts +3 -3
- package/Button/Button.d.ts +4 -4
- package/ButtonBase/ButtonBase.d.ts +2 -2
- package/ButtonGroup/ButtonGroup.d.ts +2 -2
- package/CHANGELOG.md +24 -2242
- package/Card/Card.d.ts +3 -3
- package/CardActionArea/CardActionArea.d.ts +3 -3
- package/CardActions/CardActions.d.ts +2 -2
- package/CardContent/CardContent.d.ts +2 -2
- package/CardHeader/CardHeader.d.ts +2 -2
- package/CardMedia/CardMedia.d.ts +2 -2
- package/Checkbox/Checkbox.d.ts +4 -4
- package/Chip/Chip.d.ts +2 -2
- package/CircularProgress/CircularProgress.d.ts +3 -7
- package/ClickAwayListener/ClickAwayListener.d.ts +3 -3
- package/ClickAwayListener/ClickAwayListener.js +3 -3
- package/Collapse/Collapse.d.ts +5 -5
- package/Container/Container.d.ts +2 -2
- package/CssBaseline/CssBaseline.d.ts +2 -2
- package/Dialog/Dialog.d.ts +3 -3
- package/DialogActions/DialogActions.d.ts +2 -2
- package/DialogContent/DialogContent.d.ts +2 -2
- package/DialogContentText/DialogContentText.d.ts +3 -3
- package/DialogTitle/DialogTitle.d.ts +3 -3
- package/Divider/Divider.d.ts +3 -3
- package/Drawer/Drawer.d.ts +3 -3
- package/Fab/Fab.d.ts +3 -3
- package/Fade/Fade.d.ts +3 -3
- package/FilledInput/FilledInput.d.ts +3 -3
- package/FormControl/FormControl.d.ts +6 -6
- package/FormControlLabel/FormControlLabel.d.ts +4 -4
- package/FormGroup/FormGroup.d.ts +3 -3
- package/FormHelperText/FormHelperText.d.ts +2 -2
- package/FormLabel/FormLabel.d.ts +4 -4
- package/GlobalStyles/GlobalStyles.d.ts +2 -2
- package/Grid/Grid.d.ts +2 -2
- package/Grid2/Grid2.d.ts +2 -2
- package/Grid2/Grid2.js +2 -2
- package/Grow/Grow.d.ts +5 -5
- package/Hidden/Hidden.d.ts +2 -2
- package/Icon/Icon.d.ts +3 -3
- package/IconButton/IconButton.d.ts +4 -4
- package/ImageList/ImageList.d.ts +2 -2
- package/ImageListItem/ImageListItem.d.ts +2 -2
- package/ImageListItemBar/ImageListItemBar.d.ts +2 -2
- package/Input/Input.d.ts +3 -3
- package/InputAdornment/InputAdornment.d.ts +2 -2
- package/InputBase/InputBase.d.ts +2 -2
- package/InputLabel/InputLabel.d.ts +3 -3
- package/LinearProgress/LinearProgress.d.ts +3 -7
- package/Link/Link.d.ts +4 -4
- package/List/List.d.ts +3 -3
- package/ListItem/ListItem.d.ts +3 -3
- package/ListItemAvatar/ListItemAvatar.d.ts +2 -2
- package/ListItemButton/ListItemButton.d.ts +3 -3
- package/ListItemIcon/ListItemIcon.d.ts +2 -2
- package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +2 -2
- package/ListItemText/ListItemText.d.ts +2 -2
- package/ListSubheader/ListSubheader.d.ts +2 -2
- package/Menu/Menu.d.ts +4 -4
- package/Menu/Menu.js +6 -2
- package/MenuItem/MenuItem.d.ts +3 -3
- package/MenuList/MenuList.d.ts +4 -4
- package/MobileStepper/MobileStepper.d.ts +3 -3
- package/Modal/Modal.d.ts +7 -7
- package/Modal/Modal.js +9 -10
- package/NativeSelect/NativeSelect.d.ts +3 -3
- package/NoSsr/NoSsr.d.ts +2 -2
- package/NoSsr/NoSsr.js +2 -2
- package/OutlinedInput/OutlinedInput.d.ts +3 -3
- package/Pagination/Pagination.d.ts +2 -2
- package/PaginationItem/PaginationItem.d.ts +2 -2
- package/Paper/Paper.d.ts +3 -3
- package/PigmentContainer/PigmentContainer.d.ts +2 -2
- package/PigmentContainer/PigmentContainer.js +2 -2
- package/PigmentGrid/PigmentGrid.d.ts +2 -2
- package/PigmentGrid/PigmentGrid.js +2 -2
- package/PigmentHidden/PigmentHidden.d.ts +2 -2
- package/PigmentHidden/PigmentHidden.js +2 -2
- package/PigmentStack/PigmentStack.d.ts +2 -2
- package/PigmentStack/PigmentStack.js +2 -2
- package/Popover/Popover.d.ts +64 -10
- package/Popover/Popover.js +78 -51
- package/Popper/Popper.d.ts +4 -4
- package/Popper/Popper.js +4 -4
- package/Portal/Portal.d.ts +2 -2
- package/Portal/Portal.js +2 -2
- package/README.md +4 -3
- package/Radio/Radio.d.ts +3 -3
- package/RadioGroup/RadioGroup.d.ts +3 -3
- package/Rating/Rating.d.ts +2 -2
- package/ScopedCssBaseline/ScopedCssBaseline.d.ts +2 -2
- package/Select/Select.d.ts +3 -3
- package/Skeleton/Skeleton.d.ts +2 -2
- package/Slide/Slide.d.ts +4 -4
- package/Slider/Slider.d.ts +20 -11
- package/Slider/Slider.js +2 -2
- package/Snackbar/Snackbar.d.ts +80 -3
- package/Snackbar/Snackbar.js +122 -32
- package/SnackbarContent/SnackbarContent.d.ts +3 -3
- package/SpeedDial/SpeedDial.d.ts +2 -2
- package/SpeedDialAction/SpeedDialAction.d.ts +3 -3
- package/SpeedDialIcon/SpeedDialIcon.d.ts +2 -2
- package/Stack/Stack.d.ts +2 -2
- package/Step/Step.d.ts +2 -2
- package/StepButton/StepButton.d.ts +3 -3
- package/StepConnector/StepConnector.d.ts +2 -2
- package/StepContent/StepContent.d.ts +2 -2
- package/StepIcon/StepIcon.d.ts +3 -3
- package/StepLabel/StepLabel.d.ts +2 -2
- package/Stepper/Stepper.d.ts +2 -2
- package/SvgIcon/SvgIcon.d.ts +3 -3
- package/SwipeableDrawer/SwipeableDrawer.d.ts +3 -3
- package/Switch/Switch.d.ts +4 -4
- package/Tab/Tab.d.ts +3 -3
- package/TabScrollButton/TabScrollButton.d.ts +2 -2
- package/Table/Table.d.ts +2 -2
- package/TableBody/TableBody.d.ts +2 -2
- package/TableCell/TableCell.d.ts +2 -2
- package/TableContainer/TableContainer.d.ts +2 -2
- package/TableFooter/TableFooter.d.ts +2 -2
- package/TableHead/TableHead.d.ts +2 -2
- package/TablePagination/TablePagination.d.ts +4 -4
- package/TableRow/TableRow.d.ts +2 -2
- package/TableSortLabel/TableSortLabel.d.ts +3 -3
- package/Tabs/Tabs.d.ts +2 -2
- package/TextField/TextField.d.ts +10 -10
- package/TextareaAutosize/TextareaAutosize.d.ts +2 -2
- package/TextareaAutosize/TextareaAutosize.js +2 -2
- package/ToggleButton/ToggleButton.d.ts +3 -3
- package/ToggleButtonGroup/ToggleButtonGroup.d.ts +2 -2
- package/Toolbar/Toolbar.d.ts +2 -2
- package/Tooltip/Tooltip.d.ts +2 -2
- package/Typography/Typography.d.ts +3 -3
- package/Zoom/Zoom.d.ts +3 -3
- package/index.js +1 -1
- package/internal/SwitchBase.d.ts +33 -1
- package/internal/SwitchBase.js +84 -30
- package/modern/ClickAwayListener/ClickAwayListener.js +3 -3
- package/modern/Grid2/Grid2.js +2 -2
- package/modern/Menu/Menu.js +6 -2
- package/modern/Modal/Modal.js +9 -10
- package/modern/NoSsr/NoSsr.js +2 -2
- package/modern/PigmentContainer/PigmentContainer.js +2 -2
- package/modern/PigmentGrid/PigmentGrid.js +2 -2
- package/modern/PigmentHidden/PigmentHidden.js +2 -2
- package/modern/PigmentStack/PigmentStack.js +2 -2
- package/modern/Popover/Popover.js +78 -51
- package/modern/Popper/Popper.js +4 -4
- package/modern/Portal/Portal.js +2 -2
- package/modern/Slider/Slider.js +2 -2
- package/modern/Snackbar/Snackbar.js +122 -32
- package/modern/TextareaAutosize/TextareaAutosize.js +2 -2
- package/modern/index.js +1 -1
- package/modern/internal/SwitchBase.js +84 -30
- package/modern/utils/mergeSlotProps.js +10 -3
- package/modern/version/index.js +5 -5
- package/node/ClickAwayListener/ClickAwayListener.js +3 -3
- package/node/Grid2/Grid2.js +2 -2
- package/node/Menu/Menu.js +6 -2
- package/node/Modal/Modal.js +9 -10
- package/node/NoSsr/NoSsr.js +2 -2
- package/node/PigmentContainer/PigmentContainer.js +2 -2
- package/node/PigmentGrid/PigmentGrid.js +2 -2
- package/node/PigmentHidden/PigmentHidden.js +2 -2
- package/node/PigmentStack/PigmentStack.js +2 -2
- package/node/Popover/Popover.js +78 -51
- package/node/Popper/Popper.js +4 -4
- package/node/Portal/Portal.js +2 -2
- package/node/Slider/Slider.js +2 -2
- package/node/Snackbar/Snackbar.js +122 -32
- package/node/TextareaAutosize/TextareaAutosize.js +2 -2
- package/node/index.js +1 -1
- package/node/internal/SwitchBase.js +84 -30
- package/node/utils/mergeSlotProps.js +10 -3
- package/node/version/index.js +5 -5
- package/package.json +7 -7
- package/utils/mergeSlotProps.js +10 -3
- package/version/index.js +5 -5
package/node/Popover/Popover.js
CHANGED
|
@@ -24,12 +24,12 @@ var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
|
24
24
|
var _debounce = _interopRequireDefault(require("../utils/debounce"));
|
|
25
25
|
var _ownerDocument = _interopRequireDefault(require("../utils/ownerDocument"));
|
|
26
26
|
var _ownerWindow = _interopRequireDefault(require("../utils/ownerWindow"));
|
|
27
|
-
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
28
27
|
var _Grow = _interopRequireDefault(require("../Grow"));
|
|
29
28
|
var _Modal = _interopRequireDefault(require("../Modal"));
|
|
30
29
|
var _Paper = _interopRequireDefault(require("../Paper"));
|
|
31
30
|
var _popoverClasses = require("./popoverClasses");
|
|
32
31
|
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
32
|
+
var _utils = require("../utils");
|
|
33
33
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
34
34
|
function getOffsetTop(rect, vertical) {
|
|
35
35
|
let offset = 0;
|
|
@@ -112,22 +112,21 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
112
112
|
marginThreshold = 16,
|
|
113
113
|
open,
|
|
114
114
|
PaperProps: PaperPropsProp = {},
|
|
115
|
+
// TODO: remove in v7
|
|
115
116
|
slots = {},
|
|
116
117
|
slotProps = {},
|
|
117
118
|
transformOrigin = {
|
|
118
119
|
vertical: 'top',
|
|
119
120
|
horizontal: 'left'
|
|
120
121
|
},
|
|
121
|
-
TransitionComponent
|
|
122
|
+
TransitionComponent,
|
|
123
|
+
// TODO: remove in v7
|
|
122
124
|
transitionDuration: transitionDurationProp = 'auto',
|
|
123
|
-
TransitionProps
|
|
124
|
-
|
|
125
|
-
...TransitionProps
|
|
126
|
-
} = {},
|
|
125
|
+
TransitionProps = {},
|
|
126
|
+
// TODO: remove in v7
|
|
127
127
|
disableScrollLock = false,
|
|
128
128
|
...other
|
|
129
129
|
} = props;
|
|
130
|
-
const externalPaperSlotProps = slotProps?.paper ?? PaperPropsProp;
|
|
131
130
|
const paperRef = React.useRef();
|
|
132
131
|
const ownerState = {
|
|
133
132
|
...props,
|
|
@@ -135,7 +134,6 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
135
134
|
anchorReference,
|
|
136
135
|
elevation,
|
|
137
136
|
marginThreshold,
|
|
138
|
-
externalPaperSlotProps,
|
|
139
137
|
transformOrigin,
|
|
140
138
|
TransitionComponent,
|
|
141
139
|
transitionDuration: transitionDurationProp,
|
|
@@ -264,10 +262,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
264
262
|
}
|
|
265
263
|
return () => window.removeEventListener('scroll', setPositioningStyles);
|
|
266
264
|
}, [anchorEl, disableScrollLock, setPositioningStyles]);
|
|
267
|
-
const handleEntering = (
|
|
268
|
-
if (onEntering) {
|
|
269
|
-
onEntering(element, isAppearing);
|
|
270
|
-
}
|
|
265
|
+
const handleEntering = () => {
|
|
271
266
|
setPositioningStyles();
|
|
272
267
|
};
|
|
273
268
|
const handleExited = () => {
|
|
@@ -298,45 +293,65 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
298
293
|
};
|
|
299
294
|
}, [anchorEl, open, setPositioningStyles]);
|
|
300
295
|
let transitionDuration = transitionDurationProp;
|
|
301
|
-
if (transitionDurationProp === 'auto' && !TransitionComponent.muiSupportAuto) {
|
|
302
|
-
transitionDuration = undefined;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// If the container prop is provided, use that
|
|
306
|
-
// If the anchorEl prop is provided, use its parent body element as the container
|
|
307
|
-
// If neither are provided let the Modal take care of choosing the container
|
|
308
|
-
const container = containerProp || (anchorEl ? (0, _ownerDocument.default)(resolveAnchorEl(anchorEl)).body : undefined);
|
|
309
296
|
const externalForwardedProps = {
|
|
310
|
-
slots
|
|
297
|
+
slots: {
|
|
298
|
+
transition: TransitionComponent,
|
|
299
|
+
...slots
|
|
300
|
+
},
|
|
311
301
|
slotProps: {
|
|
312
|
-
|
|
313
|
-
paper:
|
|
302
|
+
transition: TransitionProps,
|
|
303
|
+
paper: PaperPropsProp,
|
|
304
|
+
...slotProps
|
|
314
305
|
}
|
|
315
306
|
};
|
|
316
|
-
const [
|
|
317
|
-
elementType:
|
|
307
|
+
const [TransitionSlot, transitionSlotProps] = (0, _useSlot.default)('transition', {
|
|
308
|
+
elementType: _Grow.default,
|
|
318
309
|
externalForwardedProps,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
310
|
+
ownerState,
|
|
311
|
+
getSlotProps: handlers => ({
|
|
312
|
+
...handlers,
|
|
313
|
+
onEntering: (element, isAppearing) => {
|
|
314
|
+
handlers.onEntering?.(element, isAppearing);
|
|
315
|
+
handleEntering();
|
|
316
|
+
},
|
|
317
|
+
onExited: element => {
|
|
318
|
+
handlers.onExited?.(element);
|
|
319
|
+
handleExited();
|
|
325
320
|
}
|
|
326
|
-
},
|
|
327
|
-
|
|
321
|
+
}),
|
|
322
|
+
additionalProps: {
|
|
323
|
+
appear: true,
|
|
324
|
+
in: open
|
|
325
|
+
}
|
|
328
326
|
});
|
|
327
|
+
if (transitionDurationProp === 'auto' && !TransitionSlot.muiSupportAuto) {
|
|
328
|
+
transitionDuration = undefined;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// If the container prop is provided, use that
|
|
332
|
+
// If the anchorEl prop is provided, use its parent body element as the container
|
|
333
|
+
// If neither are provided let the Modal take care of choosing the container
|
|
334
|
+
const container = containerProp || (anchorEl ? (0, _ownerDocument.default)(resolveAnchorEl(anchorEl)).body : undefined);
|
|
329
335
|
const [RootSlot, {
|
|
336
|
+
slots: rootSlotsProp,
|
|
330
337
|
slotProps: rootSlotPropsProp,
|
|
331
338
|
...rootProps
|
|
332
339
|
}] = (0, _useSlot.default)('root', {
|
|
340
|
+
ref,
|
|
333
341
|
elementType: PopoverRoot,
|
|
334
|
-
externalForwardedProps
|
|
342
|
+
externalForwardedProps: {
|
|
343
|
+
...externalForwardedProps,
|
|
344
|
+
...other
|
|
345
|
+
},
|
|
346
|
+
shouldForwardComponentProp: true,
|
|
335
347
|
additionalProps: {
|
|
348
|
+
slots: {
|
|
349
|
+
backdrop: slots.backdrop
|
|
350
|
+
},
|
|
336
351
|
slotProps: {
|
|
337
|
-
backdrop: {
|
|
352
|
+
backdrop: (0, _utils.mergeSlotProps)(typeof slotProps.backdrop === 'function' ? slotProps.backdrop(ownerState) : slotProps.backdrop, {
|
|
338
353
|
invisible: true
|
|
339
|
-
}
|
|
354
|
+
})
|
|
340
355
|
},
|
|
341
356
|
container,
|
|
342
357
|
open
|
|
@@ -344,25 +359,32 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
344
359
|
ownerState,
|
|
345
360
|
className: (0, _clsx.default)(classes.root, className)
|
|
346
361
|
});
|
|
347
|
-
const
|
|
362
|
+
const [PaperSlot, paperProps] = (0, _useSlot.default)('paper', {
|
|
363
|
+
ref: paperRef,
|
|
364
|
+
className: classes.paper,
|
|
365
|
+
elementType: PopoverPaper,
|
|
366
|
+
externalForwardedProps,
|
|
367
|
+
shouldForwardComponentProp: true,
|
|
368
|
+
additionalProps: {
|
|
369
|
+
elevation,
|
|
370
|
+
style: isPositioned ? undefined : {
|
|
371
|
+
opacity: 0
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
ownerState
|
|
375
|
+
});
|
|
348
376
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RootSlot, {
|
|
349
377
|
...rootProps,
|
|
350
378
|
...(!(0, _isHostComponent.default)(RootSlot) && {
|
|
379
|
+
slots: rootSlotsProp,
|
|
351
380
|
slotProps: rootSlotPropsProp,
|
|
352
381
|
disableScrollLock
|
|
353
382
|
}),
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionComponent, {
|
|
357
|
-
appear: true,
|
|
358
|
-
in: open,
|
|
359
|
-
onEntering: handleEntering,
|
|
360
|
-
onExited: handleExited,
|
|
383
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionSlot, {
|
|
384
|
+
...transitionSlotProps,
|
|
361
385
|
timeout: transitionDuration,
|
|
362
|
-
...TransitionProps,
|
|
363
386
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PaperSlot, {
|
|
364
387
|
...paperProps,
|
|
365
|
-
ref: handlePaperRef,
|
|
366
388
|
children: children
|
|
367
389
|
})
|
|
368
390
|
})
|
|
@@ -430,8 +452,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
430
452
|
anchorReference: _propTypes.default.oneOf(['anchorEl', 'anchorPosition', 'none']),
|
|
431
453
|
/**
|
|
432
454
|
* A backdrop component. This prop enables custom backdrop rendering.
|
|
433
|
-
* @deprecated Use `
|
|
434
|
-
* Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
|
|
455
|
+
* @deprecated Use `slots.backdrop` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
435
456
|
* @default styled(Backdrop, {
|
|
436
457
|
* name: 'MuiModal',
|
|
437
458
|
* slot: 'Backdrop',
|
|
@@ -445,7 +466,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
445
466
|
BackdropComponent: _propTypes.default.elementType,
|
|
446
467
|
/**
|
|
447
468
|
* Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
|
|
448
|
-
* @deprecated Use `slotProps.
|
|
469
|
+
* @deprecated Use `slotProps.backdrop` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
449
470
|
*/
|
|
450
471
|
BackdropProps: _propTypes.default.object,
|
|
451
472
|
/**
|
|
@@ -509,16 +530,20 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
509
530
|
* @default {}
|
|
510
531
|
*/
|
|
511
532
|
slotProps: _propTypes.default.shape({
|
|
533
|
+
backdrop: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
512
534
|
paper: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
513
|
-
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
535
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
536
|
+
transition: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
514
537
|
}),
|
|
515
538
|
/**
|
|
516
539
|
* The components used for each slot inside.
|
|
517
540
|
* @default {}
|
|
518
541
|
*/
|
|
519
542
|
slots: _propTypes.default.shape({
|
|
543
|
+
backdrop: _propTypes.default.elementType,
|
|
520
544
|
paper: _propTypes.default.elementType,
|
|
521
|
-
root: _propTypes.default.elementType
|
|
545
|
+
root: _propTypes.default.elementType,
|
|
546
|
+
transition: _propTypes.default.elementType
|
|
522
547
|
}),
|
|
523
548
|
/**
|
|
524
549
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
@@ -543,6 +568,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
543
568
|
/**
|
|
544
569
|
* The component used for the transition.
|
|
545
570
|
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
571
|
+
* @deprecated use the `slots.transition` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
546
572
|
* @default Grow
|
|
547
573
|
*/
|
|
548
574
|
TransitionComponent: _propTypes.default.elementType,
|
|
@@ -558,6 +584,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
558
584
|
/**
|
|
559
585
|
* Props applied to the transition element.
|
|
560
586
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
587
|
+
* @deprecated use the `slotProps.transition` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
561
588
|
* @default {}
|
|
562
589
|
*/
|
|
563
590
|
TransitionProps: _propTypes.default.object
|
package/node/Popper/Popper.js
CHANGED
|
@@ -26,13 +26,13 @@ const PopperRoot = (0, _zeroStyled.styled)(_BasePopper.default, {
|
|
|
26
26
|
*
|
|
27
27
|
* Demos:
|
|
28
28
|
*
|
|
29
|
-
* - [Autocomplete](https://mui.com/material-ui/react-autocomplete/)
|
|
30
|
-
* - [Menu](https://mui.com/material-ui/react-menu/)
|
|
31
|
-
* - [Popper](https://mui.com/material-ui/react-popper/)
|
|
29
|
+
* - [Autocomplete](https://next.mui.com/material-ui/react-autocomplete/)
|
|
30
|
+
* - [Menu](https://next.mui.com/material-ui/react-menu/)
|
|
31
|
+
* - [Popper](https://next.mui.com/material-ui/react-popper/)
|
|
32
32
|
*
|
|
33
33
|
* API:
|
|
34
34
|
*
|
|
35
|
-
* - [Popper API](https://mui.com/material-ui/api/popper/)
|
|
35
|
+
* - [Popper API](https://next.mui.com/material-ui/api/popper/)
|
|
36
36
|
*/
|
|
37
37
|
const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
38
38
|
const isRtl = (0, _RtlProvider.useRtl)();
|
package/node/Portal/Portal.js
CHANGED
|
@@ -21,11 +21,11 @@ function getContainer(container) {
|
|
|
21
21
|
*
|
|
22
22
|
* Demos:
|
|
23
23
|
*
|
|
24
|
-
* - [Portal](https://mui.com/material-ui/react-portal/)
|
|
24
|
+
* - [Portal](https://next.mui.com/material-ui/react-portal/)
|
|
25
25
|
*
|
|
26
26
|
* API:
|
|
27
27
|
*
|
|
28
|
-
* - [Portal API](https://mui.com/material-ui/api/portal/)
|
|
28
|
+
* - [Portal API](https://next.mui.com/material-ui/api/portal/)
|
|
29
29
|
*/
|
|
30
30
|
const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, forwardedRef) {
|
|
31
31
|
const {
|
package/node/Slider/Slider.js
CHANGED
|
@@ -972,7 +972,7 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
|
|
|
972
972
|
* @param {Event} event The event source of the callback.
|
|
973
973
|
* You can pull out the new value by accessing `event.target.value` (any).
|
|
974
974
|
* **Warning**: This is a generic event not a change event.
|
|
975
|
-
* @param {
|
|
975
|
+
* @param {Value} value The new value.
|
|
976
976
|
* @param {number} activeThumb Index of the currently moved thumb.
|
|
977
977
|
*/
|
|
978
978
|
onChange: _propTypes.default.func,
|
|
@@ -980,7 +980,7 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
|
|
|
980
980
|
* Callback function that is fired when the `mouseup` is triggered.
|
|
981
981
|
*
|
|
982
982
|
* @param {React.SyntheticEvent | Event} event The event source of the callback. **Warning**: This is a generic event not a change event.
|
|
983
|
-
* @param {
|
|
983
|
+
* @param {Value} value The new value.
|
|
984
984
|
*/
|
|
985
985
|
onChangeCommitted: _propTypes.default.func,
|
|
986
986
|
/**
|
|
@@ -10,7 +10,6 @@ exports.default = void 0;
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
13
|
-
var _useSlotProps = _interopRequireDefault(require("@mui/utils/useSlotProps"));
|
|
14
13
|
var _useSnackbar = _interopRequireDefault(require("./useSnackbar"));
|
|
15
14
|
var _ClickAwayListener = _interopRequireDefault(require("../ClickAwayListener"));
|
|
16
15
|
var _zeroStyled = require("../zero-styled");
|
|
@@ -20,6 +19,7 @@ var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
|
|
|
20
19
|
var _Grow = _interopRequireDefault(require("../Grow"));
|
|
21
20
|
var _SnackbarContent = _interopRequireDefault(require("../SnackbarContent"));
|
|
22
21
|
var _snackbarClasses = require("./snackbarClasses");
|
|
22
|
+
var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
|
|
23
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
24
|
const useUtilityClasses = ownerState => {
|
|
25
25
|
const {
|
|
@@ -127,8 +127,8 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
127
127
|
autoHideDuration = null,
|
|
128
128
|
children,
|
|
129
129
|
className,
|
|
130
|
-
ClickAwayListenerProps,
|
|
131
|
-
ContentProps,
|
|
130
|
+
ClickAwayListenerProps: ClickAwayListenerPropsProp,
|
|
131
|
+
ContentProps: ContentPropsProp,
|
|
132
132
|
disableWindowBlurListener = false,
|
|
133
133
|
message,
|
|
134
134
|
onBlur,
|
|
@@ -138,12 +138,14 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
138
138
|
onMouseLeave,
|
|
139
139
|
open,
|
|
140
140
|
resumeHideDuration,
|
|
141
|
-
|
|
141
|
+
slots = {},
|
|
142
|
+
slotProps = {},
|
|
143
|
+
TransitionComponent: TransitionComponentProp,
|
|
142
144
|
transitionDuration = defaultTransitionDuration,
|
|
143
145
|
TransitionProps: {
|
|
144
146
|
onEnter,
|
|
145
147
|
onExited,
|
|
146
|
-
...
|
|
148
|
+
...TransitionPropsProp
|
|
147
149
|
} = {},
|
|
148
150
|
...other
|
|
149
151
|
} = props;
|
|
@@ -155,7 +157,7 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
155
157
|
},
|
|
156
158
|
autoHideDuration,
|
|
157
159
|
disableWindowBlurListener,
|
|
158
|
-
TransitionComponent,
|
|
160
|
+
TransitionComponent: TransitionComponentProp,
|
|
159
161
|
transitionDuration
|
|
160
162
|
};
|
|
161
163
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -166,16 +168,6 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
166
168
|
...ownerState
|
|
167
169
|
});
|
|
168
170
|
const [exited, setExited] = React.useState(true);
|
|
169
|
-
const rootProps = (0, _useSlotProps.default)({
|
|
170
|
-
elementType: SnackbarRoot,
|
|
171
|
-
getSlotProps: getRootProps,
|
|
172
|
-
externalForwardedProps: other,
|
|
173
|
-
ownerState,
|
|
174
|
-
additionalProps: {
|
|
175
|
-
ref
|
|
176
|
-
},
|
|
177
|
-
className: [classes.root, className]
|
|
178
|
-
});
|
|
179
171
|
const handleExited = node => {
|
|
180
172
|
setExited(true);
|
|
181
173
|
if (onExited) {
|
|
@@ -188,28 +180,84 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
188
180
|
onEnter(node, isAppearing);
|
|
189
181
|
}
|
|
190
182
|
};
|
|
183
|
+
const externalForwardedProps = {
|
|
184
|
+
slots: {
|
|
185
|
+
transition: TransitionComponentProp,
|
|
186
|
+
...slots
|
|
187
|
+
},
|
|
188
|
+
slotProps: {
|
|
189
|
+
content: ContentPropsProp,
|
|
190
|
+
clickAwayListener: ClickAwayListenerPropsProp,
|
|
191
|
+
transition: TransitionPropsProp,
|
|
192
|
+
...slotProps
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
const [Root, rootProps] = (0, _useSlot.default)('root', {
|
|
196
|
+
ref,
|
|
197
|
+
className: [classes.root, className],
|
|
198
|
+
elementType: SnackbarRoot,
|
|
199
|
+
getSlotProps: getRootProps,
|
|
200
|
+
externalForwardedProps: {
|
|
201
|
+
...externalForwardedProps,
|
|
202
|
+
...other
|
|
203
|
+
},
|
|
204
|
+
ownerState
|
|
205
|
+
});
|
|
206
|
+
const [ClickAwaySlot, clickAwayListenerProps] = (0, _useSlot.default)('clickAwayListener', {
|
|
207
|
+
elementType: _ClickAwayListener.default,
|
|
208
|
+
externalForwardedProps,
|
|
209
|
+
getSlotProps: handlers => ({
|
|
210
|
+
onClickAway: (...params) => {
|
|
211
|
+
handlers.onClickAway?.(...params);
|
|
212
|
+
onClickAway(...params);
|
|
213
|
+
}
|
|
214
|
+
}),
|
|
215
|
+
ownerState
|
|
216
|
+
});
|
|
217
|
+
const [ContentSlot, contentSlotProps] = (0, _useSlot.default)('content', {
|
|
218
|
+
elementType: _SnackbarContent.default,
|
|
219
|
+
shouldForwardComponentProp: true,
|
|
220
|
+
externalForwardedProps,
|
|
221
|
+
additionalProps: {
|
|
222
|
+
message,
|
|
223
|
+
action
|
|
224
|
+
},
|
|
225
|
+
ownerState
|
|
226
|
+
});
|
|
227
|
+
const [TransitionSlot, transitionProps] = (0, _useSlot.default)('transition', {
|
|
228
|
+
elementType: _Grow.default,
|
|
229
|
+
externalForwardedProps,
|
|
230
|
+
getSlotProps: handlers => ({
|
|
231
|
+
onEnter: (...params) => {
|
|
232
|
+
handlers.onEnter?.(...params);
|
|
233
|
+
handleEnter(...params);
|
|
234
|
+
},
|
|
235
|
+
onExited: (...params) => {
|
|
236
|
+
handlers.onExited?.(...params);
|
|
237
|
+
handleExited(...params);
|
|
238
|
+
}
|
|
239
|
+
}),
|
|
240
|
+
additionalProps: {
|
|
241
|
+
appear: true,
|
|
242
|
+
in: open,
|
|
243
|
+
timeout: transitionDuration,
|
|
244
|
+
direction: vertical === 'top' ? 'down' : 'up'
|
|
245
|
+
},
|
|
246
|
+
ownerState
|
|
247
|
+
});
|
|
191
248
|
|
|
192
249
|
// So we only render active snackbars.
|
|
193
250
|
if (!open && exited) {
|
|
194
251
|
return null;
|
|
195
252
|
}
|
|
196
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SnackbarRoot, {
|
|
253
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ClickAwaySlot, {
|
|
254
|
+
...clickAwayListenerProps,
|
|
255
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
200
256
|
...rootProps,
|
|
201
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
direction: vertical === 'top' ? 'down' : 'up',
|
|
206
|
-
onEnter: handleEnter,
|
|
207
|
-
onExited: handleExited,
|
|
208
|
-
...TransitionProps,
|
|
209
|
-
children: children || /*#__PURE__*/(0, _jsxRuntime.jsx)(_SnackbarContent.default, {
|
|
210
|
-
message: message,
|
|
211
|
-
action: action,
|
|
212
|
-
...ContentProps
|
|
257
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionSlot, {
|
|
258
|
+
...transitionProps,
|
|
259
|
+
children: children || /*#__PURE__*/(0, _jsxRuntime.jsx)(ContentSlot, {
|
|
260
|
+
...contentSlotProps
|
|
213
261
|
})
|
|
214
262
|
})
|
|
215
263
|
})
|
|
@@ -256,10 +304,12 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
|
|
|
256
304
|
className: _propTypes.default.string,
|
|
257
305
|
/**
|
|
258
306
|
* Props applied to the `ClickAwayListener` element.
|
|
307
|
+
* @deprecated Use `slotProps.clickAwayListener` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
259
308
|
*/
|
|
260
309
|
ClickAwayListenerProps: _propTypes.default.object,
|
|
261
310
|
/**
|
|
262
311
|
* Props applied to the [`SnackbarContent`](https://mui.com/material-ui/api/snackbar-content/) element.
|
|
312
|
+
* @deprecated Use `slotProps.content` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
263
313
|
*/
|
|
264
314
|
ContentProps: _propTypes.default.object,
|
|
265
315
|
/**
|
|
@@ -316,6 +366,44 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
|
|
|
316
366
|
* we default to `autoHideDuration / 2` ms.
|
|
317
367
|
*/
|
|
318
368
|
resumeHideDuration: _propTypes.default.number,
|
|
369
|
+
/**
|
|
370
|
+
* The props used for each slot inside.
|
|
371
|
+
* @default {}
|
|
372
|
+
*/
|
|
373
|
+
slotProps: _propTypes.default.shape({
|
|
374
|
+
clickAwayListener: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.shape({
|
|
375
|
+
children: _propTypes.default.element.isRequired,
|
|
376
|
+
disableReactTree: _propTypes.default.bool,
|
|
377
|
+
mouseEvent: _propTypes.default.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]),
|
|
378
|
+
onClickAway: _propTypes.default.func,
|
|
379
|
+
touchEvent: _propTypes.default.oneOf(['onTouchEnd', 'onTouchStart', false])
|
|
380
|
+
}), _propTypes.default.shape({
|
|
381
|
+
children: _propTypes.default.element.isRequired,
|
|
382
|
+
disableReactTree: _propTypes.default.bool,
|
|
383
|
+
key: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
384
|
+
'__@toStringTag@9059': _propTypes.default.oneOf(['BigInt']).isRequired,
|
|
385
|
+
toLocaleString: _propTypes.default.func.isRequired,
|
|
386
|
+
toString: _propTypes.default.func.isRequired,
|
|
387
|
+
valueOf: _propTypes.default.func.isRequired
|
|
388
|
+
}), _propTypes.default.string]),
|
|
389
|
+
mouseEvent: _propTypes.default.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]),
|
|
390
|
+
onClickAway: _propTypes.default.func,
|
|
391
|
+
touchEvent: _propTypes.default.oneOf(['onTouchEnd', 'onTouchStart', false])
|
|
392
|
+
})]),
|
|
393
|
+
content: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
394
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
395
|
+
transition: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
396
|
+
}),
|
|
397
|
+
/**
|
|
398
|
+
* The components used for each slot inside.
|
|
399
|
+
* @default {}
|
|
400
|
+
*/
|
|
401
|
+
slots: _propTypes.default.shape({
|
|
402
|
+
clickAwayListener: _propTypes.default.elementType,
|
|
403
|
+
content: _propTypes.default.elementType,
|
|
404
|
+
root: _propTypes.default.elementType,
|
|
405
|
+
transition: _propTypes.default.elementType
|
|
406
|
+
}),
|
|
319
407
|
/**
|
|
320
408
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
321
409
|
*/
|
|
@@ -323,6 +411,7 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
|
|
|
323
411
|
/**
|
|
324
412
|
* The component used for the transition.
|
|
325
413
|
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
414
|
+
* @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
326
415
|
* @default Grow
|
|
327
416
|
*/
|
|
328
417
|
TransitionComponent: _propTypes.default.elementType,
|
|
@@ -342,6 +431,7 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes /* remove-proptypes *
|
|
|
342
431
|
/**
|
|
343
432
|
* Props applied to the transition element.
|
|
344
433
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
434
|
+
* @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
345
435
|
* @default {}
|
|
346
436
|
*/
|
|
347
437
|
TransitionProps: _propTypes.default.object
|
|
@@ -44,11 +44,11 @@ function isEmpty(obj) {
|
|
|
44
44
|
*
|
|
45
45
|
* Demos:
|
|
46
46
|
*
|
|
47
|
-
* - [Textarea Autosize](https://mui.com/material-ui/react-textarea-autosize/)
|
|
47
|
+
* - [Textarea Autosize](https://next.mui.com/material-ui/react-textarea-autosize/)
|
|
48
48
|
*
|
|
49
49
|
* API:
|
|
50
50
|
*
|
|
51
|
-
* - [TextareaAutosize API](https://mui.com/material-ui/api/textarea-autosize/)
|
|
51
|
+
* - [TextareaAutosize API](https://next.mui.com/material-ui/api/textarea-autosize/)
|
|
52
52
|
*/
|
|
53
53
|
const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize(props, forwardedRef) {
|
|
54
54
|
const {
|
package/node/index.js
CHANGED