1 line
12 KiB
JSON
1 line
12 KiB
JSON
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport Trigger from '@rc-component/trigger';\nimport classNames from 'classnames';\nimport raf from \"rc-util/es/raf\";\nimport { MenuContext } from \"../context/MenuContext\";\nimport { placements, placementsRtl } from \"../placements\";\nimport { getMotion } from \"../utils/motionUtil\";\nvar popupPlacementMap = {\n horizontal: 'bottomLeft',\n vertical: 'rightTop',\n 'vertical-left': 'rightTop',\n 'vertical-right': 'leftTop'\n};\nexport default function PopupTrigger(_ref) {\n var prefixCls = _ref.prefixCls,\n visible = _ref.visible,\n children = _ref.children,\n popup = _ref.popup,\n popupStyle = _ref.popupStyle,\n popupClassName = _ref.popupClassName,\n popupOffset = _ref.popupOffset,\n disabled = _ref.disabled,\n mode = _ref.mode,\n onVisibleChange = _ref.onVisibleChange;\n var _React$useContext = React.useContext(MenuContext),\n getPopupContainer = _React$useContext.getPopupContainer,\n rtl = _React$useContext.rtl,\n subMenuOpenDelay = _React$useContext.subMenuOpenDelay,\n subMenuCloseDelay = _React$useContext.subMenuCloseDelay,\n builtinPlacements = _React$useContext.builtinPlacements,\n triggerSubMenuAction = _React$useContext.triggerSubMenuAction,\n forceSubMenuRender = _React$useContext.forceSubMenuRender,\n rootClassName = _React$useContext.rootClassName,\n motion = _React$useContext.motion,\n defaultMotions = _React$useContext.defaultMotions;\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n innerVisible = _React$useState2[0],\n setInnerVisible = _React$useState2[1];\n var placement = rtl ? _objectSpread(_objectSpread({}, placementsRtl), builtinPlacements) : _objectSpread(_objectSpread({}, placements), builtinPlacements);\n var popupPlacement = popupPlacementMap[mode];\n var targetMotion = getMotion(mode, motion, defaultMotions);\n var targetMotionRef = React.useRef(targetMotion);\n if (mode !== 'inline') {\n /**\n * PopupTrigger is only used for vertical and horizontal types.\n * When collapsed is unfolded, the inline animation will destroy the vertical animation.\n */\n targetMotionRef.current = targetMotion;\n }\n var mergedMotion = _objectSpread(_objectSpread({}, targetMotionRef.current), {}, {\n leavedClassName: \"\".concat(prefixCls, \"-hidden\"),\n removeOnLeave: false,\n motionAppear: true\n });\n\n // Delay to change visible\n var visibleRef = React.useRef();\n React.useEffect(function () {\n visibleRef.current = raf(function () {\n setInnerVisible(visible);\n });\n return function () {\n raf.cancel(visibleRef.current);\n };\n }, [visible]);\n return /*#__PURE__*/React.createElement(Trigger, {\n prefixCls: prefixCls,\n popupClassName: classNames(\"\".concat(prefixCls, \"-popup\"), _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), rtl), popupClassName, rootClassName),\n stretch: mode === 'horizontal' ? 'minWidth' : null,\n getPopupContainer: getPopupContainer,\n builtinPlacements: placement,\n popupPlacement: popupPlacement,\n popupVisible: innerVisible,\n popup: popup,\n popupStyle: popupStyle,\n popupAlign: popupOffset && {\n offset: popupOffset\n },\n action: disabled ? [] : [triggerSubMenuAction],\n mouseEnterDelay: subMenuOpenDelay,\n mouseLeaveDelay: subMenuCloseDelay,\n onPopupVisibleChange: onVisibleChange,\n forceRender: forceSubMenuRender,\n popupMotion: mergedMotion,\n fresh: true\n }, children);\n}","map":{"version":3,"names":["_defineProperty","_objectSpread","_slicedToArray","React","Trigger","classNames","raf","MenuContext","placements","placementsRtl","getMotion","popupPlacementMap","horizontal","vertical","PopupTrigger","_ref","prefixCls","visible","children","popup","popupStyle","popupClassName","popupOffset","disabled","mode","onVisibleChange","_React$useContext","useContext","getPopupContainer","rtl","subMenuOpenDelay","subMenuCloseDelay","builtinPlacements","triggerSubMenuAction","forceSubMenuRender","rootClassName","motion","defaultMotions","_React$useState","useState","_React$useState2","innerVisible","setInnerVisible","placement","popupPlacement","targetMotion","targetMotionRef","useRef","current","mergedMotion","leavedClassName","concat","removeOnLeave","motionAppear","visibleRef","useEffect","cancel","createElement","stretch","popupVisible","popupAlign","offset","action","mouseEnterDelay","mouseLeaveDelay","onPopupVisibleChange","forceRender","popupMotion","fresh"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-menu/es/SubMenu/PopupTrigger.js"],"sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport Trigger from '@rc-component/trigger';\nimport classNames from 'classnames';\nimport raf from \"rc-util/es/raf\";\nimport { MenuContext } from \"../context/MenuContext\";\nimport { placements, placementsRtl } from \"../placements\";\nimport { getMotion } from \"../utils/motionUtil\";\nvar popupPlacementMap = {\n horizontal: 'bottomLeft',\n vertical: 'rightTop',\n 'vertical-left': 'rightTop',\n 'vertical-right': 'leftTop'\n};\nexport default function PopupTrigger(_ref) {\n var prefixCls = _ref.prefixCls,\n visible = _ref.visible,\n children = _ref.children,\n popup = _ref.popup,\n popupStyle = _ref.popupStyle,\n popupClassName = _ref.popupClassName,\n popupOffset = _ref.popupOffset,\n disabled = _ref.disabled,\n mode = _ref.mode,\n onVisibleChange = _ref.onVisibleChange;\n var _React$useContext = React.useContext(MenuContext),\n getPopupContainer = _React$useContext.getPopupContainer,\n rtl = _React$useContext.rtl,\n subMenuOpenDelay = _React$useContext.subMenuOpenDelay,\n subMenuCloseDelay = _React$useContext.subMenuCloseDelay,\n builtinPlacements = _React$useContext.builtinPlacements,\n triggerSubMenuAction = _React$useContext.triggerSubMenuAction,\n forceSubMenuRender = _React$useContext.forceSubMenuRender,\n rootClassName = _React$useContext.rootClassName,\n motion = _React$useContext.motion,\n defaultMotions = _React$useContext.defaultMotions;\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n innerVisible = _React$useState2[0],\n setInnerVisible = _React$useState2[1];\n var placement = rtl ? _objectSpread(_objectSpread({}, placementsRtl), builtinPlacements) : _objectSpread(_objectSpread({}, placements), builtinPlacements);\n var popupPlacement = popupPlacementMap[mode];\n var targetMotion = getMotion(mode, motion, defaultMotions);\n var targetMotionRef = React.useRef(targetMotion);\n if (mode !== 'inline') {\n /**\n * PopupTrigger is only used for vertical and horizontal types.\n * When collapsed is unfolded, the inline animation will destroy the vertical animation.\n */\n targetMotionRef.current = targetMotion;\n }\n var mergedMotion = _objectSpread(_objectSpread({}, targetMotionRef.current), {}, {\n leavedClassName: \"\".concat(prefixCls, \"-hidden\"),\n removeOnLeave: false,\n motionAppear: true\n });\n\n // Delay to change visible\n var visibleRef = React.useRef();\n React.useEffect(function () {\n visibleRef.current = raf(function () {\n setInnerVisible(visible);\n });\n return function () {\n raf.cancel(visibleRef.current);\n };\n }, [visible]);\n return /*#__PURE__*/React.createElement(Trigger, {\n prefixCls: prefixCls,\n popupClassName: classNames(\"\".concat(prefixCls, \"-popup\"), _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), rtl), popupClassName, rootClassName),\n stretch: mode === 'horizontal' ? 'minWidth' : null,\n getPopupContainer: getPopupContainer,\n builtinPlacements: placement,\n popupPlacement: popupPlacement,\n popupVisible: innerVisible,\n popup: popup,\n popupStyle: popupStyle,\n popupAlign: popupOffset && {\n offset: popupOffset\n },\n action: disabled ? [] : [triggerSubMenuAction],\n mouseEnterDelay: subMenuOpenDelay,\n mouseLeaveDelay: subMenuCloseDelay,\n onPopupVisibleChange: onVisibleChange,\n forceRender: forceSubMenuRender,\n popupMotion: mergedMotion,\n fresh: true\n }, children);\n}"],"mappings":"AAAA,OAAOA,eAAe,MAAM,2CAA2C;AACvE,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,OAAO,MAAM,uBAAuB;AAC3C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,GAAG,MAAM,gBAAgB;AA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