animations-browser-testing.umd.js
7.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/**
* @license Angular v4.2.3
* (c) 2010-2017 Google, Inc. https://angular.io/
* License: MIT
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/animations')) :
typeof define === 'function' && define.amd ? define(['exports', '@angular/animations'], factory) :
(factory((global.ng = global.ng || {}, global.ng.animations = global.ng.animations || {}, global.ng.animations.browser = global.ng.animations.browser || {}, global.ng.animations.browser.testing = global.ng.animations.browser.testing || {}),global._angular_animations));
}(this, (function (exports,_angular_animations) { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
/**
* @license Angular v4.2.3
* (c) 2010-2017 Google, Inc. https://angular.io/
* 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 _contains = function (elm1, elm2) { return false; };
var _matches = function (element, selector) { return false; };
var _query = function (element, selector, multi) {
return [];
};
if (typeof Element != 'undefined') {
// this is well supported in all browsers
_contains = function (elm1, elm2) { return elm1.contains(elm2); };
if (Element.prototype.matches) {
_matches = function (element, selector) { return element.matches(selector); };
}
else {
var proto = Element.prototype;
var fn_1 = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector ||
proto.oMatchesSelector || proto.webkitMatchesSelector;
if (fn_1) {
_matches = function (element, selector) { return fn_1.apply(element, [selector]); };
}
}
_query = function (element, selector, multi) {
var results = [];
if (multi) {
results.push.apply(results, element.querySelectorAll(selector));
}
else {
var elm = element.querySelector(selector);
if (elm) {
results.push(elm);
}
}
return results;
};
}
var matchesElement = _matches;
var containsElement = _contains;
var invokeQuery = _query;
/**
* @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
*/
/**
* @experimental Animation support is experimental.
*/
var MockAnimationDriver = (function () {
function MockAnimationDriver() {
}
MockAnimationDriver.prototype.matchesElement = function (element, selector) {
return matchesElement(element, selector);
};
MockAnimationDriver.prototype.containsElement = function (elm1, elm2) { return containsElement(elm1, elm2); };
MockAnimationDriver.prototype.query = function (element, selector, multi) {
return invokeQuery(element, selector, multi);
};
MockAnimationDriver.prototype.computeStyle = function (element, prop, defaultValue) {
return defaultValue || '';
};
MockAnimationDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers) {
if (previousPlayers === void 0) { previousPlayers = []; }
var player = new MockAnimationPlayer(element, keyframes, duration, delay, easing, previousPlayers);
MockAnimationDriver.log.push(player);
return player;
};
return MockAnimationDriver;
}());
MockAnimationDriver.log = [];
/**
* @experimental Animation support is experimental.
*/
var MockAnimationPlayer = (function (_super) {
__extends(MockAnimationPlayer, _super);
function MockAnimationPlayer(element, keyframes, duration, delay, easing, previousPlayers) {
var _this = _super.call(this) || this;
_this.element = element;
_this.keyframes = keyframes;
_this.duration = duration;
_this.delay = delay;
_this.easing = easing;
_this.previousPlayers = previousPlayers;
_this.__finished = false;
_this.__started = false;
_this.previousStyles = {};
_this._onInitFns = [];
_this.currentSnapshot = {};
previousPlayers.forEach(function (player) {
if (player instanceof MockAnimationPlayer) {
var styles_1 = player.currentSnapshot;
Object.keys(styles_1).forEach(function (prop) { return _this.previousStyles[prop] = styles_1[prop]; });
}
});
_this.totalTime = delay + duration;
return _this;
}
/* @internal */
MockAnimationPlayer.prototype.onInit = function (fn) { this._onInitFns.push(fn); };
/* @internal */
MockAnimationPlayer.prototype.init = function () {
_super.prototype.init.call(this);
this._onInitFns.forEach(function (fn) { return fn(); });
this._onInitFns = [];
};
MockAnimationPlayer.prototype.finish = function () {
_super.prototype.finish.call(this);
this.__finished = true;
};
MockAnimationPlayer.prototype.destroy = function () {
_super.prototype.destroy.call(this);
this.__finished = true;
};
/* @internal */
MockAnimationPlayer.prototype.triggerMicrotask = function () { };
MockAnimationPlayer.prototype.play = function () {
_super.prototype.play.call(this);
this.__started = true;
};
MockAnimationPlayer.prototype.hasStarted = function () { return this.__started; };
MockAnimationPlayer.prototype.beforeDestroy = function () {
var _this = this;
var captures = {};
Object.keys(this.previousStyles).forEach(function (prop) {
captures[prop] = _this.previousStyles[prop];
});
if (this.hasStarted()) {
// when assembling the captured styles, it's important that
// we build the keyframe styles in the following order:
// {other styles within keyframes, ... previousStyles }
this.keyframes.forEach(function (kf) {
Object.keys(kf).forEach(function (prop) {
if (prop != 'offset') {
captures[prop] = _this.__finished ? kf[prop] : _angular_animations.AUTO_STYLE;
}
});
});
}
this.currentSnapshot = captures;
};
return MockAnimationPlayer;
}(_angular_animations.NoopAnimationPlayer));
exports.MockAnimationDriver = MockAnimationDriver;
exports.MockAnimationPlayer = MockAnimationPlayer;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=animations-browser-testing.umd.js.map