@angular/router 12.2.0-rc.0 → 12.2.3

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,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.2.0-rc.0
2
+ * @license Angular v12.2.3
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.2.0-rc.0
2
+ * @license Angular v12.2.3
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.2.0-rc.0
2
+ * @license Angular v12.2.3
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -4650,6 +4650,11 @@
4650
4650
  t.extractedUrl.toString() !== _this.browserUrlTree.toString();
4651
4651
  var processCurrentUrl = (_this.onSameUrlNavigation === 'reload' ? true : urlTransition) &&
4652
4652
  _this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl);
4653
+ // If the source of the navigation is from a browser event, the URL is
4654
+ // already updated. We already need to sync the internal state.
4655
+ if (isBrowserTriggeredNavigation(t.source)) {
4656
+ _this.browserUrlTree = t.rawUrl;
4657
+ }
4653
4658
  if (processCurrentUrl) {
4654
4659
  return rxjs.of(t).pipe(
4655
4660
  // Fire NavigationStart event
@@ -4881,7 +4886,12 @@
4881
4886
  var mergedTree = _this.urlHandlingStrategy.merge(e.url, _this.rawUrlTree);
4882
4887
  var extras = {
4883
4888
  skipLocationChange: t.extras.skipLocationChange,
4884
- replaceUrl: _this.urlUpdateStrategy === 'eager'
4889
+ // The URL is already updated at this point if we have 'eager' URL
4890
+ // updates or if the navigation was triggered by the browser (back
4891
+ // button, URL bar, etc). We want to replace that item in history if
4892
+ // the navigation is rejected.
4893
+ replaceUrl: _this.urlUpdateStrategy === 'eager' ||
4894
+ isBrowserTriggeredNavigation(t.source)
4885
4895
  };
4886
4896
  _this.scheduleNavigation(mergedTree, 'imperative', null, extras, { resolve: t.resolve, reject: t.reject, promise: t.promise });
4887
4897
  }, 0);
@@ -5267,7 +5277,8 @@
5267
5277
  var lastNavigation = this.getTransition();
5268
5278
  // We don't want to skip duplicate successful navs if they're imperative because
5269
5279
  // onSameUrlNavigation could be 'reload' (so the duplicate is intended).
5270
- var browserNavPrecededByRouterNav = source !== 'imperative' && (lastNavigation === null || lastNavigation === void 0 ? void 0 : lastNavigation.source) === 'imperative';
5280
+ var browserNavPrecededByRouterNav = isBrowserTriggeredNavigation(source) && lastNavigation &&
5281
+ !isBrowserTriggeredNavigation(lastNavigation.source);
5271
5282
  var lastNavigationSucceeded = this.lastSuccessfulId === lastNavigation.id;
5272
5283
  // If the last navigation succeeded or is in flight, we can use the rawUrl as the comparison.
5273
5284
  // However, if it failed, we should compare to the final result (urlAfterRedirects).
@@ -5438,6 +5449,9 @@
5438
5449
  }
5439
5450
  }
5440
5451
  }
5452
+ function isBrowserTriggeredNavigation(source) {
5453
+ return source !== 'imperative';
5454
+ }
5441
5455
 
5442
5456
  /**
5443
5457
  * @license
@@ -5889,7 +5903,7 @@
5889
5903
  });
5890
5904
  };
5891
5905
  RouterLinkActive.prototype.isLinkActive = function (router) {
5892
- var options = 'paths' in this.routerLinkActiveOptions ?
5906
+ var options = isActiveMatchOptions(this.routerLinkActiveOptions) ?
5893
5907
  this.routerLinkActiveOptions :
5894
5908
  // While the types should disallow `undefined` here, it's possible without strict inputs
5895
5909
  (this.routerLinkActiveOptions.exact || false);
@@ -5923,6 +5937,12 @@
5923
5937
  routerLinkActiveOptions: [{ type: core.Input }],
5924
5938
  routerLinkActive: [{ type: core.Input }]
5925
5939
  };
5940
+ /**
5941
+ * Use instead of `'paths' in options` to be compatible with property renaming
5942
+ */
5943
+ function isActiveMatchOptions(options) {
5944
+ return !!options.paths;
5945
+ }
5926
5946
 
5927
5947
  /**
5928
5948
  * @license
@@ -6727,7 +6747,7 @@
6727
6747
  /**
6728
6748
  * @publicApi
6729
6749
  */
6730
- var VERSION = new core.Version('12.2.0-rc.0');
6750
+ var VERSION = new core.Version('12.2.3');
6731
6751
 
6732
6752
  /**
6733
6753
  * @license