forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdrop-location.ts
More file actions
39 lines (32 loc) · 1.09 KB
/
drop-location.ts
File metadata and controls
39 lines (32 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { IDropLocation as InnerDropLocation } from '@felce/lowcode-designer';
import { dropLocationSymbol } from '../symbols';
import { Node as ShellNode } from './node';
import {
IPublicModelDropLocation,
IPublicTypeLocationDetail,
IPublicModelLocateEvent,
} from '@felce/lowcode-types';
export class DropLocation implements IPublicModelDropLocation {
private readonly [dropLocationSymbol]: InnerDropLocation;
constructor(dropLocation: InnerDropLocation) {
this[dropLocationSymbol] = dropLocation;
}
static create(dropLocation: InnerDropLocation | null): IPublicModelDropLocation | null {
if (!dropLocation) {
return null;
}
return new DropLocation(dropLocation);
}
get target() {
return ShellNode.create(this[dropLocationSymbol].target);
}
get detail(): IPublicTypeLocationDetail {
return this[dropLocationSymbol].detail;
}
get event(): IPublicModelLocateEvent {
return this[dropLocationSymbol].event;
}
clone(event: IPublicModelLocateEvent): IPublicModelDropLocation {
return new DropLocation(this[dropLocationSymbol].clone(event));
}
}