@angular/core
Advanced tools
Comparing version 2.2.0 to 2.2.1
/** | ||
* @license Angular v2.2.0 | ||
* @license Angular v2.2.1 | ||
* (c) 2010-2016 Google, Inc. https://angular.io/ | ||
@@ -966,11 +966,10 @@ * License: MIT | ||
/** | ||
* @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 | ||
*/ | ||
var MockAnimationPlayer = (function () { | ||
function MockAnimationPlayer() { | ||
function MockAnimationPlayer(startingStyles, keyframes, previousPlayers) { | ||
var _this = this; | ||
if (startingStyles === void 0) { startingStyles = {}; } | ||
if (keyframes === void 0) { keyframes = []; } | ||
if (previousPlayers === void 0) { previousPlayers = []; } | ||
this.startingStyles = startingStyles; | ||
this.keyframes = keyframes; | ||
this._onDoneFns = []; | ||
@@ -982,3 +981,10 @@ this._onStartFns = []; | ||
this.parentPlayer = null; | ||
this.previousStyles = {}; | ||
this.log = []; | ||
previousPlayers.forEach(function (player) { | ||
if (player instanceof MockAnimationPlayer) { | ||
var styles_1 = player._captureStyles(); | ||
Object.keys(styles_1).forEach(function (prop) { return _this.previousStyles[prop] = styles_1[prop]; }); | ||
} | ||
}); | ||
} | ||
@@ -1021,4 +1027,25 @@ MockAnimationPlayer.prototype._onFinish = function () { | ||
}; | ||
MockAnimationPlayer.prototype.setPosition = function (p /** TODO #9100 */) { }; | ||
MockAnimationPlayer.prototype.setPosition = function (p) { }; | ||
MockAnimationPlayer.prototype.getPosition = function () { return 0; }; | ||
MockAnimationPlayer.prototype._captureStyles = function () { | ||
var _this = this; | ||
var captures = {}; | ||
if (this.hasStarted()) { | ||
// when assembling the captured styles, it's important that | ||
// we build the keyframe styles in the following order: | ||
// {startingStyles, ... other styles within keyframes, ... previousStyles } | ||
Object.keys(this.startingStyles).forEach(function (prop) { | ||
captures[prop] = _this.startingStyles[prop]; | ||
}); | ||
this.keyframes.forEach(function (kf) { | ||
var offset = kf[0], styles = kf[1]; | ||
var newStyles = {}; | ||
Object.keys(styles).forEach(function (prop) { captures[prop] = _this._finished ? styles[prop] : _angular_core.AUTO_STYLE; }); | ||
}); | ||
} | ||
Object.keys(this.previousStyles).forEach(function (prop) { | ||
captures[prop] = _this.previousStyles[prop]; | ||
}); | ||
return captures; | ||
}; | ||
return MockAnimationPlayer; | ||
@@ -1025,0 +1052,0 @@ }()); |
{ | ||
"name": "@angular/core", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Angular - the core framework", | ||
@@ -5,0 +5,0 @@ "main": "bundles/core.umd.js", |
@@ -22,4 +22,5 @@ import { AnimationPlayer } from './animation_player'; | ||
reset(): void; | ||
setPosition(p: any): void; | ||
setPosition(p: number): void; | ||
getPosition(): number; | ||
players: AnimationPlayer[]; | ||
} |
@@ -76,3 +76,3 @@ /** | ||
}; | ||
AnimationGroupPlayer.prototype.setPosition = function (p /** TODO #9100 */) { | ||
AnimationGroupPlayer.prototype.setPosition = function (p) { | ||
this._players.forEach(function (player) { player.setPosition(p); }); | ||
@@ -88,4 +88,9 @@ }; | ||
}; | ||
Object.defineProperty(AnimationGroupPlayer.prototype, "players", { | ||
get: function () { return this._players; }, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return AnimationGroupPlayer; | ||
}()); | ||
//# sourceMappingURL=animation_group_player.js.map |
@@ -35,4 +35,4 @@ /** | ||
reset(): void; | ||
setPosition(p: any): void; | ||
setPosition(p: number): void; | ||
getPosition(): number; | ||
} |
@@ -53,3 +53,3 @@ /** | ||
NoOpAnimationPlayer.prototype.reset = function () { }; | ||
NoOpAnimationPlayer.prototype.setPosition = function (p /** TODO #9100 */) { }; | ||
NoOpAnimationPlayer.prototype.setPosition = function (p) { }; | ||
NoOpAnimationPlayer.prototype.getPosition = function () { return 0; }; | ||
@@ -56,0 +56,0 @@ return NoOpAnimationPlayer; |
@@ -25,4 +25,5 @@ import { AnimationPlayer } from './animation_player'; | ||
destroy(): void; | ||
setPosition(p: any): void; | ||
setPosition(p: number): void; | ||
getPosition(): number; | ||
players: AnimationPlayer[]; | ||
} |
@@ -92,6 +92,11 @@ /** | ||
}; | ||
AnimationSequencePlayer.prototype.setPosition = function (p /** TODO #9100 */) { this._players[0].setPosition(p); }; | ||
AnimationSequencePlayer.prototype.setPosition = function (p) { this._players[0].setPosition(p); }; | ||
AnimationSequencePlayer.prototype.getPosition = function () { return this._players[0].getPosition(); }; | ||
Object.defineProperty(AnimationSequencePlayer.prototype, "players", { | ||
get: function () { return this._players; }, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return AnimationSequencePlayer; | ||
}()); | ||
//# sourceMappingURL=animation_sequence_player.js.map |
@@ -68,2 +68,3 @@ /** | ||
} | ||
collectAndResolveStyles(collectedStyles, [finalStateStyles]); | ||
return keyframes; | ||
@@ -70,0 +71,0 @@ } |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":1,"metadata":{"collectAndResolveStyles":{"__symbolic":"function","parameters":["collection","styles"],"value":{"__symbolic":"error","message":"Function call not supported","line":97,"character":20}}}} | ||
{"__symbolic":"module","version":1,"metadata":{"collectAndResolveStyles":{"__symbolic":"function","parameters":["collection","styles"],"value":{"__symbolic":"error","message":"Function call not supported","line":99,"character":20}}}} |
@@ -17,3 +17,3 @@ /** | ||
} | ||
export declare class DebugDomRenderer implements Renderer { | ||
export declare class DebugDomRenderer { | ||
private _delegate; | ||
@@ -39,3 +39,3 @@ constructor(_delegate: Renderer); | ||
setText(renderNode: any, text: string): void; | ||
animate(element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[], duration: number, delay: number, easing: string): AnimationPlayer; | ||
animate(element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[], duration: number, delay: number, easing: string, previousPlayers?: AnimationPlayer[]): AnimationPlayer; | ||
} |
@@ -128,4 +128,5 @@ /** | ||
DebugDomRenderer.prototype.setText = function (renderNode, text) { this._delegate.setText(renderNode, text); }; | ||
DebugDomRenderer.prototype.animate = function (element, startingStyles, keyframes, duration, delay, easing) { | ||
return this._delegate.animate(element, startingStyles, keyframes, duration, delay, easing); | ||
DebugDomRenderer.prototype.animate = function (element, startingStyles, keyframes, duration, delay, easing, previousPlayers) { | ||
if (previousPlayers === void 0) { previousPlayers = []; } | ||
return this._delegate.animate(element, startingStyles, keyframes, duration, delay, easing, previousPlayers); | ||
}; | ||
@@ -132,0 +133,0 @@ return DebugDomRenderer; |
@@ -6,3 +6,3 @@ import { AnimationPlayer } from '../animation/animation_player'; | ||
queueAnimation(element: any, animationName: string, player: AnimationPlayer): void; | ||
cancelActiveAnimation(element: any, animationName: string, removeAllAnimations?: boolean): void; | ||
getAnimationPlayers(element: any, animationName: string, removeAllAnimations?: boolean): AnimationPlayer[]; | ||
} |
import { AnimationGroupPlayer } from '../animation/animation_group_player'; | ||
import { queueAnimation as queueAnimationGlobally } from '../animation/animation_queue'; | ||
import { AnimationSequencePlayer } from '../animation/animation_sequence_player'; | ||
import { ViewAnimationMap } from '../animation/view_animation_map'; | ||
@@ -23,16 +24,26 @@ export var AnimationViewContext = (function () { | ||
}; | ||
AnimationViewContext.prototype.cancelActiveAnimation = function (element, animationName, removeAllAnimations) { | ||
AnimationViewContext.prototype.getAnimationPlayers = function (element, animationName, removeAllAnimations) { | ||
if (removeAllAnimations === void 0) { removeAllAnimations = false; } | ||
var players = []; | ||
if (removeAllAnimations) { | ||
this._players.findAllPlayersByElement(element).forEach(function (player) { return player.destroy(); }); | ||
this._players.findAllPlayersByElement(element).forEach(function (player) { _recursePlayers(player, players); }); | ||
} | ||
else { | ||
var player = this._players.find(element, animationName); | ||
if (player) { | ||
player.destroy(); | ||
var currentPlayer = this._players.find(element, animationName); | ||
if (currentPlayer) { | ||
_recursePlayers(currentPlayer, players); | ||
} | ||
} | ||
return players; | ||
}; | ||
return AnimationViewContext; | ||
}()); | ||
function _recursePlayers(player, collectedPlayers) { | ||
if ((player instanceof AnimationGroupPlayer) || (player instanceof AnimationSequencePlayer)) { | ||
player.players.forEach(function (player) { return _recursePlayers(player, collectedPlayers); }); | ||
} | ||
else { | ||
collectedPlayers.push(player); | ||
} | ||
} | ||
//# sourceMappingURL=animation_view_context.js.map |
@@ -215,3 +215,6 @@ /** | ||
else { | ||
this.visitRootNodesInternal(this._directRenderer.appendChild, this._directRenderer.parentElement(prevNode)); | ||
var parentElement = this._directRenderer.parentElement(prevNode); | ||
if (parentElement) { | ||
this.visitRootNodesInternal(this._directRenderer.appendChild, parentElement); | ||
} | ||
} | ||
@@ -218,0 +221,0 @@ } |
@@ -56,4 +56,7 @@ /** | ||
// API of tsickle for lowering decorators to properties on the class. | ||
if (type.ctorParameters) { | ||
var ctorParameters = type.ctorParameters; | ||
var tsickleCtorParams = type.ctorParameters; | ||
if (tsickleCtorParams) { | ||
// Newer tsickle uses a function closure | ||
// Retain the non-function case for compatibility with older tsickle | ||
var ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams; | ||
var paramTypes = ctorParameters.map(function (ctorParam) { return ctorParam && ctorParam.type; }); | ||
@@ -60,0 +63,0 @@ var paramAnnotations = ctorParameters.map(function (ctorParam) { |
@@ -71,3 +71,3 @@ /** | ||
abstract setText(renderNode: any, text: string): void; | ||
abstract animate(element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[], duration: number, delay: number, easing: string): AnimationPlayer; | ||
abstract animate(element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[], duration: number, delay: number, easing: string, previousPlayers?: AnimationPlayer[]): AnimationPlayer; | ||
} | ||
@@ -74,0 +74,0 @@ /** |
@@ -10,2 +10,8 @@ /** | ||
export declare class MockAnimationPlayer implements AnimationPlayer { | ||
startingStyles: { | ||
[key: string]: string | number; | ||
}; | ||
keyframes: Array<[number, { | ||
[style: string]: string | number; | ||
}]>; | ||
private _onDoneFns; | ||
@@ -17,3 +23,11 @@ private _onStartFns; | ||
parentPlayer: AnimationPlayer; | ||
previousStyles: { | ||
[styleName: string]: string | number; | ||
}; | ||
log: any[]; | ||
constructor(startingStyles?: { | ||
[key: string]: string | number; | ||
}, keyframes?: Array<[number, { | ||
[style: string]: string | number; | ||
}]>, previousPlayers?: AnimationPlayer[]); | ||
private _onFinish(); | ||
@@ -30,4 +44,5 @@ init(): void; | ||
destroy(): void; | ||
setPosition(p: any): void; | ||
setPosition(p: number): void; | ||
getPosition(): number; | ||
private _captureStyles(); | ||
} |
@@ -1,10 +0,10 @@ | ||
/** | ||
* @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 | ||
*/ | ||
import { AUTO_STYLE } from '@angular/core'; | ||
export var MockAnimationPlayer = (function () { | ||
function MockAnimationPlayer() { | ||
function MockAnimationPlayer(startingStyles, keyframes, previousPlayers) { | ||
var _this = this; | ||
if (startingStyles === void 0) { startingStyles = {}; } | ||
if (keyframes === void 0) { keyframes = []; } | ||
if (previousPlayers === void 0) { previousPlayers = []; } | ||
this.startingStyles = startingStyles; | ||
this.keyframes = keyframes; | ||
this._onDoneFns = []; | ||
@@ -16,3 +16,10 @@ this._onStartFns = []; | ||
this.parentPlayer = null; | ||
this.previousStyles = {}; | ||
this.log = []; | ||
previousPlayers.forEach(function (player) { | ||
if (player instanceof MockAnimationPlayer) { | ||
var styles_1 = player._captureStyles(); | ||
Object.keys(styles_1).forEach(function (prop) { return _this.previousStyles[prop] = styles_1[prop]; }); | ||
} | ||
}); | ||
} | ||
@@ -55,6 +62,27 @@ MockAnimationPlayer.prototype._onFinish = function () { | ||
}; | ||
MockAnimationPlayer.prototype.setPosition = function (p /** TODO #9100 */) { }; | ||
MockAnimationPlayer.prototype.setPosition = function (p) { }; | ||
MockAnimationPlayer.prototype.getPosition = function () { return 0; }; | ||
MockAnimationPlayer.prototype._captureStyles = function () { | ||
var _this = this; | ||
var captures = {}; | ||
if (this.hasStarted()) { | ||
// when assembling the captured styles, it's important that | ||
// we build the keyframe styles in the following order: | ||
// {startingStyles, ... other styles within keyframes, ... previousStyles } | ||
Object.keys(this.startingStyles).forEach(function (prop) { | ||
captures[prop] = _this.startingStyles[prop]; | ||
}); | ||
this.keyframes.forEach(function (kf) { | ||
var offset = kf[0], styles = kf[1]; | ||
var newStyles = {}; | ||
Object.keys(styles).forEach(function (prop) { captures[prop] = _this._finished ? styles[prop] : AUTO_STYLE; }); | ||
}); | ||
} | ||
Object.keys(this.previousStyles).forEach(function (prop) { | ||
captures[prop] = _this.previousStyles[prop]; | ||
}); | ||
return captures; | ||
}; | ||
return MockAnimationPlayer; | ||
}()); | ||
//# sourceMappingURL=mock_animation_player.js.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2103657
30500