@angular/cdk 11.0.0-rc.4 → 11.0.3

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 (82) hide show
  1. package/a11y/focus-trap/focus-trap.d.ts +8 -8
  2. package/a11y/index.metadata.json +1 -1
  3. package/bundles/cdk-a11y.umd.js +18 -13
  4. package/bundles/cdk-a11y.umd.js.map +1 -1
  5. package/bundles/cdk-a11y.umd.min.js +7 -7
  6. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  7. package/bundles/cdk-coercion.umd.js +5 -5
  8. package/bundles/cdk-coercion.umd.js.map +1 -1
  9. package/bundles/cdk-coercion.umd.min.js.map +1 -1
  10. package/bundles/cdk-collections.umd.js +5 -5
  11. package/bundles/cdk-collections.umd.js.map +1 -1
  12. package/bundles/cdk-collections.umd.min.js +1 -1
  13. package/bundles/cdk-collections.umd.min.js.map +1 -1
  14. package/bundles/cdk-drag-drop.umd.js +43 -11
  15. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  16. package/bundles/cdk-drag-drop.umd.min.js +8 -8
  17. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  18. package/bundles/cdk-observers.umd.js +3 -4
  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 +5 -5
  23. package/bundles/cdk-overlay.umd.js.map +1 -1
  24. package/bundles/cdk-overlay.umd.min.js +1 -1
  25. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  26. package/bundles/cdk-portal.umd.js +5 -5
  27. package/bundles/cdk-portal.umd.js.map +1 -1
  28. package/bundles/cdk-portal.umd.min.js +1 -1
  29. package/bundles/cdk-portal.umd.min.js.map +1 -1
  30. package/bundles/cdk-scrolling.umd.js +5 -5
  31. package/bundles/cdk-scrolling.umd.js.map +1 -1
  32. package/bundles/cdk-scrolling.umd.min.js +2 -2
  33. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  34. package/bundles/cdk-table.umd.js +5 -5
  35. package/bundles/cdk-table.umd.js.map +1 -1
  36. package/bundles/cdk-table.umd.min.js +1 -1
  37. package/bundles/cdk-table.umd.min.js.map +1 -1
  38. package/bundles/cdk-testing-protractor.umd.js +5 -5
  39. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  40. package/bundles/cdk-testing-protractor.umd.min.js +1 -1
  41. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  42. package/bundles/cdk-testing-testbed.umd.js +5 -5
  43. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  44. package/bundles/cdk-testing-testbed.umd.min.js +1 -1
  45. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  46. package/bundles/cdk-testing.umd.js +5 -5
  47. package/bundles/cdk-testing.umd.js.map +1 -1
  48. package/bundles/cdk-testing.umd.min.js +1 -1
  49. package/bundles/cdk-testing.umd.min.js.map +1 -1
  50. package/bundles/cdk-tree.umd.js +5 -5
  51. package/bundles/cdk-tree.umd.js.map +1 -1
  52. package/bundles/cdk-tree.umd.min.js +2 -2
  53. package/bundles/cdk-tree.umd.min.js.map +1 -1
  54. package/bundles/cdk.umd.js +1 -1
  55. package/bundles/cdk.umd.js.map +1 -1
  56. package/bundles/cdk.umd.min.js +1 -1
  57. package/bundles/cdk.umd.min.js.map +1 -1
  58. package/drag-drop/drag-ref.d.ts +13 -0
  59. package/drag-drop/index.metadata.json +1 -1
  60. package/esm2015/a11y/focus-trap/focus-trap.js +14 -9
  61. package/esm2015/drag-drop/drag-ref.js +39 -8
  62. package/esm2015/observers/observe-content.js +3 -4
  63. package/esm2015/version.js +1 -1
  64. package/fesm2015/a11y.js +13 -8
  65. package/fesm2015/a11y.js.map +1 -1
  66. package/fesm2015/cdk.js +1 -1
  67. package/fesm2015/cdk.js.map +1 -1
  68. package/fesm2015/drag-drop.js +37 -6
  69. package/fesm2015/drag-drop.js.map +1 -1
  70. package/fesm2015/observers.js +2 -3
  71. package/fesm2015/observers.js.map +1 -1
  72. package/observers/index.metadata.json +1 -1
  73. package/observers/observe-content.d.ts +2 -2
  74. package/package.json +3 -3
  75. package/schematics/migration.json +5 -0
  76. package/schematics/ng-add/index.js +1 -1
  77. package/schematics/ng-update/devkit-file-system.d.ts +1 -0
  78. package/schematics/ng-update/devkit-file-system.js +20 -13
  79. package/schematics/ng-update/index.d.ts +2 -0
  80. package/schematics/ng-update/index.js +7 -2
  81. package/schematics/update-tool/target-version.d.ts +2 -1
  82. package/schematics/update-tool/target-version.js +2 -1
@@ -87,7 +87,7 @@
87
87
  /** Clean up the underlying MutationObserver for the specified element. */
88
88
  ContentObserver.prototype._cleanupObserver = function (element) {
89
89
  if (this._observedElements.has(element)) {
90
- var _a = this._observedElements.get(element), observer = _a.observer, stream = _a.stream;
90
+ var _b = this._observedElements.get(element), observer = _b.observer, stream = _b.stream;
91
91
  if (observer) {
92
92
  observer.disconnect();
93
93
  }
@@ -163,9 +163,8 @@
163
163
  });
164
164
  };
165
165
  CdkObserveContent.prototype._unsubscribe = function () {
166
- if (this._currentSubscription) {
167
- this._currentSubscription.unsubscribe();
168
- }
166
+ var _a;
167
+ (_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
169
168
  };
170
169
  return CdkObserveContent;
171
170
  }());
@@ -1 +1 @@
1
- {"version":3,"file":"cdk-observers.umd.js","sources":["../../../../../src/cdk/observers/observe-content.ts","../../../../../src/cdk/observers/public-api.ts","../../../../../src/cdk/observers/index.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 {\n coerceBooleanProperty,\n coerceNumberProperty,\n coerceElement,\n BooleanInput\n} 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 static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_debounce: BooleanInput;\n}\n\n\n@NgModule({\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n})\nexport class ObserversModule {}\n","/**\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\nexport * from './observe-content';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Injectable","coerceElement","Observable","Subject","EventEmitter","coerceBooleanProperty","coerceNumberProperty","debounceTime","Directive","ElementRef","NgZone","Output","Input","NgModule"],"mappings":";;;;;;IAAA;;;;;;;AAQA,IAqBA;;;;AAKA;QAAA;;QACE,wCAAM,GAAN,UAAO,QAA0B;YAC/B,OAAO,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;SACxF;;;;;gBAJFA,aAAU,SAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;IAQhC;AAEA;QAQE,yBAAoB,wBAAiD;YAAjD,6BAAwB,GAAxB,wBAAwB,CAAyB;;YAN7D,sBAAiB,GAAG,IAAI,GAAG,EAI/B,CAAC;SAEoE;QAEzE,qCAAW,GAAX;YAAA,iBAEC;YADC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,UAAC,CAAC,EAAE,OAAO,IAAK,OAAA,KAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,GAAA,CAAC,CAAC;SAChF;QAcD,iCAAO,GAAP,UAAQ,YAA2C;YAAnD,iBAYC;YAXC,IAAM,OAAO,GAAGC,sBAAa,CAAC,YAAY,CAAC,CAAC;YAE5C,O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AsDR;QAAA;;;;;gBALCC,WAAQ,SAAC;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,SAAS,EAAE,CAAC,uBAAuB,CAAC;iBACrC;;;IClND;;;;;;OAMG;;ICNH;;OAEG;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"cdk-observers.umd.js","sources":["../../../../../src/cdk/observers/observe-content.ts","../../../../../src/cdk/observers/public-api.ts","../../../../../src/cdk/observers/index.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 {\n coerceBooleanProperty,\n coerceNumberProperty,\n coerceElement,\n BooleanInput,\n NumberInput\n} 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 this._currentSubscription?.unsubscribe();\n }\n\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_debounce: NumberInput;\n}\n\n\n@NgModule({\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n})\nexport class ObserversModule {}\n","/**\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\nexport * from './observe-content';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["Injectable","coerceElement","Observable","Subject","EventEmitter","coerceBooleanProperty","coerceNumberProperty","debounceTime","Directive","ElementRef","NgZone","Output","Input","NgModule"],"mappings":";;;;;;IAAA;;;;;;;AAQA,IAsBA;;;;AAKA;QAAA;;QACE,wCAAM,GAAN,U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,OAAO,CAAC,iBAAiB,CAAC;gBAC7B,KAAI,CAAC,oBAAoB;oBACrB,CAAC,KAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAACC,sBAAY,CAAC,KAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,EAAE,SAAS,CAAC,KAAI,CAAC,KAAK,CAAC,CAAC;aAC/F,CAAC,CAAC;SACJ;QAEO,wCAAY,GAAZ;;YACN,MAAA,IAAI,CAAC,oBAAoB,0CAAE,WAAW,GAAG;SAC1C;;;;gBA7DFC,YAAS,SAAC;oBACT,QAAQ,EAAE,qBAAqB;oBAC/B,QAAQ,EAAE,mBAAmB;iBAC9B;;;gBA4BuC,eAAe;gBAtJrDC,aAAU;gBAKVC,SAAM;;;wBAwHLC,SAAM,SAAC,mBAAmB;2BAM1BC,QAAK,SAAC,2BAA2B;2BASjCA,QAAK;;AAoDR;QAAA;;;;;gBALCC,WAAQ,SAAC;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,SAAS,EAAE,CAAC,uBAAuB,CAAC;iBACrC;;;ICjND;;;;;;OAMG;;ICNH;;OAEG;;;;;;;;;;;;;;;"}
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
- */var s=function(){function e(){}return e.prototype.create=function(e){return"undefined"==typeof MutationObserver?null:new MutationObserver(e)},e}();s.ɵprov=r.ɵɵdefineInjectable({factory:function e(){return new s},token:s,providedIn:"root"}),s.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}];var 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).subscribe(e);return function(){t.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._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}();i.ɵprov=r.ɵɵdefineInjectable({factory:function e(){return new i(r.ɵɵinject(s))},token:i,providedIn:"root"}),i.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],i.ctorParameters=function(){return[{type:s}]};var c,u=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:!1,configurable:!0}),Object.defineProperty(e.prototype,"debounce",{get:function(){return this._debounce},set:function(e){this._debounce=t.coerceNumberProperty(e),this._subscribe()},enumerable:!1,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}();u.decorators=[{type:r.Directive,args:[{selector:"[cdkObserveContent]",exportAs:"cdkObserveContent"}]}],u.ctorParameters=function(){return[{type:i},{type:r.ElementRef},{type:r.NgZone}]},u.propDecorators={event:[{type:r.Output,args:["cdkObserveContent"]}],disabled:[{type:r.Input,args:["cdkObserveContentDisabled"]}],debounce:[{type:r.Input}]},(c=function c(){}).decorators=[{type:r.NgModule,args:[{exports:[u],declarations:[u],providers:[s]}]}],
8
+ */var s=function(){function e(){}return e.prototype.create=function(e){return"undefined"==typeof MutationObserver?null:new MutationObserver(e)},e}();s.ɵprov=r.ɵɵdefineInjectable({factory:function e(){return new s},token:s,providedIn:"root"}),s.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}];var 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).subscribe(e);return function(){t.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._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}();i.ɵprov=r.ɵɵdefineInjectable({factory:function e(){return new i(r.ɵɵinject(s))},token:i,providedIn:"root"}),i.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],i.ctorParameters=function(){return[{type:s}]};var c,u=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:!1,configurable:!0}),Object.defineProperty(e.prototype,"debounce",{get:function(){return this._debounce},set:function(e){this._debounce=t.coerceNumberProperty(e),this._subscribe()},enumerable:!1,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(){var e;null===(e=this._currentSubscription)||void 0===e||e.unsubscribe()},e}();u.decorators=[{type:r.Directive,args:[{selector:"[cdkObserveContent]",exportAs:"cdkObserveContent"}]}],u.ctorParameters=function(){return[{type:i},{type:r.ElementRef},{type:r.NgZone}]},u.propDecorators={event:[{type:r.Output,args:["cdkObserveContent"]}],disabled:[{type:r.Input,args:["cdkObserveContentDisabled"]}],debounce:[{type:r.Input}]},(c=function c(){}).decorators=[{type:r.NgModule,args:[{exports:[u],declarations:[u],providers:[s]}]}],
9
9
  /**
10
10
  * @license
11
11
  * Copyright Google LLC All Rights Reserved.
@@ -1 +1 @@
1
- {"version":3,"sources":["src/cdk/cdk-observers.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","observers","coercion","core","rxjs","operators","this","i0","MutationObserverFactory","prototype","create","callback","MutationObserver","ɵprov","ɵɵdefineInjectable","MutationObserverFactory_Factory","token","providedIn","decorators","type","Injectable","args","ContentObserver","_mutationObserverFactory","_observedElements","Map","ngOnDestroy","_this","forEach","_","element","_cleanupObserver","observe","elementOrRef","coerceElement","Observable","observer","subscription","_observeElement","subscribe","unsubscribe","_unobserveElement","has","get","count","stream_1","Subject","mutations","next","characterData","childList","subtree","set","stream","_a","disconnect","complete","delete","ContentObserver_Factory","ɵɵinject","ctorParameters","ObserversModule","CdkObserveContent","_contentObserver","_elementRef","_ngZone","event","EventEmitter","_disabled","_currentSubscription","Object","defineProperty","value","coerceBooleanProperty","_unsubscribe","_subscribe","enumerable","configurable","_debounce","coerceNumberProperty","ngAfterContentInit","disabled","runOutsideAngular","debounce","pipe","debounceTime","Directive","selector","exportAs","ElementRef","NgZone","propDecorators","Output","Input","NgModule","declarations","providers"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,yBAA0BA,QAAQ,iBAAkBA,QAAQ,QAASA,QAAQ,mBACnJ,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,yBAA0B,CAAC,UAAW,wBAAyB,gBAAiB,OAAQ,kBAAmBJ,GACrIA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAAOQ,GAAGC,IAAIC,UAAY,IAAKV,EAAOQ,GAAGC,IAAIE,SAAUX,EAAOQ,GAAGI,KAAMZ,EAAOa,KAAMb,EAAOa,KAAKC,WAHzM,CAIEC,MAAM,SAAWb,EAASS,EAAUK,EAAIH,EAAMC,GAAa;;;;;;;OAazD,IAAIG,EAAyC,WACzC,SAASA,KAKT,OAHAA,EAAwBC,UAAUC,OAAS,SAAUC,GACjD,MAAmC,oBAArBC,iBAAmC,KAAO,IAAIA,iBAAiBD,IAE1EH,EANiC,GAQ5CA,EAAwBK,MAAQN,EAAGO,mBAAmB,CAAEtB,QAAS,SAASuB,IAAoC,OAAO,IAAIP,GAA8BQ,MAAOR,EAAyBS,WAAY,SACnMT,EAAwBU,WAAa,CACjC,CAAEC,KAAMZ,EAAGa,WAAYC,KAAM,CAAC,CAAEJ,WAAY,WAGhD,IAAIK,EAAiC,WACjC,SAASA,EAAgBC,GACrBjB,KAAKiB,yBAA2BA,EAEhCjB,KAAKkB,kBAAoB,IAAIC,I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QAAQ1B,KAAK0D,aAKhD1D,KAAK2D,QAAQiB,mBAAkB,WAC3BvD,EAAM0C,sBACD1C,EAAMwD,SAAW9B,EAAO+B,KAAK/E,EAAUgF,aAAa1D,EAAMwD,WAAa9B,GAAQd,UAAUZ,EAAMuC,WAG5GJ,EAAkBrD,UAAUiE,aAAe,WACnCpE,KAAK+D,sBACL/D,KAAK+D,qBAAqB7B,eAG3BsB,EA3D2B,GA6DtCA,EAAkB5C,WAAa,CAC3B,CAAEC,KAAMZ,EAAG+E,UAAWjE,KAAM,CAAC,CACjBkE,SAAU,sBACVC,SAAU,wBAG1B1B,EAAkBF,eAAiB,WAAc,MAAO,CACpD,CAAEzC,KAAMG,GACR,CAAEH,KAAMZ,EAAGkF,YACX,CAAEtE,KAAMZ,EAAGmF,UAEf5B,EAAkB6B,eAAiB,CAC/BzB,MAAO,CAAC,CAAE/C,KAAMZ,EAAGqF,OAAQvE,KAAM,CAAC,uBAClC4D,SAAU,CAAC,CAAE9D,KAAMZ,EAAGsF,MAAOxE,KAAM,CAAC,+BACpC8D,SAAU,CAAC,CAAEhE,KAAMZ,EAAGsF,UAEtBhC,EACA,SAASA,OAIG3C,WAAa,CACzB,CAAEC,KAAMZ,EAAGuF,SAAUzE,KAAM,CAAC,CAChB5B,QAAS,CAACqE,GACViC,aAAc,CAACjC,GACfkC,UAAW,CAACxF;;;;;;;;AAgB5Bf,EAAQqE,kBAAoBA,EAC5BrE,EAAQ6B,gBAAkBA,EAC1B7B,EAAQe,wBAA0BA,EAClCf,EAAQoE,gBAAkBA,EAE1BS,OAAOC,eAAe9E,EAAS,aAAc,CAAE+E,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/coercion'), require('@angular/core'), require('rxjs'), require('rxjs/operators')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/observers', ['exports', '@angular/cdk/coercion', '@angular/core', 'rxjs', 'rxjs/operators'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.observers = {}), global.ng.cdk.coercion, global.ng.core, global.rxjs, global.rxjs.operators));\n}(this, (function (exports, coercion, i0, rxjs, operators) { 'use strict';\n\n /**\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 /**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * @docs-private\n */\n var MutationObserverFactory = /** @class */ (function () {\n function MutationObserverFactory() {\n }\n MutationObserverFactory.prototype.create = function (callback) {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n };\n return MutationObserverFactory;\n }());\n MutationObserverFactory.ɵprov = i0.ɵɵdefineInjectable({ factory: function MutationObserverFactory_Factory() { return new MutationObserverFactory(); }, token: MutationObserverFactory, providedIn: \"root\" });\n MutationObserverFactory.decorators = [\n { type: i0.Injectable, args: [{ providedIn: 'root' },] }\n ];\n /** An injectable service that allows watching elements for changes to their content. */\n var ContentObserver = /** @class */ (function () {\n function ContentObserver(_mutationObserverFactory) {\n this._mutationObserverFactory = _mutationObserverFactory;\n /** Keeps track of the existing MutationObservers so they can be reused. */\n this._observedElements = new Map();\n }\n ContentObserver.prototype.ngOnDestroy = function () {\n var _this = this;\n this._observedElements.forEach(function (_, element) { return _this._cleanupObserver(element); });\n };\n ContentObserver.prototype.observe = function (elementOrRef) {\n var _this = this;\n var element = coercion.coerceElement(elementOrRef);\n return new rxjs.Observable(function (observer) {\n var stream = _this._observeElement(element);\n var subscription = stream.subscribe(observer);\n return function () {\n subscription.unsubscribe();\n _this._unobserveElement(element);\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 ContentObserver.prototype._observeElement = function (element) {\n if (!this._observedElements.has(element)) {\n var stream_1 = new rxjs.Subject();\n var observer = this._mutationObserverFactory.create(function (mutations) { return stream_1.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: observer, stream: stream_1, count: 1 });\n }\n else {\n this._observedElements.get(element).count++;\n }\n return this._observedElements.get(element).stream;\n };\n /**\n * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is\n * observing this element.\n */\n ContentObserver.prototype._unobserveElement = function (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 /** Clean up the underlying MutationObserver for the specified element. */\n ContentObserver.prototype._cleanupObserver = function (element) {\n if (this._observedElements.has(element)) {\n var _a = this._observedElements.get(element), observer = _a.observer, stream = _a.stream;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n };\n return ContentObserver;\n }());\n ContentObserver.ɵprov = i0.ɵɵdefineInjectable({ factory: function ContentObserver_Factory() { return new ContentObserver(i0.ɵɵinject(MutationObserverFactory)); }, token: ContentObserver, providedIn: \"root\" });\n ContentObserver.decorators = [\n { type: i0.Injectable, args: [{ providedIn: 'root' },] }\n ];\n ContentObserver.ctorParameters = function () { return [\n { type: MutationObserverFactory }\n ]; };\n /**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\n var CdkObserveContent = /** @class */ (function () {\n function CdkObserveContent(_contentObserver, _elementRef, _ngZone) {\n this._contentObserver = _contentObserver;\n this._elementRef = _elementRef;\n this._ngZone = _ngZone;\n /** Event emitted for each change in the element's content. */\n this.event = new i0.EventEmitter();\n this._disabled = false;\n this._currentSubscription = null;\n }\n Object.defineProperty(CdkObserveContent.prototype, \"disabled\", {\n /**\n * Whether observing content is disabled. This option can be used\n * to disconnect the underlying MutationObserver until it is needed.\n */\n get: function () { return this._disabled; },\n set: function (value) {\n this._disabled = coercion.coerceBooleanProperty(value);\n this._disabled ? this._unsubscribe() : this._subscribe();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkObserveContent.prototype, \"debounce\", {\n /** Debounce interval for emitting the changes. */\n get: function () { return this._debounce; },\n set: function (value) {\n this._debounce = coercion.coerceNumberProperty(value);\n this._subscribe();\n },\n enumerable: false,\n configurable: true\n });\n CdkObserveContent.prototype.ngAfterContentInit = function () {\n if (!this._currentSubscription && !this.disabled) {\n this._subscribe();\n }\n };\n CdkObserveContent.prototype.ngOnDestroy = function () {\n this._unsubscribe();\n };\n CdkObserveContent.prototype._subscribe = function () {\n var _this = this;\n this._unsubscribe();\n var stream = this._contentObserver.observe(this._elementRef);\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(function () {\n _this._currentSubscription =\n (_this.debounce ? stream.pipe(operators.debounceTime(_this.debounce)) : stream).subscribe(_this.event);\n });\n };\n CdkObserveContent.prototype._unsubscribe = function () {\n if (this._currentSubscription) {\n this._currentSubscription.unsubscribe();\n }\n };\n return CdkObserveContent;\n }());\n CdkObserveContent.decorators = [\n { type: i0.Directive, args: [{\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n },] }\n ];\n CdkObserveContent.ctorParameters = function () { return [\n { type: ContentObserver },\n { type: i0.ElementRef },\n { type: i0.NgZone }\n ]; };\n CdkObserveContent.propDecorators = {\n event: [{ type: i0.Output, args: ['cdkObserveContent',] }],\n disabled: [{ type: i0.Input, args: ['cdkObserveContentDisabled',] }],\n debounce: [{ type: i0.Input }]\n };\n var ObserversModule = /** @class */ (function () {\n function ObserversModule() {\n }\n return ObserversModule;\n }());\n ObserversModule.decorators = [\n { type: i0.NgModule, args: [{\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n },] }\n ];\n\n /**\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\n /**\n * Generated bundle index. Do not edit.\n */\n\n exports.CdkObserveContent = CdkObserveContent;\n exports.ContentObserver = ContentObserver;\n exports.MutationObserverFactory = MutationObserverFactory;\n exports.ObserversModule = ObserversModule;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-observers.umd.js.map\n"]}
1
+ {"version":3,"sources":["src/cdk/cdk-observers.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","cdk","observers","coercion","core","rxjs","operators","this","i0","MutationObserverFactory","prototype","create","callback","MutationObserver","ɵprov","ɵɵdefineInjectable","MutationObserverFactory_Factory","token","providedIn","decorators","type","Injectable","args","ContentObserver","_mutationObserverFactory","_observedElements","Map","ngOnDestroy","_this","forEach","_","element","_cleanupObserver","observe","elementOrRef","coerceElement","Observable","observer","subscription","_observeElement","subscribe","unsubscribe","_unobserveElement","has","get","count","stream_1","Subject","mutations","next","characterData","childList","subtree","set","stream","_b","disconnect","complete","delete","ContentObserver_Factory","ɵɵinject","ctorParameters","ObserversModule","CdkObserveContent","_contentObserver","_elementRef","_ngZone","event","EventEmitter","_disabled","_currentSubscription","Object","defineProperty","value","coerceBooleanProperty","_unsubscribe","_subscribe","enumerable","configurable","_debounce","coerceNumberProperty","ngAfterContentInit","disabled","runOutsideAngular","debounce","pipe","debounceTime","_a","Directive","selector","exportAs","ElementRef","NgZone","propDecorators","Output","Input","NgModule","declarations","providers"],"mappings":"CAAC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,yBAA0BA,QAAQ,iBAAkBA,QAAQ,QAASA,QAAQ,mBACnJ,mBAAXC,QAAyBA,OAAOC,IAAMD,OAAO,yBAA0B,CAAC,UAAW,wBAAyB,gBAAiB,OAAQ,kBAAmBJ,GACrIA,IAAzBD,EAASA,GAAUO,MAAsBC,GAAKR,EAAOQ,IAAM,GAAIR,EAAOQ,GAAGC,IAAMT,EAAOQ,GAAGC,KAAO,GAAIT,EAA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KAAM,CAAC,uBAClC4D,SAAU,CAAC,CAAE9D,KAAMZ,EAAGuF,MAAOzE,KAAM,CAAC,+BACpC8D,SAAU,CAAC,CAAEhE,KAAMZ,EAAGuF,UAEtBjC,EACA,SAASA,OAIG3C,WAAa,CACzB,CAAEC,KAAMZ,EAAGwF,SAAU1E,KAAM,CAAC,CAChB5B,QAAS,CAACqE,GACVkC,aAAc,CAAClC,GACfmC,UAAW,CAACzF;;;;;;;;AAgB5Bf,EAAQqE,kBAAoBA,EAC5BrE,EAAQ6B,gBAAkBA,EAC1B7B,EAAQe,wBAA0BA,EAClCf,EAAQoE,gBAAkBA,EAE1BS,OAAOC,eAAe9E,EAAS,aAAc,CAAE+E,OAAO","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/coercion'), require('@angular/core'), require('rxjs'), require('rxjs/operators')) :\n typeof define === 'function' && define.amd ? define('@angular/cdk/observers', ['exports', '@angular/cdk/coercion', '@angular/core', 'rxjs', 'rxjs/operators'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.observers = {}), global.ng.cdk.coercion, global.ng.core, global.rxjs, global.rxjs.operators));\n}(this, (function (exports, coercion, i0, rxjs, operators) { 'use strict';\n\n /**\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 /**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * @docs-private\n */\n var MutationObserverFactory = /** @class */ (function () {\n function MutationObserverFactory() {\n }\n MutationObserverFactory.prototype.create = function (callback) {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n };\n return MutationObserverFactory;\n }());\n MutationObserverFactory.ɵprov = i0.ɵɵdefineInjectable({ factory: function MutationObserverFactory_Factory() { return new MutationObserverFactory(); }, token: MutationObserverFactory, providedIn: \"root\" });\n MutationObserverFactory.decorators = [\n { type: i0.Injectable, args: [{ providedIn: 'root' },] }\n ];\n /** An injectable service that allows watching elements for changes to their content. */\n var ContentObserver = /** @class */ (function () {\n function ContentObserver(_mutationObserverFactory) {\n this._mutationObserverFactory = _mutationObserverFactory;\n /** Keeps track of the existing MutationObservers so they can be reused. */\n this._observedElements = new Map();\n }\n ContentObserver.prototype.ngOnDestroy = function () {\n var _this = this;\n this._observedElements.forEach(function (_, element) { return _this._cleanupObserver(element); });\n };\n ContentObserver.prototype.observe = function (elementOrRef) {\n var _this = this;\n var element = coercion.coerceElement(elementOrRef);\n return new rxjs.Observable(function (observer) {\n var stream = _this._observeElement(element);\n var subscription = stream.subscribe(observer);\n return function () {\n subscription.unsubscribe();\n _this._unobserveElement(element);\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 ContentObserver.prototype._observeElement = function (element) {\n if (!this._observedElements.has(element)) {\n var stream_1 = new rxjs.Subject();\n var observer = this._mutationObserverFactory.create(function (mutations) { return stream_1.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: observer, stream: stream_1, count: 1 });\n }\n else {\n this._observedElements.get(element).count++;\n }\n return this._observedElements.get(element).stream;\n };\n /**\n * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is\n * observing this element.\n */\n ContentObserver.prototype._unobserveElement = function (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 /** Clean up the underlying MutationObserver for the specified element. */\n ContentObserver.prototype._cleanupObserver = function (element) {\n if (this._observedElements.has(element)) {\n var _b = this._observedElements.get(element), observer = _b.observer, stream = _b.stream;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n };\n return ContentObserver;\n }());\n ContentObserver.ɵprov = i0.ɵɵdefineInjectable({ factory: function ContentObserver_Factory() { return new ContentObserver(i0.ɵɵinject(MutationObserverFactory)); }, token: ContentObserver, providedIn: \"root\" });\n ContentObserver.decorators = [\n { type: i0.Injectable, args: [{ providedIn: 'root' },] }\n ];\n ContentObserver.ctorParameters = function () { return [\n { type: MutationObserverFactory }\n ]; };\n /**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\n var CdkObserveContent = /** @class */ (function () {\n function CdkObserveContent(_contentObserver, _elementRef, _ngZone) {\n this._contentObserver = _contentObserver;\n this._elementRef = _elementRef;\n this._ngZone = _ngZone;\n /** Event emitted for each change in the element's content. */\n this.event = new i0.EventEmitter();\n this._disabled = false;\n this._currentSubscription = null;\n }\n Object.defineProperty(CdkObserveContent.prototype, \"disabled\", {\n /**\n * Whether observing content is disabled. This option can be used\n * to disconnect the underlying MutationObserver until it is needed.\n */\n get: function () { return this._disabled; },\n set: function (value) {\n this._disabled = coercion.coerceBooleanProperty(value);\n this._disabled ? this._unsubscribe() : this._subscribe();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CdkObserveContent.prototype, \"debounce\", {\n /** Debounce interval for emitting the changes. */\n get: function () { return this._debounce; },\n set: function (value) {\n this._debounce = coercion.coerceNumberProperty(value);\n this._subscribe();\n },\n enumerable: false,\n configurable: true\n });\n CdkObserveContent.prototype.ngAfterContentInit = function () {\n if (!this._currentSubscription && !this.disabled) {\n this._subscribe();\n }\n };\n CdkObserveContent.prototype.ngOnDestroy = function () {\n this._unsubscribe();\n };\n CdkObserveContent.prototype._subscribe = function () {\n var _this = this;\n this._unsubscribe();\n var stream = this._contentObserver.observe(this._elementRef);\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(function () {\n _this._currentSubscription =\n (_this.debounce ? stream.pipe(operators.debounceTime(_this.debounce)) : stream).subscribe(_this.event);\n });\n };\n CdkObserveContent.prototype._unsubscribe = function () {\n var _a;\n (_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n };\n return CdkObserveContent;\n }());\n CdkObserveContent.decorators = [\n { type: i0.Directive, args: [{\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n },] }\n ];\n CdkObserveContent.ctorParameters = function () { return [\n { type: ContentObserver },\n { type: i0.ElementRef },\n { type: i0.NgZone }\n ]; };\n CdkObserveContent.propDecorators = {\n event: [{ type: i0.Output, args: ['cdkObserveContent',] }],\n disabled: [{ type: i0.Input, args: ['cdkObserveContentDisabled',] }],\n debounce: [{ type: i0.Input }]\n };\n var ObserversModule = /** @class */ (function () {\n function ObserversModule() {\n }\n return ObserversModule;\n }());\n ObserversModule.decorators = [\n { type: i0.NgModule, args: [{\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n },] }\n ];\n\n /**\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\n /**\n * Generated bundle index. Do not edit.\n */\n\n exports.CdkObserveContent = CdkObserveContent;\n exports.ContentObserver = ContentObserver;\n exports.MutationObserverFactory = MutationObserverFactory;\n exports.ObserversModule = ObserversModule;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=cdk-observers.umd.js.map\n"]}
@@ -23,7 +23,7 @@
23
23
  extendStatics = Object.setPrototypeOf ||
24
24
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
25
  function (d, b) { for (var p in b)
26
- if (b.hasOwnProperty(p))
26
+ if (Object.prototype.hasOwnProperty.call(b, p))
27
27
  d[p] = b[p]; };
28
28
  return extendStatics(d, b);
29
29
  };
@@ -170,10 +170,10 @@
170
170
  k2 = k;
171
171
  o[k2] = m[k];
172
172
  });
173
- function __exportStar(m, exports) {
173
+ function __exportStar(m, o) {
174
174
  for (var p in m)
175
- if (p !== "default" && !exports.hasOwnProperty(p))
176
- __createBinding(exports, m, p);
175
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
176
+ __createBinding(o, m, p);
177
177
  }
178
178
  function __values(o) {
179
179
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
@@ -283,7 +283,7 @@
283
283
  var result = {};
284
284
  if (mod != null)
285
285
  for (var k in mod)
286
- if (Object.hasOwnProperty.call(mod, k))
286
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
287
287
  __createBinding(result, mod, k);
288
288
  __setModuleDefault(result, mod);
289
289
  return result;