@lotte-innovate/ui-component-test 0.0.150 → 0.0.151
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/components/Tree/index.js +0 -1
- package/dist/lib/components/Tree/index.mjs.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/lib/utils/useWindowSize.js +2 -1
- package/dist/lib/utils/useWindowSize.mjs +1 -1
- package/dist/lib/utils/useWindowSize.mjs.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -9,7 +9,8 @@ export function useWindowSize() {
|
|
9
9
|
width = Math.min(width, 300);
|
10
10
|
setSize(width);
|
11
11
|
}
|
12
|
-
|
12
|
+
if (typeof window !== undefined)
|
13
|
+
window.addEventListener('resize', handleResize);
|
13
14
|
handleResize();
|
14
15
|
return function () { return window.removeEventListener('resize', handleResize); };
|
15
16
|
}, []);
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{useState as n,useEffect as e}from"react";function r(){var r=n(250),t=r[0],i=r[1];return e((function(){function n(){var n=130+.15*window.innerWidth;n=Math.max(n,250),n=Math.min(n,300),i(n)}return window.addEventListener("resize",n),n(),function(){return window.removeEventListener("resize",n)}}),[]),t}export{r as useWindowSize};
|
1
|
+
import{useState as n,useEffect as e}from"react";function r(){var r=n(250),t=r[0],i=r[1];return e((function(){function n(){var n=130+.15*window.innerWidth;n=Math.max(n,250),n=Math.min(n,300),i(n)}return void 0!==typeof window&&window.addEventListener("resize",n),n(),function(){return window.removeEventListener("resize",n)}}),[]),t}export{r as useWindowSize};
|
2
2
|
//# sourceMappingURL=useWindowSize.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useWindowSize.mjs","sources":["../../lib/utils/useWindowSize.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nvar MIN_SIZE = 250;\nexport function useWindowSize() {\n var _a = useState(MIN_SIZE), size = _a[0], setSize = _a[1];\n useEffect(function () {\n function handleResize() {\n var width = 130 + window.innerWidth * 0.15;\n width = Math.max(width, MIN_SIZE);\n width = Math.min(width, 300);\n setSize(width);\n }\n window.addEventListener('resize', handleResize);\n handleResize();\n return function () { return window.removeEventListener('resize', handleResize); };\n }, []);\n return size;\n}\n"],"names":["useWindowSize","_a","useState","size","setSize","useEffect","handleResize","width","window","innerWidth","Math","max","min","addEventListener","removeEventListener"],"mappings":"gDAEO,SAASA,IACZ,IAAIC,EAAKC,EAFE,KAEkBC,EAAOF,EAAG,GAAIG,EAAUH,EAAG,
|
1
|
+
{"version":3,"file":"useWindowSize.mjs","sources":["../../lib/utils/useWindowSize.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nvar MIN_SIZE = 250;\nexport function useWindowSize() {\n var _a = useState(MIN_SIZE), size = _a[0], setSize = _a[1];\n useEffect(function () {\n function handleResize() {\n var width = 130 + window.innerWidth * 0.15;\n width = Math.max(width, MIN_SIZE);\n width = Math.min(width, 300);\n setSize(width);\n }\n if (typeof window !== undefined)\n window.addEventListener('resize', handleResize);\n handleResize();\n return function () { return window.removeEventListener('resize', handleResize); };\n }, []);\n return size;\n}\n"],"names":["useWindowSize","_a","useState","size","setSize","useEffect","handleResize","width","window","innerWidth","Math","max","min","undefined","addEventListener","removeEventListener"],"mappings":"gDAEO,SAASA,IACZ,IAAIC,EAAKC,EAFE,KAEkBC,EAAOF,EAAG,GAAIG,EAAUH,EAAG,GAaxD,OAZAI,GAAU,WACN,SAASC,IACL,IAAIC,EAAQ,IAA0B,IAApBC,OAAOC,WACzBF,EAAQG,KAAKC,IAAIJ,EANd,KAOHA,EAAQG,KAAKE,IAAIL,EAAO,KACxBH,EAAQG,EACX,CAID,YAHsBM,WAAXL,QACPA,OAAOM,iBAAiB,SAAUR,GACtCA,IACO,WAAc,OAAOE,OAAOO,oBAAoB,SAAUT,GACpE,GAAE,IACIH,CACX"}
|