MCPcopy
hub / github.com/refinedev/refine / useStepsForm

Function useStepsForm

packages/antd/src/hooks/form/useStepsForm/useStepsForm.ts:85–145  ·  view source on GitHub ↗
(
  props: UseStepsFormProps<
    TQueryFnData,
    TError,
    TVariables,
    TData,
    TResponse,
    TResponseError
  > = {},
)

Source from the content-addressed store, hash-verified

83 *
84 */
85export const useStepsForm = <
86 TQueryFnData extends BaseRecord = BaseRecord,
87 TError extends HttpError = HttpError,
88 TVariables = {},
89 TData extends BaseRecord = TQueryFnData,
90 TResponse extends BaseRecord = TData,
91 TResponseError extends HttpError = TError,
92>(
93 props: UseStepsFormProps<
94 TQueryFnData,
95 TError,
96 TVariables,
97 TData,
98 TResponse,
99 TResponseError
100 > = {},
101): UseStepsFormReturnType<
102 TQueryFnData,
103 TError,
104 TVariables,
105 TData,
106 TResponse,
107 TResponseError
108> => {
109 const useFormProps = useForm<
110 TQueryFnData,
111 TError,
112 TVariables,
113 TData,
114 TResponse,
115 TResponseError
116 >({
117 ...props,
118 });
119 const { form, formProps } = useFormProps;
120
121 const stepsPropsSunflower = useStepsFormSF<TResponse, TVariables>({
122 isBackValidate: false,
123 form: form,
124 submit: (values: any) => {
125 formProps?.onFinish?.(values);
126 },
127 ...props,
128 });
129
130 return {
131 ...useFormProps,
132 ...stepsPropsSunflower,
133 formLoading: useFormProps.formLoading,
134 formProps: {
135 ...stepsPropsSunflower.formProps,
136 ...useFormProps.formProps,
137 onValuesChange: formProps?.onValuesChange,
138 onKeyUp: formProps?.onKeyUp,
139 },
140 saveButtonProps: {
141 ...useFormProps.saveButtonProps,
142 onClick: () => stepsPropsSunflower.submit(),

Callers 4

PostCreateFunction · 0.90
PostEditFunction · 0.90
CourierCreateFunction · 0.90
PageFunction · 0.70

Calls 1

useFormFunction · 0.90

Tested by 1

PageFunction · 0.56