;
+
+ onSubmit?: (e: BaseSyntheticEvent) => void;
}
/**
@@ -47,6 +49,8 @@ export interface DialogProps {
* @returns A promise that resolves when the dialog can be fully closed.
*/
onClose: (result: R) => Promise;
+
+ onSubmit: (e: BaseSyntheticEvent) => void;
}
export type DialogComponent = React.ComponentType>;
@@ -142,24 +146,28 @@ export interface DialogProviderProps {
}
// form dialog
-export interface FormDialogProps extends MuiDialogProps {
+export interface FormDialogProps
+ extends FormButtonsProps,
+ Omit {
title?: string;
children?: React.ReactNode;
- onSubmit: (e: BaseSyntheticEvent) => void;
}
// form
-export type ComponentFormProps = {
+export interface FormButtonsProps {
+ onSubmit: (e: BaseSyntheticEvent) => void;
+ onCancel?: () => void;
+ cancelButtonProps?: ButtonProps;
+ confirmButtonProps?: ButtonProps;
+}
+
+export type ComponentFormProps = FormButtonsProps & {
data: T | null;
onError?: () => void;
onSuccess?: () => void;
Wrapper?: React.FC;
- WrapperProps?: Partial;
+ WrapperProps?: Partial & Partial;
};
-export interface FormButtonsProps {
- onCancel?: () => void;
- onSubmit: (e: BaseSyntheticEvent) => void;
-}
-
-export type ComponentFormDialogProps = DialogProps;
+export type ComponentFormDialogProps = FormButtonsProps &
+ DialogProps;