UNPKG

53.5 kBTypeScriptView Raw
1import { BooleanInput } from '@angular/cdk/coercion';
2import { CdkScrollable } from '@angular/cdk/scrolling';
3import { ComponentFactoryResolver } from '@angular/core';
4import { ComponentPortal } from '@angular/cdk/portal';
5import { ComponentRef } from '@angular/core';
6import { ComponentType } from '@angular/cdk/portal';
7import { Direction } from '@angular/cdk/bidi';
8import { Directionality } from '@angular/cdk/bidi';
9import { ElementRef } from '@angular/core';
10import { EmbeddedViewRef } from '@angular/core';
11import { EventEmitter } from '@angular/core';
12import * as i0 from '@angular/core';
13import * as i1 from '@angular/cdk/bidi';
14import * as i2 from '@angular/cdk/portal';
15import * as i3 from '@angular/cdk/scrolling';
16import { InjectionToken } from '@angular/core';
17import { Injector } from '@angular/core';
18import { Location as Location_2 } from '@angular/common';
19import { NgZone } from '@angular/core';
20import { Observable } from 'rxjs';
21import { OnChanges } from '@angular/core';
22import { OnDestroy } from '@angular/core';
23import { Platform } from '@angular/cdk/platform';
24import { PortalOutlet } from '@angular/cdk/portal';
25import { ScrollDispatcher } from '@angular/cdk/scrolling';
26import { SimpleChanges } from '@angular/core';
27import { Subject } from 'rxjs';
28import { TemplatePortal } from '@angular/cdk/portal';
29import { TemplateRef } from '@angular/core';
30import { ViewContainerRef } from '@angular/core';
31import { ViewportRuler } from '@angular/cdk/scrolling';
32
33/**
34 * Service for dispatching events that land on the body to appropriate overlay ref,
35 * if any. It maintains a list of attached overlays to determine best suited overlay based
36 * on event target and order of overlay opens.
37 */
38declare abstract class BaseOverlayDispatcher implements OnDestroy {
39 /** Currently attached overlays in the order they were attached. */
40 _attachedOverlays: OverlayRef[];
41 protected _document: Document;
42 protected _isAttached: boolean;
43 constructor(document: any);
44 ngOnDestroy(): void;
45 /** Add a new overlay to the list of attached overlay refs. */
46 add(overlayRef: OverlayRef): void;
47 /** Remove an overlay from the list of attached overlay refs. */
48 remove(overlayRef: OverlayRef): void;
49 /** Detaches the global event listener. */
50 protected abstract detach(): void;
51 static ɵfac: i0.ɵɵFactoryDeclaration<BaseOverlayDispatcher, never>;
52 static ɵprov: i0.ɵɵInjectableDeclaration<BaseOverlayDispatcher>;
53}
54
55/**
56 * Strategy that will prevent the user from scrolling while the overlay is visible.
57 */
58export declare class BlockScrollStrategy implements ScrollStrategy {
59 private _viewportRuler;
60 private _previousHTMLStyles;
61 private _previousScrollPosition;
62 private _isEnabled;
63 private _document;
64 constructor(_viewportRuler: ViewportRuler, document: any);
65 /** Attaches this scroll strategy to an overlay. */
66 attach(): void;
67 /** Blocks page-level scroll while the attached overlay is open. */
68 enable(): void;
69 /** Unblocks page-level scroll while the attached overlay is open. */
70 disable(): void;
71 private _canBeEnabled;
72}
73
74/** Injection token that determines the scroll handling while the connected overlay is open. */
75declare const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
76
77/** @docs-private */
78declare const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER: {
79 provide: InjectionToken<() => ScrollStrategy>;
80 deps: (typeof Overlay)[];
81 useFactory: typeof CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY;
82};
83
84/** @docs-private */
85declare function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay: Overlay): () => RepositionScrollStrategy;
86
87/**
88 * Directive to facilitate declarative creation of an
89 * Overlay using a FlexibleConnectedPositionStrategy.
90 */
91export declare class CdkConnectedOverlay implements OnDestroy, OnChanges {
92 private _overlay;
93 private _dir;
94 private _overlayRef;
95 private _templatePortal;
96 private _hasBackdrop;
97 private _lockPosition;
98 private _growAfterOpen;
99 private _flexibleDimensions;
100 private _push;
101 private _backdropSubscription;
102 private _attachSubscription;
103 private _detachSubscription;
104 private _positionSubscription;
105 private _offsetX;
106 private _offsetY;
107 private _position;
108 private _scrollStrategyFactory;
109 /** Origin for the connected overlay. */
110 origin: CdkOverlayOrigin | FlexibleConnectedPositionStrategyOrigin;
111 /** Registered connected position pairs. */
112 positions: ConnectedPosition[];
113 /**
114 * This input overrides the positions input if specified. It lets users pass
115 * in arbitrary positioning strategies.
116 */
117 positionStrategy: FlexibleConnectedPositionStrategy;
118 /** The offset in pixels for the overlay connection point on the x-axis */
119 get offsetX(): number;
120 set offsetX(offsetX: number);
121 /** The offset in pixels for the overlay connection point on the y-axis */
122 get offsetY(): number;
123 set offsetY(offsetY: number);
124 /** The width of the overlay panel. */
125 width: number | string;
126 /** The height of the overlay panel. */
127 height: number | string;
128 /** The min width of the overlay panel. */
129 minWidth: number | string;
130 /** The min height of the overlay panel. */
131 minHeight: number | string;
132 /** The custom class to be set on the backdrop element. */
133 backdropClass: string | string[];
134 /** The custom class to add to the overlay pane element. */
135 panelClass: string | string[];
136 /** Margin between the overlay and the viewport edges. */
137 viewportMargin: number;
138 /** Strategy to be used when handling scroll events while the overlay is open. */
139 scrollStrategy: ScrollStrategy;
140 /** Whether the overlay is open. */
141 open: boolean;
142 /** Whether the overlay can be closed by user interaction. */
143 disableClose: boolean;
144 /** CSS selector which to set the transform origin. */
145 transformOriginSelector: string;
146 /** Whether or not the overlay should attach a backdrop. */
147 get hasBackdrop(): boolean;
148 set hasBackdrop(value: BooleanInput);
149 /** Whether or not the overlay should be locked when scrolling. */
150 get lockPosition(): boolean;
151 set lockPosition(value: BooleanInput);
152 /** Whether the overlay's width and height can be constrained to fit within the viewport. */
153 get flexibleDimensions(): boolean;
154 set flexibleDimensions(value: BooleanInput);
155 /** Whether the overlay can grow after the initial open when flexible positioning is turned on. */
156 get growAfterOpen(): boolean;
157 set growAfterOpen(value: BooleanInput);
158 /** Whether the overlay can be pushed on-screen if none of the provided positions fit. */
159 get push(): boolean;
160 set push(value: BooleanInput);
161 /** Event emitted when the backdrop is clicked. */
162 readonly backdropClick: EventEmitter<MouseEvent>;
163 /** Event emitted when the position has changed. */
164 readonly positionChange: EventEmitter<ConnectedOverlayPositionChange>;
165 /** Event emitted when the overlay has been attached. */
166 readonly attach: EventEmitter<void>;
167 /** Event emitted when the overlay has been detached. */
168 readonly detach: EventEmitter<void>;
169 /** Emits when there are keyboard events that are targeted at the overlay. */
170 readonly overlayKeydown: EventEmitter<KeyboardEvent>;
171 /** Emits when there are mouse outside click events that are targeted at the overlay. */
172 readonly overlayOutsideClick: EventEmitter<MouseEvent>;
173 constructor(_overlay: Overlay, templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef, scrollStrategyFactory: any, _dir: Directionality);
174 /** The associated overlay reference. */
175 get overlayRef(): OverlayRef;
176 /** The element's layout direction. */
177 get dir(): Direction;
178 ngOnDestroy(): void;
179 ngOnChanges(changes: SimpleChanges): void;
180 /** Creates an overlay */
181 private _createOverlay;
182 /** Builds the overlay config based on the directive's inputs */
183 private _buildConfig;
184 /** Updates the state of a position strategy, based on the values of the directive inputs. */
185 private _updatePositionStrategy;
186 /** Returns the position strategy of the overlay to be set on the overlay config */
187 private _createPositionStrategy;
188 private _getFlexibleConnectedPositionStrategyOrigin;
189 /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */
190 private _attachOverlay;
191 /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */
192 private _detachOverlay;
193 static ɵfac: i0.ɵɵFactoryDeclaration<CdkConnectedOverlay, [null, null, null, null, { optional: true; }]>;
194 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkConnectedOverlay, "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", ["cdkConnectedOverlay"], { "origin": { "alias": "cdkConnectedOverlayOrigin"; "required": false; }; "positions": { "alias": "cdkConnectedOverlayPositions"; "required": false; }; "positionStrategy": { "alias": "cdkConnectedOverlayPositionStrategy"; "required": false; }; "offsetX": { "alias": "cdkConnectedOverlayOffsetX"; "required": false; }; "offsetY": { "alias": "cdkConnectedOverlayOffsetY"; "required": false; }; "width": { "alias": "cdkConnectedOverlayWidth"; "required": false; }; "height": { "alias": "cdkConnectedOverlayHeight"; "required": false; }; "minWidth": { "alias": "cdkConnectedOverlayMinWidth"; "required": false; }; "minHeight": { "alias": "cdkConnectedOverlayMinHeight"; "required": false; }; "backdropClass": { "alias": "cdkConnectedOverlayBackdropClass"; "required": false; }; "panelClass": { "alias": "cdkConnectedOverlayPanelClass"; "required": false; }; "viewportMargin": { "alias": "cdkConnectedOverlayViewportMargin"; "required": false; }; "scrollStrategy": { "alias": "cdkConnectedOverlayScrollStrategy"; "required": false; }; "open": { "alias": "cdkConnectedOverlayOpen"; "required": false; }; "disableClose": { "alias": "cdkConnectedOverlayDisableClose"; "required": false; }; "transformOriginSelector": { "alias": "cdkConnectedOverlayTransformOriginOn"; "required": false; }; "hasBackdrop": { "alias": "cdkConnectedOverlayHasBackdrop"; "required": false; }; "lockPosition": { "alias": "cdkConnectedOverlayLockPosition"; "required": false; }; "flexibleDimensions": { "alias": "cdkConnectedOverlayFlexibleDimensions"; "required": false; }; "growAfterOpen": { "alias": "cdkConnectedOverlayGrowAfterOpen"; "required": false; }; "push": { "alias": "cdkConnectedOverlayPush"; "required": false; }; }, { "backdropClick": "backdropClick"; "positionChange": "positionChange"; "attach": "attach"; "detach": "detach"; "overlayKeydown": "overlayKeydown"; "overlayOutsideClick": "overlayOutsideClick"; }, never, never, true, never>;
195}
196
197/**
198 * Directive applied to an element to make it usable as an origin for an Overlay using a
199 * ConnectedPositionStrategy.
200 */
201export declare class CdkOverlayOrigin {
202 /** Reference to the element on which the directive is applied. */
203 elementRef: ElementRef;
204 constructor(
205 /** Reference to the element on which the directive is applied. */
206 elementRef: ElementRef);
207 static ɵfac: i0.ɵɵFactoryDeclaration<CdkOverlayOrigin, never>;
208 static ɵdir: i0.ɵɵDirectiveDeclaration<CdkOverlayOrigin, "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", ["cdkOverlayOrigin"], {}, {}, never, never, true, never>;
209}
210
211export { CdkScrollable }
212
213/**
214 * Strategy that will close the overlay as soon as the user starts scrolling.
215 */
216export declare class CloseScrollStrategy implements ScrollStrategy {
217 private _scrollDispatcher;
218 private _ngZone;
219 private _viewportRuler;
220 private _config?;
221 private _scrollSubscription;
222 private _overlayRef;
223 private _initialScrollPosition;
224 constructor(_scrollDispatcher: ScrollDispatcher, _ngZone: NgZone, _viewportRuler: ViewportRuler, _config?: CloseScrollStrategyConfig | undefined);
225 /** Attaches this scroll strategy to an overlay. */
226 attach(overlayRef: OverlayRef): void;
227 /** Enables the closing of the attached overlay on scroll. */
228 enable(): void;
229 /** Disables the closing the attached overlay on scroll. */
230 disable(): void;
231 detach(): void;
232 /** Detaches the overlay ref and disables the scroll strategy. */
233 private _detach;
234}
235
236/**
237 * Config options for the CloseScrollStrategy.
238 */
239declare interface CloseScrollStrategyConfig {
240 /** Amount of pixels the user has to scroll before the overlay is closed. */
241 threshold?: number;
242}
243
244export { ComponentType }
245
246/** The change event emitted by the strategy when a fallback position is used. */
247export declare class ConnectedOverlayPositionChange {
248 /** The position used as a result of this change. */
249 connectionPair: ConnectionPositionPair;
250 /** @docs-private */
251 scrollableViewProperties: ScrollingVisibility;
252 constructor(
253 /** The position used as a result of this change. */
254 connectionPair: ConnectionPositionPair,
255 /** @docs-private */
256 scrollableViewProperties: ScrollingVisibility);
257}
258
259/** A connected position as specified by the user. */
260export declare interface ConnectedPosition {
261 originX: 'start' | 'center' | 'end';
262 originY: 'top' | 'center' | 'bottom';
263 overlayX: 'start' | 'center' | 'end';
264 overlayY: 'top' | 'center' | 'bottom';
265 weight?: number;
266 offsetX?: number;
267 offsetY?: number;
268 panelClass?: string | string[];
269}
270
271/** The points of the origin element and the overlay element to connect. */
272export declare class ConnectionPositionPair {
273 /** Offset along the X axis. */
274 offsetX?: number | undefined;
275 /** Offset along the Y axis. */
276 offsetY?: number | undefined;
277 /** Class(es) to be applied to the panel while this position is active. */
278 panelClass?: string | string[] | undefined;
279 /** X-axis attachment point for connected overlay origin. Can be 'start', 'end', or 'center'. */
280 originX: HorizontalConnectionPos;
281 /** Y-axis attachment point for connected overlay origin. Can be 'top', 'bottom', or 'center'. */
282 originY: VerticalConnectionPos;
283 /** X-axis attachment point for connected overlay. Can be 'start', 'end', or 'center'. */
284 overlayX: HorizontalConnectionPos;
285 /** Y-axis attachment point for connected overlay. Can be 'top', 'bottom', or 'center'. */
286 overlayY: VerticalConnectionPos;
287 constructor(origin: OriginConnectionPosition, overlay: OverlayConnectionPosition,
288 /** Offset along the X axis. */
289 offsetX?: number | undefined,
290 /** Offset along the Y axis. */
291 offsetY?: number | undefined,
292 /** Class(es) to be applied to the panel while this position is active. */
293 panelClass?: string | string[] | undefined);
294}
295
296/**
297 * A strategy for positioning overlays. Using this strategy, an overlay is given an
298 * implicit position relative some origin element. The relative position is defined in terms of
299 * a point on the origin element that is connected to a point on the overlay element. For example,
300 * a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner
301 * of the overlay.
302 */
303export declare class FlexibleConnectedPositionStrategy implements PositionStrategy {
304 private _viewportRuler;
305 private _document;
306 private _platform;
307 private _overlayContainer;
308 /** The overlay to which this strategy is attached. */
309 private _overlayRef;
310 /** Whether we're performing the very first positioning of the overlay. */
311 private _isInitialRender;
312 /** Last size used for the bounding box. Used to avoid resizing the overlay after open. */
313 private _lastBoundingBoxSize;
314 /** Whether the overlay was pushed in a previous positioning. */
315 private _isPushed;
316 /** Whether the overlay can be pushed on-screen on the initial open. */
317 private _canPush;
318 /** Whether the overlay can grow via flexible width/height after the initial open. */
319 private _growAfterOpen;
320 /** Whether the overlay's width and height can be constrained to fit within the viewport. */
321 private _hasFlexibleDimensions;
322 /** Whether the overlay position is locked. */
323 private _positionLocked;
324 /** Cached origin dimensions */
325 private _originRect;
326 /** Cached overlay dimensions */
327 private _overlayRect;
328 /** Cached viewport dimensions */
329 private _viewportRect;
330 /** Cached container dimensions */
331 private _containerRect;
332 /** Amount of space that must be maintained between the overlay and the edge of the viewport. */
333 private _viewportMargin;
334 /** The Scrollable containers used to check scrollable view properties on position change. */
335 private _scrollables;
336 /** Ordered list of preferred positions, from most to least desirable. */
337 _preferredPositions: ConnectionPositionPair[];
338 /** The origin element against which the overlay will be positioned. */
339 _origin: FlexibleConnectedPositionStrategyOrigin;
340 /** The overlay pane element. */
341 private _pane;
342 /** Whether the strategy has been disposed of already. */
343 private _isDisposed;
344 /**
345 * Parent element for the overlay panel used to constrain the overlay panel's size to fit
346 * within the viewport.
347 */
348 private _boundingBox;
349 /** The last position to have been calculated as the best fit position. */
350 private _lastPosition;
351 /** Subject that emits whenever the position changes. */
352 private readonly _positionChanges;
353 /** Subscription to viewport size changes. */
354 private _resizeSubscription;
355 /** Default offset for the overlay along the x axis. */
356 private _offsetX;
357 /** Default offset for the overlay along the y axis. */
358 private _offsetY;
359 /** Selector to be used when finding the elements on which to set the transform origin. */
360 private _transformOriginSelector;
361 /** Keeps track of the CSS classes that the position strategy has applied on the overlay panel. */
362 private _appliedPanelClasses;
363 /** Amount by which the overlay was pushed in each axis during the last time it was positioned. */
364 private _previousPushAmount;
365 /** Observable sequence of position changes. */
366 positionChanges: Observable<ConnectedOverlayPositionChange>;
367 /** Ordered list of preferred positions, from most to least desirable. */
368 get positions(): ConnectionPositionPair[];
369 constructor(connectedTo: FlexibleConnectedPositionStrategyOrigin, _viewportRuler: ViewportRuler, _document: Document, _platform: Platform, _overlayContainer: OverlayContainer);
370 /** Attaches this position strategy to an overlay. */
371 attach(overlayRef: OverlayRef): void;
372 /**
373 * Updates the position of the overlay element, using whichever preferred position relative
374 * to the origin best fits on-screen.
375 *
376 * The selection of a position goes as follows:
377 * - If any positions fit completely within the viewport as-is,
378 * choose the first position that does so.
379 * - If flexible dimensions are enabled and at least one satisfies the given minimum width/height,
380 * choose the position with the greatest available size modified by the positions' weight.
381 * - If pushing is enabled, take the position that went off-screen the least and push it
382 * on-screen.
383 * - If none of the previous criteria were met, use the position that goes off-screen the least.
384 * @docs-private
385 */
386 apply(): void;
387 detach(): void;
388 /** Cleanup after the element gets destroyed. */
389 dispose(): void;
390 /**
391 * This re-aligns the overlay element with the trigger in its last calculated position,
392 * even if a position higher in the "preferred positions" list would now fit. This
393 * allows one to re-align the panel without changing the orientation of the panel.
394 */
395 reapplyLastPosition(): void;
396 /**
397 * Sets the list of Scrollable containers that host the origin element so that
398 * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
399 * Scrollable must be an ancestor element of the strategy's origin element.
400 */
401 withScrollableContainers(scrollables: CdkScrollable[]): this;
402 /**
403 * Adds new preferred positions.
404 * @param positions List of positions options for this overlay.
405 */
406 withPositions(positions: ConnectedPosition[]): this;
407 /**
408 * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
409 * @param margin Required margin between the overlay and the viewport edge in pixels.
410 */
411 withViewportMargin(margin: number): this;
412 /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */
413 withFlexibleDimensions(flexibleDimensions?: boolean): this;
414 /** Sets whether the overlay can grow after the initial open via flexible width/height. */
415 withGrowAfterOpen(growAfterOpen?: boolean): this;
416 /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */
417 withPush(canPush?: boolean): this;
418 /**
419 * Sets whether the overlay's position should be locked in after it is positioned
420 * initially. When an overlay is locked in, it won't attempt to reposition itself
421 * when the position is re-applied (e.g. when the user scrolls away).
422 * @param isLocked Whether the overlay should locked in.
423 */
424 withLockedPosition(isLocked?: boolean): this;
425 /**
426 * Sets the origin, relative to which to position the overlay.
427 * Using an element origin is useful for building components that need to be positioned
428 * relatively to a trigger (e.g. dropdown menus or tooltips), whereas using a point can be
429 * used for cases like contextual menus which open relative to the user's pointer.
430 * @param origin Reference to the new origin.
431 */
432 setOrigin(origin: FlexibleConnectedPositionStrategyOrigin): this;
433 /**
434 * Sets the default offset for the overlay's connection point on the x-axis.
435 * @param offset New offset in the X axis.
436 */
437 withDefaultOffsetX(offset: number): this;
438 /**
439 * Sets the default offset for the overlay's connection point on the y-axis.
440 * @param offset New offset in the Y axis.
441 */
442 withDefaultOffsetY(offset: number): this;
443 /**
444 * Configures that the position strategy should set a `transform-origin` on some elements
445 * inside the overlay, depending on the current position that is being applied. This is
446 * useful for the cases where the origin of an animation can change depending on the
447 * alignment of the overlay.
448 * @param selector CSS selector that will be used to find the target
449 * elements onto which to set the transform origin.
450 */
451 withTransformOriginOn(selector: string): this;
452 /**
453 * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
454 */
455 private _getOriginPoint;
456 /**
457 * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
458 * origin point to which the overlay should be connected.
459 */
460 private _getOverlayPoint;
461 /** Gets how well an overlay at the given point will fit within the viewport. */
462 private _getOverlayFit;
463 /**
464 * Whether the overlay can fit within the viewport when it may resize either its width or height.
465 * @param fit How well the overlay fits in the viewport at some position.
466 * @param point The (x, y) coordinates of the overlay at some position.
467 * @param viewport The geometry of the viewport.
468 */
469 private _canFitWithFlexibleDimensions;
470 /**
471 * Gets the point at which the overlay can be "pushed" on-screen. If the overlay is larger than
472 * the viewport, the top-left corner will be pushed on-screen (with overflow occurring on the
473 * right and bottom).
474 *
475 * @param start Starting point from which the overlay is pushed.
476 * @param rawOverlayRect Dimensions of the overlay.
477 * @param scrollPosition Current viewport scroll position.
478 * @returns The point at which to position the overlay after pushing. This is effectively a new
479 * originPoint.
480 */
481 private _pushOverlayOnScreen;
482 /**
483 * Applies a computed position to the overlay and emits a position change.
484 * @param position The position preference
485 * @param originPoint The point on the origin element where the overlay is connected.
486 */
487 private _applyPosition;
488 /** Sets the transform origin based on the configured selector and the passed-in position. */
489 private _setTransformOrigin;
490 /**
491 * Gets the position and size of the overlay's sizing container.
492 *
493 * This method does no measuring and applies no styles so that we can cheaply compute the
494 * bounds for all positions and choose the best fit based on these results.
495 */
496 private _calculateBoundingBoxRect;
497 /**
498 * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
499 * origin's connection point and stretches to the bounds of the viewport.
500 *
501 * @param origin The point on the origin element where the overlay is connected.
502 * @param position The position preference
503 */
504 private _setBoundingBoxStyles;
505 /** Resets the styles for the bounding box so that a new positioning can be computed. */
506 private _resetBoundingBoxStyles;
507 /** Resets the styles for the overlay pane so that a new positioning can be computed. */
508 private _resetOverlayElementStyles;
509 /** Sets positioning styles to the overlay element. */
510 private _setOverlayElementStyles;
511 /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */
512 private _getExactOverlayY;
513 /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */
514 private _getExactOverlayX;
515 /**
516 * Gets the view properties of the trigger and overlay, including whether they are clipped
517 * or completely outside the view of any of the strategy's scrollables.
518 */
519 private _getScrollVisibility;
520 /** Subtracts the amount that an element is overflowing on an axis from its length. */
521 private _subtractOverflows;
522 /** Narrows the given viewport rect by the current _viewportMargin. */
523 private _getNarrowedViewportRect;
524 /** Whether the we're dealing with an RTL context */
525 private _isRtl;
526 /** Determines whether the overlay uses exact or flexible positioning. */
527 private _hasExactPosition;
528 /** Retrieves the offset of a position along the x or y axis. */
529 private _getOffset;
530 /** Validates that the current position match the expected values. */
531 private _validatePositions;
532 /** Adds a single CSS class or an array of classes on the overlay panel. */
533 private _addPanelClasses;
534 /** Clears the classes that the position strategy has applied from the overlay panel. */
535 private _clearPanelClasses;
536 /** Returns the ClientRect of the current origin. */
537 private _getOriginRect;
538}
539
540/** Possible values that can be set as the origin of a FlexibleConnectedPositionStrategy. */
541export declare type FlexibleConnectedPositionStrategyOrigin = ElementRef | Element | (Point & {
542 width?: number;
543 height?: number;
544});
545
546/**
547 * Alternative to OverlayContainer that supports correct displaying of overlay elements in
548 * Fullscreen mode
549 * https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen
550 *
551 * Should be provided in the root component.
552 */
553export declare class FullscreenOverlayContainer extends OverlayContainer implements OnDestroy {
554 private _fullScreenEventName;
555 private _fullScreenListener;
556 constructor(_document: any, platform: Platform);
557 ngOnDestroy(): void;
558 protected _createContainer(): void;
559 private _adjustParentForFullscreenChange;
560 private _addFullscreenChangeListener;
561 private _getEventName;
562 /**
563 * When the page is put into fullscreen mode, a specific element is specified.
564 * Only that element and its children are visible when in fullscreen mode.
565 */
566 getFullscreenElement(): Element;
567 static ɵfac: i0.ɵɵFactoryDeclaration<FullscreenOverlayContainer, never>;
568 static ɵprov: i0.ɵɵInjectableDeclaration<FullscreenOverlayContainer>;
569}
570
571/**
572 * A strategy for positioning overlays. Using this strategy, an overlay is given an
573 * explicit position relative to the browser's viewport. We use flexbox, instead of
574 * transforms, in order to avoid issues with subpixel rendering which can cause the
575 * element to become blurry.
576 */
577export declare class GlobalPositionStrategy implements PositionStrategy {
578 /** The overlay to which this strategy is attached. */
579 private _overlayRef;
580 private _cssPosition;
581 private _topOffset;
582 private _bottomOffset;
583 private _alignItems;
584 private _xPosition;
585 private _xOffset;
586 private _width;
587 private _height;
588 private _isDisposed;
589 attach(overlayRef: OverlayRef): void;
590 /**
591 * Sets the top position of the overlay. Clears any previously set vertical position.
592 * @param value New top offset.
593 */
594 top(value?: string): this;
595 /**
596 * Sets the left position of the overlay. Clears any previously set horizontal position.
597 * @param value New left offset.
598 */
599 left(value?: string): this;
600 /**
601 * Sets the bottom position of the overlay. Clears any previously set vertical position.
602 * @param value New bottom offset.
603 */
604 bottom(value?: string): this;
605 /**
606 * Sets the right position of the overlay. Clears any previously set horizontal position.
607 * @param value New right offset.
608 */
609 right(value?: string): this;
610 /**
611 * Sets the overlay to the start of the viewport, depending on the overlay direction.
612 * This will be to the left in LTR layouts and to the right in RTL.
613 * @param offset Offset from the edge of the screen.
614 */
615 start(value?: string): this;
616 /**
617 * Sets the overlay to the end of the viewport, depending on the overlay direction.
618 * This will be to the right in LTR layouts and to the left in RTL.
619 * @param offset Offset from the edge of the screen.
620 */
621 end(value?: string): this;
622 /**
623 * Sets the overlay width and clears any previously set width.
624 * @param value New width for the overlay
625 * @deprecated Pass the `width` through the `OverlayConfig`.
626 * @breaking-change 8.0.0
627 */
628 width(value?: string): this;
629 /**
630 * Sets the overlay height and clears any previously set height.
631 * @param value New height for the overlay
632 * @deprecated Pass the `height` through the `OverlayConfig`.
633 * @breaking-change 8.0.0
634 */
635 height(value?: string): this;
636 /**
637 * Centers the overlay horizontally with an optional offset.
638 * Clears any previously set horizontal position.
639 *
640 * @param offset Overlay offset from the horizontal center.
641 */
642 centerHorizontally(offset?: string): this;
643 /**
644 * Centers the overlay vertically with an optional offset.
645 * Clears any previously set vertical position.
646 *
647 * @param offset Overlay offset from the vertical center.
648 */
649 centerVertically(offset?: string): this;
650 /**
651 * Apply the position to the element.
652 * @docs-private
653 */
654 apply(): void;
655 /**
656 * Cleans up the DOM changes from the position strategy.
657 * @docs-private
658 */
659 dispose(): void;
660}
661
662
663/** Horizontal dimension of a connection point on the perimeter of the origin or overlay element. */
664export declare type HorizontalConnectionPos = 'start' | 'center' | 'end';
665
666declare namespace i4 {
667 export {
668 CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY,
669 CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,
670 CdkOverlayOrigin,
671 CdkConnectedOverlay,
672 CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER
673 }
674}
675
676/** An object where all of its properties cannot be written. */
677declare type ImmutableObject<T> = {
678 readonly [P in keyof T]: T[P];
679};
680
681/** Scroll strategy that doesn't do anything. */
682export declare class NoopScrollStrategy implements ScrollStrategy {
683 /** Does nothing, as this scroll strategy is a no-op. */
684 enable(): void;
685 /** Does nothing, as this scroll strategy is a no-op. */
686 disable(): void;
687 /** Does nothing, as this scroll strategy is a no-op. */
688 attach(): void;
689}
690
691/** A connection point on the origin element. */
692export declare interface OriginConnectionPosition {
693 originX: HorizontalConnectionPos;
694 originY: VerticalConnectionPos;
695}
696
697/**
698 * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
699 * used as a low-level building block for other components. Dialogs, tooltips, menus,
700 * selects, etc. can all be built using overlays. The service should primarily be used by authors
701 * of re-usable components rather than developers building end-user applications.
702 *
703 * An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.
704 */
705export declare class Overlay {
706 /** Scrolling strategies that can be used when creating an overlay. */
707 scrollStrategies: ScrollStrategyOptions;
708 private _overlayContainer;
709 private _componentFactoryResolver;
710 private _positionBuilder;
711 private _keyboardDispatcher;
712 private _injector;
713 private _ngZone;
714 private _document;
715 private _directionality;
716 private _location;
717 private _outsideClickDispatcher;
718 private _animationsModuleType?;
719 private _appRef;
720 constructor(
721 /** Scrolling strategies that can be used when creating an overlay. */
722 scrollStrategies: ScrollStrategyOptions, _overlayContainer: OverlayContainer, _componentFactoryResolver: ComponentFactoryResolver, _positionBuilder: OverlayPositionBuilder, _keyboardDispatcher: OverlayKeyboardDispatcher, _injector: Injector, _ngZone: NgZone, _document: any, _directionality: Directionality, _location: Location_2, _outsideClickDispatcher: OverlayOutsideClickDispatcher, _animationsModuleType?: string | undefined);
723 /**
724 * Creates an overlay.
725 * @param config Configuration applied to the overlay.
726 * @returns Reference to the created overlay.
727 */
728 create(config?: OverlayConfig): OverlayRef;
729 /**
730 * Gets a position builder that can be used, via fluent API,
731 * to construct and configure a position strategy.
732 * @returns An overlay position builder.
733 */
734 position(): OverlayPositionBuilder;
735 /**
736 * Creates the DOM element for an overlay and appends it to the overlay container.
737 * @returns Newly-created pane element
738 */
739 private _createPaneElement;
740 /**
741 * Creates the host element that wraps around an overlay
742 * and can be used for advanced positioning.
743 * @returns Newly-create host element.
744 */
745 private _createHostElement;
746 /**
747 * Create a DomPortalOutlet into which the overlay content can be loaded.
748 * @param pane The DOM element to turn into a portal outlet.
749 * @returns A portal outlet for the given DOM element.
750 */
751 private _createPortalOutlet;
752 static ɵfac: i0.ɵɵFactoryDeclaration<Overlay, [null, null, null, null, null, null, null, null, null, null, null, { optional: true; }]>;
753 static ɵprov: i0.ɵɵInjectableDeclaration<Overlay>;
754}
755
756/** Initial configuration used when creating an overlay. */
757export declare class OverlayConfig {
758 /** Strategy with which to position the overlay. */
759 positionStrategy?: PositionStrategy;
760 /** Strategy to be used when handling scroll events while the overlay is open. */
761 scrollStrategy?: ScrollStrategy;
762 /** Custom class to add to the overlay pane. */
763 panelClass?: string | string[];
764 /** Whether the overlay has a backdrop. */
765 hasBackdrop?: boolean;
766 /** Custom class to add to the backdrop */
767 backdropClass?: string | string[];
768 /** The width of the overlay panel. If a number is provided, pixel units are assumed. */
769 width?: number | string;
770 /** The height of the overlay panel. If a number is provided, pixel units are assumed. */
771 height?: number | string;
772 /** The min-width of the overlay panel. If a number is provided, pixel units are assumed. */
773 minWidth?: number | string;
774 /** The min-height of the overlay panel. If a number is provided, pixel units are assumed. */
775 minHeight?: number | string;
776 /** The max-width of the overlay panel. If a number is provided, pixel units are assumed. */
777 maxWidth?: number | string;
778 /** The max-height of the overlay panel. If a number is provided, pixel units are assumed. */
779 maxHeight?: number | string;
780 /**
781 * Direction of the text in the overlay panel. If a `Directionality` instance
782 * is passed in, the overlay will handle changes to its value automatically.
783 */
784 direction?: Direction | Directionality;
785 /**
786 * Whether the overlay should be disposed of when the user goes backwards/forwards in history.
787 * Note that this usually doesn't include clicking on links (unless the user is using
788 * the `HashLocationStrategy`).
789 */
790 disposeOnNavigation?: boolean;
791 constructor(config?: OverlayConfig);
792}
793
794/** A connection point on the overlay element. */
795export declare interface OverlayConnectionPosition {
796 overlayX: HorizontalConnectionPos;
797 overlayY: VerticalConnectionPos;
798}
799
800/** Container inside which all overlays will render. */
801export declare class OverlayContainer implements OnDestroy {
802 protected _platform: Platform;
803 protected _containerElement: HTMLElement;
804 protected _document: Document;
805 constructor(document: any, _platform: Platform);
806 ngOnDestroy(): void;
807 /**
808 * This method returns the overlay container element. It will lazily
809 * create the element the first time it is called to facilitate using
810 * the container in non-browser environments.
811 * @returns the container element
812 */
813 getContainerElement(): HTMLElement;
814 /**
815 * Create the overlay container element, which is simply a div
816 * with the 'cdk-overlay-container' class on the document body.
817 */
818 protected _createContainer(): void;
819 static ɵfac: i0.ɵɵFactoryDeclaration<OverlayContainer, never>;
820 static ɵprov: i0.ɵɵInjectableDeclaration<OverlayContainer>;
821}
822
823/**
824 * Service for dispatching keyboard events that land on the body to appropriate overlay ref,
825 * if any. It maintains a list of attached overlays to determine best suited overlay based
826 * on event target and order of overlay opens.
827 */
828export declare class OverlayKeyboardDispatcher extends BaseOverlayDispatcher {
829 /** @breaking-change 14.0.0 _ngZone will be required. */
830 private _ngZone?;
831 constructor(document: any,
832 /** @breaking-change 14.0.0 _ngZone will be required. */
833 _ngZone?: NgZone | undefined);
834 /** Add a new overlay to the list of attached overlay refs. */
835 add(overlayRef: OverlayRef): void;
836 /** Detaches the global keyboard event listener. */
837 protected detach(): void;
838 /** Keyboard event listener that will be attached to the body. */
839 private _keydownListener;
840 static ɵfac: i0.ɵɵFactoryDeclaration<OverlayKeyboardDispatcher, [null, { optional: true; }]>;
841 static ɵprov: i0.ɵɵInjectableDeclaration<OverlayKeyboardDispatcher>;
842}
843
844export declare class OverlayModule {
845 static ɵfac: i0.ɵɵFactoryDeclaration<OverlayModule, never>;
846 static ɵmod: i0.ɵɵNgModuleDeclaration<OverlayModule, never, [typeof i1.BidiModule, typeof i2.PortalModule, typeof i3.ScrollingModule, typeof i4.CdkConnectedOverlay, typeof i4.CdkOverlayOrigin], [typeof i4.CdkConnectedOverlay, typeof i4.CdkOverlayOrigin, typeof i3.ScrollingModule]>;
847 static ɵinj: i0.ɵɵInjectorDeclaration<OverlayModule>;
848}
849
850/**
851 * Service for dispatching mouse click events that land on the body to appropriate overlay ref,
852 * if any. It maintains a list of attached overlays to determine best suited overlay based
853 * on event target and order of overlay opens.
854 */
855export declare class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
856 private _platform;
857 /** @breaking-change 14.0.0 _ngZone will be required. */
858 private _ngZone?;
859 private _cursorOriginalValue;
860 private _cursorStyleIsSet;
861 private _pointerDownEventTarget;
862 constructor(document: any, _platform: Platform,
863 /** @breaking-change 14.0.0 _ngZone will be required. */
864 _ngZone?: NgZone | undefined);
865 /** Add a new overlay to the list of attached overlay refs. */
866 add(overlayRef: OverlayRef): void;
867 /** Detaches the global keyboard event listener. */
868 protected detach(): void;
869 private _addEventListeners;
870 /** Store pointerdown event target to track origin of click. */
871 private _pointerDownListener;
872 /** Click event listener that will be attached to the body propagate phase. */
873 private _clickListener;
874 static ɵfac: i0.ɵɵFactoryDeclaration<OverlayOutsideClickDispatcher, [null, null, { optional: true; }]>;
875 static ɵprov: i0.ɵɵInjectableDeclaration<OverlayOutsideClickDispatcher>;
876}
877
878/** Builder for overlay position strategy. */
879export declare class OverlayPositionBuilder {
880 private _viewportRuler;
881 private _document;
882 private _platform;
883 private _overlayContainer;
884 constructor(_viewportRuler: ViewportRuler, _document: any, _platform: Platform, _overlayContainer: OverlayContainer);
885 /**
886 * Creates a global position strategy.
887 */
888 global(): GlobalPositionStrategy;
889 /**
890 * Creates a flexible position strategy.
891 * @param origin Origin relative to which to position the overlay.
892 */
893 flexibleConnectedTo(origin: FlexibleConnectedPositionStrategyOrigin): FlexibleConnectedPositionStrategy;
894 static ɵfac: i0.ɵɵFactoryDeclaration<OverlayPositionBuilder, never>;
895 static ɵprov: i0.ɵɵInjectableDeclaration<OverlayPositionBuilder>;
896}
897
898/**
899 * Reference to an overlay that has been created with the Overlay service.
900 * Used to manipulate or dispose of said overlay.
901 */
902export declare class OverlayRef implements PortalOutlet {
903 private _portalOutlet;
904 private _host;
905 private _pane;
906 private _config;
907 private _ngZone;
908 private _keyboardDispatcher;
909 private _document;
910 private _location;
911 private _outsideClickDispatcher;
912 private _animationsDisabled;
913 private _backdropElement;
914 private _backdropTimeout;
915 private readonly _backdropClick;
916 private readonly _attachments;
917 private readonly _detachments;
918 private _positionStrategy;
919 private _scrollStrategy;
920 private _locationChanges;
921 private _backdropClickHandler;
922 private _backdropTransitionendHandler;
923 /**
924 * Reference to the parent of the `_host` at the time it was detached. Used to restore
925 * the `_host` to its original position in the DOM when it gets re-attached.
926 */
927 private _previousHostParent;
928 /** Stream of keydown events dispatched to this overlay. */
929 readonly _keydownEvents: Subject<KeyboardEvent>;
930 /** Stream of mouse outside events dispatched to this overlay. */
931 readonly _outsidePointerEvents: Subject<MouseEvent>;
932 constructor(_portalOutlet: PortalOutlet, _host: HTMLElement, _pane: HTMLElement, _config: ImmutableObject<OverlayConfig>, _ngZone: NgZone, _keyboardDispatcher: OverlayKeyboardDispatcher, _document: Document, _location: Location_2, _outsideClickDispatcher: OverlayOutsideClickDispatcher, _animationsDisabled?: boolean);
933 /** The overlay's HTML element */
934 get overlayElement(): HTMLElement;
935 /** The overlay's backdrop HTML element. */
936 get backdropElement(): HTMLElement | null;
937 /**
938 * Wrapper around the panel element. Can be used for advanced
939 * positioning where a wrapper with specific styling is
940 * required around the overlay pane.
941 */
942 get hostElement(): HTMLElement;
943 attach<T>(portal: ComponentPortal<T>): ComponentRef<T>;
944 attach<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T>;
945 attach(portal: any): any;
946 /**
947 * Detaches an overlay from a portal.
948 * @returns The portal detachment result.
949 */
950 detach(): any;
951 /** Cleans up the overlay from the DOM. */
952 dispose(): void;
953 /** Whether the overlay has attached content. */
954 hasAttached(): boolean;
955 /** Gets an observable that emits when the backdrop has been clicked. */
956 backdropClick(): Observable<MouseEvent>;
957 /** Gets an observable that emits when the overlay has been attached. */
958 attachments(): Observable<void>;
959 /** Gets an observable that emits when the overlay has been detached. */
960 detachments(): Observable<void>;
961 /** Gets an observable of keydown events targeted to this overlay. */
962 keydownEvents(): Observable<KeyboardEvent>;
963 /** Gets an observable of pointer events targeted outside this overlay. */
964 outsidePointerEvents(): Observable<MouseEvent>;
965 /** Gets the current overlay configuration, which is immutable. */
966 getConfig(): OverlayConfig;
967 /** Updates the position of the overlay based on the position strategy. */
968 updatePosition(): void;
969 /** Switches to a new position strategy and updates the overlay position. */
970 updatePositionStrategy(strategy: PositionStrategy): void;
971 /** Update the size properties of the overlay. */
972 updateSize(sizeConfig: OverlaySizeConfig): void;
973 /** Sets the LTR/RTL direction for the overlay. */
974 setDirection(dir: Direction | Directionality): void;
975 /** Add a CSS class or an array of classes to the overlay pane. */
976 addPanelClass(classes: string | string[]): void;
977 /** Remove a CSS class or an array of classes from the overlay pane. */
978 removePanelClass(classes: string | string[]): void;
979 /**
980 * Returns the layout direction of the overlay panel.
981 */
982 getDirection(): Direction;
983 /** Switches to a new scroll strategy. */
984 updateScrollStrategy(strategy: ScrollStrategy): void;
985 /** Updates the text direction of the overlay panel. */
986 private _updateElementDirection;
987 /** Updates the size of the overlay element based on the overlay config. */
988 private _updateElementSize;
989 /** Toggles the pointer events for the overlay pane element. */
990 private _togglePointerEvents;
991 /** Attaches a backdrop for this overlay. */
992 private _attachBackdrop;
993 /**
994 * Updates the stacking order of the element, moving it to the top if necessary.
995 * This is required in cases where one overlay was detached, while another one,
996 * that should be behind it, was destroyed. The next time both of them are opened,
997 * the stacking will be wrong, because the detached element's pane will still be
998 * in its original DOM position.
999 */
1000 private _updateStackingOrder;
1001 /** Detaches the backdrop (if any) associated with the overlay. */
1002 detachBackdrop(): void;
1003 /** Toggles a single CSS class or an array of classes on an element. */
1004 private _toggleClasses;
1005 /** Detaches the overlay content next time the zone stabilizes. */
1006 private _detachContentWhenStable;
1007 /** Disposes of a scroll strategy. */
1008 private _disposeScrollStrategy;
1009 /** Removes a backdrop element from the DOM. */
1010 private _disposeBackdrop;
1011}
1012
1013/** Size properties for an overlay. */
1014export declare interface OverlaySizeConfig {
1015 width?: number | string;
1016 height?: number | string;
1017 minWidth?: number | string;
1018 minHeight?: number | string;
1019 maxWidth?: number | string;
1020 maxHeight?: number | string;
1021}
1022
1023/** A simple (x, y) coordinate. */
1024declare interface Point {
1025 x: number;
1026 y: number;
1027}
1028
1029/** Strategy for setting the position on an overlay. */
1030export declare interface PositionStrategy {
1031 /** Attaches this position strategy to an overlay. */
1032 attach(overlayRef: OverlayRef): void;
1033 /** Updates the position of the overlay element. */
1034 apply(): void;
1035 /** Called when the overlay is detached. */
1036 detach?(): void;
1037 /** Cleans up any DOM modifications made by the position strategy, if necessary. */
1038 dispose(): void;
1039}
1040
1041/**
1042 * Strategy that will update the element position as the user is scrolling.
1043 */
1044export declare class RepositionScrollStrategy implements ScrollStrategy {
1045 private _scrollDispatcher;
1046 private _viewportRuler;
1047 private _ngZone;
1048 private _config?;
1049 private _scrollSubscription;
1050 private _overlayRef;
1051 constructor(_scrollDispatcher: ScrollDispatcher, _viewportRuler: ViewportRuler, _ngZone: NgZone, _config?: RepositionScrollStrategyConfig | undefined);
1052 /** Attaches this scroll strategy to an overlay. */
1053 attach(overlayRef: OverlayRef): void;
1054 /** Enables repositioning of the attached overlay on scroll. */
1055 enable(): void;
1056 /** Disables repositioning of the attached overlay on scroll. */
1057 disable(): void;
1058 detach(): void;
1059}
1060
1061/**
1062 * Config options for the RepositionScrollStrategy.
1063 */
1064export declare interface RepositionScrollStrategyConfig {
1065 /** Time in milliseconds to throttle the scroll events. */
1066 scrollThrottle?: number;
1067 /** Whether to close the overlay once the user has scrolled away completely. */
1068 autoClose?: boolean;
1069}
1070
1071export { ScrollDispatcher }
1072
1073/**
1074 * Set of properties regarding the position of the origin and overlay relative to the viewport
1075 * with respect to the containing Scrollable elements.
1076 *
1077 * The overlay and origin are clipped if any part of their bounding client rectangle exceeds the
1078 * bounds of any one of the strategy's Scrollable's bounding client rectangle.
1079 *
1080 * The overlay and origin are outside view if there is no overlap between their bounding client
1081 * rectangle and any one of the strategy's Scrollable's bounding client rectangle.
1082 *
1083 * ----------- -----------
1084 * | outside | | clipped |
1085 * | view | --------------------------
1086 * | | | | | |
1087 * ---------- | ----------- |
1088 * -------------------------- | |
1089 * | | | Scrollable |
1090 * | | | |
1091 * | | --------------------------
1092 * | Scrollable |
1093 * | |
1094 * --------------------------
1095 *
1096 * @docs-private
1097 */
1098export declare class ScrollingVisibility {
1099 isOriginClipped: boolean;
1100 isOriginOutsideView: boolean;
1101 isOverlayClipped: boolean;
1102 isOverlayOutsideView: boolean;
1103}
1104
1105/**
1106 * Describes a strategy that will be used by an overlay to handle scroll events while it is open.
1107 */
1108export declare interface ScrollStrategy {
1109 /** Enable this scroll strategy (called when the attached overlay is attached to a portal). */
1110 enable: () => void;
1111 /** Disable this scroll strategy (called when the attached overlay is detached from a portal). */
1112 disable: () => void;
1113 /** Attaches this `ScrollStrategy` to an overlay. */
1114 attach: (overlayRef: OverlayRef) => void;
1115 /** Detaches the scroll strategy from the current overlay. */
1116 detach?: () => void;
1117}
1118
1119/**
1120 * Options for how an overlay will handle scrolling.
1121 *
1122 * Users can provide a custom value for `ScrollStrategyOptions` to replace the default
1123 * behaviors. This class primarily acts as a factory for ScrollStrategy instances.
1124 */
1125export declare class ScrollStrategyOptions {
1126 private _scrollDispatcher;
1127 private _viewportRuler;
1128 private _ngZone;
1129 private _document;
1130 constructor(_scrollDispatcher: ScrollDispatcher, _viewportRuler: ViewportRuler, _ngZone: NgZone, document: any);
1131 /** Do nothing on scroll. */
1132 noop: () => NoopScrollStrategy;
1133 /**
1134 * Close the overlay as soon as the user scrolls.
1135 * @param config Configuration to be used inside the scroll strategy.
1136 */
1137 close: (config?: CloseScrollStrategyConfig) => CloseScrollStrategy;
1138 /** Block scrolling. */
1139 block: () => BlockScrollStrategy;
1140 /**
1141 * Update the overlay's position on scroll.
1142 * @param config Configuration to be used inside the scroll strategy.
1143 * Allows debouncing the reposition calls.
1144 */
1145 reposition: (config?: RepositionScrollStrategyConfig) => RepositionScrollStrategy;
1146 static ɵfac: i0.ɵɵFactoryDeclaration<ScrollStrategyOptions, never>;
1147 static ɵprov: i0.ɵɵInjectableDeclaration<ScrollStrategyOptions>;
1148}
1149
1150export declare const STANDARD_DROPDOWN_ADJACENT_POSITIONS: ConnectedPosition[];
1151
1152export declare const STANDARD_DROPDOWN_BELOW_POSITIONS: ConnectedPosition[];
1153
1154/**
1155 * Validates whether a horizontal position property matches the expected values.
1156 * @param property Name of the property being validated.
1157 * @param value Value of the property being validated.
1158 * @docs-private
1159 */
1160export declare function validateHorizontalPosition(property: string, value: HorizontalConnectionPos): void;
1161
1162/**
1163 * Validates whether a vertical position property matches the expected values.
1164 * @param property Name of the property being validated.
1165 * @param value Value of the property being validated.
1166 * @docs-private
1167 */
1168export declare function validateVerticalPosition(property: string, value: VerticalConnectionPos): void;
1169
1170/** Vertical dimension of a connection point on the perimeter of the origin or overlay element. */
1171export declare type VerticalConnectionPos = 'top' | 'center' | 'bottom';
1172
1173export { ViewportRuler }
1174
1175export { }