import React, { ReactElement } from 'react'; import { DropDownProps } from 'choerodon-ui/lib/dropdown'; import { ButtonProps } from 'choerodon-ui/pro/lib/button/Button'; import ChoseFieldStore from './store'; import { IChosenFieldField, IChosenFieldFieldEvents } from './types'; interface Props { store: ChoseFieldStore; wrapClassName?: string; wrapStyle?: React.CSSProperties; choseField?: (data: IChosenFieldField | IChosenFieldField[], status: 'add' | 'del') => void; dropDownProps?: Partial; dropDownBtnChildren?: ReactElement | ReactElement[] | string | null; dropDownBtnProps?: Partial; } /** *@param fields 加载的字段列表 *@param defaultValue 默认选中 *@param actions 数据初始化过程中额外操作 */ interface IChoseFieldConfig { fields?: IChosenFieldField[]; /** 是否启用远程加载 @default true */ server?: boolean; defaultValue?: IChosenFieldField[]; value?: Array; /** 可控value */ events?: IChosenFieldFieldEvents; addFieldCallback?: (key: string) => void; dropDownProps?: Partial; dropDownBtnChildren?: ReactElement | ReactElement[] | string | null; dropDownBtnProps?: Partial; } interface IChoseFieldDataProps { store: ChoseFieldStore; fields: IChosenFieldField[]; } export interface IChoseFieldComponentProps { store: ChoseFieldStore; choseField?: (data: IChosenFieldField | IChosenFieldField[], status: 'add' | 'del') => void; dropDownProps?: Partial; dropDownBtnChildren?: ReactElement | ReactElement[] | string | null; dropDownBtnProps?: Partial; } export declare function useChoseField(config?: IChoseFieldConfig): [IChoseFieldDataProps, IChoseFieldComponentProps]; declare const _default: React.FunctionComponent; export default _default;