@angular/cdk 21.0.0-next.9 → 21.0.0-rc.0
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/_adev_assets/cdk_drag_drop.json +13 -12
- package/_adev_assets/cdk_testing.json +9 -9
- package/_adev_assets/cdk_testing_protractor.json +1 -1
- package/_adev_assets/cdk_testing_selenium_webdriver.json +1 -1
- package/_adev_assets/cdk_testing_testbed.json +1 -1
- package/fesm2022/_a11y-module-chunk.mjs +755 -869
- package/fesm2022/_a11y-module-chunk.mjs.map +1 -1
- package/fesm2022/_activedescendant-key-manager-chunk.mjs +8 -8
- package/fesm2022/_activedescendant-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_array-chunk.mjs +1 -1
- package/fesm2022/_array-chunk.mjs.map +1 -1
- package/fesm2022/_breakpoints-observer-chunk.mjs +149 -152
- package/fesm2022/_breakpoints-observer-chunk.mjs.map +1 -1
- package/fesm2022/_css-pixel-value-chunk.mjs +4 -5
- package/fesm2022/_css-pixel-value-chunk.mjs.map +1 -1
- package/fesm2022/_data-source-chunk.mjs +2 -8
- package/fesm2022/_data-source-chunk.mjs.map +1 -1
- package/fesm2022/_directionality-chunk.mjs +54 -54
- package/fesm2022/_directionality-chunk.mjs.map +1 -1
- package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs +25 -36
- package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs.map +1 -1
- package/fesm2022/_element-chunk.mjs +6 -17
- package/fesm2022/_element-chunk.mjs.map +1 -1
- package/fesm2022/_fake-event-detection-chunk.mjs +3 -17
- package/fesm2022/_fake-event-detection-chunk.mjs.map +1 -1
- package/fesm2022/_focus-key-manager-chunk.mjs +10 -14
- package/fesm2022/_focus-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_focus-monitor-chunk.mjs +376 -566
- package/fesm2022/_focus-monitor-chunk.mjs.map +1 -1
- package/fesm2022/_id-generator-chunk.mjs +36 -27
- package/fesm2022/_id-generator-chunk.mjs.map +1 -1
- package/fesm2022/_keycodes-chunk.mjs +9 -9
- package/fesm2022/_keycodes-chunk.mjs.map +1 -1
- package/fesm2022/_list-key-manager-chunk.mjs +248 -336
- package/fesm2022/_list-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_overlay-module-chunk.mjs +2534 -2948
- package/fesm2022/_overlay-module-chunk.mjs.map +1 -1
- package/fesm2022/_passive-listeners-chunk.mjs +10 -22
- package/fesm2022/_passive-listeners-chunk.mjs.map +1 -1
- package/fesm2022/_platform-chunk.mjs +42 -65
- package/fesm2022/_platform-chunk.mjs.map +1 -1
- package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs +78 -134
- package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs.map +1 -1
- package/fesm2022/_scrolling-chunk.mjs +44 -85
- package/fesm2022/_scrolling-chunk.mjs.map +1 -1
- package/fesm2022/_selection-model-chunk.mjs +138 -209
- package/fesm2022/_selection-model-chunk.mjs.map +1 -1
- package/fesm2022/_shadow-dom-chunk.mjs +21 -35
- package/fesm2022/_shadow-dom-chunk.mjs.map +1 -1
- package/fesm2022/_style-loader-chunk.mjs +50 -37
- package/fesm2022/_style-loader-chunk.mjs.map +1 -1
- package/fesm2022/_test-environment-chunk.mjs +2 -14
- package/fesm2022/_test-environment-chunk.mjs.map +1 -1
- package/fesm2022/_tree-key-manager-chunk.mjs +229 -308
- package/fesm2022/_tree-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_typeahead-chunk.mjs +52 -74
- package/fesm2022/_typeahead-chunk.mjs.map +1 -1
- package/fesm2022/_unique-selection-dispatcher-chunk.mjs +43 -40
- package/fesm2022/_unique-selection-dispatcher-chunk.mjs.map +1 -1
- package/fesm2022/a11y.mjs +351 -449
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs +254 -192
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/bidi.mjs +121 -64
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -2
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +208 -186
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/coercion-private.mjs +4 -8
- package/fesm2022/coercion-private.mjs.map +1 -1
- package/fesm2022/coercion.mjs +11 -29
- package/fesm2022/coercion.mjs.map +1 -1
- package/fesm2022/dialog.mjs +660 -808
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +3347 -4286
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/keycodes.mjs +4 -8
- package/fesm2022/keycodes.mjs.map +1 -1
- package/fesm2022/layout.mjs +44 -26
- package/fesm2022/layout.mjs.map +1 -1
- package/fesm2022/listbox.mjs +841 -895
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +1942 -1858
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/observers-private.mjs +88 -106
- package/fesm2022/observers-private.mjs.map +1 -1
- package/fesm2022/observers.mjs +262 -184
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/overlay.mjs +72 -68
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/platform.mjs +43 -54
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/portal.mjs +402 -560
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/private.mjs +38 -10
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +1323 -1400
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/stepper.mjs +758 -590
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +2327 -2319
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/testing-selenium-webdriver.mjs +252 -325
- package/fesm2022/testing-selenium-webdriver.mjs.map +1 -1
- package/fesm2022/testing-testbed.mjs +592 -709
- package/fesm2022/testing-testbed.mjs.map +1 -1
- package/fesm2022/testing.mjs +368 -889
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/text-field.mjs +459 -388
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/tree.mjs +1483 -1731
- package/fesm2022/tree.mjs.map +1 -1
- package/overlay/_index.scss +28 -0
- package/overlay-prebuilt.css +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/types/_overlay-module-chunk.d.ts +59 -7
- package/types/_portal-directives-chunk.d.ts +2 -18
- package/types/accordion.d.ts +3 -1
- package/types/dialog.d.ts +1 -1
- package/types/overlay.d.ts +6 -2
- package/types/portal.d.ts +1 -1
|
@@ -5,174 +5,171 @@ import { take, skip, debounceTime, map, startWith, takeUntil } from 'rxjs/operat
|
|
|
5
5
|
import { Platform } from './_platform-chunk.mjs';
|
|
6
6
|
import { coerceArray } from './_array-chunk.mjs';
|
|
7
7
|
|
|
8
|
-
/** Global registry for all dynamically-created, injected media queries. */
|
|
9
8
|
const mediaQueriesForWebkitCompatibility = new Set();
|
|
10
|
-
/** Style tag that holds all of the dynamically-created media queries. */
|
|
11
9
|
let mediaQueryStyleNode;
|
|
12
|
-
/** A utility for calling matchMedia queries. */
|
|
13
10
|
class MediaMatcher {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
_platform = inject(Platform);
|
|
12
|
+
_nonce = inject(CSP_NONCE, {
|
|
13
|
+
optional: true
|
|
14
|
+
});
|
|
15
|
+
_matchMedia;
|
|
16
|
+
constructor() {
|
|
17
|
+
this._matchMedia = this._platform.isBrowser && window.matchMedia ? window.matchMedia.bind(window) : noopMatchMedia;
|
|
18
|
+
}
|
|
19
|
+
matchMedia(query) {
|
|
20
|
+
if (this._platform.WEBKIT || this._platform.BLINK) {
|
|
21
|
+
createEmptyStyleRule(query, this._nonce);
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
return this._matchMedia(query);
|
|
24
|
+
}
|
|
25
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
26
|
+
minVersion: "12.0.0",
|
|
27
|
+
version: "20.2.0-next.2",
|
|
28
|
+
ngImport: i0,
|
|
29
|
+
type: MediaMatcher,
|
|
30
|
+
deps: [],
|
|
31
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
32
|
+
});
|
|
33
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
34
|
+
minVersion: "12.0.0",
|
|
35
|
+
version: "20.2.0-next.2",
|
|
36
|
+
ngImport: i0,
|
|
37
|
+
type: MediaMatcher,
|
|
38
|
+
providedIn: 'root'
|
|
39
|
+
});
|
|
40
40
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
42
|
+
minVersion: "12.0.0",
|
|
43
|
+
version: "20.2.0-next.2",
|
|
44
|
+
ngImport: i0,
|
|
45
|
+
type: MediaMatcher,
|
|
46
|
+
decorators: [{
|
|
47
|
+
type: Injectable,
|
|
48
|
+
args: [{
|
|
49
|
+
providedIn: 'root'
|
|
50
|
+
}]
|
|
51
|
+
}],
|
|
52
|
+
ctorParameters: () => []
|
|
53
|
+
});
|
|
54
54
|
function createEmptyStyleRule(query, nonce) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
if (mediaQueryStyleNode.sheet) {
|
|
68
|
-
mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);
|
|
69
|
-
mediaQueriesForWebkitCompatibility.add(query);
|
|
70
|
-
}
|
|
55
|
+
if (mediaQueriesForWebkitCompatibility.has(query)) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
if (!mediaQueryStyleNode) {
|
|
60
|
+
mediaQueryStyleNode = document.createElement('style');
|
|
61
|
+
if (nonce) {
|
|
62
|
+
mediaQueryStyleNode.setAttribute('nonce', nonce);
|
|
63
|
+
}
|
|
64
|
+
mediaQueryStyleNode.setAttribute('type', 'text/css');
|
|
65
|
+
document.head.appendChild(mediaQueryStyleNode);
|
|
71
66
|
}
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
if (mediaQueryStyleNode.sheet) {
|
|
68
|
+
mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);
|
|
69
|
+
mediaQueriesForWebkitCompatibility.add(query);
|
|
74
70
|
}
|
|
71
|
+
} catch (e) {
|
|
72
|
+
console.error(e);
|
|
73
|
+
}
|
|
75
74
|
}
|
|
76
|
-
/** No-op matchMedia replacement for non-browser platforms. */
|
|
77
75
|
function noopMatchMedia(query) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
removeListener: () => { },
|
|
85
|
-
};
|
|
76
|
+
return {
|
|
77
|
+
matches: query === 'all' || query === '',
|
|
78
|
+
media: query,
|
|
79
|
+
addListener: () => {},
|
|
80
|
+
removeListener: () => {}
|
|
81
|
+
};
|
|
86
82
|
}
|
|
87
83
|
|
|
88
|
-
/** Utility for checking the matching state of `@media` queries. */
|
|
89
84
|
class BreakpointObserver {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
85
|
+
_mediaMatcher = inject(MediaMatcher);
|
|
86
|
+
_zone = inject(NgZone);
|
|
87
|
+
_queries = new Map();
|
|
88
|
+
_destroySubject = new Subject();
|
|
89
|
+
constructor() {}
|
|
90
|
+
ngOnDestroy() {
|
|
91
|
+
this._destroySubject.next();
|
|
92
|
+
this._destroySubject.complete();
|
|
93
|
+
}
|
|
94
|
+
isMatched(value) {
|
|
95
|
+
const queries = splitQueries(coerceArray(value));
|
|
96
|
+
return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches);
|
|
97
|
+
}
|
|
98
|
+
observe(value) {
|
|
99
|
+
const queries = splitQueries(coerceArray(value));
|
|
100
|
+
const observables = queries.map(query => this._registerQuery(query).observable);
|
|
101
|
+
let stateObservable = combineLatest(observables);
|
|
102
|
+
stateObservable = concat(stateObservable.pipe(take(1)), stateObservable.pipe(skip(1), debounceTime(0)));
|
|
103
|
+
return stateObservable.pipe(map(breakpointStates => {
|
|
104
|
+
const response = {
|
|
105
|
+
matches: false,
|
|
106
|
+
breakpoints: {}
|
|
107
|
+
};
|
|
108
|
+
breakpointStates.forEach(({
|
|
109
|
+
matches,
|
|
110
|
+
query
|
|
111
|
+
}) => {
|
|
112
|
+
response.matches = response.matches || matches;
|
|
113
|
+
response.breakpoints[query] = matches;
|
|
114
|
+
});
|
|
115
|
+
return response;
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
_registerQuery(query) {
|
|
119
|
+
if (this._queries.has(query)) {
|
|
120
|
+
return this._queries.get(query);
|
|
110
121
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
// webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not
|
|
147
|
-
// have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js
|
|
148
|
-
// patches it.
|
|
149
|
-
const handler = (e) => this._zone.run(() => observer.next(e));
|
|
150
|
-
mql.addListener(handler);
|
|
151
|
-
return () => {
|
|
152
|
-
mql.removeListener(handler);
|
|
153
|
-
};
|
|
154
|
-
}).pipe(startWith(mql), map(({ matches }) => ({ query, matches })), takeUntil(this._destroySubject));
|
|
155
|
-
// Add the MediaQueryList to the set of queries.
|
|
156
|
-
const output = { observable: queryObservable, mql };
|
|
157
|
-
this._queries.set(query, output);
|
|
158
|
-
return output;
|
|
159
|
-
}
|
|
160
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: BreakpointObserver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
161
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: BreakpointObserver, providedIn: 'root' });
|
|
122
|
+
const mql = this._mediaMatcher.matchMedia(query);
|
|
123
|
+
const queryObservable = new Observable(observer => {
|
|
124
|
+
const handler = e => this._zone.run(() => observer.next(e));
|
|
125
|
+
mql.addListener(handler);
|
|
126
|
+
return () => {
|
|
127
|
+
mql.removeListener(handler);
|
|
128
|
+
};
|
|
129
|
+
}).pipe(startWith(mql), map(({
|
|
130
|
+
matches
|
|
131
|
+
}) => ({
|
|
132
|
+
query,
|
|
133
|
+
matches
|
|
134
|
+
})), takeUntil(this._destroySubject));
|
|
135
|
+
const output = {
|
|
136
|
+
observable: queryObservable,
|
|
137
|
+
mql
|
|
138
|
+
};
|
|
139
|
+
this._queries.set(query, output);
|
|
140
|
+
return output;
|
|
141
|
+
}
|
|
142
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
143
|
+
minVersion: "12.0.0",
|
|
144
|
+
version: "20.2.0-next.2",
|
|
145
|
+
ngImport: i0,
|
|
146
|
+
type: BreakpointObserver,
|
|
147
|
+
deps: [],
|
|
148
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
149
|
+
});
|
|
150
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
151
|
+
minVersion: "12.0.0",
|
|
152
|
+
version: "20.2.0-next.2",
|
|
153
|
+
ngImport: i0,
|
|
154
|
+
type: BreakpointObserver,
|
|
155
|
+
providedIn: 'root'
|
|
156
|
+
});
|
|
162
157
|
}
|
|
163
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
158
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
159
|
+
minVersion: "12.0.0",
|
|
160
|
+
version: "20.2.0-next.2",
|
|
161
|
+
ngImport: i0,
|
|
162
|
+
type: BreakpointObserver,
|
|
163
|
+
decorators: [{
|
|
164
|
+
type: Injectable,
|
|
165
|
+
args: [{
|
|
166
|
+
providedIn: 'root'
|
|
167
|
+
}]
|
|
168
|
+
}],
|
|
169
|
+
ctorParameters: () => []
|
|
170
|
+
});
|
|
171
171
|
function splitQueries(queries) {
|
|
172
|
-
|
|
173
|
-
.map(query => query.split(','))
|
|
174
|
-
.reduce((a1, a2) => a1.concat(a2))
|
|
175
|
-
.map(query => query.trim());
|
|
172
|
+
return queries.map(query => query.split(',')).reduce((a1, a2) => a1.concat(a2)).map(query => query.trim());
|
|
176
173
|
}
|
|
177
174
|
|
|
178
175
|
export { BreakpointObserver, MediaMatcher };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_breakpoints-observer-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk/layout/media-matcher.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk/layout/breakpoints-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 {Injectable, CSP_NONCE, inject} from '@angular/core';\nimport {Platform} from '../platform';\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\n@Injectable({providedIn: 'root'})\nexport class MediaMatcher {\n private _platform = inject(Platform);\n private _nonce = inject(CSP_NONCE, {optional: true});\n\n /** The internal matchMedia method to return back a MediaQueryList like object. */\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor(...args: unknown[]);\n\n constructor() {\n this._matchMedia =\n this._platform.isBrowser && window.matchMedia\n ? // matchMedia is bound to the window scope intentionally as it is an illegal invocation to\n // call it from a different scope.\n window.matchMedia.bind(window)\n : noopMatchMedia;\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this._platform.WEBKIT || this._platform.BLINK) {\n createEmptyStyleRule(query, this._nonce);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * Creates an empty stylesheet that is used to work around browser inconsistencies related to\n * `matchMedia`. At the time of writing, it handles the following cases:\n * 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia`\n * to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration.\n * 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules\n * inside the `@media` match existing elements on the page. We work around it by having one rule\n * targeting the `body`. See https://github.com/angular/components/issues/23546.\n */\nfunction createEmptyStyleRule(query: string, nonce: string | undefined | null) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n\n if (nonce) {\n mediaQueryStyleNode.setAttribute('nonce', nonce);\n }\n\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head!.appendChild(mediaQueryStyleNode);\n }\n\n if (mediaQueryStyleNode.sheet) {\n mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n console.error(e);\n }\n}\n\n/** No-op matchMedia replacement for non-browser platforms. */\nfunction noopMatchMedia(query: string): MediaQueryList {\n // Use `as any` here to avoid adding additional necessary properties for\n // the noop matcher.\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: () => {},\n removeListener: () => {},\n } as any;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {coerceArray} from '../coercion';\nimport {Injectable, NgZone, OnDestroy, inject} from '@angular/core';\nimport {combineLatest, concat, Observable, Observer, Subject} from 'rxjs';\nimport {debounceTime, map, skip, startWith, take, takeUntil} from 'rxjs/operators';\nimport {MediaMatcher} from './media-matcher';\n\n/** The current state of a layout breakpoint. */\nexport interface BreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /**\n * A key boolean pair for each query provided to the observe method,\n * with its current matched state.\n */\n breakpoints: {\n [key: string]: boolean;\n };\n}\n\n/** The current state of a layout breakpoint. */\ninterface InternalBreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /** The media query being to be matched */\n query: string;\n}\n\ninterface Query {\n observable: Observable<InternalBreakpointState>;\n mql: MediaQueryList;\n}\n\n/** Utility for checking the matching state of `@media` queries. */\n@Injectable({providedIn: 'root'})\nexport class BreakpointObserver implements OnDestroy {\n private _mediaMatcher = inject(MediaMatcher);\n private _zone = inject(NgZone);\n\n /** A map of all media queries currently being listened for. */\n private _queries = new Map<string, Query>();\n /** A subject for all other observables to takeUntil based on. */\n private readonly _destroySubject = new Subject<void>();\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /** Completes the active subject, signalling to all other observables to complete. */\n ngOnDestroy() {\n this._destroySubject.next();\n this._destroySubject.complete();\n }\n\n /**\n * Whether one or more media queries match the current viewport size.\n * @param value One or more media queries to check.\n * @returns Whether any of the media queries match.\n */\n isMatched(value: string | readonly string[]): boolean {\n const queries = splitQueries(coerceArray(value));\n return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches);\n }\n\n /**\n * Gets an observable of results for the given queries that will emit new results for any changes\n * in matching of the given queries.\n * @param value One or more media queries to check.\n * @returns A stream of matches for the given queries.\n */\n observe(value: string | readonly string[]): Observable<BreakpointState> {\n const queries = splitQueries(coerceArray(value));\n const observables = queries.map(query => this._registerQuery(query).observable);\n\n let stateObservable = combineLatest(observables);\n // Emit the first state immediately, and then debounce the subsequent emissions.\n stateObservable = concat(\n stateObservable.pipe(take(1)),\n stateObservable.pipe(skip(1), debounceTime(0)),\n );\n return stateObservable.pipe(\n map(breakpointStates => {\n const response: BreakpointState = {\n matches: false,\n breakpoints: {},\n };\n breakpointStates.forEach(({matches, query}) => {\n response.matches = response.matches || matches;\n response.breakpoints[query] = matches;\n });\n return response;\n }),\n );\n }\n\n /** Registers a specific query to be listened for. */\n private _registerQuery(query: string): Query {\n // Only set up a new MediaQueryList if it is not already being listened for.\n if (this._queries.has(query)) {\n return this._queries.get(query)!;\n }\n\n const mql = this._mediaMatcher.matchMedia(query);\n\n // Create callback for match changes and add it is as a listener.\n const queryObservable = new Observable((observer: Observer<MediaQueryListEvent>) => {\n // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed\n // back into the zone because matchMedia is only included in Zone.js by loading the\n // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not\n // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js\n // patches it.\n const handler = (e: MediaQueryListEvent): void => this._zone.run(() => observer.next(e));\n mql.addListener(handler);\n\n return () => {\n mql.removeListener(handler);\n };\n }).pipe(\n startWith(mql),\n map(({matches}) => ({query, matches})),\n takeUntil(this._destroySubject),\n );\n\n // Add the MediaQueryList to the set of queries.\n const output = {observable: queryObservable, mql};\n this._queries.set(query, output);\n return output;\n }\n}\n\n/**\n * Split each query string into separate query strings if two queries are provided as comma\n * separated.\n */\nfunction splitQueries(queries: readonly string[]): readonly string[] {\n return queries\n .map(query => query.split(','))\n .reduce((a1, a2) => a1.concat(a2))\n .map(query => query.trim());\n}\n"],"names":[],"mappings":";;;;;;;AAUA;AACA,MAAM,kCAAkC,GAAgB,IAAI,GAAG,EAAU;AAEzE;AACA,IAAI,mBAAiD;AAErD;MAEa,YAAY,CAAA;AACf,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC5B,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;AAG5C,IAAA,WAAW;AAInB,IAAA,WAAA,GAAA;AACE,QAAA,IAAI,CAAC,WAAW;AACd,YAAA,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,MAAM,CAAC;AACjC;;AAEE,oBAAA,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM;kBAC7B,cAAc;;AAGtB;;;;;AAKG;AACH,IAAA,UAAU,CAAC,KAAa,EAAA;AACtB,QAAA,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;AACjD,YAAA,oBAAoB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ACtC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,CAChC;;QAGD,MAAM,MAAM,GAAG,EAAC,UAAU,EAAE,eAAe,EAAE,GAAG,EAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;AAChC,QAAA,OAAO,MAAM;;8GA1FJ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cADN,MAAM,EAAA,CAAA;;kGAClB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;AA+FhC;;;AAGG;AACH,SAAS,YAAY,CAAC,OAA0B,EAAA;AAC9C,IAAA,OAAO;SACJ,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AAC7B,SAAA,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;SAChC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;AAC/B;;;;"}
|
|
1
|
+
{"version":3,"file":"_breakpoints-observer-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk/layout/media-matcher.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk/layout/breakpoints-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 {Injectable, CSP_NONCE, inject} from '@angular/core';\nimport {Platform} from '../platform';\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\n@Injectable({providedIn: 'root'})\nexport class MediaMatcher {\n private _platform = inject(Platform);\n private _nonce = inject(CSP_NONCE, {optional: true});\n\n /** The internal matchMedia method to return back a MediaQueryList like object. */\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor(...args: unknown[]);\n\n constructor() {\n this._matchMedia =\n this._platform.isBrowser && window.matchMedia\n ? // matchMedia is bound to the window scope intentionally as it is an illegal invocation to\n // call it from a different scope.\n window.matchMedia.bind(window)\n : noopMatchMedia;\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this._platform.WEBKIT || this._platform.BLINK) {\n createEmptyStyleRule(query, this._nonce);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * Creates an empty stylesheet that is used to work around browser inconsistencies related to\n * `matchMedia`. At the time of writing, it handles the following cases:\n * 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia`\n * to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration.\n * 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules\n * inside the `@media` match existing elements on the page. We work around it by having one rule\n * targeting the `body`. See https://github.com/angular/components/issues/23546.\n */\nfunction createEmptyStyleRule(query: string, nonce: string | undefined | null) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n\n if (nonce) {\n mediaQueryStyleNode.setAttribute('nonce', nonce);\n }\n\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head!.appendChild(mediaQueryStyleNode);\n }\n\n if (mediaQueryStyleNode.sheet) {\n mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n console.error(e);\n }\n}\n\n/** No-op matchMedia replacement for non-browser platforms. */\nfunction noopMatchMedia(query: string): MediaQueryList {\n // Use `as any` here to avoid adding additional necessary properties for\n // the noop matcher.\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: () => {},\n removeListener: () => {},\n } as any;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {coerceArray} from '../coercion';\nimport {Injectable, NgZone, OnDestroy, inject} from '@angular/core';\nimport {combineLatest, concat, Observable, Observer, Subject} from 'rxjs';\nimport {debounceTime, map, skip, startWith, take, takeUntil} from 'rxjs/operators';\nimport {MediaMatcher} from './media-matcher';\n\n/** The current state of a layout breakpoint. */\nexport interface BreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /**\n * A key boolean pair for each query provided to the observe method,\n * with its current matched state.\n */\n breakpoints: {\n [key: string]: boolean;\n };\n}\n\n/** The current state of a layout breakpoint. */\ninterface InternalBreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /** The media query being to be matched */\n query: string;\n}\n\ninterface Query {\n observable: Observable<InternalBreakpointState>;\n mql: MediaQueryList;\n}\n\n/** Utility for checking the matching state of `@media` queries. */\n@Injectable({providedIn: 'root'})\nexport class BreakpointObserver implements OnDestroy {\n private _mediaMatcher = inject(MediaMatcher);\n private _zone = inject(NgZone);\n\n /** A map of all media queries currently being listened for. */\n private _queries = new Map<string, Query>();\n /** A subject for all other observables to takeUntil based on. */\n private readonly _destroySubject = new Subject<void>();\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /** Completes the active subject, signalling to all other observables to complete. */\n ngOnDestroy() {\n this._destroySubject.next();\n this._destroySubject.complete();\n }\n\n /**\n * Whether one or more media queries match the current viewport size.\n * @param value One or more media queries to check.\n * @returns Whether any of the media queries match.\n */\n isMatched(value: string | readonly string[]): boolean {\n const queries = splitQueries(coerceArray(value));\n return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches);\n }\n\n /**\n * Gets an observable of results for the given queries that will emit new results for any changes\n * in matching of the given queries.\n * @param value One or more media queries to check.\n * @returns A stream of matches for the given queries.\n */\n observe(value: string | readonly string[]): Observable<BreakpointState> {\n const queries = splitQueries(coerceArray(value));\n const observables = queries.map(query => this._registerQuery(query).observable);\n\n let stateObservable = combineLatest(observables);\n // Emit the first state immediately, and then debounce the subsequent emissions.\n stateObservable = concat(\n stateObservable.pipe(take(1)),\n stateObservable.pipe(skip(1), debounceTime(0)),\n );\n return stateObservable.pipe(\n map(breakpointStates => {\n const response: BreakpointState = {\n matches: false,\n breakpoints: {},\n };\n breakpointStates.forEach(({matches, query}) => {\n response.matches = response.matches || matches;\n response.breakpoints[query] = matches;\n });\n return response;\n }),\n );\n }\n\n /** Registers a specific query to be listened for. */\n private _registerQuery(query: string): Query {\n // Only set up a new MediaQueryList if it is not already being listened for.\n if (this._queries.has(query)) {\n return this._queries.get(query)!;\n }\n\n const mql = this._mediaMatcher.matchMedia(query);\n\n // Create callback for match changes and add it is as a listener.\n const queryObservable = new Observable((observer: Observer<MediaQueryListEvent>) => {\n // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed\n // back into the zone because matchMedia is only included in Zone.js by loading the\n // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not\n // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js\n // patches it.\n const handler = (e: MediaQueryListEvent): void => this._zone.run(() => observer.next(e));\n mql.addListener(handler);\n\n return () => {\n mql.removeListener(handler);\n };\n }).pipe(\n startWith(mql),\n map(({matches}) => ({query, matches})),\n takeUntil(this._destroySubject),\n );\n\n // Add the MediaQueryList to the set of queries.\n const output = {observable: queryObservable, mql};\n this._queries.set(query, output);\n return output;\n }\n}\n\n/**\n * Split each query string into separate query strings if two queries are provided as comma\n * separated.\n */\nfunction splitQueries(queries: readonly string[]): readonly string[] {\n return queries\n .map(query => query.split(','))\n .reduce((a1, a2) => a1.concat(a2))\n .map(query => query.trim());\n}\n"],"names":["mediaQueryStyleNode","_matchMedia","constructor","_platform","isBrowser","window","matchMedia","query","nonce","setAttribute","document","head","appendChild","sheet","insertRule","add","console","error","e","noopMatchMedia","BreakpointObserver","_mediaMatcher","inject","MediaMatcher","NgZone","Map","_destroySubject","Subject","ngOnDestroy","complete","observe","value","queries","splitQueries","coerceArray","response","matches","_registerQuery"],"mappings":";;;;;;;;IAcAA,mBAAA;kBAIyB,CAAA;;;;;EASvBC,WAAA;EACEC,WAAA,GAAA;IAEI,IAAAD,CAAAA,WAAA,GAEE,IAAA,CAAAE,SAAA,CAAAC,SAAA,IAAAC,MAAA,CAAAC,UAAA;AAUR;AAxBWA,EAAAA,UAAAA,CAAAC,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDP,MAAA,IAAAC,KAAA,EAAA;AACAR,QAAAA,mBAAA,CAAAS,YAA2B,CAAA,OAAA,EAAAD,KAAA,CAAA;;AAG7BR,MAAAA,mBAAA,CAAAS,YAAA,CAAA,MAAA,EAAA,UAAA,CAAA;AAEEC,MAAAA,QAAA,CAAAC,IAAA,CAAAC,WAAA,CAAAZ,mBAAA,CAAA;;AAEJA,IAAAA,IAAAA,mBAAA,CAAAa,KAAA,EAAA;AACEb,MAAAA,mBAAQ,CAAAa,KAAA,CAAAC,UAAA,WAAAP,KAAA,CAAA,UAAA,CAAA,EAAA,CAAA,CAAA;wCACV,CAAAQ,GAAA,CAAAR,KAAA,CAAA;;AAKwE,GAAA,CAAA,OAAA,CAAA,EAAA;IACxES,OAAoB,CAAAC,KAAA,CAAAC,CAAA,CAAA;;;AAKlBC,SAAAA,cAAAA,CAAAZ,KAAA,EAAA;AAEJ,EAAA,OAAA;;;;;;;;ACpDU,MAAAa,kBAAsB,CAAA;EACtBC,aAAA,GAAcC,MAAC,CAAOC,YAAA,CAAA;OAEkC,GAAAD,MAAA,CAAAE,MAAA,CAAA;UAEC,GAAA,IAAAC,GAAA,EAAA;AAkC/DC,EAAAA,eAAA,OAAAC,OAAA,EAAA;AAMIzB,EAAAA,WAAAA,GAAA;AAEE0B,EAAAA,WAAAA,GAAA;;QAGQ,CAAAF,eAA2B,CAAAG,QAAA,EAAA;AACnC;;;;;AAwBJC,EAAAA,OAAAA,CAAAC,KAAA,EAAA;AAGE,IAAA,MAAAC,OAAA,GAAAC,YAAA,CAAAC,WAAA,CAAAH,KAAA,CAAA,CAAA;;;;;AAWJ,MAAA,MAAaI,QAAA,GAAA;AACfC,QAAAA,OAAA,EAAA,KAAA;;;;;;;gBA5FS,CAAAA,OAAA,mBAAE,IAAAA,OAAY;;AAkGtB,OAAA,CAAA;aACMD,QAAA;;;AAIDE,EAAAA,cAAAA,CAAA9B,KAAM,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA1DJ,EAAA;;;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/** Coerces a value to a CSS pixel value. */
|
|
2
1
|
function coerceCssPixelValue(value) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
if (value == null) {
|
|
3
|
+
return '';
|
|
4
|
+
}
|
|
5
|
+
return typeof value === 'string' ? value : `${value}px`;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
export { coerceCssPixelValue };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_css-pixel-value-chunk.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"_css-pixel-value-chunk.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { ConnectableObservable } from 'rxjs';
|
|
2
2
|
|
|
3
|
-
class DataSource {
|
|
4
|
-
}
|
|
5
|
-
/** Checks whether an object is a data source. */
|
|
3
|
+
class DataSource {}
|
|
6
4
|
function isDataSource(value) {
|
|
7
|
-
|
|
8
|
-
// be checked as an `instanceof DataSource` since people could create their own sources
|
|
9
|
-
// that match the interface, but don't extend DataSource. We also can't use `isObservable`
|
|
10
|
-
// here, because of some internal apps.
|
|
11
|
-
return value && typeof value.connect === 'function' && !(value instanceof ConnectableObservable);
|
|
5
|
+
return value && typeof value.connect === 'function' && !(value instanceof ConnectableObservable);
|
|
12
6
|
}
|
|
13
7
|
|
|
14
8
|
export { DataSource, isDataSource };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_data-source-chunk.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"_data-source-chunk.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, DOCUMENT, signal, EventEmitter, Injectable } from '@angular/core';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Injection token used to inject the document into Directionality.
|
|
6
|
-
* This is used so that the value can be faked in tests.
|
|
7
|
-
*
|
|
8
|
-
* We can't use the real document in tests because changing the real `dir` causes geometry-based
|
|
9
|
-
* tests in Safari to fail.
|
|
10
|
-
*
|
|
11
|
-
* We also can't re-provide the DOCUMENT token from platform-browser because the unit tests
|
|
12
|
-
* themselves use things like `querySelector` in test code.
|
|
13
|
-
*
|
|
14
|
-
* This token is defined in a separate file from Directionality as a workaround for
|
|
15
|
-
* https://github.com/angular/angular/issues/22559
|
|
16
|
-
*
|
|
17
|
-
* @docs-private
|
|
18
|
-
*/
|
|
19
4
|
const DIR_DOCUMENT = new InjectionToken('cdk-dir-doc', {
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
providedIn: 'root',
|
|
6
|
+
factory: () => inject(DOCUMENT)
|
|
22
7
|
});
|
|
23
8
|
|
|
24
|
-
/** Regex that matches locales with an RTL script. Taken from `goog.i18n.bidi.isRtlLanguage`. */
|
|
25
9
|
const RTL_LOCALE_PATTERN = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;
|
|
26
|
-
/** Resolves a string value to a specific direction. */
|
|
27
10
|
function _resolveDirectionality(rawValue) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
11
|
+
const value = rawValue?.toLowerCase() || '';
|
|
12
|
+
if (value === 'auto' && typeof navigator !== 'undefined' && navigator?.language) {
|
|
13
|
+
return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr';
|
|
14
|
+
}
|
|
15
|
+
return value === 'rtl' ? 'rtl' : 'ltr';
|
|
33
16
|
}
|
|
34
|
-
/**
|
|
35
|
-
* The directionality (LTR / RTL) context for the application (or a subtree of it).
|
|
36
|
-
* Exposes the current direction and a stream of direction changes.
|
|
37
|
-
*/
|
|
38
17
|
class Directionality {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.valueSignal.set(_resolveDirectionality(bodyDir || htmlDir || 'ltr'));
|
|
55
|
-
}
|
|
18
|
+
get value() {
|
|
19
|
+
return this.valueSignal();
|
|
20
|
+
}
|
|
21
|
+
valueSignal = signal('ltr', ...(ngDevMode ? [{
|
|
22
|
+
debugName: "valueSignal"
|
|
23
|
+
}] : []));
|
|
24
|
+
change = new EventEmitter();
|
|
25
|
+
constructor() {
|
|
26
|
+
const _document = inject(DIR_DOCUMENT, {
|
|
27
|
+
optional: true
|
|
28
|
+
});
|
|
29
|
+
if (_document) {
|
|
30
|
+
const bodyDir = _document.body ? _document.body.dir : null;
|
|
31
|
+
const htmlDir = _document.documentElement ? _document.documentElement.dir : null;
|
|
32
|
+
this.valueSignal.set(_resolveDirectionality(bodyDir || htmlDir || 'ltr'));
|
|
56
33
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
34
|
+
}
|
|
35
|
+
ngOnDestroy() {
|
|
36
|
+
this.change.complete();
|
|
37
|
+
}
|
|
38
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
39
|
+
minVersion: "12.0.0",
|
|
40
|
+
version: "20.2.0-next.2",
|
|
41
|
+
ngImport: i0,
|
|
42
|
+
type: Directionality,
|
|
43
|
+
deps: [],
|
|
44
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
45
|
+
});
|
|
46
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
47
|
+
minVersion: "12.0.0",
|
|
48
|
+
version: "20.2.0-next.2",
|
|
49
|
+
ngImport: i0,
|
|
50
|
+
type: Directionality,
|
|
51
|
+
providedIn: 'root'
|
|
52
|
+
});
|
|
62
53
|
}
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
55
|
+
minVersion: "12.0.0",
|
|
56
|
+
version: "20.2.0-next.2",
|
|
57
|
+
ngImport: i0,
|
|
58
|
+
type: Directionality,
|
|
59
|
+
decorators: [{
|
|
60
|
+
type: Injectable,
|
|
61
|
+
args: [{
|
|
62
|
+
providedIn: 'root'
|
|
63
|
+
}]
|
|
64
|
+
}],
|
|
65
|
+
ctorParameters: () => []
|
|
66
|
+
});
|
|
67
67
|
|
|
68
68
|
export { DIR_DOCUMENT, Directionality, _resolveDirectionality };
|
|
69
69
|
//# sourceMappingURL=_directionality-chunk.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_directionality-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk/bidi/
|
|
1
|
+
{"version":3,"file":"_directionality-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/cdk/bidi/directionality.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 {EventEmitter, Injectable, OnDestroy, inject, signal} from '@angular/core';\nimport {DIR_DOCUMENT} from './dir-document-token';\n\nexport type Direction = 'ltr' | 'rtl';\n\n/** Regex that matches locales with an RTL script. Taken from `goog.i18n.bidi.isRtlLanguage`. */\nconst RTL_LOCALE_PATTERN =\n /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;\n\n/** Resolves a string value to a specific direction. */\nexport function _resolveDirectionality(rawValue: string): Direction {\n const value = rawValue?.toLowerCase() || '';\n\n if (value === 'auto' && typeof navigator !== 'undefined' && navigator?.language) {\n return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr';\n }\n\n return value === 'rtl' ? 'rtl' : 'ltr';\n}\n\n/**\n * The directionality (LTR / RTL) context for the application (or a subtree of it).\n * Exposes the current direction and a stream of direction changes.\n */\n@Injectable({providedIn: 'root'})\nexport class Directionality implements OnDestroy {\n /** The current 'ltr' or 'rtl' value. */\n get value() {\n return this.valueSignal();\n }\n\n /**\n * The current 'ltr' or 'rtl' value.\n */\n readonly valueSignal = signal<Direction>('ltr');\n\n /** Stream that emits whenever the 'ltr' / 'rtl' state changes. */\n readonly change = new EventEmitter<Direction>();\n\n constructor(...args: unknown[]);\n\n constructor() {\n const _document = inject(DIR_DOCUMENT, {optional: true});\n\n if (_document) {\n const bodyDir = _document.body ? _document.body.dir : null;\n const htmlDir = _document.documentElement ? _document.documentElement.dir : null;\n this.valueSignal.set(_resolveDirectionality(bodyDir || htmlDir || 'ltr'));\n }\n }\n\n ngOnDestroy() {\n this.change.complete();\n }\n}\n"],"names":["_resolveDirectionality","rawValue","value","toLowerCase","navigator","language","valueSignal","debugName","EventEmitter","constructor"],"mappings":";;;;;;;;;AAkBM,SAAAA,uBAAAC,QAAA,EAAA;AAGJ,EAAA,MAAIC,KAAA,GAAAD,QAAgB,EAAAE,WAAyB,EAAA,IAAA,EAAA;EAC3C,IAAAD,KAAA,+CAAiD,IAAAE,SAAA,EAAAC,QAAA,EAAA;;AAMrD;;AAKA;;;AAgBE,IAAA,OAAA,IAAA,CAAAC,WAAA,EAAA;;2CAOE,GAAA,CAAA;IAAAC,SAAA,EAAA;AAAA,GAAA,CAAA,GAAA,EAAA,CAAA,CAAA;AAGF,EAAA,MAAA,GAAA,IAAWC,YAAA,EAAA;AACTC,EAAAA,WAAAA,GAAA;;;;;;;oEA5B4B,IAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|