@leafer-ui/event 1.0.0-rc.24 → 1.0.0-rc.26
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 +10 -1
- package/types/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/event",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.26",
|
|
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.0-rc.
|
|
25
|
+
"@leafer/core": "1.0.0-rc.26"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@leafer/interface": "1.0.0-rc.
|
|
28
|
+
"@leafer/interface": "1.0.0-rc.26"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/DragEvent.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IDragEvent, IPointData, ILeaf, ILeafList, IObject, IBoundsData } from '@leafer/interface'
|
|
2
|
-
import { registerUIEvent, LeafList } from '@leafer/core'
|
|
2
|
+
import { registerUIEvent, LeafList, BoundsHelper } from '@leafer/core'
|
|
3
3
|
|
|
4
4
|
import { PointerEvent } from './PointerEvent'
|
|
5
5
|
|
|
@@ -89,6 +89,15 @@ export class DragEvent extends PointerEvent implements IDragEvent {
|
|
|
89
89
|
return this.getLocalMove(relative, true)
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
public getPageBounds(): IBoundsData {
|
|
93
|
+
const total = this.getPageTotal()
|
|
94
|
+
const start = this.getPage()
|
|
95
|
+
const bounds = {} as IBoundsData
|
|
96
|
+
BoundsHelper.set(bounds, start.x - total.x, start.y - total.y, total.x, total.y)
|
|
97
|
+
BoundsHelper.unsign(bounds)
|
|
98
|
+
return bounds
|
|
99
|
+
}
|
|
100
|
+
|
|
92
101
|
protected assignMove(total: boolean): void {
|
|
93
102
|
move.x = total ? this.totalX : this.moveX
|
|
94
103
|
move.y = total ? this.totalY : this.moveY
|
package/types/index.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ declare class DragEvent extends PointerEvent implements IDragEvent {
|
|
|
80
80
|
getPageTotal(): IPointData;
|
|
81
81
|
getInnerTotal(relative?: ILeaf): IPointData;
|
|
82
82
|
getLocalTotal(relative?: ILeaf): IPointData;
|
|
83
|
+
getPageBounds(): IBoundsData;
|
|
83
84
|
protected assignMove(total: boolean): void;
|
|
84
85
|
}
|
|
85
86
|
|