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
5.4 KiB

2 years ago
{"ast":null,"code":"import React, { forwardRef, useEffect, useImperativeHandle, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { LeafletProvider } from './context.js';\nexport function createContainerComponent(useElement) {\n function ContainerComponent(props, forwardedRef) {\n const {\n instance,\n context\n } = useElement(props).current;\n useImperativeHandle(forwardedRef, () => instance);\n return props.children == null ? null : /*#__PURE__*/React.createElement(LeafletProvider, {\n value: context\n }, props.children);\n }\n\n return /*#__PURE__*/forwardRef(ContainerComponent);\n}\nexport function createDivOverlayComponent(useElement) {\n function OverlayComponent(props, forwardedRef) {\n const [isOpen, setOpen] = useState(false);\n const {\n instance\n } = useElement(props, setOpen).current;\n useImperativeHandle(forwardedRef, () => instance);\n useEffect(function updateOverlay() {\n if (isOpen) {\n instance.update();\n }\n }, [instance, isOpen, props.children]); // @ts-ignore _contentNode missing in type definition\n\n const contentNode = instance._contentNode;\n return contentNode ? /*#__PURE__*/createPortal(props.children, contentNode) : null;\n }\n\n return /*#__PURE__*/forwardRef(OverlayComponent);\n}\nexport function createLeafComponent(useElement) {\n function LeafComponent(props, forwardedRef) {\n const {\n instance\n } = useElement(props).current;\n useImperativeHandle(forwardedRef, () => instance);\n return null;\n }\n\n return /*#__PURE__*/forwardRef(LeafComponent);\n}","map":{"version":3,"names":["React","forwardRef","useEffect","useImperativeHandle","useState","createPortal","LeafletProvider","createContainerComponent","useElement","ContainerComponent","props","forwardedRef","instance","context","current","children","createElement","value","createDivOverlayComponent","OverlayComponent","isOpen","setOpen","updateOverlay","update","contentNode","_contentNode","createLeafComponent","LeafComponent"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/@react-leaflet/core/lib/component.js"],"sourcesContent":["import React, { forwardRef, useEffect, useImperativeHandle, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { LeafletProvider } from './context.js';\nexport function createContainerComponent(useElement) {\n function ContainerComponent(props, forwardedRef) {\n const { instance , context } = useElement(props).current;\n useImperativeHandle(forwardedRef, ()=>instance\n );\n return props.children == null ? null : /*#__PURE__*/ React.createElement(LeafletProvider, {\n value: context\n }, props.children);\n }\n return /*#__PURE__*/ forwardRef(ContainerComponent);\n}\nexport function createDivOverlayComponent(useElement) {\n function OverlayComponent(props, forwardedRef) {\n const [isOpen, setOpen] = useState(false);\n const { instance } = useElement(props, setOpen).current;\n useImperativeHandle(forwardedRef, ()=>instance\n );\n useEffect(function updateOverlay() {\n if (isOpen) {\n instance.update();\n }\n }, [\n instance,\n isOpen,\n props.children\n ]);\n // @ts-ignore _contentNode missing in type definition\n const contentNode = instance._contentNode;\n return contentNode ? /*#__PURE__*/ createPortal(props.children, contentNode) : null;\n }\n return /*#__PURE__*/ forwardRef(OverlayComponent);\n}\nexport function createLeafComponent(useElement) {\n function LeafComponent(props, forwardedRef) {\n const { instance } = useElement(props).current;\n useImperativeHandle(forwardedRef, ()=>instance\n );\n return null;\n }\n return /*#__PURE__*/ forwardRef(LeafComponent);\n}\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,UAAhB,EAA4BC,SAA5B,EAAuCC,mBAAvC,EAA4DC,QAA5D,QAA4E,OAA5E;AACA,SAASC,Y