PromoCursed/node_modules/.cache/babel-loader/be0fb70967e11180d216f035dd065e3aa6881cdfe974125527833aaef38e4297.json

1 line
32 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport pickAttrs from \"rc-util/es/pickAttrs\";\nimport * as React from 'react';\nimport DrawerContext from \"./context\";\nimport DrawerPanel from \"./DrawerPanel\";\nimport { parseWidthHeight } from \"./util\";\nvar sentinelStyle = {\n width: 0,\n height: 0,\n overflow: 'hidden',\n outline: 'none',\n position: 'absolute'\n};\nfunction DrawerPopup(props, ref) {\n var _ref, _pushConfig$distance, _pushConfig;\n var prefixCls = props.prefixCls,\n open = props.open,\n placement = props.placement,\n inline = props.inline,\n push = props.push,\n forceRender = props.forceRender,\n autoFocus = props.autoFocus,\n keyboard = props.keyboard,\n drawerClassNames = props.classNames,\n rootClassName = props.rootClassName,\n rootStyle = props.rootStyle,\n zIndex = props.zIndex,\n className = props.className,\n id = props.id,\n style = props.style,\n motion = props.motion,\n width = props.width,\n height = props.height,\n children = props.children,\n mask = props.mask,\n maskClosable = props.maskClosable,\n maskMotion = props.maskMotion,\n maskClassName = props.maskClassName,\n maskStyle = props.maskStyle,\n afterOpenChange = props.afterOpenChange,\n onClose = props.onClose,\n onMouseEnter = props.onMouseEnter,\n onMouseOver = props.onMouseOver,\n onMouseLeave = props.onMouseLeave,\n onClick = props.onClick,\n onKeyDown = props.onKeyDown,\n onKeyUp = props.onKeyUp,\n styles = props.styles,\n drawerRender = props.drawerRender;\n\n // ================================ Refs ================================\n var panelRef = React.useRef();\n var sentinelStartRef = React.useRef();\n var sentinelEndRef = React.useRef();\n React.useImperativeHandle(ref, function () {\n return panelRef.current;\n });\n var onPanelKeyDown = function onPanelKeyDown(event) {\n var keyCode = event.keyCode,\n shiftKey = event.shiftKey;\n switch (keyCode) {\n // Tab active\n case KeyCode.TAB:\n {\n if (keyCode === KeyCode.TAB) {\n if (!shiftKey && document.activeElement === sentinelEndRef.current) {\n var _sentinelStartRef$cur;\n (_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 || _sentinelStartRef$cur.focus({\n preventScroll: true\n });\n } else if (shiftKey && document.activeElement === sentinelStartRef.current) {\n var _sentinelEndRef$curre;\n (_sentinelEndRef$curre = sentinelEndRef.current) === null || _sentinelEndRef$curre === void 0 || _sentinelEndRef$curre.focus({\n preventScroll: true\n });\n }\n }\n break;\n }\n\n // Close\n case KeyCode.ESC:\n {\n if (onClose && keyboard) {\n event.stopPropagation();\n onClose(event);\n }\n break;\n }\n }\n };\n\n // ========================== Control ===========================\n // Auto Focus\n React.useEffect(function () {\n if (open && autoFocus) {\n var _panelRef$current;\n (_panelRef$current = panelRef.current) === null || _panelRef$current === void 0 || _panelRef$current.focus({\n preventScroll: true\n });\n }\n }, [open]);\n\n // ============================ Push ============================\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n pushed = _React$useState2[0],\n setPushed = _React$useState2[1];\n var parentContext = React.useContext(DrawerContext);\n\n // M