-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathoverlay-module.d-7674c06c.d.ts
executable file
·795 lines (782 loc) · 39.2 KB
/
overlay-module.d-7674c06c.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
import * as i0 from '@angular/core';
import { OnDestroy, NgZone, EnvironmentInjector, Renderer2, ComponentRef, EmbeddedViewRef, ElementRef, OnChanges, EventEmitter, SimpleChanges } from '@angular/core';
import { a as Direction, D as Directionality, B as BidiModule } from './bidi-module.d-e045bff7.js';
import { f as PortalOutlet, a as ComponentPortal, T as TemplatePortal, P as PortalModule } from './portal-directives.d-cac5eb8d.js';
import { C as CdkScrollable, S as ScrollingModule } from './scrolling-module.d-132f8fdb.js';
import { Location } from '@angular/common';
import { Subject, Observable } from 'rxjs';
import { V as ViewportRuler } from './viewport-ruler.d-17d129ea.js';
import { P as Platform } from './platform.d-4dc3e073.js';
import { _ as _CdkPrivateStyleLoader } from './style-loader.d-972eab2d.js';
/**
* Service for dispatching events that land on the body to appropriate overlay ref,
* if any. It maintains a list of attached overlays to determine best suited overlay based
* on event target and order of overlay opens.
*/
declare abstract class BaseOverlayDispatcher implements OnDestroy {
/** Currently attached overlays in the order they were attached. */
_attachedOverlays: OverlayRef[];
protected _document: Document;
protected _isAttached: boolean;
constructor(...args: unknown[]);
ngOnDestroy(): void;
/** Add a new overlay to the list of attached overlay refs. */
add(overlayRef: OverlayRef): void;
/** Remove an overlay from the list of attached overlay refs. */
remove(overlayRef: OverlayRef): void;
/** Detaches the global event listener. */
protected abstract detach(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<BaseOverlayDispatcher, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<BaseOverlayDispatcher>;
}
/**
* Service for dispatching keyboard events that land on the body to appropriate overlay ref,
* if any. It maintains a list of attached overlays to determine best suited overlay based
* on event target and order of overlay opens.
*/
declare class OverlayKeyboardDispatcher extends BaseOverlayDispatcher {
private _ngZone;
private _renderer;
private _cleanupKeydown;
/** Add a new overlay to the list of attached overlay refs. */
add(overlayRef: OverlayRef): void;
/** Detaches the global keyboard event listener. */
protected detach(): void;
/** Keyboard event listener that will be attached to the body. */
private _keydownListener;
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayKeyboardDispatcher, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<OverlayKeyboardDispatcher>;
}
/**
* Service for dispatching mouse click events that land on the body to appropriate overlay ref,
* if any. It maintains a list of attached overlays to determine best suited overlay based
* on event target and order of overlay opens.
*/
declare class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
private _platform;
private _ngZone;
private _renderer;
private _cursorOriginalValue;
private _cursorStyleIsSet;
private _pointerDownEventTarget;
private _cleanups;
/** Add a new overlay to the list of attached overlay refs. */
add(overlayRef: OverlayRef): void;
/** Detaches the global keyboard event listener. */
protected detach(): void;
/** Store pointerdown event target to track origin of click. */
private _pointerDownListener;
/** Click event listener that will be attached to the body propagate phase. */
private _clickListener;
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayOutsideClickDispatcher, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<OverlayOutsideClickDispatcher>;
}
/**
* Describes a strategy that will be used by an overlay to handle scroll events while it is open.
*/
interface ScrollStrategy {
/** Enable this scroll strategy (called when the attached overlay is attached to a portal). */
enable: () => void;
/** Disable this scroll strategy (called when the attached overlay is detached from a portal). */
disable: () => void;
/** Attaches this `ScrollStrategy` to an overlay. */
attach: (overlayRef: OverlayRef) => void;
/** Detaches the scroll strategy from the current overlay. */
detach?: () => void;
}
/** An object where all of its properties cannot be written. */
type ImmutableObject<T> = {
readonly [P in keyof T]: T[P];
};
/**
* Reference to an overlay that has been created with the Overlay service.
* Used to manipulate or dispose of said overlay.
*/
declare class OverlayRef implements PortalOutlet {
private _portalOutlet;
private _host;
private _pane;
private _config;
private _ngZone;
private _keyboardDispatcher;
private _document;
private _location;
private _outsideClickDispatcher;
private _animationsDisabled;
private _injector;
private _renderer;
private readonly _backdropClick;
private readonly _attachments;
private readonly _detachments;
private _positionStrategy;
private _scrollStrategy;
private _locationChanges;
private _backdropRef;
private _detachContentMutationObserver;
private _detachContentAfterRenderRef;
/**
* Reference to the parent of the `_host` at the time it was detached. Used to restore
* the `_host` to its original position in the DOM when it gets re-attached.
*/
private _previousHostParent;
/** Stream of keydown events dispatched to this overlay. */
readonly _keydownEvents: Subject<KeyboardEvent>;
/** Stream of mouse outside events dispatched to this overlay. */
readonly _outsidePointerEvents: Subject<MouseEvent>;
/** Reference to the currently-running `afterNextRender` call. */
private _afterNextRenderRef;
constructor(_portalOutlet: PortalOutlet, _host: HTMLElement, _pane: HTMLElement, _config: ImmutableObject<OverlayConfig>, _ngZone: NgZone, _keyboardDispatcher: OverlayKeyboardDispatcher, _document: Document, _location: Location, _outsideClickDispatcher: OverlayOutsideClickDispatcher, _animationsDisabled: boolean | undefined, _injector: EnvironmentInjector, _renderer: Renderer2);
/** The overlay's HTML element */
get overlayElement(): HTMLElement;
/** The overlay's backdrop HTML element. */
get backdropElement(): HTMLElement | null;
/**
* Wrapper around the panel element. Can be used for advanced
* positioning where a wrapper with specific styling is
* required around the overlay pane.
*/
get hostElement(): HTMLElement;
attach<T>(portal: ComponentPortal<T>): ComponentRef<T>;
attach<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T>;
attach(portal: any): any;
/**
* Detaches an overlay from a portal.
* @returns The portal detachment result.
*/
detach(): any;
/** Cleans up the overlay from the DOM. */
dispose(): void;
/** Whether the overlay has attached content. */
hasAttached(): boolean;
/** Gets an observable that emits when the backdrop has been clicked. */
backdropClick(): Observable<MouseEvent>;
/** Gets an observable that emits when the overlay has been attached. */
attachments(): Observable<void>;
/** Gets an observable that emits when the overlay has been detached. */
detachments(): Observable<void>;
/** Gets an observable of keydown events targeted to this overlay. */
keydownEvents(): Observable<KeyboardEvent>;
/** Gets an observable of pointer events targeted outside this overlay. */
outsidePointerEvents(): Observable<MouseEvent>;
/** Gets the current overlay configuration, which is immutable. */
getConfig(): OverlayConfig;
/** Updates the position of the overlay based on the position strategy. */
updatePosition(): void;
/** Switches to a new position strategy and updates the overlay position. */
updatePositionStrategy(strategy: PositionStrategy): void;
/** Update the size properties of the overlay. */
updateSize(sizeConfig: OverlaySizeConfig): void;
/** Sets the LTR/RTL direction for the overlay. */
setDirection(dir: Direction | Directionality): void;
/** Add a CSS class or an array of classes to the overlay pane. */
addPanelClass(classes: string | string[]): void;
/** Remove a CSS class or an array of classes from the overlay pane. */
removePanelClass(classes: string | string[]): void;
/**
* Returns the layout direction of the overlay panel.
*/
getDirection(): Direction;
/** Switches to a new scroll strategy. */
updateScrollStrategy(strategy: ScrollStrategy): void;
/** Updates the text direction of the overlay panel. */
private _updateElementDirection;
/** Updates the size of the overlay element based on the overlay config. */
private _updateElementSize;
/** Toggles the pointer events for the overlay pane element. */
private _togglePointerEvents;
/** Attaches a backdrop for this overlay. */
private _attachBackdrop;
/**
* Updates the stacking order of the element, moving it to the top if necessary.
* This is required in cases where one overlay was detached, while another one,
* that should be behind it, was destroyed. The next time both of them are opened,
* the stacking will be wrong, because the detached element's pane will still be
* in its original DOM position.
*/
private _updateStackingOrder;
/** Detaches the backdrop (if any) associated with the overlay. */
detachBackdrop(): void;
/** Toggles a single CSS class or an array of classes on an element. */
private _toggleClasses;
/** Detaches the overlay once the content finishes animating and is removed from the DOM. */
private _detachContentWhenEmpty;
private _detachContent;
private _completeDetachContent;
/** Disposes of a scroll strategy. */
private _disposeScrollStrategy;
}
/** Size properties for an overlay. */
interface OverlaySizeConfig {
width?: number | string;
height?: number | string;
minWidth?: number | string;
minHeight?: number | string;
maxWidth?: number | string;
maxHeight?: number | string;
}
/** Strategy for setting the position on an overlay. */
interface PositionStrategy {
/** Attaches this position strategy to an overlay. */
attach(overlayRef: OverlayRef): void;
/** Updates the position of the overlay element. */
apply(): void;
/** Called when the overlay is detached. */
detach?(): void;
/** Cleans up any DOM modifications made by the position strategy, if necessary. */
dispose(): void;
}
/** Initial configuration used when creating an overlay. */
declare class OverlayConfig {
/** Strategy with which to position the overlay. */
positionStrategy?: PositionStrategy;
/** Strategy to be used when handling scroll events while the overlay is open. */
scrollStrategy?: ScrollStrategy;
/** Custom class to add to the overlay pane. */
panelClass?: string | string[];
/** Whether the overlay has a backdrop. */
hasBackdrop?: boolean;
/** Custom class to add to the backdrop */
backdropClass?: string | string[];
/** Whether to disable any built-in animations. */
disableAnimations?: boolean;
/** The width of the overlay panel. If a number is provided, pixel units are assumed. */
width?: number | string;
/** The height of the overlay panel. If a number is provided, pixel units are assumed. */
height?: number | string;
/** The min-width of the overlay panel. If a number is provided, pixel units are assumed. */
minWidth?: number | string;
/** The min-height of the overlay panel. If a number is provided, pixel units are assumed. */
minHeight?: number | string;
/** The max-width of the overlay panel. If a number is provided, pixel units are assumed. */
maxWidth?: number | string;
/** The max-height of the overlay panel. If a number is provided, pixel units are assumed. */
maxHeight?: number | string;
/**
* Direction of the text in the overlay panel. If a `Directionality` instance
* is passed in, the overlay will handle changes to its value automatically.
*/
direction?: Direction | Directionality;
/**
* Whether the overlay should be disposed of when the user goes backwards/forwards in history.
* Note that this usually doesn't include clicking on links (unless the user is using
* the `HashLocationStrategy`).
*/
disposeOnNavigation?: boolean;
constructor(config?: OverlayConfig);
}
/** Horizontal dimension of a connection point on the perimeter of the origin or overlay element. */
type HorizontalConnectionPos = 'start' | 'center' | 'end';
/** Vertical dimension of a connection point on the perimeter of the origin or overlay element. */
type VerticalConnectionPos = 'top' | 'center' | 'bottom';
/** A connection point on the origin element. */
interface OriginConnectionPosition {
originX: HorizontalConnectionPos;
originY: VerticalConnectionPos;
}
/** A connection point on the overlay element. */
interface OverlayConnectionPosition {
overlayX: HorizontalConnectionPos;
overlayY: VerticalConnectionPos;
}
/** The points of the origin element and the overlay element to connect. */
declare class ConnectionPositionPair {
/** Offset along the X axis. */
offsetX?: number | undefined;
/** Offset along the Y axis. */
offsetY?: number | undefined;
/** Class(es) to be applied to the panel while this position is active. */
panelClass?: string | string[] | undefined;
/** X-axis attachment point for connected overlay origin. Can be 'start', 'end', or 'center'. */
originX: HorizontalConnectionPos;
/** Y-axis attachment point for connected overlay origin. Can be 'top', 'bottom', or 'center'. */
originY: VerticalConnectionPos;
/** X-axis attachment point for connected overlay. Can be 'start', 'end', or 'center'. */
overlayX: HorizontalConnectionPos;
/** Y-axis attachment point for connected overlay. Can be 'top', 'bottom', or 'center'. */
overlayY: VerticalConnectionPos;
constructor(origin: OriginConnectionPosition, overlay: OverlayConnectionPosition,
/** Offset along the X axis. */
offsetX?: number | undefined,
/** Offset along the Y axis. */
offsetY?: number | undefined,
/** Class(es) to be applied to the panel while this position is active. */
panelClass?: string | string[] | undefined);
}
/**
* Set of properties regarding the position of the origin and overlay relative to the viewport
* with respect to the containing Scrollable elements.
*
* The overlay and origin are clipped if any part of their bounding client rectangle exceeds the
* bounds of any one of the strategy's Scrollable's bounding client rectangle.
*
* The overlay and origin are outside view if there is no overlap between their bounding client
* rectangle and any one of the strategy's Scrollable's bounding client rectangle.
*
* ----------- -----------
* | outside | | clipped |
* | view | --------------------------
* | | | | | |
* ---------- | ----------- |
* -------------------------- | |
* | | | Scrollable |
* | | | |
* | | --------------------------
* | Scrollable |
* | |
* --------------------------
*
* @docs-private
*/
declare class ScrollingVisibility {
isOriginClipped: boolean;
isOriginOutsideView: boolean;
isOverlayClipped: boolean;
isOverlayOutsideView: boolean;
}
/** The change event emitted by the strategy when a fallback position is used. */
declare class ConnectedOverlayPositionChange {
/** The position used as a result of this change. */
connectionPair: ConnectionPositionPair;
/** @docs-private */
scrollableViewProperties: ScrollingVisibility;
constructor(
/** The position used as a result of this change. */
connectionPair: ConnectionPositionPair,
/** @docs-private */
scrollableViewProperties: ScrollingVisibility);
}
/**
* Validates whether a vertical position property matches the expected values.
* @param property Name of the property being validated.
* @param value Value of the property being validated.
* @docs-private
*/
declare function validateVerticalPosition(property: string, value: VerticalConnectionPos): void;
/**
* Validates whether a horizontal position property matches the expected values.
* @param property Name of the property being validated.
* @param value Value of the property being validated.
* @docs-private
*/
declare function validateHorizontalPosition(property: string, value: HorizontalConnectionPos): void;
/** Container inside which all overlays will render. */
declare class OverlayContainer implements OnDestroy {
protected _platform: Platform;
protected _containerElement: HTMLElement;
protected _document: Document;
protected _styleLoader: _CdkPrivateStyleLoader;
constructor(...args: unknown[]);
ngOnDestroy(): void;
/**
* This method returns the overlay container element. It will lazily
* create the element the first time it is called to facilitate using
* the container in non-browser environments.
* @returns the container element
*/
getContainerElement(): HTMLElement;
/**
* Create the overlay container element, which is simply a div
* with the 'cdk-overlay-container' class on the document body.
*/
protected _createContainer(): void;
/** Loads the structural styles necessary for the overlay to work. */
protected _loadStyles(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayContainer, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<OverlayContainer>;
}
/** Possible values that can be set as the origin of a FlexibleConnectedPositionStrategy. */
type FlexibleConnectedPositionStrategyOrigin = ElementRef | Element | (Point & {
width?: number;
height?: number;
});
/**
* A strategy for positioning overlays. Using this strategy, an overlay is given an
* implicit position relative some origin element. The relative position is defined in terms of
* a point on the origin element that is connected to a point on the overlay element. For example,
* a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner
* of the overlay.
*/
declare class FlexibleConnectedPositionStrategy implements PositionStrategy {
private _viewportRuler;
private _document;
private _platform;
private _overlayContainer;
/** The overlay to which this strategy is attached. */
private _overlayRef;
/** Whether we're performing the very first positioning of the overlay. */
private _isInitialRender;
/** Last size used for the bounding box. Used to avoid resizing the overlay after open. */
private _lastBoundingBoxSize;
/** Whether the overlay was pushed in a previous positioning. */
private _isPushed;
/** Whether the overlay can be pushed on-screen on the initial open. */
private _canPush;
/** Whether the overlay can grow via flexible width/height after the initial open. */
private _growAfterOpen;
/** Whether the overlay's width and height can be constrained to fit within the viewport. */
private _hasFlexibleDimensions;
/** Whether the overlay position is locked. */
private _positionLocked;
/** Cached origin dimensions */
private _originRect;
/** Cached overlay dimensions */
private _overlayRect;
/** Cached viewport dimensions */
private _viewportRect;
/** Cached container dimensions */
private _containerRect;
/** Amount of space that must be maintained between the overlay and the edge of the viewport. */
private _viewportMargin;
/** The Scrollable containers used to check scrollable view properties on position change. */
private _scrollables;
/** Ordered list of preferred positions, from most to least desirable. */
_preferredPositions: ConnectionPositionPair[];
/** The origin element against which the overlay will be positioned. */
_origin: FlexibleConnectedPositionStrategyOrigin;
/** The overlay pane element. */
private _pane;
/** Whether the strategy has been disposed of already. */
private _isDisposed;
/**
* Parent element for the overlay panel used to constrain the overlay panel's size to fit
* within the viewport.
*/
private _boundingBox;
/** The last position to have been calculated as the best fit position. */
private _lastPosition;
/** The last calculated scroll visibility. Only tracked */
private _lastScrollVisibility;
/** Subject that emits whenever the position changes. */
private readonly _positionChanges;
/** Subscription to viewport size changes. */
private _resizeSubscription;
/** Default offset for the overlay along the x axis. */
private _offsetX;
/** Default offset for the overlay along the y axis. */
private _offsetY;
/** Selector to be used when finding the elements on which to set the transform origin. */
private _transformOriginSelector;
/** Keeps track of the CSS classes that the position strategy has applied on the overlay panel. */
private _appliedPanelClasses;
/** Amount by which the overlay was pushed in each axis during the last time it was positioned. */
private _previousPushAmount;
/** Observable sequence of position changes. */
positionChanges: Observable<ConnectedOverlayPositionChange>;
/** Ordered list of preferred positions, from most to least desirable. */
get positions(): ConnectionPositionPair[];
constructor(connectedTo: FlexibleConnectedPositionStrategyOrigin, _viewportRuler: ViewportRuler, _document: Document, _platform: Platform, _overlayContainer: OverlayContainer);
/** Attaches this position strategy to an overlay. */
attach(overlayRef: OverlayRef): void;
/**
* Updates the position of the overlay element, using whichever preferred position relative
* to the origin best fits on-screen.
*
* The selection of a position goes as follows:
* - If any positions fit completely within the viewport as-is,
* choose the first position that does so.
* - If flexible dimensions are enabled and at least one satisfies the given minimum width/height,
* choose the position with the greatest available size modified by the positions' weight.
* - If pushing is enabled, take the position that went off-screen the least and push it
* on-screen.
* - If none of the previous criteria were met, use the position that goes off-screen the least.
* @docs-private
*/
apply(): void;
detach(): void;
/** Cleanup after the element gets destroyed. */
dispose(): void;
/**
* This re-aligns the overlay element with the trigger in its last calculated position,
* even if a position higher in the "preferred positions" list would now fit. This
* allows one to re-align the panel without changing the orientation of the panel.
*/
reapplyLastPosition(): void;
/**
* Sets the list of Scrollable containers that host the origin element so that
* on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
* Scrollable must be an ancestor element of the strategy's origin element.
*/
withScrollableContainers(scrollables: CdkScrollable[]): this;
/**
* Adds new preferred positions.
* @param positions List of positions options for this overlay.
*/
withPositions(positions: ConnectedPosition[]): this;
/**
* Sets a minimum distance the overlay may be positioned to the edge of the viewport.
* @param margin Required margin between the overlay and the viewport edge in pixels.
*/
withViewportMargin(margin: number): this;
/** Sets whether the overlay's width and height can be constrained to fit within the viewport. */
withFlexibleDimensions(flexibleDimensions?: boolean): this;
/** Sets whether the overlay can grow after the initial open via flexible width/height. */
withGrowAfterOpen(growAfterOpen?: boolean): this;
/** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */
withPush(canPush?: boolean): this;
/**
* Sets whether the overlay's position should be locked in after it is positioned
* initially. When an overlay is locked in, it won't attempt to reposition itself
* when the position is re-applied (e.g. when the user scrolls away).
* @param isLocked Whether the overlay should locked in.
*/
withLockedPosition(isLocked?: boolean): this;
/**
* Sets the origin, relative to which to position the overlay.
* Using an element origin is useful for building components that need to be positioned
* relatively to a trigger (e.g. dropdown menus or tooltips), whereas using a point can be
* used for cases like contextual menus which open relative to the user's pointer.
* @param origin Reference to the new origin.
*/
setOrigin(origin: FlexibleConnectedPositionStrategyOrigin): this;
/**
* Sets the default offset for the overlay's connection point on the x-axis.
* @param offset New offset in the X axis.
*/
withDefaultOffsetX(offset: number): this;
/**
* Sets the default offset for the overlay's connection point on the y-axis.
* @param offset New offset in the Y axis.
*/
withDefaultOffsetY(offset: number): this;
/**
* Configures that the position strategy should set a `transform-origin` on some elements
* inside the overlay, depending on the current position that is being applied. This is
* useful for the cases where the origin of an animation can change depending on the
* alignment of the overlay.
* @param selector CSS selector that will be used to find the target
* elements onto which to set the transform origin.
*/
withTransformOriginOn(selector: string): this;
/**
* Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
*/
private _getOriginPoint;
/**
* Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
* origin point to which the overlay should be connected.
*/
private _getOverlayPoint;
/** Gets how well an overlay at the given point will fit within the viewport. */
private _getOverlayFit;
/**
* Whether the overlay can fit within the viewport when it may resize either its width or height.
* @param fit How well the overlay fits in the viewport at some position.
* @param point The (x, y) coordinates of the overlay at some position.
* @param viewport The geometry of the viewport.
*/
private _canFitWithFlexibleDimensions;
/**
* Gets the point at which the overlay can be "pushed" on-screen. If the overlay is larger than
* the viewport, the top-left corner will be pushed on-screen (with overflow occurring on the
* right and bottom).
*
* @param start Starting point from which the overlay is pushed.
* @param rawOverlayRect Dimensions of the overlay.
* @param scrollPosition Current viewport scroll position.
* @returns The point at which to position the overlay after pushing. This is effectively a new
* originPoint.
*/
private _pushOverlayOnScreen;
/**
* Applies a computed position to the overlay and emits a position change.
* @param position The position preference
* @param originPoint The point on the origin element where the overlay is connected.
*/
private _applyPosition;
/** Sets the transform origin based on the configured selector and the passed-in position. */
private _setTransformOrigin;
/**
* Gets the position and size of the overlay's sizing container.
*
* This method does no measuring and applies no styles so that we can cheaply compute the
* bounds for all positions and choose the best fit based on these results.
*/
private _calculateBoundingBoxRect;
/**
* Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
* origin's connection point and stretches to the bounds of the viewport.
*
* @param origin The point on the origin element where the overlay is connected.
* @param position The position preference
*/
private _setBoundingBoxStyles;
/** Resets the styles for the bounding box so that a new positioning can be computed. */
private _resetBoundingBoxStyles;
/** Resets the styles for the overlay pane so that a new positioning can be computed. */
private _resetOverlayElementStyles;
/** Sets positioning styles to the overlay element. */
private _setOverlayElementStyles;
/** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */
private _getExactOverlayY;
/** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */
private _getExactOverlayX;
/**
* Gets the view properties of the trigger and overlay, including whether they are clipped
* or completely outside the view of any of the strategy's scrollables.
*/
private _getScrollVisibility;
/** Subtracts the amount that an element is overflowing on an axis from its length. */
private _subtractOverflows;
/** Narrows the given viewport rect by the current _viewportMargin. */
private _getNarrowedViewportRect;
/** Whether the we're dealing with an RTL context */
private _isRtl;
/** Determines whether the overlay uses exact or flexible positioning. */
private _hasExactPosition;
/** Retrieves the offset of a position along the x or y axis. */
private _getOffset;
/** Validates that the current position match the expected values. */
private _validatePositions;
/** Adds a single CSS class or an array of classes on the overlay panel. */
private _addPanelClasses;
/** Clears the classes that the position strategy has applied from the overlay panel. */
private _clearPanelClasses;
/** Returns the DOMRect of the current origin. */
private _getOriginRect;
}
/** A simple (x, y) coordinate. */
interface Point {
x: number;
y: number;
}
/** A connected position as specified by the user. */
interface ConnectedPosition {
originX: 'start' | 'center' | 'end';
originY: 'top' | 'center' | 'bottom';
overlayX: 'start' | 'center' | 'end';
overlayY: 'top' | 'center' | 'bottom';
weight?: number;
offsetX?: number;
offsetY?: number;
panelClass?: string | string[];
}
declare const STANDARD_DROPDOWN_BELOW_POSITIONS: ConnectedPosition[];
declare const STANDARD_DROPDOWN_ADJACENT_POSITIONS: ConnectedPosition[];
/**
* Directive applied to an element to make it usable as an origin for an Overlay using a
* ConnectedPositionStrategy.
*/
declare class CdkOverlayOrigin {
elementRef: ElementRef<any>;
constructor(...args: unknown[]);
static ɵfac: i0.ɵɵFactoryDeclaration<CdkOverlayOrigin, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkOverlayOrigin, "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", ["cdkOverlayOrigin"], {}, {}, never, never, true, never>;
}
/**
* Directive to facilitate declarative creation of an
* Overlay using a FlexibleConnectedPositionStrategy.
*/
declare class CdkConnectedOverlay implements OnDestroy, OnChanges {
private _overlay;
private _dir;
private _overlayRef;
private _templatePortal;
private _backdropSubscription;
private _attachSubscription;
private _detachSubscription;
private _positionSubscription;
private _offsetX;
private _offsetY;
private _position;
private _scrollStrategyFactory;
private _disposeOnNavigation;
private _ngZone;
/** Origin for the connected overlay. */
origin: CdkOverlayOrigin | FlexibleConnectedPositionStrategyOrigin;
/** Registered connected position pairs. */
positions: ConnectedPosition[];
/**
* This input overrides the positions input if specified. It lets users pass
* in arbitrary positioning strategies.
*/
positionStrategy: FlexibleConnectedPositionStrategy;
/** The offset in pixels for the overlay connection point on the x-axis */
get offsetX(): number;
set offsetX(offsetX: number);
/** The offset in pixels for the overlay connection point on the y-axis */
get offsetY(): number;
set offsetY(offsetY: number);
/** The width of the overlay panel. */
width: number | string;
/** The height of the overlay panel. */
height: number | string;
/** The min width of the overlay panel. */
minWidth: number | string;
/** The min height of the overlay panel. */
minHeight: number | string;
/** The custom class to be set on the backdrop element. */
backdropClass: string | string[];
/** The custom class to add to the overlay pane element. */
panelClass: string | string[];
/** Margin between the overlay and the viewport edges. */
viewportMargin: number;
/** Strategy to be used when handling scroll events while the overlay is open. */
scrollStrategy: ScrollStrategy;
/** Whether the overlay is open. */
open: boolean;
/** Whether the overlay can be closed by user interaction. */
disableClose: boolean;
/** CSS selector which to set the transform origin. */
transformOriginSelector: string;
/** Whether or not the overlay should attach a backdrop. */
hasBackdrop: boolean;
/** Whether or not the overlay should be locked when scrolling. */
lockPosition: boolean;
/** Whether the overlay's width and height can be constrained to fit within the viewport. */
flexibleDimensions: boolean;
/** Whether the overlay can grow after the initial open when flexible positioning is turned on. */
growAfterOpen: boolean;
/** Whether the overlay can be pushed on-screen if none of the provided positions fit. */
push: boolean;
/** Whether the overlay should be disposed of when the user goes backwards/forwards in history. */
get disposeOnNavigation(): boolean;
set disposeOnNavigation(value: boolean);
/** Event emitted when the backdrop is clicked. */
readonly backdropClick: EventEmitter<MouseEvent>;
/** Event emitted when the position has changed. */
readonly positionChange: EventEmitter<ConnectedOverlayPositionChange>;
/** Event emitted when the overlay has been attached. */
readonly attach: EventEmitter<void>;
/** Event emitted when the overlay has been detached. */
readonly detach: EventEmitter<void>;
/** Emits when there are keyboard events that are targeted at the overlay. */
readonly overlayKeydown: EventEmitter<KeyboardEvent>;
/** Emits when there are mouse outside click events that are targeted at the overlay. */
readonly overlayOutsideClick: EventEmitter<MouseEvent>;
constructor(...args: unknown[]);
/** The associated overlay reference. */
get overlayRef(): OverlayRef;
/** The element's layout direction. */
get dir(): Direction;
ngOnDestroy(): void;
ngOnChanges(changes: SimpleChanges): void;
/** Creates an overlay */
private _createOverlay;
/** Builds the overlay config based on the directive's inputs */
private _buildConfig;
/** Updates the state of a position strategy, based on the values of the directive inputs. */
private _updatePositionStrategy;
/** Returns the position strategy of the overlay to be set on the overlay config */
private _createPositionStrategy;
private _getOrigin;
private _getOriginElement;
/** Attaches the overlay. */
attachOverlay(): void;
/** Detaches the overlay. */
detachOverlay(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<CdkConnectedOverlay, never>;
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; }; "disposeOnNavigation": { "alias": "cdkConnectedOverlayDisposeOnNavigation"; "required": false; }; }, { "backdropClick": "backdropClick"; "positionChange": "positionChange"; "attach": "attach"; "detach": "detach"; "overlayKeydown": "overlayKeydown"; "overlayOutsideClick": "overlayOutsideClick"; }, never, never, true, never>;
static ngAcceptInputType_hasBackdrop: unknown;
static ngAcceptInputType_lockPosition: unknown;
static ngAcceptInputType_flexibleDimensions: unknown;
static ngAcceptInputType_growAfterOpen: unknown;
static ngAcceptInputType_push: unknown;
static ngAcceptInputType_disposeOnNavigation: unknown;
}
declare class OverlayModule {
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<OverlayModule, never, [typeof BidiModule, typeof PortalModule, typeof ScrollingModule, typeof CdkConnectedOverlay, typeof CdkOverlayOrigin], [typeof CdkConnectedOverlay, typeof CdkOverlayOrigin, typeof ScrollingModule]>;
static ɵinj: i0.ɵɵInjectorDeclaration<OverlayModule>;
}
export { OverlayRef as O, OverlayModule as a, FlexibleConnectedPositionStrategy as b, OverlayConfig as c, OverlayContainer as d, CdkOverlayOrigin as e, CdkConnectedOverlay as f, STANDARD_DROPDOWN_ADJACENT_POSITIONS as h, STANDARD_DROPDOWN_BELOW_POSITIONS as i, ConnectionPositionPair as l, ScrollingVisibility as m, ConnectedOverlayPositionChange as n, validateHorizontalPosition as o, OverlayOutsideClickDispatcher as p, OverlayKeyboardDispatcher as q, validateVerticalPosition as v };
export type { ConnectedPosition as C, FlexibleConnectedPositionStrategyOrigin as F, HorizontalConnectionPos as H, PositionStrategy as P, ScrollStrategy as S, VerticalConnectionPos as V, OverlaySizeConfig as g, OriginConnectionPosition as j, OverlayConnectionPosition as k };