@hipay/hipay-material-ui 1.0.0-beta.3 → 1.0.0-beta.5
Sign up to get free protection for your applications and to get access to all the features.
- package/HiChip/HiChip.js +4 -4
- package/HiColoredLabel/HiColoredLabel.js +1 -1
- package/HiDatePicker/HiDatePicker.js +12 -14
- package/HiDatePicker/HiDateRangeSelector.js +5 -5
- package/HiForm/HiFormControl.js +5 -2
- package/HiForm/HiInput.js +4 -4
- package/HiForm/HiSearchField.js +1 -1
- package/HiSelect/HiSelect.js +286 -258
- 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/HiSelectableList.js +8 -2
- package/HiSelectableList/HiSelectableListItem.js +41 -38
- package/HiTable/HiTable.js +1 -1
- package/HiTable/HiTableFooterScroll.js +1 -1
- package/HiTopBar/HiTopBar.js +16 -12
- package/es/HiChip/HiChip.js +4 -4
- package/es/HiColoredLabel/HiColoredLabel.js +1 -1
- package/es/HiDatePicker/HiDatePicker.js +12 -14
- package/es/HiDatePicker/HiDateRangeSelector.js +5 -5
- package/es/HiForm/HiFormControl.js +5 -2
- package/es/HiForm/HiInput.js +4 -4
- package/es/HiForm/HiSearchField.js +1 -1
- package/es/HiSelect/HiSelect.js +262 -230
- 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/HiSelectableList.js +9 -3
- package/es/HiSelectableList/HiSelectableListItem.js +41 -38
- package/es/HiTable/HiTable.js +1 -1
- package/es/HiTable/HiTableFooterScroll.js +1 -1
- package/es/HiTopBar/HiTopBar.js +16 -8
- package/es/utils/hiHelpers.js +1 -1
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/umd/hipay-material-ui.development.js +8701 -8705
- package/umd/hipay-material-ui.production.min.js +5 -5
- package/utils/hiHelpers.js +1 -1
@@ -4,17 +4,12 @@ import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutPropert
|
|
4
4
|
|
5
5
|
import React from 'react';
|
6
6
|
import PropTypes from 'prop-types';
|
7
|
-
|
8
|
-
import classNames from 'classnames';
|
9
7
|
import { findDOMNode } from 'react-dom';
|
10
8
|
import Grow from 'material-ui/transitions/Grow';
|
11
9
|
import Paper from 'material-ui/Paper';
|
12
|
-
import ClickAwayListener from 'material-ui/utils/ClickAwayListener';
|
13
10
|
import { Manager, Target, Popper } from 'react-popper';
|
14
|
-
|
15
11
|
import HiSelectableList from '../HiSelectableList';
|
16
12
|
import HiInput from '../HiForm/HiInput';
|
17
|
-
|
18
13
|
import { withStyles } from '../styles';
|
19
14
|
import { getNextItemSelectable } from '../utils/hiHelpers';
|
20
15
|
|
@@ -22,7 +17,7 @@ export const styles = theme => ({
|
|
22
17
|
root: {
|
23
18
|
backgroundColor: theme.palette.background2,
|
24
19
|
maxWidth: 500,
|
25
|
-
minWidth:
|
20
|
+
minWidth: 200,
|
26
21
|
width: '100%'
|
27
22
|
},
|
28
23
|
popper: {
|
@@ -31,9 +26,6 @@ export const styles = theme => ({
|
|
31
26
|
zIndex: 9,
|
32
27
|
top: '100%'
|
33
28
|
},
|
34
|
-
popperClose: {
|
35
|
-
pointerEvents: 'none'
|
36
|
-
},
|
37
29
|
paper: {
|
38
30
|
borderRadius: '0px 2px',
|
39
31
|
maxHeight: 440,
|
@@ -94,34 +86,29 @@ class HiSuggestSelect extends React.PureComponent {
|
|
94
86
|
};
|
95
87
|
|
96
88
|
this.handleSelect = this.handleSelect.bind(this);
|
97
|
-
this.handleClose = this.handleClose.bind(this);
|
98
89
|
this.handleBlur = this.handleBlur.bind(this);
|
90
|
+
this.handleFocus = this.handleFocus.bind(this);
|
99
91
|
}
|
100
92
|
|
101
93
|
componentWillReceiveProps(nextProps) {
|
102
94
|
this.setState({ options: nextProps.options });
|
103
95
|
}
|
104
96
|
|
105
|
-
handleClose() {
|
106
|
-
document.body.style.overflow = 'auto';
|
107
|
-
this.setState({
|
108
|
-
focused: false, // TODO - Make difference between open and focus
|
109
|
-
options: []
|
110
|
-
});
|
111
|
-
}
|
112
|
-
|
113
97
|
// Key down on list items
|
114
98
|
|
115
99
|
|
116
100
|
// Key down on search input
|
117
101
|
|
118
102
|
|
103
|
+
handleFocus() {
|
104
|
+
this.setState({ focused: true });
|
105
|
+
}
|
106
|
+
|
119
107
|
handleBlur(event) {
|
120
108
|
// Si on click sur un élément de HiInput, on garde le focus
|
121
109
|
// Par exemple sur l'icone reset
|
122
|
-
const overlay = this.overlay;
|
123
110
|
if (!event.relatedTarget || !this.overlay || !this.overlay.contains(event.relatedTarget)) {
|
124
|
-
this.setState({ options: [] });
|
111
|
+
this.setState({ options: [], focused: false });
|
125
112
|
}
|
126
113
|
}
|
127
114
|
|
@@ -131,7 +118,8 @@ class HiSuggestSelect extends React.PureComponent {
|
|
131
118
|
otherProps = _objectWithoutProperties(_props, ['classes', 'translations', 'id', 'onSearch']);
|
132
119
|
|
133
120
|
const { focused, options } = this.state;
|
134
|
-
const open = !!options.length;
|
121
|
+
const open = !!options.length && focused;
|
122
|
+
|
135
123
|
return React.createElement(
|
136
124
|
'div',
|
137
125
|
{
|
@@ -154,7 +142,8 @@ class HiSuggestSelect extends React.PureComponent {
|
|
154
142
|
},
|
155
143
|
onChange: onSearch,
|
156
144
|
onKeyDown: this.handleKeyDownSearch,
|
157
|
-
onBlur: this.handleBlur
|
145
|
+
onBlur: this.handleBlur,
|
146
|
+
onFocus: this.handleFocus
|
158
147
|
}))
|
159
148
|
),
|
160
149
|
open && React.createElement(
|
@@ -162,26 +151,22 @@ class HiSuggestSelect extends React.PureComponent {
|
|
162
151
|
{
|
163
152
|
placement: 'bottom-start',
|
164
153
|
eventsEnabled: open,
|
165
|
-
className:
|
154
|
+
className: classes.popper
|
166
155
|
},
|
167
156
|
React.createElement(
|
168
|
-
|
169
|
-
{
|
157
|
+
Grow,
|
158
|
+
{ 'in': open, id: 'menu-list', style: { transformOrigin: '0 0 0' } },
|
170
159
|
React.createElement(
|
171
|
-
|
172
|
-
{
|
173
|
-
React.createElement(
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
translations: translations,
|
182
|
-
onKeyDown: this.handleKeyDown
|
183
|
-
})
|
184
|
-
)
|
160
|
+
Paper,
|
161
|
+
{ className: classes.paper },
|
162
|
+
React.createElement(HiSelectableList, {
|
163
|
+
itemList: options,
|
164
|
+
selectedIdList: [],
|
165
|
+
checkbox: false,
|
166
|
+
onSelect: this.handleSelect,
|
167
|
+
translations: translations,
|
168
|
+
onKeyDown: this.handleKeyDown
|
169
|
+
})
|
185
170
|
)
|
186
171
|
)
|
187
172
|
)
|
@@ -12,78 +12,86 @@ import HiSuggestSelect from './HiSuggestSelect';
|
|
12
12
|
*/
|
13
13
|
class HiSuggestSelectField extends React.PureComponent {
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
15
|
+
render() {
|
16
|
+
const _props = this.props,
|
17
|
+
{
|
18
|
+
label,
|
19
|
+
required,
|
20
|
+
disabled,
|
21
|
+
error,
|
22
|
+
errorText,
|
23
|
+
helperText,
|
24
|
+
helperIcon,
|
25
|
+
id,
|
26
|
+
className
|
27
|
+
} = _props,
|
28
|
+
others = _objectWithoutProperties(_props, ['label', 'required', 'disabled', 'error', 'errorText', 'helperText', 'helperIcon', 'id', 'className']);
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
30
|
+
return React.createElement(
|
31
|
+
HiFormControl,
|
32
|
+
{
|
33
|
+
id: id,
|
34
|
+
label: label,
|
35
|
+
required: required,
|
36
|
+
disabled: disabled,
|
37
|
+
error: error,
|
38
|
+
errorText: errorText,
|
39
|
+
helperText: helperText,
|
40
|
+
helperIcon: helperIcon,
|
41
|
+
className: className
|
42
|
+
},
|
43
|
+
React.createElement(HiSuggestSelect, _extends({
|
44
|
+
id: id,
|
45
|
+
translations: {
|
46
|
+
all: 'Tous les pays',
|
47
|
+
no_result_match: 'Aucun résultat correspondant',
|
48
|
+
search: 'Recherche',
|
49
|
+
n_items_selected: '%s pays sélectionnés',
|
50
|
+
one_item_selected: '%s pays sélectionné'
|
51
|
+
},
|
52
|
+
disabled: disabled,
|
53
|
+
error: error
|
54
|
+
}, others))
|
55
|
+
);
|
56
|
+
}
|
53
57
|
}
|
54
58
|
|
55
59
|
HiSuggestSelectField.propTypes = process.env.NODE_ENV !== "production" ? {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
60
|
+
/**
|
61
|
+
* Surcharge des styles
|
62
|
+
*/
|
63
|
+
className: PropTypes.string,
|
64
|
+
/**
|
65
|
+
* Si `true`, l'input sera inactif.
|
66
|
+
*/
|
67
|
+
disabled: PropTypes.bool,
|
68
|
+
/**
|
69
|
+
* Si `true`, le champs sera en erreur.
|
70
|
+
*/
|
71
|
+
error: PropTypes.bool,
|
72
|
+
/**
|
73
|
+
* Texte de l'erreur
|
74
|
+
*/
|
75
|
+
errorText: PropTypes.string,
|
76
|
+
/**
|
77
|
+
* Si "true", le texte d'aide s'affichera seulement au clic sur l'icône "Information"
|
78
|
+
*/
|
79
|
+
helperIcon: PropTypes.bool,
|
80
|
+
/**
|
81
|
+
* Texte de l'aide
|
82
|
+
*/
|
83
|
+
helperText: PropTypes.string,
|
84
|
+
/**
|
85
|
+
* id de l'élément input
|
86
|
+
*/
|
87
|
+
id: PropTypes.string,
|
88
|
+
/**
|
89
|
+
* Label du champs
|
90
|
+
*/
|
91
|
+
label: PropTypes.string,
|
92
|
+
/**
|
93
|
+
* true si champs obligatoire
|
94
|
+
*/
|
95
|
+
required: PropTypes.bool
|
88
96
|
} : {};
|
89
97
|
export default HiSuggestSelectField;
|
@@ -47,7 +47,7 @@ export const styles = theme => ({
|
|
47
47
|
},
|
48
48
|
inkbar: {
|
49
49
|
'&:not($disabled)': {
|
50
|
-
'&:after': {
|
50
|
+
'&:not($error):after': {
|
51
51
|
backgroundColor: theme.palette.business.primary.normal,
|
52
52
|
left: 0,
|
53
53
|
bottom: 0,
|
@@ -135,7 +135,18 @@ class SelectInput extends React.PureComponent {
|
|
135
135
|
}
|
136
136
|
|
137
137
|
render() {
|
138
|
-
const {
|
138
|
+
const {
|
139
|
+
classes,
|
140
|
+
noButton,
|
141
|
+
disabled,
|
142
|
+
onClick,
|
143
|
+
value,
|
144
|
+
open,
|
145
|
+
focused,
|
146
|
+
error,
|
147
|
+
id,
|
148
|
+
refElement
|
149
|
+
} = this.props;
|
139
150
|
|
140
151
|
// On utilise classNames pour variabiliser les styles et merge les classes appliquées
|
141
152
|
const rootClass = classNames(classes.root, classes.inkbar, classes.underline, {
|
@@ -162,7 +173,10 @@ class SelectInput extends React.PureComponent {
|
|
162
173
|
onFocus: this.props.onFocus,
|
163
174
|
onBlur: this.props.onBlur,
|
164
175
|
role: 'button',
|
165
|
-
tabIndex: '0'
|
176
|
+
tabIndex: '0',
|
177
|
+
ref: el => {
|
178
|
+
refElement && refElement(el);
|
179
|
+
}
|
166
180
|
},
|
167
181
|
React.createElement(
|
168
182
|
'span',
|
@@ -181,7 +195,10 @@ class SelectInput extends React.PureComponent {
|
|
181
195
|
onMouseLeave: this.props.onMouseLeave,
|
182
196
|
onKeyDown: this.handleKeyDown,
|
183
197
|
onFocus: this.props.onFocus,
|
184
|
-
onBlur: this.props.onBlur
|
198
|
+
onBlur: this.props.onBlur,
|
199
|
+
buttonRef: el => {
|
200
|
+
refElement && refElement(el);
|
201
|
+
}
|
185
202
|
},
|
186
203
|
React.createElement(
|
187
204
|
'span',
|
@@ -216,6 +233,23 @@ SelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
216
233
|
* If `true`, the select will be disabled.
|
217
234
|
*/
|
218
235
|
disabled: PropTypes.bool,
|
236
|
+
/**
|
237
|
+
* Applique le style error
|
238
|
+
*/
|
239
|
+
error: PropTypes.bool,
|
240
|
+
/**
|
241
|
+
* Applique le style focused
|
242
|
+
*/
|
243
|
+
focused: PropTypes.bool,
|
244
|
+
/**
|
245
|
+
* id du select
|
246
|
+
*/
|
247
|
+
id: PropTypes.string,
|
248
|
+
/**
|
249
|
+
* Affiche sous forme de div à la place d'un bouton.
|
250
|
+
* Si des éléments cliquables sont à l'intérieur.
|
251
|
+
*/
|
252
|
+
noButton: PropTypes.bool,
|
219
253
|
/**
|
220
254
|
* Fonction de callback au blur du bouton
|
221
255
|
*/
|
@@ -232,30 +266,17 @@ SelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
232
266
|
* Fonction de callback à la pression de touche
|
233
267
|
*/
|
234
268
|
onKeyDown: PropTypes.func,
|
235
|
-
/**
|
236
|
-
* Valeur à afficher (déjà formattée)
|
237
|
-
*/
|
238
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.node]),
|
239
269
|
/**
|
240
270
|
* Applique le style open et effectue une rotation de l'icône
|
241
271
|
*/
|
242
272
|
open: PropTypes.bool,
|
243
273
|
/**
|
244
|
-
*
|
245
|
-
* Si des éléments cliquables sont à l'intérieur.
|
246
|
-
*/
|
247
|
-
noButton: PropTypes.bool,
|
248
|
-
/**
|
249
|
-
* Applique le style focused
|
250
|
-
*/
|
251
|
-
focused: PropTypes.bool,
|
252
|
-
/**
|
253
|
-
* Applique le style error
|
274
|
+
* Use that property to pass a ref callback to the native component.
|
254
275
|
*/
|
255
|
-
|
276
|
+
refElement: PropTypes.func,
|
256
277
|
/**
|
257
|
-
*
|
278
|
+
* Valeur à afficher (déjà formattée)
|
258
279
|
*/
|
259
|
-
|
280
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.node])
|
260
281
|
} : {};
|
261
282
|
export default withStyles(styles, { name: 'HmuiSelectInput' })(SelectInput);
|
@@ -37,9 +37,10 @@ class HiSelectableList extends React.PureComponent {
|
|
37
37
|
checkedIcon,
|
38
38
|
allSelected,
|
39
39
|
checkbox,
|
40
|
-
hierarchic
|
40
|
+
hierarchic,
|
41
|
+
disabledIds
|
41
42
|
} = _props,
|
42
|
-
others = _objectWithoutProperties(_props, ['classes', 'itemList', 'selectedIdList', 'onSelect', 'maxHeight', 'hierarchySelected', 'parentItemSelectable', 'hierarchy', 'translations', 'icon', 'parentIcon', 'hoverIcon', 'checkedIcon', 'allSelected', 'checkbox', 'hierarchic']);
|
43
|
+
others = _objectWithoutProperties(_props, ['classes', 'itemList', 'selectedIdList', 'onSelect', 'maxHeight', 'hierarchySelected', 'parentItemSelectable', 'hierarchy', 'translations', 'icon', 'parentIcon', 'hoverIcon', 'checkedIcon', 'allSelected', 'checkbox', 'hierarchic', 'disabledIds']);
|
43
44
|
|
44
45
|
let parents = [];
|
45
46
|
|
@@ -100,7 +101,8 @@ class HiSelectableList extends React.PureComponent {
|
|
100
101
|
hoverIcon: hoverIcon,
|
101
102
|
checkedIcon: checkedIcon,
|
102
103
|
checkbox: checkbox,
|
103
|
-
level: parents.length
|
104
|
+
level: parents.length,
|
105
|
+
disabled: disabledIds ? disabledIds.includes(item.id) : false
|
104
106
|
}, others));
|
105
107
|
})
|
106
108
|
)
|
@@ -140,6 +142,10 @@ HiSelectableList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
140
142
|
* Useful to extend the style applied to components.
|
141
143
|
*/
|
142
144
|
classes: PropTypes.object,
|
145
|
+
/**
|
146
|
+
* Liste des ids des items disabled
|
147
|
+
*/
|
148
|
+
disabledIds: PropTypes.array,
|
143
149
|
/**
|
144
150
|
* Tableau associatif : parentId => [children objects]
|
145
151
|
*/
|
@@ -55,6 +55,9 @@ export const styles = theme => ({
|
|
55
55
|
marginLeft: theme.spacing.unit
|
56
56
|
}),
|
57
57
|
listItemInfoText: _extends({
|
58
|
+
whiteSpace: 'nowrap',
|
59
|
+
overflow: 'hidden',
|
60
|
+
textOverflow: 'ellipsis',
|
58
61
|
color: theme.palette.neutral.normal
|
59
62
|
}, theme.typography.body4, {
|
60
63
|
fontWeight: theme.typography.fontWeightRegular,
|
@@ -358,18 +361,38 @@ HiSelectableListItem.defaultProps = {
|
|
358
361
|
}
|
359
362
|
};
|
360
363
|
HiSelectableListItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
364
|
+
/**
|
365
|
+
* Affiche une checkbox
|
366
|
+
*/
|
367
|
+
checkbox: PropTypes.bool,
|
368
|
+
/**
|
369
|
+
* Icon affiché lorsque l'item est sélectionné
|
370
|
+
*/
|
371
|
+
checkedIcon: PropTypes.node,
|
361
372
|
/**
|
362
373
|
* Useful to extend the style applied to components.
|
363
374
|
*/
|
364
375
|
classes: PropTypes.object,
|
365
376
|
/**
|
366
|
-
*
|
377
|
+
* Applique le style et désactive le click
|
367
378
|
*/
|
368
|
-
|
379
|
+
disabled: PropTypes.bool,
|
369
380
|
/**
|
370
|
-
*
|
381
|
+
* Si "true", liste avec hierarchie
|
371
382
|
*/
|
372
|
-
|
383
|
+
hierarchic: PropTypes.bool,
|
384
|
+
/**
|
385
|
+
* Icon affiché lorsque l'item n'est pas sélectionné et qu'on le survole
|
386
|
+
*/
|
387
|
+
hoverIcon: PropTypes.node,
|
388
|
+
/**
|
389
|
+
* Icon affiché lorsque l'item n'est pas sélectionné
|
390
|
+
*/
|
391
|
+
icon: PropTypes.node,
|
392
|
+
/**
|
393
|
+
* Items sélectionné partiellement
|
394
|
+
*/
|
395
|
+
indeterminate: PropTypes.bool,
|
373
396
|
/**
|
374
397
|
* Élément dont la structure attendue dépend du type
|
375
398
|
* paramètres requis:
|
@@ -377,65 +400,45 @@ HiSelectableListItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
377
400
|
* - label: string
|
378
401
|
*/
|
379
402
|
item: PropTypes.object.isRequired,
|
403
|
+
/**
|
404
|
+
* Padding par défaut des éléments
|
405
|
+
*/
|
406
|
+
leftPadding: PropTypes.number,
|
380
407
|
/**
|
381
408
|
* Niveau de l'item
|
382
409
|
*/
|
383
410
|
level: PropTypes.number,
|
384
411
|
/**
|
385
|
-
*
|
412
|
+
* Nombre d'items enfants
|
386
413
|
*/
|
387
|
-
|
414
|
+
nbChildren: PropTypes.number,
|
388
415
|
/**
|
389
416
|
* Fonction de callback à la sélection de l'élément
|
390
417
|
*/
|
391
418
|
onSelect: PropTypes.func,
|
392
419
|
/**
|
393
|
-
*
|
420
|
+
* Icon affiché lorsqu'un item parent n'est pas sélectionné
|
394
421
|
*/
|
395
|
-
|
422
|
+
parentIcon: PropTypes.node,
|
396
423
|
/**
|
397
|
-
*
|
424
|
+
* Affiche l'item en tant qu'item parent d'un groupe
|
398
425
|
*/
|
399
|
-
|
426
|
+
parentItem: PropTypes.bool,
|
400
427
|
/**
|
401
428
|
* Les items parents sont sélectionnables
|
402
429
|
*/
|
403
430
|
parentItemSelectable: PropTypes.bool,
|
404
431
|
/**
|
405
|
-
*
|
432
|
+
* État de l'élément
|
406
433
|
*/
|
407
|
-
|
434
|
+
selected: PropTypes.bool,
|
408
435
|
/**
|
409
436
|
* Traductions (par défaut en anglais)
|
410
437
|
*/
|
411
438
|
translations: PropTypes.object,
|
412
439
|
/**
|
413
|
-
*
|
414
|
-
*/
|
415
|
-
icon: PropTypes.node,
|
416
|
-
/**
|
417
|
-
* Icon affiché lorsqu'un item parent n'est pas sélectionné
|
418
|
-
*/
|
419
|
-
parentIcon: PropTypes.node,
|
420
|
-
/**
|
421
|
-
* Icon affiché lorsque l'item n'est pas sélectionné et qu'on le survole
|
422
|
-
*/
|
423
|
-
hoverIcon: PropTypes.node,
|
424
|
-
/**
|
425
|
-
* Icon affiché lorsque l'item est sélectionné
|
426
|
-
*/
|
427
|
-
checkedIcon: PropTypes.node,
|
428
|
-
/**
|
429
|
-
* Affiche une checkbox
|
430
|
-
*/
|
431
|
-
checkbox: PropTypes.bool,
|
432
|
-
/**
|
433
|
-
* Si "true", liste avec hierarchie
|
434
|
-
*/
|
435
|
-
hierarchic: PropTypes.bool,
|
436
|
-
/**
|
437
|
-
* Padding par défaut des éléments
|
440
|
+
* Type de l'élément
|
438
441
|
*/
|
439
|
-
|
442
|
+
type: PropTypes.string
|
440
443
|
} : {};
|
441
444
|
export default withStyles(styles, { name: 'HmuiHiSelectableList' })(HiSelectableListItem);
|
package/es/HiTable/HiTable.js
CHANGED
package/es/HiTopBar/HiTopBar.js
CHANGED
@@ -128,7 +128,7 @@ class HiTopBar extends React.Component {
|
|
128
128
|
menuAnchor: null
|
129
129
|
};
|
130
130
|
|
131
|
-
this.
|
131
|
+
this.handleCollapse = this.handleCollapse.bind(this);
|
132
132
|
this.handleClickMenu = this.handleClickMenu.bind(this);
|
133
133
|
this.handleOpenMenu = this.handleOpenMenu.bind(this);
|
134
134
|
this.handleCloseMenu = this.handleCloseMenu.bind(this);
|
@@ -148,7 +148,7 @@ class HiTopBar extends React.Component {
|
|
148
148
|
callback();
|
149
149
|
}
|
150
150
|
|
151
|
-
|
151
|
+
handleCollapse() {
|
152
152
|
this.setState({ collapsed: !this.state.collapsed });
|
153
153
|
}
|
154
154
|
|
@@ -168,6 +168,7 @@ class HiTopBar extends React.Component {
|
|
168
168
|
translations,
|
169
169
|
onClickMenu,
|
170
170
|
accountSelectorContent,
|
171
|
+
refButtons,
|
171
172
|
searchInput,
|
172
173
|
searchFocus
|
173
174
|
} = this.props;
|
@@ -204,15 +205,18 @@ class HiTopBar extends React.Component {
|
|
204
205
|
null,
|
205
206
|
React.createElement(
|
206
207
|
Collapse,
|
207
|
-
{
|
208
|
+
{
|
209
|
+
'in': !this.state.collapsed,
|
210
|
+
className: classNames({
|
208
211
|
[classes.collapseOverflow]: !hideable
|
209
|
-
})
|
212
|
+
})
|
213
|
+
},
|
210
214
|
React.createElement(
|
211
215
|
Toolbar,
|
212
216
|
{ className: classes.toolbar },
|
213
217
|
React.createElement(
|
214
218
|
'div',
|
215
|
-
{ ref:
|
219
|
+
{ ref: refButtons },
|
216
220
|
searchFocus ? React.createElement(
|
217
221
|
HiButton,
|
218
222
|
{
|
@@ -268,7 +272,7 @@ class HiTopBar extends React.Component {
|
|
268
272
|
(hideable || hasSettings) && React.createElement(
|
269
273
|
IconButton,
|
270
274
|
{ color: 'inherit', className: classes.iconButton },
|
271
|
-
hideable && React.createElement(ChevronDoubleUp, { onClick: this.
|
275
|
+
hideable && React.createElement(ChevronDoubleUp, { onClick: this.handleCollapse }),
|
272
276
|
hasSettings && React.createElement(HiIconBuilder, {
|
273
277
|
onClick: this.props.onClickSettings,
|
274
278
|
icon: 'fa-gear',
|
@@ -280,7 +284,7 @@ class HiTopBar extends React.Component {
|
|
280
284
|
hideable && this.state.collapsed && React.createElement(
|
281
285
|
IconButton,
|
282
286
|
{
|
283
|
-
onClick: this.
|
287
|
+
onClick: this.handleCollapse,
|
284
288
|
color: 'inherit',
|
285
289
|
className: classes.showTopBarButton
|
286
290
|
},
|
@@ -296,7 +300,7 @@ class HiTopBar extends React.Component {
|
|
296
300
|
{ className: classes.toolbar },
|
297
301
|
React.createElement(
|
298
302
|
'div',
|
299
|
-
{ ref:
|
303
|
+
{ ref: refButtons },
|
300
304
|
searchFocus ? React.createElement(
|
301
305
|
IconButton,
|
302
306
|
{ className: classes.leftButtonMobile, color: 'inherit' },
|
@@ -434,6 +438,10 @@ HiTopBar.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
434
438
|
* [here](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning).
|
435
439
|
*/
|
436
440
|
position: PropTypes.oneOf(['fixed', 'absolute', 'sticky', 'static']),
|
441
|
+
/**
|
442
|
+
* Passe une ref callback à la div contenant les boutons "menu" et "back"
|
443
|
+
*/
|
444
|
+
refButtons: PropTypes.func,
|
437
445
|
/**
|
438
446
|
* Etat de focus.
|
439
447
|
*/
|