zy-react-library/components/Search/index.d.ts

42 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import type { FormInstance, FormProps } from "antd/es/form";
import type { FC, ReactNode } from "react";
import type { FormOption } from "../FormBuilder/FormItemsRenderer";
type FormValues = Record<string, any>;
/**
* Search 组件属性
*/
export interface SearchProps extends Omit<FormProps, "form" | "onFinish"> {
/** 表单配置项数组 */
options: FormOption[];
/** 表单值 */
values?: FormValues;
/** 搜索和重置都会触发的回调 */
onFinish?: (values: FormValues, type: "submit" | "reset") => void;
/** 搜索回调 */
onSubmit?: (values: FormValues) => void;
/** 重置回调 */
onReset?: (values: FormValues) => void;
/** 搜索按钮文本,默认"搜索" */
searchText?: string;
/** 重置按钮文本,默认"重置" */
resetText?: string;
/** 是否显示搜索按钮,默认 true */
showSearchButton?: boolean;
/** 是否显示重置按钮,默认 true */
showResetButton?: boolean;
/** 额外的底部按钮组 */
extraButtons?: ReactNode;
/** 表单实例(通过 Form.useForm() 创建) */
form: FormInstance;
}
/**
* 搜索表单组件
* 支持自动展开/收起功能当表单项超过4个时显示展开/收起按钮
*/
declare const Search: FC<SearchProps>;
export default Search;