@leafer-ui/event 1.0.7 → 1.0.9
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 +3 -3
- package/src/DragEvent.ts +6 -6
- package/src/UIEvent.ts +3 -3
- package/types/index.d.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/event",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "@leafer-ui/event",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.0.
|
|
25
|
+
"@leafer/core": "1.0.9"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@leafer/interface": "1.0.
|
|
28
|
+
"@leafer/interface": "1.0.9"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/DragEvent.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { registerUIEvent, LeafList, BoundsHelper } from '@leafer/core'
|
|
|
4
4
|
import { PointerEvent } from './PointerEvent'
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const tempMove = {} as IPointData
|
|
8
8
|
|
|
9
9
|
@registerUIEvent()
|
|
10
10
|
export class DragEvent extends PointerEvent implements IDragEvent {
|
|
@@ -72,19 +72,19 @@ export class DragEvent extends PointerEvent implements IDragEvent {
|
|
|
72
72
|
|
|
73
73
|
public getPageMove(total?: boolean): IPointData {
|
|
74
74
|
this.assignMove(total)
|
|
75
|
-
return this.current.getPagePoint(
|
|
75
|
+
return this.current.getPagePoint(tempMove, null, true)
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
public getInnerMove(relative?: ILeaf, total?: boolean): IPointData {
|
|
79
79
|
if (!relative) relative = this.current
|
|
80
80
|
this.assignMove(total)
|
|
81
|
-
return relative.getInnerPoint(
|
|
81
|
+
return relative.getInnerPoint(tempMove, null, true)
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
public getLocalMove(relative?: ILeaf, total?: boolean): IPointData {
|
|
85
85
|
if (!relative) relative = this.current
|
|
86
86
|
this.assignMove(total)
|
|
87
|
-
return relative.getLocalPoint(
|
|
87
|
+
return relative.getLocalPoint(tempMove, null, true)
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
public getPageTotal(): IPointData {
|
|
@@ -109,8 +109,8 @@ export class DragEvent extends PointerEvent implements IDragEvent {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
protected assignMove(total: boolean): void {
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
tempMove.x = total ? this.totalX : this.moveX
|
|
113
|
+
tempMove.y = total ? this.totalY : this.moveY
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
}
|
package/src/UIEvent.ts
CHANGED
|
@@ -53,9 +53,9 @@ export class UIEvent extends Event implements IUIEvent {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// 兼容代码,未来可移除
|
|
56
|
-
public getInner
|
|
57
|
-
public getLocal
|
|
58
|
-
public getPage
|
|
56
|
+
public getInner(relative?: ILeaf): IPointData { return this.getInnerPoint(relative) }
|
|
57
|
+
public getLocal(relative?: ILeaf): IPointData { return this.getLocalPoint(relative) }
|
|
58
|
+
public getPage(): IPointData { return this.getPagePoint() }
|
|
59
59
|
|
|
60
60
|
static changeName(oldName: string, newName: string): void {
|
|
61
61
|
EventCreator.changeName(oldName, newName)
|
package/types/index.d.ts
CHANGED
|
@@ -23,9 +23,9 @@ declare class UIEvent extends Event implements IUIEvent {
|
|
|
23
23
|
getInnerPoint(relative?: ILeaf): IPointData;
|
|
24
24
|
getLocalPoint(relative?: ILeaf): IPointData;
|
|
25
25
|
getPagePoint(): IPointData;
|
|
26
|
-
getInner
|
|
27
|
-
getLocal
|
|
28
|
-
getPage
|
|
26
|
+
getInner(relative?: ILeaf): IPointData;
|
|
27
|
+
getLocal(relative?: ILeaf): IPointData;
|
|
28
|
+
getPage(): IPointData;
|
|
29
29
|
static changeName(oldName: string, newName: string): void;
|
|
30
30
|
}
|
|
31
31
|
|