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

1 line
17 KiB
JSON

{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"arrow\", \"prefixCls\", \"transitionName\", \"animation\", \"align\", \"placement\", \"placements\", \"getPopupContainer\", \"showAction\", \"hideAction\", \"overlayClassName\", \"overlayStyle\", \"visible\", \"trigger\", \"autoFocus\", \"overlay\", \"children\", \"onVisibleChange\"];\nimport Trigger from '@rc-component/trigger';\nimport classNames from 'classnames';\nimport { composeRef, supportRef } from \"rc-util/es/ref\";\nimport React from 'react';\nimport useAccessibility from \"./hooks/useAccessibility\";\nimport Overlay from \"./Overlay\";\nimport Placements from \"./placements\";\nfunction Dropdown(props, ref) {\n var _children$props;\n var _props$arrow = props.arrow,\n arrow = _props$arrow === void 0 ? false : _props$arrow,\n _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-dropdown' : _props$prefixCls,\n transitionName = props.transitionName,\n animation = props.animation,\n align = props.align,\n _props$placement = props.placement,\n placement = _props$placement === void 0 ? 'bottomLeft' : _props$placement,\n _props$placements = props.placements,\n placements = _props$placements === void 0 ? Placements : _props$placements,\n getPopupContainer = props.getPopupContainer,\n showAction = props.showAction,\n hideAction = props.hideAction,\n overlayClassName = props.overlayClassName,\n overlayStyle = props.overlayStyle,\n visible = props.visible,\n _props$trigger = props.trigger,\n trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,\n autoFocus = props.autoFocus,\n overlay = props.overlay,\n children = props.children,\n onVisibleChange = props.onVisibleChange,\n otherProps = _objectWithoutProperties(props, _excluded);\n var _React$useState = React.useState(),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n triggerVisible = _React$useState2[0],\n setTriggerVisible = _React$useState2[1];\n var mergedVisible = 'visible' in props ? visible : triggerVisible;\n var triggerRef = React.useRef(null);\n var overlayRef = React.useRef(null);\n var childRef = React.useRef(null);\n React.useImperativeHandle(ref, function () {\n return triggerRef.current;\n });\n var handleVisibleChange = function handleVisibleChange(newVisible) {\n setTriggerVisible(newVisible);\n onVisibleChange === null || onVisibleChange === void 0 || onVisibleChange(newVisible);\n };\n useAccessibility({\n visible: mergedVisible,\n triggerRef: childRef,\n onVisibleChange: handleVisibleChange,\n autoFocus: autoFocus,\n overlayRef: overlayRef\n });\n var onClick = function onClick(e) {\n var onOverlayClick = props.onOverlayClick;\n setTriggerVisible(false);\n if (onOverlayClick) {\n onOverlayClick(e);\n }\n };\n var getMenuElement = function getMenuElement() {\n return /*#__PURE__*/React.createElement(Overlay, {\n ref: overlayRef,\n overlay: overlay,\n prefixCls: prefixCls,\n arrow: arrow\n });\n };\n var getMenuElementOrLambda = function getMenuElementOrLambda() {\n if (typeof overlay === 'function') {\n return getMenuElement;\n }\n return getMenuElement();\n };\n var getMinOverlayWidthMatchTrigger = function getMinOverlayWidthMatchTrigger() {\n var minOverlayWidthMatchTrigger = props.minOverlayWidthMatchTrigger,\n alignPoint = props.alignPoint;\n if ('minOverlayWidthMatchTrigger' in props) {\n return minOverlayWidthMatchTrigger;\n }\n return !alignPoint;\n };\n var getOpenClassName = function getOpenClassName() {\n var openClassName = props.openClassName;\n if (openClassName !== undefined) {\n return openClassName;\n }\n return \"\".concat(prefixCls, \"-open\");\n };\n var childrenNode = /*#__PURE__*/React.cloneElement(children, {\n className: classNames((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.className, mergedVisible && getOpenClassName()),\n ref: supportRef(children) ? composeRef(childRef, children.ref) : undefined\n });\n var triggerHideAction = hideAction;\n if (!triggerHideAction && trigger.indexOf('contextMenu') !== -1) {\n triggerHideAction = ['click'];\n }\n return /*#__PURE__*/React.createElement(Trigger, _extends({\n builtinPlacements: placements\n }, otherProps, {\n prefixCls: prefixCls,\n ref: triggerRef,\n popupClassName: classNames(overlayClassName, _defineProperty({}, \"\".concat(prefixCls, \"-show-arrow\"), arrow)),\n popupStyle: overlayStyle,\n action: trigger,\n showAction: showAction,\n hideAction: triggerHideAction,\n popupPlacement: placement,\n popupAlign: align,\n popupTransitionName: transitionName,\n popupAnimation: animation,\n popupVisible: mergedVisible,\n stretch: getMinOverlayWidthMatchTrigger() ? 'minWidth' : '',\n popup: getMenuElementOrLambda(),\n onPopupVisibleChange: handleVisibleChange,\n onPopupClick: onClick,\n getPopupContainer: getPopupContainer\n }), childrenNode);\n}\nexport default /*#__PURE__*/React.forwardRef(Dropdown);","map":{"version":3,"names":["_extends","_defineProperty","_slicedToArray","_objectWithoutProperties","_excluded","Trigger","classNames","composeRef","supportRef","React","useAccessibility","Overlay","Placements","Dropdown","props","ref","_children$props","_props$arrow","arrow","_props$prefixCls","prefixCls","transitionName","animation","align","_props$placement","placement","_props$placements","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","_props$trigger","trigger","autoFocus","overlay","children","onVisibleChange","otherProps","_React$useState","useState","_React$useState2","triggerVisible","setTriggerVisible","mergedVisible","triggerRef","useRef","overlayRef","childRef","useImperativeHandle","current","handleVisibleChange","newVisible","onClick","e","onOverlayClick","getMenuElement","createElement","getMenuElementOrLambda","getMinOverlayWidthMatchTrigger","minOverlayWidthMatchTrigger","alignPoint","getOpenClassName","openClassName","undefined","concat","childrenNode","cloneElement","className","triggerHideAction","indexOf","builtinPlacements","popupClassName","popupStyle","action","popupPlacement","popupAlign","popupTransitionName","popupAnimation","popupVisible","stretch","popup","onPopupVisibleChange","onPopupClick","forwardRef"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-dropdown/es/Dropdown.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"arrow\", \"prefixCls\", \"transitionName\", \"animation\", \"align\", \"placement\", \"placements\", \"getPopupContainer\", \"showAction\", \"hideAction\", \"overlayClassName\", \"overlayStyle\", \"visible\", \"trigger\", \"autoFocus\", \"overlay\", \"children\", \"onVisibleChange\"];\nimport Trigger from '@rc-component/trigger';\nimport classNames from 'classnames';\nimport { composeRef, supportRef } from \"rc-util/es/ref\";\nimport React from 'react';\nimport useAccessibility from \"./hooks/useAccessibility\";\nimport Overlay from \"./Overlay\";\nimport Placements from \"./placements\";\nfunction Dropdown(props, ref) {\n var _children$props;\n var _props$arrow = props.arrow,\n arrow = _props$arrow === void 0 ? false : _props$arrow,\n _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-dropdown' : _props$prefixCls,\n transitionName = props.transitionName,\n animation = props.animation,\n align = props.align,\n _props$placement = props.placement,\n placement = _props$placement === void 0 ? 'bottomLeft' : _props$placement,\n _props$placements = props.placements,\n placements = _props$placements === void 0 ? Placements : _props$placements,\n getPopupContainer = props.getPopupContainer,\n showAction = props.showAction,\n hideAction = props.hideAction,\n overlayClassName = props.overlayClassName,\n overlayStyle = props.overlayStyle,\n visible = props.visible,\n _props$trigger = props.trigger,\n trigger = _props$trigger === void 0 ? ['hover'] : _props$trigger,\n autoFocus = props.autoFocus,\n overlay = props.overlay,\n children = props.children,\n onVisibleChange = props.onVisibleChange,\n otherProps = _objectWithoutProperties(props, _excluded);\n var _React$useState = React.useState(),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n triggerVisible = _React$useState2[0],\n setTriggerVisible = _React$useState2[1];\n var mergedVisible = 'visible' in props ? visible : triggerVisible;\n var triggerRef = React.useRef(null);\n var overlayRef = React.useRef(null);\n var childRef = React.useRef(null);\n React.useImperativeHandle(ref, function () {\n return triggerRef.current;\n });\n var handleVisibleChange = function handleVisibleChange(newVisible) {\n setTriggerVisible(newVisible);\n onVisibleChange === null || onVisibleChange === void 0 || onVisibleChange(newVisible);\n };\n useAccessibility({\n visible: mergedVisible,\n triggerRef: childRef,\n onVisibleChange: handleVisibleChange,\n autoFocus: autoFocus,\n overlayRef: overlayRef\n });\n var onClick = function onClick(e) {\n var onOverlayClick = props.onOverlayClick;\n setTriggerVisible(false);\n if (onOverlayClick) {\n onOverlayClick(e);\n }\n };\n var getMenuElement = function getMenuElement() {\n return /*#__PURE__*/React.createElement(Overlay, {\n ref: overlayRef,\n overlay: overlay,\n prefixCls: prefixCls,\n arrow: arrow\n });\n };\n var getMenuElementOrLambda = function getMenuElementOrLambda() {\n if (typeof overlay === 'function') {\n return getMenuElement;\n }\n return getMenuElement();\n };\n var getMinOverlayWidthMatchTrigger = function getMinOverlayWidthMatchTrigger() {\n var minOverlayWidthMatchTrigger = props.minOverlayWidthMatchTrigger,\n alignPoint = props.alignPoint;\n if ('minOverlayWidthMatchTrigger' in props) {\n return minOverlayWidthMatchTrigger;\n }\n return !alignPoint;\n };\n var getOpenClassName = function getOpenClassName() {\n var openClassName = props.openClassName;\n if (openClassName !== undefined) {\n return openClassName;\n }\n return \"\".concat(prefixCls, \"-open\");\n };\n var childrenNode = /*#__PURE__*/React.cloneElement(children, {\n className: classNames((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.className, mergedVisible && getOpenClassName()),\n ref: supportRef(children) ? composeRef(childRef, children.ref) : undefined\n });\n var triggerHideAction = hideAction;\n if (!triggerHideAction && trigger.indexOf('contextMenu') !== -1) {\n triggerHideAction = ['click'];\n }\n return /*#__PURE__*/React.createElement(Trigger, _extends({\n builtinPlacements: placements\n }, otherProps, {\n prefixCls: prefixCls,\n ref: triggerRef,\n popupClassName: classNames(overlayClassName, _defineProperty({}, \"\".concat(prefixCls, \"-show-arrow\"), arrow)),\n popupStyle: overlayStyle,\n action: trigger,\n showAction: showAction,\n hideAction: triggerHideAction,\n popupPlacement: placement,\n popupAlign: align,\n popupTransitionName: transitionName,\n popupAnimation: animation,\n popupVisible: mergedVisible,\n stretch: getMinOverlayWidthMatchTrigger() ? 'minWidth' : '',\n popup: getMenuElementOrLambda(),\n onPopupVisibleChange: handleVisibleChange,\n onPopupClick: onClick,\n getPopupContainer: getPopupContainer\n }), childrenNode);\n}\nexport default /*#__PURE__*/React.forwardRef(Dropdown);"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,IAAIC,SAAS,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,CAAC;AAC3Q,OAAOC,OAAO,MAAM,uBAAuB;AAC3C,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,UAAU,EAAEC,UAAU,QAAQ,gBAAgB;AACvD,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,gBAAgB,MAAM,0BAA0B;AACvD,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,QAAQA,CAACC,KAAK,EAAEC,GAAG,EAAE;EAC5B,IAAIC,eAAe;EACnB,IAAIC,YAAY,GAAGH,KAAK,CAACI,KAAK;IAC5BA,KAAK,GAAGD,YAAY,KAAK,KAAK,CAAC,GAAG,KAAK,GAAGA,YAAY;IACtDE,gBAAgB,GAAGL,KAAK,CAACM,SAAS;IAClCA,SAAS,GAAGD,gBAAgB,KAAK,KAAK,CAAC,GAAG,aAAa,GAAGA,gBAAgB;IAC1EE,cAAc,GAAGP,KAAK,CAAC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