@hipay/hipay-material-ui 2.0.0-beta.58 → 2.0.0-beta.60
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +117 -0
- package/HiCell/CellNumeric.js +1 -1
- package/HiColoredLabel/HiColoredLabel.js +16 -4
- package/HiDatePicker/HiDatePicker.js +11 -2
- package/HiDatePicker/HiDateRangePicker.js +49 -8
- package/HiDatePicker/HiDateRangeSelector.js +39 -30
- package/HiDatePicker/Overlays/YearPickerOverlay.js +8 -3
- package/HiForm/HiFormControl.js +26 -11
- package/HiForm/HiFormLabel.js +3 -1
- package/HiForm/HiInput.js +33 -1
- package/HiForm/HiUpload.js +290 -45
- package/HiForm/HiUploadField.js +19 -51
- package/HiForm/HiUploadInput.js +18 -7
- package/HiSelect/HiSuggestSelect.js +3 -3
- package/HiSelectNew/HiDynamicSelect.js +3 -3
- package/HiSelectNew/HiNestedSelect.js +29 -15
- package/HiSelectNew/HiNestedSelectContent.js +29 -15
- package/HiSelectNew/HiSelect.js +23 -12
- package/HiSelectNew/HiSelectContent.js +23 -11
- package/HiSelectNew/HiSelectInput.js +4 -4
- package/HiSelectableList/HiSelectableListItem.js +8 -10
- package/README.md +1 -1
- package/es/HiCell/CellNumeric.js +1 -1
- package/es/HiColoredLabel/HiColoredLabel.js +21 -4
- package/es/HiDatePicker/HiDatePicker.js +11 -2
- package/es/HiDatePicker/HiDateRangePicker.js +42 -8
- package/es/HiDatePicker/HiDateRangeSelector.js +38 -27
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +8 -3
- package/es/HiForm/HiFormControl.js +27 -11
- package/es/HiForm/HiFormLabel.js +3 -1
- package/es/HiForm/HiInput.js +32 -1
- package/es/HiForm/HiUpload.js +276 -35
- package/es/HiForm/HiUploadField.js +19 -43
- package/es/HiForm/HiUploadInput.js +16 -7
- package/es/HiSelect/HiSuggestSelect.js +3 -3
- package/es/HiSelectNew/HiNestedSelect.js +17 -7
- package/es/HiSelectNew/HiNestedSelectContent.js +16 -6
- package/es/HiSelectNew/HiSelect.js +15 -3
- package/es/HiSelectNew/HiSelectContent.js +11 -2
- package/es/HiSelectNew/HiSelectInput.js +4 -3
- package/es/HiSelectableList/HiSelectableListItem.js +8 -10
- package/es/utils/helpers.js +6 -5
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +3 -2
- package/umd/hipay-material-ui.development.js +4632 -1923
- package/umd/hipay-material-ui.production.min.js +2 -2
- package/utils/helpers.js +6 -4
@@ -16,6 +16,7 @@ export const styles = theme => ({
|
|
16
16
|
height: 40,
|
17
17
|
display: 'inline-flex',
|
18
18
|
justifyContent: 'flex-start',
|
19
|
+
cursor: 'pointer',
|
19
20
|
'&$focused, &$dragOver': {
|
20
21
|
backgroundColor: theme.palette.global.background1
|
21
22
|
},
|
@@ -82,7 +83,7 @@ export const styles = theme => ({
|
|
82
83
|
transform: 'scaleX(1)'
|
83
84
|
},
|
84
85
|
'&$error': {
|
85
|
-
borderBottom: `1px solid ${theme.palette.negative.
|
86
|
+
borderBottom: `1px solid ${theme.palette.negative.main}`
|
86
87
|
}
|
87
88
|
}
|
88
89
|
},
|
@@ -90,7 +91,8 @@ export const styles = theme => ({
|
|
90
91
|
color: `${theme.palette.action.disabled}`,
|
91
92
|
'&:before': {
|
92
93
|
display: 'none'
|
93
|
-
}
|
94
|
+
},
|
95
|
+
cursor: 'default'
|
94
96
|
},
|
95
97
|
focused: {
|
96
98
|
backgroundColor: theme.palette.background3
|
@@ -107,6 +109,7 @@ export const styles = theme => ({
|
|
107
109
|
height: 39,
|
108
110
|
display: 'inline-flex',
|
109
111
|
width: '100%',
|
112
|
+
cursor: 'pointer',
|
110
113
|
'&$empty': {
|
111
114
|
opacity: 0.42
|
112
115
|
}
|
@@ -130,7 +133,7 @@ export const styles = theme => ({
|
|
130
133
|
}),
|
131
134
|
'&:hover': {
|
132
135
|
color: 'inherit',
|
133
|
-
|
136
|
+
background: 'none'
|
134
137
|
}
|
135
138
|
}
|
136
139
|
});
|
@@ -298,6 +301,10 @@ class HiUploadInput extends React.Component {
|
|
298
301
|
[classes.dragOver]: dragOver,
|
299
302
|
[classes.droppable]: droppable
|
300
303
|
});
|
304
|
+
const eyeButton = React.createElement(HiIconButton, {
|
305
|
+
className: classes.icon,
|
306
|
+
onClick: this.handleSeeFile
|
307
|
+
}, _ref);
|
301
308
|
return React.createElement("div", {
|
302
309
|
className: rootClass
|
303
310
|
}, React.createElement("label", {
|
@@ -314,10 +321,7 @@ class HiUploadInput extends React.Component {
|
|
314
321
|
onChange: this.handleChange
|
315
322
|
})), value === null || React.createElement("div", {
|
316
323
|
className: classes.endAdornment
|
317
|
-
}, React.createElement(HiIconButton, {
|
318
|
-
className: classes.icon,
|
319
|
-
onClick: this.handleSeeFile
|
320
|
-
}, _ref), React.createElement(HiIconButton, {
|
324
|
+
}, this.props.seeFile && eyeButton, React.createElement(HiIconButton, {
|
321
325
|
className: classes.icon,
|
322
326
|
onClick: this.handleDeleteFile
|
323
327
|
}, _ref2)));
|
@@ -395,6 +399,11 @@ HiUploadInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
395
399
|
*/
|
396
400
|
placeholder: PropTypes.string,
|
397
401
|
|
402
|
+
/**
|
403
|
+
* set to false to hide the eye button
|
404
|
+
*/
|
405
|
+
seeFile: PropTypes.bool,
|
406
|
+
|
398
407
|
/**
|
399
408
|
* The translations of the error messages.
|
400
409
|
*/
|
@@ -144,10 +144,10 @@ class HiSuggestSelect extends React.PureComponent {
|
|
144
144
|
options: [],
|
145
145
|
focused: false
|
146
146
|
});
|
147
|
-
}
|
148
147
|
|
149
|
-
|
150
|
-
|
148
|
+
if (this.props.onBlurInput) {
|
149
|
+
this.props.onBlurInput(event);
|
150
|
+
}
|
151
151
|
}
|
152
152
|
}
|
153
153
|
|
@@ -45,6 +45,10 @@ function findFinalItemRecursively(itemList, searchId) {
|
|
45
45
|
});
|
46
46
|
return foundItem;
|
47
47
|
}
|
48
|
+
|
49
|
+
export var filterValue = function (item, searchValue) {
|
50
|
+
return searchValue === '' || foldAccents(item.label.toString().toLowerCase()).search(foldAccents(searchValue.toLowerCase())) !== -1;
|
51
|
+
};
|
48
52
|
/**
|
49
53
|
* Build item list by settings item props relative to the nested parent/child situation
|
50
54
|
* Reduce the item list to build specified items (displayed, pinned, disabled, selected, indeterminate)
|
@@ -62,15 +66,14 @@ function findFinalItemRecursively(itemList, searchId) {
|
|
62
66
|
* @returns {*}
|
63
67
|
*/
|
64
68
|
|
65
|
-
|
66
|
-
function buildFilteredItemList(itemList, selectedItemIdList = [], searchValue = '', visibleParent = false, pinnedParent = false, disabledParent = false, nbChildrenAsInfo = false, translations) {
|
69
|
+
function buildFilteredItemList(itemList, selectedItemIdList = [], searchValue = '', visibleParent = false, pinnedParent = false, disabledParent = false, nbChildrenAsInfo = false, translations, filterFunc = filterValue) {
|
67
70
|
return itemList.reduce(({
|
68
71
|
l: memoItemList,
|
69
72
|
s: memoSelected,
|
70
73
|
u: memoUnselected,
|
71
74
|
v: memoVisible
|
72
75
|
}, item) => {
|
73
|
-
const itemVisible =
|
76
|
+
const itemVisible = filterFunc(item, searchValue); // Parent item
|
74
77
|
|
75
78
|
if (item.children) {
|
76
79
|
const {
|
@@ -78,7 +81,7 @@ function buildFilteredItemList(itemList, selectedItemIdList = [], searchValue =
|
|
78
81
|
s: selected,
|
79
82
|
u: unselected,
|
80
83
|
v: visible
|
81
|
-
} = buildFilteredItemList(item.children, selectedItemIdList, searchValue, itemVisible, pinnedParent, disabledParent);
|
84
|
+
} = buildFilteredItemList(item.children, selectedItemIdList, searchValue, itemVisible, pinnedParent, disabledParent, nbChildrenAsInfo, translations, filterFunc);
|
82
85
|
|
83
86
|
if (nbChildrenAsInfo) {
|
84
87
|
item.info = translations.n_children.replace('%s', item.children.length);
|
@@ -227,7 +230,8 @@ class HiNestedSelect extends React.PureComponent {
|
|
227
230
|
multiple,
|
228
231
|
nbChildrenAsInfo,
|
229
232
|
pinnedParent,
|
230
|
-
translations
|
233
|
+
translations,
|
234
|
+
filterFunc
|
231
235
|
} = this.props; // build item list
|
232
236
|
|
233
237
|
const {
|
@@ -235,7 +239,7 @@ class HiNestedSelect extends React.PureComponent {
|
|
235
239
|
s: allSelected,
|
236
240
|
u: allUnselected,
|
237
241
|
v: visible
|
238
|
-
} = buildFilteredItemList(options, value, search, false, pinnedParent, disabledParent || !multiple, nbChildrenAsInfo, translations);
|
242
|
+
} = buildFilteredItemList(options, value, search, false, pinnedParent, disabledParent || !multiple, nbChildrenAsInfo, translations, filterFunc);
|
239
243
|
const itemList = !visible ? [...(loading ? [{
|
240
244
|
id: '_loading',
|
241
245
|
type: 'loader',
|
@@ -367,7 +371,8 @@ HiNestedSelect.defaultProps = {
|
|
367
371
|
one_item_selected: '%s item selected',
|
368
372
|
n_children: '%s',
|
369
373
|
one_child: '%s item'
|
370
|
-
}
|
374
|
+
},
|
375
|
+
filterFunc: filterValue
|
371
376
|
};
|
372
377
|
HiNestedSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
373
378
|
/**
|
@@ -385,6 +390,11 @@ HiNestedSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
385
390
|
*/
|
386
391
|
displayAsChip: PropTypes.bool,
|
387
392
|
|
393
|
+
/*
|
394
|
+
* Fonction de filtrage custom
|
395
|
+
*/
|
396
|
+
filterFunc: PropTypes.func,
|
397
|
+
|
388
398
|
/**
|
389
399
|
* Affiche l'élément 'All'
|
390
400
|
*/
|
@@ -42,6 +42,9 @@ export function findFinalItemRecursively(itemList, searchId) {
|
|
42
42
|
});
|
43
43
|
return foundItem;
|
44
44
|
}
|
45
|
+
export var filterValue = function (item, searchValue) {
|
46
|
+
return searchValue === '' || foldAccents(item.label.toString().toLowerCase()).search(foldAccents(searchValue.toLowerCase())) !== -1;
|
47
|
+
};
|
45
48
|
/**
|
46
49
|
* Build item list by settings item props relative to the nested parent/child situation
|
47
50
|
* Reduce the item list to build specified items (displayed, pinned, disabled, selected, indeterminate)
|
@@ -59,14 +62,14 @@ export function findFinalItemRecursively(itemList, searchId) {
|
|
59
62
|
* @returns {*}
|
60
63
|
*/
|
61
64
|
|
62
|
-
function buildFilteredItemList(itemList, selectedItemIdList = [], searchValue = '', visibleParent = false, pinnedParent = false, disabledParent = false, nbChildrenAsInfo = false, translations) {
|
65
|
+
function buildFilteredItemList(itemList, selectedItemIdList = [], searchValue = '', visibleParent = false, pinnedParent = false, disabledParent = false, nbChildrenAsInfo = false, translations, filterFunc = filterValue) {
|
63
66
|
return itemList.reduce(({
|
64
67
|
l: memoItemList,
|
65
68
|
s: memoSelected,
|
66
69
|
u: memoUnselected,
|
67
70
|
v: memoVisible
|
68
71
|
}, item) => {
|
69
|
-
const itemVisible =
|
72
|
+
const itemVisible = filterFunc(item, searchValue); // Parent item
|
70
73
|
|
71
74
|
if (item.children) {
|
72
75
|
const {
|
@@ -74,7 +77,7 @@ function buildFilteredItemList(itemList, selectedItemIdList = [], searchValue =
|
|
74
77
|
s: selected,
|
75
78
|
u: unselected,
|
76
79
|
v: visible
|
77
|
-
} = buildFilteredItemList(item.children, selectedItemIdList, searchValue, itemVisible, pinnedParent, disabledParent);
|
80
|
+
} = buildFilteredItemList(item.children, selectedItemIdList, searchValue, itemVisible, pinnedParent, disabledParent, nbChildrenAsInfo, translations, filterFunc);
|
78
81
|
|
79
82
|
if (nbChildrenAsInfo) {
|
80
83
|
item.info = translations.n_children.replace('%s', item.children.length);
|
@@ -181,7 +184,8 @@ class HiNestedSelectContent extends React.PureComponent {
|
|
181
184
|
multiple,
|
182
185
|
nbChildrenAsInfo,
|
183
186
|
pinnedParent,
|
184
|
-
translations
|
187
|
+
translations,
|
188
|
+
filterFunc
|
185
189
|
} = this.props; // build item list
|
186
190
|
|
187
191
|
const {
|
@@ -189,7 +193,7 @@ class HiNestedSelectContent extends React.PureComponent {
|
|
189
193
|
s: allSelected,
|
190
194
|
u: allUnselected,
|
191
195
|
v: visible
|
192
|
-
} = buildFilteredItemList(options, value, search, false, pinnedParent, disabledParent || !multiple, nbChildrenAsInfo, translations);
|
196
|
+
} = buildFilteredItemList(options, value, search, false, pinnedParent, disabledParent || !multiple, nbChildrenAsInfo, translations, filterFunc);
|
193
197
|
const itemList = !visible ? [...(loading ? [{
|
194
198
|
id: '_loading',
|
195
199
|
type: 'loader',
|
@@ -272,7 +276,8 @@ HiNestedSelectContent.defaultProps = {
|
|
272
276
|
search: 'Search',
|
273
277
|
n_children: '%s',
|
274
278
|
one_child: '%s item'
|
275
|
-
}
|
279
|
+
},
|
280
|
+
filterFunc: filterValue
|
276
281
|
};
|
277
282
|
HiNestedSelectContent.propTypes = process.env.NODE_ENV !== "production" ? {
|
278
283
|
/**
|
@@ -285,6 +290,11 @@ HiNestedSelectContent.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
285
290
|
*/
|
286
291
|
disabledParent: PropTypes.bool,
|
287
292
|
|
293
|
+
/*
|
294
|
+
* Fonction de filtrage custom
|
295
|
+
*/
|
296
|
+
filterFunc: PropTypes.func,
|
297
|
+
|
288
298
|
/**
|
289
299
|
* Affiche l'élément 'All'
|
290
300
|
*/
|
@@ -68,6 +68,10 @@ export const styles = theme => ({
|
|
68
68
|
borderTop: `1px solid ${theme.palette.input.bottomLine}`
|
69
69
|
}
|
70
70
|
});
|
71
|
+
|
72
|
+
function filterValue(item, search) {
|
73
|
+
return search === '' || foldAccents(item.label.toString().toLowerCase()).search(foldAccents(search.toLowerCase())) !== -1;
|
74
|
+
}
|
71
75
|
/**
|
72
76
|
*
|
73
77
|
* Utilisé pour tous types de selects dans les formulaires.
|
@@ -83,6 +87,7 @@ export const styles = theme => ({
|
|
83
87
|
* - HiSelectableList : affiche la liste des suggestions selon le type des éléments
|
84
88
|
*/
|
85
89
|
|
90
|
+
|
86
91
|
class HiSelect extends React.PureComponent {
|
87
92
|
constructor(props) {
|
88
93
|
super(props);
|
@@ -97,7 +102,7 @@ class HiSelect extends React.PureComponent {
|
|
97
102
|
hideCheckbox: true,
|
98
103
|
label: 'loading'
|
99
104
|
}] : []), // simple one level filter on label
|
100
|
-
...(search !== '' ? [...options.filter(item =>
|
105
|
+
...(search !== '' ? [...options.filter(item => this.props.filterFunc(item, search))] : [...(this.props.hasAll ? [_objectSpread({
|
101
106
|
id: '_all',
|
102
107
|
label: this.props.translations.all
|
103
108
|
}, this.props.iconAll && {
|
@@ -450,11 +455,12 @@ class HiSelect extends React.PureComponent {
|
|
450
455
|
suggestions: props.options,
|
451
456
|
openDown: true
|
452
457
|
};
|
458
|
+
this.handleBlur = this.handleBlur.bind(this);
|
453
459
|
this.handleClick = this.handleClick.bind(this);
|
454
460
|
this.handleClose = this.handleClose.bind(this);
|
455
461
|
this.handleClickAway = this.handleClickAway.bind(this);
|
456
462
|
this.handleFocus = this.handleFocus.bind(this);
|
457
|
-
this.
|
463
|
+
this.handleKeyDownInput = this.handleKeyDownInput.bind(this);
|
458
464
|
this.handleSearch = this.handleSearch.bind(this);
|
459
465
|
this.handleSearchReset = this.handleSearchReset.bind(this);
|
460
466
|
this.handleSelect = this.handleSelect.bind(this);
|
@@ -676,7 +682,8 @@ HiSelect.defaultProps = {
|
|
676
682
|
n_children: '%s items',
|
677
683
|
one_child: '%s item'
|
678
684
|
},
|
679
|
-
type: 'text'
|
685
|
+
type: 'text',
|
686
|
+
filterFunc: filterValue
|
680
687
|
};
|
681
688
|
HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
682
689
|
align: PropTypes.oneOf(['left', 'right']),
|
@@ -711,6 +718,11 @@ HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
711
718
|
*/
|
712
719
|
fallbackImage: PropTypes.string,
|
713
720
|
|
721
|
+
/*
|
722
|
+
* Fonction de filtrage custom
|
723
|
+
*/
|
724
|
+
filterFunc: PropTypes.func,
|
725
|
+
|
714
726
|
/**
|
715
727
|
* Affiche l'élément 'All'
|
716
728
|
*/
|
@@ -37,6 +37,9 @@ export const styles = theme => ({
|
|
37
37
|
width: '100%'
|
38
38
|
})
|
39
39
|
});
|
40
|
+
export var filterValue = function (item, searchValue) {
|
41
|
+
return searchValue === '' || foldAccents(item.label.toString().toLowerCase()).search(foldAccents(searchValue.toLowerCase())) !== -1;
|
42
|
+
};
|
40
43
|
/**
|
41
44
|
*
|
42
45
|
* Utilisé pour tous types de selects dans les formulaires.
|
@@ -197,7 +200,7 @@ class HiSelectContent extends React.PureComponent {
|
|
197
200
|
hideCheckbox: true,
|
198
201
|
label: 'loading'
|
199
202
|
}] : []), // simple one level filter on label
|
200
|
-
...(search !== '' ? [...options.filter(item => item.label &&
|
203
|
+
...(search !== '' ? [...options.filter(item => item.label && this.props.filterFunc(item, search))] : [...(this.props.hasAll ? [_objectSpread({
|
201
204
|
id: '_all',
|
202
205
|
label: this.props.translations.all
|
203
206
|
}, this.props.iconAll && {
|
@@ -331,7 +334,8 @@ HiSelectContent.defaultProps = {
|
|
331
334
|
n_children: '%s items',
|
332
335
|
one_child: '%s item'
|
333
336
|
},
|
334
|
-
type: 'text'
|
337
|
+
type: 'text',
|
338
|
+
filterFunc: filterValue
|
335
339
|
};
|
336
340
|
HiSelectContent.propTypes = process.env.NODE_ENV !== "production" ? {
|
337
341
|
autoHeight: PropTypes.bool,
|
@@ -356,6 +360,11 @@ HiSelectContent.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
356
360
|
*/
|
357
361
|
fallbackImage: PropTypes.string,
|
358
362
|
|
363
|
+
/*
|
364
|
+
* Fonction de filtrage custom
|
365
|
+
*/
|
366
|
+
filterFunc: PropTypes.func,
|
367
|
+
|
359
368
|
/**
|
360
369
|
* Affiche l'élément 'All'
|
361
370
|
*/
|
@@ -127,7 +127,6 @@ class HiSelectInput extends React.PureComponent {
|
|
127
127
|
|
128
128
|
if (this.props.onKeyDown) {
|
129
129
|
this.props.onKeyDown(event);
|
130
|
-
event.preventDefault();
|
131
130
|
} else if (key === 'down' || key === 'up') {
|
132
131
|
this.props.onClick();
|
133
132
|
} else if (key === 'enter' && this.props.onSubmit) {
|
@@ -167,9 +166,11 @@ class HiSelectInput extends React.PureComponent {
|
|
167
166
|
this.handleBlur = event => {
|
168
167
|
if ((!this.input || !this.input.contains(event.relatedTarget)) && this.props.onBlur) {
|
169
168
|
this.props.onBlur(event);
|
170
|
-
} else if (this.input && (!this.resetIcon || !this.resetIcon.contains(event.relatedTarget))) {
|
171
|
-
this.input.focus();
|
172
169
|
}
|
170
|
+
/* else if (this.input && (!this.resetIcon || !this.resetIcon.contains(event.relatedTarget))) {
|
171
|
+
this.input.focus();
|
172
|
+
}*/
|
173
|
+
|
173
174
|
};
|
174
175
|
|
175
176
|
this.ref = el => {
|
@@ -34,7 +34,7 @@ export const styles = theme => ({
|
|
34
34
|
display: 'block'
|
35
35
|
},
|
36
36
|
'&$inline': {
|
37
|
-
|
37
|
+
minHeight: 40,
|
38
38
|
'& $secondaryLabel': {
|
39
39
|
display: 'inline-block'
|
40
40
|
}
|
@@ -85,12 +85,13 @@ export const styles = theme => ({
|
|
85
85
|
minWidth: '50%',
|
86
86
|
padding: '5px 0',
|
87
87
|
'&$listItemContentSelected': {
|
88
|
-
marginBottom:
|
88
|
+
marginBottom: 1,
|
89
89
|
marginLeft: -4
|
90
90
|
},
|
91
91
|
'& strong': {
|
92
92
|
fontWeight: theme.typography.fontWeightMedium
|
93
|
-
}
|
93
|
+
},
|
94
|
+
display: 'contents'
|
94
95
|
}),
|
95
96
|
listItemContentSelected: {},
|
96
97
|
label: {
|
@@ -120,7 +121,6 @@ export const styles = theme => ({
|
|
120
121
|
fontSize: 12,
|
121
122
|
textOverflow: 'ellipsis',
|
122
123
|
textAlign: 'right',
|
123
|
-
padding: '4px 0px 4px 8px',
|
124
124
|
alignSelf: 'center'
|
125
125
|
}),
|
126
126
|
img: {
|
@@ -134,9 +134,9 @@ export const styles = theme => ({
|
|
134
134
|
verticalAlign: 'middle'
|
135
135
|
},
|
136
136
|
labelContent: {
|
137
|
-
display: 'flex',
|
137
|
+
display: '-webkit-flex',
|
138
138
|
alignItems: 'center',
|
139
|
-
maxWidth: '
|
139
|
+
maxWidth: '85%',
|
140
140
|
'&$labelWithoutSecondaryInline': {
|
141
141
|
maxWidth: '100%'
|
142
142
|
}
|
@@ -152,9 +152,6 @@ export const styles = theme => ({
|
|
152
152
|
},
|
153
153
|
'&$infosWithoutSecondaryInline': {
|
154
154
|
paddingLeft: 28
|
155
|
-
},
|
156
|
-
'&$infosWithSecondaryInline': {
|
157
|
-
marginTop: -8
|
158
155
|
}
|
159
156
|
},
|
160
157
|
infosInlineWithoutSecondary: {},
|
@@ -225,7 +222,8 @@ class HiSelectableListItem extends React.PureComponent {
|
|
225
222
|
}
|
226
223
|
|
227
224
|
return React.createElement("div", {
|
228
|
-
className: classes.label
|
225
|
+
className: classes.label,
|
226
|
+
title: label
|
229
227
|
}, label);
|
230
228
|
}
|
231
229
|
|
package/es/utils/helpers.js
CHANGED
@@ -121,7 +121,7 @@ export function formatNumber(number, size = 'l', locale = 'en-EN', precision) {
|
|
121
121
|
break;
|
122
122
|
}
|
123
123
|
|
124
|
-
const effectivePrecision = precision
|
124
|
+
const effectivePrecision = Number.isInteger(precision) ? precision : size === 'l' ? 2 : 0; // To locale
|
125
125
|
|
126
126
|
const options = {
|
127
127
|
minimumFractionDigits: effectivePrecision,
|
@@ -147,7 +147,7 @@ export function formatNumber(number, size = 'l', locale = 'en-EN', precision) {
|
|
147
147
|
* @param currency - ISO 4217
|
148
148
|
*/
|
149
149
|
|
150
|
-
export function formatCurrencyAmount(amount, size = 'l', locale = 'en-EN', currency = 'EUR') {
|
150
|
+
export function formatCurrencyAmount(amount, size = 'l', locale = 'en-EN', currency = 'EUR', precision = null) {
|
151
151
|
let value = amount;
|
152
152
|
let unit = ''; // Round number
|
153
153
|
|
@@ -172,12 +172,13 @@ export function formatCurrencyAmount(amount, size = 'l', locale = 'en-EN', curre
|
|
172
172
|
default:
|
173
173
|
value = Math.round(amount * 100) / 100;
|
174
174
|
break;
|
175
|
-
}
|
175
|
+
}
|
176
176
|
|
177
|
+
const effectivePrecision = Number.isInteger(precision) ? precision : size === 'l' ? 2 : 0; // To locale
|
177
178
|
|
178
179
|
const options = {
|
179
|
-
minimumFractionDigits:
|
180
|
-
maximumFractionDigits:
|
180
|
+
minimumFractionDigits: effectivePrecision,
|
181
|
+
maximumFractionDigits: effectivePrecision,
|
181
182
|
useGrouping: true,
|
182
183
|
style: 'currency',
|
183
184
|
currency,
|
package/index.es.js
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@hipay/hipay-material-ui",
|
3
3
|
"private": false,
|
4
4
|
"author": "HiPay PSYCHE Team",
|
5
|
-
"version": "2.0.0-beta.
|
5
|
+
"version": "2.0.0-beta.60",
|
6
6
|
"description": "React components that implement Google's Material Design.",
|
7
7
|
"keywords": [
|
8
8
|
"react",
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"type": "git",
|
17
17
|
"url": "https://gitlab.hipay.org/backend/hipay-material-ui.git"
|
18
18
|
},
|
19
|
-
"license": "
|
19
|
+
"license": "UNLICENSED",
|
20
20
|
"bugs": {
|
21
21
|
"url": "https://gitlab.hipay.org/backend/hipay-material-ui/issues"
|
22
22
|
},
|
@@ -50,6 +50,7 @@
|
|
50
50
|
"leaflet": "^1.3.4",
|
51
51
|
"mdi-material-ui": "^5.4.0",
|
52
52
|
"moment": "^2.22.2",
|
53
|
+
"moment-timezone": "^0.5.23",
|
53
54
|
"normalize-scroll-left": "^0.1.2",
|
54
55
|
"popper.js": "^1.14.1",
|
55
56
|
"prop-types": "^15.6.0",
|