@hipay/hipay-material-ui 1.0.0-beta.23 → 1.0.0-beta.25
Sign up to get free protection for your applications and to get access to all the features.
- package/HI-CHANGELOG.md +26 -43
- package/HiChip/HiChip.js +61 -8
- package/HiDatePicker/HiDateRangePicker.js +27 -13
- package/HiDatePicker/HiDateRangeSelector.js +13 -2
- package/HiForm/HiInput.js +1 -0
- package/HiForm/HiPasswordField.js +2 -2
- package/HiPins/HiPins.js +6 -4
- package/HiSelect/HiSelect.js +7 -5
- package/HiSelect/SelectInput.js +3 -8
- package/HiSelectableList/HiSelectableList.js +51 -49
- package/HiSelectableList/HiSelectableListItem.js +4 -2
- package/HiTable/BodyCellBuilder.js +22 -12
- package/HiTable/BodyCells/CellAccount.js +12 -3
- package/HiTable/BodyCells/CellAccountNumber.js +12 -3
- package/HiTable/BodyCells/CellAddress.js +12 -3
- package/HiTable/BodyCells/CellCountry.js +12 -3
- package/HiTable/BodyCells/CellDate.js +43 -42
- package/HiTable/BodyCells/CellIcon.js +12 -3
- package/HiTable/BodyCells/CellImage.js +12 -3
- package/HiTable/BodyCells/CellNumeric.js +12 -3
- package/HiTable/BodyCells/CellRate.js +12 -3
- package/HiTable/BodyCells/CellSentinel.js +17 -7
- package/HiTable/BodyCells/CellStatus.js +12 -3
- package/HiTable/BodyCells/CellText.js +17 -7
- package/HiTable/BodyCells/CellThirdPartySecurity.js +12 -3
- package/HiTable/BodyRow.js +12 -3
- package/HiTable/ColumnFilter.js +1 -4
- package/HiTable/HeaderCell.js +21 -11
- package/HiTable/HiStickyRow.js +24 -13
- package/HiTable/HiTable.js +30 -69
- package/HiTable/HiTableBody.js +99 -29
- package/HiTable/HiTableContextMenu.js +31 -16
- package/HiTable/HiTableFooter.js +9 -0
- package/HiTable/HiTableHead.js +15 -7
- package/HiTopBar/HiTopBar.js +6 -0
- package/README.md +71 -6
- package/es/HiChip/HiChip.js +74 -8
- package/es/HiDatePicker/HiDateRangePicker.js +25 -12
- package/es/HiDatePicker/HiDateRangeSelector.js +12 -2
- package/es/HiForm/HiInput.js +1 -0
- package/es/HiForm/HiPasswordField.js +2 -2
- package/es/HiPins/HiPins.js +4 -4
- package/es/HiSelect/HiSelect.js +6 -5
- package/es/HiSelect/SelectInput.js +3 -8
- package/es/HiSelectableList/HiSelectableList.js +51 -49
- package/es/HiSelectableList/HiSelectableListItem.js +4 -2
- package/es/HiTable/BodyCellBuilder.js +8 -2
- package/es/HiTable/BodyCells/CellAccount.js +6 -1
- package/es/HiTable/BodyCells/CellAccountNumber.js +6 -1
- package/es/HiTable/BodyCells/CellAddress.js +6 -1
- package/es/HiTable/BodyCells/CellCountry.js +6 -1
- package/es/HiTable/BodyCells/CellDate.js +28 -37
- package/es/HiTable/BodyCells/CellIcon.js +6 -1
- package/es/HiTable/BodyCells/CellImage.js +6 -1
- package/es/HiTable/BodyCells/CellNumeric.js +6 -1
- package/es/HiTable/BodyCells/CellRate.js +6 -1
- package/es/HiTable/BodyCells/CellSentinel.js +6 -1
- package/es/HiTable/BodyCells/CellStatus.js +6 -1
- package/es/HiTable/BodyCells/CellText.js +6 -1
- package/es/HiTable/BodyCells/CellThirdPartySecurity.js +6 -1
- package/es/HiTable/BodyRow.js +7 -2
- package/es/HiTable/ColumnFilter.js +1 -4
- package/es/HiTable/HeaderCell.js +16 -9
- package/es/HiTable/HiStickyRow.js +20 -13
- package/es/HiTable/HiTable.js +4 -40
- package/es/HiTable/HiTableBody.js +78 -26
- package/es/HiTable/HiTableContextMenu.js +28 -16
- package/es/HiTable/HiTableFooter.js +5 -0
- package/es/HiTable/HiTableHead.js +11 -6
- package/es/HiTopBar/HiTopBar.js +5 -0
- package/es/utils/HiIconBuilder.js +6 -2
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +6 -1
- package/umd/hipay-material-ui.development.js +80901 -47149
- package/umd/hipay-material-ui.production.min.js +5 -5
- package/utils/HiIconBuilder.js +6 -2
package/es/HiChip/HiChip.js
CHANGED
@@ -27,14 +27,24 @@ export const styles = theme => ({
|
|
27
27
|
},
|
28
28
|
'&$deletable': {
|
29
29
|
paddingRight: 4
|
30
|
+
},
|
31
|
+
'&$leftIccon': {
|
32
|
+
paddingLeft: 4
|
30
33
|
}
|
31
34
|
}),
|
32
35
|
leftNavigation: {},
|
33
36
|
rightNavigation: {},
|
34
37
|
deletable: {},
|
38
|
+
leftIccon: {},
|
35
39
|
icon: {
|
36
40
|
marginRight: 4
|
37
41
|
},
|
42
|
+
iconClickable: {
|
43
|
+
cursor: 'pointer',
|
44
|
+
'&:hover, &:focus': {
|
45
|
+
color: theme.palette.business.primary.normal
|
46
|
+
}
|
47
|
+
},
|
38
48
|
eraseIcon: {
|
39
49
|
// Remove grey highlight
|
40
50
|
WebkitTapHighlightColor: 'transparent',
|
@@ -78,7 +88,23 @@ export const styles = theme => ({
|
|
78
88
|
});
|
79
89
|
|
80
90
|
function HiChip(props) {
|
81
|
-
const {
|
91
|
+
const {
|
92
|
+
label,
|
93
|
+
classes,
|
94
|
+
icon,
|
95
|
+
id,
|
96
|
+
img,
|
97
|
+
onPrevious,
|
98
|
+
onNext,
|
99
|
+
onDelete,
|
100
|
+
prefix,
|
101
|
+
onIconClick,
|
102
|
+
titleDelete,
|
103
|
+
titleIcon,
|
104
|
+
titleImg,
|
105
|
+
titleNext,
|
106
|
+
titlePrevious
|
107
|
+
} = props;
|
82
108
|
|
83
109
|
return React.createElement(
|
84
110
|
'div',
|
@@ -87,7 +113,8 @@ function HiChip(props) {
|
|
87
113
|
className: classNames(classes.root, {
|
88
114
|
[classes.leftNavigation]: onPrevious,
|
89
115
|
[classes.rightNavigation]: onNext,
|
90
|
-
[classes.deletable]: onDelete
|
116
|
+
[classes.deletable]: onDelete,
|
117
|
+
[classes.leftIccon]: icon
|
91
118
|
})
|
92
119
|
},
|
93
120
|
prefix && React.createElement(
|
@@ -96,13 +123,22 @@ function HiChip(props) {
|
|
96
123
|
prefix,
|
97
124
|
' : '
|
98
125
|
),
|
99
|
-
img && React.createElement('img', { className: classes.badge, src: img, alt: img }),
|
100
|
-
icon && React.createElement(HiIconBuilder, {
|
126
|
+
img && React.createElement('img', { className: classes.badge, src: img, alt: img, title: titleImg }),
|
127
|
+
icon && React.createElement(HiIconBuilder, {
|
128
|
+
className: classNames(classes.icon, {
|
129
|
+
[classes.iconClickable]: onIconClick
|
130
|
+
}),
|
131
|
+
icon: icon,
|
132
|
+
size: 16,
|
133
|
+
onClick: onIconClick,
|
134
|
+
titleAccess: titleIcon
|
135
|
+
}),
|
101
136
|
onPrevious && React.createElement(HiIconBuilder, {
|
102
137
|
className: classNames(classes.navigate),
|
103
138
|
icon: 'menuLeft',
|
104
139
|
onClick: onPrevious,
|
105
|
-
size: 16
|
140
|
+
size: 16,
|
141
|
+
titleAccess: titlePrevious
|
106
142
|
}),
|
107
143
|
React.createElement(
|
108
144
|
'span',
|
@@ -113,13 +149,15 @@ function HiChip(props) {
|
|
113
149
|
className: classNames(classes.navigate),
|
114
150
|
icon: 'menuRight',
|
115
151
|
onClick: onNext,
|
116
|
-
size: 16
|
152
|
+
size: 16,
|
153
|
+
titleAccess: titleNext
|
117
154
|
}),
|
118
155
|
onDelete && React.createElement(HiIconBuilder, {
|
119
156
|
classes: { root: classes.eraseIcon },
|
120
157
|
icon: 'closeCircle',
|
121
158
|
onClick: onDelete,
|
122
|
-
size: 16
|
159
|
+
size: 16,
|
160
|
+
titleAccess: titleDelete
|
123
161
|
})
|
124
162
|
);
|
125
163
|
}
|
@@ -149,6 +187,10 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
149
187
|
* Fonction de callback au clic sur l'icon close si cancelable = true
|
150
188
|
*/
|
151
189
|
onDelete: PropTypes.func,
|
190
|
+
/**
|
191
|
+
* Fonction de callback au clic sur l'icon à gauche
|
192
|
+
*/
|
193
|
+
onIconClick: PropTypes.func,
|
152
194
|
/**
|
153
195
|
* Fonction de callback au clic sur l'icon next
|
154
196
|
*/
|
@@ -156,7 +198,31 @@ HiChip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
156
198
|
/**
|
157
199
|
* Fonction de callback au clic sur l'icon previous
|
158
200
|
*/
|
159
|
-
onPrevious: PropTypes.func
|
201
|
+
onPrevious: PropTypes.func,
|
202
|
+
/**
|
203
|
+
* Préfixe dans le HiChip
|
204
|
+
*/
|
205
|
+
prefix: PropTypes.string,
|
206
|
+
/**
|
207
|
+
* Titre de l'icône supprimer
|
208
|
+
*/
|
209
|
+
titleDelete: PropTypes.string,
|
210
|
+
/**
|
211
|
+
* Titre de l'icône
|
212
|
+
*/
|
213
|
+
titleIcon: PropTypes.string,
|
214
|
+
/**
|
215
|
+
* Titre de la balise img
|
216
|
+
*/
|
217
|
+
titleImg: PropTypes.string,
|
218
|
+
/**
|
219
|
+
* Titre de la navigation suivante
|
220
|
+
*/
|
221
|
+
titleNext: PropTypes.string,
|
222
|
+
/**
|
223
|
+
* Titre de la navigation précédente
|
224
|
+
*/
|
225
|
+
titlePrevious: PropTypes.string
|
160
226
|
} : {};
|
161
227
|
|
162
228
|
export default withStyles(styles, { name: 'HmuiHiChip' })(HiChip);
|
@@ -27,6 +27,7 @@ class HiDateRangePicker extends React.Component {
|
|
27
27
|
super();
|
28
28
|
|
29
29
|
this.handleInputChange = inputName => event => {
|
30
|
+
this.event = event;
|
30
31
|
this.props.onChange(inputName, event.target.value);
|
31
32
|
};
|
32
33
|
|
@@ -34,6 +35,13 @@ class HiDateRangePicker extends React.Component {
|
|
34
35
|
this.setState({ focusedInput: name });
|
35
36
|
};
|
36
37
|
|
38
|
+
this.handleDayPickerBlur = name => () => {
|
39
|
+
this.setState({ focusedInput: '' });
|
40
|
+
if (this.props.onBlur) {
|
41
|
+
this.props.onBlur(name);
|
42
|
+
}
|
43
|
+
};
|
44
|
+
|
37
45
|
this.state = {
|
38
46
|
fromCurrentMonth: props.from ? props.from : new Date(),
|
39
47
|
toCurrentMonth: props.to ? props.to : new Date(),
|
@@ -100,11 +108,7 @@ class HiDateRangePicker extends React.Component {
|
|
100
108
|
}
|
101
109
|
|
102
110
|
handleReset(name) {
|
103
|
-
|
104
|
-
this.handleCurrentMonthChange(name, new Date());
|
105
|
-
} else {
|
106
|
-
this.handleCurrentMonthChange(name, this.props.from);
|
107
|
-
}
|
111
|
+
this.handleCurrentMonthChange(name, new Date());
|
108
112
|
|
109
113
|
this.timeout = setTimeout(() => {
|
110
114
|
if (this.props.onReset) {
|
@@ -122,7 +126,12 @@ class HiDateRangePicker extends React.Component {
|
|
122
126
|
if (name === 'from' && this.toInput) {
|
123
127
|
this.toInput.getInput().focus();
|
124
128
|
} else if (name === 'to') {
|
125
|
-
|
129
|
+
if (typeof this.event === 'undefined' || this.event && this.event.type !== 'change') {
|
130
|
+
// trigger blur only if user clicks on date into calendar
|
131
|
+
// else keep focus to see day selection into calendar
|
132
|
+
document.activeElement.blur();
|
133
|
+
}
|
134
|
+
delete this.event;
|
126
135
|
}
|
127
136
|
}
|
128
137
|
} else {
|
@@ -222,10 +231,6 @@ class HiDateRangePicker extends React.Component {
|
|
222
231
|
}
|
223
232
|
}
|
224
233
|
|
225
|
-
handleDayPickerBlur() {
|
226
|
-
this.setState({ focusedInput: '' });
|
227
|
-
}
|
228
|
-
|
229
234
|
openPanel(name, panel) {
|
230
235
|
this.setState({
|
231
236
|
[`${name}OpenedPanel`]: panel
|
@@ -479,7 +484,7 @@ class HiDateRangePicker extends React.Component {
|
|
479
484
|
{
|
480
485
|
className: classes.fromInput,
|
481
486
|
onFocus: this.handleDayPickerFocus('from'),
|
482
|
-
onBlur: this.handleDayPickerBlur
|
487
|
+
onBlur: this.handleDayPickerBlur('from')
|
483
488
|
},
|
484
489
|
React.createElement(
|
485
490
|
'div',
|
@@ -507,7 +512,7 @@ class HiDateRangePicker extends React.Component {
|
|
507
512
|
{
|
508
513
|
className: toClass,
|
509
514
|
onFocus: this.handleDayPickerFocus('to'),
|
510
|
-
onBlur: this.handleDayPickerBlur
|
515
|
+
onBlur: this.handleDayPickerBlur('to')
|
511
516
|
},
|
512
517
|
React.createElement(DayPickerInput, {
|
513
518
|
ref: el => {
|
@@ -604,10 +609,18 @@ HiDateRangePicker.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
604
609
|
minimumDate: PropTypes.instanceOf(Date),
|
605
610
|
/**
|
606
611
|
* Callback à la sélection d'une date
|
612
|
+
* @param {string} nom de l'input
|
613
|
+
*/
|
614
|
+
onBlur: PropTypes.func,
|
615
|
+
/**
|
616
|
+
* Callback à la sélection d'une date
|
617
|
+
* @param {string} nom du champs
|
618
|
+
* @param {string} nouvelle valeur du champs
|
607
619
|
*/
|
608
620
|
onChange: PropTypes.func,
|
609
621
|
/**
|
610
622
|
* Callback au reset de l'input
|
623
|
+
* @param {string} nom du champs réinitialisé
|
611
624
|
*/
|
612
625
|
onReset: PropTypes.func,
|
613
626
|
/**
|
@@ -42,13 +42,13 @@ export function buildDateRangeOptionByKey(key, t, format) {
|
|
42
42
|
label = t.current_week;
|
43
43
|
from = moment().startOf('week');
|
44
44
|
to = moment();
|
45
|
-
info = `${t.
|
45
|
+
info = `${t.short_week}${from.format('w')}, \n ${from.format(format)} ${t.to_now}`;
|
46
46
|
break;
|
47
47
|
case 'pw':
|
48
48
|
label = t.previous_week;
|
49
49
|
from = moment().subtract(1, 'week').startOf('week');
|
50
50
|
to = moment().subtract(1, 'week').endOf('week');
|
51
|
-
info = `${t.
|
51
|
+
info = `${t.short_week}${from.format('w')}, ${from.format(format)} ${t.to} ${to.format(format)}`;
|
52
52
|
break;
|
53
53
|
case 'cm':
|
54
54
|
label = t.current_month;
|
@@ -146,6 +146,15 @@ class HiDateRangeSelector extends React.Component {
|
|
146
146
|
this.options = props.availableOptionKeys.map(key => buildDateRangeOptionByKey(key, props.translations, props.format));
|
147
147
|
}
|
148
148
|
|
149
|
+
static getDerivedStateFromProps(props, state) {
|
150
|
+
if (props.defaultPreset && props.returnSelectValue) {
|
151
|
+
return {
|
152
|
+
selectedPreset: props.defaultPreset
|
153
|
+
};
|
154
|
+
}
|
155
|
+
return null;
|
156
|
+
}
|
157
|
+
|
149
158
|
componentDidMount() {
|
150
159
|
if (this.container) {
|
151
160
|
this.setState({ containerWidth: findDOMNode(this.container).clientWidth });
|
@@ -250,6 +259,7 @@ HiDateRangeSelector.defaultProps = {
|
|
250
259
|
month: 'Month',
|
251
260
|
quarter: 'Quarter',
|
252
261
|
week: 'Week',
|
262
|
+
short_week: 'W',
|
253
263
|
year: 'Year',
|
254
264
|
days: 'days',
|
255
265
|
custom_period: 'Custom Period',
|
package/es/HiForm/HiInput.js
CHANGED
@@ -11,9 +11,9 @@ import HiTextField from './HiTextField';
|
|
11
11
|
export const styles = theme => ({
|
12
12
|
inputPassword: {
|
13
13
|
fontWeight: 'bolder',
|
14
|
-
fontFamily: '
|
14
|
+
fontFamily: 'inherit',
|
15
15
|
letterSpacing: '4px',
|
16
|
-
fontSize:
|
16
|
+
fontSize: '1.6rem'
|
17
17
|
}
|
18
18
|
});
|
19
19
|
|
package/es/HiPins/HiPins.js
CHANGED
@@ -10,7 +10,7 @@ export const styles = theme => ({
|
|
10
10
|
display: 'inline-block',
|
11
11
|
padding: '0 9px',
|
12
12
|
height: 16,
|
13
|
-
lineHeight: '
|
13
|
+
lineHeight: '18px',
|
14
14
|
minWidth: 25,
|
15
15
|
textAlign: 'center',
|
16
16
|
borderRadius: '45px',
|
@@ -33,9 +33,9 @@ export const styles = theme => ({
|
|
33
33
|
*
|
34
34
|
*/
|
35
35
|
function HiPins(props) {
|
36
|
-
const { classes, children, color, onClick, className } = props;
|
36
|
+
const { classes, theme, children, color = props.theme.palette.business.primary.normal, onClick, className } = props;
|
37
37
|
|
38
|
-
const textColor = getContrastedTextColor(color,
|
38
|
+
const textColor = getContrastedTextColor(color, theme.palette.neutral.dark, '#FFF');
|
39
39
|
|
40
40
|
const divProps = {
|
41
41
|
style: { backgroundColor: color, color: textColor }
|
@@ -59,7 +59,7 @@ HiPins.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
59
59
|
children: PropTypes.node.isRequired,
|
60
60
|
classes: PropTypes.object.isRequired,
|
61
61
|
className: PropTypes.string,
|
62
|
-
color: PropTypes.string
|
62
|
+
color: PropTypes.string,
|
63
63
|
onClick: PropTypes.func
|
64
64
|
} : {};
|
65
65
|
export default withStyles(styles, { withTheme: true, name: 'HmuiHiPins' })(HiPins);
|
package/es/HiSelect/HiSelect.js
CHANGED
@@ -223,10 +223,11 @@ class HiSelect extends React.PureComponent {
|
|
223
223
|
id,
|
224
224
|
placeholder,
|
225
225
|
staticPosition,
|
226
|
-
pinnedItem
|
226
|
+
pinnedItem,
|
227
|
+
hasAll
|
227
228
|
} = this.props;
|
228
229
|
|
229
|
-
const { open, suggestions, focused } = this.state;
|
230
|
+
const { open, suggestions, focused, dynamic } = this.state;
|
230
231
|
|
231
232
|
let display = '';
|
232
233
|
const selectedIdList = Array.isArray(value) ? value : value ? [value] : [];
|
@@ -249,11 +250,11 @@ class HiSelect extends React.PureComponent {
|
|
249
250
|
});
|
250
251
|
}
|
251
252
|
|
252
|
-
if (
|
253
|
+
if ((dynamic || loading) && selectedIdList.length === 1) {
|
253
254
|
display = translations.one_item_selected.replace('%s', selectedIdList.length);
|
254
|
-
} else if (this.state.nbOptions !== selectedIdList.length && selectedIdList.length > 1) {
|
255
|
+
} else if ((this.state.nbOptions !== selectedIdList.length || !hasAll) && selectedIdList.length > 1) {
|
255
256
|
display = translations.n_items_selected.replace('%s', selectedIdList.length);
|
256
|
-
} else if (this.state.nbOptions === selectedIdList.length && this.state.nbOptions
|
257
|
+
} else if (this.state.nbOptions === selectedIdList.length && this.state.nbOptions > 1) {
|
257
258
|
display = translations.all;
|
258
259
|
} else if (selectedIdList.length === 1) {
|
259
260
|
if (type !== 'icon') {
|
@@ -14,7 +14,8 @@ export const styles = theme => ({
|
|
14
14
|
width: '100%',
|
15
15
|
height: 40,
|
16
16
|
maxWidth: 500,
|
17
|
-
|
17
|
+
display: 'flex',
|
18
|
+
justifyContent: 'center',
|
18
19
|
padding: 8,
|
19
20
|
cursor: 'pointer'
|
20
21
|
},
|
@@ -89,18 +90,12 @@ export const styles = theme => ({
|
|
89
90
|
label: _extends({
|
90
91
|
whiteSpace: 'nowrap',
|
91
92
|
overflow: 'hidden',
|
92
|
-
textOverflow: 'ellipsis'
|
93
|
-
paddingRight: 16
|
93
|
+
textOverflow: 'ellipsis'
|
94
94
|
}, theme.typography.body1, {
|
95
95
|
display: 'inline-flex',
|
96
96
|
width: '100%'
|
97
97
|
}),
|
98
98
|
icon: {
|
99
|
-
position: 'absolute',
|
100
|
-
display: 'flex',
|
101
|
-
alignItems: 'center',
|
102
|
-
right: 0,
|
103
|
-
height: 40,
|
104
99
|
transition: theme.transitions.create(['opacity', 'transform'], {
|
105
100
|
duration: theme.transitions.duration.shorter
|
106
101
|
})
|
@@ -51,59 +51,61 @@ class HiSelectableList extends React.PureComponent {
|
|
51
51
|
List,
|
52
52
|
{ className: classes.root, onKeyDown: this.props.onKeyDown },
|
53
53
|
itemList.map(item => {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
parents.
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
54
|
+
if (item.displayed !== false) {
|
55
|
+
/**
|
56
|
+
* Calcul du level de l'item
|
57
|
+
*/
|
58
|
+
if (hierarchic) {
|
59
|
+
// On stocke l'id des parents dans un tableau
|
60
|
+
if (item.parentId && !parents.includes(item.parentId)) {
|
61
|
+
parents.push(item.parentId);
|
62
|
+
} else if (item.parentId && parents.includes(item.parentId)) {
|
63
|
+
// Si l'item n'a pas de parentId ou qu'on l'a déjà stocké :
|
64
|
+
// Et si le parentId n'est pas le dernier inseré
|
65
|
+
if (item.parentId !== parents[parents.length - 1]) {
|
66
|
+
// On est donc redescendu d'un niveau
|
67
|
+
// donc on supprime le dernier parent
|
68
|
+
parents.pop();
|
69
|
+
}
|
70
|
+
} else if (!item.parentId && parents.length > 0) {
|
71
|
+
// Si l'item n'a pas de parent et que le tableau des parent
|
72
|
+
// n'est pas vide => on le réinitialise
|
73
|
+
parents = [];
|
68
74
|
}
|
69
|
-
} else if (!item.parentId && parents.length > 0) {
|
70
|
-
// Si l'item n'a pas de parent et que le tableau des parent
|
71
|
-
// n'est pas vide => on le réinitialise
|
72
|
-
parents = [];
|
73
75
|
}
|
74
|
-
}
|
75
76
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
77
|
+
/**
|
78
|
+
* L'élément est-il selectionné ?
|
79
|
+
*/
|
80
|
+
let selected = false;
|
81
|
+
if (item.id === '_all') {
|
82
|
+
selected = allSelected;
|
83
|
+
} else if (!item.hasChildren) {
|
84
|
+
selected = selectedIdList.includes(item.id);
|
85
|
+
} else if (hierarchic && parentItemSelectable) {
|
86
|
+
selected = hierarchySelected[item.id].length === hierarchy[item.id].length;
|
87
|
+
}
|
87
88
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
89
|
+
return React.createElement(HiSelectableListItem, _extends({
|
90
|
+
key: item.id,
|
91
|
+
item: item,
|
92
|
+
selected: selected,
|
93
|
+
indeterminate: item.hasChildren && parentItemSelectable ? hierarchySelected[item.id].length > 0 && hierarchySelected[item.id].length !== hierarchy[item.id].length : false,
|
94
|
+
onSelect: onSelect,
|
95
|
+
hierarchySelected: hierarchySelected,
|
96
|
+
parentItemSelectable: parentItemSelectable,
|
97
|
+
nbChildren: typeof hierarchy !== 'undefined' && typeof hierarchy[item.id] !== 'undefined' ? hierarchy[item.id].length : 0,
|
98
|
+
hierarchic: hierarchic,
|
99
|
+
translations: translations,
|
100
|
+
icon: icon,
|
101
|
+
parentIcon: parentIcon,
|
102
|
+
hoverIcon: hoverIcon,
|
103
|
+
checkedIcon: checkedIcon,
|
104
|
+
checkbox: checkbox,
|
105
|
+
level: parents.length,
|
106
|
+
disabled: disabledIds ? disabledIds.includes(item.id) : false
|
107
|
+
}, others));
|
108
|
+
}
|
107
109
|
})
|
108
110
|
)
|
109
111
|
);
|
@@ -14,9 +14,11 @@ import HiLoader from '../HiLoader';
|
|
14
14
|
|
15
15
|
export const styles = theme => ({
|
16
16
|
listItem: {
|
17
|
-
padding:
|
17
|
+
padding: '9px 0px',
|
18
18
|
fontWeight: theme.typography.fontWeightRegular,
|
19
|
-
maxHeight: 40
|
19
|
+
maxHeight: 40,
|
20
|
+
display: 'flex',
|
21
|
+
alignItems: 'flex-start'
|
20
22
|
},
|
21
23
|
listItemTitle: {
|
22
24
|
padding: `${9}px 0px`,
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import _extends from 'babel-runtime/helpers/extends';
|
2
2
|
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
3
|
+
import _JSON$stringify from 'babel-runtime/core-js/json/stringify';
|
3
4
|
import React from 'react';
|
4
5
|
import PropTypes from 'prop-types';
|
5
6
|
import { ContextMenuTrigger } from 'react-contextmenu';
|
@@ -11,7 +12,7 @@ import { formatRate } from '../utils/hiHelpers';
|
|
11
12
|
/**
|
12
13
|
* Construit la cellule correspondante au type demandé
|
13
14
|
*/
|
14
|
-
export default class BodyCellBuilder extends React.
|
15
|
+
export default class BodyCellBuilder extends React.Component {
|
15
16
|
|
16
17
|
constructor(props) {
|
17
18
|
super(props);
|
@@ -19,6 +20,10 @@ export default class BodyCellBuilder extends React.PureComponent {
|
|
19
20
|
this.collectContextMenuDatas = this.collectContextMenuDatas.bind(this);
|
20
21
|
}
|
21
22
|
|
23
|
+
shouldComponentUpdate(nextProps, nextState) {
|
24
|
+
return _JSON$stringify(this.props) !== _JSON$stringify(nextProps) || _JSON$stringify(this.state) !== _JSON$stringify(nextState);
|
25
|
+
}
|
26
|
+
|
22
27
|
/**
|
23
28
|
* CollecContextMenuDatas
|
24
29
|
*
|
@@ -151,7 +156,8 @@ export default class BodyCellBuilder extends React.PureComponent {
|
|
151
156
|
locale: dateLocale,
|
152
157
|
view: view,
|
153
158
|
displayTime: props.displayTime,
|
154
|
-
sticky: sticky
|
159
|
+
sticky: sticky,
|
160
|
+
formatShort: this.props.formatShort
|
155
161
|
});
|
156
162
|
break;
|
157
163
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import _JSON$stringify from 'babel-runtime/core-js/json/stringify';
|
1
2
|
import React from 'react';
|
2
3
|
import PropTypes from 'prop-types';
|
3
4
|
import Tooltip from '../../Tooltip';
|
@@ -9,7 +10,11 @@ export const styles = theme => ({});
|
|
9
10
|
/**
|
10
11
|
* Cette cellule permet d'afficher le nom d'un compte sous la forme d'un label coloré.
|
11
12
|
*/
|
12
|
-
class CellAccount extends React.
|
13
|
+
class CellAccount extends React.Component {
|
14
|
+
|
15
|
+
shouldComponentUpdate(nextProps, nextState) {
|
16
|
+
return _JSON$stringify(this.props) !== _JSON$stringify(nextProps) || _JSON$stringify(this.state) !== _JSON$stringify(nextState);
|
17
|
+
}
|
13
18
|
|
14
19
|
render() {
|
15
20
|
const { value, color } = this.props;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import _JSON$stringify from 'babel-runtime/core-js/json/stringify';
|
1
2
|
import React from 'react';
|
2
3
|
import PropTypes from 'prop-types';
|
3
4
|
import { Circle } from 'mdi-material-ui';
|
@@ -44,7 +45,11 @@ export const styles = theme => ({
|
|
44
45
|
* Cette cellule permet d'afficher un numéro de compte
|
45
46
|
* Le tooltip affiche les informations complémentaires (country, expiration date..)
|
46
47
|
*/
|
47
|
-
class CellAccountNumber extends React.
|
48
|
+
class CellAccountNumber extends React.Component {
|
49
|
+
|
50
|
+
shouldComponentUpdate(nextProps, nextState) {
|
51
|
+
return _JSON$stringify(this.props) !== _JSON$stringify(nextProps) || _JSON$stringify(this.state) !== _JSON$stringify(nextState);
|
52
|
+
}
|
48
53
|
|
49
54
|
render() {
|
50
55
|
const {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import _JSON$stringify from 'babel-runtime/core-js/json/stringify';
|
1
2
|
// @inheritedComponent CellLayout
|
2
3
|
|
3
4
|
import React from 'react';
|
@@ -23,7 +24,11 @@ export const styles = theme => ({
|
|
23
24
|
* - sinon on affiche la ville et le pays
|
24
25
|
* - tous les champs définis sont affichés dans le tooltip
|
25
26
|
*/
|
26
|
-
class CellAddress extends React.
|
27
|
+
class CellAddress extends React.Component {
|
28
|
+
|
29
|
+
shouldComponentUpdate(nextProps, nextState) {
|
30
|
+
return _JSON$stringify(this.props) !== _JSON$stringify(nextProps) || _JSON$stringify(this.state) !== _JSON$stringify(nextState);
|
31
|
+
}
|
27
32
|
|
28
33
|
render() {
|
29
34
|
const { classes, streetAddress, name, city, postalCode, view, country, isoCountry } = this.props;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import _JSON$stringify from 'babel-runtime/core-js/json/stringify';
|
1
2
|
import React from 'react';
|
2
3
|
import PropTypes from 'prop-types';
|
3
4
|
|
@@ -44,7 +45,11 @@ export const styles = theme => ({
|
|
44
45
|
* en vue small : Affiche la valeur courte (id), tooltip = Image + Value
|
45
46
|
*
|
46
47
|
*/
|
47
|
-
class CellCountry extends React.
|
48
|
+
class CellCountry extends React.Component {
|
49
|
+
|
50
|
+
shouldComponentUpdate(nextProps, nextState) {
|
51
|
+
return _JSON$stringify(this.props) !== _JSON$stringify(nextProps) || _JSON$stringify(this.state) !== _JSON$stringify(nextState);
|
52
|
+
}
|
48
53
|
|
49
54
|
render() {
|
50
55
|
const { label, path, value, view } = this.props;
|