@orca-fe/pocket
Version:
UI components by orca-team
25 lines (24 loc) • 874 B
TypeScript
import React from 'react';
type DraggableData = {
key?: string | number;
};
export interface DraggableListProps<T extends DraggableData> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
data?: T[];
onDataChange?: (data: T[]) => void;
children: (item: T, params: {
checked: boolean;
dragging: boolean;
changeItem: (item: Partial<T>) => void;
removeItem: () => void;
drag: () => void;
moveUp: () => boolean;
moveDown: () => boolean;
}, index: number) => React.ReactChild;
customStyle?: boolean;
copyByKeyboard?: boolean;
onGenerateKey?: (data: T) => T;
checkMode?: boolean;
customDragHandler?: boolean;
}
declare const DraggableList: <T extends DraggableData>(props: DraggableListProps<T>) => import("react/jsx-runtime").JSX.Element;
export default DraggableList;