@popperjs/core
- Version 2.11.8
- Published
- 1.46 MB
- No dependencies
- MIT license
Install
npm i @popperjs/core
yarn add @popperjs/core
pnpm add @popperjs/core
Overview
Tooltip and Popover Positioning Engine
Index
Variables
Functions
Type Aliases
- AutoPlacement
- BasePlacement
- Boundary
- ClientRectObject
- ComputedPlacement
- Context
- EventListeners
- Instance
- Modifier
- ModifierArguments
- ModifierPhases
- Obj
- Offsets
- Options
- OptionsGeneric
- Padding
- Placement
- PositioningStrategy
- Rect
- RootBoundary
- SideObject
- State
- StateOffsets
- StateRects
- StrictModifiers
- UpdateCallback
- Variation
- VariationPlacement
- VirtualElement
- VisualViewport
- Window
Variables
variable afterMain
const afterMain: string;
variable afterRead
const afterRead: string;
variable afterWrite
const afterWrite: string;
variable applyStyles
const applyStyles: ApplyStylesModifier;
variable arrow
const arrow: ArrowModifier;
variable auto
const auto: string;
variable basePlacements
const basePlacements: BasePlacement[];
variable beforeMain
const beforeMain: string;
variable beforeRead
const beforeRead: string;
variable beforeWrite
const beforeWrite: string;
variable bottom
const bottom: string;
variable clippingParents
const clippingParents: string;
variable computeStyles
const computeStyles: ComputeStylesModifier;
variable end
const end: string;
variable eventListeners
const eventListeners: EventListenersModifier;
variable flip
const flip: FlipModifier;
variable hide
const hide: HideModifier;
variable left
const left: string;
variable main
const main: string;
variable modifierPhases
const modifierPhases: ModifierPhases[];
variable offset
const offset: OffsetModifier;
variable placements
const placements: Placement[];
variable popper
const popper: string;
variable popperOffsets
const popperOffsets: PopperOffsetsModifier;
variable preventOverflow
const preventOverflow: PreventOverflowModifier;
variable read
const read: string;
variable reference
const reference: string;
variable right
const right: string;
variable start
const start: string;
variable top
const top: string;
variable variationPlacements
const variationPlacements: VariationPlacement[];
variable viewport
const viewport: string;
variable write
const write: string;
Functions
function createPopper
createPopper: <TModifier extends Partial<Modifier<any, any>>>( reference: Element | import('./types').VirtualElement, popper: HTMLElement, options?: Partial<OptionsGeneric<TModifier>>) => import('./types').Instance;
function createPopperBase
createPopperBase: <TModifier extends Partial<Modifier<any, any>>>( reference: Element | VirtualElement, popper: HTMLElement, options?: Partial<OptionsGeneric<TModifier>>) => Instance;
function createPopperLite
createPopperLite: <TModifier extends Partial<Modifier<any, any>>>( reference: Element | import('./types').VirtualElement, popper: HTMLElement, options?: Partial<OptionsGeneric<TModifier>>) => import('./types').Instance;
function detectOverflow
detectOverflow: (state: State, options?: Partial<Options>) => SideObject;
function popperGenerator
popperGenerator: ( generatorOptions?: PopperGeneratorArgs) => <TModifier extends Partial<Modifier<any, any>>>( reference: Element | VirtualElement, popper: HTMLElement, options?: Partial<OptionsGeneric<TModifier>>) => Instance;
Type Aliases
type AutoPlacement
type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';
type BasePlacement
type BasePlacement = typeof top | typeof bottom | typeof right | typeof left;
type Boundary
type Boundary = Element | Array<Element> | typeof clippingParents;
type ClientRectObject
type ClientRectObject = { x: number; y: number; top: number; left: number; right: number; bottom: number; width: number; height: number;};
type ComputedPlacement
type ComputedPlacement = VariationPlacement | BasePlacement;
type Context
type Context = typeof popper | typeof reference;
type EventListeners
type EventListeners = { scroll: boolean; resize: boolean;};
type Instance
type Instance = { state: State; destroy: () => void; forceUpdate: () => void; update: () => Promise<Partial<State>>; setOptions: ( setOptionsAction: SetAction<Partial<OptionsGeneric<any>>> ) => Promise<Partial<State>>;};
type Modifier
type Modifier<Name, Options extends Obj> = { name: Name; enabled: boolean; phase: ModifierPhases; requires?: Array<string>; requiresIfExists?: Array<string>; fn: (arg0: ModifierArguments<Options>) => State | void; effect?: (arg0: ModifierArguments<Options>) => (() => void) | void; options?: Partial<Options>; data?: Obj;};
type ModifierArguments
type ModifierArguments<Options extends Obj> = { state: State; instance: Instance; options: Partial<Options>; name: string;};
type ModifierPhases
type ModifierPhases = | typeof beforeRead | typeof read | typeof afterRead | typeof beforeMain | typeof main | typeof afterMain | typeof beforeWrite | typeof write | typeof afterWrite;
type Obj
type Obj = { [key: string]: any;};
type Offsets
type Offsets = { y: number; x: number;};
type Options
type Options = { placement: Placement; modifiers: Array<Partial<Modifier<any, any>>>; strategy: PositioningStrategy; onFirstUpdate?: (arg0: Partial<State>) => void;};
type OptionsGeneric
type OptionsGeneric<TModifier> = { placement: Placement; modifiers: Array<TModifier>; strategy: PositioningStrategy; onFirstUpdate?: (arg0: Partial<State>) => void;};
type Padding
type Padding = number | Partial<SideObject>;
type Placement
type Placement = AutoPlacement | BasePlacement | VariationPlacement;
type PositioningStrategy
type PositioningStrategy = 'absolute' | 'fixed';
type Rect
type Rect = { width: number; height: number; x: number; y: number;};
type RootBoundary
type RootBoundary = typeof viewport | 'document';
type SideObject
type SideObject = { top: number; left: number; right: number; bottom: number;};
type State
type State = { elements: { reference: Element | VirtualElement; popper: HTMLElement; arrow?: HTMLElement; }; options: OptionsGeneric<any>; placement: Placement; strategy: PositioningStrategy; orderedModifiers: Array<Modifier<any, any>>; rects: StateRects; scrollParents: { reference: Array<Element | Window | VisualViewport>; popper: Array<Element | Window | VisualViewport>; }; styles: { [key: string]: Partial<CSSStyleDeclaration>; }; attributes: { [key: string]: { [key: string]: string | boolean; }; }; modifiersData: { arrow?: { x?: number; y?: number; centerOffset: number; }; hide?: { isReferenceHidden: boolean; hasPopperEscaped: boolean; referenceClippingOffsets: SideObject; popperEscapeOffsets: SideObject; }; offset?: OffsetData; preventOverflow?: Offsets; popperOffsets?: Offsets; [key: string]: any; }; reset: boolean;};
type StateOffsets
type StateOffsets = { popper: Offsets; arrow?: Offsets;};
type StateRects
type StateRects = { reference: Rect; popper: Rect;};
type StrictModifiers
type StrictModifiers = | Partial<OffsetModifier> | Partial<ApplyStylesModifier> | Partial<ArrowModifier> | Partial<HideModifier> | Partial<ComputeStylesModifier> | Partial<EventListenersModifier> | Partial<FlipModifier> | Partial<PreventOverflowModifier> | Partial<PopperOffsetsModifier>;
type UpdateCallback
type UpdateCallback = (arg0: State) => void;
type Variation
type Variation = typeof start | typeof end;
type VariationPlacement
type VariationPlacement = | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end';
type VirtualElement
type VirtualElement = { getBoundingClientRect: () => ClientRect | DOMRect; contextElement?: Element;};
type VisualViewport
type VisualViewport = EventTarget & { width: number; height: number; offsetLeft: number; offsetTop: number; scale: number;};
type Window
type Window = { innerHeight: number; offsetHeight: number; innerWidth: number; offsetWidth: number; pageXOffset: number; pageYOffset: number; getComputedStyle: typeof getComputedStyle; addEventListener(type: any, listener: any, optionsOrUseCapture?: any): void; removeEventListener(type: any, listener: any, optionsOrUseCapture?: any): void; Element: Element; HTMLElement: HTMLElement; Node: Node; toString(): '[object Window]'; devicePixelRatio: number; visualViewport?: VisualViewport; ShadowRoot: ShadowRoot;};
Package Files (16)
- index.d.ts
- lib/createPopper.d.ts
- lib/enums.d.ts
- lib/modifiers/applyStyles.d.ts
- lib/modifiers/arrow.d.ts
- lib/modifiers/computeStyles.d.ts
- lib/modifiers/eventListeners.d.ts
- lib/modifiers/flip.d.ts
- lib/modifiers/hide.d.ts
- lib/modifiers/offset.d.ts
- lib/modifiers/popperOffsets.d.ts
- lib/modifiers/preventOverflow.d.ts
- lib/popper-lite.d.ts
- lib/popper.d.ts
- lib/types.d.ts
- lib/utils/detectOverflow.d.ts
Dependencies (0)
No dependencies.
Dev Dependencies (46)
- @ampproject/rollup-plugin-closure-compiler
- @atomico/rollup-plugin-sizes
- @babel/cli
- @babel/core
- @babel/plugin-transform-flow-strip-types
- @babel/plugin-transform-runtime
- @babel/preset-env
- @fezvrasta/tsc-silent
- @khanacademy/flow-to-ts
- @rollup/plugin-babel
- @rollup/plugin-replace
- babel-eslint
- babel-jest
- babel-plugin-add-import-extension
- babel-plugin-annotate-pure-calls
- babel-plugin-dev-expression
- babel-plugin-inline-replace-variables
- babel-plugin-transform-inline-environment-variables
- concurrently
- dotenv
- eslint
- eslint-plugin-flowtype
- eslint-plugin-import
- eslint-plugin-unused-imports
- flow-bin
- flow-copy-source
- get-port-cli
- husky
- jest
- jest-environment-jsdom-sixteen
- jest-environment-puppeteer
- jest-image-snapshot
- jest-puppeteer
- pinst
- poster
- prettier
- pretty-quick
- puppeteer
- replace-in-files-cli
- rollup
- rollup-plugin-flow-entry
- rollup-plugin-license
- rollup-plugin-terser
- rollup-plugin-visualizer
- serve
- typescript
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@popperjs/core
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@popperjs/core)
- HTML<a href="https://www.jsdocs.io/package/@popperjs/core"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 5191 ms. - Missing or incorrect documentation? Open an issue for this package.