72766e3ed67b52e3a2210b2a5caf45c7.json
6.05 KB
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport { useState, useEffect } from 'react';\nimport isMobile from \"rc-util/es/isMobile\";\nimport Mask from './Mask';\nimport PopupInner from './PopupInner';\nimport MobilePopupInner from './MobilePopupInner';\nvar Popup = React.forwardRef(function (_ref, ref) {\n var visible = _ref.visible,\n mobile = _ref.mobile,\n props = _objectWithoutProperties(_ref, [\"visible\", \"mobile\"]);\n\n var _useState = useState(visible),\n _useState2 = _slicedToArray(_useState, 2),\n innerVisible = _useState2[0],\n serInnerVisible = _useState2[1];\n\n var _useState3 = useState(false),\n _useState4 = _slicedToArray(_useState3, 2),\n inMobile = _useState4[0],\n setInMobile = _useState4[1];\n\n var cloneProps = _objectSpread(_objectSpread({}, props), {}, {\n visible: innerVisible\n }); // We check mobile in visible changed here.\n // And this also delay set `innerVisible` to avoid popup component render flash\n\n\n useEffect(function () {\n serInnerVisible(visible);\n\n if (visible && mobile) {\n setInMobile(isMobile());\n }\n }, [visible, !!mobile]);\n var popupNode = inMobile ? React.createElement(MobilePopupInner, Object.assign({}, cloneProps, {\n mobile: mobile,\n ref: ref\n })) : React.createElement(PopupInner, Object.assign({}, cloneProps, {\n ref: ref\n })); // We can use fragment directly but this may failed some selector usage. Keep as origin logic\n\n return React.createElement(\"div\", null, React.createElement(Mask, Object.assign({}, cloneProps)), popupNode);\n});\nPopup.displayName = 'Popup';\nexport default Popup;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-trigger/es/Popup/index.js"],"names":["_objectSpread","_slicedToArray","_objectWithoutProperties","React","useState","useEffect","isMobile","Mask","PopupInner","MobilePopupInner","Popup","forwardRef","_ref","ref","visible","mobile","props","_useState","_useState2","innerVisible","serInnerVisible","_useState3","_useState4","inMobile","setInMobile","cloneProps","popupNode","createElement","Object","assign","displayName"],"mappings":"AAAA,OAAOA,aAAP,MAA0B,0CAA1B;AACA,OAAOC,cAAP,MAA2B,0CAA3B;AACA,OAAOC,wBAAP,MAAqC,oDAArC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,OAApC;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;AACA,IAAIC,KAAK,GAAGP,KAAK,CAACQ,UAAN,CAAiB,UAAUC,IAAV,EAAgBC,GAAhB,EAAqB;AAChD,MAAIC,OAAO,GAAGF,IAAI,CAACE,OAAnB;AAAA,MACIC,MAAM,GAAGH,IAAI,CAACG,MADlB;AAAA,MAEIC,KAAK,GAAGd,wBAAwB,CAACU,IAAD,EAAO,CAAC,SAAD,EAAY,QAAZ,CAAP,CAFpC;;AAIA,MAAIK,SAAS,GAAGb,QAAQ,CAACU,OAAD,CAAxB;AAAA,MACII,UAAU,GAAGjB,cAAc,CAACgB,SAAD,EAAY,CAAZ,CAD/B;AAAA,MAEIE,YAAY,GAAGD,UAAU,CAAC,CAAD,CAF7B;AAAA,MAGIE,eAAe,GAAGF,UAAU,CAAC,CAAD,CAHhC;;AAKA,MAAIG,UAAU,GAAGjB,QAAQ,CAAC,KAAD,CAAzB;AAAA,MACIkB,UAAU,GAAGrB,cAAc,CAACoB,UAAD,EAAa,CAAb,CAD/B;AAAA,MAEIE,QAAQ,GAAGD,UAAU,CAAC,CAAD,CAFzB;AAAA,MAGIE,WAAW,GAAGF,UAAU,CAAC,CAAD,CAH5B;;AAKA,MAAIG,UAAU,GAAGzB,aAAa,CAACA,aAAa,CAAC,EAAD,EAAKgB,KAAL,CAAd,EAA2B,EAA3B,EAA+B;AAC3DF,IAAAA,OAAO,EAAEK;AADkD,GAA/B,CAA9B,CAfgD,CAiB5C;AACJ;;;AAGAd,EAAAA,SAAS,CAAC,YAAY;AACpBe,IAAAA,eAAe,CAACN,OAAD,CAAf;;AAEA,QAAIA,OAAO,IAAIC,MAAf,EAAuB;AACrBS,MAAAA,WAAW,CAAClB,QAAQ,EAAT,CAAX;AACD;AACF,GANQ,EAMN,CAACQ,OAAD,EAAU,CAAC,CAACC,MAAZ,CANM,CAAT;AAOA,MAAIW,SAAS,GAAGH,QAAQ,GAAGpB,KAAK,CAACwB,aAAN,CAAoBlB,gBAApB,EAAsCmB,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBJ,UAAlB,EAA8B;AAC7FV,IAAAA,MAAM,EAAEA,MADqF;AAE7FF,IAAAA,GAAG,EAAEA;AAFwF,GAA9B,CAAtC,CAAH,GAGlBV,KAAK,CAACwB,aAAN,CAAoBnB,UAApB,EAAgCoB,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBJ,UAAlB,EAA8B;AAClEZ,IAAAA,GAAG,EAAEA;AAD6D,GAA9B,CAAhC,CAHN,CA5BgD,CAiC3C;;AAEL,SAAOV,KAAK,CAACwB,aAAN,CAAoB,KAApB,EAA2B,IAA3B,EAAiCxB,KAAK,CAACwB,aAAN,CAAoBpB,IAApB,EAA0BqB,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBJ,UAAlB,CAA1B,CAAjC,EAA2FC,SAA3F,CAAP;AACD,CApCW,CAAZ;AAqCAhB,KAAK,CAACoB,WAAN,GAAoB,OAApB;AACA,eAAepB,KAAf","sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport { useState, useEffect } from 'react';\nimport isMobile from \"rc-util/es/isMobile\";\nimport Mask from './Mask';\nimport PopupInner from './PopupInner';\nimport MobilePopupInner from './MobilePopupInner';\nvar Popup = React.forwardRef(function (_ref, ref) {\n var visible = _ref.visible,\n mobile = _ref.mobile,\n props = _objectWithoutProperties(_ref, [\"visible\", \"mobile\"]);\n\n var _useState = useState(visible),\n _useState2 = _slicedToArray(_useState, 2),\n innerVisible = _useState2[0],\n serInnerVisible = _useState2[1];\n\n var _useState3 = useState(false),\n _useState4 = _slicedToArray(_useState3, 2),\n inMobile = _useState4[0],\n setInMobile = _useState4[1];\n\n var cloneProps = _objectSpread(_objectSpread({}, props), {}, {\n visible: innerVisible\n }); // We check mobile in visible changed here.\n // And this also delay set `innerVisible` to avoid popup component render flash\n\n\n useEffect(function () {\n serInnerVisible(visible);\n\n if (visible && mobile) {\n setInMobile(isMobile());\n }\n }, [visible, !!mobile]);\n var popupNode = inMobile ? React.createElement(MobilePopupInner, Object.assign({}, cloneProps, {\n mobile: mobile,\n ref: ref\n })) : React.createElement(PopupInner, Object.assign({}, cloneProps, {\n ref: ref\n })); // We can use fragment directly but this may failed some selector usage. Keep as origin logic\n\n return React.createElement(\"div\", null, React.createElement(Mask, Object.assign({}, cloneProps)), popupNode);\n});\nPopup.displayName = 'Popup';\nexport default Popup;"]},"metadata":{},"sourceType":"module"}