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

{"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,YAAT,QAA6B,WAA7B;AACA,SAASC,eAAT,QAAgC,cAAhC;AACA,OAAO,SAASC,wBAAT,CAAkCC,UAAlC,EAA8C;EACjD,SAASC,kBAAT,CAA4BC,KAA5B,EAAmCC,YAAnC,EAAiD;IAC7C,MAAM;MAAEC,QAAF;MAAaC;IAAb,IAA0BL,UAAU,CAACE,KAAD,CAAV,CAAkBI,OAAlD;IACAX,mBAAmB,CAACQ,YAAD,EAAe,MAAIC,QAAnB,CAAnB;IAEA,OAAOF,KAAK,CAACK,QAAN,IAAkB,IAAlB,GAAyB,IAAzB,GAAgC,aAAcf,KAAK,CAACgB,aAAN,CAAoBV,eAApB,EAAqC;MACtFW,KAAK,EAAEJ;IAD+E,CA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