1 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
2 | import _extends from "@babel/runtime/helpers/esm/extends";
|
3 | const _excluded = ["className", "dividers"];
|
4 | import * as React from 'react';
|
5 | import PropTypes from 'prop-types';
|
6 | import clsx from 'clsx';
|
7 | import { unstable_composeClasses as composeClasses } from '@mui/base';
|
8 | import styled from '../styles/styled';
|
9 | import useThemeProps from '../styles/useThemeProps';
|
10 | import { getDialogContentUtilityClass } from './dialogContentClasses';
|
11 | import dialogTitleClasses from '../DialogTitle/dialogTitleClasses';
|
12 | import { jsx as _jsx } from "react/jsx-runtime";
|
13 |
|
14 | const useUtilityClasses = ownerState => {
|
15 | const {
|
16 | classes,
|
17 | dividers
|
18 | } = ownerState;
|
19 | const slots = {
|
20 | root: ['root', dividers && 'dividers']
|
21 | };
|
22 | return composeClasses(slots, getDialogContentUtilityClass, classes);
|
23 | };
|
24 |
|
25 | const DialogContentRoot = styled('div', {
|
26 | name: 'MuiDialogContent',
|
27 | slot: 'Root',
|
28 | overridesResolver: (props, styles) => {
|
29 | const {
|
30 | ownerState
|
31 | } = props;
|
32 | return [styles.root, ownerState.dividers && styles.dividers];
|
33 | }
|
34 | })(({
|
35 | theme,
|
36 | ownerState
|
37 | }) => _extends({
|
38 | flex: '1 1 auto',
|
39 |
|
40 | WebkitOverflowScrolling: 'touch',
|
41 | overflowY: 'auto',
|
42 | padding: '20px 24px'
|
43 | }, ownerState.dividers ? {
|
44 | padding: '16px 24px',
|
45 | borderTop: `1px solid ${(theme.vars || theme).palette.divider}`,
|
46 | borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
|
47 | } : {
|
48 | [`.${dialogTitleClasses.root} + &`]: {
|
49 | paddingTop: 0
|
50 | }
|
51 | }));
|
52 | const DialogContent = React.forwardRef(function DialogContent(inProps, ref) {
|
53 | const props = useThemeProps({
|
54 | props: inProps,
|
55 | name: 'MuiDialogContent'
|
56 | });
|
57 |
|
58 | const {
|
59 | className,
|
60 | dividers = false
|
61 | } = props,
|
62 | other = _objectWithoutPropertiesLoose(props, _excluded);
|
63 |
|
64 | const ownerState = _extends({}, props, {
|
65 | dividers
|
66 | });
|
67 |
|
68 | const classes = useUtilityClasses(ownerState);
|
69 | return _jsx(DialogContentRoot, _extends({
|
70 | className: clsx(classes.root, className),
|
71 | ownerState: ownerState,
|
72 | ref: ref
|
73 | }, other));
|
74 | });
|
75 | process.env.NODE_ENV !== "production" ? DialogContent.propTypes
|
76 |
|
77 | = {
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | |
84 |
|
85 |
|
86 | children: PropTypes.node,
|
87 |
|
88 | |
89 |
|
90 |
|
91 | classes: PropTypes.object,
|
92 |
|
93 | |
94 |
|
95 |
|
96 | className: PropTypes.string,
|
97 |
|
98 | |
99 |
|
100 |
|
101 |
|
102 | dividers: PropTypes.bool,
|
103 |
|
104 | |
105 |
|
106 |
|
107 | sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
108 | } : void 0;
|
109 | export default DialogContent; |
\ | No newline at end of file |