@angular/cdk 7.2.0 → 7.2.1

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.
Files changed (110) hide show
  1. package/LICENSE +1 -1
  2. package/_a11y.scss +1 -1
  3. package/a11y/typings/focus-monitor/focus-monitor.d.ts +0 -1
  4. package/a11y/typings/focus-trap/focus-trap.d.ts +2 -0
  5. package/a11y/typings/index.metadata.json +1 -1
  6. package/bundles/cdk-a11y.umd.js +23 -22
  7. package/bundles/cdk-a11y.umd.js.map +1 -1
  8. package/bundles/cdk-a11y.umd.min.js +1 -1
  9. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  10. package/bundles/cdk-coercion.umd.js +20 -4
  11. package/bundles/cdk-coercion.umd.js.map +1 -1
  12. package/bundles/cdk-coercion.umd.min.js +1 -1
  13. package/bundles/cdk-coercion.umd.min.js.map +1 -1
  14. package/bundles/cdk-drag-drop.umd.js +43 -21
  15. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  16. package/bundles/cdk-drag-drop.umd.min.js +2 -2
  17. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  18. package/bundles/cdk-observers.umd.js +1 -1
  19. package/bundles/cdk-observers.umd.js.map +1 -1
  20. package/bundles/cdk-observers.umd.min.js +1 -1
  21. package/bundles/cdk-observers.umd.min.js.map +1 -1
  22. package/bundles/cdk-overlay.umd.js +9 -19
  23. package/bundles/cdk-overlay.umd.js.map +1 -1
  24. package/bundles/cdk-overlay.umd.min.js +2 -2
  25. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  26. package/bundles/cdk-text-field.umd.js +6 -6
  27. package/bundles/cdk-text-field.umd.js.map +1 -1
  28. package/bundles/cdk-text-field.umd.min.js +1 -1
  29. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  30. package/bundles/cdk-tree.umd.js.map +1 -1
  31. package/bundles/cdk-tree.umd.min.js.map +1 -1
  32. package/bundles/cdk.umd.js +1 -1
  33. package/bundles/cdk.umd.js.map +1 -1
  34. package/bundles/cdk.umd.min.js +1 -1
  35. package/bundles/cdk.umd.min.js.map +1 -1
  36. package/coercion/typings/element.d.ts +13 -0
  37. package/coercion/typings/index.metadata.json +1 -1
  38. package/coercion/typings/public-api.d.ts +1 -0
  39. package/drag-drop/typings/directives/drag.d.ts +5 -4
  40. package/drag-drop/typings/drag-ref.d.ts +2 -2
  41. package/drag-drop/typings/index.metadata.json +1 -1
  42. package/esm2015/a11y.js +23 -18
  43. package/esm2015/a11y.js.map +1 -1
  44. package/esm2015/cdk.js +1 -1
  45. package/esm2015/cdk.js.map +1 -1
  46. package/esm2015/coercion.js +18 -1
  47. package/esm2015/coercion.js.map +1 -1
  48. package/esm2015/drag-drop.js +37 -19
  49. package/esm2015/drag-drop.js.map +1 -1
  50. package/esm2015/observers.js +2 -2
  51. package/esm2015/observers.js.map +1 -1
  52. package/esm2015/overlay.js +11 -15
  53. package/esm2015/overlay.js.map +1 -1
  54. package/esm2015/text-field.js +3 -3
  55. package/esm2015/text-field.js.map +1 -1
  56. package/esm2015/tree.js.map +1 -1
  57. package/esm5/a11y.es5.js +24 -23
  58. package/esm5/a11y.es5.js.map +1 -1
  59. package/esm5/cdk.es5.js +1 -1
  60. package/esm5/cdk.es5.js.map +1 -1
  61. package/esm5/coercion.es5.js +18 -1
  62. package/esm5/coercion.es5.js.map +1 -1
  63. package/esm5/drag-drop.es5.js +43 -21
  64. package/esm5/drag-drop.es5.js.map +1 -1
  65. package/esm5/observers.es5.js +2 -2
  66. package/esm5/observers.es5.js.map +1 -1
  67. package/esm5/overlay.es5.js +11 -21
  68. package/esm5/overlay.es5.js.map +1 -1
  69. package/esm5/text-field.es5.js +3 -3
  70. package/esm5/text-field.es5.js.map +1 -1
  71. package/esm5/tree.es5.js.map +1 -1
  72. package/overlay/typings/index.metadata.json +1 -1
  73. package/overlay/typings/overlay-directives.d.ts +0 -2
  74. package/package.json +4 -4
  75. package/text-field/typings/index.metadata.json +1 -1
  76. package/tree/typings/control/base-tree-control.d.ts +1 -1
  77. package/tree/typings/control/nested-tree-control.d.ts +2 -2
  78. package/tree/typings/control/tree-control.d.ts +1 -1
  79. package/typings/a11y/focus-monitor/focus-monitor.d.ts +0 -1
  80. package/typings/a11y/focus-trap/focus-trap.d.ts +2 -0
  81. package/typings/a11y/index.metadata.json +1 -1
  82. package/typings/coercion/element.d.ts +13 -0
  83. package/typings/coercion/index.metadata.json +1 -1
  84. package/typings/coercion/public-api.d.ts +1 -0
  85. package/typings/drag-drop/directives/drag.d.ts +5 -4
  86. package/typings/drag-drop/drag-ref.d.ts +2 -2
  87. package/typings/drag-drop/index.metadata.json +1 -1
  88. package/typings/esm5/a11y/focus-monitor/focus-monitor.d.ts +0 -1
  89. package/typings/esm5/a11y/focus-trap/focus-trap.d.ts +2 -0
  90. package/typings/esm5/a11y/index.metadata.json +1 -1
  91. package/typings/esm5/coercion/element.d.ts +13 -0
  92. package/typings/esm5/coercion/index.metadata.json +1 -1
  93. package/typings/esm5/coercion/public-api.d.ts +1 -0
  94. package/typings/esm5/drag-drop/directives/drag.d.ts +5 -4
  95. package/typings/esm5/drag-drop/drag-ref.d.ts +2 -2
  96. package/typings/esm5/drag-drop/index.metadata.json +1 -1
  97. package/typings/esm5/index.metadata.json +1 -1
  98. package/typings/esm5/overlay/index.metadata.json +1 -1
  99. package/typings/esm5/overlay/overlay-directives.d.ts +0 -2
  100. package/typings/esm5/text-field/index.metadata.json +1 -1
  101. package/typings/esm5/tree/control/base-tree-control.d.ts +1 -1
  102. package/typings/esm5/tree/control/nested-tree-control.d.ts +2 -2
  103. package/typings/esm5/tree/control/tree-control.d.ts +1 -1
  104. package/typings/index.metadata.json +1 -1
  105. package/typings/overlay/index.metadata.json +1 -1
  106. package/typings/overlay/overlay-directives.d.ts +0 -2
  107. package/typings/text-field/index.metadata.json +1 -1
  108. package/typings/tree/control/base-tree-control.d.ts +1 -1
  109. package/typings/tree/control/nested-tree-control.d.ts +2 -2
  110. package/typings/tree/control/tree-control.d.ts +1 -1
@@ -5,7 +5,7 @@
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
- import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
8
+ import { coerceBooleanProperty, coerceNumberProperty, coerceElement } from '@angular/cdk/coercion';
9
9
  import { Directive, ElementRef, EventEmitter, Injectable, Input, NgModule, NgZone, Output, defineInjectable, inject } from '@angular/core';
10
10
  import { Observable, Subject } from 'rxjs';
11
11
  import { debounceTime } from 'rxjs/operators';
@@ -70,7 +70,7 @@ var ContentObserver = /** @class */ (function () {
70
70
  function (elementOrRef) {
71
71
  var _this = this;
72
72
  /** @type {?} */
73
- var element = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;
73
+ var element = coerceElement(elementOrRef);
74
74
  return Observable.create(function (observer) {
75
75
  /** @type {?} */
76
76
  var stream = _this._observeElement(element);
@@ -1 +1 @@
1
- {"version":3,"file":"observers.es5.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} 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 = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : 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":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA4BA,AAAA,IAAA,uBAAA,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jC,SAAS,EAAE,CAAC,uBAAuB,CAAC;iBACrC,EAAD,EAAA;;IAC8B,OAA9B,eAA+B,CAA/B;CAA+B,EAA/B,CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"observers.es5.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":[],"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,EAAC,UAAU,EAAX,IAAA,EAAA,CAAY,EAAC,UAAU,EAAE,MAAM,EAAC,EAAhC,EAAA;;;IA5BA,OAAA,uBAAA,CAAA;CAiCC,EAAD,CAAA,CAAC;AAJD;;;AAQA,AAAA,IAAA,eAAA,kBAAA,YAAA;IASE,SAAF,eAAA,CAAsB,wBAAiD,EAAvE;QAAsB,IAAtB,CAAA,wBAA8C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Q,EAAE,qBAAqB;oBAC/B,QAAQ,EAAE,mBAAmB;iBAC9B,EAAD,EAAA;;;;QA4BA,EAAA,IAAA,EAAwC,eAAe,EAAvD;QAtJA,EAAA,IAAA,EAAE,UAAU,EAAZ;QAKA,EAAA,IAAA,EAAE,MAAM,EAAR;;;QAwHA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAG,MAAM,EAAT,IAAA,EAAA,CAAU,mBAAmB,EAA7B,EAAA,CAAA;QAMA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,IAAA,EAAA,CAAS,2BAA2B,EAApC,EAAA,CAAA;QASA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,CAAA;;IA2CA,OAAA,iBAAC,CAAD;CAAC,EAAD,CAAA,CAAC;AA5DD,AA+DA,IAAA,eAAA,kBAAA,YAAA;IAAA,SAAA,eAAA,GAAA;KAK+B;;QAL/B,EAAA,IAAA,EAAC,QAAQ,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,11 +5,11 @@
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
- import { coerceCssPixelValue, coerceArray, coerceBooleanProperty } from '@angular/cdk/coercion';
8
+ import { coerceCssPixelValue, coerceArray, coerceElement, coerceBooleanProperty } from '@angular/cdk/coercion';
9
9
  import { ScrollDispatcher, ViewportRuler, ScrollingModule, VIEWPORT_RULER_PROVIDER } from '@angular/cdk/scrolling';
10
10
  export { ViewportRuler, VIEWPORT_RULER_PROVIDER, CdkScrollable, ScrollDispatcher } from '@angular/cdk/scrolling';
11
11
  import { DOCUMENT, Location } from '@angular/common';
12
- import { Inject, Injectable, NgZone, Optional, NgModule, SkipSelf, ApplicationRef, ComponentFactoryResolver, Injector, ElementRef, Directive, EventEmitter, InjectionToken, Input, Output, TemplateRef, ViewContainerRef, defineInjectable, inject } from '@angular/core';
12
+ import { Inject, Injectable, NgZone, Optional, NgModule, SkipSelf, ApplicationRef, ComponentFactoryResolver, Injector, Directive, ElementRef, EventEmitter, InjectionToken, Input, Output, TemplateRef, ViewContainerRef, defineInjectable, inject } from '@angular/core';
13
13
  import { __assign, __extends } from 'tslib';
14
14
  import { Observable, Subject, merge, Subscription } from 'rxjs';
15
15
  import { take, takeUntil } from 'rxjs/operators';
@@ -2080,7 +2080,7 @@ FlexibleConnectedPositionStrategy = /** @class */ (function () {
2080
2080
  * @return {THIS}
2081
2081
  */
2082
2082
  function (origin) {
2083
- (/** @type {?} */ (this))._origin = origin instanceof ElementRef ? origin.nativeElement : origin;
2083
+ (/** @type {?} */ (this))._origin = coerceElement(origin);
2084
2084
  return (/** @type {?} */ (this));
2085
2085
  };
2086
2086
  /**
@@ -4359,7 +4359,10 @@ var CdkConnectedOverlay = /** @class */ (function () {
4359
4359
  * @return {?}
4360
4360
  */
4361
4361
  function () {
4362
- this._destroyOverlay();
4362
+ if (this._overlayRef) {
4363
+ this._overlayRef.dispose();
4364
+ }
4365
+ this._backdropSubscription.unsubscribe();
4363
4366
  };
4364
4367
  /**
4365
4368
  * @param {?} changes
@@ -4521,6 +4524,7 @@ var CdkConnectedOverlay = /** @class */ (function () {
4521
4524
  height: this.height,
4522
4525
  minHeight: this.minHeight,
4523
4526
  });
4527
+ this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;
4524
4528
  }
4525
4529
  if (!this._overlayRef.hasAttached()) {
4526
4530
  this._overlayRef.attach(this._templatePortal);
@@ -4531,6 +4535,9 @@ var CdkConnectedOverlay = /** @class */ (function () {
4531
4535
  _this.backdropClick.emit(event);
4532
4536
  });
4533
4537
  }
4538
+ else {
4539
+ this._backdropSubscription.unsubscribe();
4540
+ }
4534
4541
  };
4535
4542
  /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */
4536
4543
  /**
@@ -4550,23 +4557,6 @@ var CdkConnectedOverlay = /** @class */ (function () {
4550
4557
  }
4551
4558
  this._backdropSubscription.unsubscribe();
4552
4559
  };
4553
- /** Destroys the overlay created by this directive. */
4554
- /**
4555
- * Destroys the overlay created by this directive.
4556
- * @private
4557
- * @return {?}
4558
- */
4559
- CdkConnectedOverlay.prototype._destroyOverlay = /**
4560
- * Destroys the overlay created by this directive.
4561
- * @private
4562
- * @return {?}
4563
- */
4564
- function () {
4565
- if (this._overlayRef) {
4566
- this._overlayRef.dispose();
4567
- }
4568
- this._backdropSubscription.unsubscribe();
4569
- };
4570
4560
  CdkConnectedOverlay.decorators = [
4571
4561
  { type: Directive, args: [{
4572
4562
  selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',