1 line
7.8 KiB
JSON
1 line
7.8 KiB
JSON
|
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { useRef } from 'react';\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport { offset } from \"../../util\";\nimport Panel from \"./Panel\";\nvar Content = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var prefixCls = props.prefixCls,\n title = props.title,\n style = props.style,\n className = props.className,\n visible = props.visible,\n forceRender = props.forceRender,\n destroyOnClose = props.destroyOnClose,\n motionName = props.motionName,\n ariaId = props.ariaId,\n onVisibleChanged = props.onVisibleChanged,\n mousePosition = props.mousePosition;\n var dialogRef = useRef();\n\n // ============================= Style ==============================\n var _React$useState = React.useState(),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n transformOrigin = _React$useState2[0],\n setTransformOrigin = _React$useState2[1];\n var contentStyle = {};\n if (transformOrigin) {\n contentStyle.transformOrigin = transformOrigin;\n }\n function onPrepare() {\n var elementOffset = offset(dialogRef.current);\n setTransformOrigin(mousePosition && (mousePosition.x || mousePosition.y) ? \"\".concat(mousePosition.x - elementOffset.left, \"px \").concat(mousePosition.y - elementOffset.top, \"px\") : '');\n }\n\n // ============================= Render =============================\n return /*#__PURE__*/React.createElement(CSSMotion, {\n visible: visible,\n onVisibleChanged: onVisibleChanged,\n onAppearPrepare: onPrepare,\n onEnterPrepare: onPrepare,\n forceRender: forceRender,\n motionName: motionName,\n removeOnLeave: destroyOnClose,\n ref: dialogRef\n }, function (_ref, motionRef) {\n var motionClassName = _ref.className,\n motionStyle = _ref.style;\n return /*#__PURE__*/React.createElement(Panel, _extends({}, props, {\n ref: ref,\n title: title,\n ariaId: ariaId,\n prefixCls: prefixCls,\n holderRef: motionRef,\n style: _objectSpread(_objectSpread(_objectSpread({}, motionStyle), style), contentStyle),\n className: classNames(className, motionClassName)\n }));\n });\n});\nContent.displayName = 'Content';\nexport default Content;","map":{"version":3,"names":["_extends","_objectSpread","_slicedToArray","React","useRef","classNames","CSSMotion","offset","Panel","Content","forwardRef","props","ref","prefixCls","title","style","className","visible","forceRender","destroyOnClose","motionName","ariaId","onVisibleChanged","mousePosition","dialogRef","_React$useState","useState","_React$useState2","transformOrigin","setTransformOrigin","contentStyle","onPrepare","elementOffset","current","x","y","concat","left","top","createElement","onAppearPrepare","onEnterPrepare","removeOnLeave","_ref","motionRef","motionClassName","motionStyle","holderRef","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-dialog/es/Dialog/Content/index.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { useRef } from 'react';\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport { offset } from \"../../util\";\nimport Panel from \"./Panel\";\nvar Content = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var prefixCls = props.prefixCls,\n title = props.title,\n style = props.style,\n className = props.className,\n visible = props.visible,\n forceRender = props.forceRender,\n destroyOnClose = props.destroyOnClose,\n motionName = props.motionName,\n ariaId = props.ariaId,\n onVisibleChanged = props.onVisibleChanged,\n
|