@ssplib/react-components 0.0.195 → 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
|
});
|
|
@@ -104,11 +104,11 @@ function NavBar(_a) {
|
|
|
104
104
|
xs: 'flex',
|
|
105
105
|
md: 'none',
|
|
106
106
|
},
|
|
107
|
-
} },
|
|
107
|
+
} }, links.length > 0 && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
108
108
|
react_1.default.createElement(material_1.IconButton, { onClick: onMenuClick },
|
|
109
109
|
react_1.default.createElement(Menu_1.default, null)),
|
|
110
110
|
react_1.default.createElement(material_1.Menu, { open: menuOpen, onClose: closeMenu, anchorEl: anchor }, links.map((x) => (react_1.default.createElement(material_1.MenuItem, { key: `navmenu${x}`, onClick: (e) => onMenuItemClick(e, x.path) },
|
|
111
|
-
react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize' }, x.name)))))),
|
|
111
|
+
react_1.default.createElement(material_1.Typography, { textTransform: 'capitalize' }, x.name)))))))),
|
|
112
112
|
react_1.default.createElement(material_1.Stack, { direction: 'row', justifyContent: 'flex-end', alignItems: 'center', sx: { width: { md: '100%' } } },
|
|
113
113
|
react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 2, sx: { display: { xs: 'none', md: 'flex' } } }, links.map((x) => (react_1.default.createElement(material_1.Box, { key: `navigation${x.path}`, sx: {
|
|
114
114
|
a: {
|
|
@@ -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;
|