muffin-admin 3.7.2 → 3.7.3
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/package.json
CHANGED
|
@@ -116,20 +116,18 @@ export function CommonPayload({ active, onClose, onHandle, schema, title }) {
|
|
|
116
116
|
})
|
|
117
117
|
|
|
118
118
|
return (
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
</FormProvider>
|
|
133
|
-
</AdminModal>
|
|
119
|
+
<FormProvider {...form}>
|
|
120
|
+
<FormGroupsProvider>
|
|
121
|
+
<AdminModal
|
|
122
|
+
maxWidth="sm"
|
|
123
|
+
open={active}
|
|
124
|
+
onClose={onClose}
|
|
125
|
+
title={translate(title, { _: title })}
|
|
126
|
+
actions={<PayloadButtons onClose={onClose} onSubmit={formHandleSubmit} />}
|
|
127
|
+
>
|
|
128
|
+
{inputs}
|
|
129
|
+
</AdminModal>
|
|
130
|
+
</FormGroupsProvider>
|
|
131
|
+
</FormProvider>
|
|
134
132
|
)
|
|
135
133
|
}
|
|
@@ -2,16 +2,16 @@ import { Stack } from "@mui/material"
|
|
|
2
2
|
import { Button } from "react-admin"
|
|
3
3
|
import { useFormContext } from "react-hook-form"
|
|
4
4
|
|
|
5
|
-
export function PayloadButtons({ onClose }) {
|
|
5
|
+
export function PayloadButtons({ onClose, onSubmit }) {
|
|
6
6
|
const { formState } = useFormContext()
|
|
7
7
|
return (
|
|
8
8
|
<Stack direction="row" alignItems="center" justifyContent="flex-end" spacing={1}>
|
|
9
9
|
<Button
|
|
10
|
-
type="submit"
|
|
11
10
|
label="ra.action.confirm"
|
|
12
11
|
variant="contained"
|
|
13
12
|
disabled={!formState.isValid}
|
|
14
13
|
size="medium"
|
|
14
|
+
onClick={onSubmit}
|
|
15
15
|
/>
|
|
16
16
|
<Button label="ra.action.cancel" variant="outlined" size="medium" onClick={onClose} />
|
|
17
17
|
</Stack>
|