@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
|
@@ -18,12 +18,12 @@ function clickedRootScrollbar(event, doc) {
|
|
|
18
18
|
*
|
|
19
19
|
* Demos:
|
|
20
20
|
*
|
|
21
|
-
* - [Click-Away Listener](https://mui.com/material-ui/react-click-away-listener/)
|
|
22
|
-
* - [Menu](https://mui.com/material-ui/react-menu/)
|
|
21
|
+
* - [Click-Away Listener](https://next.mui.com/material-ui/react-click-away-listener/)
|
|
22
|
+
* - [Menu](https://next.mui.com/material-ui/react-menu/)
|
|
23
23
|
*
|
|
24
24
|
* API:
|
|
25
25
|
*
|
|
26
|
-
* - [ClickAwayListener API](https://mui.com/material-ui/api/click-away-listener/)
|
|
26
|
+
* - [ClickAwayListener API](https://next.mui.com/material-ui/api/click-away-listener/)
|
|
27
27
|
*/
|
|
28
28
|
function ClickAwayListener(props) {
|
|
29
29
|
const {
|
package/modern/Grid2/Grid2.js
CHANGED
|
@@ -10,11 +10,11 @@ import useTheme from "../styles/useTheme.js";
|
|
|
10
10
|
*
|
|
11
11
|
* Demos:
|
|
12
12
|
*
|
|
13
|
-
* - [Grid version 2](https://mui.com/material-ui/react-grid2/)
|
|
13
|
+
* - [Grid version 2](https://next.mui.com/material-ui/react-grid2/)
|
|
14
14
|
*
|
|
15
15
|
* API:
|
|
16
16
|
*
|
|
17
|
-
* - [Grid2 API](https://mui.com/material-ui/api/grid-2/)
|
|
17
|
+
* - [Grid2 API](https://next.mui.com/material-ui/api/grid-2/)
|
|
18
18
|
*/
|
|
19
19
|
const Grid2 = createGrid2({
|
|
20
20
|
createStyledComponent: styled('div', {
|
package/modern/Menu/Menu.js
CHANGED
|
@@ -263,16 +263,20 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
|
|
|
263
263
|
* @default {}
|
|
264
264
|
*/
|
|
265
265
|
slotProps: PropTypes.shape({
|
|
266
|
+
backdrop: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
266
267
|
paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
267
|
-
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
268
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
269
|
+
transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
268
270
|
}),
|
|
269
271
|
/**
|
|
270
272
|
* The components used for each slot inside.
|
|
271
273
|
* @default {}
|
|
272
274
|
*/
|
|
273
275
|
slots: PropTypes.shape({
|
|
276
|
+
backdrop: PropTypes.elementType,
|
|
274
277
|
paper: PropTypes.elementType,
|
|
275
|
-
root: PropTypes.elementType
|
|
278
|
+
root: PropTypes.elementType,
|
|
279
|
+
transition: PropTypes.elementType
|
|
276
280
|
}),
|
|
277
281
|
/**
|
|
278
282
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
package/modern/Modal/Modal.js
CHANGED
|
@@ -15,7 +15,6 @@ import Backdrop from "../Backdrop/index.js";
|
|
|
15
15
|
import useModal from "./useModal.js";
|
|
16
16
|
import { getModalUtilityClass } from "./modalClasses.js";
|
|
17
17
|
import useSlot from "../utils/useSlot.js";
|
|
18
|
-
import { useForkRef } from "../utils/index.js";
|
|
19
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
const useUtilityClasses = ownerState => {
|
|
21
20
|
const {
|
|
@@ -158,7 +157,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
158
157
|
childProps.onExited = onExited;
|
|
159
158
|
}
|
|
160
159
|
const externalForwardedProps = {
|
|
161
|
-
...other,
|
|
162
160
|
slots: {
|
|
163
161
|
root: components.Root,
|
|
164
162
|
backdrop: components.Backdrop,
|
|
@@ -170,19 +168,22 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
170
168
|
}
|
|
171
169
|
};
|
|
172
170
|
const [RootSlot, rootProps] = useSlot('root', {
|
|
171
|
+
ref,
|
|
173
172
|
elementType: ModalRoot,
|
|
174
|
-
externalForwardedProps
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
as: component
|
|
173
|
+
externalForwardedProps: {
|
|
174
|
+
...externalForwardedProps,
|
|
175
|
+
...other,
|
|
176
|
+
component
|
|
179
177
|
},
|
|
178
|
+
getSlotProps: getRootProps,
|
|
180
179
|
ownerState,
|
|
181
180
|
className: clsx(className, classes?.root, !ownerState.open && ownerState.exited && classes?.hidden)
|
|
182
181
|
});
|
|
183
182
|
const [BackdropSlot, backdropProps] = useSlot('backdrop', {
|
|
183
|
+
ref: BackdropProps?.ref,
|
|
184
184
|
elementType: BackdropComponent,
|
|
185
185
|
externalForwardedProps,
|
|
186
|
+
shouldForwardComponentProp: true,
|
|
186
187
|
additionalProps: BackdropProps,
|
|
187
188
|
getSlotProps: otherHandlers => {
|
|
188
189
|
return getBackdropProps({
|
|
@@ -200,7 +201,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
200
201
|
className: clsx(BackdropProps?.className, classes?.backdrop),
|
|
201
202
|
ownerState
|
|
202
203
|
});
|
|
203
|
-
const backdropRef = useForkRef(BackdropProps?.ref, backdropProps.ref);
|
|
204
204
|
if (!keepMounted && !open && (!hasTransition || exited)) {
|
|
205
205
|
return null;
|
|
206
206
|
}
|
|
@@ -211,8 +211,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
211
211
|
children: /*#__PURE__*/_jsxs(RootSlot, {
|
|
212
212
|
...rootProps,
|
|
213
213
|
children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/_jsx(BackdropSlot, {
|
|
214
|
-
...backdropProps
|
|
215
|
-
ref: backdropRef
|
|
214
|
+
...backdropProps
|
|
216
215
|
}) : null, /*#__PURE__*/_jsx(FocusTrap, {
|
|
217
216
|
disableEnforceFocus: disableEnforceFocus,
|
|
218
217
|
disableAutoFocus: disableAutoFocus,
|
package/modern/NoSsr/NoSsr.js
CHANGED
|
@@ -15,11 +15,11 @@ import { exactProp, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui
|
|
|
15
15
|
*
|
|
16
16
|
* Demos:
|
|
17
17
|
*
|
|
18
|
-
* - [No SSR](https://mui.com/material-ui/react-no-ssr/)
|
|
18
|
+
* - [No SSR](https://next.mui.com/material-ui/react-no-ssr/)
|
|
19
19
|
*
|
|
20
20
|
* API:
|
|
21
21
|
*
|
|
22
|
-
* - [NoSsr API](https://mui.com/material-ui/api/no-ssr/)
|
|
22
|
+
* - [NoSsr API](https://next.mui.com/material-ui/api/no-ssr/)
|
|
23
23
|
*/
|
|
24
24
|
function NoSsr(props) {
|
|
25
25
|
const {
|
|
@@ -23,11 +23,11 @@ const useUtilityClasses = ownerState => {
|
|
|
23
23
|
*
|
|
24
24
|
* Demos:
|
|
25
25
|
*
|
|
26
|
-
* - [Container](https://mui.com/material-ui/react-container/)
|
|
26
|
+
* - [Container](https://next.mui.com/material-ui/react-container/)
|
|
27
27
|
*
|
|
28
28
|
* API:
|
|
29
29
|
*
|
|
30
|
-
* - [PigmentContainer API](https://mui.com/material-ui/api/pigment-container/)
|
|
30
|
+
* - [PigmentContainer API](https://next.mui.com/material-ui/api/pigment-container/)
|
|
31
31
|
*/
|
|
32
32
|
const PigmentContainer = /*#__PURE__*/React.forwardRef(function PigmentContainer({
|
|
33
33
|
className,
|
|
@@ -37,11 +37,11 @@ const useUtilityClasses = ownerState => {
|
|
|
37
37
|
*
|
|
38
38
|
* Demos:
|
|
39
39
|
*
|
|
40
|
-
* - [Grid version 2](https://mui.com/material-ui/react-grid2/)
|
|
40
|
+
* - [Grid version 2](https://next.mui.com/material-ui/react-grid2/)
|
|
41
41
|
*
|
|
42
42
|
* API:
|
|
43
43
|
*
|
|
44
|
-
* - [PigmentGrid API](https://mui.com/material-ui/api/pigment-grid/)
|
|
44
|
+
* - [PigmentGrid API](https://next.mui.com/material-ui/api/pigment-grid/)
|
|
45
45
|
*/
|
|
46
46
|
const PigmentGrid = /*#__PURE__*/React.forwardRef(function PigmentGrid(props, ref) {
|
|
47
47
|
const {
|
|
@@ -171,11 +171,11 @@ process.env.NODE_ENV !== "production" ? HiddenCss.propTypes /* remove-proptypes
|
|
|
171
171
|
*
|
|
172
172
|
* Demos:
|
|
173
173
|
*
|
|
174
|
-
* - [Hidden](https://mui.com/material-ui/react-hidden/)
|
|
174
|
+
* - [Hidden](https://next.mui.com/material-ui/react-hidden/)
|
|
175
175
|
*
|
|
176
176
|
* API:
|
|
177
177
|
*
|
|
178
|
-
* - [PigmentHidden API](https://mui.com/material-ui/api/pigment-hidden/)
|
|
178
|
+
* - [PigmentHidden API](https://next.mui.com/material-ui/api/pigment-hidden/)
|
|
179
179
|
*/
|
|
180
180
|
function PigmentHidden({
|
|
181
181
|
implementation = 'js',
|
|
@@ -16,11 +16,11 @@ const useUtilityClasses = () => {
|
|
|
16
16
|
*
|
|
17
17
|
* Demos:
|
|
18
18
|
*
|
|
19
|
-
* - [Stack](https://mui.com/material-ui/react-stack/)
|
|
19
|
+
* - [Stack](https://next.mui.com/material-ui/react-stack/)
|
|
20
20
|
*
|
|
21
21
|
* API:
|
|
22
22
|
*
|
|
23
|
-
* - [PigmentStack API](https://mui.com/material-ui/api/pigment-stack/)
|
|
23
|
+
* - [PigmentStack API](https://next.mui.com/material-ui/api/pigment-stack/)
|
|
24
24
|
*/
|
|
25
25
|
const PigmentStack = /*#__PURE__*/React.forwardRef(function PigmentStack({
|
|
26
26
|
className,
|
|
@@ -15,12 +15,12 @@ import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
|
15
15
|
import debounce from "../utils/debounce.js";
|
|
16
16
|
import ownerDocument from "../utils/ownerDocument.js";
|
|
17
17
|
import ownerWindow from "../utils/ownerWindow.js";
|
|
18
|
-
import useForkRef from "../utils/useForkRef.js";
|
|
19
18
|
import Grow from "../Grow/index.js";
|
|
20
19
|
import Modal from "../Modal/index.js";
|
|
21
20
|
import PaperBase from "../Paper/index.js";
|
|
22
21
|
import { getPopoverUtilityClass } from "./popoverClasses.js";
|
|
23
22
|
import useSlot from "../utils/useSlot.js";
|
|
23
|
+
import { mergeSlotProps } from "../utils/index.js";
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
25
|
export function getOffsetTop(rect, vertical) {
|
|
26
26
|
let offset = 0;
|
|
@@ -103,22 +103,21 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
103
103
|
marginThreshold = 16,
|
|
104
104
|
open,
|
|
105
105
|
PaperProps: PaperPropsProp = {},
|
|
106
|
+
// TODO: remove in v7
|
|
106
107
|
slots = {},
|
|
107
108
|
slotProps = {},
|
|
108
109
|
transformOrigin = {
|
|
109
110
|
vertical: 'top',
|
|
110
111
|
horizontal: 'left'
|
|
111
112
|
},
|
|
112
|
-
TransitionComponent
|
|
113
|
+
TransitionComponent,
|
|
114
|
+
// TODO: remove in v7
|
|
113
115
|
transitionDuration: transitionDurationProp = 'auto',
|
|
114
|
-
TransitionProps
|
|
115
|
-
|
|
116
|
-
...TransitionProps
|
|
117
|
-
} = {},
|
|
116
|
+
TransitionProps = {},
|
|
117
|
+
// TODO: remove in v7
|
|
118
118
|
disableScrollLock = false,
|
|
119
119
|
...other
|
|
120
120
|
} = props;
|
|
121
|
-
const externalPaperSlotProps = slotProps?.paper ?? PaperPropsProp;
|
|
122
121
|
const paperRef = React.useRef();
|
|
123
122
|
const ownerState = {
|
|
124
123
|
...props,
|
|
@@ -126,7 +125,6 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
126
125
|
anchorReference,
|
|
127
126
|
elevation,
|
|
128
127
|
marginThreshold,
|
|
129
|
-
externalPaperSlotProps,
|
|
130
128
|
transformOrigin,
|
|
131
129
|
TransitionComponent,
|
|
132
130
|
transitionDuration: transitionDurationProp,
|
|
@@ -255,10 +253,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
255
253
|
}
|
|
256
254
|
return () => window.removeEventListener('scroll', setPositioningStyles);
|
|
257
255
|
}, [anchorEl, disableScrollLock, setPositioningStyles]);
|
|
258
|
-
const handleEntering = (
|
|
259
|
-
if (onEntering) {
|
|
260
|
-
onEntering(element, isAppearing);
|
|
261
|
-
}
|
|
256
|
+
const handleEntering = () => {
|
|
262
257
|
setPositioningStyles();
|
|
263
258
|
};
|
|
264
259
|
const handleExited = () => {
|
|
@@ -289,45 +284,65 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
289
284
|
};
|
|
290
285
|
}, [anchorEl, open, setPositioningStyles]);
|
|
291
286
|
let transitionDuration = transitionDurationProp;
|
|
292
|
-
if (transitionDurationProp === 'auto' && !TransitionComponent.muiSupportAuto) {
|
|
293
|
-
transitionDuration = undefined;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// If the container prop is provided, use that
|
|
297
|
-
// If the anchorEl prop is provided, use its parent body element as the container
|
|
298
|
-
// If neither are provided let the Modal take care of choosing the container
|
|
299
|
-
const container = containerProp || (anchorEl ? ownerDocument(resolveAnchorEl(anchorEl)).body : undefined);
|
|
300
287
|
const externalForwardedProps = {
|
|
301
|
-
slots
|
|
288
|
+
slots: {
|
|
289
|
+
transition: TransitionComponent,
|
|
290
|
+
...slots
|
|
291
|
+
},
|
|
302
292
|
slotProps: {
|
|
303
|
-
|
|
304
|
-
paper:
|
|
293
|
+
transition: TransitionProps,
|
|
294
|
+
paper: PaperPropsProp,
|
|
295
|
+
...slotProps
|
|
305
296
|
}
|
|
306
297
|
};
|
|
307
|
-
const [
|
|
308
|
-
elementType:
|
|
298
|
+
const [TransitionSlot, transitionSlotProps] = useSlot('transition', {
|
|
299
|
+
elementType: Grow,
|
|
309
300
|
externalForwardedProps,
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
301
|
+
ownerState,
|
|
302
|
+
getSlotProps: handlers => ({
|
|
303
|
+
...handlers,
|
|
304
|
+
onEntering: (element, isAppearing) => {
|
|
305
|
+
handlers.onEntering?.(element, isAppearing);
|
|
306
|
+
handleEntering();
|
|
307
|
+
},
|
|
308
|
+
onExited: element => {
|
|
309
|
+
handlers.onExited?.(element);
|
|
310
|
+
handleExited();
|
|
316
311
|
}
|
|
317
|
-
},
|
|
318
|
-
|
|
312
|
+
}),
|
|
313
|
+
additionalProps: {
|
|
314
|
+
appear: true,
|
|
315
|
+
in: open
|
|
316
|
+
}
|
|
319
317
|
});
|
|
318
|
+
if (transitionDurationProp === 'auto' && !TransitionSlot.muiSupportAuto) {
|
|
319
|
+
transitionDuration = undefined;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// If the container prop is provided, use that
|
|
323
|
+
// If the anchorEl prop is provided, use its parent body element as the container
|
|
324
|
+
// If neither are provided let the Modal take care of choosing the container
|
|
325
|
+
const container = containerProp || (anchorEl ? ownerDocument(resolveAnchorEl(anchorEl)).body : undefined);
|
|
320
326
|
const [RootSlot, {
|
|
327
|
+
slots: rootSlotsProp,
|
|
321
328
|
slotProps: rootSlotPropsProp,
|
|
322
329
|
...rootProps
|
|
323
330
|
}] = useSlot('root', {
|
|
331
|
+
ref,
|
|
324
332
|
elementType: PopoverRoot,
|
|
325
|
-
externalForwardedProps
|
|
333
|
+
externalForwardedProps: {
|
|
334
|
+
...externalForwardedProps,
|
|
335
|
+
...other
|
|
336
|
+
},
|
|
337
|
+
shouldForwardComponentProp: true,
|
|
326
338
|
additionalProps: {
|
|
339
|
+
slots: {
|
|
340
|
+
backdrop: slots.backdrop
|
|
341
|
+
},
|
|
327
342
|
slotProps: {
|
|
328
|
-
backdrop: {
|
|
343
|
+
backdrop: mergeSlotProps(typeof slotProps.backdrop === 'function' ? slotProps.backdrop(ownerState) : slotProps.backdrop, {
|
|
329
344
|
invisible: true
|
|
330
|
-
}
|
|
345
|
+
})
|
|
331
346
|
},
|
|
332
347
|
container,
|
|
333
348
|
open
|
|
@@ -335,25 +350,32 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
335
350
|
ownerState,
|
|
336
351
|
className: clsx(classes.root, className)
|
|
337
352
|
});
|
|
338
|
-
const
|
|
353
|
+
const [PaperSlot, paperProps] = useSlot('paper', {
|
|
354
|
+
ref: paperRef,
|
|
355
|
+
className: classes.paper,
|
|
356
|
+
elementType: PopoverPaper,
|
|
357
|
+
externalForwardedProps,
|
|
358
|
+
shouldForwardComponentProp: true,
|
|
359
|
+
additionalProps: {
|
|
360
|
+
elevation,
|
|
361
|
+
style: isPositioned ? undefined : {
|
|
362
|
+
opacity: 0
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
ownerState
|
|
366
|
+
});
|
|
339
367
|
return /*#__PURE__*/_jsx(RootSlot, {
|
|
340
368
|
...rootProps,
|
|
341
369
|
...(!isHostComponent(RootSlot) && {
|
|
370
|
+
slots: rootSlotsProp,
|
|
342
371
|
slotProps: rootSlotPropsProp,
|
|
343
372
|
disableScrollLock
|
|
344
373
|
}),
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
children: /*#__PURE__*/_jsx(TransitionComponent, {
|
|
348
|
-
appear: true,
|
|
349
|
-
in: open,
|
|
350
|
-
onEntering: handleEntering,
|
|
351
|
-
onExited: handleExited,
|
|
374
|
+
children: /*#__PURE__*/_jsx(TransitionSlot, {
|
|
375
|
+
...transitionSlotProps,
|
|
352
376
|
timeout: transitionDuration,
|
|
353
|
-
...TransitionProps,
|
|
354
377
|
children: /*#__PURE__*/_jsx(PaperSlot, {
|
|
355
378
|
...paperProps,
|
|
356
|
-
ref: handlePaperRef,
|
|
357
379
|
children: children
|
|
358
380
|
})
|
|
359
381
|
})
|
|
@@ -421,8 +443,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
421
443
|
anchorReference: PropTypes.oneOf(['anchorEl', 'anchorPosition', 'none']),
|
|
422
444
|
/**
|
|
423
445
|
* A backdrop component. This prop enables custom backdrop rendering.
|
|
424
|
-
* @deprecated Use `
|
|
425
|
-
* Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
|
|
446
|
+
* @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.
|
|
426
447
|
* @default styled(Backdrop, {
|
|
427
448
|
* name: 'MuiModal',
|
|
428
449
|
* slot: 'Backdrop',
|
|
@@ -436,7 +457,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
436
457
|
BackdropComponent: PropTypes.elementType,
|
|
437
458
|
/**
|
|
438
459
|
* Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
|
|
439
|
-
* @deprecated Use `slotProps.
|
|
460
|
+
* @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.
|
|
440
461
|
*/
|
|
441
462
|
BackdropProps: PropTypes.object,
|
|
442
463
|
/**
|
|
@@ -500,16 +521,20 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
500
521
|
* @default {}
|
|
501
522
|
*/
|
|
502
523
|
slotProps: PropTypes.shape({
|
|
524
|
+
backdrop: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
503
525
|
paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
504
|
-
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
526
|
+
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
527
|
+
transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
505
528
|
}),
|
|
506
529
|
/**
|
|
507
530
|
* The components used for each slot inside.
|
|
508
531
|
* @default {}
|
|
509
532
|
*/
|
|
510
533
|
slots: PropTypes.shape({
|
|
534
|
+
backdrop: PropTypes.elementType,
|
|
511
535
|
paper: PropTypes.elementType,
|
|
512
|
-
root: PropTypes.elementType
|
|
536
|
+
root: PropTypes.elementType,
|
|
537
|
+
transition: PropTypes.elementType
|
|
513
538
|
}),
|
|
514
539
|
/**
|
|
515
540
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
@@ -534,6 +559,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
534
559
|
/**
|
|
535
560
|
* The component used for the transition.
|
|
536
561
|
* [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
|
|
562
|
+
* @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.
|
|
537
563
|
* @default Grow
|
|
538
564
|
*/
|
|
539
565
|
TransitionComponent: PropTypes.elementType,
|
|
@@ -549,6 +575,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
|
|
|
549
575
|
/**
|
|
550
576
|
* Props applied to the transition element.
|
|
551
577
|
* By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
|
|
578
|
+
* @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.
|
|
552
579
|
* @default {}
|
|
553
580
|
*/
|
|
554
581
|
TransitionProps: PropTypes.object
|
package/modern/Popper/Popper.js
CHANGED
|
@@ -19,13 +19,13 @@ const PopperRoot = styled(BasePopper, {
|
|
|
19
19
|
*
|
|
20
20
|
* Demos:
|
|
21
21
|
*
|
|
22
|
-
* - [Autocomplete](https://mui.com/material-ui/react-autocomplete/)
|
|
23
|
-
* - [Menu](https://mui.com/material-ui/react-menu/)
|
|
24
|
-
* - [Popper](https://mui.com/material-ui/react-popper/)
|
|
22
|
+
* - [Autocomplete](https://next.mui.com/material-ui/react-autocomplete/)
|
|
23
|
+
* - [Menu](https://next.mui.com/material-ui/react-menu/)
|
|
24
|
+
* - [Popper](https://next.mui.com/material-ui/react-popper/)
|
|
25
25
|
*
|
|
26
26
|
* API:
|
|
27
27
|
*
|
|
28
|
-
* - [Popper API](https://mui.com/material-ui/api/popper/)
|
|
28
|
+
* - [Popper API](https://next.mui.com/material-ui/api/popper/)
|
|
29
29
|
*/
|
|
30
30
|
const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
|
|
31
31
|
const isRtl = useRtl();
|
package/modern/Portal/Portal.js
CHANGED
|
@@ -14,11 +14,11 @@ function getContainer(container) {
|
|
|
14
14
|
*
|
|
15
15
|
* Demos:
|
|
16
16
|
*
|
|
17
|
-
* - [Portal](https://mui.com/material-ui/react-portal/)
|
|
17
|
+
* - [Portal](https://next.mui.com/material-ui/react-portal/)
|
|
18
18
|
*
|
|
19
19
|
* API:
|
|
20
20
|
*
|
|
21
|
-
* - [Portal API](https://mui.com/material-ui/api/portal/)
|
|
21
|
+
* - [Portal API](https://next.mui.com/material-ui/api/portal/)
|
|
22
22
|
*/
|
|
23
23
|
const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, forwardedRef) {
|
|
24
24
|
const {
|
package/modern/Slider/Slider.js
CHANGED
|
@@ -966,7 +966,7 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
|
|
|
966
966
|
* @param {Event} event The event source of the callback.
|
|
967
967
|
* You can pull out the new value by accessing `event.target.value` (any).
|
|
968
968
|
* **Warning**: This is a generic event not a change event.
|
|
969
|
-
* @param {
|
|
969
|
+
* @param {Value} value The new value.
|
|
970
970
|
* @param {number} activeThumb Index of the currently moved thumb.
|
|
971
971
|
*/
|
|
972
972
|
onChange: PropTypes.func,
|
|
@@ -974,7 +974,7 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
|
|
|
974
974
|
* Callback function that is fired when the `mouseup` is triggered.
|
|
975
975
|
*
|
|
976
976
|
* @param {React.SyntheticEvent | Event} event The event source of the callback. **Warning**: This is a generic event not a change event.
|
|
977
|
-
* @param {
|
|
977
|
+
* @param {Value} value The new value.
|
|
978
978
|
*/
|
|
979
979
|
onChangeCommitted: PropTypes.func,
|
|
980
980
|
/**
|