@angular/core 21.2.0-next.2 → 21.2.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/_attribute-chunk.mjs +1 -1
- package/fesm2022/_debug_node-chunk.mjs +329 -230
- 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 +1 -1
- package/fesm2022/_untracked-chunk.mjs +1 -1
- package/fesm2022/_weak_ref-chunk.mjs +1 -1
- package/fesm2022/core.mjs +3 -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 +8 -8
- 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 +2 -2
- 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,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.2.0-
|
|
2
|
+
* @license Angular v21.2.0-rc.0
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { attachInjectFlag, _global, ɵɵdefineInjectable as __defineInjectable, ɵɵdefineInjector as __defineInjector, ɵɵinject as __inject, ɵɵinvalidFactoryDep as __invalidFactoryDep, resolveForwardRef, newArray, EMPTY_OBJ, assertString, assertNotEqual, FLAGS, assertEqual, isInCheckNoChangesMode, PREORDER_HOOK_FLAGS, assertFirstCreatePass, assertDefined, throwError, assertNumber, assertGreaterThan, HEADER_OFFSET, DECLARATION_VIEW, NG_FACTORY_DEF, isForwardRef, getFactoryDef, assertIndexInRange, assertTNodeForLView, enterDI, runInInjectorProfilerContext, getCurrentTNode, getLView, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, throwProviderNotFoundError, leaveDI, assertNodeInjector, stringifyForError, cyclicDependencyErrorWithDetails, cyclicDependencyError, setInjectorProfilerContext, setInjectImplementation, assertDirectiveDef, NG_ELEMENT_ID, convertToBitFlags, isRootView, T_HOST, TVIEW, injectRootLimpMode, isComponentDef, EMBEDDED_VIEW_INJECTOR, INJECTOR$1 as INJECTOR, DECLARATION_COMPONENT_VIEW, isComponentHost, RuntimeError, NG_PROV_DEF, getClosureSafeProperty, getNativeByTNode, flatten, arrayEquals, ID, isLView, assertDomNode, unwrapRNode, getComponentLViewByIndex, CONTEXT, EMPTY_ARRAY, assertLView, HOST, CHILD_HEAD, NEXT, isLContainer, getLViewParent, Injector, CLEANUP, getComponentDef, getDirectiveDef, InjectionToken, inject, DOCUMENT as DOCUMENT$1, ENVIRONMENT_INITIALIZER, formatRuntimeError, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, isDirectiveHost, XSS_SECURITY_URL, RENDERER, renderStringify, getSelectedTNode, ENVIRONMENT, makeEnvironmentProviders, resetPreOrderHookFlags, PARENT, CHILD_TAIL, assertSame, assertFirstUpdatePass, getSelectedIndex, getTView, assertIndexInDeclRange, setSelectedIndex, NgZone, ChangeDetectionScheduler, ErrorHandler, AFTER_RENDER_SEQUENCES_TO_ADD, markAncestorsForTraversal, assertNotInReactiveContext, assertInInjectionContext, DestroyRef, ViewContext, EnvironmentInjector, assertLContainer, MOVED_VIEWS, isDestroyed, REACTIVE_TEMPLATE_CONSUMER, DECLARATION_LCONTAINER, QUERIES, assertNotReactive, ON_DESTROY_HOOKS, assertFunction, EFFECTS, assertProjectionSlots, NATIVE,
|
|
7
|
+
import { attachInjectFlag, _global, ɵɵdefineInjectable as __defineInjectable, ɵɵdefineInjector as __defineInjector, ɵɵinject as __inject, ɵɵinvalidFactoryDep as __invalidFactoryDep, resolveForwardRef, newArray, EMPTY_OBJ, assertString, assertNotEqual, FLAGS, assertEqual, isInCheckNoChangesMode, PREORDER_HOOK_FLAGS, assertFirstCreatePass, assertDefined, throwError, assertNumber, assertGreaterThan, HEADER_OFFSET, DECLARATION_VIEW, NG_FACTORY_DEF, isForwardRef, getFactoryDef, assertIndexInRange, assertTNodeForLView, enterDI, runInInjectorProfilerContext, getCurrentTNode, getLView, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, throwProviderNotFoundError, leaveDI, assertNodeInjector, stringifyForError, cyclicDependencyErrorWithDetails, cyclicDependencyError, setInjectorProfilerContext, setInjectImplementation, assertDirectiveDef, NG_ELEMENT_ID, convertToBitFlags, isRootView, T_HOST, TVIEW, injectRootLimpMode, isComponentDef, EMBEDDED_VIEW_INJECTOR, INJECTOR$1 as INJECTOR, DECLARATION_COMPONENT_VIEW, isComponentHost, RuntimeError, NG_PROV_DEF, getClosureSafeProperty, getNativeByTNode, flatten, arrayEquals, ID, isLView, assertDomNode, unwrapRNode, getComponentLViewByIndex, CONTEXT, EMPTY_ARRAY, assertLView, HOST, CHILD_HEAD, NEXT, isLContainer, getLViewParent, Injector, CLEANUP, getComponentDef, getDirectiveDef, InjectionToken, inject, DOCUMENT as DOCUMENT$1, ENVIRONMENT_INITIALIZER, formatRuntimeError, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, isDirectiveHost, XSS_SECURITY_URL, RENDERER, renderStringify, getSelectedTNode, ENVIRONMENT, makeEnvironmentProviders, resetPreOrderHookFlags, PARENT, CHILD_TAIL, assertSame, assertFirstUpdatePass, getSelectedIndex, getTView, assertIndexInDeclRange, setSelectedIndex, stringify, ANIMATIONS, NgZone, ChangeDetectionScheduler, ErrorHandler, AFTER_RENDER_SEQUENCES_TO_ADD, markAncestorsForTraversal, assertNotInReactiveContext, assertInInjectionContext, DestroyRef, ViewContext, EnvironmentInjector, INJECTOR as INJECTOR$1, CONTAINER_HEADER_OFFSET, assertLContainer, MOVED_VIEWS, isDestroyed, REACTIVE_TEMPLATE_CONSUMER, DECLARATION_LCONTAINER, QUERIES, assertNotReactive, ON_DESTROY_HOOKS, assertFunction, EFFECTS, assertProjectionSlots, NATIVE, assertParentView, assertNotSame, setCurrentDirectiveIndex, setCurrentTNode, getElementDepthCount, increaseElementDepthCount, wasLastNodeCreated, isCurrentTNodeParent, setCurrentTNodeAsNotParent, assertHasParent, INTERNAL_APPLICATION_ERROR_HANDLER, getCurrentDirectiveIndex, unwrapLView, isCreationMode, enterView, leaveView, markViewForRefresh, setIsRefreshingViews, isExhaustiveCheckNoChanges, requiresRefreshOrTraversal, setIsInCheckNoChangesMode, CheckNoChangesMode, setBindingIndex, EFFECTS_TO_SCHEDULE, viewAttachedToChangeDetector, setBindingRootForHostBindings, isRefreshingViews, removeFromArray, addToArray, updateAncestorTraversalFlagsOnAttach, storeLViewOnDestroy, VIEW_REFS, assertGreaterThanOrEqual, isInI18nBlock, assertTNodeForTView, getCurrentParentTNode, getCurrentTNodePlaceholderOk, assertTNode, assertTIcu, assertNumberInRange, DEHYDRATED_VIEWS, getNgModuleDef, getPipeDef as getPipeDef$1, getNgModuleDefOrThrow, isStandalone, concatStringsWithSpace, assertInjectImplementationNotEqual, emitInjectEvent, getConstant, assertLessThan, getOrCreateTViewCleanup, getOrCreateLViewCleanup, debugStringifyTypeForError, assertNotDefined, nextBindingIndex, getDirectiveDefOrThrow, getTNode, assertComponentType, SVG_NAMESPACE, MATH_ML_NAMESPACE, viewAttachedToContainer, storeCleanupWithContext, signal, createInjectorWithoutInjectorInstances, R3Injector, getNullInjector, internalImportProvidersFrom, initNgDevMode, fillProperties, getBindingsEnabled, lastNodeWasCreated, removeLViewOnDestroy, walkUpViews, getNativeByIndex, assertElement, arrayInsert2, arraySplice, setInjectorProfiler, EffectRefImpl, NullInjector, INJECTOR_DEF_TYPES, walkProviderTree, getInjectorDef, deepForEach, isTypeProvider, isInInjectionContext, runInInjectionContext, ZONELESS_ENABLED, EffectScheduler, PendingTasksInternal, PendingTasks, assertTNodeCreationIndex, isSkipHydrationRootTNode, leaveSkipHydrationBlock, decreaseElementDepthCount, getNamespace, enterSkipHydrationBlock, getCurrentDirectiveDef, assertIndexInExpandoRange, getBindingIndex, assertOneOf, setInI18nBlock, nextContextImpl, getCurrentQueryIndex, getContextLView, load, keyValueArrayIndexOf, keyValueArraySet, keyValueArrayGet, incrementBindingIndex, store, getBindingRoot, providerToFactory, emitProviderConfiguredEvent, isClassProvider, NG_COMP_DEF, ɵɵresetView as __resetView, ɵɵnamespaceHTML as __namespaceHTML, ɵɵnamespaceMathML as __namespaceMathML, ɵɵnamespaceSVG as __namespaceSVG, ɵɵenableBindings as __enableBindings, ɵɵdisableBindings as __disableBindings, ɵɵrestoreView as __restoreView, forwardRef, NG_MOD_DEF, NG_INJ_DEF, NG_DIR_DEF, NG_PIPE_DEF, angularZoneInstanceIdProperty, SCHEDULE_IN_ROOT_ZONE, PROVIDED_ZONELESS, NoopNgZone, scheduleCallbackWithMicrotask, scheduleCallbackWithRafRace, getNativeByTNodeOrNull } from './_effect-chunk2.mjs';
|
|
8
8
|
import { setActiveConsumer, SIGNAL, consumerDestroy, REACTIVE_NODE, consumerPollProducersForChange, consumerBeforeComputation, getActiveConsumer, consumerAfterComputation, createComputed, setThrowInvalidWriteToSignalError } from './_effect-chunk.mjs';
|
|
9
9
|
import { Subject, Subscription } from 'rxjs';
|
|
10
10
|
import { setActiveConsumer as setActiveConsumer$1 } from '@angular/core/primitives/signals';
|
|
@@ -1141,7 +1141,7 @@ function lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundVa
|
|
|
1141
1141
|
if (!parentTNode) {
|
|
1142
1142
|
const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];
|
|
1143
1143
|
if (embeddedViewInjector) {
|
|
1144
|
-
const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags);
|
|
1144
|
+
const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags & ~4);
|
|
1145
1145
|
if (embeddedViewInjectorValue !== NOT_FOUND) {
|
|
1146
1146
|
return embeddedViewInjectorValue;
|
|
1147
1147
|
}
|
|
@@ -1443,8 +1443,8 @@ function isI18nInSkipHydrationBlock(parentTNode) {
|
|
|
1443
1443
|
var ChangeDetectionStrategy;
|
|
1444
1444
|
(function (ChangeDetectionStrategy) {
|
|
1445
1445
|
ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush";
|
|
1446
|
-
ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
|
|
1447
1446
|
ChangeDetectionStrategy[ChangeDetectionStrategy["Eager"] = 1] = "Eager";
|
|
1447
|
+
ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default";
|
|
1448
1448
|
})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
|
|
1449
1449
|
|
|
1450
1450
|
const TRACKED_LVIEWS = new Map();
|
|
@@ -1813,7 +1813,7 @@ function getDirectiveMetadata$1(directiveOrComponentInstance) {
|
|
|
1813
1813
|
inputs,
|
|
1814
1814
|
outputs: componentDef.outputs,
|
|
1815
1815
|
encapsulation: componentDef.encapsulation,
|
|
1816
|
-
changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush : ChangeDetectionStrategy.
|
|
1816
|
+
changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush : ChangeDetectionStrategy.Eager
|
|
1817
1817
|
};
|
|
1818
1818
|
}
|
|
1819
1819
|
const directiveDef = getDirectiveDef(constructor);
|
|
@@ -3994,6 +3994,163 @@ function ensureIcuContainerVisitorLoaded(loader) {
|
|
|
3994
3994
|
}
|
|
3995
3995
|
}
|
|
3996
3996
|
|
|
3997
|
+
const ANIMATIONS_DISABLED = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationsDisabled' : '', {
|
|
3998
|
+
factory: () => false
|
|
3999
|
+
});
|
|
4000
|
+
const MAX_ANIMATION_TIMEOUT = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'MaxAnimationTimeout' : '', {
|
|
4001
|
+
factory: () => MAX_ANIMATION_TIMEOUT_DEFAULT
|
|
4002
|
+
});
|
|
4003
|
+
const MAX_ANIMATION_TIMEOUT_DEFAULT = 4000;
|
|
4004
|
+
|
|
4005
|
+
const DEFAULT_ANIMATIONS_DISABLED = false;
|
|
4006
|
+
const areAnimationSupported = (typeof ngServerMode === 'undefined' || !ngServerMode) && typeof document !== 'undefined' && typeof document?.documentElement?.getAnimations === 'function';
|
|
4007
|
+
function areAnimationsDisabled(lView) {
|
|
4008
|
+
const injector = lView[INJECTOR];
|
|
4009
|
+
return injector.get(ANIMATIONS_DISABLED, DEFAULT_ANIMATIONS_DISABLED);
|
|
4010
|
+
}
|
|
4011
|
+
function assertAnimationTypes(value, instruction) {
|
|
4012
|
+
if (value == null || typeof value !== 'string' && typeof value !== 'function') {
|
|
4013
|
+
throw new RuntimeError(650, `'${instruction}' value must be a string of CSS classes or an animation function, got ${stringify(value)}`);
|
|
4014
|
+
}
|
|
4015
|
+
}
|
|
4016
|
+
function assertElementNodes(nativeElement, instruction) {
|
|
4017
|
+
if (nativeElement.nodeType !== Node.ELEMENT_NODE) {
|
|
4018
|
+
throw new RuntimeError(650, `'${instruction}' can only be used on an element node, got ${stringify(nativeElement.nodeType)}`);
|
|
4019
|
+
}
|
|
4020
|
+
}
|
|
4021
|
+
function trackEnterClasses(el, classList, cleanupFns) {
|
|
4022
|
+
const elementData = enterClassMap.get(el);
|
|
4023
|
+
if (elementData) {
|
|
4024
|
+
for (const klass of classList) {
|
|
4025
|
+
elementData.classList.push(klass);
|
|
4026
|
+
}
|
|
4027
|
+
for (const fn of cleanupFns) {
|
|
4028
|
+
elementData.cleanupFns.push(fn);
|
|
4029
|
+
}
|
|
4030
|
+
} else {
|
|
4031
|
+
enterClassMap.set(el, {
|
|
4032
|
+
classList,
|
|
4033
|
+
cleanupFns
|
|
4034
|
+
});
|
|
4035
|
+
}
|
|
4036
|
+
}
|
|
4037
|
+
function cleanupEnterClassData(element) {
|
|
4038
|
+
const elementData = enterClassMap.get(element);
|
|
4039
|
+
if (elementData) {
|
|
4040
|
+
for (const fn of elementData.cleanupFns) {
|
|
4041
|
+
fn();
|
|
4042
|
+
}
|
|
4043
|
+
enterClassMap.delete(element);
|
|
4044
|
+
}
|
|
4045
|
+
longestAnimations.delete(element);
|
|
4046
|
+
}
|
|
4047
|
+
const noOpAnimationComplete = () => {};
|
|
4048
|
+
const enterClassMap = new WeakMap();
|
|
4049
|
+
const longestAnimations = new WeakMap();
|
|
4050
|
+
const leavingNodes = new WeakMap();
|
|
4051
|
+
function clearLeavingNodes(tNode, el) {
|
|
4052
|
+
const nodes = leavingNodes.get(tNode);
|
|
4053
|
+
if (nodes && nodes.length > 0) {
|
|
4054
|
+
const ix = nodes.findIndex(node => node === el);
|
|
4055
|
+
if (ix > -1) nodes.splice(ix, 1);
|
|
4056
|
+
}
|
|
4057
|
+
if (nodes?.length === 0) {
|
|
4058
|
+
leavingNodes.delete(tNode);
|
|
4059
|
+
}
|
|
4060
|
+
}
|
|
4061
|
+
function cancelLeavingNodes(tNode, newElement) {
|
|
4062
|
+
const nodes = leavingNodes.get(tNode);
|
|
4063
|
+
if (!nodes || nodes.length === 0) return;
|
|
4064
|
+
const newParent = newElement.parentNode;
|
|
4065
|
+
const prevSibling = newElement.previousSibling;
|
|
4066
|
+
for (let i = nodes.length - 1; i >= 0; i--) {
|
|
4067
|
+
const leavingEl = nodes[i];
|
|
4068
|
+
const leavingParent = leavingEl.parentNode;
|
|
4069
|
+
if (prevSibling && leavingEl === prevSibling || leavingParent && newParent && leavingParent !== newParent) {
|
|
4070
|
+
nodes.splice(i, 1);
|
|
4071
|
+
leavingEl.dispatchEvent(new CustomEvent('animationend', {
|
|
4072
|
+
detail: {
|
|
4073
|
+
cancel: true
|
|
4074
|
+
}
|
|
4075
|
+
}));
|
|
4076
|
+
leavingEl.parentNode?.removeChild(leavingEl);
|
|
4077
|
+
}
|
|
4078
|
+
}
|
|
4079
|
+
}
|
|
4080
|
+
function trackLeavingNodes(tNode, el) {
|
|
4081
|
+
const nodes = leavingNodes.get(tNode);
|
|
4082
|
+
if (nodes) {
|
|
4083
|
+
if (!nodes.includes(el)) {
|
|
4084
|
+
nodes.push(el);
|
|
4085
|
+
}
|
|
4086
|
+
} else {
|
|
4087
|
+
leavingNodes.set(tNode, [el]);
|
|
4088
|
+
}
|
|
4089
|
+
}
|
|
4090
|
+
function getLViewEnterAnimations(lView) {
|
|
4091
|
+
const animationData = lView[ANIMATIONS] ??= {};
|
|
4092
|
+
return animationData.enter ??= new Map();
|
|
4093
|
+
}
|
|
4094
|
+
function getLViewLeaveAnimations(lView) {
|
|
4095
|
+
const animationData = lView[ANIMATIONS] ??= {};
|
|
4096
|
+
return animationData.leave ??= new Map();
|
|
4097
|
+
}
|
|
4098
|
+
function getClassListFromValue(value) {
|
|
4099
|
+
const classes = typeof value === 'function' ? value() : value;
|
|
4100
|
+
let classList = Array.isArray(classes) ? classes : null;
|
|
4101
|
+
if (typeof classes === 'string') {
|
|
4102
|
+
classList = classes.trim().split(/\s+/).filter(k => k);
|
|
4103
|
+
}
|
|
4104
|
+
return classList;
|
|
4105
|
+
}
|
|
4106
|
+
function cancelAnimationsIfRunning(element, renderer) {
|
|
4107
|
+
if (!areAnimationSupported) return;
|
|
4108
|
+
const elementData = enterClassMap.get(element);
|
|
4109
|
+
if (elementData && elementData.classList.length > 0 && elementHasClassList(element, elementData.classList)) {
|
|
4110
|
+
for (const klass of elementData.classList) {
|
|
4111
|
+
renderer.removeClass(element, klass);
|
|
4112
|
+
}
|
|
4113
|
+
}
|
|
4114
|
+
cleanupEnterClassData(element);
|
|
4115
|
+
}
|
|
4116
|
+
function elementHasClassList(element, classList) {
|
|
4117
|
+
for (const className of classList) {
|
|
4118
|
+
if (element.classList.contains(className)) return true;
|
|
4119
|
+
}
|
|
4120
|
+
return false;
|
|
4121
|
+
}
|
|
4122
|
+
function isLongestAnimation(event, nativeElement) {
|
|
4123
|
+
const longestAnimation = longestAnimations.get(nativeElement);
|
|
4124
|
+
if (longestAnimation === undefined) return true;
|
|
4125
|
+
return nativeElement === event.target && (longestAnimation.animationName !== undefined && event.animationName === longestAnimation.animationName || longestAnimation.propertyName !== undefined && event.propertyName === longestAnimation.propertyName);
|
|
4126
|
+
}
|
|
4127
|
+
function addAnimationToLView(animations, tNode, fn) {
|
|
4128
|
+
const nodeAnimations = animations.get(tNode.index) ?? {
|
|
4129
|
+
animateFns: []
|
|
4130
|
+
};
|
|
4131
|
+
nodeAnimations.animateFns.push(fn);
|
|
4132
|
+
animations.set(tNode.index, nodeAnimations);
|
|
4133
|
+
}
|
|
4134
|
+
function cleanupAfterLeaveAnimations(resolvers, cleanupFns) {
|
|
4135
|
+
if (resolvers) {
|
|
4136
|
+
for (const fn of resolvers) {
|
|
4137
|
+
fn();
|
|
4138
|
+
}
|
|
4139
|
+
}
|
|
4140
|
+
for (const fn of cleanupFns) {
|
|
4141
|
+
fn();
|
|
4142
|
+
}
|
|
4143
|
+
}
|
|
4144
|
+
function clearLViewNodeAnimationResolvers(lView, tNode) {
|
|
4145
|
+
const nodeAnimations = getLViewLeaveAnimations(lView).get(tNode.index);
|
|
4146
|
+
if (nodeAnimations) nodeAnimations.resolvers = undefined;
|
|
4147
|
+
}
|
|
4148
|
+
function leaveAnimationFunctionCleanup(lView, tNode, nativeElement, resolvers, cleanupFns) {
|
|
4149
|
+
clearLeavingNodes(tNode, nativeElement);
|
|
4150
|
+
cleanupAfterLeaveAnimations(resolvers, cleanupFns);
|
|
4151
|
+
clearLViewNodeAnimationResolvers(lView, tNode);
|
|
4152
|
+
}
|
|
4153
|
+
|
|
3997
4154
|
function parseCssTimeUnitsToMs(value) {
|
|
3998
4155
|
if (!value) return 0;
|
|
3999
4156
|
const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;
|
|
@@ -4304,11 +4461,14 @@ const NOOP_AFTER_RENDER_REF = {
|
|
|
4304
4461
|
|
|
4305
4462
|
const ANIMATION_QUEUE = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationQueue' : '', {
|
|
4306
4463
|
factory: () => {
|
|
4464
|
+
const injector = inject(EnvironmentInjector);
|
|
4465
|
+
const queue = new Set();
|
|
4466
|
+
injector.onDestroy(() => queue.clear());
|
|
4307
4467
|
return {
|
|
4308
|
-
queue
|
|
4468
|
+
queue,
|
|
4309
4469
|
isScheduled: false,
|
|
4310
4470
|
scheduler: null,
|
|
4311
|
-
injector
|
|
4471
|
+
injector
|
|
4312
4472
|
};
|
|
4313
4473
|
}
|
|
4314
4474
|
});
|
|
@@ -4359,16 +4519,6 @@ function queueEnterAnimations(injector, enterAnimations) {
|
|
|
4359
4519
|
addToAnimationQueue(injector, nodeAnimations.animateFns);
|
|
4360
4520
|
}
|
|
4361
4521
|
}
|
|
4362
|
-
function removeAnimationsFromQueue(injector, animationFns) {
|
|
4363
|
-
const animationQueue = injector.get(ANIMATION_QUEUE);
|
|
4364
|
-
if (Array.isArray(animationFns)) {
|
|
4365
|
-
for (const animateFn of animationFns) {
|
|
4366
|
-
animationQueue.queue.delete(animateFn);
|
|
4367
|
-
}
|
|
4368
|
-
} else {
|
|
4369
|
-
animationQueue.queue.delete(animationFns);
|
|
4370
|
-
}
|
|
4371
|
-
}
|
|
4372
4522
|
|
|
4373
4523
|
function maybeQueueEnterAnimation(parentLView, parent, tNode, injector) {
|
|
4374
4524
|
const enterAnimations = parentLView?.[ANIMATIONS]?.enter;
|
|
@@ -4376,6 +4526,135 @@ function maybeQueueEnterAnimation(parentLView, parent, tNode, injector) {
|
|
|
4376
4526
|
queueEnterAnimations(injector, enterAnimations);
|
|
4377
4527
|
}
|
|
4378
4528
|
}
|
|
4529
|
+
function runLeaveAnimationsWithCallback(lView, tNode, injector, callback) {
|
|
4530
|
+
try {
|
|
4531
|
+
injector.get(INJECTOR$1);
|
|
4532
|
+
} catch {
|
|
4533
|
+
return callback(false);
|
|
4534
|
+
}
|
|
4535
|
+
const animations = lView?.[ANIMATIONS];
|
|
4536
|
+
const nodesWithExitAnimations = aggregateDescendantAnimations(lView, tNode, animations);
|
|
4537
|
+
if (nodesWithExitAnimations.size === 0) {
|
|
4538
|
+
let hasNestedAnimations = false;
|
|
4539
|
+
if (lView) {
|
|
4540
|
+
const nestedPromises = [];
|
|
4541
|
+
collectNestedViewAnimations(lView, tNode, nestedPromises);
|
|
4542
|
+
hasNestedAnimations = nestedPromises.length > 0;
|
|
4543
|
+
}
|
|
4544
|
+
if (!hasNestedAnimations) {
|
|
4545
|
+
return callback(false);
|
|
4546
|
+
}
|
|
4547
|
+
}
|
|
4548
|
+
if (lView) allLeavingAnimations.add(lView[ID]);
|
|
4549
|
+
addToAnimationQueue(injector, () => executeLeaveAnimations(lView, tNode, animations || undefined, nodesWithExitAnimations, callback), animations || undefined);
|
|
4550
|
+
}
|
|
4551
|
+
function aggregateDescendantAnimations(lView, tNode, animations) {
|
|
4552
|
+
const nodesWithExitAnimations = new Map();
|
|
4553
|
+
const leaveAnimations = animations?.leave;
|
|
4554
|
+
if (leaveAnimations && leaveAnimations.has(tNode.index)) {
|
|
4555
|
+
nodesWithExitAnimations.set(tNode.index, leaveAnimations.get(tNode.index));
|
|
4556
|
+
}
|
|
4557
|
+
if (lView && leaveAnimations) {
|
|
4558
|
+
for (const [index, animationData] of leaveAnimations) {
|
|
4559
|
+
if (nodesWithExitAnimations.has(index)) continue;
|
|
4560
|
+
const nestedTNode = lView[TVIEW].data[index];
|
|
4561
|
+
let parent = nestedTNode.parent;
|
|
4562
|
+
while (parent) {
|
|
4563
|
+
if (parent === tNode) {
|
|
4564
|
+
nodesWithExitAnimations.set(index, animationData);
|
|
4565
|
+
break;
|
|
4566
|
+
}
|
|
4567
|
+
parent = parent.parent;
|
|
4568
|
+
}
|
|
4569
|
+
}
|
|
4570
|
+
}
|
|
4571
|
+
return nodesWithExitAnimations;
|
|
4572
|
+
}
|
|
4573
|
+
function executeLeaveAnimations(lView, tNode, animations, nodesWithExitAnimations, callback) {
|
|
4574
|
+
const runningAnimations = [];
|
|
4575
|
+
if (animations && animations.leave) {
|
|
4576
|
+
for (const [index] of nodesWithExitAnimations) {
|
|
4577
|
+
if (!animations.leave.has(index)) continue;
|
|
4578
|
+
const currentAnimationData = animations.leave.get(index);
|
|
4579
|
+
for (const animationFn of currentAnimationData.animateFns) {
|
|
4580
|
+
const {
|
|
4581
|
+
promise
|
|
4582
|
+
} = animationFn();
|
|
4583
|
+
runningAnimations.push(promise);
|
|
4584
|
+
}
|
|
4585
|
+
animations.detachedLeaveAnimationFns = undefined;
|
|
4586
|
+
}
|
|
4587
|
+
}
|
|
4588
|
+
if (lView) {
|
|
4589
|
+
collectNestedViewAnimations(lView, tNode, runningAnimations);
|
|
4590
|
+
}
|
|
4591
|
+
if (runningAnimations.length > 0) {
|
|
4592
|
+
const currentAnimations = animations || lView?.[ANIMATIONS];
|
|
4593
|
+
if (currentAnimations) {
|
|
4594
|
+
const prevRunning = currentAnimations.running;
|
|
4595
|
+
if (prevRunning) {
|
|
4596
|
+
runningAnimations.push(prevRunning);
|
|
4597
|
+
}
|
|
4598
|
+
currentAnimations.running = Promise.allSettled(runningAnimations);
|
|
4599
|
+
runAfterLeaveAnimations(lView, currentAnimations.running, callback);
|
|
4600
|
+
} else {
|
|
4601
|
+
Promise.allSettled(runningAnimations).then(() => {
|
|
4602
|
+
if (lView) allLeavingAnimations.delete(lView[ID]);
|
|
4603
|
+
callback(true);
|
|
4604
|
+
});
|
|
4605
|
+
}
|
|
4606
|
+
} else {
|
|
4607
|
+
if (lView) allLeavingAnimations.delete(lView[ID]);
|
|
4608
|
+
callback(false);
|
|
4609
|
+
}
|
|
4610
|
+
}
|
|
4611
|
+
function collectNestedViewAnimations(lView, tNode, collectedPromises) {
|
|
4612
|
+
if (isComponentHost(tNode)) {
|
|
4613
|
+
const componentView = getComponentLViewByIndex(tNode.index, lView);
|
|
4614
|
+
collectAllViewLeaveAnimations(componentView, collectedPromises);
|
|
4615
|
+
} else if (tNode.type & 12) {
|
|
4616
|
+
const lContainer = lView[tNode.index];
|
|
4617
|
+
if (isLContainer(lContainer)) {
|
|
4618
|
+
for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
|
|
4619
|
+
const subView = lContainer[i];
|
|
4620
|
+
collectAllViewLeaveAnimations(subView, collectedPromises);
|
|
4621
|
+
}
|
|
4622
|
+
}
|
|
4623
|
+
}
|
|
4624
|
+
let child = tNode.child;
|
|
4625
|
+
while (child) {
|
|
4626
|
+
collectNestedViewAnimations(lView, child, collectedPromises);
|
|
4627
|
+
child = child.next;
|
|
4628
|
+
}
|
|
4629
|
+
}
|
|
4630
|
+
function collectAllViewLeaveAnimations(view, collectedPromises) {
|
|
4631
|
+
const animations = view[ANIMATIONS];
|
|
4632
|
+
if (animations && animations.leave) {
|
|
4633
|
+
for (const animationData of animations.leave.values()) {
|
|
4634
|
+
for (const animationFn of animationData.animateFns) {
|
|
4635
|
+
const {
|
|
4636
|
+
promise
|
|
4637
|
+
} = animationFn();
|
|
4638
|
+
collectedPromises.push(promise);
|
|
4639
|
+
}
|
|
4640
|
+
}
|
|
4641
|
+
}
|
|
4642
|
+
let child = view[TVIEW].firstChild;
|
|
4643
|
+
while (child) {
|
|
4644
|
+
collectNestedViewAnimations(view, child, collectedPromises);
|
|
4645
|
+
child = child.next;
|
|
4646
|
+
}
|
|
4647
|
+
}
|
|
4648
|
+
function runAfterLeaveAnimations(lView, runningAnimations, callback) {
|
|
4649
|
+
runningAnimations.then(() => {
|
|
4650
|
+
if (lView[ANIMATIONS]?.running === runningAnimations) {
|
|
4651
|
+
lView[ANIMATIONS].running = undefined;
|
|
4652
|
+
allLeavingAnimations.delete(lView[ID]);
|
|
4653
|
+
}
|
|
4654
|
+
callback(true);
|
|
4655
|
+
});
|
|
4656
|
+
}
|
|
4657
|
+
|
|
4379
4658
|
function applyToElementOrContainer(action, renderer, injector, parent, lNodeToHandle, tNode, beforeNode, parentLView) {
|
|
4380
4659
|
if (lNodeToHandle != null) {
|
|
4381
4660
|
let lContainer;
|
|
@@ -4398,7 +4677,11 @@ function applyToElementOrContainer(action, renderer, injector, parent, lNodeToHa
|
|
|
4398
4677
|
} else if (action === 1 && parent !== null) {
|
|
4399
4678
|
maybeQueueEnterAnimation(parentLView, parent, tNode, injector);
|
|
4400
4679
|
nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
|
|
4680
|
+
cancelLeavingNodes(tNode, rNode);
|
|
4401
4681
|
} else if (action === 2) {
|
|
4682
|
+
if (parentLView?.[ANIMATIONS]?.leave?.has(tNode.index)) {
|
|
4683
|
+
trackLeavingNodes(tNode, rNode);
|
|
4684
|
+
}
|
|
4402
4685
|
runLeaveAnimationsWithCallback(parentLView, tNode, injector, nodeHasLeaveAnimations => {
|
|
4403
4686
|
nativeRemoveNode(renderer, rNode, isComponent, nodeHasLeaveAnimations);
|
|
4404
4687
|
});
|
|
@@ -4502,48 +4785,6 @@ function cleanUpView(tView, lView) {
|
|
|
4502
4785
|
setActiveConsumer(prevConsumer);
|
|
4503
4786
|
}
|
|
4504
4787
|
}
|
|
4505
|
-
function runLeaveAnimationsWithCallback(lView, tNode, injector, callback) {
|
|
4506
|
-
const animations = lView?.[ANIMATIONS];
|
|
4507
|
-
if (animations?.enter?.has(tNode.index)) {
|
|
4508
|
-
removeAnimationsFromQueue(injector, animations.enter.get(tNode.index).animateFns);
|
|
4509
|
-
}
|
|
4510
|
-
if (animations == null || animations.leave == undefined || !animations.leave.has(tNode.index)) return callback(false);
|
|
4511
|
-
if (lView) allLeavingAnimations.add(lView[ID]);
|
|
4512
|
-
addToAnimationQueue(injector, () => {
|
|
4513
|
-
if (animations.leave && animations.leave.has(tNode.index)) {
|
|
4514
|
-
const leaveAnimationMap = animations.leave;
|
|
4515
|
-
const leaveAnimations = leaveAnimationMap.get(tNode.index);
|
|
4516
|
-
const runningAnimations = [];
|
|
4517
|
-
if (leaveAnimations) {
|
|
4518
|
-
for (let index = 0; index < leaveAnimations.animateFns.length; index++) {
|
|
4519
|
-
const animationFn = leaveAnimations.animateFns[index];
|
|
4520
|
-
const {
|
|
4521
|
-
promise
|
|
4522
|
-
} = animationFn();
|
|
4523
|
-
runningAnimations.push(promise);
|
|
4524
|
-
}
|
|
4525
|
-
animations.detachedLeaveAnimationFns = undefined;
|
|
4526
|
-
}
|
|
4527
|
-
animations.running = Promise.allSettled(runningAnimations);
|
|
4528
|
-
runAfterLeaveAnimations(lView, callback);
|
|
4529
|
-
} else {
|
|
4530
|
-
if (lView) allLeavingAnimations.delete(lView[ID]);
|
|
4531
|
-
callback(false);
|
|
4532
|
-
}
|
|
4533
|
-
}, animations);
|
|
4534
|
-
}
|
|
4535
|
-
function runAfterLeaveAnimations(lView, callback) {
|
|
4536
|
-
const runningAnimations = lView[ANIMATIONS]?.running;
|
|
4537
|
-
if (runningAnimations) {
|
|
4538
|
-
runningAnimations.then(() => {
|
|
4539
|
-
lView[ANIMATIONS].running = undefined;
|
|
4540
|
-
allLeavingAnimations.delete(lView[ID]);
|
|
4541
|
-
callback(true);
|
|
4542
|
-
});
|
|
4543
|
-
return;
|
|
4544
|
-
}
|
|
4545
|
-
callback(false);
|
|
4546
|
-
}
|
|
4547
4788
|
function processCleanups(tView, lView) {
|
|
4548
4789
|
ngDevMode && assertNotReactive(processCleanups.name);
|
|
4549
4790
|
const tCleanup = tView.cleanup;
|
|
@@ -8161,13 +8402,25 @@ class ControlDirectiveHostImpl {
|
|
|
8161
8402
|
}
|
|
8162
8403
|
setInputOnDirectives(inputName, value) {
|
|
8163
8404
|
const directiveIndices = this.tNode.inputs?.[inputName];
|
|
8164
|
-
|
|
8405
|
+
const hostDirectiveInputs = this.tNode.hostDirectiveInputs?.[inputName];
|
|
8406
|
+
if (!directiveIndices && !hostDirectiveInputs) {
|
|
8165
8407
|
return false;
|
|
8166
8408
|
}
|
|
8167
|
-
|
|
8168
|
-
const
|
|
8169
|
-
|
|
8170
|
-
|
|
8409
|
+
if (directiveIndices) {
|
|
8410
|
+
for (const index of directiveIndices) {
|
|
8411
|
+
const directiveDef = this.tView.data[index];
|
|
8412
|
+
const directive = this.lView[index];
|
|
8413
|
+
writeToDirectiveInput(directiveDef, directive, inputName, value);
|
|
8414
|
+
}
|
|
8415
|
+
}
|
|
8416
|
+
if (hostDirectiveInputs) {
|
|
8417
|
+
for (let i = 0; i < hostDirectiveInputs.length; i += 2) {
|
|
8418
|
+
const index = hostDirectiveInputs[i];
|
|
8419
|
+
const internalName = hostDirectiveInputs[i + 1];
|
|
8420
|
+
const directiveDef = this.tView.data[index];
|
|
8421
|
+
const directive = this.lView[index];
|
|
8422
|
+
writeToDirectiveInput(directiveDef, directive, internalName, value);
|
|
8423
|
+
}
|
|
8171
8424
|
}
|
|
8172
8425
|
return true;
|
|
8173
8426
|
}
|
|
@@ -8459,7 +8712,7 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
8459
8712
|
}
|
|
8460
8713
|
}
|
|
8461
8714
|
function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
|
|
8462
|
-
const tAttributes = rootSelectorOrNode ? ['ng-version', '21.2.0-
|
|
8715
|
+
const tAttributes = rootSelectorOrNode ? ['ng-version', '21.2.0-rc.0'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
|
|
8463
8716
|
let creationBindings = null;
|
|
8464
8717
|
let updateBindings = null;
|
|
8465
8718
|
let varsToAllocate = 0;
|
|
@@ -13051,156 +13304,6 @@ function ɵɵattribute(name, value, sanitizer, namespace) {
|
|
|
13051
13304
|
return ɵɵattribute;
|
|
13052
13305
|
}
|
|
13053
13306
|
|
|
13054
|
-
const ANIMATIONS_DISABLED = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationsDisabled' : '', {
|
|
13055
|
-
factory: () => false
|
|
13056
|
-
});
|
|
13057
|
-
const MAX_ANIMATION_TIMEOUT = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'MaxAnimationTimeout' : '', {
|
|
13058
|
-
factory: () => MAX_ANIMATION_TIMEOUT_DEFAULT
|
|
13059
|
-
});
|
|
13060
|
-
const MAX_ANIMATION_TIMEOUT_DEFAULT = 4000;
|
|
13061
|
-
|
|
13062
|
-
const DEFAULT_ANIMATIONS_DISABLED = false;
|
|
13063
|
-
const areAnimationSupported = (typeof ngServerMode === 'undefined' || !ngServerMode) && typeof document !== 'undefined' && typeof document?.documentElement?.getAnimations === 'function';
|
|
13064
|
-
function areAnimationsDisabled(lView) {
|
|
13065
|
-
const injector = lView[INJECTOR];
|
|
13066
|
-
return injector.get(ANIMATIONS_DISABLED, DEFAULT_ANIMATIONS_DISABLED);
|
|
13067
|
-
}
|
|
13068
|
-
function assertAnimationTypes(value, instruction) {
|
|
13069
|
-
if (value == null || typeof value !== 'string' && typeof value !== 'function') {
|
|
13070
|
-
throw new RuntimeError(650, `'${instruction}' value must be a string of CSS classes or an animation function, got ${stringify(value)}`);
|
|
13071
|
-
}
|
|
13072
|
-
}
|
|
13073
|
-
function assertElementNodes(nativeElement, instruction) {
|
|
13074
|
-
if (nativeElement.nodeType !== Node.ELEMENT_NODE) {
|
|
13075
|
-
throw new RuntimeError(650, `'${instruction}' can only be used on an element node, got ${stringify(nativeElement.nodeType)}`);
|
|
13076
|
-
}
|
|
13077
|
-
}
|
|
13078
|
-
function trackEnterClasses(el, classList, cleanupFns) {
|
|
13079
|
-
const elementData = enterClassMap.get(el);
|
|
13080
|
-
if (elementData) {
|
|
13081
|
-
for (const klass of classList) {
|
|
13082
|
-
elementData.classList.push(klass);
|
|
13083
|
-
}
|
|
13084
|
-
for (const fn of cleanupFns) {
|
|
13085
|
-
elementData.cleanupFns.push(fn);
|
|
13086
|
-
}
|
|
13087
|
-
} else {
|
|
13088
|
-
enterClassMap.set(el, {
|
|
13089
|
-
classList,
|
|
13090
|
-
cleanupFns
|
|
13091
|
-
});
|
|
13092
|
-
}
|
|
13093
|
-
}
|
|
13094
|
-
function cleanupEnterClassData(element) {
|
|
13095
|
-
const elementData = enterClassMap.get(element);
|
|
13096
|
-
if (elementData) {
|
|
13097
|
-
for (const fn of elementData.cleanupFns) {
|
|
13098
|
-
fn();
|
|
13099
|
-
}
|
|
13100
|
-
enterClassMap.delete(element);
|
|
13101
|
-
}
|
|
13102
|
-
longestAnimations.delete(element);
|
|
13103
|
-
}
|
|
13104
|
-
const noOpAnimationComplete = () => {};
|
|
13105
|
-
const enterClassMap = new WeakMap();
|
|
13106
|
-
const longestAnimations = new WeakMap();
|
|
13107
|
-
const leavingNodes = new WeakMap();
|
|
13108
|
-
function clearLeavingNodes(tNode, el) {
|
|
13109
|
-
const nodes = leavingNodes.get(tNode);
|
|
13110
|
-
if (nodes && nodes.length > 0) {
|
|
13111
|
-
const ix = nodes.findIndex(node => node === el);
|
|
13112
|
-
if (ix > -1) nodes.splice(ix, 1);
|
|
13113
|
-
}
|
|
13114
|
-
if (nodes?.length === 0) {
|
|
13115
|
-
leavingNodes.delete(tNode);
|
|
13116
|
-
}
|
|
13117
|
-
}
|
|
13118
|
-
function cancelLeavingNodes(tNode, lView) {
|
|
13119
|
-
const leavingEl = leavingNodes.get(tNode)?.shift();
|
|
13120
|
-
const lContainer = lView[DECLARATION_LCONTAINER];
|
|
13121
|
-
if (lContainer) {
|
|
13122
|
-
const beforeNode = getBeforeNodeForView(tNode.index, lContainer);
|
|
13123
|
-
const previousNode = beforeNode?.previousSibling;
|
|
13124
|
-
if (leavingEl && previousNode && leavingEl === previousNode) {
|
|
13125
|
-
leavingEl.dispatchEvent(new CustomEvent('animationend', {
|
|
13126
|
-
detail: {
|
|
13127
|
-
cancel: true
|
|
13128
|
-
}
|
|
13129
|
-
}));
|
|
13130
|
-
}
|
|
13131
|
-
}
|
|
13132
|
-
}
|
|
13133
|
-
function trackLeavingNodes(tNode, el) {
|
|
13134
|
-
if (leavingNodes.has(tNode)) {
|
|
13135
|
-
leavingNodes.get(tNode)?.push(el);
|
|
13136
|
-
} else {
|
|
13137
|
-
leavingNodes.set(tNode, [el]);
|
|
13138
|
-
}
|
|
13139
|
-
}
|
|
13140
|
-
function getLViewEnterAnimations(lView) {
|
|
13141
|
-
const animationData = lView[ANIMATIONS] ??= {};
|
|
13142
|
-
return animationData.enter ??= new Map();
|
|
13143
|
-
}
|
|
13144
|
-
function getLViewLeaveAnimations(lView) {
|
|
13145
|
-
const animationData = lView[ANIMATIONS] ??= {};
|
|
13146
|
-
return animationData.leave ??= new Map();
|
|
13147
|
-
}
|
|
13148
|
-
function getClassListFromValue(value) {
|
|
13149
|
-
const classes = typeof value === 'function' ? value() : value;
|
|
13150
|
-
let classList = Array.isArray(classes) ? classes : null;
|
|
13151
|
-
if (typeof classes === 'string') {
|
|
13152
|
-
classList = classes.trim().split(/\s+/).filter(k => k);
|
|
13153
|
-
}
|
|
13154
|
-
return classList;
|
|
13155
|
-
}
|
|
13156
|
-
function cancelAnimationsIfRunning(element, renderer) {
|
|
13157
|
-
if (!areAnimationSupported) return;
|
|
13158
|
-
const elementData = enterClassMap.get(element);
|
|
13159
|
-
if (elementData && elementData.classList.length > 0 && elementHasClassList(element, elementData.classList)) {
|
|
13160
|
-
for (const klass of elementData.classList) {
|
|
13161
|
-
renderer.removeClass(element, klass);
|
|
13162
|
-
}
|
|
13163
|
-
}
|
|
13164
|
-
cleanupEnterClassData(element);
|
|
13165
|
-
}
|
|
13166
|
-
function elementHasClassList(element, classList) {
|
|
13167
|
-
for (const className of classList) {
|
|
13168
|
-
if (element.classList.contains(className)) return true;
|
|
13169
|
-
}
|
|
13170
|
-
return false;
|
|
13171
|
-
}
|
|
13172
|
-
function isLongestAnimation(event, nativeElement) {
|
|
13173
|
-
const longestAnimation = longestAnimations.get(nativeElement);
|
|
13174
|
-
if (longestAnimation === undefined) return true;
|
|
13175
|
-
return nativeElement === event.target && (longestAnimation.animationName !== undefined && event.animationName === longestAnimation.animationName || longestAnimation.propertyName !== undefined && event.propertyName === longestAnimation.propertyName);
|
|
13176
|
-
}
|
|
13177
|
-
function addAnimationToLView(animations, tNode, fn) {
|
|
13178
|
-
const nodeAnimations = animations.get(tNode.index) ?? {
|
|
13179
|
-
animateFns: []
|
|
13180
|
-
};
|
|
13181
|
-
nodeAnimations.animateFns.push(fn);
|
|
13182
|
-
animations.set(tNode.index, nodeAnimations);
|
|
13183
|
-
}
|
|
13184
|
-
function cleanupAfterLeaveAnimations(resolvers, cleanupFns) {
|
|
13185
|
-
if (resolvers) {
|
|
13186
|
-
for (const fn of resolvers) {
|
|
13187
|
-
fn();
|
|
13188
|
-
}
|
|
13189
|
-
}
|
|
13190
|
-
for (const fn of cleanupFns) {
|
|
13191
|
-
fn();
|
|
13192
|
-
}
|
|
13193
|
-
}
|
|
13194
|
-
function clearLViewNodeAnimationResolvers(lView, tNode) {
|
|
13195
|
-
const nodeAnimations = getLViewLeaveAnimations(lView).get(tNode.index);
|
|
13196
|
-
if (nodeAnimations) nodeAnimations.resolvers = undefined;
|
|
13197
|
-
}
|
|
13198
|
-
function leaveAnimationFunctionCleanup(lView, tNode, nativeElement, resolvers, cleanupFns) {
|
|
13199
|
-
clearLeavingNodes(tNode, nativeElement);
|
|
13200
|
-
cleanupAfterLeaveAnimations(resolvers, cleanupFns);
|
|
13201
|
-
clearLViewNodeAnimationResolvers(lView, tNode);
|
|
13202
|
-
}
|
|
13203
|
-
|
|
13204
13307
|
function ɵɵanimateEnter(value) {
|
|
13205
13308
|
performanceMarkFeature('NgAnimateEnter');
|
|
13206
13309
|
if (typeof ngServerMode !== 'undefined' && ngServerMode || !areAnimationSupported) {
|
|
@@ -13212,17 +13315,16 @@ function ɵɵanimateEnter(value) {
|
|
|
13212
13315
|
return ɵɵanimateEnter;
|
|
13213
13316
|
}
|
|
13214
13317
|
const tNode = getCurrentTNode();
|
|
13215
|
-
|
|
13216
|
-
addAnimationToLView(getLViewEnterAnimations(lView), tNode, () => runEnterAnimation(lView, tNode, value));
|
|
13318
|
+
const ngZone = lView[INJECTOR].get(NgZone);
|
|
13319
|
+
addAnimationToLView(getLViewEnterAnimations(lView), tNode, () => runEnterAnimation(lView, tNode, value, ngZone));
|
|
13217
13320
|
initializeAnimationQueueScheduler(lView[INJECTOR]);
|
|
13218
13321
|
queueEnterAnimations(lView[INJECTOR], getLViewEnterAnimations(lView));
|
|
13219
13322
|
return ɵɵanimateEnter;
|
|
13220
13323
|
}
|
|
13221
|
-
function runEnterAnimation(lView, tNode, value) {
|
|
13324
|
+
function runEnterAnimation(lView, tNode, value, ngZone) {
|
|
13222
13325
|
const nativeElement = getNativeByTNode(tNode, lView);
|
|
13223
13326
|
ngDevMode && assertElementNodes(nativeElement, 'animate.enter');
|
|
13224
13327
|
const renderer = lView[RENDERER];
|
|
13225
|
-
const ngZone = lView[INJECTOR].get(NgZone);
|
|
13226
13328
|
const activeClasses = getClassListFromValue(value);
|
|
13227
13329
|
const cleanupFns = [];
|
|
13228
13330
|
const handleEnterAnimationStart = event => {
|
|
@@ -13280,7 +13382,6 @@ function ɵɵanimateEnterListener(value) {
|
|
|
13280
13382
|
return ɵɵanimateEnterListener;
|
|
13281
13383
|
}
|
|
13282
13384
|
const tNode = getCurrentTNode();
|
|
13283
|
-
cancelLeavingNodes(tNode, lView);
|
|
13284
13385
|
addAnimationToLView(getLViewEnterAnimations(lView), tNode, () => runEnterAnimationFunction(lView, tNode, value));
|
|
13285
13386
|
initializeAnimationQueueScheduler(lView[INJECTOR]);
|
|
13286
13387
|
queueEnterAnimations(lView[INJECTOR], getLViewEnterAnimations(lView));
|
|
@@ -13306,12 +13407,12 @@ function ɵɵanimateLeave(value) {
|
|
|
13306
13407
|
return ɵɵanimateLeave;
|
|
13307
13408
|
}
|
|
13308
13409
|
const tNode = getCurrentTNode();
|
|
13309
|
-
|
|
13310
|
-
addAnimationToLView(getLViewLeaveAnimations(lView), tNode, () => runLeaveAnimations(lView, tNode, value));
|
|
13410
|
+
const ngZone = lView[INJECTOR].get(NgZone);
|
|
13411
|
+
addAnimationToLView(getLViewLeaveAnimations(lView), tNode, () => runLeaveAnimations(lView, tNode, value, ngZone));
|
|
13311
13412
|
initializeAnimationQueueScheduler(lView[INJECTOR]);
|
|
13312
13413
|
return ɵɵanimateLeave;
|
|
13313
13414
|
}
|
|
13314
|
-
function runLeaveAnimations(lView, tNode, value) {
|
|
13415
|
+
function runLeaveAnimations(lView, tNode, value, ngZone) {
|
|
13315
13416
|
const {
|
|
13316
13417
|
promise,
|
|
13317
13418
|
resolve
|
|
@@ -13319,7 +13420,6 @@ function runLeaveAnimations(lView, tNode, value) {
|
|
|
13319
13420
|
const nativeElement = getNativeByTNode(tNode, lView);
|
|
13320
13421
|
ngDevMode && assertElementNodes(nativeElement, 'animate.leave');
|
|
13321
13422
|
const renderer = lView[RENDERER];
|
|
13322
|
-
const ngZone = lView[INJECTOR].get(NgZone);
|
|
13323
13423
|
allLeavingAnimations.add(lView[ID]);
|
|
13324
13424
|
(getLViewLeaveAnimations(lView).get(tNode.index).resolvers ??= []).push(resolve);
|
|
13325
13425
|
const activeClasses = getClassListFromValue(value);
|
|
@@ -13379,13 +13479,14 @@ function ɵɵanimateLeaveListener(value) {
|
|
|
13379
13479
|
ngDevMode && assertAnimationTypes(value, 'animate.leave');
|
|
13380
13480
|
const lView = getLView();
|
|
13381
13481
|
const tNode = getCurrentTNode();
|
|
13382
|
-
cancelLeavingNodes(tNode, lView);
|
|
13383
13482
|
allLeavingAnimations.add(lView[ID]);
|
|
13384
|
-
|
|
13483
|
+
const ngZone = lView[INJECTOR].get(NgZone);
|
|
13484
|
+
const maxAnimationTimeout = lView[INJECTOR].get(MAX_ANIMATION_TIMEOUT);
|
|
13485
|
+
addAnimationToLView(getLViewLeaveAnimations(lView), tNode, () => runLeaveAnimationFunction(lView, tNode, value, ngZone, maxAnimationTimeout));
|
|
13385
13486
|
initializeAnimationQueueScheduler(lView[INJECTOR]);
|
|
13386
13487
|
return ɵɵanimateLeaveListener;
|
|
13387
13488
|
}
|
|
13388
|
-
function runLeaveAnimationFunction(lView, tNode, value) {
|
|
13489
|
+
function runLeaveAnimationFunction(lView, tNode, value, ngZone, maxAnimationTimeout) {
|
|
13389
13490
|
const {
|
|
13390
13491
|
promise,
|
|
13391
13492
|
resolve
|
|
@@ -13395,8 +13496,6 @@ function runLeaveAnimationFunction(lView, tNode, value) {
|
|
|
13395
13496
|
const cleanupFns = [];
|
|
13396
13497
|
const renderer = lView[RENDERER];
|
|
13397
13498
|
const animationsDisabled = areAnimationsDisabled(lView);
|
|
13398
|
-
const ngZone = lView[INJECTOR].get(NgZone);
|
|
13399
|
-
const maxAnimationTimeout = lView[INJECTOR].get(MAX_ANIMATION_TIMEOUT);
|
|
13400
13499
|
(getLViewLeaveAnimations(lView).get(tNode.index).resolvers ??= []).push(resolve);
|
|
13401
13500
|
const resolvers = getLViewLeaveAnimations(lView).get(tNode.index)?.resolvers;
|
|
13402
13501
|
if (animationsDisabled) {
|
|
@@ -17810,7 +17909,7 @@ function getPipeMetadata(type, meta) {
|
|
|
17810
17909
|
|
|
17811
17910
|
const Directive = makeDecorator('Directive', (dir = {}) => dir, undefined, undefined, (type, meta) => compileDirective(type, meta));
|
|
17812
17911
|
const Component = makeDecorator('Component', (c = {}) => ({
|
|
17813
|
-
changeDetection: ChangeDetectionStrategy.
|
|
17912
|
+
changeDetection: ChangeDetectionStrategy.Eager,
|
|
17814
17913
|
...c
|
|
17815
17914
|
}), Directive, undefined, (type, meta) => compileComponent(type, meta));
|
|
17816
17915
|
const Pipe = makeDecorator('Pipe', p => ({
|