ag-common 0.0.749 → 0.0.750
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.
|
@@ -19,8 +19,11 @@ function useOnScroll({ onScroll, element, } = {}) {
|
|
|
19
19
|
var _a;
|
|
20
20
|
const listener = (e) => {
|
|
21
21
|
var _a, _b;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
if (!(element === null || element === void 0 ? void 0 : element.current)) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const y = (_a = element.current.scrollTop) !== null && _a !== void 0 ? _a : window.scrollY;
|
|
26
|
+
const x = (_b = element.current.scrollLeft) !== null && _b !== void 0 ? _b : window.scrollX;
|
|
24
27
|
const r = {
|
|
25
28
|
y,
|
|
26
29
|
x,
|
|
@@ -35,8 +38,10 @@ function useOnScroll({ onScroll, element, } = {}) {
|
|
|
35
38
|
};
|
|
36
39
|
const listenDebounce = (e) => {
|
|
37
40
|
(0, debounce_1.debounce)(() => {
|
|
38
|
-
const
|
|
39
|
-
|
|
41
|
+
const l = listener(e);
|
|
42
|
+
if (l) {
|
|
43
|
+
setStartScrollTopY(l.y);
|
|
44
|
+
}
|
|
40
45
|
}, { key: 'onscroll', time: 20 });
|
|
41
46
|
};
|
|
42
47
|
((_a = element === null || element === void 0 ? void 0 : element.current) !== null && _a !== void 0 ? _a : document).addEventListener(`scroll`, listenDebounce, {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.750",
|
|
3
3
|
"name": "ag-common",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@emotion/styled": "^11.14.0",
|
|
48
48
|
"@smithy/types": "^4.2.0",
|
|
49
49
|
"@storybook/addon-actions": "^8.6.12",
|
|
50
|
-
"@storybook/addon-docs": "8.6.
|
|
50
|
+
"@storybook/addon-docs": "8.6.14",
|
|
51
51
|
"@storybook/addon-essentials": "^8.6.12",
|
|
52
52
|
"@storybook/addon-interactions": "^8.6.12",
|
|
53
53
|
"@storybook/addon-links": "^8.6.12",
|