@hipay/hipay-material-ui 1.0.0-beta.8 → 1.0.0-beta.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/HiDotsStepper/HiDot.js +151 -0
  2. package/HiDotsStepper/HiDotsStepper.js +146 -0
  3. package/HiDotsStepper/index.js +16 -0
  4. package/HiForm/HiAddressField.js +204 -0
  5. package/HiForm/HiInput.js +1 -1
  6. package/HiForm/index.js +9 -0
  7. package/HiPdfReader/HiPdfReader.js +282 -0
  8. package/HiPdfReader/index.js +16 -0
  9. package/HiSelect/HiSuggestSelect.js +2 -0
  10. package/HiSelectableList/HiSelectableListItem.js +1 -2
  11. package/HiTable/BodyCellBuilder.js +7 -8
  12. package/HiTable/BodyCells/CellLayout.js +20 -18
  13. package/HiTable/BodyCells/CellSentinel.js +12 -4
  14. package/HiTable/BodyRow.js +7 -1
  15. package/HiTable/HeaderCell.js +17 -14
  16. package/HiTable/HiTable.js +13 -4
  17. package/HiTable/HiTableBody.js +26 -12
  18. package/HiTable/HiTableHead.js +22 -5
  19. package/es/HiDotsStepper/HiDot.js +92 -0
  20. package/es/HiDotsStepper/HiDotsStepper.js +83 -0
  21. package/es/HiDotsStepper/index.js +1 -0
  22. package/es/HiForm/HiAddressField.js +142 -0
  23. package/es/HiForm/HiInput.js +1 -1
  24. package/es/HiForm/index.js +2 -1
  25. package/es/HiPdfReader/HiPdfReader.js +198 -0
  26. package/es/HiPdfReader/index.js +1 -0
  27. package/es/HiSelect/HiSuggestSelect.js +2 -0
  28. package/es/HiSelectableList/HiSelectableListItem.js +1 -2
  29. package/es/HiTable/BodyCellBuilder.js +8 -9
  30. package/es/HiTable/BodyCells/CellLayout.js +22 -20
  31. package/es/HiTable/BodyCells/CellSentinel.js +12 -4
  32. package/es/HiTable/BodyRow.js +7 -1
  33. package/es/HiTable/HeaderCell.js +17 -14
  34. package/es/HiTable/HiTable.js +13 -4
  35. package/es/HiTable/HiTableBody.js +22 -9
  36. package/es/HiTable/HiTableHead.js +17 -5
  37. package/es/styles/createHiMuiTheme.js +7 -0
  38. package/index.es.js +1 -1
  39. package/index.js +1 -1
  40. package/package.json +2 -1
  41. package/styles/createHiMuiTheme.js +7 -0
  42. package/umd/hipay-material-ui.development.js +2874 -2606
  43. package/umd/hipay-material-ui.production.min.js +4 -4
@@ -0,0 +1,282 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.styles = undefined;
7
+
8
+ var _extends2 = require('babel-runtime/helpers/extends');
9
+
10
+ var _extends3 = _interopRequireDefault(_extends2);
11
+
12
+ var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
13
+
14
+ var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
15
+
16
+ var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
17
+
18
+ var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
19
+
20
+ var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
21
+
22
+ var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
23
+
24
+ var _createClass2 = require('babel-runtime/helpers/createClass');
25
+
26
+ var _createClass3 = _interopRequireDefault(_createClass2);
27
+
28
+ var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
29
+
30
+ var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
31
+
32
+ var _inherits2 = require('babel-runtime/helpers/inherits');
33
+
34
+ var _inherits3 = _interopRequireDefault(_inherits2);
35
+
36
+ var _react = require('react');
37
+
38
+ var _react2 = _interopRequireDefault(_react);
39
+
40
+ var _propTypes = require('prop-types');
41
+
42
+ var _propTypes2 = _interopRequireDefault(_propTypes);
43
+
44
+ var _reactPdf = require('react-pdf');
45
+
46
+ var _HiButton = require('../HiButton');
47
+
48
+ var _HiButton2 = _interopRequireDefault(_HiButton);
49
+
50
+ var _ChevronRight = require('mdi-material-ui/ChevronRight');
51
+
52
+ var _ChevronRight2 = _interopRequireDefault(_ChevronRight);
53
+
54
+ var _ChevronLeft = require('mdi-material-ui/ChevronLeft');
55
+
56
+ var _ChevronLeft2 = _interopRequireDefault(_ChevronLeft);
57
+
58
+ var _Progress = require('material-ui/Progress');
59
+
60
+ var _styles = require('../styles');
61
+
62
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
63
+
64
+ var styles = exports.styles = function styles(theme) {
65
+ return {
66
+ root: {
67
+ position: 'relative'
68
+ },
69
+ pageNumber: {
70
+ position: 'absolute',
71
+ bottom: 16,
72
+ left: -24,
73
+ backgroundColor: '#FFFFFF',
74
+ borderRadius: 4,
75
+ paddingTop: 7,
76
+ paddingBottom: 7,
77
+ paddingRight: 8,
78
+ paddingLeft: 8,
79
+ fontSize: 15,
80
+ fontFamily: theme.typography.fontFamily,
81
+ boxShadow: '1px 1px 5px rgba(0, 0, 0, .16)',
82
+ color: '#737373'
83
+ },
84
+ pagesNavigation: {
85
+ position: 'absolute',
86
+ top: 16,
87
+ right: -30,
88
+ backgroundColor: '#FFFFFF',
89
+ borderRadius: 3,
90
+ paddingTop: 4,
91
+ paddingBottom: 4,
92
+ paddingRight: 3,
93
+ paddingLeft: 3,
94
+ fontFamily: theme.typography.fontFamily,
95
+ boxShadow: '1px 1px 5px rgba(0, 0, 0, .16)',
96
+ color: '#737373',
97
+ '&>button:first-child': {
98
+ marginRight: 6
99
+ }
100
+ },
101
+ navigationButton: {
102
+ padding: 0,
103
+ minWidth: 0,
104
+ minHeight: 0
105
+ }
106
+ };
107
+ };
108
+
109
+ // Constantes utilisées pour le redimentionnement du PDF (format mobile par exemple)
110
+ var maxWindowWidth = 900;
111
+ var maxPdfWidth = 600;
112
+
113
+ var _ref3 = _react2.default.createElement(_Progress.CircularProgress, null);
114
+
115
+ var _ref4 = _react2.default.createElement(_ChevronLeft2.default, null);
116
+
117
+ var _ref5 = _react2.default.createElement(_ChevronRight2.default, null);
118
+
119
+ var HiPdfReader = function (_React$PureComponent) {
120
+ (0, _inherits3.default)(HiPdfReader, _React$PureComponent);
121
+
122
+ function HiPdfReader() {
123
+ var _ref;
124
+
125
+ var _temp, _this, _ret;
126
+
127
+ (0, _classCallCheck3.default)(this, HiPdfReader);
128
+
129
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
130
+ args[_key] = arguments[_key];
131
+ }
132
+
133
+ return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = HiPdfReader.__proto__ || (0, _getPrototypeOf2.default)(HiPdfReader)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
134
+ numPages: null,
135
+ pageNumber: 1,
136
+ error: false,
137
+ width: 600
138
+ }, _this.handleLoadSuccess = function (_ref2) {
139
+ var numPages = _ref2.numPages;
140
+
141
+ _this.setState({ numPages: numPages, error: false });
142
+ }, _this.handleLoadError = function () {
143
+ _this.setState({ error: true });
144
+ }, _this.handleClickNextPage = function () {
145
+ _this.setState({ pageNumber: _this.state.pageNumber + 1 });
146
+ }, _this.handleClickPreviousPage = function () {
147
+ _this.setState({ pageNumber: _this.state.pageNumber - 1 });
148
+ }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
149
+ }
150
+
151
+ (0, _createClass3.default)(HiPdfReader, [{
152
+ key: 'updateDimensions',
153
+
154
+
155
+ // Calculate & Update state of new dimensions
156
+ value: function updateDimensions() {
157
+ if (window.innerWidth < maxWindowWidth) {
158
+ var updateWidth = Math.round(window.innerWidth * 100 / maxWindowWidth / 100 * maxPdfWidth);
159
+ this.setState({ width: updateWidth });
160
+ } else {
161
+ this.setState({ width: maxPdfWidth });
162
+ }
163
+ }
164
+ }, {
165
+ key: 'componentDidMount',
166
+ value: function componentDidMount() {
167
+ this.updateDimensions();
168
+ window.addEventListener('resize', this.updateDimensions.bind(this));
169
+ }
170
+ }, {
171
+ key: 'componentWillUnmount',
172
+ value: function componentWillUnmount() {
173
+ window.removeEventListener('resize', this.updateDimensions.bind(this));
174
+ }
175
+
176
+ // Fonction appelée une fois le pdf correctement chargé
177
+
178
+
179
+ // Fonction appelée en cas d'erreur de chargement du pdf
180
+
181
+
182
+ // Fonction appelée au clic du bouton pour visualiser la page suivante du pdf
183
+
184
+
185
+ // Fonction appelée au clic du bouton pour visualiser la page précédente du pdf
186
+
187
+ }, {
188
+ key: 'render',
189
+
190
+
191
+ // Render
192
+ value: function render() {
193
+ var _state = this.state,
194
+ pageNumber = _state.pageNumber,
195
+ numPages = _state.numPages,
196
+ error = _state.error;
197
+ var _props = this.props,
198
+ classes = _props.classes,
199
+ file = _props.file,
200
+ displayPagination = _props.displayPagination,
201
+ displayNavigationButtons = _props.displayNavigationButtons,
202
+ props = (0, _objectWithoutProperties3.default)(_props, ['classes', 'file', 'displayPagination', 'displayNavigationButtons']);
203
+
204
+
205
+ return _react2.default.createElement(
206
+ 'div',
207
+ { className: classes.root },
208
+ _react2.default.createElement(
209
+ _reactPdf.Document,
210
+ (0, _extends3.default)({
211
+ className: classes.style,
212
+ file: file,
213
+ onLoadSuccess: this.handleLoadSuccess,
214
+ onLoadError: this.handleLoadError,
215
+ loading: _ref3
216
+ }, props),
217
+ _react2.default.createElement(_reactPdf.Page, {
218
+ pageNumber: pageNumber,
219
+ renderAnnotations: false,
220
+ renderTextLayer: false,
221
+ width: this.state.width
222
+ })
223
+ ),
224
+ !error && numPages > 1 && displayPagination && _react2.default.createElement(
225
+ 'span',
226
+ { className: classes.pageNumber },
227
+ 'Page ',
228
+ pageNumber,
229
+ ' sur ',
230
+ numPages
231
+ ),
232
+ !error && numPages > 1 && displayNavigationButtons && _react2.default.createElement(
233
+ 'span',
234
+ { className: classes.pagesNavigation },
235
+ _react2.default.createElement(
236
+ _HiButton2.default,
237
+ {
238
+ onClick: this.handleClickPreviousPage,
239
+ disabled: pageNumber === 1,
240
+ className: classes.navigationButton
241
+ },
242
+ _ref4
243
+ ),
244
+ _react2.default.createElement(
245
+ _HiButton2.default,
246
+ {
247
+ onClick: this.handleClickNextPage,
248
+ disabled: pageNumber === numPages,
249
+ className: classes.navigationButton
250
+ },
251
+ _ref5
252
+ )
253
+ )
254
+ );
255
+ }
256
+ }]);
257
+ return HiPdfReader;
258
+ }(_react2.default.PureComponent);
259
+
260
+ HiPdfReader.defaultProps = {
261
+ displayPagination: true,
262
+ displayNavigationButtons: true
263
+ };
264
+ HiPdfReader.propTypes = process.env.NODE_ENV !== "production" ? {
265
+ /**
266
+ * Surcharge les classes du composant
267
+ */
268
+ classes: _propTypes2.default.object,
269
+ /**
270
+ * Chemin vers le fichier PDF
271
+ */
272
+ file: _propTypes2.default.string.isRequired,
273
+ /**
274
+ * On affiche la pagination si le PDF contient plusieurs pages
275
+ */
276
+ displayPagination: _propTypes2.default.bool,
277
+ /**
278
+ * On affiche les boutons de navigation entre les pages si le PDF contient plusieurs pages
279
+ */
280
+ displayNavigationButtons: _propTypes2.default.bool
281
+ } : {};
282
+ exports.default = (0, _styles.withStyles)(styles, { name: 'HmuiHiPdfReader', index: 51 })(HiPdfReader);
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _HiPdfReader = require('./HiPdfReader');
8
+
9
+ Object.defineProperty(exports, 'default', {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _interopRequireDefault(_HiPdfReader).default;
13
+ }
14
+ });
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -138,6 +138,8 @@ var HiSuggestSelect = function (_React$PureComponent) {
138
138
  items[0].focus();
139
139
  }
140
140
  }, 1);
141
+ } else if (event.key === 'Escape') {
142
+ _this.setState({ options: [] });
141
143
  }
142
144
  };
143
145
 
@@ -235,8 +235,7 @@ var HiSelectableListItem = function (_React$Component) {
235
235
  case 'image':
236
236
  var img = '';
237
237
  if (typeof item.img !== 'undefined') {
238
-
239
- img = _react2.default.createElement('img', { src: item.img, className: classes.imgListItem });
238
+ img = _react2.default.createElement('img', { src: item.img, alt: item.img, className: classes.imgListItem });
240
239
  }
241
240
 
242
241
  return _react2.default.createElement(
@@ -128,7 +128,6 @@ var BodyCellBuilder = function (_React$PureComponent) {
128
128
  datas = _props.datas,
129
129
  view = _props.view,
130
130
  width = _props.width,
131
- fixedWidth = _props.fixedWidth,
132
131
  padding = _props.padding,
133
132
  align = _props.align,
134
133
  dense = _props.dense,
@@ -142,14 +141,14 @@ var BodyCellBuilder = function (_React$PureComponent) {
142
141
  childrenCount = _props.childrenCount,
143
142
  onOpenDetails = _props.onOpenDetails,
144
143
  lookedUp = _props.lookedUp,
145
- props = (0, _objectWithoutProperties3.default)(_props, ['ukey', 'type', 'datas', 'view', 'width', 'fixedWidth', 'padding', 'align', 'dense', 'ellipsis', 'onSelect', 'selectable', 'selected', 'sticky', 'dateLocale', 'numberLocale', 'childrenCount', 'onOpenDetails', 'lookedUp']);
144
+ fixedColumnWidth = _props.fixedColumnWidth,
145
+ props = (0, _objectWithoutProperties3.default)(_props, ['ukey', 'type', 'datas', 'view', 'width', 'padding', 'align', 'dense', 'ellipsis', 'onSelect', 'selectable', 'selected', 'sticky', 'dateLocale', 'numberLocale', 'childrenCount', 'onOpenDetails', 'lookedUp', 'fixedColumnWidth']);
146
146
 
147
147
 
148
148
  var layoutProps = {
149
149
  type: type,
150
150
  view: view,
151
151
  width: width,
152
- fixedWidth: fixedWidth,
153
152
  align: align,
154
153
  dense: dense,
155
154
  onSelect: onSelect,
@@ -158,7 +157,8 @@ var BodyCellBuilder = function (_React$PureComponent) {
158
157
  selected: selected,
159
158
  sticky: sticky,
160
159
  childrenCount: childrenCount,
161
- lookedUp: lookedUp
160
+ lookedUp: lookedUp,
161
+ fixedColumnWidth: fixedColumnWidth
162
162
  };
163
163
 
164
164
  var cellElement = void 0;
@@ -214,7 +214,6 @@ var BodyCellBuilder = function (_React$PureComponent) {
214
214
  break;
215
215
 
216
216
  case cst.TYPE_ICON:
217
- if (view === cst.VIEWS.SMALL) layoutProps.fixedWidth = true;
218
217
  cellElement = _react2.default.createElement(_BodyCells.CellIcon, {
219
218
  value: datas.value,
220
219
  icon: datas.icon,
@@ -277,7 +276,6 @@ var BodyCellBuilder = function (_React$PureComponent) {
277
276
 
278
277
  case cst.TYPE_THIRD_PARTY_SECURITY:
279
278
  layoutProps.align = 'center';
280
- layoutProps.fixedWidth = true;
281
279
  cellElement = _react2.default.createElement(_BodyCells.CellThirdPartySecurity, {
282
280
  value: datas.value,
283
281
  code: datas.code,
@@ -351,9 +349,10 @@ BodyCellBuilder.propTypes = process.env.NODE_ENV !== "production" ? {
351
349
  */
352
350
  ellipsis: _propTypes2.default.oneOf(['left', 'right', 'middle', 'name', 'after-first-word']),
353
351
  /**
354
- * La largeur de la cellule est fixé (toutes les colonnes sauf une)
352
+ * Fixe la taille des colonnes selon le type de vue
353
+ * Sinon les colonnes s'adaptent à l'espace disponible
355
354
  */
356
- fixedWidth: _propTypes2.default.bool,
355
+ fixedColumnWidth: _propTypes2.default.bool,
357
356
  /**
358
357
  * Recherche lookup sur cette colonne
359
358
  */
@@ -136,7 +136,7 @@ var CellLayout = function (_React$Component) {
136
136
  dense = _props.dense,
137
137
  _props$width = _props.width,
138
138
  width = _props$width === undefined ? cst.DEFAULT_WIDTHS[type][view] : _props$width,
139
- fixedWidth = _props.fixedWidth,
139
+ fixedColumnWidth = _props.fixedColumnWidth,
140
140
  sticky = _props.sticky,
141
141
  selectable = _props.selectable,
142
142
  selected = _props.selected,
@@ -154,22 +154,23 @@ var CellLayout = function (_React$Component) {
154
154
 
155
155
  var lookedUpClassName = (0, _classnames2.default)(classes.flexContent, (0, _defineProperty3.default)({}, classes.lookedUp, lookedUp));
156
156
 
157
+ var cellStyle = {
158
+ zIndex: sticky ? 12 : 11,
159
+ textAlign: align,
160
+ position: sticky ? 'relative' : 'inherit',
161
+ border: 'none',
162
+ height: dense ? cst.CELL_HEIGHT_DENSE : cst.CELL_HEIGHT
163
+ };
164
+
165
+ if (fixedColumnWidth) {
166
+ cellStyle.maxWidth = _width;
167
+ cellStyle.minWidth = _width;
168
+ cellStyle.width = _width;
169
+ }
170
+
157
171
  return _react2.default.createElement(
158
172
  _TableCell2.default,
159
- {
160
- className: classes.root,
161
- style: {
162
- maxWidth: _width,
163
- minWidth: _width,
164
- width: _width,
165
- // la cellule sticky doit être au dessus des autres cellules du body
166
- zIndex: sticky ? 12 : 11,
167
- textAlign: align,
168
- position: sticky ? 'relative' : 'inherit',
169
- border: 'none',
170
- height: dense ? cst.CELL_HEIGHT_DENSE : cst.CELL_HEIGHT
171
- }
172
- },
173
+ { className: classes.root, style: cellStyle },
173
174
  !!selectable && _react2.default.createElement(_HiCheckbox2.default, {
174
175
  classes: { root: classes.checkbox },
175
176
  style: { margin: dense ? 6 : 10 },
@@ -216,7 +217,7 @@ CellLayout.defaultProps = {
216
217
  selectable: false,
217
218
  selected: false,
218
219
  dense: false,
219
- fixedWidth: false,
220
+ fixedColumnWidth: true,
220
221
  sticky: false,
221
222
  padding: 8
222
223
  };
@@ -250,9 +251,10 @@ CellLayout.propTypes = process.env.NODE_ENV !== "production" ? {
250
251
  */
251
252
  width: _propTypes2.default.number,
252
253
  /**
253
- * La largeur de la cellule est fixé (toutes les colonnes sauf une)
254
+ * Fixe la taille des colonnes selon le type de vue
255
+ * Sinon les colonnes s'adaptent à l'espace disponible
254
256
  */
255
- fixedWidth: _propTypes2.default.bool,
257
+ fixedColumnWidth: _propTypes2.default.bool,
256
258
  /**
257
259
  * Title alignement, est déduit de type par défaut
258
260
  */
@@ -73,7 +73,7 @@ var CellSentinel = function (_React$PureComponent) {
73
73
  function CellSentinel(props) {
74
74
  (0, _classCallCheck3.default)(this, CellSentinel);
75
75
 
76
- var _this = (0, _possibleConstructorReturn3.default)(this, (CellSentinel.__proto__ || (0, _getPrototypeOf2.default)(CellSentinel)).call(this));
76
+ var _this = (0, _possibleConstructorReturn3.default)(this, (CellSentinel.__proto__ || (0, _getPrototypeOf2.default)(CellSentinel)).call(this, props));
77
77
 
78
78
  _this.getColorFromFraudResult = _this.getColorFromFraudResult.bind(_this);
79
79
  return _this;
@@ -124,7 +124,8 @@ var CellSentinel = function (_React$PureComponent) {
124
124
  fraudResult = _props.fraudResult,
125
125
  automaticFraudReviewResult = _props.automaticFraudReviewResult,
126
126
  pendingManualAction = _props.pendingManualAction,
127
- smartDecision = _props.smartDecision;
127
+ smartDecision = _props.smartDecision,
128
+ hideFraudResult = _props.hideFraudResult;
128
129
 
129
130
 
130
131
  var scoreLabel = score > 0 ? '+' + score : '' + score;
@@ -155,14 +156,14 @@ var CellSentinel = function (_React$PureComponent) {
155
156
  { title: tooltipContent, placement: this.props.sticky ? 'right' : 'bottom' },
156
157
  _react2.default.createElement(
157
158
  'div',
158
- null,
159
+ { style: { textAlign: 'right' } },
159
160
  _react2.default.createElement(_HiColoredLabel2.default, {
160
161
  label: scoreLabel,
161
162
  color: this.getColorFromFraudResult(fraudResult.toLowerCase()),
162
163
  classes: { root: classes.label },
163
164
  active: pendingManualAction
164
165
  }),
165
- _react2.default.createElement(_HiColoredLabel2.default, {
166
+ !hideFraudResult && _react2.default.createElement(_HiColoredLabel2.default, {
166
167
  label: fraudResult.toUpperCase().substr(0, 1),
167
168
  color: this.getColorFromFraudResult(fraudResult),
168
169
  classes: { root: classes.label },
@@ -184,6 +185,9 @@ var CellSentinel = function (_React$PureComponent) {
184
185
  return CellSentinel;
185
186
  }(_react2.default.PureComponent);
186
187
 
188
+ CellSentinel.defaultProps = {
189
+ hideFraudResult: false
190
+ };
187
191
  CellSentinel.propTypes = process.env.NODE_ENV !== "production" ? {
188
192
  /**
189
193
  * Résultat de l'automaticFraudReview si la transaction est passée par SmartDecision
@@ -197,6 +201,10 @@ CellSentinel.propTypes = process.env.NODE_ENV !== "production" ? {
197
201
  * Résultat de la fraude
198
202
  */
199
203
  fraudResult: _propTypes2.default.string.isRequired,
204
+ /**
205
+ * Si true le fraudResult ne sera pas affiché
206
+ */
207
+ hideFraudResult: _propTypes2.default.bool.isRequired,
200
208
  /**
201
209
  * Signal qu'il attend une réponse manuelle
202
210
  */
@@ -315,7 +315,8 @@ BodyRow.defaultProps = {
315
315
  sticky: false,
316
316
  live: false,
317
317
  innerRow: false,
318
- lookupColumns: []
318
+ lookupColumns: [],
319
+ fixedColumnWidth: true
319
320
  };
320
321
  BodyRow.propTypes = process.env.NODE_ENV !== "production" ? {
321
322
  /**
@@ -326,6 +327,11 @@ BodyRow.propTypes = process.env.NODE_ENV !== "production" ? {
326
327
  * Densité d'affichage (joue sur la hauteur des lignes)
327
328
  */
328
329
  dense: _propTypes2.default.bool,
330
+ /**
331
+ * Fixe la taille des colonnes selon le type de vue
332
+ * Sinon les colonnes s'adaptent à l'espace disponible
333
+ */
334
+ fixedColumnWidth: _propTypes2.default.bool,
329
335
  /**
330
336
  * Applique le style d'une ligne intégrée a un sous-tableau
331
337
  */
@@ -227,7 +227,7 @@ var HeaderCell = function (_React$PureComponent) {
227
227
  dense = _props.dense,
228
228
  _props$width = _props.width,
229
229
  width = _props$width === undefined ? cst.DEFAULT_WIDTHS[type][view] : _props$width,
230
- fixedWidth = _props.fixedWidth,
230
+ fixedColumnWidth = _props.fixedColumnWidth,
231
231
  _props$align = _props.align,
232
232
  align = _props$align === undefined ? cst.ALIGN_RIGHT_TYPES.includes(type) ? 'right' : 'left' : _props$align,
233
233
  sticky = _props.sticky,
@@ -263,19 +263,22 @@ var HeaderCell = function (_React$PureComponent) {
263
263
 
264
264
  var lookedUpClassName = (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.lookedUp, lookedUp));
265
265
 
266
+ var cellStyle = {
267
+ padding: 0,
268
+ zIndex: sticky ? 13 : 12, // la cellule sticky doit être au dessus des autres cellules du header
269
+ backgroundColor: 'inherit',
270
+ textAlign: align
271
+ };
272
+
273
+ if (fixedColumnWidth) {
274
+ cellStyle.maxWidth = _width;
275
+ cellStyle.minWidth = _width;
276
+ cellStyle.width = _width;
277
+ }
278
+
266
279
  return _react2.default.createElement(
267
280
  _Table.TableCell,
268
- {
269
- style: {
270
- maxWidth: _width,
271
- minWidth: _width,
272
- width: _width,
273
- padding: 0,
274
- zIndex: sticky ? 13 : 12, // la cellule sticky doit être au dessus des autres cellules du header
275
- backgroundColor: 'inherit',
276
- textAlign: align
277
- }
278
- },
281
+ { style: cellStyle },
279
282
  _react2.default.createElement(
280
283
  'div',
281
284
  null,
@@ -366,7 +369,7 @@ HeaderCell.defaultProps = {
366
369
  sortDirection: 'asc',
367
370
  view: 'l',
368
371
  dense: false,
369
- fixedWidth: false,
372
+ fixedColumnWidth: true,
370
373
  sticky: true,
371
374
  padding: 8
372
375
  };
@@ -446,7 +449,7 @@ HeaderCell.propTypes = process.env.NODE_ENV !== "production" ? {
446
449
  /**
447
450
  * La largeur de la cellule est fixé (toutes les colonnes sauf une)
448
451
  */
449
- fixedWidth: _propTypes2.default.bool,
452
+ fixedColumnWidth: _propTypes2.default.bool,
450
453
  /**
451
454
  * Title alignement, est déduit de type par défaut
452
455
  */
@@ -706,7 +706,8 @@ var HiTable = function (_React$Component) {
706
706
  view = _props.view,
707
707
  groupBy = _props.groupBy,
708
708
  lookupColumns = _props.lookupColumns,
709
- loading = _props.loading;
709
+ loading = _props.loading,
710
+ fixedColumnWidth = _props.fixedColumnWidth;
710
711
  var _state = this.state,
711
712
  dateUpdate = _state.dateUpdate,
712
713
  isScrollToBottom = _state.isScrollToBottom,
@@ -756,7 +757,8 @@ var HiTable = function (_React$Component) {
756
757
  sticky: sticky,
757
758
  view: view,
758
759
  translations: translations,
759
- lookupColumns: lookupColumns
760
+ lookupColumns: lookupColumns,
761
+ fixedColumnWidth: fixedColumnWidth
760
762
  }),
761
763
  _react2.default.createElement(_HiTableBody2.default, {
762
764
  tabId: tabId,
@@ -782,7 +784,8 @@ var HiTable = function (_React$Component) {
782
784
  onClickNext: this.handleNextStickyRow,
783
785
  groupByIds: groupByIds,
784
786
  lookupColumns: lookupColumns,
785
- loading: loading
787
+ loading: loading,
788
+ fixedColumnWidth: fixedColumnWidth
786
789
  }),
787
790
  infiniteScroll && _react2.default.createElement(_HiTableFooterScroll2.default, {
788
791
  tabId: tabId,
@@ -852,7 +855,8 @@ HiTable.defaultProps = {
852
855
  },
853
856
  view: 'l',
854
857
  lookupColumns: [],
855
- loading: false
858
+ loading: false,
859
+ fixedColumnWidth: true
856
860
  };
857
861
  HiTable.propTypes = process.env.NODE_ENV !== "production" ? {
858
862
  /**
@@ -883,6 +887,11 @@ HiTable.propTypes = process.env.NODE_ENV !== "production" ? {
883
887
  * Active le filtre sur les colonnes filtrables
884
888
  */
885
889
  filterable: _propTypes2.default.bool,
890
+ /**
891
+ * Fixe la taille des colonnes selon le type de vue
892
+ * Sinon les colonnes s'adaptent à l'espace disponible
893
+ */
894
+ fixedColumnWidth: _propTypes2.default.bool,
886
895
  /**
887
896
  * Id de la colonne par laquelle sont regroupé les éléments
888
897
  */