@hipay/hipay-material-ui 1.0.0-beta.7 → 1.0.0-beta.9
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/HiBreadcrumb/HiBreadcrumb.js +143 -0
- package/HiBreadcrumb/HiStep.js +123 -0
- package/HiBreadcrumb/HiStepConnector.js +142 -0
- package/HiBreadcrumb/HiStepIcon.js +134 -0
- package/HiBreadcrumb/HiStepLabel.js +182 -0
- package/HiBreadcrumb/HiStepper.js +125 -0
- package/HiBreadcrumb/index.js +16 -0
- package/HiDatePicker/HiDateRangeSelector.js +1 -1
- package/HiDotsStepper/HiDot.js +151 -0
- package/HiDotsStepper/HiDotsStepper.js +146 -0
- package/HiDotsStepper/index.js +16 -0
- package/HiForm/HiAddressField.js +204 -0
- package/HiForm/HiFormControl.js +19 -27
- package/HiForm/HiInput.js +1 -1
- package/HiForm/HiSearchField.js +1 -1
- package/HiForm/index.js +9 -0
- package/HiPdfReader/HiPdfReader.js +282 -0
- package/HiPdfReader/index.js +16 -0
- package/HiPins/HiPins.js +0 -1
- package/HiSelect/HiSuggestSelect.js +2 -0
- package/HiSelectableList/HiSelectableListItem.js +23 -11
- package/HiTable/BodyCellBuilder.js +7 -8
- package/HiTable/BodyCells/CellLayout.js +25 -19
- package/HiTable/BodyCells/CellSentinel.js +12 -4
- package/HiTable/BodyCells/CellStatus.js +5 -1
- package/HiTable/BodyCells/CellText.js +2 -1
- package/HiTable/BodyRow.js +7 -1
- package/HiTable/ColumnFilter.js +5 -1
- package/HiTable/HeaderCell.js +17 -14
- package/HiTable/HiTable.js +25 -9
- package/HiTable/HiTableBody.js +38 -14
- package/HiTable/HiTableHead.js +22 -5
- package/HiTable/OrderColumns.js +6 -2
- package/es/HiBreadcrumb/HiBreadcrumb.js +73 -0
- package/es/HiBreadcrumb/HiStep.js +93 -0
- package/es/HiBreadcrumb/HiStepConnector.js +83 -0
- package/es/HiBreadcrumb/HiStepIcon.js +81 -0
- package/es/HiBreadcrumb/HiStepLabel.js +154 -0
- package/es/HiBreadcrumb/HiStepper.js +62 -0
- package/es/HiBreadcrumb/index.js +1 -0
- package/es/HiDatePicker/HiDateRangeSelector.js +1 -1
- package/es/HiDotsStepper/HiDot.js +92 -0
- package/es/HiDotsStepper/HiDotsStepper.js +83 -0
- package/es/HiDotsStepper/index.js +1 -0
- package/es/HiForm/HiAddressField.js +142 -0
- package/es/HiForm/HiFormControl.js +15 -15
- package/es/HiForm/HiInput.js +1 -1
- package/es/HiForm/HiSearchField.js +1 -1
- package/es/HiForm/index.js +2 -1
- package/es/HiPdfReader/HiPdfReader.js +198 -0
- package/es/HiPdfReader/index.js +1 -0
- package/es/HiPins/HiPins.js +0 -1
- package/es/HiSelect/HiSuggestSelect.js +2 -0
- package/es/HiSelectableList/HiSelectableListItem.js +22 -11
- package/es/HiTable/BodyCellBuilder.js +8 -9
- package/es/HiTable/BodyCells/CellLayout.js +27 -21
- package/es/HiTable/BodyCells/CellSentinel.js +12 -4
- package/es/HiTable/BodyCells/CellStatus.js +5 -1
- package/es/HiTable/BodyCells/CellText.js +2 -1
- package/es/HiTable/BodyRow.js +7 -1
- package/es/HiTable/ColumnFilter.js +5 -1
- package/es/HiTable/HeaderCell.js +17 -14
- package/es/HiTable/HiTable.js +25 -9
- package/es/HiTable/HiTableBody.js +34 -11
- package/es/HiTable/HiTableHead.js +17 -5
- package/es/HiTable/OrderColumns.js +6 -2
- package/es/styles/createHiMuiTheme.js +7 -0
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -1
- package/styles/createHiMuiTheme.js +7 -0
- package/umd/hipay-material-ui.development.js +2965 -2659
- package/umd/hipay-material-ui.production.min.js +4 -4
@@ -79,7 +79,6 @@ export default class BodyCellBuilder extends React.PureComponent {
|
|
79
79
|
datas,
|
80
80
|
view,
|
81
81
|
width,
|
82
|
-
fixedWidth,
|
83
82
|
padding,
|
84
83
|
align,
|
85
84
|
dense,
|
@@ -92,15 +91,15 @@ export default class BodyCellBuilder extends React.PureComponent {
|
|
92
91
|
numberLocale,
|
93
92
|
childrenCount,
|
94
93
|
onOpenDetails,
|
95
|
-
lookedUp
|
94
|
+
lookedUp,
|
95
|
+
fixedColumnWidth
|
96
96
|
} = _props,
|
97
|
-
props = _objectWithoutProperties(_props, ['ukey', 'type', 'datas', 'view', 'width', '
|
97
|
+
props = _objectWithoutProperties(_props, ['ukey', 'type', 'datas', 'view', 'width', 'padding', 'align', 'dense', 'ellipsis', 'onSelect', 'selectable', 'selected', 'sticky', 'dateLocale', 'numberLocale', 'childrenCount', 'onOpenDetails', 'lookedUp', 'fixedColumnWidth']);
|
98
98
|
|
99
99
|
const layoutProps = {
|
100
100
|
type,
|
101
101
|
view,
|
102
102
|
width,
|
103
|
-
fixedWidth,
|
104
103
|
align,
|
105
104
|
dense,
|
106
105
|
onSelect,
|
@@ -109,7 +108,8 @@ export default class BodyCellBuilder extends React.PureComponent {
|
|
109
108
|
selected,
|
110
109
|
sticky,
|
111
110
|
childrenCount,
|
112
|
-
lookedUp
|
111
|
+
lookedUp,
|
112
|
+
fixedColumnWidth
|
113
113
|
};
|
114
114
|
|
115
115
|
let cellElement;
|
@@ -165,7 +165,6 @@ export default class BodyCellBuilder extends React.PureComponent {
|
|
165
165
|
break;
|
166
166
|
|
167
167
|
case cst.TYPE_ICON:
|
168
|
-
if (view === cst.VIEWS.SMALL) layoutProps.fixedWidth = true;
|
169
168
|
cellElement = React.createElement(CellIcon, {
|
170
169
|
value: datas.value,
|
171
170
|
icon: datas.icon,
|
@@ -228,7 +227,6 @@ export default class BodyCellBuilder extends React.PureComponent {
|
|
228
227
|
|
229
228
|
case cst.TYPE_THIRD_PARTY_SECURITY:
|
230
229
|
layoutProps.align = 'center';
|
231
|
-
layoutProps.fixedWidth = true;
|
232
230
|
cellElement = React.createElement(CellThirdPartySecurity, {
|
233
231
|
value: datas.value,
|
234
232
|
code: datas.code,
|
@@ -298,9 +296,10 @@ BodyCellBuilder.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
298
296
|
*/
|
299
297
|
ellipsis: PropTypes.oneOf(['left', 'right', 'middle', 'name', 'after-first-word']),
|
300
298
|
/**
|
301
|
-
*
|
299
|
+
* Fixe la taille des colonnes selon le type de vue
|
300
|
+
* Sinon les colonnes s'adaptent à l'espace disponible
|
302
301
|
*/
|
303
|
-
|
302
|
+
fixedColumnWidth: PropTypes.bool,
|
304
303
|
/**
|
305
304
|
* Recherche lookup sur cette colonne
|
306
305
|
*/
|
@@ -28,6 +28,10 @@ export const styles = theme => ({
|
|
28
28
|
lookedUp: {
|
29
29
|
background: `linear-gradient(0deg, transparent 25%, #FFFF8D 10%, #FFFF8D 75%, transparent 30%)`,
|
30
30
|
borderRadius: '45%'
|
31
|
+
},
|
32
|
+
pins: {
|
33
|
+
position: 'relative',
|
34
|
+
top: 3
|
31
35
|
}
|
32
36
|
});
|
33
37
|
|
@@ -57,34 +61,35 @@ class CellLayout extends React.Component {
|
|
57
61
|
const {
|
58
62
|
classes, type, children,
|
59
63
|
align = cst.ALIGN_RIGHT_TYPES.includes(type) ? 'right' : 'left',
|
60
|
-
view, dense, width = cst.DEFAULT_WIDTHS[type][view],
|
64
|
+
view, dense, width = cst.DEFAULT_WIDTHS[type][view], fixedColumnWidth, sticky,
|
61
65
|
selectable, selected, onSelect, childrenCount, theme, padding,
|
62
66
|
lookedUp
|
63
67
|
} = this.props;
|
64
68
|
|
65
|
-
|
69
|
+
const offset = selectable ? dense ? 32 : 40 : 0;
|
66
70
|
|
67
71
|
// Inclus le padding et/ou la checkbox dans la largeur de la cellule
|
68
|
-
|
72
|
+
const _width = width + offset + (selectable ? padding : 2 * padding);
|
69
73
|
|
70
74
|
const lookedUpClassName = classNames(classes.flexContent, { [classes.lookedUp]: lookedUp });
|
71
75
|
|
76
|
+
const cellStyle = {
|
77
|
+
zIndex: sticky ? 12 : 11,
|
78
|
+
textAlign: align,
|
79
|
+
position: sticky ? 'relative' : 'inherit',
|
80
|
+
border: 'none',
|
81
|
+
height: dense ? cst.CELL_HEIGHT_DENSE : cst.CELL_HEIGHT
|
82
|
+
};
|
83
|
+
|
84
|
+
if (fixedColumnWidth) {
|
85
|
+
cellStyle.maxWidth = _width;
|
86
|
+
cellStyle.minWidth = _width;
|
87
|
+
cellStyle.width = _width;
|
88
|
+
}
|
89
|
+
|
72
90
|
return React.createElement(
|
73
91
|
TableCell,
|
74
|
-
{
|
75
|
-
className: classes.root,
|
76
|
-
style: {
|
77
|
-
maxWidth: _width,
|
78
|
-
minWidth: _width,
|
79
|
-
width: _width,
|
80
|
-
// la cellule sticky doit être au dessus des autres cellules du body
|
81
|
-
zIndex: sticky ? 12 : 11,
|
82
|
-
textAlign: align,
|
83
|
-
position: sticky ? 'relative' : 'inherit',
|
84
|
-
border: 'none',
|
85
|
-
height: dense ? cst.CELL_HEIGHT_DENSE : cst.CELL_HEIGHT
|
86
|
-
}
|
87
|
-
},
|
92
|
+
{ className: classes.root, style: cellStyle },
|
88
93
|
!!selectable && React.createElement(HiCheckbox, {
|
89
94
|
classes: { root: classes.checkbox },
|
90
95
|
style: { margin: dense ? 6 : 10 },
|
@@ -115,7 +120,7 @@ class CellLayout extends React.Component {
|
|
115
120
|
},
|
116
121
|
React.createElement(
|
117
122
|
HiPins,
|
118
|
-
{ color: theme.palette.business.primary.normal },
|
123
|
+
{ color: theme.palette.business.primary.normal, className: classes.pins },
|
119
124
|
childrenCount
|
120
125
|
)
|
121
126
|
)
|
@@ -129,7 +134,7 @@ CellLayout.defaultProps = {
|
|
129
134
|
selectable: false,
|
130
135
|
selected: false,
|
131
136
|
dense: false,
|
132
|
-
|
137
|
+
fixedColumnWidth: true,
|
133
138
|
sticky: false,
|
134
139
|
padding: 8
|
135
140
|
};
|
@@ -163,9 +168,10 @@ CellLayout.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
163
168
|
*/
|
164
169
|
width: PropTypes.number,
|
165
170
|
/**
|
166
|
-
*
|
171
|
+
* Fixe la taille des colonnes selon le type de vue
|
172
|
+
* Sinon les colonnes s'adaptent à l'espace disponible
|
167
173
|
*/
|
168
|
-
|
174
|
+
fixedColumnWidth: PropTypes.bool,
|
169
175
|
/**
|
170
176
|
* Title alignement, est déduit de type par défaut
|
171
177
|
*/
|
@@ -21,7 +21,7 @@ export const styles = theme => ({
|
|
21
21
|
class CellSentinel extends React.PureComponent {
|
22
22
|
|
23
23
|
constructor(props) {
|
24
|
-
super();
|
24
|
+
super(props);
|
25
25
|
|
26
26
|
this.getColorFromFraudResult = this.getColorFromFraudResult.bind(this);
|
27
27
|
}
|
@@ -66,7 +66,8 @@ class CellSentinel extends React.PureComponent {
|
|
66
66
|
fraudResult,
|
67
67
|
automaticFraudReviewResult,
|
68
68
|
pendingManualAction,
|
69
|
-
smartDecision
|
69
|
+
smartDecision,
|
70
|
+
hideFraudResult
|
70
71
|
} = this.props;
|
71
72
|
|
72
73
|
const scoreLabel = score > 0 ? `+${score}` : `${score}`;
|
@@ -97,14 +98,14 @@ class CellSentinel extends React.PureComponent {
|
|
97
98
|
{ title: tooltipContent, placement: this.props.sticky ? 'right' : 'bottom' },
|
98
99
|
React.createElement(
|
99
100
|
'div',
|
100
|
-
|
101
|
+
{ style: { textAlign: 'right' } },
|
101
102
|
React.createElement(HiColoredLabel, {
|
102
103
|
label: scoreLabel,
|
103
104
|
color: this.getColorFromFraudResult(fraudResult.toLowerCase()),
|
104
105
|
classes: { root: classes.label },
|
105
106
|
active: pendingManualAction
|
106
107
|
}),
|
107
|
-
React.createElement(HiColoredLabel, {
|
108
|
+
!hideFraudResult && React.createElement(HiColoredLabel, {
|
108
109
|
label: fraudResult.toUpperCase().substr(0, 1),
|
109
110
|
color: this.getColorFromFraudResult(fraudResult),
|
110
111
|
classes: { root: classes.label },
|
@@ -124,6 +125,9 @@ class CellSentinel extends React.PureComponent {
|
|
124
125
|
}
|
125
126
|
}
|
126
127
|
|
128
|
+
CellSentinel.defaultProps = {
|
129
|
+
hideFraudResult: false
|
130
|
+
};
|
127
131
|
CellSentinel.propTypes = process.env.NODE_ENV !== "production" ? {
|
128
132
|
/**
|
129
133
|
* Résultat de l'automaticFraudReview si la transaction est passée par SmartDecision
|
@@ -137,6 +141,10 @@ CellSentinel.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
137
141
|
* Résultat de la fraude
|
138
142
|
*/
|
139
143
|
fraudResult: PropTypes.string.isRequired,
|
144
|
+
/**
|
145
|
+
* Si true le fraudResult ne sera pas affiché
|
146
|
+
*/
|
147
|
+
hideFraudResult: PropTypes.bool.isRequired,
|
140
148
|
/**
|
141
149
|
* Signal qu'il attend une réponse manuelle
|
142
150
|
*/
|
@@ -11,6 +11,10 @@ export const styles = theme => ({
|
|
11
11
|
display: 'inline-flex',
|
12
12
|
alignItems: 'baseline',
|
13
13
|
maxWidth: 'calc(100% - 36px)'
|
14
|
+
},
|
15
|
+
pins: {
|
16
|
+
position: 'relative',
|
17
|
+
bottom: 1
|
14
18
|
}
|
15
19
|
});
|
16
20
|
|
@@ -33,7 +37,7 @@ class CellStatus extends React.PureComponent {
|
|
33
37
|
React.createElement(HiColoredLabel, { label: value, color: color }),
|
34
38
|
React.createElement(
|
35
39
|
HiPins,
|
36
|
-
{ color: color, onClick: onOpenDetails },
|
40
|
+
{ color: color, onClick: onOpenDetails, className: classes.pins },
|
37
41
|
nbOperations
|
38
42
|
)
|
39
43
|
) : React.createElement(HiColoredLabel, { label: value, color: color })
|
package/es/HiTable/BodyRow.js
CHANGED
@@ -241,7 +241,8 @@ BodyRow.defaultProps = {
|
|
241
241
|
sticky: false,
|
242
242
|
live: false,
|
243
243
|
innerRow: false,
|
244
|
-
lookupColumns: []
|
244
|
+
lookupColumns: [],
|
245
|
+
fixedColumnWidth: true
|
245
246
|
};
|
246
247
|
BodyRow.propTypes = process.env.NODE_ENV !== "production" ? {
|
247
248
|
/**
|
@@ -252,6 +253,11 @@ BodyRow.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
252
253
|
* Densité d'affichage (joue sur la hauteur des lignes)
|
253
254
|
*/
|
254
255
|
dense: PropTypes.bool,
|
256
|
+
/**
|
257
|
+
* Fixe la taille des colonnes selon le type de vue
|
258
|
+
* Sinon les colonnes s'adaptent à l'espace disponible
|
259
|
+
*/
|
260
|
+
fixedColumnWidth: PropTypes.bool,
|
255
261
|
/**
|
256
262
|
* Applique le style d'une ligne intégrée a un sous-tableau
|
257
263
|
*/
|
@@ -253,7 +253,11 @@ class ColumnFilter extends React.Component {
|
|
253
253
|
React.createElement(
|
254
254
|
'div',
|
255
255
|
{ className: classes.menuItemFilter },
|
256
|
-
|
256
|
+
React.createElement(
|
257
|
+
'span',
|
258
|
+
{ style: { marginRight: 4 } },
|
259
|
+
translations.filter
|
260
|
+
),
|
257
261
|
React.createElement(
|
258
262
|
HiPins,
|
259
263
|
{
|
package/es/HiTable/HeaderCell.js
CHANGED
@@ -141,7 +141,7 @@ class HeaderCell extends React.PureComponent {
|
|
141
141
|
view,
|
142
142
|
dense,
|
143
143
|
width = cst.DEFAULT_WIDTHS[type][view],
|
144
|
-
|
144
|
+
fixedColumnWidth,
|
145
145
|
align = cst.ALIGN_RIGHT_TYPES.includes(type) ? 'right' : 'left',
|
146
146
|
sticky,
|
147
147
|
padding,
|
@@ -178,19 +178,22 @@ class HeaderCell extends React.PureComponent {
|
|
178
178
|
|
179
179
|
const lookedUpClassName = classNames({ [classes.lookedUp]: lookedUp });
|
180
180
|
|
181
|
+
const cellStyle = {
|
182
|
+
padding: 0,
|
183
|
+
zIndex: sticky ? 13 : 12, // la cellule sticky doit être au dessus des autres cellules du header
|
184
|
+
backgroundColor: 'inherit',
|
185
|
+
textAlign: align
|
186
|
+
};
|
187
|
+
|
188
|
+
if (fixedColumnWidth) {
|
189
|
+
cellStyle.maxWidth = _width;
|
190
|
+
cellStyle.minWidth = _width;
|
191
|
+
cellStyle.width = _width;
|
192
|
+
}
|
193
|
+
|
181
194
|
return React.createElement(
|
182
195
|
TableCell,
|
183
|
-
{
|
184
|
-
style: {
|
185
|
-
maxWidth: _width,
|
186
|
-
minWidth: _width,
|
187
|
-
width: _width,
|
188
|
-
padding: 0,
|
189
|
-
zIndex: sticky ? 13 : 12, // la cellule sticky doit être au dessus des autres cellules du header
|
190
|
-
backgroundColor: 'inherit',
|
191
|
-
textAlign: align
|
192
|
-
}
|
193
|
-
},
|
196
|
+
{ style: cellStyle },
|
194
197
|
React.createElement(
|
195
198
|
'div',
|
196
199
|
null,
|
@@ -279,7 +282,7 @@ HeaderCell.defaultProps = {
|
|
279
282
|
sortDirection: 'asc',
|
280
283
|
view: 'l',
|
281
284
|
dense: false,
|
282
|
-
|
285
|
+
fixedColumnWidth: true,
|
283
286
|
sticky: true,
|
284
287
|
padding: 8
|
285
288
|
};
|
@@ -359,7 +362,7 @@ HeaderCell.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
359
362
|
/**
|
360
363
|
* La largeur de la cellule est fixé (toutes les colonnes sauf une)
|
361
364
|
*/
|
362
|
-
|
365
|
+
fixedColumnWidth: PropTypes.bool,
|
363
366
|
/**
|
364
367
|
* Title alignement, est déduit de type par défaut
|
365
368
|
*/
|
package/es/HiTable/HiTable.js
CHANGED
@@ -581,7 +581,9 @@ class HiTable extends React.Component {
|
|
581
581
|
translations,
|
582
582
|
view,
|
583
583
|
groupBy,
|
584
|
-
lookupColumns
|
584
|
+
lookupColumns,
|
585
|
+
loading,
|
586
|
+
fixedColumnWidth
|
585
587
|
} = this.props;
|
586
588
|
|
587
589
|
const { dateUpdate, isScrollToBottom, groupByIds } = this.state;
|
@@ -627,7 +629,8 @@ class HiTable extends React.Component {
|
|
627
629
|
sticky: sticky,
|
628
630
|
view: view,
|
629
631
|
translations: translations,
|
630
|
-
lookupColumns: lookupColumns
|
632
|
+
lookupColumns: lookupColumns,
|
633
|
+
fixedColumnWidth: fixedColumnWidth
|
631
634
|
}),
|
632
635
|
React.createElement(HiTableBody, {
|
633
636
|
tabId: tabId,
|
@@ -652,7 +655,9 @@ class HiTable extends React.Component {
|
|
652
655
|
groupBy: groupBy,
|
653
656
|
onClickNext: this.handleNextStickyRow,
|
654
657
|
groupByIds: groupByIds,
|
655
|
-
lookupColumns: lookupColumns
|
658
|
+
lookupColumns: lookupColumns,
|
659
|
+
loading: loading,
|
660
|
+
fixedColumnWidth: fixedColumnWidth
|
656
661
|
}),
|
657
662
|
infiniteScroll && React.createElement(HiTableFooterScroll, {
|
658
663
|
tabId: tabId,
|
@@ -717,7 +722,9 @@ HiTable.defaultProps = {
|
|
717
722
|
}
|
718
723
|
},
|
719
724
|
view: 'l',
|
720
|
-
lookupColumns: []
|
725
|
+
lookupColumns: [],
|
726
|
+
loading: false,
|
727
|
+
fixedColumnWidth: true
|
721
728
|
};
|
722
729
|
HiTable.propTypes = process.env.NODE_ENV !== "production" ? {
|
723
730
|
/**
|
@@ -748,6 +755,15 @@ HiTable.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
748
755
|
* Active le filtre sur les colonnes filtrables
|
749
756
|
*/
|
750
757
|
filterable: PropTypes.bool,
|
758
|
+
/**
|
759
|
+
* Fixe la taille des colonnes selon le type de vue
|
760
|
+
* Sinon les colonnes s'adaptent à l'espace disponible
|
761
|
+
*/
|
762
|
+
fixedColumnWidth: PropTypes.bool,
|
763
|
+
/**
|
764
|
+
* Id de la colonne par laquelle sont regroupé les éléments
|
765
|
+
*/
|
766
|
+
groupBy: PropTypes.string,
|
751
767
|
/**
|
752
768
|
* Ajoute le loader et le requestNextDatas en fin de tableau (si infiniteScroll activé)
|
753
769
|
*/
|
@@ -760,6 +776,10 @@ HiTable.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
760
776
|
* Ajoute l'infinite scroll
|
761
777
|
*/
|
762
778
|
infiniteScroll: PropTypes.bool,
|
779
|
+
/**
|
780
|
+
* État du tableau en cours de chargement des données
|
781
|
+
*/
|
782
|
+
loading: PropTypes.bool,
|
763
783
|
/**
|
764
784
|
* Identifiant de la ou des colonnes sur la/lesquelles il y a une 'lookup' search
|
765
785
|
*/
|
@@ -867,10 +887,6 @@ HiTable.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
867
887
|
* Taille du tableau (L/M/S),
|
868
888
|
* définit l'espace entre les cellules et leurs tailles par default
|
869
889
|
*/
|
870
|
-
view: PropTypes.oneOf(['l', 'm', 's'])
|
871
|
-
/**
|
872
|
-
* Id de la colonne par laquelle sont regroupé les éléments
|
873
|
-
*/
|
874
|
-
groupBy: PropTypes.string
|
890
|
+
view: PropTypes.oneOf(['l', 'm', 's'])
|
875
891
|
} : {};
|
876
892
|
export default withStyles(styles, { withTheme: true, name: 'HmuiHiTable' })(HiTable);
|
@@ -2,23 +2,24 @@ import _extends from 'babel-runtime/helpers/extends';
|
|
2
2
|
import React from 'react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import { TableBody, TableRow } from 'material-ui/Table';
|
5
|
-
import
|
5
|
+
import classNames from 'classnames';
|
6
|
+
import { withStyles } from '../styles';
|
6
7
|
import BodyRow from './BodyRow';
|
7
8
|
import ChildRow from './ChildRow';
|
8
9
|
import HiStickyRow from './HiStickyRow';
|
9
10
|
import * as cst from './constants';
|
10
|
-
import { SORTED_COLUMN_ERROR_MESSAGE } from './HiTableHead';
|
11
|
-
import isRequiredIf from 'react-proptype-conditional-require';
|
12
11
|
|
13
12
|
export const styles = theme => ({
|
14
13
|
tbody: {
|
15
14
|
position: 'relative',
|
16
|
-
|
17
|
-
, width: '100%',
|
15
|
+
width: '100%',
|
18
16
|
overflowX: 'hidden',
|
19
17
|
overflowY: 'auto',
|
20
18
|
zIndex: 11
|
21
19
|
},
|
20
|
+
tbodyFixedWidth: {
|
21
|
+
display: 'block' /* seperates the tbody from the header */
|
22
|
+
},
|
22
23
|
tbodyRows: {
|
23
24
|
backgroundColor: theme.palette.background3
|
24
25
|
},
|
@@ -191,7 +192,9 @@ class HiTableBody extends React.Component {
|
|
191
192
|
numberLocale,
|
192
193
|
groupByIds,
|
193
194
|
sortedColumnId,
|
194
|
-
lookupColumns
|
195
|
+
lookupColumns,
|
196
|
+
loading,
|
197
|
+
fixedColumnWidth
|
195
198
|
} = this.props;
|
196
199
|
|
197
200
|
const { openedParentRowId, openedDetailsRowIdList } = this.state;
|
@@ -288,7 +291,8 @@ class HiTableBody extends React.Component {
|
|
288
291
|
row,
|
289
292
|
sticky,
|
290
293
|
tabId,
|
291
|
-
view
|
294
|
+
view,
|
295
|
+
fixedColumnWidth
|
292
296
|
});
|
293
297
|
|
294
298
|
if (hasChildren && openedParentRowId === row.rowId) {
|
@@ -317,7 +321,8 @@ class HiTableBody extends React.Component {
|
|
317
321
|
view,
|
318
322
|
dense,
|
319
323
|
sticky,
|
320
|
-
isDetail: true
|
324
|
+
isDetail: true,
|
325
|
+
fixedColumnWidth
|
321
326
|
};
|
322
327
|
|
323
328
|
tableRows.push(React.createElement(BodyRow, _extends({ key: `${row.rowId}-${detailRow.rowId}` }, detailRowProps)));
|
@@ -325,12 +330,20 @@ class HiTableBody extends React.Component {
|
|
325
330
|
}
|
326
331
|
});
|
327
332
|
|
333
|
+
const tBodyClasses = classNames(classes.tbody, {
|
334
|
+
[classes.tbodyFixedWidth]: fixedColumnWidth
|
335
|
+
});
|
336
|
+
|
328
337
|
return React.createElement(
|
329
338
|
TableBody,
|
330
339
|
{
|
331
340
|
id: `${tabId}-body`,
|
332
|
-
className:
|
333
|
-
style: {
|
341
|
+
className: tBodyClasses,
|
342
|
+
style: _extends({
|
343
|
+
height
|
344
|
+
}, loading && {
|
345
|
+
opacity: 0.6
|
346
|
+
}),
|
334
347
|
onScroll: onScroll
|
335
348
|
},
|
336
349
|
tableRows.map(tableRow => {
|
@@ -349,7 +362,8 @@ HiTableBody.defaultProps = {
|
|
349
362
|
dense: false,
|
350
363
|
height: 450,
|
351
364
|
sticky: true,
|
352
|
-
view: 'l'
|
365
|
+
view: 'l',
|
366
|
+
loading: false
|
353
367
|
};
|
354
368
|
HiTableBody.propTypes = process.env.NODE_ENV !== "production" ? {
|
355
369
|
/**
|
@@ -377,10 +391,19 @@ HiTableBody.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
377
391
|
* Densité d'affichage (joue sur la hauteur des lignes)
|
378
392
|
*/
|
379
393
|
dense: PropTypes.bool,
|
394
|
+
/**
|
395
|
+
* Fixe la taille des colonnes selon le type de vue
|
396
|
+
* Sinon les colonnes s'adaptent à l'espace disponible
|
397
|
+
*/
|
398
|
+
fixedColumnWidth: PropTypes.bool,
|
380
399
|
/**
|
381
400
|
* Hauteur du tableau (px)
|
382
401
|
*/
|
383
402
|
height: PropTypes.number,
|
403
|
+
/**
|
404
|
+
* État du tableau en cours de chargement des données
|
405
|
+
*/
|
406
|
+
loading: PropTypes.bool,
|
384
407
|
/**
|
385
408
|
* Identifiant de la ou des colonnes sur la/lesquelles il y a une 'lookup' search
|
386
409
|
*/
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
3
3
|
import { findDOMNode } from 'react-dom';
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import isRequiredIf from 'react-proptype-conditional-require';
|
6
|
+
import classNames from 'classnames';
|
6
7
|
|
7
8
|
import { TableHead, TableRow, TableCell } from 'material-ui/Table';
|
8
9
|
import PlusCircleIcon from 'mdi-material-ui/PlusCircle';
|
@@ -18,11 +19,13 @@ import { MANDATORY_COLUMN_ERROR_MESSAGE } from './HiTable';
|
|
18
19
|
export const styles = theme => ({
|
19
20
|
thead: {
|
20
21
|
position: 'relative',
|
21
|
-
|
22
|
-
, width: '100%',
|
22
|
+
width: '100%',
|
23
23
|
overflow: 'visible',
|
24
24
|
zIndex: 12
|
25
25
|
},
|
26
|
+
theadFixedWidth: {
|
27
|
+
display: 'block' /*seperates the header from the body allowing it to be positioned*/
|
28
|
+
},
|
26
29
|
theadRow: {
|
27
30
|
backgroundColor: theme.palette.background3,
|
28
31
|
zIndex: 12
|
@@ -148,13 +151,16 @@ class HiTableHead extends React.Component {
|
|
148
151
|
sticky,
|
149
152
|
translations,
|
150
153
|
view,
|
151
|
-
lookupColumns
|
154
|
+
lookupColumns,
|
155
|
+
fixedColumnWidth
|
152
156
|
} = this.props;
|
153
157
|
|
154
158
|
const { hovered, openedOrderColumns, orderColumnsAnchorEl } = this.state;
|
155
159
|
|
156
160
|
let headerProps = _extends({
|
157
|
-
className: classes.thead
|
161
|
+
className: classNames(classes.thead, {
|
162
|
+
[classes.theadFixedWidth]: fixedColumnWidth
|
163
|
+
})
|
158
164
|
}, orderable && { onMouseEnter: this.handleEvent, onMouseLeave: this.handleEvent });
|
159
165
|
|
160
166
|
let unfixedColumnIsSet = false,
|
@@ -221,7 +227,8 @@ class HiTableHead extends React.Component {
|
|
221
227
|
fixedWidth: fixed,
|
222
228
|
align: column['align'],
|
223
229
|
sticky: firstColumn && sticky,
|
224
|
-
lookedUp: lookupColumns.includes(column.colId)
|
230
|
+
lookedUp: lookupColumns.includes(column.colId),
|
231
|
+
fixedColumnWidth: fixedColumnWidth
|
225
232
|
});
|
226
233
|
}
|
227
234
|
}),
|
@@ -329,6 +336,11 @@ HiTableHead.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
329
336
|
* Active le filtre sur les colonnes filtrables
|
330
337
|
*/
|
331
338
|
filterable: PropTypes.bool,
|
339
|
+
/**
|
340
|
+
* Fixe la taille des colonnes selon le type de vue
|
341
|
+
* Sinon les colonnes s'adaptent à l'espace disponible
|
342
|
+
*/
|
343
|
+
fixedColumnWidth: PropTypes.bool,
|
332
344
|
/**
|
333
345
|
* Identifiant de la ou des colonnes sur la/lesquelles il y a une 'lookup' search
|
334
346
|
*/
|
@@ -63,7 +63,8 @@ export const styles = theme => ({
|
|
63
63
|
controlLabelRoot: {
|
64
64
|
marginLeft: 6,
|
65
65
|
marginBottom: 8,
|
66
|
-
fontSize: 15
|
66
|
+
fontSize: 15,
|
67
|
+
width: 160
|
67
68
|
},
|
68
69
|
switchLabelRoot: {
|
69
70
|
marginLeft: 15,
|
@@ -72,7 +73,10 @@ export const styles = theme => ({
|
|
72
73
|
columnLabel: {
|
73
74
|
position: 'relative',
|
74
75
|
top: 5,
|
75
|
-
left: 5
|
76
|
+
left: 5,
|
77
|
+
overflow: 'hidden',
|
78
|
+
textOverflow: 'ellipsis',
|
79
|
+
whiteSpace: 'nowrap'
|
76
80
|
},
|
77
81
|
label: {
|
78
82
|
fontWeight: 'inherit'
|
@@ -89,6 +89,9 @@ const light = {
|
|
89
89
|
appBar: '#fff',
|
90
90
|
paper: '#fff',
|
91
91
|
default: grey[50]
|
92
|
+
},
|
93
|
+
dot: {
|
94
|
+
neutral: '#707070'
|
92
95
|
}
|
93
96
|
};
|
94
97
|
|
@@ -156,6 +159,9 @@ const dark = {
|
|
156
159
|
appBar: '#fff',
|
157
160
|
paper: '#fff',
|
158
161
|
default: grey[50]
|
162
|
+
},
|
163
|
+
dot: {
|
164
|
+
neutral: '#707070'
|
159
165
|
}
|
160
166
|
};
|
161
167
|
|
@@ -275,6 +281,7 @@ function createHiMuiTheme(options = {}) {
|
|
275
281
|
inputDisabled: shades[type].inputDisabled,
|
276
282
|
tableLine: shades[type].tableLine,
|
277
283
|
background: shades[type].background,
|
284
|
+
dot: shades[type].dot,
|
278
285
|
status: statusPalette,
|
279
286
|
primary: blue,
|
280
287
|
secondary: yellow
|
package/index.es.js
CHANGED
package/index.js
CHANGED