@leafer/event 1.5.2 → 1.6.0
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 +5 -5
- package/src/RenderEvent.ts +2 -0
- package/src/ResizeEvent.ts +7 -1
- package/types/index.d.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/event",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "@leafer/event",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/decorator": "1.
|
|
26
|
-
"@leafer/math": "1.
|
|
27
|
-
"@leafer/platform": "1.
|
|
25
|
+
"@leafer/decorator": "1.6.0",
|
|
26
|
+
"@leafer/math": "1.6.0",
|
|
27
|
+
"@leafer/platform": "1.6.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@leafer/interface": "1.
|
|
30
|
+
"@leafer/interface": "1.6.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/RenderEvent.ts
CHANGED
|
@@ -8,6 +8,8 @@ export class RenderEvent extends Event implements IRenderEvent {
|
|
|
8
8
|
static REQUEST = 'render.request'
|
|
9
9
|
|
|
10
10
|
static CHILD_START = 'render.child_start' // app 专用
|
|
11
|
+
static CHILD_END = 'render.child_end'
|
|
12
|
+
|
|
11
13
|
static START = 'render.start'
|
|
12
14
|
|
|
13
15
|
static BEFORE = 'render.before'
|
package/src/ResizeEvent.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IResizeEvent, IScreenSizeData } from '@leafer/interface'
|
|
1
|
+
import { ILeaf, INumberMap, IResizeEvent, IScreenSizeData } from '@leafer/interface'
|
|
2
2
|
|
|
3
3
|
import { Event } from './Event'
|
|
4
4
|
|
|
@@ -7,6 +7,8 @@ export class ResizeEvent extends Event implements IResizeEvent {
|
|
|
7
7
|
|
|
8
8
|
static RESIZE: string = 'resize'
|
|
9
9
|
|
|
10
|
+
static resizingKeys: INumberMap // resize编辑中的元素 LeafList 键表
|
|
11
|
+
|
|
10
12
|
readonly width: number
|
|
11
13
|
readonly height: number
|
|
12
14
|
readonly pixelRatio: number
|
|
@@ -38,4 +40,8 @@ export class ResizeEvent extends Event implements IResizeEvent {
|
|
|
38
40
|
this.old = oldSize
|
|
39
41
|
}
|
|
40
42
|
|
|
43
|
+
static isResizing(leaf: ILeaf): boolean {
|
|
44
|
+
return this.resizingKeys && this.resizingKeys[leaf.innerId] !== undefined
|
|
45
|
+
}
|
|
46
|
+
|
|
41
47
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEvent, IObject, IEventTarget, IChildEvent, ILeaf, IPropertyEvent, IImageEvent, ILeaferImage, IResizeEvent, IScreenSizeData, IWatchEvent, IWatchEventData, ILayoutEvent, ILayoutBlockData, IRenderEvent, IBounds, IRenderOptions, ILeaferEvent, IEventer, InnerId, IEventListenerMap, IEventMap, IEventListener, IEventOption, IEventListenerId } from '@leafer/interface';
|
|
1
|
+
import { IEvent, IObject, IEventTarget, IChildEvent, ILeaf, IPropertyEvent, IImageEvent, ILeaferImage, IResizeEvent, INumberMap, IScreenSizeData, IWatchEvent, IWatchEventData, ILayoutEvent, ILayoutBlockData, IRenderEvent, IBounds, IRenderOptions, ILeaferEvent, IEventer, InnerId, IEventListenerMap, IEventMap, IEventListener, IEventOption, IEventListenerId } from '@leafer/interface';
|
|
2
2
|
|
|
3
3
|
declare class Event implements IEvent {
|
|
4
4
|
readonly origin: IObject;
|
|
@@ -50,6 +50,7 @@ declare class ImageEvent extends Event implements IImageEvent {
|
|
|
50
50
|
|
|
51
51
|
declare class ResizeEvent extends Event implements IResizeEvent {
|
|
52
52
|
static RESIZE: string;
|
|
53
|
+
static resizingKeys: INumberMap;
|
|
53
54
|
readonly width: number;
|
|
54
55
|
readonly height: number;
|
|
55
56
|
readonly pixelRatio: number;
|
|
@@ -58,6 +59,7 @@ declare class ResizeEvent extends Event implements IResizeEvent {
|
|
|
58
59
|
get samePixelRatio(): boolean;
|
|
59
60
|
readonly old: IScreenSizeData;
|
|
60
61
|
constructor(size: IScreenSizeData | string, oldSize?: IScreenSizeData);
|
|
62
|
+
static isResizing(leaf: ILeaf): boolean;
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
declare class WatchEvent extends Event implements IWatchEvent {
|
|
@@ -83,6 +85,7 @@ declare class LayoutEvent extends Event implements ILayoutEvent {
|
|
|
83
85
|
declare class RenderEvent extends Event implements IRenderEvent {
|
|
84
86
|
static REQUEST: string;
|
|
85
87
|
static CHILD_START: string;
|
|
88
|
+
static CHILD_END: string;
|
|
86
89
|
static START: string;
|
|
87
90
|
static BEFORE: string;
|
|
88
91
|
static RENDER: string;
|