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 withStyles from '../styles/withStyles';
|
7 | export const styles = theme => ({
|
8 |
|
9 | root: {
|
10 | flex: '1 1 auto'
|
11 | },
|
12 |
|
13 |
|
14 | horizontal: {},
|
15 |
|
16 |
|
17 | vertical: {
|
18 | marginLeft: 12,
|
19 |
|
20 | padding: '0 0 8px'
|
21 | },
|
22 |
|
23 |
|
24 | alternativeLabel: {
|
25 | position: 'absolute',
|
26 | top: 8 + 4,
|
27 | left: 'calc(-50% + 20px)',
|
28 | right: 'calc(50% + 20px)'
|
29 | },
|
30 |
|
31 |
|
32 | active: {},
|
33 |
|
34 |
|
35 | completed: {},
|
36 |
|
37 |
|
38 | disabled: {},
|
39 |
|
40 |
|
41 | line: {
|
42 | display: 'block',
|
43 | borderColor: theme.palette.type === 'light' ? theme.palette.grey[400] : theme.palette.grey[600]
|
44 | },
|
45 |
|
46 |
|
47 | lineHorizontal: {
|
48 | borderTopStyle: 'solid',
|
49 | borderTopWidth: 1
|
50 | },
|
51 |
|
52 |
|
53 | lineVertical: {
|
54 | borderLeftStyle: 'solid',
|
55 | borderLeftWidth: 1,
|
56 | minHeight: 24
|
57 | }
|
58 | });
|
59 | const StepConnector = React.forwardRef(function StepConnector(props, ref) {
|
60 | const {
|
61 |
|
62 | active,
|
63 |
|
64 | alternativeLabel = false,
|
65 | classes,
|
66 | className,
|
67 |
|
68 | completed,
|
69 |
|
70 | disabled,
|
71 |
|
72 | orientation = 'horizontal'
|
73 | } = props,
|
74 | other = _objectWithoutPropertiesLoose(props, ["active", "alternativeLabel", "classes", "className", "completed", "disabled", "index", "orientation"]);
|
75 |
|
76 | return React.createElement("div", _extends({
|
77 | className: clsx(classes.root, classes[orientation], className, alternativeLabel && classes.alternativeLabel, active && classes.active, completed && classes.completed, disabled && classes.disabled),
|
78 | ref: ref
|
79 | }, other), React.createElement("span", {
|
80 | className: clsx(classes.line, {
|
81 | 'horizontal': classes.lineHorizontal,
|
82 | 'vertical': classes.lineVertical
|
83 | }[orientation])
|
84 | }));
|
85 | });
|
86 | process.env.NODE_ENV !== "production" ? StepConnector.propTypes = {
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 | |
93 |
|
94 |
|
95 |
|
96 | classes: PropTypes.object,
|
97 |
|
98 | |
99 |
|
100 |
|
101 | className: PropTypes.string
|
102 | } : void 0;
|
103 | export default withStyles(styles, {
|
104 | name: 'MuiStepConnector'
|
105 | })(StepConnector); |
\ | No newline at end of file |