REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.96 KB
Close
/home/byroehnu/easepay.easetack.com/node_modules/react-popper/lib/cjs/usePopper.js.flow
Text
Base64
// @flow strict import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { createPopper as defaultCreatePopper, type Options as PopperOptions, type VirtualElement, type State as PopperState, type Instance as PopperInstance, } from '@popperjs/core'; import isEqual from 'react-fast-compare'; import { fromEntries, useIsomorphicLayoutEffect } from './utils'; type Options = $Shape<{ ...PopperOptions, createPopper: typeof defaultCreatePopper, }>; type Styles = { [key: string]: $Shape<CSSStyleDeclaration>, }; type Attributes = { [key: string]: { [key: string]: string }, }; type State = { styles: Styles, attributes: Attributes, }; const EMPTY_MODIFIERS = []; type UsePopperResult = $ReadOnly<{ state: ?PopperState, styles: Styles, attributes: Attributes, update: ?$PropertyType<PopperInstance, 'update'>, forceUpdate: ?$PropertyType<PopperInstance, 'forceUpdate'>, }>; export const usePopper = ( referenceElement: ?(Element | VirtualElement), popperElement: ?HTMLElement, options: Options = {} ): UsePopperResult => { const prevOptions = React.useRef<?PopperOptions>(null); const optionsWithDefaults = { onFirstUpdate: options.onFirstUpdate, placement: options.placement || 'bottom', strategy: options.strategy || 'absolute', modifiers: options.modifiers || EMPTY_MODIFIERS, }; const [state, setState] = React.useState<State>({ styles: { popper: { position: optionsWithDefaults.strategy, left: '0', top: '0', }, arrow: { position: 'absolute', }, }, attributes: {}, }); const updateStateModifier = React.useMemo( () => ({ name: 'updateState', enabled: true, phase: 'write', fn: ({ state }) => { const elements = Object.keys(state.elements); ReactDOM.flushSync(() => { setState({ styles: fromEntries( elements.map((element) => [element, state.styles[element] || {}]) ), attributes: fromEntries( elements.map((element) => [element, state.attributes[element]]) ), }); }); }, requires: ['computeStyles'], }), [] ); const popperOptions = React.useMemo(() => { const newOptions = { onFirstUpdate: optionsWithDefaults.onFirstUpdate, placement: optionsWithDefaults.placement, strategy: optionsWithDefaults.strategy, modifiers: [ ...optionsWithDefaults.modifiers, updateStateModifier, { name: 'applyStyles', enabled: false }, ], }; if (isEqual(prevOptions.current, newOptions)) { return prevOptions.current || newOptions; } else { prevOptions.current = newOptions; return newOptions; } }, [ optionsWithDefaults.onFirstUpdate, optionsWithDefaults.placement, optionsWithDefaults.strategy, optionsWithDefaults.modifiers, updateStateModifier, ]); const popperInstanceRef = React.useRef(); useIsomorphicLayoutEffect(() => { if (popperInstanceRef.current) { popperInstanceRef.current.setOptions(popperOptions); } }, [popperOptions]); useIsomorphicLayoutEffect(() => { if (referenceElement == null || popperElement == null) { return; } const createPopper = options.createPopper || defaultCreatePopper; const popperInstance = createPopper( referenceElement, popperElement, popperOptions ); popperInstanceRef.current = popperInstance; return () => { popperInstance.destroy(); popperInstanceRef.current = null; }; }, [referenceElement, popperElement, options.createPopper]); return { state: popperInstanceRef.current ? popperInstanceRef.current.state : null, styles: state.styles, attributes: state.attributes, update: popperInstanceRef.current ? popperInstanceRef.current.update : null, forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null, }; };
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 15
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__typings__
DIR
-
drwxr-xr-x
2026-03-14 01:49:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
.htaccess
127 B
lr--r--r--
2026-03-14 01:49:21
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
746 B
lrw-r--r--
2026-02-28 00:28:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js.flow
607 B
lrw-r--r--
2026-02-28 00:28:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Manager.js
2.16 KB
lrw-r--r--
2026-02-28 00:27:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Manager.js.flow
1.03 KB
lrw-r--r--
2026-02-28 00:27:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Popper.js
3.66 KB
lrw-r--r--
2026-02-28 00:28:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Popper.js.flow
3.04 KB
lrw-r--r--
2026-02-28 00:28:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Reference.js
2.13 KB
lrw-r--r--
2026-02-28 00:28:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Reference.js.flow
1.12 KB
lrw-r--r--
2026-02-28 00:28:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RefTypes.js
13 B
lrw-r--r--
2026-02-28 00:28:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RefTypes.js.flow
145 B
lrw-r--r--
2026-02-28 00:28:12
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
usePopper.js
4.61 KB
lrw-r--r--
2026-02-28 00:28:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
usePopper.js.flow
3.96 KB
lrw-r--r--
2026-02-28 00:28:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.js
2.81 KB
lrw-r--r--
2026-02-28 00:28:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.js.flow
1.46 KB
lrw-r--r--
2026-02-28 00:28:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).