mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
30 KiB
JSON
1 line
30 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport { isFragment } from 'react-is';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { HTMLElementType } from '@material-ui/utils';\nimport withStyles from '../styles/withStyles';\nimport Popover from '../Popover';\nimport MenuList from '../MenuList';\nimport * as ReactDOM from 'react-dom';\nimport setRef from '../utils/setRef';\nimport useTheme from '../styles/useTheme';\nimport deprecatedPropType from '../utils/deprecatedPropType';\nvar RTL_ORIGIN = {\n vertical: 'top',\n horizontal: 'right'\n};\nvar LTR_ORIGIN = {\n vertical: 'top',\n horizontal: 'left'\n};\nexport var styles = {\n /* Styles applied to the `Paper` component. */\n paper: {\n // specZ: The maximum height of a simple menu should be one or more rows less than the view\n // height. This ensures a tapable area outside of the simple menu with which to dismiss\n // the menu.\n maxHeight: 'calc(100% - 96px)',\n // Add iOS momentum scrolling.\n WebkitOverflowScrolling: 'touch'\n },\n\n /* Styles applied to the `List` component via `MenuList`. */\n list: {\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0\n }\n};\nvar Menu = /*#__PURE__*/React.forwardRef(function Menu(props, ref) {\n var _props$autoFocus = props.autoFocus,\n autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,\n children = props.children,\n classes = props.classes,\n _props$disableAutoFoc = props.disableAutoFocusItem,\n disableAutoFocusItem = _props$disableAutoFoc === void 0 ? false : _props$disableAutoFoc,\n _props$MenuListProps = props.MenuListProps,\n MenuListProps = _props$MenuListProps === void 0 ? {} : _props$MenuListProps,\n onClose = props.onClose,\n onEnteringProp = props.onEntering,\n open = props.open,\n _props$PaperProps = props.PaperProps,\n PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps,\n PopoverClasses = props.PopoverClasses,\n _props$transitionDura = props.transitionDuration,\n transitionDuration = _props$transitionDura === void 0 ? 'auto' : _props$transitionDura,\n _props$TransitionProp = props.TransitionProps;\n _props$TransitionProp = _props$TransitionProp === void 0 ? {} : _props$TransitionProp;\n\n var onEntering = _props$TransitionProp.onEntering,\n TransitionProps = _objectWithoutProperties(_props$TransitionProp, [\"onEntering\"]),\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'selectedMenu' : _props$variant,\n other = _objectWithoutProperties(props, [\"autoFocus\", \"children\", \"classes\", \"disableAutoFocusItem\", \"MenuListProps\", \"onClose\", \"onEntering\", \"open\", \"PaperProps\", \"PopoverClasses\", \"transitionDuration\", \"TransitionProps\", \"variant\"]);\n\n var theme = useTheme();\n var autoFocusItem = autoFocus && !disableAutoFocusItem && open;\n var menuListActionsRef = React.useRef(null);\n var contentAnchorRef = React.useRef(null);\n\n var getContentAnchorEl = function getContentAnchorEl() {\n return contentAnchorRef.current;\n };\n\n var handleEntering = function handleEntering(element, isAppearing) {\n if (menuListActionsRef.current) {\n menuListActionsRef.current.adjustStyleForScrollbar(element, theme);\n }\n\n if (onEnteringProp) {\n onEnteringProp(element, isAppearing);\n }\n\n if (onEntering) {\n onEntering(element, isAppearing);\n }\n };\n\n var handleListKeyDown = function handleListKeyDown(event) {\n if (event.key === 'Tab') {\n event.preventDefault();\n\n if (onClose) {\n onClose(event, 'tabKeyDown');\n }\n }\n };\n /**\n * the index of the item should receive focus\n * in a `variant=\"selectedMenu\"` it's the first `selected` item\n * otherwise it's the very first item.\n */\n\n\n var activeItemIndex = -1; // since we inject focus related props into children we have to do a lookahead\n // to check if there is a `selected` item. We're looking for the last `selected`\n // item and use the first valid item as a fallback\n\n React.Children.map(children, function (child, index) {\n if (! /*#__PURE__*/React.isValidElement(child)) {\n return;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (isFragment(child)) {\n console.error([\"Material-UI: The Menu component doesn't accept a Fragment as a child.\", 'Consider providing an array instead.'].join('\\n'));\n }\n }\n\n if (!child.props.disabled) {\n if (variant !== \"menu\" && child.props.selected) {\n activeItemIndex = index;\n } else if (activeItemIndex === -1) {\n activeItemIndex = index;\n }\n }\n });\n var items = React.Children.map(children, function (child, index) {\n if (index === activeItemIndex) {\n return /*#__PURE__*/React.cloneElement(child, {\n ref: function ref(instance) {\n // #StrictMode ready\n contentAnchorRef.current = ReactDOM.findDOMNode(instance);\n setRef(child.ref, instance);\n }\n });\n }\n\n return child;\n });\n return /*#__PURE__*/React.createElement(Popover, _extends({\n getContentAnchorEl: getContentAnchorEl,\n classes: PopoverClasses,\n onClose: onClose,\n TransitionProps: _extends({\n onEntering: handleEntering\n }, TransitionProps),\n anchorOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN,\n transformOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN,\n PaperProps: _extends({}, PaperProps, {\n classes: _extends({}, PaperProps.classes, {\n root: classes.paper\n })\n }),\n open: open,\n ref: ref,\n transitionDuration: transitionDuration\n }, other), /*#__PURE__*/React.createElement(MenuList, _extends({\n onKeyDown: handleListKeyDown,\n actions: menuListActionsRef,\n autoFocus: autoFocus && (activeItemIndex === -1 || disableAutoFocusItem),\n autoFocusItem: autoFocusItem,\n variant: variant\n }, MenuListProps, {\n className: clsx(classes.list, MenuListProps.className)\n }), items));\n});\nprocess.env.NODE_ENV !== \"production\" ? Menu.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * A HTML element, or a function that returns it.\n * It's used to set the position of the menu.\n */\n anchorEl: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([HTMLElementType, PropTypes.func]),\n\n /**\n * If `true` (Default) will focus the `[role=\"menu\"]` if no focusable child is found. Disabled\n * children are not focusable. If you set this prop to `false` focus will be placed\n * on the parent modal container. This has severe accessibility implications\n * and should only be considered if you manage focus otherwise.\n */\n autoFocus: PropTypes.bool,\n\n /**\n * Menu contents, normally `MenuItem`s.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * When opening the menu will not focus the active item but the `[role=\"menu\"]`\n * unless `autoFocus` is also set to `false`. Not using the default means not\n * following WAI-ARIA authoring practices. Please be considerate about possible\n * accessibility implications.\n */\n disableAutoFocusItem: PropTypes.bool,\n\n /**\n * Props applied to the [`MenuList`](/api/menu-list/) element.\n */\n MenuListProps: PropTypes.object,\n\n /**\n * Callback fired when the component requests to be closed.\n *\n * @param {object} event The event source of the callback.\n * @param {string} reason Can be: `\"escapeKeyDown\"`, `\"backdropClick\"`, `\"tabKeyDown\"`.\n */\n onClose: PropTypes.func,\n\n /**\n * Callback fired before the Menu enters.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onEnter: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * Callback fired when the Menu has entered.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onEntered: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * Callback fired when the Menu is entering.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onEntering: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * Callback fired before the Menu exits.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onExit: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * Callback fired when the Menu has exited.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onExited: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * Callback fired when the Menu is exiting.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onExiting: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * If `true`, the menu is visible.\n */\n open: PropTypes.bool.isRequired,\n\n /**\n * @ignore\n */\n PaperProps: PropTypes.object,\n\n /**\n * `classes` prop applied to the [`Popover`](/api/popover/) element.\n */\n PopoverClasses: PropTypes.object,\n\n /**\n * The length of the transition in `ms`, or 'auto'\n */\n transitionDuration: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })]),\n\n /**\n * Props applied to the transition element.\n * By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition) component.\n */\n TransitionProps: PropTypes.object,\n\n /**\n * The variant to use. Use `menu` to prevent selected items from impacting the initial focus\n * and the vertical alignment relative to the anchor element.\n */\n variant: PropTypes.oneOf(['menu', 'selectedMenu'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiMenu'\n})(Menu);","map":{"version":3,"sources":["/app/node_modules/@material-ui/core/esm/Menu/Menu.js"],"names":["_extends","_objectWithoutProperties","React","isFragment","PropTypes","clsx","HTMLElementType","withStyles","Popover","MenuList","ReactDOM","setRef","useTheme","deprecatedPropType","RTL_ORIGIN","vertical","horizontal","LTR_ORIGIN","styles","paper","maxHeight","WebkitOverflowScrolling","list","outline","Menu","forwardRef","props","ref","_props$autoFocus","autoFocus","children","classes","_props$disableAutoFoc","disableAutoFocusItem","_props$MenuListProps","MenuListProps","onClose","onEnteringProp","onEntering","open","_props$PaperProps","PaperProps","PopoverClasses","_props$transitionDura","transitionDuration","_props$TransitionProp","TransitionProps","_props$variant","variant","other","theme","autoFocusItem","menuListActionsRef","useRef","contentAnchorRef","getContentAnchorEl","current","handleEntering","element","isAppearing","adjustStyleForScrollbar","handleListKeyDown","event","key","preventDefault","activeItemIndex","Children","map","child","index","isValidElement","process","env","NODE_ENV","console","error","join","disabled","selected","items","cloneElement","instance","findDOMNode","createElement","anchorOrigin","direction","transformOrigin","root","onKeyDown","actions","className","propTypes","anchorEl","oneOfType","func","bool","node","object","onEnter","onEntered","onExit","onExited","onExiting","isRequ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D0B,CAAT,CAAV,CAEZtF,IAFY,CAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport { isFragment } from 'react-is';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { HTMLElementType } from '@material-ui/utils';\nimport withStyles from '../styles/withStyles';\nimport Popover from '../Popover';\nimport MenuList from '../MenuList';\nimport * as ReactDOM from 'react-dom';\nimport setRef from '../utils/setRef';\nimport useTheme from '../styles/useTheme';\nimport deprecatedPropType from '../utils/deprecatedPropType';\nvar RTL_ORIGIN = {\n vertical: 'top',\n horizontal: 'right'\n};\nvar LTR_ORIGIN = {\n vertical: 'top',\n horizontal: 'left'\n};\nexport var styles = {\n /* Styles applied to the `Paper` component. */\n paper: {\n // specZ: The maximum height of a simple menu should be one or more rows less than the view\n // height. This ensures a tapable area outside of the simple menu with which to dismiss\n // the menu.\n maxHeight: 'calc(100% - 96px)',\n // Add iOS momentum scrolling.\n WebkitOverflowScrolling: 'touch'\n },\n\n /* Styles applied to the `List` component via `MenuList`. */\n list: {\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0\n }\n};\nvar Menu = /*#__PURE__*/React.forwardRef(function Menu(props, ref) {\n var _props$autoFocus = props.autoFocus,\n autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,\n children = props.children,\n classes = props.classes,\n _props$disableAutoFoc = props.disableAutoFocusItem,\n disableAutoFocusItem = _props$disableAutoFoc === void 0 ? false : _props$disableAutoFoc,\n _props$MenuListProps = props.MenuListProps,\n MenuListProps = _props$MenuListProps === void 0 ? {} : _props$MenuListProps,\n onClose = props.onClose,\n onEnteringProp = props.onEntering,\n open = props.open,\n _props$PaperProps = props.PaperProps,\n PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps,\n PopoverClasses = props.PopoverClasses,\n _props$transitionDura = props.transitionDuration,\n transitionDuration = _props$transitionDura === void 0 ? 'auto' : _props$transitionDura,\n _props$TransitionProp = props.TransitionProps;\n _props$TransitionProp = _props$TransitionProp === void 0 ? {} : _props$TransitionProp;\n\n var onEntering = _props$TransitionProp.onEntering,\n TransitionProps = _objectWithoutProperties(_props$TransitionProp, [\"onEntering\"]),\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'selectedMenu' : _props$variant,\n other = _objectWithoutProperties(props, [\"autoFocus\", \"children\", \"classes\", \"disableAutoFocusItem\", \"MenuListProps\", \"onClose\", \"onEntering\", \"open\", \"PaperProps\", \"PopoverClasses\", \"transitionDuration\", \"TransitionProps\", \"variant\"]);\n\n var theme = useTheme();\n var autoFocusItem = autoFocus && !disableAutoFocusItem && open;\n var menuListActionsRef = React.useRef(null);\n var contentAnchorRef = React.useRef(null);\n\n var getContentAnchorEl = function getContentAnchorEl() {\n return contentAnchorRef.current;\n };\n\n var handleEntering = function handleEntering(element, isAppearing) {\n if (menuListActionsRef.current) {\n menuListActionsRef.current.adjustStyleForScrollbar(element, theme);\n }\n\n if (onEnteringProp) {\n onEnteringProp(element, isAppearing);\n }\n\n if (onEntering) {\n onEntering(element, isAppearing);\n }\n };\n\n var handleListKeyDown = function handleListKeyDown(event) {\n if (event.key === 'Tab') {\n event.preventDefault();\n\n if (onClose) {\n onClose(event, 'tabKeyDown');\n }\n }\n };\n /**\n * the index of the item should receive focus\n * in a `variant=\"selectedMenu\"` it's the first `selected` item\n * otherwise it's the very first item.\n */\n\n\n var activeItemIndex = -1; // since we inject focus related props into children we have to do a lookahead\n // to check if there is a `selected` item. We're looking for the last `selected`\n // item and use the first valid item as a fallback\n\n React.Children.map(children, function (child, index) {\n if (! /*#__PURE__*/React.isValidElement(child)) {\n return;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (isFragment(child)) {\n console.error([\"Material-UI: The Menu component doesn't accept a Fragment as a child.\", 'Consider providing an array instead.'].join('\\n'));\n }\n }\n\n if (!child.props.disabled) {\n if (variant !== \"menu\" && child.props.selected) {\n activeItemIndex = index;\n } else if (activeItemIndex === -1) {\n activeItemIndex = index;\n }\n }\n });\n var items = React.Children.map(children, function (child, index) {\n if (index === activeItemIndex) {\n return /*#__PURE__*/React.cloneElement(child, {\n ref: function ref(instance) {\n // #StrictMode ready\n contentAnchorRef.current = ReactDOM.findDOMNode(instance);\n setRef(child.ref, instance);\n }\n });\n }\n\n return child;\n });\n return /*#__PURE__*/React.createElement(Popover, _extends({\n getContentAnchorEl: getContentAnchorEl,\n classes: PopoverClasses,\n onClose: onClose,\n TransitionProps: _extends({\n onEntering: handleEntering\n }, TransitionProps),\n anchorOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN,\n transformOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN,\n PaperProps: _extends({}, PaperProps, {\n classes: _extends({}, PaperProps.classes, {\n root: classes.paper\n })\n }),\n open: open,\n ref: ref,\n transitionDuration: transitionDuration\n }, other), /*#__PURE__*/React.createElement(MenuList, _extends({\n onKeyDown: handleListKeyDown,\n actions: menuListActionsRef,\n autoFocus: autoFocus && (activeItemIndex === -1 || disableAutoFocusItem),\n autoFocusItem: autoFocusItem,\n variant: variant\n }, MenuListProps, {\n className: clsx(classes.list, MenuListProps.className)\n }), items));\n});\nprocess.env.NODE_ENV !== \"production\" ? Menu.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * A HTML element, or a function that returns it.\n * It's used to set the position of the menu.\n */\n anchorEl: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([HTMLElementType, PropTypes.func]),\n\n /**\n * If `true` (Default) will focus the `[role=\"menu\"]` if no focusable child is found. Disabled\n * children are not focusable. If you set this prop to `false` focus will be placed\n * on the parent modal container. This has severe accessibility implications\n * and should only be considered if you manage focus otherwise.\n */\n autoFocus: PropTypes.bool,\n\n /**\n * Menu contents, normally `MenuItem`s.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * When opening the menu will not focus the active item but the `[role=\"menu\"]`\n * unless `autoFocus` is also set to `false`. Not using the default means not\n * following WAI-ARIA authoring practices. Please be considerate about possible\n * accessibility implications.\n */\n disableAutoFocusItem: PropTypes.bool,\n\n /**\n * Props applied to the [`MenuList`](/api/menu-list/) element.\n */\n MenuListProps: PropTypes.object,\n\n /**\n * Callback fired when the component requests to be closed.\n *\n * @param {object} event The event source of the callback.\n * @param {string} reason Can be: `\"escapeKeyDown\"`, `\"backdropClick\"`, `\"tabKeyDown\"`.\n */\n onClose: PropTypes.func,\n\n /**\n * Callback fired before the Menu enters.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onEnter: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * Callback fired when the Menu has entered.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onEntered: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * Callback fired when the Menu is entering.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onEntering: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * Callback fired before the Menu exits.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onExit: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * Callback fired when the Menu has exited.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onExited: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * Callback fired when the Menu is exiting.\n * @deprecated Use the `TransitionProps` prop instead.\n */\n onExiting: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` prop instead.'),\n\n /**\n * If `true`, the menu is visible.\n */\n open: PropTypes.bool.isRequired,\n\n /**\n * @ignore\n */\n PaperProps: PropTypes.object,\n\n /**\n * `classes` prop applied to the [`Popover`](/api/popover/) element.\n */\n PopoverClasses: PropTypes.object,\n\n /**\n * The length of the transition in `ms`, or 'auto'\n */\n transitionDuration: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })]),\n\n /**\n * Props applied to the transition element.\n * By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition) component.\n */\n TransitionProps: PropTypes.object,\n\n /**\n * The variant to use. Use `menu` to prevent selected items from impacting the initial focus\n * and the vertical alignment relative to the anchor element.\n */\n variant: PropTypes.oneOf(['menu', 'selectedMenu'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiMenu'\n})(Menu);"]},"metadata":{},"sourceType":"module"} |