1 |
|
2 |
|
3 |
|
4 | import { Column } from "../entities/column";
|
5 | import { RowNode } from "../entities/rowNode";
|
6 | export declare enum DragSourceType {
|
7 | ToolPanel = 0,
|
8 | HeaderCell = 1,
|
9 | RowDrag = 2,
|
10 | }
|
11 | export interface DragItem {
|
12 | rowNode?: RowNode;
|
13 | columns?: Column[];
|
14 | visibleState?: {
|
15 | [key: string]: boolean;
|
16 | };
|
17 | }
|
18 | export interface DragSource {
|
19 | |
20 |
|
21 | type: DragSourceType;
|
22 |
|
23 | eElement: HTMLElement;
|
24 |
|
25 | dragItemCallback: () => DragItem;
|
26 |
|
27 | dragItemName: string;
|
28 | |
29 |
|
30 | dragSourceDropTarget?: DropTarget;
|
31 |
|
32 | dragStartPixels?: number;
|
33 |
|
34 | dragStarted?: () => void;
|
35 |
|
36 | dragStopped?: () => void;
|
37 | }
|
38 | export interface DropTarget {
|
39 |
|
40 | getContainer(): HTMLElement;
|
41 | |
42 |
|
43 | getSecondaryContainers?(): HTMLElement[];
|
44 |
|
45 | getIconName?(): string;
|
46 | isInterestedIn(type: DragSourceType): boolean;
|
47 |
|
48 | onDragEnter?(params: DraggingEvent): void;
|
49 |
|
50 | onDragLeave?(params: DraggingEvent): void;
|
51 |
|
52 | onDragging?(params: DraggingEvent): void;
|
53 |
|
54 | onDragStop?(params: DraggingEvent): void;
|
55 | }
|
56 | export declare enum VDirection {
|
57 | Up = 0,
|
58 | Down = 1,
|
59 | }
|
60 | export declare enum HDirection {
|
61 | Left = 0,
|
62 | Right = 1,
|
63 | }
|
64 | export interface DraggingEvent {
|
65 | event: MouseEvent;
|
66 | x: number;
|
67 | y: number;
|
68 | vDirection: VDirection;
|
69 | hDirection: HDirection;
|
70 | dragSource: DragSource;
|
71 | dragItem: DragItem;
|
72 | fromNudge: boolean;
|
73 | }
|
74 | export declare class DragAndDropService {
|
75 | private gridOptionsWrapper;
|
76 | private dragService;
|
77 | private environment;
|
78 | private columnController;
|
79 | static ICON_PINNED: string;
|
80 | static ICON_ADD: string;
|
81 | static ICON_MOVE: string;
|
82 | static ICON_LEFT: string;
|
83 | static ICON_RIGHT: string;
|
84 | static ICON_GROUP: string;
|
85 | static ICON_AGGREGATE: string;
|
86 | static ICON_PIVOT: string;
|
87 | static ICON_NOT_ALLOWED: string;
|
88 | static GHOST_TEMPLATE: string;
|
89 | private logger;
|
90 | private dragSourceAndParamsList;
|
91 | private dragItem;
|
92 | private eventLastTime;
|
93 | private dragSource;
|
94 | private dragging;
|
95 | private eGhost;
|
96 | private eGhostParent;
|
97 | private eGhostIcon;
|
98 | private dropTargets;
|
99 | private lastDropTarget;
|
100 | private ePinnedIcon;
|
101 | private ePlusIcon;
|
102 | private eHiddenIcon;
|
103 | private eMoveIcon;
|
104 | private eLeftIcon;
|
105 | private eRightIcon;
|
106 | private eGroupIcon;
|
107 | private eAggregateIcon;
|
108 | private ePivotIcon;
|
109 | private eDropNotAllowedIcon;
|
110 | private init();
|
111 | private setBeans(loggerFactory);
|
112 | private getStringType(type);
|
113 | addDragSource(dragSource: DragSource, allowTouch?: boolean): void;
|
114 | removeDragSource(dragSource: DragSource): void;
|
115 | private destroy();
|
116 | nudge(): void;
|
117 | private onDragStart(dragSource, mouseEvent);
|
118 | private onDragStop(mouseEvent);
|
119 | private onDragging(mouseEvent, fromNudge);
|
120 | private enterDragTargetIfExists(dropTarget, mouseEvent, hDirection, vDirection, fromNudge);
|
121 | private leaveLastTargetIfExists(mouseEvent, hDirection, vDirection, fromNudge);
|
122 | private getAllContainersFromDropTarget(dropTarget);
|
123 | private isMouseOnDropTarget(mouseEvent, dropTarget);
|
124 | addDropTarget(dropTarget: DropTarget): void;
|
125 | workOutHDirection(event: MouseEvent): HDirection;
|
126 | workOutVDirection(event: MouseEvent): VDirection;
|
127 | createDropTargetEvent(dropTarget: DropTarget, event: MouseEvent, hDirection: HDirection, vDirection: VDirection, fromNudge: boolean): DraggingEvent;
|
128 | private positionGhost(event);
|
129 | private removeGhost();
|
130 | private createGhost();
|
131 | setGhostIcon(iconName: string, shake?: boolean): void;
|
132 | }
|