@mui/material 5.14.4 → 5.14.6
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/accordionClasses.d.ts +18 -18
- package/AccordionActions/accordionActionsClasses.d.ts +10 -10
- package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
- package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
- package/Alert/alertClasses.d.ts +44 -44
- package/AlertTitle/alertTitleClasses.d.ts +8 -8
- package/AppBar/appBarClasses.d.ts +28 -28
- package/Autocomplete/autocompleteClasses.d.ts +58 -58
- package/Avatar/avatarClasses.d.ts +20 -20
- package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
- package/Backdrop/backdropClasses.d.ts +10 -10
- package/Badge/Badge.d.ts +135 -67
- package/Badge/badgeClasses.d.ts +56 -56
- package/BottomNavigation/BottomNavigation.js +0 -0
- package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
- package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
- package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
- package/Button/buttonClasses.d.ts +100 -100
- package/ButtonBase/buttonBaseClasses.d.ts +12 -12
- package/ButtonBase/touchRippleClasses.d.ts +20 -20
- package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
- package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
- package/CHANGELOG.md +195 -7
- package/Card/cardClasses.d.ts +8 -8
- package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
- package/CardActions/cardActionsClasses.d.ts +10 -10
- package/CardContent/cardContentClasses.d.ts +8 -8
- package/CardHeader/cardHeaderClasses.d.ts +18 -18
- package/CardMedia/cardMediaClasses.d.ts +12 -12
- package/Checkbox/checkboxClasses.d.ts +22 -22
- package/Chip/chipClasses.d.ts +96 -96
- package/CircularProgress/circularProgressClasses.d.ts +26 -26
- package/ClickAwayListener/index.d.ts +1 -1
- package/Collapse/collapseClasses.d.ts +18 -18
- package/Container/containerClasses.d.ts +6 -6
- package/Dialog/DialogContext.d.ts +6 -6
- package/Dialog/dialogClasses.d.ts +36 -36
- package/DialogActions/dialogActionsClasses.d.ts +10 -10
- package/DialogContent/dialogContentClasses.d.ts +10 -10
- package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
- package/DialogTitle/dialogTitleClasses.d.ts +8 -8
- package/Divider/dividerClasses.d.ts +34 -34
- package/Drawer/Drawer.d.ts +2 -0
- package/Drawer/Drawer.js +2 -0
- package/Drawer/drawerClasses.d.ts +30 -30
- package/Fab/fabClasses.d.ts +26 -26
- package/FilledInput/filledInputClasses.d.ts +42 -42
- package/FormControl/FormControlContext.d.ts +17 -17
- package/FormControl/formControlClasses.d.ts +14 -14
- package/FormControl/useFormControl.d.ts +2 -2
- package/FormControlLabel/formControlLabelClasses.d.ts +24 -24
- package/FormGroup/formGroupClasses.d.ts +12 -12
- package/FormHelperText/formHelperTextClasses.d.ts +22 -22
- package/FormLabel/formLabelClasses.d.ts +22 -22
- package/Grid/gridClasses.d.ts +48 -48
- package/Icon/iconClasses.d.ts +24 -24
- package/IconButton/iconButtonClasses.d.ts +34 -34
- package/ImageList/imageListClasses.d.ts +16 -16
- package/ImageListItem/imageListItemClasses.d.ts +18 -18
- package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
- package/Input/inputClasses.d.ts +38 -38
- package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
- package/InputBase/InputBase.js +1 -1
- package/InputBase/inputBaseClasses.d.ts +46 -46
- package/InputLabel/inputLabelClasses.d.ts +32 -32
- package/LinearProgress/linearProgressClasses.d.ts +42 -42
- package/Link/getTextDecoration.d.ts +15 -15
- package/Link/linkClasses.d.ts +18 -18
- package/List/listClasses.d.ts +14 -14
- package/ListItem/listItemClasses.d.ts +30 -30
- package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
- package/ListItemButton/listItemButtonClasses.d.ts +22 -22
- package/ListItemIcon/listItemIconClasses.d.ts +10 -10
- package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
- package/ListItemText/listItemTextClasses.d.ts +18 -18
- package/ListSubheader/listSubheaderClasses.d.ts +18 -18
- package/Menu/menuClasses.d.ts +12 -12
- package/MenuItem/menuItemClasses.d.ts +20 -20
- package/MobileStepper/mobileStepperClasses.d.ts +22 -22
- package/Modal/Modal.d.ts +117 -12
- package/Modal/Modal.js +97 -36
- package/Modal/index.d.ts +4 -1
- package/Modal/index.js +3 -2
- package/Modal/modalClasses.d.ts +12 -0
- package/Modal/modalClasses.js +7 -0
- package/NativeSelect/nativeSelectClasses.d.ts +34 -34
- package/OutlinedInput/outlinedInputClasses.d.ts +38 -38
- package/Pagination/paginationClasses.d.ts +14 -14
- package/PaginationItem/paginationItemClasses.d.ts +42 -42
- package/Paper/paperClasses.d.ts +39 -39
- package/Popover/popoverClasses.d.ts +10 -10
- package/Popper/Popper.d.ts +65 -65
- package/README.md +2 -3
- package/Radio/radioClasses.d.ts +16 -16
- package/RadioGroup/RadioGroupContext.d.ts +11 -11
- package/RadioGroup/useRadioGroup.d.ts +4 -4
- package/Rating/ratingClasses.d.ts +40 -40
- package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
- package/Select/Select.js +5 -3
- package/Select/selectClasses.d.ts +34 -32
- package/Select/selectClasses.js +1 -1
- package/Skeleton/Skeleton.js +2 -2
- package/Skeleton/skeletonClasses.d.ts +26 -26
- package/Slider/SliderValueLabel.d.ts +10 -10
- package/Slider/SliderValueLabel.types.d.ts +24 -24
- package/Slider/sliderClasses.d.ts +58 -58
- package/Snackbar/snackbarClasses.d.ts +20 -20
- package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
- package/SpeedDial/speedDialClasses.d.ts +22 -22
- package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
- package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
- package/Stack/stackClasses.d.ts +6 -6
- package/Step/StepContext.d.ts +20 -20
- package/Step/stepClasses.d.ts +16 -16
- package/StepButton/stepButtonClasses.d.ts +14 -14
- package/StepConnector/stepConnectorClasses.d.ts +26 -26
- package/StepContent/stepContentClasses.d.ts +12 -12
- package/StepIcon/stepIconClasses.d.ts +16 -16
- package/StepLabel/stepLabelClasses.d.ts +28 -28
- package/Stepper/StepperContext.d.ts +18 -18
- package/Stepper/stepperClasses.d.ts +14 -14
- package/SvgIcon/svgIconClasses.d.ts +26 -26
- package/Switch/switchClasses.d.ts +32 -32
- package/Tab/tabClasses.d.ts +26 -26
- package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
- package/Table/tableClasses.d.ts +10 -10
- package/TableBody/tableBodyClasses.d.ts +8 -8
- package/TableCell/tableCellClasses.d.ts +32 -32
- package/TableContainer/tableContainerClasses.d.ts +8 -8
- package/TableFooter/tableFooterClasses.d.ts +8 -8
- package/TableHead/tableHeadClasses.d.ts +8 -8
- package/TablePagination/tablePaginationClasses.d.ts +28 -28
- package/TableRow/tableRowClasses.d.ts +16 -16
- package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
- package/Tabs/tabsClasses.d.ts +32 -32
- package/TextField/TextField.d.ts +0 -4
- package/TextField/TextField.js +1 -7
- package/TextField/textFieldClasses.d.ts +8 -8
- package/ToggleButton/toggleButtonClasses.d.ts +24 -24
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
- package/Toolbar/toolbarClasses.d.ts +14 -14
- package/Tooltip/tooltipClasses.d.ts +30 -30
- package/Typography/typographyClasses.d.ts +50 -50
- package/Unstable_Grid2/Grid2.d.ts +4 -4
- package/Unstable_Grid2/Grid2Props.d.ts +15 -15
- package/Unstable_Grid2/grid2Classes.d.ts +5 -5
- package/Unstable_Grid2/index.d.ts +4 -4
- package/className/index.d.ts +1 -1
- package/darkScrollbar/index.d.ts +28 -28
- package/generateUtilityClass/index.d.ts +2 -2
- package/generateUtilityClasses/index.d.ts +1 -1
- package/index.js +1 -1
- package/internal/switchBaseClasses.d.ts +12 -12
- package/legacy/BottomNavigation/BottomNavigation.js +0 -0
- package/legacy/Drawer/Drawer.js +2 -0
- package/legacy/InputBase/InputBase.js +1 -1
- package/legacy/Modal/Modal.js +93 -43
- package/legacy/Modal/index.js +3 -2
- package/legacy/Modal/modalClasses.js +7 -0
- package/legacy/Select/Select.js +4 -2
- package/legacy/Select/selectClasses.js +1 -1
- package/legacy/Skeleton/Skeleton.js +2 -2
- package/legacy/TextField/TextField.js +1 -7
- package/legacy/index.js +1 -1
- package/locale/index.d.ts +80 -80
- package/modern/BottomNavigation/BottomNavigation.js +0 -0
- package/modern/Drawer/Drawer.js +2 -0
- package/modern/InputBase/InputBase.js +1 -1
- package/modern/Modal/Modal.js +97 -36
- package/modern/Modal/index.js +3 -2
- package/modern/Modal/modalClasses.js +7 -0
- package/modern/Select/Select.js +5 -3
- package/modern/Select/selectClasses.js +1 -1
- package/modern/Skeleton/Skeleton.js +2 -2
- package/modern/TextField/TextField.js +1 -7
- package/modern/index.js +1 -1
- package/node/BottomNavigation/BottomNavigation.js +0 -0
- package/node/Drawer/Drawer.js +2 -0
- package/node/InputBase/InputBase.js +1 -1
- package/node/Modal/Modal.js +100 -41
- package/node/Modal/index.js +17 -8
- package/node/Modal/modalClasses.js +16 -0
- package/node/Select/Select.js +5 -3
- package/node/Select/selectClasses.js +1 -1
- package/node/Skeleton/Skeleton.js +2 -2
- package/node/TextField/TextField.js +1 -7
- package/node/index.js +1 -1
- package/package.json +6 -6
- package/styles/CssVarsProvider.d.ts +20 -20
- package/styles/excludeVariablesFromRoot.d.ts +5 -5
- package/styles/getOverlayAlpha.d.ts +2 -2
- package/styles/identifier.d.ts +2 -2
- package/styles/shouldSkipGeneratingVar.d.ts +1 -1
- package/transitions/index.d.ts +1 -1
- package/transitions/transition.d.ts +13 -13
- package/transitions/utils.d.ts +23 -23
- package/types/OverridableComponentAugmentation.d.ts +31 -31
- package/umd/material-ui.development.js +527 -652
- package/umd/material-ui.production.min.js +22 -22
- package/useMediaQuery/useMediaQuery.d.ts +46 -46
- package/useTouchRipple/index.d.ts +1 -1
- package/useTouchRipple/useTouchRipple.d.ts +28 -28
- package/utils/getScrollbarSize.d.ts +2 -2
- package/utils/ownerDocument.d.ts +2 -2
- package/utils/ownerWindow.d.ts +2 -2
- package/utils/setRef.d.ts +2 -2
package/legacy/Modal/Modal.js
CHANGED
|
@@ -5,14 +5,28 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
|
-
import { Modal as ModalUnstyled, modalClasses as modalUnstyledClasses } from '@mui/base/Modal';
|
|
9
|
-
import { isHostComponent, resolveComponentProps } from '@mui/base/utils';
|
|
10
8
|
import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
|
|
9
|
+
import { useSlotProps } from '@mui/base';
|
|
10
|
+
import { unstable_useModal as useModal } from '@mui/base/unstable_useModal';
|
|
11
|
+
import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
|
|
12
|
+
import FocusTrap from '../Unstable_TrapFocus';
|
|
13
|
+
import Portal from '../Portal';
|
|
11
14
|
import styled from '../styles/styled';
|
|
12
15
|
import useThemeProps from '../styles/useThemeProps';
|
|
13
16
|
import Backdrop from '../Backdrop';
|
|
17
|
+
import { getModalUtilityClass } from './modalClasses';
|
|
14
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
|
|
19
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
21
|
+
var open = ownerState.open,
|
|
22
|
+
exited = ownerState.exited,
|
|
23
|
+
classes = ownerState.classes;
|
|
24
|
+
var slots = {
|
|
25
|
+
root: ['root', !open && exited && 'hidden'],
|
|
26
|
+
backdrop: ['backdrop']
|
|
27
|
+
};
|
|
28
|
+
return composeClasses(slots, getModalUtilityClass, classes);
|
|
29
|
+
};
|
|
16
30
|
var ModalRoot = styled('div', {
|
|
17
31
|
name: 'MuiModal',
|
|
18
32
|
slot: 'Root',
|
|
@@ -66,7 +80,7 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
66
80
|
var _props$BackdropCompon = props.BackdropComponent,
|
|
67
81
|
BackdropComponent = _props$BackdropCompon === void 0 ? ModalBackdrop : _props$BackdropCompon,
|
|
68
82
|
BackdropProps = props.BackdropProps,
|
|
69
|
-
|
|
83
|
+
classesProp = props.classes,
|
|
70
84
|
className = props.className,
|
|
71
85
|
_props$closeAfterTran = props.closeAfterTransition,
|
|
72
86
|
closeAfterTransition = _props$closeAfterTran === void 0 ? false : _props$closeAfterTran,
|
|
@@ -100,11 +114,7 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
100
114
|
slots = props.slots,
|
|
101
115
|
theme = props.theme,
|
|
102
116
|
other = _objectWithoutProperties(props, ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "open", "slotProps", "slots", "theme"]);
|
|
103
|
-
var
|
|
104
|
-
exited = _React$useState[0],
|
|
105
|
-
setExited = _React$useState[1];
|
|
106
|
-
var commonProps = {
|
|
107
|
-
container: container,
|
|
117
|
+
var propsWithDefaults = _extends({}, props, {
|
|
108
118
|
closeAfterTransition: closeAfterTransition,
|
|
109
119
|
disableAutoFocus: disableAutoFocus,
|
|
110
120
|
disableEnforceFocus: disableEnforceFocus,
|
|
@@ -113,48 +123,88 @@ var Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
113
123
|
disableRestoreFocus: disableRestoreFocus,
|
|
114
124
|
disableScrollLock: disableScrollLock,
|
|
115
125
|
hideBackdrop: hideBackdrop,
|
|
116
|
-
keepMounted: keepMounted
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
keepMounted: keepMounted
|
|
127
|
+
});
|
|
128
|
+
var _useModal = useModal(_extends({}, propsWithDefaults, {
|
|
129
|
+
rootRef: ref
|
|
130
|
+
})),
|
|
131
|
+
getRootProps = _useModal.getRootProps,
|
|
132
|
+
getBackdropProps = _useModal.getBackdropProps,
|
|
133
|
+
getTransitionProps = _useModal.getTransitionProps,
|
|
134
|
+
portalRef = _useModal.portalRef,
|
|
135
|
+
isTopModal = _useModal.isTopModal,
|
|
136
|
+
exited = _useModal.exited,
|
|
137
|
+
hasTransition = _useModal.hasTransition;
|
|
138
|
+
var ownerState = _extends({}, propsWithDefaults, {
|
|
122
139
|
exited: exited
|
|
123
140
|
});
|
|
141
|
+
var classes = useUtilityClasses(ownerState);
|
|
142
|
+
var childProps = {};
|
|
143
|
+
if (children.props.tabIndex === undefined) {
|
|
144
|
+
childProps.tabIndex = '-1';
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// It's a Transition like component
|
|
148
|
+
if (hasTransition) {
|
|
149
|
+
var _getTransitionProps = getTransitionProps(),
|
|
150
|
+
onEnter = _getTransitionProps.onEnter,
|
|
151
|
+
onExited = _getTransitionProps.onExited;
|
|
152
|
+
childProps.onEnter = onEnter;
|
|
153
|
+
childProps.onExited = onExited;
|
|
154
|
+
}
|
|
124
155
|
var RootSlot = (_ref2 = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components.Root) != null ? _ref2 : ModalRoot;
|
|
125
156
|
var BackdropSlot = (_ref3 = (_slots$backdrop = slots == null ? void 0 : slots.backdrop) != null ? _slots$backdrop : components.Backdrop) != null ? _ref3 : BackdropComponent;
|
|
126
157
|
var rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
|
|
127
158
|
var backdropSlotProps = (_slotProps$backdrop = slotProps == null ? void 0 : slotProps.backdrop) != null ? _slotProps$backdrop : componentsProps.backdrop;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
as: component,
|
|
137
|
-
theme: theme
|
|
138
|
-
}, {
|
|
139
|
-
className: clsx(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
|
|
140
|
-
});
|
|
141
|
-
},
|
|
142
|
-
backdrop: function backdrop() {
|
|
143
|
-
return _extends({}, BackdropProps, resolveComponentProps(backdropSlotProps, ownerState), {
|
|
144
|
-
className: clsx(backdropSlotProps == null ? void 0 : backdropSlotProps.className, BackdropProps == null ? void 0 : BackdropProps.className, classes == null ? void 0 : classes.backdrop)
|
|
145
|
-
});
|
|
146
|
-
}
|
|
159
|
+
var rootProps = useSlotProps({
|
|
160
|
+
elementType: RootSlot,
|
|
161
|
+
externalSlotProps: rootSlotProps,
|
|
162
|
+
externalForwardedProps: other,
|
|
163
|
+
getSlotProps: getRootProps,
|
|
164
|
+
additionalProps: {
|
|
165
|
+
ref: ref,
|
|
166
|
+
as: component
|
|
147
167
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
168
|
+
ownerState: ownerState,
|
|
169
|
+
className: clsx(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
|
|
170
|
+
});
|
|
171
|
+
var backdropProps = useSlotProps({
|
|
172
|
+
elementType: BackdropSlot,
|
|
173
|
+
externalSlotProps: backdropSlotProps,
|
|
174
|
+
additionalProps: BackdropProps,
|
|
175
|
+
getSlotProps: function getSlotProps(otherHandlers) {
|
|
176
|
+
return getBackdropProps(_extends({}, otherHandlers, {
|
|
177
|
+
onClick: function onClick(e) {
|
|
178
|
+
if (onBackdropClick) {
|
|
179
|
+
onBackdropClick(e);
|
|
180
|
+
}
|
|
181
|
+
if (otherHandlers != null && otherHandlers.onClick) {
|
|
182
|
+
otherHandlers.onClick(e);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}));
|
|
153
186
|
},
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
187
|
+
className: clsx(backdropSlotProps == null ? void 0 : backdropSlotProps.className, BackdropProps == null ? void 0 : BackdropProps.className, classes == null ? void 0 : classes.backdrop),
|
|
188
|
+
ownerState: ownerState
|
|
189
|
+
});
|
|
190
|
+
if (!keepMounted && !open && (!hasTransition || exited)) {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
return /*#__PURE__*/_jsx(Portal, {
|
|
194
|
+
ref: portalRef,
|
|
195
|
+
container: container,
|
|
196
|
+
disablePortal: disablePortal,
|
|
197
|
+
children: /*#__PURE__*/_jsxs(RootSlot, _extends({}, rootProps, {
|
|
198
|
+
children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/_jsx(BackdropSlot, _extends({}, backdropProps)) : null, /*#__PURE__*/_jsx(FocusTrap, {
|
|
199
|
+
disableEnforceFocus: disableEnforceFocus,
|
|
200
|
+
disableAutoFocus: disableAutoFocus,
|
|
201
|
+
disableRestoreFocus: disableRestoreFocus,
|
|
202
|
+
isEnabled: isTopModal,
|
|
203
|
+
open: open,
|
|
204
|
+
children: /*#__PURE__*/React.cloneElement(children, childProps)
|
|
205
|
+
})]
|
|
206
|
+
}))
|
|
207
|
+
});
|
|
158
208
|
});
|
|
159
209
|
process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ = {
|
|
160
210
|
// ----------------------------- Warning --------------------------------
|
package/legacy/Modal/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
export { ModalManager } from '@mui/base/
|
|
3
|
+
export { ModalManager } from '@mui/base/unstable_useModal';
|
|
4
4
|
export { default } from './Modal';
|
|
5
|
-
export
|
|
5
|
+
export { default as modalClasses } from './modalClasses';
|
|
6
|
+
export * from './modalClasses';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
2
|
+
import generateUtilityClass from '../generateUtilityClass';
|
|
3
|
+
export function getModalUtilityClass(slot) {
|
|
4
|
+
return generateUtilityClass('MuiModal', slot);
|
|
5
|
+
}
|
|
6
|
+
var modalClasses = generateUtilityClasses('MuiModal', ['root', 'hidden', 'backdrop']);
|
|
7
|
+
export default modalClasses;
|
package/legacy/Select/Select.js
CHANGED
|
@@ -83,6 +83,8 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
83
83
|
classes: classesProp
|
|
84
84
|
});
|
|
85
85
|
var classes = useUtilityClasses(ownerState);
|
|
86
|
+
var root = classes.root,
|
|
87
|
+
restOfClasses = _objectWithoutProperties(classes, ["root"]);
|
|
86
88
|
var InputComponent = input || {
|
|
87
89
|
standard: /*#__PURE__*/_jsx(StyledInput, {
|
|
88
90
|
ownerState: ownerState
|
|
@@ -125,13 +127,13 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
125
127
|
id: id
|
|
126
128
|
}, SelectDisplayProps)
|
|
127
129
|
}, inputProps, {
|
|
128
|
-
classes: inputProps ? deepmerge(
|
|
130
|
+
classes: inputProps ? deepmerge(restOfClasses, inputProps.classes) : restOfClasses
|
|
129
131
|
}, input ? input.props.inputProps : {})
|
|
130
132
|
}, multiple && native && variant === 'outlined' ? {
|
|
131
133
|
notched: true
|
|
132
134
|
} : {}, {
|
|
133
135
|
ref: inputComponentRef,
|
|
134
|
-
className: clsx(InputComponent.props.className, className)
|
|
136
|
+
className: clsx(InputComponent.props.className, className, classes.root)
|
|
135
137
|
}, !input && {
|
|
136
138
|
variant: variant
|
|
137
139
|
}, other))
|
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '../generateUtilityClass';
|
|
|
3
3
|
export function getSelectUtilityClasses(slot) {
|
|
4
4
|
return generateUtilityClass('MuiSelect', slot);
|
|
5
5
|
}
|
|
6
|
-
var selectClasses = generateUtilityClasses('MuiSelect', ['select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
|
|
6
|
+
var selectClasses = generateUtilityClasses('MuiSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
|
|
7
7
|
export default selectClasses;
|
|
@@ -70,11 +70,11 @@ var SkeletonRoot = styled('span', {
|
|
|
70
70
|
});
|
|
71
71
|
}, function (_ref2) {
|
|
72
72
|
var ownerState = _ref2.ownerState;
|
|
73
|
-
return ownerState.animation === 'pulse' && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n animation: ", "
|
|
73
|
+
return ownerState.animation === 'pulse' && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n animation: ", " 2s ease-in-out 0.5s infinite;\n "])), pulseKeyframe);
|
|
74
74
|
}, function (_ref3) {
|
|
75
75
|
var ownerState = _ref3.ownerState,
|
|
76
76
|
theme = _ref3.theme;
|
|
77
|
-
return ownerState.animation === 'wave' && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n\n /* Fix bug in Safari https://bugs.webkit.org/show_bug.cgi?id=68196 */\n -webkit-mask-image: -webkit-radial-gradient(white, black);\n\n &::after {\n animation: ", "
|
|
77
|
+
return ownerState.animation === 'wave' && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n\n /* Fix bug in Safari https://bugs.webkit.org/show_bug.cgi?id=68196 */\n -webkit-mask-image: -webkit-radial-gradient(white, black);\n\n &::after {\n animation: ", " 2s linear 0.5s infinite;\n background: linear-gradient(\n 90deg,\n transparent,\n ", ",\n transparent\n );\n content: '';\n position: absolute;\n transform: translateX(-100%); /* Avoid flash during server-side hydration */\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n }\n "])), waveKeyframe, (theme.vars || theme).palette.action.hover);
|
|
78
78
|
});
|
|
79
79
|
var Skeleton = /*#__PURE__*/React.forwardRef(function Skeleton(inProps, ref) {
|
|
80
80
|
var props = useThemeProps({
|
|
@@ -105,7 +105,6 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
|
|
|
105
105
|
name = props.name,
|
|
106
106
|
onBlur = props.onBlur,
|
|
107
107
|
onChange = props.onChange,
|
|
108
|
-
onClick = props.onClick,
|
|
109
108
|
onFocus = props.onFocus,
|
|
110
109
|
placeholder = props.placeholder,
|
|
111
110
|
_props$required = props.required,
|
|
@@ -118,7 +117,7 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
|
|
|
118
117
|
value = props.value,
|
|
119
118
|
_props$variant = props.variant,
|
|
120
119
|
variant = _props$variant === void 0 ? 'outlined' : _props$variant,
|
|
121
|
-
other = _objectWithoutProperties(props, ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "
|
|
120
|
+
other = _objectWithoutProperties(props, ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"]);
|
|
122
121
|
var ownerState = _extends({}, props, {
|
|
123
122
|
autoFocus: autoFocus,
|
|
124
123
|
color: color,
|
|
@@ -172,7 +171,6 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
|
|
|
172
171
|
onBlur: onBlur,
|
|
173
172
|
onChange: onChange,
|
|
174
173
|
onFocus: onFocus,
|
|
175
|
-
onClick: onClick,
|
|
176
174
|
placeholder: placeholder,
|
|
177
175
|
inputProps: inputProps
|
|
178
176
|
}, InputMore, InputProps));
|
|
@@ -331,10 +329,6 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
331
329
|
* You can pull out the new value by accessing `event.target.value` (string).
|
|
332
330
|
*/
|
|
333
331
|
onChange: PropTypes.func,
|
|
334
|
-
/**
|
|
335
|
-
* @ignore
|
|
336
|
-
*/
|
|
337
|
-
onClick: PropTypes.func,
|
|
338
332
|
/**
|
|
339
333
|
* @ignore
|
|
340
334
|
*/
|
package/legacy/index.js
CHANGED
package/locale/index.d.ts
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import { ComponentsPropsList } from '../styles/props';
|
|
2
|
-
export interface Localization {
|
|
3
|
-
components?: {
|
|
4
|
-
MuiAlert?: {
|
|
5
|
-
defaultProps: Pick<ComponentsPropsList['MuiAlert'], 'closeText'>;
|
|
6
|
-
};
|
|
7
|
-
MuiBreadcrumbs?: {
|
|
8
|
-
defaultProps: Pick<ComponentsPropsList['MuiBreadcrumbs'], 'expandText'>;
|
|
9
|
-
};
|
|
10
|
-
MuiTablePagination?: {
|
|
11
|
-
defaultProps: Pick<ComponentsPropsList['MuiTablePagination'], 'labelRowsPerPage' | 'labelDisplayedRows' | 'getItemAriaLabel'>;
|
|
12
|
-
};
|
|
13
|
-
MuiRating?: {
|
|
14
|
-
defaultProps: Pick<ComponentsPropsList['MuiRating'], 'emptyLabelText' | 'getLabelText'>;
|
|
15
|
-
};
|
|
16
|
-
MuiAutocomplete?: {
|
|
17
|
-
defaultProps: Pick<ComponentsPropsList['MuiAutocomplete'], 'clearText' | 'closeText' | 'loadingText' | 'noOptionsText' | 'openText'>;
|
|
18
|
-
};
|
|
19
|
-
MuiPagination?: {
|
|
20
|
-
defaultProps: Pick<ComponentsPropsList['MuiPagination'], 'aria-label' | 'getItemAriaLabel'>;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export declare const amET: Localization;
|
|
25
|
-
export declare const arEG: Localization;
|
|
26
|
-
export declare const arSA: Localization;
|
|
27
|
-
export declare const arSD: Localization;
|
|
28
|
-
export declare const azAZ: Localization;
|
|
29
|
-
export declare const bnBD: Localization;
|
|
30
|
-
export declare const beBY: Localization;
|
|
31
|
-
export declare const bgBG: Localization;
|
|
32
|
-
export declare const caES: Localization;
|
|
33
|
-
export declare const csCZ: Localization;
|
|
34
|
-
export declare const daDK: Localization;
|
|
35
|
-
export declare const deDE: Localization;
|
|
36
|
-
export declare const elGR: Localization;
|
|
37
|
-
export declare const enUS: Localization;
|
|
38
|
-
export declare const esES: Localization;
|
|
39
|
-
export declare const etEE: Localization;
|
|
40
|
-
export declare const faIR: Localization;
|
|
41
|
-
export declare const fiFI: Localization;
|
|
42
|
-
export declare const frFR: Localization;
|
|
43
|
-
export declare const heIL: Localization;
|
|
44
|
-
export declare const hiIN: Localization;
|
|
45
|
-
export declare const hrHR: Localization;
|
|
46
|
-
export declare const huHU: Localization;
|
|
47
|
-
export declare const hyAM: Localization;
|
|
48
|
-
export declare const idID: Localization;
|
|
49
|
-
export declare const isIS: Localization;
|
|
50
|
-
export declare const itIT: Localization;
|
|
51
|
-
export declare const jaJP: Localization;
|
|
52
|
-
export declare const khKH: Localization;
|
|
53
|
-
export declare const koKR: Localization;
|
|
54
|
-
export declare const kuCKB: Localization;
|
|
55
|
-
export declare const kuLatn: Localization;
|
|
56
|
-
export declare const kkKZ: Localization;
|
|
57
|
-
export declare const mkMK: Localization;
|
|
58
|
-
export declare const myMY: Localization;
|
|
59
|
-
export declare const msMS: Localization;
|
|
60
|
-
export declare const neNP: Localization;
|
|
61
|
-
export declare const nbNO: Localization;
|
|
62
|
-
export declare const nlNL: Localization;
|
|
63
|
-
export declare const plPL: Localization;
|
|
64
|
-
export declare const ptBR: Localization;
|
|
65
|
-
export declare const ptPT: Localization;
|
|
66
|
-
export declare const roRO: Localization;
|
|
67
|
-
export declare const srRS: Localization;
|
|
68
|
-
export declare const ruRU: Localization;
|
|
69
|
-
export declare const siLK: Localization;
|
|
70
|
-
export declare const skSK: Localization;
|
|
71
|
-
export declare const svSE: Localization;
|
|
72
|
-
export declare const thTH: Localization;
|
|
73
|
-
export declare const trTR: Localization;
|
|
74
|
-
export declare const tlTL: Localization;
|
|
75
|
-
export declare const ukUA: Localization;
|
|
76
|
-
export declare const urPK: Localization;
|
|
77
|
-
export declare const viVN: Localization;
|
|
78
|
-
export declare const zhCN: Localization;
|
|
79
|
-
export declare const zhHK: Localization;
|
|
80
|
-
export declare const zhTW: Localization;
|
|
1
|
+
import { ComponentsPropsList } from '../styles/props';
|
|
2
|
+
export interface Localization {
|
|
3
|
+
components?: {
|
|
4
|
+
MuiAlert?: {
|
|
5
|
+
defaultProps: Pick<ComponentsPropsList['MuiAlert'], 'closeText'>;
|
|
6
|
+
};
|
|
7
|
+
MuiBreadcrumbs?: {
|
|
8
|
+
defaultProps: Pick<ComponentsPropsList['MuiBreadcrumbs'], 'expandText'>;
|
|
9
|
+
};
|
|
10
|
+
MuiTablePagination?: {
|
|
11
|
+
defaultProps: Pick<ComponentsPropsList['MuiTablePagination'], 'labelRowsPerPage' | 'labelDisplayedRows' | 'getItemAriaLabel'>;
|
|
12
|
+
};
|
|
13
|
+
MuiRating?: {
|
|
14
|
+
defaultProps: Pick<ComponentsPropsList['MuiRating'], 'emptyLabelText' | 'getLabelText'>;
|
|
15
|
+
};
|
|
16
|
+
MuiAutocomplete?: {
|
|
17
|
+
defaultProps: Pick<ComponentsPropsList['MuiAutocomplete'], 'clearText' | 'closeText' | 'loadingText' | 'noOptionsText' | 'openText'>;
|
|
18
|
+
};
|
|
19
|
+
MuiPagination?: {
|
|
20
|
+
defaultProps: Pick<ComponentsPropsList['MuiPagination'], 'aria-label' | 'getItemAriaLabel'>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare const amET: Localization;
|
|
25
|
+
export declare const arEG: Localization;
|
|
26
|
+
export declare const arSA: Localization;
|
|
27
|
+
export declare const arSD: Localization;
|
|
28
|
+
export declare const azAZ: Localization;
|
|
29
|
+
export declare const bnBD: Localization;
|
|
30
|
+
export declare const beBY: Localization;
|
|
31
|
+
export declare const bgBG: Localization;
|
|
32
|
+
export declare const caES: Localization;
|
|
33
|
+
export declare const csCZ: Localization;
|
|
34
|
+
export declare const daDK: Localization;
|
|
35
|
+
export declare const deDE: Localization;
|
|
36
|
+
export declare const elGR: Localization;
|
|
37
|
+
export declare const enUS: Localization;
|
|
38
|
+
export declare const esES: Localization;
|
|
39
|
+
export declare const etEE: Localization;
|
|
40
|
+
export declare const faIR: Localization;
|
|
41
|
+
export declare const fiFI: Localization;
|
|
42
|
+
export declare const frFR: Localization;
|
|
43
|
+
export declare const heIL: Localization;
|
|
44
|
+
export declare const hiIN: Localization;
|
|
45
|
+
export declare const hrHR: Localization;
|
|
46
|
+
export declare const huHU: Localization;
|
|
47
|
+
export declare const hyAM: Localization;
|
|
48
|
+
export declare const idID: Localization;
|
|
49
|
+
export declare const isIS: Localization;
|
|
50
|
+
export declare const itIT: Localization;
|
|
51
|
+
export declare const jaJP: Localization;
|
|
52
|
+
export declare const khKH: Localization;
|
|
53
|
+
export declare const koKR: Localization;
|
|
54
|
+
export declare const kuCKB: Localization;
|
|
55
|
+
export declare const kuLatn: Localization;
|
|
56
|
+
export declare const kkKZ: Localization;
|
|
57
|
+
export declare const mkMK: Localization;
|
|
58
|
+
export declare const myMY: Localization;
|
|
59
|
+
export declare const msMS: Localization;
|
|
60
|
+
export declare const neNP: Localization;
|
|
61
|
+
export declare const nbNO: Localization;
|
|
62
|
+
export declare const nlNL: Localization;
|
|
63
|
+
export declare const plPL: Localization;
|
|
64
|
+
export declare const ptBR: Localization;
|
|
65
|
+
export declare const ptPT: Localization;
|
|
66
|
+
export declare const roRO: Localization;
|
|
67
|
+
export declare const srRS: Localization;
|
|
68
|
+
export declare const ruRU: Localization;
|
|
69
|
+
export declare const siLK: Localization;
|
|
70
|
+
export declare const skSK: Localization;
|
|
71
|
+
export declare const svSE: Localization;
|
|
72
|
+
export declare const thTH: Localization;
|
|
73
|
+
export declare const trTR: Localization;
|
|
74
|
+
export declare const tlTL: Localization;
|
|
75
|
+
export declare const ukUA: Localization;
|
|
76
|
+
export declare const urPK: Localization;
|
|
77
|
+
export declare const viVN: Localization;
|
|
78
|
+
export declare const zhCN: Localization;
|
|
79
|
+
export declare const zhHK: Localization;
|
|
80
|
+
export declare const zhTW: Localization;
|
|
File without changes
|
package/modern/Drawer/Drawer.js
CHANGED
|
@@ -268,8 +268,10 @@ process.env.NODE_ENV !== "production" ? Drawer.propTypes /* remove-proptypes */
|
|
|
268
268
|
ModalProps: PropTypes.object,
|
|
269
269
|
/**
|
|
270
270
|
* Callback fired when the component requests to be closed.
|
|
271
|
+
* The `reason` parameter can optionally be used to control the response to `onClose`.
|
|
271
272
|
*
|
|
272
273
|
* @param {object} event The event source of the callback.
|
|
274
|
+
* @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
|
|
273
275
|
*/
|
|
274
276
|
onClose: PropTypes.func,
|
|
275
277
|
/**
|
|
@@ -373,7 +373,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
373
373
|
if (inputRef.current && event.currentTarget === event.target) {
|
|
374
374
|
inputRef.current.focus();
|
|
375
375
|
}
|
|
376
|
-
if (onClick
|
|
376
|
+
if (onClick) {
|
|
377
377
|
onClick(event);
|
|
378
378
|
}
|
|
379
379
|
};
|
package/modern/Modal/Modal.js
CHANGED
|
@@ -6,14 +6,30 @@ const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className",
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import { Modal as ModalUnstyled, modalClasses as modalUnstyledClasses } from '@mui/base/Modal';
|
|
10
|
-
import { isHostComponent, resolveComponentProps } from '@mui/base/utils';
|
|
11
9
|
import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
|
|
10
|
+
import { useSlotProps } from '@mui/base';
|
|
11
|
+
import { unstable_useModal as useModal } from '@mui/base/unstable_useModal';
|
|
12
|
+
import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
|
|
13
|
+
import FocusTrap from '../Unstable_TrapFocus';
|
|
14
|
+
import Portal from '../Portal';
|
|
12
15
|
import styled from '../styles/styled';
|
|
13
16
|
import useThemeProps from '../styles/useThemeProps';
|
|
14
17
|
import Backdrop from '../Backdrop';
|
|
18
|
+
import { getModalUtilityClass } from './modalClasses';
|
|
15
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
|
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
const useUtilityClasses = ownerState => {
|
|
22
|
+
const {
|
|
23
|
+
open,
|
|
24
|
+
exited,
|
|
25
|
+
classes
|
|
26
|
+
} = ownerState;
|
|
27
|
+
const slots = {
|
|
28
|
+
root: ['root', !open && exited && 'hidden'],
|
|
29
|
+
backdrop: ['backdrop']
|
|
30
|
+
};
|
|
31
|
+
return composeClasses(slots, getModalUtilityClass, classes);
|
|
32
|
+
};
|
|
17
33
|
const ModalRoot = styled('div', {
|
|
18
34
|
name: 'MuiModal',
|
|
19
35
|
slot: 'Root',
|
|
@@ -67,7 +83,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
67
83
|
const {
|
|
68
84
|
BackdropComponent = ModalBackdrop,
|
|
69
85
|
BackdropProps,
|
|
70
|
-
classes,
|
|
71
86
|
className,
|
|
72
87
|
closeAfterTransition = false,
|
|
73
88
|
children,
|
|
@@ -84,17 +99,13 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
84
99
|
hideBackdrop = false,
|
|
85
100
|
keepMounted = false,
|
|
86
101
|
onBackdropClick,
|
|
87
|
-
onClose,
|
|
88
102
|
open,
|
|
89
103
|
slotProps,
|
|
90
|
-
slots
|
|
104
|
+
slots
|
|
91
105
|
// eslint-disable-next-line react/prop-types
|
|
92
|
-
theme
|
|
93
106
|
} = props,
|
|
94
107
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
95
|
-
const
|
|
96
|
-
const commonProps = {
|
|
97
|
-
container,
|
|
108
|
+
const propsWithDefaults = _extends({}, props, {
|
|
98
109
|
closeAfterTransition,
|
|
99
110
|
disableAutoFocus,
|
|
100
111
|
disableEnforceFocus,
|
|
@@ -103,40 +114,90 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
103
114
|
disableRestoreFocus,
|
|
104
115
|
disableScrollLock,
|
|
105
116
|
hideBackdrop,
|
|
106
|
-
keepMounted
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
keepMounted
|
|
118
|
+
});
|
|
119
|
+
const {
|
|
120
|
+
getRootProps,
|
|
121
|
+
getBackdropProps,
|
|
122
|
+
getTransitionProps,
|
|
123
|
+
portalRef,
|
|
124
|
+
isTopModal,
|
|
125
|
+
exited,
|
|
126
|
+
hasTransition
|
|
127
|
+
} = useModal(_extends({}, propsWithDefaults, {
|
|
128
|
+
rootRef: ref
|
|
129
|
+
}));
|
|
130
|
+
const ownerState = _extends({}, propsWithDefaults, {
|
|
112
131
|
exited
|
|
113
132
|
});
|
|
133
|
+
const classes = useUtilityClasses(ownerState);
|
|
134
|
+
const childProps = {};
|
|
135
|
+
if (children.props.tabIndex === undefined) {
|
|
136
|
+
childProps.tabIndex = '-1';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// It's a Transition like component
|
|
140
|
+
if (hasTransition) {
|
|
141
|
+
const {
|
|
142
|
+
onEnter,
|
|
143
|
+
onExited
|
|
144
|
+
} = getTransitionProps();
|
|
145
|
+
childProps.onEnter = onEnter;
|
|
146
|
+
childProps.onExited = onExited;
|
|
147
|
+
}
|
|
114
148
|
const RootSlot = slots?.root ?? components.Root ?? ModalRoot;
|
|
115
149
|
const BackdropSlot = slots?.backdrop ?? components.Backdrop ?? BackdropComponent;
|
|
116
150
|
const rootSlotProps = slotProps?.root ?? componentsProps.root;
|
|
117
151
|
const backdropSlotProps = slotProps?.backdrop ?? componentsProps.backdrop;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
152
|
+
const rootProps = useSlotProps({
|
|
153
|
+
elementType: RootSlot,
|
|
154
|
+
externalSlotProps: rootSlotProps,
|
|
155
|
+
externalForwardedProps: other,
|
|
156
|
+
getSlotProps: getRootProps,
|
|
157
|
+
additionalProps: {
|
|
158
|
+
ref,
|
|
159
|
+
as: component
|
|
122
160
|
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
161
|
+
ownerState,
|
|
162
|
+
className: clsx(className, rootSlotProps?.className, classes?.root, !ownerState.open && ownerState.exited && classes?.hidden)
|
|
163
|
+
});
|
|
164
|
+
const backdropProps = useSlotProps({
|
|
165
|
+
elementType: BackdropSlot,
|
|
166
|
+
externalSlotProps: backdropSlotProps,
|
|
167
|
+
additionalProps: BackdropProps,
|
|
168
|
+
getSlotProps: otherHandlers => {
|
|
169
|
+
return getBackdropProps(_extends({}, otherHandlers, {
|
|
170
|
+
onClick: e => {
|
|
171
|
+
if (onBackdropClick) {
|
|
172
|
+
onBackdropClick(e);
|
|
173
|
+
}
|
|
174
|
+
if (otherHandlers?.onClick) {
|
|
175
|
+
otherHandlers.onClick(e);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}));
|
|
133
179
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
180
|
+
className: clsx(backdropSlotProps?.className, BackdropProps?.className, classes?.backdrop),
|
|
181
|
+
ownerState
|
|
182
|
+
});
|
|
183
|
+
if (!keepMounted && !open && (!hasTransition || exited)) {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
return /*#__PURE__*/_jsx(Portal, {
|
|
187
|
+
ref: portalRef,
|
|
188
|
+
container: container,
|
|
189
|
+
disablePortal: disablePortal,
|
|
190
|
+
children: /*#__PURE__*/_jsxs(RootSlot, _extends({}, rootProps, {
|
|
191
|
+
children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/_jsx(BackdropSlot, _extends({}, backdropProps)) : null, /*#__PURE__*/_jsx(FocusTrap, {
|
|
192
|
+
disableEnforceFocus: disableEnforceFocus,
|
|
193
|
+
disableAutoFocus: disableAutoFocus,
|
|
194
|
+
disableRestoreFocus: disableRestoreFocus,
|
|
195
|
+
isEnabled: isTopModal,
|
|
196
|
+
open: open,
|
|
197
|
+
children: /*#__PURE__*/React.cloneElement(children, childProps)
|
|
198
|
+
})]
|
|
199
|
+
}))
|
|
200
|
+
});
|
|
140
201
|
});
|
|
141
202
|
process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ = {
|
|
142
203
|
// ----------------------------- Warning --------------------------------
|