import { DrawerProps, ButtonProps } from '@wakeadmin/element-adapter'; import { FatFormMethods, FatFormBaseProps, FatFormSlots, FatFormEvents } from '../fat-form'; import { OurComponentInstance } from '../utils'; export interface FatFormDrawerMethods extends Partial> { /** * 可以传递临时参数 * @param tempProps */ open(tempProps?: FatFormDrawerProps): void; /** * 关闭 */ close(): void; } export interface FatFormDrawerSlots extends Omit, 'renderSubmitter'> { /** * 渲染标题 */ renderTitle?: (instance: FatFormDrawerMethods) => any; /** * 渲染底部 */ renderFooter?: (instance: FatFormDrawerMethods) => any; /** * 自定义提交器渲染 */ renderSubmitter?: (instance: FatFormDrawerMethods) => any; } export interface FatFormDrawerEvents extends Omit, 'onFinish'> { /** * 可视状态变动 */ onVisibleChange?: (visible: boolean) => void; /** * 已取消 */ onCancel?: () => void; /** * 保存成功 */ onFinish?: (values: Store) => void; /** * 传入和 FatForm 兼容的组件, 默认为 FatForm */ Form?: any; form?: any; } export interface FatFormDrawerProps extends Omit, FatFormDrawerEvents, FatFormBaseProps, FatFormDrawerSlots { /** * 受控显示, 你也可以使用 open 实例方法 */ visible?: boolean; /** * 抽屉大小 */ drawerSize?: string | number; /** * 是否开启取消按钮, 默认开启 */ enableCancel?: boolean; /** * 取消按钮文本, 默认为取消 */ cancelText?: string; /** * 自定义取消 props */ cancelProps?: ButtonProps; /** * 点击取消前调用,默认行为是关闭弹窗。调用 done 可以执行默认行为 */ beforeCancel?: (done: () => void) => void; /** * 表单保存成功后调用,默认行为是关闭弹窗。调用 done 可以执行默认行为 */ beforeFinish?: (done: () => void) => void; } export declare const FatFormDrawerMethodKeys: string[]; /** * 实例引用 hook */ export declare function useFatFormDrawerRef(): import("@wakeadmin/demi").Ref | undefined>; export declare const FatFormDrawer: new (props: FatFormDrawerProps) => OurComponentInstance, FatFormDrawerSlots, FatFormDrawerEvents, FatFormDrawerMethods>; //# sourceMappingURL=fat-form-drawer.d.ts.map