@acvl/frontend-components 0.0.23 → 0.0.24
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.
- package/dist/cjs/index.js +8 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/v1/datagrids/custom_slots/index.d.ts +1 -0
- package/dist/cjs/types/src/components/v1/datagrids/index.d.ts +1 -0
- package/dist/cjs/types/src/components/v1/layout/pages/DetailPage/types.d.ts +1 -0
- package/dist/cjs/types/src/components/v1/layout/pages/index.d.ts +1 -0
- package/dist/esm/index.js +8 -19
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/v1/datagrids/custom_slots/index.d.ts +1 -0
- package/dist/esm/types/src/components/v1/datagrids/index.d.ts +1 -0
- package/dist/esm/types/src/components/v1/layout/pages/DetailPage/types.d.ts +1 -0
- package/dist/esm/types/src/components/v1/layout/pages/index.d.ts +1 -0
- package/dist/index.d.ts +13 -12
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -25788,20 +25788,12 @@ const formDataForm = ({ submitData, data, useLabel, props }) => {
|
|
|
25788
25788
|
return formData;
|
|
25789
25789
|
};
|
|
25790
25790
|
// ==============================|| ERRORS ||============================== //
|
|
25791
|
-
const
|
|
25792
|
-
if (
|
|
25793
|
-
Object.
|
|
25794
|
-
|
|
25791
|
+
const setErrors = (form, error) => {
|
|
25792
|
+
if ('invalid_params' in error.data) {
|
|
25793
|
+
Object.values(error.data.invalid_params).forEach((entry) => {
|
|
25794
|
+
form.setError(entry.name, { message: entry.reason.join(', ') });
|
|
25795
25795
|
});
|
|
25796
25796
|
}
|
|
25797
|
-
else {
|
|
25798
|
-
form.setError(key, { message: errorObj });
|
|
25799
|
-
}
|
|
25800
|
-
};
|
|
25801
|
-
const setErrors = (form, error) => {
|
|
25802
|
-
Object.keys(error.data).forEach(x => {
|
|
25803
|
-
errorLoop(form, error.data[x], x);
|
|
25804
|
-
});
|
|
25805
25797
|
};
|
|
25806
25798
|
|
|
25807
25799
|
const valueLabel = zod.object({
|
|
@@ -28329,15 +28321,12 @@ function DetailPage(props) {
|
|
|
28329
28321
|
else {
|
|
28330
28322
|
console.log(error);
|
|
28331
28323
|
setErrors(form, error);
|
|
28332
|
-
notifications.show((
|
|
28333
|
-
error.data.
|
|
28324
|
+
notifications.show((error.data.detail ?
|
|
28325
|
+
error.data.detail.join(', ') :
|
|
28334
28326
|
`Error ${props.pageType == 'edit' ? 'actualizando' : 'creando'} ${props.object.name}!`), { severity: 'error' });
|
|
28335
28327
|
}
|
|
28336
28328
|
});
|
|
28337
28329
|
};
|
|
28338
|
-
const onError = (errors) => {
|
|
28339
|
-
console.log(errors);
|
|
28340
|
-
};
|
|
28341
28330
|
// ==============================|| RENDER SECTIONS ||============================== //
|
|
28342
28331
|
const renderContent = () => {
|
|
28343
28332
|
let displayed_sections = -1;
|
|
@@ -28393,7 +28382,7 @@ function DetailPage(props) {
|
|
|
28393
28382
|
}
|
|
28394
28383
|
};
|
|
28395
28384
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ContentLayout, { button: renderButton(), badge: props.pageType == 'detail' && badgeInfo &&
|
|
28396
|
-
jsxRuntime.jsx(StatusBadge, { title: badgeInfo['label'], severity: badgeInfo['value'] }), children: jsxRuntime.jsx(LoadingComponent, { height: 0.7, isLoading: isLoading || isFetching, children: jsxRuntime.jsx(reactHookForm.FormProvider, { ...form, children: jsxRuntime.jsx(material.Box, { id: 'formulario', component: 'form', autoComplete: "off", noValidate: true, onSubmit: form.handleSubmit(onSubmitHandler
|
|
28385
|
+
jsxRuntime.jsx(StatusBadge, { title: badgeInfo['label'], severity: badgeInfo['value'] }), children: jsxRuntime.jsx(LoadingComponent, { height: 0.7, isLoading: isLoading || isFetching, children: jsxRuntime.jsx(reactHookForm.FormProvider, { ...form, children: jsxRuntime.jsx(material.Box, { id: 'formulario', component: 'form', autoComplete: "off", noValidate: true, onSubmit: form.handleSubmit(onSubmitHandler), width: '100%', position: 'relative', children: renderContent() }) }) }) }), renderPostAction()] }));
|
|
28397
28386
|
}
|
|
28398
28387
|
|
|
28399
28388
|
const ListPage = (props) => {
|
|
@@ -28712,6 +28701,7 @@ exports.DeleteButton = DeleteButton;
|
|
|
28712
28701
|
exports.DeleteConfirmationDialog = DeleteConfirmationDialog;
|
|
28713
28702
|
exports.DetailPage = DetailPage;
|
|
28714
28703
|
exports.EditButton = EditButton;
|
|
28704
|
+
exports.ExportButton = ExportButton;
|
|
28715
28705
|
exports.HistorialDrawer = HistorialDrawer;
|
|
28716
28706
|
exports.ListPage = ListPage;
|
|
28717
28707
|
exports.Loadable = Loadable;
|