UNPKG

2.14 kBTypeScriptView Raw
1import { ElementRef, RendererFactory2, NgZone } from '@angular/core';
2import { Observable } from 'rxjs';
3import { Options } from './models';
4import * as i0 from "@angular/core";
5export interface PositioningOptions {
6 /** The DOM element, ElementRef, or a selector string of an element which will be moved */
7 element?: HTMLElement | ElementRef | string;
8 /** The DOM element, ElementRef, or a selector string of an element which the element will be attached to */
9 target?: HTMLElement | ElementRef | string;
10 /**
11 * A string of the form 'vert-attachment horiz-attachment' or 'placement'
12 * - placement can be "top", "bottom", "left", "right"
13 * not yet supported:
14 * - vert-attachment can be any of 'top', 'middle', 'bottom'
15 * - horiz-attachment can be any of 'left', 'center', 'right'
16 */
17 attachment?: string;
18 /** A string similar to `attachment`. The one difference is that, if it's not provided,
19 * `targetAttachment` will assume the mirror image of `attachment`.
20 */
21 targetAttachment?: string;
22 /** A string of the form 'vert-offset horiz-offset'
23 * - vert-offset and horiz-offset can be of the form "20px" or "55%"
24 */
25 offset?: string;
26 /** A string similar to `offset`, but referring to the offset of the target */
27 targetOffset?: string;
28 /** If true component will be attached to body */
29 appendToBody?: boolean;
30}
31export declare class PositioningService {
32 private options?;
33 private update$$;
34 private positionElements;
35 private triggerEvent$?;
36 private isDisabled;
37 constructor(ngZone: NgZone, rendererFactory: RendererFactory2, platformId: number);
38 position(options: PositioningOptions): void;
39 get event$(): Observable<number | Event | null> | undefined;
40 disable(): void;
41 enable(): void;
42 addPositionElement(options: PositioningOptions): void;
43 calcPosition(): void;
44 deletePositionElement(elRef: ElementRef): void;
45 setOptions(options: Options): void;
46 static ɵfac: i0.ɵɵFactoryDeclaration<PositioningService, never>;
47 static ɵprov: i0.ɵɵInjectableDeclaration<PositioningService>;
48}