import React from "react"; import { TableAddon } from "../../TableProps"; import { CheckTreeRelation } from "../../../checktree"; /** * `RowsDraggable` 插件用于支持表格行拖拽排序操作。 */ export interface RowsDraggableOptions { /** * 提供 `relations` 属性,结合 expandable 插件 */ relations?: CheckTreeRelation; /** * 用户进行展开/收起操作的时候,知会最新的键值,结合 expandable 插件 */ onExpandedKeysChange?: (value: string[], context?: { event: React.SyntheticEvent; operateType: "expand" | "collapse"; operateKey: string; operateRecord: Record; }) => void; /** * 展开行的键值,结合 expandable 插件 */ expandedKeys?: string[]; /** * 子级相对父级缩进量,结合 expandable 插件 * @default 20 */ indent?: number; /** * 拖拽完成回调 */ onDragEnd: (records: Record[], dragContext?: { dragKey?: string; dragRecordIndex?: number; dragRecord?: Record; dropKey?: string; dropDepth?: number; }) => void; /** * 拖拽开始时回调 */ onDragStart?: (context: any) => void; /** * 拖拽类型,树拖拽排序或者仅行拖拽 * @default "row" */ dragType?: "tree" | "row"; /** * 可拖拽的行, 默认所有行 * @default "all" */ draggableRowKeys?: string[] | "all"; /** * 子树列表字段名,树形拖拽需传该参数 */ childrenColName?: string; /** * 隐藏拖拽手柄图标 * * *默认值:* * * - *内置拖拽 `"unhover"`* * - *第三方库拖拽 `false`* */ hideHandler?: boolean | "unhover"; /** * 拖拽手柄列宽度,可以指定 CSS 属性或数字 (单位:px) * @default 46 */ width?: string | number; /** * 拖拽手柄图标 * * *参考 Icon 组件[图标类型](/component/icon)* * * @default "drop" */ icon?: string; /** * 提供一个列的 `key`,将icon插入到一个目标列 * * 默认在最前新建一列插入 */ targetColumnKey?: string; } export declare function rowsDraggable({ onDragEnd, onDragStart, draggableRowKeys, childrenColName, dragType, relations, onExpandedKeysChange, expandedKeys, indent, hideHandler, icon, width, targetColumnKey, ...options }: RowsDraggableOptions): TableAddon;