@angular/cdk 17.3.1 → 18.0.0-next.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 (156) hide show
  1. package/drag-drop/index.d.ts +1 -0
  2. package/esm2022/a11y/a11y-module.mjs +5 -5
  3. package/esm2022/a11y/aria-describer/aria-describer.mjs +4 -4
  4. package/esm2022/a11y/focus-monitor/focus-monitor.mjs +7 -7
  5. package/esm2022/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
  6. package/esm2022/a11y/focus-trap/focus-trap-manager.mjs +4 -4
  7. package/esm2022/a11y/focus-trap/focus-trap.mjs +7 -7
  8. package/esm2022/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +4 -4
  9. package/esm2022/a11y/input-modality/input-modality-detector.mjs +4 -4
  10. package/esm2022/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
  11. package/esm2022/a11y/live-announcer/live-announcer.mjs +7 -7
  12. package/esm2022/accordion/accordion-item.mjs +4 -4
  13. package/esm2022/accordion/accordion-module.mjs +5 -5
  14. package/esm2022/accordion/accordion.mjs +4 -4
  15. package/esm2022/bidi/bidi-module.mjs +5 -5
  16. package/esm2022/bidi/dir.mjs +4 -4
  17. package/esm2022/bidi/directionality.mjs +4 -4
  18. package/esm2022/clipboard/clipboard-module.mjs +5 -5
  19. package/esm2022/clipboard/clipboard.mjs +4 -4
  20. package/esm2022/clipboard/copy-to-clipboard.mjs +4 -4
  21. package/esm2022/collections/unique-selection-dispatcher.mjs +4 -4
  22. package/esm2022/dialog/dialog-container.mjs +4 -4
  23. package/esm2022/dialog/dialog-module.mjs +5 -5
  24. package/esm2022/dialog/dialog.mjs +4 -4
  25. package/esm2022/drag-drop/directives/drag-handle.mjs +4 -4
  26. package/esm2022/drag-drop/directives/drag-placeholder.mjs +4 -4
  27. package/esm2022/drag-drop/directives/drag-preview.mjs +4 -4
  28. package/esm2022/drag-drop/directives/drag.mjs +20 -22
  29. package/esm2022/drag-drop/directives/drop-list-group.mjs +4 -4
  30. package/esm2022/drag-drop/directives/drop-list.mjs +4 -4
  31. package/esm2022/drag-drop/drag-drop-module.mjs +5 -5
  32. package/esm2022/drag-drop/drag-drop-registry.mjs +4 -4
  33. package/esm2022/drag-drop/drag-drop.mjs +4 -4
  34. package/esm2022/layout/breakpoints-observer.mjs +4 -4
  35. package/esm2022/layout/layout-module.mjs +5 -5
  36. package/esm2022/layout/media-matcher.mjs +4 -4
  37. package/esm2022/listbox/listbox-module.mjs +5 -5
  38. package/esm2022/listbox/listbox.mjs +7 -7
  39. package/esm2022/menu/context-menu-trigger.mjs +7 -7
  40. package/esm2022/menu/menu-aim.mjs +7 -7
  41. package/esm2022/menu/menu-bar.mjs +4 -4
  42. package/esm2022/menu/menu-base.mjs +4 -4
  43. package/esm2022/menu/menu-group.mjs +4 -4
  44. package/esm2022/menu/menu-item-checkbox.mjs +4 -4
  45. package/esm2022/menu/menu-item-radio.mjs +4 -4
  46. package/esm2022/menu/menu-item-selectable.mjs +4 -4
  47. package/esm2022/menu/menu-item.mjs +4 -4
  48. package/esm2022/menu/menu-module.mjs +5 -5
  49. package/esm2022/menu/menu-stack.mjs +4 -4
  50. package/esm2022/menu/menu-trigger-base.mjs +4 -4
  51. package/esm2022/menu/menu-trigger.mjs +4 -4
  52. package/esm2022/menu/menu.mjs +4 -4
  53. package/esm2022/observers/observe-content.mjs +14 -14
  54. package/esm2022/observers/private/shared-resize-observer.mjs +4 -4
  55. package/esm2022/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
  56. package/esm2022/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +4 -4
  57. package/esm2022/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +4 -4
  58. package/esm2022/overlay/fullscreen-overlay-container.mjs +4 -4
  59. package/esm2022/overlay/overlay-container.mjs +4 -4
  60. package/esm2022/overlay/overlay-directives.mjs +7 -7
  61. package/esm2022/overlay/overlay-module.mjs +5 -5
  62. package/esm2022/overlay/overlay-ref.mjs +22 -12
  63. package/esm2022/overlay/overlay.mjs +6 -6
  64. package/esm2022/overlay/position/overlay-position-builder.mjs +4 -4
  65. package/esm2022/overlay/scroll/scroll-strategy-options.mjs +4 -4
  66. package/esm2022/platform/platform-module.mjs +5 -5
  67. package/esm2022/platform/platform.mjs +4 -4
  68. package/esm2022/portal/portal-directives.mjs +17 -17
  69. package/esm2022/scrolling/fixed-size-virtual-scroll.mjs +4 -4
  70. package/esm2022/scrolling/scroll-dispatcher.mjs +4 -4
  71. package/esm2022/scrolling/scrollable.mjs +4 -4
  72. package/esm2022/scrolling/scrolling-module.mjs +9 -9
  73. package/esm2022/scrolling/viewport-ruler.mjs +4 -4
  74. package/esm2022/scrolling/virtual-for-of.mjs +4 -4
  75. package/esm2022/scrolling/virtual-scroll-viewport.mjs +4 -4
  76. package/esm2022/scrolling/virtual-scrollable-element.mjs +4 -4
  77. package/esm2022/scrolling/virtual-scrollable-window.mjs +4 -4
  78. package/esm2022/scrolling/virtual-scrollable.mjs +4 -4
  79. package/esm2022/stepper/step-header.mjs +4 -4
  80. package/esm2022/stepper/step-label.mjs +4 -4
  81. package/esm2022/stepper/stepper-button.mjs +7 -7
  82. package/esm2022/stepper/stepper-module.mjs +5 -5
  83. package/esm2022/stepper/stepper.mjs +7 -7
  84. package/esm2022/table/cell.mjs +22 -22
  85. package/esm2022/table/coalesced-style-scheduler.mjs +4 -4
  86. package/esm2022/table/row.mjs +28 -28
  87. package/esm2022/table/table-module.mjs +5 -5
  88. package/esm2022/table/table.mjs +27 -34
  89. package/esm2022/table/text-column.mjs +4 -4
  90. package/esm2022/text-field/autofill.mjs +7 -7
  91. package/esm2022/text-field/autosize.mjs +4 -4
  92. package/esm2022/text-field/text-field-module.mjs +5 -5
  93. package/esm2022/tree/nested-node.mjs +4 -4
  94. package/esm2022/tree/node.mjs +4 -4
  95. package/esm2022/tree/outlet.mjs +4 -4
  96. package/esm2022/tree/padding.mjs +4 -4
  97. package/esm2022/tree/toggle.mjs +4 -4
  98. package/esm2022/tree/tree-module.mjs +5 -5
  99. package/esm2022/tree/tree.mjs +7 -7
  100. package/esm2022/version.mjs +1 -1
  101. package/fesm2022/a11y.mjs +40 -40
  102. package/fesm2022/a11y.mjs.map +1 -1
  103. package/fesm2022/accordion.mjs +10 -10
  104. package/fesm2022/accordion.mjs.map +1 -1
  105. package/fesm2022/bidi.mjs +10 -10
  106. package/fesm2022/bidi.mjs.map +1 -1
  107. package/fesm2022/cdk.mjs +1 -1
  108. package/fesm2022/cdk.mjs.map +1 -1
  109. package/fesm2022/clipboard.mjs +10 -10
  110. package/fesm2022/clipboard.mjs.map +1 -1
  111. package/fesm2022/collections.mjs +3 -3
  112. package/fesm2022/collections.mjs.map +1 -1
  113. package/fesm2022/dialog.mjs +10 -10
  114. package/fesm2022/dialog.mjs.map +1 -1
  115. package/fesm2022/drag-drop.mjs +44 -46
  116. package/fesm2022/drag-drop.mjs.map +1 -1
  117. package/fesm2022/layout.mjs +10 -10
  118. package/fesm2022/layout.mjs.map +1 -1
  119. package/fesm2022/listbox.mjs +10 -10
  120. package/fesm2022/listbox.mjs.map +1 -1
  121. package/fesm2022/menu.mjs +49 -49
  122. package/fesm2022/menu.mjs.map +1 -1
  123. package/fesm2022/observers/private.mjs +3 -3
  124. package/fesm2022/observers/private.mjs.map +1 -1
  125. package/fesm2022/observers.mjs +13 -13
  126. package/fesm2022/observers.mjs.map +1 -1
  127. package/fesm2022/overlay.mjs +56 -47
  128. package/fesm2022/overlay.mjs.map +1 -1
  129. package/fesm2022/platform.mjs +7 -7
  130. package/fesm2022/platform.mjs.map +1 -1
  131. package/fesm2022/portal.mjs +16 -16
  132. package/fesm2022/portal.mjs.map +1 -1
  133. package/fesm2022/scrolling.mjs +35 -35
  134. package/fesm2022/scrolling.mjs.map +1 -1
  135. package/fesm2022/stepper.mjs +22 -22
  136. package/fesm2022/stepper.mjs.map +1 -1
  137. package/fesm2022/table.mjs +83 -90
  138. package/fesm2022/table.mjs.map +1 -1
  139. package/fesm2022/text-field.mjs +13 -13
  140. package/fesm2022/text-field.mjs.map +1 -1
  141. package/fesm2022/tree.mjs +25 -25
  142. package/fesm2022/tree.mjs.map +1 -1
  143. package/overlay/index.d.ts +6 -2
  144. package/package.json +3 -3
  145. package/schematics/migration.json +4 -4
  146. package/schematics/ng-add/index.js +1 -1
  147. package/schematics/ng-add/index.mjs +1 -1
  148. package/schematics/ng-update/index.d.ts +2 -2
  149. package/schematics/ng-update/index.js +6 -6
  150. package/schematics/ng-update/index.mjs +6 -6
  151. package/schematics/ng-update/migrations/misc-template.js +2 -2
  152. package/schematics/ng-update/migrations/misc-template.mjs +2 -2
  153. package/schematics/update-tool/target-version.d.ts +1 -1
  154. package/schematics/update-tool/target-version.js +2 -2
  155. package/schematics/update-tool/target-version.mjs +2 -2
  156. package/table/index.d.ts +4 -8
@@ -107,10 +107,10 @@ class SharedResizeObserver {
107
107
  }
108
108
  return this._observers.get(box).observe(target);
109
109
  }
110
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: SharedResizeObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
111
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: SharedResizeObserver, providedIn: 'root' }); }
110
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: SharedResizeObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
111
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: SharedResizeObserver, providedIn: 'root' }); }
112
112
  }
113
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: SharedResizeObserver, decorators: [{
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: SharedResizeObserver, decorators: [{
114
114
  type: Injectable,
115
115
  args: [{
116
116
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"private.mjs","sources":["../../../../../../../src/cdk/observers/private/shared-resize-observer.ts","../../../../../../../src/cdk/observers/private/private_public_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 */\nimport {inject, Injectable, NgZone, OnDestroy} from '@angular/core';\nimport {Observable, Subject} from 'rxjs';\nimport {filter, shareReplay, takeUntil} from 'rxjs/operators';\n\n/**\n * Handler that logs \"ResizeObserver loop limit exceeded\" errors.\n * These errors are not shown in the Chrome console, so we log them to ensure developers are aware.\n * @param e The error\n */\nconst loopLimitExceededErrorHandler = (e: unknown) => {\n if (e instanceof Error && e.message === 'ResizeObserver loop limit exceeded') {\n console.error(\n `${e.message}. This could indicate a performance issue with your app. See https://github.com/WICG/resize-observer/blob/master/explainer.md#error-handling`,\n );\n }\n};\n\n/**\n * A shared ResizeObserver to be used for a particular box type (content-box, border-box, or\n * device-pixel-content-box)\n */\nclass SingleBoxSharedResizeObserver {\n /** Stream that emits when the shared observer is destroyed. */\n private _destroyed = new Subject<void>();\n /** Stream of all events from the ResizeObserver. */\n private _resizeSubject = new Subject<ResizeObserverEntry[]>();\n /** ResizeObserver used to observe element resize events. */\n private _resizeObserver?: ResizeObserver;\n /** A map of elements to streams of their resize events. */\n private _elementObservables = new Map<Element, Observable<ResizeObserverEntry[]>>();\n\n constructor(\n /** The box type to observe for resizes. */\n private _box: ResizeObserverBoxOptions,\n ) {\n if (typeof ResizeObserver !== 'undefined') {\n this._resizeObserver = new ResizeObserver(entries => this._resizeSubject.next(entries));\n }\n }\n\n /**\n * Gets a stream of resize events for the given element.\n * @param target The element to observe.\n * @return The stream of resize events for the element.\n */\n observe(target: Element): Observable<ResizeObserverEntry[]> {\n if (!this._elementObservables.has(target)) {\n this._elementObservables.set(\n target,\n new Observable<ResizeObserverEntry[]>(observer => {\n const subscription = this._resizeSubject.subscribe(observer);\n this._resizeObserver?.observe(target, {box: this._box});\n return () => {\n this._resizeObserver?.unobserve(target);\n subscription.unsubscribe();\n this._elementObservables.delete(target);\n };\n }).pipe(\n filter(entries => entries.some(entry => entry.target === target)),\n // Share a replay of the last event so that subsequent calls to observe the same element\n // receive initial sizing info like the first one. Also enable ref counting so the\n // element will be automatically unobserved when there are no more subscriptions.\n shareReplay({bufferSize: 1, refCount: true}),\n takeUntil(this._destroyed),\n ),\n );\n }\n return this._elementObservables.get(target)!;\n }\n\n /** Destroys this instance. */\n destroy() {\n this._destroyed.next();\n this._destroyed.complete();\n this._resizeSubject.complete();\n this._elementObservables.clear();\n }\n}\n\n/**\n * Allows observing resize events on multiple elements using a shared set of ResizeObserver.\n * Sharing a ResizeObserver instance is recommended for better performance (see\n * https://github.com/WICG/resize-observer/issues/59).\n *\n * Rather than share a single `ResizeObserver`, this class creates one `ResizeObserver` per type\n * of observed box ('content-box', 'border-box', and 'device-pixel-content-box'). This avoids\n * later calls to `observe` with a different box type from influencing the events dispatched to\n * earlier calls.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SharedResizeObserver implements OnDestroy {\n /** Map of box type to shared resize observer. */\n private _observers = new Map<ResizeObserverBoxOptions, SingleBoxSharedResizeObserver>();\n\n /** The Angular zone. */\n private _ngZone = inject(NgZone);\n\n constructor() {\n if (typeof ResizeObserver !== 'undefined' && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n this._ngZone.runOutsideAngular(() => {\n window.addEventListener('error', loopLimitExceededErrorHandler);\n });\n }\n }\n\n ngOnDestroy() {\n for (const [, observer] of this._observers) {\n observer.destroy();\n }\n this._observers.clear();\n if (typeof ResizeObserver !== 'undefined' && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n window.removeEventListener('error', loopLimitExceededErrorHandler);\n }\n }\n\n /**\n * Gets a stream of resize events for the given target element and box type.\n * @param target The element to observe for resizes.\n * @param options Options to pass to the `ResizeObserver`\n * @return The stream of resize events for the element.\n */\n observe(target: Element, options?: ResizeObserverOptions): Observable<ResizeObserverEntry[]> {\n const box = options?.box || 'content-box';\n if (!this._observers.has(box)) {\n this._observers.set(box, new SingleBoxSharedResizeObserver(box));\n }\n return this._observers.get(box)!.observe(target);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAWA;;;;AAIG;AACH,MAAM,6BAA6B,GAAG,CAAC,CAAU,KAAI;IACnD,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,OAAO,KAAK,oCAAoC,EAAE;QAC5E,OAAO,CAAC,KAAK,CACX,CAAA,EAAG,CAAC,CAAC,OAAO,CAA8I,4IAAA,CAAA,CAC3J,CAAC;KACH;AACH,CAAC,CAAC;AAEF;;;AAGG;AACH,MAAM,6BAA6B,CAAA;AAUjC,IAAA,WAAA;;IAEU,IAA8B,EAAA;QAA9B,IAAI,CAAA,IAAA,GAAJ,IAAI,CAA0B;;AAVhC,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,OAAO,EAAQ,CAAC;;AAEjC,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,OAAO,EAAyB,CAAC;;AAItD,QAAA,IAAA,CAAA,mBAAmB,GAAG,IAAI,GAAG,EAA8C,CAAC;AAMlF,QAAA,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE;AACzC,YAAA,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;SACzF;KACF;AAED;;;;AAIG;AACH,IAAA,OAAO,CAAC,MAAe,EAAA;QACrB,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;AACzC,YAAA,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAC1B,MAAM,EACN,IAAI,UAAU,C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,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cAFnB,MAAM,EAAA,CAAA,CAAA,EAAA;;2FAEP,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;AClGD;;AAEG;;;;"}
1
+ {"version":3,"file":"private.mjs","sources":["../../../../../../../src/cdk/observers/private/shared-resize-observer.ts","../../../../../../../src/cdk/observers/private/private_public_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 */\nimport {inject, Injectable, NgZone, OnDestroy} from '@angular/core';\nimport {Observable, Subject} from 'rxjs';\nimport {filter, shareReplay, takeUntil} from 'rxjs/operators';\n\n/**\n * Handler that logs \"ResizeObserver loop limit exceeded\" errors.\n * These errors are not shown in the Chrome console, so we log them to ensure developers are aware.\n * @param e The error\n */\nconst loopLimitExceededErrorHandler = (e: unknown) => {\n if (e instanceof Error && e.message === 'ResizeObserver loop limit exceeded') {\n console.error(\n `${e.message}. This could indicate a performance issue with your app. See https://github.com/WICG/resize-observer/blob/master/explainer.md#error-handling`,\n );\n }\n};\n\n/**\n * A shared ResizeObserver to be used for a particular box type (content-box, border-box, or\n * device-pixel-content-box)\n */\nclass SingleBoxSharedResizeObserver {\n /** Stream that emits when the shared observer is destroyed. */\n private _destroyed = new Subject<void>();\n /** Stream of all events from the ResizeObserver. */\n private _resizeSubject = new Subject<ResizeObserverEntry[]>();\n /** ResizeObserver used to observe element resize events. */\n private _resizeObserver?: ResizeObserver;\n /** A map of elements to streams of their resize events. */\n private _elementObservables = new Map<Element, Observable<ResizeObserverEntry[]>>();\n\n constructor(\n /** The box type to observe for resizes. */\n private _box: ResizeObserverBoxOptions,\n ) {\n if (typeof ResizeObserver !== 'undefined') {\n this._resizeObserver = new ResizeObserver(entries => this._resizeSubject.next(entries));\n }\n }\n\n /**\n * Gets a stream of resize events for the given element.\n * @param target The element to observe.\n * @return The stream of resize events for the element.\n */\n observe(target: Element): Observable<ResizeObserverEntry[]> {\n if (!this._elementObservables.has(target)) {\n this._elementObservables.set(\n target,\n new Observable<ResizeObserverEntry[]>(observer => {\n const subscription = this._resizeSubject.subscribe(observer);\n this._resizeObserver?.observe(target, {box: this._box});\n return () => {\n this._resizeObserver?.unobserve(target);\n subscription.unsubscribe();\n this._elementObservables.delete(target);\n };\n }).pipe(\n filter(entries => entries.some(entry => entry.target === target)),\n // Share a replay of the last event so that subsequent calls to observe the same element\n // receive initial sizing info like the first one. Also enable ref counting so the\n // element will be automatically unobserved when there are no more subscriptions.\n shareReplay({bufferSize: 1, refCount: true}),\n takeUntil(this._destroyed),\n ),\n );\n }\n return this._elementObservables.get(target)!;\n }\n\n /** Destroys this instance. */\n destroy() {\n this._destroyed.next();\n this._destroyed.complete();\n this._resizeSubject.complete();\n this._elementObservables.clear();\n }\n}\n\n/**\n * Allows observing resize events on multiple elements using a shared set of ResizeObserver.\n * Sharing a ResizeObserver instance is recommended for better performance (see\n * https://github.com/WICG/resize-observer/issues/59).\n *\n * Rather than share a single `ResizeObserver`, this class creates one `ResizeObserver` per type\n * of observed box ('content-box', 'border-box', and 'device-pixel-content-box'). This avoids\n * later calls to `observe` with a different box type from influencing the events dispatched to\n * earlier calls.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SharedResizeObserver implements OnDestroy {\n /** Map of box type to shared resize observer. */\n private _observers = new Map<ResizeObserverBoxOptions, SingleBoxSharedResizeObserver>();\n\n /** The Angular zone. */\n private _ngZone = inject(NgZone);\n\n constructor() {\n if (typeof ResizeObserver !== 'undefined' && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n this._ngZone.runOutsideAngular(() => {\n window.addEventListener('error', loopLimitExceededErrorHandler);\n });\n }\n }\n\n ngOnDestroy() {\n for (const [, observer] of this._observers) {\n observer.destroy();\n }\n this._observers.clear();\n if (typeof ResizeObserver !== 'undefined' && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n window.removeEventListener('error', loopLimitExceededErrorHandler);\n }\n }\n\n /**\n * Gets a stream of resize events for the given target element and box type.\n * @param target The element to observe for resizes.\n * @param options Options to pass to the `ResizeObserver`\n * @return The stream of resize events for the element.\n */\n observe(target: Element, options?: ResizeObserverOptions): Observable<ResizeObserverEntry[]> {\n const box = options?.box || 'content-box';\n if (!this._observers.has(box)) {\n this._observers.set(box, new SingleBoxSharedResizeObserver(box));\n }\n return this._observers.get(box)!.observe(target);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAWA;;;;AAIG;AACH,MAAM,6BAA6B,GAAG,CAAC,CAAU,KAAI;IACnD,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,OAAO,KAAK,oCAAoC,EAAE;QAC5E,OAAO,CAAC,KAAK,CACX,CAAA,EAAG,CAAC,CAAC,OAAO,CAA8I,4IAAA,CAAA,CAC3J,CAAC;KACH;AACH,CAAC,CAAC;AAEF;;;AAGG;AACH,MAAM,6BAA6B,CAAA;AAUjC,IAAA,WAAA;;IAEU,IAA8B,EAAA;QAA9B,IAAI,CAAA,IAAA,GAAJ,IAAI,CAA0B;;AAVhC,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,OAAO,EAAQ,CAAC;;AAEjC,QAAA,IAAA,CAAA,cAAc,GAAG,IAAI,OAAO,EAAyB,CAAC;;AAItD,QAAA,IAAA,CAAA,mBAAmB,GAAG,IAAI,GAAG,EAA8C,CAAC;AAMlF,QAAA,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE;AACzC,YAAA,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC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AO,CAAC,MAAM,CAAC,CAAC;KAClD;qHArCU,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cAFnB,MAAM,EAAA,CAAA,CAAA,EAAA;;kGAEP,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;AClGD;;AAEG;;;;"}
@@ -12,10 +12,10 @@ class MutationObserverFactory {
12
12
  create(callback) {
13
13
  return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
14
14
  }
15
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
16
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' }); }
15
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
16
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' }); }
17
17
  }
18
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: MutationObserverFactory, decorators: [{
18
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: MutationObserverFactory, decorators: [{
19
19
  type: Injectable,
20
20
  args: [{ providedIn: 'root' }]
21
21
  }] });
@@ -85,10 +85,10 @@ class ContentObserver {
85
85
  this._observedElements.delete(element);
86
86
  }
87
87
  }
88
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: ContentObserver, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
89
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: ContentObserver, providedIn: 'root' }); }
88
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: ContentObserver, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
89
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: ContentObserver, providedIn: 'root' }); }
90
90
  }
91
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: ContentObserver, decorators: [{
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: ContentObserver, decorators: [{
92
92
  type: Injectable,
93
93
  args: [{ providedIn: 'root' }]
94
94
  }], ctorParameters: () => [{ type: MutationObserverFactory }] });
@@ -147,10 +147,10 @@ class CdkObserveContent {
147
147
  _unsubscribe() {
148
148
  this._currentSubscription?.unsubscribe();
149
149
  }
150
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: CdkObserveContent, deps: [{ token: ContentObserver }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
151
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.2.0", type: CdkObserveContent, isStandalone: true, selector: "[cdkObserveContent]", inputs: { disabled: ["cdkObserveContentDisabled", "disabled", booleanAttribute], debounce: "debounce" }, outputs: { event: "cdkObserveContent" }, exportAs: ["cdkObserveContent"], ngImport: i0 }); }
150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: CdkObserveContent, deps: [{ token: ContentObserver }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
151
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.0-next.0", type: CdkObserveContent, isStandalone: true, selector: "[cdkObserveContent]", inputs: { disabled: ["cdkObserveContentDisabled", "disabled", booleanAttribute], debounce: "debounce" }, outputs: { event: "cdkObserveContent" }, exportAs: ["cdkObserveContent"], ngImport: i0 }); }
152
152
  }
153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: CdkObserveContent, decorators: [{
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: CdkObserveContent, decorators: [{
154
154
  type: Directive,
155
155
  args: [{
156
156
  selector: '[cdkObserveContent]',
@@ -167,11 +167,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
167
167
  type: Input
168
168
  }] } });
169
169
  class ObserversModule {
170
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: ObserversModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
171
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.0", ngImport: i0, type: ObserversModule, imports: [CdkObserveContent], exports: [CdkObserveContent] }); }
172
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: ObserversModule, providers: [MutationObserverFactory] }); }
170
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: ObserversModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
171
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.0", ngImport: i0, type: ObserversModule, imports: [CdkObserveContent], exports: [CdkObserveContent] }); }
172
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: ObserversModule, providers: [MutationObserverFactory] }); }
173
173
  }
174
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: ObserversModule, decorators: [{
174
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: ObserversModule, decorators: [{
175
175
  type: NgModule,
176
176
  args: [{
177
177
  imports: [CdkObserveContent],
@@ -1 +1 @@
1
- {"version":3,"file":"observers.mjs","sources":["../../../../../../src/cdk/observers/observe-content.ts","../../../../../../src/cdk/observers/observers_public_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 {coerceNumberProperty, coerceElement, NumberInput} 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 booleanAttribute,\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/** 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<\n Element,\n {\n observer: MutationObserver | null;\n readonly stream: Subject<MutationRecord[]>;\n count: number;\n }\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 * 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 standalone: true,\n})\nexport class CdkObserveContent implements AfterContentInit, OnDestroy {\n /** Event emitted for each change in the element's content. */\n @Output('cdkObserveContent') readonly 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({alias: 'cdkObserveContentDisabled', transform: booleanAttribute})\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: boolean) {\n this._disabled = 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 {\n return this._debounce;\n }\n set debounce(value: NumberInput) {\n this._debounce = coerceNumberProperty(value);\n this._subscribe();\n }\n private _debounce: number;\n\n private _currentSubscription: Subscription | null = null;\n\n constructor(\n private _contentObserver: ContentObserver,\n private _elementRef: ElementRef<HTMLElement>,\n private _ngZone: NgZone,\n ) {}\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\n ).subscribe(this.event);\n });\n }\n\n private _unsubscribe() {\n this._currentSubscription?.unsubscribe();\n }\n}\n\n@NgModule({\n imports: [CdkObserveContent],\n exports: [CdkObserveContent],\n providers: [MutationObserverFactory],\n})\nexport class ObserversMod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qDK,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAf,eAAe,EAAA,OAAA,EAAA,CAxEf,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAAjB,iBAAiB,CAAA,EAAA,CAAA,CAAA,EAAA;+GAwEjB,eAAe,EAAA,SAAA,EAFf,CAAC,uBAAuB,CAAC,EAAA,CAAA,CAAA,EAAA;;2FAEzB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,SAAS,EAAE,CAAC,uBAAuB,CAAC;AACrC,iBAAA,CAAA;;;ACjND;;AAEG;;;;"}
1
+ {"version":3,"file":"observers.mjs","sources":["../../../../../../src/cdk/observers/observe-content.ts","../../../../../../src/cdk/observers/observers_public_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 {coerceNumberProperty, coerceElement, NumberInput} 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 booleanAttribute,\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/** 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<\n Element,\n {\n observer: MutationObserver | null;\n readonly stream: Subject<MutationRecord[]>;\n count: number;\n }\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 * 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 standalone: true,\n})\nexport class CdkObserveContent implements AfterContentInit, OnDestroy {\n /** Event emitted for each change in the element's content. */\n @Output('cdkObserveContent') readonly 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({alias: 'cdkObserveContentDisabled', transform: booleanAttribute})\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: boolean) {\n this._disabled = 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 {\n return this._debounce;\n }\n set debounce(value: NumberInput) {\n this._debounce = coerceNumberProperty(value);\n this._subscribe();\n }\n private _debounce: number;\n\n private _currentSubscription: Subscription | null = null;\n\n constructor(\n private _contentObserver: ContentObserver,\n private _elementRef: ElementRef<HTMLElement>,\n private _ngZone: NgZone,\n ) {}\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\n ).subscribe(this.event);\n });\n }\n\n private _unsubscribe() {\n this._currentSubscription?.unsubscribe();\n }\n}\n\n@NgModule({\n imports: [CdkObserveContent],\n exports: [CdkObserveContent],\n providers: [MutationObserverFactory],\n})\nexport class ObserversModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from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AAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;sHAAf,eAAe,EAAA,OAAA,EAAA,CAxEf,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAAjB,iBAAiB,CAAA,EAAA,CAAA,CAAA,EAAA;sHAwEjB,eAAe,EAAA,SAAA,EAFf,CAAC,uBAAuB,CAAC,EAAA,CAAA,CAAA,EAAA;;kGAEzB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,SAAS,EAAE,CAAC,uBAAuB,CAAC;AACrC,iBAAA,CAAA;;;ACjND;;AAEG;;;;"}
@@ -4,11 +4,11 @@ export { CdkScrollable, ScrollDispatcher, ViewportRuler } from '@angular/cdk/scr
4
4
  import * as i6 from '@angular/common';
5
5
  import { DOCUMENT } from '@angular/common';
6
6
  import * as i0 from '@angular/core';
7
- import { Injectable, Inject, Optional, ElementRef, ApplicationRef, ANIMATION_MODULE_TYPE, InjectionToken, inject, Directive, NgZone, EventEmitter, booleanAttribute, Input, Output, NgModule } from '@angular/core';
7
+ import { Injectable, Inject, Optional, untracked, afterRender, afterNextRender, ElementRef, EnvironmentInjector, ApplicationRef, ANIMATION_MODULE_TYPE, InjectionToken, inject, Directive, NgZone, EventEmitter, booleanAttribute, Input, Output, NgModule } from '@angular/core';
8
8
  import { coerceCssPixelValue, coerceArray } from '@angular/cdk/coercion';
9
9
  import * as i1$1 from '@angular/cdk/platform';
10
10
  import { supportsScrollBehavior, _getEventTarget, _isTestEnvironment } from '@angular/cdk/platform';
11
- import { filter, take, takeUntil, takeWhile } from 'rxjs/operators';
11
+ import { filter, takeUntil, takeWhile } from 'rxjs/operators';
12
12
  import * as i5 from '@angular/cdk/bidi';
13
13
  import { BidiModule } from '@angular/cdk/bidi';
14
14
  import { DomPortalOutlet, TemplatePortal, PortalModule } from '@angular/cdk/portal';
@@ -279,10 +279,10 @@ class ScrollStrategyOptions {
279
279
  this.reposition = (config) => new RepositionScrollStrategy(this._scrollDispatcher, this._viewportRuler, this._ngZone, config);
280
280
  this._document = document;
281
281
  }
282
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: ScrollStrategyOptions, deps: [{ token: i1.ScrollDispatcher }, { token: i1.ViewportRuler }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
283
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: ScrollStrategyOptions, providedIn: 'root' }); }
282
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: ScrollStrategyOptions, deps: [{ token: i1.ScrollDispatcher }, { token: i1.ViewportRuler }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
283
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: ScrollStrategyOptions, providedIn: 'root' }); }
284
284
  }
285
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: ScrollStrategyOptions, decorators: [{
285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: ScrollStrategyOptions, decorators: [{
286
286
  type: Injectable,
287
287
  args: [{ providedIn: 'root' }]
288
288
  }], ctorParameters: () => [{ type: i1.ScrollDispatcher }, { type: i1.ViewportRuler }, { type: i0.NgZone }, { type: undefined, decorators: [{
@@ -439,10 +439,10 @@ class BaseOverlayDispatcher {
439
439
  this.detach();
440
440
  }
441
441
  }
442
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: BaseOverlayDispatcher, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
443
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: BaseOverlayDispatcher, providedIn: 'root' }); }
442
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: BaseOverlayDispatcher, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
443
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: BaseOverlayDispatcher, providedIn: 'root' }); }
444
444
  }
445
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: BaseOverlayDispatcher, decorators: [{
445
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: BaseOverlayDispatcher, decorators: [{
446
446
  type: Injectable,
447
447
  args: [{ providedIn: 'root' }]
448
448
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -507,10 +507,10 @@ class OverlayKeyboardDispatcher extends BaseOverlayDispatcher {
507
507
  this._isAttached = false;
508
508
  }
509
509
  }
510
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayKeyboardDispatcher, deps: [{ token: DOCUMENT }, { token: i0.NgZone, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
511
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayKeyboardDispatcher, providedIn: 'root' }); }
510
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayKeyboardDispatcher, deps: [{ token: DOCUMENT }, { token: i0.NgZone, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
511
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayKeyboardDispatcher, providedIn: 'root' }); }
512
512
  }
513
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayKeyboardDispatcher, decorators: [{
513
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayKeyboardDispatcher, decorators: [{
514
514
  type: Injectable,
515
515
  args: [{ providedIn: 'root' }]
516
516
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -632,10 +632,10 @@ class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
632
632
  body.addEventListener('auxclick', this._clickListener, true);
633
633
  body.addEventListener('contextmenu', this._clickListener, true);
634
634
  }
635
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayOutsideClickDispatcher, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }, { token: i0.NgZone, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
636
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayOutsideClickDispatcher, providedIn: 'root' }); }
635
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayOutsideClickDispatcher, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }, { token: i0.NgZone, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
636
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayOutsideClickDispatcher, providedIn: 'root' }); }
637
637
  }
638
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayOutsideClickDispatcher, decorators: [{
638
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayOutsideClickDispatcher, decorators: [{
639
639
  type: Injectable,
640
640
  args: [{ providedIn: 'root' }]
641
641
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -703,10 +703,10 @@ class OverlayContainer {
703
703
  this._document.body.appendChild(container);
704
704
  this._containerElement = container;
705
705
  }
706
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayContainer, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
707
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayContainer, providedIn: 'root' }); }
706
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayContainer, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
707
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayContainer, providedIn: 'root' }); }
708
708
  }
709
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayContainer, decorators: [{
709
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayContainer, decorators: [{
710
710
  type: Injectable,
711
711
  args: [{ providedIn: 'root' }]
712
712
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -719,7 +719,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
719
719
  * Used to manipulate or dispose of said overlay.
720
720
  */
721
721
  class OverlayRef {
722
- constructor(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document, _location, _outsideClickDispatcher, _animationsDisabled = false) {
722
+ constructor(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document, _location, _outsideClickDispatcher, _animationsDisabled = false, _injector) {
723
723
  this._portalOutlet = _portalOutlet;
724
724
  this._host = _host;
725
725
  this._pane = _pane;
@@ -730,6 +730,7 @@ class OverlayRef {
730
730
  this._location = _location;
731
731
  this._outsideClickDispatcher = _outsideClickDispatcher;
732
732
  this._animationsDisabled = _animationsDisabled;
733
+ this._injector = _injector;
733
734
  this._backdropElement = null;
734
735
  this._backdropClick = new Subject();
735
736
  this._attachments = new Subject();
@@ -743,11 +744,18 @@ class OverlayRef {
743
744
  this._keydownEvents = new Subject();
744
745
  /** Stream of mouse outside events dispatched to this overlay. */
745
746
  this._outsidePointerEvents = new Subject();
747
+ this._renders = new Subject();
746
748
  if (_config.scrollStrategy) {
747
749
  this._scrollStrategy = _config.scrollStrategy;
748
750
  this._scrollStrategy.attach(this);
749
751
  }
750
752
  this._positionStrategy = _config.positionStrategy;
753
+ // Users could open the overlay from an `effect`, in which case we need to
754
+ // run the `afterRender` as `untracked`. We don't recommend that users do
755
+ // this, but we also don't want to break users who are doing it.
756
+ this._afterRenderRef = untracked(() => afterRender(() => {
757
+ this._renders.next();
758
+ }, { injector: this._injector }));
751
759
  }
752
760
  /** The overlay's HTML element */
753
761
  get overlayElement() {
@@ -788,15 +796,14 @@ class OverlayRef {
788
796
  if (this._scrollStrategy) {
789
797
  this._scrollStrategy.enable();
790
798
  }
791
- // Update the position once the zone is stable so that the overlay will be fully rendered
792
- // before attempting to position it, as the position may depend on the size of the rendered
793
- // content.
794
- this._ngZone.onStable.pipe(take(1)).subscribe(() => {
795
- // The overlay could've been detached before the zone has stabilized.
799
+ // Update the position once the overlay is fully rendered before attempting to position it,
800
+ // as the position may depend on the size of the rendered content.
801
+ afterNextRender(() => {
802
+ // The overlay could've been detached before the callback executed.
796
803
  if (this.hasAttached()) {
797
804
  this.updatePosition();
798
805
  }
799
- });
806
+ }, { injector: this._injector });
800
807
  // Enable pointer events for the overlay pane element.
801
808
  this._togglePointerEvents(true);
802
809
  if (this._config.hasBackdrop) {
@@ -859,7 +866,7 @@ class OverlayRef {
859
866
  this._keyboardDispatcher.remove(this);
860
867
  // Keeping the host element in the DOM can cause scroll jank, because it still gets
861
868
  // rendered, even though it's transparent and unclickable which is why we remove it.
862
- this._detachContentWhenStable();
869
+ this._detachContentWhenEmpty();
863
870
  this._locationChanges.unsubscribe();
864
871
  this._outsideClickDispatcher.remove(this);
865
872
  return detachmentResult;
@@ -886,6 +893,8 @@ class OverlayRef {
886
893
  this._detachments.next();
887
894
  }
888
895
  this._detachments.complete();
896
+ this._afterRenderRef.destroy();
897
+ this._renders.complete();
889
898
  }
890
899
  /** Whether the overlay has attached content. */
891
900
  hasAttached() {
@@ -1075,7 +1084,7 @@ class OverlayRef {
1075
1084
  }
1076
1085
  }
1077
1086
  /** Detaches the overlay content next time the zone stabilizes. */
1078
- _detachContentWhenStable() {
1087
+ _detachContentWhenEmpty() {
1079
1088
  // Normally we wouldn't have to explicitly run this outside the `NgZone`, however
1080
1089
  // if the consumer is using `zone-patch-rxjs`, the `Subscription.unsubscribe` call will
1081
1090
  // be patched to run inside the zone, which will throw us into an infinite loop.
@@ -1083,7 +1092,7 @@ class OverlayRef {
1083
1092
  // We can't remove the host here immediately, because the overlay pane's content
1084
1093
  // might still be animating. This stream helps us avoid interrupting the animation
1085
1094
  // by waiting for the pane to become empty.
1086
- const subscription = this._ngZone.onStable
1095
+ const subscription = this._renders
1087
1096
  .pipe(takeUntil(merge(this._attachments, this._detachments)))
1088
1097
  .subscribe(() => {
1089
1098
  // Needs a couple of checks for the pane and host, because
@@ -2372,10 +2381,10 @@ class OverlayPositionBuilder {
2372
2381
  flexibleConnectedTo(origin) {
2373
2382
  return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document, this._platform, this._overlayContainer);
2374
2383
  }
2375
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayPositionBuilder, deps: [{ token: i1.ViewportRuler }, { token: DOCUMENT }, { token: i1$1.Platform }, { token: OverlayContainer }], target: i0.ɵɵFactoryTarget.Injectable }); }
2376
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayPositionBuilder, providedIn: 'root' }); }
2384
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayPositionBuilder, deps: [{ token: i1.ViewportRuler }, { token: DOCUMENT }, { token: i1$1.Platform }, { token: OverlayContainer }], target: i0.ɵɵFactoryTarget.Injectable }); }
2385
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayPositionBuilder, providedIn: 'root' }); }
2377
2386
  }
2378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayPositionBuilder, decorators: [{
2387
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayPositionBuilder, decorators: [{
2379
2388
  type: Injectable,
2380
2389
  args: [{ providedIn: 'root' }]
2381
2390
  }], ctorParameters: () => [{ type: i1.ViewportRuler }, { type: undefined, decorators: [{
@@ -2423,7 +2432,7 @@ class Overlay {
2423
2432
  const portalOutlet = this._createPortalOutlet(pane);
2424
2433
  const overlayConfig = new OverlayConfig(config);
2425
2434
  overlayConfig.direction = overlayConfig.direction || this._directionality.value;
2426
- return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location, this._outsideClickDispatcher, this._animationsModuleType === 'NoopAnimations');
2435
+ return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location, this._outsideClickDispatcher, this._animationsModuleType === 'NoopAnimations', this._injector.get(EnvironmentInjector));
2427
2436
  }
2428
2437
  /**
2429
2438
  * Gets a position builder that can be used, via fluent API,
@@ -2467,10 +2476,10 @@ class Overlay {
2467
2476
  }
2468
2477
  return new DomPortalOutlet(pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);
2469
2478
  }
2470
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: Overlay, deps: [{ token: ScrollStrategyOptions }, { token: OverlayContainer }, { token: i0.ComponentFactoryResolver }, { token: OverlayPositionBuilder }, { token: OverlayKeyboardDispatcher }, { token: i0.Injector }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i5.Directionality }, { token: i6.Location }, { token: OverlayOutsideClickDispatcher }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2471
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: Overlay, providedIn: 'root' }); }
2479
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: Overlay, deps: [{ token: ScrollStrategyOptions }, { token: OverlayContainer }, { token: i0.ComponentFactoryResolver }, { token: OverlayPositionBuilder }, { token: OverlayKeyboardDispatcher }, { token: i0.Injector }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i5.Directionality }, { token: i6.Location }, { token: OverlayOutsideClickDispatcher }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
2480
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: Overlay, providedIn: 'root' }); }
2472
2481
  }
2473
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: Overlay, decorators: [{
2482
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: Overlay, decorators: [{
2474
2483
  type: Injectable,
2475
2484
  args: [{ providedIn: 'root' }]
2476
2485
  }], ctorParameters: () => [{ type: ScrollStrategyOptions }, { type: OverlayContainer }, { type: i0.ComponentFactoryResolver }, { type: OverlayPositionBuilder }, { type: OverlayKeyboardDispatcher }, { type: i0.Injector }, { type: i0.NgZone }, { type: undefined, decorators: [{
@@ -2528,10 +2537,10 @@ class CdkOverlayOrigin {
2528
2537
  elementRef) {
2529
2538
  this.elementRef = elementRef;
2530
2539
  }
2531
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: CdkOverlayOrigin, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2532
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.0", type: CdkOverlayOrigin, isStandalone: true, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"], ngImport: i0 }); }
2540
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: CdkOverlayOrigin, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
2541
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.0-next.0", type: CdkOverlayOrigin, isStandalone: true, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"], ngImport: i0 }); }
2533
2542
  }
2534
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: CdkOverlayOrigin, decorators: [{
2543
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: CdkOverlayOrigin, decorators: [{
2535
2544
  type: Directive,
2536
2545
  args: [{
2537
2546
  selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',
@@ -2776,10 +2785,10 @@ class CdkConnectedOverlay {
2776
2785
  this._backdropSubscription.unsubscribe();
2777
2786
  this._positionSubscription.unsubscribe();
2778
2787
  }
2779
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: CdkConnectedOverlay, deps: [{ token: Overlay }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY }, { token: i5.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2780
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.2.0", type: CdkConnectedOverlay, isStandalone: true, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: { origin: ["cdkConnectedOverlayOrigin", "origin"], positions: ["cdkConnectedOverlayPositions", "positions"], positionStrategy: ["cdkConnectedOverlayPositionStrategy", "positionStrategy"], offsetX: ["cdkConnectedOverlayOffsetX", "offsetX"], offsetY: ["cdkConnectedOverlayOffsetY", "offsetY"], width: ["cdkConnectedOverlayWidth", "width"], height: ["cdkConnectedOverlayHeight", "height"], minWidth: ["cdkConnectedOverlayMinWidth", "minWidth"], minHeight: ["cdkConnectedOverlayMinHeight", "minHeight"], backdropClass: ["cdkConnectedOverlayBackdropClass", "backdropClass"], panelClass: ["cdkConnectedOverlayPanelClass", "panelClass"], viewportMargin: ["cdkConnectedOverlayViewportMargin", "viewportMargin"], scrollStrategy: ["cdkConnectedOverlayScrollStrategy", "scrollStrategy"], open: ["cdkConnectedOverlayOpen", "open"], disableClose: ["cdkConnectedOverlayDisableClose", "disableClose"], transformOriginSelector: ["cdkConnectedOverlayTransformOriginOn", "transformOriginSelector"], hasBackdrop: ["cdkConnectedOverlayHasBackdrop", "hasBackdrop", booleanAttribute], lockPosition: ["cdkConnectedOverlayLockPosition", "lockPosition", booleanAttribute], flexibleDimensions: ["cdkConnectedOverlayFlexibleDimensions", "flexibleDimensions", booleanAttribute], growAfterOpen: ["cdkConnectedOverlayGrowAfterOpen", "growAfterOpen", booleanAttribute], push: ["cdkConnectedOverlayPush", "push", booleanAttribute], disposeOnNavigation: ["cdkConnectedOverlayDisposeOnNavigation", "disposeOnNavigation", booleanAttribute] }, outputs: { backdropClick: "backdropClick", positionChange: "positionChange", attach: "attach", detach: "detach", overlayKeydown: "overlayKeydown", overlayOutsideClick: "overlayOutsideClick" }, exportAs: ["cdkConnectedOverlay"], usesOnChanges: true, ngImport: i0 }); }
2788
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: CdkConnectedOverlay, deps: [{ token: Overlay }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY }, { token: i5.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
2789
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.0.0-next.0", type: CdkConnectedOverlay, isStandalone: true, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: { origin: ["cdkConnectedOverlayOrigin", "origin"], positions: ["cdkConnectedOverlayPositions", "positions"], positionStrategy: ["cdkConnectedOverlayPositionStrategy", "positionStrategy"], offsetX: ["cdkConnectedOverlayOffsetX", "offsetX"], offsetY: ["cdkConnectedOverlayOffsetY", "offsetY"], width: ["cdkConnectedOverlayWidth", "width"], height: ["cdkConnectedOverlayHeight", "height"], minWidth: ["cdkConnectedOverlayMinWidth", "minWidth"], minHeight: ["cdkConnectedOverlayMinHeight", "minHeight"], backdropClass: ["cdkConnectedOverlayBackdropClass", "backdropClass"], panelClass: ["cdkConnectedOverlayPanelClass", "panelClass"], viewportMargin: ["cdkConnectedOverlayViewportMargin", "viewportMargin"], scrollStrategy: ["cdkConnectedOverlayScrollStrategy", "scrollStrategy"], open: ["cdkConnectedOverlayOpen", "open"], disableClose: ["cdkConnectedOverlayDisableClose", "disableClose"], transformOriginSelector: ["cdkConnectedOverlayTransformOriginOn", "transformOriginSelector"], hasBackdrop: ["cdkConnectedOverlayHasBackdrop", "hasBackdrop", booleanAttribute], lockPosition: ["cdkConnectedOverlayLockPosition", "lockPosition", booleanAttribute], flexibleDimensions: ["cdkConnectedOverlayFlexibleDimensions", "flexibleDimensions", booleanAttribute], growAfterOpen: ["cdkConnectedOverlayGrowAfterOpen", "growAfterOpen", booleanAttribute], push: ["cdkConnectedOverlayPush", "push", booleanAttribute], disposeOnNavigation: ["cdkConnectedOverlayDisposeOnNavigation", "disposeOnNavigation", booleanAttribute] }, outputs: { backdropClick: "backdropClick", positionChange: "positionChange", attach: "attach", detach: "detach", overlayKeydown: "overlayKeydown", overlayOutsideClick: "overlayOutsideClick" }, exportAs: ["cdkConnectedOverlay"], usesOnChanges: true, ngImport: i0 }); }
2781
2790
  }
2782
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: CdkConnectedOverlay, decorators: [{
2791
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: CdkConnectedOverlay, decorators: [{
2783
2792
  type: Directive,
2784
2793
  args: [{
2785
2794
  selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',
@@ -2882,11 +2891,11 @@ const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
2882
2891
  };
2883
2892
 
2884
2893
  class OverlayModule {
2885
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2886
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.0", ngImport: i0, type: OverlayModule, imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin], exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule] }); }
2887
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayModule, providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER], imports: [BidiModule, PortalModule, ScrollingModule, ScrollingModule] }); }
2894
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2895
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayModule, imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin], exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule] }); }
2896
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayModule, providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER], imports: [BidiModule, PortalModule, ScrollingModule, ScrollingModule] }); }
2888
2897
  }
2889
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: OverlayModule, decorators: [{
2898
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: OverlayModule, decorators: [{
2890
2899
  type: NgModule,
2891
2900
  args: [{
2892
2901
  imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin],
@@ -2965,10 +2974,10 @@ class FullscreenOverlayContainer extends OverlayContainer {
2965
2974
  _document.msFullscreenElement ||
2966
2975
  null);
2967
2976
  }
2968
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: FullscreenOverlayContainer, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
2969
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: FullscreenOverlayContainer, providedIn: 'root' }); }
2977
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: FullscreenOverlayContainer, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
2978
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: FullscreenOverlayContainer, providedIn: 'root' }); }
2970
2979
  }
2971
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: FullscreenOverlayContainer, decorators: [{
2980
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0-next.0", ngImport: i0, type: FullscreenOverlayContainer, decorators: [{
2972
2981
  type: Injectable,
2973
2982
  args: [{ providedIn: 'root' }]
2974
2983
  }], ctorParameters: () => [{ type: undefined, decorators: [{