@angular/cdk 14.0.0-next.0 → 14.0.0-next.11
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/_index.scss +11 -0
- package/a11y/a11y-module.d.ts +2 -3
- package/a11y/aria-describer/aria-describer.d.ts +33 -6
- package/a11y/live-announcer/live-announcer.d.ts +5 -1
- package/a11y-prebuilt.css +1 -1
- package/drag-drop/drag-events.d.ts +8 -0
- package/drag-drop/drag-ref.d.ts +11 -1
- package/drag-drop/drop-list-ref.d.ts +5 -1
- package/drag-drop/parent-position-tracker.d.ts +11 -3
- package/esm2020/a11y/a11y-module.mjs +6 -7
- package/esm2020/a11y/aria-describer/aria-describer.mjs +75 -52
- package/esm2020/a11y/focus-monitor/focus-monitor.mjs +13 -11
- package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
- package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +4 -4
- package/esm2020/a11y/focus-trap/focus-trap.mjs +7 -7
- package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +7 -12
- package/esm2020/a11y/input-modality/input-modality-detector.mjs +4 -4
- package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
- package/esm2020/a11y/live-announcer/live-announcer.mjs +26 -18
- package/esm2020/accordion/accordion-item.mjs +4 -4
- package/esm2020/accordion/accordion-module.mjs +5 -5
- package/esm2020/accordion/accordion.mjs +4 -4
- package/esm2020/bidi/bidi-module.mjs +5 -5
- package/esm2020/bidi/dir.mjs +4 -4
- package/esm2020/bidi/directionality.mjs +4 -4
- package/esm2020/clipboard/clipboard-module.mjs +5 -5
- package/esm2020/clipboard/clipboard.mjs +4 -4
- package/esm2020/clipboard/copy-to-clipboard.mjs +4 -4
- package/esm2020/collections/unique-selection-dispatcher.mjs +4 -4
- package/esm2020/drag-drop/directives/drag-handle.mjs +4 -4
- package/esm2020/drag-drop/directives/drag-placeholder.mjs +4 -4
- package/esm2020/drag-drop/directives/drag-preview.mjs +4 -4
- package/esm2020/drag-drop/directives/drag.mjs +26 -24
- package/esm2020/drag-drop/directives/drop-list-group.mjs +4 -4
- package/esm2020/drag-drop/directives/drop-list.mjs +14 -13
- package/esm2020/drag-drop/drag-drop-module.mjs +5 -5
- package/esm2020/drag-drop/drag-drop-registry.mjs +4 -4
- package/esm2020/drag-drop/drag-drop.mjs +4 -4
- package/esm2020/drag-drop/drag-events.mjs +1 -1
- package/esm2020/drag-drop/drag-ref.mjs +48 -24
- package/esm2020/drag-drop/drop-list-ref.mjs +7 -3
- package/esm2020/drag-drop/parent-position-tracker.mjs +13 -5
- package/esm2020/layout/breakpoints-observer.mjs +4 -4
- package/esm2020/layout/layout-module.mjs +5 -5
- package/esm2020/layout/media-matcher.mjs +4 -4
- package/esm2020/observers/observe-content.mjs +14 -14
- package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
- package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +26 -8
- package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +33 -12
- package/esm2020/overlay/fullscreen-overlay-container.mjs +4 -4
- package/esm2020/overlay/overlay-container.mjs +4 -4
- package/esm2020/overlay/overlay-directives.mjs +7 -7
- package/esm2020/overlay/overlay-module.mjs +5 -5
- package/esm2020/overlay/overlay-ref.mjs +24 -18
- package/esm2020/overlay/overlay.mjs +14 -8
- package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +21 -3
- package/esm2020/overlay/position/global-position-strategy.mjs +64 -30
- package/esm2020/overlay/position/overlay-position-builder.mjs +4 -4
- package/esm2020/overlay/public-api.mjs +2 -2
- package/esm2020/overlay/scroll/scroll-strategy-options.mjs +4 -4
- package/esm2020/platform/platform-module.mjs +5 -5
- package/esm2020/platform/platform.mjs +4 -4
- package/esm2020/portal/dom-portal-outlet.mjs +29 -5
- package/esm2020/portal/portal-directives.mjs +20 -18
- package/esm2020/portal/portal.mjs +12 -3
- package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +4 -4
- package/esm2020/scrolling/scroll-dispatcher.mjs +4 -4
- package/esm2020/scrolling/scrollable.mjs +4 -4
- package/esm2020/scrolling/scrolling-module.mjs +10 -11
- package/esm2020/scrolling/viewport-ruler.mjs +4 -4
- package/esm2020/scrolling/virtual-for-of.mjs +7 -5
- package/esm2020/scrolling/virtual-scroll-viewport.mjs +8 -6
- package/esm2020/stepper/step-header.mjs +4 -4
- package/esm2020/stepper/step-label.mjs +4 -4
- package/esm2020/stepper/stepper-button.mjs +7 -7
- package/esm2020/stepper/stepper-module.mjs +5 -5
- package/esm2020/stepper/stepper.mjs +9 -22
- package/esm2020/table/cell.mjs +22 -22
- package/esm2020/table/coalesced-style-scheduler.mjs +4 -4
- package/esm2020/table/row.mjs +28 -28
- package/esm2020/table/table-module.mjs +5 -5
- package/esm2020/table/table.mjs +21 -21
- package/esm2020/table/text-column.mjs +4 -4
- package/esm2020/testing/component-harness.mjs +7 -1
- package/esm2020/testing/harness-environment.mjs +12 -1
- package/esm2020/testing/public-api.mjs +2 -1
- package/esm2020/testing/selenium-webdriver/selenium-web-driver-element.mjs +8 -3
- package/esm2020/testing/test-element-errors.mjs +15 -0
- package/esm2020/testing/test-element.mjs +1 -1
- package/esm2020/testing/testbed/fake-events/type-in-element.mjs +13 -4
- package/esm2020/testing/testbed/unit-test-element.mjs +21 -5
- package/esm2020/text-field/autofill.mjs +7 -7
- package/esm2020/text-field/autosize.mjs +4 -4
- package/esm2020/text-field/text-field-module.mjs +5 -7
- package/esm2020/tree/nested-node.mjs +4 -4
- package/esm2020/tree/node.mjs +4 -4
- package/esm2020/tree/outlet.mjs +4 -4
- package/esm2020/tree/padding.mjs +4 -4
- package/esm2020/tree/toggle.mjs +4 -4
- package/esm2020/tree/tree-module.mjs +5 -5
- package/esm2020/tree/tree.mjs +7 -7
- package/esm2020/version.mjs +1 -1
- package/fesm2015/a11y.mjs +146 -118
- package/fesm2015/a11y.mjs.map +1 -1
- package/fesm2015/accordion.mjs +10 -10
- package/fesm2015/accordion.mjs.map +1 -1
- package/fesm2015/bidi.mjs +10 -10
- package/fesm2015/bidi.mjs.map +1 -1
- package/fesm2015/cdk.mjs +1 -1
- package/fesm2015/cdk.mjs.map +1 -1
- package/fesm2015/clipboard.mjs +10 -10
- package/fesm2015/clipboard.mjs.map +1 -1
- package/fesm2015/coercion.mjs.map +1 -1
- package/fesm2015/collections.mjs +3 -3
- package/fesm2015/collections.mjs.map +1 -1
- package/fesm2015/drag-drop.mjs +126 -86
- package/fesm2015/drag-drop.mjs.map +1 -1
- package/fesm2015/keycodes.mjs.map +1 -1
- package/fesm2015/layout.mjs +10 -10
- package/fesm2015/layout.mjs.map +1 -1
- package/fesm2015/observers.mjs +13 -13
- package/fesm2015/observers.mjs.map +1 -1
- package/fesm2015/overlay.mjs +202 -99
- package/fesm2015/overlay.mjs.map +1 -1
- package/fesm2015/platform.mjs +7 -7
- package/fesm2015/platform.mjs.map +1 -1
- package/fesm2015/portal.mjs +58 -24
- package/fesm2015/portal.mjs.map +1 -1
- package/fesm2015/scrolling.mjs +35 -31
- package/fesm2015/scrolling.mjs.map +1 -1
- package/fesm2015/stepper.mjs +24 -37
- package/fesm2015/stepper.mjs.map +1 -1
- package/fesm2015/table.mjs +78 -78
- package/fesm2015/table.mjs.map +1 -1
- package/fesm2015/testing/selenium-webdriver.mjs +7 -2
- package/fesm2015/testing/selenium-webdriver.mjs.map +1 -1
- package/fesm2015/testing/testbed.mjs +32 -8
- package/fesm2015/testing/testbed.mjs.map +1 -1
- package/fesm2015/testing.mjs +39 -1
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/text-field.mjs +14 -15
- package/fesm2015/text-field.mjs.map +1 -1
- package/fesm2015/tree.mjs +25 -25
- package/fesm2015/tree.mjs.map +1 -1
- package/fesm2020/a11y.mjs +142 -116
- package/fesm2020/a11y.mjs.map +1 -1
- package/fesm2020/accordion.mjs +10 -10
- package/fesm2020/accordion.mjs.map +1 -1
- package/fesm2020/bidi.mjs +10 -10
- package/fesm2020/bidi.mjs.map +1 -1
- package/fesm2020/cdk.mjs +1 -1
- package/fesm2020/cdk.mjs.map +1 -1
- package/fesm2020/clipboard.mjs +10 -10
- package/fesm2020/clipboard.mjs.map +1 -1
- package/fesm2020/coercion.mjs.map +1 -1
- package/fesm2020/collections.mjs +3 -3
- package/fesm2020/collections.mjs.map +1 -1
- package/fesm2020/drag-drop.mjs +125 -86
- package/fesm2020/drag-drop.mjs.map +1 -1
- package/fesm2020/keycodes.mjs.map +1 -1
- package/fesm2020/layout.mjs +10 -10
- package/fesm2020/layout.mjs.map +1 -1
- package/fesm2020/observers.mjs +13 -13
- package/fesm2020/observers.mjs.map +1 -1
- package/fesm2020/overlay.mjs +202 -99
- package/fesm2020/overlay.mjs.map +1 -1
- package/fesm2020/platform.mjs +7 -7
- package/fesm2020/platform.mjs.map +1 -1
- package/fesm2020/portal.mjs +58 -24
- package/fesm2020/portal.mjs.map +1 -1
- package/fesm2020/scrolling.mjs +35 -31
- package/fesm2020/scrolling.mjs.map +1 -1
- package/fesm2020/stepper.mjs +24 -37
- package/fesm2020/stepper.mjs.map +1 -1
- package/fesm2020/table.mjs +78 -78
- package/fesm2020/table.mjs.map +1 -1
- package/fesm2020/testing/selenium-webdriver.mjs +7 -2
- package/fesm2020/testing/selenium-webdriver.mjs.map +1 -1
- package/fesm2020/testing/testbed.mjs +32 -8
- package/fesm2020/testing/testbed.mjs.map +1 -1
- package/fesm2020/testing.mjs +33 -1
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/text-field.mjs +14 -15
- package/fesm2020/text-field.mjs.map +1 -1
- package/fesm2020/tree.mjs +25 -25
- package/fesm2020/tree.mjs.map +1 -1
- package/overlay/_index.scss +11 -1
- package/overlay/dispatchers/overlay-keyboard-dispatcher.d.ts +7 -2
- package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +8 -2
- package/overlay/overlay-ref.d.ts +4 -1
- package/overlay/overlay.d.ts +3 -2
- package/overlay/position/flexible-connected-position-strategy.d.ts +2 -0
- package/overlay/position/global-position-strategy.d.ts +14 -3
- package/overlay/public-api.d.ts +1 -1
- package/overlay-prebuilt.css +1 -1
- package/package.json +3 -11
- package/portal/dom-portal-outlet.d.ts +17 -6
- package/portal/portal.d.ts +12 -2
- package/schematics/collection.json +2 -1
- package/schematics/index.js +6 -2
- package/schematics/index.mjs +6 -2
- package/schematics/migration.json +5 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/drag-drop/index.js +5 -14
- package/schematics/ng-generate/drag-drop/index.mjs +5 -14
- package/schematics/ng-generate/drag-drop/schema.json +1 -1
- package/schematics/ng-update/data/constructor-checks.js +7 -1
- package/schematics/ng-update/data/constructor-checks.mjs +7 -1
- package/schematics/ng-update/data/index.js +6 -2
- package/schematics/ng-update/data/index.mjs +6 -2
- package/schematics/ng-update/devkit-migration-rule.js +5 -14
- package/schematics/ng-update/devkit-migration-rule.mjs +5 -14
- package/schematics/ng-update/devkit-migration.js +1 -1
- package/schematics/ng-update/devkit-migration.mjs +1 -1
- package/schematics/ng-update/html-parsing/elements.js +2 -3
- package/schematics/ng-update/html-parsing/elements.mjs +2 -3
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +7 -2
- package/schematics/ng-update/index.mjs +7 -2
- package/schematics/ng-update/migrations/symbol-removal.js +2 -3
- package/schematics/ng-update/migrations/symbol-removal.mjs +2 -3
- package/schematics/ng-update/public-api.js +6 -2
- package/schematics/ng-update/public-api.mjs +6 -2
- package/schematics/tsconfig.json +2 -10
- package/schematics/update-tool/public-api.js +6 -2
- package/schematics/update-tool/public-api.mjs +6 -2
- package/schematics/update-tool/target-version.d.ts +2 -1
- package/schematics/update-tool/target-version.js +2 -1
- package/schematics/update-tool/target-version.mjs +2 -1
- package/schematics/utils/ast.js +11 -22
- package/schematics/utils/ast.mjs +11 -22
- package/schematics/utils/build-component.js +10 -15
- package/schematics/utils/build-component.mjs +10 -15
- package/schematics/utils/get-project.d.ts +1 -1
- package/schematics/utils/get-project.js +7 -2
- package/schematics/utils/get-project.mjs +7 -2
- package/schematics/utils/html-manipulation.js +3 -1
- package/schematics/utils/html-manipulation.mjs +3 -1
- package/schematics/utils/index.js +6 -2
- package/schematics/utils/index.mjs +6 -2
- package/schematics/utils/project-index-file.js +2 -2
- package/schematics/utils/project-index-file.mjs +2 -2
- package/schematics/utils/project-targets.js +3 -4
- package/schematics/utils/project-targets.mjs +3 -4
- package/schematics/utils/project-tsconfig-paths.js +16 -28
- package/schematics/utils/project-tsconfig-paths.mjs +16 -28
- package/scrolling/scrolling-module.d.ts +1 -2
- package/stepper/stepper.d.ts +3 -12
- package/table/table.d.ts +2 -6
- package/table/text-column.d.ts +1 -1
- package/testing/component-harness.d.ts +18 -0
- package/testing/harness-environment.d.ts +2 -0
- package/testing/public-api.d.ts +1 -0
- package/testing/{protractor/index.d.ts → test-element-errors.d.ts} +5 -1
- package/testing/test-element.d.ts +4 -2
- package/testing/testbed/fake-events/type-in-element.d.ts +2 -2
- package/testing/testbed/unit-test-element.d.ts +4 -1
- package/text-field/text-field-module.d.ts +1 -2
- package/text-field-prebuilt.css +1 -1
- package/esm2020/testing/protractor/index.mjs +0 -9
- package/esm2020/testing/protractor/protractor-element.mjs +0 -234
- package/esm2020/testing/protractor/protractor-harness-environment.mjs +0 -72
- package/esm2020/testing/protractor/public-api.mjs +0 -10
- package/fesm2015/testing/protractor.mjs +0 -355
- package/fesm2015/testing/protractor.mjs.map +0 -1
- package/fesm2020/testing/protractor.mjs +0 -322
- package/fesm2020/testing/protractor.mjs.map +0 -1
- package/testing/protractor/package.json +0 -9
- package/testing/protractor/protractor-element.d.ts +0 -90
- package/testing/protractor/protractor-harness-environment.d.ts +0 -50
- package/testing/protractor/public-api.d.ts +0 -9
package/fesm2015/overlay.mjs
CHANGED
|
@@ -4,7 +4,7 @@ export { CdkScrollable, ScrollDispatcher, ViewportRuler } from '@angular/cdk/scr
|
|
|
4
4
|
import * as i6 from '@angular/common';
|
|
5
5
|
import { DOCUMENT } from '@angular/common';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
|
-
import { Injectable, Inject, ElementRef, ApplicationRef, InjectionToken, Directive, EventEmitter,
|
|
7
|
+
import { Injectable, Inject, ElementRef, Optional, ApplicationRef, ANIMATION_MODULE_TYPE, InjectionToken, Directive, EventEmitter, Input, Output, NgModule } from '@angular/core';
|
|
8
8
|
import { coerceCssPixelValue, coerceArray, coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
9
9
|
import * as i1$1 from '@angular/cdk/platform';
|
|
10
10
|
import { supportsScrollBehavior, _isTestEnvironment, _getEventTarget } from '@angular/cdk/platform';
|
|
@@ -312,9 +312,9 @@ class ScrollStrategyOptions {
|
|
|
312
312
|
this._document = document;
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
ScrollStrategyOptions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
316
|
-
ScrollStrategyOptions.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
317
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
315
|
+
ScrollStrategyOptions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: ScrollStrategyOptions, deps: [{ token: i1.ScrollDispatcher }, { token: i1.ViewportRuler }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
316
|
+
ScrollStrategyOptions.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: ScrollStrategyOptions, providedIn: 'root' });
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: ScrollStrategyOptions, decorators: [{
|
|
318
318
|
type: Injectable,
|
|
319
319
|
args: [{ providedIn: 'root' }]
|
|
320
320
|
}], ctorParameters: function () {
|
|
@@ -476,7 +476,7 @@ function validateHorizontalPosition(property, value) {
|
|
|
476
476
|
* Used to manipulate or dispose of said overlay.
|
|
477
477
|
*/
|
|
478
478
|
class OverlayRef {
|
|
479
|
-
constructor(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document, _location, _outsideClickDispatcher) {
|
|
479
|
+
constructor(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document, _location, _outsideClickDispatcher, _animationsDisabled = false) {
|
|
480
480
|
this._portalOutlet = _portalOutlet;
|
|
481
481
|
this._host = _host;
|
|
482
482
|
this._pane = _pane;
|
|
@@ -486,12 +486,16 @@ class OverlayRef {
|
|
|
486
486
|
this._document = _document;
|
|
487
487
|
this._location = _location;
|
|
488
488
|
this._outsideClickDispatcher = _outsideClickDispatcher;
|
|
489
|
+
this._animationsDisabled = _animationsDisabled;
|
|
489
490
|
this._backdropElement = null;
|
|
490
491
|
this._backdropClick = new Subject();
|
|
491
492
|
this._attachments = new Subject();
|
|
492
493
|
this._detachments = new Subject();
|
|
493
494
|
this._locationChanges = Subscription.EMPTY;
|
|
494
495
|
this._backdropClickHandler = (event) => this._backdropClick.next(event);
|
|
496
|
+
this._backdropTransitionendHandler = (event) => {
|
|
497
|
+
this._disposeBackdrop(event.target);
|
|
498
|
+
};
|
|
495
499
|
/** Stream of keydown events dispatched to this overlay. */
|
|
496
500
|
this._keydownEvents = new Subject();
|
|
497
501
|
/** Stream of mouse outside events dispatched to this overlay. */
|
|
@@ -740,6 +744,9 @@ class OverlayRef {
|
|
|
740
744
|
const showingClass = 'cdk-overlay-backdrop-showing';
|
|
741
745
|
this._backdropElement = this._document.createElement('div');
|
|
742
746
|
this._backdropElement.classList.add('cdk-overlay-backdrop');
|
|
747
|
+
if (this._animationsDisabled) {
|
|
748
|
+
this._backdropElement.classList.add('cdk-overlay-backdrop-noop-animation');
|
|
749
|
+
}
|
|
743
750
|
if (this._config.backdropClass) {
|
|
744
751
|
this._toggleClasses(this._backdropElement, this._config.backdropClass, true);
|
|
745
752
|
}
|
|
@@ -750,7 +757,7 @@ class OverlayRef {
|
|
|
750
757
|
// action desired when such a click occurs (usually closing the overlay).
|
|
751
758
|
this._backdropElement.addEventListener('click', this._backdropClickHandler);
|
|
752
759
|
// Add class to fade-in the backdrop after one frame.
|
|
753
|
-
if (typeof requestAnimationFrame !== 'undefined') {
|
|
760
|
+
if (!this._animationsDisabled && typeof requestAnimationFrame !== 'undefined') {
|
|
754
761
|
this._ngZone.runOutsideAngular(() => {
|
|
755
762
|
requestAnimationFrame(() => {
|
|
756
763
|
if (this._backdropElement) {
|
|
@@ -781,22 +788,13 @@ class OverlayRef {
|
|
|
781
788
|
if (!backdropToDetach) {
|
|
782
789
|
return;
|
|
783
790
|
}
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
backdropToDetach.removeEventListener('click', this._backdropClickHandler);
|
|
789
|
-
backdropToDetach.removeEventListener('transitionend', finishDetach);
|
|
790
|
-
this._disposeBackdrop(backdropToDetach);
|
|
791
|
-
}
|
|
792
|
-
if (this._config.backdropClass) {
|
|
793
|
-
this._toggleClasses(backdropToDetach, this._config.backdropClass, false);
|
|
794
|
-
}
|
|
795
|
-
clearTimeout(timeoutId);
|
|
796
|
-
};
|
|
791
|
+
if (this._animationsDisabled) {
|
|
792
|
+
this._disposeBackdrop(backdropToDetach);
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
797
795
|
backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');
|
|
798
796
|
this._ngZone.runOutsideAngular(() => {
|
|
799
|
-
backdropToDetach.addEventListener('transitionend',
|
|
797
|
+
backdropToDetach.addEventListener('transitionend', this._backdropTransitionendHandler);
|
|
800
798
|
});
|
|
801
799
|
// If the backdrop doesn't have a transition, the `transitionend` event won't fire.
|
|
802
800
|
// In this case we make it unclickable and we try to remove it after a delay.
|
|
@@ -804,7 +802,9 @@ class OverlayRef {
|
|
|
804
802
|
// Run this outside the Angular zone because there's nothing that Angular cares about.
|
|
805
803
|
// If it were to run inside the Angular zone, every test that used Overlay would have to be
|
|
806
804
|
// either async or fakeAsync.
|
|
807
|
-
|
|
805
|
+
this._backdropTimeout = this._ngZone.runOutsideAngular(() => setTimeout(() => {
|
|
806
|
+
this._disposeBackdrop(backdropToDetach);
|
|
807
|
+
}, 500));
|
|
808
808
|
}
|
|
809
809
|
/** Toggles a single CSS class or an array of classes on an element. */
|
|
810
810
|
_toggleClasses(element, cssClasses, isAdd) {
|
|
@@ -853,6 +853,8 @@ class OverlayRef {
|
|
|
853
853
|
/** Removes a backdrop element from the DOM. */
|
|
854
854
|
_disposeBackdrop(backdrop) {
|
|
855
855
|
if (backdrop) {
|
|
856
|
+
backdrop.removeEventListener('click', this._backdropClickHandler);
|
|
857
|
+
backdrop.removeEventListener('transitionend', this._backdropTransitionendHandler);
|
|
856
858
|
backdrop.remove();
|
|
857
859
|
// It is possible that a new portal has been attached to this overlay since we started
|
|
858
860
|
// removing the backdrop. If that is the case, only clear the backdrop reference if it
|
|
@@ -861,6 +863,10 @@ class OverlayRef {
|
|
|
861
863
|
this._backdropElement = null;
|
|
862
864
|
}
|
|
863
865
|
}
|
|
866
|
+
if (this._backdropTimeout) {
|
|
867
|
+
clearTimeout(this._backdropTimeout);
|
|
868
|
+
this._backdropTimeout = undefined;
|
|
869
|
+
}
|
|
864
870
|
}
|
|
865
871
|
}
|
|
866
872
|
|
|
@@ -931,9 +937,9 @@ class OverlayContainer {
|
|
|
931
937
|
this._containerElement = container;
|
|
932
938
|
}
|
|
933
939
|
}
|
|
934
|
-
OverlayContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
935
|
-
OverlayContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
936
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
940
|
+
OverlayContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayContainer, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
941
|
+
OverlayContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayContainer, providedIn: 'root' });
|
|
942
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayContainer, decorators: [{
|
|
937
943
|
type: Injectable,
|
|
938
944
|
args: [{ providedIn: 'root' }]
|
|
939
945
|
}], ctorParameters: function () {
|
|
@@ -1180,15 +1186,21 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1180
1186
|
* allows one to re-align the panel without changing the orientation of the panel.
|
|
1181
1187
|
*/
|
|
1182
1188
|
reapplyLastPosition() {
|
|
1183
|
-
if (
|
|
1189
|
+
if (this._isDisposed || !this._platform.isBrowser) {
|
|
1190
|
+
return;
|
|
1191
|
+
}
|
|
1192
|
+
const lastPosition = this._lastPosition;
|
|
1193
|
+
if (lastPosition) {
|
|
1184
1194
|
this._originRect = this._getOriginRect();
|
|
1185
1195
|
this._overlayRect = this._pane.getBoundingClientRect();
|
|
1186
1196
|
this._viewportRect = this._getNarrowedViewportRect();
|
|
1187
1197
|
this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();
|
|
1188
|
-
const lastPosition = this._lastPosition || this._preferredPositions[0];
|
|
1189
1198
|
const originPoint = this._getOriginPoint(this._originRect, this._containerRect, lastPosition);
|
|
1190
1199
|
this._applyPosition(lastPosition, originPoint);
|
|
1191
1200
|
}
|
|
1201
|
+
else {
|
|
1202
|
+
this.apply();
|
|
1203
|
+
}
|
|
1192
1204
|
}
|
|
1193
1205
|
/**
|
|
1194
1206
|
* Sets the list of Scrollable containers that host the origin element so that
|
|
@@ -1904,6 +1916,18 @@ function getRoundedBoundingClientRect(clientRect) {
|
|
|
1904
1916
|
height: Math.floor(clientRect.height),
|
|
1905
1917
|
};
|
|
1906
1918
|
}
|
|
1919
|
+
const STANDARD_DROPDOWN_BELOW_POSITIONS = [
|
|
1920
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
|
|
1921
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },
|
|
1922
|
+
{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },
|
|
1923
|
+
{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },
|
|
1924
|
+
];
|
|
1925
|
+
const STANDARD_DROPDOWN_ADJACENT_POSITIONS = [
|
|
1926
|
+
{ originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top' },
|
|
1927
|
+
{ originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom' },
|
|
1928
|
+
{ originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top' },
|
|
1929
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'end', overlayY: 'bottom' },
|
|
1930
|
+
];
|
|
1907
1931
|
|
|
1908
1932
|
/**
|
|
1909
1933
|
* @license
|
|
@@ -1925,12 +1949,12 @@ class GlobalPositionStrategy {
|
|
|
1925
1949
|
this._cssPosition = 'static';
|
|
1926
1950
|
this._topOffset = '';
|
|
1927
1951
|
this._bottomOffset = '';
|
|
1928
|
-
this._leftOffset = '';
|
|
1929
|
-
this._rightOffset = '';
|
|
1930
1952
|
this._alignItems = '';
|
|
1931
|
-
this.
|
|
1953
|
+
this._xPosition = '';
|
|
1954
|
+
this._xOffset = '';
|
|
1932
1955
|
this._width = '';
|
|
1933
1956
|
this._height = '';
|
|
1957
|
+
this._isDisposed = false;
|
|
1934
1958
|
}
|
|
1935
1959
|
attach(overlayRef) {
|
|
1936
1960
|
const config = overlayRef.getConfig();
|
|
@@ -1959,9 +1983,8 @@ class GlobalPositionStrategy {
|
|
|
1959
1983
|
* @param value New left offset.
|
|
1960
1984
|
*/
|
|
1961
1985
|
left(value = '') {
|
|
1962
|
-
this.
|
|
1963
|
-
this.
|
|
1964
|
-
this._justifyContent = 'flex-start';
|
|
1986
|
+
this._xOffset = value;
|
|
1987
|
+
this._xPosition = 'left';
|
|
1965
1988
|
return this;
|
|
1966
1989
|
}
|
|
1967
1990
|
/**
|
|
@@ -1979,9 +2002,28 @@ class GlobalPositionStrategy {
|
|
|
1979
2002
|
* @param value New right offset.
|
|
1980
2003
|
*/
|
|
1981
2004
|
right(value = '') {
|
|
1982
|
-
this.
|
|
1983
|
-
this.
|
|
1984
|
-
this
|
|
2005
|
+
this._xOffset = value;
|
|
2006
|
+
this._xPosition = 'right';
|
|
2007
|
+
return this;
|
|
2008
|
+
}
|
|
2009
|
+
/**
|
|
2010
|
+
* Sets the overlay to the start of the viewport, depending on the overlay direction.
|
|
2011
|
+
* This will be to the left in LTR layouts and to the right in RTL.
|
|
2012
|
+
* @param offset Offset from the edge of the screen.
|
|
2013
|
+
*/
|
|
2014
|
+
start(value = '') {
|
|
2015
|
+
this._xOffset = value;
|
|
2016
|
+
this._xPosition = 'start';
|
|
2017
|
+
return this;
|
|
2018
|
+
}
|
|
2019
|
+
/**
|
|
2020
|
+
* Sets the overlay to the end of the viewport, depending on the overlay direction.
|
|
2021
|
+
* This will be to the right in LTR layouts and to the left in RTL.
|
|
2022
|
+
* @param offset Offset from the edge of the screen.
|
|
2023
|
+
*/
|
|
2024
|
+
end(value = '') {
|
|
2025
|
+
this._xOffset = value;
|
|
2026
|
+
this._xPosition = 'end';
|
|
1985
2027
|
return this;
|
|
1986
2028
|
}
|
|
1987
2029
|
/**
|
|
@@ -2022,7 +2064,7 @@ class GlobalPositionStrategy {
|
|
|
2022
2064
|
*/
|
|
2023
2065
|
centerHorizontally(offset = '') {
|
|
2024
2066
|
this.left(offset);
|
|
2025
|
-
this.
|
|
2067
|
+
this._xPosition = 'center';
|
|
2026
2068
|
return this;
|
|
2027
2069
|
}
|
|
2028
2070
|
/**
|
|
@@ -2055,32 +2097,48 @@ class GlobalPositionStrategy {
|
|
|
2055
2097
|
(!maxWidth || maxWidth === '100%' || maxWidth === '100vw');
|
|
2056
2098
|
const shouldBeFlushVertically = (height === '100%' || height === '100vh') &&
|
|
2057
2099
|
(!maxHeight || maxHeight === '100%' || maxHeight === '100vh');
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2100
|
+
const xPosition = this._xPosition;
|
|
2101
|
+
const xOffset = this._xOffset;
|
|
2102
|
+
const isRtl = this._overlayRef.getConfig().direction === 'rtl';
|
|
2103
|
+
let marginLeft = '';
|
|
2104
|
+
let marginRight = '';
|
|
2105
|
+
let justifyContent = '';
|
|
2063
2106
|
if (shouldBeFlushHorizontally) {
|
|
2064
|
-
|
|
2065
|
-
}
|
|
2066
|
-
else if (
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
// In RTL the browser will invert `flex-start` and `flex-end` automatically, but we
|
|
2071
|
-
// don't want that because our positioning is explicitly `left` and `right`, hence
|
|
2072
|
-
// why we do another inversion to ensure that the overlay stays in the same position.
|
|
2073
|
-
// TODO: reconsider this if we add `start` and `end` methods.
|
|
2074
|
-
if (this._justifyContent === 'flex-start') {
|
|
2075
|
-
parentStyles.justifyContent = 'flex-end';
|
|
2107
|
+
justifyContent = 'flex-start';
|
|
2108
|
+
}
|
|
2109
|
+
else if (xPosition === 'center') {
|
|
2110
|
+
justifyContent = 'center';
|
|
2111
|
+
if (isRtl) {
|
|
2112
|
+
marginRight = xOffset;
|
|
2076
2113
|
}
|
|
2077
|
-
else
|
|
2078
|
-
|
|
2114
|
+
else {
|
|
2115
|
+
marginLeft = xOffset;
|
|
2079
2116
|
}
|
|
2080
2117
|
}
|
|
2081
|
-
else {
|
|
2082
|
-
|
|
2118
|
+
else if (isRtl) {
|
|
2119
|
+
if (xPosition === 'left' || xPosition === 'end') {
|
|
2120
|
+
justifyContent = 'flex-end';
|
|
2121
|
+
marginLeft = xOffset;
|
|
2122
|
+
}
|
|
2123
|
+
else if (xPosition === 'right' || xPosition === 'start') {
|
|
2124
|
+
justifyContent = 'flex-start';
|
|
2125
|
+
marginRight = xOffset;
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
else if (xPosition === 'left' || xPosition === 'start') {
|
|
2129
|
+
justifyContent = 'flex-start';
|
|
2130
|
+
marginLeft = xOffset;
|
|
2131
|
+
}
|
|
2132
|
+
else if (xPosition === 'right' || xPosition === 'end') {
|
|
2133
|
+
justifyContent = 'flex-end';
|
|
2134
|
+
marginRight = xOffset;
|
|
2083
2135
|
}
|
|
2136
|
+
styles.position = this._cssPosition;
|
|
2137
|
+
styles.marginLeft = shouldBeFlushHorizontally ? '0' : marginLeft;
|
|
2138
|
+
styles.marginTop = shouldBeFlushVertically ? '0' : this._topOffset;
|
|
2139
|
+
styles.marginBottom = this._bottomOffset;
|
|
2140
|
+
styles.marginRight = shouldBeFlushHorizontally ? '0' : marginRight;
|
|
2141
|
+
parentStyles.justifyContent = justifyContent;
|
|
2084
2142
|
parentStyles.alignItems = shouldBeFlushVertically ? 'flex-start' : this._alignItems;
|
|
2085
2143
|
}
|
|
2086
2144
|
/**
|
|
@@ -2130,9 +2188,9 @@ class OverlayPositionBuilder {
|
|
|
2130
2188
|
return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document, this._platform, this._overlayContainer);
|
|
2131
2189
|
}
|
|
2132
2190
|
}
|
|
2133
|
-
OverlayPositionBuilder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2134
|
-
OverlayPositionBuilder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2191
|
+
OverlayPositionBuilder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayPositionBuilder, deps: [{ token: i1.ViewportRuler }, { token: DOCUMENT }, { token: i1$1.Platform }, { token: OverlayContainer }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2192
|
+
OverlayPositionBuilder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayPositionBuilder, providedIn: 'root' });
|
|
2193
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayPositionBuilder, decorators: [{
|
|
2136
2194
|
type: Injectable,
|
|
2137
2195
|
args: [{ providedIn: 'root' }]
|
|
2138
2196
|
}], ctorParameters: function () {
|
|
@@ -2181,9 +2239,9 @@ class BaseOverlayDispatcher {
|
|
|
2181
2239
|
}
|
|
2182
2240
|
}
|
|
2183
2241
|
}
|
|
2184
|
-
BaseOverlayDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2185
|
-
BaseOverlayDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2186
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2242
|
+
BaseOverlayDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: BaseOverlayDispatcher, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2243
|
+
BaseOverlayDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: BaseOverlayDispatcher, providedIn: 'root' });
|
|
2244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: BaseOverlayDispatcher, decorators: [{
|
|
2187
2245
|
type: Injectable,
|
|
2188
2246
|
args: [{ providedIn: 'root' }]
|
|
2189
2247
|
}], ctorParameters: function () {
|
|
@@ -2206,8 +2264,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ng
|
|
|
2206
2264
|
* on event target and order of overlay opens.
|
|
2207
2265
|
*/
|
|
2208
2266
|
class OverlayKeyboardDispatcher extends BaseOverlayDispatcher {
|
|
2209
|
-
constructor(document
|
|
2267
|
+
constructor(document,
|
|
2268
|
+
/** @breaking-change 14.0.0 _ngZone will be required. */
|
|
2269
|
+
_ngZone) {
|
|
2210
2270
|
super(document);
|
|
2271
|
+
this._ngZone = _ngZone;
|
|
2211
2272
|
/** Keyboard event listener that will be attached to the body. */
|
|
2212
2273
|
this._keydownListener = (event) => {
|
|
2213
2274
|
const overlays = this._attachedOverlays;
|
|
@@ -2219,7 +2280,14 @@ class OverlayKeyboardDispatcher extends BaseOverlayDispatcher {
|
|
|
2219
2280
|
// because we don't want overlays that don't handle keyboard events to block the ones below
|
|
2220
2281
|
// them that do.
|
|
2221
2282
|
if (overlays[i]._keydownEvents.observers.length > 0) {
|
|
2222
|
-
overlays[i]._keydownEvents
|
|
2283
|
+
const keydownEvents = overlays[i]._keydownEvents;
|
|
2284
|
+
/** @breaking-change 14.0.0 _ngZone will be required. */
|
|
2285
|
+
if (this._ngZone) {
|
|
2286
|
+
this._ngZone.run(() => keydownEvents.next(event));
|
|
2287
|
+
}
|
|
2288
|
+
else {
|
|
2289
|
+
keydownEvents.next(event);
|
|
2290
|
+
}
|
|
2223
2291
|
break;
|
|
2224
2292
|
}
|
|
2225
2293
|
}
|
|
@@ -2230,7 +2298,13 @@ class OverlayKeyboardDispatcher extends BaseOverlayDispatcher {
|
|
|
2230
2298
|
super.add(overlayRef);
|
|
2231
2299
|
// Lazily start dispatcher once first overlay is added
|
|
2232
2300
|
if (!this._isAttached) {
|
|
2233
|
-
|
|
2301
|
+
/** @breaking-change 14.0.0 _ngZone will be required. */
|
|
2302
|
+
if (this._ngZone) {
|
|
2303
|
+
this._ngZone.runOutsideAngular(() => this._document.body.addEventListener('keydown', this._keydownListener));
|
|
2304
|
+
}
|
|
2305
|
+
else {
|
|
2306
|
+
this._document.body.addEventListener('keydown', this._keydownListener);
|
|
2307
|
+
}
|
|
2234
2308
|
this._isAttached = true;
|
|
2235
2309
|
}
|
|
2236
2310
|
}
|
|
@@ -2242,15 +2316,17 @@ class OverlayKeyboardDispatcher extends BaseOverlayDispatcher {
|
|
|
2242
2316
|
}
|
|
2243
2317
|
}
|
|
2244
2318
|
}
|
|
2245
|
-
OverlayKeyboardDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2246
|
-
OverlayKeyboardDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2247
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2319
|
+
OverlayKeyboardDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayKeyboardDispatcher, deps: [{ token: DOCUMENT }, { token: i0.NgZone, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2320
|
+
OverlayKeyboardDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayKeyboardDispatcher, providedIn: 'root' });
|
|
2321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayKeyboardDispatcher, decorators: [{
|
|
2248
2322
|
type: Injectable,
|
|
2249
2323
|
args: [{ providedIn: 'root' }]
|
|
2250
2324
|
}], ctorParameters: function () {
|
|
2251
2325
|
return [{ type: undefined, decorators: [{
|
|
2252
2326
|
type: Inject,
|
|
2253
2327
|
args: [DOCUMENT]
|
|
2328
|
+
}] }, { type: i0.NgZone, decorators: [{
|
|
2329
|
+
type: Optional
|
|
2254
2330
|
}] }];
|
|
2255
2331
|
} });
|
|
2256
2332
|
|
|
@@ -2267,9 +2343,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ng
|
|
|
2267
2343
|
* on event target and order of overlay opens.
|
|
2268
2344
|
*/
|
|
2269
2345
|
class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
|
|
2270
|
-
constructor(document, _platform
|
|
2346
|
+
constructor(document, _platform,
|
|
2347
|
+
/** @breaking-change 14.0.0 _ngZone will be required. */
|
|
2348
|
+
_ngZone) {
|
|
2271
2349
|
super(document);
|
|
2272
2350
|
this._platform = _platform;
|
|
2351
|
+
this._ngZone = _ngZone;
|
|
2273
2352
|
this._cursorStyleIsSet = false;
|
|
2274
2353
|
/** Store pointerdown event target to track origin of click. */
|
|
2275
2354
|
this._pointerDownListener = (event) => {
|
|
@@ -2310,7 +2389,14 @@ class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
|
|
|
2310
2389
|
overlayRef.overlayElement.contains(origin)) {
|
|
2311
2390
|
break;
|
|
2312
2391
|
}
|
|
2313
|
-
overlayRef._outsidePointerEvents
|
|
2392
|
+
const outsidePointerEvents = overlayRef._outsidePointerEvents;
|
|
2393
|
+
/** @breaking-change 14.0.0 _ngZone will be required. */
|
|
2394
|
+
if (this._ngZone) {
|
|
2395
|
+
this._ngZone.run(() => outsidePointerEvents.next(event));
|
|
2396
|
+
}
|
|
2397
|
+
else {
|
|
2398
|
+
outsidePointerEvents.next(event);
|
|
2399
|
+
}
|
|
2314
2400
|
}
|
|
2315
2401
|
};
|
|
2316
2402
|
}
|
|
@@ -2325,10 +2411,13 @@ class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
|
|
|
2325
2411
|
// https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
|
|
2326
2412
|
if (!this._isAttached) {
|
|
2327
2413
|
const body = this._document.body;
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2414
|
+
/** @breaking-change 14.0.0 _ngZone will be required. */
|
|
2415
|
+
if (this._ngZone) {
|
|
2416
|
+
this._ngZone.runOutsideAngular(() => this._addEventListeners(body));
|
|
2417
|
+
}
|
|
2418
|
+
else {
|
|
2419
|
+
this._addEventListeners(body);
|
|
2420
|
+
}
|
|
2332
2421
|
// click event is not fired on iOS. To make element "clickable" we are
|
|
2333
2422
|
// setting the cursor to pointer
|
|
2334
2423
|
if (this._platform.IOS && !this._cursorStyleIsSet) {
|
|
@@ -2354,17 +2443,25 @@ class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
|
|
|
2354
2443
|
this._isAttached = false;
|
|
2355
2444
|
}
|
|
2356
2445
|
}
|
|
2446
|
+
_addEventListeners(body) {
|
|
2447
|
+
body.addEventListener('pointerdown', this._pointerDownListener, true);
|
|
2448
|
+
body.addEventListener('click', this._clickListener, true);
|
|
2449
|
+
body.addEventListener('auxclick', this._clickListener, true);
|
|
2450
|
+
body.addEventListener('contextmenu', this._clickListener, true);
|
|
2451
|
+
}
|
|
2357
2452
|
}
|
|
2358
|
-
OverlayOutsideClickDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2359
|
-
OverlayOutsideClickDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2360
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2453
|
+
OverlayOutsideClickDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayOutsideClickDispatcher, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }, { token: i0.NgZone, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2454
|
+
OverlayOutsideClickDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayOutsideClickDispatcher, providedIn: 'root' });
|
|
2455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayOutsideClickDispatcher, decorators: [{
|
|
2361
2456
|
type: Injectable,
|
|
2362
2457
|
args: [{ providedIn: 'root' }]
|
|
2363
2458
|
}], ctorParameters: function () {
|
|
2364
2459
|
return [{ type: undefined, decorators: [{
|
|
2365
2460
|
type: Inject,
|
|
2366
2461
|
args: [DOCUMENT]
|
|
2367
|
-
}] }, { type: i1$1.Platform }
|
|
2462
|
+
}] }, { type: i1$1.Platform }, { type: i0.NgZone, decorators: [{
|
|
2463
|
+
type: Optional
|
|
2464
|
+
}] }];
|
|
2368
2465
|
} });
|
|
2369
2466
|
|
|
2370
2467
|
/** Next overlay unique ID. */
|
|
@@ -2382,7 +2479,7 @@ let nextUniqueId = 0;
|
|
|
2382
2479
|
class Overlay {
|
|
2383
2480
|
constructor(
|
|
2384
2481
|
/** Scrolling strategies that can be used when creating an overlay. */
|
|
2385
|
-
scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality, _location, _outsideClickDispatcher) {
|
|
2482
|
+
scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality, _location, _outsideClickDispatcher, _animationsModuleType) {
|
|
2386
2483
|
this.scrollStrategies = scrollStrategies;
|
|
2387
2484
|
this._overlayContainer = _overlayContainer;
|
|
2388
2485
|
this._componentFactoryResolver = _componentFactoryResolver;
|
|
@@ -2394,6 +2491,7 @@ class Overlay {
|
|
|
2394
2491
|
this._directionality = _directionality;
|
|
2395
2492
|
this._location = _location;
|
|
2396
2493
|
this._outsideClickDispatcher = _outsideClickDispatcher;
|
|
2494
|
+
this._animationsModuleType = _animationsModuleType;
|
|
2397
2495
|
}
|
|
2398
2496
|
/**
|
|
2399
2497
|
* Creates an overlay.
|
|
@@ -2406,7 +2504,7 @@ class Overlay {
|
|
|
2406
2504
|
const portalOutlet = this._createPortalOutlet(pane);
|
|
2407
2505
|
const overlayConfig = new OverlayConfig(config);
|
|
2408
2506
|
overlayConfig.direction = overlayConfig.direction || this._directionality.value;
|
|
2409
|
-
return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location, this._outsideClickDispatcher);
|
|
2507
|
+
return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location, this._outsideClickDispatcher, this._animationsModuleType === 'NoopAnimations');
|
|
2410
2508
|
}
|
|
2411
2509
|
/**
|
|
2412
2510
|
* Gets a position builder that can be used, via fluent API,
|
|
@@ -2451,15 +2549,20 @@ class Overlay {
|
|
|
2451
2549
|
return new DomPortalOutlet(pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);
|
|
2452
2550
|
}
|
|
2453
2551
|
}
|
|
2454
|
-
Overlay.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2455
|
-
Overlay.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2456
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2552
|
+
Overlay.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: Overlay, deps: [{ token: ScrollStrategyOptions }, { token: OverlayContainer }, { token: i0.ComponentFactoryResolver }, { token: OverlayPositionBuilder }, { token: OverlayKeyboardDispatcher }, { token: i0.Injector }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i5.Directionality }, { token: i6.Location }, { token: OverlayOutsideClickDispatcher }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2553
|
+
Overlay.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: Overlay });
|
|
2554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: Overlay, decorators: [{
|
|
2457
2555
|
type: Injectable
|
|
2458
2556
|
}], ctorParameters: function () {
|
|
2459
2557
|
return [{ type: ScrollStrategyOptions }, { type: OverlayContainer }, { type: i0.ComponentFactoryResolver }, { type: OverlayPositionBuilder }, { type: OverlayKeyboardDispatcher }, { type: i0.Injector }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
2460
2558
|
type: Inject,
|
|
2461
2559
|
args: [DOCUMENT]
|
|
2462
|
-
}] }, { type: i5.Directionality }, { type: i6.Location }, { type: OverlayOutsideClickDispatcher }
|
|
2560
|
+
}] }, { type: i5.Directionality }, { type: i6.Location }, { type: OverlayOutsideClickDispatcher }, { type: undefined, decorators: [{
|
|
2561
|
+
type: Inject,
|
|
2562
|
+
args: [ANIMATION_MODULE_TYPE]
|
|
2563
|
+
}, {
|
|
2564
|
+
type: Optional
|
|
2565
|
+
}] }];
|
|
2463
2566
|
} });
|
|
2464
2567
|
|
|
2465
2568
|
/** Default set of positions for the overlay. Follows the behavior of a dropdown. */
|
|
@@ -2502,9 +2605,9 @@ class CdkOverlayOrigin {
|
|
|
2502
2605
|
this.elementRef = elementRef;
|
|
2503
2606
|
}
|
|
2504
2607
|
}
|
|
2505
|
-
CdkOverlayOrigin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2506
|
-
CdkOverlayOrigin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2507
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2608
|
+
CdkOverlayOrigin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkOverlayOrigin, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2609
|
+
CdkOverlayOrigin.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.13", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"], ngImport: i0 });
|
|
2610
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkOverlayOrigin, decorators: [{
|
|
2508
2611
|
type: Directive,
|
|
2509
2612
|
args: [{
|
|
2510
2613
|
selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',
|
|
@@ -2769,9 +2872,9 @@ class CdkConnectedOverlay {
|
|
|
2769
2872
|
this._positionSubscription.unsubscribe();
|
|
2770
2873
|
}
|
|
2771
2874
|
}
|
|
2772
|
-
CdkConnectedOverlay.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2773
|
-
CdkConnectedOverlay.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2774
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2875
|
+
CdkConnectedOverlay.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkConnectedOverlay, deps: [{ token: Overlay }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY }, { token: i5.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2876
|
+
CdkConnectedOverlay.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.13", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: { origin: ["cdkConnectedOverlayOrigin", "origin"], positions: ["cdkConnectedOverlayPositions", "positions"], positionStrategy: ["cdkConnectedOverlayPositionStrategy", "positionStrategy"], offsetX: ["cdkConnectedOverlayOffsetX", "offsetX"], offsetY: ["cdkConnectedOverlayOffsetY", "offsetY"], width: ["cdkConnectedOverlayWidth", "width"], height: ["cdkConnectedOverlayHeight", "height"], minWidth: ["cdkConnectedOverlayMinWidth", "minWidth"], minHeight: ["cdkConnectedOverlayMinHeight", "minHeight"], backdropClass: ["cdkConnectedOverlayBackdropClass", "backdropClass"], panelClass: ["cdkConnectedOverlayPanelClass", "panelClass"], viewportMargin: ["cdkConnectedOverlayViewportMargin", "viewportMargin"], scrollStrategy: ["cdkConnectedOverlayScrollStrategy", "scrollStrategy"], open: ["cdkConnectedOverlayOpen", "open"], disableClose: ["cdkConnectedOverlayDisableClose", "disableClose"], transformOriginSelector: ["cdkConnectedOverlayTransformOriginOn", "transformOriginSelector"], hasBackdrop: ["cdkConnectedOverlayHasBackdrop", "hasBackdrop"], lockPosition: ["cdkConnectedOverlayLockPosition", "lockPosition"], flexibleDimensions: ["cdkConnectedOverlayFlexibleDimensions", "flexibleDimensions"], growAfterOpen: ["cdkConnectedOverlayGrowAfterOpen", "growAfterOpen"], push: ["cdkConnectedOverlayPush", "push"] }, outputs: { backdropClick: "backdropClick", positionChange: "positionChange", attach: "attach", detach: "detach", overlayKeydown: "overlayKeydown", overlayOutsideClick: "overlayOutsideClick" }, exportAs: ["cdkConnectedOverlay"], usesOnChanges: true, ngImport: i0 });
|
|
2877
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkConnectedOverlay, decorators: [{
|
|
2775
2878
|
type: Directive,
|
|
2776
2879
|
args: [{
|
|
2777
2880
|
selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',
|
|
@@ -2880,10 +2983,10 @@ const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
|
|
|
2880
2983
|
*/
|
|
2881
2984
|
class OverlayModule {
|
|
2882
2985
|
}
|
|
2883
|
-
OverlayModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2884
|
-
OverlayModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
|
|
2885
|
-
OverlayModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2886
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2986
|
+
OverlayModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2987
|
+
OverlayModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayModule, declarations: [CdkConnectedOverlay, CdkOverlayOrigin], imports: [BidiModule, PortalModule, ScrollingModule], exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule] });
|
|
2988
|
+
OverlayModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayModule, providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER], imports: [[BidiModule, PortalModule, ScrollingModule], ScrollingModule] });
|
|
2989
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: OverlayModule, decorators: [{
|
|
2887
2990
|
type: NgModule,
|
|
2888
2991
|
args: [{
|
|
2889
2992
|
imports: [BidiModule, PortalModule, ScrollingModule],
|
|
@@ -2979,9 +3082,9 @@ class FullscreenOverlayContainer extends OverlayContainer {
|
|
|
2979
3082
|
null);
|
|
2980
3083
|
}
|
|
2981
3084
|
}
|
|
2982
|
-
FullscreenOverlayContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2983
|
-
FullscreenOverlayContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2984
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3085
|
+
FullscreenOverlayContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FullscreenOverlayContainer, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3086
|
+
FullscreenOverlayContainer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FullscreenOverlayContainer, providedIn: 'root' });
|
|
3087
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FullscreenOverlayContainer, decorators: [{
|
|
2985
3088
|
type: Injectable,
|
|
2986
3089
|
args: [{ providedIn: 'root' }]
|
|
2987
3090
|
}], ctorParameters: function () {
|
|
@@ -3011,5 +3114,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ng
|
|
|
3011
3114
|
* Generated bundle index. Do not edit.
|
|
3012
3115
|
*/
|
|
3013
3116
|
|
|
3014
|
-
export { BlockScrollStrategy, CdkConnectedOverlay, CdkOverlayOrigin, CloseScrollStrategy, ConnectedOverlayPositionChange, ConnectionPositionPair, FlexibleConnectedPositionStrategy, FullscreenOverlayContainer, GlobalPositionStrategy, NoopScrollStrategy, Overlay, OverlayConfig, OverlayContainer, OverlayKeyboardDispatcher, OverlayModule, OverlayOutsideClickDispatcher, OverlayPositionBuilder, OverlayRef, RepositionScrollStrategy, ScrollStrategyOptions, ScrollingVisibility, validateHorizontalPosition, validateVerticalPosition };
|
|
3117
|
+
export { BlockScrollStrategy, CdkConnectedOverlay, CdkOverlayOrigin, CloseScrollStrategy, ConnectedOverlayPositionChange, ConnectionPositionPair, FlexibleConnectedPositionStrategy, FullscreenOverlayContainer, GlobalPositionStrategy, NoopScrollStrategy, Overlay, OverlayConfig, OverlayContainer, OverlayKeyboardDispatcher, OverlayModule, OverlayOutsideClickDispatcher, OverlayPositionBuilder, OverlayRef, RepositionScrollStrategy, STANDARD_DROPDOWN_ADJACENT_POSITIONS, STANDARD_DROPDOWN_BELOW_POSITIONS, ScrollStrategyOptions, ScrollingVisibility, validateHorizontalPosition, validateVerticalPosition };
|
|
3015
3118
|
//# sourceMappingURL=overlay.mjs.map
|