Files
ETB/ETB-FrontEnd/node_modules/.cache/babel-loader/d901d73b8ea26c9ac1dbc29db3bec1c9b5cd00300cfa8c2ed8665af86c671639.json
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

1 line
8.9 KiB
JSON

{"ast":null,"code":"'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { DropdownContext } from '../useDropdown/DropdownContext';\nimport { DropdownActionTypes } from '../useDropdown/useDropdown.types';\nimport { useButton } from '../useButton/useButton';\nimport { combineHooksSlotProps } from '../utils/combineHooksSlotProps';\nimport { extractEventHandlers } from '../utils';\n\n/**\n *\n * Demos:\n *\n * - [Menu](https://mui.com/base-ui/react-menu/#hooks)\n *\n * API:\n *\n * - [useMenuButton API](https://mui.com/base-ui/react-menu/hooks-api/#use-menu-button)\n */\nexport function useMenuButton(parameters = {}) {\n const {\n disabled = false,\n focusableWhenDisabled,\n rootRef: externalRef\n } = parameters;\n const menuContext = React.useContext(DropdownContext);\n if (menuContext === null) {\n throw new Error('useMenuButton: no menu context available.');\n }\n const {\n state,\n dispatch,\n registerTrigger,\n popupId\n } = menuContext;\n const {\n getRootProps: getButtonRootProps,\n rootRef: buttonRootRef,\n active\n } = useButton({\n disabled,\n focusableWhenDisabled,\n rootRef: externalRef\n });\n const handleRef = useForkRef(buttonRootRef, registerTrigger);\n const createHandleClick = otherHandlers => event => {\n var _otherHandlers$onClic;\n (_otherHandlers$onClic = otherHandlers.onClick) == null || _otherHandlers$onClic.call(otherHandlers, event);\n if (event.defaultMuiPrevented) {\n return;\n }\n dispatch({\n type: DropdownActionTypes.toggle,\n event\n });\n };\n const createHandleKeyDown = otherHandlers => event => {\n var _otherHandlers$onKeyD;\n (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null || _otherHandlers$onKeyD.call(otherHandlers, event);\n if (event.defaultMuiPrevented) {\n return;\n }\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n dispatch({\n type: DropdownActionTypes.open,\n event\n });\n }\n };\n const getOwnRootProps = (otherHandlers = {}) => ({\n onClick: createHandleClick(otherHandlers),\n onKeyDown: createHandleKeyDown(otherHandlers)\n });\n const getRootProps = (externalProps = {}) => {\n const externalEventHandlers = extractEventHandlers(externalProps);\n const getCombinedProps = combineHooksSlotProps(getOwnRootProps, getButtonRootProps);\n return _extends({\n 'aria-haspopup': 'menu',\n 'aria-expanded': state.open,\n 'aria-controls': popupId\n }, externalProps, externalEventHandlers, getCombinedProps(externalEventHandlers), {\n tabIndex: 0,\n // this is needed to make the button focused after click in Safari\n ref: handleRef\n });\n };\n return {\n active,\n getRootProps,\n open: state.open,\n rootRef: handleRef\n };\n}","map":{"version":3,"names":["_extends","React","unstable_useForkRef","useForkRef","DropdownContext","DropdownActionTypes","useButton","combineHooksSlotProps","extractEventHandlers","useMenuButton","parameters","disabled","focusableWhenDisabled","rootRef","externalRef","menuContext","useContext","Error","state","dispatch","registerTrigger","popupId","getRootProps","getButtonRootProps","buttonRootRef","active","handleRef","createHandleClick","otherHandlers","event","_otherHandlers$onClic","onClick","call","defaultMuiPrevented","type","toggle","createHandleKeyDown","_otherHandlers$onKeyD","onKeyDown","key","preventDefault","open","getOwnRootProps","externalProps","externalEventHandlers","getCombinedProps","tabIndex","ref"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/base/useMenuButton/useMenuButton.js"],"sourcesContent":["'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { DropdownContext } from '../useDropdown/DropdownContext';\nimport { DropdownActionTypes } from '../useDropdown/useDropdown.types';\nimport { useButton } from '../useButton/useButton';\nimport { combineHooksSlotProps } from '../utils/combineHooksSlotProps';\nimport { extractEventHandlers } from '../utils';\n\n/**\n *\n * Demos:\n *\n * - [Menu](https://mui.com/base-ui/react-menu/#hooks)\n *\n * API:\n *\n * - [useMenuButton API](https://mui.com/base-ui/react-menu/hooks-api/#use-menu-button)\n */\nexport function useMenuButton(parameters = {}) {\n const {\n disabled = false,\n focusableWhenDisabled,\n rootRef: externalRef\n } = parameters;\n const menuContext = React.useContext(DropdownContext);\n if (menuContext === null) {\n throw new Error('useMenuButton: no menu context available.');\n }\n const {\n state,\n dispatch,\n registerTrigger,\n popupId\n } = menuContext;\n const {\n getRootProps: getButtonRootProps,\n rootRef: buttonRootRef,\n active\n } = useButton({\n disabled,\n focusableWhenDisabled,\n rootRef: externalRef\n });\n const handleRef = useForkRef(buttonRootRef, registerTrigger);\n const createHandleClick = otherHandlers => event => {\n var _otherHandlers$onClic;\n (_otherHandlers$onClic = otherHandlers.onClick) == null || _otherHandlers$onClic.call(otherHandlers, event);\n if (event.defaultMuiPrevented) {\n return;\n }\n dispatch({\n type: DropdownActionTypes.toggle,\n event\n });\n };\n const createHandleKeyDown = otherHandlers => event => {\n var _otherHandlers$onKeyD;\n (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null || _otherHandlers$onKeyD.call(otherHandlers, event);\n if (event.defaultMuiPrevented) {\n return;\n }\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n dispatch({\n type: DropdownActionTypes.open,\n event\n });\n }\n };\n const getOwnRootProps = (otherHandlers = {}) => ({\n onClick: createHandleClick(otherHandlers),\n onKeyDown: createHandleKeyDown(otherHandlers)\n });\n const getRootProps = (externalProps = {}) => {\n const externalEventHandlers = extractEventHandlers(externalProps);\n const getCombinedProps = combineHooksSlotProps(getOwnRootProps, getButtonRootProps);\n return _extends({\n 'aria-haspopup': 'menu',\n 'aria-expanded': state.open,\n 'aria-controls': popupId\n }, externalProps, externalEventHandlers, getCombinedProps(externalEventHandlers), {\n tabIndex: 0,\n // this is needed to make the button focused after click in Safari\n ref: handleRef\n });\n };\n return {\n active,\n getRootProps,\n open: state.open,\n rootRef: handleRef\n };\n}"],"mappings":"AAA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