@hipay/hipay-material-ui 2.0.0-beta.59 → 2.0.0-beta.60
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/CHANGELOG.md +58 -0
- package/HiCell/CellNumeric.js +1 -1
- 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 +20 -1
- package/HiForm/HiUpload.js +290 -45
- package/HiForm/HiUploadField.js +19 -51
- package/HiForm/HiUploadInput.js +18 -7
- package/HiSelectNew/HiDynamicSelect.js +3 -3
- package/HiSelectNew/HiNestedSelect.js +9 -9
- package/HiSelectNew/HiNestedSelectContent.js +9 -9
- package/HiSelectNew/HiSelect.js +22 -23
- package/HiSelectNew/HiSelectContent.js +7 -7
- package/HiSelectableList/HiSelectableListItem.js +3 -7
- package/README.md +1 -1
- package/es/HiCell/CellNumeric.js +1 -1
- 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 +19 -1
- package/es/HiForm/HiUpload.js +276 -35
- package/es/HiForm/HiUploadField.js +19 -43
- package/es/HiForm/HiUploadInput.js +16 -7
- package/es/HiSelectNew/HiSelect.js +15 -16
- package/es/HiSelectableList/HiSelectableListItem.js +3 -7
- 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 +29594 -21713
- 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
|
*/
|
|
@@ -209,22 +209,20 @@ class HiSelect extends React.PureComponent {
|
|
|
209
209
|
};
|
|
210
210
|
|
|
211
211
|
this.focusOnSelectedItem = selectedValue => {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
212
|
+
setTimeout(() => {
|
|
213
|
+
// On initialise au premier élément pour être sûr de ne pas se retrouver avec un focus of undefined
|
|
214
|
+
let item = this.overlay.getElementsByTagName('li')[0];
|
|
215
|
+
|
|
216
|
+
if (selectedValue && typeof selectedValue === 'string') {
|
|
217
|
+
item = this.overlay.getElementsByTagName('li')[selectedValue];
|
|
218
|
+
} else if (selectedValue && typeof selectedValue === 'number') {
|
|
219
|
+
item = this.overlay.getElementsByTagName('li')[selectedValue - 1];
|
|
220
|
+
}
|
|
222
221
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
222
|
+
if (item) {
|
|
223
|
+
item.focus();
|
|
224
|
+
}
|
|
225
|
+
}, 1);
|
|
228
226
|
};
|
|
229
227
|
|
|
230
228
|
this.handleClickAway = event => {
|
|
@@ -457,11 +455,12 @@ class HiSelect extends React.PureComponent {
|
|
|
457
455
|
suggestions: props.options,
|
|
458
456
|
openDown: true
|
|
459
457
|
};
|
|
458
|
+
this.handleBlur = this.handleBlur.bind(this);
|
|
460
459
|
this.handleClick = this.handleClick.bind(this);
|
|
461
460
|
this.handleClose = this.handleClose.bind(this);
|
|
462
461
|
this.handleClickAway = this.handleClickAway.bind(this);
|
|
463
462
|
this.handleFocus = this.handleFocus.bind(this);
|
|
464
|
-
this.
|
|
463
|
+
this.handleKeyDownInput = this.handleKeyDownInput.bind(this);
|
|
465
464
|
this.handleSearch = this.handleSearch.bind(this);
|
|
466
465
|
this.handleSearchReset = this.handleSearchReset.bind(this);
|
|
467
466
|
this.handleSelect = this.handleSelect.bind(this);
|
|
@@ -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
|
}
|
|
@@ -91,7 +91,7 @@ export const styles = theme => ({
|
|
|
91
91
|
'& strong': {
|
|
92
92
|
fontWeight: theme.typography.fontWeightMedium
|
|
93
93
|
},
|
|
94
|
-
display: '
|
|
94
|
+
display: 'contents'
|
|
95
95
|
}),
|
|
96
96
|
listItemContentSelected: {},
|
|
97
97
|
label: {
|
|
@@ -121,7 +121,6 @@ export const styles = theme => ({
|
|
|
121
121
|
fontSize: 12,
|
|
122
122
|
textOverflow: 'ellipsis',
|
|
123
123
|
textAlign: 'right',
|
|
124
|
-
padding: '4px 0px 4px 8px',
|
|
125
124
|
alignSelf: 'center'
|
|
126
125
|
}),
|
|
127
126
|
img: {
|
|
@@ -135,7 +134,7 @@ export const styles = theme => ({
|
|
|
135
134
|
verticalAlign: 'middle'
|
|
136
135
|
},
|
|
137
136
|
labelContent: {
|
|
138
|
-
display: 'flex',
|
|
137
|
+
display: '-webkit-flex',
|
|
139
138
|
alignItems: 'center',
|
|
140
139
|
maxWidth: '85%',
|
|
141
140
|
'&$labelWithoutSecondaryInline': {
|
|
@@ -153,9 +152,6 @@ export const styles = theme => ({
|
|
|
153
152
|
},
|
|
154
153
|
'&$infosWithoutSecondaryInline': {
|
|
155
154
|
paddingLeft: 28
|
|
156
|
-
},
|
|
157
|
-
'&$infosWithSecondaryInline': {
|
|
158
|
-
marginTop: -8
|
|
159
155
|
}
|
|
160
156
|
},
|
|
161
157
|
infosInlineWithoutSecondary: {},
|
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",
|