import { IDataMutator } from '@shesha/reactjs/dist/components/crudViews/models'; import { FormIdentifier, FormMarkup, IFormActions, IFormSections } from '@shesha/reactjs'; import { FormInstance } from 'antd/lib/form'; import { FC, ReactNode } from 'react'; export declare enum OnSuccessActionType { Return = "RETURN", AddMore = "ADD_MORE", GoToDetails = "GO_TO_DETAILS", GoToUrl = "GO_TO_URL", Close = "CLOSE" } export type DataUpdater = (props: any) => IDataMutator; export interface IGenericCreateModalProps { /** * Modal title */ title: string; /** * Whether the modal is visible */ visible?: boolean; /** * Path to the form to display on the modal */ formId: FormIdentifier; /** * A callback to update the entity */ updater: DataUpdater; /** * A callback to cancel the modal */ onCancel?: (form: FormInstance) => void; /** * A callback to for when the updating of an entity is successful */ onError?: (form: FormInstance, error: any) => void; /** * A callback to for when the updating of an entity is successful */ onSuccess?: (form: FormInstance, keepOpen?: boolean) => void; /** * A function to prepare modal values */ prepareValues?: (values: any) => any; /** * An enum that determines what happens after a user saves a form */ OnSuccessAction?: OnSuccessActionType; /** * Allows changing of the label of the Save/Submit in the modal */ submitButtonLabel?: string | ReactNode; /** * Allows changing of the label of the Cancel in the modal */ cancelButtonLabel?: string | ReactNode; /** * The URL to navigate to after successfully submitting the form and the OnSuccessAction is set to "GoToUrl" */ onSuccessUrl?: string | ((data: any) => string); beforeSubmit?: (form: any) => boolean; actions?: IFormActions; sections?: IFormSections; destroyOnClose?: boolean; formMarkup?: FormMarkup; returnUrlOnSuccess?: string | ((data: any) => string); initialValues?: object; forceLoading?: boolean; } declare const GenericCreateModalExtended: FC; export default GenericCreateModalExtended;