1 | import { PositionStrategy } from './position-strategy';
|
2 | import { ElementRef } from '@angular/core';
|
3 | import { ViewportRuler } from './viewport-ruler';
|
4 | import { ConnectionPositionPair, OriginConnectionPosition, OverlayConnectionPosition } from './connected-position';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | export declare class ConnectedPositionStrategy implements PositionStrategy {
|
13 | private _connectedTo;
|
14 | private _originPos;
|
15 | private _overlayPos;
|
16 | private _viewportRuler;
|
17 |
|
18 | _isRtl: boolean;
|
19 |
|
20 | _preferredPositions: ConnectionPositionPair[];
|
21 |
|
22 | private _origin;
|
23 | constructor(_connectedTo: ElementRef, _originPos: OriginConnectionPosition, _overlayPos: OverlayConnectionPosition, _viewportRuler: ViewportRuler);
|
24 | readonly positions: ConnectionPositionPair[];
|
25 | /**
|
26 | * Updates the position of the overlay element, using whichever preferred position relative
|
27 | * to the origin fits on-screen.
|
28 | * TODO: internal
|
29 | */
|
30 | apply(element: HTMLElement): Promise<void>;
|
31 | withFallbackPosition(originPos: OriginConnectionPosition, overlayPos: OverlayConnectionPosition): this;
|
32 | /**
|
33 | * Gets the horizontal (x) "start" dimension based on whether the overlay is in an RTL context.
|
34 | * @param rect
|
35 | */
|
36 | private _getStartX(rect);
|
37 | /**
|
38 | * Gets the horizontal (x) "end" dimension based on whether the overlay is in an RTL context.
|
39 | * @param rect
|
40 | */
|
41 | private _getEndX(rect);
|
42 | /**
|
43 | * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
|
44 | * @param originRect
|
45 | * @param pos
|
46 | */
|
47 | private _getOriginConnectionPoint(originRect, pos);
|
48 | /**
|
49 | * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
|
50 | * origin point to which the overlay should be connected.
|
51 | * @param originPoint
|
52 | * @param overlayRect
|
53 | * @param pos
|
54 | */
|
55 | private _getOverlayPoint(originPoint, overlayRect, pos);
|
56 | /**
|
57 | * Gets whether the overlay positioned at the given point will fit on-screen.
|
58 | * @param overlayPoint The top-left coordinate of the overlay.
|
59 | * @param overlayRect Bounding rect of the overlay, used to get its size.
|
60 | * @param viewportRect The bounding viewport.
|
61 | */
|
62 | private _willOverlayFitWithinViewport(overlayPoint, overlayRect, viewportRect);
|
63 | /**
|
64 | * Physically positions the overlay element to the given coordinate.
|
65 | * @param element
|
66 | * @param overlayPoint
|
67 | */
|
68 | private _setElementPosition(element, overlayPoint);
|
69 | }
|