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