@angular/cdk 7.2.1 → 7.2.2
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/typings/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +2 -1
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +1 -1
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +274 -126
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +2 -2
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-observers.umd.js +1 -1
- package/bundles/cdk-observers.umd.js.map +1 -1
- package/bundles/cdk-observers.umd.min.js +1 -1
- package/bundles/cdk-observers.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +13 -12
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +2 -2
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-portal.umd.js +3 -3
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +9 -6
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +1 -1
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +23 -11
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js +1 -1
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +8 -4
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +1 -1
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +1 -1
- package/bundles/cdk-text-field.umd.min.js +1 -1
- package/bundles/cdk-text-field.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/typings/directives/drag-handle.d.ts +6 -2
- package/drag-drop/typings/directives/drag.d.ts +3 -2
- package/drag-drop/typings/directives/drop-list.d.ts +2 -5
- package/drag-drop/typings/drag-ref.d.ts +27 -19
- package/drag-drop/typings/drop-list-ref.d.ts +28 -14
- package/drag-drop/typings/index.metadata.json +1 -1
- package/esm2015/a11y.js +2 -1
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/cdk.js +1 -1
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/drag-drop.js +192 -108
- package/esm2015/drag-drop.js.map +1 -1
- package/esm2015/observers.js +1 -1
- package/esm2015/observers.js.map +1 -1
- package/esm2015/overlay.js +11 -10
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/portal.js +1 -1
- package/esm2015/portal.js.map +1 -1
- package/esm2015/scrolling.js +9 -6
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/stepper.js +18 -11
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +8 -4
- package/esm2015/table.js.map +1 -1
- package/esm5/a11y.es5.js +2 -1
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/cdk.es5.js +1 -1
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/drag-drop.es5.js +276 -128
- package/esm5/drag-drop.es5.js.map +1 -1
- package/esm5/observers.es5.js +1 -1
- package/esm5/observers.es5.js.map +1 -1
- package/esm5/overlay.es5.js +13 -12
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/portal.es5.js +3 -3
- package/esm5/portal.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +9 -6
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/stepper.es5.js +23 -11
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +8 -4
- package/esm5/table.es5.js.map +1 -1
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/overlay-ref.d.ts +1 -1
- package/package.json +3 -3
- package/portal/typings/portal.d.ts +1 -1
- package/schematics/migration.json +5 -0
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +5 -0
- package/schematics/ng-update/index.js.map +1 -1
- package/schematics/ng-update/target-version.d.ts +7 -1
- package/schematics/ng-update/target-version.js +10 -0
- package/schematics/ng-update/target-version.js.map +1 -1
- package/stepper/typings/index.metadata.json +1 -1
- package/stepper/typings/stepper.d.ts +7 -1
- package/typings/a11y/index.metadata.json +1 -1
- package/typings/drag-drop/directives/drag-handle.d.ts +6 -2
- package/typings/drag-drop/directives/drag.d.ts +3 -2
- package/typings/drag-drop/directives/drop-list.d.ts +2 -5
- package/typings/drag-drop/drag-ref.d.ts +27 -19
- package/typings/drag-drop/drop-list-ref.d.ts +28 -14
- package/typings/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/a11y/index.metadata.json +1 -1
- package/typings/esm5/drag-drop/directives/drag-handle.d.ts +6 -2
- package/typings/esm5/drag-drop/directives/drag.d.ts +3 -2
- package/typings/esm5/drag-drop/directives/drop-list.d.ts +2 -5
- package/typings/esm5/drag-drop/drag-ref.d.ts +27 -19
- package/typings/esm5/drag-drop/drop-list-ref.d.ts +28 -14
- package/typings/esm5/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/overlay/index.metadata.json +1 -1
- package/typings/esm5/overlay/overlay-ref.d.ts +1 -1
- package/typings/esm5/portal/portal.d.ts +1 -1
- package/typings/esm5/stepper/index.metadata.json +1 -1
- package/typings/esm5/stepper/stepper.d.ts +7 -1
- package/typings/index.metadata.json +1 -1
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/overlay-ref.d.ts +1 -1
- package/typings/portal/portal.d.ts +1 -1
- package/typings/schematics/ng-update/index.d.ts +2 -0
- package/typings/schematics/ng-update/target-version.d.ts +7 -1
- package/typings/stepper/index.metadata.json +1 -1
- package/typings/stepper/stepper.d.ts +7 -1
|
@@ -72,7 +72,7 @@ var ContentObserver = /** @class */ (function () {
|
|
|
72
72
|
var _this = this;
|
|
73
73
|
/** @type {?} */
|
|
74
74
|
var element = coercion.coerceElement(elementOrRef);
|
|
75
|
-
return rxjs.Observable
|
|
75
|
+
return new rxjs.Observable(function (observer) {
|
|
76
76
|
/** @type {?} */
|
|
77
77
|
var stream = _this._observeElement(element);
|
|
78
78
|
/** @type {?} */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk-observers.umd.js","sources":["../../src/cdk/observers/observe-content.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceBooleanProperty, coerceNumberProperty, coerceElement} from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n Output,\n} from '@angular/core';\nimport {Observable, Subject, Subscription, Observer} from 'rxjs';\nimport {debounceTime} from 'rxjs/operators';\n\n/**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class MutationObserverFactory {\n create(callback: MutationCallback): MutationObserver | null {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n }\n}\n\n\n/** An injectable service that allows watching elements for changes to their content. */\n@Injectable({providedIn: 'root'})\nexport class ContentObserver implements OnDestroy {\n /** Keeps track of the existing MutationObservers so they can be reused. */\n private _observedElements = new Map<Element, {\n observer: MutationObserver | null,\n stream: Subject<MutationRecord[]>,\n count: number\n }>();\n\n constructor(private _mutationObserverFactory: MutationObserverFactory) {}\n\n ngOnDestroy() {\n this._observedElements.forEach((_, element) => this._cleanupObserver(element));\n }\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: Element): Observable<MutationRecord[]>;\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: ElementRef<Element>): Observable<MutationRecord[]>;\n\n observe(elementOrRef: Element | ElementRef<Element>): Observable<MutationRecord[]> {\n const element = coerceElement(elementOrRef);\n\n return Observable.create((observer: Observer<MutationRecord[]>) => {\n const stream = this._observeElement(element);\n const subscription = stream.subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n this._unobserveElement(element);\n };\n });\n }\n\n /**\n * Observes the given element by using the existing MutationObserver if available, or creating a\n * new one if not.\n */\n private _observeElement(element: Element): Subject<MutationRecord[]> {\n if (!this._observedElements.has(element)) {\n const stream = new Subject<MutationRecord[]>();\n const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations));\n if (observer) {\n observer.observe(element, {\n characterData: true,\n childList: true,\n subtree: true\n });\n }\n this._observedElements.set(element, {observer, stream, count: 1});\n } else {\n this._observedElements.get(element)!.count++;\n }\n return this._observedElements.get(element)!.stream;\n }\n\n /**\n * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is\n * observing this element.\n */\n private _unobserveElement(element: Element) {\n if (this._observedElements.has(element)) {\n this._observedElements.get(element)!.count--;\n if (!this._observedElements.get(element)!.count) {\n this._cleanupObserver(element);\n }\n }\n }\n\n /** Clean up the underlying MutationObserver for the specified element. */\n private _cleanupObserver(element: Element) {\n if (this._observedElements.has(element)) {\n const {observer, stream} = this._observedElements.get(element)!;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n }\n}\n\n\n/**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\n@Directive({\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n})\nexport class CdkObserveContent implements AfterContentInit, OnDestroy {\n /** Event emitted for each change in the element's content. */\n @Output('cdkObserveContent') event = new EventEmitter<MutationRecord[]>();\n\n /**\n * Whether observing content is disabled. This option can be used\n * to disconnect the underlying MutationObserver until it is needed.\n */\n @Input('cdkObserveContentDisabled')\n get disabled() { return this._disabled; }\n set disabled(value: any) {\n this._disabled = coerceBooleanProperty(value);\n this._disabled ? this._unsubscribe() : this._subscribe();\n }\n private _disabled = false;\n\n /** Debounce interval for emitting the changes. */\n @Input()\n get debounce(): number { return this._debounce; }\n set debounce(value: number) {\n this._debounce = coerceNumberProperty(value);\n this._subscribe();\n }\n private _debounce: number;\n\n private _currentSubscription: Subscription | null = null;\n\n constructor(private _contentObserver: ContentObserver,\n private _elementRef: ElementRef<HTMLElement>,\n private _ngZone: NgZone) {}\n\n ngAfterContentInit() {\n if (!this._currentSubscription && !this.disabled) {\n this._subscribe();\n }\n }\n\n ngOnDestroy() {\n this._unsubscribe();\n }\n\n private _subscribe() {\n this._unsubscribe();\n const stream = this._contentObserver.observe(this._elementRef);\n\n // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone.\n // Consider brining it back inside the zone next time we're making breaking changes.\n // Bringing it back inside can cause things like infinite change detection loops and changed\n // after checked errors if people's code isn't handling it properly.\n this._ngZone.runOutsideAngular(() => {\n this._currentSubscription =\n (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);\n });\n }\n\n private _unsubscribe() {\n if (this._currentSubscription) {\n this._currentSubscription.unsubscribe();\n }\n }\n}\n\n\n@NgModule({\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n})\nexport class ObserversModule {}\n"],"names":["NgModule","Input","Output","NgZone","ElementRef","Directive","debounceTime","coerceNumberProperty","coerceBooleanProperty","EventEmitter","Injectable","Subject","Observable","coerceElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BA,AAAA,IAAA,uBAAA,kBAAA,YAAA;IAAA,SAAA,uBAAA,GAAA;KAKC;;;;;IAHC,uBAAF,CAAA,SAAA,CAAA,MAAQ;;;;IAAN,UAAO,QAA0B,EAAnC;QACI,OAAO,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,gB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\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceBooleanProperty, coerceNumberProperty, coerceElement} from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n Output,\n} from '@angular/core';\nimport {Observable, Subject, Subscription, Observer} from 'rxjs';\nimport {debounceTime} from 'rxjs/operators';\n\n/**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class MutationObserverFactory {\n create(callback: MutationCallback): MutationObserver | null {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n }\n}\n\n\n/** An injectable service that allows watching elements for changes to their content. */\n@Injectable({providedIn: 'root'})\nexport class ContentObserver implements OnDestroy {\n /** Keeps track of the existing MutationObservers so they can be reused. */\n private _observedElements = new Map<Element, {\n observer: MutationObserver | null,\n stream: Subject<MutationRecord[]>,\n count: number\n }>();\n\n constructor(private _mutationObserverFactory: MutationObserverFactory) {}\n\n ngOnDestroy() {\n this._observedElements.forEach((_, element) => this._cleanupObserver(element));\n }\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: Element): Observable<MutationRecord[]>;\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: ElementRef<Element>): Observable<MutationRecord[]>;\n\n observe(elementOrRef: Element | ElementRef<Element>): Observable<MutationRecord[]> {\n const element = coerceElement(elementOrRef);\n\n return new Observable((observer: Observer<MutationRecord[]>) => {\n const stream = this._observeElement(element);\n const subscription = stream.subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n this._unobserveElement(element);\n };\n });\n }\n\n /**\n * Observes the given element by using the existing MutationObserver if available, or creating a\n * new one if not.\n */\n private _observeElement(element: Element): Subject<MutationRecord[]> {\n if (!this._observedElements.has(element)) {\n const stream = new Subject<MutationRecord[]>();\n const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations));\n if (observer) {\n observer.observe(element, {\n characterData: true,\n childList: true,\n subtree: true\n });\n }\n this._observedElements.set(element, {observer, stream, count: 1});\n } else {\n this._observedElements.get(element)!.count++;\n }\n return this._observedElements.get(element)!.stream;\n }\n\n /**\n * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is\n * observing this element.\n */\n private _unobserveElement(element: Element) {\n if (this._observedElements.has(element)) {\n this._observedElements.get(element)!.count--;\n if (!this._observedElements.get(element)!.count) {\n this._cleanupObserver(element);\n }\n }\n }\n\n /** Clean up the underlying MutationObserver for the specified element. */\n private _cleanupObserver(element: Element) {\n if (this._observedElements.has(element)) {\n const {observer, stream} = this._observedElements.get(element)!;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n }\n}\n\n\n/**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\n@Directive({\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n})\nexport class CdkObserveContent implements AfterContentInit, OnDestroy {\n /** Event emitted for each change in the element's content. */\n @Output('cdkObserveContent') event = new EventEmitter<MutationRecord[]>();\n\n /**\n * Whether observing content is disabled. This option can be used\n * to disconnect the underlying MutationObserver until it is needed.\n */\n @Input('cdkObserveContentDisabled')\n get disabled() { return this._disabled; }\n set disabled(value: any) {\n this._disabled = coerceBooleanProperty(value);\n this._disabled ? this._unsubscribe() : this._subscribe();\n }\n private _disabled = false;\n\n /** Debounce interval for emitting the changes. */\n @Input()\n get debounce(): number { return this._debounce; }\n set debounce(value: number) {\n this._debounce = coerceNumberProperty(value);\n this._subscribe();\n }\n private _debounce: number;\n\n private _currentSubscription: Subscription | null = null;\n\n constructor(private _contentObserver: ContentObserver,\n private _elementRef: ElementRef<HTMLElement>,\n private _ngZone: NgZone) {}\n\n ngAfterContentInit() {\n if (!this._currentSubscription && !this.disabled) {\n this._subscribe();\n }\n }\n\n ngOnDestroy() {\n this._unsubscribe();\n }\n\n private _subscribe() {\n this._unsubscribe();\n const stream = this._contentObserver.observe(this._elementRef);\n\n // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone.\n // Consider brining it back inside the zone next time we're making breaking changes.\n // Bringing it back inside can cause things like infinite change detection loops and changed\n // after checked errors if people's code isn't handling it properly.\n this._ngZone.runOutsideAngular(() => {\n this._currentSubscription =\n (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);\n });\n }\n\n private _unsubscribe() {\n if (this._currentSubscription) {\n this._currentSubscription.unsubscribe();\n }\n }\n}\n\n\n@NgModule({\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n})\nexport class ObserversModule {}\n"],"names":["NgModule","Input","Output","NgZone","ElementRef","Directive","debounceTime","coerceNumberProperty","coerceBooleanProperty","EventEmitter","Injectable","Subject","Observable","coerceElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BA,AAAA,IAAA,uBAAA,kBAAA,YAAA;IAAA,SAAA,uBAAA,GAAA;KAKC;;;;;IAHC,uBAAF,CAAA,SAAA,CAAA,MAAQ;;;;IAAN,UAAO,QAA0B,EAAnC;QACI,OAAO,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;KACxF,CAAH;;QAJA,EAAA,IAAA,EAACU,eAAU,EAAX,IAAA,EAAA,CAAY,EAAC,UAAU,EAAE,MAAM,EAAC,EAAhC,EAAA;;;IA5BA,OAAA,uBAAA,CAAA;CAiCC,EAAD,CAAA,CAAC;;;;AAID,AAAA,IAAA,eAAA,kBAAA,YAAA;IASE,SAAF,eAAA,CAAsB,wBAAiD,EAAvE;QAAsB,IAAtB,CAAA,wBAA8C,GAAxB,wBAAwB,CAAyB;;;;QAN7D,IAAV,CAAA,iBAA2B,GAAG,IAAI,GAAG,EAI/B,CAAC;KAEoE;;;;IAEzE,eAAF,C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,EAAA,IAAA,EAAED,eAAU,EAAZ;QAKA,EAAA,IAAA,EAAED,WAAM,EAAR;;;QAwHA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAGD,WAAM,EAAT,IAAA,EAAA,CAAU,mBAAmB,EAA7B,EAAA,CAAA;QAMA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAGD,UAAK,EAAR,IAAA,EAAA,CAAS,2BAA2B,EAApC,EAAA,CAAA;QASA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAGA,UAAK,EAAR,CAAA;;IA2CA,OAAA,iBAAC,CAAD;CAAC,EAAD,CAAA,CAAC;AA5DD,AAAA,IA+DA,eAAA,kBAAA,YAAA;IAAA,SAAA,eAAA,GAAA;KAK+B;;QAL/B,EAAA,IAAA,EAACD,aAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,SAAS,EAAE,CAAC,uBAAuB,CAAC;iBACrC,EAAD,EAAA;;IAC8B,OAA9B,eAA+B,CAA/B;CAA+B,EAA/B,CAAA;;;;;;;;;;;;;;;"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/coercion"),require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/cdk/observers",["exports","@angular/cdk/coercion","@angular/core","rxjs","rxjs/operators"],t):t((e.ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.observers={}),e.ng.cdk.coercion,e.ng.core,e.rxjs,e.rxjs.operators)}(this,function(e,t,r,n,o){"use strict";var s=function(){function e(){}return e.prototype.create=function(e){return"undefined"==typeof MutationObserver?null:new MutationObserver(e)},e.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=r.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),i=function(){function e(e){this._mutationObserverFactory=e,this._observedElements=new Map}return e.prototype.ngOnDestroy=function(){var e=this;this._observedElements.forEach(function(t,r){return e._cleanupObserver(r)})},e.prototype.observe=function(e){var r=this,o=t.coerceElement(e);return n.Observable
|
|
8
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/coercion"),require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/cdk/observers",["exports","@angular/cdk/coercion","@angular/core","rxjs","rxjs/operators"],t):t((e.ng=e.ng||{},e.ng.cdk=e.ng.cdk||{},e.ng.cdk.observers={}),e.ng.cdk.coercion,e.ng.core,e.rxjs,e.rxjs.operators)}(this,function(e,t,r,n,o){"use strict";var s=function(){function e(){}return e.prototype.create=function(e){return"undefined"==typeof MutationObserver?null:new MutationObserver(e)},e.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],e.ngInjectableDef=r.defineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),i=function(){function e(e){this._mutationObserverFactory=e,this._observedElements=new Map}return e.prototype.ngOnDestroy=function(){var e=this;this._observedElements.forEach(function(t,r){return e._cleanupObserver(r)})},e.prototype.observe=function(e){var r=this,o=t.coerceElement(e);return new n.Observable(function(e){var t=r._observeElement(o),n=t.subscribe(e);return function(){n.unsubscribe(),r._unobserveElement(o)}})},e.prototype._observeElement=function(e){if(this._observedElements.has(e))this._observedElements.get(e).count++;else{var t=new n.Subject,r=this._mutationObserverFactory.create(function(e){return t.next(e)});r&&r.observe(e,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(e,{observer:r,stream:t,count:1})}return this._observedElements.get(e).stream},e.prototype._unobserveElement=function(e){this._observedElements.has(e)&&(--this._observedElements.get(e).count||this._cleanupObserver(e))},e.prototype._cleanupObserver=function(e){if(this._observedElements.has(e)){var t=this._observedElements.get(e),r=t.observer,n=t.stream;r&&r.disconnect(),n.complete(),this._observedElements.delete(e)}},e.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:s}]},e.ngInjectableDef=r.defineInjectable({factory:function(){return new e(r.inject(s))},token:e,providedIn:"root"}),e}(),c=function(){function e(e,t,n){this._contentObserver=e,this._elementRef=t,this._ngZone=n,this.event=new r.EventEmitter,this._disabled=!1,this._currentSubscription=null}return Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(e){this._disabled=t.coerceBooleanProperty(e),this._disabled?this._unsubscribe():this._subscribe()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"debounce",{get:function(){return this._debounce},set:function(e){this._debounce=t.coerceNumberProperty(e),this._subscribe()},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this._currentSubscription||this.disabled||this._subscribe()},e.prototype.ngOnDestroy=function(){this._unsubscribe()},e.prototype._subscribe=function(){var e=this;this._unsubscribe();var t=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(function(){e._currentSubscription=(e.debounce?t.pipe(o.debounceTime(e.debounce)):t).subscribe(e.event)})},e.prototype._unsubscribe=function(){this._currentSubscription&&this._currentSubscription.unsubscribe()},e.decorators=[{type:r.Directive,args:[{selector:"[cdkObserveContent]",exportAs:"cdkObserveContent"}]}],e.ctorParameters=function(){return[{type:i},{type:r.ElementRef},{type:r.NgZone}]},e.propDecorators={event:[{type:r.Output,args:["cdkObserveContent"]}],disabled:[{type:r.Input,args:["cdkObserveContentDisabled"]}],debounce:[{type:r.Input}]},e}(),u=function(){function e(){}return e.decorators=[{type:r.NgModule,args:[{exports:[c],declarations:[c],providers:[s]}]}],e}();e.MutationObserverFactory=s,e.ContentObserver=i,e.CdkObserveContent=c,e.ObserversModule=u,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
9
9
|
//# sourceMappingURL=cdk-observers.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk-observers.umd.min.js","sources":["../../src/cdk/observers/observe-content.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceBooleanProperty, coerceNumberProperty, coerceElement} from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n Output,\n} from '@angular/core';\nimport {Observable, Subject, Subscription, Observer} from 'rxjs';\nimport {debounceTime} from 'rxjs/operators';\n\n/**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class MutationObserverFactory {\n create(callback: MutationCallback): MutationObserver | null {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n }\n}\n\n\n/** An injectable service that allows watching elements for changes to their content. */\n@Injectable({providedIn: 'root'})\nexport class ContentObserver implements OnDestroy {\n /** Keeps track of the existing MutationObservers so they can be reused. */\n private _observedElements = new Map<Element, {\n observer: MutationObserver | null,\n stream: Subject<MutationRecord[]>,\n count: number\n }>();\n\n constructor(private _mutationObserverFactory: MutationObserverFactory) {}\n\n ngOnDestroy() {\n this._observedElements.forEach((_, element) => this._cleanupObserver(element));\n }\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: Element): Observable<MutationRecord[]>;\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: ElementRef<Element>): Observable<MutationRecord[]>;\n\n observe(elementOrRef: Element | ElementRef<Element>): Observable<MutationRecord[]> {\n const element = coerceElement(elementOrRef);\n\n return Observable.create((observer: Observer<MutationRecord[]>) => {\n const stream = this._observeElement(element);\n const subscription = stream.subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n this._unobserveElement(element);\n };\n });\n }\n\n /**\n * Observes the given element by using the existing MutationObserver if available, or creating a\n * new one if not.\n */\n private _observeElement(element: Element): Subject<MutationRecord[]> {\n if (!this._observedElements.has(element)) {\n const stream = new Subject<MutationRecord[]>();\n const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations));\n if (observer) {\n observer.observe(element, {\n characterData: true,\n childList: true,\n subtree: true\n });\n }\n this._observedElements.set(element, {observer, stream, count: 1});\n } else {\n this._observedElements.get(element)!.count++;\n }\n return this._observedElements.get(element)!.stream;\n }\n\n /**\n * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is\n * observing this element.\n */\n private _unobserveElement(element: Element) {\n if (this._observedElements.has(element)) {\n this._observedElements.get(element)!.count--;\n if (!this._observedElements.get(element)!.count) {\n this._cleanupObserver(element);\n }\n }\n }\n\n /** Clean up the underlying MutationObserver for the specified element. */\n private _cleanupObserver(element: Element) {\n if (this._observedElements.has(element)) {\n const {observer, stream} = this._observedElements.get(element)!;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n }\n}\n\n\n/**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\n@Directive({\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n})\nexport class CdkObserveContent implements AfterContentInit, OnDestroy {\n /** Event emitted for each change in the element's content. */\n @Output('cdkObserveContent') event = new EventEmitter<MutationRecord[]>();\n\n /**\n * Whether observing content is disabled. This option can be used\n * to disconnect the underlying MutationObserver until it is needed.\n */\n @Input('cdkObserveContentDisabled')\n get disabled() { return this._disabled; }\n set disabled(value: any) {\n this._disabled = coerceBooleanProperty(value);\n this._disabled ? this._unsubscribe() : this._subscribe();\n }\n private _disabled = false;\n\n /** Debounce interval for emitting the changes. */\n @Input()\n get debounce(): number { return this._debounce; }\n set debounce(value: number) {\n this._debounce = coerceNumberProperty(value);\n this._subscribe();\n }\n private _debounce: number;\n\n private _currentSubscription: Subscription | null = null;\n\n constructor(private _contentObserver: ContentObserver,\n private _elementRef: ElementRef<HTMLElement>,\n private _ngZone: NgZone) {}\n\n ngAfterContentInit() {\n if (!this._currentSubscription && !this.disabled) {\n this._subscribe();\n }\n }\n\n ngOnDestroy() {\n this._unsubscribe();\n }\n\n private _subscribe() {\n this._unsubscribe();\n const stream = this._contentObserver.observe(this._elementRef);\n\n // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone.\n // Consider brining it back inside the zone next time we're making breaking changes.\n // Bringing it back inside can cause things like infinite change detection loops and changed\n // after checked errors if people's code isn't handling it properly.\n this._ngZone.runOutsideAngular(() => {\n this._currentSubscription =\n (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);\n });\n }\n\n private _unsubscribe() {\n if (this._currentSubscription) {\n this._currentSubscription.unsubscribe();\n }\n }\n}\n\n\n@NgModule({\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n})\nexport class ObserversModule {}\n"],"names":["MutationObserverFactory","prototype","create","callback","MutationObserver","type","Injectable","args","providedIn","ContentObserver","_mutationObserverFactory","this","_observedElements","Map","ngOnDestroy","_this","forEach","_","element","_cleanupObserver","observe","elementOrRef","coerceElement","Observable","observer","stream","_observeElement","subscription","subscribe","unsubscribe","_unobserveElement","has","get","count","stream_1","Subject","mutations","next","characterData","childList","subtree","set","_a","disconnect","complete","delete","CdkObserveContent","_contentObserver","_elementRef","_ngZone","event","EventEmitter","_disabled","_currentSubscription","Object","defineProperty","value","coerceBooleanProperty","_unsubscribe","_subscribe","_debounce","coerceNumberProperty","ngAfterContentInit","disabled","runOutsideAngular","debounce","pipe","debounceTime","Directive","selector","exportAs","ElementRef","NgZone","Output","Input","ObserversModule","NgModule","exports","declarations","providers"],"mappings":";;;;;;;ieA4BA,IAAAA,GAAA,WAAA,QAAAA,MA5BA,MA8BEA,GAAFC,UAAAC,OAAE,SAAOC,GACL,MAAmC,mBAArBC,kBAAmC,KAAO,GAAIA,kBAAiBD,mBAHjFE,KAACC,EAAAA,WAADC,OAAaC,WAAY,8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kE,EAAAA,aAKFlE,KAAEmE,EAAAA,4BAwHFtB,QAAA7C,KAAGoE,EAAAA,OAAHlE,MAAU,uBAMVwD,WAAA1D,KAAGqE,EAAAA,MAAHnE,MAAS,+BAST0D,WAAA5D,KAAGqE,EAAAA,SA2CH5B,KAGA6B,EAAA,WAAA,QAAAA,MAK8B,sBAL9BtE,KAACuE,EAAAA,SAADrE,OACEsE,SAAU/B,GACVgC,cAAehC,GACfiC,WAAY/E,OAEd2E"}
|
|
1
|
+
{"version":3,"file":"cdk-observers.umd.min.js","sources":["../../src/cdk/observers/observe-content.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {coerceBooleanProperty, coerceNumberProperty, coerceElement} from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n Output,\n} from '@angular/core';\nimport {Observable, Subject, Subscription, Observer} from 'rxjs';\nimport {debounceTime} from 'rxjs/operators';\n\n/**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class MutationObserverFactory {\n create(callback: MutationCallback): MutationObserver | null {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n }\n}\n\n\n/** An injectable service that allows watching elements for changes to their content. */\n@Injectable({providedIn: 'root'})\nexport class ContentObserver implements OnDestroy {\n /** Keeps track of the existing MutationObservers so they can be reused. */\n private _observedElements = new Map<Element, {\n observer: MutationObserver | null,\n stream: Subject<MutationRecord[]>,\n count: number\n }>();\n\n constructor(private _mutationObserverFactory: MutationObserverFactory) {}\n\n ngOnDestroy() {\n this._observedElements.forEach((_, element) => this._cleanupObserver(element));\n }\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: Element): Observable<MutationRecord[]>;\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: ElementRef<Element>): Observable<MutationRecord[]>;\n\n observe(elementOrRef: Element | ElementRef<Element>): Observable<MutationRecord[]> {\n const element = coerceElement(elementOrRef);\n\n return new Observable((observer: Observer<MutationRecord[]>) => {\n const stream = this._observeElement(element);\n const subscription = stream.subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n this._unobserveElement(element);\n };\n });\n }\n\n /**\n * Observes the given element by using the existing MutationObserver if available, or creating a\n * new one if not.\n */\n private _observeElement(element: Element): Subject<MutationRecord[]> {\n if (!this._observedElements.has(element)) {\n const stream = new Subject<MutationRecord[]>();\n const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations));\n if (observer) {\n observer.observe(element, {\n characterData: true,\n childList: true,\n subtree: true\n });\n }\n this._observedElements.set(element, {observer, stream, count: 1});\n } else {\n this._observedElements.get(element)!.count++;\n }\n return this._observedElements.get(element)!.stream;\n }\n\n /**\n * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is\n * observing this element.\n */\n private _unobserveElement(element: Element) {\n if (this._observedElements.has(element)) {\n this._observedElements.get(element)!.count--;\n if (!this._observedElements.get(element)!.count) {\n this._cleanupObserver(element);\n }\n }\n }\n\n /** Clean up the underlying MutationObserver for the specified element. */\n private _cleanupObserver(element: Element) {\n if (this._observedElements.has(element)) {\n const {observer, stream} = this._observedElements.get(element)!;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n }\n}\n\n\n/**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\n@Directive({\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n})\nexport class CdkObserveContent implements AfterContentInit, OnDestroy {\n /** Event emitted for each change in the element's content. */\n @Output('cdkObserveContent') event = new EventEmitter<MutationRecord[]>();\n\n /**\n * Whether observing content is disabled. This option can be used\n * to disconnect the underlying MutationObserver until it is needed.\n */\n @Input('cdkObserveContentDisabled')\n get disabled() { return this._disabled; }\n set disabled(value: any) {\n this._disabled = coerceBooleanProperty(value);\n this._disabled ? this._unsubscribe() : this._subscribe();\n }\n private _disabled = false;\n\n /** Debounce interval for emitting the changes. */\n @Input()\n get debounce(): number { return this._debounce; }\n set debounce(value: number) {\n this._debounce = coerceNumberProperty(value);\n this._subscribe();\n }\n private _debounce: number;\n\n private _currentSubscription: Subscription | null = null;\n\n constructor(private _contentObserver: ContentObserver,\n private _elementRef: ElementRef<HTMLElement>,\n private _ngZone: NgZone) {}\n\n ngAfterContentInit() {\n if (!this._currentSubscription && !this.disabled) {\n this._subscribe();\n }\n }\n\n ngOnDestroy() {\n this._unsubscribe();\n }\n\n private _subscribe() {\n this._unsubscribe();\n const stream = this._contentObserver.observe(this._elementRef);\n\n // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone.\n // Consider brining it back inside the zone next time we're making breaking changes.\n // Bringing it back inside can cause things like infinite change detection loops and changed\n // after checked errors if people's code isn't handling it properly.\n this._ngZone.runOutsideAngular(() => {\n this._currentSubscription =\n (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);\n });\n }\n\n private _unsubscribe() {\n if (this._currentSubscription) {\n this._currentSubscription.unsubscribe();\n }\n }\n}\n\n\n@NgModule({\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n})\nexport class ObserversModule {}\n"],"names":["MutationObserverFactory","prototype","create","callback","MutationObserver","type","Injectable","args","providedIn","ContentObserver","_mutationObserverFactory","this","_observedElements","Map","ngOnDestroy","_this","forEach","_","element","_cleanupObserver","observe","elementOrRef","coerceElement","Observable","observer","stream","_observeElement","subscription","subscribe","unsubscribe","_unobserveElement","has","get","count","stream_1","Subject","mutations","next","characterData","childList","subtree","set","_a","disconnect","complete","delete","CdkObserveContent","_contentObserver","_elementRef","_ngZone","event","EventEmitter","_disabled","_currentSubscription","Object","defineProperty","value","coerceBooleanProperty","_unsubscribe","_subscribe","_debounce","coerceNumberProperty","ngAfterContentInit","disabled","runOutsideAngular","debounce","pipe","debounceTime","Directive","selector","exportAs","ElementRef","NgZone","Output","Input","ObserversModule","NgModule","exports","declarations","providers"],"mappings":";;;;;;;ieA4BA,IAAAA,GAAA,WAAA,QAAAA,MA5BA,MA8BEA,GAAFC,UAAAC,OAAE,SAAOC,GACL,MAAmC,mBAArBC,kBAAmC,KAAO,GAAIA,kBAAiBD,mBAHjFE,KAACC,EAAAA,WAADC,OAAaC,WAAY,8GA5BzBR,KAqCAS,EAAA,WASE,QAAFA,GAAsBC,GAAAC,KAAtBD,yBAAsBA,EANZC,KAAVC,kBAA8B,GAAIC,KAxClC,MAgDEJ,GAAFR,UAAAa,YAAE,WAAA,GAAFC,GAAAJ,IACIA,MAAKC,kBAAkBI,QAAQ,SAACC,EAAGC,GAAY,MAAAH,GAAKI,iBAAiBD,MAevET,EAAFR,UAAAmB,QAAE,SAAQC,GAAR,GAAFN,GAAAJ,KACUO,EAAUI,EAAAA,cAAcD,EAE9B,OAAO,IAAIE,GAAAA,WAAW,SAACC,GAC3B,GAAYC,GAASV,EAAKW,gBAAgBR,GAC9BS,EAAeF,EAAOG,UAAUJ,EAEtC,OAAO,YACLG,EAAaE,cACbd,EAAKe,kBAAkBZ,OASrBT,EAAVR,UAAAyB,gBAAE,SAAwBR,GACtB,GAAKP,KAAKC,kBAAkBmB,IAAIb,GAY9BP,KAAKC,kBAAkBoB,IAAId,GAAUe,YAZG,CAC9C,GAAYC,GAAS,GAAIC,GAAAA,QACbX,EAAWb,KAAKD,yBAAyBR,OAAO,SAAAkC,GAAa,MAAAF,GAAOG,KAAKD,IAC3EZ,IACFA,EAASJ,QAAQF,GACfoB,eAAe,EACfC,WAAW,EACXC,SAAS,IAGb7B,KAAKC,kBAAkB6B,IAAIvB,GAAUM,SAA3CA,EAAqDC,OAArDS,EAA6DD,MAAO,IAIhE,MAAOtB,MAAKC,kBAAkBoB,IAAId,GAAUO,QAOtChB,EAAVR,UAAA6B,kBAAE,SAA0B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BAAkB,WAC7BjD,EAAKsC,sBACAtC,EAAKkD,SAAWxC,EAAOyC,KAAKC,EAAAA,aAAapD,EAAKkD,WAAaxC,GAAQG,UAAUb,EAAKmC,UAInFJ,EAAV7C,UAAAyD,aAAE,WACM/C,KAAK0C,sBACP1C,KAAK0C,qBAAqBxB,8BA7DhCxB,KAAC+D,EAAAA,UAAD7D,OACE8D,SAAU,sBACVC,SAAU,4DA6BZjE,KAAwCI,IAtJxCJ,KAAEkE,EAAAA,aAKFlE,KAAEmE,EAAAA,4BAwHFtB,QAAA7C,KAAGoE,EAAAA,OAAHlE,MAAU,uBAMVwD,WAAA1D,KAAGqE,EAAAA,MAAHnE,MAAS,+BAST0D,WAAA5D,KAAGqE,EAAAA,SA2CH5B,KAGA6B,EAAA,WAAA,QAAAA,MAK8B,sBAL9BtE,KAACuE,EAAAA,SAADrE,OACEsE,SAAU/B,GACVgC,cAAehC,GACfiC,WAAY/E,OAEd2E"}
|
|
@@ -949,7 +949,7 @@ OverlayRef = /** @class */ (function () {
|
|
|
949
949
|
this._attachments = new rxjs.Subject();
|
|
950
950
|
this._detachments = new rxjs.Subject();
|
|
951
951
|
this._locationChanges = rxjs.Subscription.EMPTY;
|
|
952
|
-
this._keydownEventsObservable = rxjs.Observable
|
|
952
|
+
this._keydownEventsObservable = new rxjs.Observable(function (observer) {
|
|
953
953
|
/** @type {?} */
|
|
954
954
|
var subscription = _this._keydownEvents.subscribe(observer);
|
|
955
955
|
_this._keydownEventSubscriptions++;
|
|
@@ -1217,13 +1217,13 @@ OverlayRef = /** @class */ (function () {
|
|
|
1217
1217
|
function () {
|
|
1218
1218
|
return this._keydownEventsObservable;
|
|
1219
1219
|
};
|
|
1220
|
-
/** Gets the
|
|
1220
|
+
/** Gets the current overlay configuration, which is immutable. */
|
|
1221
1221
|
/**
|
|
1222
|
-
* Gets the
|
|
1222
|
+
* Gets the current overlay configuration, which is immutable.
|
|
1223
1223
|
* @return {?}
|
|
1224
1224
|
*/
|
|
1225
1225
|
OverlayRef.prototype.getConfig = /**
|
|
1226
|
-
* Gets the
|
|
1226
|
+
* Gets the current overlay configuration, which is immutable.
|
|
1227
1227
|
* @return {?}
|
|
1228
1228
|
*/
|
|
1229
1229
|
function () {
|
|
@@ -1647,7 +1647,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
|
|
|
1647
1647
|
/**
|
|
1648
1648
|
* Observable sequence of position changes.
|
|
1649
1649
|
*/
|
|
1650
|
-
this.positionChanges = rxjs.Observable
|
|
1650
|
+
this.positionChanges = new rxjs.Observable(function (observer) {
|
|
1651
1651
|
/** @type {?} */
|
|
1652
1652
|
var subscription = _this._positionChanges.subscribe(observer);
|
|
1653
1653
|
_this._positionChangeSubscriptions++;
|
|
@@ -2581,7 +2581,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
|
|
|
2581
2581
|
if (position.overlayY === 'top') {
|
|
2582
2582
|
// Overlay is opening "downward" and thus is bound by the bottom viewport edge.
|
|
2583
2583
|
top = origin.y;
|
|
2584
|
-
height = viewport.
|
|
2584
|
+
height = viewport.height - top + this._viewportMargin;
|
|
2585
2585
|
}
|
|
2586
2586
|
else if (position.overlayY === 'bottom') {
|
|
2587
2587
|
// Overlay is opening "upward" and thus is bound by the top viewport edge. We need to add
|
|
@@ -2760,6 +2760,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
|
|
|
2760
2760
|
bottom: '',
|
|
2761
2761
|
right: '',
|
|
2762
2762
|
position: '',
|
|
2763
|
+
transform: '',
|
|
2763
2764
|
})));
|
|
2764
2765
|
};
|
|
2765
2766
|
/** Sets positioning styles to the overlay element. */
|
|
@@ -4408,6 +4409,12 @@ var CdkConnectedOverlay = /** @class */ (function () {
|
|
|
4408
4409
|
function (changes) {
|
|
4409
4410
|
if (this._position) {
|
|
4410
4411
|
this._updatePositionStrategy(this._position);
|
|
4412
|
+
this._overlayRef.updateSize({
|
|
4413
|
+
width: this.width,
|
|
4414
|
+
minWidth: this.minWidth,
|
|
4415
|
+
height: this.height,
|
|
4416
|
+
minHeight: this.minHeight,
|
|
4417
|
+
});
|
|
4411
4418
|
if (changes['origin'] && this.open) {
|
|
4412
4419
|
this._position.apply();
|
|
4413
4420
|
}
|
|
@@ -4551,12 +4558,6 @@ var CdkConnectedOverlay = /** @class */ (function () {
|
|
|
4551
4558
|
}
|
|
4552
4559
|
else {
|
|
4553
4560
|
// Update the overlay size, in case the directive's inputs have changed
|
|
4554
|
-
this._overlayRef.updateSize({
|
|
4555
|
-
width: this.width,
|
|
4556
|
-
minWidth: this.minWidth,
|
|
4557
|
-
height: this.height,
|
|
4558
|
-
minHeight: this.minHeight,
|
|
4559
|
-
});
|
|
4560
4561
|
this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;
|
|
4561
4562
|
}
|
|
4562
4563
|
if (!this._overlayRef.hasAttached()) {
|