@angular/core 14.2.0-next.0 → 14.2.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/esm2020/src/application_ref.mjs +2 -2
- package/esm2020/src/core_private_export.mjs +2 -2
- package/esm2020/src/core_render3_private_export.mjs +4 -4
- package/esm2020/src/di/interface/defs.mjs +4 -1
- package/esm2020/src/linker/template_ref.mjs +1 -1
- package/esm2020/src/render3/component_ref.mjs +4 -31
- package/esm2020/src/render3/definition.mjs +5 -5
- package/esm2020/src/render3/index.mjs +4 -4
- package/esm2020/src/render3/instructions/change_detection.mjs +3 -19
- package/esm2020/src/render3/instructions/shared.mjs +10 -50
- package/esm2020/src/render3/interfaces/view.mjs +1 -1
- package/esm2020/src/render3/jit/module.mjs +2 -6
- package/esm2020/src/render3/util/change_detection_utils.mjs +7 -3
- package/esm2020/src/render3/util/misc_utils.mjs +1 -7
- package/esm2020/src/sanitization/url_sanitizer.mjs +3 -7
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/esm2020/testing/src/resolvers.mjs +1 -1
- package/fesm2015/core.mjs +25 -114
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +22 -112
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +25 -114
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +22 -112
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +10 -99
- package/package.json +1 -1
- package/testing/index.d.ts +1 -1
- package/esm2020/src/render3/interfaces/player.mjs +0 -9
package/fesm2015/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.2.0
|
|
2
|
+
* @license Angular v14.2.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -835,6 +835,9 @@ function ɵɵdefineInjector(options) {
|
|
|
835
835
|
function getInjectableDef(type) {
|
|
836
836
|
return getOwnDefinition(type, NG_PROV_DEF) || getOwnDefinition(type, NG_INJECTABLE_DEF);
|
|
837
837
|
}
|
|
838
|
+
function isInjectable(type) {
|
|
839
|
+
return getInjectableDef(type) !== null;
|
|
840
|
+
}
|
|
838
841
|
/**
|
|
839
842
|
* Return definition only if it is defined directly on `type` and is not inherited from a base
|
|
840
843
|
* class of `type`.
|
|
@@ -2605,7 +2608,6 @@ function extractDirectiveDef(type) {
|
|
|
2605
2608
|
function nonNull(value) {
|
|
2606
2609
|
return value !== null;
|
|
2607
2610
|
}
|
|
2608
|
-
const autoRegisterModuleById = {};
|
|
2609
2611
|
/**
|
|
2610
2612
|
* @codeGenApi
|
|
2611
2613
|
*/
|
|
@@ -2621,9 +2623,6 @@ function ɵɵdefineNgModule(def) {
|
|
|
2621
2623
|
schemas: def.schemas || null,
|
|
2622
2624
|
id: def.id || null,
|
|
2623
2625
|
};
|
|
2624
|
-
if (def.id != null) {
|
|
2625
|
-
autoRegisterModuleById[def.id] = def.type;
|
|
2626
|
-
}
|
|
2627
2626
|
return res;
|
|
2628
2627
|
});
|
|
2629
2628
|
}
|
|
@@ -2777,6 +2776,10 @@ function getDirectiveDef(type) {
|
|
|
2777
2776
|
function getPipeDef$1(type) {
|
|
2778
2777
|
return type[NG_PIPE_DEF] || null;
|
|
2779
2778
|
}
|
|
2779
|
+
function isStandalone(type) {
|
|
2780
|
+
const def = getComponentDef$1(type) || getDirectiveDef(type) || getPipeDef$1(type);
|
|
2781
|
+
return def !== null ? def.standalone : false;
|
|
2782
|
+
}
|
|
2780
2783
|
function getNgModuleDef(type, throwNotFound) {
|
|
2781
2784
|
const ngModuleDef = type[NG_MOD_DEF] || null;
|
|
2782
2785
|
if (!ngModuleDef && throwNotFound === true) {
|
|
@@ -5502,11 +5505,6 @@ function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {
|
|
|
5502
5505
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5503
5506
|
* found in the LICENSE file at https://angular.io/license
|
|
5504
5507
|
*/
|
|
5505
|
-
const defaultScheduler = (() => (typeof requestAnimationFrame !== 'undefined' &&
|
|
5506
|
-
requestAnimationFrame || // browser only
|
|
5507
|
-
setTimeout // everything else
|
|
5508
|
-
)
|
|
5509
|
-
.bind(_global$1))();
|
|
5510
5508
|
/**
|
|
5511
5509
|
*
|
|
5512
5510
|
* @codeGenApi
|
|
@@ -6093,14 +6091,10 @@ function isDOMParserAvailable() {
|
|
|
6093
6091
|
*
|
|
6094
6092
|
* This regular expression was taken from the Closure sanitization library.
|
|
6095
6093
|
*/
|
|
6096
|
-
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;
|
|
6097
|
-
/* A pattern that matches safe srcset values */
|
|
6098
|
-
const SAFE_SRCSET_PATTERN = /^(?:(?:https?|file):|[^&:/?#]*(?:[/?#]|$))/gi;
|
|
6099
|
-
/** A pattern that matches safe data URLs. Only matches image, video and audio types. */
|
|
6100
|
-
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;
|
|
6094
|
+
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|data|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;
|
|
6101
6095
|
function _sanitizeUrl(url) {
|
|
6102
6096
|
url = String(url);
|
|
6103
|
-
if (url.match(SAFE_URL_PATTERN)
|
|
6097
|
+
if (url.match(SAFE_URL_PATTERN))
|
|
6104
6098
|
return url;
|
|
6105
6099
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
6106
6100
|
console.warn(`WARNING: sanitizing unsafe URL value ${url} (see https://g.co/ng/security#xss)`);
|
|
@@ -7649,7 +7643,7 @@ class Version {
|
|
|
7649
7643
|
/**
|
|
7650
7644
|
* @publicApi
|
|
7651
7645
|
*/
|
|
7652
|
-
const VERSION = new Version('14.2.0
|
|
7646
|
+
const VERSION = new Version('14.2.0');
|
|
7653
7647
|
|
|
7654
7648
|
/**
|
|
7655
7649
|
* @license
|
|
@@ -12047,11 +12041,6 @@ class LContainerDebug {
|
|
|
12047
12041
|
* Use of this source code is governed by an MIT-style license that can be
|
|
12048
12042
|
* found in the LICENSE file at https://angular.io/license
|
|
12049
12043
|
*/
|
|
12050
|
-
/**
|
|
12051
|
-
* A permanent marker promise which signifies that the current CD tree is
|
|
12052
|
-
* clean.
|
|
12053
|
-
*/
|
|
12054
|
-
const _CLEAN_PROMISE = (() => Promise.resolve(null))();
|
|
12055
12044
|
/**
|
|
12056
12045
|
* Invoke `HostBindingsFunction`s for view.
|
|
12057
12046
|
*
|
|
@@ -13432,13 +13421,15 @@ function refreshContainsDirtyView(lView) {
|
|
|
13432
13421
|
for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
|
|
13433
13422
|
for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
|
|
13434
13423
|
const embeddedLView = lContainer[i];
|
|
13435
|
-
if (embeddedLView
|
|
13436
|
-
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13441
|
-
|
|
13424
|
+
if (viewAttachedToChangeDetector(embeddedLView)) {
|
|
13425
|
+
if (embeddedLView[FLAGS] & 512 /* LViewFlags.RefreshTransplantedView */) {
|
|
13426
|
+
const embeddedTView = embeddedLView[TVIEW];
|
|
13427
|
+
ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');
|
|
13428
|
+
refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);
|
|
13429
|
+
}
|
|
13430
|
+
else if (embeddedLView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {
|
|
13431
|
+
refreshContainsDirtyView(embeddedLView);
|
|
13432
|
+
}
|
|
13442
13433
|
}
|
|
13443
13434
|
}
|
|
13444
13435
|
}
|
|
@@ -13547,42 +13538,6 @@ function markViewDirty(lView) {
|
|
|
13547
13538
|
}
|
|
13548
13539
|
return null;
|
|
13549
13540
|
}
|
|
13550
|
-
/**
|
|
13551
|
-
* Used to schedule change detection on the whole application.
|
|
13552
|
-
*
|
|
13553
|
-
* Unlike `tick`, `scheduleTick` coalesces multiple calls into one change detection run.
|
|
13554
|
-
* It is usually called indirectly by calling `markDirty` when the view needs to be
|
|
13555
|
-
* re-rendered.
|
|
13556
|
-
*
|
|
13557
|
-
* Typically `scheduleTick` uses `requestAnimationFrame` to coalesce multiple
|
|
13558
|
-
* `scheduleTick` requests. The scheduling function can be overridden in
|
|
13559
|
-
* `renderComponent`'s `scheduler` option.
|
|
13560
|
-
*/
|
|
13561
|
-
function scheduleTick(rootContext, flags) {
|
|
13562
|
-
const nothingScheduled = rootContext.flags === 0 /* RootContextFlags.Empty */;
|
|
13563
|
-
if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {
|
|
13564
|
-
// https://github.com/angular/angular/issues/39296
|
|
13565
|
-
// should only attach the flags when really scheduling a tick
|
|
13566
|
-
rootContext.flags |= flags;
|
|
13567
|
-
let res;
|
|
13568
|
-
rootContext.clean = new Promise((r) => res = r);
|
|
13569
|
-
rootContext.scheduler(() => {
|
|
13570
|
-
if (rootContext.flags & 1 /* RootContextFlags.DetectChanges */) {
|
|
13571
|
-
rootContext.flags &= ~1 /* RootContextFlags.DetectChanges */;
|
|
13572
|
-
tickRootContext(rootContext);
|
|
13573
|
-
}
|
|
13574
|
-
if (rootContext.flags & 2 /* RootContextFlags.FlushPlayers */) {
|
|
13575
|
-
rootContext.flags &= ~2 /* RootContextFlags.FlushPlayers */;
|
|
13576
|
-
const playerHandler = rootContext.playerHandler;
|
|
13577
|
-
if (playerHandler) {
|
|
13578
|
-
playerHandler.flushPlayers();
|
|
13579
|
-
}
|
|
13580
|
-
}
|
|
13581
|
-
rootContext.clean = _CLEAN_PROMISE;
|
|
13582
|
-
res(null);
|
|
13583
|
-
});
|
|
13584
|
-
}
|
|
13585
|
-
}
|
|
13586
13541
|
function tickRootContext(rootContext) {
|
|
13587
13542
|
for (let i = 0; i < rootContext.components.length; i++) {
|
|
13588
13543
|
const rootComponent = rootContext.components[i];
|
|
@@ -13691,7 +13646,6 @@ function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex,
|
|
|
13691
13646
|
}
|
|
13692
13647
|
}
|
|
13693
13648
|
}
|
|
13694
|
-
const CLEAN_PROMISE = _CLEAN_PROMISE;
|
|
13695
13649
|
function getOrCreateLViewCleanup(view) {
|
|
13696
13650
|
// top level variables should not be exported for performance reasons (PERF_NOTES.md)
|
|
13697
13651
|
return view[CLEANUP] || (view[CLEANUP] = ngDevMode ? new LCleanup() : []);
|
|
@@ -14450,14 +14404,8 @@ function createRootComponent(componentView, componentDef, rootLView, rootContext
|
|
|
14450
14404
|
}
|
|
14451
14405
|
return component;
|
|
14452
14406
|
}
|
|
14453
|
-
function createRootContext(
|
|
14454
|
-
return {
|
|
14455
|
-
components: [],
|
|
14456
|
-
scheduler: scheduler || defaultScheduler,
|
|
14457
|
-
clean: CLEAN_PROMISE,
|
|
14458
|
-
playerHandler: playerHandler || null,
|
|
14459
|
-
flags: 0 /* RootContextFlags.Empty */
|
|
14460
|
-
};
|
|
14407
|
+
function createRootContext() {
|
|
14408
|
+
return { components: [] };
|
|
14461
14409
|
}
|
|
14462
14410
|
/**
|
|
14463
14411
|
* Used to enable lifecycle hooks on the root component.
|
|
@@ -14477,25 +14425,6 @@ function LifecycleHooksFeature() {
|
|
|
14477
14425
|
ngDevMode && assertDefined(tNode, 'TNode is required');
|
|
14478
14426
|
registerPostOrderHooks(getLView()[TVIEW], tNode);
|
|
14479
14427
|
}
|
|
14480
|
-
/**
|
|
14481
|
-
* Wait on component until it is rendered.
|
|
14482
|
-
*
|
|
14483
|
-
* This function returns a `Promise` which is resolved when the component's
|
|
14484
|
-
* change detection is executed. This is determined by finding the scheduler
|
|
14485
|
-
* associated with the `component`'s render tree and waiting until the scheduler
|
|
14486
|
-
* flushes. If nothing is scheduled, the function returns a resolved promise.
|
|
14487
|
-
*
|
|
14488
|
-
* Example:
|
|
14489
|
-
* ```
|
|
14490
|
-
* await whenRendered(myComponent);
|
|
14491
|
-
* ```
|
|
14492
|
-
*
|
|
14493
|
-
* @param component Component to wait upon
|
|
14494
|
-
* @returns Promise which resolves when the component is rendered.
|
|
14495
|
-
*/
|
|
14496
|
-
function whenRendered(component) {
|
|
14497
|
-
return getRootContext(component).clean;
|
|
14498
|
-
}
|
|
14499
14428
|
|
|
14500
14429
|
/**
|
|
14501
14430
|
* @license
|
|
@@ -15480,21 +15409,6 @@ function detectChanges(component) {
|
|
|
15480
15409
|
const view = getComponentViewByInstance(component);
|
|
15481
15410
|
detectChangesInternal(view[TVIEW], view, component);
|
|
15482
15411
|
}
|
|
15483
|
-
/**
|
|
15484
|
-
* Marks the component as dirty (needing change detection). Marking a component dirty will
|
|
15485
|
-
* schedule a change detection on it at some point in the future.
|
|
15486
|
-
*
|
|
15487
|
-
* Marking an already dirty component as dirty won't do anything. Only one outstanding change
|
|
15488
|
-
* detection can be scheduled per component tree.
|
|
15489
|
-
*
|
|
15490
|
-
* @param component Component to mark as dirty.
|
|
15491
|
-
*/
|
|
15492
|
-
function markDirty(component) {
|
|
15493
|
-
ngDevMode && assertDefined(component, 'component');
|
|
15494
|
-
const rootView = markViewDirty(getComponentViewByInstance(component));
|
|
15495
|
-
ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
|
|
15496
|
-
scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
|
|
15497
|
-
}
|
|
15498
15412
|
|
|
15499
15413
|
/**
|
|
15500
15414
|
* @license
|
|
@@ -24657,10 +24571,6 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
|
|
|
24657
24571
|
configurable: !!ngDevMode,
|
|
24658
24572
|
});
|
|
24659
24573
|
}
|
|
24660
|
-
function isStandalone(type) {
|
|
24661
|
-
const def = getComponentDef$1(type) || getDirectiveDef(type) || getPipeDef$1(type);
|
|
24662
|
-
return def !== null ? def.standalone : false;
|
|
24663
|
-
}
|
|
24664
24574
|
function generateStandaloneInDeclarationsError(type, location) {
|
|
24665
24575
|
const prefix = `Unexpected "${stringifyForError(type)}" found in the "declarations" array of the`;
|
|
24666
24576
|
const suffix = `"${stringifyForError(type)}" is marked as standalone and can't be declared ` +
|