@hipay/hipay-material-ui 2.0.0-beta.42 → 2.0.0-beta.43
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/HiAppBar/HiAppBar.js +3 -20
- package/HiButton/HiButton.js +29 -6
- package/HiColoredLabel/HiColoredLabel.js +7 -2
- package/HiDatePicker/HiDatePicker.js +0 -2
- package/HiForm/HiInput.js +4 -0
- package/HiIcon/HiIcon.js +37 -31
- package/HiSelectNew/HiNestedSelect.js +44 -4
- package/HiSelectNew/HiSelect.js +14 -6
- package/HiSelectableList/HiSelectableListItem.js +8 -2
- package/es/HiAppBar/HiAppBar.js +3 -18
- package/es/HiButton/HiButton.js +29 -6
- package/es/HiColoredLabel/HiColoredLabel.js +8 -3
- package/es/HiDatePicker/HiDatePicker.js +0 -2
- package/es/HiForm/HiInput.js +4 -0
- package/es/HiIcon/HiIcon.js +37 -31
- package/es/HiSelectNew/HiNestedSelect.js +44 -6
- package/es/HiSelectNew/HiSelect.js +13 -6
- package/es/HiSelectableList/HiSelectableListItem.js +8 -2
- package/es/utils/helpers.js +22 -0
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/umd/hipay-material-ui.development.js +83 -41
- package/umd/hipay-material-ui.production.min.js +2 -2
- package/utils/helpers.js +24 -0
package/HiAppBar/HiAppBar.js
CHANGED
@@ -75,10 +75,6 @@ var _ref = _react.default.createElement(_HiIcon.default, {
|
|
75
75
|
icon: "keyboard_arrow_up"
|
76
76
|
});
|
77
77
|
|
78
|
-
var _ref2 = _react.default.createElement(_HiIcon.default, {
|
79
|
-
icon: "keyboard_arrow_down"
|
80
|
-
});
|
81
|
-
|
82
78
|
var HiAppBar =
|
83
79
|
/*#__PURE__*/
|
84
80
|
function (_React$Component) {
|
@@ -99,15 +95,7 @@ function (_React$Component) {
|
|
99
95
|
(0, _createClass2.default)(HiAppBar, [{
|
100
96
|
key: "handleCollapse",
|
101
97
|
value: function handleCollapse() {
|
102
|
-
|
103
|
-
this.props.onCollapse();
|
104
|
-
} else {
|
105
|
-
this.setState(function (prevState) {
|
106
|
-
return {
|
107
|
-
collapsed: !prevState.collapsed
|
108
|
-
};
|
109
|
-
});
|
110
|
-
}
|
98
|
+
this.props.onCollapse(!this.state.collapsed);
|
111
99
|
}
|
112
100
|
}, {
|
113
101
|
key: "render",
|
@@ -116,8 +104,7 @@ function (_React$Component) {
|
|
116
104
|
children = _this$props.children,
|
117
105
|
classes = _this$props.classes,
|
118
106
|
className = _this$props.className,
|
119
|
-
|
120
|
-
collapsed = _this$props$collapsed === void 0 ? this.state.collapsed : _this$props$collapsed,
|
107
|
+
collapsed = _this$props.collapsed,
|
121
108
|
focused = _this$props.focused,
|
122
109
|
hideable = _this$props.hideable,
|
123
110
|
position = _this$props.position,
|
@@ -137,11 +124,7 @@ function (_React$Component) {
|
|
137
124
|
onClick: this.handleCollapse,
|
138
125
|
color: "inherit",
|
139
126
|
className: classes.iconButton
|
140
|
-
}, _ref))))
|
141
|
-
onClick: this.handleCollapse,
|
142
|
-
color: "inherit",
|
143
|
-
className: classes.collapseButton
|
144
|
-
}, _ref2));
|
127
|
+
}, _ref)))));
|
145
128
|
}
|
146
129
|
}]);
|
147
130
|
return HiAppBar;
|
package/HiButton/HiButton.js
CHANGED
@@ -28,15 +28,13 @@ var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
28
28
|
// @inheritedComponent Button
|
29
29
|
var styles = function styles(theme) {
|
30
30
|
return {
|
31
|
-
root: {
|
31
|
+
root: {},
|
32
|
+
flatNeutral: {
|
33
|
+
color: theme.palette.neutral.main,
|
32
34
|
'&$disabled': {
|
33
|
-
color: theme.palette.
|
34
|
-
backgroundColor: theme.palette.neutral.main
|
35
|
+
color: theme.palette.action.disabled
|
35
36
|
}
|
36
37
|
},
|
37
|
-
flatNeutral: {
|
38
|
-
color: theme.palette.neutral.main
|
39
|
-
},
|
40
38
|
flatPositive: {
|
41
39
|
color: theme.palette.positive.main,
|
42
40
|
'&:hover': {
|
@@ -45,6 +43,9 @@ var styles = function styles(theme) {
|
|
45
43
|
'@media (hover: none)': {
|
46
44
|
backgroundColor: 'transparent'
|
47
45
|
}
|
46
|
+
},
|
47
|
+
'&$disabled': {
|
48
|
+
color: theme.palette.action.disabled
|
48
49
|
}
|
49
50
|
},
|
50
51
|
flatNegative: {
|
@@ -55,6 +56,9 @@ var styles = function styles(theme) {
|
|
55
56
|
'@media (hover: none)': {
|
56
57
|
backgroundColor: 'transparent'
|
57
58
|
}
|
59
|
+
},
|
60
|
+
'&$disabled': {
|
61
|
+
color: theme.palette.action.disabled
|
58
62
|
}
|
59
63
|
},
|
60
64
|
flatMiddle: {
|
@@ -65,6 +69,9 @@ var styles = function styles(theme) {
|
|
65
69
|
'@media (hover: none)': {
|
66
70
|
backgroundColor: 'transparent'
|
67
71
|
}
|
72
|
+
},
|
73
|
+
'&$disabled': {
|
74
|
+
color: theme.palette.action.disabled
|
68
75
|
}
|
69
76
|
},
|
70
77
|
|
@@ -78,6 +85,10 @@ var styles = function styles(theme) {
|
|
78
85
|
'@media (hover: none)': {
|
79
86
|
backgroundColor: theme.palette.positive.main
|
80
87
|
}
|
88
|
+
},
|
89
|
+
'&$disabled': {
|
90
|
+
color: theme.palette.neutral.contrastText,
|
91
|
+
backgroundColor: theme.palette.neutral.main
|
81
92
|
}
|
82
93
|
},
|
83
94
|
|
@@ -91,6 +102,10 @@ var styles = function styles(theme) {
|
|
91
102
|
'@media (hover: none)': {
|
92
103
|
backgroundColor: theme.palette.negative.main
|
93
104
|
}
|
105
|
+
},
|
106
|
+
'&$disabled': {
|
107
|
+
color: theme.palette.neutral.contrastText,
|
108
|
+
backgroundColor: theme.palette.neutral.main
|
94
109
|
}
|
95
110
|
},
|
96
111
|
|
@@ -104,6 +119,10 @@ var styles = function styles(theme) {
|
|
104
119
|
'@media (hover: none)': {
|
105
120
|
backgroundColor: theme.palette.middle.main
|
106
121
|
}
|
122
|
+
},
|
123
|
+
'&$disabled': {
|
124
|
+
color: theme.palette.neutral.contrastText,
|
125
|
+
backgroundColor: theme.palette.neutral.main
|
107
126
|
}
|
108
127
|
},
|
109
128
|
|
@@ -117,6 +136,10 @@ var styles = function styles(theme) {
|
|
117
136
|
'@media (hover: none)': {
|
118
137
|
backgroundColor: theme.palette.neutral.main
|
119
138
|
}
|
139
|
+
},
|
140
|
+
'&$disabled': {
|
141
|
+
color: theme.palette.neutral.contrastText,
|
142
|
+
backgroundColor: theme.palette.neutral.main
|
120
143
|
}
|
121
144
|
},
|
122
145
|
|
@@ -27,7 +27,7 @@ var _colorManipulator = require("../styles/colorManipulator");
|
|
27
27
|
|
28
28
|
var styles = function styles(theme) {
|
29
29
|
return {
|
30
|
-
root: (0, _extends2.default)({}, theme.typography.
|
30
|
+
root: (0, _extends2.default)({}, theme.typography.b1, {
|
31
31
|
display: 'inline-block',
|
32
32
|
alignItems: 'baseline',
|
33
33
|
maxWidth: '100%',
|
@@ -147,7 +147,12 @@ function HiColoredLabel(props) {
|
|
147
147
|
}, fontWeight && {
|
148
148
|
fontWeight: fontWeight
|
149
149
|
})
|
150
|
-
}, other
|
150
|
+
}, other, {
|
151
|
+
// eslint-disable-next-line react/no-danger
|
152
|
+
dangerouslySetInnerHTML: {
|
153
|
+
__html: (0, _helpers.escapeHTML)(label)
|
154
|
+
}
|
155
|
+
}));
|
151
156
|
}
|
152
157
|
|
153
158
|
HiColoredLabel.propTypes = process.env.NODE_ENV !== "production" ? {
|
package/HiForm/HiInput.js
CHANGED
@@ -219,6 +219,10 @@ function (_React$PureComponent) {
|
|
219
219
|
// Si on click sur un élément de HiInput, on garde le focus
|
220
220
|
// Par exemple sur l'icone reset
|
221
221
|
if (event.relatedTarget && this.overlayNode && this.overlayNode.contains(event.relatedTarget)) {
|
222
|
+
if (this.endAdornmentNode.contains(event.relatedTarget) && this.props.onBlur) {
|
223
|
+
this.props.onBlur(event);
|
224
|
+
}
|
225
|
+
|
222
226
|
event.stopPropagation();
|
223
227
|
} else {
|
224
228
|
this.setState({
|
package/HiIcon/HiIcon.js
CHANGED
@@ -34,42 +34,48 @@ var mdi = _interopRequireWildcard(require("mdi-material-ui"));
|
|
34
34
|
var styles = function styles(theme) {
|
35
35
|
return {
|
36
36
|
/* Styles applied to the root element. */
|
37
|
-
root: {
|
37
|
+
root: {
|
38
|
+
/* Styles applied to the root element if `color="primary"`. */
|
39
|
+
'&$colorPrimary': {
|
40
|
+
color: theme.palette.primary.main
|
41
|
+
},
|
42
|
+
|
43
|
+
/* Styles applied to the root element if `color="secondary"`. */
|
44
|
+
'&$colorSecondary': {
|
45
|
+
color: theme.palette.secondary.main
|
46
|
+
},
|
47
|
+
|
48
|
+
/* Styles applied to the root element if `color="positive"`. */
|
49
|
+
'&$colorPositive': {
|
50
|
+
color: theme.palette.positive.main
|
51
|
+
},
|
52
|
+
|
53
|
+
/* Styles applied to the root element if `color="negative"`. */
|
54
|
+
'&$colorNegative': {
|
55
|
+
color: theme.palette.negative.main
|
56
|
+
},
|
57
|
+
|
58
|
+
/* Styles applied to the root element if `color="middle"`. */
|
59
|
+
'&$colorMiddle': {
|
60
|
+
color: theme.palette.middle.main
|
61
|
+
},
|
62
|
+
|
63
|
+
/* Styles applied to the root element if `color="neutral"`. */
|
64
|
+
'&$colorNeutral': {
|
65
|
+
color: theme.palette.neutral.main
|
66
|
+
}
|
67
|
+
},
|
38
68
|
|
39
69
|
/* Styles applied to the root element. */
|
40
70
|
faIcon: {
|
41
71
|
fontSize: 20
|
42
72
|
},
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
},
|
48
|
-
|
49
|
-
/* Styles applied to the root element if `color="secondary"`. */
|
50
|
-
colorSecondary: {
|
51
|
-
color: theme.palette.secondary.main
|
52
|
-
},
|
53
|
-
|
54
|
-
/* Styles applied to the root element if `color="positive"`. */
|
55
|
-
colorPositive: {
|
56
|
-
color: theme.palette.positive.main
|
57
|
-
},
|
58
|
-
|
59
|
-
/* Styles applied to the root element if `color="negative"`. */
|
60
|
-
colorNegative: {
|
61
|
-
color: theme.palette.negative.main
|
62
|
-
},
|
63
|
-
|
64
|
-
/* Styles applied to the root element if `color="middle"`. */
|
65
|
-
colorMiddle: {
|
66
|
-
color: theme.palette.middle.main
|
67
|
-
},
|
68
|
-
|
69
|
-
/* Styles applied to the root element if `color="neutral"`. */
|
70
|
-
colorNeutral: {
|
71
|
-
color: theme.palette.neutral.main
|
72
|
-
}
|
73
|
+
colorPrimary: {},
|
74
|
+
colorSecondary: {},
|
75
|
+
colorPositive: {},
|
76
|
+
colorNegative: {},
|
77
|
+
colorMiddle: {},
|
78
|
+
colorNeutral: {}
|
73
79
|
};
|
74
80
|
};
|
75
81
|
|
@@ -35,6 +35,8 @@ var _HiIcon = _interopRequireDefault(require("../HiIcon"));
|
|
35
35
|
|
36
36
|
var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
|
37
37
|
|
38
|
+
var _helpers = require("../utils/helpers");
|
39
|
+
|
38
40
|
// @inheritedComponent HiSelect
|
39
41
|
|
40
42
|
/**
|
@@ -86,6 +88,8 @@ function findFinalItemRecursively(itemList, searchId) {
|
|
86
88
|
* @param visibleParent - visibility of the list parent item (default false)
|
87
89
|
* @param pinnedParent - parent will be displayed as pinned items
|
88
90
|
* @param disabledParent - parent will not be selectable
|
91
|
+
* @param nbChildrenAsInfo - Show children number as info
|
92
|
+
* @param translations - Translations
|
89
93
|
* @returns {*}
|
90
94
|
*/
|
91
95
|
|
@@ -96,12 +100,14 @@ function buildFilteredItemList(itemList) {
|
|
96
100
|
var visibleParent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
97
101
|
var pinnedParent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
98
102
|
var disabledParent = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
103
|
+
var nbChildrenAsInfo = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
104
|
+
var translations = arguments.length > 7 ? arguments[7] : undefined;
|
99
105
|
return itemList.reduce(function (_ref, item) {
|
100
106
|
var memoItemList = _ref.l,
|
101
107
|
memoSelected = _ref.s,
|
102
108
|
memoUnselected = _ref.u,
|
103
109
|
memoVisible = _ref.v;
|
104
|
-
var itemVisible = searchValue === '' || item.label.toString().toLowerCase().search(searchValue.toLowerCase()) !== -1; // Parent item
|
110
|
+
var itemVisible = searchValue === '' || (0, _helpers.foldAccents)(item.label.toString().toLowerCase()).search((0, _helpers.foldAccents)(searchValue.toLowerCase())) !== -1; // Parent item
|
105
111
|
|
106
112
|
if (item.children) {
|
107
113
|
var _buildFilteredItemLis = buildFilteredItemList(item.children, selectedItemIdList, searchValue, itemVisible, pinnedParent, disabledParent),
|
@@ -110,6 +116,10 @@ function buildFilteredItemList(itemList) {
|
|
110
116
|
unselected = _buildFilteredItemLis.u,
|
111
117
|
visible = _buildFilteredItemLis.v;
|
112
118
|
|
119
|
+
if (nbChildrenAsInfo) {
|
120
|
+
item.info = translations.n_children.replace('%s', item.children.length);
|
121
|
+
}
|
122
|
+
|
113
123
|
return {
|
114
124
|
l: (0, _toConsumableArray2.default)(memoItemList).concat([(0, _extends2.default)({}, item, disabledParent && {
|
115
125
|
disabled: true,
|
@@ -161,7 +171,31 @@ var styles = function styles(theme) {
|
|
161
171
|
borderRadius: '0px 2px',
|
162
172
|
maxHeight: 480,
|
163
173
|
transition: 'none !important'
|
164
|
-
}
|
174
|
+
},
|
175
|
+
labelImg: {
|
176
|
+
height: 18,
|
177
|
+
width: 'auto',
|
178
|
+
margin: '0 4px',
|
179
|
+
verticalAlign: 'middle'
|
180
|
+
},
|
181
|
+
selectIconLabel: (0, _extends2.default)({
|
182
|
+
whiteSpace: 'nowrap',
|
183
|
+
overflow: 'hidden',
|
184
|
+
textOverflow: 'ellipsis',
|
185
|
+
paddingRight: 16
|
186
|
+
}, theme.typography.b1, {
|
187
|
+
display: 'inline-flex',
|
188
|
+
width: '100%'
|
189
|
+
}),
|
190
|
+
selectImgLabel: (0, _extends2.default)({
|
191
|
+
whiteSpace: 'nowrap',
|
192
|
+
overflow: 'hidden',
|
193
|
+
textOverflow: 'ellipsis',
|
194
|
+
paddingRight: 16
|
195
|
+
}, theme.typography.b1, {
|
196
|
+
display: 'inline-flex',
|
197
|
+
width: '100%'
|
198
|
+
})
|
165
199
|
};
|
166
200
|
};
|
167
201
|
/**
|
@@ -249,10 +283,11 @@ function (_React$PureComponent) {
|
|
249
283
|
hasAll = _this$props2.hasAll,
|
250
284
|
iconAll = _this$props2.iconAll,
|
251
285
|
multiple = _this$props2.multiple,
|
286
|
+
nbChildrenAsInfo = _this$props2.nbChildrenAsInfo,
|
252
287
|
pinnedParent = _this$props2.pinnedParent,
|
253
288
|
translations = _this$props2.translations; // build item list
|
254
289
|
|
255
|
-
var _buildFilteredItemLis2 = buildFilteredItemList(options, value, search, false, pinnedParent, disabledParent || !multiple),
|
290
|
+
var _buildFilteredItemLis2 = buildFilteredItemList(options, value, search, false, pinnedParent, disabledParent || !multiple, nbChildrenAsInfo, translations),
|
256
291
|
filteredItemList = _buildFilteredItemLis2.l,
|
257
292
|
allSelected = _buildFilteredItemLis2.s,
|
258
293
|
allUnselected = _buildFilteredItemLis2.u,
|
@@ -389,7 +424,7 @@ HiNestedSelect.defaultProps = {
|
|
389
424
|
search: 'Search',
|
390
425
|
n_items_selected: '%s items selected',
|
391
426
|
one_item_selected: '%s item selected',
|
392
|
-
n_children: '%s
|
427
|
+
n_children: '%s',
|
393
428
|
one_child: '%s item'
|
394
429
|
}
|
395
430
|
};
|
@@ -434,6 +469,11 @@ HiNestedSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
434
469
|
*/
|
435
470
|
name: _propTypes.default.string.isRequired,
|
436
471
|
|
472
|
+
/**
|
473
|
+
* Définit si l'on doit afficher le nombre d'enfants du parent dans son champ info
|
474
|
+
*/
|
475
|
+
nbChildrenAsInfo: _propTypes.default.bool,
|
476
|
+
|
437
477
|
/**
|
438
478
|
* Fonction de callback qui renvoit la/les valeurs sélectionnées
|
439
479
|
*
|
package/HiSelectNew/HiSelect.js
CHANGED
@@ -59,11 +59,11 @@ var styles = function styles(theme) {
|
|
59
59
|
backgroundColor: theme.palette.background2,
|
60
60
|
maxWidth: 500,
|
61
61
|
width: '100%',
|
62
|
-
position: 'relative'
|
63
|
-
zIndex: 1
|
62
|
+
position: 'relative'
|
64
63
|
},
|
65
64
|
popper: {
|
66
|
-
width: '100%'
|
65
|
+
width: '100% !important',
|
66
|
+
zIndex: 1200
|
67
67
|
},
|
68
68
|
paper: {
|
69
69
|
borderRadius: '0px 2px',
|
@@ -193,7 +193,9 @@ function (_React$PureComponent) {
|
|
193
193
|
|
194
194
|
if (_this.overlay && (key === 'down' || key === 'up')) {
|
195
195
|
_this.focusOnFirstItem();
|
196
|
-
} else if (_this.overlay && key === 'esc') {
|
196
|
+
} else if (_this.overlay && key === 'esc' || key === 'enter') {
|
197
|
+
event.preventDefault();
|
198
|
+
|
197
199
|
_this.handleClose();
|
198
200
|
}
|
199
201
|
};
|
@@ -336,8 +338,14 @@ function (_React$PureComponent) {
|
|
336
338
|
hideCheckbox: true,
|
337
339
|
label: 'loading'
|
338
340
|
}] : []).concat((0, _toConsumableArray2.default)(search !== '' ? (0, _toConsumableArray2.default)(options.filter(function (item) {
|
339
|
-
return item.label && item.label.toString().toLowerCase().search(search.toLowerCase()) !== -1;
|
340
|
-
})) : (0, _toConsumableArray2.default)(
|
341
|
+
return item.label && (0, _helpers.foldAccents)(item.label.toString().toLowerCase()).search((0, _helpers.foldAccents)(search.toLowerCase())) !== -1;
|
342
|
+
})) : (0, _toConsumableArray2.default)(_this.props.hasAll ? [(0, _extends2.default)({
|
343
|
+
id: '_all',
|
344
|
+
label: _this.props.translations.all
|
345
|
+
}, _this.props.iconAll && {
|
346
|
+
type: 'icon',
|
347
|
+
icon: _this.props.iconAll
|
348
|
+
})] : []).concat((0, _toConsumableArray2.default)(options))));
|
341
349
|
return {
|
342
350
|
itemList: itemList,
|
343
351
|
inputValue: _this.buildInputValue(options, value, loading)
|
@@ -111,7 +111,10 @@ var styles = function styles(theme) {
|
|
111
111
|
}, theme.typography.b1, {
|
112
112
|
fontWeight: 'inherit',
|
113
113
|
width: '100%',
|
114
|
-
padding: '5px 0'
|
114
|
+
padding: '5px 0',
|
115
|
+
'& strong': {
|
116
|
+
fontWeight: theme.typography.fontWeightMedium
|
117
|
+
}
|
115
118
|
}),
|
116
119
|
label: {
|
117
120
|
display: 'inline-block',
|
@@ -259,6 +262,7 @@ function (_React$Component) {
|
|
259
262
|
hideCheckbox = _this$props2.hideCheckbox,
|
260
263
|
onSelect = _this$props2.onSelect,
|
261
264
|
indeterminate = _this$props2.indeterminate,
|
265
|
+
indeterminateIcon = _this$props2.indeterminateIcon,
|
262
266
|
icon = _this$props2.icon,
|
263
267
|
id = _this$props2.id,
|
264
268
|
img = _this$props2.img,
|
@@ -317,7 +321,8 @@ function (_React$Component) {
|
|
317
321
|
,
|
318
322
|
disabled: disabled,
|
319
323
|
icon: displayedIcon,
|
320
|
-
indeterminate: indeterminate
|
324
|
+
indeterminate: indeterminate,
|
325
|
+
indeterminateIcon: indeterminateIcon
|
321
326
|
}), _react.default.createElement("div", {
|
322
327
|
className: (0, _classnames.default)(classes.listItemContent, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, classes.centered, centered), (0, _defineProperty2.default)(_classNames2, classes.primaryHighlight, type === 'primary-highlight'), _classNames2)),
|
323
328
|
"data-id": id
|
@@ -351,6 +356,7 @@ HiSelectableListItem.defaultProps = {
|
|
351
356
|
hideCheckbox: false,
|
352
357
|
hoverIcon: 'check_box_outline_blank',
|
353
358
|
checkedIcon: 'check_box',
|
359
|
+
indeterminateIcon: 'indeterminate_check_box',
|
354
360
|
indeterminate: false,
|
355
361
|
level: 0,
|
356
362
|
paddingLeft: 4,
|
package/es/HiAppBar/HiAppBar.js
CHANGED
@@ -37,10 +37,6 @@ var _ref = React.createElement(HiIcon, {
|
|
37
37
|
icon: "keyboard_arrow_up"
|
38
38
|
});
|
39
39
|
|
40
|
-
var _ref2 = React.createElement(HiIcon, {
|
41
|
-
icon: "keyboard_arrow_down"
|
42
|
-
});
|
43
|
-
|
44
40
|
class HiAppBar extends React.Component {
|
45
41
|
constructor(props) {
|
46
42
|
super(props);
|
@@ -51,13 +47,7 @@ class HiAppBar extends React.Component {
|
|
51
47
|
}
|
52
48
|
|
53
49
|
handleCollapse() {
|
54
|
-
|
55
|
-
this.props.onCollapse();
|
56
|
-
} else {
|
57
|
-
this.setState(prevState => ({
|
58
|
-
collapsed: !prevState.collapsed
|
59
|
-
}));
|
60
|
-
}
|
50
|
+
this.props.onCollapse(!this.state.collapsed);
|
61
51
|
}
|
62
52
|
|
63
53
|
render() {
|
@@ -66,8 +56,7 @@ class HiAppBar extends React.Component {
|
|
66
56
|
children,
|
67
57
|
classes,
|
68
58
|
className,
|
69
|
-
collapsed
|
70
|
-
// enable controlled & uncontrolled prop
|
59
|
+
collapsed,
|
71
60
|
focused,
|
72
61
|
hideable,
|
73
62
|
position
|
@@ -93,11 +82,7 @@ class HiAppBar extends React.Component {
|
|
93
82
|
onClick: this.handleCollapse,
|
94
83
|
color: "inherit",
|
95
84
|
className: classes.iconButton
|
96
|
-
}, _ref))))
|
97
|
-
onClick: this.handleCollapse,
|
98
|
-
color: "inherit",
|
99
|
-
className: classes.collapseButton
|
100
|
-
}, _ref2));
|
85
|
+
}, _ref)))));
|
101
86
|
}
|
102
87
|
|
103
88
|
}
|
package/es/HiButton/HiButton.js
CHANGED
@@ -8,15 +8,13 @@ import { withStyles } from '../styles';
|
|
8
8
|
import { fade } from '../styles/colorManipulator';
|
9
9
|
import Button from '@material-ui/core/Button';
|
10
10
|
export const styles = theme => ({
|
11
|
-
root: {
|
11
|
+
root: {},
|
12
|
+
flatNeutral: {
|
13
|
+
color: theme.palette.neutral.main,
|
12
14
|
'&$disabled': {
|
13
|
-
color: theme.palette.
|
14
|
-
backgroundColor: theme.palette.neutral.main
|
15
|
+
color: theme.palette.action.disabled
|
15
16
|
}
|
16
17
|
},
|
17
|
-
flatNeutral: {
|
18
|
-
color: theme.palette.neutral.main
|
19
|
-
},
|
20
18
|
flatPositive: {
|
21
19
|
color: theme.palette.positive.main,
|
22
20
|
'&:hover': {
|
@@ -25,6 +23,9 @@ export const styles = theme => ({
|
|
25
23
|
'@media (hover: none)': {
|
26
24
|
backgroundColor: 'transparent'
|
27
25
|
}
|
26
|
+
},
|
27
|
+
'&$disabled': {
|
28
|
+
color: theme.palette.action.disabled
|
28
29
|
}
|
29
30
|
},
|
30
31
|
flatNegative: {
|
@@ -35,6 +36,9 @@ export const styles = theme => ({
|
|
35
36
|
'@media (hover: none)': {
|
36
37
|
backgroundColor: 'transparent'
|
37
38
|
}
|
39
|
+
},
|
40
|
+
'&$disabled': {
|
41
|
+
color: theme.palette.action.disabled
|
38
42
|
}
|
39
43
|
},
|
40
44
|
flatMiddle: {
|
@@ -45,6 +49,9 @@ export const styles = theme => ({
|
|
45
49
|
'@media (hover: none)': {
|
46
50
|
backgroundColor: 'transparent'
|
47
51
|
}
|
52
|
+
},
|
53
|
+
'&$disabled': {
|
54
|
+
color: theme.palette.action.disabled
|
48
55
|
}
|
49
56
|
},
|
50
57
|
|
@@ -58,6 +65,10 @@ export const styles = theme => ({
|
|
58
65
|
'@media (hover: none)': {
|
59
66
|
backgroundColor: theme.palette.positive.main
|
60
67
|
}
|
68
|
+
},
|
69
|
+
'&$disabled': {
|
70
|
+
color: theme.palette.neutral.contrastText,
|
71
|
+
backgroundColor: theme.palette.neutral.main
|
61
72
|
}
|
62
73
|
},
|
63
74
|
|
@@ -71,6 +82,10 @@ export const styles = theme => ({
|
|
71
82
|
'@media (hover: none)': {
|
72
83
|
backgroundColor: theme.palette.negative.main
|
73
84
|
}
|
85
|
+
},
|
86
|
+
'&$disabled': {
|
87
|
+
color: theme.palette.neutral.contrastText,
|
88
|
+
backgroundColor: theme.palette.neutral.main
|
74
89
|
}
|
75
90
|
},
|
76
91
|
|
@@ -84,6 +99,10 @@ export const styles = theme => ({
|
|
84
99
|
'@media (hover: none)': {
|
85
100
|
backgroundColor: theme.palette.middle.main
|
86
101
|
}
|
102
|
+
},
|
103
|
+
'&$disabled': {
|
104
|
+
color: theme.palette.neutral.contrastText,
|
105
|
+
backgroundColor: theme.palette.neutral.main
|
87
106
|
}
|
88
107
|
},
|
89
108
|
|
@@ -97,6 +116,10 @@ export const styles = theme => ({
|
|
97
116
|
'@media (hover: none)': {
|
98
117
|
backgroundColor: theme.palette.neutral.main
|
99
118
|
}
|
119
|
+
},
|
120
|
+
'&$disabled': {
|
121
|
+
color: theme.palette.neutral.contrastText,
|
122
|
+
backgroundColor: theme.palette.neutral.main
|
100
123
|
}
|
101
124
|
},
|
102
125
|
|
@@ -5,10 +5,10 @@ import React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import classNames from 'classnames';
|
7
7
|
import withStyles from '../styles/withStyles';
|
8
|
-
import { capitalize } from '../utils/helpers';
|
8
|
+
import { capitalize, escapeHTML } from '../utils/helpers';
|
9
9
|
import { fade } from '../styles/colorManipulator';
|
10
10
|
export const styles = theme => ({
|
11
|
-
root: _objectSpread({}, theme.typography.
|
11
|
+
root: _objectSpread({}, theme.typography.b1, {
|
12
12
|
display: 'inline-block',
|
13
13
|
alignItems: 'baseline',
|
14
14
|
maxWidth: '100%',
|
@@ -130,7 +130,12 @@ function HiColoredLabel(props) {
|
|
130
130
|
}, fontWeight && {
|
131
131
|
fontWeight
|
132
132
|
})
|
133
|
-
}, other
|
133
|
+
}, other, {
|
134
|
+
// eslint-disable-next-line react/no-danger
|
135
|
+
dangerouslySetInnerHTML: {
|
136
|
+
__html: escapeHTML(label)
|
137
|
+
}
|
138
|
+
}));
|
134
139
|
}
|
135
140
|
|
136
141
|
HiColoredLabel.propTypes = process.env.NODE_ENV !== "production" ? {
|
package/es/HiForm/HiInput.js
CHANGED
@@ -179,6 +179,10 @@ class HiInput extends React.PureComponent {
|
|
179
179
|
// Si on click sur un élément de HiInput, on garde le focus
|
180
180
|
// Par exemple sur l'icone reset
|
181
181
|
if (event.relatedTarget && this.overlayNode && this.overlayNode.contains(event.relatedTarget)) {
|
182
|
+
if (this.endAdornmentNode.contains(event.relatedTarget) && this.props.onBlur) {
|
183
|
+
this.props.onBlur(event);
|
184
|
+
}
|
185
|
+
|
182
186
|
event.stopPropagation();
|
183
187
|
} else {
|
184
188
|
this.setState({
|