f71e94c1598736307254cc60d3d3c325.json 28 KB

1
  1. {"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 PropTypes from 'prop-types';\nimport * as ReactDOM from 'react-dom';\nimport debounce from '../utils/debounce';\nimport { Transition } from 'react-transition-group';\nimport { elementAcceptingRef } from '@material-ui/utils';\nimport useForkRef from '../utils/useForkRef';\nimport useTheme from '../styles/useTheme';\nimport { duration } from '../styles/transitions';\nimport { reflow, getTransitionProps } from '../transitions/utils'; // Translate the node so he can't be seen on the screen.\n// Later, we gonna translate back the node to his original location\n// with `none`.`\n\nfunction getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(\").concat(offsetX - rect.left, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(\").concat(offsetY - rect.top, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}\n\nexport function setTranslateValue(direction, node) {\n var transform = getTranslateValue(direction, node);\n\n if (transform) {\n node.style.webkitTransform = transform;\n node.style.transform = transform;\n }\n}\nvar defaultTimeout = {\n enter: duration.enteringScreen,\n exit: duration.leavingScreen\n};\n/**\n * The Slide transition is used by the [Drawer](/components/drawers/) component.\n * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.\n */\n\nvar Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {\n var children = props.children,\n _props$direction = props.direction,\n direction = _props$direction === void 0 ? 'down' : _props$direction,\n inProp = props.in,\n onEnter = props.onEnter,\n onEntered = props.onEntered,\n onEntering = props.onEntering,\n onExit = props.onExit,\n onExited = props.onExited,\n onExiting = props.onExiting,\n style = props.style,\n _props$timeout = props.timeout,\n timeout = _props$timeout === void 0 ? defaultTimeout : _props$timeout,\n _props$TransitionComp = props.TransitionComponent,\n TransitionComponent = _props$TransitionComp === void 0 ? Transition : _props$TransitionComp,\n other = _objectWithoutProperties(props, [\"children\", \"direction\", \"in\", \"onEnter\", \"onEntered\", \"onEntering\", \"onExit\", \"onExited\", \"onExiting\", \"style\", \"timeout\", \"TransitionComponent\"]);\n\n var theme = useTheme();\n var childrenRef = React.useRef(null);\n /**\n * used in cloneElement(children, { ref: handleRef })\n */\n\n var handleOwnRef = React.useCallback(function (instance) {\n // #StrictMode ready\n childrenRef.current = ReactDOM.findDOMNode(instance);\n }, []);\n var handleRefIntermediary = useForkRef(children.ref, handleOwnRef);\n var handleRef = useForkRef(handleRefIntermediary, ref);\n\n var normalizedTransitionCallback = function normalizedTransitionCallback(callback) {\n return function (isAppearing) {\n if (callback) {\n // onEnterXxx and onExitXxx callbacks have a different arguments.length value.\n if (isAppearing === undefined) {\n callback(childrenRef.current);\n } else {\n callback(childrenRef.current, isAppearing);\n }\n }\n };\n };\n\n var handleEnter = normalizedTransitionCallback(function (node, isAppearing) {\n setTranslateValue(direction, node);\n reflow(node);\n\n if (onEnter) {\n onEnter(node, isAppearing);\n }\n });\n var handleEntering = normalizedTransitionCallback(function (node, isAppearing) {\n var transitionProps = getTransitionProps({\n timeout: timeout,\n style: style\n }, {\n mode: 'enter'\n });\n node.style.webkitTransition = theme.transitions.create('-webkit-transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.easeOut\n }));\n node.style.transition = theme.transitions.create('transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.easeOut\n }));\n node.style.webkitTransform = 'none';\n node.style.transform = 'none';\n\n if (onEntering) {\n onEntering(node, isAppearing);\n }\n });\n var handleEntered = normalizedTransitionCallback(onEntered);\n var handleExiting = normalizedTransitionCallback(onExiting);\n var handleExit = normalizedTransitionCallback(function (node) {\n var transitionProps = getTransitionProps({\n timeout: timeout,\n style: style\n }, {\n mode: 'exit'\n });\n node.style.webkitTransition = theme.transitions.create('-webkit-transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.sharp\n }));\n node.style.transition = theme.transitions.create('transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.sharp\n }));\n setTranslateValue(direction, node);\n\n if (onExit) {\n onExit(node);\n }\n });\n var handleExited = normalizedTransitionCallback(function (node) {\n // No need for transitions when the component is hidden\n node.style.webkitTransition = '';\n node.style.transition = '';\n\n if (onExited) {\n onExited(node);\n }\n });\n var updatePosition = React.useCallback(function () {\n if (childrenRef.current) {\n setTranslateValue(direction, childrenRef.current);\n }\n }, [direction]);\n React.useEffect(function () {\n // Skip configuration where the position is screen size invariant.\n if (inProp || direction === 'down' || direction === 'right') {\n return undefined;\n }\n\n var handleResize = debounce(function () {\n if (childrenRef.current) {\n setTranslateValue(direction, childrenRef.current);\n }\n });\n window.addEventListener('resize', handleResize);\n return function () {\n handleResize.clear();\n window.removeEventListener('resize', handleResize);\n };\n }, [direction, inProp]);\n React.useEffect(function () {\n if (!inProp) {\n // We need to update the position of the drawer when the direction change and\n // when it's hidden.\n updatePosition();\n }\n }, [inProp, updatePosition]);\n return /*#__PURE__*/React.createElement(TransitionComponent, _extends({\n nodeRef: childrenRef,\n onEnter: handleEnter,\n onEntered: handleEntered,\n onEntering: handleEntering,\n onExit: handleExit,\n onExited: handleExited,\n onExiting: handleExiting,\n appear: true,\n in: inProp,\n timeout: timeout\n }, other), function (state, childProps) {\n return /*#__PURE__*/React.cloneElement(children, _extends({\n ref: handleRef,\n style: _extends({\n visibility: state === 'exited' && !inProp ? 'hidden' : undefined\n }, style, children.props.style)\n }, childProps));\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Slide.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 single child content element.\n */\n children: elementAcceptingRef,\n\n /**\n * Direction the child node will enter from.\n */\n direction: PropTypes.oneOf(['down', 'left', 'right', 'up']),\n\n /**\n * If `true`, show the component; triggers the enter or exit animation.\n */\n in: PropTypes.bool,\n\n /**\n * @ignore\n */\n onEnter: PropTypes.func,\n\n /**\n * @ignore\n */\n onEntered: PropTypes.func,\n\n /**\n * @ignore\n */\n onEntering: PropTypes.func,\n\n /**\n * @ignore\n */\n onExit: PropTypes.func,\n\n /**\n * @ignore\n */\n onExited: PropTypes.func,\n\n /**\n * @ignore\n */\n onExiting: PropTypes.func,\n\n /**\n * @ignore\n */\n style: PropTypes.object,\n\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n */\n timeout: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })])\n} : void 0;\nexport default Slide;","map":{"version":3,"sources":["/Users/holunyeung/Documents/GitHub/Photo_React/photo/node_modules/@material-ui/core/esm/Slide/Slide.js"],"names":["_extends","_objectWithoutProperties","React","PropTypes","ReactDOM","debounce","Transition","elementAcceptingRef","useForkRef","useTheme","duration","reflow","getTransitionProps","getTranslateValue","direction","node","rect","getBoundingClientRect","transform","fakeTransform","computedStyle","window","getComputedStyle","getPropertyValue","offsetX","offsetY","transformValues","split","parseInt","concat","innerWidth","left","width","innerHeight","top","height","setTranslateValue","style","webkitTransform","defaultTimeout","enter","enteringScreen","exit","leavingScreen","Slide","forwardRef","props","ref","children","_props$direction","inProp","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","_props$timeout","timeout","_props$TransitionComp","TransitionComponent","other","theme","childrenRef","useRef","handleOwnRef","useCallback","instance","current","findDOMNode","handleRefIntermediary","handleRef","normalizedTransitionCallback","callback","isAppearing","undefined","handleEnter","handleEntering","transitionProps","mode","webkitTransition","transitions","create","easing","easeOut","transition","handleEntered","handleExiting","handleExit","sharp","handleExited","updatePosition","useEffect","handleResize","addEventListener","clear","removeEventListener","createElement","nodeRef","appear","state","childProps","cloneElement","visibility","process","env","NODE_ENV","propTypes","oneOf","bool","func","object","oneOfType","number","shape"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;AACA,OAAOC,wBAAP,MAAqC,oDAArC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAO,KAAKC,QAAZ,MAA0B,WAA1B;AACA,OAAOC,QAAP,MAAqB,mBAArB;AACA,SAASC,UAAT,QAA2B,wBAA3B;AACA,SAASC,mBAAT,QAAoC,oBAApC;AACA,OAAOC,UAAP,MAAuB,qBAAvB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,SAASC,QAAT,QAAyB,uBAAzB;AACA,SAASC,MAAT,EAAiBC,kBAAjB,QAA2C,sBAA3C,C,CAAmE;AACnE;AACA;;AAEA,SAASC,iBAAT,CAA2BC,SAA3B,EAAsCC,IAAtC,EAA4C;AAC1C,MAAIC,IAAI,GAAGD,IAAI,CAACE,qBAAL,EAAX;AACA,MAAIC,SAAJ;;AAEA,MAAIH,IAAI,CAACI,aAAT,EAAwB;AACtBD,IAAAA,SAAS,GAAGH,IAAI,CAACI,aAAjB;AACD,GAFD,MAEO;AACL,QAAIC,aAAa,GAAGC,MAAM,CAACC,gBAAP,CAAwBP,IAAxB,CAApB;AACAG,IAAAA,SAAS,GAAGE,aAAa,CAACG,gBAAd,CAA+B,mBAA/B,KAAuDH,aAAa,CAACG,gBAAd,CAA+B,WAA/B,CAAnE;AACD;;A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D,SAAS,CAAC4G,IAlCkC;;AAoCxD;;;AAGAxD,EAAAA,MAAM,EAAEpD,SAAS,CAAC4G,IAvCsC;;AAyCxD;;;AAGAvD,EAAAA,QAAQ,EAAErD,SAAS,CAAC4G,IA5CoC;;AA8CxD;;;AAGAtD,EAAAA,SAAS,EAAEtD,SAAS,CAAC4G,IAjDmC;;AAmDxD;;;AAGA1E,EAAAA,KAAK,EAAElC,SAAS,CAAC6G,MAtDuC;;AAwDxD;;;;AAIArD,EAAAA,OAAO,EAAExD,SAAS,CAAC8G,SAAV,CAAoB,CAAC9G,SAAS,CAAC+G,MAAX,EAAmB/G,SAAS,CAACgH,KAAV,CAAgB;AAC9Df,IAAAA,MAAM,EAAEjG,SAAS,CAAC+G,MAD4C;AAE9D1E,IAAAA,KAAK,EAAErC,SAAS,CAAC+G,MAF6C;AAG9DxE,IAAAA,IAAI,EAAEvC,SAAS,CAAC+G;AAH8C,GAAhB,CAAnB,CAApB;AA5D+C,CAA1D,GAiEI,KAAK,CAjET;AAkEA,eAAetE,KAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport * as ReactDOM from 'react-dom';\nimport debounce from '../utils/debounce';\nimport { Transition } from 'react-transition-group';\nimport { elementAcceptingRef } from '@material-ui/utils';\nimport useForkRef from '../utils/useForkRef';\nimport useTheme from '../styles/useTheme';\nimport { duration } from '../styles/transitions';\nimport { reflow, getTransitionProps } from '../transitions/utils'; // Translate the node so he can't be seen on the screen.\n// Later, we gonna translate back the node to his original location\n// with `none`.`\n\nfunction getTranslateValue(direction, node) {\n var rect = node.getBoundingClientRect();\n var transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n var computedStyle = window.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n var offsetX = 0;\n var offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n return \"translateX(\".concat(window.innerWidth, \"px) translateX(\").concat(offsetX - rect.left, \"px)\");\n }\n\n if (direction === 'right') {\n return \"translateX(-\".concat(rect.left + rect.width - offsetX, \"px)\");\n }\n\n if (direction === 'up') {\n return \"translateY(\".concat(window.innerHeight, \"px) translateY(\").concat(offsetY - rect.top, \"px)\");\n } // direction === 'down'\n\n\n return \"translateY(-\".concat(rect.top + rect.height - offsetY, \"px)\");\n}\n\nexport function setTranslateValue(direction, node) {\n var transform = getTranslateValue(direction, node);\n\n if (transform) {\n node.style.webkitTransform = transform;\n node.style.transform = transform;\n }\n}\nvar defaultTimeout = {\n enter: duration.enteringScreen,\n exit: duration.leavingScreen\n};\n/**\n * The Slide transition is used by the [Drawer](/components/drawers/) component.\n * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.\n */\n\nvar Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {\n var children = props.children,\n _props$direction = props.direction,\n direction = _props$direction === void 0 ? 'down' : _props$direction,\n inProp = props.in,\n onEnter = props.onEnter,\n onEntered = props.onEntered,\n onEntering = props.onEntering,\n onExit = props.onExit,\n onExited = props.onExited,\n onExiting = props.onExiting,\n style = props.style,\n _props$timeout = props.timeout,\n timeout = _props$timeout === void 0 ? defaultTimeout : _props$timeout,\n _props$TransitionComp = props.TransitionComponent,\n TransitionComponent = _props$TransitionComp === void 0 ? Transition : _props$TransitionComp,\n other = _objectWithoutProperties(props, [\"children\", \"direction\", \"in\", \"onEnter\", \"onEntered\", \"onEntering\", \"onExit\", \"onExited\", \"onExiting\", \"style\", \"timeout\", \"TransitionComponent\"]);\n\n var theme = useTheme();\n var childrenRef = React.useRef(null);\n /**\n * used in cloneElement(children, { ref: handleRef })\n */\n\n var handleOwnRef = React.useCallback(function (instance) {\n // #StrictMode ready\n childrenRef.current = ReactDOM.findDOMNode(instance);\n }, []);\n var handleRefIntermediary = useForkRef(children.ref, handleOwnRef);\n var handleRef = useForkRef(handleRefIntermediary, ref);\n\n var normalizedTransitionCallback = function normalizedTransitionCallback(callback) {\n return function (isAppearing) {\n if (callback) {\n // onEnterXxx and onExitXxx callbacks have a different arguments.length value.\n if (isAppearing === undefined) {\n callback(childrenRef.current);\n } else {\n callback(childrenRef.current, isAppearing);\n }\n }\n };\n };\n\n var handleEnter = normalizedTransitionCallback(function (node, isAppearing) {\n setTranslateValue(direction, node);\n reflow(node);\n\n if (onEnter) {\n onEnter(node, isAppearing);\n }\n });\n var handleEntering = normalizedTransitionCallback(function (node, isAppearing) {\n var transitionProps = getTransitionProps({\n timeout: timeout,\n style: style\n }, {\n mode: 'enter'\n });\n node.style.webkitTransition = theme.transitions.create('-webkit-transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.easeOut\n }));\n node.style.transition = theme.transitions.create('transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.easeOut\n }));\n node.style.webkitTransform = 'none';\n node.style.transform = 'none';\n\n if (onEntering) {\n onEntering(node, isAppearing);\n }\n });\n var handleEntered = normalizedTransitionCallback(onEntered);\n var handleExiting = normalizedTransitionCallback(onExiting);\n var handleExit = normalizedTransitionCallback(function (node) {\n var transitionProps = getTransitionProps({\n timeout: timeout,\n style: style\n }, {\n mode: 'exit'\n });\n node.style.webkitTransition = theme.transitions.create('-webkit-transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.sharp\n }));\n node.style.transition = theme.transitions.create('transform', _extends({}, transitionProps, {\n easing: theme.transitions.easing.sharp\n }));\n setTranslateValue(direction, node);\n\n if (onExit) {\n onExit(node);\n }\n });\n var handleExited = normalizedTransitionCallback(function (node) {\n // No need for transitions when the component is hidden\n node.style.webkitTransition = '';\n node.style.transition = '';\n\n if (onExited) {\n onExited(node);\n }\n });\n var updatePosition = React.useCallback(function () {\n if (childrenRef.current) {\n setTranslateValue(direction, childrenRef.current);\n }\n }, [direction]);\n React.useEffect(function () {\n // Skip configuration where the position is screen size invariant.\n if (inProp || direction === 'down' || direction === 'right') {\n return undefined;\n }\n\n var handleResize = debounce(function () {\n if (childrenRef.current) {\n setTranslateValue(direction, childrenRef.current);\n }\n });\n window.addEventListener('resize', handleResize);\n return function () {\n handleResize.clear();\n window.removeEventListener('resize', handleResize);\n };\n }, [direction, inProp]);\n React.useEffect(function () {\n if (!inProp) {\n // We need to update the position of the drawer when the direction change and\n // when it's hidden.\n updatePosition();\n }\n }, [inProp, updatePosition]);\n return /*#__PURE__*/React.createElement(TransitionComponent, _extends({\n nodeRef: childrenRef,\n onEnter: handleEnter,\n onEntered: handleEntered,\n onEntering: handleEntering,\n onExit: handleExit,\n onExited: handleExited,\n onExiting: handleExiting,\n appear: true,\n in: inProp,\n timeout: timeout\n }, other), function (state, childProps) {\n return /*#__PURE__*/React.cloneElement(children, _extends({\n ref: handleRef,\n style: _extends({\n visibility: state === 'exited' && !inProp ? 'hidden' : undefined\n }, style, children.props.style)\n }, childProps));\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Slide.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 single child content element.\n */\n children: elementAcceptingRef,\n\n /**\n * Direction the child node will enter from.\n */\n direction: PropTypes.oneOf(['down', 'left', 'right', 'up']),\n\n /**\n * If `true`, show the component; triggers the enter or exit animation.\n */\n in: PropTypes.bool,\n\n /**\n * @ignore\n */\n onEnter: PropTypes.func,\n\n /**\n * @ignore\n */\n onEntered: PropTypes.func,\n\n /**\n * @ignore\n */\n onEntering: PropTypes.func,\n\n /**\n * @ignore\n */\n onExit: PropTypes.func,\n\n /**\n * @ignore\n */\n onExited: PropTypes.func,\n\n /**\n * @ignore\n */\n onExiting: PropTypes.func,\n\n /**\n * @ignore\n */\n style: PropTypes.object,\n\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n */\n timeout: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })])\n} : void 0;\nexport default Slide;"]},"metadata":{},"sourceType":"module"}