import type { CheckboxProps, DatePickerProps, InputNumberProps, InputProps, SelectProps, SwitchProps } from 'antd'; import type { TextAreaProps } from 'antd/es/input'; import type { Dayjs } from 'dayjs'; import React, { CSSProperties, type RefObject } from 'react'; import type { ICheckboxExtraProps } from '../../../baseComponent'; import type { BaseHelpProps } from '../../base-help'; import type { ICurrentObject, IObject } from '../util'; declare type optionType = { value: any; label?: React.ReactNode; type?: 'Badge' | 'Tag' | String; color?: string; status?: 'success' | 'processing' | 'error' | 'default' | 'warning'; }; interface IBaseFormat { nullValue?: string; } interface IDateFormat extends IBaseFormat { type: 'date'; formatter: 'YYYY-MM-DD' | 'YYYY-MM-DD HH:mm' | 'HH:mm' | String; } interface IOptionFormat extends IBaseFormat { type: 'option'; formatter?: optionType[]; } interface INumberFormat extends IBaseFormat { type: 'number'; color?: string; prefix?: string; suffix?: string; precision?: number; formatter?: ',' | String | false | Function; } interface IIconFormat extends IBaseFormat { type: 'icon'; formatter: Array<{ value: any; label?: React.ReactNode; icon: string | React.ReactElement; style?: CSSProperties; }>; } interface IAttachmentFormat extends IBaseFormat { type: 'attachment'; oType: 'add' | 'edit' | 'view'; formatter?: { icon: string | React.ReactElement; style?: CSSProperties; showTip?: string; }; } interface IExprFormat extends IBaseFormat { type: 'expr'; formatter: string; } export declare type IFormat = IDateFormat | IOptionFormat | INumberFormat | IIconFormat | IExprFormat | IAttachmentFormat; export declare type IExpr = String | (($R: any, $D: any, $V: any, $DI: any) => any); declare type getEditor = (dataIndex?: string) => ICurrentObject; declare type onBeforeInit = ({ editor, row, dataIndex, table }: { editor: any; row: any; dataIndex: any; table: any; }) => boolean | void | IObject; declare type onInit = ({ editor, row, dataIndex, rowIndex, table }: { editor: any; row: any; dataIndex: any; rowIndex: any; table: any; }) => void; declare type onChange = { value: any; row: any; lastRow: any; rowIndex: number; dataIndex: any; table: any; getEditor: getEditor; originValue: any; }; interface IEditor
extends IObject {
/**
* @description 设置是否必输项
*/
required?: boolean;
/**
* @description 设置编辑器内部组件的属性,不会被过滤,直接传入组件内部
*/
antProps?: P;
/**
* @description 设置编辑器的监听事件
*/
listeners?: {
/**
* @description 返回false阻止编辑器渲染,相当于只读
*/
onBeforeInit?: onBeforeInit;
onInit?: onInit;
onChange?: (args: onChange) => void;
};
/**
* @description 设置编辑器的条件隐藏函数
*/
hidden?: (params: {
row: IObject;
dataIndex: string;
}) => Boolean;
/**
* @description 设置编辑器的条件禁用函数
*/
disabled?: (params: {
row: IObject;
dataIndex: string;
}) => Boolean;
/**
* @description 设置非编辑状态下单元格需要显示的字段
*/
nameField?: string | ((params: {
row: IObject;
dataIndex: string;
}) => string);
}
interface CustomizedTypeProps extends IObject {
value: any;
onChange: Function;
onKeyDown: Function;
outRef: RefObject