@angular/platform-browser 20.0.0-next.4 → 20.0.0-next.6
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/animations/async/index.d.ts +1 -1
- package/animations/index.d.ts +7 -5
- package/browser.d-C4gIBeOX.d.ts +130 -0
- package/fesm2022/animations/async.mjs +6 -6
- package/fesm2022/animations/async.mjs.map +1 -1
- package/fesm2022/animations.mjs +15 -14
- package/fesm2022/animations.mjs.map +1 -1
- package/fesm2022/browser-X3l5Bmdq.mjs +549 -0
- package/fesm2022/browser-X3l5Bmdq.mjs.map +1 -0
- package/fesm2022/dom_renderer-DGKzginR.mjs +783 -0
- package/fesm2022/dom_renderer-DGKzginR.mjs.map +1 -0
- package/fesm2022/platform-browser.mjs +33 -1347
- package/fesm2022/platform-browser.mjs.map +1 -1
- package/fesm2022/testing.mjs +10 -9
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +8 -134
- package/package.json +5 -5
- package/testing/index.d.ts +4 -3
@@ -1,1332 +1,18 @@
|
|
1
1
|
/**
|
2
|
-
* @license Angular v20.0.0-next.
|
2
|
+
* @license Angular v20.0.0-next.6
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
4
4
|
* License: MIT
|
5
5
|
*/
|
6
6
|
|
7
|
-
|
7
|
+
export { BrowserModule, bootstrapApplication, createApplication, platformBrowser, provideProtractorTestingSupport, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserGetTestability as ɵBrowserGetTestability, DomEventsPlugin as ɵDomEventsPlugin, KeyEventsPlugin as ɵKeyEventsPlugin } from './browser-X3l5Bmdq.mjs';
|
8
|
+
import { ɵgetDOM as _getDOM, DOCUMENT } from '@angular/common';
|
8
9
|
export { ɵgetDOM } from '@angular/common';
|
9
10
|
import * as i0 from '@angular/core';
|
10
|
-
import {
|
11
|
+
import { Inject, Injectable, ɵglobal as _global, ApplicationRef, InjectionToken, Injector, Optional, ɵConsole as _Console, NgModule, ɵRuntimeError as _RuntimeError, ɵXSS_SECURITY_URL as _XSS_SECURITY_URL, SecurityContext, ɵallowSanitizationBypassAndThrow as _allowSanitizationBypassAndThrow, ɵunwrapSafeValue as _unwrapSafeValue, ɵ_sanitizeUrl as __sanitizeUrl, ɵ_sanitizeHtml as __sanitizeHtml, ɵbypassSanitizationTrustHtml as _bypassSanitizationTrustHtml, ɵbypassSanitizationTrustStyle as _bypassSanitizationTrustStyle, ɵbypassSanitizationTrustScript as _bypassSanitizationTrustScript, ɵbypassSanitizationTrustUrl as _bypassSanitizationTrustUrl, ɵbypassSanitizationTrustResourceUrl as _bypassSanitizationTrustResourceUrl, forwardRef, makeEnvironmentProviders, ɵwithDomHydration as _withDomHydration, ɵwithEventReplay as _withEventReplay, ɵwithI18nSupport as _withI18nSupport, ɵwithIncrementalHydration as _withIncrementalHydration, ENVIRONMENT_INITIALIZER, inject, NgZone, ɵZONELESS_ENABLED as _ZONELESS_ENABLED, ɵformatRuntimeError as _formatRuntimeError, Version } from '@angular/core';
|
12
|
+
import { EVENT_MANAGER_PLUGINS, EventManagerPlugin } from './dom_renderer-DGKzginR.mjs';
|
13
|
+
export { EventManager, REMOVE_STYLES_ON_COMPONENT_DESTROY, DomRendererFactory2 as ɵDomRendererFactory2, SharedStylesHost as ɵSharedStylesHost } from './dom_renderer-DGKzginR.mjs';
|
11
14
|
import { ɵwithHttpTransferCache as _withHttpTransferCache } from '@angular/common/http';
|
12
15
|
|
13
|
-
/**
|
14
|
-
* Provides DOM operations in any browser environment.
|
15
|
-
*
|
16
|
-
* @security Tread carefully! Interacting with the DOM directly is dangerous and
|
17
|
-
* can introduce XSS risks.
|
18
|
-
*/
|
19
|
-
class GenericBrowserDomAdapter extends _DomAdapter {
|
20
|
-
supportsDOMEvents = true;
|
21
|
-
}
|
22
|
-
|
23
|
-
/**
|
24
|
-
* A `DomAdapter` powered by full browser DOM APIs.
|
25
|
-
*
|
26
|
-
* @security Tread carefully! Interacting with the DOM directly is dangerous and
|
27
|
-
* can introduce XSS risks.
|
28
|
-
*/
|
29
|
-
class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
30
|
-
static makeCurrent() {
|
31
|
-
_setRootDomAdapter(new BrowserDomAdapter());
|
32
|
-
}
|
33
|
-
onAndCancel(el, evt, listener, options) {
|
34
|
-
el.addEventListener(evt, listener, options);
|
35
|
-
return () => {
|
36
|
-
el.removeEventListener(evt, listener, options);
|
37
|
-
};
|
38
|
-
}
|
39
|
-
dispatchEvent(el, evt) {
|
40
|
-
el.dispatchEvent(evt);
|
41
|
-
}
|
42
|
-
remove(node) {
|
43
|
-
node.remove();
|
44
|
-
}
|
45
|
-
createElement(tagName, doc) {
|
46
|
-
doc = doc || this.getDefaultDocument();
|
47
|
-
return doc.createElement(tagName);
|
48
|
-
}
|
49
|
-
createHtmlDocument() {
|
50
|
-
return document.implementation.createHTMLDocument('fakeTitle');
|
51
|
-
}
|
52
|
-
getDefaultDocument() {
|
53
|
-
return document;
|
54
|
-
}
|
55
|
-
isElementNode(node) {
|
56
|
-
return node.nodeType === Node.ELEMENT_NODE;
|
57
|
-
}
|
58
|
-
isShadowRoot(node) {
|
59
|
-
return node instanceof DocumentFragment;
|
60
|
-
}
|
61
|
-
/** @deprecated No longer being used in Ivy code. To be removed in version 14. */
|
62
|
-
getGlobalEventTarget(doc, target) {
|
63
|
-
if (target === 'window') {
|
64
|
-
return window;
|
65
|
-
}
|
66
|
-
if (target === 'document') {
|
67
|
-
return doc;
|
68
|
-
}
|
69
|
-
if (target === 'body') {
|
70
|
-
return doc.body;
|
71
|
-
}
|
72
|
-
return null;
|
73
|
-
}
|
74
|
-
getBaseHref(doc) {
|
75
|
-
const href = getBaseElementHref();
|
76
|
-
return href == null ? null : relativePath(href);
|
77
|
-
}
|
78
|
-
resetBaseElement() {
|
79
|
-
baseElement = null;
|
80
|
-
}
|
81
|
-
getUserAgent() {
|
82
|
-
return window.navigator.userAgent;
|
83
|
-
}
|
84
|
-
getCookie(name) {
|
85
|
-
return _parseCookieValue(document.cookie, name);
|
86
|
-
}
|
87
|
-
}
|
88
|
-
let baseElement = null;
|
89
|
-
function getBaseElementHref() {
|
90
|
-
baseElement = baseElement || document.querySelector('base');
|
91
|
-
return baseElement ? baseElement.getAttribute('href') : null;
|
92
|
-
}
|
93
|
-
function relativePath(url) {
|
94
|
-
// The base URL doesn't really matter, we just need it so relative paths have something
|
95
|
-
// to resolve against. In the browser `HTMLBaseElement.href` is always absolute.
|
96
|
-
return new URL(url, document.baseURI).pathname;
|
97
|
-
}
|
98
|
-
|
99
|
-
class BrowserGetTestability {
|
100
|
-
addToWindow(registry) {
|
101
|
-
_global['getAngularTestability'] = (elem, findInAncestors = true) => {
|
102
|
-
const testability = registry.findTestabilityInTree(elem, findInAncestors);
|
103
|
-
if (testability == null) {
|
104
|
-
throw new _RuntimeError(5103 /* RuntimeErrorCode.TESTABILITY_NOT_FOUND */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
105
|
-
'Could not find testability for element.');
|
106
|
-
}
|
107
|
-
return testability;
|
108
|
-
};
|
109
|
-
_global['getAllAngularTestabilities'] = () => registry.getAllTestabilities();
|
110
|
-
_global['getAllAngularRootElements'] = () => registry.getAllRootElements();
|
111
|
-
const whenAllStable = (callback) => {
|
112
|
-
const testabilities = _global['getAllAngularTestabilities']();
|
113
|
-
let count = testabilities.length;
|
114
|
-
const decrement = function () {
|
115
|
-
count--;
|
116
|
-
if (count == 0) {
|
117
|
-
callback();
|
118
|
-
}
|
119
|
-
};
|
120
|
-
testabilities.forEach((testability) => {
|
121
|
-
testability.whenStable(decrement);
|
122
|
-
});
|
123
|
-
};
|
124
|
-
if (!_global['frameworkStabilizers']) {
|
125
|
-
_global['frameworkStabilizers'] = [];
|
126
|
-
}
|
127
|
-
_global['frameworkStabilizers'].push(whenAllStable);
|
128
|
-
}
|
129
|
-
findTestabilityInTree(registry, elem, findInAncestors) {
|
130
|
-
if (elem == null) {
|
131
|
-
return null;
|
132
|
-
}
|
133
|
-
const t = registry.getTestability(elem);
|
134
|
-
if (t != null) {
|
135
|
-
return t;
|
136
|
-
}
|
137
|
-
else if (!findInAncestors) {
|
138
|
-
return null;
|
139
|
-
}
|
140
|
-
if (_getDOM().isShadowRoot(elem)) {
|
141
|
-
return this.findTestabilityInTree(registry, elem.host, true);
|
142
|
-
}
|
143
|
-
return this.findTestabilityInTree(registry, elem.parentElement, true);
|
144
|
-
}
|
145
|
-
}
|
146
|
-
|
147
|
-
/**
|
148
|
-
* A factory for `HttpXhrBackend` that uses the `XMLHttpRequest` browser API.
|
149
|
-
*/
|
150
|
-
class BrowserXhr {
|
151
|
-
build() {
|
152
|
-
return new XMLHttpRequest();
|
153
|
-
}
|
154
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: BrowserXhr, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
155
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: BrowserXhr });
|
156
|
-
}
|
157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: BrowserXhr, decorators: [{
|
158
|
-
type: Injectable
|
159
|
-
}] });
|
160
|
-
|
161
|
-
/**
|
162
|
-
* The injection token for plugins of the `EventManager` service.
|
163
|
-
*
|
164
|
-
* @publicApi
|
165
|
-
*/
|
166
|
-
const EVENT_MANAGER_PLUGINS = new InjectionToken(ngDevMode ? 'EventManagerPlugins' : '');
|
167
|
-
/**
|
168
|
-
* An injectable service that provides event management for Angular
|
169
|
-
* through a browser plug-in.
|
170
|
-
*
|
171
|
-
* @publicApi
|
172
|
-
*/
|
173
|
-
class EventManager {
|
174
|
-
_zone;
|
175
|
-
_plugins;
|
176
|
-
_eventNameToPlugin = new Map();
|
177
|
-
/**
|
178
|
-
* Initializes an instance of the event-manager service.
|
179
|
-
*/
|
180
|
-
constructor(plugins, _zone) {
|
181
|
-
this._zone = _zone;
|
182
|
-
plugins.forEach((plugin) => {
|
183
|
-
plugin.manager = this;
|
184
|
-
});
|
185
|
-
this._plugins = plugins.slice().reverse();
|
186
|
-
}
|
187
|
-
/**
|
188
|
-
* Registers a handler for a specific element and event.
|
189
|
-
*
|
190
|
-
* @param element The HTML element to receive event notifications.
|
191
|
-
* @param eventName The name of the event to listen for.
|
192
|
-
* @param handler A function to call when the notification occurs. Receives the
|
193
|
-
* event object as an argument.
|
194
|
-
* @param options Options that configure how the event listener is bound.
|
195
|
-
* @returns A callback function that can be used to remove the handler.
|
196
|
-
*/
|
197
|
-
addEventListener(element, eventName, handler, options) {
|
198
|
-
const plugin = this._findPluginFor(eventName);
|
199
|
-
return plugin.addEventListener(element, eventName, handler, options);
|
200
|
-
}
|
201
|
-
/**
|
202
|
-
* Retrieves the compilation zone in which event listeners are registered.
|
203
|
-
*/
|
204
|
-
getZone() {
|
205
|
-
return this._zone;
|
206
|
-
}
|
207
|
-
/** @internal */
|
208
|
-
_findPluginFor(eventName) {
|
209
|
-
let plugin = this._eventNameToPlugin.get(eventName);
|
210
|
-
if (plugin) {
|
211
|
-
return plugin;
|
212
|
-
}
|
213
|
-
const plugins = this._plugins;
|
214
|
-
plugin = plugins.find((plugin) => plugin.supports(eventName));
|
215
|
-
if (!plugin) {
|
216
|
-
throw new _RuntimeError(5101 /* RuntimeErrorCode.NO_PLUGIN_FOR_EVENT */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
217
|
-
`No event manager plugin found for event ${eventName}`);
|
218
|
-
}
|
219
|
-
this._eventNameToPlugin.set(eventName, plugin);
|
220
|
-
return plugin;
|
221
|
-
}
|
222
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: EventManager, deps: [{ token: EVENT_MANAGER_PLUGINS }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
223
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: EventManager });
|
224
|
-
}
|
225
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: EventManager, decorators: [{
|
226
|
-
type: Injectable
|
227
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
228
|
-
type: Inject,
|
229
|
-
args: [EVENT_MANAGER_PLUGINS]
|
230
|
-
}] }, { type: i0.NgZone }] });
|
231
|
-
/**
|
232
|
-
* The plugin definition for the `EventManager` class
|
233
|
-
*
|
234
|
-
* It can be used as a base class to create custom manager plugins, i.e. you can create your own
|
235
|
-
* class that extends the `EventManagerPlugin` one.
|
236
|
-
*
|
237
|
-
* @publicApi
|
238
|
-
*/
|
239
|
-
class EventManagerPlugin {
|
240
|
-
_doc;
|
241
|
-
// TODO: remove (has some usage in G3)
|
242
|
-
constructor(_doc) {
|
243
|
-
this._doc = _doc;
|
244
|
-
}
|
245
|
-
// Using non-null assertion because it's set by EventManager's constructor
|
246
|
-
manager;
|
247
|
-
}
|
248
|
-
|
249
|
-
/** The style elements attribute name used to set value of `APP_ID` token. */
|
250
|
-
const APP_ID_ATTRIBUTE_NAME = 'ng-app-id';
|
251
|
-
/**
|
252
|
-
* Removes all provided elements from the document.
|
253
|
-
* @param elements An array of HTML Elements.
|
254
|
-
*/
|
255
|
-
function removeElements(elements) {
|
256
|
-
for (const element of elements) {
|
257
|
-
element.remove();
|
258
|
-
}
|
259
|
-
}
|
260
|
-
/**
|
261
|
-
* Creates a `style` element with the provided inline style content.
|
262
|
-
* @param style A string of the inline style content.
|
263
|
-
* @param doc A DOM Document to use to create the element.
|
264
|
-
* @returns An HTMLStyleElement instance.
|
265
|
-
*/
|
266
|
-
function createStyleElement(style, doc) {
|
267
|
-
const styleElement = doc.createElement('style');
|
268
|
-
styleElement.textContent = style;
|
269
|
-
return styleElement;
|
270
|
-
}
|
271
|
-
/**
|
272
|
-
* Searches a DOM document's head element for style elements with a matching application
|
273
|
-
* identifier attribute (`ng-app-id`) to the provide identifier and adds usage records for each.
|
274
|
-
* @param doc An HTML DOM document instance.
|
275
|
-
* @param appId A string containing an Angular application identifer.
|
276
|
-
* @param inline A Map object for tracking inline (defined via `styles` in component decorator) style usage.
|
277
|
-
* @param external A Map object for tracking external (defined via `styleUrls` in component decorator) style usage.
|
278
|
-
*/
|
279
|
-
function addServerStyles(doc, appId, inline, external) {
|
280
|
-
const elements = doc.head?.querySelectorAll(`style[${APP_ID_ATTRIBUTE_NAME}="${appId}"],link[${APP_ID_ATTRIBUTE_NAME}="${appId}"]`);
|
281
|
-
if (elements) {
|
282
|
-
for (const styleElement of elements) {
|
283
|
-
styleElement.removeAttribute(APP_ID_ATTRIBUTE_NAME);
|
284
|
-
if (styleElement instanceof HTMLLinkElement) {
|
285
|
-
// Only use filename from href
|
286
|
-
// The href is build time generated with a unique value to prevent duplicates.
|
287
|
-
external.set(styleElement.href.slice(styleElement.href.lastIndexOf('/') + 1), {
|
288
|
-
usage: 0,
|
289
|
-
elements: [styleElement],
|
290
|
-
});
|
291
|
-
}
|
292
|
-
else if (styleElement.textContent) {
|
293
|
-
inline.set(styleElement.textContent, { usage: 0, elements: [styleElement] });
|
294
|
-
}
|
295
|
-
}
|
296
|
-
}
|
297
|
-
}
|
298
|
-
/**
|
299
|
-
* Creates a `link` element for the provided external style URL.
|
300
|
-
* @param url A string of the URL for the stylesheet.
|
301
|
-
* @param doc A DOM Document to use to create the element.
|
302
|
-
* @returns An HTMLLinkElement instance.
|
303
|
-
*/
|
304
|
-
function createLinkElement(url, doc) {
|
305
|
-
const linkElement = doc.createElement('link');
|
306
|
-
linkElement.setAttribute('rel', 'stylesheet');
|
307
|
-
linkElement.setAttribute('href', url);
|
308
|
-
return linkElement;
|
309
|
-
}
|
310
|
-
class SharedStylesHost {
|
311
|
-
doc;
|
312
|
-
appId;
|
313
|
-
nonce;
|
314
|
-
/**
|
315
|
-
* Provides usage information for active inline style content and associated HTML <style> elements.
|
316
|
-
* Embedded styles typically originate from the `styles` metadata of a rendered component.
|
317
|
-
*/
|
318
|
-
inline = new Map();
|
319
|
-
/**
|
320
|
-
* Provides usage information for active external style URLs and the associated HTML <link> elements.
|
321
|
-
* External styles typically originate from the `ɵɵExternalStylesFeature` of a rendered component.
|
322
|
-
*/
|
323
|
-
external = new Map();
|
324
|
-
/**
|
325
|
-
* Set of host DOM nodes that will have styles attached.
|
326
|
-
*/
|
327
|
-
hosts = new Set();
|
328
|
-
/**
|
329
|
-
* Whether the application code is currently executing on a server.
|
330
|
-
*/
|
331
|
-
isServer;
|
332
|
-
constructor(doc, appId, nonce, platformId = {}) {
|
333
|
-
this.doc = doc;
|
334
|
-
this.appId = appId;
|
335
|
-
this.nonce = nonce;
|
336
|
-
this.isServer = isPlatformServer(platformId);
|
337
|
-
addServerStyles(doc, appId, this.inline, this.external);
|
338
|
-
this.hosts.add(doc.head);
|
339
|
-
}
|
340
|
-
/**
|
341
|
-
* Adds embedded styles to the DOM via HTML `style` elements.
|
342
|
-
* @param styles An array of style content strings.
|
343
|
-
*/
|
344
|
-
addStyles(styles, urls) {
|
345
|
-
for (const value of styles) {
|
346
|
-
this.addUsage(value, this.inline, createStyleElement);
|
347
|
-
}
|
348
|
-
urls?.forEach((value) => this.addUsage(value, this.external, createLinkElement));
|
349
|
-
}
|
350
|
-
/**
|
351
|
-
* Removes embedded styles from the DOM that were added as HTML `style` elements.
|
352
|
-
* @param styles An array of style content strings.
|
353
|
-
*/
|
354
|
-
removeStyles(styles, urls) {
|
355
|
-
for (const value of styles) {
|
356
|
-
this.removeUsage(value, this.inline);
|
357
|
-
}
|
358
|
-
urls?.forEach((value) => this.removeUsage(value, this.external));
|
359
|
-
}
|
360
|
-
addUsage(value, usages, creator) {
|
361
|
-
// Attempt to get any current usage of the value
|
362
|
-
const record = usages.get(value);
|
363
|
-
// If existing, just increment the usage count
|
364
|
-
if (record) {
|
365
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && record.usage === 0) {
|
366
|
-
// A usage count of zero indicates a preexisting server generated style.
|
367
|
-
// This attribute is solely used for debugging purposes of SSR style reuse.
|
368
|
-
record.elements.forEach((element) => element.setAttribute('ng-style-reused', ''));
|
369
|
-
}
|
370
|
-
record.usage++;
|
371
|
-
}
|
372
|
-
else {
|
373
|
-
// Otherwise, create an entry to track the elements and add element for each host
|
374
|
-
usages.set(value, {
|
375
|
-
usage: 1,
|
376
|
-
elements: [...this.hosts].map((host) => this.addElement(host, creator(value, this.doc))),
|
377
|
-
});
|
378
|
-
}
|
379
|
-
}
|
380
|
-
removeUsage(value, usages) {
|
381
|
-
// Attempt to get any current usage of the value
|
382
|
-
const record = usages.get(value);
|
383
|
-
// If there is a record, reduce the usage count and if no longer used,
|
384
|
-
// remove from DOM and delete usage record.
|
385
|
-
if (record) {
|
386
|
-
record.usage--;
|
387
|
-
if (record.usage <= 0) {
|
388
|
-
removeElements(record.elements);
|
389
|
-
usages.delete(value);
|
390
|
-
}
|
391
|
-
}
|
392
|
-
}
|
393
|
-
ngOnDestroy() {
|
394
|
-
for (const [, { elements }] of [...this.inline, ...this.external]) {
|
395
|
-
removeElements(elements);
|
396
|
-
}
|
397
|
-
this.hosts.clear();
|
398
|
-
}
|
399
|
-
/**
|
400
|
-
* Adds a host node to the set of style hosts and adds all existing style usage to
|
401
|
-
* the newly added host node.
|
402
|
-
*
|
403
|
-
* This is currently only used for Shadow DOM encapsulation mode.
|
404
|
-
*/
|
405
|
-
addHost(hostNode) {
|
406
|
-
this.hosts.add(hostNode);
|
407
|
-
// Add existing styles to new host
|
408
|
-
for (const [style, { elements }] of this.inline) {
|
409
|
-
elements.push(this.addElement(hostNode, createStyleElement(style, this.doc)));
|
410
|
-
}
|
411
|
-
for (const [url, { elements }] of this.external) {
|
412
|
-
elements.push(this.addElement(hostNode, createLinkElement(url, this.doc)));
|
413
|
-
}
|
414
|
-
}
|
415
|
-
removeHost(hostNode) {
|
416
|
-
this.hosts.delete(hostNode);
|
417
|
-
}
|
418
|
-
addElement(host, element) {
|
419
|
-
// Add a nonce if present
|
420
|
-
if (this.nonce) {
|
421
|
-
element.setAttribute('nonce', this.nonce);
|
422
|
-
}
|
423
|
-
// Add application identifier when on the server to support client-side reuse
|
424
|
-
if (this.isServer) {
|
425
|
-
element.setAttribute(APP_ID_ATTRIBUTE_NAME, this.appId);
|
426
|
-
}
|
427
|
-
// Insert the element into the DOM with the host node as parent
|
428
|
-
return host.appendChild(element);
|
429
|
-
}
|
430
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: SharedStylesHost, deps: [{ token: DOCUMENT }, { token: APP_ID }, { token: CSP_NONCE, optional: true }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
431
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: SharedStylesHost });
|
432
|
-
}
|
433
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: SharedStylesHost, decorators: [{
|
434
|
-
type: Injectable
|
435
|
-
}], ctorParameters: () => [{ type: Document, decorators: [{
|
436
|
-
type: Inject,
|
437
|
-
args: [DOCUMENT]
|
438
|
-
}] }, { type: undefined, decorators: [{
|
439
|
-
type: Inject,
|
440
|
-
args: [APP_ID]
|
441
|
-
}] }, { type: undefined, decorators: [{
|
442
|
-
type: Inject,
|
443
|
-
args: [CSP_NONCE]
|
444
|
-
}, {
|
445
|
-
type: Optional
|
446
|
-
}] }, { type: undefined, decorators: [{
|
447
|
-
type: Inject,
|
448
|
-
args: [PLATFORM_ID]
|
449
|
-
}] }] });
|
450
|
-
|
451
|
-
const NAMESPACE_URIS = {
|
452
|
-
'svg': 'http://www.w3.org/2000/svg',
|
453
|
-
'xhtml': 'http://www.w3.org/1999/xhtml',
|
454
|
-
'xlink': 'http://www.w3.org/1999/xlink',
|
455
|
-
'xml': 'http://www.w3.org/XML/1998/namespace',
|
456
|
-
'xmlns': 'http://www.w3.org/2000/xmlns/',
|
457
|
-
'math': 'http://www.w3.org/1998/Math/MathML',
|
458
|
-
};
|
459
|
-
const COMPONENT_REGEX = /%COMP%/g;
|
460
|
-
const SOURCEMAP_URL_REGEXP = /\/\*#\s*sourceMappingURL=(.+?)\s*\*\//;
|
461
|
-
const PROTOCOL_REGEXP = /^https?:/;
|
462
|
-
const COMPONENT_VARIABLE = '%COMP%';
|
463
|
-
const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
464
|
-
const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
|
465
|
-
/**
|
466
|
-
* The default value for the `REMOVE_STYLES_ON_COMPONENT_DESTROY` DI token.
|
467
|
-
*/
|
468
|
-
const REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT = true;
|
469
|
-
/**
|
470
|
-
* A DI token that indicates whether styles
|
471
|
-
* of destroyed components should be removed from DOM.
|
472
|
-
*
|
473
|
-
* By default, the value is set to `true`.
|
474
|
-
* @publicApi
|
475
|
-
*/
|
476
|
-
const REMOVE_STYLES_ON_COMPONENT_DESTROY = new InjectionToken(ngDevMode ? 'RemoveStylesOnCompDestroy' : '', {
|
477
|
-
providedIn: 'root',
|
478
|
-
factory: () => REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT,
|
479
|
-
});
|
480
|
-
function shimContentAttribute(componentShortId) {
|
481
|
-
return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
|
482
|
-
}
|
483
|
-
function shimHostAttribute(componentShortId) {
|
484
|
-
return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
|
485
|
-
}
|
486
|
-
function shimStylesContent(compId, styles) {
|
487
|
-
return styles.map((s) => s.replace(COMPONENT_REGEX, compId));
|
488
|
-
}
|
489
|
-
/**
|
490
|
-
* Prepends a baseHref to the `sourceMappingURL` within the provided CSS content.
|
491
|
-
* If the `sourceMappingURL` contains an inline (encoded) map, the function skips processing.
|
492
|
-
*
|
493
|
-
* @note For inline stylesheets, the `sourceMappingURL` is relative to the page's origin
|
494
|
-
* and not the provided baseHref. This function is needed as when accessing the page with a URL
|
495
|
-
* containing two or more segments.
|
496
|
-
* For example, if the baseHref is set to `/`, and you visit a URL like `http://localhost/foo/bar`,
|
497
|
-
* the map would be requested from `http://localhost/foo/bar/comp.css.map` instead of what you'd expect,
|
498
|
-
* which is `http://localhost/comp.css.map`. This behavior is corrected by modifying the `sourceMappingURL`
|
499
|
-
* to ensure external source maps are loaded relative to the baseHref.
|
500
|
-
*
|
501
|
-
|
502
|
-
* @param baseHref - The base URL to prepend to the `sourceMappingURL`.
|
503
|
-
* @param styles - An array of CSS content strings, each potentially containing a `sourceMappingURL`.
|
504
|
-
* @returns The updated array of CSS content strings with modified `sourceMappingURL` values,
|
505
|
-
* or the original content if no modification is needed.
|
506
|
-
*/
|
507
|
-
function addBaseHrefToCssSourceMap(baseHref, styles) {
|
508
|
-
if (!baseHref) {
|
509
|
-
return styles;
|
510
|
-
}
|
511
|
-
const absoluteBaseHrefUrl = new URL(baseHref, 'http://localhost');
|
512
|
-
return styles.map((cssContent) => {
|
513
|
-
if (!cssContent.includes('sourceMappingURL=')) {
|
514
|
-
return cssContent;
|
515
|
-
}
|
516
|
-
return cssContent.replace(SOURCEMAP_URL_REGEXP, (_, sourceMapUrl) => {
|
517
|
-
if (sourceMapUrl[0] === '/' ||
|
518
|
-
sourceMapUrl.startsWith('data:') ||
|
519
|
-
PROTOCOL_REGEXP.test(sourceMapUrl)) {
|
520
|
-
return `/*# sourceMappingURL=${sourceMapUrl} */`;
|
521
|
-
}
|
522
|
-
const { pathname: resolvedSourceMapUrl } = new URL(sourceMapUrl, absoluteBaseHrefUrl);
|
523
|
-
return `/*# sourceMappingURL=${resolvedSourceMapUrl} */`;
|
524
|
-
});
|
525
|
-
});
|
526
|
-
}
|
527
|
-
class DomRendererFactory2 {
|
528
|
-
eventManager;
|
529
|
-
sharedStylesHost;
|
530
|
-
appId;
|
531
|
-
removeStylesOnCompDestroy;
|
532
|
-
doc;
|
533
|
-
platformId;
|
534
|
-
ngZone;
|
535
|
-
nonce;
|
536
|
-
tracingService;
|
537
|
-
rendererByCompId = new Map();
|
538
|
-
defaultRenderer;
|
539
|
-
platformIsServer;
|
540
|
-
constructor(eventManager, sharedStylesHost, appId, removeStylesOnCompDestroy, doc, platformId, ngZone, nonce = null, tracingService = null) {
|
541
|
-
this.eventManager = eventManager;
|
542
|
-
this.sharedStylesHost = sharedStylesHost;
|
543
|
-
this.appId = appId;
|
544
|
-
this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
|
545
|
-
this.doc = doc;
|
546
|
-
this.platformId = platformId;
|
547
|
-
this.ngZone = ngZone;
|
548
|
-
this.nonce = nonce;
|
549
|
-
this.tracingService = tracingService;
|
550
|
-
this.platformIsServer = isPlatformServer(platformId);
|
551
|
-
this.defaultRenderer = new DefaultDomRenderer2(eventManager, doc, ngZone, this.platformIsServer, this.tracingService);
|
552
|
-
}
|
553
|
-
createRenderer(element, type) {
|
554
|
-
if (!element || !type) {
|
555
|
-
return this.defaultRenderer;
|
556
|
-
}
|
557
|
-
if (this.platformIsServer && type.encapsulation === ViewEncapsulation.ShadowDom) {
|
558
|
-
// Domino does not support shadow DOM.
|
559
|
-
type = { ...type, encapsulation: ViewEncapsulation.Emulated };
|
560
|
-
}
|
561
|
-
const renderer = this.getOrCreateRenderer(element, type);
|
562
|
-
// Renderers have different logic due to different encapsulation behaviours.
|
563
|
-
// Ex: for emulated, an attribute is added to the element.
|
564
|
-
if (renderer instanceof EmulatedEncapsulationDomRenderer2) {
|
565
|
-
renderer.applyToHost(element);
|
566
|
-
}
|
567
|
-
else if (renderer instanceof NoneEncapsulationDomRenderer) {
|
568
|
-
renderer.applyStyles();
|
569
|
-
}
|
570
|
-
return renderer;
|
571
|
-
}
|
572
|
-
getOrCreateRenderer(element, type) {
|
573
|
-
const rendererByCompId = this.rendererByCompId;
|
574
|
-
let renderer = rendererByCompId.get(type.id);
|
575
|
-
if (!renderer) {
|
576
|
-
const doc = this.doc;
|
577
|
-
const ngZone = this.ngZone;
|
578
|
-
const eventManager = this.eventManager;
|
579
|
-
const sharedStylesHost = this.sharedStylesHost;
|
580
|
-
const removeStylesOnCompDestroy = this.removeStylesOnCompDestroy;
|
581
|
-
const platformIsServer = this.platformIsServer;
|
582
|
-
const tracingService = this.tracingService;
|
583
|
-
switch (type.encapsulation) {
|
584
|
-
case ViewEncapsulation.Emulated:
|
585
|
-
renderer = new EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, type, this.appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService);
|
586
|
-
break;
|
587
|
-
case ViewEncapsulation.ShadowDom:
|
588
|
-
return new ShadowDomRenderer(eventManager, sharedStylesHost, element, type, doc, ngZone, this.nonce, platformIsServer, tracingService);
|
589
|
-
default:
|
590
|
-
renderer = new NoneEncapsulationDomRenderer(eventManager, sharedStylesHost, type, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService);
|
591
|
-
break;
|
592
|
-
}
|
593
|
-
rendererByCompId.set(type.id, renderer);
|
594
|
-
}
|
595
|
-
return renderer;
|
596
|
-
}
|
597
|
-
ngOnDestroy() {
|
598
|
-
this.rendererByCompId.clear();
|
599
|
-
}
|
600
|
-
/**
|
601
|
-
* Used during HMR to clear any cached data about a component.
|
602
|
-
* @param componentId ID of the component that is being replaced.
|
603
|
-
*/
|
604
|
-
componentReplaced(componentId) {
|
605
|
-
this.rendererByCompId.delete(componentId);
|
606
|
-
}
|
607
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: DomRendererFactory2, deps: [{ token: EventManager }, { token: SharedStylesHost }, { token: APP_ID }, { token: REMOVE_STYLES_ON_COMPONENT_DESTROY }, { token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: CSP_NONCE }, { token: _TracingService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
608
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: DomRendererFactory2 });
|
609
|
-
}
|
610
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: DomRendererFactory2, decorators: [{
|
611
|
-
type: Injectable
|
612
|
-
}], ctorParameters: () => [{ type: EventManager }, { type: SharedStylesHost }, { type: undefined, decorators: [{
|
613
|
-
type: Inject,
|
614
|
-
args: [APP_ID]
|
615
|
-
}] }, { type: undefined, decorators: [{
|
616
|
-
type: Inject,
|
617
|
-
args: [REMOVE_STYLES_ON_COMPONENT_DESTROY]
|
618
|
-
}] }, { type: Document, decorators: [{
|
619
|
-
type: Inject,
|
620
|
-
args: [DOCUMENT]
|
621
|
-
}] }, { type: Object, decorators: [{
|
622
|
-
type: Inject,
|
623
|
-
args: [PLATFORM_ID]
|
624
|
-
}] }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
625
|
-
type: Inject,
|
626
|
-
args: [CSP_NONCE]
|
627
|
-
}] }, { type: i0.ɵTracingService, decorators: [{
|
628
|
-
type: Inject,
|
629
|
-
args: [_TracingService]
|
630
|
-
}, {
|
631
|
-
type: Optional
|
632
|
-
}] }] });
|
633
|
-
class DefaultDomRenderer2 {
|
634
|
-
eventManager;
|
635
|
-
doc;
|
636
|
-
ngZone;
|
637
|
-
platformIsServer;
|
638
|
-
tracingService;
|
639
|
-
data = Object.create(null);
|
640
|
-
/**
|
641
|
-
* By default this renderer throws when encountering synthetic properties
|
642
|
-
* This can be disabled for example by the AsyncAnimationRendererFactory
|
643
|
-
*/
|
644
|
-
throwOnSyntheticProps = true;
|
645
|
-
constructor(eventManager, doc, ngZone, platformIsServer, tracingService) {
|
646
|
-
this.eventManager = eventManager;
|
647
|
-
this.doc = doc;
|
648
|
-
this.ngZone = ngZone;
|
649
|
-
this.platformIsServer = platformIsServer;
|
650
|
-
this.tracingService = tracingService;
|
651
|
-
}
|
652
|
-
destroy() { }
|
653
|
-
destroyNode = null;
|
654
|
-
createElement(name, namespace) {
|
655
|
-
if (namespace) {
|
656
|
-
// TODO: `|| namespace` was added in
|
657
|
-
// https://github.com/angular/angular/commit/2b9cc8503d48173492c29f5a271b61126104fbdb to
|
658
|
-
// support how Ivy passed around the namespace URI rather than short name at the time. It did
|
659
|
-
// not, however extend the support to other parts of the system (setAttribute, setAttribute,
|
660
|
-
// and the ServerRenderer). We should decide what exactly the semantics for dealing with
|
661
|
-
// namespaces should be and make it consistent.
|
662
|
-
// Related issues:
|
663
|
-
// https://github.com/angular/angular/issues/44028
|
664
|
-
// https://github.com/angular/angular/issues/44883
|
665
|
-
return this.doc.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);
|
666
|
-
}
|
667
|
-
return this.doc.createElement(name);
|
668
|
-
}
|
669
|
-
createComment(value) {
|
670
|
-
return this.doc.createComment(value);
|
671
|
-
}
|
672
|
-
createText(value) {
|
673
|
-
return this.doc.createTextNode(value);
|
674
|
-
}
|
675
|
-
appendChild(parent, newChild) {
|
676
|
-
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
677
|
-
targetParent.appendChild(newChild);
|
678
|
-
}
|
679
|
-
insertBefore(parent, newChild, refChild) {
|
680
|
-
if (parent) {
|
681
|
-
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
682
|
-
targetParent.insertBefore(newChild, refChild);
|
683
|
-
}
|
684
|
-
}
|
685
|
-
removeChild(_parent, oldChild) {
|
686
|
-
oldChild.remove();
|
687
|
-
}
|
688
|
-
selectRootElement(selectorOrNode, preserveContent) {
|
689
|
-
let el = typeof selectorOrNode === 'string' ? this.doc.querySelector(selectorOrNode) : selectorOrNode;
|
690
|
-
if (!el) {
|
691
|
-
throw new _RuntimeError(-5104 /* RuntimeErrorCode.ROOT_NODE_NOT_FOUND */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
692
|
-
`The selector "${selectorOrNode}" did not match any elements`);
|
693
|
-
}
|
694
|
-
if (!preserveContent) {
|
695
|
-
el.textContent = '';
|
696
|
-
}
|
697
|
-
return el;
|
698
|
-
}
|
699
|
-
parentNode(node) {
|
700
|
-
return node.parentNode;
|
701
|
-
}
|
702
|
-
nextSibling(node) {
|
703
|
-
return node.nextSibling;
|
704
|
-
}
|
705
|
-
setAttribute(el, name, value, namespace) {
|
706
|
-
if (namespace) {
|
707
|
-
name = namespace + ':' + name;
|
708
|
-
const namespaceUri = NAMESPACE_URIS[namespace];
|
709
|
-
if (namespaceUri) {
|
710
|
-
el.setAttributeNS(namespaceUri, name, value);
|
711
|
-
}
|
712
|
-
else {
|
713
|
-
el.setAttribute(name, value);
|
714
|
-
}
|
715
|
-
}
|
716
|
-
else {
|
717
|
-
el.setAttribute(name, value);
|
718
|
-
}
|
719
|
-
}
|
720
|
-
removeAttribute(el, name, namespace) {
|
721
|
-
if (namespace) {
|
722
|
-
const namespaceUri = NAMESPACE_URIS[namespace];
|
723
|
-
if (namespaceUri) {
|
724
|
-
el.removeAttributeNS(namespaceUri, name);
|
725
|
-
}
|
726
|
-
else {
|
727
|
-
el.removeAttribute(`${namespace}:${name}`);
|
728
|
-
}
|
729
|
-
}
|
730
|
-
else {
|
731
|
-
el.removeAttribute(name);
|
732
|
-
}
|
733
|
-
}
|
734
|
-
addClass(el, name) {
|
735
|
-
el.classList.add(name);
|
736
|
-
}
|
737
|
-
removeClass(el, name) {
|
738
|
-
el.classList.remove(name);
|
739
|
-
}
|
740
|
-
setStyle(el, style, value, flags) {
|
741
|
-
if (flags & (RendererStyleFlags2.DashCase | RendererStyleFlags2.Important)) {
|
742
|
-
el.style.setProperty(style, value, flags & RendererStyleFlags2.Important ? 'important' : '');
|
743
|
-
}
|
744
|
-
else {
|
745
|
-
el.style[style] = value;
|
746
|
-
}
|
747
|
-
}
|
748
|
-
removeStyle(el, style, flags) {
|
749
|
-
if (flags & RendererStyleFlags2.DashCase) {
|
750
|
-
// removeProperty has no effect when used on camelCased properties.
|
751
|
-
el.style.removeProperty(style);
|
752
|
-
}
|
753
|
-
else {
|
754
|
-
el.style[style] = '';
|
755
|
-
}
|
756
|
-
}
|
757
|
-
setProperty(el, name, value) {
|
758
|
-
if (el == null) {
|
759
|
-
return;
|
760
|
-
}
|
761
|
-
(typeof ngDevMode === 'undefined' || ngDevMode) &&
|
762
|
-
this.throwOnSyntheticProps &&
|
763
|
-
checkNoSyntheticProp(name, 'property');
|
764
|
-
el[name] = value;
|
765
|
-
}
|
766
|
-
setValue(node, value) {
|
767
|
-
node.nodeValue = value;
|
768
|
-
}
|
769
|
-
listen(target, event, callback, options) {
|
770
|
-
(typeof ngDevMode === 'undefined' || ngDevMode) &&
|
771
|
-
this.throwOnSyntheticProps &&
|
772
|
-
checkNoSyntheticProp(event, 'listener');
|
773
|
-
if (typeof target === 'string') {
|
774
|
-
target = _getDOM().getGlobalEventTarget(this.doc, target);
|
775
|
-
if (!target) {
|
776
|
-
throw new _RuntimeError(5102 /* RuntimeErrorCode.UNSUPPORTED_EVENT_TARGET */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
777
|
-
`Unsupported event target ${target} for event ${event}`);
|
778
|
-
}
|
779
|
-
}
|
780
|
-
let wrappedCallback = this.decoratePreventDefault(callback);
|
781
|
-
if (this.tracingService?.wrapEventListener) {
|
782
|
-
wrappedCallback = this.tracingService.wrapEventListener(target, event, wrappedCallback);
|
783
|
-
}
|
784
|
-
return this.eventManager.addEventListener(target, event, wrappedCallback, options);
|
785
|
-
}
|
786
|
-
decoratePreventDefault(eventHandler) {
|
787
|
-
// `DebugNode.triggerEventHandler` needs to know if the listener was created with
|
788
|
-
// decoratePreventDefault or is a listener added outside the Angular context so it can handle
|
789
|
-
// the two differently. In the first case, the special '__ngUnwrap__' token is passed to the
|
790
|
-
// unwrap the listener (see below).
|
791
|
-
return (event) => {
|
792
|
-
// Ivy uses '__ngUnwrap__' as a special token that allows us to unwrap the function
|
793
|
-
// so that it can be invoked programmatically by `DebugNode.triggerEventHandler`. The
|
794
|
-
// debug_node can inspect the listener toString contents for the existence of this special
|
795
|
-
// token. Because the token is a string literal, it is ensured to not be modified by compiled
|
796
|
-
// code.
|
797
|
-
if (event === '__ngUnwrap__') {
|
798
|
-
return eventHandler;
|
799
|
-
}
|
800
|
-
// Run the event handler inside the ngZone because event handlers are not patched
|
801
|
-
// by Zone on the server. This is required only for tests.
|
802
|
-
const allowDefaultBehavior = this.platformIsServer
|
803
|
-
? this.ngZone.runGuarded(() => eventHandler(event))
|
804
|
-
: eventHandler(event);
|
805
|
-
if (allowDefaultBehavior === false) {
|
806
|
-
event.preventDefault();
|
807
|
-
}
|
808
|
-
return undefined;
|
809
|
-
};
|
810
|
-
}
|
811
|
-
}
|
812
|
-
const AT_CHARCODE = (() => '@'.charCodeAt(0))();
|
813
|
-
function checkNoSyntheticProp(name, nameKind) {
|
814
|
-
if (name.charCodeAt(0) === AT_CHARCODE) {
|
815
|
-
throw new _RuntimeError(5105 /* RuntimeErrorCode.UNEXPECTED_SYNTHETIC_PROPERTY */, `Unexpected synthetic ${nameKind} ${name} found. Please make sure that:
|
816
|
-
- Make sure \`provideAnimationsAsync()\`, \`provideAnimations()\` or \`provideNoopAnimations()\` call was added to a list of providers used to bootstrap an application.
|
817
|
-
- There is a corresponding animation configuration named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.dev/api/core/Component#animations).`);
|
818
|
-
}
|
819
|
-
}
|
820
|
-
function isTemplateNode(node) {
|
821
|
-
return node.tagName === 'TEMPLATE' && node.content !== undefined;
|
822
|
-
}
|
823
|
-
class ShadowDomRenderer extends DefaultDomRenderer2 {
|
824
|
-
sharedStylesHost;
|
825
|
-
hostEl;
|
826
|
-
shadowRoot;
|
827
|
-
constructor(eventManager, sharedStylesHost, hostEl, component, doc, ngZone, nonce, platformIsServer, tracingService) {
|
828
|
-
super(eventManager, doc, ngZone, platformIsServer, tracingService);
|
829
|
-
this.sharedStylesHost = sharedStylesHost;
|
830
|
-
this.hostEl = hostEl;
|
831
|
-
this.shadowRoot = hostEl.attachShadow({ mode: 'open' });
|
832
|
-
this.sharedStylesHost.addHost(this.shadowRoot);
|
833
|
-
let styles = component.styles;
|
834
|
-
if (ngDevMode) {
|
835
|
-
// We only do this in development, as for production users should not add CSS sourcemaps to components.
|
836
|
-
const baseHref = _getDOM().getBaseHref(doc) ?? '';
|
837
|
-
styles = addBaseHrefToCssSourceMap(baseHref, styles);
|
838
|
-
}
|
839
|
-
styles = shimStylesContent(component.id, styles);
|
840
|
-
for (const style of styles) {
|
841
|
-
const styleEl = document.createElement('style');
|
842
|
-
if (nonce) {
|
843
|
-
styleEl.setAttribute('nonce', nonce);
|
844
|
-
}
|
845
|
-
styleEl.textContent = style;
|
846
|
-
this.shadowRoot.appendChild(styleEl);
|
847
|
-
}
|
848
|
-
// Apply any external component styles to the shadow root for the component's element.
|
849
|
-
// The ShadowDOM renderer uses an alternative execution path for component styles that
|
850
|
-
// does not use the SharedStylesHost that other encapsulation modes leverage. Much like
|
851
|
-
// the manual addition of embedded styles directly above, any external stylesheets
|
852
|
-
// must be manually added here to ensure ShadowDOM components are correctly styled.
|
853
|
-
// TODO: Consider reworking the DOM Renderers to consolidate style handling.
|
854
|
-
const styleUrls = component.getExternalStyles?.();
|
855
|
-
if (styleUrls) {
|
856
|
-
for (const styleUrl of styleUrls) {
|
857
|
-
const linkEl = createLinkElement(styleUrl, doc);
|
858
|
-
if (nonce) {
|
859
|
-
linkEl.setAttribute('nonce', nonce);
|
860
|
-
}
|
861
|
-
this.shadowRoot.appendChild(linkEl);
|
862
|
-
}
|
863
|
-
}
|
864
|
-
}
|
865
|
-
nodeOrShadowRoot(node) {
|
866
|
-
return node === this.hostEl ? this.shadowRoot : node;
|
867
|
-
}
|
868
|
-
appendChild(parent, newChild) {
|
869
|
-
return super.appendChild(this.nodeOrShadowRoot(parent), newChild);
|
870
|
-
}
|
871
|
-
insertBefore(parent, newChild, refChild) {
|
872
|
-
return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild);
|
873
|
-
}
|
874
|
-
removeChild(_parent, oldChild) {
|
875
|
-
return super.removeChild(null, oldChild);
|
876
|
-
}
|
877
|
-
parentNode(node) {
|
878
|
-
return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node)));
|
879
|
-
}
|
880
|
-
destroy() {
|
881
|
-
this.sharedStylesHost.removeHost(this.shadowRoot);
|
882
|
-
}
|
883
|
-
}
|
884
|
-
class NoneEncapsulationDomRenderer extends DefaultDomRenderer2 {
|
885
|
-
sharedStylesHost;
|
886
|
-
removeStylesOnCompDestroy;
|
887
|
-
styles;
|
888
|
-
styleUrls;
|
889
|
-
constructor(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, compId) {
|
890
|
-
super(eventManager, doc, ngZone, platformIsServer, tracingService);
|
891
|
-
this.sharedStylesHost = sharedStylesHost;
|
892
|
-
this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
|
893
|
-
let styles = component.styles;
|
894
|
-
if (ngDevMode) {
|
895
|
-
// We only do this in development, as for production users should not add CSS sourcemaps to components.
|
896
|
-
const baseHref = _getDOM().getBaseHref(doc) ?? '';
|
897
|
-
styles = addBaseHrefToCssSourceMap(baseHref, styles);
|
898
|
-
}
|
899
|
-
this.styles = compId ? shimStylesContent(compId, styles) : styles;
|
900
|
-
this.styleUrls = component.getExternalStyles?.(compId);
|
901
|
-
}
|
902
|
-
applyStyles() {
|
903
|
-
this.sharedStylesHost.addStyles(this.styles, this.styleUrls);
|
904
|
-
}
|
905
|
-
destroy() {
|
906
|
-
if (!this.removeStylesOnCompDestroy) {
|
907
|
-
return;
|
908
|
-
}
|
909
|
-
this.sharedStylesHost.removeStyles(this.styles, this.styleUrls);
|
910
|
-
}
|
911
|
-
}
|
912
|
-
class EmulatedEncapsulationDomRenderer2 extends NoneEncapsulationDomRenderer {
|
913
|
-
contentAttr;
|
914
|
-
hostAttr;
|
915
|
-
constructor(eventManager, sharedStylesHost, component, appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService) {
|
916
|
-
const compId = appId + '-' + component.id;
|
917
|
-
super(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, compId);
|
918
|
-
this.contentAttr = shimContentAttribute(compId);
|
919
|
-
this.hostAttr = shimHostAttribute(compId);
|
920
|
-
}
|
921
|
-
applyToHost(element) {
|
922
|
-
this.applyStyles();
|
923
|
-
this.setAttribute(element, this.hostAttr, '');
|
924
|
-
}
|
925
|
-
createElement(parent, name) {
|
926
|
-
const el = super.createElement(parent, name);
|
927
|
-
super.setAttribute(el, this.contentAttr, '');
|
928
|
-
return el;
|
929
|
-
}
|
930
|
-
}
|
931
|
-
|
932
|
-
class DomEventsPlugin extends EventManagerPlugin {
|
933
|
-
constructor(doc) {
|
934
|
-
super(doc);
|
935
|
-
}
|
936
|
-
// This plugin should come last in the list of plugins, because it accepts all
|
937
|
-
// events.
|
938
|
-
supports(eventName) {
|
939
|
-
return true;
|
940
|
-
}
|
941
|
-
addEventListener(element, eventName, handler, options) {
|
942
|
-
element.addEventListener(eventName, handler, options);
|
943
|
-
return () => this.removeEventListener(element, eventName, handler, options);
|
944
|
-
}
|
945
|
-
removeEventListener(target, eventName, callback, options) {
|
946
|
-
return target.removeEventListener(eventName, callback, options);
|
947
|
-
}
|
948
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: DomEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
949
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: DomEventsPlugin });
|
950
|
-
}
|
951
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: DomEventsPlugin, decorators: [{
|
952
|
-
type: Injectable
|
953
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
954
|
-
type: Inject,
|
955
|
-
args: [DOCUMENT]
|
956
|
-
}] }] });
|
957
|
-
|
958
|
-
/**
|
959
|
-
* Defines supported modifiers for key events.
|
960
|
-
*/
|
961
|
-
const MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
|
962
|
-
// The following values are here for cross-browser compatibility and to match the W3C standard
|
963
|
-
// cf https://www.w3.org/TR/DOM-Level-3-Events-key/
|
964
|
-
const _keyMap = {
|
965
|
-
'\b': 'Backspace',
|
966
|
-
'\t': 'Tab',
|
967
|
-
'\x7F': 'Delete',
|
968
|
-
'\x1B': 'Escape',
|
969
|
-
'Del': 'Delete',
|
970
|
-
'Esc': 'Escape',
|
971
|
-
'Left': 'ArrowLeft',
|
972
|
-
'Right': 'ArrowRight',
|
973
|
-
'Up': 'ArrowUp',
|
974
|
-
'Down': 'ArrowDown',
|
975
|
-
'Menu': 'ContextMenu',
|
976
|
-
'Scroll': 'ScrollLock',
|
977
|
-
'Win': 'OS',
|
978
|
-
};
|
979
|
-
/**
|
980
|
-
* Retrieves modifiers from key-event objects.
|
981
|
-
*/
|
982
|
-
const MODIFIER_KEY_GETTERS = {
|
983
|
-
'alt': (event) => event.altKey,
|
984
|
-
'control': (event) => event.ctrlKey,
|
985
|
-
'meta': (event) => event.metaKey,
|
986
|
-
'shift': (event) => event.shiftKey,
|
987
|
-
};
|
988
|
-
/**
|
989
|
-
* A browser plug-in that provides support for handling of key events in Angular.
|
990
|
-
*/
|
991
|
-
class KeyEventsPlugin extends EventManagerPlugin {
|
992
|
-
/**
|
993
|
-
* Initializes an instance of the browser plug-in.
|
994
|
-
* @param doc The document in which key events will be detected.
|
995
|
-
*/
|
996
|
-
constructor(doc) {
|
997
|
-
super(doc);
|
998
|
-
}
|
999
|
-
/**
|
1000
|
-
* Reports whether a named key event is supported.
|
1001
|
-
* @param eventName The event name to query.
|
1002
|
-
* @return True if the named key event is supported.
|
1003
|
-
*/
|
1004
|
-
supports(eventName) {
|
1005
|
-
return KeyEventsPlugin.parseEventName(eventName) != null;
|
1006
|
-
}
|
1007
|
-
/**
|
1008
|
-
* Registers a handler for a specific element and key event.
|
1009
|
-
* @param element The HTML element to receive event notifications.
|
1010
|
-
* @param eventName The name of the key event to listen for.
|
1011
|
-
* @param handler A function to call when the notification occurs. Receives the
|
1012
|
-
* event object as an argument.
|
1013
|
-
* @returns The key event that was registered.
|
1014
|
-
*/
|
1015
|
-
addEventListener(element, eventName, handler, options) {
|
1016
|
-
const parsedEvent = KeyEventsPlugin.parseEventName(eventName);
|
1017
|
-
const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());
|
1018
|
-
return this.manager.getZone().runOutsideAngular(() => {
|
1019
|
-
return _getDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler, options);
|
1020
|
-
});
|
1021
|
-
}
|
1022
|
-
/**
|
1023
|
-
* Parses the user provided full keyboard event definition and normalizes it for
|
1024
|
-
* later internal use. It ensures the string is all lowercase, converts special
|
1025
|
-
* characters to a standard spelling, and orders all the values consistently.
|
1026
|
-
*
|
1027
|
-
* @param eventName The name of the key event to listen for.
|
1028
|
-
* @returns an object with the full, normalized string, and the dom event name
|
1029
|
-
* or null in the case when the event doesn't match a keyboard event.
|
1030
|
-
*/
|
1031
|
-
static parseEventName(eventName) {
|
1032
|
-
const parts = eventName.toLowerCase().split('.');
|
1033
|
-
const domEventName = parts.shift();
|
1034
|
-
if (parts.length === 0 || !(domEventName === 'keydown' || domEventName === 'keyup')) {
|
1035
|
-
return null;
|
1036
|
-
}
|
1037
|
-
const key = KeyEventsPlugin._normalizeKey(parts.pop());
|
1038
|
-
let fullKey = '';
|
1039
|
-
let codeIX = parts.indexOf('code');
|
1040
|
-
if (codeIX > -1) {
|
1041
|
-
parts.splice(codeIX, 1);
|
1042
|
-
fullKey = 'code.';
|
1043
|
-
}
|
1044
|
-
MODIFIER_KEYS.forEach((modifierName) => {
|
1045
|
-
const index = parts.indexOf(modifierName);
|
1046
|
-
if (index > -1) {
|
1047
|
-
parts.splice(index, 1);
|
1048
|
-
fullKey += modifierName + '.';
|
1049
|
-
}
|
1050
|
-
});
|
1051
|
-
fullKey += key;
|
1052
|
-
if (parts.length != 0 || key.length === 0) {
|
1053
|
-
// returning null instead of throwing to let another plugin process the event
|
1054
|
-
return null;
|
1055
|
-
}
|
1056
|
-
// NOTE: Please don't rewrite this as so, as it will break JSCompiler property renaming.
|
1057
|
-
// The code must remain in the `result['domEventName']` form.
|
1058
|
-
// return {domEventName, fullKey};
|
1059
|
-
const result = {};
|
1060
|
-
result['domEventName'] = domEventName;
|
1061
|
-
result['fullKey'] = fullKey;
|
1062
|
-
return result;
|
1063
|
-
}
|
1064
|
-
/**
|
1065
|
-
* Determines whether the actual keys pressed match the configured key code string.
|
1066
|
-
* The `fullKeyCode` event is normalized in the `parseEventName` method when the
|
1067
|
-
* event is attached to the DOM during the `addEventListener` call. This is unseen
|
1068
|
-
* by the end user and is normalized for internal consistency and parsing.
|
1069
|
-
*
|
1070
|
-
* @param event The keyboard event.
|
1071
|
-
* @param fullKeyCode The normalized user defined expected key event string
|
1072
|
-
* @returns boolean.
|
1073
|
-
*/
|
1074
|
-
static matchEventFullKeyCode(event, fullKeyCode) {
|
1075
|
-
let keycode = _keyMap[event.key] || event.key;
|
1076
|
-
let key = '';
|
1077
|
-
if (fullKeyCode.indexOf('code.') > -1) {
|
1078
|
-
keycode = event.code;
|
1079
|
-
key = 'code.';
|
1080
|
-
}
|
1081
|
-
// the keycode could be unidentified so we have to check here
|
1082
|
-
if (keycode == null || !keycode)
|
1083
|
-
return false;
|
1084
|
-
keycode = keycode.toLowerCase();
|
1085
|
-
if (keycode === ' ') {
|
1086
|
-
keycode = 'space'; // for readability
|
1087
|
-
}
|
1088
|
-
else if (keycode === '.') {
|
1089
|
-
keycode = 'dot'; // because '.' is used as a separator in event names
|
1090
|
-
}
|
1091
|
-
MODIFIER_KEYS.forEach((modifierName) => {
|
1092
|
-
if (modifierName !== keycode) {
|
1093
|
-
const modifierGetter = MODIFIER_KEY_GETTERS[modifierName];
|
1094
|
-
if (modifierGetter(event)) {
|
1095
|
-
key += modifierName + '.';
|
1096
|
-
}
|
1097
|
-
}
|
1098
|
-
});
|
1099
|
-
key += keycode;
|
1100
|
-
return key === fullKeyCode;
|
1101
|
-
}
|
1102
|
-
/**
|
1103
|
-
* Configures a handler callback for a key event.
|
1104
|
-
* @param fullKey The event name that combines all simultaneous keystrokes.
|
1105
|
-
* @param handler The function that responds to the key event.
|
1106
|
-
* @param zone The zone in which the event occurred.
|
1107
|
-
* @returns A callback function.
|
1108
|
-
*/
|
1109
|
-
static eventCallback(fullKey, handler, zone) {
|
1110
|
-
return (event) => {
|
1111
|
-
if (KeyEventsPlugin.matchEventFullKeyCode(event, fullKey)) {
|
1112
|
-
zone.runGuarded(() => handler(event));
|
1113
|
-
}
|
1114
|
-
};
|
1115
|
-
}
|
1116
|
-
/** @internal */
|
1117
|
-
static _normalizeKey(keyName) {
|
1118
|
-
return keyName === 'esc' ? 'escape' : keyName;
|
1119
|
-
}
|
1120
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: KeyEventsPlugin, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
1121
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: KeyEventsPlugin });
|
1122
|
-
}
|
1123
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: KeyEventsPlugin, decorators: [{
|
1124
|
-
type: Injectable
|
1125
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
1126
|
-
type: Inject,
|
1127
|
-
args: [DOCUMENT]
|
1128
|
-
}] }] });
|
1129
|
-
|
1130
|
-
/**
|
1131
|
-
* Bootstraps an instance of an Angular application and renders a standalone component as the
|
1132
|
-
* application's root component. More information about standalone components can be found in [this
|
1133
|
-
* guide](guide/components/importing).
|
1134
|
-
*
|
1135
|
-
* @usageNotes
|
1136
|
-
* The root component passed into this function *must* be a standalone one (should have the
|
1137
|
-
* `standalone: true` flag in the `@Component` decorator config).
|
1138
|
-
*
|
1139
|
-
* ```angular-ts
|
1140
|
-
* @Component({
|
1141
|
-
* standalone: true,
|
1142
|
-
* template: 'Hello world!'
|
1143
|
-
* })
|
1144
|
-
* class RootComponent {}
|
1145
|
-
*
|
1146
|
-
* const appRef: ApplicationRef = await bootstrapApplication(RootComponent);
|
1147
|
-
* ```
|
1148
|
-
*
|
1149
|
-
* You can add the list of providers that should be available in the application injector by
|
1150
|
-
* specifying the `providers` field in an object passed as the second argument:
|
1151
|
-
*
|
1152
|
-
* ```ts
|
1153
|
-
* await bootstrapApplication(RootComponent, {
|
1154
|
-
* providers: [
|
1155
|
-
* {provide: BACKEND_URL, useValue: 'https://yourdomain.com/api'}
|
1156
|
-
* ]
|
1157
|
-
* });
|
1158
|
-
* ```
|
1159
|
-
*
|
1160
|
-
* The `importProvidersFrom` helper method can be used to collect all providers from any
|
1161
|
-
* existing NgModule (and transitively from all NgModules that it imports):
|
1162
|
-
*
|
1163
|
-
* ```ts
|
1164
|
-
* await bootstrapApplication(RootComponent, {
|
1165
|
-
* providers: [
|
1166
|
-
* importProvidersFrom(SomeNgModule)
|
1167
|
-
* ]
|
1168
|
-
* });
|
1169
|
-
* ```
|
1170
|
-
*
|
1171
|
-
* Note: the `bootstrapApplication` method doesn't include [Testability](api/core/Testability) by
|
1172
|
-
* default. You can add [Testability](api/core/Testability) by getting the list of necessary
|
1173
|
-
* providers using `provideProtractorTestingSupport()` function and adding them into the `providers`
|
1174
|
-
* array, for example:
|
1175
|
-
*
|
1176
|
-
* ```ts
|
1177
|
-
* import {provideProtractorTestingSupport} from '@angular/platform-browser';
|
1178
|
-
*
|
1179
|
-
* await bootstrapApplication(RootComponent, {providers: [provideProtractorTestingSupport()]});
|
1180
|
-
* ```
|
1181
|
-
*
|
1182
|
-
* @param rootComponent A reference to a standalone component that should be rendered.
|
1183
|
-
* @param options Extra configuration for the bootstrap operation, see `ApplicationConfig` for
|
1184
|
-
* additional info.
|
1185
|
-
* @returns A promise that returns an `ApplicationRef` instance once resolved.
|
1186
|
-
*
|
1187
|
-
* @publicApi
|
1188
|
-
*/
|
1189
|
-
function bootstrapApplication(rootComponent, options) {
|
1190
|
-
return _internalCreateApplication({ rootComponent, ...createProvidersConfig(options) });
|
1191
|
-
}
|
1192
|
-
/**
|
1193
|
-
* Create an instance of an Angular application without bootstrapping any components. This is useful
|
1194
|
-
* for the situation where one wants to decouple application environment creation (a platform and
|
1195
|
-
* associated injectors) from rendering components on a screen. Components can be subsequently
|
1196
|
-
* bootstrapped on the returned `ApplicationRef`.
|
1197
|
-
*
|
1198
|
-
* @param options Extra configuration for the application environment, see `ApplicationConfig` for
|
1199
|
-
* additional info.
|
1200
|
-
* @returns A promise that returns an `ApplicationRef` instance once resolved.
|
1201
|
-
*
|
1202
|
-
* @publicApi
|
1203
|
-
*/
|
1204
|
-
function createApplication(options) {
|
1205
|
-
return _internalCreateApplication(createProvidersConfig(options));
|
1206
|
-
}
|
1207
|
-
function createProvidersConfig(options) {
|
1208
|
-
return {
|
1209
|
-
appProviders: [...BROWSER_MODULE_PROVIDERS, ...(options?.providers ?? [])],
|
1210
|
-
platformProviders: INTERNAL_BROWSER_PLATFORM_PROVIDERS,
|
1211
|
-
};
|
1212
|
-
}
|
1213
|
-
/**
|
1214
|
-
* Returns a set of providers required to setup [Testability](api/core/Testability) for an
|
1215
|
-
* application bootstrapped using the `bootstrapApplication` function. The set of providers is
|
1216
|
-
* needed to support testing an application with Protractor (which relies on the Testability APIs
|
1217
|
-
* to be present).
|
1218
|
-
*
|
1219
|
-
* @returns An array of providers required to setup Testability for an application and make it
|
1220
|
-
* available for testing using Protractor.
|
1221
|
-
*
|
1222
|
-
* @publicApi
|
1223
|
-
*/
|
1224
|
-
function provideProtractorTestingSupport() {
|
1225
|
-
// Return a copy to prevent changes to the original array in case any in-place
|
1226
|
-
// alterations are performed to the `provideProtractorTestingSupport` call results in app
|
1227
|
-
// code.
|
1228
|
-
return [...TESTABILITY_PROVIDERS];
|
1229
|
-
}
|
1230
|
-
function initDomAdapter() {
|
1231
|
-
BrowserDomAdapter.makeCurrent();
|
1232
|
-
}
|
1233
|
-
function errorHandler() {
|
1234
|
-
return new ErrorHandler();
|
1235
|
-
}
|
1236
|
-
function _document() {
|
1237
|
-
// Tell ivy about the global document
|
1238
|
-
_setDocument(document);
|
1239
|
-
return document;
|
1240
|
-
}
|
1241
|
-
const INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
|
1242
|
-
{ provide: PLATFORM_ID, useValue: _PLATFORM_BROWSER_ID },
|
1243
|
-
{ provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true },
|
1244
|
-
{ provide: DOCUMENT, useFactory: _document, deps: [] },
|
1245
|
-
];
|
1246
|
-
/**
|
1247
|
-
* A factory function that returns a `PlatformRef` instance associated with browser service
|
1248
|
-
* providers.
|
1249
|
-
*
|
1250
|
-
* @publicApi
|
1251
|
-
*/
|
1252
|
-
const platformBrowser = createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
|
1253
|
-
/**
|
1254
|
-
* Internal marker to signal whether providers from the `BrowserModule` are already present in DI.
|
1255
|
-
* This is needed to avoid loading `BrowserModule` providers twice. We can't rely on the
|
1256
|
-
* `BrowserModule` presence itself, since the standalone-based bootstrap just imports
|
1257
|
-
* `BrowserModule` providers without referencing the module itself.
|
1258
|
-
*/
|
1259
|
-
const BROWSER_MODULE_PROVIDERS_MARKER = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'BrowserModule Providers Marker' : '');
|
1260
|
-
const TESTABILITY_PROVIDERS = [
|
1261
|
-
{
|
1262
|
-
provide: _TESTABILITY_GETTER,
|
1263
|
-
useClass: BrowserGetTestability,
|
1264
|
-
deps: [],
|
1265
|
-
},
|
1266
|
-
{
|
1267
|
-
provide: _TESTABILITY,
|
1268
|
-
useClass: Testability,
|
1269
|
-
deps: [NgZone, TestabilityRegistry, _TESTABILITY_GETTER],
|
1270
|
-
},
|
1271
|
-
{
|
1272
|
-
provide: Testability, // Also provide as `Testability` for backwards-compatibility.
|
1273
|
-
useClass: Testability,
|
1274
|
-
deps: [NgZone, TestabilityRegistry, _TESTABILITY_GETTER],
|
1275
|
-
},
|
1276
|
-
];
|
1277
|
-
const BROWSER_MODULE_PROVIDERS = [
|
1278
|
-
{ provide: _INJECTOR_SCOPE, useValue: 'root' },
|
1279
|
-
{ provide: ErrorHandler, useFactory: errorHandler, deps: [] },
|
1280
|
-
{
|
1281
|
-
provide: EVENT_MANAGER_PLUGINS,
|
1282
|
-
useClass: DomEventsPlugin,
|
1283
|
-
multi: true,
|
1284
|
-
deps: [DOCUMENT],
|
1285
|
-
},
|
1286
|
-
{ provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [DOCUMENT] },
|
1287
|
-
DomRendererFactory2,
|
1288
|
-
SharedStylesHost,
|
1289
|
-
EventManager,
|
1290
|
-
{ provide: RendererFactory2, useExisting: DomRendererFactory2 },
|
1291
|
-
{ provide: XhrFactory, useClass: BrowserXhr, deps: [] },
|
1292
|
-
typeof ngDevMode === 'undefined' || ngDevMode
|
1293
|
-
? { provide: BROWSER_MODULE_PROVIDERS_MARKER, useValue: true }
|
1294
|
-
: [],
|
1295
|
-
];
|
1296
|
-
/**
|
1297
|
-
* Exports required infrastructure for all Angular apps.
|
1298
|
-
* Included by default in all Angular apps created with the CLI
|
1299
|
-
* `new` command.
|
1300
|
-
* Re-exports `CommonModule` and `ApplicationModule`, making their
|
1301
|
-
* exports and providers available to all apps.
|
1302
|
-
*
|
1303
|
-
* @publicApi
|
1304
|
-
*/
|
1305
|
-
class BrowserModule {
|
1306
|
-
constructor() {
|
1307
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
1308
|
-
const providersAlreadyPresent = inject(BROWSER_MODULE_PROVIDERS_MARKER, {
|
1309
|
-
optional: true,
|
1310
|
-
skipSelf: true,
|
1311
|
-
});
|
1312
|
-
if (providersAlreadyPresent) {
|
1313
|
-
throw new _RuntimeError(5100 /* RuntimeErrorCode.BROWSER_MODULE_ALREADY_LOADED */, `Providers from the \`BrowserModule\` have already been loaded. If you need access ` +
|
1314
|
-
`to common directives such as NgIf and NgFor, import the \`CommonModule\` instead.`);
|
1315
|
-
}
|
1316
|
-
}
|
1317
|
-
}
|
1318
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: BrowserModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1319
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.4", ngImport: i0, type: BrowserModule, exports: [CommonModule, ApplicationModule] });
|
1320
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: BrowserModule, providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS], imports: [CommonModule, ApplicationModule] });
|
1321
|
-
}
|
1322
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: BrowserModule, decorators: [{
|
1323
|
-
type: NgModule,
|
1324
|
-
args: [{
|
1325
|
-
providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS],
|
1326
|
-
exports: [CommonModule, ApplicationModule],
|
1327
|
-
}]
|
1328
|
-
}], ctorParameters: () => [] });
|
1329
|
-
|
1330
16
|
/**
|
1331
17
|
* A service for managing HTML `<meta>` tags.
|
1332
18
|
*
|
@@ -1478,10 +164,10 @@ class Meta {
|
|
1478
164
|
_getMetaKeyMap(prop) {
|
1479
165
|
return META_KEYS_MAP[prop] || prop;
|
1480
166
|
}
|
1481
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.
|
1482
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.
|
167
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: Meta, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
168
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: Meta, providedIn: 'root' });
|
1483
169
|
}
|
1484
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.
|
170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: Meta, decorators: [{
|
1485
171
|
type: Injectable,
|
1486
172
|
args: [{ providedIn: 'root' }]
|
1487
173
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
@@ -1523,10 +209,10 @@ class Title {
|
|
1523
209
|
setTitle(newTitle) {
|
1524
210
|
this._doc.title = newTitle || '';
|
1525
211
|
}
|
1526
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.
|
1527
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.
|
212
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: Title, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
213
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: Title, providedIn: 'root' });
|
1528
214
|
}
|
1529
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: Title, decorators: [{
|
1530
216
|
type: Injectable,
|
1531
217
|
args: [{ providedIn: 'root' }]
|
1532
218
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
@@ -1805,10 +491,10 @@ class HammerGestureConfig {
|
|
1805
491
|
}
|
1806
492
|
return mc;
|
1807
493
|
}
|
1808
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.
|
1809
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.
|
494
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: HammerGestureConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
495
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: HammerGestureConfig });
|
1810
496
|
}
|
1811
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.
|
497
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: HammerGestureConfig, decorators: [{
|
1812
498
|
type: Injectable
|
1813
499
|
}] });
|
1814
500
|
/**
|
@@ -1909,10 +595,10 @@ class HammerGesturesPlugin extends EventManagerPlugin {
|
|
1909
595
|
isCustomEvent(eventName) {
|
1910
596
|
return this._config.events.indexOf(eventName) > -1;
|
1911
597
|
}
|
1912
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.
|
1913
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.
|
598
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: HammerGesturesPlugin, deps: [{ token: DOCUMENT }, { token: HAMMER_GESTURE_CONFIG }, { token: i0.Injector }, { token: HAMMER_LOADER, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
599
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: HammerGesturesPlugin });
|
1914
600
|
}
|
1915
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.
|
601
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: HammerGesturesPlugin, decorators: [{
|
1916
602
|
type: Injectable
|
1917
603
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
1918
604
|
type: Inject,
|
@@ -1940,19 +626,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4",
|
|
1940
626
|
* @deprecated The hammer integration is deprecated. Replace it by your own implementation.
|
1941
627
|
*/
|
1942
628
|
class HammerModule {
|
1943
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.
|
1944
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.
|
1945
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.
|
629
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: HammerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
630
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0-next.6", ngImport: i0, type: HammerModule });
|
631
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: HammerModule, providers: [
|
1946
632
|
{
|
1947
633
|
provide: EVENT_MANAGER_PLUGINS,
|
1948
634
|
useClass: HammerGesturesPlugin,
|
1949
635
|
multi: true,
|
1950
636
|
deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, Injector, [new Optional(), HAMMER_LOADER]],
|
1951
637
|
},
|
1952
|
-
{ provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig
|
638
|
+
{ provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig },
|
1953
639
|
] });
|
1954
640
|
}
|
1955
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.
|
641
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: HammerModule, decorators: [{
|
1956
642
|
type: NgModule,
|
1957
643
|
args: [{
|
1958
644
|
providers: [
|
@@ -1962,7 +648,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4",
|
|
1962
648
|
multi: true,
|
1963
649
|
deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, Injector, [new Optional(), HAMMER_LOADER]],
|
1964
650
|
},
|
1965
|
-
{ provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig
|
651
|
+
{ provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig },
|
1966
652
|
],
|
1967
653
|
}]
|
1968
654
|
}] });
|
@@ -1999,10 +685,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4",
|
|
1999
685
|
* @publicApi
|
2000
686
|
*/
|
2001
687
|
class DomSanitizer {
|
2002
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.
|
2003
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.
|
688
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: DomSanitizer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
689
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: DomSanitizer, providedIn: 'root', useExisting: i0.forwardRef(() => DomSanitizerImpl) });
|
2004
690
|
}
|
2005
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.
|
691
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: DomSanitizer, decorators: [{
|
2006
692
|
type: Injectable,
|
2007
693
|
args: [{ providedIn: 'root', useExisting: forwardRef(() => DomSanitizerImpl) }]
|
2008
694
|
}] });
|
@@ -2065,10 +751,10 @@ class DomSanitizerImpl extends DomSanitizer {
|
|
2065
751
|
bypassSecurityTrustResourceUrl(value) {
|
2066
752
|
return _bypassSanitizationTrustResourceUrl(value);
|
2067
753
|
}
|
2068
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.
|
2069
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.
|
754
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: DomSanitizerImpl, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
755
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: DomSanitizerImpl, providedIn: 'root' });
|
2070
756
|
}
|
2071
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.
|
757
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: DomSanitizerImpl, decorators: [{
|
2072
758
|
type: Injectable,
|
2073
759
|
args: [{ providedIn: 'root' }]
|
2074
760
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
@@ -2245,13 +931,13 @@ function provideZoneJsCompatibilityDetector() {
|
|
2245
931
|
function provideClientHydration(...features) {
|
2246
932
|
const providers = [];
|
2247
933
|
const featuresKind = new Set();
|
2248
|
-
const hasHttpTransferCacheOptions = featuresKind.has(HydrationFeatureKind.HttpTransferCacheOptions);
|
2249
934
|
for (const { ɵproviders, ɵkind } of features) {
|
2250
935
|
featuresKind.add(ɵkind);
|
2251
936
|
if (ɵproviders.length) {
|
2252
937
|
providers.push(ɵproviders);
|
2253
938
|
}
|
2254
939
|
}
|
940
|
+
const hasHttpTransferCacheOptions = featuresKind.has(HydrationFeatureKind.HttpTransferCacheOptions);
|
2255
941
|
if (typeof ngDevMode !== 'undefined' &&
|
2256
942
|
ngDevMode &&
|
2257
943
|
featuresKind.has(HydrationFeatureKind.NoHttpTransferCache) &&
|
@@ -2277,7 +963,7 @@ function provideClientHydration(...features) {
|
|
2277
963
|
/**
|
2278
964
|
* @publicApi
|
2279
965
|
*/
|
2280
|
-
const VERSION = new Version('20.0.0-next.
|
966
|
+
const VERSION = new Version('20.0.0-next.6');
|
2281
967
|
|
2282
|
-
export {
|
968
|
+
export { By, DomSanitizer, EVENT_MANAGER_PLUGINS, EventManagerPlugin, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, HammerModule, HydrationFeatureKind, Meta, Title, VERSION, disableDebugTools, enableDebugTools, provideClientHydration, withEventReplay, withHttpTransferCacheOptions, withI18nSupport, withIncrementalHydration, withNoHttpTransferCache, DomSanitizerImpl as ɵDomSanitizerImpl, HammerGesturesPlugin as ɵHammerGesturesPlugin };
|
2283
969
|
//# sourceMappingURL=platform-browser.mjs.map
|