@leafer/event 1.0.0-rc.3 → 1.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -3
- package/src/Event.ts +7 -1
- package/src/index.ts +0 -1
- package/types/index.d.ts +3 -21
- package/src/TransformEvent.ts +0 -32
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/event",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.5",
|
|
4
4
|
"description": "@leafer/event",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,9 +22,10 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/decorator": "1.0.0-rc.
|
|
25
|
+
"@leafer/decorator": "1.0.0-rc.5",
|
|
26
|
+
"@leafer/platform": "1.0.0-rc.5"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@leafer/interface": "1.0.0-rc.
|
|
29
|
+
"@leafer/interface": "1.0.0-rc.5"
|
|
29
30
|
}
|
|
30
31
|
}
|
package/src/Event.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { IEvent, IEventTarget } from '@leafer/interface'
|
|
1
|
+
import { IEvent, IEventTarget, IObject } from '@leafer/interface'
|
|
2
|
+
import { Platform } from '@leafer/platform'
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
export class Event implements IEvent {
|
|
5
6
|
|
|
7
|
+
readonly origin: IObject
|
|
8
|
+
|
|
6
9
|
readonly type: string
|
|
7
10
|
readonly target: IEventTarget
|
|
8
11
|
readonly current: IEventTarget
|
|
@@ -21,14 +24,17 @@ export class Event implements IEvent {
|
|
|
21
24
|
|
|
22
25
|
public stopDefault(): void {
|
|
23
26
|
this.isStopDefault = true
|
|
27
|
+
if (this.origin) Platform.event.stopDefault(this.origin)
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
public stopNow(): void {
|
|
27
31
|
this.isStopNow = true
|
|
28
32
|
this.isStop = true
|
|
33
|
+
if (this.origin) Platform.event.stopNow(this.origin)
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
public stop(): void {
|
|
32
37
|
this.isStop = true
|
|
38
|
+
if (this.origin) Platform.event.stop(this.origin)
|
|
33
39
|
}
|
|
34
40
|
}
|
package/src/index.ts
CHANGED
|
@@ -2,7 +2,6 @@ export { ChildEvent } from './ChildEvent'
|
|
|
2
2
|
export { PropertyEvent } from './PropertyEvent'
|
|
3
3
|
export { ImageEvent } from './ImageEvent'
|
|
4
4
|
export { ResizeEvent } from './ResizeEvent'
|
|
5
|
-
export { TransformEvent } from './TransformEvent'
|
|
6
5
|
export { WatchEvent } from './WatchEvent'
|
|
7
6
|
export { LayoutEvent } from './LayoutEvent'
|
|
8
7
|
export { AnimateEvent } from './AnimateEvent'
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { IEvent, IEventTarget, IChildEvent, ILeaf, IPropertyEvent, IImageEvent, ILeaferImage,
|
|
1
|
+
import { IEvent, IObject, IEventTarget, IChildEvent, ILeaf, IPropertyEvent, IImageEvent, ILeaferImage, IResizeEvent, IScreenSizeData, IWatchEvent, IWatchEventData, ILayoutEvent, ILayoutBlockData, IAnimateEvent, IRenderEvent, IBounds, IRenderOptions, ILeaferEvent } from '@leafer/interface';
|
|
2
2
|
|
|
3
3
|
declare class Event implements IEvent {
|
|
4
|
+
readonly origin: IObject;
|
|
4
5
|
readonly type: string;
|
|
5
6
|
readonly target: IEventTarget;
|
|
6
7
|
readonly current: IEventTarget;
|
|
@@ -54,25 +55,6 @@ declare class ResizeEvent extends Event implements IResizeEvent {
|
|
|
54
55
|
constructor(size: IScreenSizeData | string, oldSize?: IScreenSizeData);
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
declare class TransformEvent extends Event implements ITransformEvent {
|
|
58
|
-
static START: string;
|
|
59
|
-
static CHANGE: string;
|
|
60
|
-
static END: string;
|
|
61
|
-
static BEFORE_START: string;
|
|
62
|
-
static BEFORE_CHANGE: string;
|
|
63
|
-
static BEFORE_END: string;
|
|
64
|
-
readonly x: number;
|
|
65
|
-
readonly y: number;
|
|
66
|
-
readonly scaleX: number;
|
|
67
|
-
readonly scaleY: number;
|
|
68
|
-
readonly rotation: number;
|
|
69
|
-
readonly zooming: boolean;
|
|
70
|
-
readonly moving: boolean;
|
|
71
|
-
readonly rotating: boolean;
|
|
72
|
-
readonly changing: boolean;
|
|
73
|
-
constructor(type: string, params?: ITransformEventData);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
58
|
declare class WatchEvent extends Event implements IWatchEvent {
|
|
77
59
|
static REQUEST: string;
|
|
78
60
|
static DATA: string;
|
|
@@ -124,4 +106,4 @@ declare class LeaferEvent extends Event implements ILeaferEvent {
|
|
|
124
106
|
static END: string;
|
|
125
107
|
}
|
|
126
108
|
|
|
127
|
-
export { AnimateEvent, ChildEvent, Event, ImageEvent, LayoutEvent, LeaferEvent, PropertyEvent, RenderEvent, ResizeEvent,
|
|
109
|
+
export { AnimateEvent, ChildEvent, Event, ImageEvent, LayoutEvent, LeaferEvent, PropertyEvent, RenderEvent, ResizeEvent, WatchEvent };
|
package/src/TransformEvent.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ITransformEvent, ITransformEventData } from '@leafer/interface'
|
|
2
|
-
|
|
3
|
-
import { Event } from './Event'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export class TransformEvent extends Event implements ITransformEvent {
|
|
7
|
-
|
|
8
|
-
static START = 'transform.start'
|
|
9
|
-
static CHANGE = 'transform.change'
|
|
10
|
-
static END = 'transform.end'
|
|
11
|
-
|
|
12
|
-
static BEFORE_START = 'transform.before_start'
|
|
13
|
-
static BEFORE_CHANGE = 'transform.before_change'
|
|
14
|
-
static BEFORE_END = 'transform.before_end'
|
|
15
|
-
|
|
16
|
-
readonly x: number
|
|
17
|
-
readonly y: number
|
|
18
|
-
readonly scaleX: number
|
|
19
|
-
readonly scaleY: number
|
|
20
|
-
readonly rotation: number
|
|
21
|
-
|
|
22
|
-
readonly zooming: boolean
|
|
23
|
-
readonly moving: boolean
|
|
24
|
-
readonly rotating: boolean
|
|
25
|
-
readonly changing: boolean
|
|
26
|
-
|
|
27
|
-
constructor(type: string, params?: ITransformEventData) {
|
|
28
|
-
super(type)
|
|
29
|
-
if (params) Object.assign(this, params)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
}
|