1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
3 | import * as React from 'react';
|
4 | import PropTypes from 'prop-types';
|
5 | import clsx from 'clsx';
|
6 | import Collapse from '../Collapse';
|
7 | import withStyles from '../styles/withStyles';
|
8 | export const styles = theme => ({
|
9 |
|
10 | root: {
|
11 | marginTop: 8,
|
12 | marginLeft: 12,
|
13 |
|
14 | paddingLeft: 8 + 12,
|
15 |
|
16 | paddingRight: 8,
|
17 | borderLeft: `1px solid ${theme.palette.type === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]}`
|
18 | },
|
19 |
|
20 |
|
21 | last: {
|
22 | borderLeft: 'none'
|
23 | },
|
24 |
|
25 |
|
26 | transition: {}
|
27 | });
|
28 | const StepContent = React.forwardRef(function StepContent(props, ref) {
|
29 | const {
|
30 |
|
31 | active,
|
32 | children,
|
33 | classes,
|
34 | className,
|
35 |
|
36 | expanded,
|
37 |
|
38 | last,
|
39 |
|
40 | orientation,
|
41 | TransitionComponent = Collapse,
|
42 | transitionDuration: transitionDurationProp = 'auto',
|
43 | TransitionProps
|
44 | } = props,
|
45 | other = _objectWithoutPropertiesLoose(props, ["active", "alternativeLabel", "children", "classes", "className", "completed", "expanded", "last", "optional", "orientation", "TransitionComponent", "transitionDuration", "TransitionProps"]);
|
46 |
|
47 | if (process.env.NODE_ENV !== 'production') {
|
48 | if (orientation !== 'vertical') {
|
49 | console.error('Material-UI: <StepContent /> is only designed for use with the vertical stepper.');
|
50 | }
|
51 | }
|
52 |
|
53 | let transitionDuration = transitionDurationProp;
|
54 |
|
55 | if (transitionDurationProp === 'auto' && !TransitionComponent.muiSupportAuto) {
|
56 | transitionDuration = undefined;
|
57 | }
|
58 |
|
59 | return React.createElement("div", _extends({
|
60 | className: clsx(classes.root, className, last && classes.last),
|
61 | ref: ref
|
62 | }, other), React.createElement(TransitionComponent, _extends({
|
63 | in: active || expanded,
|
64 | className: classes.transition,
|
65 | timeout: transitionDuration,
|
66 | unmountOnExit: true
|
67 | }, TransitionProps), children));
|
68 | });
|
69 | process.env.NODE_ENV !== "production" ? StepContent.propTypes = {
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 | |
76 |
|
77 |
|
78 | children: PropTypes.node,
|
79 |
|
80 | |
81 |
|
82 |
|
83 |
|
84 | classes: PropTypes.object,
|
85 |
|
86 | |
87 |
|
88 |
|
89 | className: PropTypes.string,
|
90 |
|
91 | |
92 |
|
93 |
|
94 |
|
95 | TransitionComponent: PropTypes.elementType,
|
96 |
|
97 | |
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 | transitionDuration: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({
|
104 | appear: PropTypes.number,
|
105 | enter: PropTypes.number,
|
106 | exit: PropTypes.number
|
107 | })]),
|
108 |
|
109 | |
110 |
|
111 |
|
112 | TransitionProps: PropTypes.object
|
113 | } : void 0;
|
114 | export default withStyles(styles, {
|
115 | name: 'MuiStepContent'
|
116 | })(StepContent); |
\ | No newline at end of file |