/// <reference types="lodash" />
import React, { CSSProperties, ReactNode } from 'react';
import { IReactionDisposer } from 'mobx';
import Menu from '../../../lib/rc-components/menu';
import { Tooltip as OptionTooltip } from '../core/enum';
import TriggerField, { TriggerFieldPopupContentProps, TriggerFieldProps } from '../trigger-field/TriggerField';
import { ValidationMessages } from '../validator/Validator';
import Option, { OptionProps } from '../option/Option';
import OptGroup from '../option/OptGroup';
import DataSet from '../data-set/DataSet';
import Record from '../data-set/Record';
import { Renderer } from '../field/FormField';
import Field from '../data-set/Field';
import { ButtonProps } from '../button/Button';
import { TextFieldProps } from '../text-field/TextField';
import { ValueChangeAction } from '../text-field/enum';
import { Action } from '../trigger/enum';
export declare function isSearchTextEmpty(text: string | string[] | undefined): text is undefined;
export declare const DISABLED_FIELD = "__disabled";
export declare const MORE_KEY = "__more__";
declare function defaultOnOption({ record }: {
    record: any;
}): {
    disabled: any;
};
export declare function getItemKey(record: Record, text: ReactNode, value: any): string;
export declare type onOptionProps = {
    dataSet: DataSet;
    record: Record;
};
export declare type SearchMatcher = string | ((props: SearchMatcherProps) => boolean);
export interface SearchMatcherProps {
    record: Record;
    text: string | string[];
    value: any;
    props: any;
    textField: string;
    valueField: string;
}
export declare type ParamMatcher = string | ((props: ParamMatcherProps) => string | object);
export interface ParamMatcherProps {
    record: Record | undefined;
    key: string;
    text: string | string[] | undefined;
    textField: string;
    valueField: string;
}
export interface SelectPopupContentProps extends TriggerFieldPopupContentProps {
    dataSet: DataSet;
    textField: string;
    valueField: string;
    field?: Field | undefined;
    record?: Record | undefined;
    content: ReactNode;
}
export interface SelectProps extends TriggerFieldProps<SelectPopupContentProps> {
    /**
     * 复合输入值
     * @default false
     */
    combo?: boolean;
    /**
     * 常用项
     */
    commonItem?: string[];
    /**
     * 常用项标签超出最大数量时的占位描述
     */
    maxCommonTagPlaceholder?: ReactNode | ((omittedValues: any[]) => ReactNode);
    /**
     * 常用项标签最大数量
     */
    maxCommonTagCount?: number;
    /**
     * 常用项标签文案最大长度
     */
    maxCommonTagTextLength?: number;
    /**
     * 可搜索
     * @default false
     */
    searchable?: boolean;
    /**
     * 开启搜索时，是否保留查询参数
     * @default true
     */
    reserveParam?: boolean;
    /**
     * 搜索框在 Popup 中显示
     * @default false
     */
    searchFieldInPopup?: boolean;
    /**
     * 搜索框的属性
     */
    searchFieldProps?: TextFieldProps;
    /**
     * 搜索匹配器。 当为字符串时，作为lookup的参数名来重新请求值列表。
     */
    searchMatcher?: SearchMatcher;
    /**
     * 参数匹配器。 当为字符串时，参数拼接。
     */
    paramMatcher?: ParamMatcher;
    /**
     * 选项过滤
     * @param {Record} record
     * @return {boolean}
     */
    optionsFilter?: (record: Record, index: number, records: Record[]) => boolean;
    /**
     * 当选项改变时，检查并清除不在选项中的值
     * @default true
     */
    checkValueOnOptionsChange?: boolean;
    /**
     * 下拉框匹配输入框宽度
     * @default true
     */
    dropdownMatchSelectWidth?: boolean;
    /**
     * 多选时显示全选按钮;
     * @default true
     */
    selectAllButton?: boolean | ((buttons: ButtonProps[]) => ButtonProps[]);
    /**
     * 多选是否开启反选
     * @default false
     */
    reverse?: boolean;
    /**
     * 下拉框菜单样式名
     */
    dropdownMenuStyle?: CSSProperties;
    /**
     * 选项数据源
     */
    options?: DataSet;
    /**
     * 是否为原始值
     * true - 选项中valueField对应的值
     * false - 选项值对象
     */
    primitiveValue?: boolean;
    /**
     * 渲染Option文本的钩子
     * @example
     * ```js
     * <Select
     *   {...props}
     *   optionRenderer={({ record, text, value }) => text + '$'}
     * />
     * ```
     */
    optionRenderer?: Renderer;
    /**
     * 渲染分页 Item 内容
     */
    pagingOptionContent?: string | ReactNode;
    /**
     * 当下拉列表为空时显示的内容
     */
    notFoundContent?: ReactNode;
    /**
     * 设置选项属性，如 disabled;
     */
    onOption: (props: onOptionProps) => OptionProps;
    /**
     * 下拉时自动重新查询
     */
    noCache?: boolean;
    /**
     * 用tooltip显示选项内容
     * 可选值：`none` `always` `overflow`
     */
    optionTooltip?: OptionTooltip;
    /**
     * 是否默认高亮第一个选项
     * @default true
     */
    defaultActiveFirstOption?: boolean;
    children?: ReactNode;
}
export declare class Select<T extends SelectProps = SelectProps> extends TriggerField<T> {
    static displayName: string;
    static defaultProps: {
        suffixCls: string;
        combo: boolean;
        checkValueOnOptionsChange: boolean;
        onOption: typeof defaultOnOption;
        selectAllButton: boolean;
        clearButton: boolean;
        popupPlacement: string;
        triggerShowDelay: number;
        triggerHiddenDelay: number;
        viewMode: import("../trigger-field/enum").TriggerViewMode;
        multiple: boolean;
        border: boolean;
        valueChangeAction: ValueChangeAction;
        waitType: import("../core/enum").WaitType;
        readOnly: boolean;
        disabled: boolean;
        noValidate: boolean;
        trim: import("../data-set/enum").FieldTrim;
    };
    static Option: typeof Option;
    static OptGroup: typeof OptGroup;
    static __PRO_SELECT: boolean;
    comboOptions?: DataSet;
    menu?: Menu | null;
    $searchText?: string | string[] | undefined;
    get range(): boolean | [string, string];
    get searchText(): string | string[] | undefined;
    set searchText(searchText: string | string[] | undefined);
    get searchMatcher(): SearchMatcher;
    get paramMatcher(): ParamMatcher;
    get defaultValidationMessages(): ValidationMessages;
    get textField(): string;
    get valueField(): string;
    get currentComboOption(): Record | undefined;
    get filteredOptions(): Record[];
    get optionsWithCombo(): Record[];
    get cascadeOptions(): Record[];
    get searchable(): boolean;
    get reserveParam(): boolean;
    get multiple(): boolean;
    get menuMultiple(): boolean;
    get options(): DataSet;
    get primitive(): boolean;
    checkValueReaction?: IReactionDisposer;
    checkComboReaction?: IReactionDisposer;
    saveMenu(node: any): void;
    getSearchFieldProps(): TextFieldProps;
    isSearchFieldInPopup(): boolean | undefined;
    isEmpty(): boolean;
    isEditable(): boolean;
    checkValue(): void;
    checkCombo(): void;
    clearCheckValue(): void;
    clearCheckCombo(): void;
    clearReaction(): void;
    componentWillMount(): void;
    componentWillUnmount(): void;
    componentWillReceiveProps(nextProps: any, nextContext: any): void;
    componentDidUpdate(): void;
    getOmitPropsKeys(): string[];
    getObservableProps(props: any, context: any): any;
    getMenuPrefixCls(): string;
    renderMultipleHolder(): JSX.Element | undefined;
    getNotFoundContent(): T["notFoundContent"];
    getPagingOptionContent(): T["pagingOptionContent"];
    getOtherNextNode(): ReactNode;
    getMenuItem({ record, text, value }: {
        record: any;
        text: any;
        value: any;
    }): string | ReactNode;
    getMenu(menuProps?: object): ReactNode;
    /**
     * 增加lov popupContent 回调参数 用于控制对应交互
     */
    getPopupProps(): SelectPopupContentProps;
    getPopupClassName(defaultClassName: string | undefined): string | undefined;
    get dropdownMatchSelectWidth(): boolean | undefined;
    get defaultActiveFirstOption(): boolean | undefined;
    get selectReverse(): boolean | undefined;
    get loading(): boolean;
    handlePopupSearch(value: any): void;
    renderSearchFieldPrefix(_props: any): ReactNode;
    renderSearchField(props?: any): ReactNode;
    renderSelectAll(): ReactNode | void;
    getPopupContent(): ReactNode;
    getPopupStyleFromAlign(target: any): CSSProperties | undefined;
    getDefaultAction(): Action[];
    getTriggerIconFont(): string;
    handleKeyDown(e: any): void;
    isMultipleBlockDisabled(v: any): any;
    handleKeyDownFirstLast(e: any, menu: Menu, direction: number): void;
    handleKeyDownPrevNext(e: any, menu: Menu, direction: number): void;
    handleKeyDownEsc(e: any): void;
    handleKeyDownSpace(e: any): void;
    handleBlur(e: any): void;
    expand(): void;
    syncValueOnBlur(text: any): void;
    findByTextWithValue(text: any, data: Record[]): Record | undefined;
    findByText(text: any): Record | undefined;
    findByValue(value: any): Record | undefined;
    isSelected(record: Record): boolean;
    generateComboOption(value: string | object | any[], callback?: (text: string) => void): void;
    createComboOption(value: any): void;
    removeComboOptions(): void;
    removeComboOption(record?: Record): void;
    handlePopupAnimateAppear(): void;
    getValueKey(v: any): any;
    handlePopupAnimateEnd(_key: any, _exists: any): void;
    handleMenuClick({ key, item: { props: { value }, }, }: {
        key: any;
        item: {
            props: {
                value: any;
            };
        };
    }): void;
    handleCommonItemClick(value: any): void;
    handleOptionSelect(record: Record | Record[]): void;
    handleOptionUnSelect(record: Record | Record[]): void;
    multipleSearch(text: string): void;
    handleSearch(_text?: string | string[] | undefined): void;
    setValue(value: any, noVaidate?: boolean): void;
    setText(text?: string): void;
    doSearch: import("lodash").DebouncedFunc<(value?: string | string[] | undefined) => void>;
    getSearchPara(searchMatcher: string, value?: string | string[] | undefined): object;
    searchRemote(text?: string | string[] | undefined): void;
    /**
     * 该方法会被onChange和onCompositionend触发
     * @param e 改变事件
     */
    handleChange(e: any): void;
    processRecordToObject(record: Record): any;
    processObjectValue(value: any, textField: any): any;
    processLookupValue(value: any): React.ReactNode;
    processValue(value: any): ReactNode;
    clear(): void;
    setRangeTarget(target: any): void;
    resetFilter(): void;
    reset(): void;
    unChoose(record?: Record | Record[] | null): void;
    choose(record?: Record | Record[] | null): void;
    optionIsSelected(record: Record, values: any[]): boolean;
    chooseAll(): void;
    /**
     * 反选
     */
    chooseRe(): void;
    unChooseAll(): void;
    handlePopupHiddenChange(hidden: boolean): void;
    processSelectedData(): Promise<void>;
    searchData(data: Record[]): Record[];
    matchRecordBySearch(record: Record, text: string | string[]): boolean;
    renderLengthInfo(_maxLength?: number): ReactNode;
}
export default class ObserverSelect extends Select<SelectProps> {
    static defaultProps: {
        suffixCls: string;
        combo: boolean;
        checkValueOnOptionsChange: boolean;
        onOption: typeof defaultOnOption;
        selectAllButton: boolean;
        clearButton: boolean;
        popupPlacement: string;
        triggerShowDelay: number;
        triggerHiddenDelay: number;
        viewMode: import("../trigger-field/enum").TriggerViewMode;
        multiple: boolean;
        border: boolean;
        valueChangeAction: ValueChangeAction;
        waitType: import("../core/enum").WaitType;
        readOnly: boolean;
        disabled: boolean;
        noValidate: boolean;
        trim: import("../data-set/enum").FieldTrim;
    };
    static Option: typeof Option;
    static OptGroup: typeof OptGroup;
    static __PRO_SELECT: boolean;
}
export {};
