@angular/cdk 10.0.0-rc.3 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/aria-describer/aria-describer.d.ts +10 -1
- package/a11y/focus-trap/focus-trap.d.ts +4 -2
- package/a11y/index.metadata.json +1 -1
- package/a11y/interactivity-checker/interactivity-checker.d.ts +11 -1
- package/a11y/key-manager/list-key-manager.d.ts +6 -0
- package/accordion/accordion.d.ts +7 -1
- package/accordion/index.d.ts +1 -0
- package/accordion/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +78 -15
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +11 -11
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-accordion.umd.js +12 -4
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js +2 -2
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +717 -641
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +8 -16
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +199 -42
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +11 -18
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +0 -1
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +2 -2
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +26 -4
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +11 -4
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.min.js +8 -8
- package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
- package/bundles/cdk-testing.umd.js +32 -0
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.min.js +5 -5
- package/bundles/cdk-testing.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +6 -2
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +3 -3
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/drag-drop/directives/drag-handle.d.ts +7 -1
- package/drag-drop/directives/drag-placeholder.d.ts +7 -1
- package/drag-drop/directives/drag-preview.d.ts +7 -1
- package/drag-drop/directives/drag.d.ts +4 -14
- package/drag-drop/directives/drop-list-group.d.ts +7 -1
- package/drag-drop/directives/drop-list.d.ts +7 -1
- package/drag-drop/drag-ref.d.ts +6 -0
- package/drag-drop/drop-list-ref.d.ts +3 -2
- package/drag-drop/index.d.ts +2 -2
- package/drag-drop/index.metadata.json +1 -1
- package/esm2015/a11y/a11y-module.js +15 -19
- package/esm2015/a11y/aria-describer/aria-describer.js +177 -167
- package/esm2015/a11y/focus-monitor/focus-monitor.js +337 -345
- package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +30 -34
- package/esm2015/a11y/focus-trap/focus-trap-manager.js +36 -40
- package/esm2015/a11y/focus-trap/focus-trap.js +85 -82
- package/esm2015/a11y/high-contrast-mode/high-contrast-mode-detector.js +56 -60
- package/esm2015/a11y/interactivity-checker/interactivity-checker.js +113 -104
- package/esm2015/a11y/key-manager/list-key-manager.js +29 -4
- package/esm2015/a11y/live-announcer/live-announcer.js +138 -146
- package/esm2015/accordion/accordion-item.js +119 -123
- package/esm2015/accordion/accordion-module.js +9 -13
- package/esm2015/accordion/accordion.js +49 -46
- package/esm2015/accordion/index.js +2 -1
- package/esm2015/bidi/bidi-module.js +9 -13
- package/esm2015/bidi/dir.js +41 -45
- package/esm2015/bidi/directionality.js +27 -31
- package/esm2015/clipboard/clipboard-module.js +9 -13
- package/esm2015/clipboard/clipboard.js +36 -40
- package/esm2015/clipboard/copy-to-clipboard.js +71 -75
- package/esm2015/collections/unique-selection-dispatcher.js +33 -37
- package/esm2015/drag-drop/directives/drag-handle.js +42 -39
- package/esm2015/drag-drop/directives/drag-placeholder.js +24 -21
- package/esm2015/drag-drop/directives/drag-preview.js +29 -26
- package/esm2015/drag-drop/directives/drag.js +313 -319
- package/esm2015/drag-drop/directives/drop-list-group.js +32 -29
- package/esm2015/drag-drop/directives/drop-list.js +251 -250
- package/esm2015/drag-drop/drag-drop-module.js +27 -31
- package/esm2015/drag-drop/drag-drop-registry.js +139 -143
- package/esm2015/drag-drop/drag-drop.js +33 -37
- package/esm2015/drag-drop/drag-ref.js +59 -25
- package/esm2015/drag-drop/drop-list-ref.js +15 -9
- package/esm2015/drag-drop/index.js +3 -2
- package/esm2015/layout/breakpoints-observer.js +81 -85
- package/esm2015/layout/layout-module.js +6 -10
- package/esm2015/layout/media-matcher.js +28 -32
- package/esm2015/observers/observe-content.js +147 -163
- package/esm2015/overlay/dispatchers/base-overlay-dispatcher.js +51 -0
- package/esm2015/overlay/dispatchers/index.js +10 -0
- package/esm2015/overlay/dispatchers/overlay-keyboard-dispatcher.js +79 -0
- package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +94 -0
- package/esm2015/overlay/fullscreen-overlay-container.js +70 -74
- package/esm2015/overlay/index.js +5 -4
- package/esm2015/overlay/overlay-config.js +5 -1
- package/esm2015/overlay/overlay-container.js +69 -73
- package/esm2015/overlay/overlay-directives.js +245 -243
- package/esm2015/overlay/overlay-module.js +15 -19
- package/esm2015/overlay/overlay-ref.js +24 -2
- package/esm2015/overlay/overlay-reference.js +1 -1
- package/esm2015/overlay/overlay.js +93 -92
- package/esm2015/overlay/position/connected-position.js +14 -18
- package/esm2015/overlay/position/overlay-position-builder.js +43 -47
- package/esm2015/overlay/public-api.js +2 -2
- package/esm2015/overlay/scroll/scroll-strategy-options.js +33 -37
- package/esm2015/platform/features/scrolling.js +1 -2
- package/esm2015/platform/platform-module.js +6 -10
- package/esm2015/platform/platform.js +48 -52
- package/esm2015/portal/portal-directives.js +181 -201
- package/esm2015/scrolling/fixed-size-virtual-scroll.js +57 -47
- package/esm2015/scrolling/public-api.js +2 -1
- package/esm2015/scrolling/scroll-dispatcher.js +139 -143
- package/esm2015/scrolling/scrollable.js +135 -139
- package/esm2015/scrolling/scrolling-module.js +32 -40
- package/esm2015/scrolling/viewport-ruler.js +105 -109
- package/esm2015/scrolling/virtual-for-of.js +264 -268
- package/esm2015/scrolling/virtual-scroll-repeater.js +8 -0
- package/esm2015/scrolling/virtual-scroll-viewport.js +318 -322
- package/esm2015/stepper/step-header.js +20 -24
- package/esm2015/stepper/step-label.js +13 -17
- package/esm2015/stepper/stepper-button.js +59 -67
- package/esm2015/stepper/stepper-module.js +24 -28
- package/esm2015/stepper/stepper.js +313 -321
- package/esm2015/table/cell.js +129 -157
- package/esm2015/table/row.js +183 -219
- package/esm2015/table/table-module.js +9 -13
- package/esm2015/table/table.js +765 -785
- package/esm2015/table/text-column.js +85 -89
- package/esm2015/testing/component-harness.js +19 -1
- package/esm2015/testing/harness-environment.js +7 -1
- package/esm2015/text-field/autofill.js +89 -97
- package/esm2015/text-field/autosize.js +225 -229
- package/esm2015/text-field/text-field-module.js +10 -14
- package/esm2015/tree/control/nested-tree-control.js +7 -3
- package/esm2015/tree/nested-node.js +79 -83
- package/esm2015/tree/node.js +17 -21
- package/esm2015/tree/outlet.js +15 -19
- package/esm2015/tree/padding.js +88 -92
- package/esm2015/tree/toggle.js +32 -36
- package/esm2015/tree/tree-module.js +10 -14
- package/esm2015/tree/tree.js +266 -274
- package/esm2015/version.js +1 -1
- package/fesm2015/a11y.js +1021 -996
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/accordion.js +173 -175
- package/fesm2015/accordion.js.map +1 -1
- package/fesm2015/bidi.js +74 -83
- package/fesm2015/bidi.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/clipboard.js +113 -122
- package/fesm2015/clipboard.js.map +1 -1
- package/fesm2015/collections.js +32 -35
- package/fesm2015/collections.js.map +1 -1
- package/fesm2015/drag-drop.js +1005 -961
- package/fesm2015/drag-drop.js.map +1 -1
- package/fesm2015/layout.js +111 -120
- package/fesm2015/layout.js.map +1 -1
- package/fesm2015/observers.js +146 -158
- package/fesm2015/observers.js.map +1 -1
- package/fesm2015/overlay.js +793 -659
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/platform.js +52 -59
- package/fesm2015/platform.js.map +1 -1
- package/fesm2015/portal.js +180 -195
- package/fesm2015/portal.js.map +1 -1
- package/fesm2015/scrolling.js +1058 -1060
- package/fesm2015/scrolling.js.map +1 -1
- package/fesm2015/stepper.js +424 -445
- package/fesm2015/stepper.js.map +1 -1
- package/fesm2015/table.js +1178 -1247
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/testing.js +25 -1
- package/fesm2015/testing.js.map +1 -1
- package/fesm2015/text-field.js +318 -330
- package/fesm2015/text-field.js.map +1 -1
- package/fesm2015/tree.js +517 -537
- package/fesm2015/tree.js.map +1 -1
- package/overlay/dispatchers/base-overlay-dispatcher.d.ts +28 -0
- package/overlay/dispatchers/index.d.ts +9 -0
- package/overlay/{keyboard → dispatchers}/overlay-keyboard-dispatcher.d.ts +4 -10
- package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +27 -0
- package/overlay/index.d.ts +4 -3
- package/overlay/index.metadata.json +1 -1
- package/overlay/overlay-config.d.ts +4 -0
- package/overlay/overlay-directives.d.ts +4 -0
- package/overlay/overlay-ref.d.ts +8 -2
- package/overlay/overlay-reference.d.ts +1 -0
- package/overlay/overlay.d.ts +4 -2
- package/overlay/public-api.d.ts +1 -1
- package/package.json +3 -3
- package/schematics/index.js +1 -1
- package/schematics/migration.json +5 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-update/data/index.js +1 -1
- package/schematics/ng-update/devkit-file-system.d.ts +5 -5
- package/schematics/ng-update/devkit-file-system.js +21 -16
- package/schematics/ng-update/devkit-migration-rule.js +13 -20
- package/schematics/ng-update/devkit-migration.d.ts +0 -2
- package/schematics/ng-update/devkit-migration.js +1 -1
- package/schematics/ng-update/find-stylesheets.d.ts +10 -0
- package/schematics/ng-update/find-stylesheets.js +31 -0
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +7 -2
- package/schematics/ng-update/migrations/attribute-selectors.js +3 -3
- package/schematics/ng-update/migrations/css-selectors.js +3 -3
- package/schematics/ng-update/migrations/element-selectors.js +3 -3
- package/schematics/ng-update/public-api.js +1 -1
- package/schematics/update-tool/component-resource-collector.d.ts +1 -1
- package/schematics/update-tool/component-resource-collector.js +18 -14
- package/schematics/update-tool/file-system.d.ts +19 -14
- package/schematics/update-tool/file-system.js +1 -1
- package/schematics/update-tool/index.d.ts +21 -3
- package/schematics/update-tool/index.js +29 -23
- package/schematics/update-tool/public-api.js +1 -1
- package/schematics/update-tool/target-version.d.ts +2 -1
- package/schematics/update-tool/target-version.js +5 -3
- package/schematics/update-tool/utils/parse-tsconfig.d.ts +2 -1
- package/schematics/update-tool/utils/parse-tsconfig.js +6 -10
- package/schematics/update-tool/utils/virtual-host.d.ts +34 -0
- package/schematics/update-tool/utils/virtual-host.js +62 -0
- package/schematics/update-tool/version-changes.js +4 -6
- package/schematics/utils/index.js +1 -1
- package/schematics/utils/project-tsconfig-paths.d.ts +2 -1
- package/schematics/utils/project-tsconfig-paths.js +1 -1
- package/scrolling/index.metadata.json +1 -1
- package/scrolling/public-api.d.ts +1 -0
- package/scrolling/virtual-for-of.d.ts +2 -1
- package/scrolling/virtual-scroll-repeater.d.ts +16 -0
- package/scrolling/virtual-scroll-viewport.d.ts +4 -4
- package/testing/component-harness.d.ts +12 -0
- package/testing/harness-environment.d.ts +1 -0
- package/tree/control/nested-tree-control.d.ts +7 -2
- package/tree/index.metadata.json +1 -1
- package/esm2015/overlay/keyboard/overlay-keyboard-dispatcher.js +0 -100
package/fesm2015/overlay.js
CHANGED
|
@@ -285,42 +285,39 @@ class RepositionScrollStrategy {
|
|
|
285
285
|
* Users can provide a custom value for `ScrollStrategyOptions` to replace the default
|
|
286
286
|
* behaviors. This class primarily acts as a factory for ScrollStrategy instances.
|
|
287
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
|
-
return ScrollStrategyOptions;
|
|
323
|
-
})();
|
|
288
|
+
class ScrollStrategyOptions {
|
|
289
|
+
constructor(_scrollDispatcher, _viewportRuler, _ngZone, document) {
|
|
290
|
+
this._scrollDispatcher = _scrollDispatcher;
|
|
291
|
+
this._viewportRuler = _viewportRuler;
|
|
292
|
+
this._ngZone = _ngZone;
|
|
293
|
+
/** Do nothing on scroll. */
|
|
294
|
+
this.noop = () => new NoopScrollStrategy();
|
|
295
|
+
/**
|
|
296
|
+
* Close the overlay as soon as the user scrolls.
|
|
297
|
+
* @param config Configuration to be used inside the scroll strategy.
|
|
298
|
+
*/
|
|
299
|
+
this.close = (config) => new CloseScrollStrategy(this._scrollDispatcher, this._ngZone, this._viewportRuler, config);
|
|
300
|
+
/** Block scrolling. */
|
|
301
|
+
this.block = () => new BlockScrollStrategy(this._viewportRuler, this._document);
|
|
302
|
+
/**
|
|
303
|
+
* Update the overlay's position on scroll.
|
|
304
|
+
* @param config Configuration to be used inside the scroll strategy.
|
|
305
|
+
* Allows debouncing the reposition calls.
|
|
306
|
+
*/
|
|
307
|
+
this.reposition = (config) => new RepositionScrollStrategy(this._scrollDispatcher, this._viewportRuler, this._ngZone, config);
|
|
308
|
+
this._document = document;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
ScrollStrategyOptions.ɵprov = ɵɵdefineInjectable({ factory: function ScrollStrategyOptions_Factory() { return new ScrollStrategyOptions(ɵɵinject(ScrollDispatcher), ɵɵinject(ViewportRuler), ɵɵinject(NgZone), ɵɵinject(DOCUMENT)); }, token: ScrollStrategyOptions, providedIn: "root" });
|
|
312
|
+
ScrollStrategyOptions.decorators = [
|
|
313
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
314
|
+
];
|
|
315
|
+
ScrollStrategyOptions.ctorParameters = () => [
|
|
316
|
+
{ type: ScrollDispatcher },
|
|
317
|
+
{ type: ViewportRuler },
|
|
318
|
+
{ type: NgZone },
|
|
319
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
320
|
+
];
|
|
324
321
|
|
|
325
322
|
/**
|
|
326
323
|
* @license
|
|
@@ -354,6 +351,10 @@ class OverlayConfig {
|
|
|
354
351
|
* the `HashLocationStrategy`).
|
|
355
352
|
*/
|
|
356
353
|
this.disposeOnNavigation = false;
|
|
354
|
+
/**
|
|
355
|
+
* Array of HTML elements clicking on which should not be considered as outside click
|
|
356
|
+
*/
|
|
357
|
+
this.excludeFromOutsideClick = [];
|
|
357
358
|
if (config) {
|
|
358
359
|
// Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3,
|
|
359
360
|
// loses the array generic type in the `for of`. But we *also* have to use `Array` because
|
|
@@ -427,23 +428,20 @@ class ConnectionPositionPair {
|
|
|
427
428
|
class ScrollingVisibility {
|
|
428
429
|
}
|
|
429
430
|
/** The change event emitted by the strategy when a fallback position is used. */
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
];
|
|
445
|
-
return ConnectedOverlayPositionChange;
|
|
446
|
-
})();
|
|
431
|
+
class ConnectedOverlayPositionChange {
|
|
432
|
+
constructor(
|
|
433
|
+
/** The position used as a result of this change. */
|
|
434
|
+
connectionPair,
|
|
435
|
+
/** @docs-private */
|
|
436
|
+
scrollableViewProperties) {
|
|
437
|
+
this.connectionPair = connectionPair;
|
|
438
|
+
this.scrollableViewProperties = scrollableViewProperties;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
ConnectedOverlayPositionChange.ctorParameters = () => [
|
|
442
|
+
{ type: ConnectionPositionPair },
|
|
443
|
+
{ type: ScrollingVisibility, decorators: [{ type: Optional }] }
|
|
444
|
+
];
|
|
447
445
|
/**
|
|
448
446
|
* Validates whether a vertical position property matches the expected values.
|
|
449
447
|
* @param property Name of the property being validated.
|
|
@@ -469,6 +467,53 @@ function validateHorizontalPosition(property, value) {
|
|
|
469
467
|
}
|
|
470
468
|
}
|
|
471
469
|
|
|
470
|
+
/**
|
|
471
|
+
* @license
|
|
472
|
+
* Copyright Google LLC All Rights Reserved.
|
|
473
|
+
*
|
|
474
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
475
|
+
* found in the LICENSE file at https://angular.io/license
|
|
476
|
+
*/
|
|
477
|
+
/**
|
|
478
|
+
* Service for dispatching events that land on the body to appropriate overlay ref,
|
|
479
|
+
* if any. It maintains a list of attached overlays to determine best suited overlay based
|
|
480
|
+
* on event target and order of overlay opens.
|
|
481
|
+
*/
|
|
482
|
+
class BaseOverlayDispatcher {
|
|
483
|
+
constructor(document) {
|
|
484
|
+
/** Currently attached overlays in the order they were attached. */
|
|
485
|
+
this._attachedOverlays = [];
|
|
486
|
+
this._document = document;
|
|
487
|
+
}
|
|
488
|
+
ngOnDestroy() {
|
|
489
|
+
this.detach();
|
|
490
|
+
}
|
|
491
|
+
/** Add a new overlay to the list of attached overlay refs. */
|
|
492
|
+
add(overlayRef) {
|
|
493
|
+
// Ensure that we don't get the same overlay multiple times.
|
|
494
|
+
this.remove(overlayRef);
|
|
495
|
+
this._attachedOverlays.push(overlayRef);
|
|
496
|
+
}
|
|
497
|
+
/** Remove an overlay from the list of attached overlay refs. */
|
|
498
|
+
remove(overlayRef) {
|
|
499
|
+
const index = this._attachedOverlays.indexOf(overlayRef);
|
|
500
|
+
if (index > -1) {
|
|
501
|
+
this._attachedOverlays.splice(index, 1);
|
|
502
|
+
}
|
|
503
|
+
// Remove the global listener once there are no more overlays.
|
|
504
|
+
if (this._attachedOverlays.length === 0) {
|
|
505
|
+
this.detach();
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
BaseOverlayDispatcher.ɵprov = ɵɵdefineInjectable({ factory: function BaseOverlayDispatcher_Factory() { return new BaseOverlayDispatcher(ɵɵinject(DOCUMENT)); }, token: BaseOverlayDispatcher, providedIn: "root" });
|
|
510
|
+
BaseOverlayDispatcher.decorators = [
|
|
511
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
512
|
+
];
|
|
513
|
+
BaseOverlayDispatcher.ctorParameters = () => [
|
|
514
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
515
|
+
];
|
|
516
|
+
|
|
472
517
|
/**
|
|
473
518
|
* @license
|
|
474
519
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -481,71 +526,50 @@ function validateHorizontalPosition(property, value) {
|
|
|
481
526
|
* if any. It maintains a list of attached overlays to determine best suited overlay based
|
|
482
527
|
* on event target and order of overlay opens.
|
|
483
528
|
*/
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
overlays[i]._keydownEvents.next(event);
|
|
501
|
-
break;
|
|
502
|
-
}
|
|
529
|
+
class OverlayKeyboardDispatcher extends BaseOverlayDispatcher {
|
|
530
|
+
constructor(document) {
|
|
531
|
+
super(document);
|
|
532
|
+
/** Keyboard event listener that will be attached to the body. */
|
|
533
|
+
this._keydownListener = (event) => {
|
|
534
|
+
const overlays = this._attachedOverlays;
|
|
535
|
+
for (let i = overlays.length - 1; i > -1; i--) {
|
|
536
|
+
// Dispatch the keydown event to the top overlay which has subscribers to its keydown events.
|
|
537
|
+
// We want to target the most recent overlay, rather than trying to match where the event came
|
|
538
|
+
// from, because some components might open an overlay, but keep focus on a trigger element
|
|
539
|
+
// (e.g. for select and autocomplete). We skip overlays without keydown event subscriptions,
|
|
540
|
+
// because we don't want overlays that don't handle keyboard events to block the ones below
|
|
541
|
+
// them that do.
|
|
542
|
+
if (overlays[i]._keydownEvents.observers.length > 0) {
|
|
543
|
+
overlays[i]._keydownEvents.next(event);
|
|
544
|
+
break;
|
|
503
545
|
}
|
|
504
|
-
};
|
|
505
|
-
this._document = document;
|
|
506
|
-
}
|
|
507
|
-
ngOnDestroy() {
|
|
508
|
-
this._detach();
|
|
509
|
-
}
|
|
510
|
-
/** Add a new overlay to the list of attached overlay refs. */
|
|
511
|
-
add(overlayRef) {
|
|
512
|
-
// Ensure that we don't get the same overlay multiple times.
|
|
513
|
-
this.remove(overlayRef);
|
|
514
|
-
// Lazily start dispatcher once first overlay is added
|
|
515
|
-
if (!this._isAttached) {
|
|
516
|
-
this._document.body.addEventListener('keydown', this._keydownListener);
|
|
517
|
-
this._isAttached = true;
|
|
518
|
-
}
|
|
519
|
-
this._attachedOverlays.push(overlayRef);
|
|
520
|
-
}
|
|
521
|
-
/** Remove an overlay from the list of attached overlay refs. */
|
|
522
|
-
remove(overlayRef) {
|
|
523
|
-
const index = this._attachedOverlays.indexOf(overlayRef);
|
|
524
|
-
if (index > -1) {
|
|
525
|
-
this._attachedOverlays.splice(index, 1);
|
|
526
|
-
}
|
|
527
|
-
// Remove the global listener once there are no more overlays.
|
|
528
|
-
if (this._attachedOverlays.length === 0) {
|
|
529
|
-
this._detach();
|
|
530
546
|
}
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
/** Add a new overlay to the list of attached overlay refs. */
|
|
550
|
+
add(overlayRef) {
|
|
551
|
+
super.add(overlayRef);
|
|
552
|
+
// Lazily start dispatcher once first overlay is added
|
|
553
|
+
if (!this._isAttached) {
|
|
554
|
+
this._document.body.addEventListener('keydown', this._keydownListener);
|
|
555
|
+
this._isAttached = true;
|
|
531
556
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
557
|
+
}
|
|
558
|
+
/** Detaches the global keyboard event listener. */
|
|
559
|
+
detach() {
|
|
560
|
+
if (this._isAttached) {
|
|
561
|
+
this._document.body.removeEventListener('keydown', this._keydownListener);
|
|
562
|
+
this._isAttached = false;
|
|
538
563
|
}
|
|
539
564
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
]
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
]
|
|
547
|
-
|
|
548
|
-
})();
|
|
565
|
+
}
|
|
566
|
+
OverlayKeyboardDispatcher.ɵprov = ɵɵdefineInjectable({ factory: function OverlayKeyboardDispatcher_Factory() { return new OverlayKeyboardDispatcher(ɵɵinject(DOCUMENT)); }, token: OverlayKeyboardDispatcher, providedIn: "root" });
|
|
567
|
+
OverlayKeyboardDispatcher.decorators = [
|
|
568
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
569
|
+
];
|
|
570
|
+
OverlayKeyboardDispatcher.ctorParameters = () => [
|
|
571
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
572
|
+
];
|
|
549
573
|
/** @docs-private @deprecated @breaking-change 8.0.0 */
|
|
550
574
|
function OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY(dispatcher, _document) {
|
|
551
575
|
return dispatcher || new OverlayKeyboardDispatcher(_document);
|
|
@@ -564,6 +588,93 @@ const OVERLAY_KEYBOARD_DISPATCHER_PROVIDER = {
|
|
|
564
588
|
useFactory: OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY
|
|
565
589
|
};
|
|
566
590
|
|
|
591
|
+
/**
|
|
592
|
+
* @license
|
|
593
|
+
* Copyright Google LLC All Rights Reserved.
|
|
594
|
+
*
|
|
595
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
596
|
+
* found in the LICENSE file at https://angular.io/license
|
|
597
|
+
*/
|
|
598
|
+
/**
|
|
599
|
+
* Service for dispatching mouse click events that land on the body to appropriate overlay ref,
|
|
600
|
+
* if any. It maintains a list of attached overlays to determine best suited overlay based
|
|
601
|
+
* on event target and order of overlay opens.
|
|
602
|
+
*/
|
|
603
|
+
class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
|
|
604
|
+
constructor(document, _platform) {
|
|
605
|
+
super(document);
|
|
606
|
+
this._platform = _platform;
|
|
607
|
+
this._cursorStyleIsSet = false;
|
|
608
|
+
/** Click event listener that will be attached to the body propagate phase. */
|
|
609
|
+
this._clickListener = (event) => {
|
|
610
|
+
// Get the target through the `composedPath` if possible to account for shadow DOM.
|
|
611
|
+
const target = event.composedPath ? event.composedPath()[0] : event.target;
|
|
612
|
+
const overlays = this._attachedOverlays;
|
|
613
|
+
// Dispatch the mouse event to the top overlay which has subscribers to its mouse events.
|
|
614
|
+
// We want to target all overlays for which the click could be considered as outside click.
|
|
615
|
+
// As soon as we reach an overlay for which the click is not outside click we break off
|
|
616
|
+
// the loop.
|
|
617
|
+
for (let i = overlays.length - 1; i > -1; i--) {
|
|
618
|
+
const overlayRef = overlays[i];
|
|
619
|
+
if (overlayRef._outsidePointerEvents.observers.length < 1) {
|
|
620
|
+
continue;
|
|
621
|
+
}
|
|
622
|
+
const config = overlayRef.getConfig();
|
|
623
|
+
const excludeElements = [...config.excludeFromOutsideClick, overlayRef.overlayElement];
|
|
624
|
+
const isInsideClick = excludeElements.some(e => e.contains(target));
|
|
625
|
+
// If it is inside click just break - we should do nothing
|
|
626
|
+
// If it is outside click dispatch the mouse event, and proceed with the next overlay
|
|
627
|
+
if (isInsideClick) {
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
overlayRef._outsidePointerEvents.next(event);
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
/** Add a new overlay to the list of attached overlay refs. */
|
|
635
|
+
add(overlayRef) {
|
|
636
|
+
super.add(overlayRef);
|
|
637
|
+
// tslint:disable: max-line-length
|
|
638
|
+
// Safari on iOS does not generate click events for non-interactive
|
|
639
|
+
// elements. However, we want to receive a click for any element outside
|
|
640
|
+
// the overlay. We can force a "clickable" state by setting
|
|
641
|
+
// `cursor: pointer` on the document body.
|
|
642
|
+
// See https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#Safari_Mobile
|
|
643
|
+
// and https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
|
|
644
|
+
// tslint:enable: max-line-length
|
|
645
|
+
if (!this._isAttached) {
|
|
646
|
+
this._document.body.addEventListener('click', this._clickListener, true);
|
|
647
|
+
// click event is not fired on iOS. To make element "clickable" we are
|
|
648
|
+
// setting the cursor to pointer
|
|
649
|
+
if (this._platform.IOS && !this._cursorStyleIsSet) {
|
|
650
|
+
this._cursorOriginalValue = this._document.body.style.cursor;
|
|
651
|
+
this._document.body.style.cursor = 'pointer';
|
|
652
|
+
this._cursorStyleIsSet = true;
|
|
653
|
+
}
|
|
654
|
+
this._isAttached = true;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
/** Detaches the global keyboard event listener. */
|
|
658
|
+
detach() {
|
|
659
|
+
if (this._isAttached) {
|
|
660
|
+
this._document.body.removeEventListener('click', this._clickListener, true);
|
|
661
|
+
if (this._platform.IOS && this._cursorStyleIsSet) {
|
|
662
|
+
this._document.body.style.cursor = this._cursorOriginalValue;
|
|
663
|
+
this._cursorStyleIsSet = false;
|
|
664
|
+
}
|
|
665
|
+
this._isAttached = false;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
OverlayOutsideClickDispatcher.ɵprov = ɵɵdefineInjectable({ factory: function OverlayOutsideClickDispatcher_Factory() { return new OverlayOutsideClickDispatcher(ɵɵinject(DOCUMENT), ɵɵinject(Platform)); }, token: OverlayOutsideClickDispatcher, providedIn: "root" });
|
|
670
|
+
OverlayOutsideClickDispatcher.decorators = [
|
|
671
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
672
|
+
];
|
|
673
|
+
OverlayOutsideClickDispatcher.ctorParameters = () => [
|
|
674
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
675
|
+
{ type: Platform }
|
|
676
|
+
];
|
|
677
|
+
|
|
567
678
|
/**
|
|
568
679
|
* @license
|
|
569
680
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -578,83 +689,80 @@ const OVERLAY_KEYBOARD_DISPATCHER_PROVIDER = {
|
|
|
578
689
|
const isTestEnvironment = typeof window !== 'undefined' && !!window &&
|
|
579
690
|
!!(window.__karma__ || window.jasmine);
|
|
580
691
|
/** Container inside which all overlays will render. */
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
_platform
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
container.parentNode.removeChild(container);
|
|
596
|
-
}
|
|
692
|
+
class OverlayContainer {
|
|
693
|
+
constructor(document,
|
|
694
|
+
/**
|
|
695
|
+
* @deprecated `platform` parameter to become required.
|
|
696
|
+
* @breaking-change 10.0.0
|
|
697
|
+
*/
|
|
698
|
+
_platform) {
|
|
699
|
+
this._platform = _platform;
|
|
700
|
+
this._document = document;
|
|
701
|
+
}
|
|
702
|
+
ngOnDestroy() {
|
|
703
|
+
const container = this._containerElement;
|
|
704
|
+
if (container && container.parentNode) {
|
|
705
|
+
container.parentNode.removeChild(container);
|
|
597
706
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
return this._containerElement;
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* This method returns the overlay container element. It will lazily
|
|
710
|
+
* create the element the first time it is called to facilitate using
|
|
711
|
+
* the container in non-browser environments.
|
|
712
|
+
* @returns the container element
|
|
713
|
+
*/
|
|
714
|
+
getContainerElement() {
|
|
715
|
+
if (!this._containerElement) {
|
|
716
|
+
this._createContainer();
|
|
609
717
|
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
const container = this._document.createElement('div');
|
|
628
|
-
container.classList.add(containerClass);
|
|
629
|
-
// A long time ago we kept adding new overlay containers whenever a new app was instantiated,
|
|
630
|
-
// but at some point we added logic which clears the duplicate ones in order to avoid leaks.
|
|
631
|
-
// The new logic was a little too aggressive since it was breaking some legitimate use cases.
|
|
632
|
-
// To mitigate the problem we made it so that only containers from a different platform are
|
|
633
|
-
// cleared, but the side-effect was that people started depending on the overly-aggressive
|
|
634
|
-
// logic to clean up their tests for them. Until we can introduce an overlay-specific testing
|
|
635
|
-
// module which does the cleanup, we try to detect that we're in a test environment and we
|
|
636
|
-
// always clear the container. See #17006.
|
|
637
|
-
// TODO(crisbeto): remove the test environment check once we have an overlay testing module.
|
|
638
|
-
if (isTestEnvironment) {
|
|
639
|
-
container.setAttribute('platform', 'test');
|
|
640
|
-
}
|
|
641
|
-
else if (!isBrowser) {
|
|
642
|
-
container.setAttribute('platform', 'server');
|
|
718
|
+
return this._containerElement;
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Create the overlay container element, which is simply a div
|
|
722
|
+
* with the 'cdk-overlay-container' class on the document body.
|
|
723
|
+
*/
|
|
724
|
+
_createContainer() {
|
|
725
|
+
// @breaking-change 10.0.0 Remove null check for `_platform`.
|
|
726
|
+
const isBrowser = this._platform ? this._platform.isBrowser : typeof window !== 'undefined';
|
|
727
|
+
const containerClass = 'cdk-overlay-container';
|
|
728
|
+
if (isBrowser || isTestEnvironment) {
|
|
729
|
+
const oppositePlatformContainers = this._document.querySelectorAll(`.${containerClass}[platform="server"], ` +
|
|
730
|
+
`.${containerClass}[platform="test"]`);
|
|
731
|
+
// Remove any old containers from the opposite platform.
|
|
732
|
+
// This can happen when transitioning from the server to the client.
|
|
733
|
+
for (let i = 0; i < oppositePlatformContainers.length; i++) {
|
|
734
|
+
oppositePlatformContainers[i].parentNode.removeChild(oppositePlatformContainers[i]);
|
|
643
735
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
736
|
+
}
|
|
737
|
+
const container = this._document.createElement('div');
|
|
738
|
+
container.classList.add(containerClass);
|
|
739
|
+
// A long time ago we kept adding new overlay containers whenever a new app was instantiated,
|
|
740
|
+
// but at some point we added logic which clears the duplicate ones in order to avoid leaks.
|
|
741
|
+
// The new logic was a little too aggressive since it was breaking some legitimate use cases.
|
|
742
|
+
// To mitigate the problem we made it so that only containers from a different platform are
|
|
743
|
+
// cleared, but the side-effect was that people started depending on the overly-aggressive
|
|
744
|
+
// logic to clean up their tests for them. Until we can introduce an overlay-specific testing
|
|
745
|
+
// module which does the cleanup, we try to detect that we're in a test environment and we
|
|
746
|
+
// always clear the container. See #17006.
|
|
747
|
+
// TODO(crisbeto): remove the test environment check once we have an overlay testing module.
|
|
748
|
+
if (isTestEnvironment) {
|
|
749
|
+
container.setAttribute('platform', 'test');
|
|
750
|
+
}
|
|
751
|
+
else if (!isBrowser) {
|
|
752
|
+
container.setAttribute('platform', 'server');
|
|
753
|
+
}
|
|
754
|
+
this._document.body.appendChild(container);
|
|
755
|
+
this._containerElement = container;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
OverlayContainer.ɵprov = ɵɵdefineInjectable({ factory: function OverlayContainer_Factory() { return new OverlayContainer(ɵɵinject(DOCUMENT), ɵɵinject(Platform)); }, token: OverlayContainer, providedIn: "root" });
|
|
759
|
+
OverlayContainer.decorators = [
|
|
760
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
761
|
+
];
|
|
762
|
+
OverlayContainer.ctorParameters = () => [
|
|
763
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
764
|
+
{ type: Platform }
|
|
765
|
+
];
|
|
658
766
|
/** @docs-private @deprecated @breaking-change 8.0.0 */
|
|
659
767
|
function OVERLAY_CONTAINER_PROVIDER_FACTORY(parentContainer, _document) {
|
|
660
768
|
return parentContainer || new OverlayContainer(_document);
|
|
@@ -684,7 +792,9 @@ const OVERLAY_CONTAINER_PROVIDER = {
|
|
|
684
792
|
class OverlayRef {
|
|
685
793
|
constructor(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document,
|
|
686
794
|
// @breaking-change 8.0.0 `_location` parameter to be made required.
|
|
687
|
-
_location
|
|
795
|
+
_location,
|
|
796
|
+
// @breaking-change 9.0.0 `_mouseClickDispatcher` parameter to be made required.
|
|
797
|
+
_outsideClickDispatcher) {
|
|
688
798
|
this._portalOutlet = _portalOutlet;
|
|
689
799
|
this._host = _host;
|
|
690
800
|
this._pane = _pane;
|
|
@@ -693,6 +803,7 @@ class OverlayRef {
|
|
|
693
803
|
this._keyboardDispatcher = _keyboardDispatcher;
|
|
694
804
|
this._document = _document;
|
|
695
805
|
this._location = _location;
|
|
806
|
+
this._outsideClickDispatcher = _outsideClickDispatcher;
|
|
696
807
|
this._backdropElement = null;
|
|
697
808
|
this._backdropClick = new Subject();
|
|
698
809
|
this._attachments = new Subject();
|
|
@@ -701,6 +812,8 @@ class OverlayRef {
|
|
|
701
812
|
this._backdropClickHandler = (event) => this._backdropClick.next(event);
|
|
702
813
|
/** Stream of keydown events dispatched to this overlay. */
|
|
703
814
|
this._keydownEvents = new Subject();
|
|
815
|
+
/** Stream of mouse outside events dispatched to this overlay. */
|
|
816
|
+
this._outsidePointerEvents = new Subject();
|
|
704
817
|
if (_config.scrollStrategy) {
|
|
705
818
|
this._scrollStrategy = _config.scrollStrategy;
|
|
706
819
|
this._scrollStrategy.attach(this);
|
|
@@ -774,6 +887,10 @@ class OverlayRef {
|
|
|
774
887
|
if (this._config.disposeOnNavigation && this._location) {
|
|
775
888
|
this._locationChanges = this._location.subscribe(() => this.dispose());
|
|
776
889
|
}
|
|
890
|
+
// @breaking-change 9.0.0 remove the null check for `_mouseClickDispatcher`
|
|
891
|
+
if (this._outsideClickDispatcher) {
|
|
892
|
+
this._outsideClickDispatcher.add(this);
|
|
893
|
+
}
|
|
777
894
|
return attachResult;
|
|
778
895
|
}
|
|
779
896
|
/**
|
|
@@ -805,6 +922,10 @@ class OverlayRef {
|
|
|
805
922
|
this._detachContentWhenStable();
|
|
806
923
|
// Stop listening for location changes.
|
|
807
924
|
this._locationChanges.unsubscribe();
|
|
925
|
+
// @breaking-change 9.0.0 remove the null check for `_outsideClickDispatcher`
|
|
926
|
+
if (this._outsideClickDispatcher) {
|
|
927
|
+
this._outsideClickDispatcher.remove(this);
|
|
928
|
+
}
|
|
808
929
|
return detachmentResult;
|
|
809
930
|
}
|
|
810
931
|
/** Cleans up the overlay from the DOM. */
|
|
@@ -821,6 +942,11 @@ class OverlayRef {
|
|
|
821
942
|
this._attachments.complete();
|
|
822
943
|
this._backdropClick.complete();
|
|
823
944
|
this._keydownEvents.complete();
|
|
945
|
+
this._outsidePointerEvents.complete();
|
|
946
|
+
// @breaking-change 9.0.0 remove the null check for `_outsideClickDispatcher`
|
|
947
|
+
if (this._outsideClickDispatcher) {
|
|
948
|
+
this._outsideClickDispatcher.remove(this);
|
|
949
|
+
}
|
|
824
950
|
if (this._host && this._host.parentNode) {
|
|
825
951
|
this._host.parentNode.removeChild(this._host);
|
|
826
952
|
this._host = null;
|
|
@@ -851,6 +977,10 @@ class OverlayRef {
|
|
|
851
977
|
keydownEvents() {
|
|
852
978
|
return this._keydownEvents.asObservable();
|
|
853
979
|
}
|
|
980
|
+
/** Gets an observable of pointer events targeted outside this overlay. */
|
|
981
|
+
outsidePointerEvents() {
|
|
982
|
+
return this._outsidePointerEvents.asObservable();
|
|
983
|
+
}
|
|
854
984
|
/** Gets the current overlay configuration, which is immutable. */
|
|
855
985
|
getConfig() {
|
|
856
986
|
return this._config;
|
|
@@ -2360,51 +2490,48 @@ class GlobalPositionStrategy {
|
|
|
2360
2490
|
* found in the LICENSE file at https://angular.io/license
|
|
2361
2491
|
*/
|
|
2362
2492
|
/** Builder for overlay position strategy. */
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
];
|
|
2406
|
-
return OverlayPositionBuilder;
|
|
2407
|
-
})();
|
|
2493
|
+
class OverlayPositionBuilder {
|
|
2494
|
+
constructor(_viewportRuler, _document, _platform, _overlayContainer) {
|
|
2495
|
+
this._viewportRuler = _viewportRuler;
|
|
2496
|
+
this._document = _document;
|
|
2497
|
+
this._platform = _platform;
|
|
2498
|
+
this._overlayContainer = _overlayContainer;
|
|
2499
|
+
}
|
|
2500
|
+
/**
|
|
2501
|
+
* Creates a global position strategy.
|
|
2502
|
+
*/
|
|
2503
|
+
global() {
|
|
2504
|
+
return new GlobalPositionStrategy();
|
|
2505
|
+
}
|
|
2506
|
+
/**
|
|
2507
|
+
* Creates a relative position strategy.
|
|
2508
|
+
* @param elementRef
|
|
2509
|
+
* @param originPos
|
|
2510
|
+
* @param overlayPos
|
|
2511
|
+
* @deprecated Use `flexibleConnectedTo` instead.
|
|
2512
|
+
* @breaking-change 8.0.0
|
|
2513
|
+
*/
|
|
2514
|
+
connectedTo(elementRef, originPos, overlayPos) {
|
|
2515
|
+
return new ConnectedPositionStrategy(originPos, overlayPos, elementRef, this._viewportRuler, this._document, this._platform, this._overlayContainer);
|
|
2516
|
+
}
|
|
2517
|
+
/**
|
|
2518
|
+
* Creates a flexible position strategy.
|
|
2519
|
+
* @param origin Origin relative to which to position the overlay.
|
|
2520
|
+
*/
|
|
2521
|
+
flexibleConnectedTo(origin) {
|
|
2522
|
+
return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document, this._platform, this._overlayContainer);
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
OverlayPositionBuilder.ɵprov = ɵɵdefineInjectable({ factory: function OverlayPositionBuilder_Factory() { return new OverlayPositionBuilder(ɵɵinject(ViewportRuler), ɵɵinject(DOCUMENT), ɵɵinject(Platform), ɵɵinject(OverlayContainer)); }, token: OverlayPositionBuilder, providedIn: "root" });
|
|
2526
|
+
OverlayPositionBuilder.decorators = [
|
|
2527
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
2528
|
+
];
|
|
2529
|
+
OverlayPositionBuilder.ctorParameters = () => [
|
|
2530
|
+
{ type: ViewportRuler },
|
|
2531
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
2532
|
+
{ type: Platform },
|
|
2533
|
+
{ type: OverlayContainer }
|
|
2534
|
+
];
|
|
2408
2535
|
|
|
2409
2536
|
/**
|
|
2410
2537
|
* @license
|
|
@@ -2425,97 +2552,98 @@ let nextUniqueId = 0;
|
|
|
2425
2552
|
*
|
|
2426
2553
|
* An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.
|
|
2427
2554
|
*/
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2555
|
+
class Overlay {
|
|
2556
|
+
constructor(
|
|
2557
|
+
/** Scrolling strategies that can be used when creating an overlay. */
|
|
2558
|
+
scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality,
|
|
2559
|
+
// @breaking-change 8.0.0 `_location` parameter to be made required.
|
|
2560
|
+
_location,
|
|
2561
|
+
// @breaking-change 9.0.0 `_outsideClickDispatcher` parameter to be made required.
|
|
2562
|
+
_outsideClickDispatcher) {
|
|
2563
|
+
this.scrollStrategies = scrollStrategies;
|
|
2564
|
+
this._overlayContainer = _overlayContainer;
|
|
2565
|
+
this._componentFactoryResolver = _componentFactoryResolver;
|
|
2566
|
+
this._positionBuilder = _positionBuilder;
|
|
2567
|
+
this._keyboardDispatcher = _keyboardDispatcher;
|
|
2568
|
+
this._injector = _injector;
|
|
2569
|
+
this._ngZone = _ngZone;
|
|
2570
|
+
this._document = _document;
|
|
2571
|
+
this._directionality = _directionality;
|
|
2572
|
+
this._location = _location;
|
|
2573
|
+
this._outsideClickDispatcher = _outsideClickDispatcher;
|
|
2574
|
+
}
|
|
2575
|
+
/**
|
|
2576
|
+
* Creates an overlay.
|
|
2577
|
+
* @param config Configuration applied to the overlay.
|
|
2578
|
+
* @returns Reference to the created overlay.
|
|
2579
|
+
*/
|
|
2580
|
+
create(config) {
|
|
2581
|
+
const host = this._createHostElement();
|
|
2582
|
+
const pane = this._createPaneElement(host);
|
|
2583
|
+
const portalOutlet = this._createPortalOutlet(pane);
|
|
2584
|
+
const overlayConfig = new OverlayConfig(config);
|
|
2585
|
+
overlayConfig.direction = overlayConfig.direction || this._directionality.value;
|
|
2586
|
+
return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location, this._outsideClickDispatcher);
|
|
2587
|
+
}
|
|
2588
|
+
/**
|
|
2589
|
+
* Gets a position builder that can be used, via fluent API,
|
|
2590
|
+
* to construct and configure a position strategy.
|
|
2591
|
+
* @returns An overlay position builder.
|
|
2592
|
+
*/
|
|
2593
|
+
position() {
|
|
2594
|
+
return this._positionBuilder;
|
|
2595
|
+
}
|
|
2596
|
+
/**
|
|
2597
|
+
* Creates the DOM element for an overlay and appends it to the overlay container.
|
|
2598
|
+
* @returns Newly-created pane element
|
|
2599
|
+
*/
|
|
2600
|
+
_createPaneElement(host) {
|
|
2601
|
+
const pane = this._document.createElement('div');
|
|
2602
|
+
pane.id = `cdk-overlay-${nextUniqueId++}`;
|
|
2603
|
+
pane.classList.add('cdk-overlay-pane');
|
|
2604
|
+
host.appendChild(pane);
|
|
2605
|
+
return pane;
|
|
2606
|
+
}
|
|
2607
|
+
/**
|
|
2608
|
+
* Creates the host element that wraps around an overlay
|
|
2609
|
+
* and can be used for advanced positioning.
|
|
2610
|
+
* @returns Newly-create host element.
|
|
2611
|
+
*/
|
|
2612
|
+
_createHostElement() {
|
|
2613
|
+
const host = this._document.createElement('div');
|
|
2614
|
+
this._overlayContainer.getContainerElement().appendChild(host);
|
|
2615
|
+
return host;
|
|
2616
|
+
}
|
|
2617
|
+
/**
|
|
2618
|
+
* Create a DomPortalOutlet into which the overlay content can be loaded.
|
|
2619
|
+
* @param pane The DOM element to turn into a portal outlet.
|
|
2620
|
+
* @returns A portal outlet for the given DOM element.
|
|
2621
|
+
*/
|
|
2622
|
+
_createPortalOutlet(pane) {
|
|
2623
|
+
// We have to resolve the ApplicationRef later in order to allow people
|
|
2624
|
+
// to use overlay-based providers during app initialization.
|
|
2625
|
+
if (!this._appRef) {
|
|
2626
|
+
this._appRef = this._injector.get(ApplicationRef);
|
|
2487
2627
|
}
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
]
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
{ type: OverlayContainer },
|
|
2508
|
-
{ type: ComponentFactoryResolver },
|
|
2509
|
-
{ type: OverlayPositionBuilder },
|
|
2510
|
-
{ type: OverlayKeyboardDispatcher },
|
|
2511
|
-
{ type: Injector },
|
|
2512
|
-
{ type: NgZone },
|
|
2513
|
-
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
2514
|
-
{ type: Directionality },
|
|
2515
|
-
{ type: Location, decorators: [{ type: Optional }] }
|
|
2516
|
-
];
|
|
2517
|
-
return Overlay;
|
|
2518
|
-
})();
|
|
2628
|
+
return new DomPortalOutlet(pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
Overlay.decorators = [
|
|
2632
|
+
{ type: Injectable }
|
|
2633
|
+
];
|
|
2634
|
+
Overlay.ctorParameters = () => [
|
|
2635
|
+
{ type: ScrollStrategyOptions },
|
|
2636
|
+
{ type: OverlayContainer },
|
|
2637
|
+
{ type: ComponentFactoryResolver },
|
|
2638
|
+
{ type: OverlayPositionBuilder },
|
|
2639
|
+
{ type: OverlayKeyboardDispatcher },
|
|
2640
|
+
{ type: Injector },
|
|
2641
|
+
{ type: NgZone },
|
|
2642
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
2643
|
+
{ type: Directionality },
|
|
2644
|
+
{ type: Location, decorators: [{ type: Optional }] },
|
|
2645
|
+
{ type: OverlayOutsideClickDispatcher, decorators: [{ type: Optional }] }
|
|
2646
|
+
];
|
|
2519
2647
|
|
|
2520
2648
|
/**
|
|
2521
2649
|
* @license
|
|
@@ -2561,268 +2689,272 @@ function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_FACTORY(overlay) {
|
|
|
2561
2689
|
* Directive applied to an element to make it usable as an origin for an Overlay using a
|
|
2562
2690
|
* ConnectedPositionStrategy.
|
|
2563
2691
|
*/
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
elementRef
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
];
|
|
2581
|
-
return CdkOverlayOrigin;
|
|
2582
|
-
})();
|
|
2692
|
+
class CdkOverlayOrigin {
|
|
2693
|
+
constructor(
|
|
2694
|
+
/** Reference to the element on which the directive is applied. */
|
|
2695
|
+
elementRef) {
|
|
2696
|
+
this.elementRef = elementRef;
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
CdkOverlayOrigin.decorators = [
|
|
2700
|
+
{ type: Directive, args: [{
|
|
2701
|
+
selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',
|
|
2702
|
+
exportAs: 'cdkOverlayOrigin',
|
|
2703
|
+
},] }
|
|
2704
|
+
];
|
|
2705
|
+
CdkOverlayOrigin.ctorParameters = () => [
|
|
2706
|
+
{ type: ElementRef }
|
|
2707
|
+
];
|
|
2583
2708
|
/**
|
|
2584
2709
|
* Directive to facilitate declarative creation of an
|
|
2585
2710
|
* Overlay using a FlexibleConnectedPositionStrategy.
|
|
2586
2711
|
*/
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2712
|
+
class CdkConnectedOverlay {
|
|
2713
|
+
// TODO(jelbourn): inputs for size, scroll behavior, animation, etc.
|
|
2714
|
+
constructor(_overlay, templateRef, viewContainerRef, scrollStrategyFactory, _dir) {
|
|
2715
|
+
this._overlay = _overlay;
|
|
2716
|
+
this._dir = _dir;
|
|
2717
|
+
this._hasBackdrop = false;
|
|
2718
|
+
this._lockPosition = false;
|
|
2719
|
+
this._growAfterOpen = false;
|
|
2720
|
+
this._flexibleDimensions = false;
|
|
2721
|
+
this._push = false;
|
|
2722
|
+
this._backdropSubscription = Subscription.EMPTY;
|
|
2723
|
+
this._attachSubscription = Subscription.EMPTY;
|
|
2724
|
+
this._detachSubscription = Subscription.EMPTY;
|
|
2725
|
+
/** Margin between the overlay and the viewport edges. */
|
|
2726
|
+
this.viewportMargin = 0;
|
|
2727
|
+
/** Whether the overlay is open. */
|
|
2728
|
+
this.open = false;
|
|
2729
|
+
/** Event emitted when the backdrop is clicked. */
|
|
2730
|
+
this.backdropClick = new EventEmitter();
|
|
2731
|
+
/** Event emitted when the position has changed. */
|
|
2732
|
+
this.positionChange = new EventEmitter();
|
|
2733
|
+
/** Event emitted when the overlay has been attached. */
|
|
2734
|
+
this.attach = new EventEmitter();
|
|
2735
|
+
/** Event emitted when the overlay has been detached. */
|
|
2736
|
+
this.detach = new EventEmitter();
|
|
2737
|
+
/** Emits when there are keyboard events that are targeted at the overlay. */
|
|
2738
|
+
this.overlayKeydown = new EventEmitter();
|
|
2739
|
+
/** Emits when there are mouse outside click events that are targeted at the overlay. */
|
|
2740
|
+
this.overlayOutsideClick = new EventEmitter();
|
|
2741
|
+
this._templatePortal = new TemplatePortal(templateRef, viewContainerRef);
|
|
2742
|
+
this._scrollStrategyFactory = scrollStrategyFactory;
|
|
2743
|
+
this.scrollStrategy = this._scrollStrategyFactory();
|
|
2744
|
+
}
|
|
2745
|
+
/** The offset in pixels for the overlay connection point on the x-axis */
|
|
2746
|
+
get offsetX() { return this._offsetX; }
|
|
2747
|
+
set offsetX(offsetX) {
|
|
2748
|
+
this._offsetX = offsetX;
|
|
2749
|
+
if (this._position) {
|
|
2750
|
+
this._updatePositionStrategy(this._position);
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
/** The offset in pixels for the overlay connection point on the y-axis */
|
|
2754
|
+
get offsetY() { return this._offsetY; }
|
|
2755
|
+
set offsetY(offsetY) {
|
|
2756
|
+
this._offsetY = offsetY;
|
|
2757
|
+
if (this._position) {
|
|
2758
|
+
this._updatePositionStrategy(this._position);
|
|
2759
|
+
}
|
|
2760
|
+
}
|
|
2761
|
+
/** Whether or not the overlay should attach a backdrop. */
|
|
2762
|
+
get hasBackdrop() { return this._hasBackdrop; }
|
|
2763
|
+
set hasBackdrop(value) { this._hasBackdrop = coerceBooleanProperty(value); }
|
|
2764
|
+
/** Whether or not the overlay should be locked when scrolling. */
|
|
2765
|
+
get lockPosition() { return this._lockPosition; }
|
|
2766
|
+
set lockPosition(value) { this._lockPosition = coerceBooleanProperty(value); }
|
|
2767
|
+
/** Whether the overlay's width and height can be constrained to fit within the viewport. */
|
|
2768
|
+
get flexibleDimensions() { return this._flexibleDimensions; }
|
|
2769
|
+
set flexibleDimensions(value) {
|
|
2770
|
+
this._flexibleDimensions = coerceBooleanProperty(value);
|
|
2771
|
+
}
|
|
2772
|
+
/** Whether the overlay can grow after the initial open when flexible positioning is turned on. */
|
|
2773
|
+
get growAfterOpen() { return this._growAfterOpen; }
|
|
2774
|
+
set growAfterOpen(value) { this._growAfterOpen = coerceBooleanProperty(value); }
|
|
2775
|
+
/** Whether the overlay can be pushed on-screen if none of the provided positions fit. */
|
|
2776
|
+
get push() { return this._push; }
|
|
2777
|
+
set push(value) { this._push = coerceBooleanProperty(value); }
|
|
2778
|
+
/** The associated overlay reference. */
|
|
2779
|
+
get overlayRef() {
|
|
2780
|
+
return this._overlayRef;
|
|
2781
|
+
}
|
|
2782
|
+
/** The element's layout direction. */
|
|
2783
|
+
get dir() {
|
|
2784
|
+
return this._dir ? this._dir.value : 'ltr';
|
|
2785
|
+
}
|
|
2786
|
+
ngOnDestroy() {
|
|
2787
|
+
this._attachSubscription.unsubscribe();
|
|
2788
|
+
this._detachSubscription.unsubscribe();
|
|
2789
|
+
this._backdropSubscription.unsubscribe();
|
|
2790
|
+
if (this._overlayRef) {
|
|
2791
|
+
this._overlayRef.dispose();
|
|
2624
2792
|
}
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
this.
|
|
2629
|
-
|
|
2630
|
-
this.
|
|
2793
|
+
}
|
|
2794
|
+
ngOnChanges(changes) {
|
|
2795
|
+
if (this._position) {
|
|
2796
|
+
this._updatePositionStrategy(this._position);
|
|
2797
|
+
this._overlayRef.updateSize({
|
|
2798
|
+
width: this.width,
|
|
2799
|
+
minWidth: this.minWidth,
|
|
2800
|
+
height: this.height,
|
|
2801
|
+
minHeight: this.minHeight,
|
|
2802
|
+
});
|
|
2803
|
+
if (changes['origin'] && this.open) {
|
|
2804
|
+
this._position.apply();
|
|
2631
2805
|
}
|
|
2632
2806
|
}
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
set hasBackdrop(value) { this._hasBackdrop = coerceBooleanProperty(value); }
|
|
2636
|
-
/** Whether or not the overlay should be locked when scrolling. */
|
|
2637
|
-
get lockPosition() { return this._lockPosition; }
|
|
2638
|
-
set lockPosition(value) { this._lockPosition = coerceBooleanProperty(value); }
|
|
2639
|
-
/** Whether the overlay's width and height can be constrained to fit within the viewport. */
|
|
2640
|
-
get flexibleDimensions() { return this._flexibleDimensions; }
|
|
2641
|
-
set flexibleDimensions(value) {
|
|
2642
|
-
this._flexibleDimensions = coerceBooleanProperty(value);
|
|
2643
|
-
}
|
|
2644
|
-
/** Whether the overlay can grow after the initial open when flexible positioning is turned on. */
|
|
2645
|
-
get growAfterOpen() { return this._growAfterOpen; }
|
|
2646
|
-
set growAfterOpen(value) { this._growAfterOpen = coerceBooleanProperty(value); }
|
|
2647
|
-
/** Whether the overlay can be pushed on-screen if none of the provided positions fit. */
|
|
2648
|
-
get push() { return this._push; }
|
|
2649
|
-
set push(value) { this._push = coerceBooleanProperty(value); }
|
|
2650
|
-
/** The associated overlay reference. */
|
|
2651
|
-
get overlayRef() {
|
|
2652
|
-
return this._overlayRef;
|
|
2653
|
-
}
|
|
2654
|
-
/** The element's layout direction. */
|
|
2655
|
-
get dir() {
|
|
2656
|
-
return this._dir ? this._dir.value : 'ltr';
|
|
2657
|
-
}
|
|
2658
|
-
ngOnDestroy() {
|
|
2659
|
-
if (this._overlayRef) {
|
|
2660
|
-
this._overlayRef.dispose();
|
|
2661
|
-
}
|
|
2662
|
-
this._backdropSubscription.unsubscribe();
|
|
2807
|
+
if (changes['open']) {
|
|
2808
|
+
this.open ? this._attachOverlay() : this._detachOverlay();
|
|
2663
2809
|
}
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
minWidth: this.minWidth,
|
|
2670
|
-
height: this.height,
|
|
2671
|
-
minHeight: this.minHeight,
|
|
2672
|
-
});
|
|
2673
|
-
if (changes['origin'] && this.open) {
|
|
2674
|
-
this._position.apply();
|
|
2675
|
-
}
|
|
2676
|
-
}
|
|
2677
|
-
if (changes['open']) {
|
|
2678
|
-
this.open ? this._attachOverlay() : this._detachOverlay();
|
|
2679
|
-
}
|
|
2810
|
+
}
|
|
2811
|
+
/** Creates an overlay */
|
|
2812
|
+
_createOverlay() {
|
|
2813
|
+
if (!this.positions || !this.positions.length) {
|
|
2814
|
+
this.positions = defaultPositionList;
|
|
2680
2815
|
}
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2816
|
+
const overlayRef = this._overlayRef = this._overlay.create(this._buildConfig());
|
|
2817
|
+
this._attachSubscription = overlayRef.attachments().subscribe(() => this.attach.emit());
|
|
2818
|
+
this._detachSubscription = overlayRef.detachments().subscribe(() => this.detach.emit());
|
|
2819
|
+
overlayRef.keydownEvents().subscribe((event) => {
|
|
2820
|
+
this.overlayKeydown.next(event);
|
|
2821
|
+
if (event.keyCode === ESCAPE && !hasModifierKey(event)) {
|
|
2822
|
+
event.preventDefault();
|
|
2823
|
+
this._detachOverlay();
|
|
2685
2824
|
}
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2825
|
+
});
|
|
2826
|
+
this._overlayRef.outsidePointerEvents().subscribe((event) => {
|
|
2827
|
+
this.overlayOutsideClick.next(event);
|
|
2828
|
+
});
|
|
2829
|
+
}
|
|
2830
|
+
/** Builds the overlay config based on the directive's inputs */
|
|
2831
|
+
_buildConfig() {
|
|
2832
|
+
const positionStrategy = this._position =
|
|
2833
|
+
this.positionStrategy || this._createPositionStrategy();
|
|
2834
|
+
const overlayConfig = new OverlayConfig({
|
|
2835
|
+
direction: this._dir,
|
|
2836
|
+
positionStrategy,
|
|
2837
|
+
scrollStrategy: this.scrollStrategy,
|
|
2838
|
+
hasBackdrop: this.hasBackdrop
|
|
2839
|
+
});
|
|
2840
|
+
if (this.width || this.width === 0) {
|
|
2841
|
+
overlayConfig.width = this.width;
|
|
2842
|
+
}
|
|
2843
|
+
if (this.height || this.height === 0) {
|
|
2844
|
+
overlayConfig.height = this.height;
|
|
2845
|
+
}
|
|
2846
|
+
if (this.minWidth || this.minWidth === 0) {
|
|
2847
|
+
overlayConfig.minWidth = this.minWidth;
|
|
2848
|
+
}
|
|
2849
|
+
if (this.minHeight || this.minHeight === 0) {
|
|
2850
|
+
overlayConfig.minHeight = this.minHeight;
|
|
2851
|
+
}
|
|
2852
|
+
if (this.backdropClass) {
|
|
2853
|
+
overlayConfig.backdropClass = this.backdropClass;
|
|
2854
|
+
}
|
|
2855
|
+
if (this.panelClass) {
|
|
2856
|
+
overlayConfig.panelClass = this.panelClass;
|
|
2857
|
+
}
|
|
2858
|
+
return overlayConfig;
|
|
2859
|
+
}
|
|
2860
|
+
/** Updates the state of a position strategy, based on the values of the directive inputs. */
|
|
2861
|
+
_updatePositionStrategy(positionStrategy) {
|
|
2862
|
+
const positions = this.positions.map(currentPosition => ({
|
|
2863
|
+
originX: currentPosition.originX,
|
|
2864
|
+
originY: currentPosition.originY,
|
|
2865
|
+
overlayX: currentPosition.overlayX,
|
|
2866
|
+
overlayY: currentPosition.overlayY,
|
|
2867
|
+
offsetX: currentPosition.offsetX || this.offsetX,
|
|
2868
|
+
offsetY: currentPosition.offsetY || this.offsetY,
|
|
2869
|
+
panelClass: currentPosition.panelClass || undefined,
|
|
2870
|
+
}));
|
|
2871
|
+
return positionStrategy
|
|
2872
|
+
.setOrigin(this.origin.elementRef)
|
|
2873
|
+
.withPositions(positions)
|
|
2874
|
+
.withFlexibleDimensions(this.flexibleDimensions)
|
|
2875
|
+
.withPush(this.push)
|
|
2876
|
+
.withGrowAfterOpen(this.growAfterOpen)
|
|
2877
|
+
.withViewportMargin(this.viewportMargin)
|
|
2878
|
+
.withLockedPosition(this.lockPosition)
|
|
2879
|
+
.withTransformOriginOn(this.transformOriginSelector);
|
|
2880
|
+
}
|
|
2881
|
+
/** Returns the position strategy of the overlay to be set on the overlay config */
|
|
2882
|
+
_createPositionStrategy() {
|
|
2883
|
+
const strategy = this._overlay.position().flexibleConnectedTo(this.origin.elementRef);
|
|
2884
|
+
this._updatePositionStrategy(strategy);
|
|
2885
|
+
strategy.positionChanges.subscribe(p => this.positionChange.emit(p));
|
|
2886
|
+
return strategy;
|
|
2887
|
+
}
|
|
2888
|
+
/** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */
|
|
2889
|
+
_attachOverlay() {
|
|
2890
|
+
if (!this._overlayRef) {
|
|
2891
|
+
this._createOverlay();
|
|
2892
|
+
}
|
|
2893
|
+
else {
|
|
2894
|
+
// Update the overlay size, in case the directive's inputs have changed
|
|
2895
|
+
this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;
|
|
2694
2896
|
}
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
positionStrategy,
|
|
2702
|
-
scrollStrategy: this.scrollStrategy,
|
|
2703
|
-
hasBackdrop: this.hasBackdrop
|
|
2897
|
+
if (!this._overlayRef.hasAttached()) {
|
|
2898
|
+
this._overlayRef.attach(this._templatePortal);
|
|
2899
|
+
}
|
|
2900
|
+
if (this.hasBackdrop) {
|
|
2901
|
+
this._backdropSubscription = this._overlayRef.backdropClick().subscribe(event => {
|
|
2902
|
+
this.backdropClick.emit(event);
|
|
2704
2903
|
});
|
|
2705
|
-
if (this.width || this.width === 0) {
|
|
2706
|
-
overlayConfig.width = this.width;
|
|
2707
|
-
}
|
|
2708
|
-
if (this.height || this.height === 0) {
|
|
2709
|
-
overlayConfig.height = this.height;
|
|
2710
|
-
}
|
|
2711
|
-
if (this.minWidth || this.minWidth === 0) {
|
|
2712
|
-
overlayConfig.minWidth = this.minWidth;
|
|
2713
|
-
}
|
|
2714
|
-
if (this.minHeight || this.minHeight === 0) {
|
|
2715
|
-
overlayConfig.minHeight = this.minHeight;
|
|
2716
|
-
}
|
|
2717
|
-
if (this.backdropClass) {
|
|
2718
|
-
overlayConfig.backdropClass = this.backdropClass;
|
|
2719
|
-
}
|
|
2720
|
-
if (this.panelClass) {
|
|
2721
|
-
overlayConfig.panelClass = this.panelClass;
|
|
2722
|
-
}
|
|
2723
|
-
return overlayConfig;
|
|
2724
|
-
}
|
|
2725
|
-
/** Updates the state of a position strategy, based on the values of the directive inputs. */
|
|
2726
|
-
_updatePositionStrategy(positionStrategy) {
|
|
2727
|
-
const positions = this.positions.map(currentPosition => ({
|
|
2728
|
-
originX: currentPosition.originX,
|
|
2729
|
-
originY: currentPosition.originY,
|
|
2730
|
-
overlayX: currentPosition.overlayX,
|
|
2731
|
-
overlayY: currentPosition.overlayY,
|
|
2732
|
-
offsetX: currentPosition.offsetX || this.offsetX,
|
|
2733
|
-
offsetY: currentPosition.offsetY || this.offsetY,
|
|
2734
|
-
panelClass: currentPosition.panelClass || undefined,
|
|
2735
|
-
}));
|
|
2736
|
-
return positionStrategy
|
|
2737
|
-
.setOrigin(this.origin.elementRef)
|
|
2738
|
-
.withPositions(positions)
|
|
2739
|
-
.withFlexibleDimensions(this.flexibleDimensions)
|
|
2740
|
-
.withPush(this.push)
|
|
2741
|
-
.withGrowAfterOpen(this.growAfterOpen)
|
|
2742
|
-
.withViewportMargin(this.viewportMargin)
|
|
2743
|
-
.withLockedPosition(this.lockPosition)
|
|
2744
|
-
.withTransformOriginOn(this.transformOriginSelector);
|
|
2745
|
-
}
|
|
2746
|
-
/** Returns the position strategy of the overlay to be set on the overlay config */
|
|
2747
|
-
_createPositionStrategy() {
|
|
2748
|
-
const strategy = this._overlay.position().flexibleConnectedTo(this.origin.elementRef);
|
|
2749
|
-
this._updatePositionStrategy(strategy);
|
|
2750
|
-
strategy.positionChanges.subscribe(p => this.positionChange.emit(p));
|
|
2751
|
-
return strategy;
|
|
2752
|
-
}
|
|
2753
|
-
/** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */
|
|
2754
|
-
_attachOverlay() {
|
|
2755
|
-
if (!this._overlayRef) {
|
|
2756
|
-
this._createOverlay();
|
|
2757
|
-
}
|
|
2758
|
-
else {
|
|
2759
|
-
// Update the overlay size, in case the directive's inputs have changed
|
|
2760
|
-
this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;
|
|
2761
|
-
}
|
|
2762
|
-
if (!this._overlayRef.hasAttached()) {
|
|
2763
|
-
this._overlayRef.attach(this._templatePortal);
|
|
2764
|
-
this.attach.emit();
|
|
2765
|
-
}
|
|
2766
|
-
if (this.hasBackdrop) {
|
|
2767
|
-
this._backdropSubscription = this._overlayRef.backdropClick().subscribe(event => {
|
|
2768
|
-
this.backdropClick.emit(event);
|
|
2769
|
-
});
|
|
2770
|
-
}
|
|
2771
|
-
else {
|
|
2772
|
-
this._backdropSubscription.unsubscribe();
|
|
2773
|
-
}
|
|
2774
2904
|
}
|
|
2775
|
-
|
|
2776
|
-
_detachOverlay() {
|
|
2777
|
-
if (this._overlayRef) {
|
|
2778
|
-
this._overlayRef.detach();
|
|
2779
|
-
this.detach.emit();
|
|
2780
|
-
}
|
|
2905
|
+
else {
|
|
2781
2906
|
this._backdropSubscription.unsubscribe();
|
|
2782
2907
|
}
|
|
2783
2908
|
}
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
}
|
|
2824
|
-
|
|
2825
|
-
}
|
|
2909
|
+
/** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */
|
|
2910
|
+
_detachOverlay() {
|
|
2911
|
+
if (this._overlayRef) {
|
|
2912
|
+
this._overlayRef.detach();
|
|
2913
|
+
}
|
|
2914
|
+
this._backdropSubscription.unsubscribe();
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
CdkConnectedOverlay.decorators = [
|
|
2918
|
+
{ type: Directive, args: [{
|
|
2919
|
+
selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',
|
|
2920
|
+
exportAs: 'cdkConnectedOverlay'
|
|
2921
|
+
},] }
|
|
2922
|
+
];
|
|
2923
|
+
CdkConnectedOverlay.ctorParameters = () => [
|
|
2924
|
+
{ type: Overlay },
|
|
2925
|
+
{ type: TemplateRef },
|
|
2926
|
+
{ type: ViewContainerRef },
|
|
2927
|
+
{ type: undefined, decorators: [{ type: Inject, args: [CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,] }] },
|
|
2928
|
+
{ type: Directionality, decorators: [{ type: Optional }] }
|
|
2929
|
+
];
|
|
2930
|
+
CdkConnectedOverlay.propDecorators = {
|
|
2931
|
+
origin: [{ type: Input, args: ['cdkConnectedOverlayOrigin',] }],
|
|
2932
|
+
positions: [{ type: Input, args: ['cdkConnectedOverlayPositions',] }],
|
|
2933
|
+
positionStrategy: [{ type: Input, args: ['cdkConnectedOverlayPositionStrategy',] }],
|
|
2934
|
+
offsetX: [{ type: Input, args: ['cdkConnectedOverlayOffsetX',] }],
|
|
2935
|
+
offsetY: [{ type: Input, args: ['cdkConnectedOverlayOffsetY',] }],
|
|
2936
|
+
width: [{ type: Input, args: ['cdkConnectedOverlayWidth',] }],
|
|
2937
|
+
height: [{ type: Input, args: ['cdkConnectedOverlayHeight',] }],
|
|
2938
|
+
minWidth: [{ type: Input, args: ['cdkConnectedOverlayMinWidth',] }],
|
|
2939
|
+
minHeight: [{ type: Input, args: ['cdkConnectedOverlayMinHeight',] }],
|
|
2940
|
+
backdropClass: [{ type: Input, args: ['cdkConnectedOverlayBackdropClass',] }],
|
|
2941
|
+
panelClass: [{ type: Input, args: ['cdkConnectedOverlayPanelClass',] }],
|
|
2942
|
+
viewportMargin: [{ type: Input, args: ['cdkConnectedOverlayViewportMargin',] }],
|
|
2943
|
+
scrollStrategy: [{ type: Input, args: ['cdkConnectedOverlayScrollStrategy',] }],
|
|
2944
|
+
open: [{ type: Input, args: ['cdkConnectedOverlayOpen',] }],
|
|
2945
|
+
transformOriginSelector: [{ type: Input, args: ['cdkConnectedOverlayTransformOriginOn',] }],
|
|
2946
|
+
hasBackdrop: [{ type: Input, args: ['cdkConnectedOverlayHasBackdrop',] }],
|
|
2947
|
+
lockPosition: [{ type: Input, args: ['cdkConnectedOverlayLockPosition',] }],
|
|
2948
|
+
flexibleDimensions: [{ type: Input, args: ['cdkConnectedOverlayFlexibleDimensions',] }],
|
|
2949
|
+
growAfterOpen: [{ type: Input, args: ['cdkConnectedOverlayGrowAfterOpen',] }],
|
|
2950
|
+
push: [{ type: Input, args: ['cdkConnectedOverlayPush',] }],
|
|
2951
|
+
backdropClick: [{ type: Output }],
|
|
2952
|
+
positionChange: [{ type: Output }],
|
|
2953
|
+
attach: [{ type: Output }],
|
|
2954
|
+
detach: [{ type: Output }],
|
|
2955
|
+
overlayKeydown: [{ type: Output }],
|
|
2956
|
+
overlayOutsideClick: [{ type: Output }]
|
|
2957
|
+
};
|
|
2826
2958
|
/** @docs-private */
|
|
2827
2959
|
function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
|
|
2828
2960
|
return () => overlay.scrollStrategies.reposition();
|
|
@@ -2841,22 +2973,19 @@ const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
|
|
|
2841
2973
|
* Use of this source code is governed by an MIT-style license that can be
|
|
2842
2974
|
* found in the LICENSE file at https://angular.io/license
|
|
2843
2975
|
*/
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
];
|
|
2858
|
-
return OverlayModule;
|
|
2859
|
-
})();
|
|
2976
|
+
class OverlayModule {
|
|
2977
|
+
}
|
|
2978
|
+
OverlayModule.decorators = [
|
|
2979
|
+
{ type: NgModule, args: [{
|
|
2980
|
+
imports: [BidiModule, PortalModule, ScrollingModule],
|
|
2981
|
+
exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule],
|
|
2982
|
+
declarations: [CdkConnectedOverlay, CdkOverlayOrigin],
|
|
2983
|
+
providers: [
|
|
2984
|
+
Overlay,
|
|
2985
|
+
CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER,
|
|
2986
|
+
],
|
|
2987
|
+
},] }
|
|
2988
|
+
];
|
|
2860
2989
|
/**
|
|
2861
2990
|
* @deprecated Use `OverlayModule` instead.
|
|
2862
2991
|
* @breaking-change 8.0.0
|
|
@@ -2870,6 +2999,14 @@ const OVERLAY_PROVIDERS = [
|
|
|
2870
2999
|
CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER,
|
|
2871
3000
|
];
|
|
2872
3001
|
|
|
3002
|
+
/**
|
|
3003
|
+
* @license
|
|
3004
|
+
* Copyright Google LLC All Rights Reserved.
|
|
3005
|
+
*
|
|
3006
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3007
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3008
|
+
*/
|
|
3009
|
+
|
|
2873
3010
|
/**
|
|
2874
3011
|
* @license
|
|
2875
3012
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -2884,86 +3021,83 @@ const OVERLAY_PROVIDERS = [
|
|
|
2884
3021
|
*
|
|
2885
3022
|
* Should be provided in the root component.
|
|
2886
3023
|
*/
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
platform)
|
|
2895
|
-
|
|
3024
|
+
class FullscreenOverlayContainer extends OverlayContainer {
|
|
3025
|
+
constructor(_document,
|
|
3026
|
+
/**
|
|
3027
|
+
* @deprecated `platform` parameter to become required.
|
|
3028
|
+
* @breaking-change 10.0.0
|
|
3029
|
+
*/
|
|
3030
|
+
platform) {
|
|
3031
|
+
super(_document, platform);
|
|
3032
|
+
}
|
|
3033
|
+
ngOnDestroy() {
|
|
3034
|
+
super.ngOnDestroy();
|
|
3035
|
+
if (this._fullScreenEventName && this._fullScreenListener) {
|
|
3036
|
+
this._document.removeEventListener(this._fullScreenEventName, this._fullScreenListener);
|
|
2896
3037
|
}
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
3038
|
+
}
|
|
3039
|
+
_createContainer() {
|
|
3040
|
+
super._createContainer();
|
|
3041
|
+
this._adjustParentForFullscreenChange();
|
|
3042
|
+
this._addFullscreenChangeListener(() => this._adjustParentForFullscreenChange());
|
|
3043
|
+
}
|
|
3044
|
+
_adjustParentForFullscreenChange() {
|
|
3045
|
+
if (!this._containerElement) {
|
|
3046
|
+
return;
|
|
2902
3047
|
}
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
3048
|
+
const fullscreenElement = this.getFullscreenElement();
|
|
3049
|
+
const parent = fullscreenElement || this._document.body;
|
|
3050
|
+
parent.appendChild(this._containerElement);
|
|
3051
|
+
}
|
|
3052
|
+
_addFullscreenChangeListener(fn) {
|
|
3053
|
+
const eventName = this._getEventName();
|
|
3054
|
+
if (eventName) {
|
|
3055
|
+
if (this._fullScreenListener) {
|
|
3056
|
+
this._document.removeEventListener(eventName, this._fullScreenListener);
|
|
3057
|
+
}
|
|
3058
|
+
this._document.addEventListener(eventName, fn);
|
|
3059
|
+
this._fullScreenListener = fn;
|
|
2907
3060
|
}
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
3061
|
+
}
|
|
3062
|
+
_getEventName() {
|
|
3063
|
+
if (!this._fullScreenEventName) {
|
|
3064
|
+
const _document = this._document;
|
|
3065
|
+
if (_document.fullscreenEnabled) {
|
|
3066
|
+
this._fullScreenEventName = 'fullscreenchange';
|
|
2911
3067
|
}
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
parent.appendChild(this._containerElement);
|
|
2915
|
-
}
|
|
2916
|
-
_addFullscreenChangeListener(fn) {
|
|
2917
|
-
const eventName = this._getEventName();
|
|
2918
|
-
if (eventName) {
|
|
2919
|
-
if (this._fullScreenListener) {
|
|
2920
|
-
this._document.removeEventListener(eventName, this._fullScreenListener);
|
|
2921
|
-
}
|
|
2922
|
-
this._document.addEventListener(eventName, fn);
|
|
2923
|
-
this._fullScreenListener = fn;
|
|
3068
|
+
else if (_document.webkitFullscreenEnabled) {
|
|
3069
|
+
this._fullScreenEventName = 'webkitfullscreenchange';
|
|
2924
3070
|
}
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
this._fullScreenEventName = 'fullscreenchange';
|
|
2931
|
-
}
|
|
2932
|
-
else if (_document.webkitFullscreenEnabled) {
|
|
2933
|
-
this._fullScreenEventName = 'webkitfullscreenchange';
|
|
2934
|
-
}
|
|
2935
|
-
else if (_document.mozFullScreenEnabled) {
|
|
2936
|
-
this._fullScreenEventName = 'mozfullscreenchange';
|
|
2937
|
-
}
|
|
2938
|
-
else if (_document.msFullscreenEnabled) {
|
|
2939
|
-
this._fullScreenEventName = 'MSFullscreenChange';
|
|
2940
|
-
}
|
|
3071
|
+
else if (_document.mozFullScreenEnabled) {
|
|
3072
|
+
this._fullScreenEventName = 'mozfullscreenchange';
|
|
3073
|
+
}
|
|
3074
|
+
else if (_document.msFullscreenEnabled) {
|
|
3075
|
+
this._fullScreenEventName = 'MSFullscreenChange';
|
|
2941
3076
|
}
|
|
2942
|
-
return this._fullScreenEventName;
|
|
2943
3077
|
}
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
]
|
|
2965
|
-
|
|
2966
|
-
|
|
3078
|
+
return this._fullScreenEventName;
|
|
3079
|
+
}
|
|
3080
|
+
/**
|
|
3081
|
+
* When the page is put into fullscreen mode, a specific element is specified.
|
|
3082
|
+
* Only that element and its children are visible when in fullscreen mode.
|
|
3083
|
+
*/
|
|
3084
|
+
getFullscreenElement() {
|
|
3085
|
+
const _document = this._document;
|
|
3086
|
+
return _document.fullscreenElement ||
|
|
3087
|
+
_document.webkitFullscreenElement ||
|
|
3088
|
+
_document.mozFullScreenElement ||
|
|
3089
|
+
_document.msFullscreenElement ||
|
|
3090
|
+
null;
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3093
|
+
FullscreenOverlayContainer.ɵprov = ɵɵdefineInjectable({ factory: function FullscreenOverlayContainer_Factory() { return new FullscreenOverlayContainer(ɵɵinject(DOCUMENT), ɵɵinject(Platform)); }, token: FullscreenOverlayContainer, providedIn: "root" });
|
|
3094
|
+
FullscreenOverlayContainer.decorators = [
|
|
3095
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
3096
|
+
];
|
|
3097
|
+
FullscreenOverlayContainer.ctorParameters = () => [
|
|
3098
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
3099
|
+
{ type: Platform }
|
|
3100
|
+
];
|
|
2967
3101
|
|
|
2968
3102
|
/**
|
|
2969
3103
|
* @license
|
|
@@ -2977,5 +3111,5 @@ let FullscreenOverlayContainer = /** @class */ (() => {
|
|
|
2977
3111
|
* Generated bundle index. Do not edit.
|
|
2978
3112
|
*/
|
|
2979
3113
|
|
|
2980
|
-
export { BlockScrollStrategy, CdkConnectedOverlay, CdkOverlayOrigin, CloseScrollStrategy, ConnectedOverlayPositionChange, ConnectedPositionStrategy, ConnectionPositionPair, FlexibleConnectedPositionStrategy, FullscreenOverlayContainer, GlobalPositionStrategy, NoopScrollStrategy, OVERLAY_PROVIDERS, Overlay, OverlayConfig, OverlayContainer, OverlayKeyboardDispatcher, OverlayModule, OverlayPositionBuilder, OverlayRef, RepositionScrollStrategy, ScrollStrategyOptions, ScrollingVisibility, validateHorizontalPosition, validateVerticalPosition,
|
|
3114
|
+
export { BlockScrollStrategy, CdkConnectedOverlay, CdkOverlayOrigin, CloseScrollStrategy, ConnectedOverlayPositionChange, ConnectedPositionStrategy, ConnectionPositionPair, FlexibleConnectedPositionStrategy, FullscreenOverlayContainer, GlobalPositionStrategy, NoopScrollStrategy, OVERLAY_PROVIDERS, Overlay, OverlayConfig, OverlayContainer, OverlayKeyboardDispatcher, OverlayModule, OverlayOutsideClickDispatcher, OverlayPositionBuilder, OverlayRef, RepositionScrollStrategy, ScrollStrategyOptions, ScrollingVisibility, validateHorizontalPosition, validateVerticalPosition, OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY as ɵangular_material_src_cdk_overlay_overlay_a, OVERLAY_KEYBOARD_DISPATCHER_PROVIDER as ɵangular_material_src_cdk_overlay_overlay_b, OVERLAY_CONTAINER_PROVIDER_FACTORY as ɵangular_material_src_cdk_overlay_overlay_c, OVERLAY_CONTAINER_PROVIDER as ɵangular_material_src_cdk_overlay_overlay_d, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY as ɵangular_material_src_cdk_overlay_overlay_e, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY as ɵangular_material_src_cdk_overlay_overlay_f, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER as ɵangular_material_src_cdk_overlay_overlay_g, BaseOverlayDispatcher as ɵangular_material_src_cdk_overlay_overlay_h };
|
|
2981
3115
|
//# sourceMappingURL=overlay.js.map
|