2017-01-26 11:16:51 -08:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
2017-02-22 15:14:49 -08:00
|
|
|
import {ɵStyleData} from '@angular/animations';
|
|
|
|
import {AnimationEngineInstruction, AnimationTransitionInstructionType} from '../render/animation_engine_instruction';
|
2017-01-26 11:16:51 -08:00
|
|
|
import {AnimationTimelineInstruction} from './animation_timeline_instruction';
|
|
|
|
|
|
|
|
export interface AnimationTransitionInstruction extends AnimationEngineInstruction {
|
2017-04-26 10:44:28 -07:00
|
|
|
element: any;
|
2017-01-26 11:16:51 -08:00
|
|
|
triggerName: string;
|
|
|
|
isRemovalTransition: boolean;
|
2017-02-22 15:14:49 -08:00
|
|
|
fromState: string;
|
|
|
|
fromStyles: ɵStyleData;
|
|
|
|
toState: string;
|
|
|
|
toStyles: ɵStyleData;
|
2017-01-26 11:16:51 -08:00
|
|
|
timelines: AnimationTimelineInstruction[];
|
2017-04-26 10:44:28 -07:00
|
|
|
queriedElements: any[];
|
|
|
|
preStyleProps: Map<any, {[prop: string]: boolean}>;
|
|
|
|
postStyleProps: Map<any, {[prop: string]: boolean}>;
|
2018-02-14 10:12:10 -08:00
|
|
|
totalTime: number;
|
2017-06-29 14:17:39 -07:00
|
|
|
errors?: any[];
|
2017-01-26 11:16:51 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function createTransitionInstruction(
|
2017-04-26 10:44:28 -07:00
|
|
|
element: any, triggerName: string, fromState: string, toState: string,
|
|
|
|
isRemovalTransition: boolean, fromStyles: ɵStyleData, toStyles: ɵStyleData,
|
|
|
|
timelines: AnimationTimelineInstruction[], queriedElements: any[],
|
|
|
|
preStyleProps: Map<any, {[prop: string]: boolean}>,
|
2018-02-14 10:12:10 -08:00
|
|
|
postStyleProps: Map<any, {[prop: string]: boolean}>, totalTime: number,
|
2017-06-29 14:17:39 -07:00
|
|
|
errors?: any[]): AnimationTransitionInstruction {
|
2017-01-26 11:16:51 -08:00
|
|
|
return {
|
|
|
|
type: AnimationTransitionInstructionType.TransitionAnimation,
|
2017-04-26 10:44:28 -07:00
|
|
|
element,
|
2017-01-26 11:16:51 -08:00
|
|
|
triggerName,
|
|
|
|
isRemovalTransition,
|
2017-02-22 15:14:49 -08:00
|
|
|
fromState,
|
2017-01-26 11:16:51 -08:00
|
|
|
fromStyles,
|
2017-02-22 15:14:49 -08:00
|
|
|
toState,
|
2017-01-26 11:16:51 -08:00
|
|
|
toStyles,
|
2017-04-26 10:44:28 -07:00
|
|
|
timelines,
|
|
|
|
queriedElements,
|
|
|
|
preStyleProps,
|
2017-06-29 14:17:39 -07:00
|
|
|
postStyleProps,
|
2018-02-14 10:12:10 -08:00
|
|
|
totalTime,
|
2017-06-29 14:17:39 -07:00
|
|
|
errors
|
2017-01-26 11:16:51 -08:00
|
|
|
};
|
|
|
|
}
|