| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521 |
- /**
- * @license Angular v5.2.11
- * (c) 2010-2018 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('@angular/animations/browser/testing', ['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));
- }(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 v5.2.11
- * (c) 2010-2018 Google, Inc. https://angular.io/
- * License: MIT
- */
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes} checked by tsc
- */
- /**
- * @param {?} players
- * @return {?}
- */
-
- /**
- * @param {?} driver
- * @param {?} normalizer
- * @param {?} element
- * @param {?} keyframes
- * @param {?=} preStyles
- * @param {?=} postStyles
- * @return {?}
- */
-
- /**
- * @param {?} player
- * @param {?} eventName
- * @param {?} event
- * @param {?} callback
- * @return {?}
- */
-
- /**
- * @param {?} e
- * @param {?=} phaseName
- * @param {?=} totalTime
- * @return {?}
- */
-
- /**
- * @param {?} element
- * @param {?} triggerName
- * @param {?} fromState
- * @param {?} toState
- * @param {?=} phaseName
- * @param {?=} totalTime
- * @return {?}
- */
-
- /**
- * @param {?} map
- * @param {?} key
- * @param {?} defaultValue
- * @return {?}
- */
-
- /**
- * @param {?} command
- * @return {?}
- */
-
- 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 /** @type {?} */ (elm1.contains(elm2)); };
- if (Element.prototype.matches) {
- _matches = function (element, selector) { return element.matches(selector); };
- }
- else {
- var /** @type {?} */ proto = /** @type {?} */ (Element.prototype);
- var /** @type {?} */ 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 /** @type {?} */ results = [];
- if (multi) {
- results.push.apply(results, element.querySelectorAll(selector));
- }
- else {
- var /** @type {?} */ elm = element.querySelector(selector);
- if (elm) {
- results.push(elm);
- }
- }
- return results;
- };
- }
- /**
- * @param {?} prop
- * @return {?}
- */
- function containsVendorPrefix(prop) {
- // Webkit is the only real popular vendor prefix nowadays
- // cc: http://shouldiprefix.com/
- return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit
- }
- var _CACHED_BODY = null;
- var _IS_WEBKIT = false;
- /**
- * @param {?} prop
- * @return {?}
- */
- function validateStyleProperty(prop) {
- if (!_CACHED_BODY) {
- _CACHED_BODY = getBodyNode() || {};
- _IS_WEBKIT = /** @type {?} */ ((_CACHED_BODY)).style ? ('WebkitAppearance' in /** @type {?} */ ((_CACHED_BODY)).style) : false;
- }
- var /** @type {?} */ result = true;
- if (/** @type {?} */ ((_CACHED_BODY)).style && !containsVendorPrefix(prop)) {
- result = prop in /** @type {?} */ ((_CACHED_BODY)).style;
- if (!result && _IS_WEBKIT) {
- var /** @type {?} */ camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.substr(1);
- result = camelProp in /** @type {?} */ ((_CACHED_BODY)).style;
- }
- }
- return result;
- }
- /**
- * @return {?}
- */
- function getBodyNode() {
- if (typeof document != 'undefined') {
- return document.body;
- }
- return null;
- }
- var matchesElement = _matches;
- var containsElement = _contains;
- var invokeQuery = _query;
-
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes} checked by tsc
- */
-
-
-
-
-
-
-
-
-
-
-
- /**
- * @param {?} value
- * @return {?}
- */
-
- /**
- * @param {?} timings
- * @param {?} errors
- * @param {?=} allowNegativeValues
- * @return {?}
- */
-
- /**
- * @param {?} obj
- * @param {?=} destination
- * @return {?}
- */
-
- /**
- * @param {?} styles
- * @return {?}
- */
-
- /**
- * @param {?} styles
- * @param {?} readPrototype
- * @param {?=} destination
- * @return {?}
- */
-
- /**
- * @param {?} element
- * @param {?} styles
- * @return {?}
- */
-
- /**
- * @param {?} element
- * @param {?} styles
- * @return {?}
- */
-
- /**
- * @param {?} steps
- * @return {?}
- */
-
- /**
- * @param {?} value
- * @param {?} options
- * @param {?} errors
- * @return {?}
- */
-
- /**
- * @param {?} value
- * @return {?}
- */
-
- /**
- * @param {?} value
- * @param {?} params
- * @param {?} errors
- * @return {?}
- */
-
- /**
- * @param {?} iterator
- * @return {?}
- */
-
- /**
- * @param {?} source
- * @param {?} destination
- * @return {?}
- */
-
- /**
- * @param {?} input
- * @return {?}
- */
-
- /**
- * @param {?} duration
- * @param {?} delay
- * @return {?}
- */
- function allowPreviousPlayerStylesMerge(duration, delay) {
- return duration === 0 || delay === 0;
- }
- /**
- * @param {?} visitor
- * @param {?} node
- * @param {?} context
- * @return {?}
- */
-
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes} checked by tsc
- */
- /**
- * \@experimental Animation support is experimental.
- */
- var MockAnimationDriver = /** @class */ (function () {
- function MockAnimationDriver() {
- }
- /**
- * @param {?} prop
- * @return {?}
- */
- MockAnimationDriver.prototype.validateStyleProperty = /**
- * @param {?} prop
- * @return {?}
- */
- function (prop) { return validateStyleProperty(prop); };
- /**
- * @param {?} element
- * @param {?} selector
- * @return {?}
- */
- MockAnimationDriver.prototype.matchesElement = /**
- * @param {?} element
- * @param {?} selector
- * @return {?}
- */
- function (element, selector) {
- return matchesElement(element, selector);
- };
- /**
- * @param {?} elm1
- * @param {?} elm2
- * @return {?}
- */
- MockAnimationDriver.prototype.containsElement = /**
- * @param {?} elm1
- * @param {?} elm2
- * @return {?}
- */
- function (elm1, elm2) { return containsElement(elm1, elm2); };
- /**
- * @param {?} element
- * @param {?} selector
- * @param {?} multi
- * @return {?}
- */
- MockAnimationDriver.prototype.query = /**
- * @param {?} element
- * @param {?} selector
- * @param {?} multi
- * @return {?}
- */
- function (element, selector, multi) {
- return invokeQuery(element, selector, multi);
- };
- /**
- * @param {?} element
- * @param {?} prop
- * @param {?=} defaultValue
- * @return {?}
- */
- MockAnimationDriver.prototype.computeStyle = /**
- * @param {?} element
- * @param {?} prop
- * @param {?=} defaultValue
- * @return {?}
- */
- function (element, prop, defaultValue) {
- return defaultValue || '';
- };
- /**
- * @param {?} element
- * @param {?} keyframes
- * @param {?} duration
- * @param {?} delay
- * @param {?} easing
- * @param {?=} previousPlayers
- * @return {?}
- */
- MockAnimationDriver.prototype.animate = /**
- * @param {?} element
- * @param {?} keyframes
- * @param {?} duration
- * @param {?} delay
- * @param {?} easing
- * @param {?=} previousPlayers
- * @return {?}
- */
- function (element, keyframes, duration, delay, easing, previousPlayers) {
- if (previousPlayers === void 0) { previousPlayers = []; }
- var /** @type {?} */ player = new MockAnimationPlayer(element, keyframes, duration, delay, easing, previousPlayers);
- MockAnimationDriver.log.push(/** @type {?} */ (player));
- return player;
- };
- MockAnimationDriver.log = [];
- return MockAnimationDriver;
- }());
- /**
- * \@experimental Animation support is experimental.
- */
- var MockAnimationPlayer = /** @class */ (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 = {};
- if (allowPreviousPlayerStylesMerge(duration, delay)) {
- previousPlayers.forEach(function (player) {
- if (player instanceof MockAnimationPlayer) {
- var /** @type {?} */ 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 */
- /**
- * @param {?} fn
- * @return {?}
- */
- MockAnimationPlayer.prototype.onInit = /**
- * @param {?} fn
- * @return {?}
- */
- function (fn) { this._onInitFns.push(fn); };
- /* @internal */
- /**
- * @return {?}
- */
- MockAnimationPlayer.prototype.init = /**
- * @return {?}
- */
- function () {
- _super.prototype.init.call(this);
- this._onInitFns.forEach(function (fn) { return fn(); });
- this._onInitFns = [];
- };
- /**
- * @return {?}
- */
- MockAnimationPlayer.prototype.finish = /**
- * @return {?}
- */
- function () {
- _super.prototype.finish.call(this);
- this.__finished = true;
- };
- /**
- * @return {?}
- */
- MockAnimationPlayer.prototype.destroy = /**
- * @return {?}
- */
- function () {
- _super.prototype.destroy.call(this);
- this.__finished = true;
- };
- /* @internal */
- /**
- * @return {?}
- */
- MockAnimationPlayer.prototype.triggerMicrotask = /**
- * @return {?}
- */
- function () { };
- /**
- * @return {?}
- */
- MockAnimationPlayer.prototype.play = /**
- * @return {?}
- */
- function () {
- _super.prototype.play.call(this);
- this.__started = true;
- };
- /**
- * @return {?}
- */
- MockAnimationPlayer.prototype.hasStarted = /**
- * @return {?}
- */
- function () { return this.__started; };
- /**
- * @return {?}
- */
- MockAnimationPlayer.prototype.beforeDestroy = /**
- * @return {?}
- */
- function () {
- var _this = this;
- var /** @type {?} */ 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
|