@angular/core 21.0.0-next.8 → 21.0.0-next.9
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 +481 -438
- package/fesm2022/_debug_node-chunk.mjs.map +1 -1
- package/fesm2022/_effect-chunk.mjs +512 -48
- package/fesm2022/_effect-chunk.mjs.map +1 -1
- package/fesm2022/{_root_effect_scheduler-chunk.mjs → _effect-chunk2.mjs} +197 -19
- package/fesm2022/_effect-chunk2.mjs.map +1 -0
- package/fesm2022/_not_found-chunk.mjs +1 -1
- package/fesm2022/_resource-chunk.mjs +5 -173
- package/fesm2022/_resource-chunk.mjs.map +1 -1
- package/fesm2022/_untracked-chunk.mjs +117 -0
- package/fesm2022/_untracked-chunk.mjs.map +1 -0
- package/fesm2022/_weak_ref-chunk.mjs +1 -1
- package/fesm2022/core.mjs +8 -7
- 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 +4 -4
- package/fesm2022/primitives-signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +5 -5
- package/fesm2022/testing.mjs +3 -3
- package/package.json +2 -2
- package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +5 -5
- package/schematics/bundles/application-config-core.cjs +5 -5
- package/schematics/bundles/{apply_import_manager-CBLmogDD.cjs → apply_import_manager-CoeTX_Ob.cjs} +3 -3
- package/schematics/bundles/bootstrap-options-migration.cjs +5 -5
- package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
- package/schematics/bundles/common-to-standalone-migration.cjs +385 -0
- package/schematics/bundles/{compiler_host-T6xncpiw.cjs → compiler_host-emLDwK2U.cjs} +2 -2
- package/schematics/bundles/control-flow-migration.cjs +4 -4
- package/schematics/bundles/imports-DwPXlGFl.cjs +1 -1
- package/schematics/bundles/{index-DWSaRJdz.cjs → index-CLxYZ09c.cjs} +4 -4
- package/schematics/bundles/{index-BnmACOsq.cjs → index-Dvqnp6JS.cjs} +166 -66
- package/schematics/bundles/inject-migration.cjs +3 -3
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-Cu-FR4L5.cjs → migrate_ts_type_references-CpM5FPGa.cjs} +5 -5
- package/schematics/bundles/{ng_component_template-BkWiUuGG.cjs → ng_component_template-BRbBIAUX.cjs} +2 -2
- package/schematics/bundles/ng_decorators-BI0uV7KI.cjs +1 -1
- package/schematics/bundles/ngclass-to-class-migration.cjs +7 -7
- package/schematics/bundles/ngstyle-to-style-migration.cjs +7 -7
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +6 -6
- package/schematics/bundles/{parse_html-C97tKKp3.cjs → parse_html-CPWfkfhR.cjs} +2 -2
- package/schematics/bundles/{project_paths-C6g3lqjX.cjs → project_paths-C8H7KDJ3.cjs} +3 -3
- package/schematics/bundles/{project_tsconfig_paths-CdhVNYMk.cjs → project_tsconfig_paths-CiBzGSIa.cjs} +12 -4
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +3 -3
- package/schematics/bundles/router-current-navigation.cjs +4 -4
- package/schematics/bundles/router-last-successful-navigation.cjs +4 -4
- package/schematics/bundles/router-testing-module-migration.cjs +5 -5
- package/schematics/bundles/self-closing-tags-migration.cjs +6 -6
- package/schematics/bundles/signal-input-migration.cjs +7 -7
- package/schematics/bundles/signal-queries-migration.cjs +7 -7
- package/schematics/bundles/signals.cjs +7 -7
- package/schematics/bundles/standalone-migration.cjs +4 -4
- package/schematics/bundles/symbol-BObKoqes.cjs +1 -1
- package/schematics/collection.json +6 -0
- package/schematics/migrations/common-to-standalone-migration/schema.json +14 -0
- package/types/_api-chunk.d.ts +1 -1
- package/types/_chrome_dev_tools_performance-chunk.d.ts +20 -12
- package/types/_discovery-chunk.d.ts +12 -6
- package/types/_effect-chunk.d.ts +1 -1
- package/types/_event_dispatcher-chunk.d.ts +1 -1
- package/types/_formatter-chunk.d.ts +4 -3
- package/types/_weak_ref-chunk.d.ts +1 -1
- package/types/core.d.ts +49 -20
- package/types/primitives-di.d.ts +1 -1
- package/types/primitives-event-dispatch.d.ts +1 -1
- package/types/primitives-signals.d.ts +2 -2
- package/types/rxjs-interop.d.ts +1 -1
- package/types/testing.d.ts +1 -1
- package/fesm2022/_root_effect_scheduler-chunk.mjs.map +0 -1
- package/fesm2022/_signal-chunk.mjs +0 -581
- package/fesm2022/_signal-chunk.mjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-next.
|
|
2
|
+
* @license Angular v21.0.0-next.9
|
|
3
3
|
* (c) 2010-2025 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, ENVIRONMENT_INITIALIZER, inject, formatRuntimeError, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, XSS_SECURITY_URL, renderStringify, ENVIRONMENT, makeEnvironmentProviders, isDirectiveHost, resetPreOrderHookFlags, PARENT, RENDERER, CHILD_TAIL, assertSame, assertFirstUpdatePass, getSelectedIndex, getTView, assertIndexInDeclRange, setSelectedIndex, assertLContainer, MOVED_VIEWS, isDestroyed, REACTIVE_TEMPLATE_CONSUMER, DECLARATION_LCONTAINER, QUERIES, assertNotReactive, ON_DESTROY_HOOKS, assertFunction, EFFECTS, assertProjectionSlots, NATIVE, assertParentView, CONTAINER_HEADER_OFFSET,
|
|
8
|
-
import { setActiveConsumer, SIGNAL, consumerDestroy, REACTIVE_NODE, consumerPollProducersForChange, consumerBeforeComputation, getActiveConsumer, consumerAfterComputation, createComputed, setThrowInvalidWriteToSignalError } from './
|
|
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, ENVIRONMENT_INITIALIZER, inject, formatRuntimeError, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, XSS_SECURITY_URL, renderStringify, ENVIRONMENT, makeEnvironmentProviders, isDirectiveHost, resetPreOrderHookFlags, PARENT, RENDERER, CHILD_TAIL, assertSame, assertFirstUpdatePass, getSelectedIndex, getTView, assertIndexInDeclRange, setSelectedIndex, NgZone, ChangeDetectionScheduler, ErrorHandler, AFTER_RENDER_SEQUENCES_TO_ADD, markAncestorsForTraversal, assertNotInReactiveContext, assertInInjectionContext, DestroyRef, ViewContext, assertLContainer, MOVED_VIEWS, isDestroyed, REACTIVE_TEMPLATE_CONSUMER, DECLARATION_LCONTAINER, QUERIES, assertNotReactive, ON_DESTROY_HOOKS, assertFunction, EFFECTS, assertProjectionSlots, NATIVE, ANIMATIONS, assertParentView, CONTAINER_HEADER_OFFSET, assertNotSame, setCurrentDirectiveIndex, setCurrentTNode, getElementDepthCount, increaseElementDepthCount, wasLastNodeCreated, isCurrentTNodeParent, setCurrentTNodeAsNotParent, assertHasParent, INTERNAL_APPLICATION_ERROR_HANDLER, stringify, 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, assertNotDefined, nextBindingIndex, getSelectedTNode, getDirectiveDefOrThrow, getTNode, assertComponentType, debugStringifyTypeForError, EnvironmentInjector, SVG_NAMESPACE, MATH_ML_NAMESPACE, viewAttachedToContainer, storeCleanupWithContext, signal, createInjectorWithoutInjectorInstances, R3Injector, getNullInjector, internalImportProvidersFrom, initNgDevMode, fillProperties, getBindingsEnabled, lastNodeWasCreated, removeLViewOnDestroy, walkUpViews, getNativeByIndex, assertElement, arrayInsert2, arraySplice, setInjectorProfiler, NullInjector, INJECTOR_DEF_TYPES, walkProviderTree, getInjectorDef, deepForEach, EffectRefImpl, isTypeProvider, isSignal, 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, isWritableSignal, store, providerToFactory, emitProviderConfiguredEvent, isClassProvider, getBindingRoot, 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, scheduleCallbackWithMicrotask, PROVIDED_ZONELESS, NoopNgZone, scheduleCallbackWithRafRace, getNativeByTNodeOrNull } from './_effect-chunk2.mjs';
|
|
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';
|
|
11
11
|
import { map } from 'rxjs/operators';
|
|
@@ -494,6 +494,15 @@ function getParentCtor(ctor) {
|
|
|
494
494
|
return parentCtor || Object;
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
+
function applyValueToInputField(instance, inputSignalNode, privateName, value) {
|
|
498
|
+
if (inputSignalNode !== null) {
|
|
499
|
+
inputSignalNode.applyValueToInputSignal(inputSignalNode, value);
|
|
500
|
+
}
|
|
501
|
+
else {
|
|
502
|
+
instance[privateName] = value;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
497
506
|
/**
|
|
498
507
|
* Represents a basic change from a previous to a new value for a single
|
|
499
508
|
* property on a directive instance. Passed as a value in a
|
|
@@ -520,15 +529,6 @@ class SimpleChange {
|
|
|
520
529
|
}
|
|
521
530
|
}
|
|
522
531
|
|
|
523
|
-
function applyValueToInputField(instance, inputSignalNode, privateName, value) {
|
|
524
|
-
if (inputSignalNode !== null) {
|
|
525
|
-
inputSignalNode.applyValueToInputSignal(inputSignalNode, value);
|
|
526
|
-
}
|
|
527
|
-
else {
|
|
528
|
-
instance[privateName] = value;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
|
|
532
532
|
/**
|
|
533
533
|
* The NgOnChangesFeature decorates a component with support for the ngOnChanges
|
|
534
534
|
* lifecycle hook, so it should be included in any component that implements
|
|
@@ -7380,130 +7380,393 @@ function determineLongestAnimationFromElementAnimations(el, animationsMap, anima
|
|
|
7380
7380
|
}
|
|
7381
7381
|
const allLeavingAnimations = new Set();
|
|
7382
7382
|
|
|
7383
|
+
/** Actions that are supported by the tracing framework. */
|
|
7384
|
+
var TracingAction;
|
|
7385
|
+
(function (TracingAction) {
|
|
7386
|
+
TracingAction[TracingAction["CHANGE_DETECTION"] = 0] = "CHANGE_DETECTION";
|
|
7387
|
+
TracingAction[TracingAction["AFTER_NEXT_RENDER"] = 1] = "AFTER_NEXT_RENDER";
|
|
7388
|
+
})(TracingAction || (TracingAction = {}));
|
|
7383
7389
|
/**
|
|
7384
|
-
*
|
|
7385
|
-
*/
|
|
7386
|
-
const ANIMATIONS_DISABLED = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationsDisabled' : '', {
|
|
7387
|
-
providedIn: 'root',
|
|
7388
|
-
factory: () => false,
|
|
7389
|
-
});
|
|
7390
|
-
/**
|
|
7391
|
-
* A [DI token](api/core/InjectionToken) for the queue of all animations.
|
|
7390
|
+
* Injection token for a `TracingService`, optionally provided.
|
|
7392
7391
|
*/
|
|
7393
|
-
const
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
queue: new Set(),
|
|
7398
|
-
isScheduled: false,
|
|
7399
|
-
};
|
|
7400
|
-
},
|
|
7401
|
-
});
|
|
7392
|
+
const TracingService = new InjectionToken(typeof ngDevMode !== undefined && ngDevMode ? 'TracingService' : '');
|
|
7393
|
+
|
|
7394
|
+
const markedFeatures = new Set();
|
|
7395
|
+
// tslint:disable:ban
|
|
7402
7396
|
/**
|
|
7403
|
-
* A
|
|
7404
|
-
* before element removal. The default value mirrors from Chrome's cross document
|
|
7405
|
-
* navigation view transition timeout. It's intended to prevent people from accidentally
|
|
7406
|
-
* forgetting to call the removal function in their callback. Also serves as a delay
|
|
7407
|
-
* for when stylesheets are pruned.
|
|
7397
|
+
* A guarded `performance.mark` for feature marking.
|
|
7408
7398
|
*
|
|
7409
|
-
*
|
|
7399
|
+
* This method exists because while all supported browser and node.js version supported by Angular
|
|
7400
|
+
* support performance.mark API. This is not the case for other environments such as JSDOM and
|
|
7401
|
+
* Cloudflare workers.
|
|
7410
7402
|
*/
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
}
|
|
7415
|
-
|
|
7403
|
+
function performanceMarkFeature(feature) {
|
|
7404
|
+
if (markedFeatures.has(feature)) {
|
|
7405
|
+
return;
|
|
7406
|
+
}
|
|
7407
|
+
markedFeatures.add(feature);
|
|
7408
|
+
performance?.mark?.('mark_feature_usage', { detail: { feature } });
|
|
7409
|
+
}
|
|
7416
7410
|
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
for (const animateFn of enterAnimations.get(tNode.index).animateFns) {
|
|
7422
|
-
animationQueue.queue.add(animateFn);
|
|
7423
|
-
}
|
|
7411
|
+
class AfterRenderManager {
|
|
7412
|
+
impl = null;
|
|
7413
|
+
execute() {
|
|
7414
|
+
this.impl?.execute();
|
|
7424
7415
|
}
|
|
7416
|
+
/** @nocollapse */
|
|
7417
|
+
static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({
|
|
7418
|
+
token: AfterRenderManager,
|
|
7419
|
+
providedIn: 'root',
|
|
7420
|
+
factory: () => new AfterRenderManager(),
|
|
7421
|
+
});
|
|
7425
7422
|
}
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7423
|
+
const AFTER_RENDER_PHASES = /* @__PURE__ **/ (() => [
|
|
7424
|
+
0 /* AfterRenderPhase.EarlyRead */,
|
|
7425
|
+
1 /* AfterRenderPhase.Write */,
|
|
7426
|
+
2 /* AfterRenderPhase.MixedReadWrite */,
|
|
7427
|
+
3 /* AfterRenderPhase.Read */,
|
|
7428
|
+
])();
|
|
7429
|
+
class AfterRenderImpl {
|
|
7430
|
+
ngZone = inject(NgZone);
|
|
7431
|
+
scheduler = inject(ChangeDetectionScheduler);
|
|
7432
|
+
errorHandler = inject(ErrorHandler, { optional: true });
|
|
7433
|
+
/** Current set of active sequences. */
|
|
7434
|
+
sequences = new Set();
|
|
7435
|
+
/** Tracks registrations made during the current set of executions. */
|
|
7436
|
+
deferredRegistrations = new Set();
|
|
7437
|
+
/** Whether the `AfterRenderManager` is currently executing hooks. */
|
|
7438
|
+
executing = false;
|
|
7439
|
+
constructor() {
|
|
7440
|
+
// Inject the tracing service to make sure it's initialized.
|
|
7441
|
+
inject(TracingService, { optional: true });
|
|
7442
|
+
}
|
|
7443
|
+
/**
|
|
7444
|
+
* Run the sequence of phases of hooks, once through. As a result of executing some hooks, more
|
|
7445
|
+
* might be scheduled.
|
|
7446
|
+
*/
|
|
7447
|
+
execute() {
|
|
7448
|
+
const hasSequencesToExecute = this.sequences.size > 0;
|
|
7449
|
+
if (hasSequencesToExecute) {
|
|
7450
|
+
profiler(16 /* ProfilerEvent.AfterRenderHooksStart */);
|
|
7448
7451
|
}
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7452
|
+
this.executing = true;
|
|
7453
|
+
for (const phase of AFTER_RENDER_PHASES) {
|
|
7454
|
+
for (const sequence of this.sequences) {
|
|
7455
|
+
if (sequence.erroredOrDestroyed || !sequence.hooks[phase]) {
|
|
7456
|
+
continue;
|
|
7457
|
+
}
|
|
7458
|
+
try {
|
|
7459
|
+
sequence.pipelinedValue = this.ngZone.runOutsideAngular(() => this.maybeTrace(() => {
|
|
7460
|
+
const hookFn = sequence.hooks[phase];
|
|
7461
|
+
const value = hookFn(sequence.pipelinedValue);
|
|
7462
|
+
return value;
|
|
7463
|
+
}, sequence.snapshot));
|
|
7464
|
+
}
|
|
7465
|
+
catch (err) {
|
|
7466
|
+
sequence.erroredOrDestroyed = true;
|
|
7467
|
+
this.errorHandler?.handleError(err);
|
|
7468
|
+
}
|
|
7454
7469
|
}
|
|
7455
|
-
|
|
7456
|
-
|
|
7470
|
+
}
|
|
7471
|
+
this.executing = false;
|
|
7472
|
+
// Cleanup step to reset sequence state and also collect one-shot sequences for removal.
|
|
7473
|
+
for (const sequence of this.sequences) {
|
|
7474
|
+
sequence.afterRun();
|
|
7475
|
+
if (sequence.once) {
|
|
7476
|
+
this.sequences.delete(sequence);
|
|
7477
|
+
// Destroy the sequence so its on destroy callbacks can be cleaned up
|
|
7478
|
+
// immediately, instead of waiting until the injector is destroyed.
|
|
7479
|
+
sequence.destroy();
|
|
7457
7480
|
}
|
|
7458
7481
|
}
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
|
|
7482
|
+
for (const sequence of this.deferredRegistrations) {
|
|
7483
|
+
this.sequences.add(sequence);
|
|
7462
7484
|
}
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
// the nodeHasLeaveAnimations indicates to the renderer that the element needs to
|
|
7466
|
-
// be removed synchronously and sets the requireSynchronousElementRemoval flag in
|
|
7467
|
-
// the renderer.
|
|
7468
|
-
nativeRemoveNode(renderer, rNode, isComponent, nodeHasLeaveAnimations);
|
|
7469
|
-
});
|
|
7485
|
+
if (this.deferredRegistrations.size > 0) {
|
|
7486
|
+
this.scheduler.notify(7 /* NotificationSource.RenderHook */);
|
|
7470
7487
|
}
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
});
|
|
7488
|
+
this.deferredRegistrations.clear();
|
|
7489
|
+
if (hasSequencesToExecute) {
|
|
7490
|
+
profiler(17 /* ProfilerEvent.AfterRenderHooksEnd */);
|
|
7475
7491
|
}
|
|
7476
|
-
|
|
7477
|
-
|
|
7492
|
+
}
|
|
7493
|
+
register(sequence) {
|
|
7494
|
+
const { view } = sequence;
|
|
7495
|
+
if (view !== undefined) {
|
|
7496
|
+
// Delay adding it to the manager, add it to the view instead.
|
|
7497
|
+
(view[AFTER_RENDER_SEQUENCES_TO_ADD] ??= []).push(sequence);
|
|
7498
|
+
// Mark the view for traversal to ensure we eventually schedule the afterNextRender.
|
|
7499
|
+
markAncestorsForTraversal(view);
|
|
7500
|
+
view[FLAGS] |= 8192 /* LViewFlags.HasChildViewsToRefresh */;
|
|
7501
|
+
}
|
|
7502
|
+
else if (!this.executing) {
|
|
7503
|
+
this.addSequence(sequence);
|
|
7504
|
+
}
|
|
7505
|
+
else {
|
|
7506
|
+
this.deferredRegistrations.add(sequence);
|
|
7478
7507
|
}
|
|
7479
7508
|
}
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7509
|
+
addSequence(sequence) {
|
|
7510
|
+
this.sequences.add(sequence);
|
|
7511
|
+
// Trigger an `ApplicationRef.tick()` if one is not already pending/running, because we have a
|
|
7512
|
+
// new render hook that needs to run.
|
|
7513
|
+
this.scheduler.notify(7 /* NotificationSource.RenderHook */);
|
|
7514
|
+
}
|
|
7515
|
+
unregister(sequence) {
|
|
7516
|
+
if (this.executing && this.sequences.has(sequence)) {
|
|
7517
|
+
// We can't remove an `AfterRenderSequence` in the middle of iteration.
|
|
7518
|
+
// Instead, mark it as destroyed so it doesn't run any more, and mark it as one-shot so it'll
|
|
7519
|
+
// be removed at the end of the current execution.
|
|
7520
|
+
sequence.erroredOrDestroyed = true;
|
|
7521
|
+
sequence.pipelinedValue = undefined;
|
|
7522
|
+
sequence.once = true;
|
|
7523
|
+
}
|
|
7524
|
+
else {
|
|
7525
|
+
// It's safe to directly remove this sequence.
|
|
7526
|
+
this.sequences.delete(sequence);
|
|
7527
|
+
this.deferredRegistrations.delete(sequence);
|
|
7486
7528
|
}
|
|
7487
7529
|
}
|
|
7488
|
-
|
|
7489
|
-
|
|
7530
|
+
maybeTrace(fn, snapshot) {
|
|
7531
|
+
// Only trace the execution if the snapshot is defined.
|
|
7532
|
+
return snapshot ? snapshot.run(TracingAction.AFTER_NEXT_RENDER, fn) : fn();
|
|
7490
7533
|
}
|
|
7534
|
+
/** @nocollapse */
|
|
7535
|
+
static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({
|
|
7536
|
+
token: AfterRenderImpl,
|
|
7537
|
+
providedIn: 'root',
|
|
7538
|
+
factory: () => new AfterRenderImpl(),
|
|
7539
|
+
});
|
|
7540
|
+
}
|
|
7541
|
+
class AfterRenderSequence {
|
|
7542
|
+
impl;
|
|
7543
|
+
hooks;
|
|
7544
|
+
view;
|
|
7545
|
+
once;
|
|
7546
|
+
snapshot;
|
|
7547
|
+
/**
|
|
7548
|
+
* Whether this sequence errored or was destroyed during this execution, and hooks should no
|
|
7549
|
+
* longer run for it.
|
|
7550
|
+
*/
|
|
7551
|
+
erroredOrDestroyed = false;
|
|
7552
|
+
/**
|
|
7553
|
+
* The value returned by the last hook execution (if any), ready to be pipelined into the next
|
|
7554
|
+
* one.
|
|
7555
|
+
*/
|
|
7556
|
+
pipelinedValue = undefined;
|
|
7557
|
+
unregisterOnDestroy;
|
|
7558
|
+
constructor(impl, hooks, view, once, destroyRef, snapshot = null) {
|
|
7559
|
+
this.impl = impl;
|
|
7560
|
+
this.hooks = hooks;
|
|
7561
|
+
this.view = view;
|
|
7562
|
+
this.once = once;
|
|
7563
|
+
this.snapshot = snapshot;
|
|
7564
|
+
this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());
|
|
7565
|
+
}
|
|
7566
|
+
afterRun() {
|
|
7567
|
+
this.erroredOrDestroyed = false;
|
|
7568
|
+
this.pipelinedValue = undefined;
|
|
7569
|
+
// Clear the tracing snapshot after the initial run. This snapshot only
|
|
7570
|
+
// associates the initial run of the hook with the context that created it.
|
|
7571
|
+
// Follow-up runs are independent of that initial context and have different
|
|
7572
|
+
// triggers.
|
|
7573
|
+
this.snapshot?.dispose();
|
|
7574
|
+
this.snapshot = null;
|
|
7575
|
+
}
|
|
7576
|
+
destroy() {
|
|
7577
|
+
this.impl.unregister(this);
|
|
7578
|
+
this.unregisterOnDestroy?.();
|
|
7579
|
+
const scheduled = this.view?.[AFTER_RENDER_SEQUENCES_TO_ADD];
|
|
7580
|
+
if (scheduled) {
|
|
7581
|
+
this.view[AFTER_RENDER_SEQUENCES_TO_ADD] = scheduled.filter((s) => s !== this);
|
|
7582
|
+
}
|
|
7583
|
+
}
|
|
7584
|
+
}
|
|
7585
|
+
|
|
7586
|
+
function afterEveryRender(callbackOrSpec, options) {
|
|
7587
|
+
ngDevMode &&
|
|
7588
|
+
assertNotInReactiveContext(afterEveryRender, 'Call `afterEveryRender` outside of a reactive context. For example, schedule the render ' +
|
|
7589
|
+
'callback inside the component constructor`.');
|
|
7590
|
+
if (ngDevMode && !options?.injector) {
|
|
7591
|
+
assertInInjectionContext(afterEveryRender);
|
|
7592
|
+
}
|
|
7593
|
+
const injector = options?.injector ?? inject(Injector);
|
|
7594
|
+
if (typeof ngServerMode !== 'undefined' && ngServerMode) {
|
|
7595
|
+
return NOOP_AFTER_RENDER_REF;
|
|
7596
|
+
}
|
|
7597
|
+
performanceMarkFeature('NgAfterRender');
|
|
7598
|
+
return afterEveryRenderImpl(callbackOrSpec, injector, options, /* once */ false);
|
|
7599
|
+
}
|
|
7600
|
+
function afterNextRender(callbackOrSpec, options) {
|
|
7601
|
+
if (ngDevMode && !options?.injector) {
|
|
7602
|
+
assertInInjectionContext(afterNextRender);
|
|
7603
|
+
}
|
|
7604
|
+
const injector = options?.injector ?? inject(Injector);
|
|
7605
|
+
if (typeof ngServerMode !== 'undefined' && ngServerMode) {
|
|
7606
|
+
return NOOP_AFTER_RENDER_REF;
|
|
7607
|
+
}
|
|
7608
|
+
performanceMarkFeature('NgAfterNextRender');
|
|
7609
|
+
return afterEveryRenderImpl(callbackOrSpec, injector, options, /* once */ true);
|
|
7610
|
+
}
|
|
7611
|
+
function getHooks(callbackOrSpec) {
|
|
7612
|
+
if (callbackOrSpec instanceof Function) {
|
|
7613
|
+
return [undefined, undefined, /* MixedReadWrite */ callbackOrSpec, undefined];
|
|
7614
|
+
}
|
|
7615
|
+
else {
|
|
7616
|
+
return [
|
|
7617
|
+
callbackOrSpec.earlyRead,
|
|
7618
|
+
callbackOrSpec.write,
|
|
7619
|
+
callbackOrSpec.mixedReadWrite,
|
|
7620
|
+
callbackOrSpec.read,
|
|
7621
|
+
];
|
|
7622
|
+
}
|
|
7623
|
+
}
|
|
7624
|
+
/**
|
|
7625
|
+
* Shared implementation for `afterEveryRender` and `afterNextRender`.
|
|
7626
|
+
*/
|
|
7627
|
+
function afterEveryRenderImpl(callbackOrSpec, injector, options, once) {
|
|
7628
|
+
const manager = injector.get(AfterRenderManager);
|
|
7629
|
+
// Lazily initialize the handler implementation, if necessary. This is so that it can be
|
|
7630
|
+
// tree-shaken if `afterEveryRender` and `afterNextRender` aren't used.
|
|
7631
|
+
manager.impl ??= injector.get(AfterRenderImpl);
|
|
7632
|
+
const tracing = injector.get(TracingService, null, { optional: true });
|
|
7633
|
+
const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;
|
|
7634
|
+
const viewContext = injector.get(ViewContext, null, { optional: true });
|
|
7635
|
+
const sequence = new AfterRenderSequence(manager.impl, getHooks(callbackOrSpec), viewContext?.view, once, destroyRef, tracing?.snapshot(null));
|
|
7636
|
+
manager.impl.register(sequence);
|
|
7637
|
+
return sequence;
|
|
7638
|
+
}
|
|
7639
|
+
/** `AfterRenderRef` that does nothing. */
|
|
7640
|
+
const NOOP_AFTER_RENDER_REF = {
|
|
7641
|
+
destroy() { },
|
|
7642
|
+
};
|
|
7643
|
+
|
|
7644
|
+
/**
|
|
7645
|
+
* A [DI token](api/core/InjectionToken) for the queue of all animations.
|
|
7646
|
+
*/
|
|
7647
|
+
const ANIMATION_QUEUE = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationQueue' : '', {
|
|
7648
|
+
providedIn: 'root',
|
|
7649
|
+
factory: () => {
|
|
7650
|
+
return {
|
|
7651
|
+
queue: new Set(),
|
|
7652
|
+
isScheduled: false,
|
|
7653
|
+
scheduler: null,
|
|
7654
|
+
};
|
|
7655
|
+
},
|
|
7656
|
+
});
|
|
7657
|
+
function addToAnimationQueue(injector, animationFns) {
|
|
7658
|
+
const animationQueue = injector.get(ANIMATION_QUEUE);
|
|
7659
|
+
if (Array.isArray(animationFns)) {
|
|
7660
|
+
for (const animateFn of animationFns) {
|
|
7661
|
+
animationQueue.queue.add(animateFn);
|
|
7662
|
+
}
|
|
7663
|
+
}
|
|
7664
|
+
else {
|
|
7665
|
+
animationQueue.queue.add(animationFns);
|
|
7666
|
+
}
|
|
7667
|
+
animationQueue.scheduler && animationQueue.scheduler(injector);
|
|
7668
|
+
}
|
|
7669
|
+
function scheduleAnimationQueue(injector) {
|
|
7670
|
+
const animationQueue = injector.get(ANIMATION_QUEUE);
|
|
7671
|
+
// We only want to schedule the animation queue if it hasn't already been scheduled.
|
|
7672
|
+
if (!animationQueue.isScheduled) {
|
|
7673
|
+
afterNextRender(() => {
|
|
7674
|
+
animationQueue.isScheduled = false;
|
|
7675
|
+
for (let animateFn of animationQueue.queue) {
|
|
7676
|
+
animateFn();
|
|
7677
|
+
}
|
|
7678
|
+
animationQueue.queue.clear();
|
|
7679
|
+
}, { injector });
|
|
7680
|
+
animationQueue.isScheduled = true;
|
|
7681
|
+
}
|
|
7682
|
+
}
|
|
7683
|
+
function initializeAnimationQueueScheduler(injector) {
|
|
7684
|
+
const animationQueue = injector.get(ANIMATION_QUEUE);
|
|
7685
|
+
animationQueue.scheduler = scheduleAnimationQueue;
|
|
7686
|
+
animationQueue.scheduler(injector);
|
|
7687
|
+
}
|
|
7688
|
+
function queueEnterAnimations(injector, enterAnimations) {
|
|
7689
|
+
for (const [_, nodeAnimations] of enterAnimations) {
|
|
7690
|
+
addToAnimationQueue(injector, nodeAnimations.animateFns);
|
|
7691
|
+
}
|
|
7692
|
+
}
|
|
7693
|
+
|
|
7694
|
+
function maybeQueueEnterAnimation(parentLView, parent, tNode, injector) {
|
|
7695
|
+
const enterAnimations = parentLView?.[ANIMATIONS]?.enter;
|
|
7696
|
+
if (parent !== null && enterAnimations && enterAnimations.has(tNode.index)) {
|
|
7697
|
+
queueEnterAnimations(injector, enterAnimations);
|
|
7698
|
+
}
|
|
7699
|
+
}
|
|
7700
|
+
/**
|
|
7701
|
+
* NOTE: for performance reasons, the possible actions are inlined within the function instead of
|
|
7702
|
+
* being passed as an argument.
|
|
7703
|
+
*/
|
|
7704
|
+
function applyToElementOrContainer(action, renderer, injector, parent, lNodeToHandle, tNode, beforeNode, parentLView) {
|
|
7705
|
+
// If this slot was allocated for a text node dynamically created by i18n, the text node itself
|
|
7706
|
+
// won't be created until i18nApply() in the update block, so this node should be skipped.
|
|
7707
|
+
// For more info, see "ICU expressions should work inside an ngTemplateOutlet inside an ngFor"
|
|
7708
|
+
// in `i18n_spec.ts`.
|
|
7709
|
+
if (lNodeToHandle != null) {
|
|
7710
|
+
let lContainer;
|
|
7711
|
+
let isComponent = false;
|
|
7712
|
+
// We are expecting an RNode, but in the case of a component or LContainer the `RNode` is
|
|
7713
|
+
// wrapped in an array which needs to be unwrapped. We need to know if it is a component and if
|
|
7714
|
+
// it has LContainer so that we can process all of those cases appropriately.
|
|
7715
|
+
if (isLContainer(lNodeToHandle)) {
|
|
7716
|
+
lContainer = lNodeToHandle;
|
|
7717
|
+
}
|
|
7718
|
+
else if (isLView(lNodeToHandle)) {
|
|
7719
|
+
isComponent = true;
|
|
7720
|
+
ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');
|
|
7721
|
+
lNodeToHandle = lNodeToHandle[HOST];
|
|
7722
|
+
}
|
|
7723
|
+
const rNode = unwrapRNode(lNodeToHandle);
|
|
7724
|
+
if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {
|
|
7725
|
+
maybeQueueEnterAnimation(parentLView, parent, tNode, injector);
|
|
7726
|
+
if (beforeNode == null) {
|
|
7727
|
+
nativeAppendChild(renderer, parent, rNode);
|
|
7728
|
+
}
|
|
7729
|
+
else {
|
|
7730
|
+
nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
|
|
7731
|
+
}
|
|
7732
|
+
}
|
|
7733
|
+
else if (action === 1 /* WalkTNodeTreeAction.Insert */ && parent !== null) {
|
|
7734
|
+
maybeQueueEnterAnimation(parentLView, parent, tNode, injector);
|
|
7735
|
+
nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
|
|
7736
|
+
}
|
|
7737
|
+
else if (action === 2 /* WalkTNodeTreeAction.Detach */) {
|
|
7738
|
+
runLeaveAnimationsWithCallback(parentLView, tNode, injector, (nodeHasLeaveAnimations) => {
|
|
7739
|
+
// the nodeHasLeaveAnimations indicates to the renderer that the element needs to
|
|
7740
|
+
// be removed synchronously and sets the requireSynchronousElementRemoval flag in
|
|
7741
|
+
// the renderer.
|
|
7742
|
+
nativeRemoveNode(renderer, rNode, isComponent, nodeHasLeaveAnimations);
|
|
7743
|
+
});
|
|
7744
|
+
}
|
|
7745
|
+
else if (action === 3 /* WalkTNodeTreeAction.Destroy */) {
|
|
7746
|
+
runLeaveAnimationsWithCallback(parentLView, tNode, injector, () => {
|
|
7747
|
+
renderer.destroyNode(rNode);
|
|
7748
|
+
});
|
|
7749
|
+
}
|
|
7750
|
+
if (lContainer != null) {
|
|
7751
|
+
applyContainer(renderer, action, injector, lContainer, tNode, parent, beforeNode);
|
|
7752
|
+
}
|
|
7753
|
+
}
|
|
7754
|
+
}
|
|
7755
|
+
/**
|
|
7756
|
+
* Removes all DOM elements associated with a view.
|
|
7757
|
+
*
|
|
7758
|
+
* Because some root nodes of the view may be containers, we sometimes need
|
|
7759
|
+
* to propagate deeply into the nested containers to remove all elements in the
|
|
7760
|
+
* views beneath it.
|
|
7761
|
+
*
|
|
7762
|
+
* @param tView The `TView' of the `LView` from which elements should be added or removed
|
|
7763
|
+
* @param lView The view from which elements should be added or removed
|
|
7764
|
+
*/
|
|
7765
|
+
function removeViewFromDOM(tView, lView) {
|
|
7766
|
+
detachViewFromDOM(tView, lView);
|
|
7767
|
+
lView[HOST] = null;
|
|
7768
|
+
lView[T_HOST] = null;
|
|
7491
7769
|
}
|
|
7492
|
-
/**
|
|
7493
|
-
* Removes all DOM elements associated with a view.
|
|
7494
|
-
*
|
|
7495
|
-
* Because some root nodes of the view may be containers, we sometimes need
|
|
7496
|
-
* to propagate deeply into the nested containers to remove all elements in the
|
|
7497
|
-
* views beneath it.
|
|
7498
|
-
*
|
|
7499
|
-
* @param tView The `TView' of the `LView` from which elements should be added or removed
|
|
7500
|
-
* @param lView The view from which elements should be added or removed
|
|
7501
|
-
*/
|
|
7502
|
-
function removeViewFromDOM(tView, lView) {
|
|
7503
|
-
detachViewFromDOM(tView, lView);
|
|
7504
|
-
lView[HOST] = null;
|
|
7505
|
-
lView[T_HOST] = null;
|
|
7506
|
-
}
|
|
7507
7770
|
/**
|
|
7508
7771
|
* Adds all DOM elements associated with a view.
|
|
7509
7772
|
*
|
|
@@ -13816,7 +14079,7 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
13816
14079
|
}
|
|
13817
14080
|
function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
|
|
13818
14081
|
const tAttributes = rootSelectorOrNode
|
|
13819
|
-
? ['ng-version', '21.0.0-next.
|
|
14082
|
+
? ['ng-version', '21.0.0-next.9']
|
|
13820
14083
|
: // Extract attributes and classes from the first selector only to match VE behavior.
|
|
13821
14084
|
extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
|
|
13822
14085
|
let creationBindings = null;
|
|
@@ -15122,23 +15385,6 @@ function ɵɵvalidateIframeAttribute(attrValue, tagName, attrName) {
|
|
|
15122
15385
|
return attrValue;
|
|
15123
15386
|
}
|
|
15124
15387
|
|
|
15125
|
-
const markedFeatures = new Set();
|
|
15126
|
-
// tslint:disable:ban
|
|
15127
|
-
/**
|
|
15128
|
-
* A guarded `performance.mark` for feature marking.
|
|
15129
|
-
*
|
|
15130
|
-
* This method exists because while all supported browser and node.js version supported by Angular
|
|
15131
|
-
* support performance.mark API. This is not the case for other environments such as JSDOM and
|
|
15132
|
-
* Cloudflare workers.
|
|
15133
|
-
*/
|
|
15134
|
-
function performanceMarkFeature(feature) {
|
|
15135
|
-
if (markedFeatures.has(feature)) {
|
|
15136
|
-
return;
|
|
15137
|
-
}
|
|
15138
|
-
markedFeatures.add(feature);
|
|
15139
|
-
performance?.mark?.('mark_feature_usage', { detail: { feature } });
|
|
15140
|
-
}
|
|
15141
|
-
|
|
15142
15388
|
/**
|
|
15143
15389
|
* Represents an instance of an `NgModule` created by an `NgModuleFactory`.
|
|
15144
15390
|
* Provides access to the `NgModule` instance and related objects.
|
|
@@ -16481,258 +16727,14 @@ function getCleanupFnKeyByType(type) {
|
|
|
16481
16727
|
return key;
|
|
16482
16728
|
}
|
|
16483
16729
|
|
|
16484
|
-
/** Actions that are supported by the tracing framework. */
|
|
16485
|
-
var TracingAction;
|
|
16486
|
-
(function (TracingAction) {
|
|
16487
|
-
TracingAction[TracingAction["CHANGE_DETECTION"] = 0] = "CHANGE_DETECTION";
|
|
16488
|
-
TracingAction[TracingAction["AFTER_NEXT_RENDER"] = 1] = "AFTER_NEXT_RENDER";
|
|
16489
|
-
})(TracingAction || (TracingAction = {}));
|
|
16490
16730
|
/**
|
|
16491
|
-
*
|
|
16731
|
+
* Calculates a data slot index for defer block info (either static or
|
|
16732
|
+
* instance-specific), given an index of a defer instruction.
|
|
16492
16733
|
*/
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
|
|
16497
|
-
execute() {
|
|
16498
|
-
this.impl?.execute();
|
|
16499
|
-
}
|
|
16500
|
-
/** @nocollapse */
|
|
16501
|
-
static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({
|
|
16502
|
-
token: AfterRenderManager,
|
|
16503
|
-
providedIn: 'root',
|
|
16504
|
-
factory: () => new AfterRenderManager(),
|
|
16505
|
-
});
|
|
16506
|
-
}
|
|
16507
|
-
const AFTER_RENDER_PHASES = /* @__PURE__ **/ (() => [
|
|
16508
|
-
0 /* AfterRenderPhase.EarlyRead */,
|
|
16509
|
-
1 /* AfterRenderPhase.Write */,
|
|
16510
|
-
2 /* AfterRenderPhase.MixedReadWrite */,
|
|
16511
|
-
3 /* AfterRenderPhase.Read */,
|
|
16512
|
-
])();
|
|
16513
|
-
class AfterRenderImpl {
|
|
16514
|
-
ngZone = inject(NgZone);
|
|
16515
|
-
scheduler = inject(ChangeDetectionScheduler);
|
|
16516
|
-
errorHandler = inject(ErrorHandler, { optional: true });
|
|
16517
|
-
/** Current set of active sequences. */
|
|
16518
|
-
sequences = new Set();
|
|
16519
|
-
/** Tracks registrations made during the current set of executions. */
|
|
16520
|
-
deferredRegistrations = new Set();
|
|
16521
|
-
/** Whether the `AfterRenderManager` is currently executing hooks. */
|
|
16522
|
-
executing = false;
|
|
16523
|
-
constructor() {
|
|
16524
|
-
// Inject the tracing service to make sure it's initialized.
|
|
16525
|
-
inject(TracingService, { optional: true });
|
|
16526
|
-
}
|
|
16527
|
-
/**
|
|
16528
|
-
* Run the sequence of phases of hooks, once through. As a result of executing some hooks, more
|
|
16529
|
-
* might be scheduled.
|
|
16530
|
-
*/
|
|
16531
|
-
execute() {
|
|
16532
|
-
const hasSequencesToExecute = this.sequences.size > 0;
|
|
16533
|
-
if (hasSequencesToExecute) {
|
|
16534
|
-
profiler(16 /* ProfilerEvent.AfterRenderHooksStart */);
|
|
16535
|
-
}
|
|
16536
|
-
this.executing = true;
|
|
16537
|
-
for (const phase of AFTER_RENDER_PHASES) {
|
|
16538
|
-
for (const sequence of this.sequences) {
|
|
16539
|
-
if (sequence.erroredOrDestroyed || !sequence.hooks[phase]) {
|
|
16540
|
-
continue;
|
|
16541
|
-
}
|
|
16542
|
-
try {
|
|
16543
|
-
sequence.pipelinedValue = this.ngZone.runOutsideAngular(() => this.maybeTrace(() => {
|
|
16544
|
-
const hookFn = sequence.hooks[phase];
|
|
16545
|
-
const value = hookFn(sequence.pipelinedValue);
|
|
16546
|
-
return value;
|
|
16547
|
-
}, sequence.snapshot));
|
|
16548
|
-
}
|
|
16549
|
-
catch (err) {
|
|
16550
|
-
sequence.erroredOrDestroyed = true;
|
|
16551
|
-
this.errorHandler?.handleError(err);
|
|
16552
|
-
}
|
|
16553
|
-
}
|
|
16554
|
-
}
|
|
16555
|
-
this.executing = false;
|
|
16556
|
-
// Cleanup step to reset sequence state and also collect one-shot sequences for removal.
|
|
16557
|
-
for (const sequence of this.sequences) {
|
|
16558
|
-
sequence.afterRun();
|
|
16559
|
-
if (sequence.once) {
|
|
16560
|
-
this.sequences.delete(sequence);
|
|
16561
|
-
// Destroy the sequence so its on destroy callbacks can be cleaned up
|
|
16562
|
-
// immediately, instead of waiting until the injector is destroyed.
|
|
16563
|
-
sequence.destroy();
|
|
16564
|
-
}
|
|
16565
|
-
}
|
|
16566
|
-
for (const sequence of this.deferredRegistrations) {
|
|
16567
|
-
this.sequences.add(sequence);
|
|
16568
|
-
}
|
|
16569
|
-
if (this.deferredRegistrations.size > 0) {
|
|
16570
|
-
this.scheduler.notify(7 /* NotificationSource.RenderHook */);
|
|
16571
|
-
}
|
|
16572
|
-
this.deferredRegistrations.clear();
|
|
16573
|
-
if (hasSequencesToExecute) {
|
|
16574
|
-
profiler(17 /* ProfilerEvent.AfterRenderHooksEnd */);
|
|
16575
|
-
}
|
|
16576
|
-
}
|
|
16577
|
-
register(sequence) {
|
|
16578
|
-
const { view } = sequence;
|
|
16579
|
-
if (view !== undefined) {
|
|
16580
|
-
// Delay adding it to the manager, add it to the view instead.
|
|
16581
|
-
(view[AFTER_RENDER_SEQUENCES_TO_ADD] ??= []).push(sequence);
|
|
16582
|
-
// Mark the view for traversal to ensure we eventually schedule the afterNextRender.
|
|
16583
|
-
markAncestorsForTraversal(view);
|
|
16584
|
-
view[FLAGS] |= 8192 /* LViewFlags.HasChildViewsToRefresh */;
|
|
16585
|
-
}
|
|
16586
|
-
else if (!this.executing) {
|
|
16587
|
-
this.addSequence(sequence);
|
|
16588
|
-
}
|
|
16589
|
-
else {
|
|
16590
|
-
this.deferredRegistrations.add(sequence);
|
|
16591
|
-
}
|
|
16592
|
-
}
|
|
16593
|
-
addSequence(sequence) {
|
|
16594
|
-
this.sequences.add(sequence);
|
|
16595
|
-
// Trigger an `ApplicationRef.tick()` if one is not already pending/running, because we have a
|
|
16596
|
-
// new render hook that needs to run.
|
|
16597
|
-
this.scheduler.notify(7 /* NotificationSource.RenderHook */);
|
|
16598
|
-
}
|
|
16599
|
-
unregister(sequence) {
|
|
16600
|
-
if (this.executing && this.sequences.has(sequence)) {
|
|
16601
|
-
// We can't remove an `AfterRenderSequence` in the middle of iteration.
|
|
16602
|
-
// Instead, mark it as destroyed so it doesn't run any more, and mark it as one-shot so it'll
|
|
16603
|
-
// be removed at the end of the current execution.
|
|
16604
|
-
sequence.erroredOrDestroyed = true;
|
|
16605
|
-
sequence.pipelinedValue = undefined;
|
|
16606
|
-
sequence.once = true;
|
|
16607
|
-
}
|
|
16608
|
-
else {
|
|
16609
|
-
// It's safe to directly remove this sequence.
|
|
16610
|
-
this.sequences.delete(sequence);
|
|
16611
|
-
this.deferredRegistrations.delete(sequence);
|
|
16612
|
-
}
|
|
16613
|
-
}
|
|
16614
|
-
maybeTrace(fn, snapshot) {
|
|
16615
|
-
// Only trace the execution if the snapshot is defined.
|
|
16616
|
-
return snapshot ? snapshot.run(TracingAction.AFTER_NEXT_RENDER, fn) : fn();
|
|
16617
|
-
}
|
|
16618
|
-
/** @nocollapse */
|
|
16619
|
-
static ɵprov = /** @pureOrBreakMyCode */ /* @__PURE__ */ __defineInjectable({
|
|
16620
|
-
token: AfterRenderImpl,
|
|
16621
|
-
providedIn: 'root',
|
|
16622
|
-
factory: () => new AfterRenderImpl(),
|
|
16623
|
-
});
|
|
16624
|
-
}
|
|
16625
|
-
class AfterRenderSequence {
|
|
16626
|
-
impl;
|
|
16627
|
-
hooks;
|
|
16628
|
-
view;
|
|
16629
|
-
once;
|
|
16630
|
-
snapshot;
|
|
16631
|
-
/**
|
|
16632
|
-
* Whether this sequence errored or was destroyed during this execution, and hooks should no
|
|
16633
|
-
* longer run for it.
|
|
16634
|
-
*/
|
|
16635
|
-
erroredOrDestroyed = false;
|
|
16636
|
-
/**
|
|
16637
|
-
* The value returned by the last hook execution (if any), ready to be pipelined into the next
|
|
16638
|
-
* one.
|
|
16639
|
-
*/
|
|
16640
|
-
pipelinedValue = undefined;
|
|
16641
|
-
unregisterOnDestroy;
|
|
16642
|
-
constructor(impl, hooks, view, once, destroyRef, snapshot = null) {
|
|
16643
|
-
this.impl = impl;
|
|
16644
|
-
this.hooks = hooks;
|
|
16645
|
-
this.view = view;
|
|
16646
|
-
this.once = once;
|
|
16647
|
-
this.snapshot = snapshot;
|
|
16648
|
-
this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());
|
|
16649
|
-
}
|
|
16650
|
-
afterRun() {
|
|
16651
|
-
this.erroredOrDestroyed = false;
|
|
16652
|
-
this.pipelinedValue = undefined;
|
|
16653
|
-
// Clear the tracing snapshot after the initial run. This snapshot only
|
|
16654
|
-
// associates the initial run of the hook with the context that created it.
|
|
16655
|
-
// Follow-up runs are independent of that initial context and have different
|
|
16656
|
-
// triggers.
|
|
16657
|
-
this.snapshot?.dispose();
|
|
16658
|
-
this.snapshot = null;
|
|
16659
|
-
}
|
|
16660
|
-
destroy() {
|
|
16661
|
-
this.impl.unregister(this);
|
|
16662
|
-
this.unregisterOnDestroy?.();
|
|
16663
|
-
const scheduled = this.view?.[AFTER_RENDER_SEQUENCES_TO_ADD];
|
|
16664
|
-
if (scheduled) {
|
|
16665
|
-
this.view[AFTER_RENDER_SEQUENCES_TO_ADD] = scheduled.filter((s) => s !== this);
|
|
16666
|
-
}
|
|
16667
|
-
}
|
|
16668
|
-
}
|
|
16669
|
-
|
|
16670
|
-
function afterEveryRender(callbackOrSpec, options) {
|
|
16671
|
-
ngDevMode &&
|
|
16672
|
-
assertNotInReactiveContext(afterEveryRender, 'Call `afterEveryRender` outside of a reactive context. For example, schedule the render ' +
|
|
16673
|
-
'callback inside the component constructor`.');
|
|
16674
|
-
if (ngDevMode && !options?.injector) {
|
|
16675
|
-
assertInInjectionContext(afterEveryRender);
|
|
16676
|
-
}
|
|
16677
|
-
const injector = options?.injector ?? inject(Injector);
|
|
16678
|
-
if (typeof ngServerMode !== 'undefined' && ngServerMode) {
|
|
16679
|
-
return NOOP_AFTER_RENDER_REF;
|
|
16680
|
-
}
|
|
16681
|
-
performanceMarkFeature('NgAfterRender');
|
|
16682
|
-
return afterEveryRenderImpl(callbackOrSpec, injector, options, /* once */ false);
|
|
16683
|
-
}
|
|
16684
|
-
function afterNextRender(callbackOrSpec, options) {
|
|
16685
|
-
if (ngDevMode && !options?.injector) {
|
|
16686
|
-
assertInInjectionContext(afterNextRender);
|
|
16687
|
-
}
|
|
16688
|
-
const injector = options?.injector ?? inject(Injector);
|
|
16689
|
-
if (typeof ngServerMode !== 'undefined' && ngServerMode) {
|
|
16690
|
-
return NOOP_AFTER_RENDER_REF;
|
|
16691
|
-
}
|
|
16692
|
-
performanceMarkFeature('NgAfterNextRender');
|
|
16693
|
-
return afterEveryRenderImpl(callbackOrSpec, injector, options, /* once */ true);
|
|
16694
|
-
}
|
|
16695
|
-
function getHooks(callbackOrSpec) {
|
|
16696
|
-
if (callbackOrSpec instanceof Function) {
|
|
16697
|
-
return [undefined, undefined, /* MixedReadWrite */ callbackOrSpec, undefined];
|
|
16698
|
-
}
|
|
16699
|
-
else {
|
|
16700
|
-
return [
|
|
16701
|
-
callbackOrSpec.earlyRead,
|
|
16702
|
-
callbackOrSpec.write,
|
|
16703
|
-
callbackOrSpec.mixedReadWrite,
|
|
16704
|
-
callbackOrSpec.read,
|
|
16705
|
-
];
|
|
16706
|
-
}
|
|
16707
|
-
}
|
|
16708
|
-
/**
|
|
16709
|
-
* Shared implementation for `afterEveryRender` and `afterNextRender`.
|
|
16710
|
-
*/
|
|
16711
|
-
function afterEveryRenderImpl(callbackOrSpec, injector, options, once) {
|
|
16712
|
-
const manager = injector.get(AfterRenderManager);
|
|
16713
|
-
// Lazily initialize the handler implementation, if necessary. This is so that it can be
|
|
16714
|
-
// tree-shaken if `afterEveryRender` and `afterNextRender` aren't used.
|
|
16715
|
-
manager.impl ??= injector.get(AfterRenderImpl);
|
|
16716
|
-
const tracing = injector.get(TracingService, null, { optional: true });
|
|
16717
|
-
const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;
|
|
16718
|
-
const viewContext = injector.get(ViewContext, null, { optional: true });
|
|
16719
|
-
const sequence = new AfterRenderSequence(manager.impl, getHooks(callbackOrSpec), viewContext?.view, once, destroyRef, tracing?.snapshot(null));
|
|
16720
|
-
manager.impl.register(sequence);
|
|
16721
|
-
return sequence;
|
|
16722
|
-
}
|
|
16723
|
-
/** `AfterRenderRef` that does nothing. */
|
|
16724
|
-
const NOOP_AFTER_RENDER_REF = {
|
|
16725
|
-
destroy() { },
|
|
16726
|
-
};
|
|
16727
|
-
|
|
16728
|
-
/**
|
|
16729
|
-
* Calculates a data slot index for defer block info (either static or
|
|
16730
|
-
* instance-specific), given an index of a defer instruction.
|
|
16731
|
-
*/
|
|
16732
|
-
function getDeferBlockDataIndex(deferBlockIndex) {
|
|
16733
|
-
// Instance state is located at the *next* position
|
|
16734
|
-
// after the defer block slot in an LView or TView.data.
|
|
16735
|
-
return deferBlockIndex + 1;
|
|
16734
|
+
function getDeferBlockDataIndex(deferBlockIndex) {
|
|
16735
|
+
// Instance state is located at the *next* position
|
|
16736
|
+
// after the defer block slot in an LView or TView.data.
|
|
16737
|
+
return deferBlockIndex + 1;
|
|
16736
16738
|
}
|
|
16737
16739
|
/** Retrieves a defer block state from an LView, given a TNode that represents a block. */
|
|
16738
16740
|
function getLDeferBlockDetails(lView, tNode) {
|
|
@@ -17789,6 +17791,9 @@ function injectorProfilerEventHandler(injectorProfilerEvent) {
|
|
|
17789
17791
|
else if (type === 3 /* InjectorProfilerEventType.EffectCreated */) {
|
|
17790
17792
|
handleEffectCreatedEvent(context, injectorProfilerEvent.effect);
|
|
17791
17793
|
}
|
|
17794
|
+
else if (type === 4 /* InjectorProfilerEventType.AfterRenderEffectPhaseCreated */) {
|
|
17795
|
+
handleEffectCreatedEvent(context, injectorProfilerEvent.effectPhase);
|
|
17796
|
+
}
|
|
17792
17797
|
}
|
|
17793
17798
|
function handleEffectCreatedEvent(context, effect) {
|
|
17794
17799
|
const diResolver = getDIResolver(context.injector);
|
|
@@ -18799,7 +18804,15 @@ function extractEffectsFromInjector(injector) {
|
|
|
18799
18804
|
}
|
|
18800
18805
|
const resolverToEffects = getFrameworkDIDebugData().resolverToEffects;
|
|
18801
18806
|
const effects = resolverToEffects.get(diResolver) ?? [];
|
|
18802
|
-
return effects.map((effect) =>
|
|
18807
|
+
return effects.map((effect) => {
|
|
18808
|
+
if (effect instanceof EffectRefImpl) {
|
|
18809
|
+
return effect[SIGNAL];
|
|
18810
|
+
}
|
|
18811
|
+
else {
|
|
18812
|
+
// Narrowing down afterRenderEffect phases
|
|
18813
|
+
return effect.signal[SIGNAL];
|
|
18814
|
+
}
|
|
18815
|
+
});
|
|
18803
18816
|
}
|
|
18804
18817
|
function extractSignalNodesAndEdgesFromRoots(nodes, signalDependenciesMap = new Map()) {
|
|
18805
18818
|
for (const node of nodes) {
|
|
@@ -18858,7 +18871,7 @@ function measureEnd(startEvent, entryName, color) {
|
|
|
18858
18871
|
}
|
|
18859
18872
|
const chromeDevToolsInjectorProfiler = (event) => {
|
|
18860
18873
|
const eventType = event.type;
|
|
18861
|
-
if (eventType ===
|
|
18874
|
+
if (eventType === 5 /* InjectorProfilerEventType.InjectorToCreateInstanceEvent */) {
|
|
18862
18875
|
measureStart(100 /* ProfilerDIEvent.InjectorToCreateInstanceEvent */);
|
|
18863
18876
|
}
|
|
18864
18877
|
else if (eventType === 1 /* InjectorProfilerEventType.InstanceCreatedByInjector */) {
|
|
@@ -20241,7 +20254,7 @@ function scheduleDelayedTrigger(scheduleFn) {
|
|
|
20241
20254
|
*
|
|
20242
20255
|
* @param scheduleFn A function that does the scheduling.
|
|
20243
20256
|
*/
|
|
20244
|
-
function scheduleDelayedPrefetching(scheduleFn
|
|
20257
|
+
function scheduleDelayedPrefetching(scheduleFn) {
|
|
20245
20258
|
if (typeof ngServerMode !== 'undefined' && ngServerMode)
|
|
20246
20259
|
return;
|
|
20247
20260
|
const lView = getLView();
|
|
@@ -21416,6 +21429,28 @@ function ɵɵattribute(name, value, sanitizer, namespace) {
|
|
|
21416
21429
|
return ɵɵattribute;
|
|
21417
21430
|
}
|
|
21418
21431
|
|
|
21432
|
+
/**
|
|
21433
|
+
* A [DI token](api/core/InjectionToken) that enables or disables all enter and leave animations.
|
|
21434
|
+
*/
|
|
21435
|
+
const ANIMATIONS_DISABLED = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationsDisabled' : '', {
|
|
21436
|
+
providedIn: 'root',
|
|
21437
|
+
factory: () => false,
|
|
21438
|
+
});
|
|
21439
|
+
/**
|
|
21440
|
+
* A [DI token](api/core/InjectionToken) that configures the maximum animation timeout
|
|
21441
|
+
* before element removal. The default value mirrors from Chrome's cross document
|
|
21442
|
+
* navigation view transition timeout. It's intended to prevent people from accidentally
|
|
21443
|
+
* forgetting to call the removal function in their callback. Also serves as a delay
|
|
21444
|
+
* for when stylesheets are pruned.
|
|
21445
|
+
*
|
|
21446
|
+
* @publicApi 20.2
|
|
21447
|
+
*/
|
|
21448
|
+
const MAX_ANIMATION_TIMEOUT = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'MaxAnimationTimeout' : '', {
|
|
21449
|
+
providedIn: 'root',
|
|
21450
|
+
factory: () => MAX_ANIMATION_TIMEOUT_DEFAULT,
|
|
21451
|
+
});
|
|
21452
|
+
const MAX_ANIMATION_TIMEOUT_DEFAULT = 4000;
|
|
21453
|
+
|
|
21419
21454
|
const DEFAULT_ANIMATIONS_DISABLED = false;
|
|
21420
21455
|
const areAnimationSupported = (typeof ngServerMode === 'undefined' || !ngServerMode) &&
|
|
21421
21456
|
typeof document !== 'undefined' &&
|
|
@@ -21670,7 +21705,13 @@ function ɵɵanimateEnter(value) {
|
|
|
21670
21705
|
const tNode = getCurrentTNode();
|
|
21671
21706
|
cancelLeavingNodes(tNode, lView);
|
|
21672
21707
|
addAnimationToLView(getLViewEnterAnimations(lView), tNode, () => runEnterAnimation(lView, tNode, value));
|
|
21673
|
-
|
|
21708
|
+
initializeAnimationQueueScheduler(lView[INJECTOR]);
|
|
21709
|
+
// We have to queue here due to the animation instruction being invoked after the element
|
|
21710
|
+
// instruction. The DOM node has to exist before we can queue an animation. Any node that
|
|
21711
|
+
// is not inside of control flow needs to get queued here. For nodes inside of control
|
|
21712
|
+
// flow, those are queued in node_manipulation.ts and are deduped by a Set in the animation
|
|
21713
|
+
// queue.
|
|
21714
|
+
queueEnterAnimations(lView[INJECTOR], getLViewEnterAnimations(lView));
|
|
21674
21715
|
return ɵɵanimateEnter; // For chaining
|
|
21675
21716
|
}
|
|
21676
21717
|
function runEnterAnimation(lView, tNode, value) {
|
|
@@ -21767,7 +21808,13 @@ function ɵɵanimateEnterListener(value) {
|
|
|
21767
21808
|
const tNode = getCurrentTNode();
|
|
21768
21809
|
cancelLeavingNodes(tNode, lView);
|
|
21769
21810
|
addAnimationToLView(getLViewEnterAnimations(lView), tNode, () => runEnterAnimationFunction(lView, tNode, value));
|
|
21770
|
-
|
|
21811
|
+
initializeAnimationQueueScheduler(lView[INJECTOR]);
|
|
21812
|
+
// We have to queue here due to the animation instruction being invoked after the element
|
|
21813
|
+
// instruction. The DOM node has to exist before we can queue an animation. Any node that
|
|
21814
|
+
// is not inside of control flow needs to get queued here. For nodes inside of control
|
|
21815
|
+
// flow, those are queued in node_manipulation.ts and are deduped by a Set in the animation
|
|
21816
|
+
// queue.
|
|
21817
|
+
queueEnterAnimations(lView[INJECTOR], getLViewEnterAnimations(lView));
|
|
21771
21818
|
return ɵɵanimateEnterListener;
|
|
21772
21819
|
}
|
|
21773
21820
|
/**
|
|
@@ -21800,8 +21847,9 @@ function ɵɵanimateLeave(value) {
|
|
|
21800
21847
|
return ɵɵanimateLeave;
|
|
21801
21848
|
}
|
|
21802
21849
|
const tNode = getCurrentTNode();
|
|
21850
|
+
cancelLeavingNodes(tNode, lView);
|
|
21803
21851
|
addAnimationToLView(getLViewLeaveAnimations(lView), tNode, () => runLeaveAnimations(lView, tNode, value));
|
|
21804
|
-
|
|
21852
|
+
initializeAnimationQueueScheduler(lView[INJECTOR]);
|
|
21805
21853
|
return ɵɵanimateLeave; // For chaining
|
|
21806
21854
|
}
|
|
21807
21855
|
function runLeaveAnimations(lView, tNode, value) {
|
|
@@ -21897,9 +21945,10 @@ function ɵɵanimateLeaveListener(value) {
|
|
|
21897
21945
|
// So we don't have an early return here.
|
|
21898
21946
|
const lView = getLView();
|
|
21899
21947
|
const tNode = getCurrentTNode();
|
|
21948
|
+
cancelLeavingNodes(tNode, lView);
|
|
21900
21949
|
allLeavingAnimations.add(lView);
|
|
21901
21950
|
addAnimationToLView(getLViewLeaveAnimations(lView), tNode, () => runLeaveAnimationFunction(lView, tNode, value));
|
|
21902
|
-
|
|
21951
|
+
initializeAnimationQueueScheduler(lView[INJECTOR]);
|
|
21903
21952
|
return ɵɵanimateLeaveListener; // For chaining
|
|
21904
21953
|
}
|
|
21905
21954
|
/**
|
|
@@ -21940,35 +21989,6 @@ function runLeaveAnimationFunction(lView, tNode, value) {
|
|
|
21940
21989
|
// Ensure cleanup if the LView is destroyed before the animation runs.
|
|
21941
21990
|
return { promise, resolve };
|
|
21942
21991
|
}
|
|
21943
|
-
function queueEnterAnimations(lView) {
|
|
21944
|
-
enableAnimationQueueScheduler(lView[INJECTOR]);
|
|
21945
|
-
const enterAnimations = lView[ANIMATIONS]?.enter;
|
|
21946
|
-
if (enterAnimations) {
|
|
21947
|
-
const animationQueue = lView[INJECTOR].get(ANIMATION_QUEUE);
|
|
21948
|
-
for (const [_, nodeAnimations] of enterAnimations) {
|
|
21949
|
-
for (const animateFn of nodeAnimations.animateFns) {
|
|
21950
|
-
animationQueue.queue.add(animateFn);
|
|
21951
|
-
}
|
|
21952
|
-
}
|
|
21953
|
-
}
|
|
21954
|
-
}
|
|
21955
|
-
function enableAnimationQueueScheduler(injector) {
|
|
21956
|
-
const animationQueue = injector.get(ANIMATION_QUEUE);
|
|
21957
|
-
// We only need to schedule the animation queue runner once per application.
|
|
21958
|
-
if (!animationQueue.isScheduled) {
|
|
21959
|
-
afterEveryRender(() => {
|
|
21960
|
-
runQueuedAnimations(injector);
|
|
21961
|
-
}, { injector });
|
|
21962
|
-
animationQueue.isScheduled = true;
|
|
21963
|
-
}
|
|
21964
|
-
}
|
|
21965
|
-
function runQueuedAnimations(injector) {
|
|
21966
|
-
const animationQueue = injector.get(ANIMATION_QUEUE);
|
|
21967
|
-
for (let animateFn of animationQueue.queue) {
|
|
21968
|
-
animateFn();
|
|
21969
|
-
}
|
|
21970
|
-
animationQueue.queue.clear();
|
|
21971
|
-
}
|
|
21972
21992
|
|
|
21973
21993
|
/*!
|
|
21974
21994
|
* @license
|
|
@@ -22018,10 +22038,13 @@ function ɵɵcontrolCreate() {
|
|
|
22018
22038
|
else if (tNode.flags & 4096 /* TNodeFlags.isFormCheckboxControl */) {
|
|
22019
22039
|
listenToCustomControl(lView, tNode, control, 'checked');
|
|
22020
22040
|
}
|
|
22041
|
+
else if (tNode.flags & 8192 /* TNodeFlags.isInteropControl */) {
|
|
22042
|
+
control.ɵinteropControlCreate();
|
|
22043
|
+
}
|
|
22021
22044
|
else {
|
|
22022
22045
|
listenToNativeControl(lView, tNode, control);
|
|
22023
22046
|
}
|
|
22024
|
-
control
|
|
22047
|
+
control.ɵregister();
|
|
22025
22048
|
}
|
|
22026
22049
|
/**
|
|
22027
22050
|
* Updates a `field` property, and possibly other form control properties, on the current element.
|
|
@@ -22051,6 +22074,9 @@ function ɵɵcontrol(value, sanitizer) {
|
|
|
22051
22074
|
else if (tNode.flags & 4096 /* TNodeFlags.isFormCheckboxControl */) {
|
|
22052
22075
|
updateCustomControl(tNode, lView, control, 'checked');
|
|
22053
22076
|
}
|
|
22077
|
+
else if (tNode.flags & 8192 /* TNodeFlags.isInteropControl */) {
|
|
22078
|
+
control.ɵinteropControlUpdate();
|
|
22079
|
+
}
|
|
22054
22080
|
else {
|
|
22055
22081
|
updateNativeControl(tNode, lView, control);
|
|
22056
22082
|
}
|
|
@@ -22091,12 +22117,16 @@ function getControlDirectiveFirstCreatePass(tView, tNode, lView) {
|
|
|
22091
22117
|
return control;
|
|
22092
22118
|
}
|
|
22093
22119
|
}
|
|
22120
|
+
if (control.ɵhasInteropControl) {
|
|
22121
|
+
tNode.flags |= 8192 /* TNodeFlags.isInteropControl */;
|
|
22122
|
+
return control;
|
|
22123
|
+
}
|
|
22094
22124
|
if (isNativeControl(tNode)) {
|
|
22095
22125
|
if (isNumericInput(tNode)) {
|
|
22096
|
-
tNode.flags |=
|
|
22126
|
+
tNode.flags |= 16384 /* TNodeFlags.isNativeNumericControl */;
|
|
22097
22127
|
}
|
|
22098
22128
|
if (isTextControl(tNode)) {
|
|
22099
|
-
tNode.flags |=
|
|
22129
|
+
tNode.flags |= 32768 /* TNodeFlags.isNativeTextControl */;
|
|
22100
22130
|
}
|
|
22101
22131
|
return control;
|
|
22102
22132
|
}
|
|
@@ -22155,7 +22185,9 @@ function listenToCustomControl(lView, tNode, control, modelName) {
|
|
|
22155
22185
|
const componentIndex = tNode.directiveStart + tNode.componentOffset;
|
|
22156
22186
|
const outputName = modelName + 'Change';
|
|
22157
22187
|
listenToOutput(tNode, lView, componentIndex, outputName, outputName, wrapListener(tNode, lView, (newValue) => {
|
|
22158
|
-
control.state()
|
|
22188
|
+
const state = control.state();
|
|
22189
|
+
state.value.set(newValue);
|
|
22190
|
+
state.markAsDirty();
|
|
22159
22191
|
}));
|
|
22160
22192
|
const tView = getTView();
|
|
22161
22193
|
const componentDef = tView.data[componentIndex];
|
|
@@ -22185,12 +22217,12 @@ function listenToNativeControl(lView, tNode, control) {
|
|
|
22185
22217
|
const renderer = lView[RENDERER];
|
|
22186
22218
|
const inputListener = () => {
|
|
22187
22219
|
const element = getNativeByTNode(tNode, lView);
|
|
22188
|
-
const
|
|
22189
|
-
value.set(getNativeControlValue(element, value));
|
|
22220
|
+
const state = control.state();
|
|
22221
|
+
state.value.set(getNativeControlValue(element, state.value));
|
|
22222
|
+
state.markAsDirty();
|
|
22190
22223
|
};
|
|
22191
22224
|
listenToDomEvent(tNode, tView, lView, undefined, renderer, 'input', inputListener, wrapListener(tNode, lView, inputListener));
|
|
22192
22225
|
const blurListener = () => {
|
|
22193
|
-
// TODO: https://github.com/orgs/angular/projects/60/views/1?pane=issue&itemId=131860538
|
|
22194
22226
|
control.state().markAsTouched();
|
|
22195
22227
|
};
|
|
22196
22228
|
listenToDomEvent(tNode, tView, lView, undefined, renderer, 'blur', blurListener, wrapListener(tNode, lView, blurListener));
|
|
@@ -22214,17 +22246,18 @@ function updateCustomControl(tNode, lView, control, modelName) {
|
|
|
22214
22246
|
// * cache which inputs exist.
|
|
22215
22247
|
writeToDirectiveInput(componentDef, component, modelName, state.value());
|
|
22216
22248
|
maybeWriteToDirectiveInput(componentDef, component, 'errors', state.errors);
|
|
22249
|
+
maybeWriteToDirectiveInput(componentDef, component, 'invalid', state.invalid);
|
|
22217
22250
|
maybeWriteToDirectiveInput(componentDef, component, 'disabled', state.disabled);
|
|
22218
22251
|
maybeWriteToDirectiveInput(componentDef, component, 'disabledReasons', state.disabledReasons);
|
|
22252
|
+
maybeWriteToDirectiveInput(componentDef, component, 'name', state.name);
|
|
22253
|
+
maybeWriteToDirectiveInput(componentDef, component, 'readonly', state.readonly);
|
|
22254
|
+
maybeWriteToDirectiveInput(componentDef, component, 'touched', state.touched);
|
|
22219
22255
|
maybeWriteToDirectiveInput(componentDef, component, 'max', state.max);
|
|
22220
22256
|
maybeWriteToDirectiveInput(componentDef, component, 'maxLength', state.maxLength);
|
|
22221
22257
|
maybeWriteToDirectiveInput(componentDef, component, 'min', state.min);
|
|
22222
22258
|
maybeWriteToDirectiveInput(componentDef, component, 'minLength', state.minLength);
|
|
22223
|
-
maybeWriteToDirectiveInput(componentDef, component, 'name', state.name);
|
|
22224
22259
|
maybeWriteToDirectiveInput(componentDef, component, 'pattern', state.pattern);
|
|
22225
|
-
maybeWriteToDirectiveInput(componentDef, component, 'readonly', state.readonly);
|
|
22226
22260
|
maybeWriteToDirectiveInput(componentDef, component, 'required', state.required);
|
|
22227
|
-
maybeWriteToDirectiveInput(componentDef, component, 'touched', state.touched);
|
|
22228
22261
|
}
|
|
22229
22262
|
/**
|
|
22230
22263
|
* Writes the specified value to a directive input if the input exists.
|
|
@@ -22235,7 +22268,7 @@ function updateCustomControl(tNode, lView, control, modelName) {
|
|
|
22235
22268
|
* @param source A function that returns the value to write.
|
|
22236
22269
|
*/
|
|
22237
22270
|
function maybeWriteToDirectiveInput(componentDef, component, inputName, source) {
|
|
22238
|
-
if (inputName in componentDef.inputs) {
|
|
22271
|
+
if (source && inputName in componentDef.inputs) {
|
|
22239
22272
|
writeToDirectiveInput(componentDef, component, inputName, source());
|
|
22240
22273
|
}
|
|
22241
22274
|
}
|
|
@@ -22256,14 +22289,24 @@ function updateNativeControl(tNode, lView, control) {
|
|
|
22256
22289
|
renderer.setAttribute(input, 'name', state.name());
|
|
22257
22290
|
setBooleanAttribute(renderer, input, 'disabled', state.disabled());
|
|
22258
22291
|
setBooleanAttribute(renderer, input, 'readonly', state.readonly());
|
|
22259
|
-
|
|
22260
|
-
|
|
22261
|
-
|
|
22262
|
-
|
|
22292
|
+
if (state.required) {
|
|
22293
|
+
setBooleanAttribute(renderer, input, 'required', state.required());
|
|
22294
|
+
}
|
|
22295
|
+
if (tNode.flags & 16384 /* TNodeFlags.isNativeNumericControl */) {
|
|
22296
|
+
if (state.max) {
|
|
22297
|
+
setOptionalAttribute(renderer, input, 'max', state.max());
|
|
22298
|
+
}
|
|
22299
|
+
if (state.min) {
|
|
22300
|
+
setOptionalAttribute(renderer, input, 'min', state.min());
|
|
22301
|
+
}
|
|
22263
22302
|
}
|
|
22264
|
-
if (tNode.flags &
|
|
22265
|
-
|
|
22266
|
-
|
|
22303
|
+
if (tNode.flags & 32768 /* TNodeFlags.isNativeTextControl */) {
|
|
22304
|
+
if (state.maxLength) {
|
|
22305
|
+
setOptionalAttribute(renderer, input, 'maxLength', state.maxLength());
|
|
22306
|
+
}
|
|
22307
|
+
if (state.minLength) {
|
|
22308
|
+
setOptionalAttribute(renderer, input, 'minLength', state.minLength());
|
|
22309
|
+
}
|
|
22267
22310
|
}
|
|
22268
22311
|
}
|
|
22269
22312
|
/** Checks if a given value is a Date or null */
|
|
@@ -23633,7 +23676,7 @@ function plural(val) {
|
|
|
23633
23676
|
return 1;
|
|
23634
23677
|
return 5;
|
|
23635
23678
|
}
|
|
23636
|
-
var localeEn = ["en", [["a", "p"], ["AM", "PM"]], [["AM", "PM"]], [["S", "M", "T", "W", "T", "F", "S"], ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]], u, [["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]], u, [["B", "A"], ["BC", "AD"], ["Before Christ", "Anno Domini"]], 0, [6, 0], ["M/d/yy", "MMM d, y", "MMMM d, y", "EEEE, MMMM d, y"], ["h:mm
|
|
23679
|
+
var localeEn = ["en", [["a", "p"], ["AM", "PM"]], [["AM", "PM"]], [["S", "M", "T", "W", "T", "F", "S"], ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]], u, [["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]], u, [["B", "A"], ["BC", "AD"], ["Before Christ", "Anno Domini"]], 0, [6, 0], ["M/d/yy", "MMM d, y", "MMMM d, y", "EEEE, MMMM d, y"], ["h:mm a", "h:mm:ss a", "h:mm:ss a z", "h:mm:ss a zzzz"], ["{1}, {0}", u, u, u], [".", ",", ";", "%", "+", "-", "E", "×", "‰", "∞", "NaN", ":"], ["#,##0.###", "#,##0%", "¤#,##0.00", "#E0"], "USD", "$", "US Dollar", {}, "ltr", plural];
|
|
23637
23680
|
|
|
23638
23681
|
/**
|
|
23639
23682
|
* This const is used to store the locale data registered with `registerLocaleData`
|