a9e7d2403357b2f97900969953f1ba4b.json 7.08 KB
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport * as React from 'react';\nimport CSSMotion from 'rc-motion';\nimport classNames from 'classnames';\nvar MobilePopupInner = React.forwardRef(function (props, ref) {\n  var prefixCls = props.prefixCls,\n      visible = props.visible,\n      zIndex = props.zIndex,\n      children = props.children,\n      _props$mobile = props.mobile;\n  _props$mobile = _props$mobile === void 0 ? {} : _props$mobile;\n  var popupClassName = _props$mobile.popupClassName,\n      popupStyle = _props$mobile.popupStyle,\n      _props$mobile$popupMo = _props$mobile.popupMotion,\n      popupMotion = _props$mobile$popupMo === void 0 ? {} : _props$mobile$popupMo,\n      popupRender = _props$mobile.popupRender;\n  var elementRef = React.useRef(); // ========================= Refs =========================\n\n  React.useImperativeHandle(ref, function () {\n    return {\n      forceAlign: function forceAlign() {},\n      getElement: function getElement() {\n        return elementRef.current;\n      }\n    };\n  }); // ======================== Render ========================\n\n  var mergedStyle = _objectSpread({\n    zIndex: zIndex\n  }, popupStyle);\n\n  var childNode = children; // Wrapper when multiple children\n\n  if (React.Children.count(children) > 1) {\n    childNode = React.createElement(\"div\", {\n      className: \"\".concat(prefixCls, \"-content\")\n    }, children);\n  } // Mobile support additional render\n\n\n  if (popupRender) {\n    childNode = popupRender(childNode);\n  }\n\n  return React.createElement(CSSMotion, Object.assign({\n    visible: visible,\n    ref: elementRef,\n    removeOnLeave: true\n  }, popupMotion), function (_ref, motionRef) {\n    var motionClassName = _ref.className,\n        motionStyle = _ref.style;\n    var mergedClassName = classNames(prefixCls, popupClassName, motionClassName);\n    return React.createElement(\"div\", {\n      ref: motionRef,\n      className: mergedClassName,\n      style: _objectSpread(_objectSpread({}, motionStyle), mergedStyle)\n    }, childNode);\n  });\n});\nMobilePopupInner.displayName = 'MobilePopupInner';\nexport default MobilePopupInner;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-trigger/es/Popup/MobilePopupInner.js"],"names":["_objectSpread","React","CSSMotion","classNames","MobilePopupInner","forwardRef","props","ref","prefixCls","visible","zIndex","children","_props$mobile","mobile","popupClassName","popupStyle","_props$mobile$popupMo","popupMotion","popupRender","elementRef","useRef","useImperativeHandle","forceAlign","getElement","current","mergedStyle","childNode","Children","count","createElement","className","concat","Object","assign","removeOnLeave","_ref","motionRef","motionClassName","motionStyle","style","mergedClassName","displayName"],"mappings":"AAAA,OAAOA,aAAP,MAA0B,0CAA1B;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,SAAP,MAAsB,WAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,IAAIC,gBAAgB,GAAGH,KAAK,CAACI,UAAN,CAAiB,UAAUC,KAAV,EAAiBC,GAAjB,EAAsB;AAC5D,MAAIC,SAAS,GAAGF,KAAK,CAACE,SAAtB;AAAA,MACIC,OAAO,GAAGH,KAAK,CAACG,OADpB;AAAA,MAEIC,MAAM,GAAGJ,KAAK,CAACI,MAFnB;AAAA,MAGIC,QAAQ,GAAGL,KAAK,CAACK,QAHrB;AAAA,MAIIC,aAAa,GAAGN,KAAK,CAACO,MAJ1B;AAKAD,EAAAA,aAAa,GAAGA,aAAa,KAAK,KAAK,CAAvB,GAA2B,EAA3B,GAAgCA,aAAhD;AACA,MAAIE,cAAc,GAAGF,aAAa,CAACE,cAAnC;AAAA,MACIC,UAAU,GAAGH,aAAa,CAACG,UAD/B;AAAA,MAEIC,qBAAqB,GAAGJ,aAAa,CAACK,WAF1C;AAAA,MAGIA,WAAW,GAAGD,qBAAqB,KAAK,KAAK,CAA/B,GAAmC,EAAnC,GAAwCA,qBAH1D;AAAA,MAIIE,WAAW,GAAGN,aAAa,CAACM,WAJhC;AAKA,MAAIC,UAAU,GAAGlB,KAAK,CAACmB,MAAN,EAAjB,CAZ4D,CAY3B;;AAEjCnB,EAAAA,KAAK,CAACoB,mBAAN,CAA0Bd,GAA1B,EAA+B,YAAY;AACzC,W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SAD2B;AAEhCN,MAAAA,SAAS,EAAEU,eAFqB;AAGhCD,MAAAA,KAAK,EAAEvC,aAAa,CAACA,aAAa,CAAC,EAAD,EAAKsC,WAAL,CAAd,EAAiCb,WAAjC;AAHY,KAA3B,EAIJC,SAJI,CAAP;AAKD,GAbM,CAAP;AAcD,CAtDsB,CAAvB;AAuDAtB,gBAAgB,CAACqC,WAAjB,GAA+B,kBAA/B;AACA,eAAerC,gBAAf","sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport * as React from 'react';\nimport CSSMotion from 'rc-motion';\nimport classNames from 'classnames';\nvar MobilePopupInner = React.forwardRef(function (props, ref) {\n  var prefixCls = props.prefixCls,\n      visible = props.visible,\n      zIndex = props.zIndex,\n      children = props.children,\n      _props$mobile = props.mobile;\n  _props$mobile = _props$mobile === void 0 ? {} : _props$mobile;\n  var popupClassName = _props$mobile.popupClassName,\n      popupStyle = _props$mobile.popupStyle,\n      _props$mobile$popupMo = _props$mobile.popupMotion,\n      popupMotion = _props$mobile$popupMo === void 0 ? {} : _props$mobile$popupMo,\n      popupRender = _props$mobile.popupRender;\n  var elementRef = React.useRef(); // ========================= Refs =========================\n\n  React.useImperativeHandle(ref, function () {\n    return {\n      forceAlign: function forceAlign() {},\n      getElement: function getElement() {\n        return elementRef.current;\n      }\n    };\n  }); // ======================== Render ========================\n\n  var mergedStyle = _objectSpread({\n    zIndex: zIndex\n  }, popupStyle);\n\n  var childNode = children; // Wrapper when multiple children\n\n  if (React.Children.count(children) > 1) {\n    childNode = React.createElement(\"div\", {\n      className: \"\".concat(prefixCls, \"-content\")\n    }, children);\n  } // Mobile support additional render\n\n\n  if (popupRender) {\n    childNode = popupRender(childNode);\n  }\n\n  return React.createElement(CSSMotion, Object.assign({\n    visible: visible,\n    ref: elementRef,\n    removeOnLeave: true\n  }, popupMotion), function (_ref, motionRef) {\n    var motionClassName = _ref.className,\n        motionStyle = _ref.style;\n    var mergedClassName = classNames(prefixCls, popupClassName, motionClassName);\n    return React.createElement(\"div\", {\n      ref: motionRef,\n      className: mergedClassName,\n      style: _objectSpread(_objectSpread({}, motionStyle), mergedStyle)\n    }, childNode);\n  });\n});\nMobilePopupInner.displayName = 'MobilePopupInner';\nexport default MobilePopupInner;"]},"metadata":{},"sourceType":"module"}