@hipay/hipay-material-ui 1.0.0-beta.20 → 1.0.0-beta.22
Sign up to get free protection for your applications and to get access to all the features.
- package/HiLoader/HiLoader.js +9 -5
- package/HiSelect/HiSelect.js +47 -12
- package/HiSelect/HiSuggestSelect.js +35 -5
- package/HiSelectableList/HiSelectableListItem.js +30 -37
- package/HiTable/HeaderCell.js +55 -49
- package/HiTable/HiTable.js +4 -14
- package/HiTable/HiTableHead.js +4 -6
- package/HiTopBar/HiTopBar.js +10 -3
- package/es/HiLoader/HiLoader.js +9 -5
- package/es/HiSelect/HiSelect.js +41 -10
- package/es/HiSelect/HiSuggestSelect.js +33 -5
- package/es/HiSelectableList/HiSelectableListItem.js +30 -37
- package/es/HiTable/HeaderCell.js +64 -59
- package/es/HiTable/HiTable.js +4 -14
- package/es/HiTable/HiTableHead.js +4 -6
- package/es/HiTopBar/HiTopBar.js +11 -4
- package/es/utils/hiHelpers.js +3 -3
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/umd/hipay-material-ui.development.js +204 -143
- package/umd/hipay-material-ui.production.min.js +4 -4
- package/utils/hiHelpers.js +3 -3
package/HiLoader/HiLoader.js
CHANGED
@@ -30,11 +30,15 @@ function HiLoader(props) {
|
|
30
30
|
loading = props.loading;
|
31
31
|
|
32
32
|
|
33
|
-
return _react2.default.createElement(
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
return _react2.default.createElement(
|
34
|
+
'div',
|
35
|
+
{ id: 'hi-loader' },
|
36
|
+
_react2.default.createElement(_reactSpinners.PropagateLoader, {
|
37
|
+
loading: loading,
|
38
|
+
size: 12,
|
39
|
+
color: theme.palette.business.primary.normal
|
40
|
+
})
|
41
|
+
);
|
38
42
|
}
|
39
43
|
|
40
44
|
HiLoader.propTypes = process.env.NODE_ENV !== "production" ? {
|
package/HiSelect/HiSelect.js
CHANGED
@@ -13,6 +13,10 @@ var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
|
|
13
13
|
|
14
14
|
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
|
15
15
|
|
16
|
+
var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');
|
17
|
+
|
18
|
+
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
|
19
|
+
|
16
20
|
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
17
21
|
|
18
22
|
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
@@ -103,7 +107,7 @@ var styles = exports.styles = function styles(theme) {
|
|
103
107
|
},
|
104
108
|
popper: {
|
105
109
|
width: '100%',
|
106
|
-
zIndex:
|
110
|
+
zIndex: 1200
|
107
111
|
},
|
108
112
|
paper: {
|
109
113
|
borderRadius: '0px 2px',
|
@@ -174,6 +178,11 @@ var HiSelect = function (_React$PureComponent) {
|
|
174
178
|
valueInOptions = true;
|
175
179
|
}
|
176
180
|
});
|
181
|
+
if (!valueInOptions && props.pinnedItem) {
|
182
|
+
if (props.value.indexOf(props.pinnedItem.id) >= 0) {
|
183
|
+
valueInOptions = true;
|
184
|
+
}
|
185
|
+
}
|
177
186
|
}
|
178
187
|
|
179
188
|
if (!valueInOptions) {
|
@@ -303,7 +312,8 @@ var HiSelect = function (_React$PureComponent) {
|
|
303
312
|
hierarchic = _props.hierarchic,
|
304
313
|
id = _props.id,
|
305
314
|
placeholder = _props.placeholder,
|
306
|
-
staticPosition = _props.staticPosition
|
315
|
+
staticPosition = _props.staticPosition,
|
316
|
+
pinnedItem = _props.pinnedItem;
|
307
317
|
var _state = this.state,
|
308
318
|
open = _state.open,
|
309
319
|
suggestions = _state.suggestions,
|
@@ -313,6 +323,11 @@ var HiSelect = function (_React$PureComponent) {
|
|
313
323
|
var display = '';
|
314
324
|
var selectedIdList = Array.isArray(value) ? value : value ? [value] : [];
|
315
325
|
|
326
|
+
var _suggestions = [].concat((0, _toConsumableArray3.default)(suggestions));
|
327
|
+
if (pinnedItem) {
|
328
|
+
_suggestions = [pinnedItem].concat((0, _toConsumableArray3.default)(suggestions));
|
329
|
+
}
|
330
|
+
|
316
331
|
if (this.state.dynamic && selectedIdList.length === 1) {
|
317
332
|
display = translations.one_item_selected.replace('%s', selectedIdList.length);
|
318
333
|
} else if (this.state.nbOptions !== selectedIdList.length && selectedIdList.length > 1) {
|
@@ -321,9 +336,13 @@ var HiSelect = function (_React$PureComponent) {
|
|
321
336
|
display = translations.all;
|
322
337
|
} else if (selectedIdList.length === 1) {
|
323
338
|
if (type !== 'icon') {
|
324
|
-
|
339
|
+
var item = options.find(function (o) {
|
325
340
|
return o.id === selectedIdList[0];
|
326
|
-
})
|
341
|
+
});
|
342
|
+
if (!item && pinnedItem) {
|
343
|
+
item = pinnedItem;
|
344
|
+
}
|
345
|
+
display = item.label;
|
327
346
|
} else {
|
328
347
|
var optionSelected = options.find(function (o) {
|
329
348
|
return o.id === selectedIdList[0];
|
@@ -380,7 +399,7 @@ var HiSelect = function (_React$PureComponent) {
|
|
380
399
|
_react2.default.createElement(_HiSelectableList2.default, {
|
381
400
|
type: type,
|
382
401
|
parentItemSelectable: parentItemSelectable,
|
383
|
-
itemList:
|
402
|
+
itemList: _suggestions,
|
384
403
|
onSelect: this.handleSelect,
|
385
404
|
selectedIdList: selectedIdList,
|
386
405
|
checkbox: checkbox,
|
@@ -490,7 +509,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
490
509
|
_this3.handleClose();
|
491
510
|
} else {
|
492
511
|
if (!_this3.props.staticPosition) {
|
493
|
-
document.body.style.overflow = 'hidden';
|
512
|
+
//document.body.style.overflow = 'hidden';
|
494
513
|
}
|
495
514
|
_this3.setState({ open: true });
|
496
515
|
var options = _this3.props.options.slice();
|
@@ -554,7 +573,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
554
573
|
nextItem = (0, _hiHelpers.getNextItemSelectable)(document.activeElement, 'up');
|
555
574
|
} else if (event.key === 'Tab') {
|
556
575
|
if (!_this3.props.staticPosition) {
|
557
|
-
document.body.style.overflow = 'auto';
|
576
|
+
//document.body.style.overflow = 'auto';
|
558
577
|
}
|
559
578
|
_this3.setState({ open: false });
|
560
579
|
}
|
@@ -579,7 +598,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
579
598
|
|
580
599
|
this.handleClose = function () {
|
581
600
|
if (!_this3.props.staticPosition) {
|
582
|
-
document.body.style.overflow = 'auto';
|
601
|
+
//document.body.style.overflow = 'auto';
|
583
602
|
}
|
584
603
|
_this3.setState({
|
585
604
|
open: false
|
@@ -604,10 +623,10 @@ var _initialiseProps = function _initialiseProps() {
|
|
604
623
|
var _props2 = _this3.props,
|
605
624
|
multiple = _props2.multiple,
|
606
625
|
value = _props2.value,
|
607
|
-
name = _props2.name,
|
608
626
|
onChange = _props2.onChange,
|
609
627
|
options = _props2.options,
|
610
|
-
hierarchic = _props2.hierarchic
|
628
|
+
hierarchic = _props2.hierarchic,
|
629
|
+
pinnedItem = _props2.pinnedItem;
|
611
630
|
var _state2 = _this3.state,
|
612
631
|
hierarchySelected = _state2.hierarchySelected,
|
613
632
|
hierarchy = _state2.hierarchy,
|
@@ -656,8 +675,20 @@ var _initialiseProps = function _initialiseProps() {
|
|
656
675
|
hiSelected[item.parentId].splice(hiSelected[item.parentId].indexOf(item.id), 1);
|
657
676
|
}
|
658
677
|
} else {
|
659
|
-
|
660
|
-
|
678
|
+
if (pinnedItem && item.id === pinnedItem.id) {
|
679
|
+
(0, _keys2.default)(hiSelected).map(function (parentItemId) {
|
680
|
+
hiSelected[parentItemId] = [];
|
681
|
+
return true;
|
682
|
+
});
|
683
|
+
valueList = [item.id];
|
684
|
+
} else {
|
685
|
+
// item non sélectionné => on le sélectionne
|
686
|
+
if (item.hasChildren !== true) valueList.push(item.id);
|
687
|
+
|
688
|
+
if (pinnedItem && valueList.includes(pinnedItem.id)) {
|
689
|
+
valueList.splice(valueList.indexOf(pinnedItem.id), 1);
|
690
|
+
}
|
691
|
+
}
|
661
692
|
|
662
693
|
if (item.hasChildren === true) {
|
663
694
|
// Si item parent => on ajoute tous les enfants
|
@@ -848,6 +879,10 @@ HiSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
848
879
|
* Les items parents sont sélectionnables
|
849
880
|
*/
|
850
881
|
parentItemSelectable: _propTypes2.default.bool,
|
882
|
+
/**
|
883
|
+
* Item épinglé en début de liste
|
884
|
+
*/
|
885
|
+
pinnedItem: _propTypes2.default.object,
|
851
886
|
/**
|
852
887
|
* Placeholder affiché lorsque le select est fermé
|
853
888
|
* Surcharge le placeholder par défaut
|
@@ -186,15 +186,31 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
186
186
|
|
187
187
|
var _props = this.props,
|
188
188
|
classes = _props.classes,
|
189
|
-
translations = _props.translations,
|
190
189
|
id = _props.id,
|
190
|
+
showMinLength = _props.showMinLength,
|
191
|
+
showNoResults = _props.showNoResults,
|
191
192
|
onSearch = _props.onSearch,
|
192
|
-
|
193
|
+
translations = _props.translations,
|
194
|
+
otherProps = (0, _objectWithoutProperties3.default)(_props, ['classes', 'id', 'showMinLength', 'showNoResults', 'onSearch', 'translations']);
|
193
195
|
var _state = this.state,
|
194
196
|
focused = _state.focused,
|
195
197
|
options = _state.options;
|
196
198
|
|
197
|
-
|
199
|
+
|
200
|
+
var optionsShown = options;
|
201
|
+
|
202
|
+
// If no results match
|
203
|
+
if (options.length === 0 && (showNoResults || showMinLength)) {
|
204
|
+
optionsShown = [{
|
205
|
+
id: '_no_result',
|
206
|
+
type: 'text',
|
207
|
+
disabled: true,
|
208
|
+
centered: true,
|
209
|
+
checkbox: false,
|
210
|
+
label: showNoResults ? translations.no_result_match : translations.min_length
|
211
|
+
}];
|
212
|
+
}
|
213
|
+
var open = !!optionsShown.length && focused;
|
198
214
|
|
199
215
|
return _react2.default.createElement(
|
200
216
|
'div',
|
@@ -211,6 +227,7 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
211
227
|
_reactPopper.Target,
|
212
228
|
null,
|
213
229
|
_react2.default.createElement(_HiInput2.default, (0, _extends3.default)({}, otherProps, {
|
230
|
+
|
214
231
|
inputId: id,
|
215
232
|
focused: focused,
|
216
233
|
inputRef: function inputRef(input) {
|
@@ -236,7 +253,7 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
236
253
|
_Paper2.default,
|
237
254
|
{ className: classes.paper },
|
238
255
|
_react2.default.createElement(_HiSelectableList2.default, {
|
239
|
-
itemList:
|
256
|
+
itemList: optionsShown,
|
240
257
|
selectedIdList: [],
|
241
258
|
checkbox: false,
|
242
259
|
onSelect: this.handleSelect,
|
@@ -254,7 +271,12 @@ var HiSuggestSelect = function (_React$PureComponent) {
|
|
254
271
|
}(_react2.default.PureComponent);
|
255
272
|
|
256
273
|
HiSuggestSelect.defaultProps = {
|
257
|
-
|
274
|
+
showMinLength: false,
|
275
|
+
showNoResults: false,
|
276
|
+
translations: {
|
277
|
+
no_result_match: 'No result match',
|
278
|
+
min_length: 'Veuillez saisir 3 caractères minimum'
|
279
|
+
},
|
258
280
|
options: []
|
259
281
|
};
|
260
282
|
HiSuggestSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
@@ -278,6 +300,14 @@ HiSuggestSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
278
300
|
* Liste de suggestions.
|
279
301
|
*/
|
280
302
|
options: _propTypes2.default.array,
|
303
|
+
/**
|
304
|
+
* Permet d'afficher un message si pas assez de caractères
|
305
|
+
*/
|
306
|
+
showMinLength: _propTypes2.default.bool,
|
307
|
+
/**
|
308
|
+
* Permet d'afficher un message si aucune options n'est présente
|
309
|
+
*/
|
310
|
+
showNoResults: _propTypes2.default.bool,
|
281
311
|
/**
|
282
312
|
* Traductions (par défaut en anglais)
|
283
313
|
*/
|
@@ -377,51 +377,44 @@ var HiSelectableListItem = function (_React$Component) {
|
|
377
377
|
listItemProps.button = false;
|
378
378
|
}
|
379
379
|
|
380
|
-
var iconAll = void 0;
|
381
|
-
if (item.id === '_all' && item.icon) {
|
382
|
-
iconAll = _react2.default.createElement(_HiIconBuilder2.default, { icon: item.icon, className: classes.checkboxIcon });
|
383
|
-
}
|
384
|
-
|
385
380
|
// calcul du padding left
|
386
381
|
var paddingLeft = 0;
|
387
382
|
|
388
383
|
if (leftPadding) {
|
389
384
|
paddingLeft = leftPadding;
|
390
|
-
} else {
|
391
|
-
// Si pas de hiérarchie, padding de 8px
|
392
|
-
if (!
|
393
|
-
|
394
|
-
|
385
|
+
} else if (!hierarchic) {
|
386
|
+
// Si pas de hiérarchie et sans checkbox, padding de 8px
|
387
|
+
if (!effectiveCheckbox) {
|
388
|
+
paddingLeft = 8;
|
389
|
+
}
|
390
|
+
} else if (selectable) {
|
391
|
+
// Si item selectionnable
|
392
|
+
// Si parent selectionnable
|
393
|
+
if (parentItemSelectable) {
|
394
|
+
// Si l'item contient une checkbox
|
395
|
+
if (effectiveCheckbox) {
|
396
|
+
paddingLeft = 16 * level;
|
397
|
+
} else {
|
398
|
+
paddingLeft = 16 * (level + 1);
|
395
399
|
}
|
396
|
-
} else if (
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
if (effectiveCheckbox) {
|
402
|
-
paddingLeft = 16 * level;
|
403
|
-
} else {
|
404
|
-
paddingLeft = 16 * (level + 1);
|
405
|
-
}
|
406
|
-
} else if (level > 0) {
|
407
|
-
if (effectiveCheckbox) {
|
408
|
-
paddingLeft = 16 * (level - 1);
|
409
|
-
} else {
|
410
|
-
paddingLeft = 16 * level;
|
411
|
-
}
|
412
|
-
} else if (!effectiveCheckbox) {
|
413
|
-
if (item.id === '_all') {
|
414
|
-
paddingLeft = 16;
|
415
|
-
} else {
|
416
|
-
paddingLeft = 16 * level;
|
417
|
-
}
|
400
|
+
} else if (level > 0) {
|
401
|
+
if (effectiveCheckbox) {
|
402
|
+
paddingLeft = 16 * (level - 1);
|
403
|
+
} else {
|
404
|
+
paddingLeft = 16 * level;
|
418
405
|
}
|
419
|
-
} else {
|
420
|
-
|
421
|
-
|
406
|
+
} else if (!effectiveCheckbox) {
|
407
|
+
if (item.id === '_all') {
|
408
|
+
paddingLeft = 16;
|
409
|
+
} else {
|
422
410
|
paddingLeft = 16 * level;
|
423
411
|
}
|
424
412
|
}
|
413
|
+
} else {
|
414
|
+
paddingLeft = 16; // Padding de 16 par défaut
|
415
|
+
if (level > 0) {
|
416
|
+
paddingLeft = 16 * level;
|
417
|
+
}
|
425
418
|
}
|
426
419
|
|
427
420
|
listItemProps.style = { paddingLeft: paddingLeft + 'px' };
|
@@ -431,8 +424,8 @@ var HiSelectableListItem = function (_React$Component) {
|
|
431
424
|
iconDisplay = hoverIcon;
|
432
425
|
} else if (item.hasChildren) {
|
433
426
|
iconDisplay = parentIcon;
|
434
|
-
} else if (item.
|
435
|
-
iconDisplay =
|
427
|
+
} else if (item.type === 'icon' && item.icon) {
|
428
|
+
iconDisplay = _react2.default.createElement(_HiIconBuilder2.default, { icon: item.icon, className: classes.checkboxIcon });
|
436
429
|
}
|
437
430
|
|
438
431
|
return _react2.default.createElement(
|
package/HiTable/HeaderCell.js
CHANGED
@@ -170,7 +170,7 @@ var HeaderCell = function (_React$PureComponent) {
|
|
170
170
|
|
171
171
|
_this.onFilterClick = _this.onFilterClick.bind(_this);
|
172
172
|
_this.openFilterMenu = _this.openFilterMenu.bind(_this);
|
173
|
-
_this.
|
173
|
+
_this.handleClose = _this.handleClose.bind(_this);
|
174
174
|
_this.handleSort = _this.handleSort.bind(_this);
|
175
175
|
_this.handleFilterChange = _this.handleFilterChange.bind(_this);
|
176
176
|
return _this;
|
@@ -186,8 +186,8 @@ var HeaderCell = function (_React$PureComponent) {
|
|
186
186
|
});
|
187
187
|
}
|
188
188
|
}, {
|
189
|
-
key: '
|
190
|
-
value: function
|
189
|
+
key: 'handleClose',
|
190
|
+
value: function handleClose() {
|
191
191
|
this.setState({ filterOpen: false, anchorEl: null, menuFilters: [] });
|
192
192
|
}
|
193
193
|
|
@@ -232,7 +232,8 @@ var HeaderCell = function (_React$PureComponent) {
|
|
232
232
|
align = _props$align === undefined ? cst.ALIGN_RIGHT_TYPES.includes(type) ? 'right' : 'left' : _props$align,
|
233
233
|
sticky = _props.sticky,
|
234
234
|
padding = _props.padding,
|
235
|
-
lookedUp = _props.lookedUp
|
235
|
+
lookedUp = _props.lookedUp,
|
236
|
+
translations = _props.translations;
|
236
237
|
var _state = this.state,
|
237
238
|
filterOpen = _state.filterOpen,
|
238
239
|
anchorEl = _state.anchorEl,
|
@@ -323,7 +324,7 @@ var HeaderCell = function (_React$PureComponent) {
|
|
323
324
|
{
|
324
325
|
className: classes.labelContainer + (_sorted ? ' ' + classes.labelContainerOrdered : '')
|
325
326
|
},
|
326
|
-
view !== 's' ? title : smallTitle
|
327
|
+
view !== 's' ? title : smallTitle || title
|
327
328
|
),
|
328
329
|
align !== 'right' && _icons
|
329
330
|
) : _react2.default.createElement(
|
@@ -340,7 +341,7 @@ var HeaderCell = function (_React$PureComponent) {
|
|
340
341
|
_react2.default.createElement(
|
341
342
|
'span',
|
342
343
|
{ className: classes.labelContainer, style: { width: '100%' } },
|
343
|
-
view !== 's' ? title : smallTitle
|
344
|
+
view !== 's' ? title : smallTitle || title
|
344
345
|
)
|
345
346
|
)
|
346
347
|
),
|
@@ -351,11 +352,12 @@ var HeaderCell = function (_React$PureComponent) {
|
|
351
352
|
title: title,
|
352
353
|
filterValueList: menuFilters,
|
353
354
|
isOpen: filterOpen,
|
354
|
-
onClose: this.
|
355
|
+
onClose: this.handleClose,
|
355
356
|
anchorEl: anchorEl,
|
356
357
|
sortable: sortable,
|
357
358
|
onSort: this.handleSort,
|
358
|
-
onFilterChange: this.handleFilterChange
|
359
|
+
onFilterChange: this.handleFilterChange,
|
360
|
+
translations: translations.columnFilter
|
359
361
|
})
|
360
362
|
);
|
361
363
|
}
|
@@ -376,18 +378,50 @@ HeaderCell.defaultProps = {
|
|
376
378
|
padding: 8
|
377
379
|
};
|
378
380
|
HeaderCell.propTypes = process.env.NODE_ENV !== "production" ? {
|
381
|
+
/**
|
382
|
+
* Title alignement, est déduit de type par défaut
|
383
|
+
*/
|
384
|
+
align: _propTypes2.default.string,
|
379
385
|
/**
|
380
386
|
* Useful to extend the style applied to components.
|
381
387
|
*/
|
382
388
|
classes: _propTypes2.default.object,
|
389
|
+
/**
|
390
|
+
* Densité, défini la hauteur de la ligne
|
391
|
+
*/
|
392
|
+
dense: _propTypes2.default.bool,
|
393
|
+
/**
|
394
|
+
* Ajoute le composant ColumnFilter, par défaut à True si filterSource est définie.
|
395
|
+
*/
|
396
|
+
filterable: _propTypes2.default.bool,
|
397
|
+
/**
|
398
|
+
* Liste fermé des valeurs disponibles sur lesquelles filtrer (inclure/exclure)
|
399
|
+
*/
|
400
|
+
filterSource: _propTypes2.default.array,
|
401
|
+
/**
|
402
|
+
* La largeur de la cellule est fixé (toutes les colonnes sauf une)
|
403
|
+
*/
|
404
|
+
fixedColumnWidth: _propTypes2.default.bool,
|
383
405
|
/**
|
384
406
|
* Recherche lookup sur cette colonne
|
385
407
|
*/
|
386
408
|
lookedUp: _propTypes2.default.bool,
|
409
|
+
/**
|
410
|
+
* Padding de la cellule (px)
|
411
|
+
*/
|
412
|
+
padding: _propTypes2.default.number,
|
413
|
+
/**
|
414
|
+
* Fonction de callback au changement du filtre - passe la liste des id des valeurs incluses
|
415
|
+
*/
|
416
|
+
onFilterChange: _propTypes2.default.func,
|
387
417
|
/**
|
388
418
|
* Fonction de callback au click du select
|
389
419
|
*/
|
390
420
|
onSelect: _propTypes2.default.func,
|
421
|
+
/**
|
422
|
+
* Fonction de callback au tri - passe la direction du tri
|
423
|
+
*/
|
424
|
+
onSort: _propTypes2.default.func,
|
391
425
|
/**
|
392
426
|
* Ajoute une checkbox
|
393
427
|
*/
|
@@ -400,69 +434,41 @@ HeaderCell.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
400
434
|
* Titre condensé
|
401
435
|
*/
|
402
436
|
smallTitle: _propTypes2.default.string,
|
403
|
-
/**
|
404
|
-
* Titre de la colonne
|
405
|
-
*/
|
406
|
-
title: _propTypes2.default.string.isRequired,
|
407
|
-
/**
|
408
|
-
* Type de cellule
|
409
|
-
*/
|
410
|
-
type: _propTypes2.default.string.isRequired,
|
411
437
|
/**
|
412
438
|
* Ajoute la fonction de tri au click sur le label & dans le ColumnFilter
|
413
439
|
*/
|
414
440
|
sortable: _propTypes2.default.bool,
|
415
|
-
/**
|
416
|
-
* Tri actif / inactif
|
417
|
-
*/
|
418
|
-
sorted: _propTypes2.default.bool,
|
419
441
|
/**
|
420
442
|
* Sens du tri
|
421
443
|
*/
|
422
444
|
sortDirection: _propTypes2.default.oneOf(['asc', 'desc']),
|
423
445
|
/**
|
424
|
-
*
|
446
|
+
* Tri actif / inactif
|
425
447
|
*/
|
426
|
-
|
448
|
+
sorted: _propTypes2.default.bool,
|
427
449
|
/**
|
428
|
-
*
|
450
|
+
* True si la colonne est la première colonne et doit avoir un comportement "sticky" lors du scroll horizontal
|
429
451
|
*/
|
430
|
-
|
452
|
+
sticky: _propTypes2.default.bool,
|
431
453
|
/**
|
432
|
-
*
|
454
|
+
* Titre de la colonne
|
433
455
|
*/
|
434
|
-
|
456
|
+
title: _propTypes2.default.string.isRequired,
|
435
457
|
/**
|
436
|
-
*
|
458
|
+
* Traduction des chaînes affichées
|
437
459
|
*/
|
438
|
-
|
460
|
+
translations: _propTypes2.default.object,
|
439
461
|
/**
|
440
|
-
*
|
462
|
+
* Type de cellule
|
441
463
|
*/
|
442
|
-
|
464
|
+
type: _propTypes2.default.string.isRequired,
|
443
465
|
/**
|
444
|
-
*
|
466
|
+
* View (L/M/S)
|
445
467
|
*/
|
446
|
-
|
468
|
+
view: _propTypes2.default.oneOf(['l', 'm', 's']),
|
447
469
|
/**
|
448
470
|
* Largeur de la cellule (hors padding), est déduit de view par défaut
|
449
471
|
*/
|
450
|
-
width: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string])
|
451
|
-
/**
|
452
|
-
* La largeur de la cellule est fixé (toutes les colonnes sauf une)
|
453
|
-
*/
|
454
|
-
fixedColumnWidth: _propTypes2.default.bool,
|
455
|
-
/**
|
456
|
-
* Title alignement, est déduit de type par défaut
|
457
|
-
*/
|
458
|
-
align: _propTypes2.default.string,
|
459
|
-
/**
|
460
|
-
* True si la colonne est la première colonne et doit avoir un comportement "sticky" lors du scroll horizontal
|
461
|
-
*/
|
462
|
-
sticky: _propTypes2.default.bool,
|
463
|
-
/**
|
464
|
-
* Padding de la cellule (px)
|
465
|
-
*/
|
466
|
-
padding: _propTypes2.default.number
|
472
|
+
width: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string])
|
467
473
|
} : {};
|
468
474
|
exports.default = (0, _styles.withStyles)(styles, { withTheme: true, name: 'HmuiHeaderCell' })(HeaderCell);
|
package/HiTable/HiTable.js
CHANGED
@@ -770,7 +770,7 @@ var HiTable = function (_React$Component) {
|
|
770
770
|
height: headerHeight,
|
771
771
|
sticky: sticky,
|
772
772
|
view: view,
|
773
|
-
translations: translations,
|
773
|
+
translations: translations.tableHead,
|
774
774
|
lookupColumns: lookupColumns,
|
775
775
|
fixedColumnWidth: fixedColumnWidth
|
776
776
|
}),
|
@@ -793,7 +793,7 @@ var HiTable = function (_React$Component) {
|
|
793
793
|
onRowClick: onRowClick,
|
794
794
|
onScroll: this.handleVerticalScroll,
|
795
795
|
addNewRowRefs: this.addNewRowRefs,
|
796
|
-
translations: translations,
|
796
|
+
translations: translations.tableBody,
|
797
797
|
groupBy: groupBy,
|
798
798
|
onClickNext: this.handleNextStickyRow,
|
799
799
|
groupByIds: groupByIds,
|
@@ -809,7 +809,7 @@ var HiTable = function (_React$Component) {
|
|
809
809
|
requestNextDatas: requestNextDatas,
|
810
810
|
maxAutoRequest: 3,
|
811
811
|
isScrollToBottom: isScrollToBottom,
|
812
|
-
translations: translations
|
812
|
+
translations: translations.tableFooterScroll
|
813
813
|
}),
|
814
814
|
!infiniteScroll && footerContent && _react2.default.createElement(
|
815
815
|
_HiTableFooter2.default,
|
@@ -866,17 +866,7 @@ HiTable.defaultProps = {
|
|
866
866
|
height: 450,
|
867
867
|
sticky: true,
|
868
868
|
translations: {
|
869
|
-
|
870
|
-
back_to_top: 'Back to top',
|
871
|
-
get_the_n_new_items: 'See %s new items',
|
872
|
-
choose_and_organize_columns: 'Choose & organize columns',
|
873
|
-
search: 'Search',
|
874
|
-
time: 'Time',
|
875
|
-
stickyRow: {
|
876
|
-
button: {
|
877
|
-
next: 'Next day'
|
878
|
-
}
|
879
|
-
}
|
869
|
+
back_to_top: 'Back to top'
|
880
870
|
},
|
881
871
|
view: 'l',
|
882
872
|
lookupColumns: [],
|
package/HiTable/HiTableHead.js
CHANGED
@@ -313,7 +313,8 @@ var HiTableHead = function (_React$Component) {
|
|
313
313
|
align: column['align'],
|
314
314
|
sticky: firstColumn && sticky,
|
315
315
|
lookedUp: lookupColumns.includes(column.colId),
|
316
|
-
fixedColumnWidth: fixedColumnWidth
|
316
|
+
fixedColumnWidth: fixedColumnWidth,
|
317
|
+
translations: translations.headerCell
|
317
318
|
});
|
318
319
|
}
|
319
320
|
}),
|
@@ -347,7 +348,7 @@ var HiTableHead = function (_React$Component) {
|
|
347
348
|
columns: columns,
|
348
349
|
orderedColumns: orderedColumns,
|
349
350
|
mandatoryColumnId: mandatoryColumnId,
|
350
|
-
translations: translations
|
351
|
+
translations: translations.orderColumns
|
351
352
|
})
|
352
353
|
)
|
353
354
|
),
|
@@ -391,10 +392,7 @@ HiTableHead.defaultProps = {
|
|
391
392
|
dense: false,
|
392
393
|
sticky: true,
|
393
394
|
translations: {
|
394
|
-
get_the_n_new_items: 'Get the %s new items'
|
395
|
-
choose_and_organize_columns: 'Choose & organize columns',
|
396
|
-
search: 'Search',
|
397
|
-
time: 'Time'
|
395
|
+
get_the_n_new_items: 'Get the %s new items'
|
398
396
|
},
|
399
397
|
view: 'l'
|
400
398
|
};
|
package/HiTopBar/HiTopBar.js
CHANGED
@@ -187,7 +187,7 @@ var _ref = _react2.default.createElement(_HiIconBuilder2.default, { icon: 'fa-be
|
|
187
187
|
|
188
188
|
var _ref2 = _react2.default.createElement(_mdiMaterialUi.ArrowLeft, null);
|
189
189
|
|
190
|
-
var _ref3 = _react2.default.createElement(_mdiMaterialUi.
|
190
|
+
var _ref3 = _react2.default.createElement(_mdiMaterialUi.ChevronDown, null);
|
191
191
|
|
192
192
|
var _ref4 = _react2.default.createElement(_mdiMaterialUi.ArrowLeft, null);
|
193
193
|
|
@@ -235,6 +235,9 @@ var HiTopBar = function (_React$Component) {
|
|
235
235
|
}, {
|
236
236
|
key: 'handleCollapse',
|
237
237
|
value: function handleCollapse() {
|
238
|
+
if (this.props.onCollapse) {
|
239
|
+
this.props.onCollapse(!this.state.collapsed);
|
240
|
+
}
|
238
241
|
this.setState({ collapsed: !this.state.collapsed });
|
239
242
|
}
|
240
243
|
}, {
|
@@ -362,7 +365,7 @@ var HiTopBar = function (_React$Component) {
|
|
362
365
|
(hideable || hasSettings) && _react2.default.createElement(
|
363
366
|
_IconButton2.default,
|
364
367
|
{ color: 'inherit', className: classes.iconButton },
|
365
|
-
hideable && _react2.default.createElement(_mdiMaterialUi.
|
368
|
+
hideable && _react2.default.createElement(_mdiMaterialUi.ChevronUp, { onClick: this.handleCollapse }),
|
366
369
|
hasSettings && _react2.default.createElement(_HiIconBuilder2.default, {
|
367
370
|
onClick: this.props.onClickSettings,
|
368
371
|
icon: 'fa-gear',
|
@@ -498,7 +501,7 @@ HiTopBar.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
498
501
|
*/
|
499
502
|
hasSettings: _propTypes2.default.bool,
|
500
503
|
/**
|
501
|
-
* La TopBar peut être cachée vie le bouton
|
504
|
+
* La TopBar peut être cachée vie le bouton chevron
|
502
505
|
*/
|
503
506
|
hideable: _propTypes2.default.bool,
|
504
507
|
/**
|
@@ -525,6 +528,10 @@ HiTopBar.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
525
528
|
* Fonction de callback au click sur le bouton "Settings" du menu
|
526
529
|
*/
|
527
530
|
onClickSettings: _propTypes2.default.func,
|
531
|
+
/**
|
532
|
+
* Fonction de callback au click sur le bouton chevron
|
533
|
+
*/
|
534
|
+
onCollapse: _propTypes2.default.func,
|
528
535
|
/**
|
529
536
|
* Positionement de la topBar. The behavior of the different options is described
|
530
537
|
* [here](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Positioning).
|