@hipay/hipay-material-ui 1.0.0-beta.14 → 1.0.0-beta.15
Sign up to get free protection for your applications and to get access to all the features.
- package/HiBreadcrumb/HiBreadcrumb.js +28 -22
- package/HiBreadcrumb/HiStep.js +96 -60
- package/HiBreadcrumb/HiStepConnector.js +91 -26
- package/HiBreadcrumb/HiStepContent.js +122 -0
- package/HiBreadcrumb/HiStepIcon.js +86 -29
- package/HiBreadcrumb/HiStepLabel.js +128 -62
- package/HiBreadcrumb/HiStepper.js +5 -24
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +3 -1
- package/HiDatePicker/Overlays/Overlay.js +14 -2
- package/HiForm/HiInput.js +24 -11
- package/HiForm/HiSlider.js +399 -0
- package/HiForm/index.js +9 -0
- package/HiTable/BodyCellBuilder.js +3 -0
- package/HiTable/BodyCells/CellIcon.js +26 -19
- package/HiTable/BodyCells/CellImage.js +17 -13
- package/HiTable/BodyCells/CellNumeric.js +7 -2
- package/HiTable/BodyCells/CellSentinel.js +14 -13
- package/HiTable/BodyCells/CellThirdPartySecurity.js +43 -19
- package/HiTable/HeaderCell.js +3 -2
- package/es/HiBreadcrumb/HiBreadcrumb.js +27 -19
- package/es/HiBreadcrumb/HiStep.js +55 -54
- package/es/HiBreadcrumb/HiStepConnector.js +86 -26
- package/es/HiBreadcrumb/HiStepContent.js +63 -0
- package/es/HiBreadcrumb/HiStepIcon.js +103 -35
- package/es/HiBreadcrumb/HiStepLabel.js +106 -63
- package/es/HiBreadcrumb/HiStepper.js +5 -21
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +3 -1
- package/es/HiDatePicker/Overlays/Overlay.js +9 -2
- package/es/HiForm/HiInput.js +19 -10
- package/es/HiForm/HiSlider.js +309 -0
- package/es/HiForm/index.js +1 -0
- package/es/HiTable/BodyCellBuilder.js +3 -0
- package/es/HiTable/BodyCells/CellIcon.js +15 -8
- package/es/HiTable/BodyCells/CellImage.js +16 -14
- package/es/HiTable/BodyCells/CellNumeric.js +6 -2
- package/es/HiTable/BodyCells/CellSentinel.js +8 -5
- package/es/HiTable/BodyCells/CellThirdPartySecurity.js +40 -15
- package/es/HiTable/HeaderCell.js +3 -2
- package/es/utils/hiHelpers.js +4 -3
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +43 -43
- package/umd/hipay-material-ui.development.js +7679 -7170
- package/umd/hipay-material-ui.production.min.js +5 -5
- package/utils/hiHelpers.js +4 -2
@@ -33,23 +33,24 @@ var _propTypes = require('prop-types');
|
|
33
33
|
|
34
34
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
35
35
|
|
36
|
+
var _mdiMaterialUi = require('mdi-material-ui');
|
37
|
+
|
36
38
|
var _Tooltip = require('../../Tooltip');
|
37
39
|
|
38
40
|
var _Tooltip2 = _interopRequireDefault(_Tooltip);
|
39
41
|
|
40
42
|
var _styles = require('../../styles');
|
41
43
|
|
42
|
-
var _mdiMaterialUi = require('mdi-material-ui');
|
43
|
-
|
44
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
45
45
|
|
46
|
-
var styles = exports.styles =
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
46
|
+
var styles = exports.styles = {
|
47
|
+
icon: {
|
48
|
+
width: 18,
|
49
|
+
height: 18
|
50
|
+
},
|
51
|
+
nowrap: {
|
52
|
+
whiteSpace: 'nowrap'
|
53
|
+
}
|
53
54
|
};
|
54
55
|
|
55
56
|
/**
|
@@ -84,26 +85,45 @@ var CellThirdPartySecurity = function (_React$PureComponent) {
|
|
84
85
|
var icon = null;
|
85
86
|
switch (value) {
|
86
87
|
case ECI_5:
|
87
|
-
icon = _react2.default.createElement(_mdiMaterialUi.Lock, {
|
88
|
+
icon = _react2.default.createElement(_mdiMaterialUi.Lock, {
|
89
|
+
className: classes.icon,
|
90
|
+
style: { color: theme.palette.positive.normal }
|
91
|
+
});
|
88
92
|
break;
|
89
93
|
case ECI_6:
|
90
|
-
icon = _react2.default.createElement(_mdiMaterialUi.LockOpen, {
|
94
|
+
icon = _react2.default.createElement(_mdiMaterialUi.LockOpen, {
|
95
|
+
className: classes.icon,
|
96
|
+
style: { color: theme.palette.middle.normal }
|
97
|
+
});
|
91
98
|
break;
|
92
99
|
case AUTH_1:
|
93
|
-
icon = _react2.default.createElement(_mdiMaterialUi.LockOpenOutline, {
|
100
|
+
icon = _react2.default.createElement(_mdiMaterialUi.LockOpenOutline, {
|
101
|
+
className: classes.icon,
|
102
|
+
style: { color: theme.palette.neutral.light }
|
103
|
+
});
|
94
104
|
break;
|
95
105
|
case AUTH_2:
|
96
|
-
icon = _react2.default.createElement(_mdiMaterialUi.LockOpen, {
|
106
|
+
icon = _react2.default.createElement(_mdiMaterialUi.LockOpen, {
|
107
|
+
className: classes.icon,
|
108
|
+
style: { color: theme.palette.neutral.light }
|
109
|
+
});
|
97
110
|
break;
|
98
111
|
case ECI_7:
|
99
112
|
case AUTH_0:
|
113
|
+
default:
|
100
114
|
icon = null;
|
101
115
|
break;
|
102
116
|
}
|
103
117
|
|
118
|
+
var tooltipContent = _react2.default.createElement(
|
119
|
+
'div',
|
120
|
+
{ className: classes.nowrap },
|
121
|
+
label
|
122
|
+
);
|
123
|
+
|
104
124
|
return _react2.default.createElement(
|
105
125
|
_Tooltip2.default,
|
106
|
-
{ title:
|
126
|
+
{ title: tooltipContent, placement: this.props.sticky ? 'right' : 'bottom' },
|
107
127
|
_react2.default.createElement(
|
108
128
|
'div',
|
109
129
|
null,
|
@@ -120,6 +140,14 @@ CellThirdPartySecurity.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
120
140
|
* Useful to extend the style applied to components.
|
121
141
|
*/
|
122
142
|
classes: _propTypes2.default.object,
|
143
|
+
/**
|
144
|
+
* Label
|
145
|
+
*/
|
146
|
+
label: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]),
|
147
|
+
/**
|
148
|
+
* True si la colonne est sticky
|
149
|
+
*/
|
150
|
+
sticky: _propTypes2.default.bool,
|
123
151
|
/**
|
124
152
|
* Useful to extend the theme applied to components.
|
125
153
|
* Used theme props positive.normal, middle.normal, neutral.light
|
@@ -134,10 +162,6 @@ CellThirdPartySecurity.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
134
162
|
* AUTH_1 = 4; // ask for 3DS
|
135
163
|
* AUTH_2 = 5; // force 3DS
|
136
164
|
*/
|
137
|
-
value: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string])
|
138
|
-
/**
|
139
|
-
* Label
|
140
|
-
*/
|
141
|
-
label: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string])
|
165
|
+
value: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string])
|
142
166
|
} : {};
|
143
167
|
exports.default = (0, _styles.withStyles)(styles, { withTheme: true, name: 'HmuiCellThirdPartySecurity' })(CellThirdPartySecurity);
|
package/HiTable/HeaderCell.js
CHANGED
@@ -215,6 +215,7 @@ var HeaderCell = function (_React$PureComponent) {
|
|
215
215
|
classes = _props.classes,
|
216
216
|
type = _props.type,
|
217
217
|
title = _props.title,
|
218
|
+
smallTitle = _props.smallTitle,
|
218
219
|
selectable = _props.selectable,
|
219
220
|
selected = _props.selected,
|
220
221
|
onSelect = _props.onSelect,
|
@@ -321,7 +322,7 @@ var HeaderCell = function (_React$PureComponent) {
|
|
321
322
|
{
|
322
323
|
className: classes.labelContainer + (_sorted ? ' ' + classes.labelContainerOrdered : '')
|
323
324
|
},
|
324
|
-
title
|
325
|
+
view !== 's' ? title : smallTitle ? smallTitle : title
|
325
326
|
),
|
326
327
|
align !== 'right' && _icons
|
327
328
|
) : _react2.default.createElement(
|
@@ -338,7 +339,7 @@ var HeaderCell = function (_React$PureComponent) {
|
|
338
339
|
_react2.default.createElement(
|
339
340
|
'span',
|
340
341
|
{ className: classes.labelContainer, style: { width: '100%' } },
|
341
|
-
title
|
342
|
+
view !== 's' ? title : smallTitle ? smallTitle : title
|
342
343
|
)
|
343
344
|
)
|
344
345
|
),
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import _extends from 'babel-runtime/helpers/extends';
|
2
1
|
import React from 'react';
|
3
2
|
import PropTypes from 'prop-types';
|
4
3
|
import { withStyles } from '../styles';
|
@@ -6,17 +5,7 @@ import HiStepper from './HiStepper';
|
|
6
5
|
import HiStepLabel from './HiStepLabel';
|
7
6
|
import HiStep from './HiStep';
|
8
7
|
|
9
|
-
export const styles = theme => ({
|
10
|
-
label: _extends({
|
11
|
-
display: 'inline-block',
|
12
|
-
marginLeft: 12,
|
13
|
-
fontWeight: theme.typography.fontWeightRegular,
|
14
|
-
color: theme.palette.neutral.normal
|
15
|
-
}, theme.typography.body3),
|
16
|
-
active: {
|
17
|
-
fontWeight: theme.typography.fontWeightMedium
|
18
|
-
}
|
19
|
-
});
|
8
|
+
export const styles = theme => ({});
|
20
9
|
|
21
10
|
class HiBreadcrumb extends React.PureComponent {
|
22
11
|
constructor(...args) {
|
@@ -28,30 +17,35 @@ class HiBreadcrumb extends React.PureComponent {
|
|
28
17
|
}
|
29
18
|
|
30
19
|
render() {
|
31
|
-
const { activeStep, steps } = this.props;
|
20
|
+
const { activeStep, steps, type } = this.props;
|
32
21
|
|
33
22
|
return React.createElement(
|
34
23
|
HiStepper,
|
35
|
-
{ activeStep: activeStep },
|
24
|
+
{ activeStep: activeStep, type: type },
|
36
25
|
React.createElement(
|
37
26
|
'div',
|
38
27
|
null,
|
39
28
|
steps.map((step, index) => {
|
40
|
-
const validConnector = step.status === 'validated' && index < steps.length - 1 && steps[index + 1].status === 'validated';
|
29
|
+
const validConnector = step.status === 'validated' && index < steps.length - 1 && (steps[index + 1].status === 'validated' || steps[index + 1].status === 'active');
|
30
|
+
|
41
31
|
return React.createElement(
|
42
32
|
HiStep,
|
43
33
|
{
|
34
|
+
content: step.content,
|
44
35
|
key: step.id,
|
45
36
|
onClick: this.handleStep(index),
|
46
37
|
isLast: index === steps.length - 1,
|
47
|
-
validConnector: validConnector
|
38
|
+
validConnector: validConnector,
|
39
|
+
type: type,
|
40
|
+
steps: steps
|
48
41
|
},
|
49
42
|
React.createElement(
|
50
43
|
HiStepLabel,
|
51
44
|
{
|
52
45
|
active: activeStep === index,
|
53
46
|
status: step.status,
|
54
|
-
notificationNumber: step.notificationNumber
|
47
|
+
notificationNumber: step.notificationNumber,
|
48
|
+
type: type
|
55
49
|
},
|
56
50
|
step.label
|
57
51
|
)
|
@@ -63,11 +57,25 @@ class HiBreadcrumb extends React.PureComponent {
|
|
63
57
|
}
|
64
58
|
|
65
59
|
HiBreadcrumb.defaultProps = {
|
66
|
-
activeStep: 0
|
60
|
+
activeStep: 0,
|
61
|
+
type: 'back'
|
67
62
|
};
|
68
63
|
HiBreadcrumb.propTypes = process.env.NODE_ENV !== "production" ? {
|
64
|
+
/**
|
65
|
+
* Which step is the active one
|
66
|
+
*/
|
69
67
|
activeStep: PropTypes.number,
|
68
|
+
/**
|
69
|
+
* The collection of steps of the breadcrumb.
|
70
|
+
*/
|
70
71
|
steps: PropTypes.array.isRequired,
|
71
|
-
|
72
|
+
/**
|
73
|
+
* The callback function handling the flow from one step to another
|
74
|
+
*/
|
75
|
+
handleStep: PropTypes.func,
|
76
|
+
/**
|
77
|
+
* The Breadcrumb type
|
78
|
+
*/
|
79
|
+
type: PropTypes.oneOf(['back', 'front-dark', 'front-light'])
|
72
80
|
} : {};
|
73
81
|
export default withStyles(styles, { name: 'HmuiHiBreadcrumb' })(HiBreadcrumb);
|
@@ -1,53 +1,61 @@
|
|
1
1
|
import _extends from 'babel-runtime/helpers/extends';
|
2
|
-
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
3
2
|
import React from 'react';
|
4
3
|
import PropTypes from 'prop-types';
|
5
|
-
import classNames from 'classnames';
|
6
4
|
import { withStyles } from '../styles';
|
5
|
+
import classNames from 'classnames';
|
7
6
|
import HiStepConnector from './HiStepConnector';
|
7
|
+
import HiStepContent from './HiStepContent';
|
8
8
|
|
9
9
|
export const styles = theme => ({
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
paddingRight: theme.spacing.unit,
|
14
|
-
'&:first-child': {
|
15
|
-
paddingLeft: 0
|
16
|
-
},
|
17
|
-
'&:last-child': {
|
18
|
-
paddingRight: 0
|
19
|
-
}
|
20
|
-
},
|
21
|
-
vertical: {}
|
10
|
+
lastStep: {
|
11
|
+
marginBottom: 40
|
12
|
+
}
|
22
13
|
});
|
23
14
|
|
24
|
-
|
25
|
-
const {
|
26
|
-
active,
|
27
|
-
children,
|
28
|
-
classes,
|
29
|
-
className: classNameProp,
|
30
|
-
index,
|
31
|
-
isLast,
|
32
|
-
orientation,
|
33
|
-
validConnector
|
34
|
-
} = props,
|
35
|
-
other = _objectWithoutProperties(props, ['active', 'children', 'classes', 'className', 'index', 'isLast', 'orientation', 'validConnector']);
|
36
|
-
|
37
|
-
const className = classNames(classes.root, classes[orientation], classNameProp);
|
15
|
+
class HiStep extends React.PureComponent {
|
38
16
|
|
39
|
-
|
40
|
-
|
41
|
-
_extends({ className: className }, other),
|
42
|
-
React.Children.map(children, child => React.cloneElement(child, _extends({
|
17
|
+
render() {
|
18
|
+
const {
|
43
19
|
active,
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
20
|
+
children,
|
21
|
+
classes,
|
22
|
+
content,
|
23
|
+
isLast,
|
24
|
+
onClick,
|
25
|
+
steps,
|
26
|
+
type,
|
27
|
+
validConnector
|
28
|
+
} = this.props;
|
29
|
+
|
30
|
+
return React.createElement(
|
31
|
+
'div',
|
32
|
+
{
|
33
|
+
className: classNames({ [classes.lastStep]: isLast && type !== 'back' }),
|
34
|
+
onClick: onClick
|
35
|
+
},
|
36
|
+
React.Children.map(children, child => React.cloneElement(child, _extends({
|
37
|
+
active
|
38
|
+
}, child.props))),
|
39
|
+
!isLast && React.createElement(HiStepConnector, {
|
40
|
+
validConnector: validConnector,
|
41
|
+
type: type,
|
42
|
+
steps: steps,
|
43
|
+
active: active,
|
44
|
+
content: content
|
45
|
+
}),
|
46
|
+
content && active && isLast && type === 'front-light' && React.createElement(HiStepContent, { content: content, isLast: true })
|
47
|
+
);
|
48
|
+
}
|
49
49
|
}
|
50
50
|
|
51
|
+
HiStep.defaultProps = {
|
52
|
+
active: false,
|
53
|
+
content: React.createElement('span', null),
|
54
|
+
isLast: false,
|
55
|
+
steps: [],
|
56
|
+
type: 'back',
|
57
|
+
validConnector: false
|
58
|
+
};
|
51
59
|
HiStep.propTypes = process.env.NODE_ENV !== "production" ? {
|
52
60
|
/**
|
53
61
|
* Sets the step as active. Is passed to child components.
|
@@ -58,36 +66,29 @@ HiStep.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
58
66
|
*/
|
59
67
|
children: PropTypes.node,
|
60
68
|
/**
|
61
|
-
*
|
69
|
+
* The content to be displayed in the case of front-light breadcrumb
|
62
70
|
*/
|
63
|
-
|
71
|
+
content: PropTypes.node,
|
64
72
|
/**
|
65
73
|
* @ignore
|
74
|
+
* Used to know which step is the last, to not put a HiStepConnector
|
66
75
|
*/
|
67
|
-
|
76
|
+
isLast: PropTypes.bool,
|
68
77
|
/**
|
69
|
-
*
|
70
|
-
* Used internally for numbering.
|
78
|
+
* Callback on step container click
|
71
79
|
*/
|
72
|
-
|
80
|
+
onClick: PropTypes.func,
|
73
81
|
/**
|
74
|
-
*
|
75
|
-
* Used to know which step is the last, to not put a HiStepConnector
|
82
|
+
* The collection of steps of the breadcrumb.
|
76
83
|
*/
|
77
|
-
|
84
|
+
steps: PropTypes.array,
|
78
85
|
/**
|
79
86
|
* @ignore
|
80
87
|
*/
|
81
|
-
|
88
|
+
type: PropTypes.oneOf(['back', 'front-light', 'front-dark']),
|
82
89
|
/**
|
83
90
|
* @ignore
|
84
91
|
*/
|
85
92
|
validConnector: PropTypes.bool
|
86
93
|
} : {};
|
87
|
-
|
88
|
-
HiStep.defaultProps = {
|
89
|
-
active: false,
|
90
|
-
validConnector: false
|
91
|
-
};
|
92
|
-
|
93
|
-
export default withStyles(styles, { name: 'MuiStep' })(HiStep);
|
94
|
+
export default withStyles(styles, { name: 'MuiHiStep' })(HiStep);
|
@@ -4,31 +4,28 @@ import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import classNames from 'classnames';
|
6
6
|
import { withStyles } from '../styles';
|
7
|
+
import HiStepContent from './HiStepContent';
|
7
8
|
|
8
9
|
export const styles = theme => ({
|
9
10
|
root: {
|
10
|
-
|
11
|
-
|
12
|
-
vertical: {
|
11
|
+
display: 'flex',
|
12
|
+
flex: '1 1 auto',
|
13
13
|
marginLeft: 13, // half icon
|
14
14
|
padding: `0 0 ${theme.spacing.unit}px`
|
15
15
|
},
|
16
16
|
line: {
|
17
17
|
display: 'block',
|
18
|
-
borderColor: theme.palette.grey[600]
|
19
|
-
},
|
20
|
-
lineHorizontal: {
|
21
|
-
borderTopStyle: 'solid',
|
22
|
-
borderTopWidth: 1
|
23
|
-
},
|
24
|
-
lineVertical: {
|
18
|
+
borderColor: theme.palette.grey[600],
|
25
19
|
borderLeftStyle: 'solid',
|
26
20
|
borderLeftWidth: 2,
|
27
21
|
minHeight: theme.spacing.unit * 3,
|
28
|
-
height:
|
22
|
+
height: 40
|
29
23
|
},
|
30
|
-
|
24
|
+
greenLine: {
|
31
25
|
borderColor: theme.palette.status[116]
|
26
|
+
},
|
27
|
+
lightLine: {
|
28
|
+
borderColor: '#FFFFFF'
|
32
29
|
}
|
33
30
|
});
|
34
31
|
|
@@ -36,32 +33,88 @@ export const styles = theme => ({
|
|
36
33
|
* @ignore - internal component.
|
37
34
|
*/
|
38
35
|
class HiStepConnector extends React.PureComponent {
|
36
|
+
|
37
|
+
constructor(props) {
|
38
|
+
super(props);
|
39
|
+
|
40
|
+
this.state = {
|
41
|
+
width: 1280,
|
42
|
+
height: 800
|
43
|
+
};
|
44
|
+
|
45
|
+
this.updateWindowDimensions = this.updateWindowDimensions.bind(this);
|
46
|
+
}
|
47
|
+
|
48
|
+
componentDidMount() {
|
49
|
+
this.updateWindowDimensions();
|
50
|
+
window.addEventListener('resize', this.updateWindowDimensions);
|
51
|
+
}
|
52
|
+
|
53
|
+
componentWillUnmount() {
|
54
|
+
window.removeEventListener('resize', this.updateWindowDimensions);
|
55
|
+
}
|
56
|
+
|
57
|
+
updateWindowDimensions() {
|
58
|
+
this.setState({ width: window.innerWidth, height: window.innerHeight });
|
59
|
+
}
|
60
|
+
|
39
61
|
render() {
|
40
62
|
const _props = this.props,
|
41
63
|
{
|
64
|
+
active,
|
42
65
|
className: classNameProp,
|
43
66
|
classes,
|
44
|
-
|
67
|
+
content,
|
68
|
+
steps,
|
69
|
+
type,
|
45
70
|
validConnector
|
46
71
|
} = _props,
|
47
|
-
other = _objectWithoutProperties(_props, ['className', 'classes', '
|
72
|
+
other = _objectWithoutProperties(_props, ['active', 'className', 'classes', 'content', 'steps', 'type', 'validConnector']);
|
48
73
|
|
49
|
-
const
|
74
|
+
const { width, height } = this.state;
|
75
|
+
|
76
|
+
const className = classNames(classes.root, classNameProp);
|
50
77
|
const lineClassName = classNames(classes.line, {
|
51
|
-
[classes.
|
52
|
-
[classes.
|
53
|
-
[classes.lineVerticalGreen]: orientation === 'vertical' && validConnector
|
78
|
+
[classes.greenLine]: validConnector,
|
79
|
+
[classes.lightLine]: type === 'front-light'
|
54
80
|
});
|
55
81
|
|
82
|
+
let lineHeight = 40;
|
83
|
+
|
84
|
+
if (type !== 'back') {
|
85
|
+
// Pour un breadcrumb Front, la tige du connector de la step active doit s'allonger en fonction de la hauteur de la page et du nombre de steps
|
86
|
+
lineHeight = height - 226 - 58 * (steps.length - 1);
|
87
|
+
if (lineHeight < 202) {
|
88
|
+
lineHeight = 202;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
let heightStyle = {};
|
93
|
+
if (active) {
|
94
|
+
heightStyle = { height: lineHeight };
|
95
|
+
}
|
96
|
+
|
56
97
|
return React.createElement(
|
57
98
|
'div',
|
58
99
|
_extends({ className: className }, other),
|
59
|
-
React.createElement('span', { className: lineClassName })
|
100
|
+
React.createElement('span', { className: lineClassName, style: heightStyle }),
|
101
|
+
type === 'front-light' && active && content && React.createElement(HiStepContent, { content: content })
|
60
102
|
);
|
61
103
|
}
|
62
104
|
}
|
63
105
|
|
106
|
+
HiStepConnector.defaultProps = {
|
107
|
+
active: false,
|
108
|
+
content: React.createElement('span', null),
|
109
|
+
steps: [],
|
110
|
+
type: 'back',
|
111
|
+
validConnector: false
|
112
|
+
};
|
64
113
|
HiStepConnector.propTypes = process.env.NODE_ENV !== "production" ? {
|
114
|
+
/**
|
115
|
+
* Used to know if the step it is connected to is active, and if so possibly adapt its height
|
116
|
+
*/
|
117
|
+
active: PropTypes.bool,
|
65
118
|
/**
|
66
119
|
* Useful to extend the style applied to the component.
|
67
120
|
*/
|
@@ -71,13 +124,20 @@ HiStepConnector.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
71
124
|
*/
|
72
125
|
className: PropTypes.string,
|
73
126
|
/**
|
74
|
-
*
|
127
|
+
* The content to be displayed in the case of front-light breadcrumb
|
128
|
+
*/
|
129
|
+
content: PropTypes.node,
|
130
|
+
/**
|
131
|
+
* The collection of steps of the breadcrumb.
|
75
132
|
*/
|
76
|
-
|
133
|
+
steps: PropTypes.array,
|
134
|
+
/**
|
135
|
+
* specifies which type of breadcrumb is used
|
136
|
+
*/
|
137
|
+
type: PropTypes.oneOf(['back', 'front-dark', 'front-light']),
|
138
|
+
/**
|
139
|
+
* Specifies if the connector should be displayed in green or its default color
|
140
|
+
*/
|
141
|
+
validConnector: PropTypes.bool
|
77
142
|
} : {};
|
78
|
-
|
79
|
-
HiStepConnector.defaultProps = {
|
80
|
-
orientation: 'vertical'
|
81
|
-
};
|
82
|
-
|
83
143
|
export default withStyles(styles, { name: 'MuiHiStepConnector' })(HiStepConnector);
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import classNames from 'classnames';
|
4
|
+
import { withStyles } from '../styles';
|
5
|
+
import Paper from '../Paper';
|
6
|
+
|
7
|
+
export const styles = theme => ({
|
8
|
+
root: {
|
9
|
+
display: 'flex',
|
10
|
+
justifyContent: 'center',
|
11
|
+
alignItems: 'center'
|
12
|
+
},
|
13
|
+
contentContainer: {
|
14
|
+
height: 'fit-content',
|
15
|
+
maxHeight: 300,
|
16
|
+
maxWidth: 323,
|
17
|
+
marginTop: 35,
|
18
|
+
marginLeft: 24,
|
19
|
+
padding: 24,
|
20
|
+
textAlign: 'center',
|
21
|
+
fontFamily: 'Roboto, Regular, sans-serif',
|
22
|
+
color: '#737373',
|
23
|
+
fontSize: 14,
|
24
|
+
lineHeight: '20px',
|
25
|
+
borderRadius: 3
|
26
|
+
},
|
27
|
+
lastStep: {
|
28
|
+
marginLeft: 0,
|
29
|
+
marginTop: 20
|
30
|
+
}
|
31
|
+
});
|
32
|
+
|
33
|
+
class HiStepContent extends React.PureComponent {
|
34
|
+
|
35
|
+
render() {
|
36
|
+
const { content, classes, isLast } = this.props;
|
37
|
+
|
38
|
+
return React.createElement(
|
39
|
+
Paper,
|
40
|
+
{
|
41
|
+
square: true,
|
42
|
+
className: classNames(classes.contentContainer, {
|
43
|
+
[classes.lastStep]: isLast
|
44
|
+
})
|
45
|
+
},
|
46
|
+
React.createElement(
|
47
|
+
'div',
|
48
|
+
{ className: classes.root },
|
49
|
+
content
|
50
|
+
)
|
51
|
+
);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
HiStepContent.defaultProps = {
|
56
|
+
content: React.createElement('span', null),
|
57
|
+
isLast: false
|
58
|
+
};
|
59
|
+
HiStepContent.propTypes = process.env.NODE_ENV !== "production" ? {
|
60
|
+
content: PropTypes.node,
|
61
|
+
isLast: PropTypes.bool
|
62
|
+
} : {};
|
63
|
+
export default withStyles(styles, { name: 'MuiHiStepContent' })(HiStepContent);
|