ca9e15be92d8632803a6e05dada12437.json 3.44 KB
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from 'react';\nimport { useRef } from 'react';\nimport { composeRef } from \"rc-util/es/ref\";\nimport raf from \"rc-util/es/raf\";\nimport Tooltip from '../tooltip';\nvar SliderTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var visible = props.visible;\n  var innerRef = useRef(null);\n  var rafRef = useRef(null);\n\n  function cancelKeepAlign() {\n    raf.cancel(rafRef.current);\n    rafRef.current = null;\n  }\n\n  function keepAlign() {\n    rafRef.current = raf(function () {\n      innerRef.current.forcePopupAlign();\n      rafRef.current = null;\n      keepAlign();\n    });\n  }\n\n  React.useEffect(function () {\n    if (visible) {\n      keepAlign();\n    } else {\n      cancelKeepAlign();\n    }\n\n    return cancelKeepAlign;\n  }, [visible]);\n  return /*#__PURE__*/React.createElement(Tooltip, _extends({\n    ref: composeRef(innerRef, ref)\n  }, props));\n});\nexport default SliderTooltip;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/slider/SliderTooltip.js"],"names":["_extends","React","useRef","composeRef","raf","Tooltip","SliderTooltip","forwardRef","props","ref","visible","innerRef","rafRef","cancelKeepAlign","cancel","current","keepAlign","forcePopupAlign","useEffect","createElement"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,gCAArB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,MAAT,QAAuB,OAAvB;AACA,SAASC,UAAT,QAA2B,gBAA3B;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,IAAIC,aAAa,GAAG,aAAaL,KAAK,CAACM,UAAN,CAAiB,UAAUC,KAAV,EAAiBC,GAAjB,EAAsB;AACtE,MAAIC,OAAO,GAAGF,KAAK,CAACE,OAApB;AACA,MAAIC,QAAQ,GAAGT,MAAM,CAAC,IAAD,CAArB;AACA,MAAIU,MAAM,GAAGV,MAAM,CAAC,IAAD,CAAnB;;AAEA,WAASW,eAAT,GAA2B;AACzBT,IAAAA,GAAG,CAACU,MAAJ,CAAWF,MAAM,CAACG,OAAlB;AACAH,IAAAA,MAAM,CAACG,OAAP,GAAiB,IAAjB;AACD;;AAED,WAASC,SAAT,GAAqB;AACnBJ,IAAAA,MAAM,CAACG,OAAP,GAAiBX,GAAG,CAAC,YAAY;AAC/BO,MAAAA,QAAQ,CAACI,OAAT,CAAiBE,eAAjB;AACAL,MAAAA,MAAM,CAACG,OAAP,GAAiB,IAAjB;AACAC,MAAAA,SAAS;AACV,KAJmB,CAApB;AAKD;;AAEDf,EAAAA,KAAK,CAACiB,SAAN,CAAgB,YAAY;AAC1B,QAAIR,OAAJ,EAAa;AACXM,MAAAA,SAAS;AACV,KAFD,MAEO;AACLH,MAAAA,eAAe;AAChB;;AAED,WAAOA,eAAP;AACD,GARD,EAQG,CAACH,OAAD,CARH;AASA,SAAO,aAAaT,KAAK,CAACkB,aAAN,CAAoBd,OAApB,EAA6BL,QAAQ,CAAC;AACxDS,IAAAA,GAAG,EAAEN,UAAU,CAACQ,QAAD,EAAWF,GAAX;AADyC,GAAD,EAEtDD,KAFsD,CAArC,CAApB;AAGD,CA9BgC,CAAjC;AA+BA,eAAeF,aAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from 'react';\nimport { useRef } from 'react';\nimport { composeRef } from \"rc-util/es/ref\";\nimport raf from \"rc-util/es/raf\";\nimport Tooltip from '../tooltip';\nvar SliderTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var visible = props.visible;\n  var innerRef = useRef(null);\n  var rafRef = useRef(null);\n\n  function cancelKeepAlign() {\n    raf.cancel(rafRef.current);\n    rafRef.current = null;\n  }\n\n  function keepAlign() {\n    rafRef.current = raf(function () {\n      innerRef.current.forcePopupAlign();\n      rafRef.current = null;\n      keepAlign();\n    });\n  }\n\n  React.useEffect(function () {\n    if (visible) {\n      keepAlign();\n    } else {\n      cancelKeepAlign();\n    }\n\n    return cancelKeepAlign;\n  }, [visible]);\n  return /*#__PURE__*/React.createElement(Tooltip, _extends({\n    ref: composeRef(innerRef, ref)\n  }, props));\n});\nexport default SliderTooltip;"]},"metadata":{},"sourceType":"module"}