@hipay/hipay-material-ui 2.3.5 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Guideline/index.js +2 -0
- package/HiChip/HiChip.js +1 -0
- package/HiDatePicker/HiDateRangeSelector.js +181 -46
- package/HiDatePicker/stylesheet.js +1 -2
- package/HiForm/HiFormControl.js +10 -9
- package/HiIcon/HiIcon.js +58 -54
- package/HiPaymentMeans/HiPaymentMeans.js +16 -4
- package/HiPin/HiPin.js +12 -20
- package/HiSelect/HiSelect.js +44 -10
- package/HiSelectableList/HiSelectableListItem.js +38 -24
- package/HiStepper/HiStep.js +194 -0
- package/HiStepper/HiStepper.js +59 -0
- package/HiStepper/index.js +23 -0
- package/HiSwitch/HiSwitch.js +4 -1
- package/es/Guideline/index.js +2 -0
- package/es/HiChip/HiChip.js +1 -0
- package/es/HiDatePicker/HiDateRangeSelector.js +181 -46
- package/es/HiDatePicker/stylesheet.js +1 -2
- package/es/HiForm/HiFormControl.js +10 -9
- package/es/HiIcon/HiIcon.js +58 -54
- package/es/HiPaymentMeans/HiPaymentMeans.js +16 -4
- package/es/HiPin/HiPin.js +12 -20
- package/es/HiSelect/HiSelect.js +44 -10
- package/es/HiSelectableList/HiSelectableListItem.js +38 -24
- package/es/HiStepper/HiStep.js +194 -0
- package/es/HiStepper/HiStepper.js +59 -0
- package/es/HiStepper/index.js +23 -0
- package/es/HiSwitch/HiSwitch.js +4 -1
- package/es/hi-svg-icons/HiAccount.js +5 -9
- package/es/hi-svg-icons/HiActivity.js +5 -9
- package/es/hi-svg-icons/HiAll.js +5 -9
- package/es/hi-svg-icons/HiBilling.js +5 -9
- package/es/hi-svg-icons/HiBriefcaseRescue.js +14 -12
- package/es/hi-svg-icons/HiCatalog.js +5 -9
- package/es/hi-svg-icons/HiCustomer.js +5 -9
- package/es/hi-svg-icons/HiDownload.js +8 -9
- package/es/hi-svg-icons/HiFinance.js +5 -9
- package/es/hi-svg-icons/HiIntelligence.js +5 -9
- package/es/hi-svg-icons/HiIntelligenceMenu.js +49 -0
- package/es/hi-svg-icons/HiLogoRounded.js +58 -0
- package/es/hi-svg-icons/HiOrder.js +5 -9
- package/es/hi-svg-icons/HiPaymentOrder.js +5 -9
- package/es/hi-svg-icons/HiPermission.js +5 -9
- package/es/hi-svg-icons/HiPriceGrid.js +5 -9
- package/es/hi-svg-icons/HiRoute.js +5 -9
- package/es/hi-svg-icons/HiSettlement.js +5 -9
- package/es/hi-svg-icons/HiSizeLarge.js +17 -8
- package/es/hi-svg-icons/HiSizeMedium.js +18 -7
- package/es/hi-svg-icons/HiSizeSmall.js +18 -7
- package/es/hi-svg-icons/HiStore.js +64 -0
- package/es/hi-svg-icons/HiStoreMenu.js +58 -0
- package/es/hi-svg-icons/HiTransaction.js +5 -9
- package/es/hi-svg-icons/HiTransactionMenu.js +46 -0
- package/es/hi-svg-icons/HiUser.js +5 -9
- package/es/hi-svg-icons/HiVendor.js +5 -9
- package/es/hi-svg-icons/HiWidget.js +5 -9
- package/es/hi-svg-icons/index.js +33 -1
- package/es/hi-svg-images/HiLogo.js +41 -0
- package/es/hi-svg-images/HiLogoWhite.js +41 -0
- package/es/hi-svg-images/index.js +23 -0
- package/es/setupTest.js +44 -0
- package/es/styleguide/Wrapper.js +9 -37
- package/es/styles/makeStyles.js +28 -0
- package/es/styles/withStyles.js +28 -0
- package/es/theme.js +7 -9
- package/es/utils/helpers.js +10 -0
- package/hi-svg-icons/HiAccount.js +5 -9
- package/hi-svg-icons/HiActivity.js +5 -9
- package/hi-svg-icons/HiAll.js +5 -9
- package/hi-svg-icons/HiBilling.js +5 -9
- package/hi-svg-icons/HiBriefcaseRescue.js +14 -12
- package/hi-svg-icons/HiCatalog.js +5 -9
- package/hi-svg-icons/HiCustomer.js +5 -9
- package/hi-svg-icons/HiDownload.js +8 -9
- package/hi-svg-icons/HiFinance.js +5 -9
- package/hi-svg-icons/HiIntelligence.js +5 -9
- package/hi-svg-icons/HiIntelligenceMenu.js +49 -0
- package/hi-svg-icons/HiLogoRounded.js +58 -0
- package/hi-svg-icons/HiOrder.js +5 -9
- package/hi-svg-icons/HiPaymentOrder.js +5 -9
- package/hi-svg-icons/HiPermission.js +5 -9
- package/hi-svg-icons/HiPriceGrid.js +5 -9
- package/hi-svg-icons/HiRoute.js +5 -9
- package/hi-svg-icons/HiSettlement.js +5 -9
- package/hi-svg-icons/HiSizeLarge.js +17 -8
- package/hi-svg-icons/HiSizeMedium.js +18 -7
- package/hi-svg-icons/HiSizeSmall.js +18 -7
- package/hi-svg-icons/HiStore.js +64 -0
- package/hi-svg-icons/HiStoreMenu.js +58 -0
- package/hi-svg-icons/HiTransaction.js +5 -9
- package/hi-svg-icons/HiTransactionMenu.js +46 -0
- package/hi-svg-icons/HiUser.js +5 -9
- package/hi-svg-icons/HiVendor.js +5 -9
- package/hi-svg-icons/HiWidget.js +5 -9
- package/hi-svg-icons/index.js +33 -1
- package/hi-svg-images/HiLogo.js +41 -0
- package/hi-svg-images/HiLogoWhite.js +41 -0
- package/hi-svg-images/index.js +23 -0
- package/package.json +2 -2
- package/setupTest.js +44 -0
- package/styleguide/Wrapper.js +9 -37
- package/styles/makeStyles.js +28 -0
- package/styles/withStyles.js +28 -0
- package/theme.js +7 -9
- package/utils/helpers.js +10 -0
package/HiPin/HiPin.js
CHANGED
|
@@ -5,9 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
8
|
+
exports.default = exports.useStyles = void 0;
|
|
11
9
|
|
|
12
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
13
11
|
|
|
@@ -17,7 +15,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
17
15
|
|
|
18
16
|
var _styles = require("@material-ui/core/styles");
|
|
19
17
|
|
|
20
|
-
var
|
|
18
|
+
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
21
19
|
return {
|
|
22
20
|
root: {
|
|
23
21
|
display: 'inline-block',
|
|
@@ -62,7 +60,7 @@ var styles = function styles(theme) {
|
|
|
62
60
|
color: theme.palette.neutral.contrastText
|
|
63
61
|
}
|
|
64
62
|
};
|
|
65
|
-
};
|
|
63
|
+
});
|
|
66
64
|
/**
|
|
67
65
|
* HiPins
|
|
68
66
|
*
|
|
@@ -72,33 +70,27 @@ var styles = function styles(theme) {
|
|
|
72
70
|
*
|
|
73
71
|
*/
|
|
74
72
|
|
|
75
|
-
|
|
76
|
-
exports.styles = styles;
|
|
73
|
+
exports.useStyles = useStyles;
|
|
77
74
|
|
|
78
75
|
function HiPin(props) {
|
|
79
76
|
var _classNames;
|
|
80
77
|
|
|
81
|
-
var
|
|
82
|
-
children = props.children,
|
|
78
|
+
var children = props.children,
|
|
83
79
|
color = props.color,
|
|
84
80
|
onClick = props.onClick,
|
|
85
81
|
className = props.className;
|
|
82
|
+
var classes = useStyles(props);
|
|
86
83
|
var pinClass = (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.clickable, onClick), (0, _defineProperty2.default)(_classNames, classes.primary, color === 'primary'), (0, _defineProperty2.default)(_classNames, classes.secondary, color === 'secondary'), (0, _defineProperty2.default)(_classNames, classes.positive, color === 'positive'), (0, _defineProperty2.default)(_classNames, classes.negative, color === 'negative'), (0, _defineProperty2.default)(_classNames, classes.middle, color === 'middle'), (0, _defineProperty2.default)(_classNames, classes.neutral, color === 'neutral'), _classNames), className);
|
|
87
|
-
return _react.default.createElement("div",
|
|
88
|
-
className: pinClass
|
|
89
|
-
}, onClick && {
|
|
84
|
+
return _react.default.createElement("div", {
|
|
85
|
+
className: pinClass,
|
|
90
86
|
onClick: onClick,
|
|
91
|
-
role: 'button'
|
|
92
|
-
}
|
|
87
|
+
role: onClick ? 'button' : undefined
|
|
88
|
+
}, children);
|
|
93
89
|
}
|
|
94
90
|
|
|
95
91
|
HiPin.defaultProps = {
|
|
96
92
|
color: 'default'
|
|
97
93
|
};
|
|
98
|
-
|
|
99
|
-
var _default =
|
|
100
|
-
hiComponent: true,
|
|
101
|
-
name: 'HmuiHiPin'
|
|
102
|
-
})(HiPin);
|
|
103
|
-
|
|
94
|
+
HiPin.useStyles = useStyles;
|
|
95
|
+
var _default = HiPin;
|
|
104
96
|
exports.default = _default;
|
package/HiSelect/HiSelect.js
CHANGED
|
@@ -7,9 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.styles = void 0;
|
|
9
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
11
|
+
|
|
10
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
11
13
|
|
|
12
|
-
var
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
13
15
|
|
|
14
16
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
15
17
|
|
|
@@ -145,11 +147,11 @@ var HiSelect =
|
|
|
145
147
|
function (_React$PureComponent) {
|
|
146
148
|
(0, _inherits2.default)(HiSelect, _React$PureComponent);
|
|
147
149
|
|
|
148
|
-
function HiSelect(
|
|
150
|
+
function HiSelect(_props) {
|
|
149
151
|
var _this;
|
|
150
152
|
|
|
151
153
|
(0, _classCallCheck2.default)(this, HiSelect);
|
|
152
|
-
_this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(HiSelect).call(this,
|
|
154
|
+
_this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(HiSelect).call(this, _props));
|
|
153
155
|
|
|
154
156
|
_this.buildSelectProps = function (options) {
|
|
155
157
|
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -235,9 +237,9 @@ function (_React$PureComponent) {
|
|
|
235
237
|
};
|
|
236
238
|
|
|
237
239
|
_this.focusOnFirstItem = function () {
|
|
238
|
-
if (_this.overlay && _this.overlay.
|
|
240
|
+
if (_this.overlay && _this.overlay.querySelector('li:not([tabindex^="-"])')) {
|
|
239
241
|
setTimeout(function () {
|
|
240
|
-
var item = _this.overlay.
|
|
242
|
+
var item = _this.overlay.querySelector('li:not([tabindex^="-"])');
|
|
241
243
|
|
|
242
244
|
item.focus();
|
|
243
245
|
}, 1);
|
|
@@ -310,16 +312,16 @@ function (_React$PureComponent) {
|
|
|
310
312
|
};
|
|
311
313
|
|
|
312
314
|
_this.focusOnSelectedItem = function (selectedValue) {
|
|
313
|
-
if (_this.overlay && _this.overlay.
|
|
315
|
+
if (_this.overlay && _this.overlay.querySelector('li:not([tabindex^="-"])')) {
|
|
314
316
|
setTimeout(function () {
|
|
315
317
|
if (_this.overlay) {
|
|
316
318
|
// On initialise au premier élément pour être sûr de ne pas se retrouver avec un focus of undefined
|
|
317
|
-
var item = _this.overlay.
|
|
319
|
+
var item = _this.overlay.querySelector('li:not([tabindex^="-"])');
|
|
318
320
|
|
|
319
321
|
if (selectedValue && typeof selectedValue === 'string') {
|
|
320
322
|
item = _this.overlay.getElementsByTagName('li')[selectedValue];
|
|
321
323
|
} else if (selectedValue && typeof selectedValue === 'number') {
|
|
322
|
-
item = _this.overlay.
|
|
324
|
+
item = _this.overlay.querySelector('li:not([tabindex^="-"])')[selectedValue - 1];
|
|
323
325
|
}
|
|
324
326
|
|
|
325
327
|
if (item) {
|
|
@@ -525,12 +527,42 @@ function (_React$PureComponent) {
|
|
|
525
527
|
return itemListLength;
|
|
526
528
|
};
|
|
527
529
|
|
|
530
|
+
_this.renderScrollbarTrackHorizontal = function (props) {
|
|
531
|
+
var style = props.style,
|
|
532
|
+
otherProps = (0, _objectWithoutProperties2.default)(props, ["style"]);
|
|
533
|
+
var inlineStyle = (0, _objectSpread2.default)({}, style, {
|
|
534
|
+
zIndex: 10,
|
|
535
|
+
right: 2,
|
|
536
|
+
bottom: 2,
|
|
537
|
+
left: 2,
|
|
538
|
+
borderRadius: 3
|
|
539
|
+
});
|
|
540
|
+
return _react.default.createElement("div", (0, _extends2.default)({}, props, {
|
|
541
|
+
style: inlineStyle
|
|
542
|
+
}));
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
_this.renderScrollbarTrackVertical = function (props) {
|
|
546
|
+
var style = props.style,
|
|
547
|
+
otherProps = (0, _objectWithoutProperties2.default)(props, ["style"]);
|
|
548
|
+
var inlineStyle = (0, _objectSpread2.default)({}, style, {
|
|
549
|
+
zIndex: 10,
|
|
550
|
+
right: 2,
|
|
551
|
+
bottom: 2,
|
|
552
|
+
top: 2,
|
|
553
|
+
borderRadius: 3
|
|
554
|
+
});
|
|
555
|
+
return _react.default.createElement("div", (0, _extends2.default)({}, props, {
|
|
556
|
+
style: inlineStyle
|
|
557
|
+
}));
|
|
558
|
+
};
|
|
559
|
+
|
|
528
560
|
_this.state = {
|
|
529
561
|
alertOpen: false,
|
|
530
562
|
open: false,
|
|
531
563
|
focused: false,
|
|
532
|
-
searchValue:
|
|
533
|
-
suggestions:
|
|
564
|
+
searchValue: _props.searchValue ? undefined : '',
|
|
565
|
+
suggestions: _props.options,
|
|
534
566
|
openDown: true,
|
|
535
567
|
overlayWidth: 0
|
|
536
568
|
};
|
|
@@ -672,6 +704,8 @@ function (_React$PureComponent) {
|
|
|
672
704
|
} : {},
|
|
673
705
|
className: classes.paper
|
|
674
706
|
}, (_this2.placement && _this2.placement.indexOf('bottom') >= 0 || staticPosition) && searchInput('bottom'), startAdornment, _react.default.createElement(_reactCustomScrollbars.default, (0, _extends2.default)({
|
|
707
|
+
renderTrackHorizontal: _this2.renderScrollbarTrackHorizontal,
|
|
708
|
+
renderTrackVertical: _this2.renderScrollbarTrackVertical,
|
|
675
709
|
ref: function ref(contentEl) {
|
|
676
710
|
_this2.optionsContent = contentEl;
|
|
677
711
|
},
|
|
@@ -55,7 +55,7 @@ var PureListItem = (0, _pure.default)(_ListItem.default);
|
|
|
55
55
|
var styles = function styles(theme) {
|
|
56
56
|
return {
|
|
57
57
|
root: {
|
|
58
|
-
paddingLeft:
|
|
58
|
+
paddingLeft: theme.spacing(1)
|
|
59
59
|
},
|
|
60
60
|
listItem: {
|
|
61
61
|
backgroundColor: theme.palette.background3,
|
|
@@ -64,8 +64,10 @@ var styles = function styles(theme) {
|
|
|
64
64
|
fontWeight: theme.typography.fontWeightRegular,
|
|
65
65
|
maxHeight: 56,
|
|
66
66
|
display: 'inline-flex',
|
|
67
|
-
alignItems:
|
|
68
|
-
|
|
67
|
+
alignItems: "center",
|
|
68
|
+
"&:not($disabled):not($pinned)": {
|
|
69
|
+
cursor: 'pointer'
|
|
70
|
+
},
|
|
69
71
|
'&$listItemInlineWithInfoWithoutSecondary': {
|
|
70
72
|
justifyContent: 'space-between'
|
|
71
73
|
},
|
|
@@ -79,7 +81,9 @@ var styles = function styles(theme) {
|
|
|
79
81
|
}
|
|
80
82
|
},
|
|
81
83
|
'&:focus': {
|
|
82
|
-
|
|
84
|
+
'&:not($disabled):not($pinned)': {
|
|
85
|
+
backgroundColor: theme.palette.action.hover
|
|
86
|
+
},
|
|
83
87
|
outline: 'none'
|
|
84
88
|
}
|
|
85
89
|
},
|
|
@@ -104,8 +108,8 @@ var styles = function styles(theme) {
|
|
|
104
108
|
backgroundColor: theme.palette.action.selected
|
|
105
109
|
},
|
|
106
110
|
pinned: {
|
|
111
|
+
zIndex: 1,
|
|
107
112
|
display: 'inherit',
|
|
108
|
-
marginRight: 8,
|
|
109
113
|
backgroundColor: theme.palette.background3
|
|
110
114
|
},
|
|
111
115
|
thin: {
|
|
@@ -115,7 +119,7 @@ var styles = function styles(theme) {
|
|
|
115
119
|
textAlign: 'center',
|
|
116
120
|
width: 1,
|
|
117
121
|
height: 22,
|
|
118
|
-
padding:
|
|
122
|
+
padding: theme.spacing(2, 0),
|
|
119
123
|
margin: 'auto'
|
|
120
124
|
},
|
|
121
125
|
listItemContent: (0, _objectSpread2.default)({}, theme.typography.b1, {
|
|
@@ -125,7 +129,7 @@ var styles = function styles(theme) {
|
|
|
125
129
|
padding: '5px 0',
|
|
126
130
|
'&$listItemContentSelected': {
|
|
127
131
|
marginBottom: 1,
|
|
128
|
-
marginLeft: -
|
|
132
|
+
marginLeft: theme.spacing(-1)
|
|
129
133
|
},
|
|
130
134
|
'& strong': {
|
|
131
135
|
fontWeight: theme.typography.fontWeightMedium
|
|
@@ -139,8 +143,12 @@ var styles = function styles(theme) {
|
|
|
139
143
|
overflow: 'hidden',
|
|
140
144
|
textOverflow: 'ellipsis',
|
|
141
145
|
display: 'inline-block',
|
|
142
|
-
margin: '1px 0'
|
|
143
|
-
|
|
146
|
+
margin: '1px 0'
|
|
147
|
+
},
|
|
148
|
+
highlight: {
|
|
149
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
150
|
+
color: theme.palette.neutral.main,
|
|
151
|
+
textTransform: 'uppercase'
|
|
144
152
|
},
|
|
145
153
|
primaryHighlight: {
|
|
146
154
|
fontWeight: theme.typography.fontWeightMedium,
|
|
@@ -151,7 +159,7 @@ var styles = function styles(theme) {
|
|
|
151
159
|
color: theme.palette.neutral.main,
|
|
152
160
|
fontWeight: theme.typography.fontWeightLight,
|
|
153
161
|
fontSize: 11,
|
|
154
|
-
marginLeft:
|
|
162
|
+
marginLeft: theme.spacing(1)
|
|
155
163
|
}),
|
|
156
164
|
inline: {},
|
|
157
165
|
info: (0, _objectSpread2.default)({}, theme.typography.b3, {
|
|
@@ -169,11 +177,12 @@ var styles = function styles(theme) {
|
|
|
169
177
|
verticalAlign: 'middle'
|
|
170
178
|
},
|
|
171
179
|
icon: {
|
|
172
|
-
|
|
180
|
+
marginRight: theme.spacing(1),
|
|
173
181
|
verticalAlign: 'middle'
|
|
174
182
|
},
|
|
175
183
|
labelContent: {
|
|
176
184
|
display: '-webkit-flex',
|
|
185
|
+
paddingLeft: theme.spacing(1),
|
|
177
186
|
alignItems: 'center',
|
|
178
187
|
maxWidth: '85%',
|
|
179
188
|
'&$labelWithoutSecondaryInline': {
|
|
@@ -184,13 +193,11 @@ var styles = function styles(theme) {
|
|
|
184
193
|
infosContent: {
|
|
185
194
|
display: 'flex',
|
|
186
195
|
alignItems: 'center',
|
|
196
|
+
paddingLeft: theme.spacing(1),
|
|
187
197
|
width: '100%',
|
|
188
198
|
justifyContent: 'space-between',
|
|
189
199
|
'&$infosInlineWithoutSecondary': {
|
|
190
200
|
width: 'auto'
|
|
191
|
-
},
|
|
192
|
-
'&$infosWithoutSecondaryInline': {
|
|
193
|
-
paddingLeft: 28
|
|
194
201
|
}
|
|
195
202
|
},
|
|
196
203
|
infosInlineWithoutSecondary: {},
|
|
@@ -345,21 +352,27 @@ function (_React$PureComponent) {
|
|
|
345
352
|
}
|
|
346
353
|
|
|
347
354
|
var ListItemComponentName = pinned ? PureListSubheader : PureListItem;
|
|
355
|
+
var listItemListenerProps = {};
|
|
356
|
+
|
|
357
|
+
if (!disabled && !pinned) {
|
|
358
|
+
listItemListenerProps = {
|
|
359
|
+
onClick: onSelect,
|
|
360
|
+
onMouseEnter: this.setHover(true),
|
|
361
|
+
onMouseLeave: this.setHover(false),
|
|
362
|
+
onKeyDown: this.handleKeyDown(item)
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
|
|
348
366
|
return _react.default.createElement(ListItemComponentName, (0, _extends2.default)({
|
|
349
367
|
id: id,
|
|
350
|
-
tabIndex: disabled ? '-1' : 0,
|
|
368
|
+
tabIndex: disabled || pinned ? '-1' : 0,
|
|
351
369
|
key: "li-".concat(id),
|
|
352
370
|
classes: {
|
|
353
371
|
root: classes.root
|
|
354
372
|
},
|
|
355
373
|
className: (0, _classnames.default)(classes.listItem, classes.listItemHover, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.disabled, disabled), (0, _defineProperty2.default)(_classNames, classes.selected, selected), (0, _defineProperty2.default)(_classNames, classes.thin, thin), (0, _defineProperty2.default)(_classNames, classes.pinned, pinned), (0, _defineProperty2.default)(_classNames, classes.inline, secondaryInline), (0, _defineProperty2.default)(_classNames, classes.listItemWithoutSecondaryInline, !secondaryInline), (0, _defineProperty2.default)(_classNames, classes.listItemInlineWithInfoWithoutSecondary, secondaryInline && info && !secondaryLabel), _classNames)),
|
|
356
374
|
disabled: disabled
|
|
357
|
-
},
|
|
358
|
-
onClick: onSelect,
|
|
359
|
-
onMouseEnter: this.setHover(true),
|
|
360
|
-
onMouseLeave: this.setHover(false),
|
|
361
|
-
onKeyDown: this.handleKeyDown(item)
|
|
362
|
-
}, {
|
|
375
|
+
}, listItemListenerProps, {
|
|
363
376
|
style: {
|
|
364
377
|
paddingLeft: "".concat(paddingLeft + level * 32, "px")
|
|
365
378
|
}
|
|
@@ -389,11 +402,12 @@ function (_React$PureComponent) {
|
|
|
389
402
|
},
|
|
390
403
|
className: classes.img
|
|
391
404
|
}), _react.default.createElement("div", {
|
|
392
|
-
className: (0, _classnames.default)(classes.listItemContent, (_classNames3 = {}, (0, _defineProperty2.default)(_classNames3, classes.centered, centered), (0, _defineProperty2.default)(_classNames3, classes.primaryHighlight, type === 'primary-highlight'), (0, _defineProperty2.default)(_classNames3, classes.listItemContentSelected, selected && color), _classNames3)),
|
|
405
|
+
className: (0, _classnames.default)(classes.listItemContent, (_classNames3 = {}, (0, _defineProperty2.default)(_classNames3, classes.centered, centered), (0, _defineProperty2.default)(_classNames3, classes.highlight, type === 'highlight'), (0, _defineProperty2.default)(_classNames3, classes.primaryHighlight, type === 'primary-highlight'), (0, _defineProperty2.default)(_classNames3, classes.listItemContentSelected, selected && color), _classNames3)),
|
|
393
406
|
"data-id": id
|
|
394
|
-
},
|
|
407
|
+
}, icon && hideCheckbox && _react.default.createElement(_HiIcon.default, {
|
|
395
408
|
icon: icon,
|
|
396
|
-
className: classes.icon
|
|
409
|
+
className: classes.icon,
|
|
410
|
+
color: "inherit"
|
|
397
411
|
}), this.buildItemLabel())), _react.default.createElement("div", {
|
|
398
412
|
className: (0, _classnames.default)(classes.infosContent, (_classNames4 = {}, (0, _defineProperty2.default)(_classNames4, classes.infosWithoutSecondaryInline, !secondaryInline), (0, _defineProperty2.default)(_classNames4, classes.infosWithSecondaryInline, !secondaryInline), (0, _defineProperty2.default)(_classNames4, classes.infosInlineWithoutSecondary, secondaryInline && !secondaryLabel), _classNames4))
|
|
399
413
|
}, !!secondaryLabel && _react.default.createElement("div", {
|
|
@@ -0,0 +1,194 @@
|
|
|
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 = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _styles = require("@material-ui/core/styles");
|
|
21
|
+
|
|
22
|
+
var _Step = _interopRequireDefault(require("@material-ui/core/Step"));
|
|
23
|
+
|
|
24
|
+
var _StepButton = _interopRequireDefault(require("@material-ui/core/StepButton"));
|
|
25
|
+
|
|
26
|
+
var _StepContent = _interopRequireDefault(require("@material-ui/core/StepContent"));
|
|
27
|
+
|
|
28
|
+
var _StepLabel = _interopRequireDefault(require("@material-ui/core/StepLabel"));
|
|
29
|
+
|
|
30
|
+
var _Check = _interopRequireDefault(require("@material-ui/icons/Check"));
|
|
31
|
+
|
|
32
|
+
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
33
|
+
|
|
34
|
+
var _Remove = _interopRequireDefault(require("@material-ui/icons/Remove"));
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* HiStepIcon used internally by HiStep
|
|
38
|
+
*/
|
|
39
|
+
var HiStepIcon = function HiStepIcon(_ref) {
|
|
40
|
+
var color = _ref.color,
|
|
41
|
+
indicator = _ref.indicator,
|
|
42
|
+
status = _ref.status;
|
|
43
|
+
// get icon style from color
|
|
44
|
+
var style = (0, _react.useMemo)(function () {
|
|
45
|
+
return {
|
|
46
|
+
backgroundColor: color,
|
|
47
|
+
color: "#fff",
|
|
48
|
+
borderRadius: "50%",
|
|
49
|
+
width: 20,
|
|
50
|
+
height: 20,
|
|
51
|
+
padding: 2,
|
|
52
|
+
lineHeight: "20px",
|
|
53
|
+
fontWeight: 600,
|
|
54
|
+
fontSize: 14
|
|
55
|
+
};
|
|
56
|
+
}, [color]); // get component from status
|
|
57
|
+
|
|
58
|
+
var StepIconComponent = (0, _react.useMemo)(function () {
|
|
59
|
+
switch (status) {
|
|
60
|
+
case "done":
|
|
61
|
+
return _Check.default;
|
|
62
|
+
|
|
63
|
+
case "error":
|
|
64
|
+
return _Close.default;
|
|
65
|
+
|
|
66
|
+
case "warning":
|
|
67
|
+
return _Remove.default;
|
|
68
|
+
|
|
69
|
+
case "in_progress":
|
|
70
|
+
default:
|
|
71
|
+
return function (props) {
|
|
72
|
+
return _react.default.createElement("div", props, indicator);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}, [status, indicator]);
|
|
76
|
+
return _react.default.createElement(StepIconComponent, {
|
|
77
|
+
style: style
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Custom style for StepButton
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
var useStepButtonStyle = (0, _styles.makeStyles)(function (theme) {
|
|
86
|
+
return {
|
|
87
|
+
root: {
|
|
88
|
+
fontFamily: theme.typography.fontFamily
|
|
89
|
+
},
|
|
90
|
+
vertical: {
|
|
91
|
+
marginBottom: 'auto'
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Custom style for StepContent
|
|
97
|
+
*/
|
|
98
|
+
|
|
99
|
+
var useStepContentStyle = (0, _styles.makeStyles)(function (theme) {
|
|
100
|
+
return {
|
|
101
|
+
root: {
|
|
102
|
+
marginLeft: 11,
|
|
103
|
+
marginTop: 0,
|
|
104
|
+
textAlign: "left",
|
|
105
|
+
borderLeft: "2px solid ".concat(theme.palette.neutral.light)
|
|
106
|
+
},
|
|
107
|
+
last: {
|
|
108
|
+
borderLeft: "none"
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
/**
|
|
113
|
+
* Custom style for StepLabel
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
var useStepLabelStyle = (0, _styles.makeStyles)(function (theme) {
|
|
117
|
+
return {
|
|
118
|
+
label: (0, _objectSpread2.default)({}, theme.typography.button, {
|
|
119
|
+
fontWeight: '600 !important',
|
|
120
|
+
color: "inherit !important"
|
|
121
|
+
}),
|
|
122
|
+
active: {},
|
|
123
|
+
completed: {}
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
var HiStep = _react.default.forwardRef(function (props, ref) {
|
|
128
|
+
var content = props.content,
|
|
129
|
+
disabled = props.disabled,
|
|
130
|
+
_props$indicator = props.indicator,
|
|
131
|
+
indicator = _props$indicator === void 0 ? props.index + 1 : _props$indicator,
|
|
132
|
+
label = props.label,
|
|
133
|
+
onClick = props.onClick,
|
|
134
|
+
status = props.status,
|
|
135
|
+
others = (0, _objectWithoutProperties2.default)(props, ["content", "disabled", "indicator", "label", "onClick", "status"]);
|
|
136
|
+
var theme = (0, _styles.useTheme)();
|
|
137
|
+
var stepButtonClasses = useStepButtonStyle(props);
|
|
138
|
+
var stepContentClasses = useStepContentStyle(props);
|
|
139
|
+
var stepLabelClasses = useStepLabelStyle(props);
|
|
140
|
+
var color = (0, _react.useMemo)(function () {
|
|
141
|
+
switch (status) {
|
|
142
|
+
case "done":
|
|
143
|
+
return theme.palette.positive.main;
|
|
144
|
+
|
|
145
|
+
case "error":
|
|
146
|
+
return theme.palette.negative.main;
|
|
147
|
+
|
|
148
|
+
case "in_progress":
|
|
149
|
+
return theme.palette.primary.main;
|
|
150
|
+
|
|
151
|
+
case "warning":
|
|
152
|
+
return theme.palette.middle.main;
|
|
153
|
+
|
|
154
|
+
default:
|
|
155
|
+
return disabled ? theme.palette.text.disabled : theme.palette.neutral.light;
|
|
156
|
+
}
|
|
157
|
+
}, [status, disabled]); // set label color
|
|
158
|
+
|
|
159
|
+
var stepLabelStyle = (0, _react.useMemo)(function () {
|
|
160
|
+
return {
|
|
161
|
+
color: color
|
|
162
|
+
};
|
|
163
|
+
}, [color]);
|
|
164
|
+
|
|
165
|
+
var _ref2 = _react.default.createElement(HiStepIcon, {
|
|
166
|
+
color: color,
|
|
167
|
+
indicator: indicator,
|
|
168
|
+
status: status
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
var StepIconProps = (0, _react.useMemo)(function () {
|
|
172
|
+
return {
|
|
173
|
+
icon: _ref2
|
|
174
|
+
};
|
|
175
|
+
}, [color, indicator, status]);
|
|
176
|
+
return _react.default.createElement(_Step.default, (0, _extends2.default)({
|
|
177
|
+
ref: ref,
|
|
178
|
+
completed: status === "done",
|
|
179
|
+
disabled: disabled
|
|
180
|
+
}, others), _react.default.createElement(_StepButton.default, {
|
|
181
|
+
classes: stepButtonClasses,
|
|
182
|
+
onClick: onClick
|
|
183
|
+
}, _react.default.createElement(_StepLabel.default, {
|
|
184
|
+
classes: stepLabelClasses,
|
|
185
|
+
StepIconProps: StepIconProps,
|
|
186
|
+
style: stepLabelStyle
|
|
187
|
+
}, label)), content && _react.default.createElement(_StepContent.default, {
|
|
188
|
+
classes: stepContentClasses
|
|
189
|
+
}, content));
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
HiStep.defaultProps = {};
|
|
193
|
+
var _default = HiStep;
|
|
194
|
+
exports.default = _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _styles = require("@material-ui/core/styles");
|
|
17
|
+
|
|
18
|
+
var _Stepper = _interopRequireDefault(require("@material-ui/core/Stepper"));
|
|
19
|
+
|
|
20
|
+
var _StepConnector = _interopRequireDefault(require("@material-ui/core/StepConnector"));
|
|
21
|
+
|
|
22
|
+
var HiStepConnector = (0, _styles.withStyles)(function (theme) {
|
|
23
|
+
return {
|
|
24
|
+
line: {
|
|
25
|
+
border: 0,
|
|
26
|
+
backgroundColor: theme.palette.neutral.light,
|
|
27
|
+
borderRadius: 2,
|
|
28
|
+
width: 2,
|
|
29
|
+
marginLeft: -1,
|
|
30
|
+
marginTop: -1
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
})(_StepConnector.default);
|
|
34
|
+
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
35
|
+
return {
|
|
36
|
+
root: {
|
|
37
|
+
padding: 0
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
var _ref2 = _react.default.createElement(HiStepConnector, null);
|
|
43
|
+
|
|
44
|
+
var HiStepper = _react.default.forwardRef(function (_ref, ref) {
|
|
45
|
+
var children = _ref.children,
|
|
46
|
+
props = (0, _objectWithoutProperties2.default)(_ref, ["children"]);
|
|
47
|
+
var classes = useStyles(props);
|
|
48
|
+
return _react.default.createElement(_Stepper.default, (0, _extends2.default)({
|
|
49
|
+
ref: ref,
|
|
50
|
+
classes: classes,
|
|
51
|
+
connector: _ref2,
|
|
52
|
+
nonLinear: true,
|
|
53
|
+
orientation: "vertical"
|
|
54
|
+
}, props), children);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
HiStepper.defaultProps = {};
|
|
58
|
+
var _default = HiStepper;
|
|
59
|
+
exports.default = _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "default", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _HiStepper.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "HiStep", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _HiStep.default;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
var _HiStepper = _interopRequireDefault(require("./HiStepper"));
|
|
22
|
+
|
|
23
|
+
var _HiStep = _interopRequireDefault(require("./HiStep"));
|
package/HiSwitch/HiSwitch.js
CHANGED
|
@@ -183,7 +183,10 @@ function HiSwitch(props) {
|
|
|
183
183
|
},
|
|
184
184
|
checkedIcon: icon,
|
|
185
185
|
checked: checked,
|
|
186
|
-
disabled: disabled
|
|
186
|
+
disabled: disabled,
|
|
187
|
+
inputProps: {
|
|
188
|
+
value: checked ? "on" : "off"
|
|
189
|
+
}
|
|
187
190
|
}, other)), _react.default.createElement("div", {
|
|
188
191
|
className: classes.bar
|
|
189
192
|
}));
|