Front end of the Slack clone application.

platform-browser-animations.umd.js 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915
  1. /**
  2. * @license Angular v5.2.11
  3. * (c) 2010-2018 Google, Inc. https://angular.io/
  4. * License: MIT
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/platform-browser'), require('@angular/animations'), require('@angular/animations/browser')) :
  8. typeof define === 'function' && define.amd ? define('@angular/platform-browser/animations', ['exports', '@angular/core', '@angular/platform-browser', '@angular/animations', '@angular/animations/browser'], factory) :
  9. (factory((global.ng = global.ng || {}, global.ng.platformBrowser = global.ng.platformBrowser || {}, global.ng.platformBrowser.animations = {}),global.ng.core,global.ng.platformBrowser,global.ng.animations,global.ng.animations.browser));
  10. }(this, (function (exports,_angular_core,_angular_platformBrowser,_angular_animations,_angular_animations_browser) { 'use strict';
  11. /*! *****************************************************************************
  12. Copyright (c) Microsoft Corporation. All rights reserved.
  13. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  14. this file except in compliance with the License. You may obtain a copy of the
  15. License at http://www.apache.org/licenses/LICENSE-2.0
  16. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  18. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  19. MERCHANTABLITY OR NON-INFRINGEMENT.
  20. See the Apache Version 2.0 License for specific language governing permissions
  21. and limitations under the License.
  22. ***************************************************************************** */
  23. /* global Reflect, Promise */
  24. var extendStatics = Object.setPrototypeOf ||
  25. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  26. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  27. function __extends(d, b) {
  28. extendStatics(d, b);
  29. function __() { this.constructor = d; }
  30. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  31. }
  32. /**
  33. * @license Angular v5.2.11
  34. * (c) 2010-2018 Google, Inc. https://angular.io/
  35. * License: MIT
  36. */
  37. /**
  38. * @fileoverview added by tsickle
  39. * @suppress {checkTypes} checked by tsc
  40. */
  41. var BrowserAnimationBuilder = /** @class */ (function (_super) {
  42. __extends(BrowserAnimationBuilder, _super);
  43. function BrowserAnimationBuilder(rootRenderer, doc) {
  44. var _this = _super.call(this) || this;
  45. _this._nextAnimationId = 0;
  46. var /** @type {?} */ typeData = /** @type {?} */ ({
  47. id: '0',
  48. encapsulation: _angular_core.ViewEncapsulation.None,
  49. styles: [],
  50. data: { animation: [] }
  51. });
  52. _this._renderer = /** @type {?} */ (rootRenderer.createRenderer(doc.body, typeData));
  53. return _this;
  54. }
  55. /**
  56. * @param {?} animation
  57. * @return {?}
  58. */
  59. BrowserAnimationBuilder.prototype.build = /**
  60. * @param {?} animation
  61. * @return {?}
  62. */
  63. function (animation) {
  64. var /** @type {?} */ id = this._nextAnimationId.toString();
  65. this._nextAnimationId++;
  66. var /** @type {?} */ entry = Array.isArray(animation) ? _angular_animations.sequence(animation) : animation;
  67. issueAnimationCommand(this._renderer, null, id, 'register', [entry]);
  68. return new BrowserAnimationFactory(id, this._renderer);
  69. };
  70. BrowserAnimationBuilder.decorators = [
  71. { type: _angular_core.Injectable },
  72. ];
  73. /** @nocollapse */
  74. BrowserAnimationBuilder.ctorParameters = function () { return [
  75. { type: _angular_core.RendererFactory2, },
  76. { type: undefined, decorators: [{ type: _angular_core.Inject, args: [_angular_platformBrowser.DOCUMENT,] },] },
  77. ]; };
  78. return BrowserAnimationBuilder;
  79. }(_angular_animations.AnimationBuilder));
  80. var BrowserAnimationFactory = /** @class */ (function (_super) {
  81. __extends(BrowserAnimationFactory, _super);
  82. function BrowserAnimationFactory(_id, _renderer) {
  83. var _this = _super.call(this) || this;
  84. _this._id = _id;
  85. _this._renderer = _renderer;
  86. return _this;
  87. }
  88. /**
  89. * @param {?} element
  90. * @param {?=} options
  91. * @return {?}
  92. */
  93. BrowserAnimationFactory.prototype.create = /**
  94. * @param {?} element
  95. * @param {?=} options
  96. * @return {?}
  97. */
  98. function (element, options) {
  99. return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer);
  100. };
  101. return BrowserAnimationFactory;
  102. }(_angular_animations.AnimationFactory));
  103. var RendererAnimationPlayer = /** @class */ (function () {
  104. function RendererAnimationPlayer(id, element, options, _renderer) {
  105. this.id = id;
  106. this.element = element;
  107. this._renderer = _renderer;
  108. this.parentPlayer = null;
  109. this._started = false;
  110. this.totalTime = 0;
  111. this._command('create', options);
  112. }
  113. /**
  114. * @param {?} eventName
  115. * @param {?} callback
  116. * @return {?}
  117. */
  118. RendererAnimationPlayer.prototype._listen = /**
  119. * @param {?} eventName
  120. * @param {?} callback
  121. * @return {?}
  122. */
  123. function (eventName, callback) {
  124. return this._renderer.listen(this.element, "@@" + this.id + ":" + eventName, callback);
  125. };
  126. /**
  127. * @param {?} command
  128. * @param {...?} args
  129. * @return {?}
  130. */
  131. RendererAnimationPlayer.prototype._command = /**
  132. * @param {?} command
  133. * @param {...?} args
  134. * @return {?}
  135. */
  136. function (command) {
  137. var args = [];
  138. for (var _i = 1; _i < arguments.length; _i++) {
  139. args[_i - 1] = arguments[_i];
  140. }
  141. return issueAnimationCommand(this._renderer, this.element, this.id, command, args);
  142. };
  143. /**
  144. * @param {?} fn
  145. * @return {?}
  146. */
  147. RendererAnimationPlayer.prototype.onDone = /**
  148. * @param {?} fn
  149. * @return {?}
  150. */
  151. function (fn) { this._listen('done', fn); };
  152. /**
  153. * @param {?} fn
  154. * @return {?}
  155. */
  156. RendererAnimationPlayer.prototype.onStart = /**
  157. * @param {?} fn
  158. * @return {?}
  159. */
  160. function (fn) { this._listen('start', fn); };
  161. /**
  162. * @param {?} fn
  163. * @return {?}
  164. */
  165. RendererAnimationPlayer.prototype.onDestroy = /**
  166. * @param {?} fn
  167. * @return {?}
  168. */
  169. function (fn) { this._listen('destroy', fn); };
  170. /**
  171. * @return {?}
  172. */
  173. RendererAnimationPlayer.prototype.init = /**
  174. * @return {?}
  175. */
  176. function () { this._command('init'); };
  177. /**
  178. * @return {?}
  179. */
  180. RendererAnimationPlayer.prototype.hasStarted = /**
  181. * @return {?}
  182. */
  183. function () { return this._started; };
  184. /**
  185. * @return {?}
  186. */
  187. RendererAnimationPlayer.prototype.play = /**
  188. * @return {?}
  189. */
  190. function () {
  191. this._command('play');
  192. this._started = true;
  193. };
  194. /**
  195. * @return {?}
  196. */
  197. RendererAnimationPlayer.prototype.pause = /**
  198. * @return {?}
  199. */
  200. function () { this._command('pause'); };
  201. /**
  202. * @return {?}
  203. */
  204. RendererAnimationPlayer.prototype.restart = /**
  205. * @return {?}
  206. */
  207. function () { this._command('restart'); };
  208. /**
  209. * @return {?}
  210. */
  211. RendererAnimationPlayer.prototype.finish = /**
  212. * @return {?}
  213. */
  214. function () { this._command('finish'); };
  215. /**
  216. * @return {?}
  217. */
  218. RendererAnimationPlayer.prototype.destroy = /**
  219. * @return {?}
  220. */
  221. function () { this._command('destroy'); };
  222. /**
  223. * @return {?}
  224. */
  225. RendererAnimationPlayer.prototype.reset = /**
  226. * @return {?}
  227. */
  228. function () { this._command('reset'); };
  229. /**
  230. * @param {?} p
  231. * @return {?}
  232. */
  233. RendererAnimationPlayer.prototype.setPosition = /**
  234. * @param {?} p
  235. * @return {?}
  236. */
  237. function (p) { this._command('setPosition', p); };
  238. /**
  239. * @return {?}
  240. */
  241. RendererAnimationPlayer.prototype.getPosition = /**
  242. * @return {?}
  243. */
  244. function () { return 0; };
  245. return RendererAnimationPlayer;
  246. }());
  247. /**
  248. * @param {?} renderer
  249. * @param {?} element
  250. * @param {?} id
  251. * @param {?} command
  252. * @param {?} args
  253. * @return {?}
  254. */
  255. function issueAnimationCommand(renderer, element, id, command, args) {
  256. return renderer.setProperty(element, "@@" + id + ":" + command, args);
  257. }
  258. /**
  259. * @fileoverview added by tsickle
  260. * @suppress {checkTypes} checked by tsc
  261. */
  262. var ANIMATION_PREFIX = '@';
  263. var DISABLE_ANIMATIONS_FLAG = '@.disabled';
  264. var AnimationRendererFactory = /** @class */ (function () {
  265. function AnimationRendererFactory(delegate, engine, _zone) {
  266. this.delegate = delegate;
  267. this.engine = engine;
  268. this._zone = _zone;
  269. this._currentId = 0;
  270. this._microtaskId = 1;
  271. this._animationCallbacksBuffer = [];
  272. this._rendererCache = new Map();
  273. this._cdRecurDepth = 0;
  274. this.promise = Promise.resolve(0);
  275. engine.onRemovalComplete = function (element, delegate) {
  276. // Note: if an component element has a leave animation, and the component
  277. // a host leave animation, the view engine will call `removeChild` for the parent
  278. // component renderer as well as for the child component renderer.
  279. // Therefore, we need to check if we already removed the element.
  280. if (delegate && delegate.parentNode(element)) {
  281. delegate.removeChild(element.parentNode, element);
  282. }
  283. };
  284. }
  285. /**
  286. * @param {?} hostElement
  287. * @param {?} type
  288. * @return {?}
  289. */
  290. AnimationRendererFactory.prototype.createRenderer = /**
  291. * @param {?} hostElement
  292. * @param {?} type
  293. * @return {?}
  294. */
  295. function (hostElement, type) {
  296. var _this = this;
  297. var /** @type {?} */ EMPTY_NAMESPACE_ID = '';
  298. // cache the delegates to find out which cached delegate can
  299. // be used by which cached renderer
  300. var /** @type {?} */ delegate = this.delegate.createRenderer(hostElement, type);
  301. if (!hostElement || !type || !type.data || !type.data['animation']) {
  302. var /** @type {?} */ renderer = this._rendererCache.get(delegate);
  303. if (!renderer) {
  304. renderer = new BaseAnimationRenderer(EMPTY_NAMESPACE_ID, delegate, this.engine);
  305. // only cache this result when the base renderer is used
  306. this._rendererCache.set(delegate, renderer);
  307. }
  308. return renderer;
  309. }
  310. var /** @type {?} */ componentId = type.id;
  311. var /** @type {?} */ namespaceId = type.id + '-' + this._currentId;
  312. this._currentId++;
  313. this.engine.register(namespaceId, hostElement);
  314. var /** @type {?} */ animationTriggers = /** @type {?} */ (type.data['animation']);
  315. animationTriggers.forEach(function (trigger) {
  316. return _this.engine.registerTrigger(componentId, namespaceId, hostElement, trigger.name, trigger);
  317. });
  318. return new AnimationRenderer(this, namespaceId, delegate, this.engine);
  319. };
  320. /**
  321. * @return {?}
  322. */
  323. AnimationRendererFactory.prototype.begin = /**
  324. * @return {?}
  325. */
  326. function () {
  327. this._cdRecurDepth++;
  328. if (this.delegate.begin) {
  329. this.delegate.begin();
  330. }
  331. };
  332. /**
  333. * @return {?}
  334. */
  335. AnimationRendererFactory.prototype._scheduleCountTask = /**
  336. * @return {?}
  337. */
  338. function () {
  339. var _this = this;
  340. // always use promise to schedule microtask instead of use Zone
  341. this.promise.then(function () { _this._microtaskId++; });
  342. };
  343. /* @internal */
  344. /**
  345. * @param {?} count
  346. * @param {?} fn
  347. * @param {?} data
  348. * @return {?}
  349. */
  350. AnimationRendererFactory.prototype.scheduleListenerCallback = /**
  351. * @param {?} count
  352. * @param {?} fn
  353. * @param {?} data
  354. * @return {?}
  355. */
  356. function (count, fn, data) {
  357. var _this = this;
  358. if (count >= 0 && count < this._microtaskId) {
  359. this._zone.run(function () { return fn(data); });
  360. return;
  361. }
  362. if (this._animationCallbacksBuffer.length == 0) {
  363. Promise.resolve(null).then(function () {
  364. _this._zone.run(function () {
  365. _this._animationCallbacksBuffer.forEach(function (tuple) {
  366. var fn = tuple[0], data = tuple[1];
  367. fn(data);
  368. });
  369. _this._animationCallbacksBuffer = [];
  370. });
  371. });
  372. }
  373. this._animationCallbacksBuffer.push([fn, data]);
  374. };
  375. /**
  376. * @return {?}
  377. */
  378. AnimationRendererFactory.prototype.end = /**
  379. * @return {?}
  380. */
  381. function () {
  382. var _this = this;
  383. this._cdRecurDepth--;
  384. // this is to prevent animations from running twice when an inner
  385. // component does CD when a parent component insted has inserted it
  386. if (this._cdRecurDepth == 0) {
  387. this._zone.runOutsideAngular(function () {
  388. _this._scheduleCountTask();
  389. _this.engine.flush(_this._microtaskId);
  390. });
  391. }
  392. if (this.delegate.end) {
  393. this.delegate.end();
  394. }
  395. };
  396. /**
  397. * @return {?}
  398. */
  399. AnimationRendererFactory.prototype.whenRenderingDone = /**
  400. * @return {?}
  401. */
  402. function () { return this.engine.whenRenderingDone(); };
  403. AnimationRendererFactory.decorators = [
  404. { type: _angular_core.Injectable },
  405. ];
  406. /** @nocollapse */
  407. AnimationRendererFactory.ctorParameters = function () { return [
  408. { type: _angular_core.RendererFactory2, },
  409. { type: _angular_animations_browser.ɵAnimationEngine, },
  410. { type: _angular_core.NgZone, },
  411. ]; };
  412. return AnimationRendererFactory;
  413. }());
  414. var BaseAnimationRenderer = /** @class */ (function () {
  415. function BaseAnimationRenderer(namespaceId, delegate, engine) {
  416. this.namespaceId = namespaceId;
  417. this.delegate = delegate;
  418. this.engine = engine;
  419. this.destroyNode = this.delegate.destroyNode ? function (n) { return ((delegate.destroyNode))(n); } : null;
  420. }
  421. Object.defineProperty(BaseAnimationRenderer.prototype, "data", {
  422. get: /**
  423. * @return {?}
  424. */
  425. function () { return this.delegate.data; },
  426. enumerable: true,
  427. configurable: true
  428. });
  429. /**
  430. * @return {?}
  431. */
  432. BaseAnimationRenderer.prototype.destroy = /**
  433. * @return {?}
  434. */
  435. function () {
  436. this.engine.destroy(this.namespaceId, this.delegate);
  437. this.delegate.destroy();
  438. };
  439. /**
  440. * @param {?} name
  441. * @param {?=} namespace
  442. * @return {?}
  443. */
  444. BaseAnimationRenderer.prototype.createElement = /**
  445. * @param {?} name
  446. * @param {?=} namespace
  447. * @return {?}
  448. */
  449. function (name, namespace) {
  450. return this.delegate.createElement(name, namespace);
  451. };
  452. /**
  453. * @param {?} value
  454. * @return {?}
  455. */
  456. BaseAnimationRenderer.prototype.createComment = /**
  457. * @param {?} value
  458. * @return {?}
  459. */
  460. function (value) { return this.delegate.createComment(value); };
  461. /**
  462. * @param {?} value
  463. * @return {?}
  464. */
  465. BaseAnimationRenderer.prototype.createText = /**
  466. * @param {?} value
  467. * @return {?}
  468. */
  469. function (value) { return this.delegate.createText(value); };
  470. /**
  471. * @param {?} parent
  472. * @param {?} newChild
  473. * @return {?}
  474. */
  475. BaseAnimationRenderer.prototype.appendChild = /**
  476. * @param {?} parent
  477. * @param {?} newChild
  478. * @return {?}
  479. */
  480. function (parent, newChild) {
  481. this.delegate.appendChild(parent, newChild);
  482. this.engine.onInsert(this.namespaceId, newChild, parent, false);
  483. };
  484. /**
  485. * @param {?} parent
  486. * @param {?} newChild
  487. * @param {?} refChild
  488. * @return {?}
  489. */
  490. BaseAnimationRenderer.prototype.insertBefore = /**
  491. * @param {?} parent
  492. * @param {?} newChild
  493. * @param {?} refChild
  494. * @return {?}
  495. */
  496. function (parent, newChild, refChild) {
  497. this.delegate.insertBefore(parent, newChild, refChild);
  498. this.engine.onInsert(this.namespaceId, newChild, parent, true);
  499. };
  500. /**
  501. * @param {?} parent
  502. * @param {?} oldChild
  503. * @return {?}
  504. */
  505. BaseAnimationRenderer.prototype.removeChild = /**
  506. * @param {?} parent
  507. * @param {?} oldChild
  508. * @return {?}
  509. */
  510. function (parent, oldChild) {
  511. this.engine.onRemove(this.namespaceId, oldChild, this.delegate);
  512. };
  513. /**
  514. * @param {?} selectorOrNode
  515. * @return {?}
  516. */
  517. BaseAnimationRenderer.prototype.selectRootElement = /**
  518. * @param {?} selectorOrNode
  519. * @return {?}
  520. */
  521. function (selectorOrNode) { return this.delegate.selectRootElement(selectorOrNode); };
  522. /**
  523. * @param {?} node
  524. * @return {?}
  525. */
  526. BaseAnimationRenderer.prototype.parentNode = /**
  527. * @param {?} node
  528. * @return {?}
  529. */
  530. function (node) { return this.delegate.parentNode(node); };
  531. /**
  532. * @param {?} node
  533. * @return {?}
  534. */
  535. BaseAnimationRenderer.prototype.nextSibling = /**
  536. * @param {?} node
  537. * @return {?}
  538. */
  539. function (node) { return this.delegate.nextSibling(node); };
  540. /**
  541. * @param {?} el
  542. * @param {?} name
  543. * @param {?} value
  544. * @param {?=} namespace
  545. * @return {?}
  546. */
  547. BaseAnimationRenderer.prototype.setAttribute = /**
  548. * @param {?} el
  549. * @param {?} name
  550. * @param {?} value
  551. * @param {?=} namespace
  552. * @return {?}
  553. */
  554. function (el, name, value, namespace) {
  555. this.delegate.setAttribute(el, name, value, namespace);
  556. };
  557. /**
  558. * @param {?} el
  559. * @param {?} name
  560. * @param {?=} namespace
  561. * @return {?}
  562. */
  563. BaseAnimationRenderer.prototype.removeAttribute = /**
  564. * @param {?} el
  565. * @param {?} name
  566. * @param {?=} namespace
  567. * @return {?}
  568. */
  569. function (el, name, namespace) {
  570. this.delegate.removeAttribute(el, name, namespace);
  571. };
  572. /**
  573. * @param {?} el
  574. * @param {?} name
  575. * @return {?}
  576. */
  577. BaseAnimationRenderer.prototype.addClass = /**
  578. * @param {?} el
  579. * @param {?} name
  580. * @return {?}
  581. */
  582. function (el, name) { this.delegate.addClass(el, name); };
  583. /**
  584. * @param {?} el
  585. * @param {?} name
  586. * @return {?}
  587. */
  588. BaseAnimationRenderer.prototype.removeClass = /**
  589. * @param {?} el
  590. * @param {?} name
  591. * @return {?}
  592. */
  593. function (el, name) { this.delegate.removeClass(el, name); };
  594. /**
  595. * @param {?} el
  596. * @param {?} style
  597. * @param {?} value
  598. * @param {?=} flags
  599. * @return {?}
  600. */
  601. BaseAnimationRenderer.prototype.setStyle = /**
  602. * @param {?} el
  603. * @param {?} style
  604. * @param {?} value
  605. * @param {?=} flags
  606. * @return {?}
  607. */
  608. function (el, style, value, flags) {
  609. this.delegate.setStyle(el, style, value, flags);
  610. };
  611. /**
  612. * @param {?} el
  613. * @param {?} style
  614. * @param {?=} flags
  615. * @return {?}
  616. */
  617. BaseAnimationRenderer.prototype.removeStyle = /**
  618. * @param {?} el
  619. * @param {?} style
  620. * @param {?=} flags
  621. * @return {?}
  622. */
  623. function (el, style, flags) {
  624. this.delegate.removeStyle(el, style, flags);
  625. };
  626. /**
  627. * @param {?} el
  628. * @param {?} name
  629. * @param {?} value
  630. * @return {?}
  631. */
  632. BaseAnimationRenderer.prototype.setProperty = /**
  633. * @param {?} el
  634. * @param {?} name
  635. * @param {?} value
  636. * @return {?}
  637. */
  638. function (el, name, value) {
  639. if (name.charAt(0) == ANIMATION_PREFIX && name == DISABLE_ANIMATIONS_FLAG) {
  640. this.disableAnimations(el, !!value);
  641. }
  642. else {
  643. this.delegate.setProperty(el, name, value);
  644. }
  645. };
  646. /**
  647. * @param {?} node
  648. * @param {?} value
  649. * @return {?}
  650. */
  651. BaseAnimationRenderer.prototype.setValue = /**
  652. * @param {?} node
  653. * @param {?} value
  654. * @return {?}
  655. */
  656. function (node, value) { this.delegate.setValue(node, value); };
  657. /**
  658. * @param {?} target
  659. * @param {?} eventName
  660. * @param {?} callback
  661. * @return {?}
  662. */
  663. BaseAnimationRenderer.prototype.listen = /**
  664. * @param {?} target
  665. * @param {?} eventName
  666. * @param {?} callback
  667. * @return {?}
  668. */
  669. function (target, eventName, callback) {
  670. return this.delegate.listen(target, eventName, callback);
  671. };
  672. /**
  673. * @param {?} element
  674. * @param {?} value
  675. * @return {?}
  676. */
  677. BaseAnimationRenderer.prototype.disableAnimations = /**
  678. * @param {?} element
  679. * @param {?} value
  680. * @return {?}
  681. */
  682. function (element, value) {
  683. this.engine.disableAnimations(element, value);
  684. };
  685. return BaseAnimationRenderer;
  686. }());
  687. var AnimationRenderer = /** @class */ (function (_super) {
  688. __extends(AnimationRenderer, _super);
  689. function AnimationRenderer(factory, namespaceId, delegate, engine) {
  690. var _this = _super.call(this, namespaceId, delegate, engine) || this;
  691. _this.factory = factory;
  692. _this.namespaceId = namespaceId;
  693. return _this;
  694. }
  695. /**
  696. * @param {?} el
  697. * @param {?} name
  698. * @param {?} value
  699. * @return {?}
  700. */
  701. AnimationRenderer.prototype.setProperty = /**
  702. * @param {?} el
  703. * @param {?} name
  704. * @param {?} value
  705. * @return {?}
  706. */
  707. function (el, name, value) {
  708. if (name.charAt(0) == ANIMATION_PREFIX) {
  709. if (name.charAt(1) == '.' && name == DISABLE_ANIMATIONS_FLAG) {
  710. value = value === undefined ? true : !!value;
  711. this.disableAnimations(el, /** @type {?} */ (value));
  712. }
  713. else {
  714. this.engine.process(this.namespaceId, el, name.substr(1), value);
  715. }
  716. }
  717. else {
  718. this.delegate.setProperty(el, name, value);
  719. }
  720. };
  721. /**
  722. * @param {?} target
  723. * @param {?} eventName
  724. * @param {?} callback
  725. * @return {?}
  726. */
  727. AnimationRenderer.prototype.listen = /**
  728. * @param {?} target
  729. * @param {?} eventName
  730. * @param {?} callback
  731. * @return {?}
  732. */
  733. function (target, eventName, callback) {
  734. var _this = this;
  735. if (eventName.charAt(0) == ANIMATION_PREFIX) {
  736. var /** @type {?} */ element = resolveElementFromTarget(target);
  737. var /** @type {?} */ name_1 = eventName.substr(1);
  738. var /** @type {?} */ phase = '';
  739. // @listener.phase is for trigger animation callbacks
  740. // @@listener is for animation builder callbacks
  741. if (name_1.charAt(0) != ANIMATION_PREFIX) {
  742. _a = parseTriggerCallbackName(name_1), name_1 = _a[0], phase = _a[1];
  743. }
  744. return this.engine.listen(this.namespaceId, element, name_1, phase, function (event) {
  745. var /** @type {?} */ countId = (/** @type {?} */ (event))['_data'] || -1;
  746. _this.factory.scheduleListenerCallback(countId, callback, event);
  747. });
  748. }
  749. return this.delegate.listen(target, eventName, callback);
  750. var _a;
  751. };
  752. return AnimationRenderer;
  753. }(BaseAnimationRenderer));
  754. /**
  755. * @param {?} target
  756. * @return {?}
  757. */
  758. function resolveElementFromTarget(target) {
  759. switch (target) {
  760. case 'body':
  761. return document.body;
  762. case 'document':
  763. return document;
  764. case 'window':
  765. return window;
  766. default:
  767. return target;
  768. }
  769. }
  770. /**
  771. * @param {?} triggerName
  772. * @return {?}
  773. */
  774. function parseTriggerCallbackName(triggerName) {
  775. var /** @type {?} */ dotIndex = triggerName.indexOf('.');
  776. var /** @type {?} */ trigger = triggerName.substring(0, dotIndex);
  777. var /** @type {?} */ phase = triggerName.substr(dotIndex + 1);
  778. return [trigger, phase];
  779. }
  780. /**
  781. * @fileoverview added by tsickle
  782. * @suppress {checkTypes} checked by tsc
  783. */
  784. /**
  785. * @license
  786. * Copyright Google Inc. All Rights Reserved.
  787. *
  788. * Use of this source code is governed by an MIT-style license that can be
  789. * found in the LICENSE file at https://angular.io/license
  790. */
  791. var InjectableAnimationEngine = /** @class */ (function (_super) {
  792. __extends(InjectableAnimationEngine, _super);
  793. function InjectableAnimationEngine(driver, normalizer) {
  794. return _super.call(this, driver, normalizer) || this;
  795. }
  796. InjectableAnimationEngine.decorators = [
  797. { type: _angular_core.Injectable },
  798. ];
  799. /** @nocollapse */
  800. InjectableAnimationEngine.ctorParameters = function () { return [
  801. { type: _angular_animations_browser.AnimationDriver, },
  802. { type: _angular_animations_browser.ɵAnimationStyleNormalizer, },
  803. ]; };
  804. return InjectableAnimationEngine;
  805. }(_angular_animations_browser.ɵAnimationEngine));
  806. /**
  807. * @return {?}
  808. */
  809. function instantiateSupportedAnimationDriver() {
  810. if (_angular_animations_browser.ɵsupportsWebAnimations()) {
  811. return new _angular_animations_browser.ɵWebAnimationsDriver();
  812. }
  813. return new _angular_animations_browser.ɵNoopAnimationDriver();
  814. }
  815. /**
  816. * @return {?}
  817. */
  818. function instantiateDefaultStyleNormalizer() {
  819. return new _angular_animations_browser.ɵWebAnimationsStyleNormalizer();
  820. }
  821. /**
  822. * @param {?} renderer
  823. * @param {?} engine
  824. * @param {?} zone
  825. * @return {?}
  826. */
  827. function instantiateRendererFactory(renderer, engine, zone) {
  828. return new AnimationRendererFactory(renderer, engine, zone);
  829. }
  830. var SHARED_ANIMATION_PROVIDERS = [
  831. { provide: _angular_animations.AnimationBuilder, useClass: BrowserAnimationBuilder },
  832. { provide: _angular_animations_browser.ɵAnimationStyleNormalizer, useFactory: instantiateDefaultStyleNormalizer },
  833. { provide: _angular_animations_browser.ɵAnimationEngine, useClass: InjectableAnimationEngine }, {
  834. provide: _angular_core.RendererFactory2,
  835. useFactory: instantiateRendererFactory,
  836. deps: [_angular_platformBrowser.ɵDomRendererFactory2, _angular_animations_browser.ɵAnimationEngine, _angular_core.NgZone]
  837. }
  838. ];
  839. /**
  840. * Separate providers from the actual module so that we can do a local modification in Google3 to
  841. * include them in the BrowserModule.
  842. */
  843. var BROWSER_ANIMATIONS_PROVIDERS = [
  844. { provide: _angular_animations_browser.AnimationDriver, useFactory: instantiateSupportedAnimationDriver }
  845. ].concat(SHARED_ANIMATION_PROVIDERS);
  846. /**
  847. * Separate providers from the actual module so that we can do a local modification in Google3 to
  848. * include them in the BrowserTestingModule.
  849. */
  850. var BROWSER_NOOP_ANIMATIONS_PROVIDERS = [{ provide: _angular_animations_browser.AnimationDriver, useClass: _angular_animations_browser.ɵNoopAnimationDriver }].concat(SHARED_ANIMATION_PROVIDERS);
  851. /**
  852. * @fileoverview added by tsickle
  853. * @suppress {checkTypes} checked by tsc
  854. */
  855. /**
  856. * \@experimental Animation support is experimental.
  857. */
  858. var BrowserAnimationsModule = /** @class */ (function () {
  859. function BrowserAnimationsModule() {
  860. }
  861. BrowserAnimationsModule.decorators = [
  862. { type: _angular_core.NgModule, args: [{
  863. exports: [_angular_platformBrowser.BrowserModule],
  864. providers: BROWSER_ANIMATIONS_PROVIDERS,
  865. },] },
  866. ];
  867. /** @nocollapse */
  868. BrowserAnimationsModule.ctorParameters = function () { return []; };
  869. return BrowserAnimationsModule;
  870. }());
  871. /**
  872. * \@experimental Animation support is experimental.
  873. */
  874. var NoopAnimationsModule = /** @class */ (function () {
  875. function NoopAnimationsModule() {
  876. }
  877. NoopAnimationsModule.decorators = [
  878. { type: _angular_core.NgModule, args: [{
  879. exports: [_angular_platformBrowser.BrowserModule],
  880. providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS,
  881. },] },
  882. ];
  883. /** @nocollapse */
  884. NoopAnimationsModule.ctorParameters = function () { return []; };
  885. return NoopAnimationsModule;
  886. }());
  887. exports.BrowserAnimationsModule = BrowserAnimationsModule;
  888. exports.NoopAnimationsModule = NoopAnimationsModule;
  889. exports.ɵBrowserAnimationBuilder = BrowserAnimationBuilder;
  890. exports.ɵBrowserAnimationFactory = BrowserAnimationFactory;
  891. exports.ɵAnimationRenderer = AnimationRenderer;
  892. exports.ɵAnimationRendererFactory = AnimationRendererFactory;
  893. exports.ɵa = BaseAnimationRenderer;
  894. exports.ɵf = BROWSER_ANIMATIONS_PROVIDERS;
  895. exports.ɵg = BROWSER_NOOP_ANIMATIONS_PROVIDERS;
  896. exports.ɵb = InjectableAnimationEngine;
  897. exports.ɵd = instantiateDefaultStyleNormalizer;
  898. exports.ɵe = instantiateRendererFactory;
  899. exports.ɵc = instantiateSupportedAnimationDriver;
  900. Object.defineProperty(exports, '__esModule', { value: true });
  901. })));
  902. //# sourceMappingURL=platform-browser-animations.umd.js.map