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

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.
@@ -410,8 +410,9 @@ 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,
413
414
  helperText = _this$props2.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"]);
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"]);
415
416
  var today = (0, _momentTimezone.default)();
416
417
  var now = new Date(today.year(), today.month(), today.date(), 23, 59, 59, 999);
417
418
  var modifiers = (0, _defineProperty2.default)({
@@ -608,6 +609,7 @@ function (_React$Component) {
608
609
  content = _react.default.createElement(_HiFormControl.default, {
609
610
  disabled: disabled,
610
611
  helperIcon: helperIcon,
612
+ helperIconLeft: helperIconLeft,
611
613
  helperText: helperText,
612
614
  errorText: errorText,
613
615
  error: fromError || toError,
@@ -450,6 +450,7 @@ 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,
453
454
  helperText = _this$props2.helperText,
454
455
  idRange = _this$props2.idRange,
455
456
  idSelect = _this$props2.idSelect,
@@ -463,7 +464,7 @@ function (_React$Component) {
463
464
  classes = _this$props2.classes,
464
465
  selectProps = _this$props2.selectProps,
465
466
  staticPosition = _this$props2.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"]);
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"]);
467
468
  var _this$state = this.state,
468
469
  selectedPreset = _this$state.selectedPreset,
469
470
  containerWidth = _this$state.containerWidth;
@@ -476,6 +477,7 @@ function (_React$Component) {
476
477
  return _react.default.createElement(_HiFormControl.default, {
477
478
  disabled: disabled,
478
479
  helperIcon: helperIcon,
480
+ helperIconLeft: helperIconLeft,
479
481
  helperText: helperText,
480
482
  errorText: errorText,
481
483
  error: !!(fromError || toError),
@@ -64,6 +64,8 @@ var styles = function styles(theme) {
64
64
  height: 20,
65
65
  width: 20,
66
66
  marginLeft: 3,
67
+ transform: 'translateY(2px)',
68
+ marginTop: -6,
67
69
  '&$iconButtonError': {
68
70
  color: theme.palette.negative.main
69
71
  },
@@ -73,17 +75,15 @@ var styles = function styles(theme) {
73
75
  '&$iconButtonInfoActive': {
74
76
  color: theme.palette.primary.main
75
77
  },
76
- '&$iconFullWidth': {
77
- position: 'absolute',
78
- right: theme.spacing(1),
79
- marginLeft: 0,
80
- bottom: 0
81
- }
78
+ '&$iconFullWidth': {}
82
79
  },
83
80
  iconButtonError: {},
84
81
  iconButtonInfo: {},
85
82
  iconButtonInfoActive: {},
86
83
  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,6 +224,7 @@ 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,
227
228
  FormHelperTextProps = _this$props.FormHelperTextProps,
228
229
  fullWidth = _this$props.fullWidth,
229
230
  required = _this$props.required,
@@ -231,7 +232,7 @@ function (_React$PureComponent) {
231
232
  rootRef = _this$props.rootRef,
232
233
  maxLength = _this$props.maxLength,
233
234
  nbChars = _this$props.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"]);
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"]);
235
236
  var _this$state = this.state,
236
237
  helperOpen = _this$state.helperOpen,
237
238
  focused = _this$state.focused,
@@ -264,7 +265,8 @@ function (_React$PureComponent) {
264
265
  label: label,
265
266
  required: required,
266
267
  disabled: disabled,
267
- focused: !disabled && (focused || hovered)
268
+ focused: !disabled && (focused || hovered),
269
+ className: !helperIconLeft && classes.iconRight
268
270
  }, InputLabelProps), error && errorText && _react.default.createElement(_HiIconButton.default, {
269
271
  className: (0, _classnames.default)(classes.iconButton, classes.iconButtonError, (0, _defineProperty2.default)({}, classes.iconFullWidth, fullWidth)),
270
272
  onClick: this.handleHelperClick
@@ -299,6 +301,7 @@ HiFormControl.defaultProps = {
299
301
  errorText: undefined,
300
302
  helperText: undefined,
301
303
  helperIcon: false,
304
+ helperIconLeft: false,
302
305
  multiline: false,
303
306
  nbChars: 0,
304
307
  maxLength: 280
@@ -46,8 +46,7 @@ var styles = function styles(theme) {
46
46
  '&$error': {
47
47
  color: theme.palette.negative.main
48
48
  },
49
- display: 'flex',
50
- alignItems: 'baseline'
49
+ display: 'flex'
51
50
  }),
52
51
  optional: {
53
52
  fontSize: 11,
@@ -101,6 +101,7 @@ 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,
104
105
  fullWidth = _this$props.fullWidth,
105
106
  required = _this$props.required,
106
107
  type = _this$props.type,
@@ -123,6 +124,7 @@ function (_React$PureComponent) {
123
124
  errorText: errorText,
124
125
  helperText: helperText,
125
126
  helperIcon: helperIcon,
127
+ helperIconLeft: helperIconLeft,
126
128
  multiline: multiline,
127
129
  maxLength: maxLength,
128
130
  nbChars: nbChars,
@@ -163,6 +165,7 @@ HiTextField.defaultProps = {
163
165
  errorText: '',
164
166
  helperText: '',
165
167
  helperIcon: false,
168
+ helperIconLeft: false,
166
169
  multiline: false,
167
170
  maxLength: 280
168
171
  };
@@ -47,7 +47,8 @@ function (_React$PureComponent) {
47
47
  helperText = _this$props.helperText,
48
48
  values = _this$props.values,
49
49
  fullWidth = _this$props.fullWidth,
50
- others = (0, _objectWithoutProperties2.default)(_this$props, ["className", "label", "helperIcon", "helperText", "values", "fullWidth"]);
50
+ required = _this$props.required,
51
+ others = (0, _objectWithoutProperties2.default)(_this$props, ["className", "label", "helperIcon", "helperText", "values", "fullWidth", "required"]);
51
52
  var empty = true;
52
53
  var error = false;
53
54
  var errorText = '';
@@ -68,8 +69,10 @@ function (_React$PureComponent) {
68
69
  errorText: errorText,
69
70
  error: error,
70
71
  helperIcon: helperIcon,
72
+ helperIconLeft: true,
71
73
  helperText: helperText,
72
- fullWidth: fullWidth
74
+ fullWidth: fullWidth,
75
+ required: required
73
76
  }, _react.default.createElement(_HiUpload.default, (0, _extends2.default)({
74
77
  values: values
75
78
  }, others)));
@@ -82,7 +85,8 @@ HiUploadField.defaultProps = {
82
85
  helperText: '',
83
86
  helperIcon: false,
84
87
  seeFile: true,
85
- fullWidth: false
88
+ fullWidth: false,
89
+ required: true
86
90
  };
87
91
  var _default = HiUploadField;
88
92
  exports.default = _default;