@ssplib/react-components 0.0.162 → 0.0.164

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.
@@ -9,7 +9,10 @@ const form_1 = require("../../../context/form");
9
9
  const react_2 = __importDefault(require("react"));
10
10
  function CheckBox({ name, title, defaultValue = false, xs = 12, sm, md, onChange, }) {
11
11
  const context = (0, react_1.useContext)(form_1.FormContext);
12
+ const onClick = (0, react_1.useCallback)((e) => {
13
+ context === null || context === void 0 ? void 0 : context.formSetValue(name, !(context === null || context === void 0 ? void 0 : context.formGetValues(name)));
14
+ }, [context, name]);
12
15
  return (react_2.default.createElement(material_1.Grid, Object.assign({ item: true }, { xs, sm, md }),
13
- react_2.default.createElement(material_1.FormControlLabel, Object.assign({ control: react_2.default.createElement(material_1.Checkbox, { size: 'small', defaultChecked: defaultValue }), label: title }, context === null || context === void 0 ? void 0 : context.formRegister(name), { onChange: onChange }))));
16
+ react_2.default.createElement(material_1.FormControlLabel, Object.assign({ control: react_2.default.createElement(material_1.Checkbox, { size: 'small', defaultChecked: defaultValue }), label: title }, context === null || context === void 0 ? void 0 : context.formRegister(name), { onChange: onChange, onClick: onClick }))));
14
17
  }
15
18
  exports.default = CheckBox;
@@ -74,14 +74,13 @@ function RequiredCheckBoxGroup(_a) {
74
74
  if (nameValue) {
75
75
  canContinue = true;
76
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
+ console.log("todos os value", context.formGetValues());
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');
85
84
  console.log(`ENTROU NO forEach DO return - VALOR DE names: ${names} - VALOR ATUAL: ${x} - INDEX: ${i}`);
86
85
  });
87
86
  if (!canContinue)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.162",
3
+ "version": "0.0.164",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",