1 | "use strict";
|
2 |
|
3 | var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
4 |
|
5 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
6 |
|
7 | Object.defineProperty(exports, "__esModule", {
|
8 | value: true
|
9 | });
|
10 | exports.default = exports.styles = void 0;
|
11 |
|
12 | var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13 |
|
14 | var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
15 |
|
16 | var React = _interopRequireWildcard(require("react"));
|
17 |
|
18 | var _propTypes = _interopRequireDefault(require("prop-types"));
|
19 |
|
20 | var _clsx = _interopRequireDefault(require("clsx"));
|
21 |
|
22 | var _Collapse = _interopRequireDefault(require("../Collapse"));
|
23 |
|
24 | var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
|
25 |
|
26 | var styles = function styles(theme) {
|
27 | return {
|
28 |
|
29 | root: {
|
30 | marginTop: 8,
|
31 | marginLeft: 12,
|
32 |
|
33 | paddingLeft: 8 + 12,
|
34 |
|
35 | paddingRight: 8,
|
36 | borderLeft: "1px solid ".concat(theme.palette.type === 'light' ? theme.palette.grey[400] : theme.palette.grey[600])
|
37 | },
|
38 |
|
39 |
|
40 | last: {
|
41 | borderLeft: 'none'
|
42 | },
|
43 |
|
44 |
|
45 | transition: {}
|
46 | };
|
47 | };
|
48 |
|
49 | exports.styles = styles;
|
50 | var StepContent = React.forwardRef(function StepContent(props, ref) {
|
51 | var active = props.active,
|
52 | alternativeLabel = props.alternativeLabel,
|
53 | children = props.children,
|
54 | classes = props.classes,
|
55 | className = props.className,
|
56 | completed = props.completed,
|
57 | expanded = props.expanded,
|
58 | last = props.last,
|
59 | optional = props.optional,
|
60 | orientation = props.orientation,
|
61 | _props$TransitionComp = props.TransitionComponent,
|
62 | TransitionComponent = _props$TransitionComp === void 0 ? _Collapse.default : _props$TransitionComp,
|
63 | _props$transitionDura = props.transitionDuration,
|
64 | transitionDurationProp = _props$transitionDura === void 0 ? 'auto' : _props$transitionDura,
|
65 | TransitionProps = props.TransitionProps,
|
66 | other = (0, _objectWithoutProperties2.default)(props, ["active", "alternativeLabel", "children", "classes", "className", "completed", "expanded", "last", "optional", "orientation", "TransitionComponent", "transitionDuration", "TransitionProps"]);
|
67 |
|
68 | if (process.env.NODE_ENV !== 'production') {
|
69 | if (orientation !== 'vertical') {
|
70 | console.error('Material-UI: <StepContent /> is only designed for use with the vertical stepper.');
|
71 | }
|
72 | }
|
73 |
|
74 | var transitionDuration = transitionDurationProp;
|
75 |
|
76 | if (transitionDurationProp === 'auto' && !TransitionComponent.muiSupportAuto) {
|
77 | transitionDuration = undefined;
|
78 | }
|
79 |
|
80 | return React.createElement("div", (0, _extends2.default)({
|
81 | className: (0, _clsx.default)(classes.root, className, last && classes.last),
|
82 | ref: ref
|
83 | }, other), React.createElement(TransitionComponent, (0, _extends2.default)({
|
84 | in: active || expanded,
|
85 | className: classes.transition,
|
86 | timeout: transitionDuration,
|
87 | unmountOnExit: true
|
88 | }, TransitionProps), children));
|
89 | });
|
90 | process.env.NODE_ENV !== "production" ? StepContent.propTypes = {
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 | |
97 |
|
98 |
|
99 | children: _propTypes.default.node,
|
100 |
|
101 | |
102 |
|
103 |
|
104 |
|
105 | classes: _propTypes.default.object,
|
106 |
|
107 | |
108 |
|
109 |
|
110 | className: _propTypes.default.string,
|
111 |
|
112 | |
113 |
|
114 |
|
115 |
|
116 | TransitionComponent: _propTypes.default.elementType,
|
117 |
|
118 | |
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 | transitionDuration: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number, _propTypes.default.shape({
|
125 | appear: _propTypes.default.number,
|
126 | enter: _propTypes.default.number,
|
127 | exit: _propTypes.default.number
|
128 | })]),
|
129 |
|
130 | |
131 |
|
132 |
|
133 | TransitionProps: _propTypes.default.object
|
134 | } : void 0;
|
135 |
|
136 | var _default = (0, _withStyles.default)(styles, {
|
137 | name: 'MuiStepContent'
|
138 | })(StepContent);
|
139 |
|
140 | exports.default = _default; |
\ | No newline at end of file |