1f25943f70e331f870d88ddc2097dd0e.json
3.85 KB
{"ast":null,"code":"import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport * as React from 'react';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\"; // fix ssr render\n\nvar defaultContainer = canUseDom() ? window : null;\n/** Sticky header hooks */\n\nexport default function useSticky(sticky, prefixCls) {\n var _ref = _typeof(sticky) === 'object' ? sticky : {},\n _ref$offsetHeader = _ref.offsetHeader,\n offsetHeader = _ref$offsetHeader === void 0 ? 0 : _ref$offsetHeader,\n _ref$offsetScroll = _ref.offsetScroll,\n offsetScroll = _ref$offsetScroll === void 0 ? 0 : _ref$offsetScroll,\n _ref$getContainer = _ref.getContainer,\n getContainer = _ref$getContainer === void 0 ? function () {\n return defaultContainer;\n } : _ref$getContainer;\n\n var container = getContainer() || defaultContainer;\n return React.useMemo(function () {\n var isSticky = !!sticky;\n return {\n isSticky: isSticky,\n stickyClassName: isSticky ? \"\".concat(prefixCls, \"-sticky-header\") : '',\n offsetHeader: offsetHeader,\n offsetScroll: offsetScroll,\n container: container\n };\n }, [offsetScroll, offsetHeader, prefixCls, container]);\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-table/es/hooks/useSticky.js"],"names":["_typeof","React","canUseDom","defaultContainer","window","useSticky","sticky","prefixCls","_ref","_ref$offsetHeader","offsetHeader","_ref$offsetScroll","offsetScroll","_ref$getContainer","getContainer","container","useMemo","isSticky","stickyClassName","concat"],"mappings":"AAAA,OAAOA,OAAP,MAAoB,mCAApB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,SAAP,MAAsB,0BAAtB,C,CAAkD;;AAElD,IAAIC,gBAAgB,GAAGD,SAAS,KAAKE,MAAL,GAAc,IAA9C;AACA;;AAEA,eAAe,SAASC,SAAT,CAAmBC,MAAnB,EAA2BC,SAA3B,EAAsC;AACnD,MAAIC,IAAI,GAAGR,OAAO,CAACM,MAAD,CAAP,KAAoB,QAApB,GAA+BA,MAA/B,GAAwC,EAAnD;AAAA,MACIG,iBAAiB,GAAGD,IAAI,CAACE,YAD7B;AAAA,MAEIA,YAAY,GAAGD,iBAAiB,KAAK,KAAK,CAA3B,GAA+B,CAA/B,GAAmCA,iBAFtD;AAAA,MAGIE,iBAAiB,GAAGH,IAAI,CAACI,YAH7B;AAAA,MAIIA,YAAY,GAAGD,iBAAiB,KAAK,KAAK,CAA3B,GAA+B,CAA/B,GAAmCA,iBAJtD;AAAA,MAKIE,iBAAiB,GAAGL,IAAI,CAACM,YAL7B;AAAA,MAMIA,YAAY,GAAGD,iBAAiB,KAAK,KAAK,CAA3B,GAA+B,YAAY;AAC5D,WAAOV,gBAAP;AACD,GAFkB,GAEfU,iBARJ;;AAUA,MAAIE,SAAS,GAAGD,YAAY,MAAMX,gBAAlC;AACA,SAAOF,KAAK,CAACe,OAAN,CAAc,YAAY;AAC/B,QAAIC,QAAQ,GAAG,CAAC,CAACX,MAAjB;AACA,WAAO;AACLW,MAAAA,QAAQ,EAAEA,QADL;AAELC,MAAAA,eAAe,EAAED,QAAQ,GAAG,GAAGE,MAAH,CAAUZ,SAAV,EAAqB,gBAArB,CAAH,GAA4C,EAFhE;AAGLG,MAAAA,YAAY,EAAEA,YAHT;AAILE,MAAAA,YAAY,EAAEA,YAJT;AAKLG,MAAAA,SAAS,EAAEA;AALN,KAAP;AAOD,GATM,EASJ,CAACH,YAAD,EAAeF,YAAf,EAA6BH,SAA7B,EAAwCQ,SAAxC,CATI,CAAP;AAUD","sourcesContent":["import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport * as React from 'react';\nimport canUseDom from \"rc-util/es/Dom/canUseDom\"; // fix ssr render\n\nvar defaultContainer = canUseDom() ? window : null;\n/** Sticky header hooks */\n\nexport default function useSticky(sticky, prefixCls) {\n var _ref = _typeof(sticky) === 'object' ? sticky : {},\n _ref$offsetHeader = _ref.offsetHeader,\n offsetHeader = _ref$offsetHeader === void 0 ? 0 : _ref$offsetHeader,\n _ref$offsetScroll = _ref.offsetScroll,\n offsetScroll = _ref$offsetScroll === void 0 ? 0 : _ref$offsetScroll,\n _ref$getContainer = _ref.getContainer,\n getContainer = _ref$getContainer === void 0 ? function () {\n return defaultContainer;\n } : _ref$getContainer;\n\n var container = getContainer() || defaultContainer;\n return React.useMemo(function () {\n var isSticky = !!sticky;\n return {\n isSticky: isSticky,\n stickyClassName: isSticky ? \"\".concat(prefixCls, \"-sticky-header\") : '',\n offsetHeader: offsetHeader,\n offsetScroll: offsetScroll,\n container: container\n };\n }, [offsetScroll, offsetHeader, prefixCls, container]);\n}"]},"metadata":{},"sourceType":"module"}