@angular/router 15.0.0-next.4 → 15.0.0-next.6
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.
- package/esm2020/src/components/empty_outlet.mjs +3 -3
- package/esm2020/src/deprecated_load_children.mjs +11 -0
- package/esm2020/src/directives/router_link.mjs +86 -178
- package/esm2020/src/directives/router_link_active.mjs +10 -18
- package/esm2020/src/directives/router_outlet.mjs +59 -31
- package/esm2020/src/index.mjs +1 -1
- package/esm2020/src/models.mjs +1 -1
- package/esm2020/src/page_title_strategy.mjs +6 -6
- package/esm2020/src/patchable_relative_link_resolution.mjs +1 -1
- package/esm2020/src/private_export.mjs +1 -1
- package/esm2020/src/provide_router.mjs +4 -4
- package/esm2020/src/router.mjs +7 -11
- package/esm2020/src/router_config.mjs +1 -1
- package/esm2020/src/router_config_loader.mjs +23 -6
- package/esm2020/src/router_module.mjs +7 -7
- package/esm2020/src/router_outlet_context.mjs +3 -3
- package/esm2020/src/router_preloader.mjs +9 -9
- package/esm2020/src/router_scroller.mjs +3 -3
- package/esm2020/src/url_tree.mjs +3 -3
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/router_testing_module.mjs +9 -11
- package/fesm2015/router.mjs +220 -277
- package/fesm2015/router.mjs.map +1 -1
- package/fesm2015/testing.mjs +9 -11
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/upgrade.mjs +1 -1
- package/fesm2020/router.mjs +216 -273
- package/fesm2020/router.mjs.map +1 -1
- package/fesm2020/testing.mjs +9 -11
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/upgrade.mjs +1 -1
- package/index.d.ts +88 -178
- package/package.json +5 -5
- package/testing/index.d.ts +1 -1
- package/upgrade/index.d.ts +1 -1
- package/esm2020/testing/src/provide_router_for_testing.mjs +0 -51
package/fesm2015/router.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.0-next.
|
|
2
|
+
* @license Angular v15.0.0-next.6
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { ɵisObservable, ɵisPromise, ɵRuntimeError, Injectable, EventEmitter, Directive,
|
|
8
|
+
import { ɵisObservable, ɵisPromise, ɵRuntimeError, Injectable, EventEmitter, inject, ViewContainerRef, ChangeDetectorRef, EnvironmentInjector, Directive, Input, Output, Component, createEnvironmentInjector, ɵisStandalone, ComponentFactoryResolver, ɵisInjectable, InjectionToken, InjectFlags, NgModuleFactory, Injector, Compiler, NgModuleRef, ɵConsole, NgZone, ɵcoerceToBoolean, ɵɵsanitizeUrlOrResourceUrl, Attribute, HostBinding, HostListener, Optional, ContentChildren, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, ApplicationRef, APP_INITIALIZER, ENVIRONMENT_INITIALIZER, NgProbeToken, SkipSelf, NgModule, Inject, Version } from '@angular/core';
|
|
9
9
|
import { from, of, BehaviorSubject, EmptyError, combineLatest, concat, defer, pipe, throwError, Observable, EMPTY, ConnectableObservable, Subject } from 'rxjs';
|
|
10
10
|
import * as i3 from '@angular/common';
|
|
11
11
|
import { Location, ViewportScroller, LOCATION_INITIALIZED, LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common';
|
|
@@ -461,9 +461,9 @@ function mapChildrenIntoArray(segment, fn) {
|
|
|
461
461
|
*/
|
|
462
462
|
class UrlSerializer {
|
|
463
463
|
}
|
|
464
|
-
UrlSerializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
465
|
-
UrlSerializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
466
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
464
|
+
UrlSerializer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: UrlSerializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
465
|
+
UrlSerializer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: UrlSerializer, providedIn: 'root', useFactory: () => new DefaultUrlSerializer() });
|
|
466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: UrlSerializer, decorators: [{
|
|
467
467
|
type: Injectable,
|
|
468
468
|
args: [{ providedIn: 'root', useFactory: () => new DefaultUrlSerializer() }]
|
|
469
469
|
}] });
|
|
@@ -2394,9 +2394,9 @@ class ChildrenOutletContexts {
|
|
|
2394
2394
|
return this.contexts.get(childName) || null;
|
|
2395
2395
|
}
|
|
2396
2396
|
}
|
|
2397
|
-
ChildrenOutletContexts.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2398
|
-
ChildrenOutletContexts.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2399
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2397
|
+
ChildrenOutletContexts.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: ChildrenOutletContexts, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2398
|
+
ChildrenOutletContexts.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: ChildrenOutletContexts, providedIn: 'root' });
|
|
2399
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: ChildrenOutletContexts, decorators: [{
|
|
2400
2400
|
type: Injectable,
|
|
2401
2401
|
args: [{ providedIn: 'root' }]
|
|
2402
2402
|
}] });
|
|
@@ -2461,13 +2461,15 @@ const NG_DEV_MODE$7 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
|
2461
2461
|
* @publicApi
|
|
2462
2462
|
*/
|
|
2463
2463
|
class RouterOutlet {
|
|
2464
|
-
constructor(
|
|
2465
|
-
this.parentContexts = parentContexts;
|
|
2466
|
-
this.location = location;
|
|
2467
|
-
this.changeDetector = changeDetector;
|
|
2468
|
-
this.environmentInjector = environmentInjector;
|
|
2464
|
+
constructor() {
|
|
2469
2465
|
this.activated = null;
|
|
2470
2466
|
this._activatedRoute = null;
|
|
2467
|
+
/**
|
|
2468
|
+
* The name of the outlet
|
|
2469
|
+
*
|
|
2470
|
+
* @see [named outlets](guide/router-tutorial-toh#displaying-multiple-routes-in-named-outlets)
|
|
2471
|
+
*/
|
|
2472
|
+
this.name = PRIMARY_OUTLET;
|
|
2471
2473
|
this.activateEvents = new EventEmitter();
|
|
2472
2474
|
this.deactivateEvents = new EventEmitter();
|
|
2473
2475
|
/**
|
|
@@ -2480,32 +2482,60 @@ class RouterOutlet {
|
|
|
2480
2482
|
* subtree.
|
|
2481
2483
|
*/
|
|
2482
2484
|
this.detachEvents = new EventEmitter();
|
|
2483
|
-
this.
|
|
2484
|
-
|
|
2485
|
+
this.parentContexts = inject(ChildrenOutletContexts);
|
|
2486
|
+
this.location = inject(ViewContainerRef);
|
|
2487
|
+
this.changeDetector = inject(ChangeDetectorRef);
|
|
2488
|
+
this.environmentInjector = inject(EnvironmentInjector);
|
|
2489
|
+
}
|
|
2490
|
+
/** @nodoc */
|
|
2491
|
+
ngOnChanges(changes) {
|
|
2492
|
+
if (changes['name']) {
|
|
2493
|
+
const { firstChange, previousValue } = changes['name'];
|
|
2494
|
+
if (firstChange) {
|
|
2495
|
+
// The first change is handled by ngOnInit. Because ngOnChanges doesn't get called when no
|
|
2496
|
+
// input is set at all, we need to centrally handle the first change there.
|
|
2497
|
+
return;
|
|
2498
|
+
}
|
|
2499
|
+
// unregister with the old name
|
|
2500
|
+
if (this.isTrackedInParentContexts(previousValue)) {
|
|
2501
|
+
this.deactivate();
|
|
2502
|
+
this.parentContexts.onChildOutletDestroyed(previousValue);
|
|
2503
|
+
}
|
|
2504
|
+
// register the new name
|
|
2505
|
+
this.initializeOutletWithName();
|
|
2506
|
+
}
|
|
2485
2507
|
}
|
|
2486
2508
|
/** @nodoc */
|
|
2487
2509
|
ngOnDestroy() {
|
|
2488
|
-
var _a;
|
|
2489
2510
|
// Ensure that the registered outlet is this one before removing it on the context.
|
|
2490
|
-
if (
|
|
2511
|
+
if (this.isTrackedInParentContexts(this.name)) {
|
|
2491
2512
|
this.parentContexts.onChildOutletDestroyed(this.name);
|
|
2492
2513
|
}
|
|
2493
2514
|
}
|
|
2515
|
+
isTrackedInParentContexts(outletName) {
|
|
2516
|
+
var _a;
|
|
2517
|
+
return ((_a = this.parentContexts.getContext(outletName)) === null || _a === void 0 ? void 0 : _a.outlet) === this;
|
|
2518
|
+
}
|
|
2494
2519
|
/** @nodoc */
|
|
2495
2520
|
ngOnInit() {
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2521
|
+
this.initializeOutletWithName();
|
|
2522
|
+
}
|
|
2523
|
+
initializeOutletWithName() {
|
|
2524
|
+
this.parentContexts.onChildOutletCreated(this.name, this);
|
|
2525
|
+
if (this.activated) {
|
|
2526
|
+
return;
|
|
2527
|
+
}
|
|
2528
|
+
// If the outlet was not instantiated at the time the route got activated we need to populate
|
|
2529
|
+
// the outlet when it is initialized (ie inside a NgIf)
|
|
2530
|
+
const context = this.parentContexts.getContext(this.name);
|
|
2531
|
+
if (context === null || context === void 0 ? void 0 : context.route) {
|
|
2532
|
+
if (context.attachRef) {
|
|
2533
|
+
// `attachRef` is populated when there is an existing component to mount
|
|
2534
|
+
this.attach(context.attachRef, context.route);
|
|
2535
|
+
}
|
|
2536
|
+
else {
|
|
2537
|
+
// otherwise the component defined in the configuration is created
|
|
2538
|
+
this.activateWith(context.route, context.injector);
|
|
2509
2539
|
}
|
|
2510
2540
|
}
|
|
2511
2541
|
}
|
|
@@ -2587,21 +2617,18 @@ class RouterOutlet {
|
|
|
2587
2617
|
this.activateEvents.emit(this.activated.instance);
|
|
2588
2618
|
}
|
|
2589
2619
|
}
|
|
2590
|
-
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2591
|
-
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
2592
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2620
|
+
RouterOutlet.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2621
|
+
RouterOutlet.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: RouterOutlet, isStandalone: true, selector: "router-outlet", inputs: { name: "name" }, outputs: { activateEvents: "activate", deactivateEvents: "deactivate", attachEvents: "attach", detachEvents: "detach" }, exportAs: ["outlet"], usesOnChanges: true, ngImport: i0 });
|
|
2622
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterOutlet, decorators: [{
|
|
2593
2623
|
type: Directive,
|
|
2594
2624
|
args: [{
|
|
2595
2625
|
selector: 'router-outlet',
|
|
2596
2626
|
exportAs: 'outlet',
|
|
2597
2627
|
standalone: true,
|
|
2598
2628
|
}]
|
|
2599
|
-
}],
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
args: ['name']
|
|
2603
|
-
}] }, { type: i0.ChangeDetectorRef }, { type: i0.EnvironmentInjector }];
|
|
2604
|
-
}, propDecorators: { activateEvents: [{
|
|
2629
|
+
}], propDecorators: { name: [{
|
|
2630
|
+
type: Input
|
|
2631
|
+
}], activateEvents: [{
|
|
2605
2632
|
type: Output,
|
|
2606
2633
|
args: ['activate']
|
|
2607
2634
|
}], deactivateEvents: [{
|
|
@@ -2652,9 +2679,9 @@ function isComponentFactoryResolver(item) {
|
|
|
2652
2679
|
*/
|
|
2653
2680
|
class ɵEmptyOutletComponent {
|
|
2654
2681
|
}
|
|
2655
|
-
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2656
|
-
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
2657
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
2682
|
+
ɵEmptyOutletComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: ɵEmptyOutletComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2683
|
+
ɵEmptyOutletComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0-next.6", type: ɵEmptyOutletComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `<router-outlet></router-outlet>`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
|
|
2684
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: ɵEmptyOutletComponent, decorators: [{
|
|
2658
2685
|
type: Component,
|
|
2659
2686
|
args: [{
|
|
2660
2687
|
template: `<router-outlet></router-outlet>`,
|
|
@@ -4356,9 +4383,9 @@ class TitleStrategy {
|
|
|
4356
4383
|
return snapshot.data[RouteTitleKey];
|
|
4357
4384
|
}
|
|
4358
4385
|
}
|
|
4359
|
-
TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4360
|
-
TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4386
|
+
TitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: TitleStrategy, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4387
|
+
TitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: TitleStrategy, providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) });
|
|
4388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: TitleStrategy, decorators: [{
|
|
4362
4389
|
type: Injectable,
|
|
4363
4390
|
args: [{ providedIn: 'root', useFactory: () => inject(DefaultTitleStrategy) }]
|
|
4364
4391
|
}] });
|
|
@@ -4382,9 +4409,9 @@ class DefaultTitleStrategy extends TitleStrategy {
|
|
|
4382
4409
|
}
|
|
4383
4410
|
}
|
|
4384
4411
|
}
|
|
4385
|
-
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4386
|
-
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4387
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4412
|
+
DefaultTitleStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: DefaultTitleStrategy, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4413
|
+
DefaultTitleStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: DefaultTitleStrategy, providedIn: 'root' });
|
|
4414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: DefaultTitleStrategy, decorators: [{
|
|
4388
4415
|
type: Injectable,
|
|
4389
4416
|
args: [{ providedIn: 'root' }]
|
|
4390
4417
|
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
|
@@ -4484,6 +4511,17 @@ const ROUTER_CONFIGURATION = new InjectionToken(NG_DEV_MODE$4 ? 'router config'
|
|
|
4484
4511
|
factory: () => ({}),
|
|
4485
4512
|
});
|
|
4486
4513
|
|
|
4514
|
+
/**
|
|
4515
|
+
* @license
|
|
4516
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4517
|
+
*
|
|
4518
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
4519
|
+
* found in the LICENSE file at https://angular.io/license
|
|
4520
|
+
*/
|
|
4521
|
+
function deprecatedLoadChildrenString(injector, loadChildren) {
|
|
4522
|
+
return null;
|
|
4523
|
+
}
|
|
4524
|
+
|
|
4487
4525
|
/**
|
|
4488
4526
|
* @license
|
|
4489
4527
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -4521,7 +4559,7 @@ class RouterConfigLoader {
|
|
|
4521
4559
|
this.onLoadStartListener(route);
|
|
4522
4560
|
}
|
|
4523
4561
|
const loadRunner = wrapIntoObservable(route.loadComponent())
|
|
4524
|
-
.pipe(tap(component => {
|
|
4562
|
+
.pipe(map(maybeUnwrapDefaultExport), tap(component => {
|
|
4525
4563
|
var _a;
|
|
4526
4564
|
if (this.onLoadEndListener) {
|
|
4527
4565
|
this.onLoadEndListener(route);
|
|
@@ -4581,7 +4619,12 @@ class RouterConfigLoader {
|
|
|
4581
4619
|
return loader;
|
|
4582
4620
|
}
|
|
4583
4621
|
loadModuleFactoryOrRoutes(loadChildren) {
|
|
4584
|
-
|
|
4622
|
+
const deprecatedResult = deprecatedLoadChildrenString(this.injector, loadChildren);
|
|
4623
|
+
if (deprecatedResult) {
|
|
4624
|
+
return deprecatedResult;
|
|
4625
|
+
}
|
|
4626
|
+
return wrapIntoObservable(loadChildren())
|
|
4627
|
+
.pipe(map(maybeUnwrapDefaultExport), mergeMap((t) => {
|
|
4585
4628
|
if (t instanceof NgModuleFactory || Array.isArray(t)) {
|
|
4586
4629
|
return of(t);
|
|
4587
4630
|
}
|
|
@@ -4591,12 +4634,23 @@ class RouterConfigLoader {
|
|
|
4591
4634
|
}));
|
|
4592
4635
|
}
|
|
4593
4636
|
}
|
|
4594
|
-
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4595
|
-
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4596
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
4637
|
+
RouterConfigLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterConfigLoader, deps: [{ token: i0.Injector }, { token: i0.Compiler }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4638
|
+
RouterConfigLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterConfigLoader, providedIn: 'root' });
|
|
4639
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterConfigLoader, decorators: [{
|
|
4597
4640
|
type: Injectable,
|
|
4598
4641
|
args: [{ providedIn: 'root' }]
|
|
4599
4642
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.Compiler }]; } });
|
|
4643
|
+
function isWrappedDefaultExport(value) {
|
|
4644
|
+
// We use `in` here with a string key `'default'`, because we expect `DefaultExport` objects to be
|
|
4645
|
+
// dynamically imported ES modules with a spec-mandated `default` key. Thus we don't expect that
|
|
4646
|
+
// `default` will be a renamed property.
|
|
4647
|
+
return value && typeof value === 'object' && 'default' in value;
|
|
4648
|
+
}
|
|
4649
|
+
function maybeUnwrapDefaultExport(input) {
|
|
4650
|
+
// As per `isWrappedDefaultExport`, the `default` key here is generated by the browser and not
|
|
4651
|
+
// subject to property renaming, so we reference it with bracket access.
|
|
4652
|
+
return isWrappedDefaultExport(input) ? input['default'] : input;
|
|
4653
|
+
}
|
|
4600
4654
|
|
|
4601
4655
|
/**
|
|
4602
4656
|
* @license
|
|
@@ -4676,9 +4730,6 @@ function assignExtraOptionsToRouter(opts, router) {
|
|
|
4676
4730
|
if (opts.paramsInheritanceStrategy) {
|
|
4677
4731
|
router.paramsInheritanceStrategy = opts.paramsInheritanceStrategy;
|
|
4678
4732
|
}
|
|
4679
|
-
if (opts.relativeLinkResolution) {
|
|
4680
|
-
router.relativeLinkResolution = opts.relativeLinkResolution;
|
|
4681
|
-
}
|
|
4682
4733
|
if (opts.urlUpdateStrategy) {
|
|
4683
4734
|
router.urlUpdateStrategy = opts.urlUpdateStrategy;
|
|
4684
4735
|
}
|
|
@@ -4818,10 +4869,9 @@ class Router {
|
|
|
4818
4869
|
*/
|
|
4819
4870
|
this.urlUpdateStrategy = 'deferred';
|
|
4820
4871
|
/**
|
|
4821
|
-
*
|
|
4822
|
-
*
|
|
4823
|
-
*
|
|
4824
|
-
* @deprecated
|
|
4872
|
+
* TODO(atscott): Remove all references to relativeLinkResolution when internal cleanup is
|
|
4873
|
+
* finished.
|
|
4874
|
+
* @internal
|
|
4825
4875
|
*/
|
|
4826
4876
|
this.relativeLinkResolution = 'corrected';
|
|
4827
4877
|
/**
|
|
@@ -5618,9 +5668,9 @@ class Router {
|
|
|
5618
5668
|
return { navigationId };
|
|
5619
5669
|
}
|
|
5620
5670
|
}
|
|
5621
|
-
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5622
|
-
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5623
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5671
|
+
Router.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: Router, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
5672
|
+
Router.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: Router, providedIn: 'root', useFactory: setupRouter });
|
|
5673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: Router, decorators: [{
|
|
5624
5674
|
type: Injectable,
|
|
5625
5675
|
args: [{
|
|
5626
5676
|
providedIn: 'root',
|
|
@@ -5737,19 +5787,36 @@ function isBrowserTriggeredNavigation(source) {
|
|
|
5737
5787
|
* @publicApi
|
|
5738
5788
|
*/
|
|
5739
5789
|
class RouterLink {
|
|
5740
|
-
constructor(router, route, tabIndexAttribute, renderer, el) {
|
|
5790
|
+
constructor(router, route, tabIndexAttribute, renderer, el, locationStrategy) {
|
|
5741
5791
|
this.router = router;
|
|
5742
5792
|
this.route = route;
|
|
5743
5793
|
this.tabIndexAttribute = tabIndexAttribute;
|
|
5744
5794
|
this.renderer = renderer;
|
|
5745
5795
|
this.el = el;
|
|
5796
|
+
this.locationStrategy = locationStrategy;
|
|
5746
5797
|
this._preserveFragment = false;
|
|
5747
5798
|
this._skipLocationChange = false;
|
|
5748
5799
|
this._replaceUrl = false;
|
|
5800
|
+
/**
|
|
5801
|
+
* Represents an `href` attribute value applied to a host element,
|
|
5802
|
+
* when a host element is `<a>`. For other tags, the value is `null`.
|
|
5803
|
+
*/
|
|
5804
|
+
this.href = null;
|
|
5749
5805
|
this.commands = null;
|
|
5750
5806
|
/** @internal */
|
|
5751
5807
|
this.onChanges = new Subject();
|
|
5752
|
-
|
|
5808
|
+
const tagName = el.nativeElement.tagName;
|
|
5809
|
+
this.isAnchorElement = tagName === 'A' || tagName === 'AREA';
|
|
5810
|
+
if (this.isAnchorElement) {
|
|
5811
|
+
this.subscription = router.events.subscribe((s) => {
|
|
5812
|
+
if (s instanceof NavigationEnd) {
|
|
5813
|
+
this.updateHref();
|
|
5814
|
+
}
|
|
5815
|
+
});
|
|
5816
|
+
}
|
|
5817
|
+
else {
|
|
5818
|
+
this.setTabIndexIfNotOnNativeEl('0');
|
|
5819
|
+
}
|
|
5753
5820
|
}
|
|
5754
5821
|
/**
|
|
5755
5822
|
* Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
|
|
@@ -5792,20 +5859,16 @@ class RouterLink {
|
|
|
5792
5859
|
* instantiation.
|
|
5793
5860
|
*/
|
|
5794
5861
|
setTabIndexIfNotOnNativeEl(newTabIndex) {
|
|
5795
|
-
if (this.tabIndexAttribute != null /* both `null` and `undefined` */) {
|
|
5862
|
+
if (this.tabIndexAttribute != null /* both `null` and `undefined` */ || this.isAnchorElement) {
|
|
5796
5863
|
return;
|
|
5797
5864
|
}
|
|
5798
|
-
|
|
5799
|
-
const nativeElement = this.el.nativeElement;
|
|
5800
|
-
if (newTabIndex !== null) {
|
|
5801
|
-
renderer.setAttribute(nativeElement, 'tabindex', newTabIndex);
|
|
5802
|
-
}
|
|
5803
|
-
else {
|
|
5804
|
-
renderer.removeAttribute(nativeElement, 'tabindex');
|
|
5805
|
-
}
|
|
5865
|
+
this.applyAttributeValue('tabindex', newTabIndex);
|
|
5806
5866
|
}
|
|
5807
5867
|
/** @nodoc */
|
|
5808
5868
|
ngOnChanges(changes) {
|
|
5869
|
+
if (this.isAnchorElement) {
|
|
5870
|
+
this.updateHref();
|
|
5871
|
+
}
|
|
5809
5872
|
// This is subscribed to by `RouterLinkActive` so that it knows to update when there are changes
|
|
5810
5873
|
// to the RouterLinks it's tracking.
|
|
5811
5874
|
this.onChanges.next(this);
|
|
@@ -5828,17 +5891,63 @@ class RouterLink {
|
|
|
5828
5891
|
}
|
|
5829
5892
|
}
|
|
5830
5893
|
/** @nodoc */
|
|
5831
|
-
onClick() {
|
|
5894
|
+
onClick(button, ctrlKey, shiftKey, altKey, metaKey) {
|
|
5832
5895
|
if (this.urlTree === null) {
|
|
5833
5896
|
return true;
|
|
5834
5897
|
}
|
|
5898
|
+
if (this.isAnchorElement) {
|
|
5899
|
+
if (button !== 0 || ctrlKey || shiftKey || altKey || metaKey) {
|
|
5900
|
+
return true;
|
|
5901
|
+
}
|
|
5902
|
+
if (typeof this.target === 'string' && this.target != '_self') {
|
|
5903
|
+
return true;
|
|
5904
|
+
}
|
|
5905
|
+
}
|
|
5835
5906
|
const extras = {
|
|
5836
5907
|
skipLocationChange: this.skipLocationChange,
|
|
5837
5908
|
replaceUrl: this.replaceUrl,
|
|
5838
5909
|
state: this.state,
|
|
5839
5910
|
};
|
|
5840
5911
|
this.router.navigateByUrl(this.urlTree, extras);
|
|
5841
|
-
|
|
5912
|
+
// Return `false` for `<a>` elements to prevent default action
|
|
5913
|
+
// and cancel the native behavior, since the navigation is handled
|
|
5914
|
+
// by the Router.
|
|
5915
|
+
return !this.isAnchorElement;
|
|
5916
|
+
}
|
|
5917
|
+
/** @nodoc */
|
|
5918
|
+
ngOnDestroy() {
|
|
5919
|
+
var _a;
|
|
5920
|
+
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
5921
|
+
}
|
|
5922
|
+
updateHref() {
|
|
5923
|
+
var _a;
|
|
5924
|
+
this.href = this.urlTree !== null && this.locationStrategy ?
|
|
5925
|
+
(_a = this.locationStrategy) === null || _a === void 0 ? void 0 : _a.prepareExternalUrl(this.router.serializeUrl(this.urlTree)) :
|
|
5926
|
+
null;
|
|
5927
|
+
const sanitizedValue = this.href === null ?
|
|
5928
|
+
null :
|
|
5929
|
+
// This class represents a directive that can be added to both `<a>` elements,
|
|
5930
|
+
// as well as other elements. As a result, we can't define security context at
|
|
5931
|
+
// compile time. So the security context is deferred to runtime.
|
|
5932
|
+
// The `ɵɵsanitizeUrlOrResourceUrl` selects the necessary sanitizer function
|
|
5933
|
+
// based on the tag and property names. The logic mimics the one from
|
|
5934
|
+
// `packages/compiler/src/schema/dom_security_schema.ts`, which is used at compile time.
|
|
5935
|
+
//
|
|
5936
|
+
// Note: we should investigate whether we can switch to using `@HostBinding('attr.href')`
|
|
5937
|
+
// instead of applying a value via a renderer, after a final merge of the
|
|
5938
|
+
// `RouterLinkWithHref` directive.
|
|
5939
|
+
ɵɵsanitizeUrlOrResourceUrl(this.href, this.el.nativeElement.tagName.toLowerCase(), 'href');
|
|
5940
|
+
this.applyAttributeValue('href', sanitizedValue);
|
|
5941
|
+
}
|
|
5942
|
+
applyAttributeValue(attrName, attrValue) {
|
|
5943
|
+
const renderer = this.renderer;
|
|
5944
|
+
const nativeElement = this.el.nativeElement;
|
|
5945
|
+
if (attrValue !== null) {
|
|
5946
|
+
renderer.setAttribute(nativeElement, attrName, attrValue);
|
|
5947
|
+
}
|
|
5948
|
+
else {
|
|
5949
|
+
renderer.removeAttribute(nativeElement, attrName);
|
|
5950
|
+
}
|
|
5842
5951
|
}
|
|
5843
5952
|
get urlTree() {
|
|
5844
5953
|
if (this.commands === null) {
|
|
@@ -5855,175 +5964,20 @@ class RouterLink {
|
|
|
5855
5964
|
});
|
|
5856
5965
|
}
|
|
5857
5966
|
}
|
|
5858
|
-
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5859
|
-
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
5860
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
5967
|
+
RouterLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterLink, deps: [{ token: Router }, { token: ActivatedRoute }, { token: 'tabindex', attribute: true }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5968
|
+
RouterLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: RouterLink, isStandalone: true, selector: ":not(a):not(area)[routerLink],a[routerLink],area[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", relativeTo: "relativeTo", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target" } }, usesOnChanges: true, ngImport: i0 });
|
|
5969
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterLink, decorators: [{
|
|
5861
5970
|
type: Directive,
|
|
5862
5971
|
args: [{
|
|
5863
|
-
selector: ':not(a):not(area)[routerLink]',
|
|
5972
|
+
selector: ':not(a):not(area)[routerLink],a[routerLink],area[routerLink]',
|
|
5864
5973
|
standalone: true,
|
|
5865
5974
|
}]
|
|
5866
5975
|
}], ctorParameters: function () {
|
|
5867
5976
|
return [{ type: Router }, { type: ActivatedRoute }, { type: undefined, decorators: [{
|
|
5868
5977
|
type: Attribute,
|
|
5869
5978
|
args: ['tabindex']
|
|
5870
|
-
}] }, { type: i0.Renderer2 }, { type: i0.ElementRef }];
|
|
5871
|
-
}, propDecorators: {
|
|
5872
|
-
type: Input
|
|
5873
|
-
}], fragment: [{
|
|
5874
|
-
type: Input
|
|
5875
|
-
}], queryParamsHandling: [{
|
|
5876
|
-
type: Input
|
|
5877
|
-
}], state: [{
|
|
5878
|
-
type: Input
|
|
5879
|
-
}], relativeTo: [{
|
|
5880
|
-
type: Input
|
|
5881
|
-
}], preserveFragment: [{
|
|
5882
|
-
type: Input
|
|
5883
|
-
}], skipLocationChange: [{
|
|
5884
|
-
type: Input
|
|
5885
|
-
}], replaceUrl: [{
|
|
5886
|
-
type: Input
|
|
5887
|
-
}], routerLink: [{
|
|
5888
|
-
type: Input
|
|
5889
|
-
}], onClick: [{
|
|
5890
|
-
type: HostListener,
|
|
5891
|
-
args: ['click']
|
|
5892
|
-
}] } });
|
|
5893
|
-
/**
|
|
5894
|
-
* @description
|
|
5895
|
-
*
|
|
5896
|
-
* Lets you link to specific routes in your app.
|
|
5897
|
-
*
|
|
5898
|
-
* See `RouterLink` for more information.
|
|
5899
|
-
*
|
|
5900
|
-
* @ngModule RouterModule
|
|
5901
|
-
*
|
|
5902
|
-
* @publicApi
|
|
5903
|
-
*/
|
|
5904
|
-
class RouterLinkWithHref {
|
|
5905
|
-
constructor(router, route, locationStrategy) {
|
|
5906
|
-
this.router = router;
|
|
5907
|
-
this.route = route;
|
|
5908
|
-
this.locationStrategy = locationStrategy;
|
|
5909
|
-
this._preserveFragment = false;
|
|
5910
|
-
this._skipLocationChange = false;
|
|
5911
|
-
this._replaceUrl = false;
|
|
5912
|
-
this.commands = null;
|
|
5913
|
-
// the url displayed on the anchor element.
|
|
5914
|
-
// @HostBinding('attr.href') is used rather than @HostBinding() because it removes the
|
|
5915
|
-
// href attribute when it becomes `null`.
|
|
5916
|
-
this.href = null;
|
|
5917
|
-
/** @internal */
|
|
5918
|
-
this.onChanges = new Subject();
|
|
5919
|
-
this.subscription = router.events.subscribe((s) => {
|
|
5920
|
-
if (s instanceof NavigationEnd) {
|
|
5921
|
-
this.updateTargetUrlAndHref();
|
|
5922
|
-
}
|
|
5923
|
-
});
|
|
5924
|
-
}
|
|
5925
|
-
/**
|
|
5926
|
-
* Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
|
|
5927
|
-
* `UrlCreationOptions`.
|
|
5928
|
-
* @see {@link UrlCreationOptions#preserveFragment UrlCreationOptions#preserveFragment}
|
|
5929
|
-
* @see {@link Router#createUrlTree Router#createUrlTree}
|
|
5930
|
-
*/
|
|
5931
|
-
set preserveFragment(preserveFragment) {
|
|
5932
|
-
this._preserveFragment = ɵcoerceToBoolean(preserveFragment);
|
|
5933
|
-
}
|
|
5934
|
-
get preserveFragment() {
|
|
5935
|
-
return this._preserveFragment;
|
|
5936
|
-
}
|
|
5937
|
-
/**
|
|
5938
|
-
* Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the
|
|
5939
|
-
* `NavigationBehaviorOptions`.
|
|
5940
|
-
* @see {@link NavigationBehaviorOptions#skipLocationChange NavigationBehaviorOptions#skipLocationChange}
|
|
5941
|
-
* @see {@link Router#navigateByUrl Router#navigateByUrl}
|
|
5942
|
-
*/
|
|
5943
|
-
set skipLocationChange(skipLocationChange) {
|
|
5944
|
-
this._skipLocationChange = ɵcoerceToBoolean(skipLocationChange);
|
|
5945
|
-
}
|
|
5946
|
-
get skipLocationChange() {
|
|
5947
|
-
return this._skipLocationChange;
|
|
5948
|
-
}
|
|
5949
|
-
/**
|
|
5950
|
-
* Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the
|
|
5951
|
-
* `NavigationBehaviorOptions`.
|
|
5952
|
-
* @see {@link NavigationBehaviorOptions#replaceUrl NavigationBehaviorOptions#replaceUrl}
|
|
5953
|
-
* @see {@link Router#navigateByUrl Router#navigateByUrl}
|
|
5954
|
-
*/
|
|
5955
|
-
set replaceUrl(replaceUrl) {
|
|
5956
|
-
this._replaceUrl = ɵcoerceToBoolean(replaceUrl);
|
|
5957
|
-
}
|
|
5958
|
-
get replaceUrl() {
|
|
5959
|
-
return this._replaceUrl;
|
|
5960
|
-
}
|
|
5961
|
-
/**
|
|
5962
|
-
* Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
|
|
5963
|
-
* - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
|
|
5964
|
-
* - **string**: shorthand for array of commands with just the string, i.e. `['/route']`
|
|
5965
|
-
* - **null|undefined**: Disables the link by removing the `href`
|
|
5966
|
-
* @see {@link Router#createUrlTree Router#createUrlTree}
|
|
5967
|
-
*/
|
|
5968
|
-
set routerLink(commands) {
|
|
5969
|
-
if (commands != null) {
|
|
5970
|
-
this.commands = Array.isArray(commands) ? commands : [commands];
|
|
5971
|
-
}
|
|
5972
|
-
else {
|
|
5973
|
-
this.commands = null;
|
|
5974
|
-
}
|
|
5975
|
-
}
|
|
5976
|
-
/** @nodoc */
|
|
5977
|
-
ngOnChanges(changes) {
|
|
5978
|
-
this.updateTargetUrlAndHref();
|
|
5979
|
-
this.onChanges.next(this);
|
|
5980
|
-
}
|
|
5981
|
-
/** @nodoc */
|
|
5982
|
-
ngOnDestroy() {
|
|
5983
|
-
this.subscription.unsubscribe();
|
|
5984
|
-
}
|
|
5985
|
-
/** @nodoc */
|
|
5986
|
-
onClick(button, ctrlKey, shiftKey, altKey, metaKey) {
|
|
5987
|
-
if (button !== 0 || ctrlKey || shiftKey || altKey || metaKey) {
|
|
5988
|
-
return true;
|
|
5989
|
-
}
|
|
5990
|
-
if (typeof this.target === 'string' && this.target != '_self' || this.urlTree === null) {
|
|
5991
|
-
return true;
|
|
5992
|
-
}
|
|
5993
|
-
const extras = {
|
|
5994
|
-
skipLocationChange: this.skipLocationChange,
|
|
5995
|
-
replaceUrl: this.replaceUrl,
|
|
5996
|
-
state: this.state
|
|
5997
|
-
};
|
|
5998
|
-
this.router.navigateByUrl(this.urlTree, extras);
|
|
5999
|
-
return false;
|
|
6000
|
-
}
|
|
6001
|
-
updateTargetUrlAndHref() {
|
|
6002
|
-
this.href = this.urlTree !== null ?
|
|
6003
|
-
this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree)) :
|
|
6004
|
-
null;
|
|
6005
|
-
}
|
|
6006
|
-
get urlTree() {
|
|
6007
|
-
if (this.commands === null) {
|
|
6008
|
-
return null;
|
|
6009
|
-
}
|
|
6010
|
-
return this.router.createUrlTree(this.commands, {
|
|
6011
|
-
// If the `relativeTo` input is not defined, we want to use `this.route` by default.
|
|
6012
|
-
// Otherwise, we should use the value provided by the user in the input.
|
|
6013
|
-
relativeTo: this.relativeTo !== undefined ? this.relativeTo : this.route,
|
|
6014
|
-
queryParams: this.queryParams,
|
|
6015
|
-
fragment: this.fragment,
|
|
6016
|
-
queryParamsHandling: this.queryParamsHandling,
|
|
6017
|
-
preserveFragment: this.preserveFragment,
|
|
6018
|
-
});
|
|
6019
|
-
}
|
|
6020
|
-
}
|
|
6021
|
-
RouterLinkWithHref.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.4", ngImport: i0, type: RouterLinkWithHref, deps: [{ token: Router }, { token: ActivatedRoute }, { token: i3.LocationStrategy }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6022
|
-
RouterLinkWithHref.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.4", type: RouterLinkWithHref, isStandalone: true, selector: "a[routerLink],area[routerLink]", inputs: { target: "target", queryParams: "queryParams", fragment: "fragment", queryParamsHandling: "queryParamsHandling", state: "state", relativeTo: "relativeTo", preserveFragment: "preserveFragment", skipLocationChange: "skipLocationChange", replaceUrl: "replaceUrl", routerLink: "routerLink" }, host: { listeners: { "click": "onClick($event.button,$event.ctrlKey,$event.shiftKey,$event.altKey,$event.metaKey)" }, properties: { "attr.target": "this.target", "attr.href": "this.href" } }, usesOnChanges: true, ngImport: i0 });
|
|
6023
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.4", ngImport: i0, type: RouterLinkWithHref, decorators: [{
|
|
6024
|
-
type: Directive,
|
|
6025
|
-
args: [{ selector: 'a[routerLink],area[routerLink]', standalone: true }]
|
|
6026
|
-
}], ctorParameters: function () { return [{ type: Router }, { type: ActivatedRoute }, { type: i3.LocationStrategy }]; }, propDecorators: { target: [{
|
|
5979
|
+
}] }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i3.LocationStrategy }];
|
|
5980
|
+
}, propDecorators: { target: [{
|
|
6027
5981
|
type: HostBinding,
|
|
6028
5982
|
args: ['attr.target']
|
|
6029
5983
|
}, {
|
|
@@ -6038,9 +5992,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.4",
|
|
|
6038
5992
|
type: Input
|
|
6039
5993
|
}], relativeTo: [{
|
|
6040
5994
|
type: Input
|
|
6041
|
-
}], href: [{
|
|
6042
|
-
type: HostBinding,
|
|
6043
|
-
args: ['attr.href']
|
|
6044
5995
|
}], preserveFragment: [{
|
|
6045
5996
|
type: Input
|
|
6046
5997
|
}], skipLocationChange: [{
|
|
@@ -6132,13 +6083,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.4",
|
|
|
6132
6083
|
* @publicApi
|
|
6133
6084
|
*/
|
|
6134
6085
|
class RouterLinkActive {
|
|
6135
|
-
constructor(router, element, renderer, cdr, link
|
|
6086
|
+
constructor(router, element, renderer, cdr, link) {
|
|
6136
6087
|
this.router = router;
|
|
6137
6088
|
this.element = element;
|
|
6138
6089
|
this.renderer = renderer;
|
|
6139
6090
|
this.cdr = cdr;
|
|
6140
6091
|
this.link = link;
|
|
6141
|
-
this.linkWithHref = linkWithHref;
|
|
6142
6092
|
this.classes = [];
|
|
6143
6093
|
this.isActive = false;
|
|
6144
6094
|
/**
|
|
@@ -6175,7 +6125,7 @@ class RouterLinkActive {
|
|
|
6175
6125
|
/** @nodoc */
|
|
6176
6126
|
ngAfterContentInit() {
|
|
6177
6127
|
// `of(null)` is used to force subscribe body to execute once immediately (like `startWith`).
|
|
6178
|
-
of(this.links.changes,
|
|
6128
|
+
of(this.links.changes, of(null)).pipe(mergeAll()).subscribe(_ => {
|
|
6179
6129
|
this.update();
|
|
6180
6130
|
this.subscribeToEachLinkOnChanges();
|
|
6181
6131
|
});
|
|
@@ -6183,7 +6133,7 @@ class RouterLinkActive {
|
|
|
6183
6133
|
subscribeToEachLinkOnChanges() {
|
|
6184
6134
|
var _a;
|
|
6185
6135
|
(_a = this.linkInputChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
6186
|
-
const allLinkChanges = [...this.links.toArray(),
|
|
6136
|
+
const allLinkChanges = [...this.links.toArray(), this.link]
|
|
6187
6137
|
.filter((link) => !!link)
|
|
6188
6138
|
.map(link => link.onChanges);
|
|
6189
6139
|
this.linkInputChangesSubscription = from(allLinkChanges).pipe(mergeAll()).subscribe(link => {
|
|
@@ -6207,7 +6157,7 @@ class RouterLinkActive {
|
|
|
6207
6157
|
(_a = this.linkInputChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
6208
6158
|
}
|
|
6209
6159
|
update() {
|
|
6210
|
-
if (!this.links || !this.
|
|
6160
|
+
if (!this.links || !this.router.navigated)
|
|
6211
6161
|
return;
|
|
6212
6162
|
Promise.resolve().then(() => {
|
|
6213
6163
|
const hasActiveLinks = this.hasActiveLinks();
|
|
@@ -6242,14 +6192,12 @@ class RouterLinkActive {
|
|
|
6242
6192
|
}
|
|
6243
6193
|
hasActiveLinks() {
|
|
6244
6194
|
const isActiveCheckFn = this.isLinkActive(this.router);
|
|
6245
|
-
return this.link && isActiveCheckFn(this.link) ||
|
|
6246
|
-
this.linkWithHref && isActiveCheckFn(this.linkWithHref) ||
|
|
6247
|
-
this.links.some(isActiveCheckFn) || this.linksWithHrefs.some(isActiveCheckFn);
|
|
6195
|
+
return this.link && isActiveCheckFn(this.link) || this.links.some(isActiveCheckFn);
|
|
6248
6196
|
}
|
|
6249
6197
|
}
|
|
6250
|
-
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6251
|
-
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
6252
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6198
|
+
RouterLinkActive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterLinkActive, deps: [{ token: Router }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: RouterLink, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
6199
|
+
RouterLinkActive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.0-next.6", type: RouterLinkActive, isStandalone: true, selector: "[routerLinkActive]", inputs: { routerLinkActiveOptions: "routerLinkActiveOptions", ariaCurrentWhenActive: "ariaCurrentWhenActive", routerLinkActive: "routerLinkActive" }, outputs: { isActiveChange: "isActiveChange" }, queries: [{ propertyName: "links", predicate: RouterLink, descendants: true }], exportAs: ["routerLinkActive"], usesOnChanges: true, ngImport: i0 });
|
|
6200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterLinkActive, decorators: [{
|
|
6253
6201
|
type: Directive,
|
|
6254
6202
|
args: [{
|
|
6255
6203
|
selector: '[routerLinkActive]',
|
|
@@ -6259,15 +6207,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.4",
|
|
|
6259
6207
|
}], ctorParameters: function () {
|
|
6260
6208
|
return [{ type: Router }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: RouterLink, decorators: [{
|
|
6261
6209
|
type: Optional
|
|
6262
|
-
}] }, { type: RouterLinkWithHref, decorators: [{
|
|
6263
|
-
type: Optional
|
|
6264
6210
|
}] }];
|
|
6265
6211
|
}, propDecorators: { links: [{
|
|
6266
6212
|
type: ContentChildren,
|
|
6267
6213
|
args: [RouterLink, { descendants: true }]
|
|
6268
|
-
}], linksWithHrefs: [{
|
|
6269
|
-
type: ContentChildren,
|
|
6270
|
-
args: [RouterLinkWithHref, { descendants: true }]
|
|
6271
6214
|
}], routerLinkActiveOptions: [{
|
|
6272
6215
|
type: Input
|
|
6273
6216
|
}], ariaCurrentWhenActive: [{
|
|
@@ -6316,9 +6259,9 @@ class PreloadAllModules {
|
|
|
6316
6259
|
return fn().pipe(catchError(() => of(null)));
|
|
6317
6260
|
}
|
|
6318
6261
|
}
|
|
6319
|
-
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6320
|
-
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6321
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6262
|
+
PreloadAllModules.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PreloadAllModules, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6263
|
+
PreloadAllModules.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PreloadAllModules, providedIn: 'root' });
|
|
6264
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: PreloadAllModules, decorators: [{
|
|
6322
6265
|
type: Injectable,
|
|
6323
6266
|
args: [{ providedIn: 'root' }]
|
|
6324
6267
|
}] });
|
|
@@ -6336,9 +6279,9 @@ class NoPreloading {
|
|
|
6336
6279
|
return of(null);
|
|
6337
6280
|
}
|
|
6338
6281
|
}
|
|
6339
|
-
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6340
|
-
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6341
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6282
|
+
NoPreloading.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NoPreloading, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6283
|
+
NoPreloading.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NoPreloading, providedIn: 'root' });
|
|
6284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: NoPreloading, decorators: [{
|
|
6342
6285
|
type: Injectable,
|
|
6343
6286
|
args: [{ providedIn: 'root' }]
|
|
6344
6287
|
}] });
|
|
@@ -6434,9 +6377,9 @@ class RouterPreloader {
|
|
|
6434
6377
|
});
|
|
6435
6378
|
}
|
|
6436
6379
|
}
|
|
6437
|
-
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6438
|
-
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6439
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6380
|
+
RouterPreloader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterPreloader, deps: [{ token: Router }, { token: i0.Compiler }, { token: i0.EnvironmentInjector }, { token: PreloadingStrategy }, { token: RouterConfigLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6381
|
+
RouterPreloader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterPreloader, providedIn: 'root' });
|
|
6382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterPreloader, decorators: [{
|
|
6440
6383
|
type: Injectable,
|
|
6441
6384
|
args: [{ providedIn: 'root' }]
|
|
6442
6385
|
}], ctorParameters: function () { return [{ type: Router }, { type: i0.Compiler }, { type: i0.EnvironmentInjector }, { type: PreloadingStrategy }, { type: RouterConfigLoader }]; } });
|
|
@@ -6517,9 +6460,9 @@ class RouterScroller {
|
|
|
6517
6460
|
}
|
|
6518
6461
|
}
|
|
6519
6462
|
}
|
|
6520
|
-
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6521
|
-
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6522
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6463
|
+
RouterScroller.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterScroller, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
6464
|
+
RouterScroller.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterScroller });
|
|
6465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterScroller, decorators: [{
|
|
6523
6466
|
type: Injectable
|
|
6524
6467
|
}], ctorParameters: function () { return [{ type: Router }, { type: i3.ViewportScroller }, { type: undefined }]; } });
|
|
6525
6468
|
|
|
@@ -6569,7 +6512,7 @@ const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
|
6569
6512
|
* @returns A set of providers to setup a Router.
|
|
6570
6513
|
*/
|
|
6571
6514
|
function provideRouter(routes, ...features) {
|
|
6572
|
-
return [
|
|
6515
|
+
return makeEnvironmentProviders([
|
|
6573
6516
|
provideRoutes(routes), { provide: ActivatedRoute, useFactory: rootRoute, deps: [Router] },
|
|
6574
6517
|
{ provide: APP_BOOTSTRAP_LISTENER, multi: true, useFactory: getBootstrapListener },
|
|
6575
6518
|
features.map(feature => feature.ɵproviders),
|
|
@@ -6577,7 +6520,7 @@ function provideRouter(routes, ...features) {
|
|
|
6577
6520
|
// how we want them to be configured. This API doesn't currently have a way to configure them
|
|
6578
6521
|
// and we should decide what the _best_ way to do that is rather than just sticking with the
|
|
6579
6522
|
// status quo of how it's done today.
|
|
6580
|
-
];
|
|
6523
|
+
]);
|
|
6581
6524
|
}
|
|
6582
6525
|
function rootRoute(router) {
|
|
6583
6526
|
return router.routerState.root;
|
|
@@ -6945,7 +6888,7 @@ const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
|
6945
6888
|
/**
|
|
6946
6889
|
* The directives defined in the `RouterModule`.
|
|
6947
6890
|
*/
|
|
6948
|
-
const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink,
|
|
6891
|
+
const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent];
|
|
6949
6892
|
/**
|
|
6950
6893
|
* @docsNotRequired
|
|
6951
6894
|
*/
|
|
@@ -7048,10 +6991,10 @@ class RouterModule {
|
|
|
7048
6991
|
return { ngModule: RouterModule, providers: [provideRoutes(routes)] };
|
|
7049
6992
|
}
|
|
7050
6993
|
}
|
|
7051
|
-
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
7052
|
-
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-next.
|
|
7053
|
-
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
7054
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.
|
|
6994
|
+
RouterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterModule, deps: [{ token: ROUTER_FORROOT_GUARD, optional: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6995
|
+
RouterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterModule, imports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent], exports: [RouterOutlet, RouterLink, RouterLinkActive, ɵEmptyOutletComponent] });
|
|
6996
|
+
RouterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterModule, imports: [ɵEmptyOutletComponent] });
|
|
6997
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.6", ngImport: i0, type: RouterModule, decorators: [{
|
|
7055
6998
|
type: NgModule,
|
|
7056
6999
|
args: [{
|
|
7057
7000
|
imports: ROUTER_DIRECTIVES,
|
|
@@ -7137,7 +7080,7 @@ function provideRouterInitializer() {
|
|
|
7137
7080
|
/**
|
|
7138
7081
|
* @publicApi
|
|
7139
7082
|
*/
|
|
7140
|
-
const VERSION = new Version('15.0.0-next.
|
|
7083
|
+
const VERSION = new Version('15.0.0-next.6');
|
|
7141
7084
|
|
|
7142
7085
|
/**
|
|
7143
7086
|
* @license
|
|
@@ -7176,5 +7119,5 @@ const VERSION = new Version('15.0.0-next.4');
|
|
|
7176
7119
|
* Generated bundle index. Do not edit.
|
|
7177
7120
|
*/
|
|
7178
7121
|
|
|
7179
|
-
export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, TitleStrategy, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, createUrlTreeFromSnapshot, defaultUrlMatcher, provideRouter, provideRoutes, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withInMemoryScrolling, withPreloading, withRouterConfig, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, assignExtraOptionsToRouter as ɵassignExtraOptionsToRouter, flatten as ɵflatten, withPreloading as ɵwithPreloading };
|
|
7122
|
+
export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, NoPreloading, OutletContext, PRIMARY_OUTLET, PreloadAllModules, PreloadingStrategy, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTES, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterLink, RouterLinkActive, RouterLink as RouterLinkWithHref, RouterModule, RouterOutlet, RouterPreloader, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, TitleStrategy, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, convertToParamMap, createUrlTreeFromSnapshot, defaultUrlMatcher, provideRouter, provideRoutes, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withInMemoryScrolling, withPreloading, withRouterConfig, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, assignExtraOptionsToRouter as ɵassignExtraOptionsToRouter, flatten as ɵflatten, withPreloading as ɵwithPreloading };
|
|
7180
7123
|
//# sourceMappingURL=router.mjs.map
|