@angular/animations 4.2.0 → 4.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import * as tslib_1 from "tslib";
2
2
  /**
3
- * @license Angular v4.2.0
3
+ * @license Angular v4.2.4
4
4
  * (c) 2010-2017 Google, Inc. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v4.2.0
2
+ * @license Angular v4.2.4
3
3
  * (c) 2010-2017 Google, Inc. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import * as tslib_1 from "tslib";
2
2
  /**
3
- * @license Angular v4.2.0
3
+ * @license Angular v4.2.4
4
4
  * (c) 2010-2017 Google, Inc. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -450,12 +450,6 @@ function dashCaseToCamelCase(input) {
450
450
  return m[1].toUpperCase();
451
451
  });
452
452
  }
453
- /**
454
- * @license
455
- * Copyright Google Inc. All Rights Reserved.
456
- *
457
- * Use of this source code is governed by an MIT-style license that can be
458
- * found in the LICENSE file at https://angular.io/license
459
453
  /**
460
454
  * @license
461
455
  * Copyright Google Inc. All Rights Reserved.
@@ -3719,16 +3713,19 @@ var TransitionAnimationEngine = (function () {
3719
3713
  // the :enter queries match the elements (since the timeline queries
3720
3714
  // are fired during instruction building).
3721
3715
  var /** @type {?} */ bodyNode = getBodyNode();
3722
- var /** @type {?} */ allEnterNodes = this.collectedEnterElements;
3723
- var /** @type {?} */ enterNodes = allEnterNodes.length ? collectEnterElements(this.driver, allEnterNodes) : [];
3724
- var /** @type {?} */ leaveNodes = [];
3716
+ var /** @type {?} */ allEnterNodes = this.collectedEnterElements.length ?
3717
+ collectEnterElements(this.driver, this.collectedEnterElements) :
3718
+ [];
3719
+ var /** @type {?} */ allLeaveNodes = [];
3720
+ var /** @type {?} */ leaveNodesWithoutAnimations = [];
3725
3721
  for (var /** @type {?} */ i = 0; i < this.collectedLeaveElements.length; i++) {
3726
3722
  var /** @type {?} */ element = this.collectedLeaveElements[i];
3727
- if (isElementNode(element)) {
3728
- var /** @type {?} */ details = (element[REMOVAL_FLAG]);
3729
- if (details && details.setForRemoval) {
3730
- addClass(element, LEAVE_CLASSNAME);
3731
- leaveNodes.push(element);
3723
+ var /** @type {?} */ details = (element[REMOVAL_FLAG]);
3724
+ if (details && details.setForRemoval) {
3725
+ addClass(element, LEAVE_CLASSNAME);
3726
+ allLeaveNodes.push(element);
3727
+ if (!details.hasAnimation) {
3728
+ leaveNodesWithoutAnimations.push(element);
3732
3729
  }
3733
3730
  }
3734
3731
  }
@@ -3782,6 +3779,15 @@ var TransitionAnimationEngine = (function () {
3782
3779
  });
3783
3780
  });
3784
3781
  }
3782
+ // these can only be detected here since we have a map of all the elements
3783
+ // that have animations attached to them...
3784
+ var /** @type {?} */ enterNodesWithoutAnimations = [];
3785
+ for (var /** @type {?} */ i = 0; i < allEnterNodes.length; i++) {
3786
+ var /** @type {?} */ element = allEnterNodes[i];
3787
+ if (!subTimelines.has(element)) {
3788
+ enterNodesWithoutAnimations.push(element);
3789
+ }
3790
+ }
3785
3791
  var /** @type {?} */ allPreviousPlayersMap = new Map();
3786
3792
  var /** @type {?} */ sortedParentElements = [];
3787
3793
  queuedInstructions.forEach(function (entry) {
@@ -3799,10 +3805,10 @@ var TransitionAnimationEngine = (function () {
3799
3805
  allPreviousPlayersMap.forEach(function (players) { return players.forEach(function (player) { return player.destroy(); }); });
3800
3806
  // PRE STAGE: fill the ! styles
3801
3807
  var /** @type {?} */ preStylesMap = allPreStyleElements.size ?
3802
- cloakAndComputeStyles(this.driver, enterNodes, allPreStyleElements, ɵPRE_STYLE) :
3808
+ cloakAndComputeStyles(this.driver, enterNodesWithoutAnimations, allPreStyleElements, ɵPRE_STYLE) :
3803
3809
  new Map();
3804
3810
  // POST STAGE: fill the * styles
3805
- var /** @type {?} */ postStylesMap = cloakAndComputeStyles(this.driver, leaveNodes, allPostStyleElements, AUTO_STYLE);
3811
+ var /** @type {?} */ postStylesMap = cloakAndComputeStyles(this.driver, leaveNodesWithoutAnimations, allPostStyleElements, AUTO_STYLE);
3806
3812
  var /** @type {?} */ rootPlayers = [];
3807
3813
  var /** @type {?} */ subPlayers = [];
3808
3814
  queuedInstructions.forEach(function (entry) {
@@ -3860,8 +3866,8 @@ var TransitionAnimationEngine = (function () {
3860
3866
  // run through all of the queued removals and see if they
3861
3867
  // were picked up by a query. If not then perform the removal
3862
3868
  // operation right away unless a parent animation is ongoing.
3863
- for (var /** @type {?} */ i = 0; i < leaveNodes.length; i++) {
3864
- var /** @type {?} */ element = leaveNodes[i];
3869
+ for (var /** @type {?} */ i = 0; i < allLeaveNodes.length; i++) {
3870
+ var /** @type {?} */ element = allLeaveNodes[i];
3865
3871
  var /** @type {?} */ players = queriedElements.get(element);
3866
3872
  if (players) {
3867
3873
  removeNodesAfterAnimationDone(this, element, players);
@@ -3882,7 +3888,7 @@ var TransitionAnimationEngine = (function () {
3882
3888
  });
3883
3889
  player.play();
3884
3890
  });
3885
- enterNodes.forEach(function (element) { return removeClass(element, ENTER_CLASSNAME); });
3891
+ allEnterNodes.forEach(function (element) { return removeClass(element, ENTER_CLASSNAME); });
3886
3892
  return rootPlayers;
3887
3893
  };
3888
3894
  /**
@@ -4254,7 +4260,7 @@ function normalizeTriggerValue(value) {
4254
4260
  case 'boolean':
4255
4261
  return value ? '1' : '0';
4256
4262
  default:
4257
- return value ? value.toString() : null;
4263
+ return value != null ? value.toString() : null;
4258
4264
  }
4259
4265
  }
4260
4266
  /**
@@ -4293,27 +4299,51 @@ function filterNodeClasses(driver, rootElement, selector) {
4293
4299
  return rootElements;
4294
4300
  var /** @type {?} */ cursor = rootElement;
4295
4301
  var /** @type {?} */ nextCursor = {};
4302
+ var /** @type {?} */ potentialCursorStack = [];
4296
4303
  do {
4297
- nextCursor = driver.query(cursor, selector, false)[0];
4304
+ // 1. query from root
4305
+ nextCursor = cursor ? driver.query(cursor, selector, false)[0] : null;
4306
+ // this is used to avoid the extra matchesElement call when we
4307
+ // know that the element does match based it on being queried
4308
+ var /** @type {?} */ justQueried = !!nextCursor;
4298
4309
  if (!nextCursor) {
4299
- cursor = cursor.parentElement;
4300
- if (!cursor)
4301
- break;
4302
- nextCursor = cursor = cursor.nextElementSibling;
4310
+ var /** @type {?} */ nextPotentialCursor = potentialCursorStack.pop();
4311
+ if (nextPotentialCursor) {
4312
+ // 1a)
4313
+ nextCursor = nextPotentialCursor;
4314
+ }
4315
+ else {
4316
+ cursor = cursor.parentElement;
4317
+ // 1b)
4318
+ if (!cursor)
4319
+ break;
4320
+ // 1c)
4321
+ nextCursor = cursor = cursor.nextElementSibling;
4322
+ continue;
4323
+ }
4303
4324
  }
4304
- else {
4305
- while (nextCursor && driver.matchesElement(nextCursor, selector)) {
4306
- rootElements.push(nextCursor);
4307
- nextCursor = nextCursor.nextElementSibling;
4308
- if (nextCursor) {
4309
- cursor = nextCursor;
4310
- }
4311
- else {
4312
- cursor = cursor.parentElement;
4313
- if (!cursor)
4314
- break;
4315
- nextCursor = cursor = cursor.nextElementSibling;
4316
- }
4325
+ // 2. visit the next node
4326
+ while (nextCursor) {
4327
+ var /** @type {?} */ matches = justQueried || driver.matchesElement(nextCursor, selector);
4328
+ justQueried = false;
4329
+ var /** @type {?} */ nextPotentialCursor = nextCursor.nextElementSibling;
4330
+ // 2a)
4331
+ if (!matches) {
4332
+ potentialCursorStack.push(nextPotentialCursor);
4333
+ cursor = nextCursor;
4334
+ break;
4335
+ }
4336
+ // 2b)
4337
+ rootElements.push(nextCursor);
4338
+ nextCursor = nextPotentialCursor;
4339
+ if (nextCursor) {
4340
+ cursor = nextCursor;
4341
+ }
4342
+ else {
4343
+ cursor = cursor.parentElement;
4344
+ if (!cursor)
4345
+ break;
4346
+ nextCursor = cursor = cursor.nextElementSibling;
4317
4347
  }
4318
4348
  }
4319
4349
  } while (nextCursor && nextCursor !== rootElement);