| 
									
										
										
										
											2025-10-22 14:43:42 +08:00
										 |  |  | import type { FormInstance, FormProps } from "antd/es/form"; | 
					
						
							|  |  |  | import type { Gutter } from "antd/es/grid/row"; | 
					
						
							| 
									
										
										
										
											2025-10-23 18:01:20 +08:00
										 |  |  | import type { FC, ReactNode } from "react"; | 
					
						
							| 
									
										
										
										
											2025-10-22 14:43:42 +08:00
										 |  |  | import type { FormOption, FormValues } from "./FormItemsRenderer"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * FormBuilder 组件属性 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export interface FormBuilderProps extends Omit<FormProps, "form"> { | 
					
						
							|  |  |  |   /** 表单初始值 */ | 
					
						
							|  |  |  |   values?: FormValues; | 
					
						
							|  |  |  |   /** 表单配置项数组 */ | 
					
						
							|  |  |  |   options: FormOption[]; | 
					
						
							|  |  |  |   /** 栅格间距,默认 24 */ | 
					
						
							|  |  |  |   gutter?: Gutter | [Gutter, Gutter]; | 
					
						
							|  |  |  |   /** 占据栅格列数,默认 12 */ | 
					
						
							|  |  |  |   span?: number | string; | 
					
						
							|  |  |  |   /** 表单实例(通过 Form.useForm() 创建) */ | 
					
						
							| 
									
										
										
										
											2025-10-23 18:01:20 +08:00
										 |  |  |   form?: FormInstance; | 
					
						
							| 
									
										
										
										
											2025-10-22 14:43:42 +08:00
										 |  |  |   /** 自动生成必填规则,默认 true */ | 
					
						
							|  |  |  |   useAutoGenerateRequired?: boolean; | 
					
						
							|  |  |  |   /** 表单提交回调 */ | 
					
						
							| 
									
										
										
										
											2025-10-23 18:01:20 +08:00
										 |  |  |   onFinish?: (values: FormValues) => void; | 
					
						
							|  |  |  |   /** 是否显示操作按钮区域,默认 true */ | 
					
						
							|  |  |  |   showActionButtons?: boolean; | 
					
						
							|  |  |  |   /** 提交按钮文字,默认为"提交" */ | 
					
						
							|  |  |  |   submitButtonText?: string; | 
					
						
							|  |  |  |   /** 重置按钮文字,默认为"重置" */ | 
					
						
							|  |  |  |   resetButtonText?: string; | 
					
						
							|  |  |  |   /** 是否显示提交按钮,默认 true */ | 
					
						
							|  |  |  |   showSubmitButton?: boolean; | 
					
						
							|  |  |  |   /** 是否显示重置按钮,默认 true */ | 
					
						
							|  |  |  |   showResetButton?: boolean; | 
					
						
							|  |  |  |   /** 自定义操作按钮组 */ | 
					
						
							|  |  |  |   customActionButtons?: ReactNode; | 
					
						
							| 
									
										
										
										
											2025-10-22 14:43:42 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * 表单构建器组件 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | declare const FormBuilder: FC<FormBuilderProps>; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default FormBuilder; |