mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
11 KiB
JSON
1 line
11 KiB
JSON
{"ast":null,"code":"import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { exactProp, HTMLElementType } from '@material-ui/utils';\nimport deprecatedPropType from '../utils/deprecatedPropType';\nimport setRef from '../utils/setRef';\nimport useForkRef from '../utils/useForkRef';\n\nfunction getContainer(container) {\n container = typeof container === 'function' ? container() : container; // #StrictMode ready\n\n return ReactDOM.findDOMNode(container);\n}\n\nvar useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n/**\n * Portals provide a first-class way to render children into a DOM node\n * that exists outside the DOM hierarchy of the parent component.\n */\n\nvar Portal = /*#__PURE__*/React.forwardRef(function Portal(props, ref) {\n var children = props.children,\n container = props.container,\n _props$disablePortal = props.disablePortal,\n disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal,\n onRendered = props.onRendered;\n\n var _React$useState = React.useState(null),\n mountNode = _React$useState[0],\n setMountNode = _React$useState[1];\n\n var handleRef = useForkRef( /*#__PURE__*/React.isValidElement(children) ? children.ref : null, ref);\n useEnhancedEffect(function () {\n if (!disablePortal) {\n setMountNode(getContainer(container) || document.body);\n }\n }, [container, disablePortal]);\n useEnhancedEffect(function () {\n if (mountNode && !disablePortal) {\n setRef(ref, mountNode);\n return function () {\n setRef(ref, null);\n };\n }\n\n return undefined;\n }, [ref, mountNode, disablePortal]);\n useEnhancedEffect(function () {\n if (onRendered && (mountNode || disablePortal)) {\n onRendered();\n }\n }, [onRendered, mountNode, disablePortal]);\n\n if (disablePortal) {\n if ( /*#__PURE__*/React.isValidElement(children)) {\n return /*#__PURE__*/React.cloneElement(children, {\n ref: handleRef\n });\n }\n\n return children;\n }\n\n return mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode;\n});\nprocess.env.NODE_ENV !== \"production\" ? Portal.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 * The children to render into the `container`.\n */\n children: PropTypes.node,\n\n /**\n * A HTML element, component instance, or function that returns either.\n * The `container` will have the portal children appended to it.\n *\n * By default, it uses the body of the top-level document object,\n * so it's simply `document.body` most of the time.\n */\n container: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([HTMLElementType, PropTypes.instanceOf(React.Component), PropTypes.func]),\n\n /**\n * Disable the portal behavior.\n * The children stay within it's parent DOM hierarchy.\n */\n disablePortal: PropTypes.bool,\n\n /**\n * Callback fired once the children has been mounted into the `container`.\n *\n * This prop will be removed in v5, the ref can be used instead.\n * @deprecated Use the ref instead.\n */\n onRendered: deprecatedPropType(PropTypes.func, 'Use the ref instead.')\n} : void 0;\n\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n Portal['propTypes' + ''] = exactProp(Portal.propTypes);\n}\n\nexport default Portal;","map":{"version":3,"sources":["/app/node_modules/@material-ui/core/esm/Portal/Portal.js"],"names":["React","ReactDOM","PropTypes","exactProp","HTMLElementType","deprecatedPropType","setRef","useForkRef","getContainer","container","findDOMNode","useEnhancedEffect","window","useLayoutEffect","useEffect","Portal","forwardRef","props","ref","children","_props$disablePortal","disablePortal","onRendered","_React$useState","useState","mountNode","setMountNode","handleRef","isValidElement","document","body","undefined","cloneElement","createPortal","process","env","NODE_ENV","propTypes","node","oneOfType","instanceOf","Component","func","bool"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAO,KAAKC,QAAZ,MAA0B,WAA1B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,SAAT,EAAoBC,eAApB,QAA2C,oBAA3C;AACA,OAAOC,kBAAP,MAA+B,6BAA/B;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,UAAP,MAAuB,qBAAvB;;AAEA,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CAAlB,EAAyDvC,SAAS,CAACwC,IAAnE,CAFA,CAlB8C;;AAsBzD;AACF;AACA;AACA;AACErB,EAAAA,aAAa,EAAEnB,SAAS,CAACyC,IA1BgC;;AA4BzD;AACF;AACA;AACA;AACA;AACA;AACErB,EAAAA,UAAU,EAAEjB,kBAAkB,CAACH,SAAS,CAACwC,IAAX,EAAiB,sBAAjB;AAlC2B,CAA3D,GAmCI,KAAK,CAnCT;;AAqCA,IAAIR,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;AACzC;AACArB,EAAAA,MAAM,CAAC,cAAc,EAAf,CAAN,GAA2BZ,SAAS,CAACY,MAAM,CAACsB,SAAR,CAApC;AACD;;AAED,eAAetB,MAAf","sourcesContent":["import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { exactProp, HTMLElementType } from '@material-ui/utils';\nimport deprecatedPropType from '../utils/deprecatedPropType';\nimport setRef from '../utils/setRef';\nimport useForkRef from '../utils/useForkRef';\n\nfunction getContainer(container) {\n container = typeof container === 'function' ? container() : container; // #StrictMode ready\n\n return ReactDOM.findDOMNode(container);\n}\n\nvar useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n/**\n * Portals provide a first-class way to render children into a DOM node\n * that exists outside the DOM hierarchy of the parent component.\n */\n\nvar Portal = /*#__PURE__*/React.forwardRef(function Portal(props, ref) {\n var children = props.children,\n container = props.container,\n _props$disablePortal = props.disablePortal,\n disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal,\n onRendered = props.onRendered;\n\n var _React$useState = React.useState(null),\n mountNode = _React$useState[0],\n setMountNode = _React$useState[1];\n\n var handleRef = useForkRef( /*#__PURE__*/React.isValidElement(children) ? children.ref : null, ref);\n useEnhancedEffect(function () {\n if (!disablePortal) {\n setMountNode(getContainer(container) || document.body);\n }\n }, [container, disablePortal]);\n useEnhancedEffect(function () {\n if (mountNode && !disablePortal) {\n setRef(ref, mountNode);\n return function () {\n setRef(ref, null);\n };\n }\n\n return undefined;\n }, [ref, mountNode, disablePortal]);\n useEnhancedEffect(function () {\n if (onRendered && (mountNode || disablePortal)) {\n onRendered();\n }\n }, [onRendered, mountNode, disablePortal]);\n\n if (disablePortal) {\n if ( /*#__PURE__*/React.isValidElement(children)) {\n return /*#__PURE__*/React.cloneElement(children, {\n ref: handleRef\n });\n }\n\n return children;\n }\n\n return mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode;\n});\nprocess.env.NODE_ENV !== \"production\" ? Portal.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 * The children to render into the `container`.\n */\n children: PropTypes.node,\n\n /**\n * A HTML element, component instance, or function that returns either.\n * The `container` will have the portal children appended to it.\n *\n * By default, it uses the body of the top-level document object,\n * so it's simply `document.body` most of the time.\n */\n container: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([HTMLElementType, PropTypes.instanceOf(React.Component), PropTypes.func]),\n\n /**\n * Disable the portal behavior.\n * The children stay within it's parent DOM hierarchy.\n */\n disablePortal: PropTypes.bool,\n\n /**\n * Callback fired once the children has been mounted into the `container`.\n *\n * This prop will be removed in v5, the ref can be used instead.\n * @deprecated Use the ref instead.\n */\n onRendered: deprecatedPropType(PropTypes.func, 'Use the ref instead.')\n} : void 0;\n\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n Portal['propTypes' + ''] = exactProp(Portal.propTypes);\n}\n\nexport default Portal;"]},"metadata":{},"sourceType":"module"} |