@angular/cdk 17.0.0-next.2 → 17.0.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/index.d.ts +4 -5
- package/accordion/index.d.ts +6 -8
- package/drag-drop/index.d.ts +14 -12
- package/esm2022/a11y/a11y-module.mjs +5 -5
- package/esm2022/a11y/aria-describer/aria-describer.mjs +4 -4
- package/esm2022/a11y/focus-monitor/focus-monitor.mjs +7 -7
- package/esm2022/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
- package/esm2022/a11y/focus-trap/focus-trap-manager.mjs +4 -4
- package/esm2022/a11y/focus-trap/focus-trap.mjs +11 -22
- package/esm2022/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +4 -4
- package/esm2022/a11y/input-modality/input-modality-detector.mjs +4 -4
- package/esm2022/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
- package/esm2022/a11y/live-announcer/live-announcer.mjs +7 -7
- package/esm2022/accordion/accordion-item.mjs +11 -17
- package/esm2022/accordion/accordion-module.mjs +5 -5
- package/esm2022/accordion/accordion.mjs +10 -16
- package/esm2022/bidi/bidi-module.mjs +5 -5
- package/esm2022/bidi/dir.mjs +4 -4
- package/esm2022/bidi/directionality.mjs +4 -4
- package/esm2022/clipboard/clipboard-module.mjs +5 -5
- package/esm2022/clipboard/clipboard.mjs +4 -4
- package/esm2022/clipboard/copy-to-clipboard.mjs +4 -4
- package/esm2022/collections/unique-selection-dispatcher.mjs +4 -4
- package/esm2022/dialog/dialog-container.mjs +4 -4
- package/esm2022/dialog/dialog-module.mjs +5 -5
- package/esm2022/dialog/dialog.mjs +4 -4
- package/esm2022/drag-drop/directives/drag-handle.mjs +7 -8
- package/esm2022/drag-drop/directives/drag-placeholder.mjs +4 -4
- package/esm2022/drag-drop/directives/drag-preview.mjs +9 -15
- package/esm2022/drag-drop/directives/drag.mjs +8 -8
- package/esm2022/drag-drop/directives/drop-list-group.mjs +8 -15
- package/esm2022/drag-drop/directives/drop-list.mjs +12 -12
- package/esm2022/drag-drop/drag-drop-module.mjs +5 -5
- package/esm2022/drag-drop/drag-drop-registry.mjs +4 -4
- package/esm2022/drag-drop/drag-drop.mjs +4 -4
- package/esm2022/drag-drop/drag-ref.mjs +5 -6
- package/esm2022/layout/breakpoints-observer.mjs +4 -4
- package/esm2022/layout/layout-module.mjs +5 -5
- package/esm2022/layout/media-matcher.mjs +4 -4
- package/esm2022/listbox/listbox-module.mjs +5 -5
- package/esm2022/listbox/listbox.mjs +25 -37
- package/esm2022/menu/context-menu-trigger.mjs +11 -18
- package/esm2022/menu/menu-aim.mjs +7 -7
- package/esm2022/menu/menu-bar.mjs +4 -4
- package/esm2022/menu/menu-base.mjs +4 -4
- package/esm2022/menu/menu-group.mjs +4 -4
- package/esm2022/menu/menu-item-checkbox.mjs +4 -4
- package/esm2022/menu/menu-item-radio.mjs +4 -4
- package/esm2022/menu/menu-item-selectable.mjs +8 -15
- package/esm2022/menu/menu-item.mjs +8 -15
- package/esm2022/menu/menu-module.mjs +5 -5
- package/esm2022/menu/menu-stack.mjs +4 -4
- package/esm2022/menu/menu-trigger-base.mjs +4 -4
- package/esm2022/menu/menu-trigger.mjs +4 -4
- package/esm2022/menu/menu.mjs +4 -4
- package/esm2022/observers/observe-content.mjs +18 -18
- package/esm2022/observers/private/shared-resize-observer.mjs +4 -4
- package/esm2022/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
- package/esm2022/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +4 -4
- package/esm2022/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +4 -4
- package/esm2022/overlay/fullscreen-overlay-container.mjs +4 -4
- package/esm2022/overlay/overlay-container.mjs +4 -4
- package/esm2022/overlay/overlay-directives.mjs +22 -53
- package/esm2022/overlay/overlay-module.mjs +5 -5
- package/esm2022/overlay/overlay.mjs +4 -4
- package/esm2022/overlay/position/overlay-position-builder.mjs +4 -4
- package/esm2022/overlay/scroll/scroll-strategy-options.mjs +4 -4
- package/esm2022/platform/platform-module.mjs +5 -5
- package/esm2022/platform/platform.mjs +4 -4
- package/esm2022/portal/portal-directives.mjs +17 -17
- package/esm2022/scrolling/fixed-size-virtual-scroll.mjs +4 -4
- package/esm2022/scrolling/scroll-dispatcher.mjs +4 -4
- package/esm2022/scrolling/scrollable.mjs +4 -4
- package/esm2022/scrolling/scrolling-module.mjs +9 -9
- package/esm2022/scrolling/viewport-ruler.mjs +4 -4
- package/esm2022/scrolling/virtual-for-of.mjs +4 -4
- package/esm2022/scrolling/virtual-scroll-viewport.mjs +17 -19
- package/esm2022/scrolling/virtual-scrollable-element.mjs +4 -4
- package/esm2022/scrolling/virtual-scrollable-window.mjs +4 -4
- package/esm2022/scrolling/virtual-scrollable.mjs +4 -4
- package/esm2022/stepper/step-header.mjs +4 -4
- package/esm2022/stepper/step-label.mjs +4 -4
- package/esm2022/stepper/stepper-button.mjs +7 -7
- package/esm2022/stepper/stepper-module.mjs +5 -5
- package/esm2022/stepper/stepper.mjs +35 -49
- package/esm2022/table/cell.mjs +29 -29
- package/esm2022/table/coalesced-style-scheduler.mjs +4 -4
- package/esm2022/table/row.mjs +28 -28
- package/esm2022/table/table-module.mjs +5 -5
- package/esm2022/table/table.mjs +28 -27
- package/esm2022/table/text-column.mjs +4 -4
- package/esm2022/text-field/autofill.mjs +7 -7
- package/esm2022/text-field/autosize.mjs +7 -8
- package/esm2022/text-field/text-field-module.mjs +5 -5
- package/esm2022/tree/nested-node.mjs +4 -4
- package/esm2022/tree/node.mjs +4 -4
- package/esm2022/tree/outlet.mjs +4 -4
- package/esm2022/tree/padding.mjs +4 -4
- package/esm2022/tree/toggle.mjs +4 -4
- package/esm2022/tree/tree-module.mjs +5 -5
- package/esm2022/tree/tree.mjs +7 -7
- package/esm2022/version.mjs +1 -1
- package/fesm2022/a11y.mjs +45 -55
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs +22 -33
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/bidi.mjs +10 -10
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +10 -10
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/collections.mjs +3 -3
- package/fesm2022/collections.mjs.map +1 -1
- package/fesm2022/dialog.mjs +10 -10
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +50 -62
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/layout.mjs +10 -10
- package/fesm2022/layout.mjs.map +1 -1
- package/fesm2022/listbox.mjs +28 -40
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +59 -78
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/observers/private.mjs +3 -3
- package/fesm2022/observers/private.mjs.map +1 -1
- package/fesm2022/observers.mjs +17 -17
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/overlay.mjs +50 -80
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/platform.mjs +7 -7
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/portal.mjs +16 -16
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +49 -50
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/stepper.mjs +50 -64
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +92 -89
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/text-field.mjs +16 -17
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/tree.mjs +25 -25
- package/fesm2022/tree.mjs.map +1 -1
- package/listbox/index.d.ts +14 -13
- package/menu/index.d.ts +6 -10
- package/observers/index.d.ts +2 -2
- package/overlay/index.d.ts +10 -16
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/update-tool/component-resource-collector.d.ts +1 -0
- package/schematics/update-tool/component-resource-collector.js +17 -8
- package/schematics/update-tool/component-resource-collector.mjs +17 -8
- package/schematics/utils/project-main-file.js +4 -3
- package/schematics/utils/project-main-file.mjs +4 -3
- package/schematics/utils/project-targets.js +2 -2
- package/schematics/utils/project-targets.mjs +2 -2
- package/scrolling/index.d.ts +2 -4
- package/stepper/index.d.ts +12 -14
- package/table/index.d.ts +6 -4
- package/text-field/index.d.ts +2 -2
|
@@ -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: "
|
|
111
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
110
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: SharedResizeObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
111
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: SharedResizeObserver, providedIn: 'root' }); }
|
|
112
112
|
}
|
|
113
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", 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;;;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J,SAAA;KACF;IAED,WAAW,GAAA;QACT,KAAK,MAAM,GAAG,QAAQ,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE;YAC1C,QAAQ,CAAC,OAAO,EAAE,CAAC;AACpB,SAAA;AACD,QAAA,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;AACxB,QAAA,IAAI,OAAO,cAAc,KAAK,WAAW,KAAK,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,EAAE;AAC5F,YAAA,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAC;AACpE,SAAA;KACF;AAED;;;;;AAKG;IACH,OAAO,CAAC,MAAe,EAAE,OAA+B,EAAA;AACtD,QAAA,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,aAAa,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AAC7B,YAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,6BAA6B,CAAC,GAAG,CAAC,CAAC,CAAC;AAClE,SAAA;AACD,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;KAClD;
|
|
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,CAC3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A,IAAI,OAAO,cAAc,KAAK,WAAW,KAAK,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,EAAE;AAC5F,YAAA,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAC;AACpE,SAAA;KACF;AAED;;;;;AAKG;IACH,OAAO,CAAC,MAAe,EAAE,OAA+B,EAAA;AACtD,QAAA,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,aAAa,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AAC7B,YAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,6BAA6B,CAAC,GAAG,CAAC,CAAC,CAAC;AAClE,SAAA;AACD,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,OAAO,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;;;;"}
|
package/fesm2022/observers.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { coerceElement,
|
|
1
|
+
import { coerceElement, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Injectable, EventEmitter, Directive, Output, Input, NgModule } from '@angular/core';
|
|
3
|
+
import { Injectable, EventEmitter, booleanAttribute, Directive, Output, Input, NgModule } from '@angular/core';
|
|
4
4
|
import { Observable, Subject } from 'rxjs';
|
|
5
5
|
import { debounceTime } from 'rxjs/operators';
|
|
6
6
|
|
|
@@ -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: "
|
|
16
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
15
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
16
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' }); }
|
|
17
17
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", 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: "
|
|
89
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
88
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: ContentObserver, deps: [{ token: MutationObserverFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
89
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: ContentObserver, providedIn: 'root' }); }
|
|
90
90
|
}
|
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: ContentObserver, decorators: [{
|
|
92
92
|
type: Injectable,
|
|
93
93
|
args: [{ providedIn: 'root' }]
|
|
94
94
|
}], ctorParameters: function () { return [{ type: MutationObserverFactory }]; } });
|
|
@@ -105,7 +105,7 @@ class CdkObserveContent {
|
|
|
105
105
|
return this._disabled;
|
|
106
106
|
}
|
|
107
107
|
set disabled(value) {
|
|
108
|
-
this._disabled =
|
|
108
|
+
this._disabled = value;
|
|
109
109
|
this._disabled ? this._unsubscribe() : this._subscribe();
|
|
110
110
|
}
|
|
111
111
|
/** Debounce interval for emitting the changes. */
|
|
@@ -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: "
|
|
151
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
150
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", 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.0.0-next.4", type: CdkObserveContent, 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: "
|
|
153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: CdkObserveContent, decorators: [{
|
|
154
154
|
type: Directive,
|
|
155
155
|
args: [{
|
|
156
156
|
selector: '[cdkObserveContent]',
|
|
@@ -161,16 +161,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImpor
|
|
|
161
161
|
args: ['cdkObserveContent']
|
|
162
162
|
}], disabled: [{
|
|
163
163
|
type: Input,
|
|
164
|
-
args: ['cdkObserveContentDisabled']
|
|
164
|
+
args: [{ alias: 'cdkObserveContentDisabled', transform: booleanAttribute }]
|
|
165
165
|
}], debounce: [{
|
|
166
166
|
type: Input
|
|
167
167
|
}] } });
|
|
168
168
|
class ObserversModule {
|
|
169
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
170
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
171
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
169
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: ObserversModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
170
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.0-next.4", ngImport: i0, type: ObserversModule, declarations: [CdkObserveContent], exports: [CdkObserveContent] }); }
|
|
171
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: ObserversModule, providers: [MutationObserverFactory] }); }
|
|
172
172
|
}
|
|
173
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: ObserversModule, decorators: [{
|
|
174
174
|
type: NgModule,
|
|
175
175
|
args: [{
|
|
176
176
|
exports: [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 {\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/** 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})\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('cdkObserveContentDisabled')\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: BooleanInput) {\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 {\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 exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory],\n})\nexport class ObserversModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AA8BA;;;AAGG;MAEU,uBAAuB,CAAA;AAClC,IAAA,MAAM,CAAC,QAA0B,EAAA;AAC/B,QAAA,OAAO,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;KACxF;8GAHU,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA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AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,SAAS,EAAE,CAAC,uBAAuB,CAAC;AACrC,iBAAA,CAAA;;;ACrND;;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})\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 exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory],\n})\nexport class ObserversModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAyBA;;;AAGG;MAEU,uBAAuB,CAAA;AAClC,IAAA,MAAM,CAAC,QAA0B,EAAA;AAC/B,QAAA,OAAO,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;KACxF;qHAHU,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,q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A,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,SAAS,EAAE,CAAC,uBAAuB,CAAC;AACrC,iBAAA,CAAA;;;AChND;;AAEG;;;;"}
|
package/fesm2022/overlay.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import * as i6 from '@angular/common';
|
|
|
5
5
|
import { DOCUMENT } from '@angular/common';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
7
|
import { Injectable, Inject, Optional, ElementRef, ApplicationRef, ANIMATION_MODULE_TYPE, InjectionToken, Directive, EventEmitter, booleanAttribute, Input, Output, NgModule } from '@angular/core';
|
|
8
|
-
import { coerceCssPixelValue, coerceArray
|
|
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
11
|
import { filter, take, takeUntil, takeWhile } from 'rxjs/operators';
|
|
@@ -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: "
|
|
283
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
282
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", 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.0.0-next.4", ngImport: i0, type: ScrollStrategyOptions, providedIn: 'root' }); }
|
|
284
284
|
}
|
|
285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: ScrollStrategyOptions, decorators: [{
|
|
286
286
|
type: Injectable,
|
|
287
287
|
args: [{ providedIn: 'root' }]
|
|
288
288
|
}], ctorParameters: function () { return [{ 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: "
|
|
443
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
442
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: BaseOverlayDispatcher, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
443
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: BaseOverlayDispatcher, providedIn: 'root' }); }
|
|
444
444
|
}
|
|
445
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
445
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: BaseOverlayDispatcher, decorators: [{
|
|
446
446
|
type: Injectable,
|
|
447
447
|
args: [{ providedIn: 'root' }]
|
|
448
448
|
}], ctorParameters: function () { return [{ 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: "
|
|
511
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
510
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", 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.0.0-next.4", ngImport: i0, type: OverlayKeyboardDispatcher, providedIn: 'root' }); }
|
|
512
512
|
}
|
|
513
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
513
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: OverlayKeyboardDispatcher, decorators: [{
|
|
514
514
|
type: Injectable,
|
|
515
515
|
args: [{ providedIn: 'root' }]
|
|
516
516
|
}], ctorParameters: function () { return [{ 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: "
|
|
636
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
635
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", 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.0.0-next.4", ngImport: i0, type: OverlayOutsideClickDispatcher, providedIn: 'root' }); }
|
|
637
637
|
}
|
|
638
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: OverlayOutsideClickDispatcher, decorators: [{
|
|
639
639
|
type: Injectable,
|
|
640
640
|
args: [{ providedIn: 'root' }]
|
|
641
641
|
}], ctorParameters: function () { return [{ 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: "
|
|
707
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
706
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", 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.0.0-next.4", ngImport: i0, type: OverlayContainer, providedIn: 'root' }); }
|
|
708
708
|
}
|
|
709
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
709
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: OverlayContainer, decorators: [{
|
|
710
710
|
type: Injectable,
|
|
711
711
|
args: [{ providedIn: 'root' }]
|
|
712
712
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -2355,10 +2355,10 @@ class OverlayPositionBuilder {
|
|
|
2355
2355
|
flexibleConnectedTo(origin) {
|
|
2356
2356
|
return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document, this._platform, this._overlayContainer);
|
|
2357
2357
|
}
|
|
2358
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2359
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2358
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: OverlayPositionBuilder, deps: [{ token: i1.ViewportRuler }, { token: DOCUMENT }, { token: i1$1.Platform }, { token: OverlayContainer }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2359
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: OverlayPositionBuilder, providedIn: 'root' }); }
|
|
2360
2360
|
}
|
|
2361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: OverlayPositionBuilder, decorators: [{
|
|
2362
2362
|
type: Injectable,
|
|
2363
2363
|
args: [{ providedIn: 'root' }]
|
|
2364
2364
|
}], ctorParameters: function () { return [{ type: i1.ViewportRuler }, { type: undefined, decorators: [{
|
|
@@ -2450,10 +2450,10 @@ class Overlay {
|
|
|
2450
2450
|
}
|
|
2451
2451
|
return new DomPortalOutlet(pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);
|
|
2452
2452
|
}
|
|
2453
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2454
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2453
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", 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 }); }
|
|
2454
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: Overlay, providedIn: 'root' }); }
|
|
2455
2455
|
}
|
|
2456
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: Overlay, decorators: [{
|
|
2457
2457
|
type: Injectable,
|
|
2458
2458
|
args: [{ providedIn: 'root' }]
|
|
2459
2459
|
}], ctorParameters: function () { return [{ type: ScrollStrategyOptions }, { type: OverlayContainer }, { type: i0.ComponentFactoryResolver }, { type: OverlayPositionBuilder }, { type: OverlayKeyboardDispatcher }, { type: i0.Injector }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
@@ -2505,10 +2505,10 @@ class CdkOverlayOrigin {
|
|
|
2505
2505
|
elementRef) {
|
|
2506
2506
|
this.elementRef = elementRef;
|
|
2507
2507
|
}
|
|
2508
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2509
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2508
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: CdkOverlayOrigin, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2509
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.0-next.4", type: CdkOverlayOrigin, isStandalone: true, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"], ngImport: i0 }); }
|
|
2510
2510
|
}
|
|
2511
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: CdkOverlayOrigin, decorators: [{
|
|
2512
2512
|
type: Directive,
|
|
2513
2513
|
args: [{
|
|
2514
2514
|
selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',
|
|
@@ -2541,41 +2541,6 @@ class CdkConnectedOverlay {
|
|
|
2541
2541
|
this._updatePositionStrategy(this._position);
|
|
2542
2542
|
}
|
|
2543
2543
|
}
|
|
2544
|
-
/** Whether or not the overlay should attach a backdrop. */
|
|
2545
|
-
get hasBackdrop() {
|
|
2546
|
-
return this._hasBackdrop;
|
|
2547
|
-
}
|
|
2548
|
-
set hasBackdrop(value) {
|
|
2549
|
-
this._hasBackdrop = coerceBooleanProperty(value);
|
|
2550
|
-
}
|
|
2551
|
-
/** Whether or not the overlay should be locked when scrolling. */
|
|
2552
|
-
get lockPosition() {
|
|
2553
|
-
return this._lockPosition;
|
|
2554
|
-
}
|
|
2555
|
-
set lockPosition(value) {
|
|
2556
|
-
this._lockPosition = coerceBooleanProperty(value);
|
|
2557
|
-
}
|
|
2558
|
-
/** Whether the overlay's width and height can be constrained to fit within the viewport. */
|
|
2559
|
-
get flexibleDimensions() {
|
|
2560
|
-
return this._flexibleDimensions;
|
|
2561
|
-
}
|
|
2562
|
-
set flexibleDimensions(value) {
|
|
2563
|
-
this._flexibleDimensions = coerceBooleanProperty(value);
|
|
2564
|
-
}
|
|
2565
|
-
/** Whether the overlay can grow after the initial open when flexible positioning is turned on. */
|
|
2566
|
-
get growAfterOpen() {
|
|
2567
|
-
return this._growAfterOpen;
|
|
2568
|
-
}
|
|
2569
|
-
set growAfterOpen(value) {
|
|
2570
|
-
this._growAfterOpen = coerceBooleanProperty(value);
|
|
2571
|
-
}
|
|
2572
|
-
/** Whether the overlay can be pushed on-screen if none of the provided positions fit. */
|
|
2573
|
-
get push() {
|
|
2574
|
-
return this._push;
|
|
2575
|
-
}
|
|
2576
|
-
set push(value) {
|
|
2577
|
-
this._push = coerceBooleanProperty(value);
|
|
2578
|
-
}
|
|
2579
2544
|
/** Whether the overlay should be disposed of when the user goes backwards/forwards in history. */
|
|
2580
2545
|
get disposeOnNavigation() {
|
|
2581
2546
|
return this._disposeOnNavigation;
|
|
@@ -2587,11 +2552,6 @@ class CdkConnectedOverlay {
|
|
|
2587
2552
|
constructor(_overlay, templateRef, viewContainerRef, scrollStrategyFactory, _dir) {
|
|
2588
2553
|
this._overlay = _overlay;
|
|
2589
2554
|
this._dir = _dir;
|
|
2590
|
-
this._hasBackdrop = false;
|
|
2591
|
-
this._lockPosition = false;
|
|
2592
|
-
this._growAfterOpen = false;
|
|
2593
|
-
this._flexibleDimensions = false;
|
|
2594
|
-
this._push = false;
|
|
2595
2555
|
this._backdropSubscription = Subscription.EMPTY;
|
|
2596
2556
|
this._attachSubscription = Subscription.EMPTY;
|
|
2597
2557
|
this._detachSubscription = Subscription.EMPTY;
|
|
@@ -2603,6 +2563,16 @@ class CdkConnectedOverlay {
|
|
|
2603
2563
|
this.open = false;
|
|
2604
2564
|
/** Whether the overlay can be closed by user interaction. */
|
|
2605
2565
|
this.disableClose = false;
|
|
2566
|
+
/** Whether or not the overlay should attach a backdrop. */
|
|
2567
|
+
this.hasBackdrop = false;
|
|
2568
|
+
/** Whether or not the overlay should be locked when scrolling. */
|
|
2569
|
+
this.lockPosition = false;
|
|
2570
|
+
/** Whether the overlay's width and height can be constrained to fit within the viewport. */
|
|
2571
|
+
this.flexibleDimensions = false;
|
|
2572
|
+
/** Whether the overlay can grow after the initial open when flexible positioning is turned on. */
|
|
2573
|
+
this.growAfterOpen = false;
|
|
2574
|
+
/** Whether the overlay can be pushed on-screen if none of the provided positions fit. */
|
|
2575
|
+
this.push = false;
|
|
2606
2576
|
/** Event emitted when the backdrop is clicked. */
|
|
2607
2577
|
this.backdropClick = new EventEmitter();
|
|
2608
2578
|
/** Event emitted when the position has changed. */
|
|
@@ -2782,10 +2752,10 @@ class CdkConnectedOverlay {
|
|
|
2782
2752
|
this._backdropSubscription.unsubscribe();
|
|
2783
2753
|
this._positionSubscription.unsubscribe();
|
|
2784
2754
|
}
|
|
2785
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2786
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
2755
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", 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 }); }
|
|
2756
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.0.0-next.4", 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 }); }
|
|
2787
2757
|
}
|
|
2788
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2758
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: CdkConnectedOverlay, decorators: [{
|
|
2789
2759
|
type: Directive,
|
|
2790
2760
|
args: [{
|
|
2791
2761
|
selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',
|
|
@@ -2847,19 +2817,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImpor
|
|
|
2847
2817
|
args: ['cdkConnectedOverlayTransformOriginOn']
|
|
2848
2818
|
}], hasBackdrop: [{
|
|
2849
2819
|
type: Input,
|
|
2850
|
-
args: ['cdkConnectedOverlayHasBackdrop']
|
|
2820
|
+
args: [{ alias: 'cdkConnectedOverlayHasBackdrop', transform: booleanAttribute }]
|
|
2851
2821
|
}], lockPosition: [{
|
|
2852
2822
|
type: Input,
|
|
2853
|
-
args: ['cdkConnectedOverlayLockPosition']
|
|
2823
|
+
args: [{ alias: 'cdkConnectedOverlayLockPosition', transform: booleanAttribute }]
|
|
2854
2824
|
}], flexibleDimensions: [{
|
|
2855
2825
|
type: Input,
|
|
2856
|
-
args: ['cdkConnectedOverlayFlexibleDimensions']
|
|
2826
|
+
args: [{ alias: 'cdkConnectedOverlayFlexibleDimensions', transform: booleanAttribute }]
|
|
2857
2827
|
}], growAfterOpen: [{
|
|
2858
2828
|
type: Input,
|
|
2859
|
-
args: ['cdkConnectedOverlayGrowAfterOpen']
|
|
2829
|
+
args: [{ alias: 'cdkConnectedOverlayGrowAfterOpen', transform: booleanAttribute }]
|
|
2860
2830
|
}], push: [{
|
|
2861
2831
|
type: Input,
|
|
2862
|
-
args: ['cdkConnectedOverlayPush']
|
|
2832
|
+
args: [{ alias: 'cdkConnectedOverlayPush', transform: booleanAttribute }]
|
|
2863
2833
|
}], disposeOnNavigation: [{
|
|
2864
2834
|
type: Input,
|
|
2865
2835
|
args: [{ alias: 'cdkConnectedOverlayDisposeOnNavigation', transform: booleanAttribute }]
|
|
@@ -2888,11 +2858,11 @@ const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
|
|
|
2888
2858
|
};
|
|
2889
2859
|
|
|
2890
2860
|
class OverlayModule {
|
|
2891
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2892
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
2893
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2861
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: OverlayModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2862
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.0-next.4", ngImport: i0, type: OverlayModule, imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin], exports: [CdkConnectedOverlay, CdkOverlayOrigin, ScrollingModule] }); }
|
|
2863
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: OverlayModule, providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER], imports: [BidiModule, PortalModule, ScrollingModule, ScrollingModule] }); }
|
|
2894
2864
|
}
|
|
2895
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2865
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: OverlayModule, decorators: [{
|
|
2896
2866
|
type: NgModule,
|
|
2897
2867
|
args: [{
|
|
2898
2868
|
imports: [BidiModule, PortalModule, ScrollingModule, CdkConnectedOverlay, CdkOverlayOrigin],
|
|
@@ -2971,10 +2941,10 @@ class FullscreenOverlayContainer extends OverlayContainer {
|
|
|
2971
2941
|
_document.msFullscreenElement ||
|
|
2972
2942
|
null);
|
|
2973
2943
|
}
|
|
2974
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2975
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2944
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: FullscreenOverlayContainer, deps: [{ token: DOCUMENT }, { token: i1$1.Platform }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2945
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: FullscreenOverlayContainer, providedIn: 'root' }); }
|
|
2976
2946
|
}
|
|
2977
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2947
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0-next.4", ngImport: i0, type: FullscreenOverlayContainer, decorators: [{
|
|
2978
2948
|
type: Injectable,
|
|
2979
2949
|
args: [{ providedIn: 'root' }]
|
|
2980
2950
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|