562fcea4c62322b9212094e3ab69a9edf9f24dd4ac389873ea8aad43887e6ed1.json 13 KB

1
  1. {"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectDestructuringEmpty from \"@babel/runtime/helpers/esm/objectDestructuringEmpty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"className\", \"style\", \"motion\", \"motionNodes\", \"motionType\", \"onMotionStart\", \"onMotionEnd\", \"active\", \"treeNodeRequiredProps\"];\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport * as React from 'react';\nimport { TreeContext } from \"./contextTypes\";\nimport TreeNode from \"./TreeNode\";\nimport useUnmount from \"./useUnmount\";\nimport { getTreeNodeProps } from \"./utils/treeUtil\";\nvar MotionTreeNode = /*#__PURE__*/React.forwardRef(function (oriProps, ref) {\n var className = oriProps.className,\n style = oriProps.style,\n motion = oriProps.motion,\n motionNodes = oriProps.motionNodes,\n motionType = oriProps.motionType,\n onOriginMotionStart = oriProps.onMotionStart,\n onOriginMotionEnd = oriProps.onMotionEnd,\n active = oriProps.active,\n treeNodeRequiredProps = oriProps.treeNodeRequiredProps,\n props = _objectWithoutProperties(oriProps, _excluded);\n var _React$useState = React.useState(true),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n visible = _React$useState2[0],\n setVisible = _React$useState2[1];\n var _React$useContext = React.useContext(TreeContext),\n prefixCls = _React$useContext.prefixCls;\n\n // Calculate target visible here.\n // And apply in effect to make `leave` motion work.\n var targetVisible = motionNodes && motionType !== 'hide';\n useLayoutEffect(function () {\n if (motionNodes) {\n if (targetVisible !== visible) {\n setVisible(targetVisible);\n }\n }\n }, [motionNodes]);\n var triggerMotionStart = function triggerMotionStart() {\n if (motionNodes) {\n onOriginMotionStart();\n }\n };\n\n // Should only trigger once\n var triggerMotionEndRef = React.useRef(false);\n var triggerMotionEnd = function triggerMotionEnd() {\n if (motionNodes && !triggerMotionEndRef.current) {\n triggerMotionEndRef.current = true;\n onOriginMotionEnd();\n }\n };\n\n // Effect if unmount\n useUnmount(triggerMotionStart, triggerMotionEnd);\n\n // Motion end event\n var onVisibleChanged = function onVisibleChanged(nextVisible) {\n if (targetVisible === nextVisible) {\n triggerMotionEnd();\n }\n };\n if (motionNodes) {\n return /*#__PURE__*/React.createElement(CSSMotion, _extends({\n ref: ref,\n visible: visible\n }, motion, {\n motionAppear: motionType === 'show',\n onVisibleChanged: onVisibleChanged\n }), function (_ref, motionRef) {\n var motionClassName = _ref.className,\n motionStyle = _ref.style;\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: motionRef,\n className: classNames(\"\".concat(prefixCls, \"-treenode-motion\"), motionClassName),\n style: motionStyle\n }, motionNodes.map(function (treeNode) {\n var restProps = Object.assign({}, (_objectDestructuringEmpty(treeNode.data), treeNode.data)),\n title = treeNode.title,\n key = treeNode.key,\n isStart = treeNode.isStart,\n isEnd = treeNode.isEnd;\n delete restProps.children;\n var treeNodeProps = getTreeNodeProps(key, treeNodeRequiredProps);\n return /*#__PURE__*/React.createElement(TreeNode, _extends({}, restProps, treeNodeProps, {\n title: title,\n active: active,\n data: treeNode.data,\n key: key,\n isStart: isStart,\n isEnd: isEnd\n }));\n }));\n });\n }\n return /*#__PURE__*/React.createElement(TreeNode, _extends({\n domRef: ref,\n className: className,\n style: style\n }, props, {\n active: active\n }));\n});\nif (process.env.NODE_ENV !== 'production') {\n MotionTreeNode.displayName = 'MotionTreeNode';\n}\nexport default MotionTreeNode;","map":{"version":3,"names":["_extends","_objectDestructuringEmpty","_slicedToArray","_objectWithoutProperties","_excluded","classNames","CSSMotion","useLayoutEffect","React","TreeContext","TreeNode","useUnmount","getTreeNodeProps","MotionTreeNode","forwardRef","oriProps","ref","className","style","motion","motionNodes","motionType","onOriginMotionStart","onMotionStart","onOriginMotionEnd","onMotionEnd","active","treeNodeRequiredProps","props","_React$useState","useState","_React$useState2","visible","setVisible","_React$useContext","useContext","prefixCls","targetVisible","triggerMotionStart","triggerMotionEndRef","useRef","triggerMotionEnd","current","onVisibleChanged","nextVisible","createElement","motionAppear","_ref","motionRef","motionClassName","motionStyle","concat","map","treeNode","restProps","Object","assign","data","title","key","isStart","isEnd","children","treeNodeProps","domRef","process","env","NODE_ENV","displayName"],"sources":["/Users/max_liu/max_liu/company/tools_auto_pt/node_modules/rc-tree/es/MotionTreeNode.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectDestructuringEmpty from \"@babel/runtime/helpers/esm/objectDestructuringEmpty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"className\", \"style\", \"motion\", \"motionNodes\", \"motionType\", \"onMotionStart\", \"onMotionEnd\", \"active\", \"treeNodeRequiredProps\"];\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport * as React from 'react';\nimport { TreeContext } from \"./contextTypes\";\nimport TreeNode from \"./TreeNode\";\nimport useUnmount from \"./useUnmount\";\nimport { getTreeNodeProps } from \"./utils/treeUtil\";\nvar MotionTreeNode = /*#__PURE__*/React.forwardRef(function (oriProps, ref) {\n var className = oriProps.className,\n style = oriProps.style,\n motion = oriProps.motion,\n motionNodes = oriProps.motionNodes,\n motionType = oriProps.motionType,\n onOriginMotionStart = oriProps.onMotionStart,\n onOriginMotionEnd = oriProps.onMotionEnd,\n active = oriProps.active,\n treeNodeRequiredProps = oriProps.treeNodeRequiredProps,\n props = _objectWithoutProperties(oriProps, _excluded);\n var _React$useState = React.useState(true),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n visible = _React$useState2[0],\n setVisible = _React$useState2[1];\n var _React$useContext = React.useContext(TreeContext),\n prefixCls = _React$useContext.prefixCls;\n\n // Calculate target visible here.\n // And apply in effect to make `leave` motion work.\n var targetVisible = motionNodes && motionType !== 'hide';\n useLayoutEffect(function () {\n if (motionNodes) {\n if (targetVisible !== visible) {\n setVisible(targetVisible);\n }\n }\n }, [motionNodes]);\n var triggerMotionStart = function triggerMotionStart() {\n if (motionNodes) {\n onOriginMotionStart();\n }\n };\n\n // Should only trigger once\n var triggerMotionEndRef = React.useRef(false);\n var triggerMotionEnd = function triggerMotionEnd() {\n if (motionNodes && !triggerMotionEndRef.current) {\n triggerMotionEndRef.current = true;\n onOriginMotionEnd();\n }\n };\n\n // Effect if unmount\n useUnmount(triggerMotionStart, triggerMotionEnd);\n\n // Motion end event\n var onVisibleChanged = function onVisibleChanged(nextVisible) {\n if (targetVisible === nextVisible) {\n triggerMotionEnd();\n }\n };\n if (motionNodes) {\n return /*#__PURE__*/React.createElement(CSSMotion, _extends({\n ref: ref,\n visible: visible\n }, motion, {\n motionAppear: motionType === 'show',\n onVisibleChanged: onVisibleChanged\n }), function (_ref, motionRef) {\n var motionClassName = _ref.className,\n motionStyle = _ref.style;\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: motionRef,\n className: classNames(\"\".concat(prefixCls, \"-treenode-motion\"), motionClassName),\n style: motionStyle\n }, motionNodes.map(function (treeNode) {\n var restProps = Object.assign({}, (_objectDestructuringEmpty(treeNode.data), treeNode.data)),\n title = treeNode.title,\n key = treeNode.key,\n isStart = treeNode.isStart,\n isEnd = treeNode.isEnd;\n delete restProps.children;\n var treeNodeProps = getTreeNodeProps(key, treeNodeRequiredProps);\n return /*#__PURE__*/React.createElement(TreeNode, _extends({}, restProps, treeNodeProps, {\n title: title,\n active: active,\n data: treeNode.data,\n key: key,\n isStart: isStart,\n isEnd: isEnd\n }));\n }));\n });\n }\n return /*#__PURE__*/React.createElement(TreeNode, _extends({\n domRef: ref,\n className: className,\n style: style\n }, props, {\n active: active\n }));\n});\nif (process.env.NODE_ENV !== 'production') {\n MotionTreeNode.displayName = 'Mot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