@varlet/use 2.18.0-alpha.1697555377370 → 2.18.0-alpha.1697608760113
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/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ declare function useTouch(): {
|
|
|
63
63
|
startTouch: (event: TouchEvent) => void;
|
|
64
64
|
moveTouch: (event: TouchEvent) => void;
|
|
65
65
|
endTouch: () => void;
|
|
66
|
-
isReachTop: (element: Element) => boolean;
|
|
66
|
+
isReachTop: (element: Element | Window) => boolean;
|
|
67
67
|
isReachBottom: (element: Element, offset?: number) => boolean;
|
|
68
68
|
};
|
|
69
69
|
|
package/lib/index.js
CHANGED
|
@@ -265,6 +265,7 @@ function useInitialized(source, value) {
|
|
|
265
265
|
|
|
266
266
|
// src/useTouch.ts
|
|
267
267
|
import { ref as ref2 } from "vue";
|
|
268
|
+
import { getScrollTop } from "@varlet/shared";
|
|
268
269
|
function getDirection(x, y) {
|
|
269
270
|
if (x > y) {
|
|
270
271
|
return "horizontal";
|
|
@@ -344,7 +345,7 @@ function useTouch() {
|
|
|
344
345
|
});
|
|
345
346
|
};
|
|
346
347
|
const isReachTop = (element) => {
|
|
347
|
-
const
|
|
348
|
+
const scrollTop = getScrollTop(element);
|
|
348
349
|
return scrollTop === 0 && deltaY.value > 0;
|
|
349
350
|
};
|
|
350
351
|
const isReachBottom = (element, offset = 1) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/use",
|
|
3
|
-
"version": "2.18.0-alpha.
|
|
3
|
+
"version": "2.18.0-alpha.1697608760113",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/varletjs/varlet/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@varlet/shared": "2.18.0-alpha.
|
|
27
|
+
"@varlet/shared": "2.18.0-alpha.1697608760113"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^18.7.18",
|