@leafer-ui/interaction-web 1.3.2 → 1.4.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 +4 -4
- package/src/Interaction.ts +8 -2
- package/types/index.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interaction-web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "@leafer-ui/interaction-web",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.
|
|
26
|
-
"@leafer-ui/core": "1.
|
|
25
|
+
"@leafer/core": "1.4.0",
|
|
26
|
+
"@leafer-ui/core": "1.4.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.
|
|
29
|
+
"@leafer/interface": "1.4.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/Interaction.ts
CHANGED
|
@@ -41,6 +41,7 @@ export class Interaction extends InteractionBase {
|
|
|
41
41
|
'pointerdown': this.onPointerDown,
|
|
42
42
|
'mousedown': this.onMouseDown,
|
|
43
43
|
'touchstart': this.onTouchStart,
|
|
44
|
+
'pointerleave': this.onPointerLeave,
|
|
44
45
|
|
|
45
46
|
'contextmenu': this.onContextMenu,
|
|
46
47
|
|
|
@@ -150,10 +151,15 @@ export class Interaction extends InteractionBase {
|
|
|
150
151
|
this.pointerDown(PointerEventHelper.convert(e, this.getLocal(e)))
|
|
151
152
|
}
|
|
152
153
|
|
|
153
|
-
protected onPointerMove(e: PointerEvent): void {
|
|
154
|
+
protected onPointerMove(e: PointerEvent, isLeave?: boolean): void {
|
|
154
155
|
if (this.config.pointer.touch || this.useMultiTouch || this.preventWindowPointer(e)) return
|
|
155
156
|
this.usePointer || (this.usePointer = true)
|
|
156
|
-
|
|
157
|
+
const data = PointerEventHelper.convert(e, this.getLocal(e, true))
|
|
158
|
+
isLeave ? this.pointerHover(data) : this.pointerMove(data)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
protected onPointerLeave(e: PointerEvent): void {
|
|
162
|
+
this.onPointerMove(e, true)
|
|
157
163
|
}
|
|
158
164
|
|
|
159
165
|
protected onPointerUp(e: PointerEvent): void {
|
package/types/index.d.ts
CHANGED
|
@@ -28,7 +28,8 @@ declare class Interaction extends InteractionBase {
|
|
|
28
28
|
protected onContextMenu(e: PointerEvent): void;
|
|
29
29
|
protected onScroll(): void;
|
|
30
30
|
protected onPointerDown(e: PointerEvent): void;
|
|
31
|
-
protected onPointerMove(e: PointerEvent): void;
|
|
31
|
+
protected onPointerMove(e: PointerEvent, isLeave?: boolean): void;
|
|
32
|
+
protected onPointerLeave(e: PointerEvent): void;
|
|
32
33
|
protected onPointerUp(e: PointerEvent): void;
|
|
33
34
|
protected onPointerCancel(): void;
|
|
34
35
|
protected onMouseDown(e: MouseEvent): void;
|