@angular/cdk 17.0.2 → 17.1.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.
- package/a11y/index.d.ts +10 -10
- package/accordion/index.d.ts +3 -3
- package/bidi/index.d.ts +2 -2
- package/clipboard/index.d.ts +2 -2
- package/collections/index.d.ts +1 -1
- package/esm2022/a11y/a11y-module.mjs +3 -4
- package/esm2022/a11y/focus-monitor/focus-monitor.mjs +21 -5
- package/esm2022/a11y/focus-trap/focus-trap.mjs +3 -2
- package/esm2022/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +14 -7
- package/esm2022/a11y/live-announcer/live-announcer.mjs +3 -2
- package/esm2022/a11y/public-api.mjs +2 -2
- package/esm2022/accordion/accordion-item.mjs +3 -2
- package/esm2022/accordion/accordion-module.mjs +3 -3
- package/esm2022/accordion/accordion.mjs +3 -2
- package/esm2022/bidi/bidi-module.mjs +3 -3
- package/esm2022/bidi/dir.mjs +3 -2
- package/esm2022/clipboard/clipboard-module.mjs +3 -3
- package/esm2022/clipboard/copy-to-clipboard.mjs +3 -2
- package/esm2022/clipboard/pending-copy.mjs +1 -1
- package/esm2022/collections/dispose-view-repeater-strategy.mjs +5 -4
- package/esm2022/collections/recycle-view-repeater-strategy.mjs +5 -4
- package/esm2022/collections/view-repeater.mjs +13 -1
- package/esm2022/dialog/dialog-container.mjs +5 -6
- package/esm2022/dialog/dialog-module.mjs +2 -2
- package/esm2022/drag-drop/drag-drop-registry.mjs +1 -1
- package/esm2022/drag-drop/drop-list-ref.mjs +37 -23
- package/esm2022/layout/breakpoints-observer.mjs +1 -1
- package/esm2022/menu/menu-bar.mjs +5 -5
- package/esm2022/menu/menu-base.mjs +3 -2
- package/esm2022/menu/menu-item-selectable.mjs +3 -2
- package/esm2022/menu/menu-item.mjs +5 -5
- package/esm2022/menu/menu-stack.mjs +8 -1
- package/esm2022/menu/menu-trigger-base.mjs +3 -2
- package/esm2022/menu/menu.mjs +6 -6
- package/esm2022/observers/observe-content.mjs +5 -4
- package/esm2022/overlay/overlay-container.mjs +1 -1
- package/esm2022/overlay/overlay-directives.mjs +9 -3
- package/esm2022/overlay/scroll/block-scroll-strategy.mjs +1 -1
- package/esm2022/platform/features/scrolling.mjs +23 -4
- package/esm2022/portal/portal-directives.mjs +11 -7
- package/esm2022/portal/portal-injector.mjs +1 -1
- package/esm2022/scrolling/scrollable.mjs +7 -7
- package/esm2022/stepper/step-header.mjs +3 -2
- package/esm2022/stepper/step-label.mjs +3 -2
- package/esm2022/stepper/stepper-button.mjs +5 -3
- package/esm2022/stepper/stepper-module.mjs +7 -6
- package/esm2022/stepper/stepper.mjs +5 -3
- package/esm2022/table/cell.mjs +24 -11
- package/esm2022/table/row.mjs +23 -10
- package/esm2022/table/table-module.mjs +4 -5
- package/esm2022/table/table.mjs +28 -15
- package/esm2022/table/text-column.mjs +6 -5
- package/esm2022/text-field/autofill.mjs +3 -2
- package/esm2022/text-field/autosize.mjs +3 -2
- package/esm2022/text-field/text-field-module.mjs +3 -3
- package/esm2022/tree/nested-node.mjs +3 -3
- package/esm2022/tree/node.mjs +3 -2
- package/esm2022/tree/outlet.mjs +3 -2
- package/esm2022/tree/padding.mjs +7 -7
- package/esm2022/tree/toggle.mjs +7 -13
- package/esm2022/tree/tree-module.mjs +3 -3
- package/esm2022/tree/tree.mjs +8 -7
- package/esm2022/version.mjs +1 -1
- package/fesm2022/a11y.mjs +40 -16
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs +6 -4
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/bidi.mjs +4 -3
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +4 -3
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/collections.mjs +26 -14
- package/fesm2022/collections.mjs.map +1 -1
- package/fesm2022/dialog.mjs +5 -6
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +36 -22
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/layout.mjs.map +1 -1
- package/fesm2022/menu.mjs +24 -14
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/observers.mjs +4 -3
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/overlay.mjs +8 -2
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/platform.mjs +23 -4
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/portal.mjs +10 -6
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +6 -6
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/stepper.mjs +18 -11
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +79 -39
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/text-field.mjs +6 -4
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/tree.mjs +25 -25
- package/fesm2022/tree.mjs.map +1 -1
- package/menu/index.d.ts +4 -4
- package/observers/index.d.ts +2 -2
- package/package.json +3 -3
- package/platform/index.d.ts +1 -1
- package/portal/index.d.ts +5 -5
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/update-tool/target-version.js +1 -2
- package/schematics/update-tool/target-version.mjs +1 -2
- package/stepper/index.d.ts +12 -12
- package/table/index.d.ts +28 -28
- package/text-field/index.d.ts +3 -3
- package/tree/index.d.ts +13 -15
package/fesm2022/observers.mjs
CHANGED
|
@@ -148,13 +148,14 @@ class CdkObserveContent {
|
|
|
148
148
|
this._currentSubscription?.unsubscribe();
|
|
149
149
|
}
|
|
150
150
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.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.4", type: CdkObserveContent, selector: "[cdkObserveContent]", inputs: { disabled: ["cdkObserveContentDisabled", "disabled", booleanAttribute], debounce: "debounce" }, outputs: { event: "cdkObserveContent" }, exportAs: ["cdkObserveContent"], ngImport: i0 }); }
|
|
151
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "17.0.4", type: CdkObserveContent, isStandalone: true, selector: "[cdkObserveContent]", inputs: { disabled: ["cdkObserveContentDisabled", "disabled", booleanAttribute], debounce: "debounce" }, outputs: { event: "cdkObserveContent" }, exportAs: ["cdkObserveContent"], ngImport: i0 }); }
|
|
152
152
|
}
|
|
153
153
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: CdkObserveContent, decorators: [{
|
|
154
154
|
type: Directive,
|
|
155
155
|
args: [{
|
|
156
156
|
selector: '[cdkObserveContent]',
|
|
157
157
|
exportAs: 'cdkObserveContent',
|
|
158
|
+
standalone: true,
|
|
158
159
|
}]
|
|
159
160
|
}], ctorParameters: () => [{ type: ContentObserver }, { type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { event: [{
|
|
160
161
|
type: Output,
|
|
@@ -167,14 +168,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImpor
|
|
|
167
168
|
}] } });
|
|
168
169
|
class ObserversModule {
|
|
169
170
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: ObserversModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
170
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.4", ngImport: i0, type: ObserversModule,
|
|
171
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.4", ngImport: i0, type: ObserversModule, imports: [CdkObserveContent], exports: [CdkObserveContent] }); }
|
|
171
172
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: ObserversModule, providers: [MutationObserverFactory] }); }
|
|
172
173
|
}
|
|
173
174
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: ObserversModule, decorators: [{
|
|
174
175
|
type: NgModule,
|
|
175
176
|
args: [{
|
|
177
|
+
imports: [CdkObserveContent],
|
|
176
178
|
exports: [CdkObserveContent],
|
|
177
|
-
declarations: [CdkObserveContent],
|
|
178
179
|
providers: [MutationObserverFactory],
|
|
179
180
|
}]
|
|
180
181
|
}] });
|
|
@@ -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})\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,QAA0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A,CAAA,CAAA,EAAA;+GAAf,eAAe,EAAA,YAAA,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,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,SAAS,EAAE,CAAC,uBAAuB,CAAC;AACrC,iBAAA,CAAA;;;AChND;;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 './index';\n"],"names":[],"mappings":";;;;;;AAyBA;;;AAGG;MAEU,uBAAuB,CAAA;AAClC,IAAA,MAAM,CAAC,QAA0B,EAAA;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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;;;;"}
|
package/fesm2022/overlay.mjs
CHANGED
|
@@ -4,7 +4,7 @@ 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, Directive, EventEmitter, booleanAttribute, Input, Output, NgModule } from '@angular/core';
|
|
7
|
+
import { Injectable, Inject, Optional, ElementRef, ApplicationRef, ANIMATION_MODULE_TYPE, InjectionToken, inject, Directive, 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';
|
|
@@ -2494,7 +2494,13 @@ const defaultPositionList = [
|
|
|
2494
2494
|
},
|
|
2495
2495
|
];
|
|
2496
2496
|
/** Injection token that determines the scroll handling while the connected overlay is open. */
|
|
2497
|
-
const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken('cdk-connected-overlay-scroll-strategy'
|
|
2497
|
+
const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken('cdk-connected-overlay-scroll-strategy', {
|
|
2498
|
+
providedIn: 'root',
|
|
2499
|
+
factory: () => {
|
|
2500
|
+
const overlay = inject(Overlay);
|
|
2501
|
+
return () => overlay.scrollStrategies.reposition();
|
|
2502
|
+
},
|
|
2503
|
+
});
|
|
2498
2504
|
/**
|
|
2499
2505
|
* Directive applied to an element to make it usable as an origin for an Overlay using a
|
|
2500
2506
|
* ConnectedPositionStrategy.
|