vue-devui
Version:
DevUI components based on Vite and Vue3
76 lines (75 loc) • 2.55 kB
TypeScript
import { Subject, Subscription } from 'rxjs';
import { DraggableDirective } from './draggable.directive';
import { InjectionKey } from 'vue';
import { DragPreviewDirective } from './drag-preview.directive';
export declare class DragDropService {
static TOKEN: InjectionKey<DragDropService>;
dragData: any;
draggedEl: any;
draggedElIdentity: any;
batchDragData?: Array<{
identity?: any;
draggable: DraggableDirective;
dragData: any;
}>;
batchDragGroup?: string;
batchDragStyle?: Array<string>;
batchDragging?: boolean;
scope?: string | Array<string>;
dropTargets: Array<{
nativeElement: any;
}>;
dropEvent: Subject<any>;
dragEndEvent: Subject<any>;
dragStartEvent: Subject<any>;
dropOnItem?: boolean;
dragFollow?: boolean;
dragFollowOptions?: {
appendToBody?: boolean;
};
dropOnOrigin?: boolean;
draggedElFollowingMouse?: boolean;
dragOffset?: {
top: number;
left: number;
offsetLeft: number | null;
offsetTop: number | null;
width?: number;
height?: number;
};
subscription: Subscription;
private _dragEmptyImage?;
get dragEmptyImage(): HTMLImageElement;
dragCloneNode: any;
dragOriginPlaceholder: any;
dragItemContainer: any;
dragItemParentName: string;
dragItemChildrenName: string;
intersectionObserver: any;
sub?: Subscription;
dragOriginPlaceholderNextSibling: any;
touchInstance: any;
dragElShowHideEvent: Subject<boolean>;
dragSyncGroupDirectives?: any;
dragPreviewDirective?: DragPreviewDirective;
get document(): Document;
constructor();
newSubscription(): Subscription;
enableDraggedCloneNodeFollowMouse(): void;
disableDraggedCloneNodeFollowMouse(): void;
interceptChildNode(parentNode: Node, childNodeList: NodeListOf<Node>): void;
setChildNodeHide(entries: any): void;
followMouse4CloneNode: (event: DragEvent) => void;
getBatchDragData(identity?: any, order?: ((a: any, b: any) => number) | 'select' | 'draggedElFirst'): any[];
/** usage:
* constructor(..., private dragDropService: DragDropService) {}
* cleanBatchDragData() { this.dragDropService.cleanBatchDragData(); }
*/
cleanBatchDragData(): {
identity?: any;
draggable: DraggableDirective;
dragData: any;
}[] | undefined;
copyStyle(source: HTMLElement, target: HTMLElement): void;
}
export declare function useDragDropService(): DragDropService;