@hipay/hipay-material-ui 1.0.0-beta.3 → 1.0.0-beta.4
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/HiDatePicker/HiDatePicker.js +12 -14
- package/HiForm/HiFormControl.js +4 -1
- package/HiForm/HiInput.js +4 -4
- package/HiForm/HiSearchField.js +1 -1
- package/HiSelect/HiSelect.js +285 -257
- package/HiSelect/HiSelectField.js +8 -6
- package/HiSelect/HiSuggestSelect.js +25 -47
- package/HiSelect/HiSuggestSelectField.js +88 -80
- package/HiSelect/SelectInput.js +32 -21
- package/HiSelectableList/HiSelectableListItem.js +3 -0
- package/HiTopBar/HiTopBar.js +16 -12
- package/es/HiDatePicker/HiDatePicker.js +12 -14
- package/es/HiForm/HiFormControl.js +4 -1
- package/es/HiForm/HiInput.js +4 -4
- package/es/HiForm/HiSearchField.js +1 -1
- package/es/HiSelect/HiSelect.js +261 -229
- package/es/HiSelect/HiSelectField.js +9 -7
- package/es/HiSelect/HiSuggestSelect.js +24 -39
- package/es/HiSelect/HiSuggestSelectField.js +77 -69
- package/es/HiSelect/SelectInput.js +42 -21
- package/es/HiSelectableList/HiSelectableListItem.js +3 -0
- package/es/HiTopBar/HiTopBar.js +16 -8
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/umd/hipay-material-ui.development.js +8684 -8694
- package/umd/hipay-material-ui.production.min.js +5 -5
@@ -5,10 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.styles = undefined;
|
7
7
|
|
8
|
-
var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
|
9
|
-
|
10
|
-
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
11
|
-
|
12
8
|
var _extends2 = require('babel-runtime/helpers/extends');
|
13
9
|
|
14
10
|
var _extends3 = _interopRequireDefault(_extends2);
|
@@ -45,10 +41,6 @@ var _propTypes = require('prop-types');
|
|
45
41
|
|
46
42
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
47
43
|
|
48
|
-
var _classnames = require('classnames');
|
49
|
-
|
50
|
-
var _classnames2 = _interopRequireDefault(_classnames);
|
51
|
-
|
52
44
|
var _reactDom = require('react-dom');
|
53
45
|
|
54
46
|
var _Grow = require('material-ui/transitions/Grow');
|
@@ -59,10 +51,6 @@ var _Paper = require('material-ui/Paper');
|
|
59
51
|
|
60
52
|
var _Paper2 = _interopRequireDefault(_Paper);
|
61
53
|
|
62
|
-
var _ClickAwayListener = require('material-ui/utils/ClickAwayListener');
|
63
|
-
|
64
|
-
var _ClickAwayListener2 = _interopRequireDefault(_ClickAwayListener);
|
65
|
-
|
66
54
|
var _reactPopper = require('react-popper');
|
67
55
|
|
68
56
|
var _HiSelectableList = require('../HiSelectableList');
|
@@ -86,7 +74,7 @@ var styles = exports.styles = function styles(theme) {
|
|
86
74
|
root: {
|
87
75
|
backgroundColor: theme.palette.background2,
|
88
76
|
maxWidth: 500,
|
89
|
-
minWidth:
|
77
|
+
minWidth: 200,
|
90
78
|
width: '100%'
|
91
79
|
},
|
92
80
|
popper: {
|
@@ -95,9 +83,6 @@ var styles = exports.styles = function styles(theme) {
|
|
95
83
|
zIndex: 9,
|
96
84
|
top: '100%'
|
97
85
|
},
|
98
|
-
popperClose: {
|
99
|
-
pointerEvents: 'none'
|
100
|
-
},
|
101
86
|
paper: {
|
102
87
|
borderRadius: '0px 2px',
|
103
88
|
maxHeight: 440,
|
@@ -162,8 +147,8 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
162
147
|
};
|
163
148
|
|
164
149
|
_this.handleSelect = _this.handleSelect.bind(_this);
|
165
|
-
_this.handleClose = _this.handleClose.bind(_this);
|
166
150
|
_this.handleBlur = _this.handleBlur.bind(_this);
|
151
|
+
_this.handleFocus = _this.handleFocus.bind(_this);
|
167
152
|
return _this;
|
168
153
|
}
|
169
154
|
|
@@ -172,29 +157,24 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
172
157
|
value: function componentWillReceiveProps(nextProps) {
|
173
158
|
this.setState({ options: nextProps.options });
|
174
159
|
}
|
175
|
-
}, {
|
176
|
-
key: 'handleClose',
|
177
|
-
value: function handleClose() {
|
178
|
-
document.body.style.overflow = 'auto';
|
179
|
-
this.setState({
|
180
|
-
focused: false, // TODO - Make difference between open and focus
|
181
|
-
options: []
|
182
|
-
});
|
183
|
-
}
|
184
160
|
|
185
161
|
// Key down on list items
|
186
162
|
|
187
163
|
|
188
164
|
// Key down on search input
|
189
165
|
|
166
|
+
}, {
|
167
|
+
key: 'handleFocus',
|
168
|
+
value: function handleFocus() {
|
169
|
+
this.setState({ focused: true });
|
170
|
+
}
|
190
171
|
}, {
|
191
172
|
key: 'handleBlur',
|
192
173
|
value: function handleBlur(event) {
|
193
174
|
// Si on click sur un élément de HiInput, on garde le focus
|
194
175
|
// Par exemple sur l'icone reset
|
195
|
-
var overlay = this.overlay;
|
196
176
|
if (!event.relatedTarget || !this.overlay || !this.overlay.contains(event.relatedTarget)) {
|
197
|
-
this.setState({ options: [] });
|
177
|
+
this.setState({ options: [], focused: false });
|
198
178
|
}
|
199
179
|
}
|
200
180
|
}, {
|
@@ -212,7 +192,8 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
212
192
|
focused = _state.focused,
|
213
193
|
options = _state.options;
|
214
194
|
|
215
|
-
var open = !!options.length;
|
195
|
+
var open = !!options.length && focused;
|
196
|
+
|
216
197
|
return _react2.default.createElement(
|
217
198
|
'div',
|
218
199
|
{
|
@@ -235,7 +216,8 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
235
216
|
},
|
236
217
|
onChange: onSearch,
|
237
218
|
onKeyDown: this.handleKeyDownSearch,
|
238
|
-
onBlur: this.handleBlur
|
219
|
+
onBlur: this.handleBlur,
|
220
|
+
onFocus: this.handleFocus
|
239
221
|
}))
|
240
222
|
),
|
241
223
|
open && _react2.default.createElement(
|
@@ -243,26 +225,22 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
243
225
|
{
|
244
226
|
placement: 'bottom-start',
|
245
227
|
eventsEnabled: open,
|
246
|
-
className:
|
228
|
+
className: classes.popper
|
247
229
|
},
|
248
230
|
_react2.default.createElement(
|
249
|
-
|
250
|
-
{
|
231
|
+
_Grow2.default,
|
232
|
+
{ 'in': open, id: 'menu-list', style: { transformOrigin: '0 0 0' } },
|
251
233
|
_react2.default.createElement(
|
252
|
-
|
253
|
-
{
|
254
|
-
_react2.default.createElement(
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
translations: translations,
|
263
|
-
onKeyDown: this.handleKeyDown
|
264
|
-
})
|
265
|
-
)
|
234
|
+
_Paper2.default,
|
235
|
+
{ className: classes.paper },
|
236
|
+
_react2.default.createElement(_HiSelectableList2.default, {
|
237
|
+
itemList: options,
|
238
|
+
selectedIdList: [],
|
239
|
+
checkbox: false,
|
240
|
+
onSelect: this.handleSelect,
|
241
|
+
translations: translations,
|
242
|
+
onKeyDown: this.handleKeyDown
|
243
|
+
})
|
266
244
|
)
|
267
245
|
)
|
268
246
|
)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
4
|
+
value: true
|
5
5
|
});
|
6
6
|
|
7
7
|
var _extends2 = require('babel-runtime/helpers/extends');
|
@@ -56,88 +56,96 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
56
56
|
// @inheritedComponent HiSuggestSelect
|
57
57
|
|
58
58
|
var HiSuggestSelectField = function (_React$PureComponent) {
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
59
|
+
(0, _inherits3.default)(HiSuggestSelectField, _React$PureComponent);
|
60
|
+
|
61
|
+
function HiSuggestSelectField() {
|
62
|
+
(0, _classCallCheck3.default)(this, HiSuggestSelectField);
|
63
|
+
return (0, _possibleConstructorReturn3.default)(this, (HiSuggestSelectField.__proto__ || (0, _getPrototypeOf2.default)(HiSuggestSelectField)).apply(this, arguments));
|
64
|
+
}
|
65
|
+
|
66
|
+
(0, _createClass3.default)(HiSuggestSelectField, [{
|
67
|
+
key: 'render',
|
68
|
+
value: function render() {
|
69
|
+
var _props = this.props,
|
70
|
+
label = _props.label,
|
71
|
+
required = _props.required,
|
72
|
+
disabled = _props.disabled,
|
73
|
+
error = _props.error,
|
74
|
+
errorText = _props.errorText,
|
75
|
+
helperText = _props.helperText,
|
76
|
+
helperIcon = _props.helperIcon,
|
77
|
+
id = _props.id,
|
78
|
+
className = _props.className,
|
79
|
+
others = (0, _objectWithoutProperties3.default)(_props, ['label', 'required', 'disabled', 'error', 'errorText', 'helperText', 'helperIcon', 'id', 'className']);
|
80
|
+
|
81
|
+
|
82
|
+
return _react2.default.createElement(
|
83
|
+
_HiFormControl2.default,
|
84
|
+
{
|
85
|
+
id: id,
|
86
|
+
label: label,
|
87
|
+
required: required,
|
88
|
+
disabled: disabled,
|
89
|
+
error: error,
|
90
|
+
errorText: errorText,
|
91
|
+
helperText: helperText,
|
92
|
+
helperIcon: helperIcon,
|
93
|
+
className: className
|
94
|
+
},
|
95
|
+
_react2.default.createElement(_HiSuggestSelect2.default, (0, _extends3.default)({
|
96
|
+
id: id,
|
97
|
+
translations: {
|
98
|
+
all: 'Tous les pays',
|
99
|
+
no_result_match: 'Aucun résultat correspondant',
|
100
|
+
search: 'Recherche',
|
101
|
+
n_items_selected: '%s pays sélectionnés',
|
102
|
+
one_item_selected: '%s pays sélectionné'
|
103
|
+
},
|
104
|
+
disabled: disabled,
|
105
|
+
error: error
|
106
|
+
}, others))
|
107
|
+
);
|
64
108
|
}
|
65
|
-
|
66
|
-
|
67
|
-
key: 'render',
|
68
|
-
value: function render() {
|
69
|
-
var _props = this.props,
|
70
|
-
label = _props.label,
|
71
|
-
required = _props.required,
|
72
|
-
disabled = _props.disabled,
|
73
|
-
error = _props.error,
|
74
|
-
errorText = _props.errorText,
|
75
|
-
helperText = _props.helperText,
|
76
|
-
helperIcon = _props.helperIcon,
|
77
|
-
id = _props.id,
|
78
|
-
others = (0, _objectWithoutProperties3.default)(_props, ['label', 'required', 'disabled', 'error', 'errorText', 'helperText', 'helperIcon', 'id']);
|
79
|
-
|
80
|
-
|
81
|
-
return _react2.default.createElement(
|
82
|
-
_HiFormControl2.default,
|
83
|
-
{
|
84
|
-
id: id,
|
85
|
-
label: label,
|
86
|
-
required: required,
|
87
|
-
disabled: disabled,
|
88
|
-
error: error,
|
89
|
-
errorText: errorText,
|
90
|
-
helperText: helperText,
|
91
|
-
helperIcon: helperIcon
|
92
|
-
},
|
93
|
-
_react2.default.createElement(_HiSuggestSelect2.default, (0, _extends3.default)({
|
94
|
-
id: id,
|
95
|
-
translations: {
|
96
|
-
all: 'Tous les pays',
|
97
|
-
no_result_match: 'Aucun résultat correspondant',
|
98
|
-
search: 'Recherche',
|
99
|
-
n_items_selected: '%s pays sélectionnés',
|
100
|
-
one_item_selected: '%s pays sélectionné'
|
101
|
-
}
|
102
|
-
}, others))
|
103
|
-
);
|
104
|
-
}
|
105
|
-
}]);
|
106
|
-
return HiSuggestSelectField;
|
109
|
+
}]);
|
110
|
+
return HiSuggestSelectField;
|
107
111
|
}(_react2.default.PureComponent);
|
108
112
|
|
109
113
|
HiSuggestSelectField.propTypes = process.env.NODE_ENV !== "production" ? {
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
114
|
+
/**
|
115
|
+
* Surcharge des styles
|
116
|
+
*/
|
117
|
+
className: _propTypes2.default.string,
|
118
|
+
/**
|
119
|
+
* Si `true`, l'input sera inactif.
|
120
|
+
*/
|
121
|
+
disabled: _propTypes2.default.bool,
|
122
|
+
/**
|
123
|
+
* Si `true`, le champs sera en erreur.
|
124
|
+
*/
|
125
|
+
error: _propTypes2.default.bool,
|
126
|
+
/**
|
127
|
+
* Texte de l'erreur
|
128
|
+
*/
|
129
|
+
errorText: _propTypes2.default.string,
|
130
|
+
/**
|
131
|
+
* Si "true", le texte d'aide s'affichera seulement au clic sur l'icône "Information"
|
132
|
+
*/
|
133
|
+
helperIcon: _propTypes2.default.bool,
|
134
|
+
/**
|
135
|
+
* Texte de l'aide
|
136
|
+
*/
|
137
|
+
helperText: _propTypes2.default.string,
|
138
|
+
/**
|
139
|
+
* id de l'élément input
|
140
|
+
*/
|
141
|
+
id: _propTypes2.default.string,
|
142
|
+
/**
|
143
|
+
* Label du champs
|
144
|
+
*/
|
145
|
+
label: _propTypes2.default.string,
|
146
|
+
/**
|
147
|
+
* true si champs obligatoire
|
148
|
+
*/
|
149
|
+
required: _propTypes2.default.bool
|
142
150
|
} : {};
|
143
151
|
exports.default = HiSuggestSelectField;
|
package/HiSelect/SelectInput.js
CHANGED
@@ -100,7 +100,7 @@ var styles = exports.styles = function styles(theme) {
|
|
100
100
|
},
|
101
101
|
inkbar: {
|
102
102
|
'&:not($disabled)': {
|
103
|
-
'&:after': {
|
103
|
+
'&:not($error):after': {
|
104
104
|
backgroundColor: theme.palette.business.primary.normal,
|
105
105
|
left: 0,
|
106
106
|
bottom: 0,
|
@@ -206,7 +206,8 @@ var SelectInput = function (_React$PureComponent) {
|
|
206
206
|
open = _props.open,
|
207
207
|
focused = _props.focused,
|
208
208
|
error = _props.error,
|
209
|
-
id = _props.id
|
209
|
+
id = _props.id,
|
210
|
+
refElement = _props.refElement;
|
210
211
|
|
211
212
|
// On utilise classNames pour variabiliser les styles et merge les classes appliquées
|
212
213
|
|
@@ -227,7 +228,10 @@ var SelectInput = function (_React$PureComponent) {
|
|
227
228
|
onFocus: this.props.onFocus,
|
228
229
|
onBlur: this.props.onBlur,
|
229
230
|
role: 'button',
|
230
|
-
tabIndex: '0'
|
231
|
+
tabIndex: '0',
|
232
|
+
ref: function ref(el) {
|
233
|
+
refElement && refElement(el);
|
234
|
+
}
|
231
235
|
},
|
232
236
|
_react2.default.createElement(
|
233
237
|
'span',
|
@@ -246,7 +250,10 @@ var SelectInput = function (_React$PureComponent) {
|
|
246
250
|
onMouseLeave: this.props.onMouseLeave,
|
247
251
|
onKeyDown: this.handleKeyDown,
|
248
252
|
onFocus: this.props.onFocus,
|
249
|
-
onBlur: this.props.onBlur
|
253
|
+
onBlur: this.props.onBlur,
|
254
|
+
buttonRef: function buttonRef(el) {
|
255
|
+
refElement && refElement(el);
|
256
|
+
}
|
250
257
|
},
|
251
258
|
_react2.default.createElement(
|
252
259
|
'span',
|
@@ -283,6 +290,23 @@ SelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
283
290
|
* If `true`, the select will be disabled.
|
284
291
|
*/
|
285
292
|
disabled: _propTypes2.default.bool,
|
293
|
+
/**
|
294
|
+
* Applique le style error
|
295
|
+
*/
|
296
|
+
error: _propTypes2.default.bool,
|
297
|
+
/**
|
298
|
+
* Applique le style focused
|
299
|
+
*/
|
300
|
+
focused: _propTypes2.default.bool,
|
301
|
+
/**
|
302
|
+
* id du select
|
303
|
+
*/
|
304
|
+
id: _propTypes2.default.string,
|
305
|
+
/**
|
306
|
+
* Affiche sous forme de div à la place d'un bouton.
|
307
|
+
* Si des éléments cliquables sont à l'intérieur.
|
308
|
+
*/
|
309
|
+
noButton: _propTypes2.default.bool,
|
286
310
|
/**
|
287
311
|
* Fonction de callback au blur du bouton
|
288
312
|
*/
|
@@ -299,30 +323,17 @@ SelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
299
323
|
* Fonction de callback à la pression de touche
|
300
324
|
*/
|
301
325
|
onKeyDown: _propTypes2.default.func,
|
302
|
-
/**
|
303
|
-
* Valeur à afficher (déjà formattée)
|
304
|
-
*/
|
305
|
-
value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number, _propTypes2.default.node]),
|
306
326
|
/**
|
307
327
|
* Applique le style open et effectue une rotation de l'icône
|
308
328
|
*/
|
309
329
|
open: _propTypes2.default.bool,
|
310
330
|
/**
|
311
|
-
*
|
312
|
-
* Si des éléments cliquables sont à l'intérieur.
|
313
|
-
*/
|
314
|
-
noButton: _propTypes2.default.bool,
|
315
|
-
/**
|
316
|
-
* Applique le style focused
|
317
|
-
*/
|
318
|
-
focused: _propTypes2.default.bool,
|
319
|
-
/**
|
320
|
-
* Applique le style error
|
331
|
+
* Use that property to pass a ref callback to the native component.
|
321
332
|
*/
|
322
|
-
|
333
|
+
refElement: _propTypes2.default.func,
|
323
334
|
/**
|
324
|
-
*
|
335
|
+
* Valeur à afficher (déjà formattée)
|
325
336
|
*/
|
326
|
-
|
337
|
+
value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number, _propTypes2.default.node])
|
327
338
|
} : {};
|
328
339
|
exports.default = (0, _styles.withStyles)(styles, { name: 'HmuiSelectInput' })(SelectInput);
|
@@ -117,6 +117,9 @@ var styles = exports.styles = function styles(theme) {
|
|
117
117
|
marginLeft: theme.spacing.unit
|
118
118
|
}),
|
119
119
|
listItemInfoText: (0, _extends3.default)({
|
120
|
+
whiteSpace: 'nowrap',
|
121
|
+
overflow: 'hidden',
|
122
|
+
textOverflow: 'ellipsis',
|
120
123
|
color: theme.palette.neutral.normal
|
121
124
|
}, theme.typography.body4, {
|
122
125
|
fontWeight: theme.typography.fontWeightRegular,
|
package/HiTopBar/HiTopBar.js
CHANGED
@@ -209,7 +209,7 @@ var HiTopBar = function (_React$Component) {
|
|
209
209
|
menuAnchor: null
|
210
210
|
};
|
211
211
|
|
212
|
-
_this.
|
212
|
+
_this.handleCollapse = _this.handleCollapse.bind(_this);
|
213
213
|
_this.handleClickMenu = _this.handleClickMenu.bind(_this);
|
214
214
|
_this.handleOpenMenu = _this.handleOpenMenu.bind(_this);
|
215
215
|
_this.handleCloseMenu = _this.handleCloseMenu.bind(_this);
|
@@ -234,8 +234,8 @@ var HiTopBar = function (_React$Component) {
|
|
234
234
|
callback();
|
235
235
|
}
|
236
236
|
}, {
|
237
|
-
key: '
|
238
|
-
value: function
|
237
|
+
key: 'handleCollapse',
|
238
|
+
value: function handleCollapse() {
|
239
239
|
this.setState({ collapsed: !this.state.collapsed });
|
240
240
|
}
|
241
241
|
}, {
|
@@ -259,6 +259,7 @@ var HiTopBar = function (_React$Component) {
|
|
259
259
|
translations = _props.translations,
|
260
260
|
onClickMenu = _props.onClickMenu,
|
261
261
|
accountSelectorContent = _props.accountSelectorContent,
|
262
|
+
refButtons = _props.refButtons,
|
262
263
|
searchInput = _props.searchInput,
|
263
264
|
searchFocus = _props.searchFocus;
|
264
265
|
|
@@ -295,15 +296,16 @@ var HiTopBar = function (_React$Component) {
|
|
295
296
|
null,
|
296
297
|
_react2.default.createElement(
|
297
298
|
_Collapse2.default,
|
298
|
-
{
|
299
|
+
{
|
300
|
+
'in': !this.state.collapsed,
|
301
|
+
className: (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.collapseOverflow, !hideable))
|
302
|
+
},
|
299
303
|
_react2.default.createElement(
|
300
304
|
_Toolbar2.default,
|
301
305
|
{ className: classes.toolbar },
|
302
306
|
_react2.default.createElement(
|
303
307
|
'div',
|
304
|
-
{ ref:
|
305
|
-
return _this2.overlay = div;
|
306
|
-
} },
|
308
|
+
{ ref: refButtons },
|
307
309
|
searchFocus ? _react2.default.createElement(
|
308
310
|
_HiButton2.default,
|
309
311
|
{
|
@@ -359,7 +361,7 @@ var HiTopBar = function (_React$Component) {
|
|
359
361
|
(hideable || hasSettings) && _react2.default.createElement(
|
360
362
|
_IconButton2.default,
|
361
363
|
{ color: 'inherit', className: classes.iconButton },
|
362
|
-
hideable && _react2.default.createElement(_mdiMaterialUi.ChevronDoubleUp, { onClick: this.
|
364
|
+
hideable && _react2.default.createElement(_mdiMaterialUi.ChevronDoubleUp, { onClick: this.handleCollapse }),
|
363
365
|
hasSettings && _react2.default.createElement(_HiIconBuilder2.default, {
|
364
366
|
onClick: this.props.onClickSettings,
|
365
367
|
icon: 'fa-gear',
|
@@ -371,7 +373,7 @@ var HiTopBar = function (_React$Component) {
|
|
371
373
|
hideable && this.state.collapsed && _react2.default.createElement(
|
372
374
|
_IconButton2.default,
|
373
375
|
{
|
374
|
-
onClick: this.
|
376
|
+
onClick: this.handleCollapse,
|
375
377
|
color: 'inherit',
|
376
378
|
className: classes.showTopBarButton
|
377
379
|
},
|
@@ -387,9 +389,7 @@ var HiTopBar = function (_React$Component) {
|
|
387
389
|
{ className: classes.toolbar },
|
388
390
|
_react2.default.createElement(
|
389
391
|
'div',
|
390
|
-
{ ref:
|
391
|
-
return _this2.overlay = div;
|
392
|
-
} },
|
392
|
+
{ ref: refButtons },
|
393
393
|
searchFocus ? _react2.default.createElement(
|
394
394
|
_IconButton2.default,
|
395
395
|
{ className: classes.leftButtonMobile, color: 'inherit' },
|
@@ -533,6 +533,10 @@ HiTopBar.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
533
533
|
* [here](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning).
|
534
534
|
*/
|
535
535
|
position: _propTypes2.default.oneOf(['fixed', 'absolute', 'sticky', 'static']),
|
536
|
+
/**
|
537
|
+
* Passe une ref callback à la div contenant les boutons "menu" et "back"
|
538
|
+
*/
|
539
|
+
refButtons: _propTypes2.default.func,
|
536
540
|
/**
|
537
541
|
* Etat de focus.
|
538
542
|
*/
|
@@ -52,21 +52,19 @@ class HiDatePicker extends React.Component {
|
|
52
52
|
}
|
53
53
|
|
54
54
|
handleDayChange(day, modifiers) {
|
55
|
-
if (
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
if (this.props.
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
day.setHours(0, 0);
|
66
|
-
}
|
55
|
+
if (modifiers.selected) {
|
56
|
+
// Deselect day
|
57
|
+
this.props.onChange(undefined);
|
58
|
+
} else {
|
59
|
+
// Keep Time if set
|
60
|
+
if (this.props.enableTime && day !== undefined) {
|
61
|
+
if (this.props.value) {
|
62
|
+
day.setHours(this.props.value.getHours(), this.props.value.getMinutes());
|
63
|
+
} else {
|
64
|
+
day.setHours(0, 0);
|
67
65
|
}
|
68
|
-
this.props.onChange(day);
|
69
66
|
}
|
67
|
+
this.props.onChange(day);
|
70
68
|
}
|
71
69
|
if (day instanceof Date && !this.props.enableTime && modifiers.selected !== true) {
|
72
70
|
// Hide overlay & remove focus on input
|
@@ -304,7 +302,7 @@ HiDatePicker.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
304
302
|
*
|
305
303
|
* @param {Date} date sélectionnée
|
306
304
|
*/
|
307
|
-
onChange: PropTypes.func,
|
305
|
+
onChange: PropTypes.func.isRequired,
|
308
306
|
/**
|
309
307
|
* Callback au reset de l'input
|
310
308
|
*/
|
@@ -98,8 +98,11 @@ class HiFormControl extends React.PureComponent {
|
|
98
98
|
this.handleHover = this.handleHover.bind(this);
|
99
99
|
}
|
100
100
|
|
101
|
-
handleHelperClick() {
|
101
|
+
handleHelperClick(event) {
|
102
102
|
this.setState(prevState => ({ helperOpen: !prevState.helperOpen }));
|
103
|
+
if (event) {
|
104
|
+
event.preventDefault();
|
105
|
+
}
|
103
106
|
}
|
104
107
|
|
105
108
|
handleFocus(value) {
|
package/es/HiForm/HiInput.js
CHANGED
@@ -67,7 +67,7 @@ export const styles = theme => ({
|
|
67
67
|
rightIcon: {
|
68
68
|
margin: '0 8px',
|
69
69
|
width: 18,
|
70
|
-
height:
|
70
|
+
height: 39,
|
71
71
|
color: theme.palette.neutral.normal
|
72
72
|
},
|
73
73
|
rightIconFocus: {
|
@@ -90,10 +90,10 @@ export const styles = theme => ({
|
|
90
90
|
padding: 0
|
91
91
|
}),
|
92
92
|
inputText: {
|
93
|
-
height:
|
93
|
+
height: 39
|
94
94
|
},
|
95
95
|
inputTextarea: {
|
96
|
-
minHeight:
|
96
|
+
minHeight: 39,
|
97
97
|
paddingTop: 8
|
98
98
|
},
|
99
99
|
iconPointer: {
|
@@ -101,7 +101,7 @@ export const styles = theme => ({
|
|
101
101
|
cursor: 'pointer'
|
102
102
|
},
|
103
103
|
eraseButton: {
|
104
|
-
height:
|
104
|
+
height: 39,
|
105
105
|
width: 40,
|
106
106
|
display: 'inline-block'
|
107
107
|
},
|