UNPKG

2.54 kBTypeScriptView Raw
1import { ChangeDetectorRef } from '@angular/core';
2import { EventEmitter, ElementRef } from '@angular/core';
3import { AbstractComponent, AbstractHandleComponent } from './abstract.component';
4import { DragDropConfig, DragImage } from './dnd.config';
5import { DragDropService, DragDropData } from './dnd.service';
6export declare class DraggableComponent extends AbstractComponent {
7 set draggable(value: boolean);
8 /**
9 * Callback function called when the drag actions happened.
10 */
11 onDragStart: EventEmitter<DragDropData>;
12 onDragEnd: EventEmitter<DragDropData>;
13 /**
14 * The data that has to be dragged. It can be any JS object
15 */
16 dragData: any;
17 /**
18 * Callback function called when the drag action ends with a valid drop action.
19 * It is activated after the on-drop-success callback
20 */
21 onDragSuccessCallback: EventEmitter<any>;
22 set dropzones(value: Array<string>);
23 /**
24 * Drag allowed effect
25 */
26 set effectallowed(value: string);
27 /**
28 * Drag effect cursor
29 */
30 set effectcursor(value: string);
31 /**
32 * Here is the property dragImage you can use:
33 * - The string value as url to the image
34 * <div class="panel panel-default"
35 * dnd-draggable [dragEnabled]="true"
36 * [dragImage]="/images/simpler.png">
37 * ...
38 * - The DragImage value with Image and offset by x and y:
39 * let myDragImage: DragImage = new DragImage("/images/simpler1.png", 0, 0);
40 * ...
41 * <div class="panel panel-default"
42 * dnd-draggable [dragEnabled]="true"
43 * [dragImage]="myDragImage">
44 * ...
45 * - The custom function to return the value of dragImage programmatically:
46 * <div class="panel panel-default"
47 * dnd-draggable [dragEnabled]="true"
48 * [dragImage]="getDragImage(someData)">
49 * ...
50 * getDragImage(value:any): string {
51 * return value ? "/images/simpler1.png" : "/images/simpler2.png"
52 * }
53 */
54 dragImage: string | DragImage | Function;
55 cloneItem: boolean;
56 constructor(elemRef: ElementRef, dragDropService: DragDropService, config: DragDropConfig, cdr: ChangeDetectorRef);
57 _onDragStartCallback(event: MouseEvent): void;
58 _onDragEndCallback(event: MouseEvent): void;
59}
60export declare class DraggableHandleComponent extends AbstractHandleComponent {
61 constructor(elemRef: ElementRef, dragDropService: DragDropService, config: DragDropConfig, _Component: DraggableComponent, cdr: ChangeDetectorRef);
62}