import { ReactNode } from 'react';
import { LovConfig as DataSetLovConfig, LovConfigItem } from 'choerodon-ui/dataset/interface';
import { LovViewProps } from './LovView';
import { ModalProps } from '../modal/Modal';
import DataSet from '../data-set/DataSet';
import Record from '../data-set/Record';
import { SearchMatcher, Select, SelectProps } from '../select/Select';
import { TableQueryBarType } from '../table/enum';
import { CheckedStrategy } from '../data-set/enum';
import { PopupSearchMode, SearchAction, ViewMode } from './enum';
import { ButtonProps } from '../button/Button';
import { TableProps, TableQueryBarHook, TableQueryBarHookProps } from '../table/Table';
import { TextFieldProps } from '../text-field/TextField';
import { ModalChildrenProps, ModalProxy } from '../modal/interface';
import { TriggerViewMode } from '../trigger-field/TriggerField';
export declare type Events = {
    [key: string]: Function;
};
export declare type ViewRenderer = ({ dataSet, lovConfig, textField, valueField, multiple, modal, }: {
    dataSet: DataSet;
    lovConfig: LovConfig | undefined;
    textField: string | undefined;
    valueField: string | undefined;
    multiple: boolean;
    modal?: ModalChildrenProps;
}) => ReactNode;
export declare type NodeRenderer = (record: Record) => ReactNode;
export { LovConfigItem };
export interface SelectionProps {
    nodeRenderer?: NodeRenderer;
    placeholder?: string | ReactNode;
}
export interface LovConfig extends DataSetLovConfig {
    queryBar?: TableQueryBarType | TableQueryBarHook;
    tableProps?: Partial<TableProps>;
}
export interface LovProps extends SelectProps, ButtonProps {
    modalProps?: ModalProps;
    tableProps?: Partial<TableProps> | ((lovTablePropsConfig: Partial<TableProps>, modal?: ModalProxy) => Partial<TableProps>);
    noCache?: boolean;
    mode?: ViewMode;
    viewMode?: TriggerViewMode;
    /**
     * @deprecated
     */
    lovEvents?: Events;
    /**
     * 触发查询变更的动作， default: input
     */
    searchAction?: SearchAction;
    /**
     * 触发查询获取记录有重复时弹出选择窗口
     * SearchAction blur 生效
     * default: false
     */
    fetchSingle?: boolean;
    /**
     * 点击查询仅存在一条数据时自动选中
     */
    autoSelectSingle?: boolean;
    showCheckedStrategy?: CheckedStrategy;
    onBeforeSelect?: (records: Record | Record[]) => boolean | Promise<boolean | undefined> | undefined;
    onSearchMatcherChange?: (searchMatcher?: string) => void;
    viewRenderer?: ViewRenderer;
    nodeRenderer?: NodeRenderer;
    showSelectedInView?: boolean;
    selectionProps?: SelectionProps;
    popupSearchMode?: PopupSearchMode;
}
export default class Lov extends Select<LovProps> {
    static displayName: string;
    static defaultProps: {
        clearButton: boolean;
        checkValueOnOptionsChange: boolean;
        dropdownMatchSelectWidth: boolean;
        searchAction: SearchAction;
        fetchSingle: boolean;
        viewMode: TriggerViewMode;
        popupSearchMode: PopupSearchMode;
        suffixCls: string;
        combo: boolean;
        onOption: ({ record }: {
            record: any;
        }) => {
            disabled: any;
        };
        selectAllButton: boolean;
        popupPlacement: string;
        triggerShowDelay: number;
        triggerHiddenDelay: number;
        multiple: boolean;
        border: boolean;
        valueChangeAction: import("../text-field/enum").ValueChangeAction;
        waitType: import("../core/enum").WaitType;
        readOnly: boolean;
        disabled: boolean;
        noValidate: boolean;
        trim: import("../data-set/enum").FieldTrim;
    };
    modal: ModalProxy | undefined;
    initedModalLovViewProps: any;
    fetched?: boolean;
    searching?: boolean;
    get searchMatcher(): SearchMatcher;
    get searchable(): boolean;
    get lovCode(): string | undefined;
    get popup(): boolean;
    /**
     * 点击查询仅存在一条数据时自动选中, Button 模式禁用
     */
    get autoSelectSingle(): boolean | undefined;
    get options(): DataSet;
    get showSelectedInView(): boolean;
    getSearchFieldProps(): TextFieldProps;
    isSearchFieldInPopup(): boolean | undefined;
    popupEditable(): boolean;
    isEditable(): boolean;
    handleSearchMatcherChange(searchMatcher: any): void;
    renderSearchFieldPrefix(props?: TableQueryBarHookProps): ReactNode;
    getPopupLovView(): JSX.Element | undefined;
    getPopupContent(): ReactNode;
    syncOptionsSelectedAfterValueRemove(values: any[]): void;
    removeValues(values: any[], index?: number): void;
    removeLastValue(): any;
    clear(): void;
    beforeOpen(options: DataSet): Partial<LovViewProps> | undefined;
    afterOpen(options: DataSet, fetchSingle?: boolean): void;
    private getSelectionProps;
    private openModal;
    getModalClassName(): string;
    setText(text?: string): void;
    /**
     * 处理 Lov input 查询参数
     * @param text
     */
    searchRemote(text?: string | string[] | undefined): void;
    handlePopupHiddenChange(hidden: boolean): void;
    handleLovViewClose(): void;
    /**
     * 关闭弹窗移除时间监听 后续废弃
     */
    handleLovViewAfterClose(): void;
    handleLovViewSelect(records: Record | Record[]): void;
    processRecordToObject(record: Record): any;
    resetOptions(noCache?: boolean): boolean;
    handleKeyDown(e: any): void;
    handleBlur(e: any): void;
    getWrapperProps(): any;
    getPopupClassName(defaultClassName: string | undefined): string | undefined;
    syncValueOnBlur(value: any): void;
    getConfig(): DataSetLovConfig | undefined;
    getPlaceholders(): string[];
    getModalProps(): ModalProps;
    getTableProps(localTableProps?: Partial<TableProps>): Partial<TableProps>;
    selectSingle(): Promise<void>;
    handleOpenModal(): void | Promise<void>;
    getOmitPropsKeys(): string[];
    getButtonProps(): ButtonProps;
    get loading(): boolean;
    saveSuffixRef(node: any): void;
    getSuffix(): ReactNode;
    componentWillUnmount(): void;
    select(): void;
    handleButtonClick(e: any): void | Promise<void>;
    getTextByValue(value: any): ReactNode;
    renderWrapper(): ReactNode;
}
