@iimm/formily-mui
Version:
form field components based on @mui/material and @formily/react
32 lines (31 loc) • 1.71 kB
TypeScript
import type { ReactNode, ComponentType } from "react";
import type { ObjectField } from "@formily/core";
import { type StepIconProps, type ButtonProps, type BoxProps } from "@mui/material";
import { SubmitProps } from "../../Submit";
export interface StepFormProps extends Omit<BoxProps, "title"> {
name?: string;
title?: ReactNode;
subTitle?: ReactNode;
icon?: ComponentType<StepIconProps>;
/** [不要手动传递,但可以通过props获取到]当前激活的stepForm的index(从0开始) */
current?: number;
/** [不要手动传递,但可以通过props获取到]该StepForm的编号(从0开始) */
stepIndex?: number;
/** [不要手动传递,但可以通过props获取到]步骤总数 */
stepsCount?: number;
/** [不要手动传递,但可以通过props获取到]当前Step对应的ObjectField对象 */
field?: ObjectField;
handleStepChange?: (direction?: "next" | "previous" | number) => void;
onFinish?: ((values?: object, allValues?: object, stepObjField?: ObjectField) => void | boolean) | ((values?: object, allValues?: object, stepObjField?: ObjectField) => Promise<void | boolean>);
onSubmitFail?: (error?: Error) => void;
onPrevious?: (stepObjField: ObjectField) => void;
previousText?: ReactNode;
previousProps?: Omit<ButtonProps, "onClick">;
nextText?: [ReactNode, ReactNode];
nextProps?: Omit<SubmitProps, "onSubmit" | "onSubmitFailed">;
showReset?: boolean;
onReset?: () => void | (() => Promise<void>);
resetProps?: Omit<ButtonProps, "onClick">;
children?: ReactNode;
}
export declare const StepForm: import("react").MemoExoticComponent<import("@formily/react").ReactFC<Omit<StepFormProps, "ref">>>;