https://github.com/devnax/react-draghost
https://github.com/devnax/react-draghost
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/devnax/react-draghost
- Owner: devnax
- License: mit
- Created: 2022-11-06T15:17:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-24T11:11:06.000Z (over 3 years ago)
- Last Synced: 2025-01-22T00:41:25.483Z (over 1 year ago)
- Language: TypeScript
- Size: 351 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
```tsx
import {DraggableWrapper, Droppable, DroppableProps, WrapperProps} from 'react-draghost'
{}}>
...
...
interface WrapperProps {
instance: Drake;
id: string;
onDrop?: (props: { el: ELE, target: ELE, source: ELE, sibling: ELE }) => void;
onDrag?: (props: { el: ELE, source: ELE }) => void;
onDragend?: (props: { el: ELE }) => void;
onCalcel?: (props: { el: ELE, container: ELE, source: ELE }) => void;
onRemove?: (props: { el: ELE, container: ELE, source: ELE }) => void;
onShadow?: (props: { el: ELE, container: ELE, source: ELE }) => void;
onOver?: (props: { el: ELE, container: ELE, source: ELE }) => void;
onOut?: (props: { el: ELE, container: ELE, source: ELE }) => void;
onCloned?: (props: { clone: ELE, original: ELE, type: 'mirror' | 'copy' }) => void;
moves?: (props: { el?: ELE, container?: ELE, handle?: ELE, sibling?: ELE }) => boolean;
accepts?: (props: { el: ELE, target: ELE, source: ELE, sibling: ELE }) => boolean;
copy?: (props: { el: ELE, source: ELE }) => boolean;
invalid?: (props: { el?: ELE, target?: ELE }) => boolean;
isContainer?: (props: { el?: ELE }) => boolean;
direction?: 'vertical' | 'horizontal';
copySortSource?: boolean;
revertOnSpill?: boolean;
removeOnSpill?: boolean;
mirrorContainer?: ELE;
ignoreInputTextSelection?: boolean;
slideFactorX?: number;
slideFactorY?: number;
droppables: {
[droppableId: string]: DroppableProps
}
}
interface DroppableProps {
id: string;
selfOnly?: boolean;
disabled?: boolean;
observe: () => void;
moves?: (props: { el?: ELE, container?: ELE, handle?: ELE, sibling?: ELE }) => boolean;
accepts?: (props: { el: ELE, target: ELE, source: ELE, sibling: ELE }) => boolean;
copy?: (props: { el: Element, source: Element }) => boolean;
invalid?: (props: { el?: ELE, target?: ELE }) => boolean;
isContainer?: (props: { el?: ELE }) => boolean;
onDrop?: (props: { fromIndex: number | null, toIndex: number | null, el: ELE, target: ELE, source: ELE, sibling: ELE }) => void;
onDrag?: (props: { el: ELE, source: ELE }) => void;
onDragend?: (props: { el: ELE }) => void;
onCalcel?: (props: { el: ELE, container: ELE, source: ELE }) => void;
onRemove?: (props: { el: ELE, container: ELE, source: ELE }) => void;
onShadow?: (props: { el: ELE, container: ELE, source: ELE }) => void;
onOver?: (props: { el: ELE, container: ELE, source: ELE }) => void;
onOut?: (props: { el: ELE, container: ELE, source: ELE }) => void;
onCloned?: (props: { clone: ELE, original: ELE, type: 'mirror' | 'copy' }) => void;
sendData?: (props: { fromIndex: number | null, toIndex: number | null, el: ELE, target: ELE, source: ELE, sibling: ELE }) => any;
}
```