/// <reference types="lodash" />
import React from 'react';
import { FormControlProps, FormBaseControl } from './Item';
import { RendererData, Action } from '../../types';
import { SimpleMap } from '../../utils/SimpleMap';
import { TableSchema } from '../Table';
import { SchemaApi } from '../../Schema';
export interface TableControlSchema extends FormBaseControl, TableSchema {
    type: 'table';
    /**
     * 可新增
     */
    addable?: boolean;
    /**
     * 是否可以拖拽排序
     */
    draggable?: boolean;
    /**
     * 新增 API
     */
    addApi?: SchemaApi;
    /**
     * 新增按钮
     */
    addBtnLabel?: string;
    /**
     * 新增图标
     */
    addBtnIcon?: string;
    /**
     * 显示新增按钮
     */
    showAddBtn?: boolean;
    /**
     * 可否删除
     */
    removable?: boolean;
    /**
     * 删除的 API
     */
    deleteApi?: SchemaApi;
    /**
     * 可否编辑
     */
    editable?: boolean;
    /**
     * 更新按钮名称
     */
    updateBtnLabel?: string;
    /**
     * 更新按钮图标
     */
    updateBtnIcon?: string;
    /**
     * 确认按钮文字
     */
    confirmBtnLabel?: string;
    /**
     * 确认按钮图标
     */
    confirmBtnIcon?: string;
    /**
     * 取消按钮文字
     */
    cancelBtnLabel?: string;
    /**
     * 取消按钮图标
     */
    cancelBtnIcon?: string;
    /**
     * 删除按钮文字
     */
    deleteBtnLabel?: string;
    /**
     * 删除按钮图标
     */
    deleteBtnIcon?: string;
    /**
     * 更新 API
     */
    updateApi?: SchemaApi;
    /**
     * 初始值，新增的时候
     */
    scaffold?: any;
    /**
     * 删除确认文字
     */
    deleteConfirmText?: string;
    /**
     * 值字段
     */
    valueField?: string;
    /**
     * 是否为确认的编辑模式。
     */
    needConfirm?: boolean;
}
export interface TableProps extends FormControlProps, Omit<TableControlSchema, 'type'> {
}
export interface TableState {
    columns: Array<any>;
    editIndex: number;
    editting?: any;
    isCreateMode?: boolean;
}
export default class FormTable extends React.Component<TableProps, TableState> {
    static defaultProps: {
        placeholder: string;
        scaffold: {};
        addBtnIcon: string;
        updateBtnIcon: string;
        deleteBtnIcon: string;
        confirmBtnIcon: string;
        cancelBtnIcon: string;
        valueField: string;
    };
    static propsList: Array<string>;
    entries: SimpleMap<any, number>;
    entityId: number;
    subForms: any;
    editting: any;
    constructor(props: TableProps);
    componentWillUnmount(): void;
    subFormRef(form: any, x: number, y: number): void;
    validate(): any;
    doAction(action: Action, ctx: RendererData, ...rest: Array<any>): Promise<any>;
    addItem(index: number, payload?: any): void;
    startEdit(index: number, editting?: any, isCreate?: boolean): void;
    confirmEdit(): Promise<void>;
    cancelEdit(): void;
    removeItem(index: number): Promise<void>;
    buildItemProps(item: any, index: number): {
        quickEditEnabled: boolean;
    } | null;
    buildColumns(props: TableProps, isCreateMode?: boolean): Array<any>;
    handleTableSave(rows: Array<object> | object, diff: Array<object> | object, rowIndexes: Array<number> | number): void;
    handleSaveTableOrder(moved: Array<object>, rows: Array<object>): void;
    removeEntry(entry: any): void;
    getEntryId(entry: any): string;
    buildItems: ((value: Array<any>, editIndex: number) => any[]) & import("lodash").MemoizedFunction;
    render(): JSX.Element;
}
export declare class TableControlRenderer extends FormTable {
}
