@ssplib/react-components 0.0.196 → 0.0.197
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.
|
@@ -87,7 +87,7 @@ function Stepper(_a) {
|
|
|
87
87
|
// console.log('valores conferidos', getKeys(context.formGetValues(), activeStep), context.formGetValues(getKeys(context.formGetValues(), activeStep)))
|
|
88
88
|
const result = yield context.formTrigger(getKeys(context.formGetValues(), activeStep));
|
|
89
89
|
if (!result) {
|
|
90
|
-
(0, react_toastify_1.toast)('Formulário incompleto!', { type: 'warning', theme: 'light' });
|
|
90
|
+
(0, react_toastify_1.toast)('Formulário incompleto! Verifique os campos marcados e tente novamente.', { type: 'warning', theme: 'light' });
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
setActiveStep((prevActiveStep) => prevActiveStep + 1);
|
|
@@ -96,7 +96,7 @@ function Stepper(_a) {
|
|
|
96
96
|
const result = yield context.formTrigger(getKeys(context.formGetValues(), activeStep));
|
|
97
97
|
if (!result) {
|
|
98
98
|
e.preventDefault();
|
|
99
|
-
(0, react_toastify_1.toast)('Formulário incompleto!', { type: 'warning', theme: 'light' });
|
|
99
|
+
(0, react_toastify_1.toast)('Formulário incompleto! Verifique os campos marcados e tente novamente.', { type: 'warning', theme: 'light' });
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
});
|
|
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
const react_1 = __importStar(require("react"));
|
|
27
27
|
const react_hook_form_1 = require("react-hook-form");
|
|
28
28
|
const form_1 = require("../../context/form");
|
|
29
|
+
const react_toastify_1 = require("react-toastify");
|
|
29
30
|
function FormProvider({ children, onSubmit, formMethod = 'GET', submiting = false, }) {
|
|
30
31
|
const { register, handleSubmit, control, formState: { errors }, reset, watch, trigger, setValue, unregister, getValues, } = (0, react_hook_form_1.useForm)();
|
|
31
32
|
const [filesUid, setFilesUid] = (0, react_1.useState)([]);
|
|
@@ -43,6 +44,6 @@ function FormProvider({ children, onSubmit, formMethod = 'GET', submiting = fals
|
|
|
43
44
|
errors: errors,
|
|
44
45
|
submiting: submiting,
|
|
45
46
|
} },
|
|
46
|
-
react_1.default.createElement("form", { method: formMethod, onSubmit: handleSubmit((d) => onSubmit(d, filesUid)) }, children)));
|
|
47
|
+
react_1.default.createElement("form", { method: formMethod, onSubmit: handleSubmit((d) => onSubmit(d, filesUid), (d) => (0, react_toastify_1.toast)('Formulário incompleto! Verifique os campos marcados e tente novamente.', { type: 'warning', position: 'top-right', theme: 'colored' })) }, children)));
|
|
47
48
|
}
|
|
48
49
|
exports.default = FormProvider;
|