PromoCursed/node_modules/.cache/babel-loader/f9ab6e726fd59c3a6566f081420d5f8a82e58d84d5be09087282da9f2e712d81.json
2024-08-20 23:25:37 +04:00

1 line
9.2 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 CSSMotion from 'rc-motion';\nimport { getMotion } from \"../utils/motionUtil\";\nimport MenuContextProvider, { MenuContext } from \"../context/MenuContext\";\nimport SubMenuList from \"./SubMenuList\";\nexport default function InlineSubMenuList(_ref) {\n var id = _ref.id,\n open = _ref.open,\n keyPath = _ref.keyPath,\n children = _ref.children;\n var fixedMode = 'inline';\n var _React$useContext = React.useContext(MenuContext),\n prefixCls = _React$useContext.prefixCls,\n forceSubMenuRender = _React$useContext.forceSubMenuRender,\n motion = _React$useContext.motion,\n defaultMotions = _React$useContext.defaultMotions,\n mode = _React$useContext.mode;\n\n // Always use latest mode check\n var sameModeRef = React.useRef(false);\n sameModeRef.current = mode === fixedMode;\n\n // We record `destroy` mark here since when mode change from `inline` to others.\n // The inline list should remove when motion end.\n var _React$useState = React.useState(!sameModeRef.current),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n destroy = _React$useState2[0],\n setDestroy = _React$useState2[1];\n var mergedOpen = sameModeRef.current ? open : false;\n\n // ================================= Effect =================================\n // Reset destroy state when mode change back\n React.useEffect(function () {\n if (sameModeRef.current) {\n setDestroy(false);\n }\n }, [mode]);\n\n // ================================= Render =================================\n var mergedMotion = _objectSpread({}, getMotion(fixedMode, motion, defaultMotions));\n\n // No need appear since nest inlineCollapse changed\n if (keyPath.length > 1) {\n mergedMotion.motionAppear = false;\n }\n\n // Hide inline list when mode changed and motion end\n var originOnVisibleChanged = mergedMotion.onVisibleChanged;\n mergedMotion.onVisibleChanged = function (newVisible) {\n if (!sameModeRef.current && !newVisible) {\n setDestroy(true);\n }\n return originOnVisibleChanged === null || originOnVisibleChanged === void 0 ? void 0 : originOnVisibleChanged(newVisible);\n };\n if (destroy) {\n return null;\n }\n return /*#__PURE__*/React.createElement(MenuContextProvider, {\n mode: fixedMode,\n locked: !sameModeRef.current\n }, /*#__PURE__*/React.createElement(CSSMotion, _extends({\n visible: mergedOpen\n }, mergedMotion, {\n forceRender: forceSubMenuRender,\n removeOnLeave: false,\n leavedClassName: \"\".concat(prefixCls, \"-hidden\")\n }), function (_ref2) {\n var motionClassName = _ref2.className,\n motionStyle = _ref2.style;\n return /*#__PURE__*/React.createElement(SubMenuList, {\n id: id,\n className: motionClassName,\n style: motionStyle\n }, children);\n }));\n}","map":{"version":3,"names":["_extends","_objectSpread","_slicedToArray","React","CSSMotion","getMotion","MenuContextProvider","MenuContext","SubMenuList","InlineSubMenuList","_ref","id","open","keyPath","children","fixedMode","_React$useContext","useContext","prefixCls","forceSubMenuRender","motion","defaultMotions","mode","sameModeRef","useRef","current","_React$useState","useState","_React$useState2","destroy","setDestroy","mergedOpen","useEffect","mergedMotion","length","motionAppear","originOnVisibleChanged","onVisibleChanged","newVisible","createElement","locked","visible","forceRender","removeOnLeave","leavedClassName","concat","_ref2","motionClassName","className","motionStyle","style"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-menu/es/SubMenu/InlineSubMenuList.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 CSSMotion from 'rc-motion';\nimport { getMotion } from \"../utils/motionUtil\";\nimport MenuContextProvider, { MenuContext } from \"../context/MenuContext\";\nimport SubMenuList from \"./SubMenuList\";\nexport default function InlineSubMenuList(_ref) {\n var id = _ref.id,\n open = _ref.open,\n keyPath = _ref.keyPath,\n children = _ref.children;\n var fixedMode = 'inline';\n var _React$useContext = React.useContext(MenuContext),\n prefixCls = _React$useContext.prefixCls,\n forceSubMenuRender = _React$useContext.forceSubMenuRender,\n motion = _React$useContext.motion,\n defaultMotions = _React$useContext.defaultMotions,\n mode = _React$useContext.mode;\n\n // Always use latest mode check\n var sameModeRef = React.useRef(false);\n sameModeRef.current = mode === fixedMode;\n\n // We record `destroy` mark here since when mode change from `inline` to others.\n // The inline list should remove when motion end.\n var _React$useState = React.useState(!sameModeRef.current),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n destroy = _React$useState2[0],\n setDestroy = _React$useState2[1];\n var mergedOpen = sameModeRef.current ? open : false;\n\n // ================================= Effect =================================\n // Reset destroy state when mode change back\n React.useEffect(function () {\n if (sameModeRef.current) {\n setDestroy(false);\n }\n }, [mode]);\n\n // ================================= Render =================================\n var mergedMotion = _objectSpread({}, getMotion(fixedMode, motion, defaultMotions));\n\n // No need appear since nest inlineCollapse changed\n if (keyPath.length > 1) {\n mergedMotion.motionAppear = false;\n }\n\n // Hide inline list when mode changed and motion end\n var originOnVisibleChanged = mergedMotion.onVisibleChanged;\n mergedMotion.onVisibleChanged = function (newVisible) {\n if (!sameModeRef.current && !newVisible) {\n setDestroy(true);\n }\n return originOnVisibleChanged === null || originOnVisibleChanged === void 0 ? void 0 : originOnVisibleChanged(newVisible);\n };\n if (destroy) {\n return null;\n }\n return /*#__PURE__*/React.createElement(MenuContextProvider, {\n mode: fixedMode,\n locked: !sameModeRef.current\n }, /*#__PURE__*/React.createElement(CSSMotion, _extends({\n visible: mergedOpen\n }, mergedMotion, {\n forceRender: forceSubMenuRender,\n removeOnLeave: false,\n leavedClassName: \"\".concat(prefixCls, \"-hidden\")\n }), function (_ref2) {\n var motionClassName = _ref2.className,\n motionStyle = _ref2.style;\n return /*#__PURE__*/React.createElement(SubMenuList, {\n id: id,\n className: motionClassName,\n style: motionStyle\n }, children);\n }));\n}"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,cAAc,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