UNPKG

ng-reorder

Version:

Sort elements within a list by using drag-n-drop interface without any restrictions by direction

54 lines (53 loc) 2.04 kB
import { ElementRef, AfterViewInit, OnDestroy, NgZone, InjectionToken } from '@angular/core'; import { Point } from './interfaces'; import { DragCollectionInterface as DragCollection } from './collection.directive'; import { EventService } from './event.service'; export declare const DRAG_COLLECTION: InjectionToken<DragCollection>; export declare class DragUnitDirective implements AfterViewInit, OnDestroy { container: DragCollection; private eventService; private _host; private _zone; private _disabled; /** Emits when the element is successfully touched */ private unitTaken; /** Emits when the element is released */ private unitReleased; /** Emits when the element is moved on the page */ private unitMoved; private _handles; private _rejectors; private _active; private _droppped; /** Emits when the element is destroyed */ private _destroy; /** Point on the page. Changes when the element is touched and contains coordinates of the event */ private _origin; /** Contains current offset from origin position */ private _offset; private _pointerPosition; /** Current scroll value since drag sequence has been started */ private _scrollOrigin; private _scrollOffset; private _moveSubscribtion; private _upSubscription; private _scrollSubscription; get active(): boolean; get dropped(): boolean; get disabled(): boolean; constructor(container: DragCollection, eventService: EventService, _host: ElementRef<HTMLElement>, _zone: NgZone); ngAfterViewInit(): void; ngOnDestroy(): void; applyTransformation(shift: Point): void; getRect(): ClientRect; reset(): void; setOffset(point: Point): void; private _animateDroppedElement; private _initDragSequence; private _viewScroll; private _startDragSequence; private _stopDragSequence; private _pointerDown; private _pointerMove; private _pointerUp; }