@angular/cdk 20.0.0-next.0 → 20.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.
- package/a11y/index.d.ts +330 -1234
- package/a11y-module.d-7d03e079.d.ts +313 -0
- package/accordion/index.d.ts +8 -27
- package/activedescendant-key-manager.d-11921e3a.d.ts +31 -0
- package/bidi/index.d.ts +3 -62
- package/bidi-module.d-f8648621.d.ts +53 -0
- package/clipboard/index.d.ts +61 -75
- package/coercion/index.d.ts +10 -33
- package/coercion/private/index.d.ts +2 -2
- package/collections/index.d.ts +13 -291
- package/data-source.d-7cab2c9d.d.ts +42 -0
- package/dialog/index.d.ts +204 -249
- package/drag-drop/index.d.ts +1077 -1157
- package/fesm2022/a11y-module-e6996d20.mjs +952 -0
- package/fesm2022/a11y-module-e6996d20.mjs.map +1 -0
- package/fesm2022/a11y.mjs +47 -2445
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs +12 -16
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/activedescendant-key-manager-1351a9d3.mjs +16 -0
- package/fesm2022/activedescendant-key-manager-1351a9d3.mjs.map +1 -0
- package/fesm2022/array-ee3b4bab.mjs +6 -0
- package/fesm2022/array-ee3b4bab.mjs.map +1 -0
- package/fesm2022/backwards-compatibility-bcbe473e.mjs +25 -0
- package/fesm2022/backwards-compatibility-bcbe473e.mjs.map +1 -0
- package/fesm2022/bidi-module-0726b65c.mjs +78 -0
- package/fesm2022/bidi-module-0726b65c.mjs.map +1 -0
- package/fesm2022/bidi.mjs +4 -143
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/breakpoints-observer-d4584b66.mjs +179 -0
- package/fesm2022/breakpoints-observer-d4584b66.mjs.map +1 -0
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +10 -14
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/coercion/private.mjs +2 -18
- package/fesm2022/coercion/private.mjs.map +1 -1
- package/fesm2022/coercion.mjs +5 -39
- package/fesm2022/coercion.mjs.map +1 -1
- package/fesm2022/collections.mjs +7 -476
- package/fesm2022/collections.mjs.map +1 -1
- package/fesm2022/css-pixel-value-286c9a60.mjs +10 -0
- package/fesm2022/css-pixel-value-286c9a60.mjs.map +1 -0
- package/fesm2022/data-source-5320b6fd.mjs +15 -0
- package/fesm2022/data-source-5320b6fd.mjs.map +1 -0
- package/fesm2022/dialog.mjs +37 -39
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/directionality-7ea26429.mjs +72 -0
- package/fesm2022/directionality-7ea26429.mjs.map +1 -0
- package/fesm2022/dispose-view-repeater-strategy-b11b87ea.mjs +44 -0
- package/fesm2022/dispose-view-repeater-strategy-b11b87ea.mjs.map +1 -0
- package/fesm2022/drag-drop.mjs +48 -50
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/element-705567fe.mjs +29 -0
- package/fesm2022/element-705567fe.mjs.map +1 -0
- package/fesm2022/fake-event-detection-7055b1bd.mjs +24 -0
- package/fesm2022/fake-event-detection-7055b1bd.mjs.map +1 -0
- package/fesm2022/focus-key-manager-58d29acd.mjs +22 -0
- package/fesm2022/focus-key-manager-58d29acd.mjs.map +1 -0
- package/fesm2022/focus-monitor-cebaa0d1.mjs +629 -0
- package/fesm2022/focus-monitor-cebaa0d1.mjs.map +1 -0
- package/fesm2022/id-generator-fba495fb.mjs +37 -0
- package/fesm2022/id-generator-fba495fb.mjs.map +1 -0
- package/fesm2022/keycodes-107cd3e4.mjs +122 -0
- package/fesm2022/keycodes-107cd3e4.mjs.map +1 -0
- package/fesm2022/keycodes.mjs +2 -136
- package/fesm2022/keycodes.mjs.map +1 -1
- package/fesm2022/layout.mjs +12 -184
- package/fesm2022/layout.mjs.map +1 -1
- package/fesm2022/list-key-manager-c7b5cefb.mjs +360 -0
- package/fesm2022/list-key-manager-c7b5cefb.mjs.map +1 -0
- package/fesm2022/listbox.mjs +21 -20
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +76 -60
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/modifiers-33a5859e.mjs +13 -0
- package/fesm2022/modifiers-33a5859e.mjs.map +1 -0
- package/fesm2022/observable-97c0792c.mjs +15 -0
- package/fesm2022/observable-97c0792c.mjs.map +1 -0
- package/fesm2022/observe-content-d2a6b5a0.mjs +210 -0
- package/fesm2022/observe-content-d2a6b5a0.mjs.map +1 -0
- package/fesm2022/observers/private.mjs +3 -7
- package/fesm2022/observers/private.mjs.map +1 -1
- package/fesm2022/observers.mjs +5 -213
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/overlay-module-863b82c9.mjs +3029 -0
- package/fesm2022/overlay-module-863b82c9.mjs.map +1 -0
- package/fesm2022/overlay.mjs +28 -3019
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/passive-listeners-c0bdc49f.mjs +31 -0
- package/fesm2022/passive-listeners-c0bdc49f.mjs.map +1 -0
- package/fesm2022/platform-1be098b0.mjs +77 -0
- package/fesm2022/platform-1be098b0.mjs.map +1 -0
- package/fesm2022/platform.mjs +13 -293
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/portal-directives-c88fea11.mjs +615 -0
- package/fesm2022/portal-directives-c88fea11.mjs.map +1 -0
- package/fesm2022/portal.mjs +3 -650
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/private.mjs +3 -63
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/recycle-view-repeater-strategy-c1712813.mjs +156 -0
- package/fesm2022/recycle-view-repeater-strategy-c1712813.mjs.map +1 -0
- package/fesm2022/scrolling-61955dd1.mjs +99 -0
- package/fesm2022/scrolling-61955dd1.mjs.map +1 -0
- package/fesm2022/scrolling-module-aa9eeac5.mjs +1463 -0
- package/fesm2022/scrolling-module-aa9eeac5.mjs.map +1 -0
- package/fesm2022/scrolling.mjs +12 -1463
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection-model-30243dba.mjs +221 -0
- package/fesm2022/selection-model-30243dba.mjs.map +1 -0
- package/fesm2022/shadow-dom-9f403d00.mjs +49 -0
- package/fesm2022/shadow-dom-9f403d00.mjs.map +1 -0
- package/fesm2022/stepper.mjs +32 -30
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/style-loader-e14dc585.mjs +47 -0
- package/fesm2022/style-loader-e14dc585.mjs.map +1 -0
- package/fesm2022/table.mjs +88 -132
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/test-environment-34eef1ee.mjs +19 -0
- package/fesm2022/test-environment-34eef1ee.mjs.map +1 -0
- package/fesm2022/testing/selenium-webdriver.mjs +2 -1
- package/fesm2022/testing/selenium-webdriver.mjs.map +1 -1
- package/fesm2022/testing/testbed.mjs +33 -74
- package/fesm2022/testing/testbed.mjs.map +1 -1
- package/fesm2022/testing.mjs +2 -697
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/text-field.mjs +20 -23
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/text-filtering-b60ba8a2.mjs +698 -0
- package/fesm2022/text-filtering-b60ba8a2.mjs.map +1 -0
- package/fesm2022/tree-key-manager-2f20c79c.mjs +360 -0
- package/fesm2022/tree-key-manager-2f20c79c.mjs.map +1 -0
- package/fesm2022/tree.mjs +33 -33
- package/fesm2022/tree.mjs.map +1 -1
- package/fesm2022/typeahead-11ae39bd.mjs +88 -0
- package/fesm2022/typeahead-11ae39bd.mjs.map +1 -0
- package/fesm2022/unique-selection-dispatcher-1d6f91d8.mjs +49 -0
- package/fesm2022/unique-selection-dispatcher-1d6f91d8.mjs.map +1 -0
- package/fesm2022/visually-hidden-83aea4a0.mjs +18 -0
- package/fesm2022/visually-hidden-83aea4a0.mjs.map +1 -0
- package/focus-key-manager.d-415a6958.d.ts +33 -0
- package/focus-monitor.d-810a02e6.d.ts +209 -0
- package/harness-environment.d-4d615248.d.ts +619 -0
- package/index.d.ts +2 -2
- package/keycodes/index.d.ts +123 -244
- package/layout/index.d.ts +23 -25
- package/list-key-manager.d-72e9a2e7.d.ts +164 -0
- package/listbox/index.d.ts +91 -107
- package/menu/index.d.ts +596 -682
- package/number-property.d-ce316715.d.ts +15 -0
- package/observe-content.d-c08bc882.d.ts +84 -0
- package/observers/index.d.ts +4 -90
- package/observers/private/index.d.ts +3 -3
- package/overlay/index.d.ts +110 -951
- package/overlay-module.d-5d06db8a.d.ts +790 -0
- package/package.json +1 -1
- package/platform/index.d.ts +45 -86
- package/platform.d-0a5b4792.d.ts +33 -0
- package/portal/index.d.ts +5 -264
- package/portal-directives.d-d345bd53.d.ts +210 -0
- package/private/index.d.ts +3 -20
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/scrolling/index.d.ts +7 -687
- package/scrolling-module.d-a08a462d.d.ts +551 -0
- package/selection-model.d-1a70542c.d.ts +111 -0
- package/stepper/index.d.ts +74 -124
- package/style-loader.d-19baab84.d.ts +21 -0
- package/table/index.d.ts +329 -453
- package/testing/index.d.ts +32 -675
- package/testing/selenium-webdriver/index.d.ts +30 -20
- package/testing/testbed/index.d.ts +9 -19
- package/text-field/index.d.ts +9 -30
- package/tree/index.d.ts +205 -271
- package/tree-key-manager-strategy.d-603161dd.d.ts +116 -0
- package/unique-selection-dispatcher.d-7993b9f5.d.ts +32 -0
- package/view-repeater.d-79039e1f.d.ts +88 -0
- package/viewport-ruler.d-f3d3e82f.d.ts +57 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks whether a modifier key is pressed.
|
|
3
|
+
* @param event Event to be checked.
|
|
4
|
+
*/
|
|
5
|
+
function hasModifierKey(event, ...modifiers) {
|
|
6
|
+
if (modifiers.length) {
|
|
7
|
+
return modifiers.some(modifier => event[modifier]);
|
|
8
|
+
}
|
|
9
|
+
return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { hasModifierKey as h };
|
|
13
|
+
//# sourceMappingURL=modifiers-33a5859e.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modifiers-33a5859e.mjs","sources":["../../../../../../src/cdk/keycodes/modifiers.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.dev/license\n */\n\nexport type ModifierKey = 'altKey' | 'shiftKey' | 'ctrlKey' | 'metaKey';\n\n/**\n * Checks whether a modifier key is pressed.\n * @param event Event to be checked.\n */\nexport function hasModifierKey(event: KeyboardEvent, ...modifiers: ModifierKey[]): boolean {\n if (modifiers.length) {\n return modifiers.some(modifier => event[modifier]);\n }\n\n return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey;\n}\n"],"names":[],"mappings":"AAUA;;;AAGG;SACa,cAAc,CAAC,KAAoB,EAAE,GAAG,SAAwB,EAAA;AAC9E,IAAA,IAAI,SAAS,CAAC,MAAM,EAAE;AACpB,QAAA,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;KACpD;AAEA,IAAA,OAAO,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAA;AACzE;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isObservable, of } from 'rxjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Given either an Observable or non-Observable value, returns either the original
|
|
5
|
+
* Observable, or wraps it in an Observable that emits the non-Observable value.
|
|
6
|
+
*/
|
|
7
|
+
function coerceObservable(data) {
|
|
8
|
+
if (!isObservable(data)) {
|
|
9
|
+
return of(data);
|
|
10
|
+
}
|
|
11
|
+
return data;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { coerceObservable as c };
|
|
15
|
+
//# sourceMappingURL=observable-97c0792c.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observable-97c0792c.mjs","sources":["../../../../../../src/cdk/coercion/private/observable.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.dev/license\n */\nimport {Observable, isObservable, of as observableOf} from 'rxjs';\n\n/**\n * Given either an Observable or non-Observable value, returns either the original\n * Observable, or wraps it in an Observable that emits the non-Observable value.\n */\nexport function coerceObservable<T>(data: T | Observable<T>): Observable<T> {\n if (!isObservable(data)) {\n return observableOf(data);\n }\n return data;\n}\n"],"names":["observableOf"],"mappings":";;AASA;;;AAGG;AACG,SAAU,gBAAgB,CAAI,IAAuB,EAAA;AACzD,IAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;AACvB,QAAA,OAAOA,EAAY,CAAC,IAAI,CAAC,CAAA;KAC3B;AACA,IAAA,OAAO,IAAI,CAAA;AACb;;;;"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, inject, NgZone, ElementRef, EventEmitter, booleanAttribute, Directive, Output, Input, NgModule } from '@angular/core';
|
|
3
|
+
import { Observable, Subject } from 'rxjs';
|
|
4
|
+
import { map, filter, debounceTime } from 'rxjs/operators';
|
|
5
|
+
import { a as coerceNumberProperty, c as coerceElement } from './element-705567fe.mjs';
|
|
6
|
+
|
|
7
|
+
// Angular may add, remove, or edit comment nodes during change detection. We don't care about
|
|
8
|
+
// these changes because they don't affect the user-preceived content, and worse it can cause
|
|
9
|
+
// infinite change detection cycles where the change detection updates a comment, triggering the
|
|
10
|
+
// MutationObserver, triggering another change detection and kicking the cycle off again.
|
|
11
|
+
function shouldIgnoreRecord(record) {
|
|
12
|
+
// Ignore changes to comment text.
|
|
13
|
+
if (record.type === 'characterData' && record.target instanceof Comment) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
// Ignore addition / removal of comments.
|
|
17
|
+
if (record.type === 'childList') {
|
|
18
|
+
for (let i = 0; i < record.addedNodes.length; i++) {
|
|
19
|
+
if (!(record.addedNodes[i] instanceof Comment)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
for (let i = 0; i < record.removedNodes.length; i++) {
|
|
24
|
+
if (!(record.removedNodes[i] instanceof Comment)) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
// Observe everything else.
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Factory that creates a new MutationObserver and allows us to stub it out in unit tests.
|
|
35
|
+
* @docs-private
|
|
36
|
+
*/
|
|
37
|
+
class MutationObserverFactory {
|
|
38
|
+
create(callback) {
|
|
39
|
+
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
|
|
40
|
+
}
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
42
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' });
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: MutationObserverFactory, decorators: [{
|
|
45
|
+
type: Injectable,
|
|
46
|
+
args: [{ providedIn: 'root' }]
|
|
47
|
+
}] });
|
|
48
|
+
/** An injectable service that allows watching elements for changes to their content. */
|
|
49
|
+
class ContentObserver {
|
|
50
|
+
_mutationObserverFactory = inject(MutationObserverFactory);
|
|
51
|
+
/** Keeps track of the existing MutationObservers so they can be reused. */
|
|
52
|
+
_observedElements = new Map();
|
|
53
|
+
_ngZone = inject(NgZone);
|
|
54
|
+
constructor() { }
|
|
55
|
+
ngOnDestroy() {
|
|
56
|
+
this._observedElements.forEach((_, element) => this._cleanupObserver(element));
|
|
57
|
+
}
|
|
58
|
+
observe(elementOrRef) {
|
|
59
|
+
const element = coerceElement(elementOrRef);
|
|
60
|
+
return new Observable((observer) => {
|
|
61
|
+
const stream = this._observeElement(element);
|
|
62
|
+
const subscription = stream
|
|
63
|
+
.pipe(map(records => records.filter(record => !shouldIgnoreRecord(record))), filter(records => !!records.length))
|
|
64
|
+
.subscribe(records => {
|
|
65
|
+
this._ngZone.run(() => {
|
|
66
|
+
observer.next(records);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
return () => {
|
|
70
|
+
subscription.unsubscribe();
|
|
71
|
+
this._unobserveElement(element);
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Observes the given element by using the existing MutationObserver if available, or creating a
|
|
77
|
+
* new one if not.
|
|
78
|
+
*/
|
|
79
|
+
_observeElement(element) {
|
|
80
|
+
return this._ngZone.runOutsideAngular(() => {
|
|
81
|
+
if (!this._observedElements.has(element)) {
|
|
82
|
+
const stream = new Subject();
|
|
83
|
+
const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations));
|
|
84
|
+
if (observer) {
|
|
85
|
+
observer.observe(element, {
|
|
86
|
+
characterData: true,
|
|
87
|
+
childList: true,
|
|
88
|
+
subtree: true,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
this._observedElements.set(element, { observer, stream, count: 1 });
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this._observedElements.get(element).count++;
|
|
95
|
+
}
|
|
96
|
+
return this._observedElements.get(element).stream;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Un-observes the given element and cleans up the underlying MutationObserver if nobody else is
|
|
101
|
+
* observing this element.
|
|
102
|
+
*/
|
|
103
|
+
_unobserveElement(element) {
|
|
104
|
+
if (this._observedElements.has(element)) {
|
|
105
|
+
this._observedElements.get(element).count--;
|
|
106
|
+
if (!this._observedElements.get(element).count) {
|
|
107
|
+
this._cleanupObserver(element);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/** Clean up the underlying MutationObserver for the specified element. */
|
|
112
|
+
_cleanupObserver(element) {
|
|
113
|
+
if (this._observedElements.has(element)) {
|
|
114
|
+
const { observer, stream } = this._observedElements.get(element);
|
|
115
|
+
if (observer) {
|
|
116
|
+
observer.disconnect();
|
|
117
|
+
}
|
|
118
|
+
stream.complete();
|
|
119
|
+
this._observedElements.delete(element);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: ContentObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
123
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: ContentObserver, providedIn: 'root' });
|
|
124
|
+
}
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: ContentObserver, decorators: [{
|
|
126
|
+
type: Injectable,
|
|
127
|
+
args: [{ providedIn: 'root' }]
|
|
128
|
+
}], ctorParameters: () => [] });
|
|
129
|
+
/**
|
|
130
|
+
* Directive that triggers a callback whenever the content of
|
|
131
|
+
* its associated element has changed.
|
|
132
|
+
*/
|
|
133
|
+
class CdkObserveContent {
|
|
134
|
+
_contentObserver = inject(ContentObserver);
|
|
135
|
+
_elementRef = inject(ElementRef);
|
|
136
|
+
/** Event emitted for each change in the element's content. */
|
|
137
|
+
event = new EventEmitter();
|
|
138
|
+
/**
|
|
139
|
+
* Whether observing content is disabled. This option can be used
|
|
140
|
+
* to disconnect the underlying MutationObserver until it is needed.
|
|
141
|
+
*/
|
|
142
|
+
get disabled() {
|
|
143
|
+
return this._disabled;
|
|
144
|
+
}
|
|
145
|
+
set disabled(value) {
|
|
146
|
+
this._disabled = value;
|
|
147
|
+
this._disabled ? this._unsubscribe() : this._subscribe();
|
|
148
|
+
}
|
|
149
|
+
_disabled = false;
|
|
150
|
+
/** Debounce interval for emitting the changes. */
|
|
151
|
+
get debounce() {
|
|
152
|
+
return this._debounce;
|
|
153
|
+
}
|
|
154
|
+
set debounce(value) {
|
|
155
|
+
this._debounce = coerceNumberProperty(value);
|
|
156
|
+
this._subscribe();
|
|
157
|
+
}
|
|
158
|
+
_debounce;
|
|
159
|
+
_currentSubscription = null;
|
|
160
|
+
constructor() { }
|
|
161
|
+
ngAfterContentInit() {
|
|
162
|
+
if (!this._currentSubscription && !this.disabled) {
|
|
163
|
+
this._subscribe();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
ngOnDestroy() {
|
|
167
|
+
this._unsubscribe();
|
|
168
|
+
}
|
|
169
|
+
_subscribe() {
|
|
170
|
+
this._unsubscribe();
|
|
171
|
+
const stream = this._contentObserver.observe(this._elementRef);
|
|
172
|
+
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);
|
|
173
|
+
}
|
|
174
|
+
_unsubscribe() {
|
|
175
|
+
this._currentSubscription?.unsubscribe();
|
|
176
|
+
}
|
|
177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkObserveContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
178
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.0.0-next.1", type: CdkObserveContent, isStandalone: true, selector: "[cdkObserveContent]", inputs: { disabled: ["cdkObserveContentDisabled", "disabled", booleanAttribute], debounce: "debounce" }, outputs: { event: "cdkObserveContent" }, exportAs: ["cdkObserveContent"], ngImport: i0 });
|
|
179
|
+
}
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: CdkObserveContent, decorators: [{
|
|
181
|
+
type: Directive,
|
|
182
|
+
args: [{
|
|
183
|
+
selector: '[cdkObserveContent]',
|
|
184
|
+
exportAs: 'cdkObserveContent',
|
|
185
|
+
}]
|
|
186
|
+
}], ctorParameters: () => [], propDecorators: { event: [{
|
|
187
|
+
type: Output,
|
|
188
|
+
args: ['cdkObserveContent']
|
|
189
|
+
}], disabled: [{
|
|
190
|
+
type: Input,
|
|
191
|
+
args: [{ alias: 'cdkObserveContentDisabled', transform: booleanAttribute }]
|
|
192
|
+
}], debounce: [{
|
|
193
|
+
type: Input
|
|
194
|
+
}] } });
|
|
195
|
+
class ObserversModule {
|
|
196
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: ObserversModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
197
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.1", ngImport: i0, type: ObserversModule, imports: [CdkObserveContent], exports: [CdkObserveContent] });
|
|
198
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: ObserversModule, providers: [MutationObserverFactory] });
|
|
199
|
+
}
|
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: ObserversModule, decorators: [{
|
|
201
|
+
type: NgModule,
|
|
202
|
+
args: [{
|
|
203
|
+
imports: [CdkObserveContent],
|
|
204
|
+
exports: [CdkObserveContent],
|
|
205
|
+
providers: [MutationObserverFactory],
|
|
206
|
+
}]
|
|
207
|
+
}] });
|
|
208
|
+
|
|
209
|
+
export { ContentObserver as C, MutationObserverFactory as M, ObserversModule as O, CdkObserveContent as a };
|
|
210
|
+
//# sourceMappingURL=observe-content-d2a6b5a0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observe-content-d2a6b5a0.mjs","sources":["../../../../../../src/cdk/observers/observe-content.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NumberInput, coerceElement, coerceNumberProperty} from '../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 inject,\n} from '@angular/core';\nimport {Observable, Observer, Subject, Subscription} from 'rxjs';\nimport {debounceTime, filter, map} from 'rxjs/operators';\n\n// Angular may add, remove, or edit comment nodes during change detection. We don't care about\n// these changes because they don't affect the user-preceived content, and worse it can cause\n// infinite change detection cycles where the change detection updates a comment, triggering the\n// MutationObserver, triggering another change detection and kicking the cycle off again.\nfunction shouldIgnoreRecord(record: MutationRecord) {\n // Ignore changes to comment text.\n if (record.type === 'characterData' && record.target instanceof Comment) {\n return true;\n }\n // Ignore addition / removal of comments.\n if (record.type === 'childList') {\n for (let i = 0; i < record.addedNodes.length; i++) {\n if (!(record.addedNodes[i] instanceof Comment)) {\n return false;\n }\n }\n for (let i = 0; i < record.removedNodes.length; i++) {\n if (!(record.removedNodes[i] instanceof Comment)) {\n return false;\n }\n }\n return true;\n }\n // Observe everything else.\n return false;\n}\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 private _mutationObserverFactory = inject(MutationObserverFactory);\n\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 private _ngZone = inject(NgZone);\n\n constructor(...args: unknown[]);\n constructor() {}\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\n .pipe(\n map(records => records.filter(record => !shouldIgnoreRecord(record))),\n filter(records => !!records.length),\n )\n .subscribe(records => {\n this._ngZone.run(() => {\n observer.next(records);\n });\n });\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 return this._ngZone.runOutsideAngular(() => {\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 /**\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 private _contentObserver = inject(ContentObserver);\n private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\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(...args: unknown[]);\n constructor() {}\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 this._currentSubscription = (\n this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream\n ).subscribe(this.event);\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"],"names":[],"mappings":";;;;;;AA0BA;AACA;AACA;AACA;AACA,SAAS,kBAAkB,CAAC,MAAsB,EAAA;;A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rC,iBAAA,CAAA;;;;;"}
|
|
@@ -110,19 +110,15 @@ class SharedResizeObserver {
|
|
|
110
110
|
}
|
|
111
111
|
return this._observers.get(box).observe(target);
|
|
112
112
|
}
|
|
113
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
114
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
113
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: SharedResizeObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
114
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: SharedResizeObserver, providedIn: 'root' });
|
|
115
115
|
}
|
|
116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.1", ngImport: i0, type: SharedResizeObserver, decorators: [{
|
|
117
117
|
type: Injectable,
|
|
118
118
|
args: [{
|
|
119
119
|
providedIn: 'root',
|
|
120
120
|
}]
|
|
121
121
|
}], ctorParameters: () => [] });
|
|
122
122
|
|
|
123
|
-
/**
|
|
124
|
-
* Generated bundle index. Do not edit.
|
|
125
|
-
*/
|
|
126
|
-
|
|
127
123
|
export { SharedResizeObserver };
|
|
128
124
|
//# sourceMappingURL=private.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private.mjs","sources":["../../../../../../../src/cdk/observers/private/shared-resize-observer.ts"
|
|
1
|
+
{"version":3,"file":"private.mjs","sources":["../../../../../../../src/cdk/observers/private/shared-resize-observer.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.dev/license\n */\nimport {inject, Injectable, NgZone, OnDestroy, RendererFactory2} 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 ErrorEvent && 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 private _cleanupErrorListener: (() => void) | undefined;\n\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 const renderer = inject(RendererFactory2).createRenderer(null, null);\n this._cleanupErrorListener = renderer.listen(\n 'window',\n 'error',\n loopLimitExceededErrorHandler,\n );\n });\n }\n }\n\n ngOnDestroy() {\n for (const [, observer] of this._observers) {\n observer.destroy();\n }\n this._observers.clear();\n this._cleanupErrorListener?.();\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"],"names":[],"mappings":";;;;;AAWA;;;;AAIG;AACH,MAAM,6BAA6B,GAAG,CAAC,CAAU,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@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
// Angular may add, remove, or edit comment nodes during change detection. We don't care about
|
|
8
|
-
// these changes because they don't affect the user-preceived content, and worse it can cause
|
|
9
|
-
// infinite change detection cycles where the change detection updates a comment, triggering the
|
|
10
|
-
// MutationObserver, triggering another change detection and kicking the cycle off again.
|
|
11
|
-
function shouldIgnoreRecord(record) {
|
|
12
|
-
// Ignore changes to comment text.
|
|
13
|
-
if (record.type === 'characterData' && record.target instanceof Comment) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
// Ignore addition / removal of comments.
|
|
17
|
-
if (record.type === 'childList') {
|
|
18
|
-
for (let i = 0; i < record.addedNodes.length; i++) {
|
|
19
|
-
if (!(record.addedNodes[i] instanceof Comment)) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
for (let i = 0; i < record.removedNodes.length; i++) {
|
|
24
|
-
if (!(record.removedNodes[i] instanceof Comment)) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
// Observe everything else.
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Factory that creates a new MutationObserver and allows us to stub it out in unit tests.
|
|
35
|
-
* @docs-private
|
|
36
|
-
*/
|
|
37
|
-
class MutationObserverFactory {
|
|
38
|
-
create(callback) {
|
|
39
|
-
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
|
|
40
|
-
}
|
|
41
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MutationObserverFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
42
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MutationObserverFactory, providedIn: 'root' });
|
|
43
|
-
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MutationObserverFactory, decorators: [{
|
|
45
|
-
type: Injectable,
|
|
46
|
-
args: [{ providedIn: 'root' }]
|
|
47
|
-
}] });
|
|
48
|
-
/** An injectable service that allows watching elements for changes to their content. */
|
|
49
|
-
class ContentObserver {
|
|
50
|
-
_mutationObserverFactory = inject(MutationObserverFactory);
|
|
51
|
-
/** Keeps track of the existing MutationObservers so they can be reused. */
|
|
52
|
-
_observedElements = new Map();
|
|
53
|
-
_ngZone = inject(NgZone);
|
|
54
|
-
constructor() { }
|
|
55
|
-
ngOnDestroy() {
|
|
56
|
-
this._observedElements.forEach((_, element) => this._cleanupObserver(element));
|
|
57
|
-
}
|
|
58
|
-
observe(elementOrRef) {
|
|
59
|
-
const element = coerceElement(elementOrRef);
|
|
60
|
-
return new Observable((observer) => {
|
|
61
|
-
const stream = this._observeElement(element);
|
|
62
|
-
const subscription = stream
|
|
63
|
-
.pipe(map(records => records.filter(record => !shouldIgnoreRecord(record))), filter(records => !!records.length))
|
|
64
|
-
.subscribe(records => {
|
|
65
|
-
this._ngZone.run(() => {
|
|
66
|
-
observer.next(records);
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
return () => {
|
|
70
|
-
subscription.unsubscribe();
|
|
71
|
-
this._unobserveElement(element);
|
|
72
|
-
};
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Observes the given element by using the existing MutationObserver if available, or creating a
|
|
77
|
-
* new one if not.
|
|
78
|
-
*/
|
|
79
|
-
_observeElement(element) {
|
|
80
|
-
return this._ngZone.runOutsideAngular(() => {
|
|
81
|
-
if (!this._observedElements.has(element)) {
|
|
82
|
-
const stream = new Subject();
|
|
83
|
-
const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations));
|
|
84
|
-
if (observer) {
|
|
85
|
-
observer.observe(element, {
|
|
86
|
-
characterData: true,
|
|
87
|
-
childList: true,
|
|
88
|
-
subtree: true,
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
this._observedElements.set(element, { observer, stream, count: 1 });
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
this._observedElements.get(element).count++;
|
|
95
|
-
}
|
|
96
|
-
return this._observedElements.get(element).stream;
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Un-observes the given element and cleans up the underlying MutationObserver if nobody else is
|
|
101
|
-
* observing this element.
|
|
102
|
-
*/
|
|
103
|
-
_unobserveElement(element) {
|
|
104
|
-
if (this._observedElements.has(element)) {
|
|
105
|
-
this._observedElements.get(element).count--;
|
|
106
|
-
if (!this._observedElements.get(element).count) {
|
|
107
|
-
this._cleanupObserver(element);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/** Clean up the underlying MutationObserver for the specified element. */
|
|
112
|
-
_cleanupObserver(element) {
|
|
113
|
-
if (this._observedElements.has(element)) {
|
|
114
|
-
const { observer, stream } = this._observedElements.get(element);
|
|
115
|
-
if (observer) {
|
|
116
|
-
observer.disconnect();
|
|
117
|
-
}
|
|
118
|
-
stream.complete();
|
|
119
|
-
this._observedElements.delete(element);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ContentObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
123
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ContentObserver, providedIn: 'root' });
|
|
124
|
-
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ContentObserver, decorators: [{
|
|
126
|
-
type: Injectable,
|
|
127
|
-
args: [{ providedIn: 'root' }]
|
|
128
|
-
}], ctorParameters: () => [] });
|
|
129
|
-
/**
|
|
130
|
-
* Directive that triggers a callback whenever the content of
|
|
131
|
-
* its associated element has changed.
|
|
132
|
-
*/
|
|
133
|
-
class CdkObserveContent {
|
|
134
|
-
_contentObserver = inject(ContentObserver);
|
|
135
|
-
_elementRef = inject(ElementRef);
|
|
136
|
-
/** Event emitted for each change in the element's content. */
|
|
137
|
-
event = new EventEmitter();
|
|
138
|
-
/**
|
|
139
|
-
* Whether observing content is disabled. This option can be used
|
|
140
|
-
* to disconnect the underlying MutationObserver until it is needed.
|
|
141
|
-
*/
|
|
142
|
-
get disabled() {
|
|
143
|
-
return this._disabled;
|
|
144
|
-
}
|
|
145
|
-
set disabled(value) {
|
|
146
|
-
this._disabled = value;
|
|
147
|
-
this._disabled ? this._unsubscribe() : this._subscribe();
|
|
148
|
-
}
|
|
149
|
-
_disabled = false;
|
|
150
|
-
/** Debounce interval for emitting the changes. */
|
|
151
|
-
get debounce() {
|
|
152
|
-
return this._debounce;
|
|
153
|
-
}
|
|
154
|
-
set debounce(value) {
|
|
155
|
-
this._debounce = coerceNumberProperty(value);
|
|
156
|
-
this._subscribe();
|
|
157
|
-
}
|
|
158
|
-
_debounce;
|
|
159
|
-
_currentSubscription = null;
|
|
160
|
-
constructor() { }
|
|
161
|
-
ngAfterContentInit() {
|
|
162
|
-
if (!this._currentSubscription && !this.disabled) {
|
|
163
|
-
this._subscribe();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
ngOnDestroy() {
|
|
167
|
-
this._unsubscribe();
|
|
168
|
-
}
|
|
169
|
-
_subscribe() {
|
|
170
|
-
this._unsubscribe();
|
|
171
|
-
const stream = this._contentObserver.observe(this._elementRef);
|
|
172
|
-
this._currentSubscription = (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);
|
|
173
|
-
}
|
|
174
|
-
_unsubscribe() {
|
|
175
|
-
this._currentSubscription?.unsubscribe();
|
|
176
|
-
}
|
|
177
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CdkObserveContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
178
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.0", type: CdkObserveContent, isStandalone: true, selector: "[cdkObserveContent]", inputs: { disabled: ["cdkObserveContentDisabled", "disabled", booleanAttribute], debounce: "debounce" }, outputs: { event: "cdkObserveContent" }, exportAs: ["cdkObserveContent"], ngImport: i0 });
|
|
179
|
-
}
|
|
180
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: CdkObserveContent, decorators: [{
|
|
181
|
-
type: Directive,
|
|
182
|
-
args: [{
|
|
183
|
-
selector: '[cdkObserveContent]',
|
|
184
|
-
exportAs: 'cdkObserveContent',
|
|
185
|
-
}]
|
|
186
|
-
}], ctorParameters: () => [], propDecorators: { event: [{
|
|
187
|
-
type: Output,
|
|
188
|
-
args: ['cdkObserveContent']
|
|
189
|
-
}], disabled: [{
|
|
190
|
-
type: Input,
|
|
191
|
-
args: [{ alias: 'cdkObserveContentDisabled', transform: booleanAttribute }]
|
|
192
|
-
}], debounce: [{
|
|
193
|
-
type: Input
|
|
194
|
-
}] } });
|
|
195
|
-
class ObserversModule {
|
|
196
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ObserversModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
197
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.0", ngImport: i0, type: ObserversModule, imports: [CdkObserveContent], exports: [CdkObserveContent] });
|
|
198
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ObserversModule, providers: [MutationObserverFactory] });
|
|
199
|
-
}
|
|
200
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ObserversModule, decorators: [{
|
|
201
|
-
type: NgModule,
|
|
202
|
-
args: [{
|
|
203
|
-
imports: [CdkObserveContent],
|
|
204
|
-
exports: [CdkObserveContent],
|
|
205
|
-
providers: [MutationObserverFactory],
|
|
206
|
-
}]
|
|
207
|
-
}] });
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Generated bundle index. Do not edit.
|
|
211
|
-
*/
|
|
212
|
-
|
|
213
|
-
export { CdkObserveContent, ContentObserver, MutationObserverFactory, ObserversModule };
|
|
1
|
+
export { a as CdkObserveContent, C as ContentObserver, M as MutationObserverFactory, O as ObserversModule } from './observe-content-d2a6b5a0.mjs';
|
|
2
|
+
import '@angular/core';
|
|
3
|
+
import 'rxjs';
|
|
4
|
+
import 'rxjs/operators';
|
|
5
|
+
import './element-705567fe.mjs';
|
|
214
6
|
//# sourceMappingURL=observers.mjs.map
|
|
@@ -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.dev/license\n */\n\nimport {NumberInput, coerceElement, coerceNumberProperty} from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n Output,\n booleanAttribute,\n inject,\n} from '@angular/core';\nimport {Observable, Observer, Subject, Subscription} from 'rxjs';\nimport {debounceTime, filter, map} from 'rxjs/operators';\n\n// Angular may add, remove, or edit comment nodes during change detection. We don't care about\n// these changes because they don't affect the user-preceived content, and worse it can cause\n// infinite change detection cycles where the change detection updates a comment, triggering the\n// MutationObserver, triggering another change detection and kicking the cycle off again.\nfunction shouldIgnoreRecord(record: MutationRecord) {\n // Ignore changes to comment text.\n if (record.type === 'characterData' && record.target instanceof Comment) {\n return true;\n }\n // Ignore addition / removal of comments.\n if (record.type === 'childList') {\n for (let i = 0; i < record.addedNodes.length; i++) {\n if (!(record.addedNodes[i] instanceof Comment)) {\n return false;\n }\n }\n for (let i = 0; i < record.removedNodes.length; i++) {\n if (!(record.removedNodes[i] instanceof Comment)) {\n return false;\n }\n }\n return true;\n }\n // Observe everything else.\n return false;\n}\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 private _mutationObserverFactory = inject(MutationObserverFactory);\n\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 private _ngZone = inject(NgZone);\n\n constructor(...args: unknown[]);\n constructor() {}\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\n .pipe(\n map(records => records.filter(record => !shouldIgnoreRecord(record))),\n filter(records => !!records.length),\n )\n .subscribe(records => {\n this._ngZone.run(() => {\n observer.next(records);\n });\n });\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 return this._ngZone.runOutsideAngular(() => {\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 /**\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 private _contentObserver = inject(ContentObserver);\n private _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\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(...args: unknown[]);\n constructor() {}\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 this._currentSubscription = (\n this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream\n ).subscribe(this.event);\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":";;;;;;AA0BA;AACA;AACA;AACA;AACA,SAAS,kBAAkB,CAAC,MAAsB,EAAA;;AAEhD,IAAA,IAAI,MAAM,CAAC,IAAI,KAAK,eAAe,IAAI,MAAM,CAAC,MAAM,YAAY,OAAO,EAAE;AACvE,QAAA,OAAO,IAAI,CAAC;KACb;;AAED,IAAA,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE;AAC/B,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACjD,YAAA,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,OAAO,CAAC,EAAE;AAC9C,gBAAA,OAAO,KAAK,CAAC;aACd;SACF;AACD,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACnD,YAAA,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,OAAO,CAAC,EAAE;AACh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