@ssplib/react-components 0.0.113 → 0.0.114

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.
@@ -70,8 +70,6 @@ function FileUpload({ name, tipoArquivo, title, required = false, multiple = fal
70
70
  if (!res.ok)
71
71
  setFilesError((fl) => [...fl, id]);
72
72
  res.json().then((j) => {
73
- if (!j.status)
74
- setFilesError((fl) => [...fl, id]);
75
73
  if (j.status && j.status.status === 200) {
76
74
  const fileIdFromApi = j.data[0];
77
75
  const fileId = fileIdFromApi['coSeqArquivo'];
@@ -138,15 +136,13 @@ function FileUpload({ name, tipoArquivo, title, required = false, multiple = fal
138
136
  react_1.default.createElement(material_1.Box, { sx: { backgroundColor: '#e2eafc', padding: 1, borderRadius: 1, marginTop: 1 } },
139
137
  react_1.default.createElement("input", Object.assign({ id: name, type: 'file', multiple: multiple }, context === null || context === void 0 ? void 0 : context.formRegister(name, {
140
138
  validate: (v, f) => {
141
- console.log('v: ', v.length, 'filesupload: ', filesLoaded.length);
142
- if (filesLoaded.length <= 0 && required)
139
+ if ((v.length && filesLoaded.length) <= 0 && required)
143
140
  return 'O campo de arquivo é obrigatório';
144
141
  },
145
142
  }), { onChange: onFile, accept: '.pdf', style: { display: 'none' } })),
146
143
  react_1.default.createElement("input", Object.assign({ id: name + 'foto', type: 'file', capture: 'environment', multiple: multiple }, context === null || context === void 0 ? void 0 : context.formRegister(name, {
147
144
  validate: (v, f) => {
148
- console.log('v: ', v.length, 'filesupload: ', filesLoaded.length);
149
- if (filesLoaded.length <= 0 && required)
145
+ if ((v.length && filesLoaded.length) <= 0 && required)
150
146
  return 'O campo de arquivo é obrigatório';
151
147
  },
152
148
  }), { onChange: onFile, accept: '.jpg, .png, .jpeg', style: { display: 'none' } })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.113",
3
+ "version": "0.0.114",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",