import { Dispatch, ReactNode, SetStateAction, JSX } from "react";
import { IFColumnSelectTable } from "../select-table";
import { FromItemsField } from "../edit-form";
import { UseFormGetValues, UseFormReset, UseFormSetValue } from "react-hook-form";
type ITextAlign = 'center' | 'left' | 'right';
type IEditType = 'text' | 'numeric' | 'datetime' | 'selectTree' | 'date' | 'select' | 'checkbox' | 'form' | 'color';
export type ICommandItem = {
    id: string;
    color?: string;
    tooltip?: string;
    icon?: string;
    commandTemplate?: ReactNode;
};
export type IFToolbarOptions = {
    align: 'left' | 'right' | 'center';
    template: any;
};
export type ISettingFormElement = {
    schema: any;
    labelSize?: 'label-small' | 'label-medium' | 'label-large';
    menuWidth?: number;
    menuHeight?: number;
    displayValue?: any;
    openOnFocus?: boolean;
    isClearable?: boolean;
    onFormOpen?: (rowData: any, itemsField: FromItemsField[], setItemsField: Dispatch<SetStateAction<FromItemsField[]>>) => void;
    onFormSubmit?: (rowData: any, setValue: UseFormSetValue<any>, getValues: UseFormGetValues<any>, reset: UseFormReset<any>) => void;
    footerTemplate?: (rowData: any) => JSX.Element;
    onChangeField?: (rowData: any, field: string, setValue: UseFormSetValue<any>, getValues: UseFormGetValues<any>) => void;
    onChange?: (rowData: any) => void;
};
export type ISettingSelectElement = {
    isClearable?: boolean;
    isMulti?: boolean;
    noHeader?: boolean;
    showFooter?: boolean;
    selectChilds?: boolean;
    allowCreate?: boolean;
    defaultValue?: any;
    fieldValue?: string;
    fieldLabel?: string;
    fieldChild?: string;
    options?: any[];
    widthPopup?: string | number;
    heightPopup?: string | number;
    iconGroup?: string;
    handAddNew?: any;
    validateOption?: any;
    optionsField?: string;
    columns?: IFColumnSelectTable[];
    formatOptionLabel?: (ele: any) => JSX.Element;
    footerComponent?: () => JSX.Element;
    loadOptions?: (keyword: string, callback: (rs: any[]) => void) => void;
    onOpenMenu?: (row: any, col: IColumnTable, indexRow: number) => void;
};
export type ISettingNumericElement = {
    min?: number;
    max?: number;
    fraction?: number;
    allowNegative?: boolean;
};
export type IColumnTable = {
    field: string;
    headerText?: string;
    isPrimarykey?: boolean;
    isUnikey?: boolean;
    haveSum?: boolean;
    haveToolTip?: boolean;
    width?: number | string;
    minWidth?: number | string;
    maxWidth?: number | string;
    editEnable?: boolean;
    visible?: boolean;
    invisibleDisable?: boolean;
    editType?: IEditType;
    textAlign?: ITextAlign;
    fixedType?: 'left' | 'right' | undefined;
    commandItems?: ICommandItem[];
    placeholder?: string;
    numericSettings?: ISettingNumericElement;
    selectSettings?: ISettingSelectElement;
    formSettings?: ISettingFormElement;
    columns?: IColumnTable[];
    disablePaste?: boolean;
    validate?: (value: any, row: any) => string | undefined;
    disabledCondition?: (row: any) => boolean;
    callback?: (value: any, indexRow: number, item: any) => void;
    template?: (row: any, indexRow: number) => JSX.Element | string | number | undefined;
    editTypeCondition?: (row: any) => string;
    onPaste?: (dataRow: any, dataPaste: any) => void;
    onPasteValidate?: (dataPaste: string, dataRow: any, rowIndex: number) => Promise<any>;
};
export type IFTableEditPaging = {
    allowPaging?: boolean;
    pagingClient?: boolean;
    currentPage?: number;
    setCurrentPage?: Dispatch<SetStateAction<number>>;
    setPageSize?: Dispatch<SetStateAction<number>>;
    pageSize?: number;
    totalItem?: number;
    pageOptions?: number[];
};
export type IFTableEditButton = {
    deleteAllDisable?: boolean;
    insertAfterDisable?: boolean;
    insertBeforeDisable?: boolean;
    duplicateDisable?: boolean;
};
export type IFTableEditToolbar = {
    showTopToolbar?: boolean;
    toolbarOptions?: IFToolbarOptions[];
    toolbarBottomOptions?: IFToolbarOptions[];
    showBottomToolbar?: boolean;
};
export type IFTableEditSearchSetting = {
    searchEnable?: boolean;
    searchClient?: boolean;
    searchTerm?: string;
    keyField?: string[];
    setSearchTerm?: Dispatch<SetStateAction<string>>;
};
export type IFTableEditFormat = {
    dateFormat?: string;
    datetimeFormat?: string;
    decimalSeparator?: string;
    thousandSeparator?: string;
    colorNegative?: string;
    prefixNegative?: string;
    suffixNegative?: string;
};
export type IFPageSize = {
    pageSize: number;
};
export type IFCurrentPage = {
    currentPage: number;
};
export type IFCurrentPageConfig = {
    currentPage: number;
    oldPage: number;
};
export type IHeaderColumnTable = {
    field: string;
    headerText?: string;
    width?: number | string;
    minWidth?: number | string;
    maxWidth?: number | string;
    visible?: boolean;
    rowspan?: number;
    columns?: IColumnTable[];
    textAlign?: ITextAlign;
    fixedType?: 'left' | 'right' | undefined;
    index?: number;
};
export {};
