/// <reference types="lodash" />
import { CSSProperties, ReactElement, ReactNode } from 'react';
import { IReactionDisposer } from 'mobx';
import { FieldNamesType, MenuMode } from '../../../es/cascader';
import TriggerField, { TriggerFieldPopupContentProps, TriggerFieldProps } from '../trigger-field/TriggerField';
import { ValidationMessages } from '../validator/Validator';
import DataSet from '../data-set/DataSet';
import Record from '../data-set/Record';
import Field from '../data-set/Field';
import { OptionProps } from '../option/Option';
import { ExpandTrigger } from './enum';
import { Action } from '../trigger/enum';
export declare const MORE_KEY = "__more__";
export interface OptionObject {
    value: any;
    meaning: string;
}
export interface ProcessOption extends OptionObject {
    parent: any;
    children?: any;
    disabled?: boolean;
}
export interface CascaderOptionType {
    value: string;
    label: ReactNode;
    disabled?: boolean;
    children?: Array<CascaderOptionType>;
    parent?: Array<CascaderOptionType>;
    __IS_FILTERED_OPTION?: boolean;
}
export interface SearchMatcherProps {
    record: Record;
    text: string;
    textField: string;
    valueField: string;
}
export declare type SearchMatcher = string | ((props: SearchMatcherProps) => boolean);
declare function defaultOnOption({ record }: {
    record: any;
}): {
    disabled: any;
} | undefined;
export declare function getItemKey(record: Record, text: ReactNode, value: any): string;
export declare type onOptionProps = {
    dataSet: DataSet;
    record: Record;
};
export declare type RenderProps = {
    value?: any;
    text?: ReactNode;
    record?: Record | null;
    dataSet?: DataSet | null;
    isFilterSearch?: boolean;
};
declare type Renderer<T extends RenderProps = RenderProps> = (props: T) => ReactNode;
export interface CascaderPopupContentProps extends TriggerFieldPopupContentProps {
    dataSet: DataSet;
    textField: string;
    valueField: string;
    field?: Field | undefined;
    record?: Record | undefined;
    content: ReactNode;
}
export interface CascaderProps extends TriggerFieldProps {
    /**
     * 次级菜单的展开方式，可选 'click' 和 'hover'
     */
    expandTrigger?: ExpandTrigger;
    /**
     * 下拉框匹配输入框宽度
     * @default true
     */
    dropdownMatchSelectWidth?: boolean;
    /**
     * 下拉框菜单样式名
     */
    dropdownMenuStyle?: CSSProperties;
    /**
     * 选项数据源
     */
    options?: DataSet | CascaderOptionType[];
    /**
     * 是否为原始值
     * true - 选项中valueField对应的值
     * false - 选项值对象
     */
    primitiveValue?: boolean;
    /**
     * 当下拉列表为空时显示的内容
     */
    notFoundContent?: ReactNode;
    /**
     * 设置选项属性，如 disabled;
     */
    onOption?: (props: onOptionProps) => OptionProps;
    /**
     * 选择一个值的时候触发
     */
    onChoose?: (value: any, record: any) => void;
    /**
     * 取消选中一个值的时候触发多选时候生效
     */
    onUnChoose?: (value: any, record: any) => void;
    /** 单框弹出形式切换 */
    menuMode?: MenuMode;
    /** 由于渲染在body下可以方便按照业务配置弹出框的大小 */
    singleMenuStyle?: CSSProperties;
    /** 由于渲染在body下可以方便按照业务配置超出大小样式和最小宽度等 */
    singleMenuItemStyle?: CSSProperties;
    /** 设置需要的提示问题配置 */
    singlePleaseRender?: ({ key, className, text }: {
        key: string;
        className: string;
        text: string;
    }) => ReactElement<any>;
    /** 头部可以渲染出想要的tab样子 */
    singleMenuItemRender?: (title: string) => ReactElement<any>;
    /** 选择及改变 */
    changeOnSelect?: boolean;
    searchable?: boolean;
    searchMatcher?: SearchMatcher;
    async?: boolean;
    loadData?: (node: any) => Promise<any>;
    /**
     * 渲染分页 Item 内容
     */
    pagingOptionContent?: string | ReactNode;
    fieldNames?: FieldNamesType;
    /** 渲染Option文本的钩子 */
    optionRenderer?: Renderer;
}
export declare class Cascader<T extends CascaderProps> extends TriggerField<T> {
    static displayName: string;
    static defaultProps: {
        suffixCls: string;
        searchable: boolean;
        dropdownMatchSelectWidth: boolean;
        expandTrigger: ExpandTrigger;
        fieldNames: any;
        onOption: typeof defaultOnOption;
        clearButton: boolean;
        popupPlacement: string;
        triggerShowDelay: number;
        triggerHiddenDelay: number;
        viewMode: import("../trigger-field/enum").TriggerViewMode;
        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;
    };
    activeValues: any;
    menuItemWith: number;
    clickTab: any;
    optionsIsChange: boolean | undefined;
    get isClickTab(): any;
    get activeValue(): any;
    get itemMenuWidth(): number;
    constructor(props: any, context: any);
    findActiveRecord(value: any, options: any): any;
    setActiveValue(activeValues: any): void;
    setIsClickTab(isClickTab: boolean): void;
    setItemMenuWidth(width: number): void;
    getDefaultAction(): Action[];
    get defaultValidationMessages(): ValidationMessages;
    get textField(): string;
    get valueField(): string;
    get cascadeOptions(): Record[];
    get multiple(): boolean;
    get menuMultiple(): boolean;
    get parentField(): string;
    get idField(): string;
    get searchMatcher(): SearchMatcher;
    get options(): DataSet;
    get filteredOptions(): Record[];
    addOptionsParent(options: any, parent: any): any;
    get primitive(): boolean;
    checkValueReaction?: IReactionDisposer;
    checkComboReaction?: IReactionDisposer;
    checkValue(): void;
    checkCombo(): void;
    clearCheckValue(): void;
    clearCheckCombo(): void;
    clearReaction(): void;
    componentWillUnmount(): void;
    componentWillReceiveProps(nextProps: any, nextContext: any): void;
    componentDidUpdate(): void;
    getOmitPropsKeys(): string[];
    getObservableProps(props: any, context: any): any;
    getMenuPrefixCls(): string;
    getPagingOptionContent(): T["pagingOptionContent"];
    renderMultipleHolder(): JSX.Element | undefined;
    getNotFoundContent(): T["notFoundContent"];
    /**
     * 返回一个打平tree返回层级
     * @param record
     * @param fn
     */
    findParentRecordTree(record: Record, fn?: any): any;
    handleLoadData(event: any): Promise<any>;
    /**
     * 获取record 或者 obj对应的值
     * @param value
     * @param key
     */
    getRecordOrObjValue(value: any, key: any): any;
    /**
     * 渲染menu 表格
     * @param menuProps
     */
    getMenu(menuProps?: object): ReactNode;
    getMenuItem({ record, text, value, isFilterSearch }: RenderProps): string | ReactNode;
    get searchable(): boolean;
    get loading(): boolean;
    isEditable(): boolean;
    getPopupContent(): ReactNode;
    /**
     * 增加 popupContent 回调参数 用于控制对应交互
     */
    getPopupProps(): CascaderPopupContentProps;
    getPopupStyleFromAlign(target: any): CSSProperties | undefined;
    getTriggerIconFont(): string;
    handleKeyDown(e: any): void;
    findTreeDataFirstLast(options: any, activeValue: any, direction: any): any;
    handleKeyDownFirstLast(e: any, direction: number): void;
    findTreeDataUpDown(options: any, value: any, direction: any, fn?: any): any;
    sameKeyRecordIndex(options: Record[], activeValue: Record, valueKey: string): number;
    handleKeyDownPrevNext(e: any, direction: number): void;
    findTreeParentChidren(_options: any, activeValue: any, direction: any): any;
    handleKeyLeftRightNext(e: any, direction: number): void;
    handleKeyDownEnter(e: any): void;
    handleKeyDownEsc(e: any): void;
    handleKeyDownSpace(e: any): void;
    handleBlur(e: any): void;
    expand(): void;
    syncValueOnBlur(value: any): void;
    findByText(text: any): Record | undefined;
    findByValue(value: any): Record | undefined;
    isSelected(record: Record): boolean;
    generateComboOption(value: string | any[], callback?: (text: string) => void): void;
    handlePopupAnimateAppear(): void;
    getValueKey(v: any): any;
    handlePopupAnimateEnd(_key: any, _exists: any): void;
    handleMenuSelect(targetOption: any, _menuIndex: any, isClickTab: any, trigger: any): void;
    setactiveEmpty(): void;
    handleOptionSelect(record: Record): void;
    handleOptionUnSelect(record: Record): void;
    removeValues(values: any[], index?: number): void;
    handleSearch(_text?: string): void;
    setText(text?: string): void;
    doSearch: import("lodash").DebouncedFunc<(value: any) => void>;
    searchRemote(value: any): void;
    searchData(data: Record[], text?: string): Record[];
    matchRecordBySearch(record: Record, text?: string): boolean;
    handleChange(e: any): void;
    processRecordToObject(record: Record): any;
    /**
     * 返回tree 的值的列表方法
     * @param record
     * @param allArray
     */
    treeValueToArray(record: Record | ProcessOption, allArray?: string[]): any;
    /**
     * 返回tree 的值的列表方法
     * @param record
     * @param allArray
     */
    treeTextToArray(record: Record, allArray?: string[]): any;
    /**
     * 返回tree 的值的列表方法
     * @param record
     * @param allArray
     */
    treeToArray(record: Record, allArray?: Record[]): any;
    removeObjParentChild(obj: any): any;
    processObjectValue(value: any, textField: any): any;
    processLookupValue(value: any): {} | null | undefined;
    processValue(value: any): ReactNode;
    toValueString(value: any): string | undefined;
    clear(): void;
    addValue(...values: any[]): void;
    resetFilter(): void;
    reset(): void;
    unChoose(record?: Record | null): void;
    /**
     *
     * @param record
     * @param visible
     */
    choose(record?: Record | null, visible?: boolean): void;
    chooseAll(): void;
    unChooseAll(): void;
    handlePopupHiddenChange(hidden: boolean): Promise<void>;
    processSelectedData(): Promise<void>;
    renderLengthInfo(): ReactNode;
}
export default class ObserverCascader extends Cascader<CascaderProps> {
    static defaultProps: {
        suffixCls: string;
        searchable: boolean;
        dropdownMatchSelectWidth: boolean;
        expandTrigger: ExpandTrigger;
        fieldNames: any;
        onOption: typeof defaultOnOption;
        clearButton: boolean;
        popupPlacement: string;
        triggerShowDelay: number;
        triggerHiddenDelay: number;
        viewMode: import("../trigger-field/enum").TriggerViewMode;
        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;
    };
}
export {};
