@angular/core 21.2.0 → 21.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/_attribute-chunk.mjs +1 -1
- package/fesm2022/_debug_node-chunk.mjs +54 -16
- package/fesm2022/_debug_node-chunk.mjs.map +1 -1
- package/fesm2022/_effect-chunk.mjs +1 -1
- package/fesm2022/_effect-chunk2.mjs +2 -2
- package/fesm2022/_effect-chunk2.mjs.map +1 -1
- package/fesm2022/_not_found-chunk.mjs +1 -1
- package/fesm2022/_resource-chunk.mjs +7 -4
- package/fesm2022/_resource-chunk.mjs.map +1 -1
- package/fesm2022/_untracked-chunk.mjs +1 -1
- package/fesm2022/_weak_ref-chunk.mjs +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives-di.mjs +1 -1
- package/fesm2022/primitives-event-dispatch.mjs +1 -1
- package/fesm2022/primitives-signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/package.json +2 -2
- package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +1 -1
- package/schematics/bundles/application-config-core.cjs +1 -1
- package/schematics/bundles/apply_import_manager-CxA_YYgB.cjs +1 -1
- package/schematics/bundles/bootstrap-options-migration.cjs +1 -1
- package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
- package/schematics/bundles/common-to-standalone-migration.cjs +1 -1
- package/schematics/bundles/compiler_host-CY14HvaP.cjs +1 -1
- package/schematics/bundles/control-flow-migration.cjs +1 -1
- package/schematics/bundles/imports-CVmcbVA9.cjs +1 -1
- package/schematics/bundles/index-BtLcQH8g.cjs +1 -1
- package/schematics/bundles/inject-migration.cjs +1 -1
- package/schematics/bundles/leading_space-BTPRV0wu.cjs +1 -1
- package/schematics/bundles/migrate_ts_type_references-MWoZx-Cb.cjs +1 -1
- package/schematics/bundles/ng_component_template-BOuKAnQd.cjs +1 -1
- package/schematics/bundles/ng_decorators-DYy6II6x.cjs +1 -1
- package/schematics/bundles/ngclass-to-class-migration.cjs +1 -1
- package/schematics/bundles/ngstyle-to-style-migration.cjs +1 -1
- package/schematics/bundles/nodes-ZSQ7WZRB.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +1 -1
- package/schematics/bundles/parse_html-C8eKA9px.cjs +1 -1
- package/schematics/bundles/project_paths-D2V-Uh2L.cjs +1 -1
- package/schematics/bundles/project_tsconfig_paths-DkkMibv-.cjs +1 -1
- package/schematics/bundles/property_name-BCpALNpZ.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +1 -1
- package/schematics/bundles/router-current-navigation.cjs +1 -1
- package/schematics/bundles/router-last-successful-navigation.cjs +1 -1
- package/schematics/bundles/router-testing-module-migration.cjs +1 -1
- package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
- package/schematics/bundles/signal-input-migration.cjs +1 -1
- package/schematics/bundles/signal-queries-migration.cjs +1 -1
- package/schematics/bundles/signals.cjs +1 -1
- package/schematics/bundles/standalone-migration.cjs +1 -1
- package/schematics/bundles/symbol-DZeHSR-V.cjs +1 -1
- package/types/_api-chunk.d.ts +1 -1
- package/types/_chrome_dev_tools_performance-chunk.d.ts +1 -1
- package/types/_discovery-chunk.d.ts +1 -1
- package/types/_effect-chunk.d.ts +1 -1
- package/types/_event_dispatcher-chunk.d.ts +1 -1
- package/types/_formatter-chunk.d.ts +1 -1
- package/types/_weak_ref-chunk.d.ts +1 -1
- package/types/core.d.ts +7 -7
- package/types/primitives-di.d.ts +1 -1
- package/types/primitives-event-dispatch.d.ts +1 -1
- package/types/primitives-signals.d.ts +1 -1
- package/types/rxjs-interop.d.ts +1 -1
- package/types/testing.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.2.
|
|
2
|
+
* @license Angular v21.2.1
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -4048,6 +4048,7 @@ const noOpAnimationComplete = () => {};
|
|
|
4048
4048
|
const enterClassMap = new WeakMap();
|
|
4049
4049
|
const longestAnimations = new WeakMap();
|
|
4050
4050
|
const leavingNodes = new WeakMap();
|
|
4051
|
+
const reusedNodes = new WeakSet();
|
|
4051
4052
|
function clearLeavingNodes(tNode, el) {
|
|
4052
4053
|
const nodes = leavingNodes.get(tNode);
|
|
4053
4054
|
if (nodes && nodes.length > 0) {
|
|
@@ -4066,7 +4067,15 @@ function cancelLeavingNodes(tNode, newElement) {
|
|
|
4066
4067
|
for (let i = nodes.length - 1; i >= 0; i--) {
|
|
4067
4068
|
const leavingEl = nodes[i];
|
|
4068
4069
|
const leavingParent = leavingEl.parentNode;
|
|
4069
|
-
if (
|
|
4070
|
+
if (leavingEl === newElement) {
|
|
4071
|
+
nodes.splice(i, 1);
|
|
4072
|
+
reusedNodes.add(leavingEl);
|
|
4073
|
+
leavingEl.dispatchEvent(new CustomEvent('animationend', {
|
|
4074
|
+
detail: {
|
|
4075
|
+
cancel: true
|
|
4076
|
+
}
|
|
4077
|
+
}));
|
|
4078
|
+
} else if (prevSibling && leavingEl === prevSibling || leavingParent && newParent && leavingParent !== newParent) {
|
|
4070
4079
|
nodes.splice(i, 1);
|
|
4071
4080
|
leavingEl.dispatchEvent(new CustomEvent('animationend', {
|
|
4072
4081
|
detail: {
|
|
@@ -4119,10 +4128,13 @@ function elementHasClassList(element, classList) {
|
|
|
4119
4128
|
}
|
|
4120
4129
|
return false;
|
|
4121
4130
|
}
|
|
4131
|
+
function getEventTarget(event) {
|
|
4132
|
+
return event.composedPath ? event.composedPath()[0] : event.target;
|
|
4133
|
+
}
|
|
4122
4134
|
function isLongestAnimation(event, nativeElement) {
|
|
4123
4135
|
const longestAnimation = longestAnimations.get(nativeElement);
|
|
4124
4136
|
if (longestAnimation === undefined) return true;
|
|
4125
|
-
return nativeElement === event
|
|
4137
|
+
return nativeElement === getEventTarget(event) && (longestAnimation.animationName !== undefined && event.animationName === longestAnimation.animationName || longestAnimation.propertyName !== undefined && (longestAnimation.propertyName === 'all' || event.propertyName === longestAnimation.propertyName));
|
|
4126
4138
|
}
|
|
4127
4139
|
function addAnimationToLView(animations, tNode, fn) {
|
|
4128
4140
|
const nodeAnimations = animations.get(tNode.index) ?? {
|
|
@@ -4182,6 +4194,7 @@ function getLongestComputedAnimation(computedStyle) {
|
|
|
4182
4194
|
const rawNames = parseCssPropertyValue(computedStyle, 'animation-name');
|
|
4183
4195
|
const rawDelays = parseCssPropertyValue(computedStyle, 'animation-delay');
|
|
4184
4196
|
const rawDurations = parseCssPropertyValue(computedStyle, 'animation-duration');
|
|
4197
|
+
const rawIterationCounts = parseCssPropertyValue(computedStyle, 'animation-iteration-count');
|
|
4185
4198
|
const longest = {
|
|
4186
4199
|
animationName: '',
|
|
4187
4200
|
propertyName: undefined,
|
|
@@ -4189,7 +4202,8 @@ function getLongestComputedAnimation(computedStyle) {
|
|
|
4189
4202
|
};
|
|
4190
4203
|
for (let i = 0; i < rawNames.length; i++) {
|
|
4191
4204
|
const duration = parseCssTimeUnitsToMs(rawDelays[i]) + parseCssTimeUnitsToMs(rawDurations[i]);
|
|
4192
|
-
|
|
4205
|
+
const iterationCount = rawIterationCounts[i];
|
|
4206
|
+
if (duration > longest.duration && iterationCount !== 'infinite') {
|
|
4193
4207
|
longest.animationName = rawNames[i];
|
|
4194
4208
|
longest.duration = duration;
|
|
4195
4209
|
}
|
|
@@ -4225,6 +4239,9 @@ function determineLongestAnimationFromElementAnimations(el, animationsMap, anima
|
|
|
4225
4239
|
};
|
|
4226
4240
|
for (const animation of animations) {
|
|
4227
4241
|
const timing = animation.effect?.getTiming();
|
|
4242
|
+
if (timing?.iterations === Infinity) {
|
|
4243
|
+
continue;
|
|
4244
|
+
}
|
|
4228
4245
|
const animDuration = typeof timing?.duration === 'number' ? timing.duration : 0;
|
|
4229
4246
|
let duration = (timing?.delay ?? 0) + animDuration;
|
|
4230
4247
|
let propertyName;
|
|
@@ -4683,6 +4700,10 @@ function applyToElementOrContainer(action, renderer, injector, parent, lNodeToHa
|
|
|
4683
4700
|
trackLeavingNodes(tNode, rNode);
|
|
4684
4701
|
}
|
|
4685
4702
|
runLeaveAnimationsWithCallback(parentLView, tNode, injector, nodeHasLeaveAnimations => {
|
|
4703
|
+
if (reusedNodes.has(rNode)) {
|
|
4704
|
+
reusedNodes.delete(rNode);
|
|
4705
|
+
return;
|
|
4706
|
+
}
|
|
4686
4707
|
nativeRemoveNode(renderer, rNode, isComponent, nodeHasLeaveAnimations);
|
|
4687
4708
|
});
|
|
4688
4709
|
} else if (action === 3) {
|
|
@@ -8712,7 +8733,7 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
8712
8733
|
}
|
|
8713
8734
|
}
|
|
8714
8735
|
function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
|
|
8715
|
-
const tAttributes = rootSelectorOrNode ? ['ng-version', '21.2.
|
|
8736
|
+
const tAttributes = rootSelectorOrNode ? ['ng-version', '21.2.1'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
|
|
8716
8737
|
let creationBindings = null;
|
|
8717
8738
|
let updateBindings = null;
|
|
8718
8739
|
let varsToAllocate = 0;
|
|
@@ -13327,15 +13348,19 @@ function runEnterAnimation(lView, tNode, value, ngZone) {
|
|
|
13327
13348
|
const renderer = lView[RENDERER];
|
|
13328
13349
|
const activeClasses = getClassListFromValue(value);
|
|
13329
13350
|
const cleanupFns = [];
|
|
13351
|
+
let hasCompleted = false;
|
|
13330
13352
|
const handleEnterAnimationStart = event => {
|
|
13331
|
-
if (event
|
|
13353
|
+
if (getEventTarget(event) !== nativeElement) return;
|
|
13332
13354
|
const eventName = event instanceof AnimationEvent ? 'animationend' : 'transitionend';
|
|
13333
13355
|
ngZone.runOutsideAngular(() => {
|
|
13334
13356
|
renderer.listen(nativeElement, eventName, handleEnterAnimationEnd);
|
|
13335
13357
|
});
|
|
13336
13358
|
};
|
|
13337
13359
|
const handleEnterAnimationEnd = event => {
|
|
13338
|
-
if (event
|
|
13360
|
+
if (getEventTarget(event) !== nativeElement) return;
|
|
13361
|
+
if (isLongestAnimation(event, nativeElement)) {
|
|
13362
|
+
hasCompleted = true;
|
|
13363
|
+
}
|
|
13339
13364
|
enterAnimationEnd(event, nativeElement, renderer);
|
|
13340
13365
|
};
|
|
13341
13366
|
if (activeClasses && activeClasses.length > 0) {
|
|
@@ -13349,6 +13374,7 @@ function runEnterAnimation(lView, tNode, value, ngZone) {
|
|
|
13349
13374
|
}
|
|
13350
13375
|
ngZone.runOutsideAngular(() => {
|
|
13351
13376
|
requestAnimationFrame(() => {
|
|
13377
|
+
if (hasCompleted) return;
|
|
13352
13378
|
determineLongestAnimation(nativeElement, longestAnimations, areAnimationSupported);
|
|
13353
13379
|
if (!longestAnimations.has(nativeElement)) {
|
|
13354
13380
|
for (const klass of activeClasses) {
|
|
@@ -13362,9 +13388,9 @@ function runEnterAnimation(lView, tNode, value, ngZone) {
|
|
|
13362
13388
|
}
|
|
13363
13389
|
function enterAnimationEnd(event, nativeElement, renderer) {
|
|
13364
13390
|
const elementData = enterClassMap.get(nativeElement);
|
|
13365
|
-
if (event
|
|
13391
|
+
if (getEventTarget(event) !== nativeElement || !elementData) return;
|
|
13366
13392
|
if (isLongestAnimation(event, nativeElement)) {
|
|
13367
|
-
event.
|
|
13393
|
+
event.stopPropagation();
|
|
13368
13394
|
for (const klass of elementData.classList) {
|
|
13369
13395
|
renderer.removeClass(nativeElement, klass);
|
|
13370
13396
|
}
|
|
@@ -13436,11 +13462,16 @@ function runLeaveAnimations(lView, tNode, value, ngZone) {
|
|
|
13436
13462
|
function animateLeaveClassRunner(el, tNode, lView, classList, renderer, ngZone) {
|
|
13437
13463
|
cancelAnimationsIfRunning(el, renderer);
|
|
13438
13464
|
const cleanupFns = [];
|
|
13439
|
-
const
|
|
13465
|
+
const componentResolvers = getLViewLeaveAnimations(lView).get(tNode.index)?.resolvers;
|
|
13466
|
+
let fallbackTimeoutId;
|
|
13467
|
+
let hasCompleted = false;
|
|
13440
13468
|
const handleOutAnimationEnd = event => {
|
|
13441
|
-
|
|
13442
|
-
if (
|
|
13443
|
-
|
|
13469
|
+
const target = getEventTarget(event);
|
|
13470
|
+
if (target !== el && event.type !== 'animation-fallback') return;
|
|
13471
|
+
if (event.type === 'animation-fallback' || isLongestAnimation(event, el)) {
|
|
13472
|
+
hasCompleted = true;
|
|
13473
|
+
if (fallbackTimeoutId) clearTimeout(fallbackTimeoutId);
|
|
13474
|
+
if (event.type !== 'animation-fallback') event.stopPropagation();
|
|
13444
13475
|
longestAnimations.delete(el);
|
|
13445
13476
|
clearLeavingNodes(tNode, el);
|
|
13446
13477
|
if (Array.isArray(tNode.projection)) {
|
|
@@ -13448,7 +13479,7 @@ function animateLeaveClassRunner(el, tNode, lView, classList, renderer, ngZone)
|
|
|
13448
13479
|
renderer.removeClass(el, item);
|
|
13449
13480
|
}
|
|
13450
13481
|
}
|
|
13451
|
-
cleanupAfterLeaveAnimations(
|
|
13482
|
+
cleanupAfterLeaveAnimations(componentResolvers, cleanupFns);
|
|
13452
13483
|
clearLViewNodeAnimationResolvers(lView, tNode);
|
|
13453
13484
|
}
|
|
13454
13485
|
};
|
|
@@ -13462,11 +13493,18 @@ function animateLeaveClassRunner(el, tNode, lView, classList, renderer, ngZone)
|
|
|
13462
13493
|
}
|
|
13463
13494
|
ngZone.runOutsideAngular(() => {
|
|
13464
13495
|
requestAnimationFrame(() => {
|
|
13496
|
+
if (hasCompleted) return;
|
|
13465
13497
|
determineLongestAnimation(el, longestAnimations, areAnimationSupported);
|
|
13466
|
-
|
|
13498
|
+
const longest = longestAnimations.get(el);
|
|
13499
|
+
if (!longest) {
|
|
13467
13500
|
clearLeavingNodes(tNode, el);
|
|
13468
|
-
cleanupAfterLeaveAnimations(
|
|
13501
|
+
cleanupAfterLeaveAnimations(componentResolvers, cleanupFns);
|
|
13469
13502
|
clearLViewNodeAnimationResolvers(lView, tNode);
|
|
13503
|
+
} else {
|
|
13504
|
+
fallbackTimeoutId = setTimeout(() => {
|
|
13505
|
+
handleOutAnimationEnd(new CustomEvent('animation-fallback'));
|
|
13506
|
+
}, longest.duration + 50);
|
|
13507
|
+
cleanupFns.push(() => clearTimeout(fallbackTimeoutId));
|
|
13470
13508
|
}
|
|
13471
13509
|
});
|
|
13472
13510
|
});
|