You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
6.5 KiB

{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"active\", \"children\", \"onRequestClose\", \"transparent\"];\nimport * as React from 'react';\nimport View from \"../View\";\nimport StyleSheet from \"../StyleSheet\";\nimport canUseDOM from \"../../modules/canUseDom\";\nvar ModalContent = React.forwardRef(function (props, forwardedRef) {\n var active = props.active,\n children = props.children,\n onRequestClose = props.onRequestClose,\n transparent = props.transparent,\n rest = _objectWithoutPropertiesLoose(props, _excluded);\n React.useEffect(function () {\n if (canUseDOM) {\n var closeOnEscape = function closeOnEscape(e) {\n if (active && e.key === 'Escape') {\n e.stopPropagation();\n if (onRequestClose) {\n onRequestClose();\n }\n }\n };\n document.addEventListener('keyup', closeOnEscape, false);\n return function () {\n return document.removeEventListener('keyup', closeOnEscape, false);\n };\n }\n }, [active, onRequestClose]);\n var style = React.useMemo(function () {\n return [styles.modal, transparent ? styles.modalTransparent : styles.modalOpaque];\n }, [transparent]);\n return React.createElement(View, _extends({}, rest, {\n accessibilityModal: true,\n accessibilityRole: active ? 'dialog' : null,\n ref: forwardedRef,\n style: style\n }), React.createElement(View, {\n style: styles.container\n }, children));\n});\nvar styles = StyleSheet.create({\n modal: {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n modalTransparent: {\n backgroundColor: 'transparent'\n },\n modalOpaque: {\n backgroundColor: 'white'\n },\n container: {\n top: 0,\n flex: 1\n }\n});\nexport default ModalContent;","map":{"version":3,"names":["_extends","_objectWithoutPropertiesLoose","_excluded","React","View","StyleSheet","canUseDOM","ModalContent","forwardRef","props","forwardedRef","active","children","onRequestClose","transparent","rest","useEffect","closeOnEscape","e","key","stopPropagation","document","addEventListener","removeEventListener","style","useMemo","styles","modal","modalTransparent","modalOpaque","createElement","accessibilityModal","accessibilityRole","ref","container","create","position","top","right","bottom","left","backgroundColor","flex"],"sources":["/Users/thomaschazot/Documents/But2A/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/exports/Modal/ModalContent.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nvar _excluded = [\"active\", \"children\", \"onRequestClose\", \"transparent\"];\n\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport * as React from 'react';\nimport View from '../View';\nimport StyleSheet from '../StyleSheet';\nimport canUseDOM from '../../modules/canUseDom';\nvar ModalContent = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {\n var active = props.active,\n children = props.children,\n onRequestClose = props.onRequestClose,\n transparent = props.transparent,\n rest = _objectWithoutPropertiesLoose(props, _excluded);\n\n React.useEffect(() => {\n if (canUseDOM) {\n var closeOnEscape = e => {\n if (active && e.key === 'Escape') {\n e.stopPropagation();\n\n if (onRequestClose) {\n onRequestClose();\n }\n }\n };\n\n document.addEventListener('keyup', closeOnEscape, false);\n return () => document.removeEventListener('keyup', closeOnEscape, false);\n }\n }, [active, onRequestClose]);\n var style = React.useMemo(() => {\n return [styles.modal, transparent ? styles.modalTransparent : styles.modalOpaque];\n }, [transparent]);\n return /*#__PURE__*/React.createElement(View, _extends({}, rest, {\n accessibilityModal: true,\n accessibilityRole: active ? 'dialog' : null,\n ref: forwardedRef,\n style: style\n }), /*#__PURE__*/React.createElement(View, {\n style: styles.container\n }, children));\n});\nvar styles = StyleSheet.create({\n modal: {\n position: 'fixed',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n modalTransparent: {\n backgroundColor: 'transparent'\n },\n modalOpaque: {\n backgroundColor: 'white'\n },\n container: {\n top: 0,\n flex: 1\n }\n});\nexport default ModalCont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