@hipay/hipay-material-ui 3.6.0-rc1 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/HiCell/CellImage.js +3 -3
  2. package/HiCell/CellTextStyled.js +2 -1
  3. package/HiDatePicker/HiDateRangePicker.js +1 -3
  4. package/HiDatePicker/HiDateRangeSelector.js +1 -3
  5. package/HiForm/HiFormControl.js +8 -11
  6. package/HiForm/HiFormLabel.js +2 -1
  7. package/HiForm/HiTextField.js +0 -3
  8. package/HiForm/HiUploadField.js +0 -1
  9. package/HiSelect/HiDynamicSelectField.js +18 -7
  10. package/HiSelect/HiNestedSelect.js +0 -1
  11. package/HiSelect/HiNestedSelectField.js +18 -7
  12. package/HiSelect/HiSelect.js +0 -1
  13. package/HiSelect/HiSelectField.js +18 -7
  14. package/HiSelect/HiSelectInput.js +1 -3
  15. package/HiSelect/HiSuggestSelect.js +2 -2
  16. package/HiSelect/HiSuggestSelectField.js +18 -7
  17. package/HiSelectableList/HiSelectableList.js +2 -2
  18. package/HiTable/HiCellBuilder.js +5 -3
  19. package/es/HiCell/CellImage.js +3 -3
  20. package/es/HiCell/CellTextStyled.js +2 -1
  21. package/es/HiDatePicker/HiDateRangePicker.js +1 -3
  22. package/es/HiDatePicker/HiDateRangeSelector.js +1 -3
  23. package/es/HiForm/HiFormControl.js +8 -11
  24. package/es/HiForm/HiFormLabel.js +2 -1
  25. package/es/HiForm/HiTextField.js +0 -3
  26. package/es/HiForm/HiUploadField.js +0 -1
  27. package/es/HiSelect/HiDynamicSelectField.js +18 -7
  28. package/es/HiSelect/HiNestedSelect.js +0 -1
  29. package/es/HiSelect/HiNestedSelectField.js +18 -7
  30. package/es/HiSelect/HiSelect.js +0 -1
  31. package/es/HiSelect/HiSelectField.js +18 -7
  32. package/es/HiSelect/HiSelectInput.js +1 -3
  33. package/es/HiSelect/HiSuggestSelect.js +2 -2
  34. package/es/HiSelect/HiSuggestSelectField.js +18 -7
  35. package/es/HiSelectableList/HiSelectableList.js +2 -2
  36. package/es/HiTable/HiCellBuilder.js +5 -3
  37. package/es/hi-svg-icons/HiInvoice.js +52 -0
  38. package/es/hi-svg-icons/HiInvoiceMenu.js +52 -0
  39. package/hi-svg-icons/HiInvoice.js +52 -0
  40. package/hi-svg-icons/HiInvoiceMenu.js +52 -0
  41. package/package.json +1 -1
@@ -79,12 +79,12 @@ function (_React$PureComponent) {
79
79
  view = _this$props.view,
80
80
  size = _this$props.size,
81
81
  fallbackImage = _this$props.fallbackImage,
82
- title = _this$props.title;
83
- if (!path || path === '') return '';
82
+ title = _this$props.title,
83
+ value = _this$props.value;
84
84
  return _react.default.createElement("div", {
85
85
  className: classes.wrapper,
86
86
  title: label
87
- }, _react.default.createElement("img", {
87
+ }, path && path !== '' && _react.default.createElement("img", {
88
88
  src: path,
89
89
  alt: label,
90
90
  title: title,
@@ -20,7 +20,8 @@ var styleRoot = {
20
20
  height: 19,
21
21
  margin: 'auto 0',
22
22
  display: 'flex',
23
- lineHeight: '15px'
23
+ lineHeight: '15px',
24
+ alignItems: 'center'
24
25
  };
25
26
  var styleColorLabel = {
26
27
  display: 'inline-block',
@@ -410,9 +410,8 @@ function (_React$Component) {
410
410
  errorText = _this$props2.errorText,
411
411
  hasSelector = _this$props2.hasSelector,
412
412
  helperIcon = _this$props2.helperIcon,
413
- helperIconLeft = _this$props2.helperIconLeft,
414
413
  helperText = _this$props2.helperText,
415
- props = (0, _objectWithoutProperties2.default)(_this$props2, ["classes", "disabled", "disabledDays", "disableFutureDays", "enableTime", "labelFrom", "labelTo", "locale", "format", "from", "fromError", "minimumDate", "onReset", "to", "toError", "translations", "id", "staticPosition", "errorText", "hasSelector", "helperIcon", "helperIconLeft", "helperText"]);
414
+ props = (0, _objectWithoutProperties2.default)(_this$props2, ["classes", "disabled", "disabledDays", "disableFutureDays", "enableTime", "labelFrom", "labelTo", "locale", "format", "from", "fromError", "minimumDate", "onReset", "to", "toError", "translations", "id", "staticPosition", "errorText", "hasSelector", "helperIcon", "helperText"]);
416
415
  var today = (0, _momentTimezone.default)();
417
416
  var now = new Date(today.year(), today.month(), today.date(), 23, 59, 59, 999);
418
417
  var modifiers = (0, _defineProperty2.default)({
@@ -609,7 +608,6 @@ function (_React$Component) {
609
608
  content = _react.default.createElement(_HiFormControl.default, {
610
609
  disabled: disabled,
611
610
  helperIcon: helperIcon,
612
- helperIconLeft: helperIconLeft,
613
611
  helperText: helperText,
614
612
  errorText: errorText,
615
613
  error: fromError || toError,
@@ -450,7 +450,6 @@ function (_React$Component) {
450
450
  fromError = _this$props2.fromError,
451
451
  toError = _this$props2.toError,
452
452
  helperIcon = _this$props2.helperIcon,
453
- helperIconLeft = _this$props2.helperIconLeft,
454
453
  helperText = _this$props2.helperText,
455
454
  idRange = _this$props2.idRange,
456
455
  idSelect = _this$props2.idSelect,
@@ -464,7 +463,7 @@ function (_React$Component) {
464
463
  classes = _this$props2.classes,
465
464
  selectProps = _this$props2.selectProps,
466
465
  staticPosition = _this$props2.staticPosition,
467
- props = (0, _objectWithoutProperties2.default)(_this$props2, ["availableOptionKeys", "disabled", "enableTime", "errorText", "fromError", "toError", "helperIcon", "helperIconLeft", "helperText", "idRange", "idSelect", "minimumDate", "label", "from", "onChange", "required", "to", "translations", "classes", "selectProps", "staticPosition"]);
466
+ props = (0, _objectWithoutProperties2.default)(_this$props2, ["availableOptionKeys", "disabled", "enableTime", "errorText", "fromError", "toError", "helperIcon", "helperText", "idRange", "idSelect", "minimumDate", "label", "from", "onChange", "required", "to", "translations", "classes", "selectProps", "staticPosition"]);
468
467
  var _this$state = this.state,
469
468
  selectedPreset = _this$state.selectedPreset,
470
469
  containerWidth = _this$state.containerWidth;
@@ -477,7 +476,6 @@ function (_React$Component) {
477
476
  return _react.default.createElement(_HiFormControl.default, {
478
477
  disabled: disabled,
479
478
  helperIcon: helperIcon,
480
- helperIconLeft: helperIconLeft,
481
479
  helperText: helperText,
482
480
  errorText: errorText,
483
481
  error: !!(fromError || toError),
@@ -64,8 +64,6 @@ var styles = function styles(theme) {
64
64
  height: 20,
65
65
  width: 20,
66
66
  marginLeft: 3,
67
- transform: 'translateY(2px)',
68
- marginTop: -6,
69
67
  '&$iconButtonError': {
70
68
  color: theme.palette.negative.main
71
69
  },
@@ -75,15 +73,17 @@ var styles = function styles(theme) {
75
73
  '&$iconButtonInfoActive': {
76
74
  color: theme.palette.primary.main
77
75
  },
78
- '&$iconFullWidth': {}
76
+ '&$iconFullWidth': {
77
+ position: 'absolute',
78
+ right: theme.spacing(1),
79
+ marginLeft: 0,
80
+ bottom: 0
81
+ }
79
82
  },
80
83
  iconButtonError: {},
81
84
  iconButtonInfo: {},
82
85
  iconButtonInfoActive: {},
83
86
  iconFullWidth: {},
84
- iconRight: {
85
- justifyContent: 'space-between'
86
- },
87
87
  errorDiv: (0, _objectSpread2.default)({}, theme.typography.b3, {
88
88
  backgroundColor: theme.palette.negative.main,
89
89
  color: '#FFFFFF',
@@ -224,7 +224,6 @@ function (_React$PureComponent) {
224
224
  InputLabelProps = _this$props.InputLabelProps,
225
225
  helperText = _this$props.helperText,
226
226
  helperIcon = _this$props.helperIcon,
227
- helperIconLeft = _this$props.helperIconLeft,
228
227
  FormHelperTextProps = _this$props.FormHelperTextProps,
229
228
  fullWidth = _this$props.fullWidth,
230
229
  required = _this$props.required,
@@ -232,7 +231,7 @@ function (_React$PureComponent) {
232
231
  rootRef = _this$props.rootRef,
233
232
  maxLength = _this$props.maxLength,
234
233
  nbChars = _this$props.nbChars,
235
- others = (0, _objectWithoutProperties2.default)(_this$props, ["children", "classes", "className", "disabled", "error", "errorText", "id", "label", "InputLabelProps", "helperText", "helperIcon", "helperIconLeft", "FormHelperTextProps", "fullWidth", "required", "multiline", "rootRef", "maxLength", "nbChars"]);
234
+ others = (0, _objectWithoutProperties2.default)(_this$props, ["children", "classes", "className", "disabled", "error", "errorText", "id", "label", "InputLabelProps", "helperText", "helperIcon", "FormHelperTextProps", "fullWidth", "required", "multiline", "rootRef", "maxLength", "nbChars"]);
236
235
  var _this$state = this.state,
237
236
  helperOpen = _this$state.helperOpen,
238
237
  focused = _this$state.focused,
@@ -265,8 +264,7 @@ function (_React$PureComponent) {
265
264
  label: label,
266
265
  required: required,
267
266
  disabled: disabled,
268
- focused: !disabled && (focused || hovered),
269
- className: !helperIconLeft && classes.iconRight
267
+ focused: !disabled && (focused || hovered)
270
268
  }, InputLabelProps), error && errorText && _react.default.createElement(_HiIconButton.default, {
271
269
  className: (0, _classnames.default)(classes.iconButton, classes.iconButtonError, (0, _defineProperty2.default)({}, classes.iconFullWidth, fullWidth)),
272
270
  onClick: this.handleHelperClick
@@ -301,7 +299,6 @@ HiFormControl.defaultProps = {
301
299
  errorText: undefined,
302
300
  helperText: undefined,
303
301
  helperIcon: false,
304
- helperIconLeft: false,
305
302
  multiline: false,
306
303
  nbChars: 0,
307
304
  maxLength: 280
@@ -46,7 +46,8 @@ var styles = function styles(theme) {
46
46
  '&$error': {
47
47
  color: theme.palette.negative.main
48
48
  },
49
- display: 'flex'
49
+ display: 'flex',
50
+ alignItems: 'baseline'
50
51
  }),
51
52
  optional: {
52
53
  fontSize: 11,
@@ -101,7 +101,6 @@ function (_React$PureComponent) {
101
101
  label = _this$props.label,
102
102
  helperText = _this$props.helperText,
103
103
  helperIcon = _this$props.helperIcon,
104
- helperIconLeft = _this$props.helperIconLeft,
105
104
  fullWidth = _this$props.fullWidth,
106
105
  required = _this$props.required,
107
106
  type = _this$props.type,
@@ -124,7 +123,6 @@ function (_React$PureComponent) {
124
123
  errorText: errorText,
125
124
  helperText: helperText,
126
125
  helperIcon: helperIcon,
127
- helperIconLeft: helperIconLeft,
128
126
  multiline: multiline,
129
127
  maxLength: maxLength,
130
128
  nbChars: nbChars,
@@ -165,7 +163,6 @@ HiTextField.defaultProps = {
165
163
  errorText: '',
166
164
  helperText: '',
167
165
  helperIcon: false,
168
- helperIconLeft: false,
169
166
  multiline: false,
170
167
  maxLength: 280
171
168
  };
@@ -69,7 +69,6 @@ function (_React$PureComponent) {
69
69
  errorText: errorText,
70
70
  error: error,
71
71
  helperIcon: helperIcon,
72
- helperIconLeft: true,
73
72
  helperText: helperText,
74
73
  fullWidth: fullWidth,
75
74
  required: required
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.default = exports.styles = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
11
11
 
@@ -27,11 +27,22 @@ var _HiFormControl = _interopRequireDefault(require("../HiForm/HiFormControl"));
27
27
 
28
28
  var _HiDynamicSelect = _interopRequireDefault(require("./HiDynamicSelect"));
29
29
 
30
- // @inheritedComponent HiDynamicSelect
30
+ var _classnames = _interopRequireDefault(require("classnames"));
31
+
32
+ var _styles = require("@material-ui/core/styles");
31
33
 
34
+ // @inheritedComponent HiDynamicSelect
35
+ var styles = {
36
+ root: {
37
+ maxWidth: 500
38
+ }
39
+ };
32
40
  /**
33
41
  * Champs input pour formulaire
34
42
  */
43
+
44
+ exports.styles = styles;
45
+
35
46
  var HiDynamicSelectField =
36
47
  /*#__PURE__*/
37
48
  function (_React$PureComponent) {
@@ -53,7 +64,6 @@ function (_React$PureComponent) {
53
64
  errorText = _this$props.errorText,
54
65
  helperText = _this$props.helperText,
55
66
  helperIcon = _this$props.helperIcon,
56
- helperIconLeft = _this$props.helperIconLeft,
57
67
  id = _this$props.id,
58
68
  name = _this$props.name,
59
69
  value = _this$props.value,
@@ -65,7 +75,8 @@ function (_React$PureComponent) {
65
75
  searchable = _this$props.searchable,
66
76
  translations = _this$props.translations,
67
77
  className = _this$props.className,
68
- others = (0, _objectWithoutProperties2.default)(_this$props, ["label", "required", "disabled", "error", "errorText", "helperText", "helperIcon", "helperIconLeft", "id", "name", "value", "options", "type", "multiple", "iconAll", "checkbox", "searchable", "translations", "className"]);
78
+ classes = _this$props.classes,
79
+ others = (0, _objectWithoutProperties2.default)(_this$props, ["label", "required", "disabled", "error", "errorText", "helperText", "helperIcon", "id", "name", "value", "options", "type", "multiple", "iconAll", "checkbox", "searchable", "translations", "className", "classes"]);
69
80
  return _react.default.createElement(_HiFormControl.default, {
70
81
  id: id,
71
82
  label: label,
@@ -75,8 +86,7 @@ function (_React$PureComponent) {
75
86
  errorText: errorText,
76
87
  helperText: helperText,
77
88
  helperIcon: helperIcon,
78
- helperIconLeft: helperIconLeft,
79
- className: className
89
+ className: (0, _classnames.default)(classes.root, className)
80
90
  }, _react.default.createElement(_HiDynamicSelect.default, (0, _extends2.default)({
81
91
  id: id,
82
92
  name: name,
@@ -96,5 +106,6 @@ function (_React$PureComponent) {
96
106
  return HiDynamicSelectField;
97
107
  }(_react.default.PureComponent);
98
108
 
99
- var _default = HiDynamicSelectField;
109
+ var _default = (0, _styles.withStyles)(styles)(HiDynamicSelectField);
110
+
100
111
  exports.default = _default;
@@ -166,7 +166,6 @@ var styles = function styles(theme) {
166
166
  return {
167
167
  root: {
168
168
  backgroundColor: theme.palette.background2,
169
- maxWidth: 500,
170
169
  width: '100%',
171
170
  position: 'relative'
172
171
  },
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.default = exports.styles = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
11
11
 
@@ -27,11 +27,22 @@ var _HiFormControl = _interopRequireDefault(require("../HiForm/HiFormControl"));
27
27
 
28
28
  var _HiNestedSelect = _interopRequireDefault(require("./HiNestedSelect"));
29
29
 
30
- // @inheritedComponent HiDynamicSelect
30
+ var _classnames = _interopRequireDefault(require("classnames"));
31
+
32
+ var _styles = require("@material-ui/core/styles");
31
33
 
34
+ // @inheritedComponent HiDynamicSelect
35
+ var styles = {
36
+ root: {
37
+ maxWidth: 500
38
+ }
39
+ };
32
40
  /**
33
41
  * Champs input pour formulaire
34
42
  */
43
+
44
+ exports.styles = styles;
45
+
35
46
  var HiNestedSelectField =
36
47
  /*#__PURE__*/
37
48
  function (_React$PureComponent) {
@@ -53,7 +64,6 @@ function (_React$PureComponent) {
53
64
  errorText = _this$props.errorText,
54
65
  helperText = _this$props.helperText,
55
66
  helperIcon = _this$props.helperIcon,
56
- helperIconLeft = _this$props.helperIconLeft,
57
67
  id = _this$props.id,
58
68
  name = _this$props.name,
59
69
  value = _this$props.value,
@@ -65,7 +75,8 @@ function (_React$PureComponent) {
65
75
  searchable = _this$props.searchable,
66
76
  translations = _this$props.translations,
67
77
  className = _this$props.className,
68
- others = (0, _objectWithoutProperties2.default)(_this$props, ["label", "required", "disabled", "error", "errorText", "helperText", "helperIcon", "helperIconLeft", "id", "name", "value", "options", "type", "multiple", "iconAll", "checkbox", "searchable", "translations", "className"]);
78
+ classes = _this$props.classes,
79
+ others = (0, _objectWithoutProperties2.default)(_this$props, ["label", "required", "disabled", "error", "errorText", "helperText", "helperIcon", "id", "name", "value", "options", "type", "multiple", "iconAll", "checkbox", "searchable", "translations", "className", "classes"]);
69
80
  return _react.default.createElement(_HiFormControl.default, {
70
81
  id: id,
71
82
  label: label,
@@ -75,8 +86,7 @@ function (_React$PureComponent) {
75
86
  errorText: errorText,
76
87
  helperText: helperText,
77
88
  helperIcon: helperIcon,
78
- helperIconLeft: helperIconLeft,
79
- className: className
89
+ className: (0, _classnames.default)(classes.root, className)
80
90
  }, _react.default.createElement(_HiNestedSelect.default, (0, _extends2.default)({
81
91
  id: id,
82
92
  name: name,
@@ -96,5 +106,6 @@ function (_React$PureComponent) {
96
106
  return HiNestedSelectField;
97
107
  }(_react.default.PureComponent);
98
108
 
99
- var _default = HiNestedSelectField;
109
+ var _default = (0, _styles.withStyles)(styles)(HiNestedSelectField);
110
+
100
111
  exports.default = _default;
@@ -69,7 +69,6 @@ var styles = function styles(theme) {
69
69
  return {
70
70
  root: {
71
71
  backgroundColor: theme.palette.background2,
72
- maxWidth: 500,
73
72
  width: '100%',
74
73
  position: 'relative'
75
74
  },
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.default = exports.styles = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
11
11
 
@@ -27,11 +27,22 @@ var _HiFormControl = _interopRequireDefault(require("../HiForm/HiFormControl"));
27
27
 
28
28
  var _HiSelect = _interopRequireDefault(require("./HiSelect"));
29
29
 
30
- // @inheritedComponent HiSelect
30
+ var _classnames = _interopRequireDefault(require("classnames"));
31
+
32
+ var _index = require("@material-ui/core/styles/index");
31
33
 
34
+ // @inheritedComponent HiSelect
35
+ var styles = {
36
+ root: {
37
+ maxWidth: 500
38
+ }
39
+ };
32
40
  /**
33
41
  * Champs input pour formulaire
34
42
  */
43
+
44
+ exports.styles = styles;
45
+
35
46
  var HiSelectField =
36
47
  /*#__PURE__*/
37
48
  function (_React$PureComponent) {
@@ -53,7 +64,6 @@ function (_React$PureComponent) {
53
64
  errorText = _this$props.errorText,
54
65
  helperText = _this$props.helperText,
55
66
  helperIcon = _this$props.helperIcon,
56
- helperIconLeft = _this$props.helperIconLeft,
57
67
  id = _this$props.id,
58
68
  name = _this$props.name,
59
69
  value = _this$props.value,
@@ -65,8 +75,9 @@ function (_React$PureComponent) {
65
75
  searchable = _this$props.searchable,
66
76
  translations = _this$props.translations,
67
77
  className = _this$props.className,
78
+ classes = _this$props.classes,
68
79
  HiInputLabelProps = _this$props.HiInputLabelProps,
69
- others = (0, _objectWithoutProperties2.default)(_this$props, ["label", "required", "disabled", "error", "errorText", "helperText", "helperIcon", "helperIconLeft", "id", "name", "value", "options", "type", "multiple", "iconAll", "checkbox", "searchable", "translations", "className", "HiInputLabelProps"]);
80
+ others = (0, _objectWithoutProperties2.default)(_this$props, ["label", "required", "disabled", "error", "errorText", "helperText", "helperIcon", "id", "name", "value", "options", "type", "multiple", "iconAll", "checkbox", "searchable", "translations", "className", "classes", "HiInputLabelProps"]);
70
81
  return _react.default.createElement(_HiFormControl.default, {
71
82
  id: id,
72
83
  label: label,
@@ -76,8 +87,7 @@ function (_React$PureComponent) {
76
87
  errorText: errorText,
77
88
  helperText: helperText,
78
89
  helperIcon: helperIcon,
79
- helperIconLeft: helperIconLeft,
80
- className: className,
90
+ className: (0, _classnames.default)(classes.root, className),
81
91
  InputLabelProps: HiInputLabelProps
82
92
  }, _react.default.createElement(_HiSelect.default, (0, _extends2.default)({
83
93
  id: id,
@@ -98,5 +108,6 @@ function (_React$PureComponent) {
98
108
  return HiSelectField;
99
109
  }(_react.default.PureComponent);
100
110
 
101
- var _default = HiSelectField;
111
+ var _default = (0, _index.withStyles)(styles)(HiSelectField);
112
+
102
113
  exports.default = _default;
@@ -46,7 +46,6 @@ var styles = function styles(theme) {
46
46
  root: {
47
47
  width: '100%',
48
48
  height: 40,
49
- maxWidth: 500,
50
49
  display: 'flex',
51
50
  justifyContent: 'center',
52
51
  padding: 8,
@@ -131,8 +130,7 @@ var styles = function styles(theme) {
131
130
  textOverflow: 'ellipsis'
132
131
  }, theme.typography.b1, {
133
132
  display: 'inline-block',
134
- width: '100%',
135
- maxWidth: 500
133
+ width: '100%'
136
134
  }),
137
135
  placeholder: {
138
136
  color: theme.palette.grey[400]
@@ -48,7 +48,6 @@ var styles = function styles(theme) {
48
48
  return {
49
49
  root: {
50
50
  backgroundColor: theme.palette.background2,
51
- maxWidth: 500,
52
51
  minWidth: 200,
53
52
  width: '100%'
54
53
  },
@@ -252,7 +251,8 @@ function (_React$PureComponent) {
252
251
  disabled: true,
253
252
  centered: true,
254
253
  checkbox: false,
255
- label: showNoResults ? translations.no_result_match : translations.min_length
254
+ label: showNoResults ? translations.no_result_match : translations.min_length,
255
+ selectable: false
256
256
  }];
257
257
  }
258
258
 
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.default = exports.styles = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/extends"));
11
11
 
@@ -27,11 +27,22 @@ var _HiFormControl = _interopRequireDefault(require("../HiForm/HiFormControl"));
27
27
 
28
28
  var _HiSuggestSelect = _interopRequireDefault(require("./HiSuggestSelect"));
29
29
 
30
- // @inheritedComponent HiSuggestSelect
30
+ var _classnames = _interopRequireDefault(require("classnames"));
31
+
32
+ var _styles = require("@material-ui/core/styles");
31
33
 
34
+ // @inheritedComponent HiSuggestSelect
35
+ var styles = {
36
+ root: {
37
+ maxWidth: 500
38
+ }
39
+ };
32
40
  /**
33
41
  * Champs input autosuggest pour formulaire avec label
34
42
  */
43
+
44
+ exports.styles = styles;
45
+
35
46
  var HiSuggestSelectField =
36
47
  /*#__PURE__*/
37
48
  function (_React$PureComponent) {
@@ -53,10 +64,10 @@ function (_React$PureComponent) {
53
64
  errorText = _this$props.errorText,
54
65
  helperText = _this$props.helperText,
55
66
  helperIcon = _this$props.helperIcon,
56
- helperIconLeft = _this$props.helperIconLeft,
57
67
  id = _this$props.id,
58
68
  className = _this$props.className,
59
- others = (0, _objectWithoutProperties2.default)(_this$props, ["label", "required", "disabled", "error", "errorText", "helperText", "helperIcon", "helperIconLeft", "id", "className"]);
69
+ classes = _this$props.classes,
70
+ others = (0, _objectWithoutProperties2.default)(_this$props, ["label", "required", "disabled", "error", "errorText", "helperText", "helperIcon", "id", "className", "classes"]);
60
71
  return _react.default.createElement(_HiFormControl.default, {
61
72
  id: id,
62
73
  label: label,
@@ -66,8 +77,7 @@ function (_React$PureComponent) {
66
77
  errorText: errorText,
67
78
  helperText: helperText,
68
79
  helperIcon: helperIcon,
69
- helperIconLeft: helperIconLeft,
70
- className: className
80
+ className: (0, _classnames.default)(classes.root, className)
71
81
  }, _react.default.createElement(_HiSuggestSelect.default, (0, _extends2.default)({
72
82
  id: id,
73
83
  translations: {
@@ -85,5 +95,6 @@ function (_React$PureComponent) {
85
95
  return HiSuggestSelectField;
86
96
  }(_react.default.PureComponent);
87
97
 
88
- var _default = HiSuggestSelectField;
98
+ var _default = (0, _styles.withStyles)(styles)(HiSuggestSelectField);
99
+
89
100
  exports.default = _default;
@@ -151,8 +151,8 @@ function (_React$PureComponent) {
151
151
  hoverIcon: hoverIcon,
152
152
  icon: icon,
153
153
  level: level,
154
- onSelect: _this.handleSelect(item),
155
- onKeyDown: onKeyDown,
154
+ onSelect: item.selectable !== false ? _this.handleSelect(item) : undefined,
155
+ onKeyDown: item.selectable !== false ? onKeyDown : undefined,
156
156
  onKeyUp: onKeyUp,
157
157
  selected: selectedItemIdList.includes(item.id) // item props override upper props (disabled, hideCheckbox, icon, level...)
158
158
  ,
@@ -78,9 +78,11 @@ function (_React$PureComponent) {
78
78
  Object.keys(refproperties).forEach(function (key) {
79
79
  datacell[key] = refproperties[key];
80
80
  });
81
- } else {
82
- datacell = undefined;
83
81
  }
82
+ /* else {
83
+ datacell = undefined;
84
+ }*/
85
+
84
86
  }
85
87
 
86
88
  if (datacell) {
@@ -109,7 +111,7 @@ function (_React$PureComponent) {
109
111
 
110
112
  case cst.TYPE_IMAGE:
111
113
  return _react.default.createElement(_CellImage.default, {
112
- label: datacell.label,
114
+ label: datacell.label || datacell.value,
113
115
  shortLabel: datacell.id,
114
116
  path: datacell.img,
115
117
  size: datacell.size || cell.size,
@@ -79,12 +79,12 @@ function (_React$PureComponent) {
79
79
  view = _this$props.view,
80
80
  size = _this$props.size,
81
81
  fallbackImage = _this$props.fallbackImage,
82
- title = _this$props.title;
83
- if (!path || path === '') return '';
82
+ title = _this$props.title,
83
+ value = _this$props.value;
84
84
  return _react.default.createElement("div", {
85
85
  className: classes.wrapper,
86
86
  title: label
87
- }, _react.default.createElement("img", {
87
+ }, path && path !== '' && _react.default.createElement("img", {
88
88
  src: path,
89
89
  alt: label,
90
90
  title: title,
@@ -20,7 +20,8 @@ var styleRoot = {
20
20
  height: 19,
21
21
  margin: 'auto 0',
22
22
  display: 'flex',
23
- lineHeight: '15px'
23
+ lineHeight: '15px',
24
+ alignItems: 'center'
24
25
  };
25
26
  var styleColorLabel = {
26
27
  display: 'inline-block',
@@ -410,9 +410,8 @@ function (_React$Component) {
410
410
  errorText = _this$props2.errorText,
411
411
  hasSelector = _this$props2.hasSelector,
412
412
  helperIcon = _this$props2.helperIcon,
413
- helperIconLeft = _this$props2.helperIconLeft,
414
413
  helperText = _this$props2.helperText,
415
- props = (0, _objectWithoutProperties2.default)(_this$props2, ["classes", "disabled", "disabledDays", "disableFutureDays", "enableTime", "labelFrom", "labelTo", "locale", "format", "from", "fromError", "minimumDate", "onReset", "to", "toError", "translations", "id", "staticPosition", "errorText", "hasSelector", "helperIcon", "helperIconLeft", "helperText"]);
414
+ props = (0, _objectWithoutProperties2.default)(_this$props2, ["classes", "disabled", "disabledDays", "disableFutureDays", "enableTime", "labelFrom", "labelTo", "locale", "format", "from", "fromError", "minimumDate", "onReset", "to", "toError", "translations", "id", "staticPosition", "errorText", "hasSelector", "helperIcon", "helperText"]);
416
415
  var today = (0, _momentTimezone.default)();
417
416
  var now = new Date(today.year(), today.month(), today.date(), 23, 59, 59, 999);
418
417
  var modifiers = (0, _defineProperty2.default)({
@@ -609,7 +608,6 @@ function (_React$Component) {
609
608
  content = _react.default.createElement(_HiFormControl.default, {
610
609
  disabled: disabled,
611
610
  helperIcon: helperIcon,
612
- helperIconLeft: helperIconLeft,
613
611
  helperText: helperText,
614
612
  errorText: errorText,
615
613
  error: fromError || toError,
@@ -450,7 +450,6 @@ function (_React$Component) {
450
450
  fromError = _this$props2.fromError,
451
451
  toError = _this$props2.toError,
452
452
  helperIcon = _this$props2.helperIcon,
453
- helperIconLeft = _this$props2.helperIconLeft,
454
453
  helperText = _this$props2.helperText,
455
454
  idRange = _this$props2.idRange,
456
455
  idSelect = _this$props2.idSelect,
@@ -464,7 +463,7 @@ function (_React$Component) {
464
463
  classes = _this$props2.classes,
465
464
  selectProps = _this$props2.selectProps,
466
465
  staticPosition = _this$props2.staticPosition,
467
- props = (0, _objectWithoutProperties2.default)(_this$props2, ["availableOptionKeys", "disabled", "enableTime", "errorText", "fromError", "toError", "helperIcon", "helperIconLeft", "helperText", "idRange", "idSelect", "minimumDate", "label", "from", "onChange", "required", "to", "translations", "classes", "selectProps", "staticPosition"]);
466
+ props = (0, _objectWithoutProperties2.default)(_this$props2, ["availableOptionKeys", "disabled", "enableTime", "errorText", "fromError", "toError", "helperIcon", "helperText", "idRange", "idSelect", "minimumDate", "label", "from", "onChange", "required", "to", "translations", "classes", "selectProps", "staticPosition"]);
468
467
  var _this$state = this.state,
469
468
  selectedPreset = _this$state.selectedPreset,
470
469
  containerWidth = _this$state.containerWidth;
@@ -477,7 +476,6 @@ function (_React$Component) {
477
476
  return _react.default.createElement(_HiFormControl.default, {
478
477
  disabled: disabled,
479
478
  helperIcon: helperIcon,
480
- helperIconLeft: helperIconLeft,
481
479
  helperText: helperText,
482
480
  errorText: errorText,
483
481
  error: !!(fromError || toError),