├── ANGULAR_PACKAGE ├── BUILD_INFO ├── LICENSE ├── README.md ├── animation_driver.d-xuLo2K_d.d.ts ├── animation_player.d-Bpvrt8M2.d.ts ├── browser ├── index.d.ts └── testing │ └── index.d.ts ├── fesm2022 ├── animations.mjs ├── animations.mjs.map ├── browser.mjs ├── browser.mjs.map ├── browser │ ├── testing.mjs │ └── testing.mjs.map ├── private_export-B_vy_9K7.mjs ├── private_export-B_vy_9K7.mjs.map ├── util-CPU6TNml.mjs └── util-CPU6TNml.mjs.map ├── index.d.ts └── package.json /ANGULAR_PACKAGE: -------------------------------------------------------------------------------- 1 | This file is used by the npm/yarn_install rule to detect APF. See https://github.com/bazelbuild/rules_nodejs/issues/927 2 | -------------------------------------------------------------------------------- /BUILD_INFO: -------------------------------------------------------------------------------- 1 | Fri Jun 6 22:26:37 UTC 2025 2 | 21fc93bf4b2183114d7703dbea4e57c30b54c66e 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010-2025 Google LLC. https://angular.dev/license 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Angular 2 | ======= 3 | 4 | The sources for this package are in the main [Angular](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo. 5 | 6 | Usage information and reference details can be found in [Angular documentation](https://angular.dev/overview). 7 | 8 | License: MIT 9 | -------------------------------------------------------------------------------- /animation_driver.d-xuLo2K_d.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Angular v20.1.0-next.0+sha-21fc93b 3 | * (c) 2010-2025 Google LLC. https://angular.io/ 4 | * License: MIT 5 | */ 6 | 7 | import * as i0 from '@angular/core'; 8 | import { AnimationPlayer } from './animation_player.d-Bpvrt8M2.js'; 9 | 10 | /** 11 | * @publicApi 12 | * 13 | * `AnimationDriver` implentation for Noop animations 14 | */ 15 | declare class NoopAnimationDriver implements AnimationDriver { 16 | /** 17 | * @returns Whether `prop` is a valid CSS property 18 | */ 19 | validateStyleProperty(prop: string): boolean; 20 | /** 21 | * 22 | * @returns Whether elm1 contains elm2. 23 | */ 24 | containsElement(elm1: any, elm2: any): boolean; 25 | /** 26 | * @returns Rhe parent of the given element or `null` if the element is the `document` 27 | */ 28 | getParentElement(element: unknown): unknown; 29 | /** 30 | * @returns The result of the query selector on the element. The array will contain up to 1 item 31 | * if `multi` is `false`. 32 | */ 33 | query(element: any, selector: string, multi: boolean): any[]; 34 | /** 35 | * @returns The `defaultValue` or empty string 36 | */ 37 | computeStyle(element: any, prop: string, defaultValue?: string): string; 38 | /** 39 | * @returns An `NoopAnimationPlayer` 40 | */ 41 | animate(element: any, keyframes: Array>, duration: number, delay: number, easing: string, previousPlayers?: any[], scrubberAccessRequested?: boolean): AnimationPlayer; 42 | static ɵfac: i0.ɵɵFactoryDeclaration; 43 | static ɵprov: i0.ɵɵInjectableDeclaration; 44 | } 45 | /** 46 | * @publicApi 47 | */ 48 | declare abstract class AnimationDriver { 49 | /** 50 | * @deprecated Use the NoopAnimationDriver class. 51 | */ 52 | static NOOP: AnimationDriver; 53 | abstract validateStyleProperty(prop: string): boolean; 54 | abstract validateAnimatableStyleProperty?: (prop: string) => boolean; 55 | abstract containsElement(elm1: any, elm2: any): boolean; 56 | /** 57 | * Obtains the parent element, if any. `null` is returned if the element does not have a parent. 58 | */ 59 | abstract getParentElement(element: unknown): unknown; 60 | abstract query(element: any, selector: string, multi: boolean): any[]; 61 | abstract computeStyle(element: any, prop: string, defaultValue?: string): string; 62 | abstract animate(element: any, keyframes: Array>, duration: number, delay: number, easing?: string | null, previousPlayers?: any[], scrubberAccessRequested?: boolean): any; 63 | } 64 | 65 | export { AnimationDriver, NoopAnimationDriver }; 66 | -------------------------------------------------------------------------------- /browser/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Angular v20.1.0-next.0+sha-21fc93b 3 | * (c) 2010-2025 Google LLC. https://angular.io/ 4 | * License: MIT 5 | */ 6 | 7 | import { AnimationDriver } from '../animation_driver.d-xuLo2K_d.js'; 8 | export { NoopAnimationDriver } from '../animation_driver.d-xuLo2K_d.js'; 9 | import { AnimationTriggerMetadata, AnimationPlayer, ɵStyleDataMap as _StyleDataMap, AnimationMetadata, AnimationOptions, ɵStyleData as _StyleData } from '../animation_player.d-Bpvrt8M2.js'; 10 | import { Renderer2, ɵAnimationRendererType as _AnimationRendererType, RendererStyleFlags2, ListenerOptions, RendererFactory2, NgZone, RendererType2 } from '@angular/core'; 11 | 12 | declare abstract class AnimationStyleNormalizer { 13 | abstract normalizePropertyName(propertyName: string, errors: Error[]): string; 14 | abstract normalizeStyleValue(userProvidedProperty: string, normalizedProperty: string, value: string | number, errors: Error[]): string; 15 | } 16 | declare class NoopAnimationStyleNormalizer { 17 | normalizePropertyName(propertyName: string, errors: Error[]): string; 18 | normalizeStyleValue(userProvidedProperty: string, normalizedProperty: string, value: string | number, errors: Error[]): string; 19 | } 20 | 21 | declare class AnimationEngine { 22 | private _driver; 23 | private _normalizer; 24 | private _transitionEngine; 25 | private _timelineEngine; 26 | private _triggerCache; 27 | onRemovalComplete: (element: any, context: any) => void; 28 | constructor(doc: Document, _driver: AnimationDriver, _normalizer: AnimationStyleNormalizer); 29 | registerTrigger(componentId: string, namespaceId: string, hostElement: any, name: string, metadata: AnimationTriggerMetadata): void; 30 | register(namespaceId: string, hostElement: any): void; 31 | destroy(namespaceId: string, context: any): void; 32 | onInsert(namespaceId: string, element: any, parent: any, insertBefore: boolean): void; 33 | onRemove(namespaceId: string, element: any, context: any): void; 34 | disableAnimations(element: any, disable: boolean): void; 35 | process(namespaceId: string, element: any, property: string, value: any): void; 36 | listen(namespaceId: string, element: any, eventName: string, eventPhase: string, callback: (event: any) => any): () => any; 37 | flush(microtaskId?: number): void; 38 | get players(): AnimationPlayer[]; 39 | whenRenderingDone(): Promise; 40 | afterFlushAnimationsDone(cb: VoidFunction): void; 41 | } 42 | 43 | declare function createEngine(type: 'animations' | 'noop', doc: Document): AnimationEngine; 44 | 45 | declare const enum AnimationTransitionInstructionType { 46 | TransitionAnimation = 0, 47 | TimelineAnimation = 1 48 | } 49 | interface AnimationEngineInstruction { 50 | type: AnimationTransitionInstructionType; 51 | } 52 | 53 | interface AnimationTimelineInstruction extends AnimationEngineInstruction { 54 | element: any; 55 | keyframes: Array<_StyleDataMap>; 56 | preStyleProps: string[]; 57 | postStyleProps: string[]; 58 | duration: number; 59 | delay: number; 60 | totalTime: number; 61 | easing: string | null; 62 | stretchStartingKeyframe?: boolean; 63 | subTimeline: boolean; 64 | } 65 | 66 | declare class ElementInstructionMap { 67 | private _map; 68 | get(element: any): AnimationTimelineInstruction[]; 69 | append(element: any, instructions: AnimationTimelineInstruction[]): void; 70 | has(element: any): boolean; 71 | clear(): void; 72 | } 73 | 74 | declare class Animation$1 { 75 | private _driver; 76 | private _animationAst; 77 | constructor(_driver: AnimationDriver, input: AnimationMetadata | AnimationMetadata[]); 78 | buildTimelines(element: any, startingStyles: _StyleDataMap | Array<_StyleDataMap>, destinationStyles: _StyleDataMap | Array<_StyleDataMap>, options: AnimationOptions, subInstructions?: ElementInstructionMap): AnimationTimelineInstruction[]; 79 | } 80 | 81 | declare class WebAnimationsStyleNormalizer extends AnimationStyleNormalizer { 82 | normalizePropertyName(propertyName: string, errors: Error[]): string; 83 | normalizeStyleValue(userProvidedProperty: string, normalizedProperty: string, value: string | number, errors: Error[]): string; 84 | } 85 | 86 | type AnimationFactoryWithListenerCallback = RendererFactory2 & { 87 | scheduleListenerCallback: (count: number, fn: (e: any) => any, data: any) => void; 88 | }; 89 | declare class BaseAnimationRenderer implements Renderer2 { 90 | protected namespaceId: string; 91 | delegate: Renderer2; 92 | engine: AnimationEngine; 93 | private _onDestroy?; 94 | readonly ɵtype: _AnimationRendererType.Regular; 95 | constructor(namespaceId: string, delegate: Renderer2, engine: AnimationEngine, _onDestroy?: (() => void) | undefined); 96 | get data(): { 97 | [key: string]: any; 98 | }; 99 | destroyNode(node: any): void; 100 | destroy(): void; 101 | createElement(name: string, namespace?: string | null | undefined): any; 102 | createComment(value: string): any; 103 | createText(value: string): any; 104 | appendChild(parent: any, newChild: any): void; 105 | insertBefore(parent: any, newChild: any, refChild: any, isMove?: boolean): void; 106 | removeChild(parent: any, oldChild: any, isHostElement?: boolean): void; 107 | selectRootElement(selectorOrNode: any, preserveContent?: boolean): any; 108 | parentNode(node: any): any; 109 | nextSibling(node: any): any; 110 | setAttribute(el: any, name: string, value: string, namespace?: string | null | undefined): void; 111 | removeAttribute(el: any, name: string, namespace?: string | null | undefined): void; 112 | addClass(el: any, name: string): void; 113 | removeClass(el: any, name: string): void; 114 | setStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2 | undefined): void; 115 | removeStyle(el: any, style: string, flags?: RendererStyleFlags2 | undefined): void; 116 | setProperty(el: any, name: string, value: any): void; 117 | setValue(node: any, value: string): void; 118 | listen(target: any, eventName: string, callback: (event: any) => boolean | void, options?: ListenerOptions): () => void; 119 | protected disableAnimations(element: any, value: boolean): void; 120 | } 121 | declare class AnimationRenderer extends BaseAnimationRenderer implements Renderer2 { 122 | factory: AnimationFactoryWithListenerCallback; 123 | constructor(factory: AnimationFactoryWithListenerCallback, namespaceId: string, delegate: Renderer2, engine: AnimationEngine, onDestroy?: () => void); 124 | setProperty(el: any, name: string, value: any): void; 125 | listen(target: 'window' | 'document' | 'body' | any, eventName: string, callback: (event: any) => any, options?: ListenerOptions): () => void; 126 | } 127 | 128 | declare class AnimationRendererFactory implements RendererFactory2 { 129 | private delegate; 130 | private engine; 131 | private _zone; 132 | private _currentId; 133 | private _microtaskId; 134 | private _animationCallbacksBuffer; 135 | private _rendererCache; 136 | private _cdRecurDepth; 137 | constructor(delegate: RendererFactory2, engine: AnimationEngine, _zone: NgZone); 138 | createRenderer(hostElement: any, type: RendererType2): BaseAnimationRenderer; 139 | begin(): void; 140 | private _scheduleCountTask; 141 | end(): void; 142 | whenRenderingDone(): Promise; 143 | /** 144 | * Used during HMR to clear any cached data about a component. 145 | * @param componentId ID of the component that is being replaced. 146 | */ 147 | protected componentReplaced(componentId: string): void; 148 | } 149 | 150 | declare function getParentElement(element: any): unknown | null; 151 | declare function validateStyleProperty(prop: string): boolean; 152 | declare function validateWebAnimatableStyleProperty(prop: string): boolean; 153 | declare function containsElement(elm1: any, elm2: any): boolean; 154 | declare function invokeQuery(element: any, selector: string, multi: boolean): any[]; 155 | 156 | declare class WebAnimationsDriver implements AnimationDriver { 157 | validateStyleProperty(prop: string): boolean; 158 | validateAnimatableStyleProperty(prop: string): boolean; 159 | containsElement(elm1: any, elm2: any): boolean; 160 | getParentElement(element: unknown): unknown; 161 | query(element: any, selector: string, multi: boolean): any[]; 162 | computeStyle(element: any, prop: string, defaultValue?: string): string; 163 | animate(element: any, keyframes: Array>, duration: number, delay: number, easing: string, previousPlayers?: AnimationPlayer[]): AnimationPlayer; 164 | } 165 | 166 | /** 167 | * Designed to be executed during a keyframe-based animation to apply any special-cased styles. 168 | * 169 | * When started (when the `start()` method is run) then the provided `startStyles` 170 | * will be applied. When finished (when the `finish()` method is called) the 171 | * `endStyles` will be applied as well any any starting styles. Finally when 172 | * `destroy()` is called then all styles will be removed. 173 | */ 174 | declare class SpecialCasedStyles { 175 | private _element; 176 | private _startStyles; 177 | private _endStyles; 178 | static initialStylesByElement: WeakMap; 179 | private _state; 180 | private _initialStyles; 181 | constructor(_element: any, _startStyles: _StyleDataMap | null, _endStyles: _StyleDataMap | null); 182 | start(): void; 183 | finish(): void; 184 | destroy(): void; 185 | } 186 | 187 | declare class WebAnimationsPlayer implements AnimationPlayer { 188 | element: any; 189 | keyframes: Array<_StyleDataMap>; 190 | options: { 191 | [key: string]: string | number; 192 | }; 193 | private _specialStyles?; 194 | private _onDoneFns; 195 | private _onStartFns; 196 | private _onDestroyFns; 197 | private _duration; 198 | private _delay; 199 | private _initialized; 200 | private _finished; 201 | private _started; 202 | private _destroyed; 203 | private _finalKeyframe?; 204 | private _originalOnDoneFns; 205 | private _originalOnStartFns; 206 | readonly domPlayer: Animation; 207 | time: number; 208 | parentPlayer: AnimationPlayer | null; 209 | currentSnapshot: _StyleDataMap; 210 | constructor(element: any, keyframes: Array<_StyleDataMap>, options: { 211 | [key: string]: string | number; 212 | }, _specialStyles?: (SpecialCasedStyles | null) | undefined); 213 | private _onFinish; 214 | init(): void; 215 | private _buildPlayer; 216 | private _preparePlayerBeforeStart; 217 | private _convertKeyframesToObject; 218 | onStart(fn: () => void): void; 219 | onDone(fn: () => void): void; 220 | onDestroy(fn: () => void): void; 221 | play(): void; 222 | pause(): void; 223 | finish(): void; 224 | reset(): void; 225 | private _resetDomPlayerState; 226 | restart(): void; 227 | hasStarted(): boolean; 228 | destroy(): void; 229 | setPosition(p: number): void; 230 | getPosition(): number; 231 | get totalTime(): number; 232 | beforeDestroy(): void; 233 | } 234 | 235 | declare const ENTER_CLASSNAME = "ng-enter"; 236 | declare const LEAVE_CLASSNAME = "ng-leave"; 237 | declare function normalizeKeyframes(keyframes: Array<_StyleData> | Array<_StyleDataMap>): Array<_StyleDataMap>; 238 | declare function camelCaseToDashCase(input: string): string; 239 | declare function allowPreviousPlayerStylesMerge(duration: number, delay: number): boolean; 240 | 241 | declare class TransitionAnimationPlayer implements AnimationPlayer { 242 | namespaceId: string; 243 | triggerName: string; 244 | element: any; 245 | private _player; 246 | private _containsRealPlayer; 247 | private _queuedCallbacks; 248 | readonly destroyed = false; 249 | parentPlayer: AnimationPlayer | null; 250 | markedForDestroy: boolean; 251 | disabled: boolean; 252 | readonly queued: boolean; 253 | readonly totalTime: number; 254 | constructor(namespaceId: string, triggerName: string, element: any); 255 | setRealPlayer(player: AnimationPlayer): void; 256 | getRealPlayer(): AnimationPlayer; 257 | overrideTotalTime(totalTime: number): void; 258 | syncPlayerEvents(player: AnimationPlayer): void; 259 | private _queueEvent; 260 | onDone(fn: () => void): void; 261 | onStart(fn: () => void): void; 262 | onDestroy(fn: () => void): void; 263 | init(): void; 264 | hasStarted(): boolean; 265 | play(): void; 266 | pause(): void; 267 | restart(): void; 268 | finish(): void; 269 | destroy(): void; 270 | reset(): void; 271 | setPosition(p: number): void; 272 | getPosition(): number; 273 | } 274 | 275 | export { AnimationDriver, Animation$1 as ɵAnimation, AnimationEngine as ɵAnimationEngine, AnimationRenderer as ɵAnimationRenderer, AnimationRendererFactory as ɵAnimationRendererFactory, AnimationStyleNormalizer as ɵAnimationStyleNormalizer, BaseAnimationRenderer as ɵBaseAnimationRenderer, ENTER_CLASSNAME as ɵENTER_CLASSNAME, LEAVE_CLASSNAME as ɵLEAVE_CLASSNAME, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer, TransitionAnimationPlayer as ɵTransitionAnimationPlayer, WebAnimationsDriver as ɵWebAnimationsDriver, WebAnimationsPlayer as ɵWebAnimationsPlayer, WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer, allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, camelCaseToDashCase as ɵcamelCaseToDashCase, containsElement as ɵcontainsElement, createEngine as ɵcreateEngine, getParentElement as ɵgetParentElement, invokeQuery as ɵinvokeQuery, normalizeKeyframes as ɵnormalizeKeyframes, validateStyleProperty as ɵvalidateStyleProperty, validateWebAnimatableStyleProperty as ɵvalidateWebAnimatableStyleProperty }; 276 | -------------------------------------------------------------------------------- /browser/testing/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Angular v20.1.0-next.0+sha-21fc93b 3 | * (c) 2010-2025 Google LLC. https://angular.io/ 4 | * License: MIT 5 | */ 6 | 7 | import { AnimationPlayer, ɵStyleDataMap as _StyleDataMap, NoopAnimationPlayer } from '../../animation_player.d-Bpvrt8M2.js'; 8 | import { AnimationDriver } from '../../animation_driver.d-xuLo2K_d.js'; 9 | import '@angular/core'; 10 | 11 | /** 12 | * @publicApi 13 | */ 14 | declare class MockAnimationDriver implements AnimationDriver { 15 | static log: AnimationPlayer[]; 16 | validateStyleProperty(prop: string): boolean; 17 | validateAnimatableStyleProperty(prop: string): boolean; 18 | containsElement(elm1: any, elm2: any): boolean; 19 | getParentElement(element: unknown): unknown; 20 | query(element: any, selector: string, multi: boolean): any[]; 21 | computeStyle(element: any, prop: string, defaultValue?: string): string; 22 | animate(element: any, keyframes: Array<_StyleDataMap>, duration: number, delay: number, easing: string, previousPlayers?: any[]): MockAnimationPlayer; 23 | } 24 | /** 25 | * @publicApi 26 | */ 27 | declare class MockAnimationPlayer extends NoopAnimationPlayer { 28 | element: any; 29 | keyframes: Array<_StyleDataMap>; 30 | duration: number; 31 | delay: number; 32 | easing: string; 33 | previousPlayers: any[]; 34 | private __finished; 35 | private __started; 36 | previousStyles: _StyleDataMap; 37 | private _onInitFns; 38 | currentSnapshot: _StyleDataMap; 39 | private _keyframes; 40 | constructor(element: any, keyframes: Array<_StyleDataMap>, duration: number, delay: number, easing: string, previousPlayers: any[]); 41 | reset(): void; 42 | finish(): void; 43 | destroy(): void; 44 | play(): void; 45 | hasStarted(): boolean; 46 | beforeDestroy(): void; 47 | } 48 | 49 | export { MockAnimationDriver, MockAnimationPlayer }; 50 | -------------------------------------------------------------------------------- /fesm2022/animations.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Angular v20.1.0-next.0+sha-21fc93b 3 | * (c) 2010-2025 Google LLC. https://angular.io/ 4 | * License: MIT 5 | */ 6 | 7 | import { DOCUMENT } from '@angular/common'; 8 | import * as i0 from '@angular/core'; 9 | import { inject, Injectable, ANIMATION_MODULE_TYPE, ɵRuntimeError as _RuntimeError, Inject, ViewEncapsulation } from '@angular/core'; 10 | import { sequence } from './private_export-B_vy_9K7.mjs'; 11 | export { AUTO_STYLE, AnimationMetadataType, NoopAnimationPlayer, animate, animateChild, animation, group, keyframes, query, stagger, state, style, transition, trigger, useAnimation, AnimationGroupPlayer as ɵAnimationGroupPlayer, ɵPRE_STYLE } from './private_export-B_vy_9K7.mjs'; 12 | 13 | /** 14 | * An injectable service that produces an animation sequence programmatically within an 15 | * Angular component or directive. 16 | * Provided by the `BrowserAnimationsModule` or `NoopAnimationsModule`. 17 | * 18 | * @usageNotes 19 | * 20 | * To use this service, add it to your component or directive as a dependency. 21 | * The service is instantiated along with your component. 22 | * 23 | * Apps do not typically need to create their own animation players, but if you 24 | * do need to, follow these steps: 25 | * 26 | * 1. Use the [AnimationBuilder.build](api/animations/AnimationBuilder#build)() method 27 | * to create a programmatic animation. The method returns an `AnimationFactory` instance. 28 | * 29 | * 2. Use the factory object to create an `AnimationPlayer` and attach it to a DOM element. 30 | * 31 | * 3. Use the player object to control the animation programmatically. 32 | * 33 | * For example: 34 | * 35 | * ```ts 36 | * // import the service from BrowserAnimationsModule 37 | * import {AnimationBuilder} from '@angular/animations'; 38 | * // require the service as a dependency 39 | * class MyCmp { 40 | * constructor(private _builder: AnimationBuilder) {} 41 | * 42 | * makeAnimation(element: any) { 43 | * // first define a reusable animation 44 | * const myAnimation = this._builder.build([ 45 | * style({ width: 0 }), 46 | * animate(1000, style({ width: '100px' })) 47 | * ]); 48 | * 49 | * // use the returned factory object to create a player 50 | * const player = myAnimation.create(element); 51 | * 52 | * player.play(); 53 | * } 54 | * } 55 | * ``` 56 | * 57 | * @publicApi 58 | */ 59 | class AnimationBuilder { 60 | static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0-next.0+sha-21fc93b", ngImport: i0, type: AnimationBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); 61 | static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0-next.0+sha-21fc93b", ngImport: i0, type: AnimationBuilder, providedIn: 'root', useFactory: () => inject(BrowserAnimationBuilder) }); 62 | } 63 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0-next.0+sha-21fc93b", ngImport: i0, type: AnimationBuilder, decorators: [{ 64 | type: Injectable, 65 | args: [{ providedIn: 'root', useFactory: () => inject(BrowserAnimationBuilder) }] 66 | }] }); 67 | /** 68 | * A factory object returned from the 69 | * [AnimationBuilder.build](api/animations/AnimationBuilder#build)() 70 | * method. 71 | * 72 | * @publicApi 73 | */ 74 | class AnimationFactory { 75 | } 76 | class BrowserAnimationBuilder extends AnimationBuilder { 77 | animationModuleType = inject(ANIMATION_MODULE_TYPE, { optional: true }); 78 | _nextAnimationId = 0; 79 | _renderer; 80 | constructor(rootRenderer, doc) { 81 | super(); 82 | const typeData = { 83 | id: '0', 84 | encapsulation: ViewEncapsulation.None, 85 | styles: [], 86 | data: { animation: [] }, 87 | }; 88 | this._renderer = rootRenderer.createRenderer(doc.body, typeData); 89 | if (this.animationModuleType === null && !isAnimationRenderer(this._renderer)) { 90 | // We only support AnimationRenderer & DynamicDelegationRenderer for this AnimationBuilder 91 | throw new _RuntimeError(3600 /* RuntimeErrorCode.BROWSER_ANIMATION_BUILDER_INJECTED_WITHOUT_ANIMATIONS */, (typeof ngDevMode === 'undefined' || ngDevMode) && 92 | 'Angular detected that the `AnimationBuilder` was injected, but animation support was not enabled. ' + 93 | 'Please make sure that you enable animations in your application by calling `provideAnimations()` or `provideAnimationsAsync()` function.'); 94 | } 95 | } 96 | build(animation) { 97 | const id = this._nextAnimationId; 98 | this._nextAnimationId++; 99 | const entry = Array.isArray(animation) ? sequence(animation) : animation; 100 | issueAnimationCommand(this._renderer, null, id, 'register', [entry]); 101 | return new BrowserAnimationFactory(id, this._renderer); 102 | } 103 | static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0-next.0+sha-21fc93b", ngImport: i0, type: BrowserAnimationBuilder, deps: [{ token: i0.RendererFactory2 }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); 104 | static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.0-next.0+sha-21fc93b", ngImport: i0, type: BrowserAnimationBuilder, providedIn: 'root' }); 105 | } 106 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0-next.0+sha-21fc93b", ngImport: i0, type: BrowserAnimationBuilder, decorators: [{ 107 | type: Injectable, 108 | args: [{ providedIn: 'root' }] 109 | }], ctorParameters: () => [{ type: i0.RendererFactory2 }, { type: Document, decorators: [{ 110 | type: Inject, 111 | args: [DOCUMENT] 112 | }] }] }); 113 | class BrowserAnimationFactory extends AnimationFactory { 114 | _id; 115 | _renderer; 116 | constructor(_id, _renderer) { 117 | super(); 118 | this._id = _id; 119 | this._renderer = _renderer; 120 | } 121 | create(element, options) { 122 | return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer); 123 | } 124 | } 125 | class RendererAnimationPlayer { 126 | id; 127 | element; 128 | _renderer; 129 | parentPlayer = null; 130 | _started = false; 131 | constructor(id, element, options, _renderer) { 132 | this.id = id; 133 | this.element = element; 134 | this._renderer = _renderer; 135 | this._command('create', options); 136 | } 137 | _listen(eventName, callback) { 138 | return this._renderer.listen(this.element, `@@${this.id}:${eventName}`, callback); 139 | } 140 | _command(command, ...args) { 141 | issueAnimationCommand(this._renderer, this.element, this.id, command, args); 142 | } 143 | onDone(fn) { 144 | this._listen('done', fn); 145 | } 146 | onStart(fn) { 147 | this._listen('start', fn); 148 | } 149 | onDestroy(fn) { 150 | this._listen('destroy', fn); 151 | } 152 | init() { 153 | this._command('init'); 154 | } 155 | hasStarted() { 156 | return this._started; 157 | } 158 | play() { 159 | this._command('play'); 160 | this._started = true; 161 | } 162 | pause() { 163 | this._command('pause'); 164 | } 165 | restart() { 166 | this._command('restart'); 167 | } 168 | finish() { 169 | this._command('finish'); 170 | } 171 | destroy() { 172 | this._command('destroy'); 173 | } 174 | reset() { 175 | this._command('reset'); 176 | this._started = false; 177 | } 178 | setPosition(p) { 179 | this._command('setPosition', p); 180 | } 181 | getPosition() { 182 | return unwrapAnimationRenderer(this._renderer)?.engine?.players[this.id]?.getPosition() ?? 0; 183 | } 184 | totalTime = 0; 185 | } 186 | function issueAnimationCommand(renderer, element, id, command, args) { 187 | renderer.setProperty(element, `@@${id}:${command}`, args); 188 | } 189 | /** 190 | * The following 2 methods cannot reference their correct types (AnimationRenderer & 191 | * DynamicDelegationRenderer) since this would introduce a import cycle. 192 | */ 193 | function unwrapAnimationRenderer(renderer) { 194 | const type = renderer.ɵtype; 195 | if (type === 0 /* AnimationRendererType.Regular */) { 196 | return renderer; 197 | } 198 | else if (type === 1 /* AnimationRendererType.Delegated */) { 199 | return renderer.animationRenderer; 200 | } 201 | return null; 202 | } 203 | function isAnimationRenderer(renderer) { 204 | const type = renderer.ɵtype; 205 | return type === 0 /* AnimationRendererType.Regular */ || type === 1 /* AnimationRendererType.Delegated */; 206 | } 207 | 208 | export { AnimationBuilder, AnimationFactory, sequence, BrowserAnimationBuilder as ɵBrowserAnimationBuilder }; 209 | //# sourceMappingURL=animations.mjs.map 210 | -------------------------------------------------------------------------------- /fesm2022/animations.mjs.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"animations.mjs","sources":["../../../../../k8-fastbuild-ST-46c76129e412/bin/packages/animations/src/animation_builder.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {DOCUMENT} from '@angular/common';\nimport {\n ANIMATION_MODULE_TYPE,\n Inject,\n inject,\n Injectable,\n Renderer2,\n RendererFactory2,\n RendererType2,\n ViewEncapsulation,\n ɵAnimationRendererType as AnimationRendererType,\n ɵRuntimeError as RuntimeError,\n} from '@angular/core';\n\nimport {AnimationMetadata, AnimationOptions, sequence} from './animation_metadata';\nimport {RuntimeErrorCode} from './errors';\nimport {AnimationPlayer} from './players/animation_player';\n\n/**\n * An injectable service that produces an animation sequence programmatically within an\n * Angular component or directive.\n * Provided by the `BrowserAnimationsModule` or `NoopAnimationsModule`.\n *\n * @usageNotes\n *\n * To use this service, add it to your component or directive as a dependency.\n * The service is instantiated along with your component.\n *\n * Apps do not typically need to create their own animation players, but if you\n * do need to, follow these steps:\n *\n * 1. Use the [AnimationBuilder.build](api/animations/AnimationBuilder#build)() method\n * to create a programmatic animation. The method returns an `AnimationFactory` instance.\n *\n * 2. Use the factory object to create an `AnimationPlayer` and attach it to a DOM element.\n *\n * 3. Use the player object to control the animation programmatically.\n *\n * For example:\n *\n * ```ts\n * // import the service from BrowserAnimationsModule\n * import {AnimationBuilder} from '@angular/animations';\n * // require the service as a dependency\n * class MyCmp {\n * constructor(private _builder: AnimationBuilder) {}\n *\n * makeAnimation(element: any) {\n * // first define a reusable animation\n * const myAnimation = this._builder.build([\n * style({ width: 0 }),\n * animate(1000, style({ width: '100px' }))\n * ]);\n *\n * // use the returned factory object to create a player\n * const player = myAnimation.create(element);\n *\n * player.play();\n * }\n * }\n * ```\n *\n * @publicApi\n */\n@Injectable({providedIn: 'root', useFactory: () => inject(BrowserAnimationBuilder)})\nexport abstract class AnimationBuilder {\n /**\n * Builds a factory for producing a defined animation.\n * @param animation A reusable animation definition.\n * @returns A factory object that can create a player for the defined animation.\n * @see {@link animate}\n */\n abstract build(animation: AnimationMetadata | AnimationMetadata[]): AnimationFactory;\n}\n\n/**\n * A factory object returned from the\n * [AnimationBuilder.build](api/animations/AnimationBuilder#build)()\n * method.\n *\n * @publicApi\n */\nexport abstract class AnimationFactory {\n /**\n * Creates an `AnimationPlayer` instance for the reusable animation defined by\n * the [AnimationBuilder.build](api/animations/AnimationBuilder#build)()\n * method that created this factory and attaches the new player a DOM element.\n *\n * @param element The DOM element to which to attach the player.\n * @param options A set of options that can include a time delay and\n * additional developer-defined parameters.\n */\n abstract create(element: any, options?: AnimationOptions): AnimationPlayer;\n}\n\n@Injectable({providedIn: 'root'})\nexport class BrowserAnimationBuilder extends AnimationBuilder {\n private animationModuleType = inject(ANIMATION_MODULE_TYPE, {optional: true});\n private _nextAnimationId = 0;\n private _renderer: Renderer2;\n\n constructor(rootRenderer: RendererFactory2, @Inject(DOCUMENT) doc: Document) {\n super();\n const typeData: RendererType2 = {\n id: '0',\n encapsulation: ViewEncapsulation.None,\n styles: [],\n data: {animation: []},\n };\n this._renderer = rootRenderer.createRenderer(doc.body, typeData);\n\n if (this.animationModuleType === null && !isAnimationRenderer(this._renderer)) {\n // We only support AnimationRenderer & DynamicDelegationRenderer for this AnimationBuilder\n\n throw new RuntimeError(\n RuntimeErrorCode.BROWSER_ANIMATION_BUILDER_INJECTED_WITHOUT_ANIMATIONS,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n 'Angular detected that the `AnimationBuilder` was injected, but animation support was not enabled. ' +\n 'Please make sure that you enable animations in your application by calling `provideAnimations()` or `provideAnimationsAsync()` function.',\n );\n }\n }\n\n override build(animation: AnimationMetadata | AnimationMetadata[]): AnimationFactory {\n const id = this._nextAnimationId;\n this._nextAnimationId++;\n const entry = Array.isArray(animation) ? sequence(animation) : animation;\n issueAnimationCommand(this._renderer, null, id, 'register', [entry]);\n return new BrowserAnimationFactory(id, this._renderer);\n }\n}\n\nclass BrowserAnimationFactory extends AnimationFactory {\n constructor(\n private _id: number,\n private _renderer: Renderer2,\n ) {\n super();\n }\n\n override create(element: any, options?: AnimationOptions): AnimationPlayer {\n return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer);\n }\n}\n\nclass RendererAnimationPlayer implements AnimationPlayer {\n public parentPlayer: AnimationPlayer | null = null;\n private _started = false;\n\n constructor(\n public id: number,\n public element: any,\n options: AnimationOptions,\n private _renderer: Renderer2,\n ) {\n this._command('create', options);\n }\n\n private _listen(eventName: string, callback: (event: any) => any): () => void {\n return this._renderer.listen(this.element, `@@${this.id}:${eventName}`, callback);\n }\n\n private _command(command: string, ...args: any[]): void {\n issueAnimationCommand(this._renderer, this.element, this.id, command, args);\n }\n\n onDone(fn: () => void): void {\n this._listen('done', fn);\n }\n\n onStart(fn: () => void): void {\n this._listen('start', fn);\n }\n\n onDestroy(fn: () => void): void {\n this._listen('destroy', fn);\n }\n\n init(): void {\n this._command('init');\n }\n\n hasStarted(): boolean {\n return this._started;\n }\n\n play(): void {\n this._command('play');\n this._started = true;\n }\n\n pause(): void {\n this._command('pause');\n }\n\n restart(): void {\n this._command('restart');\n }\n\n finish(): void {\n this._command('finish');\n }\n\n destroy(): void {\n this._command('destroy');\n }\n\n reset(): void {\n this._command('reset');\n this._started = false;\n }\n\n setPosition(p: number): void {\n this._command('setPosition', p);\n }\n\n getPosition(): number {\n return unwrapAnimationRenderer(this._renderer)?.engine?.players[this.id]?.getPosition() ?? 0;\n }\n\n public totalTime = 0;\n}\n\nfunction issueAnimationCommand(\n renderer: Renderer2,\n element: any,\n id: number,\n command: string,\n args: any[],\n): void {\n renderer.setProperty(element, `@@${id}:${command}`, args);\n}\n\n/**\n * The following 2 methods cannot reference their correct types (AnimationRenderer &\n * DynamicDelegationRenderer) since this would introduce a import cycle.\n */\n\nfunction unwrapAnimationRenderer(\n renderer: Renderer2,\n): {engine: {players: AnimationPlayer[]}} | null {\n const type = (renderer as unknown as {ɵtype: AnimationRendererType}).ɵtype;\n if (type === AnimationRendererType.Regular) {\n return renderer as any;\n } else if (type === AnimationRendererType.Delegated) {\n return (renderer as any).animationRenderer;\n }\n\n return null;\n}\n\nfunction isAnimationRenderer(renderer: Renderer2): boolean {\n const type = (renderer as unknown as {ɵtype: AnimationRendererType}).ɵtype;\n return type === AnimationRendererType.Regular || type === AnimationRendererType.Delegated;\n}\n"],"names":["RuntimeError"],"mappings":";;;;;;;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CG;MAEmB,gBAAgB,CAAA;kHAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;sHAAhB,gBAAgB,EAAA,UAAA,EADb,MAAM,EAAc,UAAA,EAAA,MAAM,MAAM,CAAC,uBAAuB,CAAC,EAAA,CAAA;;sGAC5D,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA,EAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC,uBAAuB,CAAC,EAAC;;AAWnF;;;;;;AAMG;MACmB,gBAAgB,CAAA;AAWrC;AAGK,MAAO,uBAAwB,SAAQ,gBAAgB,CAAA;IACnD,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;IACrE,gBAAgB,GAAG,CAAC;AACpB,IAAA,SAAS;IAEjB,WAAY,CAAA,YAA8B,EAAoB,GAAa,EAAA;AACzE,QAAA,KAAK,EAAE;AACP,QAAA,MAAM,QAAQ,GAAkB;AAC9B,YAAA,EAAE,EAAE,GAAG;YACP,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,YAAA,MAAM,EAAE,EAAE;AACV,YAAA,IAAI,EAAE,EAAC,SAAS,EAAE,EAAE,EAAC;SACtB;AACD,QAAA,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC;AAEhE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AAE,CAAA,CAAA,EAAI,OAAO,CAAA,CAAE,EAAE,IAAI,CAAC;AAC3D;AAEA;;;AAGG;AAEH,SAAS,uBAAuB,CAC9B,QAAmB,EAAA;AAEnB,IAAA,MAAM,IAAI,GAAI,QAAsD,CAAC,KAAK;IAC1E,IAAI,IAAI,KAAkC,CAAA,sCAAE;AAC1C,QAAA,OAAO,QAAe;;SACjB,IAAI,IAAI,KAAoC,CAAA,wCAAE;QACnD,OAAQ,QAAgB,CAAC,iBAAiB;;AAG5C,IAAA,OAAO,IAAI;AACb;AAEA,SAAS,mBAAmB,CAAC,QAAmB,EAAA;AAC9C,IAAA,MAAM,IAAI,GAAI,QAAsD,CAAC,KAAK;AAC1E,IAAA,OAAO,IAAI,KAAA,CAAA,wCAAsC,IAAI;AACvD;;;;"} -------------------------------------------------------------------------------- /fesm2022/browser/testing.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Angular v20.1.0-next.0+sha-21fc93b 3 | * (c) 2010-2025 Google LLC. https://angular.io/ 4 | * License: MIT 5 | */ 6 | 7 | import { validateStyleProperty, camelCaseToDashCase, validateWebAnimatableStyleProperty, containsElement, getParentElement, invokeQuery, normalizeKeyframes$1 as normalizeKeyframes, allowPreviousPlayerStylesMerge } from '../util-CPU6TNml.mjs'; 8 | import { NoopAnimationPlayer, AUTO_STYLE } from '../private_export-B_vy_9K7.mjs'; 9 | import '@angular/core'; 10 | 11 | /** 12 | * @publicApi 13 | */ 14 | class MockAnimationDriver { 15 | static log = []; 16 | validateStyleProperty(prop) { 17 | return validateStyleProperty(prop); 18 | } 19 | validateAnimatableStyleProperty(prop) { 20 | const cssProp = camelCaseToDashCase(prop); 21 | return validateWebAnimatableStyleProperty(cssProp); 22 | } 23 | containsElement(elm1, elm2) { 24 | return containsElement(elm1, elm2); 25 | } 26 | getParentElement(element) { 27 | return getParentElement(element); 28 | } 29 | query(element, selector, multi) { 30 | return invokeQuery(element, selector, multi); 31 | } 32 | computeStyle(element, prop, defaultValue) { 33 | return defaultValue || ''; 34 | } 35 | animate(element, keyframes, duration, delay, easing, previousPlayers = []) { 36 | const player = new MockAnimationPlayer(element, keyframes, duration, delay, easing, previousPlayers); 37 | MockAnimationDriver.log.push(player); 38 | return player; 39 | } 40 | } 41 | /** 42 | * @publicApi 43 | */ 44 | class MockAnimationPlayer extends NoopAnimationPlayer { 45 | element; 46 | keyframes; 47 | duration; 48 | delay; 49 | easing; 50 | previousPlayers; 51 | __finished = false; 52 | __started = false; 53 | previousStyles = new Map(); 54 | _onInitFns = []; 55 | currentSnapshot = new Map(); 56 | _keyframes = []; 57 | constructor(element, keyframes, duration, delay, easing, previousPlayers) { 58 | super(duration, delay); 59 | this.element = element; 60 | this.keyframes = keyframes; 61 | this.duration = duration; 62 | this.delay = delay; 63 | this.easing = easing; 64 | this.previousPlayers = previousPlayers; 65 | this._keyframes = normalizeKeyframes(keyframes); 66 | if (allowPreviousPlayerStylesMerge(duration, delay)) { 67 | previousPlayers.forEach((player) => { 68 | if (player instanceof MockAnimationPlayer) { 69 | const styles = player.currentSnapshot; 70 | styles.forEach((val, prop) => this.previousStyles.set(prop, val)); 71 | } 72 | }); 73 | } 74 | } 75 | /** @internal */ 76 | onInit(fn) { 77 | this._onInitFns.push(fn); 78 | } 79 | /** @internal */ 80 | init() { 81 | super.init(); 82 | this._onInitFns.forEach((fn) => fn()); 83 | this._onInitFns = []; 84 | } 85 | reset() { 86 | super.reset(); 87 | this.__started = false; 88 | } 89 | finish() { 90 | super.finish(); 91 | this.__finished = true; 92 | } 93 | destroy() { 94 | super.destroy(); 95 | this.__finished = true; 96 | } 97 | /** @internal */ 98 | triggerMicrotask() { } 99 | play() { 100 | super.play(); 101 | this.__started = true; 102 | } 103 | hasStarted() { 104 | return this.__started; 105 | } 106 | beforeDestroy() { 107 | const captures = new Map(); 108 | this.previousStyles.forEach((val, prop) => captures.set(prop, val)); 109 | if (this.hasStarted()) { 110 | // when assembling the captured styles, it's important that 111 | // we build the keyframe styles in the following order: 112 | // {other styles within keyframes, ... previousStyles } 113 | this._keyframes.forEach((kf) => { 114 | for (let [prop, val] of kf) { 115 | if (prop !== 'offset') { 116 | captures.set(prop, this.__finished ? val : AUTO_STYLE); 117 | } 118 | } 119 | }); 120 | } 121 | this.currentSnapshot = captures; 122 | } 123 | } 124 | 125 | export { MockAnimationDriver, MockAnimationPlayer }; 126 | //# sourceMappingURL=testing.mjs.map 127 | -------------------------------------------------------------------------------- /fesm2022/browser/testing.mjs.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"testing.mjs","sources":["../../../../../../k8-fastbuild-ST-46c76129e412/bin/packages/animations/browser/testing/src/mock_animation_driver.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {\n AnimationPlayer,\n AUTO_STYLE,\n NoopAnimationPlayer,\n ɵStyleDataMap,\n} from '../../../src/animations';\nimport {\n AnimationDriver,\n ɵallowPreviousPlayerStylesMerge as allowPreviousPlayerStylesMerge,\n ɵcamelCaseToDashCase,\n ɵcontainsElement as containsElement,\n ɵgetParentElement as getParentElement,\n ɵinvokeQuery as invokeQuery,\n ɵnormalizeKeyframes as normalizeKeyframes,\n ɵvalidateStyleProperty as validateStyleProperty,\n ɵvalidateWebAnimatableStyleProperty,\n} from '../../../browser';\n\n/**\n * @publicApi\n */\nexport class MockAnimationDriver implements AnimationDriver {\n static log: AnimationPlayer[] = [];\n\n validateStyleProperty(prop: string): boolean {\n return validateStyleProperty(prop);\n }\n\n validateAnimatableStyleProperty(prop: string): boolean {\n const cssProp = ɵcamelCaseToDashCase(prop);\n return ɵvalidateWebAnimatableStyleProperty(cssProp);\n }\n\n containsElement(elm1: any, elm2: any): boolean {\n return containsElement(elm1, elm2);\n }\n\n getParentElement(element: unknown): unknown {\n return getParentElement(element);\n }\n\n query(element: any, selector: string, multi: boolean): any[] {\n return invokeQuery(element, selector, multi);\n }\n\n computeStyle(element: any, prop: string, defaultValue?: string): string {\n return defaultValue || '';\n }\n\n animate(\n element: any,\n keyframes: Array<ɵStyleDataMap>,\n duration: number,\n delay: number,\n easing: string,\n previousPlayers: any[] = [],\n ): MockAnimationPlayer {\n const player = new MockAnimationPlayer(\n element,\n keyframes,\n duration,\n delay,\n easing,\n previousPlayers,\n );\n MockAnimationDriver.log.push(player);\n return player;\n }\n}\n\n/**\n * @publicApi\n */\nexport class MockAnimationPlayer extends NoopAnimationPlayer {\n private __finished = false;\n private __started = false;\n public previousStyles: ɵStyleDataMap = new Map();\n private _onInitFns: (() => any)[] = [];\n public currentSnapshot: ɵStyleDataMap = new Map();\n private _keyframes: Array<ɵStyleDataMap> = [];\n\n constructor(\n public element: any,\n public keyframes: Array<ɵStyleDataMap>,\n public duration: number,\n public delay: number,\n public easing: string,\n public previousPlayers: any[],\n ) {\n super(duration, delay);\n\n this._keyframes = normalizeKeyframes(keyframes);\n\n if (allowPreviousPlayerStylesMerge(duration, delay)) {\n previousPlayers.forEach((player) => {\n if (player instanceof MockAnimationPlayer) {\n const styles = player.currentSnapshot;\n styles.forEach((val, prop) => this.previousStyles.set(prop, val));\n }\n });\n }\n }\n\n /** @internal */\n onInit(fn: () => any) {\n this._onInitFns.push(fn);\n }\n\n /** @internal */\n override init() {\n super.init();\n this._onInitFns.forEach((fn) => fn());\n this._onInitFns = [];\n }\n\n override reset() {\n super.reset();\n this.__started = false;\n }\n\n override finish(): void {\n super.finish();\n this.__finished = true;\n }\n\n override destroy(): void {\n super.destroy();\n this.__finished = true;\n }\n\n /** @internal */\n triggerMicrotask() {}\n\n override play(): void {\n super.play();\n this.__started = true;\n }\n\n override hasStarted() {\n return this.__started;\n }\n\n beforeDestroy() {\n const captures: ɵStyleDataMap = new Map();\n\n this.previousStyles.forEach((val, prop) => captures.set(prop, val));\n\n if (this.hasStarted()) {\n // when assembling the captured styles, it's important that\n // we build the keyframe styles in the following order:\n // {other styles within keyframes, ... previousStyles }\n this._keyframes.forEach((kf) => {\n for (let [prop, val] of kf) {\n if (prop !== 'offset') {\n captures.set(prop, this.__finished ? val : AUTO_STYLE);\n }\n }\n });\n }\n\n this.currentSnapshot = captures;\n }\n}\n"],"names":["ɵcamelCaseToDashCase","ɵvalidateWebAnimatableStyleProperty"],"mappings":";;;;;;;;;;AAyBA;;AAEG;MACU,mBAAmB,CAAA;AAC9B,IAAA,OAAO,GAAG,GAAsB,EAAE;AAElC,IAAA,qBAAqB,CAAC,IAAY,EAAA;AAChC,QAAA,OAAO,qBAAqB,CAAC,IAAI,CAAC;;AAGpC,IAAA,+BAA+B,CAAC,IAAY,EAAA;AAC1C,QAAA,MAAM,OAAO,GAAGA,mBAAoB,CAAC,IAAI,CAAC;AAC1C,QAAA,OAAOC,kCAAmC,CAAC,OAAO,CAAC;;IAGrD,eAAe,CAAC,IAAS,EAAE,IAAS,EAAA;AAClC,QAAA,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC;;AAGpC,IAAA,gBAAgB,CAAC,OAAgB,EAAA;AAC/B,QAAA,OAAO,gBAAgB,CAAC,OAAO,CAAC;;AAGlC,IAAA,KAAK,CAAC,OAAY,EAAE,QAAgB,EAAE,KAAc,EAAA;QAClD,OAAO,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC;;AAG9C,IAAA,YAAY,CAAC,OAAY,EAAE,IAAY,EAAE,YAAqB,EAAA;QAC5D,OAAO,YAAY,IAAI,EAAE;;AAG3B,IAAA,OAAO,CACL,OAAY,EACZ,SAA+B,EAC/B,QAAgB,EAChB,KAAa,EACb,MAAc,EACd,eAAA,GAAyB,EAAE,EAAA;AAE3B,QAAA,MAAM,MAAM,GAAG,IAAI,mBAAmB,CACpC,OAAO,EACP,SAAS,EACT,QAAQ,EACR,KAAK,EACL,MAAM,EACN,eAAe,CAChB;AACD,QAAA,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAkB,MAAM,CAAC;AACrD,QAAA,OAAO,MAAM;;;AAIjB;;AAE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K7.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Angular v20.1.0-next.0+sha-21fc93b 3 | * (c) 2010-2025 Google LLC. https://angular.io/ 4 | * License: MIT 5 | */ 6 | 7 | /** 8 | * @description Constants for the categories of parameters that can be defined for animations. 9 | * 10 | * A corresponding function defines a set of parameters for each category, and 11 | * collects them into a corresponding `AnimationMetadata` object. 12 | * 13 | * @publicApi 14 | */ 15 | var AnimationMetadataType; 16 | (function (AnimationMetadataType) { 17 | /** 18 | * Associates a named animation state with a set of CSS styles. 19 | * See [`state()`](api/animations/state) 20 | */ 21 | AnimationMetadataType[AnimationMetadataType["State"] = 0] = "State"; 22 | /** 23 | * Data for a transition from one animation state to another. 24 | * See `transition()` 25 | */ 26 | AnimationMetadataType[AnimationMetadataType["Transition"] = 1] = "Transition"; 27 | /** 28 | * Contains a set of animation steps. 29 | * See `sequence()` 30 | */ 31 | AnimationMetadataType[AnimationMetadataType["Sequence"] = 2] = "Sequence"; 32 | /** 33 | * Contains a set of animation steps. 34 | * See `group()` 35 | */ 36 | AnimationMetadataType[AnimationMetadataType["Group"] = 3] = "Group"; 37 | /** 38 | * Contains an animation step. 39 | * See `animate()` 40 | */ 41 | AnimationMetadataType[AnimationMetadataType["Animate"] = 4] = "Animate"; 42 | /** 43 | * Contains a set of animation steps. 44 | * See `keyframes()` 45 | */ 46 | AnimationMetadataType[AnimationMetadataType["Keyframes"] = 5] = "Keyframes"; 47 | /** 48 | * Contains a set of CSS property-value pairs into a named style. 49 | * See `style()` 50 | */ 51 | AnimationMetadataType[AnimationMetadataType["Style"] = 6] = "Style"; 52 | /** 53 | * Associates an animation with an entry trigger that can be attached to an element. 54 | * See `trigger()` 55 | */ 56 | AnimationMetadataType[AnimationMetadataType["Trigger"] = 7] = "Trigger"; 57 | /** 58 | * Contains a re-usable animation. 59 | * See `animation()` 60 | */ 61 | AnimationMetadataType[AnimationMetadataType["Reference"] = 8] = "Reference"; 62 | /** 63 | * Contains data to use in executing child animations returned by a query. 64 | * See `animateChild()` 65 | */ 66 | AnimationMetadataType[AnimationMetadataType["AnimateChild"] = 9] = "AnimateChild"; 67 | /** 68 | * Contains animation parameters for a re-usable animation. 69 | * See `useAnimation()` 70 | */ 71 | AnimationMetadataType[AnimationMetadataType["AnimateRef"] = 10] = "AnimateRef"; 72 | /** 73 | * Contains child-animation query data. 74 | * See `query()` 75 | */ 76 | AnimationMetadataType[AnimationMetadataType["Query"] = 11] = "Query"; 77 | /** 78 | * Contains data for staggering an animation sequence. 79 | * See `stagger()` 80 | */ 81 | AnimationMetadataType[AnimationMetadataType["Stagger"] = 12] = "Stagger"; 82 | })(AnimationMetadataType || (AnimationMetadataType = {})); 83 | /** 84 | * Specifies automatic styling. 85 | * 86 | * @publicApi 87 | */ 88 | const AUTO_STYLE = '*'; 89 | /** 90 | * Creates a named animation trigger, containing a list of [`state()`](api/animations/state) 91 | * and `transition()` entries to be evaluated when the expression 92 | * bound to the trigger changes. 93 | * 94 | * @param name An identifying string. 95 | * @param definitions An animation definition object, containing an array of 96 | * [`state()`](api/animations/state) and `transition()` declarations. 97 | * 98 | * @return An object that encapsulates the trigger data. 99 | * 100 | * @usageNotes 101 | * Define an animation trigger in the `animations` section of `@Component` metadata. 102 | * In the template, reference the trigger by name and bind it to a trigger expression that 103 | * evaluates to a defined animation state, using the following format: 104 | * 105 | * `[@triggerName]="expression"` 106 | * 107 | * Animation trigger bindings convert all values to strings, and then match the 108 | * previous and current values against any linked transitions. 109 | * Booleans can be specified as `1` or `true` and `0` or `false`. 110 | * 111 | * ### Usage Example 112 | * 113 | * The following example creates an animation trigger reference based on the provided 114 | * name value. 115 | * The provided animation value is expected to be an array consisting of state and 116 | * transition declarations. 117 | * 118 | * ```ts 119 | * @Component({ 120 | * selector: "my-component", 121 | * templateUrl: "my-component-tpl.html", 122 | * animations: [ 123 | * trigger("myAnimationTrigger", [ 124 | * state(...), 125 | * state(...), 126 | * transition(...), 127 | * transition(...) 128 | * ]) 129 | * ] 130 | * }) 131 | * class MyComponent { 132 | * myStatusExp = "something"; 133 | * } 134 | * ``` 135 | * 136 | * The template associated with this component makes use of the defined trigger 137 | * by binding to an element within its template code. 138 | * 139 | * ```html 140 | * 141 | *
...
142 | * ``` 143 | * 144 | * ### Using an inline function 145 | * The `transition` animation method also supports reading an inline function which can decide 146 | * if its associated animation should be run. 147 | * 148 | * ```ts 149 | * // this method is run each time the `myAnimationTrigger` trigger value changes. 150 | * function myInlineMatcherFn(fromState: string, toState: string, element: any, params: {[key: 151 | string]: any}): boolean { 152 | * // notice that `element` and `params` are also available here 153 | * return toState == 'yes-please-animate'; 154 | * } 155 | * 156 | * @Component({ 157 | * selector: 'my-component', 158 | * templateUrl: 'my-component-tpl.html', 159 | * animations: [ 160 | * trigger('myAnimationTrigger', [ 161 | * transition(myInlineMatcherFn, [ 162 | * // the animation sequence code 163 | * ]), 164 | * ]) 165 | * ] 166 | * }) 167 | * class MyComponent { 168 | * myStatusExp = "yes-please-animate"; 169 | * } 170 | * ``` 171 | * 172 | * ### Disabling Animations 173 | * When true, the special animation control binding `@.disabled` binding prevents 174 | * all animations from rendering. 175 | * Place the `@.disabled` binding on an element to disable 176 | * animations on the element itself, as well as any inner animation triggers 177 | * within the element. 178 | * 179 | * The following example shows how to use this feature: 180 | * 181 | * ```angular-ts 182 | * @Component({ 183 | * selector: 'my-component', 184 | * template: ` 185 | *
186 | *
187 | *
188 | * `, 189 | * animations: [ 190 | * trigger("childAnimation", [ 191 | * // ... 192 | * ]) 193 | * ] 194 | * }) 195 | * class MyComponent { 196 | * isDisabled = true; 197 | * exp = '...'; 198 | * } 199 | * ``` 200 | * 201 | * When `@.disabled` is true, it prevents the `@childAnimation` trigger from animating, 202 | * along with any inner animations. 203 | * 204 | * ### Disable animations application-wide 205 | * When an area of the template is set to have animations disabled, 206 | * **all** inner components have their animations disabled as well. 207 | * This means that you can disable all animations for an app 208 | * by placing a host binding set on `@.disabled` on the topmost Angular component. 209 | * 210 | * ```ts 211 | * import {Component, HostBinding} from '@angular/core'; 212 | * 213 | * @Component({ 214 | * selector: 'app-component', 215 | * templateUrl: 'app.component.html', 216 | * }) 217 | * class AppComponent { 218 | * @HostBinding('@.disabled') 219 | * public animationsDisabled = true; 220 | * } 221 | * ``` 222 | * 223 | * ### Overriding disablement of inner animations 224 | * Despite inner animations being disabled, a parent animation can `query()` 225 | * for inner elements located in disabled areas of the template and still animate 226 | * them if needed. This is also the case for when a sub animation is 227 | * queried by a parent and then later animated using `animateChild()`. 228 | * 229 | * ### Detecting when an animation is disabled 230 | * If a region of the DOM (or the entire application) has its animations disabled, the animation 231 | * trigger callbacks still fire, but for zero seconds. When the callback fires, it provides 232 | * an instance of an `AnimationEvent`. If animations are disabled, 233 | * the `.disabled` flag on the event is true. 234 | * 235 | * @publicApi 236 | */ 237 | function trigger(name, definitions) { 238 | return { type: AnimationMetadataType.Trigger, name, definitions, options: {} }; 239 | } 240 | /** 241 | * Defines an animation step that combines styling information with timing information. 242 | * 243 | * @param timings Sets `AnimateTimings` for the parent animation. 244 | * A string in the format "duration [delay] [easing]". 245 | * - Duration and delay are expressed as a number and optional time unit, 246 | * such as "1s" or "10ms" for one second and 10 milliseconds, respectively. 247 | * The default unit is milliseconds. 248 | * - The easing value controls how the animation accelerates and decelerates 249 | * during its runtime. Value is one of `ease`, `ease-in`, `ease-out`, 250 | * `ease-in-out`, or a `cubic-bezier()` function call. 251 | * If not supplied, no easing is applied. 252 | * 253 | * For example, the string "1s 100ms ease-out" specifies a duration of 254 | * 1000 milliseconds, and delay of 100 ms, and the "ease-out" easing style, 255 | * which decelerates near the end of the duration. 256 | * @param styles Sets AnimationStyles for the parent animation. 257 | * A function call to either `style()` or `keyframes()` 258 | * that returns a collection of CSS style entries to be applied to the parent animation. 259 | * When null, uses the styles from the destination state. 260 | * This is useful when describing an animation step that will complete an animation; 261 | * see "Animating to the final state" in `transitions()`. 262 | * @returns An object that encapsulates the animation step. 263 | * 264 | * @usageNotes 265 | * Call within an animation `sequence()`, {@link /api/animations/group group()}, or 266 | * `transition()` call to specify an animation step 267 | * that applies given style data to the parent animation for a given amount of time. 268 | * 269 | * ### Syntax Examples 270 | * **Timing examples** 271 | * 272 | * The following examples show various `timings` specifications. 273 | * - `animate(500)` : Duration is 500 milliseconds. 274 | * - `animate("1s")` : Duration is 1000 milliseconds. 275 | * - `animate("100ms 0.5s")` : Duration is 100 milliseconds, delay is 500 milliseconds. 276 | * - `animate("5s ease-in")` : Duration is 5000 milliseconds, easing in. 277 | * - `animate("5s 10ms cubic-bezier(.17,.67,.88,.1)")` : Duration is 5000 milliseconds, delay is 10 278 | * milliseconds, easing according to a bezier curve. 279 | * 280 | * **Style examples** 281 | * 282 | * The following example calls `style()` to set a single CSS style. 283 | * ```ts 284 | * animate(500, style({ background: "red" })) 285 | * ``` 286 | * The following example calls `keyframes()` to set a CSS style 287 | * to different values for successive keyframes. 288 | * ```ts 289 | * animate(500, keyframes( 290 | * [ 291 | * style({ background: "blue" }), 292 | * style({ background: "red" }) 293 | * ]) 294 | * ``` 295 | * 296 | * @publicApi 297 | */ 298 | function animate(timings, styles = null) { 299 | return { type: AnimationMetadataType.Animate, styles, timings }; 300 | } 301 | /** 302 | * @description Defines a list of animation steps to be run in parallel. 303 | * 304 | * @param steps An array of animation step objects. 305 | * - When steps are defined by `style()` or `animate()` 306 | * function calls, each call within the group is executed instantly. 307 | * - To specify offset styles to be applied at a later time, define steps with 308 | * `keyframes()`, or use `animate()` calls with a delay value. 309 | * For example: 310 | * 311 | * ```ts 312 | * group([ 313 | * animate("1s", style({ background: "black" })), 314 | * animate("2s", style({ color: "white" })) 315 | * ]) 316 | * ``` 317 | * 318 | * @param options An options object containing a delay and 319 | * developer-defined parameters that provide styling defaults and 320 | * can be overridden on invocation. 321 | * 322 | * @return An object that encapsulates the group data. 323 | * 324 | * @usageNotes 325 | * Grouped animations are useful when a series of styles must be 326 | * animated at different starting times and closed off at different ending times. 327 | * 328 | * When called within a `sequence()` or a 329 | * `transition()` call, does not continue to the next 330 | * instruction until all of the inner animation steps have completed. 331 | * 332 | * @publicApi 333 | */ 334 | function group(steps, options = null) { 335 | return { type: AnimationMetadataType.Group, steps, options }; 336 | } 337 | /** 338 | * Defines a list of animation steps to be run sequentially, one by one. 339 | * 340 | * @param steps An array of animation step objects. 341 | * - Steps defined by `style()` calls apply the styling data immediately. 342 | * - Steps defined by `animate()` calls apply the styling data over time 343 | * as specified by the timing data. 344 | * 345 | * ```ts 346 | * sequence([ 347 | * style({ opacity: 0 }), 348 | * animate("1s", style({ opacity: 1 })) 349 | * ]) 350 | * ``` 351 | * 352 | * @param options An options object containing a delay and 353 | * developer-defined parameters that provide styling defaults and 354 | * can be overridden on invocation. 355 | * 356 | * @return An object that encapsulates the sequence data. 357 | * 358 | * @usageNotes 359 | * When you pass an array of steps to a 360 | * `transition()` call, the steps run sequentially by default. 361 | * Compare this to the {@link /api/animations/group group()} call, which runs animation steps in 362 | *parallel. 363 | * 364 | * When a sequence is used within a {@link /api/animations/group group()} or a `transition()` call, 365 | * execution continues to the next instruction only after each of the inner animation 366 | * steps have completed. 367 | * 368 | * @publicApi 369 | **/ 370 | function sequence(steps, options = null) { 371 | return { type: AnimationMetadataType.Sequence, steps, options }; 372 | } 373 | /** 374 | * Declares a key/value object containing CSS properties/styles that 375 | * can then be used for an animation [`state`](api/animations/state), within an animation 376 | *`sequence`, or as styling data for calls to `animate()` and `keyframes()`. 377 | * 378 | * @param tokens A set of CSS styles or HTML styles associated with an animation state. 379 | * The value can be any of the following: 380 | * - A key-value style pair associating a CSS property with a value. 381 | * - An array of key-value style pairs. 382 | * - An asterisk (*), to use auto-styling, where styles are derived from the element 383 | * being animated and applied to the animation when it starts. 384 | * 385 | * Auto-styling can be used to define a state that depends on layout or other 386 | * environmental factors. 387 | * 388 | * @return An object that encapsulates the style data. 389 | * 390 | * @usageNotes 391 | * The following examples create animation styles that collect a set of 392 | * CSS property values: 393 | * 394 | * ```ts 395 | * // string values for CSS properties 396 | * style({ background: "red", color: "blue" }) 397 | * 398 | * // numerical pixel values 399 | * style({ width: 100, height: 0 }) 400 | * ``` 401 | * 402 | * The following example uses auto-styling to allow an element to animate from 403 | * a height of 0 up to its full height: 404 | * 405 | * ```ts 406 | * style({ height: 0 }), 407 | * animate("1s", style({ height: "*" })) 408 | * ``` 409 | * 410 | * @publicApi 411 | **/ 412 | function style(tokens) { 413 | return { type: AnimationMetadataType.Style, styles: tokens, offset: null }; 414 | } 415 | /** 416 | * Declares an animation state within a trigger attached to an element. 417 | * 418 | * @param name One or more names for the defined state in a comma-separated string. 419 | * The following reserved state names can be supplied to define a style for specific use 420 | * cases: 421 | * 422 | * - `void` You can associate styles with this name to be used when 423 | * the element is detached from the application. For example, when an `ngIf` evaluates 424 | * to false, the state of the associated element is void. 425 | * - `*` (asterisk) Indicates the default state. You can associate styles with this name 426 | * to be used as the fallback when the state that is being animated is not declared 427 | * within the trigger. 428 | * 429 | * @param styles A set of CSS styles associated with this state, created using the 430 | * `style()` function. 431 | * This set of styles persists on the element once the state has been reached. 432 | * @param options Parameters that can be passed to the state when it is invoked. 433 | * 0 or more key-value pairs. 434 | * @return An object that encapsulates the new state data. 435 | * 436 | * @usageNotes 437 | * Use the `trigger()` function to register states to an animation trigger. 438 | * Use the `transition()` function to animate between states. 439 | * When a state is active within a component, its associated styles persist on the element, 440 | * even when the animation ends. 441 | * 442 | * @publicApi 443 | **/ 444 | function state(name, styles, options) { 445 | return { type: AnimationMetadataType.State, name, styles, options }; 446 | } 447 | /** 448 | * Defines a set of animation styles, associating each style with an optional `offset` value. 449 | * 450 | * @param steps A set of animation styles with optional offset data. 451 | * The optional `offset` value for a style specifies a percentage of the total animation 452 | * time at which that style is applied. 453 | * @returns An object that encapsulates the keyframes data. 454 | * 455 | * @usageNotes 456 | * Use with the `animate()` call. Instead of applying animations 457 | * from the current state 458 | * to the destination state, keyframes describe how each style entry is applied and at what point 459 | * within the animation arc. 460 | * Compare [CSS Keyframe Animations](https://www.w3schools.com/css/css3_animations.asp). 461 | * 462 | * ### Usage 463 | * 464 | * In the following example, the offset values describe 465 | * when each `backgroundColor` value is applied. The color is red at the start, and changes to 466 | * blue when 20% of the total time has elapsed. 467 | * 468 | * ```ts 469 | * // the provided offset values 470 | * animate("5s", keyframes([ 471 | * style({ backgroundColor: "red", offset: 0 }), 472 | * style({ backgroundColor: "blue", offset: 0.2 }), 473 | * style({ backgroundColor: "orange", offset: 0.3 }), 474 | * style({ backgroundColor: "black", offset: 1 }) 475 | * ])) 476 | * ``` 477 | * 478 | * If there are no `offset` values specified in the style entries, the offsets 479 | * are calculated automatically. 480 | * 481 | * ```ts 482 | * animate("5s", keyframes([ 483 | * style({ backgroundColor: "red" }) // offset = 0 484 | * style({ backgroundColor: "blue" }) // offset = 0.33 485 | * style({ backgroundColor: "orange" }) // offset = 0.66 486 | * style({ backgroundColor: "black" }) // offset = 1 487 | * ])) 488 | *``` 489 | 490 | * @publicApi 491 | */ 492 | function keyframes(steps) { 493 | return { type: AnimationMetadataType.Keyframes, steps }; 494 | } 495 | /** 496 | * Declares an animation transition which is played when a certain specified condition is met. 497 | * 498 | * @param stateChangeExpr A string with a specific format or a function that specifies when the 499 | * animation transition should occur (see [State Change Expression](#state-change-expression)). 500 | * 501 | * @param steps One or more animation objects that represent the animation's instructions. 502 | * 503 | * @param options An options object that can be used to specify a delay for the animation or provide 504 | * custom parameters for it. 505 | * 506 | * @returns An object that encapsulates the transition data. 507 | * 508 | * @usageNotes 509 | * 510 | * ### State Change Expression 511 | * 512 | * The State Change Expression instructs Angular when to run the transition's animations, it can 513 | *either be 514 | * - a string with a specific syntax 515 | * - or a function that compares the previous and current state (value of the expression bound to 516 | * the element's trigger) and returns `true` if the transition should occur or `false` otherwise 517 | * 518 | * The string format can be: 519 | * - `fromState => toState`, which indicates that the transition's animations should occur then the 520 | * expression bound to the trigger's element goes from `fromState` to `toState` 521 | * 522 | * _Example:_ 523 | * ```ts 524 | * transition('open => closed', animate('.5s ease-out', style({ height: 0 }) )) 525 | * ``` 526 | * 527 | * - `fromState <=> toState`, which indicates that the transition's animations should occur then 528 | * the expression bound to the trigger's element goes from `fromState` to `toState` or vice versa 529 | * 530 | * _Example:_ 531 | * ```ts 532 | * transition('enabled <=> disabled', animate('1s cubic-bezier(0.8,0.3,0,1)')) 533 | * ``` 534 | * 535 | * - `:enter`/`:leave`, which indicates that the transition's animations should occur when the 536 | * element enters or exists the DOM 537 | * 538 | * _Example:_ 539 | * ```ts 540 | * transition(':enter', [ 541 | * style({ opacity: 0 }), 542 | * animate('500ms', style({ opacity: 1 })) 543 | * ]) 544 | * ``` 545 | * 546 | * - `:increment`/`:decrement`, which indicates that the transition's animations should occur when 547 | * the numerical expression bound to the trigger's element has increased in value or decreased 548 | * 549 | * _Example:_ 550 | * ```ts 551 | * transition(':increment', query('@counter', animateChild())) 552 | * ``` 553 | * 554 | * - a sequence of any of the above divided by commas, which indicates that transition's animations 555 | * should occur whenever one of the state change expressions matches 556 | * 557 | * _Example:_ 558 | * ```ts 559 | * transition(':increment, * => enabled, :enter', animate('1s ease', keyframes([ 560 | * style({ transform: 'scale(1)', offset: 0}), 561 | * style({ transform: 'scale(1.1)', offset: 0.7}), 562 | * style({ transform: 'scale(1)', offset: 1}) 563 | * ]))), 564 | * ``` 565 | * 566 | * Also note that in such context: 567 | * - `void` can be used to indicate the absence of the element 568 | * - asterisks can be used as wildcards that match any state 569 | * - (as a consequence of the above, `void => *` is equivalent to `:enter` and `* => void` is 570 | * equivalent to `:leave`) 571 | * - `true` and `false` also match expression values of `1` and `0` respectively (but do not match 572 | * _truthy_ and _falsy_ values) 573 | * 574 | *
575 | * 576 | * Be careful about entering end leaving elements as their transitions present a common 577 | * pitfall for developers. 578 | * 579 | * Note that when an element with a trigger enters the DOM its `:enter` transition always 580 | * gets executed, but its `:leave` transition will not be executed if the element is removed 581 | * alongside its parent (as it will be removed "without warning" before its transition has 582 | * a chance to be executed, the only way that such transition can occur is if the element 583 | * is exiting the DOM on its own). 584 | * 585 | * 586 | *
587 | * 588 | * ### Animating to a Final State 589 | * 590 | * If the final step in a transition is a call to `animate()` that uses a timing value 591 | * with no `style` data, that step is automatically considered the final animation arc, 592 | * for the element to reach the final state, in such case Angular automatically adds or removes 593 | * CSS styles to ensure that the element is in the correct final state. 594 | * 595 | * 596 | * ### Usage Examples 597 | * 598 | * - Transition animations applied based on 599 | * the trigger's expression value 600 | * 601 | * ```html 602 | *
603 | * ... 604 | *
605 | * ``` 606 | * 607 | * ```ts 608 | * trigger("myAnimationTrigger", [ 609 | * ..., // states 610 | * transition("on => off, open => closed", animate(500)), 611 | * transition("* <=> error", query('.indicator', animateChild())) 612 | * ]) 613 | * ``` 614 | * 615 | * - Transition animations applied based on custom logic dependent 616 | * on the trigger's expression value and provided parameters 617 | * 618 | * ```html 619 | *
623 | * ... 624 | *
625 | * ``` 626 | * 627 | * ```ts 628 | * trigger("myAnimationTrigger", [ 629 | * ..., // states 630 | * transition( 631 | * (fromState, toState, _element, params) => 632 | * ['firststep', 'laststep'].includes(fromState.toLowerCase()) 633 | * && toState === params?.['target'], 634 | * animate('1s') 635 | * ) 636 | * ]) 637 | * ``` 638 | * 639 | * @publicApi 640 | **/ 641 | function transition(stateChangeExpr, steps, options = null) { 642 | return { type: AnimationMetadataType.Transition, expr: stateChangeExpr, animation: steps, options }; 643 | } 644 | /** 645 | * Produces a reusable animation that can be invoked in another animation or sequence, 646 | * by calling the `useAnimation()` function. 647 | * 648 | * @param steps One or more animation objects, as returned by the `animate()` 649 | * or `sequence()` function, that form a transformation from one state to another. 650 | * A sequence is used by default when you pass an array. 651 | * @param options An options object that can contain a delay value for the start of the 652 | * animation, and additional developer-defined parameters. 653 | * Provided values for additional parameters are used as defaults, 654 | * and override values can be passed to the caller on invocation. 655 | * @returns An object that encapsulates the animation data. 656 | * 657 | * @usageNotes 658 | * The following example defines a reusable animation, providing some default parameter 659 | * values. 660 | * 661 | * ```ts 662 | * var fadeAnimation = animation([ 663 | * style({ opacity: '{{ start }}' }), 664 | * animate('{{ time }}', 665 | * style({ opacity: '{{ end }}'})) 666 | * ], 667 | * { params: { time: '1000ms', start: 0, end: 1 }}); 668 | * ``` 669 | * 670 | * The following invokes the defined animation with a call to `useAnimation()`, 671 | * passing in override parameter values. 672 | * 673 | * ```js 674 | * useAnimation(fadeAnimation, { 675 | * params: { 676 | * time: '2s', 677 | * start: 1, 678 | * end: 0 679 | * } 680 | * }) 681 | * ``` 682 | * 683 | * If any of the passed-in parameter values are missing from this call, 684 | * the default values are used. If one or more parameter values are missing before a step is 685 | * animated, `useAnimation()` throws an error. 686 | * 687 | * @publicApi 688 | */ 689 | function animation(steps, options = null) { 690 | return { type: AnimationMetadataType.Reference, animation: steps, options }; 691 | } 692 | /** 693 | * Executes a queried inner animation element within an animation sequence. 694 | * 695 | * @param options An options object that can contain a delay value for the start of the 696 | * animation, and additional override values for developer-defined parameters. 697 | * @return An object that encapsulates the child animation data. 698 | * 699 | * @usageNotes 700 | * Each time an animation is triggered in Angular, the parent animation 701 | * has priority and any child animations are blocked. In order 702 | * for a child animation to run, the parent animation must query each of the elements 703 | * containing child animations, and run them using this function. 704 | * 705 | * Note that this feature is designed to be used with `query()` and it will only work 706 | * with animations that are assigned using the Angular animation library. CSS keyframes 707 | * and transitions are not handled by this API. 708 | * 709 | * @publicApi 710 | */ 711 | function animateChild(options = null) { 712 | return { type: AnimationMetadataType.AnimateChild, options }; 713 | } 714 | /** 715 | * Starts a reusable animation that is created using the `animation()` function. 716 | * 717 | * @param animation The reusable animation to start. 718 | * @param options An options object that can contain a delay value for the start of 719 | * the animation, and additional override values for developer-defined parameters. 720 | * @return An object that contains the animation parameters. 721 | * 722 | * @publicApi 723 | */ 724 | function useAnimation(animation, options = null) { 725 | return { type: AnimationMetadataType.AnimateRef, animation, options }; 726 | } 727 | /** 728 | * Finds one or more inner elements within the current element that is 729 | * being animated within a sequence. Use with `animate()`. 730 | * 731 | * @param selector The element to query, or a set of elements that contain Angular-specific 732 | * characteristics, specified with one or more of the following tokens. 733 | * - `query(":enter")` or `query(":leave")` : Query for newly inserted/removed elements (not 734 | * all elements can be queried via these tokens, see 735 | * [Entering and Leaving Elements](#entering-and-leaving-elements)) 736 | * - `query(":animating")` : Query all currently animating elements. 737 | * - `query("@triggerName")` : Query elements that contain an animation trigger. 738 | * - `query("@*")` : Query all elements that contain an animation triggers. 739 | * - `query(":self")` : Include the current element into the animation sequence. 740 | * 741 | * @param animation One or more animation steps to apply to the queried element or elements. 742 | * An array is treated as an animation sequence. 743 | * @param options An options object. Use the 'limit' field to limit the total number of 744 | * items to collect. 745 | * @return An object that encapsulates the query data. 746 | * 747 | * @usageNotes 748 | * 749 | * ### Multiple Tokens 750 | * 751 | * Tokens can be merged into a combined query selector string. For example: 752 | * 753 | * ```ts 754 | * query(':self, .record:enter, .record:leave, @subTrigger', [...]) 755 | * ``` 756 | * 757 | * The `query()` function collects multiple elements and works internally by using 758 | * `element.querySelectorAll`. Use the `limit` field of an options object to limit 759 | * the total number of items to be collected. For example: 760 | * 761 | * ```js 762 | * query('div', [ 763 | * animate(...), 764 | * animate(...) 765 | * ], { limit: 1 }) 766 | * ``` 767 | * 768 | * By default, throws an error when zero items are found. Set the 769 | * `optional` flag to ignore this error. For example: 770 | * 771 | * ```js 772 | * query('.some-element-that-may-not-be-there', [ 773 | * animate(...), 774 | * animate(...) 775 | * ], { optional: true }) 776 | * ``` 777 | * 778 | * ### Entering and Leaving Elements 779 | * 780 | * Not all elements can be queried via the `:enter` and `:leave` tokens, the only ones 781 | * that can are those that Angular assumes can enter/leave based on their own logic 782 | * (if their insertion/removal is simply a consequence of that of their parent they 783 | * should be queried via a different token in their parent's `:enter`/`:leave` transitions). 784 | * 785 | * The only elements Angular assumes can enter/leave based on their own logic (thus the only 786 | * ones that can be queried via the `:enter` and `:leave` tokens) are: 787 | * - Those inserted dynamically (via `ViewContainerRef`) 788 | * - Those that have a structural directive (which, under the hood, are a subset of the above ones) 789 | * 790 | *
791 | * 792 | * Note that elements will be successfully queried via `:enter`/`:leave` even if their 793 | * insertion/removal is not done manually via `ViewContainerRef`or caused by their structural 794 | * directive (e.g. they enter/exit alongside their parent). 795 | * 796 | *
797 | * 798 | *
799 | * 800 | * There is an exception to what previously mentioned, besides elements entering/leaving based on 801 | * their own logic, elements with an animation trigger can always be queried via `:leave` when 802 | * their parent is also leaving. 803 | * 804 | *
805 | * 806 | * ### Usage Example 807 | * 808 | * The following example queries for inner elements and animates them 809 | * individually using `animate()`. 810 | * 811 | * ```angular-ts 812 | * @Component({ 813 | * selector: 'inner', 814 | * template: ` 815 | *
816 | *

Title

817 | *
818 | * Blah blah blah 819 | *
820 | *
821 | * `, 822 | * animations: [ 823 | * trigger('queryAnimation', [ 824 | * transition('* => goAnimate', [ 825 | * // hide the inner elements 826 | * query('h1', style({ opacity: 0 })), 827 | * query('.content', style({ opacity: 0 })), 828 | * 829 | * // animate the inner elements in, one by one 830 | * query('h1', animate(1000, style({ opacity: 1 }))), 831 | * query('.content', animate(1000, style({ opacity: 1 }))), 832 | * ]) 833 | * ]) 834 | * ] 835 | * }) 836 | * class Cmp { 837 | * exp = ''; 838 | * 839 | * goAnimate() { 840 | * this.exp = 'goAnimate'; 841 | * } 842 | * } 843 | * ``` 844 | * 845 | * @publicApi 846 | */ 847 | function query(selector, animation, options = null) { 848 | return { type: AnimationMetadataType.Query, selector, animation, options }; 849 | } 850 | /** 851 | * Use within an animation `query()` call to issue a timing gap after 852 | * each queried item is animated. 853 | * 854 | * @param timings A delay value. 855 | * @param animation One ore more animation steps. 856 | * @returns An object that encapsulates the stagger data. 857 | * 858 | * @usageNotes 859 | * In the following example, a container element wraps a list of items stamped out 860 | * by an `@for` block. The container element contains an animation trigger that will later be set 861 | * to query for each of the inner items. 862 | * 863 | * Each time items are added, the opacity fade-in animation runs, 864 | * and each removed item is faded out. 865 | * When either of these animations occur, the stagger effect is 866 | * applied after each item's animation is started. 867 | * 868 | * ```html 869 | * 870 | * 871 | *
872 | *
873 | * @for(item of items; track $index) { 874 | *
{{ item }}
875 | * } 876 | *
877 | * ``` 878 | * 879 | * Here is the component code: 880 | * 881 | * ```ts 882 | * import {trigger, transition, style, animate, query, stagger} from '@angular/animations'; 883 | * @Component({ 884 | * templateUrl: 'list.component.html', 885 | * animations: [ 886 | * trigger('listAnimation', [ 887 | * ... 888 | * ]) 889 | * ] 890 | * }) 891 | * class ListComponent { 892 | * items = []; 893 | * 894 | * showItems() { 895 | * this.items = [0,1,2,3,4]; 896 | * } 897 | * 898 | * hideItems() { 899 | * this.items = []; 900 | * } 901 | * 902 | * toggle() { 903 | * this.items.length ? this.hideItems() : this.showItems(); 904 | * } 905 | * } 906 | * ``` 907 | * 908 | * Here is the animation trigger code: 909 | * 910 | * ```ts 911 | * trigger('listAnimation', [ 912 | * transition('* => *', [ // each time the binding value changes 913 | * query(':leave', [ 914 | * stagger(100, [ 915 | * animate('0.5s', style({ opacity: 0 })) 916 | * ]) 917 | * ]), 918 | * query(':enter', [ 919 | * style({ opacity: 0 }), 920 | * stagger(100, [ 921 | * animate('0.5s', style({ opacity: 1 })) 922 | * ]) 923 | * ]) 924 | * ]) 925 | * ]) 926 | * ``` 927 | * 928 | * @publicApi 929 | */ 930 | function stagger(timings, animation) { 931 | return { type: AnimationMetadataType.Stagger, timings, animation }; 932 | } 933 | 934 | /** 935 | * An empty programmatic controller for reusable animations. 936 | * Used internally when animations are disabled, to avoid 937 | * checking for the null case when an animation player is expected. 938 | * 939 | * @see {@link animate} 940 | * @see {@link AnimationPlayer} 941 | * 942 | * @publicApi 943 | */ 944 | class NoopAnimationPlayer { 945 | _onDoneFns = []; 946 | _onStartFns = []; 947 | _onDestroyFns = []; 948 | _originalOnDoneFns = []; 949 | _originalOnStartFns = []; 950 | _started = false; 951 | _destroyed = false; 952 | _finished = false; 953 | _position = 0; 954 | parentPlayer = null; 955 | totalTime; 956 | constructor(duration = 0, delay = 0) { 957 | this.totalTime = duration + delay; 958 | } 959 | _onFinish() { 960 | if (!this._finished) { 961 | this._finished = true; 962 | this._onDoneFns.forEach((fn) => fn()); 963 | this._onDoneFns = []; 964 | } 965 | } 966 | onStart(fn) { 967 | this._originalOnStartFns.push(fn); 968 | this._onStartFns.push(fn); 969 | } 970 | onDone(fn) { 971 | this._originalOnDoneFns.push(fn); 972 | this._onDoneFns.push(fn); 973 | } 974 | onDestroy(fn) { 975 | this._onDestroyFns.push(fn); 976 | } 977 | hasStarted() { 978 | return this._started; 979 | } 980 | init() { } 981 | play() { 982 | if (!this.hasStarted()) { 983 | this._onStart(); 984 | this.triggerMicrotask(); 985 | } 986 | this._started = true; 987 | } 988 | /** @internal */ 989 | triggerMicrotask() { 990 | queueMicrotask(() => this._onFinish()); 991 | } 992 | _onStart() { 993 | this._onStartFns.forEach((fn) => fn()); 994 | this._onStartFns = []; 995 | } 996 | pause() { } 997 | restart() { } 998 | finish() { 999 | this._onFinish(); 1000 | } 1001 | destroy() { 1002 | if (!this._destroyed) { 1003 | this._destroyed = true; 1004 | if (!this.hasStarted()) { 1005 | this._onStart(); 1006 | } 1007 | this.finish(); 1008 | this._onDestroyFns.forEach((fn) => fn()); 1009 | this._onDestroyFns = []; 1010 | } 1011 | } 1012 | reset() { 1013 | this._started = false; 1014 | this._finished = false; 1015 | this._onStartFns = this._originalOnStartFns; 1016 | this._onDoneFns = this._originalOnDoneFns; 1017 | } 1018 | setPosition(position) { 1019 | this._position = this.totalTime ? position * this.totalTime : 1; 1020 | } 1021 | getPosition() { 1022 | return this.totalTime ? this._position / this.totalTime : 1; 1023 | } 1024 | /** @internal */ 1025 | triggerCallback(phaseName) { 1026 | const methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns; 1027 | methods.forEach((fn) => fn()); 1028 | methods.length = 0; 1029 | } 1030 | } 1031 | 1032 | /** 1033 | * A programmatic controller for a group of reusable animations. 1034 | * Used internally to control animations. 1035 | * 1036 | * @see {@link AnimationPlayer} 1037 | * @see {@link animations/group group} 1038 | * 1039 | */ 1040 | class AnimationGroupPlayer { 1041 | _onDoneFns = []; 1042 | _onStartFns = []; 1043 | _finished = false; 1044 | _started = false; 1045 | _destroyed = false; 1046 | _onDestroyFns = []; 1047 | parentPlayer = null; 1048 | totalTime = 0; 1049 | players; 1050 | constructor(_players) { 1051 | this.players = _players; 1052 | let doneCount = 0; 1053 | let destroyCount = 0; 1054 | let startCount = 0; 1055 | const total = this.players.length; 1056 | if (total == 0) { 1057 | queueMicrotask(() => this._onFinish()); 1058 | } 1059 | else { 1060 | this.players.forEach((player) => { 1061 | player.onDone(() => { 1062 | if (++doneCount == total) { 1063 | this._onFinish(); 1064 | } 1065 | }); 1066 | player.onDestroy(() => { 1067 | if (++destroyCount == total) { 1068 | this._onDestroy(); 1069 | } 1070 | }); 1071 | player.onStart(() => { 1072 | if (++startCount == total) { 1073 | this._onStart(); 1074 | } 1075 | }); 1076 | }); 1077 | } 1078 | this.totalTime = this.players.reduce((time, player) => Math.max(time, player.totalTime), 0); 1079 | } 1080 | _onFinish() { 1081 | if (!this._finished) { 1082 | this._finished = true; 1083 | this._onDoneFns.forEach((fn) => fn()); 1084 | this._onDoneFns = []; 1085 | } 1086 | } 1087 | init() { 1088 | this.players.forEach((player) => player.init()); 1089 | } 1090 | onStart(fn) { 1091 | this._onStartFns.push(fn); 1092 | } 1093 | _onStart() { 1094 | if (!this.hasStarted()) { 1095 | this._started = true; 1096 | this._onStartFns.forEach((fn) => fn()); 1097 | this._onStartFns = []; 1098 | } 1099 | } 1100 | onDone(fn) { 1101 | this._onDoneFns.push(fn); 1102 | } 1103 | onDestroy(fn) { 1104 | this._onDestroyFns.push(fn); 1105 | } 1106 | hasStarted() { 1107 | return this._started; 1108 | } 1109 | play() { 1110 | if (!this.parentPlayer) { 1111 | this.init(); 1112 | } 1113 | this._onStart(); 1114 | this.players.forEach((player) => player.play()); 1115 | } 1116 | pause() { 1117 | this.players.forEach((player) => player.pause()); 1118 | } 1119 | restart() { 1120 | this.players.forEach((player) => player.restart()); 1121 | } 1122 | finish() { 1123 | this._onFinish(); 1124 | this.players.forEach((player) => player.finish()); 1125 | } 1126 | destroy() { 1127 | this._onDestroy(); 1128 | } 1129 | _onDestroy() { 1130 | if (!this._destroyed) { 1131 | this._destroyed = true; 1132 | this._onFinish(); 1133 | this.players.forEach((player) => player.destroy()); 1134 | this._onDestroyFns.forEach((fn) => fn()); 1135 | this._onDestroyFns = []; 1136 | } 1137 | } 1138 | reset() { 1139 | this.players.forEach((player) => player.reset()); 1140 | this._destroyed = false; 1141 | this._finished = false; 1142 | this._started = false; 1143 | } 1144 | setPosition(p) { 1145 | const timeAtPosition = p * this.totalTime; 1146 | this.players.forEach((player) => { 1147 | const position = player.totalTime ? Math.min(1, timeAtPosition / player.totalTime) : 1; 1148 | player.setPosition(position); 1149 | }); 1150 | } 1151 | getPosition() { 1152 | const longestPlayer = this.players.reduce((longestSoFar, player) => { 1153 | const newPlayerIsLongest = longestSoFar === null || player.totalTime > longestSoFar.totalTime; 1154 | return newPlayerIsLongest ? player : longestSoFar; 1155 | }, null); 1156 | return longestPlayer != null ? longestPlayer.getPosition() : 0; 1157 | } 1158 | beforeDestroy() { 1159 | this.players.forEach((player) => { 1160 | if (player.beforeDestroy) { 1161 | player.beforeDestroy(); 1162 | } 1163 | }); 1164 | } 1165 | /** @internal */ 1166 | triggerCallback(phaseName) { 1167 | const methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns; 1168 | methods.forEach((fn) => fn()); 1169 | methods.length = 0; 1170 | } 1171 | } 1172 | 1173 | const ɵPRE_STYLE = '!'; 1174 | 1175 | export { AUTO_STYLE, AnimationGroupPlayer, AnimationMetadataType, NoopAnimationPlayer, animate, animateChild, animation, group, keyframes, query, sequence, stagger, state, style, transition, trigger, useAnimation, ɵPRE_STYLE }; 1176 | //# sourceMappingURL=private_export-B_vy_9K7.mjs.map 1177 | -------------------------------------------------------------------------------- /fesm2022/util-CPU6TNml.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Angular v20.1.0-next.0+sha-21fc93b 3 | * (c) 2010-2025 Google LLC. https://angular.io/ 4 | * License: MIT 5 | */ 6 | 7 | import { AnimationGroupPlayer, NoopAnimationPlayer, AUTO_STYLE, ɵPRE_STYLE as _PRE_STYLE, AnimationMetadataType, sequence } from './private_export-B_vy_9K7.mjs'; 8 | import { ɵRuntimeError as _RuntimeError } from '@angular/core'; 9 | 10 | const LINE_START = '\n - '; 11 | function invalidTimingValue(exp) { 12 | return new _RuntimeError(3000 /* RuntimeErrorCode.INVALID_TIMING_VALUE */, ngDevMode && `The provided timing value "${exp}" is invalid.`); 13 | } 14 | function negativeStepValue() { 15 | return new _RuntimeError(3100 /* RuntimeErrorCode.NEGATIVE_STEP_VALUE */, ngDevMode && 'Duration values below 0 are not allowed for this animation step.'); 16 | } 17 | function negativeDelayValue() { 18 | return new _RuntimeError(3101 /* RuntimeErrorCode.NEGATIVE_DELAY_VALUE */, ngDevMode && 'Delay values below 0 are not allowed for this animation step.'); 19 | } 20 | function invalidStyleParams(varName) { 21 | return new _RuntimeError(3001 /* RuntimeErrorCode.INVALID_STYLE_PARAMS */, ngDevMode && 22 | `Unable to resolve the local animation param ${varName} in the given list of values`); 23 | } 24 | function invalidParamValue(varName) { 25 | return new _RuntimeError(3003 /* RuntimeErrorCode.INVALID_PARAM_VALUE */, ngDevMode && `Please provide a value for the animation param ${varName}`); 26 | } 27 | function invalidNodeType(nodeType) { 28 | return new _RuntimeError(3004 /* RuntimeErrorCode.INVALID_NODE_TYPE */, ngDevMode && `Unable to resolve animation metadata node #${nodeType}`); 29 | } 30 | function invalidCssUnitValue(userProvidedProperty, value) { 31 | return new _RuntimeError(3005 /* RuntimeErrorCode.INVALID_CSS_UNIT_VALUE */, ngDevMode && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`); 32 | } 33 | function invalidTrigger() { 34 | return new _RuntimeError(3006 /* RuntimeErrorCode.INVALID_TRIGGER */, ngDevMode && 35 | "animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"); 36 | } 37 | function invalidDefinition() { 38 | return new _RuntimeError(3007 /* RuntimeErrorCode.INVALID_DEFINITION */, ngDevMode && 'only state() and transition() definitions can sit inside of a trigger()'); 39 | } 40 | function invalidState(metadataName, missingSubs) { 41 | return new _RuntimeError(3008 /* RuntimeErrorCode.INVALID_STATE */, ngDevMode && 42 | `state("${metadataName}", ...) must define default values for all the following style substitutions: ${missingSubs.join(', ')}`); 43 | } 44 | function invalidStyleValue(value) { 45 | return new _RuntimeError(3002 /* RuntimeErrorCode.INVALID_STYLE_VALUE */, ngDevMode && `The provided style string value ${value} is not allowed.`); 46 | } 47 | function invalidParallelAnimation(prop, firstStart, firstEnd, secondStart, secondEnd) { 48 | return new _RuntimeError(3010 /* RuntimeErrorCode.INVALID_PARALLEL_ANIMATION */, ngDevMode && 49 | `The CSS property "${prop}" that exists between the times of "${firstStart}ms" and "${firstEnd}ms" is also being animated in a parallel animation between the times of "${secondStart}ms" and "${secondEnd}ms"`); 50 | } 51 | function invalidKeyframes() { 52 | return new _RuntimeError(3011 /* RuntimeErrorCode.INVALID_KEYFRAMES */, ngDevMode && `keyframes() must be placed inside of a call to animate()`); 53 | } 54 | function invalidOffset() { 55 | return new _RuntimeError(3012 /* RuntimeErrorCode.INVALID_OFFSET */, ngDevMode && `Please ensure that all keyframe offsets are between 0 and 1`); 56 | } 57 | function keyframeOffsetsOutOfOrder() { 58 | return new _RuntimeError(3200 /* RuntimeErrorCode.KEYFRAME_OFFSETS_OUT_OF_ORDER */, ngDevMode && `Please ensure that all keyframe offsets are in order`); 59 | } 60 | function keyframesMissingOffsets() { 61 | return new _RuntimeError(3202 /* RuntimeErrorCode.KEYFRAMES_MISSING_OFFSETS */, ngDevMode && `Not all style() steps within the declared keyframes() contain offsets`); 62 | } 63 | function invalidStagger() { 64 | return new _RuntimeError(3013 /* RuntimeErrorCode.INVALID_STAGGER */, ngDevMode && `stagger() can only be used inside of query()`); 65 | } 66 | function invalidQuery(selector) { 67 | return new _RuntimeError(3014 /* RuntimeErrorCode.INVALID_QUERY */, ngDevMode && 68 | `\`query("${selector}")\` returned zero elements. (Use \`query("${selector}", { optional: true })\` if you wish to allow this.)`); 69 | } 70 | function invalidExpression(expr) { 71 | return new _RuntimeError(3015 /* RuntimeErrorCode.INVALID_EXPRESSION */, ngDevMode && `The provided transition expression "${expr}" is not supported`); 72 | } 73 | function invalidTransitionAlias(alias) { 74 | return new _RuntimeError(3016 /* RuntimeErrorCode.INVALID_TRANSITION_ALIAS */, ngDevMode && `The transition alias value "${alias}" is not supported`); 75 | } 76 | function validationFailed(errors) { 77 | return new _RuntimeError(3500 /* RuntimeErrorCode.VALIDATION_FAILED */, ngDevMode && `animation validation failed:\n${errors.map((err) => err.message).join('\n')}`); 78 | } 79 | function buildingFailed(errors) { 80 | return new _RuntimeError(3501 /* RuntimeErrorCode.BUILDING_FAILED */, ngDevMode && `animation building failed:\n${errors.map((err) => err.message).join('\n')}`); 81 | } 82 | function triggerBuildFailed(name, errors) { 83 | return new _RuntimeError(3404 /* RuntimeErrorCode.TRIGGER_BUILD_FAILED */, ngDevMode && 84 | `The animation trigger "${name}" has failed to build due to the following errors:\n - ${errors 85 | .map((err) => err.message) 86 | .join('\n - ')}`); 87 | } 88 | function animationFailed(errors) { 89 | return new _RuntimeError(3502 /* RuntimeErrorCode.ANIMATION_FAILED */, ngDevMode && 90 | `Unable to animate due to the following errors:${LINE_START}${errors 91 | .map((err) => err.message) 92 | .join(LINE_START)}`); 93 | } 94 | function registerFailed(errors) { 95 | return new _RuntimeError(3503 /* RuntimeErrorCode.REGISTRATION_FAILED */, ngDevMode && 96 | `Unable to build the animation due to the following errors: ${errors 97 | .map((err) => err.message) 98 | .join('\n')}`); 99 | } 100 | function missingOrDestroyedAnimation() { 101 | return new _RuntimeError(3300 /* RuntimeErrorCode.MISSING_OR_DESTROYED_ANIMATION */, ngDevMode && "The requested animation doesn't exist or has already been destroyed"); 102 | } 103 | function createAnimationFailed(errors) { 104 | return new _RuntimeError(3504 /* RuntimeErrorCode.CREATE_ANIMATION_FAILED */, ngDevMode && 105 | `Unable to create the animation due to the following errors:${errors 106 | .map((err) => err.message) 107 | .join('\n')}`); 108 | } 109 | function missingPlayer(id) { 110 | return new _RuntimeError(3301 /* RuntimeErrorCode.MISSING_PLAYER */, ngDevMode && `Unable to find the timeline player referenced by ${id}`); 111 | } 112 | function missingTrigger(phase, name) { 113 | return new _RuntimeError(3302 /* RuntimeErrorCode.MISSING_TRIGGER */, ngDevMode && 114 | `Unable to listen on the animation trigger event "${phase}" because the animation trigger "${name}" doesn\'t exist!`); 115 | } 116 | function missingEvent(name) { 117 | return new _RuntimeError(3303 /* RuntimeErrorCode.MISSING_EVENT */, ngDevMode && 118 | `Unable to listen on the animation trigger "${name}" because the provided event is undefined!`); 119 | } 120 | function unsupportedTriggerEvent(phase, name) { 121 | return new _RuntimeError(3400 /* RuntimeErrorCode.UNSUPPORTED_TRIGGER_EVENT */, ngDevMode && 122 | `The provided animation trigger event "${phase}" for the animation trigger "${name}" is not supported!`); 123 | } 124 | function unregisteredTrigger(name) { 125 | return new _RuntimeError(3401 /* RuntimeErrorCode.UNREGISTERED_TRIGGER */, ngDevMode && `The provided animation trigger "${name}" has not been registered!`); 126 | } 127 | function triggerTransitionsFailed(errors) { 128 | return new _RuntimeError(3402 /* RuntimeErrorCode.TRIGGER_TRANSITIONS_FAILED */, ngDevMode && 129 | `Unable to process animations due to the following failed trigger transitions\n ${errors 130 | .map((err) => err.message) 131 | .join('\n')}`); 132 | } 133 | function transitionFailed(name, errors) { 134 | return new _RuntimeError(3505 /* RuntimeErrorCode.TRANSITION_FAILED */, ngDevMode && `@${name} has failed due to:\n ${errors.map((err) => err.message).join('\n- ')}`); 135 | } 136 | 137 | /** 138 | * Set of all animatable CSS properties 139 | * 140 | * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties 141 | */ 142 | const ANIMATABLE_PROP_SET = new Set([ 143 | '-moz-outline-radius', 144 | '-moz-outline-radius-bottomleft', 145 | '-moz-outline-radius-bottomright', 146 | '-moz-outline-radius-topleft', 147 | '-moz-outline-radius-topright', 148 | '-ms-grid-columns', 149 | '-ms-grid-rows', 150 | '-webkit-line-clamp', 151 | '-webkit-text-fill-color', 152 | '-webkit-text-stroke', 153 | '-webkit-text-stroke-color', 154 | 'accent-color', 155 | 'all', 156 | 'backdrop-filter', 157 | 'background', 158 | 'background-color', 159 | 'background-position', 160 | 'background-size', 161 | 'block-size', 162 | 'border', 163 | 'border-block-end', 164 | 'border-block-end-color', 165 | 'border-block-end-width', 166 | 'border-block-start', 167 | 'border-block-start-color', 168 | 'border-block-start-width', 169 | 'border-bottom', 170 | 'border-bottom-color', 171 | 'border-bottom-left-radius', 172 | 'border-bottom-right-radius', 173 | 'border-bottom-width', 174 | 'border-color', 175 | 'border-end-end-radius', 176 | 'border-end-start-radius', 177 | 'border-image-outset', 178 | 'border-image-slice', 179 | 'border-image-width', 180 | 'border-inline-end', 181 | 'border-inline-end-color', 182 | 'border-inline-end-width', 183 | 'border-inline-start', 184 | 'border-inline-start-color', 185 | 'border-inline-start-width', 186 | 'border-left', 187 | 'border-left-color', 188 | 'border-left-width', 189 | 'border-radius', 190 | 'border-right', 191 | 'border-right-color', 192 | 'border-right-width', 193 | 'border-start-end-radius', 194 | 'border-start-start-radius', 195 | 'border-top', 196 | 'border-top-color', 197 | 'border-top-left-radius', 198 | 'border-top-right-radius', 199 | 'border-top-width', 200 | 'border-width', 201 | 'bottom', 202 | 'box-shadow', 203 | 'caret-color', 204 | 'clip', 205 | 'clip-path', 206 | 'color', 207 | 'column-count', 208 | 'column-gap', 209 | 'column-rule', 210 | 'column-rule-color', 211 | 'column-rule-width', 212 | 'column-width', 213 | 'columns', 214 | 'filter', 215 | 'flex', 216 | 'flex-basis', 217 | 'flex-grow', 218 | 'flex-shrink', 219 | 'font', 220 | 'font-size', 221 | 'font-size-adjust', 222 | 'font-stretch', 223 | 'font-variation-settings', 224 | 'font-weight', 225 | 'gap', 226 | 'grid-column-gap', 227 | 'grid-gap', 228 | 'grid-row-gap', 229 | 'grid-template-columns', 230 | 'grid-template-rows', 231 | 'height', 232 | 'inline-size', 233 | 'input-security', 234 | 'inset', 235 | 'inset-block', 236 | 'inset-block-end', 237 | 'inset-block-start', 238 | 'inset-inline', 239 | 'inset-inline-end', 240 | 'inset-inline-start', 241 | 'left', 242 | 'letter-spacing', 243 | 'line-clamp', 244 | 'line-height', 245 | 'margin', 246 | 'margin-block-end', 247 | 'margin-block-start', 248 | 'margin-bottom', 249 | 'margin-inline-end', 250 | 'margin-inline-start', 251 | 'margin-left', 252 | 'margin-right', 253 | 'margin-top', 254 | 'mask', 255 | 'mask-border', 256 | 'mask-position', 257 | 'mask-size', 258 | 'max-block-size', 259 | 'max-height', 260 | 'max-inline-size', 261 | 'max-lines', 262 | 'max-width', 263 | 'min-block-size', 264 | 'min-height', 265 | 'min-inline-size', 266 | 'min-width', 267 | 'object-position', 268 | 'offset', 269 | 'offset-anchor', 270 | 'offset-distance', 271 | 'offset-path', 272 | 'offset-position', 273 | 'offset-rotate', 274 | 'opacity', 275 | 'order', 276 | 'outline', 277 | 'outline-color', 278 | 'outline-offset', 279 | 'outline-width', 280 | 'padding', 281 | 'padding-block-end', 282 | 'padding-block-start', 283 | 'padding-bottom', 284 | 'padding-inline-end', 285 | 'padding-inline-start', 286 | 'padding-left', 287 | 'padding-right', 288 | 'padding-top', 289 | 'perspective', 290 | 'perspective-origin', 291 | 'right', 292 | 'rotate', 293 | 'row-gap', 294 | 'scale', 295 | 'scroll-margin', 296 | 'scroll-margin-block', 297 | 'scroll-margin-block-end', 298 | 'scroll-margin-block-start', 299 | 'scroll-margin-bottom', 300 | 'scroll-margin-inline', 301 | 'scroll-margin-inline-end', 302 | 'scroll-margin-inline-start', 303 | 'scroll-margin-left', 304 | 'scroll-margin-right', 305 | 'scroll-margin-top', 306 | 'scroll-padding', 307 | 'scroll-padding-block', 308 | 'scroll-padding-block-end', 309 | 'scroll-padding-block-start', 310 | 'scroll-padding-bottom', 311 | 'scroll-padding-inline', 312 | 'scroll-padding-inline-end', 313 | 'scroll-padding-inline-start', 314 | 'scroll-padding-left', 315 | 'scroll-padding-right', 316 | 'scroll-padding-top', 317 | 'scroll-snap-coordinate', 318 | 'scroll-snap-destination', 319 | 'scrollbar-color', 320 | 'shape-image-threshold', 321 | 'shape-margin', 322 | 'shape-outside', 323 | 'tab-size', 324 | 'text-decoration', 325 | 'text-decoration-color', 326 | 'text-decoration-thickness', 327 | 'text-emphasis', 328 | 'text-emphasis-color', 329 | 'text-indent', 330 | 'text-shadow', 331 | 'text-underline-offset', 332 | 'top', 333 | 'transform', 334 | 'transform-origin', 335 | 'translate', 336 | 'vertical-align', 337 | 'visibility', 338 | 'width', 339 | 'word-spacing', 340 | 'z-index', 341 | 'zoom', 342 | ]); 343 | 344 | function optimizeGroupPlayer(players) { 345 | switch (players.length) { 346 | case 0: 347 | return new NoopAnimationPlayer(); 348 | case 1: 349 | return players[0]; 350 | default: 351 | return new AnimationGroupPlayer(players); 352 | } 353 | } 354 | function normalizeKeyframes$1(normalizer, keyframes, preStyles = new Map(), postStyles = new Map()) { 355 | const errors = []; 356 | const normalizedKeyframes = []; 357 | let previousOffset = -1; 358 | let previousKeyframe = null; 359 | keyframes.forEach((kf) => { 360 | const offset = kf.get('offset'); 361 | const isSameOffset = offset == previousOffset; 362 | const normalizedKeyframe = (isSameOffset && previousKeyframe) || new Map(); 363 | kf.forEach((val, prop) => { 364 | let normalizedProp = prop; 365 | let normalizedValue = val; 366 | if (prop !== 'offset') { 367 | normalizedProp = normalizer.normalizePropertyName(normalizedProp, errors); 368 | switch (normalizedValue) { 369 | case _PRE_STYLE: 370 | normalizedValue = preStyles.get(prop); 371 | break; 372 | case AUTO_STYLE: 373 | normalizedValue = postStyles.get(prop); 374 | break; 375 | default: 376 | normalizedValue = normalizer.normalizeStyleValue(prop, normalizedProp, normalizedValue, errors); 377 | break; 378 | } 379 | } 380 | normalizedKeyframe.set(normalizedProp, normalizedValue); 381 | }); 382 | if (!isSameOffset) { 383 | normalizedKeyframes.push(normalizedKeyframe); 384 | } 385 | previousKeyframe = normalizedKeyframe; 386 | previousOffset = offset; 387 | }); 388 | if (errors.length) { 389 | throw animationFailed(errors); 390 | } 391 | return normalizedKeyframes; 392 | } 393 | function listenOnPlayer(player, eventName, event, callback) { 394 | switch (eventName) { 395 | case 'start': 396 | player.onStart(() => callback(event && copyAnimationEvent(event, 'start', player))); 397 | break; 398 | case 'done': 399 | player.onDone(() => callback(event && copyAnimationEvent(event, 'done', player))); 400 | break; 401 | case 'destroy': 402 | player.onDestroy(() => callback(event && copyAnimationEvent(event, 'destroy', player))); 403 | break; 404 | } 405 | } 406 | function copyAnimationEvent(e, phaseName, player) { 407 | const totalTime = player.totalTime; 408 | const disabled = player.disabled ? true : false; 409 | const event = makeAnimationEvent(e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName, totalTime == undefined ? e.totalTime : totalTime, disabled); 410 | const data = e['_data']; 411 | if (data != null) { 412 | event['_data'] = data; 413 | } 414 | return event; 415 | } 416 | function makeAnimationEvent(element, triggerName, fromState, toState, phaseName = '', totalTime = 0, disabled) { 417 | return { element, triggerName, fromState, toState, phaseName, totalTime, disabled: !!disabled }; 418 | } 419 | function getOrSetDefaultValue(map, key, defaultValue) { 420 | let value = map.get(key); 421 | if (!value) { 422 | map.set(key, (value = defaultValue)); 423 | } 424 | return value; 425 | } 426 | function parseTimelineCommand(command) { 427 | const separatorPos = command.indexOf(':'); 428 | const id = command.substring(1, separatorPos); 429 | const action = command.slice(separatorPos + 1); 430 | return [id, action]; 431 | } 432 | const documentElement = /* @__PURE__ */ (() => typeof document === 'undefined' ? null : document.documentElement)(); 433 | function getParentElement(element) { 434 | const parent = element.parentNode || element.host || null; // consider host to support shadow DOM 435 | if (parent === documentElement) { 436 | return null; 437 | } 438 | return parent; 439 | } 440 | function containsVendorPrefix(prop) { 441 | // Webkit is the only real popular vendor prefix nowadays 442 | // cc: http://shouldiprefix.com/ 443 | return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit 444 | } 445 | let _CACHED_BODY = null; 446 | let _IS_WEBKIT = false; 447 | function validateStyleProperty(prop) { 448 | if (!_CACHED_BODY) { 449 | _CACHED_BODY = getBodyNode() || {}; 450 | _IS_WEBKIT = _CACHED_BODY.style ? 'WebkitAppearance' in _CACHED_BODY.style : false; 451 | } 452 | let result = true; 453 | if (_CACHED_BODY.style && !containsVendorPrefix(prop)) { 454 | result = prop in _CACHED_BODY.style; 455 | if (!result && _IS_WEBKIT) { 456 | const camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.slice(1); 457 | result = camelProp in _CACHED_BODY.style; 458 | } 459 | } 460 | return result; 461 | } 462 | function validateWebAnimatableStyleProperty(prop) { 463 | return ANIMATABLE_PROP_SET.has(prop); 464 | } 465 | function getBodyNode() { 466 | if (typeof document != 'undefined') { 467 | return document.body; 468 | } 469 | return null; 470 | } 471 | function containsElement(elm1, elm2) { 472 | while (elm2) { 473 | if (elm2 === elm1) { 474 | return true; 475 | } 476 | elm2 = getParentElement(elm2); 477 | } 478 | return false; 479 | } 480 | function invokeQuery(element, selector, multi) { 481 | if (multi) { 482 | return Array.from(element.querySelectorAll(selector)); 483 | } 484 | const elem = element.querySelector(selector); 485 | return elem ? [elem] : []; 486 | } 487 | 488 | const ONE_SECOND = 1000; 489 | const SUBSTITUTION_EXPR_START = '{{'; 490 | const SUBSTITUTION_EXPR_END = '}}'; 491 | const ENTER_CLASSNAME = 'ng-enter'; 492 | const LEAVE_CLASSNAME = 'ng-leave'; 493 | const NG_TRIGGER_CLASSNAME = 'ng-trigger'; 494 | const NG_TRIGGER_SELECTOR = '.ng-trigger'; 495 | const NG_ANIMATING_CLASSNAME = 'ng-animating'; 496 | const NG_ANIMATING_SELECTOR = '.ng-animating'; 497 | function resolveTimingValue(value) { 498 | if (typeof value == 'number') 499 | return value; 500 | const matches = value.match(/^(-?[\.\d]+)(m?s)/); 501 | if (!matches || matches.length < 2) 502 | return 0; 503 | return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]); 504 | } 505 | function _convertTimeValueToMS(value, unit) { 506 | switch (unit) { 507 | case 's': 508 | return value * ONE_SECOND; 509 | default: // ms or something else 510 | return value; 511 | } 512 | } 513 | function resolveTiming(timings, errors, allowNegativeValues) { 514 | return timings.hasOwnProperty('duration') 515 | ? timings 516 | : parseTimeExpression(timings, errors, allowNegativeValues); 517 | } 518 | function parseTimeExpression(exp, errors, allowNegativeValues) { 519 | const regex = /^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i; 520 | let duration; 521 | let delay = 0; 522 | let easing = ''; 523 | if (typeof exp === 'string') { 524 | const matches = exp.match(regex); 525 | if (matches === null) { 526 | errors.push(invalidTimingValue(exp)); 527 | return { duration: 0, delay: 0, easing: '' }; 528 | } 529 | duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]); 530 | const delayMatch = matches[3]; 531 | if (delayMatch != null) { 532 | delay = _convertTimeValueToMS(parseFloat(delayMatch), matches[4]); 533 | } 534 | const easingVal = matches[5]; 535 | if (easingVal) { 536 | easing = easingVal; 537 | } 538 | } 539 | else { 540 | duration = exp; 541 | } 542 | if (!allowNegativeValues) { 543 | let containsErrors = false; 544 | let startIndex = errors.length; 545 | if (duration < 0) { 546 | errors.push(negativeStepValue()); 547 | containsErrors = true; 548 | } 549 | if (delay < 0) { 550 | errors.push(negativeDelayValue()); 551 | containsErrors = true; 552 | } 553 | if (containsErrors) { 554 | errors.splice(startIndex, 0, invalidTimingValue(exp)); 555 | } 556 | } 557 | return { duration, delay, easing }; 558 | } 559 | function normalizeKeyframes(keyframes) { 560 | if (!keyframes.length) { 561 | return []; 562 | } 563 | if (keyframes[0] instanceof Map) { 564 | return keyframes; 565 | } 566 | return keyframes.map((kf) => new Map(Object.entries(kf))); 567 | } 568 | function normalizeStyles(styles) { 569 | return Array.isArray(styles) ? new Map(...styles) : new Map(styles); 570 | } 571 | function setStyles(element, styles, formerStyles) { 572 | styles.forEach((val, prop) => { 573 | const camelProp = dashCaseToCamelCase(prop); 574 | if (formerStyles && !formerStyles.has(prop)) { 575 | formerStyles.set(prop, element.style[camelProp]); 576 | } 577 | element.style[camelProp] = val; 578 | }); 579 | } 580 | function eraseStyles(element, styles) { 581 | styles.forEach((_, prop) => { 582 | const camelProp = dashCaseToCamelCase(prop); 583 | element.style[camelProp] = ''; 584 | }); 585 | } 586 | function normalizeAnimationEntry(steps) { 587 | if (Array.isArray(steps)) { 588 | if (steps.length == 1) 589 | return steps[0]; 590 | return sequence(steps); 591 | } 592 | return steps; 593 | } 594 | function validateStyleParams(value, options, errors) { 595 | const params = options.params || {}; 596 | const matches = extractStyleParams(value); 597 | if (matches.length) { 598 | matches.forEach((varName) => { 599 | if (!params.hasOwnProperty(varName)) { 600 | errors.push(invalidStyleParams(varName)); 601 | } 602 | }); 603 | } 604 | } 605 | const PARAM_REGEX = /* @__PURE__ */ new RegExp(`${SUBSTITUTION_EXPR_START}\\s*(.+?)\\s*${SUBSTITUTION_EXPR_END}`, 'g'); 606 | function extractStyleParams(value) { 607 | let params = []; 608 | if (typeof value === 'string') { 609 | let match; 610 | while ((match = PARAM_REGEX.exec(value))) { 611 | params.push(match[1]); 612 | } 613 | PARAM_REGEX.lastIndex = 0; 614 | } 615 | return params; 616 | } 617 | function interpolateParams(value, params, errors) { 618 | const original = `${value}`; 619 | const str = original.replace(PARAM_REGEX, (_, varName) => { 620 | let localVal = params[varName]; 621 | // this means that the value was never overridden by the data passed in by the user 622 | if (localVal == null) { 623 | errors.push(invalidParamValue(varName)); 624 | localVal = ''; 625 | } 626 | return localVal.toString(); 627 | }); 628 | // we do this to assert that numeric values stay as they are 629 | return str == original ? value : str; 630 | } 631 | const DASH_CASE_REGEXP = /-+([a-z0-9])/g; 632 | function dashCaseToCamelCase(input) { 633 | return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase()); 634 | } 635 | function camelCaseToDashCase(input) { 636 | return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); 637 | } 638 | function allowPreviousPlayerStylesMerge(duration, delay) { 639 | return duration === 0 || delay === 0; 640 | } 641 | function balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles) { 642 | if (previousStyles.size && keyframes.length) { 643 | let startingKeyframe = keyframes[0]; 644 | let missingStyleProps = []; 645 | previousStyles.forEach((val, prop) => { 646 | if (!startingKeyframe.has(prop)) { 647 | missingStyleProps.push(prop); 648 | } 649 | startingKeyframe.set(prop, val); 650 | }); 651 | if (missingStyleProps.length) { 652 | for (let i = 1; i < keyframes.length; i++) { 653 | let kf = keyframes[i]; 654 | missingStyleProps.forEach((prop) => kf.set(prop, computeStyle(element, prop))); 655 | } 656 | } 657 | } 658 | return keyframes; 659 | } 660 | function visitDslNode(visitor, node, context) { 661 | switch (node.type) { 662 | case AnimationMetadataType.Trigger: 663 | return visitor.visitTrigger(node, context); 664 | case AnimationMetadataType.State: 665 | return visitor.visitState(node, context); 666 | case AnimationMetadataType.Transition: 667 | return visitor.visitTransition(node, context); 668 | case AnimationMetadataType.Sequence: 669 | return visitor.visitSequence(node, context); 670 | case AnimationMetadataType.Group: 671 | return visitor.visitGroup(node, context); 672 | case AnimationMetadataType.Animate: 673 | return visitor.visitAnimate(node, context); 674 | case AnimationMetadataType.Keyframes: 675 | return visitor.visitKeyframes(node, context); 676 | case AnimationMetadataType.Style: 677 | return visitor.visitStyle(node, context); 678 | case AnimationMetadataType.Reference: 679 | return visitor.visitReference(node, context); 680 | case AnimationMetadataType.AnimateChild: 681 | return visitor.visitAnimateChild(node, context); 682 | case AnimationMetadataType.AnimateRef: 683 | return visitor.visitAnimateRef(node, context); 684 | case AnimationMetadataType.Query: 685 | return visitor.visitQuery(node, context); 686 | case AnimationMetadataType.Stagger: 687 | return visitor.visitStagger(node, context); 688 | default: 689 | throw invalidNodeType(node.type); 690 | } 691 | } 692 | function computeStyle(element, prop) { 693 | return window.getComputedStyle(element)[prop]; 694 | } 695 | 696 | export { ENTER_CLASSNAME, LEAVE_CLASSNAME, NG_ANIMATING_CLASSNAME, NG_ANIMATING_SELECTOR, NG_TRIGGER_CLASSNAME, NG_TRIGGER_SELECTOR, SUBSTITUTION_EXPR_START, allowPreviousPlayerStylesMerge, balancePreviousStylesIntoKeyframes, buildingFailed, camelCaseToDashCase, computeStyle, containsElement, createAnimationFailed, dashCaseToCamelCase, eraseStyles, extractStyleParams, getOrSetDefaultValue, getParentElement, interpolateParams, invalidCssUnitValue, invalidDefinition, invalidExpression, invalidKeyframes, invalidOffset, invalidParallelAnimation, invalidQuery, invalidStagger, invalidState, invalidStyleValue, invalidTransitionAlias, invalidTrigger, invokeQuery, keyframeOffsetsOutOfOrder, keyframesMissingOffsets, listenOnPlayer, makeAnimationEvent, missingEvent, missingOrDestroyedAnimation, missingPlayer, missingTrigger, normalizeAnimationEntry, normalizeKeyframes$1 as normalizeKeyframes, normalizeKeyframes as normalizeKeyframes$1, normalizeStyles, optimizeGroupPlayer, parseTimelineCommand, registerFailed, resolveTiming, resolveTimingValue, setStyles, transitionFailed, triggerBuildFailed, triggerTransitionsFailed, unregisteredTrigger, unsupportedTriggerEvent, validateStyleParams, validateStyleProperty, validateWebAnimatableStyleProperty, validationFailed, visitDslNode }; 697 | //# sourceMappingURL=util-CPU6TNml.mjs.map 698 | -------------------------------------------------------------------------------- /fesm2022/util-CPU6TNml.mjs.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"util-CPU6TNml.mjs","sources":["../../../../../k8-fastbuild-ST-46c76129e412/bin/packages/animations/browser/src/error_helpers.ts","../../../../../k8-fastbuild-ST-46c76129e412/bin/packages/animations/browser/src/render/web_animations/animatable_props_set.ts","../../../../../k8-fastbuild-ST-46c76129e412/bin/packages/animations/browser/src/render/shared.ts","../../../../../k8-fastbuild-ST-46c76129e412/bin/packages/animations/browser/src/util.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {RuntimeErrorCode} from '../../src/errors';\nimport {ɵRuntimeError as RuntimeError} from '@angular/core';\n\nconst LINE_START = '\\n - ';\n\nexport function invalidTimingValue(exp: string | number): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_TIMING_VALUE,\n ngDevMode && `The provided timing value \"${exp}\" is invalid.`,\n );\n}\n\nexport function negativeStepValue(): Error {\n return new RuntimeError(\n RuntimeErrorCode.NEGATIVE_STEP_VALUE,\n ngDevMode && 'Duration values below 0 are not allowed for this animation step.',\n );\n}\n\nexport function negativeDelayValue(): Error {\n return new RuntimeError(\n RuntimeErrorCode.NEGATIVE_DELAY_VALUE,\n ngDevMode && 'Delay values below 0 are not allowed for this animation step.',\n );\n}\n\nexport function invalidStyleParams(varName: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_STYLE_PARAMS,\n ngDevMode &&\n `Unable to resolve the local animation param ${varName} in the given list of values`,\n );\n}\n\nexport function invalidParamValue(varName: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_PARAM_VALUE,\n ngDevMode && `Please provide a value for the animation param ${varName}`,\n );\n}\n\nexport function invalidNodeType(nodeType: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_NODE_TYPE,\n ngDevMode && `Unable to resolve animation metadata node #${nodeType}`,\n );\n}\n\nexport function invalidCssUnitValue(userProvidedProperty: string, value: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_CSS_UNIT_VALUE,\n ngDevMode && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`,\n );\n}\n\nexport function invalidTrigger(): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_TRIGGER,\n ngDevMode &&\n \"animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))\",\n );\n}\n\nexport function invalidDefinition(): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_DEFINITION,\n ngDevMode && 'only state() and transition() definitions can sit inside of a trigger()',\n );\n}\n\nexport function invalidState(metadataName: string, missingSubs: string[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_STATE,\n ngDevMode &&\n `state(\"${metadataName}\", ...) must define default values for all the following style substitutions: ${missingSubs.join(\n ', ',\n )}`,\n );\n}\n\nexport function invalidStyleValue(value: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_STYLE_VALUE,\n ngDevMode && `The provided style string value ${value} is not allowed.`,\n );\n}\n\nexport function invalidProperty(prop: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_PROPERTY,\n ngDevMode &&\n `The provided animation property \"${prop}\" is not a supported CSS property for animations`,\n );\n}\n\nexport function invalidParallelAnimation(\n prop: string,\n firstStart: number,\n firstEnd: number,\n secondStart: number,\n secondEnd: number,\n): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_PARALLEL_ANIMATION,\n ngDevMode &&\n `The CSS property \"${prop}\" that exists between the times of \"${firstStart}ms\" and \"${firstEnd}ms\" is also being animated in a parallel animation between the times of \"${secondStart}ms\" and \"${secondEnd}ms\"`,\n );\n}\n\nexport function invalidKeyframes(): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_KEYFRAMES,\n ngDevMode && `keyframes() must be placed inside of a call to animate()`,\n );\n}\n\nexport function invalidOffset(): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_OFFSET,\n ngDevMode && `Please ensure that all keyframe offsets are between 0 and 1`,\n );\n}\n\nexport function keyframeOffsetsOutOfOrder(): Error {\n return new RuntimeError(\n RuntimeErrorCode.KEYFRAME_OFFSETS_OUT_OF_ORDER,\n ngDevMode && `Please ensure that all keyframe offsets are in order`,\n );\n}\n\nexport function keyframesMissingOffsets(): Error {\n return new RuntimeError(\n RuntimeErrorCode.KEYFRAMES_MISSING_OFFSETS,\n ngDevMode && `Not all style() steps within the declared keyframes() contain offsets`,\n );\n}\n\nexport function invalidStagger(): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_STAGGER,\n ngDevMode && `stagger() can only be used inside of query()`,\n );\n}\n\nexport function invalidQuery(selector: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_QUERY,\n ngDevMode &&\n `\\`query(\"${selector}\")\\` returned zero elements. (Use \\`query(\"${selector}\", { optional: true })\\` if you wish to allow this.)`,\n );\n}\n\nexport function invalidExpression(expr: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_EXPRESSION,\n ngDevMode && `The provided transition expression \"${expr}\" is not supported`,\n );\n}\n\nexport function invalidTransitionAlias(alias: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.INVALID_TRANSITION_ALIAS,\n ngDevMode && `The transition alias value \"${alias}\" is not supported`,\n );\n}\n\nexport function validationFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.VALIDATION_FAILED,\n ngDevMode && `animation validation failed:\\n${errors.map((err) => err.message).join('\\n')}`,\n );\n}\n\nexport function buildingFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.BUILDING_FAILED,\n ngDevMode && `animation building failed:\\n${errors.map((err) => err.message).join('\\n')}`,\n );\n}\n\nexport function triggerBuildFailed(name: string, errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.TRIGGER_BUILD_FAILED,\n ngDevMode &&\n `The animation trigger \"${name}\" has failed to build due to the following errors:\\n - ${errors\n .map((err) => err.message)\n .join('\\n - ')}`,\n );\n}\n\nexport function animationFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.ANIMATION_FAILED,\n ngDevMode &&\n `Unable to animate due to the following errors:${LINE_START}${errors\n .map((err) => err.message)\n .join(LINE_START)}`,\n );\n}\n\nexport function registerFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.REGISTRATION_FAILED,\n ngDevMode &&\n `Unable to build the animation due to the following errors: ${errors\n .map((err) => err.message)\n .join('\\n')}`,\n );\n}\n\nexport function missingOrDestroyedAnimation(): Error {\n return new RuntimeError(\n RuntimeErrorCode.MISSING_OR_DESTROYED_ANIMATION,\n ngDevMode && \"The requested animation doesn't exist or has already been destroyed\",\n );\n}\n\nexport function createAnimationFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.CREATE_ANIMATION_FAILED,\n ngDevMode &&\n `Unable to create the animation due to the following errors:${errors\n .map((err) => err.message)\n .join('\\n')}`,\n );\n}\n\nexport function missingPlayer(id: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.MISSING_PLAYER,\n ngDevMode && `Unable to find the timeline player referenced by ${id}`,\n );\n}\n\nexport function missingTrigger(phase: string, name: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.MISSING_TRIGGER,\n ngDevMode &&\n `Unable to listen on the animation trigger event \"${phase}\" because the animation trigger \"${name}\" doesn\\'t exist!`,\n );\n}\n\nexport function missingEvent(name: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.MISSING_EVENT,\n ngDevMode &&\n `Unable to listen on the animation trigger \"${name}\" because the provided event is undefined!`,\n );\n}\n\nexport function unsupportedTriggerEvent(phase: string, name: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.UNSUPPORTED_TRIGGER_EVENT,\n ngDevMode &&\n `The provided animation trigger event \"${phase}\" for the animation trigger \"${name}\" is not supported!`,\n );\n}\n\nexport function unregisteredTrigger(name: string): Error {\n return new RuntimeError(\n RuntimeErrorCode.UNREGISTERED_TRIGGER,\n ngDevMode && `The provided animation trigger \"${name}\" has not been registered!`,\n );\n}\n\nexport function triggerTransitionsFailed(errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.TRIGGER_TRANSITIONS_FAILED,\n ngDevMode &&\n `Unable to process animations due to the following failed trigger transitions\\n ${errors\n .map((err) => err.message)\n .join('\\n')}`,\n );\n}\n\nexport function triggerParsingFailed(name: string, errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.TRIGGER_PARSING_FAILED,\n ngDevMode &&\n `Animation parsing for the ${name} trigger have failed:${LINE_START}${errors\n .map((err) => err.message)\n .join(LINE_START)}`,\n );\n}\n\nexport function transitionFailed(name: string, errors: Error[]): Error {\n return new RuntimeError(\n RuntimeErrorCode.TRANSITION_FAILED,\n ngDevMode && `@${name} has failed due to:\\n ${errors.map((err) => err.message).join('\\n- ')}`,\n );\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * Set of all animatable CSS properties\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties\n */\nexport const ANIMATABLE_PROP_SET = new Set([\n '-moz-outline-radius',\n '-moz-outline-radius-bottomleft',\n '-moz-outline-radius-bottomright',\n '-moz-outline-radius-topleft',\n '-moz-outline-radius-topright',\n '-ms-grid-columns',\n '-ms-grid-rows',\n '-webkit-line-clamp',\n '-webkit-text-fill-color',\n '-webkit-text-stroke',\n '-webkit-text-stroke-color',\n 'accent-color',\n 'all',\n 'backdrop-filter',\n 'background',\n 'background-color',\n 'background-position',\n 'background-size',\n 'block-size',\n 'border',\n 'border-block-end',\n 'border-block-end-color',\n 'border-block-end-width',\n 'border-block-start',\n 'border-block-start-color',\n 'border-block-start-width',\n 'border-bottom',\n 'border-bottom-color',\n 'border-bottom-left-radius',\n 'border-bottom-right-radius',\n 'border-bottom-width',\n 'border-color',\n 'border-end-end-radius',\n 'border-end-start-radius',\n 'border-image-outset',\n 'border-image-slice',\n 'border-image-width',\n 'border-inline-end',\n 'border-inline-end-color',\n 'border-inline-end-width',\n 'border-inline-start',\n 'border-inline-start-color',\n 'border-inline-start-width',\n 'border-left',\n 'border-left-color',\n 'border-left-width',\n 'border-radius',\n 'border-right',\n 'border-right-color',\n 'border-right-width',\n 'border-start-end-radius',\n 'border-start-start-radius',\n 'border-top',\n 'border-top-color',\n 'border-top-left-radius',\n 'border-top-right-radius',\n 'border-top-width',\n 'border-width',\n 'bottom',\n 'box-shadow',\n 'caret-color',\n 'clip',\n 'clip-path',\n 'color',\n 'column-count',\n 'column-gap',\n 'column-rule',\n 'column-rule-color',\n 'column-rule-width',\n 'column-width',\n 'columns',\n 'filter',\n 'flex',\n 'flex-basis',\n 'flex-grow',\n 'flex-shrink',\n 'font',\n 'font-size',\n 'font-size-adjust',\n 'font-stretch',\n 'font-variation-settings',\n 'font-weight',\n 'gap',\n 'grid-column-gap',\n 'grid-gap',\n 'grid-row-gap',\n 'grid-template-columns',\n 'grid-template-rows',\n 'height',\n 'inline-size',\n 'input-security',\n 'inset',\n 'inset-block',\n 'inset-block-end',\n 'inset-block-start',\n 'inset-inline',\n 'inset-inline-end',\n 'inset-inline-start',\n 'left',\n 'letter-spacing',\n 'line-clamp',\n 'line-height',\n 'margin',\n 'margin-block-end',\n 'margin-block-start',\n 'margin-bottom',\n 'margin-inline-end',\n 'margin-inline-start',\n 'margin-left',\n 'margin-right',\n 'margin-top',\n 'mask',\n 'mask-border',\n 'mask-position',\n 'mask-size',\n 'max-block-size',\n 'max-height',\n 'max-inline-size',\n 'max-lines',\n 'max-width',\n 'min-block-size',\n 'min-height',\n 'min-inline-size',\n 'min-width',\n 'object-position',\n 'offset',\n 'offset-anchor',\n 'offset-distance',\n 'offset-path',\n 'offset-position',\n 'offset-rotate',\n 'opacity',\n 'order',\n 'outline',\n 'outline-color',\n 'outline-offset',\n 'outline-width',\n 'padding',\n 'padding-block-end',\n 'padding-block-start',\n 'padding-bottom',\n 'padding-inline-end',\n 'padding-inline-start',\n 'padding-left',\n 'padding-right',\n 'padding-top',\n 'perspective',\n 'perspective-origin',\n 'right',\n 'rotate',\n 'row-gap',\n 'scale',\n 'scroll-margin',\n 'scroll-margin-block',\n 'scroll-margin-block-end',\n 'scroll-margin-block-start',\n 'scroll-margin-bottom',\n 'scroll-margin-inline',\n 'scroll-margin-inline-end',\n 'scroll-margin-inline-start',\n 'scroll-margin-left',\n 'scroll-margin-right',\n 'scroll-margin-top',\n 'scroll-padding',\n 'scroll-padding-block',\n 'scroll-padding-block-end',\n 'scroll-padding-block-start',\n 'scroll-padding-bottom',\n 'scroll-padding-inline',\n 'scroll-padding-inline-end',\n 'scroll-padding-inline-start',\n 'scroll-padding-left',\n 'scroll-padding-right',\n 'scroll-padding-top',\n 'scroll-snap-coordinate',\n 'scroll-snap-destination',\n 'scrollbar-color',\n 'shape-image-threshold',\n 'shape-margin',\n 'shape-outside',\n 'tab-size',\n 'text-decoration',\n 'text-decoration-color',\n 'text-decoration-thickness',\n 'text-emphasis',\n 'text-emphasis-color',\n 'text-indent',\n 'text-shadow',\n 'text-underline-offset',\n 'top',\n 'transform',\n 'transform-origin',\n 'translate',\n 'vertical-align',\n 'visibility',\n 'width',\n 'word-spacing',\n 'z-index',\n 'zoom',\n]);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {\n AnimationEvent,\n AnimationPlayer,\n AUTO_STYLE,\n NoopAnimationPlayer,\n ɵAnimationGroupPlayer,\n ɵPRE_STYLE as PRE_STYLE,\n ɵStyleDataMap,\n} from '../../../src/animations';\n\nimport {AnimationStyleNormalizer} from '../../src/dsl/style_normalization/animation_style_normalizer';\nimport {animationFailed} from '../error_helpers';\n\nimport {ANIMATABLE_PROP_SET} from './web_animations/animatable_props_set';\n\nexport function optimizeGroupPlayer(players: AnimationPlayer[]): AnimationPlayer {\n switch (players.length) {\n case 0:\n return new NoopAnimationPlayer();\n case 1:\n return players[0];\n default:\n return new ɵAnimationGroupPlayer(players);\n }\n}\n\nexport function normalizeKeyframes(\n normalizer: AnimationStyleNormalizer,\n keyframes: Array<ɵStyleDataMap>,\n preStyles: ɵStyleDataMap = new Map(),\n postStyles: ɵStyleDataMap = new Map(),\n): Array<ɵStyleDataMap> {\n const errors: Error[] = [];\n const normalizedKeyframes: Array<ɵStyleDataMap> = [];\n let previousOffset = -1;\n let previousKeyframe: ɵStyleDataMap | null = null;\n keyframes.forEach((kf) => {\n const offset = kf.get('offset') as number;\n const isSameOffset = offset == previousOffset;\n const normalizedKeyframe: ɵStyleDataMap = (isSameOffset && previousKeyframe) || new Map();\n kf.forEach((val, prop) => {\n let normalizedProp = prop;\n let normalizedValue = val;\n if (prop !== 'offset') {\n normalizedProp = normalizer.normalizePropertyName(normalizedProp, errors);\n switch (normalizedValue) {\n case PRE_STYLE:\n normalizedValue = preStyles.get(prop)!;\n break;\n\n case AUTO_STYLE:\n normalizedValue = postStyles.get(prop)!;\n break;\n\n default:\n normalizedValue = normalizer.normalizeStyleValue(\n prop,\n normalizedProp,\n normalizedValue,\n errors,\n );\n break;\n }\n }\n normalizedKeyframe.set(normalizedProp, normalizedValue);\n });\n if (!isSameOffset) {\n normalizedKeyframes.push(normalizedKeyframe);\n }\n previousKeyframe = normalizedKeyframe;\n previousOffset = offset;\n });\n if (errors.length) {\n throw animationFailed(errors);\n }\n\n return normalizedKeyframes;\n}\n\nexport function listenOnPlayer(\n player: AnimationPlayer,\n eventName: string,\n event: AnimationEvent | undefined,\n callback: (event: any) => any,\n) {\n switch (eventName) {\n case 'start':\n player.onStart(() => callback(event && copyAnimationEvent(event, 'start', player)));\n break;\n case 'done':\n player.onDone(() => callback(event && copyAnimationEvent(event, 'done', player)));\n break;\n case 'destroy':\n player.onDestroy(() => callback(event && copyAnimationEvent(event, 'destroy', player)));\n break;\n }\n}\n\nexport function copyAnimationEvent(\n e: AnimationEvent,\n phaseName: string,\n player: AnimationPlayer,\n): AnimationEvent {\n const totalTime = player.totalTime;\n const disabled = (player as any).disabled ? true : false;\n const event = makeAnimationEvent(\n e.element,\n e.triggerName,\n e.fromState,\n e.toState,\n phaseName || e.phaseName,\n totalTime == undefined ? e.totalTime : totalTime,\n disabled,\n );\n const data = (e as any)['_data'];\n if (data != null) {\n (event as any)['_data'] = data;\n }\n return event;\n}\n\nexport function makeAnimationEvent(\n element: any,\n triggerName: string,\n fromState: string,\n toState: string,\n phaseName: string = '',\n totalTime: number = 0,\n disabled?: boolean,\n): AnimationEvent {\n return {element, triggerName, fromState, toState, phaseName, totalTime, disabled: !!disabled};\n}\n\nexport function getOrSetDefaultValue(map: Map, key: T, defaultValue: V) {\n let value = map.get(key);\n if (!value) {\n map.set(key, (value = defaultValue));\n }\n return value;\n}\n\nexport function parseTimelineCommand(command: string): [string, string] {\n const separatorPos = command.indexOf(':');\n const id = command.substring(1, separatorPos);\n const action = command.slice(separatorPos + 1);\n return [id, action];\n}\n\nconst documentElement: HTMLElement | null = /* @__PURE__ */ (() =>\n typeof document === 'undefined' ? null : document.documentElement)();\n\nexport function getParentElement(element: any): unknown | null {\n const parent = element.parentNode || element.host || null; // consider host to support shadow DOM\n if (parent === documentElement) {\n return null;\n }\n return parent;\n}\n\nfunction containsVendorPrefix(prop: string): boolean {\n // Webkit is the only real popular vendor prefix nowadays\n // cc: http://shouldiprefix.com/\n return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit\n}\n\nlet _CACHED_BODY: {style: any} | null = null;\nlet _IS_WEBKIT = false;\nexport function validateStyleProperty(prop: string): boolean {\n if (!_CACHED_BODY) {\n _CACHED_BODY = getBodyNode() || {};\n _IS_WEBKIT = _CACHED_BODY!.style ? 'WebkitAppearance' in _CACHED_BODY!.style : false;\n }\n\n let result = true;\n if (_CACHED_BODY!.style && !containsVendorPrefix(prop)) {\n result = prop in _CACHED_BODY!.style;\n if (!result && _IS_WEBKIT) {\n const camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.slice(1);\n result = camelProp in _CACHED_BODY!.style;\n }\n }\n\n return result;\n}\n\nexport function validateWebAnimatableStyleProperty(prop: string): boolean {\n return ANIMATABLE_PROP_SET.has(prop);\n}\n\nexport function getBodyNode(): any | null {\n if (typeof document != 'undefined') {\n return document.body;\n }\n return null;\n}\n\nexport function containsElement(elm1: any, elm2: any): boolean {\n while (elm2) {\n if (elm2 === elm1) {\n return true;\n }\n elm2 = getParentElement(elm2);\n }\n return false;\n}\n\nexport function invokeQuery(element: any, selector: string, multi: boolean): any[] {\n if (multi) {\n return Array.from(element.querySelectorAll(selector));\n }\n const elem = element.querySelector(selector);\n return elem ? [elem] : [];\n}\n\nexport function hypenatePropsKeys(original: ɵStyleDataMap): ɵStyleDataMap {\n const newMap: ɵStyleDataMap = new Map();\n original.forEach((val, prop) => {\n const newProp = prop.replace(/([a-z])([A-Z])/g, '$1-$2');\n newMap.set(newProp, val);\n });\n return newMap;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {\n AnimateTimings,\n AnimationMetadata,\n AnimationMetadataType,\n AnimationOptions,\n sequence,\n ɵStyleData,\n ɵStyleDataMap,\n} from '../../src/animations';\n\nimport {Ast as AnimationAst, AstVisitor as AnimationAstVisitor} from './dsl/animation_ast';\nimport {AnimationDslVisitor} from './dsl/animation_dsl_visitor';\nimport {\n invalidNodeType,\n invalidParamValue,\n invalidStyleParams,\n invalidTimingValue,\n negativeDelayValue,\n negativeStepValue,\n} from './error_helpers';\n\nconst ONE_SECOND = 1000;\n\nexport const SUBSTITUTION_EXPR_START = '{{';\nexport const SUBSTITUTION_EXPR_END = '}}';\nexport const ENTER_CLASSNAME = 'ng-enter';\nexport const LEAVE_CLASSNAME = 'ng-leave';\nexport const NG_TRIGGER_CLASSNAME = 'ng-trigger';\nexport const NG_TRIGGER_SELECTOR = '.ng-trigger';\nexport const NG_ANIMATING_CLASSNAME = 'ng-animating';\nexport const NG_ANIMATING_SELECTOR = '.ng-animating';\n\nexport function resolveTimingValue(value: string | number) {\n if (typeof value == 'number') return value;\n\n const matches = value.match(/^(-?[\\.\\d]+)(m?s)/);\n if (!matches || matches.length < 2) return 0;\n\n return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);\n}\n\nfunction _convertTimeValueToMS(value: number, unit: string): number {\n switch (unit) {\n case 's':\n return value * ONE_SECOND;\n default: // ms or something else\n return value;\n }\n}\n\nexport function resolveTiming(\n timings: string | number | AnimateTimings,\n errors: Error[],\n allowNegativeValues?: boolean,\n) {\n return timings.hasOwnProperty('duration')\n ? timings\n : parseTimeExpression(timings, errors, allowNegativeValues);\n}\n\nfunction parseTimeExpression(\n exp: string | number,\n errors: Error[],\n allowNegativeValues?: boolean,\n): AnimateTimings {\n const regex = /^(-?[\\.\\d]+)(m?s)(?:\\s+(-?[\\.\\d]+)(m?s))?(?:\\s+([-a-z]+(?:\\(.+?\\))?))?$/i;\n let duration: number;\n let delay: number = 0;\n let easing: string = '';\n if (typeof exp === 'string') {\n const matches = exp.match(regex);\n if (matches === null) {\n errors.push(invalidTimingValue(exp));\n return {duration: 0, delay: 0, easing: ''};\n }\n\n duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);\n\n const delayMatch = matches[3];\n if (delayMatch != null) {\n delay = _convertTimeValueToMS(parseFloat(delayMatch), matches[4]);\n }\n\n const easingVal = matches[5];\n if (easingVal) {\n easing = easingVal;\n }\n } else {\n duration = exp;\n }\n\n if (!allowNegativeValues) {\n let containsErrors = false;\n let startIndex = errors.length;\n if (duration < 0) {\n errors.push(negativeStepValue());\n containsErrors = true;\n }\n if (delay < 0) {\n errors.push(negativeDelayValue());\n containsErrors = true;\n }\n if (containsErrors) {\n errors.splice(startIndex, 0, invalidTimingValue(exp));\n }\n }\n\n return {duration, delay, easing};\n}\n\nexport function normalizeKeyframes(\n keyframes: Array<ɵStyleData> | Array<ɵStyleDataMap>,\n): Array<ɵStyleDataMap> {\n if (!keyframes.length) {\n return [];\n }\n if (keyframes[0] instanceof Map) {\n return keyframes as Array<ɵStyleDataMap>;\n }\n return keyframes.map((kf) => new Map(Object.entries(kf)));\n}\n\nexport function normalizeStyles(styles: ɵStyleDataMap | Array<ɵStyleDataMap>): ɵStyleDataMap {\n return Array.isArray(styles) ? new Map(...styles) : new Map(styles);\n}\n\nexport function setStyles(element: any, styles: ɵStyleDataMap, formerStyles?: ɵStyleDataMap) {\n styles.forEach((val, prop) => {\n const camelProp = dashCaseToCamelCase(prop);\n if (formerStyles && !formerStyles.has(prop)) {\n formerStyles.set(prop, element.style[camelProp]);\n }\n element.style[camelProp] = val;\n });\n}\n\nexport function eraseStyles(element: any, styles: ɵStyleDataMap) {\n styles.forEach((_, prop) => {\n const camelProp = dashCaseToCamelCase(prop);\n element.style[camelProp] = '';\n });\n}\n\nexport function normalizeAnimationEntry(\n steps: AnimationMetadata | AnimationMetadata[],\n): AnimationMetadata {\n if (Array.isArray(steps)) {\n if (steps.length == 1) return steps[0];\n return sequence(steps);\n }\n return steps as AnimationMetadata;\n}\n\nexport function validateStyleParams(\n value: string | number | null | undefined,\n options: AnimationOptions,\n errors: Error[],\n) {\n const params = options.params || {};\n const matches = extractStyleParams(value);\n if (matches.length) {\n matches.forEach((varName) => {\n if (!params.hasOwnProperty(varName)) {\n errors.push(invalidStyleParams(varName));\n }\n });\n }\n}\n\nconst PARAM_REGEX = /* @__PURE__ */ new RegExp(\n `${SUBSTITUTION_EXPR_START}\\\\s*(.+?)\\\\s*${SUBSTITUTION_EXPR_END}`,\n 'g',\n);\nexport function extractStyleParams(value: string | number | null | undefined): string[] {\n let params: string[] = [];\n if (typeof value === 'string') {\n let match: any;\n while ((match = PARAM_REGEX.exec(value))) {\n params.push(match[1] as string);\n }\n PARAM_REGEX.lastIndex = 0;\n }\n return params;\n}\n\nexport function interpolateParams(\n value: string | number,\n params: {[name: string]: any},\n errors: Error[],\n): string | number {\n const original = `${value}`;\n const str = original.replace(PARAM_REGEX, (_, varName) => {\n let localVal = params[varName];\n // this means that the value was never overridden by the data passed in by the user\n if (localVal == null) {\n errors.push(invalidParamValue(varName));\n localVal = '';\n }\n return localVal.toString();\n });\n\n // we do this to assert that numeric values stay as they are\n return str == original ? value : str;\n}\n\nconst DASH_CASE_REGEXP = /-+([a-z0-9])/g;\nexport function dashCaseToCamelCase(input: string): string {\n return input.replace(DASH_CASE_REGEXP, (...m: any[]) => m[1].toUpperCase());\n}\n\nexport function camelCaseToDashCase(input: string): string {\n return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\nexport function allowPreviousPlayerStylesMerge(duration: number, delay: number) {\n return duration === 0 || delay === 0;\n}\n\nexport function balancePreviousStylesIntoKeyframes(\n element: any,\n keyframes: Array<ɵStyleDataMap>,\n previousStyles: ɵStyleDataMap,\n) {\n if (previousStyles.size && keyframes.length) {\n let startingKeyframe = keyframes[0];\n let missingStyleProps: string[] = [];\n previousStyles.forEach((val, prop) => {\n if (!startingKeyframe.has(prop)) {\n missingStyleProps.push(prop);\n }\n startingKeyframe.set(prop, val);\n });\n\n if (missingStyleProps.length) {\n for (let i = 1; i < keyframes.length; i++) {\n let kf = keyframes[i];\n missingStyleProps.forEach((prop) => kf.set(prop, computeStyle(element, prop)));\n }\n }\n }\n return keyframes;\n}\n\nexport function visitDslNode(\n visitor: AnimationDslVisitor,\n node: AnimationMetadata,\n context: any,\n): any;\nexport function visitDslNode(\n visitor: AnimationAstVisitor,\n node: AnimationAst,\n context: any,\n): any;\nexport function visitDslNode(visitor: any, node: any, context: any): any {\n switch (node.type) {\n case AnimationMetadataType.Trigger:\n return visitor.visitTrigger(node, context);\n case AnimationMetadataType.State:\n return visitor.visitState(node, context);\n case AnimationMetadataType.Transition:\n return visitor.visitTransition(node, context);\n case AnimationMetadataType.Sequence:\n return visitor.visitSequence(node, context);\n case AnimationMetadataType.Group:\n return visitor.visitGroup(node, context);\n case AnimationMetadataType.Animate:\n return visitor.visitAnimate(node, context);\n case AnimationMetadataType.Keyframes:\n return visitor.visitKeyframes(node, context);\n case AnimationMetadataType.Style:\n return visitor.visitStyle(node, context);\n case AnimationMetadataType.Reference:\n return visitor.visitReference(node, context);\n case AnimationMetadataType.AnimateChild:\n return visitor.visitAnimateChild(node, context);\n case AnimationMetadataType.AnimateRef:\n return visitor.visitAnimateRef(node, context);\n case AnimationMetadataType.Query:\n return visitor.visitQuery(node, context);\n case AnimationMetadataType.Stagger:\n return visitor.visitStagger(node, context);\n default:\n throw invalidNodeType(node.type);\n }\n}\n\nexport function computeStyle(element: any, prop: string): string {\n return (window.getComputedStyle(element))[prop];\n}\n"],"names":["RuntimeError","ɵAnimationGroupPlayer","normalizeKeyframes","PRE_STYLE"],"mappings":";;;;;;;;;AAWA,MAAM,UAAU,GAAG,OAAO;AAEpB,SAAU,kBAAkB,CAAC,GAAoB,EAAA;IACrD,OAAO,IAAIA,aAAY,CAErB,IAAA,8CAAA,SAAS,IAAI,CAA8B,2BAAA,EAAA,GAAG,CAAe,aAAA,CAAA,CAC9D;AACH;SAEgB,iBAAiB,GAAA;AAC/B,IAAA,OAAO,IAAIA,aAAY,CAAA,IAAA,6CAErB,SAAS,IAAI,kEAAkE,CAChF;AACH;SAEgB,kBAAkB,GAAA;AAChC,IAAA,OAAO,IAAIA,aAAY,CAAA,IAAA,8CAErB,SAAS,IAAI,+DAA+D,CAC7E;AACH;AAEM,SAAU,kBAAkB,CAAC,OAAe,EAAA;IAChD,OAAO,IAAIA,aAAY,CAAA,IAAA,8CAErB,SAAS;QACP,CAA+C,4CAAA,EAAA,OAAO,CAA8B,4BAAA,CAAA,CACvF;AACH;AAEM,SAAU,iBAAiB,CAAC,OAAe,EAAA;IAC/C,OAAO,IAAIA,aAAY,CAErB,IAAA,6CAAA,SAAS,IAAI,CAAkD,+CAAA,EAAA,OAAO,CAAE,CAAA,CACzE;AACH;AAEM,SAAU,eAAe,CAAC,QAAgB,EAAA;IAC9C,OAAO,IAAIA,aAAY,CAErB,IAAA,2CAAA,SAAS,IAAI,CAA8C,2CAAA,EAAA,QAAQ,CAAE,CAAA,CACtE;AACH;AAEgB,SAAA,mBAAmB,CAAC,oBAA4B,EAAE,KAAa,EAAA;IAC7E,OAAO,IAAIA,aAAY,CAAA,IAAA,gDAErB,SAAS,IAAI,CAAuC,oCAAA,EAAA,oBAAoB,CAAI,CAAA,EAAA,KAAK,CAAE,CAAA,CACpF;AACH;SAEgB,cAAc,GAAA;IAC5B,OAAO,IAAIA,aAAY,CAAA,IAAA,yCAErB,SAAS;AACP,QAAA,sFAAsF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AC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC;AAC5C,QAAA;AACE,YAAA,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;;AAEtC;AAEgB,SAAA,YAAY,CAAC,OAAY,EAAE,IAAY,EAAA;IACrD,OAAa,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAE,CAAC,IAAI,CAAC;AACtD;;;;"} -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Angular v20.1.0-next.0+sha-21fc93b 3 | * (c) 2010-2025 Google LLC. https://angular.io/ 4 | * License: MIT 5 | */ 6 | 7 | import * as i0 from '@angular/core'; 8 | import { RendererFactory2 } from '@angular/core'; 9 | import { AnimationMetadata, AnimationOptions, AnimationPlayer } from './animation_player.d-Bpvrt8M2.js'; 10 | export { AUTO_STYLE, AnimateChildOptions, AnimateTimings, AnimationAnimateChildMetadata, AnimationAnimateMetadata, AnimationAnimateRefMetadata, AnimationGroupMetadata, AnimationKeyframesSequenceMetadata, AnimationMetadataType, AnimationQueryMetadata, AnimationQueryOptions, AnimationReferenceMetadata, AnimationSequenceMetadata, AnimationStaggerMetadata, AnimationStateMetadata, AnimationStyleMetadata, AnimationTransitionMetadata, AnimationTriggerMetadata, NoopAnimationPlayer, animate, animateChild, animation, group, keyframes, query, sequence, stagger, state, style, transition, trigger, useAnimation, ɵStyleData, ɵStyleDataMap } from './animation_player.d-Bpvrt8M2.js'; 11 | 12 | /** 13 | * An injectable service that produces an animation sequence programmatically within an 14 | * Angular component or directive. 15 | * Provided by the `BrowserAnimationsModule` or `NoopAnimationsModule`. 16 | * 17 | * @usageNotes 18 | * 19 | * To use this service, add it to your component or directive as a dependency. 20 | * The service is instantiated along with your component. 21 | * 22 | * Apps do not typically need to create their own animation players, but if you 23 | * do need to, follow these steps: 24 | * 25 | * 1. Use the [AnimationBuilder.build](api/animations/AnimationBuilder#build)() method 26 | * to create a programmatic animation. The method returns an `AnimationFactory` instance. 27 | * 28 | * 2. Use the factory object to create an `AnimationPlayer` and attach it to a DOM element. 29 | * 30 | * 3. Use the player object to control the animation programmatically. 31 | * 32 | * For example: 33 | * 34 | * ```ts 35 | * // import the service from BrowserAnimationsModule 36 | * import {AnimationBuilder} from '@angular/animations'; 37 | * // require the service as a dependency 38 | * class MyCmp { 39 | * constructor(private _builder: AnimationBuilder) {} 40 | * 41 | * makeAnimation(element: any) { 42 | * // first define a reusable animation 43 | * const myAnimation = this._builder.build([ 44 | * style({ width: 0 }), 45 | * animate(1000, style({ width: '100px' })) 46 | * ]); 47 | * 48 | * // use the returned factory object to create a player 49 | * const player = myAnimation.create(element); 50 | * 51 | * player.play(); 52 | * } 53 | * } 54 | * ``` 55 | * 56 | * @publicApi 57 | */ 58 | declare abstract class AnimationBuilder { 59 | /** 60 | * Builds a factory for producing a defined animation. 61 | * @param animation A reusable animation definition. 62 | * @returns A factory object that can create a player for the defined animation. 63 | * @see {@link animate} 64 | */ 65 | abstract build(animation: AnimationMetadata | AnimationMetadata[]): AnimationFactory; 66 | static ɵfac: i0.ɵɵFactoryDeclaration; 67 | static ɵprov: i0.ɵɵInjectableDeclaration; 68 | } 69 | /** 70 | * A factory object returned from the 71 | * [AnimationBuilder.build](api/animations/AnimationBuilder#build)() 72 | * method. 73 | * 74 | * @publicApi 75 | */ 76 | declare abstract class AnimationFactory { 77 | /** 78 | * Creates an `AnimationPlayer` instance for the reusable animation defined by 79 | * the [AnimationBuilder.build](api/animations/AnimationBuilder#build)() 80 | * method that created this factory and attaches the new player a DOM element. 81 | * 82 | * @param element The DOM element to which to attach the player. 83 | * @param options A set of options that can include a time delay and 84 | * additional developer-defined parameters. 85 | */ 86 | abstract create(element: any, options?: AnimationOptions): AnimationPlayer; 87 | } 88 | declare class BrowserAnimationBuilder extends AnimationBuilder { 89 | private animationModuleType; 90 | private _nextAnimationId; 91 | private _renderer; 92 | constructor(rootRenderer: RendererFactory2, doc: Document); 93 | build(animation: AnimationMetadata | AnimationMetadata[]): AnimationFactory; 94 | static ɵfac: i0.ɵɵFactoryDeclaration; 95 | static ɵprov: i0.ɵɵInjectableDeclaration; 96 | } 97 | 98 | /** 99 | * An instance of this class is returned as an event parameter when an animation 100 | * callback is captured for an animation either during the start or done phase. 101 | * 102 | * ```ts 103 | * @Component({ 104 | * host: { 105 | * '[@myAnimationTrigger]': 'someExpression', 106 | * '(@myAnimationTrigger.start)': 'captureStartEvent($event)', 107 | * '(@myAnimationTrigger.done)': 'captureDoneEvent($event)', 108 | * }, 109 | * animations: [ 110 | * trigger("myAnimationTrigger", [ 111 | * // ... 112 | * ]) 113 | * ] 114 | * }) 115 | * class MyComponent { 116 | * someExpression: any = false; 117 | * captureStartEvent(event: AnimationEvent) { 118 | * // the toState, fromState and totalTime data is accessible from the event variable 119 | * } 120 | * 121 | * captureDoneEvent(event: AnimationEvent) { 122 | * // the toState, fromState and totalTime data is accessible from the event variable 123 | * } 124 | * } 125 | * ``` 126 | * 127 | * @publicApi 128 | */ 129 | interface AnimationEvent { 130 | /** 131 | * The name of the state from which the animation is triggered. 132 | */ 133 | fromState: string; 134 | /** 135 | * The name of the state in which the animation completes. 136 | */ 137 | toState: string; 138 | /** 139 | * The time it takes the animation to complete, in milliseconds. 140 | */ 141 | totalTime: number; 142 | /** 143 | * The animation phase in which the callback was invoked, one of 144 | * "start" or "done". 145 | */ 146 | phaseName: string; 147 | /** 148 | * The element to which the animation is attached. 149 | */ 150 | element: any; 151 | /** 152 | * Internal. 153 | */ 154 | triggerName: string; 155 | /** 156 | * Internal. 157 | */ 158 | disabled: boolean; 159 | } 160 | 161 | /** 162 | * The list of error codes used in runtime code of the `animations` package. 163 | * Reserved error code range: 3000-3999. 164 | */ 165 | declare const enum RuntimeErrorCode { 166 | INVALID_TIMING_VALUE = 3000, 167 | INVALID_STYLE_PARAMS = 3001, 168 | INVALID_STYLE_VALUE = 3002, 169 | INVALID_PARAM_VALUE = 3003, 170 | INVALID_NODE_TYPE = 3004, 171 | INVALID_CSS_UNIT_VALUE = 3005, 172 | INVALID_TRIGGER = 3006, 173 | INVALID_DEFINITION = 3007, 174 | INVALID_STATE = 3008, 175 | INVALID_PROPERTY = 3009, 176 | INVALID_PARALLEL_ANIMATION = 3010, 177 | INVALID_KEYFRAMES = 3011, 178 | INVALID_OFFSET = 3012, 179 | INVALID_STAGGER = 3013, 180 | INVALID_QUERY = 3014, 181 | INVALID_EXPRESSION = 3015, 182 | INVALID_TRANSITION_ALIAS = 3016, 183 | NEGATIVE_STEP_VALUE = 3100, 184 | NEGATIVE_DELAY_VALUE = 3101, 185 | KEYFRAME_OFFSETS_OUT_OF_ORDER = 3200, 186 | KEYFRAMES_MISSING_OFFSETS = 3202, 187 | MISSING_OR_DESTROYED_ANIMATION = 3300, 188 | MISSING_PLAYER = 3301, 189 | MISSING_TRIGGER = 3302, 190 | MISSING_EVENT = 3303, 191 | UNSUPPORTED_TRIGGER_EVENT = 3400, 192 | UNREGISTERED_TRIGGER = 3401, 193 | TRIGGER_TRANSITIONS_FAILED = 3402, 194 | TRIGGER_PARSING_FAILED = 3403, 195 | TRIGGER_BUILD_FAILED = 3404, 196 | VALIDATION_FAILED = 3500, 197 | BUILDING_FAILED = 3501, 198 | ANIMATION_FAILED = 3502, 199 | REGISTRATION_FAILED = 3503, 200 | CREATE_ANIMATION_FAILED = 3504, 201 | TRANSITION_FAILED = 3505, 202 | BROWSER_ANIMATION_BUILDER_INJECTED_WITHOUT_ANIMATIONS = 3600 203 | } 204 | 205 | /** 206 | * A programmatic controller for a group of reusable animations. 207 | * Used internally to control animations. 208 | * 209 | * @see {@link AnimationPlayer} 210 | * @see {@link animations/group group} 211 | * 212 | */ 213 | declare class AnimationGroupPlayer implements AnimationPlayer { 214 | private _onDoneFns; 215 | private _onStartFns; 216 | private _finished; 217 | private _started; 218 | private _destroyed; 219 | private _onDestroyFns; 220 | parentPlayer: AnimationPlayer | null; 221 | totalTime: number; 222 | readonly players: AnimationPlayer[]; 223 | constructor(_players: AnimationPlayer[]); 224 | private _onFinish; 225 | init(): void; 226 | onStart(fn: () => void): void; 227 | private _onStart; 228 | onDone(fn: () => void): void; 229 | onDestroy(fn: () => void): void; 230 | hasStarted(): boolean; 231 | play(): void; 232 | pause(): void; 233 | restart(): void; 234 | finish(): void; 235 | destroy(): void; 236 | private _onDestroy; 237 | reset(): void; 238 | setPosition(p: number): void; 239 | getPosition(): number; 240 | beforeDestroy(): void; 241 | } 242 | 243 | declare const ɵPRE_STYLE = "!"; 244 | 245 | export { AnimationBuilder, AnimationFactory, AnimationMetadata, AnimationOptions, AnimationPlayer, AnimationGroupPlayer as ɵAnimationGroupPlayer, BrowserAnimationBuilder as ɵBrowserAnimationBuilder, ɵPRE_STYLE, RuntimeErrorCode as ɵRuntimeErrorCode }; 246 | export type { AnimationEvent }; 247 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@angular/animations", 3 | "version": "20.1.0-next.0+sha-21fc93b", 4 | "description": "Angular - animations integration with web-animations", 5 | "author": "angular", 6 | "license": "MIT", 7 | "engines": { 8 | "node": "^20.19.0 || ^22.12.0 || >=24.0.0" 9 | }, 10 | "dependencies": { 11 | "tslib": "^2.3.0" 12 | }, 13 | "peerDependencies": { 14 | "@angular/core": "20.1.0-next.0+sha-21fc93b", 15 | "@angular/common": "20.1.0-next.0+sha-21fc93b" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/angular/angular.git", 20 | "directory": "packages/animations" 21 | }, 22 | "ng-update": { 23 | "packageGroup": [ 24 | "@angular/core", 25 | "@angular/bazel", 26 | "@angular/common", 27 | "@angular/compiler", 28 | "@angular/compiler-cli", 29 | "@angular/animations", 30 | "@angular/elements", 31 | "@angular/platform-browser", 32 | "@angular/platform-browser-dynamic", 33 | "@angular/forms", 34 | "@angular/platform-server", 35 | "@angular/upgrade", 36 | "@angular/router", 37 | "@angular/language-service", 38 | "@angular/localize", 39 | "@angular/service-worker" 40 | ] 41 | }, 42 | "sideEffects": false, 43 | "module": "./fesm2022/animations.mjs", 44 | "typings": "./index.d.ts", 45 | "type": "module", 46 | "exports": { 47 | "./package.json": { 48 | "default": "./package.json" 49 | }, 50 | ".": { 51 | "types": "./index.d.ts", 52 | "default": "./fesm2022/animations.mjs" 53 | }, 54 | "./browser": { 55 | "types": "./browser/index.d.ts", 56 | "default": "./fesm2022/browser.mjs" 57 | }, 58 | "./browser/testing": { 59 | "types": "./browser/testing/index.d.ts", 60 | "default": "./fesm2022/browser/testing.mjs" 61 | } 62 | } 63 | } --------------------------------------------------------------------------------