UNPKG

@ng-doc/ui-kit

Version:

<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>

45 lines (40 loc) 2.6 kB
import { ConnectedPosition, ConnectionPositionPair } from '@angular/cdk/overlay'; import { NgDocOverlayPosition, NgDocHorizontalAlign, NgDocVerticalAlign, NgDocOverlayRelativePosition } from '@ng-doc/ui-kit/types'; import { Point } from '@angular/cdk/drag-drop'; declare class NgDocFocusUtils { static isNativeKeyboardFocusable(element: Element): boolean; static getClosestKeyboardFocusable(initial: HTMLElement, root: Node, forward?: boolean): HTMLElement | null; static focusClosestElement(initial: HTMLElement, root: Node, forward?: boolean): void; } declare const NG_DOC_ARROW_MARGIN: number; declare class NgDocOverlayUtils { static getConnectedPosition(dropdownPositions: NgDocOverlayPosition | NgDocOverlayPosition[], origin: HTMLElement, offset?: number, withPointer?: boolean): ConnectedPosition[]; static toConnectedPosition(position: NgDocOverlayPosition): ConnectedPosition; static toConnectedPositions(positions: NgDocOverlayPosition[]): ConnectedPosition[]; static getOffsetX(origin: HTMLElement, position: ConnectedPosition): number; static getOffsetY(origin: HTMLElement, position: ConnectedPosition): number; static overlayIsOutByX(position: ConnectedPosition): boolean; static overlayIsOutByY(position: ConnectedPosition): boolean; static getOffsetMultiplier(position: ConnectedPosition): number; static getMarginMultiplier(position: ConnectedPosition): number; static isVerticalPosition(position: ConnectedPosition): boolean; static isCenterPosition(position: ConnectedPosition): boolean; static getPositionAlign(position: ConnectedPosition): NgDocHorizontalAlign | NgDocVerticalAlign | null; static getRelativePosition(pos: NgDocOverlayPosition): NgDocOverlayRelativePosition | null; static getOverlayPosition(positionPair: ConnectionPositionPair): NgDocOverlayPosition; } declare class NgDocPositionUtils { /** * Getting the position of the element relative to the viewPort, this function is faster than BoundingClientRect, * it also takes into account the change in the position of the element through transform * @param element */ static getElementPosition(element: HTMLElement | null): Point; /** * An implementation of the element.offsetParent function, this implementation closes a bug in Firefox when it * returns an offsetParent for elements with position: fixed * @param element */ static getOffsetParent(element: HTMLElement): HTMLElement | null; } export { NG_DOC_ARROW_MARGIN, NgDocFocusUtils, NgDocOverlayUtils, NgDocPositionUtils };