PromoCursed/node_modules/.cache/babel-loader/6a35912a747e8f2e013627368a6587fe060de1cd7d89374aef03024e95d2c967.json

1 line
17 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"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(pref