@flatbiz/antd
Version:
45 lines (42 loc) • 1.23 kB
TypeScript
import { TPlainObject } from '@flatbiz/utils';
import { TableProps } from 'antd';
import { ReactElement } from 'react';
export type DragTableProps = Omit<TableProps<TPlainObject>, "dataSource"> & {
/**
* ```
* 1. 可自定义拖拽图标
* 2. dragIcon = false,可设置表格行拖拽
* ```
*/
dragIcon?: false | ReactElement;
/** 表格数据唯一值字段Key,未填或者无法唯一,都不能拖拽能力 */
uidFieldKey: string;
dataSource?: TPlainObject[];
/** 禁用拖拽 */
disabledDrag?: boolean;
/**
* 拖拽结束事件
* ```
* dataSource: 拖拽完成后的数据源
* dragData
* 1. activeId 拖拽ID
* 2. activeIndex 拖拽起始表格数组索引值
* 3. overIndex 拖拽结束表格数组索引值
* ```
*/
onDragChange?: (dataSource: TPlainObject[], dragData: {
activeId: string | number;
activeIndex: number;
overIndex: number;
}) => void;
};
/**
* 可拖拽表格
* ```
* 1. 必须设置唯一值字段 uidFieldKey
* 2. 如果拖拽显示异常,请检查 uidFieldKey 是否正确
* 3. Table 参数 components.body.row 被组件内部使用
* ```
*/
export declare const DragTable: (props: DragTableProps) => import("react").JSX.Element;
export {};