@ssplib/react-components 0.0.161 → 0.0.162
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.
|
@@ -63,7 +63,6 @@ function getChildrenNames(children) {
|
|
|
63
63
|
function RequiredCheckBoxGroup(_a) {
|
|
64
64
|
var _b;
|
|
65
65
|
var { customText = 'Selecione pelo menos 1 opção' } = _a, props = __rest(_a, ["customText"]);
|
|
66
|
-
console.log('ENTROU NO RequiredCheckBoxGroup - VALOR DE props: ', props);
|
|
67
66
|
const context = (0, react_1.useContext)(form_1.FormContext);
|
|
68
67
|
return (react_1.default.createElement(material_1.Grid, { container: true, sx: { border: (0, lodash_get_1.default)(context.errors, props.name) ? '2px solid #a51c30' : '', padding: 1, borderRadius: 2 } },
|
|
69
68
|
react_1.default.createElement("input", Object.assign({ key: 1, type: 'text' }, context.formRegister(props.name, {
|
|
@@ -72,8 +71,17 @@ function RequiredCheckBoxGroup(_a) {
|
|
|
72
71
|
let canContinue = false;
|
|
73
72
|
names.forEach((x, i) => {
|
|
74
73
|
const nameValue = context.formGetValues(x);
|
|
75
|
-
if (nameValue)
|
|
74
|
+
if (nameValue) {
|
|
76
75
|
canContinue = true;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
console.log("Erro validação");
|
|
79
|
+
console.log("names", names);
|
|
80
|
+
console.log("x", x);
|
|
81
|
+
console.log('i', i);
|
|
82
|
+
console.log("nameValue", nameValue);
|
|
83
|
+
console.log('Erro validação');
|
|
84
|
+
}
|
|
77
85
|
console.log(`ENTROU NO forEach DO return - VALOR DE names: ${names} - VALOR ATUAL: ${x} - INDEX: ${i}`);
|
|
78
86
|
});
|
|
79
87
|
if (!canContinue)
|