@destyler/remove-scroll 0.2.11 → 0.2.12
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/dist/index.d.mts +2 -3
- package/dist/index.mjs +3 -4
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
//#region src/remove-scroll.d.ts
|
|
2
|
-
declare function preventBodyScroll(_document?: Document): (() => void) | undefined;
|
|
3
|
-
//#endregion
|
|
4
|
-
export { preventBodyScroll };
|
|
2
|
+
export declare function preventBodyScroll(_document?: Document): (() => void) | undefined;
|
|
3
|
+
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { isIos } from "@destyler/dom";
|
|
2
|
-
|
|
3
2
|
//#region src/remove-scroll.ts
|
|
4
3
|
const LOCK_CLASSNAME = "data-scroll-lock";
|
|
5
4
|
function assignStyle(el, style) {
|
|
6
5
|
if (!el) return;
|
|
7
6
|
const previousStyle = Object.keys(style).reduce((acc, key) => {
|
|
8
|
-
|
|
7
|
+
const property = key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
8
|
+
acc[key] = el.style.getPropertyValue(property);
|
|
9
9
|
return acc;
|
|
10
10
|
}, {});
|
|
11
11
|
Object.assign(el.style, style);
|
|
@@ -66,6 +66,5 @@ function preventBodyScroll(_document) {
|
|
|
66
66
|
body.removeAttribute(LOCK_CLASSNAME);
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
|
|
70
69
|
//#endregion
|
|
71
|
-
export { preventBodyScroll };
|
|
70
|
+
export { preventBodyScroll };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@destyler/remove-scroll",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.12",
|
|
5
5
|
"description": "remove scroll on body of UI machines",
|
|
6
6
|
"author": "Elone Hoo <elonehoo@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@destyler/dom": "0.2.
|
|
25
|
+
"@destyler/dom": "0.2.12"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|