@ssplib/react-components 0.0.293 → 0.0.294

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.
@@ -118,6 +118,8 @@ function FetchAutoComplete({ name, url, title, customLoadingText, shouldRefetch
118
118
  title && react_1.default.createElement(material_1.InputLabel, { required: required }, title),
119
119
  react_1.default.createElement("input", Object.assign({ type: 'text' }, context === null || context === void 0 ? void 0 : context.formRegister(name, {
120
120
  validate: (v, f) => {
121
+ if (!v)
122
+ return 'Este campo é obrigatório';
121
123
  if (v.length <= 0 && required)
122
124
  return 'Este campo é obrigatório';
123
125
  },
@@ -60,13 +60,15 @@ function FixedAutoComplete({ name, title, required = false, list, defaultValue,
60
60
  return;
61
61
  }
62
62
  setValue(null);
63
- context.formSetValue(name, undefined);
63
+ context.formSetValue(name, '');
64
64
  onChange(undefined);
65
65
  }
66
66
  return (react_1.default.createElement(material_1.Grid, Object.assign({ item: true }, { xs, sm, md }),
67
67
  title && react_1.default.createElement(material_1.InputLabel, { required: required }, title),
68
68
  react_1.default.createElement("input", Object.assign({ type: 'text' }, context === null || context === void 0 ? void 0 : context.formRegister(name, {
69
69
  validate: (v, f) => {
70
+ if (!v)
71
+ return 'Este campo é obrigatório';
70
72
  if ((v === null || v === void 0 ? void 0 : v.length) <= 0 && required)
71
73
  return 'Este campo é obrigatório';
72
74
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.293",
3
+ "version": "0.0.294",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",