54a2ae5812391a488d5f4d01bbe33680.json
3.58 KB
{"ast":null,"code":"import * as React from 'react';\nimport Tooltip from 'rc-tooltip';\nimport { composeRef } from \"rc-util/es/ref\";\nimport raf from \"rc-util/es/raf\";\nvar SliderTooltip = React.forwardRef(function (props, ref) {\n var visible = props.visible,\n overlay = props.overlay;\n var innerRef = React.useRef(null);\n var tooltipRef = composeRef(ref, innerRef);\n var rafRef = React.useRef(null);\n\n function cancelKeepAlign() {\n raf.cancel(rafRef.current);\n }\n\n function keepAlign() {\n rafRef.current = raf(function () {\n var _innerRef$current;\n\n (_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.forcePopupAlign();\n });\n }\n\n React.useEffect(function () {\n if (visible) {\n keepAlign();\n } else {\n cancelKeepAlign();\n }\n\n return cancelKeepAlign;\n }, [visible, overlay]);\n return React.createElement(Tooltip, Object.assign({\n ref: tooltipRef\n }, props));\n});\nexport default SliderTooltip;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-slider/es/common/SliderTooltip.js"],"names":["React","Tooltip","composeRef","raf","SliderTooltip","forwardRef","props","ref","visible","overlay","innerRef","useRef","tooltipRef","rafRef","cancelKeepAlign","cancel","current","keepAlign","_innerRef$current","forcePopupAlign","useEffect","createElement","Object","assign"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,SAASC,UAAT,QAA2B,gBAA3B;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,IAAIC,aAAa,GAAGJ,KAAK,CAACK,UAAN,CAAiB,UAAUC,KAAV,EAAiBC,GAAjB,EAAsB;AACzD,MAAIC,OAAO,GAAGF,KAAK,CAACE,OAApB;AAAA,MACIC,OAAO,GAAGH,KAAK,CAACG,OADpB;AAEA,MAAIC,QAAQ,GAAGV,KAAK,CAACW,MAAN,CAAa,IAAb,CAAf;AACA,MAAIC,UAAU,GAAGV,UAAU,CAACK,GAAD,EAAMG,QAAN,CAA3B;AACA,MAAIG,MAAM,GAAGb,KAAK,CAACW,MAAN,CAAa,IAAb,CAAb;;AAEA,WAASG,eAAT,GAA2B;AACzBX,IAAAA,GAAG,CAACY,MAAJ,CAAWF,MAAM,CAACG,OAAlB;AACD;;AAED,WAASC,SAAT,GAAqB;AACnBJ,IAAAA,MAAM,CAACG,OAAP,GAAiBb,GAAG,CAAC,YAAY;AAC/B,UAAIe,iBAAJ;;AAEA,OAACA,iBAAiB,GAAGR,QAAQ,CAACM,OAA9B,MAA2C,IAA3C,IAAmDE,iBAAiB,KAAK,KAAK,CAA9E,GAAkF,KAAK,CAAvF,GAA2FA,iBAAiB,CAACC,eAAlB,EAA3F;AACD,KAJmB,CAApB;AAKD;;AAEDnB,EAAAA,KAAK,CAACoB,SAAN,CAAgB,YAAY;AAC1B,QAAIZ,OAAJ,EAAa;AACXS,MAAAA,SAAS;AACV,KAFD,MAEO;AACLH,MAAAA,eAAe;AAChB;;AAED,WAAOA,eAAP;AACD,GARD,EAQG,CAACN,OAAD,EAAUC,OAAV,CARH;AASA,SAAOT,KAAK,CAACqB,aAAN,CAAoBpB,OAApB,EAA6BqB,MAAM,CAACC,MAAP,CAAc;AAChDhB,IAAAA,GAAG,EAAEK;AAD2C,GAAd,EAEjCN,KAFiC,CAA7B,CAAP;AAGD,CA/BmB,CAApB;AAgCA,eAAeF,aAAf","sourcesContent":["import * as React from 'react';\nimport Tooltip from 'rc-tooltip';\nimport { composeRef } from \"rc-util/es/ref\";\nimport raf from \"rc-util/es/raf\";\nvar SliderTooltip = React.forwardRef(function (props, ref) {\n var visible = props.visible,\n overlay = props.overlay;\n var innerRef = React.useRef(null);\n var tooltipRef = composeRef(ref, innerRef);\n var rafRef = React.useRef(null);\n\n function cancelKeepAlign() {\n raf.cancel(rafRef.current);\n }\n\n function keepAlign() {\n rafRef.current = raf(function () {\n var _innerRef$current;\n\n (_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.forcePopupAlign();\n });\n }\n\n React.useEffect(function () {\n if (visible) {\n keepAlign();\n } else {\n cancelKeepAlign();\n }\n\n return cancelKeepAlign;\n }, [visible, overlay]);\n return React.createElement(Tooltip, Object.assign({\n ref: tooltipRef\n }, props));\n});\nexport default SliderTooltip;"]},"metadata":{},"sourceType":"module"}