UNPKG

igniteui-angular

Version:

Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps

52 lines (51 loc) 2.24 kB
import { ConnectedFit } from '../utilities'; import { Point, PositionSettings, Size } from './../utilities'; import { IPositionStrategy } from './IPositionStrategy'; /** * Positions the element based on the directions and start point passed in trough PositionSettings. * It is possible to either pass a start point or an HTMLElement as a positioning base. */ export declare class ConnectedPositioningStrategy implements IPositionStrategy { /** * PositionSettings to use when position the component in the overlay */ settings: PositionSettings; private _defaultSettings; constructor(settings?: PositionSettings); /** * Position the element based on the PositionStrategy implementing this interface. * * @param contentElement The HTML element to be positioned * @param size Size of the element * @param document reference to the Document object * @param initialCall should be true if this is the initial call to the method * @param target attaching target for the component to show * ```typescript * settings.positionStrategy.position(content, size, document, true); * ``` */ position(contentElement: HTMLElement, size: Size, document?: Document, initialCall?: boolean, target?: Point | HTMLElement): void; /** * Creates clone of this position strategy * @returns clone of this position strategy */ clone(): IPositionStrategy; /** * Obtains the DomRect objects for the required elements - target and element to position * * @returns target and element DomRect objects */ protected calculateElementRectangles(contentElement: any, target: Point | HTMLElement): { targetRect: Partial<DOMRect>; elementRect: Partial<DOMRect>; }; /** * Sets element's style which effectively positions provided element according * to provided position settings * * @param element Element to position * @param targetRect Bounding rectangle of strategy target * @param elementRect Bounding rectangle of the element */ protected setStyle(element: HTMLElement, targetRect: Partial<DOMRect>, elementRect: Partial<DOMRect>, connectedFit: ConnectedFit): void; }