@floating-ui/dom
Advanced tools
| import { AlignedPlacement } from '@floating-ui/core'; | ||
| import { Alignment } from '@floating-ui/core'; | ||
| import type { ArrowOptions as ArrowOptions_2 } from '@floating-ui/core'; | ||
| import type { AutoPlacementOptions as AutoPlacementOptions_2 } from '@floating-ui/core'; | ||
| import { Axis } from '@floating-ui/core'; | ||
| import { ClientRectObject } from '@floating-ui/core'; | ||
| import type { ComputePositionConfig as ComputePositionConfig_2 } from '@floating-ui/core'; | ||
| import { ComputePositionReturn } from '@floating-ui/core'; | ||
| import { Coords } from '@floating-ui/core'; | ||
| import type { Derivable as Derivable_2 } from '@floating-ui/core'; | ||
| import { detectOverflow } from '@floating-ui/core'; | ||
| import type { DetectOverflowOptions as DetectOverflowOptions_2 } from '@floating-ui/core'; | ||
| import { Dimensions } from '@floating-ui/core'; | ||
| import { ElementContext } from '@floating-ui/core'; | ||
| import { ElementRects } from '@floating-ui/core'; | ||
| import type { FlipOptions as FlipOptions_2 } from '@floating-ui/core'; | ||
| import { getOverflowAncestors } from '@floating-ui/utils/dom'; | ||
| import type { HideOptions as HideOptions_2 } from '@floating-ui/core'; | ||
| import { InlineOptions } from '@floating-ui/core'; | ||
| import { Length } from '@floating-ui/core'; | ||
| import type { LimitShiftOptions } from '@floating-ui/core'; | ||
| import type { Middleware as Middleware_2 } from '@floating-ui/core'; | ||
| import { MiddlewareData } from '@floating-ui/core'; | ||
| import { MiddlewareReturn } from '@floating-ui/core'; | ||
| import type { MiddlewareState as MiddlewareState_2 } from '@floating-ui/core'; | ||
| import { offset } from '@floating-ui/core'; | ||
| import { OffsetOptions } from '@floating-ui/core'; | ||
| import { Padding } from '@floating-ui/core'; | ||
| import { Placement } from '@floating-ui/core'; | ||
| import { Rect } from '@floating-ui/core'; | ||
| import { RootBoundary } from '@floating-ui/core'; | ||
| import type { ShiftOptions as ShiftOptions_2 } from '@floating-ui/core'; | ||
| import { Side } from '@floating-ui/core'; | ||
| import { SideObject } from '@floating-ui/core'; | ||
| import type { SizeOptions as SizeOptions_2 } from '@floating-ui/core'; | ||
| import { Strategy } from '@floating-ui/core'; | ||
| export { AlignedPlacement } | ||
| export { Alignment } | ||
| /** | ||
| * Provides data to position an inner element of the floating element so that it | ||
| * appears centered to the reference element. | ||
| * @see https://floating-ui.com/docs/arrow | ||
| */ | ||
| export declare const arrow: (options: ArrowOptions | Derivable_2<ArrowOptions>) => Middleware; | ||
| export declare type ArrowOptions = Prettify<Omit<ArrowOptions_2, 'element'> & { | ||
| element: Element; | ||
| }>; | ||
| /** | ||
| * Optimizes the visibility of the floating element by choosing the placement | ||
| * that has the most space available automatically, without needing to specify a | ||
| * preferred placement. Alternative to `flip`. | ||
| * @see https://floating-ui.com/docs/autoPlacement | ||
| */ | ||
| export declare const autoPlacement: (options?: AutoPlacementOptions | Derivable_2<AutoPlacementOptions>) => Middleware; | ||
| export declare type AutoPlacementOptions = Prettify<Omit<AutoPlacementOptions_2, 'boundary'> & DetectOverflowOptions>; | ||
| /** | ||
| * Automatically updates the position of the floating element when necessary. | ||
| * Should only be called when the floating element is mounted on the DOM or | ||
| * visible on the screen. | ||
| * @returns cleanup function that should be invoked when the floating element is | ||
| * removed from the DOM or hidden from the screen. | ||
| * @see https://floating-ui.com/docs/autoUpdate | ||
| */ | ||
| export declare function autoUpdate(reference: ReferenceElement, floating: FloatingElement, update: () => void, options?: AutoUpdateOptions): () => void; | ||
| export declare type AutoUpdateOptions = Partial<{ | ||
| /** | ||
| * Whether to update the position when an overflow ancestor is scrolled. | ||
| * @default true | ||
| */ | ||
| ancestorScroll: boolean; | ||
| /** | ||
| * Whether to update the position when an overflow ancestor is resized. This | ||
| * uses the native `resize` event. | ||
| * @default true | ||
| */ | ||
| ancestorResize: boolean; | ||
| /** | ||
| * Whether to update the position when either the reference or floating | ||
| * elements resized. This uses a `ResizeObserver`. | ||
| * @default true | ||
| */ | ||
| elementResize: boolean; | ||
| /** | ||
| * Whether to update the position when the reference relocated on the screen | ||
| * due to layout shift. | ||
| * @default true | ||
| */ | ||
| layoutShift: boolean; | ||
| /** | ||
| * Whether to update on every animation frame if necessary. Only use if you | ||
| * need to update the position in response to an animation using transforms. | ||
| * @default false | ||
| */ | ||
| animationFrame: boolean; | ||
| }>; | ||
| export { Axis } | ||
| /** | ||
| * The clipping boundary area of the floating element. | ||
| */ | ||
| export declare type Boundary = 'clippingAncestors' | Element | Array<Element> | Rect; | ||
| export { ClientRectObject } | ||
| /** | ||
| * Computes the `x` and `y` coordinates that will place the floating element | ||
| * next to a given reference element. | ||
| */ | ||
| export declare const computePosition: (reference: ReferenceElement, floating: FloatingElement, options?: Partial<ComputePositionConfig>) => Promise<ComputePositionReturn>; | ||
| export declare type ComputePositionConfig = Prettify<Omit<ComputePositionConfig_2, 'middleware' | 'platform'> & { | ||
| /** | ||
| * Array of middleware objects to modify the positioning or provide data for | ||
| * rendering. | ||
| */ | ||
| middleware?: Array<Middleware | null | undefined | false>; | ||
| /** | ||
| * Custom or extended platform object. | ||
| */ | ||
| platform?: Platform; | ||
| }>; | ||
| export { ComputePositionReturn } | ||
| export { Coords } | ||
| export declare type Derivable<T> = (state: MiddlewareState) => T; | ||
| export { detectOverflow } | ||
| export declare type DetectOverflowOptions = Prettify<Omit<DetectOverflowOptions_2, 'boundary'> & { | ||
| boundary?: Boundary; | ||
| }>; | ||
| export { Dimensions } | ||
| export { ElementContext } | ||
| export { ElementRects } | ||
| export declare interface Elements { | ||
| reference: ReferenceElement; | ||
| floating: FloatingElement; | ||
| } | ||
| /** | ||
| * Optimizes the visibility of the floating element by flipping the `placement` | ||
| * in order to keep it in view when the preferred placement(s) will overflow the | ||
| * clipping boundary. Alternative to `autoPlacement`. | ||
| * @see https://floating-ui.com/docs/flip | ||
| */ | ||
| export declare const flip: (options?: FlipOptions | Derivable_2<FlipOptions>) => Middleware; | ||
| export declare type FlipOptions = Prettify<Omit<FlipOptions_2, 'boundary'> & DetectOverflowOptions>; | ||
| export declare type FloatingElement = HTMLElement; | ||
| export { getOverflowAncestors } | ||
| /** | ||
| * Provides data to hide the floating element in applicable situations, such as | ||
| * when it is not in the same clipping context as the reference element. | ||
| * @see https://floating-ui.com/docs/hide | ||
| */ | ||
| export declare const hide: (options?: HideOptions | Derivable_2<HideOptions>) => Middleware; | ||
| export declare type HideOptions = Prettify<Omit<HideOptions_2, 'boundary'> & DetectOverflowOptions>; | ||
| /** | ||
| * Provides improved positioning for inline reference elements that can span | ||
| * over multiple lines, such as hyperlinks or range selections. | ||
| * @see https://floating-ui.com/docs/inline | ||
| */ | ||
| export declare const inline: (options?: InlineOptions | Derivable_2<InlineOptions>) => Middleware; | ||
| export { InlineOptions } | ||
| export { Length } | ||
| /** | ||
| * Built-in `limiter` that will stop `shift()` at a certain point. | ||
| */ | ||
| export declare const limitShift: (options?: LimitShiftOptions | Derivable_2<LimitShiftOptions>) => { | ||
| options: any; | ||
| fn: (state: MiddlewareState) => Coords; | ||
| }; | ||
| export declare type Middleware = Prettify<Omit<Middleware_2, 'fn'> & { | ||
| fn(state: MiddlewareState): Promisable<MiddlewareReturn>; | ||
| }>; | ||
| /** | ||
| * @deprecated use `MiddlewareState` instead. | ||
| */ | ||
| export declare type MiddlewareArguments = MiddlewareState; | ||
| export { MiddlewareData } | ||
| export { MiddlewareReturn } | ||
| export declare type MiddlewareState = Prettify<Omit<MiddlewareState_2, 'elements'> & { | ||
| elements: Elements; | ||
| }>; | ||
| export declare interface NodeScroll { | ||
| scrollLeft: number; | ||
| scrollTop: number; | ||
| } | ||
| export { offset } | ||
| export { OffsetOptions } | ||
| export { Padding } | ||
| export { Placement } | ||
| export declare interface Platform { | ||
| getElementRects: (args: { | ||
| reference: ReferenceElement; | ||
| floating: FloatingElement; | ||
| strategy: Strategy; | ||
| }) => Promisable<ElementRects>; | ||
| getClippingRect: (args: { | ||
| element: Element; | ||
| boundary: Boundary; | ||
| rootBoundary: RootBoundary; | ||
| strategy: Strategy; | ||
| }) => Promisable<Rect>; | ||
| getDimensions: (element: Element) => Promisable<Dimensions>; | ||
| convertOffsetParentRelativeRectToViewportRelativeRect?: (args: { | ||
| rect: Rect; | ||
| offsetParent: Element; | ||
| strategy: Strategy; | ||
| }) => Promisable<Rect>; | ||
| getOffsetParent?: (element: Element, polyfill?: (element: HTMLElement) => Element | null) => Promisable<Element | Window>; | ||
| isElement?: (value: unknown) => Promisable<boolean>; | ||
| getDocumentElement?: (element: Element) => Promisable<HTMLElement>; | ||
| getClientRects?: (element: Element) => Promisable<Array<ClientRectObject>>; | ||
| isRTL?: (element: Element) => Promisable<boolean>; | ||
| getScale?: (element: HTMLElement) => Promisable<{ | ||
| x: number; | ||
| y: number; | ||
| }>; | ||
| } | ||
| export declare const platform: Required<Platform>; | ||
| declare type Prettify<T> = { | ||
| [K in keyof T]: T[K]; | ||
| } & {}; | ||
| declare type Promisable<T> = T | Promise<T>; | ||
| export { Rect } | ||
| export declare type ReferenceElement = Element | VirtualElement; | ||
| export { RootBoundary } | ||
| /** | ||
| * Optimizes the visibility of the floating element by shifting it in order to | ||
| * keep it in view when it will overflow the clipping boundary. | ||
| * @see https://floating-ui.com/docs/shift | ||
| */ | ||
| export declare const shift: (options?: ShiftOptions | Derivable_2<ShiftOptions>) => Middleware; | ||
| export declare type ShiftOptions = Prettify<Omit<ShiftOptions_2, 'boundary'> & DetectOverflowOptions>; | ||
| export { Side } | ||
| export { SideObject } | ||
| /** | ||
| * Provides data that allows you to change the size of the floating element — | ||
| * for instance, prevent it from overflowing the clipping boundary or match the | ||
| * width of the reference element. | ||
| * @see https://floating-ui.com/docs/size | ||
| */ | ||
| export declare const size: (options?: SizeOptions | Derivable_2<SizeOptions>) => Middleware; | ||
| export declare type SizeOptions = Prettify<Omit<SizeOptions_2, 'apply' | 'boundary'> & DetectOverflowOptions & { | ||
| /** | ||
| * Function that is called to perform style mutations to the floating element | ||
| * to change its size. | ||
| * @default undefined | ||
| */ | ||
| apply?(args: MiddlewareState & { | ||
| availableWidth: number; | ||
| availableHeight: number; | ||
| }): Promisable<void>; | ||
| }>; | ||
| export { Strategy } | ||
| /** | ||
| * Custom positioning reference element. | ||
| * @see https://floating-ui.com/docs/virtual-elements | ||
| */ | ||
| export declare interface VirtualElement { | ||
| getBoundingClientRect(): ClientRectObject; | ||
| contextElement?: Element; | ||
| } | ||
| export { } |
| import { AlignedPlacement } from '@floating-ui/core'; | ||
| import { Alignment } from '@floating-ui/core'; | ||
| import type { ArrowOptions as ArrowOptions_2 } from '@floating-ui/core'; | ||
| import type { AutoPlacementOptions as AutoPlacementOptions_2 } from '@floating-ui/core'; | ||
| import { Axis } from '@floating-ui/core'; | ||
| import { ClientRectObject } from '@floating-ui/core'; | ||
| import type { ComputePositionConfig as ComputePositionConfig_2 } from '@floating-ui/core'; | ||
| import { ComputePositionReturn } from '@floating-ui/core'; | ||
| import { Coords } from '@floating-ui/core'; | ||
| import type { Derivable as Derivable_2 } from '@floating-ui/core'; | ||
| import { detectOverflow } from '@floating-ui/core'; | ||
| import type { DetectOverflowOptions as DetectOverflowOptions_2 } from '@floating-ui/core'; | ||
| import { Dimensions } from '@floating-ui/core'; | ||
| import { ElementContext } from '@floating-ui/core'; | ||
| import { ElementRects } from '@floating-ui/core'; | ||
| import type { FlipOptions as FlipOptions_2 } from '@floating-ui/core'; | ||
| import { getOverflowAncestors } from '@floating-ui/utils/dom'; | ||
| import type { HideOptions as HideOptions_2 } from '@floating-ui/core'; | ||
| import { InlineOptions } from '@floating-ui/core'; | ||
| import { Length } from '@floating-ui/core'; | ||
| import type { LimitShiftOptions } from '@floating-ui/core'; | ||
| import type { Middleware as Middleware_2 } from '@floating-ui/core'; | ||
| import { MiddlewareData } from '@floating-ui/core'; | ||
| import { MiddlewareReturn } from '@floating-ui/core'; | ||
| import type { MiddlewareState as MiddlewareState_2 } from '@floating-ui/core'; | ||
| import { offset } from '@floating-ui/core'; | ||
| import { OffsetOptions } from '@floating-ui/core'; | ||
| import { Padding } from '@floating-ui/core'; | ||
| import { Placement } from '@floating-ui/core'; | ||
| import { Rect } from '@floating-ui/core'; | ||
| import { RootBoundary } from '@floating-ui/core'; | ||
| import type { ShiftOptions as ShiftOptions_2 } from '@floating-ui/core'; | ||
| import { Side } from '@floating-ui/core'; | ||
| import { SideObject } from '@floating-ui/core'; | ||
| import type { SizeOptions as SizeOptions_2 } from '@floating-ui/core'; | ||
| import { Strategy } from '@floating-ui/core'; | ||
| export { AlignedPlacement } | ||
| export { Alignment } | ||
| /** | ||
| * Provides data to position an inner element of the floating element so that it | ||
| * appears centered to the reference element. | ||
| * @see https://floating-ui.com/docs/arrow | ||
| */ | ||
| export declare const arrow: (options: ArrowOptions | Derivable_2<ArrowOptions>) => Middleware; | ||
| export declare type ArrowOptions = Prettify<Omit<ArrowOptions_2, 'element'> & { | ||
| element: Element; | ||
| }>; | ||
| /** | ||
| * Optimizes the visibility of the floating element by choosing the placement | ||
| * that has the most space available automatically, without needing to specify a | ||
| * preferred placement. Alternative to `flip`. | ||
| * @see https://floating-ui.com/docs/autoPlacement | ||
| */ | ||
| export declare const autoPlacement: (options?: AutoPlacementOptions | Derivable_2<AutoPlacementOptions>) => Middleware; | ||
| export declare type AutoPlacementOptions = Prettify<Omit<AutoPlacementOptions_2, 'boundary'> & DetectOverflowOptions>; | ||
| /** | ||
| * Automatically updates the position of the floating element when necessary. | ||
| * Should only be called when the floating element is mounted on the DOM or | ||
| * visible on the screen. | ||
| * @returns cleanup function that should be invoked when the floating element is | ||
| * removed from the DOM or hidden from the screen. | ||
| * @see https://floating-ui.com/docs/autoUpdate | ||
| */ | ||
| export declare function autoUpdate(reference: ReferenceElement, floating: FloatingElement, update: () => void, options?: AutoUpdateOptions): () => void; | ||
| export declare type AutoUpdateOptions = Partial<{ | ||
| /** | ||
| * Whether to update the position when an overflow ancestor is scrolled. | ||
| * @default true | ||
| */ | ||
| ancestorScroll: boolean; | ||
| /** | ||
| * Whether to update the position when an overflow ancestor is resized. This | ||
| * uses the native `resize` event. | ||
| * @default true | ||
| */ | ||
| ancestorResize: boolean; | ||
| /** | ||
| * Whether to update the position when either the reference or floating | ||
| * elements resized. This uses a `ResizeObserver`. | ||
| * @default true | ||
| */ | ||
| elementResize: boolean; | ||
| /** | ||
| * Whether to update the position when the reference relocated on the screen | ||
| * due to layout shift. | ||
| * @default true | ||
| */ | ||
| layoutShift: boolean; | ||
| /** | ||
| * Whether to update on every animation frame if necessary. Only use if you | ||
| * need to update the position in response to an animation using transforms. | ||
| * @default false | ||
| */ | ||
| animationFrame: boolean; | ||
| }>; | ||
| export { Axis } | ||
| /** | ||
| * The clipping boundary area of the floating element. | ||
| */ | ||
| export declare type Boundary = 'clippingAncestors' | Element | Array<Element> | Rect; | ||
| export { ClientRectObject } | ||
| /** | ||
| * Computes the `x` and `y` coordinates that will place the floating element | ||
| * next to a given reference element. | ||
| */ | ||
| export declare const computePosition: (reference: ReferenceElement, floating: FloatingElement, options?: Partial<ComputePositionConfig>) => Promise<ComputePositionReturn>; | ||
| export declare type ComputePositionConfig = Prettify<Omit<ComputePositionConfig_2, 'middleware' | 'platform'> & { | ||
| /** | ||
| * Array of middleware objects to modify the positioning or provide data for | ||
| * rendering. | ||
| */ | ||
| middleware?: Array<Middleware | null | undefined | false>; | ||
| /** | ||
| * Custom or extended platform object. | ||
| */ | ||
| platform?: Platform; | ||
| }>; | ||
| export { ComputePositionReturn } | ||
| export { Coords } | ||
| export declare type Derivable<T> = (state: MiddlewareState) => T; | ||
| export { detectOverflow } | ||
| export declare type DetectOverflowOptions = Prettify<Omit<DetectOverflowOptions_2, 'boundary'> & { | ||
| boundary?: Boundary; | ||
| }>; | ||
| export { Dimensions } | ||
| export { ElementContext } | ||
| export { ElementRects } | ||
| export declare interface Elements { | ||
| reference: ReferenceElement; | ||
| floating: FloatingElement; | ||
| } | ||
| /** | ||
| * Optimizes the visibility of the floating element by flipping the `placement` | ||
| * in order to keep it in view when the preferred placement(s) will overflow the | ||
| * clipping boundary. Alternative to `autoPlacement`. | ||
| * @see https://floating-ui.com/docs/flip | ||
| */ | ||
| export declare const flip: (options?: FlipOptions | Derivable_2<FlipOptions>) => Middleware; | ||
| export declare type FlipOptions = Prettify<Omit<FlipOptions_2, 'boundary'> & DetectOverflowOptions>; | ||
| export declare type FloatingElement = HTMLElement; | ||
| export { getOverflowAncestors } | ||
| /** | ||
| * Provides data to hide the floating element in applicable situations, such as | ||
| * when it is not in the same clipping context as the reference element. | ||
| * @see https://floating-ui.com/docs/hide | ||
| */ | ||
| export declare const hide: (options?: HideOptions | Derivable_2<HideOptions>) => Middleware; | ||
| export declare type HideOptions = Prettify<Omit<HideOptions_2, 'boundary'> & DetectOverflowOptions>; | ||
| /** | ||
| * Provides improved positioning for inline reference elements that can span | ||
| * over multiple lines, such as hyperlinks or range selections. | ||
| * @see https://floating-ui.com/docs/inline | ||
| */ | ||
| export declare const inline: (options?: InlineOptions | Derivable_2<InlineOptions>) => Middleware; | ||
| export { InlineOptions } | ||
| export { Length } | ||
| /** | ||
| * Built-in `limiter` that will stop `shift()` at a certain point. | ||
| */ | ||
| export declare const limitShift: (options?: LimitShiftOptions | Derivable_2<LimitShiftOptions>) => { | ||
| options: any; | ||
| fn: (state: MiddlewareState) => Coords; | ||
| }; | ||
| export declare type Middleware = Prettify<Omit<Middleware_2, 'fn'> & { | ||
| fn(state: MiddlewareState): Promisable<MiddlewareReturn>; | ||
| }>; | ||
| /** | ||
| * @deprecated use `MiddlewareState` instead. | ||
| */ | ||
| export declare type MiddlewareArguments = MiddlewareState; | ||
| export { MiddlewareData } | ||
| export { MiddlewareReturn } | ||
| export declare type MiddlewareState = Prettify<Omit<MiddlewareState_2, 'elements'> & { | ||
| elements: Elements; | ||
| }>; | ||
| export declare interface NodeScroll { | ||
| scrollLeft: number; | ||
| scrollTop: number; | ||
| } | ||
| export { offset } | ||
| export { OffsetOptions } | ||
| export { Padding } | ||
| export { Placement } | ||
| export declare interface Platform { | ||
| getElementRects: (args: { | ||
| reference: ReferenceElement; | ||
| floating: FloatingElement; | ||
| strategy: Strategy; | ||
| }) => Promisable<ElementRects>; | ||
| getClippingRect: (args: { | ||
| element: Element; | ||
| boundary: Boundary; | ||
| rootBoundary: RootBoundary; | ||
| strategy: Strategy; | ||
| }) => Promisable<Rect>; | ||
| getDimensions: (element: Element) => Promisable<Dimensions>; | ||
| convertOffsetParentRelativeRectToViewportRelativeRect?: (args: { | ||
| rect: Rect; | ||
| offsetParent: Element; | ||
| strategy: Strategy; | ||
| }) => Promisable<Rect>; | ||
| getOffsetParent?: (element: Element, polyfill?: (element: HTMLElement) => Element | null) => Promisable<Element | Window>; | ||
| isElement?: (value: unknown) => Promisable<boolean>; | ||
| getDocumentElement?: (element: Element) => Promisable<HTMLElement>; | ||
| getClientRects?: (element: Element) => Promisable<Array<ClientRectObject>>; | ||
| isRTL?: (element: Element) => Promisable<boolean>; | ||
| getScale?: (element: HTMLElement) => Promisable<{ | ||
| x: number; | ||
| y: number; | ||
| }>; | ||
| } | ||
| export declare const platform: Required<Platform>; | ||
| declare type Prettify<T> = { | ||
| [K in keyof T]: T[K]; | ||
| } & {}; | ||
| declare type Promisable<T> = T | Promise<T>; | ||
| export { Rect } | ||
| export declare type ReferenceElement = Element | VirtualElement; | ||
| export { RootBoundary } | ||
| /** | ||
| * Optimizes the visibility of the floating element by shifting it in order to | ||
| * keep it in view when it will overflow the clipping boundary. | ||
| * @see https://floating-ui.com/docs/shift | ||
| */ | ||
| export declare const shift: (options?: ShiftOptions | Derivable_2<ShiftOptions>) => Middleware; | ||
| export declare type ShiftOptions = Prettify<Omit<ShiftOptions_2, 'boundary'> & DetectOverflowOptions>; | ||
| export { Side } | ||
| export { SideObject } | ||
| /** | ||
| * Provides data that allows you to change the size of the floating element — | ||
| * for instance, prevent it from overflowing the clipping boundary or match the | ||
| * width of the reference element. | ||
| * @see https://floating-ui.com/docs/size | ||
| */ | ||
| export declare const size: (options?: SizeOptions | Derivable_2<SizeOptions>) => Middleware; | ||
| export declare type SizeOptions = Prettify<Omit<SizeOptions_2, 'apply' | 'boundary'> & DetectOverflowOptions & { | ||
| /** | ||
| * Function that is called to perform style mutations to the floating element | ||
| * to change its size. | ||
| * @default undefined | ||
| */ | ||
| apply?(args: MiddlewareState & { | ||
| availableWidth: number; | ||
| availableHeight: number; | ||
| }): Promisable<void>; | ||
| }>; | ||
| export { Strategy } | ||
| /** | ||
| * Custom positioning reference element. | ||
| * @see https://floating-ui.com/docs/virtual-elements | ||
| */ | ||
| export declare interface VirtualElement { | ||
| getBoundingClientRect(): ClientRectObject; | ||
| contextElement?: Element; | ||
| } | ||
| export { } |
@@ -1,1 +0,1 @@ | ||
| import{rectToClientRect as t,computePosition as e}from"@floating-ui/core";export{arrow,autoPlacement,detectOverflow,flip,hide,inline,limitShift,offset,shift,size}from"@floating-ui/core";const n=Math.min,o=Math.max,i=Math.round,r=Math.floor,c=t=>({x:t,y:t});function l(t){return u(t)?(t.nodeName||"").toLowerCase():"#document"}function s(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function f(t){var e;return null==(e=(u(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function u(t){return t instanceof Node||t instanceof s(t).Node}function a(t){return t instanceof Element||t instanceof s(t).Element}function d(t){return t instanceof HTMLElement||t instanceof s(t).HTMLElement}function h(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof s(t).ShadowRoot)}function p(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=x(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function m(t){return["table","td","th"].includes(l(t))}function g(t){const e=y(),n=x(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function y(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function w(t){return["html","body","#document"].includes(l(t))}function x(t){return s(t).getComputedStyle(t)}function v(t){return a(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function b(t){if("html"===l(t))return t;const e=t.assignedSlot||t.parentNode||h(t)&&t.host||f(t);return h(e)?e.host:e}function L(t){const e=b(t);return w(e)?t.ownerDocument?t.ownerDocument.body:t.body:d(e)&&p(e)?e:L(e)}function T(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=L(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=s(i);return r?e.concat(c,c.visualViewport||[],p(i)?i:[],c.frameElement&&n?T(c.frameElement):[]):e.concat(i,T(i))}function R(t){const e=x(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=d(t),c=r?t.offsetWidth:n,l=r?t.offsetHeight:o,s=i(n)!==c||i(o)!==l;return s&&(n=c,o=l),{width:n,height:o,$:s}}function E(t){return a(t)?t:t.contextElement}function S(t){const e=E(t);if(!d(e))return c(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:l}=R(e);let s=(l?i(n.width):n.width)/o,f=(l?i(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),f&&Number.isFinite(f)||(f=1),{x:s,y:f}}const C=c(0);function F(t){const e=s(t);return y()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:C}function O(e,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),l=E(e);let f=c(1);n&&(i?a(i)&&(f=S(i)):f=S(e));const u=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==s(t))&&e}(l,o,i)?F(l):c(0);let d=(r.left+u.x)/f.x,h=(r.top+u.y)/f.y,p=r.width/f.x,m=r.height/f.y;if(l){const t=s(l),e=i&&a(i)?s(i):i;let n=t.frameElement;for(;n&&i&&e!==t;){const t=S(n),e=n.getBoundingClientRect(),o=x(n),i=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;d*=t.x,h*=t.y,p*=t.x,m*=t.y,d+=i,h+=r,n=s(n).frameElement}}return t({width:p,height:m,x:d,y:h})}function D(t){return O(f(t)).left+v(t).scrollLeft}function H(e,n,i){let r;if("viewport"===n)r=function(t,e){const n=s(t),o=f(t),i=n.visualViewport;let r=o.clientWidth,c=o.clientHeight,l=0,u=0;if(i){r=i.width,c=i.height;const t=y();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,u=i.offsetTop)}return{width:r,height:c,x:l,y:u}}(e,i);else if("document"===n)r=function(t){const e=f(t),n=v(t),i=t.ownerDocument.body,r=o(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),c=o(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+D(t);const s=-n.scrollTop;return"rtl"===x(i).direction&&(l+=o(e.clientWidth,i.clientWidth)-r),{width:r,height:c,x:l,y:s}}(f(e));else if(a(n))r=function(t,e){const n=O(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=d(t)?S(t):c(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,i);else{const t=F(e);r={...n,x:n.x-t.x,y:n.y-t.y}}return t(r)}function W(t,e){const n=b(t);return!(n===e||!a(n)||w(n))&&("fixed"===x(n).position||W(n,e))}function M(t,e,n){const o=d(e),i=f(e),r="fixed"===n,s=O(t,!0,r,e);let u={scrollLeft:0,scrollTop:0};const a=c(0);if(o||!o&&!r)if(("body"!==l(e)||p(i))&&(u=v(e)),o){const t=O(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=D(i));return{x:s.left+u.scrollLeft-a.x,y:s.top+u.scrollTop-a.y,width:s.width,height:s.height}}function z(t,e){return d(t)&&"fixed"!==x(t).position?e?e(t):t.offsetParent:null}function P(t,e){const n=s(t);if(!d(t))return n;let o=z(t,e);for(;o&&m(o)&&"static"===x(o).position;)o=z(o,e);return o&&("html"===l(o)||"body"===l(o)&&"static"===x(o).position&&!g(o))?n:o||function(t){let e=b(t);for(;d(e)&&!w(e);){if(g(e))return e;e=b(e)}return null}(t)||n}const V={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=d(n),r=f(n);if(n===r)return e;let s={scrollLeft:0,scrollTop:0},u=c(1);const a=c(0);if((i||!i&&"fixed"!==o)&&(("body"!==l(n)||p(r))&&(s=v(n)),d(n))){const t=O(n);u=S(n),a.x=t.x+n.clientLeft,a.y=t.y+n.clientTop}return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-s.scrollLeft*u.x+a.x,y:e.y*u.y-s.scrollTop*u.y+a.y}},getDocumentElement:f,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:c}=t;const s=[..."clippingAncestors"===i?function(t,e){const n=e.get(t);if(n)return n;let o=T(t,[],!1).filter((t=>a(t)&&"body"!==l(t))),i=null;const r="fixed"===x(t).position;let c=r?b(t):t;for(;a(c)&&!w(c);){const e=x(c),n=g(c);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||p(c)&&!n&&W(t,c))?o=o.filter((t=>t!==c)):i=e,c=b(c)}return e.set(t,o),o}(e,this._c):[].concat(i),r],f=s[0],u=s.reduce(((t,i)=>{const r=H(e,i,c);return t.top=o(r.top,t.top),t.right=n(r.right,t.right),t.bottom=n(r.bottom,t.bottom),t.left=o(r.left,t.left),t}),H(e,f,c));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:P,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||P,r=this.getDimensions;return{reference:M(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return R(t)},getScale:S,isElement:a,isRTL:function(t){return"rtl"===x(t).direction}};function A(t,e,i,c){void 0===c&&(c={});const{ancestorScroll:l=!0,ancestorResize:s=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:d=!1}=c,h=E(t),p=l||s?[...h?T(h):[],...T(e)]:[];p.forEach((t=>{l&&t.addEventListener("scroll",i,{passive:!0}),s&&t.addEventListener("resize",i)}));const m=h&&a?function(t,e){let i,c=null;const l=f(t);function s(){clearTimeout(i),c&&c.disconnect(),c=null}return function f(u,a){void 0===u&&(u=!1),void 0===a&&(a=1),s();const{left:d,top:h,width:p,height:m}=t.getBoundingClientRect();if(u||e(),!p||!m)return;const g={rootMargin:-r(h)+"px "+-r(l.clientWidth-(d+p))+"px "+-r(l.clientHeight-(h+m))+"px "+-r(d)+"px",threshold:o(0,n(1,a))||1};let y=!0;function w(t){const e=t[0].intersectionRatio;if(e!==a){if(!y)return f();e?f(!1,e):i=setTimeout((()=>{f(!1,1e-7)}),100)}y=!1}try{c=new IntersectionObserver(w,{...g,root:l.ownerDocument})}catch(t){c=new IntersectionObserver(w,g)}c.observe(t)}(!0),s}(h,i):null;let g,y=-1,w=null;u&&(w=new ResizeObserver((t=>{let[n]=t;n&&n.target===h&&w&&(w.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame((()=>{w&&w.observe(e)}))),i()})),h&&!d&&w.observe(h),w.observe(e));let x=d?O(t):null;return d&&function e(){const n=O(t);!x||n.x===x.x&&n.y===x.y&&n.width===x.width&&n.height===x.height||i();x=n,g=requestAnimationFrame(e)}(),i(),()=>{p.forEach((t=>{l&&t.removeEventListener("scroll",i),s&&t.removeEventListener("resize",i)})),m&&m(),w&&w.disconnect(),w=null,d&&cancelAnimationFrame(g)}}const N=(t,n,o)=>{const i=new Map,r={platform:V,...o},c={...r.platform,_c:i};return e(t,n,{...r,platform:c})};export{A as autoUpdate,N as computePosition,T as getOverflowAncestors,V as platform}; | ||
| import{rectToClientRect as t,autoPlacement as e,shift as n,flip as o,size as i,hide as r,arrow as c,inline as l,limitShift as s,computePosition as f}from"@floating-ui/core";export{detectOverflow,offset}from"@floating-ui/core";const u=Math.min,a=Math.max,d=Math.round,h=Math.floor,p=t=>({x:t,y:t});function m(t){return w(t)?(t.nodeName||"").toLowerCase():"#document"}function g(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function y(t){var e;return null==(e=(w(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function w(t){return t instanceof Node||t instanceof g(t).Node}function x(t){return t instanceof Element||t instanceof g(t).Element}function v(t){return t instanceof HTMLElement||t instanceof g(t).HTMLElement}function b(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof g(t).ShadowRoot)}function L(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function T(t){return["table","td","th"].includes(m(t))}function R(t){const e=E(),n=C(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function E(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function S(t){return["html","body","#document"].includes(m(t))}function C(t){return g(t).getComputedStyle(t)}function F(t){return x(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function O(t){if("html"===m(t))return t;const e=t.assignedSlot||t.parentNode||b(t)&&t.host||y(t);return b(e)?e.host:e}function D(t){const e=O(t);return S(e)?t.ownerDocument?t.ownerDocument.body:t.body:v(e)&&L(e)?e:D(e)}function H(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=D(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=g(i);return r?e.concat(c,c.visualViewport||[],L(i)?i:[],c.frameElement&&n?H(c.frameElement):[]):e.concat(i,H(i,[],n))}function W(t){const e=C(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=v(t),r=i?t.offsetWidth:n,c=i?t.offsetHeight:o,l=d(n)!==r||d(o)!==c;return l&&(n=r,o=c),{width:n,height:o,$:l}}function M(t){return x(t)?t:t.contextElement}function z(t){const e=M(t);if(!v(e))return p(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=W(e);let c=(r?d(n.width):n.width)/o,l=(r?d(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}const P=p(0);function V(t){const e=g(t);return E()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:P}function A(e,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),c=M(e);let l=p(1);n&&(i?x(i)&&(l=z(i)):l=z(e));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==g(t))&&e}(c,o,i)?V(c):p(0);let f=(r.left+s.x)/l.x,u=(r.top+s.y)/l.y,a=r.width/l.x,d=r.height/l.y;if(c){const t=g(c),e=i&&x(i)?g(i):i;let n=t.frameElement;for(;n&&i&&e!==t;){const t=z(n),e=n.getBoundingClientRect(),o=C(n),i=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;f*=t.x,u*=t.y,a*=t.x,d*=t.y,f+=i,u+=r,n=g(n).frameElement}}return t({width:a,height:d,x:f,y:u})}function N(t){return A(y(t)).left+F(t).scrollLeft}function B(e,n,o){let i;if("viewport"===n)i=function(t,e){const n=g(t),o=y(t),i=n.visualViewport;let r=o.clientWidth,c=o.clientHeight,l=0,s=0;if(i){r=i.width,c=i.height;const t=E();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,s=i.offsetTop)}return{width:r,height:c,x:l,y:s}}(e,o);else if("document"===n)i=function(t){const e=y(t),n=F(t),o=t.ownerDocument.body,i=a(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=a(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let c=-n.scrollLeft+N(t);const l=-n.scrollTop;return"rtl"===C(o).direction&&(c+=a(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:c,y:l}}(y(e));else if(x(n))i=function(t,e){const n=A(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=v(t)?z(t):p(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,o);else{const t=V(e);i={...n,x:n.x-t.x,y:n.y-t.y}}return t(i)}function k(t,e){const n=O(t);return!(n===e||!x(n)||S(n))&&("fixed"===C(n).position||k(n,e))}function I(t,e,n){const o=v(e),i=y(e),r="fixed"===n,c=A(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const s=p(0);if(o||!o&&!r)if(("body"!==m(e)||L(i))&&(l=F(e)),o){const t=A(e,!0,r,e);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else i&&(s.x=N(i));return{x:c.left+l.scrollLeft-s.x,y:c.top+l.scrollTop-s.y,width:c.width,height:c.height}}function q(t,e){return v(t)&&"fixed"!==C(t).position?e?e(t):t.offsetParent:null}function X(t,e){const n=g(t);if(!v(t))return n;let o=q(t,e);for(;o&&T(o)&&"static"===C(o).position;)o=q(o,e);return o&&("html"===m(o)||"body"===m(o)&&"static"===C(o).position&&!R(o))?n:o||function(t){let e=O(t);for(;v(e)&&!S(e);){if(R(e))return e;e=O(e)}return null}(t)||n}const Y={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=v(n),r=y(n);if(n===r)return e;let c={scrollLeft:0,scrollTop:0},l=p(1);const s=p(0);if((i||!i&&"fixed"!==o)&&(("body"!==m(n)||L(r))&&(c=F(n)),v(n))){const t=A(n);l=z(n),s.x=t.x+n.clientLeft,s.y=t.y+n.clientTop}return{width:e.width*l.x,height:e.height*l.y,x:e.x*l.x-c.scrollLeft*l.x+s.x,y:e.y*l.y-c.scrollTop*l.y+s.y}},getDocumentElement:y,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let o=H(t,[],!1).filter((t=>x(t)&&"body"!==m(t))),i=null;const r="fixed"===C(t).position;let c=r?O(t):t;for(;x(c)&&!S(c);){const e=C(c),n=R(c);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||L(c)&&!n&&k(t,c))?o=o.filter((t=>t!==c)):i=e,c=O(c)}return e.set(t,o),o}(e,this._c):[].concat(n),o],c=r[0],l=r.reduce(((t,n)=>{const o=B(e,n,i);return t.top=a(o.top,t.top),t.right=u(o.right,t.right),t.bottom=u(o.bottom,t.bottom),t.left=a(o.left,t.left),t}),B(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:X,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||X,r=this.getDimensions;return{reference:I(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=W(t);return{width:e,height:n}},getScale:z,isElement:x,isRTL:function(t){return"rtl"===C(t).direction}};function $(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,f=M(t),d=i||r?[...f?H(f):[],...H(e)]:[];d.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const p=f&&l?function(t,e){let n,o=null;const i=y(t);function r(){clearTimeout(n),o&&o.disconnect(),o=null}return function c(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),r();const{left:f,top:d,width:p,height:m}=t.getBoundingClientRect();if(l||e(),!p||!m)return;const g={rootMargin:-h(d)+"px "+-h(i.clientWidth-(f+p))+"px "+-h(i.clientHeight-(d+m))+"px "+-h(f)+"px",threshold:a(0,u(1,s))||1};let y=!0;function w(t){const e=t[0].intersectionRatio;if(e!==s){if(!y)return c();e?c(!1,e):n=setTimeout((()=>{c(!1,1e-7)}),100)}y=!1}try{o=new IntersectionObserver(w,{...g,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(w,g)}o.observe(t)}(!0),r}(f,n):null;let m,g=-1,w=null;c&&(w=new ResizeObserver((t=>{let[o]=t;o&&o.target===f&&w&&(w.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame((()=>{w&&w.observe(e)}))),n()})),f&&!s&&w.observe(f),w.observe(e));let x=s?A(t):null;return s&&function e(){const o=A(t);!x||o.x===x.x&&o.y===x.y&&o.width===x.width&&o.height===x.height||n();x=o,m=requestAnimationFrame(e)}(),n(),()=>{d.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),p&&p(),w&&w.disconnect(),w=null,s&&cancelAnimationFrame(m)}}const _=e,j=n,G=o,J=i,K=r,Q=c,U=l,Z=s,tt=(t,e,n)=>{const o=new Map,i={platform:Y,...n},r={...i.platform,_c:o};return f(t,e,{...i,platform:r})};export{Q as arrow,_ as autoPlacement,$ as autoUpdate,tt as computePosition,G as flip,H as getOverflowAncestors,K as hide,U as inline,Z as limitShift,Y as platform,j as shift,J as size}; |
@@ -1,4 +0,9 @@ | ||
| import { rectToClientRect, computePosition as computePosition$1 } from '@floating-ui/core'; | ||
| export { arrow, autoPlacement, detectOverflow, flip, hide, inline, limitShift, offset, shift, size } from '@floating-ui/core'; | ||
| import { rectToClientRect, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core'; | ||
| export { detectOverflow, offset } from '@floating-ui/core'; | ||
| /** | ||
| * Custom positioning reference element. | ||
| * @see https://floating-ui.com/docs/virtual-elements | ||
| */ | ||
| const min = Math.min; | ||
@@ -24,3 +29,3 @@ const max = Math.max; | ||
| var _node$ownerDocument; | ||
| return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; | ||
| return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; | ||
| } | ||
@@ -138,3 +143,3 @@ function getDocumentElement(node) { | ||
| } | ||
| return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor)); | ||
| return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); | ||
| } | ||
@@ -465,3 +470,10 @@ | ||
| function getDimensions(element) { | ||
| return getCssDimensions(element); | ||
| const { | ||
| width, | ||
| height | ||
| } = getCssDimensions(element); | ||
| return { | ||
| width, | ||
| height | ||
| }; | ||
| } | ||
@@ -713,5 +725,61 @@ | ||
| /** | ||
| * Optimizes the visibility of the floating element by choosing the placement | ||
| * that has the most space available automatically, without needing to specify a | ||
| * preferred placement. Alternative to `flip`. | ||
| * @see https://floating-ui.com/docs/autoPlacement | ||
| */ | ||
| const autoPlacement = autoPlacement$1; | ||
| /** | ||
| * Optimizes the visibility of the floating element by shifting it in order to | ||
| * keep it in view when it will overflow the clipping boundary. | ||
| * @see https://floating-ui.com/docs/shift | ||
| */ | ||
| const shift = shift$1; | ||
| /** | ||
| * Optimizes the visibility of the floating element by flipping the `placement` | ||
| * in order to keep it in view when the preferred placement(s) will overflow the | ||
| * clipping boundary. Alternative to `autoPlacement`. | ||
| * @see https://floating-ui.com/docs/flip | ||
| */ | ||
| const flip = flip$1; | ||
| /** | ||
| * Provides data that allows you to change the size of the floating element — | ||
| * for instance, prevent it from overflowing the clipping boundary or match the | ||
| * width of the reference element. | ||
| * @see https://floating-ui.com/docs/size | ||
| */ | ||
| const size = size$1; | ||
| /** | ||
| * Provides data to hide the floating element in applicable situations, such as | ||
| * when it is not in the same clipping context as the reference element. | ||
| * @see https://floating-ui.com/docs/hide | ||
| */ | ||
| const hide = hide$1; | ||
| /** | ||
| * Provides data to position an inner element of the floating element so that it | ||
| * appears centered to the reference element. | ||
| * @see https://floating-ui.com/docs/arrow | ||
| */ | ||
| const arrow = arrow$1; | ||
| /** | ||
| * Provides improved positioning for inline reference elements that can span | ||
| * over multiple lines, such as hyperlinks or range selections. | ||
| * @see https://floating-ui.com/docs/inline | ||
| */ | ||
| const inline = inline$1; | ||
| /** | ||
| * Built-in `limiter` that will stop `shift()` at a certain point. | ||
| */ | ||
| const limitShift = limitShift$1; | ||
| /** | ||
| * Computes the `x` and `y` coordinates that will place the floating element | ||
| * next to a reference element when it is given a certain CSS positioning | ||
| * strategy. | ||
| * next to a given reference element. | ||
| */ | ||
@@ -737,2 +805,2 @@ const computePosition = (reference, floating, options) => { | ||
| export { autoUpdate, computePosition, getOverflowAncestors, platform }; | ||
| export { arrow, autoPlacement, autoUpdate, computePosition, flip, getOverflowAncestors, hide, inline, limitShift, platform, shift, size }; |
@@ -1,3 +0,3 @@ | ||
| import { rectToClientRect, computePosition as computePosition$1 } from '@floating-ui/core'; | ||
| export { arrow, autoPlacement, detectOverflow, flip, hide, inline, limitShift, offset, shift, size } from '@floating-ui/core'; | ||
| import { rectToClientRect, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core'; | ||
| export { detectOverflow, offset } from '@floating-ui/core'; | ||
| import { round, createCoords, max, min, floor } from '@floating-ui/utils'; | ||
@@ -330,3 +330,10 @@ import { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getDocumentElement, getNodeName, isOverflowElement, getNodeScroll, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom'; | ||
| function getDimensions(element) { | ||
| return getCssDimensions(element); | ||
| const { | ||
| width, | ||
| height | ||
| } = getCssDimensions(element); | ||
| return { | ||
| width, | ||
| height | ||
| }; | ||
| } | ||
@@ -578,5 +585,61 @@ | ||
| /** | ||
| * Optimizes the visibility of the floating element by choosing the placement | ||
| * that has the most space available automatically, without needing to specify a | ||
| * preferred placement. Alternative to `flip`. | ||
| * @see https://floating-ui.com/docs/autoPlacement | ||
| */ | ||
| const autoPlacement = autoPlacement$1; | ||
| /** | ||
| * Optimizes the visibility of the floating element by shifting it in order to | ||
| * keep it in view when it will overflow the clipping boundary. | ||
| * @see https://floating-ui.com/docs/shift | ||
| */ | ||
| const shift = shift$1; | ||
| /** | ||
| * Optimizes the visibility of the floating element by flipping the `placement` | ||
| * in order to keep it in view when the preferred placement(s) will overflow the | ||
| * clipping boundary. Alternative to `autoPlacement`. | ||
| * @see https://floating-ui.com/docs/flip | ||
| */ | ||
| const flip = flip$1; | ||
| /** | ||
| * Provides data that allows you to change the size of the floating element — | ||
| * for instance, prevent it from overflowing the clipping boundary or match the | ||
| * width of the reference element. | ||
| * @see https://floating-ui.com/docs/size | ||
| */ | ||
| const size = size$1; | ||
| /** | ||
| * Provides data to hide the floating element in applicable situations, such as | ||
| * when it is not in the same clipping context as the reference element. | ||
| * @see https://floating-ui.com/docs/hide | ||
| */ | ||
| const hide = hide$1; | ||
| /** | ||
| * Provides data to position an inner element of the floating element so that it | ||
| * appears centered to the reference element. | ||
| * @see https://floating-ui.com/docs/arrow | ||
| */ | ||
| const arrow = arrow$1; | ||
| /** | ||
| * Provides improved positioning for inline reference elements that can span | ||
| * over multiple lines, such as hyperlinks or range selections. | ||
| * @see https://floating-ui.com/docs/inline | ||
| */ | ||
| const inline = inline$1; | ||
| /** | ||
| * Built-in `limiter` that will stop `shift()` at a certain point. | ||
| */ | ||
| const limitShift = limitShift$1; | ||
| /** | ||
| * Computes the `x` and `y` coordinates that will place the floating element | ||
| * next to a reference element when it is given a certain CSS positioning | ||
| * strategy. | ||
| * next to a given reference element. | ||
| */ | ||
@@ -602,2 +665,2 @@ const computePosition = (reference, floating, options) => { | ||
| export { autoUpdate, computePosition, platform }; | ||
| export { arrow, autoPlacement, autoUpdate, computePosition, flip, hide, inline, limitShift, platform, shift, size }; |
@@ -1,3 +0,3 @@ | ||
| import { rectToClientRect, computePosition as computePosition$1 } from '@floating-ui/core'; | ||
| export { arrow, autoPlacement, detectOverflow, flip, hide, inline, limitShift, offset, shift, size } from '@floating-ui/core'; | ||
| import { rectToClientRect, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core'; | ||
| export { detectOverflow, offset } from '@floating-ui/core'; | ||
| import { round, createCoords, max, min, floor } from '@floating-ui/utils'; | ||
@@ -330,3 +330,10 @@ import { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getDocumentElement, getNodeName, isOverflowElement, getNodeScroll, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom'; | ||
| function getDimensions(element) { | ||
| return getCssDimensions(element); | ||
| const { | ||
| width, | ||
| height | ||
| } = getCssDimensions(element); | ||
| return { | ||
| width, | ||
| height | ||
| }; | ||
| } | ||
@@ -578,5 +585,61 @@ | ||
| /** | ||
| * Optimizes the visibility of the floating element by choosing the placement | ||
| * that has the most space available automatically, without needing to specify a | ||
| * preferred placement. Alternative to `flip`. | ||
| * @see https://floating-ui.com/docs/autoPlacement | ||
| */ | ||
| const autoPlacement = autoPlacement$1; | ||
| /** | ||
| * Optimizes the visibility of the floating element by shifting it in order to | ||
| * keep it in view when it will overflow the clipping boundary. | ||
| * @see https://floating-ui.com/docs/shift | ||
| */ | ||
| const shift = shift$1; | ||
| /** | ||
| * Optimizes the visibility of the floating element by flipping the `placement` | ||
| * in order to keep it in view when the preferred placement(s) will overflow the | ||
| * clipping boundary. Alternative to `autoPlacement`. | ||
| * @see https://floating-ui.com/docs/flip | ||
| */ | ||
| const flip = flip$1; | ||
| /** | ||
| * Provides data that allows you to change the size of the floating element — | ||
| * for instance, prevent it from overflowing the clipping boundary or match the | ||
| * width of the reference element. | ||
| * @see https://floating-ui.com/docs/size | ||
| */ | ||
| const size = size$1; | ||
| /** | ||
| * Provides data to hide the floating element in applicable situations, such as | ||
| * when it is not in the same clipping context as the reference element. | ||
| * @see https://floating-ui.com/docs/hide | ||
| */ | ||
| const hide = hide$1; | ||
| /** | ||
| * Provides data to position an inner element of the floating element so that it | ||
| * appears centered to the reference element. | ||
| * @see https://floating-ui.com/docs/arrow | ||
| */ | ||
| const arrow = arrow$1; | ||
| /** | ||
| * Provides improved positioning for inline reference elements that can span | ||
| * over multiple lines, such as hyperlinks or range selections. | ||
| * @see https://floating-ui.com/docs/inline | ||
| */ | ||
| const inline = inline$1; | ||
| /** | ||
| * Built-in `limiter` that will stop `shift()` at a certain point. | ||
| */ | ||
| const limitShift = limitShift$1; | ||
| /** | ||
| * Computes the `x` and `y` coordinates that will place the floating element | ||
| * next to a reference element when it is given a certain CSS positioning | ||
| * strategy. | ||
| * next to a given reference element. | ||
| */ | ||
@@ -602,2 +665,2 @@ const computePosition = (reference, floating, options) => { | ||
| export { autoUpdate, computePosition, platform }; | ||
| export { arrow, autoPlacement, autoUpdate, computePosition, flip, hide, inline, limitShift, platform, shift, size }; |
@@ -7,2 +7,7 @@ (function (global, factory) { | ||
| /** | ||
| * Custom positioning reference element. | ||
| * @see https://floating-ui.com/docs/virtual-elements | ||
| */ | ||
| const min = Math.min; | ||
@@ -28,3 +33,3 @@ const max = Math.max; | ||
| var _node$ownerDocument; | ||
| return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; | ||
| return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; | ||
| } | ||
@@ -142,3 +147,3 @@ function getDocumentElement(node) { | ||
| } | ||
| return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor)); | ||
| return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); | ||
| } | ||
@@ -469,3 +474,10 @@ | ||
| function getDimensions(element) { | ||
| return getCssDimensions(element); | ||
| const { | ||
| width, | ||
| height | ||
| } = getCssDimensions(element); | ||
| return { | ||
| width, | ||
| height | ||
| }; | ||
| } | ||
@@ -717,5 +729,61 @@ | ||
| /** | ||
| * Optimizes the visibility of the floating element by choosing the placement | ||
| * that has the most space available automatically, without needing to specify a | ||
| * preferred placement. Alternative to `flip`. | ||
| * @see https://floating-ui.com/docs/autoPlacement | ||
| */ | ||
| const autoPlacement = core.autoPlacement; | ||
| /** | ||
| * Optimizes the visibility of the floating element by shifting it in order to | ||
| * keep it in view when it will overflow the clipping boundary. | ||
| * @see https://floating-ui.com/docs/shift | ||
| */ | ||
| const shift = core.shift; | ||
| /** | ||
| * Optimizes the visibility of the floating element by flipping the `placement` | ||
| * in order to keep it in view when the preferred placement(s) will overflow the | ||
| * clipping boundary. Alternative to `autoPlacement`. | ||
| * @see https://floating-ui.com/docs/flip | ||
| */ | ||
| const flip = core.flip; | ||
| /** | ||
| * Provides data that allows you to change the size of the floating element — | ||
| * for instance, prevent it from overflowing the clipping boundary or match the | ||
| * width of the reference element. | ||
| * @see https://floating-ui.com/docs/size | ||
| */ | ||
| const size = core.size; | ||
| /** | ||
| * Provides data to hide the floating element in applicable situations, such as | ||
| * when it is not in the same clipping context as the reference element. | ||
| * @see https://floating-ui.com/docs/hide | ||
| */ | ||
| const hide = core.hide; | ||
| /** | ||
| * Provides data to position an inner element of the floating element so that it | ||
| * appears centered to the reference element. | ||
| * @see https://floating-ui.com/docs/arrow | ||
| */ | ||
| const arrow = core.arrow; | ||
| /** | ||
| * Provides improved positioning for inline reference elements that can span | ||
| * over multiple lines, such as hyperlinks or range selections. | ||
| * @see https://floating-ui.com/docs/inline | ||
| */ | ||
| const inline = core.inline; | ||
| /** | ||
| * Built-in `limiter` that will stop `shift()` at a certain point. | ||
| */ | ||
| const limitShift = core.limitShift; | ||
| /** | ||
| * Computes the `x` and `y` coordinates that will place the floating element | ||
| * next to a reference element when it is given a certain CSS positioning | ||
| * strategy. | ||
| * next to a given reference element. | ||
| */ | ||
@@ -741,47 +809,23 @@ const computePosition = (reference, floating, options) => { | ||
| Object.defineProperty(exports, 'arrow', { | ||
| Object.defineProperty(exports, "detectOverflow", { | ||
| enumerable: true, | ||
| get: function () { return core.arrow; } | ||
| }); | ||
| Object.defineProperty(exports, 'autoPlacement', { | ||
| enumerable: true, | ||
| get: function () { return core.autoPlacement; } | ||
| }); | ||
| Object.defineProperty(exports, 'detectOverflow', { | ||
| enumerable: true, | ||
| get: function () { return core.detectOverflow; } | ||
| }); | ||
| Object.defineProperty(exports, 'flip', { | ||
| Object.defineProperty(exports, "offset", { | ||
| enumerable: true, | ||
| get: function () { return core.flip; } | ||
| }); | ||
| Object.defineProperty(exports, 'hide', { | ||
| enumerable: true, | ||
| get: function () { return core.hide; } | ||
| }); | ||
| Object.defineProperty(exports, 'inline', { | ||
| enumerable: true, | ||
| get: function () { return core.inline; } | ||
| }); | ||
| Object.defineProperty(exports, 'limitShift', { | ||
| enumerable: true, | ||
| get: function () { return core.limitShift; } | ||
| }); | ||
| Object.defineProperty(exports, 'offset', { | ||
| enumerable: true, | ||
| get: function () { return core.offset; } | ||
| }); | ||
| Object.defineProperty(exports, 'shift', { | ||
| enumerable: true, | ||
| get: function () { return core.shift; } | ||
| }); | ||
| Object.defineProperty(exports, 'size', { | ||
| enumerable: true, | ||
| get: function () { return core.size; } | ||
| }); | ||
| exports.arrow = arrow; | ||
| exports.autoPlacement = autoPlacement; | ||
| exports.autoUpdate = autoUpdate; | ||
| exports.computePosition = computePosition; | ||
| exports.flip = flip; | ||
| exports.getOverflowAncestors = getOverflowAncestors; | ||
| exports.hide = hide; | ||
| exports.inline = inline; | ||
| exports.limitShift = limitShift; | ||
| exports.platform = platform; | ||
| exports.shift = shift; | ||
| exports.size = size; | ||
| })); |
@@ -1,1 +0,1 @@ | ||
| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUIDOM={},t.FloatingUICore)}(this,(function(t,e){"use strict";const n=Math.min,o=Math.max,i=Math.round,r=Math.floor,c=t=>({x:t,y:t});function l(t){return u(t)?(t.nodeName||"").toLowerCase():"#document"}function f(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function s(t){var e;return null==(e=(u(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function u(t){return t instanceof Node||t instanceof f(t).Node}function a(t){return t instanceof Element||t instanceof f(t).Element}function d(t){return t instanceof HTMLElement||t instanceof f(t).HTMLElement}function h(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof f(t).ShadowRoot)}function p(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=b(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function m(t){return["table","td","th"].includes(l(t))}function g(t){const e=y(),n=b(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function y(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function w(t){return["html","body","#document"].includes(l(t))}function b(t){return f(t).getComputedStyle(t)}function x(t){return a(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function v(t){if("html"===l(t))return t;const e=t.assignedSlot||t.parentNode||h(t)&&t.host||s(t);return h(e)?e.host:e}function T(t){const e=v(t);return w(e)?t.ownerDocument?t.ownerDocument.body:t.body:d(e)&&p(e)?e:T(e)}function L(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=T(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=f(i);return r?e.concat(c,c.visualViewport||[],p(i)?i:[],c.frameElement&&n?L(c.frameElement):[]):e.concat(i,L(i))}function O(t){const e=b(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=d(t),c=r?t.offsetWidth:n,l=r?t.offsetHeight:o,f=i(n)!==c||i(o)!==l;return f&&(n=c,o=l),{width:n,height:o,$:f}}function R(t){return a(t)?t:t.contextElement}function E(t){const e=R(t);if(!d(e))return c(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:l}=O(e);let f=(l?i(n.width):n.width)/o,s=(l?i(n.height):n.height)/r;return f&&Number.isFinite(f)||(f=1),s&&Number.isFinite(s)||(s=1),{x:f,y:s}}const P=c(0);function C(t){const e=f(t);return y()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:P}function S(t,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),l=R(t);let s=c(1);n&&(i?a(i)&&(s=E(i)):s=E(t));const u=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==f(t))&&e}(l,o,i)?C(l):c(0);let d=(r.left+u.x)/s.x,h=(r.top+u.y)/s.y,p=r.width/s.x,m=r.height/s.y;if(l){const t=f(l),e=i&&a(i)?f(i):i;let n=t.frameElement;for(;n&&i&&e!==t;){const t=E(n),e=n.getBoundingClientRect(),o=b(n),i=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;d*=t.x,h*=t.y,p*=t.x,m*=t.y,d+=i,h+=r,n=f(n).frameElement}}return e.rectToClientRect({width:p,height:m,x:d,y:h})}function F(t){return S(s(t)).left+x(t).scrollLeft}function j(t,n,i){let r;if("viewport"===n)r=function(t,e){const n=f(t),o=s(t),i=n.visualViewport;let r=o.clientWidth,c=o.clientHeight,l=0,u=0;if(i){r=i.width,c=i.height;const t=y();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,u=i.offsetTop)}return{width:r,height:c,x:l,y:u}}(t,i);else if("document"===n)r=function(t){const e=s(t),n=x(t),i=t.ownerDocument.body,r=o(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),c=o(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+F(t);const f=-n.scrollTop;return"rtl"===b(i).direction&&(l+=o(e.clientWidth,i.clientWidth)-r),{width:r,height:c,x:l,y:f}}(s(t));else if(a(n))r=function(t,e){const n=S(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=d(t)?E(t):c(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,i);else{const e=C(t);r={...n,x:n.x-e.x,y:n.y-e.y}}return e.rectToClientRect(r)}function D(t,e){const n=v(t);return!(n===e||!a(n)||w(n))&&("fixed"===b(n).position||D(n,e))}function H(t,e,n){const o=d(e),i=s(e),r="fixed"===n,f=S(t,!0,r,e);let u={scrollLeft:0,scrollTop:0};const a=c(0);if(o||!o&&!r)if(("body"!==l(e)||p(i))&&(u=x(e)),o){const t=S(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=F(i));return{x:f.left+u.scrollLeft-a.x,y:f.top+u.scrollTop-a.y,width:f.width,height:f.height}}function W(t,e){return d(t)&&"fixed"!==b(t).position?e?e(t):t.offsetParent:null}function M(t,e){const n=f(t);if(!d(t))return n;let o=W(t,e);for(;o&&m(o)&&"static"===b(o).position;)o=W(o,e);return o&&("html"===l(o)||"body"===l(o)&&"static"===b(o).position&&!g(o))?n:o||function(t){let e=v(t);for(;d(e)&&!w(e);){if(g(e))return e;e=v(e)}return null}(t)||n}const z={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=d(n),r=s(n);if(n===r)return e;let f={scrollLeft:0,scrollTop:0},u=c(1);const a=c(0);if((i||!i&&"fixed"!==o)&&(("body"!==l(n)||p(r))&&(f=x(n)),d(n))){const t=S(n);u=E(n),a.x=t.x+n.clientLeft,a.y=t.y+n.clientTop}return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-f.scrollLeft*u.x+a.x,y:e.y*u.y-f.scrollTop*u.y+a.y}},getDocumentElement:s,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:c}=t;const f=[..."clippingAncestors"===i?function(t,e){const n=e.get(t);if(n)return n;let o=L(t,[],!1).filter((t=>a(t)&&"body"!==l(t))),i=null;const r="fixed"===b(t).position;let c=r?v(t):t;for(;a(c)&&!w(c);){const e=b(c),n=g(c);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||p(c)&&!n&&D(t,c))?o=o.filter((t=>t!==c)):i=e,c=v(c)}return e.set(t,o),o}(e,this._c):[].concat(i),r],s=f[0],u=f.reduce(((t,i)=>{const r=j(e,i,c);return t.top=o(r.top,t.top),t.right=n(r.right,t.right),t.bottom=n(r.bottom,t.bottom),t.left=o(r.left,t.left),t}),j(e,s,c));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:M,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||M,r=this.getDimensions;return{reference:H(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return O(t)},getScale:E,isElement:a,isRTL:function(t){return"rtl"===b(t).direction}};Object.defineProperty(t,"arrow",{enumerable:!0,get:function(){return e.arrow}}),Object.defineProperty(t,"autoPlacement",{enumerable:!0,get:function(){return e.autoPlacement}}),Object.defineProperty(t,"detectOverflow",{enumerable:!0,get:function(){return e.detectOverflow}}),Object.defineProperty(t,"flip",{enumerable:!0,get:function(){return e.flip}}),Object.defineProperty(t,"hide",{enumerable:!0,get:function(){return e.hide}}),Object.defineProperty(t,"inline",{enumerable:!0,get:function(){return e.inline}}),Object.defineProperty(t,"limitShift",{enumerable:!0,get:function(){return e.limitShift}}),Object.defineProperty(t,"offset",{enumerable:!0,get:function(){return e.offset}}),Object.defineProperty(t,"shift",{enumerable:!0,get:function(){return e.shift}}),Object.defineProperty(t,"size",{enumerable:!0,get:function(){return e.size}}),t.autoUpdate=function(t,e,i,c){void 0===c&&(c={});const{ancestorScroll:l=!0,ancestorResize:f=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:d=!1}=c,h=R(t),p=l||f?[...h?L(h):[],...L(e)]:[];p.forEach((t=>{l&&t.addEventListener("scroll",i,{passive:!0}),f&&t.addEventListener("resize",i)}));const m=h&&a?function(t,e){let i,c=null;const l=s(t);function f(){clearTimeout(i),c&&c.disconnect(),c=null}return function s(u,a){void 0===u&&(u=!1),void 0===a&&(a=1),f();const{left:d,top:h,width:p,height:m}=t.getBoundingClientRect();if(u||e(),!p||!m)return;const g={rootMargin:-r(h)+"px "+-r(l.clientWidth-(d+p))+"px "+-r(l.clientHeight-(h+m))+"px "+-r(d)+"px",threshold:o(0,n(1,a))||1};let y=!0;function w(t){const e=t[0].intersectionRatio;if(e!==a){if(!y)return s();e?s(!1,e):i=setTimeout((()=>{s(!1,1e-7)}),100)}y=!1}try{c=new IntersectionObserver(w,{...g,root:l.ownerDocument})}catch(t){c=new IntersectionObserver(w,g)}c.observe(t)}(!0),f}(h,i):null;let g,y=-1,w=null;u&&(w=new ResizeObserver((t=>{let[n]=t;n&&n.target===h&&w&&(w.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame((()=>{w&&w.observe(e)}))),i()})),h&&!d&&w.observe(h),w.observe(e));let b=d?S(t):null;return d&&function e(){const n=S(t);!b||n.x===b.x&&n.y===b.y&&n.width===b.width&&n.height===b.height||i();b=n,g=requestAnimationFrame(e)}(),i(),()=>{p.forEach((t=>{l&&t.removeEventListener("scroll",i),f&&t.removeEventListener("resize",i)})),m&&m(),w&&w.disconnect(),w=null,d&&cancelAnimationFrame(g)}},t.computePosition=(t,n,o)=>{const i=new Map,r={platform:z,...o},c={...r.platform,_c:i};return e.computePosition(t,n,{...r,platform:c})},t.getOverflowAncestors=L,t.platform=z})); | ||
| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@floating-ui/core")):"function"==typeof define&&define.amd?define(["exports","@floating-ui/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUIDOM={},t.FloatingUICore)}(this,(function(t,e){"use strict";const n=Math.min,o=Math.max,i=Math.round,r=Math.floor,c=t=>({x:t,y:t});function l(t){return u(t)?(t.nodeName||"").toLowerCase():"#document"}function s(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function f(t){var e;return null==(e=(u(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function u(t){return t instanceof Node||t instanceof s(t).Node}function a(t){return t instanceof Element||t instanceof s(t).Element}function d(t){return t instanceof HTMLElement||t instanceof s(t).HTMLElement}function h(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof s(t).ShadowRoot)}function p(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=x(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function m(t){return["table","td","th"].includes(l(t))}function g(t){const e=y(),n=x(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function y(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function w(t){return["html","body","#document"].includes(l(t))}function x(t){return s(t).getComputedStyle(t)}function v(t){return a(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function b(t){if("html"===l(t))return t;const e=t.assignedSlot||t.parentNode||h(t)&&t.host||f(t);return h(e)?e.host:e}function T(t){const e=b(t);return w(e)?t.ownerDocument?t.ownerDocument.body:t.body:d(e)&&p(e)?e:T(e)}function L(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=T(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=s(i);return r?e.concat(c,c.visualViewport||[],p(i)?i:[],c.frameElement&&n?L(c.frameElement):[]):e.concat(i,L(i,[],n))}function R(t){const e=x(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=d(t),c=r?t.offsetWidth:n,l=r?t.offsetHeight:o,s=i(n)!==c||i(o)!==l;return s&&(n=c,o=l),{width:n,height:o,$:s}}function E(t){return a(t)?t:t.contextElement}function C(t){const e=E(t);if(!d(e))return c(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:l}=R(e);let s=(l?i(n.width):n.width)/o,f=(l?i(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),f&&Number.isFinite(f)||(f=1),{x:s,y:f}}const O=c(0);function S(t){const e=s(t);return y()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:O}function F(t,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),l=E(t);let f=c(1);n&&(i?a(i)&&(f=C(i)):f=C(t));const u=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==s(t))&&e}(l,o,i)?S(l):c(0);let d=(r.left+u.x)/f.x,h=(r.top+u.y)/f.y,p=r.width/f.x,m=r.height/f.y;if(l){const t=s(l),e=i&&a(i)?s(i):i;let n=t.frameElement;for(;n&&i&&e!==t;){const t=C(n),e=n.getBoundingClientRect(),o=x(n),i=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;d*=t.x,h*=t.y,p*=t.x,m*=t.y,d+=i,h+=r,n=s(n).frameElement}}return e.rectToClientRect({width:p,height:m,x:d,y:h})}function D(t){return F(f(t)).left+v(t).scrollLeft}function P(t,n,i){let r;if("viewport"===n)r=function(t,e){const n=s(t),o=f(t),i=n.visualViewport;let r=o.clientWidth,c=o.clientHeight,l=0,u=0;if(i){r=i.width,c=i.height;const t=y();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,u=i.offsetTop)}return{width:r,height:c,x:l,y:u}}(t,i);else if("document"===n)r=function(t){const e=f(t),n=v(t),i=t.ownerDocument.body,r=o(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),c=o(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+D(t);const s=-n.scrollTop;return"rtl"===x(i).direction&&(l+=o(e.clientWidth,i.clientWidth)-r),{width:r,height:c,x:l,y:s}}(f(t));else if(a(n))r=function(t,e){const n=F(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=d(t)?C(t):c(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,i);else{const e=S(t);r={...n,x:n.x-e.x,y:n.y-e.y}}return e.rectToClientRect(r)}function H(t,e){const n=b(t);return!(n===e||!a(n)||w(n))&&("fixed"===x(n).position||H(n,e))}function W(t,e,n){const o=d(e),i=f(e),r="fixed"===n,s=F(t,!0,r,e);let u={scrollLeft:0,scrollTop:0};const a=c(0);if(o||!o&&!r)if(("body"!==l(e)||p(i))&&(u=v(e)),o){const t=F(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&(a.x=D(i));return{x:s.left+u.scrollLeft-a.x,y:s.top+u.scrollTop-a.y,width:s.width,height:s.height}}function M(t,e){return d(t)&&"fixed"!==x(t).position?e?e(t):t.offsetParent:null}function z(t,e){const n=s(t);if(!d(t))return n;let o=M(t,e);for(;o&&m(o)&&"static"===x(o).position;)o=M(o,e);return o&&("html"===l(o)||"body"===l(o)&&"static"===x(o).position&&!g(o))?n:o||function(t){let e=b(t);for(;d(e)&&!w(e);){if(g(e))return e;e=b(e)}return null}(t)||n}const A={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=d(n),r=f(n);if(n===r)return e;let s={scrollLeft:0,scrollTop:0},u=c(1);const a=c(0);if((i||!i&&"fixed"!==o)&&(("body"!==l(n)||p(r))&&(s=v(n)),d(n))){const t=F(n);u=C(n),a.x=t.x+n.clientLeft,a.y=t.y+n.clientTop}return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-s.scrollLeft*u.x+a.x,y:e.y*u.y-s.scrollTop*u.y+a.y}},getDocumentElement:f,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:c}=t;const s=[..."clippingAncestors"===i?function(t,e){const n=e.get(t);if(n)return n;let o=L(t,[],!1).filter((t=>a(t)&&"body"!==l(t))),i=null;const r="fixed"===x(t).position;let c=r?b(t):t;for(;a(c)&&!w(c);){const e=x(c),n=g(c);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||p(c)&&!n&&H(t,c))?o=o.filter((t=>t!==c)):i=e,c=b(c)}return e.set(t,o),o}(e,this._c):[].concat(i),r],f=s[0],u=s.reduce(((t,i)=>{const r=P(e,i,c);return t.top=o(r.top,t.top),t.right=n(r.right,t.right),t.bottom=n(r.bottom,t.bottom),t.left=o(r.left,t.left),t}),P(e,f,c));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:z,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||z,r=this.getDimensions;return{reference:W(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=R(t);return{width:e,height:n}},getScale:C,isElement:a,isRTL:function(t){return"rtl"===x(t).direction}};const V=e.autoPlacement,N=e.shift,B=e.flip,I=e.size,k=e.hide,j=e.arrow,q=e.inline,U=e.limitShift;Object.defineProperty(t,"detectOverflow",{enumerable:!0,get:function(){return e.detectOverflow}}),Object.defineProperty(t,"offset",{enumerable:!0,get:function(){return e.offset}}),t.arrow=j,t.autoPlacement=V,t.autoUpdate=function(t,e,i,c){void 0===c&&(c={});const{ancestorScroll:l=!0,ancestorResize:s=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:d=!1}=c,h=E(t),p=l||s?[...h?L(h):[],...L(e)]:[];p.forEach((t=>{l&&t.addEventListener("scroll",i,{passive:!0}),s&&t.addEventListener("resize",i)}));const m=h&&a?function(t,e){let i,c=null;const l=f(t);function s(){clearTimeout(i),c&&c.disconnect(),c=null}return function f(u,a){void 0===u&&(u=!1),void 0===a&&(a=1),s();const{left:d,top:h,width:p,height:m}=t.getBoundingClientRect();if(u||e(),!p||!m)return;const g={rootMargin:-r(h)+"px "+-r(l.clientWidth-(d+p))+"px "+-r(l.clientHeight-(h+m))+"px "+-r(d)+"px",threshold:o(0,n(1,a))||1};let y=!0;function w(t){const e=t[0].intersectionRatio;if(e!==a){if(!y)return f();e?f(!1,e):i=setTimeout((()=>{f(!1,1e-7)}),100)}y=!1}try{c=new IntersectionObserver(w,{...g,root:l.ownerDocument})}catch(t){c=new IntersectionObserver(w,g)}c.observe(t)}(!0),s}(h,i):null;let g,y=-1,w=null;u&&(w=new ResizeObserver((t=>{let[n]=t;n&&n.target===h&&w&&(w.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame((()=>{w&&w.observe(e)}))),i()})),h&&!d&&w.observe(h),w.observe(e));let x=d?F(t):null;return d&&function e(){const n=F(t);!x||n.x===x.x&&n.y===x.y&&n.width===x.width&&n.height===x.height||i();x=n,g=requestAnimationFrame(e)}(),i(),()=>{p.forEach((t=>{l&&t.removeEventListener("scroll",i),s&&t.removeEventListener("resize",i)})),m&&m(),w&&w.disconnect(),w=null,d&&cancelAnimationFrame(g)}},t.computePosition=(t,n,o)=>{const i=new Map,r={platform:A,...o},c={...r.platform,_c:i};return e.computePosition(t,n,{...r,platform:c})},t.flip=B,t.getOverflowAncestors=L,t.hide=k,t.inline=q,t.limitShift=U,t.platform=A,t.shift=N,t.size=I})); |
+25
-17
| { | ||
| "name": "@floating-ui/dom", | ||
| "version": "1.5.3", | ||
| "version": "1.5.4", | ||
| "description": "Floating UI for the web", | ||
@@ -11,3 +11,3 @@ "publishConfig": { | ||
| "unpkg": "./dist/floating-ui.dom.umd.min.js", | ||
| "types": "./src/types.d.ts", | ||
| "types": "./dist/floating-ui.dom.d.ts", | ||
| "exports": { | ||
@@ -17,6 +17,6 @@ "./package.json": "./package.json", | ||
| "import": { | ||
| "types": "./src/types.d.ts", | ||
| "types": "./dist/floating-ui.dom.d.mts", | ||
| "default": "./dist/floating-ui.dom.mjs" | ||
| }, | ||
| "types": "./src/types.d.ts", | ||
| "types": "./dist/floating-ui.dom.d.ts", | ||
| "module": "./dist/floating-ui.dom.esm.js", | ||
@@ -28,11 +28,4 @@ "default": "./dist/floating-ui.dom.umd.js" | ||
| "files": [ | ||
| "dist/", | ||
| "**/*.d.ts", | ||
| "**/*.d.mts" | ||
| "dist" | ||
| ], | ||
| "scripts": { | ||
| "dev": "vite", | ||
| "build": "NODE_ENV=build rollup -c", | ||
| "test": "vitest" | ||
| }, | ||
| "author": "atomiks", | ||
@@ -56,11 +49,26 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@floating-ui/core": "^1.4.2", | ||
| "@floating-ui/utils": "^0.1.3" | ||
| "@floating-ui/core": "^1.5.3", | ||
| "@floating-ui/utils": "^0.2.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/react": "^18.2.14", | ||
| "@types/react": "^18.2.46", | ||
| "@types/react-dom": "^18.2.18", | ||
| "@vitejs/plugin-react": "^4.2.1", | ||
| "react": "^18.2.0", | ||
| "react-dom": "^18.2.0", | ||
| "react-router-dom": "^6.14.0" | ||
| "react-router-dom": "^6.21.1", | ||
| "config": "0.0.0" | ||
| }, | ||
| "scripts": { | ||
| "lint": "eslint .", | ||
| "clean": "rimraf dist out-tsc test-results", | ||
| "dev": "vite", | ||
| "build": "rollup -c", | ||
| "build:api": "build-api --tsc tsconfig.lib.json", | ||
| "test": "vitest run", | ||
| "test:watch": "vitest watch", | ||
| "publint": "publint", | ||
| "playwright": "playwright test ./test/functional", | ||
| "typecheck": "tsc -b" | ||
| } | ||
| } | ||
| } |
| import type { FloatingElement, ReferenceElement } from './types'; | ||
| export type AutoUpdateOptions = Partial<{ | ||
| /** | ||
| * Whether to update the position when an overflow ancestor is scrolled. | ||
| * @default true | ||
| */ | ||
| ancestorScroll: boolean; | ||
| /** | ||
| * Whether to update the position when an overflow ancestor is resized. This | ||
| * uses the native `resize` event. | ||
| * @default true | ||
| */ | ||
| ancestorResize: boolean; | ||
| /** | ||
| * Whether to update the position when either the reference or floating | ||
| * elements resized. This uses a `ResizeObserver`. | ||
| * @default true | ||
| */ | ||
| elementResize: boolean; | ||
| /** | ||
| * Whether to update the position when the reference relocated on the screen | ||
| * due to layout shift. | ||
| * @default true | ||
| */ | ||
| layoutShift: boolean; | ||
| /** | ||
| * Whether to update on every animation frame if necessary. Only use if you | ||
| * need to update the position in response to an animation using transforms. | ||
| * @default false | ||
| */ | ||
| animationFrame: boolean; | ||
| }>; | ||
| /** | ||
| * Automatically updates the position of the floating element when necessary. | ||
| * Should only be called when the floating element is mounted on the DOM or | ||
| * visible on the screen. | ||
| * @returns cleanup function that should be invoked when the floating element is | ||
| * removed from the DOM or hidden from the screen. | ||
| * @see https://floating-ui.com/docs/autoUpdate | ||
| */ | ||
| export declare function autoUpdate(reference: ReferenceElement, floating: FloatingElement, update: () => void, options?: AutoUpdateOptions): () => void; |
| import type { ComputePositionConfig, FloatingElement, ReferenceElement } from './types'; | ||
| /** | ||
| * Computes the `x` and `y` coordinates that will place the floating element | ||
| * next to a reference element when it is given a certain CSS positioning | ||
| * strategy. | ||
| */ | ||
| export declare const computePosition: (reference: ReferenceElement, floating: FloatingElement, options?: Partial<ComputePositionConfig>) => Promise<import("@floating-ui/core").ComputePositionReturn>; | ||
| export { autoUpdate } from './autoUpdate'; | ||
| export { platform } from './platform'; | ||
| export { arrow, autoPlacement, detectOverflow, flip, hide, inline, limitShift, offset, shift, size, } from '@floating-ui/core'; | ||
| export { getOverflowAncestors } from '@floating-ui/utils/dom'; |
| import type { Platform } from './types'; | ||
| export declare const platform: Required<Platform>; |
| import type { Rect, Strategy } from '@floating-ui/core'; | ||
| export declare function convertOffsetParentRelativeRectToViewportRelativeRect({ rect, offsetParent, strategy, }: { | ||
| rect: Rect; | ||
| offsetParent: Element | Window; | ||
| strategy: Strategy; | ||
| }): Rect; |
| export declare function getClientRects(element: Element): DOMRect[]; |
| import type { Boundary, Rect, RootBoundary, Strategy } from '@floating-ui/core'; | ||
| import { Platform, ReferenceElement } from '../types'; | ||
| type PlatformWithCache = Platform & { | ||
| _c: Map<ReferenceElement, Element[]>; | ||
| }; | ||
| export declare function getClippingRect(this: PlatformWithCache, { element, boundary, rootBoundary, strategy, }: { | ||
| element: Element; | ||
| boundary: Boundary; | ||
| rootBoundary: RootBoundary; | ||
| strategy: Strategy; | ||
| }): Rect; | ||
| export {}; |
| import type { Dimensions } from '@floating-ui/core'; | ||
| export declare function getDimensions(element: Element): Dimensions; |
| export { getDocumentElement } from '@floating-ui/utils/dom'; |
| import { Platform } from '../types'; | ||
| export declare const getElementRects: Platform['getElementRects']; |
| type Polyfill = (element: HTMLElement) => Element | null; | ||
| export declare function getOffsetParent(element: Element, polyfill?: Polyfill): Element | Window; | ||
| export {}; |
| import type { Coords } from '@floating-ui/core'; | ||
| import type { VirtualElement } from '../types'; | ||
| export declare function getScale(element: Element | VirtualElement): Coords; |
| export { isElement } from '@floating-ui/utils/dom'; |
| export declare function isRTL(element: Element): boolean; |
-166
| import type { ArrowOptions as CoreArrowOptions, AutoPlacementOptions as CoreAutoPlacementOptions, ClientRectObject, ComputePositionConfig as CoreComputePositionConfig, Coords, DetectOverflowOptions as CoreDetectOverflowOptions, Dimensions, ElementRects, FlipOptions as CoreFlipOptions, HideOptions as CoreHideOptions, InlineOptions, LimitShiftOptions, Middleware as CoreMiddleware, MiddlewareReturn, MiddlewareState as CoreMiddlewareState, Rect, RootBoundary, ShiftOptions as CoreShiftOptions, SideObject, SizeOptions as CoreSizeOptions, Strategy } from '@floating-ui/core'; | ||
| type Prettify<T> = { | ||
| [K in keyof T]: T[K]; | ||
| } & {}; | ||
| type Promisable<T> = T | Promise<T>; | ||
| export type Derivable<T> = (state: MiddlewareState) => T; | ||
| export interface Platform { | ||
| getElementRects: (args: { | ||
| reference: ReferenceElement; | ||
| floating: FloatingElement; | ||
| strategy: Strategy; | ||
| }) => Promisable<ElementRects>; | ||
| getClippingRect: (args: { | ||
| element: Element; | ||
| boundary: Boundary; | ||
| rootBoundary: RootBoundary; | ||
| strategy: Strategy; | ||
| }) => Promisable<Rect>; | ||
| getDimensions: (element: Element) => Promisable<Dimensions>; | ||
| convertOffsetParentRelativeRectToViewportRelativeRect?: (args: { | ||
| rect: Rect; | ||
| offsetParent: Element; | ||
| strategy: Strategy; | ||
| }) => Promisable<Rect>; | ||
| getOffsetParent?: (element: Element, polyfill?: (element: HTMLElement) => Element | null) => Promisable<Element | Window>; | ||
| isElement?: (value: unknown) => Promisable<boolean>; | ||
| getDocumentElement?: (element: Element) => Promisable<HTMLElement>; | ||
| getClientRects?: (element: Element) => Promisable<Array<ClientRectObject>>; | ||
| isRTL?: (element: Element) => Promisable<boolean>; | ||
| getScale?: (element: HTMLElement) => Promisable<{ | ||
| x: number; | ||
| y: number; | ||
| }>; | ||
| } | ||
| export interface NodeScroll { | ||
| scrollLeft: number; | ||
| scrollTop: number; | ||
| } | ||
| /** | ||
| * The clipping boundary area of the floating element. | ||
| */ | ||
| export type Boundary = 'clippingAncestors' | Element | Array<Element> | Rect; | ||
| export type DetectOverflowOptions = Prettify<Omit<CoreDetectOverflowOptions, 'boundary'> & { | ||
| boundary?: Boundary; | ||
| }>; | ||
| export type ComputePositionConfig = Prettify<Omit<CoreComputePositionConfig, 'middleware' | 'platform'> & { | ||
| /** | ||
| * Array of middleware objects to modify the positioning or provide data for | ||
| * rendering. | ||
| */ | ||
| middleware?: Array<Middleware | null | undefined | false>; | ||
| /** | ||
| * Custom or extended platform object. | ||
| */ | ||
| platform?: Platform; | ||
| }>; | ||
| /** | ||
| * Custom positioning reference element. | ||
| * @see https://floating-ui.com/docs/virtual-elements | ||
| */ | ||
| export interface VirtualElement { | ||
| getBoundingClientRect(): ClientRectObject; | ||
| contextElement?: Element; | ||
| } | ||
| export type ReferenceElement = Element | VirtualElement; | ||
| export type FloatingElement = HTMLElement; | ||
| export interface Elements { | ||
| reference: ReferenceElement; | ||
| floating: FloatingElement; | ||
| } | ||
| export type MiddlewareState = Prettify<Omit<CoreMiddlewareState, 'elements'> & { | ||
| elements: Elements; | ||
| }>; | ||
| /** | ||
| * @deprecated use `MiddlewareState` instead. | ||
| */ | ||
| export type MiddlewareArguments = MiddlewareState; | ||
| export type Middleware = Prettify<Omit<CoreMiddleware, 'fn'> & { | ||
| fn(state: MiddlewareState): Promisable<MiddlewareReturn>; | ||
| }>; | ||
| export type SizeOptions = Prettify<Omit<CoreSizeOptions, 'apply' | 'boundary'> & DetectOverflowOptions & { | ||
| /** | ||
| * Function that is called to perform style mutations to the floating element | ||
| * to change its size. | ||
| * @default undefined | ||
| */ | ||
| apply?(args: MiddlewareState & { | ||
| availableWidth: number; | ||
| availableHeight: number; | ||
| }): Promisable<void>; | ||
| }>; | ||
| export type ArrowOptions = Prettify<Omit<CoreArrowOptions, 'element'> & { | ||
| element: Element; | ||
| }>; | ||
| export type AutoPlacementOptions = Prettify<Omit<CoreAutoPlacementOptions, 'boundary'> & DetectOverflowOptions>; | ||
| export type ShiftOptions = Prettify<Omit<CoreShiftOptions, 'boundary'> & DetectOverflowOptions>; | ||
| export type FlipOptions = Prettify<Omit<CoreFlipOptions, 'boundary'> & DetectOverflowOptions>; | ||
| export type HideOptions = Prettify<Omit<CoreHideOptions, 'boundary'> & DetectOverflowOptions>; | ||
| /** | ||
| * Optimizes the visibility of the floating element by choosing the placement | ||
| * that has the most space available automatically, without needing to specify a | ||
| * preferred placement. Alternative to `flip`. | ||
| * @see https://floating-ui.com/docs/autoPlacement | ||
| */ | ||
| declare const autoPlacement: (options?: AutoPlacementOptions | Derivable<AutoPlacementOptions>) => Middleware; | ||
| /** | ||
| * Optimizes the visibility of the floating element by shifting it in order to | ||
| * keep it in view when it will overflow the clipping boundary. | ||
| * @see https://floating-ui.com/docs/shift | ||
| */ | ||
| declare const shift: (options?: ShiftOptions | Derivable<ShiftOptions>) => Middleware; | ||
| /** | ||
| * Optimizes the visibility of the floating element by flipping the `placement` | ||
| * in order to keep it in view when the preferred placement(s) will overflow the | ||
| * clipping boundary. Alternative to `autoPlacement`. | ||
| * @see https://floating-ui.com/docs/flip | ||
| */ | ||
| declare const flip: (options?: FlipOptions | Derivable<FlipOptions>) => Middleware; | ||
| /** | ||
| * Provides data that allows you to change the size of the floating element — | ||
| * for instance, prevent it from overflowing the clipping boundary or match the | ||
| * width of the reference element. | ||
| * @see https://floating-ui.com/docs/size | ||
| */ | ||
| declare const size: (options?: SizeOptions | Derivable<SizeOptions>) => Middleware; | ||
| /** | ||
| * Provides data to hide the floating element in applicable situations, such as | ||
| * when it is not in the same clipping context as the reference element. | ||
| * @see https://floating-ui.com/docs/hide | ||
| */ | ||
| declare const hide: (options?: HideOptions | Derivable<HideOptions>) => Middleware; | ||
| /** | ||
| * Provides data to position an inner element of the floating element so that it | ||
| * appears centered to the reference element. | ||
| * @see https://floating-ui.com/docs/arrow | ||
| */ | ||
| declare const arrow: (options: ArrowOptions | Derivable<ArrowOptions>) => Middleware; | ||
| /** | ||
| * Provides improved positioning for inline reference elements that can span | ||
| * over multiple lines, such as hyperlinks or range selections. | ||
| * @see https://floating-ui.com/docs/inline | ||
| */ | ||
| declare const inline: (options?: InlineOptions | Derivable<InlineOptions>) => Middleware; | ||
| /** | ||
| * Built-in `limiter` that will stop `shift()` at a certain point. | ||
| */ | ||
| declare const limitShift: (options?: LimitShiftOptions | Derivable<LimitShiftOptions>) => { | ||
| options: any; | ||
| fn: (state: MiddlewareState) => Coords; | ||
| }; | ||
| /** | ||
| * Resolves with an object of overflow side offsets that determine how much the | ||
| * element is overflowing a given clipping boundary on each side. | ||
| * - positive = overflowing the boundary by that number of pixels | ||
| * - negative = how many pixels left before it will overflow | ||
| * - 0 = lies flush with the boundary | ||
| * @see https://floating-ui.com/docs/detectOverflow | ||
| */ | ||
| declare const detectOverflow: (state: MiddlewareState, options?: DetectOverflowOptions) => Promise<SideObject>; | ||
| export { arrow, autoPlacement, detectOverflow, flip, hide, inline, limitShift, shift, size, }; | ||
| export { computePosition } from './'; | ||
| export { autoUpdate, AutoUpdateOptions } from './autoUpdate'; | ||
| export { platform } from './platform'; | ||
| export type { AlignedPlacement, Alignment, Axis, ClientRectObject, ComputePositionReturn, Coords, Dimensions, ElementContext, ElementRects, InlineOptions, Length, MiddlewareData, MiddlewareReturn, OffsetOptions, Padding, Placement, Rect, RootBoundary, Side, SideObject, Strategy, } from '@floating-ui/core'; | ||
| export { offset } from '@floating-ui/core'; | ||
| export { getOverflowAncestors } from '@floating-ui/utils/dom'; |
| import type { ClientRectObject, VirtualElement } from '@floating-ui/core'; | ||
| export declare function getBoundingClientRect(element: Element | VirtualElement, includeScale?: boolean, isFixedStrategy?: boolean, offsetParent?: Element | Window): ClientRectObject; |
| import type { Dimensions } from '@floating-ui/core'; | ||
| export declare function getCssDimensions(element: Element): Dimensions & { | ||
| $: boolean; | ||
| }; |
| import type { Rect } from '@floating-ui/core'; | ||
| export declare function getDocumentRect(element: HTMLElement): Rect; |
| import type { Rect, Strategy, VirtualElement } from '@floating-ui/core'; | ||
| export declare function getRectRelativeToOffsetParent(element: Element | VirtualElement, offsetParent: Element | Window, strategy: Strategy): Rect; |
| import type { Rect, Strategy } from '@floating-ui/core'; | ||
| export declare function getViewportRect(element: Element, strategy: Strategy): Rect; |
| import type { Coords } from '@floating-ui/core'; | ||
| export declare function getVisualOffsets(element: Element | undefined): Coords; | ||
| export declare function shouldAddVisualOffsets(element: Element | undefined, isFixed?: boolean, floatingOffsetParent?: Element | Window | undefined): boolean; |
| export declare function getWindowScrollBarX(element: Element): number; |
| import type { VirtualElement } from '../types'; | ||
| export declare function unwrapElement(element: Element | VirtualElement): Element | undefined; |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
143695
13.31%3132
6.31%7
75%11
-64.52%- Removed
Updated
Updated