@data-driven-forms/ant-component-mapper 3.19.0 → 3.19.2

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.
@@ -48,7 +48,8 @@ var DatePicker = function DatePicker(props) {
48
48
  helperText: helperText,
49
49
  description: description,
50
50
  FormItemProps: FormItemProps,
51
- isRequired: isRequired
51
+ isRequired: isRequired,
52
+ input: input
52
53
  }, /*#__PURE__*/_react["default"].createElement(_index["default"], (0, _extends2["default"])({
53
54
  disabled: isDisabled || isReadOnly,
54
55
  defaultValue: input.value ? input.value : undefined,
@@ -57,7 +58,8 @@ var DatePicker = function DatePicker(props) {
57
58
  error: !!invalid,
58
59
  readOnly: isReadOnly
59
60
  }, input, {
60
- value: input.value || null
61
+ value: input.value || null,
62
+ id: input.name
61
63
  }, rest)));
62
64
  };
63
65
 
@@ -58,7 +58,8 @@ var DualListSelect = function DualListSelect(props) {
58
58
  helperText: helperText,
59
59
  description: description,
60
60
  FormItemProps: FormItemProps,
61
- isRequired: isRequired
61
+ isRequired: isRequired,
62
+ input: input
62
63
  }, /*#__PURE__*/_react["default"].createElement(_index["default"], (0, _extends2["default"])({}, input, {
63
64
  targetKeys: value,
64
65
  onChange: function onChange(targetKeys) {
@@ -31,7 +31,8 @@ var DatePicker = function DatePicker(props) {
31
31
  helperText: helperText,
32
32
  description: description,
33
33
  FormItemProps: FormItemProps,
34
- isRequired: isRequired
34
+ isRequired: isRequired,
35
+ input: input
35
36
  }, /*#__PURE__*/React.createElement(AntDatePicker, _extends({
36
37
  disabled: isDisabled || isReadOnly,
37
38
  defaultValue: input.value ? input.value : undefined,
@@ -40,7 +41,8 @@ var DatePicker = function DatePicker(props) {
40
41
  error: !!invalid,
41
42
  readOnly: isReadOnly
42
43
  }, input, {
43
- value: input.value || null
44
+ value: input.value || null,
45
+ id: input.name
44
46
  }, rest)));
45
47
  };
46
48
 
@@ -43,7 +43,8 @@ var DualListSelect = function DualListSelect(props) {
43
43
  helperText: helperText,
44
44
  description: description,
45
45
  FormItemProps: FormItemProps,
46
- isRequired: isRequired
46
+ isRequired: isRequired,
47
+ input: input
47
48
  }, /*#__PURE__*/React.createElement(Transfer, _extends({}, input, {
48
49
  targetKeys: value,
49
50
  onChange: function onChange(targetKeys) {
@@ -14,7 +14,8 @@ var FormGroup = function FormGroup(_ref) {
14
14
  validateOnMount = _ref.validateOnMount,
15
15
  helperText = _ref.helperText,
16
16
  description = _ref.description,
17
- hideLabel = _ref.hideLabel;
17
+ hideLabel = _ref.hideLabel,
18
+ input = _ref.input;
18
19
  var invalid = validationError(meta, validateOnMount);
19
20
  var warning = (meta.touched || validateOnMount) && meta.warning;
20
21
  var help = invalid || warning || helperText || description;
@@ -22,7 +23,8 @@ var FormGroup = function FormGroup(_ref) {
22
23
  validateStatus: !invalid ? warning ? 'warning' : '' : 'error',
23
24
  help: help,
24
25
  label: !hideLabel && label,
25
- required: isRequired
26
+ required: isRequired,
27
+ htmlFor: input === null || input === void 0 ? void 0 : input.name
26
28
  }, FormItemProps), children);
27
29
  };
28
30
 
@@ -37,6 +39,7 @@ FormGroup.propTypes = {
37
39
  validateOnMount: PropTypes.bool,
38
40
  helperText: PropTypes.node,
39
41
  description: PropTypes.node,
40
- hideLabel: PropTypes.bool
42
+ hideLabel: PropTypes.bool,
43
+ input: PropTypes.object
41
44
  };
42
45
  export default FormGroup;
@@ -33,6 +33,7 @@ var Wrapper = function Wrapper(_ref2) {
33
33
  isRequired = _ref2.isRequired,
34
34
  children = _ref2.children,
35
35
  meta = _ref2.meta,
36
+ input = _ref2.input,
36
37
  validateOnMount = _ref2.validateOnMount,
37
38
  helperText = _ref2.helperText,
38
39
  description = _ref2.description,
@@ -44,7 +45,8 @@ var Wrapper = function Wrapper(_ref2) {
44
45
  helperText: helperText,
45
46
  description: description,
46
47
  FormItemProps: FormItemProps,
47
- isRequired: isRequired
48
+ isRequired: isRequired,
49
+ input: input
48
50
  }, children);
49
51
  };
50
52
 
@@ -45,7 +45,8 @@ var Select = function Select(props) {
45
45
  helperText: helperText,
46
46
  description: description,
47
47
  FormItemProps: FormItemProps,
48
- isRequired: isRequired
48
+ isRequired: isRequired,
49
+ input: input
49
50
  }, /*#__PURE__*/React.createElement(AntSelect, _extends({}, input, {
50
51
  value: input.value ? input.value : undefined,
51
52
  defaultValue: input.value ? input.value : undefined,
@@ -62,7 +63,8 @@ var Select = function Select(props) {
62
63
  onChange: function onChange(value, option) {
63
64
  return input.onChange(isMulti ? selectValue(option) : option ? option.value : undefined);
64
65
  },
65
- input: input
66
+ input: input,
67
+ id: input.name
66
68
  }, rest), options.filter(function (option) {
67
69
  return Object.prototype.hasOwnProperty.call(option, 'value') && option.value !== null;
68
70
  }).map(function (_ref) {
@@ -49,7 +49,8 @@ var Slider = function Slider(props) {
49
49
  value: range === true && !Array.isArray(value) ? [min, max] : value,
50
50
  range: range,
51
51
  min: min,
52
- max: max
52
+ max: max,
53
+ id: input.name
53
54
  }, rest)));
54
55
  };
55
56
 
@@ -41,8 +41,11 @@ export var Switch = function Switch(props) {
41
41
  helperText: helperText,
42
42
  description: description,
43
43
  FormItemProps: FormItemProps,
44
- isRequired: isRequired
45
- }, /*#__PURE__*/React.createElement(AntSwitch, _extends({}, rest, {
44
+ isRequired: isRequired,
45
+ input: input
46
+ }, /*#__PURE__*/React.createElement(AntSwitch, _extends({
47
+ id: input.name
48
+ }, rest, {
46
49
  defaultValue: input.checked ? input.checked : undefined,
47
50
  onChange: onChange,
48
51
  checked: checked,
@@ -29,12 +29,14 @@ var TextField = function TextField(props) {
29
29
  helperText: helperText,
30
30
  description: description,
31
31
  FormItemProps: FormItemProps,
32
- isRequired: isRequired
32
+ isRequired: isRequired,
33
+ input: input
33
34
  }, /*#__PURE__*/React.createElement(Input, _extends({}, input, {
34
35
  defaultValue: input.value ? input.value : undefined,
35
36
  disabled: isDisabled,
36
37
  readOnly: isReadOnly,
37
- placeholder: placeholder
38
+ placeholder: placeholder,
39
+ id: input.name
38
40
  }, rest)));
39
41
  };
40
42
 
@@ -30,12 +30,14 @@ var Textarea = function Textarea(props) {
30
30
  helperText: helperText,
31
31
  description: description,
32
32
  FormItemProps: FormItemProps,
33
- isRequired: isRequired
33
+ isRequired: isRequired,
34
+ input: input
34
35
  }, /*#__PURE__*/React.createElement(TextArea, _extends({}, input, {
35
36
  defaultValue: input.value ? input.value : undefined,
36
37
  disabled: isDisabled,
37
38
  readOnly: isReadOnly,
38
- placeholder: placeholder
39
+ placeholder: placeholder,
40
+ id: input.name
39
41
  }, rest)));
40
42
  };
41
43
 
@@ -31,7 +31,8 @@ var TimePicker = function TimePicker(props) {
31
31
  helperText: helperText,
32
32
  description: description,
33
33
  FormItemProps: FormItemProps,
34
- isRequired: isRequired
34
+ isRequired: isRequired,
35
+ input: input
35
36
  }, /*#__PURE__*/React.createElement(AntTimePicker, _extends({
36
37
  use12Hours: true,
37
38
  format: "h:mm a",
@@ -42,7 +43,8 @@ var TimePicker = function TimePicker(props) {
42
43
  readOnly: isReadOnly,
43
44
  defaultValue: input.value ? input.value : undefined
44
45
  }, input, {
45
- value: input.value || null
46
+ value: input.value || null,
47
+ id: input.name
46
48
  }, rest)));
47
49
  };
48
50
 
@@ -28,7 +28,8 @@ var FormGroup = function FormGroup(_ref) {
28
28
  validateOnMount = _ref.validateOnMount,
29
29
  helperText = _ref.helperText,
30
30
  description = _ref.description,
31
- hideLabel = _ref.hideLabel;
31
+ hideLabel = _ref.hideLabel,
32
+ input = _ref.input;
32
33
  var invalid = (0, _validationError.validationError)(meta, validateOnMount);
33
34
  var warning = (meta.touched || validateOnMount) && meta.warning;
34
35
  var help = invalid || warning || helperText || description;
@@ -36,7 +37,8 @@ var FormGroup = function FormGroup(_ref) {
36
37
  validateStatus: !invalid ? warning ? 'warning' : '' : 'error',
37
38
  help: help,
38
39
  label: !hideLabel && label,
39
- required: isRequired
40
+ required: isRequired,
41
+ htmlFor: input === null || input === void 0 ? void 0 : input.name
40
42
  }, FormItemProps), children);
41
43
  };
42
44
 
@@ -51,7 +53,8 @@ FormGroup.propTypes = {
51
53
  validateOnMount: _propTypes["default"].bool,
52
54
  helperText: _propTypes["default"].node,
53
55
  description: _propTypes["default"].node,
54
- hideLabel: _propTypes["default"].bool
56
+ hideLabel: _propTypes["default"].bool,
57
+ input: _propTypes["default"].object
55
58
  };
56
59
  var _default = FormGroup;
57
60
  exports["default"] = _default;
@@ -54,6 +54,7 @@ var Wrapper = function Wrapper(_ref2) {
54
54
  isRequired = _ref2.isRequired,
55
55
  children = _ref2.children,
56
56
  meta = _ref2.meta,
57
+ input = _ref2.input,
57
58
  validateOnMount = _ref2.validateOnMount,
58
59
  helperText = _ref2.helperText,
59
60
  description = _ref2.description,
@@ -65,7 +66,8 @@ var Wrapper = function Wrapper(_ref2) {
65
66
  helperText: helperText,
66
67
  description: description,
67
68
  FormItemProps: FormItemProps,
68
- isRequired: isRequired
69
+ isRequired: isRequired,
70
+ input: input
69
71
  }, children);
70
72
  };
71
73
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-driven-forms/ant-component-mapper",
3
- "version": "3.19.0",
3
+ "version": "3.19.2",
4
4
  "description": "Ant Design React component mapper for Data Driven Forms.",
5
5
  "main": "index.js",
6
6
  "module": "esm/index.js",
@@ -29,13 +29,13 @@
29
29
  "antd": "^4.2.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@data-driven-forms/react-form-renderer": "^3.19.0",
32
+ "@data-driven-forms/react-form-renderer": "^3.19.2",
33
33
  "antd": "^4.2.0",
34
34
  "react": "^16.13.1 || ^17.0.2 || ^18.0.0",
35
35
  "react-dom": "^16.13.1 || ^17.0.2 || ^18.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@data-driven-forms/common": "^3.19.0",
38
+ "@data-driven-forms/common": "^3.19.2",
39
39
  "lodash": "^4.17.21"
40
40
  }
41
41
  }
package/select/select.js CHANGED
@@ -61,7 +61,8 @@ var Select = function Select(props) {
61
61
  helperText: helperText,
62
62
  description: description,
63
63
  FormItemProps: FormItemProps,
64
- isRequired: isRequired
64
+ isRequired: isRequired,
65
+ input: input
65
66
  }, /*#__PURE__*/_react["default"].createElement(_index["default"], (0, _extends2["default"])({}, input, {
66
67
  value: input.value ? input.value : undefined,
67
68
  defaultValue: input.value ? input.value : undefined,
@@ -78,7 +79,8 @@ var Select = function Select(props) {
78
79
  onChange: function onChange(value, option) {
79
80
  return input.onChange(isMulti ? selectValue(option) : option ? option.value : undefined);
80
81
  },
81
- input: input
82
+ input: input,
83
+ id: input.name
82
84
  }, rest), options.filter(function (option) {
83
85
  return Object.prototype.hasOwnProperty.call(option, 'value') && option.value !== null;
84
86
  }).map(function (_ref) {
package/slider/slider.js CHANGED
@@ -70,7 +70,8 @@ var Slider = function Slider(props) {
70
70
  value: range === true && !Array.isArray(value) ? [min, max] : value,
71
71
  range: range,
72
72
  min: min,
73
- max: max
73
+ max: max,
74
+ id: input.name
74
75
  }, rest)));
75
76
  };
76
77
 
package/switch/switch.js CHANGED
@@ -58,8 +58,11 @@ var Switch = function Switch(props) {
58
58
  helperText: helperText,
59
59
  description: description,
60
60
  FormItemProps: FormItemProps,
61
- isRequired: isRequired
62
- }, /*#__PURE__*/_react["default"].createElement(_index["default"], (0, _extends2["default"])({}, rest, {
61
+ isRequired: isRequired,
62
+ input: input
63
+ }, /*#__PURE__*/_react["default"].createElement(_index["default"], (0, _extends2["default"])({
64
+ id: input.name
65
+ }, rest, {
63
66
  defaultValue: input.checked ? input.checked : undefined,
64
67
  onChange: onChange,
65
68
  checked: checked,
@@ -45,12 +45,14 @@ var TextField = function TextField(props) {
45
45
  helperText: helperText,
46
46
  description: description,
47
47
  FormItemProps: FormItemProps,
48
- isRequired: isRequired
48
+ isRequired: isRequired,
49
+ input: input
49
50
  }, /*#__PURE__*/_react["default"].createElement(_index["default"], (0, _extends2["default"])({}, input, {
50
51
  defaultValue: input.value ? input.value : undefined,
51
52
  disabled: isDisabled,
52
53
  readOnly: isReadOnly,
53
- placeholder: placeholder
54
+ placeholder: placeholder,
55
+ id: input.name
54
56
  }, rest)));
55
57
  };
56
58
 
@@ -46,12 +46,14 @@ var Textarea = function Textarea(props) {
46
46
  helperText: helperText,
47
47
  description: description,
48
48
  FormItemProps: FormItemProps,
49
- isRequired: isRequired
49
+ isRequired: isRequired,
50
+ input: input
50
51
  }, /*#__PURE__*/_react["default"].createElement(TextArea, (0, _extends2["default"])({}, input, {
51
52
  defaultValue: input.value ? input.value : undefined,
52
53
  disabled: isDisabled,
53
54
  readOnly: isReadOnly,
54
- placeholder: placeholder
55
+ placeholder: placeholder,
56
+ id: input.name
55
57
  }, rest)));
56
58
  };
57
59
 
@@ -48,7 +48,8 @@ var TimePicker = function TimePicker(props) {
48
48
  helperText: helperText,
49
49
  description: description,
50
50
  FormItemProps: FormItemProps,
51
- isRequired: isRequired
51
+ isRequired: isRequired,
52
+ input: input
52
53
  }, /*#__PURE__*/_react["default"].createElement(_index["default"], (0, _extends2["default"])({
53
54
  use12Hours: true,
54
55
  format: "h:mm a",
@@ -59,7 +60,8 @@ var TimePicker = function TimePicker(props) {
59
60
  readOnly: isReadOnly,
60
61
  defaultValue: input.value ? input.value : undefined
61
62
  }, input, {
62
- value: input.value || null
63
+ value: input.value || null,
64
+ id: input.name
63
65
  }, rest)));
64
66
  };
65
67