@hipay/hipay-material-ui 2.0.0-beta.55 → 2.0.0-beta.57
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +116 -0
- package/HiBreadcrumb/HiBreadcrumb.js +14 -4
- package/HiBreadcrumb/HiStep.js +4 -1
- package/HiBreadcrumb/HiStepContent.js +0 -1
- package/HiBreadcrumb/HiStepLabel.js +12 -4
- package/HiBreadcrumb/HiStepper.js +1 -1
- package/HiButton/HiButton.js +7 -1
- package/HiCell/CellIcon.js +4 -4
- package/HiCell/CellImage.js +13 -1
- package/HiCell/CellRate.js +6 -3
- package/HiCell/CellSentinel.js +7 -10
- package/HiCell/CellTextStyled.js +29 -1
- package/HiColoredLabel/HiColoredLabel.js +1 -1
- package/HiDatePicker/Caption.js +16 -10
- package/HiDatePicker/HiDatePicker.js +9 -3
- package/HiDatePicker/HiDateRangePicker.js +36 -22
- package/HiDatePicker/HiDateRangeSelector.js +75 -21
- package/HiDatePicker/NavBar.js +8 -1
- package/HiDatePicker/Overlays/CustomOverlayLayout.js +26 -17
- package/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +123 -0
- package/HiDatePicker/Overlays/MonthPickerOverlay.js +4 -4
- package/HiDatePicker/Overlays/MonthPickerOverlay.spec.js +1 -0
- package/HiDatePicker/Overlays/Overlay.js +15 -8
- package/HiDatePicker/Overlays/Overlay.spec.js +1 -0
- package/HiDatePicker/Overlays/TimePickerOverlay.js +2 -2
- package/HiDatePicker/Overlays/TimePickerOverlay.spec.js +1 -0
- package/HiDatePicker/Overlays/YearPickerOverlay.js +4 -6
- package/HiDatePicker/Overlays/YearPickerOverlay.spec.js +1 -0
- package/HiDatePicker/hiLocaleUtils.js +144 -0
- package/HiDatePicker/stylesheet.js +33 -7
- package/HiDotsStepper/HiDot.js +108 -0
- package/HiDotsStepper/HiDotsStepper.js +121 -0
- package/HiExpansionPanel/HiExpansionPanel.js +1 -1
- package/HiForm/HiAddressField.js +176 -0
- package/HiForm/HiFormControl.js +2 -0
- package/HiForm/HiInput.js +3 -3
- package/HiForm/HiSlider.js +352 -0
- package/HiForm/HiUpload.js +204 -0
- package/HiForm/HiUploadField.js +182 -0
- package/HiForm/HiUploadInput.js +459 -0
- package/HiForm/index.js +16 -0
- package/HiMap/HiMap.js +345 -0
- package/HiMap/HiMapExpand.js +210 -0
- package/HiMap/index.js +23 -0
- package/HiNotice/HiKPI.js +238 -0
- package/HiNotice/HiKPINotice.js +96 -0
- package/HiNotice/index.js +23 -0
- package/HiPdfReader/HiPdfReader.js +269 -0
- package/HiPdfReader/index.js +15 -0
- package/HiPin/HiPin.js +1 -1
- package/HiRadio/HiRadio.js +74 -0
- package/HiRadio/index.js +15 -0
- package/HiSelect/HiSelect.js +73 -84
- package/HiSelect/HiSuggestSelect.js +35 -4
- package/HiSelect/SelectInput.js +9 -1
- package/HiSelectNew/HiNestedSelectContent.js +5 -1
- package/HiSelectNew/HiSelect.js +260 -179
- package/HiSelectNew/HiSelectContent.js +0 -8
- package/HiSelectNew/HiSelectInput.js +8 -9
- package/HiSelectableList/HiSelectableList.js +39 -4
- package/HiSelectableList/HiSelectableListItem.js +81 -38
- package/HiTable/HiCellBuilder.js +25 -12
- package/HiTable/HiTableHeader.js +16 -17
- package/HiTable/constants.js +3 -1
- package/README.md +248 -98
- package/es/HiBreadcrumb/HiBreadcrumb.js +14 -4
- package/es/HiBreadcrumb/HiStep.js +4 -1
- package/es/HiBreadcrumb/HiStepContent.js +0 -1
- package/es/HiBreadcrumb/HiStepLabel.js +13 -4
- package/es/HiBreadcrumb/HiStepper.js +1 -1
- package/es/HiButton/HiButton.js +7 -0
- package/es/HiCell/CellIcon.js +5 -5
- package/es/HiCell/CellImage.js +13 -1
- package/es/HiCell/CellRate.js +6 -3
- package/es/HiCell/CellSentinel.js +7 -10
- package/es/HiCell/CellTextStyled.js +28 -1
- package/es/HiColoredLabel/HiColoredLabel.js +1 -1
- package/es/HiDatePicker/Caption.js +14 -10
- package/es/HiDatePicker/HiDatePicker.js +8 -3
- package/es/HiDatePicker/HiDateRangePicker.js +40 -28
- package/es/HiDatePicker/HiDateRangeSelector.js +69 -21
- package/es/HiDatePicker/ListPicker.js +1 -1
- package/es/HiDatePicker/NavBar.js +7 -1
- package/es/HiDatePicker/Overlays/CustomOverlayLayout.js +30 -19
- package/es/HiDatePicker/Overlays/CustomOverlayLayoutWithoutFooter.js +106 -0
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.js +5 -5
- package/es/HiDatePicker/Overlays/MonthPickerOverlay.spec.js +1 -0
- package/es/HiDatePicker/Overlays/Overlay.js +16 -9
- package/es/HiDatePicker/Overlays/Overlay.spec.js +1 -0
- package/es/HiDatePicker/Overlays/TimePickerOverlay.js +2 -2
- package/es/HiDatePicker/Overlays/TimePickerOverlay.spec.js +1 -0
- package/es/HiDatePicker/Overlays/YearPickerOverlay.js +4 -6
- package/es/HiDatePicker/Overlays/YearPickerOverlay.spec.js +1 -0
- package/es/HiDatePicker/hiLocaleUtils.js +131 -0
- package/es/HiDatePicker/stylesheet.js +32 -7
- package/es/HiDotsStepper/HiDot.js +66 -0
- package/es/HiDotsStepper/HiDotsStepper.js +73 -0
- package/es/HiExpansionPanel/HiExpansionPanel.js +1 -1
- package/es/HiForm/HiAddressField.js +134 -0
- package/es/HiForm/HiFormControl.js +2 -0
- package/es/HiForm/HiInput.js +3 -3
- package/es/HiForm/HiSlider.js +302 -0
- package/es/HiForm/HiUpload.js +158 -0
- package/es/HiForm/HiUploadField.js +140 -0
- package/es/HiForm/HiUploadInput.js +411 -0
- package/es/HiForm/index.js +2 -0
- package/es/HiMap/HiMap.js +290 -0
- package/es/HiMap/HiMapExpand.js +162 -0
- package/es/HiMap/index.js +2 -0
- package/es/HiNotice/HiKPI.js +196 -0
- package/es/HiNotice/HiKPINotice.js +78 -0
- package/es/HiNotice/index.js +2 -0
- package/es/HiPdfReader/HiPdfReader.js +214 -0
- package/es/HiPdfReader/index.js +1 -0
- package/es/HiPin/HiPin.js +1 -1
- package/es/HiRadio/HiRadio.js +55 -0
- package/es/HiRadio/index.js +1 -0
- package/es/HiSelect/HiSelect.js +68 -78
- package/es/HiSelect/HiSuggestSelect.js +30 -4
- package/es/HiSelect/SelectInput.js +9 -1
- package/es/HiSelectNew/HiNestedSelectContent.js +5 -1
- package/es/HiSelectNew/HiSelect.js +246 -162
- package/es/HiSelectNew/HiSelectContent.js +0 -7
- package/es/HiSelectNew/HiSelectInput.js +8 -9
- package/es/HiSelectableList/HiSelectableList.js +34 -6
- package/es/HiSelectableList/HiSelectableListItem.js +92 -40
- package/es/HiTable/HiCellBuilder.js +130 -123
- package/es/HiTable/HiTableHeader.js +14 -12
- package/es/HiTable/constants.js +1 -0
- package/es/index.js +9 -1
- package/es/utils/helpers.js +1 -1
- package/index.es.js +9 -1
- package/index.js +66 -2
- package/package.json +5 -2
- package/umd/hipay-material-ui.development.js +44450 -40930
- package/umd/hipay-material-ui.production.min.js +2 -2
- package/utils/helpers.js +1 -1
@@ -21,15 +21,20 @@ export const styles = theme => ({
|
|
21
21
|
listItem: {
|
22
22
|
backgroundColor: theme.palette.background3,
|
23
23
|
color: theme.palette.neutral.dark,
|
24
|
-
padding: '5px
|
24
|
+
padding: '5px 12px 5px 0px',
|
25
25
|
fontWeight: theme.typography.fontWeightRegular,
|
26
26
|
maxHeight: 56,
|
27
27
|
display: 'inline-flex',
|
28
28
|
alignItems: 'center',
|
29
29
|
cursor: 'pointer',
|
30
|
+
'&$listItemInlineWithInfoWithoutSecondary': {
|
31
|
+
justifyContent: 'space-between'
|
32
|
+
},
|
33
|
+
'&$listItemWithoutSecondaryInline': {
|
34
|
+
display: 'block'
|
35
|
+
},
|
30
36
|
'&$inline': {
|
31
37
|
maxHeight: 40,
|
32
|
-
alignItems: 'flex-start',
|
33
38
|
'& $secondaryLabel': {
|
34
39
|
display: 'inline-block'
|
35
40
|
}
|
@@ -39,6 +44,8 @@ export const styles = theme => ({
|
|
39
44
|
outline: 'none'
|
40
45
|
}
|
41
46
|
},
|
47
|
+
listItemWithoutSecondaryInline: {},
|
48
|
+
listItemInlineWithInfoWithoutSecondary: {},
|
42
49
|
listItemHover: {
|
43
50
|
'&:hover:not($disabled):not($pinned)': {
|
44
51
|
backgroundColor: theme.palette.action.hover,
|
@@ -72,20 +79,25 @@ export const styles = theme => ({
|
|
72
79
|
padding: '8px 0',
|
73
80
|
margin: 'auto'
|
74
81
|
},
|
75
|
-
listItemContent: _objectSpread({
|
76
|
-
whiteSpace: 'nowrap',
|
77
|
-
overflow: 'hidden',
|
78
|
-
textOverflow: 'ellipsis'
|
79
|
-
}, theme.typography.b1, {
|
82
|
+
listItemContent: _objectSpread({}, theme.typography.b1, {
|
80
83
|
fontWeight: 'inherit',
|
81
84
|
width: '100%',
|
82
85
|
minWidth: '50%',
|
83
86
|
padding: '5px 0',
|
87
|
+
'&$listItemContentSelected': {
|
88
|
+
marginBottom: -3,
|
89
|
+
marginLeft: -4
|
90
|
+
},
|
84
91
|
'& strong': {
|
85
92
|
fontWeight: theme.typography.fontWeightMedium
|
86
93
|
}
|
87
94
|
}),
|
95
|
+
listItemContentSelected: {},
|
88
96
|
label: {
|
97
|
+
maxWidth: '100%',
|
98
|
+
whiteSpace: 'nowrap',
|
99
|
+
overflow: 'hidden',
|
100
|
+
textOverflow: 'ellipsis',
|
89
101
|
display: 'inline-block',
|
90
102
|
margin: '1px 0',
|
91
103
|
paddingLeft: 4
|
@@ -108,17 +120,9 @@ export const styles = theme => ({
|
|
108
120
|
fontSize: 12,
|
109
121
|
textOverflow: 'ellipsis',
|
110
122
|
textAlign: 'right',
|
111
|
-
|
112
|
-
alignSelf: 'center'
|
113
|
-
minWidth: '40%',
|
114
|
-
maxWidth: '100%'
|
123
|
+
padding: '4px 0px 4px 8px',
|
124
|
+
alignSelf: 'center'
|
115
125
|
}),
|
116
|
-
checkbox: {
|
117
|
-
marginTop: 3
|
118
|
-
},
|
119
|
-
checkboxWithSecondaryInline: {
|
120
|
-
marginTop: '-8px'
|
121
|
-
},
|
122
126
|
img: {
|
123
127
|
width: 24,
|
124
128
|
height: 'auto',
|
@@ -128,7 +132,34 @@ export const styles = theme => ({
|
|
128
132
|
icon: {
|
129
133
|
margin: '0 4px',
|
130
134
|
verticalAlign: 'middle'
|
131
|
-
}
|
135
|
+
},
|
136
|
+
labelContent: {
|
137
|
+
display: 'flex',
|
138
|
+
alignItems: 'center',
|
139
|
+
maxWidth: '70%',
|
140
|
+
'&$labelWithoutSecondaryInline': {
|
141
|
+
maxWidth: '100%'
|
142
|
+
}
|
143
|
+
},
|
144
|
+
labelWithoutSecondaryInline: {},
|
145
|
+
infosContent: {
|
146
|
+
display: 'flex',
|
147
|
+
alignItems: 'center',
|
148
|
+
width: '100%',
|
149
|
+
justifyContent: 'space-between',
|
150
|
+
'&$infosInlineWithoutSecondary': {
|
151
|
+
width: 'auto'
|
152
|
+
},
|
153
|
+
'&$infosWithoutSecondaryInline': {
|
154
|
+
paddingLeft: 28
|
155
|
+
},
|
156
|
+
'&$infosWithSecondaryInline': {
|
157
|
+
marginTop: -8
|
158
|
+
}
|
159
|
+
},
|
160
|
+
infosInlineWithoutSecondary: {},
|
161
|
+
infosWithSecondaryInline: {},
|
162
|
+
infosWithoutSecondaryInline: {}
|
132
163
|
});
|
133
164
|
/**
|
134
165
|
* Construit un élément de liste sélectionnable (avec checkbox)
|
@@ -208,6 +239,7 @@ class HiSelectableListItem extends React.PureComponent {
|
|
208
239
|
hideCheckbox,
|
209
240
|
onSelect,
|
210
241
|
onKeyDown,
|
242
|
+
onKeyUp,
|
211
243
|
indeterminate,
|
212
244
|
indeterminateIcon,
|
213
245
|
icon,
|
@@ -222,7 +254,8 @@ class HiSelectableListItem extends React.PureComponent {
|
|
222
254
|
secondaryInline,
|
223
255
|
secondaryLabel,
|
224
256
|
thin,
|
225
|
-
type
|
257
|
+
type,
|
258
|
+
color
|
226
259
|
} = this.props; // Return simple loader list item
|
227
260
|
|
228
261
|
if (type === 'loader') {
|
@@ -254,39 +287,37 @@ class HiSelectableListItem extends React.PureComponent {
|
|
254
287
|
[classes.selected]: selected,
|
255
288
|
[classes.thin]: thin,
|
256
289
|
[classes.pinned]: pinned,
|
257
|
-
[classes.inline]: secondaryInline
|
290
|
+
[classes.inline]: secondaryInline,
|
291
|
+
[classes.listItemWithoutSecondaryInline]: !secondaryInline,
|
292
|
+
[classes.listItemInlineWithInfoWithoutSecondary]: secondaryInline && info && !secondaryLabel
|
258
293
|
}),
|
259
294
|
disabled: disabled
|
260
295
|
}, disabled || {
|
261
296
|
onClick: onSelect,
|
262
297
|
onMouseEnter: this.setHover(true),
|
263
298
|
onMouseLeave: this.setHover(false),
|
264
|
-
onKeyDown
|
299
|
+
onKeyDown,
|
300
|
+
onKeyUp
|
265
301
|
}, {
|
266
302
|
style: {
|
267
303
|
paddingLeft: `${paddingLeft + level * 32}px`
|
268
304
|
}
|
269
|
-
}),
|
305
|
+
}), React.createElement("div", {
|
306
|
+
className: classNames(classes.labelContent, {
|
307
|
+
[classes.labelWithoutSecondaryInline]: !secondaryInline || !secondaryLabel && !info
|
308
|
+
})
|
309
|
+
}, !hideCheckbox && !pinned && React.createElement(HiCheckbox, {
|
270
310
|
tabIndex: onKeyDown ? '-1' : 0,
|
271
|
-
checked: selected,
|
272
|
-
checkedIcon: checkedIcon,
|
273
311
|
classes: {
|
274
312
|
root: !secondaryInline ? classes.checkboxWithSecondaryInline : classes.checkbox
|
275
313
|
},
|
276
|
-
|
314
|
+
checked: selected,
|
315
|
+
checkedIcon: checkedIcon,
|
316
|
+
color: disabled ? 'inherit' : 'primary',
|
277
317
|
disabled: disabled,
|
278
318
|
icon: displayedIcon,
|
279
319
|
indeterminate: indeterminate,
|
280
320
|
indeterminateIcon: indeterminateIcon
|
281
|
-
}), React.createElement("div", {
|
282
|
-
className: classNames(classes.listItemContent, {
|
283
|
-
[classes.centered]: centered,
|
284
|
-
[classes.primaryHighlight]: type === 'primary-highlight'
|
285
|
-
}),
|
286
|
-
"data-id": id
|
287
|
-
}, type === 'icon' && icon && hideCheckbox && React.createElement(HiIcon, {
|
288
|
-
icon: icon,
|
289
|
-
className: classes.icon
|
290
321
|
}), type === 'image' && img && React.createElement("img", {
|
291
322
|
src: img,
|
292
323
|
alt: img,
|
@@ -298,13 +329,29 @@ class HiSelectableListItem extends React.PureComponent {
|
|
298
329
|
}
|
299
330
|
},
|
300
331
|
className: classes.img
|
301
|
-
}),
|
332
|
+
}), React.createElement("div", {
|
333
|
+
className: classNames(classes.listItemContent, {
|
334
|
+
[classes.centered]: centered,
|
335
|
+
[classes.primaryHighlight]: type === 'primary-highlight',
|
336
|
+
[classes.listItemContentSelected]: selected && color
|
337
|
+
}),
|
338
|
+
"data-id": id
|
339
|
+
}, type === 'icon' && icon && hideCheckbox && React.createElement(HiIcon, {
|
340
|
+
icon: icon,
|
341
|
+
className: classes.icon
|
342
|
+
}), this.buildItemLabel())), React.createElement("div", {
|
343
|
+
className: classNames(classes.infosContent, {
|
344
|
+
[classes.infosWithoutSecondaryInline]: !secondaryInline,
|
345
|
+
[classes.infosWithSecondaryInline]: !secondaryInline,
|
346
|
+
[classes.infosInlineWithoutSecondary]: secondaryInline && !secondaryLabel
|
347
|
+
})
|
348
|
+
}, !!secondaryLabel && React.createElement("div", {
|
302
349
|
className: classNames(classes.secondaryLabel, {
|
303
350
|
[classes.inline]: secondaryInline
|
304
351
|
})
|
305
|
-
}, secondaryLabel)
|
306
|
-
className: classes.info
|
307
|
-
}, info));
|
352
|
+
}, secondaryLabel), !!info && React.createElement("span", {
|
353
|
+
className: classNames(classes.info)
|
354
|
+
}, info)));
|
308
355
|
}
|
309
356
|
|
310
357
|
}
|
@@ -413,12 +460,17 @@ HiSelectableListItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
413
460
|
/**
|
414
461
|
* Fonction de callback à la sélection de l'élément
|
415
462
|
*/
|
416
|
-
|
463
|
+
onKeyDown: PropTypes.func,
|
417
464
|
|
418
465
|
/**
|
419
466
|
* Fonction de callback à la sélection de l'élément
|
420
467
|
*/
|
421
|
-
|
468
|
+
onKeyUp: PropTypes.func,
|
469
|
+
|
470
|
+
/**
|
471
|
+
* Fonction de callback à la sélection de l'élément
|
472
|
+
*/
|
473
|
+
onSelect: PropTypes.func,
|
422
474
|
|
423
475
|
/**
|
424
476
|
* Padding par défaut des éléments
|
@@ -15,137 +15,144 @@ import CellPinToAction from '../HiCell/CellPinToAction';
|
|
15
15
|
import * as cst from './constants';
|
16
16
|
|
17
17
|
class HiCellBuilder extends React.PureComponent {
|
18
|
-
|
19
|
-
|
20
|
-
let datacell = rowdata.datas[cell.colId];
|
21
|
-
|
22
|
-
if (cell.data !== undefined) {
|
23
|
-
const refproperties = cell.data.find(el => el.id === datacell.value);
|
24
|
-
|
25
|
-
if (refproperties) {
|
26
|
-
Object.keys(refproperties).forEach(key => {
|
27
|
-
datacell[key] = refproperties[key];
|
28
|
-
});
|
29
|
-
} else {
|
30
|
-
datacell = undefined;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
if (datacell) {
|
35
|
-
switch (cell.type) {
|
36
|
-
case cst.TYPE_NUMERIC:
|
37
|
-
return React.createElement(CellNumeric, {
|
38
|
-
value: datacell.value,
|
39
|
-
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type],
|
40
|
-
precision: cell.precision,
|
41
|
-
currency: datacell.currency,
|
42
|
-
locale: datacell.locale || cell.locale || locale
|
43
|
-
});
|
44
|
-
|
45
|
-
case cst.TYPE_COUNTRY:
|
46
|
-
return React.createElement(CellImage, {
|
47
|
-
label: datacell.label,
|
48
|
-
shortLabel: datacell.id,
|
49
|
-
path: datacell.img,
|
50
|
-
size: datacell.size,
|
51
|
-
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type]
|
52
|
-
});
|
53
|
-
|
54
|
-
case cst.TYPE_IMAGE:
|
55
|
-
return React.createElement(CellImage, {
|
56
|
-
label: datacell.label,
|
57
|
-
shortLabel: datacell.id,
|
58
|
-
path: datacell.img,
|
59
|
-
size: datacell.size,
|
60
|
-
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type],
|
61
|
-
fallbackImage: datacell.fallbackImage
|
62
|
-
});
|
63
|
-
|
64
|
-
case cst.TYPE_RATE:
|
65
|
-
return React.createElement(CellRate, {
|
66
|
-
indicator: datacell.indicator,
|
67
|
-
isPositive: datacell.isPositive,
|
68
|
-
locale: datacell.locale || cell.locale || locale,
|
69
|
-
value: datacell.value,
|
70
|
-
trendchip: datacell.trendchip,
|
71
|
-
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type]
|
72
|
-
});
|
73
|
-
|
74
|
-
case cst.TYPE_ADDRESS:
|
75
|
-
return React.createElement(CellAddress, {
|
76
|
-
city: datacell.city,
|
77
|
-
country: datacell.country,
|
78
|
-
isoCountry: datacell.isoCountry,
|
79
|
-
name: datacell.name,
|
80
|
-
postalCode: datacell.postalCode,
|
81
|
-
streetAddress: datacell.streetAddress,
|
82
|
-
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type]
|
83
|
-
});
|
84
|
-
|
85
|
-
case cst.TYPE_DATE:
|
86
|
-
return React.createElement(CellDate, {
|
87
|
-
date: datacell.date,
|
88
|
-
displayTime: datacell.displayTime,
|
89
|
-
formatShort: datacell.formatShort,
|
90
|
-
locale: datacell.locale || cell.precision || locale,
|
91
|
-
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type]
|
92
|
-
});
|
18
|
+
constructor(...args) {
|
19
|
+
super(...args);
|
93
20
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
icon: datacell.icon,
|
98
|
-
label: datacell.label,
|
99
|
-
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type],
|
100
|
-
size: cell.size
|
101
|
-
});
|
21
|
+
this.createCell = (cell, rowdata, locale) => {
|
22
|
+
if (rowdata.datas[cell.colId]) {
|
23
|
+
let datacell = rowdata.datas[cell.colId];
|
102
24
|
|
103
|
-
|
104
|
-
|
105
|
-
color: datacell.color,
|
106
|
-
icon: datacell.icon,
|
107
|
-
label: datacell.label,
|
108
|
-
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type],
|
109
|
-
size: cell.size
|
110
|
-
});
|
25
|
+
if (cell.data !== undefined) {
|
26
|
+
const refproperties = cell.data.find(el => el.id === datacell.value);
|
111
27
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
label: datacell.label,
|
116
|
-
letter: datacell.label2,
|
117
|
-
active: datacell.active,
|
118
|
-
reviewer: datacell.reviewer,
|
119
|
-
outlined: datacell.outlined
|
120
|
-
});
|
121
|
-
|
122
|
-
case cst.TYPE_SENTINEL_SCORE:
|
123
|
-
return React.createElement(CellSentinelScore, {
|
124
|
-
value: datacell.value,
|
125
|
-
result: datacell.result,
|
126
|
-
active: datacell.active
|
127
|
-
});
|
128
|
-
|
129
|
-
case cst.TYPE_PIN_TO_ACTION:
|
130
|
-
return React.createElement(CellPinToAction, {
|
131
|
-
number: datacell.number,
|
132
|
-
onClick: datacell.onClick
|
28
|
+
if (refproperties) {
|
29
|
+
Object.keys(refproperties).forEach(key => {
|
30
|
+
datacell[key] = refproperties[key];
|
133
31
|
});
|
32
|
+
} else {
|
33
|
+
datacell = undefined;
|
34
|
+
}
|
35
|
+
}
|
134
36
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
37
|
+
if (datacell) {
|
38
|
+
switch (cell.type) {
|
39
|
+
case cst.TYPE_NUMERIC:
|
40
|
+
return React.createElement(CellNumeric, {
|
41
|
+
value: datacell.value,
|
42
|
+
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type],
|
43
|
+
precision: cell.precision,
|
44
|
+
currency: datacell.currency,
|
45
|
+
locale: datacell.locale || cell.locale || locale
|
46
|
+
});
|
47
|
+
|
48
|
+
case cst.TYPE_COUNTRY:
|
49
|
+
return React.createElement(CellImage, {
|
50
|
+
label: datacell.label,
|
51
|
+
shortLabel: datacell.id,
|
52
|
+
path: datacell.img,
|
53
|
+
size: datacell.size,
|
54
|
+
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type]
|
55
|
+
});
|
56
|
+
|
57
|
+
case cst.TYPE_IMAGE:
|
58
|
+
return React.createElement(CellImage, {
|
59
|
+
label: datacell.label,
|
60
|
+
shortLabel: datacell.id,
|
61
|
+
path: datacell.img,
|
62
|
+
size: datacell.size || cell.size,
|
63
|
+
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type],
|
64
|
+
fallbackImage: datacell.fallbackImage,
|
65
|
+
title: cell.title ? cell.title(datacell, cell) : datacell.title
|
66
|
+
});
|
67
|
+
|
68
|
+
case cst.TYPE_RATE:
|
69
|
+
return React.createElement(CellRate, {
|
70
|
+
indicator: datacell.indicator,
|
71
|
+
isPositive: datacell.isPositive,
|
72
|
+
locale: datacell.locale || cell.locale || locale,
|
73
|
+
value: datacell.value,
|
74
|
+
trendchip: datacell.trendchip,
|
75
|
+
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type]
|
76
|
+
});
|
77
|
+
|
78
|
+
case cst.TYPE_ADDRESS:
|
79
|
+
return React.createElement(CellAddress, {
|
80
|
+
city: datacell.city,
|
81
|
+
country: datacell.country,
|
82
|
+
isoCountry: datacell.isoCountry,
|
83
|
+
name: datacell.name,
|
84
|
+
postalCode: datacell.postalCode,
|
85
|
+
streetAddress: datacell.streetAddress,
|
86
|
+
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type]
|
87
|
+
});
|
88
|
+
|
89
|
+
case cst.TYPE_DATE:
|
90
|
+
return React.createElement(CellDate, {
|
91
|
+
date: datacell.date,
|
92
|
+
displayTime: datacell.displayTime,
|
93
|
+
formatShort: datacell.formatShort,
|
94
|
+
locale: datacell.locale || cell.precision || locale,
|
95
|
+
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type]
|
96
|
+
});
|
97
|
+
|
98
|
+
case cst.TYPE_ICON:
|
99
|
+
return React.createElement(CellIcon, {
|
100
|
+
color: datacell.color,
|
101
|
+
icon: datacell.icon,
|
102
|
+
label: datacell.label,
|
103
|
+
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type],
|
104
|
+
size: cell.size
|
105
|
+
});
|
106
|
+
|
107
|
+
case cst.TYPE_THIRD_PARTY_SECURITY:
|
108
|
+
return React.createElement(CellIcon, {
|
109
|
+
color: datacell.color,
|
110
|
+
icon: datacell.icon,
|
111
|
+
label: datacell.label,
|
112
|
+
view: cell.view ? cell.view : cst.DEFAULT_VIEWS[cell.type],
|
113
|
+
size: cell.size
|
114
|
+
});
|
115
|
+
|
116
|
+
case cst.TYPE_SENTINEL:
|
117
|
+
return React.createElement(CellSentinel, {
|
118
|
+
color: datacell.color,
|
119
|
+
label: datacell.label,
|
120
|
+
letter: datacell.label2,
|
121
|
+
active: datacell.active,
|
122
|
+
reviewer: datacell.reviewer,
|
123
|
+
outlined: datacell.outlined
|
124
|
+
});
|
125
|
+
|
126
|
+
case cst.TYPE_SENTINEL_SCORE:
|
127
|
+
return React.createElement(CellSentinelScore, {
|
128
|
+
value: datacell.value,
|
129
|
+
result: datacell.result,
|
130
|
+
active: datacell.active
|
131
|
+
});
|
132
|
+
|
133
|
+
case cst.TYPE_PIN_TO_ACTION:
|
134
|
+
return React.createElement(CellPinToAction, {
|
135
|
+
number: datacell.number // eslint-disable-next-line react/jsx-handler-names
|
136
|
+
,
|
137
|
+
onClick: datacell.onClick
|
138
|
+
});
|
139
|
+
|
140
|
+
case cst.TYPE_ACCOUNT_NUMBER:
|
141
|
+
case cst.TYPE_CUSTOMER_ACCOUNT_NUMBER:
|
142
|
+
default:
|
143
|
+
return React.createElement(CellTextStyled, {
|
144
|
+
active: datacell.active,
|
145
|
+
color: datacell.color,
|
146
|
+
label: datacell.label,
|
147
|
+
title: cell.title ? cell.title(datacell, cell) : datacell.title,
|
148
|
+
value: datacell.value
|
149
|
+
});
|
150
|
+
}
|
144
151
|
}
|
145
152
|
}
|
146
|
-
}
|
147
153
|
|
148
|
-
|
154
|
+
return null;
|
155
|
+
};
|
149
156
|
}
|
150
157
|
|
151
158
|
render() {
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
2
1
|
// @inheritedComponent TableHeader
|
3
2
|
import React from 'react';
|
4
3
|
import PropTypes from 'prop-types';
|
@@ -6,15 +5,16 @@ import withStyles from '../styles/withStyles';
|
|
6
5
|
import TableCell from '@material-ui/core/TableCell';
|
7
6
|
import TableHead from '@material-ui/core/TableHead';
|
8
7
|
import TableRow from '@material-ui/core/TableRow';
|
9
|
-
import Tooltip from '@material-ui/core/Tooltip';
|
10
8
|
import TableSortLabel from '@material-ui/core/TableSortLabel';
|
11
9
|
import * as cst from './constants';
|
12
|
-
|
13
|
-
const styles = theme => ({
|
10
|
+
const styles = {
|
14
11
|
icon: {
|
15
12
|
color: '#00ADE9'
|
13
|
+
},
|
14
|
+
headerRoot: {
|
15
|
+
cursor: 'inherit'
|
16
16
|
}
|
17
|
-
}
|
17
|
+
};
|
18
18
|
|
19
19
|
class HiTableHeader extends React.PureComponent {
|
20
20
|
constructor(...args) {
|
@@ -45,8 +45,10 @@ class HiTableHeader extends React.PureComponent {
|
|
45
45
|
type,
|
46
46
|
label,
|
47
47
|
smallLabel,
|
48
|
-
view
|
48
|
+
view,
|
49
|
+
headerTooltip
|
49
50
|
} = columns[key];
|
51
|
+
const finalLabel = view === 's' ? smallLabel : label;
|
50
52
|
return React.createElement(TableCell, {
|
51
53
|
key: colId,
|
52
54
|
sortDirection: orderBy === colId ? order : false,
|
@@ -56,17 +58,17 @@ class HiTableHeader extends React.PureComponent {
|
|
56
58
|
paddingRight: '13px',
|
57
59
|
paddingLeft: '13px'
|
58
60
|
},
|
59
|
-
numeric: cst.ALIGN_RIGHT_TYPES.includes(type)
|
60
|
-
|
61
|
+
numeric: cst.ALIGN_RIGHT_TYPES.includes(type),
|
62
|
+
title: headerTooltip
|
63
|
+
}, sortable ? React.createElement(TableSortLabel, {
|
61
64
|
active: orderBy === colId,
|
62
65
|
direction: order,
|
63
|
-
onClick: this.createSortHandler(colId)
|
64
|
-
}, {
|
66
|
+
onClick: this.createSortHandler(colId),
|
65
67
|
classes: {
|
66
68
|
icon: classes.icon
|
67
69
|
},
|
68
|
-
title: label
|
69
|
-
}
|
70
|
+
title: headerTooltip || label
|
71
|
+
}, finalLabel) : finalLabel);
|
70
72
|
}, this)));
|
71
73
|
}
|
72
74
|
|
package/es/HiTable/constants.js
CHANGED
@@ -18,6 +18,7 @@ export const CELL_HEADER_HEIGHT_DENSE = 40;
|
|
18
18
|
|
19
19
|
export const TYPE_ACCOUNT = 'account';
|
20
20
|
export const TYPE_ACCOUNT_NUMBER = 'account_number';
|
21
|
+
export const TYPE_CUSTOMER_ACCOUNT_NUMBER = 'customer_account_number';
|
21
22
|
export const TYPE_ADDRESS = 'address';
|
22
23
|
export const TYPE_CHECKBOX = 'checkbox';
|
23
24
|
export const TYPE_DATE = 'date';
|
package/es/index.js
CHANGED
@@ -5,16 +5,24 @@ export { default as HiCheckbox } from './HiCheckbox';
|
|
5
5
|
export { default as HiChip } from './HiChip';
|
6
6
|
export { default as HiChipSwitch } from './HiChip/HiChipSwitch';
|
7
7
|
export { default as HiInput } from './HiForm/HiInput';
|
8
|
+
export { default as HiAddressField } from './HiForm/HiAddressField';
|
8
9
|
export { default as HiEmailField } from './HiForm/HiEmailField';
|
9
10
|
export { default as HiFormControl } from './HiForm/HiFormControl';
|
10
11
|
export { default as HiFormLabel } from './HiForm/HiFormLabel';
|
12
|
+
export { default as HiMap } from './HiMap/HiMap';
|
13
|
+
export { default as HiMapExpand } from './HiMap/HiMapExpand';
|
11
14
|
export { default as HiTextField } from './HiForm/HiTextField';
|
12
15
|
export { default as HiPasswordField } from './HiForm/HiPasswordField';
|
16
|
+
export { default as HiPdfReader } from './HiPdfReader/HiPdfReader';
|
17
|
+
export { default as HiSlider } from './HiForm/HiSlider';
|
13
18
|
export { default as HiSwitch } from './HiSwitch';
|
14
19
|
export { default as HiSwitchState } from './HiSwitch/HiSwitchState';
|
15
20
|
export { default as HiTable } from './HiTable/HiTable';
|
21
|
+
export { default as HiDotsStepper } from './HiDotsStepper/HiDotsStepper';
|
22
|
+
export { default as HiDot } from './HiDotsStepper/HiDot';
|
16
23
|
export { default as withMobileDialog } from './withMobileDialog';
|
17
24
|
export { default as withWidth } from './withWidth';
|
18
25
|
export { default as HiDatePicker } from './HiDatePicker/HiDatePicker';
|
19
26
|
export { default as HiDateRangePicker } from './HiDatePicker/HiDateRangePicker';
|
20
|
-
export { default as HiDateRangeSelector } from './HiDatePicker/HiDateRangeSelector';
|
27
|
+
export { default as HiDateRangeSelector } from './HiDatePicker/HiDateRangeSelector';
|
28
|
+
export { default as HiLocaleUtils } from './HiDatePicker/hiLocaleUtils';
|
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 = precision || (size === 'l' ? 2 : 0); // To locale
|
125
125
|
|
126
126
|
const options = {
|
127
127
|
minimumFractionDigits: effectivePrecision,
|
package/index.es.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/** @license HiPay-Material-UI v2.0.0-beta.
|
1
|
+
/** @license HiPay-Material-UI v2.0.0-beta.57
|
2
2
|
*
|
3
3
|
* This source code is licensed under the MIT license found in the
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
@@ -10,16 +10,24 @@ export { default as HiCheckbox } from './HiCheckbox';
|
|
10
10
|
export { default as HiChip } from './HiChip';
|
11
11
|
export { default as HiChipSwitch } from './HiChip/HiChipSwitch';
|
12
12
|
export { default as HiInput } from './HiForm/HiInput';
|
13
|
+
export { default as HiAddressField } from './HiForm/HiAddressField';
|
13
14
|
export { default as HiEmailField } from './HiForm/HiEmailField';
|
14
15
|
export { default as HiFormControl } from './HiForm/HiFormControl';
|
15
16
|
export { default as HiFormLabel } from './HiForm/HiFormLabel';
|
17
|
+
export { default as HiMap } from './HiMap/HiMap';
|
18
|
+
export { default as HiMapExpand } from './HiMap/HiMapExpand';
|
16
19
|
export { default as HiTextField } from './HiForm/HiTextField';
|
17
20
|
export { default as HiPasswordField } from './HiForm/HiPasswordField';
|
21
|
+
export { default as HiPdfReader } from './HiPdfReader/HiPdfReader';
|
22
|
+
export { default as HiSlider } from './HiForm/HiSlider';
|
18
23
|
export { default as HiSwitch } from './HiSwitch';
|
19
24
|
export { default as HiSwitchState } from './HiSwitch/HiSwitchState';
|
20
25
|
export { default as HiTable } from './HiTable/HiTable';
|
26
|
+
export { default as HiDotsStepper } from './HiDotsStepper/HiDotsStepper';
|
27
|
+
export { default as HiDot } from './HiDotsStepper/HiDot';
|
21
28
|
export { default as withMobileDialog } from './withMobileDialog';
|
22
29
|
export { default as withWidth } from './withWidth';
|
23
30
|
export { default as HiDatePicker } from './HiDatePicker/HiDatePicker';
|
24
31
|
export { default as HiDateRangePicker } from './HiDatePicker/HiDateRangePicker';
|
25
32
|
export { default as HiDateRangeSelector } from './HiDatePicker/HiDateRangeSelector';
|
33
|
+
export { default as HiLocaleUtils } from './HiDatePicker/hiLocaleUtils';
|