@angular/router 10.0.9 → 10.0.10

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.
@@ -14,5 +14,5 @@ import { Version } from '@angular/core';
14
14
  /**
15
15
  * @publicApi
16
16
  */
17
- export const VERSION = new Version('10.0.9');
17
+ export const VERSION = new Version('10.0.10');
18
18
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3JvdXRlci9zcmMvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSDs7OztHQUlHO0FBRUgsT0FBTyxFQUFDLE9BQU8sRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUV0Qzs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLE9BQU8sR0FBRyxJQUFJLE9BQU8sQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbi8qKlxuICogQG1vZHVsZVxuICogQGRlc2NyaXB0aW9uXG4gKiBFbnRyeSBwb2ludCBmb3IgYWxsIHB1YmxpYyBBUElzIG9mIHRoZSBjb21tb24gcGFja2FnZS5cbiAqL1xuXG5pbXBvcnQge1ZlcnNpb259IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuXG4vKipcbiAqIEBwdWJsaWNBcGlcbiAqL1xuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBuZXcgVmVyc2lvbignMC4wLjAtUExBQ0VIT0xERVInKTtcbiJdfQ==
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v10.0.9
2
+ * @license Angular v10.0.10
3
3
  * (c) 2010-2020 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -4061,7 +4061,7 @@ class Router {
4061
4061
  this.navigated = false;
4062
4062
  this.lastSuccessfulId = -1;
4063
4063
  }
4064
- /** @docsNotRequired */
4064
+ /** @nodoc */
4065
4065
  ngOnDestroy() {
4066
4066
  this.dispose();
4067
4067
  }
@@ -4469,10 +4469,18 @@ class RouterLink {
4469
4469
  this.router = router;
4470
4470
  this.route = route;
4471
4471
  this.commands = [];
4472
+ /** @internal */
4473
+ this.onChanges = new Subject();
4472
4474
  if (tabIndex == null) {
4473
4475
  renderer.setAttribute(el.nativeElement, 'tabindex', '0');
4474
4476
  }
4475
4477
  }
4478
+ /** @nodoc */
4479
+ ngOnChanges(changes) {
4480
+ // This is subscribed to by `RouterLinkActive` so that it knows to update when there are changes
4481
+ // to the RouterLinks it's tracking.
4482
+ this.onChanges.next();
4483
+ }
4476
4484
  /**
4477
4485
  * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
4478
4486
  * - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
@@ -4497,6 +4505,7 @@ class RouterLink {
4497
4505
  }
4498
4506
  this.preserve = value;
4499
4507
  }
4508
+ /** @nodoc */
4500
4509
  onClick() {
4501
4510
  const extras = {
4502
4511
  skipLocationChange: attrBoolValue(this.skipLocationChange),
@@ -4556,6 +4565,8 @@ class RouterLinkWithHref {
4556
4565
  this.route = route;
4557
4566
  this.locationStrategy = locationStrategy;
4558
4567
  this.commands = [];
4568
+ /** @internal */
4569
+ this.onChanges = new Subject();
4559
4570
  this.subscription = router.events.subscribe((s) => {
4560
4571
  if (s instanceof NavigationEnd) {
4561
4572
  this.updateTargetUrlAndHref();
@@ -4586,12 +4597,16 @@ class RouterLinkWithHref {
4586
4597
  }
4587
4598
  this.preserve = value;
4588
4599
  }
4600
+ /** @nodoc */
4589
4601
  ngOnChanges(changes) {
4590
4602
  this.updateTargetUrlAndHref();
4603
+ this.onChanges.next();
4591
4604
  }
4605
+ /** @nodoc */
4592
4606
  ngOnDestroy() {
4593
4607
  this.subscription.unsubscribe();
4594
4608
  }
4609
+ /** @nodoc */
4595
4610
  onClick(button, ctrlKey, metaKey, shiftKey) {
4596
4611
  if (button !== 0 || ctrlKey || metaKey || shiftKey) {
4597
4612
  return true;
@@ -4724,26 +4739,44 @@ class RouterLinkActive {
4724
4739
  this.classes = [];
4725
4740
  this.isActive = false;
4726
4741
  this.routerLinkActiveOptions = { exact: false };
4727
- this.subscription = router.events.subscribe((s) => {
4742
+ this.routerEventsSubscription = router.events.subscribe((s) => {
4728
4743
  if (s instanceof NavigationEnd) {
4729
4744
  this.update();
4730
4745
  }
4731
4746
  });
4732
4747
  }
4748
+ /** @nodoc */
4733
4749
  ngAfterContentInit() {
4734
- this.links.changes.subscribe(_ => this.update());
4735
- this.linksWithHrefs.changes.subscribe(_ => this.update());
4736
- this.update();
4750
+ // `of(null)` is used to force subscribe body to execute once immediately (like `startWith`).
4751
+ from([this.links.changes, this.linksWithHrefs.changes, of(null)])
4752
+ .pipe(mergeAll())
4753
+ .subscribe(_ => {
4754
+ this.update();
4755
+ this.subscribeToEachLinkOnChanges();
4756
+ });
4757
+ }
4758
+ subscribeToEachLinkOnChanges() {
4759
+ var _a;
4760
+ (_a = this.linkInputChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
4761
+ const allLinkChanges = [...this.links.toArray(), ...this.linksWithHrefs.toArray(), this.link, this.linkWithHref]
4762
+ .filter((link) => !!link)
4763
+ .map(link => link.onChanges);
4764
+ this.linkInputChangesSubscription =
4765
+ from(allLinkChanges).pipe(mergeAll()).subscribe(() => this.update());
4737
4766
  }
4738
4767
  set routerLinkActive(data) {
4739
4768
  const classes = Array.isArray(data) ? data : data.split(' ');
4740
4769
  this.classes = classes.filter(c => !!c);
4741
4770
  }
4771
+ /** @nodoc */
4742
4772
  ngOnChanges(changes) {
4743
4773
  this.update();
4744
4774
  }
4775
+ /** @nodoc */
4745
4776
  ngOnDestroy() {
4746
- this.subscription.unsubscribe();
4777
+ var _a;
4778
+ this.routerEventsSubscription.unsubscribe();
4779
+ (_a = this.linkInputChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
4747
4780
  }
4748
4781
  update() {
4749
4782
  if (!this.links || !this.linksWithHrefs || !this.router.navigated)
@@ -4861,9 +4894,11 @@ class RouterOutlet {
4861
4894
  this.name = name || PRIMARY_OUTLET;
4862
4895
  parentContexts.onChildOutletCreated(this.name, this);
4863
4896
  }
4897
+ /** @nodoc */
4864
4898
  ngOnDestroy() {
4865
4899
  this.parentContexts.onChildOutletDestroyed(this.name);
4866
4900
  }
4901
+ /** @nodoc */
4867
4902
  ngOnInit() {
4868
4903
  if (!this.activated) {
4869
4904
  // If the outlet was not instantiated at the time the route got activated we need to populate
@@ -5055,6 +5090,7 @@ class RouterPreloader {
5055
5090
  const ngModule = this.injector.get(NgModuleRef);
5056
5091
  return this.processRoutes(ngModule, this.router.config);
5057
5092
  }
5093
+ /** @nodoc */
5058
5094
  ngOnDestroy() {
5059
5095
  if (this.subscription) {
5060
5096
  this.subscription.unsubscribe();
@@ -5172,6 +5208,7 @@ class RouterScroller {
5172
5208
  scheduleScrollEvent(routerEvent, anchor) {
5173
5209
  this.router.triggerEvent(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor));
5174
5210
  }
5211
+ /** @nodoc */
5175
5212
  ngOnDestroy() {
5176
5213
  if (this.routerEventsSubscription) {
5177
5214
  this.routerEventsSubscription.unsubscribe();
@@ -5542,7 +5579,7 @@ function provideRouterInitializer() {
5542
5579
  /**
5543
5580
  * @publicApi
5544
5581
  */
5545
- const VERSION = new Version('10.0.9');
5582
+ const VERSION = new Version('10.0.10');
5546
5583
 
5547
5584
  /**
5548
5585
  * @license