UNPKG

ngx-explorer-dnd

Version:

## _Drag & Drop in Angular like in a desktop explorer!_

68 lines (67 loc) 2.97 kB
import { EventEmitter } from '@angular/core'; import { NgxExplorerContainerDirective } from './ngx-explorer-container.directive'; import { FileFolder } from '../core/file-folder'; import * as i0 from "@angular/core"; export declare class NgxDragSelectionDirective { private _document; private _parentDrag?; /** The current x position of the selection div. */ private startX; /** The current y position of the selection div. */ private startY; /** * The initial x position of the selection div. * Will be used to handle negative x position. */ private initialX; /** * The initial y position of the selection div. * Will be used to handle negative y position. */ private initialY; /** * Will be used to set current selected elements to check has * the current selected elements changed to before. */ private selectedElements; /** The current x position from the fired event. */ private currentX; /** the current y position from the fired event. */ private currentY; /** The current calculated width of the selection div. */ private currentWidth; /** The current calculated height of the selection div. */ private currentHeight; /** Will be true if selection in progress. */ private selectingInProgress; /** The selection border created by this directive. */ private selectionDiv; /** Sets whether ngx-drag-selection can be used. */ selectionAllowed: boolean; /** Set a custom selection div `HTMLElement`. */ selectionDivElement: HTMLElement | null | undefined; /** Event emitted when the selected elements are changed. */ selectedElementsChange: EventEmitter<{ count: number; data: FileFolder[]; }>; /** Checks if a registered element of type `ngx-explorer-item` inside the selection div rect. */ checkIfElementInsideRect(rect: any, selectionBorder: { x: number; y: number; width: number; height: number; }): boolean; /** Checks whether the selected elements have changed. */ checkIfSelectedElementsChanged(items: number[]): boolean; /** Creates the selection div into document.body. */ createSelectionDiv(): void; /** On `mousemove` this will set the current position and width of the selection div. */ setSelectionDivPosition(mouseX: number, mouseY: number): void; constructor(_document: Document, _parentDrag?: NgxExplorerContainerDirective<any> | undefined); onMouseDown(ev: any): void; onMouseMove(ev: any): void; onMouseUp(ev: any): void; static ɵfac: i0.ɵɵFactoryDeclaration<NgxDragSelectionDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<NgxDragSelectionDirective, "[ngxDragSelection]", never, { "selectionAllowed": "selectionAllowed"; "selectionDivElement": "selectionDivElement"; }, { "selectedElementsChange": "selectedElementsChange"; }, never, never, false, never>; }